From dee22c3da174956eb4f96404bcb4b75a3161db35 Mon Sep 17 00:00:00 2001 From: lwj <674416404@qq.com> Date: Fri, 24 Apr 2026 23:43:03 +0800 Subject: [PATCH 01/40] =?UTF-8?q?feat(utils):=20=E6=B7=BB=E5=8A=A0=20GitHe?= =?UTF-8?q?lper=20=E7=B1=BB=E5=92=8C=E7=9B=B8=E5=85=B3=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refactor(github-helper): 重构 GithubHelper 类并改进错误处理 feat(upgrade-deps): 新增依赖升级工作流和工具 chore: 更新 pnpm 工作区配置和依赖 --- packages/close-release-issue/dist/index.mjs | 206 +- packages/upgrade-deps/dist/index.mjs | 30198 ++++++++++++++++++ packages/upgrade-deps/index.ts | 228 + packages/upgrade-deps/package.json | 22 + packages/upgrade-deps/tsdown.config.ts | 53 + packages/utils/constants.ts | 5 + packages/utils/git-helper.ts | 124 + packages/utils/github-helper.ts | 188 +- packages/utils/index.ts | 1 + packages/utils/package.json | 1 + pnpm-lock.yaml | 206 + pnpm-workspace.yaml | 4 +- 12 files changed, 31080 insertions(+), 156 deletions(-) create mode 100644 packages/upgrade-deps/dist/index.mjs create mode 100644 packages/upgrade-deps/index.ts create mode 100644 packages/upgrade-deps/package.json create mode 100644 packages/upgrade-deps/tsdown.config.ts create mode 100644 packages/utils/constants.ts create mode 100644 packages/utils/git-helper.ts diff --git a/packages/close-release-issue/dist/index.mjs b/packages/close-release-issue/dist/index.mjs index b93bbdc..b15d2c6 100644 --- a/packages/close-release-issue/dist/index.mjs +++ b/packages/close-release-issue/dist/index.mjs @@ -41,6 +41,23 @@ function toCommandValue(input) { else if (typeof input === "string" || input instanceof String) return input; return JSON.stringify(input); } +/** +* +* @param annotationProperties +* @returns The command properties to send with the actual annotation command +* See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646 +*/ +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 + }; +} //#endregion //#region ../../node_modules/.pnpm/@actions+core@3.0.0/node_modules/@actions/core/lib/command.js /** @@ -16104,6 +16121,14 @@ function debug(message) { issueCommand("debug", {}, message); } /** +* Adds an error issue +* @param message error issue message. Errors will be converted to string via toString() +* @param properties optional properties to add to the annotation. +*/ +function error(message, properties = {}) { + issueCommand("error", toCommandProperties(properties), message instanceof Error ? message.toString() : message); +} +/** * Writes info to log with console.log. * @param message info message */ @@ -19204,101 +19229,126 @@ function getOctokit(token, options, ...additionalPlugins) { var GithubHelper = class { octokit; context; - dryRun; constructor(context) { this.context = context; - this.dryRun = context.dryRun; this.octokit = getOctokit(context.token); } - async getPrData(pr_number) { - const { data } = await this.octokit.rest.pulls.get({ - owner: this.context.owner, - repo: this.context.repo, - pull_number: pr_number - }); - return data; - } - async getIssueData(issue_number) { - const { data } = await this.octokit.rest.issues.get({ - owner: this.context.owner, - repo: this.context.repo, - issue_number - }); - return data; + async dryRunLog(methodName, params) { + if (!this.context.dryRun) return false; + startGroup(`dry-run模式, 不运行${methodName}`); + for (const [key, value] of Object.entries(params)) info(`${key}: ${typeof value === "string" ? value : JSON.stringify(value)}`); + endGroup(); + return true; } - async getIssueList(params) { - const { data } = await this.octokit.rest.issues.listForRepo({ - ...params, + get defaultRepoParams() { + return { owner: this.context.owner, repo: this.context.repo - }); - return data.filter((item) => !item?.pull_request); + }; } - async closeIssue(issue_number) { - if (this.dryRun) { - startGroup("dry-run模式, 不运行closeIssue"); - info(`issue_number: ${issue_number}`); - endGroup(); - return; + async getPrData(prNumber) { + try { + const { data } = await this.octokit.rest.pulls.get({ + ...this.defaultRepoParams, + pull_number: prNumber + }); + return data; + } catch (error$3) { + error(`获取PR数据失败: ${error$3}`); + throw error$3; } - await this.octokit.rest.issues.update({ - owner: this.context.owner, - repo: this.context.repo, - issue_number, - state: "closed" - }); } - async createPR(title, head, body, base) { - if (this.dryRun) { - startGroup("dry-run模式, 不运行createPR"); - info(`title: ${title}`); - info(`head: ${head}`); - info(`base: ${base}`); - info(`body: ${body}`); - endGroup(); - return; + async getIssueData(issueNumber) { + try { + const { data } = await this.octokit.rest.issues.get({ + ...this.defaultRepoParams, + issue_number: issueNumber + }); + return data; + } catch (error$5) { + error(`获取Issue数据失败: ${error$5}`); + throw error$5; } - const { data } = await this.octokit.rest.pulls.create({ - owner: this.context.owner, - repo: this.context.repo, + } + async getIssueList(params) { + try { + const { data } = await this.octokit.rest.issues.listForRepo({ + ...params, + ...this.defaultRepoParams + }); + return data.filter((item) => !item?.pull_request); + } catch (error$4) { + error(`获取Issue列表失败: ${error$4}`); + throw error$4; + } + } + async closeIssue(issueNumber) { + if (await this.dryRunLog("closeIssue", { issueNumber })) return; + try { + await this.octokit.rest.issues.update({ + ...this.defaultRepoParams, + issue_number: issueNumber, + state: "closed" + }); + } catch (error$6) { + error(`关闭Issue失败: ${error$6}`); + throw error$6; + } + } + async createPR(title, head, body, base = "develop") { + if (await this.dryRunLog("createPR", { title, head, - base: base || "develop", + base, body - }); - return data; - } - async addComment(pr_number, body) { - if (this.dryRun) { - startGroup("dry-run模式, 不运行addComment"); - info(`pr_number: ${pr_number}`); - info(`body: ${body}`); - endGroup(); - return; + })) return; + try { + const { data } = await this.octokit.rest.pulls.create({ + ...this.defaultRepoParams, + title, + head, + base, + body + }); + return data; + } catch (error$1) { + error(`创建PR失败: ${error$1}`); + throw error$1; } - const { data } = await this.octokit.rest.issues.createComment({ - owner: this.context.owner, - repo: this.context.repo, - issue_number: pr_number, + } + async addComment(issueNumber, body) { + if (await this.dryRunLog("addComment", { + issueNumber, body - }); - return data; - } - async addLabels(pr_number, labels) { - if (this.dryRun) { - startGroup("dry-run模式, 不运行addLabels"); - info(`pr_number: ${pr_number}`); - info(`labels: ${labels.join(", ")}`); - endGroup(); - return; + })) return; + try { + const { data } = await this.octokit.rest.issues.createComment({ + ...this.defaultRepoParams, + issue_number: issueNumber, + body + }); + return data; + } catch (error$2) { + error(`添加评论失败: ${error$2}`); + throw error$2; + } + } + async addLabels(issueNumber, labels) { + if (await this.dryRunLog("addLabels", { + issueNumber, + labels: labels.join(", ") + })) return; + try { + const { data } = await this.octokit.rest.issues.addLabels({ + ...this.defaultRepoParams, + issue_number: issueNumber, + labels + }); + return data; + } catch (error$7) { + error(`添加标签失败: ${error$7}`); + throw error$7; } - const { data } = await this.octokit.rest.issues.addLabels({ - owner: this.context.owner, - repo: this.context.repo, - issue_number: pr_number, - labels - }); - return data; } }; //#endregion diff --git a/packages/upgrade-deps/dist/index.mjs b/packages/upgrade-deps/dist/index.mjs new file mode 100644 index 0000000..b8b4626 --- /dev/null +++ b/packages/upgrade-deps/dist/index.mjs @@ -0,0 +1,30198 @@ +import { createRequire } from "node:module"; +import * as os$1 from "os"; +import os, { EOL } from "os"; +import * as fs$3 from "fs"; +import { constants, existsSync, promises, readFileSync } from "fs"; +import * as path$2 from "path"; +import * as events from "events"; +import { fileURLToPath } from "node:url"; +import { StringDecoder } from "string_decoder"; +import * as child from "child_process"; +import { setTimeout as setTimeout$1 } from "timers"; +import * as fs from "node:fs/promises"; +import * as path from "node:path"; +//#region \0rolldown/runtime.js +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res); +var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports); +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) { + key = keys[i]; + if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { + get: ((k) => from[k]).bind(null, key), + enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable + }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { + value: mod, + enumerable: true +}) : target, mod)); +var __require = /* @__PURE__ */ createRequire(import.meta.url); +//#endregion +//#region ../../node_modules/.pnpm/@actions+core@3.0.0/node_modules/@actions/core/lib/utils.js +/** +* Sanitizes an input into a string so it can be passed into issueCommand safely +* @param input input to sanitize into a string +*/ +function toCommandValue(input) { + if (input === null || input === void 0) return ""; + else if (typeof input === "string" || input instanceof String) return input; + return JSON.stringify(input); +} +/** +* +* @param annotationProperties +* @returns The command properties to send with the actual annotation command +* See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646 +*/ +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 + }; +} +//#endregion +//#region ../../node_modules/.pnpm/@actions+core@3.0.0/node_modules/@actions/core/lib/command.js +/** +* Issues a command to the GitHub Actions runner +* +* @param command - The command name to issue +* @param properties - Additional properties for the command (key-value pairs) +* @param message - The message to include with the command +* @remarks +* This function outputs a specially formatted string to stdout that the Actions +* runner interprets as a command. These commands can control workflow behavior, +* set outputs, create annotations, mask values, and more. +* +* Command Format: +* ::name key=value,key=value::message +* +* @example +* ```typescript +* // Issue a warning annotation +* issueCommand('warning', {}, 'This is a warning message'); +* // Output: ::warning::This is a warning message +* +* // Set an environment variable +* issueCommand('set-env', { name: 'MY_VAR' }, 'some value'); +* // Output: ::set-env name=MY_VAR::some value +* +* // Add a secret mask +* issueCommand('add-mask', {}, 'secretValue123'); +* // Output: ::add-mask::secretValue123 +* ``` +* +* @internal +* This is an internal utility function that powers the public API functions +* such as setSecret, warning, error, and exportVariable. +*/ +function issueCommand(command, properties, message) { + const cmd = new Command(command, properties, message); + process.stdout.write(cmd.toString() + os$1.EOL); +} +function issue(name, message = "") { + issueCommand(name, {}, message); +} +const CMD_STRING = "::"; +var Command = class { + constructor(command, properties, message) { + if (!command) command = "missing.command"; + this.command = command; + 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 toCommandValue(s).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A"); +} +function escapeProperty(s) { + return toCommandValue(s).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A").replace(/:/g, "%3A").replace(/,/g, "%2C"); +} +//#endregion +//#region ../../node_modules/.pnpm/tunnel@0.0.6/node_modules/tunnel/lib/tunnel.js +var require_tunnel$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + __require("net"); + var tls = __require("tls"); + var http$2 = __require("http"); + var https$1 = __require("https"); + var events$1 = __require("events"); + __require("assert"); + var util$2 = __require("util"); + exports.httpOverHttp = httpOverHttp; + exports.httpsOverHttp = httpsOverHttp; + exports.httpOverHttps = httpOverHttps; + exports.httpsOverHttps = httpsOverHttps; + function httpOverHttp(options) { + var agent = new TunnelingAgent(options); + agent.request = http$2.request; + return agent; + } + function httpsOverHttp(options) { + var agent = new TunnelingAgent(options); + agent.request = http$2.request; + agent.createSocket = createSecureSocket; + agent.defaultPort = 443; + return agent; + } + function httpOverHttps(options) { + var agent = new TunnelingAgent(options); + agent.request = https$1.request; + return agent; + } + function httpsOverHttps(options) { + var agent = new TunnelingAgent(options); + agent.request = https$1.request; + agent.createSocket = createSecureSocket; + agent.defaultPort = 443; + return agent; + } + function TunnelingAgent(options) { + var self = this; + self.options = options || {}; + self.proxyOptions = self.options.proxy || {}; + self.maxSockets = self.options.maxSockets || http$2.Agent.defaultMaxSockets; + self.requests = []; + self.sockets = []; + self.on("free", function onFree(socket, host, port, localAddress) { + var options = toOptions(host, port, localAddress); + for (var i = 0, len = self.requests.length; i < len; ++i) { + var pending = self.requests[i]; + if (pending.host === options.host && pending.port === options.port) { + self.requests.splice(i, 1); + pending.request.onSocket(socket); + return; + } + } + socket.destroy(); + self.removeSocket(socket); + }); + } + util$2.inherits(TunnelingAgent, events$1.EventEmitter); + TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) { + var self = this; + var options = mergeOptions({ request: req }, self.options, toOptions(host, port, localAddress)); + if (self.sockets.length >= this.maxSockets) { + self.requests.push(options); + return; + } + self.createSocket(options, function(socket) { + socket.on("free", onFree); + socket.on("close", onCloseOrRemove); + socket.on("agentRemove", onCloseOrRemove); + req.onSocket(socket); + function onFree() { + self.emit("free", socket, options); + } + function onCloseOrRemove(err) { + self.removeSocket(socket); + socket.removeListener("free", onFree); + socket.removeListener("close", onCloseOrRemove); + socket.removeListener("agentRemove", onCloseOrRemove); + } + }); + }; + TunnelingAgent.prototype.createSocket = function createSocket(options, cb) { + var self = this; + var placeholder = {}; + self.sockets.push(placeholder); + var connectOptions = mergeOptions({}, self.proxyOptions, { + method: "CONNECT", + path: options.host + ":" + options.port, + agent: false, + headers: { host: options.host + ":" + options.port } + }); + if (options.localAddress) connectOptions.localAddress = options.localAddress; + if (connectOptions.proxyAuth) { + connectOptions.headers = connectOptions.headers || {}; + connectOptions.headers["Proxy-Authorization"] = "Basic " + new Buffer(connectOptions.proxyAuth).toString("base64"); + } + debug("making CONNECT request"); + var connectReq = self.request(connectOptions); + connectReq.useChunkedEncodingByDefault = false; + connectReq.once("response", onResponse); + connectReq.once("upgrade", onUpgrade); + connectReq.once("connect", onConnect); + connectReq.once("error", onError); + 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("tunneling socket could not be established, statusCode=%d", res.statusCode); + socket.destroy(); + var error = /* @__PURE__ */ new Error("tunneling socket could not be established, statusCode=" + res.statusCode); + error.code = "ECONNRESET"; + options.request.emit("error", error); + self.removeSocket(placeholder); + return; + } + if (head.length > 0) { + debug("got illegal response body from proxy"); + socket.destroy(); + var error = /* @__PURE__ */ new Error("got illegal response body from proxy"); + error.code = "ECONNRESET"; + options.request.emit("error", error); + self.removeSocket(placeholder); + return; + } + debug("tunneling connection has established"); + self.sockets[self.sockets.indexOf(placeholder)] = socket; + return cb(socket); + } + function onError(cause) { + connectReq.removeAllListeners(); + debug("tunneling socket could not be established, cause=%s\n", cause.message, cause.stack); + var error = /* @__PURE__ */ new Error("tunneling socket could not be established, cause=" + cause.message); + error.code = "ECONNRESET"; + options.request.emit("error", error); + self.removeSocket(placeholder); + } + }; + TunnelingAgent.prototype.removeSocket = function removeSocket(socket) { + var pos = this.sockets.indexOf(socket); + if (pos === -1) return; + this.sockets.splice(pos, 1); + var pending = this.requests.shift(); + if (pending) this.createSocket(pending, function(socket) { + pending.request.onSocket(socket); + }); + }; + function createSecureSocket(options, cb) { + var self = this; + TunnelingAgent.prototype.createSocket.call(self, options, function(socket) { + var hostHeader = options.request.getHeader("host"); + var tlsOptions = mergeOptions({}, self.options, { + socket, + servername: hostHeader ? hostHeader.replace(/:.*$/, "") : options.host + }); + var secureSocket = tls.connect(0, tlsOptions); + self.sockets[self.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; + if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) debug = 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 = function() {}; + exports.debug = debug; +})); +//#endregion +//#region ../../node_modules/.pnpm/tunnel@0.0.6/node_modules/tunnel/index.js +var require_tunnel = /* @__PURE__ */ __commonJSMin(((exports, module) => { + module.exports = require_tunnel$1(); +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/core/symbols.js +var require_symbols$4 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + module.exports = { + kClose: Symbol("close"), + kDestroy: Symbol("destroy"), + kDispatch: Symbol("dispatch"), + kUrl: Symbol("url"), + kWriting: Symbol("writing"), + kResuming: Symbol("resuming"), + kQueue: Symbol("queue"), + kConnect: Symbol("connect"), + kConnecting: Symbol("connecting"), + kKeepAliveDefaultTimeout: Symbol("default keep alive timeout"), + kKeepAliveMaxTimeout: Symbol("max keep alive timeout"), + kKeepAliveTimeoutThreshold: Symbol("keep alive timeout threshold"), + kKeepAliveTimeoutValue: Symbol("keep alive timeout"), + kKeepAlive: Symbol("keep alive"), + kHeadersTimeout: Symbol("headers timeout"), + kBodyTimeout: Symbol("body timeout"), + kServerName: Symbol("server name"), + kLocalAddress: Symbol("local address"), + kHost: Symbol("host"), + kNoRef: Symbol("no ref"), + kBodyUsed: Symbol("used"), + kBody: Symbol("abstracted request body"), + kRunning: Symbol("running"), + kBlocking: Symbol("blocking"), + kPending: Symbol("pending"), + kSize: Symbol("size"), + kBusy: Symbol("busy"), + kQueued: Symbol("queued"), + kFree: Symbol("free"), + kConnected: Symbol("connected"), + kClosed: Symbol("closed"), + kNeedDrain: Symbol("need drain"), + kReset: Symbol("reset"), + kDestroyed: Symbol.for("nodejs.stream.destroyed"), + kResume: Symbol("resume"), + kOnError: Symbol("on error"), + kMaxHeadersSize: Symbol("max headers size"), + kRunningIdx: Symbol("running index"), + kPendingIdx: Symbol("pending index"), + kError: Symbol("error"), + kClients: Symbol("clients"), + kClient: Symbol("client"), + kParser: Symbol("parser"), + kOnDestroyed: Symbol("destroy callbacks"), + kPipelining: Symbol("pipelining"), + kSocket: Symbol("socket"), + kHostHeader: Symbol("host header"), + kConnector: Symbol("connector"), + kStrictContentLength: Symbol("strict content length"), + kMaxRedirections: Symbol("maxRedirections"), + kMaxRequests: Symbol("maxRequestsPerClient"), + kProxy: Symbol("proxy agent options"), + kCounter: Symbol("socket request counter"), + kInterceptors: Symbol("dispatch interceptors"), + kMaxResponseSize: Symbol("max response size"), + kHTTP2Session: Symbol("http2Session"), + kHTTP2SessionState: Symbol("http2Session state"), + kRetryHandlerDefaultRetry: Symbol("retry agent default retry"), + kConstruct: Symbol("constructable"), + kListeners: Symbol("listeners"), + kHTTPContext: Symbol("http context"), + kMaxConcurrentStreams: Symbol("max concurrent streams"), + kNoProxyAgent: Symbol("no proxy agent"), + kHttpProxyAgent: Symbol("http proxy agent"), + kHttpsProxyAgent: Symbol("https proxy agent") + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/core/errors.js +var require_errors$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const kUndiciError = Symbol.for("undici.error.UND_ERR"); + var UndiciError = class extends Error { + constructor(message) { + super(message); + this.name = "UndiciError"; + this.code = "UND_ERR"; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kUndiciError] === true; + } + [kUndiciError] = true; + }; + const kConnectTimeoutError = Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT"); + var ConnectTimeoutError = class extends UndiciError { + constructor(message) { + super(message); + this.name = "ConnectTimeoutError"; + this.message = message || "Connect Timeout Error"; + this.code = "UND_ERR_CONNECT_TIMEOUT"; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kConnectTimeoutError] === true; + } + [kConnectTimeoutError] = true; + }; + const kHeadersTimeoutError = Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT"); + var HeadersTimeoutError = class extends UndiciError { + constructor(message) { + super(message); + this.name = "HeadersTimeoutError"; + this.message = message || "Headers Timeout Error"; + this.code = "UND_ERR_HEADERS_TIMEOUT"; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kHeadersTimeoutError] === true; + } + [kHeadersTimeoutError] = true; + }; + const kHeadersOverflowError = Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW"); + var HeadersOverflowError = class extends UndiciError { + constructor(message) { + super(message); + this.name = "HeadersOverflowError"; + this.message = message || "Headers Overflow Error"; + this.code = "UND_ERR_HEADERS_OVERFLOW"; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kHeadersOverflowError] === true; + } + [kHeadersOverflowError] = true; + }; + const kBodyTimeoutError = Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT"); + var BodyTimeoutError = class extends UndiciError { + constructor(message) { + super(message); + this.name = "BodyTimeoutError"; + this.message = message || "Body Timeout Error"; + this.code = "UND_ERR_BODY_TIMEOUT"; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kBodyTimeoutError] === true; + } + [kBodyTimeoutError] = true; + }; + const kResponseStatusCodeError = Symbol.for("undici.error.UND_ERR_RESPONSE_STATUS_CODE"); + var ResponseStatusCodeError = class extends UndiciError { + constructor(message, statusCode, headers, body) { + super(message); + this.name = "ResponseStatusCodeError"; + this.message = message || "Response Status Code Error"; + this.code = "UND_ERR_RESPONSE_STATUS_CODE"; + this.body = body; + this.status = statusCode; + this.statusCode = statusCode; + this.headers = headers; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kResponseStatusCodeError] === true; + } + [kResponseStatusCodeError] = true; + }; + const kInvalidArgumentError = Symbol.for("undici.error.UND_ERR_INVALID_ARG"); + var InvalidArgumentError = class extends UndiciError { + constructor(message) { + super(message); + this.name = "InvalidArgumentError"; + this.message = message || "Invalid Argument Error"; + this.code = "UND_ERR_INVALID_ARG"; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kInvalidArgumentError] === true; + } + [kInvalidArgumentError] = true; + }; + const kInvalidReturnValueError = Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE"); + var InvalidReturnValueError = class extends UndiciError { + constructor(message) { + super(message); + this.name = "InvalidReturnValueError"; + this.message = message || "Invalid Return Value Error"; + this.code = "UND_ERR_INVALID_RETURN_VALUE"; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kInvalidReturnValueError] === true; + } + [kInvalidReturnValueError] = true; + }; + const kAbortError = Symbol.for("undici.error.UND_ERR_ABORT"); + var AbortError = class extends UndiciError { + constructor(message) { + super(message); + this.name = "AbortError"; + this.message = message || "The operation was aborted"; + this.code = "UND_ERR_ABORT"; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kAbortError] === true; + } + [kAbortError] = true; + }; + const kRequestAbortedError = Symbol.for("undici.error.UND_ERR_ABORTED"); + var RequestAbortedError = class extends AbortError { + constructor(message) { + super(message); + this.name = "AbortError"; + this.message = message || "Request aborted"; + this.code = "UND_ERR_ABORTED"; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kRequestAbortedError] === true; + } + [kRequestAbortedError] = true; + }; + const kInformationalError = Symbol.for("undici.error.UND_ERR_INFO"); + var InformationalError = class extends UndiciError { + constructor(message) { + super(message); + this.name = "InformationalError"; + this.message = message || "Request information"; + this.code = "UND_ERR_INFO"; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kInformationalError] === true; + } + [kInformationalError] = true; + }; + const kRequestContentLengthMismatchError = Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"); + var RequestContentLengthMismatchError = class extends UndiciError { + constructor(message) { + super(message); + this.name = "RequestContentLengthMismatchError"; + this.message = message || "Request body length does not match content-length header"; + this.code = "UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kRequestContentLengthMismatchError] === true; + } + [kRequestContentLengthMismatchError] = true; + }; + const kResponseContentLengthMismatchError = Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH"); + var ResponseContentLengthMismatchError = class extends UndiciError { + constructor(message) { + super(message); + this.name = "ResponseContentLengthMismatchError"; + this.message = message || "Response body length does not match content-length header"; + this.code = "UND_ERR_RES_CONTENT_LENGTH_MISMATCH"; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kResponseContentLengthMismatchError] === true; + } + [kResponseContentLengthMismatchError] = true; + }; + const kClientDestroyedError = Symbol.for("undici.error.UND_ERR_DESTROYED"); + var ClientDestroyedError = class extends UndiciError { + constructor(message) { + super(message); + this.name = "ClientDestroyedError"; + this.message = message || "The client is destroyed"; + this.code = "UND_ERR_DESTROYED"; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kClientDestroyedError] === true; + } + [kClientDestroyedError] = true; + }; + const kClientClosedError = Symbol.for("undici.error.UND_ERR_CLOSED"); + var ClientClosedError = class extends UndiciError { + constructor(message) { + super(message); + this.name = "ClientClosedError"; + this.message = message || "The client is closed"; + this.code = "UND_ERR_CLOSED"; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kClientClosedError] === true; + } + [kClientClosedError] = true; + }; + const kSocketError = Symbol.for("undici.error.UND_ERR_SOCKET"); + var SocketError = class extends UndiciError { + constructor(message, socket) { + super(message); + this.name = "SocketError"; + this.message = message || "Socket error"; + this.code = "UND_ERR_SOCKET"; + this.socket = socket; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kSocketError] === true; + } + [kSocketError] = true; + }; + const kNotSupportedError = Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED"); + var NotSupportedError = class extends UndiciError { + constructor(message) { + super(message); + this.name = "NotSupportedError"; + this.message = message || "Not supported error"; + this.code = "UND_ERR_NOT_SUPPORTED"; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kNotSupportedError] === true; + } + [kNotSupportedError] = true; + }; + const kBalancedPoolMissingUpstreamError = Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM"); + var BalancedPoolMissingUpstreamError = class extends UndiciError { + constructor(message) { + super(message); + this.name = "MissingUpstreamError"; + this.message = message || "No upstream has been added to the BalancedPool"; + this.code = "UND_ERR_BPL_MISSING_UPSTREAM"; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kBalancedPoolMissingUpstreamError] === true; + } + [kBalancedPoolMissingUpstreamError] = true; + }; + const kHTTPParserError = Symbol.for("undici.error.UND_ERR_HTTP_PARSER"); + var HTTPParserError = class extends Error { + constructor(message, code, data) { + super(message); + this.name = "HTTPParserError"; + this.code = code ? `HPE_${code}` : void 0; + this.data = data ? data.toString() : void 0; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kHTTPParserError] === true; + } + [kHTTPParserError] = true; + }; + const kResponseExceededMaxSizeError = Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE"); + var ResponseExceededMaxSizeError = class extends UndiciError { + constructor(message) { + super(message); + this.name = "ResponseExceededMaxSizeError"; + this.message = message || "Response content exceeded max size"; + this.code = "UND_ERR_RES_EXCEEDED_MAX_SIZE"; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kResponseExceededMaxSizeError] === true; + } + [kResponseExceededMaxSizeError] = true; + }; + const kRequestRetryError = Symbol.for("undici.error.UND_ERR_REQ_RETRY"); + var RequestRetryError = class extends UndiciError { + constructor(message, code, { headers, data }) { + super(message); + this.name = "RequestRetryError"; + this.message = message || "Request retry error"; + this.code = "UND_ERR_REQ_RETRY"; + this.statusCode = code; + this.data = data; + this.headers = headers; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kRequestRetryError] === true; + } + [kRequestRetryError] = true; + }; + const kResponseError = Symbol.for("undici.error.UND_ERR_RESPONSE"); + var ResponseError = class extends UndiciError { + constructor(message, code, { headers, data }) { + super(message); + this.name = "ResponseError"; + this.message = message || "Response error"; + this.code = "UND_ERR_RESPONSE"; + this.statusCode = code; + this.data = data; + this.headers = headers; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kResponseError] === true; + } + [kResponseError] = true; + }; + const kSecureProxyConnectionError = Symbol.for("undici.error.UND_ERR_PRX_TLS"); + var SecureProxyConnectionError = class extends UndiciError { + constructor(cause, message, options) { + super(message, { + cause, + ...options ?? {} + }); + this.name = "SecureProxyConnectionError"; + this.message = message || "Secure Proxy Connection failed"; + this.code = "UND_ERR_PRX_TLS"; + this.cause = cause; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kSecureProxyConnectionError] === true; + } + [kSecureProxyConnectionError] = true; + }; + module.exports = { + AbortError, + HTTPParserError, + UndiciError, + HeadersTimeoutError, + HeadersOverflowError, + BodyTimeoutError, + RequestContentLengthMismatchError, + ConnectTimeoutError, + ResponseStatusCodeError, + InvalidArgumentError, + InvalidReturnValueError, + RequestAbortedError, + ClientDestroyedError, + ClientClosedError, + InformationalError, + SocketError, + NotSupportedError, + ResponseContentLengthMismatchError, + BalancedPoolMissingUpstreamError, + ResponseExceededMaxSizeError, + RequestRetryError, + ResponseError, + SecureProxyConnectionError + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/core/constants.js +var require_constants$4 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + /** @type {Record} */ + const headerNameLowerCasedRecord = {}; + 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[key] = headerNameLowerCasedRecord[lowerCasedKey] = lowerCasedKey; + } + Object.setPrototypeOf(headerNameLowerCasedRecord, null); + module.exports = { + wellknownHeaderNames, + headerNameLowerCasedRecord + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/core/tree.js +var require_tree = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { wellknownHeaderNames, headerNameLowerCasedRecord } = require_constants$4(); + var TstNode = class TstNode { + /** @type {any} */ + value = null; + /** @type {null | TstNode} */ + left = null; + /** @type {null | TstNode} */ + middle = null; + /** @type {null | TstNode} */ + right = null; + /** @type {number} */ + code; + /** + * @param {string} key + * @param {any} value + * @param {number} index + */ + constructor(key, value, index) { + if (index === void 0 || index >= key.length) throw new TypeError("Unreachable"); + if ((this.code = key.charCodeAt(index)) > 127) throw new TypeError("key must be ascii string"); + if (key.length !== ++index) this.middle = new TstNode(key, value, index); + else this.value = value; + } + /** + * @param {string} key + * @param {any} value + */ + add(key, value) { + const length = key.length; + if (length === 0) throw new TypeError("Unreachable"); + let index = 0; + let node = this; + while (true) { + const code = key.charCodeAt(index); + if (code > 127) throw new TypeError("key must be ascii string"); + if (node.code === code) if (length === ++index) { + node.value = value; + break; + } else if (node.middle !== null) node = node.middle; + else { + node.middle = new TstNode(key, value, index); + break; + } + else if (node.code < code) if (node.left !== null) node = node.left; + else { + node.left = new TstNode(key, value, index); + break; + } + else if (node.right !== null) node = node.right; + else { + node.right = new TstNode(key, value, index); + break; + } + } + } + /** + * @param {Uint8Array} key + * @return {TstNode | null} + */ + search(key) { + const keylength = key.length; + let index = 0; + let node = this; + while (node !== null && index < keylength) { + let code = key[index]; + if (code <= 90 && code >= 65) code |= 32; + while (node !== null) { + if (code === node.code) { + if (keylength === ++index) return node; + node = node.middle; + break; + } + node = node.code < code ? node.left : node.right; + } + } + return null; + } + }; + var TernarySearchTree = class { + /** @type {TstNode | null} */ + node = null; + /** + * @param {string} key + * @param {any} value + * */ + insert(key, value) { + if (this.node === null) this.node = new TstNode(key, value, 0); + else this.node.add(key, value); + } + /** + * @param {Uint8Array} key + * @return {any} + */ + lookup(key) { + return this.node?.search(key)?.value ?? null; + } + }; + const tree = new TernarySearchTree(); + for (let i = 0; i < wellknownHeaderNames.length; ++i) { + const key = headerNameLowerCasedRecord[wellknownHeaderNames[i]]; + tree.insert(key, key); + } + module.exports = { + TernarySearchTree, + tree + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/core/util.js +var require_util$7 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const assert$26 = __require("node:assert"); + const { kDestroyed, kBodyUsed, kListeners, kBody } = require_symbols$4(); + const { IncomingMessage } = __require("node:http"); + const stream = __require("node:stream"); + const net$2 = __require("node:net"); + const { Blob: Blob$3 } = __require("node:buffer"); + const nodeUtil$3 = __require("node:util"); + const { stringify } = __require("node:querystring"); + const { EventEmitter: EE$2 } = __require("node:events"); + const { InvalidArgumentError } = require_errors$1(); + const { headerNameLowerCasedRecord } = require_constants$4(); + const { tree } = require_tree(); + const [nodeMajor, nodeMinor] = process.versions.node.split(".").map((v) => Number(v)); + var BodyAsyncIterable = class { + constructor(body) { + this[kBody] = body; + this[kBodyUsed] = false; + } + async *[Symbol.asyncIterator]() { + assert$26(!this[kBodyUsed], "disturbed"); + this[kBodyUsed] = true; + yield* this[kBody]; + } + }; + function wrapRequestBody(body) { + if (isStream(body)) { + if (bodyLength(body) === 0) body.on("data", function() { + assert$26(false); + }); + if (typeof body.readableDidRead !== "boolean") { + body[kBodyUsed] = false; + EE$2.prototype.on.call(body, "data", function() { + this[kBodyUsed] = true; + }); + } + return body; + } else if (body && typeof body.pipeTo === "function") return new BodyAsyncIterable(body); + else if (body && typeof body !== "string" && !ArrayBuffer.isView(body) && isIterable(body)) return new BodyAsyncIterable(body); + else return body; + } + function nop() {} + function isStream(obj) { + return obj && typeof obj === "object" && typeof obj.pipe === "function" && typeof obj.on === "function"; + } + function isBlobLike(object) { + if (object === null) return false; + else if (object instanceof Blob$3) return true; + else if (typeof object !== "object") return false; + else { + const sTag = object[Symbol.toStringTag]; + return (sTag === "Blob" || sTag === "File") && ("stream" in object && typeof object.stream === "function" || "arrayBuffer" in object && typeof object.arrayBuffer === "function"); + } + } + function buildURL(url, queryParams) { + if (url.includes("?") || url.includes("#")) throw new Error("Query params cannot be passed when url already contains \"?\" or \"#\"."); + const stringified = stringify(queryParams); + if (stringified) url += "?" + stringified; + return url; + } + function isValidPort(port) { + const value = parseInt(port, 10); + return value === Number(port) && value >= 0 && value <= 65535; + } + function isHttpOrHttpsPrefixed(value) { + return value != null && value[0] === "h" && value[1] === "t" && value[2] === "t" && value[3] === "p" && (value[4] === ":" || value[4] === "s" && value[5] === ":"); + } + function parseURL(url) { + if (typeof url === "string") { + url = new URL(url); + if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); + return url; + } + if (!url || typeof url !== "object") throw new InvalidArgumentError("Invalid URL: The URL argument must be a non-null object."); + if (!(url instanceof URL)) { + if (url.port != null && url.port !== "" && isValidPort(url.port) === false) throw new InvalidArgumentError("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("Invalid URL path: the path must be a string or null/undefined."); + if (url.pathname != null && typeof url.pathname !== "string") throw new InvalidArgumentError("Invalid URL pathname: the pathname must be a string or null/undefined."); + if (url.hostname != null && typeof url.hostname !== "string") throw new InvalidArgumentError("Invalid URL hostname: the hostname must be a string or null/undefined."); + if (url.origin != null && typeof url.origin !== "string") throw new InvalidArgumentError("Invalid URL origin: the origin must be a string or null/undefined."); + if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); + 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 path = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`; + if (origin[origin.length - 1] === "/") origin = origin.slice(0, origin.length - 1); + if (path && path[0] !== "/") path = `/${path}`; + return new URL(`${origin}${path}`); + } + if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); + return url; + } + function parseOrigin(url) { + url = parseURL(url); + if (url.pathname !== "/" || url.search || url.hash) throw new InvalidArgumentError("invalid url"); + return url; + } + function getHostname(host) { + if (host[0] === "[") { + const idx = host.indexOf("]"); + assert$26(idx !== -1); + return host.substring(1, idx); + } + const idx = host.indexOf(":"); + if (idx === -1) return host; + return host.substring(0, idx); + } + function getServerName(host) { + if (!host) return null; + assert$26(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(body) { + if (body == null) return 0; + else if (isStream(body)) { + const state = body._readableState; + return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length) ? state.length : null; + } else if (isBlobLike(body)) return body.size != null ? body.size : null; + else if (isBuffer(body)) return body.byteLength; + return null; + } + function isDestroyed(body) { + return body && !!(body.destroyed || body[kDestroyed] || stream.isDestroyed?.(body)); + } + function destroy(stream, err) { + if (stream == null || !isStream(stream) || isDestroyed(stream)) return; + if (typeof stream.destroy === "function") { + if (Object.getPrototypeOf(stream).constructor === IncomingMessage) stream.socket = null; + stream.destroy(err); + } else if (err) queueMicrotask(() => { + stream.emit("error", err); + }); + if (stream.destroyed !== true) stream[kDestroyed] = 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; + } + /** + * Retrieves a header name and returns its lowercase value. + * @param {string | Buffer} value Header name + * @returns {string} + */ + function headerNameToString(value) { + return typeof value === "string" ? headerNameLowerCasedRecord[value] ?? value.toLowerCase() : tree.lookup(value) ?? value.toString("latin1").toLowerCase(); + } + /** + * Receive the buffer as a string and return its lowercase value. + * @param {Buffer} value Header name + * @returns {string} + */ + function bufferToLowerCasedHeaderName(value) { + return tree.lookup(value) ?? value.toString("latin1").toLowerCase(); + } + /** + * @param {Record | (Buffer | string | (Buffer | string)[])[]} headers + * @param {Record} [obj] + * @returns {Record} + */ + function parseHeaders(headers, obj) { + if (obj === void 0) obj = {}; + for (let i = 0; i < headers.length; i += 2) { + const key = headerNameToString(headers[i]); + let val = obj[key]; + if (val) { + if (typeof val === "string") { + val = [val]; + obj[key] = val; + } + val.push(headers[i + 1].toString("utf8")); + } else { + const headersValue = headers[i + 1]; + if (typeof headersValue === "string") obj[key] = headersValue; + else obj[key] = Array.isArray(headersValue) ? headersValue.map((x) => x.toString("utf8")) : headersValue.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(headers) { + const len = headers.length; + const ret = new Array(len); + let hasContentLength = false; + let contentDispositionIdx = -1; + let key; + let val; + let kLen = 0; + for (let n = 0; n < headers.length; n += 2) { + key = headers[n]; + val = headers[n + 1]; + typeof key !== "string" && (key = key.toString()); + typeof val !== "string" && (val = val.toString("utf8")); + kLen = key.length; + if (kLen === 14 && key[7] === "-" && (key === "content-length" || key.toLowerCase() === "content-length")) hasContentLength = true; + else if (kLen === 19 && key[7] === "-" && (key === "content-disposition" || key.toLowerCase() === "content-disposition")) contentDispositionIdx = n + 1; + ret[n] = key; + ret[n + 1] = 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(handler, method, upgrade) { + if (!handler || typeof handler !== "object") throw new InvalidArgumentError("handler must be an object"); + if (typeof handler.onConnect !== "function") throw new InvalidArgumentError("invalid onConnect method"); + if (typeof handler.onError !== "function") throw new InvalidArgumentError("invalid onError method"); + if (typeof handler.onBodySent !== "function" && handler.onBodySent !== void 0) throw new InvalidArgumentError("invalid onBodySent method"); + if (upgrade || method === "CONNECT") { + if (typeof handler.onUpgrade !== "function") throw new InvalidArgumentError("invalid onUpgrade method"); + } else { + if (typeof handler.onHeaders !== "function") throw new InvalidArgumentError("invalid onHeaders method"); + if (typeof handler.onData !== "function") throw new InvalidArgumentError("invalid onData method"); + if (typeof handler.onComplete !== "function") throw new InvalidArgumentError("invalid onComplete method"); + } + } + function isDisturbed(body) { + return !!(body && (stream.isDisturbed(body) || body[kBodyUsed])); + } + function isErrored(body) { + return !!(body && stream.isErrored(body)); + } + function isReadable(body) { + return !!(body && stream.isReadable(body)); + } + 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 + }; + } + /** @type {globalThis['ReadableStream']} */ + function ReadableStreamFrom(iterable) { + let iterator; + return new ReadableStream({ + async start() { + iterator = iterable[Symbol.asyncIterator](); + }, + async pull(controller) { + const { done, value } = await iterator.next(); + if (done) queueMicrotask(() => { + controller.close(); + controller.byobRequest?.respond(0); + }); + else { + const buf = Buffer.isBuffer(value) ? value : Buffer.from(value); + if (buf.byteLength) controller.enqueue(new Uint8Array(buf)); + } + return controller.desiredSize > 0; + }, + async cancel(reason) { + await iterator.return(); + }, + type: "bytes" + }); + } + 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 addAbortListener(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 = typeof String.prototype.toWellFormed === "function"; + const hasIsWellFormed = typeof String.prototype.isWellFormed === "function"; + /** + * @param {string} val + */ + function toUSVString(val) { + return hasToWellFormed ? `${val}`.toWellFormed() : nodeUtil$3.toUSVString(val); + } + /** + * @param {string} val + */ + function isUSVString(val) { + return hasIsWellFormed ? `${val}`.isWellFormed() : toUSVString(val) === `${val}`; + } + /** + * @see https://tools.ietf.org/html/rfc7230#section-3.2.6 + * @param {number} c + */ + 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; + } + } + /** + * @param {string} characters + */ + 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; + } + /** + * Matches if val contains an invalid field-vchar + * field-value = *( field-content / obs-fold ) + * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ] + * field-vchar = VCHAR / obs-text + */ + const headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/; + /** + * @param {string} characters + */ + function isValidHeaderValue(characters) { + return !headerCharRegex.test(characters); + } + function parseRangeHeader(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; + } + function addListener(obj, name, listener) { + (obj[kListeners] ??= []).push([name, listener]); + obj.on(name, listener); + return obj; + } + function removeAllListeners(obj) { + for (const [name, listener] of obj[kListeners] ?? []) obj.removeListener(name, listener); + obj[kListeners] = null; + } + function errorRequest(client, request, err) { + try { + request.onError(err); + assert$26(request.aborted); + } catch (err) { + client.emit("error", err); + } + } + const kEnumerableProperty = Object.create(null); + kEnumerableProperty.enumerable = true; + const normalizedMethodRecordsBase = { + delete: "DELETE", + DELETE: "DELETE", + get: "GET", + GET: "GET", + head: "HEAD", + HEAD: "HEAD", + options: "OPTIONS", + OPTIONS: "OPTIONS", + post: "POST", + POST: "POST", + put: "PUT", + PUT: "PUT" + }; + const normalizedMethodRecords = { + ...normalizedMethodRecordsBase, + patch: "patch", + PATCH: "PATCH" + }; + Object.setPrototypeOf(normalizedMethodRecordsBase, null); + Object.setPrototypeOf(normalizedMethodRecords, null); + module.exports = { + kEnumerableProperty, + nop, + isDisturbed, + isErrored, + isReadable, + toUSVString, + isUSVString, + isBlobLike, + parseOrigin, + parseURL, + getServerName, + isStream, + isIterable, + isAsyncIterable, + isDestroyed, + headerNameToString, + bufferToLowerCasedHeaderName, + addListener, + removeAllListeners, + errorRequest, + parseRawHeaders, + parseHeaders, + parseKeepAliveTimeout, + destroy, + bodyLength, + deepClone, + ReadableStreamFrom, + isBuffer, + validateHandler, + getSocketInfo, + isFormDataLike, + buildURL, + addAbortListener, + isValidHTTPToken, + isValidHeaderValue, + isTokenCharCode, + parseRangeHeader, + normalizedMethodRecordsBase, + normalizedMethodRecords, + isValidPort, + isHttpOrHttpsPrefixed, + nodeMajor, + nodeMinor, + safeHTTPMethods: [ + "GET", + "HEAD", + "OPTIONS", + "TRACE" + ], + wrapRequestBody + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/core/diagnostics.js +var require_diagnostics = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const diagnosticsChannel = __require("node:diagnostics_channel"); + const util$1 = __require("node:util"); + const undiciDebugLog = util$1.debuglog("undici"); + const fetchDebuglog = util$1.debuglog("fetch"); + const websocketDebuglog = util$1.debuglog("websocket"); + let isClientSet = false; + const channels = { + beforeConnect: diagnosticsChannel.channel("undici:client:beforeConnect"), + connected: diagnosticsChannel.channel("undici:client:connected"), + connectError: diagnosticsChannel.channel("undici:client:connectError"), + sendHeaders: diagnosticsChannel.channel("undici:client:sendHeaders"), + create: diagnosticsChannel.channel("undici:request:create"), + bodySent: diagnosticsChannel.channel("undici:request:bodySent"), + headers: diagnosticsChannel.channel("undici:request:headers"), + trailers: diagnosticsChannel.channel("undici:request:trailers"), + error: diagnosticsChannel.channel("undici:request:error"), + open: diagnosticsChannel.channel("undici:websocket:open"), + close: diagnosticsChannel.channel("undici:websocket:close"), + socketError: diagnosticsChannel.channel("undici:websocket:socket_error"), + ping: diagnosticsChannel.channel("undici:websocket:ping"), + pong: diagnosticsChannel.channel("undici:websocket:pong") + }; + if (undiciDebugLog.enabled || fetchDebuglog.enabled) { + const debuglog = fetchDebuglog.enabled ? fetchDebuglog : undiciDebugLog; + diagnosticsChannel.channel("undici:client:beforeConnect").subscribe((evt) => { + const { connectParams: { version, protocol, port, host } } = evt; + debuglog("connecting to %s using %s%s", `${host}${port ? `:${port}` : ""}`, protocol, version); + }); + diagnosticsChannel.channel("undici:client:connected").subscribe((evt) => { + const { connectParams: { version, protocol, port, host } } = evt; + debuglog("connected to %s using %s%s", `${host}${port ? `:${port}` : ""}`, protocol, version); + }); + diagnosticsChannel.channel("undici:client:connectError").subscribe((evt) => { + const { connectParams: { version, protocol, port, host }, error } = evt; + debuglog("connection to %s using %s%s errored - %s", `${host}${port ? `:${port}` : ""}`, protocol, version, error.message); + }); + diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { + const { request: { method, path, origin } } = evt; + debuglog("sending request to %s %s/%s", method, origin, path); + }); + diagnosticsChannel.channel("undici:request:headers").subscribe((evt) => { + const { request: { method, path, origin }, response: { statusCode } } = evt; + debuglog("received response to %s %s/%s - HTTP %d", method, origin, path, statusCode); + }); + diagnosticsChannel.channel("undici:request:trailers").subscribe((evt) => { + const { request: { method, path, origin } } = evt; + debuglog("trailers received from %s %s/%s", method, origin, path); + }); + diagnosticsChannel.channel("undici:request:error").subscribe((evt) => { + const { request: { method, path, origin }, error } = evt; + debuglog("request to %s %s/%s errored - %s", method, origin, path, error.message); + }); + isClientSet = true; + } + if (websocketDebuglog.enabled) { + if (!isClientSet) { + const debuglog = undiciDebugLog.enabled ? undiciDebugLog : websocketDebuglog; + diagnosticsChannel.channel("undici:client:beforeConnect").subscribe((evt) => { + const { connectParams: { version, protocol, port, host } } = evt; + debuglog("connecting to %s%s using %s%s", host, port ? `:${port}` : "", protocol, version); + }); + diagnosticsChannel.channel("undici:client:connected").subscribe((evt) => { + const { connectParams: { version, protocol, port, host } } = evt; + debuglog("connected to %s%s using %s%s", host, port ? `:${port}` : "", protocol, version); + }); + diagnosticsChannel.channel("undici:client:connectError").subscribe((evt) => { + const { connectParams: { version, protocol, port, host }, error } = evt; + debuglog("connection to %s%s using %s%s errored - %s", host, port ? `:${port}` : "", protocol, version, error.message); + }); + diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { + const { request: { method, path, origin } } = evt; + debuglog("sending request to %s %s/%s", method, origin, path); + }); + } + diagnosticsChannel.channel("undici:websocket:open").subscribe((evt) => { + const { address: { address, port } } = evt; + websocketDebuglog("connection opened %s%s", address, port ? `:${port}` : ""); + }); + diagnosticsChannel.channel("undici:websocket:close").subscribe((evt) => { + const { websocket, code, reason } = evt; + websocketDebuglog("closed connection to %s - %s %s", websocket.url, code, reason); + }); + diagnosticsChannel.channel("undici:websocket:socket_error").subscribe((err) => { + websocketDebuglog("connection errored - %s", err.message); + }); + diagnosticsChannel.channel("undici:websocket:ping").subscribe((evt) => { + websocketDebuglog("ping received"); + }); + diagnosticsChannel.channel("undici:websocket:pong").subscribe((evt) => { + websocketDebuglog("pong received"); + }); + } + module.exports = { channels }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/core/request.js +var require_request$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { InvalidArgumentError, NotSupportedError } = require_errors$1(); + const assert$25 = __require("node:assert"); + const { isValidHTTPToken, isValidHeaderValue, isStream, destroy, isBuffer, isFormDataLike, isIterable, isBlobLike, buildURL, validateHandler, getServerName, normalizedMethodRecords } = require_util$7(); + const { channels } = require_diagnostics(); + const { headerNameLowerCasedRecord } = require_constants$4(); + const invalidPathRegex = /[^\u0021-\u00ff]/; + const kHandler = Symbol("handler"); + var Request = class { + constructor(origin, { path, method, body, headers, query, idempotent, blocking, upgrade, headersTimeout, bodyTimeout, reset, throwOnError, expectContinue, servername }, handler) { + if (typeof path !== "string") throw new InvalidArgumentError("path must be a string"); + else if (path[0] !== "/" && !(path.startsWith("http://") || path.startsWith("https://")) && method !== "CONNECT") throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); + else if (invalidPathRegex.test(path)) throw new InvalidArgumentError("invalid request path"); + if (typeof method !== "string") throw new InvalidArgumentError("method must be a string"); + else if (normalizedMethodRecords[method] === void 0 && !isValidHTTPToken(method)) throw new InvalidArgumentError("invalid request method"); + if (upgrade && typeof upgrade !== "string") throw new InvalidArgumentError("upgrade must be a string"); + if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) throw new InvalidArgumentError("invalid headersTimeout"); + if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) throw new InvalidArgumentError("invalid bodyTimeout"); + if (reset != null && typeof reset !== "boolean") throw new InvalidArgumentError("invalid reset"); + if (expectContinue != null && typeof expectContinue !== "boolean") throw new InvalidArgumentError("invalid expectContinue"); + this.headersTimeout = headersTimeout; + this.bodyTimeout = bodyTimeout; + this.throwOnError = throwOnError === true; + this.method = method; + this.abort = null; + if (body == null) this.body = null; + else if (isStream(body)) { + this.body = body; + const rState = this.body._readableState; + if (!rState || !rState.autoDestroy) { + this.endHandler = function autoDestroy() { + 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 (isBuffer(body)) this.body = body.byteLength ? body : null; + else if (ArrayBuffer.isView(body)) this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null; + else if (body instanceof ArrayBuffer) this.body = body.byteLength ? Buffer.from(body) : null; + else if (typeof body === "string") this.body = body.length ? Buffer.from(body) : null; + else if (isFormDataLike(body) || isIterable(body) || isBlobLike(body)) this.body = body; + else throw new InvalidArgumentError("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable"); + this.completed = false; + this.aborted = false; + this.upgrade = upgrade || null; + this.path = query ? buildURL(path, query) : path; + 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(headers)) { + if (headers.length % 2 !== 0) throw new InvalidArgumentError("headers array must be even"); + for (let i = 0; i < headers.length; i += 2) processHeader(this, headers[i], headers[i + 1]); + } else if (headers && typeof headers === "object") if (headers[Symbol.iterator]) for (const header of headers) { + if (!Array.isArray(header) || header.length !== 2) throw new InvalidArgumentError("headers must be in key-value pair format"); + processHeader(this, header[0], header[1]); + } + else { + const keys = Object.keys(headers); + for (let i = 0; i < keys.length; ++i) processHeader(this, keys[i], headers[keys[i]]); + } + else if (headers != null) throw new InvalidArgumentError("headers must be an object or an array"); + validateHandler(handler, method, upgrade); + this.servername = servername || getServerName(this.host); + this[kHandler] = handler; + if (channels.create.hasSubscribers) channels.create.publish({ request: this }); + } + onBodySent(chunk) { + if (this[kHandler].onBodySent) try { + return this[kHandler].onBodySent(chunk); + } catch (err) { + this.abort(err); + } + } + onRequestSent() { + if (channels.bodySent.hasSubscribers) channels.bodySent.publish({ request: this }); + if (this[kHandler].onRequestSent) try { + return this[kHandler].onRequestSent(); + } catch (err) { + this.abort(err); + } + } + onConnect(abort) { + assert$25(!this.aborted); + assert$25(!this.completed); + if (this.error) abort(this.error); + else { + this.abort = abort; + return this[kHandler].onConnect(abort); + } + } + onResponseStarted() { + return this[kHandler].onResponseStarted?.(); + } + onHeaders(statusCode, headers, resume, statusText) { + assert$25(!this.aborted); + assert$25(!this.completed); + if (channels.headers.hasSubscribers) channels.headers.publish({ + request: this, + response: { + statusCode, + headers, + statusText + } + }); + try { + return this[kHandler].onHeaders(statusCode, headers, resume, statusText); + } catch (err) { + this.abort(err); + } + } + onData(chunk) { + assert$25(!this.aborted); + assert$25(!this.completed); + try { + return this[kHandler].onData(chunk); + } catch (err) { + this.abort(err); + return false; + } + } + onUpgrade(statusCode, headers, socket) { + assert$25(!this.aborted); + assert$25(!this.completed); + return this[kHandler].onUpgrade(statusCode, headers, socket); + } + onComplete(trailers) { + this.onFinally(); + assert$25(!this.aborted); + this.completed = true; + if (channels.trailers.hasSubscribers) channels.trailers.publish({ + request: this, + trailers + }); + try { + return this[kHandler].onComplete(trailers); + } catch (err) { + this.onError(err); + } + } + onError(error) { + this.onFinally(); + if (channels.error.hasSubscribers) channels.error.publish({ + request: this, + error + }); + if (this.aborted) return; + this.aborted = true; + return this[kHandler].onError(error); + } + onFinally() { + if (this.errorHandler) { + this.body.off("error", this.errorHandler); + this.errorHandler = null; + } + if (this.endHandler) { + this.body.off("end", this.endHandler); + this.endHandler = null; + } + } + addHeader(key, value) { + processHeader(this, key, value); + return this; + } + }; + function processHeader(request, key, val) { + if (val && typeof val === "object" && !Array.isArray(val)) throw new InvalidArgumentError(`invalid ${key} header`); + else if (val === void 0) return; + let headerName = headerNameLowerCasedRecord[key]; + if (headerName === void 0) { + headerName = key.toLowerCase(); + if (headerNameLowerCasedRecord[headerName] === void 0 && !isValidHTTPToken(headerName)) throw new InvalidArgumentError("invalid header key"); + } + if (Array.isArray(val)) { + const arr = []; + for (let i = 0; i < val.length; i++) if (typeof val[i] === "string") { + if (!isValidHeaderValue(val[i])) throw new InvalidArgumentError(`invalid ${key} header`); + arr.push(val[i]); + } else if (val[i] === null) arr.push(""); + else if (typeof val[i] === "object") throw new InvalidArgumentError(`invalid ${key} header`); + else arr.push(`${val[i]}`); + val = arr; + } else if (typeof val === "string") { + if (!isValidHeaderValue(val)) throw new InvalidArgumentError(`invalid ${key} header`); + } else if (val === null) val = ""; + else val = `${val}`; + if (request.host === null && headerName === "host") { + if (typeof val !== "string") throw new InvalidArgumentError("invalid host header"); + request.host = val; + } else if (request.contentLength === null && headerName === "content-length") { + request.contentLength = parseInt(val, 10); + if (!Number.isFinite(request.contentLength)) throw new InvalidArgumentError("invalid content-length header"); + } else if (request.contentType === null && headerName === "content-type") { + request.contentType = val; + request.headers.push(key, val); + } else if (headerName === "transfer-encoding" || headerName === "keep-alive" || headerName === "upgrade") throw new InvalidArgumentError(`invalid ${headerName} header`); + else if (headerName === "connection") { + const value = typeof val === "string" ? val.toLowerCase() : null; + if (value !== "close" && value !== "keep-alive") throw new InvalidArgumentError("invalid connection header"); + if (value === "close") request.reset = true; + } else if (headerName === "expect") throw new NotSupportedError("expect header not supported"); + else request.headers.push(key, val); + } + module.exports = Request; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/dispatcher/dispatcher.js +var require_dispatcher = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const EventEmitter = __require("node:events"); + var Dispatcher = class extends EventEmitter { + dispatch() { + throw new Error("not implemented"); + } + close() { + throw new Error("not implemented"); + } + destroy() { + throw new Error("not implemented"); + } + compose(...args) { + const interceptors = Array.isArray(args[0]) ? args[0] : args; + let dispatch = this.dispatch.bind(this); + for (const interceptor of interceptors) { + if (interceptor == null) continue; + if (typeof interceptor !== "function") throw new TypeError(`invalid interceptor, expected function received ${typeof interceptor}`); + dispatch = interceptor(dispatch); + if (dispatch == null || typeof dispatch !== "function" || dispatch.length !== 2) throw new TypeError("invalid interceptor"); + } + return new ComposedDispatcher(this, dispatch); + } + }; + var ComposedDispatcher = class extends Dispatcher { + #dispatcher = null; + #dispatch = null; + constructor(dispatcher, dispatch) { + super(); + this.#dispatcher = dispatcher; + this.#dispatch = dispatch; + } + dispatch(...args) { + this.#dispatch(...args); + } + close(...args) { + return this.#dispatcher.close(...args); + } + destroy(...args) { + return this.#dispatcher.destroy(...args); + } + }; + module.exports = Dispatcher; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/dispatcher/dispatcher-base.js +var require_dispatcher_base = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const Dispatcher = require_dispatcher(); + const { ClientDestroyedError, ClientClosedError, InvalidArgumentError } = require_errors$1(); + const { kDestroy, kClose, kClosed, kDestroyed, kDispatch, kInterceptors } = require_symbols$4(); + const kOnDestroyed = Symbol("onDestroyed"); + const kOnClosed = Symbol("onClosed"); + const kInterceptedDispatch = Symbol("Intercepted Dispatch"); + var DispatcherBase = class extends Dispatcher { + 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]; + } + set interceptors(newInterceptors) { + if (newInterceptors) { + for (let i = newInterceptors.length - 1; i >= 0; i--) if (typeof this[kInterceptors][i] !== "function") throw new InvalidArgumentError("interceptor must be an function"); + } + this[kInterceptors] = 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("invalid callback"); + if (this[kDestroyed]) { + queueMicrotask(() => callback(new ClientDestroyedError(), 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]().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, (err, data) => { + return err ? reject(err) : resolve(data); + }); + }); + if (typeof callback !== "function") throw new InvalidArgumentError("invalid callback"); + if (this[kDestroyed]) { + if (this[kOnDestroyed]) this[kOnDestroyed].push(callback); + else queueMicrotask(() => callback(null, null)); + return; + } + if (!err) err = new ClientDestroyedError(); + 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](err).then(() => { + queueMicrotask(onDestroyed); + }); + } + [kInterceptedDispatch](opts, handler) { + if (!this[kInterceptors] || this[kInterceptors].length === 0) { + this[kInterceptedDispatch] = this[kDispatch]; + return this[kDispatch](opts, handler); + } + let dispatch = this[kDispatch].bind(this); + for (let i = this[kInterceptors].length - 1; i >= 0; i--) dispatch = this[kInterceptors][i](dispatch); + this[kInterceptedDispatch] = dispatch; + return dispatch(opts, handler); + } + dispatch(opts, handler) { + if (!handler || typeof handler !== "object") throw new InvalidArgumentError("handler must be an object"); + try { + if (!opts || typeof opts !== "object") throw new InvalidArgumentError("opts must be an object."); + if (this[kDestroyed] || this[kOnDestroyed]) throw new ClientDestroyedError(); + if (this[kClosed]) throw new ClientClosedError(); + return this[kInterceptedDispatch](opts, handler); + } catch (err) { + if (typeof handler.onError !== "function") throw new InvalidArgumentError("invalid onError method"); + handler.onError(err); + return false; + } + } + }; + module.exports = DispatcherBase; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/util/timers.js +var require_timers = /* @__PURE__ */ __commonJSMin(((exports, module) => { + /** + * This module offers an optimized timer implementation designed for scenarios + * where high precision is not critical. + * + * The timer achieves faster performance by using a low-resolution approach, + * with an accuracy target of within 500ms. This makes it particularly useful + * for timers with delays of 1 second or more, where exact timing is less + * crucial. + * + * It's important to note that Node.js timers are inherently imprecise, as + * delays can occur due to the event loop being blocked by other operations. + * Consequently, timers may trigger later than their scheduled time. + */ + /** + * The fastNow variable contains the internal fast timer clock value. + * + * @type {number} + */ + let fastNow = 0; + /** + * RESOLUTION_MS represents the target resolution time in milliseconds. + * + * @type {number} + * @default 1000 + */ + const RESOLUTION_MS = 1e3; + /** + * TICK_MS defines the desired interval in milliseconds between each tick. + * The target value is set to half the resolution time, minus 1 ms, to account + * for potential event loop overhead. + * + * @type {number} + * @default 499 + */ + const TICK_MS = (RESOLUTION_MS >> 1) - 1; + /** + * fastNowTimeout is a Node.js timer used to manage and process + * the FastTimers stored in the `fastTimers` array. + * + * @type {NodeJS.Timeout} + */ + let fastNowTimeout; + /** + * The kFastTimer symbol is used to identify FastTimer instances. + * + * @type {Symbol} + */ + const kFastTimer = Symbol("kFastTimer"); + /** + * The fastTimers array contains all active FastTimers. + * + * @type {FastTimer[]} + */ + const fastTimers = []; + /** + * These constants represent the various states of a FastTimer. + */ + /** + * The `NOT_IN_LIST` constant indicates that the FastTimer is not included + * in the `fastTimers` array. Timers with this status will not be processed + * during the next tick by the `onTick` function. + * + * A FastTimer can be re-added to the `fastTimers` array by invoking the + * `refresh` method on the FastTimer instance. + * + * @type {-2} + */ + const NOT_IN_LIST = -2; + /** + * The `TO_BE_CLEARED` constant indicates that the FastTimer is scheduled + * for removal from the `fastTimers` array. A FastTimer in this state will + * be removed in the next tick by the `onTick` function and will no longer + * be processed. + * + * This status is also set when the `clear` method is called on the FastTimer instance. + * + * @type {-1} + */ + const TO_BE_CLEARED = -1; + /** + * The `PENDING` constant signifies that the FastTimer is awaiting processing + * in the next tick by the `onTick` function. Timers with this status will have + * their `_idleStart` value set and their status updated to `ACTIVE` in the next tick. + * + * @type {0} + */ + const PENDING = 0; + /** + * The `ACTIVE` constant indicates that the FastTimer is active and waiting + * for its timer to expire. During the next tick, the `onTick` function will + * check if the timer has expired, and if so, it will execute the associated callback. + * + * @type {1} + */ + const ACTIVE = 1; + /** + * The onTick function processes the fastTimers array. + * + * @returns {void} + */ + function onTick() { + /** + * Increment the fastNow value by the TICK_MS value, despite the actual time + * that has passed since the last tick. This approach ensures independence + * from the system clock and delays caused by a blocked event loop. + * + * @type {number} + */ + fastNow += TICK_MS; + /** + * The `idx` variable is used to iterate over the `fastTimers` array. + * Expired timers are removed by replacing them with the last element in the array. + * Consequently, `idx` is only incremented when the current element is not removed. + * + * @type {number} + */ + let idx = 0; + /** + * The len variable will contain the length of the fastTimers array + * and will be decremented when a FastTimer should be removed from the + * fastTimers array. + * + * @type {number} + */ + let len = fastTimers.length; + while (idx < len) { + /** + * @type {FastTimer} + */ + const timer = fastTimers[idx]; + if (timer._state === PENDING) { + timer._idleStart = fastNow - TICK_MS; + timer._state = ACTIVE; + } else if (timer._state === ACTIVE && fastNow >= timer._idleStart + timer._idleTimeout) { + timer._state = TO_BE_CLEARED; + timer._idleStart = -1; + timer._onTimeout(timer._timerArg); + } + if (timer._state === TO_BE_CLEARED) { + timer._state = NOT_IN_LIST; + if (--len !== 0) fastTimers[idx] = fastTimers[len]; + } else ++idx; + } + fastTimers.length = len; + if (fastTimers.length !== 0) refreshTimeout(); + } + function refreshTimeout() { + if (fastNowTimeout) fastNowTimeout.refresh(); + else { + clearTimeout(fastNowTimeout); + fastNowTimeout = setTimeout(onTick, TICK_MS); + if (fastNowTimeout.unref) fastNowTimeout.unref(); + } + } + /** + * The `FastTimer` class is a data structure designed to store and manage + * timer information. + */ + var FastTimer = class { + [kFastTimer] = true; + /** + * The state of the timer, which can be one of the following: + * - NOT_IN_LIST (-2) + * - TO_BE_CLEARED (-1) + * - PENDING (0) + * - ACTIVE (1) + * + * @type {-2|-1|0|1} + * @private + */ + _state = NOT_IN_LIST; + /** + * The number of milliseconds to wait before calling the callback. + * + * @type {number} + * @private + */ + _idleTimeout = -1; + /** + * The time in milliseconds when the timer was started. This value is used to + * calculate when the timer should expire. + * + * @type {number} + * @default -1 + * @private + */ + _idleStart = -1; + /** + * The function to be executed when the timer expires. + * @type {Function} + * @private + */ + _onTimeout; + /** + * The argument to be passed to the callback when the timer expires. + * + * @type {*} + * @private + */ + _timerArg; + /** + * @constructor + * @param {Function} callback A function to be executed after the timer + * expires. + * @param {number} delay The time, in milliseconds that the timer should wait + * before the specified function or code is executed. + * @param {*} arg + */ + constructor(callback, delay, arg) { + this._onTimeout = callback; + this._idleTimeout = delay; + this._timerArg = arg; + this.refresh(); + } + /** + * Sets the timer's start time to the current time, and reschedules the timer + * to call its callback at the previously specified duration adjusted to the + * current time. + * Using this on a timer that has already called its callback will reactivate + * the timer. + * + * @returns {void} + */ + refresh() { + if (this._state === NOT_IN_LIST) fastTimers.push(this); + if (!fastNowTimeout || fastTimers.length === 1) refreshTimeout(); + this._state = PENDING; + } + /** + * The `clear` method cancels the timer, preventing it from executing. + * + * @returns {void} + * @private + */ + clear() { + this._state = TO_BE_CLEARED; + this._idleStart = -1; + } + }; + /** + * This module exports a setTimeout and clearTimeout function that can be + * used as a drop-in replacement for the native functions. + */ + module.exports = { + setTimeout(callback, delay, arg) { + return delay <= RESOLUTION_MS ? setTimeout(callback, delay, arg) : new FastTimer(callback, delay, arg); + }, + clearTimeout(timeout) { + if (timeout[kFastTimer]) + /** + * @type {FastTimer} + */ + timeout.clear(); + else clearTimeout(timeout); + }, + setFastTimeout(callback, delay, arg) { + return new FastTimer(callback, delay, arg); + }, + clearFastTimeout(timeout) { + timeout.clear(); + }, + now() { + return fastNow; + }, + tick(delay = 0) { + fastNow += delay - RESOLUTION_MS + 1; + onTick(); + onTick(); + }, + reset() { + fastNow = 0; + fastTimers.length = 0; + clearTimeout(fastNowTimeout); + fastNowTimeout = null; + }, + kFastTimer + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/core/connect.js +var require_connect = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const net$1 = __require("node:net"); + const assert$24 = __require("node:assert"); + const util = require_util$7(); + const { InvalidArgumentError, ConnectTimeoutError } = require_errors$1(); + const timers = require_timers(); + function noop() {} + let tls; + let SessionCache; + if (global.FinalizationRegistry && !(process.env.NODE_V8_COVERAGE || process.env.UNDICI_NO_FG)) SessionCache = class WeakSessionCache { + constructor(maxCachedSessions) { + this._maxCachedSessions = maxCachedSessions; + this._sessionCache = /* @__PURE__ */ new Map(); + this._sessionRegistry = new global.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({ allowH2, maxCachedSessions, socketPath, timeout, session: customSession, ...opts }) { + if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) throw new InvalidArgumentError("maxCachedSessions must be a positive integer or zero"); + const options = { + path: socketPath, + ...opts + }; + const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions); + timeout = timeout == null ? 1e4 : timeout; + allowH2 = allowH2 != null ? allowH2 : false; + return function connect({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) { + let socket; + if (protocol === "https:") { + if (!tls) tls = __require("node:tls"); + servername = servername || options.servername || util.getServerName(host) || null; + const sessionKey = servername || hostname; + assert$24(sessionKey); + const session = customSession || sessionCache.get(sessionKey) || null; + port = port || 443; + socket = tls.connect({ + highWaterMark: 16384, + ...options, + servername, + session, + localAddress, + ALPNProtocols: allowH2 ? ["http/1.1", "h2"] : ["http/1.1"], + socket: httpSocket, + port, + host: hostname + }); + socket.on("session", function(session) { + sessionCache.set(sessionKey, session); + }); + } else { + assert$24(!httpSocket, "httpSocket can only be sent on TLS update"); + port = port || 80; + socket = net$1.connect({ + highWaterMark: 64 * 1024, + ...options, + localAddress, + port, + host: hostname + }); + } + if (options.keepAlive == null || options.keepAlive) { + const keepAliveInitialDelay = options.keepAliveInitialDelay === void 0 ? 6e4 : options.keepAliveInitialDelay; + socket.setKeepAlive(true, keepAliveInitialDelay); + } + const clearConnectTimeout = setupConnectTimeout(new WeakRef(socket), { + timeout, + hostname, + port + }); + socket.setNoDelay(true).once(protocol === "https:" ? "secureConnect" : "connect", function() { + queueMicrotask(clearConnectTimeout); + if (callback) { + const cb = callback; + callback = null; + cb(null, this); + } + }).on("error", function(err) { + queueMicrotask(clearConnectTimeout); + if (callback) { + const cb = callback; + callback = null; + cb(err); + } + }); + return socket; + }; + } + /** + * @param {WeakRef} socketWeakRef + * @param {object} opts + * @param {number} opts.timeout + * @param {string} opts.hostname + * @param {number} opts.port + * @returns {() => void} + */ + const setupConnectTimeout = process.platform === "win32" ? (socketWeakRef, opts) => { + if (!opts.timeout) return noop; + let s1 = null; + let s2 = null; + const fastTimer = timers.setFastTimeout(() => { + s1 = setImmediate(() => { + s2 = setImmediate(() => onConnectTimeout(socketWeakRef.deref(), opts)); + }); + }, opts.timeout); + return () => { + timers.clearFastTimeout(fastTimer); + clearImmediate(s1); + clearImmediate(s2); + }; + } : (socketWeakRef, opts) => { + if (!opts.timeout) return noop; + let s1 = null; + const fastTimer = timers.setFastTimeout(() => { + s1 = setImmediate(() => { + onConnectTimeout(socketWeakRef.deref(), opts); + }); + }, opts.timeout); + return () => { + timers.clearFastTimeout(fastTimer); + clearImmediate(s1); + }; + }; + /** + * @param {net.Socket} socket + * @param {object} opts + * @param {number} opts.timeout + * @param {string} opts.hostname + * @param {number} opts.port + */ + function onConnectTimeout(socket, opts) { + if (socket == null) return; + let message = "Connect Timeout Error"; + if (Array.isArray(socket.autoSelectFamilyAttemptedAddresses)) message += ` (attempted addresses: ${socket.autoSelectFamilyAttemptedAddresses.join(", ")},`; + else message += ` (attempted address: ${opts.hostname}:${opts.port},`; + message += ` timeout: ${opts.timeout}ms)`; + util.destroy(socket, new ConnectTimeoutError(message)); + } + module.exports = buildConnector; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/llhttp/utils.js +var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.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; + } + exports.enumToMap = enumToMap; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/llhttp/constants.js +var require_constants$3 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0; + const utils_1 = require_utils(); + (function(ERROR) { + ERROR[ERROR["OK"] = 0] = "OK"; + ERROR[ERROR["INTERNAL"] = 1] = "INTERNAL"; + ERROR[ERROR["STRICT"] = 2] = "STRICT"; + ERROR[ERROR["LF_EXPECTED"] = 3] = "LF_EXPECTED"; + ERROR[ERROR["UNEXPECTED_CONTENT_LENGTH"] = 4] = "UNEXPECTED_CONTENT_LENGTH"; + ERROR[ERROR["CLOSED_CONNECTION"] = 5] = "CLOSED_CONNECTION"; + ERROR[ERROR["INVALID_METHOD"] = 6] = "INVALID_METHOD"; + ERROR[ERROR["INVALID_URL"] = 7] = "INVALID_URL"; + ERROR[ERROR["INVALID_CONSTANT"] = 8] = "INVALID_CONSTANT"; + ERROR[ERROR["INVALID_VERSION"] = 9] = "INVALID_VERSION"; + ERROR[ERROR["INVALID_HEADER_TOKEN"] = 10] = "INVALID_HEADER_TOKEN"; + ERROR[ERROR["INVALID_CONTENT_LENGTH"] = 11] = "INVALID_CONTENT_LENGTH"; + ERROR[ERROR["INVALID_CHUNK_SIZE"] = 12] = "INVALID_CHUNK_SIZE"; + ERROR[ERROR["INVALID_STATUS"] = 13] = "INVALID_STATUS"; + ERROR[ERROR["INVALID_EOF_STATE"] = 14] = "INVALID_EOF_STATE"; + ERROR[ERROR["INVALID_TRANSFER_ENCODING"] = 15] = "INVALID_TRANSFER_ENCODING"; + ERROR[ERROR["CB_MESSAGE_BEGIN"] = 16] = "CB_MESSAGE_BEGIN"; + ERROR[ERROR["CB_HEADERS_COMPLETE"] = 17] = "CB_HEADERS_COMPLETE"; + ERROR[ERROR["CB_MESSAGE_COMPLETE"] = 18] = "CB_MESSAGE_COMPLETE"; + ERROR[ERROR["CB_CHUNK_HEADER"] = 19] = "CB_CHUNK_HEADER"; + ERROR[ERROR["CB_CHUNK_COMPLETE"] = 20] = "CB_CHUNK_COMPLETE"; + ERROR[ERROR["PAUSED"] = 21] = "PAUSED"; + ERROR[ERROR["PAUSED_UPGRADE"] = 22] = "PAUSED_UPGRADE"; + ERROR[ERROR["PAUSED_H2_UPGRADE"] = 23] = "PAUSED_H2_UPGRADE"; + ERROR[ERROR["USER"] = 24] = "USER"; + })(exports.ERROR || (exports.ERROR = {})); + (function(TYPE) { + TYPE[TYPE["BOTH"] = 0] = "BOTH"; + TYPE[TYPE["REQUEST"] = 1] = "REQUEST"; + TYPE[TYPE["RESPONSE"] = 2] = "RESPONSE"; + })(exports.TYPE || (exports.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"; + })(exports.FLAGS || (exports.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"; + })(exports.LENIENT_FLAGS || (exports.LENIENT_FLAGS = {})); + var METHODS; + (function(METHODS) { + METHODS[METHODS["DELETE"] = 0] = "DELETE"; + METHODS[METHODS["GET"] = 1] = "GET"; + METHODS[METHODS["HEAD"] = 2] = "HEAD"; + METHODS[METHODS["POST"] = 3] = "POST"; + METHODS[METHODS["PUT"] = 4] = "PUT"; + METHODS[METHODS["CONNECT"] = 5] = "CONNECT"; + METHODS[METHODS["OPTIONS"] = 6] = "OPTIONS"; + METHODS[METHODS["TRACE"] = 7] = "TRACE"; + METHODS[METHODS["COPY"] = 8] = "COPY"; + METHODS[METHODS["LOCK"] = 9] = "LOCK"; + METHODS[METHODS["MKCOL"] = 10] = "MKCOL"; + METHODS[METHODS["MOVE"] = 11] = "MOVE"; + METHODS[METHODS["PROPFIND"] = 12] = "PROPFIND"; + METHODS[METHODS["PROPPATCH"] = 13] = "PROPPATCH"; + METHODS[METHODS["SEARCH"] = 14] = "SEARCH"; + METHODS[METHODS["UNLOCK"] = 15] = "UNLOCK"; + METHODS[METHODS["BIND"] = 16] = "BIND"; + METHODS[METHODS["REBIND"] = 17] = "REBIND"; + METHODS[METHODS["UNBIND"] = 18] = "UNBIND"; + METHODS[METHODS["ACL"] = 19] = "ACL"; + METHODS[METHODS["REPORT"] = 20] = "REPORT"; + METHODS[METHODS["MKACTIVITY"] = 21] = "MKACTIVITY"; + METHODS[METHODS["CHECKOUT"] = 22] = "CHECKOUT"; + METHODS[METHODS["MERGE"] = 23] = "MERGE"; + METHODS[METHODS["M-SEARCH"] = 24] = "M-SEARCH"; + METHODS[METHODS["NOTIFY"] = 25] = "NOTIFY"; + METHODS[METHODS["SUBSCRIBE"] = 26] = "SUBSCRIBE"; + METHODS[METHODS["UNSUBSCRIBE"] = 27] = "UNSUBSCRIBE"; + METHODS[METHODS["PATCH"] = 28] = "PATCH"; + METHODS[METHODS["PURGE"] = 29] = "PURGE"; + METHODS[METHODS["MKCALENDAR"] = 30] = "MKCALENDAR"; + METHODS[METHODS["LINK"] = 31] = "LINK"; + METHODS[METHODS["UNLINK"] = 32] = "UNLINK"; + METHODS[METHODS["SOURCE"] = 33] = "SOURCE"; + METHODS[METHODS["PRI"] = 34] = "PRI"; + METHODS[METHODS["DESCRIBE"] = 35] = "DESCRIBE"; + METHODS[METHODS["ANNOUNCE"] = 36] = "ANNOUNCE"; + METHODS[METHODS["SETUP"] = 37] = "SETUP"; + METHODS[METHODS["PLAY"] = 38] = "PLAY"; + METHODS[METHODS["PAUSE"] = 39] = "PAUSE"; + METHODS[METHODS["TEARDOWN"] = 40] = "TEARDOWN"; + METHODS[METHODS["GET_PARAMETER"] = 41] = "GET_PARAMETER"; + METHODS[METHODS["SET_PARAMETER"] = 42] = "SET_PARAMETER"; + METHODS[METHODS["REDIRECT"] = 43] = "REDIRECT"; + METHODS[METHODS["RECORD"] = 44] = "RECORD"; + METHODS[METHODS["FLUSH"] = 45] = "FLUSH"; + })(METHODS = exports.METHODS || (exports.METHODS = {})); + exports.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, + METHODS.SOURCE + ]; + exports.METHODS_ICE = [METHODS.SOURCE]; + exports.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, + METHODS.GET, + METHODS.POST + ]; + exports.METHOD_MAP = utils_1.enumToMap(METHODS); + exports.H_METHOD_MAP = {}; + Object.keys(exports.METHOD_MAP).forEach((key) => { + if (/^H/.test(key)) exports.H_METHOD_MAP[key] = exports.METHOD_MAP[key]; + }); + (function(FINISH) { + FINISH[FINISH["SAFE"] = 0] = "SAFE"; + FINISH[FINISH["SAFE_WITH_CB"] = 1] = "SAFE_WITH_CB"; + FINISH[FINISH["UNSAFE"] = 2] = "UNSAFE"; + })(exports.FINISH || (exports.FINISH = {})); + exports.ALPHA = []; + for (let i = "A".charCodeAt(0); i <= "Z".charCodeAt(0); i++) { + exports.ALPHA.push(String.fromCharCode(i)); + exports.ALPHA.push(String.fromCharCode(i + 32)); + } + exports.NUM_MAP = { + 0: 0, + 1: 1, + 2: 2, + 3: 3, + 4: 4, + 5: 5, + 6: 6, + 7: 7, + 8: 8, + 9: 9 + }; + exports.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 + }; + exports.NUM = [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9" + ]; + exports.ALPHANUM = exports.ALPHA.concat(exports.NUM); + exports.MARK = [ + "-", + "_", + ".", + "!", + "~", + "*", + "'", + "(", + ")" + ]; + exports.USERINFO_CHARS = exports.ALPHANUM.concat(exports.MARK).concat([ + "%", + ";", + ":", + "&", + "=", + "+", + "$", + "," + ]); + exports.STRICT_URL_CHAR = [ + "!", + "\"", + "$", + "%", + "&", + "'", + "(", + ")", + "*", + "+", + ",", + "-", + ".", + "/", + ":", + ";", + "<", + "=", + ">", + "@", + "[", + "\\", + "]", + "^", + "_", + "`", + "{", + "|", + "}", + "~" + ].concat(exports.ALPHANUM); + exports.URL_CHAR = exports.STRICT_URL_CHAR.concat([" ", "\f"]); + for (let i = 128; i <= 255; i++) exports.URL_CHAR.push(i); + exports.HEX = exports.NUM.concat([ + "a", + "b", + "c", + "d", + "e", + "f", + "A", + "B", + "C", + "D", + "E", + "F" + ]); + exports.STRICT_TOKEN = [ + "!", + "#", + "$", + "%", + "&", + "'", + "*", + "+", + "-", + ".", + "^", + "_", + "`", + "|", + "~" + ].concat(exports.ALPHANUM); + exports.TOKEN = exports.STRICT_TOKEN.concat([" "]); + exports.HEADER_CHARS = [" "]; + for (let i = 32; i <= 255; i++) if (i !== 127) exports.HEADER_CHARS.push(i); + exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c) => c !== 44); + exports.MAJOR = exports.NUM_MAP; + exports.MINOR = exports.MAJOR; + var HEADER_STATE; + (function(HEADER_STATE) { + HEADER_STATE[HEADER_STATE["GENERAL"] = 0] = "GENERAL"; + HEADER_STATE[HEADER_STATE["CONNECTION"] = 1] = "CONNECTION"; + HEADER_STATE[HEADER_STATE["CONTENT_LENGTH"] = 2] = "CONTENT_LENGTH"; + HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING"] = 3] = "TRANSFER_ENCODING"; + HEADER_STATE[HEADER_STATE["UPGRADE"] = 4] = "UPGRADE"; + HEADER_STATE[HEADER_STATE["CONNECTION_KEEP_ALIVE"] = 5] = "CONNECTION_KEEP_ALIVE"; + HEADER_STATE[HEADER_STATE["CONNECTION_CLOSE"] = 6] = "CONNECTION_CLOSE"; + HEADER_STATE[HEADER_STATE["CONNECTION_UPGRADE"] = 7] = "CONNECTION_UPGRADE"; + HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING_CHUNKED"] = 8] = "TRANSFER_ENCODING_CHUNKED"; + })(HEADER_STATE = exports.HEADER_STATE || (exports.HEADER_STATE = {})); + exports.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 + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/llhttp/llhttp-wasm.js +var require_llhttp_wasm = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { Buffer: Buffer$2 } = __require("node:buffer"); + module.exports = Buffer$2.from("AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38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CACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAIoAhwiA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kACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDsYBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHyAhIyUmKCorLC8wMTIzNDU2Nzk6Ozw9lANAQkRFRklLTk9QUVJTVFVWWFpbXF1eX2BhYmNkZWZnaGpsb3Bxc3V2eHl6e3x/gAGBAYIBgwGEAYUBh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QMM7QELQacBIQMgASAERg2FAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHtzwBqLQAARw1IIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyGAgsgAkEANgIAIAZBAWohAUERDEkLQagBIQMgASAERg2EAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHCzwBqLQAARw1HIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyFAgsgAkEANgIAIAZBAWohAUEsDEgLQakBIQMgASAERg2DAiACKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHFzwBqLQAARw1GIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyEAgsgAkEANgIAIAZBAWohAUErDEcLQaoBIQMgASAERg2CAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHKzwBqLQAARw1FIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyDAgsgAkEANgIAIAZBAWohAUEUDEYLIAEgBEYEQEGrASEDDIICCwJAAkACQAJAIAEtAABBwgBrDg8AAQJHR0dHR0dHR0dHRwNHCyABQQFqIQFBkwEhAwzrAQsgAUEBaiEBQZQBIQMM6gELIAFBAWohAUGVASEDDOkBCyABQQFqIQFBlgEhAwzoAQsgASAERgRAQawBIQMMgQILIAEtAABBxQBHDUIgAUEBaiEBDD0LQa0BIQMgASAERg3/ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHNzwBqLQAARw1CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyAAgsgAkEANgIAIAZBAWohAUEODEMLIAEgBEYEQEGuASEDDP8BCyABLQAAQdAARw1AIAFBAWohAUElDEILQa8BIQMgASAERg39ASACKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEHQzwBqLQAARw1AIABBCEYN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IUIAJBww82AhAgAkEHNgIMQQAhAwy2AQsgAkEANgIcIAIgATYCFCACQcMPNgIQIAJBBzYCDEEAIQMMtQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0RIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMtAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0gIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMswELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0iIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgB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//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +var require_llhttp_simd_wasm = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { Buffer: Buffer$1 } = __require("node:buffer"); + module.exports = Buffer$1.from("AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAy0sBQYAAAIAAAAAAAACAQIAAgICAAADAAAAAAMDAwMBAQEBAQEBAQEAAAIAAAAEBQFwARISBQMBAAIGCAF/AUGA1AQLB9EFIgZtZW1vcnkCAAtfaW5pdGlhbGl6ZQAIGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtsbGh0dHBfaW5pdAAJGGxsaHR0cF9zaG91bGRfa2VlcF9hbGl2ZQAvDGxsaHR0cF9hbGxvYwALBm1hbGxvYwAxC2xsaHR0cF9mcmVlAAwEZnJlZQAMD2xsaHR0cF9nZXRfdHlwZQANFWxsaHR0cF9nZXRfaHR0cF9tYWpvcgAOFWxsaHR0cF9nZXRfaHR0cF9taW5vcgAPEWxsaHR0cF9nZXRfbWV0aG9kABAWbGxodHRwX2dldF9zdGF0dXNfY29kZQAREmxsaHR0cF9nZXRfdXBncmFkZQASDGxsaHR0cF9yZXNldAATDmxsaHR0cF9leGVjdXRlABQUbGxodHRwX3NldHRpbmdzX2luaXQAFQ1sbGh0dHBfZmluaXNoABYMbGxodHRwX3BhdXNlABcNbGxodHRwX3Jlc3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EAAn9BjNAAKAIAIgJBASAEQQN2dCIDcUUEQEGM0AAgAiADcjYCACAADAELIAAoAggLIgIgATYCDCAAIAE2AgggASAANgIMIAEgAjYCCAwBC0EfIQIgBEH///8HTQRAIARBJiAEQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAgsgASACNgIcIAFCADcCECACQQJ0QbzSAGohAAJAQZDQACgCACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJA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LC0G5AQwKC0G6AQwJC0G7AQwIC0HGAQwHC0G8AQwGC0G9AQwFC0G+AQwEC0G/AQwDC0HAAQwCC0HCAQwBC0HBAQshAwNAAkACQAJAAkACQAJAAkACQAJAIAICfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQ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DAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQfDOAAuWAU5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw==", "base64"); +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/fetch/constants.js +var require_constants$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + 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); + /** + * @see https://fetch.spec.whatwg.org/#block-bad-port + */ + 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", + "4190", + "5060", + "5061", + "6000", + "6566", + "6665", + "6666", + "6667", + "6668", + "6669", + "6679", + "6697", + "10080" + ]; + const badPortsSet = new Set(badPorts); + /** + * @see https://w3c.github.io/webappsec-referrer-policy/#referrer-policies + */ + 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" + ]; + /** + * @see https://fetch.spec.whatwg.org/#request-body-header-name + */ + const requestBodyHeader = [ + "content-encoding", + "content-language", + "content-location", + "content-type", + "content-length" + ]; + /** + * @see https://fetch.spec.whatwg.org/#enumdef-requestduplex + */ + const requestDuplex = ["half"]; + /** + * @see http://fetch.spec.whatwg.org/#forbidden-method + */ + const forbiddenMethods = [ + "CONNECT", + "TRACE", + "TRACK" + ]; + const forbiddenMethodsSet = new Set(forbiddenMethods); + const subresource = [ + "audio", + "audioworklet", + "font", + "image", + "manifest", + "paintworklet", + "script", + "style", + "track", + "video", + "xslt", + "" + ]; + module.exports = { + subresource, + forbiddenMethods, + requestBodyHeader, + referrerPolicy, + requestRedirect, + requestMode, + requestCredentials, + requestCache, + redirectStatus, + corsSafeListedMethods, + nullBodyStatus, + safeMethods, + badPorts, + requestDuplex, + subresourceSet: new Set(subresource), + badPortsSet, + redirectStatusSet, + corsSafeListedMethodsSet, + safeMethodsSet, + forbiddenMethodsSet, + referrerPolicySet + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/fetch/global.js +var require_global$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + 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 + }); + } + module.exports = { + getGlobalOrigin, + setGlobalOrigin + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/fetch/data-url.js +var require_data_url = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const assert$23 = __require("node:assert"); + const encoder = new TextEncoder(); + /** + * @see https://mimesniff.spec.whatwg.org/#http-token-code-point + */ + const HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+\-.^_|~A-Za-z0-9]+$/; + const HTTP_WHITESPACE_REGEX = /[\u000A\u000D\u0009\u0020]/; + const ASCII_WHITESPACE_REPLACE_REGEX = /[\u0009\u000A\u000C\u000D\u0020]/g; + /** + * @see https://mimesniff.spec.whatwg.org/#http-quoted-string-token-code-point + */ + const HTTP_QUOTED_STRING_TOKENS = /^[\u0009\u0020-\u007E\u0080-\u00FF]+$/; + /** @param {URL} dataURL */ + function dataURLProcessor(dataURL) { + assert$23(dataURL.protocol === "data:"); + let input = URLSerializer(dataURL, 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++; + let body = stringPercentDecode(input.slice(mimeTypeLength + 1)); + if (/;(\u0020){0,}base64$/i.test(mimeType)) { + body = forgivingBase64(isomorphicDecode(body)); + if (body === "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 + }; + } + /** + * @param {URL} url + * @param {boolean} excludeFragment + */ + function URLSerializer(url, excludeFragment = false) { + if (!excludeFragment) return url.href; + const href = url.href; + const hashLength = url.hash.length; + const serialized = hashLength === 0 ? href : href.substring(0, href.length - hashLength); + if (!hashLength && href.endsWith("#")) return serialized.slice(0, -1); + return serialized; + } + /** + * @param {(char: string) => boolean} condition + * @param {string} input + * @param {{ position: number }} position + */ + function collectASequenceOfCodePoints(condition, input, position) { + let result = ""; + while (position.position < input.length && condition(input[position.position])) { + result += input[position.position]; + position.position++; + } + return result; + } + /** + * A faster collectASequenceOfCodePoints that only works when comparing a single character. + * @param {string} char + * @param {string} input + * @param {{ position: number }} position + */ + 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); + } + /** @param {string} input */ + function stringPercentDecode(input) { + return percentDecode(encoder.encode(input)); + } + /** + * @param {number} byte + */ + function isHexCharByte(byte) { + return byte >= 48 && byte <= 57 || byte >= 65 && byte <= 70 || byte >= 97 && byte <= 102; + } + /** + * @param {number} byte + */ + function hexByteToNumber(byte) { + return byte >= 48 && byte <= 57 ? byte - 48 : (byte & 223) - 55; + } + /** @param {Uint8Array} input */ + function percentDecode(input) { + const length = input.length; + /** @type {Uint8Array} */ + const output = new Uint8Array(length); + let j = 0; + for (let i = 0; i < length; ++i) { + const byte = input[i]; + if (byte !== 37) output[j++] = byte; + else if (byte === 37 && !(isHexCharByte(input[i + 1]) && isHexCharByte(input[i + 2]))) output[j++] = 37; + else { + output[j++] = hexByteToNumber(input[i + 1]) << 4 | hexByteToNumber(input[i + 2]); + i += 2; + } + } + return length === j ? output : output.subarray(0, j); + } + /** @param {string} input */ + 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, + parameters: /* @__PURE__ */ new Map(), + essence: `${typeLowercase}/${subtypeLowercase}` + }; + while (position.position < input.length) { + position.position++; + collectASequenceOfCodePoints((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; + } + /** @param {string} data */ + function forgivingBase64(data) { + data = data.replace(ASCII_WHITESPACE_REPLACE_REGEX, ""); + let dataLength = data.length; + if (dataLength % 4 === 0) { + if (data.charCodeAt(dataLength - 1) === 61) { + --dataLength; + if (data.charCodeAt(dataLength - 1) === 61) --dataLength; + } + } + if (dataLength % 4 === 1) return "failure"; + if (/[^+/0-9A-Za-z]/.test(data.length === dataLength ? data : data.substring(0, dataLength))) return "failure"; + const buffer = Buffer.from(data, "base64"); + return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength); + } + /** + * @param {string} input + * @param {{ position: number }} position + * @param {boolean?} extractValue + */ + function collectAnHTTPQuotedString(input, position, extractValue) { + const positionStart = position.position; + let value = ""; + assert$23(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 { + assert$23(quoteOrBackslash === "\""); + break; + } + } + if (extractValue) return value; + return input.slice(positionStart, position.position); + } + /** + * @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type + */ + function serializeAMimeType(mimeType) { + assert$23(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; + } + /** + * @see https://fetch.spec.whatwg.org/#http-whitespace + * @param {number} char + */ + function isHTTPWhiteSpace(char) { + return char === 13 || char === 10 || char === 9 || char === 32; + } + /** + * @see https://fetch.spec.whatwg.org/#http-whitespace + * @param {string} str + * @param {boolean} [leading=true] + * @param {boolean} [trailing=true] + */ + function removeHTTPWhitespace(str, leading = true, trailing = true) { + return removeChars(str, leading, trailing, isHTTPWhiteSpace); + } + /** + * @see https://infra.spec.whatwg.org/#ascii-whitespace + * @param {number} char + */ + function isASCIIWhitespace(char) { + return char === 13 || char === 10 || char === 9 || char === 12 || char === 32; + } + /** + * @see https://infra.spec.whatwg.org/#strip-leading-and-trailing-ascii-whitespace + * @param {string} str + * @param {boolean} [leading=true] + * @param {boolean} [trailing=true] + */ + function removeASCIIWhitespace(str, leading = true, trailing = true) { + return removeChars(str, leading, trailing, isASCIIWhitespace); + } + /** + * @param {string} str + * @param {boolean} leading + * @param {boolean} trailing + * @param {(charCode: number) => boolean} predicate + * @returns + */ + function removeChars(str, leading, trailing, predicate) { + let lead = 0; + let trail = str.length - 1; + if (leading) while (lead < str.length && predicate(str.charCodeAt(lead))) lead++; + if (trailing) while (trail > 0 && predicate(str.charCodeAt(trail))) trail--; + return lead === 0 && trail === str.length - 1 ? str : str.slice(lead, trail + 1); + } + /** + * @see https://infra.spec.whatwg.org/#isomorphic-decode + * @param {Uint8Array} input + * @returns {string} + */ + function isomorphicDecode(input) { + const length = input.length; + if (65535 > length) return String.fromCharCode.apply(null, input); + let result = ""; + let i = 0; + let addition = 65535; + while (i < length) { + if (i + addition > length) addition = length - i; + result += String.fromCharCode.apply(null, input.subarray(i, i += addition)); + } + return result; + } + /** + * @see https://mimesniff.spec.whatwg.org/#minimize-a-supported-mime-type + * @param {Exclude, 'failure'>} mimeType + */ + function minimizeSupportedMimeType(mimeType) { + switch (mimeType.essence) { + case "application/ecmascript": + case "application/javascript": + case "application/x-ecmascript": + case "application/x-javascript": + case "text/ecmascript": + case "text/javascript": + case "text/javascript1.0": + case "text/javascript1.1": + case "text/javascript1.2": + case "text/javascript1.3": + case "text/javascript1.4": + case "text/javascript1.5": + case "text/jscript": + case "text/livescript": + case "text/x-ecmascript": + case "text/x-javascript": return "text/javascript"; + case "application/json": + case "text/json": return "application/json"; + case "image/svg+xml": return "image/svg+xml"; + case "text/xml": + case "application/xml": return "application/xml"; + } + if (mimeType.subtype.endsWith("+json")) return "application/json"; + if (mimeType.subtype.endsWith("+xml")) return "application/xml"; + return ""; + } + module.exports = { + dataURLProcessor, + URLSerializer, + collectASequenceOfCodePoints, + collectASequenceOfCodePointsFast, + stringPercentDecode, + parseMIMEType, + collectAnHTTPQuotedString, + serializeAMimeType, + removeChars, + removeHTTPWhitespace, + minimizeSupportedMimeType, + HTTP_TOKEN_CODEPOINTS, + isomorphicDecode + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/fetch/webidl.js +var require_webidl = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { types: types$3, inspect } = __require("node:util"); + const { markAsUncloneable } = __require("node:worker_threads"); + const { toUSVString } = require_util$7(); + /** @type {import('../../../types/webidl').Webidl} */ + const webidl = {}; + webidl.converters = {}; + webidl.util = {}; + webidl.errors = {}; + webidl.errors.exception = function(message) { + return /* @__PURE__ */ new TypeError(`${message.header}: ${message.message}`); + }; + webidl.errors.conversionFailed = function(context) { + const plural = context.types.length === 1 ? "" : " one of"; + const message = `${context.argument} could not be converted to${plural}: ${context.types.join(", ")}.`; + return webidl.errors.exception({ + header: context.prefix, + message + }); + }; + webidl.errors.invalidArgument = function(context) { + return webidl.errors.exception({ + header: context.prefix, + message: `"${context.value}" is an invalid ${context.type}.` + }); + }; + webidl.brandCheck = function(V, I, opts) { + if (opts?.strict !== false) { + if (!(V instanceof I)) { + const err = /* @__PURE__ */ new TypeError("Illegal invocation"); + err.code = "ERR_INVALID_THIS"; + throw err; + } + } else if (V?.[Symbol.toStringTag] !== I.prototype[Symbol.toStringTag]) { + const err = /* @__PURE__ */ new TypeError("Illegal invocation"); + err.code = "ERR_INVALID_THIS"; + throw err; + } + }; + 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.`, + header: 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.markAsUncloneable = markAsUncloneable || (() => {}); + 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 ${webidl.util.Stringify(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.util.Stringify = function(V) { + switch (webidl.util.Type(V)) { + case "Symbol": return `Symbol(${V.description})`; + case "Object": return inspect(V); + case "String": return `"${V}"`; + default: return `${V}`; + } + }; + webidl.sequenceConverter = function(converter) { + return (V, prefix, argument, Iterable) => { + if (webidl.util.Type(V) !== "Object") throw webidl.errors.exception({ + header: prefix, + message: `${argument} (${webidl.util.Stringify(V)}) is not iterable.` + }); + /** @type {Generator} */ + const method = typeof Iterable === "function" ? Iterable() : V?.[Symbol.iterator]?.(); + const seq = []; + let index = 0; + if (method === void 0 || typeof method.next !== "function") throw webidl.errors.exception({ + header: prefix, + message: `${argument} is not iterable.` + }); + while (true) { + const { done, value } = method.next(); + if (done) break; + seq.push(converter(value, prefix, `${argument}[${index++}]`)); + } + return seq; + }; + }; + webidl.recordConverter = function(keyConverter, valueConverter) { + return (O, prefix, argument) => { + if (webidl.util.Type(O) !== "Object") throw webidl.errors.exception({ + header: prefix, + message: `${argument} ("${webidl.util.Type(O)}") is not an Object.` + }); + const result = {}; + if (!types$3.isProxy(O)) { + const keys = [...Object.getOwnPropertyNames(O), ...Object.getOwnPropertySymbols(O)]; + for (const key of keys) { + const typedKey = keyConverter(key, prefix, argument); + result[typedKey] = valueConverter(O[key], prefix, argument); + } + return result; + } + const keys = Reflect.ownKeys(O); + for (const key of keys) if (Reflect.getOwnPropertyDescriptor(O, key)?.enumerable) { + const typedKey = keyConverter(key, prefix, argument); + result[typedKey] = valueConverter(O[key], prefix, argument); + } + return result; + }; + }; + webidl.interfaceConverter = function(i) { + return (V, prefix, argument, opts) => { + if (opts?.strict !== false && !(V instanceof i)) throw webidl.errors.exception({ + header: prefix, + message: `Expected ${argument} ("${webidl.util.Stringify(V)}") to be an instance of ${i.name}.` + }); + return V; + }; + }; + webidl.dictionaryConverter = function(converters) { + return (dictionary, prefix, argument) => { + const type = webidl.util.Type(dictionary); + const dict = {}; + if (type === "Null" || type === "Undefined") return dict; + else if (type !== "Object") throw webidl.errors.exception({ + header: prefix, + message: `Expected ${dictionary} to be one of: Null, Undefined, Object.` + }); + for (const options of converters) { + const { key, defaultValue, required, converter } = options; + if (required === true) { + if (!Object.hasOwn(dictionary, key)) throw webidl.errors.exception({ + header: prefix, + message: `Missing required key "${key}".` + }); + } + let value = dictionary[key]; + const hasDefault = Object.hasOwn(options, "defaultValue"); + if (hasDefault && value !== null) value ??= defaultValue(); + if (required || hasDefault || value !== void 0) { + value = converter(value, prefix, `${argument}.${key}`); + if (options.allowedValues && !options.allowedValues.includes(value)) throw webidl.errors.exception({ + header: prefix, + message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(", ")}.` + }); + dict[key] = value; + } + } + return dict; + }; + }; + webidl.nullableConverter = function(converter) { + return (V, prefix, argument) => { + if (V === null) return V; + return converter(V, prefix, argument); + }; + }; + webidl.converters.DOMString = function(V, prefix, argument, opts) { + if (V === null && opts?.legacyNullToEmptyString) return ""; + if (typeof V === "symbol") throw webidl.errors.exception({ + header: prefix, + message: `${argument} is a symbol, which cannot be converted to a DOMString.` + }); + return String(V); + }; + webidl.converters.ByteString = function(V, prefix, argument) { + const x = webidl.converters.DOMString(V, prefix, argument); + 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 = toUSVString; + webidl.converters.boolean = function(V) { + return Boolean(V); + }; + webidl.converters.any = function(V) { + return V; + }; + webidl.converters["long long"] = function(V, prefix, argument) { + return webidl.util.ConvertToInt(V, 64, "signed", void 0, prefix, argument); + }; + webidl.converters["unsigned long long"] = function(V, prefix, argument) { + return webidl.util.ConvertToInt(V, 64, "unsigned", void 0, prefix, argument); + }; + webidl.converters["unsigned long"] = function(V, prefix, argument) { + return webidl.util.ConvertToInt(V, 32, "unsigned", void 0, prefix, argument); + }; + webidl.converters["unsigned short"] = function(V, prefix, argument, opts) { + return webidl.util.ConvertToInt(V, 16, "unsigned", opts, prefix, argument); + }; + webidl.converters.ArrayBuffer = function(V, prefix, argument, opts) { + if (webidl.util.Type(V) !== "Object" || !types$3.isAnyArrayBuffer(V)) throw webidl.errors.conversionFailed({ + prefix, + argument: `${argument} ("${webidl.util.Stringify(V)}")`, + types: ["ArrayBuffer"] + }); + if (opts?.allowShared === false && types$3.isSharedArrayBuffer(V)) throw webidl.errors.exception({ + header: "ArrayBuffer", + message: "SharedArrayBuffer is not allowed." + }); + if (V.resizable || V.growable) throw webidl.errors.exception({ + header: "ArrayBuffer", + message: "Received a resizable ArrayBuffer." + }); + return V; + }; + webidl.converters.TypedArray = function(V, T, prefix, name, opts) { + if (webidl.util.Type(V) !== "Object" || !types$3.isTypedArray(V) || V.constructor.name !== T.name) throw webidl.errors.conversionFailed({ + prefix, + argument: `${name} ("${webidl.util.Stringify(V)}")`, + types: [T.name] + }); + if (opts?.allowShared === false && types$3.isSharedArrayBuffer(V.buffer)) throw webidl.errors.exception({ + header: "ArrayBuffer", + message: "SharedArrayBuffer is not allowed." + }); + if (V.buffer.resizable || V.buffer.growable) throw webidl.errors.exception({ + header: "ArrayBuffer", + message: "Received a resizable ArrayBuffer." + }); + return V; + }; + webidl.converters.DataView = function(V, prefix, name, opts) { + if (webidl.util.Type(V) !== "Object" || !types$3.isDataView(V)) throw webidl.errors.exception({ + header: prefix, + message: `${name} is not a DataView.` + }); + if (opts?.allowShared === false && types$3.isSharedArrayBuffer(V.buffer)) throw webidl.errors.exception({ + header: "ArrayBuffer", + message: "SharedArrayBuffer is not allowed." + }); + if (V.buffer.resizable || V.buffer.growable) throw webidl.errors.exception({ + header: "ArrayBuffer", + message: "Received a resizable ArrayBuffer." + }); + return V; + }; + webidl.converters.BufferSource = function(V, prefix, name, opts) { + if (types$3.isAnyArrayBuffer(V)) return webidl.converters.ArrayBuffer(V, prefix, name, { + ...opts, + allowShared: false + }); + if (types$3.isTypedArray(V)) return webidl.converters.TypedArray(V, V.constructor, prefix, name, { + ...opts, + allowShared: false + }); + if (types$3.isDataView(V)) return webidl.converters.DataView(V, prefix, name, { + ...opts, + allowShared: false + }); + throw webidl.errors.conversionFailed({ + prefix, + argument: `${name} ("${webidl.util.Stringify(V)}")`, + types: ["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); + module.exports = { webidl }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/fetch/util.js +var require_util$6 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { Transform: Transform$2 } = __require("node:stream"); + const zlib$1 = __require("node:zlib"); + const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = require_constants$2(); + const { getGlobalOrigin } = require_global$1(); + const { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = require_data_url(); + const { performance: performance$1 } = __require("node:perf_hooks"); + const { isBlobLike, ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = require_util$7(); + const assert$22 = __require("node:assert"); + const { isUint8Array } = __require("node:util/types"); + const { webidl } = require_webidl(); + let supportedHashes = []; + /** @type {import('crypto')} */ + let crypto; + try { + crypto = __require("node:crypto"); + const possibleRelevantHashes = [ + "sha256", + "sha384", + "sha512" + ]; + supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash)); + } catch {} + function responseURL(response) { + const urlList = response.urlList; + const length = urlList.length; + return length === 0 ? null : urlList[length - 1].toString(); + } + function responseLocationURL(response, requestFragment) { + if (!redirectStatusSet.has(response.status)) return null; + let location = response.headersList.get("location", true); + if (location !== null && isValidHeaderValue(location)) { + if (!isValidEncodedURL(location)) location = normalizeBinaryStringToUtf8(location); + location = new URL(location, responseURL(response)); + } + if (location && !location.hash) location.hash = requestFragment; + return location; + } + /** + * @see https://www.rfc-editor.org/rfc/rfc1738#section-2.2 + * @param {string} url + * @returns {boolean} + */ + function isValidEncodedURL(url) { + for (let i = 0; i < url.length; ++i) { + const code = url.charCodeAt(i); + if (code > 126 || code < 32) return false; + } + return true; + } + /** + * If string contains non-ASCII characters, assumes it's UTF-8 encoded and decodes it. + * Since UTF-8 is a superset of ASCII, this will work for ASCII strings as well. + * @param {string} value + * @returns {string} + */ + function normalizeBinaryStringToUtf8(value) { + return Buffer.from(value, "binary").toString("utf8"); + } + /** @returns {URL} */ + function requestCurrentURL(request) { + return request.urlList[request.urlList.length - 1]; + } + function requestBadPort(request) { + const url = requestCurrentURL(request); + if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) return "blocked"; + return "allowed"; + } + function isErrorLike(object) { + return object instanceof Error || object?.constructor?.name === "Error" || object?.constructor?.name === "DOMException"; + } + function isValidReasonPhrase(statusText) { + for (let i = 0; i < statusText.length; ++i) { + const c = statusText.charCodeAt(i); + if (!(c === 9 || c >= 32 && c <= 126 || c >= 128 && c <= 255)) return false; + } + return true; + } + /** + * @see https://fetch.spec.whatwg.org/#header-name + * @param {string} potentialValue + */ + const isValidHeaderName = isValidHTTPToken; + /** + * @see https://fetch.spec.whatwg.org/#header-value + * @param {string} potentialValue + */ + function isValidHeaderValue(potentialValue) { + return (potentialValue[0] === " " || potentialValue[0] === " " || potentialValue[potentialValue.length - 1] === " " || potentialValue[potentialValue.length - 1] === " " || potentialValue.includes("\n") || potentialValue.includes("\r") || potentialValue.includes("\0")) === false; + } + function setRequestReferrerPolicyOnRedirect(request, actualResponse) { + const { headersList } = actualResponse; + const policyHeader = (headersList.get("referrer-policy", true) ?? "").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 !== "") request.referrerPolicy = policy; + } + function crossOriginResourcePolicyCheck() { + return "allowed"; + } + function corsCheck() { + return "success"; + } + function TAOCheck() { + return "success"; + } + function appendFetchMetadata(httpRequest) { + let header = null; + header = httpRequest.mode; + httpRequest.headersList.set("sec-fetch-mode", header, true); + } + function appendRequestOriginHeader(request) { + let serializedOrigin = request.origin; + if (serializedOrigin === "client" || serializedOrigin === void 0) return; + if (request.responseTainting === "cors" || request.mode === "websocket") request.headersList.append("origin", serializedOrigin, true); + else if (request.method !== "GET" && request.method !== "HEAD") { + switch (request.referrerPolicy) { + case "no-referrer": + serializedOrigin = null; + break; + case "no-referrer-when-downgrade": + case "strict-origin": + case "strict-origin-when-cross-origin": + if (request.origin && urlHasHttpsScheme(request.origin) && !urlHasHttpsScheme(requestCurrentURL(request))) serializedOrigin = null; + break; + case "same-origin": + if (!sameOrigin(request, requestCurrentURL(request))) serializedOrigin = null; + break; + default: + } + request.headersList.append("origin", serializedOrigin, true); + } + } + function coarsenTime(timestamp, crossOriginIsolatedCapability) { + return timestamp; + } + function clampAndCoarsenConnectionTimingInfo(connectionTimingInfo, defaultStartTime, crossOriginIsolatedCapability) { + if (!connectionTimingInfo?.startTime || connectionTimingInfo.startTime < defaultStartTime) return { + domainLookupStartTime: defaultStartTime, + domainLookupEndTime: defaultStartTime, + connectionStartTime: defaultStartTime, + connectionEndTime: defaultStartTime, + secureConnectionStartTime: defaultStartTime, + ALPNNegotiatedProtocol: connectionTimingInfo?.ALPNNegotiatedProtocol + }; + return { + domainLookupStartTime: coarsenTime(connectionTimingInfo.domainLookupStartTime, crossOriginIsolatedCapability), + domainLookupEndTime: coarsenTime(connectionTimingInfo.domainLookupEndTime, crossOriginIsolatedCapability), + connectionStartTime: coarsenTime(connectionTimingInfo.connectionStartTime, crossOriginIsolatedCapability), + connectionEndTime: coarsenTime(connectionTimingInfo.connectionEndTime, crossOriginIsolatedCapability), + secureConnectionStartTime: coarsenTime(connectionTimingInfo.secureConnectionStartTime, crossOriginIsolatedCapability), + ALPNNegotiatedProtocol: connectionTimingInfo.ALPNNegotiatedProtocol + }; + } + function coarsenedSharedCurrentTime(crossOriginIsolatedCapability) { + return coarsenTime(performance$1.now(), crossOriginIsolatedCapability); + } + 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(request) { + const policy = request.referrerPolicy; + assert$22(policy); + let referrerSource = null; + if (request.referrer === "client") { + const globalOrigin = getGlobalOrigin(); + if (!globalOrigin || globalOrigin.origin === "null") return "no-referrer"; + referrerSource = new URL(globalOrigin); + } else if (request.referrer instanceof URL) referrerSource = request.referrer; + let referrerURL = stripURLForReferrer(referrerSource); + const referrerOrigin = stripURLForReferrer(referrerSource, true); + if (referrerURL.toString().length > 4096) referrerURL = referrerOrigin; + const areSameOrigin = sameOrigin(request, referrerURL); + const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(request.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(request); + if (sameOrigin(referrerURL, currentURL)) return referrerURL; + if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) return "no-referrer"; + return referrerOrigin; + } + /** + * 1. If referrerURL is a potentially trustworthy URL and + * request’s current URL is not a potentially trustworthy URL, + * then return no referrer. + * 2. Return referrerOrigin + */ + default: return isNonPotentiallyTrustWorthy ? "no-referrer" : referrerOrigin; + } + } + /** + * @see https://w3c.github.io/webappsec-referrer-policy/#strip-url + * @param {URL} url + * @param {boolean|undefined} originOnly + */ + function stripURLForReferrer(url, originOnly) { + assert$22(url instanceof URL); + url = new URL(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; + } + } + /** + * @see https://w3c.github.io/webappsec-subresource-integrity/#does-response-match-metadatalist + * @param {Uint8Array} bytes + * @param {string} metadataList + */ + function bytesMatch(bytes, metadataList) { + /* istanbul ignore if: only if node is built with --without-ssl */ + if (crypto === void 0) return true; + const parsedMetadata = parseMetadata(metadataList); + if (parsedMetadata === "no metadata") return true; + if (parsedMetadata.length === 0) return true; + const metadata = filterMetadataListByAlgorithm(parsedMetadata, getStrongestMetadata(parsedMetadata)); + for (const item of metadata) { + const algorithm = item.algo; + const expectedValue = item.hash; + let actualValue = crypto.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; + /** + * @see https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata + * @param {string} metadata + */ + function parseMetadata(metadata) { + /** @type {{ algo: string, hash: string }[]} */ + 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; + } + /** + * @param {{ algo: 'sha256' | 'sha384' | 'sha512' }[]} metadataList + */ + 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 pos = 0; + for (let i = 0; i < metadataList.length; ++i) if (metadataList[i].algo === algorithm) metadataList[pos++] = metadataList[i]; + metadataList.length = pos; + return metadataList; + } + /** + * Compares two base64 strings, allowing for base64url + * in the second string. + * + * @param {string} actualValue always base64 + * @param {string} expectedValue base64 or base64url + * @returns {boolean} + */ + 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(request) {} + /** + * @link {https://html.spec.whatwg.org/multipage/origin.html#same-origin} + * @param {URL} A + * @param {URL} B + */ + 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; + return { + promise: new Promise((resolve, reject) => { + res = resolve; + rej = reject; + }), + resolve: res, + reject: rej + }; + } + function isAborted(fetchParams) { + return fetchParams.controller.state === "aborted"; + } + function isCancelled(fetchParams) { + return fetchParams.controller.state === "aborted" || fetchParams.controller.state === "terminated"; + } + /** + * @see https://fetch.spec.whatwg.org/#concept-method-normalize + * @param {string} method + */ + function normalizeMethod(method) { + return normalizedMethodRecordsBase[method.toLowerCase()] ?? method; + } + function serializeJavascriptValueToJSONString(value) { + const result = JSON.stringify(value); + if (result === void 0) throw new TypeError("Value is not JSON serializable"); + assert$22(typeof result === "string"); + return result; + } + const esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())); + /** + * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object + * @param {string} name name of the instance + * @param {symbol} kInternalIterator + * @param {string | number} [keyIndex] + * @param {string | number} [valueIndex] + */ + function createIterator(name, kInternalIterator, keyIndex = 0, valueIndex = 1) { + class FastIterableIterator { + /** @type {any} */ + #target; + /** @type {'key' | 'value' | 'key+value'} */ + #kind; + /** @type {number} */ + #index; + /** + * @see https://webidl.spec.whatwg.org/#dfn-default-iterator-object + * @param {unknown} target + * @param {'key' | 'value' | 'key+value'} kind + */ + constructor(target, kind) { + this.#target = target; + this.#kind = kind; + this.#index = 0; + } + next() { + if (typeof this !== "object" || this === null || !(#target in this)) throw new TypeError(`'next' called on an object that does not implement interface ${name} Iterator.`); + const index = this.#index; + const values = this.#target[kInternalIterator]; + if (index >= values.length) return { + value: void 0, + done: true + }; + const { [keyIndex]: key, [valueIndex]: value } = values[index]; + this.#index = index + 1; + let result; + switch (this.#kind) { + case "key": + result = key; + break; + case "value": + result = value; + break; + case "key+value": + result = [key, value]; + break; + } + return { + value: result, + done: false + }; + } + } + delete FastIterableIterator.prototype.constructor; + Object.setPrototypeOf(FastIterableIterator.prototype, esIteratorPrototype); + Object.defineProperties(FastIterableIterator.prototype, { + [Symbol.toStringTag]: { + writable: false, + enumerable: false, + configurable: true, + value: `${name} Iterator` + }, + next: { + writable: true, + enumerable: true, + configurable: true + } + }); + /** + * @param {unknown} target + * @param {'key' | 'value' | 'key+value'} kind + * @returns {IterableIterator} + */ + return function(target, kind) { + return new FastIterableIterator(target, kind); + }; + } + /** + * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object + * @param {string} name name of the instance + * @param {any} object class + * @param {symbol} kInternalIterator + * @param {string | number} [keyIndex] + * @param {string | number} [valueIndex] + */ + function iteratorMixin(name, object, kInternalIterator, keyIndex = 0, valueIndex = 1) { + const makeIterator = createIterator(name, kInternalIterator, keyIndex, valueIndex); + const properties = { + keys: { + writable: true, + enumerable: true, + configurable: true, + value: function keys() { + webidl.brandCheck(this, object); + return makeIterator(this, "key"); + } + }, + values: { + writable: true, + enumerable: true, + configurable: true, + value: function values() { + webidl.brandCheck(this, object); + return makeIterator(this, "value"); + } + }, + entries: { + writable: true, + enumerable: true, + configurable: true, + value: function entries() { + webidl.brandCheck(this, object); + return makeIterator(this, "key+value"); + } + }, + forEach: { + writable: true, + enumerable: true, + configurable: true, + value: function forEach(callbackfn, thisArg = globalThis) { + webidl.brandCheck(this, object); + webidl.argumentLengthCheck(arguments, 1, `${name}.forEach`); + if (typeof callbackfn !== "function") throw new TypeError(`Failed to execute 'forEach' on '${name}': parameter 1 is not of type 'Function'.`); + for (const { 0: key, 1: value } of makeIterator(this, "key+value")) callbackfn.call(thisArg, value, key, this); + } + } + }; + return Object.defineProperties(object.prototype, { + ...properties, + [Symbol.iterator]: { + writable: true, + enumerable: false, + configurable: true, + value: properties.entries.value + } + }); + } + /** + * @see https://fetch.spec.whatwg.org/#body-fully-read + */ + async function fullyReadBody(body, processBody, processBodyError) { + const successSteps = processBody; + const errorSteps = processBodyError; + let reader; + try { + reader = body.stream.getReader(); + } catch (e) { + errorSteps(e); + return; + } + try { + successSteps(await readAllBytes(reader)); + } catch (e) { + errorSteps(e); + } + } + function isReadableStreamLike(stream) { + return stream instanceof ReadableStream || stream[Symbol.toStringTag] === "ReadableStream" && typeof stream.tee === "function"; + } + /** + * @param {ReadableStreamController} controller + */ + function readableStreamClose(controller) { + try { + controller.close(); + controller.byobRequest?.respond(0); + } catch (err) { + if (!err.message.includes("Controller is already closed") && !err.message.includes("ReadableStream is already closed")) throw err; + } + } + const invalidIsomorphicEncodeValueRegex = /[^\x00-\xFF]/; + /** + * @see https://infra.spec.whatwg.org/#isomorphic-encode + * @param {string} input + */ + function isomorphicEncode(input) { + assert$22(!invalidIsomorphicEncodeValueRegex.test(input)); + return input; + } + /** + * @see https://streams.spec.whatwg.org/#readablestreamdefaultreader-read-all-bytes + * @see https://streams.spec.whatwg.org/#read-loop + * @param {ReadableStreamDefaultReader} reader + */ + async function readAllBytes(reader) { + const bytes = []; + let byteLength = 0; + while (true) { + const { done, value: chunk } = await reader.read(); + if (done) return Buffer.concat(bytes, byteLength); + if (!isUint8Array(chunk)) throw new TypeError("Received non-Uint8Array chunk"); + bytes.push(chunk); + byteLength += chunk.length; + } + } + /** + * @see https://fetch.spec.whatwg.org/#is-local + * @param {URL} url + */ + function urlIsLocal(url) { + assert$22("protocol" in url); + const protocol = url.protocol; + return protocol === "about:" || protocol === "blob:" || protocol === "data:"; + } + /** + * @param {string|URL} url + * @returns {boolean} + */ + function urlHasHttpsScheme(url) { + return typeof url === "string" && url[5] === ":" && url[0] === "h" && url[1] === "t" && url[2] === "t" && url[3] === "p" && url[4] === "s" || url.protocol === "https:"; + } + /** + * @see https://fetch.spec.whatwg.org/#http-scheme + * @param {URL} url + */ + function urlIsHttpHttpsScheme(url) { + assert$22("protocol" in url); + const protocol = url.protocol; + return protocol === "http:" || protocol === "https:"; + } + /** + * @see https://fetch.spec.whatwg.org/#simple-range-header-value + * @param {string} value + * @param {boolean} allowWhitespace + */ + function simpleRangeHeaderValue(value, allowWhitespace) { + const data = value; + if (!data.startsWith("bytes")) return "failure"; + const position = { position: 5 }; + if (allowWhitespace) collectASequenceOfCodePoints((char) => char === " " || char === " ", data, position); + if (data.charCodeAt(position.position) !== 61) return "failure"; + position.position++; + if (allowWhitespace) collectASequenceOfCodePoints((char) => char === " " || char === " ", data, position); + const rangeStart = collectASequenceOfCodePoints((char) => { + const code = char.charCodeAt(0); + return code >= 48 && code <= 57; + }, data, position); + const rangeStartValue = rangeStart.length ? Number(rangeStart) : null; + if (allowWhitespace) collectASequenceOfCodePoints((char) => char === " " || char === " ", data, position); + if (data.charCodeAt(position.position) !== 45) return "failure"; + position.position++; + if (allowWhitespace) collectASequenceOfCodePoints((char) => char === " " || char === " ", data, position); + const rangeEnd = collectASequenceOfCodePoints((char) => { + const code = char.charCodeAt(0); + return code >= 48 && code <= 57; + }, data, position); + const rangeEndValue = rangeEnd.length ? Number(rangeEnd) : null; + if (position.position < data.length) return "failure"; + if (rangeEndValue === null && rangeStartValue === null) return "failure"; + if (rangeStartValue > rangeEndValue) return "failure"; + return { + rangeStartValue, + rangeEndValue + }; + } + /** + * @see https://fetch.spec.whatwg.org/#build-a-content-range + * @param {number} rangeStart + * @param {number} rangeEnd + * @param {number} fullLength + */ + function buildContentRange(rangeStart, rangeEnd, fullLength) { + let contentRange = "bytes "; + contentRange += isomorphicEncode(`${rangeStart}`); + contentRange += "-"; + contentRange += isomorphicEncode(`${rangeEnd}`); + contentRange += "/"; + contentRange += isomorphicEncode(`${fullLength}`); + return contentRange; + } + var InflateStream = class extends Transform$2 { + #zlibOptions; + /** @param {zlib.ZlibOptions} [zlibOptions] */ + constructor(zlibOptions) { + super(); + this.#zlibOptions = zlibOptions; + } + _transform(chunk, encoding, callback) { + if (!this._inflateStream) { + if (chunk.length === 0) { + callback(); + return; + } + this._inflateStream = (chunk[0] & 15) === 8 ? zlib$1.createInflate(this.#zlibOptions) : zlib$1.createInflateRaw(this.#zlibOptions); + this._inflateStream.on("data", this.push.bind(this)); + this._inflateStream.on("end", () => this.push(null)); + this._inflateStream.on("error", (err) => this.destroy(err)); + } + this._inflateStream.write(chunk, encoding, callback); + } + _final(callback) { + if (this._inflateStream) { + this._inflateStream.end(); + this._inflateStream = null; + } + callback(); + } + }; + /** + * @param {zlib.ZlibOptions} [zlibOptions] + * @returns {InflateStream} + */ + function createInflate(zlibOptions) { + return new InflateStream(zlibOptions); + } + /** + * @see https://fetch.spec.whatwg.org/#concept-header-extract-mime-type + * @param {import('./headers').HeadersList} headers + */ + function extractMimeType(headers) { + let charset = null; + let essence = null; + let mimeType = null; + const values = getDecodeSplit("content-type", headers); + if (values === null) return "failure"; + for (const value of values) { + const temporaryMimeType = parseMIMEType(value); + if (temporaryMimeType === "failure" || temporaryMimeType.essence === "*/*") continue; + mimeType = temporaryMimeType; + if (mimeType.essence !== essence) { + charset = null; + if (mimeType.parameters.has("charset")) charset = mimeType.parameters.get("charset"); + essence = mimeType.essence; + } else if (!mimeType.parameters.has("charset") && charset !== null) mimeType.parameters.set("charset", charset); + } + if (mimeType == null) return "failure"; + return mimeType; + } + /** + * @see https://fetch.spec.whatwg.org/#header-value-get-decode-and-split + * @param {string|null} value + */ + function gettingDecodingSplitting(value) { + const input = value; + const position = { position: 0 }; + const values = []; + let temporaryValue = ""; + while (position.position < input.length) { + temporaryValue += collectASequenceOfCodePoints((char) => char !== "\"" && char !== ",", input, position); + if (position.position < input.length) if (input.charCodeAt(position.position) === 34) { + temporaryValue += collectAnHTTPQuotedString(input, position); + if (position.position < input.length) continue; + } else { + assert$22(input.charCodeAt(position.position) === 44); + position.position++; + } + temporaryValue = removeChars(temporaryValue, true, true, (char) => char === 9 || char === 32); + values.push(temporaryValue); + temporaryValue = ""; + } + return values; + } + /** + * @see https://fetch.spec.whatwg.org/#concept-header-list-get-decode-split + * @param {string} name lowercase header name + * @param {import('./headers').HeadersList} list + */ + function getDecodeSplit(name, list) { + const value = list.get(name, true); + if (value === null) return null; + return gettingDecodingSplitting(value); + } + const textDecoder = new TextDecoder(); + /** + * @see https://encoding.spec.whatwg.org/#utf-8-decode + * @param {Buffer} buffer + */ + function utf8DecodeBytes(buffer) { + if (buffer.length === 0) return ""; + if (buffer[0] === 239 && buffer[1] === 187 && buffer[2] === 191) buffer = buffer.subarray(3); + return textDecoder.decode(buffer); + } + var EnvironmentSettingsObjectBase = class { + get baseUrl() { + return getGlobalOrigin(); + } + get origin() { + return this.baseUrl?.origin; + } + policyContainer = makePolicyContainer(); + }; + var EnvironmentSettingsObject = class { + settingsObject = new EnvironmentSettingsObjectBase(); + }; + module.exports = { + isAborted, + isCancelled, + isValidEncodedURL, + createDeferredPromise, + ReadableStreamFrom, + tryUpgradeRequestToAPotentiallyTrustworthyURL, + clampAndCoarsenConnectionTimingInfo, + coarsenedSharedCurrentTime, + determineRequestsReferrer, + makePolicyContainer, + clonePolicyContainer, + appendFetchMetadata, + appendRequestOriginHeader, + TAOCheck, + corsCheck, + crossOriginResourcePolicyCheck, + createOpaqueTimingInfo, + setRequestReferrerPolicyOnRedirect, + isValidHTTPToken, + requestBadPort, + requestCurrentURL, + responseURL, + responseLocationURL, + isBlobLike, + isURLPotentiallyTrustworthy, + isValidReasonPhrase, + sameOrigin, + normalizeMethod, + serializeJavascriptValueToJSONString, + iteratorMixin, + createIterator, + isValidHeaderName, + isValidHeaderValue, + isErrorLike, + fullyReadBody, + bytesMatch, + isReadableStreamLike, + readableStreamClose, + isomorphicEncode, + urlIsLocal, + urlHasHttpsScheme, + urlIsHttpHttpsScheme, + readAllBytes, + simpleRangeHeaderValue, + buildContentRange, + parseMetadata, + createInflate, + extractMimeType, + getDecodeSplit, + utf8DecodeBytes, + environmentSettingsObject: new EnvironmentSettingsObject() + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/fetch/symbols.js +var require_symbols$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + module.exports = { + kUrl: Symbol("url"), + kHeaders: Symbol("headers"), + kSignal: Symbol("signal"), + kState: Symbol("state"), + kDispatcher: Symbol("dispatcher") + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/fetch/file.js +var require_file = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { Blob: Blob$2, File } = __require("node:buffer"); + const { kState } = require_symbols$3(); + const { webidl } = require_webidl(); + var FileLike = class FileLike { + constructor(blobLike, fileName, options = {}) { + const n = fileName; + const t = options.type; + const d = options.lastModified ?? Date.now(); + this[kState] = { + blobLike, + name: n, + type: t, + 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"; + } + }; + webidl.converters.Blob = webidl.interfaceConverter(Blob$2); + function isFileLike(object) { + return object instanceof File || object && (typeof object.stream === "function" || typeof object.arrayBuffer === "function") && object[Symbol.toStringTag] === "File"; + } + module.exports = { + FileLike, + isFileLike + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/fetch/formdata.js +var require_formdata = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { isBlobLike, iteratorMixin } = require_util$6(); + const { kState } = require_symbols$3(); + const { kEnumerableProperty } = require_util$7(); + const { FileLike, isFileLike } = require_file(); + const { webidl } = require_webidl(); + const { File: NativeFile } = __require("node:buffer"); + const nodeUtil$2 = __require("node:util"); + /** @type {globalThis['File']} */ + const File = globalThis.File ?? NativeFile; + var FormData = class FormData { + constructor(form) { + webidl.util.markAsUncloneable(this); + 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); + const prefix = "FormData.append"; + webidl.argumentLengthCheck(arguments, 2, prefix); + if (arguments.length === 3 && !isBlobLike(value)) throw new TypeError("Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'"); + name = webidl.converters.USVString(name, prefix, "name"); + value = isBlobLike(value) ? webidl.converters.Blob(value, prefix, "value", { strict: false }) : webidl.converters.USVString(value, prefix, "value"); + filename = arguments.length === 3 ? webidl.converters.USVString(filename, prefix, "filename") : void 0; + const entry = makeEntry(name, value, filename); + this[kState].push(entry); + } + delete(name) { + webidl.brandCheck(this, FormData); + const prefix = "FormData.delete"; + webidl.argumentLengthCheck(arguments, 1, prefix); + name = webidl.converters.USVString(name, prefix, "name"); + this[kState] = this[kState].filter((entry) => entry.name !== name); + } + get(name) { + webidl.brandCheck(this, FormData); + const prefix = "FormData.get"; + webidl.argumentLengthCheck(arguments, 1, prefix); + name = webidl.converters.USVString(name, prefix, "name"); + const idx = this[kState].findIndex((entry) => entry.name === name); + if (idx === -1) return null; + return this[kState][idx].value; + } + getAll(name) { + webidl.brandCheck(this, FormData); + const prefix = "FormData.getAll"; + webidl.argumentLengthCheck(arguments, 1, prefix); + name = webidl.converters.USVString(name, prefix, "name"); + return this[kState].filter((entry) => entry.name === name).map((entry) => entry.value); + } + has(name) { + webidl.brandCheck(this, FormData); + const prefix = "FormData.has"; + webidl.argumentLengthCheck(arguments, 1, prefix); + name = webidl.converters.USVString(name, prefix, "name"); + return this[kState].findIndex((entry) => entry.name === name) !== -1; + } + set(name, value, filename = void 0) { + webidl.brandCheck(this, FormData); + const prefix = "FormData.set"; + webidl.argumentLengthCheck(arguments, 2, prefix); + if (arguments.length === 3 && !isBlobLike(value)) throw new TypeError("Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'"); + name = webidl.converters.USVString(name, prefix, "name"); + value = isBlobLike(value) ? webidl.converters.Blob(value, prefix, "name", { strict: false }) : webidl.converters.USVString(value, prefix, "name"); + filename = arguments.length === 3 ? webidl.converters.USVString(filename, prefix, "name") : void 0; + const entry = makeEntry(name, value, filename); + const idx = this[kState].findIndex((entry) => entry.name === name); + if (idx !== -1) this[kState] = [ + ...this[kState].slice(0, idx), + entry, + ...this[kState].slice(idx + 1).filter((entry) => entry.name !== name) + ]; + else this[kState].push(entry); + } + [nodeUtil$2.inspect.custom](depth, options) { + const state = this[kState].reduce((a, b) => { + if (a[b.name]) if (Array.isArray(a[b.name])) a[b.name].push(b.value); + else a[b.name] = [a[b.name], b.value]; + else a[b.name] = b.value; + return a; + }, { __proto__: null }); + options.depth ??= depth; + options.colors ??= true; + const output = nodeUtil$2.formatWithOptions(options, state); + return `FormData ${output.slice(output.indexOf("]") + 2)}`; + } + }; + iteratorMixin("FormData", FormData, kState, "name", "value"); + Object.defineProperties(FormData.prototype, { + append: kEnumerableProperty, + delete: kEnumerableProperty, + get: kEnumerableProperty, + getAll: kEnumerableProperty, + has: kEnumerableProperty, + set: kEnumerableProperty, + [Symbol.toStringTag]: { + value: "FormData", + configurable: true + } + }); + /** + * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#create-an-entry + * @param {string} name + * @param {string|Blob} value + * @param {?string} filename + * @returns + */ + function makeEntry(name, value, filename) { + if (typeof value === "string") {} else { + if (!isFileLike(value)) value = value instanceof Blob ? new File([value], "blob", { type: value.type }) : new FileLike(value, "blob", { type: value.type }); + if (filename !== void 0) { + /** @type {FilePropertyBag} */ + const options = { + type: value.type, + lastModified: value.lastModified + }; + value = value instanceof NativeFile ? new File([value], filename, options) : new FileLike(value, filename, options); + } + } + return { + name, + value + }; + } + module.exports = { + FormData, + makeEntry + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/fetch/formdata-parser.js +var require_formdata_parser = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { isUSVString, bufferToLowerCasedHeaderName } = require_util$7(); + const { utf8DecodeBytes } = require_util$6(); + const { HTTP_TOKEN_CODEPOINTS, isomorphicDecode } = require_data_url(); + const { isFileLike } = require_file(); + const { makeEntry } = require_formdata(); + const assert$21 = __require("node:assert"); + const { File: NodeFile } = __require("node:buffer"); + const File = globalThis.File ?? NodeFile; + const formDataNameBuffer = Buffer.from("form-data; name=\""); + const filenameBuffer = Buffer.from("; filename"); + const dd = Buffer.from("--"); + const ddcrlf = Buffer.from("--\r\n"); + /** + * @param {string} chars + */ + function isAsciiString(chars) { + for (let i = 0; i < chars.length; ++i) if ((chars.charCodeAt(i) & -128) !== 0) return false; + return true; + } + /** + * @see https://andreubotella.github.io/multipart-form-data/#multipart-form-data-boundary + * @param {string} boundary + */ + function validateBoundary(boundary) { + const length = boundary.length; + if (length < 27 || length > 70) return false; + for (let i = 0; i < length; ++i) { + const cp = boundary.charCodeAt(i); + if (!(cp >= 48 && cp <= 57 || cp >= 65 && cp <= 90 || cp >= 97 && cp <= 122 || cp === 39 || cp === 45 || cp === 95)) return false; + } + return true; + } + /** + * @see https://andreubotella.github.io/multipart-form-data/#multipart-form-data-parser + * @param {Buffer} input + * @param {ReturnType} mimeType + */ + function multipartFormDataParser(input, mimeType) { + assert$21(mimeType !== "failure" && mimeType.essence === "multipart/form-data"); + const boundaryString = mimeType.parameters.get("boundary"); + if (boundaryString === void 0) return "failure"; + const boundary = Buffer.from(`--${boundaryString}`, "utf8"); + const entryList = []; + const position = { position: 0 }; + while (input[position.position] === 13 && input[position.position + 1] === 10) position.position += 2; + let trailing = input.length; + while (input[trailing - 1] === 10 && input[trailing - 2] === 13) trailing -= 2; + if (trailing !== input.length) input = input.subarray(0, trailing); + while (true) { + if (input.subarray(position.position, position.position + boundary.length).equals(boundary)) position.position += boundary.length; + else return "failure"; + if (position.position === input.length - 2 && bufferStartsWith(input, dd, position) || position.position === input.length - 4 && bufferStartsWith(input, ddcrlf, position)) return entryList; + if (input[position.position] !== 13 || input[position.position + 1] !== 10) return "failure"; + position.position += 2; + const result = parseMultipartFormDataHeaders(input, position); + if (result === "failure") return "failure"; + let { name, filename, contentType, encoding } = result; + position.position += 2; + let body; + { + const boundaryIndex = input.indexOf(boundary.subarray(2), position.position); + if (boundaryIndex === -1) return "failure"; + body = input.subarray(position.position, boundaryIndex - 4); + position.position += body.length; + if (encoding === "base64") body = Buffer.from(body.toString(), "base64"); + } + if (input[position.position] !== 13 || input[position.position + 1] !== 10) return "failure"; + else position.position += 2; + let value; + if (filename !== null) { + contentType ??= "text/plain"; + if (!isAsciiString(contentType)) contentType = ""; + value = new File([body], filename, { type: contentType }); + } else value = utf8DecodeBytes(Buffer.from(body)); + assert$21(isUSVString(name)); + assert$21(typeof value === "string" && isUSVString(value) || isFileLike(value)); + entryList.push(makeEntry(name, value, filename)); + } + } + /** + * @see https://andreubotella.github.io/multipart-form-data/#parse-multipart-form-data-headers + * @param {Buffer} input + * @param {{ position: number }} position + */ + function parseMultipartFormDataHeaders(input, position) { + let name = null; + let filename = null; + let contentType = null; + let encoding = null; + while (true) { + if (input[position.position] === 13 && input[position.position + 1] === 10) { + if (name === null) return "failure"; + return { + name, + filename, + contentType, + encoding + }; + } + let headerName = collectASequenceOfBytes((char) => char !== 10 && char !== 13 && char !== 58, input, position); + headerName = removeChars(headerName, true, true, (char) => char === 9 || char === 32); + if (!HTTP_TOKEN_CODEPOINTS.test(headerName.toString())) return "failure"; + if (input[position.position] !== 58) return "failure"; + position.position++; + collectASequenceOfBytes((char) => char === 32 || char === 9, input, position); + switch (bufferToLowerCasedHeaderName(headerName)) { + case "content-disposition": + name = filename = null; + if (!bufferStartsWith(input, formDataNameBuffer, position)) return "failure"; + position.position += 17; + name = parseMultipartFormDataName(input, position); + if (name === null) return "failure"; + if (bufferStartsWith(input, filenameBuffer, position)) { + let check = position.position + filenameBuffer.length; + if (input[check] === 42) { + position.position += 1; + check += 1; + } + if (input[check] !== 61 || input[check + 1] !== 34) return "failure"; + position.position += 12; + filename = parseMultipartFormDataName(input, position); + if (filename === null) return "failure"; + } + break; + case "content-type": { + let headerValue = collectASequenceOfBytes((char) => char !== 10 && char !== 13, input, position); + headerValue = removeChars(headerValue, false, true, (char) => char === 9 || char === 32); + contentType = isomorphicDecode(headerValue); + break; + } + case "content-transfer-encoding": { + let headerValue = collectASequenceOfBytes((char) => char !== 10 && char !== 13, input, position); + headerValue = removeChars(headerValue, false, true, (char) => char === 9 || char === 32); + encoding = isomorphicDecode(headerValue); + break; + } + default: collectASequenceOfBytes((char) => char !== 10 && char !== 13, input, position); + } + if (input[position.position] !== 13 && input[position.position + 1] !== 10) return "failure"; + else position.position += 2; + } + } + /** + * @see https://andreubotella.github.io/multipart-form-data/#parse-a-multipart-form-data-name + * @param {Buffer} input + * @param {{ position: number }} position + */ + function parseMultipartFormDataName(input, position) { + assert$21(input[position.position - 1] === 34); + /** @type {string | Buffer} */ + let name = collectASequenceOfBytes((char) => char !== 10 && char !== 13 && char !== 34, input, position); + if (input[position.position] !== 34) return null; + else position.position++; + name = new TextDecoder().decode(name).replace(/%0A/gi, "\n").replace(/%0D/gi, "\r").replace(/%22/g, "\""); + return name; + } + /** + * @param {(char: number) => boolean} condition + * @param {Buffer} input + * @param {{ position: number }} position + */ + function collectASequenceOfBytes(condition, input, position) { + let start = position.position; + while (start < input.length && condition(input[start])) ++start; + return input.subarray(position.position, position.position = start); + } + /** + * @param {Buffer} buf + * @param {boolean} leading + * @param {boolean} trailing + * @param {(charCode: number) => boolean} predicate + * @returns {Buffer} + */ + function removeChars(buf, leading, trailing, predicate) { + let lead = 0; + let trail = buf.length - 1; + if (leading) while (lead < buf.length && predicate(buf[lead])) lead++; + if (trailing) while (trail > 0 && predicate(buf[trail])) trail--; + return lead === 0 && trail === buf.length - 1 ? buf : buf.subarray(lead, trail + 1); + } + /** + * Checks if {@param buffer} starts with {@param start} + * @param {Buffer} buffer + * @param {Buffer} start + * @param {{ position: number }} position + */ + function bufferStartsWith(buffer, start, position) { + if (buffer.length < start.length) return false; + for (let i = 0; i < start.length; i++) if (start[i] !== buffer[position.position + i]) return false; + return true; + } + module.exports = { + multipartFormDataParser, + validateBoundary + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/fetch/body.js +var require_body = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const util = require_util$7(); + const { ReadableStreamFrom, isBlobLike, isReadableStreamLike, readableStreamClose, createDeferredPromise, fullyReadBody, extractMimeType, utf8DecodeBytes } = require_util$6(); + const { FormData } = require_formdata(); + const { kState } = require_symbols$3(); + const { webidl } = require_webidl(); + const { Blob: Blob$1 } = __require("node:buffer"); + const assert$20 = __require("node:assert"); + const { isErrored, isDisturbed } = __require("node:stream"); + const { isArrayBuffer } = __require("node:util/types"); + const { serializeAMimeType } = require_data_url(); + const { multipartFormDataParser } = require_formdata_parser(); + let random; + try { + const crypto = __require("node:crypto"); + random = (max) => crypto.randomInt(0, max); + } catch { + random = (max) => Math.floor(Math.random(max)); + } + const textEncoder = new TextEncoder(); + function noop() {} + const hasFinalizationRegistry = globalThis.FinalizationRegistry && process.version.indexOf("v18") !== 0; + let streamRegistry; + if (hasFinalizationRegistry) streamRegistry = new FinalizationRegistry((weakRef) => { + const stream = weakRef.deref(); + if (stream && !stream.locked && !isDisturbed(stream) && !isErrored(stream)) stream.cancel("Response object has been garbage collected").catch(noop); + }); + function extractBody(object, keepalive = false) { + let stream = null; + if (object instanceof ReadableStream) stream = object; + else if (isBlobLike(object)) stream = object.stream(); + else stream = new ReadableStream({ + async pull(controller) { + const buffer = typeof source === "string" ? textEncoder.encode(source) : source; + if (buffer.byteLength) controller.enqueue(buffer); + queueMicrotask(() => readableStreamClose(controller)); + }, + start() {}, + type: "bytes" + }); + assert$20(isReadableStreamLike(stream)); + 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 (isArrayBuffer(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 (util.isFormDataLike(object)) { + const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, "0")}`; + const prefix = `--${boundary}\r\nContent-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 chunk = textEncoder.encode(prefix + `; name="${escape(normalizeLinefeeds(name))}"\r\n\r\n${normalizeLinefeeds(value)}\r\n`); + blobParts.push(chunk); + length += chunk.byteLength; + } else { + const chunk = textEncoder.encode(`${prefix}; name="${escape(normalizeLinefeeds(name))}"` + (value.name ? `; filename="${escape(value.name)}"` : "") + `\r +Content-Type: ${value.type || "application/octet-stream"}\r\n\r\n`); + blobParts.push(chunk, value, rn); + if (typeof value.size === "number") length += chunk.byteLength + value.size + rn.byteLength; + else hasUnknownSizeValue = true; + } + const chunk = textEncoder.encode(`--${boundary}--\r\n`); + 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 (isBlobLike(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 (util.isDisturbed(object) || object.locked) throw new TypeError("Response body object should not be disturbed or locked"); + stream = object instanceof ReadableStream ? object : ReadableStreamFrom(object); + } + if (typeof source === "string" || util.isBuffer(source)) length = Buffer.byteLength(source); + if (action != null) { + let iterator; + stream = new ReadableStream({ + async start() { + iterator = action(object)[Symbol.asyncIterator](); + }, + async pull(controller) { + const { value, done } = await iterator.next(); + if (done) queueMicrotask(() => { + controller.close(); + controller.byobRequest?.respond(0); + }); + else if (!isErrored(stream)) { + const buffer = new Uint8Array(value); + if (buffer.byteLength) controller.enqueue(buffer); + } + return controller.desiredSize > 0; + }, + async cancel(reason) { + await iterator.return(); + }, + type: "bytes" + }); + } + return [{ + stream, + source, + length + }, type]; + } + function safelyExtractBody(object, keepalive = false) { + if (object instanceof ReadableStream) { + // istanbul ignore next + assert$20(!util.isDisturbed(object), "The body has already been consumed."); + // istanbul ignore next + assert$20(!object.locked, "The stream is locked."); + } + return extractBody(object, keepalive); + } + function cloneBody(instance, body) { + const [out1, out2] = body.stream.tee(); + body.stream = out1; + return { + stream: out2, + length: body.length, + source: body.source + }; + } + function throwIfAborted(state) { + if (state.aborted) throw new DOMException("The operation was aborted.", "AbortError"); + } + function bodyMixinMethods(instance) { + return { + blob() { + return consumeBody(this, (bytes) => { + let mimeType = bodyMimeType(this); + if (mimeType === null) mimeType = ""; + else if (mimeType) mimeType = serializeAMimeType(mimeType); + return new Blob$1([bytes], { type: mimeType }); + }, instance); + }, + arrayBuffer() { + return consumeBody(this, (bytes) => { + return new Uint8Array(bytes).buffer; + }, instance); + }, + text() { + return consumeBody(this, utf8DecodeBytes, instance); + }, + json() { + return consumeBody(this, parseJSONFromBytes, instance); + }, + formData() { + return consumeBody(this, (value) => { + const mimeType = bodyMimeType(this); + if (mimeType !== null) switch (mimeType.essence) { + case "multipart/form-data": { + const parsed = multipartFormDataParser(value, mimeType); + if (parsed === "failure") throw new TypeError("Failed to parse body as FormData."); + const fd = new FormData(); + fd[kState] = parsed; + return fd; + } + case "application/x-www-form-urlencoded": { + const entries = new URLSearchParams(value.toString()); + const fd = new FormData(); + for (const [name, value] of entries) fd.append(name, value); + return fd; + } + } + throw new TypeError("Content-Type was not one of \"multipart/form-data\" or \"application/x-www-form-urlencoded\"."); + }, instance); + }, + bytes() { + return consumeBody(this, (bytes) => { + return new Uint8Array(bytes); + }, instance); + } + }; + } + function mixinBody(prototype) { + Object.assign(prototype.prototype, bodyMixinMethods(prototype)); + } + /** + * @see https://fetch.spec.whatwg.org/#concept-body-consume-body + * @param {Response|Request} object + * @param {(value: unknown) => unknown} convertBytesToJSValue + * @param {Response|Request} instance + */ + async function consumeBody(object, convertBytesToJSValue, instance) { + webidl.brandCheck(object, instance); + if (bodyUnusable(object)) throw new TypeError("Body is unusable: Body has already been read"); + throwIfAborted(object[kState]); + const promise = createDeferredPromise(); + const errorSteps = (error) => promise.reject(error); + const successSteps = (data) => { + try { + promise.resolve(convertBytesToJSValue(data)); + } catch (e) { + errorSteps(e); + } + }; + if (object[kState].body == null) { + successSteps(Buffer.allocUnsafe(0)); + return promise.promise; + } + await fullyReadBody(object[kState].body, successSteps, errorSteps); + return promise.promise; + } + function bodyUnusable(object) { + const body = object[kState].body; + return body != null && (body.stream.locked || util.isDisturbed(body.stream)); + } + /** + * @see https://infra.spec.whatwg.org/#parse-json-bytes-to-a-javascript-value + * @param {Uint8Array} bytes + */ + function parseJSONFromBytes(bytes) { + return JSON.parse(utf8DecodeBytes(bytes)); + } + /** + * @see https://fetch.spec.whatwg.org/#concept-body-mime-type + * @param {import('./response').Response|import('./request').Request} requestOrResponse + */ + function bodyMimeType(requestOrResponse) { + /** @type {import('./headers').HeadersList} */ + const headers = requestOrResponse[kState].headersList; + const mimeType = extractMimeType(headers); + if (mimeType === "failure") return null; + return mimeType; + } + module.exports = { + extractBody, + safelyExtractBody, + cloneBody, + mixinBody, + streamRegistry, + hasFinalizationRegistry, + bodyUnusable + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/dispatcher/client-h1.js +var require_client_h1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const assert$19 = __require("node:assert"); + const util = require_util$7(); + const { channels } = require_diagnostics(); + const timers = require_timers(); + const { RequestContentLengthMismatchError, ResponseContentLengthMismatchError, RequestAbortedError, HeadersTimeoutError, HeadersOverflowError, SocketError, InformationalError, BodyTimeoutError, HTTPParserError, ResponseExceededMaxSizeError } = require_errors$1(); + const { kUrl, kReset, kClient, kParser, kBlocking, kRunning, kPending, kSize, kWriting, kQueue, kNoRef, kKeepAliveDefaultTimeout, kHostHeader, kPendingIdx, kRunningIdx, kError, kPipelining, kSocket, kKeepAliveTimeoutValue, kMaxHeadersSize, kKeepAliveMaxTimeout, kKeepAliveTimeoutThreshold, kHeadersTimeout, kBodyTimeout, kStrictContentLength, kMaxRequests, kCounter, kMaxResponseSize, kOnError, kResume, kHTTPContext } = require_symbols$4(); + const constants = require_constants$3(); + const EMPTY_BUF = Buffer.alloc(0); + const FastBuffer = Buffer[Symbol.species]; + const addListener = util.addListener; + const removeAllListeners = util.removeAllListeners; + let extractBody; + async function lazyllhttp() { + const llhttpWasmData = process.env.JEST_WORKER_ID ? require_llhttp_wasm() : void 0; + let mod; + try { + mod = await WebAssembly.compile(require_llhttp_simd_wasm()); + } catch (e) { + /* istanbul ignore next */ + mod = await WebAssembly.compile(llhttpWasmData || require_llhttp_wasm()); + } + return await WebAssembly.instantiate(mod, { env: { + wasm_on_url: (p, at, len) => { + /* istanbul ignore next */ + return 0; + }, + wasm_on_status: (p, at, len) => { + assert$19(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$19(currentParser.ptr === p); + return currentParser.onMessageBegin() || 0; + }, + wasm_on_header_field: (p, at, len) => { + assert$19(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$19(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, upgrade, shouldKeepAlive) => { + assert$19(currentParser.ptr === p); + return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0; + }, + wasm_on_body: (p, at, len) => { + assert$19(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$19(currentParser.ptr === p); + return currentParser.onMessageComplete() || 0; + } + } }); + } + let llhttpInstance = null; + let llhttpPromise = lazyllhttp(); + llhttpPromise.catch(); + let currentParser = null; + let currentBufferRef = null; + let currentBufferSize = 0; + let currentBufferPtr = null; + const USE_NATIVE_TIMER = 0; + const USE_FAST_TIMER = 1; + const TIMEOUT_HEADERS = 2 | USE_FAST_TIMER; + const TIMEOUT_BODY = 4 | USE_FAST_TIMER; + const TIMEOUT_KEEP_ALIVE = 8 | USE_NATIVE_TIMER; + var Parser = class { + constructor(client, socket, { exports: exports$1 }) { + assert$19(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0); + this.llhttp = exports$1; + this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE); + this.client = client; + 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 = client[kMaxHeadersSize]; + this.shouldKeepAlive = false; + this.paused = false; + this.resume = this.resume.bind(this); + this.bytesRead = 0; + this.keepAlive = ""; + this.contentLength = ""; + this.connection = ""; + this.maxResponseSize = client[kMaxResponseSize]; + } + setTimeout(delay, type) { + if (delay !== this.timeoutValue || type & USE_FAST_TIMER ^ this.timeoutType & USE_FAST_TIMER) { + if (this.timeout) { + timers.clearTimeout(this.timeout); + this.timeout = null; + } + if (delay) if (type & USE_FAST_TIMER) this.timeout = timers.setFastTimeout(onParserTimeout, delay, new WeakRef(this)); + else { + this.timeout = setTimeout(onParserTimeout, delay, new WeakRef(this)); + this.timeout.unref(); + } + this.timeoutValue = delay; + } else if (this.timeout) { + // istanbul ignore else: only for jest + if (this.timeout.refresh) this.timeout.refresh(); + } + this.timeoutType = type; + } + resume() { + if (this.socket.destroyed || !this.paused) return; + assert$19(this.ptr != null); + assert$19(currentParser == null); + this.llhttp.llhttp_resume(this.ptr); + assert$19(this.timeoutType === TIMEOUT_BODY); + if (this.timeout) { + // istanbul ignore else: only for jest + 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$19(this.ptr != null); + assert$19(currentParser == null); + assert$19(!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) { + /* istanbul ignore next: difficult to make a test case for */ + throw err; + } finally { + currentParser = null; + currentBufferRef = null; + } + const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr; + if (ret === constants.ERROR.PAUSED_UPGRADE) this.onUpgrade(data.slice(offset)); + else if (ret === constants.ERROR.PAUSED) { + this.paused = true; + socket.unshift(data.slice(offset)); + } else if (ret !== constants.ERROR.OK) { + const ptr = llhttp.llhttp_get_error_reason(this.ptr); + let message = ""; + /* istanbul ignore else: difficult to make a test case for */ + 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 HTTPParserError(message, constants.ERROR[ret], data.slice(offset)); + } + } catch (err) { + util.destroy(socket, err); + } + } + destroy() { + assert$19(this.ptr != null); + assert$19(currentParser == null); + this.llhttp.llhttp_free(this.ptr); + this.ptr = null; + this.timeout && 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 } = this; + /* istanbul ignore next: difficult to make a test case for */ + if (socket.destroyed) return -1; + const request = client[kQueue][client[kRunningIdx]]; + if (!request) return -1; + request.onResponseStarted(); + } + 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) { + const headerName = util.bufferToLowerCasedHeaderName(key); + if (headerName === "keep-alive") this.keepAlive += buf.toString(); + else if (headerName === "connection") this.connection += buf.toString(); + } else if (key.length === 14 && util.bufferToLowerCasedHeaderName(key) === "content-length") this.contentLength += buf.toString(); + this.trackHeader(buf.length); + } + trackHeader(len) { + this.headersSize += len; + if (this.headersSize >= this.headersMaxSize) util.destroy(this.socket, new HeadersOverflowError()); + } + onUpgrade(head) { + const { upgrade, client, socket, headers, statusCode } = this; + assert$19(upgrade); + assert$19(client[kSocket] === socket); + assert$19(!socket.destroyed); + assert$19(!this.paused); + assert$19((headers.length & 1) === 0); + const request = client[kQueue][client[kRunningIdx]]; + assert$19(request); + assert$19(request.upgrade || request.method === "CONNECT"); + this.statusCode = null; + this.statusText = ""; + this.shouldKeepAlive = null; + this.headers = []; + this.headersSize = 0; + socket.unshift(head); + socket[kParser].destroy(); + socket[kParser] = null; + socket[kClient] = null; + socket[kError] = null; + removeAllListeners(socket); + client[kSocket] = null; + client[kHTTPContext] = null; + client[kQueue][client[kRunningIdx]++] = null; + client.emit("disconnect", client[kUrl], [client], new InformationalError("upgrade")); + try { + request.onUpgrade(statusCode, headers, socket); + } catch (err) { + util.destroy(socket, err); + } + client[kResume](); + } + onHeadersComplete(statusCode, upgrade, shouldKeepAlive) { + const { client, socket, headers, statusText } = this; + /* istanbul ignore next: difficult to make a test case for */ + if (socket.destroyed) return -1; + const request = client[kQueue][client[kRunningIdx]]; + /* istanbul ignore next: difficult to make a test case for */ + if (!request) return -1; + assert$19(!this.upgrade); + assert$19(this.statusCode < 200); + if (statusCode === 100) { + util.destroy(socket, new SocketError("bad response", util.getSocketInfo(socket))); + return -1; + } + if (upgrade && !request.upgrade) { + util.destroy(socket, new SocketError("bad upgrade", util.getSocketInfo(socket))); + return -1; + } + assert$19(this.timeoutType === TIMEOUT_HEADERS); + this.statusCode = statusCode; + this.shouldKeepAlive = shouldKeepAlive || request.method === "HEAD" && !socket[kReset] && this.connection.toLowerCase() === "keep-alive"; + if (this.statusCode >= 200) { + const bodyTimeout = request.bodyTimeout != null ? request.bodyTimeout : client[kBodyTimeout]; + this.setTimeout(bodyTimeout, TIMEOUT_BODY); + } else if (this.timeout) { + // istanbul ignore else: only for jest + if (this.timeout.refresh) this.timeout.refresh(); + } + if (request.method === "CONNECT") { + assert$19(client[kRunning] === 1); + this.upgrade = true; + return 2; + } + if (upgrade) { + assert$19(client[kRunning] === 1); + this.upgrade = true; + return 2; + } + assert$19((this.headers.length & 1) === 0); + this.headers = []; + this.headersSize = 0; + if (this.shouldKeepAlive && client[kPipelining]) { + const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null; + if (keepAliveTimeout != null) { + const timeout = Math.min(keepAliveTimeout - client[kKeepAliveTimeoutThreshold], client[kKeepAliveMaxTimeout]); + if (timeout <= 0) socket[kReset] = true; + else client[kKeepAliveTimeoutValue] = timeout; + } else client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout]; + } else socket[kReset] = true; + const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false; + if (request.aborted) return -1; + if (request.method === "HEAD") return 1; + if (statusCode < 200) return 1; + if (socket[kBlocking]) { + socket[kBlocking] = false; + client[kResume](); + } + return pause ? constants.ERROR.PAUSED : 0; + } + onBody(buf) { + const { client, socket, statusCode, maxResponseSize } = this; + if (socket.destroyed) return -1; + const request = client[kQueue][client[kRunningIdx]]; + assert$19(request); + assert$19(this.timeoutType === TIMEOUT_BODY); + if (this.timeout) { + // istanbul ignore else: only for jest + if (this.timeout.refresh) this.timeout.refresh(); + } + assert$19(statusCode >= 200); + if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) { + util.destroy(socket, new ResponseExceededMaxSizeError()); + return -1; + } + this.bytesRead += buf.length; + if (request.onData(buf) === false) return constants.ERROR.PAUSED; + } + onMessageComplete() { + const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this; + if (socket.destroyed && (!statusCode || shouldKeepAlive)) return -1; + if (upgrade) return; + assert$19(statusCode >= 100); + assert$19((this.headers.length & 1) === 0); + const request = client[kQueue][client[kRunningIdx]]; + assert$19(request); + this.statusCode = null; + this.statusText = ""; + this.bytesRead = 0; + this.contentLength = ""; + this.keepAlive = ""; + this.connection = ""; + this.headers = []; + this.headersSize = 0; + if (statusCode < 200) return; + /* istanbul ignore next: should be handled by llhttp? */ + if (request.method !== "HEAD" && contentLength && bytesRead !== parseInt(contentLength, 10)) { + util.destroy(socket, new ResponseContentLengthMismatchError()); + return -1; + } + request.onComplete(headers); + client[kQueue][client[kRunningIdx]++] = null; + if (socket[kWriting]) { + assert$19(client[kRunning] === 0); + util.destroy(socket, new InformationalError("reset")); + return constants.ERROR.PAUSED; + } else if (!shouldKeepAlive) { + util.destroy(socket, new InformationalError("reset")); + return constants.ERROR.PAUSED; + } else if (socket[kReset] && client[kRunning] === 0) { + util.destroy(socket, new InformationalError("reset")); + return constants.ERROR.PAUSED; + } else if (client[kPipelining] == null || client[kPipelining] === 1) setImmediate(() => client[kResume]()); + else client[kResume](); + } + }; + function onParserTimeout(parser) { + const { socket, timeoutType, client, paused } = parser.deref(); + /* istanbul ignore else */ + if (timeoutType === TIMEOUT_HEADERS) { + if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) { + assert$19(!paused, "cannot be paused while waiting for headers"); + util.destroy(socket, new HeadersTimeoutError()); + } + } else if (timeoutType === TIMEOUT_BODY) { + if (!paused) util.destroy(socket, new BodyTimeoutError()); + } else if (timeoutType === TIMEOUT_KEEP_ALIVE) { + assert$19(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]); + util.destroy(socket, new InformationalError("socket idle timeout")); + } + } + async function connectH1(client, socket) { + client[kSocket] = socket; + if (!llhttpInstance) { + llhttpInstance = await llhttpPromise; + llhttpPromise = null; + } + socket[kNoRef] = false; + socket[kWriting] = false; + socket[kReset] = false; + socket[kBlocking] = false; + socket[kParser] = new Parser(client, socket, llhttpInstance); + addListener(socket, "error", function(err) { + assert$19(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); + const parser = this[kParser]; + if (err.code === "ECONNRESET" && parser.statusCode && !parser.shouldKeepAlive) { + parser.onMessageComplete(); + return; + } + this[kError] = err; + this[kClient][kOnError](err); + }); + addListener(socket, "readable", function() { + const parser = this[kParser]; + if (parser) parser.readMore(); + }); + addListener(socket, "end", function() { + const parser = this[kParser]; + if (parser.statusCode && !parser.shouldKeepAlive) { + parser.onMessageComplete(); + return; + } + util.destroy(this, new SocketError("other side closed", util.getSocketInfo(this))); + }); + addListener(socket, "close", function() { + const client = this[kClient]; + const parser = this[kParser]; + if (parser) { + if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) parser.onMessageComplete(); + this[kParser].destroy(); + this[kParser] = null; + } + const err = this[kError] || new SocketError("closed", util.getSocketInfo(this)); + client[kSocket] = null; + client[kHTTPContext] = null; + if (client.destroyed) { + assert$19(client[kPending] === 0); + const requests = client[kQueue].splice(client[kRunningIdx]); + for (let i = 0; i < requests.length; i++) { + const request = requests[i]; + util.errorRequest(client, request, err); + } + } else if (client[kRunning] > 0 && err.code !== "UND_ERR_INFO") { + const request = client[kQueue][client[kRunningIdx]]; + client[kQueue][client[kRunningIdx]++] = null; + util.errorRequest(client, request, err); + } + client[kPendingIdx] = client[kRunningIdx]; + assert$19(client[kRunning] === 0); + client.emit("disconnect", client[kUrl], [client], err); + client[kResume](); + }); + let closed = false; + socket.on("close", () => { + closed = true; + }); + return { + version: "h1", + defaultPipelining: 1, + write(...args) { + return writeH1(client, ...args); + }, + resume() { + resumeH1(client); + }, + destroy(err, callback) { + if (closed) queueMicrotask(callback); + else socket.destroy(err).on("close", callback); + }, + get destroyed() { + return socket.destroyed; + }, + busy(request) { + if (socket[kWriting] || socket[kReset] || socket[kBlocking]) return true; + if (request) { + if (client[kRunning] > 0 && !request.idempotent) return true; + if (client[kRunning] > 0 && (request.upgrade || request.method === "CONNECT")) return true; + if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 && (util.isStream(request.body) || util.isAsyncIterable(request.body) || util.isFormDataLike(request.body))) return true; + } + return false; + } + }; + } + function resumeH1(client) { + const socket = client[kSocket]; + if (socket && !socket.destroyed) { + if (client[kSize] === 0) { + if (!socket[kNoRef] && socket.unref) { + socket.unref(); + socket[kNoRef] = true; + } + } else if (socket[kNoRef] && socket.ref) { + socket.ref(); + socket[kNoRef] = false; + } + if (client[kSize] === 0) { + if (socket[kParser].timeoutType !== TIMEOUT_KEEP_ALIVE) socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_KEEP_ALIVE); + } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) { + if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) { + const request = client[kQueue][client[kRunningIdx]]; + const headersTimeout = request.headersTimeout != null ? request.headersTimeout : client[kHeadersTimeout]; + socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS); + } + } + } + } + function shouldSendContentLength(method) { + return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT"; + } + function writeH1(client, request) { + const { method, path, host, upgrade, blocking, reset } = request; + let { body, headers, contentLength } = request; + const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH"; + if (util.isFormDataLike(body)) { + if (!extractBody) extractBody = require_body().extractBody; + const [bodyStream, contentType] = extractBody(body); + if (request.contentType == null) headers.push("content-type", contentType); + body = bodyStream.stream; + contentLength = bodyStream.length; + } else if (util.isBlobLike(body) && request.contentType == null && body.type) headers.push("content-type", body.type); + if (body && typeof body.read === "function") body.read(0); + const bodyLength = util.bodyLength(body); + contentLength = bodyLength ?? contentLength; + if (contentLength === null) contentLength = request.contentLength; + if (contentLength === 0 && !expectsPayload) contentLength = null; + if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) { + if (client[kStrictContentLength]) { + util.errorRequest(client, request, new RequestContentLengthMismatchError()); + return false; + } + process.emitWarning(new RequestContentLengthMismatchError()); + } + const socket = client[kSocket]; + const abort = (err) => { + if (request.aborted || request.completed) return; + util.errorRequest(client, request, err || new RequestAbortedError()); + util.destroy(body); + util.destroy(socket, new InformationalError("aborted")); + }; + try { + request.onConnect(abort); + } catch (err) { + util.errorRequest(client, request, err); + } + if (request.aborted) return false; + if (method === "HEAD") socket[kReset] = true; + if (upgrade || method === "CONNECT") socket[kReset] = true; + if (reset != null) socket[kReset] = reset; + if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) socket[kReset] = true; + if (blocking) socket[kBlocking] = true; + let header = `${method} ${path} HTTP/1.1\r\n`; + if (typeof host === "string") header += `host: ${host}\r\n`; + else header += client[kHostHeader]; + if (upgrade) header += `connection: upgrade\r\nupgrade: ${upgrade}\r\n`; + else if (client[kPipelining] && !socket[kReset]) header += "connection: keep-alive\r\n"; + else header += "connection: close\r\n"; + if (Array.isArray(headers)) for (let n = 0; n < headers.length; n += 2) { + const key = headers[n + 0]; + const val = headers[n + 1]; + if (Array.isArray(val)) for (let i = 0; i < val.length; i++) header += `${key}: ${val[i]}\r\n`; + else header += `${key}: ${val}\r\n`; + } + if (channels.sendHeaders.hasSubscribers) channels.sendHeaders.publish({ + request, + headers: header, + socket + }); + /* istanbul ignore else: assertion */ + if (!body || bodyLength === 0) writeBuffer(abort, null, client, request, socket, contentLength, header, expectsPayload); + else if (util.isBuffer(body)) writeBuffer(abort, body, client, request, socket, contentLength, header, expectsPayload); + else if (util.isBlobLike(body)) if (typeof body.stream === "function") writeIterable(abort, body.stream(), client, request, socket, contentLength, header, expectsPayload); + else writeBlob(abort, body, client, request, socket, contentLength, header, expectsPayload); + else if (util.isStream(body)) writeStream(abort, body, client, request, socket, contentLength, header, expectsPayload); + else if (util.isIterable(body)) writeIterable(abort, body, client, request, socket, contentLength, header, expectsPayload); + else assert$19(false); + return true; + } + function writeStream(abort, body, client, request, socket, contentLength, header, expectsPayload) { + assert$19(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined"); + let finished = false; + const writer = new AsyncWriter({ + abort, + socket, + request, + contentLength, + client, + expectsPayload, + header + }); + const onData = function(chunk) { + if (finished) return; + try { + if (!writer.write(chunk) && this.pause) this.pause(); + } catch (err) { + util.destroy(this, err); + } + }; + const onDrain = function() { + if (finished) return; + if (body.resume) body.resume(); + }; + const onClose = function() { + queueMicrotask(() => { + body.removeListener("error", onFinished); + }); + if (!finished) { + const err = new RequestAbortedError(); + queueMicrotask(() => onFinished(err)); + } + }; + const onFinished = function(err) { + if (finished) return; + finished = true; + assert$19(socket.destroyed || socket[kWriting] && client[kRunning] <= 1); + socket.off("drain", onDrain).off("error", onFinished); + body.removeListener("data", onData).removeListener("end", onFinished).removeListener("close", onClose); + if (!err) try { + writer.end(); + } catch (er) { + err = er; + } + writer.destroy(err); + if (err && (err.code !== "UND_ERR_INFO" || err.message !== "reset")) util.destroy(body, err); + else util.destroy(body); + }; + body.on("data", onData).on("end", onFinished).on("error", onFinished).on("close", onClose); + if (body.resume) body.resume(); + socket.on("drain", onDrain).on("error", onFinished); + if (body.errorEmitted ?? body.errored) setImmediate(() => onFinished(body.errored)); + else if (body.endEmitted ?? body.readableEnded) setImmediate(() => onFinished(null)); + if (body.closeEmitted ?? body.closed) setImmediate(onClose); + } + function writeBuffer(abort, body, client, request, socket, contentLength, header, expectsPayload) { + try { + if (!body) if (contentLength === 0) socket.write(`${header}content-length: 0\r\n\r\n`, "latin1"); + else { + assert$19(contentLength === null, "no body must not have content length"); + socket.write(`${header}\r\n`, "latin1"); + } + else if (util.isBuffer(body)) { + assert$19(contentLength === body.byteLength, "buffer body must have content length"); + socket.cork(); + socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, "latin1"); + socket.write(body); + socket.uncork(); + request.onBodySent(body); + if (!expectsPayload && request.reset !== false) socket[kReset] = true; + } + request.onRequestSent(); + client[kResume](); + } catch (err) { + abort(err); + } + } + async function writeBlob(abort, body, client, request, socket, contentLength, header, expectsPayload) { + assert$19(contentLength === body.size, "blob body must have content length"); + try { + if (contentLength != null && contentLength !== body.size) throw new RequestContentLengthMismatchError(); + const buffer = Buffer.from(await body.arrayBuffer()); + socket.cork(); + socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, "latin1"); + socket.write(buffer); + socket.uncork(); + request.onBodySent(buffer); + request.onRequestSent(); + if (!expectsPayload && request.reset !== false) socket[kReset] = true; + client[kResume](); + } catch (err) { + abort(err); + } + } + async function writeIterable(abort, body, client, request, socket, contentLength, header, expectsPayload) { + assert$19(contentLength !== 0 || client[kRunning] === 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$19(callback === null); + if (socket[kError]) reject(socket[kError]); + else callback = resolve; + }); + socket.on("close", onDrain).on("drain", onDrain); + const writer = new AsyncWriter({ + abort, + socket, + request, + contentLength, + client, + expectsPayload, + header + }); + try { + for await (const chunk of body) { + 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); + } + } + var AsyncWriter = class { + constructor({ abort, socket, request, contentLength, client, expectsPayload, header }) { + this.socket = socket; + this.request = request; + this.contentLength = contentLength; + this.client = client; + this.bytesWritten = 0; + this.expectsPayload = expectsPayload; + this.header = header; + this.abort = abort; + socket[kWriting] = true; + } + write(chunk) { + const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = 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 (client[kStrictContentLength]) throw new RequestContentLengthMismatchError(); + process.emitWarning(new RequestContentLengthMismatchError()); + } + socket.cork(); + if (bytesWritten === 0) { + if (!expectsPayload && request.reset !== false) socket[kReset] = true; + if (contentLength === null) socket.write(`${header}transfer-encoding: chunked\r\n`, "latin1"); + else socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, "latin1"); + } + if (contentLength === null) socket.write(`\r\n${len.toString(16)}\r\n`, "latin1"); + this.bytesWritten += len; + const ret = socket.write(chunk); + socket.uncork(); + request.onBodySent(chunk); + if (!ret) { + if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) { + // istanbul ignore else: only for jest + if (socket[kParser].timeout.refresh) socket[kParser].timeout.refresh(); + } + } + return ret; + } + end() { + const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this; + request.onRequestSent(); + socket[kWriting] = false; + if (socket[kError]) throw socket[kError]; + if (socket.destroyed) return; + if (bytesWritten === 0) if (expectsPayload) socket.write(`${header}content-length: 0\r\n\r\n`, "latin1"); + else socket.write(`${header}\r\n`, "latin1"); + else if (contentLength === null) socket.write("\r\n0\r\n\r\n", "latin1"); + if (contentLength !== null && bytesWritten !== contentLength) if (client[kStrictContentLength]) throw new RequestContentLengthMismatchError(); + else process.emitWarning(new RequestContentLengthMismatchError()); + if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) { + // istanbul ignore else: only for jest + if (socket[kParser].timeout.refresh) socket[kParser].timeout.refresh(); + } + client[kResume](); + } + destroy(err) { + const { socket, client, abort } = this; + socket[kWriting] = false; + if (err) { + assert$19(client[kRunning] <= 1, "pipeline should only contain this request"); + abort(err); + } + } + }; + module.exports = connectH1; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/dispatcher/client-h2.js +var require_client_h2 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const assert$18 = __require("node:assert"); + const { pipeline: pipeline$2 } = __require("node:stream"); + const util = require_util$7(); + const { RequestContentLengthMismatchError, RequestAbortedError, SocketError, InformationalError } = require_errors$1(); + const { kUrl, kReset, kClient, kRunning, kPending, kQueue, kPendingIdx, kRunningIdx, kError, kSocket, kStrictContentLength, kOnError, kMaxConcurrentStreams, kHTTP2Session, kResume, kSize, kHTTPContext } = require_symbols$4(); + const kOpenStreams = Symbol("open streams"); + let extractBody; + let h2ExperimentalWarned = false; + /** @type {import('http2')} */ + let http2; + try { + http2 = __require("node: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; + function parseH2Headers(headers) { + const result = []; + for (const [name, value] of Object.entries(headers)) if (Array.isArray(value)) for (const subvalue of value) result.push(Buffer.from(name), Buffer.from(subvalue)); + else result.push(Buffer.from(name), Buffer.from(value)); + return result; + } + async function connectH2(client, socket) { + client[kSocket] = socket; + if (!h2ExperimentalWarned) { + h2ExperimentalWarned = true; + process.emitWarning("H2 support is experimental, expect them to change at any time.", { code: "UNDICI-H2" }); + } + const session = http2.connect(client[kUrl], { + createConnection: () => socket, + peerMaxConcurrentStreams: client[kMaxConcurrentStreams] + }); + session[kOpenStreams] = 0; + session[kClient] = client; + session[kSocket] = socket; + util.addListener(session, "error", onHttp2SessionError); + util.addListener(session, "frameError", onHttp2FrameError); + util.addListener(session, "end", onHttp2SessionEnd); + util.addListener(session, "goaway", onHTTP2GoAway); + util.addListener(session, "close", function() { + const { [kClient]: client } = this; + const { [kSocket]: socket } = client; + const err = this[kSocket][kError] || this[kError] || new SocketError("closed", util.getSocketInfo(socket)); + client[kHTTP2Session] = null; + if (client.destroyed) { + assert$18(client[kPending] === 0); + const requests = client[kQueue].splice(client[kRunningIdx]); + for (let i = 0; i < requests.length; i++) { + const request = requests[i]; + util.errorRequest(client, request, err); + } + } + }); + session.unref(); + client[kHTTP2Session] = session; + socket[kHTTP2Session] = session; + util.addListener(socket, "error", function(err) { + assert$18(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); + this[kError] = err; + this[kClient][kOnError](err); + }); + util.addListener(socket, "end", function() { + util.destroy(this, new SocketError("other side closed", util.getSocketInfo(this))); + }); + util.addListener(socket, "close", function() { + const err = this[kError] || new SocketError("closed", util.getSocketInfo(this)); + client[kSocket] = null; + if (this[kHTTP2Session] != null) this[kHTTP2Session].destroy(err); + client[kPendingIdx] = client[kRunningIdx]; + assert$18(client[kRunning] === 0); + client.emit("disconnect", client[kUrl], [client], err); + client[kResume](); + }); + let closed = false; + socket.on("close", () => { + closed = true; + }); + return { + version: "h2", + defaultPipelining: Infinity, + write(...args) { + return writeH2(client, ...args); + }, + resume() { + resumeH2(client); + }, + destroy(err, callback) { + if (closed) queueMicrotask(callback); + else socket.destroy(err).on("close", callback); + }, + get destroyed() { + return socket.destroyed; + }, + busy() { + return false; + } + }; + } + function resumeH2(client) { + const socket = client[kSocket]; + if (socket?.destroyed === false) if (client[kSize] === 0 && client[kMaxConcurrentStreams] === 0) { + socket.unref(); + client[kHTTP2Session].unref(); + } else { + socket.ref(); + client[kHTTP2Session].ref(); + } + } + function onHttp2SessionError(err) { + assert$18(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); + this[kSocket][kError] = err; + this[kClient][kOnError](err); + } + function onHttp2FrameError(type, code, id) { + if (id === 0) { + const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`); + this[kSocket][kError] = err; + this[kClient][kOnError](err); + } + } + function onHttp2SessionEnd() { + const err = new SocketError("other side closed", util.getSocketInfo(this[kSocket])); + this.destroy(err); + util.destroy(this[kSocket], err); + } + /** + * This is the root cause of #3011 + * We need to handle GOAWAY frames properly, and trigger the session close + * along with the socket right away + */ + function onHTTP2GoAway(code) { + const err = this[kError] || new SocketError(`HTTP/2: "GOAWAY" frame received with code ${code}`, util.getSocketInfo(this)); + const client = this[kClient]; + client[kSocket] = null; + client[kHTTPContext] = null; + if (this[kHTTP2Session] != null) { + this[kHTTP2Session].destroy(err); + this[kHTTP2Session] = null; + } + util.destroy(this[kSocket], err); + if (client[kRunningIdx] < client[kQueue].length) { + const request = client[kQueue][client[kRunningIdx]]; + client[kQueue][client[kRunningIdx]++] = null; + util.errorRequest(client, request, err); + client[kPendingIdx] = client[kRunningIdx]; + } + assert$18(client[kRunning] === 0); + client.emit("disconnect", client[kUrl], [client], err); + client[kResume](); + } + function shouldSendContentLength(method) { + return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT"; + } + function writeH2(client, request) { + const session = client[kHTTP2Session]; + const { method, path, host, upgrade, expectContinue, signal, headers: reqHeaders } = request; + let { body } = request; + if (upgrade) { + util.errorRequest(client, request, /* @__PURE__ */ new Error("Upgrade not supported for H2")); + return false; + } + const headers = {}; + for (let n = 0; n < reqHeaders.length; n += 2) { + const key = reqHeaders[n + 0]; + const val = reqHeaders[n + 1]; + if (Array.isArray(val)) for (let i = 0; i < val.length; i++) if (headers[key]) headers[key] += `,${val[i]}`; + else headers[key] = val[i]; + else headers[key] = val; + } + /** @type {import('node:http2').ClientHttp2Stream} */ + let stream; + const { hostname, port } = client[kUrl]; + headers[HTTP2_HEADER_AUTHORITY] = host || `${hostname}${port ? `:${port}` : ""}`; + headers[HTTP2_HEADER_METHOD] = method; + const abort = (err) => { + if (request.aborted || request.completed) return; + err = err || new RequestAbortedError(); + util.errorRequest(client, request, err); + if (stream != null) util.destroy(stream, err); + util.destroy(body, err); + client[kQueue][client[kRunningIdx]++] = null; + client[kResume](); + }; + try { + request.onConnect(abort); + } catch (err) { + util.errorRequest(client, request, err); + } + if (request.aborted) return false; + if (method === "CONNECT") { + session.ref(); + stream = session.request(headers, { + endStream: false, + signal + }); + if (stream.id && !stream.pending) { + request.onUpgrade(null, null, stream); + ++session[kOpenStreams]; + client[kQueue][client[kRunningIdx]++] = null; + } else stream.once("ready", () => { + request.onUpgrade(null, null, stream); + ++session[kOpenStreams]; + client[kQueue][client[kRunningIdx]++] = null; + }); + stream.once("close", () => { + session[kOpenStreams] -= 1; + if (session[kOpenStreams] === 0) session.unref(); + }); + return true; + } + headers[HTTP2_HEADER_PATH] = path; + headers[HTTP2_HEADER_SCHEME] = "https"; + const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; + if (body && typeof body.read === "function") body.read(0); + let contentLength = util.bodyLength(body); + if (util.isFormDataLike(body)) { + extractBody ??= require_body().extractBody; + const [bodyStream, contentType] = extractBody(body); + headers["content-type"] = contentType; + body = bodyStream.stream; + contentLength = bodyStream.length; + } + if (contentLength == null) contentLength = request.contentLength; + if (contentLength === 0 || !expectsPayload) contentLength = null; + if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength != null && request.contentLength !== contentLength) { + if (client[kStrictContentLength]) { + util.errorRequest(client, request, new RequestContentLengthMismatchError()); + return false; + } + process.emitWarning(new RequestContentLengthMismatchError()); + } + if (contentLength != null) { + assert$18(body, "no body must not have content length"); + headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`; + } + session.ref(); + const shouldEndStream = method === "GET" || method === "HEAD" || body === null; + if (expectContinue) { + headers[HTTP2_HEADER_EXPECT] = "100-continue"; + stream = session.request(headers, { + endStream: shouldEndStream, + signal + }); + stream.once("continue", writeBodyH2); + } else { + stream = session.request(headers, { + endStream: shouldEndStream, + signal + }); + writeBodyH2(); + } + ++session[kOpenStreams]; + stream.once("response", (headers) => { + const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers; + request.onResponseStarted(); + if (request.aborted) { + const err = new RequestAbortedError(); + util.errorRequest(client, request, err); + util.destroy(stream, err); + return; + } + if (request.onHeaders(Number(statusCode), parseH2Headers(realHeaders), stream.resume.bind(stream), "") === false) stream.pause(); + stream.on("data", (chunk) => { + if (request.onData(chunk) === false) stream.pause(); + }); + }); + stream.once("end", () => { + if (stream.state?.state == null || stream.state.state < 6) request.onComplete([]); + if (session[kOpenStreams] === 0) session.unref(); + abort(new InformationalError("HTTP/2: stream half-closed (remote)")); + client[kQueue][client[kRunningIdx]++] = null; + client[kPendingIdx] = client[kRunningIdx]; + client[kResume](); + }); + stream.once("close", () => { + session[kOpenStreams] -= 1; + if (session[kOpenStreams] === 0) session.unref(); + }); + stream.once("error", function(err) { + abort(err); + }); + stream.once("frameError", (type, code) => { + abort(new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)); + }); + return true; + function writeBodyH2() { + /* istanbul ignore else: assertion */ + if (!body || contentLength === 0) writeBuffer(abort, stream, null, client, request, client[kSocket], contentLength, expectsPayload); + else if (util.isBuffer(body)) writeBuffer(abort, stream, body, client, request, client[kSocket], contentLength, expectsPayload); + else if (util.isBlobLike(body)) if (typeof body.stream === "function") writeIterable(abort, stream, body.stream(), client, request, client[kSocket], contentLength, expectsPayload); + else writeBlob(abort, stream, body, client, request, client[kSocket], contentLength, expectsPayload); + else if (util.isStream(body)) writeStream(abort, client[kSocket], expectsPayload, stream, body, client, request, contentLength); + else if (util.isIterable(body)) writeIterable(abort, stream, body, client, request, client[kSocket], contentLength, expectsPayload); + else assert$18(false); + } + } + function writeBuffer(abort, h2stream, body, client, request, socket, contentLength, expectsPayload) { + try { + if (body != null && util.isBuffer(body)) { + assert$18(contentLength === body.byteLength, "buffer body must have content length"); + h2stream.cork(); + h2stream.write(body); + h2stream.uncork(); + h2stream.end(); + request.onBodySent(body); + } + if (!expectsPayload) socket[kReset] = true; + request.onRequestSent(); + client[kResume](); + } catch (error) { + abort(error); + } + } + function writeStream(abort, socket, expectsPayload, h2stream, body, client, request, contentLength) { + assert$18(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined"); + const pipe = pipeline$2(body, h2stream, (err) => { + if (err) { + util.destroy(pipe, err); + abort(err); + } else { + util.removeAllListeners(pipe); + request.onRequestSent(); + if (!expectsPayload) socket[kReset] = true; + client[kResume](); + } + }); + util.addListener(pipe, "data", onPipeData); + function onPipeData(chunk) { + request.onBodySent(chunk); + } + } + async function writeBlob(abort, h2stream, body, client, request, socket, contentLength, expectsPayload) { + assert$18(contentLength === body.size, "blob body must have content length"); + try { + if (contentLength != null && contentLength !== body.size) throw new RequestContentLengthMismatchError(); + const buffer = Buffer.from(await body.arrayBuffer()); + h2stream.cork(); + h2stream.write(buffer); + h2stream.uncork(); + h2stream.end(); + request.onBodySent(buffer); + request.onRequestSent(); + if (!expectsPayload) socket[kReset] = true; + client[kResume](); + } catch (err) { + abort(err); + } + } + async function writeIterable(abort, h2stream, body, client, request, socket, contentLength, expectsPayload) { + assert$18(contentLength !== 0 || client[kRunning] === 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$18(callback === null); + if (socket[kError]) reject(socket[kError]); + else callback = resolve; + }); + h2stream.on("close", onDrain).on("drain", onDrain); + try { + for await (const chunk of body) { + if (socket[kError]) throw socket[kError]; + const res = h2stream.write(chunk); + request.onBodySent(chunk); + if (!res) await waitForDrain(); + } + h2stream.end(); + request.onRequestSent(); + if (!expectsPayload) socket[kReset] = true; + client[kResume](); + } catch (err) { + abort(err); + } finally { + h2stream.off("close", onDrain).off("drain", onDrain); + } + } + module.exports = connectH2; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/handler/redirect-handler.js +var require_redirect_handler = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const util = require_util$7(); + const { kBodyUsed } = require_symbols$4(); + const assert$17 = __require("node:assert"); + const { InvalidArgumentError } = require_errors$1(); + const EE$1 = __require("node:events"); + const redirectableStatusCodes = [ + 300, + 301, + 302, + 303, + 307, + 308 + ]; + const kBody = Symbol("body"); + var BodyAsyncIterable = class { + constructor(body) { + this[kBody] = body; + this[kBodyUsed] = false; + } + async *[Symbol.asyncIterator]() { + assert$17(!this[kBodyUsed], "disturbed"); + this[kBodyUsed] = true; + yield* this[kBody]; + } + }; + var RedirectHandler = class { + constructor(dispatch, maxRedirections, opts, handler) { + if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) throw new InvalidArgumentError("maxRedirections must be a positive number"); + util.validateHandler(handler, opts.method, opts.upgrade); + this.dispatch = dispatch; + this.location = null; + this.abort = null; + this.opts = { + ...opts, + maxRedirections: 0 + }; + this.maxRedirections = maxRedirections; + this.handler = handler; + this.history = []; + this.redirectionLimitReached = false; + if (util.isStream(this.opts.body)) { + if (util.bodyLength(this.opts.body) === 0) this.opts.body.on("data", function() { + assert$17(false); + }); + if (typeof this.opts.body.readableDidRead !== "boolean") { + this.opts.body[kBodyUsed] = false; + EE$1.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.isIterable(this.opts.body)) this.opts.body = new BodyAsyncIterable(this.opts.body); + } + onConnect(abort) { + this.abort = abort; + this.handler.onConnect(abort, { history: this.history }); + } + onUpgrade(statusCode, headers, socket) { + this.handler.onUpgrade(statusCode, headers, socket); + } + onError(error) { + this.handler.onError(error); + } + onHeaders(statusCode, headers, resume, statusText) { + this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers); + if (this.opts.throwOnMaxRedirect && this.history.length >= this.maxRedirections) { + if (this.request) this.request.abort(/* @__PURE__ */ new Error("max redirects")); + this.redirectionLimitReached = true; + this.abort(/* @__PURE__ */ new Error("max redirects")); + return; + } + if (this.opts.origin) this.history.push(new URL(this.opts.path, this.opts.origin)); + if (!this.location) return this.handler.onHeaders(statusCode, headers, resume, statusText); + const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); + const path = search ? `${pathname}${search}` : pathname; + this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); + this.opts.path = path; + 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, headers) { + if (redirectableStatusCodes.indexOf(statusCode) === -1) return null; + for (let i = 0; i < headers.length; i += 2) if (headers[i].length === 8 && util.headerNameToString(headers[i]) === "location") return headers[i + 1]; + } + function shouldRemoveHeader(header, removeContent, unknownOrigin) { + if (header.length === 4) return util.headerNameToString(header) === "host"; + if (removeContent && util.headerNameToString(header).startsWith("content-")) return true; + if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) { + const name = util.headerNameToString(header); + return name === "authorization" || name === "cookie" || name === "proxy-authorization"; + } + return false; + } + function cleanRequestHeaders(headers, removeContent, unknownOrigin) { + const ret = []; + if (Array.isArray(headers)) { + for (let i = 0; i < headers.length; i += 2) if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) ret.push(headers[i], headers[i + 1]); + } else if (headers && typeof headers === "object") { + for (const key of Object.keys(headers)) if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) ret.push(key, headers[key]); + } else assert$17(headers == null, "headers must be an object or an array"); + return ret; + } + module.exports = RedirectHandler; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/interceptor/redirect-interceptor.js +var require_redirect_interceptor = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const RedirectHandler = require_redirect_handler(); + function createRedirectInterceptor({ maxRedirections: defaultMaxRedirections }) { + return (dispatch) => { + return function Intercept(opts, handler) { + const { maxRedirections = defaultMaxRedirections } = opts; + if (!maxRedirections) return dispatch(opts, handler); + const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler); + opts = { + ...opts, + maxRedirections: 0 + }; + return dispatch(opts, redirectHandler); + }; + }; + } + module.exports = createRedirectInterceptor; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/dispatcher/client.js +var require_client = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const assert$16 = __require("node:assert"); + const net = __require("node:net"); + const http$1 = __require("node:http"); + const util = require_util$7(); + const { channels } = require_diagnostics(); + const Request = require_request$1(); + const DispatcherBase = require_dispatcher_base(); + const { InvalidArgumentError, InformationalError, ClientDestroyedError } = require_errors$1(); + const buildConnector = require_connect(); + const { kUrl, kServerName, kClient, kBusy, kConnect, kResuming, kRunning, kPending, kSize, kQueue, kConnected, kConnecting, kNeedDrain, kKeepAliveDefaultTimeout, kHostHeader, kPendingIdx, kRunningIdx, kError, kPipelining, kKeepAliveTimeoutValue, kMaxHeadersSize, kKeepAliveMaxTimeout, kKeepAliveTimeoutThreshold, kHeadersTimeout, kBodyTimeout, kStrictContentLength, kConnector, kMaxRedirections, kMaxRequests, kCounter, kClose, kDestroy, kDispatch, kInterceptors, kLocalAddress, kMaxResponseSize, kOnError, kHTTPContext, kMaxConcurrentStreams, kResume } = require_symbols$4(); + const connectH1 = require_client_h1(); + const connectH2 = require_client_h2(); + let deprecatedInterceptorWarned = false; + const kClosedResolve = Symbol("kClosedResolve"); + const noop = () => {}; + function getPipelining(client) { + return client[kPipelining] ?? client[kHTTPContext]?.defaultPipelining ?? 1; + } + /** + * @type {import('../../types/client.js').default} + */ + var Client = class extends DispatcherBase { + /** + * + * @param {string|URL} url + * @param {import('../../types/client.js').Client.Options} options + */ + constructor(url, { interceptors, maxHeaderSize, headersTimeout, socketTimeout, requestTimeout, connectTimeout, bodyTimeout, idleTimeout, keepAlive, keepAliveTimeout, maxKeepAliveTimeout, keepAliveMaxTimeout, keepAliveTimeoutThreshold, socketPath, pipelining, tls, strictContentLength, maxCachedSessions, maxRedirections, connect, maxRequestsPerClient, localAddress, maxResponseSize, autoSelectFamily, autoSelectFamilyAttemptTimeout, maxConcurrentStreams, allowH2 } = {}) { + super(); + if (keepAlive !== void 0) throw new InvalidArgumentError("unsupported keepAlive, use pipelining=0 instead"); + if (socketTimeout !== void 0) throw new InvalidArgumentError("unsupported socketTimeout, use headersTimeout & bodyTimeout instead"); + if (requestTimeout !== void 0) throw new InvalidArgumentError("unsupported requestTimeout, use headersTimeout & bodyTimeout instead"); + if (idleTimeout !== void 0) throw new InvalidArgumentError("unsupported idleTimeout, use keepAliveTimeout instead"); + if (maxKeepAliveTimeout !== void 0) throw new InvalidArgumentError("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead"); + if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) throw new InvalidArgumentError("invalid maxHeaderSize"); + if (socketPath != null && typeof socketPath !== "string") throw new InvalidArgumentError("invalid socketPath"); + if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) throw new InvalidArgumentError("invalid connectTimeout"); + if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) throw new InvalidArgumentError("invalid keepAliveTimeout"); + if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) throw new InvalidArgumentError("invalid keepAliveMaxTimeout"); + if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) throw new InvalidArgumentError("invalid keepAliveTimeoutThreshold"); + if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) throw new InvalidArgumentError("headersTimeout must be a positive integer or zero"); + if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) throw new InvalidArgumentError("bodyTimeout must be a positive integer or zero"); + if (connect != null && typeof connect !== "function" && typeof connect !== "object") throw new InvalidArgumentError("connect must be a function or an object"); + if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) throw new InvalidArgumentError("maxRedirections must be a positive number"); + if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) throw new InvalidArgumentError("maxRequestsPerClient must be a positive number"); + if (localAddress != null && (typeof localAddress !== "string" || net.isIP(localAddress) === 0)) throw new InvalidArgumentError("localAddress must be valid string IP address"); + if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) throw new InvalidArgumentError("maxResponseSize must be a positive number"); + if (autoSelectFamilyAttemptTimeout != null && (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)) throw new InvalidArgumentError("autoSelectFamilyAttemptTimeout must be a positive number"); + if (allowH2 != null && typeof allowH2 !== "boolean") throw new InvalidArgumentError("allowH2 must be a valid boolean value"); + if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== "number" || maxConcurrentStreams < 1)) throw new InvalidArgumentError("maxConcurrentStreams must be a positive integer, greater than 0"); + if (typeof connect !== "function") connect = buildConnector({ + ...tls, + maxCachedSessions, + allowH2, + socketPath, + timeout: connectTimeout, + ...autoSelectFamily ? { + autoSelectFamily, + autoSelectFamilyAttemptTimeout + } : void 0, + ...connect + }); + if (interceptors?.Client && Array.isArray(interceptors.Client)) { + this[kInterceptors] = interceptors.Client; + if (!deprecatedInterceptorWarned) { + deprecatedInterceptorWarned = true; + process.emitWarning("Client.Options#interceptor is deprecated. Use Dispatcher#compose instead.", { code: "UNDICI-CLIENT-INTERCEPTOR-DEPRECATED" }); + } + } else this[kInterceptors] = [createRedirectInterceptor({ maxRedirections })]; + this[kUrl] = util.parseOrigin(url); + this[kConnector] = connect; + 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 ? 2e3 : keepAliveTimeoutThreshold; + this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout]; + this[kServerName] = null; + this[kLocalAddress] = localAddress != null ? localAddress : null; + this[kResuming] = 0; + this[kNeedDrain] = 0; + this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ""}\r\n`; + this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 3e5; + this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 3e5; + this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength; + this[kMaxRedirections] = maxRedirections; + this[kMaxRequests] = maxRequestsPerClient; + this[kClosedResolve] = null; + this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1; + this[kMaxConcurrentStreams] = maxConcurrentStreams != null ? maxConcurrentStreams : 100; + this[kHTTPContext] = null; + this[kQueue] = []; + this[kRunningIdx] = 0; + this[kPendingIdx] = 0; + this[kResume] = (sync) => resume(this, sync); + this[kOnError] = (err) => onError(this, err); + } + get pipelining() { + return this[kPipelining]; + } + set pipelining(value) { + this[kPipelining] = value; + this[kResume](true); + } + get [kPending]() { + return this[kQueue].length - this[kPendingIdx]; + } + get [kRunning]() { + return this[kPendingIdx] - this[kRunningIdx]; + } + get [kSize]() { + return this[kQueue].length - this[kRunningIdx]; + } + get [kConnected]() { + return !!this[kHTTPContext] && !this[kConnecting] && !this[kHTTPContext].destroyed; + } + get [kBusy]() { + return Boolean(this[kHTTPContext]?.busy(null) || this[kSize] >= (getPipelining(this) || 1) || this[kPending] > 0); + } + /* istanbul ignore: only used for test */ + [kConnect](cb) { + connect(this); + this.once("connect", cb); + } + [kDispatch](opts, handler) { + const request = new Request(opts.origin || this[kUrl].origin, opts, handler); + this[kQueue].push(request); + if (this[kResuming]) {} else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) { + this[kResuming] = 1; + queueMicrotask(() => resume(this)); + } else this[kResume](true); + if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) this[kNeedDrain] = 2; + return this[kNeedDrain] < 2; + } + async [kClose]() { + return new Promise((resolve) => { + if (this[kSize]) this[kClosedResolve] = resolve; + else resolve(null); + }); + } + async [kDestroy](err) { + return new Promise((resolve) => { + const requests = this[kQueue].splice(this[kPendingIdx]); + for (let i = 0; i < requests.length; i++) { + const request = requests[i]; + util.errorRequest(this, request, err); + } + const callback = () => { + if (this[kClosedResolve]) { + this[kClosedResolve](); + this[kClosedResolve] = null; + } + resolve(null); + }; + if (this[kHTTPContext]) { + this[kHTTPContext].destroy(err, callback); + this[kHTTPContext] = null; + } else queueMicrotask(callback); + this[kResume](); + }); + } + }; + const createRedirectInterceptor = require_redirect_interceptor(); + function onError(client, err) { + if (client[kRunning] === 0 && err.code !== "UND_ERR_INFO" && err.code !== "UND_ERR_SOCKET") { + assert$16(client[kPendingIdx] === client[kRunningIdx]); + const requests = client[kQueue].splice(client[kRunningIdx]); + for (let i = 0; i < requests.length; i++) { + const request = requests[i]; + util.errorRequest(client, request, err); + } + assert$16(client[kSize] === 0); + } + } + /** + * @param {Client} client + * @returns + */ + async function connect(client) { + assert$16(!client[kConnecting]); + assert$16(!client[kHTTPContext]); + let { host, hostname, protocol, port } = client[kUrl]; + if (hostname[0] === "[") { + const idx = hostname.indexOf("]"); + assert$16(idx !== -1); + const ip = hostname.substring(1, idx); + assert$16(net.isIP(ip)); + hostname = ip; + } + client[kConnecting] = true; + if (channels.beforeConnect.hasSubscribers) channels.beforeConnect.publish({ + connectParams: { + host, + hostname, + protocol, + port, + version: client[kHTTPContext]?.version, + servername: client[kServerName], + localAddress: client[kLocalAddress] + }, + connector: client[kConnector] + }); + try { + const socket = await new Promise((resolve, reject) => { + client[kConnector]({ + host, + hostname, + protocol, + port, + servername: client[kServerName], + localAddress: client[kLocalAddress] + }, (err, socket) => { + if (err) reject(err); + else resolve(socket); + }); + }); + if (client.destroyed) { + util.destroy(socket.on("error", noop), new ClientDestroyedError()); + return; + } + assert$16(socket); + try { + client[kHTTPContext] = socket.alpnProtocol === "h2" ? await connectH2(client, socket) : await connectH1(client, socket); + } catch (err) { + socket.destroy().on("error", noop); + throw err; + } + client[kConnecting] = false; + socket[kCounter] = 0; + socket[kMaxRequests] = client[kMaxRequests]; + socket[kClient] = client; + socket[kError] = null; + if (channels.connected.hasSubscribers) channels.connected.publish({ + connectParams: { + host, + hostname, + protocol, + port, + version: client[kHTTPContext]?.version, + servername: client[kServerName], + localAddress: client[kLocalAddress] + }, + connector: client[kConnector], + socket + }); + client.emit("connect", client[kUrl], [client]); + } catch (err) { + if (client.destroyed) return; + client[kConnecting] = false; + if (channels.connectError.hasSubscribers) channels.connectError.publish({ + connectParams: { + host, + hostname, + protocol, + port, + version: client[kHTTPContext]?.version, + servername: client[kServerName], + localAddress: client[kLocalAddress] + }, + connector: client[kConnector], + error: err + }); + if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") { + assert$16(client[kRunning] === 0); + while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) { + const request = client[kQueue][client[kPendingIdx]++]; + util.errorRequest(client, request, err); + } + } else onError(client, err); + client.emit("connectionError", client[kUrl], [client], err); + } + client[kResume](); + } + function emitDrain(client) { + client[kNeedDrain] = 0; + client.emit("drain", client[kUrl], [client]); + } + function resume(client, sync) { + if (client[kResuming] === 2) return; + client[kResuming] = 2; + _resume(client, sync); + client[kResuming] = 0; + if (client[kRunningIdx] > 256) { + client[kQueue].splice(0, client[kRunningIdx]); + client[kPendingIdx] -= client[kRunningIdx]; + client[kRunningIdx] = 0; + } + } + function _resume(client, sync) { + while (true) { + if (client.destroyed) { + assert$16(client[kPending] === 0); + return; + } + if (client[kClosedResolve] && !client[kSize]) { + client[kClosedResolve](); + client[kClosedResolve] = null; + return; + } + if (client[kHTTPContext]) client[kHTTPContext].resume(); + if (client[kBusy]) client[kNeedDrain] = 2; + else if (client[kNeedDrain] === 2) { + if (sync) { + client[kNeedDrain] = 1; + queueMicrotask(() => emitDrain(client)); + } else emitDrain(client); + continue; + } + if (client[kPending] === 0) return; + if (client[kRunning] >= (getPipelining(client) || 1)) return; + const request = client[kQueue][client[kPendingIdx]]; + if (client[kUrl].protocol === "https:" && client[kServerName] !== request.servername) { + if (client[kRunning] > 0) return; + client[kServerName] = request.servername; + client[kHTTPContext]?.destroy(new InformationalError("servername changed"), () => { + client[kHTTPContext] = null; + resume(client); + }); + } + if (client[kConnecting]) return; + if (!client[kHTTPContext]) { + connect(client); + return; + } + if (client[kHTTPContext].destroyed) return; + if (client[kHTTPContext].busy(request)) return; + if (!request.aborted && client[kHTTPContext].write(request)) client[kPendingIdx]++; + else client[kQueue].splice(client[kPendingIdx], 1); + } + } + module.exports = Client; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/dispatcher/fixed-queue.js +var require_fixed_queue = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const kSize = 2048; + const kMask = kSize - 1; + var FixedCircularBuffer = class { + constructor() { + this.bottom = 0; + this.top = 0; + this.list = new Array(kSize); + 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; + } + }; + module.exports = 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; + } + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/dispatcher/pool-stats.js +var require_pool_stats = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = require_symbols$4(); + const kPool = Symbol("pool"); + var PoolStats = class { + constructor(pool) { + this[kPool] = pool; + } + get connected() { + return this[kPool][kConnected]; + } + get free() { + return this[kPool][kFree]; + } + get pending() { + return this[kPool][kPending]; + } + get queued() { + return this[kPool][kQueued]; + } + get running() { + return this[kPool][kRunning]; + } + get size() { + return this[kPool][kSize]; + } + }; + module.exports = PoolStats; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/dispatcher/pool-base.js +var require_pool_base = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const DispatcherBase = require_dispatcher_base(); + const FixedQueue = require_fixed_queue(); + const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = require_symbols$4(); + const PoolStats = require_pool_stats(); + const kClients = Symbol("clients"); + const kNeedDrain = Symbol("needDrain"); + const kQueue = Symbol("queue"); + const kClosedResolve = Symbol("closed resolve"); + const kOnDrain = Symbol("onDrain"); + const kOnConnect = Symbol("onConnect"); + const kOnDisconnect = Symbol("onDisconnect"); + const kOnConnectionError = Symbol("onConnectionError"); + const kGetDispatcher = Symbol("get dispatcher"); + const kAddClient = Symbol("add client"); + const kRemoveClient = Symbol("remove client"); + const kStats = Symbol("stats"); + var PoolBase = class extends DispatcherBase { + constructor() { + super(); + this[kQueue] = new FixedQueue(); + this[kClients] = []; + this[kQueued] = 0; + const pool = this; + this[kOnDrain] = function onDrain(origin, targets) { + const queue = pool[kQueue]; + let needDrain = false; + while (!needDrain) { + const item = queue.shift(); + if (!item) break; + pool[kQueued]--; + needDrain = !this.dispatch(item.opts, item.handler); + } + this[kNeedDrain] = needDrain; + if (!this[kNeedDrain] && pool[kNeedDrain]) { + pool[kNeedDrain] = false; + pool.emit("drain", origin, [pool, ...targets]); + } + if (pool[kClosedResolve] && queue.isEmpty()) Promise.all(pool[kClients].map((c) => c.close())).then(pool[kClosedResolve]); + }; + this[kOnConnect] = (origin, targets) => { + pool.emit("connect", origin, [pool, ...targets]); + }; + this[kOnDisconnect] = (origin, targets, err) => { + pool.emit("disconnect", origin, [pool, ...targets], err); + }; + this[kOnConnectionError] = (origin, targets, err) => { + pool.emit("connectionError", origin, [pool, ...targets], err); + }; + this[kStats] = new PoolStats(this); + } + get [kBusy]() { + return this[kNeedDrain]; + } + get [kConnected]() { + return this[kClients].filter((client) => client[kConnected]).length; + } + get [kFree]() { + return this[kClients].filter((client) => client[kConnected] && !client[kNeedDrain]).length; + } + get [kPending]() { + let ret = this[kQueued]; + for (const { [kPending]: pending } of this[kClients]) ret += pending; + return ret; + } + get [kRunning]() { + let ret = 0; + for (const { [kRunning]: running } of this[kClients]) ret += running; + return ret; + } + get [kSize]() { + let ret = this[kQueued]; + for (const { [kSize]: size } of this[kClients]) ret += size; + return ret; + } + get stats() { + return this[kStats]; + } + async [kClose]() { + if (this[kQueue].isEmpty()) await Promise.all(this[kClients].map((c) => c.close())); + else await new Promise((resolve) => { + this[kClosedResolve] = resolve; + }); + } + async [kDestroy](err) { + while (true) { + const item = this[kQueue].shift(); + if (!item) break; + item.handler.onError(err); + } + await Promise.all(this[kClients].map((c) => c.destroy(err))); + } + [kDispatch](opts, handler) { + const dispatcher = this[kGetDispatcher](); + if (!dispatcher) { + this[kNeedDrain] = true; + this[kQueue].push({ + opts, + handler + }); + this[kQueued]++; + } else if (!dispatcher.dispatch(opts, handler)) { + dispatcher[kNeedDrain] = true; + this[kNeedDrain] = !this[kGetDispatcher](); + } + return !this[kNeedDrain]; + } + [kAddClient](client) { + client.on("drain", this[kOnDrain]).on("connect", this[kOnConnect]).on("disconnect", this[kOnDisconnect]).on("connectionError", this[kOnConnectionError]); + this[kClients].push(client); + if (this[kNeedDrain]) queueMicrotask(() => { + if (this[kNeedDrain]) this[kOnDrain](client[kUrl], [this, client]); + }); + return this; + } + [kRemoveClient](client) { + client.close(() => { + const idx = this[kClients].indexOf(client); + if (idx !== -1) this[kClients].splice(idx, 1); + }); + this[kNeedDrain] = this[kClients].some((dispatcher) => !dispatcher[kNeedDrain] && dispatcher.closed !== true && dispatcher.destroyed !== true); + } + }; + module.exports = { + PoolBase, + kClients, + kNeedDrain, + kAddClient, + kRemoveClient, + kGetDispatcher + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/dispatcher/pool.js +var require_pool = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { PoolBase, kClients, kNeedDrain, kAddClient, kGetDispatcher } = require_pool_base(); + const Client = require_client(); + const { InvalidArgumentError } = require_errors$1(); + const util = require_util$7(); + const { kUrl, kInterceptors } = require_symbols$4(); + const buildConnector = require_connect(); + const kOptions = Symbol("options"); + const kConnections = Symbol("connections"); + const kFactory = Symbol("factory"); + function defaultFactory(origin, opts) { + return new Client(origin, opts); + } + var Pool = class extends PoolBase { + constructor(origin, { connections, factory = defaultFactory, connect, connectTimeout, tls, maxCachedSessions, socketPath, autoSelectFamily, autoSelectFamilyAttemptTimeout, allowH2, ...options } = {}) { + super(); + if (connections != null && (!Number.isFinite(connections) || connections < 0)) throw new InvalidArgumentError("invalid connections"); + if (typeof factory !== "function") throw new InvalidArgumentError("factory must be a function."); + if (connect != null && typeof connect !== "function" && typeof connect !== "object") throw new InvalidArgumentError("connect must be a function or an object"); + if (typeof connect !== "function") connect = buildConnector({ + ...tls, + maxCachedSessions, + allowH2, + socketPath, + timeout: connectTimeout, + ...autoSelectFamily ? { + autoSelectFamily, + autoSelectFamilyAttemptTimeout + } : void 0, + ...connect + }); + this[kInterceptors] = options.interceptors?.Pool && Array.isArray(options.interceptors.Pool) ? options.interceptors.Pool : []; + this[kConnections] = connections || null; + this[kUrl] = util.parseOrigin(origin); + this[kOptions] = { + ...util.deepClone(options), + connect, + allowH2 + }; + this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0; + this[kFactory] = factory; + this.on("connectionError", (origin, targets, error) => { + for (const target of targets) { + const idx = this[kClients].indexOf(target); + if (idx !== -1) this[kClients].splice(idx, 1); + } + }); + } + [kGetDispatcher]() { + for (const client of this[kClients]) if (!client[kNeedDrain]) return client; + if (!this[kConnections] || this[kClients].length < this[kConnections]) { + const dispatcher = this[kFactory](this[kUrl], this[kOptions]); + this[kAddClient](dispatcher); + return dispatcher; + } + } + }; + module.exports = Pool; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/dispatcher/balanced-pool.js +var require_balanced_pool = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { BalancedPoolMissingUpstreamError, InvalidArgumentError } = require_errors$1(); + const { PoolBase, kClients, kNeedDrain, kAddClient, kRemoveClient, kGetDispatcher } = require_pool_base(); + const Pool = require_pool(); + const { kUrl, kInterceptors } = require_symbols$4(); + const { parseOrigin } = require_util$7(); + const kFactory = Symbol("factory"); + const kOptions = 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"); + /** + * Calculate the greatest common divisor of two numbers by + * using the Euclidean algorithm. + * + * @param {number} a + * @param {number} b + * @returns {number} + */ + function getGreatestCommonDivisor(a, b) { + if (a === 0) return b; + while (b !== 0) { + const t = b; + b = a % b; + a = t; + } + return a; + } + function defaultFactory(origin, opts) { + return new Pool(origin, opts); + } + var BalancedPool = class extends PoolBase { + constructor(upstreams = [], { factory = defaultFactory, ...opts } = {}) { + super(); + this[kOptions] = opts; + this[kIndex] = -1; + this[kCurrentWeight] = 0; + this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100; + this[kErrorPenalty] = this[kOptions].errorPenalty || 15; + if (!Array.isArray(upstreams)) upstreams = [upstreams]; + if (typeof factory !== "function") throw new InvalidArgumentError("factory must be a function."); + this[kInterceptors] = opts.interceptors?.BalancedPool && Array.isArray(opts.interceptors.BalancedPool) ? opts.interceptors.BalancedPool : []; + this[kFactory] = factory; + for (const upstream of upstreams) this.addUpstream(upstream); + this._updateBalancedPoolStats(); + } + addUpstream(upstream) { + const upstreamOrigin = parseOrigin(upstream).origin; + if (this[kClients].find((pool) => pool[kUrl].origin === upstreamOrigin && pool.closed !== true && pool.destroyed !== true)) return this; + const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions])); + this[kAddClient](pool); + pool.on("connect", () => { + pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty]); + }); + pool.on("connectionError", () => { + pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty]); + this._updateBalancedPoolStats(); + }); + pool.on("disconnect", (...args) => { + const err = args[2]; + if (err && err.code === "UND_ERR_SOCKET") { + pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty]); + this._updateBalancedPoolStats(); + } + }); + for (const client of this[kClients]) client[kWeight] = this[kMaxWeightPerServer]; + this._updateBalancedPoolStats(); + return this; + } + _updateBalancedPoolStats() { + let result = 0; + for (let i = 0; i < this[kClients].length; i++) result = getGreatestCommonDivisor(this[kClients][i][kWeight], result); + this[kGreatestCommonDivisor] = result; + } + removeUpstream(upstream) { + const upstreamOrigin = parseOrigin(upstream).origin; + const pool = this[kClients].find((pool) => pool[kUrl].origin === upstreamOrigin && pool.closed !== true && pool.destroyed !== true); + if (pool) this[kRemoveClient](pool); + return this; + } + get upstreams() { + return this[kClients].filter((dispatcher) => dispatcher.closed !== true && dispatcher.destroyed !== true).map((p) => p[kUrl].origin); + } + [kGetDispatcher]() { + if (this[kClients].length === 0) throw new BalancedPoolMissingUpstreamError(); + if (!this[kClients].find((dispatcher) => !dispatcher[kNeedDrain] && dispatcher.closed !== true && dispatcher.destroyed !== true)) return; + if (this[kClients].map((pool) => pool[kNeedDrain]).reduce((a, b) => a && b, true)) return; + let counter = 0; + let maxWeightIndex = this[kClients].findIndex((pool) => !pool[kNeedDrain]); + while (counter++ < this[kClients].length) { + this[kIndex] = (this[kIndex] + 1) % this[kClients].length; + const pool = this[kClients][this[kIndex]]; + if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) maxWeightIndex = this[kIndex]; + if (this[kIndex] === 0) { + this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor]; + if (this[kCurrentWeight] <= 0) this[kCurrentWeight] = this[kMaxWeightPerServer]; + } + if (pool[kWeight] >= this[kCurrentWeight] && !pool[kNeedDrain]) return pool; + } + this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight]; + this[kIndex] = maxWeightIndex; + return this[kClients][maxWeightIndex]; + } + }; + module.exports = BalancedPool; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/dispatcher/agent.js +var require_agent = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { InvalidArgumentError } = require_errors$1(); + const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = require_symbols$4(); + const DispatcherBase = require_dispatcher_base(); + const Pool = require_pool(); + const Client = require_client(); + const util = require_util$7(); + const createRedirectInterceptor = require_redirect_interceptor(); + const kOnConnect = Symbol("onConnect"); + const kOnDisconnect = Symbol("onDisconnect"); + const kOnConnectionError = Symbol("onConnectionError"); + const kMaxRedirections = Symbol("maxRedirections"); + const kOnDrain = Symbol("onDrain"); + const kFactory = Symbol("factory"); + const kOptions = Symbol("options"); + function defaultFactory(origin, opts) { + return opts && opts.connections === 1 ? new Client(origin, opts) : new Pool(origin, opts); + } + var Agent = class extends DispatcherBase { + constructor({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) { + super(); + if (typeof factory !== "function") throw new InvalidArgumentError("factory must be a function."); + if (connect != null && typeof connect !== "function" && typeof connect !== "object") throw new InvalidArgumentError("connect must be a function or an object"); + if (!Number.isInteger(maxRedirections) || maxRedirections < 0) throw new InvalidArgumentError("maxRedirections must be a positive number"); + if (connect && typeof connect !== "function") connect = { ...connect }; + this[kInterceptors] = options.interceptors?.Agent && Array.isArray(options.interceptors.Agent) ? options.interceptors.Agent : [createRedirectInterceptor({ maxRedirections })]; + this[kOptions] = { + ...util.deepClone(options), + connect + }; + this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0; + this[kMaxRedirections] = maxRedirections; + this[kFactory] = factory; + this[kClients] = /* @__PURE__ */ new Map(); + this[kOnDrain] = (origin, targets) => { + this.emit("drain", origin, [this, ...targets]); + }; + this[kOnConnect] = (origin, targets) => { + this.emit("connect", origin, [this, ...targets]); + }; + this[kOnDisconnect] = (origin, targets, err) => { + this.emit("disconnect", origin, [this, ...targets], err); + }; + this[kOnConnectionError] = (origin, targets, err) => { + this.emit("connectionError", origin, [this, ...targets], err); + }; + } + get [kRunning]() { + let ret = 0; + for (const client of this[kClients].values()) ret += client[kRunning]; + return ret; + } + [kDispatch](opts, handler) { + let key; + if (opts.origin && (typeof opts.origin === "string" || opts.origin instanceof URL)) key = String(opts.origin); + else throw new InvalidArgumentError("opts.origin must be a non-empty string or URL."); + let dispatcher = this[kClients].get(key); + if (!dispatcher) { + dispatcher = this[kFactory](opts.origin, this[kOptions]).on("drain", this[kOnDrain]).on("connect", this[kOnConnect]).on("disconnect", this[kOnDisconnect]).on("connectionError", this[kOnConnectionError]); + this[kClients].set(key, dispatcher); + } + return dispatcher.dispatch(opts, handler); + } + async [kClose]() { + const closePromises = []; + for (const client of this[kClients].values()) closePromises.push(client.close()); + this[kClients].clear(); + await Promise.all(closePromises); + } + async [kDestroy](err) { + const destroyPromises = []; + for (const client of this[kClients].values()) destroyPromises.push(client.destroy(err)); + this[kClients].clear(); + await Promise.all(destroyPromises); + } + }; + module.exports = Agent; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/dispatcher/proxy-agent.js +var require_proxy_agent = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { kProxy, kClose, kDestroy, kDispatch, kInterceptors } = require_symbols$4(); + const { URL: URL$1 } = __require("node:url"); + const Agent = require_agent(); + const Pool = require_pool(); + const DispatcherBase = require_dispatcher_base(); + const { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = require_errors$1(); + const buildConnector = require_connect(); + const Client = require_client(); + 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"); + const kTunnelProxy = Symbol("tunnel proxy"); + function defaultProtocolPort(protocol) { + return protocol === "https:" ? 443 : 80; + } + function defaultFactory(origin, opts) { + return new Pool(origin, opts); + } + const noop = () => {}; + function defaultAgentFactory(origin, opts) { + if (opts.connections === 1) return new Client(origin, opts); + return new Pool(origin, opts); + } + var Http1ProxyWrapper = class extends DispatcherBase { + #client; + constructor(proxyUrl, { headers = {}, connect, factory }) { + super(); + if (!proxyUrl) throw new InvalidArgumentError("Proxy URL is mandatory"); + this[kProxyHeaders] = headers; + if (factory) this.#client = factory(proxyUrl, { connect }); + else this.#client = new Client(proxyUrl, { connect }); + } + [kDispatch](opts, handler) { + const onHeaders = handler.onHeaders; + handler.onHeaders = function(statusCode, data, resume) { + if (statusCode === 407) { + if (typeof handler.onError === "function") handler.onError(new InvalidArgumentError("Proxy Authentication Required (407)")); + return; + } + if (onHeaders) onHeaders.call(this, statusCode, data, resume); + }; + const { origin, path = "/", headers = {} } = opts; + opts.path = origin + path; + if (!("host" in headers) && !("Host" in headers)) { + const { host } = new URL$1(origin); + headers.host = host; + } + opts.headers = { + ...this[kProxyHeaders], + ...headers + }; + return this.#client[kDispatch](opts, handler); + } + async [kClose]() { + return this.#client.close(); + } + async [kDestroy](err) { + return this.#client.destroy(err); + } + }; + var ProxyAgent = class extends DispatcherBase { + constructor(opts) { + super(); + if (!opts || typeof opts === "object" && !(opts instanceof URL$1) && !opts.uri) throw new InvalidArgumentError("Proxy uri is mandatory"); + const { clientFactory = defaultFactory } = opts; + if (typeof clientFactory !== "function") throw new InvalidArgumentError("Proxy opts.clientFactory must be a function."); + const { proxyTunnel = true } = opts; + const url = this.#getUrl(opts); + const { href, origin, port, protocol, username, password, hostname: proxyHostname } = url; + this[kProxy] = { + uri: href, + protocol + }; + this[kInterceptors] = opts.interceptors?.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent) ? opts.interceptors.ProxyAgent : []; + this[kRequestTls] = opts.requestTls; + this[kProxyTls] = opts.proxyTls; + this[kProxyHeaders] = opts.headers || {}; + this[kTunnelProxy] = proxyTunnel; + if (opts.auth && opts.token) throw new InvalidArgumentError("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 connect = buildConnector({ ...opts.proxyTls }); + this[kConnectEndpoint] = buildConnector({ ...opts.requestTls }); + const agentFactory = opts.factory || defaultAgentFactory; + const factory = (origin, options) => { + const { protocol } = new URL$1(origin); + if (!this[kTunnelProxy] && protocol === "http:" && this[kProxy].protocol === "http:") return new Http1ProxyWrapper(this[kProxy].uri, { + headers: this[kProxyHeaders], + connect, + factory: agentFactory + }); + return agentFactory(origin, options); + }; + this[kClient] = clientFactory(url, { connect }); + this[kAgent] = new Agent({ + ...opts, + factory, + connect: async (opts, callback) => { + let requestedPath = opts.host; + if (!opts.port) requestedPath += `:${defaultProtocolPort(opts.protocol)}`; + try { + const { socket, statusCode } = await this[kClient].connect({ + origin, + port, + path: requestedPath, + signal: opts.signal, + headers: { + ...this[kProxyHeaders], + host: opts.host + }, + servername: this[kProxyTls]?.servername || proxyHostname + }); + if (statusCode !== 200) { + socket.on("error", noop).destroy(); + callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`)); + } + if (opts.protocol !== "https:") { + callback(null, socket); + return; + } + let servername; + if (this[kRequestTls]) servername = this[kRequestTls].servername; + else servername = opts.servername; + this[kConnectEndpoint]({ + ...opts, + servername, + httpSocket: socket + }, callback); + } catch (err) { + if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") callback(new SecureProxyConnectionError(err)); + else callback(err); + } + } + }); + } + dispatch(opts, handler) { + const headers = buildHeaders(opts.headers); + throwIfProxyAuthIsSent(headers); + if (headers && !("host" in headers) && !("Host" in headers)) { + const { host } = new URL$1(opts.origin); + headers.host = host; + } + return this[kAgent].dispatch({ + ...opts, + headers + }, handler); + } + /** + * @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts + * @returns {URL} + */ + #getUrl(opts) { + if (typeof opts === "string") return new URL$1(opts); + else if (opts instanceof URL$1) return opts; + else return new URL$1(opts.uri); + } + async [kClose]() { + await this[kAgent].close(); + await this[kClient].close(); + } + async [kDestroy]() { + await this[kAgent].destroy(); + await this[kClient].destroy(); + } + }; + /** + * @param {string[] | Record} headers + * @returns {Record} + */ + function buildHeaders(headers) { + if (Array.isArray(headers)) { + /** @type {Record} */ + const headersPair = {}; + for (let i = 0; i < headers.length; i += 2) headersPair[headers[i]] = headers[i + 1]; + return headersPair; + } + return headers; + } + /** + * @param {Record} headers + * + * Previous versions of ProxyAgent suggests the Proxy-Authorization in request headers + * Nevertheless, it was changed and to avoid a security vulnerability by end users + * this check was created. + * It should be removed in the next major version for performance reasons + */ + function throwIfProxyAuthIsSent(headers) { + if (headers && Object.keys(headers).find((key) => key.toLowerCase() === "proxy-authorization")) throw new InvalidArgumentError("Proxy-Authorization should be sent in ProxyAgent constructor"); + } + module.exports = ProxyAgent; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +var require_env_http_proxy_agent = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const DispatcherBase = require_dispatcher_base(); + const { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = require_symbols$4(); + const ProxyAgent = require_proxy_agent(); + const Agent = require_agent(); + const DEFAULT_PORTS = { + "http:": 80, + "https:": 443 + }; + let experimentalWarned = false; + var EnvHttpProxyAgent = class extends DispatcherBase { + #noProxyValue = null; + #noProxyEntries = null; + #opts = null; + constructor(opts = {}) { + super(); + this.#opts = opts; + if (!experimentalWarned) { + experimentalWarned = true; + process.emitWarning("EnvHttpProxyAgent is experimental, expect them to change at any time.", { code: "UNDICI-EHPA" }); + } + const { httpProxy, httpsProxy, noProxy, ...agentOpts } = opts; + this[kNoProxyAgent] = new Agent(agentOpts); + const HTTP_PROXY = httpProxy ?? process.env.http_proxy ?? process.env.HTTP_PROXY; + if (HTTP_PROXY) this[kHttpProxyAgent] = new ProxyAgent({ + ...agentOpts, + uri: HTTP_PROXY + }); + else this[kHttpProxyAgent] = this[kNoProxyAgent]; + const HTTPS_PROXY = httpsProxy ?? process.env.https_proxy ?? process.env.HTTPS_PROXY; + if (HTTPS_PROXY) this[kHttpsProxyAgent] = new ProxyAgent({ + ...agentOpts, + uri: HTTPS_PROXY + }); + else this[kHttpsProxyAgent] = this[kHttpProxyAgent]; + this.#parseNoProxy(); + } + [kDispatch](opts, handler) { + const url = new URL(opts.origin); + return this.#getProxyAgentForUrl(url).dispatch(opts, handler); + } + async [kClose]() { + await this[kNoProxyAgent].close(); + if (!this[kHttpProxyAgent][kClosed]) await this[kHttpProxyAgent].close(); + if (!this[kHttpsProxyAgent][kClosed]) await this[kHttpsProxyAgent].close(); + } + async [kDestroy](err) { + await this[kNoProxyAgent].destroy(err); + if (!this[kHttpProxyAgent][kDestroyed]) await this[kHttpProxyAgent].destroy(err); + if (!this[kHttpsProxyAgent][kDestroyed]) await this[kHttpsProxyAgent].destroy(err); + } + #getProxyAgentForUrl(url) { + let { protocol, host: hostname, port } = url; + hostname = hostname.replace(/:\d*$/, "").toLowerCase(); + port = Number.parseInt(port, 10) || DEFAULT_PORTS[protocol] || 0; + if (!this.#shouldProxy(hostname, port)) return this[kNoProxyAgent]; + if (protocol === "https:") return this[kHttpsProxyAgent]; + return this[kHttpProxyAgent]; + } + #shouldProxy(hostname, port) { + if (this.#noProxyChanged) this.#parseNoProxy(); + if (this.#noProxyEntries.length === 0) return true; + if (this.#noProxyValue === "*") return false; + for (let i = 0; i < this.#noProxyEntries.length; i++) { + const entry = this.#noProxyEntries[i]; + if (entry.port && entry.port !== port) continue; + if (!/^[.*]/.test(entry.hostname)) { + if (hostname === entry.hostname) return false; + } else if (hostname.endsWith(entry.hostname.replace(/^\*/, ""))) return false; + } + return true; + } + #parseNoProxy() { + const noProxyValue = this.#opts.noProxy ?? this.#noProxyEnv; + const noProxySplit = noProxyValue.split(/[,\s]/); + const noProxyEntries = []; + for (let i = 0; i < noProxySplit.length; i++) { + const entry = noProxySplit[i]; + if (!entry) continue; + const parsed = entry.match(/^(.+):(\d+)$/); + noProxyEntries.push({ + hostname: (parsed ? parsed[1] : entry).toLowerCase(), + port: parsed ? Number.parseInt(parsed[2], 10) : 0 + }); + } + this.#noProxyValue = noProxyValue; + this.#noProxyEntries = noProxyEntries; + } + get #noProxyChanged() { + if (this.#opts.noProxy !== void 0) return false; + return this.#noProxyValue !== this.#noProxyEnv; + } + get #noProxyEnv() { + return process.env.no_proxy ?? process.env.NO_PROXY ?? ""; + } + }; + module.exports = EnvHttpProxyAgent; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/handler/retry-handler.js +var require_retry_handler = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const assert$15 = __require("node:assert"); + const { kRetryHandlerDefaultRetry } = require_symbols$4(); + const { RequestRetryError } = require_errors$1(); + const { isDisturbed, parseHeaders, parseRangeHeader, wrapRequestBody } = require_util$7(); + function calculateRetryAfterHeader(retryAfter) { + const current = Date.now(); + return new Date(retryAfter).getTime() - current; + } + module.exports = class RetryHandler { + constructor(opts, handlers) { + const { retryOptions, ...dispatchOpts } = opts; + const { retry: retryFn, maxRetries, maxTimeout, minTimeout, timeoutFactor, methods, errorCodes, retryAfter, statusCodes } = retryOptions ?? {}; + this.dispatch = handlers.dispatch; + this.handler = handlers.handler; + this.opts = { + ...dispatchOpts, + body: wrapRequestBody(opts.body) + }; + this.abort = null; + this.aborted = false; + this.retryOpts = { + retry: retryFn ?? RetryHandler[kRetryHandlerDefaultRetry], + retryAfter: retryAfter ?? true, + maxTimeout: maxTimeout ?? 30 * 1e3, + minTimeout: minTimeout ?? 500, + timeoutFactor: timeoutFactor ?? 2, + maxRetries: maxRetries ?? 5, + methods: methods ?? [ + "GET", + "HEAD", + "OPTIONS", + "PUT", + "DELETE", + "TRACE" + ], + statusCodes: statusCodes ?? [ + 500, + 502, + 503, + 504, + 429 + ], + errorCodes: errorCodes ?? [ + "ECONNRESET", + "ECONNREFUSED", + "ENOTFOUND", + "ENETDOWN", + "ENETUNREACH", + "EHOSTDOWN", + "EHOSTUNREACH", + "EPIPE", + "UND_ERR_SOCKET" + ] + }; + this.retryCount = 0; + this.retryCountCheckpoint = 0; + this.start = 0; + this.end = null; + this.etag = null; + this.resume = null; + this.handler.onConnect((reason) => { + this.aborted = true; + if (this.abort) this.abort(reason); + else this.reason = reason; + }); + } + onRequestSent() { + if (this.handler.onRequestSent) this.handler.onRequestSent(); + } + onUpgrade(statusCode, headers, socket) { + if (this.handler.onUpgrade) this.handler.onUpgrade(statusCode, headers, socket); + } + onConnect(abort) { + if (this.aborted) abort(this.reason); + else this.abort = abort; + } + onBodySent(chunk) { + if (this.handler.onBodySent) return this.handler.onBodySent(chunk); + } + static [kRetryHandlerDefaultRetry](err, { state, opts }, cb) { + const { statusCode, code, headers } = err; + const { method, retryOptions } = opts; + const { maxRetries, minTimeout, maxTimeout, timeoutFactor, statusCodes, errorCodes, methods } = retryOptions; + const { counter } = state; + if (code && code !== "UND_ERR_REQ_RETRY" && !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 = headers?.["retry-after"]; + if (retryAfterHeader) { + retryAfterHeader = Number(retryAfterHeader); + retryAfterHeader = Number.isNaN(retryAfterHeader) ? calculateRetryAfterHeader(retryAfterHeader) : retryAfterHeader * 1e3; + } + const retryTimeout = retryAfterHeader > 0 ? Math.min(retryAfterHeader, maxTimeout) : Math.min(minTimeout * timeoutFactor ** (counter - 1), maxTimeout); + setTimeout(() => cb(null), retryTimeout); + } + onHeaders(statusCode, rawHeaders, resume, statusMessage) { + const headers = parseHeaders(rawHeaders); + this.retryCount += 1; + if (statusCode >= 300) if (this.retryOpts.statusCodes.includes(statusCode) === false) return this.handler.onHeaders(statusCode, rawHeaders, resume, statusMessage); + else { + this.abort(new RequestRetryError("Request failed", statusCode, { + headers, + data: { count: this.retryCount } + })); + return false; + } + if (this.resume != null) { + this.resume = null; + if (statusCode !== 206 && (this.start > 0 || statusCode !== 200)) { + this.abort(new RequestRetryError("server does not support the range header and the payload was partially consumed", statusCode, { + headers, + data: { count: this.retryCount } + })); + return false; + } + const contentRange = parseRangeHeader(headers["content-range"]); + if (!contentRange) { + this.abort(new RequestRetryError("Content-Range mismatch", statusCode, { + headers, + data: { count: this.retryCount } + })); + return false; + } + if (this.etag != null && this.etag !== headers.etag) { + this.abort(new RequestRetryError("ETag mismatch", statusCode, { + headers, + data: { count: this.retryCount } + })); + return false; + } + const { start, size, end = size - 1 } = contentRange; + assert$15(this.start === start, "content-range mismatch"); + assert$15(this.end == null || this.end === end, "content-range mismatch"); + this.resume = resume; + return true; + } + if (this.end == null) { + if (statusCode === 206) { + const range = parseRangeHeader(headers["content-range"]); + if (range == null) return this.handler.onHeaders(statusCode, rawHeaders, resume, statusMessage); + const { start, size, end = size - 1 } = range; + assert$15(start != null && Number.isFinite(start), "content-range mismatch"); + assert$15(end != null && Number.isFinite(end), "invalid content-length"); + this.start = start; + this.end = end; + } + if (this.end == null) { + const contentLength = headers["content-length"]; + this.end = contentLength != null ? Number(contentLength) - 1 : null; + } + assert$15(Number.isFinite(this.start)); + assert$15(this.end == null || Number.isFinite(this.end), "invalid content-length"); + this.resume = resume; + this.etag = headers.etag != null ? headers.etag : null; + if (this.etag != null && this.etag.startsWith("W/")) this.etag = null; + return this.handler.onHeaders(statusCode, rawHeaders, resume, statusMessage); + } + const err = new RequestRetryError("Request failed", statusCode, { + headers, + data: { 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); + if (this.retryCount - this.retryCountCheckpoint > 0) this.retryCount = this.retryCountCheckpoint + (this.retryCount - this.retryCountCheckpoint); + else this.retryCount += 1; + this.retryOpts.retry(err, { + state: { counter: this.retryCount }, + opts: { + retryOptions: this.retryOpts, + ...this.opts + } + }, onRetry.bind(this)); + function onRetry(err) { + if (err != null || this.aborted || isDisturbed(this.opts.body)) return this.handler.onError(err); + if (this.start !== 0) { + const headers = { range: `bytes=${this.start}-${this.end ?? ""}` }; + if (this.etag != null) headers["if-match"] = this.etag; + this.opts = { + ...this.opts, + headers: { + ...this.opts.headers, + ...headers + } + }; + } + try { + this.retryCountCheckpoint = this.retryCount; + this.dispatch(this.opts, this); + } catch (err) { + this.handler.onError(err); + } + } + } + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/dispatcher/retry-agent.js +var require_retry_agent = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const Dispatcher = require_dispatcher(); + const RetryHandler = require_retry_handler(); + var RetryAgent = class extends Dispatcher { + #agent = null; + #options = null; + constructor(agent, options = {}) { + super(options); + this.#agent = agent; + this.#options = options; + } + dispatch(opts, handler) { + const retry = new RetryHandler({ + ...opts, + retryOptions: this.#options + }, { + dispatch: this.#agent.dispatch.bind(this.#agent), + handler + }); + return this.#agent.dispatch(opts, retry); + } + close() { + return this.#agent.close(); + } + destroy() { + return this.#agent.destroy(); + } + }; + module.exports = RetryAgent; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/api/readable.js +var require_readable = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const assert$14 = __require("node:assert"); + const { Readable: Readable$2 } = __require("node:stream"); + const { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = require_errors$1(); + const util = require_util$7(); + const { ReadableStreamFrom } = require_util$7(); + const kConsume = Symbol("kConsume"); + const kReading = Symbol("kReading"); + const kBody = Symbol("kBody"); + const kAbort = Symbol("kAbort"); + const kContentType = Symbol("kContentType"); + const kContentLength = Symbol("kContentLength"); + const noop = () => {}; + var BodyReadable = class extends Readable$2 { + constructor({ resume, abort, contentType = "", contentLength, highWaterMark = 64 * 1024 }) { + super({ + autoDestroy: true, + read: resume, + highWaterMark + }); + this._readableState.dataEmitted = false; + this[kAbort] = abort; + this[kConsume] = null; + this[kBody] = null; + this[kContentType] = contentType; + this[kContentLength] = contentLength; + this[kReading] = false; + } + destroy(err) { + if (!err && !this._readableState.endEmitted) err = new RequestAbortedError(); + if (err) this[kAbort](); + return super.destroy(err); + } + _destroy(err, callback) { + if (!this[kReading]) setImmediate(() => { + callback(err); + }); + else callback(err); + } + 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) { + consumePush(this[kConsume], chunk); + return this[kReading] ? super.push(chunk) : true; + } + return super.push(chunk); + } + async text() { + return consume(this, "text"); + } + async json() { + return consume(this, "json"); + } + async blob() { + return consume(this, "blob"); + } + async bytes() { + return consume(this, "bytes"); + } + async arrayBuffer() { + return consume(this, "arrayBuffer"); + } + async formData() { + throw new NotSupportedError(); + } + get bodyUsed() { + return util.isDisturbed(this); + } + get body() { + if (!this[kBody]) { + this[kBody] = ReadableStreamFrom(this); + if (this[kConsume]) { + this[kBody].getReader(); + assert$14(this[kBody].locked); + } + } + return this[kBody]; + } + async dump(opts) { + let limit = Number.isFinite(opts?.limit) ? opts.limit : 128 * 1024; + const signal = opts?.signal; + if (signal != null && (typeof signal !== "object" || !("aborted" in signal))) throw new InvalidArgumentError("signal must be an AbortSignal"); + signal?.throwIfAborted(); + if (this._readableState.closeEmitted) return null; + return await new Promise((resolve, reject) => { + if (this[kContentLength] > limit) this.destroy(new AbortError()); + const onAbort = () => { + this.destroy(signal.reason ?? new AbortError()); + }; + signal?.addEventListener("abort", onAbort); + this.on("close", function() { + signal?.removeEventListener("abort", onAbort); + if (signal?.aborted) reject(signal.reason ?? new AbortError()); + else resolve(null); + }).on("error", noop).on("data", function(chunk) { + limit -= chunk.length; + if (limit <= 0) this.destroy(); + }).resume(); + }); + } + }; + function isLocked(self) { + return self[kBody] && self[kBody].locked === true || self[kConsume]; + } + function isUnusable(self) { + return util.isDisturbed(self) || isLocked(self); + } + async function consume(stream, type) { + assert$14(!stream[kConsume]); + return new Promise((resolve, reject) => { + if (isUnusable(stream)) { + const rState = stream._readableState; + if (rState.destroyed && rState.closeEmitted === false) stream.on("error", (err) => { + reject(err); + }).on("close", () => { + reject(/* @__PURE__ */ new TypeError("unusable")); + }); + else reject(rState.errored ?? /* @__PURE__ */ new TypeError("unusable")); + } else queueMicrotask(() => { + stream[kConsume] = { + type, + stream, + resolve, + reject, + length: 0, + body: [] + }; + stream.on("error", function(err) { + consumeFinish(this[kConsume], err); + }).on("close", function() { + if (this[kConsume].body !== null) consumeFinish(this[kConsume], new RequestAbortedError()); + }); + consumeStart(stream[kConsume]); + }); + }); + } + function consumeStart(consume) { + if (consume.body === null) return; + const { _readableState: state } = consume.stream; + if (state.bufferIndex) { + const start = state.bufferIndex; + const end = state.buffer.length; + for (let n = start; n < end; n++) consumePush(consume, state.buffer[n]); + } else for (const chunk of state.buffer) consumePush(consume, chunk); + if (state.endEmitted) consumeEnd(this[kConsume]); + else consume.stream.on("end", function() { + consumeEnd(this[kConsume]); + }); + consume.stream.resume(); + while (consume.stream.read() != null); + } + /** + * @param {Buffer[]} chunks + * @param {number} length + */ + function chunksDecode(chunks, length) { + if (chunks.length === 0 || length === 0) return ""; + const buffer = chunks.length === 1 ? chunks[0] : Buffer.concat(chunks, length); + const bufferLength = buffer.length; + const start = bufferLength > 2 && buffer[0] === 239 && buffer[1] === 187 && buffer[2] === 191 ? 3 : 0; + return buffer.utf8Slice(start, bufferLength); + } + /** + * @param {Buffer[]} chunks + * @param {number} length + * @returns {Uint8Array} + */ + function chunksConcat(chunks, length) { + if (chunks.length === 0 || length === 0) return new Uint8Array(0); + if (chunks.length === 1) return new Uint8Array(chunks[0]); + const buffer = new Uint8Array(Buffer.allocUnsafeSlow(length).buffer); + let offset = 0; + for (let i = 0; i < chunks.length; ++i) { + const chunk = chunks[i]; + buffer.set(chunk, offset); + offset += chunk.length; + } + return buffer; + } + function consumeEnd(consume) { + const { type, body, resolve, stream, length } = consume; + try { + if (type === "text") resolve(chunksDecode(body, length)); + else if (type === "json") resolve(JSON.parse(chunksDecode(body, length))); + else if (type === "arrayBuffer") resolve(chunksConcat(body, length).buffer); + else if (type === "blob") resolve(new Blob(body, { type: stream[kContentType] })); + else if (type === "bytes") resolve(chunksConcat(body, length)); + consumeFinish(consume); + } catch (err) { + stream.destroy(err); + } + } + function consumePush(consume, chunk) { + consume.length += chunk.length; + consume.body.push(chunk); + } + function consumeFinish(consume, err) { + if (consume.body === null) return; + if (err) consume.reject(err); + else consume.resolve(); + consume.type = null; + consume.stream = null; + consume.resolve = null; + consume.reject = null; + consume.length = 0; + consume.body = null; + } + module.exports = { + Readable: BodyReadable, + chunksDecode + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/api/util.js +var require_util$5 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const assert$13 = __require("node:assert"); + const { ResponseStatusCodeError } = require_errors$1(); + const { chunksDecode } = require_readable(); + const CHUNK_LIMIT = 128 * 1024; + async function getResolveErrorBodyCallback({ callback, body, contentType, statusCode, statusMessage, headers }) { + assert$13(body); + let chunks = []; + let length = 0; + try { + for await (const chunk of body) { + chunks.push(chunk); + length += chunk.length; + if (length > CHUNK_LIMIT) { + chunks = []; + length = 0; + break; + } + } + } catch { + chunks = []; + length = 0; + } + const message = `Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ""}`; + if (statusCode === 204 || !contentType || !length) { + queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers))); + return; + } + const stackTraceLimit = Error.stackTraceLimit; + Error.stackTraceLimit = 0; + let payload; + try { + if (isContentTypeApplicationJson(contentType)) payload = JSON.parse(chunksDecode(chunks, length)); + else if (isContentTypeText(contentType)) payload = chunksDecode(chunks, length); + } catch {} finally { + Error.stackTraceLimit = stackTraceLimit; + } + queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers, payload))); + } + const isContentTypeApplicationJson = (contentType) => { + return contentType.length > 15 && contentType[11] === "/" && contentType[0] === "a" && contentType[1] === "p" && contentType[2] === "p" && contentType[3] === "l" && contentType[4] === "i" && contentType[5] === "c" && contentType[6] === "a" && contentType[7] === "t" && contentType[8] === "i" && contentType[9] === "o" && contentType[10] === "n" && contentType[12] === "j" && contentType[13] === "s" && contentType[14] === "o" && contentType[15] === "n"; + }; + const isContentTypeText = (contentType) => { + return contentType.length > 4 && contentType[4] === "/" && contentType[0] === "t" && contentType[1] === "e" && contentType[2] === "x" && contentType[3] === "t"; + }; + module.exports = { + getResolveErrorBodyCallback, + isContentTypeApplicationJson, + isContentTypeText + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/api/api-request.js +var require_api_request = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const assert$12 = __require("node:assert"); + const { Readable } = require_readable(); + const { InvalidArgumentError, RequestAbortedError } = require_errors$1(); + const util = require_util$7(); + const { getResolveErrorBodyCallback } = require_util$5(); + const { AsyncResource: AsyncResource$4 } = __require("node:async_hooks"); + var RequestHandler = class extends AsyncResource$4 { + constructor(opts, callback) { + if (!opts || typeof opts !== "object") throw new InvalidArgumentError("invalid opts"); + const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts; + try { + if (typeof callback !== "function") throw new InvalidArgumentError("invalid callback"); + if (highWaterMark && (typeof highWaterMark !== "number" || highWaterMark < 0)) throw new InvalidArgumentError("invalid highWaterMark"); + if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget"); + if (method === "CONNECT") throw new InvalidArgumentError("invalid method"); + if (onInfo && typeof onInfo !== "function") throw new InvalidArgumentError("invalid onInfo callback"); + super("UNDICI_REQUEST"); + } catch (err) { + if (util.isStream(body)) util.destroy(body.on("error", util.nop), err); + throw err; + } + this.method = method; + this.responseHeaders = responseHeaders || null; + this.opaque = opaque || null; + this.callback = callback; + this.res = null; + this.abort = null; + this.body = body; + this.trailers = {}; + this.context = null; + this.onInfo = onInfo || null; + this.throwOnError = throwOnError; + this.highWaterMark = highWaterMark; + this.signal = signal; + this.reason = null; + this.removeAbortListener = null; + if (util.isStream(body)) body.on("error", (err) => { + this.onError(err); + }); + if (this.signal) if (this.signal.aborted) this.reason = this.signal.reason ?? new RequestAbortedError(); + else this.removeAbortListener = util.addAbortListener(this.signal, () => { + this.reason = this.signal.reason ?? new RequestAbortedError(); + if (this.res) util.destroy(this.res.on("error", util.nop), this.reason); + else if (this.abort) this.abort(this.reason); + if (this.removeAbortListener) { + this.res?.off("close", this.removeAbortListener); + this.removeAbortListener(); + this.removeAbortListener = null; + } + }); + } + onConnect(abort, context) { + if (this.reason) { + abort(this.reason); + return; + } + assert$12(this.callback); + this.abort = abort; + this.context = context; + } + onHeaders(statusCode, rawHeaders, resume, statusMessage) { + const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this; + const headers = responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); + if (statusCode < 200) { + if (this.onInfo) this.onInfo({ + statusCode, + headers + }); + return; + } + const parsedHeaders = responseHeaders === "raw" ? util.parseHeaders(rawHeaders) : headers; + const contentType = parsedHeaders["content-type"]; + const contentLength = parsedHeaders["content-length"]; + const res = new Readable({ + resume, + abort, + contentType, + contentLength: this.method !== "HEAD" && contentLength ? Number(contentLength) : null, + highWaterMark + }); + if (this.removeAbortListener) res.on("close", this.removeAbortListener); + this.callback = null; + this.res = res; + if (callback !== null) if (this.throwOnError && statusCode >= 400) this.runInAsyncScope(getResolveErrorBodyCallback, null, { + callback, + body: res, + contentType, + statusCode, + statusMessage, + headers + }); + else this.runInAsyncScope(callback, null, null, { + statusCode, + headers, + trailers: this.trailers, + opaque, + body: res, + context + }); + } + onData(chunk) { + return this.res.push(chunk); + } + onComplete(trailers) { + util.parseHeaders(trailers, this.trailers); + this.res.push(null); + } + onError(err) { + const { res, callback, body, opaque } = this; + if (callback) { + this.callback = null; + queueMicrotask(() => { + this.runInAsyncScope(callback, null, err, { opaque }); + }); + } + if (res) { + this.res = null; + queueMicrotask(() => { + util.destroy(res, err); + }); + } + if (body) { + this.body = null; + util.destroy(body, err); + } + if (this.removeAbortListener) { + res?.off("close", this.removeAbortListener); + this.removeAbortListener(); + this.removeAbortListener = null; + } + } + }; + function request(opts, callback) { + if (callback === void 0) return new Promise((resolve, reject) => { + request.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?.opaque; + queueMicrotask(() => callback(err, { opaque })); + } + } + module.exports = request; + module.exports.RequestHandler = RequestHandler; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/api/abort-signal.js +var require_abort_signal = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { addAbortListener } = require_util$7(); + const { RequestAbortedError } = require_errors$1(); + const kListener = Symbol("kListener"); + const kSignal = Symbol("kSignal"); + function abort(self) { + if (self.abort) self.abort(self[kSignal]?.reason); + else self.reason = self[kSignal]?.reason ?? new RequestAbortedError(); + removeSignal(self); + } + function addSignal(self, signal) { + self.reason = null; + self[kSignal] = null; + self[kListener] = null; + if (!signal) return; + if (signal.aborted) { + abort(self); + return; + } + self[kSignal] = signal; + self[kListener] = () => { + abort(self); + }; + addAbortListener(self[kSignal], self[kListener]); + } + function removeSignal(self) { + if (!self[kSignal]) return; + if ("removeEventListener" in self[kSignal]) self[kSignal].removeEventListener("abort", self[kListener]); + else self[kSignal].removeListener("abort", self[kListener]); + self[kSignal] = null; + self[kListener] = null; + } + module.exports = { + addSignal, + removeSignal + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/api/api-stream.js +var require_api_stream = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const assert$11 = __require("node:assert"); + const { finished: finished$1, PassThrough: PassThrough$1 } = __require("node:stream"); + const { InvalidArgumentError, InvalidReturnValueError } = require_errors$1(); + const util = require_util$7(); + const { getResolveErrorBodyCallback } = require_util$5(); + const { AsyncResource: AsyncResource$3 } = __require("node:async_hooks"); + const { addSignal, removeSignal } = require_abort_signal(); + var StreamHandler = class extends AsyncResource$3 { + constructor(opts, factory, callback) { + if (!opts || typeof opts !== "object") throw new InvalidArgumentError("invalid opts"); + const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts; + try { + if (typeof callback !== "function") throw new InvalidArgumentError("invalid callback"); + if (typeof factory !== "function") throw new InvalidArgumentError("invalid factory"); + if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget"); + if (method === "CONNECT") throw new InvalidArgumentError("invalid method"); + if (onInfo && typeof onInfo !== "function") throw new InvalidArgumentError("invalid onInfo callback"); + super("UNDICI_STREAM"); + } catch (err) { + if (util.isStream(body)) util.destroy(body.on("error", util.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 = body; + this.onInfo = onInfo || null; + this.throwOnError = throwOnError || false; + if (util.isStream(body)) body.on("error", (err) => { + this.onError(err); + }); + addSignal(this, signal); + } + onConnect(abort, context) { + if (this.reason) { + abort(this.reason); + return; + } + assert$11(this.callback); + this.abort = abort; + this.context = context; + } + onHeaders(statusCode, rawHeaders, resume, statusMessage) { + const { factory, opaque, context, callback, responseHeaders } = this; + const headers = responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); + if (statusCode < 200) { + if (this.onInfo) this.onInfo({ + statusCode, + headers + }); + return; + } + this.factory = null; + let res; + if (this.throwOnError && statusCode >= 400) { + const contentType = (responseHeaders === "raw" ? util.parseHeaders(rawHeaders) : headers)["content-type"]; + res = new PassThrough$1(); + this.callback = null; + this.runInAsyncScope(getResolveErrorBodyCallback, null, { + callback, + body: res, + contentType, + statusCode, + statusMessage, + headers + }); + } else { + if (factory === null) return; + res = this.runInAsyncScope(factory, null, { + statusCode, + headers, + opaque, + context + }); + if (!res || typeof res.write !== "function" || typeof res.end !== "function" || typeof res.on !== "function") throw new InvalidReturnValueError("expected Writable"); + finished$1(res, { readable: false }, (err) => { + const { callback, res, opaque, trailers, abort } = this; + this.res = null; + if (err || !res.readable) util.destroy(res, err); + this.callback = null; + this.runInAsyncScope(callback, null, err || null, { + opaque, + trailers + }); + if (err) abort(); + }); + } + res.on("drain", resume); + this.res = res; + return (res.writableNeedDrain !== void 0 ? res.writableNeedDrain : res._writableState?.needDrain) !== true; + } + onData(chunk) { + const { res } = this; + return res ? res.write(chunk) : true; + } + onComplete(trailers) { + const { res } = this; + removeSignal(this); + if (!res) return; + this.trailers = util.parseHeaders(trailers); + res.end(); + } + onError(err) { + const { res, callback, opaque, body } = this; + removeSignal(this); + this.factory = null; + if (res) { + this.res = null; + util.destroy(res, err); + } else if (callback) { + this.callback = null; + queueMicrotask(() => { + this.runInAsyncScope(callback, null, err, { opaque }); + }); + } + if (body) { + this.body = null; + util.destroy(body, err); + } + } + }; + function stream(opts, factory, callback) { + if (callback === void 0) return new Promise((resolve, reject) => { + stream.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?.opaque; + queueMicrotask(() => callback(err, { opaque })); + } + } + module.exports = stream; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/api/api-pipeline.js +var require_api_pipeline = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { Readable: Readable$1, Duplex, PassThrough } = __require("node:stream"); + const { InvalidArgumentError, InvalidReturnValueError, RequestAbortedError } = require_errors$1(); + const util = require_util$7(); + const { AsyncResource: AsyncResource$2 } = __require("node:async_hooks"); + const { addSignal, removeSignal } = require_abort_signal(); + const assert$10 = __require("node:assert"); + const kResume = Symbol("resume"); + var PipelineRequest = class extends Readable$1 { + constructor() { + super({ autoDestroy: true }); + this[kResume] = null; + } + _read() { + const { [kResume]: resume } = this; + if (resume) { + this[kResume] = null; + resume(); + } + } + _destroy(err, callback) { + this._read(); + callback(err); + } + }; + var PipelineResponse = class extends Readable$1 { + constructor(resume) { + super({ autoDestroy: true }); + this[kResume] = resume; + } + _read() { + this[kResume](); + } + _destroy(err, callback) { + if (!err && !this._readableState.endEmitted) err = new RequestAbortedError(); + callback(err); + } + }; + var PipelineHandler = class extends AsyncResource$2 { + constructor(opts, handler) { + if (!opts || typeof opts !== "object") throw new InvalidArgumentError("invalid opts"); + if (typeof handler !== "function") throw new InvalidArgumentError("invalid handler"); + const { signal, method, opaque, onInfo, responseHeaders } = opts; + if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget"); + if (method === "CONNECT") throw new InvalidArgumentError("invalid method"); + if (onInfo && typeof onInfo !== "function") throw new InvalidArgumentError("invalid onInfo callback"); + super("UNDICI_PIPELINE"); + this.opaque = opaque || null; + this.responseHeaders = responseHeaders || null; + this.handler = handler; + this.abort = null; + this.context = null; + this.onInfo = onInfo || null; + this.req = new PipelineRequest().on("error", util.nop); + this.ret = new Duplex({ + readableObjectMode: opts.objectMode, + autoDestroy: true, + read: () => { + const { body } = this; + if (body?.resume) body.resume(); + }, + write: (chunk, encoding, callback) => { + const { req } = this; + if (req.push(chunk, encoding) || req._readableState.destroyed) callback(); + else req[kResume] = callback; + }, + destroy: (err, callback) => { + const { body, req, res, ret, abort } = this; + if (!err && !ret._readableState.endEmitted) err = new RequestAbortedError(); + if (abort && err) abort(); + util.destroy(body, err); + util.destroy(req, err); + util.destroy(res, err); + removeSignal(this); + callback(err); + } + }).on("prefinish", () => { + const { req } = this; + req.push(null); + }); + this.res = null; + addSignal(this, signal); + } + onConnect(abort, context) { + const { ret, res } = this; + if (this.reason) { + abort(this.reason); + return; + } + assert$10(!res, "pipeline cannot be retried"); + assert$10(!ret.destroyed); + this.abort = abort; + this.context = context; + } + onHeaders(statusCode, rawHeaders, resume) { + const { opaque, handler, context } = this; + if (statusCode < 200) { + if (this.onInfo) { + const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); + this.onInfo({ + statusCode, + headers + }); + } + return; + } + this.res = new PipelineResponse(resume); + let body; + try { + this.handler = null; + const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); + body = this.runInAsyncScope(handler, null, { + statusCode, + headers, + opaque, + body: this.res, + context + }); + } catch (err) { + this.res.on("error", util.nop); + throw err; + } + if (!body || typeof body.on !== "function") throw new InvalidReturnValueError("expected Readable"); + body.on("data", (chunk) => { + const { ret, body } = this; + if (!ret.push(chunk) && body.pause) body.pause(); + }).on("error", (err) => { + const { ret } = this; + util.destroy(ret, err); + }).on("end", () => { + const { ret } = this; + ret.push(null); + }).on("close", () => { + const { ret } = this; + if (!ret._readableState.ended) util.destroy(ret, new RequestAbortedError()); + }); + this.body = body; + } + 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.destroy(ret, err); + } + }; + function pipeline(opts, handler) { + try { + const pipelineHandler = new PipelineHandler(opts, handler); + this.dispatch({ + ...opts, + body: pipelineHandler.req + }, pipelineHandler); + return pipelineHandler.ret; + } catch (err) { + return new PassThrough().destroy(err); + } + } + module.exports = pipeline; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/api/api-upgrade.js +var require_api_upgrade = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { InvalidArgumentError, SocketError } = require_errors$1(); + const { AsyncResource: AsyncResource$1 } = __require("node:async_hooks"); + const util = require_util$7(); + const { addSignal, removeSignal } = require_abort_signal(); + const assert$9 = __require("node:assert"); + var UpgradeHandler = class extends AsyncResource$1 { + constructor(opts, callback) { + if (!opts || typeof opts !== "object") throw new InvalidArgumentError("invalid opts"); + if (typeof callback !== "function") throw new InvalidArgumentError("invalid callback"); + const { signal, opaque, responseHeaders } = opts; + if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") throw new InvalidArgumentError("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(this, signal); + } + onConnect(abort, context) { + if (this.reason) { + abort(this.reason); + return; + } + assert$9(this.callback); + this.abort = abort; + this.context = null; + } + onHeaders() { + throw new SocketError("bad upgrade", null); + } + onUpgrade(statusCode, rawHeaders, socket) { + assert$9(statusCode === 101); + const { callback, opaque, context } = this; + removeSignal(this); + this.callback = null; + const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); + this.runInAsyncScope(callback, null, null, { + headers, + socket, + opaque, + context + }); + } + onError(err) { + const { callback, opaque } = this; + removeSignal(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?.opaque; + queueMicrotask(() => callback(err, { opaque })); + } + } + module.exports = upgrade; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/api/api-connect.js +var require_api_connect = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const assert$8 = __require("node:assert"); + const { AsyncResource } = __require("node:async_hooks"); + const { InvalidArgumentError, SocketError } = require_errors$1(); + const util = require_util$7(); + const { addSignal, removeSignal } = require_abort_signal(); + var ConnectHandler = class extends AsyncResource { + constructor(opts, callback) { + if (!opts || typeof opts !== "object") throw new InvalidArgumentError("invalid opts"); + if (typeof callback !== "function") throw new InvalidArgumentError("invalid callback"); + const { signal, opaque, responseHeaders } = opts; + if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") throw new InvalidArgumentError("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(abort, context) { + if (this.reason) { + abort(this.reason); + return; + } + assert$8(this.callback); + this.abort = abort; + this.context = context; + } + onHeaders() { + throw new SocketError("bad connect", null); + } + onUpgrade(statusCode, rawHeaders, socket) { + const { callback, opaque, context } = this; + removeSignal(this); + this.callback = null; + let headers = rawHeaders; + if (headers != null) headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); + this.runInAsyncScope(callback, null, null, { + statusCode, + headers, + socket, + opaque, + context + }); + } + 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?.opaque; + queueMicrotask(() => callback(err, { opaque })); + } + } + module.exports = connect; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/api/index.js +var require_api = /* @__PURE__ */ __commonJSMin(((exports, module) => { + module.exports.request = require_api_request(); + module.exports.stream = require_api_stream(); + module.exports.pipeline = require_api_pipeline(); + module.exports.upgrade = require_api_upgrade(); + module.exports.connect = require_api_connect(); +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/mock/mock-errors.js +var require_mock_errors = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { UndiciError } = require_errors$1(); + const kMockNotMatchedError = Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED"); + module.exports = { MockNotMatchedError: class MockNotMatchedError extends UndiciError { + 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"; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kMockNotMatchedError] === true; + } + [kMockNotMatchedError] = true; + } }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/mock/mock-symbols.js +var require_mock_symbols = /* @__PURE__ */ __commonJSMin(((exports, module) => { + module.exports = { + kAgent: Symbol("agent"), + kOptions: Symbol("options"), + kFactory: Symbol("factory"), + kDispatches: Symbol("dispatches"), + kDispatchKey: Symbol("dispatch key"), + kDefaultHeaders: Symbol("default headers"), + kDefaultTrailers: Symbol("default trailers"), + kContentLength: Symbol("content length"), + kMockAgent: Symbol("mock agent"), + kMockAgentSet: Symbol("mock agent set"), + kMockAgentGet: Symbol("mock agent get"), + kMockDispatch: Symbol("mock dispatch"), + kClose: Symbol("close"), + kOriginalClose: Symbol("original agent close"), + kOrigin: Symbol("origin"), + kIsMockActive: Symbol("is mock active"), + kNetConnect: Symbol("net connect"), + kGetNetConnect: Symbol("get net connect"), + kConnected: Symbol("connected") + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/mock/mock-utils.js +var require_mock_utils = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { MockNotMatchedError } = require_mock_errors(); + const { kDispatches, kMockAgent, kOriginalDispatch, kOrigin, kGetNetConnect } = require_mock_symbols(); + const { buildURL } = require_util$7(); + const { STATUS_CODES: STATUS_CODES$1 } = __require("node:http"); + const { types: { isPromise } } = __require("node:util"); + function matchValue(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(headers) { + return Object.fromEntries(Object.entries(headers).map(([headerName, headerValue]) => { + return [headerName.toLocaleLowerCase(), headerValue]; + })); + } + /** + * @param {import('../../index').Headers|string[]|Record} headers + * @param {string} key + */ + function getHeaderByName(headers, key) { + if (Array.isArray(headers)) { + for (let i = 0; i < headers.length; i += 2) if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) return headers[i + 1]; + return; + } else if (typeof headers.get === "function") return headers.get(key); + else return lowerCaseEntries(headers)[key.toLocaleLowerCase()]; + } + /** @param {string[]} headers */ + function buildHeadersFromArray(headers) { + const clone = headers.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(mockDispatch, headers) { + if (typeof mockDispatch.headers === "function") { + if (Array.isArray(headers)) headers = buildHeadersFromArray(headers); + return mockDispatch.headers(headers ? lowerCaseEntries(headers) : {}); + } + if (typeof mockDispatch.headers === "undefined") return true; + if (typeof headers !== "object" || typeof mockDispatch.headers !== "object") return false; + for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch.headers)) if (!matchValue(matchHeaderValue, getHeaderByName(headers, matchHeaderName))) return false; + return true; + } + function safeUrl(path) { + if (typeof path !== "string") return path; + const pathSegments = path.split("?"); + if (pathSegments.length !== 2) return path; + const qp = new URLSearchParams(pathSegments.pop()); + qp.sort(); + return [...pathSegments, qp.toString()].join("?"); + } + function matchKey(mockDispatch, { path, method, body, headers }) { + const pathMatch = matchValue(mockDispatch.path, path); + const methodMatch = matchValue(mockDispatch.method, method); + const bodyMatch = typeof mockDispatch.body !== "undefined" ? matchValue(mockDispatch.body, body) : true; + const headersMatch = matchHeaders(mockDispatch, headers); + return pathMatch && methodMatch && bodyMatch && headersMatch; + } + function getResponseData(data) { + if (Buffer.isBuffer(data)) return data; + else if (data instanceof Uint8Array) return data; + else if (data instanceof ArrayBuffer) return data; + else if (typeof data === "object") return JSON.stringify(data); + else return data.toString(); + } + function getMockDispatch(mockDispatches, key) { + const basePath = key.query ? buildURL(key.path, key.query) : key.path; + const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath; + let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path }) => matchValue(safeUrl(path), resolvedPath)); + if (matchedMockDispatches.length === 0) throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`); + matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method)); + if (matchedMockDispatches.length === 0) throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}' on path '${resolvedPath}'`); + matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== "undefined" ? matchValue(body, key.body) : true); + if (matchedMockDispatches.length === 0) throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}' on path '${resolvedPath}'`); + matchedMockDispatches = matchedMockDispatches.filter((mockDispatch) => matchHeaders(mockDispatch, key.headers)); + if (matchedMockDispatches.length === 0) throw new MockNotMatchedError(`Mock dispatch not matched for headers '${typeof key.headers === "object" ? JSON.stringify(key.headers) : key.headers}' on path '${resolvedPath}'`); + return matchedMockDispatches[0]; + } + function addMockDispatch(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(opts) { + const { path, method, body, headers, query } = opts; + return { + path, + method, + body, + headers, + query + }; + } + function generateKeyValues(data) { + const keys = Object.keys(data); + const result = []; + for (let i = 0; i < keys.length; ++i) { + const key = keys[i]; + const value = data[key]; + const name = Buffer.from(`${key}`); + if (Array.isArray(value)) for (let j = 0; j < value.length; ++j) result.push(name, Buffer.from(`${value[j]}`)); + else result.push(name, Buffer.from(`${value}`)); + } + return result; + } + /** + * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status + * @param {number} statusCode + */ + function getStatusText(statusCode) { + return STATUS_CODES$1[statusCode] || "unknown"; + } + async function getResponse(body) { + const buffers = []; + for await (const data of body) buffers.push(data); + return Buffer.concat(buffers).toString("utf8"); + } + /** + * Mock dispatch function used to simulate undici dispatches + */ + function mockDispatch(opts, handler) { + const key = buildKey(opts); + const mockDispatch = getMockDispatch(this[kDispatches], key); + mockDispatch.timesInvoked++; + if (mockDispatch.data.callback) mockDispatch.data = { + ...mockDispatch.data, + ...mockDispatch.data.callback(opts) + }; + const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch; + const { timesInvoked, times } = mockDispatch; + mockDispatch.consumed = !persist && timesInvoked >= times; + mockDispatch.pending = timesInvoked < times; + if (error !== null) { + deleteMockDispatch(this[kDispatches], key); + handler.onError(error); + return true; + } + if (typeof delay === "number" && delay > 0) setTimeout(() => { + handleReply(this[kDispatches]); + }, delay); + else handleReply(this[kDispatches]); + function handleReply(mockDispatches, _data = data) { + const optsHeaders = Array.isArray(opts.headers) ? buildHeadersFromArray(opts.headers) : opts.headers; + const body = typeof _data === "function" ? _data({ + ...opts, + headers: optsHeaders + }) : _data; + if (isPromise(body)) { + body.then((newData) => handleReply(mockDispatches, newData)); + return; + } + const responseData = getResponseData(body); + const responseHeaders = generateKeyValues(headers); + const responseTrailers = generateKeyValues(trailers); + handler.onConnect?.((err) => handler.onError(err), null); + handler.onHeaders?.(statusCode, responseHeaders, resume, getStatusText(statusCode)); + handler.onData?.(Buffer.from(responseData)); + handler.onComplete?.(responseTrailers); + deleteMockDispatch(mockDispatches, key); + } + function resume() {} + return true; + } + function buildMockDispatch() { + const agent = this[kMockAgent]; + const origin = this[kOrigin]; + const originalDispatch = this[kOriginalDispatch]; + return function dispatch(opts, handler) { + if (agent.isMockActive) try { + mockDispatch.call(this, opts, handler); + } catch (error) { + if (error instanceof MockNotMatchedError) { + const netConnect = agent[kGetNetConnect](); + if (netConnect === false) throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); + if (checkNetConnect(netConnect, origin)) originalDispatch.call(this, opts, handler); + else throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); + } else throw error; + } + else originalDispatch.call(this, opts, handler); + }; + } + function checkNetConnect(netConnect, origin) { + const url = new URL(origin); + if (netConnect === true) return true; + else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) return true; + return false; + } + function buildMockOptions(opts) { + if (opts) { + const { agent, ...mockOptions } = opts; + return mockOptions; + } + } + module.exports = { + getResponseData, + getMockDispatch, + addMockDispatch, + deleteMockDispatch, + buildKey, + generateKeyValues, + matchValue, + getResponse, + getStatusText, + mockDispatch, + buildMockDispatch, + checkNetConnect, + buildMockOptions, + getHeaderByName, + buildHeadersFromArray + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/mock/mock-interceptor.js +var require_mock_interceptor = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { getResponseData, buildKey, addMockDispatch } = require_mock_utils(); + const { kDispatches, kDispatchKey, kDefaultHeaders, kDefaultTrailers, kContentLength, kMockDispatch } = require_mock_symbols(); + const { InvalidArgumentError } = require_errors$1(); + const { buildURL } = require_util$7(); + /** + * Defines the scope API for an interceptor reply + */ + var MockScope = class { + constructor(mockDispatch) { + this[kMockDispatch] = mockDispatch; + } + /** + * Delay a reply by a set amount in ms. + */ + delay(waitInMs) { + if (typeof waitInMs !== "number" || !Number.isInteger(waitInMs) || waitInMs <= 0) throw new InvalidArgumentError("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("repeatTimes must be a valid integer > 0"); + this[kMockDispatch].times = repeatTimes; + return this; + } + }; + /** + * Defines an interceptor for a Mock + */ + var MockInterceptor = class { + constructor(opts, mockDispatches) { + if (typeof opts !== "object") throw new InvalidArgumentError("opts must be an object"); + if (typeof opts.path === "undefined") throw new InvalidArgumentError("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] = mockDispatches; + this[kDefaultHeaders] = {}; + this[kDefaultTrailers] = {}; + this[kContentLength] = false; + } + createMockScopeDispatchData({ statusCode, data, responseOptions }) { + const responseData = getResponseData(data); + const contentLength = this[kContentLength] ? { "content-length": responseData.length } : {}; + return { + statusCode, + data, + headers: { + ...this[kDefaultHeaders], + ...contentLength, + ...responseOptions.headers + }, + trailers: { + ...this[kDefaultTrailers], + ...responseOptions.trailers + } + }; + } + validateReplyParameters(replyParameters) { + if (typeof replyParameters.statusCode === "undefined") throw new InvalidArgumentError("statusCode must be defined"); + if (typeof replyParameters.responseOptions !== "object" || replyParameters.responseOptions === null) throw new InvalidArgumentError("responseOptions must be an object"); + } + /** + * Mock an undici request with a defined reply. + */ + reply(replyOptionsCallbackOrStatusCode) { + if (typeof replyOptionsCallbackOrStatusCode === "function") { + const wrappedDefaultsCallback = (opts) => { + const resolvedData = replyOptionsCallbackOrStatusCode(opts); + if (typeof resolvedData !== "object" || resolvedData === null) throw new InvalidArgumentError("reply options callback must return an object"); + const replyParameters = { + data: "", + responseOptions: {}, + ...resolvedData + }; + this.validateReplyParameters(replyParameters); + return { ...this.createMockScopeDispatchData(replyParameters) }; + }; + return new MockScope(addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback)); + } + const replyParameters = { + statusCode: replyOptionsCallbackOrStatusCode, + data: arguments[1] === void 0 ? "" : arguments[1], + responseOptions: arguments[2] === void 0 ? {} : arguments[2] + }; + this.validateReplyParameters(replyParameters); + const dispatchData = this.createMockScopeDispatchData(replyParameters); + return new MockScope(addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData)); + } + /** + * Mock an undici request with a defined error. + */ + replyWithError(error) { + if (typeof error === "undefined") throw new InvalidArgumentError("error must be defined"); + return new MockScope(addMockDispatch(this[kDispatches], this[kDispatchKey], { error })); + } + /** + * Set default reply headers on the interceptor for subsequent replies + */ + defaultReplyHeaders(headers) { + if (typeof headers === "undefined") throw new InvalidArgumentError("headers must be defined"); + this[kDefaultHeaders] = headers; + return this; + } + /** + * Set default reply trailers on the interceptor for subsequent replies + */ + defaultReplyTrailers(trailers) { + if (typeof trailers === "undefined") throw new InvalidArgumentError("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; + } + }; + module.exports.MockInterceptor = MockInterceptor; + module.exports.MockScope = MockScope; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/mock/mock-client.js +var require_mock_client = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { promisify: promisify$2 } = __require("node:util"); + const Client = require_client(); + const { buildMockDispatch } = require_mock_utils(); + const { kDispatches, kMockAgent, kClose, kOriginalClose, kOrigin, kOriginalDispatch, kConnected } = require_mock_symbols(); + const { MockInterceptor } = require_mock_interceptor(); + const Symbols = require_symbols$4(); + const { InvalidArgumentError } = require_errors$1(); + /** + * MockClient provides an API that extends the Client to influence the mockDispatches. + */ + var MockClient = class extends Client { + constructor(origin, opts) { + super(origin, opts); + if (!opts || !opts.agent || typeof opts.agent.dispatch !== "function") throw new InvalidArgumentError("Argument opts.agent must implement Agent"); + this[kMockAgent] = opts.agent; + this[kOrigin] = origin; + this[kDispatches] = []; + this[kConnected] = 1; + this[kOriginalDispatch] = this.dispatch; + this[kOriginalClose] = this.close.bind(this); + this.dispatch = buildMockDispatch.call(this); + this.close = this[kClose]; + } + get [Symbols.kConnected]() { + return this[kConnected]; + } + /** + * Sets up the base interceptor for mocking replies from undici. + */ + intercept(opts) { + return new MockInterceptor(opts, this[kDispatches]); + } + async [kClose]() { + await promisify$2(this[kOriginalClose])(); + this[kConnected] = 0; + this[kMockAgent][Symbols.kClients].delete(this[kOrigin]); + } + }; + module.exports = MockClient; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/mock/mock-pool.js +var require_mock_pool = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { promisify: promisify$1 } = __require("node:util"); + const Pool = require_pool(); + const { buildMockDispatch } = require_mock_utils(); + const { kDispatches, kMockAgent, kClose, kOriginalClose, kOrigin, kOriginalDispatch, kConnected } = require_mock_symbols(); + const { MockInterceptor } = require_mock_interceptor(); + const Symbols = require_symbols$4(); + const { InvalidArgumentError } = require_errors$1(); + /** + * MockPool provides an API that extends the Pool to influence the mockDispatches. + */ + var MockPool = class extends Pool { + constructor(origin, opts) { + super(origin, opts); + if (!opts || !opts.agent || typeof opts.agent.dispatch !== "function") throw new InvalidArgumentError("Argument opts.agent must implement Agent"); + this[kMockAgent] = opts.agent; + this[kOrigin] = origin; + this[kDispatches] = []; + this[kConnected] = 1; + this[kOriginalDispatch] = this.dispatch; + this[kOriginalClose] = this.close.bind(this); + this.dispatch = buildMockDispatch.call(this); + this.close = this[kClose]; + } + get [Symbols.kConnected]() { + return this[kConnected]; + } + /** + * Sets up the base interceptor for mocking replies from undici. + */ + intercept(opts) { + return new MockInterceptor(opts, this[kDispatches]); + } + async [kClose]() { + await promisify$1(this[kOriginalClose])(); + this[kConnected] = 0; + this[kMockAgent][Symbols.kClients].delete(this[kOrigin]); + } + }; + module.exports = MockPool; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/mock/pluralizer.js +var require_pluralizer = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const singulars = { + pronoun: "it", + is: "is", + was: "was", + this: "this" + }; + const plurals = { + pronoun: "they", + is: "are", + was: "were", + this: "these" + }; + module.exports = 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 + }; + } + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/mock/pending-interceptors-formatter.js +var require_pending_interceptors_formatter = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { Transform: Transform$1 } = __require("node:stream"); + const { Console } = __require("node:console"); + const PERSISTENT = process.versions.icu ? "✅" : "Y "; + const NOT_PERSISTENT = process.versions.icu ? "❌" : "N "; + /** + * Gets the output of `console.table(…)` as a string. + */ + module.exports = class PendingInterceptorsFormatter { + constructor({ disableColors } = {}) { + this.transform = new Transform$1({ 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, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ + Method: method, + Origin: origin, + Path: path, + "Status code": statusCode, + Persistent: persist ? PERSISTENT : NOT_PERSISTENT, + Invocations: timesInvoked, + Remaining: persist ? Infinity : times - timesInvoked + })); + this.logger.table(withPrettyHeaders); + return this.transform.read().toString(); + } + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/mock/mock-agent.js +var require_mock_agent = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { kClients } = require_symbols$4(); + const Agent = require_agent(); + const { kAgent, kMockAgentSet, kMockAgentGet, kDispatches, kIsMockActive, kNetConnect, kGetNetConnect, kOptions, kFactory } = require_mock_symbols(); + const MockClient = require_mock_client(); + const MockPool = require_mock_pool(); + const { matchValue, buildMockOptions } = require_mock_utils(); + const { InvalidArgumentError, UndiciError } = require_errors$1(); + const Dispatcher = require_dispatcher(); + const Pluralizer = require_pluralizer(); + const PendingInterceptorsFormatter = require_pending_interceptors_formatter(); + var MockAgent = class extends Dispatcher { + constructor(opts) { + super(opts); + this[kNetConnect] = true; + this[kIsMockActive] = true; + if (opts?.agent && typeof opts.agent.dispatch !== "function") throw new InvalidArgumentError("Argument opts.agent must implement Agent"); + const agent = opts?.agent ? opts.agent : new Agent(opts); + this[kAgent] = agent; + this[kClients] = agent[kClients]; + this[kOptions] = buildMockOptions(opts); + } + get(origin) { + let dispatcher = this[kMockAgentGet](origin); + if (!dispatcher) { + dispatcher = this[kFactory](origin); + this[kMockAgentSet](origin, dispatcher); + } + return dispatcher; + } + dispatch(opts, handler) { + this.get(opts.origin); + return this[kAgent].dispatch(opts, handler); + } + async close() { + await this[kAgent].close(); + this[kClients].clear(); + } + deactivate() { + this[kIsMockActive] = false; + } + activate() { + this[kIsMockActive] = true; + } + enableNetConnect(matcher) { + if (typeof matcher === "string" || typeof matcher === "function" || matcher instanceof RegExp) if (Array.isArray(this[kNetConnect])) this[kNetConnect].push(matcher); + else this[kNetConnect] = [matcher]; + else if (typeof matcher === "undefined") this[kNetConnect] = true; + else throw new InvalidArgumentError("Unsupported matcher. Must be one of String|Function|RegExp."); + } + disableNetConnect() { + this[kNetConnect] = false; + } + get isMockActive() { + return this[kIsMockActive]; + } + [kMockAgentSet](origin, dispatcher) { + this[kClients].set(origin, dispatcher); + } + [kFactory](origin) { + const mockOptions = Object.assign({ agent: this }, this[kOptions]); + return this[kOptions] && this[kOptions].connections === 1 ? new MockClient(origin, mockOptions) : new MockPool(origin, mockOptions); + } + [kMockAgentGet](origin) { + const client = this[kClients].get(origin); + if (client) return client; + if (typeof origin !== "string") { + const dispatcher = this[kFactory]("http://localhost:9999"); + this[kMockAgentSet](origin, dispatcher); + return dispatcher; + } + for (const [keyMatcher, nonExplicitDispatcher] of Array.from(this[kClients])) if (nonExplicitDispatcher && typeof keyMatcher !== "string" && matchValue(keyMatcher, origin)) { + const dispatcher = this[kFactory](origin); + this[kMockAgentSet](origin, dispatcher); + dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches]; + return dispatcher; + } + } + [kGetNetConnect]() { + return this[kNetConnect]; + } + pendingInterceptors() { + const mockAgentClients = this[kClients]; + return Array.from(mockAgentClients.entries()).flatMap(([origin, scope]) => scope[kDispatches].map((dispatch) => ({ + ...dispatch, + origin + }))).filter(({ pending }) => pending); + } + assertNoPendingInterceptors({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) { + const pending = this.pendingInterceptors(); + if (pending.length === 0) return; + const pluralizer = new Pluralizer("interceptor", "interceptors").pluralize(pending.length); + throw new UndiciError(` +${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending: + +${pendingInterceptorsFormatter.format(pending)} +`.trim()); + } + }; + module.exports = MockAgent; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/global.js +var require_global = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const globalDispatcher = Symbol.for("undici.globalDispatcher.1"); + const { InvalidArgumentError } = require_errors$1(); + const Agent = require_agent(); + if (getGlobalDispatcher() === void 0) setGlobalDispatcher(new Agent()); + function setGlobalDispatcher(agent) { + if (!agent || typeof agent.dispatch !== "function") throw new InvalidArgumentError("Argument agent must implement Agent"); + Object.defineProperty(globalThis, globalDispatcher, { + value: agent, + writable: true, + enumerable: false, + configurable: false + }); + } + function getGlobalDispatcher() { + return globalThis[globalDispatcher]; + } + module.exports = { + setGlobalDispatcher, + getGlobalDispatcher + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/handler/decorator-handler.js +var require_decorator_handler = /* @__PURE__ */ __commonJSMin(((exports, module) => { + module.exports = class DecoratorHandler { + #handler; + constructor(handler) { + if (typeof handler !== "object" || handler === null) throw new TypeError("handler must be an object"); + this.#handler = handler; + } + onConnect(...args) { + return this.#handler.onConnect?.(...args); + } + onError(...args) { + return this.#handler.onError?.(...args); + } + onUpgrade(...args) { + return this.#handler.onUpgrade?.(...args); + } + onResponseStarted(...args) { + return this.#handler.onResponseStarted?.(...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); + } + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/interceptor/redirect.js +var require_redirect = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const RedirectHandler = require_redirect_handler(); + module.exports = (opts) => { + const globalMaxRedirections = opts?.maxRedirections; + return (dispatch) => { + return function redirectInterceptor(opts, handler) { + const { maxRedirections = globalMaxRedirections, ...baseOpts } = opts; + if (!maxRedirections) return dispatch(opts, handler); + return dispatch(baseOpts, new RedirectHandler(dispatch, maxRedirections, opts, handler)); + }; + }; + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/interceptor/retry.js +var require_retry = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const RetryHandler = require_retry_handler(); + module.exports = (globalOpts) => { + return (dispatch) => { + return function retryInterceptor(opts, handler) { + return dispatch(opts, new RetryHandler({ + ...opts, + retryOptions: { + ...globalOpts, + ...opts.retryOptions + } + }, { + handler, + dispatch + })); + }; + }; + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/interceptor/dump.js +var require_dump = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const util = require_util$7(); + const { InvalidArgumentError, RequestAbortedError } = require_errors$1(); + const DecoratorHandler = require_decorator_handler(); + var DumpHandler = class extends DecoratorHandler { + #maxSize = 1024 * 1024; + #abort = null; + #dumped = false; + #aborted = false; + #size = 0; + #reason = null; + #handler = null; + constructor({ maxSize }, handler) { + super(handler); + if (maxSize != null && (!Number.isFinite(maxSize) || maxSize < 1)) throw new InvalidArgumentError("maxSize must be a number greater than 0"); + this.#maxSize = maxSize ?? this.#maxSize; + this.#handler = handler; + } + onConnect(abort) { + this.#abort = abort; + this.#handler.onConnect(this.#customAbort.bind(this)); + } + #customAbort(reason) { + this.#aborted = true; + this.#reason = reason; + } + onHeaders(statusCode, rawHeaders, resume, statusMessage) { + const contentLength = util.parseHeaders(rawHeaders)["content-length"]; + if (contentLength != null && contentLength > this.#maxSize) throw new RequestAbortedError(`Response size (${contentLength}) larger than maxSize (${this.#maxSize})`); + if (this.#aborted) return true; + return this.#handler.onHeaders(statusCode, rawHeaders, resume, statusMessage); + } + onError(err) { + if (this.#dumped) return; + err = this.#reason ?? err; + this.#handler.onError(err); + } + onData(chunk) { + this.#size = this.#size + chunk.length; + if (this.#size >= this.#maxSize) { + this.#dumped = true; + if (this.#aborted) this.#handler.onError(this.#reason); + else this.#handler.onComplete([]); + } + return true; + } + onComplete(trailers) { + if (this.#dumped) return; + if (this.#aborted) { + this.#handler.onError(this.reason); + return; + } + this.#handler.onComplete(trailers); + } + }; + function createDumpInterceptor({ maxSize: defaultMaxSize } = { maxSize: 1024 * 1024 }) { + return (dispatch) => { + return function Intercept(opts, handler) { + const { dumpMaxSize = defaultMaxSize } = opts; + return dispatch(opts, new DumpHandler({ maxSize: dumpMaxSize }, handler)); + }; + }; + } + module.exports = createDumpInterceptor; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/interceptor/dns.js +var require_dns = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { isIP } = __require("node:net"); + const { lookup } = __require("node:dns"); + const DecoratorHandler = require_decorator_handler(); + const { InvalidArgumentError, InformationalError } = require_errors$1(); + const maxInt = Math.pow(2, 31) - 1; + var DNSInstance = class { + #maxTTL = 0; + #maxItems = 0; + #records = /* @__PURE__ */ new Map(); + dualStack = true; + affinity = null; + lookup = null; + pick = null; + constructor(opts) { + this.#maxTTL = opts.maxTTL; + this.#maxItems = opts.maxItems; + this.dualStack = opts.dualStack; + this.affinity = opts.affinity; + this.lookup = opts.lookup ?? this.#defaultLookup; + this.pick = opts.pick ?? this.#defaultPick; + } + get full() { + return this.#records.size === this.#maxItems; + } + runLookup(origin, opts, cb) { + const ips = this.#records.get(origin.hostname); + if (ips == null && this.full) { + cb(null, origin.origin); + return; + } + const newOpts = { + affinity: this.affinity, + dualStack: this.dualStack, + lookup: this.lookup, + pick: this.pick, + ...opts.dns, + maxTTL: this.#maxTTL, + maxItems: this.#maxItems + }; + if (ips == null) this.lookup(origin, newOpts, (err, addresses) => { + if (err || addresses == null || addresses.length === 0) { + cb(err ?? new InformationalError("No DNS entries found")); + return; + } + this.setRecords(origin, addresses); + const records = this.#records.get(origin.hostname); + const ip = this.pick(origin, records, newOpts.affinity); + let port; + if (typeof ip.port === "number") port = `:${ip.port}`; + else if (origin.port !== "") port = `:${origin.port}`; + else port = ""; + cb(null, `${origin.protocol}//${ip.family === 6 ? `[${ip.address}]` : ip.address}${port}`); + }); + else { + const ip = this.pick(origin, ips, newOpts.affinity); + if (ip == null) { + this.#records.delete(origin.hostname); + this.runLookup(origin, opts, cb); + return; + } + let port; + if (typeof ip.port === "number") port = `:${ip.port}`; + else if (origin.port !== "") port = `:${origin.port}`; + else port = ""; + cb(null, `${origin.protocol}//${ip.family === 6 ? `[${ip.address}]` : ip.address}${port}`); + } + } + #defaultLookup(origin, opts, cb) { + lookup(origin.hostname, { + all: true, + family: this.dualStack === false ? this.affinity : 0, + order: "ipv4first" + }, (err, addresses) => { + if (err) return cb(err); + const results = /* @__PURE__ */ new Map(); + for (const addr of addresses) results.set(`${addr.address}:${addr.family}`, addr); + cb(null, results.values()); + }); + } + #defaultPick(origin, hostnameRecords, affinity) { + let ip = null; + const { records, offset } = hostnameRecords; + let family; + if (this.dualStack) { + if (affinity == null) if (offset == null || offset === maxInt) { + hostnameRecords.offset = 0; + affinity = 4; + } else { + hostnameRecords.offset++; + affinity = (hostnameRecords.offset & 1) === 1 ? 6 : 4; + } + if (records[affinity] != null && records[affinity].ips.length > 0) family = records[affinity]; + else family = records[affinity === 4 ? 6 : 4]; + } else family = records[affinity]; + if (family == null || family.ips.length === 0) return ip; + if (family.offset == null || family.offset === maxInt) family.offset = 0; + else family.offset++; + const position = family.offset % family.ips.length; + ip = family.ips[position] ?? null; + if (ip == null) return ip; + if (Date.now() - ip.timestamp > ip.ttl) { + family.ips.splice(position, 1); + return this.pick(origin, hostnameRecords, affinity); + } + return ip; + } + setRecords(origin, addresses) { + const timestamp = Date.now(); + const records = { records: { + 4: null, + 6: null + } }; + for (const record of addresses) { + record.timestamp = timestamp; + if (typeof record.ttl === "number") record.ttl = Math.min(record.ttl, this.#maxTTL); + else record.ttl = this.#maxTTL; + const familyRecords = records.records[record.family] ?? { ips: [] }; + familyRecords.ips.push(record); + records.records[record.family] = familyRecords; + } + this.#records.set(origin.hostname, records); + } + getHandler(meta, opts) { + return new DNSDispatchHandler(this, meta, opts); + } + }; + var DNSDispatchHandler = class extends DecoratorHandler { + #state = null; + #opts = null; + #dispatch = null; + #handler = null; + #origin = null; + constructor(state, { origin, handler, dispatch }, opts) { + super(handler); + this.#origin = origin; + this.#handler = handler; + this.#opts = { ...opts }; + this.#state = state; + this.#dispatch = dispatch; + } + onError(err) { + switch (err.code) { + case "ETIMEDOUT": + case "ECONNREFUSED": + if (this.#state.dualStack) { + this.#state.runLookup(this.#origin, this.#opts, (err, newOrigin) => { + if (err) return this.#handler.onError(err); + const dispatchOpts = { + ...this.#opts, + origin: newOrigin + }; + this.#dispatch(dispatchOpts, this); + }); + return; + } + this.#handler.onError(err); + return; + case "ENOTFOUND": this.#state.deleteRecord(this.#origin); + default: + this.#handler.onError(err); + break; + } + } + }; + module.exports = (interceptorOpts) => { + if (interceptorOpts?.maxTTL != null && (typeof interceptorOpts?.maxTTL !== "number" || interceptorOpts?.maxTTL < 0)) throw new InvalidArgumentError("Invalid maxTTL. Must be a positive number"); + if (interceptorOpts?.maxItems != null && (typeof interceptorOpts?.maxItems !== "number" || interceptorOpts?.maxItems < 1)) throw new InvalidArgumentError("Invalid maxItems. Must be a positive number and greater than zero"); + if (interceptorOpts?.affinity != null && interceptorOpts?.affinity !== 4 && interceptorOpts?.affinity !== 6) throw new InvalidArgumentError("Invalid affinity. Must be either 4 or 6"); + if (interceptorOpts?.dualStack != null && typeof interceptorOpts?.dualStack !== "boolean") throw new InvalidArgumentError("Invalid dualStack. Must be a boolean"); + if (interceptorOpts?.lookup != null && typeof interceptorOpts?.lookup !== "function") throw new InvalidArgumentError("Invalid lookup. Must be a function"); + if (interceptorOpts?.pick != null && typeof interceptorOpts?.pick !== "function") throw new InvalidArgumentError("Invalid pick. Must be a function"); + const dualStack = interceptorOpts?.dualStack ?? true; + let affinity; + if (dualStack) affinity = interceptorOpts?.affinity ?? null; + else affinity = interceptorOpts?.affinity ?? 4; + const instance = new DNSInstance({ + maxTTL: interceptorOpts?.maxTTL ?? 1e4, + lookup: interceptorOpts?.lookup ?? null, + pick: interceptorOpts?.pick ?? null, + dualStack, + affinity, + maxItems: interceptorOpts?.maxItems ?? Infinity + }); + return (dispatch) => { + return function dnsInterceptor(origDispatchOpts, handler) { + const origin = origDispatchOpts.origin.constructor === URL ? origDispatchOpts.origin : new URL(origDispatchOpts.origin); + if (isIP(origin.hostname) !== 0) return dispatch(origDispatchOpts, handler); + instance.runLookup(origin, origDispatchOpts, (err, newOrigin) => { + if (err) return handler.onError(err); + let dispatchOpts = null; + dispatchOpts = { + ...origDispatchOpts, + servername: origin.hostname, + origin: newOrigin, + headers: { + host: origin.hostname, + ...origDispatchOpts.headers + } + }; + dispatch(dispatchOpts, instance.getHandler({ + origin, + dispatch, + handler + }, origDispatchOpts)); + }); + return true; + }; + }; + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/fetch/headers.js +var require_headers = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { kConstruct } = require_symbols$4(); + const { kEnumerableProperty } = require_util$7(); + const { iteratorMixin, isValidHeaderName, isValidHeaderValue } = require_util$6(); + const { webidl } = require_webidl(); + const assert$7 = __require("node:assert"); + const util = __require("node:util"); + const kHeadersMap = Symbol("headers map"); + const kHeadersSortedMap = Symbol("headers map sorted"); + /** + * @param {number} code + */ + function isHTTPWhiteSpaceCharCode(code) { + return code === 10 || code === 13 || code === 9 || code === 32; + } + /** + * @see https://fetch.spec.whatwg.org/#concept-header-value-normalize + * @param {string} potentialValue + */ + 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 fill(headers, object) { + if (Array.isArray(object)) for (let i = 0; i < object.length; ++i) { + const header = object[i]; + if (header.length !== 2) throw webidl.errors.exception({ + header: "Headers constructor", + message: `expected name/value pair to be length 2, found ${header.length}.` + }); + appendHeader(headers, header[0], header[1]); + } + else if (typeof object === "object" && object !== null) { + const keys = Object.keys(object); + for (let i = 0; i < keys.length; ++i) appendHeader(headers, keys[i], object[keys[i]]); + } else throw webidl.errors.conversionFailed({ + prefix: "Headers constructor", + argument: "Argument 1", + types: ["sequence>", "record"] + }); + } + /** + * @see https://fetch.spec.whatwg.org/#concept-headers-append + */ + function appendHeader(headers, 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 (getHeadersGuard(headers) === "immutable") throw new TypeError("immutable"); + return getHeadersList(headers).append(name, value, false); + } + function compareHeaderName(a, b) { + return a[0] < b[0] ? -1 : 1; + } + var HeadersList = class HeadersList { + /** @type {[string, string][]|null} */ + cookies = null; + constructor(init) { + 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; + } + } + /** + * @see https://fetch.spec.whatwg.org/#header-list-contains + * @param {string} name + * @param {boolean} isLowerCase + */ + contains(name, isLowerCase) { + return this[kHeadersMap].has(isLowerCase ? name : name.toLowerCase()); + } + clear() { + this[kHeadersMap].clear(); + this[kHeadersSortedMap] = null; + this.cookies = null; + } + /** + * @see https://fetch.spec.whatwg.org/#concept-header-list-append + * @param {string} name + * @param {string} value + * @param {boolean} isLowerCase + */ + append(name, value, isLowerCase) { + this[kHeadersSortedMap] = null; + const lowercaseName = isLowerCase ? name : 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 ??= []).push(value); + } + /** + * @see https://fetch.spec.whatwg.org/#concept-header-list-set + * @param {string} name + * @param {string} value + * @param {boolean} isLowerCase + */ + set(name, value, isLowerCase) { + this[kHeadersSortedMap] = null; + const lowercaseName = isLowerCase ? name : name.toLowerCase(); + if (lowercaseName === "set-cookie") this.cookies = [value]; + this[kHeadersMap].set(lowercaseName, { + name, + value + }); + } + /** + * @see https://fetch.spec.whatwg.org/#concept-header-list-delete + * @param {string} name + * @param {boolean} isLowerCase + */ + delete(name, isLowerCase) { + this[kHeadersSortedMap] = null; + if (!isLowerCase) name = name.toLowerCase(); + if (name === "set-cookie") this.cookies = null; + this[kHeadersMap].delete(name); + } + /** + * @see https://fetch.spec.whatwg.org/#concept-header-list-get + * @param {string} name + * @param {boolean} isLowerCase + * @returns {string | null} + */ + get(name, isLowerCase) { + return this[kHeadersMap].get(isLowerCase ? name : name.toLowerCase())?.value ?? null; + } + *[Symbol.iterator]() { + for (const { 0: name, 1: { value } } of this[kHeadersMap]) yield [name, value]; + } + get entries() { + const headers = {}; + if (this[kHeadersMap].size !== 0) for (const { name, value } of this[kHeadersMap].values()) headers[name] = value; + return headers; + } + rawValues() { + return this[kHeadersMap].values(); + } + get entriesList() { + const headers = []; + if (this[kHeadersMap].size !== 0) for (const { 0: lowerName, 1: { name, value } } of this[kHeadersMap]) if (lowerName === "set-cookie") for (const cookie of this.cookies) headers.push([name, cookie]); + else headers.push([name, value]); + return headers; + } + toSortedArray() { + const size = this[kHeadersMap].size; + const array = new Array(size); + if (size <= 32) { + if (size === 0) return array; + const iterator = this[kHeadersMap][Symbol.iterator](); + const firstValue = iterator.next().value; + array[0] = [firstValue[0], firstValue[1].value]; + assert$7(firstValue[1].value !== null); + for (let i = 1, j = 0, right = 0, left = 0, pivot = 0, x, value; i < size; ++i) { + value = iterator.next().value; + x = array[i] = [value[0], value[1].value]; + assert$7(x[1] !== null); + left = 0; + right = i; + while (left < right) { + pivot = left + (right - left >> 1); + if (array[pivot][0] <= x[0]) left = pivot + 1; + else right = pivot; + } + if (i !== pivot) { + j = i; + while (j > left) array[j] = array[--j]; + array[left] = x; + } + } + /* c8 ignore next 4 */ + if (!iterator.next().done) throw new TypeError("Unreachable"); + return array; + } else { + let i = 0; + for (const { 0: name, 1: { value } } of this[kHeadersMap]) { + array[i++] = [name, value]; + assert$7(value !== null); + } + return array.sort(compareHeaderName); + } + } + }; + var Headers = class Headers { + #guard; + #headersList; + constructor(init = void 0) { + webidl.util.markAsUncloneable(this); + if (init === kConstruct) return; + this.#headersList = new HeadersList(); + this.#guard = "none"; + if (init !== void 0) { + init = webidl.converters.HeadersInit(init, "Headers contructor", "init"); + fill(this, init); + } + } + append(name, value) { + webidl.brandCheck(this, Headers); + webidl.argumentLengthCheck(arguments, 2, "Headers.append"); + const prefix = "Headers.append"; + name = webidl.converters.ByteString(name, prefix, "name"); + value = webidl.converters.ByteString(value, prefix, "value"); + return appendHeader(this, name, value); + } + delete(name) { + webidl.brandCheck(this, Headers); + webidl.argumentLengthCheck(arguments, 1, "Headers.delete"); + name = webidl.converters.ByteString(name, "Headers.delete", "name"); + if (!isValidHeaderName(name)) throw webidl.errors.invalidArgument({ + prefix: "Headers.delete", + value: name, + type: "header name" + }); + if (this.#guard === "immutable") throw new TypeError("immutable"); + if (!this.#headersList.contains(name, false)) return; + this.#headersList.delete(name, false); + } + get(name) { + webidl.brandCheck(this, Headers); + webidl.argumentLengthCheck(arguments, 1, "Headers.get"); + const prefix = "Headers.get"; + name = webidl.converters.ByteString(name, prefix, "name"); + if (!isValidHeaderName(name)) throw webidl.errors.invalidArgument({ + prefix, + value: name, + type: "header name" + }); + return this.#headersList.get(name, false); + } + has(name) { + webidl.brandCheck(this, Headers); + webidl.argumentLengthCheck(arguments, 1, "Headers.has"); + const prefix = "Headers.has"; + name = webidl.converters.ByteString(name, prefix, "name"); + if (!isValidHeaderName(name)) throw webidl.errors.invalidArgument({ + prefix, + value: name, + type: "header name" + }); + return this.#headersList.contains(name, false); + } + set(name, value) { + webidl.brandCheck(this, Headers); + webidl.argumentLengthCheck(arguments, 2, "Headers.set"); + const prefix = "Headers.set"; + name = webidl.converters.ByteString(name, prefix, "name"); + value = webidl.converters.ByteString(value, prefix, "value"); + value = headerValueNormalize(value); + if (!isValidHeaderName(name)) throw webidl.errors.invalidArgument({ + prefix, + value: name, + type: "header name" + }); + else if (!isValidHeaderValue(value)) throw webidl.errors.invalidArgument({ + prefix, + value, + type: "header value" + }); + if (this.#guard === "immutable") throw new TypeError("immutable"); + this.#headersList.set(name, value, false); + } + getSetCookie() { + webidl.brandCheck(this, Headers); + const list = this.#headersList.cookies; + if (list) return [...list]; + return []; + } + get [kHeadersSortedMap]() { + if (this.#headersList[kHeadersSortedMap]) return this.#headersList[kHeadersSortedMap]; + const headers = []; + const names = this.#headersList.toSortedArray(); + const cookies = this.#headersList.cookies; + if (cookies === null || cookies.length === 1) return this.#headersList[kHeadersSortedMap] = names; + for (let i = 0; i < names.length; ++i) { + const { 0: name, 1: value } = names[i]; + if (name === "set-cookie") for (let j = 0; j < cookies.length; ++j) headers.push([name, cookies[j]]); + else headers.push([name, value]); + } + return this.#headersList[kHeadersSortedMap] = headers; + } + [util.inspect.custom](depth, options) { + options.depth ??= depth; + return `Headers ${util.formatWithOptions(options, this.#headersList.entries)}`; + } + static getHeadersGuard(o) { + return o.#guard; + } + static setHeadersGuard(o, guard) { + o.#guard = guard; + } + static getHeadersList(o) { + return o.#headersList; + } + static setHeadersList(o, list) { + o.#headersList = list; + } + }; + const { getHeadersGuard, setHeadersGuard, getHeadersList, setHeadersList } = Headers; + Reflect.deleteProperty(Headers, "getHeadersGuard"); + Reflect.deleteProperty(Headers, "setHeadersGuard"); + Reflect.deleteProperty(Headers, "getHeadersList"); + Reflect.deleteProperty(Headers, "setHeadersList"); + iteratorMixin("Headers", Headers, kHeadersSortedMap, 0, 1); + Object.defineProperties(Headers.prototype, { + append: kEnumerableProperty, + delete: kEnumerableProperty, + get: kEnumerableProperty, + has: kEnumerableProperty, + set: kEnumerableProperty, + getSetCookie: kEnumerableProperty, + [Symbol.toStringTag]: { + value: "Headers", + configurable: true + }, + [util.inspect.custom]: { enumerable: false } + }); + webidl.converters.HeadersInit = function(V, prefix, argument) { + if (webidl.util.Type(V) === "Object") { + const iterator = Reflect.get(V, Symbol.iterator); + if (!util.types.isProxy(V) && iterator === Headers.prototype.entries) try { + return getHeadersList(V).entriesList; + } catch {} + if (typeof iterator === "function") return webidl.converters["sequence>"](V, prefix, argument, iterator.bind(V)); + return webidl.converters["record"](V, prefix, argument); + } + throw webidl.errors.conversionFailed({ + prefix: "Headers constructor", + argument: "Argument 1", + types: ["sequence>", "record"] + }); + }; + module.exports = { + fill, + compareHeaderName, + Headers, + HeadersList, + getHeadersGuard, + setHeadersGuard, + setHeadersList, + getHeadersList + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/fetch/response.js +var require_response = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { Headers, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = require_headers(); + const { extractBody, cloneBody, mixinBody, hasFinalizationRegistry, streamRegistry, bodyUnusable } = require_body(); + const util = require_util$7(); + const nodeUtil$1 = __require("node:util"); + const { kEnumerableProperty } = util; + const { isValidReasonPhrase, isCancelled, isAborted, isBlobLike, serializeJavascriptValueToJSONString, isErrorLike, isomorphicEncode, environmentSettingsObject: relevantRealm } = require_util$6(); + const { redirectStatusSet, nullBodyStatus } = require_constants$2(); + const { kState, kHeaders } = require_symbols$3(); + const { webidl } = require_webidl(); + const { FormData } = require_formdata(); + const { URLSerializer } = require_data_url(); + const { kConstruct } = require_symbols$4(); + const assert$6 = __require("node:assert"); + const { types: types$2 } = __require("node:util"); + const textEncoder = new TextEncoder("utf-8"); + var Response = class Response { + static error() { + return fromInnerResponse(makeNetworkError(), "immutable"); + } + static json(data, init = {}) { + webidl.argumentLengthCheck(arguments, 1, "Response.json"); + if (init !== null) init = webidl.converters.ResponseInit(init); + const body = extractBody(textEncoder.encode(serializeJavascriptValueToJSONString(data))); + const responseObject = fromInnerResponse(makeResponse({}), "response"); + initializeResponse(responseObject, init, { + body: body[0], + type: "application/json" + }); + return responseObject; + } + static redirect(url, status = 302) { + webidl.argumentLengthCheck(arguments, 1, "Response.redirect"); + url = webidl.converters.USVString(url); + status = webidl.converters["unsigned short"](status); + let parsedURL; + try { + parsedURL = new URL(url, relevantRealm.settingsObject.baseUrl); + } catch (err) { + throw new TypeError(`Failed to parse URL from ${url}`, { cause: err }); + } + if (!redirectStatusSet.has(status)) throw new RangeError(`Invalid status code ${status}`); + const responseObject = fromInnerResponse(makeResponse({}), "immutable"); + responseObject[kState].status = status; + const value = isomorphicEncode(URLSerializer(parsedURL)); + responseObject[kState].headersList.append("location", value, true); + return responseObject; + } + constructor(body = null, init = {}) { + webidl.util.markAsUncloneable(this); + if (body === kConstruct) return; + if (body !== null) body = webidl.converters.BodyInit(body); + init = webidl.converters.ResponseInit(init); + this[kState] = makeResponse({}); + this[kHeaders] = new Headers(kConstruct); + setHeadersGuard(this[kHeaders], "response"); + setHeadersList(this[kHeaders], this[kState].headersList); + let bodyWithType = null; + if (body != null) { + const [extractedBody, type] = extractBody(body); + bodyWithType = { + body: extractedBody, + type + }; + } + initializeResponse(this, init, bodyWithType); + } + get type() { + webidl.brandCheck(this, Response); + return this[kState].type; + } + 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); + } + get redirected() { + webidl.brandCheck(this, Response); + return this[kState].urlList.length > 1; + } + get status() { + webidl.brandCheck(this, Response); + return this[kState].status; + } + get ok() { + webidl.brandCheck(this, Response); + return this[kState].status >= 200 && this[kState].status <= 299; + } + get statusText() { + webidl.brandCheck(this, Response); + return this[kState].statusText; + } + 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 && util.isDisturbed(this[kState].body.stream); + } + clone() { + webidl.brandCheck(this, Response); + if (bodyUnusable(this)) throw webidl.errors.exception({ + header: "Response.clone", + message: "Body has already been consumed." + }); + const clonedResponse = cloneResponse(this[kState]); + if (hasFinalizationRegistry && this[kState].body?.stream) streamRegistry.register(this, new WeakRef(this[kState].body.stream)); + return fromInnerResponse(clonedResponse, getHeadersGuard(this[kHeaders])); + } + [nodeUtil$1.inspect.custom](depth, options) { + if (options.depth === null) options.depth = 2; + options.colors ??= true; + const properties = { + status: this.status, + statusText: this.statusText, + headers: this.headers, + body: this.body, + bodyUsed: this.bodyUsed, + ok: this.ok, + redirected: this.redirected, + type: this.type, + url: this.url + }; + return `Response ${nodeUtil$1.formatWithOptions(options, properties)}`; + } + }; + mixinBody(Response); + Object.defineProperties(Response.prototype, { + type: kEnumerableProperty, + url: kEnumerableProperty, + status: kEnumerableProperty, + ok: kEnumerableProperty, + redirected: kEnumerableProperty, + statusText: kEnumerableProperty, + headers: kEnumerableProperty, + clone: kEnumerableProperty, + body: kEnumerableProperty, + bodyUsed: kEnumerableProperty, + [Symbol.toStringTag]: { + value: "Response", + configurable: true + } + }); + Object.defineProperties(Response, { + json: kEnumerableProperty, + redirect: kEnumerableProperty, + error: kEnumerableProperty + }); + function cloneResponse(response) { + if (response.internalResponse) return filterResponse(cloneResponse(response.internalResponse), response.type); + const newResponse = makeResponse({ + ...response, + body: null + }); + if (response.body != null) newResponse.body = cloneBody(newResponse, response.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) { + return makeResponse({ + type: "error", + status: 0, + error: isErrorLike(reason) ? reason : new Error(reason ? String(reason) : reason), + aborted: reason && reason.name === "AbortError" + }); + } + function isNetworkError(response) { + return response.type === "error" && response.status === 0; + } + function makeFilteredResponse(response, state) { + state = { + internalResponse: response, + ...state + }; + return new Proxy(response, { + get(target, p) { + return p in state ? state[p] : target[p]; + }, + set(target, p, value) { + assert$6(!(p in state)); + target[p] = value; + return true; + } + }); + } + function filterResponse(response, type) { + if (type === "basic") return makeFilteredResponse(response, { + type: "basic", + headersList: response.headersList + }); + else if (type === "cors") return makeFilteredResponse(response, { + type: "cors", + headersList: response.headersList + }); + else if (type === "opaque") return makeFilteredResponse(response, { + type: "opaque", + urlList: Object.freeze([]), + status: 0, + statusText: "", + body: null + }); + else if (type === "opaqueredirect") return makeFilteredResponse(response, { + type: "opaqueredirect", + status: 0, + statusText: "", + headersList: [], + body: null + }); + else assert$6(false); + } + function makeAppropriateNetworkError(fetchParams, err = null) { + assert$6(isCancelled(fetchParams)); + return isAborted(fetchParams) ? makeNetworkError(Object.assign(new DOMException("The operation was aborted.", "AbortError"), { cause: err })) : makeNetworkError(Object.assign(new DOMException("Request was cancelled."), { cause: err })); + } + function initializeResponse(response, init, body) { + 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) response[kState].status = init.status; + if ("statusText" in init && init.statusText != null) response[kState].statusText = init.statusText; + if ("headers" in init && init.headers != null) fill(response[kHeaders], init.headers); + if (body) { + if (nullBodyStatus.includes(response.status)) throw webidl.errors.exception({ + header: "Response constructor", + message: `Invalid response status code ${response.status}` + }); + response[kState].body = body.body; + if (body.type != null && !response[kState].headersList.contains("content-type", true)) response[kState].headersList.append("content-type", body.type, true); + } + } + /** + * @see https://fetch.spec.whatwg.org/#response-create + * @param {any} innerResponse + * @param {'request' | 'immutable' | 'request-no-cors' | 'response' | 'none'} guard + * @returns {Response} + */ + function fromInnerResponse(innerResponse, guard) { + const response = new Response(kConstruct); + response[kState] = innerResponse; + response[kHeaders] = new Headers(kConstruct); + setHeadersList(response[kHeaders], innerResponse.headersList); + setHeadersGuard(response[kHeaders], guard); + if (hasFinalizationRegistry && innerResponse.body?.stream) streamRegistry.register(response, new WeakRef(innerResponse.body.stream)); + return response; + } + webidl.converters.ReadableStream = webidl.interfaceConverter(ReadableStream); + webidl.converters.FormData = webidl.interfaceConverter(FormData); + webidl.converters.URLSearchParams = webidl.interfaceConverter(URLSearchParams); + webidl.converters.XMLHttpRequestBodyInit = function(V, prefix, name) { + if (typeof V === "string") return webidl.converters.USVString(V, prefix, name); + if (isBlobLike(V)) return webidl.converters.Blob(V, prefix, name, { strict: false }); + if (ArrayBuffer.isView(V) || types$2.isArrayBuffer(V)) return webidl.converters.BufferSource(V, prefix, name); + if (util.isFormDataLike(V)) return webidl.converters.FormData(V, prefix, name, { strict: false }); + if (V instanceof URLSearchParams) return webidl.converters.URLSearchParams(V, prefix, name); + return webidl.converters.DOMString(V, prefix, name); + }; + webidl.converters.BodyInit = function(V, prefix, argument) { + if (V instanceof ReadableStream) return webidl.converters.ReadableStream(V, prefix, argument); + if (V?.[Symbol.asyncIterator]) return V; + return webidl.converters.XMLHttpRequestBodyInit(V, prefix, argument); + }; + 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 + } + ]); + module.exports = { + isNetworkError, + makeNetworkError, + makeResponse, + makeAppropriateNetworkError, + filterResponse, + Response, + cloneResponse, + fromInnerResponse + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/fetch/dispatcher-weakref.js +var require_dispatcher_weakref = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { kConnected, kSize } = require_symbols$4(); + var CompatWeakRef = class { + constructor(value) { + this.value = value; + } + deref() { + return this.value[kConnected] === 0 && this.value[kSize] === 0 ? void 0 : this.value; + } + }; + var CompatFinalizer = class { + constructor(finalizer) { + this.finalizer = finalizer; + } + register(dispatcher, key) { + if (dispatcher.on) dispatcher.on("disconnect", () => { + if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) this.finalizer(key); + }); + } + unregister(key) {} + }; + module.exports = function() { + if (process.env.NODE_V8_COVERAGE && process.version.startsWith("v18")) { + process._rawDebug("Using compatibility WeakRef and FinalizationRegistry"); + return { + WeakRef: CompatWeakRef, + FinalizationRegistry: CompatFinalizer + }; + } + return { + WeakRef, + FinalizationRegistry + }; + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/fetch/request.js +var require_request = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { extractBody, mixinBody, cloneBody, bodyUnusable } = require_body(); + const { Headers, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = require_headers(); + const { FinalizationRegistry } = require_dispatcher_weakref()(); + const util = require_util$7(); + const nodeUtil = __require("node:util"); + const { isValidHTTPToken, sameOrigin, environmentSettingsObject } = require_util$6(); + const { forbiddenMethodsSet, corsSafeListedMethodsSet, referrerPolicy, requestRedirect, requestMode, requestCredentials, requestCache, requestDuplex } = require_constants$2(); + const { kEnumerableProperty, normalizedMethodRecordsBase, normalizedMethodRecords } = util; + const { kHeaders, kSignal, kState, kDispatcher } = require_symbols$3(); + const { webidl } = require_webidl(); + const { URLSerializer } = require_data_url(); + const { kConstruct } = require_symbols$4(); + const assert$5 = __require("node:assert"); + const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = __require("node:events"); + const kAbortController = Symbol("abortController"); + const requestFinalizer = new FinalizationRegistry(({ signal, abort }) => { + signal.removeEventListener("abort", abort); + }); + const dependentControllerMap = /* @__PURE__ */ new WeakMap(); + function buildAbort(acRef) { + return abort; + function abort() { + const ac = acRef.deref(); + if (ac !== void 0) { + requestFinalizer.unregister(abort); + this.removeEventListener("abort", abort); + ac.abort(this.reason); + const controllerList = dependentControllerMap.get(ac.signal); + if (controllerList !== void 0) { + if (controllerList.size !== 0) { + for (const ref of controllerList) { + const ctrl = ref.deref(); + if (ctrl !== void 0) ctrl.abort(this.reason); + } + controllerList.clear(); + } + dependentControllerMap.delete(ac.signal); + } + } + } + } + let patchMethodWarning = false; + var Request = class Request { + constructor(input, init = {}) { + webidl.util.markAsUncloneable(this); + if (input === kConstruct) return; + const prefix = "Request constructor"; + webidl.argumentLengthCheck(arguments, 1, prefix); + input = webidl.converters.RequestInfo(input, prefix, "input"); + init = webidl.converters.RequestInit(init, prefix, "init"); + let request = null; + let fallbackMode = null; + const baseUrl = environmentSettingsObject.settingsObject.baseUrl; + let signal = null; + if (typeof input === "string") { + this[kDispatcher] = init.dispatcher; + 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); + request = makeRequest({ urlList: [parsedURL] }); + fallbackMode = "cors"; + } else { + this[kDispatcher] = init.dispatcher || input[kDispatcher]; + assert$5(input instanceof Request); + request = input[kState]; + signal = input[kSignal]; + } + const origin = environmentSettingsObject.settingsObject.origin; + let window = "client"; + if (request.window?.constructor?.name === "EnvironmentSettingsObject" && sameOrigin(request.window, origin)) window = request.window; + if (init.window != null) throw new TypeError(`'window' option '${window}' must be null`); + if ("window" in init) window = "no-window"; + request = makeRequest({ + method: request.method, + headersList: request.headersList, + unsafeRequest: request.unsafeRequest, + client: environmentSettingsObject.settingsObject, + window, + priority: request.priority, + origin: request.origin, + referrer: request.referrer, + referrerPolicy: request.referrerPolicy, + mode: request.mode, + credentials: request.credentials, + cache: request.cache, + redirect: request.redirect, + integrity: request.integrity, + keepalive: request.keepalive, + reloadNavigation: request.reloadNavigation, + historyNavigation: request.historyNavigation, + urlList: [...request.urlList] + }); + const initHasKey = Object.keys(init).length !== 0; + if (initHasKey) { + if (request.mode === "navigate") request.mode = "same-origin"; + request.reloadNavigation = false; + request.historyNavigation = false; + request.origin = "client"; + request.referrer = "client"; + request.referrerPolicy = ""; + request.url = request.urlList[request.urlList.length - 1]; + request.urlList = [request.url]; + } + if (init.referrer !== void 0) { + const referrer = init.referrer; + if (referrer === "") request.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, environmentSettingsObject.settingsObject.baseUrl)) request.referrer = "client"; + else request.referrer = parsedReferrer; + } + } + if (init.referrerPolicy !== void 0) request.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) request.mode = mode; + if (init.credentials !== void 0) request.credentials = init.credentials; + if (init.cache !== void 0) request.cache = init.cache; + if (request.cache === "only-if-cached" && request.mode !== "same-origin") throw new TypeError("'only-if-cached' can be set only with 'same-origin' mode"); + if (init.redirect !== void 0) request.redirect = init.redirect; + if (init.integrity != null) request.integrity = String(init.integrity); + if (init.keepalive !== void 0) request.keepalive = Boolean(init.keepalive); + if (init.method !== void 0) { + let method = init.method; + const mayBeNormalized = normalizedMethodRecords[method]; + if (mayBeNormalized !== void 0) request.method = mayBeNormalized; + else { + if (!isValidHTTPToken(method)) throw new TypeError(`'${method}' is not a valid HTTP method.`); + const upperCase = method.toUpperCase(); + if (forbiddenMethodsSet.has(upperCase)) throw new TypeError(`'${method}' HTTP method is unsupported.`); + method = normalizedMethodRecordsBase[upperCase] ?? method; + request.method = method; + } + if (!patchMethodWarning && request.method === "patch") { + process.emitWarning("Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.", { code: "UNDICI-FETCH-patch" }); + patchMethodWarning = true; + } + } + if (init.signal !== void 0) signal = init.signal; + this[kState] = request; + const ac = new AbortController(); + this[kSignal] = ac.signal; + 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 abort = buildAbort(new WeakRef(ac)); + try { + if (typeof getMaxListeners === "function" && getMaxListeners(signal) === defaultMaxListeners) setMaxListeners(1500, signal); + else if (getEventListeners(signal, "abort").length >= defaultMaxListeners) setMaxListeners(1500, signal); + } catch {} + util.addAbortListener(signal, abort); + requestFinalizer.register(ac, { + signal, + abort + }, abort); + } + } + this[kHeaders] = new Headers(kConstruct); + setHeadersList(this[kHeaders], request.headersList); + setHeadersGuard(this[kHeaders], "request"); + if (mode === "no-cors") { + if (!corsSafeListedMethodsSet.has(request.method)) throw new TypeError(`'${request.method} is unsupported in no-cors mode.`); + setHeadersGuard(this[kHeaders], "request-no-cors"); + } + if (initHasKey) { + /** @type {HeadersList} */ + const headersList = getHeadersList(this[kHeaders]); + const headers = init.headers !== void 0 ? init.headers : new HeadersList(headersList); + headersList.clear(); + if (headers instanceof HeadersList) { + for (const { name, value } of headers.rawValues()) headersList.append(name, value, false); + headersList.cookies = headers.cookies; + } else fillHeaders(this[kHeaders], headers); + } + const inputBody = input instanceof Request ? input[kState].body : null; + if ((init.body != null || inputBody != null) && (request.method === "GET" || request.method === "HEAD")) throw new TypeError("Request with GET/HEAD method cannot have body."); + let initBody = null; + if (init.body != null) { + const [extractedBody, contentType] = extractBody(init.body, request.keepalive); + initBody = extractedBody; + if (contentType && !getHeadersList(this[kHeaders]).contains("content-type", true)) 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 (request.mode !== "same-origin" && request.mode !== "cors") throw new TypeError("If request is made from ReadableStream, mode should be \"same-origin\" or \"cors\""); + request.useCORSPreflightFlag = true; + } + let finalBody = inputOrInitBody; + if (initBody == null && inputBody != null) { + if (bodyUnusable(input)) throw new TypeError("Cannot construct a Request with a Request object that has already been used."); + const identityTransform = new TransformStream(); + inputBody.stream.pipeThrough(identityTransform); + finalBody = { + source: inputBody.source, + length: inputBody.length, + stream: identityTransform.readable + }; + } + this[kState].body = finalBody; + } + get method() { + webidl.brandCheck(this, Request); + return this[kState].method; + } + get url() { + webidl.brandCheck(this, Request); + return URLSerializer(this[kState].url); + } + get headers() { + webidl.brandCheck(this, Request); + return this[kHeaders]; + } + get destination() { + webidl.brandCheck(this, Request); + return this[kState].destination; + } + get referrer() { + webidl.brandCheck(this, Request); + if (this[kState].referrer === "no-referrer") return ""; + if (this[kState].referrer === "client") return "about:client"; + return this[kState].referrer.toString(); + } + get referrerPolicy() { + webidl.brandCheck(this, Request); + return this[kState].referrerPolicy; + } + get mode() { + webidl.brandCheck(this, Request); + return this[kState].mode; + } + get credentials() { + return this[kState].credentials; + } + get cache() { + webidl.brandCheck(this, Request); + return this[kState].cache; + } + get redirect() { + webidl.brandCheck(this, Request); + return this[kState].redirect; + } + get integrity() { + webidl.brandCheck(this, Request); + return this[kState].integrity; + } + get keepalive() { + webidl.brandCheck(this, Request); + return this[kState].keepalive; + } + get isReloadNavigation() { + webidl.brandCheck(this, Request); + return this[kState].reloadNavigation; + } + get isHistoryNavigation() { + webidl.brandCheck(this, Request); + return this[kState].historyNavigation; + } + get signal() { + webidl.brandCheck(this, Request); + return this[kSignal]; + } + get body() { + webidl.brandCheck(this, Request); + return this[kState].body ? this[kState].body.stream : null; + } + get bodyUsed() { + webidl.brandCheck(this, Request); + return !!this[kState].body && util.isDisturbed(this[kState].body.stream); + } + get duplex() { + webidl.brandCheck(this, Request); + return "half"; + } + clone() { + webidl.brandCheck(this, Request); + if (bodyUnusable(this)) throw new TypeError("unusable"); + const clonedRequest = cloneRequest(this[kState]); + const ac = new AbortController(); + if (this.signal.aborted) ac.abort(this.signal.reason); + else { + let list = dependentControllerMap.get(this.signal); + if (list === void 0) { + list = /* @__PURE__ */ new Set(); + dependentControllerMap.set(this.signal, list); + } + const acRef = new WeakRef(ac); + list.add(acRef); + util.addAbortListener(ac.signal, buildAbort(acRef)); + } + return fromInnerRequest(clonedRequest, ac.signal, getHeadersGuard(this[kHeaders])); + } + [nodeUtil.inspect.custom](depth, options) { + if (options.depth === null) options.depth = 2; + options.colors ??= true; + const properties = { + method: this.method, + url: this.url, + headers: this.headers, + destination: this.destination, + referrer: this.referrer, + referrerPolicy: this.referrerPolicy, + mode: this.mode, + credentials: this.credentials, + cache: this.cache, + redirect: this.redirect, + integrity: this.integrity, + keepalive: this.keepalive, + isReloadNavigation: this.isReloadNavigation, + isHistoryNavigation: this.isHistoryNavigation, + signal: this.signal + }; + return `Request ${nodeUtil.formatWithOptions(options, properties)}`; + } + }; + mixinBody(Request); + function makeRequest(init) { + return { + method: init.method ?? "GET", + localURLsOnly: init.localURLsOnly ?? false, + unsafeRequest: init.unsafeRequest ?? false, + body: init.body ?? null, + client: init.client ?? null, + reservedClient: init.reservedClient ?? null, + replacesClientId: init.replacesClientId ?? "", + window: init.window ?? "client", + keepalive: init.keepalive ?? false, + serviceWorkers: init.serviceWorkers ?? "all", + initiator: init.initiator ?? "", + destination: init.destination ?? "", + priority: init.priority ?? null, + origin: init.origin ?? "client", + policyContainer: init.policyContainer ?? "client", + referrer: init.referrer ?? "client", + referrerPolicy: init.referrerPolicy ?? "", + mode: init.mode ?? "no-cors", + useCORSPreflightFlag: init.useCORSPreflightFlag ?? false, + credentials: init.credentials ?? "same-origin", + useCredentials: init.useCredentials ?? false, + cache: init.cache ?? "default", + redirect: init.redirect ?? "follow", + integrity: init.integrity ?? "", + cryptoGraphicsNonceMetadata: init.cryptoGraphicsNonceMetadata ?? "", + parserMetadata: init.parserMetadata ?? "", + reloadNavigation: init.reloadNavigation ?? false, + historyNavigation: init.historyNavigation ?? false, + userActivation: init.userActivation ?? false, + taintedOrigin: init.taintedOrigin ?? false, + redirectCount: init.redirectCount ?? 0, + responseTainting: init.responseTainting ?? "basic", + preventNoCacheCacheControlHeaderModification: init.preventNoCacheCacheControlHeaderModification ?? false, + done: init.done ?? false, + timingAllowFailed: init.timingAllowFailed ?? false, + urlList: init.urlList, + url: init.urlList[0], + headersList: init.headersList ? new HeadersList(init.headersList) : new HeadersList() + }; + } + function cloneRequest(request) { + const newRequest = makeRequest({ + ...request, + body: null + }); + if (request.body != null) newRequest.body = cloneBody(newRequest, request.body); + return newRequest; + } + /** + * @see https://fetch.spec.whatwg.org/#request-create + * @param {any} innerRequest + * @param {AbortSignal} signal + * @param {'request' | 'immutable' | 'request-no-cors' | 'response' | 'none'} guard + * @returns {Request} + */ + function fromInnerRequest(innerRequest, signal, guard) { + const request = new Request(kConstruct); + request[kState] = innerRequest; + request[kSignal] = signal; + request[kHeaders] = new Headers(kConstruct); + setHeadersList(request[kHeaders], innerRequest.headersList); + setHeadersGuard(request[kHeaders], guard); + return request; + } + Object.defineProperties(Request.prototype, { + method: kEnumerableProperty, + url: kEnumerableProperty, + headers: kEnumerableProperty, + redirect: kEnumerableProperty, + clone: kEnumerableProperty, + signal: kEnumerableProperty, + duplex: kEnumerableProperty, + destination: kEnumerableProperty, + body: kEnumerableProperty, + bodyUsed: kEnumerableProperty, + isHistoryNavigation: kEnumerableProperty, + isReloadNavigation: kEnumerableProperty, + keepalive: kEnumerableProperty, + integrity: kEnumerableProperty, + cache: kEnumerableProperty, + credentials: kEnumerableProperty, + attribute: kEnumerableProperty, + referrerPolicy: kEnumerableProperty, + referrer: kEnumerableProperty, + mode: kEnumerableProperty, + [Symbol.toStringTag]: { + value: "Request", + configurable: true + } + }); + webidl.converters.Request = webidl.interfaceConverter(Request); + webidl.converters.RequestInfo = function(V, prefix, argument) { + if (typeof V === "string") return webidl.converters.USVString(V, prefix, argument); + if (V instanceof Request) return webidl.converters.Request(V, prefix, argument); + return webidl.converters.USVString(V, prefix, argument); + }; + 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, + allowedValues: referrerPolicy + }, + { + key: "mode", + converter: webidl.converters.DOMString, + allowedValues: requestMode + }, + { + key: "credentials", + converter: webidl.converters.DOMString, + allowedValues: requestCredentials + }, + { + key: "cache", + converter: webidl.converters.DOMString, + allowedValues: requestCache + }, + { + key: "redirect", + converter: webidl.converters.DOMString, + allowedValues: requestRedirect + }, + { + key: "integrity", + converter: webidl.converters.DOMString + }, + { + key: "keepalive", + converter: webidl.converters.boolean + }, + { + key: "signal", + converter: webidl.nullableConverter((signal) => webidl.converters.AbortSignal(signal, "RequestInit", "signal", { strict: false })) + }, + { + key: "window", + converter: webidl.converters.any + }, + { + key: "duplex", + converter: webidl.converters.DOMString, + allowedValues: requestDuplex + }, + { + key: "dispatcher", + converter: webidl.converters.any + } + ]); + module.exports = { + Request, + makeRequest, + fromInnerRequest, + cloneRequest + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/fetch/index.js +var require_fetch = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { makeNetworkError, makeAppropriateNetworkError, filterResponse, makeResponse, fromInnerResponse } = require_response(); + const { HeadersList } = require_headers(); + const { Request, cloneRequest } = require_request(); + const zlib = __require("node:zlib"); + const { bytesMatch, makePolicyContainer, clonePolicyContainer, requestBadPort, TAOCheck, appendRequestOriginHeader, responseLocationURL, requestCurrentURL, setRequestReferrerPolicyOnRedirect, tryUpgradeRequestToAPotentiallyTrustworthyURL, createOpaqueTimingInfo, appendFetchMetadata, corsCheck, crossOriginResourcePolicyCheck, determineRequestsReferrer, coarsenedSharedCurrentTime, createDeferredPromise, isBlobLike, sameOrigin, isCancelled, isAborted, isErrorLike, fullyReadBody, readableStreamClose, isomorphicEncode, urlIsLocal, urlIsHttpHttpsScheme, urlHasHttpsScheme, clampAndCoarsenConnectionTimingInfo, simpleRangeHeaderValue, buildContentRange, createInflate, extractMimeType } = require_util$6(); + const { kState, kDispatcher } = require_symbols$3(); + const assert$4 = __require("node:assert"); + const { safelyExtractBody, extractBody } = require_body(); + const { redirectStatusSet, nullBodyStatus, safeMethodsSet, requestBodyHeader, subresourceSet } = require_constants$2(); + const EE = __require("node:events"); + const { Readable, pipeline: pipeline$1, finished } = __require("node:stream"); + const { addAbortListener, isErrored, isReadable, bufferToLowerCasedHeaderName } = require_util$7(); + const { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = require_data_url(); + const { getGlobalDispatcher } = require_global(); + const { webidl } = require_webidl(); + const { STATUS_CODES } = __require("node:http"); + const GET_OR_HEAD = ["GET", "HEAD"]; + const defaultUserAgent = typeof __UNDICI_IS_NODE__ !== "undefined" || typeof esbuildDetection !== "undefined" ? "node" : "undici"; + /** @type {import('buffer').resolveObjectURL} */ + let resolveObjectURL; + var Fetch = class extends EE { + constructor(dispatcher) { + super(); + this.dispatcher = dispatcher; + this.connection = null; + this.dump = false; + this.state = "ongoing"; + } + terminate(reason) { + if (this.state !== "ongoing") return; + this.state = "terminated"; + this.connection?.destroy(reason); + this.emit("terminated", reason); + } + abort(error) { + if (this.state !== "ongoing") return; + this.state = "aborted"; + if (!error) error = new DOMException("The operation was aborted.", "AbortError"); + this.serializedAbortReason = error; + this.connection?.destroy(error); + this.emit("terminated", error); + } + }; + function handleFetchDone(response) { + finalizeAndReportTiming(response, "fetch"); + } + function fetch(input, init = void 0) { + webidl.argumentLengthCheck(arguments, 1, "globalThis.fetch"); + let p = createDeferredPromise(); + let requestObject; + try { + requestObject = new Request(input, init); + } catch (e) { + p.reject(e); + return p.promise; + } + const request = requestObject[kState]; + if (requestObject.signal.aborted) { + abortFetch(p, request, null, requestObject.signal.reason); + return p.promise; + } + if (request.client.globalObject?.constructor?.name === "ServiceWorkerGlobalScope") request.serviceWorkers = "none"; + let responseObject = null; + let locallyAborted = false; + let controller = null; + addAbortListener(requestObject.signal, () => { + locallyAborted = true; + assert$4(controller != null); + controller.abort(requestObject.signal.reason); + const realResponse = responseObject?.deref(); + abortFetch(p, request, realResponse, requestObject.signal.reason); + }); + const processResponse = (response) => { + if (locallyAborted) return; + if (response.aborted) { + abortFetch(p, request, responseObject, controller.serializedAbortReason); + return; + } + if (response.type === "error") { + p.reject(new TypeError("fetch failed", { cause: response.error })); + return; + } + responseObject = new WeakRef(fromInnerResponse(response, "immutable")); + p.resolve(responseObject.deref()); + p = null; + }; + controller = fetching({ + request, + processResponseEndOfBody: handleFetchDone, + processResponse, + dispatcher: requestObject[kDispatcher] + }); + return p.promise; + } + function finalizeAndReportTiming(response, initiatorType = "other") { + if (response.type === "error" && response.aborted) return; + if (!response.urlList?.length) return; + const originalURL = response.urlList[0]; + let timingInfo = response.timingInfo; + let cacheState = response.cacheState; + if (!urlIsHttpHttpsScheme(originalURL)) return; + if (timingInfo === null) return; + if (!response.timingAllowPassed) { + timingInfo = createOpaqueTimingInfo({ startTime: timingInfo.startTime }); + cacheState = ""; + } + timingInfo.endTime = coarsenedSharedCurrentTime(); + response.timingInfo = timingInfo; + markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis, cacheState); + } + const markResourceTiming = performance.markResourceTiming; + function abortFetch(p, request, responseObject, error) { + if (p) p.reject(error); + if (request.body != null && isReadable(request.body?.stream)) request.body.stream.cancel(error).catch((err) => { + if (err.code === "ERR_INVALID_STATE") return; + throw err; + }); + if (responseObject == null) return; + const response = responseObject[kState]; + if (response.body != null && isReadable(response.body?.stream)) response.body.stream.cancel(error).catch((err) => { + if (err.code === "ERR_INVALID_STATE") return; + throw err; + }); + } + function fetching({ request, processRequestBodyChunkLength, processRequestEndOfBody, processResponse, processResponseEndOfBody, processResponseConsumeBody, useParallelQueue = false, dispatcher = getGlobalDispatcher() }) { + assert$4(dispatcher); + let taskDestination = null; + let crossOriginIsolatedCapability = false; + if (request.client != null) { + taskDestination = request.client.globalObject; + crossOriginIsolatedCapability = request.client.crossOriginIsolatedCapability; + } + const timingInfo = createOpaqueTimingInfo({ startTime: coarsenedSharedCurrentTime(crossOriginIsolatedCapability) }); + const fetchParams = { + controller: new Fetch(dispatcher), + request, + timingInfo, + processRequestBodyChunkLength, + processRequestEndOfBody, + processResponse, + processResponseConsumeBody, + processResponseEndOfBody, + taskDestination, + crossOriginIsolatedCapability + }; + assert$4(!request.body || request.body.stream); + if (request.window === "client") request.window = request.client?.globalObject?.constructor?.name === "Window" ? request.client : "no-window"; + if (request.origin === "client") request.origin = request.client.origin; + if (request.policyContainer === "client") if (request.client != null) request.policyContainer = clonePolicyContainer(request.client.policyContainer); + else request.policyContainer = makePolicyContainer(); + if (!request.headersList.contains("accept", true)) request.headersList.append("accept", "*/*", true); + if (!request.headersList.contains("accept-language", true)) request.headersList.append("accept-language", "*", true); + if (request.priority === null) {} + if (subresourceSet.has(request.destination)) {} + mainFetch(fetchParams).catch((err) => { + fetchParams.controller.terminate(err); + }); + return fetchParams.controller; + } + async function mainFetch(fetchParams, recursive = false) { + const request = fetchParams.request; + let response = null; + if (request.localURLsOnly && !urlIsLocal(requestCurrentURL(request))) response = makeNetworkError("local URLs only"); + tryUpgradeRequestToAPotentiallyTrustworthyURL(request); + if (requestBadPort(request) === "blocked") response = makeNetworkError("bad port"); + if (request.referrerPolicy === "") request.referrerPolicy = request.policyContainer.referrerPolicy; + if (request.referrer !== "no-referrer") request.referrer = determineRequestsReferrer(request); + if (response === null) response = await (async () => { + const currentURL = requestCurrentURL(request); + if (sameOrigin(currentURL, request.url) && request.responseTainting === "basic" || currentURL.protocol === "data:" || request.mode === "navigate" || request.mode === "websocket") { + request.responseTainting = "basic"; + return await schemeFetch(fetchParams); + } + if (request.mode === "same-origin") return makeNetworkError("request mode cannot be \"same-origin\""); + if (request.mode === "no-cors") { + if (request.redirect !== "follow") return makeNetworkError("redirect mode cannot be \"follow\" for \"no-cors\" request"); + request.responseTainting = "opaque"; + return await schemeFetch(fetchParams); + } + if (!urlIsHttpHttpsScheme(requestCurrentURL(request))) return makeNetworkError("URL scheme must be a HTTP(S) scheme"); + request.responseTainting = "cors"; + return await httpFetch(fetchParams); + })(); + if (recursive) return response; + if (response.status !== 0 && !response.internalResponse) { + if (request.responseTainting === "cors") {} + if (request.responseTainting === "basic") response = filterResponse(response, "basic"); + else if (request.responseTainting === "cors") response = filterResponse(response, "cors"); + else if (request.responseTainting === "opaque") response = filterResponse(response, "opaque"); + else assert$4(false); + } + let internalResponse = response.status === 0 ? response : response.internalResponse; + if (internalResponse.urlList.length === 0) internalResponse.urlList.push(...request.urlList); + if (!request.timingAllowFailed) response.timingAllowPassed = true; + if (response.type === "opaque" && internalResponse.status === 206 && internalResponse.rangeRequested && !request.headers.contains("range", true)) response = internalResponse = makeNetworkError(); + if (response.status !== 0 && (request.method === "HEAD" || request.method === "CONNECT" || nullBodyStatus.includes(internalResponse.status))) { + internalResponse.body = null; + fetchParams.controller.dump = true; + } + if (request.integrity) { + const processBodyError = (reason) => fetchFinale(fetchParams, makeNetworkError(reason)); + if (request.responseTainting === "opaque" || response.body == null) { + processBodyError(response.error); + return; + } + const processBody = (bytes) => { + if (!bytesMatch(bytes, request.integrity)) { + processBodyError("integrity mismatch"); + return; + } + response.body = safelyExtractBody(bytes)[0]; + fetchFinale(fetchParams, response); + }; + await fullyReadBody(response.body, processBody, processBodyError); + } else fetchFinale(fetchParams, response); + } + function schemeFetch(fetchParams) { + if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) return Promise.resolve(makeAppropriateNetworkError(fetchParams)); + const { request } = fetchParams; + const { protocol: scheme } = requestCurrentURL(request); + switch (scheme) { + case "about:": return Promise.resolve(makeNetworkError("about scheme is not supported")); + case "blob:": { + if (!resolveObjectURL) resolveObjectURL = __require("node:buffer").resolveObjectURL; + const blobURLEntry = requestCurrentURL(request); + if (blobURLEntry.search.length !== 0) return Promise.resolve(makeNetworkError("NetworkError when attempting to fetch resource.")); + const blob = resolveObjectURL(blobURLEntry.toString()); + if (request.method !== "GET" || !isBlobLike(blob)) return Promise.resolve(makeNetworkError("invalid method")); + const response = makeResponse(); + const fullLength = blob.size; + const serializedFullLength = isomorphicEncode(`${fullLength}`); + const type = blob.type; + if (!request.headersList.contains("range", true)) { + const bodyWithType = extractBody(blob); + response.statusText = "OK"; + response.body = bodyWithType[0]; + response.headersList.set("content-length", serializedFullLength, true); + response.headersList.set("content-type", type, true); + } else { + response.rangeRequested = true; + const rangeValue = simpleRangeHeaderValue(request.headersList.get("range", true), true); + if (rangeValue === "failure") return Promise.resolve(makeNetworkError("failed to fetch the data URL")); + let { rangeStartValue: rangeStart, rangeEndValue: rangeEnd } = rangeValue; + if (rangeStart === null) { + rangeStart = fullLength - rangeEnd; + rangeEnd = rangeStart + rangeEnd - 1; + } else { + if (rangeStart >= fullLength) return Promise.resolve(makeNetworkError("Range start is greater than the blob's size.")); + if (rangeEnd === null || rangeEnd >= fullLength) rangeEnd = fullLength - 1; + } + const slicedBlob = blob.slice(rangeStart, rangeEnd, type); + response.body = extractBody(slicedBlob)[0]; + const serializedSlicedLength = isomorphicEncode(`${slicedBlob.size}`); + const contentRange = buildContentRange(rangeStart, rangeEnd, fullLength); + response.status = 206; + response.statusText = "Partial Content"; + response.headersList.set("content-length", serializedSlicedLength, true); + response.headersList.set("content-type", type, true); + response.headersList.set("content-range", contentRange, true); + } + return Promise.resolve(response); + } + case "data:": { + const dataURLStruct = dataURLProcessor(requestCurrentURL(request)); + 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, response) { + fetchParams.request.done = true; + if (fetchParams.processResponseDone != null) queueMicrotask(() => fetchParams.processResponseDone(response)); + } + function fetchFinale(fetchParams, response) { + let timingInfo = fetchParams.timingInfo; + const processResponseEndOfBody = () => { + const unsafeEndTime = Date.now(); + if (fetchParams.request.destination === "document") fetchParams.controller.fullTimingInfo = timingInfo; + fetchParams.controller.reportTimingSteps = () => { + if (fetchParams.request.url.protocol !== "https:") return; + timingInfo.endTime = unsafeEndTime; + let cacheState = response.cacheState; + const bodyInfo = response.bodyInfo; + if (!response.timingAllowPassed) { + timingInfo = createOpaqueTimingInfo(timingInfo); + cacheState = ""; + } + let responseStatus = 0; + if (fetchParams.request.mode !== "navigator" || !response.hasCrossOriginRedirects) { + responseStatus = response.status; + const mimeType = extractMimeType(response.headersList); + if (mimeType !== "failure") bodyInfo.contentType = minimizeSupportedMimeType(mimeType); + } + if (fetchParams.request.initiatorType != null) markResourceTiming(timingInfo, fetchParams.request.url.href, fetchParams.request.initiatorType, globalThis, cacheState, bodyInfo, responseStatus); + }; + const processResponseEndOfBodyTask = () => { + fetchParams.request.done = true; + if (fetchParams.processResponseEndOfBody != null) queueMicrotask(() => fetchParams.processResponseEndOfBody(response)); + if (fetchParams.request.initiatorType != null) fetchParams.controller.reportTimingSteps(); + }; + queueMicrotask(() => processResponseEndOfBodyTask()); + }; + if (fetchParams.processResponse != null) queueMicrotask(() => { + fetchParams.processResponse(response); + fetchParams.processResponse = null; + }); + const internalResponse = response.type === "error" ? response : response.internalResponse ?? response; + if (internalResponse.body == null) processResponseEndOfBody(); + else finished(internalResponse.body.stream, () => { + processResponseEndOfBody(); + }); + } + async function httpFetch(fetchParams) { + const request = fetchParams.request; + let response = null; + let actualResponse = null; + const timingInfo = fetchParams.timingInfo; + if (request.serviceWorkers === "all") {} + if (response === null) { + if (request.redirect === "follow") request.serviceWorkers = "none"; + actualResponse = response = await httpNetworkOrCacheFetch(fetchParams); + if (request.responseTainting === "cors" && corsCheck(request, response) === "failure") return makeNetworkError("cors failure"); + if (TAOCheck(request, response) === "failure") request.timingAllowFailed = true; + } + if ((request.responseTainting === "opaque" || response.type === "opaque") && crossOriginResourcePolicyCheck(request.origin, request.client, request.destination, actualResponse) === "blocked") return makeNetworkError("blocked"); + if (redirectStatusSet.has(actualResponse.status)) { + if (request.redirect !== "manual") fetchParams.controller.connection.destroy(void 0, false); + if (request.redirect === "error") response = makeNetworkError("unexpected redirect"); + else if (request.redirect === "manual") response = actualResponse; + else if (request.redirect === "follow") response = await httpRedirectFetch(fetchParams, response); + else assert$4(false); + } + response.timingInfo = timingInfo; + return response; + } + function httpRedirectFetch(fetchParams, response) { + const request = fetchParams.request; + const actualResponse = response.internalResponse ? response.internalResponse : response; + let locationURL; + try { + locationURL = responseLocationURL(actualResponse, requestCurrentURL(request).hash); + if (locationURL == null) return response; + } catch (err) { + return Promise.resolve(makeNetworkError(err)); + } + if (!urlIsHttpHttpsScheme(locationURL)) return Promise.resolve(makeNetworkError("URL scheme must be a HTTP(S) scheme")); + if (request.redirectCount === 20) return Promise.resolve(makeNetworkError("redirect count exceeded")); + request.redirectCount += 1; + if (request.mode === "cors" && (locationURL.username || locationURL.password) && !sameOrigin(request, locationURL)) return Promise.resolve(makeNetworkError("cross origin not allowed for request mode \"cors\"")); + if (request.responseTainting === "cors" && (locationURL.username || locationURL.password)) return Promise.resolve(makeNetworkError("URL cannot contain credentials for request mode \"cors\"")); + if (actualResponse.status !== 303 && request.body != null && request.body.source == null) return Promise.resolve(makeNetworkError()); + if ([301, 302].includes(actualResponse.status) && request.method === "POST" || actualResponse.status === 303 && !GET_OR_HEAD.includes(request.method)) { + request.method = "GET"; + request.body = null; + for (const headerName of requestBodyHeader) request.headersList.delete(headerName); + } + if (!sameOrigin(requestCurrentURL(request), locationURL)) { + request.headersList.delete("authorization", true); + request.headersList.delete("proxy-authorization", true); + request.headersList.delete("cookie", true); + request.headersList.delete("host", true); + } + if (request.body != null) { + assert$4(request.body.source != null); + request.body = safelyExtractBody(request.body.source)[0]; + } + const timingInfo = fetchParams.timingInfo; + timingInfo.redirectEndTime = timingInfo.postRedirectStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability); + if (timingInfo.redirectStartTime === 0) timingInfo.redirectStartTime = timingInfo.startTime; + request.urlList.push(locationURL); + setRequestReferrerPolicyOnRedirect(request, actualResponse); + return mainFetch(fetchParams, true); + } + async function httpNetworkOrCacheFetch(fetchParams, isAuthenticationFetch = false, isNewConnectionFetch = false) { + const request = fetchParams.request; + let httpFetchParams = null; + let httpRequest = null; + let response = null; + const httpCache = null; + if (request.window === "no-window" && request.redirect === "error") { + httpFetchParams = fetchParams; + httpRequest = request; + } else { + httpRequest = cloneRequest(request); + httpFetchParams = { ...fetchParams }; + httpFetchParams.request = httpRequest; + } + const includeCredentials = request.credentials === "include" || request.credentials === "same-origin" && request.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, true); + if (contentLength != null && httpRequest.keepalive) {} + if (httpRequest.referrer instanceof URL) httpRequest.headersList.append("referer", isomorphicEncode(httpRequest.referrer.href), true); + appendRequestOriginHeader(httpRequest); + appendFetchMetadata(httpRequest); + if (!httpRequest.headersList.contains("user-agent", true)) httpRequest.headersList.append("user-agent", defaultUserAgent); + if (httpRequest.cache === "default" && (httpRequest.headersList.contains("if-modified-since", true) || httpRequest.headersList.contains("if-none-match", true) || httpRequest.headersList.contains("if-unmodified-since", true) || httpRequest.headersList.contains("if-match", true) || httpRequest.headersList.contains("if-range", true))) httpRequest.cache = "no-store"; + if (httpRequest.cache === "no-cache" && !httpRequest.preventNoCacheCacheControlHeaderModification && !httpRequest.headersList.contains("cache-control", true)) httpRequest.headersList.append("cache-control", "max-age=0", true); + if (httpRequest.cache === "no-store" || httpRequest.cache === "reload") { + if (!httpRequest.headersList.contains("pragma", true)) httpRequest.headersList.append("pragma", "no-cache", true); + if (!httpRequest.headersList.contains("cache-control", true)) httpRequest.headersList.append("cache-control", "no-cache", true); + } + if (httpRequest.headersList.contains("range", true)) httpRequest.headersList.append("accept-encoding", "identity", true); + if (!httpRequest.headersList.contains("accept-encoding", true)) if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) httpRequest.headersList.append("accept-encoding", "br, gzip, deflate", true); + else httpRequest.headersList.append("accept-encoding", "gzip, deflate", true); + httpRequest.headersList.delete("host", true); + if (includeCredentials) {} + if (httpCache == null) httpRequest.cache = "no-store"; + if (httpRequest.cache !== "no-store" && httpRequest.cache !== "reload") {} + if (response == null) { + if (httpRequest.cache === "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 (response == null) response = forwardResponse; + } + response.urlList = [...httpRequest.urlList]; + if (httpRequest.headersList.contains("range", true)) response.rangeRequested = true; + response.requestIncludesCredentials = includeCredentials; + if (response.status === 407) { + if (request.window === "no-window") return makeNetworkError(); + if (isCancelled(fetchParams)) return makeAppropriateNetworkError(fetchParams); + return makeNetworkError("proxy authentication required"); + } + if (response.status === 421 && !isNewConnectionFetch && (request.body == null || request.body.source != null)) { + if (isCancelled(fetchParams)) return makeAppropriateNetworkError(fetchParams); + fetchParams.controller.connection.destroy(); + response = await httpNetworkOrCacheFetch(fetchParams, isAuthenticationFetch, true); + } + if (isAuthenticationFetch) {} + return response; + } + async function httpNetworkFetch(fetchParams, includeCredentials = false, forceNewConnection = false) { + assert$4(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed); + fetchParams.controller.connection = { + abort: null, + destroyed: false, + destroy(err, abort = true) { + if (!this.destroyed) { + this.destroyed = true; + if (abort) this.abort?.(err ?? new DOMException("The operation was aborted.", "AbortError")); + } + } + }; + const request = fetchParams.request; + let response = null; + const timingInfo = fetchParams.timingInfo; + request.cache = "no-store"; + if (request.mode === "websocket") {} + let requestBody = null; + if (request.body == null && fetchParams.processRequestEndOfBody) queueMicrotask(() => fetchParams.processRequestEndOfBody()); + else if (request.body != null) { + const processBodyChunk = async function* (bytes) { + if (isCancelled(fetchParams)) return; + yield bytes; + fetchParams.processRequestBodyChunkLength?.(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 request.body.stream) yield* processBodyChunk(bytes); + processEndOfBody(); + } catch (err) { + processBodyError(err); + } + })(); + } + try { + const { body, status, statusText, headersList, socket } = await dispatch({ body: requestBody }); + if (socket) response = makeResponse({ + status, + statusText, + headersList, + socket + }); + else { + const iterator = body[Symbol.asyncIterator](); + fetchParams.controller.next = () => iterator.next(); + response = makeResponse({ + status, + statusText, + headersList + }); + } + } catch (err) { + if (err.name === "AbortError") { + fetchParams.controller.connection.destroy(); + return makeAppropriateNetworkError(fetchParams, err); + } + return makeNetworkError(err); + } + const pullAlgorithm = async () => { + await fetchParams.controller.resume(); + }; + const cancelAlgorithm = (reason) => { + if (!isCancelled(fetchParams)) fetchParams.controller.abort(reason); + }; + const stream = new ReadableStream({ + async start(controller) { + fetchParams.controller.controller = controller; + }, + async pull(controller) { + await pullAlgorithm(controller); + }, + async cancel(reason) { + await cancelAlgorithm(reason); + }, + type: "bytes" + }); + response.body = { + stream, + source: null, + length: null + }; + fetchParams.controller.onAborted = onAborted; + 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, response); + return; + } + timingInfo.decodedBodySize += bytes?.byteLength ?? 0; + if (isFailure) { + fetchParams.controller.terminate(bytes); + return; + } + const buffer = new Uint8Array(bytes); + if (buffer.byteLength) fetchParams.controller.controller.enqueue(buffer); + if (isErrored(stream)) { + fetchParams.controller.terminate(); + return; + } + if (fetchParams.controller.controller.desiredSize <= 0) return; + } + }; + function onAborted(reason) { + if (isAborted(fetchParams)) { + response.aborted = true; + if (isReadable(stream)) fetchParams.controller.controller.error(fetchParams.controller.serializedAbortReason); + } else if (isReadable(stream)) fetchParams.controller.controller.error(new TypeError("terminated", { cause: isErrorLike(reason) ? reason : void 0 })); + fetchParams.controller.connection.destroy(); + } + return response; + function dispatch({ body }) { + const url = requestCurrentURL(request); + /** @type {import('../..').Agent} */ + const agent = fetchParams.controller.dispatcher; + return new Promise((resolve, reject) => agent.dispatch({ + path: url.pathname + url.search, + origin: url.origin, + method: request.method, + body: agent.isMockActive ? request.body && (request.body.source || request.body.stream) : body, + headers: request.headersList.entries, + maxRedirections: 0, + upgrade: request.mode === "websocket" ? "websocket" : void 0 + }, { + body: null, + abort: null, + onConnect(abort) { + const { connection } = fetchParams.controller; + timingInfo.finalConnectionTimingInfo = clampAndCoarsenConnectionTimingInfo(void 0, timingInfo.postRedirectStartTime, fetchParams.crossOriginIsolatedCapability); + if (connection.destroyed) abort(new DOMException("The operation was aborted.", "AbortError")); + else { + fetchParams.controller.on("terminated", abort); + this.abort = connection.abort = abort; + } + timingInfo.finalNetworkRequestStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability); + }, + onResponseStarted() { + timingInfo.finalNetworkResponseStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability); + }, + onHeaders(status, rawHeaders, resume, statusText) { + if (status < 200) return; + let location = ""; + const headersList = new HeadersList(); + for (let i = 0; i < rawHeaders.length; i += 2) headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i]), rawHeaders[i + 1].toString("latin1"), true); + location = headersList.get("location", true); + this.body = new Readable({ read: resume }); + const decoders = []; + const willFollow = location && request.redirect === "follow" && redirectStatusSet.has(status); + if (request.method !== "HEAD" && request.method !== "CONNECT" && !nullBodyStatus.includes(status) && !willFollow) { + const contentEncoding = headersList.get("content-encoding", true); + /** @type {string[]} */ + const codings = contentEncoding ? contentEncoding.toLowerCase().split(",") : []; + const maxContentEncodings = 5; + if (codings.length > maxContentEncodings) { + reject(/* @__PURE__ */ new Error(`too many content-encodings in response: ${codings.length}, maximum allowed is ${maxContentEncodings}`)); + return true; + } + for (let i = codings.length - 1; i >= 0; --i) { + const coding = codings[i].trim(); + if (coding === "x-gzip" || coding === "gzip") decoders.push(zlib.createGunzip({ + flush: zlib.constants.Z_SYNC_FLUSH, + finishFlush: zlib.constants.Z_SYNC_FLUSH + })); + else if (coding === "deflate") decoders.push(createInflate({ + flush: zlib.constants.Z_SYNC_FLUSH, + finishFlush: zlib.constants.Z_SYNC_FLUSH + })); + else if (coding === "br") decoders.push(zlib.createBrotliDecompress({ + flush: zlib.constants.BROTLI_OPERATION_FLUSH, + finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH + })); + else { + decoders.length = 0; + break; + } + } + } + const onError = this.onError.bind(this); + resolve({ + status, + statusText, + headersList, + body: decoders.length ? pipeline$1(this.body, ...decoders, (err) => { + if (err) this.onError(err); + }).on("error", onError) : this.body.on("error", onError) + }); + 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); + if (fetchParams.controller.onAborted) fetchParams.controller.off("terminated", fetchParams.controller.onAborted); + fetchParams.controller.ended = true; + this.body.push(null); + }, + onError(error) { + if (this.abort) fetchParams.controller.off("terminated", this.abort); + this.body?.destroy(error); + fetchParams.controller.terminate(error); + reject(error); + }, + onUpgrade(status, rawHeaders, socket) { + if (status !== 101) return; + const headersList = new HeadersList(); + for (let i = 0; i < rawHeaders.length; i += 2) headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i]), rawHeaders[i + 1].toString("latin1"), true); + resolve({ + status, + statusText: STATUS_CODES[status], + headersList, + socket + }); + return true; + } + })); + } + } + module.exports = { + fetch, + Fetch, + fetching, + finalizeAndReportTiming + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/fileapi/symbols.js +var require_symbols$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + module.exports = { + kState: Symbol("FileReader state"), + kResult: Symbol("FileReader result"), + kError: Symbol("FileReader error"), + kLastProgressEventFired: Symbol("FileReader last progress event fired timestamp"), + kEvents: Symbol("FileReader events"), + kAborted: Symbol("FileReader aborted") + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/fileapi/progressevent.js +var require_progressevent = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { webidl } = require_webidl(); + const kState = Symbol("ProgressEvent state"); + /** + * @see https://xhr.spec.whatwg.org/#progressevent + */ + var ProgressEvent = class ProgressEvent extends Event { + constructor(type, eventInitDict = {}) { + type = webidl.converters.DOMString(type, "ProgressEvent constructor", "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 + } + ]); + module.exports = { ProgressEvent }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/fileapi/encoding.js +var require_encoding = /* @__PURE__ */ __commonJSMin(((exports, module) => { + /** + * @see https://encoding.spec.whatwg.org/#concept-encoding-get + * @param {string|undefined} label + */ + 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"; + } + } + module.exports = { getEncoding }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/fileapi/util.js +var require_util$4 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { kState, kError, kResult, kAborted, kLastProgressEventFired } = require_symbols$2(); + const { ProgressEvent } = require_progressevent(); + const { getEncoding } = require_encoding(); + const { serializeAMimeType, parseMIMEType } = require_data_url(); + const { types: types$1 } = __require("node:util"); + const { StringDecoder: StringDecoder$1 } = __require("string_decoder"); + const { btoa: btoa$1 } = __require("node:buffer"); + /** @type {PropertyDescriptor} */ + const staticPropertyDescriptors = { + enumerable: true, + writable: false, + configurable: false + }; + /** + * @see https://w3c.github.io/FileAPI/#readOperation + * @param {import('./filereader').FileReader} fr + * @param {import('buffer').Blob} blob + * @param {string} type + * @param {string?} encodingName + */ + function readOperation(fr, blob, type, encodingName) { + if (fr[kState] === "loading") throw new DOMException("Invalid state", "InvalidStateError"); + fr[kState] = "loading"; + fr[kResult] = null; + fr[kError] = null; + const reader = blob.stream().getReader(); + /** @type {Uint8Array[]} */ + const bytes = []; + let chunkPromise = reader.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 && types$1.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 = reader.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 (error) { + fr[kError] = error; + fireAProgressEvent("error", fr); + } + if (fr[kState] !== "loading") fireAProgressEvent("loadend", fr); + }); + break; + } + } catch (error) { + if (fr[kAborted]) return; + queueMicrotask(() => { + fr[kState] = "done"; + fr[kError] = error; + fireAProgressEvent("error", fr); + if (fr[kState] !== "loading") fireAProgressEvent("loadend", fr); + }); + break; + } + })(); + } + /** + * @see https://w3c.github.io/FileAPI/#fire-a-progress-event + * @see https://dom.spec.whatwg.org/#concept-event-fire + * @param {string} e The name of the event + * @param {import('./filereader').FileReader} reader + */ + function fireAProgressEvent(e, reader) { + const event = new ProgressEvent(e, { + bubbles: false, + cancelable: false + }); + reader.dispatchEvent(event); + } + /** + * @see https://w3c.github.io/FileAPI/#blob-package-data + * @param {Uint8Array[]} bytes + * @param {string} type + * @param {string?} mimeType + * @param {string?} encodingName + */ + function packageData(bytes, type, mimeType, encodingName) { + switch (type) { + case "DataURL": { + let dataURL = "data:"; + const parsed = parseMIMEType(mimeType || "application/octet-stream"); + if (parsed !== "failure") dataURL += serializeAMimeType(parsed); + dataURL += ";base64,"; + const decoder = new StringDecoder$1("latin1"); + for (const chunk of bytes) dataURL += btoa$1(decoder.write(chunk)); + dataURL += btoa$1(decoder.end()); + return dataURL; + } + case "Text": { + let encoding = "failure"; + if (encodingName) encoding = getEncoding(encodingName); + if (encoding === "failure" && mimeType) { + const type = parseMIMEType(mimeType); + if (type !== "failure") encoding = getEncoding(type.parameters.get("charset")); + } + if (encoding === "failure") encoding = "UTF-8"; + return decode(bytes, encoding); + } + case "ArrayBuffer": return combineByteSequences(bytes).buffer; + case "BinaryString": { + let binaryString = ""; + const decoder = new StringDecoder$1("latin1"); + for (const chunk of bytes) binaryString += decoder.write(chunk); + binaryString += decoder.end(); + return binaryString; + } + } + } + /** + * @see https://encoding.spec.whatwg.org/#decode + * @param {Uint8Array[]} ioQueue + * @param {string} encoding + */ + function decode(ioQueue, encoding) { + const bytes = combineByteSequences(ioQueue); + const BOMEncoding = BOMSniffing(bytes); + let slice = 0; + if (BOMEncoding !== null) { + encoding = BOMEncoding; + slice = BOMEncoding === "UTF-8" ? 3 : 2; + } + const sliced = bytes.slice(slice); + return new TextDecoder(encoding).decode(sliced); + } + /** + * @see https://encoding.spec.whatwg.org/#bom-sniff + * @param {Uint8Array} ioQueue + */ + 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; + } + /** + * @param {Uint8Array[]} sequences + */ + 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)); + } + module.exports = { + staticPropertyDescriptors, + readOperation, + fireAProgressEvent + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/fileapi/filereader.js +var require_filereader = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { staticPropertyDescriptors, readOperation, fireAProgressEvent } = require_util$4(); + const { kState, kError, kResult, kEvents, kAborted } = require_symbols$2(); + const { webidl } = require_webidl(); + const { kEnumerableProperty } = require_util$7(); + var FileReader = class FileReader extends EventTarget { + constructor() { + super(); + this[kState] = "empty"; + this[kResult] = null; + this[kError] = 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, "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, "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, encoding = void 0) { + webidl.brandCheck(this, FileReader); + webidl.argumentLengthCheck(arguments, 1, "FileReader.readAsText"); + blob = webidl.converters.Blob(blob, { strict: false }); + if (encoding !== void 0) encoding = webidl.converters.DOMString(encoding, "FileReader.readAsText", "encoding"); + readOperation(this, blob, "Text", encoding); + } + /** + * @see https://w3c.github.io/FileAPI/#dfn-readAsDataURL + * @param {import('buffer').Blob} blob + */ + readAsDataURL(blob) { + webidl.brandCheck(this, FileReader); + webidl.argumentLengthCheck(arguments, 1, "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[kError]; + } + 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: kEnumerableProperty, + readAsBinaryString: kEnumerableProperty, + readAsText: kEnumerableProperty, + readAsDataURL: kEnumerableProperty, + abort: kEnumerableProperty, + readyState: kEnumerableProperty, + result: kEnumerableProperty, + error: kEnumerableProperty, + onloadstart: kEnumerableProperty, + onprogress: kEnumerableProperty, + onload: kEnumerableProperty, + onabort: kEnumerableProperty, + onerror: kEnumerableProperty, + onloadend: kEnumerableProperty, + [Symbol.toStringTag]: { + value: "FileReader", + writable: false, + enumerable: false, + configurable: true + } + }); + Object.defineProperties(FileReader, { + EMPTY: staticPropertyDescriptors, + LOADING: staticPropertyDescriptors, + DONE: staticPropertyDescriptors + }); + module.exports = { FileReader }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/cache/symbols.js +var require_symbols$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + module.exports = { kConstruct: require_symbols$4().kConstruct }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/cache/util.js +var require_util$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const assert$3 = __require("node:assert"); + const { URLSerializer } = require_data_url(); + const { isValidHeaderName } = require_util$6(); + /** + * @see https://url.spec.whatwg.org/#concept-url-equals + * @param {URL} A + * @param {URL} B + * @param {boolean | undefined} excludeFragment + * @returns {boolean} + */ + function urlEquals(A, B, excludeFragment = false) { + return URLSerializer(A, excludeFragment) === URLSerializer(B, excludeFragment); + } + /** + * @see https://github.com/chromium/chromium/blob/694d20d134cb553d8d89e5500b9148012b1ba299/content/browser/cache_storage/cache_storage_cache.cc#L260-L262 + * @param {string} header + */ + function getFieldValues(header) { + assert$3(header !== null); + const values = []; + for (let value of header.split(",")) { + value = value.trim(); + if (isValidHeaderName(value)) values.push(value); + } + return values; + } + module.exports = { + urlEquals, + getFieldValues + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/cache/cache.js +var require_cache = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { kConstruct } = require_symbols$1(); + const { urlEquals, getFieldValues } = require_util$3(); + const { kEnumerableProperty, isDisturbed } = require_util$7(); + const { webidl } = require_webidl(); + const { Response, cloneResponse, fromInnerResponse } = require_response(); + const { Request, fromInnerRequest } = require_request(); + const { kState } = require_symbols$3(); + const { fetching } = require_fetch(); + const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = require_util$6(); + const assert$2 = __require("node:assert"); + /** + * @see https://w3c.github.io/ServiceWorker/#dfn-cache-batch-operation + * @typedef {Object} CacheBatchOperation + * @property {'delete' | 'put'} type + * @property {any} request + * @property {any} response + * @property {import('../../types/cache').CacheQueryOptions} options + */ + /** + * @see https://w3c.github.io/ServiceWorker/#dfn-request-response-list + * @typedef {[any, any][]} requestResponseList + */ + var Cache = class Cache { + /** + * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list + * @type {requestResponseList} + */ + #relevantRequestResponseList; + constructor() { + if (arguments[0] !== kConstruct) webidl.illegalConstructor(); + webidl.util.markAsUncloneable(this); + this.#relevantRequestResponseList = arguments[1]; + } + async match(request, options = {}) { + webidl.brandCheck(this, Cache); + const prefix = "Cache.match"; + webidl.argumentLengthCheck(arguments, 1, prefix); + request = webidl.converters.RequestInfo(request, prefix, "request"); + options = webidl.converters.CacheQueryOptions(options, prefix, "options"); + const p = this.#internalMatchAll(request, options, 1); + if (p.length === 0) return; + return p[0]; + } + async matchAll(request = void 0, options = {}) { + webidl.brandCheck(this, Cache); + const prefix = "Cache.matchAll"; + if (request !== void 0) request = webidl.converters.RequestInfo(request, prefix, "request"); + options = webidl.converters.CacheQueryOptions(options, prefix, "options"); + return this.#internalMatchAll(request, options); + } + async add(request) { + webidl.brandCheck(this, Cache); + const prefix = "Cache.add"; + webidl.argumentLengthCheck(arguments, 1, prefix); + request = webidl.converters.RequestInfo(request, prefix, "request"); + const requests = [request]; + return await this.addAll(requests); + } + async addAll(requests) { + webidl.brandCheck(this, Cache); + const prefix = "Cache.addAll"; + webidl.argumentLengthCheck(arguments, 1, prefix); + const responsePromises = []; + const requestList = []; + for (let request of requests) { + if (request === void 0) throw webidl.errors.conversionFailed({ + prefix, + argument: "Argument 1", + types: ["undefined is not allowed"] + }); + request = webidl.converters.RequestInfo(request); + if (typeof request === "string") continue; + const r = request[kState]; + if (!urlIsHttpHttpsScheme(r.url) || r.method !== "GET") throw webidl.errors.exception({ + header: prefix, + message: "Expected http/s scheme when method is not GET." + }); + } + /** @type {ReturnType[]} */ + const fetchControllers = []; + for (const request of requests) { + const r = new Request(request)[kState]; + if (!urlIsHttpHttpsScheme(r.url)) throw webidl.errors.exception({ + header: prefix, + message: "Expected http/s scheme." + }); + r.initiator = "fetch"; + r.destination = "subresource"; + requestList.push(r); + const responsePromise = createDeferredPromise(); + fetchControllers.push(fetching({ + request: r, + processResponse(response) { + if (response.type === "error" || response.status === 206 || response.status < 200 || response.status > 299) responsePromise.reject(webidl.errors.exception({ + header: "Cache.addAll", + message: "Received an invalid status code or the request failed." + })); + else if (response.headersList.contains("vary")) { + const fieldValues = getFieldValues(response.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(response) { + if (response.aborted) { + responsePromise.reject(new DOMException("aborted", "AbortError")); + return; + } + responsePromise.resolve(response); + } + })); + responsePromises.push(responsePromise.promise); + } + const responses = await Promise.all(responsePromises); + const operations = []; + let index = 0; + for (const response of responses) { + /** @type {CacheBatchOperation} */ + const operation = { + type: "put", + request: requestList[index], + response + }; + operations.push(operation); + index++; + } + const cacheJobPromise = createDeferredPromise(); + let errorData = null; + try { + this.#batchCacheOperations(operations); + } catch (e) { + errorData = e; + } + queueMicrotask(() => { + if (errorData === null) cacheJobPromise.resolve(void 0); + else cacheJobPromise.reject(errorData); + }); + return cacheJobPromise.promise; + } + async put(request, response) { + webidl.brandCheck(this, Cache); + const prefix = "Cache.put"; + webidl.argumentLengthCheck(arguments, 2, prefix); + request = webidl.converters.RequestInfo(request, prefix, "request"); + response = webidl.converters.Response(response, prefix, "response"); + let innerRequest = null; + if (request instanceof Request) innerRequest = request[kState]; + else innerRequest = new Request(request)[kState]; + if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== "GET") throw webidl.errors.exception({ + header: prefix, + message: "Expected an http/s scheme when method is not GET" + }); + const innerResponse = response[kState]; + if (innerResponse.status === 206) throw webidl.errors.exception({ + header: prefix, + 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: prefix, + message: "Got * vary field value" + }); + } + if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) throw webidl.errors.exception({ + header: prefix, + message: "Response body is locked or disturbed" + }); + const clonedResponse = cloneResponse(innerResponse); + const bodyReadPromise = createDeferredPromise(); + if (innerResponse.body != null) readAllBytes(innerResponse.body.stream.getReader()).then(bodyReadPromise.resolve, bodyReadPromise.reject); + else bodyReadPromise.resolve(void 0); + /** @type {CacheBatchOperation[]} */ + const operations = []; + /** @type {CacheBatchOperation} */ + const operation = { + type: "put", + request: innerRequest, + response: clonedResponse + }; + operations.push(operation); + const bytes = await bodyReadPromise.promise; + if (clonedResponse.body != null) clonedResponse.body.source = bytes; + const cacheJobPromise = createDeferredPromise(); + let errorData = null; + try { + this.#batchCacheOperations(operations); + } catch (e) { + errorData = e; + } + queueMicrotask(() => { + if (errorData === null) cacheJobPromise.resolve(); + else cacheJobPromise.reject(errorData); + }); + return cacheJobPromise.promise; + } + async delete(request, options = {}) { + webidl.brandCheck(this, Cache); + const prefix = "Cache.delete"; + webidl.argumentLengthCheck(arguments, 1, prefix); + request = webidl.converters.RequestInfo(request, prefix, "request"); + options = webidl.converters.CacheQueryOptions(options, prefix, "options"); + /** + * @type {Request} + */ + let r = null; + if (request instanceof Request) { + r = request[kState]; + if (r.method !== "GET" && !options.ignoreMethod) return false; + } else { + assert$2(typeof request === "string"); + r = new Request(request)[kState]; + } + /** @type {CacheBatchOperation[]} */ + const operations = []; + /** @type {CacheBatchOperation} */ + const operation = { + type: "delete", + request: r, + options + }; + operations.push(operation); + const cacheJobPromise = createDeferredPromise(); + let errorData = null; + let requestResponses; + try { + requestResponses = this.#batchCacheOperations(operations); + } catch (e) { + errorData = e; + } + queueMicrotask(() => { + if (errorData === null) cacheJobPromise.resolve(!!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 {Promise} + */ + async keys(request = void 0, options = {}) { + webidl.brandCheck(this, Cache); + const prefix = "Cache.keys"; + if (request !== void 0) request = webidl.converters.RequestInfo(request, prefix, "request"); + options = webidl.converters.CacheQueryOptions(options, prefix, "options"); + let r = null; + if (request !== void 0) { + if (request instanceof Request) { + r = request[kState]; + if (r.method !== "GET" && !options.ignoreMethod) return []; + } else if (typeof request === "string") r = new Request(request)[kState]; + } + const promise = createDeferredPromise(); + const requests = []; + if (request === void 0) for (const requestResponse of this.#relevantRequestResponseList) requests.push(requestResponse[0]); + else { + const requestResponses = this.#queryCache(r, options); + for (const requestResponse of requestResponses) requests.push(requestResponse[0]); + } + queueMicrotask(() => { + const requestList = []; + for (const request of requests) { + const requestObject = fromInnerRequest(request, new AbortController().signal, "immutable"); + requestList.push(requestObject); + } + promise.resolve(Object.freeze(requestList)); + }); + return promise.promise; + } + /** + * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm + * @param {CacheBatchOperation[]} operations + * @returns {requestResponseList} + */ + #batchCacheOperations(operations) { + const cache = this.#relevantRequestResponseList; + const backupCache = [...cache]; + 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 (this.#queryCache(operation.request, operation.options, addedItems).length) throw new DOMException("???", "InvalidStateError"); + let requestResponses; + if (operation.type === "delete") { + requestResponses = this.#queryCache(operation.request, operation.options); + if (requestResponses.length === 0) return []; + for (const requestResponse of requestResponses) { + const idx = cache.indexOf(requestResponse); + assert$2(idx !== -1); + cache.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 = this.#queryCache(operation.request); + for (const requestResponse of requestResponses) { + const idx = cache.indexOf(requestResponse); + assert$2(idx !== -1); + cache.splice(idx, 1); + } + cache.push([operation.request, operation.response]); + addedItems.push([operation.request, operation.response]); + } + resultList.push([operation.request, operation.response]); + } + return resultList; + } catch (e) { + this.#relevantRequestResponseList.length = 0; + 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(requestQuery, options, targetStorage) { + /** @type {requestResponseList} */ + const resultList = []; + const storage = targetStorage ?? this.#relevantRequestResponseList; + for (const requestResponse of storage) { + const [cachedRequest, cachedResponse] = requestResponse; + if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) 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(requestQuery, request, response = null, options) { + const queryURL = new URL(requestQuery.url); + const cachedURL = new URL(request.url); + if (options?.ignoreSearch) { + cachedURL.search = ""; + queryURL.search = ""; + } + if (!urlEquals(queryURL, cachedURL, true)) return false; + if (response == null || options?.ignoreVary || !response.headersList.contains("vary")) return true; + const fieldValues = getFieldValues(response.headersList.get("vary")); + for (const fieldValue of fieldValues) { + if (fieldValue === "*") return false; + if (request.headersList.get(fieldValue) !== requestQuery.headersList.get(fieldValue)) return false; + } + return true; + } + #internalMatchAll(request, options, maxResponses = Infinity) { + let r = null; + if (request !== void 0) { + if (request instanceof Request) { + r = request[kState]; + if (r.method !== "GET" && !options.ignoreMethod) return []; + } else if (typeof request === "string") r = new Request(request)[kState]; + } + const responses = []; + if (request === void 0) for (const requestResponse of this.#relevantRequestResponseList) responses.push(requestResponse[1]); + else { + const requestResponses = this.#queryCache(r, options); + for (const requestResponse of requestResponses) responses.push(requestResponse[1]); + } + const responseList = []; + for (const response of responses) { + const responseObject = fromInnerResponse(response, "immutable"); + responseList.push(responseObject.clone()); + if (responseList.length >= maxResponses) break; + } + return Object.freeze(responseList); + } + }; + Object.defineProperties(Cache.prototype, { + [Symbol.toStringTag]: { + value: "Cache", + configurable: true + }, + match: kEnumerableProperty, + matchAll: kEnumerableProperty, + add: kEnumerableProperty, + addAll: kEnumerableProperty, + put: kEnumerableProperty, + delete: kEnumerableProperty, + keys: kEnumerableProperty + }); + 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); + module.exports = { Cache }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/cache/cachestorage.js +var require_cachestorage = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { kConstruct } = require_symbols$1(); + const { Cache } = require_cache(); + const { webidl } = require_webidl(); + const { kEnumerableProperty } = require_util$7(); + var CacheStorage = class CacheStorage { + /** + * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map + * @type {Map} + */ + async has(cacheName) { + webidl.brandCheck(this, CacheStorage); + const prefix = "CacheStorage.has"; + webidl.argumentLengthCheck(arguments, 1, prefix); + cacheName = webidl.converters.DOMString(cacheName, prefix, "cacheName"); + return 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); + const prefix = "CacheStorage.open"; + webidl.argumentLengthCheck(arguments, 1, prefix); + cacheName = webidl.converters.DOMString(cacheName, prefix, "cacheName"); + if (this.#caches.has(cacheName)) return new Cache(kConstruct, this.#caches.get(cacheName)); + const cache = []; + this.#caches.set(cacheName, cache); + return new Cache(kConstruct, cache); + } + /** + * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete + * @param {string} cacheName + * @returns {Promise} + */ + async delete(cacheName) { + webidl.brandCheck(this, CacheStorage); + const prefix = "CacheStorage.delete"; + webidl.argumentLengthCheck(arguments, 1, prefix); + cacheName = webidl.converters.DOMString(cacheName, prefix, "cacheName"); + return this.#caches.delete(cacheName); + } + /** + * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys + * @returns {Promise} + */ + async keys() { + webidl.brandCheck(this, CacheStorage); + return [...this.#caches.keys()]; + } + }; + Object.defineProperties(CacheStorage.prototype, { + [Symbol.toStringTag]: { + value: "CacheStorage", + configurable: true + }, + match: kEnumerableProperty, + has: kEnumerableProperty, + open: kEnumerableProperty, + delete: kEnumerableProperty, + keys: kEnumerableProperty + }); + module.exports = { CacheStorage }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/cookies/constants.js +var require_constants$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + module.exports = { + maxAttributeValueSize: 1024, + maxNameValuePairSize: 4096 + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/cookies/util.js +var require_util$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + /** + * @param {string} value + * @returns {boolean} + */ + function isCTLExcludingHtab(value) { + for (let i = 0; i < value.length; ++i) { + const code = value.charCodeAt(i); + if (code >= 0 && code <= 8 || code >= 10 && code <= 31 || code === 127) return true; + } + return false; + } + /** + CHAR = + token = 1* + separators = "(" | ")" | "<" | ">" | "@" + | "," | ";" | ":" | "\" | <"> + | "/" | "[" | "]" | "?" | "=" + | "{" | "}" | SP | HT + * @param {string} name + */ + function validateCookieName(name) { + for (let i = 0; i < name.length; ++i) { + const code = name.charCodeAt(i); + if (code < 33 || code > 126 || code === 34 || code === 40 || code === 41 || code === 60 || code === 62 || code === 64 || code === 44 || code === 59 || code === 58 || code === 92 || code === 47 || code === 91 || code === 93 || code === 63 || code === 61 || code === 123 || code === 125) throw new Error("Invalid cookie name"); + } + } + /** + cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE ) + cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E + ; US-ASCII characters excluding CTLs, + ; whitespace DQUOTE, comma, semicolon, + ; and backslash + * @param {string} value + */ + function validateCookieValue(value) { + let len = value.length; + let i = 0; + if (value[0] === "\"") { + if (len === 1 || value[len - 1] !== "\"") throw new Error("Invalid cookie value"); + --len; + ++i; + } + while (i < len) { + const code = value.charCodeAt(i++); + if (code < 33 || code > 126 || code === 34 || code === 44 || code === 59 || code === 92) throw new Error("Invalid cookie value"); + } + } + /** + * path-value = + * @param {string} path + */ + function validateCookiePath(path) { + for (let i = 0; i < path.length; ++i) { + const code = path.charCodeAt(i); + if (code < 32 || code === 127 || code === 59) throw new Error("Invalid cookie path"); + } + } + /** + * I have no idea why these values aren't allowed to be honest, + * but Deno tests these. - Khafra + * @param {string} domain + */ + function validateCookieDomain(domain) { + if (domain.startsWith("-") || domain.endsWith(".") || domain.endsWith("-")) throw new Error("Invalid cookie domain"); + } + const IMFDays = [ + "Sun", + "Mon", + "Tue", + "Wed", + "Thu", + "Fri", + "Sat" + ]; + const IMFMonths = [ + "Jan", + "Feb", + "Mar", + "Apr", + "May", + "Jun", + "Jul", + "Aug", + "Sep", + "Oct", + "Nov", + "Dec" + ]; + const IMFPaddedNumbers = Array(61).fill(0).map((_, i) => i.toString().padStart(2, "0")); + /** + * @see https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1 + * @param {number|Date} date + IMF-fixdate = day-name "," SP date1 SP time-of-day SP GMT + ; fixed length/zone/capitalization subset of the format + ; see Section 3.3 of [RFC5322] + + day-name = %x4D.6F.6E ; "Mon", case-sensitive + / %x54.75.65 ; "Tue", case-sensitive + / %x57.65.64 ; "Wed", case-sensitive + / %x54.68.75 ; "Thu", case-sensitive + / %x46.72.69 ; "Fri", case-sensitive + / %x53.61.74 ; "Sat", case-sensitive + / %x53.75.6E ; "Sun", case-sensitive + date1 = day SP month SP year + ; e.g., 02 Jun 1982 + + day = 2DIGIT + month = %x4A.61.6E ; "Jan", case-sensitive + / %x46.65.62 ; "Feb", case-sensitive + / %x4D.61.72 ; "Mar", case-sensitive + / %x41.70.72 ; "Apr", case-sensitive + / %x4D.61.79 ; "May", case-sensitive + / %x4A.75.6E ; "Jun", case-sensitive + / %x4A.75.6C ; "Jul", case-sensitive + / %x41.75.67 ; "Aug", case-sensitive + / %x53.65.70 ; "Sep", case-sensitive + / %x4F.63.74 ; "Oct", case-sensitive + / %x4E.6F.76 ; "Nov", case-sensitive + / %x44.65.63 ; "Dec", case-sensitive + year = 4DIGIT + + GMT = %x47.4D.54 ; "GMT", case-sensitive + + time-of-day = hour ":" minute ":" second + ; 00:00:00 - 23:59:60 (leap second) + + hour = 2DIGIT + minute = 2DIGIT + second = 2DIGIT + */ + function toIMFDate(date) { + if (typeof date === "number") date = new Date(date); + return `${IMFDays[date.getUTCDay()]}, ${IMFPaddedNumbers[date.getUTCDate()]} ${IMFMonths[date.getUTCMonth()]} ${date.getUTCFullYear()} ${IMFPaddedNumbers[date.getUTCHours()]}:${IMFPaddedNumbers[date.getUTCMinutes()]}:${IMFPaddedNumbers[date.getUTCSeconds()]} GMT`; + } + /** + max-age-av = "Max-Age=" non-zero-digit *DIGIT + ; In practice, both expires-av and max-age-av + ; are limited to dates representable by the + ; user agent. + * @param {number} maxAge + */ + function validateCookieMaxAge(maxAge) { + if (maxAge < 0) throw new Error("Invalid cookie max-age"); + } + /** + * @see https://www.rfc-editor.org/rfc/rfc6265#section-4.1.1 + * @param {import('./index').Cookie} cookie + */ + function stringify(cookie) { + if (cookie.name.length === 0) return null; + validateCookieName(cookie.name); + validateCookieValue(cookie.value); + const out = [`${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) out.push("Secure"); + if (cookie.httpOnly) out.push("HttpOnly"); + if (typeof cookie.maxAge === "number") { + validateCookieMaxAge(cookie.maxAge); + out.push(`Max-Age=${cookie.maxAge}`); + } + if (cookie.domain) { + validateCookieDomain(cookie.domain); + out.push(`Domain=${cookie.domain}`); + } + if (cookie.path) { + validateCookiePath(cookie.path); + out.push(`Path=${cookie.path}`); + } + if (cookie.expires && cookie.expires.toString() !== "Invalid Date") out.push(`Expires=${toIMFDate(cookie.expires)}`); + if (cookie.sameSite) out.push(`SameSite=${cookie.sameSite}`); + for (const part of cookie.unparsed) { + if (!part.includes("=")) throw new Error("Invalid unparsed"); + const [key, ...value] = part.split("="); + out.push(`${key.trim()}=${value.join("=")}`); + } + return out.join("; "); + } + module.exports = { + isCTLExcludingHtab, + validateCookieName, + validateCookiePath, + validateCookieValue, + toIMFDate, + stringify + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/cookies/parse.js +var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { maxNameValuePairSize, maxAttributeValueSize } = require_constants$1(); + const { isCTLExcludingHtab } = require_util$2(); + const { collectASequenceOfCodePointsFast } = require_data_url(); + const assert$1 = __require("node:assert"); + /** + * @description Parses the field-value attributes of a set-cookie header string. + * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4 + * @param {string} header + * @returns if the header is invalid, null will be returned + */ + function parseSetCookie(header) { + if (isCTLExcludingHtab(header)) return null; + let nameValuePair = ""; + let unparsedAttributes = ""; + let name = ""; + let value = ""; + if (header.includes(";")) { + const position = { position: 0 }; + nameValuePair = collectASequenceOfCodePointsFast(";", header, position); + unparsedAttributes = header.slice(position.position); + } else nameValuePair = header; + 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) + }; + } + /** + * Parses the remaining attributes of a set-cookie header + * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4 + * @param {string} unparsedAttributes + * @param {[Object.]={}} cookieAttributeList + */ + function parseUnparsedAttributes(unparsedAttributes, cookieAttributeList = {}) { + if (unparsedAttributes.length === 0) return cookieAttributeList; + assert$1(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") cookieAttributeList.expires = new Date(attributeValue); + 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); + cookieAttributeList.maxAge = Number(attributeValue); + } 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.push(`${attributeName}=${attributeValue}`); + } + return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList); + } + module.exports = { + parseSetCookie, + parseUnparsedAttributes + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/cookies/index.js +var require_cookies = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { parseSetCookie } = require_parse(); + const { stringify } = require_util$2(); + const { webidl } = require_webidl(); + const { Headers } = require_headers(); + /** + * @typedef {Object} Cookie + * @property {string} name + * @property {string} value + * @property {Date|number|undefined} expires + * @property {number|undefined} maxAge + * @property {string|undefined} domain + * @property {string|undefined} path + * @property {boolean|undefined} secure + * @property {boolean|undefined} httpOnly + * @property {'Strict'|'Lax'|'None'} sameSite + * @property {string[]} unparsed + */ + /** + * @param {Headers} headers + * @returns {Record} + */ + function getCookies(headers) { + webidl.argumentLengthCheck(arguments, 1, "getCookies"); + webidl.brandCheck(headers, Headers, { strict: false }); + const cookie = headers.get("cookie"); + const out = {}; + if (!cookie) return out; + for (const piece of cookie.split(";")) { + const [name, ...value] = piece.split("="); + out[name.trim()] = value.join("="); + } + return out; + } + /** + * @param {Headers} headers + * @param {string} name + * @param {{ path?: string, domain?: string }|undefined} attributes + * @returns {void} + */ + function deleteCookie(headers, name, attributes) { + webidl.brandCheck(headers, Headers, { strict: false }); + const prefix = "deleteCookie"; + webidl.argumentLengthCheck(arguments, 2, prefix); + name = webidl.converters.DOMString(name, prefix, "name"); + attributes = webidl.converters.DeleteCookieAttributes(attributes); + setCookie(headers, { + name, + value: "", + expires: /* @__PURE__ */ new Date(0), + ...attributes + }); + } + /** + * @param {Headers} headers + * @returns {Cookie[]} + */ + function getSetCookies(headers) { + webidl.argumentLengthCheck(arguments, 1, "getSetCookies"); + webidl.brandCheck(headers, Headers, { strict: false }); + const cookies = headers.getSetCookie(); + if (!cookies) return []; + return cookies.map((pair) => parseSetCookie(pair)); + } + /** + * @param {Headers} headers + * @param {Cookie} cookie + * @returns {void} + */ + function setCookie(headers, cookie) { + webidl.argumentLengthCheck(arguments, 2, "setCookie"); + webidl.brandCheck(headers, Headers, { strict: false }); + cookie = webidl.converters.Cookie(cookie); + const str = stringify(cookie); + if (str) headers.append("Set-Cookie", str); + } + 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: () => new Array(0) + } + ]); + module.exports = { + getCookies, + deleteCookie, + getSetCookies, + setCookie + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/websocket/events.js +var require_events = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { webidl } = require_webidl(); + const { kEnumerableProperty } = require_util$7(); + const { kConstruct } = require_symbols$4(); + const { MessagePort } = __require("node:worker_threads"); + /** + * @see https://html.spec.whatwg.org/multipage/comms.html#messageevent + */ + var MessageEvent = class MessageEvent extends Event { + #eventInit; + constructor(type, eventInitDict = {}) { + if (type === kConstruct) { + super(arguments[1], arguments[2]); + webidl.util.markAsUncloneable(this); + return; + } + const prefix = "MessageEvent constructor"; + webidl.argumentLengthCheck(arguments, 1, prefix); + type = webidl.converters.DOMString(type, prefix, "type"); + eventInitDict = webidl.converters.MessageEventInit(eventInitDict, prefix, "eventInitDict"); + super(type, eventInitDict); + this.#eventInit = eventInitDict; + webidl.util.markAsUncloneable(this); + } + get data() { + webidl.brandCheck(this, MessageEvent); + return this.#eventInit.data; + } + get origin() { + webidl.brandCheck(this, MessageEvent); + return this.#eventInit.origin; + } + get lastEventId() { + webidl.brandCheck(this, MessageEvent); + return this.#eventInit.lastEventId; + } + get source() { + webidl.brandCheck(this, MessageEvent); + return this.#eventInit.source; + } + get ports() { + webidl.brandCheck(this, MessageEvent); + if (!Object.isFrozen(this.#eventInit.ports)) Object.freeze(this.#eventInit.ports); + return this.#eventInit.ports; + } + initMessageEvent(type, bubbles = false, cancelable = false, data = null, origin = "", lastEventId = "", source = null, ports = []) { + webidl.brandCheck(this, MessageEvent); + webidl.argumentLengthCheck(arguments, 1, "MessageEvent.initMessageEvent"); + return new MessageEvent(type, { + bubbles, + cancelable, + data, + origin, + lastEventId, + source, + ports + }); + } + static createFastMessageEvent(type, init) { + const messageEvent = new MessageEvent(kConstruct, type, init); + messageEvent.#eventInit = init; + messageEvent.#eventInit.data ??= null; + messageEvent.#eventInit.origin ??= ""; + messageEvent.#eventInit.lastEventId ??= ""; + messageEvent.#eventInit.source ??= null; + messageEvent.#eventInit.ports ??= []; + return messageEvent; + } + }; + const { createFastMessageEvent } = MessageEvent; + delete MessageEvent.createFastMessageEvent; + /** + * @see https://websockets.spec.whatwg.org/#the-closeevent-interface + */ + var CloseEvent = class CloseEvent extends Event { + #eventInit; + constructor(type, eventInitDict = {}) { + const prefix = "CloseEvent constructor"; + webidl.argumentLengthCheck(arguments, 1, prefix); + type = webidl.converters.DOMString(type, prefix, "type"); + eventInitDict = webidl.converters.CloseEventInit(eventInitDict); + super(type, eventInitDict); + this.#eventInit = eventInitDict; + webidl.util.markAsUncloneable(this); + } + get wasClean() { + webidl.brandCheck(this, CloseEvent); + return this.#eventInit.wasClean; + } + get code() { + webidl.brandCheck(this, CloseEvent); + return this.#eventInit.code; + } + get reason() { + webidl.brandCheck(this, CloseEvent); + return this.#eventInit.reason; + } + }; + var ErrorEvent = class ErrorEvent extends Event { + #eventInit; + constructor(type, eventInitDict) { + const prefix = "ErrorEvent constructor"; + webidl.argumentLengthCheck(arguments, 1, prefix); + super(type, eventInitDict); + webidl.util.markAsUncloneable(this); + type = webidl.converters.DOMString(type, prefix, "type"); + eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {}); + this.#eventInit = eventInitDict; + } + get message() { + webidl.brandCheck(this, ErrorEvent); + return this.#eventInit.message; + } + get filename() { + webidl.brandCheck(this, ErrorEvent); + return this.#eventInit.filename; + } + get lineno() { + webidl.brandCheck(this, ErrorEvent); + return this.#eventInit.lineno; + } + get colno() { + webidl.brandCheck(this, ErrorEvent); + return this.#eventInit.colno; + } + get error() { + webidl.brandCheck(this, ErrorEvent); + return this.#eventInit.error; + } + }; + Object.defineProperties(MessageEvent.prototype, { + [Symbol.toStringTag]: { + value: "MessageEvent", + configurable: true + }, + data: kEnumerableProperty, + origin: kEnumerableProperty, + lastEventId: kEnumerableProperty, + source: kEnumerableProperty, + ports: kEnumerableProperty, + initMessageEvent: kEnumerableProperty + }); + Object.defineProperties(CloseEvent.prototype, { + [Symbol.toStringTag]: { + value: "CloseEvent", + configurable: true + }, + reason: kEnumerableProperty, + code: kEnumerableProperty, + wasClean: kEnumerableProperty + }); + Object.defineProperties(ErrorEvent.prototype, { + [Symbol.toStringTag]: { + value: "ErrorEvent", + configurable: true + }, + message: kEnumerableProperty, + filename: kEnumerableProperty, + lineno: kEnumerableProperty, + colno: kEnumerableProperty, + error: kEnumerableProperty + }); + 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", + converter: webidl.nullableConverter(webidl.converters.MessagePort), + defaultValue: () => null + }, + { + key: "ports", + converter: webidl.converters["sequence"], + defaultValue: () => new Array(0) + } + ]); + 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 + } + ]); + module.exports = { + MessageEvent, + CloseEvent, + ErrorEvent, + createFastMessageEvent + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/websocket/constants.js +var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => { + module.exports = { + uid: "258EAFA5-E914-47DA-95CA-C5AB0DC85B11", + sentCloseFrameState: { + NOT_SENT: 0, + PROCESSING: 1, + SENT: 2 + }, + staticPropertyDescriptors: { + enumerable: true, + writable: false, + configurable: false + }, + states: { + CONNECTING: 0, + OPEN: 1, + CLOSING: 2, + CLOSED: 3 + }, + opcodes: { + CONTINUATION: 0, + TEXT: 1, + BINARY: 2, + CLOSE: 8, + PING: 9, + PONG: 10 + }, + maxUnsigned16Bit: 2 ** 16 - 1, + parserStates: { + INFO: 0, + PAYLOADLENGTH_16: 2, + PAYLOADLENGTH_64: 3, + READ_DATA: 4 + }, + emptyBuffer: Buffer.allocUnsafe(0), + sendHints: { + string: 1, + typedArray: 2, + arrayBuffer: 3, + blob: 4 + } + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/websocket/symbols.js +var require_symbols = /* @__PURE__ */ __commonJSMin(((exports, module) => { + module.exports = { + kWebSocketURL: Symbol("url"), + kReadyState: Symbol("ready state"), + kController: Symbol("controller"), + kResponse: Symbol("response"), + kBinaryType: Symbol("binary type"), + kSentClose: Symbol("sent close"), + kReceivedClose: Symbol("received close"), + kByteParser: Symbol("byte parser") + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/websocket/util.js +var require_util$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = require_symbols(); + const { states, opcodes } = require_constants(); + const { ErrorEvent, createFastMessageEvent } = require_events(); + const { isUtf8 } = __require("node:buffer"); + const { collectASequenceOfCodePointsFast, removeHTTPWhitespace } = require_data_url(); + /** + * @param {import('./websocket').WebSocket} ws + * @returns {boolean} + */ + function isConnecting(ws) { + return ws[kReadyState] === states.CONNECTING; + } + /** + * @param {import('./websocket').WebSocket} ws + * @returns {boolean} + */ + function isEstablished(ws) { + return ws[kReadyState] === states.OPEN; + } + /** + * @param {import('./websocket').WebSocket} ws + * @returns {boolean} + */ + function isClosing(ws) { + return ws[kReadyState] === states.CLOSING; + } + /** + * @param {import('./websocket').WebSocket} ws + * @returns {boolean} + */ + function isClosed(ws) { + return ws[kReadyState] === states.CLOSED; + } + /** + * @see https://dom.spec.whatwg.org/#concept-event-fire + * @param {string} e + * @param {EventTarget} target + * @param {(...args: ConstructorParameters) => Event} eventFactory + * @param {EventInit | undefined} eventInitDict + */ + function fireEvent(e, target, eventFactory = (type, init) => new Event(type, init), eventInitDict = {}) { + const event = eventFactory(e, eventInitDict); + target.dispatchEvent(event); + } + /** + * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol + * @param {import('./websocket').WebSocket} ws + * @param {number} type Opcode + * @param {Buffer} data application data + */ + function websocketMessageReceived(ws, type, data) { + if (ws[kReadyState] !== states.OPEN) return; + let dataForEvent; + if (type === opcodes.TEXT) try { + dataForEvent = utf8Decode(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 = toArrayBuffer(data); + fireEvent("message", ws, createFastMessageEvent, { + origin: ws[kWebSocketURL].origin, + data: dataForEvent + }); + } + function toArrayBuffer(buffer) { + if (buffer.byteLength === buffer.buffer.byteLength) return buffer.buffer; + return buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength); + } + /** + * @see https://datatracker.ietf.org/doc/html/rfc6455 + * @see https://datatracker.ietf.org/doc/html/rfc2616 + * @see https://bugs.chromium.org/p/chromium/issues/detail?id=398407 + * @param {string} protocol + */ + function isValidSubprotocol(protocol) { + if (protocol.length === 0) return false; + for (let i = 0; i < protocol.length; ++i) { + const code = protocol.charCodeAt(i); + if (code < 33 || code > 126 || code === 34 || code === 40 || code === 41 || code === 44 || code === 47 || code === 58 || code === 59 || code === 60 || code === 61 || code === 62 || code === 63 || code === 64 || code === 91 || code === 92 || code === 93 || code === 123 || code === 125) return false; + } + return true; + } + /** + * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7-4 + * @param {number} code + */ + function isValidStatusCode(code) { + if (code >= 1e3 && code < 1015) return code !== 1004 && code !== 1005 && code !== 1006; + return code >= 3e3 && code <= 4999; + } + /** + * @param {import('./websocket').WebSocket} ws + * @param {string|undefined} reason + */ + function failWebsocketConnection(ws, reason) { + const { [kController]: controller, [kResponse]: response } = ws; + controller.abort(); + if (response?.socket && !response.socket.destroyed) response.socket.destroy(); + if (reason) fireEvent("error", ws, (type, init) => new ErrorEvent(type, init), { + error: new Error(reason), + message: reason + }); + } + /** + * @see https://datatracker.ietf.org/doc/html/rfc6455#section-5.5 + * @param {number} opcode + */ + function isControlFrame(opcode) { + return opcode === opcodes.CLOSE || opcode === opcodes.PING || opcode === opcodes.PONG; + } + function isContinuationFrame(opcode) { + return opcode === opcodes.CONTINUATION; + } + function isTextBinaryFrame(opcode) { + return opcode === opcodes.TEXT || opcode === opcodes.BINARY; + } + function isValidOpcode(opcode) { + return isTextBinaryFrame(opcode) || isContinuationFrame(opcode) || isControlFrame(opcode); + } + /** + * Parses a Sec-WebSocket-Extensions header value. + * @param {string} extensions + * @returns {Map} + */ + function parseExtensions(extensions) { + const position = { position: 0 }; + const extensionList = /* @__PURE__ */ new Map(); + while (position.position < extensions.length) { + const [name, value = ""] = collectASequenceOfCodePointsFast(";", extensions, position).split("="); + extensionList.set(removeHTTPWhitespace(name, true, false), removeHTTPWhitespace(value, false, true)); + position.position++; + } + return extensionList; + } + /** + * @see https://www.rfc-editor.org/rfc/rfc7692#section-7.1.2.2 + * @description "client-max-window-bits = 1*DIGIT" + * @param {string} value + */ + function isValidClientWindowBits(value) { + for (let i = 0; i < value.length; i++) { + const byte = value.charCodeAt(i); + if (byte < 48 || byte > 57) return false; + } + return true; + } + const hasIntl = typeof process.versions.icu === "string"; + const fatalDecoder = hasIntl ? new TextDecoder("utf-8", { fatal: true }) : void 0; + /** + * Converts a Buffer to utf-8, even on platforms without icu. + * @param {Buffer} buffer + */ + const utf8Decode = hasIntl ? fatalDecoder.decode.bind(fatalDecoder) : function(buffer) { + if (isUtf8(buffer)) return buffer.toString("utf-8"); + throw new TypeError("Invalid utf-8 received."); + }; + module.exports = { + isConnecting, + isEstablished, + isClosing, + isClosed, + fireEvent, + isValidSubprotocol, + isValidStatusCode, + failWebsocketConnection, + websocketMessageReceived, + utf8Decode, + isControlFrame, + isContinuationFrame, + isTextBinaryFrame, + isValidOpcode, + parseExtensions, + isValidClientWindowBits + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/websocket/frame.js +var require_frame = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { maxUnsigned16Bit } = require_constants(); + const BUFFER_SIZE = 16386; + /** @type {import('crypto')} */ + let crypto; + let buffer = null; + let bufIdx = BUFFER_SIZE; + try { + crypto = __require("node:crypto"); + } catch { + crypto = { randomFillSync: function randomFillSync(buffer, _offset, _size) { + for (let i = 0; i < buffer.length; ++i) buffer[i] = Math.random() * 255 | 0; + return buffer; + } }; + } + function generateMask() { + if (bufIdx === BUFFER_SIZE) { + bufIdx = 0; + crypto.randomFillSync(buffer ??= Buffer.allocUnsafe(BUFFER_SIZE), 0, BUFFER_SIZE); + } + return [ + buffer[bufIdx++], + buffer[bufIdx++], + buffer[bufIdx++], + buffer[bufIdx++] + ]; + } + var WebsocketFrameSend = class { + /** + * @param {Buffer|undefined} data + */ + constructor(data) { + this.frameData = data; + } + createFrame(opcode) { + const frameData = this.frameData; + const maskKey = generateMask(); + const bodyLength = frameData?.byteLength ?? 0; + /** @type {number} */ + let payloadLength = bodyLength; + let offset = 6; + if (bodyLength > maxUnsigned16Bit) { + offset += 8; + payloadLength = 127; + } else if (bodyLength > 125) { + offset += 2; + payloadLength = 126; + } + const buffer = Buffer.allocUnsafe(bodyLength + offset); + buffer[0] = buffer[1] = 0; + buffer[0] |= 128; + buffer[0] = (buffer[0] & 240) + opcode; + /*! ws. MIT License. Einar Otto Stangvik */ + buffer[offset - 4] = maskKey[0]; + buffer[offset - 3] = maskKey[1]; + buffer[offset - 2] = maskKey[2]; + buffer[offset - 1] = maskKey[3]; + buffer[1] = payloadLength; + if (payloadLength === 126) buffer.writeUInt16BE(bodyLength, 2); + else if (payloadLength === 127) { + buffer[2] = buffer[3] = 0; + buffer.writeUIntBE(bodyLength, 4, 6); + } + buffer[1] |= 128; + for (let i = 0; i < bodyLength; ++i) buffer[offset + i] = frameData[i] ^ maskKey[i & 3]; + return buffer; + } + }; + module.exports = { WebsocketFrameSend }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/websocket/connection.js +var require_connection = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { uid, states, sentCloseFrameState, emptyBuffer, opcodes } = require_constants(); + const { kReadyState, kSentClose, kByteParser, kReceivedClose, kResponse } = require_symbols(); + const { fireEvent, failWebsocketConnection, isClosing, isClosed, isEstablished, parseExtensions } = require_util$1(); + const { channels } = require_diagnostics(); + const { CloseEvent } = require_events(); + const { makeRequest } = require_request(); + const { fetching } = require_fetch(); + const { Headers, getHeadersList } = require_headers(); + const { getDecodeSplit } = require_util$6(); + const { WebsocketFrameSend } = require_frame(); + /** @type {import('crypto')} */ + let crypto; + try { + crypto = __require("node:crypto"); + } catch {} + /** + * @see https://websockets.spec.whatwg.org/#concept-websocket-establish + * @param {URL} url + * @param {string|string[]} protocols + * @param {import('./websocket').WebSocket} ws + * @param {(response: any, extensions: string[] | undefined) => void} onEstablish + * @param {Partial} options + */ + function establishWebSocketConnection(url, protocols, client, ws, onEstablish, options) { + const requestURL = url; + requestURL.protocol = url.protocol === "ws:" ? "http:" : "https:"; + const request = makeRequest({ + urlList: [requestURL], + client, + serviceWorkers: "none", + referrer: "no-referrer", + mode: "websocket", + credentials: "include", + cache: "no-store", + redirect: "error" + }); + if (options.headers) request.headersList = getHeadersList(new Headers(options.headers)); + const keyValue = crypto.randomBytes(16).toString("base64"); + request.headersList.append("sec-websocket-key", keyValue); + request.headersList.append("sec-websocket-version", "13"); + for (const protocol of protocols) request.headersList.append("sec-websocket-protocol", protocol); + request.headersList.append("sec-websocket-extensions", "permessage-deflate; client_max_window_bits"); + return fetching({ + request, + useParallelQueue: true, + dispatcher: options.dispatcher, + processResponse(response) { + if (response.type === "error" || response.status !== 101) { + failWebsocketConnection(ws, "Received network error or non-101 status code."); + return; + } + if (protocols.length !== 0 && !response.headersList.get("Sec-WebSocket-Protocol")) { + failWebsocketConnection(ws, "Server did not respond with sent protocols."); + return; + } + if (response.headersList.get("Upgrade")?.toLowerCase() !== "websocket") { + failWebsocketConnection(ws, "Server did not set Upgrade header to \"websocket\"."); + return; + } + if (response.headersList.get("Connection")?.toLowerCase() !== "upgrade") { + failWebsocketConnection(ws, "Server did not set Connection header to \"upgrade\"."); + return; + } + if (response.headersList.get("Sec-WebSocket-Accept") !== crypto.createHash("sha1").update(keyValue + uid).digest("base64")) { + failWebsocketConnection(ws, "Incorrect hash received in Sec-WebSocket-Accept header."); + return; + } + const secExtension = response.headersList.get("Sec-WebSocket-Extensions"); + let extensions; + if (secExtension !== null) { + extensions = parseExtensions(secExtension); + if (!extensions.has("permessage-deflate")) { + failWebsocketConnection(ws, "Sec-WebSocket-Extensions header does not match."); + return; + } + } + const secProtocol = response.headersList.get("Sec-WebSocket-Protocol"); + if (secProtocol !== null) { + if (!getDecodeSplit("sec-websocket-protocol", request.headersList).includes(secProtocol)) { + failWebsocketConnection(ws, "Protocol was not set in the opening handshake."); + return; + } + } + response.socket.on("data", onSocketData); + response.socket.on("close", onSocketClose); + response.socket.on("error", onSocketError); + if (channels.open.hasSubscribers) channels.open.publish({ + address: response.socket.address(), + protocol: secProtocol, + extensions: secExtension + }); + onEstablish(response, extensions); + } + }); + } + function closeWebSocketConnection(ws, code, reason, reasonByteLength) { + if (isClosing(ws) || isClosed(ws)) {} else if (!isEstablished(ws)) { + failWebsocketConnection(ws, "Connection was closed before it was established."); + ws[kReadyState] = states.CLOSING; + } else if (ws[kSentClose] === sentCloseFrameState.NOT_SENT) { + ws[kSentClose] = sentCloseFrameState.PROCESSING; + const frame = new WebsocketFrameSend(); + if (code !== void 0 && reason === void 0) { + frame.frameData = Buffer.allocUnsafe(2); + frame.frameData.writeUInt16BE(code, 0); + } else if (code !== void 0 && reason !== void 0) { + frame.frameData = Buffer.allocUnsafe(2 + reasonByteLength); + frame.frameData.writeUInt16BE(code, 0); + frame.frameData.write(reason, 2, "utf-8"); + } else frame.frameData = emptyBuffer; + ws[kResponse].socket.write(frame.createFrame(opcodes.CLOSE)); + ws[kSentClose] = sentCloseFrameState.SENT; + ws[kReadyState] = states.CLOSING; + } else ws[kReadyState] = states.CLOSING; + } + /** + * @param {Buffer} chunk + */ + function onSocketData(chunk) { + if (!this.ws[kByteParser].write(chunk)) this.pause(); + } + /** + * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol + * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.4 + */ + function onSocketClose() { + const { ws } = this; + const { [kResponse]: response } = ws; + response.socket.off("data", onSocketData); + response.socket.off("close", onSocketClose); + response.socket.off("error", onSocketError); + const wasClean = ws[kSentClose] === sentCloseFrameState.SENT && ws[kReceivedClose]; + let code = 1005; + let reason = ""; + const result = ws[kByteParser].closingInfo; + if (result && !result.error) { + code = result.code ?? 1005; + reason = result.reason; + } else if (!ws[kReceivedClose]) code = 1006; + ws[kReadyState] = states.CLOSED; + fireEvent("close", ws, (type, init) => new CloseEvent(type, init), { + wasClean, + code, + reason + }); + if (channels.close.hasSubscribers) channels.close.publish({ + websocket: ws, + code, + reason + }); + } + function onSocketError(error) { + const { ws } = this; + ws[kReadyState] = states.CLOSING; + if (channels.socketError.hasSubscribers) channels.socketError.publish(error); + this.destroy(); + } + module.exports = { + establishWebSocketConnection, + closeWebSocketConnection + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/websocket/permessage-deflate.js +var require_permessage_deflate = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { createInflateRaw, Z_DEFAULT_WINDOWBITS } = __require("node:zlib"); + const { isValidClientWindowBits } = require_util$1(); + const tail = Buffer.from([ + 0, + 0, + 255, + 255 + ]); + const kBuffer = Symbol("kBuffer"); + const kLength = Symbol("kLength"); + var PerMessageDeflate = class { + /** @type {import('node:zlib').InflateRaw} */ + #inflate; + #options = {}; + constructor(extensions) { + this.#options.serverNoContextTakeover = extensions.has("server_no_context_takeover"); + this.#options.serverMaxWindowBits = extensions.get("server_max_window_bits"); + } + decompress(chunk, fin, callback) { + if (!this.#inflate) { + let windowBits = Z_DEFAULT_WINDOWBITS; + if (this.#options.serverMaxWindowBits) { + if (!isValidClientWindowBits(this.#options.serverMaxWindowBits)) { + callback(/* @__PURE__ */ new Error("Invalid server_max_window_bits")); + return; + } + windowBits = Number.parseInt(this.#options.serverMaxWindowBits); + } + this.#inflate = createInflateRaw({ windowBits }); + this.#inflate[kBuffer] = []; + this.#inflate[kLength] = 0; + this.#inflate.on("data", (data) => { + this.#inflate[kBuffer].push(data); + this.#inflate[kLength] += data.length; + }); + this.#inflate.on("error", (err) => { + this.#inflate = null; + callback(err); + }); + } + this.#inflate.write(chunk); + if (fin) this.#inflate.write(tail); + this.#inflate.flush(() => { + const full = Buffer.concat(this.#inflate[kBuffer], this.#inflate[kLength]); + this.#inflate[kBuffer].length = 0; + this.#inflate[kLength] = 0; + callback(null, full); + }); + } + }; + module.exports = { PerMessageDeflate }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/websocket/receiver.js +var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { Writable } = __require("node:stream"); + const assert = __require("node:assert"); + const { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = require_constants(); + const { kReadyState, kSentClose, kResponse, kReceivedClose } = require_symbols(); + const { channels } = require_diagnostics(); + const { isValidStatusCode, isValidOpcode, failWebsocketConnection, websocketMessageReceived, utf8Decode, isControlFrame, isTextBinaryFrame, isContinuationFrame } = require_util$1(); + const { WebsocketFrameSend } = require_frame(); + const { closeWebSocketConnection } = require_connection(); + const { PerMessageDeflate } = require_permessage_deflate(); + var ByteParser = class extends Writable { + #buffers = []; + #byteOffset = 0; + #loop = false; + #state = parserStates.INFO; + #info = {}; + #fragments = []; + /** @type {Map} */ + #extensions; + constructor(ws, extensions) { + super(); + this.ws = ws; + this.#extensions = extensions == null ? /* @__PURE__ */ new Map() : extensions; + if (this.#extensions.has("permessage-deflate")) this.#extensions.set("permessage-deflate", new PerMessageDeflate(extensions)); + } + /** + * @param {Buffer} chunk + * @param {() => void} callback + */ + _write(chunk, _, callback) { + this.#buffers.push(chunk); + this.#byteOffset += chunk.length; + this.#loop = true; + 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) { + while (this.#loop) if (this.#state === parserStates.INFO) { + if (this.#byteOffset < 2) return callback(); + const buffer = this.consume(2); + const fin = (buffer[0] & 128) !== 0; + const opcode = buffer[0] & 15; + const masked = (buffer[1] & 128) === 128; + const fragmented = !fin && opcode !== opcodes.CONTINUATION; + const payloadLength = buffer[1] & 127; + const rsv1 = buffer[0] & 64; + const rsv2 = buffer[0] & 32; + const rsv3 = buffer[0] & 16; + if (!isValidOpcode(opcode)) { + failWebsocketConnection(this.ws, "Invalid opcode received"); + return callback(); + } + if (masked) { + failWebsocketConnection(this.ws, "Frame cannot be masked"); + return callback(); + } + if (rsv1 !== 0 && !this.#extensions.has("permessage-deflate")) { + failWebsocketConnection(this.ws, "Expected RSV1 to be clear."); + return; + } + if (rsv2 !== 0 || rsv3 !== 0) { + failWebsocketConnection(this.ws, "RSV1, RSV2, RSV3 must be clear"); + return; + } + if (fragmented && !isTextBinaryFrame(opcode)) { + failWebsocketConnection(this.ws, "Invalid frame type was fragmented."); + return; + } + if (isTextBinaryFrame(opcode) && this.#fragments.length > 0) { + failWebsocketConnection(this.ws, "Expected continuation frame"); + return; + } + if (this.#info.fragmented && fragmented) { + failWebsocketConnection(this.ws, "Fragmented frame exceeded 125 bytes."); + return; + } + if ((payloadLength > 125 || fragmented) && isControlFrame(opcode)) { + failWebsocketConnection(this.ws, "Control frame either too large or fragmented"); + return; + } + if (isContinuationFrame(opcode) && this.#fragments.length === 0 && !this.#info.compressed) { + failWebsocketConnection(this.ws, "Unexpected continuation frame"); + return; + } + if (payloadLength <= 125) { + this.#info.payloadLength = payloadLength; + this.#state = parserStates.READ_DATA; + } else if (payloadLength === 126) this.#state = parserStates.PAYLOADLENGTH_16; + else if (payloadLength === 127) this.#state = parserStates.PAYLOADLENGTH_64; + if (isTextBinaryFrame(opcode)) { + this.#info.binaryType = opcode; + this.#info.compressed = rsv1 !== 0; + } + this.#info.opcode = opcode; + this.#info.masked = masked; + this.#info.fin = fin; + this.#info.fragmented = fragmented; + } else if (this.#state === parserStates.PAYLOADLENGTH_16) { + if (this.#byteOffset < 2) return callback(); + const buffer = this.consume(2); + this.#info.payloadLength = buffer.readUInt16BE(0); + this.#state = parserStates.READ_DATA; + } else if (this.#state === parserStates.PAYLOADLENGTH_64) { + if (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); + this.#info.payloadLength = (upper << 8) + lower; + this.#state = parserStates.READ_DATA; + } else if (this.#state === parserStates.READ_DATA) { + if (this.#byteOffset < this.#info.payloadLength) return callback(); + const body = this.consume(this.#info.payloadLength); + if (isControlFrame(this.#info.opcode)) { + this.#loop = this.parseControlFrame(body); + this.#state = parserStates.INFO; + } else if (!this.#info.compressed) { + this.#fragments.push(body); + if (!this.#info.fragmented && this.#info.fin) { + const fullMessage = Buffer.concat(this.#fragments); + websocketMessageReceived(this.ws, this.#info.binaryType, fullMessage); + this.#fragments.length = 0; + } + this.#state = parserStates.INFO; + } else { + this.#extensions.get("permessage-deflate").decompress(body, this.#info.fin, (error, data) => { + if (error) { + closeWebSocketConnection(this.ws, 1007, error.message, error.message.length); + return; + } + this.#fragments.push(data); + if (!this.#info.fin) { + this.#state = parserStates.INFO; + this.#loop = true; + this.run(callback); + return; + } + websocketMessageReceived(this.ws, this.#info.binaryType, Buffer.concat(this.#fragments)); + this.#loop = true; + this.#state = parserStates.INFO; + this.#fragments.length = 0; + this.run(callback); + }); + this.#loop = false; + break; + } + } + } + /** + * Take n bytes from the buffered Buffers + * @param {number} n + * @returns {Buffer} + */ + consume(n) { + if (n > this.#byteOffset) throw new Error("Called consume() before buffers satiated."); + else if (n === 0) return emptyBuffer; + if (this.#buffers[0].length === n) { + this.#byteOffset -= this.#buffers[0].length; + return this.#buffers.shift(); + } + const buffer = Buffer.allocUnsafe(n); + let offset = 0; + while (offset !== n) { + const next = this.#buffers[0]; + const { length } = next; + if (length + offset === n) { + buffer.set(this.#buffers.shift(), offset); + break; + } else if (length + offset > n) { + buffer.set(next.subarray(0, n - offset), offset); + this.#buffers[0] = next.subarray(n - offset); + break; + } else { + buffer.set(this.#buffers.shift(), offset); + offset += next.length; + } + } + this.#byteOffset -= n; + return buffer; + } + parseCloseBody(data) { + assert(data.length !== 1); + /** @type {number|undefined} */ + let code; + if (data.length >= 2) code = data.readUInt16BE(0); + if (code !== void 0 && !isValidStatusCode(code)) return { + code: 1002, + reason: "Invalid status code", + error: true + }; + /** @type {Buffer} */ + let reason = data.subarray(2); + if (reason[0] === 239 && reason[1] === 187 && reason[2] === 191) reason = reason.subarray(3); + try { + reason = utf8Decode(reason); + } catch { + return { + code: 1007, + reason: "Invalid UTF-8", + error: true + }; + } + return { + code, + reason, + error: false + }; + } + /** + * Parses control frames. + * @param {Buffer} body + */ + parseControlFrame(body) { + const { opcode, payloadLength } = this.#info; + if (opcode === opcodes.CLOSE) { + if (payloadLength === 1) { + failWebsocketConnection(this.ws, "Received close frame with a 1-byte body."); + return false; + } + this.#info.closeInfo = this.parseCloseBody(body); + if (this.#info.closeInfo.error) { + const { code, reason } = this.#info.closeInfo; + closeWebSocketConnection(this.ws, code, reason, reason.length); + failWebsocketConnection(this.ws, reason); + return false; + } + if (this.ws[kSentClose] !== sentCloseFrameState.SENT) { + let body = emptyBuffer; + if (this.#info.closeInfo.code) { + body = Buffer.allocUnsafe(2); + body.writeUInt16BE(this.#info.closeInfo.code, 0); + } + const closeFrame = new WebsocketFrameSend(body); + this.ws[kResponse].socket.write(closeFrame.createFrame(opcodes.CLOSE), (err) => { + if (!err) this.ws[kSentClose] = sentCloseFrameState.SENT; + }); + } + this.ws[kReadyState] = states.CLOSING; + this.ws[kReceivedClose] = true; + return false; + } else if (opcode === opcodes.PING) { + if (!this.ws[kReceivedClose]) { + const frame = new WebsocketFrameSend(body); + this.ws[kResponse].socket.write(frame.createFrame(opcodes.PONG)); + if (channels.ping.hasSubscribers) channels.ping.publish({ payload: body }); + } + } else if (opcode === opcodes.PONG) { + if (channels.pong.hasSubscribers) channels.pong.publish({ payload: body }); + } + return true; + } + get closingInfo() { + return this.#info.closeInfo; + } + }; + module.exports = { ByteParser }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/websocket/sender.js +var require_sender = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { WebsocketFrameSend } = require_frame(); + const { opcodes, sendHints } = require_constants(); + const FixedQueue = require_fixed_queue(); + /** @type {typeof Uint8Array} */ + const FastBuffer = Buffer[Symbol.species]; + /** + * @typedef {object} SendQueueNode + * @property {Promise | null} promise + * @property {((...args: any[]) => any)} callback + * @property {Buffer | null} frame + */ + var SendQueue = class { + /** + * @type {FixedQueue} + */ + #queue = new FixedQueue(); + /** + * @type {boolean} + */ + #running = false; + /** @type {import('node:net').Socket} */ + #socket; + constructor(socket) { + this.#socket = socket; + } + add(item, cb, hint) { + if (hint !== sendHints.blob) { + const frame = createFrame(item, hint); + if (!this.#running) this.#socket.write(frame, cb); + else { + /** @type {SendQueueNode} */ + const node = { + promise: null, + callback: cb, + frame + }; + this.#queue.push(node); + } + return; + } + /** @type {SendQueueNode} */ + const node = { + promise: item.arrayBuffer().then((ab) => { + node.promise = null; + node.frame = createFrame(ab, hint); + }), + callback: cb, + frame: null + }; + this.#queue.push(node); + if (!this.#running) this.#run(); + } + async #run() { + this.#running = true; + const queue = this.#queue; + while (!queue.isEmpty()) { + const node = queue.shift(); + if (node.promise !== null) await node.promise; + this.#socket.write(node.frame, node.callback); + node.callback = node.frame = null; + } + this.#running = false; + } + }; + function createFrame(data, hint) { + return new WebsocketFrameSend(toBuffer(data, hint)).createFrame(hint === sendHints.string ? opcodes.TEXT : opcodes.BINARY); + } + function toBuffer(data, hint) { + switch (hint) { + case sendHints.string: return Buffer.from(data); + case sendHints.arrayBuffer: + case sendHints.blob: return new FastBuffer(data); + case sendHints.typedArray: return new FastBuffer(data.buffer, data.byteOffset, data.byteLength); + } + } + module.exports = { SendQueue }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/websocket/websocket.js +var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { webidl } = require_webidl(); + const { URLSerializer } = require_data_url(); + const { environmentSettingsObject } = require_util$6(); + const { staticPropertyDescriptors, states, sentCloseFrameState, sendHints } = require_constants(); + const { kWebSocketURL, kReadyState, kController, kBinaryType, kResponse, kSentClose, kByteParser } = require_symbols(); + const { isConnecting, isEstablished, isClosing, isValidSubprotocol, fireEvent } = require_util$1(); + const { establishWebSocketConnection, closeWebSocketConnection } = require_connection(); + const { ByteParser } = require_receiver(); + const { kEnumerableProperty, isBlobLike } = require_util$7(); + const { getGlobalDispatcher } = require_global(); + const { types } = __require("node:util"); + const { ErrorEvent, CloseEvent } = require_events(); + const { SendQueue } = require_sender(); + var WebSocket = class WebSocket extends EventTarget { + #events = { + open: null, + error: null, + close: null, + message: null + }; + #bufferedAmount = 0; + #protocol = ""; + #extensions = ""; + /** @type {SendQueue} */ + #sendQueue; + /** + * @param {string} url + * @param {string|string[]} protocols + */ + constructor(url, protocols = []) { + super(); + webidl.util.markAsUncloneable(this); + const prefix = "WebSocket constructor"; + webidl.argumentLengthCheck(arguments, 1, prefix); + const options = webidl.converters["DOMString or sequence or WebSocketInit"](protocols, prefix, "options"); + url = webidl.converters.USVString(url, prefix, "url"); + protocols = options.protocols; + const baseURL = environmentSettingsObject.settingsObject.baseUrl; + let urlRecord; + try { + urlRecord = new URL(url, baseURL); + } catch (e) { + throw new DOMException(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 DOMException(`Expected a ws: or wss: protocol, got ${urlRecord.protocol}`, "SyntaxError"); + if (urlRecord.hash || urlRecord.href.endsWith("#")) throw new DOMException("Got fragment", "SyntaxError"); + if (typeof protocols === "string") protocols = [protocols]; + if (protocols.length !== new Set(protocols.map((p) => p.toLowerCase())).size) throw new DOMException("Invalid Sec-WebSocket-Protocol value", "SyntaxError"); + if (protocols.length > 0 && !protocols.every((p) => isValidSubprotocol(p))) throw new DOMException("Invalid Sec-WebSocket-Protocol value", "SyntaxError"); + this[kWebSocketURL] = new URL(urlRecord.href); + const client = environmentSettingsObject.settingsObject; + this[kController] = establishWebSocketConnection(urlRecord, protocols, client, this, (response, extensions) => this.#onConnectionEstablished(response, extensions), options); + this[kReadyState] = WebSocket.CONNECTING; + this[kSentClose] = sentCloseFrameState.NOT_SENT; + 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); + const prefix = "WebSocket.close"; + if (code !== void 0) code = webidl.converters["unsigned short"](code, prefix, "code", { clamp: true }); + if (reason !== void 0) reason = webidl.converters.USVString(reason, prefix, "reason"); + if (code !== void 0) { + if (code !== 1e3 && (code < 3e3 || code > 4999)) throw new DOMException("invalid code", "InvalidAccessError"); + } + let reasonByteLength = 0; + if (reason !== void 0) { + reasonByteLength = Buffer.byteLength(reason); + if (reasonByteLength > 123) throw new DOMException(`Reason must be less than 123 bytes; received ${reasonByteLength}`, "SyntaxError"); + } + closeWebSocketConnection(this, code, reason, reasonByteLength); + } + /** + * @see https://websockets.spec.whatwg.org/#dom-websocket-send + * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data + */ + send(data) { + webidl.brandCheck(this, WebSocket); + const prefix = "WebSocket.send"; + webidl.argumentLengthCheck(arguments, 1, prefix); + data = webidl.converters.WebSocketSendData(data, prefix, "data"); + if (isConnecting(this)) throw new DOMException("Sent before connected.", "InvalidStateError"); + if (!isEstablished(this) || isClosing(this)) return; + if (typeof data === "string") { + const length = Buffer.byteLength(data); + this.#bufferedAmount += length; + this.#sendQueue.add(data, () => { + this.#bufferedAmount -= length; + }, sendHints.string); + } else if (types.isArrayBuffer(data)) { + this.#bufferedAmount += data.byteLength; + this.#sendQueue.add(data, () => { + this.#bufferedAmount -= data.byteLength; + }, sendHints.arrayBuffer); + } else if (ArrayBuffer.isView(data)) { + this.#bufferedAmount += data.byteLength; + this.#sendQueue.add(data, () => { + this.#bufferedAmount -= data.byteLength; + }, sendHints.typedArray); + } else if (isBlobLike(data)) { + this.#bufferedAmount += data.size; + this.#sendQueue.add(data, () => { + this.#bufferedAmount -= data.size; + }, sendHints.blob); + } + } + get readyState() { + webidl.brandCheck(this, WebSocket); + return this[kReadyState]; + } + get bufferedAmount() { + webidl.brandCheck(this, WebSocket); + return this.#bufferedAmount; + } + get url() { + webidl.brandCheck(this, WebSocket); + return URLSerializer(this[kWebSocketURL]); + } + get extensions() { + webidl.brandCheck(this, WebSocket); + return this.#extensions; + } + get protocol() { + webidl.brandCheck(this, WebSocket); + return this.#protocol; + } + get onopen() { + webidl.brandCheck(this, WebSocket); + return this.#events.open; + } + set onopen(fn) { + webidl.brandCheck(this, WebSocket); + if (this.#events.open) this.removeEventListener("open", this.#events.open); + if (typeof fn === "function") { + this.#events.open = fn; + this.addEventListener("open", fn); + } else this.#events.open = null; + } + get onerror() { + webidl.brandCheck(this, WebSocket); + return this.#events.error; + } + set onerror(fn) { + webidl.brandCheck(this, WebSocket); + if (this.#events.error) this.removeEventListener("error", this.#events.error); + if (typeof fn === "function") { + this.#events.error = fn; + this.addEventListener("error", fn); + } else this.#events.error = null; + } + get onclose() { + webidl.brandCheck(this, WebSocket); + return this.#events.close; + } + set onclose(fn) { + webidl.brandCheck(this, WebSocket); + if (this.#events.close) this.removeEventListener("close", this.#events.close); + if (typeof fn === "function") { + this.#events.close = fn; + this.addEventListener("close", fn); + } else this.#events.close = null; + } + get onmessage() { + webidl.brandCheck(this, WebSocket); + return this.#events.message; + } + set onmessage(fn) { + webidl.brandCheck(this, WebSocket); + if (this.#events.message) this.removeEventListener("message", this.#events.message); + if (typeof fn === "function") { + this.#events.message = fn; + this.addEventListener("message", fn); + } else 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; + } + /** + * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol + */ + #onConnectionEstablished(response, parsedExtensions) { + this[kResponse] = response; + const parser = new ByteParser(this, parsedExtensions); + parser.on("drain", onParserDrain); + parser.on("error", onParserError.bind(this)); + response.socket.ws = this; + this[kByteParser] = parser; + this.#sendQueue = new SendQueue(response.socket); + this[kReadyState] = states.OPEN; + const extensions = response.headersList.get("sec-websocket-extensions"); + if (extensions !== null) this.#extensions = extensions; + const protocol = response.headersList.get("sec-websocket-protocol"); + if (protocol !== null) this.#protocol = protocol; + fireEvent("open", this); + } + }; + 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: kEnumerableProperty, + readyState: kEnumerableProperty, + bufferedAmount: kEnumerableProperty, + onopen: kEnumerableProperty, + onerror: kEnumerableProperty, + onclose: kEnumerableProperty, + close: kEnumerableProperty, + onmessage: kEnumerableProperty, + binaryType: kEnumerableProperty, + send: kEnumerableProperty, + extensions: kEnumerableProperty, + protocol: kEnumerableProperty, + [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, prefix, argument) { + if (webidl.util.Type(V) === "Object" && Symbol.iterator in V) return webidl.converters["sequence"](V); + return webidl.converters.DOMString(V, prefix, argument); + }; + webidl.converters.WebSocketInit = webidl.dictionaryConverter([ + { + key: "protocols", + converter: webidl.converters["DOMString or sequence"], + defaultValue: () => new Array(0) + }, + { + key: "dispatcher", + converter: webidl.converters.any, + defaultValue: () => getGlobalDispatcher() + }, + { + 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 (isBlobLike(V)) return webidl.converters.Blob(V, { strict: false }); + if (ArrayBuffer.isView(V) || types.isArrayBuffer(V)) return webidl.converters.BufferSource(V); + } + return webidl.converters.USVString(V); + }; + function onParserDrain() { + this.ws[kResponse].socket.resume(); + } + function onParserError(err) { + let message; + let code; + if (err instanceof CloseEvent) { + message = err.reason; + code = err.code; + } else message = err.message; + fireEvent("error", this, () => new ErrorEvent("error", { + error: err, + message + })); + closeWebSocketConnection(this, code); + } + module.exports = { WebSocket }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/eventsource/util.js +var require_util = /* @__PURE__ */ __commonJSMin(((exports, module) => { + /** + * Checks if the given value is a valid LastEventId. + * @param {string} value + * @returns {boolean} + */ + function isValidLastEventId(value) { + return value.indexOf("\0") === -1; + } + /** + * Checks if the given value is a base 10 digit. + * @param {string} value + * @returns {boolean} + */ + function isASCIINumber(value) { + if (value.length === 0) return false; + for (let i = 0; i < value.length; i++) if (value.charCodeAt(i) < 48 || value.charCodeAt(i) > 57) return false; + return true; + } + function delay(ms) { + return new Promise((resolve) => { + setTimeout(resolve, ms).unref(); + }); + } + module.exports = { + isValidLastEventId, + isASCIINumber, + delay + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/eventsource/eventsource-stream.js +var require_eventsource_stream = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { Transform } = __require("node:stream"); + const { isASCIINumber, isValidLastEventId } = require_util(); + /** + * @type {number[]} BOM + */ + const BOM = [ + 239, + 187, + 191 + ]; + /** + * @type {10} LF + */ + const LF = 10; + /** + * @type {13} CR + */ + const CR = 13; + /** + * @type {58} COLON + */ + const COLON = 58; + /** + * @type {32} SPACE + */ + const SPACE = 32; + /** + * @typedef {object} EventSourceStreamEvent + * @type {object} + * @property {string} [event] The event type. + * @property {string} [data] The data of the message. + * @property {string} [id] A unique ID for the event. + * @property {string} [retry] The reconnection time, in milliseconds. + */ + /** + * @typedef eventSourceSettings + * @type {object} + * @property {string} lastEventId The last event ID received from the server. + * @property {string} origin The origin of the event source. + * @property {number} reconnectionTime The reconnection time, in milliseconds. + */ + var EventSourceStream = class extends Transform { + /** + * @type {eventSourceSettings} + */ + state = null; + /** + * Leading byte-order-mark check. + * @type {boolean} + */ + checkBOM = true; + /** + * @type {boolean} + */ + crlfCheck = false; + /** + * @type {boolean} + */ + eventEndCheck = false; + /** + * @type {Buffer} + */ + buffer = null; + pos = 0; + event = { + data: void 0, + event: void 0, + id: void 0, + retry: void 0 + }; + /** + * @param {object} options + * @param {eventSourceSettings} options.eventSourceSettings + * @param {Function} [options.push] + */ + constructor(options = {}) { + options.readableObjectMode = true; + super(options); + this.state = options.eventSourceSettings || {}; + if (options.push) this.push = options.push; + } + /** + * @param {Buffer} chunk + * @param {string} _encoding + * @param {Function} callback + * @returns {void} + */ + _transform(chunk, _encoding, callback) { + if (chunk.length === 0) { + callback(); + return; + } + if (this.buffer) this.buffer = Buffer.concat([this.buffer, chunk]); + else this.buffer = chunk; + if (this.checkBOM) switch (this.buffer.length) { + case 1: + if (this.buffer[0] === BOM[0]) { + callback(); + return; + } + this.checkBOM = false; + callback(); + return; + case 2: + if (this.buffer[0] === BOM[0] && this.buffer[1] === BOM[1]) { + callback(); + return; + } + this.checkBOM = false; + break; + case 3: + if (this.buffer[0] === BOM[0] && this.buffer[1] === BOM[1] && this.buffer[2] === BOM[2]) { + this.buffer = Buffer.alloc(0); + this.checkBOM = false; + callback(); + return; + } + this.checkBOM = false; + break; + default: + if (this.buffer[0] === BOM[0] && this.buffer[1] === BOM[1] && this.buffer[2] === BOM[2]) this.buffer = this.buffer.subarray(3); + this.checkBOM = false; + break; + } + while (this.pos < this.buffer.length) { + if (this.eventEndCheck) { + if (this.crlfCheck) { + if (this.buffer[this.pos] === LF) { + this.buffer = this.buffer.subarray(this.pos + 1); + this.pos = 0; + this.crlfCheck = false; + continue; + } + this.crlfCheck = false; + } + if (this.buffer[this.pos] === LF || this.buffer[this.pos] === CR) { + if (this.buffer[this.pos] === CR) this.crlfCheck = true; + this.buffer = this.buffer.subarray(this.pos + 1); + this.pos = 0; + if (this.event.data !== void 0 || this.event.event || this.event.id || this.event.retry) this.processEvent(this.event); + this.clearEvent(); + continue; + } + this.eventEndCheck = false; + continue; + } + if (this.buffer[this.pos] === LF || this.buffer[this.pos] === CR) { + if (this.buffer[this.pos] === CR) this.crlfCheck = true; + this.parseLine(this.buffer.subarray(0, this.pos), this.event); + this.buffer = this.buffer.subarray(this.pos + 1); + this.pos = 0; + this.eventEndCheck = true; + continue; + } + this.pos++; + } + callback(); + } + /** + * @param {Buffer} line + * @param {EventStreamEvent} event + */ + parseLine(line, event) { + if (line.length === 0) return; + const colonPosition = line.indexOf(COLON); + if (colonPosition === 0) return; + let field = ""; + let value = ""; + if (colonPosition !== -1) { + field = line.subarray(0, colonPosition).toString("utf8"); + let valueStart = colonPosition + 1; + if (line[valueStart] === SPACE) ++valueStart; + value = line.subarray(valueStart).toString("utf8"); + } else { + field = line.toString("utf8"); + value = ""; + } + switch (field) { + case "data": + if (event[field] === void 0) event[field] = value; + else event[field] += `\n${value}`; + break; + case "retry": + if (isASCIINumber(value)) event[field] = value; + break; + case "id": + if (isValidLastEventId(value)) event[field] = value; + break; + case "event": + if (value.length > 0) event[field] = value; + break; + } + } + /** + * @param {EventSourceStreamEvent} event + */ + processEvent(event) { + if (event.retry && isASCIINumber(event.retry)) this.state.reconnectionTime = parseInt(event.retry, 10); + if (event.id && isValidLastEventId(event.id)) this.state.lastEventId = event.id; + if (event.data !== void 0) this.push({ + type: event.event || "message", + options: { + data: event.data, + lastEventId: this.state.lastEventId, + origin: this.state.origin + } + }); + } + clearEvent() { + this.event = { + data: void 0, + event: void 0, + id: void 0, + retry: void 0 + }; + } + }; + module.exports = { EventSourceStream }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/web/eventsource/eventsource.js +var require_eventsource = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { pipeline } = __require("node:stream"); + const { fetching } = require_fetch(); + const { makeRequest } = require_request(); + const { webidl } = require_webidl(); + const { EventSourceStream } = require_eventsource_stream(); + const { parseMIMEType } = require_data_url(); + const { createFastMessageEvent } = require_events(); + const { isNetworkError } = require_response(); + const { delay } = require_util(); + const { kEnumerableProperty } = require_util$7(); + const { environmentSettingsObject } = require_util$6(); + let experimentalWarned = false; + /** + * A reconnection time, in milliseconds. This must initially be an implementation-defined value, + * probably in the region of a few seconds. + * + * In Comparison: + * - Chrome uses 3000ms. + * - Deno uses 5000ms. + * + * @type {3000} + */ + const defaultReconnectionTime = 3e3; + /** + * The readyState attribute represents the state of the connection. + * @enum + * @readonly + * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-readystate-dev + */ + /** + * The connection has not yet been established, or it was closed and the user + * agent is reconnecting. + * @type {0} + */ + const CONNECTING = 0; + /** + * The user agent has an open connection and is dispatching events as it + * receives them. + * @type {1} + */ + const OPEN = 1; + /** + * The connection is not open, and the user agent is not trying to reconnect. + * @type {2} + */ + const CLOSED = 2; + /** + * Requests for the element will have their mode set to "cors" and their credentials mode set to "same-origin". + * @type {'anonymous'} + */ + const ANONYMOUS = "anonymous"; + /** + * Requests for the element will have their mode set to "cors" and their credentials mode set to "include". + * @type {'use-credentials'} + */ + const USE_CREDENTIALS = "use-credentials"; + /** + * The EventSource interface is used to receive server-sent events. It + * connects to a server over HTTP and receives events in text/event-stream + * format without closing the connection. + * @extends {EventTarget} + * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#server-sent-events + * @api public + */ + var EventSource = class EventSource extends EventTarget { + #events = { + open: null, + error: null, + message: null + }; + #url = null; + #withCredentials = false; + #readyState = CONNECTING; + #request = null; + #controller = null; + #dispatcher; + /** + * @type {import('./eventsource-stream').eventSourceSettings} + */ + #state; + /** + * Creates a new EventSource object. + * @param {string} url + * @param {EventSourceInit} [eventSourceInitDict] + * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#the-eventsource-interface + */ + constructor(url, eventSourceInitDict = {}) { + super(); + webidl.util.markAsUncloneable(this); + const prefix = "EventSource constructor"; + webidl.argumentLengthCheck(arguments, 1, prefix); + if (!experimentalWarned) { + experimentalWarned = true; + process.emitWarning("EventSource is experimental, expect them to change at any time.", { code: "UNDICI-ES" }); + } + url = webidl.converters.USVString(url, prefix, "url"); + eventSourceInitDict = webidl.converters.EventSourceInitDict(eventSourceInitDict, prefix, "eventSourceInitDict"); + this.#dispatcher = eventSourceInitDict.dispatcher; + this.#state = { + lastEventId: "", + reconnectionTime: defaultReconnectionTime + }; + const settings = environmentSettingsObject; + let urlRecord; + try { + urlRecord = new URL(url, settings.settingsObject.baseUrl); + this.#state.origin = urlRecord.origin; + } catch (e) { + throw new DOMException(e, "SyntaxError"); + } + this.#url = urlRecord.href; + let corsAttributeState = ANONYMOUS; + if (eventSourceInitDict.withCredentials) { + corsAttributeState = USE_CREDENTIALS; + this.#withCredentials = true; + } + const initRequest = { + redirect: "follow", + keepalive: true, + mode: "cors", + credentials: corsAttributeState === "anonymous" ? "same-origin" : "omit", + referrer: "no-referrer" + }; + initRequest.client = environmentSettingsObject.settingsObject; + initRequest.headersList = [["accept", { + name: "accept", + value: "text/event-stream" + }]]; + initRequest.cache = "no-store"; + initRequest.initiator = "other"; + initRequest.urlList = [new URL(this.#url)]; + this.#request = makeRequest(initRequest); + this.#connect(); + } + /** + * Returns the state of this EventSource object's connection. It can have the + * values described below. + * @returns {0|1|2} + * @readonly + */ + get readyState() { + return this.#readyState; + } + /** + * Returns the URL providing the event stream. + * @readonly + * @returns {string} + */ + get url() { + return this.#url; + } + /** + * Returns a boolean indicating whether the EventSource object was + * instantiated with CORS credentials set (true), or not (false, the default). + */ + get withCredentials() { + return this.#withCredentials; + } + #connect() { + if (this.#readyState === CLOSED) return; + this.#readyState = CONNECTING; + const fetchParams = { + request: this.#request, + dispatcher: this.#dispatcher + }; + const processEventSourceEndOfBody = (response) => { + if (isNetworkError(response)) { + this.dispatchEvent(new Event("error")); + this.close(); + } + this.#reconnect(); + }; + fetchParams.processResponseEndOfBody = processEventSourceEndOfBody; + fetchParams.processResponse = (response) => { + if (isNetworkError(response)) if (response.aborted) { + this.close(); + this.dispatchEvent(new Event("error")); + return; + } else { + this.#reconnect(); + return; + } + const contentType = response.headersList.get("content-type", true); + const mimeType = contentType !== null ? parseMIMEType(contentType) : "failure"; + const contentTypeValid = mimeType !== "failure" && mimeType.essence === "text/event-stream"; + if (response.status !== 200 || contentTypeValid === false) { + this.close(); + this.dispatchEvent(new Event("error")); + return; + } + this.#readyState = OPEN; + this.dispatchEvent(new Event("open")); + this.#state.origin = response.urlList[response.urlList.length - 1].origin; + const eventSourceStream = new EventSourceStream({ + eventSourceSettings: this.#state, + push: (event) => { + this.dispatchEvent(createFastMessageEvent(event.type, event.options)); + } + }); + pipeline(response.body.stream, eventSourceStream, (error) => { + if (error?.aborted === false) { + this.close(); + this.dispatchEvent(new Event("error")); + } + }); + }; + this.#controller = fetching(fetchParams); + } + /** + * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#sse-processing-model + * @returns {Promise} + */ + async #reconnect() { + if (this.#readyState === CLOSED) return; + this.#readyState = CONNECTING; + this.dispatchEvent(new Event("error")); + await delay(this.#state.reconnectionTime); + if (this.#readyState !== CONNECTING) return; + if (this.#state.lastEventId.length) this.#request.headersList.set("last-event-id", this.#state.lastEventId, true); + this.#connect(); + } + /** + * Closes the connection, if any, and sets the readyState attribute to + * CLOSED. + */ + close() { + webidl.brandCheck(this, EventSource); + if (this.#readyState === CLOSED) return; + this.#readyState = CLOSED; + this.#controller.abort(); + this.#request = null; + } + get onopen() { + return this.#events.open; + } + set onopen(fn) { + if (this.#events.open) this.removeEventListener("open", this.#events.open); + if (typeof fn === "function") { + this.#events.open = fn; + this.addEventListener("open", fn); + } else this.#events.open = null; + } + get onmessage() { + return this.#events.message; + } + set onmessage(fn) { + if (this.#events.message) this.removeEventListener("message", this.#events.message); + if (typeof fn === "function") { + this.#events.message = fn; + this.addEventListener("message", fn); + } else this.#events.message = null; + } + get onerror() { + return this.#events.error; + } + set onerror(fn) { + if (this.#events.error) this.removeEventListener("error", this.#events.error); + if (typeof fn === "function") { + this.#events.error = fn; + this.addEventListener("error", fn); + } else this.#events.error = null; + } + }; + const constantsPropertyDescriptors = { + CONNECTING: { + __proto__: null, + configurable: false, + enumerable: true, + value: CONNECTING, + writable: false + }, + OPEN: { + __proto__: null, + configurable: false, + enumerable: true, + value: OPEN, + writable: false + }, + CLOSED: { + __proto__: null, + configurable: false, + enumerable: true, + value: CLOSED, + writable: false + } + }; + Object.defineProperties(EventSource, constantsPropertyDescriptors); + Object.defineProperties(EventSource.prototype, constantsPropertyDescriptors); + Object.defineProperties(EventSource.prototype, { + close: kEnumerableProperty, + onerror: kEnumerableProperty, + onmessage: kEnumerableProperty, + onopen: kEnumerableProperty, + readyState: kEnumerableProperty, + url: kEnumerableProperty, + withCredentials: kEnumerableProperty + }); + webidl.converters.EventSourceInitDict = webidl.dictionaryConverter([{ + key: "withCredentials", + converter: webidl.converters.boolean, + defaultValue: () => false + }, { + key: "dispatcher", + converter: webidl.converters.any + }]); + module.exports = { + EventSource, + defaultReconnectionTime + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/index.js +var require_undici = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const Client = require_client(); + const Dispatcher = require_dispatcher(); + const Pool = require_pool(); + const BalancedPool = require_balanced_pool(); + const Agent = require_agent(); + const ProxyAgent = require_proxy_agent(); + const EnvHttpProxyAgent = require_env_http_proxy_agent(); + const RetryAgent = require_retry_agent(); + const errors = require_errors$1(); + const util = require_util$7(); + const { InvalidArgumentError } = errors; + const api = require_api(); + const buildConnector = require_connect(); + const MockClient = require_mock_client(); + const MockAgent = require_mock_agent(); + const MockPool = require_mock_pool(); + const mockErrors = require_mock_errors(); + const RetryHandler = require_retry_handler(); + const { getGlobalDispatcher, setGlobalDispatcher } = require_global(); + const DecoratorHandler = require_decorator_handler(); + const RedirectHandler = require_redirect_handler(); + const createRedirectInterceptor = require_redirect_interceptor(); + Object.assign(Dispatcher.prototype, api); + module.exports.Dispatcher = Dispatcher; + module.exports.Client = Client; + module.exports.Pool = Pool; + module.exports.BalancedPool = BalancedPool; + module.exports.Agent = Agent; + module.exports.ProxyAgent = ProxyAgent; + module.exports.EnvHttpProxyAgent = EnvHttpProxyAgent; + module.exports.RetryAgent = RetryAgent; + module.exports.RetryHandler = RetryHandler; + module.exports.DecoratorHandler = DecoratorHandler; + module.exports.RedirectHandler = RedirectHandler; + module.exports.createRedirectInterceptor = createRedirectInterceptor; + module.exports.interceptors = { + redirect: require_redirect(), + retry: require_retry(), + dump: require_dump(), + dns: require_dns() + }; + module.exports.buildConnector = buildConnector; + module.exports.errors = errors; + module.exports.util = { + parseHeaders: util.parseHeaders, + headerNameToString: util.headerNameToString + }; + function makeDispatcher(fn) { + return (url, opts, handler) => { + if (typeof opts === "function") { + handler = opts; + opts = null; + } + if (!url || typeof url !== "string" && typeof url !== "object" && !(url instanceof URL)) throw new InvalidArgumentError("invalid url"); + if (opts != null && typeof opts !== "object") throw new InvalidArgumentError("invalid opts"); + if (opts && opts.path != null) { + if (typeof opts.path !== "string") throw new InvalidArgumentError("invalid opts.path"); + let path = opts.path; + if (!opts.path.startsWith("/")) path = `/${path}`; + url = new URL(util.parseOrigin(url).origin + path); + } else { + if (!opts) opts = typeof url === "object" ? url : {}; + url = util.parseURL(url); + } + const { agent, dispatcher = getGlobalDispatcher() } = opts; + if (agent) throw new InvalidArgumentError("unsupported opts.agent. Did you mean opts.client?"); + return fn.call(dispatcher, { + ...opts, + origin: url.origin, + path: url.search ? `${url.pathname}${url.search}` : url.pathname, + method: opts.method || (opts.body ? "PUT" : "GET") + }, handler); + }; + } + module.exports.setGlobalDispatcher = setGlobalDispatcher; + module.exports.getGlobalDispatcher = getGlobalDispatcher; + const fetchImpl = require_fetch().fetch; + module.exports.fetch = async function fetch(init, options = void 0) { + try { + return await fetchImpl(init, options); + } catch (err) { + if (err && typeof err === "object") Error.captureStackTrace(err); + throw err; + } + }; + module.exports.Headers = require_headers().Headers; + module.exports.Response = require_response().Response; + module.exports.Request = require_request().Request; + module.exports.FormData = require_formdata().FormData; + module.exports.File = globalThis.File ?? __require("node:buffer").File; + module.exports.FileReader = require_filereader().FileReader; + const { setGlobalOrigin, getGlobalOrigin } = require_global$1(); + module.exports.setGlobalOrigin = setGlobalOrigin; + module.exports.getGlobalOrigin = getGlobalOrigin; + const { CacheStorage } = require_cachestorage(); + const { kConstruct } = require_symbols$1(); + module.exports.caches = new CacheStorage(kConstruct); + const { deleteCookie, getCookies, getSetCookies, setCookie } = require_cookies(); + module.exports.deleteCookie = deleteCookie; + module.exports.getCookies = getCookies; + module.exports.getSetCookies = getSetCookies; + module.exports.setCookie = setCookie; + const { parseMIMEType, serializeAMimeType } = require_data_url(); + module.exports.parseMIMEType = parseMIMEType; + module.exports.serializeAMimeType = serializeAMimeType; + const { CloseEvent, ErrorEvent, MessageEvent } = require_events(); + module.exports.WebSocket = require_websocket().WebSocket; + module.exports.CloseEvent = CloseEvent; + module.exports.ErrorEvent = ErrorEvent; + module.exports.MessageEvent = MessageEvent; + module.exports.request = makeDispatcher(api.request); + module.exports.stream = makeDispatcher(api.stream); + module.exports.pipeline = makeDispatcher(api.pipeline); + module.exports.connect = makeDispatcher(api.connect); + module.exports.upgrade = makeDispatcher(api.upgrade); + module.exports.MockClient = MockClient; + module.exports.MockPool = MockPool; + module.exports.MockAgent = MockAgent; + module.exports.mockErrors = mockErrors; + const { EventSource } = require_eventsource(); + module.exports.EventSource = EventSource; +})); +require_tunnel(); +var import_undici = require_undici(); +var HttpCodes; +(function(HttpCodes) { + HttpCodes[HttpCodes["OK"] = 200] = "OK"; + HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices"; + HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently"; + HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved"; + HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther"; + HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified"; + HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy"; + HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy"; + HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect"; + HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect"; + HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest"; + HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized"; + HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired"; + HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden"; + HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound"; + HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed"; + HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable"; + HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; + HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout"; + HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict"; + HttpCodes[HttpCodes["Gone"] = 410] = "Gone"; + HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests"; + HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError"; + HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented"; + HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway"; + HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable"; + HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout"; +})(HttpCodes || (HttpCodes = {})); +var Headers; +(function(Headers) { + Headers["Accept"] = "accept"; + Headers["ContentType"] = "content-type"; +})(Headers || (Headers = {})); +var MediaTypes; +(function(MediaTypes) { + MediaTypes["ApplicationJson"] = "application/json"; +})(MediaTypes || (MediaTypes = {})); +HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect; +HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout; +//#endregion +//#region ../../node_modules/.pnpm/@actions+core@3.0.0/node_modules/@actions/core/lib/summary.js +var __awaiter$7 = 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()); + }); +}; +const { access, appendFile, writeFile } = promises; +const SUMMARY_ENV_VAR = "GITHUB_STEP_SUMMARY"; +var Summary = class { + 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 __awaiter$7(this, void 0, void 0, function* () { + if (this._filePath) return this._filePath; + const pathFromEnv = process.env[SUMMARY_ENV_VAR]; + if (!pathFromEnv) throw new Error(`Unable to find environment variable for $${SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`); + try { + yield access(pathFromEnv, constants.R_OK | constants.W_OK); + } catch (_a) { + 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(options) { + return __awaiter$7(this, void 0, void 0, function* () { + const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite); + const filePath = yield this.filePath(); + yield (overwrite ? writeFile : appendFile)(filePath, this._buffer, { encoding: "utf8" }); + return this.emptyBuffer(); + }); + } + /** + * Clears the summary buffer and wipes the summary file + * + * @returns {Summary} summary instance + */ + clear() { + return __awaiter$7(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(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, data, colspan, rowspan } = cell; + const tag = header ? "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, options) { + const { width, height } = options || {}; + 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(); + } +}; +new Summary(); +//#endregion +//#region ../../node_modules/.pnpm/@actions+io@3.0.2/node_modules/@actions/io/lib/io-util.js +var __awaiter$6 = 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()); + }); +}; +const { chmod, copyFile, lstat, mkdir, open, readdir, rename, rm, rmdir, stat, symlink, unlink } = fs$3.promises; +const IS_WINDOWS$1 = process.platform === "win32"; +fs$3.constants.O_RDONLY; +function exists(fsPath) { + return __awaiter$6(this, void 0, void 0, function* () { + try { + yield stat(fsPath); + } catch (err) { + if (err.code === "ENOENT") return false; + throw err; + } + return true; + }); +} +/** +* On OSX/Linux, true if path starts with '/'. On Windows, true for paths like: +* \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases). +*/ +function isRooted(p) { + p = normalizeSeparators(p); + if (!p) throw new Error("isRooted() parameter \"p\" cannot be empty"); + if (IS_WINDOWS$1) return p.startsWith("\\") || /^[A-Z]:/i.test(p); + return p.startsWith("/"); +} +/** +* Best effort attempt to determine whether a file exists and is executable. +* @param filePath file path to check +* @param extensions additional file extensions to try +* @return if file exists and is executable, returns the file path. otherwise empty string. +*/ +function tryGetExecutablePath(filePath, extensions) { + return __awaiter$6(this, void 0, void 0, function* () { + let stats = void 0; + try { + stats = yield stat(filePath); + } catch (err) { + if (err.code !== "ENOENT") console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); + } + if (stats && stats.isFile()) { + if (IS_WINDOWS$1) { + const upperExt = path$2.extname(filePath).toUpperCase(); + if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) return filePath; + } else if (isUnixExecutable(stats)) return filePath; + } + const originalFilePath = filePath; + for (const extension of extensions) { + filePath = originalFilePath + extension; + stats = void 0; + try { + stats = yield stat(filePath); + } catch (err) { + if (err.code !== "ENOENT") console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); + } + if (stats && stats.isFile()) { + if (IS_WINDOWS$1) { + try { + const directory = path$2.dirname(filePath); + const upperName = path$2.basename(filePath).toUpperCase(); + for (const actualName of yield readdir(directory)) if (upperName === actualName.toUpperCase()) { + filePath = path$2.join(directory, actualName); + break; + } + } catch (err) { + console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`); + } + return filePath; + } else if (isUnixExecutable(stats)) return filePath; + } + } + return ""; + }); +} +function normalizeSeparators(p) { + p = p || ""; + if (IS_WINDOWS$1) { + p = p.replace(/\//g, "\\"); + return p.replace(/\\\\+/g, "\\"); + } + return p.replace(/\/\/+/g, "/"); +} +function isUnixExecutable(stats) { + return (stats.mode & 1) > 0 || (stats.mode & 8) > 0 && process.getgid !== void 0 && stats.gid === process.getgid() || (stats.mode & 64) > 0 && process.getuid !== void 0 && stats.uid === process.getuid(); +} +//#endregion +//#region ../../node_modules/.pnpm/@actions+io@3.0.2/node_modules/@actions/io/lib/io.js +var __awaiter$5 = 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()); + }); +}; +/** +* Returns path of a tool had the tool actually been invoked. Resolves via paths. +* If you check and the tool does not exist, it will throw. +* +* @param tool name of the tool +* @param check whether to check if tool exists +* @returns Promise path to tool +*/ +function which(tool, check) { + return __awaiter$5(this, void 0, void 0, function* () { + if (!tool) throw new Error("parameter 'tool' is required"); + if (check) { + const result = yield which(tool, false); + if (!result) if (IS_WINDOWS$1) throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`); + else throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`); + return result; + } + const matches = yield findInPath(tool); + if (matches && matches.length > 0) return matches[0]; + return ""; + }); +} +/** +* Returns a list of all occurrences of the given tool on the system path. +* +* @returns Promise the paths of the tool +*/ +function findInPath(tool) { + return __awaiter$5(this, void 0, void 0, function* () { + if (!tool) throw new Error("parameter 'tool' is required"); + const extensions = []; + if (IS_WINDOWS$1 && process.env["PATHEXT"]) { + for (const extension of process.env["PATHEXT"].split(path$2.delimiter)) if (extension) extensions.push(extension); + } + if (isRooted(tool)) { + const filePath = yield tryGetExecutablePath(tool, extensions); + if (filePath) return [filePath]; + return []; + } + if (tool.includes(path$2.sep)) return []; + const directories = []; + if (process.env.PATH) { + for (const p of process.env.PATH.split(path$2.delimiter)) if (p) directories.push(p); + } + const matches = []; + for (const directory of directories) { + const filePath = yield tryGetExecutablePath(path$2.join(directory, tool), extensions); + if (filePath) matches.push(filePath); + } + return matches; + }); +} +//#endregion +//#region ../../node_modules/.pnpm/@actions+exec@3.0.0/node_modules/@actions/exec/lib/toolrunner.js +var __awaiter$4 = 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()); + }); +}; +const IS_WINDOWS = process.platform === "win32"; +var ToolRunner = class extends events.EventEmitter { + constructor(toolPath, args, options) { + super(); + if (!toolPath) throw new Error("Parameter 'toolPath' cannot be null or empty."); + this.toolPath = toolPath; + this.args = args || []; + this.options = options || {}; + } + _debug(message) { + if (this.options.listeners && this.options.listeners.debug) this.options.listeners.debug(message); + } + _getCommandString(options, noPrefix) { + const toolPath = this._getSpawnFileName(); + const args = this._getSpawnArgs(options); + let cmd = noPrefix ? "" : "[command]"; + if (IS_WINDOWS) if (this._isCmdFile()) { + cmd += toolPath; + for (const a of args) cmd += ` ${a}`; + } else if (options.windowsVerbatimArguments) { + cmd += `"${toolPath}"`; + for (const a of args) cmd += ` ${a}`; + } else { + cmd += this._windowsQuoteCmdArg(toolPath); + for (const a of args) cmd += ` ${this._windowsQuoteCmdArg(a)}`; + } + else { + cmd += toolPath; + for (const a of args) cmd += ` ${a}`; + } + return cmd; + } + _processLineBuffer(data, strBuffer, onLine) { + try { + let s = strBuffer + data.toString(); + let n = s.indexOf(os$1.EOL); + while (n > -1) { + onLine(s.substring(0, n)); + s = s.substring(n + os$1.EOL.length); + n = s.indexOf(os$1.EOL); + } + return s; + } catch (err) { + this._debug(`error processing line. Failed with error ${err}`); + return ""; + } + } + _getSpawnFileName() { + if (IS_WINDOWS) { + if (this._isCmdFile()) return process.env["COMSPEC"] || "cmd.exe"; + } + return this.toolPath; + } + _getSpawnArgs(options) { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`; + for (const a of this.args) { + argline += " "; + argline += options.windowsVerbatimArguments ? a : this._windowsQuoteCmdArg(a); + } + argline += "\""; + return [argline]; + } + } + return this.args; + } + _endsWith(str, end) { + return str.endsWith(end); + } + _isCmdFile() { + const upperToolPath = this.toolPath.toUpperCase(); + return this._endsWith(upperToolPath, ".CMD") || this._endsWith(upperToolPath, ".BAT"); + } + _windowsQuoteCmdArg(arg) { + if (!this._isCmdFile()) return this._uvQuoteCmdArg(arg); + if (!arg) return "\"\""; + const cmdSpecialChars = [ + " ", + " ", + "&", + "(", + ")", + "[", + "]", + "{", + "}", + "^", + "=", + ";", + "!", + "'", + "+", + ",", + "`", + "~", + "|", + "<", + ">", + "\"" + ]; + let needsQuotes = false; + for (const char of arg) if (cmdSpecialChars.some((x) => x === char)) { + needsQuotes = true; + break; + } + if (!needsQuotes) return arg; + let reverse = "\""; + let quoteHit = true; + for (let i = arg.length; i > 0; i--) { + reverse += arg[i - 1]; + if (quoteHit && arg[i - 1] === "\\") reverse += "\\"; + else if (arg[i - 1] === "\"") { + quoteHit = true; + reverse += "\""; + } else quoteHit = false; + } + reverse += "\""; + return reverse.split("").reverse().join(""); + } + _uvQuoteCmdArg(arg) { + if (!arg) return "\"\""; + if (!arg.includes(" ") && !arg.includes(" ") && !arg.includes("\"")) return arg; + if (!arg.includes("\"") && !arg.includes("\\")) return `"${arg}"`; + let reverse = "\""; + let quoteHit = true; + for (let i = arg.length; i > 0; i--) { + reverse += arg[i - 1]; + if (quoteHit && arg[i - 1] === "\\") reverse += "\\"; + else if (arg[i - 1] === "\"") { + quoteHit = true; + reverse += "\\"; + } else quoteHit = false; + } + reverse += "\""; + return reverse.split("").reverse().join(""); + } + _cloneExecOptions(options) { + options = options || {}; + const result = { + cwd: options.cwd || process.cwd(), + env: options.env || process.env, + silent: options.silent || false, + windowsVerbatimArguments: options.windowsVerbatimArguments || false, + failOnStdErr: options.failOnStdErr || false, + ignoreReturnCode: options.ignoreReturnCode || false, + delay: options.delay || 1e4 + }; + result.outStream = options.outStream || process.stdout; + result.errStream = options.errStream || process.stderr; + return result; + } + _getSpawnOptions(options, toolPath) { + options = options || {}; + const result = {}; + result.cwd = options.cwd; + result.env = options.env; + result["windowsVerbatimArguments"] = options.windowsVerbatimArguments || this._isCmdFile(); + if (options.windowsVerbatimArguments) result.argv0 = `"${toolPath}"`; + return result; + } + /** + * Exec a tool. + * Output will be streamed to the live console. + * Returns promise with return code + * + * @param tool path to tool to exec + * @param options optional exec options. See ExecOptions + * @returns number + */ + exec() { + return __awaiter$4(this, void 0, void 0, function* () { + if (!isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) this.toolPath = path$2.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + this.toolPath = yield which(this.toolPath, true); + return new Promise((resolve, reject) => __awaiter$4(this, void 0, void 0, function* () { + this._debug(`exec tool: ${this.toolPath}`); + this._debug("arguments:"); + for (const arg of this.args) this._debug(` ${arg}`); + const optionsNonNull = this._cloneExecOptions(this.options); + if (!optionsNonNull.silent && optionsNonNull.outStream) optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os$1.EOL); + const state = new ExecState(optionsNonNull, this.toolPath); + state.on("debug", (message) => { + this._debug(message); + }); + if (this.options.cwd && !(yield exists(this.options.cwd))) return reject(/* @__PURE__ */ new Error(`The cwd: ${this.options.cwd} does not exist!`)); + const fileName = this._getSpawnFileName(); + const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName)); + let stdbuffer = ""; + if (cp.stdout) cp.stdout.on("data", (data) => { + if (this.options.listeners && this.options.listeners.stdout) this.options.listeners.stdout(data); + if (!optionsNonNull.silent && optionsNonNull.outStream) optionsNonNull.outStream.write(data); + stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => { + if (this.options.listeners && this.options.listeners.stdline) this.options.listeners.stdline(line); + }); + }); + let errbuffer = ""; + if (cp.stderr) cp.stderr.on("data", (data) => { + state.processStderr = true; + if (this.options.listeners && this.options.listeners.stderr) this.options.listeners.stderr(data); + if (!optionsNonNull.silent && optionsNonNull.errStream && optionsNonNull.outStream) (optionsNonNull.failOnStdErr ? optionsNonNull.errStream : optionsNonNull.outStream).write(data); + errbuffer = this._processLineBuffer(data, errbuffer, (line) => { + if (this.options.listeners && this.options.listeners.errline) this.options.listeners.errline(line); + }); + }); + cp.on("error", (err) => { + state.processError = err.message; + state.processExited = true; + state.processClosed = true; + state.CheckComplete(); + }); + cp.on("exit", (code) => { + state.processExitCode = code; + state.processExited = true; + this._debug(`Exit code ${code} received from tool '${this.toolPath}'`); + state.CheckComplete(); + }); + cp.on("close", (code) => { + state.processExitCode = code; + state.processExited = true; + state.processClosed = true; + this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); + state.CheckComplete(); + }); + state.on("done", (error, exitCode) => { + if (stdbuffer.length > 0) this.emit("stdline", stdbuffer); + if (errbuffer.length > 0) this.emit("errline", errbuffer); + cp.removeAllListeners(); + if (error) reject(error); + else resolve(exitCode); + }); + if (this.options.input) { + if (!cp.stdin) throw new Error("child process missing stdin"); + cp.stdin.end(this.options.input); + } + })); + }); + } +}; +/** +* Convert an arg string to an array of args. Handles escaping +* +* @param argString string of arguments +* @returns string[] array of arguments +*/ +function argStringToArray(argString) { + const args = []; + let inQuotes = false; + let escaped = false; + let arg = ""; + function append(c) { + if (escaped && c !== "\"") arg += "\\"; + arg += c; + escaped = false; + } + for (let i = 0; i < argString.length; i++) { + const c = argString.charAt(i); + if (c === "\"") { + if (!escaped) inQuotes = !inQuotes; + else append(c); + continue; + } + if (c === "\\" && escaped) { + append(c); + continue; + } + if (c === "\\" && inQuotes) { + escaped = true; + continue; + } + if (c === " " && !inQuotes) { + if (arg.length > 0) { + args.push(arg); + arg = ""; + } + continue; + } + append(c); + } + if (arg.length > 0) args.push(arg.trim()); + return args; +} +var ExecState = class ExecState extends events.EventEmitter { + constructor(options, toolPath) { + super(); + this.processClosed = false; + this.processError = ""; + this.processExitCode = 0; + this.processExited = false; + this.processStderr = false; + this.delay = 1e4; + this.done = false; + this.timeout = null; + if (!toolPath) throw new Error("toolPath must not be empty"); + this.options = options; + this.toolPath = toolPath; + if (options.delay) this.delay = options.delay; + } + CheckComplete() { + if (this.done) return; + if (this.processClosed) this._setResult(); + else if (this.processExited) this.timeout = setTimeout$1(ExecState.HandleTimeout, this.delay, this); + } + _debug(message) { + this.emit("debug", message); + } + _setResult() { + let error; + if (this.processExited) { + if (this.processError) error = /* @__PURE__ */ new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`); + else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) error = /* @__PURE__ */ new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); + else if (this.processStderr && this.options.failOnStdErr) error = /* @__PURE__ */ new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); + } + if (this.timeout) { + clearTimeout(this.timeout); + this.timeout = null; + } + this.done = true; + this.emit("done", error, this.processExitCode); + } + static HandleTimeout(state) { + if (state.done) return; + if (!state.processClosed && state.processExited) { + const message = `The STDIO streams did not close within ${state.delay / 1e3} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`; + state._debug(message); + } + state._setResult(); + } +}; +//#endregion +//#region ../../node_modules/.pnpm/@actions+exec@3.0.0/node_modules/@actions/exec/lib/exec.js +var __awaiter$3 = 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()); + }); +}; +/** +* Exec a command. +* Output will be streamed to the live console. +* Returns promise with return code +* +* @param commandLine command to execute (can include additional args). Must be correctly escaped. +* @param args optional arguments for tool. Escaping is handled by the lib. +* @param options optional exec options. See ExecOptions +* @returns Promise exit code +*/ +function exec(commandLine, args, options) { + return __awaiter$3(this, void 0, void 0, function* () { + const commandArgs = argStringToArray(commandLine); + if (commandArgs.length === 0) throw new Error(`Parameter 'commandLine' cannot be null or empty.`); + const toolPath = commandArgs[0]; + args = commandArgs.slice(1).concat(args || []); + return new ToolRunner(toolPath, args, options).exec(); + }); +} +/** +* Exec a command and get the output. +* Output will be streamed to the live console. +* Returns promise with the exit code and collected stdout and stderr +* +* @param commandLine command to execute (can include additional args). Must be correctly escaped. +* @param args optional arguments for tool. Escaping is handled by the lib. +* @param options optional exec options. See ExecOptions +* @returns Promise exit code, stdout, and stderr +*/ +function getExecOutput(commandLine, args, options) { + return __awaiter$3(this, void 0, void 0, function* () { + var _a, _b; + let stdout = ""; + let stderr = ""; + const stdoutDecoder = new StringDecoder("utf8"); + const stderrDecoder = new StringDecoder("utf8"); + const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout; + const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr; + const stdErrListener = (data) => { + stderr += stderrDecoder.write(data); + if (originalStdErrListener) originalStdErrListener(data); + }; + const stdOutListener = (data) => { + stdout += stdoutDecoder.write(data); + if (originalStdoutListener) originalStdoutListener(data); + }; + const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { + stdout: stdOutListener, + stderr: stdErrListener + }); + const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + stdout += stdoutDecoder.end(); + stderr += stderrDecoder.end(); + return { + exitCode, + stdout, + stderr + }; + }); +} +os.platform(); +os.arch(); +/** +* The code to exit an action +*/ +var ExitCode; +(function(ExitCode) { + /** + * A code indicating that the action was successful + */ + ExitCode[ExitCode["Success"] = 0] = "Success"; + /** + * A code indicating that the action was a failure + */ + ExitCode[ExitCode["Failure"] = 1] = "Failure"; +})(ExitCode || (ExitCode = {})); +/** +* Gets the value of an input. +* Unless trimWhitespace is set to false in InputOptions, the value is also trimmed. +* Returns an empty string if the value is not defined. +* +* @param name name of the input to get +* @param options optional. See InputOptions. +* @returns string +*/ +function getInput(name, options) { + const val = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; + if (options && options.required && !val) throw new Error(`Input required and not supplied: ${name}`); + if (options && options.trimWhitespace === false) return val; + return val.trim(); +} +/** +* Gets the values of an multiline input. Each value is also trimmed. +* +* @param name name of the input to get +* @param options optional. See InputOptions. +* @returns string[] +* +*/ +function getMultilineInput(name, options) { + const inputs = getInput(name, options).split("\n").filter((x) => x !== ""); + if (options && options.trimWhitespace === false) return inputs; + return inputs.map((input) => input.trim()); +} +/** +* Gets the input value of the boolean type in the YAML 1.2 "core schema" specification. +* Support boolean input list: `true | True | TRUE | false | False | FALSE` . +* The return value is also in boolean type. +* ref: https://yaml.org/spec/1.2/spec.html#id2804923 +* +* @param name name of the input to get +* @param options optional. See InputOptions. +* @returns boolean +*/ +function getBooleanInput(name, options) { + const trueValue = [ + "true", + "True", + "TRUE" + ]; + const falseValue = [ + "false", + "False", + "FALSE" + ]; + const val = getInput(name, options); + 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}\nSupport boolean input list: \`true | True | TRUE | false | False | FALSE\``); +} +/** +* Adds an error issue +* @param message error issue message. Errors will be converted to string via toString() +* @param properties optional properties to add to the annotation. +*/ +function error(message, properties = {}) { + issueCommand("error", toCommandProperties(properties), message instanceof Error ? message.toString() : message); +} +/** +* Writes info to log with console.log. +* @param message info message +*/ +function info(message) { + process.stdout.write(message + os$1.EOL); +} +/** +* Begin an output group. +* +* Output until the next `groupEnd` will be foldable in this group +* +* @param name The name of the output group +*/ +function startGroup(name) { + issue("group", name); +} +/** +* End an output group. +*/ +function endGroup() { + issue("endgroup"); +} +//#endregion +//#region ../../node_modules/.pnpm/@actions+github@9.1.0/node_modules/@actions/github/lib/context.js +var Context = class { + /** + * Hydrate the context from the environment + */ + constructor() { + var _a, _b, _c; + this.payload = {}; + if (process.env.GITHUB_EVENT_PATH) if (existsSync(process.env.GITHUB_EVENT_PATH)) this.payload = JSON.parse(readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: "utf8" })); + else { + const path = process.env.GITHUB_EVENT_PATH; + process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${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.runAttempt = parseInt(process.env.GITHUB_RUN_ATTEMPT, 10); + this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10); + this.runId = parseInt(process.env.GITHUB_RUN_ID, 10); + this.apiUrl = (_a = process.env.GITHUB_API_URL) !== null && _a !== void 0 ? _a : `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'"); + } +}; +//#endregion +//#region ../../node_modules/.pnpm/@actions+http-client@3.0.2/node_modules/@actions/http-client/lib/proxy.js +var require_proxy = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getProxyUrl = getProxyUrl; + exports.checkBypass = checkBypass; + function getProxyUrl(reqUrl) { + const usingSsl = reqUrl.protocol === "https:"; + if (checkBypass(reqUrl)) return; + 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 DecodedURL(proxyVar); + } catch (_a) { + if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) return new DecodedURL(`http://${proxyVar}`); + } + else return; + } + 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; + } + 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 DecodedURL = class extends URL { + constructor(url, base) { + super(url, base); + this._decodedUsername = decodeURIComponent(super.username); + this._decodedPassword = decodeURIComponent(super.password); + } + get username() { + return this._decodedUsername; + } + get password() { + return this._decodedPassword; + } + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/@actions+github@9.1.0/node_modules/@actions/github/lib/internal/utils.js +var import_lib$2 = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports) => { + var __createBinding = exports && exports.__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 = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { + enumerable: true, + value: v + }); + }) : function(o, v) { + o["default"] = v; + }); + var __importStar = exports && exports.__importStar || (function() { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function(o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + } + __setModuleDefault(result, mod); + return result; + }; + })(); + var __awaiter = exports && exports.__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(exports, "__esModule", { value: true }); + exports.HttpClient = exports.HttpClientResponse = exports.HttpClientError = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0; + exports.getProxyUrl = getProxyUrl; + exports.isHttps = isHttps; + const http = __importStar(__require("http")); + const https = __importStar(__require("https")); + const pm = __importStar(require_proxy()); + const tunnel = __importStar(require_tunnel()); + const undici_1 = require_undici(); + var HttpCodes; + (function(HttpCodes) { + HttpCodes[HttpCodes["OK"] = 200] = "OK"; + HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices"; + HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently"; + HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved"; + HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther"; + HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified"; + HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy"; + HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy"; + HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect"; + HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect"; + HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest"; + HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized"; + HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired"; + HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden"; + HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound"; + HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed"; + HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable"; + HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; + HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout"; + HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict"; + HttpCodes[HttpCodes["Gone"] = 410] = "Gone"; + HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests"; + HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError"; + HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented"; + HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway"; + HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable"; + HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout"; + })(HttpCodes || (exports.HttpCodes = HttpCodes = {})); + var Headers; + (function(Headers) { + Headers["Accept"] = "accept"; + Headers["ContentType"] = "content-type"; + })(Headers || (exports.Headers = Headers = {})); + var MediaTypes; + (function(MediaTypes) { + MediaTypes["ApplicationJson"] = "application/json"; + })(MediaTypes || (exports.MediaTypes = MediaTypes = {})); + /** + * Returns the proxy URL, depending upon the supplied url and proxy environment variables. + * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com + */ + function getProxyUrl(serverUrl) { + const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); + return proxyUrl ? proxyUrl.href : ""; + } + 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; + var HttpClientError = class HttpClientError extends Error { + constructor(message, statusCode) { + super(message); + this.name = "HttpClientError"; + this.statusCode = statusCode; + Object.setPrototypeOf(this, HttpClientError.prototype); + } + }; + exports.HttpClientError = HttpClientError; + var HttpClientResponse = class { + constructor(message) { + this.message = message; + } + readBody() { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve) => __awaiter(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(this, void 0, void 0, function* () { + return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () { + const chunks = []; + this.message.on("data", (chunk) => { + chunks.push(chunk); + }); + this.message.on("end", () => { + resolve(Buffer.concat(chunks)); + }); + })); + }); + } + }; + exports.HttpClientResponse = HttpClientResponse; + function isHttps(requestUrl) { + return new URL(requestUrl).protocol === "https:"; + } + var HttpClient = class { + constructor(userAgent, 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 = this._getUserAgentWithOrchestrationId(userAgent); + 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(this, void 0, void 0, function* () { + return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); + }); + } + get(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request("GET", requestUrl, null, additionalHeaders || {}); + }); + } + del(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request("DELETE", requestUrl, null, additionalHeaders || {}); + }); + } + post(requestUrl, data, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request("POST", requestUrl, data, additionalHeaders || {}); + }); + } + patch(requestUrl, data, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request("PATCH", requestUrl, data, additionalHeaders || {}); + }); + } + put(requestUrl, data, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request("PUT", requestUrl, data, additionalHeaders || {}); + }); + } + head(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request("HEAD", requestUrl, null, additionalHeaders || {}); + }); + } + sendStream(verb, requestUrl, stream, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request(verb, requestUrl, stream, 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_1) { + return __awaiter(this, arguments, void 0, function* (requestUrl, additionalHeaders = {}) { + 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_1, obj_1) { + return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) { + const data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson); + const res = yield this.post(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); + } + putJson(requestUrl_1, obj_1) { + return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) { + const data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson); + const res = yield this.put(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); + } + patchJson(requestUrl_1, obj_1) { + return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) { + const data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, 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, headers) { + return __awaiter(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, headers); + const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb) ? this._maxRetries + 1 : 1; + let numTries = 0; + let response; + do { + response = yield this.requestRaw(info, data); + if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (const handler of this.handlers) if (handler.canHandleAuthentication(response)) { + authenticationHandler = handler; + break; + } + if (authenticationHandler) return authenticationHandler.handleAuthentication(this, info, data); + else return response; + } + let redirectsRemaining = this._maxRedirects; + while (response.message.statusCode && HttpRedirectCodes.includes(response.message.statusCode) && this._allowRedirects && redirectsRemaining > 0) { + const redirectUrl = response.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 response.readBody(); + if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { + for (const header in headers) if (header.toLowerCase() === "authorization") delete headers[header]; + } + info = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info, data); + redirectsRemaining--; + } + if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) return response; + numTries += 1; + if (numTries < maxTries) { + yield response.readBody(); + yield this._performExponentialBackoff(numTries); + } + } while (numTries < maxTries); + return response; + }); + } + /** + * 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(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => { + function callbackForResult(err, res) { + if (err) reject(err); + else if (!res) reject(/* @__PURE__ */ 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) => { + handleResult(void 0, new HttpClientResponse(msg)); + }); + let socket; + req.on("socket", (sock) => { + socket = sock; + }); + req.setTimeout(this._socketTimeout || 3 * 6e4, () => { + if (socket) socket.end(); + handleResult(/* @__PURE__ */ 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); + if (!(proxyUrl && proxyUrl.hostname)) return; + return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); + } + _prepareRequest(method, requestUrl, headers) { + 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(headers); + if (this.userAgent != null) info.options.headers["user-agent"] = this.userAgent; + info.options.agent = this._getAgent(info.parsedUrl); + if (this.handlers) for (const handler of this.handlers) handler.prepareRequest(info.options); + return info; + } + _mergeHeaders(headers) { + if (this.requestOptions && this.requestOptions.headers) return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + return lowercaseKeys(headers || {}); + } + /** + * Gets an existing header value or returns a default. + * Handles converting number header values to strings since HTTP headers must be strings. + * Note: This returns string | string[] since some headers can have multiple values. + * For headers that must always be a single string (like Content-Type), use the + * specialized _getExistingOrDefaultContentTypeHeader method instead. + */ + _getExistingOrDefaultHeader(additionalHeaders, header, _default) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + const headerValue = lowercaseKeys(this.requestOptions.headers)[header]; + if (headerValue) clientHeader = typeof headerValue === "number" ? headerValue.toString() : headerValue; + } + const additionalValue = additionalHeaders[header]; + if (additionalValue !== void 0) return typeof additionalValue === "number" ? additionalValue.toString() : additionalValue; + if (clientHeader !== void 0) return clientHeader; + return _default; + } + /** + * Specialized version of _getExistingOrDefaultHeader for Content-Type header. + * Always returns a single string (not an array) since Content-Type should be a single value. + * Converts arrays to comma-separated strings and numbers to strings to ensure type safety. + * This was split from _getExistingOrDefaultHeader to provide stricter typing for callers + * that assign the result to places expecting a string (e.g., additionalHeaders[Headers.ContentType]). + */ + _getExistingOrDefaultContentTypeHeader(additionalHeaders, _default) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + const headerValue = lowercaseKeys(this.requestOptions.headers)[Headers.ContentType]; + if (headerValue) if (typeof headerValue === "number") clientHeader = String(headerValue); + else if (Array.isArray(headerValue)) clientHeader = headerValue.join(", "); + else clientHeader = headerValue; + } + const additionalValue = additionalHeaders[Headers.ContentType]; + if (additionalValue !== void 0) if (typeof additionalValue === "number") return String(additionalValue); + else if (Array.isArray(additionalValue)) return additionalValue.join(", "); + else return additionalValue; + if (clientHeader !== void 0) return clientHeader; + return _default; + } + _getAgent(parsedUrl) { + let agent; + const proxyUrl = pm.getProxyUrl(parsedUrl); + const useProxy = proxyUrl && proxyUrl.hostname; + if (this._keepAlive && useProxy) agent = this._proxyAgent; + if (!useProxy) agent = this._agent; + if (agent) return agent; + 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; + agent = tunnelAgent(agentOptions); + this._proxyAgent = agent; + } + if (!agent) { + const options = { + keepAlive: this._keepAlive, + maxSockets + }; + agent = usingSsl ? new https.Agent(options) : new http.Agent(options); + this._agent = agent; + } + if (usingSsl && this._ignoreSslError) agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false }); + return agent; + } + _getProxyAgentDispatcher(parsedUrl, proxyUrl) { + let proxyAgent; + if (this._keepAlive) proxyAgent = this._proxyAgentDispatcher; + if (proxyAgent) return proxyAgent; + const usingSsl = parsedUrl.protocol === "https:"; + proxyAgent = new undici_1.ProxyAgent(Object.assign({ + uri: proxyUrl.href, + pipelining: !this._keepAlive ? 0 : 1 + }, (proxyUrl.username || proxyUrl.password) && { token: `Basic ${Buffer.from(`${proxyUrl.username}:${proxyUrl.password}`).toString("base64")}` })); + this._proxyAgentDispatcher = proxyAgent; + if (usingSsl && this._ignoreSslError) proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, { rejectUnauthorized: false }); + return proxyAgent; + } + _getUserAgentWithOrchestrationId(userAgent) { + const baseUserAgent = userAgent || "actions/http-client"; + const orchId = process.env["ACTIONS_ORCHESTRATION_ID"]; + if (orchId) return `${baseUserAgent} actions_orchestration_id/${orchId.replace(/[^a-z0-9_.-]/gi, "_")}`; + return baseUserAgent; + } + _performExponentialBackoff(retryNumber) { + return __awaiter(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, options) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {} + }; + if (statusCode === HttpCodes.NotFound) resolve(response); + 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 (options && options.deserializeDates) obj = JSON.parse(contents, dateTimeDeserializer); + else obj = JSON.parse(contents); + response.result = obj; + } + response.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 = response.result; + reject(err); + } else resolve(response); + })); + }); + } + }; + exports.HttpClient = HttpClient; + const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); +})))(), 1); +var __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()); + }); +}; +function getAuthString(token, options) { + if (!token && !options.auth) throw new Error("Parameter token or opts.auth is required"); + else if (token && options.auth) throw new Error("Parameters token and opts.auth may not both be specified"); + return typeof options.auth === "string" ? options.auth : `token ${token}`; +} +function getProxyAgent(destinationUrl) { + return new import_lib$2.HttpClient().getAgent(destinationUrl); +} +function getProxyAgentDispatcher(destinationUrl) { + return new import_lib$2.HttpClient().getAgentDispatcher(destinationUrl); +} +function getProxyFetch(destinationUrl) { + const httpDispatcher = getProxyAgentDispatcher(destinationUrl); + const proxyFetch = (url, opts) => __awaiter(this, void 0, void 0, function* () { + return (0, import_undici.fetch)(url, Object.assign(Object.assign({}, opts), { dispatcher: httpDispatcher })); + }); + return proxyFetch; +} +function getApiBaseUrl() { + return process.env["GITHUB_API_URL"] || "https://api.github.com"; +} +function getUserAgentWithOrchestrationId(baseUserAgent) { + var _a; + const orchId = (_a = process.env["ACTIONS_ORCHESTRATION_ID"]) === null || _a === void 0 ? void 0 : _a.trim(); + if (orchId) { + const tag = `actions_orchestration_id/${orchId.replace(/[^a-z0-9_.-]/gi, "_")}`; + if (baseUserAgent === null || baseUserAgent === void 0 ? void 0 : baseUserAgent.includes(tag)) return baseUserAgent; + return `${baseUserAgent ? `${baseUserAgent} ` : ""}${tag}`; + } + return baseUserAgent; +} +//#endregion +//#region ../../node_modules/.pnpm/universal-user-agent@7.0.3/node_modules/universal-user-agent/index.js +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 ""; +} +//#endregion +//#region ../../node_modules/.pnpm/before-after-hook@4.0.0/node_modules/before-after-hook/lib/register.js +function register(state, name, method, options) { + if (typeof method !== "function") throw new Error("method for before hook must be a function"); + if (!options) options = {}; + if (Array.isArray(name)) return name.reverse().reduce((callback, name) => { + return register.bind(null, state, name, callback, options); + }, method)(); + return Promise.resolve().then(() => { + if (!state.registry[name]) return method(options); + return state.registry[name].reduce((method, registered) => { + return registered.hook.bind(null, method, options); + }, method)(); + }); +} +//#endregion +//#region ../../node_modules/.pnpm/before-after-hook@4.0.0/node_modules/before-after-hook/lib/add.js +function addHook(state, kind, name, hook) { + const orig = hook; + if (!state.registry[name]) state.registry[name] = []; + if (kind === "before") hook = (method, options) => { + return Promise.resolve().then(orig.bind(null, options)).then(method.bind(null, options)); + }; + if (kind === "after") hook = (method, options) => { + let result; + return Promise.resolve().then(method.bind(null, options)).then((result_) => { + result = result_; + return orig(result, options); + }).then(() => { + return result; + }); + }; + if (kind === "error") hook = (method, options) => { + return Promise.resolve().then(method.bind(null, options)).catch((error) => { + return orig(error, options); + }); + }; + state.registry[name].push({ + hook, + orig + }); +} +//#endregion +//#region ../../node_modules/.pnpm/before-after-hook@4.0.0/node_modules/before-after-hook/lib/remove.js +function removeHook(state, name, method) { + if (!state.registry[name]) return; + const index = state.registry[name].map((registered) => { + return registered.orig; + }).indexOf(method); + if (index === -1) return; + state.registry[name].splice(index, 1); +} +//#endregion +//#region ../../node_modules/.pnpm/before-after-hook@4.0.0/node_modules/before-after-hook/index.js +const bind = Function.bind; +const bindable = bind.bind(bind); +function bindApi(hook, state, name) { + const removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state]); + hook.api = { remove: removeHookRef }; + hook.remove = removeHookRef; + [ + "before", + "error", + "after", + "wrap" + ].forEach((kind) => { + const args = name ? [ + state, + kind, + name + ] : [state, kind]; + hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args); + }); +} +function Singular() { + const singularHookName = Symbol("Singular"); + const singularHookState = { registry: {} }; + const singularHook = register.bind(null, singularHookState, singularHookName); + bindApi(singularHook, singularHookState, singularHookName); + return singularHook; +} +function Collection() { + const state = { registry: {} }; + const hook = register.bind(null, state); + bindApi(hook, state); + return hook; +} +var before_after_hook_default = { + Singular, + Collection +}; +//#endregion +//#region ../../node_modules/.pnpm/@octokit+endpoint@11.0.2/node_modules/@octokit/endpoint/dist-bundle/index.js +var DEFAULTS = { + method: "GET", + baseUrl: "https://api.github.com", + headers: { + accept: "application/vnd.github.v3+json", + "user-agent": `octokit-endpoint.js/0.0.0-development ${getUserAgent()}` + }, + 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, options) { + const result = Object.assign({}, defaults); + Object.keys(options).forEach((key) => { + if (isPlainObject$1(options[key])) if (!(key in defaults)) Object.assign(result, { [key]: options[key] }); + else result[key] = mergeDeep(defaults[key], options[key]); + else Object.assign(result, { [key]: options[key] }); + }); + return result; +} +function removeUndefinedProperties(obj) { + for (const key in obj) if (obj[key] === void 0) delete obj[key]; + return obj; +} +function merge(defaults, route, options) { + if (typeof route === "string") { + let [method, url] = route.split(" "); + options = Object.assign(url ? { + method, + url + } : { url: method }, options); + } else options = Object.assign({}, route); + options.headers = lowercaseKeys(options.headers); + removeUndefinedProperties(options); + removeUndefinedProperties(options.headers); + const mergedOptions = mergeDeep(defaults || {}, options); + if (options.url === "/graphql") { + if (defaults && defaults.mediaType.previews?.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+)|(?:(? 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(context, operator, key, modifier) { + var value = context[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.bind(null, template) }; +} +function expand(template, context) { + 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(context, 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(options) { + let method = options.method.toUpperCase(); + let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}"); + let headers = Object.assign({}, options.headers); + let body; + let parameters = omit(options, [ + "method", + "baseUrl", + "url", + "headers", + "request", + "mediaType" + ]); + const urlVariableNames = extractUrlVariableNames(url); + url = parseUrl(url).expand(parameters); + if (!/^http/.test(url)) url = options.baseUrl + url; + const remainingParameters = omit(parameters, Object.keys(options).filter((option) => urlVariableNames.includes(option)).concat("baseUrl")); + if (!/application\/octet-stream/i.test(headers.accept)) { + if (options.mediaType.format) headers.accept = headers.accept.split(/,/).map((format) => format.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(","); + if (url.endsWith("/graphql")) { + if (options.mediaType.previews?.length) headers.accept = (headers.accept.match(/(? { + return `application/vnd.github.${preview}-preview${options.mediaType.format ? `.${options.mediaType.format}` : "+json"}`; + }).join(","); + } + } + if (["GET", "HEAD"].includes(method)) url = addQueryParameters(url, remainingParameters); + else if ("data" in remainingParameters) body = remainingParameters.data; + else if (Object.keys(remainingParameters).length) body = remainingParameters; + if (!headers["content-type"] && typeof body !== "undefined") headers["content-type"] = "application/json; charset=utf-8"; + if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") body = ""; + return Object.assign({ + method, + url, + headers + }, typeof body !== "undefined" ? { body } : null, options.request ? { request: options.request } : null); +} +function endpointWithDefaults(defaults, route, options) { + return parse(merge(defaults, route, options)); +} +function withDefaults$2(oldDefaults, newDefaults) { + const DEFAULTS2 = merge(oldDefaults, newDefaults); + const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2); + return Object.assign(endpoint2, { + DEFAULTS: DEFAULTS2, + defaults: withDefaults$2.bind(null, DEFAULTS2), + merge: merge.bind(null, DEFAULTS2), + parse + }); +} +var endpoint = withDefaults$2(null, DEFAULTS); +//#endregion +//#region ../../node_modules/.pnpm/@octokit+request-error@7.1.0/node_modules/@octokit/request-error/dist-src/index.js +var import_fast_content_type_parse = (/* @__PURE__ */ __commonJSMin(((exports, module) => { + const NullObject = function NullObject() {}; + NullObject.prototype = Object.create(null); + /** + * RegExp to match *( ";" parameter ) in RFC 7231 sec 3.1.1.1 + * + * parameter = token "=" ( token / quoted-string ) + * token = 1*tchar + * tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" + * / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~" + * / DIGIT / ALPHA + * ; any VCHAR, except delimiters + * quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE + * qdtext = HTAB / SP / %x21 / %x23-5B / %x5D-7E / obs-text + * obs-text = %x80-FF + * quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text ) + */ + const paramRE = /; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu; + /** + * RegExp to match quoted-pair in RFC 7230 sec 3.2.6 + * + * quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text ) + * obs-text = %x80-FF + */ + const quotedPairRE = /\\([\v\u0020-\u00ff])/gu; + /** + * RegExp to match type in RFC 7231 sec 3.1.1.1 + * + * media-type = type "/" subtype + * type = token + * subtype = token + */ + const mediaTypeRE = /^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u; + const defaultContentType = { + type: "", + parameters: new NullObject() + }; + Object.freeze(defaultContentType.parameters); + Object.freeze(defaultContentType); + /** + * Parse media type to object. + * + * @param {string|object} header + * @return {Object} + * @public + */ + function parse(header) { + if (typeof header !== "string") throw new TypeError("argument header is required and must be a string"); + let index = header.indexOf(";"); + const type = index !== -1 ? header.slice(0, index).trim() : header.trim(); + if (mediaTypeRE.test(type) === false) throw new TypeError("invalid media type"); + const result = { + type: type.toLowerCase(), + parameters: new NullObject() + }; + if (index === -1) return result; + let key; + let match; + let value; + paramRE.lastIndex = index; + while (match = paramRE.exec(header)) { + if (match.index !== index) throw new TypeError("invalid parameter format"); + index += match[0].length; + key = match[1].toLowerCase(); + value = match[2]; + if (value[0] === "\"") { + value = value.slice(1, value.length - 1); + quotedPairRE.test(value) && (value = value.replace(quotedPairRE, "$1")); + } + result.parameters[key] = value; + } + if (index !== header.length) throw new TypeError("invalid parameter format"); + return result; + } + function safeParse(header) { + if (typeof header !== "string") return defaultContentType; + let index = header.indexOf(";"); + const type = index !== -1 ? header.slice(0, index).trim() : header.trim(); + if (mediaTypeRE.test(type) === false) return defaultContentType; + const result = { + type: type.toLowerCase(), + parameters: new NullObject() + }; + if (index === -1) return result; + let key; + let match; + let value; + paramRE.lastIndex = index; + while (match = paramRE.exec(header)) { + if (match.index !== index) return defaultContentType; + index += match[0].length; + key = match[1].toLowerCase(); + value = match[2]; + if (value[0] === "\"") { + value = value.slice(1, value.length - 1); + quotedPairRE.test(value) && (value = value.replace(quotedPairRE, "$1")); + } + result.parameters[key] = value; + } + if (index !== header.length) return defaultContentType; + return result; + } + module.exports.default = { + parse, + safeParse + }; + module.exports.parse = parse; + module.exports.safeParse = safeParse; + module.exports.defaultContentType = defaultContentType; +})))(); +var RequestError = class extends Error { + name; + /** + * http status code + */ + status; + /** + * Request options that lead to the error. + */ + request; + /** + * Response object if a response was received + */ + response; + constructor(message, statusCode, options) { + super(message, { cause: options.cause }); + this.name = "HttpError"; + this.status = Number.parseInt(statusCode); + if (Number.isNaN(this.status)) this.status = 0; + /* v8 ignore else -- @preserve -- Bug with vitest coverage where it sees an else branch that doesn't exist */ + if ("response" in options) this.response = options.response; + const requestCopy = Object.assign({}, options.request); + if (options.request.headers.authorization) requestCopy.headers = Object.assign({}, options.request.headers, { authorization: options.request.headers.authorization.replace(/(? ""; +async function fetchWrapper(requestOptions) { + const fetch = requestOptions.request?.fetch || globalThis.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"); + const log = requestOptions.request?.log || console; + const parseSuccessResponseBody = requestOptions.request?.parseSuccessResponseBody !== false; + const body = isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body) ? JSON.stringify(requestOptions.body) : requestOptions.body; + const requestHeaders = Object.fromEntries(Object.entries(requestOptions.headers).map(([name, value]) => [name, String(value)])); + let fetchResponse; + try { + fetchResponse = await fetch(requestOptions.url, { + method: requestOptions.method, + body, + redirect: requestOptions.request?.redirect, + headers: requestHeaders, + signal: requestOptions.request?.signal, + ...requestOptions.body && { duplex: "half" } + }); + } catch (error) { + let message = "Unknown Error"; + if (error instanceof Error) { + if (error.name === "AbortError") { + error.status = 500; + throw error; + } + message = error.message; + if (error.name === "TypeError" && "cause" in error) { + if (error.cause instanceof Error) message = error.cause.message; + else if (typeof error.cause === "string") message = error.cause; + } + } + const requestError = new RequestError(message, 500, { request: requestOptions }); + requestError.cause = error; + throw requestError; + } + const status = fetchResponse.status; + const url = fetchResponse.url; + const responseHeaders = {}; + for (const [key, value] of fetchResponse.headers) responseHeaders[key] = value; + const octokitResponse = { + url, + status, + headers: responseHeaders, + data: "" + }; + if ("deprecation" in responseHeaders) { + const matches = responseHeaders.link && responseHeaders.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 ${responseHeaders.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`); + } + if (status === 204 || status === 205) return octokitResponse; + if (requestOptions.method === "HEAD") { + if (status < 400) return octokitResponse; + throw new RequestError(fetchResponse.statusText, status, { + response: octokitResponse, + request: requestOptions + }); + } + if (status === 304) { + octokitResponse.data = await getResponseData(fetchResponse); + throw new RequestError("Not modified", status, { + response: octokitResponse, + request: requestOptions + }); + } + if (status >= 400) { + octokitResponse.data = await getResponseData(fetchResponse); + throw new RequestError(toErrorMessage(octokitResponse.data), status, { + response: octokitResponse, + request: requestOptions + }); + } + octokitResponse.data = parseSuccessResponseBody ? await getResponseData(fetchResponse) : fetchResponse.body; + return octokitResponse; +} +async function getResponseData(response) { + const contentType = response.headers.get("content-type"); + if (!contentType) return response.text().catch(noop$1); + const mimetype = (0, import_fast_content_type_parse.safeParse)(contentType); + if (isJSONResponse(mimetype)) { + let text = ""; + try { + text = await response.text(); + return JSON.parse(text); + } catch (err) { + return text; + } + } else if (mimetype.type.startsWith("text/") || mimetype.parameters.charset?.toLowerCase() === "utf-8") return response.text().catch(noop$1); + else return response.arrayBuffer().catch( + /* v8 ignore next -- @preserve */ + () => /* @__PURE__ */ new ArrayBuffer(0) + ); +} +function isJSONResponse(mimetype) { + return mimetype.type === "application/json" || mimetype.type === "application/scim+json"; +} +function toErrorMessage(data) { + if (typeof data === "string") return data; + if (data instanceof ArrayBuffer) return "Unknown error"; + if ("message" in data) { + const suffix = "documentation_url" in data ? ` - ${data.documentation_url}` : ""; + return Array.isArray(data.errors) ? `${data.message}: ${data.errors.map((v) => JSON.stringify(v)).join(", ")}${suffix}` : `${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, defaults_default); +/* v8 ignore next -- @preserve */ +/* v8 ignore else -- @preserve */ +//#endregion +//#region ../../node_modules/.pnpm/@octokit+graphql@9.0.3/node_modules/@octokit/graphql/dist-bundle/index.js +var VERSION$3 = "0.0.0-development"; +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, headers, response) { + super(_buildMessageForResponseErrors(response)); + this.request = request2; + this.headers = headers; + this.response = response; + this.errors = response.errors; + this.data = response.data; + if (Error.captureStackTrace) Error.captureStackTrace(this, this.constructor); + } + name = "GraphqlResponseError"; + errors; + data; +}; +var NON_VARIABLE_OPTIONS = [ + "method", + "baseUrl", + "url", + "headers", + "request", + "query", + "mediaType", + "operationName" +]; +var FORBIDDEN_VARIABLE_OPTIONS = [ + "query", + "method", + "url" +]; +var GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/; +function graphql(request2, query, options) { + if (options) { + if (typeof query === "string" && "query" in options) return Promise.reject(/* @__PURE__ */ new Error(`[@octokit/graphql] "query" cannot be used as variable name`)); + for (const key in options) { + if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key)) continue; + return Promise.reject(/* @__PURE__ */ new Error(`[@octokit/graphql] "${key}" cannot be used as variable name`)); + } + } + const parsedOptions = typeof query === "string" ? Object.assign({ query }, options) : 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((response) => { + if (response.data.errors) { + const headers = {}; + for (const key of Object.keys(response.headers)) headers[key] = response.headers[key]; + throw new GraphqlResponseError(requestOptions, headers, response.data); + } + return response.data.data; + }); +} +function withDefaults(request2, newDefaults) { + const newRequest = request2.defaults(newDefaults); + const newApi = (query, options) => { + return graphql(newRequest, query, options); + }; + 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" + }); +} +//#endregion +//#region ../../node_modules/.pnpm/@octokit+auth-token@6.0.0/node_modules/@octokit/auth-token/dist-bundle/index.js +var b64url = "(?:[a-zA-Z0-9_-]+)"; +var sep = "\\."; +var jwtRE = new RegExp(`^${b64url}${sep}${b64url}${sep}${b64url}$`); +var isJWT = jwtRE.test.bind(jwtRE); +async function auth(token) { + const isApp = isJWT(token); + const isInstallation = token.startsWith("v1.") || token.startsWith("ghs_"); + const isUserToServer = token.startsWith("ghu_"); + return { + type: "token", + token, + tokenType: isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth" + }; +} +function withAuthorizationPrefix(token) { + if (token.split(/\./).length === 3) return `bearer ${token}`; + return `token ${token}`; +} +async function hook(token, request, route, parameters) { + const endpoint = request.endpoint.merge(route, parameters); + endpoint.headers.authorization = withAuthorizationPrefix(token); + return request(endpoint); +} +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.bind(null, token), { hook: hook.bind(null, token) }); +}; +//#endregion +//#region ../../node_modules/.pnpm/@octokit+core@7.0.6/node_modules/@octokit/core/dist-src/version.js +const VERSION$2 = "7.0.6"; +//#endregion +//#region ../../node_modules/.pnpm/@octokit+core@7.0.6/node_modules/@octokit/core/dist-src/index.js +const noop = () => {}; +const consoleWarn = console.warn.bind(console); +const consoleError = console.error.bind(console); +function createLogger(logger = {}) { + if (typeof logger.debug !== "function") logger.debug = noop; + if (typeof logger.info !== "function") logger.info = noop; + if (typeof logger.warn !== "function") logger.warn = consoleWarn; + if (typeof logger.error !== "function") logger.error = consoleError; + return logger; +} +const userAgentTrail = `octokit-core.js/${VERSION$2} ${getUserAgent()}`; +var Octokit = class { + static VERSION = VERSION$2; + static defaults(defaults) { + const OctokitWithDefaults = class extends this { + constructor(...args) { + const options = args[0] || {}; + if (typeof defaults === "function") { + super(defaults(options)); + return; + } + super(Object.assign({}, defaults, options, options.userAgent && defaults.userAgent ? { userAgent: `${options.userAgent} ${defaults.userAgent}` } : null)); + } + }; + return OctokitWithDefaults; + } + static plugins = []; + /** + * Attach a plugin (or many) to your Octokit instance. + * + * @example + * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...) + */ + static plugin(...newPlugins) { + const currentPlugins = this.plugins; + const NewOctokit = class extends this { + static plugins = currentPlugins.concat(newPlugins.filter((plugin) => !currentPlugins.includes(plugin))); + }; + return NewOctokit; + } + constructor(options = {}) { + const hook = new before_after_hook_default.Collection(); + const requestDefaults = { + baseUrl: request.endpoint.DEFAULTS.baseUrl, + headers: {}, + request: Object.assign({}, options.request, { hook: hook.bind(null, "request") }), + mediaType: { + previews: [], + format: "" + } + }; + requestDefaults.headers["user-agent"] = options.userAgent ? `${options.userAgent} ${userAgentTrail}` : userAgentTrail; + if (options.baseUrl) requestDefaults.baseUrl = options.baseUrl; + if (options.previews) requestDefaults.mediaType.previews = options.previews; + if (options.timeZone) requestDefaults.headers["time-zone"] = options.timeZone; + this.request = request.defaults(requestDefaults); + this.graphql = withCustomRequest(this.request).defaults(requestDefaults); + this.log = createLogger(options.log); + this.hook = hook; + if (!options.authStrategy) if (!options.auth) this.auth = async () => ({ type: "unauthenticated" }); + else { + const auth = createTokenAuth(options.auth); + hook.wrap("request", auth.hook); + this.auth = auth; + } + else { + const { authStrategy, ...otherOptions } = options; + const auth = authStrategy(Object.assign({ + request: this.request, + log: this.log, + octokit: this, + octokitOptions: otherOptions + }, options.auth)); + hook.wrap("request", auth.hook); + this.auth = auth; + } + const classConstructor = this.constructor; + for (let i = 0; i < classConstructor.plugins.length; ++i) Object.assign(this, classConstructor.plugins[i](this, options)); + } + request; + graphql; + log; + hook; + auth; +}; +//#endregion +//#region ../../node_modules/.pnpm/@octokit+plugin-rest-endpoint-methods@17.0.0_@octokit+core@7.0.6/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js +const VERSION$1 = "17.0.0"; +//#endregion +//#region ../../node_modules/.pnpm/@octokit+plugin-rest-endpoint-methods@17.0.0_@octokit+core@7.0.6/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js +var endpoints_default = { + actions: { + addCustomLabelsToSelfHostedRunnerForOrg: ["POST /orgs/{org}/actions/runners/{runner_id}/labels"], + addCustomLabelsToSelfHostedRunnerForRepo: ["POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"], + addRepoAccessToSelfHostedRunnerGroupInOrg: ["PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}"], + 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 /repos/{owner}/{repo}/environments/{environment_name}/variables"], + createHostedRunnerForOrg: ["POST /orgs/{org}/actions/hosted-runners"], + createOrUpdateEnvironmentSecret: ["PUT /repos/{owner}/{repo}/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}"], + deleteCustomImageFromOrg: ["DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}"], + deleteCustomImageVersionFromOrg: ["DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}"], + deleteEnvironmentSecret: ["DELETE /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"], + deleteEnvironmentVariable: ["DELETE /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"], + deleteHostedRunnerForOrg: ["DELETE /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"], + 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}"], + getCustomImageForOrg: ["GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}"], + getCustomImageVersionForOrg: ["GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}"], + getCustomOidcSubClaimForRepo: ["GET /repos/{owner}/{repo}/actions/oidc/customization/sub"], + getEnvironmentPublicKey: ["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/public-key"], + getEnvironmentSecret: ["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"], + getEnvironmentVariable: ["GET /repos/{owner}/{repo}/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"], + getHostedRunnerForOrg: ["GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"], + getHostedRunnersGithubOwnedImagesForOrg: ["GET /orgs/{org}/actions/hosted-runners/images/github-owned"], + getHostedRunnersLimitsForOrg: ["GET /orgs/{org}/actions/hosted-runners/limits"], + getHostedRunnersMachineSpecsForOrg: ["GET /orgs/{org}/actions/hosted-runners/machine-sizes"], + getHostedRunnersPartnerImagesForOrg: ["GET /orgs/{org}/actions/hosted-runners/images/partner"], + getHostedRunnersPlatformsForOrg: ["GET /orgs/{org}/actions/hosted-runners/platforms"], + 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"], + listCustomImageVersionsForOrg: ["GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions"], + listCustomImagesForOrg: ["GET /orgs/{org}/actions/hosted-runners/images/custom"], + listEnvironmentSecrets: ["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets"], + listEnvironmentVariables: ["GET /repos/{owner}/{repo}/environments/{environment_name}/variables"], + listGithubHostedRunnersInGroupForOrg: ["GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners"], + listHostedRunnersForOrg: ["GET /orgs/{org}/actions/hosted-runners"], + 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 /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"], + updateHostedRunnerForOrg: ["PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"], + 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"], + getGithubBillingPremiumRequestUsageReportOrg: ["GET /organizations/{org}/settings/billing/premium_request/usage"], + getGithubBillingPremiumRequestUsageReportUser: ["GET /users/{username}/settings/billing/premium_request/usage"], + getGithubBillingUsageReportOrg: ["GET /organizations/{org}/settings/billing/usage"], + getGithubBillingUsageReportUser: ["GET /users/{username}/settings/billing/usage"], + 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"] + }, + campaigns: { + createCampaign: ["POST /orgs/{org}/campaigns"], + deleteCampaign: ["DELETE /orgs/{org}/campaigns/{campaign_number}"], + getCampaignSummary: ["GET /orgs/{org}/campaigns/{campaign_number}"], + listOrgCampaigns: ["GET /orgs/{org}/campaigns"], + updateCampaign: ["PATCH /orgs/{org}/campaigns/{campaign_number}"] + }, + 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: { + commitAutofix: ["POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits"], + createAutofix: ["POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix"], + createVariantAnalysis: ["POST /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses"], + deleteAnalysis: ["DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"], + deleteCodeqlDatabase: ["DELETE /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"], + 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}"], + getAutofix: ["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix"], + 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}"], + getVariantAnalysis: ["GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}"], + getVariantAnalysisRepoTask: ["GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}/repos/{repo_owner}/{repo_name}"], + 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"] + }, + codeSecurity: { + attachConfiguration: ["POST /orgs/{org}/code-security/configurations/{configuration_id}/attach"], + attachEnterpriseConfiguration: ["POST /enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach"], + createConfiguration: ["POST /orgs/{org}/code-security/configurations"], + createConfigurationForEnterprise: ["POST /enterprises/{enterprise}/code-security/configurations"], + deleteConfiguration: ["DELETE /orgs/{org}/code-security/configurations/{configuration_id}"], + deleteConfigurationForEnterprise: ["DELETE /enterprises/{enterprise}/code-security/configurations/{configuration_id}"], + detachConfiguration: ["DELETE /orgs/{org}/code-security/configurations/detach"], + getConfiguration: ["GET /orgs/{org}/code-security/configurations/{configuration_id}"], + getConfigurationForRepository: ["GET /repos/{owner}/{repo}/code-security-configuration"], + getConfigurationsForEnterprise: ["GET /enterprises/{enterprise}/code-security/configurations"], + getConfigurationsForOrg: ["GET /orgs/{org}/code-security/configurations"], + getDefaultConfigurations: ["GET /orgs/{org}/code-security/configurations/defaults"], + getDefaultConfigurationsForEnterprise: ["GET /enterprises/{enterprise}/code-security/configurations/defaults"], + getRepositoriesForConfiguration: ["GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories"], + getRepositoriesForEnterpriseConfiguration: ["GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories"], + getSingleConfigurationForEnterprise: ["GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}"], + setConfigurationAsDefault: ["PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults"], + setConfigurationAsDefaultForEnterprise: ["PUT /enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults"], + updateConfiguration: ["PATCH /orgs/{org}/code-security/configurations/{configuration_id}"], + updateEnterpriseConfiguration: ["PATCH /enterprises/{enterprise}/code-security/configurations/{configuration_id}"] + }, + 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"], + copilotMetricsForOrganization: ["GET /orgs/{org}/copilot/metrics"], + copilotMetricsForTeam: ["GET /orgs/{org}/team/{team_slug}/copilot/metrics"], + getCopilotOrganizationDetails: ["GET /orgs/{org}/copilot/billing"], + getCopilotSeatDetailsForUser: ["GET /orgs/{org}/members/{username}/copilot"], + listCopilotSeats: ["GET /orgs/{org}/copilot/billing/seats"] + }, + credentials: { revoke: ["POST /credentials/revoke"] }, + 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}"], + repositoryAccessForOrg: ["GET /organizations/{org}/dependabot/repository-access"], + setRepositoryAccessDefaultLevel: ["PUT /organizations/{org}/dependabot/repository-access/default-level"], + setSelectedReposForOrgSecret: ["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"], + updateAlert: ["PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"], + updateRepositoryAccessForOrg: ["PATCH /organizations/{org}/dependabot/repository-access"] + }, + 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"] }, + enterpriseTeamMemberships: { + add: ["PUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"], + bulkAdd: ["POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add"], + bulkRemove: ["POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove"], + get: ["GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"], + list: ["GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships"], + remove: ["DELETE /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"] + }, + enterpriseTeamOrganizations: { + add: ["PUT /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"], + bulkAdd: ["POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/add"], + bulkRemove: ["POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove"], + delete: ["DELETE /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"], + getAssignment: ["GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"], + getAssignments: ["GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations"] + }, + enterpriseTeams: { + create: ["POST /enterprises/{enterprise}/teams"], + delete: ["DELETE /enterprises/{enterprise}/teams/{team_slug}"], + get: ["GET /enterprises/{enterprise}/teams/{team_slug}"], + list: ["GET /enterprises/{enterprise}/teams"], + update: ["PATCH /enterprises/{enterprise}/teams/{team_slug}"] + }, + 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}"] + }, + hostedCompute: { + createNetworkConfigurationForOrg: ["POST /orgs/{org}/settings/network-configurations"], + deleteNetworkConfigurationFromOrg: ["DELETE /orgs/{org}/settings/network-configurations/{network_configuration_id}"], + getNetworkConfigurationForOrg: ["GET /orgs/{org}/settings/network-configurations/{network_configuration_id}"], + getNetworkSettingsForOrg: ["GET /orgs/{org}/settings/network-settings/{network_settings_id}"], + listNetworkConfigurationsForOrg: ["GET /orgs/{org}/settings/network-configurations"], + updateNetworkConfigurationForOrg: ["PATCH /orgs/{org}/settings/network-configurations/{network_configuration_id}"] + }, + 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"], + addBlockedByDependency: ["POST /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by"], + addLabels: ["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"], + addSubIssue: ["POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"], + 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}"], + getParent: ["GET /repos/{owner}/{repo}/issues/{issue_number}/parent"], + 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"], + listDependenciesBlockedBy: ["GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by"], + listDependenciesBlocking: ["GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking"], + 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"], + listSubIssues: ["GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"], + 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"], + removeDependencyBlockedBy: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}"], + removeLabel: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"], + removeSubIssue: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue"], + reprioritizeSubIssue: ["PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority"], + 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: { + 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"], + 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"] } + ], + startForAuthenticatedUser: ["POST /user/migrations"], + startForOrg: ["POST /orgs/{org}/migrations"], + unlockRepoForAuthenticatedUser: ["DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"], + unlockRepoForOrg: ["DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"] + }, + 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}", + {}, + { deprecated: "octokit.rest.orgs.addSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team" } + ], + 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}"], + createArtifactStorageRecord: ["POST /orgs/{org}/artifacts/metadata/storage-record"], + createInvitation: ["POST /orgs/{org}/invitations"], + createIssueType: ["POST /orgs/{org}/issue-types"], + createWebhook: ["POST /orgs/{org}/hooks"], + customPropertiesForOrgsCreateOrUpdateOrganizationValues: ["PATCH /organizations/{org}/org-properties/values"], + customPropertiesForOrgsGetOrganizationValues: ["GET /organizations/{org}/org-properties/values"], + customPropertiesForReposCreateOrUpdateOrganizationDefinition: ["PUT /orgs/{org}/properties/schema/{custom_property_name}"], + customPropertiesForReposCreateOrUpdateOrganizationDefinitions: ["PATCH /orgs/{org}/properties/schema"], + customPropertiesForReposCreateOrUpdateOrganizationValues: ["PATCH /orgs/{org}/properties/values"], + customPropertiesForReposDeleteOrganizationDefinition: ["DELETE /orgs/{org}/properties/schema/{custom_property_name}"], + customPropertiesForReposGetOrganizationDefinition: ["GET /orgs/{org}/properties/schema/{custom_property_name}"], + customPropertiesForReposGetOrganizationDefinitions: ["GET /orgs/{org}/properties/schema"], + customPropertiesForReposGetOrganizationValues: ["GET /orgs/{org}/properties/values"], + delete: ["DELETE /orgs/{org}"], + deleteAttestationsBulk: ["POST /orgs/{org}/attestations/delete-request"], + deleteAttestationsById: ["DELETE /orgs/{org}/attestations/{attestation_id}"], + deleteAttestationsBySubjectDigest: ["DELETE /orgs/{org}/attestations/digest/{subject_digest}"], + deleteIssueType: ["DELETE /orgs/{org}/issue-types/{issue_type_id}"], + deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"], + disableSelectedRepositoryImmutableReleasesOrganization: ["DELETE /orgs/{org}/settings/immutable-releases/repositories/{repository_id}"], + enableSelectedRepositoryImmutableReleasesOrganization: ["PUT /orgs/{org}/settings/immutable-releases/repositories/{repository_id}"], + get: ["GET /orgs/{org}"], + getImmutableReleasesSettings: ["GET /orgs/{org}/settings/immutable-releases"], + getImmutableReleasesSettingsRepositories: ["GET /orgs/{org}/settings/immutable-releases/repositories"], + getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"], + getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"], + getOrgRole: ["GET /orgs/{org}/organization-roles/{role_id}"], + getOrgRulesetHistory: ["GET /orgs/{org}/rulesets/{ruleset_id}/history"], + getOrgRulesetVersion: ["GET /orgs/{org}/rulesets/{ruleset_id}/history/{version_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"], + listArtifactStorageRecords: ["GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records"], + listAttestationRepositories: ["GET /orgs/{org}/attestations/repositories"], + listAttestations: ["GET /orgs/{org}/attestations/{subject_digest}"], + listAttestationsBulk: ["POST /orgs/{org}/attestations/bulk-list{?per_page,before,after}"], + listBlockedUsers: ["GET /orgs/{org}/blocks"], + listFailedInvitations: ["GET /orgs/{org}/failed_invitations"], + listForAuthenticatedUser: ["GET /user/orgs"], + listForUser: ["GET /users/{username}/orgs"], + listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"], + listIssueTypes: ["GET /orgs/{org}/issue-types"], + 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", + {}, + { deprecated: "octokit.rest.orgs.listSecurityManagerTeams() is deprecated, see https://docs.github.com/rest/orgs/security-managers#list-security-manager-teams" } + ], + listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"], + listWebhooks: ["GET /orgs/{org}/hooks"], + pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"], + redeliverWebhookDelivery: ["POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"], + 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}", + {}, + { deprecated: "octokit.rest.orgs.removeSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team" } + ], + 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}"], + setImmutableReleasesSettings: ["PUT /orgs/{org}/settings/immutable-releases"], + setImmutableReleasesSettingsRepositories: ["PUT /orgs/{org}/settings/immutable-releases/repositories"], + setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"], + setPublicMembershipForAuthenticatedUser: ["PUT /orgs/{org}/public_members/{username}"], + unblockUser: ["DELETE /orgs/{org}/blocks/{username}"], + update: ["PATCH /orgs/{org}"], + updateIssueType: ["PUT /orgs/{org}/issue-types/{issue_type_id}"], + 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"] + }, + privateRegistries: { + createOrgPrivateRegistry: ["POST /orgs/{org}/private-registries"], + deleteOrgPrivateRegistry: ["DELETE /orgs/{org}/private-registries/{secret_name}"], + getOrgPrivateRegistry: ["GET /orgs/{org}/private-registries/{secret_name}"], + getOrgPublicKey: ["GET /orgs/{org}/private-registries/public-key"], + listOrgPrivateRegistries: ["GET /orgs/{org}/private-registries"], + updateOrgPrivateRegistry: ["PATCH /orgs/{org}/private-registries/{secret_name}"] + }, + projects: { + addItemForOrg: ["POST /orgs/{org}/projectsV2/{project_number}/items"], + addItemForUser: ["POST /users/{username}/projectsV2/{project_number}/items"], + deleteItemForOrg: ["DELETE /orgs/{org}/projectsV2/{project_number}/items/{item_id}"], + deleteItemForUser: ["DELETE /users/{username}/projectsV2/{project_number}/items/{item_id}"], + getFieldForOrg: ["GET /orgs/{org}/projectsV2/{project_number}/fields/{field_id}"], + getFieldForUser: ["GET /users/{username}/projectsV2/{project_number}/fields/{field_id}"], + getForOrg: ["GET /orgs/{org}/projectsV2/{project_number}"], + getForUser: ["GET /users/{username}/projectsV2/{project_number}"], + getOrgItem: ["GET /orgs/{org}/projectsV2/{project_number}/items/{item_id}"], + getUserItem: ["GET /users/{username}/projectsV2/{project_number}/items/{item_id}"], + listFieldsForOrg: ["GET /orgs/{org}/projectsV2/{project_number}/fields"], + listFieldsForUser: ["GET /users/{username}/projectsV2/{project_number}/fields"], + listForOrg: ["GET /orgs/{org}/projectsV2"], + listForUser: ["GET /users/{username}/projectsV2"], + listItemsForOrg: ["GET /orgs/{org}/projectsV2/{project_number}/items"], + listItemsForUser: ["GET /users/{username}/projectsV2/{project_number}/items"], + updateItemForOrg: ["PATCH /orgs/{org}/projectsV2/{project_number}/items/{item_id}"], + updateItemForUser: ["PATCH /users/{username}/projectsV2/{project_number}/items/{item_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}"], + checkImmutableReleases: ["GET /repos/{owner}/{repo}/immutable-releases"], + checkPrivateVulnerabilityReporting: ["GET /repos/{owner}/{repo}/private-vulnerability-reporting"], + 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}"], + createAttestation: ["POST /repos/{owner}/{repo}/attestations"], + 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"], + 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"], + createUsingTemplate: ["POST /repos/{template_owner}/{template_repo}/generate"], + createWebhook: ["POST /repos/{owner}/{repo}/hooks"], + customPropertiesForReposCreateOrUpdateRepositoryValues: ["PATCH /repos/{owner}/{repo}/properties/values"], + customPropertiesForReposGetRepositoryValues: ["GET /repos/{owner}/{repo}/properties/values"], + 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}"], + 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}"], + disableImmutableReleases: ["DELETE /repos/{owner}/{repo}/immutable-releases"], + 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"], + enableImmutableReleases: ["PUT /repos/{owner}/{repo}/immutable-releases"], + 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}"], + 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}"], + getRepoRulesetHistory: ["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history"], + getRepoRulesetVersion: ["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_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"], + listAttestations: ["GET /repos/{owner}/{repo}/attestations/{subject_digest}"], + 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"], + 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: { + createPushProtectionBypass: ["POST /repos/{owner}/{repo}/secret-scanning/push-protection-bypasses"], + getAlert: ["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"], + getScanHistory: ["GET /repos/{owner}/{repo}/secret-scanning/scan-history"], + 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"], + listOrgPatternConfigs: ["GET /orgs/{org}/secret-scanning/pattern-configurations"], + updateAlert: ["PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"], + updateOrgPatternConfigs: ["PATCH /orgs/{org}/secret-scanning/pattern-configurations"] + }, + 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}"], + addOrUpdateRepoPermissionsInOrg: ["PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"], + 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"], + listReposInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos"], + removeMembershipForUserInOrg: ["DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"], + 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"], + deleteAttestationsBulk: ["POST /users/{username}/attestations/delete-request"], + deleteAttestationsById: ["DELETE /users/{username}/attestations/{attestation_id}"], + deleteAttestationsBySubjectDigest: ["DELETE /users/{username}/attestations/digest/{subject_digest}"], + 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"], + getById: ["GET /user/{account_id}"], + 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"], + listAttestations: ["GET /users/{username}/attestations/{subject_digest}"], + listAttestationsBulk: ["POST /users/{username}/attestations/bulk-list{?per_page,before,after}"], + 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"] + } +}; +//#endregion +//#region ../../node_modules/.pnpm/@octokit+plugin-rest-endpoint-methods@17.0.0_@octokit+core@7.0.6/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js +const endpointMethodsMap = /* @__PURE__ */ new Map(); +for (const [scope, endpoints] of Object.entries(endpoints_default)) for (const [methodName, endpoint] of Object.entries(endpoints)) { + const [route, defaults, decorations] = endpoint; + 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 + }); +} +const handler = { + has({ scope }, methodName) { + return endpointMethodsMap.get(scope).has(methodName); + }, + getOwnPropertyDescriptor(target, methodName) { + return { + value: this.get(target, methodName), + 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 }, methodName) { + if (cache[methodName]) return cache[methodName]; + const method = endpointMethodsMap.get(scope).get(methodName); + if (!method) return; + const { endpointDefaults, decorations } = method; + if (decorations) cache[methodName] = decorate(octokit, scope, methodName, endpointDefaults, decorations); + else cache[methodName] = octokit.request.defaults(endpointDefaults); + return cache[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 options = requestWithDefaults.endpoint.merge(...args); + if (decorations.mapToData) { + options = Object.assign({}, options, { + data: options[decorations.mapToData], + [decorations.mapToData]: void 0 + }); + return requestWithDefaults(options); + } + 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 options2 = requestWithDefaults.endpoint.merge(...args); + for (const [name, alias] of Object.entries(decorations.renamedParameters)) if (name in options2) { + octokit.log.warn(`"${name}" parameter is deprecated for "octokit.${scope}.${methodName}()". Use "${alias}" instead`); + if (!(alias in options2)) options2[alias] = options2[name]; + delete options2[name]; + } + return requestWithDefaults(options2); + } + return requestWithDefaults(...args); + } + return Object.assign(withDecorations, requestWithDefaults); +} +//#endregion +//#region ../../node_modules/.pnpm/@octokit+plugin-rest-endpoint-methods@17.0.0_@octokit+core@7.0.6/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js +function restEndpointMethods(octokit) { + return { rest: endpointsToMethods(octokit) }; +} +restEndpointMethods.VERSION = VERSION$1; +function legacyRestEndpointMethods(octokit) { + const api = endpointsToMethods(octokit); + return { + ...api, + rest: api + }; +} +legacyRestEndpointMethods.VERSION = VERSION$1; +//#endregion +//#region ../../node_modules/.pnpm/@octokit+plugin-paginate-rest@14.0.0_@octokit+core@7.0.6/node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js +var VERSION = "0.0.0-development"; +function normalizePaginatedListResponse(response) { + if (!response.data) return { + ...response, + data: [] + }; + if (!(("total_count" in response.data || "total_commits" in response.data) && !("url" in response.data))) return response; + const incompleteResults = response.data.incomplete_results; + const repositorySelection = response.data.repository_selection; + const totalCount = response.data.total_count; + const totalCommits = response.data.total_commits; + delete response.data.incomplete_results; + delete response.data.repository_selection; + delete response.data.total_count; + delete response.data.total_commits; + const namespaceKey = Object.keys(response.data)[0]; + response.data = response.data[namespaceKey]; + if (typeof incompleteResults !== "undefined") response.data.incomplete_results = incompleteResults; + if (typeof repositorySelection !== "undefined") response.data.repository_selection = repositorySelection; + response.data.total_count = totalCount; + response.data.total_commits = totalCommits; + return response; +} +function iterator(octokit, route, parameters) { + const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters); + const requestMethod = typeof route === "function" ? route : octokit.request; + const method = options.method; + const headers = options.headers; + let url = options.url; + return { [Symbol.asyncIterator]: () => ({ async next() { + if (!url) return { done: true }; + try { + const normalizedResponse = normalizePaginatedListResponse(await requestMethod({ + method, + url, + headers + })); + url = ((normalizedResponse.headers.link || "").match(/<([^<>]+)>;\s*rel="next"/) || [])[1]; + if (!url && "total_commits" in normalizedResponse.data) { + const parsedUrl = new URL(normalizedResponse.url); + const params = parsedUrl.searchParams; + const page = parseInt(params.get("page") || "1", 10); + if (page * parseInt(params.get("per_page") || "250", 10) < normalizedResponse.data.total_commits) { + params.set("page", String(page + 1)); + url = parsedUrl.toString(); + } + } + return { value: normalizedResponse }; + } catch (error) { + if (error.status !== 409) throw error; + 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(octokit, route, parameters)[Symbol.asyncIterator](), mapFn); +} +function gather(octokit, results, iterator2, mapFn) { + return iterator2.next().then((result) => { + if (result.done) return results; + let earlyExit = false; + function done() { + earlyExit = true; + } + results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data); + if (earlyExit) return results; + return gather(octokit, results, iterator2, mapFn); + }); +} +Object.assign(paginate, { iterator }); +function paginateRest(octokit) { + return { paginate: Object.assign(paginate.bind(null, octokit), { iterator: iterator.bind(null, octokit) }) }; +} +paginateRest.VERSION = VERSION; +new Context(); +const baseUrl = getApiBaseUrl(); +const defaults = { + baseUrl, + request: { + agent: getProxyAgent(baseUrl), + fetch: getProxyFetch(baseUrl) + } +}; +const GitHub = Octokit.plugin(restEndpointMethods, paginateRest).defaults(defaults); +/** +* Convience function to correctly format Octokit Options to pass into the constructor. +* +* @param token the repo PAT or GITHUB_TOKEN +* @param options other options to set +*/ +function getOctokitOptions(token, options) { + const opts = Object.assign({}, options || {}); + const auth = getAuthString(token, opts); + if (auth) opts.auth = auth; + const userAgent = getUserAgentWithOrchestrationId(opts.userAgent); + if (userAgent) opts.userAgent = userAgent; + return opts; +} +//#endregion +//#region ../../node_modules/.pnpm/@actions+github@9.1.0/node_modules/@actions/github/lib/github.js +const context = new Context(); +/** +* Returns a hydrated octokit ready to use for GitHub Actions +* +* @param token the repo PAT or GITHUB_TOKEN +* @param options other options to set +*/ +function getOctokit(token, options, ...additionalPlugins) { + return new (GitHub.plugin(...additionalPlugins))(getOctokitOptions(token, options)); +} +//#endregion +//#region ../../node_modules/.pnpm/@pnpm+constants@1001.3.1/node_modules/@pnpm/constants/lib/index.js +var require_lib$6 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.USEFUL_NON_ROOT_PNPM_FIELDS = exports.FULL_FILTERED_META_DIR = exports.FULL_META_DIR = exports.ABBREVIATED_META_DIR = exports.WORKSPACE_MANIFEST_FILENAME = exports.STORE_VERSION = exports.LAYOUT_VERSION = exports.ENGINE_NAME = exports.MANIFEST_BASE_NAMES = exports.LOCKFILE_VERSION = exports.LOCKFILE_MAJOR_VERSION = exports.WANTED_LOCKFILE = void 0; + exports.getNodeBinLocationForCurrentOS = getNodeBinLocationForCurrentOS; + exports.getDenoBinLocationForCurrentOS = getDenoBinLocationForCurrentOS; + exports.getBunBinLocationForCurrentOS = getBunBinLocationForCurrentOS; + exports.WANTED_LOCKFILE = "pnpm-lock.yaml"; + exports.LOCKFILE_MAJOR_VERSION = "9"; + exports.LOCKFILE_VERSION = `${exports.LOCKFILE_MAJOR_VERSION}.0`; + exports.MANIFEST_BASE_NAMES = [ + "package.json", + "package.json5", + "package.yaml" + ]; + exports.ENGINE_NAME = `${process.platform};${process.arch};node${process.version.split(".")[0].substring(1)}`; + exports.LAYOUT_VERSION = 5; + exports.STORE_VERSION = "v10"; + exports.WORKSPACE_MANIFEST_FILENAME = "pnpm-workspace.yaml"; + exports.ABBREVIATED_META_DIR = "metadata-v1.3"; + exports.FULL_META_DIR = "metadata-full-v1.3"; + exports.FULL_FILTERED_META_DIR = "metadata-ff-v1.3"; + exports.USEFUL_NON_ROOT_PNPM_FIELDS = ["executionEnv"]; + function getNodeBinLocationForCurrentOS(platform = process.platform) { + return platform === "win32" ? "node.exe" : "bin/node"; + } + function getDenoBinLocationForCurrentOS(platform = process.platform) { + return platform === "win32" ? "deno.exe" : "deno"; + } + function getBunBinLocationForCurrentOS(platform = process.platform) { + return platform === "win32" ? "bun.exe" : "bun"; + } +})); +//#endregion +//#region ../../node_modules/.pnpm/strip-bom@4.0.0/node_modules/strip-bom/index.js +var require_strip_bom = /* @__PURE__ */ __commonJSMin(((exports, module) => { + module.exports = (string) => { + if (typeof string !== "string") throw new TypeError(`Expected a string, got ${typeof string}`); + if (string.charCodeAt(0) === 65279) return string.slice(1); + return string; + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/common.js +var require_common = /* @__PURE__ */ __commonJSMin(((exports, module) => { + function isNothing(subject) { + return typeof subject === "undefined" || subject === null; + } + function isObject(subject) { + return typeof subject === "object" && subject !== null; + } + function toArray(sequence) { + if (Array.isArray(sequence)) return sequence; + else if (isNothing(sequence)) return []; + return [sequence]; + } + function extend(target, source) { + var index, length, key, sourceKeys; + if (source) { + sourceKeys = Object.keys(source); + for (index = 0, length = sourceKeys.length; index < length; index += 1) { + key = sourceKeys[index]; + target[key] = source[key]; + } + } + return target; + } + function repeat(string, count) { + var result = "", cycle; + for (cycle = 0; cycle < count; cycle += 1) result += string; + return result; + } + function isNegativeZero(number) { + return number === 0 && Number.NEGATIVE_INFINITY === 1 / number; + } + module.exports.isNothing = isNothing; + module.exports.isObject = isObject; + module.exports.toArray = toArray; + module.exports.repeat = repeat; + module.exports.isNegativeZero = isNegativeZero; + module.exports.extend = extend; +})); +//#endregion +//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/exception.js +var require_exception = /* @__PURE__ */ __commonJSMin(((exports, module) => { + function formatError(exception, compact) { + var where = "", message = exception.reason || "(unknown reason)"; + if (!exception.mark) return message; + if (exception.mark.name) where += "in \"" + exception.mark.name + "\" "; + where += "(" + (exception.mark.line + 1) + ":" + (exception.mark.column + 1) + ")"; + if (!compact && exception.mark.snippet) where += "\n\n" + exception.mark.snippet; + return message + " " + where; + } + function YAMLException(reason, mark) { + Error.call(this); + this.name = "YAMLException"; + this.reason = reason; + this.mark = mark; + this.message = formatError(this, false); + if (Error.captureStackTrace) Error.captureStackTrace(this, this.constructor); + else this.stack = (/* @__PURE__ */ new Error()).stack || ""; + } + YAMLException.prototype = Object.create(Error.prototype); + YAMLException.prototype.constructor = YAMLException; + YAMLException.prototype.toString = function toString(compact) { + return this.name + ": " + formatError(this, compact); + }; + module.exports = YAMLException; +})); +//#endregion +//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/snippet.js +var require_snippet = /* @__PURE__ */ __commonJSMin(((exports, module) => { + var common = require_common(); + function getLine(buffer, lineStart, lineEnd, position, maxLineLength) { + var head = ""; + var tail = ""; + var maxHalfLength = Math.floor(maxLineLength / 2) - 1; + if (position - lineStart > maxHalfLength) { + head = " ... "; + lineStart = position - maxHalfLength + head.length; + } + if (lineEnd - position > maxHalfLength) { + tail = " ..."; + lineEnd = position + maxHalfLength - tail.length; + } + return { + str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, "→") + tail, + pos: position - lineStart + head.length + }; + } + function padStart(string, max) { + return common.repeat(" ", max - string.length) + string; + } + function makeSnippet(mark, options) { + options = Object.create(options || null); + if (!mark.buffer) return null; + if (!options.maxLength) options.maxLength = 79; + if (typeof options.indent !== "number") options.indent = 1; + if (typeof options.linesBefore !== "number") options.linesBefore = 3; + if (typeof options.linesAfter !== "number") options.linesAfter = 2; + var re = /\r?\n|\r|\0/g; + var lineStarts = [0]; + var lineEnds = []; + var match; + var foundLineNo = -1; + while (match = re.exec(mark.buffer)) { + lineEnds.push(match.index); + lineStarts.push(match.index + match[0].length); + if (mark.position <= match.index && foundLineNo < 0) foundLineNo = lineStarts.length - 2; + } + if (foundLineNo < 0) foundLineNo = lineStarts.length - 1; + var result = "", i, line; + var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length; + var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3); + for (i = 1; i <= options.linesBefore; i++) { + if (foundLineNo - i < 0) break; + line = getLine(mark.buffer, lineStarts[foundLineNo - i], lineEnds[foundLineNo - i], mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]), maxLineLength); + result = common.repeat(" ", options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) + " | " + line.str + "\n" + result; + } + line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength); + result += common.repeat(" ", options.indent) + padStart((mark.line + 1).toString(), lineNoLength) + " | " + line.str + "\n"; + result += common.repeat("-", options.indent + lineNoLength + 3 + line.pos) + "^\n"; + for (i = 1; i <= options.linesAfter; i++) { + if (foundLineNo + i >= lineEnds.length) break; + line = getLine(mark.buffer, lineStarts[foundLineNo + i], lineEnds[foundLineNo + i], mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]), maxLineLength); + result += common.repeat(" ", options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) + " | " + line.str + "\n"; + } + return result.replace(/\n$/, ""); + } + module.exports = makeSnippet; +})); +//#endregion +//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/type.js +var require_type$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + var YAMLException = require_exception(); + var TYPE_CONSTRUCTOR_OPTIONS = [ + "kind", + "multi", + "resolve", + "construct", + "instanceOf", + "predicate", + "represent", + "representName", + "defaultStyle", + "styleAliases" + ]; + var YAML_NODE_KINDS = [ + "scalar", + "sequence", + "mapping" + ]; + function compileStyleAliases(map) { + var result = {}; + if (map !== null) Object.keys(map).forEach(function(style) { + map[style].forEach(function(alias) { + result[String(alias)] = style; + }); + }); + return result; + } + function Type(tag, options) { + options = options || {}; + Object.keys(options).forEach(function(name) { + if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) throw new YAMLException("Unknown option \"" + name + "\" is met in definition of \"" + tag + "\" YAML type."); + }); + this.options = options; + this.tag = tag; + this.kind = options["kind"] || null; + this.resolve = options["resolve"] || function() { + return true; + }; + this.construct = options["construct"] || function(data) { + return data; + }; + this.instanceOf = options["instanceOf"] || null; + this.predicate = options["predicate"] || null; + this.represent = options["represent"] || null; + this.representName = options["representName"] || null; + this.defaultStyle = options["defaultStyle"] || null; + this.multi = options["multi"] || false; + this.styleAliases = compileStyleAliases(options["styleAliases"] || null); + if (YAML_NODE_KINDS.indexOf(this.kind) === -1) throw new YAMLException("Unknown kind \"" + this.kind + "\" is specified for \"" + tag + "\" YAML type."); + } + module.exports = Type; +})); +//#endregion +//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/schema.js +var require_schema$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + var YAMLException = require_exception(); + var Type = require_type$1(); + function compileList(schema, name) { + var result = []; + schema[name].forEach(function(currentType) { + var newIndex = result.length; + result.forEach(function(previousType, previousIndex) { + if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) newIndex = previousIndex; + }); + result[newIndex] = currentType; + }); + return result; + } + function compileMap() { + var result = { + scalar: {}, + sequence: {}, + mapping: {}, + fallback: {}, + multi: { + scalar: [], + sequence: [], + mapping: [], + fallback: [] + } + }, index, length; + function collectType(type) { + if (type.multi) { + result.multi[type.kind].push(type); + result.multi["fallback"].push(type); + } else result[type.kind][type.tag] = result["fallback"][type.tag] = type; + } + for (index = 0, length = arguments.length; index < length; index += 1) arguments[index].forEach(collectType); + return result; + } + function Schema(definition) { + return this.extend(definition); + } + Schema.prototype.extend = function extend(definition) { + var implicit = []; + var explicit = []; + if (definition instanceof Type) explicit.push(definition); + else if (Array.isArray(definition)) explicit = explicit.concat(definition); + else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) { + if (definition.implicit) implicit = implicit.concat(definition.implicit); + if (definition.explicit) explicit = explicit.concat(definition.explicit); + } else throw new YAMLException("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })"); + implicit.forEach(function(type) { + if (!(type instanceof Type)) throw new YAMLException("Specified list of YAML types (or a single Type object) contains a non-Type object."); + if (type.loadKind && type.loadKind !== "scalar") throw new YAMLException("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported."); + if (type.multi) throw new YAMLException("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit."); + }); + explicit.forEach(function(type) { + if (!(type instanceof Type)) throw new YAMLException("Specified list of YAML types (or a single Type object) contains a non-Type object."); + }); + var result = Object.create(Schema.prototype); + result.implicit = (this.implicit || []).concat(implicit); + result.explicit = (this.explicit || []).concat(explicit); + result.compiledImplicit = compileList(result, "implicit"); + result.compiledExplicit = compileList(result, "explicit"); + result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit); + return result; + }; + module.exports = Schema; +})); +//#endregion +//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/type/str.js +var require_str = /* @__PURE__ */ __commonJSMin(((exports, module) => { + module.exports = new (require_type$1())("tag:yaml.org,2002:str", { + kind: "scalar", + construct: function(data) { + return data !== null ? data : ""; + } + }); +})); +//#endregion +//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/type/seq.js +var require_seq$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + module.exports = new (require_type$1())("tag:yaml.org,2002:seq", { + kind: "sequence", + construct: function(data) { + return data !== null ? data : []; + } + }); +})); +//#endregion +//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/type/map.js +var require_map$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + module.exports = new (require_type$1())("tag:yaml.org,2002:map", { + kind: "mapping", + construct: function(data) { + return data !== null ? data : {}; + } + }); +})); +//#endregion +//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/schema/failsafe.js +var require_failsafe = /* @__PURE__ */ __commonJSMin(((exports, module) => { + module.exports = new (require_schema$3())({ explicit: [ + require_str(), + require_seq$1(), + require_map$1() + ] }); +})); +//#endregion +//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/type/null.js +var require_null$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + var Type = require_type$1(); + function resolveYamlNull(data) { + if (data === null) return true; + var max = data.length; + return max === 1 && data === "~" || max === 4 && (data === "null" || data === "Null" || data === "NULL"); + } + function constructYamlNull() { + return null; + } + function isNull(object) { + return object === null; + } + module.exports = new Type("tag:yaml.org,2002:null", { + kind: "scalar", + resolve: resolveYamlNull, + construct: constructYamlNull, + predicate: isNull, + represent: { + canonical: function() { + return "~"; + }, + lowercase: function() { + return "null"; + }, + uppercase: function() { + return "NULL"; + }, + camelcase: function() { + return "Null"; + }, + empty: function() { + return ""; + } + }, + defaultStyle: "lowercase" + }); +})); +//#endregion +//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/type/bool.js +var require_bool$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + var Type = require_type$1(); + function resolveYamlBoolean(data) { + if (data === null) return false; + var max = data.length; + return max === 4 && (data === "true" || data === "True" || data === "TRUE") || max === 5 && (data === "false" || data === "False" || data === "FALSE"); + } + function constructYamlBoolean(data) { + return data === "true" || data === "True" || data === "TRUE"; + } + function isBoolean(object) { + return Object.prototype.toString.call(object) === "[object Boolean]"; + } + module.exports = new Type("tag:yaml.org,2002:bool", { + kind: "scalar", + resolve: resolveYamlBoolean, + construct: constructYamlBoolean, + predicate: isBoolean, + represent: { + lowercase: function(object) { + return object ? "true" : "false"; + }, + uppercase: function(object) { + return object ? "TRUE" : "FALSE"; + }, + camelcase: function(object) { + return object ? "True" : "False"; + } + }, + defaultStyle: "lowercase" + }); +})); +//#endregion +//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/type/int.js +var require_int$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + var common = require_common(); + var Type = require_type$1(); + function isHexCode(c) { + return 48 <= c && c <= 57 || 65 <= c && c <= 70 || 97 <= c && c <= 102; + } + function isOctCode(c) { + return 48 <= c && c <= 55; + } + function isDecCode(c) { + return 48 <= c && c <= 57; + } + function resolveYamlInteger(data) { + if (data === null) return false; + var max = data.length, index = 0, hasDigits = false, ch; + if (!max) return false; + ch = data[index]; + if (ch === "-" || ch === "+") ch = data[++index]; + if (ch === "0") { + if (index + 1 === max) return true; + ch = data[++index]; + if (ch === "b") { + index++; + for (; index < max; index++) { + ch = data[index]; + if (ch === "_") continue; + if (ch !== "0" && ch !== "1") return false; + hasDigits = true; + } + return hasDigits && ch !== "_"; + } + if (ch === "x") { + index++; + for (; index < max; index++) { + ch = data[index]; + if (ch === "_") continue; + if (!isHexCode(data.charCodeAt(index))) return false; + hasDigits = true; + } + return hasDigits && ch !== "_"; + } + if (ch === "o") { + index++; + for (; index < max; index++) { + ch = data[index]; + if (ch === "_") continue; + if (!isOctCode(data.charCodeAt(index))) return false; + hasDigits = true; + } + return hasDigits && ch !== "_"; + } + } + if (ch === "_") return false; + for (; index < max; index++) { + ch = data[index]; + if (ch === "_") continue; + if (!isDecCode(data.charCodeAt(index))) return false; + hasDigits = true; + } + if (!hasDigits || ch === "_") return false; + return true; + } + function constructYamlInteger(data) { + var value = data, sign = 1, ch; + if (value.indexOf("_") !== -1) value = value.replace(/_/g, ""); + ch = value[0]; + if (ch === "-" || ch === "+") { + if (ch === "-") sign = -1; + value = value.slice(1); + ch = value[0]; + } + if (value === "0") return 0; + if (ch === "0") { + if (value[1] === "b") return sign * parseInt(value.slice(2), 2); + if (value[1] === "x") return sign * parseInt(value.slice(2), 16); + if (value[1] === "o") return sign * parseInt(value.slice(2), 8); + } + return sign * parseInt(value, 10); + } + function isInteger(object) { + return Object.prototype.toString.call(object) === "[object Number]" && object % 1 === 0 && !common.isNegativeZero(object); + } + module.exports = new Type("tag:yaml.org,2002:int", { + kind: "scalar", + resolve: resolveYamlInteger, + construct: constructYamlInteger, + predicate: isInteger, + represent: { + binary: function(obj) { + return obj >= 0 ? "0b" + obj.toString(2) : "-0b" + obj.toString(2).slice(1); + }, + octal: function(obj) { + return obj >= 0 ? "0o" + obj.toString(8) : "-0o" + obj.toString(8).slice(1); + }, + decimal: function(obj) { + return obj.toString(10); + }, + hexadecimal: function(obj) { + return obj >= 0 ? "0x" + obj.toString(16).toUpperCase() : "-0x" + obj.toString(16).toUpperCase().slice(1); + } + }, + defaultStyle: "decimal", + styleAliases: { + binary: [2, "bin"], + octal: [8, "oct"], + decimal: [10, "dec"], + hexadecimal: [16, "hex"] + } + }); +})); +//#endregion +//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/type/float.js +var require_float$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + var common = require_common(); + var Type = require_type$1(); + var YAML_FLOAT_PATTERN = /* @__PURE__ */ new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"); + function resolveYamlFloat(data) { + if (data === null) return false; + if (!YAML_FLOAT_PATTERN.test(data) || data[data.length - 1] === "_") return false; + return true; + } + function constructYamlFloat(data) { + var value = data.replace(/_/g, "").toLowerCase(), sign = value[0] === "-" ? -1 : 1; + if ("+-".indexOf(value[0]) >= 0) value = value.slice(1); + if (value === ".inf") return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; + else if (value === ".nan") return NaN; + return sign * parseFloat(value, 10); + } + var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; + function representYamlFloat(object, style) { + var res; + if (isNaN(object)) switch (style) { + case "lowercase": return ".nan"; + case "uppercase": return ".NAN"; + case "camelcase": return ".NaN"; + } + else if (Number.POSITIVE_INFINITY === object) switch (style) { + case "lowercase": return ".inf"; + case "uppercase": return ".INF"; + case "camelcase": return ".Inf"; + } + else if (Number.NEGATIVE_INFINITY === object) switch (style) { + case "lowercase": return "-.inf"; + case "uppercase": return "-.INF"; + case "camelcase": return "-.Inf"; + } + else if (common.isNegativeZero(object)) return "-0.0"; + res = object.toString(10); + return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace("e", ".e") : res; + } + function isFloat(object) { + return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 !== 0 || common.isNegativeZero(object)); + } + module.exports = new Type("tag:yaml.org,2002:float", { + kind: "scalar", + resolve: resolveYamlFloat, + construct: constructYamlFloat, + predicate: isFloat, + represent: representYamlFloat, + defaultStyle: "lowercase" + }); +})); +//#endregion +//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/schema/json.js +var require_json = /* @__PURE__ */ __commonJSMin(((exports, module) => { + module.exports = require_failsafe().extend({ implicit: [ + require_null$1(), + require_bool$2(), + require_int$2(), + require_float$2() + ] }); +})); +//#endregion +//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/schema/core.js +var require_core = /* @__PURE__ */ __commonJSMin(((exports, module) => { + module.exports = require_json(); +})); +//#endregion +//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/type/timestamp.js +var require_timestamp$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + var Type = require_type$1(); + var YAML_DATE_REGEXP = /* @__PURE__ */ new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"); + var YAML_TIMESTAMP_REGEXP = /* @__PURE__ */ new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"); + function resolveYamlTimestamp(data) { + if (data === null) return false; + if (YAML_DATE_REGEXP.exec(data) !== null) return true; + if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true; + return false; + } + function constructYamlTimestamp(data) { + var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date; + match = YAML_DATE_REGEXP.exec(data); + if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data); + if (match === null) throw new Error("Date resolve error"); + year = +match[1]; + month = +match[2] - 1; + day = +match[3]; + if (!match[4]) return new Date(Date.UTC(year, month, day)); + hour = +match[4]; + minute = +match[5]; + second = +match[6]; + if (match[7]) { + fraction = match[7].slice(0, 3); + while (fraction.length < 3) fraction += "0"; + fraction = +fraction; + } + if (match[9]) { + tz_hour = +match[10]; + tz_minute = +(match[11] || 0); + delta = (tz_hour * 60 + tz_minute) * 6e4; + if (match[9] === "-") delta = -delta; + } + date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); + if (delta) date.setTime(date.getTime() - delta); + return date; + } + function representYamlTimestamp(object) { + return object.toISOString(); + } + module.exports = new Type("tag:yaml.org,2002:timestamp", { + kind: "scalar", + resolve: resolveYamlTimestamp, + construct: constructYamlTimestamp, + instanceOf: Date, + represent: representYamlTimestamp + }); +})); +//#endregion +//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/type/merge.js +var require_merge$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + var Type = require_type$1(); + function resolveYamlMerge(data) { + return data === "<<" || data === null; + } + module.exports = new Type("tag:yaml.org,2002:merge", { + kind: "scalar", + resolve: resolveYamlMerge + }); +})); +//#endregion +//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/type/binary.js +var require_binary$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + var Type = require_type$1(); + var BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r"; + function resolveYamlBinary(data) { + if (data === null) return false; + var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP; + for (idx = 0; idx < max; idx++) { + code = map.indexOf(data.charAt(idx)); + if (code > 64) continue; + if (code < 0) return false; + bitlen += 6; + } + return bitlen % 8 === 0; + } + function constructYamlBinary(data) { + var idx, tailbits, input = data.replace(/[\r\n=]/g, ""), max = input.length, map = BASE64_MAP, bits = 0, result = []; + for (idx = 0; idx < max; idx++) { + if (idx % 4 === 0 && idx) { + result.push(bits >> 16 & 255); + result.push(bits >> 8 & 255); + result.push(bits & 255); + } + bits = bits << 6 | map.indexOf(input.charAt(idx)); + } + tailbits = max % 4 * 6; + if (tailbits === 0) { + result.push(bits >> 16 & 255); + result.push(bits >> 8 & 255); + result.push(bits & 255); + } else if (tailbits === 18) { + result.push(bits >> 10 & 255); + result.push(bits >> 2 & 255); + } else if (tailbits === 12) result.push(bits >> 4 & 255); + return new Uint8Array(result); + } + function representYamlBinary(object) { + var result = "", bits = 0, idx, tail, max = object.length, map = BASE64_MAP; + for (idx = 0; idx < max; idx++) { + if (idx % 3 === 0 && idx) { + result += map[bits >> 18 & 63]; + result += map[bits >> 12 & 63]; + result += map[bits >> 6 & 63]; + result += map[bits & 63]; + } + bits = (bits << 8) + object[idx]; + } + tail = max % 3; + if (tail === 0) { + result += map[bits >> 18 & 63]; + result += map[bits >> 12 & 63]; + result += map[bits >> 6 & 63]; + result += map[bits & 63]; + } else if (tail === 2) { + result += map[bits >> 10 & 63]; + result += map[bits >> 4 & 63]; + result += map[bits << 2 & 63]; + result += map[64]; + } else if (tail === 1) { + result += map[bits >> 2 & 63]; + result += map[bits << 4 & 63]; + result += map[64]; + result += map[64]; + } + return result; + } + function isBinary(obj) { + return Object.prototype.toString.call(obj) === "[object Uint8Array]"; + } + module.exports = new Type("tag:yaml.org,2002:binary", { + kind: "scalar", + resolve: resolveYamlBinary, + construct: constructYamlBinary, + predicate: isBinary, + represent: representYamlBinary + }); +})); +//#endregion +//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/type/omap.js +var require_omap$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + var Type = require_type$1(); + var _hasOwnProperty = Object.prototype.hasOwnProperty; + var _toString = Object.prototype.toString; + function resolveYamlOmap(data) { + if (data === null) return true; + var objectKeys = [], index, length, pair, pairKey, pairHasKey, object = data; + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + pairHasKey = false; + if (_toString.call(pair) !== "[object Object]") return false; + for (pairKey in pair) if (_hasOwnProperty.call(pair, pairKey)) if (!pairHasKey) pairHasKey = true; + else return false; + if (!pairHasKey) return false; + if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey); + else return false; + } + return true; + } + function constructYamlOmap(data) { + return data !== null ? data : []; + } + module.exports = new Type("tag:yaml.org,2002:omap", { + kind: "sequence", + resolve: resolveYamlOmap, + construct: constructYamlOmap + }); +})); +//#endregion +//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/type/pairs.js +var require_pairs$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + var Type = require_type$1(); + var _toString = Object.prototype.toString; + function resolveYamlPairs(data) { + if (data === null) return true; + var index, length, pair, keys, result, object = data; + result = new Array(object.length); + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + if (_toString.call(pair) !== "[object Object]") return false; + keys = Object.keys(pair); + if (keys.length !== 1) return false; + result[index] = [keys[0], pair[keys[0]]]; + } + return true; + } + function constructYamlPairs(data) { + if (data === null) return []; + var index, length, pair, keys, result, object = data; + result = new Array(object.length); + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + keys = Object.keys(pair); + result[index] = [keys[0], pair[keys[0]]]; + } + return result; + } + module.exports = new Type("tag:yaml.org,2002:pairs", { + kind: "sequence", + resolve: resolveYamlPairs, + construct: constructYamlPairs + }); +})); +//#endregion +//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/type/set.js +var require_set$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + var Type = require_type$1(); + var _hasOwnProperty = Object.prototype.hasOwnProperty; + function resolveYamlSet(data) { + if (data === null) return true; + var key, object = data; + for (key in object) if (_hasOwnProperty.call(object, key)) { + if (object[key] !== null) return false; + } + return true; + } + function constructYamlSet(data) { + return data !== null ? data : {}; + } + module.exports = new Type("tag:yaml.org,2002:set", { + kind: "mapping", + resolve: resolveYamlSet, + construct: constructYamlSet + }); +})); +//#endregion +//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/schema/default.js +var require_default = /* @__PURE__ */ __commonJSMin(((exports, module) => { + module.exports = require_core().extend({ + implicit: [require_timestamp$1(), require_merge$1()], + explicit: [ + require_binary$1(), + require_omap$1(), + require_pairs$1(), + require_set$1() + ] + }); +})); +//#endregion +//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/loader.js +var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => { + var common = require_common(); + var YAMLException = require_exception(); + var makeSnippet = require_snippet(); + var DEFAULT_SCHEMA = require_default(); + var _hasOwnProperty = Object.prototype.hasOwnProperty; + var CONTEXT_FLOW_IN = 1; + var CONTEXT_FLOW_OUT = 2; + var CONTEXT_BLOCK_IN = 3; + var CONTEXT_BLOCK_OUT = 4; + var CHOMPING_CLIP = 1; + var CHOMPING_STRIP = 2; + var CHOMPING_KEEP = 3; + var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; + var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/; + var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/; + var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i; + var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; + function _class(obj) { + return Object.prototype.toString.call(obj); + } + function is_EOL(c) { + return c === 10 || c === 13; + } + function is_WHITE_SPACE(c) { + return c === 9 || c === 32; + } + function is_WS_OR_EOL(c) { + return c === 9 || c === 32 || c === 10 || c === 13; + } + function is_FLOW_INDICATOR(c) { + return c === 44 || c === 91 || c === 93 || c === 123 || c === 125; + } + function fromHexCode(c) { + var lc; + if (48 <= c && c <= 57) return c - 48; + lc = c | 32; + if (97 <= lc && lc <= 102) return lc - 97 + 10; + return -1; + } + function escapedHexLen(c) { + if (c === 120) return 2; + if (c === 117) return 4; + if (c === 85) return 8; + return 0; + } + function fromDecimalCode(c) { + if (48 <= c && c <= 57) return c - 48; + return -1; + } + function simpleEscapeSequence(c) { + return c === 48 ? "\0" : c === 97 ? "\x07" : c === 98 ? "\b" : c === 116 ? " " : c === 9 ? " " : c === 110 ? "\n" : c === 118 ? "\v" : c === 102 ? "\f" : c === 114 ? "\r" : c === 101 ? "\x1B" : c === 32 ? " " : c === 34 ? "\"" : c === 47 ? "/" : c === 92 ? "\\" : c === 78 ? "…" : c === 95 ? "\xA0" : c === 76 ? "\u2028" : c === 80 ? "\u2029" : ""; + } + function charFromCodepoint(c) { + if (c <= 65535) return String.fromCharCode(c); + return String.fromCharCode((c - 65536 >> 10) + 55296, (c - 65536 & 1023) + 56320); + } + function setProperty(object, key, value) { + if (key === "__proto__") Object.defineProperty(object, key, { + configurable: true, + enumerable: true, + writable: true, + value + }); + else object[key] = value; + } + var simpleEscapeCheck = new Array(256); + var simpleEscapeMap = new Array(256); + for (var i = 0; i < 256; i++) { + simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0; + simpleEscapeMap[i] = simpleEscapeSequence(i); + } + function State(input, options) { + this.input = input; + this.filename = options["filename"] || null; + this.schema = options["schema"] || DEFAULT_SCHEMA; + this.onWarning = options["onWarning"] || null; + this.legacy = options["legacy"] || false; + this.json = options["json"] || false; + this.listener = options["listener"] || null; + this.implicitTypes = this.schema.compiledImplicit; + this.typeMap = this.schema.compiledTypeMap; + this.length = input.length; + this.position = 0; + this.line = 0; + this.lineStart = 0; + this.lineIndent = 0; + this.firstTabInLine = -1; + this.documents = []; + } + function generateError(state, message) { + var mark = { + name: state.filename, + buffer: state.input.slice(0, -1), + position: state.position, + line: state.line, + column: state.position - state.lineStart + }; + mark.snippet = makeSnippet(mark); + return new YAMLException(message, mark); + } + function throwError(state, message) { + throw generateError(state, message); + } + function throwWarning(state, message) { + if (state.onWarning) state.onWarning.call(null, generateError(state, message)); + } + var directiveHandlers = { + YAML: function handleYamlDirective(state, name, args) { + var match, major, minor; + if (state.version !== null) throwError(state, "duplication of %YAML directive"); + if (args.length !== 1) throwError(state, "YAML directive accepts exactly one argument"); + match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); + if (match === null) throwError(state, "ill-formed argument of the YAML directive"); + major = parseInt(match[1], 10); + minor = parseInt(match[2], 10); + if (major !== 1) throwError(state, "unacceptable YAML version of the document"); + state.version = args[0]; + state.checkLineBreaks = minor < 2; + if (minor !== 1 && minor !== 2) throwWarning(state, "unsupported YAML version of the document"); + }, + TAG: function handleTagDirective(state, name, args) { + var handle, prefix; + if (args.length !== 2) throwError(state, "TAG directive accepts exactly two arguments"); + handle = args[0]; + prefix = args[1]; + if (!PATTERN_TAG_HANDLE.test(handle)) throwError(state, "ill-formed tag handle (first argument) of the TAG directive"); + if (_hasOwnProperty.call(state.tagMap, handle)) throwError(state, "there is a previously declared suffix for \"" + handle + "\" tag handle"); + if (!PATTERN_TAG_URI.test(prefix)) throwError(state, "ill-formed tag prefix (second argument) of the TAG directive"); + try { + prefix = decodeURIComponent(prefix); + } catch (err) { + throwError(state, "tag prefix is malformed: " + prefix); + } + state.tagMap[handle] = prefix; + } + }; + function captureSegment(state, start, end, checkJson) { + var _position, _length, _character, _result; + if (start < end) { + _result = state.input.slice(start, end); + if (checkJson) for (_position = 0, _length = _result.length; _position < _length; _position += 1) { + _character = _result.charCodeAt(_position); + if (!(_character === 9 || 32 <= _character && _character <= 1114111)) throwError(state, "expected valid JSON character"); + } + else if (PATTERN_NON_PRINTABLE.test(_result)) throwError(state, "the stream contains non-printable characters"); + state.result += _result; + } + } + function mergeMappings(state, destination, source, overridableKeys) { + var sourceKeys, key, index, quantity; + if (!common.isObject(source)) throwError(state, "cannot merge mappings; the provided source object is unacceptable"); + sourceKeys = Object.keys(source); + for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { + key = sourceKeys[index]; + if (!_hasOwnProperty.call(destination, key)) { + setProperty(destination, key, source[key]); + overridableKeys[key] = true; + } + } + } + function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startLineStart, startPos) { + var index, quantity; + if (Array.isArray(keyNode)) { + keyNode = Array.prototype.slice.call(keyNode); + for (index = 0, quantity = keyNode.length; index < quantity; index += 1) { + if (Array.isArray(keyNode[index])) throwError(state, "nested arrays are not supported inside keys"); + if (typeof keyNode === "object" && _class(keyNode[index]) === "[object Object]") keyNode[index] = "[object Object]"; + } + } + if (typeof keyNode === "object" && _class(keyNode) === "[object Object]") keyNode = "[object Object]"; + keyNode = String(keyNode); + if (_result === null) _result = {}; + if (keyTag === "tag:yaml.org,2002:merge") if (Array.isArray(valueNode)) for (index = 0, quantity = valueNode.length; index < quantity; index += 1) mergeMappings(state, _result, valueNode[index], overridableKeys); + else mergeMappings(state, _result, valueNode, overridableKeys); + else { + if (!state.json && !_hasOwnProperty.call(overridableKeys, keyNode) && _hasOwnProperty.call(_result, keyNode)) { + state.line = startLine || state.line; + state.lineStart = startLineStart || state.lineStart; + state.position = startPos || state.position; + throwError(state, "duplicated mapping key"); + } + setProperty(_result, keyNode, valueNode); + delete overridableKeys[keyNode]; + } + return _result; + } + function readLineBreak(state) { + var ch = state.input.charCodeAt(state.position); + if (ch === 10) state.position++; + else if (ch === 13) { + state.position++; + if (state.input.charCodeAt(state.position) === 10) state.position++; + } else throwError(state, "a line break is expected"); + state.line += 1; + state.lineStart = state.position; + state.firstTabInLine = -1; + } + function skipSeparationSpace(state, allowComments, checkIndent) { + var lineBreaks = 0, ch = state.input.charCodeAt(state.position); + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + if (ch === 9 && state.firstTabInLine === -1) state.firstTabInLine = state.position; + ch = state.input.charCodeAt(++state.position); + } + if (allowComments && ch === 35) do + ch = state.input.charCodeAt(++state.position); + while (ch !== 10 && ch !== 13 && ch !== 0); + if (is_EOL(ch)) { + readLineBreak(state); + ch = state.input.charCodeAt(state.position); + lineBreaks++; + state.lineIndent = 0; + while (ch === 32) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } + } else break; + } + if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) throwWarning(state, "deficient indentation"); + return lineBreaks; + } + function testDocumentSeparator(state) { + var _position = state.position, ch = state.input.charCodeAt(_position); + if ((ch === 45 || ch === 46) && ch === state.input.charCodeAt(_position + 1) && ch === state.input.charCodeAt(_position + 2)) { + _position += 3; + ch = state.input.charCodeAt(_position); + if (ch === 0 || is_WS_OR_EOL(ch)) return true; + } + return false; + } + function writeFoldedLines(state, count) { + if (count === 1) state.result += " "; + else if (count > 1) state.result += common.repeat("\n", count - 1); + } + function readPlainScalar(state, nodeIndent, withinFlowCollection) { + var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state.kind, _result = state.result, ch = state.input.charCodeAt(state.position); + if (is_WS_OR_EOL(ch) || is_FLOW_INDICATOR(ch) || ch === 35 || ch === 38 || ch === 42 || ch === 33 || ch === 124 || ch === 62 || ch === 39 || ch === 34 || ch === 37 || ch === 64 || ch === 96) return false; + if (ch === 63 || ch === 45) { + following = state.input.charCodeAt(state.position + 1); + if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) return false; + } + state.kind = "scalar"; + state.result = ""; + captureStart = captureEnd = state.position; + hasPendingContent = false; + while (ch !== 0) { + if (ch === 58) { + following = state.input.charCodeAt(state.position + 1); + if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) break; + } else if (ch === 35) { + preceding = state.input.charCodeAt(state.position - 1); + if (is_WS_OR_EOL(preceding)) break; + } else if (state.position === state.lineStart && testDocumentSeparator(state) || withinFlowCollection && is_FLOW_INDICATOR(ch)) break; + else if (is_EOL(ch)) { + _line = state.line; + _lineStart = state.lineStart; + _lineIndent = state.lineIndent; + skipSeparationSpace(state, false, -1); + if (state.lineIndent >= nodeIndent) { + hasPendingContent = true; + ch = state.input.charCodeAt(state.position); + continue; + } else { + state.position = captureEnd; + state.line = _line; + state.lineStart = _lineStart; + state.lineIndent = _lineIndent; + break; + } + } + if (hasPendingContent) { + captureSegment(state, captureStart, captureEnd, false); + writeFoldedLines(state, state.line - _line); + captureStart = captureEnd = state.position; + hasPendingContent = false; + } + if (!is_WHITE_SPACE(ch)) captureEnd = state.position + 1; + ch = state.input.charCodeAt(++state.position); + } + captureSegment(state, captureStart, captureEnd, false); + if (state.result) return true; + state.kind = _kind; + state.result = _result; + return false; + } + function readSingleQuotedScalar(state, nodeIndent) { + var ch = state.input.charCodeAt(state.position), captureStart, captureEnd; + if (ch !== 39) return false; + state.kind = "scalar"; + state.result = ""; + state.position++; + captureStart = captureEnd = state.position; + while ((ch = state.input.charCodeAt(state.position)) !== 0) if (ch === 39) { + captureSegment(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); + if (ch === 39) { + captureStart = state.position; + state.position++; + captureEnd = state.position; + } else return true; + } else if (is_EOL(ch)) { + captureSegment(state, captureStart, captureEnd, true); + writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); + captureStart = captureEnd = state.position; + } else if (state.position === state.lineStart && testDocumentSeparator(state)) throwError(state, "unexpected end of the document within a single quoted scalar"); + else { + state.position++; + captureEnd = state.position; + } + throwError(state, "unexpected end of the stream within a single quoted scalar"); + } + function readDoubleQuotedScalar(state, nodeIndent) { + var captureStart, captureEnd, hexLength, hexResult, tmp, ch = state.input.charCodeAt(state.position); + if (ch !== 34) return false; + state.kind = "scalar"; + state.result = ""; + state.position++; + captureStart = captureEnd = state.position; + while ((ch = state.input.charCodeAt(state.position)) !== 0) if (ch === 34) { + captureSegment(state, captureStart, state.position, true); + state.position++; + return true; + } else if (ch === 92) { + captureSegment(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); + if (is_EOL(ch)) skipSeparationSpace(state, false, nodeIndent); + else if (ch < 256 && simpleEscapeCheck[ch]) { + state.result += simpleEscapeMap[ch]; + state.position++; + } else if ((tmp = escapedHexLen(ch)) > 0) { + hexLength = tmp; + hexResult = 0; + for (; hexLength > 0; hexLength--) { + ch = state.input.charCodeAt(++state.position); + if ((tmp = fromHexCode(ch)) >= 0) hexResult = (hexResult << 4) + tmp; + else throwError(state, "expected hexadecimal character"); + } + state.result += charFromCodepoint(hexResult); + state.position++; + } else throwError(state, "unknown escape sequence"); + captureStart = captureEnd = state.position; + } else if (is_EOL(ch)) { + captureSegment(state, captureStart, captureEnd, true); + writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); + captureStart = captureEnd = state.position; + } else if (state.position === state.lineStart && testDocumentSeparator(state)) throwError(state, "unexpected end of the document within a double quoted scalar"); + else { + state.position++; + captureEnd = state.position; + } + throwError(state, "unexpected end of the stream within a double quoted scalar"); + } + function readFlowCollection(state, nodeIndent) { + var readNext = true, _line, _lineStart, _pos, _tag = state.tag, _result, _anchor = state.anchor, following, terminator, isPair, isExplicitPair, isMapping, overridableKeys = Object.create(null), keyNode, keyTag, valueNode, ch = state.input.charCodeAt(state.position); + if (ch === 91) { + terminator = 93; + isMapping = false; + _result = []; + } else if (ch === 123) { + terminator = 125; + isMapping = true; + _result = {}; + } else return false; + if (state.anchor !== null) state.anchorMap[state.anchor] = _result; + ch = state.input.charCodeAt(++state.position); + while (ch !== 0) { + skipSeparationSpace(state, true, nodeIndent); + ch = state.input.charCodeAt(state.position); + if (ch === terminator) { + state.position++; + state.tag = _tag; + state.anchor = _anchor; + state.kind = isMapping ? "mapping" : "sequence"; + state.result = _result; + return true; + } else if (!readNext) throwError(state, "missed comma between flow collection entries"); + else if (ch === 44) throwError(state, "expected the node content, but found ','"); + keyTag = keyNode = valueNode = null; + isPair = isExplicitPair = false; + if (ch === 63) { + following = state.input.charCodeAt(state.position + 1); + if (is_WS_OR_EOL(following)) { + isPair = isExplicitPair = true; + state.position++; + skipSeparationSpace(state, true, nodeIndent); + } + } + _line = state.line; + _lineStart = state.lineStart; + _pos = state.position; + composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); + keyTag = state.tag; + keyNode = state.result; + skipSeparationSpace(state, true, nodeIndent); + ch = state.input.charCodeAt(state.position); + if ((isExplicitPair || state.line === _line) && ch === 58) { + isPair = true; + ch = state.input.charCodeAt(++state.position); + skipSeparationSpace(state, true, nodeIndent); + composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); + valueNode = state.result; + } + if (isMapping) storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos); + else if (isPair) _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos)); + else _result.push(keyNode); + skipSeparationSpace(state, true, nodeIndent); + ch = state.input.charCodeAt(state.position); + if (ch === 44) { + readNext = true; + ch = state.input.charCodeAt(++state.position); + } else readNext = false; + } + throwError(state, "unexpected end of the stream within a flow collection"); + } + function readBlockScalar(state, nodeIndent) { + var captureStart, folding, chomping = CHOMPING_CLIP, didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch = state.input.charCodeAt(state.position); + if (ch === 124) folding = false; + else if (ch === 62) folding = true; + else return false; + state.kind = "scalar"; + state.result = ""; + while (ch !== 0) { + ch = state.input.charCodeAt(++state.position); + if (ch === 43 || ch === 45) if (CHOMPING_CLIP === chomping) chomping = ch === 43 ? CHOMPING_KEEP : CHOMPING_STRIP; + else throwError(state, "repeat of a chomping mode identifier"); + else if ((tmp = fromDecimalCode(ch)) >= 0) if (tmp === 0) throwError(state, "bad explicit indentation width of a block scalar; it cannot be less than one"); + else if (!detectedIndent) { + textIndent = nodeIndent + tmp - 1; + detectedIndent = true; + } else throwError(state, "repeat of an indentation width identifier"); + else break; + } + if (is_WHITE_SPACE(ch)) { + do + ch = state.input.charCodeAt(++state.position); + while (is_WHITE_SPACE(ch)); + if (ch === 35) do + ch = state.input.charCodeAt(++state.position); + while (!is_EOL(ch) && ch !== 0); + } + while (ch !== 0) { + readLineBreak(state); + state.lineIndent = 0; + ch = state.input.charCodeAt(state.position); + while ((!detectedIndent || state.lineIndent < textIndent) && ch === 32) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } + if (!detectedIndent && state.lineIndent > textIndent) textIndent = state.lineIndent; + if (is_EOL(ch)) { + emptyLines++; + continue; + } + if (state.lineIndent < textIndent) { + if (chomping === CHOMPING_KEEP) state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines); + else if (chomping === CHOMPING_CLIP) { + if (didReadContent) state.result += "\n"; + } + break; + } + if (folding) if (is_WHITE_SPACE(ch)) { + atMoreIndented = true; + state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines); + } else if (atMoreIndented) { + atMoreIndented = false; + state.result += common.repeat("\n", emptyLines + 1); + } else if (emptyLines === 0) { + if (didReadContent) state.result += " "; + } else state.result += common.repeat("\n", emptyLines); + else state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines); + didReadContent = true; + detectedIndent = true; + emptyLines = 0; + captureStart = state.position; + while (!is_EOL(ch) && ch !== 0) ch = state.input.charCodeAt(++state.position); + captureSegment(state, captureStart, state.position, false); + } + return true; + } + function readBlockSequence(state, nodeIndent) { + var _line, _tag = state.tag, _anchor = state.anchor, _result = [], following, detected = false, ch; + if (state.firstTabInLine !== -1) return false; + if (state.anchor !== null) state.anchorMap[state.anchor] = _result; + ch = state.input.charCodeAt(state.position); + while (ch !== 0) { + if (state.firstTabInLine !== -1) { + state.position = state.firstTabInLine; + throwError(state, "tab characters must not be used in indentation"); + } + if (ch !== 45) break; + following = state.input.charCodeAt(state.position + 1); + if (!is_WS_OR_EOL(following)) break; + detected = true; + state.position++; + if (skipSeparationSpace(state, true, -1)) { + if (state.lineIndent <= nodeIndent) { + _result.push(null); + ch = state.input.charCodeAt(state.position); + continue; + } + } + _line = state.line; + composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true); + _result.push(state.result); + skipSeparationSpace(state, true, -1); + ch = state.input.charCodeAt(state.position); + if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) throwError(state, "bad indentation of a sequence entry"); + else if (state.lineIndent < nodeIndent) break; + } + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = "sequence"; + state.result = _result; + return true; + } + return false; + } + function readBlockMapping(state, nodeIndent, flowIndent) { + var following, allowCompact, _line, _keyLine, _keyLineStart, _keyPos, _tag = state.tag, _anchor = state.anchor, _result = {}, overridableKeys = Object.create(null), keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch; + if (state.firstTabInLine !== -1) return false; + if (state.anchor !== null) state.anchorMap[state.anchor] = _result; + ch = state.input.charCodeAt(state.position); + while (ch !== 0) { + if (!atExplicitKey && state.firstTabInLine !== -1) { + state.position = state.firstTabInLine; + throwError(state, "tab characters must not be used in indentation"); + } + following = state.input.charCodeAt(state.position + 1); + _line = state.line; + if ((ch === 63 || ch === 58) && is_WS_OR_EOL(following)) { + if (ch === 63) { + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } + detected = true; + atExplicitKey = true; + allowCompact = true; + } else if (atExplicitKey) { + atExplicitKey = false; + allowCompact = true; + } else throwError(state, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"); + state.position += 1; + ch = following; + } else { + _keyLine = state.line; + _keyLineStart = state.lineStart; + _keyPos = state.position; + if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) break; + if (state.line === _line) { + ch = state.input.charCodeAt(state.position); + while (is_WHITE_SPACE(ch)) ch = state.input.charCodeAt(++state.position); + if (ch === 58) { + ch = state.input.charCodeAt(++state.position); + if (!is_WS_OR_EOL(ch)) throwError(state, "a whitespace character is expected after the key-value separator within a block mapping"); + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } + detected = true; + atExplicitKey = false; + allowCompact = false; + keyTag = state.tag; + keyNode = state.result; + } else if (detected) throwError(state, "can not read an implicit mapping pair; a colon is missed"); + else { + state.tag = _tag; + state.anchor = _anchor; + return true; + } + } else if (detected) throwError(state, "can not read a block mapping entry; a multiline key may not be an implicit key"); + else { + state.tag = _tag; + state.anchor = _anchor; + return true; + } + } + if (state.line === _line || state.lineIndent > nodeIndent) { + if (atExplicitKey) { + _keyLine = state.line; + _keyLineStart = state.lineStart; + _keyPos = state.position; + } + if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) if (atExplicitKey) keyNode = state.result; + else valueNode = state.result; + if (!atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } + skipSeparationSpace(state, true, -1); + ch = state.input.charCodeAt(state.position); + } + if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) throwError(state, "bad indentation of a mapping entry"); + else if (state.lineIndent < nodeIndent) break; + } + if (atExplicitKey) storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = "mapping"; + state.result = _result; + } + return detected; + } + function readTagProperty(state) { + var _position, isVerbatim = false, isNamed = false, tagHandle, tagName, ch = state.input.charCodeAt(state.position); + if (ch !== 33) return false; + if (state.tag !== null) throwError(state, "duplication of a tag property"); + ch = state.input.charCodeAt(++state.position); + if (ch === 60) { + isVerbatim = true; + ch = state.input.charCodeAt(++state.position); + } else if (ch === 33) { + isNamed = true; + tagHandle = "!!"; + ch = state.input.charCodeAt(++state.position); + } else tagHandle = "!"; + _position = state.position; + if (isVerbatim) { + do + ch = state.input.charCodeAt(++state.position); + while (ch !== 0 && ch !== 62); + if (state.position < state.length) { + tagName = state.input.slice(_position, state.position); + ch = state.input.charCodeAt(++state.position); + } else throwError(state, "unexpected end of the stream within a verbatim tag"); + } else { + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + if (ch === 33) if (!isNamed) { + tagHandle = state.input.slice(_position - 1, state.position + 1); + if (!PATTERN_TAG_HANDLE.test(tagHandle)) throwError(state, "named tag handle cannot contain such characters"); + isNamed = true; + _position = state.position + 1; + } else throwError(state, "tag suffix cannot contain exclamation marks"); + ch = state.input.charCodeAt(++state.position); + } + tagName = state.input.slice(_position, state.position); + if (PATTERN_FLOW_INDICATORS.test(tagName)) throwError(state, "tag suffix cannot contain flow indicator characters"); + } + if (tagName && !PATTERN_TAG_URI.test(tagName)) throwError(state, "tag name cannot contain such characters: " + tagName); + try { + tagName = decodeURIComponent(tagName); + } catch (err) { + throwError(state, "tag name is malformed: " + tagName); + } + if (isVerbatim) state.tag = tagName; + else if (_hasOwnProperty.call(state.tagMap, tagHandle)) state.tag = state.tagMap[tagHandle] + tagName; + else if (tagHandle === "!") state.tag = "!" + tagName; + else if (tagHandle === "!!") state.tag = "tag:yaml.org,2002:" + tagName; + else throwError(state, "undeclared tag handle \"" + tagHandle + "\""); + return true; + } + function readAnchorProperty(state) { + var _position, ch = state.input.charCodeAt(state.position); + if (ch !== 38) return false; + if (state.anchor !== null) throwError(state, "duplication of an anchor property"); + ch = state.input.charCodeAt(++state.position); + _position = state.position; + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) ch = state.input.charCodeAt(++state.position); + if (state.position === _position) throwError(state, "name of an anchor node must contain at least one character"); + state.anchor = state.input.slice(_position, state.position); + return true; + } + function readAlias(state) { + var _position, alias, ch = state.input.charCodeAt(state.position); + if (ch !== 42) return false; + ch = state.input.charCodeAt(++state.position); + _position = state.position; + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) ch = state.input.charCodeAt(++state.position); + if (state.position === _position) throwError(state, "name of an alias node must contain at least one character"); + alias = state.input.slice(_position, state.position); + if (!_hasOwnProperty.call(state.anchorMap, alias)) throwError(state, "unidentified alias \"" + alias + "\""); + state.result = state.anchorMap[alias]; + skipSeparationSpace(state, true, -1); + return true; + } + function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) { + var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, atNewLine = false, hasContent = false, typeIndex, typeQuantity, typeList, type, flowIndent, blockIndent; + if (state.listener !== null) state.listener("open", state); + state.tag = null; + state.anchor = null; + state.kind = null; + state.result = null; + allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT === nodeContext || CONTEXT_BLOCK_IN === nodeContext; + if (allowToSeek) { + if (skipSeparationSpace(state, true, -1)) { + atNewLine = true; + if (state.lineIndent > parentIndent) indentStatus = 1; + else if (state.lineIndent === parentIndent) indentStatus = 0; + else if (state.lineIndent < parentIndent) indentStatus = -1; + } + } + if (indentStatus === 1) while (readTagProperty(state) || readAnchorProperty(state)) if (skipSeparationSpace(state, true, -1)) { + atNewLine = true; + allowBlockCollections = allowBlockStyles; + if (state.lineIndent > parentIndent) indentStatus = 1; + else if (state.lineIndent === parentIndent) indentStatus = 0; + else if (state.lineIndent < parentIndent) indentStatus = -1; + } else allowBlockCollections = false; + if (allowBlockCollections) allowBlockCollections = atNewLine || allowCompact; + if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) { + if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) flowIndent = parentIndent; + else flowIndent = parentIndent + 1; + blockIndent = state.position - state.lineStart; + if (indentStatus === 1) if (allowBlockCollections && (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent)) || readFlowCollection(state, flowIndent)) hasContent = true; + else { + if (allowBlockScalars && readBlockScalar(state, flowIndent) || readSingleQuotedScalar(state, flowIndent) || readDoubleQuotedScalar(state, flowIndent)) hasContent = true; + else if (readAlias(state)) { + hasContent = true; + if (state.tag !== null || state.anchor !== null) throwError(state, "alias node should not have any properties"); + } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { + hasContent = true; + if (state.tag === null) state.tag = "?"; + } + if (state.anchor !== null) state.anchorMap[state.anchor] = state.result; + } + else if (indentStatus === 0) hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); + } + if (state.tag === null) { + if (state.anchor !== null) state.anchorMap[state.anchor] = state.result; + } else if (state.tag === "?") { + if (state.result !== null && state.kind !== "scalar") throwError(state, "unacceptable node kind for ! tag; it should be \"scalar\", not \"" + state.kind + "\""); + for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { + type = state.implicitTypes[typeIndex]; + if (type.resolve(state.result)) { + state.result = type.construct(state.result); + state.tag = type.tag; + if (state.anchor !== null) state.anchorMap[state.anchor] = state.result; + break; + } + } + } else if (state.tag !== "!") { + if (_hasOwnProperty.call(state.typeMap[state.kind || "fallback"], state.tag)) type = state.typeMap[state.kind || "fallback"][state.tag]; + else { + type = null; + typeList = state.typeMap.multi[state.kind || "fallback"]; + for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) { + type = typeList[typeIndex]; + break; + } + } + if (!type) throwError(state, "unknown tag !<" + state.tag + ">"); + if (state.result !== null && type.kind !== state.kind) throwError(state, "unacceptable node kind for !<" + state.tag + "> tag; it should be \"" + type.kind + "\", not \"" + state.kind + "\""); + if (!type.resolve(state.result, state.tag)) throwError(state, "cannot resolve a node with !<" + state.tag + "> explicit tag"); + else { + state.result = type.construct(state.result, state.tag); + if (state.anchor !== null) state.anchorMap[state.anchor] = state.result; + } + } + if (state.listener !== null) state.listener("close", state); + return state.tag !== null || state.anchor !== null || hasContent; + } + function readDocument(state) { + var documentStart = state.position, _position, directiveName, directiveArgs, hasDirectives = false, ch; + state.version = null; + state.checkLineBreaks = state.legacy; + state.tagMap = Object.create(null); + state.anchorMap = Object.create(null); + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + skipSeparationSpace(state, true, -1); + ch = state.input.charCodeAt(state.position); + if (state.lineIndent > 0 || ch !== 37) break; + hasDirectives = true; + ch = state.input.charCodeAt(++state.position); + _position = state.position; + while (ch !== 0 && !is_WS_OR_EOL(ch)) ch = state.input.charCodeAt(++state.position); + directiveName = state.input.slice(_position, state.position); + directiveArgs = []; + if (directiveName.length < 1) throwError(state, "directive name must not be less than one character in length"); + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) ch = state.input.charCodeAt(++state.position); + if (ch === 35) { + do + ch = state.input.charCodeAt(++state.position); + while (ch !== 0 && !is_EOL(ch)); + break; + } + if (is_EOL(ch)) break; + _position = state.position; + while (ch !== 0 && !is_WS_OR_EOL(ch)) ch = state.input.charCodeAt(++state.position); + directiveArgs.push(state.input.slice(_position, state.position)); + } + if (ch !== 0) readLineBreak(state); + if (_hasOwnProperty.call(directiveHandlers, directiveName)) directiveHandlers[directiveName](state, directiveName, directiveArgs); + else throwWarning(state, "unknown document directive \"" + directiveName + "\""); + } + skipSeparationSpace(state, true, -1); + if (state.lineIndent === 0 && state.input.charCodeAt(state.position) === 45 && state.input.charCodeAt(state.position + 1) === 45 && state.input.charCodeAt(state.position + 2) === 45) { + state.position += 3; + skipSeparationSpace(state, true, -1); + } else if (hasDirectives) throwError(state, "directives end mark is expected"); + composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); + skipSeparationSpace(state, true, -1); + if (state.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) throwWarning(state, "non-ASCII line breaks are interpreted as content"); + state.documents.push(state.result); + if (state.position === state.lineStart && testDocumentSeparator(state)) { + if (state.input.charCodeAt(state.position) === 46) { + state.position += 3; + skipSeparationSpace(state, true, -1); + } + return; + } + if (state.position < state.length - 1) throwError(state, "end of the stream or a document separator is expected"); + else return; + } + function loadDocuments(input, options) { + input = String(input); + options = options || {}; + if (input.length !== 0) { + if (input.charCodeAt(input.length - 1) !== 10 && input.charCodeAt(input.length - 1) !== 13) input += "\n"; + if (input.charCodeAt(0) === 65279) input = input.slice(1); + } + var state = new State(input, options); + var nullpos = input.indexOf("\0"); + if (nullpos !== -1) { + state.position = nullpos; + throwError(state, "null byte is not allowed in input"); + } + state.input += "\0"; + while (state.input.charCodeAt(state.position) === 32) { + state.lineIndent += 1; + state.position += 1; + } + while (state.position < state.length - 1) readDocument(state); + return state.documents; + } + function loadAll(input, iterator, options) { + if (iterator !== null && typeof iterator === "object" && typeof options === "undefined") { + options = iterator; + iterator = null; + } + var documents = loadDocuments(input, options); + if (typeof iterator !== "function") return documents; + for (var index = 0, length = documents.length; index < length; index += 1) iterator(documents[index]); + } + function load(input, options) { + var documents = loadDocuments(input, options); + if (documents.length === 0) return; + else if (documents.length === 1) return documents[0]; + throw new YAMLException("expected a single document in the stream, but found more"); + } + module.exports.loadAll = loadAll; + module.exports.load = load; +})); +//#endregion +//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/dumper.js +var require_dumper = /* @__PURE__ */ __commonJSMin(((exports, module) => { + var common = require_common(); + var YAMLException = require_exception(); + var DEFAULT_SCHEMA = require_default(); + var _toString = Object.prototype.toString; + var _hasOwnProperty = Object.prototype.hasOwnProperty; + var CHAR_BOM = 65279; + var CHAR_TAB = 9; + var CHAR_LINE_FEED = 10; + var CHAR_CARRIAGE_RETURN = 13; + var CHAR_SPACE = 32; + var CHAR_EXCLAMATION = 33; + var CHAR_DOUBLE_QUOTE = 34; + var CHAR_SHARP = 35; + var CHAR_PERCENT = 37; + var CHAR_AMPERSAND = 38; + var CHAR_SINGLE_QUOTE = 39; + var CHAR_ASTERISK = 42; + var CHAR_COMMA = 44; + var CHAR_MINUS = 45; + var CHAR_COLON = 58; + var CHAR_EQUALS = 61; + var CHAR_GREATER_THAN = 62; + var CHAR_QUESTION = 63; + var CHAR_COMMERCIAL_AT = 64; + var CHAR_LEFT_SQUARE_BRACKET = 91; + var CHAR_RIGHT_SQUARE_BRACKET = 93; + var CHAR_GRAVE_ACCENT = 96; + var CHAR_LEFT_CURLY_BRACKET = 123; + var CHAR_VERTICAL_LINE = 124; + var CHAR_RIGHT_CURLY_BRACKET = 125; + var ESCAPE_SEQUENCES = {}; + ESCAPE_SEQUENCES[0] = "\\0"; + ESCAPE_SEQUENCES[7] = "\\a"; + ESCAPE_SEQUENCES[8] = "\\b"; + ESCAPE_SEQUENCES[9] = "\\t"; + ESCAPE_SEQUENCES[10] = "\\n"; + ESCAPE_SEQUENCES[11] = "\\v"; + ESCAPE_SEQUENCES[12] = "\\f"; + ESCAPE_SEQUENCES[13] = "\\r"; + ESCAPE_SEQUENCES[27] = "\\e"; + ESCAPE_SEQUENCES[34] = "\\\""; + ESCAPE_SEQUENCES[92] = "\\\\"; + ESCAPE_SEQUENCES[133] = "\\N"; + ESCAPE_SEQUENCES[160] = "\\_"; + ESCAPE_SEQUENCES[8232] = "\\L"; + ESCAPE_SEQUENCES[8233] = "\\P"; + var DEPRECATED_BOOLEANS_SYNTAX = [ + "y", + "Y", + "yes", + "Yes", + "YES", + "on", + "On", + "ON", + "n", + "N", + "no", + "No", + "NO", + "off", + "Off", + "OFF" + ]; + var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/; + function compileStyleMap(schema, map) { + var result, keys, index, length, tag, style, type; + if (map === null) return {}; + result = {}; + keys = Object.keys(map); + for (index = 0, length = keys.length; index < length; index += 1) { + tag = keys[index]; + style = String(map[tag]); + if (tag.slice(0, 2) === "!!") tag = "tag:yaml.org,2002:" + tag.slice(2); + type = schema.compiledTypeMap["fallback"][tag]; + if (type && _hasOwnProperty.call(type.styleAliases, style)) style = type.styleAliases[style]; + result[tag] = style; + } + return result; + } + function encodeHex(character) { + var string = character.toString(16).toUpperCase(), handle, length; + if (character <= 255) { + handle = "x"; + length = 2; + } else if (character <= 65535) { + handle = "u"; + length = 4; + } else if (character <= 4294967295) { + handle = "U"; + length = 8; + } else throw new YAMLException("code point within a string may not be greater than 0xFFFFFFFF"); + return "\\" + handle + common.repeat("0", length - string.length) + string; + } + var QUOTING_TYPE_SINGLE = 1, QUOTING_TYPE_DOUBLE = 2; + function State(options) { + this.schema = options["schema"] || DEFAULT_SCHEMA; + this.indent = Math.max(1, options["indent"] || 2); + this.noArrayIndent = options["noArrayIndent"] || false; + this.skipInvalid = options["skipInvalid"] || false; + this.flowLevel = common.isNothing(options["flowLevel"]) ? -1 : options["flowLevel"]; + this.styleMap = compileStyleMap(this.schema, options["styles"] || null); + this.sortKeys = options["sortKeys"] || false; + this.lineWidth = options["lineWidth"] || 80; + this.noRefs = options["noRefs"] || false; + this.noCompatMode = options["noCompatMode"] || false; + this.condenseFlow = options["condenseFlow"] || false; + this.quotingType = options["quotingType"] === "\"" ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE; + this.forceQuotes = options["forceQuotes"] || false; + this.replacer = typeof options["replacer"] === "function" ? options["replacer"] : null; + this.implicitTypes = this.schema.compiledImplicit; + this.explicitTypes = this.schema.compiledExplicit; + this.tag = null; + this.result = ""; + this.duplicates = []; + this.usedDuplicates = null; + } + function indentString(string, spaces) { + var ind = common.repeat(" ", spaces), position = 0, next = -1, result = "", line, length = string.length; + while (position < length) { + next = string.indexOf("\n", position); + if (next === -1) { + line = string.slice(position); + position = length; + } else { + line = string.slice(position, next + 1); + position = next + 1; + } + if (line.length && line !== "\n") result += ind; + result += line; + } + return result; + } + function generateNextLine(state, level) { + return "\n" + common.repeat(" ", state.indent * level); + } + function testImplicitResolving(state, str) { + var index, length, type; + for (index = 0, length = state.implicitTypes.length; index < length; index += 1) { + type = state.implicitTypes[index]; + if (type.resolve(str)) return true; + } + return false; + } + function isWhitespace(c) { + return c === CHAR_SPACE || c === CHAR_TAB; + } + function isPrintable(c) { + return 32 <= c && c <= 126 || 161 <= c && c <= 55295 && c !== 8232 && c !== 8233 || 57344 <= c && c <= 65533 && c !== CHAR_BOM || 65536 <= c && c <= 1114111; + } + function isNsCharOrWhitespace(c) { + return isPrintable(c) && c !== CHAR_BOM && c !== CHAR_CARRIAGE_RETURN && c !== CHAR_LINE_FEED; + } + function isPlainSafe(c, prev, inblock) { + var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c); + var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c); + return (inblock ? cIsNsCharOrWhitespace : cIsNsCharOrWhitespace && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET) && c !== CHAR_SHARP && !(prev === CHAR_COLON && !cIsNsChar) || isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP || prev === CHAR_COLON && cIsNsChar; + } + function isPlainSafeFirst(c) { + return isPrintable(c) && c !== CHAR_BOM && !isWhitespace(c) && c !== CHAR_MINUS && c !== CHAR_QUESTION && c !== CHAR_COLON && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET && c !== CHAR_SHARP && c !== CHAR_AMPERSAND && c !== CHAR_ASTERISK && c !== CHAR_EXCLAMATION && c !== CHAR_VERTICAL_LINE && c !== CHAR_EQUALS && c !== CHAR_GREATER_THAN && c !== CHAR_SINGLE_QUOTE && c !== CHAR_DOUBLE_QUOTE && c !== CHAR_PERCENT && c !== CHAR_COMMERCIAL_AT && c !== CHAR_GRAVE_ACCENT; + } + function isPlainSafeLast(c) { + return !isWhitespace(c) && c !== CHAR_COLON; + } + function codePointAt(string, pos) { + var first = string.charCodeAt(pos), second; + if (first >= 55296 && first <= 56319 && pos + 1 < string.length) { + second = string.charCodeAt(pos + 1); + if (second >= 56320 && second <= 57343) return (first - 55296) * 1024 + second - 56320 + 65536; + } + return first; + } + function needIndentIndicator(string) { + return /^\n* /.test(string); + } + var STYLE_PLAIN = 1, STYLE_SINGLE = 2, STYLE_LITERAL = 3, STYLE_FOLDED = 4, STYLE_DOUBLE = 5; + function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType, quotingType, forceQuotes, inblock) { + var i; + var char = 0; + var prevChar = null; + var hasLineBreak = false; + var hasFoldableLine = false; + var shouldTrackWidth = lineWidth !== -1; + var previousLineBreak = -1; + var plain = isPlainSafeFirst(codePointAt(string, 0)) && isPlainSafeLast(codePointAt(string, string.length - 1)); + if (singleLineOnly || forceQuotes) for (i = 0; i < string.length; char >= 65536 ? i += 2 : i++) { + char = codePointAt(string, i); + if (!isPrintable(char)) return STYLE_DOUBLE; + plain = plain && isPlainSafe(char, prevChar, inblock); + prevChar = char; + } + else { + for (i = 0; i < string.length; char >= 65536 ? i += 2 : i++) { + char = codePointAt(string, i); + if (char === CHAR_LINE_FEED) { + hasLineBreak = true; + if (shouldTrackWidth) { + hasFoldableLine = hasFoldableLine || i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " "; + previousLineBreak = i; + } + } else if (!isPrintable(char)) return STYLE_DOUBLE; + plain = plain && isPlainSafe(char, prevChar, inblock); + prevChar = char; + } + hasFoldableLine = hasFoldableLine || shouldTrackWidth && i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " "; + } + if (!hasLineBreak && !hasFoldableLine) { + if (plain && !forceQuotes && !testAmbiguousType(string)) return STYLE_PLAIN; + return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE; + } + if (indentPerLevel > 9 && needIndentIndicator(string)) return STYLE_DOUBLE; + if (!forceQuotes) return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; + return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE; + } + function writeScalar(state, string, level, iskey, inblock) { + state.dump = function() { + if (string.length === 0) return state.quotingType === QUOTING_TYPE_DOUBLE ? "\"\"" : "''"; + if (!state.noCompatMode) { + if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) return state.quotingType === QUOTING_TYPE_DOUBLE ? "\"" + string + "\"" : "'" + string + "'"; + } + var indent = state.indent * Math.max(1, level); + var lineWidth = state.lineWidth === -1 ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent); + var singleLineOnly = iskey || state.flowLevel > -1 && level >= state.flowLevel; + function testAmbiguity(string) { + return testImplicitResolving(state, string); + } + switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity, state.quotingType, state.forceQuotes && !iskey, inblock)) { + case STYLE_PLAIN: return string; + case STYLE_SINGLE: return "'" + string.replace(/'/g, "''") + "'"; + case STYLE_LITERAL: return "|" + blockHeader(string, state.indent) + dropEndingNewline(indentString(string, indent)); + case STYLE_FOLDED: return ">" + blockHeader(string, state.indent) + dropEndingNewline(indentString(foldString(string, lineWidth), indent)); + case STYLE_DOUBLE: return "\"" + escapeString(string, lineWidth) + "\""; + default: throw new YAMLException("impossible error: invalid scalar style"); + } + }(); + } + function blockHeader(string, indentPerLevel) { + var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : ""; + var clip = string[string.length - 1] === "\n"; + return indentIndicator + (clip && (string[string.length - 2] === "\n" || string === "\n") ? "+" : clip ? "" : "-") + "\n"; + } + function dropEndingNewline(string) { + return string[string.length - 1] === "\n" ? string.slice(0, -1) : string; + } + function foldString(string, width) { + var lineRe = /(\n+)([^\n]*)/g; + var result = function() { + var nextLF = string.indexOf("\n"); + nextLF = nextLF !== -1 ? nextLF : string.length; + lineRe.lastIndex = nextLF; + return foldLine(string.slice(0, nextLF), width); + }(); + var prevMoreIndented = string[0] === "\n" || string[0] === " "; + var moreIndented; + var match; + while (match = lineRe.exec(string)) { + var prefix = match[1], line = match[2]; + moreIndented = line[0] === " "; + result += prefix + (!prevMoreIndented && !moreIndented && line !== "" ? "\n" : "") + foldLine(line, width); + prevMoreIndented = moreIndented; + } + return result; + } + function foldLine(line, width) { + if (line === "" || line[0] === " ") return line; + var breakRe = / [^ ]/g; + var match; + var start = 0, end, curr = 0, next = 0; + var result = ""; + while (match = breakRe.exec(line)) { + next = match.index; + if (next - start > width) { + end = curr > start ? curr : next; + result += "\n" + line.slice(start, end); + start = end + 1; + } + curr = next; + } + result += "\n"; + if (line.length - start > width && curr > start) result += line.slice(start, curr) + "\n" + line.slice(curr + 1); + else result += line.slice(start); + return result.slice(1); + } + function escapeString(string) { + var result = ""; + var char = 0; + var escapeSeq; + for (var i = 0; i < string.length; char >= 65536 ? i += 2 : i++) { + char = codePointAt(string, i); + escapeSeq = ESCAPE_SEQUENCES[char]; + if (!escapeSeq && isPrintable(char)) { + result += string[i]; + if (char >= 65536) result += string[i + 1]; + } else result += escapeSeq || encodeHex(char); + } + return result; + } + function writeFlowSequence(state, level, object) { + var _result = "", _tag = state.tag, index, length, value; + for (index = 0, length = object.length; index < length; index += 1) { + value = object[index]; + if (state.replacer) value = state.replacer.call(object, String(index), value); + if (writeNode(state, level, value, false, false) || typeof value === "undefined" && writeNode(state, level, null, false, false)) { + if (_result !== "") _result += "," + (!state.condenseFlow ? " " : ""); + _result += state.dump; + } + } + state.tag = _tag; + state.dump = "[" + _result + "]"; + } + function writeBlockSequence(state, level, object, compact) { + var _result = "", _tag = state.tag, index, length, value; + for (index = 0, length = object.length; index < length; index += 1) { + value = object[index]; + if (state.replacer) value = state.replacer.call(object, String(index), value); + if (writeNode(state, level + 1, value, true, true, false, true) || typeof value === "undefined" && writeNode(state, level + 1, null, true, true, false, true)) { + if (!compact || _result !== "") _result += generateNextLine(state, level); + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) _result += "-"; + else _result += "- "; + _result += state.dump; + } + } + state.tag = _tag; + state.dump = _result || "[]"; + } + function writeFlowMapping(state, level, object) { + var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, pairBuffer; + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + pairBuffer = ""; + if (_result !== "") pairBuffer += ", "; + if (state.condenseFlow) pairBuffer += "\""; + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + if (state.replacer) objectValue = state.replacer.call(object, objectKey, objectValue); + if (!writeNode(state, level, objectKey, false, false)) continue; + if (state.dump.length > 1024) pairBuffer += "? "; + pairBuffer += state.dump + (state.condenseFlow ? "\"" : "") + ":" + (state.condenseFlow ? "" : " "); + if (!writeNode(state, level, objectValue, false, false)) continue; + pairBuffer += state.dump; + _result += pairBuffer; + } + state.tag = _tag; + state.dump = "{" + _result + "}"; + } + function writeBlockMapping(state, level, object, compact) { + var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, explicitPair, pairBuffer; + if (state.sortKeys === true) objectKeyList.sort(); + else if (typeof state.sortKeys === "function") objectKeyList.sort(state.sortKeys); + else if (state.sortKeys) throw new YAMLException("sortKeys must be a boolean or a function"); + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + pairBuffer = ""; + if (!compact || _result !== "") pairBuffer += generateNextLine(state, level); + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + if (state.replacer) objectValue = state.replacer.call(object, objectKey, objectValue); + if (!writeNode(state, level + 1, objectKey, true, true, true)) continue; + explicitPair = state.tag !== null && state.tag !== "?" || state.dump && state.dump.length > 1024; + if (explicitPair) if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) pairBuffer += "?"; + else pairBuffer += "? "; + pairBuffer += state.dump; + if (explicitPair) pairBuffer += generateNextLine(state, level); + if (!writeNode(state, level + 1, objectValue, true, explicitPair)) continue; + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) pairBuffer += ":"; + else pairBuffer += ": "; + pairBuffer += state.dump; + _result += pairBuffer; + } + state.tag = _tag; + state.dump = _result || "{}"; + } + function detectType(state, object, explicit) { + var _result, typeList = explicit ? state.explicitTypes : state.implicitTypes, index, length, type, style; + for (index = 0, length = typeList.length; index < length; index += 1) { + type = typeList[index]; + if ((type.instanceOf || type.predicate) && (!type.instanceOf || typeof object === "object" && object instanceof type.instanceOf) && (!type.predicate || type.predicate(object))) { + if (explicit) if (type.multi && type.representName) state.tag = type.representName(object); + else state.tag = type.tag; + else state.tag = "?"; + if (type.represent) { + style = state.styleMap[type.tag] || type.defaultStyle; + if (_toString.call(type.represent) === "[object Function]") _result = type.represent(object, style); + else if (_hasOwnProperty.call(type.represent, style)) _result = type.represent[style](object, style); + else throw new YAMLException("!<" + type.tag + "> tag resolver accepts not \"" + style + "\" style"); + state.dump = _result; + } + return true; + } + } + return false; + } + function writeNode(state, level, object, block, compact, iskey, isblockseq) { + state.tag = null; + state.dump = object; + if (!detectType(state, object, false)) detectType(state, object, true); + var type = _toString.call(state.dump); + var inblock = block; + var tagStr; + if (block) block = state.flowLevel < 0 || state.flowLevel > level; + var objectOrArray = type === "[object Object]" || type === "[object Array]", duplicateIndex, duplicate; + if (objectOrArray) { + duplicateIndex = state.duplicates.indexOf(object); + duplicate = duplicateIndex !== -1; + } + if (state.tag !== null && state.tag !== "?" || duplicate || state.indent !== 2 && level > 0) compact = false; + if (duplicate && state.usedDuplicates[duplicateIndex]) state.dump = "*ref_" + duplicateIndex; + else { + if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) state.usedDuplicates[duplicateIndex] = true; + if (type === "[object Object]") if (block && Object.keys(state.dump).length !== 0) { + writeBlockMapping(state, level, state.dump, compact); + if (duplicate) state.dump = "&ref_" + duplicateIndex + state.dump; + } else { + writeFlowMapping(state, level, state.dump); + if (duplicate) state.dump = "&ref_" + duplicateIndex + " " + state.dump; + } + else if (type === "[object Array]") if (block && state.dump.length !== 0) { + if (state.noArrayIndent && !isblockseq && level > 0) writeBlockSequence(state, level - 1, state.dump, compact); + else writeBlockSequence(state, level, state.dump, compact); + if (duplicate) state.dump = "&ref_" + duplicateIndex + state.dump; + } else { + writeFlowSequence(state, level, state.dump); + if (duplicate) state.dump = "&ref_" + duplicateIndex + " " + state.dump; + } + else if (type === "[object String]") { + if (state.tag !== "?") writeScalar(state, state.dump, level, iskey, inblock); + } else if (type === "[object Undefined]") return false; + else { + if (state.skipInvalid) return false; + throw new YAMLException("unacceptable kind of an object to dump " + type); + } + if (state.tag !== null && state.tag !== "?") { + tagStr = encodeURI(state.tag[0] === "!" ? state.tag.slice(1) : state.tag).replace(/!/g, "%21"); + if (state.tag[0] === "!") tagStr = "!" + tagStr; + else if (tagStr.slice(0, 18) === "tag:yaml.org,2002:") tagStr = "!!" + tagStr.slice(18); + else tagStr = "!<" + tagStr + ">"; + state.dump = tagStr + " " + state.dump; + } + } + return true; + } + function getDuplicateReferences(object, state) { + var objects = [], duplicatesIndexes = [], index, length; + inspectNode(object, objects, duplicatesIndexes); + for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) state.duplicates.push(objects[duplicatesIndexes[index]]); + state.usedDuplicates = new Array(length); + } + function inspectNode(object, objects, duplicatesIndexes) { + var objectKeyList, index, length; + if (object !== null && typeof object === "object") { + index = objects.indexOf(object); + if (index !== -1) { + if (duplicatesIndexes.indexOf(index) === -1) duplicatesIndexes.push(index); + } else { + objects.push(object); + if (Array.isArray(object)) for (index = 0, length = object.length; index < length; index += 1) inspectNode(object[index], objects, duplicatesIndexes); + else { + objectKeyList = Object.keys(object); + for (index = 0, length = objectKeyList.length; index < length; index += 1) inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes); + } + } + } + } + function dump(input, options) { + options = options || {}; + var state = new State(options); + if (!state.noRefs) getDuplicateReferences(input, state); + var value = input; + if (state.replacer) value = state.replacer.call({ "": value }, "", value); + if (writeNode(state, 0, value, true, true)) return state.dump + "\n"; + return ""; + } + module.exports.dump = dump; +})); +//#endregion +//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/index.js +var require_js_yaml = /* @__PURE__ */ __commonJSMin(((exports, module) => { + var loader = require_loader(); + var dumper = require_dumper(); + function renamed(from, to) { + return function() { + throw new Error("Function yaml." + from + " is removed in js-yaml 4. Use yaml." + to + " instead, which is now safe by default."); + }; + } + module.exports.Type = require_type$1(); + module.exports.Schema = require_schema$3(); + module.exports.FAILSAFE_SCHEMA = require_failsafe(); + module.exports.JSON_SCHEMA = require_json(); + module.exports.CORE_SCHEMA = require_core(); + module.exports.DEFAULT_SCHEMA = require_default(); + module.exports.load = loader.load; + module.exports.loadAll = loader.loadAll; + module.exports.dump = dumper.dump; + module.exports.YAMLException = require_exception(); + module.exports.types = { + binary: require_binary$1(), + float: require_float$2(), + map: require_map$1(), + null: require_null$1(), + pairs: require_pairs$1(), + set: require_set$1(), + timestamp: require_timestamp$1(), + bool: require_bool$2(), + int: require_int$2(), + merge: require_merge$1(), + omap: require_omap$1(), + seq: require_seq$1(), + str: require_str() + }; + module.exports.safeLoad = renamed("safeLoad", "load"); + module.exports.safeLoadAll = renamed("safeLoadAll", "loadAll"); + module.exports.safeDump = renamed("safeDump", "dump"); +})); +//#endregion +//#region ../../node_modules/.pnpm/read-yaml-file@2.1.0/node_modules/read-yaml-file/index.js +var require_read_yaml_file = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const fs$2 = __require("fs"); + const stripBom = require_strip_bom(); + const yaml = require_js_yaml(); + const parse = (data) => yaml.load(stripBom(data)); + const readYamlFile = (fp) => fs$2.promises.readFile(fp, "utf8").then((data) => parse(data)); + module.exports = readYamlFile; + module.exports.default = readYamlFile; + module.exports.sync = (fp) => parse(fs$2.readFileSync(fp, "utf8")); +})); +//#endregion +//#region ../../node_modules/.pnpm/@pnpm+error@1000.1.0/node_modules/@pnpm/error/lib/index.js +var require_lib$5 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.LockfileMissingDependencyError = exports.FetchError = exports.PnpmError = void 0; + const constants_1 = require_lib$6(); + var PnpmError = class extends Error { + code; + hint; + attempts; + prefix; + pkgsStack; + constructor(code, message, opts) { + super(message, { cause: opts?.cause }); + this.code = code.startsWith("ERR_PNPM_") ? code : `ERR_PNPM_${code}`; + this.hint = opts?.hint; + this.attempts = opts?.attempts; + } + }; + exports.PnpmError = PnpmError; + var FetchError = class extends PnpmError { + response; + request; + constructor(request, response, hint) { + const _request = { url: request.url }; + if (request.authHeaderValue) _request.authHeaderValue = hideAuthInformation(request.authHeaderValue); + const message = `GET ${request.url}: ${response.statusText} - ${response.status}`; + if (response.status === 401 || response.status === 403 || response.status === 404) { + hint = hint ? `${hint}\n\n` : ""; + if (_request.authHeaderValue) hint += `An authorization header was used: ${_request.authHeaderValue}`; + else hint += "No authorization header was set for the request."; + } + super(`FETCH_${response.status}`, message, { hint }); + this.request = _request; + this.response = response; + } + }; + exports.FetchError = FetchError; + function hideAuthInformation(authHeaderValue) { + const [authType, token] = authHeaderValue.split(" "); + if (token == null) return "[hidden]"; + if (token.length < 20) return `${authType} [hidden]`; + return `${authType} ${token.substring(0, 4)}[hidden]`; + } + var LockfileMissingDependencyError = class extends PnpmError { + constructor(depPath) { + const message = `Broken lockfile: no entry for '${depPath}' in ${constants_1.WANTED_LOCKFILE}`; + super("LOCKFILE_MISSING_DEPENDENCY", message, { hint: "This issue is probably caused by a badly resolved merge conflict.\nTo fix the lockfile, run 'pnpm install --no-frozen-lockfile'." }); + } + }; + exports.LockfileMissingDependencyError = LockfileMissingDependencyError; +})); +//#endregion +//#region ../../node_modules/.pnpm/@pnpm+workspace.read-manifest@1000.3.1/node_modules/@pnpm/workspace.read-manifest/lib/errors/InvalidWorkspaceManifestError.js +var require_InvalidWorkspaceManifestError = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.InvalidWorkspaceManifestError = void 0; + const error_1 = require_lib$5(); + var InvalidWorkspaceManifestError = class extends error_1.PnpmError { + constructor(message) { + super("INVALID_WORKSPACE_CONFIGURATION", message); + } + }; + exports.InvalidWorkspaceManifestError = InvalidWorkspaceManifestError; +})); +//#endregion +//#region ../../node_modules/.pnpm/@pnpm+workspace.read-manifest@1000.3.1/node_modules/@pnpm/workspace.read-manifest/lib/catalogs.js +var require_catalogs = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.assertValidWorkspaceManifestCatalog = assertValidWorkspaceManifestCatalog; + exports.assertValidWorkspaceManifestCatalogs = assertValidWorkspaceManifestCatalogs; + const InvalidWorkspaceManifestError_js_1 = require_InvalidWorkspaceManifestError(); + function assertValidWorkspaceManifestCatalog(manifest) { + if (manifest.catalog == null) return; + if (Array.isArray(manifest.catalog)) throw new InvalidWorkspaceManifestError_js_1.InvalidWorkspaceManifestError("Expected catalog field to be an object, but found - array"); + if (typeof manifest.catalog !== "object") throw new InvalidWorkspaceManifestError_js_1.InvalidWorkspaceManifestError(`Expected catalog field to be an object, but found - ${typeof manifest.catalog}`); + for (const [alias, specifier] of Object.entries(manifest.catalog)) if (typeof specifier !== "string") throw new InvalidWorkspaceManifestError_js_1.InvalidWorkspaceManifestError(`Invalid catalog entry for ${alias}. Expected string, but found: ${typeof specifier}`); + } + function assertValidWorkspaceManifestCatalogs(manifest) { + if (manifest.catalogs == null) return; + if (Array.isArray(manifest.catalogs)) throw new InvalidWorkspaceManifestError_js_1.InvalidWorkspaceManifestError("Expected catalogs field to be an object, but found - array"); + if (typeof manifest.catalogs !== "object") throw new InvalidWorkspaceManifestError_js_1.InvalidWorkspaceManifestError(`Expected catalogs field to be an object, but found - ${typeof manifest.catalogs}`); + for (const [catalogName, catalog] of Object.entries(manifest.catalogs)) { + if (Array.isArray(catalog)) throw new InvalidWorkspaceManifestError_js_1.InvalidWorkspaceManifestError(`Expected named catalog ${catalogName} to be an object, but found - array`); + if (typeof catalog !== "object") throw new InvalidWorkspaceManifestError_js_1.InvalidWorkspaceManifestError(`Expected named catalog ${catalogName} to be an object, but found - ${typeof catalog}`); + for (const [alias, specifier] of Object.entries(catalog)) if (typeof specifier !== "string") throw new InvalidWorkspaceManifestError_js_1.InvalidWorkspaceManifestError(`Catalog '${catalogName}' has invalid entry '${alias}'. Expected string specifier, but found: ${typeof specifier}`); + } + } +})); +//#endregion +//#region ../../node_modules/.pnpm/@pnpm+workspace.read-manifest@1000.3.1/node_modules/@pnpm/workspace.read-manifest/lib/index.js +var require_lib$4 = /* @__PURE__ */ __commonJSMin(((exports) => { + var __importDefault = exports && exports.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.readWorkspaceManifest = readWorkspaceManifest; + exports.validateWorkspaceManifest = validateWorkspaceManifest; + const util_1$1 = __importDefault(__require("util")); + const constants_1 = require_lib$6(); + const node_path_1 = __importDefault(__require("node:path")); + const read_yaml_file_1 = __importDefault(require_read_yaml_file()); + const catalogs_js_1 = require_catalogs(); + const InvalidWorkspaceManifestError_js_1 = require_InvalidWorkspaceManifestError(); + async function readWorkspaceManifest(dir) { + const manifest = await readManifestRaw(dir); + validateWorkspaceManifest(manifest); + return manifest; + } + async function readManifestRaw(dir) { + try { + return await (0, read_yaml_file_1.default)(node_path_1.default.join(dir, constants_1.WORKSPACE_MANIFEST_FILENAME)); + } catch (err) { + if (util_1$1.default.types.isNativeError(err) && "code" in err && err.code === "ENOENT") return; + throw err; + } + } + function validateWorkspaceManifest(manifest) { + if (manifest === void 0 || manifest === null) return; + if (typeof manifest !== "object") throw new InvalidWorkspaceManifestError_js_1.InvalidWorkspaceManifestError(`Expected object but found - ${typeof manifest}`); + if (Array.isArray(manifest)) throw new InvalidWorkspaceManifestError_js_1.InvalidWorkspaceManifestError("Expected object but found - array"); + if (Object.keys(manifest).length === 0) return; + assertValidWorkspaceManifestPackages(manifest); + (0, catalogs_js_1.assertValidWorkspaceManifestCatalog)(manifest); + (0, catalogs_js_1.assertValidWorkspaceManifestCatalogs)(manifest); + checkWorkspaceManifestAssignability(manifest); + } + function assertValidWorkspaceManifestPackages(manifest) { + if (!manifest.packages) return; + if (!Array.isArray(manifest.packages)) throw new InvalidWorkspaceManifestError_js_1.InvalidWorkspaceManifestError("packages field is not an array"); + for (const pkg of manifest.packages) { + if (!pkg) throw new InvalidWorkspaceManifestError_js_1.InvalidWorkspaceManifestError("Missing or empty package"); + const type = typeof pkg; + if (type !== "string") throw new InvalidWorkspaceManifestError_js_1.InvalidWorkspaceManifestError(`Invalid package type - ${type}`); + } + } + /** + * Empty function to ensure TypeScript has narrowed the manifest object to + * something assignable to the {@see WorkspaceManifest} interface. This helps + * make sure the validation logic in this file is correct as it's refactored in + * the future. + */ + function checkWorkspaceManifestAssignability(_manifest) {} +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/identity.js +var require_identity = /* @__PURE__ */ __commonJSMin(((exports) => { + const ALIAS = Symbol.for("yaml.alias"); + const DOC = Symbol.for("yaml.document"); + const MAP = Symbol.for("yaml.map"); + const PAIR = Symbol.for("yaml.pair"); + const SCALAR = Symbol.for("yaml.scalar"); + const SEQ = Symbol.for("yaml.seq"); + const NODE_TYPE = Symbol.for("yaml.node.type"); + const isAlias = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === ALIAS; + const isDocument = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === DOC; + const isMap = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === MAP; + const isPair = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === PAIR; + const isScalar = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === SCALAR; + const isSeq = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === SEQ; + function isCollection(node) { + if (node && typeof node === "object") switch (node[NODE_TYPE]) { + case MAP: + case SEQ: return true; + } + return false; + } + function isNode(node) { + if (node && typeof node === "object") switch (node[NODE_TYPE]) { + case ALIAS: + case MAP: + case SCALAR: + case SEQ: return true; + } + return false; + } + const hasAnchor = (node) => (isScalar(node) || isCollection(node)) && !!node.anchor; + exports.ALIAS = ALIAS; + exports.DOC = DOC; + exports.MAP = MAP; + exports.NODE_TYPE = NODE_TYPE; + exports.PAIR = PAIR; + exports.SCALAR = SCALAR; + exports.SEQ = SEQ; + exports.hasAnchor = hasAnchor; + exports.isAlias = isAlias; + exports.isCollection = isCollection; + exports.isDocument = isDocument; + exports.isMap = isMap; + exports.isNode = isNode; + exports.isPair = isPair; + exports.isScalar = isScalar; + exports.isSeq = isSeq; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/visit.js +var require_visit = /* @__PURE__ */ __commonJSMin(((exports) => { + var identity = require_identity(); + const BREAK = Symbol("break visit"); + const SKIP = Symbol("skip children"); + const REMOVE = Symbol("remove node"); + /** + * Apply a visitor to an AST node or document. + * + * Walks through the tree (depth-first) starting from `node`, calling a + * `visitor` function with three arguments: + * - `key`: For sequence values and map `Pair`, the node's index in the + * collection. Within a `Pair`, `'key'` or `'value'`, correspondingly. + * `null` for the root node. + * - `node`: The current node. + * - `path`: The ancestry of the current node. + * + * The return value of the visitor may be used to control the traversal: + * - `undefined` (default): Do nothing and continue + * - `visit.SKIP`: Do not visit the children of this node, continue with next + * sibling + * - `visit.BREAK`: Terminate traversal completely + * - `visit.REMOVE`: Remove the current node, then continue with the next one + * - `Node`: Replace the current node, then continue by visiting it + * - `number`: While iterating the items of a sequence or map, set the index + * of the next step. This is useful especially if the index of the current + * node has changed. + * + * If `visitor` is a single function, it will be called with all values + * encountered in the tree, including e.g. `null` values. Alternatively, + * separate visitor functions may be defined for each `Map`, `Pair`, `Seq`, + * `Alias` and `Scalar` node. To define the same visitor function for more than + * one node type, use the `Collection` (map and seq), `Value` (map, seq & scalar) + * and `Node` (alias, map, seq & scalar) targets. Of all these, only the most + * specific defined one will be used for each node. + */ + function visit(node, visitor) { + const visitor_ = initVisitor(visitor); + if (identity.isDocument(node)) { + if (visit_(null, node.contents, visitor_, Object.freeze([node])) === REMOVE) node.contents = null; + } else visit_(null, node, visitor_, Object.freeze([])); + } + /** Terminate visit traversal completely */ + visit.BREAK = BREAK; + /** Do not visit the children of the current node */ + visit.SKIP = SKIP; + /** Remove the current node */ + visit.REMOVE = REMOVE; + function visit_(key, node, visitor, path) { + const ctrl = callVisitor(key, node, visitor, path); + if (identity.isNode(ctrl) || identity.isPair(ctrl)) { + replaceNode(key, path, ctrl); + return visit_(key, ctrl, visitor, path); + } + if (typeof ctrl !== "symbol") { + if (identity.isCollection(node)) { + path = Object.freeze(path.concat(node)); + for (let i = 0; i < node.items.length; ++i) { + const ci = visit_(i, node.items[i], visitor, path); + if (typeof ci === "number") i = ci - 1; + else if (ci === BREAK) return BREAK; + else if (ci === REMOVE) { + node.items.splice(i, 1); + i -= 1; + } + } + } else if (identity.isPair(node)) { + path = Object.freeze(path.concat(node)); + const ck = visit_("key", node.key, visitor, path); + if (ck === BREAK) return BREAK; + else if (ck === REMOVE) node.key = null; + const cv = visit_("value", node.value, visitor, path); + if (cv === BREAK) return BREAK; + else if (cv === REMOVE) node.value = null; + } + } + return ctrl; + } + /** + * Apply an async visitor to an AST node or document. + * + * Walks through the tree (depth-first) starting from `node`, calling a + * `visitor` function with three arguments: + * - `key`: For sequence values and map `Pair`, the node's index in the + * collection. Within a `Pair`, `'key'` or `'value'`, correspondingly. + * `null` for the root node. + * - `node`: The current node. + * - `path`: The ancestry of the current node. + * + * The return value of the visitor may be used to control the traversal: + * - `Promise`: Must resolve to one of the following values + * - `undefined` (default): Do nothing and continue + * - `visit.SKIP`: Do not visit the children of this node, continue with next + * sibling + * - `visit.BREAK`: Terminate traversal completely + * - `visit.REMOVE`: Remove the current node, then continue with the next one + * - `Node`: Replace the current node, then continue by visiting it + * - `number`: While iterating the items of a sequence or map, set the index + * of the next step. This is useful especially if the index of the current + * node has changed. + * + * If `visitor` is a single function, it will be called with all values + * encountered in the tree, including e.g. `null` values. Alternatively, + * separate visitor functions may be defined for each `Map`, `Pair`, `Seq`, + * `Alias` and `Scalar` node. To define the same visitor function for more than + * one node type, use the `Collection` (map and seq), `Value` (map, seq & scalar) + * and `Node` (alias, map, seq & scalar) targets. Of all these, only the most + * specific defined one will be used for each node. + */ + async function visitAsync(node, visitor) { + const visitor_ = initVisitor(visitor); + if (identity.isDocument(node)) { + if (await visitAsync_(null, node.contents, visitor_, Object.freeze([node])) === REMOVE) node.contents = null; + } else await visitAsync_(null, node, visitor_, Object.freeze([])); + } + /** Terminate visit traversal completely */ + visitAsync.BREAK = BREAK; + /** Do not visit the children of the current node */ + visitAsync.SKIP = SKIP; + /** Remove the current node */ + visitAsync.REMOVE = REMOVE; + async function visitAsync_(key, node, visitor, path) { + const ctrl = await callVisitor(key, node, visitor, path); + if (identity.isNode(ctrl) || identity.isPair(ctrl)) { + replaceNode(key, path, ctrl); + return visitAsync_(key, ctrl, visitor, path); + } + if (typeof ctrl !== "symbol") { + if (identity.isCollection(node)) { + path = Object.freeze(path.concat(node)); + for (let i = 0; i < node.items.length; ++i) { + const ci = await visitAsync_(i, node.items[i], visitor, path); + if (typeof ci === "number") i = ci - 1; + else if (ci === BREAK) return BREAK; + else if (ci === REMOVE) { + node.items.splice(i, 1); + i -= 1; + } + } + } else if (identity.isPair(node)) { + path = Object.freeze(path.concat(node)); + const ck = await visitAsync_("key", node.key, visitor, path); + if (ck === BREAK) return BREAK; + else if (ck === REMOVE) node.key = null; + const cv = await visitAsync_("value", node.value, visitor, path); + if (cv === BREAK) return BREAK; + else if (cv === REMOVE) node.value = null; + } + } + return ctrl; + } + function initVisitor(visitor) { + if (typeof visitor === "object" && (visitor.Collection || visitor.Node || visitor.Value)) return Object.assign({ + Alias: visitor.Node, + Map: visitor.Node, + Scalar: visitor.Node, + Seq: visitor.Node + }, visitor.Value && { + Map: visitor.Value, + Scalar: visitor.Value, + Seq: visitor.Value + }, visitor.Collection && { + Map: visitor.Collection, + Seq: visitor.Collection + }, visitor); + return visitor; + } + function callVisitor(key, node, visitor, path) { + if (typeof visitor === "function") return visitor(key, node, path); + if (identity.isMap(node)) return visitor.Map?.(key, node, path); + if (identity.isSeq(node)) return visitor.Seq?.(key, node, path); + if (identity.isPair(node)) return visitor.Pair?.(key, node, path); + if (identity.isScalar(node)) return visitor.Scalar?.(key, node, path); + if (identity.isAlias(node)) return visitor.Alias?.(key, node, path); + } + function replaceNode(key, path, node) { + const parent = path[path.length - 1]; + if (identity.isCollection(parent)) parent.items[key] = node; + else if (identity.isPair(parent)) if (key === "key") parent.key = node; + else parent.value = node; + else if (identity.isDocument(parent)) parent.contents = node; + else { + const pt = identity.isAlias(parent) ? "alias" : "scalar"; + throw new Error(`Cannot replace node with ${pt} parent`); + } + } + exports.visit = visit; + exports.visitAsync = visitAsync; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/directives.js +var require_directives = /* @__PURE__ */ __commonJSMin(((exports) => { + var identity = require_identity(); + var visit = require_visit(); + const escapeChars = { + "!": "%21", + ",": "%2C", + "[": "%5B", + "]": "%5D", + "{": "%7B", + "}": "%7D" + }; + const escapeTagName = (tn) => tn.replace(/[!,[\]{}]/g, (ch) => escapeChars[ch]); + var Directives = class Directives { + constructor(yaml, tags) { + /** + * The directives-end/doc-start marker `---`. If `null`, a marker may still be + * included in the document's stringified representation. + */ + this.docStart = null; + /** The doc-end marker `...`. */ + this.docEnd = false; + this.yaml = Object.assign({}, Directives.defaultYaml, yaml); + this.tags = Object.assign({}, Directives.defaultTags, tags); + } + clone() { + const copy = new Directives(this.yaml, this.tags); + copy.docStart = this.docStart; + return copy; + } + /** + * During parsing, get a Directives instance for the current document and + * update the stream state according to the current version's spec. + */ + atDocument() { + const res = new Directives(this.yaml, this.tags); + switch (this.yaml.version) { + case "1.1": + this.atNextDocument = true; + break; + case "1.2": + this.atNextDocument = false; + this.yaml = { + explicit: Directives.defaultYaml.explicit, + version: "1.2" + }; + this.tags = Object.assign({}, Directives.defaultTags); + break; + } + return res; + } + /** + * @param onError - May be called even if the action was successful + * @returns `true` on success + */ + add(line, onError) { + if (this.atNextDocument) { + this.yaml = { + explicit: Directives.defaultYaml.explicit, + version: "1.1" + }; + this.tags = Object.assign({}, Directives.defaultTags); + this.atNextDocument = false; + } + const parts = line.trim().split(/[ \t]+/); + const name = parts.shift(); + switch (name) { + case "%TAG": { + if (parts.length !== 2) { + onError(0, "%TAG directive should contain exactly two parts"); + if (parts.length < 2) return false; + } + const [handle, prefix] = parts; + this.tags[handle] = prefix; + return true; + } + case "%YAML": { + this.yaml.explicit = true; + if (parts.length !== 1) { + onError(0, "%YAML directive should contain exactly one part"); + return false; + } + const [version] = parts; + if (version === "1.1" || version === "1.2") { + this.yaml.version = version; + return true; + } else { + const isValid = /^\d+\.\d+$/.test(version); + onError(6, `Unsupported YAML version ${version}`, isValid); + return false; + } + } + default: + onError(0, `Unknown directive ${name}`, true); + return false; + } + } + /** + * Resolves a tag, matching handles to those defined in %TAG directives. + * + * @returns Resolved tag, which may also be the non-specific tag `'!'` or a + * `'!local'` tag, or `null` if unresolvable. + */ + tagName(source, onError) { + if (source === "!") return "!"; + if (source[0] !== "!") { + onError(`Not a valid tag: ${source}`); + return null; + } + if (source[1] === "<") { + const verbatim = source.slice(2, -1); + if (verbatim === "!" || verbatim === "!!") { + onError(`Verbatim tags aren't resolved, so ${source} is invalid.`); + return null; + } + if (source[source.length - 1] !== ">") onError("Verbatim tags must end with a >"); + return verbatim; + } + const [, handle, suffix] = source.match(/^(.*!)([^!]*)$/s); + if (!suffix) onError(`The ${source} tag has no suffix`); + const prefix = this.tags[handle]; + if (prefix) try { + return prefix + decodeURIComponent(suffix); + } catch (error) { + onError(String(error)); + return null; + } + if (handle === "!") return source; + onError(`Could not resolve tag: ${source}`); + return null; + } + /** + * Given a fully resolved tag, returns its printable string form, + * taking into account current tag prefixes and defaults. + */ + tagString(tag) { + for (const [handle, prefix] of Object.entries(this.tags)) if (tag.startsWith(prefix)) return handle + escapeTagName(tag.substring(prefix.length)); + return tag[0] === "!" ? tag : `!<${tag}>`; + } + toString(doc) { + const lines = this.yaml.explicit ? [`%YAML ${this.yaml.version || "1.2"}`] : []; + const tagEntries = Object.entries(this.tags); + let tagNames; + if (doc && tagEntries.length > 0 && identity.isNode(doc.contents)) { + const tags = {}; + visit.visit(doc.contents, (_key, node) => { + if (identity.isNode(node) && node.tag) tags[node.tag] = true; + }); + tagNames = Object.keys(tags); + } else tagNames = []; + for (const [handle, prefix] of tagEntries) { + if (handle === "!!" && prefix === "tag:yaml.org,2002:") continue; + if (!doc || tagNames.some((tn) => tn.startsWith(prefix))) lines.push(`%TAG ${handle} ${prefix}`); + } + return lines.join("\n"); + } + }; + Directives.defaultYaml = { + explicit: false, + version: "1.2" + }; + Directives.defaultTags = { "!!": "tag:yaml.org,2002:" }; + exports.Directives = Directives; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/anchors.js +var require_anchors = /* @__PURE__ */ __commonJSMin(((exports) => { + var identity = require_identity(); + var visit = require_visit(); + /** + * Verify that the input string is a valid anchor. + * + * Will throw on errors. + */ + function anchorIsValid(anchor) { + if (/[\x00-\x19\s,[\]{}]/.test(anchor)) { + const msg = `Anchor must not contain whitespace or control characters: ${JSON.stringify(anchor)}`; + throw new Error(msg); + } + return true; + } + function anchorNames(root) { + const anchors = /* @__PURE__ */ new Set(); + visit.visit(root, { Value(_key, node) { + if (node.anchor) anchors.add(node.anchor); + } }); + return anchors; + } + /** Find a new anchor name with the given `prefix` and a one-indexed suffix. */ + function findNewAnchor(prefix, exclude) { + for (let i = 1;; ++i) { + const name = `${prefix}${i}`; + if (!exclude.has(name)) return name; + } + } + function createNodeAnchors(doc, prefix) { + const aliasObjects = []; + const sourceObjects = /* @__PURE__ */ new Map(); + let prevAnchors = null; + return { + onAnchor: (source) => { + aliasObjects.push(source); + prevAnchors ?? (prevAnchors = anchorNames(doc)); + const anchor = findNewAnchor(prefix, prevAnchors); + prevAnchors.add(anchor); + return anchor; + }, + setAnchors: () => { + for (const source of aliasObjects) { + const ref = sourceObjects.get(source); + if (typeof ref === "object" && ref.anchor && (identity.isScalar(ref.node) || identity.isCollection(ref.node))) ref.node.anchor = ref.anchor; + else { + const error = /* @__PURE__ */ new Error("Failed to resolve repeated object (this should not happen)"); + error.source = source; + throw error; + } + } + }, + sourceObjects + }; + } + exports.anchorIsValid = anchorIsValid; + exports.anchorNames = anchorNames; + exports.createNodeAnchors = createNodeAnchors; + exports.findNewAnchor = findNewAnchor; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/applyReviver.js +var require_applyReviver = /* @__PURE__ */ __commonJSMin(((exports) => { + /** + * Applies the JSON.parse reviver algorithm as defined in the ECMA-262 spec, + * in section 24.5.1.1 "Runtime Semantics: InternalizeJSONProperty" of the + * 2021 edition: https://tc39.es/ecma262/#sec-json.parse + * + * Includes extensions for handling Map and Set objects. + */ + function applyReviver(reviver, obj, key, val) { + if (val && typeof val === "object") if (Array.isArray(val)) for (let i = 0, len = val.length; i < len; ++i) { + const v0 = val[i]; + const v1 = applyReviver(reviver, val, String(i), v0); + if (v1 === void 0) delete val[i]; + else if (v1 !== v0) val[i] = v1; + } + else if (val instanceof Map) for (const k of Array.from(val.keys())) { + const v0 = val.get(k); + const v1 = applyReviver(reviver, val, k, v0); + if (v1 === void 0) val.delete(k); + else if (v1 !== v0) val.set(k, v1); + } + else if (val instanceof Set) for (const v0 of Array.from(val)) { + const v1 = applyReviver(reviver, val, v0, v0); + if (v1 === void 0) val.delete(v0); + else if (v1 !== v0) { + val.delete(v0); + val.add(v1); + } + } + else for (const [k, v0] of Object.entries(val)) { + const v1 = applyReviver(reviver, val, k, v0); + if (v1 === void 0) delete val[k]; + else if (v1 !== v0) val[k] = v1; + } + return reviver.call(obj, key, val); + } + exports.applyReviver = applyReviver; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/toJS.js +var require_toJS = /* @__PURE__ */ __commonJSMin(((exports) => { + var identity = require_identity(); + /** + * Recursively convert any node or its contents to native JavaScript + * + * @param value - The input value + * @param arg - If `value` defines a `toJSON()` method, use this + * as its first argument + * @param ctx - Conversion context, originally set in Document#toJS(). If + * `{ keep: true }` is not set, output should be suitable for JSON + * stringification. + */ + function toJS(value, arg, ctx) { + if (Array.isArray(value)) return value.map((v, i) => toJS(v, String(i), ctx)); + if (value && typeof value.toJSON === "function") { + if (!ctx || !identity.hasAnchor(value)) return value.toJSON(arg, ctx); + const data = { + aliasCount: 0, + count: 1, + res: void 0 + }; + ctx.anchors.set(value, data); + ctx.onCreate = (res) => { + data.res = res; + delete ctx.onCreate; + }; + const res = value.toJSON(arg, ctx); + if (ctx.onCreate) ctx.onCreate(res); + return res; + } + if (typeof value === "bigint" && !ctx?.keep) return Number(value); + return value; + } + exports.toJS = toJS; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Node.js +var require_Node = /* @__PURE__ */ __commonJSMin(((exports) => { + var applyReviver = require_applyReviver(); + var identity = require_identity(); + var toJS = require_toJS(); + var NodeBase = class { + constructor(type) { + Object.defineProperty(this, identity.NODE_TYPE, { value: type }); + } + /** Create a copy of this node. */ + clone() { + const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this)); + if (this.range) copy.range = this.range.slice(); + return copy; + } + /** A plain JavaScript representation of this node. */ + toJS(doc, { mapAsMap, maxAliasCount, onAnchor, reviver } = {}) { + if (!identity.isDocument(doc)) throw new TypeError("A document argument is required"); + const ctx = { + anchors: /* @__PURE__ */ new Map(), + doc, + keep: true, + mapAsMap: mapAsMap === true, + mapKeyWarned: false, + maxAliasCount: typeof maxAliasCount === "number" ? maxAliasCount : 100 + }; + const res = toJS.toJS(this, "", ctx); + if (typeof onAnchor === "function") for (const { count, res } of ctx.anchors.values()) onAnchor(res, count); + return typeof reviver === "function" ? applyReviver.applyReviver(reviver, { "": res }, "", res) : res; + } + }; + exports.NodeBase = NodeBase; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Alias.js +var require_Alias = /* @__PURE__ */ __commonJSMin(((exports) => { + var anchors = require_anchors(); + var visit = require_visit(); + var identity = require_identity(); + var Node = require_Node(); + var toJS = require_toJS(); + var Alias = class extends Node.NodeBase { + constructor(source) { + super(identity.ALIAS); + this.source = source; + Object.defineProperty(this, "tag", { set() { + throw new Error("Alias nodes cannot have tags"); + } }); + } + /** + * Resolve the value of this alias within `doc`, finding the last + * instance of the `source` anchor before this node. + */ + resolve(doc, ctx) { + let nodes; + if (ctx?.aliasResolveCache) nodes = ctx.aliasResolveCache; + else { + nodes = []; + visit.visit(doc, { Node: (_key, node) => { + if (identity.isAlias(node) || identity.hasAnchor(node)) nodes.push(node); + } }); + if (ctx) ctx.aliasResolveCache = nodes; + } + let found = void 0; + for (const node of nodes) { + if (node === this) break; + if (node.anchor === this.source) found = node; + } + return found; + } + toJSON(_arg, ctx) { + if (!ctx) return { source: this.source }; + const { anchors, doc, maxAliasCount } = ctx; + const source = this.resolve(doc, ctx); + if (!source) { + const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`; + throw new ReferenceError(msg); + } + let data = anchors.get(source); + if (!data) { + toJS.toJS(source, null, ctx); + data = anchors.get(source); + } + /* istanbul ignore if */ + if (data?.res === void 0) throw new ReferenceError("This should not happen: Alias anchor was not resolved?"); + if (maxAliasCount >= 0) { + data.count += 1; + if (data.aliasCount === 0) data.aliasCount = getAliasCount(doc, source, anchors); + if (data.count * data.aliasCount > maxAliasCount) throw new ReferenceError("Excessive alias count indicates a resource exhaustion attack"); + } + return data.res; + } + toString(ctx, _onComment, _onChompKeep) { + const src = `*${this.source}`; + if (ctx) { + anchors.anchorIsValid(this.source); + if (ctx.options.verifyAliasOrder && !ctx.anchors.has(this.source)) { + const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`; + throw new Error(msg); + } + if (ctx.implicitKey) return `${src} `; + } + return src; + } + }; + function getAliasCount(doc, node, anchors) { + if (identity.isAlias(node)) { + const source = node.resolve(doc); + const anchor = anchors && source && anchors.get(source); + return anchor ? anchor.count * anchor.aliasCount : 0; + } else if (identity.isCollection(node)) { + let count = 0; + for (const item of node.items) { + const c = getAliasCount(doc, item, anchors); + if (c > count) count = c; + } + return count; + } else if (identity.isPair(node)) { + const kc = getAliasCount(doc, node.key, anchors); + const vc = getAliasCount(doc, node.value, anchors); + return Math.max(kc, vc); + } + return 1; + } + exports.Alias = Alias; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Scalar.js +var require_Scalar = /* @__PURE__ */ __commonJSMin(((exports) => { + var identity = require_identity(); + var Node = require_Node(); + var toJS = require_toJS(); + const isScalarValue = (value) => !value || typeof value !== "function" && typeof value !== "object"; + var Scalar = class extends Node.NodeBase { + constructor(value) { + super(identity.SCALAR); + this.value = value; + } + toJSON(arg, ctx) { + return ctx?.keep ? this.value : toJS.toJS(this.value, arg, ctx); + } + toString() { + return String(this.value); + } + }; + Scalar.BLOCK_FOLDED = "BLOCK_FOLDED"; + Scalar.BLOCK_LITERAL = "BLOCK_LITERAL"; + Scalar.PLAIN = "PLAIN"; + Scalar.QUOTE_DOUBLE = "QUOTE_DOUBLE"; + Scalar.QUOTE_SINGLE = "QUOTE_SINGLE"; + exports.Scalar = Scalar; + exports.isScalarValue = isScalarValue; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/createNode.js +var require_createNode = /* @__PURE__ */ __commonJSMin(((exports) => { + var Alias = require_Alias(); + var identity = require_identity(); + var Scalar = require_Scalar(); + const defaultTagPrefix = "tag:yaml.org,2002:"; + function findTagObject(value, tagName, tags) { + if (tagName) { + const match = tags.filter((t) => t.tag === tagName); + const tagObj = match.find((t) => !t.format) ?? match[0]; + if (!tagObj) throw new Error(`Tag ${tagName} not found`); + return tagObj; + } + return tags.find((t) => t.identify?.(value) && !t.format); + } + function createNode(value, tagName, ctx) { + if (identity.isDocument(value)) value = value.contents; + if (identity.isNode(value)) return value; + if (identity.isPair(value)) { + const map = ctx.schema[identity.MAP].createNode?.(ctx.schema, null, ctx); + map.items.push(value); + return map; + } + if (value instanceof String || value instanceof Number || value instanceof Boolean || typeof BigInt !== "undefined" && value instanceof BigInt) value = value.valueOf(); + const { aliasDuplicateObjects, onAnchor, onTagObj, schema, sourceObjects } = ctx; + let ref = void 0; + if (aliasDuplicateObjects && value && typeof value === "object") { + ref = sourceObjects.get(value); + if (ref) { + ref.anchor ?? (ref.anchor = onAnchor(value)); + return new Alias.Alias(ref.anchor); + } else { + ref = { + anchor: null, + node: null + }; + sourceObjects.set(value, ref); + } + } + if (tagName?.startsWith("!!")) tagName = defaultTagPrefix + tagName.slice(2); + let tagObj = findTagObject(value, tagName, schema.tags); + if (!tagObj) { + if (value && typeof value.toJSON === "function") value = value.toJSON(); + if (!value || typeof value !== "object") { + const node = new Scalar.Scalar(value); + if (ref) ref.node = node; + return node; + } + tagObj = value instanceof Map ? schema[identity.MAP] : Symbol.iterator in Object(value) ? schema[identity.SEQ] : schema[identity.MAP]; + } + if (onTagObj) { + onTagObj(tagObj); + delete ctx.onTagObj; + } + const node = tagObj?.createNode ? tagObj.createNode(ctx.schema, value, ctx) : typeof tagObj?.nodeClass?.from === "function" ? tagObj.nodeClass.from(ctx.schema, value, ctx) : new Scalar.Scalar(value); + if (tagName) node.tag = tagName; + else if (!tagObj.default) node.tag = tagObj.tag; + if (ref) ref.node = node; + return node; + } + exports.createNode = createNode; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Collection.js +var require_Collection = /* @__PURE__ */ __commonJSMin(((exports) => { + var createNode = require_createNode(); + var identity = require_identity(); + var Node = require_Node(); + function collectionFromPath(schema, path, value) { + let v = value; + for (let i = path.length - 1; i >= 0; --i) { + const k = path[i]; + if (typeof k === "number" && Number.isInteger(k) && k >= 0) { + const a = []; + a[k] = v; + v = a; + } else v = new Map([[k, v]]); + } + return createNode.createNode(v, void 0, { + aliasDuplicateObjects: false, + keepUndefined: false, + onAnchor: () => { + throw new Error("This should not happen, please report a bug."); + }, + schema, + sourceObjects: /* @__PURE__ */ new Map() + }); + } + const isEmptyPath = (path) => path == null || typeof path === "object" && !!path[Symbol.iterator]().next().done; + var Collection = class extends Node.NodeBase { + constructor(type, schema) { + super(type); + Object.defineProperty(this, "schema", { + value: schema, + configurable: true, + enumerable: false, + writable: true + }); + } + /** + * Create a copy of this collection. + * + * @param schema - If defined, overwrites the original's schema + */ + clone(schema) { + const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this)); + if (schema) copy.schema = schema; + copy.items = copy.items.map((it) => identity.isNode(it) || identity.isPair(it) ? it.clone(schema) : it); + if (this.range) copy.range = this.range.slice(); + return copy; + } + /** + * Adds a value to the collection. For `!!map` and `!!omap` the value must + * be a Pair instance or a `{ key, value }` object, which may not have a key + * that already exists in the map. + */ + addIn(path, value) { + if (isEmptyPath(path)) this.add(value); + else { + const [key, ...rest] = path; + const node = this.get(key, true); + if (identity.isCollection(node)) node.addIn(rest, value); + else if (node === void 0 && this.schema) this.set(key, collectionFromPath(this.schema, rest, value)); + else throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`); + } + } + /** + * Removes a value from the collection. + * @returns `true` if the item was found and removed. + */ + deleteIn(path) { + const [key, ...rest] = path; + if (rest.length === 0) return this.delete(key); + const node = this.get(key, true); + if (identity.isCollection(node)) return node.deleteIn(rest); + else throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`); + } + /** + * Returns item at `key`, or `undefined` if not found. By default unwraps + * scalar values from their surrounding node; to disable set `keepScalar` to + * `true` (collections are always returned intact). + */ + getIn(path, keepScalar) { + const [key, ...rest] = path; + const node = this.get(key, true); + if (rest.length === 0) return !keepScalar && identity.isScalar(node) ? node.value : node; + else return identity.isCollection(node) ? node.getIn(rest, keepScalar) : void 0; + } + hasAllNullValues(allowScalar) { + return this.items.every((node) => { + if (!identity.isPair(node)) return false; + const n = node.value; + return n == null || allowScalar && identity.isScalar(n) && n.value == null && !n.commentBefore && !n.comment && !n.tag; + }); + } + /** + * Checks if the collection includes a value with the key `key`. + */ + hasIn(path) { + const [key, ...rest] = path; + if (rest.length === 0) return this.has(key); + const node = this.get(key, true); + return identity.isCollection(node) ? node.hasIn(rest) : false; + } + /** + * Sets a value in this collection. For `!!set`, `value` needs to be a + * boolean to add/remove the item from the set. + */ + setIn(path, value) { + const [key, ...rest] = path; + if (rest.length === 0) this.set(key, value); + else { + const node = this.get(key, true); + if (identity.isCollection(node)) node.setIn(rest, value); + else if (node === void 0 && this.schema) this.set(key, collectionFromPath(this.schema, rest, value)); + else throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`); + } + } + }; + exports.Collection = Collection; + exports.collectionFromPath = collectionFromPath; + exports.isEmptyPath = isEmptyPath; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyComment.js +var require_stringifyComment = /* @__PURE__ */ __commonJSMin(((exports) => { + /** + * Stringifies a comment. + * + * Empty comment lines are left empty, + * lines consisting of a single space are replaced by `#`, + * and all other lines are prefixed with a `#`. + */ + const stringifyComment = (str) => str.replace(/^(?!$)(?: $)?/gm, "#"); + function indentComment(comment, indent) { + if (/^\n+$/.test(comment)) return comment.substring(1); + return indent ? comment.replace(/^(?! *$)/gm, indent) : comment; + } + const lineComment = (str, indent, comment) => str.endsWith("\n") ? indentComment(comment, indent) : comment.includes("\n") ? "\n" + indentComment(comment, indent) : (str.endsWith(" ") ? "" : " ") + comment; + exports.indentComment = indentComment; + exports.lineComment = lineComment; + exports.stringifyComment = stringifyComment; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/foldFlowLines.js +var require_foldFlowLines = /* @__PURE__ */ __commonJSMin(((exports) => { + const FOLD_FLOW = "flow"; + const FOLD_BLOCK = "block"; + const FOLD_QUOTED = "quoted"; + /** + * Tries to keep input at up to `lineWidth` characters, splitting only on spaces + * not followed by newlines or spaces unless `mode` is `'quoted'`. Lines are + * terminated with `\n` and started with `indent`. + */ + function foldFlowLines(text, indent, mode = "flow", { indentAtStart, lineWidth = 80, minContentWidth = 20, onFold, onOverflow } = {}) { + if (!lineWidth || lineWidth < 0) return text; + if (lineWidth < minContentWidth) minContentWidth = 0; + const endStep = Math.max(1 + minContentWidth, 1 + lineWidth - indent.length); + if (text.length <= endStep) return text; + const folds = []; + const escapedFolds = {}; + let end = lineWidth - indent.length; + if (typeof indentAtStart === "number") if (indentAtStart > lineWidth - Math.max(2, minContentWidth)) folds.push(0); + else end = lineWidth - indentAtStart; + let split = void 0; + let prev = void 0; + let overflow = false; + let i = -1; + let escStart = -1; + let escEnd = -1; + if (mode === FOLD_BLOCK) { + i = consumeMoreIndentedLines(text, i, indent.length); + if (i !== -1) end = i + endStep; + } + for (let ch; ch = text[i += 1];) { + if (mode === FOLD_QUOTED && ch === "\\") { + escStart = i; + switch (text[i + 1]) { + case "x": + i += 3; + break; + case "u": + i += 5; + break; + case "U": + i += 9; + break; + default: i += 1; + } + escEnd = i; + } + if (ch === "\n") { + if (mode === FOLD_BLOCK) i = consumeMoreIndentedLines(text, i, indent.length); + end = i + indent.length + endStep; + split = void 0; + } else { + if (ch === " " && prev && prev !== " " && prev !== "\n" && prev !== " ") { + const next = text[i + 1]; + if (next && next !== " " && next !== "\n" && next !== " ") split = i; + } + if (i >= end) if (split) { + folds.push(split); + end = split + endStep; + split = void 0; + } else if (mode === FOLD_QUOTED) { + while (prev === " " || prev === " ") { + prev = ch; + ch = text[i += 1]; + overflow = true; + } + const j = i > escEnd + 1 ? i - 2 : escStart - 1; + if (escapedFolds[j]) return text; + folds.push(j); + escapedFolds[j] = true; + end = j + endStep; + split = void 0; + } else overflow = true; + } + prev = ch; + } + if (overflow && onOverflow) onOverflow(); + if (folds.length === 0) return text; + if (onFold) onFold(); + let res = text.slice(0, folds[0]); + for (let i = 0; i < folds.length; ++i) { + const fold = folds[i]; + const end = folds[i + 1] || text.length; + if (fold === 0) res = `\n${indent}${text.slice(0, end)}`; + else { + if (mode === FOLD_QUOTED && escapedFolds[fold]) res += `${text[fold]}\\`; + res += `\n${indent}${text.slice(fold + 1, end)}`; + } + } + return res; + } + /** + * Presumes `i + 1` is at the start of a line + * @returns index of last newline in more-indented block + */ + function consumeMoreIndentedLines(text, i, indent) { + let end = i; + let start = i + 1; + let ch = text[start]; + while (ch === " " || ch === " ") if (i < start + indent) ch = text[++i]; + else { + do + ch = text[++i]; + while (ch && ch !== "\n"); + end = i; + start = i + 1; + ch = text[start]; + } + return end; + } + exports.FOLD_BLOCK = FOLD_BLOCK; + exports.FOLD_FLOW = FOLD_FLOW; + exports.FOLD_QUOTED = FOLD_QUOTED; + exports.foldFlowLines = foldFlowLines; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyString.js +var require_stringifyString = /* @__PURE__ */ __commonJSMin(((exports) => { + var Scalar = require_Scalar(); + var foldFlowLines = require_foldFlowLines(); + const getFoldOptions = (ctx, isBlock) => ({ + indentAtStart: isBlock ? ctx.indent.length : ctx.indentAtStart, + lineWidth: ctx.options.lineWidth, + minContentWidth: ctx.options.minContentWidth + }); + const containsDocumentMarker = (str) => /^(%|---|\.\.\.)/m.test(str); + function lineLengthOverLimit(str, lineWidth, indentLength) { + if (!lineWidth || lineWidth < 0) return false; + const limit = lineWidth - indentLength; + const strLen = str.length; + if (strLen <= limit) return false; + for (let i = 0, start = 0; i < strLen; ++i) if (str[i] === "\n") { + if (i - start > limit) return true; + start = i + 1; + if (strLen - start <= limit) return false; + } + return true; + } + function doubleQuotedString(value, ctx) { + const json = JSON.stringify(value); + if (ctx.options.doubleQuotedAsJSON) return json; + const { implicitKey } = ctx; + const minMultiLineLength = ctx.options.doubleQuotedMinMultiLineLength; + const indent = ctx.indent || (containsDocumentMarker(value) ? " " : ""); + let str = ""; + let start = 0; + for (let i = 0, ch = json[i]; ch; ch = json[++i]) { + if (ch === " " && json[i + 1] === "\\" && json[i + 2] === "n") { + str += json.slice(start, i) + "\\ "; + i += 1; + start = i; + ch = "\\"; + } + if (ch === "\\") switch (json[i + 1]) { + case "u": + { + str += json.slice(start, i); + const code = json.substr(i + 2, 4); + switch (code) { + case "0000": + str += "\\0"; + break; + case "0007": + str += "\\a"; + break; + case "000b": + str += "\\v"; + break; + case "001b": + str += "\\e"; + break; + case "0085": + str += "\\N"; + break; + case "00a0": + str += "\\_"; + break; + case "2028": + str += "\\L"; + break; + case "2029": + str += "\\P"; + break; + default: if (code.substr(0, 2) === "00") str += "\\x" + code.substr(2); + else str += json.substr(i, 6); + } + i += 5; + start = i + 1; + } + break; + case "n": + if (implicitKey || json[i + 2] === "\"" || json.length < minMultiLineLength) i += 1; + else { + str += json.slice(start, i) + "\n\n"; + while (json[i + 2] === "\\" && json[i + 3] === "n" && json[i + 4] !== "\"") { + str += "\n"; + i += 2; + } + str += indent; + if (json[i + 2] === " ") str += "\\"; + i += 1; + start = i + 1; + } + break; + default: i += 1; + } + } + str = start ? str + json.slice(start) : json; + return implicitKey ? str : foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_QUOTED, getFoldOptions(ctx, false)); + } + function singleQuotedString(value, ctx) { + if (ctx.options.singleQuote === false || ctx.implicitKey && value.includes("\n") || /[ \t]\n|\n[ \t]/.test(value)) return doubleQuotedString(value, ctx); + const indent = ctx.indent || (containsDocumentMarker(value) ? " " : ""); + const res = "'" + value.replace(/'/g, "''").replace(/\n+/g, `$&\n${indent}`) + "'"; + return ctx.implicitKey ? res : foldFlowLines.foldFlowLines(res, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx, false)); + } + function quotedString(value, ctx) { + const { singleQuote } = ctx.options; + let qs; + if (singleQuote === false) qs = doubleQuotedString; + else { + const hasDouble = value.includes("\""); + const hasSingle = value.includes("'"); + if (hasDouble && !hasSingle) qs = singleQuotedString; + else if (hasSingle && !hasDouble) qs = doubleQuotedString; + else qs = singleQuote ? singleQuotedString : doubleQuotedString; + } + return qs(value, ctx); + } + let blockEndNewlines; + try { + blockEndNewlines = /* @__PURE__ */ new RegExp("(^|(?\n"; + let chomp; + let endStart; + for (endStart = value.length; endStart > 0; --endStart) { + const ch = value[endStart - 1]; + if (ch !== "\n" && ch !== " " && ch !== " ") break; + } + let end = value.substring(endStart); + const endNlPos = end.indexOf("\n"); + if (endNlPos === -1) chomp = "-"; + else if (value === end || endNlPos !== end.length - 1) { + chomp = "+"; + if (onChompKeep) onChompKeep(); + } else chomp = ""; + if (end) { + value = value.slice(0, -end.length); + if (end[end.length - 1] === "\n") end = end.slice(0, -1); + end = end.replace(blockEndNewlines, `$&${indent}`); + } + let startWithSpace = false; + let startEnd; + let startNlPos = -1; + for (startEnd = 0; startEnd < value.length; ++startEnd) { + const ch = value[startEnd]; + if (ch === " ") startWithSpace = true; + else if (ch === "\n") startNlPos = startEnd; + else break; + } + let start = value.substring(0, startNlPos < startEnd ? startNlPos + 1 : startEnd); + if (start) { + value = value.substring(start.length); + start = start.replace(/\n+/g, `$&${indent}`); + } + let header = (startWithSpace ? indent ? "2" : "1" : "") + chomp; + if (comment) { + header += " " + commentString(comment.replace(/ ?[\r\n]+/g, " ")); + if (onComment) onComment(); + } + if (!literal) { + const foldedValue = value.replace(/\n+/g, "\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, "$1$2").replace(/\n+/g, `$&${indent}`); + let literalFallback = false; + const foldOptions = getFoldOptions(ctx, true); + if (blockQuote !== "folded" && type !== Scalar.Scalar.BLOCK_FOLDED) foldOptions.onOverflow = () => { + literalFallback = true; + }; + const body = foldFlowLines.foldFlowLines(`${start}${foldedValue}${end}`, indent, foldFlowLines.FOLD_BLOCK, foldOptions); + if (!literalFallback) return `>${header}\n${indent}${body}`; + } + value = value.replace(/\n+/g, `$&${indent}`); + return `|${header}\n${indent}${start}${value}${end}`; + } + function plainString(item, ctx, onComment, onChompKeep) { + const { type, value } = item; + const { actualString, implicitKey, indent, indentStep, inFlow } = ctx; + if (implicitKey && value.includes("\n") || inFlow && /[[\]{},]/.test(value)) return quotedString(value, ctx); + if (/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) return implicitKey || inFlow || !value.includes("\n") ? quotedString(value, ctx) : blockString(item, ctx, onComment, onChompKeep); + if (!implicitKey && !inFlow && type !== Scalar.Scalar.PLAIN && value.includes("\n")) return blockString(item, ctx, onComment, onChompKeep); + if (containsDocumentMarker(value)) { + if (indent === "") { + ctx.forceBlockIndent = true; + return blockString(item, ctx, onComment, onChompKeep); + } else if (implicitKey && indent === indentStep) return quotedString(value, ctx); + } + const str = value.replace(/\n+/g, `$&\n${indent}`); + if (actualString) { + const test = (tag) => tag.default && tag.tag !== "tag:yaml.org,2002:str" && tag.test?.test(str); + const { compat, tags } = ctx.doc.schema; + if (tags.some(test) || compat?.some(test)) return quotedString(value, ctx); + } + return implicitKey ? str : foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx, false)); + } + function stringifyString(item, ctx, onComment, onChompKeep) { + const { implicitKey, inFlow } = ctx; + const ss = typeof item.value === "string" ? item : Object.assign({}, item, { value: String(item.value) }); + let { type } = item; + if (type !== Scalar.Scalar.QUOTE_DOUBLE) { + if (/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(ss.value)) type = Scalar.Scalar.QUOTE_DOUBLE; + } + const _stringify = (_type) => { + switch (_type) { + case Scalar.Scalar.BLOCK_FOLDED: + case Scalar.Scalar.BLOCK_LITERAL: return implicitKey || inFlow ? quotedString(ss.value, ctx) : blockString(ss, ctx, onComment, onChompKeep); + case Scalar.Scalar.QUOTE_DOUBLE: return doubleQuotedString(ss.value, ctx); + case Scalar.Scalar.QUOTE_SINGLE: return singleQuotedString(ss.value, ctx); + case Scalar.Scalar.PLAIN: return plainString(ss, ctx, onComment, onChompKeep); + default: return null; + } + }; + let res = _stringify(type); + if (res === null) { + const { defaultKeyType, defaultStringType } = ctx.options; + const t = implicitKey && defaultKeyType || defaultStringType; + res = _stringify(t); + if (res === null) throw new Error(`Unsupported default string type ${t}`); + } + return res; + } + exports.stringifyString = stringifyString; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringify.js +var require_stringify = /* @__PURE__ */ __commonJSMin(((exports) => { + var anchors = require_anchors(); + var identity = require_identity(); + var stringifyComment = require_stringifyComment(); + var stringifyString = require_stringifyString(); + function createStringifyContext(doc, options) { + const opt = Object.assign({ + blockQuote: true, + commentString: stringifyComment.stringifyComment, + defaultKeyType: null, + defaultStringType: "PLAIN", + directives: null, + doubleQuotedAsJSON: false, + doubleQuotedMinMultiLineLength: 40, + falseStr: "false", + flowCollectionPadding: true, + indentSeq: true, + lineWidth: 80, + minContentWidth: 20, + nullStr: "null", + simpleKeys: false, + singleQuote: null, + trueStr: "true", + verifyAliasOrder: true + }, doc.schema.toStringOptions, options); + let inFlow; + switch (opt.collectionStyle) { + case "block": + inFlow = false; + break; + case "flow": + inFlow = true; + break; + default: inFlow = null; + } + return { + anchors: /* @__PURE__ */ new Set(), + doc, + flowCollectionPadding: opt.flowCollectionPadding ? " " : "", + indent: "", + indentStep: typeof opt.indent === "number" ? " ".repeat(opt.indent) : " ", + inFlow, + options: opt + }; + } + function getTagObject(tags, item) { + if (item.tag) { + const match = tags.filter((t) => t.tag === item.tag); + if (match.length > 0) return match.find((t) => t.format === item.format) ?? match[0]; + } + let tagObj = void 0; + let obj; + if (identity.isScalar(item)) { + obj = item.value; + let match = tags.filter((t) => t.identify?.(obj)); + if (match.length > 1) { + const testMatch = match.filter((t) => t.test); + if (testMatch.length > 0) match = testMatch; + } + tagObj = match.find((t) => t.format === item.format) ?? match.find((t) => !t.format); + } else { + obj = item; + tagObj = tags.find((t) => t.nodeClass && obj instanceof t.nodeClass); + } + if (!tagObj) { + const name = obj?.constructor?.name ?? (obj === null ? "null" : typeof obj); + throw new Error(`Tag not resolved for ${name} value`); + } + return tagObj; + } + function stringifyProps(node, tagObj, { anchors: anchors$1, doc }) { + if (!doc.directives) return ""; + const props = []; + const anchor = (identity.isScalar(node) || identity.isCollection(node)) && node.anchor; + if (anchor && anchors.anchorIsValid(anchor)) { + anchors$1.add(anchor); + props.push(`&${anchor}`); + } + const tag = node.tag ?? (tagObj.default ? null : tagObj.tag); + if (tag) props.push(doc.directives.tagString(tag)); + return props.join(" "); + } + function stringify(item, ctx, onComment, onChompKeep) { + if (identity.isPair(item)) return item.toString(ctx, onComment, onChompKeep); + if (identity.isAlias(item)) { + if (ctx.doc.directives) return item.toString(ctx); + if (ctx.resolvedAliases?.has(item)) throw new TypeError(`Cannot stringify circular structure without alias nodes`); + else { + if (ctx.resolvedAliases) ctx.resolvedAliases.add(item); + else ctx.resolvedAliases = new Set([item]); + item = item.resolve(ctx.doc); + } + } + let tagObj = void 0; + const node = identity.isNode(item) ? item : ctx.doc.createNode(item, { onTagObj: (o) => tagObj = o }); + tagObj ?? (tagObj = getTagObject(ctx.doc.schema.tags, node)); + const props = stringifyProps(node, tagObj, ctx); + if (props.length > 0) ctx.indentAtStart = (ctx.indentAtStart ?? 0) + props.length + 1; + const str = typeof tagObj.stringify === "function" ? tagObj.stringify(node, ctx, onComment, onChompKeep) : identity.isScalar(node) ? stringifyString.stringifyString(node, ctx, onComment, onChompKeep) : node.toString(ctx, onComment, onChompKeep); + if (!props) return str; + return identity.isScalar(node) || str[0] === "{" || str[0] === "[" ? `${props} ${str}` : `${props}\n${ctx.indent}${str}`; + } + exports.createStringifyContext = createStringifyContext; + exports.stringify = stringify; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyPair.js +var require_stringifyPair = /* @__PURE__ */ __commonJSMin(((exports) => { + var identity = require_identity(); + var Scalar = require_Scalar(); + var stringify = require_stringify(); + var stringifyComment = require_stringifyComment(); + function stringifyPair({ key, value }, ctx, onComment, onChompKeep) { + const { allNullValues, doc, indent, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx; + let keyComment = identity.isNode(key) && key.comment || null; + if (simpleKeys) { + if (keyComment) throw new Error("With simple keys, key nodes cannot have comments"); + if (identity.isCollection(key) || !identity.isNode(key) && typeof key === "object") throw new Error("With simple keys, collection cannot be used as a key value"); + } + let explicitKey = !simpleKeys && (!key || keyComment && value == null && !ctx.inFlow || identity.isCollection(key) || (identity.isScalar(key) ? key.type === Scalar.Scalar.BLOCK_FOLDED || key.type === Scalar.Scalar.BLOCK_LITERAL : typeof key === "object")); + ctx = Object.assign({}, ctx, { + allNullValues: false, + implicitKey: !explicitKey && (simpleKeys || !allNullValues), + indent: indent + indentStep + }); + let keyCommentDone = false; + let chompKeep = false; + let str = stringify.stringify(key, ctx, () => keyCommentDone = true, () => chompKeep = true); + if (!explicitKey && !ctx.inFlow && str.length > 1024) { + if (simpleKeys) throw new Error("With simple keys, single line scalar must not span more than 1024 characters"); + explicitKey = true; + } + if (ctx.inFlow) { + if (allNullValues || value == null) { + if (keyCommentDone && onComment) onComment(); + return str === "" ? "?" : explicitKey ? `? ${str}` : str; + } + } else if (allNullValues && !simpleKeys || value == null && explicitKey) { + str = `? ${str}`; + if (keyComment && !keyCommentDone) str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment)); + else if (chompKeep && onChompKeep) onChompKeep(); + return str; + } + if (keyCommentDone) keyComment = null; + if (explicitKey) { + if (keyComment) str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment)); + str = `? ${str}\n${indent}:`; + } else { + str = `${str}:`; + if (keyComment) str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment)); + } + let vsb, vcb, valueComment; + if (identity.isNode(value)) { + vsb = !!value.spaceBefore; + vcb = value.commentBefore; + valueComment = value.comment; + } else { + vsb = false; + vcb = null; + valueComment = null; + if (value && typeof value === "object") value = doc.createNode(value); + } + ctx.implicitKey = false; + if (!explicitKey && !keyComment && identity.isScalar(value)) ctx.indentAtStart = str.length + 1; + chompKeep = false; + if (!indentSeq && indentStep.length >= 2 && !ctx.inFlow && !explicitKey && identity.isSeq(value) && !value.flow && !value.tag && !value.anchor) ctx.indent = ctx.indent.substring(2); + let valueCommentDone = false; + const valueStr = stringify.stringify(value, ctx, () => valueCommentDone = true, () => chompKeep = true); + let ws = " "; + if (keyComment || vsb || vcb) { + ws = vsb ? "\n" : ""; + if (vcb) { + const cs = commentString(vcb); + ws += `\n${stringifyComment.indentComment(cs, ctx.indent)}`; + } + if (valueStr === "" && !ctx.inFlow) { + if (ws === "\n" && valueComment) ws = "\n\n"; + } else ws += `\n${ctx.indent}`; + } else if (!explicitKey && identity.isCollection(value)) { + const vs0 = valueStr[0]; + const nl0 = valueStr.indexOf("\n"); + const hasNewline = nl0 !== -1; + const flow = ctx.inFlow ?? value.flow ?? value.items.length === 0; + if (hasNewline || !flow) { + let hasPropsLine = false; + if (hasNewline && (vs0 === "&" || vs0 === "!")) { + let sp0 = valueStr.indexOf(" "); + if (vs0 === "&" && sp0 !== -1 && sp0 < nl0 && valueStr[sp0 + 1] === "!") sp0 = valueStr.indexOf(" ", sp0 + 1); + if (sp0 === -1 || nl0 < sp0) hasPropsLine = true; + } + if (!hasPropsLine) ws = `\n${ctx.indent}`; + } + } else if (valueStr === "" || valueStr[0] === "\n") ws = ""; + str += ws + valueStr; + if (ctx.inFlow) { + if (valueCommentDone && onComment) onComment(); + } else if (valueComment && !valueCommentDone) str += stringifyComment.lineComment(str, ctx.indent, commentString(valueComment)); + else if (chompKeep && onChompKeep) onChompKeep(); + return str; + } + exports.stringifyPair = stringifyPair; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/log.js +var require_log = /* @__PURE__ */ __commonJSMin(((exports) => { + var node_process$2 = __require("process"); + function debug(logLevel, ...messages) { + if (logLevel === "debug") console.log(...messages); + } + function warn(logLevel, warning) { + if (logLevel === "debug" || logLevel === "warn") if (typeof node_process$2.emitWarning === "function") node_process$2.emitWarning(warning); + else console.warn(warning); + } + exports.debug = debug; + exports.warn = warn; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/merge.js +var require_merge = /* @__PURE__ */ __commonJSMin(((exports) => { + var identity = require_identity(); + var Scalar = require_Scalar(); + const MERGE_KEY = "<<"; + const merge = { + identify: (value) => value === MERGE_KEY || typeof value === "symbol" && value.description === MERGE_KEY, + default: "key", + tag: "tag:yaml.org,2002:merge", + test: /^<<$/, + resolve: () => Object.assign(new Scalar.Scalar(Symbol(MERGE_KEY)), { addToJSMap: addMergeToJSMap }), + stringify: () => MERGE_KEY + }; + const isMergeKey = (ctx, key) => (merge.identify(key) || identity.isScalar(key) && (!key.type || key.type === Scalar.Scalar.PLAIN) && merge.identify(key.value)) && ctx?.doc.schema.tags.some((tag) => tag.tag === merge.tag && tag.default); + function addMergeToJSMap(ctx, map, value) { + value = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value; + if (identity.isSeq(value)) for (const it of value.items) mergeValue(ctx, map, it); + else if (Array.isArray(value)) for (const it of value) mergeValue(ctx, map, it); + else mergeValue(ctx, map, value); + } + function mergeValue(ctx, map, value) { + const source = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value; + if (!identity.isMap(source)) throw new Error("Merge sources must be maps or map aliases"); + const srcMap = source.toJSON(null, ctx, Map); + for (const [key, value] of srcMap) if (map instanceof Map) { + if (!map.has(key)) map.set(key, value); + } else if (map instanceof Set) map.add(key); + else if (!Object.prototype.hasOwnProperty.call(map, key)) Object.defineProperty(map, key, { + value, + writable: true, + enumerable: true, + configurable: true + }); + return map; + } + exports.addMergeToJSMap = addMergeToJSMap; + exports.isMergeKey = isMergeKey; + exports.merge = merge; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/addPairToJSMap.js +var require_addPairToJSMap = /* @__PURE__ */ __commonJSMin(((exports) => { + var log = require_log(); + var merge = require_merge(); + var stringify = require_stringify(); + var identity = require_identity(); + var toJS = require_toJS(); + function addPairToJSMap(ctx, map, { key, value }) { + if (identity.isNode(key) && key.addToJSMap) key.addToJSMap(ctx, map, value); + else if (merge.isMergeKey(ctx, key)) merge.addMergeToJSMap(ctx, map, value); + else { + const jsKey = toJS.toJS(key, "", ctx); + if (map instanceof Map) map.set(jsKey, toJS.toJS(value, jsKey, ctx)); + else if (map instanceof Set) map.add(jsKey); + else { + const stringKey = stringifyKey(key, jsKey, ctx); + const jsValue = toJS.toJS(value, stringKey, ctx); + if (stringKey in map) Object.defineProperty(map, stringKey, { + value: jsValue, + writable: true, + enumerable: true, + configurable: true + }); + else map[stringKey] = jsValue; + } + } + return map; + } + function stringifyKey(key, jsKey, ctx) { + if (jsKey === null) return ""; + if (typeof jsKey !== "object") return String(jsKey); + if (identity.isNode(key) && ctx?.doc) { + const strCtx = stringify.createStringifyContext(ctx.doc, {}); + strCtx.anchors = /* @__PURE__ */ new Set(); + for (const node of ctx.anchors.keys()) strCtx.anchors.add(node.anchor); + strCtx.inFlow = true; + strCtx.inStringifyKey = true; + const strKey = key.toString(strCtx); + if (!ctx.mapKeyWarned) { + let jsonStr = JSON.stringify(strKey); + if (jsonStr.length > 40) jsonStr = jsonStr.substring(0, 36) + "...\""; + log.warn(ctx.doc.options.logLevel, `Keys with collection values will be stringified due to JS Object restrictions: ${jsonStr}. Set mapAsMap: true to use object keys.`); + ctx.mapKeyWarned = true; + } + return strKey; + } + return JSON.stringify(jsKey); + } + exports.addPairToJSMap = addPairToJSMap; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Pair.js +var require_Pair = /* @__PURE__ */ __commonJSMin(((exports) => { + var createNode = require_createNode(); + var stringifyPair = require_stringifyPair(); + var addPairToJSMap = require_addPairToJSMap(); + var identity = require_identity(); + function createPair(key, value, ctx) { + return new Pair(createNode.createNode(key, void 0, ctx), createNode.createNode(value, void 0, ctx)); + } + var Pair = class Pair { + constructor(key, value = null) { + Object.defineProperty(this, identity.NODE_TYPE, { value: identity.PAIR }); + this.key = key; + this.value = value; + } + clone(schema) { + let { key, value } = this; + if (identity.isNode(key)) key = key.clone(schema); + if (identity.isNode(value)) value = value.clone(schema); + return new Pair(key, value); + } + toJSON(_, ctx) { + const pair = ctx?.mapAsMap ? /* @__PURE__ */ new Map() : {}; + return addPairToJSMap.addPairToJSMap(ctx, pair, this); + } + toString(ctx, onComment, onChompKeep) { + return ctx?.doc ? stringifyPair.stringifyPair(this, ctx, onComment, onChompKeep) : JSON.stringify(this); + } + }; + exports.Pair = Pair; + exports.createPair = createPair; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyCollection.js +var require_stringifyCollection = /* @__PURE__ */ __commonJSMin(((exports) => { + var identity = require_identity(); + var stringify = require_stringify(); + var stringifyComment = require_stringifyComment(); + function stringifyCollection(collection, ctx, options) { + return (ctx.inFlow ?? collection.flow ? stringifyFlowCollection : stringifyBlockCollection)(collection, ctx, options); + } + function stringifyBlockCollection({ comment, items }, ctx, { blockItemPrefix, flowChars, itemIndent, onChompKeep, onComment }) { + const { indent, options: { commentString } } = ctx; + const itemCtx = Object.assign({}, ctx, { + indent: itemIndent, + type: null + }); + let chompKeep = false; + const lines = []; + for (let i = 0; i < items.length; ++i) { + const item = items[i]; + let comment = null; + if (identity.isNode(item)) { + if (!chompKeep && item.spaceBefore) lines.push(""); + addCommentBefore(ctx, lines, item.commentBefore, chompKeep); + if (item.comment) comment = item.comment; + } else if (identity.isPair(item)) { + const ik = identity.isNode(item.key) ? item.key : null; + if (ik) { + if (!chompKeep && ik.spaceBefore) lines.push(""); + addCommentBefore(ctx, lines, ik.commentBefore, chompKeep); + } + } + chompKeep = false; + let str = stringify.stringify(item, itemCtx, () => comment = null, () => chompKeep = true); + if (comment) str += stringifyComment.lineComment(str, itemIndent, commentString(comment)); + if (chompKeep && comment) chompKeep = false; + lines.push(blockItemPrefix + str); + } + let str; + if (lines.length === 0) str = flowChars.start + flowChars.end; + else { + str = lines[0]; + for (let i = 1; i < lines.length; ++i) { + const line = lines[i]; + str += line ? `\n${indent}${line}` : "\n"; + } + } + if (comment) { + str += "\n" + stringifyComment.indentComment(commentString(comment), indent); + if (onComment) onComment(); + } else if (chompKeep && onChompKeep) onChompKeep(); + return str; + } + function stringifyFlowCollection({ items }, ctx, { flowChars, itemIndent }) { + const { indent, indentStep, flowCollectionPadding: fcPadding, options: { commentString } } = ctx; + itemIndent += indentStep; + const itemCtx = Object.assign({}, ctx, { + indent: itemIndent, + inFlow: true, + type: null + }); + let reqNewline = false; + let linesAtValue = 0; + const lines = []; + for (let i = 0; i < items.length; ++i) { + const item = items[i]; + let comment = null; + if (identity.isNode(item)) { + if (item.spaceBefore) lines.push(""); + addCommentBefore(ctx, lines, item.commentBefore, false); + if (item.comment) comment = item.comment; + } else if (identity.isPair(item)) { + const ik = identity.isNode(item.key) ? item.key : null; + if (ik) { + if (ik.spaceBefore) lines.push(""); + addCommentBefore(ctx, lines, ik.commentBefore, false); + if (ik.comment) reqNewline = true; + } + const iv = identity.isNode(item.value) ? item.value : null; + if (iv) { + if (iv.comment) comment = iv.comment; + if (iv.commentBefore) reqNewline = true; + } else if (item.value == null && ik?.comment) comment = ik.comment; + } + if (comment) reqNewline = true; + let str = stringify.stringify(item, itemCtx, () => comment = null); + if (i < items.length - 1) str += ","; + if (comment) str += stringifyComment.lineComment(str, itemIndent, commentString(comment)); + if (!reqNewline && (lines.length > linesAtValue || str.includes("\n"))) reqNewline = true; + lines.push(str); + linesAtValue = lines.length; + } + const { start, end } = flowChars; + if (lines.length === 0) return start + end; + else { + if (!reqNewline) { + const len = lines.reduce((sum, line) => sum + line.length + 2, 2); + reqNewline = ctx.options.lineWidth > 0 && len > ctx.options.lineWidth; + } + if (reqNewline) { + let str = start; + for (const line of lines) str += line ? `\n${indentStep}${indent}${line}` : "\n"; + return `${str}\n${indent}${end}`; + } else return `${start}${fcPadding}${lines.join(" ")}${fcPadding}${end}`; + } + } + function addCommentBefore({ indent, options: { commentString } }, lines, comment, chompKeep) { + if (comment && chompKeep) comment = comment.replace(/^\n+/, ""); + if (comment) { + const ic = stringifyComment.indentComment(commentString(comment), indent); + lines.push(ic.trimStart()); + } + } + exports.stringifyCollection = stringifyCollection; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/YAMLMap.js +var require_YAMLMap = /* @__PURE__ */ __commonJSMin(((exports) => { + var stringifyCollection = require_stringifyCollection(); + var addPairToJSMap = require_addPairToJSMap(); + var Collection = require_Collection(); + var identity = require_identity(); + var Pair = require_Pair(); + var Scalar = require_Scalar(); + function findPair(items, key) { + const k = identity.isScalar(key) ? key.value : key; + for (const it of items) if (identity.isPair(it)) { + if (it.key === key || it.key === k) return it; + if (identity.isScalar(it.key) && it.key.value === k) return it; + } + } + var YAMLMap = class extends Collection.Collection { + static get tagName() { + return "tag:yaml.org,2002:map"; + } + constructor(schema) { + super(identity.MAP, schema); + this.items = []; + } + /** + * A generic collection parsing method that can be extended + * to other node classes that inherit from YAMLMap + */ + static from(schema, obj, ctx) { + const { keepUndefined, replacer } = ctx; + const map = new this(schema); + const add = (key, value) => { + if (typeof replacer === "function") value = replacer.call(obj, key, value); + else if (Array.isArray(replacer) && !replacer.includes(key)) return; + if (value !== void 0 || keepUndefined) map.items.push(Pair.createPair(key, value, ctx)); + }; + if (obj instanceof Map) for (const [key, value] of obj) add(key, value); + else if (obj && typeof obj === "object") for (const key of Object.keys(obj)) add(key, obj[key]); + if (typeof schema.sortMapEntries === "function") map.items.sort(schema.sortMapEntries); + return map; + } + /** + * Adds a value to the collection. + * + * @param overwrite - If not set `true`, using a key that is already in the + * collection will throw. Otherwise, overwrites the previous value. + */ + add(pair, overwrite) { + let _pair; + if (identity.isPair(pair)) _pair = pair; + else if (!pair || typeof pair !== "object" || !("key" in pair)) _pair = new Pair.Pair(pair, pair?.value); + else _pair = new Pair.Pair(pair.key, pair.value); + const prev = findPair(this.items, _pair.key); + const sortEntries = this.schema?.sortMapEntries; + if (prev) { + if (!overwrite) throw new Error(`Key ${_pair.key} already set`); + if (identity.isScalar(prev.value) && Scalar.isScalarValue(_pair.value)) prev.value.value = _pair.value; + else prev.value = _pair.value; + } else if (sortEntries) { + const i = this.items.findIndex((item) => sortEntries(_pair, item) < 0); + if (i === -1) this.items.push(_pair); + else this.items.splice(i, 0, _pair); + } else this.items.push(_pair); + } + delete(key) { + const it = findPair(this.items, key); + if (!it) return false; + return this.items.splice(this.items.indexOf(it), 1).length > 0; + } + get(key, keepScalar) { + const node = findPair(this.items, key)?.value; + return (!keepScalar && identity.isScalar(node) ? node.value : node) ?? void 0; + } + has(key) { + return !!findPair(this.items, key); + } + set(key, value) { + this.add(new Pair.Pair(key, value), true); + } + /** + * @param ctx - Conversion context, originally set in Document#toJS() + * @param {Class} Type - If set, forces the returned collection type + * @returns Instance of Type, Map, or Object + */ + toJSON(_, ctx, Type) { + const map = Type ? new Type() : ctx?.mapAsMap ? /* @__PURE__ */ new Map() : {}; + if (ctx?.onCreate) ctx.onCreate(map); + for (const item of this.items) addPairToJSMap.addPairToJSMap(ctx, map, item); + return map; + } + toString(ctx, onComment, onChompKeep) { + if (!ctx) return JSON.stringify(this); + for (const item of this.items) if (!identity.isPair(item)) throw new Error(`Map items must all be pairs; found ${JSON.stringify(item)} instead`); + if (!ctx.allNullValues && this.hasAllNullValues(false)) ctx = Object.assign({}, ctx, { allNullValues: true }); + return stringifyCollection.stringifyCollection(this, ctx, { + blockItemPrefix: "", + flowChars: { + start: "{", + end: "}" + }, + itemIndent: ctx.indent || "", + onChompKeep, + onComment + }); + } + }; + exports.YAMLMap = YAMLMap; + exports.findPair = findPair; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/map.js +var require_map = /* @__PURE__ */ __commonJSMin(((exports) => { + var identity = require_identity(); + var YAMLMap = require_YAMLMap(); + exports.map = { + collection: "map", + default: true, + nodeClass: YAMLMap.YAMLMap, + tag: "tag:yaml.org,2002:map", + resolve(map, onError) { + if (!identity.isMap(map)) onError("Expected a mapping for this tag"); + return map; + }, + createNode: (schema, obj, ctx) => YAMLMap.YAMLMap.from(schema, obj, ctx) + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/YAMLSeq.js +var require_YAMLSeq = /* @__PURE__ */ __commonJSMin(((exports) => { + var createNode = require_createNode(); + var stringifyCollection = require_stringifyCollection(); + var Collection = require_Collection(); + var identity = require_identity(); + var Scalar = require_Scalar(); + var toJS = require_toJS(); + var YAMLSeq = class extends Collection.Collection { + static get tagName() { + return "tag:yaml.org,2002:seq"; + } + constructor(schema) { + super(identity.SEQ, schema); + this.items = []; + } + add(value) { + this.items.push(value); + } + /** + * Removes a value from the collection. + * + * `key` must contain a representation of an integer for this to succeed. + * It may be wrapped in a `Scalar`. + * + * @returns `true` if the item was found and removed. + */ + delete(key) { + const idx = asItemIndex(key); + if (typeof idx !== "number") return false; + return this.items.splice(idx, 1).length > 0; + } + get(key, keepScalar) { + const idx = asItemIndex(key); + if (typeof idx !== "number") return void 0; + const it = this.items[idx]; + return !keepScalar && identity.isScalar(it) ? it.value : it; + } + /** + * Checks if the collection includes a value with the key `key`. + * + * `key` must contain a representation of an integer for this to succeed. + * It may be wrapped in a `Scalar`. + */ + has(key) { + const idx = asItemIndex(key); + return typeof idx === "number" && idx < this.items.length; + } + /** + * Sets a value in this collection. For `!!set`, `value` needs to be a + * boolean to add/remove the item from the set. + * + * If `key` does not contain a representation of an integer, this will throw. + * It may be wrapped in a `Scalar`. + */ + set(key, value) { + const idx = asItemIndex(key); + if (typeof idx !== "number") throw new Error(`Expected a valid index, not ${key}.`); + const prev = this.items[idx]; + if (identity.isScalar(prev) && Scalar.isScalarValue(value)) prev.value = value; + else this.items[idx] = value; + } + toJSON(_, ctx) { + const seq = []; + if (ctx?.onCreate) ctx.onCreate(seq); + let i = 0; + for (const item of this.items) seq.push(toJS.toJS(item, String(i++), ctx)); + return seq; + } + toString(ctx, onComment, onChompKeep) { + if (!ctx) return JSON.stringify(this); + return stringifyCollection.stringifyCollection(this, ctx, { + blockItemPrefix: "- ", + flowChars: { + start: "[", + end: "]" + }, + itemIndent: (ctx.indent || "") + " ", + onChompKeep, + onComment + }); + } + static from(schema, obj, ctx) { + const { replacer } = ctx; + const seq = new this(schema); + if (obj && Symbol.iterator in Object(obj)) { + let i = 0; + for (let it of obj) { + if (typeof replacer === "function") { + const key = obj instanceof Set ? it : String(i++); + it = replacer.call(obj, key, it); + } + seq.items.push(createNode.createNode(it, void 0, ctx)); + } + } + return seq; + } + }; + function asItemIndex(key) { + let idx = identity.isScalar(key) ? key.value : key; + if (idx && typeof idx === "string") idx = Number(idx); + return typeof idx === "number" && Number.isInteger(idx) && idx >= 0 ? idx : null; + } + exports.YAMLSeq = YAMLSeq; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/seq.js +var require_seq = /* @__PURE__ */ __commonJSMin(((exports) => { + var identity = require_identity(); + var YAMLSeq = require_YAMLSeq(); + exports.seq = { + collection: "seq", + default: true, + nodeClass: YAMLSeq.YAMLSeq, + tag: "tag:yaml.org,2002:seq", + resolve(seq, onError) { + if (!identity.isSeq(seq)) onError("Expected a sequence for this tag"); + return seq; + }, + createNode: (schema, obj, ctx) => YAMLSeq.YAMLSeq.from(schema, obj, ctx) + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/string.js +var require_string = /* @__PURE__ */ __commonJSMin(((exports) => { + var stringifyString = require_stringifyString(); + exports.string = { + identify: (value) => typeof value === "string", + default: true, + tag: "tag:yaml.org,2002:str", + resolve: (str) => str, + stringify(item, ctx, onComment, onChompKeep) { + ctx = Object.assign({ actualString: true }, ctx); + return stringifyString.stringifyString(item, ctx, onComment, onChompKeep); + } + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/null.js +var require_null = /* @__PURE__ */ __commonJSMin(((exports) => { + var Scalar = require_Scalar(); + const nullTag = { + identify: (value) => value == null, + createNode: () => new Scalar.Scalar(null), + default: true, + tag: "tag:yaml.org,2002:null", + test: /^(?:~|[Nn]ull|NULL)?$/, + resolve: () => new Scalar.Scalar(null), + stringify: ({ source }, ctx) => typeof source === "string" && nullTag.test.test(source) ? source : ctx.options.nullStr + }; + exports.nullTag = nullTag; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/bool.js +var require_bool$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + var Scalar = require_Scalar(); + const boolTag = { + identify: (value) => typeof value === "boolean", + default: true, + tag: "tag:yaml.org,2002:bool", + test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/, + resolve: (str) => new Scalar.Scalar(str[0] === "t" || str[0] === "T"), + stringify({ source, value }, ctx) { + if (source && boolTag.test.test(source)) { + if (value === (source[0] === "t" || source[0] === "T")) return source; + } + return value ? ctx.options.trueStr : ctx.options.falseStr; + } + }; + exports.boolTag = boolTag; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyNumber.js +var require_stringifyNumber = /* @__PURE__ */ __commonJSMin(((exports) => { + function stringifyNumber({ format, minFractionDigits, tag, value }) { + if (typeof value === "bigint") return String(value); + const num = typeof value === "number" ? value : Number(value); + if (!isFinite(num)) return isNaN(num) ? ".nan" : num < 0 ? "-.inf" : ".inf"; + let n = Object.is(value, -0) ? "-0" : JSON.stringify(value); + if (!format && minFractionDigits && (!tag || tag === "tag:yaml.org,2002:float") && /^\d/.test(n)) { + let i = n.indexOf("."); + if (i < 0) { + i = n.length; + n += "."; + } + let d = minFractionDigits - (n.length - i - 1); + while (d-- > 0) n += "0"; + } + return n; + } + exports.stringifyNumber = stringifyNumber; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/float.js +var require_float$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + var Scalar = require_Scalar(); + var stringifyNumber = require_stringifyNumber(); + const floatNaN = { + identify: (value) => typeof value === "number", + default: true, + tag: "tag:yaml.org,2002:float", + test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/, + resolve: (str) => str.slice(-3).toLowerCase() === "nan" ? NaN : str[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY, + stringify: stringifyNumber.stringifyNumber + }; + const floatExp = { + identify: (value) => typeof value === "number", + default: true, + tag: "tag:yaml.org,2002:float", + format: "EXP", + test: /^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/, + resolve: (str) => parseFloat(str), + stringify(node) { + const num = Number(node.value); + return isFinite(num) ? num.toExponential() : stringifyNumber.stringifyNumber(node); + } + }; + exports.float = { + identify: (value) => typeof value === "number", + default: true, + tag: "tag:yaml.org,2002:float", + test: /^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/, + resolve(str) { + const node = new Scalar.Scalar(parseFloat(str)); + const dot = str.indexOf("."); + if (dot !== -1 && str[str.length - 1] === "0") node.minFractionDigits = str.length - dot - 1; + return node; + }, + stringify: stringifyNumber.stringifyNumber + }; + exports.floatExp = floatExp; + exports.floatNaN = floatNaN; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/int.js +var require_int$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + var stringifyNumber = require_stringifyNumber(); + const intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value); + const intResolve = (str, offset, radix, { intAsBigInt }) => intAsBigInt ? BigInt(str) : parseInt(str.substring(offset), radix); + function intStringify(node, radix, prefix) { + const { value } = node; + if (intIdentify(value) && value >= 0) return prefix + value.toString(radix); + return stringifyNumber.stringifyNumber(node); + } + const intOct = { + identify: (value) => intIdentify(value) && value >= 0, + default: true, + tag: "tag:yaml.org,2002:int", + format: "OCT", + test: /^0o[0-7]+$/, + resolve: (str, _onError, opt) => intResolve(str, 2, 8, opt), + stringify: (node) => intStringify(node, 8, "0o") + }; + const int = { + identify: intIdentify, + default: true, + tag: "tag:yaml.org,2002:int", + test: /^[-+]?[0-9]+$/, + resolve: (str, _onError, opt) => intResolve(str, 0, 10, opt), + stringify: stringifyNumber.stringifyNumber + }; + const intHex = { + identify: (value) => intIdentify(value) && value >= 0, + default: true, + tag: "tag:yaml.org,2002:int", + format: "HEX", + test: /^0x[0-9a-fA-F]+$/, + resolve: (str, _onError, opt) => intResolve(str, 2, 16, opt), + stringify: (node) => intStringify(node, 16, "0x") + }; + exports.int = int; + exports.intHex = intHex; + exports.intOct = intOct; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/schema.js +var require_schema$2 = /* @__PURE__ */ __commonJSMin(((exports) => { + var map = require_map(); + var _null = require_null(); + var seq = require_seq(); + var string = require_string(); + var bool = require_bool$1(); + var float = require_float$1(); + var int = require_int$1(); + exports.schema = [ + map.map, + seq.seq, + string.string, + _null.nullTag, + bool.boolTag, + int.intOct, + int.int, + int.intHex, + float.floatNaN, + float.floatExp, + float.float + ]; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/json/schema.js +var require_schema$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + var Scalar = require_Scalar(); + var map = require_map(); + var seq = require_seq(); + function intIdentify(value) { + return typeof value === "bigint" || Number.isInteger(value); + } + const stringifyJSON = ({ value }) => JSON.stringify(value); + const jsonScalars = [ + { + identify: (value) => typeof value === "string", + default: true, + tag: "tag:yaml.org,2002:str", + resolve: (str) => str, + stringify: stringifyJSON + }, + { + identify: (value) => value == null, + createNode: () => new Scalar.Scalar(null), + default: true, + tag: "tag:yaml.org,2002:null", + test: /^null$/, + resolve: () => null, + stringify: stringifyJSON + }, + { + identify: (value) => typeof value === "boolean", + default: true, + tag: "tag:yaml.org,2002:bool", + test: /^true$|^false$/, + resolve: (str) => str === "true", + stringify: stringifyJSON + }, + { + identify: intIdentify, + default: true, + tag: "tag:yaml.org,2002:int", + test: /^-?(?:0|[1-9][0-9]*)$/, + resolve: (str, _onError, { intAsBigInt }) => intAsBigInt ? BigInt(str) : parseInt(str, 10), + stringify: ({ value }) => intIdentify(value) ? value.toString() : JSON.stringify(value) + }, + { + identify: (value) => typeof value === "number", + default: true, + tag: "tag:yaml.org,2002:float", + test: /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/, + resolve: (str) => parseFloat(str), + stringify: stringifyJSON + } + ]; + exports.schema = [map.map, seq.seq].concat(jsonScalars, { + default: true, + tag: "", + test: /^/, + resolve(str, onError) { + onError(`Unresolved plain scalar ${JSON.stringify(str)}`); + return str; + } + }); +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/binary.js +var require_binary = /* @__PURE__ */ __commonJSMin(((exports) => { + var node_buffer = __require("buffer"); + var Scalar = require_Scalar(); + var stringifyString = require_stringifyString(); + exports.binary = { + identify: (value) => value instanceof Uint8Array, + default: false, + tag: "tag:yaml.org,2002:binary", + resolve(src, onError) { + if (typeof node_buffer.Buffer === "function") return node_buffer.Buffer.from(src, "base64"); + else if (typeof atob === "function") { + const str = atob(src.replace(/[\n\r]/g, "")); + const buffer = new Uint8Array(str.length); + for (let i = 0; i < str.length; ++i) buffer[i] = str.charCodeAt(i); + return buffer; + } else { + onError("This environment does not support reading binary tags; either Buffer or atob is required"); + return src; + } + }, + stringify({ comment, type, value }, ctx, onComment, onChompKeep) { + if (!value) return ""; + const buf = value; + let str; + if (typeof node_buffer.Buffer === "function") str = buf instanceof node_buffer.Buffer ? buf.toString("base64") : node_buffer.Buffer.from(buf.buffer).toString("base64"); + else if (typeof btoa === "function") { + let s = ""; + for (let i = 0; i < buf.length; ++i) s += String.fromCharCode(buf[i]); + str = btoa(s); + } else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required"); + type ?? (type = Scalar.Scalar.BLOCK_LITERAL); + if (type !== Scalar.Scalar.QUOTE_DOUBLE) { + const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth); + const n = Math.ceil(str.length / lineWidth); + const lines = new Array(n); + for (let i = 0, o = 0; i < n; ++i, o += lineWidth) lines[i] = str.substr(o, lineWidth); + str = lines.join(type === Scalar.Scalar.BLOCK_LITERAL ? "\n" : " "); + } + return stringifyString.stringifyString({ + comment, + type, + value: str + }, ctx, onComment, onChompKeep); + } + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +var require_pairs = /* @__PURE__ */ __commonJSMin(((exports) => { + var identity = require_identity(); + var Pair = require_Pair(); + var Scalar = require_Scalar(); + var YAMLSeq = require_YAMLSeq(); + function resolvePairs(seq, onError) { + if (identity.isSeq(seq)) for (let i = 0; i < seq.items.length; ++i) { + let item = seq.items[i]; + if (identity.isPair(item)) continue; + else if (identity.isMap(item)) { + if (item.items.length > 1) onError("Each pair must have its own sequence indicator"); + const pair = item.items[0] || new Pair.Pair(new Scalar.Scalar(null)); + if (item.commentBefore) pair.key.commentBefore = pair.key.commentBefore ? `${item.commentBefore}\n${pair.key.commentBefore}` : item.commentBefore; + if (item.comment) { + const cn = pair.value ?? pair.key; + cn.comment = cn.comment ? `${item.comment}\n${cn.comment}` : item.comment; + } + item = pair; + } + seq.items[i] = identity.isPair(item) ? item : new Pair.Pair(item); + } + else onError("Expected a sequence for this tag"); + return seq; + } + function createPairs(schema, iterable, ctx) { + const { replacer } = ctx; + const pairs = new YAMLSeq.YAMLSeq(schema); + pairs.tag = "tag:yaml.org,2002:pairs"; + let i = 0; + if (iterable && Symbol.iterator in Object(iterable)) for (let it of iterable) { + if (typeof replacer === "function") it = replacer.call(iterable, String(i++), it); + let key, value; + if (Array.isArray(it)) if (it.length === 2) { + key = it[0]; + value = it[1]; + } else throw new TypeError(`Expected [key, value] tuple: ${it}`); + else if (it && it instanceof Object) { + const keys = Object.keys(it); + if (keys.length === 1) { + key = keys[0]; + value = it[key]; + } else throw new TypeError(`Expected tuple with one key, not ${keys.length} keys`); + } else key = it; + pairs.items.push(Pair.createPair(key, value, ctx)); + } + return pairs; + } + const pairs = { + collection: "seq", + default: false, + tag: "tag:yaml.org,2002:pairs", + resolve: resolvePairs, + createNode: createPairs + }; + exports.createPairs = createPairs; + exports.pairs = pairs; + exports.resolvePairs = resolvePairs; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/omap.js +var require_omap = /* @__PURE__ */ __commonJSMin(((exports) => { + var identity = require_identity(); + var toJS = require_toJS(); + var YAMLMap = require_YAMLMap(); + var YAMLSeq = require_YAMLSeq(); + var pairs = require_pairs(); + var YAMLOMap = class YAMLOMap extends YAMLSeq.YAMLSeq { + constructor() { + super(); + this.add = YAMLMap.YAMLMap.prototype.add.bind(this); + this.delete = YAMLMap.YAMLMap.prototype.delete.bind(this); + this.get = YAMLMap.YAMLMap.prototype.get.bind(this); + this.has = YAMLMap.YAMLMap.prototype.has.bind(this); + this.set = YAMLMap.YAMLMap.prototype.set.bind(this); + this.tag = YAMLOMap.tag; + } + /** + * If `ctx` is given, the return type is actually `Map`, + * but TypeScript won't allow widening the signature of a child method. + */ + toJSON(_, ctx) { + if (!ctx) return super.toJSON(_); + const map = /* @__PURE__ */ new Map(); + if (ctx?.onCreate) ctx.onCreate(map); + for (const pair of this.items) { + let key, value; + if (identity.isPair(pair)) { + key = toJS.toJS(pair.key, "", ctx); + value = toJS.toJS(pair.value, key, ctx); + } else key = toJS.toJS(pair, "", ctx); + if (map.has(key)) throw new Error("Ordered maps must not include duplicate keys"); + map.set(key, value); + } + return map; + } + static from(schema, iterable, ctx) { + const pairs$1 = pairs.createPairs(schema, iterable, ctx); + const omap = new this(); + omap.items = pairs$1.items; + return omap; + } + }; + YAMLOMap.tag = "tag:yaml.org,2002:omap"; + const omap = { + collection: "seq", + identify: (value) => value instanceof Map, + nodeClass: YAMLOMap, + default: false, + tag: "tag:yaml.org,2002:omap", + resolve(seq, onError) { + const pairs$1 = pairs.resolvePairs(seq, onError); + const seenKeys = []; + for (const { key } of pairs$1.items) if (identity.isScalar(key)) if (seenKeys.includes(key.value)) onError(`Ordered maps must not include duplicate keys: ${key.value}`); + else seenKeys.push(key.value); + return Object.assign(new YAMLOMap(), pairs$1); + }, + createNode: (schema, iterable, ctx) => YAMLOMap.from(schema, iterable, ctx) + }; + exports.YAMLOMap = YAMLOMap; + exports.omap = omap; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/bool.js +var require_bool = /* @__PURE__ */ __commonJSMin(((exports) => { + var Scalar = require_Scalar(); + function boolStringify({ value, source }, ctx) { + if (source && (value ? trueTag : falseTag).test.test(source)) return source; + return value ? ctx.options.trueStr : ctx.options.falseStr; + } + const trueTag = { + identify: (value) => value === true, + default: true, + tag: "tag:yaml.org,2002:bool", + test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/, + resolve: () => new Scalar.Scalar(true), + stringify: boolStringify + }; + const falseTag = { + identify: (value) => value === false, + default: true, + tag: "tag:yaml.org,2002:bool", + test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/, + resolve: () => new Scalar.Scalar(false), + stringify: boolStringify + }; + exports.falseTag = falseTag; + exports.trueTag = trueTag; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/float.js +var require_float = /* @__PURE__ */ __commonJSMin(((exports) => { + var Scalar = require_Scalar(); + var stringifyNumber = require_stringifyNumber(); + const floatNaN = { + identify: (value) => typeof value === "number", + default: true, + tag: "tag:yaml.org,2002:float", + test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/, + resolve: (str) => str.slice(-3).toLowerCase() === "nan" ? NaN : str[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY, + stringify: stringifyNumber.stringifyNumber + }; + const floatExp = { + identify: (value) => typeof value === "number", + default: true, + tag: "tag:yaml.org,2002:float", + format: "EXP", + test: /^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/, + resolve: (str) => parseFloat(str.replace(/_/g, "")), + stringify(node) { + const num = Number(node.value); + return isFinite(num) ? num.toExponential() : stringifyNumber.stringifyNumber(node); + } + }; + exports.float = { + identify: (value) => typeof value === "number", + default: true, + tag: "tag:yaml.org,2002:float", + test: /^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/, + resolve(str) { + const node = new Scalar.Scalar(parseFloat(str.replace(/_/g, ""))); + const dot = str.indexOf("."); + if (dot !== -1) { + const f = str.substring(dot + 1).replace(/_/g, ""); + if (f[f.length - 1] === "0") node.minFractionDigits = f.length; + } + return node; + }, + stringify: stringifyNumber.stringifyNumber + }; + exports.floatExp = floatExp; + exports.floatNaN = floatNaN; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/int.js +var require_int = /* @__PURE__ */ __commonJSMin(((exports) => { + var stringifyNumber = require_stringifyNumber(); + const intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value); + function intResolve(str, offset, radix, { intAsBigInt }) { + const sign = str[0]; + if (sign === "-" || sign === "+") offset += 1; + str = str.substring(offset).replace(/_/g, ""); + if (intAsBigInt) { + switch (radix) { + case 2: + str = `0b${str}`; + break; + case 8: + str = `0o${str}`; + break; + case 16: + str = `0x${str}`; + break; + } + const n = BigInt(str); + return sign === "-" ? BigInt(-1) * n : n; + } + const n = parseInt(str, radix); + return sign === "-" ? -1 * n : n; + } + function intStringify(node, radix, prefix) { + const { value } = node; + if (intIdentify(value)) { + const str = value.toString(radix); + return value < 0 ? "-" + prefix + str.substr(1) : prefix + str; + } + return stringifyNumber.stringifyNumber(node); + } + const intBin = { + identify: intIdentify, + default: true, + tag: "tag:yaml.org,2002:int", + format: "BIN", + test: /^[-+]?0b[0-1_]+$/, + resolve: (str, _onError, opt) => intResolve(str, 2, 2, opt), + stringify: (node) => intStringify(node, 2, "0b") + }; + const intOct = { + identify: intIdentify, + default: true, + tag: "tag:yaml.org,2002:int", + format: "OCT", + test: /^[-+]?0[0-7_]+$/, + resolve: (str, _onError, opt) => intResolve(str, 1, 8, opt), + stringify: (node) => intStringify(node, 8, "0") + }; + const int = { + identify: intIdentify, + default: true, + tag: "tag:yaml.org,2002:int", + test: /^[-+]?[0-9][0-9_]*$/, + resolve: (str, _onError, opt) => intResolve(str, 0, 10, opt), + stringify: stringifyNumber.stringifyNumber + }; + const intHex = { + identify: intIdentify, + default: true, + tag: "tag:yaml.org,2002:int", + format: "HEX", + test: /^[-+]?0x[0-9a-fA-F_]+$/, + resolve: (str, _onError, opt) => intResolve(str, 2, 16, opt), + stringify: (node) => intStringify(node, 16, "0x") + }; + exports.int = int; + exports.intBin = intBin; + exports.intHex = intHex; + exports.intOct = intOct; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/set.js +var require_set = /* @__PURE__ */ __commonJSMin(((exports) => { + var identity = require_identity(); + var Pair = require_Pair(); + var YAMLMap = require_YAMLMap(); + var YAMLSet = class YAMLSet extends YAMLMap.YAMLMap { + constructor(schema) { + super(schema); + this.tag = YAMLSet.tag; + } + add(key) { + let pair; + if (identity.isPair(key)) pair = key; + else if (key && typeof key === "object" && "key" in key && "value" in key && key.value === null) pair = new Pair.Pair(key.key, null); + else pair = new Pair.Pair(key, null); + if (!YAMLMap.findPair(this.items, pair.key)) this.items.push(pair); + } + /** + * If `keepPair` is `true`, returns the Pair matching `key`. + * Otherwise, returns the value of that Pair's key. + */ + get(key, keepPair) { + const pair = YAMLMap.findPair(this.items, key); + return !keepPair && identity.isPair(pair) ? identity.isScalar(pair.key) ? pair.key.value : pair.key : pair; + } + set(key, value) { + if (typeof value !== "boolean") throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof value}`); + const prev = YAMLMap.findPair(this.items, key); + if (prev && !value) this.items.splice(this.items.indexOf(prev), 1); + else if (!prev && value) this.items.push(new Pair.Pair(key)); + } + toJSON(_, ctx) { + return super.toJSON(_, ctx, Set); + } + toString(ctx, onComment, onChompKeep) { + if (!ctx) return JSON.stringify(this); + if (this.hasAllNullValues(true)) return super.toString(Object.assign({}, ctx, { allNullValues: true }), onComment, onChompKeep); + else throw new Error("Set items must all have null values"); + } + static from(schema, iterable, ctx) { + const { replacer } = ctx; + const set = new this(schema); + if (iterable && Symbol.iterator in Object(iterable)) for (let value of iterable) { + if (typeof replacer === "function") value = replacer.call(iterable, value, value); + set.items.push(Pair.createPair(value, null, ctx)); + } + return set; + } + }; + YAMLSet.tag = "tag:yaml.org,2002:set"; + const set = { + collection: "map", + identify: (value) => value instanceof Set, + nodeClass: YAMLSet, + default: false, + tag: "tag:yaml.org,2002:set", + createNode: (schema, iterable, ctx) => YAMLSet.from(schema, iterable, ctx), + resolve(map, onError) { + if (identity.isMap(map)) if (map.hasAllNullValues(true)) return Object.assign(new YAMLSet(), map); + else onError("Set items must all have null values"); + else onError("Expected a mapping for this tag"); + return map; + } + }; + exports.YAMLSet = YAMLSet; + exports.set = set; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +var require_timestamp = /* @__PURE__ */ __commonJSMin(((exports) => { + var stringifyNumber = require_stringifyNumber(); + /** Internal types handle bigint as number, because TS can't figure it out. */ + function parseSexagesimal(str, asBigInt) { + const sign = str[0]; + const parts = sign === "-" || sign === "+" ? str.substring(1) : str; + const num = (n) => asBigInt ? BigInt(n) : Number(n); + const res = parts.replace(/_/g, "").split(":").reduce((res, p) => res * num(60) + num(p), num(0)); + return sign === "-" ? num(-1) * res : res; + } + /** + * hhhh:mm:ss.sss + * + * Internal types handle bigint as number, because TS can't figure it out. + */ + function stringifySexagesimal(node) { + let { value } = node; + let num = (n) => n; + if (typeof value === "bigint") num = (n) => BigInt(n); + else if (isNaN(value) || !isFinite(value)) return stringifyNumber.stringifyNumber(node); + let sign = ""; + if (value < 0) { + sign = "-"; + value *= num(-1); + } + const _60 = num(60); + const parts = [value % _60]; + if (value < 60) parts.unshift(0); + else { + value = (value - parts[0]) / _60; + parts.unshift(value % _60); + if (value >= 60) { + value = (value - parts[0]) / _60; + parts.unshift(value); + } + } + return sign + parts.map((n) => String(n).padStart(2, "0")).join(":").replace(/000000\d*$/, ""); + } + const intTime = { + identify: (value) => typeof value === "bigint" || Number.isInteger(value), + default: true, + tag: "tag:yaml.org,2002:int", + format: "TIME", + test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/, + resolve: (str, _onError, { intAsBigInt }) => parseSexagesimal(str, intAsBigInt), + stringify: stringifySexagesimal + }; + const floatTime = { + identify: (value) => typeof value === "number", + default: true, + tag: "tag:yaml.org,2002:float", + format: "TIME", + test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/, + resolve: (str) => parseSexagesimal(str, false), + stringify: stringifySexagesimal + }; + const timestamp = { + identify: (value) => value instanceof Date, + default: true, + tag: "tag:yaml.org,2002:timestamp", + test: RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"), + resolve(str) { + const match = str.match(timestamp.test); + if (!match) throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd"); + const [, year, month, day, hour, minute, second] = match.map(Number); + const millisec = match[7] ? Number((match[7] + "00").substr(1, 3)) : 0; + let date = Date.UTC(year, month - 1, day, hour || 0, minute || 0, second || 0, millisec); + const tz = match[8]; + if (tz && tz !== "Z") { + let d = parseSexagesimal(tz, false); + if (Math.abs(d) < 30) d *= 60; + date -= 6e4 * d; + } + return new Date(date); + }, + stringify: ({ value }) => value?.toISOString().replace(/(T00:00:00)?\.000Z$/, "") ?? "" + }; + exports.floatTime = floatTime; + exports.intTime = intTime; + exports.timestamp = timestamp; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/schema.js +var require_schema = /* @__PURE__ */ __commonJSMin(((exports) => { + var map = require_map(); + var _null = require_null(); + var seq = require_seq(); + var string = require_string(); + var binary = require_binary(); + var bool = require_bool(); + var float = require_float(); + var int = require_int(); + var merge = require_merge(); + var omap = require_omap(); + var pairs = require_pairs(); + var set = require_set(); + var timestamp = require_timestamp(); + exports.schema = [ + map.map, + seq.seq, + string.string, + _null.nullTag, + bool.trueTag, + bool.falseTag, + int.intBin, + int.intOct, + int.int, + int.intHex, + float.floatNaN, + float.floatExp, + float.float, + binary.binary, + merge.merge, + omap.omap, + pairs.pairs, + set.set, + timestamp.intTime, + timestamp.floatTime, + timestamp.timestamp + ]; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/tags.js +var require_tags = /* @__PURE__ */ __commonJSMin(((exports) => { + var map = require_map(); + var _null = require_null(); + var seq = require_seq(); + var string = require_string(); + var bool = require_bool$1(); + var float = require_float$1(); + var int = require_int$1(); + var schema = require_schema$2(); + var schema$1 = require_schema$1(); + var binary = require_binary(); + var merge = require_merge(); + var omap = require_omap(); + var pairs = require_pairs(); + var schema$2 = require_schema(); + var set = require_set(); + var timestamp = require_timestamp(); + const schemas = new Map([ + ["core", schema.schema], + ["failsafe", [ + map.map, + seq.seq, + string.string + ]], + ["json", schema$1.schema], + ["yaml11", schema$2.schema], + ["yaml-1.1", schema$2.schema] + ]); + const tagsByName = { + binary: binary.binary, + bool: bool.boolTag, + float: float.float, + floatExp: float.floatExp, + floatNaN: float.floatNaN, + floatTime: timestamp.floatTime, + int: int.int, + intHex: int.intHex, + intOct: int.intOct, + intTime: timestamp.intTime, + map: map.map, + merge: merge.merge, + null: _null.nullTag, + omap: omap.omap, + pairs: pairs.pairs, + seq: seq.seq, + set: set.set, + timestamp: timestamp.timestamp + }; + const coreKnownTags = { + "tag:yaml.org,2002:binary": binary.binary, + "tag:yaml.org,2002:merge": merge.merge, + "tag:yaml.org,2002:omap": omap.omap, + "tag:yaml.org,2002:pairs": pairs.pairs, + "tag:yaml.org,2002:set": set.set, + "tag:yaml.org,2002:timestamp": timestamp.timestamp + }; + function getTags(customTags, schemaName, addMergeTag) { + const schemaTags = schemas.get(schemaName); + if (schemaTags && !customTags) return addMergeTag && !schemaTags.includes(merge.merge) ? schemaTags.concat(merge.merge) : schemaTags.slice(); + let tags = schemaTags; + if (!tags) if (Array.isArray(customTags)) tags = []; + else { + const keys = Array.from(schemas.keys()).filter((key) => key !== "yaml11").map((key) => JSON.stringify(key)).join(", "); + throw new Error(`Unknown schema "${schemaName}"; use one of ${keys} or define customTags array`); + } + if (Array.isArray(customTags)) for (const tag of customTags) tags = tags.concat(tag); + else if (typeof customTags === "function") tags = customTags(tags.slice()); + if (addMergeTag) tags = tags.concat(merge.merge); + return tags.reduce((tags, tag) => { + const tagObj = typeof tag === "string" ? tagsByName[tag] : tag; + if (!tagObj) { + const tagName = JSON.stringify(tag); + const keys = Object.keys(tagsByName).map((key) => JSON.stringify(key)).join(", "); + throw new Error(`Unknown custom tag ${tagName}; use one of ${keys}`); + } + if (!tags.includes(tagObj)) tags.push(tagObj); + return tags; + }, []); + } + exports.coreKnownTags = coreKnownTags; + exports.getTags = getTags; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/Schema.js +var require_Schema = /* @__PURE__ */ __commonJSMin(((exports) => { + var identity = require_identity(); + var map = require_map(); + var seq = require_seq(); + var string = require_string(); + var tags = require_tags(); + const sortMapEntriesByKey = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0; + exports.Schema = class Schema { + constructor({ compat, customTags, merge, resolveKnownTags, schema, sortMapEntries, toStringDefaults }) { + this.compat = Array.isArray(compat) ? tags.getTags(compat, "compat") : compat ? tags.getTags(null, compat) : null; + this.name = typeof schema === "string" && schema || "core"; + this.knownTags = resolveKnownTags ? tags.coreKnownTags : {}; + this.tags = tags.getTags(customTags, this.name, merge); + this.toStringOptions = toStringDefaults ?? null; + Object.defineProperty(this, identity.MAP, { value: map.map }); + Object.defineProperty(this, identity.SCALAR, { value: string.string }); + Object.defineProperty(this, identity.SEQ, { value: seq.seq }); + this.sortMapEntries = typeof sortMapEntries === "function" ? sortMapEntries : sortMapEntries === true ? sortMapEntriesByKey : null; + } + clone() { + const copy = Object.create(Schema.prototype, Object.getOwnPropertyDescriptors(this)); + copy.tags = this.tags.slice(); + return copy; + } + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyDocument.js +var require_stringifyDocument = /* @__PURE__ */ __commonJSMin(((exports) => { + var identity = require_identity(); + var stringify = require_stringify(); + var stringifyComment = require_stringifyComment(); + function stringifyDocument(doc, options) { + const lines = []; + let hasDirectives = options.directives === true; + if (options.directives !== false && doc.directives) { + const dir = doc.directives.toString(doc); + if (dir) { + lines.push(dir); + hasDirectives = true; + } else if (doc.directives.docStart) hasDirectives = true; + } + if (hasDirectives) lines.push("---"); + const ctx = stringify.createStringifyContext(doc, options); + const { commentString } = ctx.options; + if (doc.commentBefore) { + if (lines.length !== 1) lines.unshift(""); + const cs = commentString(doc.commentBefore); + lines.unshift(stringifyComment.indentComment(cs, "")); + } + let chompKeep = false; + let contentComment = null; + if (doc.contents) { + if (identity.isNode(doc.contents)) { + if (doc.contents.spaceBefore && hasDirectives) lines.push(""); + if (doc.contents.commentBefore) { + const cs = commentString(doc.contents.commentBefore); + lines.push(stringifyComment.indentComment(cs, "")); + } + ctx.forceBlockIndent = !!doc.comment; + contentComment = doc.contents.comment; + } + const onChompKeep = contentComment ? void 0 : () => chompKeep = true; + let body = stringify.stringify(doc.contents, ctx, () => contentComment = null, onChompKeep); + if (contentComment) body += stringifyComment.lineComment(body, "", commentString(contentComment)); + if ((body[0] === "|" || body[0] === ">") && lines[lines.length - 1] === "---") lines[lines.length - 1] = `--- ${body}`; + else lines.push(body); + } else lines.push(stringify.stringify(doc.contents, ctx)); + if (doc.directives?.docEnd) if (doc.comment) { + const cs = commentString(doc.comment); + if (cs.includes("\n")) { + lines.push("..."); + lines.push(stringifyComment.indentComment(cs, "")); + } else lines.push(`... ${cs}`); + } else lines.push("..."); + else { + let dc = doc.comment; + if (dc && chompKeep) dc = dc.replace(/^\n+/, ""); + if (dc) { + if ((!chompKeep || contentComment) && lines[lines.length - 1] !== "") lines.push(""); + lines.push(stringifyComment.indentComment(commentString(dc), "")); + } + } + return lines.join("\n") + "\n"; + } + exports.stringifyDocument = stringifyDocument; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/Document.js +var require_Document = /* @__PURE__ */ __commonJSMin(((exports) => { + var Alias = require_Alias(); + var Collection = require_Collection(); + var identity = require_identity(); + var Pair = require_Pair(); + var toJS = require_toJS(); + var Schema = require_Schema(); + var stringifyDocument = require_stringifyDocument(); + var anchors = require_anchors(); + var applyReviver = require_applyReviver(); + var createNode = require_createNode(); + var directives = require_directives(); + var Document = class Document { + constructor(value, replacer, options) { + /** A comment before this Document */ + this.commentBefore = null; + /** A comment immediately after this Document */ + this.comment = null; + /** Errors encountered during parsing. */ + this.errors = []; + /** Warnings encountered during parsing. */ + this.warnings = []; + Object.defineProperty(this, identity.NODE_TYPE, { value: identity.DOC }); + let _replacer = null; + if (typeof replacer === "function" || Array.isArray(replacer)) _replacer = replacer; + else if (options === void 0 && replacer) { + options = replacer; + replacer = void 0; + } + const opt = Object.assign({ + intAsBigInt: false, + keepSourceTokens: false, + logLevel: "warn", + prettyErrors: true, + strict: true, + stringKeys: false, + uniqueKeys: true, + version: "1.2" + }, options); + this.options = opt; + let { version } = opt; + if (options?._directives) { + this.directives = options._directives.atDocument(); + if (this.directives.yaml.explicit) version = this.directives.yaml.version; + } else this.directives = new directives.Directives({ version }); + this.setSchema(version, options); + this.contents = value === void 0 ? null : this.createNode(value, _replacer, options); + } + /** + * Create a deep copy of this Document and its contents. + * + * Custom Node values that inherit from `Object` still refer to their original instances. + */ + clone() { + const copy = Object.create(Document.prototype, { [identity.NODE_TYPE]: { value: identity.DOC } }); + copy.commentBefore = this.commentBefore; + copy.comment = this.comment; + copy.errors = this.errors.slice(); + copy.warnings = this.warnings.slice(); + copy.options = Object.assign({}, this.options); + if (this.directives) copy.directives = this.directives.clone(); + copy.schema = this.schema.clone(); + copy.contents = identity.isNode(this.contents) ? this.contents.clone(copy.schema) : this.contents; + if (this.range) copy.range = this.range.slice(); + return copy; + } + /** Adds a value to the document. */ + add(value) { + if (assertCollection(this.contents)) this.contents.add(value); + } + /** Adds a value to the document. */ + addIn(path, value) { + if (assertCollection(this.contents)) this.contents.addIn(path, value); + } + /** + * Create a new `Alias` node, ensuring that the target `node` has the required anchor. + * + * If `node` already has an anchor, `name` is ignored. + * Otherwise, the `node.anchor` value will be set to `name`, + * or if an anchor with that name is already present in the document, + * `name` will be used as a prefix for a new unique anchor. + * If `name` is undefined, the generated anchor will use 'a' as a prefix. + */ + createAlias(node, name) { + if (!node.anchor) { + const prev = anchors.anchorNames(this); + node.anchor = !name || prev.has(name) ? anchors.findNewAnchor(name || "a", prev) : name; + } + return new Alias.Alias(node.anchor); + } + createNode(value, replacer, options) { + let _replacer = void 0; + if (typeof replacer === "function") { + value = replacer.call({ "": value }, "", value); + _replacer = replacer; + } else if (Array.isArray(replacer)) { + const keyToStr = (v) => typeof v === "number" || v instanceof String || v instanceof Number; + const asStr = replacer.filter(keyToStr).map(String); + if (asStr.length > 0) replacer = replacer.concat(asStr); + _replacer = replacer; + } else if (options === void 0 && replacer) { + options = replacer; + replacer = void 0; + } + const { aliasDuplicateObjects, anchorPrefix, flow, keepUndefined, onTagObj, tag } = options ?? {}; + const { onAnchor, setAnchors, sourceObjects } = anchors.createNodeAnchors(this, anchorPrefix || "a"); + const ctx = { + aliasDuplicateObjects: aliasDuplicateObjects ?? true, + keepUndefined: keepUndefined ?? false, + onAnchor, + onTagObj, + replacer: _replacer, + schema: this.schema, + sourceObjects + }; + const node = createNode.createNode(value, tag, ctx); + if (flow && identity.isCollection(node)) node.flow = true; + setAnchors(); + return node; + } + /** + * Convert a key and a value into a `Pair` using the current schema, + * recursively wrapping all values as `Scalar` or `Collection` nodes. + */ + createPair(key, value, options = {}) { + const k = this.createNode(key, null, options); + const v = this.createNode(value, null, options); + return new Pair.Pair(k, v); + } + /** + * Removes a value from the document. + * @returns `true` if the item was found and removed. + */ + delete(key) { + return assertCollection(this.contents) ? this.contents.delete(key) : false; + } + /** + * Removes a value from the document. + * @returns `true` if the item was found and removed. + */ + deleteIn(path) { + if (Collection.isEmptyPath(path)) { + if (this.contents == null) return false; + this.contents = null; + return true; + } + return assertCollection(this.contents) ? this.contents.deleteIn(path) : false; + } + /** + * Returns item at `key`, or `undefined` if not found. By default unwraps + * scalar values from their surrounding node; to disable set `keepScalar` to + * `true` (collections are always returned intact). + */ + get(key, keepScalar) { + return identity.isCollection(this.contents) ? this.contents.get(key, keepScalar) : void 0; + } + /** + * Returns item at `path`, or `undefined` if not found. By default unwraps + * scalar values from their surrounding node; to disable set `keepScalar` to + * `true` (collections are always returned intact). + */ + getIn(path, keepScalar) { + if (Collection.isEmptyPath(path)) return !keepScalar && identity.isScalar(this.contents) ? this.contents.value : this.contents; + return identity.isCollection(this.contents) ? this.contents.getIn(path, keepScalar) : void 0; + } + /** + * Checks if the document includes a value with the key `key`. + */ + has(key) { + return identity.isCollection(this.contents) ? this.contents.has(key) : false; + } + /** + * Checks if the document includes a value at `path`. + */ + hasIn(path) { + if (Collection.isEmptyPath(path)) return this.contents !== void 0; + return identity.isCollection(this.contents) ? this.contents.hasIn(path) : false; + } + /** + * Sets a value in this document. For `!!set`, `value` needs to be a + * boolean to add/remove the item from the set. + */ + set(key, value) { + if (this.contents == null) this.contents = Collection.collectionFromPath(this.schema, [key], value); + else if (assertCollection(this.contents)) this.contents.set(key, value); + } + /** + * Sets a value in this document. For `!!set`, `value` needs to be a + * boolean to add/remove the item from the set. + */ + setIn(path, value) { + if (Collection.isEmptyPath(path)) this.contents = value; + else if (this.contents == null) this.contents = Collection.collectionFromPath(this.schema, Array.from(path), value); + else if (assertCollection(this.contents)) this.contents.setIn(path, value); + } + /** + * Change the YAML version and schema used by the document. + * A `null` version disables support for directives, explicit tags, anchors, and aliases. + * It also requires the `schema` option to be given as a `Schema` instance value. + * + * Overrides all previously set schema options. + */ + setSchema(version, options = {}) { + if (typeof version === "number") version = String(version); + let opt; + switch (version) { + case "1.1": + if (this.directives) this.directives.yaml.version = "1.1"; + else this.directives = new directives.Directives({ version: "1.1" }); + opt = { + resolveKnownTags: false, + schema: "yaml-1.1" + }; + break; + case "1.2": + case "next": + if (this.directives) this.directives.yaml.version = version; + else this.directives = new directives.Directives({ version }); + opt = { + resolveKnownTags: true, + schema: "core" + }; + break; + case null: + if (this.directives) delete this.directives; + opt = null; + break; + default: { + const sv = JSON.stringify(version); + throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${sv}`); + } + } + if (options.schema instanceof Object) this.schema = options.schema; + else if (opt) this.schema = new Schema.Schema(Object.assign(opt, options)); + else throw new Error(`With a null YAML version, the { schema: Schema } option is required`); + } + toJS({ json, jsonArg, mapAsMap, maxAliasCount, onAnchor, reviver } = {}) { + const ctx = { + anchors: /* @__PURE__ */ new Map(), + doc: this, + keep: !json, + mapAsMap: mapAsMap === true, + mapKeyWarned: false, + maxAliasCount: typeof maxAliasCount === "number" ? maxAliasCount : 100 + }; + const res = toJS.toJS(this.contents, jsonArg ?? "", ctx); + if (typeof onAnchor === "function") for (const { count, res } of ctx.anchors.values()) onAnchor(res, count); + return typeof reviver === "function" ? applyReviver.applyReviver(reviver, { "": res }, "", res) : res; + } + /** + * A JSON representation of the document `contents`. + * + * @param jsonArg Used by `JSON.stringify` to indicate the array index or + * property name. + */ + toJSON(jsonArg, onAnchor) { + return this.toJS({ + json: true, + jsonArg, + mapAsMap: false, + onAnchor + }); + } + /** A YAML representation of the document. */ + toString(options = {}) { + if (this.errors.length > 0) throw new Error("Document with errors cannot be stringified"); + if ("indent" in options && (!Number.isInteger(options.indent) || Number(options.indent) <= 0)) { + const s = JSON.stringify(options.indent); + throw new Error(`"indent" option must be a positive integer, not ${s}`); + } + return stringifyDocument.stringifyDocument(this, options); + } + }; + function assertCollection(contents) { + if (identity.isCollection(contents)) return true; + throw new Error("Expected a YAML collection as document contents"); + } + exports.Document = Document; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/errors.js +var require_errors = /* @__PURE__ */ __commonJSMin(((exports) => { + var YAMLError = class extends Error { + constructor(name, pos, code, message) { + super(); + this.name = name; + this.code = code; + this.message = message; + this.pos = pos; + } + }; + var YAMLParseError = class extends YAMLError { + constructor(pos, code, message) { + super("YAMLParseError", pos, code, message); + } + }; + var YAMLWarning = class extends YAMLError { + constructor(pos, code, message) { + super("YAMLWarning", pos, code, message); + } + }; + const prettifyError = (src, lc) => (error) => { + if (error.pos[0] === -1) return; + error.linePos = error.pos.map((pos) => lc.linePos(pos)); + const { line, col } = error.linePos[0]; + error.message += ` at line ${line}, column ${col}`; + let ci = col - 1; + let lineStr = src.substring(lc.lineStarts[line - 1], lc.lineStarts[line]).replace(/[\n\r]+$/, ""); + if (ci >= 60 && lineStr.length > 80) { + const trimStart = Math.min(ci - 39, lineStr.length - 79); + lineStr = "…" + lineStr.substring(trimStart); + ci -= trimStart - 1; + } + if (lineStr.length > 80) lineStr = lineStr.substring(0, 79) + "…"; + if (line > 1 && /^ *$/.test(lineStr.substring(0, ci))) { + let prev = src.substring(lc.lineStarts[line - 2], lc.lineStarts[line - 1]); + if (prev.length > 80) prev = prev.substring(0, 79) + "…\n"; + lineStr = prev + lineStr; + } + if (/[^ ]/.test(lineStr)) { + let count = 1; + const end = error.linePos[1]; + if (end?.line === line && end.col > col) count = Math.max(1, Math.min(end.col - col, 80 - ci)); + const pointer = " ".repeat(ci) + "^".repeat(count); + error.message += `:\n\n${lineStr}\n${pointer}\n`; + } + }; + exports.YAMLError = YAMLError; + exports.YAMLParseError = YAMLParseError; + exports.YAMLWarning = YAMLWarning; + exports.prettifyError = prettifyError; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-props.js +var require_resolve_props = /* @__PURE__ */ __commonJSMin(((exports) => { + function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIndent, startOnNewline }) { + let spaceBefore = false; + let atNewline = startOnNewline; + let hasSpace = startOnNewline; + let comment = ""; + let commentSep = ""; + let hasNewline = false; + let reqSpace = false; + let tab = null; + let anchor = null; + let tag = null; + let newlineAfterProp = null; + let comma = null; + let found = null; + let start = null; + for (const token of tokens) { + if (reqSpace) { + if (token.type !== "space" && token.type !== "newline" && token.type !== "comma") onError(token.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space"); + reqSpace = false; + } + if (tab) { + if (atNewline && token.type !== "comment" && token.type !== "newline") onError(tab, "TAB_AS_INDENT", "Tabs are not allowed as indentation"); + tab = null; + } + switch (token.type) { + case "space": + if (!flow && (indicator !== "doc-start" || next?.type !== "flow-collection") && token.source.includes(" ")) tab = token; + hasSpace = true; + break; + case "comment": { + if (!hasSpace) onError(token, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters"); + const cb = token.source.substring(1) || " "; + if (!comment) comment = cb; + else comment += commentSep + cb; + commentSep = ""; + atNewline = false; + break; + } + case "newline": + if (atNewline) { + if (comment) comment += token.source; + else if (!found || indicator !== "seq-item-ind") spaceBefore = true; + } else commentSep += token.source; + atNewline = true; + hasNewline = true; + if (anchor || tag) newlineAfterProp = token; + hasSpace = true; + break; + case "anchor": + if (anchor) onError(token, "MULTIPLE_ANCHORS", "A node can have at most one anchor"); + if (token.source.endsWith(":")) onError(token.offset + token.source.length - 1, "BAD_ALIAS", "Anchor ending in : is ambiguous", true); + anchor = token; + start ?? (start = token.offset); + atNewline = false; + hasSpace = false; + reqSpace = true; + break; + case "tag": + if (tag) onError(token, "MULTIPLE_TAGS", "A node can have at most one tag"); + tag = token; + start ?? (start = token.offset); + atNewline = false; + hasSpace = false; + reqSpace = true; + break; + case indicator: + if (anchor || tag) onError(token, "BAD_PROP_ORDER", `Anchors and tags must be after the ${token.source} indicator`); + if (found) onError(token, "UNEXPECTED_TOKEN", `Unexpected ${token.source} in ${flow ?? "collection"}`); + found = token; + atNewline = indicator === "seq-item-ind" || indicator === "explicit-key-ind"; + hasSpace = false; + break; + case "comma": if (flow) { + if (comma) onError(token, "UNEXPECTED_TOKEN", `Unexpected , in ${flow}`); + comma = token; + atNewline = false; + hasSpace = false; + break; + } + default: + onError(token, "UNEXPECTED_TOKEN", `Unexpected ${token.type} token`); + atNewline = false; + hasSpace = false; + } + } + const last = tokens[tokens.length - 1]; + const end = last ? last.offset + last.source.length : offset; + if (reqSpace && next && next.type !== "space" && next.type !== "newline" && next.type !== "comma" && (next.type !== "scalar" || next.source !== "")) onError(next.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space"); + if (tab && (atNewline && tab.indent <= parentIndent || next?.type === "block-map" || next?.type === "block-seq")) onError(tab, "TAB_AS_INDENT", "Tabs are not allowed as indentation"); + return { + comma, + found, + spaceBefore, + comment, + hasNewline, + anchor, + tag, + newlineAfterProp, + end, + start: start ?? end + }; + } + exports.resolveProps = resolveProps; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-contains-newline.js +var require_util_contains_newline = /* @__PURE__ */ __commonJSMin(((exports) => { + function containsNewline(key) { + if (!key) return null; + switch (key.type) { + case "alias": + case "scalar": + case "double-quoted-scalar": + case "single-quoted-scalar": + if (key.source.includes("\n")) return true; + if (key.end) { + for (const st of key.end) if (st.type === "newline") return true; + } + return false; + case "flow-collection": + for (const it of key.items) { + for (const st of it.start) if (st.type === "newline") return true; + if (it.sep) { + for (const st of it.sep) if (st.type === "newline") return true; + } + if (containsNewline(it.key) || containsNewline(it.value)) return true; + } + return false; + default: return true; + } + } + exports.containsNewline = containsNewline; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-flow-indent-check.js +var require_util_flow_indent_check = /* @__PURE__ */ __commonJSMin(((exports) => { + var utilContainsNewline = require_util_contains_newline(); + function flowIndentCheck(indent, fc, onError) { + if (fc?.type === "flow-collection") { + const end = fc.end[0]; + if (end.indent === indent && (end.source === "]" || end.source === "}") && utilContainsNewline.containsNewline(fc)) onError(end, "BAD_INDENT", "Flow end indicator should be more indented than parent", true); + } + } + exports.flowIndentCheck = flowIndentCheck; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-map-includes.js +var require_util_map_includes = /* @__PURE__ */ __commonJSMin(((exports) => { + var identity = require_identity(); + function mapIncludes(ctx, items, search) { + const { uniqueKeys } = ctx.options; + if (uniqueKeys === false) return false; + const isEqual = typeof uniqueKeys === "function" ? uniqueKeys : (a, b) => a === b || identity.isScalar(a) && identity.isScalar(b) && a.value === b.value; + return items.some((pair) => isEqual(pair.key, search)); + } + exports.mapIncludes = mapIncludes; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-block-map.js +var require_resolve_block_map = /* @__PURE__ */ __commonJSMin(((exports) => { + var Pair = require_Pair(); + var YAMLMap = require_YAMLMap(); + var resolveProps = require_resolve_props(); + var utilContainsNewline = require_util_contains_newline(); + var utilFlowIndentCheck = require_util_flow_indent_check(); + var utilMapIncludes = require_util_map_includes(); + const startColMsg = "All mapping items must start at the same column"; + function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError, tag) { + const map = new (tag?.nodeClass ?? YAMLMap.YAMLMap)(ctx.schema); + if (ctx.atRoot) ctx.atRoot = false; + let offset = bm.offset; + let commentEnd = null; + for (const collItem of bm.items) { + const { start, key, sep, value } = collItem; + const keyProps = resolveProps.resolveProps(start, { + indicator: "explicit-key-ind", + next: key ?? sep?.[0], + offset, + onError, + parentIndent: bm.indent, + startOnNewline: true + }); + const implicitKey = !keyProps.found; + if (implicitKey) { + if (key) { + if (key.type === "block-seq") onError(offset, "BLOCK_AS_IMPLICIT_KEY", "A block sequence may not be used as an implicit map key"); + else if ("indent" in key && key.indent !== bm.indent) onError(offset, "BAD_INDENT", startColMsg); + } + if (!keyProps.anchor && !keyProps.tag && !sep) { + commentEnd = keyProps.end; + if (keyProps.comment) if (map.comment) map.comment += "\n" + keyProps.comment; + else map.comment = keyProps.comment; + continue; + } + if (keyProps.newlineAfterProp || utilContainsNewline.containsNewline(key)) onError(key ?? start[start.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line"); + } else if (keyProps.found?.indent !== bm.indent) onError(offset, "BAD_INDENT", startColMsg); + ctx.atKey = true; + const keyStart = keyProps.end; + const keyNode = key ? composeNode(ctx, key, keyProps, onError) : composeEmptyNode(ctx, keyStart, start, null, keyProps, onError); + if (ctx.schema.compat) utilFlowIndentCheck.flowIndentCheck(bm.indent, key, onError); + ctx.atKey = false; + if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode)) onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique"); + const valueProps = resolveProps.resolveProps(sep ?? [], { + indicator: "map-value-ind", + next: value, + offset: keyNode.range[2], + onError, + parentIndent: bm.indent, + startOnNewline: !key || key.type === "block-scalar" + }); + offset = valueProps.end; + if (valueProps.found) { + if (implicitKey) { + if (value?.type === "block-map" && !valueProps.hasNewline) onError(offset, "BLOCK_AS_IMPLICIT_KEY", "Nested mappings are not allowed in compact mappings"); + if (ctx.options.strict && keyProps.start < valueProps.found.offset - 1024) onError(keyNode.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key"); + } + const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset, sep, null, valueProps, onError); + if (ctx.schema.compat) utilFlowIndentCheck.flowIndentCheck(bm.indent, value, onError); + offset = valueNode.range[2]; + const pair = new Pair.Pair(keyNode, valueNode); + if (ctx.options.keepSourceTokens) pair.srcToken = collItem; + map.items.push(pair); + } else { + if (implicitKey) onError(keyNode.range, "MISSING_CHAR", "Implicit map keys need to be followed by map values"); + if (valueProps.comment) if (keyNode.comment) keyNode.comment += "\n" + valueProps.comment; + else keyNode.comment = valueProps.comment; + const pair = new Pair.Pair(keyNode); + if (ctx.options.keepSourceTokens) pair.srcToken = collItem; + map.items.push(pair); + } + } + if (commentEnd && commentEnd < offset) onError(commentEnd, "IMPOSSIBLE", "Map comment with trailing content"); + map.range = [ + bm.offset, + offset, + commentEnd ?? offset + ]; + return map; + } + exports.resolveBlockMap = resolveBlockMap; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-block-seq.js +var require_resolve_block_seq = /* @__PURE__ */ __commonJSMin(((exports) => { + var YAMLSeq = require_YAMLSeq(); + var resolveProps = require_resolve_props(); + var utilFlowIndentCheck = require_util_flow_indent_check(); + function resolveBlockSeq({ composeNode, composeEmptyNode }, ctx, bs, onError, tag) { + const seq = new (tag?.nodeClass ?? YAMLSeq.YAMLSeq)(ctx.schema); + if (ctx.atRoot) ctx.atRoot = false; + if (ctx.atKey) ctx.atKey = false; + let offset = bs.offset; + let commentEnd = null; + for (const { start, value } of bs.items) { + const props = resolveProps.resolveProps(start, { + indicator: "seq-item-ind", + next: value, + offset, + onError, + parentIndent: bs.indent, + startOnNewline: true + }); + if (!props.found) if (props.anchor || props.tag || value) if (value?.type === "block-seq") onError(props.end, "BAD_INDENT", "All sequence items must start at the same column"); + else onError(offset, "MISSING_CHAR", "Sequence item without - indicator"); + else { + commentEnd = props.end; + if (props.comment) seq.comment = props.comment; + continue; + } + const node = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, start, null, props, onError); + if (ctx.schema.compat) utilFlowIndentCheck.flowIndentCheck(bs.indent, value, onError); + offset = node.range[2]; + seq.items.push(node); + } + seq.range = [ + bs.offset, + offset, + commentEnd ?? offset + ]; + return seq; + } + exports.resolveBlockSeq = resolveBlockSeq; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-end.js +var require_resolve_end = /* @__PURE__ */ __commonJSMin(((exports) => { + function resolveEnd(end, offset, reqSpace, onError) { + let comment = ""; + if (end) { + let hasSpace = false; + let sep = ""; + for (const token of end) { + const { source, type } = token; + switch (type) { + case "space": + hasSpace = true; + break; + case "comment": { + if (reqSpace && !hasSpace) onError(token, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters"); + const cb = source.substring(1) || " "; + if (!comment) comment = cb; + else comment += sep + cb; + sep = ""; + break; + } + case "newline": + if (comment) sep += source; + hasSpace = true; + break; + default: onError(token, "UNEXPECTED_TOKEN", `Unexpected ${type} at node end`); + } + offset += source.length; + } + } + return { + comment, + offset + }; + } + exports.resolveEnd = resolveEnd; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-flow-collection.js +var require_resolve_flow_collection = /* @__PURE__ */ __commonJSMin(((exports) => { + var identity = require_identity(); + var Pair = require_Pair(); + var YAMLMap = require_YAMLMap(); + var YAMLSeq = require_YAMLSeq(); + var resolveEnd = require_resolve_end(); + var resolveProps = require_resolve_props(); + var utilContainsNewline = require_util_contains_newline(); + var utilMapIncludes = require_util_map_includes(); + const blockMsg = "Block collections are not allowed within flow collections"; + const isBlock = (token) => token && (token.type === "block-map" || token.type === "block-seq"); + function resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onError, tag) { + const isMap = fc.start.source === "{"; + const fcName = isMap ? "flow map" : "flow sequence"; + const coll = new (tag?.nodeClass ?? (isMap ? YAMLMap.YAMLMap : YAMLSeq.YAMLSeq))(ctx.schema); + coll.flow = true; + const atRoot = ctx.atRoot; + if (atRoot) ctx.atRoot = false; + if (ctx.atKey) ctx.atKey = false; + let offset = fc.offset + fc.start.source.length; + for (let i = 0; i < fc.items.length; ++i) { + const collItem = fc.items[i]; + const { start, key, sep, value } = collItem; + const props = resolveProps.resolveProps(start, { + flow: fcName, + indicator: "explicit-key-ind", + next: key ?? sep?.[0], + offset, + onError, + parentIndent: fc.indent, + startOnNewline: false + }); + if (!props.found) { + if (!props.anchor && !props.tag && !sep && !value) { + if (i === 0 && props.comma) onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`); + else if (i < fc.items.length - 1) onError(props.start, "UNEXPECTED_TOKEN", `Unexpected empty item in ${fcName}`); + if (props.comment) if (coll.comment) coll.comment += "\n" + props.comment; + else coll.comment = props.comment; + offset = props.end; + continue; + } + if (!isMap && ctx.options.strict && utilContainsNewline.containsNewline(key)) onError(key, "MULTILINE_IMPLICIT_KEY", "Implicit keys of flow sequence pairs need to be on a single line"); + } + if (i === 0) { + if (props.comma) onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`); + } else { + if (!props.comma) onError(props.start, "MISSING_CHAR", `Missing , between ${fcName} items`); + if (props.comment) { + let prevItemComment = ""; + loop: for (const st of start) switch (st.type) { + case "comma": + case "space": break; + case "comment": + prevItemComment = st.source.substring(1); + break loop; + default: break loop; + } + if (prevItemComment) { + let prev = coll.items[coll.items.length - 1]; + if (identity.isPair(prev)) prev = prev.value ?? prev.key; + if (prev.comment) prev.comment += "\n" + prevItemComment; + else prev.comment = prevItemComment; + props.comment = props.comment.substring(prevItemComment.length + 1); + } + } + } + if (!isMap && !sep && !props.found) { + const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, sep, null, props, onError); + coll.items.push(valueNode); + offset = valueNode.range[2]; + if (isBlock(value)) onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg); + } else { + ctx.atKey = true; + const keyStart = props.end; + const keyNode = key ? composeNode(ctx, key, props, onError) : composeEmptyNode(ctx, keyStart, start, null, props, onError); + if (isBlock(key)) onError(keyNode.range, "BLOCK_IN_FLOW", blockMsg); + ctx.atKey = false; + const valueProps = resolveProps.resolveProps(sep ?? [], { + flow: fcName, + indicator: "map-value-ind", + next: value, + offset: keyNode.range[2], + onError, + parentIndent: fc.indent, + startOnNewline: false + }); + if (valueProps.found) { + if (!isMap && !props.found && ctx.options.strict) { + if (sep) for (const st of sep) { + if (st === valueProps.found) break; + if (st.type === "newline") { + onError(st, "MULTILINE_IMPLICIT_KEY", "Implicit keys of flow sequence pairs need to be on a single line"); + break; + } + } + if (props.start < valueProps.found.offset - 1024) onError(valueProps.found, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit flow sequence key"); + } + } else if (value) if ("source" in value && value.source?.[0] === ":") onError(value, "MISSING_CHAR", `Missing space after : in ${fcName}`); + else onError(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`); + const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep, null, valueProps, onError) : null; + if (valueNode) { + if (isBlock(value)) onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg); + } else if (valueProps.comment) if (keyNode.comment) keyNode.comment += "\n" + valueProps.comment; + else keyNode.comment = valueProps.comment; + const pair = new Pair.Pair(keyNode, valueNode); + if (ctx.options.keepSourceTokens) pair.srcToken = collItem; + if (isMap) { + const map = coll; + if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode)) onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique"); + map.items.push(pair); + } else { + const map = new YAMLMap.YAMLMap(ctx.schema); + map.flow = true; + map.items.push(pair); + const endRange = (valueNode ?? keyNode).range; + map.range = [ + keyNode.range[0], + endRange[1], + endRange[2] + ]; + coll.items.push(map); + } + offset = valueNode ? valueNode.range[2] : valueProps.end; + } + } + const expectedEnd = isMap ? "}" : "]"; + const [ce, ...ee] = fc.end; + let cePos = offset; + if (ce?.source === expectedEnd) cePos = ce.offset + ce.source.length; + else { + const name = fcName[0].toUpperCase() + fcName.substring(1); + const msg = atRoot ? `${name} must end with a ${expectedEnd}` : `${name} in block collection must be sufficiently indented and end with a ${expectedEnd}`; + onError(offset, atRoot ? "MISSING_CHAR" : "BAD_INDENT", msg); + if (ce && ce.source.length !== 1) ee.unshift(ce); + } + if (ee.length > 0) { + const end = resolveEnd.resolveEnd(ee, cePos, ctx.options.strict, onError); + if (end.comment) if (coll.comment) coll.comment += "\n" + end.comment; + else coll.comment = end.comment; + coll.range = [ + fc.offset, + cePos, + end.offset + ]; + } else coll.range = [ + fc.offset, + cePos, + cePos + ]; + return coll; + } + exports.resolveFlowCollection = resolveFlowCollection; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-collection.js +var require_compose_collection = /* @__PURE__ */ __commonJSMin(((exports) => { + var identity = require_identity(); + var Scalar = require_Scalar(); + var YAMLMap = require_YAMLMap(); + var YAMLSeq = require_YAMLSeq(); + var resolveBlockMap = require_resolve_block_map(); + var resolveBlockSeq = require_resolve_block_seq(); + var resolveFlowCollection = require_resolve_flow_collection(); + function resolveCollection(CN, ctx, token, onError, tagName, tag) { + const coll = token.type === "block-map" ? resolveBlockMap.resolveBlockMap(CN, ctx, token, onError, tag) : token.type === "block-seq" ? resolveBlockSeq.resolveBlockSeq(CN, ctx, token, onError, tag) : resolveFlowCollection.resolveFlowCollection(CN, ctx, token, onError, tag); + const Coll = coll.constructor; + if (tagName === "!" || tagName === Coll.tagName) { + coll.tag = Coll.tagName; + return coll; + } + if (tagName) coll.tag = tagName; + return coll; + } + function composeCollection(CN, ctx, token, props, onError) { + const tagToken = props.tag; + const tagName = !tagToken ? null : ctx.directives.tagName(tagToken.source, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg)); + if (token.type === "block-seq") { + const { anchor, newlineAfterProp: nl } = props; + const lastProp = anchor && tagToken ? anchor.offset > tagToken.offset ? anchor : tagToken : anchor ?? tagToken; + if (lastProp && (!nl || nl.offset < lastProp.offset)) onError(lastProp, "MISSING_CHAR", "Missing newline after block sequence props"); + } + const expType = token.type === "block-map" ? "map" : token.type === "block-seq" ? "seq" : token.start.source === "{" ? "map" : "seq"; + if (!tagToken || !tagName || tagName === "!" || tagName === YAMLMap.YAMLMap.tagName && expType === "map" || tagName === YAMLSeq.YAMLSeq.tagName && expType === "seq") return resolveCollection(CN, ctx, token, onError, tagName); + let tag = ctx.schema.tags.find((t) => t.tag === tagName && t.collection === expType); + if (!tag) { + const kt = ctx.schema.knownTags[tagName]; + if (kt?.collection === expType) { + ctx.schema.tags.push(Object.assign({}, kt, { default: false })); + tag = kt; + } else { + if (kt) onError(tagToken, "BAD_COLLECTION_TYPE", `${kt.tag} used for ${expType} collection, but expects ${kt.collection ?? "scalar"}`, true); + else onError(tagToken, "TAG_RESOLVE_FAILED", `Unresolved tag: ${tagName}`, true); + return resolveCollection(CN, ctx, token, onError, tagName); + } + } + const coll = resolveCollection(CN, ctx, token, onError, tagName, tag); + const res = tag.resolve?.(coll, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg), ctx.options) ?? coll; + const node = identity.isNode(res) ? res : new Scalar.Scalar(res); + node.range = coll.range; + node.tag = tagName; + if (tag?.format) node.format = tag.format; + return node; + } + exports.composeCollection = composeCollection; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-block-scalar.js +var require_resolve_block_scalar = /* @__PURE__ */ __commonJSMin(((exports) => { + var Scalar = require_Scalar(); + function resolveBlockScalar(ctx, scalar, onError) { + const start = scalar.offset; + const header = parseBlockScalarHeader(scalar, ctx.options.strict, onError); + if (!header) return { + value: "", + type: null, + comment: "", + range: [ + start, + start, + start + ] + }; + const type = header.mode === ">" ? Scalar.Scalar.BLOCK_FOLDED : Scalar.Scalar.BLOCK_LITERAL; + const lines = scalar.source ? splitLines(scalar.source) : []; + let chompStart = lines.length; + for (let i = lines.length - 1; i >= 0; --i) { + const content = lines[i][1]; + if (content === "" || content === "\r") chompStart = i; + else break; + } + if (chompStart === 0) { + const value = header.chomp === "+" && lines.length > 0 ? "\n".repeat(Math.max(1, lines.length - 1)) : ""; + let end = start + header.length; + if (scalar.source) end += scalar.source.length; + return { + value, + type, + comment: header.comment, + range: [ + start, + end, + end + ] + }; + } + let trimIndent = scalar.indent + header.indent; + let offset = scalar.offset + header.length; + let contentStart = 0; + for (let i = 0; i < chompStart; ++i) { + const [indent, content] = lines[i]; + if (content === "" || content === "\r") { + if (header.indent === 0 && indent.length > trimIndent) trimIndent = indent.length; + } else { + if (indent.length < trimIndent) onError(offset + indent.length, "MISSING_CHAR", "Block scalars with more-indented leading empty lines must use an explicit indentation indicator"); + if (header.indent === 0) trimIndent = indent.length; + contentStart = i; + if (trimIndent === 0 && !ctx.atRoot) onError(offset, "BAD_INDENT", "Block scalar values in collections must be indented"); + break; + } + offset += indent.length + content.length + 1; + } + for (let i = lines.length - 1; i >= chompStart; --i) if (lines[i][0].length > trimIndent) chompStart = i + 1; + let value = ""; + let sep = ""; + let prevMoreIndented = false; + for (let i = 0; i < contentStart; ++i) value += lines[i][0].slice(trimIndent) + "\n"; + for (let i = contentStart; i < chompStart; ++i) { + let [indent, content] = lines[i]; + offset += indent.length + content.length + 1; + const crlf = content[content.length - 1] === "\r"; + if (crlf) content = content.slice(0, -1); + /* istanbul ignore if already caught in lexer */ + if (content && indent.length < trimIndent) { + const message = `Block scalar lines must not be less indented than their ${header.indent ? "explicit indentation indicator" : "first line"}`; + onError(offset - content.length - (crlf ? 2 : 1), "BAD_INDENT", message); + indent = ""; + } + if (type === Scalar.Scalar.BLOCK_LITERAL) { + value += sep + indent.slice(trimIndent) + content; + sep = "\n"; + } else if (indent.length > trimIndent || content[0] === " ") { + if (sep === " ") sep = "\n"; + else if (!prevMoreIndented && sep === "\n") sep = "\n\n"; + value += sep + indent.slice(trimIndent) + content; + sep = "\n"; + prevMoreIndented = true; + } else if (content === "") if (sep === "\n") value += "\n"; + else sep = "\n"; + else { + value += sep + content; + sep = " "; + prevMoreIndented = false; + } + } + switch (header.chomp) { + case "-": break; + case "+": + for (let i = chompStart; i < lines.length; ++i) value += "\n" + lines[i][0].slice(trimIndent); + if (value[value.length - 1] !== "\n") value += "\n"; + break; + default: value += "\n"; + } + const end = start + header.length + scalar.source.length; + return { + value, + type, + comment: header.comment, + range: [ + start, + end, + end + ] + }; + } + function parseBlockScalarHeader({ offset, props }, strict, onError) { + /* istanbul ignore if should not happen */ + if (props[0].type !== "block-scalar-header") { + onError(props[0], "IMPOSSIBLE", "Block scalar header not found"); + return null; + } + const { source } = props[0]; + const mode = source[0]; + let indent = 0; + let chomp = ""; + let error = -1; + for (let i = 1; i < source.length; ++i) { + const ch = source[i]; + if (!chomp && (ch === "-" || ch === "+")) chomp = ch; + else { + const n = Number(ch); + if (!indent && n) indent = n; + else if (error === -1) error = offset + i; + } + } + if (error !== -1) onError(error, "UNEXPECTED_TOKEN", `Block scalar header includes extra characters: ${source}`); + let hasSpace = false; + let comment = ""; + let length = source.length; + for (let i = 1; i < props.length; ++i) { + const token = props[i]; + switch (token.type) { + case "space": hasSpace = true; + case "newline": + length += token.source.length; + break; + case "comment": + if (strict && !hasSpace) onError(token, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters"); + length += token.source.length; + comment = token.source.substring(1); + break; + case "error": + onError(token, "UNEXPECTED_TOKEN", token.message); + length += token.source.length; + break; + /* istanbul ignore next should not happen */ + default: { + onError(token, "UNEXPECTED_TOKEN", `Unexpected token in block scalar header: ${token.type}`); + const ts = token.source; + if (ts && typeof ts === "string") length += ts.length; + } + } + } + return { + mode, + indent, + chomp, + comment, + length + }; + } + /** @returns Array of lines split up as `[indent, content]` */ + function splitLines(source) { + const split = source.split(/\n( *)/); + const first = split[0]; + const m = first.match(/^( *)/); + const lines = [m?.[1] ? [m[1], first.slice(m[1].length)] : ["", first]]; + for (let i = 1; i < split.length; i += 2) lines.push([split[i], split[i + 1]]); + return lines; + } + exports.resolveBlockScalar = resolveBlockScalar; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-flow-scalar.js +var require_resolve_flow_scalar = /* @__PURE__ */ __commonJSMin(((exports) => { + var Scalar = require_Scalar(); + var resolveEnd = require_resolve_end(); + function resolveFlowScalar(scalar, strict, onError) { + const { offset, type, source, end } = scalar; + let _type; + let value; + const _onError = (rel, code, msg) => onError(offset + rel, code, msg); + switch (type) { + case "scalar": + _type = Scalar.Scalar.PLAIN; + value = plainValue(source, _onError); + break; + case "single-quoted-scalar": + _type = Scalar.Scalar.QUOTE_SINGLE; + value = singleQuotedValue(source, _onError); + break; + case "double-quoted-scalar": + _type = Scalar.Scalar.QUOTE_DOUBLE; + value = doubleQuotedValue(source, _onError); + break; + /* istanbul ignore next should not happen */ + default: + onError(scalar, "UNEXPECTED_TOKEN", `Expected a flow scalar value, but found: ${type}`); + return { + value: "", + type: null, + comment: "", + range: [ + offset, + offset + source.length, + offset + source.length + ] + }; + } + const valueEnd = offset + source.length; + const re = resolveEnd.resolveEnd(end, valueEnd, strict, onError); + return { + value, + type: _type, + comment: re.comment, + range: [ + offset, + valueEnd, + re.offset + ] + }; + } + function plainValue(source, onError) { + let badChar = ""; + switch (source[0]) { + /* istanbul ignore next should not happen */ + case " ": + badChar = "a tab character"; + break; + case ",": + badChar = "flow indicator character ,"; + break; + case "%": + badChar = "directive indicator character %"; + break; + case "|": + case ">": + badChar = `block scalar indicator ${source[0]}`; + break; + case "@": + case "`": + badChar = `reserved character ${source[0]}`; + break; + } + if (badChar) onError(0, "BAD_SCALAR_START", `Plain value cannot start with ${badChar}`); + return foldLines(source); + } + function singleQuotedValue(source, onError) { + if (source[source.length - 1] !== "'" || source.length === 1) onError(source.length, "MISSING_CHAR", "Missing closing 'quote"); + return foldLines(source.slice(1, -1)).replace(/''/g, "'"); + } + function foldLines(source) { + /** + * The negative lookbehind here and in the `re` RegExp is to + * prevent causing a polynomial search time in certain cases. + * + * The try-catch is for Safari, which doesn't support this yet: + * https://caniuse.com/js-regexp-lookbehind + */ + let first, line; + try { + first = /* @__PURE__ */ new RegExp("(.*?)(? wsStart ? source.slice(wsStart, i + 1) : ch; + } else res += ch; + } + if (source[source.length - 1] !== "\"" || source.length === 1) onError(source.length, "MISSING_CHAR", "Missing closing \"quote"); + return res; + } + /** + * Fold a single newline into a space, multiple newlines to N - 1 newlines. + * Presumes `source[offset] === '\n'` + */ + function foldNewline(source, offset) { + let fold = ""; + let ch = source[offset + 1]; + while (ch === " " || ch === " " || ch === "\n" || ch === "\r") { + if (ch === "\r" && source[offset + 2] !== "\n") break; + if (ch === "\n") fold += "\n"; + offset += 1; + ch = source[offset + 1]; + } + if (!fold) fold = " "; + return { + fold, + offset + }; + } + const escapeCodes = { + "0": "\0", + a: "\x07", + b: "\b", + e: "\x1B", + f: "\f", + n: "\n", + r: "\r", + t: " ", + v: "\v", + N: "…", + _: "\xA0", + L: "\u2028", + P: "\u2029", + " ": " ", + "\"": "\"", + "/": "/", + "\\": "\\", + " ": " " + }; + function parseCharCode(source, offset, length, onError) { + const cc = source.substr(offset, length); + const code = cc.length === length && /^[0-9a-fA-F]+$/.test(cc) ? parseInt(cc, 16) : NaN; + if (isNaN(code)) { + const raw = source.substr(offset - 2, length + 2); + onError(offset - 2, "BAD_DQ_ESCAPE", `Invalid escape sequence ${raw}`); + return raw; + } + return String.fromCodePoint(code); + } + exports.resolveFlowScalar = resolveFlowScalar; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-scalar.js +var require_compose_scalar = /* @__PURE__ */ __commonJSMin(((exports) => { + var identity = require_identity(); + var Scalar = require_Scalar(); + var resolveBlockScalar = require_resolve_block_scalar(); + var resolveFlowScalar = require_resolve_flow_scalar(); + function composeScalar(ctx, token, tagToken, onError) { + const { value, type, comment, range } = token.type === "block-scalar" ? resolveBlockScalar.resolveBlockScalar(ctx, token, onError) : resolveFlowScalar.resolveFlowScalar(token, ctx.options.strict, onError); + const tagName = tagToken ? ctx.directives.tagName(tagToken.source, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg)) : null; + let tag; + if (ctx.options.stringKeys && ctx.atKey) tag = ctx.schema[identity.SCALAR]; + else if (tagName) tag = findScalarTagByName(ctx.schema, value, tagName, tagToken, onError); + else if (token.type === "scalar") tag = findScalarTagByTest(ctx, value, token, onError); + else tag = ctx.schema[identity.SCALAR]; + let scalar; + try { + const res = tag.resolve(value, (msg) => onError(tagToken ?? token, "TAG_RESOLVE_FAILED", msg), ctx.options); + scalar = identity.isScalar(res) ? res : new Scalar.Scalar(res); + } catch (error) { + const msg = error instanceof Error ? error.message : String(error); + onError(tagToken ?? token, "TAG_RESOLVE_FAILED", msg); + scalar = new Scalar.Scalar(value); + } + scalar.range = range; + scalar.source = value; + if (type) scalar.type = type; + if (tagName) scalar.tag = tagName; + if (tag.format) scalar.format = tag.format; + if (comment) scalar.comment = comment; + return scalar; + } + function findScalarTagByName(schema, value, tagName, tagToken, onError) { + if (tagName === "!") return schema[identity.SCALAR]; + const matchWithTest = []; + for (const tag of schema.tags) if (!tag.collection && tag.tag === tagName) if (tag.default && tag.test) matchWithTest.push(tag); + else return tag; + for (const tag of matchWithTest) if (tag.test?.test(value)) return tag; + const kt = schema.knownTags[tagName]; + if (kt && !kt.collection) { + schema.tags.push(Object.assign({}, kt, { + default: false, + test: void 0 + })); + return kt; + } + onError(tagToken, "TAG_RESOLVE_FAILED", `Unresolved tag: ${tagName}`, tagName !== "tag:yaml.org,2002:str"); + return schema[identity.SCALAR]; + } + function findScalarTagByTest({ atKey, directives, schema }, value, token, onError) { + const tag = schema.tags.find((tag) => (tag.default === true || atKey && tag.default === "key") && tag.test?.test(value)) || schema[identity.SCALAR]; + if (schema.compat) { + const compat = schema.compat.find((tag) => tag.default && tag.test?.test(value)) ?? schema[identity.SCALAR]; + if (tag.tag !== compat.tag) onError(token, "TAG_RESOLVE_FAILED", `Value may be parsed as either ${directives.tagString(tag.tag)} or ${directives.tagString(compat.tag)}`, true); + } + return tag; + } + exports.composeScalar = composeScalar; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-empty-scalar-position.js +var require_util_empty_scalar_position = /* @__PURE__ */ __commonJSMin(((exports) => { + function emptyScalarPosition(offset, before, pos) { + if (before) { + pos ?? (pos = before.length); + for (let i = pos - 1; i >= 0; --i) { + let st = before[i]; + switch (st.type) { + case "space": + case "comment": + case "newline": + offset -= st.source.length; + continue; + } + st = before[++i]; + while (st?.type === "space") { + offset += st.source.length; + st = before[++i]; + } + break; + } + } + return offset; + } + exports.emptyScalarPosition = emptyScalarPosition; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-node.js +var require_compose_node = /* @__PURE__ */ __commonJSMin(((exports) => { + var Alias = require_Alias(); + var identity = require_identity(); + var composeCollection = require_compose_collection(); + var composeScalar = require_compose_scalar(); + var resolveEnd = require_resolve_end(); + var utilEmptyScalarPosition = require_util_empty_scalar_position(); + const CN = { + composeNode, + composeEmptyNode + }; + function composeNode(ctx, token, props, onError) { + const atKey = ctx.atKey; + const { spaceBefore, comment, anchor, tag } = props; + let node; + let isSrcToken = true; + switch (token.type) { + case "alias": + node = composeAlias(ctx, token, onError); + if (anchor || tag) onError(token, "ALIAS_PROPS", "An alias node must not specify any properties"); + break; + case "scalar": + case "single-quoted-scalar": + case "double-quoted-scalar": + case "block-scalar": + node = composeScalar.composeScalar(ctx, token, tag, onError); + if (anchor) node.anchor = anchor.source.substring(1); + break; + case "block-map": + case "block-seq": + case "flow-collection": + node = composeCollection.composeCollection(CN, ctx, token, props, onError); + if (anchor) node.anchor = anchor.source.substring(1); + break; + default: + onError(token, "UNEXPECTED_TOKEN", token.type === "error" ? token.message : `Unsupported token (type: ${token.type})`); + node = composeEmptyNode(ctx, token.offset, void 0, null, props, onError); + isSrcToken = false; + } + if (anchor && node.anchor === "") onError(anchor, "BAD_ALIAS", "Anchor cannot be an empty string"); + if (atKey && ctx.options.stringKeys && (!identity.isScalar(node) || typeof node.value !== "string" || node.tag && node.tag !== "tag:yaml.org,2002:str")) onError(tag ?? token, "NON_STRING_KEY", "With stringKeys, all keys must be strings"); + if (spaceBefore) node.spaceBefore = true; + if (comment) if (token.type === "scalar" && token.source === "") node.comment = comment; + else node.commentBefore = comment; + if (ctx.options.keepSourceTokens && isSrcToken) node.srcToken = token; + return node; + } + function composeEmptyNode(ctx, offset, before, pos, { spaceBefore, comment, anchor, tag, end }, onError) { + const token = { + type: "scalar", + offset: utilEmptyScalarPosition.emptyScalarPosition(offset, before, pos), + indent: -1, + source: "" + }; + const node = composeScalar.composeScalar(ctx, token, tag, onError); + if (anchor) { + node.anchor = anchor.source.substring(1); + if (node.anchor === "") onError(anchor, "BAD_ALIAS", "Anchor cannot be an empty string"); + } + if (spaceBefore) node.spaceBefore = true; + if (comment) { + node.comment = comment; + node.range[2] = end; + } + return node; + } + function composeAlias({ options }, { offset, source, end }, onError) { + const alias = new Alias.Alias(source.substring(1)); + if (alias.source === "") onError(offset, "BAD_ALIAS", "Alias cannot be an empty string"); + if (alias.source.endsWith(":")) onError(offset + source.length - 1, "BAD_ALIAS", "Alias ending in : is ambiguous", true); + const valueEnd = offset + source.length; + const re = resolveEnd.resolveEnd(end, valueEnd, options.strict, onError); + alias.range = [ + offset, + valueEnd, + re.offset + ]; + if (re.comment) alias.comment = re.comment; + return alias; + } + exports.composeEmptyNode = composeEmptyNode; + exports.composeNode = composeNode; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-doc.js +var require_compose_doc = /* @__PURE__ */ __commonJSMin(((exports) => { + var Document = require_Document(); + var composeNode = require_compose_node(); + var resolveEnd = require_resolve_end(); + var resolveProps = require_resolve_props(); + function composeDoc(options, directives, { offset, start, value, end }, onError) { + const opts = Object.assign({ _directives: directives }, options); + const doc = new Document.Document(void 0, opts); + const ctx = { + atKey: false, + atRoot: true, + directives: doc.directives, + options: doc.options, + schema: doc.schema + }; + const props = resolveProps.resolveProps(start, { + indicator: "doc-start", + next: value ?? end?.[0], + offset, + onError, + parentIndent: 0, + startOnNewline: true + }); + if (props.found) { + doc.directives.docStart = true; + if (value && (value.type === "block-map" || value.type === "block-seq") && !props.hasNewline) onError(props.end, "MISSING_CHAR", "Block collection cannot start on same line with directives-end marker"); + } + doc.contents = value ? composeNode.composeNode(ctx, value, props, onError) : composeNode.composeEmptyNode(ctx, props.end, start, null, props, onError); + const contentEnd = doc.contents.range[2]; + const re = resolveEnd.resolveEnd(end, contentEnd, false, onError); + if (re.comment) doc.comment = re.comment; + doc.range = [ + offset, + contentEnd, + re.offset + ]; + return doc; + } + exports.composeDoc = composeDoc; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/composer.js +var require_composer = /* @__PURE__ */ __commonJSMin(((exports) => { + var node_process$1 = __require("process"); + var directives = require_directives(); + var Document = require_Document(); + var errors = require_errors(); + var identity = require_identity(); + var composeDoc = require_compose_doc(); + var resolveEnd = require_resolve_end(); + function getErrorPos(src) { + if (typeof src === "number") return [src, src + 1]; + if (Array.isArray(src)) return src.length === 2 ? src : [src[0], src[1]]; + const { offset, source } = src; + return [offset, offset + (typeof source === "string" ? source.length : 1)]; + } + function parsePrelude(prelude) { + let comment = ""; + let atComment = false; + let afterEmptyLine = false; + for (let i = 0; i < prelude.length; ++i) { + const source = prelude[i]; + switch (source[0]) { + case "#": + comment += (comment === "" ? "" : afterEmptyLine ? "\n\n" : "\n") + (source.substring(1) || " "); + atComment = true; + afterEmptyLine = false; + break; + case "%": + if (prelude[i + 1]?.[0] !== "#") i += 1; + atComment = false; + break; + default: + if (!atComment) afterEmptyLine = true; + atComment = false; + } + } + return { + comment, + afterEmptyLine + }; + } + /** + * Compose a stream of CST nodes into a stream of YAML Documents. + * + * ```ts + * import { Composer, Parser } from 'yaml' + * + * const src: string = ... + * const tokens = new Parser().parse(src) + * const docs = new Composer().compose(tokens) + * ``` + */ + var Composer = class { + constructor(options = {}) { + this.doc = null; + this.atDirectives = false; + this.prelude = []; + this.errors = []; + this.warnings = []; + this.onError = (source, code, message, warning) => { + const pos = getErrorPos(source); + if (warning) this.warnings.push(new errors.YAMLWarning(pos, code, message)); + else this.errors.push(new errors.YAMLParseError(pos, code, message)); + }; + this.directives = new directives.Directives({ version: options.version || "1.2" }); + this.options = options; + } + decorate(doc, afterDoc) { + const { comment, afterEmptyLine } = parsePrelude(this.prelude); + if (comment) { + const dc = doc.contents; + if (afterDoc) doc.comment = doc.comment ? `${doc.comment}\n${comment}` : comment; + else if (afterEmptyLine || doc.directives.docStart || !dc) doc.commentBefore = comment; + else if (identity.isCollection(dc) && !dc.flow && dc.items.length > 0) { + let it = dc.items[0]; + if (identity.isPair(it)) it = it.key; + const cb = it.commentBefore; + it.commentBefore = cb ? `${comment}\n${cb}` : comment; + } else { + const cb = dc.commentBefore; + dc.commentBefore = cb ? `${comment}\n${cb}` : comment; + } + } + if (afterDoc) { + Array.prototype.push.apply(doc.errors, this.errors); + Array.prototype.push.apply(doc.warnings, this.warnings); + } else { + doc.errors = this.errors; + doc.warnings = this.warnings; + } + this.prelude = []; + this.errors = []; + this.warnings = []; + } + /** + * Current stream status information. + * + * Mostly useful at the end of input for an empty stream. + */ + streamInfo() { + return { + comment: parsePrelude(this.prelude).comment, + directives: this.directives, + errors: this.errors, + warnings: this.warnings + }; + } + /** + * Compose tokens into documents. + * + * @param forceDoc - If the stream contains no document, still emit a final document including any comments and directives that would be applied to a subsequent document. + * @param endOffset - Should be set if `forceDoc` is also set, to set the document range end and to indicate errors correctly. + */ + *compose(tokens, forceDoc = false, endOffset = -1) { + for (const token of tokens) yield* this.next(token); + yield* this.end(forceDoc, endOffset); + } + /** Advance the composer by one CST token. */ + *next(token) { + if (node_process$1.env.LOG_STREAM) console.dir(token, { depth: null }); + switch (token.type) { + case "directive": + this.directives.add(token.source, (offset, message, warning) => { + const pos = getErrorPos(token); + pos[0] += offset; + this.onError(pos, "BAD_DIRECTIVE", message, warning); + }); + this.prelude.push(token.source); + this.atDirectives = true; + break; + case "document": { + const doc = composeDoc.composeDoc(this.options, this.directives, token, this.onError); + if (this.atDirectives && !doc.directives.docStart) this.onError(token, "MISSING_CHAR", "Missing directives-end/doc-start indicator line"); + this.decorate(doc, false); + if (this.doc) yield this.doc; + this.doc = doc; + this.atDirectives = false; + break; + } + case "byte-order-mark": + case "space": break; + case "comment": + case "newline": + this.prelude.push(token.source); + break; + case "error": { + const msg = token.source ? `${token.message}: ${JSON.stringify(token.source)}` : token.message; + const error = new errors.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg); + if (this.atDirectives || !this.doc) this.errors.push(error); + else this.doc.errors.push(error); + break; + } + case "doc-end": { + if (!this.doc) { + this.errors.push(new errors.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", "Unexpected doc-end without preceding document")); + break; + } + this.doc.directives.docEnd = true; + const end = resolveEnd.resolveEnd(token.end, token.offset + token.source.length, this.doc.options.strict, this.onError); + this.decorate(this.doc, true); + if (end.comment) { + const dc = this.doc.comment; + this.doc.comment = dc ? `${dc}\n${end.comment}` : end.comment; + } + this.doc.range[2] = end.offset; + break; + } + default: this.errors.push(new errors.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", `Unsupported token ${token.type}`)); + } + } + /** + * Call at end of input to yield any remaining document. + * + * @param forceDoc - If the stream contains no document, still emit a final document including any comments and directives that would be applied to a subsequent document. + * @param endOffset - Should be set if `forceDoc` is also set, to set the document range end and to indicate errors correctly. + */ + *end(forceDoc = false, endOffset = -1) { + if (this.doc) { + this.decorate(this.doc, true); + yield this.doc; + this.doc = null; + } else if (forceDoc) { + const opts = Object.assign({ _directives: this.directives }, this.options); + const doc = new Document.Document(void 0, opts); + if (this.atDirectives) this.onError(endOffset, "MISSING_CHAR", "Missing directives-end indicator line"); + doc.range = [ + 0, + endOffset, + endOffset + ]; + this.decorate(doc, false); + yield doc; + } + } + }; + exports.Composer = Composer; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst-scalar.js +var require_cst_scalar = /* @__PURE__ */ __commonJSMin(((exports) => { + var resolveBlockScalar = require_resolve_block_scalar(); + var resolveFlowScalar = require_resolve_flow_scalar(); + var errors = require_errors(); + var stringifyString = require_stringifyString(); + function resolveAsScalar(token, strict = true, onError) { + if (token) { + const _onError = (pos, code, message) => { + const offset = typeof pos === "number" ? pos : Array.isArray(pos) ? pos[0] : pos.offset; + if (onError) onError(offset, code, message); + else throw new errors.YAMLParseError([offset, offset + 1], code, message); + }; + switch (token.type) { + case "scalar": + case "single-quoted-scalar": + case "double-quoted-scalar": return resolveFlowScalar.resolveFlowScalar(token, strict, _onError); + case "block-scalar": return resolveBlockScalar.resolveBlockScalar({ options: { strict } }, token, _onError); + } + } + return null; + } + /** + * Create a new scalar token with `value` + * + * Values that represent an actual string but may be parsed as a different type should use a `type` other than `'PLAIN'`, + * as this function does not support any schema operations and won't check for such conflicts. + * + * @param value The string representation of the value, which will have its content properly indented. + * @param context.end Comments and whitespace after the end of the value, or after the block scalar header. If undefined, a newline will be added. + * @param context.implicitKey Being within an implicit key may affect the resolved type of the token's value. + * @param context.indent The indent level of the token. + * @param context.inFlow Is this scalar within a flow collection? This may affect the resolved type of the token's value. + * @param context.offset The offset position of the token. + * @param context.type The preferred type of the scalar token. If undefined, the previous type of the `token` will be used, defaulting to `'PLAIN'`. + */ + function createScalarToken(value, context) { + const { implicitKey = false, indent, inFlow = false, offset = -1, type = "PLAIN" } = context; + const source = stringifyString.stringifyString({ + type, + value + }, { + implicitKey, + indent: indent > 0 ? " ".repeat(indent) : "", + inFlow, + options: { + blockQuote: true, + lineWidth: -1 + } + }); + const end = context.end ?? [{ + type: "newline", + offset: -1, + indent, + source: "\n" + }]; + switch (source[0]) { + case "|": + case ">": { + const he = source.indexOf("\n"); + const head = source.substring(0, he); + const body = source.substring(he + 1) + "\n"; + const props = [{ + type: "block-scalar-header", + offset, + indent, + source: head + }]; + if (!addEndtoBlockProps(props, end)) props.push({ + type: "newline", + offset: -1, + indent, + source: "\n" + }); + return { + type: "block-scalar", + offset, + indent, + props, + source: body + }; + } + case "\"": return { + type: "double-quoted-scalar", + offset, + indent, + source, + end + }; + case "'": return { + type: "single-quoted-scalar", + offset, + indent, + source, + end + }; + default: return { + type: "scalar", + offset, + indent, + source, + end + }; + } + } + /** + * Set the value of `token` to the given string `value`, overwriting any previous contents and type that it may have. + * + * Best efforts are made to retain any comments previously associated with the `token`, + * though all contents within a collection's `items` will be overwritten. + * + * Values that represent an actual string but may be parsed as a different type should use a `type` other than `'PLAIN'`, + * as this function does not support any schema operations and won't check for such conflicts. + * + * @param token Any token. If it does not include an `indent` value, the value will be stringified as if it were an implicit key. + * @param value The string representation of the value, which will have its content properly indented. + * @param context.afterKey In most cases, values after a key should have an additional level of indentation. + * @param context.implicitKey Being within an implicit key may affect the resolved type of the token's value. + * @param context.inFlow Being within a flow collection may affect the resolved type of the token's value. + * @param context.type The preferred type of the scalar token. If undefined, the previous type of the `token` will be used, defaulting to `'PLAIN'`. + */ + function setScalarValue(token, value, context = {}) { + let { afterKey = false, implicitKey = false, inFlow = false, type } = context; + let indent = "indent" in token ? token.indent : null; + if (afterKey && typeof indent === "number") indent += 2; + if (!type) switch (token.type) { + case "single-quoted-scalar": + type = "QUOTE_SINGLE"; + break; + case "double-quoted-scalar": + type = "QUOTE_DOUBLE"; + break; + case "block-scalar": { + const header = token.props[0]; + if (header.type !== "block-scalar-header") throw new Error("Invalid block scalar header"); + type = header.source[0] === ">" ? "BLOCK_FOLDED" : "BLOCK_LITERAL"; + break; + } + default: type = "PLAIN"; + } + const source = stringifyString.stringifyString({ + type, + value + }, { + implicitKey: implicitKey || indent === null, + indent: indent !== null && indent > 0 ? " ".repeat(indent) : "", + inFlow, + options: { + blockQuote: true, + lineWidth: -1 + } + }); + switch (source[0]) { + case "|": + case ">": + setBlockScalarValue(token, source); + break; + case "\"": + setFlowScalarValue(token, source, "double-quoted-scalar"); + break; + case "'": + setFlowScalarValue(token, source, "single-quoted-scalar"); + break; + default: setFlowScalarValue(token, source, "scalar"); + } + } + function setBlockScalarValue(token, source) { + const he = source.indexOf("\n"); + const head = source.substring(0, he); + const body = source.substring(he + 1) + "\n"; + if (token.type === "block-scalar") { + const header = token.props[0]; + if (header.type !== "block-scalar-header") throw new Error("Invalid block scalar header"); + header.source = head; + token.source = body; + } else { + const { offset } = token; + const indent = "indent" in token ? token.indent : -1; + const props = [{ + type: "block-scalar-header", + offset, + indent, + source: head + }]; + if (!addEndtoBlockProps(props, "end" in token ? token.end : void 0)) props.push({ + type: "newline", + offset: -1, + indent, + source: "\n" + }); + for (const key of Object.keys(token)) if (key !== "type" && key !== "offset") delete token[key]; + Object.assign(token, { + type: "block-scalar", + indent, + props, + source: body + }); + } + } + /** @returns `true` if last token is a newline */ + function addEndtoBlockProps(props, end) { + if (end) for (const st of end) switch (st.type) { + case "space": + case "comment": + props.push(st); + break; + case "newline": + props.push(st); + return true; + } + return false; + } + function setFlowScalarValue(token, source, type) { + switch (token.type) { + case "scalar": + case "double-quoted-scalar": + case "single-quoted-scalar": + token.type = type; + token.source = source; + break; + case "block-scalar": { + const end = token.props.slice(1); + let oa = source.length; + if (token.props[0].type === "block-scalar-header") oa -= token.props[0].source.length; + for (const tok of end) tok.offset += oa; + delete token.props; + Object.assign(token, { + type, + source, + end + }); + break; + } + case "block-map": + case "block-seq": { + const nl = { + type: "newline", + offset: token.offset + source.length, + indent: token.indent, + source: "\n" + }; + delete token.items; + Object.assign(token, { + type, + source, + end: [nl] + }); + break; + } + default: { + const indent = "indent" in token ? token.indent : -1; + const end = "end" in token && Array.isArray(token.end) ? token.end.filter((st) => st.type === "space" || st.type === "comment" || st.type === "newline") : []; + for (const key of Object.keys(token)) if (key !== "type" && key !== "offset") delete token[key]; + Object.assign(token, { + type, + indent, + source, + end + }); + } + } + } + exports.createScalarToken = createScalarToken; + exports.resolveAsScalar = resolveAsScalar; + exports.setScalarValue = setScalarValue; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst-stringify.js +var require_cst_stringify = /* @__PURE__ */ __commonJSMin(((exports) => { + /** + * Stringify a CST document, token, or collection item + * + * Fair warning: This applies no validation whatsoever, and + * simply concatenates the sources in their logical order. + */ + const stringify = (cst) => "type" in cst ? stringifyToken(cst) : stringifyItem(cst); + function stringifyToken(token) { + switch (token.type) { + case "block-scalar": { + let res = ""; + for (const tok of token.props) res += stringifyToken(tok); + return res + token.source; + } + case "block-map": + case "block-seq": { + let res = ""; + for (const item of token.items) res += stringifyItem(item); + return res; + } + case "flow-collection": { + let res = token.start.source; + for (const item of token.items) res += stringifyItem(item); + for (const st of token.end) res += st.source; + return res; + } + case "document": { + let res = stringifyItem(token); + if (token.end) for (const st of token.end) res += st.source; + return res; + } + default: { + let res = token.source; + if ("end" in token && token.end) for (const st of token.end) res += st.source; + return res; + } + } + } + function stringifyItem({ start, key, sep, value }) { + let res = ""; + for (const st of start) res += st.source; + if (key) res += stringifyToken(key); + if (sep) for (const st of sep) res += st.source; + if (value) res += stringifyToken(value); + return res; + } + exports.stringify = stringify; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst-visit.js +var require_cst_visit = /* @__PURE__ */ __commonJSMin(((exports) => { + const BREAK = Symbol("break visit"); + const SKIP = Symbol("skip children"); + const REMOVE = Symbol("remove item"); + /** + * Apply a visitor to a CST document or item. + * + * Walks through the tree (depth-first) starting from the root, calling a + * `visitor` function with two arguments when entering each item: + * - `item`: The current item, which included the following members: + * - `start: SourceToken[]` – Source tokens before the key or value, + * possibly including its anchor or tag. + * - `key?: Token | null` – Set for pair values. May then be `null`, if + * the key before the `:` separator is empty. + * - `sep?: SourceToken[]` – Source tokens between the key and the value, + * which should include the `:` map value indicator if `value` is set. + * - `value?: Token` – The value of a sequence item, or of a map pair. + * - `path`: The steps from the root to the current node, as an array of + * `['key' | 'value', number]` tuples. + * + * The return value of the visitor may be used to control the traversal: + * - `undefined` (default): Do nothing and continue + * - `visit.SKIP`: Do not visit the children of this token, continue with + * next sibling + * - `visit.BREAK`: Terminate traversal completely + * - `visit.REMOVE`: Remove the current item, then continue with the next one + * - `number`: Set the index of the next step. This is useful especially if + * the index of the current token has changed. + * - `function`: Define the next visitor for this item. After the original + * visitor is called on item entry, next visitors are called after handling + * a non-empty `key` and when exiting the item. + */ + function visit(cst, visitor) { + if ("type" in cst && cst.type === "document") cst = { + start: cst.start, + value: cst.value + }; + _visit(Object.freeze([]), cst, visitor); + } + /** Terminate visit traversal completely */ + visit.BREAK = BREAK; + /** Do not visit the children of the current item */ + visit.SKIP = SKIP; + /** Remove the current item */ + visit.REMOVE = REMOVE; + /** Find the item at `path` from `cst` as the root */ + visit.itemAtPath = (cst, path) => { + let item = cst; + for (const [field, index] of path) { + const tok = item?.[field]; + if (tok && "items" in tok) item = tok.items[index]; + else return void 0; + } + return item; + }; + /** + * Get the immediate parent collection of the item at `path` from `cst` as the root. + * + * Throws an error if the collection is not found, which should never happen if the item itself exists. + */ + visit.parentCollection = (cst, path) => { + const parent = visit.itemAtPath(cst, path.slice(0, -1)); + const field = path[path.length - 1][0]; + const coll = parent?.[field]; + if (coll && "items" in coll) return coll; + throw new Error("Parent collection not found"); + }; + function _visit(path, item, visitor) { + let ctrl = visitor(item, path); + if (typeof ctrl === "symbol") return ctrl; + for (const field of ["key", "value"]) { + const token = item[field]; + if (token && "items" in token) { + for (let i = 0; i < token.items.length; ++i) { + const ci = _visit(Object.freeze(path.concat([[field, i]])), token.items[i], visitor); + if (typeof ci === "number") i = ci - 1; + else if (ci === BREAK) return BREAK; + else if (ci === REMOVE) { + token.items.splice(i, 1); + i -= 1; + } + } + if (typeof ctrl === "function" && field === "key") ctrl = ctrl(item, path); + } + } + return typeof ctrl === "function" ? ctrl(item, path) : ctrl; + } + exports.visit = visit; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst.js +var require_cst = /* @__PURE__ */ __commonJSMin(((exports) => { + var cstScalar = require_cst_scalar(); + var cstStringify = require_cst_stringify(); + var cstVisit = require_cst_visit(); + /** The byte order mark */ + const BOM = ""; + /** Start of doc-mode */ + const DOCUMENT = ""; + /** Unexpected end of flow-mode */ + const FLOW_END = ""; + /** Next token is a scalar value */ + const SCALAR = ""; + /** @returns `true` if `token` is a flow or block collection */ + const isCollection = (token) => !!token && "items" in token; + /** @returns `true` if `token` is a flow or block scalar; not an alias */ + const isScalar = (token) => !!token && (token.type === "scalar" || token.type === "single-quoted-scalar" || token.type === "double-quoted-scalar" || token.type === "block-scalar"); + /* istanbul ignore next */ + /** Get a printable representation of a lexer token */ + function prettyToken(token) { + switch (token) { + case BOM: return ""; + case DOCUMENT: return ""; + case FLOW_END: return ""; + case SCALAR: return ""; + default: return JSON.stringify(token); + } + } + /** Identify the type of a lexer token. May return `null` for unknown tokens. */ + function tokenType(source) { + switch (source) { + case BOM: return "byte-order-mark"; + case DOCUMENT: return "doc-mode"; + case FLOW_END: return "flow-error-end"; + case SCALAR: return "scalar"; + case "---": return "doc-start"; + case "...": return "doc-end"; + case "": + case "\n": + case "\r\n": return "newline"; + case "-": return "seq-item-ind"; + case "?": return "explicit-key-ind"; + case ":": return "map-value-ind"; + case "{": return "flow-map-start"; + case "}": return "flow-map-end"; + case "[": return "flow-seq-start"; + case "]": return "flow-seq-end"; + case ",": return "comma"; + } + switch (source[0]) { + case " ": + case " ": return "space"; + case "#": return "comment"; + case "%": return "directive-line"; + case "*": return "alias"; + case "&": return "anchor"; + case "!": return "tag"; + case "'": return "single-quoted-scalar"; + case "\"": return "double-quoted-scalar"; + case "|": + case ">": return "block-scalar-header"; + } + return null; + } + exports.createScalarToken = cstScalar.createScalarToken; + exports.resolveAsScalar = cstScalar.resolveAsScalar; + exports.setScalarValue = cstScalar.setScalarValue; + exports.stringify = cstStringify.stringify; + exports.visit = cstVisit.visit; + exports.BOM = BOM; + exports.DOCUMENT = DOCUMENT; + exports.FLOW_END = FLOW_END; + exports.SCALAR = SCALAR; + exports.isCollection = isCollection; + exports.isScalar = isScalar; + exports.prettyToken = prettyToken; + exports.tokenType = tokenType; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/lexer.js +var require_lexer = /* @__PURE__ */ __commonJSMin(((exports) => { + var cst = require_cst(); + function isEmpty(ch) { + switch (ch) { + case void 0: + case " ": + case "\n": + case "\r": + case " ": return true; + default: return false; + } + } + const hexDigits = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"); + const tagChars = /* @__PURE__ */ new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"); + const flowIndicatorChars = /* @__PURE__ */ new Set(",[]{}"); + const invalidAnchorChars = /* @__PURE__ */ new Set(" ,[]{}\n\r "); + const isNotAnchorChar = (ch) => !ch || invalidAnchorChars.has(ch); + /** + * Splits an input string into lexical tokens, i.e. smaller strings that are + * easily identifiable by `tokens.tokenType()`. + * + * Lexing starts always in a "stream" context. Incomplete input may be buffered + * until a complete token can be emitted. + * + * In addition to slices of the original input, the following control characters + * may also be emitted: + * + * - `\x02` (Start of Text): A document starts with the next token + * - `\x18` (Cancel): Unexpected end of flow-mode (indicates an error) + * - `\x1f` (Unit Separator): Next token is a scalar value + * - `\u{FEFF}` (Byte order mark): Emitted separately outside documents + */ + var Lexer = class { + constructor() { + /** + * Flag indicating whether the end of the current buffer marks the end of + * all input + */ + this.atEnd = false; + /** + * Explicit indent set in block scalar header, as an offset from the current + * minimum indent, so e.g. set to 1 from a header `|2+`. Set to -1 if not + * explicitly set. + */ + this.blockScalarIndent = -1; + /** + * Block scalars that include a + (keep) chomping indicator in their header + * include trailing empty lines, which are otherwise excluded from the + * scalar's contents. + */ + this.blockScalarKeep = false; + /** Current input */ + this.buffer = ""; + /** + * Flag noting whether the map value indicator : can immediately follow this + * node within a flow context. + */ + this.flowKey = false; + /** Count of surrounding flow collection levels. */ + this.flowLevel = 0; + /** + * Minimum level of indentation required for next lines to be parsed as a + * part of the current scalar value. + */ + this.indentNext = 0; + /** Indentation level of the current line. */ + this.indentValue = 0; + /** Position of the next \n character. */ + this.lineEndPos = null; + /** Stores the state of the lexer if reaching the end of incpomplete input */ + this.next = null; + /** A pointer to `buffer`; the current position of the lexer. */ + this.pos = 0; + } + /** + * Generate YAML tokens from the `source` string. If `incomplete`, + * a part of the last line may be left as a buffer for the next call. + * + * @returns A generator of lexical tokens + */ + *lex(source, incomplete = false) { + if (source) { + if (typeof source !== "string") throw TypeError("source is not a string"); + this.buffer = this.buffer ? this.buffer + source : source; + this.lineEndPos = null; + } + this.atEnd = !incomplete; + let next = this.next ?? "stream"; + while (next && (incomplete || this.hasChars(1))) next = yield* this.parseNext(next); + } + atLineEnd() { + let i = this.pos; + let ch = this.buffer[i]; + while (ch === " " || ch === " ") ch = this.buffer[++i]; + if (!ch || ch === "#" || ch === "\n") return true; + if (ch === "\r") return this.buffer[i + 1] === "\n"; + return false; + } + charAt(n) { + return this.buffer[this.pos + n]; + } + continueScalar(offset) { + let ch = this.buffer[offset]; + if (this.indentNext > 0) { + let indent = 0; + while (ch === " ") ch = this.buffer[++indent + offset]; + if (ch === "\r") { + const next = this.buffer[indent + offset + 1]; + if (next === "\n" || !next && !this.atEnd) return offset + indent + 1; + } + return ch === "\n" || indent >= this.indentNext || !ch && !this.atEnd ? offset + indent : -1; + } + if (ch === "-" || ch === ".") { + const dt = this.buffer.substr(offset, 3); + if ((dt === "---" || dt === "...") && isEmpty(this.buffer[offset + 3])) return -1; + } + return offset; + } + getLine() { + let end = this.lineEndPos; + if (typeof end !== "number" || end !== -1 && end < this.pos) { + end = this.buffer.indexOf("\n", this.pos); + this.lineEndPos = end; + } + if (end === -1) return this.atEnd ? this.buffer.substring(this.pos) : null; + if (this.buffer[end - 1] === "\r") end -= 1; + return this.buffer.substring(this.pos, end); + } + hasChars(n) { + return this.pos + n <= this.buffer.length; + } + setNext(state) { + this.buffer = this.buffer.substring(this.pos); + this.pos = 0; + this.lineEndPos = null; + this.next = state; + return null; + } + peek(n) { + return this.buffer.substr(this.pos, n); + } + *parseNext(next) { + switch (next) { + case "stream": return yield* this.parseStream(); + case "line-start": return yield* this.parseLineStart(); + case "block-start": return yield* this.parseBlockStart(); + case "doc": return yield* this.parseDocument(); + case "flow": return yield* this.parseFlowCollection(); + case "quoted-scalar": return yield* this.parseQuotedScalar(); + case "block-scalar": return yield* this.parseBlockScalar(); + case "plain-scalar": return yield* this.parsePlainScalar(); + } + } + *parseStream() { + let line = this.getLine(); + if (line === null) return this.setNext("stream"); + if (line[0] === cst.BOM) { + yield* this.pushCount(1); + line = line.substring(1); + } + if (line[0] === "%") { + let dirEnd = line.length; + let cs = line.indexOf("#"); + while (cs !== -1) { + const ch = line[cs - 1]; + if (ch === " " || ch === " ") { + dirEnd = cs - 1; + break; + } else cs = line.indexOf("#", cs + 1); + } + while (true) { + const ch = line[dirEnd - 1]; + if (ch === " " || ch === " ") dirEnd -= 1; + else break; + } + const n = (yield* this.pushCount(dirEnd)) + (yield* this.pushSpaces(true)); + yield* this.pushCount(line.length - n); + this.pushNewline(); + return "stream"; + } + if (this.atLineEnd()) { + const sp = yield* this.pushSpaces(true); + yield* this.pushCount(line.length - sp); + yield* this.pushNewline(); + return "stream"; + } + yield cst.DOCUMENT; + return yield* this.parseLineStart(); + } + *parseLineStart() { + const ch = this.charAt(0); + if (!ch && !this.atEnd) return this.setNext("line-start"); + if (ch === "-" || ch === ".") { + if (!this.atEnd && !this.hasChars(4)) return this.setNext("line-start"); + const s = this.peek(3); + if ((s === "---" || s === "...") && isEmpty(this.charAt(3))) { + yield* this.pushCount(3); + this.indentValue = 0; + this.indentNext = 0; + return s === "---" ? "doc" : "stream"; + } + } + this.indentValue = yield* this.pushSpaces(false); + if (this.indentNext > this.indentValue && !isEmpty(this.charAt(1))) this.indentNext = this.indentValue; + return yield* this.parseBlockStart(); + } + *parseBlockStart() { + const [ch0, ch1] = this.peek(2); + if (!ch1 && !this.atEnd) return this.setNext("block-start"); + if ((ch0 === "-" || ch0 === "?" || ch0 === ":") && isEmpty(ch1)) { + const n = (yield* this.pushCount(1)) + (yield* this.pushSpaces(true)); + this.indentNext = this.indentValue + 1; + this.indentValue += n; + return yield* this.parseBlockStart(); + } + return "doc"; + } + *parseDocument() { + yield* this.pushSpaces(true); + const line = this.getLine(); + if (line === null) return this.setNext("doc"); + let n = yield* this.pushIndicators(); + switch (line[n]) { + case "#": yield* this.pushCount(line.length - n); + case void 0: + yield* this.pushNewline(); + return yield* this.parseLineStart(); + case "{": + case "[": + yield* this.pushCount(1); + this.flowKey = false; + this.flowLevel = 1; + return "flow"; + case "}": + case "]": + yield* this.pushCount(1); + return "doc"; + case "*": + yield* this.pushUntil(isNotAnchorChar); + return "doc"; + case "\"": + case "'": return yield* this.parseQuotedScalar(); + case "|": + case ">": + n += yield* this.parseBlockScalarHeader(); + n += yield* this.pushSpaces(true); + yield* this.pushCount(line.length - n); + yield* this.pushNewline(); + return yield* this.parseBlockScalar(); + default: return yield* this.parsePlainScalar(); + } + } + *parseFlowCollection() { + let nl, sp; + let indent = -1; + do { + nl = yield* this.pushNewline(); + if (nl > 0) { + sp = yield* this.pushSpaces(false); + this.indentValue = indent = sp; + } else sp = 0; + sp += yield* this.pushSpaces(true); + } while (nl + sp > 0); + const line = this.getLine(); + if (line === null) return this.setNext("flow"); + if (indent !== -1 && indent < this.indentNext && line[0] !== "#" || indent === 0 && (line.startsWith("---") || line.startsWith("...")) && isEmpty(line[3])) { + if (!(indent === this.indentNext - 1 && this.flowLevel === 1 && (line[0] === "]" || line[0] === "}"))) { + this.flowLevel = 0; + yield cst.FLOW_END; + return yield* this.parseLineStart(); + } + } + let n = 0; + while (line[n] === ",") { + n += yield* this.pushCount(1); + n += yield* this.pushSpaces(true); + this.flowKey = false; + } + n += yield* this.pushIndicators(); + switch (line[n]) { + case void 0: return "flow"; + case "#": + yield* this.pushCount(line.length - n); + return "flow"; + case "{": + case "[": + yield* this.pushCount(1); + this.flowKey = false; + this.flowLevel += 1; + return "flow"; + case "}": + case "]": + yield* this.pushCount(1); + this.flowKey = true; + this.flowLevel -= 1; + return this.flowLevel ? "flow" : "doc"; + case "*": + yield* this.pushUntil(isNotAnchorChar); + return "flow"; + case "\"": + case "'": + this.flowKey = true; + return yield* this.parseQuotedScalar(); + case ":": { + const next = this.charAt(1); + if (this.flowKey || isEmpty(next) || next === ",") { + this.flowKey = false; + yield* this.pushCount(1); + yield* this.pushSpaces(true); + return "flow"; + } + } + default: + this.flowKey = false; + return yield* this.parsePlainScalar(); + } + } + *parseQuotedScalar() { + const quote = this.charAt(0); + let end = this.buffer.indexOf(quote, this.pos + 1); + if (quote === "'") while (end !== -1 && this.buffer[end + 1] === "'") end = this.buffer.indexOf("'", end + 2); + else while (end !== -1) { + let n = 0; + while (this.buffer[end - 1 - n] === "\\") n += 1; + if (n % 2 === 0) break; + end = this.buffer.indexOf("\"", end + 1); + } + const qb = this.buffer.substring(0, end); + let nl = qb.indexOf("\n", this.pos); + if (nl !== -1) { + while (nl !== -1) { + const cs = this.continueScalar(nl + 1); + if (cs === -1) break; + nl = qb.indexOf("\n", cs); + } + if (nl !== -1) end = nl - (qb[nl - 1] === "\r" ? 2 : 1); + } + if (end === -1) { + if (!this.atEnd) return this.setNext("quoted-scalar"); + end = this.buffer.length; + } + yield* this.pushToIndex(end + 1, false); + return this.flowLevel ? "flow" : "doc"; + } + *parseBlockScalarHeader() { + this.blockScalarIndent = -1; + this.blockScalarKeep = false; + let i = this.pos; + while (true) { + const ch = this.buffer[++i]; + if (ch === "+") this.blockScalarKeep = true; + else if (ch > "0" && ch <= "9") this.blockScalarIndent = Number(ch) - 1; + else if (ch !== "-") break; + } + return yield* this.pushUntil((ch) => isEmpty(ch) || ch === "#"); + } + *parseBlockScalar() { + let nl = this.pos - 1; + let indent = 0; + let ch; + loop: for (let i = this.pos; ch = this.buffer[i]; ++i) switch (ch) { + case " ": + indent += 1; + break; + case "\n": + nl = i; + indent = 0; + break; + case "\r": { + const next = this.buffer[i + 1]; + if (!next && !this.atEnd) return this.setNext("block-scalar"); + if (next === "\n") break; + } + default: break loop; + } + if (!ch && !this.atEnd) return this.setNext("block-scalar"); + if (indent >= this.indentNext) { + if (this.blockScalarIndent === -1) this.indentNext = indent; + else this.indentNext = this.blockScalarIndent + (this.indentNext === 0 ? 1 : this.indentNext); + do { + const cs = this.continueScalar(nl + 1); + if (cs === -1) break; + nl = this.buffer.indexOf("\n", cs); + } while (nl !== -1); + if (nl === -1) { + if (!this.atEnd) return this.setNext("block-scalar"); + nl = this.buffer.length; + } + } + let i = nl + 1; + ch = this.buffer[i]; + while (ch === " ") ch = this.buffer[++i]; + if (ch === " ") { + while (ch === " " || ch === " " || ch === "\r" || ch === "\n") ch = this.buffer[++i]; + nl = i - 1; + } else if (!this.blockScalarKeep) do { + let i = nl - 1; + let ch = this.buffer[i]; + if (ch === "\r") ch = this.buffer[--i]; + const lastChar = i; + while (ch === " ") ch = this.buffer[--i]; + if (ch === "\n" && i >= this.pos && i + 1 + indent > lastChar) nl = i; + else break; + } while (true); + yield cst.SCALAR; + yield* this.pushToIndex(nl + 1, true); + return yield* this.parseLineStart(); + } + *parsePlainScalar() { + const inFlow = this.flowLevel > 0; + let end = this.pos - 1; + let i = this.pos - 1; + let ch; + while (ch = this.buffer[++i]) if (ch === ":") { + const next = this.buffer[i + 1]; + if (isEmpty(next) || inFlow && flowIndicatorChars.has(next)) break; + end = i; + } else if (isEmpty(ch)) { + let next = this.buffer[i + 1]; + if (ch === "\r") if (next === "\n") { + i += 1; + ch = "\n"; + next = this.buffer[i + 1]; + } else end = i; + if (next === "#" || inFlow && flowIndicatorChars.has(next)) break; + if (ch === "\n") { + const cs = this.continueScalar(i + 1); + if (cs === -1) break; + i = Math.max(i, cs - 2); + } + } else { + if (inFlow && flowIndicatorChars.has(ch)) break; + end = i; + } + if (!ch && !this.atEnd) return this.setNext("plain-scalar"); + yield cst.SCALAR; + yield* this.pushToIndex(end + 1, true); + return inFlow ? "flow" : "doc"; + } + *pushCount(n) { + if (n > 0) { + yield this.buffer.substr(this.pos, n); + this.pos += n; + return n; + } + return 0; + } + *pushToIndex(i, allowEmpty) { + const s = this.buffer.slice(this.pos, i); + if (s) { + yield s; + this.pos += s.length; + return s.length; + } else if (allowEmpty) yield ""; + return 0; + } + *pushIndicators() { + switch (this.charAt(0)) { + case "!": return (yield* this.pushTag()) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators()); + case "&": return (yield* this.pushUntil(isNotAnchorChar)) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators()); + case "-": + case "?": + case ":": { + const inFlow = this.flowLevel > 0; + const ch1 = this.charAt(1); + if (isEmpty(ch1) || inFlow && flowIndicatorChars.has(ch1)) { + if (!inFlow) this.indentNext = this.indentValue + 1; + else if (this.flowKey) this.flowKey = false; + return (yield* this.pushCount(1)) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators()); + } + } + } + return 0; + } + *pushTag() { + if (this.charAt(1) === "<") { + let i = this.pos + 2; + let ch = this.buffer[i]; + while (!isEmpty(ch) && ch !== ">") ch = this.buffer[++i]; + return yield* this.pushToIndex(ch === ">" ? i + 1 : i, false); + } else { + let i = this.pos + 1; + let ch = this.buffer[i]; + while (ch) if (tagChars.has(ch)) ch = this.buffer[++i]; + else if (ch === "%" && hexDigits.has(this.buffer[i + 1]) && hexDigits.has(this.buffer[i + 2])) ch = this.buffer[i += 3]; + else break; + return yield* this.pushToIndex(i, false); + } + } + *pushNewline() { + const ch = this.buffer[this.pos]; + if (ch === "\n") return yield* this.pushCount(1); + else if (ch === "\r" && this.charAt(1) === "\n") return yield* this.pushCount(2); + else return 0; + } + *pushSpaces(allowTabs) { + let i = this.pos - 1; + let ch; + do + ch = this.buffer[++i]; + while (ch === " " || allowTabs && ch === " "); + const n = i - this.pos; + if (n > 0) { + yield this.buffer.substr(this.pos, n); + this.pos = i; + } + return n; + } + *pushUntil(test) { + let i = this.pos; + let ch = this.buffer[i]; + while (!test(ch)) ch = this.buffer[++i]; + return yield* this.pushToIndex(i, false); + } + }; + exports.Lexer = Lexer; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/line-counter.js +var require_line_counter = /* @__PURE__ */ __commonJSMin(((exports) => { + /** + * Tracks newlines during parsing in order to provide an efficient API for + * determining the one-indexed `{ line, col }` position for any offset + * within the input. + */ + var LineCounter = class { + constructor() { + this.lineStarts = []; + /** + * Should be called in ascending order. Otherwise, call + * `lineCounter.lineStarts.sort()` before calling `linePos()`. + */ + this.addNewLine = (offset) => this.lineStarts.push(offset); + /** + * Performs a binary search and returns the 1-indexed { line, col } + * position of `offset`. If `line === 0`, `addNewLine` has never been + * called or `offset` is before the first known newline. + */ + this.linePos = (offset) => { + let low = 0; + let high = this.lineStarts.length; + while (low < high) { + const mid = low + high >> 1; + if (this.lineStarts[mid] < offset) low = mid + 1; + else high = mid; + } + if (this.lineStarts[low] === offset) return { + line: low + 1, + col: 1 + }; + if (low === 0) return { + line: 0, + col: offset + }; + const start = this.lineStarts[low - 1]; + return { + line: low, + col: offset - start + 1 + }; + }; + } + }; + exports.LineCounter = LineCounter; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/parser.js +var require_parser = /* @__PURE__ */ __commonJSMin(((exports) => { + var node_process = __require("process"); + var cst = require_cst(); + var lexer = require_lexer(); + function includesToken(list, type) { + for (let i = 0; i < list.length; ++i) if (list[i].type === type) return true; + return false; + } + function findNonEmptyIndex(list) { + for (let i = 0; i < list.length; ++i) switch (list[i].type) { + case "space": + case "comment": + case "newline": break; + default: return i; + } + return -1; + } + function isFlowToken(token) { + switch (token?.type) { + case "alias": + case "scalar": + case "single-quoted-scalar": + case "double-quoted-scalar": + case "flow-collection": return true; + default: return false; + } + } + function getPrevProps(parent) { + switch (parent.type) { + case "document": return parent.start; + case "block-map": { + const it = parent.items[parent.items.length - 1]; + return it.sep ?? it.start; + } + case "block-seq": return parent.items[parent.items.length - 1].start; + /* istanbul ignore next should not happen */ + default: return []; + } + } + /** Note: May modify input array */ + function getFirstKeyStartProps(prev) { + if (prev.length === 0) return []; + let i = prev.length; + loop: while (--i >= 0) switch (prev[i].type) { + case "doc-start": + case "explicit-key-ind": + case "map-value-ind": + case "seq-item-ind": + case "newline": break loop; + } + while (prev[++i]?.type === "space"); + return prev.splice(i, prev.length); + } + function fixFlowSeqItems(fc) { + if (fc.start.type === "flow-seq-start") { + for (const it of fc.items) if (it.sep && !it.value && !includesToken(it.start, "explicit-key-ind") && !includesToken(it.sep, "map-value-ind")) { + if (it.key) it.value = it.key; + delete it.key; + if (isFlowToken(it.value)) if (it.value.end) Array.prototype.push.apply(it.value.end, it.sep); + else it.value.end = it.sep; + else Array.prototype.push.apply(it.start, it.sep); + delete it.sep; + } + } + } + /** + * A YAML concrete syntax tree (CST) parser + * + * ```ts + * const src: string = ... + * for (const token of new Parser().parse(src)) { + * // token: Token + * } + * ``` + * + * To use the parser with a user-provided lexer: + * + * ```ts + * function* parse(source: string, lexer: Lexer) { + * const parser = new Parser() + * for (const lexeme of lexer.lex(source)) + * yield* parser.next(lexeme) + * yield* parser.end() + * } + * + * const src: string = ... + * const lexer = new Lexer() + * for (const token of parse(src, lexer)) { + * // token: Token + * } + * ``` + */ + var Parser = class { + /** + * @param onNewLine - If defined, called separately with the start position of + * each new line (in `parse()`, including the start of input). + */ + constructor(onNewLine) { + /** If true, space and sequence indicators count as indentation */ + this.atNewLine = true; + /** If true, next token is a scalar value */ + this.atScalar = false; + /** Current indentation level */ + this.indent = 0; + /** Current offset since the start of parsing */ + this.offset = 0; + /** On the same line with a block map key */ + this.onKeyLine = false; + /** Top indicates the node that's currently being built */ + this.stack = []; + /** The source of the current token, set in parse() */ + this.source = ""; + /** The type of the current token, set in parse() */ + this.type = ""; + this.lexer = new lexer.Lexer(); + this.onNewLine = onNewLine; + } + /** + * Parse `source` as a YAML stream. + * If `incomplete`, a part of the last line may be left as a buffer for the next call. + * + * Errors are not thrown, but yielded as `{ type: 'error', message }` tokens. + * + * @returns A generator of tokens representing each directive, document, and other structure. + */ + *parse(source, incomplete = false) { + if (this.onNewLine && this.offset === 0) this.onNewLine(0); + for (const lexeme of this.lexer.lex(source, incomplete)) yield* this.next(lexeme); + if (!incomplete) yield* this.end(); + } + /** + * Advance the parser by the `source` of one lexical token. + */ + *next(source) { + this.source = source; + if (node_process.env.LOG_TOKENS) console.log("|", cst.prettyToken(source)); + if (this.atScalar) { + this.atScalar = false; + yield* this.step(); + this.offset += source.length; + return; + } + const type = cst.tokenType(source); + if (!type) { + const message = `Not a YAML token: ${source}`; + yield* this.pop({ + type: "error", + offset: this.offset, + message, + source + }); + this.offset += source.length; + } else if (type === "scalar") { + this.atNewLine = false; + this.atScalar = true; + this.type = "scalar"; + } else { + this.type = type; + yield* this.step(); + switch (type) { + case "newline": + this.atNewLine = true; + this.indent = 0; + if (this.onNewLine) this.onNewLine(this.offset + source.length); + break; + case "space": + if (this.atNewLine && source[0] === " ") this.indent += source.length; + break; + case "explicit-key-ind": + case "map-value-ind": + case "seq-item-ind": + if (this.atNewLine) this.indent += source.length; + break; + case "doc-mode": + case "flow-error-end": return; + default: this.atNewLine = false; + } + this.offset += source.length; + } + } + /** Call at end of input to push out any remaining constructions */ + *end() { + while (this.stack.length > 0) yield* this.pop(); + } + get sourceToken() { + return { + type: this.type, + offset: this.offset, + indent: this.indent, + source: this.source + }; + } + *step() { + const top = this.peek(1); + if (this.type === "doc-end" && top?.type !== "doc-end") { + while (this.stack.length > 0) yield* this.pop(); + this.stack.push({ + type: "doc-end", + offset: this.offset, + source: this.source + }); + return; + } + if (!top) return yield* this.stream(); + switch (top.type) { + case "document": return yield* this.document(top); + case "alias": + case "scalar": + case "single-quoted-scalar": + case "double-quoted-scalar": return yield* this.scalar(top); + case "block-scalar": return yield* this.blockScalar(top); + case "block-map": return yield* this.blockMap(top); + case "block-seq": return yield* this.blockSequence(top); + case "flow-collection": return yield* this.flowCollection(top); + case "doc-end": return yield* this.documentEnd(top); + } + /* istanbul ignore next should not happen */ + yield* this.pop(); + } + peek(n) { + return this.stack[this.stack.length - n]; + } + *pop(error) { + const token = error ?? this.stack.pop(); + /* istanbul ignore if should not happen */ + if (!token) yield { + type: "error", + offset: this.offset, + source: "", + message: "Tried to pop an empty stack" + }; + else if (this.stack.length === 0) yield token; + else { + const top = this.peek(1); + if (token.type === "block-scalar") token.indent = "indent" in top ? top.indent : 0; + else if (token.type === "flow-collection" && top.type === "document") token.indent = 0; + if (token.type === "flow-collection") fixFlowSeqItems(token); + switch (top.type) { + case "document": + top.value = token; + break; + case "block-scalar": + top.props.push(token); + break; + case "block-map": { + const it = top.items[top.items.length - 1]; + if (it.value) { + top.items.push({ + start: [], + key: token, + sep: [] + }); + this.onKeyLine = true; + return; + } else if (it.sep) it.value = token; + else { + Object.assign(it, { + key: token, + sep: [] + }); + this.onKeyLine = !it.explicitKey; + return; + } + break; + } + case "block-seq": { + const it = top.items[top.items.length - 1]; + if (it.value) top.items.push({ + start: [], + value: token + }); + else it.value = token; + break; + } + case "flow-collection": { + const it = top.items[top.items.length - 1]; + if (!it || it.value) top.items.push({ + start: [], + key: token, + sep: [] + }); + else if (it.sep) it.value = token; + else Object.assign(it, { + key: token, + sep: [] + }); + return; + } + /* istanbul ignore next should not happen */ + default: + yield* this.pop(); + yield* this.pop(token); + } + if ((top.type === "document" || top.type === "block-map" || top.type === "block-seq") && (token.type === "block-map" || token.type === "block-seq")) { + const last = token.items[token.items.length - 1]; + if (last && !last.sep && !last.value && last.start.length > 0 && findNonEmptyIndex(last.start) === -1 && (token.indent === 0 || last.start.every((st) => st.type !== "comment" || st.indent < token.indent))) { + if (top.type === "document") top.end = last.start; + else top.items.push({ start: last.start }); + token.items.splice(-1, 1); + } + } + } + } + *stream() { + switch (this.type) { + case "directive-line": + yield { + type: "directive", + offset: this.offset, + source: this.source + }; + return; + case "byte-order-mark": + case "space": + case "comment": + case "newline": + yield this.sourceToken; + return; + case "doc-mode": + case "doc-start": { + const doc = { + type: "document", + offset: this.offset, + start: [] + }; + if (this.type === "doc-start") doc.start.push(this.sourceToken); + this.stack.push(doc); + return; + } + } + yield { + type: "error", + offset: this.offset, + message: `Unexpected ${this.type} token in YAML stream`, + source: this.source + }; + } + *document(doc) { + if (doc.value) return yield* this.lineEnd(doc); + switch (this.type) { + case "doc-start": + if (findNonEmptyIndex(doc.start) !== -1) { + yield* this.pop(); + yield* this.step(); + } else doc.start.push(this.sourceToken); + return; + case "anchor": + case "tag": + case "space": + case "comment": + case "newline": + doc.start.push(this.sourceToken); + return; + } + const bv = this.startBlockValue(doc); + if (bv) this.stack.push(bv); + else yield { + type: "error", + offset: this.offset, + message: `Unexpected ${this.type} token in YAML document`, + source: this.source + }; + } + *scalar(scalar) { + if (this.type === "map-value-ind") { + const start = getFirstKeyStartProps(getPrevProps(this.peek(2))); + let sep; + if (scalar.end) { + sep = scalar.end; + sep.push(this.sourceToken); + delete scalar.end; + } else sep = [this.sourceToken]; + const map = { + type: "block-map", + offset: scalar.offset, + indent: scalar.indent, + items: [{ + start, + key: scalar, + sep + }] + }; + this.onKeyLine = true; + this.stack[this.stack.length - 1] = map; + } else yield* this.lineEnd(scalar); + } + *blockScalar(scalar) { + switch (this.type) { + case "space": + case "comment": + case "newline": + scalar.props.push(this.sourceToken); + return; + case "scalar": + scalar.source = this.source; + this.atNewLine = true; + this.indent = 0; + if (this.onNewLine) { + let nl = this.source.indexOf("\n") + 1; + while (nl !== 0) { + this.onNewLine(this.offset + nl); + nl = this.source.indexOf("\n", nl) + 1; + } + } + yield* this.pop(); + break; + /* istanbul ignore next should not happen */ + default: + yield* this.pop(); + yield* this.step(); + } + } + *blockMap(map) { + const it = map.items[map.items.length - 1]; + switch (this.type) { + case "newline": + this.onKeyLine = false; + if (it.value) { + const end = "end" in it.value ? it.value.end : void 0; + if ((Array.isArray(end) ? end[end.length - 1] : void 0)?.type === "comment") end?.push(this.sourceToken); + else map.items.push({ start: [this.sourceToken] }); + } else if (it.sep) it.sep.push(this.sourceToken); + else it.start.push(this.sourceToken); + return; + case "space": + case "comment": + if (it.value) map.items.push({ start: [this.sourceToken] }); + else if (it.sep) it.sep.push(this.sourceToken); + else { + if (this.atIndentedComment(it.start, map.indent)) { + const end = map.items[map.items.length - 2]?.value?.end; + if (Array.isArray(end)) { + Array.prototype.push.apply(end, it.start); + end.push(this.sourceToken); + map.items.pop(); + return; + } + } + it.start.push(this.sourceToken); + } + return; + } + if (this.indent >= map.indent) { + const atMapIndent = !this.onKeyLine && this.indent === map.indent; + const atNextItem = atMapIndent && (it.sep || it.explicitKey) && this.type !== "seq-item-ind"; + let start = []; + if (atNextItem && it.sep && !it.value) { + const nl = []; + for (let i = 0; i < it.sep.length; ++i) { + const st = it.sep[i]; + switch (st.type) { + case "newline": + nl.push(i); + break; + case "space": break; + case "comment": + if (st.indent > map.indent) nl.length = 0; + break; + default: nl.length = 0; + } + } + if (nl.length >= 2) start = it.sep.splice(nl[1]); + } + switch (this.type) { + case "anchor": + case "tag": + if (atNextItem || it.value) { + start.push(this.sourceToken); + map.items.push({ start }); + this.onKeyLine = true; + } else if (it.sep) it.sep.push(this.sourceToken); + else it.start.push(this.sourceToken); + return; + case "explicit-key-ind": + if (!it.sep && !it.explicitKey) { + it.start.push(this.sourceToken); + it.explicitKey = true; + } else if (atNextItem || it.value) { + start.push(this.sourceToken); + map.items.push({ + start, + explicitKey: true + }); + } else this.stack.push({ + type: "block-map", + offset: this.offset, + indent: this.indent, + items: [{ + start: [this.sourceToken], + explicitKey: true + }] + }); + this.onKeyLine = true; + return; + case "map-value-ind": + if (it.explicitKey) if (!it.sep) if (includesToken(it.start, "newline")) Object.assign(it, { + key: null, + sep: [this.sourceToken] + }); + else { + const start = getFirstKeyStartProps(it.start); + this.stack.push({ + type: "block-map", + offset: this.offset, + indent: this.indent, + items: [{ + start, + key: null, + sep: [this.sourceToken] + }] + }); + } + else if (it.value) map.items.push({ + start: [], + key: null, + sep: [this.sourceToken] + }); + else if (includesToken(it.sep, "map-value-ind")) this.stack.push({ + type: "block-map", + offset: this.offset, + indent: this.indent, + items: [{ + start, + key: null, + sep: [this.sourceToken] + }] + }); + else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) { + const start = getFirstKeyStartProps(it.start); + const key = it.key; + const sep = it.sep; + sep.push(this.sourceToken); + delete it.key; + delete it.sep; + this.stack.push({ + type: "block-map", + offset: this.offset, + indent: this.indent, + items: [{ + start, + key, + sep + }] + }); + } else if (start.length > 0) it.sep = it.sep.concat(start, this.sourceToken); + else it.sep.push(this.sourceToken); + else if (!it.sep) Object.assign(it, { + key: null, + sep: [this.sourceToken] + }); + else if (it.value || atNextItem) map.items.push({ + start, + key: null, + sep: [this.sourceToken] + }); + else if (includesToken(it.sep, "map-value-ind")) this.stack.push({ + type: "block-map", + offset: this.offset, + indent: this.indent, + items: [{ + start: [], + key: null, + sep: [this.sourceToken] + }] + }); + else it.sep.push(this.sourceToken); + this.onKeyLine = true; + return; + case "alias": + case "scalar": + case "single-quoted-scalar": + case "double-quoted-scalar": { + const fs = this.flowScalar(this.type); + if (atNextItem || it.value) { + map.items.push({ + start, + key: fs, + sep: [] + }); + this.onKeyLine = true; + } else if (it.sep) this.stack.push(fs); + else { + Object.assign(it, { + key: fs, + sep: [] + }); + this.onKeyLine = true; + } + return; + } + default: { + const bv = this.startBlockValue(map); + if (bv) { + if (bv.type === "block-seq") { + if (!it.explicitKey && it.sep && !includesToken(it.sep, "newline")) { + yield* this.pop({ + type: "error", + offset: this.offset, + message: "Unexpected block-seq-ind on same line with key", + source: this.source + }); + return; + } + } else if (atMapIndent) map.items.push({ start }); + this.stack.push(bv); + return; + } + } + } + } + yield* this.pop(); + yield* this.step(); + } + *blockSequence(seq) { + const it = seq.items[seq.items.length - 1]; + switch (this.type) { + case "newline": + if (it.value) { + const end = "end" in it.value ? it.value.end : void 0; + if ((Array.isArray(end) ? end[end.length - 1] : void 0)?.type === "comment") end?.push(this.sourceToken); + else seq.items.push({ start: [this.sourceToken] }); + } else it.start.push(this.sourceToken); + return; + case "space": + case "comment": + if (it.value) seq.items.push({ start: [this.sourceToken] }); + else { + if (this.atIndentedComment(it.start, seq.indent)) { + const end = seq.items[seq.items.length - 2]?.value?.end; + if (Array.isArray(end)) { + Array.prototype.push.apply(end, it.start); + end.push(this.sourceToken); + seq.items.pop(); + return; + } + } + it.start.push(this.sourceToken); + } + return; + case "anchor": + case "tag": + if (it.value || this.indent <= seq.indent) break; + it.start.push(this.sourceToken); + return; + case "seq-item-ind": + if (this.indent !== seq.indent) break; + if (it.value || includesToken(it.start, "seq-item-ind")) seq.items.push({ start: [this.sourceToken] }); + else it.start.push(this.sourceToken); + return; + } + if (this.indent > seq.indent) { + const bv = this.startBlockValue(seq); + if (bv) { + this.stack.push(bv); + return; + } + } + yield* this.pop(); + yield* this.step(); + } + *flowCollection(fc) { + const it = fc.items[fc.items.length - 1]; + if (this.type === "flow-error-end") { + let top; + do { + yield* this.pop(); + top = this.peek(1); + } while (top?.type === "flow-collection"); + } else if (fc.end.length === 0) { + switch (this.type) { + case "comma": + case "explicit-key-ind": + if (!it || it.sep) fc.items.push({ start: [this.sourceToken] }); + else it.start.push(this.sourceToken); + return; + case "map-value-ind": + if (!it || it.value) fc.items.push({ + start: [], + key: null, + sep: [this.sourceToken] + }); + else if (it.sep) it.sep.push(this.sourceToken); + else Object.assign(it, { + key: null, + sep: [this.sourceToken] + }); + return; + case "space": + case "comment": + case "newline": + case "anchor": + case "tag": + if (!it || it.value) fc.items.push({ start: [this.sourceToken] }); + else if (it.sep) it.sep.push(this.sourceToken); + else it.start.push(this.sourceToken); + return; + case "alias": + case "scalar": + case "single-quoted-scalar": + case "double-quoted-scalar": { + const fs = this.flowScalar(this.type); + if (!it || it.value) fc.items.push({ + start: [], + key: fs, + sep: [] + }); + else if (it.sep) this.stack.push(fs); + else Object.assign(it, { + key: fs, + sep: [] + }); + return; + } + case "flow-map-end": + case "flow-seq-end": + fc.end.push(this.sourceToken); + return; + } + const bv = this.startBlockValue(fc); + /* istanbul ignore else should not happen */ + if (bv) this.stack.push(bv); + else { + yield* this.pop(); + yield* this.step(); + } + } else { + const parent = this.peek(2); + if (parent.type === "block-map" && (this.type === "map-value-ind" && parent.indent === fc.indent || this.type === "newline" && !parent.items[parent.items.length - 1].sep)) { + yield* this.pop(); + yield* this.step(); + } else if (this.type === "map-value-ind" && parent.type !== "flow-collection") { + const start = getFirstKeyStartProps(getPrevProps(parent)); + fixFlowSeqItems(fc); + const sep = fc.end.splice(1, fc.end.length); + sep.push(this.sourceToken); + const map = { + type: "block-map", + offset: fc.offset, + indent: fc.indent, + items: [{ + start, + key: fc, + sep + }] + }; + this.onKeyLine = true; + this.stack[this.stack.length - 1] = map; + } else yield* this.lineEnd(fc); + } + } + flowScalar(type) { + if (this.onNewLine) { + let nl = this.source.indexOf("\n") + 1; + while (nl !== 0) { + this.onNewLine(this.offset + nl); + nl = this.source.indexOf("\n", nl) + 1; + } + } + return { + type, + offset: this.offset, + indent: this.indent, + source: this.source + }; + } + startBlockValue(parent) { + switch (this.type) { + case "alias": + case "scalar": + case "single-quoted-scalar": + case "double-quoted-scalar": return this.flowScalar(this.type); + case "block-scalar-header": return { + type: "block-scalar", + offset: this.offset, + indent: this.indent, + props: [this.sourceToken], + source: "" + }; + case "flow-map-start": + case "flow-seq-start": return { + type: "flow-collection", + offset: this.offset, + indent: this.indent, + start: this.sourceToken, + items: [], + end: [] + }; + case "seq-item-ind": return { + type: "block-seq", + offset: this.offset, + indent: this.indent, + items: [{ start: [this.sourceToken] }] + }; + case "explicit-key-ind": { + this.onKeyLine = true; + const start = getFirstKeyStartProps(getPrevProps(parent)); + start.push(this.sourceToken); + return { + type: "block-map", + offset: this.offset, + indent: this.indent, + items: [{ + start, + explicitKey: true + }] + }; + } + case "map-value-ind": { + this.onKeyLine = true; + const start = getFirstKeyStartProps(getPrevProps(parent)); + return { + type: "block-map", + offset: this.offset, + indent: this.indent, + items: [{ + start, + key: null, + sep: [this.sourceToken] + }] + }; + } + } + return null; + } + atIndentedComment(start, indent) { + if (this.type !== "comment") return false; + if (this.indent <= indent) return false; + return start.every((st) => st.type === "newline" || st.type === "space"); + } + *documentEnd(docEnd) { + if (this.type !== "doc-mode") { + if (docEnd.end) docEnd.end.push(this.sourceToken); + else docEnd.end = [this.sourceToken]; + if (this.type === "newline") yield* this.pop(); + } + } + *lineEnd(token) { + switch (this.type) { + case "comma": + case "doc-start": + case "doc-end": + case "flow-seq-end": + case "flow-map-end": + case "map-value-ind": + yield* this.pop(); + yield* this.step(); + break; + case "newline": this.onKeyLine = false; + default: + if (token.end) token.end.push(this.sourceToken); + else token.end = [this.sourceToken]; + if (this.type === "newline") yield* this.pop(); + } + } + }; + exports.Parser = Parser; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/public-api.js +var require_public_api = /* @__PURE__ */ __commonJSMin(((exports) => { + var composer = require_composer(); + var Document = require_Document(); + var errors = require_errors(); + var log = require_log(); + var identity = require_identity(); + var lineCounter = require_line_counter(); + var parser = require_parser(); + function parseOptions(options) { + const prettyErrors = options.prettyErrors !== false; + return { + lineCounter: options.lineCounter || prettyErrors && new lineCounter.LineCounter() || null, + prettyErrors + }; + } + /** + * Parse the input as a stream of YAML documents. + * + * Documents should be separated from each other by `...` or `---` marker lines. + * + * @returns If an empty `docs` array is returned, it will be of type + * EmptyStream and contain additional stream information. In + * TypeScript, you should use `'empty' in docs` as a type guard for it. + */ + function parseAllDocuments(source, options = {}) { + const { lineCounter, prettyErrors } = parseOptions(options); + const parser$1 = new parser.Parser(lineCounter?.addNewLine); + const composer$1 = new composer.Composer(options); + const docs = Array.from(composer$1.compose(parser$1.parse(source))); + if (prettyErrors && lineCounter) for (const doc of docs) { + doc.errors.forEach(errors.prettifyError(source, lineCounter)); + doc.warnings.forEach(errors.prettifyError(source, lineCounter)); + } + if (docs.length > 0) return docs; + return Object.assign([], { empty: true }, composer$1.streamInfo()); + } + /** Parse an input string into a single YAML.Document */ + function parseDocument(source, options = {}) { + const { lineCounter, prettyErrors } = parseOptions(options); + const parser$1 = new parser.Parser(lineCounter?.addNewLine); + const composer$1 = new composer.Composer(options); + let doc = null; + for (const _doc of composer$1.compose(parser$1.parse(source), true, source.length)) if (!doc) doc = _doc; + else if (doc.options.logLevel !== "silent") { + doc.errors.push(new errors.YAMLParseError(_doc.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()")); + break; + } + if (prettyErrors && lineCounter) { + doc.errors.forEach(errors.prettifyError(source, lineCounter)); + doc.warnings.forEach(errors.prettifyError(source, lineCounter)); + } + return doc; + } + function parse(src, reviver, options) { + let _reviver = void 0; + if (typeof reviver === "function") _reviver = reviver; + else if (options === void 0 && reviver && typeof reviver === "object") options = reviver; + const doc = parseDocument(src, options); + if (!doc) return null; + doc.warnings.forEach((warning) => log.warn(doc.options.logLevel, warning)); + if (doc.errors.length > 0) if (doc.options.logLevel !== "silent") throw doc.errors[0]; + else doc.errors = []; + return doc.toJS(Object.assign({ reviver: _reviver }, options)); + } + function stringify(value, replacer, options) { + let _replacer = null; + if (typeof replacer === "function" || Array.isArray(replacer)) _replacer = replacer; + else if (options === void 0 && replacer) options = replacer; + if (typeof options === "string") options = options.length; + if (typeof options === "number") { + const indent = Math.round(options); + options = indent < 1 ? void 0 : indent > 8 ? { indent: 8 } : { indent }; + } + if (value === void 0) { + const { keepUndefined } = options ?? replacer ?? {}; + if (!keepUndefined) return void 0; + } + if (identity.isDocument(value) && !_replacer) return value.toString(options); + return new Document.Document(value, _replacer, options).toString(options); + } + exports.parse = parse; + exports.parseAllDocuments = parseAllDocuments; + exports.parseDocument = parseDocument; + exports.stringify = stringify; +})); +//#endregion +//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/index.js +var require_dist$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + var composer = require_composer(); + var Document = require_Document(); + var Schema = require_Schema(); + var errors = require_errors(); + var Alias = require_Alias(); + var identity = require_identity(); + var Pair = require_Pair(); + var Scalar = require_Scalar(); + var YAMLMap = require_YAMLMap(); + var YAMLSeq = require_YAMLSeq(); + var cst = require_cst(); + var lexer = require_lexer(); + var lineCounter = require_line_counter(); + var parser = require_parser(); + var publicApi = require_public_api(); + var visit = require_visit(); + exports.Composer = composer.Composer; + exports.Document = Document.Document; + exports.Schema = Schema.Schema; + exports.YAMLError = errors.YAMLError; + exports.YAMLParseError = errors.YAMLParseError; + exports.YAMLWarning = errors.YAMLWarning; + exports.Alias = Alias.Alias; + exports.isAlias = identity.isAlias; + exports.isCollection = identity.isCollection; + exports.isDocument = identity.isDocument; + exports.isMap = identity.isMap; + exports.isNode = identity.isNode; + exports.isPair = identity.isPair; + exports.isScalar = identity.isScalar; + exports.isSeq = identity.isSeq; + exports.Pair = Pair.Pair; + exports.Scalar = Scalar.Scalar; + exports.YAMLMap = YAMLMap.YAMLMap; + exports.YAMLSeq = YAMLSeq.YAMLSeq; + exports.CST = cst; + exports.Lexer = lexer.Lexer; + exports.LineCounter = lineCounter.LineCounter; + exports.Parser = parser.Parser; + exports.parse = publicApi.parse; + exports.parseAllDocuments = publicApi.parseAllDocuments; + exports.parseDocument = publicApi.parseDocument; + exports.stringify = publicApi.stringify; + exports.visit = visit.visit; + exports.visitAsync = visit.visitAsync; +})); +//#endregion +//#region ../../node_modules/.pnpm/@pnpm+yaml.document-sync@1000.0.0/node_modules/@pnpm/yaml.document-sync/lib/patchDocument.js +var require_patchDocument = /* @__PURE__ */ __commonJSMin(((exports) => { + var __importDefault = exports && exports.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.patchDocument = patchDocument; + const yaml_1 = __importDefault(require_dist$1()); + /** + * Recursively update a YAML document (in-place) to match the contents of a + * target value. + * + * Comments are preserved on a best-effort basis. There are several cases where + * ambiguity arises. See this package's README.md for details. + */ + function patchDocument(document, target, options) { + if (document.errors.length > 0) throw new Error("Document with errors cannot be patched"); + document.contents = patchNode(document.contents, target, { + document, + aliases: options?.aliases ?? "unwrap" + }); + } + function patchNode(node, target, ctx) { + if (node == null) return ctx.document.createNode(target); + if (target == null) return null; + if (yaml_1.default.isAlias(node)) return patchAlias(node, target, ctx); + if (yaml_1.default.isScalar(node)) return patchScalar(node, target, ctx); + if (yaml_1.default.isMap(node)) return patchMap(node, target, ctx); + if (yaml_1.default.isSeq(node)) return patchSeq(node, target, ctx); + throw new Error("Unrecognized yaml node: " + String(node)); + } + function patchAlias(alias, target, ctx) { + const resolved = alias.resolve(ctx.document); + if (resolved == null) throw new Error("Failed to resolve yaml alias: " + alias.source); + switch (ctx.aliases) { + case "follow": + patchNode(resolved, target, ctx); + return alias; + case "unwrap": { + const copy = resolved.clone(); + copy.anchor = void 0; + patchNode(copy, target, ctx); + return copy; + } + } + } + function patchScalar(scalar, target, ctx) { + if (scalar.value === target) return scalar; + if (typeof target === "boolean" || typeof target === "string" || typeof target === "number") { + scalar.value = target; + return scalar; + } + return ctx.document.createNode(target); + } + function patchMap(map, target, ctx) { + if (!isRecord(target)) return ctx.document.createNode(target); + if (target == null || Object.keys(target).length === 0) return null; + const mapKeyToExistingPair = /* @__PURE__ */ new Map(); + for (const pair of map.items) { + if (!yaml_1.default.isScalar(pair.key) || typeof pair.key.value !== "string") throw new Error("Encountered unexpected non-node value: " + String(pair.key)); + mapKeyToExistingPair.set(pair.key.value, pair); + } + map.items = Object.entries(target).map(([key, value]) => { + const existingPair = mapKeyToExistingPair.get(key); + if (existingPair == null) return ctx.document.createPair(key, value); + if (!yaml_1.default.isNode(existingPair.value)) throw new Error("Encountered unexpected non-node value: " + String(existingPair.value)); + existingPair.value = patchNode(existingPair.value, value, ctx); + return existingPair; + }).filter((pair) => pair.value != null); + return map; + } + function patchSeq(seq, target, ctx) { + if (!Array.isArray(target)) return ctx.document.createNode(target); + return isPrimitiveList(target) ? patchSeqPrimitive(seq, target) : patchSeqComplex(seq, target, ctx); + } + function patchSeqPrimitive(seq, target) { + const valueToNodesMap = /* @__PURE__ */ new Map(); + for (const item of seq.items) { + if (item != null && !yaml_1.default.isNode(item)) throw new Error("Encountered unexpected non-node value: " + String(item)); + if (!yaml_1.default.isScalar(item) || !isPrimitive(item.value) || item.value == null) continue; + const nodeList = valueToNodesMap.get(item.value) ?? []; + nodeList.push(item); + valueToNodesMap.set(item.value, nodeList); + } + seq.items = target.filter((item) => item != null).map((item) => { + const existingNodesList = valueToNodesMap.get(item); + const firstExistingItem = existingNodesList?.shift(); + if (existingNodesList?.length === 0) valueToNodesMap.delete(item); + return firstExistingItem ?? new yaml_1.default.Scalar(item); + }); + return seq; + } + function patchSeqComplex(seq, target, ctx) { + const nextItems = []; + for (let i = 0; i < Math.max(seq.items.length, target.length); i++) { + const existingItem = seq.items[i]; + const targetItem = target[i]; + if (existingItem != null && !yaml_1.default.isNode(existingItem)) throw new Error("Encountered unexpected non-node value: " + String(existingItem)); + const nextItem = patchNode(existingItem, targetItem, ctx); + if (nextItem == null) continue; + nextItems.push(nextItem); + } + seq.items = nextItems; + return seq; + } + function isRecord(value) { + return value != null && typeof value === "object" && !Array.isArray(value); + } + function isPrimitiveList(arr) { + return arr.every(isPrimitive); + } + function isPrimitive(value) { + return value == null || typeof value === "boolean" || typeof value === "string" || typeof value === "number"; + } +})); +//#endregion +//#region ../../node_modules/.pnpm/@pnpm+yaml.document-sync@1000.0.0/node_modules/@pnpm/yaml.document-sync/lib/index.js +var require_lib$3 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.patchDocument = void 0; + var patchDocument_js_1 = require_patchDocument(); + Object.defineProperty(exports, "patchDocument", { + enumerable: true, + get: function() { + return patchDocument_js_1.patchDocument; + } + }); +})); +//#endregion +//#region ../../node_modules/.pnpm/@pnpm+ramda@0.28.1/node_modules/@pnpm/ramda/src/internal/_isPlaceholder.js +var require__isPlaceholder = /* @__PURE__ */ __commonJSMin(((exports, module) => { + function _isPlaceholder(a) { + return a != null && typeof a === "object" && a["@@functional/placeholder"] === true; + } + module.exports = _isPlaceholder; +})); +//#endregion +//#region ../../node_modules/.pnpm/@pnpm+ramda@0.28.1/node_modules/@pnpm/ramda/src/internal/_curry1.js +var require__curry1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + var _isPlaceholder = require__isPlaceholder(); + /** + * Optimized internal one-arity curry function. + * + * @private + * @category Function + * @param {Function} fn The function to curry. + * @return {Function} The curried function. + */ + function _curry1(fn) { + return function f1(a) { + if (arguments.length === 0 || _isPlaceholder(a)) return f1; + else return fn.apply(this, arguments); + }; + } + module.exports = _curry1; +})); +//#endregion +//#region ../../node_modules/.pnpm/@pnpm+ramda@0.28.1/node_modules/@pnpm/ramda/src/internal/_curry2.js +var require__curry2 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + var _curry1 = require__curry1(); + var _isPlaceholder = require__isPlaceholder(); + /** + * Optimized internal two-arity curry function. + * + * @private + * @category Function + * @param {Function} fn The function to curry. + * @return {Function} The curried function. + */ + function _curry2(fn) { + return function f2(a, b) { + switch (arguments.length) { + case 0: return f2; + case 1: return _isPlaceholder(a) ? f2 : _curry1(function(_b) { + return fn(a, _b); + }); + default: return _isPlaceholder(a) && _isPlaceholder(b) ? f2 : _isPlaceholder(a) ? _curry1(function(_a) { + return fn(_a, b); + }) : _isPlaceholder(b) ? _curry1(function(_b) { + return fn(a, _b); + }) : fn(a, b); + } + }; + } + module.exports = _curry2; +})); +//#endregion +//#region ../../node_modules/.pnpm/@pnpm+ramda@0.28.1/node_modules/@pnpm/ramda/src/internal/_arrayFromIterator.js +var require__arrayFromIterator = /* @__PURE__ */ __commonJSMin(((exports, module) => { + function _arrayFromIterator(iter) { + var list = []; + var next; + while (!(next = iter.next()).done) list.push(next.value); + return list; + } + module.exports = _arrayFromIterator; +})); +//#endregion +//#region ../../node_modules/.pnpm/@pnpm+ramda@0.28.1/node_modules/@pnpm/ramda/src/internal/_includesWith.js +var require__includesWith = /* @__PURE__ */ __commonJSMin(((exports, module) => { + function _includesWith(pred, x, list) { + var idx = 0; + var len = list.length; + while (idx < len) { + if (pred(x, list[idx])) return true; + idx += 1; + } + return false; + } + module.exports = _includesWith; +})); +//#endregion +//#region ../../node_modules/.pnpm/@pnpm+ramda@0.28.1/node_modules/@pnpm/ramda/src/internal/_functionName.js +var require__functionName = /* @__PURE__ */ __commonJSMin(((exports, module) => { + function _functionName(f) { + var match = String(f).match(/^function (\w*)/); + return match == null ? "" : match[1]; + } + module.exports = _functionName; +})); +//#endregion +//#region ../../node_modules/.pnpm/@pnpm+ramda@0.28.1/node_modules/@pnpm/ramda/src/internal/_has.js +var require__has = /* @__PURE__ */ __commonJSMin(((exports, module) => { + function _has(prop, obj) { + return Object.prototype.hasOwnProperty.call(obj, prop); + } + module.exports = _has; +})); +//#endregion +//#region ../../node_modules/.pnpm/@pnpm+ramda@0.28.1/node_modules/@pnpm/ramda/src/internal/_objectIs.js +var require__objectIs = /* @__PURE__ */ __commonJSMin(((exports, module) => { + function _objectIs(a, b) { + if (a === b) return a !== 0 || 1 / a === 1 / b; + else return a !== a && b !== b; + } + module.exports = typeof Object.is === "function" ? Object.is : _objectIs; +})); +//#endregion +//#region ../../node_modules/.pnpm/@pnpm+ramda@0.28.1/node_modules/@pnpm/ramda/src/internal/_isArguments.js +var require__isArguments = /* @__PURE__ */ __commonJSMin(((exports, module) => { + var _has = require__has(); + var toString = Object.prototype.toString; + module.exports = /* @__PURE__ */ function() { + return toString.call(arguments) === "[object Arguments]" ? function _isArguments(x) { + return toString.call(x) === "[object Arguments]"; + } : function _isArguments(x) { + return _has("callee", x); + }; + }(); +})); +//#endregion +//#region ../../node_modules/.pnpm/@pnpm+ramda@0.28.1/node_modules/@pnpm/ramda/src/keys.js +var require_keys = /* @__PURE__ */ __commonJSMin(((exports, module) => { + var _curry1 = require__curry1(); + var _has = require__has(); + var _isArguments = require__isArguments(); + var hasEnumBug = !/* @__PURE__ */ { toString: null }.propertyIsEnumerable("toString"); + var nonEnumerableProps = [ + "constructor", + "valueOf", + "isPrototypeOf", + "toString", + "propertyIsEnumerable", + "hasOwnProperty", + "toLocaleString" + ]; + var hasArgsEnumBug = /* @__PURE__ */ function() { + "use strict"; + return arguments.propertyIsEnumerable("length"); + }(); + var contains = function contains(list, item) { + var idx = 0; + while (idx < list.length) { + if (list[idx] === item) return true; + idx += 1; + } + return false; + }; + module.exports = typeof Object.keys === "function" && !hasArgsEnumBug ? /* @__PURE__ */ _curry1(function keys(obj) { + return Object(obj) !== obj ? [] : Object.keys(obj); + }) : /* @__PURE__ */ _curry1(function keys(obj) { + if (Object(obj) !== obj) return []; + var prop, nIdx; + var ks = []; + var checkArgsLength = hasArgsEnumBug && _isArguments(obj); + for (prop in obj) if (_has(prop, obj) && (!checkArgsLength || prop !== "length")) ks[ks.length] = prop; + if (hasEnumBug) { + nIdx = nonEnumerableProps.length - 1; + while (nIdx >= 0) { + prop = nonEnumerableProps[nIdx]; + if (_has(prop, obj) && !contains(ks, prop)) ks[ks.length] = prop; + nIdx -= 1; + } + } + return ks; + }); +})); +//#endregion +//#region ../../node_modules/.pnpm/@pnpm+ramda@0.28.1/node_modules/@pnpm/ramda/src/type.js +var require_type = /* @__PURE__ */ __commonJSMin(((exports, module) => { + module.exports = /* @__PURE__ */ require__curry1()(function type(val) { + return val === null ? "Null" : val === void 0 ? "Undefined" : Object.prototype.toString.call(val).slice(8, -1); + }); +})); +//#endregion +//#region ../../node_modules/.pnpm/@pnpm+ramda@0.28.1/node_modules/@pnpm/ramda/src/internal/_equals.js +var require__equals = /* @__PURE__ */ __commonJSMin(((exports, module) => { + var _arrayFromIterator = require__arrayFromIterator(); + var _includesWith = require__includesWith(); + var _functionName = require__functionName(); + var _has = require__has(); + var _objectIs = require__objectIs(); + var keys = require_keys(); + var type = require_type(); + /** + * private _uniqContentEquals function. + * That function is checking equality of 2 iterator contents with 2 assumptions + * - iterators lengths are the same + * - iterators values are unique + * + * false-positive result will be returned for comparison of, e.g. + * - [1,2,3] and [1,2,3,4] + * - [1,1,1] and [1,2,3] + * */ + function _uniqContentEquals(aIterator, bIterator, stackA, stackB) { + var a = _arrayFromIterator(aIterator); + var b = _arrayFromIterator(bIterator); + function eq(_a, _b) { + return _equals(_a, _b, stackA.slice(), stackB.slice()); + } + return !_includesWith(function(b, aItem) { + return !_includesWith(eq, aItem, b); + }, b, a); + } + function _equals(a, b, stackA, stackB) { + if (_objectIs(a, b)) return true; + var typeA = type(a); + if (typeA !== type(b)) return false; + if (typeof a["fantasy-land/equals"] === "function" || typeof b["fantasy-land/equals"] === "function") return typeof a["fantasy-land/equals"] === "function" && a["fantasy-land/equals"](b) && typeof b["fantasy-land/equals"] === "function" && b["fantasy-land/equals"](a); + if (typeof a.equals === "function" || typeof b.equals === "function") return typeof a.equals === "function" && a.equals(b) && typeof b.equals === "function" && b.equals(a); + switch (typeA) { + case "Arguments": + case "Array": + case "Object": + if (typeof a.constructor === "function" && _functionName(a.constructor) === "Promise") return a === b; + break; + case "Boolean": + case "Number": + case "String": + if (!(typeof a === typeof b && _objectIs(a.valueOf(), b.valueOf()))) return false; + break; + case "Date": + if (!_objectIs(a.valueOf(), b.valueOf())) return false; + break; + case "Error": return a.name === b.name && a.message === b.message; + case "RegExp": + if (!(a.source === b.source && a.global === b.global && a.ignoreCase === b.ignoreCase && a.multiline === b.multiline && a.sticky === b.sticky && a.unicode === b.unicode)) return false; + break; + } + var idx = stackA.length - 1; + while (idx >= 0) { + if (stackA[idx] === a) return stackB[idx] === b; + idx -= 1; + } + switch (typeA) { + case "Map": + if (a.size !== b.size) return false; + return _uniqContentEquals(a.entries(), b.entries(), stackA.concat([a]), stackB.concat([b])); + case "Set": + if (a.size !== b.size) return false; + return _uniqContentEquals(a.values(), b.values(), stackA.concat([a]), stackB.concat([b])); + case "Arguments": + case "Array": + case "Object": + case "Boolean": + case "Number": + case "String": + case "Date": + case "Error": + case "RegExp": + case "Int8Array": + case "Uint8Array": + case "Uint8ClampedArray": + case "Int16Array": + case "Uint16Array": + case "Int32Array": + case "Uint32Array": + case "Float32Array": + case "Float64Array": + case "ArrayBuffer": break; + default: return false; + } + var keysA = keys(a); + if (keysA.length !== keys(b).length) return false; + var extendedStackA = stackA.concat([a]); + var extendedStackB = stackB.concat([b]); + idx = keysA.length - 1; + while (idx >= 0) { + var key = keysA[idx]; + if (!(_has(key, b) && _equals(b[key], a[key], extendedStackA, extendedStackB))) return false; + idx -= 1; + } + return true; + } + module.exports = _equals; +})); +//#endregion +//#region ../../node_modules/.pnpm/@pnpm+ramda@0.28.1/node_modules/@pnpm/ramda/src/equals.js +var require_equals = /* @__PURE__ */ __commonJSMin(((exports, module) => { + var _curry2 = require__curry2(); + var _equals = require__equals(); + module.exports = /* @__PURE__ */ _curry2(function equals(a, b) { + return _equals(a, b, [], []); + }); +})); +//#endregion +//#region ../../node_modules/.pnpm/tsdown@0.21.9_@typescript+native-preview@7.0.0-dev.20260419.1_synckit@0.11.12_typescript@5.9.3/node_modules/tsdown/esm-shims.js +var getFilename, __filename; +var init_esm_shims = __esmMin((() => { + getFilename = () => fileURLToPath(import.meta.url); + __filename = /* @__PURE__ */ getFilename(); +})); +//#endregion +//#region ../../node_modules/.pnpm/imurmurhash@0.1.4/node_modules/imurmurhash/imurmurhash.js +var require_imurmurhash = /* @__PURE__ */ __commonJSMin(((exports, module) => { + /** + * @preserve + * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013) + * + * @author Jens Taylor + * @see http://github.com/homebrewing/brauhaus-diff + * @author Gary Court + * @see http://github.com/garycourt/murmurhash-js + * @author Austin Appleby + * @see http://sites.google.com/site/murmurhash/ + */ + (function() { + var cache; + function MurmurHash3(key, seed) { + var m = this instanceof MurmurHash3 ? this : cache; + m.reset(seed); + if (typeof key === "string" && key.length > 0) m.hash(key); + if (m !== this) return m; + } + MurmurHash3.prototype.hash = function(key) { + var h1, k1, i, top, len = key.length; + this.len += len; + k1 = this.k1; + i = 0; + switch (this.rem) { + case 0: k1 ^= len > i ? key.charCodeAt(i++) & 65535 : 0; + case 1: k1 ^= len > i ? (key.charCodeAt(i++) & 65535) << 8 : 0; + case 2: k1 ^= len > i ? (key.charCodeAt(i++) & 65535) << 16 : 0; + case 3: + k1 ^= len > i ? (key.charCodeAt(i) & 255) << 24 : 0; + k1 ^= len > i ? (key.charCodeAt(i++) & 65280) >> 8 : 0; + } + this.rem = len + this.rem & 3; + len -= this.rem; + if (len > 0) { + h1 = this.h1; + while (1) { + k1 = k1 * 11601 + (k1 & 65535) * 3432906752 & 4294967295; + k1 = k1 << 15 | k1 >>> 17; + k1 = k1 * 13715 + (k1 & 65535) * 461832192 & 4294967295; + h1 ^= k1; + h1 = h1 << 13 | h1 >>> 19; + h1 = h1 * 5 + 3864292196 & 4294967295; + if (i >= len) break; + k1 = key.charCodeAt(i++) & 65535 ^ (key.charCodeAt(i++) & 65535) << 8 ^ (key.charCodeAt(i++) & 65535) << 16; + top = key.charCodeAt(i++); + k1 ^= (top & 255) << 24 ^ (top & 65280) >> 8; + } + k1 = 0; + switch (this.rem) { + case 3: k1 ^= (key.charCodeAt(i + 2) & 65535) << 16; + case 2: k1 ^= (key.charCodeAt(i + 1) & 65535) << 8; + case 1: k1 ^= key.charCodeAt(i) & 65535; + } + this.h1 = h1; + } + this.k1 = k1; + return this; + }; + MurmurHash3.prototype.result = function() { + var k1 = this.k1, h1 = this.h1; + if (k1 > 0) { + k1 = k1 * 11601 + (k1 & 65535) * 3432906752 & 4294967295; + k1 = k1 << 15 | k1 >>> 17; + k1 = k1 * 13715 + (k1 & 65535) * 461832192 & 4294967295; + h1 ^= k1; + } + h1 ^= this.len; + h1 ^= h1 >>> 16; + h1 = h1 * 51819 + (h1 & 65535) * 2246770688 & 4294967295; + h1 ^= h1 >>> 13; + h1 = h1 * 44597 + (h1 & 65535) * 3266445312 & 4294967295; + h1 ^= h1 >>> 16; + return h1 >>> 0; + }; + MurmurHash3.prototype.reset = function(seed) { + this.h1 = typeof seed === "number" ? seed : 0; + this.rem = this.k1 = this.len = 0; + return this; + }; + cache = new MurmurHash3(); + if (typeof module != "undefined") module.exports = MurmurHash3; + else this.MurmurHash3 = MurmurHash3; + })(); +})); +//#endregion +//#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/cjs/signals.js +var require_signals = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.signals = void 0; + /** + * This is not the set of all possible signals. + * + * It IS, however, the set of all signals that trigger + * an exit on either Linux or BSD systems. Linux is a + * superset of the signal names supported on BSD, and + * the unknown signals just fail to register, so we can + * catch that easily enough. + * + * Windows signals are a different set, since there are + * signals that terminate Windows processes, but don't + * terminate (or don't even exist) on Posix systems. + * + * Don't bother with SIGKILL. It's uncatchable, which + * means that we can't fire any callbacks anyway. + * + * If a user does happen to register a handler on a non- + * fatal signal like SIGWINCH or something, and then + * exit, it'll end up firing `process.emit('exit')`, so + * the handler will be fired anyway. + * + * SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised + * artificially, inherently leave the process in a + * state from which it is not safe to try and enter JS + * listeners. + */ + exports.signals = []; + exports.signals.push("SIGHUP", "SIGINT", "SIGTERM"); + if (process.platform !== "win32") exports.signals.push("SIGALRM", "SIGABRT", "SIGVTALRM", "SIGXCPU", "SIGXFSZ", "SIGUSR2", "SIGTRAP", "SIGSYS", "SIGQUIT", "SIGIOT"); + if (process.platform === "linux") exports.signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT"); +})); +//#endregion +//#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/cjs/index.js +var require_cjs = /* @__PURE__ */ __commonJSMin(((exports) => { + var _a; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.unload = exports.load = exports.onExit = exports.signals = void 0; + const signals_js_1 = require_signals(); + Object.defineProperty(exports, "signals", { + enumerable: true, + get: function() { + return signals_js_1.signals; + } + }); + const processOk = (process) => !!process && typeof process === "object" && typeof process.removeListener === "function" && typeof process.emit === "function" && typeof process.reallyExit === "function" && typeof process.listeners === "function" && typeof process.kill === "function" && typeof process.pid === "number" && typeof process.on === "function"; + const kExitEmitter = Symbol.for("signal-exit emitter"); + const global = globalThis; + const ObjectDefineProperty = Object.defineProperty.bind(Object); + var Emitter = class { + emitted = { + afterExit: false, + exit: false + }; + listeners = { + afterExit: [], + exit: [] + }; + count = 0; + id = Math.random(); + constructor() { + if (global[kExitEmitter]) return global[kExitEmitter]; + ObjectDefineProperty(global, kExitEmitter, { + value: this, + writable: false, + enumerable: false, + configurable: false + }); + } + on(ev, fn) { + this.listeners[ev].push(fn); + } + removeListener(ev, fn) { + const list = this.listeners[ev]; + const i = list.indexOf(fn); + /* c8 ignore start */ + if (i === -1) return; + /* c8 ignore stop */ + if (i === 0 && list.length === 1) list.length = 0; + else list.splice(i, 1); + } + emit(ev, code, signal) { + if (this.emitted[ev]) return false; + this.emitted[ev] = true; + let ret = false; + for (const fn of this.listeners[ev]) ret = fn(code, signal) === true || ret; + if (ev === "exit") ret = this.emit("afterExit", code, signal) || ret; + return ret; + } + }; + var SignalExitBase = class {}; + const signalExitWrap = (handler) => { + return { + onExit(cb, opts) { + return handler.onExit(cb, opts); + }, + load() { + return handler.load(); + }, + unload() { + return handler.unload(); + } + }; + }; + var SignalExitFallback = class extends SignalExitBase { + onExit() { + return () => {}; + } + load() {} + unload() {} + }; + var SignalExit = class extends SignalExitBase { + /* c8 ignore start */ + #hupSig = process.platform === "win32" ? "SIGINT" : "SIGHUP"; + /* c8 ignore stop */ + #emitter = new Emitter(); + #process; + #originalProcessEmit; + #originalProcessReallyExit; + #sigListeners = {}; + #loaded = false; + constructor(process) { + super(); + this.#process = process; + this.#sigListeners = {}; + for (const sig of signals_js_1.signals) this.#sigListeners[sig] = () => { + const listeners = this.#process.listeners(sig); + let { count } = this.#emitter; + /* c8 ignore start */ + const p = process; + if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") count += p.__signal_exit_emitter__.count; + /* c8 ignore stop */ + if (listeners.length === count) { + this.unload(); + const ret = this.#emitter.emit("exit", null, sig); + /* c8 ignore start */ + const s = sig === "SIGHUP" ? this.#hupSig : sig; + if (!ret) process.kill(process.pid, s); + } + }; + this.#originalProcessReallyExit = process.reallyExit; + this.#originalProcessEmit = process.emit; + } + onExit(cb, opts) { + /* c8 ignore start */ + if (!processOk(this.#process)) return () => {}; + /* c8 ignore stop */ + if (this.#loaded === false) this.load(); + const ev = opts?.alwaysLast ? "afterExit" : "exit"; + this.#emitter.on(ev, cb); + return () => { + this.#emitter.removeListener(ev, cb); + if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) this.unload(); + }; + } + load() { + if (this.#loaded) return; + this.#loaded = true; + this.#emitter.count += 1; + for (const sig of signals_js_1.signals) try { + const fn = this.#sigListeners[sig]; + if (fn) this.#process.on(sig, fn); + } catch (_) {} + this.#process.emit = (ev, ...a) => { + return this.#processEmit(ev, ...a); + }; + this.#process.reallyExit = (code) => { + return this.#processReallyExit(code); + }; + } + unload() { + if (!this.#loaded) return; + this.#loaded = false; + signals_js_1.signals.forEach((sig) => { + const listener = this.#sigListeners[sig]; + /* c8 ignore start */ + if (!listener) throw new Error("Listener not defined for signal: " + sig); + /* c8 ignore stop */ + try { + this.#process.removeListener(sig, listener); + } catch (_) {} + /* c8 ignore stop */ + }); + this.#process.emit = this.#originalProcessEmit; + this.#process.reallyExit = this.#originalProcessReallyExit; + this.#emitter.count -= 1; + } + #processReallyExit(code) { + /* c8 ignore start */ + if (!processOk(this.#process)) return 0; + this.#process.exitCode = code || 0; + /* c8 ignore stop */ + this.#emitter.emit("exit", this.#process.exitCode, null); + return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode); + } + #processEmit(ev, ...args) { + const og = this.#originalProcessEmit; + if (ev === "exit" && processOk(this.#process)) { + if (typeof args[0] === "number") this.#process.exitCode = args[0]; + /* c8 ignore start */ + const ret = og.call(this.#process, ev, ...args); + /* c8 ignore start */ + this.#emitter.emit("exit", this.#process.exitCode, null); + /* c8 ignore stop */ + return ret; + } else return og.call(this.#process, ev, ...args); + } + }; + const process = globalThis.process; + _a = signalExitWrap(processOk(process) ? new SignalExit(process) : new SignalExitFallback()), exports.onExit = _a.onExit, exports.load = _a.load, exports.unload = _a.unload; +})); +//#endregion +//#region ../../node_modules/.pnpm/write-file-atomic@5.0.1/node_modules/write-file-atomic/lib/index.js +var require_lib$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + init_esm_shims(); + module.exports = writeFile; + module.exports.sync = writeFileSync; + module.exports._getTmpname = getTmpname; + module.exports._cleanupOnExit = cleanupOnExit; + const fs$1 = __require("fs"); + const MurmurHash3 = require_imurmurhash(); + const { onExit } = require_cjs(); + const path$1 = __require("path"); + const { promisify } = __require("util"); + const activeFiles = {}; + /* istanbul ignore next */ + const threadId = (function getId() { + try { + return __require("worker_threads").threadId; + } catch (e) { + return 0; + } + })(); + let invocations = 0; + function getTmpname(filename) { + return filename + "." + MurmurHash3(__filename).hash(String(process.pid)).hash(String(threadId)).hash(String(++invocations)).result(); + } + function cleanupOnExit(tmpfile) { + return () => { + try { + fs$1.unlinkSync(typeof tmpfile === "function" ? tmpfile() : tmpfile); + } catch {} + }; + } + function serializeActiveFile(absoluteName) { + return new Promise((resolve) => { + if (!activeFiles[absoluteName]) activeFiles[absoluteName] = []; + activeFiles[absoluteName].push(resolve); + if (activeFiles[absoluteName].length === 1) resolve(); + }); + } + function isChownErrOk(err) { + if (err.code === "ENOSYS") return true; + if (!process.getuid || process.getuid() !== 0) { + if (err.code === "EINVAL" || err.code === "EPERM") return true; + } + return false; + } + async function writeFileAsync(filename, data, options = {}) { + if (typeof options === "string") options = { encoding: options }; + let fd; + let tmpfile; + /* istanbul ignore next -- The closure only gets called when onExit triggers */ + const removeOnExitHandler = onExit(cleanupOnExit(() => tmpfile)); + const absoluteName = path$1.resolve(filename); + try { + await serializeActiveFile(absoluteName); + const truename = await promisify(fs$1.realpath)(filename).catch(() => filename); + tmpfile = getTmpname(truename); + if (!options.mode || !options.chown) { + const stats = await promisify(fs$1.stat)(truename).catch(() => {}); + if (stats) { + if (options.mode == null) options.mode = stats.mode; + if (options.chown == null && process.getuid) options.chown = { + uid: stats.uid, + gid: stats.gid + }; + } + } + fd = await promisify(fs$1.open)(tmpfile, "w", options.mode); + if (options.tmpfileCreated) await options.tmpfileCreated(tmpfile); + if (ArrayBuffer.isView(data)) await promisify(fs$1.write)(fd, data, 0, data.length, 0); + else if (data != null) await promisify(fs$1.write)(fd, String(data), 0, String(options.encoding || "utf8")); + if (options.fsync !== false) await promisify(fs$1.fsync)(fd); + await promisify(fs$1.close)(fd); + fd = null; + if (options.chown) await promisify(fs$1.chown)(tmpfile, options.chown.uid, options.chown.gid).catch((err) => { + if (!isChownErrOk(err)) throw err; + }); + if (options.mode) await promisify(fs$1.chmod)(tmpfile, options.mode).catch((err) => { + if (!isChownErrOk(err)) throw err; + }); + await promisify(fs$1.rename)(tmpfile, truename); + } finally { + if (fd) await promisify(fs$1.close)(fd).catch( + /* istanbul ignore next */ + () => {} + ); + removeOnExitHandler(); + await promisify(fs$1.unlink)(tmpfile).catch(() => {}); + activeFiles[absoluteName].shift(); + if (activeFiles[absoluteName].length > 0) activeFiles[absoluteName][0](); + else delete activeFiles[absoluteName]; + } + } + async function writeFile(filename, data, options, callback) { + if (options instanceof Function) { + callback = options; + options = {}; + } + const promise = writeFileAsync(filename, data, options); + if (callback) try { + const result = await promise; + return callback(result); + } catch (err) { + return callback(err); + } + return promise; + } + function writeFileSync(filename, data, options) { + if (typeof options === "string") options = { encoding: options }; + else if (!options) options = {}; + try { + filename = fs$1.realpathSync(filename); + } catch (ex) {} + const tmpfile = getTmpname(filename); + if (!options.mode || !options.chown) try { + const stats = fs$1.statSync(filename); + options = Object.assign({}, options); + if (!options.mode) options.mode = stats.mode; + if (!options.chown && process.getuid) options.chown = { + uid: stats.uid, + gid: stats.gid + }; + } catch (ex) {} + let fd; + const cleanup = cleanupOnExit(tmpfile); + const removeOnExitHandler = onExit(cleanup); + let threw = true; + try { + fd = fs$1.openSync(tmpfile, "w", options.mode || 438); + if (options.tmpfileCreated) options.tmpfileCreated(tmpfile); + if (ArrayBuffer.isView(data)) fs$1.writeSync(fd, data, 0, data.length, 0); + else if (data != null) fs$1.writeSync(fd, String(data), 0, String(options.encoding || "utf8")); + if (options.fsync !== false) fs$1.fsyncSync(fd); + fs$1.closeSync(fd); + fd = null; + if (options.chown) try { + fs$1.chownSync(tmpfile, options.chown.uid, options.chown.gid); + } catch (err) { + if (!isChownErrOk(err)) throw err; + } + if (options.mode) try { + fs$1.chmodSync(tmpfile, options.mode); + } catch (err) { + if (!isChownErrOk(err)) throw err; + } + fs$1.renameSync(tmpfile, filename); + threw = false; + } finally { + if (fd) try { + fs$1.closeSync(fd); + } catch (ex) {} + removeOnExitHandler(); + if (threw) cleanup(); + } + } +})); +//#endregion +//#region ../../node_modules/.pnpm/@pnpm+util.lex-comparator@3.0.2/node_modules/@pnpm/util.lex-comparator/dist/lex-comparator.js +var require_lex_comparator = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.lexCompare = void 0; + function lexCompare(a, b) { + return a > b ? 1 : a < b ? -1 : 0; + } + exports.lexCompare = lexCompare; +})); +//#endregion +//#region ../../node_modules/.pnpm/@pnpm+util.lex-comparator@3.0.2/node_modules/@pnpm/util.lex-comparator/dist/index.js +var require_dist = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.lexCompare = void 0; + var lex_comparator_1 = require_lex_comparator(); + Object.defineProperty(exports, "lexCompare", { + enumerable: true, + get: function() { + return lex_comparator_1.lexCompare; + } + }); +})); +//#endregion +//#region ../../node_modules/.pnpm/is-plain-obj@2.1.0/node_modules/is-plain-obj/index.js +var require_is_plain_obj = /* @__PURE__ */ __commonJSMin(((exports, module) => { + module.exports = (value) => { + if (Object.prototype.toString.call(value) !== "[object Object]") return false; + const prototype = Object.getPrototypeOf(value); + return prototype === null || prototype === Object.prototype; + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/sort-keys@4.2.0/node_modules/sort-keys/index.js +var require_sort_keys = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const isPlainObject = require_is_plain_obj(); + module.exports = (object, options = {}) => { + if (!isPlainObject(object) && !Array.isArray(object)) throw new TypeError("Expected a plain object or array"); + const { deep } = options; + const seenInput = []; + const seenOutput = []; + const deepSortArray = (array) => { + const seenIndex = seenInput.indexOf(array); + if (seenIndex !== -1) return seenOutput[seenIndex]; + const result = []; + seenInput.push(array); + seenOutput.push(result); + result.push(...array.map((item) => { + if (Array.isArray(item)) return deepSortArray(item); + if (isPlainObject(item)) return sortKeys(item); + return item; + })); + return result; + }; + const sortKeys = (object) => { + const seenIndex = seenInput.indexOf(object); + if (seenIndex !== -1) return seenOutput[seenIndex]; + const result = {}; + const keys = Object.keys(object).sort(options.compare); + seenInput.push(object); + seenOutput.push(result); + for (const key of keys) { + const value = object[key]; + let newValue; + if (deep && Array.isArray(value)) newValue = deepSortArray(value); + else newValue = deep && isPlainObject(value) ? sortKeys(value) : value; + Object.defineProperty(result, key, { + ...Object.getOwnPropertyDescriptor(object, key), + value: newValue + }); + } + return result; + }; + if (Array.isArray(object)) return deep ? deepSortArray(object) : object.slice(); + return sortKeys(object); + }; +})); +//#endregion +//#region ../../node_modules/.pnpm/@pnpm+object.key-sorting@1000.0.1/node_modules/@pnpm/object.key-sorting/lib/index.js +var require_lib$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + var __importDefault = exports && exports.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.sortDirectKeys = sortDirectKeys; + exports.sortDeepKeys = sortDeepKeys; + exports.sortKeysByPriority = sortKeysByPriority; + const util_lex_comparator_1 = require_dist(); + const sort_keys_1 = __importDefault(require_sort_keys()); + function sortDirectKeys(obj) { + return (0, sort_keys_1.default)(obj, { + compare: util_lex_comparator_1.lexCompare, + deep: false + }); + } + function sortDeepKeys(obj) { + return (0, sort_keys_1.default)(obj, { + compare: util_lex_comparator_1.lexCompare, + deep: true + }); + } + function sortKeysByPriority(opts, obj) { + const compare = compareWithPriority.bind(null, opts.priority); + return (0, sort_keys_1.default)(obj, { + compare, + deep: opts.deep + }); + } + function compareWithPriority(priority, left, right) { + const leftPriority = priority[left]; + const rightPriority = priority[right]; + if (leftPriority != null && rightPriority != null) return leftPriority - rightPriority; + if (leftPriority != null) return -1; + if (rightPriority != null) return 1; + return (0, util_lex_comparator_1.lexCompare)(left, right); + } +})); +//#endregion +//#region ../../node_modules/.pnpm/@pnpm+workspace.manifest-writer@1001.3.1/node_modules/@pnpm/workspace.manifest-writer/lib/index.js +var require_lib = /* @__PURE__ */ __commonJSMin(((exports) => { + var __importDefault = exports && exports.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.updateWorkspaceManifest = updateWorkspaceManifest; + const fs_1 = __importDefault(__require("fs")); + const path_1 = __importDefault(__require("path")); + const util_1 = __importDefault(__require("util")); + const workspace_read_manifest_1 = require_lib$4(); + const constants_1 = require_lib$6(); + const yaml_document_sync_1 = require_lib$3(); + const equals_1 = __importDefault(require_equals()); + const yaml_1 = __importDefault(require_dist$1()); + const write_file_atomic_1 = __importDefault(require_lib$2()); + const object_key_sorting_1 = require_lib$1(); + async function writeManifestFile(dir, manifest) { + const manifestStr = manifest.toString({ + lineWidth: 0, + singleQuote: true + }); + await fs_1.default.promises.mkdir(dir, { recursive: true }); + await (0, write_file_atomic_1.default)(path_1.default.join(dir, constants_1.WORKSPACE_MANIFEST_FILENAME), manifestStr); + } + async function readManifestRaw(file) { + try { + return (await fs_1.default.promises.readFile(file)).toString(); + } catch (err) { + if (util_1.default.types.isNativeError(err) && "code" in err && err.code === "ENOENT") return; + throw err; + } + } + async function updateWorkspaceManifest(dir, opts) { + const workspaceManifestStr = await readManifestRaw(path_1.default.join(dir, constants_1.WORKSPACE_MANIFEST_FILENAME)); + const document = workspaceManifestStr != null ? yaml_1.default.parseDocument(workspaceManifestStr) : new yaml_1.default.Document(); + let manifest = document.toJSON(); + (0, workspace_read_manifest_1.validateWorkspaceManifest)(manifest); + manifest ??= {}; + let shouldBeUpdated = opts.updatedCatalogs != null && addCatalogs(manifest, opts.updatedCatalogs); + if (opts.cleanupUnusedCatalogs) shouldBeUpdated = removePackagesFromWorkspaceCatalog(manifest, opts.allProjects ?? []) || shouldBeUpdated; + const updatedFields = { ...opts.updatedFields }; + if (manifest.allowBuilds != null || manifest.onlyBuiltDependencies == null && manifest.ignoredBuiltDependencies == null) { + const allowBuilds = { ...manifest.allowBuilds }; + if (updatedFields.onlyBuiltDependencies != null) for (const pattern of updatedFields.onlyBuiltDependencies) allowBuilds[pattern] = true; + if (updatedFields.ignoredBuiltDependencies != null) for (const pattern of updatedFields.ignoredBuiltDependencies) allowBuilds[pattern] = false; + if (manifest.allowBuilds != null || Object.keys(allowBuilds).length > 0) updatedFields.allowBuilds = allowBuilds; + delete updatedFields.onlyBuiltDependencies; + delete updatedFields.ignoredBuiltDependencies; + } + for (const [key, value] of Object.entries(updatedFields)) if (!(0, equals_1.default)(manifest[key], value)) { + shouldBeUpdated = true; + if (value == null) delete manifest[key]; + else manifest[key] = value; + } + if (opts.updatedOverrides) { + manifest.overrides ??= {}; + for (const [key, value] of Object.entries(opts.updatedOverrides)) if (!(0, equals_1.default)(manifest.overrides[key], value)) { + shouldBeUpdated = true; + manifest.overrides[key] = value; + } + } + if (!shouldBeUpdated) return; + if (Object.keys(manifest).length === 0) { + await fs_1.default.promises.rm(path_1.default.join(dir, constants_1.WORKSPACE_MANIFEST_FILENAME)); + return; + } + manifest = (0, object_key_sorting_1.sortKeysByPriority)({ + priority: { packages: 0 }, + deep: true + }, manifest); + (0, yaml_document_sync_1.patchDocument)(document, manifest); + await writeManifestFile(dir, document); + } + function addCatalogs(manifest, newCatalogs) { + let shouldBeUpdated = false; + for (const catalogName in newCatalogs) { + let targetCatalog = catalogName === "default" ? manifest.catalog ?? manifest.catalogs?.default : manifest.catalogs?.[catalogName]; + const targetCatalogWasNil = targetCatalog == null; + for (const [dependencyName, specifier] of Object.entries(newCatalogs[catalogName] ?? {})) { + if (specifier == null) continue; + targetCatalog ??= {}; + if (targetCatalog[dependencyName] !== specifier) { + targetCatalog[dependencyName] = specifier; + shouldBeUpdated = true; + } + } + if (targetCatalog == null) continue; + if (targetCatalogWasNil) if (catalogName === "default") manifest.catalog = targetCatalog; + else { + manifest.catalogs ??= {}; + manifest.catalogs[catalogName] = targetCatalog; + } + } + return shouldBeUpdated; + } + function removePackagesFromWorkspaceCatalog(manifest, packagesJson) { + let shouldBeUpdated = false; + if (packagesJson.length === 0 || manifest.catalog == null && manifest.catalogs == null) return shouldBeUpdated; + const packageReferences = {}; + for (const pkg of packagesJson) { + const pkgManifest = pkg.manifest; + const dependencyTypes = [ + pkgManifest.dependencies, + pkgManifest.devDependencies, + pkgManifest.optionalDependencies, + pkgManifest.peerDependencies + ]; + for (const deps of dependencyTypes) { + if (!deps) continue; + for (const [pkgName, version] of Object.entries(deps)) { + if (!packageReferences[pkgName]) packageReferences[pkgName] = /* @__PURE__ */ new Set(); + packageReferences[pkgName].add(version); + } + } + } + if (manifest.catalog) { + const packagesToRemove = Object.keys(manifest.catalog).filter((pkg) => !packageReferences[pkg]?.has("catalog:")); + for (const pkg of packagesToRemove) { + delete manifest.catalog[pkg]; + shouldBeUpdated = true; + } + if (Object.keys(manifest.catalog).length === 0) { + delete manifest.catalog; + shouldBeUpdated = true; + } + } + if (manifest.catalogs) { + const catalogsToRemove = []; + for (const [catalogName, catalog] of Object.entries(manifest.catalogs)) { + if (!catalog) continue; + const packagesToRemove = Object.keys(catalog).filter((pkg) => { + const references = packageReferences[pkg]; + return !references?.has(`catalog:${catalogName}`) && !references?.has("catalog:"); + }); + for (const pkg of packagesToRemove) { + delete catalog[pkg]; + shouldBeUpdated = true; + } + if (Object.keys(catalog).length === 0) { + catalogsToRemove.push(catalogName); + shouldBeUpdated = true; + } + } + for (const catalogName of catalogsToRemove) delete manifest.catalogs[catalogName]; + if (Object.keys(manifest.catalogs).length === 0) { + delete manifest.catalogs; + shouldBeUpdated = true; + } + } + return shouldBeUpdated; + } +})); +//#endregion +//#region ../utils/constants.ts +var import_lib$1 = require_lib$4(); +var import_lib = require_lib(); +const GIT_CONFIG = { + USER_NAME: "tdesign-bot", + USER_EMAIL: "tdesign@tencent.com" +}; +//#endregion +//#region ../utils/git-helper.ts +var GitHelper = class { + token; + owner; + repo; + repoPath; + dryRun; + constructor(context) { + this.token = context.token; + this.owner = context.owner; + this.repo = context.repo; + this.dryRun = context.dryRun; + this.repoPath = context.repoPath ?? `./${context.repo}`; + } + isDryRun() { + return this.dryRun; + } + logDryRunInfo(action, details) { + if (this.isDryRun()) info(`[DRY-RUN] ${details ? `${action}: ${JSON.stringify(details)}` : action}`); + } + async initConfig() { + await exec("git", [ + "config", + "--global", + "user.name", + GIT_CONFIG.USER_NAME + ]); + await exec("git", [ + "config", + "--global", + "user.email", + GIT_CONFIG.USER_EMAIL + ]); + await exec("git", [ + "config", + "--global", + `url.https://${this.token}@github.com/.insteadOf`, + "https://github.com/" + ]); + } + async getConflictFiles() { + const { stdout } = await getExecOutput("git", [ + "diff", + "--name-only", + "--diff-filter=U" + ], { cwd: this.repoPath }); + return stdout.split("\n").map((line) => line.trim()).filter(Boolean); + } + get repoUrl() { + return `https://github.com/${this.owner}/${this.repo}.git`; + } + async clone() { + await this.initConfig(); + info(this.repoUrl); + await exec("ls", ["-al"]); + await exec("git", [ + "clone", + this.repoUrl, + this.repoPath + ]); + await exec("ls", ["-al"]); + const { stdout } = await getExecOutput("git", [ + "rev-parse", + "--abbrev-ref", + "HEAD" + ], { cwd: this.repoPath }); + info(`当前分支: ${stdout.trim()}`); + return stdout.trim(); + } + async createBranch(branch) { + await exec("git", [ + "checkout", + "-b", + branch + ], { cwd: this.repoPath }); + } + async checkoutBranch(branch) { + await exec("git", ["checkout", branch], { cwd: this.repoPath }); + } + async checkoutPr(prNumber) { + await exec("git", [ + "fetch", + "origin", + `pull/${prNumber}/head:pr-${prNumber}` + ], { cwd: this.repoPath }); + await exec("git", ["checkout", `pr-${prNumber}`], { cwd: this.repoPath }); + } + async addRemote(name, url) { + await exec("git", [ + "remote", + "add", + name, + url + ], { cwd: this.repoPath }); + await exec("git", ["fetch", name], { cwd: this.repoPath }); + } + async setUpstream(remote, branch) { + await exec("git", [ + "branch", + "--set-upstream-to", + `${remote}/${branch}` + ], { cwd: this.repoPath }); + } + async commit(message) { + await exec("git", [ + "commit", + "-am", + message, + "--no-verify" + ], { cwd: this.repoPath }); + } + async push(branch, forkOwner) { + if (this.isDryRun()) { + this.logDryRunInfo("git push", { + branch, + forkOwner + }); + return; + } + if (forkOwner) await exec("git", [ + "push", + forkOwner, + `HEAD:${branch}` + ], { cwd: this.repoPath }); + else await exec("git", [ + "push", + "origin", + branch + ], { cwd: this.repoPath }); + } + async initSubmodule() { + await exec("git", [ + "submodule", + "update", + "--init", + "--recursive" + ], { cwd: this.repoPath }); + } + async updateSubmodule() { + await exec("git", [ + "submodule", + "update", + "--remote" + ], { cwd: this.repoPath }); + } + async isNeedCommit() { + const { stdout } = await getExecOutput("git", ["status", "--porcelain"], { cwd: this.repoPath }); + return stdout.trim() !== ""; + } + async printDiff() { + await exec("git", ["diff"], { cwd: this.repoPath }); + } +}; +//#endregion +//#region ../utils/github-helper.ts +var GithubHelper = class { + octokit; + context; + constructor(context) { + this.context = context; + this.octokit = getOctokit(context.token); + } + async dryRunLog(methodName, params) { + if (!this.context.dryRun) return false; + startGroup(`dry-run模式, 不运行${methodName}`); + for (const [key, value] of Object.entries(params)) info(`${key}: ${typeof value === "string" ? value : JSON.stringify(value)}`); + endGroup(); + return true; + } + get defaultRepoParams() { + return { + owner: this.context.owner, + repo: this.context.repo + }; + } + async getPrData(prNumber) { + try { + const { data } = await this.octokit.rest.pulls.get({ + ...this.defaultRepoParams, + pull_number: prNumber + }); + return data; + } catch (error$3) { + error(`获取PR数据失败: ${error$3}`); + throw error$3; + } + } + async getIssueData(issueNumber) { + try { + const { data } = await this.octokit.rest.issues.get({ + ...this.defaultRepoParams, + issue_number: issueNumber + }); + return data; + } catch (error$5) { + error(`获取Issue数据失败: ${error$5}`); + throw error$5; + } + } + async getIssueList(params) { + try { + const { data } = await this.octokit.rest.issues.listForRepo({ + ...params, + ...this.defaultRepoParams + }); + return data.filter((item) => !item?.pull_request); + } catch (error$4) { + error(`获取Issue列表失败: ${error$4}`); + throw error$4; + } + } + async closeIssue(issueNumber) { + if (await this.dryRunLog("closeIssue", { issueNumber })) return; + try { + await this.octokit.rest.issues.update({ + ...this.defaultRepoParams, + issue_number: issueNumber, + state: "closed" + }); + } catch (error$6) { + error(`关闭Issue失败: ${error$6}`); + throw error$6; + } + } + async createPR(title, head, body, base = "develop") { + if (await this.dryRunLog("createPR", { + title, + head, + base, + body + })) return; + try { + const { data } = await this.octokit.rest.pulls.create({ + ...this.defaultRepoParams, + title, + head, + base, + body + }); + return data; + } catch (error$1) { + error(`创建PR失败: ${error$1}`); + throw error$1; + } + } + async addComment(issueNumber, body) { + if (await this.dryRunLog("addComment", { + issueNumber, + body + })) return; + try { + const { data } = await this.octokit.rest.issues.createComment({ + ...this.defaultRepoParams, + issue_number: issueNumber, + body + }); + return data; + } catch (error$2) { + error(`添加评论失败: ${error$2}`); + throw error$2; + } + } + async addLabels(issueNumber, labels) { + if (await this.dryRunLog("addLabels", { + issueNumber, + labels: labels.join(", ") + })) return; + try { + const { data } = await this.octokit.rest.issues.addLabels({ + ...this.defaultRepoParams, + issue_number: issueNumber, + labels + }); + return data; + } catch (error$7) { + error(`添加标签失败: ${error$7}`); + throw error$7; + } + } +}; +//#endregion +//#region index.ts +const BRANCH_PATTERNS = { DEPS: (deps) => { + return `chore(deps): upgrade-${deps.map((d) => `${d.name}-${d.version}`).join("-")}`; +} }; +const PR_TITLES = { DEPS: (deps) => { + return `chore: upgrade ${deps.map((d) => `${d.name} to ${d.version}`).join(", ")}`; +} }; +const ERROR_MESSAGES = { MISSING_DEPS: "Missing deps input" }; +var ActionError = class extends Error { + constructor(message, context) { + super(message); + this.name = "ActionError"; + if (context) error(`${message} ${JSON.stringify(context)}`); + } +}; +async function updatePnpmCatalog(deps, repoPath) { + const workspaceFile = path.join(repoPath, "pnpm-workspace.yaml"); + let manifestContent; + try { + manifestContent = await fs.readFile(workspaceFile, "utf-8"); + } catch { + info(`pnpm-workspace.yaml not found in ${repoPath}, skipping catalog update`); + return; + } + const manifest = await (0, import_lib$1.readWorkspaceManifest)(manifestContent); + if (!manifest) { + info(`Failed to read pnpm-workspace.yaml, skipping catalog update`); + return; + } + const updatedCatalogs = {}; + if (manifest.catalog) { + updatedCatalogs[""] = {}; + for (const dep of deps) if (dep.name in manifest.catalog) { + const prefix = manifest.catalog[dep.name][0]; + if (prefix === "^" || prefix === "~") updatedCatalogs[""][dep.name] = `${prefix}${dep.version}`; + else updatedCatalogs[""][dep.name] = dep.version; + } + } + if (manifest.catalogs) for (const [catalogName, catalog] of Object.entries(manifest.catalogs)) { + updatedCatalogs[catalogName] = {}; + for (const dep of deps) if (dep.name in catalog) { + const prefix = catalog[dep.name][0]; + if (prefix === "^" || prefix === "~") updatedCatalogs[catalogName][dep.name] = `${prefix}${dep.version}`; + else updatedCatalogs[catalogName][dep.name] = dep.version; + } + } + if (!Object.values(updatedCatalogs).some((catalog) => Object.keys(catalog).length > 0)) { + info(`No matching dependencies found in catalog, skipping update`); + return; + } + await (0, import_lib.updateWorkspaceManifest)(workspaceFile, { updatedCatalogs }); + info(`Updated pnpm catalog in pnpm-workspace.yaml`); +} +async function getPkgLatestVersion(pkgNames) { + const results = []; + for (const pkg of pkgNames) { + const { stdout } = await getExecOutput("npm", [ + "view", + pkg, + "version" + ]); + results.push({ + name: pkg, + version: stdout.trim() + }); + } + return results; +} +async function corepackEnable() { + await exec("corepack", ["enable"]); +} +async function updatePackageDependencies(packageManager, deps, repo) { + const repoPath = `./${repo}`; + if (packageManager === "pnpm") await exec("pnpm", [ + "up", + ...deps, + "--latest" + ], { cwd: repoPath }); + else if (packageManager === "yarn") await exec("yarn", [ + "upgrade", + ...deps, + "--latest" + ], { cwd: repoPath }); + else await exec("npm", ["update", ...deps], { cwd: repoPath }); +} +async function createDepsPr(title, branchName, baseBranch, context) { + await new GithubHelper({ + owner: context.owner, + repo: context.repo, + token: context.token, + dryRun: context.dry_run + }).createPR(title, branchName, title, baseBranch); +} +async function updateDependencies(context) { + const packageManager = getInput("package-manager") || "npm"; + const deps = getMultilineInput("deps", { required: true }); + if (!deps || deps.length === 0) throw new ActionError(ERROR_MESSAGES.MISSING_DEPS, { trigger: context.trigger }); + const depInfos = await getPkgLatestVersion(deps); + if (packageManager !== "npm") await corepackEnable(); + const gitHelper = new GitHelper({ + repo: context.repo, + owner: context.owner, + token: context.token, + dryRun: context.dry_run + }); + const baseBranch = await gitHelper.clone(); + const branchName = BRANCH_PATTERNS.DEPS(depInfos); + await gitHelper.createBranch(branchName); + if (packageManager === "pnpm") await updatePnpmCatalog(depInfos, context.repo); + await updatePackageDependencies(packageManager, deps, context.repo); + if (!await gitHelper.isNeedCommit()) { + info("No changes to commit"); + return; + } + const title = PR_TITLES.DEPS(depInfos); + await gitHelper.commit(title); + await gitHelper.push(branchName); + await createDepsPr(title, branchName, baseBranch, context); +} +async function main() { + const repo = getInput("repo") || context.repo.repo; + const owner = getInput("owner") || context.repo.owner; + const token = getInput("token", { required: true }) || ""; + const dryRun = getBooleanInput("dry-run") || false; + const packageManager = getInput("package-manager") || "npm"; + const deps = getMultilineInput("deps", { required: true }); + startGroup("upgrade-deps"); + info(`repo: ${repo}`); + info(`owner: ${owner}`); + info(`packageManager: ${packageManager}`); + info(`deps: ${JSON.stringify(deps)}`); + endGroup(); + await updateDependencies({ + repo, + owner, + token, + dry_run: dryRun, + trigger: context.eventName + }); +} +main(); +//#endregion +export {}; diff --git a/packages/upgrade-deps/index.ts b/packages/upgrade-deps/index.ts new file mode 100644 index 0000000..cd55823 --- /dev/null +++ b/packages/upgrade-deps/index.ts @@ -0,0 +1,228 @@ +import * as fs from 'node:fs/promises' +import * as path from 'node:path' +import * as core from '@actions/core' +import * as exec from '@actions/exec' +import * as github from '@actions/github' +import { updateWorkspaceManifest } from '@pnpm/workspace.manifest-writer' +import { readWorkspaceManifest } from '@pnpm/workspace.read-manifest' +import { GitHelper, GithubHelper } from '@workflows/utils' + +const BRANCH_PATTERNS = { + DEPS: (deps: Array<{ name: string, version: string }>) => { + const depsSlug = deps.map(d => `${d.name}-${d.version}`).join('-') + return `chore(deps): upgrade-${depsSlug}` + }, +} + +const PR_TITLES = { + DEPS: (deps: Array<{ name: string, version: string }>) => { + const depList = deps.map(d => `${d.name} to ${d.version}`).join(', ') + return `chore: upgrade ${depList}` + }, +} + +const ERROR_MESSAGES = { + MISSING_DEPS: 'Missing deps input', +} + +class ActionError extends Error { + constructor(message: string, context?: Record) { + super(message) + this.name = 'ActionError' + if (context) { + core.error(`${message} ${JSON.stringify(context)}`) + } + } +} + +interface TriggerContext { + repo: string + owner: string + token: string + dry_run: boolean + trigger: string +} + +interface DependencyInfo { + name: string + version: string +} + +async function updatePnpmCatalog(deps: DependencyInfo[], repoPath: string): Promise { + const workspaceFile = path.join(repoPath, 'pnpm-workspace.yaml') + + let manifestContent: string + try { + manifestContent = await fs.readFile(workspaceFile, 'utf-8') + } + catch { + core.info(`pnpm-workspace.yaml not found in ${repoPath}, skipping catalog update`) + return + } + + const manifest = await readWorkspaceManifest(manifestContent) + if (!manifest) { + core.info(`Failed to read pnpm-workspace.yaml, skipping catalog update`) + return + } + + const updatedCatalogs: Record> = {} + + if (manifest.catalog) { + updatedCatalogs[''] = {} + for (const dep of deps) { + if (dep.name in manifest.catalog) { + const current = manifest.catalog[dep.name] as string + const prefix = current[0] + if (prefix === '^' || prefix === '~') { + updatedCatalogs[''][dep.name] = `${prefix}${dep.version}` + } + else { + updatedCatalogs[''][dep.name] = dep.version + } + } + } + } + + if (manifest.catalogs) { + for (const [catalogName, catalog] of Object.entries(manifest.catalogs)) { + updatedCatalogs[catalogName] = {} + for (const dep of deps) { + if (dep.name in (catalog as Record)) { + const current = (catalog as Record)[dep.name] + const prefix = current[0] + if (prefix === '^' || prefix === '~') { + updatedCatalogs[catalogName][dep.name] = `${prefix}${dep.version}` + } + else { + updatedCatalogs[catalogName][dep.name] = dep.version + } + } + } + } + } + + const hasUpdates = Object.values(updatedCatalogs).some(catalog => Object.keys(catalog).length > 0) + if (!hasUpdates) { + core.info(`No matching dependencies found in catalog, skipping update`) + return + } + + await updateWorkspaceManifest(workspaceFile, { + updatedCatalogs, + }) + core.info(`Updated pnpm catalog in pnpm-workspace.yaml`) +} + +async function getPkgLatestVersion(pkgNames: string[]): Promise { + const results: DependencyInfo[] = [] + for (const pkg of pkgNames) { + const { stdout } = await exec.getExecOutput('npm', ['view', pkg, 'version']) + results.push({ + name: pkg, + version: stdout.trim(), + }) + } + return results +} + +async function corepackEnable(): Promise { + await exec.exec('corepack', ['enable']) +} + +async function updatePackageDependencies(packageManager: string, deps: string[], repo: string): Promise { + const repoPath = `./${repo}` + if (packageManager === 'pnpm') { + await exec.exec('pnpm', ['up', ...deps, '--latest'], { cwd: repoPath }) + } + else if (packageManager === 'yarn') { + await exec.exec('yarn', ['upgrade', ...deps, '--latest'], { cwd: repoPath }) + } + else { + await exec.exec('npm', ['update', ...deps], { cwd: repoPath }) + } +} + +async function createDepsPr( + title: string, + branchName: string, + baseBranch: string, + context: TriggerContext, +): Promise { + const githubHelper = new GithubHelper({ + owner: context.owner, + repo: context.repo, + token: context.token, + dryRun: context.dry_run, + }) + await githubHelper.createPR(title, branchName, title, baseBranch) +} + +async function updateDependencies(context: TriggerContext): Promise { + const packageManager = core.getInput('package-manager') || 'npm' + const deps = core.getMultilineInput('deps', { required: true }) + + if (!deps || deps.length === 0) { + throw new ActionError(ERROR_MESSAGES.MISSING_DEPS, { trigger: context.trigger }) + } + + const depInfos = await getPkgLatestVersion(deps) + + if (packageManager !== 'npm') { + await corepackEnable() + } + + const gitHelper = new GitHelper({ + repo: context.repo, + owner: context.owner, + token: context.token, + dryRun: context.dry_run, + }) + + const baseBranch = await gitHelper.clone() + const branchName = BRANCH_PATTERNS.DEPS(depInfos) + await gitHelper.createBranch(branchName) + + if (packageManager === 'pnpm') { + await updatePnpmCatalog(depInfos, context.repo) + } + + await updatePackageDependencies(packageManager, deps, context.repo) + + if (!await gitHelper.isNeedCommit()) { + core.info('No changes to commit') + return + } + + const title = PR_TITLES.DEPS(depInfos) + await gitHelper.commit(title) + await gitHelper.push(branchName) + + await createDepsPr(title, branchName, baseBranch, context) +} + +async function main(): Promise { + const repo = core.getInput('repo') || github.context.repo.repo + const owner = core.getInput('owner') || github.context.repo.owner + const token = core.getInput('token', { required: true }) || '' + const dryRun = core.getBooleanInput('dry-run') || false + const packageManager = core.getInput('package-manager') || 'npm' + const deps = core.getMultilineInput('deps', { required: true }) + + core.startGroup('upgrade-deps') + core.info(`repo: ${repo}`) + core.info(`owner: ${owner}`) + core.info(`packageManager: ${packageManager}`) + core.info(`deps: ${JSON.stringify(deps)}`) + core.endGroup() + + await updateDependencies({ + repo, + owner, + token, + dry_run: dryRun, + trigger: github.context.eventName, + }) +} + +main() diff --git a/packages/upgrade-deps/package.json b/packages/upgrade-deps/package.json new file mode 100644 index 0000000..66ca301 --- /dev/null +++ b/packages/upgrade-deps/package.json @@ -0,0 +1,22 @@ +{ + "name": "upgrade-deps", + "type": "module", + "private": "true", + "main": "index.ts", + "scripts": { + "build": "tsdown" + }, + "dependencies": { + "@actions/core": "catalog:", + "@actions/exec": "catalog:", + "@actions/github": "catalog:", + "@pnpm/workspace.manifest-writer": "catalog:", + "@pnpm/workspace.read-manifest": "catalog:", + "@workflows/utils": "workspace:*" + }, + "devDependencies": { + "@octokit/plugin-rest-endpoint-methods": "catalog:", + "@types/node": "catalog:", + "tsdown": "catalog:" + } +} diff --git a/packages/upgrade-deps/tsdown.config.ts b/packages/upgrade-deps/tsdown.config.ts new file mode 100644 index 0000000..f328e14 --- /dev/null +++ b/packages/upgrade-deps/tsdown.config.ts @@ -0,0 +1,53 @@ +import { defineConfig } from 'tsdown' + +export default defineConfig({ + entry: ['index.ts'], + shims: true, + deps: { + alwaysBundle: [ + '@actions/core', + '@actions/exec', + '@actions/github', + '@workflows/utils', + '@pnpm/workspace.manifest-writer', + '@pnpm/workspace.read-manifest', + ], + onlyBundle: [ + '@actions/core', + '@actions/exec', + '@actions/github', + '@actions/http-client', + '@actions/io', + '@octokit/auth-token', + '@octokit/core', + '@octokit/endpoint', + '@octokit/graphql', + '@octokit/plugin-paginate-rest', + '@octokit/plugin-rest-endpoint-methods', + '@octokit/request', + '@octokit/request-error', + '@pnpm/constants', + '@pnpm/error', + '@pnpm/object.key-sorting', + '@pnpm/ramda', + '@pnpm/util.lex-comparator', + '@pnpm/workspace.manifest-writer', + '@pnpm/workspace.read-manifest', + '@pnpm/yaml.document-sync', + 'before-after-hook', + 'fast-content-type-parse', + 'imurmurhash', + 'is-plain-obj', + 'js-yaml', + 'read-yaml-file', + 'signal-exit', + 'sort-keys', + 'strip-bom', + 'tunnel', + 'undici', + 'universal-user-agent', + 'write-file-atomic', + 'yaml', + ], + }, +}) diff --git a/packages/utils/constants.ts b/packages/utils/constants.ts new file mode 100644 index 0000000..678dff0 --- /dev/null +++ b/packages/utils/constants.ts @@ -0,0 +1,5 @@ +// Git config +export const GIT_CONFIG = { + USER_NAME: 'tdesign-bot', + USER_EMAIL: 'tdesign@tencent.com', +} as const diff --git a/packages/utils/git-helper.ts b/packages/utils/git-helper.ts new file mode 100644 index 0000000..7d436e2 --- /dev/null +++ b/packages/utils/git-helper.ts @@ -0,0 +1,124 @@ +import { info } from '@actions/core' +import { exec, getExecOutput } from '@actions/exec' +import { GIT_CONFIG } from './constants' + +export interface GitContext { + owner: string + repo: string + token: string + dryRun: boolean + repoPath?: string +} + +export class GitHelper { + private readonly token: string + private readonly owner: string + private readonly repo: string + private readonly repoPath: string + private readonly dryRun: boolean + + constructor(context: GitContext) { + this.token = context.token + this.owner = context.owner + this.repo = context.repo + this.dryRun = context.dryRun + this.repoPath = context.repoPath ?? `./${context.repo}` + } + + private isDryRun(): boolean { + return this.dryRun + } + + private logDryRunInfo(action: string, details?: Record): void { + if (this.isDryRun()) { + const message = details ? `${action}: ${JSON.stringify(details)}` : action + info(`[DRY-RUN] ${message}`) + } + } + + private async initConfig(): Promise { + await exec('git', ['config', '--global', 'user.name', GIT_CONFIG.USER_NAME]) + await exec('git', ['config', '--global', 'user.email', GIT_CONFIG.USER_EMAIL]) + await exec('git', ['config', '--global', `url.https://${this.token}@github.com/.insteadOf`, 'https://github.com/']) + } + + async getConflictFiles(): Promise { + const { stdout } = await getExecOutput('git', ['diff', '--name-only', '--diff-filter=U'], { cwd: this.repoPath }) + const conflictFiles = stdout + .split('\n') + .map(line => line.trim()) + .filter(Boolean) + return conflictFiles + } + + private get repoUrl(): string { + return `https://github.com/${this.owner}/${this.repo}.git` + } + + async clone(): Promise { + await this.initConfig() + info(this.repoUrl) + await exec('ls', ['-al']) + await exec('git', ['clone', this.repoUrl, this.repoPath]) + await exec('ls', ['-al']) + const { stdout } = await getExecOutput('git', ['rev-parse', '--abbrev-ref', 'HEAD'], { cwd: this.repoPath }) + info(`当前分支: ${stdout.trim()}`) + return stdout.trim() + } + + async createBranch(branch: string): Promise { + await exec('git', ['checkout', '-b', branch], { cwd: this.repoPath }) + } + + async checkoutBranch(branch: string): Promise { + await exec('git', ['checkout', branch], { cwd: this.repoPath }) + } + + async checkoutPr(prNumber: number): Promise { + await exec('git', ['fetch', 'origin', `pull/${prNumber}/head:pr-${prNumber}`], { cwd: this.repoPath }) + await exec('git', ['checkout', `pr-${prNumber}`], { cwd: this.repoPath }) + } + + async addRemote(name: string, url: string): Promise { + await exec('git', ['remote', 'add', name, url], { cwd: this.repoPath }) + await exec('git', ['fetch', name], { cwd: this.repoPath }) + } + + async setUpstream(remote: string, branch: string): Promise { + await exec('git', ['branch', '--set-upstream-to', `${remote}/${branch}`], { cwd: this.repoPath }) + } + + async commit(message: string): Promise { + await exec('git', ['commit', '-am', message, '--no-verify'], { cwd: this.repoPath }) + } + + async push(branch: string, forkOwner?: string): Promise { + if (this.isDryRun()) { + this.logDryRunInfo('git push', { branch, forkOwner }) + return + } + if (forkOwner) { + await exec('git', ['push', forkOwner, `HEAD:${branch}`], { cwd: this.repoPath }) + } + else { + await exec('git', ['push', 'origin', branch], { cwd: this.repoPath }) + } + } + + async initSubmodule(): Promise { + await exec('git', ['submodule', 'update', '--init', '--recursive'], { cwd: this.repoPath }) + } + + async updateSubmodule(): Promise { + await exec('git', ['submodule', 'update', '--remote'], { cwd: this.repoPath }) + } + + async isNeedCommit(): Promise { + const { stdout } = await getExecOutput('git', ['status', '--porcelain'], { cwd: this.repoPath }) + return stdout.trim() !== '' + } + + async printDiff(): Promise { + await exec('git', ['diff'], { cwd: this.repoPath }) + } +} diff --git a/packages/utils/github-helper.ts b/packages/utils/github-helper.ts index 4b5fc01..a1f015e 100644 --- a/packages/utils/github-helper.ts +++ b/packages/utils/github-helper.ts @@ -1,4 +1,3 @@ -import type { RestEndpointMethodTypes } from '@octokit/plugin-rest-endpoint-methods' import * as core from '@actions/core' import * as github from '@actions/github' @@ -8,112 +7,147 @@ export interface GithubContext { token: string dryRun: boolean } + export class GithubHelper { private octokit: ReturnType private context: GithubContext - private dryRun: boolean constructor(context: GithubContext) { this.context = context - this.dryRun = context.dryRun this.octokit = github.getOctokit(context.token) } - async getPrData(pr_number: number) { - const { data } = await this.octokit.rest.pulls.get({ - owner: this.context.owner, - repo: this.context.repo, - pull_number: pr_number, - }) - return data + private async dryRunLog(methodName: string, params: Record) { + if (!this.context.dryRun) + return false + + core.startGroup(`dry-run模式, 不运行${methodName}`) + for (const [key, value] of Object.entries(params)) { + core.info(`${key}: ${typeof value === 'string' ? value : JSON.stringify(value)}`) + } + core.endGroup() + return true } - async getIssueData(issue_number: number) { - const { data } = await this.octokit.rest.issues.get({ + private get defaultRepoParams() { + return { owner: this.context.owner, repo: this.context.repo, - issue_number, - }) - return data + } } - async getIssueList(params?: Omit) { - const { data } = await this.octokit.rest.issues.listForRepo({ - ...params, - owner: this.context.owner, - repo: this.context.repo, - }) - return data.filter(item => !item?.pull_request) + async getPrData(prNumber: number) { + try { + const { data } = await this.octokit.rest.pulls.get({ + ...this.defaultRepoParams, + pull_number: prNumber, + }) + return data + } + catch (error) { + core.error(`获取PR数据失败: ${error}`) + throw error + } } - async closeIssue(issue_number: number) { - if (this.dryRun) { - core.startGroup('dry-run模式, 不运行closeIssue') - core.info(`issue_number: ${issue_number}`) - core.endGroup() - return + async getIssueData(issueNumber: number) { + try { + const { data } = await this.octokit.rest.issues.get({ + ...this.defaultRepoParams, + issue_number: issueNumber, + }) + return data + } + catch (error) { + core.error(`获取Issue数据失败: ${error}`) + throw error } + } - await this.octokit.rest.issues.update({ - owner: this.context.owner, - repo: this.context.repo, - issue_number, - state: 'closed', - }) + async getIssueList(params?: Omit[0], 'owner' | 'repo'>) { + try { + const { data } = await this.octokit.rest.issues.listForRepo({ + ...params, + ...this.defaultRepoParams, + }) + return data.filter(item => !item?.pull_request) + } + catch (error) { + core.error(`获取Issue列表失败: ${error}`) + throw error + } } - async createPR(title: string, head: string, body: string, base?: string) { - if (this.dryRun) { - core.startGroup('dry-run模式, 不运行createPR') - core.info(`title: ${title}`) - core.info(`head: ${head}`) - core.info(`base: ${base}`) - core.info(`body: ${body}`) - core.endGroup() + async closeIssue(issueNumber: number) { + if (await this.dryRunLog('closeIssue', { issueNumber })) return + + try { + await this.octokit.rest.issues.update({ + ...this.defaultRepoParams, + issue_number: issueNumber, + state: 'closed', + }) + } + catch (error) { + core.error(`关闭Issue失败: ${error}`) + throw error } - const { data } = await this.octokit.rest.pulls.create({ - owner: this.context.owner, - repo: this.context.repo, - title, - head, - base: base || 'develop', - body, - }) - return data } - async addComment(pr_number: number, body: string) { - if (this.dryRun) { - core.startGroup('dry-run模式, 不运行addComment') - core.info(`pr_number: ${pr_number}`) - core.info(`body: ${body}`) - core.endGroup() + async createPR(title: string, head: string, body: string, base = 'develop') { + if (await this.dryRunLog('createPR', { title, head, base, body })) return + + try { + const { data } = await this.octokit.rest.pulls.create({ + ...this.defaultRepoParams, + title, + head, + base, + body, + }) + return data + } + catch (error) { + core.error(`创建PR失败: ${error}`) + throw error } - const { data } = await this.octokit.rest.issues.createComment({ - owner: this.context.owner, - repo: this.context.repo, - issue_number: pr_number, - body, - }) - return data } - async addLabels(pr_number: number, labels: string[]) { - if (this.dryRun) { - core.startGroup('dry-run模式, 不运行addLabels') - core.info(`pr_number: ${pr_number}`) - core.info(`labels: ${labels.join(', ')}`) - core.endGroup() + async addComment(issueNumber: number, body: string) { + if (await this.dryRunLog('addComment', { issueNumber, body })) return + + try { + const { data } = await this.octokit.rest.issues.createComment({ + ...this.defaultRepoParams, + issue_number: issueNumber, + body, + }) + return data + } + catch (error) { + core.error(`添加评论失败: ${error}`) + throw error + } + } + + async addLabels(issueNumber: number, labels: string[]) { + if (await this.dryRunLog('addLabels', { issueNumber, labels: labels.join(', ') })) + return + + try { + const { data } = await this.octokit.rest.issues.addLabels({ + ...this.defaultRepoParams, + issue_number: issueNumber, + labels, + }) + return data + } + catch (error) { + core.error(`添加标签失败: ${error}`) + throw error } - const { data } = await this.octokit.rest.issues.addLabels({ - owner: this.context.owner, - repo: this.context.repo, - issue_number: pr_number, - labels, - }) - return data } } diff --git a/packages/utils/index.ts b/packages/utils/index.ts index d579baa..b2d412e 100644 --- a/packages/utils/index.ts +++ b/packages/utils/index.ts @@ -1 +1,2 @@ +export * from './git-helper' export * from './github-helper' diff --git a/packages/utils/package.json b/packages/utils/package.json index 9d8b1e5..3e52b3e 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@actions/core": "catalog:", + "@actions/exec": "catalog:", "@actions/github": "catalog:" }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fa1b569..d25cc34 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,6 +9,9 @@ catalogs: '@actions/core': specifier: ^3.0.0 version: 3.0.0 + '@actions/exec': + specifier: ^3.0.0 + version: 3.0.0 '@actions/github': specifier: ^9.1.0 version: 9.1.0 @@ -18,6 +21,12 @@ catalogs: '@octokit/plugin-rest-endpoint-methods': specifier: ^17.0.0 version: 17.0.0 + '@pnpm/workspace.manifest-writer': + specifier: ^1001.3.1 + version: 1001.3.1 + '@pnpm/workspace.read-manifest': + specifier: ^1000.3.1 + version: 1000.3.1 '@types/node': specifier: ^24.12.2 version: 24.12.2 @@ -86,11 +95,45 @@ importers: specifier: 'catalog:' version: 0.21.9(@typescript/native-preview@7.0.0-dev.20260419.1)(synckit@0.11.12)(typescript@5.9.3) + packages/upgrade-deps: + dependencies: + '@actions/core': + specifier: 'catalog:' + version: 3.0.0 + '@actions/exec': + specifier: 'catalog:' + version: 3.0.0 + '@actions/github': + specifier: 'catalog:' + version: 9.1.0 + '@pnpm/workspace.manifest-writer': + specifier: 'catalog:' + version: 1001.3.1 + '@pnpm/workspace.read-manifest': + specifier: 'catalog:' + version: 1000.3.1 + '@workflows/utils': + specifier: workspace:* + version: link:../utils + devDependencies: + '@octokit/plugin-rest-endpoint-methods': + specifier: 'catalog:' + version: 17.0.0(@octokit/core@7.0.6) + '@types/node': + specifier: 'catalog:' + version: 24.12.2 + tsdown: + specifier: 'catalog:' + version: 0.21.9(@typescript/native-preview@7.0.0-dev.20260419.1)(synckit@0.11.12)(typescript@5.9.3) + packages/utils: dependencies: '@actions/core': specifier: 'catalog:' version: 3.0.0 + '@actions/exec': + specifier: 'catalog:' + version: 3.0.0 '@actions/github': specifier: 'catalog:' version: 9.1.0 @@ -404,6 +447,57 @@ packages: resolution: {integrity: sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} + '@pnpm/catalogs.types@1000.0.0': + resolution: {integrity: sha512-xRf72lk7xHNvbenA4sp4Of/90QDdRW0CRYT+V+EbqpUXu1xsXtedHai34cTU6VGe7C1hUukxxE9eYTtIpYrx5g==} + engines: {node: '>=18.12'} + + '@pnpm/constants@1001.3.1': + resolution: {integrity: sha512-2hf0s4pVrVEH8RvdJJ7YRKjQdiG8m0iAT26TTqXnCbK30kKwJW69VLmP5tED5zstmDRXcOeH5eRcrpkdwczQ9g==} + engines: {node: '>=18.12'} + + '@pnpm/error@1000.1.0': + resolution: {integrity: sha512-Dqc2IJJPjUatwc9Letw+vG29rnaMrDGi5g6WCx1HiZYm0obXbTmLygeRafMbgf+sLKXrWE1shOeiayQuczBdoA==} + engines: {node: '>=18.12'} + + '@pnpm/lockfile.types@1002.1.0': + resolution: {integrity: sha512-Oa9Fhwo4Ipodj3hyUPC5wUt5ucVkuttyct2DbFUkB79Fq5HL9MHHQ+JFYh03eajmLqWrN1t8+6DbmcKqRtNjNg==} + engines: {node: '>=18.12'} + + '@pnpm/object.key-sorting@1000.0.1': + resolution: {integrity: sha512-YTJCXyUGOrJuj4QqhSKqZa1vlVAm82h1/uw00ZmD/kL2OViggtyUwWyIe62kpwWVPwEYixfGjfvaFKVJy2mjzA==} + engines: {node: '>=18.12'} + + '@pnpm/patching.types@1000.1.0': + resolution: {integrity: sha512-Zib2ysLctRnWM4KXXlljR44qSKwyEqYmLk+8VPBDBEK3l5Gp5mT3N4ix9E4qjYynvFqahumsxzOfxOYQhUGMGw==} + engines: {node: '>=18.12'} + + '@pnpm/ramda@0.28.1': + resolution: {integrity: sha512-zcAG+lvU0fMziNeGXpPyCyCJYp5ZVrPElEE4t14jAmViaihohocZ+dDkcRIyAomox8pQsuZnv1EyHR+pOhmUWw==} + + '@pnpm/resolver-base@1005.4.1': + resolution: {integrity: sha512-47zGgACkbZWLOmM61kaE0nkqxiYx63C6DJ4wzDsdj0iXDZJ9SJEl+T035pkhquHe8XEh3YxvwMg2BRyZSgmZ9Q==} + engines: {node: '>=18.12'} + + '@pnpm/types@1001.3.0': + resolution: {integrity: sha512-NLTXheat/u7OEGg5M5vF6Z85zx8uKUZE0+whtX/sbFV2XL48RdnOWGPTKYuVVkv8M+launaLUTgGEXNs/ess2w==} + engines: {node: '>=18.12'} + + '@pnpm/util.lex-comparator@3.0.2': + resolution: {integrity: sha512-blFO4Ws97tWv/SNE6N39ZdGmZBrocXnBOfVp0ln4kELmns4pGPZizqyRtR8EjfOLMLstbmNCTReBoDvLz1isVg==} + engines: {node: '>=18.12'} + + '@pnpm/workspace.manifest-writer@1001.3.1': + resolution: {integrity: sha512-EbVvYPRXO5o4qkol+Sgo1sR+46UZBrPZTNsa8G8C35iiXrMsjwS2Ssf0gpdKH7E4R24v+mtOiJuhZ8mnYCrHOA==} + engines: {node: '>=18.12'} + + '@pnpm/workspace.read-manifest@1000.3.1': + resolution: {integrity: sha512-ojO1Anf4ITL7OskuUYoLI3bldQ36XNLpG2cYQZ4F6LZbBZnRY8umW6TeWzb9h/aX8UFwYp9vWbQ8R/FaMtMEeg==} + engines: {node: '>=18.12'} + + '@pnpm/yaml.document-sync@1000.0.0': + resolution: {integrity: sha512-aEmCtfPJejq9I/q7pIYNo3Q0ryPrUoR57noCJbU+f0zNmg8JKG5YVVfCVvo5KNnG3LlN/MDyWvSHTeqy+HCoWA==} + engines: {node: '>=18.12'} + '@quansync/fs@1.0.0': resolution: {integrity: sha512-4TJ3DFtlf1L5LDMaM6CanJ/0lckGNtJcMjQ1NAV6zDmA0tEHKZtxNKin8EgPaVX1YzljbxckyT2tJrpQKAtngQ==} @@ -755,6 +849,9 @@ packages: resolution: {integrity: sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==} engines: {node: '>=14'} + argparse@2.0.1: + resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} + ast-kit@3.0.0-beta.1: resolution: {integrity: sha512-trmleAnZ2PxN/loHWVhhx1qeOHSRXq4TDsBBxq3GqeJitfk3+jTQ+v/C1km/KYq9M7wKqCewMh+/NAvVH7m+bw==} engines: {node: '>=20.19.0'} @@ -1235,9 +1332,17 @@ packages: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} + is-plain-obj@2.1.0: + resolution: {integrity: sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==} + engines: {node: '>=8'} + isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + js-yaml@4.1.1: + resolution: {integrity: sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==} + hasBin: true + jsdoc-type-pratt-parser@7.1.1: resolution: {integrity: sha512-/2uqY7x6bsrpi3i9LVU6J89352C0rpMk0as8trXxCtvd4kPk1ke/Eyif6wqfSLvoNJqcDG9Vk4UsXgygzCt2xA==} engines: {node: '>=20.0.0'} @@ -1546,6 +1651,10 @@ packages: quansync@1.0.0: resolution: {integrity: sha512-5xZacEEufv3HSTPQuchrvV6soaiACMFnq1H8wkVioctoH3TRha9Sz66lOxRwPK/qZj7HPiSveih9yAyh98gvqA==} + read-yaml-file@2.1.0: + resolution: {integrity: sha512-UkRNRIwnhG+y7hpqnycCL/xbTk7+ia9VuVTC0S+zVbwd65DI9eUpRMfsWIGrCWxTU/mi+JW8cHQCrv+zfCbEPQ==} + engines: {node: '>=10.13'} + refa@0.12.1: resolution: {integrity: sha512-J8rn6v4DBb2nnFqkqwy6/NnTYMcgLA+sLr0iIO41qpv0n+ngb7ksag2tMRl0inb1bbO/esUwzW1vbJi7K0sI0g==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} @@ -1610,9 +1719,17 @@ packages: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} + signal-exit@4.1.0: + resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} + engines: {node: '>=14'} + sisteransi@1.0.5: resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} + sort-keys@4.2.0: + resolution: {integrity: sha512-aUYIEU/UviqPgc8mHR6IW1EGxkAXpeRETYcrzg8cLAvUPZcpAlleSXHV2mY7G12GphSH6Gzv+4MMVSSkbdteHg==} + engines: {node: '>=8'} + source-map-js@1.2.1: resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} engines: {node: '>=0.10.0'} @@ -1626,6 +1743,10 @@ packages: spdx-license-ids@3.0.22: resolution: {integrity: sha512-4PRT4nh1EImPbt2jASOKHX7PB7I+e4IWNLvkKFDxNhJlfjbYlleYQh285Z/3mPTHSAK/AvdMmw5BNNuYH8ShgQ==} + strip-bom@4.0.0: + resolution: {integrity: sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==} + engines: {node: '>=8'} + strip-indent@4.1.1: resolution: {integrity: sha512-SlyRoSkdh1dYP0PzclLE7r0M9sgbFKKMFXpFRUMNuKhQSbC6VQIGzq3E0qsfvGJaUFJPGv6Ws1NZ/haTAjfbMA==} engines: {node: '>=12'} @@ -1789,6 +1910,10 @@ packages: resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} engines: {node: '>=0.10.0'} + write-file-atomic@5.0.1: + resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + xml-name-validator@4.0.0: resolution: {integrity: sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==} engines: {node: '>=12'} @@ -2140,6 +2265,61 @@ snapshots: '@pkgr/core@0.2.9': {} + '@pnpm/catalogs.types@1000.0.0': {} + + '@pnpm/constants@1001.3.1': {} + + '@pnpm/error@1000.1.0': + dependencies: + '@pnpm/constants': 1001.3.1 + + '@pnpm/lockfile.types@1002.1.0': + dependencies: + '@pnpm/patching.types': 1000.1.0 + '@pnpm/resolver-base': 1005.4.1 + '@pnpm/types': 1001.3.0 + + '@pnpm/object.key-sorting@1000.0.1': + dependencies: + '@pnpm/util.lex-comparator': 3.0.2 + sort-keys: 4.2.0 + + '@pnpm/patching.types@1000.1.0': {} + + '@pnpm/ramda@0.28.1': {} + + '@pnpm/resolver-base@1005.4.1': + dependencies: + '@pnpm/types': 1001.3.0 + + '@pnpm/types@1001.3.0': {} + + '@pnpm/util.lex-comparator@3.0.2': {} + + '@pnpm/workspace.manifest-writer@1001.3.1': + dependencies: + '@pnpm/catalogs.types': 1000.0.0 + '@pnpm/constants': 1001.3.1 + '@pnpm/lockfile.types': 1002.1.0 + '@pnpm/object.key-sorting': 1000.0.1 + '@pnpm/types': 1001.3.0 + '@pnpm/workspace.read-manifest': 1000.3.1 + '@pnpm/yaml.document-sync': 1000.0.0 + ramda: '@pnpm/ramda@0.28.1' + write-file-atomic: 5.0.1 + yaml: 2.8.2 + + '@pnpm/workspace.read-manifest@1000.3.1': + dependencies: + '@pnpm/constants': 1001.3.1 + '@pnpm/error': 1000.1.0 + '@pnpm/types': 1001.3.0 + read-yaml-file: 2.1.0 + + '@pnpm/yaml.document-sync@1000.0.0': + dependencies: + yaml: 2.8.2 + '@quansync/fs@1.0.0': dependencies: quansync: 1.0.0 @@ -2503,6 +2683,8 @@ snapshots: are-docs-informative@0.0.2: {} + argparse@2.0.1: {} + ast-kit@3.0.0-beta.1: dependencies: '@babel/parser': 8.0.0-rc.3 @@ -2988,8 +3170,14 @@ snapshots: dependencies: is-extglob: 2.1.1 + is-plain-obj@2.1.0: {} + isexe@2.0.0: {} + js-yaml@4.1.1: + dependencies: + argparse: 2.0.1 + jsdoc-type-pratt-parser@7.1.1: {} jsdoc-type-pratt-parser@7.2.0: {} @@ -3485,6 +3673,11 @@ snapshots: quansync@1.0.0: {} + read-yaml-file@2.1.0: + dependencies: + js-yaml: 4.1.1 + strip-bom: 4.0.0 + refa@0.12.1: dependencies: '@eslint-community/regexpp': 4.12.2 @@ -3558,8 +3751,14 @@ snapshots: shebang-regex@3.0.0: {} + signal-exit@4.1.0: {} + sisteransi@1.0.5: {} + sort-keys@4.2.0: + dependencies: + is-plain-obj: 2.1.0 + source-map-js@1.2.1: {} spdx-exceptions@2.5.0: {} @@ -3571,6 +3770,8 @@ snapshots: spdx-license-ids@3.0.22: {} + strip-bom@4.0.0: {} + strip-indent@4.1.1: {} synckit@0.11.12: @@ -3724,6 +3925,11 @@ snapshots: word-wrap@1.2.5: {} + write-file-atomic@5.0.1: + dependencies: + imurmurhash: 0.1.4 + signal-exit: 4.1.0 + xml-name-validator@4.0.0: {} yaml-eslint-parser@2.0.0: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 248f0e6..eca12cc 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -3,14 +3,16 @@ catalogMode: prefer shellEmulator: true trustPolicy: no-downgrade - packages: - packages/* catalog: '@actions/core': ^3.0.0 + '@actions/exec': ^3.0.0 '@actions/github': ^9.1.0 '@antfu/eslint-config': ^8.2.0 '@octokit/plugin-rest-endpoint-methods': ^17.0.0 + '@pnpm/workspace.manifest-writer': ^1001.3.1 + '@pnpm/workspace.read-manifest': ^1000.3.1 '@types/node': ^24.12.2 '@typescript/native-preview': 7.0.0-dev.20260419.1 eslint: ^10.2.1 From 0e7f08a8d4441fbf14acc729479ca82fa70657ef Mon Sep 17 00:00:00 2001 From: lwj <674416404@qq.com> Date: Fri, 24 Apr 2026 23:51:10 +0800 Subject: [PATCH 02/40] =?UTF-8?q?refactor:=20=E7=BB=9F=E4=B8=80=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=20camelCase=20=E5=91=BD=E5=90=8D=20dryRun=20=E5=8F=98?= =?UTF-8?q?=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/upgrade-deps/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/upgrade-deps/index.ts b/packages/upgrade-deps/index.ts index cd55823..61097b0 100644 --- a/packages/upgrade-deps/index.ts +++ b/packages/upgrade-deps/index.ts @@ -39,7 +39,7 @@ interface TriggerContext { repo: string owner: string token: string - dry_run: boolean + dryRun: boolean trigger: string } @@ -153,7 +153,7 @@ async function createDepsPr( owner: context.owner, repo: context.repo, token: context.token, - dryRun: context.dry_run, + dryRun: context.dryRun, }) await githubHelper.createPR(title, branchName, title, baseBranch) } @@ -176,7 +176,7 @@ async function updateDependencies(context: TriggerContext): Promise { repo: context.repo, owner: context.owner, token: context.token, - dryRun: context.dry_run, + dryRun: context.dryRun, }) const baseBranch = await gitHelper.clone() @@ -220,7 +220,7 @@ async function main(): Promise { repo, owner, token, - dry_run: dryRun, + dryRun, trigger: github.context.eventName, }) } From a8c9f709c7fbf4e4a70ffa039668f484e8501fe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Mon, 27 Apr 2026 09:33:35 +0800 Subject: [PATCH 03/40] =?UTF-8?q?refactor:=20=E4=BC=98=E5=8C=96=E5=8D=87?= =?UTF-8?q?=E7=BA=A7=E4=BE=9D=E8=B5=96=E4=BB=A3=E7=A0=81=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/upgrade-deps/index.ts | 76 ++++++++++++++++------------------ 1 file changed, 35 insertions(+), 41 deletions(-) diff --git a/packages/upgrade-deps/index.ts b/packages/upgrade-deps/index.ts index 61097b0..573b338 100644 --- a/packages/upgrade-deps/index.ts +++ b/packages/upgrade-deps/index.ts @@ -7,18 +7,14 @@ import { updateWorkspaceManifest } from '@pnpm/workspace.manifest-writer' import { readWorkspaceManifest } from '@pnpm/workspace.read-manifest' import { GitHelper, GithubHelper } from '@workflows/utils' -const BRANCH_PATTERNS = { - DEPS: (deps: Array<{ name: string, version: string }>) => { - const depsSlug = deps.map(d => `${d.name}-${d.version}`).join('-') - return `chore(deps): upgrade-${depsSlug}` - }, +function getBranchName(deps: Array<{ name: string, version: string }>): string { + const depsSlug = deps.map(d => `${d.name}-${d.version}`).join('-') + return `chore(deps): upgrade-${depsSlug}` } -const PR_TITLES = { - DEPS: (deps: Array<{ name: string, version: string }>) => { - const depList = deps.map(d => `${d.name} to ${d.version}`).join(', ') - return `chore: upgrade ${depList}` - }, +function getPrTitle(deps: Array<{ name: string, version: string }>): string { + const depList = deps.map(d => `${d.name} to ${d.version}`).join(', ') + return `chore: upgrade ${depList}` } const ERROR_MESSAGES = { @@ -48,14 +44,21 @@ interface DependencyInfo { version: string } +function getUpdatedVersion(currentVersion: string, newVersion: string): string { + const prefix = currentVersion[0] + if (prefix && (prefix === '^' || prefix === '~')) { + return `${prefix}${newVersion}` + } + return newVersion +} + async function updatePnpmCatalog(deps: DependencyInfo[], repoPath: string): Promise { const workspaceFile = path.join(repoPath, 'pnpm-workspace.yaml') let manifestContent: string try { manifestContent = await fs.readFile(workspaceFile, 'utf-8') - } - catch { + } catch { core.info(`pnpm-workspace.yaml not found in ${repoPath}, skipping catalog update`) return } @@ -69,48 +72,39 @@ async function updatePnpmCatalog(deps: DependencyInfo[], repoPath: string): Prom const updatedCatalogs: Record> = {} if (manifest.catalog) { - updatedCatalogs[''] = {} + const defaultCatalogUpdates: Record = {} for (const dep of deps) { if (dep.name in manifest.catalog) { - const current = manifest.catalog[dep.name] as string - const prefix = current[0] - if (prefix === '^' || prefix === '~') { - updatedCatalogs[''][dep.name] = `${prefix}${dep.version}` - } - else { - updatedCatalogs[''][dep.name] = dep.version - } + defaultCatalogUpdates[dep.name] = getUpdatedVersion(manifest.catalog[dep.name] as string, dep.version) } } + if (Object.keys(defaultCatalogUpdates).length > 0) { + updatedCatalogs[''] = defaultCatalogUpdates + } } if (manifest.catalogs) { for (const [catalogName, catalog] of Object.entries(manifest.catalogs)) { - updatedCatalogs[catalogName] = {} + const catalogUpdates: Record = {} + const typedCatalog = catalog as Record for (const dep of deps) { - if (dep.name in (catalog as Record)) { - const current = (catalog as Record)[dep.name] - const prefix = current[0] - if (prefix === '^' || prefix === '~') { - updatedCatalogs[catalogName][dep.name] = `${prefix}${dep.version}` - } - else { - updatedCatalogs[catalogName][dep.name] = dep.version - } + if (dep.name in typedCatalog) { + catalogUpdates[dep.name] = getUpdatedVersion(typedCatalog[dep.name], dep.version) } } + if (Object.keys(catalogUpdates).length > 0) { + updatedCatalogs[catalogName] = catalogUpdates + } } } - const hasUpdates = Object.values(updatedCatalogs).some(catalog => Object.keys(catalog).length > 0) + const hasUpdates = Object.keys(updatedCatalogs).length > 0 if (!hasUpdates) { core.info(`No matching dependencies found in catalog, skipping update`) return } - await updateWorkspaceManifest(workspaceFile, { - updatedCatalogs, - }) + await updateWorkspaceManifest(workspaceFile, { updatedCatalogs }) core.info(`Updated pnpm catalog in pnpm-workspace.yaml`) } @@ -162,7 +156,7 @@ async function updateDependencies(context: TriggerContext): Promise { const packageManager = core.getInput('package-manager') || 'npm' const deps = core.getMultilineInput('deps', { required: true }) - if (!deps || deps.length === 0) { + if (!deps.length) { throw new ActionError(ERROR_MESSAGES.MISSING_DEPS, { trigger: context.trigger }) } @@ -180,7 +174,7 @@ async function updateDependencies(context: TriggerContext): Promise { }) const baseBranch = await gitHelper.clone() - const branchName = BRANCH_PATTERNS.DEPS(depInfos) + const branchName = getBranchName(depInfos) await gitHelper.createBranch(branchName) if (packageManager === 'pnpm') { @@ -189,12 +183,12 @@ async function updateDependencies(context: TriggerContext): Promise { await updatePackageDependencies(packageManager, deps, context.repo) - if (!await gitHelper.isNeedCommit()) { + if (!(await gitHelper.isNeedCommit())) { core.info('No changes to commit') return } - const title = PR_TITLES.DEPS(depInfos) + const title = getPrTitle(depInfos) await gitHelper.commit(title) await gitHelper.push(branchName) @@ -204,8 +198,8 @@ async function updateDependencies(context: TriggerContext): Promise { async function main(): Promise { const repo = core.getInput('repo') || github.context.repo.repo const owner = core.getInput('owner') || github.context.repo.owner - const token = core.getInput('token', { required: true }) || '' - const dryRun = core.getBooleanInput('dry-run') || false + const token = core.getInput('token', { required: true }) + const dryRun = core.getBooleanInput('dry-run') const packageManager = core.getInput('package-manager') || 'npm' const deps = core.getMultilineInput('deps', { required: true }) From ad9019c2ab1ab407db9f7a4df9e957e0ac504cec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Mon, 27 Apr 2026 10:46:01 +0800 Subject: [PATCH 04/40] =?UTF-8?q?refactor:=20=E9=87=8D=E6=9E=84=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=EF=BC=8C=E5=B0=86=E9=80=BB=E8=BE=91=E4=BB=8E=20index.?= =?UTF-8?q?ts=20=E8=BF=81=E7=A7=BB=E8=87=B3=20main.ts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/upgrade-deps/dist/index.mjs | 62 ++++---- packages/upgrade-deps/index.ts | 221 +-------------------------- packages/upgrade-deps/main.ts | 217 ++++++++++++++++++++++++++ 3 files changed, 248 insertions(+), 252 deletions(-) create mode 100644 packages/upgrade-deps/main.ts diff --git a/packages/upgrade-deps/dist/index.mjs b/packages/upgrade-deps/dist/index.mjs index b8b4626..03040e2 100644 --- a/packages/upgrade-deps/dist/index.mjs +++ b/packages/upgrade-deps/dist/index.mjs @@ -1,4 +1,6 @@ import { createRequire } from "node:module"; +import * as fs from "node:fs/promises"; +import * as path from "node:path"; import * as os$1 from "os"; import os, { EOL } from "os"; import * as fs$3 from "fs"; @@ -9,8 +11,6 @@ import { fileURLToPath } from "node:url"; import { StringDecoder } from "string_decoder"; import * as child from "child_process"; import { setTimeout as setTimeout$1 } from "timers"; -import * as fs from "node:fs/promises"; -import * as path from "node:path"; //#region \0rolldown/runtime.js var __create = Object.create; var __defProp = Object.defineProperty; @@ -30053,13 +30053,13 @@ var GithubHelper = class { } }; //#endregion -//#region index.ts -const BRANCH_PATTERNS = { DEPS: (deps) => { +//#region main.ts +function getBranchName(deps) { return `chore(deps): upgrade-${deps.map((d) => `${d.name}-${d.version}`).join("-")}`; -} }; -const PR_TITLES = { DEPS: (deps) => { +} +function getPrTitle(deps) { return `chore: upgrade ${deps.map((d) => `${d.name} to ${d.version}`).join(", ")}`; -} }; +} const ERROR_MESSAGES = { MISSING_DEPS: "Missing deps input" }; var ActionError = class extends Error { constructor(message, context) { @@ -30068,6 +30068,11 @@ var ActionError = class extends Error { if (context) error(`${message} ${JSON.stringify(context)}`); } }; +function getUpdatedVersion(currentVersion, newVersion) { + const prefix = currentVersion[0]; + if (prefix && (prefix === "^" || prefix === "~")) return `${prefix}${newVersion}`; + return newVersion; +} async function updatePnpmCatalog(deps, repoPath) { const workspaceFile = path.join(repoPath, "pnpm-workspace.yaml"); let manifestContent; @@ -30084,22 +30089,17 @@ async function updatePnpmCatalog(deps, repoPath) { } const updatedCatalogs = {}; if (manifest.catalog) { - updatedCatalogs[""] = {}; - for (const dep of deps) if (dep.name in manifest.catalog) { - const prefix = manifest.catalog[dep.name][0]; - if (prefix === "^" || prefix === "~") updatedCatalogs[""][dep.name] = `${prefix}${dep.version}`; - else updatedCatalogs[""][dep.name] = dep.version; - } + const defaultCatalogUpdates = {}; + for (const dep of deps) if (dep.name in manifest.catalog) defaultCatalogUpdates[dep.name] = getUpdatedVersion(manifest.catalog[dep.name], dep.version); + if (Object.keys(defaultCatalogUpdates).length > 0) updatedCatalogs[""] = defaultCatalogUpdates; } if (manifest.catalogs) for (const [catalogName, catalog] of Object.entries(manifest.catalogs)) { - updatedCatalogs[catalogName] = {}; - for (const dep of deps) if (dep.name in catalog) { - const prefix = catalog[dep.name][0]; - if (prefix === "^" || prefix === "~") updatedCatalogs[catalogName][dep.name] = `${prefix}${dep.version}`; - else updatedCatalogs[catalogName][dep.name] = dep.version; - } + const catalogUpdates = {}; + const typedCatalog = catalog; + for (const dep of deps) if (dep.name in typedCatalog) catalogUpdates[dep.name] = getUpdatedVersion(typedCatalog[dep.name], dep.version); + if (Object.keys(catalogUpdates).length > 0) updatedCatalogs[catalogName] = catalogUpdates; } - if (!Object.values(updatedCatalogs).some((catalog) => Object.keys(catalog).length > 0)) { + if (!(Object.keys(updatedCatalogs).length > 0)) { info(`No matching dependencies found in catalog, skipping update`); return; } @@ -30143,23 +30143,23 @@ async function createDepsPr(title, branchName, baseBranch, context) { owner: context.owner, repo: context.repo, token: context.token, - dryRun: context.dry_run + dryRun: context.dryRun }).createPR(title, branchName, title, baseBranch); } async function updateDependencies(context) { const packageManager = getInput("package-manager") || "npm"; const deps = getMultilineInput("deps", { required: true }); - if (!deps || deps.length === 0) throw new ActionError(ERROR_MESSAGES.MISSING_DEPS, { trigger: context.trigger }); + if (!deps.length) throw new ActionError(ERROR_MESSAGES.MISSING_DEPS, { trigger: context.trigger }); const depInfos = await getPkgLatestVersion(deps); if (packageManager !== "npm") await corepackEnable(); const gitHelper = new GitHelper({ repo: context.repo, owner: context.owner, token: context.token, - dryRun: context.dry_run + dryRun: context.dryRun }); const baseBranch = await gitHelper.clone(); - const branchName = BRANCH_PATTERNS.DEPS(depInfos); + const branchName = getBranchName(depInfos); await gitHelper.createBranch(branchName); if (packageManager === "pnpm") await updatePnpmCatalog(depInfos, context.repo); await updatePackageDependencies(packageManager, deps, context.repo); @@ -30167,7 +30167,7 @@ async function updateDependencies(context) { info("No changes to commit"); return; } - const title = PR_TITLES.DEPS(depInfos); + const title = getPrTitle(depInfos); await gitHelper.commit(title); await gitHelper.push(branchName); await createDepsPr(title, branchName, baseBranch, context); @@ -30175,24 +30175,22 @@ async function updateDependencies(context) { async function main() { const repo = getInput("repo") || context.repo.repo; const owner = getInput("owner") || context.repo.owner; - const token = getInput("token", { required: true }) || ""; - const dryRun = getBooleanInput("dry-run") || false; - const packageManager = getInput("package-manager") || "npm"; - const deps = getMultilineInput("deps", { required: true }); + const token = getInput("token", { required: true }); + const dryRun = getBooleanInput("dry-run"); startGroup("upgrade-deps"); info(`repo: ${repo}`); info(`owner: ${owner}`); - info(`packageManager: ${packageManager}`); - info(`deps: ${JSON.stringify(deps)}`); endGroup(); await updateDependencies({ repo, owner, token, - dry_run: dryRun, + dryRun, trigger: context.eventName }); } +//#endregion +//#region index.ts main(); //#endregion export {}; diff --git a/packages/upgrade-deps/index.ts b/packages/upgrade-deps/index.ts index 573b338..ad78d52 100644 --- a/packages/upgrade-deps/index.ts +++ b/packages/upgrade-deps/index.ts @@ -1,222 +1,3 @@ -import * as fs from 'node:fs/promises' -import * as path from 'node:path' -import * as core from '@actions/core' -import * as exec from '@actions/exec' -import * as github from '@actions/github' -import { updateWorkspaceManifest } from '@pnpm/workspace.manifest-writer' -import { readWorkspaceManifest } from '@pnpm/workspace.read-manifest' -import { GitHelper, GithubHelper } from '@workflows/utils' - -function getBranchName(deps: Array<{ name: string, version: string }>): string { - const depsSlug = deps.map(d => `${d.name}-${d.version}`).join('-') - return `chore(deps): upgrade-${depsSlug}` -} - -function getPrTitle(deps: Array<{ name: string, version: string }>): string { - const depList = deps.map(d => `${d.name} to ${d.version}`).join(', ') - return `chore: upgrade ${depList}` -} - -const ERROR_MESSAGES = { - MISSING_DEPS: 'Missing deps input', -} - -class ActionError extends Error { - constructor(message: string, context?: Record) { - super(message) - this.name = 'ActionError' - if (context) { - core.error(`${message} ${JSON.stringify(context)}`) - } - } -} - -interface TriggerContext { - repo: string - owner: string - token: string - dryRun: boolean - trigger: string -} - -interface DependencyInfo { - name: string - version: string -} - -function getUpdatedVersion(currentVersion: string, newVersion: string): string { - const prefix = currentVersion[0] - if (prefix && (prefix === '^' || prefix === '~')) { - return `${prefix}${newVersion}` - } - return newVersion -} - -async function updatePnpmCatalog(deps: DependencyInfo[], repoPath: string): Promise { - const workspaceFile = path.join(repoPath, 'pnpm-workspace.yaml') - - let manifestContent: string - try { - manifestContent = await fs.readFile(workspaceFile, 'utf-8') - } catch { - core.info(`pnpm-workspace.yaml not found in ${repoPath}, skipping catalog update`) - return - } - - const manifest = await readWorkspaceManifest(manifestContent) - if (!manifest) { - core.info(`Failed to read pnpm-workspace.yaml, skipping catalog update`) - return - } - - const updatedCatalogs: Record> = {} - - if (manifest.catalog) { - const defaultCatalogUpdates: Record = {} - for (const dep of deps) { - if (dep.name in manifest.catalog) { - defaultCatalogUpdates[dep.name] = getUpdatedVersion(manifest.catalog[dep.name] as string, dep.version) - } - } - if (Object.keys(defaultCatalogUpdates).length > 0) { - updatedCatalogs[''] = defaultCatalogUpdates - } - } - - if (manifest.catalogs) { - for (const [catalogName, catalog] of Object.entries(manifest.catalogs)) { - const catalogUpdates: Record = {} - const typedCatalog = catalog as Record - for (const dep of deps) { - if (dep.name in typedCatalog) { - catalogUpdates[dep.name] = getUpdatedVersion(typedCatalog[dep.name], dep.version) - } - } - if (Object.keys(catalogUpdates).length > 0) { - updatedCatalogs[catalogName] = catalogUpdates - } - } - } - - const hasUpdates = Object.keys(updatedCatalogs).length > 0 - if (!hasUpdates) { - core.info(`No matching dependencies found in catalog, skipping update`) - return - } - - await updateWorkspaceManifest(workspaceFile, { updatedCatalogs }) - core.info(`Updated pnpm catalog in pnpm-workspace.yaml`) -} - -async function getPkgLatestVersion(pkgNames: string[]): Promise { - const results: DependencyInfo[] = [] - for (const pkg of pkgNames) { - const { stdout } = await exec.getExecOutput('npm', ['view', pkg, 'version']) - results.push({ - name: pkg, - version: stdout.trim(), - }) - } - return results -} - -async function corepackEnable(): Promise { - await exec.exec('corepack', ['enable']) -} - -async function updatePackageDependencies(packageManager: string, deps: string[], repo: string): Promise { - const repoPath = `./${repo}` - if (packageManager === 'pnpm') { - await exec.exec('pnpm', ['up', ...deps, '--latest'], { cwd: repoPath }) - } - else if (packageManager === 'yarn') { - await exec.exec('yarn', ['upgrade', ...deps, '--latest'], { cwd: repoPath }) - } - else { - await exec.exec('npm', ['update', ...deps], { cwd: repoPath }) - } -} - -async function createDepsPr( - title: string, - branchName: string, - baseBranch: string, - context: TriggerContext, -): Promise { - const githubHelper = new GithubHelper({ - owner: context.owner, - repo: context.repo, - token: context.token, - dryRun: context.dryRun, - }) - await githubHelper.createPR(title, branchName, title, baseBranch) -} - -async function updateDependencies(context: TriggerContext): Promise { - const packageManager = core.getInput('package-manager') || 'npm' - const deps = core.getMultilineInput('deps', { required: true }) - - if (!deps.length) { - throw new ActionError(ERROR_MESSAGES.MISSING_DEPS, { trigger: context.trigger }) - } - - const depInfos = await getPkgLatestVersion(deps) - - if (packageManager !== 'npm') { - await corepackEnable() - } - - const gitHelper = new GitHelper({ - repo: context.repo, - owner: context.owner, - token: context.token, - dryRun: context.dryRun, - }) - - const baseBranch = await gitHelper.clone() - const branchName = getBranchName(depInfos) - await gitHelper.createBranch(branchName) - - if (packageManager === 'pnpm') { - await updatePnpmCatalog(depInfos, context.repo) - } - - await updatePackageDependencies(packageManager, deps, context.repo) - - if (!(await gitHelper.isNeedCommit())) { - core.info('No changes to commit') - return - } - - const title = getPrTitle(depInfos) - await gitHelper.commit(title) - await gitHelper.push(branchName) - - await createDepsPr(title, branchName, baseBranch, context) -} - -async function main(): Promise { - const repo = core.getInput('repo') || github.context.repo.repo - const owner = core.getInput('owner') || github.context.repo.owner - const token = core.getInput('token', { required: true }) - const dryRun = core.getBooleanInput('dry-run') - const packageManager = core.getInput('package-manager') || 'npm' - const deps = core.getMultilineInput('deps', { required: true }) - - core.startGroup('upgrade-deps') - core.info(`repo: ${repo}`) - core.info(`owner: ${owner}`) - core.info(`packageManager: ${packageManager}`) - core.info(`deps: ${JSON.stringify(deps)}`) - core.endGroup() - - await updateDependencies({ - repo, - owner, - token, - dryRun, - trigger: github.context.eventName, - }) -} +import { main } from './main' main() diff --git a/packages/upgrade-deps/main.ts b/packages/upgrade-deps/main.ts new file mode 100644 index 0000000..851e94b --- /dev/null +++ b/packages/upgrade-deps/main.ts @@ -0,0 +1,217 @@ +import * as fs from 'node:fs/promises' +import * as path from 'node:path' +import * as core from '@actions/core' +import * as exec from '@actions/exec' +import * as github from '@actions/github' +import { updateWorkspaceManifest } from '@pnpm/workspace.manifest-writer' +import { readWorkspaceManifest } from '@pnpm/workspace.read-manifest' +import { GitHelper, GithubHelper } from '@workflows/utils' + +function getBranchName(deps: Array<{ name: string, version: string }>): string { + const depsSlug = deps.map(d => `${d.name}-${d.version}`).join('-') + return `chore(deps): upgrade-${depsSlug}` +} + +function getPrTitle(deps: Array<{ name: string, version: string }>): string { + const depList = deps.map(d => `${d.name} to ${d.version}`).join(', ') + return `chore: upgrade ${depList}` +} + +const ERROR_MESSAGES = { + MISSING_DEPS: 'Missing deps input', +} + +class ActionError extends Error { + constructor(message: string, context?: Record) { + super(message) + this.name = 'ActionError' + if (context) { + core.error(`${message} ${JSON.stringify(context)}`) + } + } +} + +interface TriggerContext { + repo: string + owner: string + token: string + dryRun: boolean + trigger: string +} + +interface DependencyInfo { + name: string + version: string +} + +function getUpdatedVersion(currentVersion: string, newVersion: string): string { + const prefix = currentVersion[0] + if (prefix && (prefix === '^' || prefix === '~')) { + return `${prefix}${newVersion}` + } + return newVersion +} + +async function updatePnpmCatalog(deps: DependencyInfo[], repoPath: string): Promise { + const workspaceFile = path.join(repoPath, 'pnpm-workspace.yaml') + + let manifestContent: string + try { + manifestContent = await fs.readFile(workspaceFile, 'utf-8') + } + catch { + core.info(`pnpm-workspace.yaml not found in ${repoPath}, skipping catalog update`) + return + } + + const manifest = await readWorkspaceManifest(manifestContent) + if (!manifest) { + core.info(`Failed to read pnpm-workspace.yaml, skipping catalog update`) + return + } + + const updatedCatalogs: Record> = {} + + if (manifest.catalog) { + const defaultCatalogUpdates: Record = {} + for (const dep of deps) { + if (dep.name in manifest.catalog) { + defaultCatalogUpdates[dep.name] = getUpdatedVersion(manifest.catalog[dep.name] as string, dep.version) + } + } + if (Object.keys(defaultCatalogUpdates).length > 0) { + updatedCatalogs[''] = defaultCatalogUpdates + } + } + + if (manifest.catalogs) { + for (const [catalogName, catalog] of Object.entries(manifest.catalogs)) { + const catalogUpdates: Record = {} + const typedCatalog = catalog as Record + for (const dep of deps) { + if (dep.name in typedCatalog) { + catalogUpdates[dep.name] = getUpdatedVersion(typedCatalog[dep.name], dep.version) + } + } + if (Object.keys(catalogUpdates).length > 0) { + updatedCatalogs[catalogName] = catalogUpdates + } + } + } + + const hasUpdates = Object.keys(updatedCatalogs).length > 0 + if (!hasUpdates) { + core.info(`No matching dependencies found in catalog, skipping update`) + return + } + + await updateWorkspaceManifest(workspaceFile, { updatedCatalogs }) + core.info(`Updated pnpm catalog in pnpm-workspace.yaml`) +} + +async function getPkgLatestVersion(pkgNames: string[]): Promise { + const results: DependencyInfo[] = [] + for (const pkg of pkgNames) { + const { stdout } = await exec.getExecOutput('npm', ['view', pkg, 'version']) + results.push({ + name: pkg, + version: stdout.trim(), + }) + } + return results +} + +async function corepackEnable(): Promise { + await exec.exec('corepack', ['enable']) +} + +async function updatePackageDependencies(packageManager: string, deps: string[], repo: string): Promise { + const repoPath = `./${repo}` + if (packageManager === 'pnpm') { + await exec.exec('pnpm', ['up', ...deps, '--latest'], { cwd: repoPath }) + } + else if (packageManager === 'yarn') { + await exec.exec('yarn', ['upgrade', ...deps, '--latest'], { cwd: repoPath }) + } + else { + await exec.exec('npm', ['update', ...deps], { cwd: repoPath }) + } +} + +async function createDepsPr( + title: string, + branchName: string, + baseBranch: string, + context: TriggerContext, +): Promise { + const githubHelper = new GithubHelper({ + owner: context.owner, + repo: context.repo, + token: context.token, + dryRun: context.dryRun, + }) + await githubHelper.createPR(title, branchName, title, baseBranch) +} + +export async function updateDependencies(context: TriggerContext): Promise { + const packageManager = core.getInput('package-manager') || 'npm' + const deps = core.getMultilineInput('deps', { required: true }) + + if (!deps.length) { + throw new ActionError(ERROR_MESSAGES.MISSING_DEPS, { trigger: context.trigger }) + } + + const depInfos = await getPkgLatestVersion(deps) + + if (packageManager !== 'npm') { + await corepackEnable() + } + + const gitHelper = new GitHelper({ + repo: context.repo, + owner: context.owner, + token: context.token, + dryRun: context.dryRun, + }) + + const baseBranch = await gitHelper.clone() + const branchName = getBranchName(depInfos) + await gitHelper.createBranch(branchName) + + if (packageManager === 'pnpm') { + await updatePnpmCatalog(depInfos, context.repo) + } + + await updatePackageDependencies(packageManager, deps, context.repo) + + if (!(await gitHelper.isNeedCommit())) { + core.info('No changes to commit') + return + } + + const title = getPrTitle(depInfos) + await gitHelper.commit(title) + await gitHelper.push(branchName) + + await createDepsPr(title, branchName, baseBranch, context) +} + +export async function main(): Promise { + const repo = core.getInput('repo') || github.context.repo.repo + const owner = core.getInput('owner') || github.context.repo.owner + const token = core.getInput('token', { required: true }) + const dryRun = core.getBooleanInput('dry-run') + + core.startGroup('upgrade-deps') + core.info(`repo: ${repo}`) + core.info(`owner: ${owner}`) + core.endGroup() + + await updateDependencies({ + repo, + owner, + token, + dryRun, + trigger: github.context.eventName, + }) +} From 076bbdc7cf0755da24e9df93ef118b69a46ef497 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Mon, 27 Apr 2026 11:00:13 +0800 Subject: [PATCH 05/40] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=E5=8D=87=E7=BA=A7=20GitHub=20Action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- actions/upgrade-deps/action.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 actions/upgrade-deps/action.yml diff --git a/actions/upgrade-deps/action.yml b/actions/upgrade-deps/action.yml new file mode 100644 index 0000000..f5bc90f --- /dev/null +++ b/actions/upgrade-deps/action.yml @@ -0,0 +1,28 @@ +name: Upgrade Dependencies +description: Upgrade dependencies to specified versions + +inputs: + token: + description: GitHub token + required: true + dry-run: + description: Whether to run in dry-run mode + required: false + default: false + repo: + description: Repository name + required: false + owner: + description: Repository owner + required: false + package-manager: + description: Package manager to use (npm, yarn, pnpm) + required: false + default: npm + deps: + description: Dependencies to upgrade in format "package1@version1 package2@version2" + required: true + +runs: + using: node24 + main: ../../packages/upgrade-deps/dist/index.mjs From 68354a969054c9a7c75e10f81d1fce37be88777b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Mon, 27 Apr 2026 11:00:46 +0800 Subject: [PATCH 06/40] =?UTF-8?q?ci:=20=E6=B7=BB=E5=8A=A0=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E5=8D=87=E7=BA=A7=E4=BE=9D=E8=B5=96=E7=9A=84=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../test-close-release-issue copy.yml | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/test-close-release-issue copy.yml diff --git a/.github/workflows/test-close-release-issue copy.yml b/.github/workflows/test-close-release-issue copy.yml new file mode 100644 index 0000000..369eaa8 --- /dev/null +++ b/.github/workflows/test-close-release-issue copy.yml @@ -0,0 +1,24 @@ +name: test-upgrade-deps +on: + pull_request: + branches: + - main + paths: + - packages/close-release-issue/dist/* + +jobs: + test: + name: test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6.0.2 + + - name: test + uses: ./actions/upgrade-deps + with: + token: ${{ secrets.GITHUB_TOKEN }} + dry-run: true + repo: tdesign-vue + owner: Tencent + deps: + - '@tdesign/site-components' From 0f7569cf4873f2fe632c0e543e8c5b7acdddac2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Mon, 27 Apr 2026 11:02:31 +0800 Subject: [PATCH 07/40] =?UTF-8?q?ci:=20=E6=B7=BB=E5=8A=A0=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=E5=8D=87=E7=BA=A7=E6=B5=8B=E8=AF=95=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...{test-close-release-issue copy.yml => test-upgrade-deps.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{test-close-release-issue copy.yml => test-upgrade-deps.yml} (90%) diff --git a/.github/workflows/test-close-release-issue copy.yml b/.github/workflows/test-upgrade-deps.yml similarity index 90% rename from .github/workflows/test-close-release-issue copy.yml rename to .github/workflows/test-upgrade-deps.yml index 369eaa8..1d070e1 100644 --- a/.github/workflows/test-close-release-issue copy.yml +++ b/.github/workflows/test-upgrade-deps.yml @@ -4,7 +4,7 @@ on: branches: - main paths: - - packages/close-release-issue/dist/* + - packages/test-upgrade-deps/dist/* jobs: test: From fd4cdea792888c71cea3a58a0def1596a83b0d3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Mon, 27 Apr 2026 11:05:29 +0800 Subject: [PATCH 08/40] =?UTF-8?q?ci:=20=E4=BF=AE=E5=A4=8D=20upgrade-deps?= =?UTF-8?q?=20=E5=B7=A5=E4=BD=9C=E6=B5=81=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test-upgrade-deps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-upgrade-deps.yml b/.github/workflows/test-upgrade-deps.yml index 1d070e1..c70d29d 100644 --- a/.github/workflows/test-upgrade-deps.yml +++ b/.github/workflows/test-upgrade-deps.yml @@ -4,7 +4,7 @@ on: branches: - main paths: - - packages/test-upgrade-deps/dist/* + - packages/upgrade-deps/dist/* jobs: test: From 3202836ca9c2df73d6b550186906fb0b98be982f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Mon, 27 Apr 2026 11:09:48 +0800 Subject: [PATCH 09/40] =?UTF-8?q?ci:=20=E6=B7=BB=E5=8A=A0=20@tdesign/theme?= =?UTF-8?q?-generator=20=E4=BE=9D=E8=B5=96=E5=8D=87=E7=BA=A7=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test-upgrade-deps.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-upgrade-deps.yml b/.github/workflows/test-upgrade-deps.yml index c70d29d..24aefad 100644 --- a/.github/workflows/test-upgrade-deps.yml +++ b/.github/workflows/test-upgrade-deps.yml @@ -22,3 +22,4 @@ jobs: owner: Tencent deps: - '@tdesign/site-components' + - '@tdesign/theme-generator' From b5afb3481dbe02f4f478feb7accbbab753c415ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Mon, 27 Apr 2026 11:12:29 +0800 Subject: [PATCH 10/40] =?UTF-8?q?ci:=20=E4=BF=AE=E6=AD=A3=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=E5=8D=87=E7=BA=A7=E5=B7=A5=E4=BD=9C=E6=B5=81=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test-upgrade-deps.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-upgrade-deps.yml b/.github/workflows/test-upgrade-deps.yml index 24aefad..cc85a1d 100644 --- a/.github/workflows/test-upgrade-deps.yml +++ b/.github/workflows/test-upgrade-deps.yml @@ -20,6 +20,6 @@ jobs: dry-run: true repo: tdesign-vue owner: Tencent - deps: - - '@tdesign/site-components' - - '@tdesign/theme-generator' + deps: | + '@tdesign/site-components' + '@tdesign/theme-generator' From 91cb6853cbbd85c312c7560c16fbaec907fc6dad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Mon, 27 Apr 2026 11:16:32 +0800 Subject: [PATCH 11/40] =?UTF-8?q?ci:=20=E6=B7=BB=E5=8A=A0=20Node.js=20?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test-upgrade-deps.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-upgrade-deps.yml b/.github/workflows/test-upgrade-deps.yml index cc85a1d..a135a28 100644 --- a/.github/workflows/test-upgrade-deps.yml +++ b/.github/workflows/test-upgrade-deps.yml @@ -13,6 +13,8 @@ jobs: steps: - uses: actions/checkout@v6.0.2 + - uses: actions/setup-node@v6.3.0 + - name: test uses: ./actions/upgrade-deps with: From b5c6e1f07ea6e529291e1f2276404a62b4f8d86b Mon Sep 17 00:00:00 2001 From: lwj <674416404@qq.com> Date: Mon, 27 Apr 2026 22:48:22 +0800 Subject: [PATCH 12/40] =?UTF-8?q?ci(workflow):=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=B7=A5=E4=BD=9C=E6=B5=81=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E6=B5=8B=E8=AF=95token?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit test(git-helper): 添加测试token的特殊处理逻辑 --- .github/workflows/test-upgrade-deps.yml | 2 +- packages/upgrade-deps/dist/index.mjs | 1 + packages/utils/git-helper.ts | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-upgrade-deps.yml b/.github/workflows/test-upgrade-deps.yml index a135a28..18bbf0e 100644 --- a/.github/workflows/test-upgrade-deps.yml +++ b/.github/workflows/test-upgrade-deps.yml @@ -18,7 +18,7 @@ jobs: - name: test uses: ./actions/upgrade-deps with: - token: ${{ secrets.GITHUB_TOKEN }} + token: test dry-run: true repo: tdesign-vue owner: Tencent diff --git a/packages/upgrade-deps/dist/index.mjs b/packages/upgrade-deps/dist/index.mjs index 03040e2..214df1f 100644 --- a/packages/upgrade-deps/dist/index.mjs +++ b/packages/upgrade-deps/dist/index.mjs @@ -29805,6 +29805,7 @@ var GitHelper = class { "user.email", GIT_CONFIG.USER_EMAIL ]); + if (this.token == "test") return; await exec("git", [ "config", "--global", diff --git a/packages/utils/git-helper.ts b/packages/utils/git-helper.ts index 7d436e2..92ce6d0 100644 --- a/packages/utils/git-helper.ts +++ b/packages/utils/git-helper.ts @@ -39,6 +39,9 @@ export class GitHelper { private async initConfig(): Promise { await exec('git', ['config', '--global', 'user.name', GIT_CONFIG.USER_NAME]) await exec('git', ['config', '--global', 'user.email', GIT_CONFIG.USER_EMAIL]) + if (this.token == 'test') { + return + } await exec('git', ['config', '--global', `url.https://${this.token}@github.com/.insteadOf`, 'https://github.com/']) } From 6d5540c66cde18dc415bcc37ae9cfbbadb69b74f Mon Sep 17 00:00:00 2001 From: lwj <674416404@qq.com> Date: Mon, 27 Apr 2026 23:02:03 +0800 Subject: [PATCH 13/40] =?UTF-8?q?fix(upgrade-deps):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=E7=89=88=E6=9C=AC=E6=97=A5=E5=BF=97=E5=B9=B6?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=89=88=E6=9C=AC=E8=8E=B7=E5=8F=96=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refactor: 更新@actions/core和@actions/github依赖版本 docs: 为定时器相关函数添加详细注释 --- packages/close-release-issue/dist/index.mjs | 70 ++++++++++++++-- packages/cnb-delete-branch/dist/index.mjs | 64 ++++++++++++++- packages/upgrade-deps/dist/index.mjs | 89 +++++++++++++++++++-- packages/upgrade-deps/main.ts | 4 +- 4 files changed, 209 insertions(+), 18 deletions(-) diff --git a/packages/close-release-issue/dist/index.mjs b/packages/close-release-issue/dist/index.mjs index b15d2c6..0fabf1d 100644 --- a/packages/close-release-issue/dist/index.mjs +++ b/packages/close-release-issue/dist/index.mjs @@ -31,7 +31,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge }) : target, mod)); var __require = /* @__PURE__ */ createRequire(import.meta.url); //#endregion -//#region ../../node_modules/.pnpm/@actions+core@3.0.0/node_modules/@actions/core/lib/utils.js +//#region ../../node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/utils.js /** * Sanitizes an input into a string so it can be passed into issueCommand safely * @param input input to sanitize into a string @@ -59,7 +59,7 @@ function toCommandProperties(annotationProperties) { }; } //#endregion -//#region ../../node_modules/.pnpm/@actions+core@3.0.0/node_modules/@actions/core/lib/command.js +//#region ../../node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/command.js /** * Issues a command to the GitHub Actions runner * @@ -2148,9 +2148,26 @@ var require_timers = /* @__PURE__ */ __commonJSMin(((exports, module) => { * used as a drop-in replacement for the native functions. */ module.exports = { + /** + * The setTimeout() method sets a timer which executes a function once the + * timer expires. + * @param {Function} callback A function to be executed after the timer + * expires. + * @param {number} delay The time, in milliseconds that the timer should + * wait before the specified function or code is executed. + * @param {*} [arg] An optional argument to be passed to the callback function + * when the timer expires. + * @returns {NodeJS.Timeout|FastTimer} + */ setTimeout(callback, delay, arg) { return delay <= RESOLUTION_MS ? setTimeout(callback, delay, arg) : new FastTimer(callback, delay, arg); }, + /** + * The clearTimeout method cancels an instantiated Timer previously created + * by calling setTimeout. + * + * @param {NodeJS.Timeout|FastTimer} timeout + */ clearTimeout(timeout) { if (timeout[kFastTimer]) /** @@ -2159,26 +2176,66 @@ var require_timers = /* @__PURE__ */ __commonJSMin(((exports, module) => { timeout.clear(); else clearTimeout(timeout); }, + /** + * The setFastTimeout() method sets a fastTimer which executes a function once + * the timer expires. + * @param {Function} callback A function to be executed after the timer + * expires. + * @param {number} delay The time, in milliseconds that the timer should + * wait before the specified function or code is executed. + * @param {*} [arg] An optional argument to be passed to the callback function + * when the timer expires. + * @returns {FastTimer} + */ setFastTimeout(callback, delay, arg) { return new FastTimer(callback, delay, arg); }, + /** + * The clearTimeout method cancels an instantiated FastTimer previously + * created by calling setFastTimeout. + * + * @param {FastTimer} timeout + */ clearFastTimeout(timeout) { timeout.clear(); }, + /** + * The now method returns the value of the internal fast timer clock. + * + * @returns {number} + */ now() { return fastNow; }, + /** + * Trigger the onTick function to process the fastTimers array. + * Exported for testing purposes only. + * Marking as deprecated to discourage any use outside of testing. + * @deprecated + * @param {number} [delay=0] The delay in milliseconds to add to the now value. + */ tick(delay = 0) { fastNow += delay - RESOLUTION_MS + 1; onTick(); onTick(); }, + /** + * Reset FastTimers. + * Exported for testing purposes only. + * Marking as deprecated to discourage any use outside of testing. + * @deprecated + */ reset() { fastNow = 0; fastTimers.length = 0; clearTimeout(fastNowTimeout); fastNowTimeout = null; }, + /** + * Exporting for testing purposes only. + * Marking as deprecated to discourage any use outside of testing. + * @deprecated + */ kFastTimer }; })); @@ -3093,6 +3150,7 @@ var require_data_url = /* @__PURE__ */ __commonJSMin(((exports, module) => { const mimeType = { type: typeLowercase, subtype: subtypeLowercase, + /** @type {Map} */ parameters: /* @__PURE__ */ new Map(), essence: `${typeLowercase}/${subtypeLowercase}` }; @@ -15589,7 +15647,7 @@ var MediaTypes; HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect; HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout; //#endregion -//#region ../../node_modules/.pnpm/@actions+core@3.0.0/node_modules/@actions/core/lib/summary.js +//#region ../../node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/summary.js var __awaiter$7 = function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve) { @@ -16152,7 +16210,7 @@ function endGroup() { issue("endgroup"); } //#endregion -//#region ../../node_modules/.pnpm/@actions+github@9.1.0/node_modules/@actions/github/lib/context.js +//#region ../../node_modules/.pnpm/@actions+github@9.1.1/node_modules/@actions/github/lib/context.js var Context = class { /** * Hydrate the context from the environment @@ -16252,7 +16310,7 @@ var require_proxy = /* @__PURE__ */ __commonJSMin(((exports) => { }; })); //#endregion -//#region ../../node_modules/.pnpm/@actions+github@9.1.0/node_modules/@actions/github/lib/internal/utils.js +//#region ../../node_modules/.pnpm/@actions+github@9.1.1/node_modules/@actions/github/lib/internal/utils.js var import_lib = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports) => { var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) { if (k2 === void 0) k2 = k; @@ -19213,7 +19271,7 @@ function getOctokitOptions(token, options) { return opts; } //#endregion -//#region ../../node_modules/.pnpm/@actions+github@9.1.0/node_modules/@actions/github/lib/github.js +//#region ../../node_modules/.pnpm/@actions+github@9.1.1/node_modules/@actions/github/lib/github.js const context = new Context(); /** * Returns a hydrated octokit ready to use for GitHub Actions diff --git a/packages/cnb-delete-branch/dist/index.mjs b/packages/cnb-delete-branch/dist/index.mjs index f4a9a1a..8b512ca 100644 --- a/packages/cnb-delete-branch/dist/index.mjs +++ b/packages/cnb-delete-branch/dist/index.mjs @@ -10,7 +10,7 @@ import "timers"; var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports); var __require = /* @__PURE__ */ createRequire(import.meta.url); //#endregion -//#region ../../node_modules/.pnpm/@actions+core@3.0.0/node_modules/@actions/core/lib/utils.js +//#region ../../node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/utils.js /** * Sanitizes an input into a string so it can be passed into issueCommand safely * @param input input to sanitize into a string @@ -38,7 +38,7 @@ function toCommandProperties(annotationProperties) { }; } //#endregion -//#region ../../node_modules/.pnpm/@actions+core@3.0.0/node_modules/@actions/core/lib/command.js +//#region ../../node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/command.js /** * Issues a command to the GitHub Actions runner * @@ -2085,9 +2085,26 @@ var require_timers = /* @__PURE__ */ __commonJSMin(((exports, module) => { * used as a drop-in replacement for the native functions. */ module.exports = { + /** + * The setTimeout() method sets a timer which executes a function once the + * timer expires. + * @param {Function} callback A function to be executed after the timer + * expires. + * @param {number} delay The time, in milliseconds that the timer should + * wait before the specified function or code is executed. + * @param {*} [arg] An optional argument to be passed to the callback function + * when the timer expires. + * @returns {NodeJS.Timeout|FastTimer} + */ setTimeout(callback, delay, arg) { return delay <= RESOLUTION_MS ? setTimeout(callback, delay, arg) : new FastTimer(callback, delay, arg); }, + /** + * The clearTimeout method cancels an instantiated Timer previously created + * by calling setTimeout. + * + * @param {NodeJS.Timeout|FastTimer} timeout + */ clearTimeout(timeout) { if (timeout[kFastTimer]) /** @@ -2096,26 +2113,66 @@ var require_timers = /* @__PURE__ */ __commonJSMin(((exports, module) => { timeout.clear(); else clearTimeout(timeout); }, + /** + * The setFastTimeout() method sets a fastTimer which executes a function once + * the timer expires. + * @param {Function} callback A function to be executed after the timer + * expires. + * @param {number} delay The time, in milliseconds that the timer should + * wait before the specified function or code is executed. + * @param {*} [arg] An optional argument to be passed to the callback function + * when the timer expires. + * @returns {FastTimer} + */ setFastTimeout(callback, delay, arg) { return new FastTimer(callback, delay, arg); }, + /** + * The clearTimeout method cancels an instantiated FastTimer previously + * created by calling setFastTimeout. + * + * @param {FastTimer} timeout + */ clearFastTimeout(timeout) { timeout.clear(); }, + /** + * The now method returns the value of the internal fast timer clock. + * + * @returns {number} + */ now() { return fastNow; }, + /** + * Trigger the onTick function to process the fastTimers array. + * Exported for testing purposes only. + * Marking as deprecated to discourage any use outside of testing. + * @deprecated + * @param {number} [delay=0] The delay in milliseconds to add to the now value. + */ tick(delay = 0) { fastNow += delay - RESOLUTION_MS + 1; onTick(); onTick(); }, + /** + * Reset FastTimers. + * Exported for testing purposes only. + * Marking as deprecated to discourage any use outside of testing. + * @deprecated + */ reset() { fastNow = 0; fastTimers.length = 0; clearTimeout(fastNowTimeout); fastNowTimeout = null; }, + /** + * Exporting for testing purposes only. + * Marking as deprecated to discourage any use outside of testing. + * @deprecated + */ kFastTimer }; })); @@ -3030,6 +3087,7 @@ var require_data_url = /* @__PURE__ */ __commonJSMin(((exports, module) => { const mimeType = { type: typeLowercase, subtype: subtypeLowercase, + /** @type {Map} */ parameters: /* @__PURE__ */ new Map(), essence: `${typeLowercase}/${subtypeLowercase}` }; @@ -15526,7 +15584,7 @@ var MediaTypes; HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect; HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout; //#endregion -//#region ../../node_modules/.pnpm/@actions+core@3.0.0/node_modules/@actions/core/lib/summary.js +//#region ../../node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/summary.js var __awaiter$6 = function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve) { diff --git a/packages/upgrade-deps/dist/index.mjs b/packages/upgrade-deps/dist/index.mjs index 214df1f..a7d358b 100644 --- a/packages/upgrade-deps/dist/index.mjs +++ b/packages/upgrade-deps/dist/index.mjs @@ -36,7 +36,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge }) : target, mod)); var __require = /* @__PURE__ */ createRequire(import.meta.url); //#endregion -//#region ../../node_modules/.pnpm/@actions+core@3.0.0/node_modules/@actions/core/lib/utils.js +//#region ../../node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/utils.js /** * Sanitizes an input into a string so it can be passed into issueCommand safely * @param input input to sanitize into a string @@ -64,7 +64,7 @@ function toCommandProperties(annotationProperties) { }; } //#endregion -//#region ../../node_modules/.pnpm/@actions+core@3.0.0/node_modules/@actions/core/lib/command.js +//#region ../../node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/command.js /** * Issues a command to the GitHub Actions runner * @@ -2153,9 +2153,26 @@ var require_timers = /* @__PURE__ */ __commonJSMin(((exports, module) => { * used as a drop-in replacement for the native functions. */ module.exports = { + /** + * The setTimeout() method sets a timer which executes a function once the + * timer expires. + * @param {Function} callback A function to be executed after the timer + * expires. + * @param {number} delay The time, in milliseconds that the timer should + * wait before the specified function or code is executed. + * @param {*} [arg] An optional argument to be passed to the callback function + * when the timer expires. + * @returns {NodeJS.Timeout|FastTimer} + */ setTimeout(callback, delay, arg) { return delay <= RESOLUTION_MS ? setTimeout(callback, delay, arg) : new FastTimer(callback, delay, arg); }, + /** + * The clearTimeout method cancels an instantiated Timer previously created + * by calling setTimeout. + * + * @param {NodeJS.Timeout|FastTimer} timeout + */ clearTimeout(timeout) { if (timeout[kFastTimer]) /** @@ -2164,26 +2181,66 @@ var require_timers = /* @__PURE__ */ __commonJSMin(((exports, module) => { timeout.clear(); else clearTimeout(timeout); }, + /** + * The setFastTimeout() method sets a fastTimer which executes a function once + * the timer expires. + * @param {Function} callback A function to be executed after the timer + * expires. + * @param {number} delay The time, in milliseconds that the timer should + * wait before the specified function or code is executed. + * @param {*} [arg] An optional argument to be passed to the callback function + * when the timer expires. + * @returns {FastTimer} + */ setFastTimeout(callback, delay, arg) { return new FastTimer(callback, delay, arg); }, + /** + * The clearTimeout method cancels an instantiated FastTimer previously + * created by calling setFastTimeout. + * + * @param {FastTimer} timeout + */ clearFastTimeout(timeout) { timeout.clear(); }, + /** + * The now method returns the value of the internal fast timer clock. + * + * @returns {number} + */ now() { return fastNow; }, + /** + * Trigger the onTick function to process the fastTimers array. + * Exported for testing purposes only. + * Marking as deprecated to discourage any use outside of testing. + * @deprecated + * @param {number} [delay=0] The delay in milliseconds to add to the now value. + */ tick(delay = 0) { fastNow += delay - RESOLUTION_MS + 1; onTick(); onTick(); }, + /** + * Reset FastTimers. + * Exported for testing purposes only. + * Marking as deprecated to discourage any use outside of testing. + * @deprecated + */ reset() { fastNow = 0; fastTimers.length = 0; clearTimeout(fastNowTimeout); fastNowTimeout = null; }, + /** + * Exporting for testing purposes only. + * Marking as deprecated to discourage any use outside of testing. + * @deprecated + */ kFastTimer }; })); @@ -3098,6 +3155,7 @@ var require_data_url = /* @__PURE__ */ __commonJSMin(((exports, module) => { const mimeType = { type: typeLowercase, subtype: subtypeLowercase, + /** @type {Map} */ parameters: /* @__PURE__ */ new Map(), essence: `${typeLowercase}/${subtypeLowercase}` }; @@ -15594,7 +15652,7 @@ var MediaTypes; HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect; HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout; //#endregion -//#region ../../node_modules/.pnpm/@actions+core@3.0.0/node_modules/@actions/core/lib/summary.js +//#region ../../node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/summary.js var __awaiter$7 = function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve) { @@ -16617,7 +16675,7 @@ function endGroup() { issue("endgroup"); } //#endregion -//#region ../../node_modules/.pnpm/@actions+github@9.1.0/node_modules/@actions/github/lib/context.js +//#region ../../node_modules/.pnpm/@actions+github@9.1.1/node_modules/@actions/github/lib/context.js var Context = class { /** * Hydrate the context from the environment @@ -16717,7 +16775,7 @@ var require_proxy = /* @__PURE__ */ __commonJSMin(((exports) => { }; })); //#endregion -//#region ../../node_modules/.pnpm/@actions+github@9.1.0/node_modules/@actions/github/lib/internal/utils.js +//#region ../../node_modules/.pnpm/@actions+github@9.1.1/node_modules/@actions/github/lib/internal/utils.js var import_lib$2 = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports) => { var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) { if (k2 === void 0) k2 = k; @@ -19678,7 +19736,7 @@ function getOctokitOptions(token, options) { return opts; } //#endregion -//#region ../../node_modules/.pnpm/@actions+github@9.1.0/node_modules/@actions/github/lib/github.js +//#region ../../node_modules/.pnpm/@actions+github@9.1.1/node_modules/@actions/github/lib/github.js const context = new Context(); /** * Returns a hydrated octokit ready to use for GitHub Actions @@ -22482,6 +22540,11 @@ var require_anchors = /* @__PURE__ */ __commonJSMin(((exports) => { prevAnchors.add(anchor); return anchor; }, + /** + * With circular references, the source node is only resolved after all + * of its child nodes are. This is why anchors are set only after all of + * the nodes have been created. + */ setAnchors: () => { for (const source of aliasObjects) { const ref = sourceObjects.get(source); @@ -24229,6 +24292,14 @@ var require_binary = /* @__PURE__ */ __commonJSMin(((exports) => { identify: (value) => value instanceof Uint8Array, default: false, tag: "tag:yaml.org,2002:binary", + /** + * Returns a Buffer in node and an Uint8Array in browsers + * + * To use the resulting buffer as an image, you'll want to do something like: + * + * const blob = new Blob([buffer], { type: 'image/jpeg' }) + * document.querySelector('#photo').src = URL.createObjectURL(blob) + */ resolve(src, onError) { if (typeof node_buffer.Buffer === "function") return node_buffer.Buffer.from(src, "base64"); else if (typeof atob === "function") { @@ -29026,7 +29097,7 @@ var require_equals = /* @__PURE__ */ __commonJSMin(((exports, module) => { }); })); //#endregion -//#region ../../node_modules/.pnpm/tsdown@0.21.9_@typescript+native-preview@7.0.0-dev.20260419.1_synckit@0.11.12_typescript@5.9.3/node_modules/tsdown/esm-shims.js +//#region ../../node_modules/.pnpm/tsdown@0.21.10_@typescript+native-preview@7.0.0-dev.20260427.1_synckit@0.11.12_typescript@5.9.3/node_modules/tsdown/esm-shims.js var getFilename, __filename; var init_esm_shims = __esmMin((() => { getFilename = () => fileURLToPath(import.meta.url); @@ -30115,9 +30186,11 @@ async function getPkgLatestVersion(pkgNames) { pkg, "version" ]); + const version = stdout.trim(); + info(`Latest version of ${pkg} is ${version}`); results.push({ name: pkg, - version: stdout.trim() + version }); } return results; diff --git a/packages/upgrade-deps/main.ts b/packages/upgrade-deps/main.ts index 851e94b..99cde02 100644 --- a/packages/upgrade-deps/main.ts +++ b/packages/upgrade-deps/main.ts @@ -113,9 +113,11 @@ async function getPkgLatestVersion(pkgNames: string[]): Promise Date: Mon, 27 Apr 2026 23:10:27 +0800 Subject: [PATCH 14/40] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=E9=A1=B9=E5=88=97=E8=A1=A8=E7=9A=84=E8=B0=83=E8=AF=95?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/upgrade-deps/dist/index.mjs | 1 + packages/upgrade-deps/main.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/upgrade-deps/dist/index.mjs b/packages/upgrade-deps/dist/index.mjs index a7d358b..dabdb6a 100644 --- a/packages/upgrade-deps/dist/index.mjs +++ b/packages/upgrade-deps/dist/index.mjs @@ -30223,6 +30223,7 @@ async function createDepsPr(title, branchName, baseBranch, context) { async function updateDependencies(context) { const packageManager = getInput("package-manager") || "npm"; const deps = getMultilineInput("deps", { required: true }); + info(`deps: ${JSON.stringify(deps)}`); if (!deps.length) throw new ActionError(ERROR_MESSAGES.MISSING_DEPS, { trigger: context.trigger }); const depInfos = await getPkgLatestVersion(deps); if (packageManager !== "npm") await corepackEnable(); diff --git a/packages/upgrade-deps/main.ts b/packages/upgrade-deps/main.ts index 99cde02..d2c505b 100644 --- a/packages/upgrade-deps/main.ts +++ b/packages/upgrade-deps/main.ts @@ -158,7 +158,8 @@ async function createDepsPr( export async function updateDependencies(context: TriggerContext): Promise { const packageManager = core.getInput('package-manager') || 'npm' const deps = core.getMultilineInput('deps', { required: true }) - + core.info(`deps: ${JSON.stringify(deps)}`) + if (!deps.length) { throw new ActionError(ERROR_MESSAGES.MISSING_DEPS, { trigger: context.trigger }) } From 5e46d3e8db1f734fbc1b8094ca95d57e497898ad Mon Sep 17 00:00:00 2001 From: lwj <674416404@qq.com> Date: Mon, 27 Apr 2026 23:15:05 +0800 Subject: [PATCH 15/40] =?UTF-8?q?style:=20=E7=A7=BB=E9=99=A4=E5=A4=9A?= =?UTF-8?q?=E4=BD=99=E7=A9=BA=E6=A0=BC=E5=B9=B6=E4=BF=AE=E5=A4=8D=E4=B8=A5?= =?UTF-8?q?=E6=A0=BC=E7=9B=B8=E7=AD=89=E6=AF=94=E8=BE=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在 main.ts 中移除多余空行,在 git-helper.ts 中将 == 改为 === 进行严格比较 --- packages/upgrade-deps/main.ts | 2 +- packages/utils/git-helper.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/upgrade-deps/main.ts b/packages/upgrade-deps/main.ts index d2c505b..d76750e 100644 --- a/packages/upgrade-deps/main.ts +++ b/packages/upgrade-deps/main.ts @@ -159,7 +159,7 @@ export async function updateDependencies(context: TriggerContext): Promise const packageManager = core.getInput('package-manager') || 'npm' const deps = core.getMultilineInput('deps', { required: true }) core.info(`deps: ${JSON.stringify(deps)}`) - + if (!deps.length) { throw new ActionError(ERROR_MESSAGES.MISSING_DEPS, { trigger: context.trigger }) } diff --git a/packages/utils/git-helper.ts b/packages/utils/git-helper.ts index 92ce6d0..75a3720 100644 --- a/packages/utils/git-helper.ts +++ b/packages/utils/git-helper.ts @@ -39,7 +39,7 @@ export class GitHelper { private async initConfig(): Promise { await exec('git', ['config', '--global', 'user.name', GIT_CONFIG.USER_NAME]) await exec('git', ['config', '--global', 'user.email', GIT_CONFIG.USER_EMAIL]) - if (this.token == 'test') { + if (this.token === 'test') { return } await exec('git', ['config', '--global', `url.https://${this.token}@github.com/.insteadOf`, 'https://github.com/']) From 0199aea0549dcdfbb354f8ed3af5800056f5b3a3 Mon Sep 17 00:00:00 2001 From: lwj <674416404@qq.com> Date: Mon, 27 Apr 2026 23:18:38 +0800 Subject: [PATCH 16/40] =?UTF-8?q?fix(upgrade-deps):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=E9=A1=B9=E8=BE=93=E5=85=A5=E7=9A=84=E7=A9=BA?= =?UTF-8?q?=E6=A0=BC=E5=A4=84=E7=90=86=E5=B9=B6=E6=B7=BB=E5=8A=A0=E8=B0=83?= =?UTF-8?q?=E8=AF=95=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在获取依赖项输入时添加trimWhitespace选项以去除空格 添加depInfos的调试日志输出以便排查问题 --- packages/upgrade-deps/main.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/upgrade-deps/main.ts b/packages/upgrade-deps/main.ts index d76750e..b7f8180 100644 --- a/packages/upgrade-deps/main.ts +++ b/packages/upgrade-deps/main.ts @@ -157,7 +157,7 @@ async function createDepsPr( export async function updateDependencies(context: TriggerContext): Promise { const packageManager = core.getInput('package-manager') || 'npm' - const deps = core.getMultilineInput('deps', { required: true }) + const deps = core.getMultilineInput('deps', { required: true,trimWhitespace:true }) core.info(`deps: ${JSON.stringify(deps)}`) if (!deps.length) { @@ -165,6 +165,7 @@ export async function updateDependencies(context: TriggerContext): Promise } const depInfos = await getPkgLatestVersion(deps) + core.info(`depInfos: ${JSON.stringify(depInfos)}`) if (packageManager !== 'npm') { await corepackEnable() From b4aa9d03d6e41108f2e02a2a171d8fad73646861 Mon Sep 17 00:00:00 2001 From: lwj <674416404@qq.com> Date: Mon, 27 Apr 2026 23:53:37 +0800 Subject: [PATCH 17/40] =?UTF-8?q?feat(upgrade-deps):=20=E4=BD=BF=E7=94=A8n?= =?UTF-8?q?pm=20registry=20API=E8=8E=B7=E5=8F=96=E6=9C=80=E6=96=B0?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 替换原有的npm CLI命令方式,改为通过npm registry API直接获取包的最新版本信息 添加错误处理和警告日志,当获取包信息失败时跳过该包而不是终止流程 --- packages/upgrade-deps/dist/index.mjs | 292 ++++++++++++++------------- packages/upgrade-deps/main.ts | 17 +- packages/utils/index.ts | 2 +- 3 files changed, 168 insertions(+), 143 deletions(-) diff --git a/packages/upgrade-deps/dist/index.mjs b/packages/upgrade-deps/dist/index.mjs index dabdb6a..4ac5aa9 100644 --- a/packages/upgrade-deps/dist/index.mjs +++ b/packages/upgrade-deps/dist/index.mjs @@ -16652,6 +16652,14 @@ function error(message, properties = {}) { issueCommand("error", toCommandProperties(properties), message instanceof Error ? message.toString() : message); } /** +* Adds a warning issue +* @param message warning issue message. Errors will be converted to string via toString() +* @param properties optional properties to add to the annotation. +*/ +function warning(message, properties = {}) { + issueCommand("warning", toCommandProperties(properties), message instanceof Error ? message.toString() : message); +} +/** * Writes info to log with console.log. * @param message info message */ @@ -29835,9 +29843,136 @@ var require_lib = /* @__PURE__ */ __commonJSMin(((exports) => { } })); //#endregion -//#region ../utils/constants.ts +//#region ../utils/github-helper.ts var import_lib$1 = require_lib$4(); var import_lib = require_lib(); +var GithubHelper = class { + octokit; + context; + constructor(context) { + this.context = context; + this.octokit = getOctokit(context.token); + } + async dryRunLog(methodName, params) { + if (!this.context.dryRun) return false; + startGroup(`dry-run模式, 不运行${methodName}`); + for (const [key, value] of Object.entries(params)) info(`${key}: ${typeof value === "string" ? value : JSON.stringify(value)}`); + endGroup(); + return true; + } + get defaultRepoParams() { + return { + owner: this.context.owner, + repo: this.context.repo + }; + } + async getPrData(prNumber) { + try { + const { data } = await this.octokit.rest.pulls.get({ + ...this.defaultRepoParams, + pull_number: prNumber + }); + return data; + } catch (error$3) { + error(`获取PR数据失败: ${error$3}`); + throw error$3; + } + } + async getIssueData(issueNumber) { + try { + const { data } = await this.octokit.rest.issues.get({ + ...this.defaultRepoParams, + issue_number: issueNumber + }); + return data; + } catch (error$5) { + error(`获取Issue数据失败: ${error$5}`); + throw error$5; + } + } + async getIssueList(params) { + try { + const { data } = await this.octokit.rest.issues.listForRepo({ + ...params, + ...this.defaultRepoParams + }); + return data.filter((item) => !item?.pull_request); + } catch (error$4) { + error(`获取Issue列表失败: ${error$4}`); + throw error$4; + } + } + async closeIssue(issueNumber) { + if (await this.dryRunLog("closeIssue", { issueNumber })) return; + try { + await this.octokit.rest.issues.update({ + ...this.defaultRepoParams, + issue_number: issueNumber, + state: "closed" + }); + } catch (error$6) { + error(`关闭Issue失败: ${error$6}`); + throw error$6; + } + } + async createPR(title, head, body, base = "develop") { + if (await this.dryRunLog("createPR", { + title, + head, + base, + body + })) return; + try { + const { data } = await this.octokit.rest.pulls.create({ + ...this.defaultRepoParams, + title, + head, + base, + body + }); + return data; + } catch (error$1) { + error(`创建PR失败: ${error$1}`); + throw error$1; + } + } + async addComment(issueNumber, body) { + if (await this.dryRunLog("addComment", { + issueNumber, + body + })) return; + try { + const { data } = await this.octokit.rest.issues.createComment({ + ...this.defaultRepoParams, + issue_number: issueNumber, + body + }); + return data; + } catch (error$2) { + error(`添加评论失败: ${error$2}`); + throw error$2; + } + } + async addLabels(issueNumber, labels) { + if (await this.dryRunLog("addLabels", { + issueNumber, + labels: labels.join(", ") + })) return; + try { + const { data } = await this.octokit.rest.issues.addLabels({ + ...this.defaultRepoParams, + issue_number: issueNumber, + labels + }); + return data; + } catch (error$7) { + error(`添加标签失败: ${error$7}`); + throw error$7; + } + } +}; +//#endregion +//#region ../utils/constants.ts const GIT_CONFIG = { USER_NAME: "tdesign-bot", USER_EMAIL: "tdesign@tencent.com" @@ -29876,7 +30011,7 @@ var GitHelper = class { "user.email", GIT_CONFIG.USER_EMAIL ]); - if (this.token == "test") return; + if (this.token === "test") return; await exec("git", [ "config", "--global", @@ -29998,133 +30133,6 @@ var GitHelper = class { } }; //#endregion -//#region ../utils/github-helper.ts -var GithubHelper = class { - octokit; - context; - constructor(context) { - this.context = context; - this.octokit = getOctokit(context.token); - } - async dryRunLog(methodName, params) { - if (!this.context.dryRun) return false; - startGroup(`dry-run模式, 不运行${methodName}`); - for (const [key, value] of Object.entries(params)) info(`${key}: ${typeof value === "string" ? value : JSON.stringify(value)}`); - endGroup(); - return true; - } - get defaultRepoParams() { - return { - owner: this.context.owner, - repo: this.context.repo - }; - } - async getPrData(prNumber) { - try { - const { data } = await this.octokit.rest.pulls.get({ - ...this.defaultRepoParams, - pull_number: prNumber - }); - return data; - } catch (error$3) { - error(`获取PR数据失败: ${error$3}`); - throw error$3; - } - } - async getIssueData(issueNumber) { - try { - const { data } = await this.octokit.rest.issues.get({ - ...this.defaultRepoParams, - issue_number: issueNumber - }); - return data; - } catch (error$5) { - error(`获取Issue数据失败: ${error$5}`); - throw error$5; - } - } - async getIssueList(params) { - try { - const { data } = await this.octokit.rest.issues.listForRepo({ - ...params, - ...this.defaultRepoParams - }); - return data.filter((item) => !item?.pull_request); - } catch (error$4) { - error(`获取Issue列表失败: ${error$4}`); - throw error$4; - } - } - async closeIssue(issueNumber) { - if (await this.dryRunLog("closeIssue", { issueNumber })) return; - try { - await this.octokit.rest.issues.update({ - ...this.defaultRepoParams, - issue_number: issueNumber, - state: "closed" - }); - } catch (error$6) { - error(`关闭Issue失败: ${error$6}`); - throw error$6; - } - } - async createPR(title, head, body, base = "develop") { - if (await this.dryRunLog("createPR", { - title, - head, - base, - body - })) return; - try { - const { data } = await this.octokit.rest.pulls.create({ - ...this.defaultRepoParams, - title, - head, - base, - body - }); - return data; - } catch (error$1) { - error(`创建PR失败: ${error$1}`); - throw error$1; - } - } - async addComment(issueNumber, body) { - if (await this.dryRunLog("addComment", { - issueNumber, - body - })) return; - try { - const { data } = await this.octokit.rest.issues.createComment({ - ...this.defaultRepoParams, - issue_number: issueNumber, - body - }); - return data; - } catch (error$2) { - error(`添加评论失败: ${error$2}`); - throw error$2; - } - } - async addLabels(issueNumber, labels) { - if (await this.dryRunLog("addLabels", { - issueNumber, - labels: labels.join(", ") - })) return; - try { - const { data } = await this.octokit.rest.issues.addLabels({ - ...this.defaultRepoParams, - issue_number: issueNumber, - labels - }); - return data; - } catch (error$7) { - error(`添加标签失败: ${error$7}`); - throw error$7; - } - } -}; -//#endregion //#region main.ts function getBranchName(deps) { return `chore(deps): upgrade-${deps.map((d) => `${d.name}-${d.version}`).join("-")}`; @@ -30181,16 +30189,20 @@ async function updatePnpmCatalog(deps, repoPath) { async function getPkgLatestVersion(pkgNames) { const results = []; for (const pkg of pkgNames) { - const { stdout } = await getExecOutput("npm", [ - "view", - pkg, - "version" - ]); - const version = stdout.trim(); - info(`Latest version of ${pkg} is ${version}`); + const response = await fetch(`https://registry.npmjs.org/${pkg}/latest`); + if (!response.ok) { + warning(`Failed to get ${pkg} info from npm registry, status code: ${response.status}`); + continue; + } + const latest = (await response.json())["version"]; + if (!latest) { + warning(`No version found for ${pkg}`); + continue; + } + info(`Latest version of ${pkg} is ${latest}`); results.push({ name: pkg, - version + version: latest }); } return results; @@ -30222,10 +30234,14 @@ async function createDepsPr(title, branchName, baseBranch, context) { } async function updateDependencies(context) { const packageManager = getInput("package-manager") || "npm"; - const deps = getMultilineInput("deps", { required: true }); + const deps = getMultilineInput("deps", { + required: true, + trimWhitespace: true + }); info(`deps: ${JSON.stringify(deps)}`); if (!deps.length) throw new ActionError(ERROR_MESSAGES.MISSING_DEPS, { trigger: context.trigger }); const depInfos = await getPkgLatestVersion(deps); + info(`depInfos: ${JSON.stringify(depInfos)}`); if (packageManager !== "npm") await corepackEnable(); const gitHelper = new GitHelper({ repo: context.repo, diff --git a/packages/upgrade-deps/main.ts b/packages/upgrade-deps/main.ts index b7f8180..c45575a 100644 --- a/packages/upgrade-deps/main.ts +++ b/packages/upgrade-deps/main.ts @@ -112,12 +112,21 @@ async function updatePnpmCatalog(deps: DependencyInfo[], repoPath: string): Prom async function getPkgLatestVersion(pkgNames: string[]): Promise { const results: DependencyInfo[] = [] for (const pkg of pkgNames) { - const { stdout } = await exec.getExecOutput('npm', ['view', pkg, 'version']) - const version = stdout.trim() - core.info(`Latest version of ${pkg} is ${version}`) + const response = await fetch(`https://registry.npmjs.org/${pkg}/latest`) + if (!response.ok) { + core.warning(`Failed to get ${pkg} info from npm registry, status code: ${response.status}`) + continue + } + const info = await response.json() as { 'version'?: string } + const latest = info['version'] + if (!latest) { + core.warning(`No version found for ${pkg}`) + continue + } + core.info(`Latest version of ${pkg} is ${latest}`) results.push({ name: pkg, - version, + version: latest, }) } return results diff --git a/packages/utils/index.ts b/packages/utils/index.ts index b2d412e..8fa1e69 100644 --- a/packages/utils/index.ts +++ b/packages/utils/index.ts @@ -1,2 +1,2 @@ -export * from './git-helper' export * from './github-helper' +export * from './git-helper' From ec62d51355363485d6cbacff2a44ad7c9be63df4 Mon Sep 17 00:00:00 2001 From: lwj <674416404@qq.com> Date: Mon, 27 Apr 2026 23:59:07 +0800 Subject: [PATCH 18/40] =?UTF-8?q?fix:=20=E7=BC=96=E7=A0=81=20npm=20?= =?UTF-8?q?=E5=8C=85=E5=90=8D=E4=BB=A5=E6=AD=A3=E7=A1=AE=E5=A4=84=E7=90=86?= =?UTF-8?q?=E7=89=B9=E6=AE=8A=E5=AD=97=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/upgrade-deps/main.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/upgrade-deps/main.ts b/packages/upgrade-deps/main.ts index c45575a..df40609 100644 --- a/packages/upgrade-deps/main.ts +++ b/packages/upgrade-deps/main.ts @@ -112,20 +112,21 @@ async function updatePnpmCatalog(deps: DependencyInfo[], repoPath: string): Prom async function getPkgLatestVersion(pkgNames: string[]): Promise { const results: DependencyInfo[] = [] for (const pkg of pkgNames) { - const response = await fetch(`https://registry.npmjs.org/${pkg}/latest`) + const encodedPkgName = encodeURIComponent(pkg) + const response = await fetch(`https://registry.npmjs.org/${encodedPkgName}/latest`) if (!response.ok) { - core.warning(`Failed to get ${pkg} info from npm registry, status code: ${response.status}`) + core.warning(`Failed to get ${encodedPkgName} info from npm registry, status code: ${response.status}`) continue } const info = await response.json() as { 'version'?: string } const latest = info['version'] if (!latest) { - core.warning(`No version found for ${pkg}`) + core.warning(`No version found for ${encodedPkgName}`) continue } - core.info(`Latest version of ${pkg} is ${latest}`) + core.info(`Latest version of ${encodedPkgName} is ${latest}`) results.push({ - name: pkg, + name: encodedPkgName, version: latest, }) } From bede7e7cbc7f4c8b9c5a2f4a18895e61521ed952 Mon Sep 17 00:00:00 2001 From: lwj <674416404@qq.com> Date: Mon, 27 Apr 2026 23:59:37 +0800 Subject: [PATCH 19/40] =?UTF-8?q?fix:=20=E5=B0=86npm=E5=8C=85=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E6=A3=80=E6=9F=A5=E7=9A=84=E8=AD=A6=E5=91=8A=E5=8D=87?= =?UTF-8?q?=E7=BA=A7=E4=B8=BA=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将获取npm包最新版本时的警告信息(core.warning)改为错误信息(core.error),以更明确地标识获取包信息失败的情况 --- packages/upgrade-deps/main.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/upgrade-deps/main.ts b/packages/upgrade-deps/main.ts index df40609..1f8281a 100644 --- a/packages/upgrade-deps/main.ts +++ b/packages/upgrade-deps/main.ts @@ -115,13 +115,13 @@ async function getPkgLatestVersion(pkgNames: string[]): Promise Date: Tue, 28 Apr 2026 00:03:22 +0800 Subject: [PATCH 20/40] =?UTF-8?q?fix(upgrade-deps):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=E5=8C=85=E5=90=8D=E7=A7=B0=E5=A4=84=E7=90=86?= =?UTF-8?q?=E5=92=8C=E9=94=99=E8=AF=AF=E6=97=A5=E5=BF=97=E7=BA=A7=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 使用原始包名而非编码后的名称显示错误信息 - 将警告日志升级为错误日志以提高可见性 - 添加对依赖项名称中引号的清理处理 --- packages/upgrade-deps/dist/index.mjs | 16 ++++------------ packages/upgrade-deps/main.ts | 9 +++++---- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/packages/upgrade-deps/dist/index.mjs b/packages/upgrade-deps/dist/index.mjs index 4ac5aa9..710338f 100644 --- a/packages/upgrade-deps/dist/index.mjs +++ b/packages/upgrade-deps/dist/index.mjs @@ -16652,14 +16652,6 @@ function error(message, properties = {}) { issueCommand("error", toCommandProperties(properties), message instanceof Error ? message.toString() : message); } /** -* Adds a warning issue -* @param message warning issue message. Errors will be converted to string via toString() -* @param properties optional properties to add to the annotation. -*/ -function warning(message, properties = {}) { - issueCommand("warning", toCommandProperties(properties), message instanceof Error ? message.toString() : message); -} -/** * Writes info to log with console.log. * @param message info message */ @@ -30189,14 +30181,14 @@ async function updatePnpmCatalog(deps, repoPath) { async function getPkgLatestVersion(pkgNames) { const results = []; for (const pkg of pkgNames) { - const response = await fetch(`https://registry.npmjs.org/${pkg}/latest`); + const response = await fetch(`https://registry.npmjs.org/${encodeURIComponent(pkg)}/latest`); if (!response.ok) { - warning(`Failed to get ${pkg} info from npm registry, status code: ${response.status}`); + error(`Failed to get ${pkg} info from npm registry, status code: ${response.status}`); continue; } const latest = (await response.json())["version"]; if (!latest) { - warning(`No version found for ${pkg}`); + error(`No version found for ${pkg}`); continue; } info(`Latest version of ${pkg} is ${latest}`); @@ -30237,7 +30229,7 @@ async function updateDependencies(context) { const deps = getMultilineInput("deps", { required: true, trimWhitespace: true - }); + }).map((dep) => dep.replace(/^['"]|['"]$/g, "")); info(`deps: ${JSON.stringify(deps)}`); if (!deps.length) throw new ActionError(ERROR_MESSAGES.MISSING_DEPS, { trigger: context.trigger }); const depInfos = await getPkgLatestVersion(deps); diff --git a/packages/upgrade-deps/main.ts b/packages/upgrade-deps/main.ts index 1f8281a..294b833 100644 --- a/packages/upgrade-deps/main.ts +++ b/packages/upgrade-deps/main.ts @@ -115,18 +115,18 @@ async function getPkgLatestVersion(pkgNames: string[]): Promise { const packageManager = core.getInput('package-manager') || 'npm' const deps = core.getMultilineInput('deps', { required: true,trimWhitespace:true }) + .map(dep => dep.replace(/^['"]|['"]$/g, '')) core.info(`deps: ${JSON.stringify(deps)}`) if (!deps.length) { From c1434104d37d7aef203396e0f84fc2f1e8e092ee Mon Sep 17 00:00:00 2001 From: lwj <674416404@qq.com> Date: Tue, 28 Apr 2026 00:06:14 +0800 Subject: [PATCH 21/40] =?UTF-8?q?fix(upgrade-deps):=20=E7=A7=BB=E9=99=A4np?= =?UTF-8?q?m=E5=8C=85=E5=90=8D=E7=BC=96=E7=A0=81=E4=BB=A5=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E4=BE=9D=E8=B5=96=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 不再对npm包名进行URI编码,因为npm registry可以直接处理未编码的包名。这修复了某些特殊包名无法正确查询的问题。 --- .github/workflows/test-upgrade-deps.yml | 4 ++-- packages/upgrade-deps/dist/index.mjs | 2 +- packages/upgrade-deps/main.ts | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-upgrade-deps.yml b/.github/workflows/test-upgrade-deps.yml index 18bbf0e..038d50f 100644 --- a/.github/workflows/test-upgrade-deps.yml +++ b/.github/workflows/test-upgrade-deps.yml @@ -23,5 +23,5 @@ jobs: repo: tdesign-vue owner: Tencent deps: | - '@tdesign/site-components' - '@tdesign/theme-generator' + @tdesign/site-components + @tdesign/theme-generator diff --git a/packages/upgrade-deps/dist/index.mjs b/packages/upgrade-deps/dist/index.mjs index 710338f..c146daf 100644 --- a/packages/upgrade-deps/dist/index.mjs +++ b/packages/upgrade-deps/dist/index.mjs @@ -30181,7 +30181,7 @@ async function updatePnpmCatalog(deps, repoPath) { async function getPkgLatestVersion(pkgNames) { const results = []; for (const pkg of pkgNames) { - const response = await fetch(`https://registry.npmjs.org/${encodeURIComponent(pkg)}/latest`); + const response = await fetch(`https://registry.npmjs.org/${pkg}/latest`); if (!response.ok) { error(`Failed to get ${pkg} info from npm registry, status code: ${response.status}`); continue; diff --git a/packages/upgrade-deps/main.ts b/packages/upgrade-deps/main.ts index 294b833..f9bb5d8 100644 --- a/packages/upgrade-deps/main.ts +++ b/packages/upgrade-deps/main.ts @@ -112,8 +112,7 @@ async function updatePnpmCatalog(deps: DependencyInfo[], repoPath: string): Prom async function getPkgLatestVersion(pkgNames: string[]): Promise { const results: DependencyInfo[] = [] for (const pkg of pkgNames) { - const encodedPkgName = encodeURIComponent(pkg) - const response = await fetch(`https://registry.npmjs.org/${encodedPkgName}/latest`) + const response = await fetch(`https://registry.npmjs.org/${pkg}/latest`) if (!response.ok) { core.error(`Failed to get ${pkg} info from npm registry, status code: ${response.status}`) continue From 9842e915b0a81788f4cf03c90f975aff70c505a5 Mon Sep 17 00:00:00 2001 From: lwj <674416404@qq.com> Date: Tue, 28 Apr 2026 00:06:49 +0800 Subject: [PATCH 22/40] =?UTF-8?q?fix:=20=E7=A7=BB=E9=99=A4=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=E9=A1=B9=E5=90=8D=E7=A7=B0=E7=9A=84=E5=BC=95=E5=8F=B7?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/upgrade-deps/dist/index.mjs | 2 +- packages/upgrade-deps/main.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/upgrade-deps/dist/index.mjs b/packages/upgrade-deps/dist/index.mjs index c146daf..53553bc 100644 --- a/packages/upgrade-deps/dist/index.mjs +++ b/packages/upgrade-deps/dist/index.mjs @@ -30229,7 +30229,7 @@ async function updateDependencies(context) { const deps = getMultilineInput("deps", { required: true, trimWhitespace: true - }).map((dep) => dep.replace(/^['"]|['"]$/g, "")); + }); info(`deps: ${JSON.stringify(deps)}`); if (!deps.length) throw new ActionError(ERROR_MESSAGES.MISSING_DEPS, { trigger: context.trigger }); const depInfos = await getPkgLatestVersion(deps); diff --git a/packages/upgrade-deps/main.ts b/packages/upgrade-deps/main.ts index f9bb5d8..0fb02cf 100644 --- a/packages/upgrade-deps/main.ts +++ b/packages/upgrade-deps/main.ts @@ -167,7 +167,6 @@ async function createDepsPr( export async function updateDependencies(context: TriggerContext): Promise { const packageManager = core.getInput('package-manager') || 'npm' const deps = core.getMultilineInput('deps', { required: true,trimWhitespace:true }) - .map(dep => dep.replace(/^['"]|['"]$/g, '')) core.info(`deps: ${JSON.stringify(deps)}`) if (!deps.length) { From 778fc664e898f8319720e7898e48188da82e46a2 Mon Sep 17 00:00:00 2001 From: lwj <674416404@qq.com> Date: Tue, 28 Apr 2026 00:12:52 +0800 Subject: [PATCH 23/40] =?UTF-8?q?fix(upgrade-deps):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=E5=90=8D=E7=A7=B0=E4=B8=AD=E7=9A=84=E7=89=B9?= =?UTF-8?q?=E6=AE=8A=E5=AD=97=E7=AC=A6=E5=AF=BC=E8=87=B4=E5=88=86=E6=94=AF?= =?UTF-8?q?=E5=90=8D=E7=94=9F=E6=88=90=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在生成依赖升级分支名时,处理依赖名称中的特殊字符,将其替换为连字符以避免生成无效的分支名 --- packages/upgrade-deps/dist/index.mjs | 2 +- packages/upgrade-deps/main.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/upgrade-deps/dist/index.mjs b/packages/upgrade-deps/dist/index.mjs index 53553bc..65ef6cd 100644 --- a/packages/upgrade-deps/dist/index.mjs +++ b/packages/upgrade-deps/dist/index.mjs @@ -30127,7 +30127,7 @@ var GitHelper = class { //#endregion //#region main.ts function getBranchName(deps) { - return `chore(deps): upgrade-${deps.map((d) => `${d.name}-${d.version}`).join("-")}`; + return `chore(deps): upgrade-${deps.map((d) => `${d.name.replace(/[@:\/\\<>|\*\?\[\]^~`']/g, "-")}-${d.version}`).join("-")}`; } function getPrTitle(deps) { return `chore: upgrade ${deps.map((d) => `${d.name} to ${d.version}`).join(", ")}`; diff --git a/packages/upgrade-deps/main.ts b/packages/upgrade-deps/main.ts index 0fb02cf..188bae8 100644 --- a/packages/upgrade-deps/main.ts +++ b/packages/upgrade-deps/main.ts @@ -8,7 +8,7 @@ import { readWorkspaceManifest } from '@pnpm/workspace.read-manifest' import { GitHelper, GithubHelper } from '@workflows/utils' function getBranchName(deps: Array<{ name: string, version: string }>): string { - const depsSlug = deps.map(d => `${d.name}-${d.version}`).join('-') + const depsSlug = deps.map(d => `${d.name.replace(/[@:\/\\<>|\*\?\[\]^~`']/g, '-')}-${d.version}`).join('-') return `chore(deps): upgrade-${depsSlug}` } From 3b3315aba5d37a69ee0a9a17f1afad0ddb9e26ea Mon Sep 17 00:00:00 2001 From: lwj <674416404@qq.com> Date: Tue, 28 Apr 2026 00:16:19 +0800 Subject: [PATCH 24/40] =?UTF-8?q?refactor(upgrade-deps):=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=BE=9D=E8=B5=96=E5=8D=87=E7=BA=A7=E5=88=86=E6=94=AF?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将分支名称从 'chore(deps): upgrade-...' 格式改为 'chore/deps/upgrade-...' 格式,以保持命名一致性 --- packages/upgrade-deps/dist/index.mjs | 2 +- packages/upgrade-deps/main.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/upgrade-deps/dist/index.mjs b/packages/upgrade-deps/dist/index.mjs index 65ef6cd..d1961ae 100644 --- a/packages/upgrade-deps/dist/index.mjs +++ b/packages/upgrade-deps/dist/index.mjs @@ -30127,7 +30127,7 @@ var GitHelper = class { //#endregion //#region main.ts function getBranchName(deps) { - return `chore(deps): upgrade-${deps.map((d) => `${d.name.replace(/[@:\/\\<>|\*\?\[\]^~`']/g, "-")}-${d.version}`).join("-")}`; + return `chore/deps/upgrade-${deps.map((d) => `${d.name.replace(/[@:\/\\<>|\*\?\[\]^~`']/g, "-")}-${d.version}`).join("-")}`; } function getPrTitle(deps) { return `chore: upgrade ${deps.map((d) => `${d.name} to ${d.version}`).join(", ")}`; diff --git a/packages/upgrade-deps/main.ts b/packages/upgrade-deps/main.ts index 188bae8..9862622 100644 --- a/packages/upgrade-deps/main.ts +++ b/packages/upgrade-deps/main.ts @@ -9,7 +9,7 @@ import { GitHelper, GithubHelper } from '@workflows/utils' function getBranchName(deps: Array<{ name: string, version: string }>): string { const depsSlug = deps.map(d => `${d.name.replace(/[@:\/\\<>|\*\?\[\]^~`']/g, '-')}-${d.version}`).join('-') - return `chore(deps): upgrade-${depsSlug}` + return `chore/deps/upgrade-${depsSlug}` } function getPrTitle(deps: Array<{ name: string, version: string }>): string { From e03a448c45e9048b861add472ae68466edd7da76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Tue, 28 Apr 2026 09:24:59 +0800 Subject: [PATCH 25/40] =?UTF-8?q?refactor:=20=E4=BC=98=E5=8C=96=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=E5=90=8D=E7=A7=B0=E5=A4=84=E7=90=86=E5=92=8C=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/upgrade-deps/dist/index.mjs | 260 +++++++++++++-------------- packages/upgrade-deps/main.ts | 8 +- packages/utils/index.ts | 2 +- 3 files changed, 135 insertions(+), 135 deletions(-) diff --git a/packages/upgrade-deps/dist/index.mjs b/packages/upgrade-deps/dist/index.mjs index d1961ae..4c9579d 100644 --- a/packages/upgrade-deps/dist/index.mjs +++ b/packages/upgrade-deps/dist/index.mjs @@ -29835,136 +29835,9 @@ var require_lib = /* @__PURE__ */ __commonJSMin(((exports) => { } })); //#endregion -//#region ../utils/github-helper.ts +//#region ../utils/constants.ts var import_lib$1 = require_lib$4(); var import_lib = require_lib(); -var GithubHelper = class { - octokit; - context; - constructor(context) { - this.context = context; - this.octokit = getOctokit(context.token); - } - async dryRunLog(methodName, params) { - if (!this.context.dryRun) return false; - startGroup(`dry-run模式, 不运行${methodName}`); - for (const [key, value] of Object.entries(params)) info(`${key}: ${typeof value === "string" ? value : JSON.stringify(value)}`); - endGroup(); - return true; - } - get defaultRepoParams() { - return { - owner: this.context.owner, - repo: this.context.repo - }; - } - async getPrData(prNumber) { - try { - const { data } = await this.octokit.rest.pulls.get({ - ...this.defaultRepoParams, - pull_number: prNumber - }); - return data; - } catch (error$3) { - error(`获取PR数据失败: ${error$3}`); - throw error$3; - } - } - async getIssueData(issueNumber) { - try { - const { data } = await this.octokit.rest.issues.get({ - ...this.defaultRepoParams, - issue_number: issueNumber - }); - return data; - } catch (error$5) { - error(`获取Issue数据失败: ${error$5}`); - throw error$5; - } - } - async getIssueList(params) { - try { - const { data } = await this.octokit.rest.issues.listForRepo({ - ...params, - ...this.defaultRepoParams - }); - return data.filter((item) => !item?.pull_request); - } catch (error$4) { - error(`获取Issue列表失败: ${error$4}`); - throw error$4; - } - } - async closeIssue(issueNumber) { - if (await this.dryRunLog("closeIssue", { issueNumber })) return; - try { - await this.octokit.rest.issues.update({ - ...this.defaultRepoParams, - issue_number: issueNumber, - state: "closed" - }); - } catch (error$6) { - error(`关闭Issue失败: ${error$6}`); - throw error$6; - } - } - async createPR(title, head, body, base = "develop") { - if (await this.dryRunLog("createPR", { - title, - head, - base, - body - })) return; - try { - const { data } = await this.octokit.rest.pulls.create({ - ...this.defaultRepoParams, - title, - head, - base, - body - }); - return data; - } catch (error$1) { - error(`创建PR失败: ${error$1}`); - throw error$1; - } - } - async addComment(issueNumber, body) { - if (await this.dryRunLog("addComment", { - issueNumber, - body - })) return; - try { - const { data } = await this.octokit.rest.issues.createComment({ - ...this.defaultRepoParams, - issue_number: issueNumber, - body - }); - return data; - } catch (error$2) { - error(`添加评论失败: ${error$2}`); - throw error$2; - } - } - async addLabels(issueNumber, labels) { - if (await this.dryRunLog("addLabels", { - issueNumber, - labels: labels.join(", ") - })) return; - try { - const { data } = await this.octokit.rest.issues.addLabels({ - ...this.defaultRepoParams, - issue_number: issueNumber, - labels - }); - return data; - } catch (error$7) { - error(`添加标签失败: ${error$7}`); - throw error$7; - } - } -}; -//#endregion -//#region ../utils/constants.ts const GIT_CONFIG = { USER_NAME: "tdesign-bot", USER_EMAIL: "tdesign@tencent.com" @@ -30125,9 +29998,136 @@ var GitHelper = class { } }; //#endregion +//#region ../utils/github-helper.ts +var GithubHelper = class { + octokit; + context; + constructor(context) { + this.context = context; + this.octokit = getOctokit(context.token); + } + async dryRunLog(methodName, params) { + if (!this.context.dryRun) return false; + startGroup(`dry-run模式, 不运行${methodName}`); + for (const [key, value] of Object.entries(params)) info(`${key}: ${typeof value === "string" ? value : JSON.stringify(value)}`); + endGroup(); + return true; + } + get defaultRepoParams() { + return { + owner: this.context.owner, + repo: this.context.repo + }; + } + async getPrData(prNumber) { + try { + const { data } = await this.octokit.rest.pulls.get({ + ...this.defaultRepoParams, + pull_number: prNumber + }); + return data; + } catch (error$3) { + error(`获取PR数据失败: ${error$3}`); + throw error$3; + } + } + async getIssueData(issueNumber) { + try { + const { data } = await this.octokit.rest.issues.get({ + ...this.defaultRepoParams, + issue_number: issueNumber + }); + return data; + } catch (error$5) { + error(`获取Issue数据失败: ${error$5}`); + throw error$5; + } + } + async getIssueList(params) { + try { + const { data } = await this.octokit.rest.issues.listForRepo({ + ...params, + ...this.defaultRepoParams + }); + return data.filter((item) => !item?.pull_request); + } catch (error$4) { + error(`获取Issue列表失败: ${error$4}`); + throw error$4; + } + } + async closeIssue(issueNumber) { + if (await this.dryRunLog("closeIssue", { issueNumber })) return; + try { + await this.octokit.rest.issues.update({ + ...this.defaultRepoParams, + issue_number: issueNumber, + state: "closed" + }); + } catch (error$6) { + error(`关闭Issue失败: ${error$6}`); + throw error$6; + } + } + async createPR(title, head, body, base = "develop") { + if (await this.dryRunLog("createPR", { + title, + head, + base, + body + })) return; + try { + const { data } = await this.octokit.rest.pulls.create({ + ...this.defaultRepoParams, + title, + head, + base, + body + }); + return data; + } catch (error$1) { + error(`创建PR失败: ${error$1}`); + throw error$1; + } + } + async addComment(issueNumber, body) { + if (await this.dryRunLog("addComment", { + issueNumber, + body + })) return; + try { + const { data } = await this.octokit.rest.issues.createComment({ + ...this.defaultRepoParams, + issue_number: issueNumber, + body + }); + return data; + } catch (error$2) { + error(`添加评论失败: ${error$2}`); + throw error$2; + } + } + async addLabels(issueNumber, labels) { + if (await this.dryRunLog("addLabels", { + issueNumber, + labels: labels.join(", ") + })) return; + try { + const { data } = await this.octokit.rest.issues.addLabels({ + ...this.defaultRepoParams, + issue_number: issueNumber, + labels + }); + return data; + } catch (error$7) { + error(`添加标签失败: ${error$7}`); + throw error$7; + } + } +}; +//#endregion //#region main.ts function getBranchName(deps) { - return `chore/deps/upgrade-${deps.map((d) => `${d.name.replace(/[@:\/\\<>|\*\?\[\]^~`']/g, "-")}-${d.version}`).join("-")}`; + return `chore/deps/upgrade-${deps.map((d) => `${d.name.replace(/@/g, "").replace(/\//g, "-")}-${d.version}`).join("-")}`; } function getPrTitle(deps) { return `chore: upgrade ${deps.map((d) => `${d.name} to ${d.version}`).join(", ")}`; @@ -30186,7 +30186,7 @@ async function getPkgLatestVersion(pkgNames) { error(`Failed to get ${pkg} info from npm registry, status code: ${response.status}`); continue; } - const latest = (await response.json())["version"]; + const latest = (await response.json()).version; if (!latest) { error(`No version found for ${pkg}`); continue; diff --git a/packages/upgrade-deps/main.ts b/packages/upgrade-deps/main.ts index 9862622..f94dbed 100644 --- a/packages/upgrade-deps/main.ts +++ b/packages/upgrade-deps/main.ts @@ -8,7 +8,7 @@ import { readWorkspaceManifest } from '@pnpm/workspace.read-manifest' import { GitHelper, GithubHelper } from '@workflows/utils' function getBranchName(deps: Array<{ name: string, version: string }>): string { - const depsSlug = deps.map(d => `${d.name.replace(/[@:\/\\<>|\*\?\[\]^~`']/g, '-')}-${d.version}`).join('-') + const depsSlug = deps.map(d => `${d.name.replace(/@/g, '').replace(/\//g, '-')}-${d.version}`).join('-') return `chore/deps/upgrade-${depsSlug}` } @@ -117,8 +117,8 @@ async function getPkgLatestVersion(pkgNames: string[]): Promise { const packageManager = core.getInput('package-manager') || 'npm' - const deps = core.getMultilineInput('deps', { required: true,trimWhitespace:true }) + const deps = core.getMultilineInput('deps', { required: true, trimWhitespace: true }) core.info(`deps: ${JSON.stringify(deps)}`) if (!deps.length) { diff --git a/packages/utils/index.ts b/packages/utils/index.ts index 8fa1e69..b2d412e 100644 --- a/packages/utils/index.ts +++ b/packages/utils/index.ts @@ -1,2 +1,2 @@ -export * from './github-helper' export * from './git-helper' +export * from './github-helper' From 4b8d54a86c391e6f62dcb5b0695bad7d54baffc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Tue, 28 Apr 2026 09:34:01 +0800 Subject: [PATCH 26/40] =?UTF-8?q?feat(upgrade-deps):=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=E7=9B=AE=E6=A0=87=E7=9B=AE=E5=BD=95=E5=8D=87?= =?UTF-8?q?=E7=BA=A7=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加 target-dir 输入参数,允许在 monorepo 的子目录中执行依赖升级。同时更新测试工作流以验证此功能。 --- .github/workflows/test-upgrade-deps.yml | 22 +++++++++++++++++++++- actions/upgrade-deps/action.yml | 4 ++++ packages/upgrade-deps/dist/index.mjs | 15 ++++++++++----- packages/upgrade-deps/main.ts | 19 ++++++++++++++----- 4 files changed, 49 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test-upgrade-deps.yml b/.github/workflows/test-upgrade-deps.yml index 038d50f..13970a9 100644 --- a/.github/workflows/test-upgrade-deps.yml +++ b/.github/workflows/test-upgrade-deps.yml @@ -7,7 +7,7 @@ on: - packages/upgrade-deps/dist/* jobs: - test: + tdesign-vue: name: test runs-on: ubuntu-latest steps: @@ -25,3 +25,23 @@ jobs: deps: | @tdesign/site-components @tdesign/theme-generator + + tdesign-flutter: + name: test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6.0.2 + + - uses: actions/setup-node@v6.3.0 + + - name: test + uses: ./actions/upgrade-deps + with: + token: test + dry-run: true + repo: tdesign-flutter + owner: Tencent + target-dir: 'tdesign-site' + deps: | + @tdesign/site-components + @tdesign/theme-generator diff --git a/actions/upgrade-deps/action.yml b/actions/upgrade-deps/action.yml index f5bc90f..63bb8c0 100644 --- a/actions/upgrade-deps/action.yml +++ b/actions/upgrade-deps/action.yml @@ -22,6 +22,10 @@ inputs: deps: description: Dependencies to upgrade in format "package1@version1 package2@version2" required: true + target-dir: + description: Target directory to upgrade dependencies + required: false + default: '' runs: using: node24 diff --git a/packages/upgrade-deps/dist/index.mjs b/packages/upgrade-deps/dist/index.mjs index 4c9579d..86fb8dd 100644 --- a/packages/upgrade-deps/dist/index.mjs +++ b/packages/upgrade-deps/dist/index.mjs @@ -30145,7 +30145,9 @@ function getUpdatedVersion(currentVersion, newVersion) { if (prefix && (prefix === "^" || prefix === "~")) return `${prefix}${newVersion}`; return newVersion; } -async function updatePnpmCatalog(deps, repoPath) { +async function updatePnpmCatalog(deps, repo, targetDir) { + let repoPath = repo; + if (targetDir) repoPath = path.join(repo, targetDir); const workspaceFile = path.join(repoPath, "pnpm-workspace.yaml"); let manifestContent; try { @@ -30202,8 +30204,9 @@ async function getPkgLatestVersion(pkgNames) { async function corepackEnable() { await exec("corepack", ["enable"]); } -async function updatePackageDependencies(packageManager, deps, repo) { - const repoPath = `./${repo}`; +async function updatePackageDependencies(packageManager, deps, repo, targetDir) { + let repoPath = `./${repo}`; + if (targetDir) repoPath = path.join(repoPath, targetDir); if (packageManager === "pnpm") await exec("pnpm", [ "up", ...deps, @@ -30226,11 +30229,13 @@ async function createDepsPr(title, branchName, baseBranch, context) { } async function updateDependencies(context) { const packageManager = getInput("package-manager") || "npm"; + const targetDir = getInput("target-dir") || ""; const deps = getMultilineInput("deps", { required: true, trimWhitespace: true }); info(`deps: ${JSON.stringify(deps)}`); + info(`target-dir: ${targetDir || "default (repo root)"}`); if (!deps.length) throw new ActionError(ERROR_MESSAGES.MISSING_DEPS, { trigger: context.trigger }); const depInfos = await getPkgLatestVersion(deps); info(`depInfos: ${JSON.stringify(depInfos)}`); @@ -30244,8 +30249,8 @@ async function updateDependencies(context) { const baseBranch = await gitHelper.clone(); const branchName = getBranchName(depInfos); await gitHelper.createBranch(branchName); - if (packageManager === "pnpm") await updatePnpmCatalog(depInfos, context.repo); - await updatePackageDependencies(packageManager, deps, context.repo); + if (packageManager === "pnpm") await updatePnpmCatalog(depInfos, context.repo, targetDir); + await updatePackageDependencies(packageManager, deps, context.repo, targetDir); if (!await gitHelper.isNeedCommit()) { info("No changes to commit"); return; diff --git a/packages/upgrade-deps/main.ts b/packages/upgrade-deps/main.ts index f94dbed..f2963e4 100644 --- a/packages/upgrade-deps/main.ts +++ b/packages/upgrade-deps/main.ts @@ -52,7 +52,11 @@ function getUpdatedVersion(currentVersion: string, newVersion: string): string { return newVersion } -async function updatePnpmCatalog(deps: DependencyInfo[], repoPath: string): Promise { +async function updatePnpmCatalog(deps: DependencyInfo[], repo: string, targetDir: string): Promise { + let repoPath = repo + if (targetDir) { + repoPath = path.join(repo, targetDir) + } const workspaceFile = path.join(repoPath, 'pnpm-workspace.yaml') let manifestContent: string @@ -136,8 +140,11 @@ async function corepackEnable(): Promise { await exec.exec('corepack', ['enable']) } -async function updatePackageDependencies(packageManager: string, deps: string[], repo: string): Promise { - const repoPath = `./${repo}` +async function updatePackageDependencies(packageManager: string, deps: string[], repo: string, targetDir: string): Promise { + let repoPath = `./${repo}` + if (targetDir) { + repoPath = path.join(repoPath, targetDir) + } if (packageManager === 'pnpm') { await exec.exec('pnpm', ['up', ...deps, '--latest'], { cwd: repoPath }) } @@ -166,8 +173,10 @@ async function createDepsPr( export async function updateDependencies(context: TriggerContext): Promise { const packageManager = core.getInput('package-manager') || 'npm' + const targetDir = core.getInput('target-dir') || '' const deps = core.getMultilineInput('deps', { required: true, trimWhitespace: true }) core.info(`deps: ${JSON.stringify(deps)}`) + core.info(`target-dir: ${targetDir || 'default (repo root)'}`) if (!deps.length) { throw new ActionError(ERROR_MESSAGES.MISSING_DEPS, { trigger: context.trigger }) @@ -192,10 +201,10 @@ export async function updateDependencies(context: TriggerContext): Promise await gitHelper.createBranch(branchName) if (packageManager === 'pnpm') { - await updatePnpmCatalog(depInfos, context.repo) + await updatePnpmCatalog(depInfos, context.repo, targetDir) } - await updatePackageDependencies(packageManager, deps, context.repo) + await updatePackageDependencies(packageManager, deps, context.repo, targetDir) if (!(await gitHelper.isNeedCommit())) { core.info('No changes to commit') From cc7880ca05b8286e8f625db95b040f4e8021647c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Tue, 28 Apr 2026 09:34:34 +0800 Subject: [PATCH 27/40] =?UTF-8?q?ci:=20=E7=BB=9F=E4=B8=80=E7=9B=AE?= =?UTF-8?q?=E6=A0=87=E7=9B=AE=E5=BD=95=E7=9A=84=E5=BC=95=E5=8F=B7=E4=BD=BF?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除 tdesign-site 路径的引号以保持工作流文件格式一致性 --- .github/workflows/test-upgrade-deps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-upgrade-deps.yml b/.github/workflows/test-upgrade-deps.yml index 13970a9..1d35d07 100644 --- a/.github/workflows/test-upgrade-deps.yml +++ b/.github/workflows/test-upgrade-deps.yml @@ -41,7 +41,7 @@ jobs: dry-run: true repo: tdesign-flutter owner: Tencent - target-dir: 'tdesign-site' + target-dir: tdesign-site deps: | @tdesign/site-components @tdesign/theme-generator From 7d01eea8ad7ed7659a64972d8c1ea03b3c415f95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Tue, 28 Apr 2026 09:40:35 +0800 Subject: [PATCH 28/40] =?UTF-8?q?ci(test-upgrade-deps):=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=20pnpm=20=E5=8C=85=E7=AE=A1=E7=90=86=E5=99=A8?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在依赖升级测试工作流中指定使用 pnpm 包管理器,以确保与项目现有依赖管理方式保持一致。 --- .github/workflows/test-upgrade-deps.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-upgrade-deps.yml b/.github/workflows/test-upgrade-deps.yml index 1d35d07..eaf72c9 100644 --- a/.github/workflows/test-upgrade-deps.yml +++ b/.github/workflows/test-upgrade-deps.yml @@ -41,6 +41,7 @@ jobs: dry-run: true repo: tdesign-flutter owner: Tencent + package-manager: pnpm target-dir: tdesign-site deps: | @tdesign/site-components From a4f984705eb683860be5ad1cdfc8cbb2c0fa5995 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Tue, 28 Apr 2026 09:42:50 +0800 Subject: [PATCH 29/40] =?UTF-8?q?ci(workflows):=20=E4=B8=BA=E5=8D=87?= =?UTF-8?q?=E7=BA=A7=E4=BE=9D=E8=B5=96=E6=B5=8B=E8=AF=95=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=B5=81=E6=8C=87=E5=AE=9A=20Node.js=20=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 为 actions/setup-node 步骤明确指定 node-version 为 22,以确保测试环境的一致性,避免因默认版本变化导致构建失败。 --- .github/workflows/test-upgrade-deps.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-upgrade-deps.yml b/.github/workflows/test-upgrade-deps.yml index eaf72c9..0ed8226 100644 --- a/.github/workflows/test-upgrade-deps.yml +++ b/.github/workflows/test-upgrade-deps.yml @@ -33,6 +33,8 @@ jobs: - uses: actions/checkout@v6.0.2 - uses: actions/setup-node@v6.3.0 + with: + node-version: 22 - name: test uses: ./actions/upgrade-deps From 02b4b085a31bf10642a01bd6125c71cc6ba42dfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Tue, 28 Apr 2026 16:37:04 +0800 Subject: [PATCH 30/40] =?UTF-8?q?ci:=20=E7=AE=80=E5=8C=96=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=E5=88=97=E8=A1=A8=E6=A0=BC=E5=BC=8F=E4=BB=A5=E6=8F=90?= =?UTF-8?q?=E5=8D=87=E5=8F=AF=E7=BB=B4=E6=8A=A4=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test-upgrade-deps.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-upgrade-deps.yml b/.github/workflows/test-upgrade-deps.yml index 0ed8226..7f991c9 100644 --- a/.github/workflows/test-upgrade-deps.yml +++ b/.github/workflows/test-upgrade-deps.yml @@ -45,6 +45,5 @@ jobs: owner: Tencent package-manager: pnpm target-dir: tdesign-site - deps: | - @tdesign/site-components - @tdesign/theme-generator + deps: @tdesign/site-components + From e26d666e9078b1b137d944d70ce7cfbd55e8682f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Tue, 28 Apr 2026 16:38:03 +0800 Subject: [PATCH 31/40] =?UTF-8?q?ci:=20=E4=BF=AE=E5=A4=8D=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=E5=8D=87=E7=BA=A7=E6=B5=8B=E8=AF=95=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=B5=81=E4=B8=AD=E7=9A=84=E4=BE=9D=E8=B5=96=E5=8C=85=E5=90=8D?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将工作流文件中的依赖包名用引号包裹,以避免 YAML 解析错误。 --- .github/workflows/test-upgrade-deps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-upgrade-deps.yml b/.github/workflows/test-upgrade-deps.yml index 7f991c9..70bb2f0 100644 --- a/.github/workflows/test-upgrade-deps.yml +++ b/.github/workflows/test-upgrade-deps.yml @@ -45,5 +45,5 @@ jobs: owner: Tencent package-manager: pnpm target-dir: tdesign-site - deps: @tdesign/site-components + deps: '@tdesign/site-components' From dda52aaefb257a72ccfbf07b8bd6f391c6e9001c Mon Sep 17 00:00:00 2001 From: lwj <674416404@qq.com> Date: Tue, 28 Apr 2026 22:48:42 +0800 Subject: [PATCH 32/40] =?UTF-8?q?ci:=20=E6=B7=BB=E5=8A=A0=20tdesign-vue-ne?= =?UTF-8?q?xt=20=E7=9A=84=E4=BE=9D=E8=B5=96=E5=8D=87=E7=BA=A7=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E5=B7=A5=E4=BD=9C=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test-upgrade-deps.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/test-upgrade-deps.yml b/.github/workflows/test-upgrade-deps.yml index 70bb2f0..8093cdc 100644 --- a/.github/workflows/test-upgrade-deps.yml +++ b/.github/workflows/test-upgrade-deps.yml @@ -26,6 +26,26 @@ jobs: @tdesign/site-components @tdesign/theme-generator + tdesign-vue-next: + name: test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6.0.2 + + - uses: actions/setup-node@v6.3.0 + + - name: test + uses: ./actions/upgrade-deps + with: + token: test + dry-run: true + repo: tdesign-vue-next + owner: Tencent + package-manager: pnpm + deps: | + @tdesign/site-components + @tdesign/theme-generator + tdesign-flutter: name: test runs-on: ubuntu-latest From e77cbb14583f6ca60768d4ade1d17eb37b34093f Mon Sep 17 00:00:00 2001 From: lwj <674416404@qq.com> Date: Tue, 28 Apr 2026 22:50:55 +0800 Subject: [PATCH 33/40] =?UTF-8?q?ci:=20=E7=A7=BB=E9=99=A4=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E5=8D=87=E7=BA=A7=E4=BE=9D=E8=B5=96=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=B5=81=E4=B8=AD=E7=9A=84=E5=86=97=E4=BD=99=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test-upgrade-deps.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test-upgrade-deps.yml b/.github/workflows/test-upgrade-deps.yml index 8093cdc..9d79d97 100644 --- a/.github/workflows/test-upgrade-deps.yml +++ b/.github/workflows/test-upgrade-deps.yml @@ -66,4 +66,3 @@ jobs: package-manager: pnpm target-dir: tdesign-site deps: '@tdesign/site-components' - From 2b9bbb686e0dcaba4796f62bece7ba5eb37d2d90 Mon Sep 17 00:00:00 2001 From: lwj <674416404@qq.com> Date: Tue, 28 Apr 2026 22:54:12 +0800 Subject: [PATCH 34/40] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=AD=90?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E5=88=9D=E5=A7=8B=E5=8C=96=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在克隆仓库后自动初始化子模块,确保依赖更新流程完整 --- packages/upgrade-deps/dist/index.mjs | 1 + packages/upgrade-deps/main.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/upgrade-deps/dist/index.mjs b/packages/upgrade-deps/dist/index.mjs index 86fb8dd..560666e 100644 --- a/packages/upgrade-deps/dist/index.mjs +++ b/packages/upgrade-deps/dist/index.mjs @@ -30247,6 +30247,7 @@ async function updateDependencies(context) { dryRun: context.dryRun }); const baseBranch = await gitHelper.clone(); + await gitHelper.initSubmodule(); const branchName = getBranchName(depInfos); await gitHelper.createBranch(branchName); if (packageManager === "pnpm") await updatePnpmCatalog(depInfos, context.repo, targetDir); diff --git a/packages/upgrade-deps/main.ts b/packages/upgrade-deps/main.ts index f2963e4..ffd839d 100644 --- a/packages/upgrade-deps/main.ts +++ b/packages/upgrade-deps/main.ts @@ -197,6 +197,7 @@ export async function updateDependencies(context: TriggerContext): Promise }) const baseBranch = await gitHelper.clone() + await gitHelper.initSubmodule() const branchName = getBranchName(depInfos) await gitHelper.createBranch(branchName) From a7e317f1ac59c5ae1bb899acec33db58e7385c3a Mon Sep 17 00:00:00 2001 From: lwj <674416404@qq.com> Date: Tue, 28 Apr 2026 23:40:09 +0800 Subject: [PATCH 35/40] =?UTF-8?q?feat(upgrade-deps):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=20PR=20=E6=A0=87=E9=A2=98=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 允许在升级依赖时指定自定义的 PR 标题,当未指定时仍使用默认标题格式 --- .github/workflows/test-upgrade-deps.yml | 1 + actions/upgrade-deps/action.yml | 5 +++++ packages/upgrade-deps/dist/index.mjs | 7 ++++++- packages/upgrade-deps/main.ts | 10 +++++++++- 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-upgrade-deps.yml b/.github/workflows/test-upgrade-deps.yml index 9d79d97..295b52f 100644 --- a/.github/workflows/test-upgrade-deps.yml +++ b/.github/workflows/test-upgrade-deps.yml @@ -42,6 +42,7 @@ jobs: repo: tdesign-vue-next owner: Tencent package-manager: pnpm + title: 'chore(deps): Upgrade site-components and theme-generator' deps: | @tdesign/site-components @tdesign/theme-generator diff --git a/actions/upgrade-deps/action.yml b/actions/upgrade-deps/action.yml index 63bb8c0..d44cdfc 100644 --- a/actions/upgrade-deps/action.yml +++ b/actions/upgrade-deps/action.yml @@ -26,6 +26,11 @@ inputs: description: Target directory to upgrade dependencies required: false default: '' + title: + description: Custom PR title (optional, defaults to "chore: upgrade ...") + required: false + default: '' + runs: using: node24 diff --git a/packages/upgrade-deps/dist/index.mjs b/packages/upgrade-deps/dist/index.mjs index 560666e..48e5043 100644 --- a/packages/upgrade-deps/dist/index.mjs +++ b/packages/upgrade-deps/dist/index.mjs @@ -30230,12 +30230,14 @@ async function createDepsPr(title, branchName, baseBranch, context) { async function updateDependencies(context) { const packageManager = getInput("package-manager") || "npm"; const targetDir = getInput("target-dir") || ""; + const customTitle = getInput("title") || ""; const deps = getMultilineInput("deps", { required: true, trimWhitespace: true }); info(`deps: ${JSON.stringify(deps)}`); info(`target-dir: ${targetDir || "default (repo root)"}`); + if (customTitle) info(`custom-title: ${customTitle}`); if (!deps.length) throw new ActionError(ERROR_MESSAGES.MISSING_DEPS, { trigger: context.trigger }); const depInfos = await getPkgLatestVersion(deps); info(`depInfos: ${JSON.stringify(depInfos)}`); @@ -30256,7 +30258,10 @@ async function updateDependencies(context) { info("No changes to commit"); return; } - const title = getPrTitle(depInfos); + startGroup("Changes to commit"); + await gitHelper.printDiff(); + endGroup(); + const title = customTitle || getPrTitle(depInfos); await gitHelper.commit(title); await gitHelper.push(branchName); await createDepsPr(title, branchName, baseBranch, context); diff --git a/packages/upgrade-deps/main.ts b/packages/upgrade-deps/main.ts index ffd839d..a22946f 100644 --- a/packages/upgrade-deps/main.ts +++ b/packages/upgrade-deps/main.ts @@ -174,9 +174,13 @@ async function createDepsPr( export async function updateDependencies(context: TriggerContext): Promise { const packageManager = core.getInput('package-manager') || 'npm' const targetDir = core.getInput('target-dir') || '' + const customTitle = core.getInput('title') || '' const deps = core.getMultilineInput('deps', { required: true, trimWhitespace: true }) core.info(`deps: ${JSON.stringify(deps)}`) core.info(`target-dir: ${targetDir || 'default (repo root)'}`) + if (customTitle) { + core.info(`custom-title: ${customTitle}`) + } if (!deps.length) { throw new ActionError(ERROR_MESSAGES.MISSING_DEPS, { trigger: context.trigger }) @@ -212,7 +216,11 @@ export async function updateDependencies(context: TriggerContext): Promise return } - const title = getPrTitle(depInfos) + core.startGroup('Changes to commit') + await gitHelper.printDiff() + core.endGroup() + + const title = customTitle || getPrTitle(depInfos) await gitHelper.commit(title) await gitHelper.push(branchName) From e3c2bdc8627d9480282782866cd51e6553bdd857 Mon Sep 17 00:00:00 2001 From: lwj <674416404@qq.com> Date: Tue, 28 Apr 2026 23:42:04 +0800 Subject: [PATCH 36/40] =?UTF-8?q?docs(actions):=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89PR=E6=A0=87=E9=A2=98=E7=9A=84?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=80=BC=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- actions/upgrade-deps/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/upgrade-deps/action.yml b/actions/upgrade-deps/action.yml index d44cdfc..ea7c7b3 100644 --- a/actions/upgrade-deps/action.yml +++ b/actions/upgrade-deps/action.yml @@ -27,7 +27,7 @@ inputs: required: false default: '' title: - description: Custom PR title (optional, defaults to "chore: upgrade ...") + description: "Custom PR title (optional, defaults to 'chore(deps): upgrade ...')" required: false default: '' From 1c2d29a3d4197cf92692babea444e23efc74859d Mon Sep 17 00:00:00 2001 From: lwj <674416404@qq.com> Date: Tue, 28 Apr 2026 23:52:03 +0800 Subject: [PATCH 37/40] =?UTF-8?q?refactor(upgrade-deps):=20=E7=A7=BB?= =?UTF-8?q?=E9=99=A4pnpm=20catalog=E6=9B=B4=E6=96=B0=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=B9=B6=E4=BC=98=E5=8C=96=E5=B7=A5=E4=BD=9C=E6=B5=81=E5=91=BD?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除不再使用的pnpm catalog相关代码,清理冗余依赖导入 优化测试工作流中的job名称以更清晰地标识项目 --- .github/workflows/test-upgrade-deps.yml | 6 +- actions/upgrade-deps/action.yml | 1 - packages/upgrade-deps/dist/index.mjs | 266 ++++-------------------- packages/upgrade-deps/main.ts | 137 ++++++------ 4 files changed, 120 insertions(+), 290 deletions(-) diff --git a/.github/workflows/test-upgrade-deps.yml b/.github/workflows/test-upgrade-deps.yml index 295b52f..64bca22 100644 --- a/.github/workflows/test-upgrade-deps.yml +++ b/.github/workflows/test-upgrade-deps.yml @@ -8,7 +8,7 @@ on: jobs: tdesign-vue: - name: test + name: tdesign-vue runs-on: ubuntu-latest steps: - uses: actions/checkout@v6.0.2 @@ -27,7 +27,7 @@ jobs: @tdesign/theme-generator tdesign-vue-next: - name: test + name: tdesign-vue-next runs-on: ubuntu-latest steps: - uses: actions/checkout@v6.0.2 @@ -48,7 +48,7 @@ jobs: @tdesign/theme-generator tdesign-flutter: - name: test + name: tdesign-flutter runs-on: ubuntu-latest steps: - uses: actions/checkout@v6.0.2 diff --git a/actions/upgrade-deps/action.yml b/actions/upgrade-deps/action.yml index ea7c7b3..fb41da9 100644 --- a/actions/upgrade-deps/action.yml +++ b/actions/upgrade-deps/action.yml @@ -30,7 +30,6 @@ inputs: description: "Custom PR title (optional, defaults to 'chore(deps): upgrade ...')" required: false default: '' - runs: using: node24 diff --git a/packages/upgrade-deps/dist/index.mjs b/packages/upgrade-deps/dist/index.mjs index 48e5043..c08de18 100644 --- a/packages/upgrade-deps/dist/index.mjs +++ b/packages/upgrade-deps/dist/index.mjs @@ -1,9 +1,8 @@ import { createRequire } from "node:module"; -import * as fs from "node:fs/promises"; import * as path from "node:path"; import * as os$1 from "os"; import os, { EOL } from "os"; -import * as fs$3 from "fs"; +import * as fs$2 from "fs"; import { constants, existsSync, promises, readFileSync } from "fs"; import * as path$2 from "path"; import * as events from "events"; @@ -15963,9 +15962,9 @@ var __awaiter$6 = function(thisArg, _arguments, P, generator) { step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -const { chmod, copyFile, lstat, mkdir, open, readdir, rename, rm, rmdir, stat, symlink, unlink } = fs$3.promises; +const { chmod, copyFile, lstat, mkdir, open, readdir, rename, rm, rmdir, stat, symlink, unlink } = fs$2.promises; const IS_WINDOWS$1 = process.platform === "win32"; -fs$3.constants.O_RDONLY; +fs$2.constants.O_RDONLY; function exists(fsPath) { return __awaiter$6(this, void 0, void 0, function* () { try { @@ -21939,14 +21938,14 @@ var require_js_yaml = /* @__PURE__ */ __commonJSMin(((exports, module) => { //#endregion //#region ../../node_modules/.pnpm/read-yaml-file@2.1.0/node_modules/read-yaml-file/index.js var require_read_yaml_file = /* @__PURE__ */ __commonJSMin(((exports, module) => { - const fs$2 = __require("fs"); + const fs$1 = __require("fs"); const stripBom = require_strip_bom(); const yaml = require_js_yaml(); const parse = (data) => yaml.load(stripBom(data)); - const readYamlFile = (fp) => fs$2.promises.readFile(fp, "utf8").then((data) => parse(data)); + const readYamlFile = (fp) => fs$1.promises.readFile(fp, "utf8").then((data) => parse(data)); module.exports = readYamlFile; module.exports.default = readYamlFile; - module.exports.sync = (fp) => parse(fs$2.readFileSync(fp, "utf8")); + module.exports.sync = (fp) => parse(fs$1.readFileSync(fp, "utf8")); })); //#endregion //#region ../../node_modules/.pnpm/@pnpm+error@1000.1.0/node_modules/@pnpm/error/lib/index.js @@ -29414,7 +29413,7 @@ var require_lib$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => { module.exports.sync = writeFileSync; module.exports._getTmpname = getTmpname; module.exports._cleanupOnExit = cleanupOnExit; - const fs$1 = __require("fs"); + const fs = __require("fs"); const MurmurHash3 = require_imurmurhash(); const { onExit } = require_cjs(); const path$1 = __require("path"); @@ -29435,7 +29434,7 @@ var require_lib$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => { function cleanupOnExit(tmpfile) { return () => { try { - fs$1.unlinkSync(typeof tmpfile === "function" ? tmpfile() : tmpfile); + fs.unlinkSync(typeof tmpfile === "function" ? tmpfile() : tmpfile); } catch {} }; } @@ -29462,10 +29461,10 @@ var require_lib$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => { const absoluteName = path$1.resolve(filename); try { await serializeActiveFile(absoluteName); - const truename = await promisify(fs$1.realpath)(filename).catch(() => filename); + const truename = await promisify(fs.realpath)(filename).catch(() => filename); tmpfile = getTmpname(truename); if (!options.mode || !options.chown) { - const stats = await promisify(fs$1.stat)(truename).catch(() => {}); + const stats = await promisify(fs.stat)(truename).catch(() => {}); if (stats) { if (options.mode == null) options.mode = stats.mode; if (options.chown == null && process.getuid) options.chown = { @@ -29474,27 +29473,27 @@ var require_lib$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => { }; } } - fd = await promisify(fs$1.open)(tmpfile, "w", options.mode); + fd = await promisify(fs.open)(tmpfile, "w", options.mode); if (options.tmpfileCreated) await options.tmpfileCreated(tmpfile); - if (ArrayBuffer.isView(data)) await promisify(fs$1.write)(fd, data, 0, data.length, 0); - else if (data != null) await promisify(fs$1.write)(fd, String(data), 0, String(options.encoding || "utf8")); - if (options.fsync !== false) await promisify(fs$1.fsync)(fd); - await promisify(fs$1.close)(fd); + if (ArrayBuffer.isView(data)) await promisify(fs.write)(fd, data, 0, data.length, 0); + else if (data != null) await promisify(fs.write)(fd, String(data), 0, String(options.encoding || "utf8")); + if (options.fsync !== false) await promisify(fs.fsync)(fd); + await promisify(fs.close)(fd); fd = null; - if (options.chown) await promisify(fs$1.chown)(tmpfile, options.chown.uid, options.chown.gid).catch((err) => { + if (options.chown) await promisify(fs.chown)(tmpfile, options.chown.uid, options.chown.gid).catch((err) => { if (!isChownErrOk(err)) throw err; }); - if (options.mode) await promisify(fs$1.chmod)(tmpfile, options.mode).catch((err) => { + if (options.mode) await promisify(fs.chmod)(tmpfile, options.mode).catch((err) => { if (!isChownErrOk(err)) throw err; }); - await promisify(fs$1.rename)(tmpfile, truename); + await promisify(fs.rename)(tmpfile, truename); } finally { - if (fd) await promisify(fs$1.close)(fd).catch( + if (fd) await promisify(fs.close)(fd).catch( /* istanbul ignore next */ () => {} ); removeOnExitHandler(); - await promisify(fs$1.unlink)(tmpfile).catch(() => {}); + await promisify(fs.unlink)(tmpfile).catch(() => {}); activeFiles[absoluteName].shift(); if (activeFiles[absoluteName].length > 0) activeFiles[absoluteName][0](); else delete activeFiles[absoluteName]; @@ -29518,11 +29517,11 @@ var require_lib$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => { if (typeof options === "string") options = { encoding: options }; else if (!options) options = {}; try { - filename = fs$1.realpathSync(filename); + filename = fs.realpathSync(filename); } catch (ex) {} const tmpfile = getTmpname(filename); if (!options.mode || !options.chown) try { - const stats = fs$1.statSync(filename); + const stats = fs.statSync(filename); options = Object.assign({}, options); if (!options.mode) options.mode = stats.mode; if (!options.chown && process.getuid) options.chown = { @@ -29535,28 +29534,28 @@ var require_lib$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => { const removeOnExitHandler = onExit(cleanup); let threw = true; try { - fd = fs$1.openSync(tmpfile, "w", options.mode || 438); + fd = fs.openSync(tmpfile, "w", options.mode || 438); if (options.tmpfileCreated) options.tmpfileCreated(tmpfile); - if (ArrayBuffer.isView(data)) fs$1.writeSync(fd, data, 0, data.length, 0); - else if (data != null) fs$1.writeSync(fd, String(data), 0, String(options.encoding || "utf8")); - if (options.fsync !== false) fs$1.fsyncSync(fd); - fs$1.closeSync(fd); + if (ArrayBuffer.isView(data)) fs.writeSync(fd, data, 0, data.length, 0); + else if (data != null) fs.writeSync(fd, String(data), 0, String(options.encoding || "utf8")); + if (options.fsync !== false) fs.fsyncSync(fd); + fs.closeSync(fd); fd = null; if (options.chown) try { - fs$1.chownSync(tmpfile, options.chown.uid, options.chown.gid); + fs.chownSync(tmpfile, options.chown.uid, options.chown.gid); } catch (err) { if (!isChownErrOk(err)) throw err; } if (options.mode) try { - fs$1.chmodSync(tmpfile, options.mode); + fs.chmodSync(tmpfile, options.mode); } catch (err) { if (!isChownErrOk(err)) throw err; } - fs$1.renameSync(tmpfile, filename); + fs.renameSync(tmpfile, filename); threw = false; } finally { if (fd) try { - fs$1.closeSync(fd); + fs.closeSync(fd); } catch (ex) {} removeOnExitHandler(); if (threw) cleanup(); @@ -29687,157 +29686,19 @@ var require_lib = /* @__PURE__ */ __commonJSMin(((exports) => { return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); - exports.updateWorkspaceManifest = updateWorkspaceManifest; - const fs_1 = __importDefault(__require("fs")); - const path_1 = __importDefault(__require("path")); - const util_1 = __importDefault(__require("util")); - const workspace_read_manifest_1 = require_lib$4(); - const constants_1 = require_lib$6(); - const yaml_document_sync_1 = require_lib$3(); - const equals_1 = __importDefault(require_equals()); - const yaml_1 = __importDefault(require_dist$1()); - const write_file_atomic_1 = __importDefault(require_lib$2()); - const object_key_sorting_1 = require_lib$1(); - async function writeManifestFile(dir, manifest) { - const manifestStr = manifest.toString({ - lineWidth: 0, - singleQuote: true - }); - await fs_1.default.promises.mkdir(dir, { recursive: true }); - await (0, write_file_atomic_1.default)(path_1.default.join(dir, constants_1.WORKSPACE_MANIFEST_FILENAME), manifestStr); - } - async function readManifestRaw(file) { - try { - return (await fs_1.default.promises.readFile(file)).toString(); - } catch (err) { - if (util_1.default.types.isNativeError(err) && "code" in err && err.code === "ENOENT") return; - throw err; - } - } - async function updateWorkspaceManifest(dir, opts) { - const workspaceManifestStr = await readManifestRaw(path_1.default.join(dir, constants_1.WORKSPACE_MANIFEST_FILENAME)); - const document = workspaceManifestStr != null ? yaml_1.default.parseDocument(workspaceManifestStr) : new yaml_1.default.Document(); - let manifest = document.toJSON(); - (0, workspace_read_manifest_1.validateWorkspaceManifest)(manifest); - manifest ??= {}; - let shouldBeUpdated = opts.updatedCatalogs != null && addCatalogs(manifest, opts.updatedCatalogs); - if (opts.cleanupUnusedCatalogs) shouldBeUpdated = removePackagesFromWorkspaceCatalog(manifest, opts.allProjects ?? []) || shouldBeUpdated; - const updatedFields = { ...opts.updatedFields }; - if (manifest.allowBuilds != null || manifest.onlyBuiltDependencies == null && manifest.ignoredBuiltDependencies == null) { - const allowBuilds = { ...manifest.allowBuilds }; - if (updatedFields.onlyBuiltDependencies != null) for (const pattern of updatedFields.onlyBuiltDependencies) allowBuilds[pattern] = true; - if (updatedFields.ignoredBuiltDependencies != null) for (const pattern of updatedFields.ignoredBuiltDependencies) allowBuilds[pattern] = false; - if (manifest.allowBuilds != null || Object.keys(allowBuilds).length > 0) updatedFields.allowBuilds = allowBuilds; - delete updatedFields.onlyBuiltDependencies; - delete updatedFields.ignoredBuiltDependencies; - } - for (const [key, value] of Object.entries(updatedFields)) if (!(0, equals_1.default)(manifest[key], value)) { - shouldBeUpdated = true; - if (value == null) delete manifest[key]; - else manifest[key] = value; - } - if (opts.updatedOverrides) { - manifest.overrides ??= {}; - for (const [key, value] of Object.entries(opts.updatedOverrides)) if (!(0, equals_1.default)(manifest.overrides[key], value)) { - shouldBeUpdated = true; - manifest.overrides[key] = value; - } - } - if (!shouldBeUpdated) return; - if (Object.keys(manifest).length === 0) { - await fs_1.default.promises.rm(path_1.default.join(dir, constants_1.WORKSPACE_MANIFEST_FILENAME)); - return; - } - manifest = (0, object_key_sorting_1.sortKeysByPriority)({ - priority: { packages: 0 }, - deep: true - }, manifest); - (0, yaml_document_sync_1.patchDocument)(document, manifest); - await writeManifestFile(dir, document); - } - function addCatalogs(manifest, newCatalogs) { - let shouldBeUpdated = false; - for (const catalogName in newCatalogs) { - let targetCatalog = catalogName === "default" ? manifest.catalog ?? manifest.catalogs?.default : manifest.catalogs?.[catalogName]; - const targetCatalogWasNil = targetCatalog == null; - for (const [dependencyName, specifier] of Object.entries(newCatalogs[catalogName] ?? {})) { - if (specifier == null) continue; - targetCatalog ??= {}; - if (targetCatalog[dependencyName] !== specifier) { - targetCatalog[dependencyName] = specifier; - shouldBeUpdated = true; - } - } - if (targetCatalog == null) continue; - if (targetCatalogWasNil) if (catalogName === "default") manifest.catalog = targetCatalog; - else { - manifest.catalogs ??= {}; - manifest.catalogs[catalogName] = targetCatalog; - } - } - return shouldBeUpdated; - } - function removePackagesFromWorkspaceCatalog(manifest, packagesJson) { - let shouldBeUpdated = false; - if (packagesJson.length === 0 || manifest.catalog == null && manifest.catalogs == null) return shouldBeUpdated; - const packageReferences = {}; - for (const pkg of packagesJson) { - const pkgManifest = pkg.manifest; - const dependencyTypes = [ - pkgManifest.dependencies, - pkgManifest.devDependencies, - pkgManifest.optionalDependencies, - pkgManifest.peerDependencies - ]; - for (const deps of dependencyTypes) { - if (!deps) continue; - for (const [pkgName, version] of Object.entries(deps)) { - if (!packageReferences[pkgName]) packageReferences[pkgName] = /* @__PURE__ */ new Set(); - packageReferences[pkgName].add(version); - } - } - } - if (manifest.catalog) { - const packagesToRemove = Object.keys(manifest.catalog).filter((pkg) => !packageReferences[pkg]?.has("catalog:")); - for (const pkg of packagesToRemove) { - delete manifest.catalog[pkg]; - shouldBeUpdated = true; - } - if (Object.keys(manifest.catalog).length === 0) { - delete manifest.catalog; - shouldBeUpdated = true; - } - } - if (manifest.catalogs) { - const catalogsToRemove = []; - for (const [catalogName, catalog] of Object.entries(manifest.catalogs)) { - if (!catalog) continue; - const packagesToRemove = Object.keys(catalog).filter((pkg) => { - const references = packageReferences[pkg]; - return !references?.has(`catalog:${catalogName}`) && !references?.has("catalog:"); - }); - for (const pkg of packagesToRemove) { - delete catalog[pkg]; - shouldBeUpdated = true; - } - if (Object.keys(catalog).length === 0) { - catalogsToRemove.push(catalogName); - shouldBeUpdated = true; - } - } - for (const catalogName of catalogsToRemove) delete manifest.catalogs[catalogName]; - if (Object.keys(manifest.catalogs).length === 0) { - delete manifest.catalogs; - shouldBeUpdated = true; - } - } - return shouldBeUpdated; - } + __importDefault(__require("fs")); + __importDefault(__require("path")); + __importDefault(__require("util")); + require_lib$4(); + require_lib$6(); + require_lib$3(); + __importDefault(require_equals()); + __importDefault(require_dist$1()); + __importDefault(require_lib$2()); + require_lib$1(); })); -//#endregion -//#region ../utils/constants.ts -var import_lib$1 = require_lib$4(); -var import_lib = require_lib(); +require_lib$4(); +require_lib(); const GIT_CONFIG = { USER_NAME: "tdesign-bot", USER_EMAIL: "tdesign@tencent.com" @@ -30140,46 +30001,6 @@ var ActionError = class extends Error { if (context) error(`${message} ${JSON.stringify(context)}`); } }; -function getUpdatedVersion(currentVersion, newVersion) { - const prefix = currentVersion[0]; - if (prefix && (prefix === "^" || prefix === "~")) return `${prefix}${newVersion}`; - return newVersion; -} -async function updatePnpmCatalog(deps, repo, targetDir) { - let repoPath = repo; - if (targetDir) repoPath = path.join(repo, targetDir); - const workspaceFile = path.join(repoPath, "pnpm-workspace.yaml"); - let manifestContent; - try { - manifestContent = await fs.readFile(workspaceFile, "utf-8"); - } catch { - info(`pnpm-workspace.yaml not found in ${repoPath}, skipping catalog update`); - return; - } - const manifest = await (0, import_lib$1.readWorkspaceManifest)(manifestContent); - if (!manifest) { - info(`Failed to read pnpm-workspace.yaml, skipping catalog update`); - return; - } - const updatedCatalogs = {}; - if (manifest.catalog) { - const defaultCatalogUpdates = {}; - for (const dep of deps) if (dep.name in manifest.catalog) defaultCatalogUpdates[dep.name] = getUpdatedVersion(manifest.catalog[dep.name], dep.version); - if (Object.keys(defaultCatalogUpdates).length > 0) updatedCatalogs[""] = defaultCatalogUpdates; - } - if (manifest.catalogs) for (const [catalogName, catalog] of Object.entries(manifest.catalogs)) { - const catalogUpdates = {}; - const typedCatalog = catalog; - for (const dep of deps) if (dep.name in typedCatalog) catalogUpdates[dep.name] = getUpdatedVersion(typedCatalog[dep.name], dep.version); - if (Object.keys(catalogUpdates).length > 0) updatedCatalogs[catalogName] = catalogUpdates; - } - if (!(Object.keys(updatedCatalogs).length > 0)) { - info(`No matching dependencies found in catalog, skipping update`); - return; - } - await (0, import_lib.updateWorkspaceManifest)(workspaceFile, { updatedCatalogs }); - info(`Updated pnpm catalog in pnpm-workspace.yaml`); -} async function getPkgLatestVersion(pkgNames) { const results = []; for (const pkg of pkgNames) { @@ -30252,7 +30073,6 @@ async function updateDependencies(context) { await gitHelper.initSubmodule(); const branchName = getBranchName(depInfos); await gitHelper.createBranch(branchName); - if (packageManager === "pnpm") await updatePnpmCatalog(depInfos, context.repo, targetDir); await updatePackageDependencies(packageManager, deps, context.repo, targetDir); if (!await gitHelper.isNeedCommit()) { info("No changes to commit"); diff --git a/packages/upgrade-deps/main.ts b/packages/upgrade-deps/main.ts index a22946f..23e79e8 100644 --- a/packages/upgrade-deps/main.ts +++ b/packages/upgrade-deps/main.ts @@ -52,66 +52,77 @@ function getUpdatedVersion(currentVersion: string, newVersion: string): string { return newVersion } -async function updatePnpmCatalog(deps: DependencyInfo[], repo: string, targetDir: string): Promise { - let repoPath = repo - if (targetDir) { - repoPath = path.join(repo, targetDir) - } - const workspaceFile = path.join(repoPath, 'pnpm-workspace.yaml') - - let manifestContent: string - try { - manifestContent = await fs.readFile(workspaceFile, 'utf-8') - } - catch { - core.info(`pnpm-workspace.yaml not found in ${repoPath}, skipping catalog update`) - return - } - - const manifest = await readWorkspaceManifest(manifestContent) - if (!manifest) { - core.info(`Failed to read pnpm-workspace.yaml, skipping catalog update`) - return - } - - const updatedCatalogs: Record> = {} - - if (manifest.catalog) { - const defaultCatalogUpdates: Record = {} - for (const dep of deps) { - if (dep.name in manifest.catalog) { - defaultCatalogUpdates[dep.name] = getUpdatedVersion(manifest.catalog[dep.name] as string, dep.version) - } - } - if (Object.keys(defaultCatalogUpdates).length > 0) { - updatedCatalogs[''] = defaultCatalogUpdates - } - } - - if (manifest.catalogs) { - for (const [catalogName, catalog] of Object.entries(manifest.catalogs)) { - const catalogUpdates: Record = {} - const typedCatalog = catalog as Record - for (const dep of deps) { - if (dep.name in typedCatalog) { - catalogUpdates[dep.name] = getUpdatedVersion(typedCatalog[dep.name], dep.version) - } - } - if (Object.keys(catalogUpdates).length > 0) { - updatedCatalogs[catalogName] = catalogUpdates - } - } - } - - const hasUpdates = Object.keys(updatedCatalogs).length > 0 - if (!hasUpdates) { - core.info(`No matching dependencies found in catalog, skipping update`) - return - } - - await updateWorkspaceManifest(workspaceFile, { updatedCatalogs }) - core.info(`Updated pnpm catalog in pnpm-workspace.yaml`) -} +// async function updatePnpmCatalog(deps: DependencyInfo[], repo: string, targetDir: string): Promise { +// let repoPath = repo +// if (targetDir) { +// repoPath = path.join(repo, targetDir) +// } +// const workspaceFile = path.join(repoPath, 'pnpm-workspace.yaml') +// core.info(`Looking for pnpm-workspace.yaml at: ${workspaceFile}`) + +// let manifestContent: string +// try { +// manifestContent = await fs.readFile(workspaceFile, 'utf-8') +// core.info(`Successfully read pnpm-workspace.yaml (${manifestContent.length} bytes)`) +// } +// catch (error) { +// core.info(`pnpm-workspace.yaml not found in ${repoPath}, skipping catalog update`) +// core.info(`Error: ${error}`) +// return +// } + +// const manifest = await readWorkspaceManifest(manifestContent) +// if (!manifest) { +// core.info(`Failed to read pnpm-workspace.yaml, skipping catalog update`) +// core.info(`File content preview: ${manifestContent.substring(0, 200)}...`) +// return +// } +// core.info(`Successfully parsed pnpm-workspace.yaml`) +// if (manifest.catalog) { +// core.info(`Found default catalog with ${Object.keys(manifest.catalog).length} entries`) +// } +// if (manifest.catalogs) { +// core.info(`Found ${Object.keys(manifest.catalogs).length} named catalogs: ${Object.keys(manifest.catalogs).join(', ')}`) +// } + +// const updatedCatalogs: Record> = {} + +// if (manifest.catalog) { +// const defaultCatalogUpdates: Record = {} +// for (const dep of deps) { +// if (dep.name in manifest.catalog) { +// defaultCatalogUpdates[dep.name] = getUpdatedVersion(manifest.catalog[dep.name] as string, dep.version) +// } +// } +// if (Object.keys(defaultCatalogUpdates).length > 0) { +// updatedCatalogs[''] = defaultCatalogUpdates +// } +// } + +// if (manifest.catalogs) { +// for (const [catalogName, catalog] of Object.entries(manifest.catalogs)) { +// const catalogUpdates: Record = {} +// const typedCatalog = catalog as Record +// for (const dep of deps) { +// if (dep.name in typedCatalog) { +// catalogUpdates[dep.name] = getUpdatedVersion(typedCatalog[dep.name], dep.version) +// } +// } +// if (Object.keys(catalogUpdates).length > 0) { +// updatedCatalogs[catalogName] = catalogUpdates +// } +// } +// } + +// const hasUpdates = Object.keys(updatedCatalogs).length > 0 +// if (!hasUpdates) { +// core.info(`No matching dependencies found in catalog, skipping update`) +// return +// } + +// await updateWorkspaceManifest(workspaceFile, { updatedCatalogs }) +// core.info(`Updated pnpm catalog in pnpm-workspace.yaml`) +// } async function getPkgLatestVersion(pkgNames: string[]): Promise { const results: DependencyInfo[] = [] @@ -205,9 +216,9 @@ export async function updateDependencies(context: TriggerContext): Promise const branchName = getBranchName(depInfos) await gitHelper.createBranch(branchName) - if (packageManager === 'pnpm') { - await updatePnpmCatalog(depInfos, context.repo, targetDir) - } + // if (packageManager === 'pnpm') { + // await updatePnpmCatalog(depInfos, context.repo, targetDir) + // } await updatePackageDependencies(packageManager, deps, context.repo, targetDir) From bf0de4eff9c31dbc794dfe6239853446a00bd55f Mon Sep 17 00:00:00 2001 From: lwj <674416404@qq.com> Date: Tue, 28 Apr 2026 23:52:09 +0800 Subject: [PATCH 38/40] =?UTF-8?q?ci:=20=E7=A7=BB=E9=99=A4=20tdesign-flutte?= =?UTF-8?q?r=20=E7=9A=84=E6=B5=8B=E8=AF=95=E5=B7=A5=E4=BD=9C=E6=B5=81?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test-upgrade-deps.yml | 36 ++++++++++++------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/test-upgrade-deps.yml b/.github/workflows/test-upgrade-deps.yml index 64bca22..8d3d700 100644 --- a/.github/workflows/test-upgrade-deps.yml +++ b/.github/workflows/test-upgrade-deps.yml @@ -47,23 +47,23 @@ jobs: @tdesign/site-components @tdesign/theme-generator - tdesign-flutter: - name: tdesign-flutter - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6.0.2 + # tdesign-flutter: + # name: tdesign-flutter + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v6.0.2 - - uses: actions/setup-node@v6.3.0 - with: - node-version: 22 + # - uses: actions/setup-node@v6.3.0 + # with: + # node-version: 22 - - name: test - uses: ./actions/upgrade-deps - with: - token: test - dry-run: true - repo: tdesign-flutter - owner: Tencent - package-manager: pnpm - target-dir: tdesign-site - deps: '@tdesign/site-components' + # - name: test + # uses: ./actions/upgrade-deps + # with: + # token: test + # dry-run: true + # repo: tdesign-flutter + # owner: Tencent + # package-manager: pnpm + # target-dir: tdesign-site + # deps: '@tdesign/site-components' From 7f52532e1193bfe74448135557301c804af64cc5 Mon Sep 17 00:00:00 2001 From: lwj <674416404@qq.com> Date: Wed, 29 Apr 2026 00:02:12 +0800 Subject: [PATCH 39/40] =?UTF-8?q?refactor:=20=E7=A7=BB=E9=99=A4=E6=9C=AA?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E7=9A=84pnpm=E5=B7=A5=E4=BD=9C=E5=8C=BA?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/upgrade-deps/dist/index.mjs | 10063 +---------------------- packages/upgrade-deps/main.ts | 83 - packages/upgrade-deps/package.json | 2 - packages/upgrade-deps/tsdown.config.ts | 21 +- pnpm-lock.yaml | 175 - pnpm-workspace.yaml | 4 +- 6 files changed, 58 insertions(+), 10290 deletions(-) diff --git a/packages/upgrade-deps/dist/index.mjs b/packages/upgrade-deps/dist/index.mjs index c08de18..180ca38 100644 --- a/packages/upgrade-deps/dist/index.mjs +++ b/packages/upgrade-deps/dist/index.mjs @@ -2,11 +2,10 @@ import { createRequire } from "node:module"; import * as path from "node:path"; import * as os$1 from "os"; import os, { EOL } from "os"; -import * as fs$2 from "fs"; +import * as fs from "fs"; import { constants, existsSync, promises, readFileSync } from "fs"; -import * as path$2 from "path"; +import * as path$1 from "path"; import * as events from "events"; -import { fileURLToPath } from "node:url"; import { StringDecoder } from "string_decoder"; import * as child from "child_process"; import { setTimeout as setTimeout$1 } from "timers"; @@ -17,7 +16,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; -var __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res); var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports); var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) { @@ -415,7 +413,7 @@ var require_symbols$4 = /* @__PURE__ */ __commonJSMin(((exports, module) => { })); //#endregion //#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/core/errors.js -var require_errors$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { +var require_errors = /* @__PURE__ */ __commonJSMin(((exports, module) => { const kUndiciError = Symbol.for("undici.error.UND_ERR"); var UndiciError = class extends Error { constructor(message) { @@ -990,7 +988,7 @@ var require_util$7 = /* @__PURE__ */ __commonJSMin(((exports, module) => { const nodeUtil$3 = __require("node:util"); const { stringify } = __require("node:querystring"); const { EventEmitter: EE$2 } = __require("node:events"); - const { InvalidArgumentError } = require_errors$1(); + const { InvalidArgumentError } = require_errors(); const { headerNameLowerCasedRecord } = require_constants$4(); const { tree } = require_tree(); const [nodeMajor, nodeMinor] = process.versions.node.split(".").map((v) => Number(v)); @@ -1532,7 +1530,7 @@ var require_diagnostics = /* @__PURE__ */ __commonJSMin(((exports, module) => { //#endregion //#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/core/request.js var require_request$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { - const { InvalidArgumentError, NotSupportedError } = require_errors$1(); + const { InvalidArgumentError, NotSupportedError } = require_errors(); const assert$25 = __require("node:assert"); const { isValidHTTPToken, isValidHeaderValue, isStream, destroy, isBuffer, isFormDataLike, isIterable, isBlobLike, buildURL, validateHandler, getServerName, normalizedMethodRecords } = require_util$7(); const { channels } = require_diagnostics(); @@ -1795,7 +1793,7 @@ var require_dispatcher = /* @__PURE__ */ __commonJSMin(((exports, module) => { //#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/dispatcher/dispatcher-base.js var require_dispatcher_base = /* @__PURE__ */ __commonJSMin(((exports, module) => { const Dispatcher = require_dispatcher(); - const { ClientDestroyedError, ClientClosedError, InvalidArgumentError } = require_errors$1(); + const { ClientDestroyedError, ClientClosedError, InvalidArgumentError } = require_errors(); const { kDestroy, kClose, kClosed, kDestroyed, kDispatch, kInterceptors } = require_symbols$4(); const kOnDestroyed = Symbol("onDestroyed"); const kOnClosed = Symbol("onClosed"); @@ -2249,7 +2247,7 @@ var require_connect = /* @__PURE__ */ __commonJSMin(((exports, module) => { const net$1 = __require("node:net"); const assert$24 = __require("node:assert"); const util = require_util$7(); - const { InvalidArgumentError, ConnectTimeoutError } = require_errors$1(); + const { InvalidArgumentError, ConnectTimeoutError } = require_errors(); const timers = require_timers(); function noop() {} let tls; @@ -5158,7 +5156,7 @@ var require_client_h1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { const util = require_util$7(); const { channels } = require_diagnostics(); const timers = require_timers(); - const { RequestContentLengthMismatchError, ResponseContentLengthMismatchError, RequestAbortedError, HeadersTimeoutError, HeadersOverflowError, SocketError, InformationalError, BodyTimeoutError, HTTPParserError, ResponseExceededMaxSizeError } = require_errors$1(); + const { RequestContentLengthMismatchError, ResponseContentLengthMismatchError, RequestAbortedError, HeadersTimeoutError, HeadersOverflowError, SocketError, InformationalError, BodyTimeoutError, HTTPParserError, ResponseExceededMaxSizeError } = require_errors(); const { kUrl, kReset, kClient, kParser, kBlocking, kRunning, kPending, kSize, kWriting, kQueue, kNoRef, kKeepAliveDefaultTimeout, kHostHeader, kPendingIdx, kRunningIdx, kError, kPipelining, kSocket, kKeepAliveTimeoutValue, kMaxHeadersSize, kKeepAliveMaxTimeout, kKeepAliveTimeoutThreshold, kHeadersTimeout, kBodyTimeout, kStrictContentLength, kMaxRequests, kCounter, kMaxResponseSize, kOnError, kResume, kHTTPContext } = require_symbols$4(); const constants = require_constants$3(); const EMPTY_BUF = Buffer.alloc(0); @@ -5932,7 +5930,7 @@ var require_client_h2 = /* @__PURE__ */ __commonJSMin(((exports, module) => { const assert$18 = __require("node:assert"); const { pipeline: pipeline$2 } = __require("node:stream"); const util = require_util$7(); - const { RequestContentLengthMismatchError, RequestAbortedError, SocketError, InformationalError } = require_errors$1(); + const { RequestContentLengthMismatchError, RequestAbortedError, SocketError, InformationalError } = require_errors(); const { kUrl, kReset, kClient, kRunning, kPending, kQueue, kPendingIdx, kRunningIdx, kError, kSocket, kStrictContentLength, kOnError, kMaxConcurrentStreams, kHTTP2Session, kResume, kSize, kHTTPContext } = require_symbols$4(); const kOpenStreams = Symbol("open streams"); let extractBody; @@ -6318,7 +6316,7 @@ var require_redirect_handler = /* @__PURE__ */ __commonJSMin(((exports, module) const util = require_util$7(); const { kBodyUsed } = require_symbols$4(); const assert$17 = __require("node:assert"); - const { InvalidArgumentError } = require_errors$1(); + const { InvalidArgumentError } = require_errors(); const EE$1 = __require("node:events"); const redirectableStatusCodes = [ 300, @@ -6468,7 +6466,7 @@ var require_client = /* @__PURE__ */ __commonJSMin(((exports, module) => { const { channels } = require_diagnostics(); const Request = require_request$1(); const DispatcherBase = require_dispatcher_base(); - const { InvalidArgumentError, InformationalError, ClientDestroyedError } = require_errors$1(); + const { InvalidArgumentError, InformationalError, ClientDestroyedError } = require_errors(); const buildConnector = require_connect(); const { kUrl, kServerName, kClient, kBusy, kConnect, kResuming, kRunning, kPending, kSize, kQueue, kConnected, kConnecting, kNeedDrain, kKeepAliveDefaultTimeout, kHostHeader, kPendingIdx, kRunningIdx, kError, kPipelining, kKeepAliveTimeoutValue, kMaxHeadersSize, kKeepAliveMaxTimeout, kKeepAliveTimeoutThreshold, kHeadersTimeout, kBodyTimeout, kStrictContentLength, kConnector, kMaxRedirections, kMaxRequests, kCounter, kClose, kDestroy, kDispatch, kInterceptors, kLocalAddress, kMaxResponseSize, kOnError, kHTTPContext, kMaxConcurrentStreams, kResume } = require_symbols$4(); const connectH1 = require_client_h1(); @@ -7011,7 +7009,7 @@ var require_pool_base = /* @__PURE__ */ __commonJSMin(((exports, module) => { var require_pool = /* @__PURE__ */ __commonJSMin(((exports, module) => { const { PoolBase, kClients, kNeedDrain, kAddClient, kGetDispatcher } = require_pool_base(); const Client = require_client(); - const { InvalidArgumentError } = require_errors$1(); + const { InvalidArgumentError } = require_errors(); const util = require_util$7(); const { kUrl, kInterceptors } = require_symbols$4(); const buildConnector = require_connect(); @@ -7070,7 +7068,7 @@ var require_pool = /* @__PURE__ */ __commonJSMin(((exports, module) => { //#endregion //#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/dispatcher/balanced-pool.js var require_balanced_pool = /* @__PURE__ */ __commonJSMin(((exports, module) => { - const { BalancedPoolMissingUpstreamError, InvalidArgumentError } = require_errors$1(); + const { BalancedPoolMissingUpstreamError, InvalidArgumentError } = require_errors(); const { PoolBase, kClients, kNeedDrain, kAddClient, kRemoveClient, kGetDispatcher } = require_pool_base(); const Pool = require_pool(); const { kUrl, kInterceptors } = require_symbols$4(); @@ -7181,7 +7179,7 @@ var require_balanced_pool = /* @__PURE__ */ __commonJSMin(((exports, module) => //#endregion //#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/dispatcher/agent.js var require_agent = /* @__PURE__ */ __commonJSMin(((exports, module) => { - const { InvalidArgumentError } = require_errors$1(); + const { InvalidArgumentError } = require_errors(); const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = require_symbols$4(); const DispatcherBase = require_dispatcher_base(); const Pool = require_pool(); @@ -7266,7 +7264,7 @@ var require_proxy_agent = /* @__PURE__ */ __commonJSMin(((exports, module) => { const Agent = require_agent(); const Pool = require_pool(); const DispatcherBase = require_dispatcher_base(); - const { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = require_errors$1(); + const { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = require_errors(); const buildConnector = require_connect(); const Client = require_client(); const kAgent = Symbol("proxy agent"); @@ -7561,7 +7559,7 @@ var require_env_http_proxy_agent = /* @__PURE__ */ __commonJSMin(((exports, modu var require_retry_handler = /* @__PURE__ */ __commonJSMin(((exports, module) => { const assert$15 = __require("node:assert"); const { kRetryHandlerDefaultRetry } = require_symbols$4(); - const { RequestRetryError } = require_errors$1(); + const { RequestRetryError } = require_errors(); const { isDisturbed, parseHeaders, parseRangeHeader, wrapRequestBody } = require_util$7(); function calculateRetryAfterHeader(retryAfter) { const current = Date.now(); @@ -7815,7 +7813,7 @@ var require_retry_agent = /* @__PURE__ */ __commonJSMin(((exports, module) => { var require_readable = /* @__PURE__ */ __commonJSMin(((exports, module) => { const assert$14 = __require("node:assert"); const { Readable: Readable$2 } = __require("node:stream"); - const { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = require_errors$1(); + const { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = require_errors(); const util = require_util$7(); const { ReadableStreamFrom } = require_util$7(); const kConsume = Symbol("kConsume"); @@ -8042,7 +8040,7 @@ var require_readable = /* @__PURE__ */ __commonJSMin(((exports, module) => { //#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/api/util.js var require_util$5 = /* @__PURE__ */ __commonJSMin(((exports, module) => { const assert$13 = __require("node:assert"); - const { ResponseStatusCodeError } = require_errors$1(); + const { ResponseStatusCodeError } = require_errors(); const { chunksDecode } = require_readable(); const CHUNK_LIMIT = 128 * 1024; async function getResolveErrorBodyCallback({ callback, body, contentType, statusCode, statusMessage, headers }) { @@ -8096,7 +8094,7 @@ var require_util$5 = /* @__PURE__ */ __commonJSMin(((exports, module) => { var require_api_request = /* @__PURE__ */ __commonJSMin(((exports, module) => { const assert$12 = __require("node:assert"); const { Readable } = require_readable(); - const { InvalidArgumentError, RequestAbortedError } = require_errors$1(); + const { InvalidArgumentError, RequestAbortedError } = require_errors(); const util = require_util$7(); const { getResolveErrorBodyCallback } = require_util$5(); const { AsyncResource: AsyncResource$4 } = __require("node:async_hooks"); @@ -8247,7 +8245,7 @@ var require_api_request = /* @__PURE__ */ __commonJSMin(((exports, module) => { //#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/api/abort-signal.js var require_abort_signal = /* @__PURE__ */ __commonJSMin(((exports, module) => { const { addAbortListener } = require_util$7(); - const { RequestAbortedError } = require_errors$1(); + const { RequestAbortedError } = require_errors(); const kListener = Symbol("kListener"); const kSignal = Symbol("kSignal"); function abort(self) { @@ -8287,7 +8285,7 @@ var require_abort_signal = /* @__PURE__ */ __commonJSMin(((exports, module) => { var require_api_stream = /* @__PURE__ */ __commonJSMin(((exports, module) => { const assert$11 = __require("node:assert"); const { finished: finished$1, PassThrough: PassThrough$1 } = __require("node:stream"); - const { InvalidArgumentError, InvalidReturnValueError } = require_errors$1(); + const { InvalidArgumentError, InvalidReturnValueError } = require_errors(); const util = require_util$7(); const { getResolveErrorBodyCallback } = require_util$5(); const { AsyncResource: AsyncResource$3 } = __require("node:async_hooks"); @@ -8431,7 +8429,7 @@ var require_api_stream = /* @__PURE__ */ __commonJSMin(((exports, module) => { //#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/api/api-pipeline.js var require_api_pipeline = /* @__PURE__ */ __commonJSMin(((exports, module) => { const { Readable: Readable$1, Duplex, PassThrough } = __require("node:stream"); - const { InvalidArgumentError, InvalidReturnValueError, RequestAbortedError } = require_errors$1(); + const { InvalidArgumentError, InvalidReturnValueError, RequestAbortedError } = require_errors(); const util = require_util$7(); const { AsyncResource: AsyncResource$2 } = __require("node:async_hooks"); const { addSignal, removeSignal } = require_abort_signal(); @@ -8598,7 +8596,7 @@ var require_api_pipeline = /* @__PURE__ */ __commonJSMin(((exports, module) => { //#endregion //#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/api/api-upgrade.js var require_api_upgrade = /* @__PURE__ */ __commonJSMin(((exports, module) => { - const { InvalidArgumentError, SocketError } = require_errors$1(); + const { InvalidArgumentError, SocketError } = require_errors(); const { AsyncResource: AsyncResource$1 } = __require("node:async_hooks"); const util = require_util$7(); const { addSignal, removeSignal } = require_abort_signal(); @@ -8679,7 +8677,7 @@ var require_api_upgrade = /* @__PURE__ */ __commonJSMin(((exports, module) => { var require_api_connect = /* @__PURE__ */ __commonJSMin(((exports, module) => { const assert$8 = __require("node:assert"); const { AsyncResource } = __require("node:async_hooks"); - const { InvalidArgumentError, SocketError } = require_errors$1(); + const { InvalidArgumentError, SocketError } = require_errors(); const util = require_util$7(); const { addSignal, removeSignal } = require_abort_signal(); var ConnectHandler = class extends AsyncResource { @@ -8764,7 +8762,7 @@ var require_api = /* @__PURE__ */ __commonJSMin(((exports, module) => { //#endregion //#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/mock/mock-errors.js var require_mock_errors = /* @__PURE__ */ __commonJSMin(((exports, module) => { - const { UndiciError } = require_errors$1(); + const { UndiciError } = require_errors(); const kMockNotMatchedError = Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED"); module.exports = { MockNotMatchedError: class MockNotMatchedError extends UndiciError { constructor(message) { @@ -9047,7 +9045,7 @@ var require_mock_utils = /* @__PURE__ */ __commonJSMin(((exports, module) => { var require_mock_interceptor = /* @__PURE__ */ __commonJSMin(((exports, module) => { const { getResponseData, buildKey, addMockDispatch } = require_mock_utils(); const { kDispatches, kDispatchKey, kDefaultHeaders, kDefaultTrailers, kContentLength, kMockDispatch } = require_mock_symbols(); - const { InvalidArgumentError } = require_errors$1(); + const { InvalidArgumentError } = require_errors(); const { buildURL } = require_util$7(); /** * Defines the scope API for an interceptor reply @@ -9185,13 +9183,13 @@ var require_mock_interceptor = /* @__PURE__ */ __commonJSMin(((exports, module) //#endregion //#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/mock/mock-client.js var require_mock_client = /* @__PURE__ */ __commonJSMin(((exports, module) => { - const { promisify: promisify$2 } = __require("node:util"); + const { promisify: promisify$1 } = __require("node:util"); const Client = require_client(); const { buildMockDispatch } = require_mock_utils(); const { kDispatches, kMockAgent, kClose, kOriginalClose, kOrigin, kOriginalDispatch, kConnected } = require_mock_symbols(); const { MockInterceptor } = require_mock_interceptor(); const Symbols = require_symbols$4(); - const { InvalidArgumentError } = require_errors$1(); + const { InvalidArgumentError } = require_errors(); /** * MockClient provides an API that extends the Client to influence the mockDispatches. */ @@ -9218,7 +9216,7 @@ var require_mock_client = /* @__PURE__ */ __commonJSMin(((exports, module) => { return new MockInterceptor(opts, this[kDispatches]); } async [kClose]() { - await promisify$2(this[kOriginalClose])(); + await promisify$1(this[kOriginalClose])(); this[kConnected] = 0; this[kMockAgent][Symbols.kClients].delete(this[kOrigin]); } @@ -9228,13 +9226,13 @@ var require_mock_client = /* @__PURE__ */ __commonJSMin(((exports, module) => { //#endregion //#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/mock/mock-pool.js var require_mock_pool = /* @__PURE__ */ __commonJSMin(((exports, module) => { - const { promisify: promisify$1 } = __require("node:util"); + const { promisify } = __require("node:util"); const Pool = require_pool(); const { buildMockDispatch } = require_mock_utils(); const { kDispatches, kMockAgent, kClose, kOriginalClose, kOrigin, kOriginalDispatch, kConnected } = require_mock_symbols(); const { MockInterceptor } = require_mock_interceptor(); const Symbols = require_symbols$4(); - const { InvalidArgumentError } = require_errors$1(); + const { InvalidArgumentError } = require_errors(); /** * MockPool provides an API that extends the Pool to influence the mockDispatches. */ @@ -9261,7 +9259,7 @@ var require_mock_pool = /* @__PURE__ */ __commonJSMin(((exports, module) => { return new MockInterceptor(opts, this[kDispatches]); } async [kClose]() { - await promisify$1(this[kOriginalClose])(); + await promisify(this[kOriginalClose])(); this[kConnected] = 0; this[kMockAgent][Symbols.kClients].delete(this[kOrigin]); } @@ -9344,7 +9342,7 @@ var require_mock_agent = /* @__PURE__ */ __commonJSMin(((exports, module) => { const MockClient = require_mock_client(); const MockPool = require_mock_pool(); const { matchValue, buildMockOptions } = require_mock_utils(); - const { InvalidArgumentError, UndiciError } = require_errors$1(); + const { InvalidArgumentError, UndiciError } = require_errors(); const Dispatcher = require_dispatcher(); const Pluralizer = require_pluralizer(); const PendingInterceptorsFormatter = require_pending_interceptors_formatter(); @@ -9442,7 +9440,7 @@ ${pendingInterceptorsFormatter.format(pending)} //#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/global.js var require_global = /* @__PURE__ */ __commonJSMin(((exports, module) => { const globalDispatcher = Symbol.for("undici.globalDispatcher.1"); - const { InvalidArgumentError } = require_errors$1(); + const { InvalidArgumentError } = require_errors(); const Agent = require_agent(); if (getGlobalDispatcher() === void 0) setGlobalDispatcher(new Agent()); function setGlobalDispatcher(agent) { @@ -9537,7 +9535,7 @@ var require_retry = /* @__PURE__ */ __commonJSMin(((exports, module) => { //#region ../../node_modules/.pnpm/undici@6.23.0/node_modules/undici/lib/interceptor/dump.js var require_dump = /* @__PURE__ */ __commonJSMin(((exports, module) => { const util = require_util$7(); - const { InvalidArgumentError, RequestAbortedError } = require_errors$1(); + const { InvalidArgumentError, RequestAbortedError } = require_errors(); const DecoratorHandler = require_decorator_handler(); var DumpHandler = class extends DecoratorHandler { #maxSize = 1024 * 1024; @@ -9606,7 +9604,7 @@ var require_dns = /* @__PURE__ */ __commonJSMin(((exports, module) => { const { isIP } = __require("node:net"); const { lookup } = __require("node:dns"); const DecoratorHandler = require_decorator_handler(); - const { InvalidArgumentError, InformationalError } = require_errors$1(); + const { InvalidArgumentError, InformationalError } = require_errors(); const maxInt = Math.pow(2, 31) - 1; var DNSInstance = class { #maxTTL = 0; @@ -12065,7 +12063,7 @@ var require_util$4 = /* @__PURE__ */ __commonJSMin(((exports, module) => { const { serializeAMimeType, parseMIMEType } = require_data_url(); const { types: types$1 } = __require("node:util"); const { StringDecoder: StringDecoder$1 } = __require("string_decoder"); - const { btoa: btoa$1 } = __require("node:buffer"); + const { btoa } = __require("node:buffer"); /** @type {PropertyDescriptor} */ const staticPropertyDescriptors = { enumerable: true, @@ -12161,8 +12159,8 @@ var require_util$4 = /* @__PURE__ */ __commonJSMin(((exports, module) => { if (parsed !== "failure") dataURL += serializeAMimeType(parsed); dataURL += ";base64,"; const decoder = new StringDecoder$1("latin1"); - for (const chunk of bytes) dataURL += btoa$1(decoder.write(chunk)); - dataURL += btoa$1(decoder.end()); + for (const chunk of bytes) dataURL += btoa(decoder.write(chunk)); + dataURL += btoa(decoder.end()); return dataURL; } case "Text": { @@ -15493,7 +15491,7 @@ var require_undici = /* @__PURE__ */ __commonJSMin(((exports, module) => { const ProxyAgent = require_proxy_agent(); const EnvHttpProxyAgent = require_env_http_proxy_agent(); const RetryAgent = require_retry_agent(); - const errors = require_errors$1(); + const errors = require_errors(); const util = require_util$7(); const { InvalidArgumentError } = errors; const api = require_api(); @@ -15962,9 +15960,9 @@ var __awaiter$6 = function(thisArg, _arguments, P, generator) { step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -const { chmod, copyFile, lstat, mkdir, open, readdir, rename, rm, rmdir, stat, symlink, unlink } = fs$2.promises; +const { chmod, copyFile, lstat, mkdir, open, readdir, rename, rm, rmdir, stat, symlink, unlink } = fs.promises; const IS_WINDOWS$1 = process.platform === "win32"; -fs$2.constants.O_RDONLY; +fs.constants.O_RDONLY; function exists(fsPath) { return __awaiter$6(this, void 0, void 0, function* () { try { @@ -16002,7 +16000,7 @@ function tryGetExecutablePath(filePath, extensions) { } if (stats && stats.isFile()) { if (IS_WINDOWS$1) { - const upperExt = path$2.extname(filePath).toUpperCase(); + const upperExt = path$1.extname(filePath).toUpperCase(); if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) return filePath; } else if (isUnixExecutable(stats)) return filePath; } @@ -16018,10 +16016,10 @@ function tryGetExecutablePath(filePath, extensions) { if (stats && stats.isFile()) { if (IS_WINDOWS$1) { try { - const directory = path$2.dirname(filePath); - const upperName = path$2.basename(filePath).toUpperCase(); + const directory = path$1.dirname(filePath); + const upperName = path$1.basename(filePath).toUpperCase(); for (const actualName of yield readdir(directory)) if (upperName === actualName.toUpperCase()) { - filePath = path$2.join(directory, actualName); + filePath = path$1.join(directory, actualName); break; } } catch (err) { @@ -16106,21 +16104,21 @@ function findInPath(tool) { if (!tool) throw new Error("parameter 'tool' is required"); const extensions = []; if (IS_WINDOWS$1 && process.env["PATHEXT"]) { - for (const extension of process.env["PATHEXT"].split(path$2.delimiter)) if (extension) extensions.push(extension); + for (const extension of process.env["PATHEXT"].split(path$1.delimiter)) if (extension) extensions.push(extension); } if (isRooted(tool)) { const filePath = yield tryGetExecutablePath(tool, extensions); if (filePath) return [filePath]; return []; } - if (tool.includes(path$2.sep)) return []; + if (tool.includes(path$1.sep)) return []; const directories = []; if (process.env.PATH) { - for (const p of process.env.PATH.split(path$2.delimiter)) if (p) directories.push(p); + for (const p of process.env.PATH.split(path$1.delimiter)) if (p) directories.push(p); } const matches = []; for (const directory of directories) { - const filePath = yield tryGetExecutablePath(path$2.join(directory, tool), extensions); + const filePath = yield tryGetExecutablePath(path$1.join(directory, tool), extensions); if (filePath) matches.push(filePath); } return matches; @@ -16327,7 +16325,7 @@ var ToolRunner = class extends events.EventEmitter { */ exec() { return __awaiter$4(this, void 0, void 0, function* () { - if (!isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) this.toolPath = path$2.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + if (!isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) this.toolPath = path$1.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); this.toolPath = yield which(this.toolPath, true); return new Promise((resolve, reject) => __awaiter$4(this, void 0, void 0, function* () { this._debug(`exec tool: ${this.toolPath}`); @@ -16775,7 +16773,7 @@ var require_proxy = /* @__PURE__ */ __commonJSMin(((exports) => { })); //#endregion //#region ../../node_modules/.pnpm/@actions+github@9.1.1/node_modules/@actions/github/lib/internal/utils.js -var import_lib$2 = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports) => { +var import_lib = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports) => { var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) { if (k2 === void 0) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); @@ -17394,10 +17392,10 @@ function getAuthString(token, options) { return typeof options.auth === "string" ? options.auth : `token ${token}`; } function getProxyAgent(destinationUrl) { - return new import_lib$2.HttpClient().getAgent(destinationUrl); + return new import_lib.HttpClient().getAgent(destinationUrl); } function getProxyAgentDispatcher(destinationUrl) { - return new import_lib$2.HttpClient().getAgentDispatcher(destinationUrl); + return new import_lib.HttpClient().getAgentDispatcher(destinationUrl); } function getProxyFetch(destinationUrl) { const httpDispatcher = getProxyAgentDispatcher(destinationUrl); @@ -19747,9958 +19745,7 @@ function getOctokit(token, options, ...additionalPlugins) { return new (GitHub.plugin(...additionalPlugins))(getOctokitOptions(token, options)); } //#endregion -//#region ../../node_modules/.pnpm/@pnpm+constants@1001.3.1/node_modules/@pnpm/constants/lib/index.js -var require_lib$6 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.USEFUL_NON_ROOT_PNPM_FIELDS = exports.FULL_FILTERED_META_DIR = exports.FULL_META_DIR = exports.ABBREVIATED_META_DIR = exports.WORKSPACE_MANIFEST_FILENAME = exports.STORE_VERSION = exports.LAYOUT_VERSION = exports.ENGINE_NAME = exports.MANIFEST_BASE_NAMES = exports.LOCKFILE_VERSION = exports.LOCKFILE_MAJOR_VERSION = exports.WANTED_LOCKFILE = void 0; - exports.getNodeBinLocationForCurrentOS = getNodeBinLocationForCurrentOS; - exports.getDenoBinLocationForCurrentOS = getDenoBinLocationForCurrentOS; - exports.getBunBinLocationForCurrentOS = getBunBinLocationForCurrentOS; - exports.WANTED_LOCKFILE = "pnpm-lock.yaml"; - exports.LOCKFILE_MAJOR_VERSION = "9"; - exports.LOCKFILE_VERSION = `${exports.LOCKFILE_MAJOR_VERSION}.0`; - exports.MANIFEST_BASE_NAMES = [ - "package.json", - "package.json5", - "package.yaml" - ]; - exports.ENGINE_NAME = `${process.platform};${process.arch};node${process.version.split(".")[0].substring(1)}`; - exports.LAYOUT_VERSION = 5; - exports.STORE_VERSION = "v10"; - exports.WORKSPACE_MANIFEST_FILENAME = "pnpm-workspace.yaml"; - exports.ABBREVIATED_META_DIR = "metadata-v1.3"; - exports.FULL_META_DIR = "metadata-full-v1.3"; - exports.FULL_FILTERED_META_DIR = "metadata-ff-v1.3"; - exports.USEFUL_NON_ROOT_PNPM_FIELDS = ["executionEnv"]; - function getNodeBinLocationForCurrentOS(platform = process.platform) { - return platform === "win32" ? "node.exe" : "bin/node"; - } - function getDenoBinLocationForCurrentOS(platform = process.platform) { - return platform === "win32" ? "deno.exe" : "deno"; - } - function getBunBinLocationForCurrentOS(platform = process.platform) { - return platform === "win32" ? "bun.exe" : "bun"; - } -})); -//#endregion -//#region ../../node_modules/.pnpm/strip-bom@4.0.0/node_modules/strip-bom/index.js -var require_strip_bom = /* @__PURE__ */ __commonJSMin(((exports, module) => { - module.exports = (string) => { - if (typeof string !== "string") throw new TypeError(`Expected a string, got ${typeof string}`); - if (string.charCodeAt(0) === 65279) return string.slice(1); - return string; - }; -})); -//#endregion -//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/common.js -var require_common = /* @__PURE__ */ __commonJSMin(((exports, module) => { - function isNothing(subject) { - return typeof subject === "undefined" || subject === null; - } - function isObject(subject) { - return typeof subject === "object" && subject !== null; - } - function toArray(sequence) { - if (Array.isArray(sequence)) return sequence; - else if (isNothing(sequence)) return []; - return [sequence]; - } - function extend(target, source) { - var index, length, key, sourceKeys; - if (source) { - sourceKeys = Object.keys(source); - for (index = 0, length = sourceKeys.length; index < length; index += 1) { - key = sourceKeys[index]; - target[key] = source[key]; - } - } - return target; - } - function repeat(string, count) { - var result = "", cycle; - for (cycle = 0; cycle < count; cycle += 1) result += string; - return result; - } - function isNegativeZero(number) { - return number === 0 && Number.NEGATIVE_INFINITY === 1 / number; - } - module.exports.isNothing = isNothing; - module.exports.isObject = isObject; - module.exports.toArray = toArray; - module.exports.repeat = repeat; - module.exports.isNegativeZero = isNegativeZero; - module.exports.extend = extend; -})); -//#endregion -//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/exception.js -var require_exception = /* @__PURE__ */ __commonJSMin(((exports, module) => { - function formatError(exception, compact) { - var where = "", message = exception.reason || "(unknown reason)"; - if (!exception.mark) return message; - if (exception.mark.name) where += "in \"" + exception.mark.name + "\" "; - where += "(" + (exception.mark.line + 1) + ":" + (exception.mark.column + 1) + ")"; - if (!compact && exception.mark.snippet) where += "\n\n" + exception.mark.snippet; - return message + " " + where; - } - function YAMLException(reason, mark) { - Error.call(this); - this.name = "YAMLException"; - this.reason = reason; - this.mark = mark; - this.message = formatError(this, false); - if (Error.captureStackTrace) Error.captureStackTrace(this, this.constructor); - else this.stack = (/* @__PURE__ */ new Error()).stack || ""; - } - YAMLException.prototype = Object.create(Error.prototype); - YAMLException.prototype.constructor = YAMLException; - YAMLException.prototype.toString = function toString(compact) { - return this.name + ": " + formatError(this, compact); - }; - module.exports = YAMLException; -})); -//#endregion -//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/snippet.js -var require_snippet = /* @__PURE__ */ __commonJSMin(((exports, module) => { - var common = require_common(); - function getLine(buffer, lineStart, lineEnd, position, maxLineLength) { - var head = ""; - var tail = ""; - var maxHalfLength = Math.floor(maxLineLength / 2) - 1; - if (position - lineStart > maxHalfLength) { - head = " ... "; - lineStart = position - maxHalfLength + head.length; - } - if (lineEnd - position > maxHalfLength) { - tail = " ..."; - lineEnd = position + maxHalfLength - tail.length; - } - return { - str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, "→") + tail, - pos: position - lineStart + head.length - }; - } - function padStart(string, max) { - return common.repeat(" ", max - string.length) + string; - } - function makeSnippet(mark, options) { - options = Object.create(options || null); - if (!mark.buffer) return null; - if (!options.maxLength) options.maxLength = 79; - if (typeof options.indent !== "number") options.indent = 1; - if (typeof options.linesBefore !== "number") options.linesBefore = 3; - if (typeof options.linesAfter !== "number") options.linesAfter = 2; - var re = /\r?\n|\r|\0/g; - var lineStarts = [0]; - var lineEnds = []; - var match; - var foundLineNo = -1; - while (match = re.exec(mark.buffer)) { - lineEnds.push(match.index); - lineStarts.push(match.index + match[0].length); - if (mark.position <= match.index && foundLineNo < 0) foundLineNo = lineStarts.length - 2; - } - if (foundLineNo < 0) foundLineNo = lineStarts.length - 1; - var result = "", i, line; - var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length; - var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3); - for (i = 1; i <= options.linesBefore; i++) { - if (foundLineNo - i < 0) break; - line = getLine(mark.buffer, lineStarts[foundLineNo - i], lineEnds[foundLineNo - i], mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]), maxLineLength); - result = common.repeat(" ", options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) + " | " + line.str + "\n" + result; - } - line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength); - result += common.repeat(" ", options.indent) + padStart((mark.line + 1).toString(), lineNoLength) + " | " + line.str + "\n"; - result += common.repeat("-", options.indent + lineNoLength + 3 + line.pos) + "^\n"; - for (i = 1; i <= options.linesAfter; i++) { - if (foundLineNo + i >= lineEnds.length) break; - line = getLine(mark.buffer, lineStarts[foundLineNo + i], lineEnds[foundLineNo + i], mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]), maxLineLength); - result += common.repeat(" ", options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) + " | " + line.str + "\n"; - } - return result.replace(/\n$/, ""); - } - module.exports = makeSnippet; -})); -//#endregion -//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/type.js -var require_type$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { - var YAMLException = require_exception(); - var TYPE_CONSTRUCTOR_OPTIONS = [ - "kind", - "multi", - "resolve", - "construct", - "instanceOf", - "predicate", - "represent", - "representName", - "defaultStyle", - "styleAliases" - ]; - var YAML_NODE_KINDS = [ - "scalar", - "sequence", - "mapping" - ]; - function compileStyleAliases(map) { - var result = {}; - if (map !== null) Object.keys(map).forEach(function(style) { - map[style].forEach(function(alias) { - result[String(alias)] = style; - }); - }); - return result; - } - function Type(tag, options) { - options = options || {}; - Object.keys(options).forEach(function(name) { - if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) throw new YAMLException("Unknown option \"" + name + "\" is met in definition of \"" + tag + "\" YAML type."); - }); - this.options = options; - this.tag = tag; - this.kind = options["kind"] || null; - this.resolve = options["resolve"] || function() { - return true; - }; - this.construct = options["construct"] || function(data) { - return data; - }; - this.instanceOf = options["instanceOf"] || null; - this.predicate = options["predicate"] || null; - this.represent = options["represent"] || null; - this.representName = options["representName"] || null; - this.defaultStyle = options["defaultStyle"] || null; - this.multi = options["multi"] || false; - this.styleAliases = compileStyleAliases(options["styleAliases"] || null); - if (YAML_NODE_KINDS.indexOf(this.kind) === -1) throw new YAMLException("Unknown kind \"" + this.kind + "\" is specified for \"" + tag + "\" YAML type."); - } - module.exports = Type; -})); -//#endregion -//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/schema.js -var require_schema$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => { - var YAMLException = require_exception(); - var Type = require_type$1(); - function compileList(schema, name) { - var result = []; - schema[name].forEach(function(currentType) { - var newIndex = result.length; - result.forEach(function(previousType, previousIndex) { - if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) newIndex = previousIndex; - }); - result[newIndex] = currentType; - }); - return result; - } - function compileMap() { - var result = { - scalar: {}, - sequence: {}, - mapping: {}, - fallback: {}, - multi: { - scalar: [], - sequence: [], - mapping: [], - fallback: [] - } - }, index, length; - function collectType(type) { - if (type.multi) { - result.multi[type.kind].push(type); - result.multi["fallback"].push(type); - } else result[type.kind][type.tag] = result["fallback"][type.tag] = type; - } - for (index = 0, length = arguments.length; index < length; index += 1) arguments[index].forEach(collectType); - return result; - } - function Schema(definition) { - return this.extend(definition); - } - Schema.prototype.extend = function extend(definition) { - var implicit = []; - var explicit = []; - if (definition instanceof Type) explicit.push(definition); - else if (Array.isArray(definition)) explicit = explicit.concat(definition); - else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) { - if (definition.implicit) implicit = implicit.concat(definition.implicit); - if (definition.explicit) explicit = explicit.concat(definition.explicit); - } else throw new YAMLException("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })"); - implicit.forEach(function(type) { - if (!(type instanceof Type)) throw new YAMLException("Specified list of YAML types (or a single Type object) contains a non-Type object."); - if (type.loadKind && type.loadKind !== "scalar") throw new YAMLException("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported."); - if (type.multi) throw new YAMLException("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit."); - }); - explicit.forEach(function(type) { - if (!(type instanceof Type)) throw new YAMLException("Specified list of YAML types (or a single Type object) contains a non-Type object."); - }); - var result = Object.create(Schema.prototype); - result.implicit = (this.implicit || []).concat(implicit); - result.explicit = (this.explicit || []).concat(explicit); - result.compiledImplicit = compileList(result, "implicit"); - result.compiledExplicit = compileList(result, "explicit"); - result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit); - return result; - }; - module.exports = Schema; -})); -//#endregion -//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/type/str.js -var require_str = /* @__PURE__ */ __commonJSMin(((exports, module) => { - module.exports = new (require_type$1())("tag:yaml.org,2002:str", { - kind: "scalar", - construct: function(data) { - return data !== null ? data : ""; - } - }); -})); -//#endregion -//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/type/seq.js -var require_seq$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { - module.exports = new (require_type$1())("tag:yaml.org,2002:seq", { - kind: "sequence", - construct: function(data) { - return data !== null ? data : []; - } - }); -})); -//#endregion -//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/type/map.js -var require_map$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { - module.exports = new (require_type$1())("tag:yaml.org,2002:map", { - kind: "mapping", - construct: function(data) { - return data !== null ? data : {}; - } - }); -})); -//#endregion -//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/schema/failsafe.js -var require_failsafe = /* @__PURE__ */ __commonJSMin(((exports, module) => { - module.exports = new (require_schema$3())({ explicit: [ - require_str(), - require_seq$1(), - require_map$1() - ] }); -})); -//#endregion -//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/type/null.js -var require_null$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { - var Type = require_type$1(); - function resolveYamlNull(data) { - if (data === null) return true; - var max = data.length; - return max === 1 && data === "~" || max === 4 && (data === "null" || data === "Null" || data === "NULL"); - } - function constructYamlNull() { - return null; - } - function isNull(object) { - return object === null; - } - module.exports = new Type("tag:yaml.org,2002:null", { - kind: "scalar", - resolve: resolveYamlNull, - construct: constructYamlNull, - predicate: isNull, - represent: { - canonical: function() { - return "~"; - }, - lowercase: function() { - return "null"; - }, - uppercase: function() { - return "NULL"; - }, - camelcase: function() { - return "Null"; - }, - empty: function() { - return ""; - } - }, - defaultStyle: "lowercase" - }); -})); -//#endregion -//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/type/bool.js -var require_bool$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => { - var Type = require_type$1(); - function resolveYamlBoolean(data) { - if (data === null) return false; - var max = data.length; - return max === 4 && (data === "true" || data === "True" || data === "TRUE") || max === 5 && (data === "false" || data === "False" || data === "FALSE"); - } - function constructYamlBoolean(data) { - return data === "true" || data === "True" || data === "TRUE"; - } - function isBoolean(object) { - return Object.prototype.toString.call(object) === "[object Boolean]"; - } - module.exports = new Type("tag:yaml.org,2002:bool", { - kind: "scalar", - resolve: resolveYamlBoolean, - construct: constructYamlBoolean, - predicate: isBoolean, - represent: { - lowercase: function(object) { - return object ? "true" : "false"; - }, - uppercase: function(object) { - return object ? "TRUE" : "FALSE"; - }, - camelcase: function(object) { - return object ? "True" : "False"; - } - }, - defaultStyle: "lowercase" - }); -})); -//#endregion -//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/type/int.js -var require_int$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => { - var common = require_common(); - var Type = require_type$1(); - function isHexCode(c) { - return 48 <= c && c <= 57 || 65 <= c && c <= 70 || 97 <= c && c <= 102; - } - function isOctCode(c) { - return 48 <= c && c <= 55; - } - function isDecCode(c) { - return 48 <= c && c <= 57; - } - function resolveYamlInteger(data) { - if (data === null) return false; - var max = data.length, index = 0, hasDigits = false, ch; - if (!max) return false; - ch = data[index]; - if (ch === "-" || ch === "+") ch = data[++index]; - if (ch === "0") { - if (index + 1 === max) return true; - ch = data[++index]; - if (ch === "b") { - index++; - for (; index < max; index++) { - ch = data[index]; - if (ch === "_") continue; - if (ch !== "0" && ch !== "1") return false; - hasDigits = true; - } - return hasDigits && ch !== "_"; - } - if (ch === "x") { - index++; - for (; index < max; index++) { - ch = data[index]; - if (ch === "_") continue; - if (!isHexCode(data.charCodeAt(index))) return false; - hasDigits = true; - } - return hasDigits && ch !== "_"; - } - if (ch === "o") { - index++; - for (; index < max; index++) { - ch = data[index]; - if (ch === "_") continue; - if (!isOctCode(data.charCodeAt(index))) return false; - hasDigits = true; - } - return hasDigits && ch !== "_"; - } - } - if (ch === "_") return false; - for (; index < max; index++) { - ch = data[index]; - if (ch === "_") continue; - if (!isDecCode(data.charCodeAt(index))) return false; - hasDigits = true; - } - if (!hasDigits || ch === "_") return false; - return true; - } - function constructYamlInteger(data) { - var value = data, sign = 1, ch; - if (value.indexOf("_") !== -1) value = value.replace(/_/g, ""); - ch = value[0]; - if (ch === "-" || ch === "+") { - if (ch === "-") sign = -1; - value = value.slice(1); - ch = value[0]; - } - if (value === "0") return 0; - if (ch === "0") { - if (value[1] === "b") return sign * parseInt(value.slice(2), 2); - if (value[1] === "x") return sign * parseInt(value.slice(2), 16); - if (value[1] === "o") return sign * parseInt(value.slice(2), 8); - } - return sign * parseInt(value, 10); - } - function isInteger(object) { - return Object.prototype.toString.call(object) === "[object Number]" && object % 1 === 0 && !common.isNegativeZero(object); - } - module.exports = new Type("tag:yaml.org,2002:int", { - kind: "scalar", - resolve: resolveYamlInteger, - construct: constructYamlInteger, - predicate: isInteger, - represent: { - binary: function(obj) { - return obj >= 0 ? "0b" + obj.toString(2) : "-0b" + obj.toString(2).slice(1); - }, - octal: function(obj) { - return obj >= 0 ? "0o" + obj.toString(8) : "-0o" + obj.toString(8).slice(1); - }, - decimal: function(obj) { - return obj.toString(10); - }, - hexadecimal: function(obj) { - return obj >= 0 ? "0x" + obj.toString(16).toUpperCase() : "-0x" + obj.toString(16).toUpperCase().slice(1); - } - }, - defaultStyle: "decimal", - styleAliases: { - binary: [2, "bin"], - octal: [8, "oct"], - decimal: [10, "dec"], - hexadecimal: [16, "hex"] - } - }); -})); -//#endregion -//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/type/float.js -var require_float$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => { - var common = require_common(); - var Type = require_type$1(); - var YAML_FLOAT_PATTERN = /* @__PURE__ */ new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"); - function resolveYamlFloat(data) { - if (data === null) return false; - if (!YAML_FLOAT_PATTERN.test(data) || data[data.length - 1] === "_") return false; - return true; - } - function constructYamlFloat(data) { - var value = data.replace(/_/g, "").toLowerCase(), sign = value[0] === "-" ? -1 : 1; - if ("+-".indexOf(value[0]) >= 0) value = value.slice(1); - if (value === ".inf") return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; - else if (value === ".nan") return NaN; - return sign * parseFloat(value, 10); - } - var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; - function representYamlFloat(object, style) { - var res; - if (isNaN(object)) switch (style) { - case "lowercase": return ".nan"; - case "uppercase": return ".NAN"; - case "camelcase": return ".NaN"; - } - else if (Number.POSITIVE_INFINITY === object) switch (style) { - case "lowercase": return ".inf"; - case "uppercase": return ".INF"; - case "camelcase": return ".Inf"; - } - else if (Number.NEGATIVE_INFINITY === object) switch (style) { - case "lowercase": return "-.inf"; - case "uppercase": return "-.INF"; - case "camelcase": return "-.Inf"; - } - else if (common.isNegativeZero(object)) return "-0.0"; - res = object.toString(10); - return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace("e", ".e") : res; - } - function isFloat(object) { - return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 !== 0 || common.isNegativeZero(object)); - } - module.exports = new Type("tag:yaml.org,2002:float", { - kind: "scalar", - resolve: resolveYamlFloat, - construct: constructYamlFloat, - predicate: isFloat, - represent: representYamlFloat, - defaultStyle: "lowercase" - }); -})); -//#endregion -//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/schema/json.js -var require_json = /* @__PURE__ */ __commonJSMin(((exports, module) => { - module.exports = require_failsafe().extend({ implicit: [ - require_null$1(), - require_bool$2(), - require_int$2(), - require_float$2() - ] }); -})); -//#endregion -//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/schema/core.js -var require_core = /* @__PURE__ */ __commonJSMin(((exports, module) => { - module.exports = require_json(); -})); -//#endregion -//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/type/timestamp.js -var require_timestamp$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { - var Type = require_type$1(); - var YAML_DATE_REGEXP = /* @__PURE__ */ new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"); - var YAML_TIMESTAMP_REGEXP = /* @__PURE__ */ new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"); - function resolveYamlTimestamp(data) { - if (data === null) return false; - if (YAML_DATE_REGEXP.exec(data) !== null) return true; - if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true; - return false; - } - function constructYamlTimestamp(data) { - var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date; - match = YAML_DATE_REGEXP.exec(data); - if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data); - if (match === null) throw new Error("Date resolve error"); - year = +match[1]; - month = +match[2] - 1; - day = +match[3]; - if (!match[4]) return new Date(Date.UTC(year, month, day)); - hour = +match[4]; - minute = +match[5]; - second = +match[6]; - if (match[7]) { - fraction = match[7].slice(0, 3); - while (fraction.length < 3) fraction += "0"; - fraction = +fraction; - } - if (match[9]) { - tz_hour = +match[10]; - tz_minute = +(match[11] || 0); - delta = (tz_hour * 60 + tz_minute) * 6e4; - if (match[9] === "-") delta = -delta; - } - date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); - if (delta) date.setTime(date.getTime() - delta); - return date; - } - function representYamlTimestamp(object) { - return object.toISOString(); - } - module.exports = new Type("tag:yaml.org,2002:timestamp", { - kind: "scalar", - resolve: resolveYamlTimestamp, - construct: constructYamlTimestamp, - instanceOf: Date, - represent: representYamlTimestamp - }); -})); -//#endregion -//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/type/merge.js -var require_merge$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { - var Type = require_type$1(); - function resolveYamlMerge(data) { - return data === "<<" || data === null; - } - module.exports = new Type("tag:yaml.org,2002:merge", { - kind: "scalar", - resolve: resolveYamlMerge - }); -})); -//#endregion -//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/type/binary.js -var require_binary$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { - var Type = require_type$1(); - var BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r"; - function resolveYamlBinary(data) { - if (data === null) return false; - var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP; - for (idx = 0; idx < max; idx++) { - code = map.indexOf(data.charAt(idx)); - if (code > 64) continue; - if (code < 0) return false; - bitlen += 6; - } - return bitlen % 8 === 0; - } - function constructYamlBinary(data) { - var idx, tailbits, input = data.replace(/[\r\n=]/g, ""), max = input.length, map = BASE64_MAP, bits = 0, result = []; - for (idx = 0; idx < max; idx++) { - if (idx % 4 === 0 && idx) { - result.push(bits >> 16 & 255); - result.push(bits >> 8 & 255); - result.push(bits & 255); - } - bits = bits << 6 | map.indexOf(input.charAt(idx)); - } - tailbits = max % 4 * 6; - if (tailbits === 0) { - result.push(bits >> 16 & 255); - result.push(bits >> 8 & 255); - result.push(bits & 255); - } else if (tailbits === 18) { - result.push(bits >> 10 & 255); - result.push(bits >> 2 & 255); - } else if (tailbits === 12) result.push(bits >> 4 & 255); - return new Uint8Array(result); - } - function representYamlBinary(object) { - var result = "", bits = 0, idx, tail, max = object.length, map = BASE64_MAP; - for (idx = 0; idx < max; idx++) { - if (idx % 3 === 0 && idx) { - result += map[bits >> 18 & 63]; - result += map[bits >> 12 & 63]; - result += map[bits >> 6 & 63]; - result += map[bits & 63]; - } - bits = (bits << 8) + object[idx]; - } - tail = max % 3; - if (tail === 0) { - result += map[bits >> 18 & 63]; - result += map[bits >> 12 & 63]; - result += map[bits >> 6 & 63]; - result += map[bits & 63]; - } else if (tail === 2) { - result += map[bits >> 10 & 63]; - result += map[bits >> 4 & 63]; - result += map[bits << 2 & 63]; - result += map[64]; - } else if (tail === 1) { - result += map[bits >> 2 & 63]; - result += map[bits << 4 & 63]; - result += map[64]; - result += map[64]; - } - return result; - } - function isBinary(obj) { - return Object.prototype.toString.call(obj) === "[object Uint8Array]"; - } - module.exports = new Type("tag:yaml.org,2002:binary", { - kind: "scalar", - resolve: resolveYamlBinary, - construct: constructYamlBinary, - predicate: isBinary, - represent: representYamlBinary - }); -})); -//#endregion -//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/type/omap.js -var require_omap$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { - var Type = require_type$1(); - var _hasOwnProperty = Object.prototype.hasOwnProperty; - var _toString = Object.prototype.toString; - function resolveYamlOmap(data) { - if (data === null) return true; - var objectKeys = [], index, length, pair, pairKey, pairHasKey, object = data; - for (index = 0, length = object.length; index < length; index += 1) { - pair = object[index]; - pairHasKey = false; - if (_toString.call(pair) !== "[object Object]") return false; - for (pairKey in pair) if (_hasOwnProperty.call(pair, pairKey)) if (!pairHasKey) pairHasKey = true; - else return false; - if (!pairHasKey) return false; - if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey); - else return false; - } - return true; - } - function constructYamlOmap(data) { - return data !== null ? data : []; - } - module.exports = new Type("tag:yaml.org,2002:omap", { - kind: "sequence", - resolve: resolveYamlOmap, - construct: constructYamlOmap - }); -})); -//#endregion -//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/type/pairs.js -var require_pairs$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { - var Type = require_type$1(); - var _toString = Object.prototype.toString; - function resolveYamlPairs(data) { - if (data === null) return true; - var index, length, pair, keys, result, object = data; - result = new Array(object.length); - for (index = 0, length = object.length; index < length; index += 1) { - pair = object[index]; - if (_toString.call(pair) !== "[object Object]") return false; - keys = Object.keys(pair); - if (keys.length !== 1) return false; - result[index] = [keys[0], pair[keys[0]]]; - } - return true; - } - function constructYamlPairs(data) { - if (data === null) return []; - var index, length, pair, keys, result, object = data; - result = new Array(object.length); - for (index = 0, length = object.length; index < length; index += 1) { - pair = object[index]; - keys = Object.keys(pair); - result[index] = [keys[0], pair[keys[0]]]; - } - return result; - } - module.exports = new Type("tag:yaml.org,2002:pairs", { - kind: "sequence", - resolve: resolveYamlPairs, - construct: constructYamlPairs - }); -})); -//#endregion -//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/type/set.js -var require_set$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { - var Type = require_type$1(); - var _hasOwnProperty = Object.prototype.hasOwnProperty; - function resolveYamlSet(data) { - if (data === null) return true; - var key, object = data; - for (key in object) if (_hasOwnProperty.call(object, key)) { - if (object[key] !== null) return false; - } - return true; - } - function constructYamlSet(data) { - return data !== null ? data : {}; - } - module.exports = new Type("tag:yaml.org,2002:set", { - kind: "mapping", - resolve: resolveYamlSet, - construct: constructYamlSet - }); -})); -//#endregion -//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/schema/default.js -var require_default = /* @__PURE__ */ __commonJSMin(((exports, module) => { - module.exports = require_core().extend({ - implicit: [require_timestamp$1(), require_merge$1()], - explicit: [ - require_binary$1(), - require_omap$1(), - require_pairs$1(), - require_set$1() - ] - }); -})); -//#endregion -//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/loader.js -var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => { - var common = require_common(); - var YAMLException = require_exception(); - var makeSnippet = require_snippet(); - var DEFAULT_SCHEMA = require_default(); - var _hasOwnProperty = Object.prototype.hasOwnProperty; - var CONTEXT_FLOW_IN = 1; - var CONTEXT_FLOW_OUT = 2; - var CONTEXT_BLOCK_IN = 3; - var CONTEXT_BLOCK_OUT = 4; - var CHOMPING_CLIP = 1; - var CHOMPING_STRIP = 2; - var CHOMPING_KEEP = 3; - var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; - var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/; - var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/; - var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i; - var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; - function _class(obj) { - return Object.prototype.toString.call(obj); - } - function is_EOL(c) { - return c === 10 || c === 13; - } - function is_WHITE_SPACE(c) { - return c === 9 || c === 32; - } - function is_WS_OR_EOL(c) { - return c === 9 || c === 32 || c === 10 || c === 13; - } - function is_FLOW_INDICATOR(c) { - return c === 44 || c === 91 || c === 93 || c === 123 || c === 125; - } - function fromHexCode(c) { - var lc; - if (48 <= c && c <= 57) return c - 48; - lc = c | 32; - if (97 <= lc && lc <= 102) return lc - 97 + 10; - return -1; - } - function escapedHexLen(c) { - if (c === 120) return 2; - if (c === 117) return 4; - if (c === 85) return 8; - return 0; - } - function fromDecimalCode(c) { - if (48 <= c && c <= 57) return c - 48; - return -1; - } - function simpleEscapeSequence(c) { - return c === 48 ? "\0" : c === 97 ? "\x07" : c === 98 ? "\b" : c === 116 ? " " : c === 9 ? " " : c === 110 ? "\n" : c === 118 ? "\v" : c === 102 ? "\f" : c === 114 ? "\r" : c === 101 ? "\x1B" : c === 32 ? " " : c === 34 ? "\"" : c === 47 ? "/" : c === 92 ? "\\" : c === 78 ? "…" : c === 95 ? "\xA0" : c === 76 ? "\u2028" : c === 80 ? "\u2029" : ""; - } - function charFromCodepoint(c) { - if (c <= 65535) return String.fromCharCode(c); - return String.fromCharCode((c - 65536 >> 10) + 55296, (c - 65536 & 1023) + 56320); - } - function setProperty(object, key, value) { - if (key === "__proto__") Object.defineProperty(object, key, { - configurable: true, - enumerable: true, - writable: true, - value - }); - else object[key] = value; - } - var simpleEscapeCheck = new Array(256); - var simpleEscapeMap = new Array(256); - for (var i = 0; i < 256; i++) { - simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0; - simpleEscapeMap[i] = simpleEscapeSequence(i); - } - function State(input, options) { - this.input = input; - this.filename = options["filename"] || null; - this.schema = options["schema"] || DEFAULT_SCHEMA; - this.onWarning = options["onWarning"] || null; - this.legacy = options["legacy"] || false; - this.json = options["json"] || false; - this.listener = options["listener"] || null; - this.implicitTypes = this.schema.compiledImplicit; - this.typeMap = this.schema.compiledTypeMap; - this.length = input.length; - this.position = 0; - this.line = 0; - this.lineStart = 0; - this.lineIndent = 0; - this.firstTabInLine = -1; - this.documents = []; - } - function generateError(state, message) { - var mark = { - name: state.filename, - buffer: state.input.slice(0, -1), - position: state.position, - line: state.line, - column: state.position - state.lineStart - }; - mark.snippet = makeSnippet(mark); - return new YAMLException(message, mark); - } - function throwError(state, message) { - throw generateError(state, message); - } - function throwWarning(state, message) { - if (state.onWarning) state.onWarning.call(null, generateError(state, message)); - } - var directiveHandlers = { - YAML: function handleYamlDirective(state, name, args) { - var match, major, minor; - if (state.version !== null) throwError(state, "duplication of %YAML directive"); - if (args.length !== 1) throwError(state, "YAML directive accepts exactly one argument"); - match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); - if (match === null) throwError(state, "ill-formed argument of the YAML directive"); - major = parseInt(match[1], 10); - minor = parseInt(match[2], 10); - if (major !== 1) throwError(state, "unacceptable YAML version of the document"); - state.version = args[0]; - state.checkLineBreaks = minor < 2; - if (minor !== 1 && minor !== 2) throwWarning(state, "unsupported YAML version of the document"); - }, - TAG: function handleTagDirective(state, name, args) { - var handle, prefix; - if (args.length !== 2) throwError(state, "TAG directive accepts exactly two arguments"); - handle = args[0]; - prefix = args[1]; - if (!PATTERN_TAG_HANDLE.test(handle)) throwError(state, "ill-formed tag handle (first argument) of the TAG directive"); - if (_hasOwnProperty.call(state.tagMap, handle)) throwError(state, "there is a previously declared suffix for \"" + handle + "\" tag handle"); - if (!PATTERN_TAG_URI.test(prefix)) throwError(state, "ill-formed tag prefix (second argument) of the TAG directive"); - try { - prefix = decodeURIComponent(prefix); - } catch (err) { - throwError(state, "tag prefix is malformed: " + prefix); - } - state.tagMap[handle] = prefix; - } - }; - function captureSegment(state, start, end, checkJson) { - var _position, _length, _character, _result; - if (start < end) { - _result = state.input.slice(start, end); - if (checkJson) for (_position = 0, _length = _result.length; _position < _length; _position += 1) { - _character = _result.charCodeAt(_position); - if (!(_character === 9 || 32 <= _character && _character <= 1114111)) throwError(state, "expected valid JSON character"); - } - else if (PATTERN_NON_PRINTABLE.test(_result)) throwError(state, "the stream contains non-printable characters"); - state.result += _result; - } - } - function mergeMappings(state, destination, source, overridableKeys) { - var sourceKeys, key, index, quantity; - if (!common.isObject(source)) throwError(state, "cannot merge mappings; the provided source object is unacceptable"); - sourceKeys = Object.keys(source); - for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { - key = sourceKeys[index]; - if (!_hasOwnProperty.call(destination, key)) { - setProperty(destination, key, source[key]); - overridableKeys[key] = true; - } - } - } - function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startLineStart, startPos) { - var index, quantity; - if (Array.isArray(keyNode)) { - keyNode = Array.prototype.slice.call(keyNode); - for (index = 0, quantity = keyNode.length; index < quantity; index += 1) { - if (Array.isArray(keyNode[index])) throwError(state, "nested arrays are not supported inside keys"); - if (typeof keyNode === "object" && _class(keyNode[index]) === "[object Object]") keyNode[index] = "[object Object]"; - } - } - if (typeof keyNode === "object" && _class(keyNode) === "[object Object]") keyNode = "[object Object]"; - keyNode = String(keyNode); - if (_result === null) _result = {}; - if (keyTag === "tag:yaml.org,2002:merge") if (Array.isArray(valueNode)) for (index = 0, quantity = valueNode.length; index < quantity; index += 1) mergeMappings(state, _result, valueNode[index], overridableKeys); - else mergeMappings(state, _result, valueNode, overridableKeys); - else { - if (!state.json && !_hasOwnProperty.call(overridableKeys, keyNode) && _hasOwnProperty.call(_result, keyNode)) { - state.line = startLine || state.line; - state.lineStart = startLineStart || state.lineStart; - state.position = startPos || state.position; - throwError(state, "duplicated mapping key"); - } - setProperty(_result, keyNode, valueNode); - delete overridableKeys[keyNode]; - } - return _result; - } - function readLineBreak(state) { - var ch = state.input.charCodeAt(state.position); - if (ch === 10) state.position++; - else if (ch === 13) { - state.position++; - if (state.input.charCodeAt(state.position) === 10) state.position++; - } else throwError(state, "a line break is expected"); - state.line += 1; - state.lineStart = state.position; - state.firstTabInLine = -1; - } - function skipSeparationSpace(state, allowComments, checkIndent) { - var lineBreaks = 0, ch = state.input.charCodeAt(state.position); - while (ch !== 0) { - while (is_WHITE_SPACE(ch)) { - if (ch === 9 && state.firstTabInLine === -1) state.firstTabInLine = state.position; - ch = state.input.charCodeAt(++state.position); - } - if (allowComments && ch === 35) do - ch = state.input.charCodeAt(++state.position); - while (ch !== 10 && ch !== 13 && ch !== 0); - if (is_EOL(ch)) { - readLineBreak(state); - ch = state.input.charCodeAt(state.position); - lineBreaks++; - state.lineIndent = 0; - while (ch === 32) { - state.lineIndent++; - ch = state.input.charCodeAt(++state.position); - } - } else break; - } - if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) throwWarning(state, "deficient indentation"); - return lineBreaks; - } - function testDocumentSeparator(state) { - var _position = state.position, ch = state.input.charCodeAt(_position); - if ((ch === 45 || ch === 46) && ch === state.input.charCodeAt(_position + 1) && ch === state.input.charCodeAt(_position + 2)) { - _position += 3; - ch = state.input.charCodeAt(_position); - if (ch === 0 || is_WS_OR_EOL(ch)) return true; - } - return false; - } - function writeFoldedLines(state, count) { - if (count === 1) state.result += " "; - else if (count > 1) state.result += common.repeat("\n", count - 1); - } - function readPlainScalar(state, nodeIndent, withinFlowCollection) { - var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state.kind, _result = state.result, ch = state.input.charCodeAt(state.position); - if (is_WS_OR_EOL(ch) || is_FLOW_INDICATOR(ch) || ch === 35 || ch === 38 || ch === 42 || ch === 33 || ch === 124 || ch === 62 || ch === 39 || ch === 34 || ch === 37 || ch === 64 || ch === 96) return false; - if (ch === 63 || ch === 45) { - following = state.input.charCodeAt(state.position + 1); - if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) return false; - } - state.kind = "scalar"; - state.result = ""; - captureStart = captureEnd = state.position; - hasPendingContent = false; - while (ch !== 0) { - if (ch === 58) { - following = state.input.charCodeAt(state.position + 1); - if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) break; - } else if (ch === 35) { - preceding = state.input.charCodeAt(state.position - 1); - if (is_WS_OR_EOL(preceding)) break; - } else if (state.position === state.lineStart && testDocumentSeparator(state) || withinFlowCollection && is_FLOW_INDICATOR(ch)) break; - else if (is_EOL(ch)) { - _line = state.line; - _lineStart = state.lineStart; - _lineIndent = state.lineIndent; - skipSeparationSpace(state, false, -1); - if (state.lineIndent >= nodeIndent) { - hasPendingContent = true; - ch = state.input.charCodeAt(state.position); - continue; - } else { - state.position = captureEnd; - state.line = _line; - state.lineStart = _lineStart; - state.lineIndent = _lineIndent; - break; - } - } - if (hasPendingContent) { - captureSegment(state, captureStart, captureEnd, false); - writeFoldedLines(state, state.line - _line); - captureStart = captureEnd = state.position; - hasPendingContent = false; - } - if (!is_WHITE_SPACE(ch)) captureEnd = state.position + 1; - ch = state.input.charCodeAt(++state.position); - } - captureSegment(state, captureStart, captureEnd, false); - if (state.result) return true; - state.kind = _kind; - state.result = _result; - return false; - } - function readSingleQuotedScalar(state, nodeIndent) { - var ch = state.input.charCodeAt(state.position), captureStart, captureEnd; - if (ch !== 39) return false; - state.kind = "scalar"; - state.result = ""; - state.position++; - captureStart = captureEnd = state.position; - while ((ch = state.input.charCodeAt(state.position)) !== 0) if (ch === 39) { - captureSegment(state, captureStart, state.position, true); - ch = state.input.charCodeAt(++state.position); - if (ch === 39) { - captureStart = state.position; - state.position++; - captureEnd = state.position; - } else return true; - } else if (is_EOL(ch)) { - captureSegment(state, captureStart, captureEnd, true); - writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); - captureStart = captureEnd = state.position; - } else if (state.position === state.lineStart && testDocumentSeparator(state)) throwError(state, "unexpected end of the document within a single quoted scalar"); - else { - state.position++; - captureEnd = state.position; - } - throwError(state, "unexpected end of the stream within a single quoted scalar"); - } - function readDoubleQuotedScalar(state, nodeIndent) { - var captureStart, captureEnd, hexLength, hexResult, tmp, ch = state.input.charCodeAt(state.position); - if (ch !== 34) return false; - state.kind = "scalar"; - state.result = ""; - state.position++; - captureStart = captureEnd = state.position; - while ((ch = state.input.charCodeAt(state.position)) !== 0) if (ch === 34) { - captureSegment(state, captureStart, state.position, true); - state.position++; - return true; - } else if (ch === 92) { - captureSegment(state, captureStart, state.position, true); - ch = state.input.charCodeAt(++state.position); - if (is_EOL(ch)) skipSeparationSpace(state, false, nodeIndent); - else if (ch < 256 && simpleEscapeCheck[ch]) { - state.result += simpleEscapeMap[ch]; - state.position++; - } else if ((tmp = escapedHexLen(ch)) > 0) { - hexLength = tmp; - hexResult = 0; - for (; hexLength > 0; hexLength--) { - ch = state.input.charCodeAt(++state.position); - if ((tmp = fromHexCode(ch)) >= 0) hexResult = (hexResult << 4) + tmp; - else throwError(state, "expected hexadecimal character"); - } - state.result += charFromCodepoint(hexResult); - state.position++; - } else throwError(state, "unknown escape sequence"); - captureStart = captureEnd = state.position; - } else if (is_EOL(ch)) { - captureSegment(state, captureStart, captureEnd, true); - writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); - captureStart = captureEnd = state.position; - } else if (state.position === state.lineStart && testDocumentSeparator(state)) throwError(state, "unexpected end of the document within a double quoted scalar"); - else { - state.position++; - captureEnd = state.position; - } - throwError(state, "unexpected end of the stream within a double quoted scalar"); - } - function readFlowCollection(state, nodeIndent) { - var readNext = true, _line, _lineStart, _pos, _tag = state.tag, _result, _anchor = state.anchor, following, terminator, isPair, isExplicitPair, isMapping, overridableKeys = Object.create(null), keyNode, keyTag, valueNode, ch = state.input.charCodeAt(state.position); - if (ch === 91) { - terminator = 93; - isMapping = false; - _result = []; - } else if (ch === 123) { - terminator = 125; - isMapping = true; - _result = {}; - } else return false; - if (state.anchor !== null) state.anchorMap[state.anchor] = _result; - ch = state.input.charCodeAt(++state.position); - while (ch !== 0) { - skipSeparationSpace(state, true, nodeIndent); - ch = state.input.charCodeAt(state.position); - if (ch === terminator) { - state.position++; - state.tag = _tag; - state.anchor = _anchor; - state.kind = isMapping ? "mapping" : "sequence"; - state.result = _result; - return true; - } else if (!readNext) throwError(state, "missed comma between flow collection entries"); - else if (ch === 44) throwError(state, "expected the node content, but found ','"); - keyTag = keyNode = valueNode = null; - isPair = isExplicitPair = false; - if (ch === 63) { - following = state.input.charCodeAt(state.position + 1); - if (is_WS_OR_EOL(following)) { - isPair = isExplicitPair = true; - state.position++; - skipSeparationSpace(state, true, nodeIndent); - } - } - _line = state.line; - _lineStart = state.lineStart; - _pos = state.position; - composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); - keyTag = state.tag; - keyNode = state.result; - skipSeparationSpace(state, true, nodeIndent); - ch = state.input.charCodeAt(state.position); - if ((isExplicitPair || state.line === _line) && ch === 58) { - isPair = true; - ch = state.input.charCodeAt(++state.position); - skipSeparationSpace(state, true, nodeIndent); - composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); - valueNode = state.result; - } - if (isMapping) storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos); - else if (isPair) _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos)); - else _result.push(keyNode); - skipSeparationSpace(state, true, nodeIndent); - ch = state.input.charCodeAt(state.position); - if (ch === 44) { - readNext = true; - ch = state.input.charCodeAt(++state.position); - } else readNext = false; - } - throwError(state, "unexpected end of the stream within a flow collection"); - } - function readBlockScalar(state, nodeIndent) { - var captureStart, folding, chomping = CHOMPING_CLIP, didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch = state.input.charCodeAt(state.position); - if (ch === 124) folding = false; - else if (ch === 62) folding = true; - else return false; - state.kind = "scalar"; - state.result = ""; - while (ch !== 0) { - ch = state.input.charCodeAt(++state.position); - if (ch === 43 || ch === 45) if (CHOMPING_CLIP === chomping) chomping = ch === 43 ? CHOMPING_KEEP : CHOMPING_STRIP; - else throwError(state, "repeat of a chomping mode identifier"); - else if ((tmp = fromDecimalCode(ch)) >= 0) if (tmp === 0) throwError(state, "bad explicit indentation width of a block scalar; it cannot be less than one"); - else if (!detectedIndent) { - textIndent = nodeIndent + tmp - 1; - detectedIndent = true; - } else throwError(state, "repeat of an indentation width identifier"); - else break; - } - if (is_WHITE_SPACE(ch)) { - do - ch = state.input.charCodeAt(++state.position); - while (is_WHITE_SPACE(ch)); - if (ch === 35) do - ch = state.input.charCodeAt(++state.position); - while (!is_EOL(ch) && ch !== 0); - } - while (ch !== 0) { - readLineBreak(state); - state.lineIndent = 0; - ch = state.input.charCodeAt(state.position); - while ((!detectedIndent || state.lineIndent < textIndent) && ch === 32) { - state.lineIndent++; - ch = state.input.charCodeAt(++state.position); - } - if (!detectedIndent && state.lineIndent > textIndent) textIndent = state.lineIndent; - if (is_EOL(ch)) { - emptyLines++; - continue; - } - if (state.lineIndent < textIndent) { - if (chomping === CHOMPING_KEEP) state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines); - else if (chomping === CHOMPING_CLIP) { - if (didReadContent) state.result += "\n"; - } - break; - } - if (folding) if (is_WHITE_SPACE(ch)) { - atMoreIndented = true; - state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines); - } else if (atMoreIndented) { - atMoreIndented = false; - state.result += common.repeat("\n", emptyLines + 1); - } else if (emptyLines === 0) { - if (didReadContent) state.result += " "; - } else state.result += common.repeat("\n", emptyLines); - else state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines); - didReadContent = true; - detectedIndent = true; - emptyLines = 0; - captureStart = state.position; - while (!is_EOL(ch) && ch !== 0) ch = state.input.charCodeAt(++state.position); - captureSegment(state, captureStart, state.position, false); - } - return true; - } - function readBlockSequence(state, nodeIndent) { - var _line, _tag = state.tag, _anchor = state.anchor, _result = [], following, detected = false, ch; - if (state.firstTabInLine !== -1) return false; - if (state.anchor !== null) state.anchorMap[state.anchor] = _result; - ch = state.input.charCodeAt(state.position); - while (ch !== 0) { - if (state.firstTabInLine !== -1) { - state.position = state.firstTabInLine; - throwError(state, "tab characters must not be used in indentation"); - } - if (ch !== 45) break; - following = state.input.charCodeAt(state.position + 1); - if (!is_WS_OR_EOL(following)) break; - detected = true; - state.position++; - if (skipSeparationSpace(state, true, -1)) { - if (state.lineIndent <= nodeIndent) { - _result.push(null); - ch = state.input.charCodeAt(state.position); - continue; - } - } - _line = state.line; - composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true); - _result.push(state.result); - skipSeparationSpace(state, true, -1); - ch = state.input.charCodeAt(state.position); - if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) throwError(state, "bad indentation of a sequence entry"); - else if (state.lineIndent < nodeIndent) break; - } - if (detected) { - state.tag = _tag; - state.anchor = _anchor; - state.kind = "sequence"; - state.result = _result; - return true; - } - return false; - } - function readBlockMapping(state, nodeIndent, flowIndent) { - var following, allowCompact, _line, _keyLine, _keyLineStart, _keyPos, _tag = state.tag, _anchor = state.anchor, _result = {}, overridableKeys = Object.create(null), keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch; - if (state.firstTabInLine !== -1) return false; - if (state.anchor !== null) state.anchorMap[state.anchor] = _result; - ch = state.input.charCodeAt(state.position); - while (ch !== 0) { - if (!atExplicitKey && state.firstTabInLine !== -1) { - state.position = state.firstTabInLine; - throwError(state, "tab characters must not be used in indentation"); - } - following = state.input.charCodeAt(state.position + 1); - _line = state.line; - if ((ch === 63 || ch === 58) && is_WS_OR_EOL(following)) { - if (ch === 63) { - if (atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); - keyTag = keyNode = valueNode = null; - } - detected = true; - atExplicitKey = true; - allowCompact = true; - } else if (atExplicitKey) { - atExplicitKey = false; - allowCompact = true; - } else throwError(state, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"); - state.position += 1; - ch = following; - } else { - _keyLine = state.line; - _keyLineStart = state.lineStart; - _keyPos = state.position; - if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) break; - if (state.line === _line) { - ch = state.input.charCodeAt(state.position); - while (is_WHITE_SPACE(ch)) ch = state.input.charCodeAt(++state.position); - if (ch === 58) { - ch = state.input.charCodeAt(++state.position); - if (!is_WS_OR_EOL(ch)) throwError(state, "a whitespace character is expected after the key-value separator within a block mapping"); - if (atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); - keyTag = keyNode = valueNode = null; - } - detected = true; - atExplicitKey = false; - allowCompact = false; - keyTag = state.tag; - keyNode = state.result; - } else if (detected) throwError(state, "can not read an implicit mapping pair; a colon is missed"); - else { - state.tag = _tag; - state.anchor = _anchor; - return true; - } - } else if (detected) throwError(state, "can not read a block mapping entry; a multiline key may not be an implicit key"); - else { - state.tag = _tag; - state.anchor = _anchor; - return true; - } - } - if (state.line === _line || state.lineIndent > nodeIndent) { - if (atExplicitKey) { - _keyLine = state.line; - _keyLineStart = state.lineStart; - _keyPos = state.position; - } - if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) if (atExplicitKey) keyNode = state.result; - else valueNode = state.result; - if (!atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos); - keyTag = keyNode = valueNode = null; - } - skipSeparationSpace(state, true, -1); - ch = state.input.charCodeAt(state.position); - } - if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) throwError(state, "bad indentation of a mapping entry"); - else if (state.lineIndent < nodeIndent) break; - } - if (atExplicitKey) storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); - if (detected) { - state.tag = _tag; - state.anchor = _anchor; - state.kind = "mapping"; - state.result = _result; - } - return detected; - } - function readTagProperty(state) { - var _position, isVerbatim = false, isNamed = false, tagHandle, tagName, ch = state.input.charCodeAt(state.position); - if (ch !== 33) return false; - if (state.tag !== null) throwError(state, "duplication of a tag property"); - ch = state.input.charCodeAt(++state.position); - if (ch === 60) { - isVerbatim = true; - ch = state.input.charCodeAt(++state.position); - } else if (ch === 33) { - isNamed = true; - tagHandle = "!!"; - ch = state.input.charCodeAt(++state.position); - } else tagHandle = "!"; - _position = state.position; - if (isVerbatim) { - do - ch = state.input.charCodeAt(++state.position); - while (ch !== 0 && ch !== 62); - if (state.position < state.length) { - tagName = state.input.slice(_position, state.position); - ch = state.input.charCodeAt(++state.position); - } else throwError(state, "unexpected end of the stream within a verbatim tag"); - } else { - while (ch !== 0 && !is_WS_OR_EOL(ch)) { - if (ch === 33) if (!isNamed) { - tagHandle = state.input.slice(_position - 1, state.position + 1); - if (!PATTERN_TAG_HANDLE.test(tagHandle)) throwError(state, "named tag handle cannot contain such characters"); - isNamed = true; - _position = state.position + 1; - } else throwError(state, "tag suffix cannot contain exclamation marks"); - ch = state.input.charCodeAt(++state.position); - } - tagName = state.input.slice(_position, state.position); - if (PATTERN_FLOW_INDICATORS.test(tagName)) throwError(state, "tag suffix cannot contain flow indicator characters"); - } - if (tagName && !PATTERN_TAG_URI.test(tagName)) throwError(state, "tag name cannot contain such characters: " + tagName); - try { - tagName = decodeURIComponent(tagName); - } catch (err) { - throwError(state, "tag name is malformed: " + tagName); - } - if (isVerbatim) state.tag = tagName; - else if (_hasOwnProperty.call(state.tagMap, tagHandle)) state.tag = state.tagMap[tagHandle] + tagName; - else if (tagHandle === "!") state.tag = "!" + tagName; - else if (tagHandle === "!!") state.tag = "tag:yaml.org,2002:" + tagName; - else throwError(state, "undeclared tag handle \"" + tagHandle + "\""); - return true; - } - function readAnchorProperty(state) { - var _position, ch = state.input.charCodeAt(state.position); - if (ch !== 38) return false; - if (state.anchor !== null) throwError(state, "duplication of an anchor property"); - ch = state.input.charCodeAt(++state.position); - _position = state.position; - while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) ch = state.input.charCodeAt(++state.position); - if (state.position === _position) throwError(state, "name of an anchor node must contain at least one character"); - state.anchor = state.input.slice(_position, state.position); - return true; - } - function readAlias(state) { - var _position, alias, ch = state.input.charCodeAt(state.position); - if (ch !== 42) return false; - ch = state.input.charCodeAt(++state.position); - _position = state.position; - while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) ch = state.input.charCodeAt(++state.position); - if (state.position === _position) throwError(state, "name of an alias node must contain at least one character"); - alias = state.input.slice(_position, state.position); - if (!_hasOwnProperty.call(state.anchorMap, alias)) throwError(state, "unidentified alias \"" + alias + "\""); - state.result = state.anchorMap[alias]; - skipSeparationSpace(state, true, -1); - return true; - } - function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) { - var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, atNewLine = false, hasContent = false, typeIndex, typeQuantity, typeList, type, flowIndent, blockIndent; - if (state.listener !== null) state.listener("open", state); - state.tag = null; - state.anchor = null; - state.kind = null; - state.result = null; - allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT === nodeContext || CONTEXT_BLOCK_IN === nodeContext; - if (allowToSeek) { - if (skipSeparationSpace(state, true, -1)) { - atNewLine = true; - if (state.lineIndent > parentIndent) indentStatus = 1; - else if (state.lineIndent === parentIndent) indentStatus = 0; - else if (state.lineIndent < parentIndent) indentStatus = -1; - } - } - if (indentStatus === 1) while (readTagProperty(state) || readAnchorProperty(state)) if (skipSeparationSpace(state, true, -1)) { - atNewLine = true; - allowBlockCollections = allowBlockStyles; - if (state.lineIndent > parentIndent) indentStatus = 1; - else if (state.lineIndent === parentIndent) indentStatus = 0; - else if (state.lineIndent < parentIndent) indentStatus = -1; - } else allowBlockCollections = false; - if (allowBlockCollections) allowBlockCollections = atNewLine || allowCompact; - if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) { - if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) flowIndent = parentIndent; - else flowIndent = parentIndent + 1; - blockIndent = state.position - state.lineStart; - if (indentStatus === 1) if (allowBlockCollections && (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent)) || readFlowCollection(state, flowIndent)) hasContent = true; - else { - if (allowBlockScalars && readBlockScalar(state, flowIndent) || readSingleQuotedScalar(state, flowIndent) || readDoubleQuotedScalar(state, flowIndent)) hasContent = true; - else if (readAlias(state)) { - hasContent = true; - if (state.tag !== null || state.anchor !== null) throwError(state, "alias node should not have any properties"); - } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { - hasContent = true; - if (state.tag === null) state.tag = "?"; - } - if (state.anchor !== null) state.anchorMap[state.anchor] = state.result; - } - else if (indentStatus === 0) hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); - } - if (state.tag === null) { - if (state.anchor !== null) state.anchorMap[state.anchor] = state.result; - } else if (state.tag === "?") { - if (state.result !== null && state.kind !== "scalar") throwError(state, "unacceptable node kind for ! tag; it should be \"scalar\", not \"" + state.kind + "\""); - for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { - type = state.implicitTypes[typeIndex]; - if (type.resolve(state.result)) { - state.result = type.construct(state.result); - state.tag = type.tag; - if (state.anchor !== null) state.anchorMap[state.anchor] = state.result; - break; - } - } - } else if (state.tag !== "!") { - if (_hasOwnProperty.call(state.typeMap[state.kind || "fallback"], state.tag)) type = state.typeMap[state.kind || "fallback"][state.tag]; - else { - type = null; - typeList = state.typeMap.multi[state.kind || "fallback"]; - for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) { - type = typeList[typeIndex]; - break; - } - } - if (!type) throwError(state, "unknown tag !<" + state.tag + ">"); - if (state.result !== null && type.kind !== state.kind) throwError(state, "unacceptable node kind for !<" + state.tag + "> tag; it should be \"" + type.kind + "\", not \"" + state.kind + "\""); - if (!type.resolve(state.result, state.tag)) throwError(state, "cannot resolve a node with !<" + state.tag + "> explicit tag"); - else { - state.result = type.construct(state.result, state.tag); - if (state.anchor !== null) state.anchorMap[state.anchor] = state.result; - } - } - if (state.listener !== null) state.listener("close", state); - return state.tag !== null || state.anchor !== null || hasContent; - } - function readDocument(state) { - var documentStart = state.position, _position, directiveName, directiveArgs, hasDirectives = false, ch; - state.version = null; - state.checkLineBreaks = state.legacy; - state.tagMap = Object.create(null); - state.anchorMap = Object.create(null); - while ((ch = state.input.charCodeAt(state.position)) !== 0) { - skipSeparationSpace(state, true, -1); - ch = state.input.charCodeAt(state.position); - if (state.lineIndent > 0 || ch !== 37) break; - hasDirectives = true; - ch = state.input.charCodeAt(++state.position); - _position = state.position; - while (ch !== 0 && !is_WS_OR_EOL(ch)) ch = state.input.charCodeAt(++state.position); - directiveName = state.input.slice(_position, state.position); - directiveArgs = []; - if (directiveName.length < 1) throwError(state, "directive name must not be less than one character in length"); - while (ch !== 0) { - while (is_WHITE_SPACE(ch)) ch = state.input.charCodeAt(++state.position); - if (ch === 35) { - do - ch = state.input.charCodeAt(++state.position); - while (ch !== 0 && !is_EOL(ch)); - break; - } - if (is_EOL(ch)) break; - _position = state.position; - while (ch !== 0 && !is_WS_OR_EOL(ch)) ch = state.input.charCodeAt(++state.position); - directiveArgs.push(state.input.slice(_position, state.position)); - } - if (ch !== 0) readLineBreak(state); - if (_hasOwnProperty.call(directiveHandlers, directiveName)) directiveHandlers[directiveName](state, directiveName, directiveArgs); - else throwWarning(state, "unknown document directive \"" + directiveName + "\""); - } - skipSeparationSpace(state, true, -1); - if (state.lineIndent === 0 && state.input.charCodeAt(state.position) === 45 && state.input.charCodeAt(state.position + 1) === 45 && state.input.charCodeAt(state.position + 2) === 45) { - state.position += 3; - skipSeparationSpace(state, true, -1); - } else if (hasDirectives) throwError(state, "directives end mark is expected"); - composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); - skipSeparationSpace(state, true, -1); - if (state.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) throwWarning(state, "non-ASCII line breaks are interpreted as content"); - state.documents.push(state.result); - if (state.position === state.lineStart && testDocumentSeparator(state)) { - if (state.input.charCodeAt(state.position) === 46) { - state.position += 3; - skipSeparationSpace(state, true, -1); - } - return; - } - if (state.position < state.length - 1) throwError(state, "end of the stream or a document separator is expected"); - else return; - } - function loadDocuments(input, options) { - input = String(input); - options = options || {}; - if (input.length !== 0) { - if (input.charCodeAt(input.length - 1) !== 10 && input.charCodeAt(input.length - 1) !== 13) input += "\n"; - if (input.charCodeAt(0) === 65279) input = input.slice(1); - } - var state = new State(input, options); - var nullpos = input.indexOf("\0"); - if (nullpos !== -1) { - state.position = nullpos; - throwError(state, "null byte is not allowed in input"); - } - state.input += "\0"; - while (state.input.charCodeAt(state.position) === 32) { - state.lineIndent += 1; - state.position += 1; - } - while (state.position < state.length - 1) readDocument(state); - return state.documents; - } - function loadAll(input, iterator, options) { - if (iterator !== null && typeof iterator === "object" && typeof options === "undefined") { - options = iterator; - iterator = null; - } - var documents = loadDocuments(input, options); - if (typeof iterator !== "function") return documents; - for (var index = 0, length = documents.length; index < length; index += 1) iterator(documents[index]); - } - function load(input, options) { - var documents = loadDocuments(input, options); - if (documents.length === 0) return; - else if (documents.length === 1) return documents[0]; - throw new YAMLException("expected a single document in the stream, but found more"); - } - module.exports.loadAll = loadAll; - module.exports.load = load; -})); -//#endregion -//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/lib/dumper.js -var require_dumper = /* @__PURE__ */ __commonJSMin(((exports, module) => { - var common = require_common(); - var YAMLException = require_exception(); - var DEFAULT_SCHEMA = require_default(); - var _toString = Object.prototype.toString; - var _hasOwnProperty = Object.prototype.hasOwnProperty; - var CHAR_BOM = 65279; - var CHAR_TAB = 9; - var CHAR_LINE_FEED = 10; - var CHAR_CARRIAGE_RETURN = 13; - var CHAR_SPACE = 32; - var CHAR_EXCLAMATION = 33; - var CHAR_DOUBLE_QUOTE = 34; - var CHAR_SHARP = 35; - var CHAR_PERCENT = 37; - var CHAR_AMPERSAND = 38; - var CHAR_SINGLE_QUOTE = 39; - var CHAR_ASTERISK = 42; - var CHAR_COMMA = 44; - var CHAR_MINUS = 45; - var CHAR_COLON = 58; - var CHAR_EQUALS = 61; - var CHAR_GREATER_THAN = 62; - var CHAR_QUESTION = 63; - var CHAR_COMMERCIAL_AT = 64; - var CHAR_LEFT_SQUARE_BRACKET = 91; - var CHAR_RIGHT_SQUARE_BRACKET = 93; - var CHAR_GRAVE_ACCENT = 96; - var CHAR_LEFT_CURLY_BRACKET = 123; - var CHAR_VERTICAL_LINE = 124; - var CHAR_RIGHT_CURLY_BRACKET = 125; - var ESCAPE_SEQUENCES = {}; - ESCAPE_SEQUENCES[0] = "\\0"; - ESCAPE_SEQUENCES[7] = "\\a"; - ESCAPE_SEQUENCES[8] = "\\b"; - ESCAPE_SEQUENCES[9] = "\\t"; - ESCAPE_SEQUENCES[10] = "\\n"; - ESCAPE_SEQUENCES[11] = "\\v"; - ESCAPE_SEQUENCES[12] = "\\f"; - ESCAPE_SEQUENCES[13] = "\\r"; - ESCAPE_SEQUENCES[27] = "\\e"; - ESCAPE_SEQUENCES[34] = "\\\""; - ESCAPE_SEQUENCES[92] = "\\\\"; - ESCAPE_SEQUENCES[133] = "\\N"; - ESCAPE_SEQUENCES[160] = "\\_"; - ESCAPE_SEQUENCES[8232] = "\\L"; - ESCAPE_SEQUENCES[8233] = "\\P"; - var DEPRECATED_BOOLEANS_SYNTAX = [ - "y", - "Y", - "yes", - "Yes", - "YES", - "on", - "On", - "ON", - "n", - "N", - "no", - "No", - "NO", - "off", - "Off", - "OFF" - ]; - var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/; - function compileStyleMap(schema, map) { - var result, keys, index, length, tag, style, type; - if (map === null) return {}; - result = {}; - keys = Object.keys(map); - for (index = 0, length = keys.length; index < length; index += 1) { - tag = keys[index]; - style = String(map[tag]); - if (tag.slice(0, 2) === "!!") tag = "tag:yaml.org,2002:" + tag.slice(2); - type = schema.compiledTypeMap["fallback"][tag]; - if (type && _hasOwnProperty.call(type.styleAliases, style)) style = type.styleAliases[style]; - result[tag] = style; - } - return result; - } - function encodeHex(character) { - var string = character.toString(16).toUpperCase(), handle, length; - if (character <= 255) { - handle = "x"; - length = 2; - } else if (character <= 65535) { - handle = "u"; - length = 4; - } else if (character <= 4294967295) { - handle = "U"; - length = 8; - } else throw new YAMLException("code point within a string may not be greater than 0xFFFFFFFF"); - return "\\" + handle + common.repeat("0", length - string.length) + string; - } - var QUOTING_TYPE_SINGLE = 1, QUOTING_TYPE_DOUBLE = 2; - function State(options) { - this.schema = options["schema"] || DEFAULT_SCHEMA; - this.indent = Math.max(1, options["indent"] || 2); - this.noArrayIndent = options["noArrayIndent"] || false; - this.skipInvalid = options["skipInvalid"] || false; - this.flowLevel = common.isNothing(options["flowLevel"]) ? -1 : options["flowLevel"]; - this.styleMap = compileStyleMap(this.schema, options["styles"] || null); - this.sortKeys = options["sortKeys"] || false; - this.lineWidth = options["lineWidth"] || 80; - this.noRefs = options["noRefs"] || false; - this.noCompatMode = options["noCompatMode"] || false; - this.condenseFlow = options["condenseFlow"] || false; - this.quotingType = options["quotingType"] === "\"" ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE; - this.forceQuotes = options["forceQuotes"] || false; - this.replacer = typeof options["replacer"] === "function" ? options["replacer"] : null; - this.implicitTypes = this.schema.compiledImplicit; - this.explicitTypes = this.schema.compiledExplicit; - this.tag = null; - this.result = ""; - this.duplicates = []; - this.usedDuplicates = null; - } - function indentString(string, spaces) { - var ind = common.repeat(" ", spaces), position = 0, next = -1, result = "", line, length = string.length; - while (position < length) { - next = string.indexOf("\n", position); - if (next === -1) { - line = string.slice(position); - position = length; - } else { - line = string.slice(position, next + 1); - position = next + 1; - } - if (line.length && line !== "\n") result += ind; - result += line; - } - return result; - } - function generateNextLine(state, level) { - return "\n" + common.repeat(" ", state.indent * level); - } - function testImplicitResolving(state, str) { - var index, length, type; - for (index = 0, length = state.implicitTypes.length; index < length; index += 1) { - type = state.implicitTypes[index]; - if (type.resolve(str)) return true; - } - return false; - } - function isWhitespace(c) { - return c === CHAR_SPACE || c === CHAR_TAB; - } - function isPrintable(c) { - return 32 <= c && c <= 126 || 161 <= c && c <= 55295 && c !== 8232 && c !== 8233 || 57344 <= c && c <= 65533 && c !== CHAR_BOM || 65536 <= c && c <= 1114111; - } - function isNsCharOrWhitespace(c) { - return isPrintable(c) && c !== CHAR_BOM && c !== CHAR_CARRIAGE_RETURN && c !== CHAR_LINE_FEED; - } - function isPlainSafe(c, prev, inblock) { - var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c); - var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c); - return (inblock ? cIsNsCharOrWhitespace : cIsNsCharOrWhitespace && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET) && c !== CHAR_SHARP && !(prev === CHAR_COLON && !cIsNsChar) || isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP || prev === CHAR_COLON && cIsNsChar; - } - function isPlainSafeFirst(c) { - return isPrintable(c) && c !== CHAR_BOM && !isWhitespace(c) && c !== CHAR_MINUS && c !== CHAR_QUESTION && c !== CHAR_COLON && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET && c !== CHAR_SHARP && c !== CHAR_AMPERSAND && c !== CHAR_ASTERISK && c !== CHAR_EXCLAMATION && c !== CHAR_VERTICAL_LINE && c !== CHAR_EQUALS && c !== CHAR_GREATER_THAN && c !== CHAR_SINGLE_QUOTE && c !== CHAR_DOUBLE_QUOTE && c !== CHAR_PERCENT && c !== CHAR_COMMERCIAL_AT && c !== CHAR_GRAVE_ACCENT; - } - function isPlainSafeLast(c) { - return !isWhitespace(c) && c !== CHAR_COLON; - } - function codePointAt(string, pos) { - var first = string.charCodeAt(pos), second; - if (first >= 55296 && first <= 56319 && pos + 1 < string.length) { - second = string.charCodeAt(pos + 1); - if (second >= 56320 && second <= 57343) return (first - 55296) * 1024 + second - 56320 + 65536; - } - return first; - } - function needIndentIndicator(string) { - return /^\n* /.test(string); - } - var STYLE_PLAIN = 1, STYLE_SINGLE = 2, STYLE_LITERAL = 3, STYLE_FOLDED = 4, STYLE_DOUBLE = 5; - function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType, quotingType, forceQuotes, inblock) { - var i; - var char = 0; - var prevChar = null; - var hasLineBreak = false; - var hasFoldableLine = false; - var shouldTrackWidth = lineWidth !== -1; - var previousLineBreak = -1; - var plain = isPlainSafeFirst(codePointAt(string, 0)) && isPlainSafeLast(codePointAt(string, string.length - 1)); - if (singleLineOnly || forceQuotes) for (i = 0; i < string.length; char >= 65536 ? i += 2 : i++) { - char = codePointAt(string, i); - if (!isPrintable(char)) return STYLE_DOUBLE; - plain = plain && isPlainSafe(char, prevChar, inblock); - prevChar = char; - } - else { - for (i = 0; i < string.length; char >= 65536 ? i += 2 : i++) { - char = codePointAt(string, i); - if (char === CHAR_LINE_FEED) { - hasLineBreak = true; - if (shouldTrackWidth) { - hasFoldableLine = hasFoldableLine || i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " "; - previousLineBreak = i; - } - } else if (!isPrintable(char)) return STYLE_DOUBLE; - plain = plain && isPlainSafe(char, prevChar, inblock); - prevChar = char; - } - hasFoldableLine = hasFoldableLine || shouldTrackWidth && i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " "; - } - if (!hasLineBreak && !hasFoldableLine) { - if (plain && !forceQuotes && !testAmbiguousType(string)) return STYLE_PLAIN; - return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE; - } - if (indentPerLevel > 9 && needIndentIndicator(string)) return STYLE_DOUBLE; - if (!forceQuotes) return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; - return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE; - } - function writeScalar(state, string, level, iskey, inblock) { - state.dump = function() { - if (string.length === 0) return state.quotingType === QUOTING_TYPE_DOUBLE ? "\"\"" : "''"; - if (!state.noCompatMode) { - if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) return state.quotingType === QUOTING_TYPE_DOUBLE ? "\"" + string + "\"" : "'" + string + "'"; - } - var indent = state.indent * Math.max(1, level); - var lineWidth = state.lineWidth === -1 ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent); - var singleLineOnly = iskey || state.flowLevel > -1 && level >= state.flowLevel; - function testAmbiguity(string) { - return testImplicitResolving(state, string); - } - switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity, state.quotingType, state.forceQuotes && !iskey, inblock)) { - case STYLE_PLAIN: return string; - case STYLE_SINGLE: return "'" + string.replace(/'/g, "''") + "'"; - case STYLE_LITERAL: return "|" + blockHeader(string, state.indent) + dropEndingNewline(indentString(string, indent)); - case STYLE_FOLDED: return ">" + blockHeader(string, state.indent) + dropEndingNewline(indentString(foldString(string, lineWidth), indent)); - case STYLE_DOUBLE: return "\"" + escapeString(string, lineWidth) + "\""; - default: throw new YAMLException("impossible error: invalid scalar style"); - } - }(); - } - function blockHeader(string, indentPerLevel) { - var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : ""; - var clip = string[string.length - 1] === "\n"; - return indentIndicator + (clip && (string[string.length - 2] === "\n" || string === "\n") ? "+" : clip ? "" : "-") + "\n"; - } - function dropEndingNewline(string) { - return string[string.length - 1] === "\n" ? string.slice(0, -1) : string; - } - function foldString(string, width) { - var lineRe = /(\n+)([^\n]*)/g; - var result = function() { - var nextLF = string.indexOf("\n"); - nextLF = nextLF !== -1 ? nextLF : string.length; - lineRe.lastIndex = nextLF; - return foldLine(string.slice(0, nextLF), width); - }(); - var prevMoreIndented = string[0] === "\n" || string[0] === " "; - var moreIndented; - var match; - while (match = lineRe.exec(string)) { - var prefix = match[1], line = match[2]; - moreIndented = line[0] === " "; - result += prefix + (!prevMoreIndented && !moreIndented && line !== "" ? "\n" : "") + foldLine(line, width); - prevMoreIndented = moreIndented; - } - return result; - } - function foldLine(line, width) { - if (line === "" || line[0] === " ") return line; - var breakRe = / [^ ]/g; - var match; - var start = 0, end, curr = 0, next = 0; - var result = ""; - while (match = breakRe.exec(line)) { - next = match.index; - if (next - start > width) { - end = curr > start ? curr : next; - result += "\n" + line.slice(start, end); - start = end + 1; - } - curr = next; - } - result += "\n"; - if (line.length - start > width && curr > start) result += line.slice(start, curr) + "\n" + line.slice(curr + 1); - else result += line.slice(start); - return result.slice(1); - } - function escapeString(string) { - var result = ""; - var char = 0; - var escapeSeq; - for (var i = 0; i < string.length; char >= 65536 ? i += 2 : i++) { - char = codePointAt(string, i); - escapeSeq = ESCAPE_SEQUENCES[char]; - if (!escapeSeq && isPrintable(char)) { - result += string[i]; - if (char >= 65536) result += string[i + 1]; - } else result += escapeSeq || encodeHex(char); - } - return result; - } - function writeFlowSequence(state, level, object) { - var _result = "", _tag = state.tag, index, length, value; - for (index = 0, length = object.length; index < length; index += 1) { - value = object[index]; - if (state.replacer) value = state.replacer.call(object, String(index), value); - if (writeNode(state, level, value, false, false) || typeof value === "undefined" && writeNode(state, level, null, false, false)) { - if (_result !== "") _result += "," + (!state.condenseFlow ? " " : ""); - _result += state.dump; - } - } - state.tag = _tag; - state.dump = "[" + _result + "]"; - } - function writeBlockSequence(state, level, object, compact) { - var _result = "", _tag = state.tag, index, length, value; - for (index = 0, length = object.length; index < length; index += 1) { - value = object[index]; - if (state.replacer) value = state.replacer.call(object, String(index), value); - if (writeNode(state, level + 1, value, true, true, false, true) || typeof value === "undefined" && writeNode(state, level + 1, null, true, true, false, true)) { - if (!compact || _result !== "") _result += generateNextLine(state, level); - if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) _result += "-"; - else _result += "- "; - _result += state.dump; - } - } - state.tag = _tag; - state.dump = _result || "[]"; - } - function writeFlowMapping(state, level, object) { - var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, pairBuffer; - for (index = 0, length = objectKeyList.length; index < length; index += 1) { - pairBuffer = ""; - if (_result !== "") pairBuffer += ", "; - if (state.condenseFlow) pairBuffer += "\""; - objectKey = objectKeyList[index]; - objectValue = object[objectKey]; - if (state.replacer) objectValue = state.replacer.call(object, objectKey, objectValue); - if (!writeNode(state, level, objectKey, false, false)) continue; - if (state.dump.length > 1024) pairBuffer += "? "; - pairBuffer += state.dump + (state.condenseFlow ? "\"" : "") + ":" + (state.condenseFlow ? "" : " "); - if (!writeNode(state, level, objectValue, false, false)) continue; - pairBuffer += state.dump; - _result += pairBuffer; - } - state.tag = _tag; - state.dump = "{" + _result + "}"; - } - function writeBlockMapping(state, level, object, compact) { - var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, explicitPair, pairBuffer; - if (state.sortKeys === true) objectKeyList.sort(); - else if (typeof state.sortKeys === "function") objectKeyList.sort(state.sortKeys); - else if (state.sortKeys) throw new YAMLException("sortKeys must be a boolean or a function"); - for (index = 0, length = objectKeyList.length; index < length; index += 1) { - pairBuffer = ""; - if (!compact || _result !== "") pairBuffer += generateNextLine(state, level); - objectKey = objectKeyList[index]; - objectValue = object[objectKey]; - if (state.replacer) objectValue = state.replacer.call(object, objectKey, objectValue); - if (!writeNode(state, level + 1, objectKey, true, true, true)) continue; - explicitPair = state.tag !== null && state.tag !== "?" || state.dump && state.dump.length > 1024; - if (explicitPair) if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) pairBuffer += "?"; - else pairBuffer += "? "; - pairBuffer += state.dump; - if (explicitPair) pairBuffer += generateNextLine(state, level); - if (!writeNode(state, level + 1, objectValue, true, explicitPair)) continue; - if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) pairBuffer += ":"; - else pairBuffer += ": "; - pairBuffer += state.dump; - _result += pairBuffer; - } - state.tag = _tag; - state.dump = _result || "{}"; - } - function detectType(state, object, explicit) { - var _result, typeList = explicit ? state.explicitTypes : state.implicitTypes, index, length, type, style; - for (index = 0, length = typeList.length; index < length; index += 1) { - type = typeList[index]; - if ((type.instanceOf || type.predicate) && (!type.instanceOf || typeof object === "object" && object instanceof type.instanceOf) && (!type.predicate || type.predicate(object))) { - if (explicit) if (type.multi && type.representName) state.tag = type.representName(object); - else state.tag = type.tag; - else state.tag = "?"; - if (type.represent) { - style = state.styleMap[type.tag] || type.defaultStyle; - if (_toString.call(type.represent) === "[object Function]") _result = type.represent(object, style); - else if (_hasOwnProperty.call(type.represent, style)) _result = type.represent[style](object, style); - else throw new YAMLException("!<" + type.tag + "> tag resolver accepts not \"" + style + "\" style"); - state.dump = _result; - } - return true; - } - } - return false; - } - function writeNode(state, level, object, block, compact, iskey, isblockseq) { - state.tag = null; - state.dump = object; - if (!detectType(state, object, false)) detectType(state, object, true); - var type = _toString.call(state.dump); - var inblock = block; - var tagStr; - if (block) block = state.flowLevel < 0 || state.flowLevel > level; - var objectOrArray = type === "[object Object]" || type === "[object Array]", duplicateIndex, duplicate; - if (objectOrArray) { - duplicateIndex = state.duplicates.indexOf(object); - duplicate = duplicateIndex !== -1; - } - if (state.tag !== null && state.tag !== "?" || duplicate || state.indent !== 2 && level > 0) compact = false; - if (duplicate && state.usedDuplicates[duplicateIndex]) state.dump = "*ref_" + duplicateIndex; - else { - if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) state.usedDuplicates[duplicateIndex] = true; - if (type === "[object Object]") if (block && Object.keys(state.dump).length !== 0) { - writeBlockMapping(state, level, state.dump, compact); - if (duplicate) state.dump = "&ref_" + duplicateIndex + state.dump; - } else { - writeFlowMapping(state, level, state.dump); - if (duplicate) state.dump = "&ref_" + duplicateIndex + " " + state.dump; - } - else if (type === "[object Array]") if (block && state.dump.length !== 0) { - if (state.noArrayIndent && !isblockseq && level > 0) writeBlockSequence(state, level - 1, state.dump, compact); - else writeBlockSequence(state, level, state.dump, compact); - if (duplicate) state.dump = "&ref_" + duplicateIndex + state.dump; - } else { - writeFlowSequence(state, level, state.dump); - if (duplicate) state.dump = "&ref_" + duplicateIndex + " " + state.dump; - } - else if (type === "[object String]") { - if (state.tag !== "?") writeScalar(state, state.dump, level, iskey, inblock); - } else if (type === "[object Undefined]") return false; - else { - if (state.skipInvalid) return false; - throw new YAMLException("unacceptable kind of an object to dump " + type); - } - if (state.tag !== null && state.tag !== "?") { - tagStr = encodeURI(state.tag[0] === "!" ? state.tag.slice(1) : state.tag).replace(/!/g, "%21"); - if (state.tag[0] === "!") tagStr = "!" + tagStr; - else if (tagStr.slice(0, 18) === "tag:yaml.org,2002:") tagStr = "!!" + tagStr.slice(18); - else tagStr = "!<" + tagStr + ">"; - state.dump = tagStr + " " + state.dump; - } - } - return true; - } - function getDuplicateReferences(object, state) { - var objects = [], duplicatesIndexes = [], index, length; - inspectNode(object, objects, duplicatesIndexes); - for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) state.duplicates.push(objects[duplicatesIndexes[index]]); - state.usedDuplicates = new Array(length); - } - function inspectNode(object, objects, duplicatesIndexes) { - var objectKeyList, index, length; - if (object !== null && typeof object === "object") { - index = objects.indexOf(object); - if (index !== -1) { - if (duplicatesIndexes.indexOf(index) === -1) duplicatesIndexes.push(index); - } else { - objects.push(object); - if (Array.isArray(object)) for (index = 0, length = object.length; index < length; index += 1) inspectNode(object[index], objects, duplicatesIndexes); - else { - objectKeyList = Object.keys(object); - for (index = 0, length = objectKeyList.length; index < length; index += 1) inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes); - } - } - } - } - function dump(input, options) { - options = options || {}; - var state = new State(options); - if (!state.noRefs) getDuplicateReferences(input, state); - var value = input; - if (state.replacer) value = state.replacer.call({ "": value }, "", value); - if (writeNode(state, 0, value, true, true)) return state.dump + "\n"; - return ""; - } - module.exports.dump = dump; -})); -//#endregion -//#region ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/index.js -var require_js_yaml = /* @__PURE__ */ __commonJSMin(((exports, module) => { - var loader = require_loader(); - var dumper = require_dumper(); - function renamed(from, to) { - return function() { - throw new Error("Function yaml." + from + " is removed in js-yaml 4. Use yaml." + to + " instead, which is now safe by default."); - }; - } - module.exports.Type = require_type$1(); - module.exports.Schema = require_schema$3(); - module.exports.FAILSAFE_SCHEMA = require_failsafe(); - module.exports.JSON_SCHEMA = require_json(); - module.exports.CORE_SCHEMA = require_core(); - module.exports.DEFAULT_SCHEMA = require_default(); - module.exports.load = loader.load; - module.exports.loadAll = loader.loadAll; - module.exports.dump = dumper.dump; - module.exports.YAMLException = require_exception(); - module.exports.types = { - binary: require_binary$1(), - float: require_float$2(), - map: require_map$1(), - null: require_null$1(), - pairs: require_pairs$1(), - set: require_set$1(), - timestamp: require_timestamp$1(), - bool: require_bool$2(), - int: require_int$2(), - merge: require_merge$1(), - omap: require_omap$1(), - seq: require_seq$1(), - str: require_str() - }; - module.exports.safeLoad = renamed("safeLoad", "load"); - module.exports.safeLoadAll = renamed("safeLoadAll", "loadAll"); - module.exports.safeDump = renamed("safeDump", "dump"); -})); -//#endregion -//#region ../../node_modules/.pnpm/read-yaml-file@2.1.0/node_modules/read-yaml-file/index.js -var require_read_yaml_file = /* @__PURE__ */ __commonJSMin(((exports, module) => { - const fs$1 = __require("fs"); - const stripBom = require_strip_bom(); - const yaml = require_js_yaml(); - const parse = (data) => yaml.load(stripBom(data)); - const readYamlFile = (fp) => fs$1.promises.readFile(fp, "utf8").then((data) => parse(data)); - module.exports = readYamlFile; - module.exports.default = readYamlFile; - module.exports.sync = (fp) => parse(fs$1.readFileSync(fp, "utf8")); -})); -//#endregion -//#region ../../node_modules/.pnpm/@pnpm+error@1000.1.0/node_modules/@pnpm/error/lib/index.js -var require_lib$5 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.LockfileMissingDependencyError = exports.FetchError = exports.PnpmError = void 0; - const constants_1 = require_lib$6(); - var PnpmError = class extends Error { - code; - hint; - attempts; - prefix; - pkgsStack; - constructor(code, message, opts) { - super(message, { cause: opts?.cause }); - this.code = code.startsWith("ERR_PNPM_") ? code : `ERR_PNPM_${code}`; - this.hint = opts?.hint; - this.attempts = opts?.attempts; - } - }; - exports.PnpmError = PnpmError; - var FetchError = class extends PnpmError { - response; - request; - constructor(request, response, hint) { - const _request = { url: request.url }; - if (request.authHeaderValue) _request.authHeaderValue = hideAuthInformation(request.authHeaderValue); - const message = `GET ${request.url}: ${response.statusText} - ${response.status}`; - if (response.status === 401 || response.status === 403 || response.status === 404) { - hint = hint ? `${hint}\n\n` : ""; - if (_request.authHeaderValue) hint += `An authorization header was used: ${_request.authHeaderValue}`; - else hint += "No authorization header was set for the request."; - } - super(`FETCH_${response.status}`, message, { hint }); - this.request = _request; - this.response = response; - } - }; - exports.FetchError = FetchError; - function hideAuthInformation(authHeaderValue) { - const [authType, token] = authHeaderValue.split(" "); - if (token == null) return "[hidden]"; - if (token.length < 20) return `${authType} [hidden]`; - return `${authType} ${token.substring(0, 4)}[hidden]`; - } - var LockfileMissingDependencyError = class extends PnpmError { - constructor(depPath) { - const message = `Broken lockfile: no entry for '${depPath}' in ${constants_1.WANTED_LOCKFILE}`; - super("LOCKFILE_MISSING_DEPENDENCY", message, { hint: "This issue is probably caused by a badly resolved merge conflict.\nTo fix the lockfile, run 'pnpm install --no-frozen-lockfile'." }); - } - }; - exports.LockfileMissingDependencyError = LockfileMissingDependencyError; -})); -//#endregion -//#region ../../node_modules/.pnpm/@pnpm+workspace.read-manifest@1000.3.1/node_modules/@pnpm/workspace.read-manifest/lib/errors/InvalidWorkspaceManifestError.js -var require_InvalidWorkspaceManifestError = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.InvalidWorkspaceManifestError = void 0; - const error_1 = require_lib$5(); - var InvalidWorkspaceManifestError = class extends error_1.PnpmError { - constructor(message) { - super("INVALID_WORKSPACE_CONFIGURATION", message); - } - }; - exports.InvalidWorkspaceManifestError = InvalidWorkspaceManifestError; -})); -//#endregion -//#region ../../node_modules/.pnpm/@pnpm+workspace.read-manifest@1000.3.1/node_modules/@pnpm/workspace.read-manifest/lib/catalogs.js -var require_catalogs = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.assertValidWorkspaceManifestCatalog = assertValidWorkspaceManifestCatalog; - exports.assertValidWorkspaceManifestCatalogs = assertValidWorkspaceManifestCatalogs; - const InvalidWorkspaceManifestError_js_1 = require_InvalidWorkspaceManifestError(); - function assertValidWorkspaceManifestCatalog(manifest) { - if (manifest.catalog == null) return; - if (Array.isArray(manifest.catalog)) throw new InvalidWorkspaceManifestError_js_1.InvalidWorkspaceManifestError("Expected catalog field to be an object, but found - array"); - if (typeof manifest.catalog !== "object") throw new InvalidWorkspaceManifestError_js_1.InvalidWorkspaceManifestError(`Expected catalog field to be an object, but found - ${typeof manifest.catalog}`); - for (const [alias, specifier] of Object.entries(manifest.catalog)) if (typeof specifier !== "string") throw new InvalidWorkspaceManifestError_js_1.InvalidWorkspaceManifestError(`Invalid catalog entry for ${alias}. Expected string, but found: ${typeof specifier}`); - } - function assertValidWorkspaceManifestCatalogs(manifest) { - if (manifest.catalogs == null) return; - if (Array.isArray(manifest.catalogs)) throw new InvalidWorkspaceManifestError_js_1.InvalidWorkspaceManifestError("Expected catalogs field to be an object, but found - array"); - if (typeof manifest.catalogs !== "object") throw new InvalidWorkspaceManifestError_js_1.InvalidWorkspaceManifestError(`Expected catalogs field to be an object, but found - ${typeof manifest.catalogs}`); - for (const [catalogName, catalog] of Object.entries(manifest.catalogs)) { - if (Array.isArray(catalog)) throw new InvalidWorkspaceManifestError_js_1.InvalidWorkspaceManifestError(`Expected named catalog ${catalogName} to be an object, but found - array`); - if (typeof catalog !== "object") throw new InvalidWorkspaceManifestError_js_1.InvalidWorkspaceManifestError(`Expected named catalog ${catalogName} to be an object, but found - ${typeof catalog}`); - for (const [alias, specifier] of Object.entries(catalog)) if (typeof specifier !== "string") throw new InvalidWorkspaceManifestError_js_1.InvalidWorkspaceManifestError(`Catalog '${catalogName}' has invalid entry '${alias}'. Expected string specifier, but found: ${typeof specifier}`); - } - } -})); -//#endregion -//#region ../../node_modules/.pnpm/@pnpm+workspace.read-manifest@1000.3.1/node_modules/@pnpm/workspace.read-manifest/lib/index.js -var require_lib$4 = /* @__PURE__ */ __commonJSMin(((exports) => { - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.readWorkspaceManifest = readWorkspaceManifest; - exports.validateWorkspaceManifest = validateWorkspaceManifest; - const util_1$1 = __importDefault(__require("util")); - const constants_1 = require_lib$6(); - const node_path_1 = __importDefault(__require("node:path")); - const read_yaml_file_1 = __importDefault(require_read_yaml_file()); - const catalogs_js_1 = require_catalogs(); - const InvalidWorkspaceManifestError_js_1 = require_InvalidWorkspaceManifestError(); - async function readWorkspaceManifest(dir) { - const manifest = await readManifestRaw(dir); - validateWorkspaceManifest(manifest); - return manifest; - } - async function readManifestRaw(dir) { - try { - return await (0, read_yaml_file_1.default)(node_path_1.default.join(dir, constants_1.WORKSPACE_MANIFEST_FILENAME)); - } catch (err) { - if (util_1$1.default.types.isNativeError(err) && "code" in err && err.code === "ENOENT") return; - throw err; - } - } - function validateWorkspaceManifest(manifest) { - if (manifest === void 0 || manifest === null) return; - if (typeof manifest !== "object") throw new InvalidWorkspaceManifestError_js_1.InvalidWorkspaceManifestError(`Expected object but found - ${typeof manifest}`); - if (Array.isArray(manifest)) throw new InvalidWorkspaceManifestError_js_1.InvalidWorkspaceManifestError("Expected object but found - array"); - if (Object.keys(manifest).length === 0) return; - assertValidWorkspaceManifestPackages(manifest); - (0, catalogs_js_1.assertValidWorkspaceManifestCatalog)(manifest); - (0, catalogs_js_1.assertValidWorkspaceManifestCatalogs)(manifest); - checkWorkspaceManifestAssignability(manifest); - } - function assertValidWorkspaceManifestPackages(manifest) { - if (!manifest.packages) return; - if (!Array.isArray(manifest.packages)) throw new InvalidWorkspaceManifestError_js_1.InvalidWorkspaceManifestError("packages field is not an array"); - for (const pkg of manifest.packages) { - if (!pkg) throw new InvalidWorkspaceManifestError_js_1.InvalidWorkspaceManifestError("Missing or empty package"); - const type = typeof pkg; - if (type !== "string") throw new InvalidWorkspaceManifestError_js_1.InvalidWorkspaceManifestError(`Invalid package type - ${type}`); - } - } - /** - * Empty function to ensure TypeScript has narrowed the manifest object to - * something assignable to the {@see WorkspaceManifest} interface. This helps - * make sure the validation logic in this file is correct as it's refactored in - * the future. - */ - function checkWorkspaceManifestAssignability(_manifest) {} -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/identity.js -var require_identity = /* @__PURE__ */ __commonJSMin(((exports) => { - const ALIAS = Symbol.for("yaml.alias"); - const DOC = Symbol.for("yaml.document"); - const MAP = Symbol.for("yaml.map"); - const PAIR = Symbol.for("yaml.pair"); - const SCALAR = Symbol.for("yaml.scalar"); - const SEQ = Symbol.for("yaml.seq"); - const NODE_TYPE = Symbol.for("yaml.node.type"); - const isAlias = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === ALIAS; - const isDocument = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === DOC; - const isMap = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === MAP; - const isPair = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === PAIR; - const isScalar = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === SCALAR; - const isSeq = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === SEQ; - function isCollection(node) { - if (node && typeof node === "object") switch (node[NODE_TYPE]) { - case MAP: - case SEQ: return true; - } - return false; - } - function isNode(node) { - if (node && typeof node === "object") switch (node[NODE_TYPE]) { - case ALIAS: - case MAP: - case SCALAR: - case SEQ: return true; - } - return false; - } - const hasAnchor = (node) => (isScalar(node) || isCollection(node)) && !!node.anchor; - exports.ALIAS = ALIAS; - exports.DOC = DOC; - exports.MAP = MAP; - exports.NODE_TYPE = NODE_TYPE; - exports.PAIR = PAIR; - exports.SCALAR = SCALAR; - exports.SEQ = SEQ; - exports.hasAnchor = hasAnchor; - exports.isAlias = isAlias; - exports.isCollection = isCollection; - exports.isDocument = isDocument; - exports.isMap = isMap; - exports.isNode = isNode; - exports.isPair = isPair; - exports.isScalar = isScalar; - exports.isSeq = isSeq; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/visit.js -var require_visit = /* @__PURE__ */ __commonJSMin(((exports) => { - var identity = require_identity(); - const BREAK = Symbol("break visit"); - const SKIP = Symbol("skip children"); - const REMOVE = Symbol("remove node"); - /** - * Apply a visitor to an AST node or document. - * - * Walks through the tree (depth-first) starting from `node`, calling a - * `visitor` function with three arguments: - * - `key`: For sequence values and map `Pair`, the node's index in the - * collection. Within a `Pair`, `'key'` or `'value'`, correspondingly. - * `null` for the root node. - * - `node`: The current node. - * - `path`: The ancestry of the current node. - * - * The return value of the visitor may be used to control the traversal: - * - `undefined` (default): Do nothing and continue - * - `visit.SKIP`: Do not visit the children of this node, continue with next - * sibling - * - `visit.BREAK`: Terminate traversal completely - * - `visit.REMOVE`: Remove the current node, then continue with the next one - * - `Node`: Replace the current node, then continue by visiting it - * - `number`: While iterating the items of a sequence or map, set the index - * of the next step. This is useful especially if the index of the current - * node has changed. - * - * If `visitor` is a single function, it will be called with all values - * encountered in the tree, including e.g. `null` values. Alternatively, - * separate visitor functions may be defined for each `Map`, `Pair`, `Seq`, - * `Alias` and `Scalar` node. To define the same visitor function for more than - * one node type, use the `Collection` (map and seq), `Value` (map, seq & scalar) - * and `Node` (alias, map, seq & scalar) targets. Of all these, only the most - * specific defined one will be used for each node. - */ - function visit(node, visitor) { - const visitor_ = initVisitor(visitor); - if (identity.isDocument(node)) { - if (visit_(null, node.contents, visitor_, Object.freeze([node])) === REMOVE) node.contents = null; - } else visit_(null, node, visitor_, Object.freeze([])); - } - /** Terminate visit traversal completely */ - visit.BREAK = BREAK; - /** Do not visit the children of the current node */ - visit.SKIP = SKIP; - /** Remove the current node */ - visit.REMOVE = REMOVE; - function visit_(key, node, visitor, path) { - const ctrl = callVisitor(key, node, visitor, path); - if (identity.isNode(ctrl) || identity.isPair(ctrl)) { - replaceNode(key, path, ctrl); - return visit_(key, ctrl, visitor, path); - } - if (typeof ctrl !== "symbol") { - if (identity.isCollection(node)) { - path = Object.freeze(path.concat(node)); - for (let i = 0; i < node.items.length; ++i) { - const ci = visit_(i, node.items[i], visitor, path); - if (typeof ci === "number") i = ci - 1; - else if (ci === BREAK) return BREAK; - else if (ci === REMOVE) { - node.items.splice(i, 1); - i -= 1; - } - } - } else if (identity.isPair(node)) { - path = Object.freeze(path.concat(node)); - const ck = visit_("key", node.key, visitor, path); - if (ck === BREAK) return BREAK; - else if (ck === REMOVE) node.key = null; - const cv = visit_("value", node.value, visitor, path); - if (cv === BREAK) return BREAK; - else if (cv === REMOVE) node.value = null; - } - } - return ctrl; - } - /** - * Apply an async visitor to an AST node or document. - * - * Walks through the tree (depth-first) starting from `node`, calling a - * `visitor` function with three arguments: - * - `key`: For sequence values and map `Pair`, the node's index in the - * collection. Within a `Pair`, `'key'` or `'value'`, correspondingly. - * `null` for the root node. - * - `node`: The current node. - * - `path`: The ancestry of the current node. - * - * The return value of the visitor may be used to control the traversal: - * - `Promise`: Must resolve to one of the following values - * - `undefined` (default): Do nothing and continue - * - `visit.SKIP`: Do not visit the children of this node, continue with next - * sibling - * - `visit.BREAK`: Terminate traversal completely - * - `visit.REMOVE`: Remove the current node, then continue with the next one - * - `Node`: Replace the current node, then continue by visiting it - * - `number`: While iterating the items of a sequence or map, set the index - * of the next step. This is useful especially if the index of the current - * node has changed. - * - * If `visitor` is a single function, it will be called with all values - * encountered in the tree, including e.g. `null` values. Alternatively, - * separate visitor functions may be defined for each `Map`, `Pair`, `Seq`, - * `Alias` and `Scalar` node. To define the same visitor function for more than - * one node type, use the `Collection` (map and seq), `Value` (map, seq & scalar) - * and `Node` (alias, map, seq & scalar) targets. Of all these, only the most - * specific defined one will be used for each node. - */ - async function visitAsync(node, visitor) { - const visitor_ = initVisitor(visitor); - if (identity.isDocument(node)) { - if (await visitAsync_(null, node.contents, visitor_, Object.freeze([node])) === REMOVE) node.contents = null; - } else await visitAsync_(null, node, visitor_, Object.freeze([])); - } - /** Terminate visit traversal completely */ - visitAsync.BREAK = BREAK; - /** Do not visit the children of the current node */ - visitAsync.SKIP = SKIP; - /** Remove the current node */ - visitAsync.REMOVE = REMOVE; - async function visitAsync_(key, node, visitor, path) { - const ctrl = await callVisitor(key, node, visitor, path); - if (identity.isNode(ctrl) || identity.isPair(ctrl)) { - replaceNode(key, path, ctrl); - return visitAsync_(key, ctrl, visitor, path); - } - if (typeof ctrl !== "symbol") { - if (identity.isCollection(node)) { - path = Object.freeze(path.concat(node)); - for (let i = 0; i < node.items.length; ++i) { - const ci = await visitAsync_(i, node.items[i], visitor, path); - if (typeof ci === "number") i = ci - 1; - else if (ci === BREAK) return BREAK; - else if (ci === REMOVE) { - node.items.splice(i, 1); - i -= 1; - } - } - } else if (identity.isPair(node)) { - path = Object.freeze(path.concat(node)); - const ck = await visitAsync_("key", node.key, visitor, path); - if (ck === BREAK) return BREAK; - else if (ck === REMOVE) node.key = null; - const cv = await visitAsync_("value", node.value, visitor, path); - if (cv === BREAK) return BREAK; - else if (cv === REMOVE) node.value = null; - } - } - return ctrl; - } - function initVisitor(visitor) { - if (typeof visitor === "object" && (visitor.Collection || visitor.Node || visitor.Value)) return Object.assign({ - Alias: visitor.Node, - Map: visitor.Node, - Scalar: visitor.Node, - Seq: visitor.Node - }, visitor.Value && { - Map: visitor.Value, - Scalar: visitor.Value, - Seq: visitor.Value - }, visitor.Collection && { - Map: visitor.Collection, - Seq: visitor.Collection - }, visitor); - return visitor; - } - function callVisitor(key, node, visitor, path) { - if (typeof visitor === "function") return visitor(key, node, path); - if (identity.isMap(node)) return visitor.Map?.(key, node, path); - if (identity.isSeq(node)) return visitor.Seq?.(key, node, path); - if (identity.isPair(node)) return visitor.Pair?.(key, node, path); - if (identity.isScalar(node)) return visitor.Scalar?.(key, node, path); - if (identity.isAlias(node)) return visitor.Alias?.(key, node, path); - } - function replaceNode(key, path, node) { - const parent = path[path.length - 1]; - if (identity.isCollection(parent)) parent.items[key] = node; - else if (identity.isPair(parent)) if (key === "key") parent.key = node; - else parent.value = node; - else if (identity.isDocument(parent)) parent.contents = node; - else { - const pt = identity.isAlias(parent) ? "alias" : "scalar"; - throw new Error(`Cannot replace node with ${pt} parent`); - } - } - exports.visit = visit; - exports.visitAsync = visitAsync; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/directives.js -var require_directives = /* @__PURE__ */ __commonJSMin(((exports) => { - var identity = require_identity(); - var visit = require_visit(); - const escapeChars = { - "!": "%21", - ",": "%2C", - "[": "%5B", - "]": "%5D", - "{": "%7B", - "}": "%7D" - }; - const escapeTagName = (tn) => tn.replace(/[!,[\]{}]/g, (ch) => escapeChars[ch]); - var Directives = class Directives { - constructor(yaml, tags) { - /** - * The directives-end/doc-start marker `---`. If `null`, a marker may still be - * included in the document's stringified representation. - */ - this.docStart = null; - /** The doc-end marker `...`. */ - this.docEnd = false; - this.yaml = Object.assign({}, Directives.defaultYaml, yaml); - this.tags = Object.assign({}, Directives.defaultTags, tags); - } - clone() { - const copy = new Directives(this.yaml, this.tags); - copy.docStart = this.docStart; - return copy; - } - /** - * During parsing, get a Directives instance for the current document and - * update the stream state according to the current version's spec. - */ - atDocument() { - const res = new Directives(this.yaml, this.tags); - switch (this.yaml.version) { - case "1.1": - this.atNextDocument = true; - break; - case "1.2": - this.atNextDocument = false; - this.yaml = { - explicit: Directives.defaultYaml.explicit, - version: "1.2" - }; - this.tags = Object.assign({}, Directives.defaultTags); - break; - } - return res; - } - /** - * @param onError - May be called even if the action was successful - * @returns `true` on success - */ - add(line, onError) { - if (this.atNextDocument) { - this.yaml = { - explicit: Directives.defaultYaml.explicit, - version: "1.1" - }; - this.tags = Object.assign({}, Directives.defaultTags); - this.atNextDocument = false; - } - const parts = line.trim().split(/[ \t]+/); - const name = parts.shift(); - switch (name) { - case "%TAG": { - if (parts.length !== 2) { - onError(0, "%TAG directive should contain exactly two parts"); - if (parts.length < 2) return false; - } - const [handle, prefix] = parts; - this.tags[handle] = prefix; - return true; - } - case "%YAML": { - this.yaml.explicit = true; - if (parts.length !== 1) { - onError(0, "%YAML directive should contain exactly one part"); - return false; - } - const [version] = parts; - if (version === "1.1" || version === "1.2") { - this.yaml.version = version; - return true; - } else { - const isValid = /^\d+\.\d+$/.test(version); - onError(6, `Unsupported YAML version ${version}`, isValid); - return false; - } - } - default: - onError(0, `Unknown directive ${name}`, true); - return false; - } - } - /** - * Resolves a tag, matching handles to those defined in %TAG directives. - * - * @returns Resolved tag, which may also be the non-specific tag `'!'` or a - * `'!local'` tag, or `null` if unresolvable. - */ - tagName(source, onError) { - if (source === "!") return "!"; - if (source[0] !== "!") { - onError(`Not a valid tag: ${source}`); - return null; - } - if (source[1] === "<") { - const verbatim = source.slice(2, -1); - if (verbatim === "!" || verbatim === "!!") { - onError(`Verbatim tags aren't resolved, so ${source} is invalid.`); - return null; - } - if (source[source.length - 1] !== ">") onError("Verbatim tags must end with a >"); - return verbatim; - } - const [, handle, suffix] = source.match(/^(.*!)([^!]*)$/s); - if (!suffix) onError(`The ${source} tag has no suffix`); - const prefix = this.tags[handle]; - if (prefix) try { - return prefix + decodeURIComponent(suffix); - } catch (error) { - onError(String(error)); - return null; - } - if (handle === "!") return source; - onError(`Could not resolve tag: ${source}`); - return null; - } - /** - * Given a fully resolved tag, returns its printable string form, - * taking into account current tag prefixes and defaults. - */ - tagString(tag) { - for (const [handle, prefix] of Object.entries(this.tags)) if (tag.startsWith(prefix)) return handle + escapeTagName(tag.substring(prefix.length)); - return tag[0] === "!" ? tag : `!<${tag}>`; - } - toString(doc) { - const lines = this.yaml.explicit ? [`%YAML ${this.yaml.version || "1.2"}`] : []; - const tagEntries = Object.entries(this.tags); - let tagNames; - if (doc && tagEntries.length > 0 && identity.isNode(doc.contents)) { - const tags = {}; - visit.visit(doc.contents, (_key, node) => { - if (identity.isNode(node) && node.tag) tags[node.tag] = true; - }); - tagNames = Object.keys(tags); - } else tagNames = []; - for (const [handle, prefix] of tagEntries) { - if (handle === "!!" && prefix === "tag:yaml.org,2002:") continue; - if (!doc || tagNames.some((tn) => tn.startsWith(prefix))) lines.push(`%TAG ${handle} ${prefix}`); - } - return lines.join("\n"); - } - }; - Directives.defaultYaml = { - explicit: false, - version: "1.2" - }; - Directives.defaultTags = { "!!": "tag:yaml.org,2002:" }; - exports.Directives = Directives; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/anchors.js -var require_anchors = /* @__PURE__ */ __commonJSMin(((exports) => { - var identity = require_identity(); - var visit = require_visit(); - /** - * Verify that the input string is a valid anchor. - * - * Will throw on errors. - */ - function anchorIsValid(anchor) { - if (/[\x00-\x19\s,[\]{}]/.test(anchor)) { - const msg = `Anchor must not contain whitespace or control characters: ${JSON.stringify(anchor)}`; - throw new Error(msg); - } - return true; - } - function anchorNames(root) { - const anchors = /* @__PURE__ */ new Set(); - visit.visit(root, { Value(_key, node) { - if (node.anchor) anchors.add(node.anchor); - } }); - return anchors; - } - /** Find a new anchor name with the given `prefix` and a one-indexed suffix. */ - function findNewAnchor(prefix, exclude) { - for (let i = 1;; ++i) { - const name = `${prefix}${i}`; - if (!exclude.has(name)) return name; - } - } - function createNodeAnchors(doc, prefix) { - const aliasObjects = []; - const sourceObjects = /* @__PURE__ */ new Map(); - let prevAnchors = null; - return { - onAnchor: (source) => { - aliasObjects.push(source); - prevAnchors ?? (prevAnchors = anchorNames(doc)); - const anchor = findNewAnchor(prefix, prevAnchors); - prevAnchors.add(anchor); - return anchor; - }, - /** - * With circular references, the source node is only resolved after all - * of its child nodes are. This is why anchors are set only after all of - * the nodes have been created. - */ - setAnchors: () => { - for (const source of aliasObjects) { - const ref = sourceObjects.get(source); - if (typeof ref === "object" && ref.anchor && (identity.isScalar(ref.node) || identity.isCollection(ref.node))) ref.node.anchor = ref.anchor; - else { - const error = /* @__PURE__ */ new Error("Failed to resolve repeated object (this should not happen)"); - error.source = source; - throw error; - } - } - }, - sourceObjects - }; - } - exports.anchorIsValid = anchorIsValid; - exports.anchorNames = anchorNames; - exports.createNodeAnchors = createNodeAnchors; - exports.findNewAnchor = findNewAnchor; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/applyReviver.js -var require_applyReviver = /* @__PURE__ */ __commonJSMin(((exports) => { - /** - * Applies the JSON.parse reviver algorithm as defined in the ECMA-262 spec, - * in section 24.5.1.1 "Runtime Semantics: InternalizeJSONProperty" of the - * 2021 edition: https://tc39.es/ecma262/#sec-json.parse - * - * Includes extensions for handling Map and Set objects. - */ - function applyReviver(reviver, obj, key, val) { - if (val && typeof val === "object") if (Array.isArray(val)) for (let i = 0, len = val.length; i < len; ++i) { - const v0 = val[i]; - const v1 = applyReviver(reviver, val, String(i), v0); - if (v1 === void 0) delete val[i]; - else if (v1 !== v0) val[i] = v1; - } - else if (val instanceof Map) for (const k of Array.from(val.keys())) { - const v0 = val.get(k); - const v1 = applyReviver(reviver, val, k, v0); - if (v1 === void 0) val.delete(k); - else if (v1 !== v0) val.set(k, v1); - } - else if (val instanceof Set) for (const v0 of Array.from(val)) { - const v1 = applyReviver(reviver, val, v0, v0); - if (v1 === void 0) val.delete(v0); - else if (v1 !== v0) { - val.delete(v0); - val.add(v1); - } - } - else for (const [k, v0] of Object.entries(val)) { - const v1 = applyReviver(reviver, val, k, v0); - if (v1 === void 0) delete val[k]; - else if (v1 !== v0) val[k] = v1; - } - return reviver.call(obj, key, val); - } - exports.applyReviver = applyReviver; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/toJS.js -var require_toJS = /* @__PURE__ */ __commonJSMin(((exports) => { - var identity = require_identity(); - /** - * Recursively convert any node or its contents to native JavaScript - * - * @param value - The input value - * @param arg - If `value` defines a `toJSON()` method, use this - * as its first argument - * @param ctx - Conversion context, originally set in Document#toJS(). If - * `{ keep: true }` is not set, output should be suitable for JSON - * stringification. - */ - function toJS(value, arg, ctx) { - if (Array.isArray(value)) return value.map((v, i) => toJS(v, String(i), ctx)); - if (value && typeof value.toJSON === "function") { - if (!ctx || !identity.hasAnchor(value)) return value.toJSON(arg, ctx); - const data = { - aliasCount: 0, - count: 1, - res: void 0 - }; - ctx.anchors.set(value, data); - ctx.onCreate = (res) => { - data.res = res; - delete ctx.onCreate; - }; - const res = value.toJSON(arg, ctx); - if (ctx.onCreate) ctx.onCreate(res); - return res; - } - if (typeof value === "bigint" && !ctx?.keep) return Number(value); - return value; - } - exports.toJS = toJS; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Node.js -var require_Node = /* @__PURE__ */ __commonJSMin(((exports) => { - var applyReviver = require_applyReviver(); - var identity = require_identity(); - var toJS = require_toJS(); - var NodeBase = class { - constructor(type) { - Object.defineProperty(this, identity.NODE_TYPE, { value: type }); - } - /** Create a copy of this node. */ - clone() { - const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this)); - if (this.range) copy.range = this.range.slice(); - return copy; - } - /** A plain JavaScript representation of this node. */ - toJS(doc, { mapAsMap, maxAliasCount, onAnchor, reviver } = {}) { - if (!identity.isDocument(doc)) throw new TypeError("A document argument is required"); - const ctx = { - anchors: /* @__PURE__ */ new Map(), - doc, - keep: true, - mapAsMap: mapAsMap === true, - mapKeyWarned: false, - maxAliasCount: typeof maxAliasCount === "number" ? maxAliasCount : 100 - }; - const res = toJS.toJS(this, "", ctx); - if (typeof onAnchor === "function") for (const { count, res } of ctx.anchors.values()) onAnchor(res, count); - return typeof reviver === "function" ? applyReviver.applyReviver(reviver, { "": res }, "", res) : res; - } - }; - exports.NodeBase = NodeBase; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Alias.js -var require_Alias = /* @__PURE__ */ __commonJSMin(((exports) => { - var anchors = require_anchors(); - var visit = require_visit(); - var identity = require_identity(); - var Node = require_Node(); - var toJS = require_toJS(); - var Alias = class extends Node.NodeBase { - constructor(source) { - super(identity.ALIAS); - this.source = source; - Object.defineProperty(this, "tag", { set() { - throw new Error("Alias nodes cannot have tags"); - } }); - } - /** - * Resolve the value of this alias within `doc`, finding the last - * instance of the `source` anchor before this node. - */ - resolve(doc, ctx) { - let nodes; - if (ctx?.aliasResolveCache) nodes = ctx.aliasResolveCache; - else { - nodes = []; - visit.visit(doc, { Node: (_key, node) => { - if (identity.isAlias(node) || identity.hasAnchor(node)) nodes.push(node); - } }); - if (ctx) ctx.aliasResolveCache = nodes; - } - let found = void 0; - for (const node of nodes) { - if (node === this) break; - if (node.anchor === this.source) found = node; - } - return found; - } - toJSON(_arg, ctx) { - if (!ctx) return { source: this.source }; - const { anchors, doc, maxAliasCount } = ctx; - const source = this.resolve(doc, ctx); - if (!source) { - const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`; - throw new ReferenceError(msg); - } - let data = anchors.get(source); - if (!data) { - toJS.toJS(source, null, ctx); - data = anchors.get(source); - } - /* istanbul ignore if */ - if (data?.res === void 0) throw new ReferenceError("This should not happen: Alias anchor was not resolved?"); - if (maxAliasCount >= 0) { - data.count += 1; - if (data.aliasCount === 0) data.aliasCount = getAliasCount(doc, source, anchors); - if (data.count * data.aliasCount > maxAliasCount) throw new ReferenceError("Excessive alias count indicates a resource exhaustion attack"); - } - return data.res; - } - toString(ctx, _onComment, _onChompKeep) { - const src = `*${this.source}`; - if (ctx) { - anchors.anchorIsValid(this.source); - if (ctx.options.verifyAliasOrder && !ctx.anchors.has(this.source)) { - const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`; - throw new Error(msg); - } - if (ctx.implicitKey) return `${src} `; - } - return src; - } - }; - function getAliasCount(doc, node, anchors) { - if (identity.isAlias(node)) { - const source = node.resolve(doc); - const anchor = anchors && source && anchors.get(source); - return anchor ? anchor.count * anchor.aliasCount : 0; - } else if (identity.isCollection(node)) { - let count = 0; - for (const item of node.items) { - const c = getAliasCount(doc, item, anchors); - if (c > count) count = c; - } - return count; - } else if (identity.isPair(node)) { - const kc = getAliasCount(doc, node.key, anchors); - const vc = getAliasCount(doc, node.value, anchors); - return Math.max(kc, vc); - } - return 1; - } - exports.Alias = Alias; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Scalar.js -var require_Scalar = /* @__PURE__ */ __commonJSMin(((exports) => { - var identity = require_identity(); - var Node = require_Node(); - var toJS = require_toJS(); - const isScalarValue = (value) => !value || typeof value !== "function" && typeof value !== "object"; - var Scalar = class extends Node.NodeBase { - constructor(value) { - super(identity.SCALAR); - this.value = value; - } - toJSON(arg, ctx) { - return ctx?.keep ? this.value : toJS.toJS(this.value, arg, ctx); - } - toString() { - return String(this.value); - } - }; - Scalar.BLOCK_FOLDED = "BLOCK_FOLDED"; - Scalar.BLOCK_LITERAL = "BLOCK_LITERAL"; - Scalar.PLAIN = "PLAIN"; - Scalar.QUOTE_DOUBLE = "QUOTE_DOUBLE"; - Scalar.QUOTE_SINGLE = "QUOTE_SINGLE"; - exports.Scalar = Scalar; - exports.isScalarValue = isScalarValue; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/createNode.js -var require_createNode = /* @__PURE__ */ __commonJSMin(((exports) => { - var Alias = require_Alias(); - var identity = require_identity(); - var Scalar = require_Scalar(); - const defaultTagPrefix = "tag:yaml.org,2002:"; - function findTagObject(value, tagName, tags) { - if (tagName) { - const match = tags.filter((t) => t.tag === tagName); - const tagObj = match.find((t) => !t.format) ?? match[0]; - if (!tagObj) throw new Error(`Tag ${tagName} not found`); - return tagObj; - } - return tags.find((t) => t.identify?.(value) && !t.format); - } - function createNode(value, tagName, ctx) { - if (identity.isDocument(value)) value = value.contents; - if (identity.isNode(value)) return value; - if (identity.isPair(value)) { - const map = ctx.schema[identity.MAP].createNode?.(ctx.schema, null, ctx); - map.items.push(value); - return map; - } - if (value instanceof String || value instanceof Number || value instanceof Boolean || typeof BigInt !== "undefined" && value instanceof BigInt) value = value.valueOf(); - const { aliasDuplicateObjects, onAnchor, onTagObj, schema, sourceObjects } = ctx; - let ref = void 0; - if (aliasDuplicateObjects && value && typeof value === "object") { - ref = sourceObjects.get(value); - if (ref) { - ref.anchor ?? (ref.anchor = onAnchor(value)); - return new Alias.Alias(ref.anchor); - } else { - ref = { - anchor: null, - node: null - }; - sourceObjects.set(value, ref); - } - } - if (tagName?.startsWith("!!")) tagName = defaultTagPrefix + tagName.slice(2); - let tagObj = findTagObject(value, tagName, schema.tags); - if (!tagObj) { - if (value && typeof value.toJSON === "function") value = value.toJSON(); - if (!value || typeof value !== "object") { - const node = new Scalar.Scalar(value); - if (ref) ref.node = node; - return node; - } - tagObj = value instanceof Map ? schema[identity.MAP] : Symbol.iterator in Object(value) ? schema[identity.SEQ] : schema[identity.MAP]; - } - if (onTagObj) { - onTagObj(tagObj); - delete ctx.onTagObj; - } - const node = tagObj?.createNode ? tagObj.createNode(ctx.schema, value, ctx) : typeof tagObj?.nodeClass?.from === "function" ? tagObj.nodeClass.from(ctx.schema, value, ctx) : new Scalar.Scalar(value); - if (tagName) node.tag = tagName; - else if (!tagObj.default) node.tag = tagObj.tag; - if (ref) ref.node = node; - return node; - } - exports.createNode = createNode; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Collection.js -var require_Collection = /* @__PURE__ */ __commonJSMin(((exports) => { - var createNode = require_createNode(); - var identity = require_identity(); - var Node = require_Node(); - function collectionFromPath(schema, path, value) { - let v = value; - for (let i = path.length - 1; i >= 0; --i) { - const k = path[i]; - if (typeof k === "number" && Number.isInteger(k) && k >= 0) { - const a = []; - a[k] = v; - v = a; - } else v = new Map([[k, v]]); - } - return createNode.createNode(v, void 0, { - aliasDuplicateObjects: false, - keepUndefined: false, - onAnchor: () => { - throw new Error("This should not happen, please report a bug."); - }, - schema, - sourceObjects: /* @__PURE__ */ new Map() - }); - } - const isEmptyPath = (path) => path == null || typeof path === "object" && !!path[Symbol.iterator]().next().done; - var Collection = class extends Node.NodeBase { - constructor(type, schema) { - super(type); - Object.defineProperty(this, "schema", { - value: schema, - configurable: true, - enumerable: false, - writable: true - }); - } - /** - * Create a copy of this collection. - * - * @param schema - If defined, overwrites the original's schema - */ - clone(schema) { - const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this)); - if (schema) copy.schema = schema; - copy.items = copy.items.map((it) => identity.isNode(it) || identity.isPair(it) ? it.clone(schema) : it); - if (this.range) copy.range = this.range.slice(); - return copy; - } - /** - * Adds a value to the collection. For `!!map` and `!!omap` the value must - * be a Pair instance or a `{ key, value }` object, which may not have a key - * that already exists in the map. - */ - addIn(path, value) { - if (isEmptyPath(path)) this.add(value); - else { - const [key, ...rest] = path; - const node = this.get(key, true); - if (identity.isCollection(node)) node.addIn(rest, value); - else if (node === void 0 && this.schema) this.set(key, collectionFromPath(this.schema, rest, value)); - else throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`); - } - } - /** - * Removes a value from the collection. - * @returns `true` if the item was found and removed. - */ - deleteIn(path) { - const [key, ...rest] = path; - if (rest.length === 0) return this.delete(key); - const node = this.get(key, true); - if (identity.isCollection(node)) return node.deleteIn(rest); - else throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`); - } - /** - * Returns item at `key`, or `undefined` if not found. By default unwraps - * scalar values from their surrounding node; to disable set `keepScalar` to - * `true` (collections are always returned intact). - */ - getIn(path, keepScalar) { - const [key, ...rest] = path; - const node = this.get(key, true); - if (rest.length === 0) return !keepScalar && identity.isScalar(node) ? node.value : node; - else return identity.isCollection(node) ? node.getIn(rest, keepScalar) : void 0; - } - hasAllNullValues(allowScalar) { - return this.items.every((node) => { - if (!identity.isPair(node)) return false; - const n = node.value; - return n == null || allowScalar && identity.isScalar(n) && n.value == null && !n.commentBefore && !n.comment && !n.tag; - }); - } - /** - * Checks if the collection includes a value with the key `key`. - */ - hasIn(path) { - const [key, ...rest] = path; - if (rest.length === 0) return this.has(key); - const node = this.get(key, true); - return identity.isCollection(node) ? node.hasIn(rest) : false; - } - /** - * Sets a value in this collection. For `!!set`, `value` needs to be a - * boolean to add/remove the item from the set. - */ - setIn(path, value) { - const [key, ...rest] = path; - if (rest.length === 0) this.set(key, value); - else { - const node = this.get(key, true); - if (identity.isCollection(node)) node.setIn(rest, value); - else if (node === void 0 && this.schema) this.set(key, collectionFromPath(this.schema, rest, value)); - else throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`); - } - } - }; - exports.Collection = Collection; - exports.collectionFromPath = collectionFromPath; - exports.isEmptyPath = isEmptyPath; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyComment.js -var require_stringifyComment = /* @__PURE__ */ __commonJSMin(((exports) => { - /** - * Stringifies a comment. - * - * Empty comment lines are left empty, - * lines consisting of a single space are replaced by `#`, - * and all other lines are prefixed with a `#`. - */ - const stringifyComment = (str) => str.replace(/^(?!$)(?: $)?/gm, "#"); - function indentComment(comment, indent) { - if (/^\n+$/.test(comment)) return comment.substring(1); - return indent ? comment.replace(/^(?! *$)/gm, indent) : comment; - } - const lineComment = (str, indent, comment) => str.endsWith("\n") ? indentComment(comment, indent) : comment.includes("\n") ? "\n" + indentComment(comment, indent) : (str.endsWith(" ") ? "" : " ") + comment; - exports.indentComment = indentComment; - exports.lineComment = lineComment; - exports.stringifyComment = stringifyComment; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/foldFlowLines.js -var require_foldFlowLines = /* @__PURE__ */ __commonJSMin(((exports) => { - const FOLD_FLOW = "flow"; - const FOLD_BLOCK = "block"; - const FOLD_QUOTED = "quoted"; - /** - * Tries to keep input at up to `lineWidth` characters, splitting only on spaces - * not followed by newlines or spaces unless `mode` is `'quoted'`. Lines are - * terminated with `\n` and started with `indent`. - */ - function foldFlowLines(text, indent, mode = "flow", { indentAtStart, lineWidth = 80, minContentWidth = 20, onFold, onOverflow } = {}) { - if (!lineWidth || lineWidth < 0) return text; - if (lineWidth < minContentWidth) minContentWidth = 0; - const endStep = Math.max(1 + minContentWidth, 1 + lineWidth - indent.length); - if (text.length <= endStep) return text; - const folds = []; - const escapedFolds = {}; - let end = lineWidth - indent.length; - if (typeof indentAtStart === "number") if (indentAtStart > lineWidth - Math.max(2, minContentWidth)) folds.push(0); - else end = lineWidth - indentAtStart; - let split = void 0; - let prev = void 0; - let overflow = false; - let i = -1; - let escStart = -1; - let escEnd = -1; - if (mode === FOLD_BLOCK) { - i = consumeMoreIndentedLines(text, i, indent.length); - if (i !== -1) end = i + endStep; - } - for (let ch; ch = text[i += 1];) { - if (mode === FOLD_QUOTED && ch === "\\") { - escStart = i; - switch (text[i + 1]) { - case "x": - i += 3; - break; - case "u": - i += 5; - break; - case "U": - i += 9; - break; - default: i += 1; - } - escEnd = i; - } - if (ch === "\n") { - if (mode === FOLD_BLOCK) i = consumeMoreIndentedLines(text, i, indent.length); - end = i + indent.length + endStep; - split = void 0; - } else { - if (ch === " " && prev && prev !== " " && prev !== "\n" && prev !== " ") { - const next = text[i + 1]; - if (next && next !== " " && next !== "\n" && next !== " ") split = i; - } - if (i >= end) if (split) { - folds.push(split); - end = split + endStep; - split = void 0; - } else if (mode === FOLD_QUOTED) { - while (prev === " " || prev === " ") { - prev = ch; - ch = text[i += 1]; - overflow = true; - } - const j = i > escEnd + 1 ? i - 2 : escStart - 1; - if (escapedFolds[j]) return text; - folds.push(j); - escapedFolds[j] = true; - end = j + endStep; - split = void 0; - } else overflow = true; - } - prev = ch; - } - if (overflow && onOverflow) onOverflow(); - if (folds.length === 0) return text; - if (onFold) onFold(); - let res = text.slice(0, folds[0]); - for (let i = 0; i < folds.length; ++i) { - const fold = folds[i]; - const end = folds[i + 1] || text.length; - if (fold === 0) res = `\n${indent}${text.slice(0, end)}`; - else { - if (mode === FOLD_QUOTED && escapedFolds[fold]) res += `${text[fold]}\\`; - res += `\n${indent}${text.slice(fold + 1, end)}`; - } - } - return res; - } - /** - * Presumes `i + 1` is at the start of a line - * @returns index of last newline in more-indented block - */ - function consumeMoreIndentedLines(text, i, indent) { - let end = i; - let start = i + 1; - let ch = text[start]; - while (ch === " " || ch === " ") if (i < start + indent) ch = text[++i]; - else { - do - ch = text[++i]; - while (ch && ch !== "\n"); - end = i; - start = i + 1; - ch = text[start]; - } - return end; - } - exports.FOLD_BLOCK = FOLD_BLOCK; - exports.FOLD_FLOW = FOLD_FLOW; - exports.FOLD_QUOTED = FOLD_QUOTED; - exports.foldFlowLines = foldFlowLines; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyString.js -var require_stringifyString = /* @__PURE__ */ __commonJSMin(((exports) => { - var Scalar = require_Scalar(); - var foldFlowLines = require_foldFlowLines(); - const getFoldOptions = (ctx, isBlock) => ({ - indentAtStart: isBlock ? ctx.indent.length : ctx.indentAtStart, - lineWidth: ctx.options.lineWidth, - minContentWidth: ctx.options.minContentWidth - }); - const containsDocumentMarker = (str) => /^(%|---|\.\.\.)/m.test(str); - function lineLengthOverLimit(str, lineWidth, indentLength) { - if (!lineWidth || lineWidth < 0) return false; - const limit = lineWidth - indentLength; - const strLen = str.length; - if (strLen <= limit) return false; - for (let i = 0, start = 0; i < strLen; ++i) if (str[i] === "\n") { - if (i - start > limit) return true; - start = i + 1; - if (strLen - start <= limit) return false; - } - return true; - } - function doubleQuotedString(value, ctx) { - const json = JSON.stringify(value); - if (ctx.options.doubleQuotedAsJSON) return json; - const { implicitKey } = ctx; - const minMultiLineLength = ctx.options.doubleQuotedMinMultiLineLength; - const indent = ctx.indent || (containsDocumentMarker(value) ? " " : ""); - let str = ""; - let start = 0; - for (let i = 0, ch = json[i]; ch; ch = json[++i]) { - if (ch === " " && json[i + 1] === "\\" && json[i + 2] === "n") { - str += json.slice(start, i) + "\\ "; - i += 1; - start = i; - ch = "\\"; - } - if (ch === "\\") switch (json[i + 1]) { - case "u": - { - str += json.slice(start, i); - const code = json.substr(i + 2, 4); - switch (code) { - case "0000": - str += "\\0"; - break; - case "0007": - str += "\\a"; - break; - case "000b": - str += "\\v"; - break; - case "001b": - str += "\\e"; - break; - case "0085": - str += "\\N"; - break; - case "00a0": - str += "\\_"; - break; - case "2028": - str += "\\L"; - break; - case "2029": - str += "\\P"; - break; - default: if (code.substr(0, 2) === "00") str += "\\x" + code.substr(2); - else str += json.substr(i, 6); - } - i += 5; - start = i + 1; - } - break; - case "n": - if (implicitKey || json[i + 2] === "\"" || json.length < minMultiLineLength) i += 1; - else { - str += json.slice(start, i) + "\n\n"; - while (json[i + 2] === "\\" && json[i + 3] === "n" && json[i + 4] !== "\"") { - str += "\n"; - i += 2; - } - str += indent; - if (json[i + 2] === " ") str += "\\"; - i += 1; - start = i + 1; - } - break; - default: i += 1; - } - } - str = start ? str + json.slice(start) : json; - return implicitKey ? str : foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_QUOTED, getFoldOptions(ctx, false)); - } - function singleQuotedString(value, ctx) { - if (ctx.options.singleQuote === false || ctx.implicitKey && value.includes("\n") || /[ \t]\n|\n[ \t]/.test(value)) return doubleQuotedString(value, ctx); - const indent = ctx.indent || (containsDocumentMarker(value) ? " " : ""); - const res = "'" + value.replace(/'/g, "''").replace(/\n+/g, `$&\n${indent}`) + "'"; - return ctx.implicitKey ? res : foldFlowLines.foldFlowLines(res, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx, false)); - } - function quotedString(value, ctx) { - const { singleQuote } = ctx.options; - let qs; - if (singleQuote === false) qs = doubleQuotedString; - else { - const hasDouble = value.includes("\""); - const hasSingle = value.includes("'"); - if (hasDouble && !hasSingle) qs = singleQuotedString; - else if (hasSingle && !hasDouble) qs = doubleQuotedString; - else qs = singleQuote ? singleQuotedString : doubleQuotedString; - } - return qs(value, ctx); - } - let blockEndNewlines; - try { - blockEndNewlines = /* @__PURE__ */ new RegExp("(^|(?\n"; - let chomp; - let endStart; - for (endStart = value.length; endStart > 0; --endStart) { - const ch = value[endStart - 1]; - if (ch !== "\n" && ch !== " " && ch !== " ") break; - } - let end = value.substring(endStart); - const endNlPos = end.indexOf("\n"); - if (endNlPos === -1) chomp = "-"; - else if (value === end || endNlPos !== end.length - 1) { - chomp = "+"; - if (onChompKeep) onChompKeep(); - } else chomp = ""; - if (end) { - value = value.slice(0, -end.length); - if (end[end.length - 1] === "\n") end = end.slice(0, -1); - end = end.replace(blockEndNewlines, `$&${indent}`); - } - let startWithSpace = false; - let startEnd; - let startNlPos = -1; - for (startEnd = 0; startEnd < value.length; ++startEnd) { - const ch = value[startEnd]; - if (ch === " ") startWithSpace = true; - else if (ch === "\n") startNlPos = startEnd; - else break; - } - let start = value.substring(0, startNlPos < startEnd ? startNlPos + 1 : startEnd); - if (start) { - value = value.substring(start.length); - start = start.replace(/\n+/g, `$&${indent}`); - } - let header = (startWithSpace ? indent ? "2" : "1" : "") + chomp; - if (comment) { - header += " " + commentString(comment.replace(/ ?[\r\n]+/g, " ")); - if (onComment) onComment(); - } - if (!literal) { - const foldedValue = value.replace(/\n+/g, "\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, "$1$2").replace(/\n+/g, `$&${indent}`); - let literalFallback = false; - const foldOptions = getFoldOptions(ctx, true); - if (blockQuote !== "folded" && type !== Scalar.Scalar.BLOCK_FOLDED) foldOptions.onOverflow = () => { - literalFallback = true; - }; - const body = foldFlowLines.foldFlowLines(`${start}${foldedValue}${end}`, indent, foldFlowLines.FOLD_BLOCK, foldOptions); - if (!literalFallback) return `>${header}\n${indent}${body}`; - } - value = value.replace(/\n+/g, `$&${indent}`); - return `|${header}\n${indent}${start}${value}${end}`; - } - function plainString(item, ctx, onComment, onChompKeep) { - const { type, value } = item; - const { actualString, implicitKey, indent, indentStep, inFlow } = ctx; - if (implicitKey && value.includes("\n") || inFlow && /[[\]{},]/.test(value)) return quotedString(value, ctx); - if (/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) return implicitKey || inFlow || !value.includes("\n") ? quotedString(value, ctx) : blockString(item, ctx, onComment, onChompKeep); - if (!implicitKey && !inFlow && type !== Scalar.Scalar.PLAIN && value.includes("\n")) return blockString(item, ctx, onComment, onChompKeep); - if (containsDocumentMarker(value)) { - if (indent === "") { - ctx.forceBlockIndent = true; - return blockString(item, ctx, onComment, onChompKeep); - } else if (implicitKey && indent === indentStep) return quotedString(value, ctx); - } - const str = value.replace(/\n+/g, `$&\n${indent}`); - if (actualString) { - const test = (tag) => tag.default && tag.tag !== "tag:yaml.org,2002:str" && tag.test?.test(str); - const { compat, tags } = ctx.doc.schema; - if (tags.some(test) || compat?.some(test)) return quotedString(value, ctx); - } - return implicitKey ? str : foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx, false)); - } - function stringifyString(item, ctx, onComment, onChompKeep) { - const { implicitKey, inFlow } = ctx; - const ss = typeof item.value === "string" ? item : Object.assign({}, item, { value: String(item.value) }); - let { type } = item; - if (type !== Scalar.Scalar.QUOTE_DOUBLE) { - if (/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(ss.value)) type = Scalar.Scalar.QUOTE_DOUBLE; - } - const _stringify = (_type) => { - switch (_type) { - case Scalar.Scalar.BLOCK_FOLDED: - case Scalar.Scalar.BLOCK_LITERAL: return implicitKey || inFlow ? quotedString(ss.value, ctx) : blockString(ss, ctx, onComment, onChompKeep); - case Scalar.Scalar.QUOTE_DOUBLE: return doubleQuotedString(ss.value, ctx); - case Scalar.Scalar.QUOTE_SINGLE: return singleQuotedString(ss.value, ctx); - case Scalar.Scalar.PLAIN: return plainString(ss, ctx, onComment, onChompKeep); - default: return null; - } - }; - let res = _stringify(type); - if (res === null) { - const { defaultKeyType, defaultStringType } = ctx.options; - const t = implicitKey && defaultKeyType || defaultStringType; - res = _stringify(t); - if (res === null) throw new Error(`Unsupported default string type ${t}`); - } - return res; - } - exports.stringifyString = stringifyString; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringify.js -var require_stringify = /* @__PURE__ */ __commonJSMin(((exports) => { - var anchors = require_anchors(); - var identity = require_identity(); - var stringifyComment = require_stringifyComment(); - var stringifyString = require_stringifyString(); - function createStringifyContext(doc, options) { - const opt = Object.assign({ - blockQuote: true, - commentString: stringifyComment.stringifyComment, - defaultKeyType: null, - defaultStringType: "PLAIN", - directives: null, - doubleQuotedAsJSON: false, - doubleQuotedMinMultiLineLength: 40, - falseStr: "false", - flowCollectionPadding: true, - indentSeq: true, - lineWidth: 80, - minContentWidth: 20, - nullStr: "null", - simpleKeys: false, - singleQuote: null, - trueStr: "true", - verifyAliasOrder: true - }, doc.schema.toStringOptions, options); - let inFlow; - switch (opt.collectionStyle) { - case "block": - inFlow = false; - break; - case "flow": - inFlow = true; - break; - default: inFlow = null; - } - return { - anchors: /* @__PURE__ */ new Set(), - doc, - flowCollectionPadding: opt.flowCollectionPadding ? " " : "", - indent: "", - indentStep: typeof opt.indent === "number" ? " ".repeat(opt.indent) : " ", - inFlow, - options: opt - }; - } - function getTagObject(tags, item) { - if (item.tag) { - const match = tags.filter((t) => t.tag === item.tag); - if (match.length > 0) return match.find((t) => t.format === item.format) ?? match[0]; - } - let tagObj = void 0; - let obj; - if (identity.isScalar(item)) { - obj = item.value; - let match = tags.filter((t) => t.identify?.(obj)); - if (match.length > 1) { - const testMatch = match.filter((t) => t.test); - if (testMatch.length > 0) match = testMatch; - } - tagObj = match.find((t) => t.format === item.format) ?? match.find((t) => !t.format); - } else { - obj = item; - tagObj = tags.find((t) => t.nodeClass && obj instanceof t.nodeClass); - } - if (!tagObj) { - const name = obj?.constructor?.name ?? (obj === null ? "null" : typeof obj); - throw new Error(`Tag not resolved for ${name} value`); - } - return tagObj; - } - function stringifyProps(node, tagObj, { anchors: anchors$1, doc }) { - if (!doc.directives) return ""; - const props = []; - const anchor = (identity.isScalar(node) || identity.isCollection(node)) && node.anchor; - if (anchor && anchors.anchorIsValid(anchor)) { - anchors$1.add(anchor); - props.push(`&${anchor}`); - } - const tag = node.tag ?? (tagObj.default ? null : tagObj.tag); - if (tag) props.push(doc.directives.tagString(tag)); - return props.join(" "); - } - function stringify(item, ctx, onComment, onChompKeep) { - if (identity.isPair(item)) return item.toString(ctx, onComment, onChompKeep); - if (identity.isAlias(item)) { - if (ctx.doc.directives) return item.toString(ctx); - if (ctx.resolvedAliases?.has(item)) throw new TypeError(`Cannot stringify circular structure without alias nodes`); - else { - if (ctx.resolvedAliases) ctx.resolvedAliases.add(item); - else ctx.resolvedAliases = new Set([item]); - item = item.resolve(ctx.doc); - } - } - let tagObj = void 0; - const node = identity.isNode(item) ? item : ctx.doc.createNode(item, { onTagObj: (o) => tagObj = o }); - tagObj ?? (tagObj = getTagObject(ctx.doc.schema.tags, node)); - const props = stringifyProps(node, tagObj, ctx); - if (props.length > 0) ctx.indentAtStart = (ctx.indentAtStart ?? 0) + props.length + 1; - const str = typeof tagObj.stringify === "function" ? tagObj.stringify(node, ctx, onComment, onChompKeep) : identity.isScalar(node) ? stringifyString.stringifyString(node, ctx, onComment, onChompKeep) : node.toString(ctx, onComment, onChompKeep); - if (!props) return str; - return identity.isScalar(node) || str[0] === "{" || str[0] === "[" ? `${props} ${str}` : `${props}\n${ctx.indent}${str}`; - } - exports.createStringifyContext = createStringifyContext; - exports.stringify = stringify; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyPair.js -var require_stringifyPair = /* @__PURE__ */ __commonJSMin(((exports) => { - var identity = require_identity(); - var Scalar = require_Scalar(); - var stringify = require_stringify(); - var stringifyComment = require_stringifyComment(); - function stringifyPair({ key, value }, ctx, onComment, onChompKeep) { - const { allNullValues, doc, indent, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx; - let keyComment = identity.isNode(key) && key.comment || null; - if (simpleKeys) { - if (keyComment) throw new Error("With simple keys, key nodes cannot have comments"); - if (identity.isCollection(key) || !identity.isNode(key) && typeof key === "object") throw new Error("With simple keys, collection cannot be used as a key value"); - } - let explicitKey = !simpleKeys && (!key || keyComment && value == null && !ctx.inFlow || identity.isCollection(key) || (identity.isScalar(key) ? key.type === Scalar.Scalar.BLOCK_FOLDED || key.type === Scalar.Scalar.BLOCK_LITERAL : typeof key === "object")); - ctx = Object.assign({}, ctx, { - allNullValues: false, - implicitKey: !explicitKey && (simpleKeys || !allNullValues), - indent: indent + indentStep - }); - let keyCommentDone = false; - let chompKeep = false; - let str = stringify.stringify(key, ctx, () => keyCommentDone = true, () => chompKeep = true); - if (!explicitKey && !ctx.inFlow && str.length > 1024) { - if (simpleKeys) throw new Error("With simple keys, single line scalar must not span more than 1024 characters"); - explicitKey = true; - } - if (ctx.inFlow) { - if (allNullValues || value == null) { - if (keyCommentDone && onComment) onComment(); - return str === "" ? "?" : explicitKey ? `? ${str}` : str; - } - } else if (allNullValues && !simpleKeys || value == null && explicitKey) { - str = `? ${str}`; - if (keyComment && !keyCommentDone) str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment)); - else if (chompKeep && onChompKeep) onChompKeep(); - return str; - } - if (keyCommentDone) keyComment = null; - if (explicitKey) { - if (keyComment) str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment)); - str = `? ${str}\n${indent}:`; - } else { - str = `${str}:`; - if (keyComment) str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment)); - } - let vsb, vcb, valueComment; - if (identity.isNode(value)) { - vsb = !!value.spaceBefore; - vcb = value.commentBefore; - valueComment = value.comment; - } else { - vsb = false; - vcb = null; - valueComment = null; - if (value && typeof value === "object") value = doc.createNode(value); - } - ctx.implicitKey = false; - if (!explicitKey && !keyComment && identity.isScalar(value)) ctx.indentAtStart = str.length + 1; - chompKeep = false; - if (!indentSeq && indentStep.length >= 2 && !ctx.inFlow && !explicitKey && identity.isSeq(value) && !value.flow && !value.tag && !value.anchor) ctx.indent = ctx.indent.substring(2); - let valueCommentDone = false; - const valueStr = stringify.stringify(value, ctx, () => valueCommentDone = true, () => chompKeep = true); - let ws = " "; - if (keyComment || vsb || vcb) { - ws = vsb ? "\n" : ""; - if (vcb) { - const cs = commentString(vcb); - ws += `\n${stringifyComment.indentComment(cs, ctx.indent)}`; - } - if (valueStr === "" && !ctx.inFlow) { - if (ws === "\n" && valueComment) ws = "\n\n"; - } else ws += `\n${ctx.indent}`; - } else if (!explicitKey && identity.isCollection(value)) { - const vs0 = valueStr[0]; - const nl0 = valueStr.indexOf("\n"); - const hasNewline = nl0 !== -1; - const flow = ctx.inFlow ?? value.flow ?? value.items.length === 0; - if (hasNewline || !flow) { - let hasPropsLine = false; - if (hasNewline && (vs0 === "&" || vs0 === "!")) { - let sp0 = valueStr.indexOf(" "); - if (vs0 === "&" && sp0 !== -1 && sp0 < nl0 && valueStr[sp0 + 1] === "!") sp0 = valueStr.indexOf(" ", sp0 + 1); - if (sp0 === -1 || nl0 < sp0) hasPropsLine = true; - } - if (!hasPropsLine) ws = `\n${ctx.indent}`; - } - } else if (valueStr === "" || valueStr[0] === "\n") ws = ""; - str += ws + valueStr; - if (ctx.inFlow) { - if (valueCommentDone && onComment) onComment(); - } else if (valueComment && !valueCommentDone) str += stringifyComment.lineComment(str, ctx.indent, commentString(valueComment)); - else if (chompKeep && onChompKeep) onChompKeep(); - return str; - } - exports.stringifyPair = stringifyPair; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/log.js -var require_log = /* @__PURE__ */ __commonJSMin(((exports) => { - var node_process$2 = __require("process"); - function debug(logLevel, ...messages) { - if (logLevel === "debug") console.log(...messages); - } - function warn(logLevel, warning) { - if (logLevel === "debug" || logLevel === "warn") if (typeof node_process$2.emitWarning === "function") node_process$2.emitWarning(warning); - else console.warn(warning); - } - exports.debug = debug; - exports.warn = warn; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/merge.js -var require_merge = /* @__PURE__ */ __commonJSMin(((exports) => { - var identity = require_identity(); - var Scalar = require_Scalar(); - const MERGE_KEY = "<<"; - const merge = { - identify: (value) => value === MERGE_KEY || typeof value === "symbol" && value.description === MERGE_KEY, - default: "key", - tag: "tag:yaml.org,2002:merge", - test: /^<<$/, - resolve: () => Object.assign(new Scalar.Scalar(Symbol(MERGE_KEY)), { addToJSMap: addMergeToJSMap }), - stringify: () => MERGE_KEY - }; - const isMergeKey = (ctx, key) => (merge.identify(key) || identity.isScalar(key) && (!key.type || key.type === Scalar.Scalar.PLAIN) && merge.identify(key.value)) && ctx?.doc.schema.tags.some((tag) => tag.tag === merge.tag && tag.default); - function addMergeToJSMap(ctx, map, value) { - value = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value; - if (identity.isSeq(value)) for (const it of value.items) mergeValue(ctx, map, it); - else if (Array.isArray(value)) for (const it of value) mergeValue(ctx, map, it); - else mergeValue(ctx, map, value); - } - function mergeValue(ctx, map, value) { - const source = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value; - if (!identity.isMap(source)) throw new Error("Merge sources must be maps or map aliases"); - const srcMap = source.toJSON(null, ctx, Map); - for (const [key, value] of srcMap) if (map instanceof Map) { - if (!map.has(key)) map.set(key, value); - } else if (map instanceof Set) map.add(key); - else if (!Object.prototype.hasOwnProperty.call(map, key)) Object.defineProperty(map, key, { - value, - writable: true, - enumerable: true, - configurable: true - }); - return map; - } - exports.addMergeToJSMap = addMergeToJSMap; - exports.isMergeKey = isMergeKey; - exports.merge = merge; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/addPairToJSMap.js -var require_addPairToJSMap = /* @__PURE__ */ __commonJSMin(((exports) => { - var log = require_log(); - var merge = require_merge(); - var stringify = require_stringify(); - var identity = require_identity(); - var toJS = require_toJS(); - function addPairToJSMap(ctx, map, { key, value }) { - if (identity.isNode(key) && key.addToJSMap) key.addToJSMap(ctx, map, value); - else if (merge.isMergeKey(ctx, key)) merge.addMergeToJSMap(ctx, map, value); - else { - const jsKey = toJS.toJS(key, "", ctx); - if (map instanceof Map) map.set(jsKey, toJS.toJS(value, jsKey, ctx)); - else if (map instanceof Set) map.add(jsKey); - else { - const stringKey = stringifyKey(key, jsKey, ctx); - const jsValue = toJS.toJS(value, stringKey, ctx); - if (stringKey in map) Object.defineProperty(map, stringKey, { - value: jsValue, - writable: true, - enumerable: true, - configurable: true - }); - else map[stringKey] = jsValue; - } - } - return map; - } - function stringifyKey(key, jsKey, ctx) { - if (jsKey === null) return ""; - if (typeof jsKey !== "object") return String(jsKey); - if (identity.isNode(key) && ctx?.doc) { - const strCtx = stringify.createStringifyContext(ctx.doc, {}); - strCtx.anchors = /* @__PURE__ */ new Set(); - for (const node of ctx.anchors.keys()) strCtx.anchors.add(node.anchor); - strCtx.inFlow = true; - strCtx.inStringifyKey = true; - const strKey = key.toString(strCtx); - if (!ctx.mapKeyWarned) { - let jsonStr = JSON.stringify(strKey); - if (jsonStr.length > 40) jsonStr = jsonStr.substring(0, 36) + "...\""; - log.warn(ctx.doc.options.logLevel, `Keys with collection values will be stringified due to JS Object restrictions: ${jsonStr}. Set mapAsMap: true to use object keys.`); - ctx.mapKeyWarned = true; - } - return strKey; - } - return JSON.stringify(jsKey); - } - exports.addPairToJSMap = addPairToJSMap; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Pair.js -var require_Pair = /* @__PURE__ */ __commonJSMin(((exports) => { - var createNode = require_createNode(); - var stringifyPair = require_stringifyPair(); - var addPairToJSMap = require_addPairToJSMap(); - var identity = require_identity(); - function createPair(key, value, ctx) { - return new Pair(createNode.createNode(key, void 0, ctx), createNode.createNode(value, void 0, ctx)); - } - var Pair = class Pair { - constructor(key, value = null) { - Object.defineProperty(this, identity.NODE_TYPE, { value: identity.PAIR }); - this.key = key; - this.value = value; - } - clone(schema) { - let { key, value } = this; - if (identity.isNode(key)) key = key.clone(schema); - if (identity.isNode(value)) value = value.clone(schema); - return new Pair(key, value); - } - toJSON(_, ctx) { - const pair = ctx?.mapAsMap ? /* @__PURE__ */ new Map() : {}; - return addPairToJSMap.addPairToJSMap(ctx, pair, this); - } - toString(ctx, onComment, onChompKeep) { - return ctx?.doc ? stringifyPair.stringifyPair(this, ctx, onComment, onChompKeep) : JSON.stringify(this); - } - }; - exports.Pair = Pair; - exports.createPair = createPair; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyCollection.js -var require_stringifyCollection = /* @__PURE__ */ __commonJSMin(((exports) => { - var identity = require_identity(); - var stringify = require_stringify(); - var stringifyComment = require_stringifyComment(); - function stringifyCollection(collection, ctx, options) { - return (ctx.inFlow ?? collection.flow ? stringifyFlowCollection : stringifyBlockCollection)(collection, ctx, options); - } - function stringifyBlockCollection({ comment, items }, ctx, { blockItemPrefix, flowChars, itemIndent, onChompKeep, onComment }) { - const { indent, options: { commentString } } = ctx; - const itemCtx = Object.assign({}, ctx, { - indent: itemIndent, - type: null - }); - let chompKeep = false; - const lines = []; - for (let i = 0; i < items.length; ++i) { - const item = items[i]; - let comment = null; - if (identity.isNode(item)) { - if (!chompKeep && item.spaceBefore) lines.push(""); - addCommentBefore(ctx, lines, item.commentBefore, chompKeep); - if (item.comment) comment = item.comment; - } else if (identity.isPair(item)) { - const ik = identity.isNode(item.key) ? item.key : null; - if (ik) { - if (!chompKeep && ik.spaceBefore) lines.push(""); - addCommentBefore(ctx, lines, ik.commentBefore, chompKeep); - } - } - chompKeep = false; - let str = stringify.stringify(item, itemCtx, () => comment = null, () => chompKeep = true); - if (comment) str += stringifyComment.lineComment(str, itemIndent, commentString(comment)); - if (chompKeep && comment) chompKeep = false; - lines.push(blockItemPrefix + str); - } - let str; - if (lines.length === 0) str = flowChars.start + flowChars.end; - else { - str = lines[0]; - for (let i = 1; i < lines.length; ++i) { - const line = lines[i]; - str += line ? `\n${indent}${line}` : "\n"; - } - } - if (comment) { - str += "\n" + stringifyComment.indentComment(commentString(comment), indent); - if (onComment) onComment(); - } else if (chompKeep && onChompKeep) onChompKeep(); - return str; - } - function stringifyFlowCollection({ items }, ctx, { flowChars, itemIndent }) { - const { indent, indentStep, flowCollectionPadding: fcPadding, options: { commentString } } = ctx; - itemIndent += indentStep; - const itemCtx = Object.assign({}, ctx, { - indent: itemIndent, - inFlow: true, - type: null - }); - let reqNewline = false; - let linesAtValue = 0; - const lines = []; - for (let i = 0; i < items.length; ++i) { - const item = items[i]; - let comment = null; - if (identity.isNode(item)) { - if (item.spaceBefore) lines.push(""); - addCommentBefore(ctx, lines, item.commentBefore, false); - if (item.comment) comment = item.comment; - } else if (identity.isPair(item)) { - const ik = identity.isNode(item.key) ? item.key : null; - if (ik) { - if (ik.spaceBefore) lines.push(""); - addCommentBefore(ctx, lines, ik.commentBefore, false); - if (ik.comment) reqNewline = true; - } - const iv = identity.isNode(item.value) ? item.value : null; - if (iv) { - if (iv.comment) comment = iv.comment; - if (iv.commentBefore) reqNewline = true; - } else if (item.value == null && ik?.comment) comment = ik.comment; - } - if (comment) reqNewline = true; - let str = stringify.stringify(item, itemCtx, () => comment = null); - if (i < items.length - 1) str += ","; - if (comment) str += stringifyComment.lineComment(str, itemIndent, commentString(comment)); - if (!reqNewline && (lines.length > linesAtValue || str.includes("\n"))) reqNewline = true; - lines.push(str); - linesAtValue = lines.length; - } - const { start, end } = flowChars; - if (lines.length === 0) return start + end; - else { - if (!reqNewline) { - const len = lines.reduce((sum, line) => sum + line.length + 2, 2); - reqNewline = ctx.options.lineWidth > 0 && len > ctx.options.lineWidth; - } - if (reqNewline) { - let str = start; - for (const line of lines) str += line ? `\n${indentStep}${indent}${line}` : "\n"; - return `${str}\n${indent}${end}`; - } else return `${start}${fcPadding}${lines.join(" ")}${fcPadding}${end}`; - } - } - function addCommentBefore({ indent, options: { commentString } }, lines, comment, chompKeep) { - if (comment && chompKeep) comment = comment.replace(/^\n+/, ""); - if (comment) { - const ic = stringifyComment.indentComment(commentString(comment), indent); - lines.push(ic.trimStart()); - } - } - exports.stringifyCollection = stringifyCollection; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/YAMLMap.js -var require_YAMLMap = /* @__PURE__ */ __commonJSMin(((exports) => { - var stringifyCollection = require_stringifyCollection(); - var addPairToJSMap = require_addPairToJSMap(); - var Collection = require_Collection(); - var identity = require_identity(); - var Pair = require_Pair(); - var Scalar = require_Scalar(); - function findPair(items, key) { - const k = identity.isScalar(key) ? key.value : key; - for (const it of items) if (identity.isPair(it)) { - if (it.key === key || it.key === k) return it; - if (identity.isScalar(it.key) && it.key.value === k) return it; - } - } - var YAMLMap = class extends Collection.Collection { - static get tagName() { - return "tag:yaml.org,2002:map"; - } - constructor(schema) { - super(identity.MAP, schema); - this.items = []; - } - /** - * A generic collection parsing method that can be extended - * to other node classes that inherit from YAMLMap - */ - static from(schema, obj, ctx) { - const { keepUndefined, replacer } = ctx; - const map = new this(schema); - const add = (key, value) => { - if (typeof replacer === "function") value = replacer.call(obj, key, value); - else if (Array.isArray(replacer) && !replacer.includes(key)) return; - if (value !== void 0 || keepUndefined) map.items.push(Pair.createPair(key, value, ctx)); - }; - if (obj instanceof Map) for (const [key, value] of obj) add(key, value); - else if (obj && typeof obj === "object") for (const key of Object.keys(obj)) add(key, obj[key]); - if (typeof schema.sortMapEntries === "function") map.items.sort(schema.sortMapEntries); - return map; - } - /** - * Adds a value to the collection. - * - * @param overwrite - If not set `true`, using a key that is already in the - * collection will throw. Otherwise, overwrites the previous value. - */ - add(pair, overwrite) { - let _pair; - if (identity.isPair(pair)) _pair = pair; - else if (!pair || typeof pair !== "object" || !("key" in pair)) _pair = new Pair.Pair(pair, pair?.value); - else _pair = new Pair.Pair(pair.key, pair.value); - const prev = findPair(this.items, _pair.key); - const sortEntries = this.schema?.sortMapEntries; - if (prev) { - if (!overwrite) throw new Error(`Key ${_pair.key} already set`); - if (identity.isScalar(prev.value) && Scalar.isScalarValue(_pair.value)) prev.value.value = _pair.value; - else prev.value = _pair.value; - } else if (sortEntries) { - const i = this.items.findIndex((item) => sortEntries(_pair, item) < 0); - if (i === -1) this.items.push(_pair); - else this.items.splice(i, 0, _pair); - } else this.items.push(_pair); - } - delete(key) { - const it = findPair(this.items, key); - if (!it) return false; - return this.items.splice(this.items.indexOf(it), 1).length > 0; - } - get(key, keepScalar) { - const node = findPair(this.items, key)?.value; - return (!keepScalar && identity.isScalar(node) ? node.value : node) ?? void 0; - } - has(key) { - return !!findPair(this.items, key); - } - set(key, value) { - this.add(new Pair.Pair(key, value), true); - } - /** - * @param ctx - Conversion context, originally set in Document#toJS() - * @param {Class} Type - If set, forces the returned collection type - * @returns Instance of Type, Map, or Object - */ - toJSON(_, ctx, Type) { - const map = Type ? new Type() : ctx?.mapAsMap ? /* @__PURE__ */ new Map() : {}; - if (ctx?.onCreate) ctx.onCreate(map); - for (const item of this.items) addPairToJSMap.addPairToJSMap(ctx, map, item); - return map; - } - toString(ctx, onComment, onChompKeep) { - if (!ctx) return JSON.stringify(this); - for (const item of this.items) if (!identity.isPair(item)) throw new Error(`Map items must all be pairs; found ${JSON.stringify(item)} instead`); - if (!ctx.allNullValues && this.hasAllNullValues(false)) ctx = Object.assign({}, ctx, { allNullValues: true }); - return stringifyCollection.stringifyCollection(this, ctx, { - blockItemPrefix: "", - flowChars: { - start: "{", - end: "}" - }, - itemIndent: ctx.indent || "", - onChompKeep, - onComment - }); - } - }; - exports.YAMLMap = YAMLMap; - exports.findPair = findPair; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/map.js -var require_map = /* @__PURE__ */ __commonJSMin(((exports) => { - var identity = require_identity(); - var YAMLMap = require_YAMLMap(); - exports.map = { - collection: "map", - default: true, - nodeClass: YAMLMap.YAMLMap, - tag: "tag:yaml.org,2002:map", - resolve(map, onError) { - if (!identity.isMap(map)) onError("Expected a mapping for this tag"); - return map; - }, - createNode: (schema, obj, ctx) => YAMLMap.YAMLMap.from(schema, obj, ctx) - }; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/YAMLSeq.js -var require_YAMLSeq = /* @__PURE__ */ __commonJSMin(((exports) => { - var createNode = require_createNode(); - var stringifyCollection = require_stringifyCollection(); - var Collection = require_Collection(); - var identity = require_identity(); - var Scalar = require_Scalar(); - var toJS = require_toJS(); - var YAMLSeq = class extends Collection.Collection { - static get tagName() { - return "tag:yaml.org,2002:seq"; - } - constructor(schema) { - super(identity.SEQ, schema); - this.items = []; - } - add(value) { - this.items.push(value); - } - /** - * Removes a value from the collection. - * - * `key` must contain a representation of an integer for this to succeed. - * It may be wrapped in a `Scalar`. - * - * @returns `true` if the item was found and removed. - */ - delete(key) { - const idx = asItemIndex(key); - if (typeof idx !== "number") return false; - return this.items.splice(idx, 1).length > 0; - } - get(key, keepScalar) { - const idx = asItemIndex(key); - if (typeof idx !== "number") return void 0; - const it = this.items[idx]; - return !keepScalar && identity.isScalar(it) ? it.value : it; - } - /** - * Checks if the collection includes a value with the key `key`. - * - * `key` must contain a representation of an integer for this to succeed. - * It may be wrapped in a `Scalar`. - */ - has(key) { - const idx = asItemIndex(key); - return typeof idx === "number" && idx < this.items.length; - } - /** - * Sets a value in this collection. For `!!set`, `value` needs to be a - * boolean to add/remove the item from the set. - * - * If `key` does not contain a representation of an integer, this will throw. - * It may be wrapped in a `Scalar`. - */ - set(key, value) { - const idx = asItemIndex(key); - if (typeof idx !== "number") throw new Error(`Expected a valid index, not ${key}.`); - const prev = this.items[idx]; - if (identity.isScalar(prev) && Scalar.isScalarValue(value)) prev.value = value; - else this.items[idx] = value; - } - toJSON(_, ctx) { - const seq = []; - if (ctx?.onCreate) ctx.onCreate(seq); - let i = 0; - for (const item of this.items) seq.push(toJS.toJS(item, String(i++), ctx)); - return seq; - } - toString(ctx, onComment, onChompKeep) { - if (!ctx) return JSON.stringify(this); - return stringifyCollection.stringifyCollection(this, ctx, { - blockItemPrefix: "- ", - flowChars: { - start: "[", - end: "]" - }, - itemIndent: (ctx.indent || "") + " ", - onChompKeep, - onComment - }); - } - static from(schema, obj, ctx) { - const { replacer } = ctx; - const seq = new this(schema); - if (obj && Symbol.iterator in Object(obj)) { - let i = 0; - for (let it of obj) { - if (typeof replacer === "function") { - const key = obj instanceof Set ? it : String(i++); - it = replacer.call(obj, key, it); - } - seq.items.push(createNode.createNode(it, void 0, ctx)); - } - } - return seq; - } - }; - function asItemIndex(key) { - let idx = identity.isScalar(key) ? key.value : key; - if (idx && typeof idx === "string") idx = Number(idx); - return typeof idx === "number" && Number.isInteger(idx) && idx >= 0 ? idx : null; - } - exports.YAMLSeq = YAMLSeq; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/seq.js -var require_seq = /* @__PURE__ */ __commonJSMin(((exports) => { - var identity = require_identity(); - var YAMLSeq = require_YAMLSeq(); - exports.seq = { - collection: "seq", - default: true, - nodeClass: YAMLSeq.YAMLSeq, - tag: "tag:yaml.org,2002:seq", - resolve(seq, onError) { - if (!identity.isSeq(seq)) onError("Expected a sequence for this tag"); - return seq; - }, - createNode: (schema, obj, ctx) => YAMLSeq.YAMLSeq.from(schema, obj, ctx) - }; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/string.js -var require_string = /* @__PURE__ */ __commonJSMin(((exports) => { - var stringifyString = require_stringifyString(); - exports.string = { - identify: (value) => typeof value === "string", - default: true, - tag: "tag:yaml.org,2002:str", - resolve: (str) => str, - stringify(item, ctx, onComment, onChompKeep) { - ctx = Object.assign({ actualString: true }, ctx); - return stringifyString.stringifyString(item, ctx, onComment, onChompKeep); - } - }; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/null.js -var require_null = /* @__PURE__ */ __commonJSMin(((exports) => { - var Scalar = require_Scalar(); - const nullTag = { - identify: (value) => value == null, - createNode: () => new Scalar.Scalar(null), - default: true, - tag: "tag:yaml.org,2002:null", - test: /^(?:~|[Nn]ull|NULL)?$/, - resolve: () => new Scalar.Scalar(null), - stringify: ({ source }, ctx) => typeof source === "string" && nullTag.test.test(source) ? source : ctx.options.nullStr - }; - exports.nullTag = nullTag; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/bool.js -var require_bool$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - var Scalar = require_Scalar(); - const boolTag = { - identify: (value) => typeof value === "boolean", - default: true, - tag: "tag:yaml.org,2002:bool", - test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/, - resolve: (str) => new Scalar.Scalar(str[0] === "t" || str[0] === "T"), - stringify({ source, value }, ctx) { - if (source && boolTag.test.test(source)) { - if (value === (source[0] === "t" || source[0] === "T")) return source; - } - return value ? ctx.options.trueStr : ctx.options.falseStr; - } - }; - exports.boolTag = boolTag; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyNumber.js -var require_stringifyNumber = /* @__PURE__ */ __commonJSMin(((exports) => { - function stringifyNumber({ format, minFractionDigits, tag, value }) { - if (typeof value === "bigint") return String(value); - const num = typeof value === "number" ? value : Number(value); - if (!isFinite(num)) return isNaN(num) ? ".nan" : num < 0 ? "-.inf" : ".inf"; - let n = Object.is(value, -0) ? "-0" : JSON.stringify(value); - if (!format && minFractionDigits && (!tag || tag === "tag:yaml.org,2002:float") && /^\d/.test(n)) { - let i = n.indexOf("."); - if (i < 0) { - i = n.length; - n += "."; - } - let d = minFractionDigits - (n.length - i - 1); - while (d-- > 0) n += "0"; - } - return n; - } - exports.stringifyNumber = stringifyNumber; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/float.js -var require_float$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - var Scalar = require_Scalar(); - var stringifyNumber = require_stringifyNumber(); - const floatNaN = { - identify: (value) => typeof value === "number", - default: true, - tag: "tag:yaml.org,2002:float", - test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/, - resolve: (str) => str.slice(-3).toLowerCase() === "nan" ? NaN : str[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY, - stringify: stringifyNumber.stringifyNumber - }; - const floatExp = { - identify: (value) => typeof value === "number", - default: true, - tag: "tag:yaml.org,2002:float", - format: "EXP", - test: /^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/, - resolve: (str) => parseFloat(str), - stringify(node) { - const num = Number(node.value); - return isFinite(num) ? num.toExponential() : stringifyNumber.stringifyNumber(node); - } - }; - exports.float = { - identify: (value) => typeof value === "number", - default: true, - tag: "tag:yaml.org,2002:float", - test: /^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/, - resolve(str) { - const node = new Scalar.Scalar(parseFloat(str)); - const dot = str.indexOf("."); - if (dot !== -1 && str[str.length - 1] === "0") node.minFractionDigits = str.length - dot - 1; - return node; - }, - stringify: stringifyNumber.stringifyNumber - }; - exports.floatExp = floatExp; - exports.floatNaN = floatNaN; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/int.js -var require_int$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - var stringifyNumber = require_stringifyNumber(); - const intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value); - const intResolve = (str, offset, radix, { intAsBigInt }) => intAsBigInt ? BigInt(str) : parseInt(str.substring(offset), radix); - function intStringify(node, radix, prefix) { - const { value } = node; - if (intIdentify(value) && value >= 0) return prefix + value.toString(radix); - return stringifyNumber.stringifyNumber(node); - } - const intOct = { - identify: (value) => intIdentify(value) && value >= 0, - default: true, - tag: "tag:yaml.org,2002:int", - format: "OCT", - test: /^0o[0-7]+$/, - resolve: (str, _onError, opt) => intResolve(str, 2, 8, opt), - stringify: (node) => intStringify(node, 8, "0o") - }; - const int = { - identify: intIdentify, - default: true, - tag: "tag:yaml.org,2002:int", - test: /^[-+]?[0-9]+$/, - resolve: (str, _onError, opt) => intResolve(str, 0, 10, opt), - stringify: stringifyNumber.stringifyNumber - }; - const intHex = { - identify: (value) => intIdentify(value) && value >= 0, - default: true, - tag: "tag:yaml.org,2002:int", - format: "HEX", - test: /^0x[0-9a-fA-F]+$/, - resolve: (str, _onError, opt) => intResolve(str, 2, 16, opt), - stringify: (node) => intStringify(node, 16, "0x") - }; - exports.int = int; - exports.intHex = intHex; - exports.intOct = intOct; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/schema.js -var require_schema$2 = /* @__PURE__ */ __commonJSMin(((exports) => { - var map = require_map(); - var _null = require_null(); - var seq = require_seq(); - var string = require_string(); - var bool = require_bool$1(); - var float = require_float$1(); - var int = require_int$1(); - exports.schema = [ - map.map, - seq.seq, - string.string, - _null.nullTag, - bool.boolTag, - int.intOct, - int.int, - int.intHex, - float.floatNaN, - float.floatExp, - float.float - ]; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/json/schema.js -var require_schema$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - var Scalar = require_Scalar(); - var map = require_map(); - var seq = require_seq(); - function intIdentify(value) { - return typeof value === "bigint" || Number.isInteger(value); - } - const stringifyJSON = ({ value }) => JSON.stringify(value); - const jsonScalars = [ - { - identify: (value) => typeof value === "string", - default: true, - tag: "tag:yaml.org,2002:str", - resolve: (str) => str, - stringify: stringifyJSON - }, - { - identify: (value) => value == null, - createNode: () => new Scalar.Scalar(null), - default: true, - tag: "tag:yaml.org,2002:null", - test: /^null$/, - resolve: () => null, - stringify: stringifyJSON - }, - { - identify: (value) => typeof value === "boolean", - default: true, - tag: "tag:yaml.org,2002:bool", - test: /^true$|^false$/, - resolve: (str) => str === "true", - stringify: stringifyJSON - }, - { - identify: intIdentify, - default: true, - tag: "tag:yaml.org,2002:int", - test: /^-?(?:0|[1-9][0-9]*)$/, - resolve: (str, _onError, { intAsBigInt }) => intAsBigInt ? BigInt(str) : parseInt(str, 10), - stringify: ({ value }) => intIdentify(value) ? value.toString() : JSON.stringify(value) - }, - { - identify: (value) => typeof value === "number", - default: true, - tag: "tag:yaml.org,2002:float", - test: /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/, - resolve: (str) => parseFloat(str), - stringify: stringifyJSON - } - ]; - exports.schema = [map.map, seq.seq].concat(jsonScalars, { - default: true, - tag: "", - test: /^/, - resolve(str, onError) { - onError(`Unresolved plain scalar ${JSON.stringify(str)}`); - return str; - } - }); -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/binary.js -var require_binary = /* @__PURE__ */ __commonJSMin(((exports) => { - var node_buffer = __require("buffer"); - var Scalar = require_Scalar(); - var stringifyString = require_stringifyString(); - exports.binary = { - identify: (value) => value instanceof Uint8Array, - default: false, - tag: "tag:yaml.org,2002:binary", - /** - * Returns a Buffer in node and an Uint8Array in browsers - * - * To use the resulting buffer as an image, you'll want to do something like: - * - * const blob = new Blob([buffer], { type: 'image/jpeg' }) - * document.querySelector('#photo').src = URL.createObjectURL(blob) - */ - resolve(src, onError) { - if (typeof node_buffer.Buffer === "function") return node_buffer.Buffer.from(src, "base64"); - else if (typeof atob === "function") { - const str = atob(src.replace(/[\n\r]/g, "")); - const buffer = new Uint8Array(str.length); - for (let i = 0; i < str.length; ++i) buffer[i] = str.charCodeAt(i); - return buffer; - } else { - onError("This environment does not support reading binary tags; either Buffer or atob is required"); - return src; - } - }, - stringify({ comment, type, value }, ctx, onComment, onChompKeep) { - if (!value) return ""; - const buf = value; - let str; - if (typeof node_buffer.Buffer === "function") str = buf instanceof node_buffer.Buffer ? buf.toString("base64") : node_buffer.Buffer.from(buf.buffer).toString("base64"); - else if (typeof btoa === "function") { - let s = ""; - for (let i = 0; i < buf.length; ++i) s += String.fromCharCode(buf[i]); - str = btoa(s); - } else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required"); - type ?? (type = Scalar.Scalar.BLOCK_LITERAL); - if (type !== Scalar.Scalar.QUOTE_DOUBLE) { - const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth); - const n = Math.ceil(str.length / lineWidth); - const lines = new Array(n); - for (let i = 0, o = 0; i < n; ++i, o += lineWidth) lines[i] = str.substr(o, lineWidth); - str = lines.join(type === Scalar.Scalar.BLOCK_LITERAL ? "\n" : " "); - } - return stringifyString.stringifyString({ - comment, - type, - value: str - }, ctx, onComment, onChompKeep); - } - }; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/pairs.js -var require_pairs = /* @__PURE__ */ __commonJSMin(((exports) => { - var identity = require_identity(); - var Pair = require_Pair(); - var Scalar = require_Scalar(); - var YAMLSeq = require_YAMLSeq(); - function resolvePairs(seq, onError) { - if (identity.isSeq(seq)) for (let i = 0; i < seq.items.length; ++i) { - let item = seq.items[i]; - if (identity.isPair(item)) continue; - else if (identity.isMap(item)) { - if (item.items.length > 1) onError("Each pair must have its own sequence indicator"); - const pair = item.items[0] || new Pair.Pair(new Scalar.Scalar(null)); - if (item.commentBefore) pair.key.commentBefore = pair.key.commentBefore ? `${item.commentBefore}\n${pair.key.commentBefore}` : item.commentBefore; - if (item.comment) { - const cn = pair.value ?? pair.key; - cn.comment = cn.comment ? `${item.comment}\n${cn.comment}` : item.comment; - } - item = pair; - } - seq.items[i] = identity.isPair(item) ? item : new Pair.Pair(item); - } - else onError("Expected a sequence for this tag"); - return seq; - } - function createPairs(schema, iterable, ctx) { - const { replacer } = ctx; - const pairs = new YAMLSeq.YAMLSeq(schema); - pairs.tag = "tag:yaml.org,2002:pairs"; - let i = 0; - if (iterable && Symbol.iterator in Object(iterable)) for (let it of iterable) { - if (typeof replacer === "function") it = replacer.call(iterable, String(i++), it); - let key, value; - if (Array.isArray(it)) if (it.length === 2) { - key = it[0]; - value = it[1]; - } else throw new TypeError(`Expected [key, value] tuple: ${it}`); - else if (it && it instanceof Object) { - const keys = Object.keys(it); - if (keys.length === 1) { - key = keys[0]; - value = it[key]; - } else throw new TypeError(`Expected tuple with one key, not ${keys.length} keys`); - } else key = it; - pairs.items.push(Pair.createPair(key, value, ctx)); - } - return pairs; - } - const pairs = { - collection: "seq", - default: false, - tag: "tag:yaml.org,2002:pairs", - resolve: resolvePairs, - createNode: createPairs - }; - exports.createPairs = createPairs; - exports.pairs = pairs; - exports.resolvePairs = resolvePairs; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/omap.js -var require_omap = /* @__PURE__ */ __commonJSMin(((exports) => { - var identity = require_identity(); - var toJS = require_toJS(); - var YAMLMap = require_YAMLMap(); - var YAMLSeq = require_YAMLSeq(); - var pairs = require_pairs(); - var YAMLOMap = class YAMLOMap extends YAMLSeq.YAMLSeq { - constructor() { - super(); - this.add = YAMLMap.YAMLMap.prototype.add.bind(this); - this.delete = YAMLMap.YAMLMap.prototype.delete.bind(this); - this.get = YAMLMap.YAMLMap.prototype.get.bind(this); - this.has = YAMLMap.YAMLMap.prototype.has.bind(this); - this.set = YAMLMap.YAMLMap.prototype.set.bind(this); - this.tag = YAMLOMap.tag; - } - /** - * If `ctx` is given, the return type is actually `Map`, - * but TypeScript won't allow widening the signature of a child method. - */ - toJSON(_, ctx) { - if (!ctx) return super.toJSON(_); - const map = /* @__PURE__ */ new Map(); - if (ctx?.onCreate) ctx.onCreate(map); - for (const pair of this.items) { - let key, value; - if (identity.isPair(pair)) { - key = toJS.toJS(pair.key, "", ctx); - value = toJS.toJS(pair.value, key, ctx); - } else key = toJS.toJS(pair, "", ctx); - if (map.has(key)) throw new Error("Ordered maps must not include duplicate keys"); - map.set(key, value); - } - return map; - } - static from(schema, iterable, ctx) { - const pairs$1 = pairs.createPairs(schema, iterable, ctx); - const omap = new this(); - omap.items = pairs$1.items; - return omap; - } - }; - YAMLOMap.tag = "tag:yaml.org,2002:omap"; - const omap = { - collection: "seq", - identify: (value) => value instanceof Map, - nodeClass: YAMLOMap, - default: false, - tag: "tag:yaml.org,2002:omap", - resolve(seq, onError) { - const pairs$1 = pairs.resolvePairs(seq, onError); - const seenKeys = []; - for (const { key } of pairs$1.items) if (identity.isScalar(key)) if (seenKeys.includes(key.value)) onError(`Ordered maps must not include duplicate keys: ${key.value}`); - else seenKeys.push(key.value); - return Object.assign(new YAMLOMap(), pairs$1); - }, - createNode: (schema, iterable, ctx) => YAMLOMap.from(schema, iterable, ctx) - }; - exports.YAMLOMap = YAMLOMap; - exports.omap = omap; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/bool.js -var require_bool = /* @__PURE__ */ __commonJSMin(((exports) => { - var Scalar = require_Scalar(); - function boolStringify({ value, source }, ctx) { - if (source && (value ? trueTag : falseTag).test.test(source)) return source; - return value ? ctx.options.trueStr : ctx.options.falseStr; - } - const trueTag = { - identify: (value) => value === true, - default: true, - tag: "tag:yaml.org,2002:bool", - test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/, - resolve: () => new Scalar.Scalar(true), - stringify: boolStringify - }; - const falseTag = { - identify: (value) => value === false, - default: true, - tag: "tag:yaml.org,2002:bool", - test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/, - resolve: () => new Scalar.Scalar(false), - stringify: boolStringify - }; - exports.falseTag = falseTag; - exports.trueTag = trueTag; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/float.js -var require_float = /* @__PURE__ */ __commonJSMin(((exports) => { - var Scalar = require_Scalar(); - var stringifyNumber = require_stringifyNumber(); - const floatNaN = { - identify: (value) => typeof value === "number", - default: true, - tag: "tag:yaml.org,2002:float", - test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/, - resolve: (str) => str.slice(-3).toLowerCase() === "nan" ? NaN : str[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY, - stringify: stringifyNumber.stringifyNumber - }; - const floatExp = { - identify: (value) => typeof value === "number", - default: true, - tag: "tag:yaml.org,2002:float", - format: "EXP", - test: /^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/, - resolve: (str) => parseFloat(str.replace(/_/g, "")), - stringify(node) { - const num = Number(node.value); - return isFinite(num) ? num.toExponential() : stringifyNumber.stringifyNumber(node); - } - }; - exports.float = { - identify: (value) => typeof value === "number", - default: true, - tag: "tag:yaml.org,2002:float", - test: /^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/, - resolve(str) { - const node = new Scalar.Scalar(parseFloat(str.replace(/_/g, ""))); - const dot = str.indexOf("."); - if (dot !== -1) { - const f = str.substring(dot + 1).replace(/_/g, ""); - if (f[f.length - 1] === "0") node.minFractionDigits = f.length; - } - return node; - }, - stringify: stringifyNumber.stringifyNumber - }; - exports.floatExp = floatExp; - exports.floatNaN = floatNaN; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/int.js -var require_int = /* @__PURE__ */ __commonJSMin(((exports) => { - var stringifyNumber = require_stringifyNumber(); - const intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value); - function intResolve(str, offset, radix, { intAsBigInt }) { - const sign = str[0]; - if (sign === "-" || sign === "+") offset += 1; - str = str.substring(offset).replace(/_/g, ""); - if (intAsBigInt) { - switch (radix) { - case 2: - str = `0b${str}`; - break; - case 8: - str = `0o${str}`; - break; - case 16: - str = `0x${str}`; - break; - } - const n = BigInt(str); - return sign === "-" ? BigInt(-1) * n : n; - } - const n = parseInt(str, radix); - return sign === "-" ? -1 * n : n; - } - function intStringify(node, radix, prefix) { - const { value } = node; - if (intIdentify(value)) { - const str = value.toString(radix); - return value < 0 ? "-" + prefix + str.substr(1) : prefix + str; - } - return stringifyNumber.stringifyNumber(node); - } - const intBin = { - identify: intIdentify, - default: true, - tag: "tag:yaml.org,2002:int", - format: "BIN", - test: /^[-+]?0b[0-1_]+$/, - resolve: (str, _onError, opt) => intResolve(str, 2, 2, opt), - stringify: (node) => intStringify(node, 2, "0b") - }; - const intOct = { - identify: intIdentify, - default: true, - tag: "tag:yaml.org,2002:int", - format: "OCT", - test: /^[-+]?0[0-7_]+$/, - resolve: (str, _onError, opt) => intResolve(str, 1, 8, opt), - stringify: (node) => intStringify(node, 8, "0") - }; - const int = { - identify: intIdentify, - default: true, - tag: "tag:yaml.org,2002:int", - test: /^[-+]?[0-9][0-9_]*$/, - resolve: (str, _onError, opt) => intResolve(str, 0, 10, opt), - stringify: stringifyNumber.stringifyNumber - }; - const intHex = { - identify: intIdentify, - default: true, - tag: "tag:yaml.org,2002:int", - format: "HEX", - test: /^[-+]?0x[0-9a-fA-F_]+$/, - resolve: (str, _onError, opt) => intResolve(str, 2, 16, opt), - stringify: (node) => intStringify(node, 16, "0x") - }; - exports.int = int; - exports.intBin = intBin; - exports.intHex = intHex; - exports.intOct = intOct; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/set.js -var require_set = /* @__PURE__ */ __commonJSMin(((exports) => { - var identity = require_identity(); - var Pair = require_Pair(); - var YAMLMap = require_YAMLMap(); - var YAMLSet = class YAMLSet extends YAMLMap.YAMLMap { - constructor(schema) { - super(schema); - this.tag = YAMLSet.tag; - } - add(key) { - let pair; - if (identity.isPair(key)) pair = key; - else if (key && typeof key === "object" && "key" in key && "value" in key && key.value === null) pair = new Pair.Pair(key.key, null); - else pair = new Pair.Pair(key, null); - if (!YAMLMap.findPair(this.items, pair.key)) this.items.push(pair); - } - /** - * If `keepPair` is `true`, returns the Pair matching `key`. - * Otherwise, returns the value of that Pair's key. - */ - get(key, keepPair) { - const pair = YAMLMap.findPair(this.items, key); - return !keepPair && identity.isPair(pair) ? identity.isScalar(pair.key) ? pair.key.value : pair.key : pair; - } - set(key, value) { - if (typeof value !== "boolean") throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof value}`); - const prev = YAMLMap.findPair(this.items, key); - if (prev && !value) this.items.splice(this.items.indexOf(prev), 1); - else if (!prev && value) this.items.push(new Pair.Pair(key)); - } - toJSON(_, ctx) { - return super.toJSON(_, ctx, Set); - } - toString(ctx, onComment, onChompKeep) { - if (!ctx) return JSON.stringify(this); - if (this.hasAllNullValues(true)) return super.toString(Object.assign({}, ctx, { allNullValues: true }), onComment, onChompKeep); - else throw new Error("Set items must all have null values"); - } - static from(schema, iterable, ctx) { - const { replacer } = ctx; - const set = new this(schema); - if (iterable && Symbol.iterator in Object(iterable)) for (let value of iterable) { - if (typeof replacer === "function") value = replacer.call(iterable, value, value); - set.items.push(Pair.createPair(value, null, ctx)); - } - return set; - } - }; - YAMLSet.tag = "tag:yaml.org,2002:set"; - const set = { - collection: "map", - identify: (value) => value instanceof Set, - nodeClass: YAMLSet, - default: false, - tag: "tag:yaml.org,2002:set", - createNode: (schema, iterable, ctx) => YAMLSet.from(schema, iterable, ctx), - resolve(map, onError) { - if (identity.isMap(map)) if (map.hasAllNullValues(true)) return Object.assign(new YAMLSet(), map); - else onError("Set items must all have null values"); - else onError("Expected a mapping for this tag"); - return map; - } - }; - exports.YAMLSet = YAMLSet; - exports.set = set; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js -var require_timestamp = /* @__PURE__ */ __commonJSMin(((exports) => { - var stringifyNumber = require_stringifyNumber(); - /** Internal types handle bigint as number, because TS can't figure it out. */ - function parseSexagesimal(str, asBigInt) { - const sign = str[0]; - const parts = sign === "-" || sign === "+" ? str.substring(1) : str; - const num = (n) => asBigInt ? BigInt(n) : Number(n); - const res = parts.replace(/_/g, "").split(":").reduce((res, p) => res * num(60) + num(p), num(0)); - return sign === "-" ? num(-1) * res : res; - } - /** - * hhhh:mm:ss.sss - * - * Internal types handle bigint as number, because TS can't figure it out. - */ - function stringifySexagesimal(node) { - let { value } = node; - let num = (n) => n; - if (typeof value === "bigint") num = (n) => BigInt(n); - else if (isNaN(value) || !isFinite(value)) return stringifyNumber.stringifyNumber(node); - let sign = ""; - if (value < 0) { - sign = "-"; - value *= num(-1); - } - const _60 = num(60); - const parts = [value % _60]; - if (value < 60) parts.unshift(0); - else { - value = (value - parts[0]) / _60; - parts.unshift(value % _60); - if (value >= 60) { - value = (value - parts[0]) / _60; - parts.unshift(value); - } - } - return sign + parts.map((n) => String(n).padStart(2, "0")).join(":").replace(/000000\d*$/, ""); - } - const intTime = { - identify: (value) => typeof value === "bigint" || Number.isInteger(value), - default: true, - tag: "tag:yaml.org,2002:int", - format: "TIME", - test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/, - resolve: (str, _onError, { intAsBigInt }) => parseSexagesimal(str, intAsBigInt), - stringify: stringifySexagesimal - }; - const floatTime = { - identify: (value) => typeof value === "number", - default: true, - tag: "tag:yaml.org,2002:float", - format: "TIME", - test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/, - resolve: (str) => parseSexagesimal(str, false), - stringify: stringifySexagesimal - }; - const timestamp = { - identify: (value) => value instanceof Date, - default: true, - tag: "tag:yaml.org,2002:timestamp", - test: RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"), - resolve(str) { - const match = str.match(timestamp.test); - if (!match) throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd"); - const [, year, month, day, hour, minute, second] = match.map(Number); - const millisec = match[7] ? Number((match[7] + "00").substr(1, 3)) : 0; - let date = Date.UTC(year, month - 1, day, hour || 0, minute || 0, second || 0, millisec); - const tz = match[8]; - if (tz && tz !== "Z") { - let d = parseSexagesimal(tz, false); - if (Math.abs(d) < 30) d *= 60; - date -= 6e4 * d; - } - return new Date(date); - }, - stringify: ({ value }) => value?.toISOString().replace(/(T00:00:00)?\.000Z$/, "") ?? "" - }; - exports.floatTime = floatTime; - exports.intTime = intTime; - exports.timestamp = timestamp; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/schema.js -var require_schema = /* @__PURE__ */ __commonJSMin(((exports) => { - var map = require_map(); - var _null = require_null(); - var seq = require_seq(); - var string = require_string(); - var binary = require_binary(); - var bool = require_bool(); - var float = require_float(); - var int = require_int(); - var merge = require_merge(); - var omap = require_omap(); - var pairs = require_pairs(); - var set = require_set(); - var timestamp = require_timestamp(); - exports.schema = [ - map.map, - seq.seq, - string.string, - _null.nullTag, - bool.trueTag, - bool.falseTag, - int.intBin, - int.intOct, - int.int, - int.intHex, - float.floatNaN, - float.floatExp, - float.float, - binary.binary, - merge.merge, - omap.omap, - pairs.pairs, - set.set, - timestamp.intTime, - timestamp.floatTime, - timestamp.timestamp - ]; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/tags.js -var require_tags = /* @__PURE__ */ __commonJSMin(((exports) => { - var map = require_map(); - var _null = require_null(); - var seq = require_seq(); - var string = require_string(); - var bool = require_bool$1(); - var float = require_float$1(); - var int = require_int$1(); - var schema = require_schema$2(); - var schema$1 = require_schema$1(); - var binary = require_binary(); - var merge = require_merge(); - var omap = require_omap(); - var pairs = require_pairs(); - var schema$2 = require_schema(); - var set = require_set(); - var timestamp = require_timestamp(); - const schemas = new Map([ - ["core", schema.schema], - ["failsafe", [ - map.map, - seq.seq, - string.string - ]], - ["json", schema$1.schema], - ["yaml11", schema$2.schema], - ["yaml-1.1", schema$2.schema] - ]); - const tagsByName = { - binary: binary.binary, - bool: bool.boolTag, - float: float.float, - floatExp: float.floatExp, - floatNaN: float.floatNaN, - floatTime: timestamp.floatTime, - int: int.int, - intHex: int.intHex, - intOct: int.intOct, - intTime: timestamp.intTime, - map: map.map, - merge: merge.merge, - null: _null.nullTag, - omap: omap.omap, - pairs: pairs.pairs, - seq: seq.seq, - set: set.set, - timestamp: timestamp.timestamp - }; - const coreKnownTags = { - "tag:yaml.org,2002:binary": binary.binary, - "tag:yaml.org,2002:merge": merge.merge, - "tag:yaml.org,2002:omap": omap.omap, - "tag:yaml.org,2002:pairs": pairs.pairs, - "tag:yaml.org,2002:set": set.set, - "tag:yaml.org,2002:timestamp": timestamp.timestamp - }; - function getTags(customTags, schemaName, addMergeTag) { - const schemaTags = schemas.get(schemaName); - if (schemaTags && !customTags) return addMergeTag && !schemaTags.includes(merge.merge) ? schemaTags.concat(merge.merge) : schemaTags.slice(); - let tags = schemaTags; - if (!tags) if (Array.isArray(customTags)) tags = []; - else { - const keys = Array.from(schemas.keys()).filter((key) => key !== "yaml11").map((key) => JSON.stringify(key)).join(", "); - throw new Error(`Unknown schema "${schemaName}"; use one of ${keys} or define customTags array`); - } - if (Array.isArray(customTags)) for (const tag of customTags) tags = tags.concat(tag); - else if (typeof customTags === "function") tags = customTags(tags.slice()); - if (addMergeTag) tags = tags.concat(merge.merge); - return tags.reduce((tags, tag) => { - const tagObj = typeof tag === "string" ? tagsByName[tag] : tag; - if (!tagObj) { - const tagName = JSON.stringify(tag); - const keys = Object.keys(tagsByName).map((key) => JSON.stringify(key)).join(", "); - throw new Error(`Unknown custom tag ${tagName}; use one of ${keys}`); - } - if (!tags.includes(tagObj)) tags.push(tagObj); - return tags; - }, []); - } - exports.coreKnownTags = coreKnownTags; - exports.getTags = getTags; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/Schema.js -var require_Schema = /* @__PURE__ */ __commonJSMin(((exports) => { - var identity = require_identity(); - var map = require_map(); - var seq = require_seq(); - var string = require_string(); - var tags = require_tags(); - const sortMapEntriesByKey = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0; - exports.Schema = class Schema { - constructor({ compat, customTags, merge, resolveKnownTags, schema, sortMapEntries, toStringDefaults }) { - this.compat = Array.isArray(compat) ? tags.getTags(compat, "compat") : compat ? tags.getTags(null, compat) : null; - this.name = typeof schema === "string" && schema || "core"; - this.knownTags = resolveKnownTags ? tags.coreKnownTags : {}; - this.tags = tags.getTags(customTags, this.name, merge); - this.toStringOptions = toStringDefaults ?? null; - Object.defineProperty(this, identity.MAP, { value: map.map }); - Object.defineProperty(this, identity.SCALAR, { value: string.string }); - Object.defineProperty(this, identity.SEQ, { value: seq.seq }); - this.sortMapEntries = typeof sortMapEntries === "function" ? sortMapEntries : sortMapEntries === true ? sortMapEntriesByKey : null; - } - clone() { - const copy = Object.create(Schema.prototype, Object.getOwnPropertyDescriptors(this)); - copy.tags = this.tags.slice(); - return copy; - } - }; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyDocument.js -var require_stringifyDocument = /* @__PURE__ */ __commonJSMin(((exports) => { - var identity = require_identity(); - var stringify = require_stringify(); - var stringifyComment = require_stringifyComment(); - function stringifyDocument(doc, options) { - const lines = []; - let hasDirectives = options.directives === true; - if (options.directives !== false && doc.directives) { - const dir = doc.directives.toString(doc); - if (dir) { - lines.push(dir); - hasDirectives = true; - } else if (doc.directives.docStart) hasDirectives = true; - } - if (hasDirectives) lines.push("---"); - const ctx = stringify.createStringifyContext(doc, options); - const { commentString } = ctx.options; - if (doc.commentBefore) { - if (lines.length !== 1) lines.unshift(""); - const cs = commentString(doc.commentBefore); - lines.unshift(stringifyComment.indentComment(cs, "")); - } - let chompKeep = false; - let contentComment = null; - if (doc.contents) { - if (identity.isNode(doc.contents)) { - if (doc.contents.spaceBefore && hasDirectives) lines.push(""); - if (doc.contents.commentBefore) { - const cs = commentString(doc.contents.commentBefore); - lines.push(stringifyComment.indentComment(cs, "")); - } - ctx.forceBlockIndent = !!doc.comment; - contentComment = doc.contents.comment; - } - const onChompKeep = contentComment ? void 0 : () => chompKeep = true; - let body = stringify.stringify(doc.contents, ctx, () => contentComment = null, onChompKeep); - if (contentComment) body += stringifyComment.lineComment(body, "", commentString(contentComment)); - if ((body[0] === "|" || body[0] === ">") && lines[lines.length - 1] === "---") lines[lines.length - 1] = `--- ${body}`; - else lines.push(body); - } else lines.push(stringify.stringify(doc.contents, ctx)); - if (doc.directives?.docEnd) if (doc.comment) { - const cs = commentString(doc.comment); - if (cs.includes("\n")) { - lines.push("..."); - lines.push(stringifyComment.indentComment(cs, "")); - } else lines.push(`... ${cs}`); - } else lines.push("..."); - else { - let dc = doc.comment; - if (dc && chompKeep) dc = dc.replace(/^\n+/, ""); - if (dc) { - if ((!chompKeep || contentComment) && lines[lines.length - 1] !== "") lines.push(""); - lines.push(stringifyComment.indentComment(commentString(dc), "")); - } - } - return lines.join("\n") + "\n"; - } - exports.stringifyDocument = stringifyDocument; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/Document.js -var require_Document = /* @__PURE__ */ __commonJSMin(((exports) => { - var Alias = require_Alias(); - var Collection = require_Collection(); - var identity = require_identity(); - var Pair = require_Pair(); - var toJS = require_toJS(); - var Schema = require_Schema(); - var stringifyDocument = require_stringifyDocument(); - var anchors = require_anchors(); - var applyReviver = require_applyReviver(); - var createNode = require_createNode(); - var directives = require_directives(); - var Document = class Document { - constructor(value, replacer, options) { - /** A comment before this Document */ - this.commentBefore = null; - /** A comment immediately after this Document */ - this.comment = null; - /** Errors encountered during parsing. */ - this.errors = []; - /** Warnings encountered during parsing. */ - this.warnings = []; - Object.defineProperty(this, identity.NODE_TYPE, { value: identity.DOC }); - let _replacer = null; - if (typeof replacer === "function" || Array.isArray(replacer)) _replacer = replacer; - else if (options === void 0 && replacer) { - options = replacer; - replacer = void 0; - } - const opt = Object.assign({ - intAsBigInt: false, - keepSourceTokens: false, - logLevel: "warn", - prettyErrors: true, - strict: true, - stringKeys: false, - uniqueKeys: true, - version: "1.2" - }, options); - this.options = opt; - let { version } = opt; - if (options?._directives) { - this.directives = options._directives.atDocument(); - if (this.directives.yaml.explicit) version = this.directives.yaml.version; - } else this.directives = new directives.Directives({ version }); - this.setSchema(version, options); - this.contents = value === void 0 ? null : this.createNode(value, _replacer, options); - } - /** - * Create a deep copy of this Document and its contents. - * - * Custom Node values that inherit from `Object` still refer to their original instances. - */ - clone() { - const copy = Object.create(Document.prototype, { [identity.NODE_TYPE]: { value: identity.DOC } }); - copy.commentBefore = this.commentBefore; - copy.comment = this.comment; - copy.errors = this.errors.slice(); - copy.warnings = this.warnings.slice(); - copy.options = Object.assign({}, this.options); - if (this.directives) copy.directives = this.directives.clone(); - copy.schema = this.schema.clone(); - copy.contents = identity.isNode(this.contents) ? this.contents.clone(copy.schema) : this.contents; - if (this.range) copy.range = this.range.slice(); - return copy; - } - /** Adds a value to the document. */ - add(value) { - if (assertCollection(this.contents)) this.contents.add(value); - } - /** Adds a value to the document. */ - addIn(path, value) { - if (assertCollection(this.contents)) this.contents.addIn(path, value); - } - /** - * Create a new `Alias` node, ensuring that the target `node` has the required anchor. - * - * If `node` already has an anchor, `name` is ignored. - * Otherwise, the `node.anchor` value will be set to `name`, - * or if an anchor with that name is already present in the document, - * `name` will be used as a prefix for a new unique anchor. - * If `name` is undefined, the generated anchor will use 'a' as a prefix. - */ - createAlias(node, name) { - if (!node.anchor) { - const prev = anchors.anchorNames(this); - node.anchor = !name || prev.has(name) ? anchors.findNewAnchor(name || "a", prev) : name; - } - return new Alias.Alias(node.anchor); - } - createNode(value, replacer, options) { - let _replacer = void 0; - if (typeof replacer === "function") { - value = replacer.call({ "": value }, "", value); - _replacer = replacer; - } else if (Array.isArray(replacer)) { - const keyToStr = (v) => typeof v === "number" || v instanceof String || v instanceof Number; - const asStr = replacer.filter(keyToStr).map(String); - if (asStr.length > 0) replacer = replacer.concat(asStr); - _replacer = replacer; - } else if (options === void 0 && replacer) { - options = replacer; - replacer = void 0; - } - const { aliasDuplicateObjects, anchorPrefix, flow, keepUndefined, onTagObj, tag } = options ?? {}; - const { onAnchor, setAnchors, sourceObjects } = anchors.createNodeAnchors(this, anchorPrefix || "a"); - const ctx = { - aliasDuplicateObjects: aliasDuplicateObjects ?? true, - keepUndefined: keepUndefined ?? false, - onAnchor, - onTagObj, - replacer: _replacer, - schema: this.schema, - sourceObjects - }; - const node = createNode.createNode(value, tag, ctx); - if (flow && identity.isCollection(node)) node.flow = true; - setAnchors(); - return node; - } - /** - * Convert a key and a value into a `Pair` using the current schema, - * recursively wrapping all values as `Scalar` or `Collection` nodes. - */ - createPair(key, value, options = {}) { - const k = this.createNode(key, null, options); - const v = this.createNode(value, null, options); - return new Pair.Pair(k, v); - } - /** - * Removes a value from the document. - * @returns `true` if the item was found and removed. - */ - delete(key) { - return assertCollection(this.contents) ? this.contents.delete(key) : false; - } - /** - * Removes a value from the document. - * @returns `true` if the item was found and removed. - */ - deleteIn(path) { - if (Collection.isEmptyPath(path)) { - if (this.contents == null) return false; - this.contents = null; - return true; - } - return assertCollection(this.contents) ? this.contents.deleteIn(path) : false; - } - /** - * Returns item at `key`, or `undefined` if not found. By default unwraps - * scalar values from their surrounding node; to disable set `keepScalar` to - * `true` (collections are always returned intact). - */ - get(key, keepScalar) { - return identity.isCollection(this.contents) ? this.contents.get(key, keepScalar) : void 0; - } - /** - * Returns item at `path`, or `undefined` if not found. By default unwraps - * scalar values from their surrounding node; to disable set `keepScalar` to - * `true` (collections are always returned intact). - */ - getIn(path, keepScalar) { - if (Collection.isEmptyPath(path)) return !keepScalar && identity.isScalar(this.contents) ? this.contents.value : this.contents; - return identity.isCollection(this.contents) ? this.contents.getIn(path, keepScalar) : void 0; - } - /** - * Checks if the document includes a value with the key `key`. - */ - has(key) { - return identity.isCollection(this.contents) ? this.contents.has(key) : false; - } - /** - * Checks if the document includes a value at `path`. - */ - hasIn(path) { - if (Collection.isEmptyPath(path)) return this.contents !== void 0; - return identity.isCollection(this.contents) ? this.contents.hasIn(path) : false; - } - /** - * Sets a value in this document. For `!!set`, `value` needs to be a - * boolean to add/remove the item from the set. - */ - set(key, value) { - if (this.contents == null) this.contents = Collection.collectionFromPath(this.schema, [key], value); - else if (assertCollection(this.contents)) this.contents.set(key, value); - } - /** - * Sets a value in this document. For `!!set`, `value` needs to be a - * boolean to add/remove the item from the set. - */ - setIn(path, value) { - if (Collection.isEmptyPath(path)) this.contents = value; - else if (this.contents == null) this.contents = Collection.collectionFromPath(this.schema, Array.from(path), value); - else if (assertCollection(this.contents)) this.contents.setIn(path, value); - } - /** - * Change the YAML version and schema used by the document. - * A `null` version disables support for directives, explicit tags, anchors, and aliases. - * It also requires the `schema` option to be given as a `Schema` instance value. - * - * Overrides all previously set schema options. - */ - setSchema(version, options = {}) { - if (typeof version === "number") version = String(version); - let opt; - switch (version) { - case "1.1": - if (this.directives) this.directives.yaml.version = "1.1"; - else this.directives = new directives.Directives({ version: "1.1" }); - opt = { - resolveKnownTags: false, - schema: "yaml-1.1" - }; - break; - case "1.2": - case "next": - if (this.directives) this.directives.yaml.version = version; - else this.directives = new directives.Directives({ version }); - opt = { - resolveKnownTags: true, - schema: "core" - }; - break; - case null: - if (this.directives) delete this.directives; - opt = null; - break; - default: { - const sv = JSON.stringify(version); - throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${sv}`); - } - } - if (options.schema instanceof Object) this.schema = options.schema; - else if (opt) this.schema = new Schema.Schema(Object.assign(opt, options)); - else throw new Error(`With a null YAML version, the { schema: Schema } option is required`); - } - toJS({ json, jsonArg, mapAsMap, maxAliasCount, onAnchor, reviver } = {}) { - const ctx = { - anchors: /* @__PURE__ */ new Map(), - doc: this, - keep: !json, - mapAsMap: mapAsMap === true, - mapKeyWarned: false, - maxAliasCount: typeof maxAliasCount === "number" ? maxAliasCount : 100 - }; - const res = toJS.toJS(this.contents, jsonArg ?? "", ctx); - if (typeof onAnchor === "function") for (const { count, res } of ctx.anchors.values()) onAnchor(res, count); - return typeof reviver === "function" ? applyReviver.applyReviver(reviver, { "": res }, "", res) : res; - } - /** - * A JSON representation of the document `contents`. - * - * @param jsonArg Used by `JSON.stringify` to indicate the array index or - * property name. - */ - toJSON(jsonArg, onAnchor) { - return this.toJS({ - json: true, - jsonArg, - mapAsMap: false, - onAnchor - }); - } - /** A YAML representation of the document. */ - toString(options = {}) { - if (this.errors.length > 0) throw new Error("Document with errors cannot be stringified"); - if ("indent" in options && (!Number.isInteger(options.indent) || Number(options.indent) <= 0)) { - const s = JSON.stringify(options.indent); - throw new Error(`"indent" option must be a positive integer, not ${s}`); - } - return stringifyDocument.stringifyDocument(this, options); - } - }; - function assertCollection(contents) { - if (identity.isCollection(contents)) return true; - throw new Error("Expected a YAML collection as document contents"); - } - exports.Document = Document; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/errors.js -var require_errors = /* @__PURE__ */ __commonJSMin(((exports) => { - var YAMLError = class extends Error { - constructor(name, pos, code, message) { - super(); - this.name = name; - this.code = code; - this.message = message; - this.pos = pos; - } - }; - var YAMLParseError = class extends YAMLError { - constructor(pos, code, message) { - super("YAMLParseError", pos, code, message); - } - }; - var YAMLWarning = class extends YAMLError { - constructor(pos, code, message) { - super("YAMLWarning", pos, code, message); - } - }; - const prettifyError = (src, lc) => (error) => { - if (error.pos[0] === -1) return; - error.linePos = error.pos.map((pos) => lc.linePos(pos)); - const { line, col } = error.linePos[0]; - error.message += ` at line ${line}, column ${col}`; - let ci = col - 1; - let lineStr = src.substring(lc.lineStarts[line - 1], lc.lineStarts[line]).replace(/[\n\r]+$/, ""); - if (ci >= 60 && lineStr.length > 80) { - const trimStart = Math.min(ci - 39, lineStr.length - 79); - lineStr = "…" + lineStr.substring(trimStart); - ci -= trimStart - 1; - } - if (lineStr.length > 80) lineStr = lineStr.substring(0, 79) + "…"; - if (line > 1 && /^ *$/.test(lineStr.substring(0, ci))) { - let prev = src.substring(lc.lineStarts[line - 2], lc.lineStarts[line - 1]); - if (prev.length > 80) prev = prev.substring(0, 79) + "…\n"; - lineStr = prev + lineStr; - } - if (/[^ ]/.test(lineStr)) { - let count = 1; - const end = error.linePos[1]; - if (end?.line === line && end.col > col) count = Math.max(1, Math.min(end.col - col, 80 - ci)); - const pointer = " ".repeat(ci) + "^".repeat(count); - error.message += `:\n\n${lineStr}\n${pointer}\n`; - } - }; - exports.YAMLError = YAMLError; - exports.YAMLParseError = YAMLParseError; - exports.YAMLWarning = YAMLWarning; - exports.prettifyError = prettifyError; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-props.js -var require_resolve_props = /* @__PURE__ */ __commonJSMin(((exports) => { - function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIndent, startOnNewline }) { - let spaceBefore = false; - let atNewline = startOnNewline; - let hasSpace = startOnNewline; - let comment = ""; - let commentSep = ""; - let hasNewline = false; - let reqSpace = false; - let tab = null; - let anchor = null; - let tag = null; - let newlineAfterProp = null; - let comma = null; - let found = null; - let start = null; - for (const token of tokens) { - if (reqSpace) { - if (token.type !== "space" && token.type !== "newline" && token.type !== "comma") onError(token.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space"); - reqSpace = false; - } - if (tab) { - if (atNewline && token.type !== "comment" && token.type !== "newline") onError(tab, "TAB_AS_INDENT", "Tabs are not allowed as indentation"); - tab = null; - } - switch (token.type) { - case "space": - if (!flow && (indicator !== "doc-start" || next?.type !== "flow-collection") && token.source.includes(" ")) tab = token; - hasSpace = true; - break; - case "comment": { - if (!hasSpace) onError(token, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters"); - const cb = token.source.substring(1) || " "; - if (!comment) comment = cb; - else comment += commentSep + cb; - commentSep = ""; - atNewline = false; - break; - } - case "newline": - if (atNewline) { - if (comment) comment += token.source; - else if (!found || indicator !== "seq-item-ind") spaceBefore = true; - } else commentSep += token.source; - atNewline = true; - hasNewline = true; - if (anchor || tag) newlineAfterProp = token; - hasSpace = true; - break; - case "anchor": - if (anchor) onError(token, "MULTIPLE_ANCHORS", "A node can have at most one anchor"); - if (token.source.endsWith(":")) onError(token.offset + token.source.length - 1, "BAD_ALIAS", "Anchor ending in : is ambiguous", true); - anchor = token; - start ?? (start = token.offset); - atNewline = false; - hasSpace = false; - reqSpace = true; - break; - case "tag": - if (tag) onError(token, "MULTIPLE_TAGS", "A node can have at most one tag"); - tag = token; - start ?? (start = token.offset); - atNewline = false; - hasSpace = false; - reqSpace = true; - break; - case indicator: - if (anchor || tag) onError(token, "BAD_PROP_ORDER", `Anchors and tags must be after the ${token.source} indicator`); - if (found) onError(token, "UNEXPECTED_TOKEN", `Unexpected ${token.source} in ${flow ?? "collection"}`); - found = token; - atNewline = indicator === "seq-item-ind" || indicator === "explicit-key-ind"; - hasSpace = false; - break; - case "comma": if (flow) { - if (comma) onError(token, "UNEXPECTED_TOKEN", `Unexpected , in ${flow}`); - comma = token; - atNewline = false; - hasSpace = false; - break; - } - default: - onError(token, "UNEXPECTED_TOKEN", `Unexpected ${token.type} token`); - atNewline = false; - hasSpace = false; - } - } - const last = tokens[tokens.length - 1]; - const end = last ? last.offset + last.source.length : offset; - if (reqSpace && next && next.type !== "space" && next.type !== "newline" && next.type !== "comma" && (next.type !== "scalar" || next.source !== "")) onError(next.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space"); - if (tab && (atNewline && tab.indent <= parentIndent || next?.type === "block-map" || next?.type === "block-seq")) onError(tab, "TAB_AS_INDENT", "Tabs are not allowed as indentation"); - return { - comma, - found, - spaceBefore, - comment, - hasNewline, - anchor, - tag, - newlineAfterProp, - end, - start: start ?? end - }; - } - exports.resolveProps = resolveProps; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-contains-newline.js -var require_util_contains_newline = /* @__PURE__ */ __commonJSMin(((exports) => { - function containsNewline(key) { - if (!key) return null; - switch (key.type) { - case "alias": - case "scalar": - case "double-quoted-scalar": - case "single-quoted-scalar": - if (key.source.includes("\n")) return true; - if (key.end) { - for (const st of key.end) if (st.type === "newline") return true; - } - return false; - case "flow-collection": - for (const it of key.items) { - for (const st of it.start) if (st.type === "newline") return true; - if (it.sep) { - for (const st of it.sep) if (st.type === "newline") return true; - } - if (containsNewline(it.key) || containsNewline(it.value)) return true; - } - return false; - default: return true; - } - } - exports.containsNewline = containsNewline; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-flow-indent-check.js -var require_util_flow_indent_check = /* @__PURE__ */ __commonJSMin(((exports) => { - var utilContainsNewline = require_util_contains_newline(); - function flowIndentCheck(indent, fc, onError) { - if (fc?.type === "flow-collection") { - const end = fc.end[0]; - if (end.indent === indent && (end.source === "]" || end.source === "}") && utilContainsNewline.containsNewline(fc)) onError(end, "BAD_INDENT", "Flow end indicator should be more indented than parent", true); - } - } - exports.flowIndentCheck = flowIndentCheck; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-map-includes.js -var require_util_map_includes = /* @__PURE__ */ __commonJSMin(((exports) => { - var identity = require_identity(); - function mapIncludes(ctx, items, search) { - const { uniqueKeys } = ctx.options; - if (uniqueKeys === false) return false; - const isEqual = typeof uniqueKeys === "function" ? uniqueKeys : (a, b) => a === b || identity.isScalar(a) && identity.isScalar(b) && a.value === b.value; - return items.some((pair) => isEqual(pair.key, search)); - } - exports.mapIncludes = mapIncludes; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-block-map.js -var require_resolve_block_map = /* @__PURE__ */ __commonJSMin(((exports) => { - var Pair = require_Pair(); - var YAMLMap = require_YAMLMap(); - var resolveProps = require_resolve_props(); - var utilContainsNewline = require_util_contains_newline(); - var utilFlowIndentCheck = require_util_flow_indent_check(); - var utilMapIncludes = require_util_map_includes(); - const startColMsg = "All mapping items must start at the same column"; - function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError, tag) { - const map = new (tag?.nodeClass ?? YAMLMap.YAMLMap)(ctx.schema); - if (ctx.atRoot) ctx.atRoot = false; - let offset = bm.offset; - let commentEnd = null; - for (const collItem of bm.items) { - const { start, key, sep, value } = collItem; - const keyProps = resolveProps.resolveProps(start, { - indicator: "explicit-key-ind", - next: key ?? sep?.[0], - offset, - onError, - parentIndent: bm.indent, - startOnNewline: true - }); - const implicitKey = !keyProps.found; - if (implicitKey) { - if (key) { - if (key.type === "block-seq") onError(offset, "BLOCK_AS_IMPLICIT_KEY", "A block sequence may not be used as an implicit map key"); - else if ("indent" in key && key.indent !== bm.indent) onError(offset, "BAD_INDENT", startColMsg); - } - if (!keyProps.anchor && !keyProps.tag && !sep) { - commentEnd = keyProps.end; - if (keyProps.comment) if (map.comment) map.comment += "\n" + keyProps.comment; - else map.comment = keyProps.comment; - continue; - } - if (keyProps.newlineAfterProp || utilContainsNewline.containsNewline(key)) onError(key ?? start[start.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line"); - } else if (keyProps.found?.indent !== bm.indent) onError(offset, "BAD_INDENT", startColMsg); - ctx.atKey = true; - const keyStart = keyProps.end; - const keyNode = key ? composeNode(ctx, key, keyProps, onError) : composeEmptyNode(ctx, keyStart, start, null, keyProps, onError); - if (ctx.schema.compat) utilFlowIndentCheck.flowIndentCheck(bm.indent, key, onError); - ctx.atKey = false; - if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode)) onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique"); - const valueProps = resolveProps.resolveProps(sep ?? [], { - indicator: "map-value-ind", - next: value, - offset: keyNode.range[2], - onError, - parentIndent: bm.indent, - startOnNewline: !key || key.type === "block-scalar" - }); - offset = valueProps.end; - if (valueProps.found) { - if (implicitKey) { - if (value?.type === "block-map" && !valueProps.hasNewline) onError(offset, "BLOCK_AS_IMPLICIT_KEY", "Nested mappings are not allowed in compact mappings"); - if (ctx.options.strict && keyProps.start < valueProps.found.offset - 1024) onError(keyNode.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key"); - } - const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset, sep, null, valueProps, onError); - if (ctx.schema.compat) utilFlowIndentCheck.flowIndentCheck(bm.indent, value, onError); - offset = valueNode.range[2]; - const pair = new Pair.Pair(keyNode, valueNode); - if (ctx.options.keepSourceTokens) pair.srcToken = collItem; - map.items.push(pair); - } else { - if (implicitKey) onError(keyNode.range, "MISSING_CHAR", "Implicit map keys need to be followed by map values"); - if (valueProps.comment) if (keyNode.comment) keyNode.comment += "\n" + valueProps.comment; - else keyNode.comment = valueProps.comment; - const pair = new Pair.Pair(keyNode); - if (ctx.options.keepSourceTokens) pair.srcToken = collItem; - map.items.push(pair); - } - } - if (commentEnd && commentEnd < offset) onError(commentEnd, "IMPOSSIBLE", "Map comment with trailing content"); - map.range = [ - bm.offset, - offset, - commentEnd ?? offset - ]; - return map; - } - exports.resolveBlockMap = resolveBlockMap; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-block-seq.js -var require_resolve_block_seq = /* @__PURE__ */ __commonJSMin(((exports) => { - var YAMLSeq = require_YAMLSeq(); - var resolveProps = require_resolve_props(); - var utilFlowIndentCheck = require_util_flow_indent_check(); - function resolveBlockSeq({ composeNode, composeEmptyNode }, ctx, bs, onError, tag) { - const seq = new (tag?.nodeClass ?? YAMLSeq.YAMLSeq)(ctx.schema); - if (ctx.atRoot) ctx.atRoot = false; - if (ctx.atKey) ctx.atKey = false; - let offset = bs.offset; - let commentEnd = null; - for (const { start, value } of bs.items) { - const props = resolveProps.resolveProps(start, { - indicator: "seq-item-ind", - next: value, - offset, - onError, - parentIndent: bs.indent, - startOnNewline: true - }); - if (!props.found) if (props.anchor || props.tag || value) if (value?.type === "block-seq") onError(props.end, "BAD_INDENT", "All sequence items must start at the same column"); - else onError(offset, "MISSING_CHAR", "Sequence item without - indicator"); - else { - commentEnd = props.end; - if (props.comment) seq.comment = props.comment; - continue; - } - const node = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, start, null, props, onError); - if (ctx.schema.compat) utilFlowIndentCheck.flowIndentCheck(bs.indent, value, onError); - offset = node.range[2]; - seq.items.push(node); - } - seq.range = [ - bs.offset, - offset, - commentEnd ?? offset - ]; - return seq; - } - exports.resolveBlockSeq = resolveBlockSeq; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-end.js -var require_resolve_end = /* @__PURE__ */ __commonJSMin(((exports) => { - function resolveEnd(end, offset, reqSpace, onError) { - let comment = ""; - if (end) { - let hasSpace = false; - let sep = ""; - for (const token of end) { - const { source, type } = token; - switch (type) { - case "space": - hasSpace = true; - break; - case "comment": { - if (reqSpace && !hasSpace) onError(token, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters"); - const cb = source.substring(1) || " "; - if (!comment) comment = cb; - else comment += sep + cb; - sep = ""; - break; - } - case "newline": - if (comment) sep += source; - hasSpace = true; - break; - default: onError(token, "UNEXPECTED_TOKEN", `Unexpected ${type} at node end`); - } - offset += source.length; - } - } - return { - comment, - offset - }; - } - exports.resolveEnd = resolveEnd; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-flow-collection.js -var require_resolve_flow_collection = /* @__PURE__ */ __commonJSMin(((exports) => { - var identity = require_identity(); - var Pair = require_Pair(); - var YAMLMap = require_YAMLMap(); - var YAMLSeq = require_YAMLSeq(); - var resolveEnd = require_resolve_end(); - var resolveProps = require_resolve_props(); - var utilContainsNewline = require_util_contains_newline(); - var utilMapIncludes = require_util_map_includes(); - const blockMsg = "Block collections are not allowed within flow collections"; - const isBlock = (token) => token && (token.type === "block-map" || token.type === "block-seq"); - function resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onError, tag) { - const isMap = fc.start.source === "{"; - const fcName = isMap ? "flow map" : "flow sequence"; - const coll = new (tag?.nodeClass ?? (isMap ? YAMLMap.YAMLMap : YAMLSeq.YAMLSeq))(ctx.schema); - coll.flow = true; - const atRoot = ctx.atRoot; - if (atRoot) ctx.atRoot = false; - if (ctx.atKey) ctx.atKey = false; - let offset = fc.offset + fc.start.source.length; - for (let i = 0; i < fc.items.length; ++i) { - const collItem = fc.items[i]; - const { start, key, sep, value } = collItem; - const props = resolveProps.resolveProps(start, { - flow: fcName, - indicator: "explicit-key-ind", - next: key ?? sep?.[0], - offset, - onError, - parentIndent: fc.indent, - startOnNewline: false - }); - if (!props.found) { - if (!props.anchor && !props.tag && !sep && !value) { - if (i === 0 && props.comma) onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`); - else if (i < fc.items.length - 1) onError(props.start, "UNEXPECTED_TOKEN", `Unexpected empty item in ${fcName}`); - if (props.comment) if (coll.comment) coll.comment += "\n" + props.comment; - else coll.comment = props.comment; - offset = props.end; - continue; - } - if (!isMap && ctx.options.strict && utilContainsNewline.containsNewline(key)) onError(key, "MULTILINE_IMPLICIT_KEY", "Implicit keys of flow sequence pairs need to be on a single line"); - } - if (i === 0) { - if (props.comma) onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`); - } else { - if (!props.comma) onError(props.start, "MISSING_CHAR", `Missing , between ${fcName} items`); - if (props.comment) { - let prevItemComment = ""; - loop: for (const st of start) switch (st.type) { - case "comma": - case "space": break; - case "comment": - prevItemComment = st.source.substring(1); - break loop; - default: break loop; - } - if (prevItemComment) { - let prev = coll.items[coll.items.length - 1]; - if (identity.isPair(prev)) prev = prev.value ?? prev.key; - if (prev.comment) prev.comment += "\n" + prevItemComment; - else prev.comment = prevItemComment; - props.comment = props.comment.substring(prevItemComment.length + 1); - } - } - } - if (!isMap && !sep && !props.found) { - const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, sep, null, props, onError); - coll.items.push(valueNode); - offset = valueNode.range[2]; - if (isBlock(value)) onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg); - } else { - ctx.atKey = true; - const keyStart = props.end; - const keyNode = key ? composeNode(ctx, key, props, onError) : composeEmptyNode(ctx, keyStart, start, null, props, onError); - if (isBlock(key)) onError(keyNode.range, "BLOCK_IN_FLOW", blockMsg); - ctx.atKey = false; - const valueProps = resolveProps.resolveProps(sep ?? [], { - flow: fcName, - indicator: "map-value-ind", - next: value, - offset: keyNode.range[2], - onError, - parentIndent: fc.indent, - startOnNewline: false - }); - if (valueProps.found) { - if (!isMap && !props.found && ctx.options.strict) { - if (sep) for (const st of sep) { - if (st === valueProps.found) break; - if (st.type === "newline") { - onError(st, "MULTILINE_IMPLICIT_KEY", "Implicit keys of flow sequence pairs need to be on a single line"); - break; - } - } - if (props.start < valueProps.found.offset - 1024) onError(valueProps.found, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit flow sequence key"); - } - } else if (value) if ("source" in value && value.source?.[0] === ":") onError(value, "MISSING_CHAR", `Missing space after : in ${fcName}`); - else onError(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`); - const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep, null, valueProps, onError) : null; - if (valueNode) { - if (isBlock(value)) onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg); - } else if (valueProps.comment) if (keyNode.comment) keyNode.comment += "\n" + valueProps.comment; - else keyNode.comment = valueProps.comment; - const pair = new Pair.Pair(keyNode, valueNode); - if (ctx.options.keepSourceTokens) pair.srcToken = collItem; - if (isMap) { - const map = coll; - if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode)) onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique"); - map.items.push(pair); - } else { - const map = new YAMLMap.YAMLMap(ctx.schema); - map.flow = true; - map.items.push(pair); - const endRange = (valueNode ?? keyNode).range; - map.range = [ - keyNode.range[0], - endRange[1], - endRange[2] - ]; - coll.items.push(map); - } - offset = valueNode ? valueNode.range[2] : valueProps.end; - } - } - const expectedEnd = isMap ? "}" : "]"; - const [ce, ...ee] = fc.end; - let cePos = offset; - if (ce?.source === expectedEnd) cePos = ce.offset + ce.source.length; - else { - const name = fcName[0].toUpperCase() + fcName.substring(1); - const msg = atRoot ? `${name} must end with a ${expectedEnd}` : `${name} in block collection must be sufficiently indented and end with a ${expectedEnd}`; - onError(offset, atRoot ? "MISSING_CHAR" : "BAD_INDENT", msg); - if (ce && ce.source.length !== 1) ee.unshift(ce); - } - if (ee.length > 0) { - const end = resolveEnd.resolveEnd(ee, cePos, ctx.options.strict, onError); - if (end.comment) if (coll.comment) coll.comment += "\n" + end.comment; - else coll.comment = end.comment; - coll.range = [ - fc.offset, - cePos, - end.offset - ]; - } else coll.range = [ - fc.offset, - cePos, - cePos - ]; - return coll; - } - exports.resolveFlowCollection = resolveFlowCollection; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-collection.js -var require_compose_collection = /* @__PURE__ */ __commonJSMin(((exports) => { - var identity = require_identity(); - var Scalar = require_Scalar(); - var YAMLMap = require_YAMLMap(); - var YAMLSeq = require_YAMLSeq(); - var resolveBlockMap = require_resolve_block_map(); - var resolveBlockSeq = require_resolve_block_seq(); - var resolveFlowCollection = require_resolve_flow_collection(); - function resolveCollection(CN, ctx, token, onError, tagName, tag) { - const coll = token.type === "block-map" ? resolveBlockMap.resolveBlockMap(CN, ctx, token, onError, tag) : token.type === "block-seq" ? resolveBlockSeq.resolveBlockSeq(CN, ctx, token, onError, tag) : resolveFlowCollection.resolveFlowCollection(CN, ctx, token, onError, tag); - const Coll = coll.constructor; - if (tagName === "!" || tagName === Coll.tagName) { - coll.tag = Coll.tagName; - return coll; - } - if (tagName) coll.tag = tagName; - return coll; - } - function composeCollection(CN, ctx, token, props, onError) { - const tagToken = props.tag; - const tagName = !tagToken ? null : ctx.directives.tagName(tagToken.source, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg)); - if (token.type === "block-seq") { - const { anchor, newlineAfterProp: nl } = props; - const lastProp = anchor && tagToken ? anchor.offset > tagToken.offset ? anchor : tagToken : anchor ?? tagToken; - if (lastProp && (!nl || nl.offset < lastProp.offset)) onError(lastProp, "MISSING_CHAR", "Missing newline after block sequence props"); - } - const expType = token.type === "block-map" ? "map" : token.type === "block-seq" ? "seq" : token.start.source === "{" ? "map" : "seq"; - if (!tagToken || !tagName || tagName === "!" || tagName === YAMLMap.YAMLMap.tagName && expType === "map" || tagName === YAMLSeq.YAMLSeq.tagName && expType === "seq") return resolveCollection(CN, ctx, token, onError, tagName); - let tag = ctx.schema.tags.find((t) => t.tag === tagName && t.collection === expType); - if (!tag) { - const kt = ctx.schema.knownTags[tagName]; - if (kt?.collection === expType) { - ctx.schema.tags.push(Object.assign({}, kt, { default: false })); - tag = kt; - } else { - if (kt) onError(tagToken, "BAD_COLLECTION_TYPE", `${kt.tag} used for ${expType} collection, but expects ${kt.collection ?? "scalar"}`, true); - else onError(tagToken, "TAG_RESOLVE_FAILED", `Unresolved tag: ${tagName}`, true); - return resolveCollection(CN, ctx, token, onError, tagName); - } - } - const coll = resolveCollection(CN, ctx, token, onError, tagName, tag); - const res = tag.resolve?.(coll, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg), ctx.options) ?? coll; - const node = identity.isNode(res) ? res : new Scalar.Scalar(res); - node.range = coll.range; - node.tag = tagName; - if (tag?.format) node.format = tag.format; - return node; - } - exports.composeCollection = composeCollection; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-block-scalar.js -var require_resolve_block_scalar = /* @__PURE__ */ __commonJSMin(((exports) => { - var Scalar = require_Scalar(); - function resolveBlockScalar(ctx, scalar, onError) { - const start = scalar.offset; - const header = parseBlockScalarHeader(scalar, ctx.options.strict, onError); - if (!header) return { - value: "", - type: null, - comment: "", - range: [ - start, - start, - start - ] - }; - const type = header.mode === ">" ? Scalar.Scalar.BLOCK_FOLDED : Scalar.Scalar.BLOCK_LITERAL; - const lines = scalar.source ? splitLines(scalar.source) : []; - let chompStart = lines.length; - for (let i = lines.length - 1; i >= 0; --i) { - const content = lines[i][1]; - if (content === "" || content === "\r") chompStart = i; - else break; - } - if (chompStart === 0) { - const value = header.chomp === "+" && lines.length > 0 ? "\n".repeat(Math.max(1, lines.length - 1)) : ""; - let end = start + header.length; - if (scalar.source) end += scalar.source.length; - return { - value, - type, - comment: header.comment, - range: [ - start, - end, - end - ] - }; - } - let trimIndent = scalar.indent + header.indent; - let offset = scalar.offset + header.length; - let contentStart = 0; - for (let i = 0; i < chompStart; ++i) { - const [indent, content] = lines[i]; - if (content === "" || content === "\r") { - if (header.indent === 0 && indent.length > trimIndent) trimIndent = indent.length; - } else { - if (indent.length < trimIndent) onError(offset + indent.length, "MISSING_CHAR", "Block scalars with more-indented leading empty lines must use an explicit indentation indicator"); - if (header.indent === 0) trimIndent = indent.length; - contentStart = i; - if (trimIndent === 0 && !ctx.atRoot) onError(offset, "BAD_INDENT", "Block scalar values in collections must be indented"); - break; - } - offset += indent.length + content.length + 1; - } - for (let i = lines.length - 1; i >= chompStart; --i) if (lines[i][0].length > trimIndent) chompStart = i + 1; - let value = ""; - let sep = ""; - let prevMoreIndented = false; - for (let i = 0; i < contentStart; ++i) value += lines[i][0].slice(trimIndent) + "\n"; - for (let i = contentStart; i < chompStart; ++i) { - let [indent, content] = lines[i]; - offset += indent.length + content.length + 1; - const crlf = content[content.length - 1] === "\r"; - if (crlf) content = content.slice(0, -1); - /* istanbul ignore if already caught in lexer */ - if (content && indent.length < trimIndent) { - const message = `Block scalar lines must not be less indented than their ${header.indent ? "explicit indentation indicator" : "first line"}`; - onError(offset - content.length - (crlf ? 2 : 1), "BAD_INDENT", message); - indent = ""; - } - if (type === Scalar.Scalar.BLOCK_LITERAL) { - value += sep + indent.slice(trimIndent) + content; - sep = "\n"; - } else if (indent.length > trimIndent || content[0] === " ") { - if (sep === " ") sep = "\n"; - else if (!prevMoreIndented && sep === "\n") sep = "\n\n"; - value += sep + indent.slice(trimIndent) + content; - sep = "\n"; - prevMoreIndented = true; - } else if (content === "") if (sep === "\n") value += "\n"; - else sep = "\n"; - else { - value += sep + content; - sep = " "; - prevMoreIndented = false; - } - } - switch (header.chomp) { - case "-": break; - case "+": - for (let i = chompStart; i < lines.length; ++i) value += "\n" + lines[i][0].slice(trimIndent); - if (value[value.length - 1] !== "\n") value += "\n"; - break; - default: value += "\n"; - } - const end = start + header.length + scalar.source.length; - return { - value, - type, - comment: header.comment, - range: [ - start, - end, - end - ] - }; - } - function parseBlockScalarHeader({ offset, props }, strict, onError) { - /* istanbul ignore if should not happen */ - if (props[0].type !== "block-scalar-header") { - onError(props[0], "IMPOSSIBLE", "Block scalar header not found"); - return null; - } - const { source } = props[0]; - const mode = source[0]; - let indent = 0; - let chomp = ""; - let error = -1; - for (let i = 1; i < source.length; ++i) { - const ch = source[i]; - if (!chomp && (ch === "-" || ch === "+")) chomp = ch; - else { - const n = Number(ch); - if (!indent && n) indent = n; - else if (error === -1) error = offset + i; - } - } - if (error !== -1) onError(error, "UNEXPECTED_TOKEN", `Block scalar header includes extra characters: ${source}`); - let hasSpace = false; - let comment = ""; - let length = source.length; - for (let i = 1; i < props.length; ++i) { - const token = props[i]; - switch (token.type) { - case "space": hasSpace = true; - case "newline": - length += token.source.length; - break; - case "comment": - if (strict && !hasSpace) onError(token, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters"); - length += token.source.length; - comment = token.source.substring(1); - break; - case "error": - onError(token, "UNEXPECTED_TOKEN", token.message); - length += token.source.length; - break; - /* istanbul ignore next should not happen */ - default: { - onError(token, "UNEXPECTED_TOKEN", `Unexpected token in block scalar header: ${token.type}`); - const ts = token.source; - if (ts && typeof ts === "string") length += ts.length; - } - } - } - return { - mode, - indent, - chomp, - comment, - length - }; - } - /** @returns Array of lines split up as `[indent, content]` */ - function splitLines(source) { - const split = source.split(/\n( *)/); - const first = split[0]; - const m = first.match(/^( *)/); - const lines = [m?.[1] ? [m[1], first.slice(m[1].length)] : ["", first]]; - for (let i = 1; i < split.length; i += 2) lines.push([split[i], split[i + 1]]); - return lines; - } - exports.resolveBlockScalar = resolveBlockScalar; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-flow-scalar.js -var require_resolve_flow_scalar = /* @__PURE__ */ __commonJSMin(((exports) => { - var Scalar = require_Scalar(); - var resolveEnd = require_resolve_end(); - function resolveFlowScalar(scalar, strict, onError) { - const { offset, type, source, end } = scalar; - let _type; - let value; - const _onError = (rel, code, msg) => onError(offset + rel, code, msg); - switch (type) { - case "scalar": - _type = Scalar.Scalar.PLAIN; - value = plainValue(source, _onError); - break; - case "single-quoted-scalar": - _type = Scalar.Scalar.QUOTE_SINGLE; - value = singleQuotedValue(source, _onError); - break; - case "double-quoted-scalar": - _type = Scalar.Scalar.QUOTE_DOUBLE; - value = doubleQuotedValue(source, _onError); - break; - /* istanbul ignore next should not happen */ - default: - onError(scalar, "UNEXPECTED_TOKEN", `Expected a flow scalar value, but found: ${type}`); - return { - value: "", - type: null, - comment: "", - range: [ - offset, - offset + source.length, - offset + source.length - ] - }; - } - const valueEnd = offset + source.length; - const re = resolveEnd.resolveEnd(end, valueEnd, strict, onError); - return { - value, - type: _type, - comment: re.comment, - range: [ - offset, - valueEnd, - re.offset - ] - }; - } - function plainValue(source, onError) { - let badChar = ""; - switch (source[0]) { - /* istanbul ignore next should not happen */ - case " ": - badChar = "a tab character"; - break; - case ",": - badChar = "flow indicator character ,"; - break; - case "%": - badChar = "directive indicator character %"; - break; - case "|": - case ">": - badChar = `block scalar indicator ${source[0]}`; - break; - case "@": - case "`": - badChar = `reserved character ${source[0]}`; - break; - } - if (badChar) onError(0, "BAD_SCALAR_START", `Plain value cannot start with ${badChar}`); - return foldLines(source); - } - function singleQuotedValue(source, onError) { - if (source[source.length - 1] !== "'" || source.length === 1) onError(source.length, "MISSING_CHAR", "Missing closing 'quote"); - return foldLines(source.slice(1, -1)).replace(/''/g, "'"); - } - function foldLines(source) { - /** - * The negative lookbehind here and in the `re` RegExp is to - * prevent causing a polynomial search time in certain cases. - * - * The try-catch is for Safari, which doesn't support this yet: - * https://caniuse.com/js-regexp-lookbehind - */ - let first, line; - try { - first = /* @__PURE__ */ new RegExp("(.*?)(? wsStart ? source.slice(wsStart, i + 1) : ch; - } else res += ch; - } - if (source[source.length - 1] !== "\"" || source.length === 1) onError(source.length, "MISSING_CHAR", "Missing closing \"quote"); - return res; - } - /** - * Fold a single newline into a space, multiple newlines to N - 1 newlines. - * Presumes `source[offset] === '\n'` - */ - function foldNewline(source, offset) { - let fold = ""; - let ch = source[offset + 1]; - while (ch === " " || ch === " " || ch === "\n" || ch === "\r") { - if (ch === "\r" && source[offset + 2] !== "\n") break; - if (ch === "\n") fold += "\n"; - offset += 1; - ch = source[offset + 1]; - } - if (!fold) fold = " "; - return { - fold, - offset - }; - } - const escapeCodes = { - "0": "\0", - a: "\x07", - b: "\b", - e: "\x1B", - f: "\f", - n: "\n", - r: "\r", - t: " ", - v: "\v", - N: "…", - _: "\xA0", - L: "\u2028", - P: "\u2029", - " ": " ", - "\"": "\"", - "/": "/", - "\\": "\\", - " ": " " - }; - function parseCharCode(source, offset, length, onError) { - const cc = source.substr(offset, length); - const code = cc.length === length && /^[0-9a-fA-F]+$/.test(cc) ? parseInt(cc, 16) : NaN; - if (isNaN(code)) { - const raw = source.substr(offset - 2, length + 2); - onError(offset - 2, "BAD_DQ_ESCAPE", `Invalid escape sequence ${raw}`); - return raw; - } - return String.fromCodePoint(code); - } - exports.resolveFlowScalar = resolveFlowScalar; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-scalar.js -var require_compose_scalar = /* @__PURE__ */ __commonJSMin(((exports) => { - var identity = require_identity(); - var Scalar = require_Scalar(); - var resolveBlockScalar = require_resolve_block_scalar(); - var resolveFlowScalar = require_resolve_flow_scalar(); - function composeScalar(ctx, token, tagToken, onError) { - const { value, type, comment, range } = token.type === "block-scalar" ? resolveBlockScalar.resolveBlockScalar(ctx, token, onError) : resolveFlowScalar.resolveFlowScalar(token, ctx.options.strict, onError); - const tagName = tagToken ? ctx.directives.tagName(tagToken.source, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg)) : null; - let tag; - if (ctx.options.stringKeys && ctx.atKey) tag = ctx.schema[identity.SCALAR]; - else if (tagName) tag = findScalarTagByName(ctx.schema, value, tagName, tagToken, onError); - else if (token.type === "scalar") tag = findScalarTagByTest(ctx, value, token, onError); - else tag = ctx.schema[identity.SCALAR]; - let scalar; - try { - const res = tag.resolve(value, (msg) => onError(tagToken ?? token, "TAG_RESOLVE_FAILED", msg), ctx.options); - scalar = identity.isScalar(res) ? res : new Scalar.Scalar(res); - } catch (error) { - const msg = error instanceof Error ? error.message : String(error); - onError(tagToken ?? token, "TAG_RESOLVE_FAILED", msg); - scalar = new Scalar.Scalar(value); - } - scalar.range = range; - scalar.source = value; - if (type) scalar.type = type; - if (tagName) scalar.tag = tagName; - if (tag.format) scalar.format = tag.format; - if (comment) scalar.comment = comment; - return scalar; - } - function findScalarTagByName(schema, value, tagName, tagToken, onError) { - if (tagName === "!") return schema[identity.SCALAR]; - const matchWithTest = []; - for (const tag of schema.tags) if (!tag.collection && tag.tag === tagName) if (tag.default && tag.test) matchWithTest.push(tag); - else return tag; - for (const tag of matchWithTest) if (tag.test?.test(value)) return tag; - const kt = schema.knownTags[tagName]; - if (kt && !kt.collection) { - schema.tags.push(Object.assign({}, kt, { - default: false, - test: void 0 - })); - return kt; - } - onError(tagToken, "TAG_RESOLVE_FAILED", `Unresolved tag: ${tagName}`, tagName !== "tag:yaml.org,2002:str"); - return schema[identity.SCALAR]; - } - function findScalarTagByTest({ atKey, directives, schema }, value, token, onError) { - const tag = schema.tags.find((tag) => (tag.default === true || atKey && tag.default === "key") && tag.test?.test(value)) || schema[identity.SCALAR]; - if (schema.compat) { - const compat = schema.compat.find((tag) => tag.default && tag.test?.test(value)) ?? schema[identity.SCALAR]; - if (tag.tag !== compat.tag) onError(token, "TAG_RESOLVE_FAILED", `Value may be parsed as either ${directives.tagString(tag.tag)} or ${directives.tagString(compat.tag)}`, true); - } - return tag; - } - exports.composeScalar = composeScalar; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-empty-scalar-position.js -var require_util_empty_scalar_position = /* @__PURE__ */ __commonJSMin(((exports) => { - function emptyScalarPosition(offset, before, pos) { - if (before) { - pos ?? (pos = before.length); - for (let i = pos - 1; i >= 0; --i) { - let st = before[i]; - switch (st.type) { - case "space": - case "comment": - case "newline": - offset -= st.source.length; - continue; - } - st = before[++i]; - while (st?.type === "space") { - offset += st.source.length; - st = before[++i]; - } - break; - } - } - return offset; - } - exports.emptyScalarPosition = emptyScalarPosition; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-node.js -var require_compose_node = /* @__PURE__ */ __commonJSMin(((exports) => { - var Alias = require_Alias(); - var identity = require_identity(); - var composeCollection = require_compose_collection(); - var composeScalar = require_compose_scalar(); - var resolveEnd = require_resolve_end(); - var utilEmptyScalarPosition = require_util_empty_scalar_position(); - const CN = { - composeNode, - composeEmptyNode - }; - function composeNode(ctx, token, props, onError) { - const atKey = ctx.atKey; - const { spaceBefore, comment, anchor, tag } = props; - let node; - let isSrcToken = true; - switch (token.type) { - case "alias": - node = composeAlias(ctx, token, onError); - if (anchor || tag) onError(token, "ALIAS_PROPS", "An alias node must not specify any properties"); - break; - case "scalar": - case "single-quoted-scalar": - case "double-quoted-scalar": - case "block-scalar": - node = composeScalar.composeScalar(ctx, token, tag, onError); - if (anchor) node.anchor = anchor.source.substring(1); - break; - case "block-map": - case "block-seq": - case "flow-collection": - node = composeCollection.composeCollection(CN, ctx, token, props, onError); - if (anchor) node.anchor = anchor.source.substring(1); - break; - default: - onError(token, "UNEXPECTED_TOKEN", token.type === "error" ? token.message : `Unsupported token (type: ${token.type})`); - node = composeEmptyNode(ctx, token.offset, void 0, null, props, onError); - isSrcToken = false; - } - if (anchor && node.anchor === "") onError(anchor, "BAD_ALIAS", "Anchor cannot be an empty string"); - if (atKey && ctx.options.stringKeys && (!identity.isScalar(node) || typeof node.value !== "string" || node.tag && node.tag !== "tag:yaml.org,2002:str")) onError(tag ?? token, "NON_STRING_KEY", "With stringKeys, all keys must be strings"); - if (spaceBefore) node.spaceBefore = true; - if (comment) if (token.type === "scalar" && token.source === "") node.comment = comment; - else node.commentBefore = comment; - if (ctx.options.keepSourceTokens && isSrcToken) node.srcToken = token; - return node; - } - function composeEmptyNode(ctx, offset, before, pos, { spaceBefore, comment, anchor, tag, end }, onError) { - const token = { - type: "scalar", - offset: utilEmptyScalarPosition.emptyScalarPosition(offset, before, pos), - indent: -1, - source: "" - }; - const node = composeScalar.composeScalar(ctx, token, tag, onError); - if (anchor) { - node.anchor = anchor.source.substring(1); - if (node.anchor === "") onError(anchor, "BAD_ALIAS", "Anchor cannot be an empty string"); - } - if (spaceBefore) node.spaceBefore = true; - if (comment) { - node.comment = comment; - node.range[2] = end; - } - return node; - } - function composeAlias({ options }, { offset, source, end }, onError) { - const alias = new Alias.Alias(source.substring(1)); - if (alias.source === "") onError(offset, "BAD_ALIAS", "Alias cannot be an empty string"); - if (alias.source.endsWith(":")) onError(offset + source.length - 1, "BAD_ALIAS", "Alias ending in : is ambiguous", true); - const valueEnd = offset + source.length; - const re = resolveEnd.resolveEnd(end, valueEnd, options.strict, onError); - alias.range = [ - offset, - valueEnd, - re.offset - ]; - if (re.comment) alias.comment = re.comment; - return alias; - } - exports.composeEmptyNode = composeEmptyNode; - exports.composeNode = composeNode; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-doc.js -var require_compose_doc = /* @__PURE__ */ __commonJSMin(((exports) => { - var Document = require_Document(); - var composeNode = require_compose_node(); - var resolveEnd = require_resolve_end(); - var resolveProps = require_resolve_props(); - function composeDoc(options, directives, { offset, start, value, end }, onError) { - const opts = Object.assign({ _directives: directives }, options); - const doc = new Document.Document(void 0, opts); - const ctx = { - atKey: false, - atRoot: true, - directives: doc.directives, - options: doc.options, - schema: doc.schema - }; - const props = resolveProps.resolveProps(start, { - indicator: "doc-start", - next: value ?? end?.[0], - offset, - onError, - parentIndent: 0, - startOnNewline: true - }); - if (props.found) { - doc.directives.docStart = true; - if (value && (value.type === "block-map" || value.type === "block-seq") && !props.hasNewline) onError(props.end, "MISSING_CHAR", "Block collection cannot start on same line with directives-end marker"); - } - doc.contents = value ? composeNode.composeNode(ctx, value, props, onError) : composeNode.composeEmptyNode(ctx, props.end, start, null, props, onError); - const contentEnd = doc.contents.range[2]; - const re = resolveEnd.resolveEnd(end, contentEnd, false, onError); - if (re.comment) doc.comment = re.comment; - doc.range = [ - offset, - contentEnd, - re.offset - ]; - return doc; - } - exports.composeDoc = composeDoc; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/composer.js -var require_composer = /* @__PURE__ */ __commonJSMin(((exports) => { - var node_process$1 = __require("process"); - var directives = require_directives(); - var Document = require_Document(); - var errors = require_errors(); - var identity = require_identity(); - var composeDoc = require_compose_doc(); - var resolveEnd = require_resolve_end(); - function getErrorPos(src) { - if (typeof src === "number") return [src, src + 1]; - if (Array.isArray(src)) return src.length === 2 ? src : [src[0], src[1]]; - const { offset, source } = src; - return [offset, offset + (typeof source === "string" ? source.length : 1)]; - } - function parsePrelude(prelude) { - let comment = ""; - let atComment = false; - let afterEmptyLine = false; - for (let i = 0; i < prelude.length; ++i) { - const source = prelude[i]; - switch (source[0]) { - case "#": - comment += (comment === "" ? "" : afterEmptyLine ? "\n\n" : "\n") + (source.substring(1) || " "); - atComment = true; - afterEmptyLine = false; - break; - case "%": - if (prelude[i + 1]?.[0] !== "#") i += 1; - atComment = false; - break; - default: - if (!atComment) afterEmptyLine = true; - atComment = false; - } - } - return { - comment, - afterEmptyLine - }; - } - /** - * Compose a stream of CST nodes into a stream of YAML Documents. - * - * ```ts - * import { Composer, Parser } from 'yaml' - * - * const src: string = ... - * const tokens = new Parser().parse(src) - * const docs = new Composer().compose(tokens) - * ``` - */ - var Composer = class { - constructor(options = {}) { - this.doc = null; - this.atDirectives = false; - this.prelude = []; - this.errors = []; - this.warnings = []; - this.onError = (source, code, message, warning) => { - const pos = getErrorPos(source); - if (warning) this.warnings.push(new errors.YAMLWarning(pos, code, message)); - else this.errors.push(new errors.YAMLParseError(pos, code, message)); - }; - this.directives = new directives.Directives({ version: options.version || "1.2" }); - this.options = options; - } - decorate(doc, afterDoc) { - const { comment, afterEmptyLine } = parsePrelude(this.prelude); - if (comment) { - const dc = doc.contents; - if (afterDoc) doc.comment = doc.comment ? `${doc.comment}\n${comment}` : comment; - else if (afterEmptyLine || doc.directives.docStart || !dc) doc.commentBefore = comment; - else if (identity.isCollection(dc) && !dc.flow && dc.items.length > 0) { - let it = dc.items[0]; - if (identity.isPair(it)) it = it.key; - const cb = it.commentBefore; - it.commentBefore = cb ? `${comment}\n${cb}` : comment; - } else { - const cb = dc.commentBefore; - dc.commentBefore = cb ? `${comment}\n${cb}` : comment; - } - } - if (afterDoc) { - Array.prototype.push.apply(doc.errors, this.errors); - Array.prototype.push.apply(doc.warnings, this.warnings); - } else { - doc.errors = this.errors; - doc.warnings = this.warnings; - } - this.prelude = []; - this.errors = []; - this.warnings = []; - } - /** - * Current stream status information. - * - * Mostly useful at the end of input for an empty stream. - */ - streamInfo() { - return { - comment: parsePrelude(this.prelude).comment, - directives: this.directives, - errors: this.errors, - warnings: this.warnings - }; - } - /** - * Compose tokens into documents. - * - * @param forceDoc - If the stream contains no document, still emit a final document including any comments and directives that would be applied to a subsequent document. - * @param endOffset - Should be set if `forceDoc` is also set, to set the document range end and to indicate errors correctly. - */ - *compose(tokens, forceDoc = false, endOffset = -1) { - for (const token of tokens) yield* this.next(token); - yield* this.end(forceDoc, endOffset); - } - /** Advance the composer by one CST token. */ - *next(token) { - if (node_process$1.env.LOG_STREAM) console.dir(token, { depth: null }); - switch (token.type) { - case "directive": - this.directives.add(token.source, (offset, message, warning) => { - const pos = getErrorPos(token); - pos[0] += offset; - this.onError(pos, "BAD_DIRECTIVE", message, warning); - }); - this.prelude.push(token.source); - this.atDirectives = true; - break; - case "document": { - const doc = composeDoc.composeDoc(this.options, this.directives, token, this.onError); - if (this.atDirectives && !doc.directives.docStart) this.onError(token, "MISSING_CHAR", "Missing directives-end/doc-start indicator line"); - this.decorate(doc, false); - if (this.doc) yield this.doc; - this.doc = doc; - this.atDirectives = false; - break; - } - case "byte-order-mark": - case "space": break; - case "comment": - case "newline": - this.prelude.push(token.source); - break; - case "error": { - const msg = token.source ? `${token.message}: ${JSON.stringify(token.source)}` : token.message; - const error = new errors.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg); - if (this.atDirectives || !this.doc) this.errors.push(error); - else this.doc.errors.push(error); - break; - } - case "doc-end": { - if (!this.doc) { - this.errors.push(new errors.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", "Unexpected doc-end without preceding document")); - break; - } - this.doc.directives.docEnd = true; - const end = resolveEnd.resolveEnd(token.end, token.offset + token.source.length, this.doc.options.strict, this.onError); - this.decorate(this.doc, true); - if (end.comment) { - const dc = this.doc.comment; - this.doc.comment = dc ? `${dc}\n${end.comment}` : end.comment; - } - this.doc.range[2] = end.offset; - break; - } - default: this.errors.push(new errors.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", `Unsupported token ${token.type}`)); - } - } - /** - * Call at end of input to yield any remaining document. - * - * @param forceDoc - If the stream contains no document, still emit a final document including any comments and directives that would be applied to a subsequent document. - * @param endOffset - Should be set if `forceDoc` is also set, to set the document range end and to indicate errors correctly. - */ - *end(forceDoc = false, endOffset = -1) { - if (this.doc) { - this.decorate(this.doc, true); - yield this.doc; - this.doc = null; - } else if (forceDoc) { - const opts = Object.assign({ _directives: this.directives }, this.options); - const doc = new Document.Document(void 0, opts); - if (this.atDirectives) this.onError(endOffset, "MISSING_CHAR", "Missing directives-end indicator line"); - doc.range = [ - 0, - endOffset, - endOffset - ]; - this.decorate(doc, false); - yield doc; - } - } - }; - exports.Composer = Composer; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst-scalar.js -var require_cst_scalar = /* @__PURE__ */ __commonJSMin(((exports) => { - var resolveBlockScalar = require_resolve_block_scalar(); - var resolveFlowScalar = require_resolve_flow_scalar(); - var errors = require_errors(); - var stringifyString = require_stringifyString(); - function resolveAsScalar(token, strict = true, onError) { - if (token) { - const _onError = (pos, code, message) => { - const offset = typeof pos === "number" ? pos : Array.isArray(pos) ? pos[0] : pos.offset; - if (onError) onError(offset, code, message); - else throw new errors.YAMLParseError([offset, offset + 1], code, message); - }; - switch (token.type) { - case "scalar": - case "single-quoted-scalar": - case "double-quoted-scalar": return resolveFlowScalar.resolveFlowScalar(token, strict, _onError); - case "block-scalar": return resolveBlockScalar.resolveBlockScalar({ options: { strict } }, token, _onError); - } - } - return null; - } - /** - * Create a new scalar token with `value` - * - * Values that represent an actual string but may be parsed as a different type should use a `type` other than `'PLAIN'`, - * as this function does not support any schema operations and won't check for such conflicts. - * - * @param value The string representation of the value, which will have its content properly indented. - * @param context.end Comments and whitespace after the end of the value, or after the block scalar header. If undefined, a newline will be added. - * @param context.implicitKey Being within an implicit key may affect the resolved type of the token's value. - * @param context.indent The indent level of the token. - * @param context.inFlow Is this scalar within a flow collection? This may affect the resolved type of the token's value. - * @param context.offset The offset position of the token. - * @param context.type The preferred type of the scalar token. If undefined, the previous type of the `token` will be used, defaulting to `'PLAIN'`. - */ - function createScalarToken(value, context) { - const { implicitKey = false, indent, inFlow = false, offset = -1, type = "PLAIN" } = context; - const source = stringifyString.stringifyString({ - type, - value - }, { - implicitKey, - indent: indent > 0 ? " ".repeat(indent) : "", - inFlow, - options: { - blockQuote: true, - lineWidth: -1 - } - }); - const end = context.end ?? [{ - type: "newline", - offset: -1, - indent, - source: "\n" - }]; - switch (source[0]) { - case "|": - case ">": { - const he = source.indexOf("\n"); - const head = source.substring(0, he); - const body = source.substring(he + 1) + "\n"; - const props = [{ - type: "block-scalar-header", - offset, - indent, - source: head - }]; - if (!addEndtoBlockProps(props, end)) props.push({ - type: "newline", - offset: -1, - indent, - source: "\n" - }); - return { - type: "block-scalar", - offset, - indent, - props, - source: body - }; - } - case "\"": return { - type: "double-quoted-scalar", - offset, - indent, - source, - end - }; - case "'": return { - type: "single-quoted-scalar", - offset, - indent, - source, - end - }; - default: return { - type: "scalar", - offset, - indent, - source, - end - }; - } - } - /** - * Set the value of `token` to the given string `value`, overwriting any previous contents and type that it may have. - * - * Best efforts are made to retain any comments previously associated with the `token`, - * though all contents within a collection's `items` will be overwritten. - * - * Values that represent an actual string but may be parsed as a different type should use a `type` other than `'PLAIN'`, - * as this function does not support any schema operations and won't check for such conflicts. - * - * @param token Any token. If it does not include an `indent` value, the value will be stringified as if it were an implicit key. - * @param value The string representation of the value, which will have its content properly indented. - * @param context.afterKey In most cases, values after a key should have an additional level of indentation. - * @param context.implicitKey Being within an implicit key may affect the resolved type of the token's value. - * @param context.inFlow Being within a flow collection may affect the resolved type of the token's value. - * @param context.type The preferred type of the scalar token. If undefined, the previous type of the `token` will be used, defaulting to `'PLAIN'`. - */ - function setScalarValue(token, value, context = {}) { - let { afterKey = false, implicitKey = false, inFlow = false, type } = context; - let indent = "indent" in token ? token.indent : null; - if (afterKey && typeof indent === "number") indent += 2; - if (!type) switch (token.type) { - case "single-quoted-scalar": - type = "QUOTE_SINGLE"; - break; - case "double-quoted-scalar": - type = "QUOTE_DOUBLE"; - break; - case "block-scalar": { - const header = token.props[0]; - if (header.type !== "block-scalar-header") throw new Error("Invalid block scalar header"); - type = header.source[0] === ">" ? "BLOCK_FOLDED" : "BLOCK_LITERAL"; - break; - } - default: type = "PLAIN"; - } - const source = stringifyString.stringifyString({ - type, - value - }, { - implicitKey: implicitKey || indent === null, - indent: indent !== null && indent > 0 ? " ".repeat(indent) : "", - inFlow, - options: { - blockQuote: true, - lineWidth: -1 - } - }); - switch (source[0]) { - case "|": - case ">": - setBlockScalarValue(token, source); - break; - case "\"": - setFlowScalarValue(token, source, "double-quoted-scalar"); - break; - case "'": - setFlowScalarValue(token, source, "single-quoted-scalar"); - break; - default: setFlowScalarValue(token, source, "scalar"); - } - } - function setBlockScalarValue(token, source) { - const he = source.indexOf("\n"); - const head = source.substring(0, he); - const body = source.substring(he + 1) + "\n"; - if (token.type === "block-scalar") { - const header = token.props[0]; - if (header.type !== "block-scalar-header") throw new Error("Invalid block scalar header"); - header.source = head; - token.source = body; - } else { - const { offset } = token; - const indent = "indent" in token ? token.indent : -1; - const props = [{ - type: "block-scalar-header", - offset, - indent, - source: head - }]; - if (!addEndtoBlockProps(props, "end" in token ? token.end : void 0)) props.push({ - type: "newline", - offset: -1, - indent, - source: "\n" - }); - for (const key of Object.keys(token)) if (key !== "type" && key !== "offset") delete token[key]; - Object.assign(token, { - type: "block-scalar", - indent, - props, - source: body - }); - } - } - /** @returns `true` if last token is a newline */ - function addEndtoBlockProps(props, end) { - if (end) for (const st of end) switch (st.type) { - case "space": - case "comment": - props.push(st); - break; - case "newline": - props.push(st); - return true; - } - return false; - } - function setFlowScalarValue(token, source, type) { - switch (token.type) { - case "scalar": - case "double-quoted-scalar": - case "single-quoted-scalar": - token.type = type; - token.source = source; - break; - case "block-scalar": { - const end = token.props.slice(1); - let oa = source.length; - if (token.props[0].type === "block-scalar-header") oa -= token.props[0].source.length; - for (const tok of end) tok.offset += oa; - delete token.props; - Object.assign(token, { - type, - source, - end - }); - break; - } - case "block-map": - case "block-seq": { - const nl = { - type: "newline", - offset: token.offset + source.length, - indent: token.indent, - source: "\n" - }; - delete token.items; - Object.assign(token, { - type, - source, - end: [nl] - }); - break; - } - default: { - const indent = "indent" in token ? token.indent : -1; - const end = "end" in token && Array.isArray(token.end) ? token.end.filter((st) => st.type === "space" || st.type === "comment" || st.type === "newline") : []; - for (const key of Object.keys(token)) if (key !== "type" && key !== "offset") delete token[key]; - Object.assign(token, { - type, - indent, - source, - end - }); - } - } - } - exports.createScalarToken = createScalarToken; - exports.resolveAsScalar = resolveAsScalar; - exports.setScalarValue = setScalarValue; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst-stringify.js -var require_cst_stringify = /* @__PURE__ */ __commonJSMin(((exports) => { - /** - * Stringify a CST document, token, or collection item - * - * Fair warning: This applies no validation whatsoever, and - * simply concatenates the sources in their logical order. - */ - const stringify = (cst) => "type" in cst ? stringifyToken(cst) : stringifyItem(cst); - function stringifyToken(token) { - switch (token.type) { - case "block-scalar": { - let res = ""; - for (const tok of token.props) res += stringifyToken(tok); - return res + token.source; - } - case "block-map": - case "block-seq": { - let res = ""; - for (const item of token.items) res += stringifyItem(item); - return res; - } - case "flow-collection": { - let res = token.start.source; - for (const item of token.items) res += stringifyItem(item); - for (const st of token.end) res += st.source; - return res; - } - case "document": { - let res = stringifyItem(token); - if (token.end) for (const st of token.end) res += st.source; - return res; - } - default: { - let res = token.source; - if ("end" in token && token.end) for (const st of token.end) res += st.source; - return res; - } - } - } - function stringifyItem({ start, key, sep, value }) { - let res = ""; - for (const st of start) res += st.source; - if (key) res += stringifyToken(key); - if (sep) for (const st of sep) res += st.source; - if (value) res += stringifyToken(value); - return res; - } - exports.stringify = stringify; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst-visit.js -var require_cst_visit = /* @__PURE__ */ __commonJSMin(((exports) => { - const BREAK = Symbol("break visit"); - const SKIP = Symbol("skip children"); - const REMOVE = Symbol("remove item"); - /** - * Apply a visitor to a CST document or item. - * - * Walks through the tree (depth-first) starting from the root, calling a - * `visitor` function with two arguments when entering each item: - * - `item`: The current item, which included the following members: - * - `start: SourceToken[]` – Source tokens before the key or value, - * possibly including its anchor or tag. - * - `key?: Token | null` – Set for pair values. May then be `null`, if - * the key before the `:` separator is empty. - * - `sep?: SourceToken[]` – Source tokens between the key and the value, - * which should include the `:` map value indicator if `value` is set. - * - `value?: Token` – The value of a sequence item, or of a map pair. - * - `path`: The steps from the root to the current node, as an array of - * `['key' | 'value', number]` tuples. - * - * The return value of the visitor may be used to control the traversal: - * - `undefined` (default): Do nothing and continue - * - `visit.SKIP`: Do not visit the children of this token, continue with - * next sibling - * - `visit.BREAK`: Terminate traversal completely - * - `visit.REMOVE`: Remove the current item, then continue with the next one - * - `number`: Set the index of the next step. This is useful especially if - * the index of the current token has changed. - * - `function`: Define the next visitor for this item. After the original - * visitor is called on item entry, next visitors are called after handling - * a non-empty `key` and when exiting the item. - */ - function visit(cst, visitor) { - if ("type" in cst && cst.type === "document") cst = { - start: cst.start, - value: cst.value - }; - _visit(Object.freeze([]), cst, visitor); - } - /** Terminate visit traversal completely */ - visit.BREAK = BREAK; - /** Do not visit the children of the current item */ - visit.SKIP = SKIP; - /** Remove the current item */ - visit.REMOVE = REMOVE; - /** Find the item at `path` from `cst` as the root */ - visit.itemAtPath = (cst, path) => { - let item = cst; - for (const [field, index] of path) { - const tok = item?.[field]; - if (tok && "items" in tok) item = tok.items[index]; - else return void 0; - } - return item; - }; - /** - * Get the immediate parent collection of the item at `path` from `cst` as the root. - * - * Throws an error if the collection is not found, which should never happen if the item itself exists. - */ - visit.parentCollection = (cst, path) => { - const parent = visit.itemAtPath(cst, path.slice(0, -1)); - const field = path[path.length - 1][0]; - const coll = parent?.[field]; - if (coll && "items" in coll) return coll; - throw new Error("Parent collection not found"); - }; - function _visit(path, item, visitor) { - let ctrl = visitor(item, path); - if (typeof ctrl === "symbol") return ctrl; - for (const field of ["key", "value"]) { - const token = item[field]; - if (token && "items" in token) { - for (let i = 0; i < token.items.length; ++i) { - const ci = _visit(Object.freeze(path.concat([[field, i]])), token.items[i], visitor); - if (typeof ci === "number") i = ci - 1; - else if (ci === BREAK) return BREAK; - else if (ci === REMOVE) { - token.items.splice(i, 1); - i -= 1; - } - } - if (typeof ctrl === "function" && field === "key") ctrl = ctrl(item, path); - } - } - return typeof ctrl === "function" ? ctrl(item, path) : ctrl; - } - exports.visit = visit; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst.js -var require_cst = /* @__PURE__ */ __commonJSMin(((exports) => { - var cstScalar = require_cst_scalar(); - var cstStringify = require_cst_stringify(); - var cstVisit = require_cst_visit(); - /** The byte order mark */ - const BOM = ""; - /** Start of doc-mode */ - const DOCUMENT = ""; - /** Unexpected end of flow-mode */ - const FLOW_END = ""; - /** Next token is a scalar value */ - const SCALAR = ""; - /** @returns `true` if `token` is a flow or block collection */ - const isCollection = (token) => !!token && "items" in token; - /** @returns `true` if `token` is a flow or block scalar; not an alias */ - const isScalar = (token) => !!token && (token.type === "scalar" || token.type === "single-quoted-scalar" || token.type === "double-quoted-scalar" || token.type === "block-scalar"); - /* istanbul ignore next */ - /** Get a printable representation of a lexer token */ - function prettyToken(token) { - switch (token) { - case BOM: return ""; - case DOCUMENT: return ""; - case FLOW_END: return ""; - case SCALAR: return ""; - default: return JSON.stringify(token); - } - } - /** Identify the type of a lexer token. May return `null` for unknown tokens. */ - function tokenType(source) { - switch (source) { - case BOM: return "byte-order-mark"; - case DOCUMENT: return "doc-mode"; - case FLOW_END: return "flow-error-end"; - case SCALAR: return "scalar"; - case "---": return "doc-start"; - case "...": return "doc-end"; - case "": - case "\n": - case "\r\n": return "newline"; - case "-": return "seq-item-ind"; - case "?": return "explicit-key-ind"; - case ":": return "map-value-ind"; - case "{": return "flow-map-start"; - case "}": return "flow-map-end"; - case "[": return "flow-seq-start"; - case "]": return "flow-seq-end"; - case ",": return "comma"; - } - switch (source[0]) { - case " ": - case " ": return "space"; - case "#": return "comment"; - case "%": return "directive-line"; - case "*": return "alias"; - case "&": return "anchor"; - case "!": return "tag"; - case "'": return "single-quoted-scalar"; - case "\"": return "double-quoted-scalar"; - case "|": - case ">": return "block-scalar-header"; - } - return null; - } - exports.createScalarToken = cstScalar.createScalarToken; - exports.resolveAsScalar = cstScalar.resolveAsScalar; - exports.setScalarValue = cstScalar.setScalarValue; - exports.stringify = cstStringify.stringify; - exports.visit = cstVisit.visit; - exports.BOM = BOM; - exports.DOCUMENT = DOCUMENT; - exports.FLOW_END = FLOW_END; - exports.SCALAR = SCALAR; - exports.isCollection = isCollection; - exports.isScalar = isScalar; - exports.prettyToken = prettyToken; - exports.tokenType = tokenType; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/lexer.js -var require_lexer = /* @__PURE__ */ __commonJSMin(((exports) => { - var cst = require_cst(); - function isEmpty(ch) { - switch (ch) { - case void 0: - case " ": - case "\n": - case "\r": - case " ": return true; - default: return false; - } - } - const hexDigits = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"); - const tagChars = /* @__PURE__ */ new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"); - const flowIndicatorChars = /* @__PURE__ */ new Set(",[]{}"); - const invalidAnchorChars = /* @__PURE__ */ new Set(" ,[]{}\n\r "); - const isNotAnchorChar = (ch) => !ch || invalidAnchorChars.has(ch); - /** - * Splits an input string into lexical tokens, i.e. smaller strings that are - * easily identifiable by `tokens.tokenType()`. - * - * Lexing starts always in a "stream" context. Incomplete input may be buffered - * until a complete token can be emitted. - * - * In addition to slices of the original input, the following control characters - * may also be emitted: - * - * - `\x02` (Start of Text): A document starts with the next token - * - `\x18` (Cancel): Unexpected end of flow-mode (indicates an error) - * - `\x1f` (Unit Separator): Next token is a scalar value - * - `\u{FEFF}` (Byte order mark): Emitted separately outside documents - */ - var Lexer = class { - constructor() { - /** - * Flag indicating whether the end of the current buffer marks the end of - * all input - */ - this.atEnd = false; - /** - * Explicit indent set in block scalar header, as an offset from the current - * minimum indent, so e.g. set to 1 from a header `|2+`. Set to -1 if not - * explicitly set. - */ - this.blockScalarIndent = -1; - /** - * Block scalars that include a + (keep) chomping indicator in their header - * include trailing empty lines, which are otherwise excluded from the - * scalar's contents. - */ - this.blockScalarKeep = false; - /** Current input */ - this.buffer = ""; - /** - * Flag noting whether the map value indicator : can immediately follow this - * node within a flow context. - */ - this.flowKey = false; - /** Count of surrounding flow collection levels. */ - this.flowLevel = 0; - /** - * Minimum level of indentation required for next lines to be parsed as a - * part of the current scalar value. - */ - this.indentNext = 0; - /** Indentation level of the current line. */ - this.indentValue = 0; - /** Position of the next \n character. */ - this.lineEndPos = null; - /** Stores the state of the lexer if reaching the end of incpomplete input */ - this.next = null; - /** A pointer to `buffer`; the current position of the lexer. */ - this.pos = 0; - } - /** - * Generate YAML tokens from the `source` string. If `incomplete`, - * a part of the last line may be left as a buffer for the next call. - * - * @returns A generator of lexical tokens - */ - *lex(source, incomplete = false) { - if (source) { - if (typeof source !== "string") throw TypeError("source is not a string"); - this.buffer = this.buffer ? this.buffer + source : source; - this.lineEndPos = null; - } - this.atEnd = !incomplete; - let next = this.next ?? "stream"; - while (next && (incomplete || this.hasChars(1))) next = yield* this.parseNext(next); - } - atLineEnd() { - let i = this.pos; - let ch = this.buffer[i]; - while (ch === " " || ch === " ") ch = this.buffer[++i]; - if (!ch || ch === "#" || ch === "\n") return true; - if (ch === "\r") return this.buffer[i + 1] === "\n"; - return false; - } - charAt(n) { - return this.buffer[this.pos + n]; - } - continueScalar(offset) { - let ch = this.buffer[offset]; - if (this.indentNext > 0) { - let indent = 0; - while (ch === " ") ch = this.buffer[++indent + offset]; - if (ch === "\r") { - const next = this.buffer[indent + offset + 1]; - if (next === "\n" || !next && !this.atEnd) return offset + indent + 1; - } - return ch === "\n" || indent >= this.indentNext || !ch && !this.atEnd ? offset + indent : -1; - } - if (ch === "-" || ch === ".") { - const dt = this.buffer.substr(offset, 3); - if ((dt === "---" || dt === "...") && isEmpty(this.buffer[offset + 3])) return -1; - } - return offset; - } - getLine() { - let end = this.lineEndPos; - if (typeof end !== "number" || end !== -1 && end < this.pos) { - end = this.buffer.indexOf("\n", this.pos); - this.lineEndPos = end; - } - if (end === -1) return this.atEnd ? this.buffer.substring(this.pos) : null; - if (this.buffer[end - 1] === "\r") end -= 1; - return this.buffer.substring(this.pos, end); - } - hasChars(n) { - return this.pos + n <= this.buffer.length; - } - setNext(state) { - this.buffer = this.buffer.substring(this.pos); - this.pos = 0; - this.lineEndPos = null; - this.next = state; - return null; - } - peek(n) { - return this.buffer.substr(this.pos, n); - } - *parseNext(next) { - switch (next) { - case "stream": return yield* this.parseStream(); - case "line-start": return yield* this.parseLineStart(); - case "block-start": return yield* this.parseBlockStart(); - case "doc": return yield* this.parseDocument(); - case "flow": return yield* this.parseFlowCollection(); - case "quoted-scalar": return yield* this.parseQuotedScalar(); - case "block-scalar": return yield* this.parseBlockScalar(); - case "plain-scalar": return yield* this.parsePlainScalar(); - } - } - *parseStream() { - let line = this.getLine(); - if (line === null) return this.setNext("stream"); - if (line[0] === cst.BOM) { - yield* this.pushCount(1); - line = line.substring(1); - } - if (line[0] === "%") { - let dirEnd = line.length; - let cs = line.indexOf("#"); - while (cs !== -1) { - const ch = line[cs - 1]; - if (ch === " " || ch === " ") { - dirEnd = cs - 1; - break; - } else cs = line.indexOf("#", cs + 1); - } - while (true) { - const ch = line[dirEnd - 1]; - if (ch === " " || ch === " ") dirEnd -= 1; - else break; - } - const n = (yield* this.pushCount(dirEnd)) + (yield* this.pushSpaces(true)); - yield* this.pushCount(line.length - n); - this.pushNewline(); - return "stream"; - } - if (this.atLineEnd()) { - const sp = yield* this.pushSpaces(true); - yield* this.pushCount(line.length - sp); - yield* this.pushNewline(); - return "stream"; - } - yield cst.DOCUMENT; - return yield* this.parseLineStart(); - } - *parseLineStart() { - const ch = this.charAt(0); - if (!ch && !this.atEnd) return this.setNext("line-start"); - if (ch === "-" || ch === ".") { - if (!this.atEnd && !this.hasChars(4)) return this.setNext("line-start"); - const s = this.peek(3); - if ((s === "---" || s === "...") && isEmpty(this.charAt(3))) { - yield* this.pushCount(3); - this.indentValue = 0; - this.indentNext = 0; - return s === "---" ? "doc" : "stream"; - } - } - this.indentValue = yield* this.pushSpaces(false); - if (this.indentNext > this.indentValue && !isEmpty(this.charAt(1))) this.indentNext = this.indentValue; - return yield* this.parseBlockStart(); - } - *parseBlockStart() { - const [ch0, ch1] = this.peek(2); - if (!ch1 && !this.atEnd) return this.setNext("block-start"); - if ((ch0 === "-" || ch0 === "?" || ch0 === ":") && isEmpty(ch1)) { - const n = (yield* this.pushCount(1)) + (yield* this.pushSpaces(true)); - this.indentNext = this.indentValue + 1; - this.indentValue += n; - return yield* this.parseBlockStart(); - } - return "doc"; - } - *parseDocument() { - yield* this.pushSpaces(true); - const line = this.getLine(); - if (line === null) return this.setNext("doc"); - let n = yield* this.pushIndicators(); - switch (line[n]) { - case "#": yield* this.pushCount(line.length - n); - case void 0: - yield* this.pushNewline(); - return yield* this.parseLineStart(); - case "{": - case "[": - yield* this.pushCount(1); - this.flowKey = false; - this.flowLevel = 1; - return "flow"; - case "}": - case "]": - yield* this.pushCount(1); - return "doc"; - case "*": - yield* this.pushUntil(isNotAnchorChar); - return "doc"; - case "\"": - case "'": return yield* this.parseQuotedScalar(); - case "|": - case ">": - n += yield* this.parseBlockScalarHeader(); - n += yield* this.pushSpaces(true); - yield* this.pushCount(line.length - n); - yield* this.pushNewline(); - return yield* this.parseBlockScalar(); - default: return yield* this.parsePlainScalar(); - } - } - *parseFlowCollection() { - let nl, sp; - let indent = -1; - do { - nl = yield* this.pushNewline(); - if (nl > 0) { - sp = yield* this.pushSpaces(false); - this.indentValue = indent = sp; - } else sp = 0; - sp += yield* this.pushSpaces(true); - } while (nl + sp > 0); - const line = this.getLine(); - if (line === null) return this.setNext("flow"); - if (indent !== -1 && indent < this.indentNext && line[0] !== "#" || indent === 0 && (line.startsWith("---") || line.startsWith("...")) && isEmpty(line[3])) { - if (!(indent === this.indentNext - 1 && this.flowLevel === 1 && (line[0] === "]" || line[0] === "}"))) { - this.flowLevel = 0; - yield cst.FLOW_END; - return yield* this.parseLineStart(); - } - } - let n = 0; - while (line[n] === ",") { - n += yield* this.pushCount(1); - n += yield* this.pushSpaces(true); - this.flowKey = false; - } - n += yield* this.pushIndicators(); - switch (line[n]) { - case void 0: return "flow"; - case "#": - yield* this.pushCount(line.length - n); - return "flow"; - case "{": - case "[": - yield* this.pushCount(1); - this.flowKey = false; - this.flowLevel += 1; - return "flow"; - case "}": - case "]": - yield* this.pushCount(1); - this.flowKey = true; - this.flowLevel -= 1; - return this.flowLevel ? "flow" : "doc"; - case "*": - yield* this.pushUntil(isNotAnchorChar); - return "flow"; - case "\"": - case "'": - this.flowKey = true; - return yield* this.parseQuotedScalar(); - case ":": { - const next = this.charAt(1); - if (this.flowKey || isEmpty(next) || next === ",") { - this.flowKey = false; - yield* this.pushCount(1); - yield* this.pushSpaces(true); - return "flow"; - } - } - default: - this.flowKey = false; - return yield* this.parsePlainScalar(); - } - } - *parseQuotedScalar() { - const quote = this.charAt(0); - let end = this.buffer.indexOf(quote, this.pos + 1); - if (quote === "'") while (end !== -1 && this.buffer[end + 1] === "'") end = this.buffer.indexOf("'", end + 2); - else while (end !== -1) { - let n = 0; - while (this.buffer[end - 1 - n] === "\\") n += 1; - if (n % 2 === 0) break; - end = this.buffer.indexOf("\"", end + 1); - } - const qb = this.buffer.substring(0, end); - let nl = qb.indexOf("\n", this.pos); - if (nl !== -1) { - while (nl !== -1) { - const cs = this.continueScalar(nl + 1); - if (cs === -1) break; - nl = qb.indexOf("\n", cs); - } - if (nl !== -1) end = nl - (qb[nl - 1] === "\r" ? 2 : 1); - } - if (end === -1) { - if (!this.atEnd) return this.setNext("quoted-scalar"); - end = this.buffer.length; - } - yield* this.pushToIndex(end + 1, false); - return this.flowLevel ? "flow" : "doc"; - } - *parseBlockScalarHeader() { - this.blockScalarIndent = -1; - this.blockScalarKeep = false; - let i = this.pos; - while (true) { - const ch = this.buffer[++i]; - if (ch === "+") this.blockScalarKeep = true; - else if (ch > "0" && ch <= "9") this.blockScalarIndent = Number(ch) - 1; - else if (ch !== "-") break; - } - return yield* this.pushUntil((ch) => isEmpty(ch) || ch === "#"); - } - *parseBlockScalar() { - let nl = this.pos - 1; - let indent = 0; - let ch; - loop: for (let i = this.pos; ch = this.buffer[i]; ++i) switch (ch) { - case " ": - indent += 1; - break; - case "\n": - nl = i; - indent = 0; - break; - case "\r": { - const next = this.buffer[i + 1]; - if (!next && !this.atEnd) return this.setNext("block-scalar"); - if (next === "\n") break; - } - default: break loop; - } - if (!ch && !this.atEnd) return this.setNext("block-scalar"); - if (indent >= this.indentNext) { - if (this.blockScalarIndent === -1) this.indentNext = indent; - else this.indentNext = this.blockScalarIndent + (this.indentNext === 0 ? 1 : this.indentNext); - do { - const cs = this.continueScalar(nl + 1); - if (cs === -1) break; - nl = this.buffer.indexOf("\n", cs); - } while (nl !== -1); - if (nl === -1) { - if (!this.atEnd) return this.setNext("block-scalar"); - nl = this.buffer.length; - } - } - let i = nl + 1; - ch = this.buffer[i]; - while (ch === " ") ch = this.buffer[++i]; - if (ch === " ") { - while (ch === " " || ch === " " || ch === "\r" || ch === "\n") ch = this.buffer[++i]; - nl = i - 1; - } else if (!this.blockScalarKeep) do { - let i = nl - 1; - let ch = this.buffer[i]; - if (ch === "\r") ch = this.buffer[--i]; - const lastChar = i; - while (ch === " ") ch = this.buffer[--i]; - if (ch === "\n" && i >= this.pos && i + 1 + indent > lastChar) nl = i; - else break; - } while (true); - yield cst.SCALAR; - yield* this.pushToIndex(nl + 1, true); - return yield* this.parseLineStart(); - } - *parsePlainScalar() { - const inFlow = this.flowLevel > 0; - let end = this.pos - 1; - let i = this.pos - 1; - let ch; - while (ch = this.buffer[++i]) if (ch === ":") { - const next = this.buffer[i + 1]; - if (isEmpty(next) || inFlow && flowIndicatorChars.has(next)) break; - end = i; - } else if (isEmpty(ch)) { - let next = this.buffer[i + 1]; - if (ch === "\r") if (next === "\n") { - i += 1; - ch = "\n"; - next = this.buffer[i + 1]; - } else end = i; - if (next === "#" || inFlow && flowIndicatorChars.has(next)) break; - if (ch === "\n") { - const cs = this.continueScalar(i + 1); - if (cs === -1) break; - i = Math.max(i, cs - 2); - } - } else { - if (inFlow && flowIndicatorChars.has(ch)) break; - end = i; - } - if (!ch && !this.atEnd) return this.setNext("plain-scalar"); - yield cst.SCALAR; - yield* this.pushToIndex(end + 1, true); - return inFlow ? "flow" : "doc"; - } - *pushCount(n) { - if (n > 0) { - yield this.buffer.substr(this.pos, n); - this.pos += n; - return n; - } - return 0; - } - *pushToIndex(i, allowEmpty) { - const s = this.buffer.slice(this.pos, i); - if (s) { - yield s; - this.pos += s.length; - return s.length; - } else if (allowEmpty) yield ""; - return 0; - } - *pushIndicators() { - switch (this.charAt(0)) { - case "!": return (yield* this.pushTag()) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators()); - case "&": return (yield* this.pushUntil(isNotAnchorChar)) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators()); - case "-": - case "?": - case ":": { - const inFlow = this.flowLevel > 0; - const ch1 = this.charAt(1); - if (isEmpty(ch1) || inFlow && flowIndicatorChars.has(ch1)) { - if (!inFlow) this.indentNext = this.indentValue + 1; - else if (this.flowKey) this.flowKey = false; - return (yield* this.pushCount(1)) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators()); - } - } - } - return 0; - } - *pushTag() { - if (this.charAt(1) === "<") { - let i = this.pos + 2; - let ch = this.buffer[i]; - while (!isEmpty(ch) && ch !== ">") ch = this.buffer[++i]; - return yield* this.pushToIndex(ch === ">" ? i + 1 : i, false); - } else { - let i = this.pos + 1; - let ch = this.buffer[i]; - while (ch) if (tagChars.has(ch)) ch = this.buffer[++i]; - else if (ch === "%" && hexDigits.has(this.buffer[i + 1]) && hexDigits.has(this.buffer[i + 2])) ch = this.buffer[i += 3]; - else break; - return yield* this.pushToIndex(i, false); - } - } - *pushNewline() { - const ch = this.buffer[this.pos]; - if (ch === "\n") return yield* this.pushCount(1); - else if (ch === "\r" && this.charAt(1) === "\n") return yield* this.pushCount(2); - else return 0; - } - *pushSpaces(allowTabs) { - let i = this.pos - 1; - let ch; - do - ch = this.buffer[++i]; - while (ch === " " || allowTabs && ch === " "); - const n = i - this.pos; - if (n > 0) { - yield this.buffer.substr(this.pos, n); - this.pos = i; - } - return n; - } - *pushUntil(test) { - let i = this.pos; - let ch = this.buffer[i]; - while (!test(ch)) ch = this.buffer[++i]; - return yield* this.pushToIndex(i, false); - } - }; - exports.Lexer = Lexer; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/line-counter.js -var require_line_counter = /* @__PURE__ */ __commonJSMin(((exports) => { - /** - * Tracks newlines during parsing in order to provide an efficient API for - * determining the one-indexed `{ line, col }` position for any offset - * within the input. - */ - var LineCounter = class { - constructor() { - this.lineStarts = []; - /** - * Should be called in ascending order. Otherwise, call - * `lineCounter.lineStarts.sort()` before calling `linePos()`. - */ - this.addNewLine = (offset) => this.lineStarts.push(offset); - /** - * Performs a binary search and returns the 1-indexed { line, col } - * position of `offset`. If `line === 0`, `addNewLine` has never been - * called or `offset` is before the first known newline. - */ - this.linePos = (offset) => { - let low = 0; - let high = this.lineStarts.length; - while (low < high) { - const mid = low + high >> 1; - if (this.lineStarts[mid] < offset) low = mid + 1; - else high = mid; - } - if (this.lineStarts[low] === offset) return { - line: low + 1, - col: 1 - }; - if (low === 0) return { - line: 0, - col: offset - }; - const start = this.lineStarts[low - 1]; - return { - line: low, - col: offset - start + 1 - }; - }; - } - }; - exports.LineCounter = LineCounter; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/parser.js -var require_parser = /* @__PURE__ */ __commonJSMin(((exports) => { - var node_process = __require("process"); - var cst = require_cst(); - var lexer = require_lexer(); - function includesToken(list, type) { - for (let i = 0; i < list.length; ++i) if (list[i].type === type) return true; - return false; - } - function findNonEmptyIndex(list) { - for (let i = 0; i < list.length; ++i) switch (list[i].type) { - case "space": - case "comment": - case "newline": break; - default: return i; - } - return -1; - } - function isFlowToken(token) { - switch (token?.type) { - case "alias": - case "scalar": - case "single-quoted-scalar": - case "double-quoted-scalar": - case "flow-collection": return true; - default: return false; - } - } - function getPrevProps(parent) { - switch (parent.type) { - case "document": return parent.start; - case "block-map": { - const it = parent.items[parent.items.length - 1]; - return it.sep ?? it.start; - } - case "block-seq": return parent.items[parent.items.length - 1].start; - /* istanbul ignore next should not happen */ - default: return []; - } - } - /** Note: May modify input array */ - function getFirstKeyStartProps(prev) { - if (prev.length === 0) return []; - let i = prev.length; - loop: while (--i >= 0) switch (prev[i].type) { - case "doc-start": - case "explicit-key-ind": - case "map-value-ind": - case "seq-item-ind": - case "newline": break loop; - } - while (prev[++i]?.type === "space"); - return prev.splice(i, prev.length); - } - function fixFlowSeqItems(fc) { - if (fc.start.type === "flow-seq-start") { - for (const it of fc.items) if (it.sep && !it.value && !includesToken(it.start, "explicit-key-ind") && !includesToken(it.sep, "map-value-ind")) { - if (it.key) it.value = it.key; - delete it.key; - if (isFlowToken(it.value)) if (it.value.end) Array.prototype.push.apply(it.value.end, it.sep); - else it.value.end = it.sep; - else Array.prototype.push.apply(it.start, it.sep); - delete it.sep; - } - } - } - /** - * A YAML concrete syntax tree (CST) parser - * - * ```ts - * const src: string = ... - * for (const token of new Parser().parse(src)) { - * // token: Token - * } - * ``` - * - * To use the parser with a user-provided lexer: - * - * ```ts - * function* parse(source: string, lexer: Lexer) { - * const parser = new Parser() - * for (const lexeme of lexer.lex(source)) - * yield* parser.next(lexeme) - * yield* parser.end() - * } - * - * const src: string = ... - * const lexer = new Lexer() - * for (const token of parse(src, lexer)) { - * // token: Token - * } - * ``` - */ - var Parser = class { - /** - * @param onNewLine - If defined, called separately with the start position of - * each new line (in `parse()`, including the start of input). - */ - constructor(onNewLine) { - /** If true, space and sequence indicators count as indentation */ - this.atNewLine = true; - /** If true, next token is a scalar value */ - this.atScalar = false; - /** Current indentation level */ - this.indent = 0; - /** Current offset since the start of parsing */ - this.offset = 0; - /** On the same line with a block map key */ - this.onKeyLine = false; - /** Top indicates the node that's currently being built */ - this.stack = []; - /** The source of the current token, set in parse() */ - this.source = ""; - /** The type of the current token, set in parse() */ - this.type = ""; - this.lexer = new lexer.Lexer(); - this.onNewLine = onNewLine; - } - /** - * Parse `source` as a YAML stream. - * If `incomplete`, a part of the last line may be left as a buffer for the next call. - * - * Errors are not thrown, but yielded as `{ type: 'error', message }` tokens. - * - * @returns A generator of tokens representing each directive, document, and other structure. - */ - *parse(source, incomplete = false) { - if (this.onNewLine && this.offset === 0) this.onNewLine(0); - for (const lexeme of this.lexer.lex(source, incomplete)) yield* this.next(lexeme); - if (!incomplete) yield* this.end(); - } - /** - * Advance the parser by the `source` of one lexical token. - */ - *next(source) { - this.source = source; - if (node_process.env.LOG_TOKENS) console.log("|", cst.prettyToken(source)); - if (this.atScalar) { - this.atScalar = false; - yield* this.step(); - this.offset += source.length; - return; - } - const type = cst.tokenType(source); - if (!type) { - const message = `Not a YAML token: ${source}`; - yield* this.pop({ - type: "error", - offset: this.offset, - message, - source - }); - this.offset += source.length; - } else if (type === "scalar") { - this.atNewLine = false; - this.atScalar = true; - this.type = "scalar"; - } else { - this.type = type; - yield* this.step(); - switch (type) { - case "newline": - this.atNewLine = true; - this.indent = 0; - if (this.onNewLine) this.onNewLine(this.offset + source.length); - break; - case "space": - if (this.atNewLine && source[0] === " ") this.indent += source.length; - break; - case "explicit-key-ind": - case "map-value-ind": - case "seq-item-ind": - if (this.atNewLine) this.indent += source.length; - break; - case "doc-mode": - case "flow-error-end": return; - default: this.atNewLine = false; - } - this.offset += source.length; - } - } - /** Call at end of input to push out any remaining constructions */ - *end() { - while (this.stack.length > 0) yield* this.pop(); - } - get sourceToken() { - return { - type: this.type, - offset: this.offset, - indent: this.indent, - source: this.source - }; - } - *step() { - const top = this.peek(1); - if (this.type === "doc-end" && top?.type !== "doc-end") { - while (this.stack.length > 0) yield* this.pop(); - this.stack.push({ - type: "doc-end", - offset: this.offset, - source: this.source - }); - return; - } - if (!top) return yield* this.stream(); - switch (top.type) { - case "document": return yield* this.document(top); - case "alias": - case "scalar": - case "single-quoted-scalar": - case "double-quoted-scalar": return yield* this.scalar(top); - case "block-scalar": return yield* this.blockScalar(top); - case "block-map": return yield* this.blockMap(top); - case "block-seq": return yield* this.blockSequence(top); - case "flow-collection": return yield* this.flowCollection(top); - case "doc-end": return yield* this.documentEnd(top); - } - /* istanbul ignore next should not happen */ - yield* this.pop(); - } - peek(n) { - return this.stack[this.stack.length - n]; - } - *pop(error) { - const token = error ?? this.stack.pop(); - /* istanbul ignore if should not happen */ - if (!token) yield { - type: "error", - offset: this.offset, - source: "", - message: "Tried to pop an empty stack" - }; - else if (this.stack.length === 0) yield token; - else { - const top = this.peek(1); - if (token.type === "block-scalar") token.indent = "indent" in top ? top.indent : 0; - else if (token.type === "flow-collection" && top.type === "document") token.indent = 0; - if (token.type === "flow-collection") fixFlowSeqItems(token); - switch (top.type) { - case "document": - top.value = token; - break; - case "block-scalar": - top.props.push(token); - break; - case "block-map": { - const it = top.items[top.items.length - 1]; - if (it.value) { - top.items.push({ - start: [], - key: token, - sep: [] - }); - this.onKeyLine = true; - return; - } else if (it.sep) it.value = token; - else { - Object.assign(it, { - key: token, - sep: [] - }); - this.onKeyLine = !it.explicitKey; - return; - } - break; - } - case "block-seq": { - const it = top.items[top.items.length - 1]; - if (it.value) top.items.push({ - start: [], - value: token - }); - else it.value = token; - break; - } - case "flow-collection": { - const it = top.items[top.items.length - 1]; - if (!it || it.value) top.items.push({ - start: [], - key: token, - sep: [] - }); - else if (it.sep) it.value = token; - else Object.assign(it, { - key: token, - sep: [] - }); - return; - } - /* istanbul ignore next should not happen */ - default: - yield* this.pop(); - yield* this.pop(token); - } - if ((top.type === "document" || top.type === "block-map" || top.type === "block-seq") && (token.type === "block-map" || token.type === "block-seq")) { - const last = token.items[token.items.length - 1]; - if (last && !last.sep && !last.value && last.start.length > 0 && findNonEmptyIndex(last.start) === -1 && (token.indent === 0 || last.start.every((st) => st.type !== "comment" || st.indent < token.indent))) { - if (top.type === "document") top.end = last.start; - else top.items.push({ start: last.start }); - token.items.splice(-1, 1); - } - } - } - } - *stream() { - switch (this.type) { - case "directive-line": - yield { - type: "directive", - offset: this.offset, - source: this.source - }; - return; - case "byte-order-mark": - case "space": - case "comment": - case "newline": - yield this.sourceToken; - return; - case "doc-mode": - case "doc-start": { - const doc = { - type: "document", - offset: this.offset, - start: [] - }; - if (this.type === "doc-start") doc.start.push(this.sourceToken); - this.stack.push(doc); - return; - } - } - yield { - type: "error", - offset: this.offset, - message: `Unexpected ${this.type} token in YAML stream`, - source: this.source - }; - } - *document(doc) { - if (doc.value) return yield* this.lineEnd(doc); - switch (this.type) { - case "doc-start": - if (findNonEmptyIndex(doc.start) !== -1) { - yield* this.pop(); - yield* this.step(); - } else doc.start.push(this.sourceToken); - return; - case "anchor": - case "tag": - case "space": - case "comment": - case "newline": - doc.start.push(this.sourceToken); - return; - } - const bv = this.startBlockValue(doc); - if (bv) this.stack.push(bv); - else yield { - type: "error", - offset: this.offset, - message: `Unexpected ${this.type} token in YAML document`, - source: this.source - }; - } - *scalar(scalar) { - if (this.type === "map-value-ind") { - const start = getFirstKeyStartProps(getPrevProps(this.peek(2))); - let sep; - if (scalar.end) { - sep = scalar.end; - sep.push(this.sourceToken); - delete scalar.end; - } else sep = [this.sourceToken]; - const map = { - type: "block-map", - offset: scalar.offset, - indent: scalar.indent, - items: [{ - start, - key: scalar, - sep - }] - }; - this.onKeyLine = true; - this.stack[this.stack.length - 1] = map; - } else yield* this.lineEnd(scalar); - } - *blockScalar(scalar) { - switch (this.type) { - case "space": - case "comment": - case "newline": - scalar.props.push(this.sourceToken); - return; - case "scalar": - scalar.source = this.source; - this.atNewLine = true; - this.indent = 0; - if (this.onNewLine) { - let nl = this.source.indexOf("\n") + 1; - while (nl !== 0) { - this.onNewLine(this.offset + nl); - nl = this.source.indexOf("\n", nl) + 1; - } - } - yield* this.pop(); - break; - /* istanbul ignore next should not happen */ - default: - yield* this.pop(); - yield* this.step(); - } - } - *blockMap(map) { - const it = map.items[map.items.length - 1]; - switch (this.type) { - case "newline": - this.onKeyLine = false; - if (it.value) { - const end = "end" in it.value ? it.value.end : void 0; - if ((Array.isArray(end) ? end[end.length - 1] : void 0)?.type === "comment") end?.push(this.sourceToken); - else map.items.push({ start: [this.sourceToken] }); - } else if (it.sep) it.sep.push(this.sourceToken); - else it.start.push(this.sourceToken); - return; - case "space": - case "comment": - if (it.value) map.items.push({ start: [this.sourceToken] }); - else if (it.sep) it.sep.push(this.sourceToken); - else { - if (this.atIndentedComment(it.start, map.indent)) { - const end = map.items[map.items.length - 2]?.value?.end; - if (Array.isArray(end)) { - Array.prototype.push.apply(end, it.start); - end.push(this.sourceToken); - map.items.pop(); - return; - } - } - it.start.push(this.sourceToken); - } - return; - } - if (this.indent >= map.indent) { - const atMapIndent = !this.onKeyLine && this.indent === map.indent; - const atNextItem = atMapIndent && (it.sep || it.explicitKey) && this.type !== "seq-item-ind"; - let start = []; - if (atNextItem && it.sep && !it.value) { - const nl = []; - for (let i = 0; i < it.sep.length; ++i) { - const st = it.sep[i]; - switch (st.type) { - case "newline": - nl.push(i); - break; - case "space": break; - case "comment": - if (st.indent > map.indent) nl.length = 0; - break; - default: nl.length = 0; - } - } - if (nl.length >= 2) start = it.sep.splice(nl[1]); - } - switch (this.type) { - case "anchor": - case "tag": - if (atNextItem || it.value) { - start.push(this.sourceToken); - map.items.push({ start }); - this.onKeyLine = true; - } else if (it.sep) it.sep.push(this.sourceToken); - else it.start.push(this.sourceToken); - return; - case "explicit-key-ind": - if (!it.sep && !it.explicitKey) { - it.start.push(this.sourceToken); - it.explicitKey = true; - } else if (atNextItem || it.value) { - start.push(this.sourceToken); - map.items.push({ - start, - explicitKey: true - }); - } else this.stack.push({ - type: "block-map", - offset: this.offset, - indent: this.indent, - items: [{ - start: [this.sourceToken], - explicitKey: true - }] - }); - this.onKeyLine = true; - return; - case "map-value-ind": - if (it.explicitKey) if (!it.sep) if (includesToken(it.start, "newline")) Object.assign(it, { - key: null, - sep: [this.sourceToken] - }); - else { - const start = getFirstKeyStartProps(it.start); - this.stack.push({ - type: "block-map", - offset: this.offset, - indent: this.indent, - items: [{ - start, - key: null, - sep: [this.sourceToken] - }] - }); - } - else if (it.value) map.items.push({ - start: [], - key: null, - sep: [this.sourceToken] - }); - else if (includesToken(it.sep, "map-value-ind")) this.stack.push({ - type: "block-map", - offset: this.offset, - indent: this.indent, - items: [{ - start, - key: null, - sep: [this.sourceToken] - }] - }); - else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) { - const start = getFirstKeyStartProps(it.start); - const key = it.key; - const sep = it.sep; - sep.push(this.sourceToken); - delete it.key; - delete it.sep; - this.stack.push({ - type: "block-map", - offset: this.offset, - indent: this.indent, - items: [{ - start, - key, - sep - }] - }); - } else if (start.length > 0) it.sep = it.sep.concat(start, this.sourceToken); - else it.sep.push(this.sourceToken); - else if (!it.sep) Object.assign(it, { - key: null, - sep: [this.sourceToken] - }); - else if (it.value || atNextItem) map.items.push({ - start, - key: null, - sep: [this.sourceToken] - }); - else if (includesToken(it.sep, "map-value-ind")) this.stack.push({ - type: "block-map", - offset: this.offset, - indent: this.indent, - items: [{ - start: [], - key: null, - sep: [this.sourceToken] - }] - }); - else it.sep.push(this.sourceToken); - this.onKeyLine = true; - return; - case "alias": - case "scalar": - case "single-quoted-scalar": - case "double-quoted-scalar": { - const fs = this.flowScalar(this.type); - if (atNextItem || it.value) { - map.items.push({ - start, - key: fs, - sep: [] - }); - this.onKeyLine = true; - } else if (it.sep) this.stack.push(fs); - else { - Object.assign(it, { - key: fs, - sep: [] - }); - this.onKeyLine = true; - } - return; - } - default: { - const bv = this.startBlockValue(map); - if (bv) { - if (bv.type === "block-seq") { - if (!it.explicitKey && it.sep && !includesToken(it.sep, "newline")) { - yield* this.pop({ - type: "error", - offset: this.offset, - message: "Unexpected block-seq-ind on same line with key", - source: this.source - }); - return; - } - } else if (atMapIndent) map.items.push({ start }); - this.stack.push(bv); - return; - } - } - } - } - yield* this.pop(); - yield* this.step(); - } - *blockSequence(seq) { - const it = seq.items[seq.items.length - 1]; - switch (this.type) { - case "newline": - if (it.value) { - const end = "end" in it.value ? it.value.end : void 0; - if ((Array.isArray(end) ? end[end.length - 1] : void 0)?.type === "comment") end?.push(this.sourceToken); - else seq.items.push({ start: [this.sourceToken] }); - } else it.start.push(this.sourceToken); - return; - case "space": - case "comment": - if (it.value) seq.items.push({ start: [this.sourceToken] }); - else { - if (this.atIndentedComment(it.start, seq.indent)) { - const end = seq.items[seq.items.length - 2]?.value?.end; - if (Array.isArray(end)) { - Array.prototype.push.apply(end, it.start); - end.push(this.sourceToken); - seq.items.pop(); - return; - } - } - it.start.push(this.sourceToken); - } - return; - case "anchor": - case "tag": - if (it.value || this.indent <= seq.indent) break; - it.start.push(this.sourceToken); - return; - case "seq-item-ind": - if (this.indent !== seq.indent) break; - if (it.value || includesToken(it.start, "seq-item-ind")) seq.items.push({ start: [this.sourceToken] }); - else it.start.push(this.sourceToken); - return; - } - if (this.indent > seq.indent) { - const bv = this.startBlockValue(seq); - if (bv) { - this.stack.push(bv); - return; - } - } - yield* this.pop(); - yield* this.step(); - } - *flowCollection(fc) { - const it = fc.items[fc.items.length - 1]; - if (this.type === "flow-error-end") { - let top; - do { - yield* this.pop(); - top = this.peek(1); - } while (top?.type === "flow-collection"); - } else if (fc.end.length === 0) { - switch (this.type) { - case "comma": - case "explicit-key-ind": - if (!it || it.sep) fc.items.push({ start: [this.sourceToken] }); - else it.start.push(this.sourceToken); - return; - case "map-value-ind": - if (!it || it.value) fc.items.push({ - start: [], - key: null, - sep: [this.sourceToken] - }); - else if (it.sep) it.sep.push(this.sourceToken); - else Object.assign(it, { - key: null, - sep: [this.sourceToken] - }); - return; - case "space": - case "comment": - case "newline": - case "anchor": - case "tag": - if (!it || it.value) fc.items.push({ start: [this.sourceToken] }); - else if (it.sep) it.sep.push(this.sourceToken); - else it.start.push(this.sourceToken); - return; - case "alias": - case "scalar": - case "single-quoted-scalar": - case "double-quoted-scalar": { - const fs = this.flowScalar(this.type); - if (!it || it.value) fc.items.push({ - start: [], - key: fs, - sep: [] - }); - else if (it.sep) this.stack.push(fs); - else Object.assign(it, { - key: fs, - sep: [] - }); - return; - } - case "flow-map-end": - case "flow-seq-end": - fc.end.push(this.sourceToken); - return; - } - const bv = this.startBlockValue(fc); - /* istanbul ignore else should not happen */ - if (bv) this.stack.push(bv); - else { - yield* this.pop(); - yield* this.step(); - } - } else { - const parent = this.peek(2); - if (parent.type === "block-map" && (this.type === "map-value-ind" && parent.indent === fc.indent || this.type === "newline" && !parent.items[parent.items.length - 1].sep)) { - yield* this.pop(); - yield* this.step(); - } else if (this.type === "map-value-ind" && parent.type !== "flow-collection") { - const start = getFirstKeyStartProps(getPrevProps(parent)); - fixFlowSeqItems(fc); - const sep = fc.end.splice(1, fc.end.length); - sep.push(this.sourceToken); - const map = { - type: "block-map", - offset: fc.offset, - indent: fc.indent, - items: [{ - start, - key: fc, - sep - }] - }; - this.onKeyLine = true; - this.stack[this.stack.length - 1] = map; - } else yield* this.lineEnd(fc); - } - } - flowScalar(type) { - if (this.onNewLine) { - let nl = this.source.indexOf("\n") + 1; - while (nl !== 0) { - this.onNewLine(this.offset + nl); - nl = this.source.indexOf("\n", nl) + 1; - } - } - return { - type, - offset: this.offset, - indent: this.indent, - source: this.source - }; - } - startBlockValue(parent) { - switch (this.type) { - case "alias": - case "scalar": - case "single-quoted-scalar": - case "double-quoted-scalar": return this.flowScalar(this.type); - case "block-scalar-header": return { - type: "block-scalar", - offset: this.offset, - indent: this.indent, - props: [this.sourceToken], - source: "" - }; - case "flow-map-start": - case "flow-seq-start": return { - type: "flow-collection", - offset: this.offset, - indent: this.indent, - start: this.sourceToken, - items: [], - end: [] - }; - case "seq-item-ind": return { - type: "block-seq", - offset: this.offset, - indent: this.indent, - items: [{ start: [this.sourceToken] }] - }; - case "explicit-key-ind": { - this.onKeyLine = true; - const start = getFirstKeyStartProps(getPrevProps(parent)); - start.push(this.sourceToken); - return { - type: "block-map", - offset: this.offset, - indent: this.indent, - items: [{ - start, - explicitKey: true - }] - }; - } - case "map-value-ind": { - this.onKeyLine = true; - const start = getFirstKeyStartProps(getPrevProps(parent)); - return { - type: "block-map", - offset: this.offset, - indent: this.indent, - items: [{ - start, - key: null, - sep: [this.sourceToken] - }] - }; - } - } - return null; - } - atIndentedComment(start, indent) { - if (this.type !== "comment") return false; - if (this.indent <= indent) return false; - return start.every((st) => st.type === "newline" || st.type === "space"); - } - *documentEnd(docEnd) { - if (this.type !== "doc-mode") { - if (docEnd.end) docEnd.end.push(this.sourceToken); - else docEnd.end = [this.sourceToken]; - if (this.type === "newline") yield* this.pop(); - } - } - *lineEnd(token) { - switch (this.type) { - case "comma": - case "doc-start": - case "doc-end": - case "flow-seq-end": - case "flow-map-end": - case "map-value-ind": - yield* this.pop(); - yield* this.step(); - break; - case "newline": this.onKeyLine = false; - default: - if (token.end) token.end.push(this.sourceToken); - else token.end = [this.sourceToken]; - if (this.type === "newline") yield* this.pop(); - } - } - }; - exports.Parser = Parser; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/public-api.js -var require_public_api = /* @__PURE__ */ __commonJSMin(((exports) => { - var composer = require_composer(); - var Document = require_Document(); - var errors = require_errors(); - var log = require_log(); - var identity = require_identity(); - var lineCounter = require_line_counter(); - var parser = require_parser(); - function parseOptions(options) { - const prettyErrors = options.prettyErrors !== false; - return { - lineCounter: options.lineCounter || prettyErrors && new lineCounter.LineCounter() || null, - prettyErrors - }; - } - /** - * Parse the input as a stream of YAML documents. - * - * Documents should be separated from each other by `...` or `---` marker lines. - * - * @returns If an empty `docs` array is returned, it will be of type - * EmptyStream and contain additional stream information. In - * TypeScript, you should use `'empty' in docs` as a type guard for it. - */ - function parseAllDocuments(source, options = {}) { - const { lineCounter, prettyErrors } = parseOptions(options); - const parser$1 = new parser.Parser(lineCounter?.addNewLine); - const composer$1 = new composer.Composer(options); - const docs = Array.from(composer$1.compose(parser$1.parse(source))); - if (prettyErrors && lineCounter) for (const doc of docs) { - doc.errors.forEach(errors.prettifyError(source, lineCounter)); - doc.warnings.forEach(errors.prettifyError(source, lineCounter)); - } - if (docs.length > 0) return docs; - return Object.assign([], { empty: true }, composer$1.streamInfo()); - } - /** Parse an input string into a single YAML.Document */ - function parseDocument(source, options = {}) { - const { lineCounter, prettyErrors } = parseOptions(options); - const parser$1 = new parser.Parser(lineCounter?.addNewLine); - const composer$1 = new composer.Composer(options); - let doc = null; - for (const _doc of composer$1.compose(parser$1.parse(source), true, source.length)) if (!doc) doc = _doc; - else if (doc.options.logLevel !== "silent") { - doc.errors.push(new errors.YAMLParseError(_doc.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()")); - break; - } - if (prettyErrors && lineCounter) { - doc.errors.forEach(errors.prettifyError(source, lineCounter)); - doc.warnings.forEach(errors.prettifyError(source, lineCounter)); - } - return doc; - } - function parse(src, reviver, options) { - let _reviver = void 0; - if (typeof reviver === "function") _reviver = reviver; - else if (options === void 0 && reviver && typeof reviver === "object") options = reviver; - const doc = parseDocument(src, options); - if (!doc) return null; - doc.warnings.forEach((warning) => log.warn(doc.options.logLevel, warning)); - if (doc.errors.length > 0) if (doc.options.logLevel !== "silent") throw doc.errors[0]; - else doc.errors = []; - return doc.toJS(Object.assign({ reviver: _reviver }, options)); - } - function stringify(value, replacer, options) { - let _replacer = null; - if (typeof replacer === "function" || Array.isArray(replacer)) _replacer = replacer; - else if (options === void 0 && replacer) options = replacer; - if (typeof options === "string") options = options.length; - if (typeof options === "number") { - const indent = Math.round(options); - options = indent < 1 ? void 0 : indent > 8 ? { indent: 8 } : { indent }; - } - if (value === void 0) { - const { keepUndefined } = options ?? replacer ?? {}; - if (!keepUndefined) return void 0; - } - if (identity.isDocument(value) && !_replacer) return value.toString(options); - return new Document.Document(value, _replacer, options).toString(options); - } - exports.parse = parse; - exports.parseAllDocuments = parseAllDocuments; - exports.parseDocument = parseDocument; - exports.stringify = stringify; -})); -//#endregion -//#region ../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/index.js -var require_dist$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - var composer = require_composer(); - var Document = require_Document(); - var Schema = require_Schema(); - var errors = require_errors(); - var Alias = require_Alias(); - var identity = require_identity(); - var Pair = require_Pair(); - var Scalar = require_Scalar(); - var YAMLMap = require_YAMLMap(); - var YAMLSeq = require_YAMLSeq(); - var cst = require_cst(); - var lexer = require_lexer(); - var lineCounter = require_line_counter(); - var parser = require_parser(); - var publicApi = require_public_api(); - var visit = require_visit(); - exports.Composer = composer.Composer; - exports.Document = Document.Document; - exports.Schema = Schema.Schema; - exports.YAMLError = errors.YAMLError; - exports.YAMLParseError = errors.YAMLParseError; - exports.YAMLWarning = errors.YAMLWarning; - exports.Alias = Alias.Alias; - exports.isAlias = identity.isAlias; - exports.isCollection = identity.isCollection; - exports.isDocument = identity.isDocument; - exports.isMap = identity.isMap; - exports.isNode = identity.isNode; - exports.isPair = identity.isPair; - exports.isScalar = identity.isScalar; - exports.isSeq = identity.isSeq; - exports.Pair = Pair.Pair; - exports.Scalar = Scalar.Scalar; - exports.YAMLMap = YAMLMap.YAMLMap; - exports.YAMLSeq = YAMLSeq.YAMLSeq; - exports.CST = cst; - exports.Lexer = lexer.Lexer; - exports.LineCounter = lineCounter.LineCounter; - exports.Parser = parser.Parser; - exports.parse = publicApi.parse; - exports.parseAllDocuments = publicApi.parseAllDocuments; - exports.parseDocument = publicApi.parseDocument; - exports.stringify = publicApi.stringify; - exports.visit = visit.visit; - exports.visitAsync = visit.visitAsync; -})); -//#endregion -//#region ../../node_modules/.pnpm/@pnpm+yaml.document-sync@1000.0.0/node_modules/@pnpm/yaml.document-sync/lib/patchDocument.js -var require_patchDocument = /* @__PURE__ */ __commonJSMin(((exports) => { - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.patchDocument = patchDocument; - const yaml_1 = __importDefault(require_dist$1()); - /** - * Recursively update a YAML document (in-place) to match the contents of a - * target value. - * - * Comments are preserved on a best-effort basis. There are several cases where - * ambiguity arises. See this package's README.md for details. - */ - function patchDocument(document, target, options) { - if (document.errors.length > 0) throw new Error("Document with errors cannot be patched"); - document.contents = patchNode(document.contents, target, { - document, - aliases: options?.aliases ?? "unwrap" - }); - } - function patchNode(node, target, ctx) { - if (node == null) return ctx.document.createNode(target); - if (target == null) return null; - if (yaml_1.default.isAlias(node)) return patchAlias(node, target, ctx); - if (yaml_1.default.isScalar(node)) return patchScalar(node, target, ctx); - if (yaml_1.default.isMap(node)) return patchMap(node, target, ctx); - if (yaml_1.default.isSeq(node)) return patchSeq(node, target, ctx); - throw new Error("Unrecognized yaml node: " + String(node)); - } - function patchAlias(alias, target, ctx) { - const resolved = alias.resolve(ctx.document); - if (resolved == null) throw new Error("Failed to resolve yaml alias: " + alias.source); - switch (ctx.aliases) { - case "follow": - patchNode(resolved, target, ctx); - return alias; - case "unwrap": { - const copy = resolved.clone(); - copy.anchor = void 0; - patchNode(copy, target, ctx); - return copy; - } - } - } - function patchScalar(scalar, target, ctx) { - if (scalar.value === target) return scalar; - if (typeof target === "boolean" || typeof target === "string" || typeof target === "number") { - scalar.value = target; - return scalar; - } - return ctx.document.createNode(target); - } - function patchMap(map, target, ctx) { - if (!isRecord(target)) return ctx.document.createNode(target); - if (target == null || Object.keys(target).length === 0) return null; - const mapKeyToExistingPair = /* @__PURE__ */ new Map(); - for (const pair of map.items) { - if (!yaml_1.default.isScalar(pair.key) || typeof pair.key.value !== "string") throw new Error("Encountered unexpected non-node value: " + String(pair.key)); - mapKeyToExistingPair.set(pair.key.value, pair); - } - map.items = Object.entries(target).map(([key, value]) => { - const existingPair = mapKeyToExistingPair.get(key); - if (existingPair == null) return ctx.document.createPair(key, value); - if (!yaml_1.default.isNode(existingPair.value)) throw new Error("Encountered unexpected non-node value: " + String(existingPair.value)); - existingPair.value = patchNode(existingPair.value, value, ctx); - return existingPair; - }).filter((pair) => pair.value != null); - return map; - } - function patchSeq(seq, target, ctx) { - if (!Array.isArray(target)) return ctx.document.createNode(target); - return isPrimitiveList(target) ? patchSeqPrimitive(seq, target) : patchSeqComplex(seq, target, ctx); - } - function patchSeqPrimitive(seq, target) { - const valueToNodesMap = /* @__PURE__ */ new Map(); - for (const item of seq.items) { - if (item != null && !yaml_1.default.isNode(item)) throw new Error("Encountered unexpected non-node value: " + String(item)); - if (!yaml_1.default.isScalar(item) || !isPrimitive(item.value) || item.value == null) continue; - const nodeList = valueToNodesMap.get(item.value) ?? []; - nodeList.push(item); - valueToNodesMap.set(item.value, nodeList); - } - seq.items = target.filter((item) => item != null).map((item) => { - const existingNodesList = valueToNodesMap.get(item); - const firstExistingItem = existingNodesList?.shift(); - if (existingNodesList?.length === 0) valueToNodesMap.delete(item); - return firstExistingItem ?? new yaml_1.default.Scalar(item); - }); - return seq; - } - function patchSeqComplex(seq, target, ctx) { - const nextItems = []; - for (let i = 0; i < Math.max(seq.items.length, target.length); i++) { - const existingItem = seq.items[i]; - const targetItem = target[i]; - if (existingItem != null && !yaml_1.default.isNode(existingItem)) throw new Error("Encountered unexpected non-node value: " + String(existingItem)); - const nextItem = patchNode(existingItem, targetItem, ctx); - if (nextItem == null) continue; - nextItems.push(nextItem); - } - seq.items = nextItems; - return seq; - } - function isRecord(value) { - return value != null && typeof value === "object" && !Array.isArray(value); - } - function isPrimitiveList(arr) { - return arr.every(isPrimitive); - } - function isPrimitive(value) { - return value == null || typeof value === "boolean" || typeof value === "string" || typeof value === "number"; - } -})); -//#endregion -//#region ../../node_modules/.pnpm/@pnpm+yaml.document-sync@1000.0.0/node_modules/@pnpm/yaml.document-sync/lib/index.js -var require_lib$3 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.patchDocument = void 0; - var patchDocument_js_1 = require_patchDocument(); - Object.defineProperty(exports, "patchDocument", { - enumerable: true, - get: function() { - return patchDocument_js_1.patchDocument; - } - }); -})); -//#endregion -//#region ../../node_modules/.pnpm/@pnpm+ramda@0.28.1/node_modules/@pnpm/ramda/src/internal/_isPlaceholder.js -var require__isPlaceholder = /* @__PURE__ */ __commonJSMin(((exports, module) => { - function _isPlaceholder(a) { - return a != null && typeof a === "object" && a["@@functional/placeholder"] === true; - } - module.exports = _isPlaceholder; -})); -//#endregion -//#region ../../node_modules/.pnpm/@pnpm+ramda@0.28.1/node_modules/@pnpm/ramda/src/internal/_curry1.js -var require__curry1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { - var _isPlaceholder = require__isPlaceholder(); - /** - * Optimized internal one-arity curry function. - * - * @private - * @category Function - * @param {Function} fn The function to curry. - * @return {Function} The curried function. - */ - function _curry1(fn) { - return function f1(a) { - if (arguments.length === 0 || _isPlaceholder(a)) return f1; - else return fn.apply(this, arguments); - }; - } - module.exports = _curry1; -})); -//#endregion -//#region ../../node_modules/.pnpm/@pnpm+ramda@0.28.1/node_modules/@pnpm/ramda/src/internal/_curry2.js -var require__curry2 = /* @__PURE__ */ __commonJSMin(((exports, module) => { - var _curry1 = require__curry1(); - var _isPlaceholder = require__isPlaceholder(); - /** - * Optimized internal two-arity curry function. - * - * @private - * @category Function - * @param {Function} fn The function to curry. - * @return {Function} The curried function. - */ - function _curry2(fn) { - return function f2(a, b) { - switch (arguments.length) { - case 0: return f2; - case 1: return _isPlaceholder(a) ? f2 : _curry1(function(_b) { - return fn(a, _b); - }); - default: return _isPlaceholder(a) && _isPlaceholder(b) ? f2 : _isPlaceholder(a) ? _curry1(function(_a) { - return fn(_a, b); - }) : _isPlaceholder(b) ? _curry1(function(_b) { - return fn(a, _b); - }) : fn(a, b); - } - }; - } - module.exports = _curry2; -})); -//#endregion -//#region ../../node_modules/.pnpm/@pnpm+ramda@0.28.1/node_modules/@pnpm/ramda/src/internal/_arrayFromIterator.js -var require__arrayFromIterator = /* @__PURE__ */ __commonJSMin(((exports, module) => { - function _arrayFromIterator(iter) { - var list = []; - var next; - while (!(next = iter.next()).done) list.push(next.value); - return list; - } - module.exports = _arrayFromIterator; -})); -//#endregion -//#region ../../node_modules/.pnpm/@pnpm+ramda@0.28.1/node_modules/@pnpm/ramda/src/internal/_includesWith.js -var require__includesWith = /* @__PURE__ */ __commonJSMin(((exports, module) => { - function _includesWith(pred, x, list) { - var idx = 0; - var len = list.length; - while (idx < len) { - if (pred(x, list[idx])) return true; - idx += 1; - } - return false; - } - module.exports = _includesWith; -})); -//#endregion -//#region ../../node_modules/.pnpm/@pnpm+ramda@0.28.1/node_modules/@pnpm/ramda/src/internal/_functionName.js -var require__functionName = /* @__PURE__ */ __commonJSMin(((exports, module) => { - function _functionName(f) { - var match = String(f).match(/^function (\w*)/); - return match == null ? "" : match[1]; - } - module.exports = _functionName; -})); -//#endregion -//#region ../../node_modules/.pnpm/@pnpm+ramda@0.28.1/node_modules/@pnpm/ramda/src/internal/_has.js -var require__has = /* @__PURE__ */ __commonJSMin(((exports, module) => { - function _has(prop, obj) { - return Object.prototype.hasOwnProperty.call(obj, prop); - } - module.exports = _has; -})); -//#endregion -//#region ../../node_modules/.pnpm/@pnpm+ramda@0.28.1/node_modules/@pnpm/ramda/src/internal/_objectIs.js -var require__objectIs = /* @__PURE__ */ __commonJSMin(((exports, module) => { - function _objectIs(a, b) { - if (a === b) return a !== 0 || 1 / a === 1 / b; - else return a !== a && b !== b; - } - module.exports = typeof Object.is === "function" ? Object.is : _objectIs; -})); -//#endregion -//#region ../../node_modules/.pnpm/@pnpm+ramda@0.28.1/node_modules/@pnpm/ramda/src/internal/_isArguments.js -var require__isArguments = /* @__PURE__ */ __commonJSMin(((exports, module) => { - var _has = require__has(); - var toString = Object.prototype.toString; - module.exports = /* @__PURE__ */ function() { - return toString.call(arguments) === "[object Arguments]" ? function _isArguments(x) { - return toString.call(x) === "[object Arguments]"; - } : function _isArguments(x) { - return _has("callee", x); - }; - }(); -})); -//#endregion -//#region ../../node_modules/.pnpm/@pnpm+ramda@0.28.1/node_modules/@pnpm/ramda/src/keys.js -var require_keys = /* @__PURE__ */ __commonJSMin(((exports, module) => { - var _curry1 = require__curry1(); - var _has = require__has(); - var _isArguments = require__isArguments(); - var hasEnumBug = !/* @__PURE__ */ { toString: null }.propertyIsEnumerable("toString"); - var nonEnumerableProps = [ - "constructor", - "valueOf", - "isPrototypeOf", - "toString", - "propertyIsEnumerable", - "hasOwnProperty", - "toLocaleString" - ]; - var hasArgsEnumBug = /* @__PURE__ */ function() { - "use strict"; - return arguments.propertyIsEnumerable("length"); - }(); - var contains = function contains(list, item) { - var idx = 0; - while (idx < list.length) { - if (list[idx] === item) return true; - idx += 1; - } - return false; - }; - module.exports = typeof Object.keys === "function" && !hasArgsEnumBug ? /* @__PURE__ */ _curry1(function keys(obj) { - return Object(obj) !== obj ? [] : Object.keys(obj); - }) : /* @__PURE__ */ _curry1(function keys(obj) { - if (Object(obj) !== obj) return []; - var prop, nIdx; - var ks = []; - var checkArgsLength = hasArgsEnumBug && _isArguments(obj); - for (prop in obj) if (_has(prop, obj) && (!checkArgsLength || prop !== "length")) ks[ks.length] = prop; - if (hasEnumBug) { - nIdx = nonEnumerableProps.length - 1; - while (nIdx >= 0) { - prop = nonEnumerableProps[nIdx]; - if (_has(prop, obj) && !contains(ks, prop)) ks[ks.length] = prop; - nIdx -= 1; - } - } - return ks; - }); -})); -//#endregion -//#region ../../node_modules/.pnpm/@pnpm+ramda@0.28.1/node_modules/@pnpm/ramda/src/type.js -var require_type = /* @__PURE__ */ __commonJSMin(((exports, module) => { - module.exports = /* @__PURE__ */ require__curry1()(function type(val) { - return val === null ? "Null" : val === void 0 ? "Undefined" : Object.prototype.toString.call(val).slice(8, -1); - }); -})); -//#endregion -//#region ../../node_modules/.pnpm/@pnpm+ramda@0.28.1/node_modules/@pnpm/ramda/src/internal/_equals.js -var require__equals = /* @__PURE__ */ __commonJSMin(((exports, module) => { - var _arrayFromIterator = require__arrayFromIterator(); - var _includesWith = require__includesWith(); - var _functionName = require__functionName(); - var _has = require__has(); - var _objectIs = require__objectIs(); - var keys = require_keys(); - var type = require_type(); - /** - * private _uniqContentEquals function. - * That function is checking equality of 2 iterator contents with 2 assumptions - * - iterators lengths are the same - * - iterators values are unique - * - * false-positive result will be returned for comparison of, e.g. - * - [1,2,3] and [1,2,3,4] - * - [1,1,1] and [1,2,3] - * */ - function _uniqContentEquals(aIterator, bIterator, stackA, stackB) { - var a = _arrayFromIterator(aIterator); - var b = _arrayFromIterator(bIterator); - function eq(_a, _b) { - return _equals(_a, _b, stackA.slice(), stackB.slice()); - } - return !_includesWith(function(b, aItem) { - return !_includesWith(eq, aItem, b); - }, b, a); - } - function _equals(a, b, stackA, stackB) { - if (_objectIs(a, b)) return true; - var typeA = type(a); - if (typeA !== type(b)) return false; - if (typeof a["fantasy-land/equals"] === "function" || typeof b["fantasy-land/equals"] === "function") return typeof a["fantasy-land/equals"] === "function" && a["fantasy-land/equals"](b) && typeof b["fantasy-land/equals"] === "function" && b["fantasy-land/equals"](a); - if (typeof a.equals === "function" || typeof b.equals === "function") return typeof a.equals === "function" && a.equals(b) && typeof b.equals === "function" && b.equals(a); - switch (typeA) { - case "Arguments": - case "Array": - case "Object": - if (typeof a.constructor === "function" && _functionName(a.constructor) === "Promise") return a === b; - break; - case "Boolean": - case "Number": - case "String": - if (!(typeof a === typeof b && _objectIs(a.valueOf(), b.valueOf()))) return false; - break; - case "Date": - if (!_objectIs(a.valueOf(), b.valueOf())) return false; - break; - case "Error": return a.name === b.name && a.message === b.message; - case "RegExp": - if (!(a.source === b.source && a.global === b.global && a.ignoreCase === b.ignoreCase && a.multiline === b.multiline && a.sticky === b.sticky && a.unicode === b.unicode)) return false; - break; - } - var idx = stackA.length - 1; - while (idx >= 0) { - if (stackA[idx] === a) return stackB[idx] === b; - idx -= 1; - } - switch (typeA) { - case "Map": - if (a.size !== b.size) return false; - return _uniqContentEquals(a.entries(), b.entries(), stackA.concat([a]), stackB.concat([b])); - case "Set": - if (a.size !== b.size) return false; - return _uniqContentEquals(a.values(), b.values(), stackA.concat([a]), stackB.concat([b])); - case "Arguments": - case "Array": - case "Object": - case "Boolean": - case "Number": - case "String": - case "Date": - case "Error": - case "RegExp": - case "Int8Array": - case "Uint8Array": - case "Uint8ClampedArray": - case "Int16Array": - case "Uint16Array": - case "Int32Array": - case "Uint32Array": - case "Float32Array": - case "Float64Array": - case "ArrayBuffer": break; - default: return false; - } - var keysA = keys(a); - if (keysA.length !== keys(b).length) return false; - var extendedStackA = stackA.concat([a]); - var extendedStackB = stackB.concat([b]); - idx = keysA.length - 1; - while (idx >= 0) { - var key = keysA[idx]; - if (!(_has(key, b) && _equals(b[key], a[key], extendedStackA, extendedStackB))) return false; - idx -= 1; - } - return true; - } - module.exports = _equals; -})); -//#endregion -//#region ../../node_modules/.pnpm/@pnpm+ramda@0.28.1/node_modules/@pnpm/ramda/src/equals.js -var require_equals = /* @__PURE__ */ __commonJSMin(((exports, module) => { - var _curry2 = require__curry2(); - var _equals = require__equals(); - module.exports = /* @__PURE__ */ _curry2(function equals(a, b) { - return _equals(a, b, [], []); - }); -})); -//#endregion -//#region ../../node_modules/.pnpm/tsdown@0.21.10_@typescript+native-preview@7.0.0-dev.20260427.1_synckit@0.11.12_typescript@5.9.3/node_modules/tsdown/esm-shims.js -var getFilename, __filename; -var init_esm_shims = __esmMin((() => { - getFilename = () => fileURLToPath(import.meta.url); - __filename = /* @__PURE__ */ getFilename(); -})); -//#endregion -//#region ../../node_modules/.pnpm/imurmurhash@0.1.4/node_modules/imurmurhash/imurmurhash.js -var require_imurmurhash = /* @__PURE__ */ __commonJSMin(((exports, module) => { - /** - * @preserve - * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013) - * - * @author Jens Taylor - * @see http://github.com/homebrewing/brauhaus-diff - * @author Gary Court - * @see http://github.com/garycourt/murmurhash-js - * @author Austin Appleby - * @see http://sites.google.com/site/murmurhash/ - */ - (function() { - var cache; - function MurmurHash3(key, seed) { - var m = this instanceof MurmurHash3 ? this : cache; - m.reset(seed); - if (typeof key === "string" && key.length > 0) m.hash(key); - if (m !== this) return m; - } - MurmurHash3.prototype.hash = function(key) { - var h1, k1, i, top, len = key.length; - this.len += len; - k1 = this.k1; - i = 0; - switch (this.rem) { - case 0: k1 ^= len > i ? key.charCodeAt(i++) & 65535 : 0; - case 1: k1 ^= len > i ? (key.charCodeAt(i++) & 65535) << 8 : 0; - case 2: k1 ^= len > i ? (key.charCodeAt(i++) & 65535) << 16 : 0; - case 3: - k1 ^= len > i ? (key.charCodeAt(i) & 255) << 24 : 0; - k1 ^= len > i ? (key.charCodeAt(i++) & 65280) >> 8 : 0; - } - this.rem = len + this.rem & 3; - len -= this.rem; - if (len > 0) { - h1 = this.h1; - while (1) { - k1 = k1 * 11601 + (k1 & 65535) * 3432906752 & 4294967295; - k1 = k1 << 15 | k1 >>> 17; - k1 = k1 * 13715 + (k1 & 65535) * 461832192 & 4294967295; - h1 ^= k1; - h1 = h1 << 13 | h1 >>> 19; - h1 = h1 * 5 + 3864292196 & 4294967295; - if (i >= len) break; - k1 = key.charCodeAt(i++) & 65535 ^ (key.charCodeAt(i++) & 65535) << 8 ^ (key.charCodeAt(i++) & 65535) << 16; - top = key.charCodeAt(i++); - k1 ^= (top & 255) << 24 ^ (top & 65280) >> 8; - } - k1 = 0; - switch (this.rem) { - case 3: k1 ^= (key.charCodeAt(i + 2) & 65535) << 16; - case 2: k1 ^= (key.charCodeAt(i + 1) & 65535) << 8; - case 1: k1 ^= key.charCodeAt(i) & 65535; - } - this.h1 = h1; - } - this.k1 = k1; - return this; - }; - MurmurHash3.prototype.result = function() { - var k1 = this.k1, h1 = this.h1; - if (k1 > 0) { - k1 = k1 * 11601 + (k1 & 65535) * 3432906752 & 4294967295; - k1 = k1 << 15 | k1 >>> 17; - k1 = k1 * 13715 + (k1 & 65535) * 461832192 & 4294967295; - h1 ^= k1; - } - h1 ^= this.len; - h1 ^= h1 >>> 16; - h1 = h1 * 51819 + (h1 & 65535) * 2246770688 & 4294967295; - h1 ^= h1 >>> 13; - h1 = h1 * 44597 + (h1 & 65535) * 3266445312 & 4294967295; - h1 ^= h1 >>> 16; - return h1 >>> 0; - }; - MurmurHash3.prototype.reset = function(seed) { - this.h1 = typeof seed === "number" ? seed : 0; - this.rem = this.k1 = this.len = 0; - return this; - }; - cache = new MurmurHash3(); - if (typeof module != "undefined") module.exports = MurmurHash3; - else this.MurmurHash3 = MurmurHash3; - })(); -})); -//#endregion -//#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/cjs/signals.js -var require_signals = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.signals = void 0; - /** - * This is not the set of all possible signals. - * - * It IS, however, the set of all signals that trigger - * an exit on either Linux or BSD systems. Linux is a - * superset of the signal names supported on BSD, and - * the unknown signals just fail to register, so we can - * catch that easily enough. - * - * Windows signals are a different set, since there are - * signals that terminate Windows processes, but don't - * terminate (or don't even exist) on Posix systems. - * - * Don't bother with SIGKILL. It's uncatchable, which - * means that we can't fire any callbacks anyway. - * - * If a user does happen to register a handler on a non- - * fatal signal like SIGWINCH or something, and then - * exit, it'll end up firing `process.emit('exit')`, so - * the handler will be fired anyway. - * - * SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised - * artificially, inherently leave the process in a - * state from which it is not safe to try and enter JS - * listeners. - */ - exports.signals = []; - exports.signals.push("SIGHUP", "SIGINT", "SIGTERM"); - if (process.platform !== "win32") exports.signals.push("SIGALRM", "SIGABRT", "SIGVTALRM", "SIGXCPU", "SIGXFSZ", "SIGUSR2", "SIGTRAP", "SIGSYS", "SIGQUIT", "SIGIOT"); - if (process.platform === "linux") exports.signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT"); -})); -//#endregion -//#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/cjs/index.js -var require_cjs = /* @__PURE__ */ __commonJSMin(((exports) => { - var _a; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.unload = exports.load = exports.onExit = exports.signals = void 0; - const signals_js_1 = require_signals(); - Object.defineProperty(exports, "signals", { - enumerable: true, - get: function() { - return signals_js_1.signals; - } - }); - const processOk = (process) => !!process && typeof process === "object" && typeof process.removeListener === "function" && typeof process.emit === "function" && typeof process.reallyExit === "function" && typeof process.listeners === "function" && typeof process.kill === "function" && typeof process.pid === "number" && typeof process.on === "function"; - const kExitEmitter = Symbol.for("signal-exit emitter"); - const global = globalThis; - const ObjectDefineProperty = Object.defineProperty.bind(Object); - var Emitter = class { - emitted = { - afterExit: false, - exit: false - }; - listeners = { - afterExit: [], - exit: [] - }; - count = 0; - id = Math.random(); - constructor() { - if (global[kExitEmitter]) return global[kExitEmitter]; - ObjectDefineProperty(global, kExitEmitter, { - value: this, - writable: false, - enumerable: false, - configurable: false - }); - } - on(ev, fn) { - this.listeners[ev].push(fn); - } - removeListener(ev, fn) { - const list = this.listeners[ev]; - const i = list.indexOf(fn); - /* c8 ignore start */ - if (i === -1) return; - /* c8 ignore stop */ - if (i === 0 && list.length === 1) list.length = 0; - else list.splice(i, 1); - } - emit(ev, code, signal) { - if (this.emitted[ev]) return false; - this.emitted[ev] = true; - let ret = false; - for (const fn of this.listeners[ev]) ret = fn(code, signal) === true || ret; - if (ev === "exit") ret = this.emit("afterExit", code, signal) || ret; - return ret; - } - }; - var SignalExitBase = class {}; - const signalExitWrap = (handler) => { - return { - onExit(cb, opts) { - return handler.onExit(cb, opts); - }, - load() { - return handler.load(); - }, - unload() { - return handler.unload(); - } - }; - }; - var SignalExitFallback = class extends SignalExitBase { - onExit() { - return () => {}; - } - load() {} - unload() {} - }; - var SignalExit = class extends SignalExitBase { - /* c8 ignore start */ - #hupSig = process.platform === "win32" ? "SIGINT" : "SIGHUP"; - /* c8 ignore stop */ - #emitter = new Emitter(); - #process; - #originalProcessEmit; - #originalProcessReallyExit; - #sigListeners = {}; - #loaded = false; - constructor(process) { - super(); - this.#process = process; - this.#sigListeners = {}; - for (const sig of signals_js_1.signals) this.#sigListeners[sig] = () => { - const listeners = this.#process.listeners(sig); - let { count } = this.#emitter; - /* c8 ignore start */ - const p = process; - if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") count += p.__signal_exit_emitter__.count; - /* c8 ignore stop */ - if (listeners.length === count) { - this.unload(); - const ret = this.#emitter.emit("exit", null, sig); - /* c8 ignore start */ - const s = sig === "SIGHUP" ? this.#hupSig : sig; - if (!ret) process.kill(process.pid, s); - } - }; - this.#originalProcessReallyExit = process.reallyExit; - this.#originalProcessEmit = process.emit; - } - onExit(cb, opts) { - /* c8 ignore start */ - if (!processOk(this.#process)) return () => {}; - /* c8 ignore stop */ - if (this.#loaded === false) this.load(); - const ev = opts?.alwaysLast ? "afterExit" : "exit"; - this.#emitter.on(ev, cb); - return () => { - this.#emitter.removeListener(ev, cb); - if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) this.unload(); - }; - } - load() { - if (this.#loaded) return; - this.#loaded = true; - this.#emitter.count += 1; - for (const sig of signals_js_1.signals) try { - const fn = this.#sigListeners[sig]; - if (fn) this.#process.on(sig, fn); - } catch (_) {} - this.#process.emit = (ev, ...a) => { - return this.#processEmit(ev, ...a); - }; - this.#process.reallyExit = (code) => { - return this.#processReallyExit(code); - }; - } - unload() { - if (!this.#loaded) return; - this.#loaded = false; - signals_js_1.signals.forEach((sig) => { - const listener = this.#sigListeners[sig]; - /* c8 ignore start */ - if (!listener) throw new Error("Listener not defined for signal: " + sig); - /* c8 ignore stop */ - try { - this.#process.removeListener(sig, listener); - } catch (_) {} - /* c8 ignore stop */ - }); - this.#process.emit = this.#originalProcessEmit; - this.#process.reallyExit = this.#originalProcessReallyExit; - this.#emitter.count -= 1; - } - #processReallyExit(code) { - /* c8 ignore start */ - if (!processOk(this.#process)) return 0; - this.#process.exitCode = code || 0; - /* c8 ignore stop */ - this.#emitter.emit("exit", this.#process.exitCode, null); - return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode); - } - #processEmit(ev, ...args) { - const og = this.#originalProcessEmit; - if (ev === "exit" && processOk(this.#process)) { - if (typeof args[0] === "number") this.#process.exitCode = args[0]; - /* c8 ignore start */ - const ret = og.call(this.#process, ev, ...args); - /* c8 ignore start */ - this.#emitter.emit("exit", this.#process.exitCode, null); - /* c8 ignore stop */ - return ret; - } else return og.call(this.#process, ev, ...args); - } - }; - const process = globalThis.process; - _a = signalExitWrap(processOk(process) ? new SignalExit(process) : new SignalExitFallback()), exports.onExit = _a.onExit, exports.load = _a.load, exports.unload = _a.unload; -})); -//#endregion -//#region ../../node_modules/.pnpm/write-file-atomic@5.0.1/node_modules/write-file-atomic/lib/index.js -var require_lib$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => { - init_esm_shims(); - module.exports = writeFile; - module.exports.sync = writeFileSync; - module.exports._getTmpname = getTmpname; - module.exports._cleanupOnExit = cleanupOnExit; - const fs = __require("fs"); - const MurmurHash3 = require_imurmurhash(); - const { onExit } = require_cjs(); - const path$1 = __require("path"); - const { promisify } = __require("util"); - const activeFiles = {}; - /* istanbul ignore next */ - const threadId = (function getId() { - try { - return __require("worker_threads").threadId; - } catch (e) { - return 0; - } - })(); - let invocations = 0; - function getTmpname(filename) { - return filename + "." + MurmurHash3(__filename).hash(String(process.pid)).hash(String(threadId)).hash(String(++invocations)).result(); - } - function cleanupOnExit(tmpfile) { - return () => { - try { - fs.unlinkSync(typeof tmpfile === "function" ? tmpfile() : tmpfile); - } catch {} - }; - } - function serializeActiveFile(absoluteName) { - return new Promise((resolve) => { - if (!activeFiles[absoluteName]) activeFiles[absoluteName] = []; - activeFiles[absoluteName].push(resolve); - if (activeFiles[absoluteName].length === 1) resolve(); - }); - } - function isChownErrOk(err) { - if (err.code === "ENOSYS") return true; - if (!process.getuid || process.getuid() !== 0) { - if (err.code === "EINVAL" || err.code === "EPERM") return true; - } - return false; - } - async function writeFileAsync(filename, data, options = {}) { - if (typeof options === "string") options = { encoding: options }; - let fd; - let tmpfile; - /* istanbul ignore next -- The closure only gets called when onExit triggers */ - const removeOnExitHandler = onExit(cleanupOnExit(() => tmpfile)); - const absoluteName = path$1.resolve(filename); - try { - await serializeActiveFile(absoluteName); - const truename = await promisify(fs.realpath)(filename).catch(() => filename); - tmpfile = getTmpname(truename); - if (!options.mode || !options.chown) { - const stats = await promisify(fs.stat)(truename).catch(() => {}); - if (stats) { - if (options.mode == null) options.mode = stats.mode; - if (options.chown == null && process.getuid) options.chown = { - uid: stats.uid, - gid: stats.gid - }; - } - } - fd = await promisify(fs.open)(tmpfile, "w", options.mode); - if (options.tmpfileCreated) await options.tmpfileCreated(tmpfile); - if (ArrayBuffer.isView(data)) await promisify(fs.write)(fd, data, 0, data.length, 0); - else if (data != null) await promisify(fs.write)(fd, String(data), 0, String(options.encoding || "utf8")); - if (options.fsync !== false) await promisify(fs.fsync)(fd); - await promisify(fs.close)(fd); - fd = null; - if (options.chown) await promisify(fs.chown)(tmpfile, options.chown.uid, options.chown.gid).catch((err) => { - if (!isChownErrOk(err)) throw err; - }); - if (options.mode) await promisify(fs.chmod)(tmpfile, options.mode).catch((err) => { - if (!isChownErrOk(err)) throw err; - }); - await promisify(fs.rename)(tmpfile, truename); - } finally { - if (fd) await promisify(fs.close)(fd).catch( - /* istanbul ignore next */ - () => {} - ); - removeOnExitHandler(); - await promisify(fs.unlink)(tmpfile).catch(() => {}); - activeFiles[absoluteName].shift(); - if (activeFiles[absoluteName].length > 0) activeFiles[absoluteName][0](); - else delete activeFiles[absoluteName]; - } - } - async function writeFile(filename, data, options, callback) { - if (options instanceof Function) { - callback = options; - options = {}; - } - const promise = writeFileAsync(filename, data, options); - if (callback) try { - const result = await promise; - return callback(result); - } catch (err) { - return callback(err); - } - return promise; - } - function writeFileSync(filename, data, options) { - if (typeof options === "string") options = { encoding: options }; - else if (!options) options = {}; - try { - filename = fs.realpathSync(filename); - } catch (ex) {} - const tmpfile = getTmpname(filename); - if (!options.mode || !options.chown) try { - const stats = fs.statSync(filename); - options = Object.assign({}, options); - if (!options.mode) options.mode = stats.mode; - if (!options.chown && process.getuid) options.chown = { - uid: stats.uid, - gid: stats.gid - }; - } catch (ex) {} - let fd; - const cleanup = cleanupOnExit(tmpfile); - const removeOnExitHandler = onExit(cleanup); - let threw = true; - try { - fd = fs.openSync(tmpfile, "w", options.mode || 438); - if (options.tmpfileCreated) options.tmpfileCreated(tmpfile); - if (ArrayBuffer.isView(data)) fs.writeSync(fd, data, 0, data.length, 0); - else if (data != null) fs.writeSync(fd, String(data), 0, String(options.encoding || "utf8")); - if (options.fsync !== false) fs.fsyncSync(fd); - fs.closeSync(fd); - fd = null; - if (options.chown) try { - fs.chownSync(tmpfile, options.chown.uid, options.chown.gid); - } catch (err) { - if (!isChownErrOk(err)) throw err; - } - if (options.mode) try { - fs.chmodSync(tmpfile, options.mode); - } catch (err) { - if (!isChownErrOk(err)) throw err; - } - fs.renameSync(tmpfile, filename); - threw = false; - } finally { - if (fd) try { - fs.closeSync(fd); - } catch (ex) {} - removeOnExitHandler(); - if (threw) cleanup(); - } - } -})); -//#endregion -//#region ../../node_modules/.pnpm/@pnpm+util.lex-comparator@3.0.2/node_modules/@pnpm/util.lex-comparator/dist/lex-comparator.js -var require_lex_comparator = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.lexCompare = void 0; - function lexCompare(a, b) { - return a > b ? 1 : a < b ? -1 : 0; - } - exports.lexCompare = lexCompare; -})); -//#endregion -//#region ../../node_modules/.pnpm/@pnpm+util.lex-comparator@3.0.2/node_modules/@pnpm/util.lex-comparator/dist/index.js -var require_dist = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.lexCompare = void 0; - var lex_comparator_1 = require_lex_comparator(); - Object.defineProperty(exports, "lexCompare", { - enumerable: true, - get: function() { - return lex_comparator_1.lexCompare; - } - }); -})); -//#endregion -//#region ../../node_modules/.pnpm/is-plain-obj@2.1.0/node_modules/is-plain-obj/index.js -var require_is_plain_obj = /* @__PURE__ */ __commonJSMin(((exports, module) => { - module.exports = (value) => { - if (Object.prototype.toString.call(value) !== "[object Object]") return false; - const prototype = Object.getPrototypeOf(value); - return prototype === null || prototype === Object.prototype; - }; -})); -//#endregion -//#region ../../node_modules/.pnpm/sort-keys@4.2.0/node_modules/sort-keys/index.js -var require_sort_keys = /* @__PURE__ */ __commonJSMin(((exports, module) => { - const isPlainObject = require_is_plain_obj(); - module.exports = (object, options = {}) => { - if (!isPlainObject(object) && !Array.isArray(object)) throw new TypeError("Expected a plain object or array"); - const { deep } = options; - const seenInput = []; - const seenOutput = []; - const deepSortArray = (array) => { - const seenIndex = seenInput.indexOf(array); - if (seenIndex !== -1) return seenOutput[seenIndex]; - const result = []; - seenInput.push(array); - seenOutput.push(result); - result.push(...array.map((item) => { - if (Array.isArray(item)) return deepSortArray(item); - if (isPlainObject(item)) return sortKeys(item); - return item; - })); - return result; - }; - const sortKeys = (object) => { - const seenIndex = seenInput.indexOf(object); - if (seenIndex !== -1) return seenOutput[seenIndex]; - const result = {}; - const keys = Object.keys(object).sort(options.compare); - seenInput.push(object); - seenOutput.push(result); - for (const key of keys) { - const value = object[key]; - let newValue; - if (deep && Array.isArray(value)) newValue = deepSortArray(value); - else newValue = deep && isPlainObject(value) ? sortKeys(value) : value; - Object.defineProperty(result, key, { - ...Object.getOwnPropertyDescriptor(object, key), - value: newValue - }); - } - return result; - }; - if (Array.isArray(object)) return deep ? deepSortArray(object) : object.slice(); - return sortKeys(object); - }; -})); -//#endregion -//#region ../../node_modules/.pnpm/@pnpm+object.key-sorting@1000.0.1/node_modules/@pnpm/object.key-sorting/lib/index.js -var require_lib$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.sortDirectKeys = sortDirectKeys; - exports.sortDeepKeys = sortDeepKeys; - exports.sortKeysByPriority = sortKeysByPriority; - const util_lex_comparator_1 = require_dist(); - const sort_keys_1 = __importDefault(require_sort_keys()); - function sortDirectKeys(obj) { - return (0, sort_keys_1.default)(obj, { - compare: util_lex_comparator_1.lexCompare, - deep: false - }); - } - function sortDeepKeys(obj) { - return (0, sort_keys_1.default)(obj, { - compare: util_lex_comparator_1.lexCompare, - deep: true - }); - } - function sortKeysByPriority(opts, obj) { - const compare = compareWithPriority.bind(null, opts.priority); - return (0, sort_keys_1.default)(obj, { - compare, - deep: opts.deep - }); - } - function compareWithPriority(priority, left, right) { - const leftPriority = priority[left]; - const rightPriority = priority[right]; - if (leftPriority != null && rightPriority != null) return leftPriority - rightPriority; - if (leftPriority != null) return -1; - if (rightPriority != null) return 1; - return (0, util_lex_comparator_1.lexCompare)(left, right); - } -})); -//#endregion -//#region ../../node_modules/.pnpm/@pnpm+workspace.manifest-writer@1001.3.1/node_modules/@pnpm/workspace.manifest-writer/lib/index.js -var require_lib = /* @__PURE__ */ __commonJSMin(((exports) => { - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - __importDefault(__require("fs")); - __importDefault(__require("path")); - __importDefault(__require("util")); - require_lib$4(); - require_lib$6(); - require_lib$3(); - __importDefault(require_equals()); - __importDefault(require_dist$1()); - __importDefault(require_lib$2()); - require_lib$1(); -})); -require_lib$4(); -require_lib(); +//#region ../utils/constants.ts const GIT_CONFIG = { USER_NAME: "tdesign-bot", USER_EMAIL: "tdesign@tencent.com" diff --git a/packages/upgrade-deps/main.ts b/packages/upgrade-deps/main.ts index 23e79e8..b700409 100644 --- a/packages/upgrade-deps/main.ts +++ b/packages/upgrade-deps/main.ts @@ -1,10 +1,7 @@ -import * as fs from 'node:fs/promises' import * as path from 'node:path' import * as core from '@actions/core' import * as exec from '@actions/exec' import * as github from '@actions/github' -import { updateWorkspaceManifest } from '@pnpm/workspace.manifest-writer' -import { readWorkspaceManifest } from '@pnpm/workspace.read-manifest' import { GitHelper, GithubHelper } from '@workflows/utils' function getBranchName(deps: Array<{ name: string, version: string }>): string { @@ -44,86 +41,6 @@ interface DependencyInfo { version: string } -function getUpdatedVersion(currentVersion: string, newVersion: string): string { - const prefix = currentVersion[0] - if (prefix && (prefix === '^' || prefix === '~')) { - return `${prefix}${newVersion}` - } - return newVersion -} - -// async function updatePnpmCatalog(deps: DependencyInfo[], repo: string, targetDir: string): Promise { -// let repoPath = repo -// if (targetDir) { -// repoPath = path.join(repo, targetDir) -// } -// const workspaceFile = path.join(repoPath, 'pnpm-workspace.yaml') -// core.info(`Looking for pnpm-workspace.yaml at: ${workspaceFile}`) - -// let manifestContent: string -// try { -// manifestContent = await fs.readFile(workspaceFile, 'utf-8') -// core.info(`Successfully read pnpm-workspace.yaml (${manifestContent.length} bytes)`) -// } -// catch (error) { -// core.info(`pnpm-workspace.yaml not found in ${repoPath}, skipping catalog update`) -// core.info(`Error: ${error}`) -// return -// } - -// const manifest = await readWorkspaceManifest(manifestContent) -// if (!manifest) { -// core.info(`Failed to read pnpm-workspace.yaml, skipping catalog update`) -// core.info(`File content preview: ${manifestContent.substring(0, 200)}...`) -// return -// } -// core.info(`Successfully parsed pnpm-workspace.yaml`) -// if (manifest.catalog) { -// core.info(`Found default catalog with ${Object.keys(manifest.catalog).length} entries`) -// } -// if (manifest.catalogs) { -// core.info(`Found ${Object.keys(manifest.catalogs).length} named catalogs: ${Object.keys(manifest.catalogs).join(', ')}`) -// } - -// const updatedCatalogs: Record> = {} - -// if (manifest.catalog) { -// const defaultCatalogUpdates: Record = {} -// for (const dep of deps) { -// if (dep.name in manifest.catalog) { -// defaultCatalogUpdates[dep.name] = getUpdatedVersion(manifest.catalog[dep.name] as string, dep.version) -// } -// } -// if (Object.keys(defaultCatalogUpdates).length > 0) { -// updatedCatalogs[''] = defaultCatalogUpdates -// } -// } - -// if (manifest.catalogs) { -// for (const [catalogName, catalog] of Object.entries(manifest.catalogs)) { -// const catalogUpdates: Record = {} -// const typedCatalog = catalog as Record -// for (const dep of deps) { -// if (dep.name in typedCatalog) { -// catalogUpdates[dep.name] = getUpdatedVersion(typedCatalog[dep.name], dep.version) -// } -// } -// if (Object.keys(catalogUpdates).length > 0) { -// updatedCatalogs[catalogName] = catalogUpdates -// } -// } -// } - -// const hasUpdates = Object.keys(updatedCatalogs).length > 0 -// if (!hasUpdates) { -// core.info(`No matching dependencies found in catalog, skipping update`) -// return -// } - -// await updateWorkspaceManifest(workspaceFile, { updatedCatalogs }) -// core.info(`Updated pnpm catalog in pnpm-workspace.yaml`) -// } - async function getPkgLatestVersion(pkgNames: string[]): Promise { const results: DependencyInfo[] = [] for (const pkg of pkgNames) { diff --git a/packages/upgrade-deps/package.json b/packages/upgrade-deps/package.json index 66ca301..135d011 100644 --- a/packages/upgrade-deps/package.json +++ b/packages/upgrade-deps/package.json @@ -10,8 +10,6 @@ "@actions/core": "catalog:", "@actions/exec": "catalog:", "@actions/github": "catalog:", - "@pnpm/workspace.manifest-writer": "catalog:", - "@pnpm/workspace.read-manifest": "catalog:", "@workflows/utils": "workspace:*" }, "devDependencies": { diff --git a/packages/upgrade-deps/tsdown.config.ts b/packages/upgrade-deps/tsdown.config.ts index f328e14..39dfe35 100644 --- a/packages/upgrade-deps/tsdown.config.ts +++ b/packages/upgrade-deps/tsdown.config.ts @@ -8,9 +8,7 @@ export default defineConfig({ '@actions/core', '@actions/exec', '@actions/github', - '@workflows/utils', - '@pnpm/workspace.manifest-writer', - '@pnpm/workspace.read-manifest', + '@workflows/utils' ], onlyBundle: [ '@actions/core', @@ -26,28 +24,11 @@ export default defineConfig({ '@octokit/plugin-rest-endpoint-methods', '@octokit/request', '@octokit/request-error', - '@pnpm/constants', - '@pnpm/error', - '@pnpm/object.key-sorting', - '@pnpm/ramda', - '@pnpm/util.lex-comparator', - '@pnpm/workspace.manifest-writer', - '@pnpm/workspace.read-manifest', - '@pnpm/yaml.document-sync', 'before-after-hook', 'fast-content-type-parse', - 'imurmurhash', - 'is-plain-obj', - 'js-yaml', - 'read-yaml-file', - 'signal-exit', - 'sort-keys', - 'strip-bom', 'tunnel', 'undici', 'universal-user-agent', - 'write-file-atomic', - 'yaml', ], }, }) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6ba5b78..1652cab 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -21,12 +21,6 @@ catalogs: '@octokit/plugin-rest-endpoint-methods': specifier: ^17.0.0 version: 17.0.0 - '@pnpm/workspace.manifest-writer': - specifier: ^1001.3.1 - version: 1001.3.1 - '@pnpm/workspace.read-manifest': - specifier: ^1000.3.1 - version: 1000.3.1 '@types/node': specifier: ^24.12.2 version: 24.12.2 @@ -106,12 +100,6 @@ importers: '@actions/github': specifier: 'catalog:' version: 9.1.1 - '@pnpm/workspace.manifest-writer': - specifier: 'catalog:' - version: 1001.3.1 - '@pnpm/workspace.read-manifest': - specifier: 'catalog:' - version: 1000.3.1 '@workflows/utils': specifier: workspace:* version: link:../utils @@ -447,57 +435,6 @@ packages: resolution: {integrity: sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} - '@pnpm/catalogs.types@1000.0.0': - resolution: {integrity: sha512-xRf72lk7xHNvbenA4sp4Of/90QDdRW0CRYT+V+EbqpUXu1xsXtedHai34cTU6VGe7C1hUukxxE9eYTtIpYrx5g==} - engines: {node: '>=18.12'} - - '@pnpm/constants@1001.3.1': - resolution: {integrity: sha512-2hf0s4pVrVEH8RvdJJ7YRKjQdiG8m0iAT26TTqXnCbK30kKwJW69VLmP5tED5zstmDRXcOeH5eRcrpkdwczQ9g==} - engines: {node: '>=18.12'} - - '@pnpm/error@1000.1.0': - resolution: {integrity: sha512-Dqc2IJJPjUatwc9Letw+vG29rnaMrDGi5g6WCx1HiZYm0obXbTmLygeRafMbgf+sLKXrWE1shOeiayQuczBdoA==} - engines: {node: '>=18.12'} - - '@pnpm/lockfile.types@1002.1.0': - resolution: {integrity: sha512-Oa9Fhwo4Ipodj3hyUPC5wUt5ucVkuttyct2DbFUkB79Fq5HL9MHHQ+JFYh03eajmLqWrN1t8+6DbmcKqRtNjNg==} - engines: {node: '>=18.12'} - - '@pnpm/object.key-sorting@1000.0.1': - resolution: {integrity: sha512-YTJCXyUGOrJuj4QqhSKqZa1vlVAm82h1/uw00ZmD/kL2OViggtyUwWyIe62kpwWVPwEYixfGjfvaFKVJy2mjzA==} - engines: {node: '>=18.12'} - - '@pnpm/patching.types@1000.1.0': - resolution: {integrity: sha512-Zib2ysLctRnWM4KXXlljR44qSKwyEqYmLk+8VPBDBEK3l5Gp5mT3N4ix9E4qjYynvFqahumsxzOfxOYQhUGMGw==} - engines: {node: '>=18.12'} - - '@pnpm/ramda@0.28.1': - resolution: {integrity: sha512-zcAG+lvU0fMziNeGXpPyCyCJYp5ZVrPElEE4t14jAmViaihohocZ+dDkcRIyAomox8pQsuZnv1EyHR+pOhmUWw==} - - '@pnpm/resolver-base@1005.4.1': - resolution: {integrity: sha512-47zGgACkbZWLOmM61kaE0nkqxiYx63C6DJ4wzDsdj0iXDZJ9SJEl+T035pkhquHe8XEh3YxvwMg2BRyZSgmZ9Q==} - engines: {node: '>=18.12'} - - '@pnpm/types@1001.3.0': - resolution: {integrity: sha512-NLTXheat/u7OEGg5M5vF6Z85zx8uKUZE0+whtX/sbFV2XL48RdnOWGPTKYuVVkv8M+launaLUTgGEXNs/ess2w==} - engines: {node: '>=18.12'} - - '@pnpm/util.lex-comparator@3.0.2': - resolution: {integrity: sha512-blFO4Ws97tWv/SNE6N39ZdGmZBrocXnBOfVp0ln4kELmns4pGPZizqyRtR8EjfOLMLstbmNCTReBoDvLz1isVg==} - engines: {node: '>=18.12'} - - '@pnpm/workspace.manifest-writer@1001.3.1': - resolution: {integrity: sha512-EbVvYPRXO5o4qkol+Sgo1sR+46UZBrPZTNsa8G8C35iiXrMsjwS2Ssf0gpdKH7E4R24v+mtOiJuhZ8mnYCrHOA==} - engines: {node: '>=18.12'} - - '@pnpm/workspace.read-manifest@1000.3.1': - resolution: {integrity: sha512-ojO1Anf4ITL7OskuUYoLI3bldQ36XNLpG2cYQZ4F6LZbBZnRY8umW6TeWzb9h/aX8UFwYp9vWbQ8R/FaMtMEeg==} - engines: {node: '>=18.12'} - - '@pnpm/yaml.document-sync@1000.0.0': - resolution: {integrity: sha512-aEmCtfPJejq9I/q7pIYNo3Q0ryPrUoR57noCJbU+f0zNmg8JKG5YVVfCVvo5KNnG3LlN/MDyWvSHTeqy+HCoWA==} - engines: {node: '>=18.12'} - '@quansync/fs@1.0.0': resolution: {integrity: sha512-4TJ3DFtlf1L5LDMaM6CanJ/0lckGNtJcMjQ1NAV6zDmA0tEHKZtxNKin8EgPaVX1YzljbxckyT2tJrpQKAtngQ==} @@ -857,9 +794,6 @@ packages: resolution: {integrity: sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==} engines: {node: '>=14'} - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - ast-kit@3.0.0-beta.1: resolution: {integrity: sha512-trmleAnZ2PxN/loHWVhhx1qeOHSRXq4TDsBBxq3GqeJitfk3+jTQ+v/C1km/KYq9M7wKqCewMh+/NAvVH7m+bw==} engines: {node: '>=20.19.0'} @@ -1340,17 +1274,9 @@ packages: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} - is-plain-obj@2.1.0: - resolution: {integrity: sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==} - engines: {node: '>=8'} - isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - js-yaml@4.1.1: - resolution: {integrity: sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==} - hasBin: true - jsdoc-type-pratt-parser@7.1.1: resolution: {integrity: sha512-/2uqY7x6bsrpi3i9LVU6J89352C0rpMk0as8trXxCtvd4kPk1ke/Eyif6wqfSLvoNJqcDG9Vk4UsXgygzCt2xA==} engines: {node: '>=20.0.0'} @@ -1659,10 +1585,6 @@ packages: quansync@1.0.0: resolution: {integrity: sha512-5xZacEEufv3HSTPQuchrvV6soaiACMFnq1H8wkVioctoH3TRha9Sz66lOxRwPK/qZj7HPiSveih9yAyh98gvqA==} - read-yaml-file@2.1.0: - resolution: {integrity: sha512-UkRNRIwnhG+y7hpqnycCL/xbTk7+ia9VuVTC0S+zVbwd65DI9eUpRMfsWIGrCWxTU/mi+JW8cHQCrv+zfCbEPQ==} - engines: {node: '>=10.13'} - refa@0.12.1: resolution: {integrity: sha512-J8rn6v4DBb2nnFqkqwy6/NnTYMcgLA+sLr0iIO41qpv0n+ngb7ksag2tMRl0inb1bbO/esUwzW1vbJi7K0sI0g==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} @@ -1727,17 +1649,9 @@ packages: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - sisteransi@1.0.5: resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} - sort-keys@4.2.0: - resolution: {integrity: sha512-aUYIEU/UviqPgc8mHR6IW1EGxkAXpeRETYcrzg8cLAvUPZcpAlleSXHV2mY7G12GphSH6Gzv+4MMVSSkbdteHg==} - engines: {node: '>=8'} - source-map-js@1.2.1: resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} engines: {node: '>=0.10.0'} @@ -1751,10 +1665,6 @@ packages: spdx-license-ids@3.0.22: resolution: {integrity: sha512-4PRT4nh1EImPbt2jASOKHX7PB7I+e4IWNLvkKFDxNhJlfjbYlleYQh285Z/3mPTHSAK/AvdMmw5BNNuYH8ShgQ==} - strip-bom@4.0.0: - resolution: {integrity: sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==} - engines: {node: '>=8'} - strip-indent@4.1.1: resolution: {integrity: sha512-SlyRoSkdh1dYP0PzclLE7r0M9sgbFKKMFXpFRUMNuKhQSbC6VQIGzq3E0qsfvGJaUFJPGv6Ws1NZ/haTAjfbMA==} engines: {node: '>=12'} @@ -1910,10 +1820,6 @@ packages: resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} engines: {node: '>=0.10.0'} - write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - xml-name-validator@4.0.0: resolution: {integrity: sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==} engines: {node: '>=12'} @@ -2265,61 +2171,6 @@ snapshots: '@pkgr/core@0.2.9': {} - '@pnpm/catalogs.types@1000.0.0': {} - - '@pnpm/constants@1001.3.1': {} - - '@pnpm/error@1000.1.0': - dependencies: - '@pnpm/constants': 1001.3.1 - - '@pnpm/lockfile.types@1002.1.0': - dependencies: - '@pnpm/patching.types': 1000.1.0 - '@pnpm/resolver-base': 1005.4.1 - '@pnpm/types': 1001.3.0 - - '@pnpm/object.key-sorting@1000.0.1': - dependencies: - '@pnpm/util.lex-comparator': 3.0.2 - sort-keys: 4.2.0 - - '@pnpm/patching.types@1000.1.0': {} - - '@pnpm/ramda@0.28.1': {} - - '@pnpm/resolver-base@1005.4.1': - dependencies: - '@pnpm/types': 1001.3.0 - - '@pnpm/types@1001.3.0': {} - - '@pnpm/util.lex-comparator@3.0.2': {} - - '@pnpm/workspace.manifest-writer@1001.3.1': - dependencies: - '@pnpm/catalogs.types': 1000.0.0 - '@pnpm/constants': 1001.3.1 - '@pnpm/lockfile.types': 1002.1.0 - '@pnpm/object.key-sorting': 1000.0.1 - '@pnpm/types': 1001.3.0 - '@pnpm/workspace.read-manifest': 1000.3.1 - '@pnpm/yaml.document-sync': 1000.0.0 - ramda: '@pnpm/ramda@0.28.1' - write-file-atomic: 5.0.1 - yaml: 2.8.2 - - '@pnpm/workspace.read-manifest@1000.3.1': - dependencies: - '@pnpm/constants': 1001.3.1 - '@pnpm/error': 1000.1.0 - '@pnpm/types': 1001.3.0 - read-yaml-file: 2.1.0 - - '@pnpm/yaml.document-sync@1000.0.0': - dependencies: - yaml: 2.8.2 - '@quansync/fs@1.0.0': dependencies: quansync: 1.0.0 @@ -2683,8 +2534,6 @@ snapshots: are-docs-informative@0.0.2: {} - argparse@2.0.1: {} - ast-kit@3.0.0-beta.1: dependencies: '@babel/parser': 8.0.0-rc.3 @@ -3170,14 +3019,8 @@ snapshots: dependencies: is-extglob: 2.1.1 - is-plain-obj@2.1.0: {} - isexe@2.0.0: {} - js-yaml@4.1.1: - dependencies: - argparse: 2.0.1 - jsdoc-type-pratt-parser@7.1.1: {} jsdoc-type-pratt-parser@7.2.0: {} @@ -3673,11 +3516,6 @@ snapshots: quansync@1.0.0: {} - read-yaml-file@2.1.0: - dependencies: - js-yaml: 4.1.1 - strip-bom: 4.0.0 - refa@0.12.1: dependencies: '@eslint-community/regexpp': 4.12.2 @@ -3751,14 +3589,8 @@ snapshots: shebang-regex@3.0.0: {} - signal-exit@4.1.0: {} - sisteransi@1.0.5: {} - sort-keys@4.2.0: - dependencies: - is-plain-obj: 2.1.0 - source-map-js@1.2.1: {} spdx-exceptions@2.5.0: {} @@ -3770,8 +3602,6 @@ snapshots: spdx-license-ids@3.0.22: {} - strip-bom@4.0.0: {} - strip-indent@4.1.1: {} synckit@0.11.12: @@ -3918,11 +3748,6 @@ snapshots: word-wrap@1.2.5: {} - write-file-atomic@5.0.1: - dependencies: - imurmurhash: 0.1.4 - signal-exit: 4.1.0 - xml-name-validator@4.0.0: {} yaml-eslint-parser@2.0.0: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 51f2d08..9c9ea51 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,5 +1,7 @@ catalogMode: prefer +cleanupUnusedCatalogs: true + shellEmulator: true trustPolicy: no-downgrade @@ -11,8 +13,6 @@ catalog: '@actions/github': ^9.1.1 '@antfu/eslint-config': ^8.2.0 '@octokit/plugin-rest-endpoint-methods': ^17.0.0 - '@pnpm/workspace.manifest-writer': ^1001.3.1 - '@pnpm/workspace.read-manifest': ^1000.3.1 '@types/node': ^24.12.2 '@typescript/native-preview': 7.0.0-dev.20260427.1 eslint: ^10.2.1 From d8ed15d9eeb150304fd7e88af8f63b3c5bd5c8c9 Mon Sep 17 00:00:00 2001 From: lwj <674416404@qq.com> Date: Wed, 29 Apr 2026 21:03:04 +0800 Subject: [PATCH 40/40] =?UTF-8?q?refactor(upgrade-deps):=20=E9=87=8D?= =?UTF-8?q?=E6=9E=84=E4=BE=9D=E8=B5=96=E5=8D=87=E7=BA=A7=E9=80=BB=E8=BE=91?= =?UTF-8?q?=EF=BC=8C=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将获取包版本和更新依赖的逻辑拆分为更小的函数 使用常量对象管理不同包管理器的命令 移除不必要的 ActionError 类,使用原生 Error 优化错误变量命名以避免冲突 --- packages/upgrade-deps/dist/index.mjs | 119 +++++++++++++------------ packages/upgrade-deps/main.ts | 104 +++++++++------------ packages/upgrade-deps/tsdown.config.ts | 2 +- 3 files changed, 104 insertions(+), 121 deletions(-) diff --git a/packages/upgrade-deps/dist/index.mjs b/packages/upgrade-deps/dist/index.mjs index 180ca38..71bf29c 100644 --- a/packages/upgrade-deps/dist/index.mjs +++ b/packages/upgrade-deps/dist/index.mjs @@ -19934,9 +19934,9 @@ var GithubHelper = class { pull_number: prNumber }); return data; - } catch (error$3) { - error(`获取PR数据失败: ${error$3}`); - throw error$3; + } catch (error$4) { + error(`获取PR数据失败: ${error$4}`); + throw error$4; } } async getIssueData(issueNumber) { @@ -19946,9 +19946,9 @@ var GithubHelper = class { issue_number: issueNumber }); return data; - } catch (error$5) { - error(`获取Issue数据失败: ${error$5}`); - throw error$5; + } catch (error$6) { + error(`获取Issue数据失败: ${error$6}`); + throw error$6; } } async getIssueList(params) { @@ -19958,9 +19958,9 @@ var GithubHelper = class { ...this.defaultRepoParams }); return data.filter((item) => !item?.pull_request); - } catch (error$4) { - error(`获取Issue列表失败: ${error$4}`); - throw error$4; + } catch (error$5) { + error(`获取Issue列表失败: ${error$5}`); + throw error$5; } } async closeIssue(issueNumber) { @@ -19971,9 +19971,9 @@ var GithubHelper = class { issue_number: issueNumber, state: "closed" }); - } catch (error$6) { - error(`关闭Issue失败: ${error$6}`); - throw error$6; + } catch (error$7) { + error(`关闭Issue失败: ${error$7}`); + throw error$7; } } async createPR(title, head, body, base = "develop") { @@ -19992,9 +19992,9 @@ var GithubHelper = class { body }); return data; - } catch (error$1) { - error(`创建PR失败: ${error$1}`); - throw error$1; + } catch (error$2) { + error(`创建PR失败: ${error$2}`); + throw error$2; } } async addComment(issueNumber, body) { @@ -20009,9 +20009,9 @@ var GithubHelper = class { body }); return data; - } catch (error$2) { - error(`添加评论失败: ${error$2}`); - throw error$2; + } catch (error$3) { + error(`添加评论失败: ${error$3}`); + throw error$3; } } async addLabels(issueNumber, labels) { @@ -20026,66 +20026,67 @@ var GithubHelper = class { labels }); return data; - } catch (error$7) { - error(`添加标签失败: ${error$7}`); - throw error$7; + } catch (error$8) { + error(`添加标签失败: ${error$8}`); + throw error$8; } } }; //#endregion //#region main.ts +const PACKAGE_MANAGER_COMMANDS = { + pnpm: { + cmd: "pnpm", + args: ["up", "--latest"] + }, + yarn: { + cmd: "yarn", + args: ["upgrade", "--latest"] + }, + npm: { + cmd: "npm", + args: ["update"] + } +}; function getBranchName(deps) { return `chore/deps/upgrade-${deps.map((d) => `${d.name.replace(/@/g, "").replace(/\//g, "-")}-${d.version}`).join("-")}`; } function getPrTitle(deps) { return `chore: upgrade ${deps.map((d) => `${d.name} to ${d.version}`).join(", ")}`; } -const ERROR_MESSAGES = { MISSING_DEPS: "Missing deps input" }; -var ActionError = class extends Error { - constructor(message, context) { - super(message); - this.name = "ActionError"; - if (context) error(`${message} ${JSON.stringify(context)}`); - } -}; -async function getPkgLatestVersion(pkgNames) { - const results = []; - for (const pkg of pkgNames) { +function getRepoPath(repo, targetDir) { + const base = `./${repo}`; + return targetDir ? path.join(base, targetDir) : base; +} +async function fetchPackageVersion(pkg) { + try { const response = await fetch(`https://registry.npmjs.org/${pkg}/latest`); if (!response.ok) { error(`Failed to get ${pkg} info from npm registry, status code: ${response.status}`); - continue; + return null; } - const latest = (await response.json()).version; - if (!latest) { + const { version } = await response.json(); + if (!version) { error(`No version found for ${pkg}`); - continue; + return null; } - info(`Latest version of ${pkg} is ${latest}`); - results.push({ + info(`Latest version of ${pkg} is ${version}`); + return { name: pkg, - version: latest - }); + version + }; + } catch (error$1) { + error(`Error fetching ${pkg}: ${error$1}`); + return null; } - return results; } -async function corepackEnable() { - await exec("corepack", ["enable"]); +async function getPkgLatestVersions(pkgNames) { + return (await Promise.all(pkgNames.map(fetchPackageVersion))).filter((r) => r !== null); } async function updatePackageDependencies(packageManager, deps, repo, targetDir) { - let repoPath = `./${repo}`; - if (targetDir) repoPath = path.join(repoPath, targetDir); - if (packageManager === "pnpm") await exec("pnpm", [ - "up", - ...deps, - "--latest" - ], { cwd: repoPath }); - else if (packageManager === "yarn") await exec("yarn", [ - "upgrade", - ...deps, - "--latest" - ], { cwd: repoPath }); - else await exec("npm", ["update", ...deps], { cwd: repoPath }); + const repoPath = getRepoPath(repo, targetDir); + const { cmd, args } = PACKAGE_MANAGER_COMMANDS[packageManager] ?? PACKAGE_MANAGER_COMMANDS.npm; + await exec(cmd, [...args, ...deps], { cwd: repoPath }); } async function createDepsPr(title, branchName, baseBranch, context) { await new GithubHelper({ @@ -20106,10 +20107,10 @@ async function updateDependencies(context) { info(`deps: ${JSON.stringify(deps)}`); info(`target-dir: ${targetDir || "default (repo root)"}`); if (customTitle) info(`custom-title: ${customTitle}`); - if (!deps.length) throw new ActionError(ERROR_MESSAGES.MISSING_DEPS, { trigger: context.trigger }); - const depInfos = await getPkgLatestVersion(deps); + if (!deps.length) throw new Error("Missing deps input"); + const depInfos = await getPkgLatestVersions(deps); info(`depInfos: ${JSON.stringify(depInfos)}`); - if (packageManager !== "npm") await corepackEnable(); + if (packageManager !== "npm") await exec("corepack", ["enable"]); const gitHelper = new GitHelper({ repo: context.repo, owner: context.owner, diff --git a/packages/upgrade-deps/main.ts b/packages/upgrade-deps/main.ts index b700409..9b11375 100644 --- a/packages/upgrade-deps/main.ts +++ b/packages/upgrade-deps/main.ts @@ -4,30 +4,6 @@ import * as exec from '@actions/exec' import * as github from '@actions/github' import { GitHelper, GithubHelper } from '@workflows/utils' -function getBranchName(deps: Array<{ name: string, version: string }>): string { - const depsSlug = deps.map(d => `${d.name.replace(/@/g, '').replace(/\//g, '-')}-${d.version}`).join('-') - return `chore/deps/upgrade-${depsSlug}` -} - -function getPrTitle(deps: Array<{ name: string, version: string }>): string { - const depList = deps.map(d => `${d.name} to ${d.version}`).join(', ') - return `chore: upgrade ${depList}` -} - -const ERROR_MESSAGES = { - MISSING_DEPS: 'Missing deps input', -} - -class ActionError extends Error { - constructor(message: string, context?: Record) { - super(message) - this.name = 'ActionError' - if (context) { - core.error(`${message} ${JSON.stringify(context)}`) - } - } -} - interface TriggerContext { repo: string owner: string @@ -41,47 +17,57 @@ interface DependencyInfo { version: string } -async function getPkgLatestVersion(pkgNames: string[]): Promise { - const results: DependencyInfo[] = [] - for (const pkg of pkgNames) { +const PACKAGE_MANAGER_COMMANDS: Record = { + pnpm: { cmd: 'pnpm', args: ['up', '--latest'] }, + yarn: { cmd: 'yarn', args: ['upgrade', '--latest'] }, + npm: { cmd: 'npm', args: ['update'] }, +} + +function getBranchName(deps: DependencyInfo[]): string { + const depsSlug = deps.map(d => `${d.name.replace(/@/g, '').replace(/\//g, '-')}-${d.version}`).join('-') + return `chore/deps/upgrade-${depsSlug}` +} + +function getPrTitle(deps: DependencyInfo[]): string { + const depList = deps.map(d => `${d.name} to ${d.version}`).join(', ') + return `chore: upgrade ${depList}` +} + +function getRepoPath(repo: string, targetDir: string): string { + const base = `./${repo}` + return targetDir ? path.join(base, targetDir) : base +} + +async function fetchPackageVersion(pkg: string): Promise { + try { const response = await fetch(`https://registry.npmjs.org/${pkg}/latest`) if (!response.ok) { core.error(`Failed to get ${pkg} info from npm registry, status code: ${response.status}`) - continue + return null } - const info = await response.json() as { version?: string } - const latest = info.version - if (!latest) { + const { version } = await response.json() as { version?: string } + if (!version) { core.error(`No version found for ${pkg}`) - continue + return null } - core.info(`Latest version of ${pkg} is ${latest}`) - results.push({ - name: pkg, - version: latest, - }) + core.info(`Latest version of ${pkg} is ${version}`) + return { name: pkg, version } + } + catch (error) { + core.error(`Error fetching ${pkg}: ${error}`) + return null } - return results } -async function corepackEnable(): Promise { - await exec.exec('corepack', ['enable']) +async function getPkgLatestVersions(pkgNames: string[]): Promise { + const results = await Promise.all(pkgNames.map(fetchPackageVersion)) + return results.filter((r): r is DependencyInfo => r !== null) } async function updatePackageDependencies(packageManager: string, deps: string[], repo: string, targetDir: string): Promise { - let repoPath = `./${repo}` - if (targetDir) { - repoPath = path.join(repoPath, targetDir) - } - if (packageManager === 'pnpm') { - await exec.exec('pnpm', ['up', ...deps, '--latest'], { cwd: repoPath }) - } - else if (packageManager === 'yarn') { - await exec.exec('yarn', ['upgrade', ...deps, '--latest'], { cwd: repoPath }) - } - else { - await exec.exec('npm', ['update', ...deps], { cwd: repoPath }) - } + const repoPath = getRepoPath(repo, targetDir) + const { cmd, args } = PACKAGE_MANAGER_COMMANDS[packageManager] ?? PACKAGE_MANAGER_COMMANDS.npm + await exec.exec(cmd, [...args, ...deps], { cwd: repoPath }) } async function createDepsPr( @@ -104,6 +90,7 @@ export async function updateDependencies(context: TriggerContext): Promise const targetDir = core.getInput('target-dir') || '' const customTitle = core.getInput('title') || '' const deps = core.getMultilineInput('deps', { required: true, trimWhitespace: true }) + core.info(`deps: ${JSON.stringify(deps)}`) core.info(`target-dir: ${targetDir || 'default (repo root)'}`) if (customTitle) { @@ -111,14 +98,14 @@ export async function updateDependencies(context: TriggerContext): Promise } if (!deps.length) { - throw new ActionError(ERROR_MESSAGES.MISSING_DEPS, { trigger: context.trigger }) + throw new Error('Missing deps input') } - const depInfos = await getPkgLatestVersion(deps) + const depInfos = await getPkgLatestVersions(deps) core.info(`depInfos: ${JSON.stringify(depInfos)}`) if (packageManager !== 'npm') { - await corepackEnable() + await exec.exec('corepack', ['enable']) } const gitHelper = new GitHelper({ @@ -133,10 +120,6 @@ export async function updateDependencies(context: TriggerContext): Promise const branchName = getBranchName(depInfos) await gitHelper.createBranch(branchName) - // if (packageManager === 'pnpm') { - // await updatePnpmCatalog(depInfos, context.repo, targetDir) - // } - await updatePackageDependencies(packageManager, deps, context.repo, targetDir) if (!(await gitHelper.isNeedCommit())) { @@ -151,7 +134,6 @@ export async function updateDependencies(context: TriggerContext): Promise const title = customTitle || getPrTitle(depInfos) await gitHelper.commit(title) await gitHelper.push(branchName) - await createDepsPr(title, branchName, baseBranch, context) } diff --git a/packages/upgrade-deps/tsdown.config.ts b/packages/upgrade-deps/tsdown.config.ts index 39dfe35..a29b31d 100644 --- a/packages/upgrade-deps/tsdown.config.ts +++ b/packages/upgrade-deps/tsdown.config.ts @@ -8,7 +8,7 @@ export default defineConfig({ '@actions/core', '@actions/exec', '@actions/github', - '@workflows/utils' + '@workflows/utils', ], onlyBundle: [ '@actions/core',