diff --git a/README.md b/README.md index 845c905..d21e7e7 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,8 @@ oco config set OCO_AI_PROVIDER='ollama' If you want to use a model other than mistral (default), you can do so by setting the `OCO_AI_PROVIDER` environment variable as follows: ```sh -oco config set OCO_AI_PROVIDER='ollama/llama3:8b' +oco config set OCO_AI_PROVIDER='ollama' +oco config set OCO_MODEL='llama3:8b' ``` If you have ollama that is set up in docker/ on another machine with GPUs (not locally), you can change the default endpoint url. @@ -127,12 +128,12 @@ OCO_TOKENS_MAX_OUTPUT= OCO_OPENAI_BASE_PATH= OCO_DESCRIPTION= OCO_EMOJI= -OCO_MODEL= +OCO_MODEL= OCO_LANGUAGE= OCO_MESSAGE_TEMPLATE_PLACEHOLDER= OCO_PROMPT_MODULE= OCO_ONE_LINE_COMMIT= -OCO_AI_PROVIDER= +OCO_AI_PROVIDER= ... ``` @@ -162,6 +163,16 @@ oco config set OCO_EMOJI=false Other config options are behaving the same. +### Output WHY the changes were done (WIP) + +You can set the `OCO_WHY` config to `true` to have OpenCommit output a short description of WHY the changes were done after the commit message. Default is `false`. + +To make this perform accurate we must store 'what files do' in some kind of an index or embedding and perform a lookup (kinda RAG) for the accurate git commit message. If you feel like building this comment on this ticket https://github.com/di-sukharev/opencommit/issues/398 and let's go from there together. + +```sh +oco config set OCO_WHY=true +``` + ### Switch to GPT-4 or other models By default, OpenCommit uses `gpt-4o-mini` model. diff --git a/out/cli.cjs b/out/cli.cjs index d855ce2..4aef541 100755 --- a/out/cli.cjs +++ b/out/cli.cjs @@ -54,12 +54,12 @@ var require_src = __commonJS({ ret += `${CSI}${y6}B`; return ret; }, - up: (count = 1) => `${CSI}${count}A`, - down: (count = 1) => `${CSI}${count}B`, - forward: (count = 1) => `${CSI}${count}C`, - backward: (count = 1) => `${CSI}${count}D`, - nextLine: (count = 1) => `${CSI}E`.repeat(count), - prevLine: (count = 1) => `${CSI}F`.repeat(count), + up: (count2 = 1) => `${CSI}${count2}A`, + down: (count2 = 1) => `${CSI}${count2}B`, + forward: (count2 = 1) => `${CSI}${count2}C`, + backward: (count2 = 1) => `${CSI}${count2}D`, + nextLine: (count2 = 1) => `${CSI}E`.repeat(count2), + prevLine: (count2 = 1) => `${CSI}F`.repeat(count2), left: `${CSI}G`, hide: `${CSI}?25l`, show: `${CSI}?25h`, @@ -67,21 +67,21 @@ var require_src = __commonJS({ restore: `${ESC}8` }; var scroll = { - up: (count = 1) => `${CSI}S`.repeat(count), - down: (count = 1) => `${CSI}T`.repeat(count) + up: (count2 = 1) => `${CSI}S`.repeat(count2), + down: (count2 = 1) => `${CSI}T`.repeat(count2) }; var erase = { screen: `${CSI}2J`, - up: (count = 1) => `${CSI}1J`.repeat(count), - down: (count = 1) => `${CSI}J`.repeat(count), + up: (count2 = 1) => `${CSI}1J`.repeat(count2), + down: (count2 = 1) => `${CSI}J`.repeat(count2), line: `${CSI}2K`, lineEnd: `${CSI}K`, lineStart: `${CSI}1K`, - lines(count) { + lines(count2) { let clear = ""; - for (let i3 = 0; i3 < count; i3++) - clear += this.line + (i3 < count - 1 ? cursor.up() : ""); - if (count) + for (let i4 = 0; i4 < count2; i4++) + clear += this.line + (i4 < count2 - 1 ? cursor.up() : ""); + if (count2) clear += cursor.left; return clear; } @@ -93,8 +93,8 @@ var require_src = __commonJS({ // node_modules/picocolors/picocolors.js var require_picocolors = __commonJS({ "node_modules/picocolors/picocolors.js"(exports, module2) { - var tty2 = require("tty"); - var isColorSupported = !("NO_COLOR" in process.env || process.argv.includes("--no-color")) && ("FORCE_COLOR" in process.env || process.argv.includes("--color") || process.platform === "win32" || tty2.isatty(1) && process.env.TERM !== "dumb" || "CI" in process.env); + var tty4 = require("tty"); + var isColorSupported = !("NO_COLOR" in process.env || process.argv.includes("--no-color")) && ("FORCE_COLOR" in process.env || process.argv.includes("--color") || process.platform === "win32" || tty4.isatty(1) && process.env.TERM !== "dumb" || "CI" in process.env); var formatter = (open, close, replace = open) => (input) => { let string = "" + input; let index = string.indexOf(close, open.length); @@ -145,7 +145,7 @@ var require_windows = __commonJS({ module2.exports = isexe; isexe.sync = sync; var fs6 = require("fs"); - function checkPathExt(path5, options) { + function checkPathExt(path7, options) { var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT; if (!pathext) { return true; @@ -154,27 +154,27 @@ var require_windows = __commonJS({ if (pathext.indexOf("") !== -1) { return true; } - for (var i3 = 0; i3 < pathext.length; i3++) { - var p4 = pathext[i3].toLowerCase(); - if (p4 && path5.substr(-p4.length).toLowerCase() === p4) { + for (var i4 = 0; i4 < pathext.length; i4++) { + var p4 = pathext[i4].toLowerCase(); + if (p4 && path7.substr(-p4.length).toLowerCase() === p4) { return true; } } return false; } - function checkStat(stat, path5, options) { + function checkStat(stat, path7, options) { if (!stat.isSymbolicLink() && !stat.isFile()) { return false; } - return checkPathExt(path5, options); + return checkPathExt(path7, options); } - function isexe(path5, options, cb) { - fs6.stat(path5, function(er2, stat) { - cb(er2, er2 ? false : checkStat(stat, path5, options)); + function isexe(path7, options, cb) { + fs6.stat(path7, function(er2, stat) { + cb(er2, er2 ? false : checkStat(stat, path7, options)); }); } - function sync(path5, options) { - return checkStat(fs6.statSync(path5), path5, options); + function sync(path7, options) { + return checkStat(fs6.statSync(path7), path7, options); } } }); @@ -185,13 +185,13 @@ var require_mode = __commonJS({ module2.exports = isexe; isexe.sync = sync; var fs6 = require("fs"); - function isexe(path5, options, cb) { - fs6.stat(path5, function(er2, stat) { + function isexe(path7, options, cb) { + fs6.stat(path7, function(er2, stat) { cb(er2, er2 ? false : checkStat(stat, options)); }); } - function sync(path5, options) { - return checkStat(fs6.statSync(path5), options); + function sync(path7, options) { + return checkStat(fs6.statSync(path7), options); } function checkStat(stat, options) { return stat.isFile() && checkMode(stat, options); @@ -202,11 +202,11 @@ var require_mode = __commonJS({ var gid = stat.gid; var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid(); var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid(); - var u3 = parseInt("100", 8); + var u4 = parseInt("100", 8); var g4 = parseInt("010", 8); - var o3 = parseInt("001", 8); - var ug = u3 | g4; - var ret = mod & o3 || mod & g4 && gid === myGid || mod & u3 && uid === myUid || mod & ug && myUid === 0; + var o4 = parseInt("001", 8); + var ug = u4 | g4; + var ret = mod & o4 || mod & g4 && gid === myGid || mod & u4 && uid === myUid || mod & ug && myUid === 0; return ret; } } @@ -224,7 +224,7 @@ var require_isexe = __commonJS({ } module2.exports = isexe; isexe.sync = sync; - function isexe(path5, options, cb) { + function isexe(path7, options, cb) { if (typeof options === "function") { cb = options; options = {}; @@ -234,7 +234,7 @@ var require_isexe = __commonJS({ throw new TypeError("callback not provided"); } return new Promise(function(resolve, reject) { - isexe(path5, options || {}, function(er2, is) { + isexe(path7, options || {}, function(er2, is) { if (er2) { reject(er2); } else { @@ -243,7 +243,7 @@ var require_isexe = __commonJS({ }); }); } - core(path5, options || {}, function(er2, is) { + core(path7, options || {}, function(er2, is) { if (er2) { if (er2.code === "EACCES" || options && options.ignoreErrors) { er2 = null; @@ -253,9 +253,9 @@ var require_isexe = __commonJS({ cb(er2, is); }); } - function sync(path5, options) { + function sync(path7, options) { try { - return core.sync(path5, options || {}); + return core.sync(path7, options || {}); } catch (er2) { if (options && options.ignoreErrors || er2.code === "EACCES") { return false; @@ -271,7 +271,7 @@ var require_isexe = __commonJS({ var require_which = __commonJS({ "node_modules/which/which.js"(exports, module2) { var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys"; - var path5 = require("path"); + var path7 = require("path"); var COLON = isWindows ? ";" : ":"; var isexe = require_isexe(); var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" }); @@ -302,18 +302,18 @@ var require_which = __commonJS({ opt = {}; const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt); const found = []; - const step = (i3) => new Promise((resolve, reject) => { - if (i3 === pathEnv.length) + const step = (i4) => new Promise((resolve, reject) => { + if (i4 === pathEnv.length) return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd)); - const ppRaw = pathEnv[i3]; + const ppRaw = pathEnv[i4]; const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw; - const pCmd = path5.join(pathPart, cmd); + const pCmd = path7.join(pathPart, cmd); const p4 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd; - resolve(subStep(p4, i3, 0)); + resolve(subStep(p4, i4, 0)); }); - const subStep = (p4, i3, ii) => new Promise((resolve, reject) => { + const subStep = (p4, i4, ii) => new Promise((resolve, reject) => { if (ii === pathExt.length) - return resolve(step(i3 + 1)); + return resolve(step(i4 + 1)); const ext = pathExt[ii]; isexe(p4 + ext, { pathExt: pathExtExe }, (er2, is) => { if (!er2 && is) { @@ -322,7 +322,7 @@ var require_which = __commonJS({ else return resolve(p4 + ext); } - return resolve(subStep(p4, i3, ii + 1)); + return resolve(subStep(p4, i4, ii + 1)); }); }); return cb ? step(0).then((res) => cb(null, res), cb) : step(0); @@ -331,10 +331,10 @@ var require_which = __commonJS({ opt = opt || {}; const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt); const found = []; - for (let i3 = 0; i3 < pathEnv.length; i3++) { - const ppRaw = pathEnv[i3]; + for (let i4 = 0; i4 < pathEnv.length; i4++) { + const ppRaw = pathEnv[i4]; const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw; - const pCmd = path5.join(pathPart, cmd); + const pCmd = path7.join(pathPart, cmd); const p4 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd; for (let j4 = 0; j4 < pathExt.length; j4++) { const cur = p4 + pathExt[j4]; @@ -367,8 +367,8 @@ var require_path_key = __commonJS({ "use strict"; var pathKey2 = (options = {}) => { const environment = options.env || process.env; - const platform = options.platform || process.platform; - if (platform !== "win32") { + const platform2 = options.platform || process.platform; + if (platform2 !== "win32") { return "PATH"; } return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path"; @@ -382,7 +382,7 @@ var require_path_key = __commonJS({ var require_resolveCommand = __commonJS({ "node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module2) { "use strict"; - var path5 = require("path"); + var path7 = require("path"); var which = require_which(); var getPathKey = require_path_key(); function resolveCommandAttempt(parsed, withoutPathExt) { @@ -400,7 +400,7 @@ var require_resolveCommand = __commonJS({ try { resolved = which.sync(parsed.command, { path: env2[getPathKey({ env: env2 })], - pathExt: withoutPathExt ? path5.delimiter : void 0 + pathExt: withoutPathExt ? path7.delimiter : void 0 }); } catch (e3) { } finally { @@ -409,7 +409,7 @@ var require_resolveCommand = __commonJS({ } } if (resolved) { - resolved = path5.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved); + resolved = path7.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved); } return resolved; } @@ -463,8 +463,8 @@ var require_shebang_command = __commonJS({ if (!match) { return null; } - const [path5, argument] = match[0].replace(/#! ?/, "").split(" "); - const binary = path5.split("/").pop(); + const [path7, argument] = match[0].replace(/#! ?/, "").split(" "); + const binary = path7.split("/").pop(); if (binary === "env") { return argument; } @@ -499,7 +499,7 @@ var require_readShebang = __commonJS({ var require_parse = __commonJS({ "node_modules/cross-spawn/lib/parse.js"(exports, module2) { "use strict"; - var path5 = require("path"); + var path7 = require("path"); var resolveCommand = require_resolveCommand(); var escape = require_escape(); var readShebang = require_readShebang(); @@ -524,7 +524,7 @@ var require_parse = __commonJS({ const needsShell = !isExecutableRegExp.test(commandFile); if (parsed.options.forceShell || needsShell) { const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile); - parsed.command = path5.normalize(parsed.command); + parsed.command = path7.normalize(parsed.command); parsed.command = escape.command(parsed.command); parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars)); const shellCommand = [parsed.command].concat(parsed.args).join(" "); @@ -614,358 +614,26 @@ var require_cross_spawn = __commonJS({ var cp = require("child_process"); var parse = require_parse(); var enoent = require_enoent(); - function spawn(command, args, options) { + function spawn2(command, args, options) { const parsed = parse(command, args, options); const spawned = cp.spawn(parsed.command, parsed.args, parsed.options); enoent.hookChildProcess(spawned, parsed); return spawned; } - function spawnSync(command, args, options) { + function spawnSync2(command, args, options) { const parsed = parse(command, args, options); const result = cp.spawnSync(parsed.command, parsed.args, parsed.options); result.error = result.error || enoent.verifyENOENTSync(result.status, parsed); return result; } - module2.exports = spawn; - module2.exports.spawn = spawn; - module2.exports.sync = spawnSync; + module2.exports = spawn2; + module2.exports.spawn = spawn2; + module2.exports.sync = spawnSync2; module2.exports._parse = parse; module2.exports._enoent = enoent; } }); -// node_modules/signal-exit/signals.js -var require_signals = __commonJS({ - "node_modules/signal-exit/signals.js"(exports, module2) { - module2.exports = [ - "SIGABRT", - "SIGALRM", - "SIGHUP", - "SIGINT", - "SIGTERM" - ]; - if (process.platform !== "win32") { - module2.exports.push( - "SIGVTALRM", - "SIGXCPU", - "SIGXFSZ", - "SIGUSR2", - "SIGTRAP", - "SIGSYS", - "SIGQUIT", - "SIGIOT" - ); - } - if (process.platform === "linux") { - module2.exports.push( - "SIGIO", - "SIGPOLL", - "SIGPWR", - "SIGSTKFLT", - "SIGUNUSED" - ); - } - } -}); - -// node_modules/signal-exit/index.js -var require_signal_exit = __commonJS({ - "node_modules/signal-exit/index.js"(exports, module2) { - var process9 = global.process; - var processOk = function(process10) { - return process10 && typeof process10 === "object" && typeof process10.removeListener === "function" && typeof process10.emit === "function" && typeof process10.reallyExit === "function" && typeof process10.listeners === "function" && typeof process10.kill === "function" && typeof process10.pid === "number" && typeof process10.on === "function"; - }; - if (!processOk(process9)) { - module2.exports = function() { - return function() { - }; - }; - } else { - assert = require("assert"); - signals = require_signals(); - isWin = /^win/i.test(process9.platform); - EE = require("events"); - if (typeof EE !== "function") { - EE = EE.EventEmitter; - } - if (process9.__signal_exit_emitter__) { - emitter = process9.__signal_exit_emitter__; - } else { - emitter = process9.__signal_exit_emitter__ = new EE(); - emitter.count = 0; - emitter.emitted = {}; - } - if (!emitter.infinite) { - emitter.setMaxListeners(Infinity); - emitter.infinite = true; - } - module2.exports = function(cb, opts) { - if (!processOk(global.process)) { - return function() { - }; - } - assert.equal(typeof cb, "function", "a callback must be provided for exit handler"); - if (loaded === false) { - load(); - } - var ev = "exit"; - if (opts && opts.alwaysLast) { - ev = "afterexit"; - } - var remove = function() { - emitter.removeListener(ev, cb); - if (emitter.listeners("exit").length === 0 && emitter.listeners("afterexit").length === 0) { - unload(); - } - }; - emitter.on(ev, cb); - return remove; - }; - unload = function unload2() { - if (!loaded || !processOk(global.process)) { - return; - } - loaded = false; - signals.forEach(function(sig) { - try { - process9.removeListener(sig, sigListeners[sig]); - } catch (er2) { - } - }); - process9.emit = originalProcessEmit; - process9.reallyExit = originalProcessReallyExit; - emitter.count -= 1; - }; - module2.exports.unload = unload; - emit = function emit2(event, code, signal) { - if (emitter.emitted[event]) { - return; - } - emitter.emitted[event] = true; - emitter.emit(event, code, signal); - }; - sigListeners = {}; - signals.forEach(function(sig) { - sigListeners[sig] = function listener() { - if (!processOk(global.process)) { - return; - } - var listeners = process9.listeners(sig); - if (listeners.length === emitter.count) { - unload(); - emit("exit", null, sig); - emit("afterexit", null, sig); - if (isWin && sig === "SIGHUP") { - sig = "SIGINT"; - } - process9.kill(process9.pid, sig); - } - }; - }); - module2.exports.signals = function() { - return signals; - }; - loaded = false; - load = function load2() { - if (loaded || !processOk(global.process)) { - return; - } - loaded = true; - emitter.count += 1; - signals = signals.filter(function(sig) { - try { - process9.on(sig, sigListeners[sig]); - return true; - } catch (er2) { - return false; - } - }); - process9.emit = processEmit; - process9.reallyExit = processReallyExit; - }; - module2.exports.load = load; - originalProcessReallyExit = process9.reallyExit; - processReallyExit = function processReallyExit2(code) { - if (!processOk(global.process)) { - return; - } - process9.exitCode = code || 0; - emit("exit", process9.exitCode, null); - emit("afterexit", process9.exitCode, null); - originalProcessReallyExit.call(process9, process9.exitCode); - }; - originalProcessEmit = process9.emit; - processEmit = function processEmit2(ev, arg) { - if (ev === "exit" && processOk(global.process)) { - if (arg !== void 0) { - process9.exitCode = arg; - } - var ret = originalProcessEmit.apply(this, arguments); - emit("exit", process9.exitCode, null); - emit("afterexit", process9.exitCode, null); - return ret; - } else { - return originalProcessEmit.apply(this, arguments); - } - }; - } - var assert; - var signals; - var isWin; - var EE; - var emitter; - var unload; - var emit; - var sigListeners; - var loaded; - var load; - var originalProcessReallyExit; - var processReallyExit; - var originalProcessEmit; - var processEmit; - } -}); - -// node_modules/get-stream/buffer-stream.js -var require_buffer_stream = __commonJS({ - "node_modules/get-stream/buffer-stream.js"(exports, module2) { - "use strict"; - var { PassThrough: PassThroughStream } = require("stream"); - module2.exports = (options) => { - options = { ...options }; - const { array } = options; - let { encoding } = options; - const isBuffer2 = encoding === "buffer"; - let objectMode = false; - if (array) { - objectMode = !(encoding || isBuffer2); - } else { - encoding = encoding || "utf8"; - } - if (isBuffer2) { - encoding = null; - } - const stream4 = new PassThroughStream({ objectMode }); - if (encoding) { - stream4.setEncoding(encoding); - } - let length = 0; - const chunks = []; - stream4.on("data", (chunk) => { - chunks.push(chunk); - if (objectMode) { - length = chunks.length; - } else { - length += chunk.length; - } - }); - stream4.getBufferedValue = () => { - if (array) { - return chunks; - } - return isBuffer2 ? Buffer.concat(chunks, length) : chunks.join(""); - }; - stream4.getBufferedLength = () => length; - return stream4; - }; - } -}); - -// node_modules/get-stream/index.js -var require_get_stream = __commonJS({ - "node_modules/get-stream/index.js"(exports, module2) { - "use strict"; - var { constants: BufferConstants } = require("buffer"); - var stream4 = require("stream"); - var { promisify } = require("util"); - var bufferStream = require_buffer_stream(); - var streamPipelinePromisified = promisify(stream4.pipeline); - var MaxBufferError = class extends Error { - constructor() { - super("maxBuffer exceeded"); - this.name = "MaxBufferError"; - } - }; - async function getStream3(inputStream, options) { - if (!inputStream) { - throw new Error("Expected a stream"); - } - options = { - maxBuffer: Infinity, - ...options - }; - const { maxBuffer } = options; - const stream5 = bufferStream(options); - await new Promise((resolve, reject) => { - const rejectPromise = (error) => { - if (error && stream5.getBufferedLength() <= BufferConstants.MAX_LENGTH) { - error.bufferedData = stream5.getBufferedValue(); - } - reject(error); - }; - (async () => { - try { - await streamPipelinePromisified(inputStream, stream5); - resolve(); - } catch (error) { - rejectPromise(error); - } - })(); - stream5.on("data", () => { - if (stream5.getBufferedLength() > maxBuffer) { - rejectPromise(new MaxBufferError()); - } - }); - }); - return stream5.getBufferedValue(); - } - module2.exports = getStream3; - module2.exports.buffer = (stream5, options) => getStream3(stream5, { ...options, encoding: "buffer" }); - module2.exports.array = (stream5, options) => getStream3(stream5, { ...options, array: true }); - module2.exports.MaxBufferError = MaxBufferError; - } -}); - -// node_modules/merge-stream/index.js -var require_merge_stream = __commonJS({ - "node_modules/merge-stream/index.js"(exports, module2) { - "use strict"; - var { PassThrough } = require("stream"); - module2.exports = function() { - var sources = []; - var output = new PassThrough({ objectMode: true }); - output.setMaxListeners(0); - output.add = add; - output.isEmpty = isEmpty; - output.on("unpipe", remove); - Array.prototype.slice.call(arguments).forEach(add); - return output; - function add(source) { - if (Array.isArray(source)) { - source.forEach(add); - return this; - } - sources.push(source); - source.once("end", remove.bind(null, source)); - source.once("error", output.emit.bind(output, "error")); - source.pipe(output, { end: false }); - return this; - } - function isEmpty() { - return sources.length == 0; - } - function remove(source) { - sources = sources.filter(function(it2) { - return it2 !== source; - }); - if (!sources.length && output.readable) { - output.end(); - } - } - }; - } -}); - // node_modules/dotenv/package.json var require_package = __commonJS({ "node_modules/dotenv/package.json"(exports, module2) { @@ -1041,8 +709,8 @@ var require_package = __commonJS({ var require_main = __commonJS({ "node_modules/dotenv/lib/main.js"(exports, module2) { var fs6 = require("fs"); - var path5 = require("path"); - var os4 = require("os"); + var path7 = require("path"); + var os3 = require("os"); var crypto2 = require("crypto"); var packageJson = require_package(); var version = packageJson.version; @@ -1077,14 +745,14 @@ var require_main = __commonJS({ const keys = _dotenvKey(options).split(","); const length = keys.length; let decrypted; - for (let i3 = 0; i3 < length; i3++) { + for (let i4 = 0; i4 < length; i4++) { try { - const key = keys[i3].trim(); + const key = keys[i4].trim(); const attrs = _instructions(result, key); decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key); break; } catch (error) { - if (i3 + 1 >= length) { + if (i4 + 1 >= length) { throw error; } } @@ -1155,7 +823,7 @@ var require_main = __commonJS({ possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`; } } else { - possibleVaultPath = path5.resolve(process.cwd(), ".env.vault"); + possibleVaultPath = path7.resolve(process.cwd(), ".env.vault"); } if (fs6.existsSync(possibleVaultPath)) { return possibleVaultPath; @@ -1163,7 +831,7 @@ var require_main = __commonJS({ return null; } function _resolveHome(envPath) { - return envPath[0] === "~" ? path5.join(os4.homedir(), envPath.slice(1)) : envPath; + return envPath[0] === "~" ? path7.join(os3.homedir(), envPath.slice(1)) : envPath; } function _configVault(options) { _log("Loading env from encrypted .env.vault"); @@ -1176,7 +844,7 @@ var require_main = __commonJS({ return { parsed }; } function configDotenv(options) { - const dotenvPath = path5.resolve(process.cwd(), ".env"); + const dotenvPath = path7.resolve(process.cwd(), ".env"); let encoding = "utf8"; const debug3 = Boolean(options && options.debug); if (options && options.encoding) { @@ -1199,13 +867,13 @@ var require_main = __commonJS({ } let lastError; const parsedAll = {}; - for (const path6 of optionPaths) { + for (const path8 of optionPaths) { try { - const parsed = DotenvModule.parse(fs6.readFileSync(path6, { encoding })); + const parsed = DotenvModule.parse(fs6.readFileSync(path8, { encoding })); DotenvModule.populate(parsedAll, parsed, options); } catch (e3) { if (debug3) { - _debug(`Failed to load ${path6} ${e3.message}`); + _debug(`Failed to load ${path8} ${e3.message}`); } lastError = e3; } @@ -1448,21 +1116,21 @@ var require_ini = __commonJS({ } else { let esc = false; let unesc = ""; - for (let i3 = 0, l3 = val.length; i3 < l3; i3++) { - const c3 = val.charAt(i3); + for (let i4 = 0, l3 = val.length; i4 < l3; i4++) { + const c5 = val.charAt(i4); if (esc) { - if ("\\;#".indexOf(c3) !== -1) { - unesc += c3; + if ("\\;#".indexOf(c5) !== -1) { + unesc += c5; } else { - unesc += "\\" + c3; + unesc += "\\" + c5; } esc = false; - } else if (";#".indexOf(c3) !== -1) { + } else if (";#".indexOf(c5) !== -1) { break; - } else if (c3 === "\\") { + } else if (c5 === "\\") { esc = true; } else { - unesc += c3; + unesc += c5; } } if (esc) { @@ -1586,9 +1254,9 @@ var require_lib = __commonJS({ }; conversions["ByteString"] = function(V6, opts) { const x5 = String(V6); - let c3 = void 0; - for (let i3 = 0; (c3 = x5.codePointAt(i3)) !== void 0; ++i3) { - if (c3 > 255) { + let c5 = void 0; + for (let i4 = 0; (c5 = x5.codePointAt(i4)) !== void 0; ++i4) { + if (c5 > 255) { throw new TypeError("Argument is not a valid bytestring"); } } @@ -1596,24 +1264,24 @@ var require_lib = __commonJS({ }; conversions["USVString"] = function(V6) { const S6 = String(V6); - const n2 = S6.length; + const n3 = S6.length; const U7 = []; - for (let i3 = 0; i3 < n2; ++i3) { - const c3 = S6.charCodeAt(i3); - if (c3 < 55296 || c3 > 57343) { - U7.push(String.fromCodePoint(c3)); - } else if (56320 <= c3 && c3 <= 57343) { + for (let i4 = 0; i4 < n3; ++i4) { + const c5 = S6.charCodeAt(i4); + if (c5 < 55296 || c5 > 57343) { + U7.push(String.fromCodePoint(c5)); + } else if (56320 <= c5 && c5 <= 57343) { U7.push(String.fromCodePoint(65533)); } else { - if (i3 === n2 - 1) { + if (i4 === n3 - 1) { U7.push(String.fromCodePoint(65533)); } else { - const d7 = S6.charCodeAt(i3 + 1); + const d7 = S6.charCodeAt(i4 + 1); if (56320 <= d7 && d7 <= 57343) { - const a4 = c3 & 1023; + const a5 = c5 & 1023; const b7 = d7 & 1023; - U7.push(String.fromCodePoint((2 << 15) + (2 << 9) * a4 + b7)); - ++i3; + U7.push(String.fromCodePoint((2 << 15) + (2 << 9) * a5 + b7)); + ++i4; } else { U7.push(String.fromCodePoint(65533)); } @@ -1646,8 +1314,8 @@ var require_utils = __commonJS({ "use strict"; module2.exports.mixin = function mixin(target, source) { const keys = Object.getOwnPropertyNames(source); - for (let i3 = 0; i3 < keys.length; ++i3) { - Object.defineProperty(target, keys[i3], Object.getOwnPropertyDescriptor(source, keys[i3])); + for (let i4 = 0; i4 < keys.length; ++i4) { + Object.defineProperty(target, keys[i4], Object.getOwnPropertyDescriptor(source, keys[i4])); } }; module2.exports.wrapperSymbol = Symbol("wrapper"); @@ -1707,8 +1375,8 @@ var require_tr46 = __commonJS({ var hasError = false; var processed = ""; var len = countSymbols(domain_name); - for (var i3 = 0; i3 < len; ++i3) { - var codePoint = domain_name.codePointAt(i3); + for (var i4 = 0; i4 < len; ++i4) { + var codePoint = domain_name.codePointAt(i4); var status = findStatus(codePoint); switch (status[1]) { case "disallowed": @@ -1762,8 +1430,8 @@ var require_tr46 = __commonJS({ error = true; } var len = countSymbols(label); - for (var i3 = 0; i3 < len; ++i3) { - var status = findStatus(label.codePointAt(i3)); + for (var i4 = 0; i4 < len; ++i4) { + var status = findStatus(label.codePointAt(i4)); if (processing === PROCESSING_OPTIONS.TRANSITIONAL && status[1] !== "valid" || processing === PROCESSING_OPTIONS.NONTRANSITIONAL && status[1] !== "valid" && status[1] !== "deviation") { error = true; break; @@ -1778,10 +1446,10 @@ var require_tr46 = __commonJS({ var result = mapChars(domain_name, useSTD3, processing_option); result.string = normalize(result.string); var labels = result.string.split("."); - for (var i3 = 0; i3 < labels.length; ++i3) { + for (var i4 = 0; i4 < labels.length; ++i4) { try { - var validation = validateLabel(labels[i3]); - labels[i3] = validation.label; + var validation = validateLabel(labels[i4]); + labels[i4] = validation.label; result.error = result.error || validation.error; } catch (e3) { result.error = true; @@ -1808,7 +1476,7 @@ var require_tr46 = __commonJS({ if (total.length > 253 || total.length === 0) { result.error = true; } - for (var i3 = 0; i3 < labels.length; ++i3) { + for (var i4 = 0; i4 < labels.length; ++i4) { if (labels.length > 63 || labels.length === 0) { result.error = true; break; @@ -1850,20 +1518,20 @@ var require_url_state_machine = __commonJS({ return punycode.ucs2.decode(str2).length; } function at2(input, idx) { - const c3 = input[idx]; - return isNaN(c3) ? void 0 : String.fromCodePoint(c3); + const c5 = input[idx]; + return isNaN(c5) ? void 0 : String.fromCodePoint(c5); } - function isASCIIDigit(c3) { - return c3 >= 48 && c3 <= 57; + function isASCIIDigit(c5) { + return c5 >= 48 && c5 <= 57; } - function isASCIIAlpha(c3) { - return c3 >= 65 && c3 <= 90 || c3 >= 97 && c3 <= 122; + function isASCIIAlpha(c5) { + return c5 >= 65 && c5 <= 90 || c5 >= 97 && c5 <= 122; } - function isASCIIAlphanumeric(c3) { - return isASCIIAlpha(c3) || isASCIIDigit(c3); + function isASCIIAlphanumeric(c5) { + return isASCIIAlpha(c5) || isASCIIDigit(c5); } - function isASCIIHex(c3) { - return isASCIIDigit(c3) || c3 >= 65 && c3 <= 70 || c3 >= 97 && c3 <= 102; + function isASCIIHex(c5) { + return isASCIIDigit(c5) || c5 >= 65 && c5 <= 70 || c5 >= 97 && c5 <= 102; } function isSingleDot(buffer) { return buffer === "." || buffer.toLowerCase() === "%2e"; @@ -1896,50 +1564,50 @@ var require_url_state_machine = __commonJS({ function defaultPort(scheme) { return specialSchemes[scheme]; } - function percentEncode(c3) { - let hex = c3.toString(16).toUpperCase(); + function percentEncode(c5) { + let hex = c5.toString(16).toUpperCase(); if (hex.length === 1) { hex = "0" + hex; } return "%" + hex; } - function utf8PercentEncode(c3) { - const buf = new Buffer(c3); + function utf8PercentEncode(c5) { + const buf = new Buffer(c5); let str2 = ""; - for (let i3 = 0; i3 < buf.length; ++i3) { - str2 += percentEncode(buf[i3]); + for (let i4 = 0; i4 < buf.length; ++i4) { + str2 += percentEncode(buf[i4]); } return str2; } function utf8PercentDecode(str2) { const input = new Buffer(str2); const output = []; - for (let i3 = 0; i3 < input.length; ++i3) { - if (input[i3] !== 37) { - output.push(input[i3]); - } else if (input[i3] === 37 && isASCIIHex(input[i3 + 1]) && isASCIIHex(input[i3 + 2])) { - output.push(parseInt(input.slice(i3 + 1, i3 + 3).toString(), 16)); - i3 += 2; + for (let i4 = 0; i4 < input.length; ++i4) { + if (input[i4] !== 37) { + output.push(input[i4]); + } else if (input[i4] === 37 && isASCIIHex(input[i4 + 1]) && isASCIIHex(input[i4 + 2])) { + output.push(parseInt(input.slice(i4 + 1, i4 + 3).toString(), 16)); + i4 += 2; } else { - output.push(input[i3]); + output.push(input[i4]); } } return new Buffer(output).toString(); } - function isC0ControlPercentEncode(c3) { - return c3 <= 31 || c3 > 126; + function isC0ControlPercentEncode(c5) { + return c5 <= 31 || c5 > 126; } var extraPathPercentEncodeSet = /* @__PURE__ */ new Set([32, 34, 35, 60, 62, 63, 96, 123, 125]); - function isPathPercentEncode(c3) { - return isC0ControlPercentEncode(c3) || extraPathPercentEncodeSet.has(c3); + function isPathPercentEncode(c5) { + return isC0ControlPercentEncode(c5) || extraPathPercentEncodeSet.has(c5); } var extraUserinfoPercentEncodeSet = /* @__PURE__ */ new Set([47, 58, 59, 61, 64, 91, 92, 93, 94, 124]); - function isUserinfoPercentEncode(c3) { - return isPathPercentEncode(c3) || extraUserinfoPercentEncodeSet.has(c3); + function isUserinfoPercentEncode(c5) { + return isPathPercentEncode(c5) || extraUserinfoPercentEncodeSet.has(c5); } - function percentEncodeChar(c3, encodeSetPredicate) { - const cStr = String.fromCodePoint(c3); - if (encodeSetPredicate(c3)) { + function percentEncodeChar(c5, encodeSetPredicate) { + const cStr = String.fromCodePoint(c5); + if (encodeSetPredicate(c5)) { return utf8PercentEncode(cStr); } return cStr; @@ -1977,14 +1645,14 @@ var require_url_state_machine = __commonJS({ if (part === "") { return input; } - const n2 = parseIPv4Number(part); - if (n2 === failure) { + const n3 = parseIPv4Number(part); + if (n3 === failure) { return input; } - numbers.push(n2); + numbers.push(n3); } - for (let i3 = 0; i3 < numbers.length - 1; ++i3) { - if (numbers[i3] > 255) { + for (let i4 = 0; i4 < numbers.length - 1; ++i4) { + if (numbers[i4] > 255) { return failure; } } @@ -1993,21 +1661,21 @@ var require_url_state_machine = __commonJS({ } let ipv4 = numbers.pop(); let counter = 0; - for (const n2 of numbers) { - ipv4 += n2 * Math.pow(256, 3 - counter); + for (const n3 of numbers) { + ipv4 += n3 * Math.pow(256, 3 - counter); ++counter; } return ipv4; } function serializeIPv4(address) { let output = ""; - let n2 = address; - for (let i3 = 1; i3 <= 4; ++i3) { - output = String(n2 % 256) + output; - if (i3 !== 4) { + let n3 = address; + for (let i4 = 1; i4 <= 4; ++i4) { + output = String(n3 % 256) + output; + if (i4 !== 4) { output = "." + output; } - n2 = Math.floor(n2 / 256); + n3 = Math.floor(n3 / 256); } return output; } @@ -2170,8 +1838,8 @@ var require_url_state_machine = __commonJS({ } let output = ""; const decoded = punycode.ucs2.decode(input); - for (let i3 = 0; i3 < decoded.length; ++i3) { - output += percentEncodeChar(decoded[i3], isC0ControlPercentEncode); + for (let i4 = 0; i4 < decoded.length; ++i4) { + output += percentEncodeChar(decoded[i4], isC0ControlPercentEncode); } return output; } @@ -2180,8 +1848,8 @@ var require_url_state_machine = __commonJS({ let maxLen = 1; let currStart = null; let currLen = 0; - for (let i3 = 0; i3 < arr.length; ++i3) { - if (arr[i3] !== 0) { + for (let i4 = 0; i4 < arr.length; ++i4) { + if (arr[i4] !== 0) { if (currLen > maxLen) { maxIdx = currStart; maxLen = currLen; @@ -2190,7 +1858,7 @@ var require_url_state_machine = __commonJS({ currLen = 0; } else { if (currStart === null) { - currStart = i3; + currStart = i4; } ++currLen; } @@ -2220,14 +1888,14 @@ var require_url_state_machine = __commonJS({ return url2.replace(/\u0009|\u000A|\u000D/g, ""); } function shortenPath(url2) { - const path5 = url2.path; - if (path5.length === 0) { + const path7 = url2.path; + if (path7.length === 0) { return; } - if (url2.scheme === "file" && path5.length === 1 && isNormalizedWindowsDriveLetter(path5[0])) { + if (url2.scheme === "file" && path7.length === 1 && isNormalizedWindowsDriveLetter(path7[0])) { return; } - path5.pop(); + path7.pop(); } function includesCredentials(url2) { return url2.username !== "" || url2.password !== ""; @@ -2277,9 +1945,9 @@ var require_url_state_machine = __commonJS({ this.passwordTokenSeenFlag = false; this.input = punycode.ucs2.decode(this.input); for (; this.pointer <= this.input.length; ++this.pointer) { - const c3 = this.input[this.pointer]; - const cStr = isNaN(c3) ? void 0 : String.fromCodePoint(c3); - const ret = this["parse " + this.state](c3, cStr); + const c5 = this.input[this.pointer]; + const cStr = isNaN(c5) ? void 0 : String.fromCodePoint(c5); + const ret = this["parse " + this.state](c5, cStr); if (!ret) { break; } else if (ret === failure) { @@ -2288,8 +1956,8 @@ var require_url_state_machine = __commonJS({ } } } - URLStateMachine.prototype["parse scheme start"] = function parseSchemeStart(c3, cStr) { - if (isASCIIAlpha(c3)) { + URLStateMachine.prototype["parse scheme start"] = function parseSchemeStart(c5, cStr) { + if (isASCIIAlpha(c5)) { this.buffer += cStr.toLowerCase(); this.state = "scheme"; } else if (!this.stateOverride) { @@ -2301,10 +1969,10 @@ var require_url_state_machine = __commonJS({ } return true; }; - URLStateMachine.prototype["parse scheme"] = function parseScheme(c3, cStr) { - if (isASCIIAlphanumeric(c3) || c3 === 43 || c3 === 45 || c3 === 46) { + URLStateMachine.prototype["parse scheme"] = function parseScheme(c5, cStr) { + if (isASCIIAlphanumeric(c5) || c5 === 43 || c5 === 45 || c5 === 46) { this.buffer += cStr.toLowerCase(); - } else if (c3 === 58) { + } else if (c5 === 58) { if (this.stateOverride) { if (isSpecial(this.url) && !isSpecialScheme(this.buffer)) { return false; @@ -2351,10 +2019,10 @@ var require_url_state_machine = __commonJS({ } return true; }; - URLStateMachine.prototype["parse no scheme"] = function parseNoScheme(c3) { - if (this.base === null || this.base.cannotBeABaseURL && c3 !== 35) { + URLStateMachine.prototype["parse no scheme"] = function parseNoScheme(c5) { + if (this.base === null || this.base.cannotBeABaseURL && c5 !== 35) { return failure; - } else if (this.base.cannotBeABaseURL && c3 === 35) { + } else if (this.base.cannotBeABaseURL && c5 === 35) { this.url.scheme = this.base.scheme; this.url.path = this.base.path.slice(); this.url.query = this.base.query; @@ -2370,8 +2038,8 @@ var require_url_state_machine = __commonJS({ } return true; }; - URLStateMachine.prototype["parse special relative or authority"] = function parseSpecialRelativeOrAuthority(c3) { - if (c3 === 47 && this.input[this.pointer + 1] === 47) { + URLStateMachine.prototype["parse special relative or authority"] = function parseSpecialRelativeOrAuthority(c5) { + if (c5 === 47 && this.input[this.pointer + 1] === 47) { this.state = "special authority ignore slashes"; ++this.pointer; } else { @@ -2381,8 +2049,8 @@ var require_url_state_machine = __commonJS({ } return true; }; - URLStateMachine.prototype["parse path or authority"] = function parsePathOrAuthority(c3) { - if (c3 === 47) { + URLStateMachine.prototype["parse path or authority"] = function parsePathOrAuthority(c5) { + if (c5 === 47) { this.state = "authority"; } else { this.state = "path"; @@ -2390,18 +2058,18 @@ var require_url_state_machine = __commonJS({ } return true; }; - URLStateMachine.prototype["parse relative"] = function parseRelative(c3) { + URLStateMachine.prototype["parse relative"] = function parseRelative(c5) { this.url.scheme = this.base.scheme; - if (isNaN(c3)) { + if (isNaN(c5)) { this.url.username = this.base.username; this.url.password = this.base.password; this.url.host = this.base.host; this.url.port = this.base.port; this.url.path = this.base.path.slice(); this.url.query = this.base.query; - } else if (c3 === 47) { + } else if (c5 === 47) { this.state = "relative slash"; - } else if (c3 === 63) { + } else if (c5 === 63) { this.url.username = this.base.username; this.url.password = this.base.password; this.url.host = this.base.host; @@ -2409,7 +2077,7 @@ var require_url_state_machine = __commonJS({ this.url.path = this.base.path.slice(); this.url.query = ""; this.state = "query"; - } else if (c3 === 35) { + } else if (c5 === 35) { this.url.username = this.base.username; this.url.password = this.base.password; this.url.host = this.base.host; @@ -2418,7 +2086,7 @@ var require_url_state_machine = __commonJS({ this.url.query = this.base.query; this.url.fragment = ""; this.state = "fragment"; - } else if (isSpecial(this.url) && c3 === 92) { + } else if (isSpecial(this.url) && c5 === 92) { this.parseError = true; this.state = "relative slash"; } else { @@ -2432,13 +2100,13 @@ var require_url_state_machine = __commonJS({ } return true; }; - URLStateMachine.prototype["parse relative slash"] = function parseRelativeSlash(c3) { - if (isSpecial(this.url) && (c3 === 47 || c3 === 92)) { - if (c3 === 92) { + URLStateMachine.prototype["parse relative slash"] = function parseRelativeSlash(c5) { + if (isSpecial(this.url) && (c5 === 47 || c5 === 92)) { + if (c5 === 92) { this.parseError = true; } this.state = "special authority ignore slashes"; - } else if (c3 === 47) { + } else if (c5 === 47) { this.state = "authority"; } else { this.url.username = this.base.username; @@ -2450,8 +2118,8 @@ var require_url_state_machine = __commonJS({ } return true; }; - URLStateMachine.prototype["parse special authority slashes"] = function parseSpecialAuthoritySlashes(c3) { - if (c3 === 47 && this.input[this.pointer + 1] === 47) { + URLStateMachine.prototype["parse special authority slashes"] = function parseSpecialAuthoritySlashes(c5) { + if (c5 === 47 && this.input[this.pointer + 1] === 47) { this.state = "special authority ignore slashes"; ++this.pointer; } else { @@ -2461,8 +2129,8 @@ var require_url_state_machine = __commonJS({ } return true; }; - URLStateMachine.prototype["parse special authority ignore slashes"] = function parseSpecialAuthorityIgnoreSlashes(c3) { - if (c3 !== 47 && c3 !== 92) { + URLStateMachine.prototype["parse special authority ignore slashes"] = function parseSpecialAuthorityIgnoreSlashes(c5) { + if (c5 !== 47 && c5 !== 92) { this.state = "authority"; --this.pointer; } else { @@ -2470,8 +2138,8 @@ var require_url_state_machine = __commonJS({ } return true; }; - URLStateMachine.prototype["parse authority"] = function parseAuthority(c3, cStr) { - if (c3 === 64) { + URLStateMachine.prototype["parse authority"] = function parseAuthority(c5, cStr) { + if (c5 === 64) { this.parseError = true; if (this.atFlag) { this.buffer = "%40" + this.buffer; @@ -2492,7 +2160,7 @@ var require_url_state_machine = __commonJS({ } } this.buffer = ""; - } else if (isNaN(c3) || c3 === 47 || c3 === 63 || c3 === 35 || isSpecial(this.url) && c3 === 92) { + } else if (isNaN(c5) || c5 === 47 || c5 === 63 || c5 === 35 || isSpecial(this.url) && c5 === 92) { if (this.atFlag && this.buffer === "") { this.parseError = true; return failure; @@ -2505,11 +2173,11 @@ var require_url_state_machine = __commonJS({ } return true; }; - URLStateMachine.prototype["parse hostname"] = URLStateMachine.prototype["parse host"] = function parseHostName(c3, cStr) { + URLStateMachine.prototype["parse hostname"] = URLStateMachine.prototype["parse host"] = function parseHostName(c5, cStr) { if (this.stateOverride && this.url.scheme === "file") { --this.pointer; this.state = "file host"; - } else if (c3 === 58 && !this.arrFlag) { + } else if (c5 === 58 && !this.arrFlag) { if (this.buffer === "") { this.parseError = true; return failure; @@ -2524,7 +2192,7 @@ var require_url_state_machine = __commonJS({ if (this.stateOverride === "hostname") { return false; } - } else if (isNaN(c3) || c3 === 47 || c3 === 63 || c3 === 35 || isSpecial(this.url) && c3 === 92) { + } else if (isNaN(c5) || c5 === 47 || c5 === 63 || c5 === 35 || isSpecial(this.url) && c5 === 92) { --this.pointer; if (isSpecial(this.url) && this.buffer === "") { this.parseError = true; @@ -2544,19 +2212,19 @@ var require_url_state_machine = __commonJS({ return false; } } else { - if (c3 === 91) { + if (c5 === 91) { this.arrFlag = true; - } else if (c3 === 93) { + } else if (c5 === 93) { this.arrFlag = false; } this.buffer += cStr; } return true; }; - URLStateMachine.prototype["parse port"] = function parsePort(c3, cStr) { - if (isASCIIDigit(c3)) { + URLStateMachine.prototype["parse port"] = function parsePort(c5, cStr) { + if (isASCIIDigit(c5)) { this.buffer += cStr; - } else if (isNaN(c3) || c3 === 47 || c3 === 63 || c3 === 35 || isSpecial(this.url) && c3 === 92 || this.stateOverride) { + } else if (isNaN(c5) || c5 === 47 || c5 === 63 || c5 === 35 || isSpecial(this.url) && c5 === 92 || this.stateOverride) { if (this.buffer !== "") { const port = parseInt(this.buffer); if (port > Math.pow(2, 16) - 1) { @@ -2578,31 +2246,31 @@ var require_url_state_machine = __commonJS({ return true; }; var fileOtherwiseCodePoints = /* @__PURE__ */ new Set([47, 92, 63, 35]); - URLStateMachine.prototype["parse file"] = function parseFile(c3) { + URLStateMachine.prototype["parse file"] = function parseFile(c5) { this.url.scheme = "file"; - if (c3 === 47 || c3 === 92) { - if (c3 === 92) { + if (c5 === 47 || c5 === 92) { + if (c5 === 92) { this.parseError = true; } this.state = "file slash"; } else if (this.base !== null && this.base.scheme === "file") { - if (isNaN(c3)) { + if (isNaN(c5)) { this.url.host = this.base.host; this.url.path = this.base.path.slice(); this.url.query = this.base.query; - } else if (c3 === 63) { + } else if (c5 === 63) { this.url.host = this.base.host; this.url.path = this.base.path.slice(); this.url.query = ""; this.state = "query"; - } else if (c3 === 35) { + } else if (c5 === 35) { this.url.host = this.base.host; this.url.path = this.base.path.slice(); this.url.query = this.base.query; this.url.fragment = ""; this.state = "fragment"; } else { - if (this.input.length - this.pointer - 1 === 0 || !isWindowsDriveLetterCodePoints(c3, this.input[this.pointer + 1]) || this.input.length - this.pointer - 1 >= 2 && !fileOtherwiseCodePoints.has(this.input[this.pointer + 2])) { + if (this.input.length - this.pointer - 1 === 0 || !isWindowsDriveLetterCodePoints(c5, this.input[this.pointer + 1]) || this.input.length - this.pointer - 1 >= 2 && !fileOtherwiseCodePoints.has(this.input[this.pointer + 2])) { this.url.host = this.base.host; this.url.path = this.base.path.slice(); shortenPath(this.url); @@ -2618,9 +2286,9 @@ var require_url_state_machine = __commonJS({ } return true; }; - URLStateMachine.prototype["parse file slash"] = function parseFileSlash(c3) { - if (c3 === 47 || c3 === 92) { - if (c3 === 92) { + URLStateMachine.prototype["parse file slash"] = function parseFileSlash(c5) { + if (c5 === 47 || c5 === 92) { + if (c5 === 92) { this.parseError = true; } this.state = "file host"; @@ -2637,8 +2305,8 @@ var require_url_state_machine = __commonJS({ } return true; }; - URLStateMachine.prototype["parse file host"] = function parseFileHost(c3, cStr) { - if (isNaN(c3) || c3 === 47 || c3 === 92 || c3 === 63 || c3 === 35) { + URLStateMachine.prototype["parse file host"] = function parseFileHost(c5, cStr) { + if (isNaN(c5) || c5 === 47 || c5 === 92 || c5 === 63 || c5 === 35) { --this.pointer; if (!this.stateOverride && isWindowsDriveLetterString(this.buffer)) { this.parseError = true; @@ -2669,40 +2337,40 @@ var require_url_state_machine = __commonJS({ } return true; }; - URLStateMachine.prototype["parse path start"] = function parsePathStart(c3) { + URLStateMachine.prototype["parse path start"] = function parsePathStart(c5) { if (isSpecial(this.url)) { - if (c3 === 92) { + if (c5 === 92) { this.parseError = true; } this.state = "path"; - if (c3 !== 47 && c3 !== 92) { + if (c5 !== 47 && c5 !== 92) { --this.pointer; } - } else if (!this.stateOverride && c3 === 63) { + } else if (!this.stateOverride && c5 === 63) { this.url.query = ""; this.state = "query"; - } else if (!this.stateOverride && c3 === 35) { + } else if (!this.stateOverride && c5 === 35) { this.url.fragment = ""; this.state = "fragment"; - } else if (c3 !== void 0) { + } else if (c5 !== void 0) { this.state = "path"; - if (c3 !== 47) { + if (c5 !== 47) { --this.pointer; } } return true; }; - URLStateMachine.prototype["parse path"] = function parsePath(c3) { - if (isNaN(c3) || c3 === 47 || isSpecial(this.url) && c3 === 92 || !this.stateOverride && (c3 === 63 || c3 === 35)) { - if (isSpecial(this.url) && c3 === 92) { + URLStateMachine.prototype["parse path"] = function parsePath(c5) { + if (isNaN(c5) || c5 === 47 || isSpecial(this.url) && c5 === 92 || !this.stateOverride && (c5 === 63 || c5 === 35)) { + if (isSpecial(this.url) && c5 === 92) { this.parseError = true; } if (isDoubleDot(this.buffer)) { shortenPath(this.url); - if (c3 !== 47 && !(isSpecial(this.url) && c3 === 92)) { + if (c5 !== 47 && !(isSpecial(this.url) && c5 === 92)) { this.url.path.push(""); } - } else if (isSingleDot(this.buffer) && c3 !== 47 && !(isSpecial(this.url) && c3 === 92)) { + } else if (isSingleDot(this.buffer) && c5 !== 47 && !(isSpecial(this.url) && c5 === 92)) { this.url.path.push(""); } else if (!isSingleDot(this.buffer)) { if (this.url.scheme === "file" && this.url.path.length === 0 && isWindowsDriveLetterString(this.buffer)) { @@ -2715,83 +2383,83 @@ var require_url_state_machine = __commonJS({ this.url.path.push(this.buffer); } this.buffer = ""; - if (this.url.scheme === "file" && (c3 === void 0 || c3 === 63 || c3 === 35)) { + if (this.url.scheme === "file" && (c5 === void 0 || c5 === 63 || c5 === 35)) { while (this.url.path.length > 1 && this.url.path[0] === "") { this.parseError = true; this.url.path.shift(); } } - if (c3 === 63) { + if (c5 === 63) { this.url.query = ""; this.state = "query"; } - if (c3 === 35) { + if (c5 === 35) { this.url.fragment = ""; this.state = "fragment"; } } else { - if (c3 === 37 && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) { + if (c5 === 37 && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) { this.parseError = true; } - this.buffer += percentEncodeChar(c3, isPathPercentEncode); + this.buffer += percentEncodeChar(c5, isPathPercentEncode); } return true; }; - URLStateMachine.prototype["parse cannot-be-a-base-URL path"] = function parseCannotBeABaseURLPath(c3) { - if (c3 === 63) { + URLStateMachine.prototype["parse cannot-be-a-base-URL path"] = function parseCannotBeABaseURLPath(c5) { + if (c5 === 63) { this.url.query = ""; this.state = "query"; - } else if (c3 === 35) { + } else if (c5 === 35) { this.url.fragment = ""; this.state = "fragment"; } else { - if (!isNaN(c3) && c3 !== 37) { + if (!isNaN(c5) && c5 !== 37) { this.parseError = true; } - if (c3 === 37 && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) { + if (c5 === 37 && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) { this.parseError = true; } - if (!isNaN(c3)) { - this.url.path[0] = this.url.path[0] + percentEncodeChar(c3, isC0ControlPercentEncode); + if (!isNaN(c5)) { + this.url.path[0] = this.url.path[0] + percentEncodeChar(c5, isC0ControlPercentEncode); } } return true; }; - URLStateMachine.prototype["parse query"] = function parseQuery(c3, cStr) { - if (isNaN(c3) || !this.stateOverride && c3 === 35) { + URLStateMachine.prototype["parse query"] = function parseQuery(c5, cStr) { + if (isNaN(c5) || !this.stateOverride && c5 === 35) { if (!isSpecial(this.url) || this.url.scheme === "ws" || this.url.scheme === "wss") { this.encodingOverride = "utf-8"; } const buffer = new Buffer(this.buffer); - for (let i3 = 0; i3 < buffer.length; ++i3) { - if (buffer[i3] < 33 || buffer[i3] > 126 || buffer[i3] === 34 || buffer[i3] === 35 || buffer[i3] === 60 || buffer[i3] === 62) { - this.url.query += percentEncode(buffer[i3]); + for (let i4 = 0; i4 < buffer.length; ++i4) { + if (buffer[i4] < 33 || buffer[i4] > 126 || buffer[i4] === 34 || buffer[i4] === 35 || buffer[i4] === 60 || buffer[i4] === 62) { + this.url.query += percentEncode(buffer[i4]); } else { - this.url.query += String.fromCodePoint(buffer[i3]); + this.url.query += String.fromCodePoint(buffer[i4]); } } this.buffer = ""; - if (c3 === 35) { + if (c5 === 35) { this.url.fragment = ""; this.state = "fragment"; } } else { - if (c3 === 37 && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) { + if (c5 === 37 && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) { this.parseError = true; } this.buffer += cStr; } return true; }; - URLStateMachine.prototype["parse fragment"] = function parseFragment(c3) { - if (isNaN(c3)) { - } else if (c3 === 0) { + URLStateMachine.prototype["parse fragment"] = function parseFragment(c5) { + if (isNaN(c5)) { + } else if (c5 === 0) { this.parseError = true; } else { - if (c3 === 37 && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) { + if (c5 === 37 && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) { this.parseError = true; } - this.url.fragment += percentEncodeChar(c3, isC0ControlPercentEncode); + this.url.fragment += percentEncodeChar(c5, isC0ControlPercentEncode); } return true; }; @@ -2875,15 +2543,15 @@ var require_url_state_machine = __commonJS({ module2.exports.setTheUsername = function(url2, username) { url2.username = ""; const decoded = punycode.ucs2.decode(username); - for (let i3 = 0; i3 < decoded.length; ++i3) { - url2.username += percentEncodeChar(decoded[i3], isUserinfoPercentEncode); + for (let i4 = 0; i4 < decoded.length; ++i4) { + url2.username += percentEncodeChar(decoded[i4], isUserinfoPercentEncode); } }; module2.exports.setThePassword = function(url2, password) { url2.password = ""; const decoded = punycode.ucs2.decode(password); - for (let i3 = 0; i3 < decoded.length; ++i3) { - url2.password += percentEncodeChar(decoded[i3], isUserinfoPercentEncode); + for (let i4 = 0; i4 < decoded.length; ++i4) { + url2.password += percentEncodeChar(decoded[i4], isUserinfoPercentEncode); } }; module2.exports.serializeHost = serializeHost; @@ -3073,8 +2741,8 @@ var require_URL = __commonJS({ throw new TypeError("Failed to construct 'URL': 1 argument required, but only " + arguments.length + " present."); } const args = []; - for (let i3 = 0; i3 < arguments.length && i3 < 2; ++i3) { - args[i3] = arguments[i3]; + for (let i4 = 0; i4 < arguments.length && i4 < 2; ++i4) { + args[i4] = arguments[i4]; } args[0] = conversions["USVString"](args[0]); if (args[1] !== void 0) { @@ -3087,8 +2755,8 @@ var require_URL = __commonJS({ throw new TypeError("Illegal invocation"); } const args = []; - for (let i3 = 0; i3 < arguments.length && i3 < 0; ++i3) { - args[i3] = arguments[i3]; + for (let i4 = 0; i4 < arguments.length && i4 < 0; ++i4) { + args[i4] = arguments[i4]; } return this[impl].toJSON.apply(this[impl], args); }; @@ -3270,7 +2938,7 @@ var require_lib2 = __commonJS({ var whatwgUrl = _interopDefault(require_public_api()); var https3 = _interopDefault(require("https")); var zlib3 = _interopDefault(require("zlib")); - var Readable5 = Stream3.Readable; + var Readable8 = Stream3.Readable; var BUFFER = Symbol("buffer"); var TYPE = Symbol("type"); var Blob5 = class { @@ -3281,10 +2949,10 @@ var require_lib2 = __commonJS({ const buffers = []; let size = 0; if (blobParts) { - const a4 = blobParts; - const length = Number(a4.length); - for (let i3 = 0; i3 < length; i3++) { - const element = a4[i3]; + const a5 = blobParts; + const length = Number(a5.length); + for (let i4 = 0; i4 < length; i4++) { + const element = a5[i4]; let buffer; if (element instanceof Buffer) { buffer = element; @@ -3322,12 +2990,12 @@ var require_lib2 = __commonJS({ return Promise.resolve(ab); } stream() { - const readable = new Readable5(); - readable._read = function() { + const readable2 = new Readable8(); + readable2._read = function() { }; - readable.push(this[BUFFER]); - readable.push(null); - return readable; + readable2.push(this[BUFFER]); + readable2.push(null); + return readable2; } toString() { return "[object Blob]"; @@ -3388,7 +3056,7 @@ var require_lib2 = __commonJS({ } catch (e3) { } var INTERNALS = Symbol("Body internals"); - var PassThrough = Stream3.PassThrough; + var PassThrough2 = Stream3.PassThrough; function Body(body) { var _this = this; var _ref = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, _ref$size = _ref.size; @@ -3611,8 +3279,8 @@ var require_lib2 = __commonJS({ throw new Error("cannot clone body after it is used"); } if (body instanceof Stream3 && typeof body.getBoundary !== "function") { - p1 = new PassThrough(); - p22 = new PassThrough(); + p1 = new PassThrough2(); + p22 = new PassThrough2(); body.pipe(p1); body.pipe(p22); instance[INTERNALS].body = p1; @@ -3755,13 +3423,13 @@ var require_lib2 = __commonJS({ forEach(callback) { let thisArg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : void 0; let pairs = getHeaders2(this); - let i3 = 0; - while (i3 < pairs.length) { - var _pairs$i = pairs[i3]; + let i4 = 0; + while (i4 < pairs.length) { + var _pairs$i = pairs[i4]; const name = _pairs$i[0], value = _pairs$i[1]; callback.call(thisArg, value, name, this); pairs = getHeaders2(this); - i3++; + i4++; } } set(name, value) { @@ -4396,28 +4064,28 @@ function t() { function r2(e3) { return "object" == typeof e3 && null !== e3 || "function" == typeof e3; } -function n(e3, t2) { +function n2(e3, t2) { try { Object.defineProperty(e3, "name", { value: t2, configurable: true }); } catch (e4) { } } -function u2(e3) { - return new a3(e3); +function u3(e3) { + return new a4(e3); } -function c2(e3) { +function c4(e3) { return l2(e3); } function d6(e3) { return s(e3); } function f3(e3, t2, r3) { - return i2.call(e3, t2, r3); + return i3.call(e3, t2, r3); } function b6(e3, t2, r3) { - f3(f3(e3, t2, r3), void 0, o2); + f3(f3(e3, t2, r3), void 0, o3); } -function h3(e3, t2) { +function h4(e3, t2) { b6(e3, t2); } function _6(e3, t2) { @@ -4427,7 +4095,7 @@ function p3(e3, t2, r3) { return f3(e3, t2, r3); } function m4(e3) { - f3(e3, void 0, o2); + f3(e3, void 0, o3); } function g3(e3, t2, r3) { if ("function" != typeof e3) @@ -4436,7 +4104,7 @@ function g3(e3, t2, r3) { } function w6(e3, t2, r3) { try { - return c2(g3(e3, t2, r3)); + return c4(g3(e3, t2, r3)); } catch (e4) { return d6(e4); } @@ -4459,7 +4127,7 @@ function k6(e3) { return new TypeError("Cannot " + e3 + " a stream using a released reader"); } function O4(e3) { - e3._closedPromise = u2((t2, r3) => { + e3._closedPromise = u3((t2, r3) => { e3._closedPromise_resolve = t2, e3._closedPromise_reject = r3; }); } @@ -4503,14 +4171,14 @@ function Q4(e3) { } function N5(e3, t2) { const r3 = Number.MAX_SAFE_INTEGER; - let o3 = Number(e3); - if (o3 = Q4(o3), !z5(o3)) + let o4 = Number(e3); + if (o4 = Q4(o4), !z5(o4)) throw new TypeError(`${t2} is not a finite number`); - if (o3 = function(e4) { + if (o4 = function(e4) { return Q4(L6(e4)); - }(o3), o3 < 0 || o3 > r3) + }(o4), o4 < 0 || o4 > r3) throw new TypeError(`${t2} is outside the accepted range of 0 to ${r3}, inclusive`); - return z5(o3) && 0 !== o3 ? o3 : 0; + return z5(o4) && 0 !== o4 ? o4 : 0; } function H4(e3) { if (!r2(e3)) @@ -4542,8 +4210,8 @@ function U6(e3, t2) { e3._reader._readRequests.push(t2); } function G5(e3, t2, r3) { - const o3 = e3._reader._readRequests.shift(); - r3 ? o3._closeSteps() : o3._chunkSteps(t2); + const o4 = e3._reader._readRequests.shift(); + r3 ? o4._closeSteps() : o4._chunkSteps(t2); } function X4(e3) { return e3._reader._readRequests.length; @@ -4578,15 +4246,15 @@ function oe(e3) { function ne(e3) { return new TypeError(`ReadableStreamAsyncIterator.${e3} can only be used on a ReadableSteamAsyncIterator`); } -function ie2(e3, t2, r3, o3, n2) { - new Uint8Array(e3).set(new Uint8Array(r3, o3, n2), t2); +function ie2(e3, t2, r3, o4, n3) { + new Uint8Array(e3).set(new Uint8Array(r3, o4, n3), t2); } function le2(e3) { const t2 = function(e4, t3, r3) { if (e4.slice) return e4.slice(t3, r3); - const o3 = r3 - t3, n2 = new ArrayBuffer(o3); - return ie2(n2, 0, e4, t3, o3), n2; + const o4 = r3 - t3, n3 = new ArrayBuffer(o4); + return ie2(n3, 0, e4, t3, o4), n3; }(e3.buffer, e3.byteOffset, e3.byteOffset + e3.byteLength); return new Uint8Array(t2); } @@ -4595,9 +4263,9 @@ function se(e3) { return e3._queueTotalSize -= t2.size, e3._queueTotalSize < 0 && (e3._queueTotalSize = 0), t2.value; } function ue2(e3, t2, r3) { - if ("number" != typeof (o3 = r3) || ae2(o3) || o3 < 0 || r3 === 1 / 0) + if ("number" != typeof (o4 = r3) || ae2(o4) || o4 < 0 || r3 === 1 / 0) throw new RangeError("Size must be a finite, non-NaN, non-negative number."); - var o3; + var o4; e3._queue.push({ value: t2, size: r3 }), e3._queueTotalSize += r3; } function ce2(e3) { @@ -4639,39 +4307,39 @@ function he(e3) { function _e(e3, t2) { let r3 = false; "closed" === e3._state && (r3 = true); - const o3 = pe(t2); - "default" === t2.readerType ? G5(e3, o3, r3) : function(e4, t3, r4) { - const o4 = e4._reader._readIntoRequests.shift(); - r4 ? o4._closeSteps(t3) : o4._chunkSteps(t3); - }(e3, o3, r3); + const o4 = pe(t2); + "default" === t2.readerType ? G5(e3, o4, r3) : function(e4, t3, r4) { + const o5 = e4._reader._readIntoRequests.shift(); + r4 ? o5._closeSteps(t3) : o5._chunkSteps(t3); + }(e3, o4, r3); } function pe(e3) { const t2 = e3.bytesFilled, r3 = e3.elementSize; return new e3.viewConstructor(e3.buffer, e3.byteOffset, t2 / r3); } -function me(e3, t2, r3, o3) { - e3._queue.push({ buffer: t2, byteOffset: r3, byteLength: o3 }), e3._queueTotalSize += o3; +function me(e3, t2, r3, o4) { + e3._queue.push({ buffer: t2, byteOffset: r3, byteLength: o4 }), e3._queueTotalSize += o4; } -function ye(e3, t2, r3, o3) { - let n2; +function ye(e3, t2, r3, o4) { + let n3; try { - n2 = t2.slice(r3, r3 + o3); + n3 = t2.slice(r3, r3 + o4); } catch (t3) { throw Pe(e3, t3), t3; } - me(e3, n2, 0, o3); + me(e3, n3, 0, o4); } function ge(e3, t2) { t2.bytesFilled > 0 && ye(e3, t2.buffer, t2.byteOffset, t2.bytesFilled), Ce(e3); } function we(e3, t2) { - const r3 = t2.elementSize, o3 = t2.bytesFilled - t2.bytesFilled % r3, n2 = Math.min(e3._queueTotalSize, t2.byteLength - t2.bytesFilled), a4 = t2.bytesFilled + n2, i3 = a4 - a4 % r3; - let l3 = n2, s2 = false; - i3 > o3 && (l3 = i3 - t2.bytesFilled, s2 = true); - const u3 = e3._queue; + const r3 = t2.elementSize, o4 = t2.bytesFilled - t2.bytesFilled % r3, n3 = Math.min(e3._queueTotalSize, t2.byteLength - t2.bytesFilled), a5 = t2.bytesFilled + n3, i4 = a5 - a5 % r3; + let l3 = n3, s2 = false; + i4 > o4 && (l3 = i4 - t2.bytesFilled, s2 = true); + const u4 = e3._queue; for (; l3 > 0; ) { - const r4 = u3.peek(), o4 = Math.min(l3, r4.byteLength), n3 = t2.byteOffset + t2.bytesFilled; - ie2(t2.buffer, n3, r4.buffer, r4.byteOffset, o4), r4.byteLength === o4 ? u3.shift() : (r4.byteOffset += o4, r4.byteLength -= o4), e3._queueTotalSize -= o4, Se(e3, o4, t2), l3 -= o4; + const r4 = u4.peek(), o5 = Math.min(l3, r4.byteLength), n4 = t2.byteOffset + t2.bytesFilled; + ie2(t2.buffer, n4, r4.buffer, r4.byteOffset, o5), r4.byteLength === o5 ? u4.shift() : (r4.byteOffset += o5, r4.byteLength -= o5), e3._queueTotalSize -= o5, Se(e3, o5, t2), l3 -= o5; } return s2; } @@ -4707,12 +4375,12 @@ function qe(e3, t2) { if (r4.bytesFilled < r4.elementSize) return; Ce(e4); - const o3 = r4.bytesFilled % r4.elementSize; - if (o3 > 0) { + const o4 = r4.bytesFilled % r4.elementSize; + if (o4 > 0) { const t4 = r4.byteOffset + r4.bytesFilled; - ye(e4, r4.buffer, t4 - o3, o3); + ye(e4, r4.buffer, t4 - o4, o4); } - r4.bytesFilled -= o3, _e(e4._controlledReadableByteStream, r4), Te(e4); + r4.bytesFilled -= o4, _e(e4._controlledReadableByteStream, r4), Te(e4); }(e3, t2, r3), be(e3); } function Ce(e3) { @@ -4728,24 +4396,24 @@ function Pe(e3, t2) { function We(e3, t2) { const r3 = e3._queue.shift(); e3._queueTotalSize -= r3.byteLength, ve(e3); - const o3 = new Uint8Array(r3.buffer, r3.byteOffset, r3.byteLength); - t2._chunkSteps(o3); + const o4 = new Uint8Array(r3.buffer, r3.byteOffset, r3.byteLength); + t2._chunkSteps(o4); } function ke(e3) { const t2 = e3._controlledReadableByteStream._state; return "errored" === t2 ? null : "closed" === t2 ? 0 : e3._strategyHWM - e3._queueTotalSize; } function Oe(e3, t2, r3) { - const o3 = Object.create(ReadableByteStreamController.prototype); - let n2, a4, i3; - n2 = void 0 !== t2.start ? () => t2.start(o3) : () => { - }, a4 = void 0 !== t2.pull ? () => t2.pull(o3) : () => c2(void 0), i3 = void 0 !== t2.cancel ? (e4) => t2.cancel(e4) : () => c2(void 0); + const o4 = Object.create(ReadableByteStreamController.prototype); + let n3, a5, i4; + n3 = void 0 !== t2.start ? () => t2.start(o4) : () => { + }, a5 = void 0 !== t2.pull ? () => t2.pull(o4) : () => c4(void 0), i4 = void 0 !== t2.cancel ? (e4) => t2.cancel(e4) : () => c4(void 0); const l3 = t2.autoAllocateChunkSize; if (0 === l3) throw new TypeError("autoAllocateChunkSize must be greater than 0"); - !function(e4, t3, r4, o4, n3, a5, i4) { - t3._controlledReadableByteStream = e4, t3._pullAgain = false, t3._pulling = false, t3._byobRequest = null, t3._queue = t3._queueTotalSize = void 0, ce2(t3), t3._closeRequested = false, t3._started = false, t3._strategyHWM = a5, t3._pullAlgorithm = o4, t3._cancelAlgorithm = n3, t3._autoAllocateChunkSize = i4, t3._pendingPullIntos = new S5(), e4._readableStreamController = t3, b6(c2(r4()), () => (t3._started = true, be(t3), null), (e5) => (Pe(t3, e5), null)); - }(e3, o3, n2, a4, i3, r3, l3); + !function(e4, t3, r4, o5, n4, a6, i5) { + t3._controlledReadableByteStream = e4, t3._pullAgain = false, t3._pulling = false, t3._byobRequest = null, t3._queue = t3._queueTotalSize = void 0, ce2(t3), t3._closeRequested = false, t3._started = false, t3._strategyHWM = a6, t3._pullAlgorithm = o5, t3._cancelAlgorithm = n4, t3._autoAllocateChunkSize = i5, t3._pendingPullIntos = new S5(), e4._readableStreamController = t3, b6(c4(r4()), () => (t3._started = true, be(t3), null), (e5) => (Pe(t3, e5), null)); + }(e3, o4, n3, a5, i4, r3, l3); } function Be(e3) { return new TypeError(`ReadableStreamBYOBRequest.prototype.${e3} can only be used on a ReadableStreamBYOBRequest`); @@ -4789,8 +4457,8 @@ function Me(e3) { } function Ye(e3, t2) { F4(e3, t2); - const r3 = null == e3 ? void 0 : e3.highWaterMark, o3 = null == e3 ? void 0 : e3.size; - return { highWaterMark: void 0 === r3 ? void 0 : Y2(r3), size: void 0 === o3 ? void 0 : Qe(o3, `${t2} has member 'size' that`) }; + const r3 = null == e3 ? void 0 : e3.highWaterMark, o4 = null == e3 ? void 0 : e3.size; + return { highWaterMark: void 0 === r3 ? void 0 : Y2(r3), size: void 0 === o4 ? void 0 : Qe(o4, `${t2} has member 'size' that`) }; } function Qe(e3, t2) { return I4(e3, t2), (t3) => Y2(e3(t3)); @@ -4805,7 +4473,7 @@ function xe(e3, t2, r3) { return I4(e3, r3), (r4) => g3(e3, t2, [r4]); } function Ve(e3, t2, r3) { - return I4(e3, r3), (r4, o3) => w6(e3, t2, [r4, o3]); + return I4(e3, r3), (r4, o4) => w6(e3, t2, [r4, o4]); } function Ge(e3) { return !!r2(e3) && (!!Object.prototype.hasOwnProperty.call(e3, "_writableStreamController") && e3 instanceof WritableStream); @@ -4816,30 +4484,30 @@ function Xe(e3) { function Je(e3, t2) { var r3; if ("closed" === e3._state || "errored" === e3._state) - return c2(void 0); + return c4(void 0); e3._writableStreamController._abortReason = t2, null === (r3 = e3._writableStreamController._abortController) || void 0 === r3 || r3.abort(t2); - const o3 = e3._state; - if ("closed" === o3 || "errored" === o3) - return c2(void 0); + const o4 = e3._state; + if ("closed" === o4 || "errored" === o4) + return c4(void 0); if (void 0 !== e3._pendingAbortRequest) return e3._pendingAbortRequest._promise; - let n2 = false; - "erroring" === o3 && (n2 = true, t2 = void 0); - const a4 = u2((r4, o4) => { - e3._pendingAbortRequest = { _promise: void 0, _resolve: r4, _reject: o4, _reason: t2, _wasAlreadyErroring: n2 }; + let n3 = false; + "erroring" === o4 && (n3 = true, t2 = void 0); + const a5 = u3((r4, o5) => { + e3._pendingAbortRequest = { _promise: void 0, _resolve: r4, _reject: o5, _reason: t2, _wasAlreadyErroring: n3 }; }); - return e3._pendingAbortRequest._promise = a4, n2 || et(e3, t2), a4; + return e3._pendingAbortRequest._promise = a5, n3 || et(e3, t2), a5; } function Ke(e3) { const t2 = e3._state; if ("closed" === t2 || "errored" === t2) return d6(new TypeError(`The stream (in ${t2} state) is not in the writable state and cannot be closed`)); - const r3 = u2((t3, r4) => { - const o4 = { _resolve: t3, _reject: r4 }; - e3._closeRequest = o4; - }), o3 = e3._writer; - var n2; - return void 0 !== o3 && e3._backpressure && "writable" === t2 && Et(o3), ue2(n2 = e3._writableStreamController, lt, 0), dt(n2), r3; + const r3 = u3((t3, r4) => { + const o5 = { _resolve: t3, _reject: r4 }; + e3._closeRequest = o5; + }), o4 = e3._writer; + var n3; + return void 0 !== o4 && e3._backpressure && "writable" === t2 && Et(o4), ue2(n3 = e3._writableStreamController, lt, 0), dt(n3), r3; } function Ze(e3, t2) { "writable" !== e3._state ? tt(e3) : et(e3, t2); @@ -4847,8 +4515,8 @@ function Ze(e3, t2) { function et(e3, t2) { const r3 = e3._writableStreamController; e3._state = "erroring", e3._storedError = t2; - const o3 = e3._writer; - void 0 !== o3 && it(o3, t2), !function(e4) { + const o4 = e3._writer; + void 0 !== o4 && it(o4, t2), !function(e4) { if (void 0 === e4._inFlightWriteRequest && void 0 === e4._inFlightCloseRequest) return false; return true; @@ -4964,7 +4632,7 @@ function yt(e3) { return new TypeError("Cannot " + e3 + " a stream using a released writer"); } function gt(e3) { - e3._closedPromise = u2((t2, r3) => { + e3._closedPromise = u3((t2, r3) => { e3._closedPromise_resolve = t2, e3._closedPromise_reject = r3, e3._closedPromiseState = "pending"; }); } @@ -4978,7 +4646,7 @@ function vt(e3) { void 0 !== e3._closedPromise_resolve && (e3._closedPromise_resolve(void 0), e3._closedPromise_resolve = void 0, e3._closedPromise_reject = void 0, e3._closedPromiseState = "resolved"); } function Rt(e3) { - e3._readyPromise = u2((t2, r3) => { + e3._readyPromise = u3((t2, r3) => { e3._readyPromise_resolve = t2, e3._readyPromise_reject = r3; }), e3._readyPromiseState = "pending"; } @@ -4994,43 +4662,43 @@ function Ct(e3, t2) { function Et(e3) { void 0 !== e3._readyPromise_resolve && (e3._readyPromise_resolve(void 0), e3._readyPromise_resolve = void 0, e3._readyPromise_reject = void 0, e3._readyPromiseState = "fulfilled"); } -function kt(e3, t2, r3, o3, n2, a4) { - const i3 = e3.getReader(), l3 = t2.getWriter(); +function kt(e3, t2, r3, o4, n3, a5) { + const i4 = e3.getReader(), l3 = t2.getWriter(); Vt(e3) && (e3._disturbed = true); let s2, _7, g4, w7 = false, S6 = false, v5 = "readable", R7 = "writable", T6 = false, q6 = false; - const C5 = u2((e4) => { + const C5 = u3((e4) => { g4 = e4; }); let E4 = Promise.resolve(void 0); - return u2((P4, W6) => { + return u3((P4, W6) => { let k7; function O5() { if (w7) return; - const e4 = u2((e5, t3) => { - !function r4(o4) { - o4 ? e5() : f3(function() { + const e4 = u3((e5, t3) => { + !function r4(o5) { + o5 ? e5() : f3(function() { if (w7) - return c2(true); - return f3(l3.ready, () => f3(i3.read(), (e6) => !!e6.done || (E4 = l3.write(e6.value), m4(E4), false))); + return c4(true); + return f3(l3.ready, () => f3(i4.read(), (e6) => !!e6.done || (E4 = l3.write(e6.value), m4(E4), false))); }(), r4, t3); }(false); }); m4(e4); } function B3() { - return v5 = "closed", r3 ? L7() : z6(() => (Ge(t2) && (T6 = rt(t2), R7 = t2._state), T6 || "closed" === R7 ? c2(void 0) : "erroring" === R7 || "errored" === R7 ? d6(_7) : (T6 = true, l3.close())), false, void 0), null; + return v5 = "closed", r3 ? L7() : z6(() => (Ge(t2) && (T6 = rt(t2), R7 = t2._state), T6 || "closed" === R7 ? c4(void 0) : "erroring" === R7 || "errored" === R7 ? d6(_7) : (T6 = true, l3.close())), false, void 0), null; } function A5(e4) { - return w7 || (v5 = "errored", s2 = e4, o3 ? L7(true, e4) : z6(() => l3.abort(e4), true, e4)), null; + return w7 || (v5 = "errored", s2 = e4, o4 ? L7(true, e4) : z6(() => l3.abort(e4), true, e4)), null; } function j4(e4) { - return S6 || (R7 = "errored", _7 = e4, n2 ? L7(true, e4) : z6(() => i3.cancel(e4), true, e4)), null; + return S6 || (R7 = "errored", _7 = e4, n3 ? L7(true, e4) : z6(() => i4.cancel(e4), true, e4)), null; } - if (void 0 !== a4 && (k7 = () => { - const e4 = void 0 !== a4.reason ? a4.reason : new Wt("Aborted", "AbortError"), t3 = []; - o3 || t3.push(() => "writable" === R7 ? l3.abort(e4) : c2(void 0)), n2 || t3.push(() => "readable" === v5 ? i3.cancel(e4) : c2(void 0)), z6(() => Promise.all(t3.map((e5) => e5())), true, e4); - }, a4.aborted ? k7() : a4.addEventListener("abort", k7)), Vt(e3) && (v5 = e3._state, s2 = e3._storedError), Ge(t2) && (R7 = t2._state, _7 = t2._storedError, T6 = rt(t2)), Vt(e3) && Ge(t2) && (q6 = true, g4()), "errored" === v5) + if (void 0 !== a5 && (k7 = () => { + const e4 = void 0 !== a5.reason ? a5.reason : new Wt("Aborted", "AbortError"), t3 = []; + o4 || t3.push(() => "writable" === R7 ? l3.abort(e4) : c4(void 0)), n3 || t3.push(() => "readable" === v5 ? i4.cancel(e4) : c4(void 0)), z6(() => Promise.all(t3.map((e5) => e5())), true, e4); + }, a5.aborted ? k7() : a5.addEventListener("abort", k7)), Vt(e3) && (v5 = e3._state, s2 = e3._storedError), Ge(t2) && (R7 = t2._state, _7 = t2._storedError, T6 = rt(t2)), Vt(e3) && Ge(t2) && (q6 = true, g4()), "errored" === v5) A5(s2); else if ("erroring" === R7 || "errored" === R7) j4(_7); @@ -5038,30 +4706,30 @@ function kt(e3, t2, r3, o3, n2, a4) { B3(); else if (T6 || "closed" === R7) { const e4 = new TypeError("the destination writable stream closed before all data could be piped to it"); - n2 ? L7(true, e4) : z6(() => i3.cancel(e4), true, e4); + n3 ? L7(true, e4) : z6(() => i4.cancel(e4), true, e4); } function z6(e4, t3, r4) { - function o4() { - return "writable" !== R7 || T6 ? n3() : h3(function() { + function o5() { + return "writable" !== R7 || T6 ? n4() : h4(function() { let e5; - return c2(function t4() { + return c4(function t4() { if (e5 !== E4) return e5 = E4, p3(E4, t4, t4); }()); - }(), n3), null; + }(), n4), null; } - function n3() { + function n4() { return e4 ? b6(e4(), () => F5(t3, r4), (e5) => F5(true, e5)) : F5(t3, r4), null; } - w7 || (w7 = true, q6 ? o4() : h3(C5, o4)); + w7 || (w7 = true, q6 ? o5() : h4(C5, o5)); } function L7(e4, t3) { z6(void 0, e4, t3); } function F5(e4, t3) { - return S6 = true, l3.releaseLock(), i3.releaseLock(), void 0 !== a4 && a4.removeEventListener("abort", k7), e4 ? W6(t3) : P4(void 0), null; + return S6 = true, l3.releaseLock(), i4.releaseLock(), void 0 !== a5 && a5.removeEventListener("abort", k7), e4 ? W6(t3) : P4(void 0), null; } - w7 || (b6(i3.closed, B3, A5), b6(l3.closed, function() { + w7 || (b6(i4.closed, B3, A5), b6(l3.closed, function() { return S6 || (R7 = "closed"), null; }, j4)), q6 ? O5() : y5(() => { q6 = true, g4(), O5(); @@ -5076,124 +4744,124 @@ function Ot(e3, t2) { return false; } }(e3) ? function(e4) { - let t3, r3, o3, n2, a4, i3 = e4.getReader(), l3 = false, s2 = false, d7 = false, f4 = false, h4 = false, p4 = false; - const m5 = u2((e5) => { - a4 = e5; + let t3, r3, o4, n3, a5, i4 = e4.getReader(), l3 = false, s2 = false, d7 = false, f4 = false, h5 = false, p4 = false; + const m5 = u3((e5) => { + a5 = e5; }); function y6(e5) { - _6(e5.closed, (t4) => (e5 !== i3 || (o3.error(t4), n2.error(t4), h4 && p4 || a4(void 0)), null)); + _6(e5.closed, (t4) => (e5 !== i4 || (o4.error(t4), n3.error(t4), h5 && p4 || a5(void 0)), null)); } function g4() { - l3 && (i3.releaseLock(), i3 = e4.getReader(), y6(i3), l3 = false), b6(i3.read(), (e5) => { + l3 && (i4.releaseLock(), i4 = e4.getReader(), y6(i4), l3 = false), b6(i4.read(), (e5) => { var t4, r4; if (d7 = false, f4 = false, e5.done) - return h4 || o3.close(), p4 || n2.close(), null === (t4 = o3.byobRequest) || void 0 === t4 || t4.respond(0), null === (r4 = n2.byobRequest) || void 0 === r4 || r4.respond(0), h4 && p4 || a4(void 0), null; - const l4 = e5.value, u3 = l4; - let c3 = l4; - if (!h4 && !p4) + return h5 || o4.close(), p4 || n3.close(), null === (t4 = o4.byobRequest) || void 0 === t4 || t4.respond(0), null === (r4 = n3.byobRequest) || void 0 === r4 || r4.respond(0), h5 && p4 || a5(void 0), null; + const l4 = e5.value, u4 = l4; + let c5 = l4; + if (!h5 && !p4) try { - c3 = le2(l4); + c5 = le2(l4); } catch (e6) { - return o3.error(e6), n2.error(e6), a4(i3.cancel(e6)), null; + return o4.error(e6), n3.error(e6), a5(i4.cancel(e6)), null; } - return h4 || o3.enqueue(u3), p4 || n2.enqueue(c3), s2 = false, d7 ? S6() : f4 && v5(), null; + return h5 || o4.enqueue(u4), p4 || n3.enqueue(c5), s2 = false, d7 ? S6() : f4 && v5(), null; }, () => (s2 = false, null)); } function w7(t4, r4) { - l3 || (i3.releaseLock(), i3 = e4.getReader({ mode: "byob" }), y6(i3), l3 = true); - const u3 = r4 ? n2 : o3, c3 = r4 ? o3 : n2; - b6(i3.read(t4), (e5) => { + l3 || (i4.releaseLock(), i4 = e4.getReader({ mode: "byob" }), y6(i4), l3 = true); + const u4 = r4 ? n3 : o4, c5 = r4 ? o4 : n3; + b6(i4.read(t4), (e5) => { var t5; d7 = false, f4 = false; - const o4 = r4 ? p4 : h4, n3 = r4 ? h4 : p4; + const o5 = r4 ? p4 : h5, n4 = r4 ? h5 : p4; if (e5.done) { - o4 || u3.close(), n3 || c3.close(); + o5 || u4.close(), n4 || c5.close(); const r5 = e5.value; - return void 0 !== r5 && (o4 || u3.byobRequest.respondWithNewView(r5), n3 || null === (t5 = c3.byobRequest) || void 0 === t5 || t5.respond(0)), o4 && n3 || a4(void 0), null; + return void 0 !== r5 && (o5 || u4.byobRequest.respondWithNewView(r5), n4 || null === (t5 = c5.byobRequest) || void 0 === t5 || t5.respond(0)), o5 && n4 || a5(void 0), null; } const l4 = e5.value; - if (n3) - o4 || u3.byobRequest.respondWithNewView(l4); + if (n4) + o5 || u4.byobRequest.respondWithNewView(l4); else { let e6; try { e6 = le2(l4); } catch (e7) { - return u3.error(e7), c3.error(e7), a4(i3.cancel(e7)), null; + return u4.error(e7), c5.error(e7), a5(i4.cancel(e7)), null; } - o4 || u3.byobRequest.respondWithNewView(l4), c3.enqueue(e6); + o5 || u4.byobRequest.respondWithNewView(l4), c5.enqueue(e6); } return s2 = false, d7 ? S6() : f4 && v5(), null; }, () => (s2 = false, null)); } function S6() { if (s2) - return d7 = true, c2(void 0); + return d7 = true, c4(void 0); s2 = true; - const e5 = o3.byobRequest; - return null === e5 ? g4() : w7(e5.view, false), c2(void 0); + const e5 = o4.byobRequest; + return null === e5 ? g4() : w7(e5.view, false), c4(void 0); } function v5() { if (s2) - return f4 = true, c2(void 0); + return f4 = true, c4(void 0); s2 = true; - const e5 = n2.byobRequest; - return null === e5 ? g4() : w7(e5.view, true), c2(void 0); + const e5 = n3.byobRequest; + return null === e5 ? g4() : w7(e5.view, true), c4(void 0); } function R7(e5) { - if (h4 = true, t3 = e5, p4) { - const e6 = [t3, r3], o4 = i3.cancel(e6); - a4(o4); + if (h5 = true, t3 = e5, p4) { + const e6 = [t3, r3], o5 = i4.cancel(e6); + a5(o5); } return m5; } function T6(e5) { - if (p4 = true, r3 = e5, h4) { - const e6 = [t3, r3], o4 = i3.cancel(e6); - a4(o4); + if (p4 = true, r3 = e5, h5) { + const e6 = [t3, r3], o5 = i4.cancel(e6); + a5(o5); } return m5; } const q6 = new ReadableStream3({ type: "bytes", start(e5) { - o3 = e5; + o4 = e5; }, pull: S6, cancel: R7 }), C5 = new ReadableStream3({ type: "bytes", start(e5) { - n2 = e5; + n3 = e5; }, pull: v5, cancel: T6 }); - return y6(i3), [q6, C5]; + return y6(i4), [q6, C5]; }(e3) : function(e4, t3) { const r3 = e4.getReader(); - let o3, n2, a4, i3, l3, s2 = false, d7 = false, f4 = false, h4 = false; - const p4 = u2((e5) => { + let o4, n3, a5, i4, l3, s2 = false, d7 = false, f4 = false, h5 = false; + const p4 = u3((e5) => { l3 = e5; }); function m5() { - return s2 ? (d7 = true, c2(void 0)) : (s2 = true, b6(r3.read(), (e5) => { + return s2 ? (d7 = true, c4(void 0)) : (s2 = true, b6(r3.read(), (e5) => { if (d7 = false, e5.done) - return f4 || a4.close(), h4 || i3.close(), f4 && h4 || l3(void 0), null; - const t4 = e5.value, r4 = t4, o4 = t4; - return f4 || a4.enqueue(r4), h4 || i3.enqueue(o4), s2 = false, d7 && m5(), null; - }, () => (s2 = false, null)), c2(void 0)); + return f4 || a5.close(), h5 || i4.close(), f4 && h5 || l3(void 0), null; + const t4 = e5.value, r4 = t4, o5 = t4; + return f4 || a5.enqueue(r4), h5 || i4.enqueue(o5), s2 = false, d7 && m5(), null; + }, () => (s2 = false, null)), c4(void 0)); } function y6(e5) { - if (f4 = true, o3 = e5, h4) { - const e6 = [o3, n2], t4 = r3.cancel(e6); + if (f4 = true, o4 = e5, h5) { + const e6 = [o4, n3], t4 = r3.cancel(e6); l3(t4); } return p4; } function g4(e5) { - if (h4 = true, n2 = e5, f4) { - const e6 = [o3, n2], t4 = r3.cancel(e6); + if (h5 = true, n3 = e5, f4) { + const e6 = [o4, n3], t4 = r3.cancel(e6); l3(t4); } return p4; } const w7 = new ReadableStream3({ start(e5) { - a4 = e5; + a5 = e5; }, pull: m5, cancel: y6 }), S6 = new ReadableStream3({ start(e5) { - i3 = e5; + i4 = e5; }, pull: m5, cancel: g4 }); - return _6(r3.closed, (e5) => (a4.error(e5), i3.error(e5), f4 && h4 || l3(void 0), null)), [w7, S6]; + return _6(r3.closed, (e5) => (a5.error(e5), i4.error(e5), f4 && h5 || l3(void 0), null)), [w7, S6]; }(e3); } function Bt(e3) { @@ -5233,13 +4901,13 @@ function Lt(e3) { function Ft(e3) { return !e3._closeRequested && "readable" === e3._controlledReadableStream._state; } -function It(e3, t2, r3, o3) { - const n2 = Object.create(ReadableStreamDefaultController.prototype); - let a4, i3, l3; - a4 = void 0 !== t2.start ? () => t2.start(n2) : () => { - }, i3 = void 0 !== t2.pull ? () => t2.pull(n2) : () => c2(void 0), l3 = void 0 !== t2.cancel ? (e4) => t2.cancel(e4) : () => c2(void 0), function(e4, t3, r4, o4, n3, a5, i4) { - t3._controlledReadableStream = e4, t3._queue = void 0, t3._queueTotalSize = void 0, ce2(t3), t3._started = false, t3._closeRequested = false, t3._pullAgain = false, t3._pulling = false, t3._strategySizeAlgorithm = i4, t3._strategyHWM = a5, t3._pullAlgorithm = o4, t3._cancelAlgorithm = n3, e4._readableStreamController = t3, b6(c2(r4()), () => (t3._started = true, At(t3), null), (e5) => (zt(t3, e5), null)); - }(e3, n2, a4, i3, l3, r3, o3); +function It(e3, t2, r3, o4) { + const n3 = Object.create(ReadableStreamDefaultController.prototype); + let a5, i4, l3; + a5 = void 0 !== t2.start ? () => t2.start(n3) : () => { + }, i4 = void 0 !== t2.pull ? () => t2.pull(n3) : () => c4(void 0), l3 = void 0 !== t2.cancel ? (e4) => t2.cancel(e4) : () => c4(void 0), function(e4, t3, r4, o5, n4, a6, i5) { + t3._controlledReadableStream = e4, t3._queue = void 0, t3._queueTotalSize = void 0, ce2(t3), t3._started = false, t3._closeRequested = false, t3._pullAgain = false, t3._pulling = false, t3._strategySizeAlgorithm = i5, t3._strategyHWM = a6, t3._pullAlgorithm = o5, t3._cancelAlgorithm = n4, e4._readableStreamController = t3, b6(c4(r4()), () => (t3._started = true, At(t3), null), (e5) => (zt(t3, e5), null)); + }(e3, n3, a5, i4, l3, r3, o4); } function Dt(e3) { return new TypeError(`ReadableStreamDefaultController.prototype.${e3} can only be used on a ReadableStreamDefaultController`); @@ -5265,8 +4933,8 @@ function Nt(e3, t2) { } function Ht(e3, t2) { F4(e3, t2); - const r3 = null == e3 ? void 0 : e3.preventAbort, o3 = null == e3 ? void 0 : e3.preventCancel, n2 = null == e3 ? void 0 : e3.preventClose, a4 = null == e3 ? void 0 : e3.signal; - return void 0 !== a4 && function(e4, t3) { + const r3 = null == e3 ? void 0 : e3.preventAbort, o4 = null == e3 ? void 0 : e3.preventCancel, n3 = null == e3 ? void 0 : e3.preventClose, a5 = null == e3 ? void 0 : e3.signal; + return void 0 !== a5 && function(e4, t3) { if (!function(e5) { if ("object" != typeof e5 || null === e5) return false; @@ -5277,7 +4945,7 @@ function Ht(e3, t2) { } }(e4)) throw new TypeError(`${t3} is not an AbortSignal.`); - }(a4, `${t2} has member 'signal' that`), { preventAbort: Boolean(r3), preventCancel: Boolean(o3), preventClose: Boolean(n2), signal: a4 }; + }(a5, `${t2} has member 'signal' that`), { preventAbort: Boolean(r3), preventCancel: Boolean(o4), preventClose: Boolean(n3), signal: a5 }; } function xt(e3, t2) { F4(e3, t2); @@ -5286,11 +4954,11 @@ function xt(e3, t2) { if (!H4(e4)) throw new TypeError(`${t3} is not a ReadableStream.`); }(r3, `${t2} has member 'readable' that`); - const o3 = null == e3 ? void 0 : e3.writable; - return M4(o3, "writable", "ReadableWritablePair"), function(e4, t3) { + const o4 = null == e3 ? void 0 : e3.writable; + return M4(o4, "writable", "ReadableWritablePair"), function(e4, t3) { if (!x4(e4)) throw new TypeError(`${t3} is not a WritableStream.`); - }(o3, `${t2} has member 'writable' that`), { readable: r3, writable: o3 }; + }(o4, `${t2} has member 'writable' that`), { readable: r3, writable: o4 }; } function Vt(e3) { return !!r2(e3) && (!!Object.prototype.hasOwnProperty.call(e3, "_readableStreamController") && e3 instanceof ReadableStream3); @@ -5300,14 +4968,14 @@ function Ut(e3) { } function Gt(e3, r3) { if (e3._disturbed = true, "closed" === e3._state) - return c2(void 0); + return c4(void 0); if ("errored" === e3._state) return d6(e3._storedError); Xt(e3); - const o3 = e3._reader; - if (void 0 !== o3 && Fe(o3)) { - const e4 = o3._readIntoRequests; - o3._readIntoRequests = new S5(), e4.forEach((e5) => { + const o4 = e3._reader; + if (void 0 !== o4 && Fe(o4)) { + const e4 = o4._readIntoRequests; + o4._readIntoRequests = new S5(), e4.forEach((e5) => { e5._closeSteps(void 0); }); } @@ -5346,7 +5014,7 @@ function nr(e3) { return new TypeError(`CountQueuingStrategy.prototype.${e3} can only be used on a CountQueuingStrategy`); } function ar(e3) { - return !!r2(e3) && (!!Object.prototype.hasOwnProperty.call(e3, "_countQueuingStrategyHighWaterMark") && e3 instanceof CountQueuingStrategy); + return !!r2(e3) && (!!Object.prototype.hasOwnProperty.call(e3, "_countQueuingStrategyHighWaterMark") && e3 instanceof CountQueuingStrategy2); } function ir(e3, t2, r3) { return I4(e3, r3), (r4) => w6(e3, t2, [r4]); @@ -5355,7 +5023,7 @@ function lr(e3, t2, r3) { return I4(e3, r3), (r4) => g3(e3, t2, [r4]); } function sr(e3, t2, r3) { - return I4(e3, r3), (r4, o3) => w6(e3, t2, [r4, o3]); + return I4(e3, r3), (r4, o4) => w6(e3, t2, [r4, o4]); } function ur(e3) { return !!r2(e3) && (!!Object.prototype.hasOwnProperty.call(e3, "_transformStreamController") && e3 instanceof TransformStream2); @@ -5370,7 +5038,7 @@ function dr(e3, t2) { }(e3, t2), e3._backpressure && fr(e3, false); } function fr(e3, t2) { - void 0 !== e3._backpressureChangePromise && e3._backpressureChangePromise_resolve(), e3._backpressureChangePromise = u2((t3) => { + void 0 !== e3._backpressureChangePromise && e3._backpressureChangePromise_resolve(), e3._backpressureChangePromise = u3((t3) => { e3._backpressureChangePromise_resolve = t3; }), e3._backpressure = t2; } @@ -5396,7 +5064,7 @@ function _r(e3, t2) { } catch (e4) { throw dr(r3, e4), r3._readableStoredError; } - const o3 = function(e4) { + const o4 = function(e4) { return !function(e5) { if (!gr(e5)) return false; @@ -5407,7 +5075,7 @@ function _r(e3, t2) { return false; }(e4); }(r3); - o3 !== r3._backpressure && fr(r3, true); + o4 !== r3._backpressure && fr(r3, true); } function pr(e3, t2) { return p3(e3._transformAlgorithm(t2), void 0, (t3) => { @@ -5446,20 +5114,20 @@ function qr(e3) { function Cr(e3) { "erroring" === e3._writableState && qr(e3); } -var e2, o2, a3, i2, l2, s, y5, S5, v4, R6, T5, q5, C4, z5, L6, ReadableStreamDefaultReader, te, re2, ae2, ReadableStreamBYOBRequest, ReadableByteStreamController, ReadableStreamBYOBReader, Ue, WritableStream, WritableStreamDefaultWriter, lt, WritableStreamDefaultController, Pt, Wt, ReadableStreamDefaultController, ReadableStream3, er, ByteLengthQueuingStrategy, or, CountQueuingStrategy, TransformStream2, TransformStreamDefaultController; +var e2, o3, a4, i3, l2, s, y5, S5, v4, R6, T5, q5, C4, z5, L6, ReadableStreamDefaultReader, te, re2, ae2, ReadableStreamBYOBRequest, ReadableByteStreamController, ReadableStreamBYOBReader, Ue, WritableStream, WritableStreamDefaultWriter, lt, WritableStreamDefaultController, Pt, Wt, ReadableStreamDefaultController, ReadableStream3, er, ByteLengthQueuingStrategy, or, CountQueuingStrategy2, TransformStream2, TransformStreamDefaultController; var init_ponyfill = __esm({ "node_modules/formdata-node/node_modules/web-streams-polyfill/dist/ponyfill.mjs"() { e2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? Symbol : (e3) => `Symbol(${e3})`; - o2 = t; - a3 = Promise; - i2 = Promise.prototype.then; - l2 = Promise.resolve.bind(a3); - s = Promise.reject.bind(a3); + o3 = t; + a4 = Promise; + i3 = Promise.prototype.then; + l2 = Promise.resolve.bind(a4); + s = Promise.reject.bind(a4); y5 = (e3) => { if ("function" == typeof queueMicrotask) y5 = queueMicrotask; else { - const e4 = c2(void 0); + const e4 = c4(void 0); y5 = (t2) => f3(e4, t2); } return y5(e3); @@ -5480,14 +5148,14 @@ var init_ponyfill = __esm({ const e3 = this._front; let t2 = e3; const r3 = this._cursor; - let o3 = r3 + 1; - const n2 = e3._elements, a4 = n2[r3]; - return 16384 === o3 && (t2 = e3._next, o3 = 0), --this._size, this._cursor = o3, e3 !== t2 && (this._front = t2), n2[r3] = void 0, a4; + let o4 = r3 + 1; + const n3 = e3._elements, a5 = n3[r3]; + return 16384 === o4 && (t2 = e3._next, o4 = 0), --this._size, this._cursor = o4, e3 !== t2 && (this._front = t2), n3[r3] = void 0, a5; } forEach(e3) { - let t2 = this._cursor, r3 = this._front, o3 = r3._elements; - for (; !(t2 === o3.length && void 0 === r3._next || t2 === o3.length && (r3 = r3._next, o3 = r3._elements, t2 = 0, 0 === o3.length)); ) - e3(o3[t2]), ++t2; + let t2 = this._cursor, r3 = this._front, o4 = r3._elements; + for (; !(t2 === o4.length && void 0 === r3._next || t2 === o4.length && (r3 = r3._next, o4 = r3._elements, t2 = 0, 0 === o4.length)); ) + e3(o4[t2]), ++t2; } peek() { const e3 = this._front, t2 = this._cursor; @@ -5523,8 +5191,8 @@ var init_ponyfill = __esm({ if (void 0 === this._ownerReadableStream) return d6(k6("read from")); let e3, t2; - const r3 = u2((r4, o3) => { - e3 = r4, t2 = o3; + const r3 = u3((r4, o4) => { + e3 = r4, t2 = o4; }); return function(e4, t3) { const r4 = e4._ownerReadableStream; @@ -5541,7 +5209,7 @@ var init_ponyfill = __esm({ }(this); } }; - Object.defineProperties(ReadableStreamDefaultReader.prototype, { cancel: { enumerable: true }, read: { enumerable: true }, releaseLock: { enumerable: true }, closed: { enumerable: true } }), n(ReadableStreamDefaultReader.prototype.cancel, "cancel"), n(ReadableStreamDefaultReader.prototype.read, "read"), n(ReadableStreamDefaultReader.prototype.releaseLock, "releaseLock"), "symbol" == typeof e2.toStringTag && Object.defineProperty(ReadableStreamDefaultReader.prototype, e2.toStringTag, { value: "ReadableStreamDefaultReader", configurable: true }); + Object.defineProperties(ReadableStreamDefaultReader.prototype, { cancel: { enumerable: true }, read: { enumerable: true }, releaseLock: { enumerable: true }, closed: { enumerable: true } }), n2(ReadableStreamDefaultReader.prototype.cancel, "cancel"), n2(ReadableStreamDefaultReader.prototype.read, "read"), n2(ReadableStreamDefaultReader.prototype.releaseLock, "releaseLock"), "symbol" == typeof e2.toStringTag && Object.defineProperty(ReadableStreamDefaultReader.prototype, e2.toStringTag, { value: "ReadableStreamDefaultReader", configurable: true }); te = class { constructor(e3, t2) { this._ongoingPromise = void 0, this._isFinished = false, this._reader = e3, this._preventCancel = t2; @@ -5577,7 +5245,7 @@ var init_ponyfill = __esm({ const r3 = t2.cancel(e3); return t2.releaseLock(), p3(r3, () => ({ value: e3, done: true })); } - return t2.releaseLock(), c2({ value: e3, done: true }); + return t2.releaseLock(), c4({ value: e3, done: true }); } }; re2 = { next() { @@ -5639,12 +5307,12 @@ var init_ponyfill = __esm({ throw new RangeError("The buffer of view has different capacity than byobRequest"); if (r3.bytesFilled + t2.byteLength > r3.byteLength) throw new RangeError("The region specified by view is larger than byobRequest"); - const o3 = t2.byteLength; - r3.buffer = t2.buffer, qe(e4, o3); + const o4 = t2.byteLength; + r3.buffer = t2.buffer, qe(e4, o4); }(this._associatedReadableByteStreamController, e3); } }; - Object.defineProperties(ReadableStreamBYOBRequest.prototype, { respond: { enumerable: true }, respondWithNewView: { enumerable: true }, view: { enumerable: true } }), n(ReadableStreamBYOBRequest.prototype.respond, "respond"), n(ReadableStreamBYOBRequest.prototype.respondWithNewView, "respondWithNewView"), "symbol" == typeof e2.toStringTag && Object.defineProperty(ReadableStreamBYOBRequest.prototype, e2.toStringTag, { value: "ReadableStreamBYOBRequest", configurable: true }); + Object.defineProperties(ReadableStreamBYOBRequest.prototype, { respond: { enumerable: true }, respondWithNewView: { enumerable: true }, view: { enumerable: true } }), n2(ReadableStreamBYOBRequest.prototype.respond, "respond"), n2(ReadableStreamBYOBRequest.prototype.respondWithNewView, "respondWithNewView"), "symbol" == typeof e2.toStringTag && Object.defineProperty(ReadableStreamBYOBRequest.prototype, e2.toStringTag, { value: "ReadableStreamBYOBRequest", configurable: true }); ReadableByteStreamController = class { constructor() { throw new TypeError("Illegal constructor"); @@ -5654,10 +5322,10 @@ var init_ponyfill = __esm({ throw Ae("byobRequest"); return function(e3) { if (null === e3._byobRequest && e3._pendingPullIntos.length > 0) { - const t2 = e3._pendingPullIntos.peek(), r3 = new Uint8Array(t2.buffer, t2.byteOffset + t2.bytesFilled, t2.byteLength - t2.bytesFilled), o3 = Object.create(ReadableStreamBYOBRequest.prototype); + const t2 = e3._pendingPullIntos.peek(), r3 = new Uint8Array(t2.buffer, t2.byteOffset + t2.bytesFilled, t2.byteLength - t2.bytesFilled), o4 = Object.create(ReadableStreamBYOBRequest.prototype); !function(e4, t3, r4) { e4._associatedReadableByteStreamController = t3, e4._view = r4; - }(o3, e3, r3), e3._byobRequest = o3; + }(o4, e3, r3), e3._byobRequest = o4; } return e3._byobRequest; }(this); @@ -5708,7 +5376,7 @@ var init_ponyfill = __esm({ const r3 = e4._controlledReadableByteStream; if (e4._closeRequested || "readable" !== r3._state) return; - const o3 = t3.buffer, n2 = t3.byteOffset, a4 = t3.byteLength, i3 = o3; + const o4 = t3.buffer, n3 = t3.byteOffset, a5 = t3.byteLength, i4 = o4; if (e4._pendingPullIntos.length > 0) { const t4 = e4._pendingPullIntos.peek(); t4.buffer, 0, Re(e4), t4.buffer = t4.buffer, "none" === t4.readerType && ge(e4, t4); @@ -5722,13 +5390,13 @@ var init_ponyfill = __esm({ We(e5, t4._readRequests.shift()); } }(e4), 0 === X4(r3)) - me(e4, i3, n2, a4); + me(e4, i4, n3, a5); else { e4._pendingPullIntos.length > 0 && Ce(e4); - G5(r3, new Uint8Array(i3, n2, a4), false); + G5(r3, new Uint8Array(i4, n3, a5), false); } else - Le(r3) ? (me(e4, i3, n2, a4), Te(e4)) : me(e4, i3, n2, a4); + Le(r3) ? (me(e4, i4, n3, a5), Te(e4)) : me(e4, i4, n3, a5); be(e4); }(this, e3); } @@ -5754,8 +5422,8 @@ var init_ponyfill = __esm({ } catch (t4) { return void e3._errorSteps(t4); } - const o3 = { buffer: t3, bufferByteLength: r3, byteOffset: 0, byteLength: r3, bytesFilled: 0, elementSize: 1, viewConstructor: Uint8Array, readerType: "default" }; - this._pendingPullIntos.push(o3); + const o4 = { buffer: t3, bufferByteLength: r3, byteOffset: 0, byteLength: r3, bytesFilled: 0, elementSize: 1, viewConstructor: Uint8Array, readerType: "default" }; + this._pendingPullIntos.push(o4); } U6(t2, e3), be(this); } @@ -5766,7 +5434,7 @@ var init_ponyfill = __esm({ } } }; - Object.defineProperties(ReadableByteStreamController.prototype, { close: { enumerable: true }, enqueue: { enumerable: true }, error: { enumerable: true }, byobRequest: { enumerable: true }, desiredSize: { enumerable: true } }), n(ReadableByteStreamController.prototype.close, "close"), n(ReadableByteStreamController.prototype.enqueue, "enqueue"), n(ReadableByteStreamController.prototype.error, "error"), "symbol" == typeof e2.toStringTag && Object.defineProperty(ReadableByteStreamController.prototype, e2.toStringTag, { value: "ReadableByteStreamController", configurable: true }); + Object.defineProperties(ReadableByteStreamController.prototype, { close: { enumerable: true }, enqueue: { enumerable: true }, error: { enumerable: true }, byobRequest: { enumerable: true }, desiredSize: { enumerable: true } }), n2(ReadableByteStreamController.prototype.close, "close"), n2(ReadableByteStreamController.prototype.enqueue, "enqueue"), n2(ReadableByteStreamController.prototype.error, "error"), "symbol" == typeof e2.toStringTag && Object.defineProperty(ReadableByteStreamController.prototype, e2.toStringTag, { value: "ReadableByteStreamController", configurable: true }); ReadableStreamBYOBReader = class { constructor(e3) { if ($5(e3, 1, "ReadableStreamBYOBReader"), V5(e3, "First parameter"), Ut(e3)) @@ -5793,19 +5461,19 @@ var init_ponyfill = __esm({ if (e3.buffer, void 0 === this._ownerReadableStream) return d6(k6("read from")); let t2, r3; - const o3 = u2((e4, o4) => { - t2 = e4, r3 = o4; + const o4 = u3((e4, o5) => { + t2 = e4, r3 = o5; }); return function(e4, t3, r4) { - const o4 = e4._ownerReadableStream; - o4._disturbed = true, "errored" === o4._state ? r4._errorSteps(o4._storedError) : function(e5, t4, r5) { - const o5 = e5._controlledReadableByteStream; - let n2 = 1; - t4.constructor !== DataView && (n2 = t4.constructor.BYTES_PER_ELEMENT); - const a4 = t4.constructor, i3 = t4.buffer, l3 = { buffer: i3, bufferByteLength: i3.byteLength, byteOffset: t4.byteOffset, byteLength: t4.byteLength, bytesFilled: 0, elementSize: n2, viewConstructor: a4, readerType: "byob" }; + const o5 = e4._ownerReadableStream; + o5._disturbed = true, "errored" === o5._state ? r4._errorSteps(o5._storedError) : function(e5, t4, r5) { + const o6 = e5._controlledReadableByteStream; + let n3 = 1; + t4.constructor !== DataView && (n3 = t4.constructor.BYTES_PER_ELEMENT); + const a5 = t4.constructor, i4 = t4.buffer, l3 = { buffer: i4, bufferByteLength: i4.byteLength, byteOffset: t4.byteOffset, byteLength: t4.byteLength, bytesFilled: 0, elementSize: n3, viewConstructor: a5, readerType: "byob" }; if (e5._pendingPullIntos.length > 0) - return e5._pendingPullIntos.push(l3), void je(o5, r5); - if ("closed" !== o5._state) { + return e5._pendingPullIntos.push(l3), void je(o6, r5); + if ("closed" !== o6._state) { if (e5._queueTotalSize > 0) { if (we(e5, l3)) { const t5 = pe(l3); @@ -5816,13 +5484,13 @@ var init_ponyfill = __esm({ return Pe(e5, t5), void r5._errorSteps(t5); } } - e5._pendingPullIntos.push(l3), je(o5, r5), be(e5); + e5._pendingPullIntos.push(l3), je(o6, r5), be(e5); } else { - const e6 = new a4(l3.buffer, l3.byteOffset, 0); + const e6 = new a5(l3.buffer, l3.byteOffset, 0); r5._closeSteps(e6); } - }(o4._readableStreamController, t3, r4); - }(this, e3, { _chunkSteps: (e4) => t2({ value: e4, done: false }), _closeSteps: (e4) => t2({ value: e4, done: true }), _errorSteps: (e4) => r3(e4) }), o3; + }(o5._readableStreamController, t3, r4); + }(this, e3, { _chunkSteps: (e4) => t2({ value: e4, done: false }), _closeSteps: (e4) => t2({ value: e4, done: true }), _errorSteps: (e4) => r3(e4) }), o4; } releaseLock() { if (!Fe(this)) @@ -5834,40 +5502,40 @@ var init_ponyfill = __esm({ }(this); } }; - Object.defineProperties(ReadableStreamBYOBReader.prototype, { cancel: { enumerable: true }, read: { enumerable: true }, releaseLock: { enumerable: true }, closed: { enumerable: true } }), n(ReadableStreamBYOBReader.prototype.cancel, "cancel"), n(ReadableStreamBYOBReader.prototype.read, "read"), n(ReadableStreamBYOBReader.prototype.releaseLock, "releaseLock"), "symbol" == typeof e2.toStringTag && Object.defineProperty(ReadableStreamBYOBReader.prototype, e2.toStringTag, { value: "ReadableStreamBYOBReader", configurable: true }); + Object.defineProperties(ReadableStreamBYOBReader.prototype, { cancel: { enumerable: true }, read: { enumerable: true }, releaseLock: { enumerable: true }, closed: { enumerable: true } }), n2(ReadableStreamBYOBReader.prototype.cancel, "cancel"), n2(ReadableStreamBYOBReader.prototype.read, "read"), n2(ReadableStreamBYOBReader.prototype.releaseLock, "releaseLock"), "symbol" == typeof e2.toStringTag && Object.defineProperty(ReadableStreamBYOBReader.prototype, e2.toStringTag, { value: "ReadableStreamBYOBReader", configurable: true }); Ue = "function" == typeof AbortController; WritableStream = class { constructor(e3 = {}, t2 = {}) { void 0 === e3 ? e3 = null : D4(e3, "First parameter"); - const r3 = Ye(t2, "Second parameter"), o3 = function(e4, t3) { + const r3 = Ye(t2, "Second parameter"), o4 = function(e4, t3) { F4(e4, t3); - const r4 = null == e4 ? void 0 : e4.abort, o4 = null == e4 ? void 0 : e4.close, n3 = null == e4 ? void 0 : e4.start, a5 = null == e4 ? void 0 : e4.type, i3 = null == e4 ? void 0 : e4.write; - return { abort: void 0 === r4 ? void 0 : Ne(r4, e4, `${t3} has member 'abort' that`), close: void 0 === o4 ? void 0 : He(o4, e4, `${t3} has member 'close' that`), start: void 0 === n3 ? void 0 : xe(n3, e4, `${t3} has member 'start' that`), write: void 0 === i3 ? void 0 : Ve(i3, e4, `${t3} has member 'write' that`), type: a5 }; + const r4 = null == e4 ? void 0 : e4.abort, o5 = null == e4 ? void 0 : e4.close, n4 = null == e4 ? void 0 : e4.start, a6 = null == e4 ? void 0 : e4.type, i4 = null == e4 ? void 0 : e4.write; + return { abort: void 0 === r4 ? void 0 : Ne(r4, e4, `${t3} has member 'abort' that`), close: void 0 === o5 ? void 0 : He(o5, e4, `${t3} has member 'close' that`), start: void 0 === n4 ? void 0 : xe(n4, e4, `${t3} has member 'start' that`), write: void 0 === i4 ? void 0 : Ve(i4, e4, `${t3} has member 'write' that`), type: a6 }; }(e3, "First parameter"); - var n2; - (n2 = this)._state = "writable", n2._storedError = void 0, n2._writer = void 0, n2._writableStreamController = void 0, n2._writeRequests = new S5(), n2._inFlightWriteRequest = void 0, n2._closeRequest = void 0, n2._inFlightCloseRequest = void 0, n2._pendingAbortRequest = void 0, n2._backpressure = false; - if (void 0 !== o3.type) + var n3; + (n3 = this)._state = "writable", n3._storedError = void 0, n3._writer = void 0, n3._writableStreamController = void 0, n3._writeRequests = new S5(), n3._inFlightWriteRequest = void 0, n3._closeRequest = void 0, n3._inFlightCloseRequest = void 0, n3._pendingAbortRequest = void 0, n3._backpressure = false; + if (void 0 !== o4.type) throw new RangeError("Invalid type is specified"); - const a4 = Me(r3); - !function(e4, t3, r4, o4) { - const n3 = Object.create(WritableStreamDefaultController.prototype); - let a5, i3, l3, s2; - a5 = void 0 !== t3.start ? () => t3.start(n3) : () => { + const a5 = Me(r3); + !function(e4, t3, r4, o5) { + const n4 = Object.create(WritableStreamDefaultController.prototype); + let a6, i4, l3, s2; + a6 = void 0 !== t3.start ? () => t3.start(n4) : () => { }; - i3 = void 0 !== t3.write ? (e5) => t3.write(e5, n3) : () => c2(void 0); - l3 = void 0 !== t3.close ? () => t3.close() : () => c2(void 0); - s2 = void 0 !== t3.abort ? (e5) => t3.abort(e5) : () => c2(void 0); - !function(e5, t4, r5, o5, n4, a6, i4, l4) { + i4 = void 0 !== t3.write ? (e5) => t3.write(e5, n4) : () => c4(void 0); + l3 = void 0 !== t3.close ? () => t3.close() : () => c4(void 0); + s2 = void 0 !== t3.abort ? (e5) => t3.abort(e5) : () => c4(void 0); + !function(e5, t4, r5, o6, n5, a7, i5, l4) { t4._controlledWritableStream = e5, e5._writableStreamController = t4, t4._queue = void 0, t4._queueTotalSize = void 0, ce2(t4), t4._abortReason = void 0, t4._abortController = function() { if (Ue) return new AbortController(); - }(), t4._started = false, t4._strategySizeAlgorithm = l4, t4._strategyHWM = i4, t4._writeAlgorithm = o5, t4._closeAlgorithm = n4, t4._abortAlgorithm = a6; + }(), t4._started = false, t4._strategySizeAlgorithm = l4, t4._strategyHWM = i5, t4._writeAlgorithm = o6, t4._closeAlgorithm = n5, t4._abortAlgorithm = a7; const s3 = bt(t4); nt(e5, s3); - const u3 = r5(); - b6(c2(u3), () => (t4._started = true, dt(t4), null), (r6) => (t4._started = true, Ze(e5, r6), null)); - }(e4, n3, a5, i3, l3, s2, r4, o4); - }(this, o3, $e(r3, 1), a4); + const u4 = r5(); + b6(c4(u4), () => (t4._started = true, dt(t4), null), (r6) => (t4._started = true, Ze(e5, r6), null)); + }(e4, n4, a6, i4, l3, s2, r4, o5); + }(this, o4, $e(r3, 1), a5); } get locked() { if (!Ge(this)) @@ -5886,7 +5554,7 @@ var init_ponyfill = __esm({ return new WritableStreamDefaultWriter(this); } }; - Object.defineProperties(WritableStream.prototype, { abort: { enumerable: true }, close: { enumerable: true }, getWriter: { enumerable: true }, locked: { enumerable: true } }), n(WritableStream.prototype.abort, "abort"), n(WritableStream.prototype.close, "close"), n(WritableStream.prototype.getWriter, "getWriter"), "symbol" == typeof e2.toStringTag && Object.defineProperty(WritableStream.prototype, e2.toStringTag, { value: "WritableStream", configurable: true }); + Object.defineProperties(WritableStream.prototype, { abort: { enumerable: true }, close: { enumerable: true }, getWriter: { enumerable: true }, locked: { enumerable: true } }), n2(WritableStream.prototype.abort, "abort"), n2(WritableStream.prototype.close, "close"), n2(WritableStream.prototype.getWriter, "getWriter"), "symbol" == typeof e2.toStringTag && Object.defineProperty(WritableStream.prototype, e2.toStringTag, { value: "WritableStream", configurable: true }); WritableStreamDefaultWriter = class { constructor(e3) { if ($5(e3, 1, "WritableStreamDefaultWriter"), function(e4, t3) { @@ -5953,26 +5621,26 @@ var init_ponyfill = __esm({ } write(e3) { return at(this) ? void 0 === this._ownerWritableStream ? d6(yt("write to")) : function(e4, t2) { - const r3 = e4._ownerWritableStream, o3 = r3._writableStreamController, n2 = function(e5, t3) { + const r3 = e4._ownerWritableStream, o4 = r3._writableStreamController, n3 = function(e5, t3) { try { return e5._strategySizeAlgorithm(t3); } catch (t4) { return ft(e5, t4), 1; } - }(o3, t2); + }(o4, t2); if (r3 !== e4._ownerWritableStream) return d6(yt("write to")); - const a4 = r3._state; - if ("errored" === a4) + const a5 = r3._state; + if ("errored" === a5) return d6(r3._storedError); - if (rt(r3) || "closed" === a4) + if (rt(r3) || "closed" === a5) return d6(new TypeError("The stream is closing or closed and cannot be written to")); - if ("erroring" === a4) + if ("erroring" === a5) return d6(r3._storedError); - const i3 = function(e5) { - return u2((t3, r4) => { - const o4 = { _resolve: t3, _reject: r4 }; - e5._writeRequests.push(o4); + const i4 = function(e5) { + return u3((t3, r4) => { + const o5 = { _resolve: t3, _reject: r4 }; + e5._writeRequests.push(o5); }); }(r3); return function(e5, t3, r4) { @@ -5981,16 +5649,16 @@ var init_ponyfill = __esm({ } catch (t4) { return void ft(e5, t4); } - const o4 = e5._controlledWritableStream; - if (!rt(o4) && "writable" === o4._state) { - nt(o4, bt(e5)); + const o5 = e5._controlledWritableStream; + if (!rt(o5) && "writable" === o5._state) { + nt(o5, bt(e5)); } dt(e5); - }(o3, t2, n2), i3; + }(o4, t2, n3), i4; }(this, e3) : d6(mt("write")); } }; - Object.defineProperties(WritableStreamDefaultWriter.prototype, { abort: { enumerable: true }, close: { enumerable: true }, releaseLock: { enumerable: true }, write: { enumerable: true }, closed: { enumerable: true }, desiredSize: { enumerable: true }, ready: { enumerable: true } }), n(WritableStreamDefaultWriter.prototype.abort, "abort"), n(WritableStreamDefaultWriter.prototype.close, "close"), n(WritableStreamDefaultWriter.prototype.releaseLock, "releaseLock"), n(WritableStreamDefaultWriter.prototype.write, "write"), "symbol" == typeof e2.toStringTag && Object.defineProperty(WritableStreamDefaultWriter.prototype, e2.toStringTag, { value: "WritableStreamDefaultWriter", configurable: true }); + Object.defineProperties(WritableStreamDefaultWriter.prototype, { abort: { enumerable: true }, close: { enumerable: true }, releaseLock: { enumerable: true }, write: { enumerable: true }, closed: { enumerable: true }, desiredSize: { enumerable: true }, ready: { enumerable: true } }), n2(WritableStreamDefaultWriter.prototype.abort, "abort"), n2(WritableStreamDefaultWriter.prototype.close, "close"), n2(WritableStreamDefaultWriter.prototype.releaseLock, "releaseLock"), n2(WritableStreamDefaultWriter.prototype.write, "write"), "symbol" == typeof e2.toStringTag && Object.defineProperty(WritableStreamDefaultWriter.prototype, e2.toStringTag, { value: "WritableStreamDefaultWriter", configurable: true }); lt = {}; WritableStreamDefaultController = class { constructor() { @@ -6106,23 +5774,23 @@ var init_ponyfill = __esm({ [C4]() { } }; - Object.defineProperties(ReadableStreamDefaultController.prototype, { close: { enumerable: true }, enqueue: { enumerable: true }, error: { enumerable: true }, desiredSize: { enumerable: true } }), n(ReadableStreamDefaultController.prototype.close, "close"), n(ReadableStreamDefaultController.prototype.enqueue, "enqueue"), n(ReadableStreamDefaultController.prototype.error, "error"), "symbol" == typeof e2.toStringTag && Object.defineProperty(ReadableStreamDefaultController.prototype, e2.toStringTag, { value: "ReadableStreamDefaultController", configurable: true }); + Object.defineProperties(ReadableStreamDefaultController.prototype, { close: { enumerable: true }, enqueue: { enumerable: true }, error: { enumerable: true }, desiredSize: { enumerable: true } }), n2(ReadableStreamDefaultController.prototype.close, "close"), n2(ReadableStreamDefaultController.prototype.enqueue, "enqueue"), n2(ReadableStreamDefaultController.prototype.error, "error"), "symbol" == typeof e2.toStringTag && Object.defineProperty(ReadableStreamDefaultController.prototype, e2.toStringTag, { value: "ReadableStreamDefaultController", configurable: true }); ReadableStream3 = class { constructor(e3 = {}, t2 = {}) { void 0 === e3 ? e3 = null : D4(e3, "First parameter"); - const r3 = Ye(t2, "Second parameter"), o3 = function(e4, t3) { + const r3 = Ye(t2, "Second parameter"), o4 = function(e4, t3) { F4(e4, t3); - const r4 = e4, o4 = null == r4 ? void 0 : r4.autoAllocateChunkSize, n3 = null == r4 ? void 0 : r4.cancel, a4 = null == r4 ? void 0 : r4.pull, i3 = null == r4 ? void 0 : r4.start, l3 = null == r4 ? void 0 : r4.type; - return { autoAllocateChunkSize: void 0 === o4 ? void 0 : N5(o4, `${t3} has member 'autoAllocateChunkSize' that`), cancel: void 0 === n3 ? void 0 : $t(n3, r4, `${t3} has member 'cancel' that`), pull: void 0 === a4 ? void 0 : Mt(a4, r4, `${t3} has member 'pull' that`), start: void 0 === i3 ? void 0 : Yt(i3, r4, `${t3} has member 'start' that`), type: void 0 === l3 ? void 0 : Qt(l3, `${t3} has member 'type' that`) }; + const r4 = e4, o5 = null == r4 ? void 0 : r4.autoAllocateChunkSize, n4 = null == r4 ? void 0 : r4.cancel, a5 = null == r4 ? void 0 : r4.pull, i4 = null == r4 ? void 0 : r4.start, l3 = null == r4 ? void 0 : r4.type; + return { autoAllocateChunkSize: void 0 === o5 ? void 0 : N5(o5, `${t3} has member 'autoAllocateChunkSize' that`), cancel: void 0 === n4 ? void 0 : $t(n4, r4, `${t3} has member 'cancel' that`), pull: void 0 === a5 ? void 0 : Mt(a5, r4, `${t3} has member 'pull' that`), start: void 0 === i4 ? void 0 : Yt(i4, r4, `${t3} has member 'start' that`), type: void 0 === l3 ? void 0 : Qt(l3, `${t3} has member 'type' that`) }; }(e3, "First parameter"); - var n2; - if ((n2 = this)._state = "readable", n2._reader = void 0, n2._storedError = void 0, n2._disturbed = false, "bytes" === o3.type) { + var n3; + if ((n3 = this)._state = "readable", n3._reader = void 0, n3._storedError = void 0, n3._disturbed = false, "bytes" === o4.type) { if (void 0 !== r3.size) throw new RangeError("The strategy for a byte stream cannot have a size function"); - Oe(this, o3, $e(r3, 0)); + Oe(this, o4, $e(r3, 0)); } else { const e4 = Me(r3); - It(this, o3, $e(r3, 1), e4); + It(this, o4, $e(r3, 1), e4); } } get locked() { @@ -6148,12 +5816,12 @@ var init_ponyfill = __esm({ if (!H4(this)) throw Kt("pipeThrough"); $5(e3, 1, "pipeThrough"); - const r3 = xt(e3, "First parameter"), o3 = Ht(t2, "Second parameter"); + const r3 = xt(e3, "First parameter"), o4 = Ht(t2, "Second parameter"); if (this.locked) throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream"); if (r3.writable.locked) throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream"); - return m4(kt(this, r3.writable, o3.preventClose, o3.preventAbort, o3.preventCancel, o3.signal)), r3.readable; + return m4(kt(this, r3.writable, o4.preventClose, o4.preventAbort, o4.preventCancel, o4.signal)), r3.readable; } pipeTo(e3, t2 = {}) { if (!H4(this)) @@ -6181,8 +5849,8 @@ var init_ponyfill = __esm({ if (!H4(this)) throw Kt("values"); return function(e4, t2) { - const r3 = e4.getReader(), o3 = new te(r3, t2), n2 = Object.create(re2); - return n2._asyncIteratorImpl = o3, n2; + const r3 = e4.getReader(), o4 = new te(r3, t2), n3 = Object.create(re2); + return n3._asyncIteratorImpl = o4, n3; }(this, function(e4, t2) { F4(e4, t2); const r3 = null == e4 ? void 0 : e4.preventCancel; @@ -6190,9 +5858,9 @@ var init_ponyfill = __esm({ }(e3, "First parameter").preventCancel); } }; - Object.defineProperties(ReadableStream3.prototype, { cancel: { enumerable: true }, getReader: { enumerable: true }, pipeThrough: { enumerable: true }, pipeTo: { enumerable: true }, tee: { enumerable: true }, values: { enumerable: true }, locked: { enumerable: true } }), n(ReadableStream3.prototype.cancel, "cancel"), n(ReadableStream3.prototype.getReader, "getReader"), n(ReadableStream3.prototype.pipeThrough, "pipeThrough"), n(ReadableStream3.prototype.pipeTo, "pipeTo"), n(ReadableStream3.prototype.tee, "tee"), n(ReadableStream3.prototype.values, "values"), "symbol" == typeof e2.toStringTag && Object.defineProperty(ReadableStream3.prototype, e2.toStringTag, { value: "ReadableStream", configurable: true }), "symbol" == typeof e2.asyncIterator && Object.defineProperty(ReadableStream3.prototype, e2.asyncIterator, { value: ReadableStream3.prototype.values, writable: true, configurable: true }); + Object.defineProperties(ReadableStream3.prototype, { cancel: { enumerable: true }, getReader: { enumerable: true }, pipeThrough: { enumerable: true }, pipeTo: { enumerable: true }, tee: { enumerable: true }, values: { enumerable: true }, locked: { enumerable: true } }), n2(ReadableStream3.prototype.cancel, "cancel"), n2(ReadableStream3.prototype.getReader, "getReader"), n2(ReadableStream3.prototype.pipeThrough, "pipeThrough"), n2(ReadableStream3.prototype.pipeTo, "pipeTo"), n2(ReadableStream3.prototype.tee, "tee"), n2(ReadableStream3.prototype.values, "values"), "symbol" == typeof e2.toStringTag && Object.defineProperty(ReadableStream3.prototype, e2.toStringTag, { value: "ReadableStream", configurable: true }), "symbol" == typeof e2.asyncIterator && Object.defineProperty(ReadableStream3.prototype, e2.asyncIterator, { value: ReadableStream3.prototype.values, writable: true, configurable: true }); er = (e3) => e3.byteLength; - n(er, "size"); + n2(er, "size"); ByteLengthQueuingStrategy = class { constructor(e3) { $5(e3, 1, "ByteLengthQueuingStrategy"), e3 = Zt(e3, "First parameter"), this._byteLengthQueuingStrategyHighWaterMark = e3.highWaterMark; @@ -6210,8 +5878,8 @@ var init_ponyfill = __esm({ }; Object.defineProperties(ByteLengthQueuingStrategy.prototype, { highWaterMark: { enumerable: true }, size: { enumerable: true } }), "symbol" == typeof e2.toStringTag && Object.defineProperty(ByteLengthQueuingStrategy.prototype, e2.toStringTag, { value: "ByteLengthQueuingStrategy", configurable: true }); or = () => 1; - n(or, "size"); - CountQueuingStrategy = class { + n2(or, "size"); + CountQueuingStrategy2 = class { constructor(e3) { $5(e3, 1, "CountQueuingStrategy"), e3 = Zt(e3, "First parameter"), this._countQueuingStrategyHighWaterMark = e3.highWaterMark; } @@ -6226,23 +5894,23 @@ var init_ponyfill = __esm({ return or; } }; - Object.defineProperties(CountQueuingStrategy.prototype, { highWaterMark: { enumerable: true }, size: { enumerable: true } }), "symbol" == typeof e2.toStringTag && Object.defineProperty(CountQueuingStrategy.prototype, e2.toStringTag, { value: "CountQueuingStrategy", configurable: true }); + Object.defineProperties(CountQueuingStrategy2.prototype, { highWaterMark: { enumerable: true }, size: { enumerable: true } }), "symbol" == typeof e2.toStringTag && Object.defineProperty(CountQueuingStrategy2.prototype, e2.toStringTag, { value: "CountQueuingStrategy", configurable: true }); TransformStream2 = class { constructor(e3 = {}, t2 = {}, r3 = {}) { void 0 === e3 && (e3 = null); - const o3 = Ye(t2, "Second parameter"), n2 = Ye(r3, "Third parameter"), a4 = function(e4, t3) { + const o4 = Ye(t2, "Second parameter"), n3 = Ye(r3, "Third parameter"), a5 = function(e4, t3) { F4(e4, t3); - const r4 = null == e4 ? void 0 : e4.flush, o4 = null == e4 ? void 0 : e4.readableType, n3 = null == e4 ? void 0 : e4.start, a5 = null == e4 ? void 0 : e4.transform, i4 = null == e4 ? void 0 : e4.writableType; - return { flush: void 0 === r4 ? void 0 : ir(r4, e4, `${t3} has member 'flush' that`), readableType: o4, start: void 0 === n3 ? void 0 : lr(n3, e4, `${t3} has member 'start' that`), transform: void 0 === a5 ? void 0 : sr(a5, e4, `${t3} has member 'transform' that`), writableType: i4 }; + const r4 = null == e4 ? void 0 : e4.flush, o5 = null == e4 ? void 0 : e4.readableType, n4 = null == e4 ? void 0 : e4.start, a6 = null == e4 ? void 0 : e4.transform, i5 = null == e4 ? void 0 : e4.writableType; + return { flush: void 0 === r4 ? void 0 : ir(r4, e4, `${t3} has member 'flush' that`), readableType: o5, start: void 0 === n4 ? void 0 : lr(n4, e4, `${t3} has member 'start' that`), transform: void 0 === a6 ? void 0 : sr(a6, e4, `${t3} has member 'transform' that`), writableType: i5 }; }(e3, "First parameter"); - if (void 0 !== a4.readableType) + if (void 0 !== a5.readableType) throw new RangeError("Invalid readableType specified"); - if (void 0 !== a4.writableType) + if (void 0 !== a5.writableType) throw new RangeError("Invalid writableType specified"); - const i3 = $e(n2, 0), l3 = Me(n2), s2 = $e(o3, 1), f4 = Me(o3); + const i4 = $e(n3, 0), l3 = Me(n3), s2 = $e(o4, 1), f4 = Me(o4); let b7; - !function(e4, t3, r4, o4, n3, a5) { - function i4() { + !function(e4, t3, r4, o5, n4, a6) { + function i5() { return t3; } function l4(t4) { @@ -6260,10 +5928,10 @@ var init_ponyfill = __esm({ } function s3(t4) { return function(e5, t5) { - return cr(e5, t5), c2(void 0); + return cr(e5, t5), c4(void 0); }(e4, t4); } - function u3() { + function u4() { return function(e5) { const t4 = e5._transformStreamController, r5 = t4._flushAlgorithm(); return hr(t4), p3(r5, () => { @@ -6281,9 +5949,9 @@ var init_ponyfill = __esm({ }(e4); } function f5(t4) { - return dr(e4, t4), c2(void 0); + return dr(e4, t4), c4(void 0); } - e4._writableState = "writable", e4._writableStoredError = void 0, e4._writableHasInFlightOperation = false, e4._writableStarted = false, e4._writable = function(e5, t4, r5, o5, n4, a6, i5) { + e4._writableState = "writable", e4._writableStoredError = void 0, e4._writableHasInFlightOperation = false, e4._writableStarted = false, e4._writable = function(e5, t4, r5, o6, n5, a7, i6) { return new WritableStream({ start(r6) { e5._writableController = r6; try { @@ -6306,7 +5974,7 @@ var init_ponyfill = __esm({ }(e5, t6), t6; })), close: () => (function(e6) { e6._writableHasInFlightOperation = true; - }(e5), p3(o5(), () => (function(e6) { + }(e5), p3(o6(), () => (function(e6) { e6._writableHasInFlightOperation = false; "erroring" === e6._writableState && (e6._writableStoredError = void 0); e6._writableState = "closed"; @@ -6314,31 +5982,31 @@ var init_ponyfill = __esm({ throw function(e6, t6) { e6._writableHasInFlightOperation = false, e6._writableState, Rr(e6, t6); }(e5, t5), t5; - })), abort: (t5) => (e5._writableState = "errored", e5._writableStoredError = t5, n4(t5)) }, { highWaterMark: a6, size: i5 }); - }(e4, i4, l4, u3, s3, r4, o4), e4._readableState = "readable", e4._readableStoredError = void 0, e4._readableCloseRequested = false, e4._readablePulling = false, e4._readable = function(e5, t4, r5, o5, n4, a6) { + })), abort: (t5) => (e5._writableState = "errored", e5._writableStoredError = t5, n5(t5)) }, { highWaterMark: a7, size: i6 }); + }(e4, i5, l4, u4, s3, r4, o5), e4._readableState = "readable", e4._readableStoredError = void 0, e4._readableCloseRequested = false, e4._readablePulling = false, e4._readable = function(e5, t4, r5, o6, n5, a7) { return new ReadableStream3({ start: (r6) => (e5._readableController = r6, t4().catch((t5) => { Sr(e5, t5); })), pull: () => (e5._readablePulling = true, r5().catch((t5) => { Sr(e5, t5); - })), cancel: (t5) => (e5._readableState = "closed", o5(t5)) }, { highWaterMark: n4, size: a6 }); - }(e4, i4, d7, f5, n3, a5), e4._backpressure = void 0, e4._backpressureChangePromise = void 0, e4._backpressureChangePromise_resolve = void 0, fr(e4, true), e4._transformStreamController = void 0; - }(this, u2((e4) => { + })), cancel: (t5) => (e5._readableState = "closed", o6(t5)) }, { highWaterMark: n5, size: a7 }); + }(e4, i5, d7, f5, n4, a6), e4._backpressure = void 0, e4._backpressureChangePromise = void 0, e4._backpressureChangePromise_resolve = void 0, fr(e4, true), e4._transformStreamController = void 0; + }(this, u3((e4) => { b7 = e4; - }), s2, f4, i3, l3), function(e4, t3) { + }), s2, f4, i4, l3), function(e4, t3) { const r4 = Object.create(TransformStreamDefaultController.prototype); - let o4, n3; - o4 = void 0 !== t3.transform ? (e5) => t3.transform(e5, r4) : (e5) => { + let o5, n4; + o5 = void 0 !== t3.transform ? (e5) => t3.transform(e5, r4) : (e5) => { try { - return _r(r4, e5), c2(void 0); + return _r(r4, e5), c4(void 0); } catch (e6) { return d6(e6); } }; - n3 = void 0 !== t3.flush ? () => t3.flush(r4) : () => c2(void 0); - !function(e5, t4, r5, o5) { - t4._controlledTransformStream = e5, e5._transformStreamController = t4, t4._transformAlgorithm = r5, t4._flushAlgorithm = o5; - }(e4, r4, o4, n3); - }(this, a4), void 0 !== a4.start ? b7(a4.start(this._transformStreamController)) : b7(void 0); + n4 = void 0 !== t3.flush ? () => t3.flush(r4) : () => c4(void 0); + !function(e5, t4, r5, o6) { + t4._controlledTransformStream = e5, e5._transformStreamController = t4, t4._transformAlgorithm = r5, t4._flushAlgorithm = o6; + }(e4, r4, o5, n4); + }(this, a5), void 0 !== a5.start ? b7(a5.start(this._transformStreamController)) : b7(void 0); } get readable() { if (!ur(this)) @@ -6383,7 +6051,7 @@ var init_ponyfill = __esm({ }(this); } }; - Object.defineProperties(TransformStreamDefaultController.prototype, { enqueue: { enumerable: true }, error: { enumerable: true }, terminate: { enumerable: true }, desiredSize: { enumerable: true } }), n(TransformStreamDefaultController.prototype.enqueue, "enqueue"), n(TransformStreamDefaultController.prototype.error, "error"), n(TransformStreamDefaultController.prototype.terminate, "terminate"), "symbol" == typeof e2.toStringTag && Object.defineProperty(TransformStreamDefaultController.prototype, e2.toStringTag, { value: "TransformStreamDefaultController", configurable: true }); + Object.defineProperties(TransformStreamDefaultController.prototype, { enqueue: { enumerable: true }, error: { enumerable: true }, terminate: { enumerable: true }, desiredSize: { enumerable: true } }), n2(TransformStreamDefaultController.prototype.enqueue, "enqueue"), n2(TransformStreamDefaultController.prototype.error, "error"), n2(TransformStreamDefaultController.prototype.terminate, "terminate"), "symbol" == typeof e2.toStringTag && Object.defineProperty(TransformStreamDefaultController.prototype, e2.toStringTag, { value: "TransformStreamDefaultController", configurable: true }); } }); @@ -6653,8 +6321,8 @@ var require_ms = __commonJS({ "node_modules/ms/index.js"(exports, module2) { var s2 = 1e3; var m5 = s2 * 60; - var h4 = m5 * 60; - var d7 = h4 * 24; + var h5 = m5 * 60; + var d7 = h5 * 24; var w7 = d7 * 7; var y6 = d7 * 365.25; module2.exports = function(val, options) { @@ -6680,7 +6348,7 @@ var require_ms = __commonJS({ if (!match) { return; } - var n2 = parseFloat(match[1]); + var n3 = parseFloat(match[1]); var type2 = (match[2] || "ms").toLowerCase(); switch (type2) { case "years": @@ -6688,39 +6356,39 @@ var require_ms = __commonJS({ case "yrs": case "yr": case "y": - return n2 * y6; + return n3 * y6; case "weeks": case "week": case "w": - return n2 * w7; + return n3 * w7; case "days": case "day": case "d": - return n2 * d7; + return n3 * d7; case "hours": case "hour": case "hrs": case "hr": case "h": - return n2 * h4; + return n3 * h5; case "minutes": case "minute": case "mins": case "min": case "m": - return n2 * m5; + return n3 * m5; case "seconds": case "second": case "secs": case "sec": case "s": - return n2 * s2; + return n3 * s2; case "milliseconds": case "millisecond": case "msecs": case "msec": case "ms": - return n2; + return n3; default: return void 0; } @@ -6730,8 +6398,8 @@ var require_ms = __commonJS({ if (msAbs >= d7) { return Math.round(ms / d7) + "d"; } - if (msAbs >= h4) { - return Math.round(ms / h4) + "h"; + if (msAbs >= h5) { + return Math.round(ms / h5) + "h"; } if (msAbs >= m5) { return Math.round(ms / m5) + "m"; @@ -6746,8 +6414,8 @@ var require_ms = __commonJS({ if (msAbs >= d7) { return plural(ms, msAbs, d7, "day"); } - if (msAbs >= h4) { - return plural(ms, msAbs, h4, "hour"); + if (msAbs >= h5) { + return plural(ms, msAbs, h5, "hour"); } if (msAbs >= m5) { return plural(ms, msAbs, m5, "minute"); @@ -6757,9 +6425,9 @@ var require_ms = __commonJS({ } return ms + " ms"; } - function plural(ms, msAbs, n2, name) { - var isPlural = msAbs >= n2 * 1.5; - return Math.round(ms / n2) + " " + name + (isPlural ? "s" : ""); + function plural(ms, msAbs, n3, name) { + var isPlural = msAbs >= n3 * 1.5; + return Math.round(ms / n3) + " " + name + (isPlural ? "s" : ""); } } }); @@ -7005,9 +6673,9 @@ var require_agent = __commonJS({ errorSocketCount: this.errorSocketCount, timeoutSocketCount: this.timeoutSocketCount, requestCount: this.requestCount, - freeSockets: inspect3(this.freeSockets), - sockets: inspect3(this.sockets), - requests: inspect3(this.requests) + freeSockets: inspect5(this.freeSockets), + sockets: inspect5(this.sockets), + requests: inspect5(this.requests) }; } }; @@ -7121,7 +6789,7 @@ var require_agent = __commonJS({ socket.on("agentRemove", onRemove); } module2.exports = Agent3; - function inspect3(obj) { + function inspect5(obj) { const res = {}; for (const key in obj) { res[key] = obj[key].length; @@ -7234,8 +6902,8 @@ var require_event_target_shim = __commonJS({ }); Object.defineProperty(this, "isTrusted", { value: false, enumerable: true }); const keys = Object.keys(event); - for (let i3 = 0; i3 < keys.length; ++i3) { - const key = keys[i3]; + for (let i4 = 0; i4 < keys.length; ++i4) { + const key = keys[i4]; if (!(key in this)) { Object.defineProperty(this, key, defineRedirectDescriptor(key)); } @@ -7375,8 +7043,8 @@ var require_event_target_shim = __commonJS({ CustomEvent.prototype = Object.create(BaseEvent.prototype, { constructor: { value: CustomEvent, configurable: true, writable: true } }); - for (let i3 = 0; i3 < keys.length; ++i3) { - const key = keys[i3]; + for (let i4 = 0; i4 < keys.length; ++i4) { + const key = keys[i4]; if (!(key in BaseEvent.prototype)) { const descriptor = Object.getOwnPropertyDescriptor(proto2, key); const isFunc = typeof descriptor.value === "function"; @@ -7420,7 +7088,7 @@ var require_event_target_shim = __commonJS({ var CAPTURE = 1; var BUBBLE = 2; var ATTRIBUTE = 3; - function isObject3(x5) { + function isObject4(x5) { return x5 !== null && typeof x5 === "object"; } function getListeners(eventTarget) { @@ -7446,7 +7114,7 @@ var require_event_target_shim = __commonJS({ return null; }, set(listener) { - if (typeof listener !== "function" && !isObject3(listener)) { + if (typeof listener !== "function" && !isObject4(listener)) { listener = null; } const listeners = getListeners(this); @@ -7503,8 +7171,8 @@ var require_event_target_shim = __commonJS({ writable: true } }); - for (let i3 = 0; i3 < eventNames.length; ++i3) { - defineEventAttribute(CustomEventTarget.prototype, eventNames[i3]); + for (let i4 = 0; i4 < eventNames.length; ++i4) { + defineEventAttribute(CustomEventTarget.prototype, eventNames[i4]); } return CustomEventTarget; } @@ -7518,8 +7186,8 @@ var require_event_target_shim = __commonJS({ } if (arguments.length > 0) { const types = new Array(arguments.length); - for (let i3 = 0; i3 < arguments.length; ++i3) { - types[i3] = arguments[i3]; + for (let i4 = 0; i4 < arguments.length; ++i4) { + types[i4] = arguments[i4]; } return defineCustomEventTarget(types); } @@ -7530,11 +7198,11 @@ var require_event_target_shim = __commonJS({ if (listener == null) { return; } - if (typeof listener !== "function" && !isObject3(listener)) { + if (typeof listener !== "function" && !isObject4(listener)) { throw new TypeError("'listener' should be a function or an object."); } const listeners = getListeners(this); - const optionsIsObj = isObject3(options); + const optionsIsObj = isObject4(options); const capture = optionsIsObj ? Boolean(options.capture) : Boolean(options); const listenerType = capture ? CAPTURE : BUBBLE; const newNode = { @@ -7564,7 +7232,7 @@ var require_event_target_shim = __commonJS({ return; } const listeners = getListeners(this); - const capture = isObject3(options) ? Boolean(options.capture) : Boolean(options); + const capture = isObject4(options) ? Boolean(options.capture) : Boolean(options); const listenerType = capture ? CAPTURE : BUBBLE; let prev = null; let node = listeners.get(eventName); @@ -7662,11 +7330,11 @@ var require_abort_controller = __commonJS({ throw new TypeError("AbortSignal cannot be constructed directly"); } get aborted() { - const aborted = abortedFlags.get(this); - if (typeof aborted !== "boolean") { + const aborted2 = abortedFlags.get(this); + if (typeof aborted2 !== "boolean") { throw new TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this === null ? "null" : typeof this}`); } - return aborted; + return aborted2; } }; eventTargetShim.defineEventAttribute(AbortSignal.prototype, "abort"); @@ -7695,7 +7363,7 @@ var require_abort_controller = __commonJS({ } var AbortController2 = class { constructor() { - signals.set(this, createAbortSignal()); + signals2.set(this, createAbortSignal()); } get signal() { return getSignal(this); @@ -7704,9 +7372,9 @@ var require_abort_controller = __commonJS({ abortSignal(getSignal(this)); } }; - var signals = /* @__PURE__ */ new WeakMap(); + var signals2 = /* @__PURE__ */ new WeakMap(); function getSignal(controller) { - const signal = signals.get(controller); + const signal = signals2.get(controller); if (signal == null) { throw new TypeError(`Expected 'this' to be an 'AbortController' object, but got ${controller === null ? "null" : typeof controller}`); } @@ -7734,17 +7402,17 @@ var require_abort_controller = __commonJS({ // node_modules/web-streams-polyfill/dist/ponyfill.es2018.js var require_ponyfill_es2018 = __commonJS({ "node_modules/web-streams-polyfill/dist/ponyfill.es2018.js"(exports, module2) { - (function(global2, factory) { - typeof exports === "object" && typeof module2 !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.WebStreamsPolyfill = {})); + (function(global3, factory) { + typeof exports === "object" && typeof module2 !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global3 = typeof globalThis !== "undefined" ? globalThis : global3 || self, factory(global3.WebStreamsPolyfill = {})); })(exports, function(exports2) { "use strict"; - function noop2() { + function noop4() { return void 0; } function typeIsObject(x5) { return typeof x5 === "object" && x5 !== null || typeof x5 === "function"; } - const rethrowAssertionErrorRejection = noop2; + const rethrowAssertionErrorRejection = noop4; function setFunctionName(fn, name) { try { Object.defineProperty(fn, "name", { @@ -7858,20 +7526,20 @@ var require_ponyfill_es2018 = __commonJS({ return element; } forEach(callback) { - let i3 = this._cursor; + let i4 = this._cursor; let node = this._front; let elements = node._elements; - while (i3 !== elements.length || node._next !== void 0) { - if (i3 === elements.length) { + while (i4 !== elements.length || node._next !== void 0) { + if (i4 === elements.length) { node = node._next; elements = node._elements; - i3 = 0; + i4 = 0; if (elements.length === 0) { break; } } - callback(elements[i3]); - ++i3; + callback(elements[i4]); + ++i4; } } peek() { @@ -7967,11 +7635,11 @@ var require_ponyfill_es2018 = __commonJS({ throw new TypeError(`${context} is not a function.`); } } - function isObject3(x5) { + function isObject4(x5) { return typeof x5 === "object" && x5 !== null || typeof x5 === "function"; } function assertObject(x5, context) { - if (!isObject3(x5)) { + if (!isObject4(x5)) { throw new TypeError(`${context} is not an object.`); } } @@ -8260,8 +7928,8 @@ var require_ponyfill_es2018 = __commonJS({ function CreateArrayFromList(elements) { return elements.slice(); } - function CopyDataBlockBytes(dest, destOffset, src, srcOffset, n2) { - new Uint8Array(dest).set(new Uint8Array(src, srcOffset, n2), destOffset); + function CopyDataBlockBytes(dest, destOffset, src, srcOffset, n3) { + new Uint8Array(dest).set(new Uint8Array(src, srcOffset, n3), destOffset); } let TransferArrayBuffer = (O5) => { if (typeof O5.transfer === "function") { @@ -10217,7 +9885,7 @@ var require_ponyfill_es2018 = __commonJS({ return newPromise((resolveRead, rejectRead) => { ReadableStreamDefaultReaderRead(reader, { _chunkSteps: (chunk) => { - currentWrite = PerformPromiseThen(WritableStreamDefaultWriterWrite(writer, chunk), void 0, noop2); + currentWrite = PerformPromiseThen(WritableStreamDefaultWriterWrite(writer, chunk), void 0, noop4); resolveRead(false); }, _closeSteps: () => resolveRead(true), @@ -10884,7 +10552,7 @@ var require_ponyfill_es2018 = __commonJS({ function ReadableStreamFromIterable(asyncIterable) { let stream4; const iteratorRecord = GetIterator(asyncIterable, "async"); - const startAlgorithm = noop2; + const startAlgorithm = noop4; function pullAlgorithm() { let nextResult; try { @@ -10936,7 +10604,7 @@ var require_ponyfill_es2018 = __commonJS({ } function ReadableStreamFromDefaultReader(reader) { let stream4; - const startAlgorithm = noop2; + const startAlgorithm = noop4; function pullAlgorithm() { let readPromise; try { @@ -11029,13 +10697,13 @@ var require_ponyfill_es2018 = __commonJS({ } function convertReadableWritablePair(pair, context) { assertDictionary(pair, context); - const readable = pair === null || pair === void 0 ? void 0 : pair.readable; - assertRequiredField(readable, "readable", "ReadableWritablePair"); - assertReadableStream(readable, `${context} has member 'readable' that`); - const writable = pair === null || pair === void 0 ? void 0 : pair.writable; - assertRequiredField(writable, "writable", "ReadableWritablePair"); - assertWritableStream(writable, `${context} has member 'writable' that`); - return { readable, writable }; + const readable2 = pair === null || pair === void 0 ? void 0 : pair.readable; + assertRequiredField(readable2, "readable", "ReadableWritablePair"); + assertReadableStream(readable2, `${context} has member 'readable' that`); + const writable2 = pair === null || pair === void 0 ? void 0 : pair.writable; + assertRequiredField(writable2, "writable", "ReadableWritablePair"); + assertWritableStream(writable2, `${context} has member 'writable' that`); + return { readable: readable2, writable: writable2 }; } class ReadableStream7 { constructor(rawUnderlyingSource = {}, rawStrategy = {}) { @@ -11229,7 +10897,7 @@ var require_ponyfill_es2018 = __commonJS({ }); } const sourceCancelPromise = stream4._readableStreamController[CancelSteps](reason); - return transformPromiseWith(sourceCancelPromise, noop2); + return transformPromiseWith(sourceCancelPromise, noop4); } function ReadableStreamClose(stream4) { stream4._state = "closed"; @@ -11320,7 +10988,7 @@ var require_ponyfill_es2018 = __commonJS({ return 1; }; setFunctionName(countSizeFunction, "size"); - class CountQueuingStrategy2 { + class CountQueuingStrategy3 { constructor(options) { assertRequiredArgument(options, 1, "CountQueuingStrategy"); options = convertQueuingStrategyInit(options, "First parameter"); @@ -11339,12 +11007,12 @@ var require_ponyfill_es2018 = __commonJS({ return countSizeFunction; } } - Object.defineProperties(CountQueuingStrategy2.prototype, { + Object.defineProperties(CountQueuingStrategy3.prototype, { highWaterMark: { enumerable: true }, size: { enumerable: true } }); if (typeof Symbol.toStringTag === "symbol") { - Object.defineProperty(CountQueuingStrategy2.prototype, Symbol.toStringTag, { + Object.defineProperty(CountQueuingStrategy3.prototype, Symbol.toStringTag, { value: "CountQueuingStrategy", configurable: true }); @@ -11359,7 +11027,7 @@ var require_ponyfill_es2018 = __commonJS({ if (!Object.prototype.hasOwnProperty.call(x5, "_countQueuingStrategyHighWaterMark")) { return false; } - return x5 instanceof CountQueuingStrategy2; + return x5 instanceof CountQueuingStrategy3; } function convertTransformer(original, context) { assertDictionary(original, context); @@ -11643,10 +11311,10 @@ var require_ponyfill_es2018 = __commonJS({ if (stream4._backpressure) { const backpressureChangePromise = stream4._backpressureChangePromise; return transformPromiseWith(backpressureChangePromise, () => { - const writable = stream4._writable; - const state2 = writable._state; + const writable2 = stream4._writable; + const state2 = writable2._state; if (state2 === "erroring") { - throw writable._storedError; + throw writable2._storedError; } return TransformStreamDefaultControllerPerformTransform(controller, chunk); }); @@ -11658,7 +11326,7 @@ var require_ponyfill_es2018 = __commonJS({ if (controller._finishPromise !== void 0) { return controller._finishPromise; } - const readable = stream4._readable; + const readable2 = stream4._readable; controller._finishPromise = newPromise((resolve, reject) => { controller._finishPromise_resolve = resolve; controller._finishPromise_reject = reject; @@ -11666,15 +11334,15 @@ var require_ponyfill_es2018 = __commonJS({ const cancelPromise = controller._cancelAlgorithm(reason); TransformStreamDefaultControllerClearAlgorithms(controller); uponPromise(cancelPromise, () => { - if (readable._state === "errored") { - defaultControllerFinishPromiseReject(controller, readable._storedError); + if (readable2._state === "errored") { + defaultControllerFinishPromiseReject(controller, readable2._storedError); } else { - ReadableStreamDefaultControllerError(readable._readableStreamController, reason); + ReadableStreamDefaultControllerError(readable2._readableStreamController, reason); defaultControllerFinishPromiseResolve(controller); } return null; }, (r3) => { - ReadableStreamDefaultControllerError(readable._readableStreamController, r3); + ReadableStreamDefaultControllerError(readable2._readableStreamController, r3); defaultControllerFinishPromiseReject(controller, r3); return null; }); @@ -11685,7 +11353,7 @@ var require_ponyfill_es2018 = __commonJS({ if (controller._finishPromise !== void 0) { return controller._finishPromise; } - const readable = stream4._readable; + const readable2 = stream4._readable; controller._finishPromise = newPromise((resolve, reject) => { controller._finishPromise_resolve = resolve; controller._finishPromise_reject = reject; @@ -11693,15 +11361,15 @@ var require_ponyfill_es2018 = __commonJS({ const flushPromise = controller._flushAlgorithm(); TransformStreamDefaultControllerClearAlgorithms(controller); uponPromise(flushPromise, () => { - if (readable._state === "errored") { - defaultControllerFinishPromiseReject(controller, readable._storedError); + if (readable2._state === "errored") { + defaultControllerFinishPromiseReject(controller, readable2._storedError); } else { - ReadableStreamDefaultControllerClose(readable._readableStreamController); + ReadableStreamDefaultControllerClose(readable2._readableStreamController); defaultControllerFinishPromiseResolve(controller); } return null; }, (r3) => { - ReadableStreamDefaultControllerError(readable._readableStreamController, r3); + ReadableStreamDefaultControllerError(readable2._readableStreamController, r3); defaultControllerFinishPromiseReject(controller, r3); return null; }); @@ -11716,7 +11384,7 @@ var require_ponyfill_es2018 = __commonJS({ if (controller._finishPromise !== void 0) { return controller._finishPromise; } - const writable = stream4._writable; + const writable2 = stream4._writable; controller._finishPromise = newPromise((resolve, reject) => { controller._finishPromise_resolve = resolve; controller._finishPromise_reject = reject; @@ -11724,16 +11392,16 @@ var require_ponyfill_es2018 = __commonJS({ const cancelPromise = controller._cancelAlgorithm(reason); TransformStreamDefaultControllerClearAlgorithms(controller); uponPromise(cancelPromise, () => { - if (writable._state === "errored") { - defaultControllerFinishPromiseReject(controller, writable._storedError); + if (writable2._state === "errored") { + defaultControllerFinishPromiseReject(controller, writable2._storedError); } else { - WritableStreamDefaultControllerErrorIfNeeded(writable._writableStreamController, reason); + WritableStreamDefaultControllerErrorIfNeeded(writable2._writableStreamController, reason); TransformStreamUnblockWrite(stream4); defaultControllerFinishPromiseResolve(controller); } return null; }, (r3) => { - WritableStreamDefaultControllerErrorIfNeeded(writable._writableStreamController, r3); + WritableStreamDefaultControllerErrorIfNeeded(writable2._writableStreamController, r3); TransformStreamUnblockWrite(stream4); defaultControllerFinishPromiseReject(controller, r3); return null; @@ -11764,7 +11432,7 @@ var require_ponyfill_es2018 = __commonJS({ return new TypeError(`TransformStream.prototype.${name} can only be used on a TransformStream`); } exports2.ByteLengthQueuingStrategy = ByteLengthQueuingStrategy2; - exports2.CountQueuingStrategy = CountQueuingStrategy2; + exports2.CountQueuingStrategy = CountQueuingStrategy3; exports2.ReadableByteStreamController = ReadableByteStreamController2; exports2.ReadableStream = ReadableStream7; exports2.ReadableStreamBYOBReader = ReadableStreamBYOBReader2; @@ -11796,7 +11464,7 @@ var require_node_domexception = __commonJS({ }); // node_modules/formdata-node/lib/esm/isPlainObject.js -function isPlainObject2(value) { +function isPlainObject3(value) { if (getType2(value) !== "object") { return false; } @@ -11811,7 +11479,7 @@ var getType2, isPlainObject_default2; var init_isPlainObject = __esm({ "node_modules/formdata-node/lib/esm/isPlainObject.js"() { getType2 = (value) => Object.prototype.toString.call(value).slice(8, -1).toLowerCase(); - isPlainObject_default2 = isPlainObject2; + isPlainObject_default2 = isPlainObject3; } }); @@ -11822,14 +11490,14 @@ __export(fileFromPath_exports, { fileFromPathSync: () => fileFromPathSync, isFile: () => isFile }); -function createFileFromPath(path5, { mtimeMs, size }, filenameOrOptions, options = {}) { +function createFileFromPath(path7, { mtimeMs, size }, filenameOrOptions, options = {}) { let filename; if (isPlainObject_default2(filenameOrOptions)) { [options, filename] = [filenameOrOptions, void 0]; } else { filename = filenameOrOptions; } - const file = new FileFromPath({ path: path5, size, lastModified: mtimeMs }); + const file = new FileFromPath({ path: path7, size, lastModified: mtimeMs }); if (!filename) { filename = file.name; } @@ -11838,13 +11506,13 @@ function createFileFromPath(path5, { mtimeMs, size }, filenameOrOptions, options lastModified: file.lastModified }); } -function fileFromPathSync(path5, filenameOrOptions, options = {}) { - const stats = (0, import_fs2.statSync)(path5); - return createFileFromPath(path5, stats, filenameOrOptions, options); +function fileFromPathSync(path7, filenameOrOptions, options = {}) { + const stats = (0, import_fs2.statSync)(path7); + return createFileFromPath(path7, stats, filenameOrOptions, options); } -async function fileFromPath2(path5, filenameOrOptions, options) { - const stats = await import_fs2.promises.stat(path5); - return createFileFromPath(path5, stats, filenameOrOptions, options); +async function fileFromPath2(path7, filenameOrOptions, options) { + const stats = await import_fs2.promises.stat(path7); + return createFileFromPath(path7, stats, filenameOrOptions, options); } var import_fs2, import_path2, import_node_domexception, __classPrivateFieldSet4, __classPrivateFieldGet5, _FileFromPath_path, _FileFromPath_start, MESSAGE, FileFromPath; var init_fileFromPath = __esm({ @@ -12081,8 +11749,8 @@ var require_combined_stream = __commonJS({ this._pipeNext(stream4); return; } - var getStream3 = stream4; - getStream3(function(stream5) { + var getStream2 = stream4; + getStream2(function(stream5) { var isStreamLike = CombinedStream.isStreamLike(stream5); if (isStreamLike) { stream5.on("data", this._checkDataSize.bind(this)); @@ -20759,11 +20427,11 @@ var require_mime_types = __commonJS({ } return exts[0]; } - function lookup(path5) { - if (!path5 || typeof path5 !== "string") { + function lookup(path7) { + if (!path7 || typeof path7 !== "string") { return false; } - var extension2 = extname("x." + path5).toLowerCase().substr(1); + var extension2 = extname("x." + path7).toLowerCase().substr(1); if (!extension2) { return false; } @@ -20778,8 +20446,8 @@ var require_mime_types = __commonJS({ return; } extensions[type2] = exts; - for (var i3 = 0; i3 < exts.length; i3++) { - var extension2 = exts[i3]; + for (var i4 = 0; i4 < exts.length; i4++) { + var extension2 = exts[i4]; if (types[extension2]) { var from = preference.indexOf(db[types[extension2]].source); var to = preference.indexOf(mime.source); @@ -20894,8 +20562,8 @@ var require_state = __commonJS({ size: isNamedList ? Object.keys(list).length : list.length }; if (sortMethod) { - initState.keyedList.sort(isNamedList ? sortMethod : function(a4, b7) { - return sortMethod(list[a4], list[b7]); + initState.keyedList.sort(isNamedList ? sortMethod : function(a5, b7) { + return sortMethod(list[a5], list[b7]); }); } return initState; @@ -20972,11 +20640,11 @@ var require_serialOrdered = __commonJS({ }); return terminator.bind(state2, callback); } - function ascending(a4, b7) { - return a4 < b7 ? -1 : a4 > b7 ? 1 : 0; + function ascending(a5, b7) { + return a5 < b7 ? -1 : a5 > b7 ? 1 : 0; } - function descending(a4, b7) { - return -1 * ascending(a4, b7); + function descending(a5, b7) { + return -1 * ascending(a5, b7); } } }); @@ -21020,7 +20688,7 @@ var require_form_data = __commonJS({ "node_modules/form-data/lib/form_data.js"(exports, module2) { var CombinedStream = require_combined_stream(); var util3 = require("util"); - var path5 = require("path"); + var path7 = require("path"); var http3 = require("http"); var https3 = require("https"); var parseUrl = require("url").parse; @@ -21145,11 +20813,11 @@ var require_form_data = __commonJS({ FormData6.prototype._getContentDisposition = function(value, options) { var filename, contentDisposition; if (typeof options.filepath === "string") { - filename = path5.normalize(options.filepath).replace(/\\/g, "/"); + filename = path7.normalize(options.filepath).replace(/\\/g, "/"); } else if (options.filename || value.name || value.path) { - filename = path5.basename(options.filename || value.name || value.path); + filename = path7.basename(options.filename || value.name || value.path); } else if (value.readable && value.hasOwnProperty("httpVersion")) { - filename = path5.basename(value.client._httpMessage.path || ""); + filename = path7.basename(value.client._httpMessage.path || ""); } if (filename) { contentDisposition = 'filename="' + filename + '"'; @@ -21212,14 +20880,14 @@ var require_form_data = __commonJS({ FormData6.prototype.getBuffer = function() { var dataBuffer = new Buffer.alloc(0); var boundary = this.getBoundary(); - for (var i3 = 0, len = this._streams.length; i3 < len; i3++) { - if (typeof this._streams[i3] !== "function") { - if (Buffer.isBuffer(this._streams[i3])) { - dataBuffer = Buffer.concat([dataBuffer, this._streams[i3]]); + for (var i4 = 0, len = this._streams.length; i4 < len; i4++) { + if (typeof this._streams[i4] !== "function") { + if (Buffer.isBuffer(this._streams[i4])) { + dataBuffer = Buffer.concat([dataBuffer, this._streams[i4]]); } else { - dataBuffer = Buffer.concat([dataBuffer, Buffer.from(this._streams[i3])]); + dataBuffer = Buffer.concat([dataBuffer, Buffer.from(this._streams[i4])]); } - if (typeof this._streams[i3] !== "string" || this._streams[i3].substring(2, boundary.length + 2) !== boundary) { + if (typeof this._streams[i4] !== "string" || this._streams[i4].substring(2, boundary.length + 2) !== boundary) { dataBuffer = Buffer.concat([dataBuffer, Buffer.from(FormData6.LINE_BREAK)]); } } @@ -21228,7 +20896,7 @@ var require_form_data = __commonJS({ }; FormData6.prototype._generateBoundary = function() { var boundary = "--------------------------"; - for (var i3 = 0; i3 < 24; i3++) { + for (var i4 = 0; i4 < 24; i4++) { boundary += Math.floor(Math.random() * 10).toString(16); } this._boundary = boundary; @@ -21418,8 +21086,8 @@ var require_common = __commonJS({ createDebug.formatters = {}; function selectColor(namespace) { let hash = 0; - for (let i3 = 0; i3 < namespace.length; i3++) { - hash = (hash << 5) - hash + namespace.charCodeAt(i3); + for (let i4 = 0; i4 < namespace.length; i4++) { + hash = (hash << 5) - hash + namespace.charCodeAt(i4); hash |= 0; } return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; @@ -21446,12 +21114,12 @@ var require_common = __commonJS({ args.unshift("%O"); } let index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format2) => { if (match === "%%") { return "%"; } index++; - const formatter = createDebug.formatters[format]; + const formatter = createDebug.formatters[format2]; if (typeof formatter === "function") { const val = args[index]; match = formatter.call(self2, val); @@ -21501,14 +21169,14 @@ var require_common = __commonJS({ createDebug.namespaces = namespaces; createDebug.names = []; createDebug.skips = []; - let i3; + let i4; const split = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/); const len = split.length; - for (i3 = 0; i3 < len; i3++) { - if (!split[i3]) { + for (i4 = 0; i4 < len; i4++) { + if (!split[i4]) { continue; } - namespaces = split[i3].replace(/\*/g, ".*?"); + namespaces = split[i4].replace(/\*/g, ".*?"); if (namespaces[0] === "-") { createDebug.skips.push(new RegExp("^" + namespaces.slice(1) + "$")); } else { @@ -21528,15 +21196,15 @@ var require_common = __commonJS({ if (name[name.length - 1] === "*") { return true; } - let i3; + let i4; let len; - for (i3 = 0, len = createDebug.skips.length; i3 < len; i3++) { - if (createDebug.skips[i3].test(name)) { + for (i4 = 0, len = createDebug.skips.length; i4 < len; i4++) { + if (createDebug.skips[i4].test(name)) { return false; } } - for (i3 = 0, len = createDebug.names.length; i3 < len; i3++) { - if (createDebug.names[i3].test(name)) { + for (i4 = 0, len = createDebug.names.length; i4 < len; i4++) { + if (createDebug.names[i4].test(name)) { return true; } } @@ -21566,7 +21234,7 @@ var require_browser = __commonJS({ "node_modules/debug/src/browser.js"(exports, module2) { exports.formatArgs = formatArgs; exports.save = save; - exports.load = load; + exports.load = load2; exports.useColors = useColors; exports.storage = localstorage(); exports.destroy = (() => { @@ -21670,8 +21338,8 @@ var require_browser = __commonJS({ if (!this.useColors) { return; } - const c3 = "color: " + this.color; - args.splice(1, 0, c3, "color: inherit"); + const c5 = "color: " + this.color; + args.splice(1, 0, c5, "color: inherit"); let index = 0; let lastC = 0; args[0].replace(/%[a-zA-Z%]/g, (match) => { @@ -21683,7 +21351,7 @@ var require_browser = __commonJS({ lastC = index; } }); - args.splice(lastC, 0, c3); + args.splice(lastC, 0, c5); } exports.log = console.debug || console.log || (() => { }); @@ -21697,7 +21365,7 @@ var require_browser = __commonJS({ } catch (error) { } } - function load() { + function load2() { let r3; try { r3 = exports.storage.getItem("debug"); @@ -21743,8 +21411,8 @@ var require_has_flag = __commonJS({ var require_supports_color = __commonJS({ "node_modules/supports-color/index.js"(exports, module2) { "use strict"; - var os4 = require("os"); - var tty2 = require("tty"); + var os3 = require("os"); + var tty4 = require("tty"); var hasFlag2 = require_has_flag(); var { env: env2 } = process; var forceColor; @@ -21791,7 +21459,7 @@ var require_supports_color = __commonJS({ return min; } if (process.platform === "win32") { - const osRelease = os4.release().split("."); + const osRelease = os3.release().split("."); if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { return Number(osRelease[2]) >= 14931 ? 3 : 2; } @@ -21835,8 +21503,8 @@ var require_supports_color = __commonJS({ } module2.exports = { supportsColor: getSupportLevel, - stdout: translateLevel2(supportsColor2(true, tty2.isatty(1))), - stderr: translateLevel2(supportsColor2(true, tty2.isatty(2))) + stdout: translateLevel2(supportsColor2(true, tty4.isatty(1))), + stderr: translateLevel2(supportsColor2(true, tty4.isatty(2))) }; } }); @@ -21844,13 +21512,13 @@ var require_supports_color = __commonJS({ // node_modules/debug/src/node.js var require_node = __commonJS({ "node_modules/debug/src/node.js"(exports, module2) { - var tty2 = require("tty"); + var tty4 = require("tty"); var util3 = require("util"); exports.init = init; exports.log = log2; exports.formatArgs = formatArgs; exports.save = save; - exports.load = load; + exports.load = load2; exports.useColors = useColors; exports.destroy = util3.deprecate( () => { @@ -21962,13 +21630,13 @@ var require_node = __commonJS({ return obj; }, {}); function useColors() { - return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty2.isatty(process.stderr.fd); + return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty4.isatty(process.stderr.fd); } function formatArgs(args) { const { namespace: name, useColors: useColors2 } = this; if (useColors2) { - const c3 = this.color; - const colorCode = "\x1B[3" + (c3 < 8 ? c3 : "8;5;" + c3); + const c5 = this.color; + const colorCode = "\x1B[3" + (c5 < 8 ? c5 : "8;5;" + c5); const prefix = ` ${colorCode};1m${name} \x1B[0m`; args[0] = prefix + args[0].split("\n").join("\n" + prefix); args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m"); @@ -21992,14 +21660,14 @@ var require_node = __commonJS({ delete process.env.DEBUG; } } - function load() { + function load2() { return process.env.DEBUG; } function init(debug3) { debug3.inspectOpts = {}; const keys = Object.keys(exports.inspectOpts); - for (let i3 = 0; i3 < keys.length; i3++) { - debug3.inspectOpts[keys[i3]] = exports.inspectOpts[keys[i3]]; + for (let i4 = 0; i4 < keys.length; i4++) { + debug3.inspectOpts[keys[i4]] = exports.inspectOpts[keys[i4]]; } } module2.exports = require_common()(exports); @@ -22053,7 +21721,7 @@ var require_follow_redirects = __commonJS({ var URL2 = url2.URL; var http3 = require("http"); var https3 = require("https"); - var Writable = require("stream").Writable; + var Writable4 = require("stream").Writable; var assert = require("assert"); var debug3 = require_debug(); var useNativeURL = false; @@ -22104,9 +21772,9 @@ var require_follow_redirects = __commonJS({ "ERR_STREAM_WRITE_AFTER_END", "write after end" ); - var destroy2 = Writable.prototype.destroy || noop2; + var destroy2 = Writable4.prototype.destroy || noop4; function RedirectableRequest(options, responseCallback) { - Writable.call(this); + Writable4.call(this); this._sanitizeOptions(options); this._options = options; this._ended = false; @@ -22128,7 +21796,7 @@ var require_follow_redirects = __commonJS({ }; this._performRequest(); } - RedirectableRequest.prototype = Object.create(Writable.prototype); + RedirectableRequest.prototype = Object.create(Writable4.prototype); RedirectableRequest.prototype.abort = function() { destroyRequest(this._currentRequest); this._currentRequest.abort(); @@ -22248,8 +21916,8 @@ var require_follow_redirects = __commonJS({ "setNoDelay", "setSocketKeepAlive" ].forEach(function(method) { - RedirectableRequest.prototype[method] = function(a4, b7) { - return this._currentRequest[method](a4, b7); + RedirectableRequest.prototype[method] = function(a5, b7) { + return this._currentRequest[method](a5, b7); }; }); ["aborted", "connection", "socket"].forEach(function(property) { @@ -22296,15 +21964,15 @@ var require_follow_redirects = __commonJS({ } this._currentUrl = /^\//.test(this._options.path) ? url2.format(this._options) : this._options.path; if (this._isRedirect) { - var i3 = 0; + var i4 = 0; var self2 = this; var buffers = this._requestBodyBuffers; (function writeNext(error) { if (request3 === self2._currentRequest) { if (error) { self2.emit("error", error); - } else if (i3 < buffers.length) { - var buffer = buffers[i3++]; + } else if (i4 < buffers.length) { + var buffer = buffers[i4++]; if (!request3.finished) { request3.write(buffer.data, buffer.encoding, writeNext); } @@ -22424,7 +22092,7 @@ var require_follow_redirects = __commonJS({ }); return exports2; } - function noop2() { + function noop4() { } function parseUrl(input) { var parsed; @@ -22498,7 +22166,7 @@ var require_follow_redirects = __commonJS({ for (var event of events) { request3.removeListener(event, eventHandlers[event]); } - request3.on("error", noop2); + request3.on("error", noop4); request3.destroy(error); } function isSubdomain(subdomain, domain) { @@ -22848,13 +22516,13 @@ var require_tiktoken = __commonJS({ var wasm = require_tiktoken_bg(); var imports = {}; imports["./tiktoken_bg.js"] = wasm; - var path5 = require("path"); + var path7 = require("path"); var fs6 = require("fs"); - var candidates = __dirname.split(path5.sep).reduce((memo, _7, index, array) => { - const prefix = array.slice(0, index + 1).join(path5.sep) + path5.sep; - if (!prefix.includes("node_modules" + path5.sep)) { + var candidates = __dirname.split(path7.sep).reduce((memo, _7, index, array) => { + const prefix = array.slice(0, index + 1).join(path7.sep) + path7.sep; + if (!prefix.includes("node_modules" + path7.sep)) { memo.unshift( - path5.join( + path7.join( prefix, "node_modules", "tiktoken", @@ -22865,7 +22533,7 @@ var require_tiktoken = __commonJS({ } return memo; }, []); - candidates.unshift(path5.join(__dirname, "./tiktoken_bg.wasm")); + candidates.unshift(path7.join(__dirname, "./tiktoken_bg.wasm")); var bytes = null; for (const candidate of candidates) { try { @@ -22958,8 +22626,8 @@ var require_tslib = __commonJS({ d7.prototype = b7 === null ? Object.create(b7) : (__.prototype = b7.prototype, new __()); }; __assign2 = Object.assign || function(t2) { - for (var s2, i3 = 1, n2 = arguments.length; i3 < n2; i3++) { - s2 = arguments[i3]; + for (var s2, i4 = 1, n3 = arguments.length; i4 < n3; i4++) { + s2 = arguments[i4]; for (var p4 in s2) if (Object.prototype.hasOwnProperty.call(s2, p4)) t2[p4] = s2[p4]; @@ -22972,21 +22640,21 @@ var require_tslib = __commonJS({ if (Object.prototype.hasOwnProperty.call(s2, p4) && e3.indexOf(p4) < 0) t2[p4] = s2[p4]; if (s2 != null && typeof Object.getOwnPropertySymbols === "function") - for (var i3 = 0, p4 = Object.getOwnPropertySymbols(s2); i3 < p4.length; i3++) { - if (e3.indexOf(p4[i3]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p4[i3])) - t2[p4[i3]] = s2[p4[i3]]; + for (var i4 = 0, p4 = Object.getOwnPropertySymbols(s2); i4 < p4.length; i4++) { + if (e3.indexOf(p4[i4]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p4[i4])) + t2[p4[i4]] = s2[p4[i4]]; } return t2; }; __decorate2 = function(decorators, target, key, desc) { - var c3 = arguments.length, r3 = c3 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d7; + var c5 = arguments.length, r3 = c5 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d7; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc); else - for (var i3 = decorators.length - 1; i3 >= 0; i3--) - if (d7 = decorators[i3]) - r3 = (c3 < 3 ? d7(r3) : c3 > 3 ? d7(target, key, r3) : d7(target, key)) || r3; - return c3 > 3 && r3 && Object.defineProperty(target, key, r3), r3; + for (var i4 = decorators.length - 1; i4 >= 0; i4--) + if (d7 = decorators[i4]) + r3 = (c5 < 3 ? d7(r3) : c5 > 3 ? d7(target, key, r3) : d7(target, key)) || r3; + return c5 > 3 && r3 && Object.defineProperty(target, key, r3), r3; }; __param2 = function(paramIndex, decorator) { return function(target, key) { @@ -23003,7 +22671,7 @@ var require_tslib = __commonJS({ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); var _7, done = false; - for (var i3 = decorators.length - 1; i3 >= 0; i3--) { + for (var i4 = decorators.length - 1; i4 >= 0; i4--) { var context = {}; for (var p4 in contextIn) context[p4] = p4 === "access" ? {} : contextIn[p4]; @@ -23014,7 +22682,7 @@ var require_tslib = __commonJS({ throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f4 || null)); }; - var result = (0, decorators[i3])(kind3 === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); + var result = (0, decorators[i4])(kind3 === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); if (kind3 === "accessor") { if (result === void 0) continue; @@ -23039,8 +22707,8 @@ var require_tslib = __commonJS({ }; __runInitializers2 = function(thisArg, initializers, value) { var useValue = arguments.length > 2; - for (var i3 = 0; i3 < initializers.length; i3++) { - value = useValue ? initializers[i3].call(thisArg, value) : initializers[i3].call(thisArg); + for (var i4 = 0; i4 < initializers.length; i4++) { + value = useValue ? initializers[i4].call(thisArg, value) : initializers[i4].call(thisArg); } return useValue ? value : void 0; }; @@ -23092,9 +22760,9 @@ var require_tslib = __commonJS({ return g4 = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g4[Symbol.iterator] = function() { return this; }), g4; - function verb(n2) { + function verb(n3) { return function(v5) { - return step([n2, v5]); + return step([n3, v5]); }; } function step(op) { @@ -23159,12 +22827,12 @@ var require_tslib = __commonJS({ return { value: op[0] ? op[1] : void 0, done: true }; } }; - __exportStar2 = function(m5, o3) { + __exportStar2 = function(m5, o4) { for (var p4 in m5) - if (p4 !== "default" && !Object.prototype.hasOwnProperty.call(o3, p4)) - __createBinding2(o3, m5, p4); + if (p4 !== "default" && !Object.prototype.hasOwnProperty.call(o4, p4)) + __createBinding2(o4, m5, p4); }; - __createBinding2 = Object.create ? function(o3, m5, k7, k22) { + __createBinding2 = Object.create ? function(o4, m5, k7, k22) { if (k22 === void 0) k22 = k7; var desc = Object.getOwnPropertyDescriptor(m5, k7); @@ -23173,40 +22841,40 @@ var require_tslib = __commonJS({ return m5[k7]; } }; } - Object.defineProperty(o3, k22, desc); - } : function(o3, m5, k7, k22) { + Object.defineProperty(o4, k22, desc); + } : function(o4, m5, k7, k22) { if (k22 === void 0) k22 = k7; - o3[k22] = m5[k7]; + o4[k22] = m5[k7]; }; - __values2 = function(o3) { - var s2 = typeof Symbol === "function" && Symbol.iterator, m5 = s2 && o3[s2], i3 = 0; + __values2 = function(o4) { + var s2 = typeof Symbol === "function" && Symbol.iterator, m5 = s2 && o4[s2], i4 = 0; if (m5) - return m5.call(o3); - if (o3 && typeof o3.length === "number") + return m5.call(o4); + if (o4 && typeof o4.length === "number") return { next: function() { - if (o3 && i3 >= o3.length) - o3 = void 0; - return { value: o3 && o3[i3++], done: !o3 }; + if (o4 && i4 >= o4.length) + o4 = void 0; + return { value: o4 && o4[i4++], done: !o4 }; } }; throw new TypeError(s2 ? "Object is not iterable." : "Symbol.iterator is not defined."); }; - __read2 = function(o3, n2) { - var m5 = typeof Symbol === "function" && o3[Symbol.iterator]; + __read2 = function(o4, n3) { + var m5 = typeof Symbol === "function" && o4[Symbol.iterator]; if (!m5) - return o3; - var i3 = m5.call(o3), r3, ar2 = [], e3; + return o4; + var i4 = m5.call(o4), r3, ar2 = [], e3; try { - while ((n2 === void 0 || n2-- > 0) && !(r3 = i3.next()).done) + while ((n3 === void 0 || n3-- > 0) && !(r3 = i4.next()).done) ar2.push(r3.value); } catch (error) { e3 = { error }; } finally { try { - if (r3 && !r3.done && (m5 = i3["return"])) - m5.call(i3); + if (r3 && !r3.done && (m5 = i4["return"])) + m5.call(i4); } finally { if (e3) throw e3.error; @@ -23215,25 +22883,25 @@ var require_tslib = __commonJS({ return ar2; }; __spread2 = function() { - for (var ar2 = [], i3 = 0; i3 < arguments.length; i3++) - ar2 = ar2.concat(__read2(arguments[i3])); + for (var ar2 = [], i4 = 0; i4 < arguments.length; i4++) + ar2 = ar2.concat(__read2(arguments[i4])); return ar2; }; __spreadArrays2 = function() { - for (var s2 = 0, i3 = 0, il = arguments.length; i3 < il; i3++) - s2 += arguments[i3].length; - for (var r3 = Array(s2), k7 = 0, i3 = 0; i3 < il; i3++) - for (var a4 = arguments[i3], j4 = 0, jl = a4.length; j4 < jl; j4++, k7++) - r3[k7] = a4[j4]; + for (var s2 = 0, i4 = 0, il = arguments.length; i4 < il; i4++) + s2 += arguments[i4].length; + for (var r3 = Array(s2), k7 = 0, i4 = 0; i4 < il; i4++) + for (var a5 = arguments[i4], j4 = 0, jl = a5.length; j4 < jl; j4++, k7++) + r3[k7] = a5[j4]; return r3; }; __spreadArray2 = function(to, from, pack) { if (pack || arguments.length === 2) - for (var i3 = 0, l3 = from.length, ar2; i3 < l3; i3++) { - if (ar2 || !(i3 in from)) { + for (var i4 = 0, l3 = from.length, ar2; i4 < l3; i4++) { + if (ar2 || !(i4 in from)) { if (!ar2) - ar2 = Array.prototype.slice.call(from, 0, i3); - ar2[i3] = from[i3]; + ar2 = Array.prototype.slice.call(from, 0, i4); + ar2[i4] = from[i4]; } } return to.concat(ar2 || Array.prototype.slice.call(from)); @@ -23244,21 +22912,21 @@ var require_tslib = __commonJS({ __asyncGenerator3 = function(thisArg, _arguments, generator) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g4 = generator.apply(thisArg, _arguments || []), i3, q6 = []; - return i3 = {}, verb("next"), verb("throw"), verb("return"), i3[Symbol.asyncIterator] = function() { + var g4 = generator.apply(thisArg, _arguments || []), i4, q6 = []; + return i4 = {}, verb("next"), verb("throw"), verb("return"), i4[Symbol.asyncIterator] = function() { return this; - }, i3; - function verb(n2) { - if (g4[n2]) - i3[n2] = function(v5) { - return new Promise(function(a4, b7) { - q6.push([n2, v5, a4, b7]) > 1 || resume(n2, v5); + }, i4; + function verb(n3) { + if (g4[n3]) + i4[n3] = function(v5) { + return new Promise(function(a5, b7) { + q6.push([n3, v5, a5, b7]) > 1 || resume(n3, v5); }); }; } - function resume(n2, v5) { + function resume(n3, v5) { try { - step(g4[n2](v5)); + step(g4[n3](v5)); } catch (e3) { settle2(q6[0][3], e3); } @@ -23277,30 +22945,30 @@ var require_tslib = __commonJS({ resume(q6[0][0], q6[0][1]); } }; - __asyncDelegator2 = function(o3) { - var i3, p4; - return i3 = {}, verb("next"), verb("throw", function(e3) { + __asyncDelegator2 = function(o4) { + var i4, p4; + return i4 = {}, verb("next"), verb("throw", function(e3) { throw e3; - }), verb("return"), i3[Symbol.iterator] = function() { + }), verb("return"), i4[Symbol.iterator] = function() { return this; - }, i3; - function verb(n2, f4) { - i3[n2] = o3[n2] ? function(v5) { - return (p4 = !p4) ? { value: __await3(o3[n2](v5)), done: false } : f4 ? f4(v5) : v5; + }, i4; + function verb(n3, f4) { + i4[n3] = o4[n3] ? function(v5) { + return (p4 = !p4) ? { value: __await3(o4[n3](v5)), done: false } : f4 ? f4(v5) : v5; } : f4; } }; - __asyncValues2 = function(o3) { + __asyncValues2 = function(o4) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m5 = o3[Symbol.asyncIterator], i3; - return m5 ? m5.call(o3) : (o3 = typeof __values2 === "function" ? __values2(o3) : o3[Symbol.iterator](), i3 = {}, verb("next"), verb("throw"), verb("return"), i3[Symbol.asyncIterator] = function() { + var m5 = o4[Symbol.asyncIterator], i4; + return m5 ? m5.call(o4) : (o4 = typeof __values2 === "function" ? __values2(o4) : o4[Symbol.iterator](), i4 = {}, verb("next"), verb("throw"), verb("return"), i4[Symbol.asyncIterator] = function() { return this; - }, i3); - function verb(n2) { - i3[n2] = o3[n2] && function(v5) { + }, i4); + function verb(n3) { + i4[n3] = o4[n3] && function(v5) { return new Promise(function(resolve, reject) { - v5 = o3[n2](v5), settle2(resolve, reject, v5.done, v5.value); + v5 = o4[n3](v5), settle2(resolve, reject, v5.done, v5.value); }); }; } @@ -23318,10 +22986,10 @@ var require_tslib = __commonJS({ } return cooked; }; - var __setModuleDefault = Object.create ? function(o3, v5) { - Object.defineProperty(o3, "default", { enumerable: true, value: v5 }); - } : function(o3, v5) { - o3["default"] = v5; + var __setModuleDefault = Object.create ? function(o4, v5) { + Object.defineProperty(o4, "default", { enumerable: true, value: v5 }); + } : function(o4, v5) { + o4["default"] = v5; }; __importStar2 = function(mod) { if (mod && mod.__esModule) @@ -23449,7 +23117,7 @@ var require_tslib = __commonJS({ var require_helpers = __commonJS({ "node_modules/agent-base/dist/helpers.js"(exports) { "use strict"; - var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o3, m5, k7, k22) { + var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o4, m5, k7, k22) { if (k22 === void 0) k22 = k7; var desc = Object.getOwnPropertyDescriptor(m5, k7); @@ -23458,16 +23126,16 @@ var require_helpers = __commonJS({ return m5[k7]; } }; } - Object.defineProperty(o3, k22, desc); - } : function(o3, m5, k7, k22) { + Object.defineProperty(o4, k22, desc); + } : function(o4, m5, k7, k22) { if (k22 === void 0) k22 = k7; - o3[k22] = m5[k7]; + o4[k22] = m5[k7]; }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o3, v5) { - Object.defineProperty(o3, "default", { enumerable: true, value: v5 }); - } : function(o3, v5) { - o3["default"] = v5; + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o4, v5) { + Object.defineProperty(o4, "default", { enumerable: true, value: v5 }); + } : function(o4, v5) { + o4["default"] = v5; }); var __importStar2 = exports && exports.__importStar || function(mod) { if (mod && mod.__esModule) @@ -23524,7 +23192,7 @@ var require_helpers = __commonJS({ var require_dist = __commonJS({ "node_modules/agent-base/dist/index.js"(exports) { "use strict"; - var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o3, m5, k7, k22) { + var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o4, m5, k7, k22) { if (k22 === void 0) k22 = k7; var desc = Object.getOwnPropertyDescriptor(m5, k7); @@ -23533,16 +23201,16 @@ var require_dist = __commonJS({ return m5[k7]; } }; } - Object.defineProperty(o3, k22, desc); - } : function(o3, m5, k7, k22) { + Object.defineProperty(o4, k22, desc); + } : function(o4, m5, k7, k22) { if (k22 === void 0) k22 = k7; - o3[k22] = m5[k7]; + o4[k22] = m5[k7]; }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o3, v5) { - Object.defineProperty(o3, "default", { enumerable: true, value: v5 }); - } : function(o3, v5) { - o3["default"] = v5; + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o4, v5) { + Object.defineProperty(o4, "default", { enumerable: true, value: v5 }); + } : function(o4, v5) { + o4["default"] = v5; }); var __importStar2 = exports && exports.__importStar || function(mod) { if (mod && mod.__esModule) @@ -23768,7 +23436,7 @@ var require_parse_proxy_response = __commonJS({ var require_dist2 = __commonJS({ "node_modules/https-proxy-agent/dist/index.js"(exports) { "use strict"; - var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o3, m5, k7, k22) { + var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o4, m5, k7, k22) { if (k22 === void 0) k22 = k7; var desc = Object.getOwnPropertyDescriptor(m5, k7); @@ -23777,16 +23445,16 @@ var require_dist2 = __commonJS({ return m5[k7]; } }; } - Object.defineProperty(o3, k22, desc); - } : function(o3, m5, k7, k22) { + Object.defineProperty(o4, k22, desc); + } : function(o4, m5, k7, k22) { if (k22 === void 0) k22 = k7; - o3[k22] = m5[k7]; + o4[k22] = m5[k7]; }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o3, v5) { - Object.defineProperty(o3, "default", { enumerable: true, value: v5 }); - } : function(o3, v5) { - o3["default"] = v5; + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o4, v5) { + Object.defineProperty(o4, "default", { enumerable: true, value: v5 }); + } : function(o4, v5) { + o4["default"] = v5; }); var __importStar2 = exports && exports.__importStar || function(mod) { if (mod && mod.__esModule) @@ -23915,7 +23583,7 @@ var require_dist2 = __commonJS({ var require_dist3 = __commonJS({ "node_modules/http-proxy-agent/dist/index.js"(exports) { "use strict"; - var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o3, m5, k7, k22) { + var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o4, m5, k7, k22) { if (k22 === void 0) k22 = k7; var desc = Object.getOwnPropertyDescriptor(m5, k7); @@ -23924,16 +23592,16 @@ var require_dist3 = __commonJS({ return m5[k7]; } }; } - Object.defineProperty(o3, k22, desc); - } : function(o3, m5, k7, k22) { + Object.defineProperty(o4, k22, desc); + } : function(o4, m5, k7, k22) { if (k22 === void 0) k22 = k7; - o3[k22] = m5[k7]; + o4[k22] = m5[k7]; }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o3, v5) { - Object.defineProperty(o3, "default", { enumerable: true, value: v5 }); - } : function(o3, v5) { - o3["default"] = v5; + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o4, v5) { + Object.defineProperty(o4, "default", { enumerable: true, value: v5 }); + } : function(o4, v5) { + o4["default"] = v5; }); var __importStar2 = exports && exports.__importStar || function(mod) { if (mod && mod.__esModule) @@ -24138,7 +23806,7 @@ var require_rules = __commonJS({ var require_lib3 = __commonJS({ "node_modules/@commitlint/types/lib/index.js"(exports) { "use strict"; - var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o3, m5, k7, k22) { + var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o4, m5, k7, k22) { if (k22 === void 0) k22 = k7; var desc = Object.getOwnPropertyDescriptor(m5, k7); @@ -24147,11 +23815,11 @@ var require_lib3 = __commonJS({ return m5[k7]; } }; } - Object.defineProperty(o3, k22, desc); - } : function(o3, m5, k7, k22) { + Object.defineProperty(o4, k22, desc); + } : function(o4, m5, k7, k22) { if (k22 === void 0) k22 = k7; - o3[k22] = m5[k7]; + o4[k22] = m5[k7]; }); var __exportStar2 = exports && exports.__exportStar || function(m5, exports2) { for (var p4 in m5) @@ -24318,17 +23986,17 @@ var require_ignore = __commonJS({ var throwError = (message, Ctor) => { throw new Ctor(message); }; - var checkPath = (path5, originalPath, doThrow) => { - if (!isString2(path5)) { + var checkPath = (path7, originalPath, doThrow) => { + if (!isString2(path7)) { return doThrow( `path must be a string, but got \`${originalPath}\``, TypeError ); } - if (!path5) { + if (!path7) { return doThrow(`path must not be empty`, TypeError); } - if (checkPath.isNotRelative(path5)) { + if (checkPath.isNotRelative(path7)) { const r3 = "`path.relative()`d"; return doThrow( `path should be a ${r3} string, but got "${originalPath}"`, @@ -24337,7 +24005,7 @@ var require_ignore = __commonJS({ } return true; }; - var isNotRelative = (path5) => REGEX_TEST_INVALID_PATH.test(path5); + var isNotRelative = (path7) => REGEX_TEST_INVALID_PATH.test(path7); checkPath.isNotRelative = isNotRelative; checkPath.convert = (p4) => p4; var Ignore2 = class { @@ -24381,7 +24049,7 @@ var require_ignore = __commonJS({ addPattern(pattern) { return this.add(pattern); } - _testOne(path5, checkUnignored) { + _testOne(path7, checkUnignored) { let ignored = false; let unignored = false; this._rules.forEach((rule) => { @@ -24389,7 +24057,7 @@ var require_ignore = __commonJS({ if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) { return; } - const matched = rule.regex.test(path5); + const matched = rule.regex.test(path7); if (matched) { ignored = !negative; unignored = negative; @@ -24401,24 +24069,24 @@ var require_ignore = __commonJS({ }; } _test(originalPath, cache, checkUnignored, slices) { - const path5 = originalPath && checkPath.convert(originalPath); + const path7 = originalPath && checkPath.convert(originalPath); checkPath( - path5, + path7, originalPath, this._allowRelativePaths ? RETURN_FALSE : throwError ); - return this._t(path5, cache, checkUnignored, slices); + return this._t(path7, cache, checkUnignored, slices); } - _t(path5, cache, checkUnignored, slices) { - if (path5 in cache) { - return cache[path5]; + _t(path7, cache, checkUnignored, slices) { + if (path7 in cache) { + return cache[path7]; } if (!slices) { - slices = path5.split(SLASH); + slices = path7.split(SLASH); } slices.pop(); if (!slices.length) { - return cache[path5] = this._testOne(path5, checkUnignored); + return cache[path7] = this._testOne(path7, checkUnignored); } const parent = this._t( slices.join(SLASH) + SLASH, @@ -24426,23 +24094,23 @@ var require_ignore = __commonJS({ checkUnignored, slices ); - return cache[path5] = parent.ignored ? parent : this._testOne(path5, checkUnignored); + return cache[path7] = parent.ignored ? parent : this._testOne(path7, checkUnignored); } - ignores(path5) { - return this._test(path5, this._ignoreCache, false).ignored; + ignores(path7) { + return this._test(path7, this._ignoreCache, false).ignored; } createFilter() { - return (path5) => !this.ignores(path5); + return (path7) => !this.ignores(path7); } filter(paths) { return makeArray(paths).filter(this.createFilter()); } - test(path5) { - return this._test(path5, this._testCache, true); + test(path7) { + return this._test(path7, this._testCache, true); } }; var factory = (options) => new Ignore2(options); - var isPathValid = (path5) => checkPath(path5 && checkPath.convert(path5), path5, RETURN_FALSE); + var isPathValid = (path7) => checkPath(path7 && checkPath.convert(path7), path7, RETURN_FALSE); factory.isPathValid = isPathValid; factory.default = factory; module2.exports = factory; @@ -24450,7 +24118,7 @@ var require_ignore = __commonJS({ const makePosix = (str2) => /^\\\\\?\\/.test(str2) || /["<>|\u0000-\u001F]+/u.test(str2) ? str2 : str2.replace(/\\/g, "/"); checkPath.convert = makePosix; const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i; - checkPath.isNotRelative = (path5) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path5) || isNotRelative(path5); + checkPath.isNotRelative = (path7) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path7) || isNotRelative(path7); } } }); @@ -24463,57 +24131,57 @@ var { stringify: h } = JSON; var O = /\B([A-Z])/g; var v = (t2) => t2.replace(O, "-$1").toLowerCase(); var { hasOwnProperty: D } = Object.prototype; -var w = (t2, n2) => D.call(t2, n2); +var w = (t2, n3) => D.call(t2, n3); var L = (t2) => Array.isArray(t2); var b = (t2) => typeof t2 == "function" ? [t2, false] : L(t2) ? [t2[0], true] : b(t2.type); -var d = (t2, n2) => t2 === Boolean ? n2 !== "false" : n2; -var m = (t2, n2) => typeof n2 == "boolean" ? n2 : t2 === Number && n2 === "" ? Number.NaN : t2(n2); +var d = (t2, n3) => t2 === Boolean ? n3 !== "false" : n3; +var m = (t2, n3) => typeof n3 == "boolean" ? n3 : t2 === Number && n3 === "" ? Number.NaN : t2(n3); var R = /[\s.:=]/; var B = (t2) => { - const n2 = `Flag name ${h(t2)}`; + const n3 = `Flag name ${h(t2)}`; if (t2.length === 0) - throw new Error(`${n2} cannot be empty`); + throw new Error(`${n3} cannot be empty`); if (t2.length === 1) - throw new Error(`${n2} must be longer than a character`); + throw new Error(`${n3} must be longer than a character`); const r3 = t2.match(R); if (r3) - throw new Error(`${n2} cannot contain ${h(r3?.[0])}`); + throw new Error(`${n3} cannot contain ${h(r3?.[0])}`); }; var K = (t2) => { - const n2 = {}, r3 = (e3, o3) => { - if (w(n2, e3)) + const n3 = {}, r3 = (e3, o4) => { + if (w(n3, e3)) throw new Error(`Duplicate flags named ${h(e3)}`); - n2[e3] = o3; + n3[e3] = o4; }; for (const e3 in t2) { if (!w(t2, e3)) continue; B(e3); - const o3 = t2[e3], s2 = [[], ...b(o3), o3]; + const o4 = t2[e3], s2 = [[], ...b(o4), o4]; r3(e3, s2); - const i3 = v(e3); - if (e3 !== i3 && r3(i3, s2), "alias" in o3 && typeof o3.alias == "string") { - const { alias: a4 } = o3, l3 = `Flag alias ${h(a4)} for flag ${h(e3)}`; - if (a4.length === 0) + const i4 = v(e3); + if (e3 !== i4 && r3(i4, s2), "alias" in o4 && typeof o4.alias == "string") { + const { alias: a5 } = o4, l3 = `Flag alias ${h(a5)} for flag ${h(e3)}`; + if (a5.length === 0) throw new Error(`${l3} cannot be empty`); - if (a4.length > 1) + if (a5.length > 1) throw new Error(`${l3} must be a single character`); - r3(a4, s2); + r3(a5, s2); } } - return n2; + return n3; }; -var _ = (t2, n2) => { +var _ = (t2, n3) => { const r3 = {}; for (const e3 in t2) { if (!w(t2, e3)) continue; - const [o3, , s2, i3] = n2[e3]; - if (o3.length === 0 && "default" in i3) { - let { default: a4 } = i3; - typeof a4 == "function" && (a4 = a4()), r3[e3] = a4; + const [o4, , s2, i4] = n3[e3]; + if (o4.length === 0 && "default" in i4) { + let { default: a5 } = i4; + typeof a5 == "function" && (a5 = a5()), r3[e3] = a5; } else - r3[e3] = s2 ? o3 : o3.pop(); + r3[e3] = s2 ? o4 : o4.pop(); } return r3; }; @@ -24523,77 +24191,77 @@ var T = /^-{1,2}\w/; var N = (t2) => { if (!T.test(t2)) return; - const n2 = !t2.startsWith(F); - let r3 = t2.slice(n2 ? 1 : 2), e3; - const o3 = r3.match(G); - if (o3) { - const { index: s2 } = o3; + const n3 = !t2.startsWith(F); + let r3 = t2.slice(n3 ? 1 : 2), e3; + const o4 = r3.match(G); + if (o4) { + const { index: s2 } = o4; e3 = r3.slice(s2 + 1), r3 = r3.slice(0, s2); } - return [r3, e3, n2]; + return [r3, e3, n3]; }; -var $ = (t2, { onFlag: n2, onArgument: r3 }) => { +var $ = (t2, { onFlag: n3, onArgument: r3 }) => { let e3; - const o3 = (s2, i3) => { + const o4 = (s2, i4) => { if (typeof e3 != "function") return true; - e3(s2, i3), e3 = void 0; + e3(s2, i4), e3 = void 0; }; for (let s2 = 0; s2 < t2.length; s2 += 1) { - const i3 = t2[s2]; - if (i3 === F) { - o3(); + const i4 = t2[s2]; + if (i4 === F) { + o4(); const l3 = t2.slice(s2 + 1); r3?.(l3, [s2], true); break; } - const a4 = N(i3); - if (a4) { - if (o3(), !n2) + const a5 = N(i4); + if (a5) { + if (o4(), !n3) continue; - const [l3, f4, g4] = a4; + const [l3, f4, g4] = a5; if (g4) - for (let c3 = 0; c3 < l3.length; c3 += 1) { - o3(); - const u3 = c3 === l3.length - 1; - e3 = n2(l3[c3], u3 ? f4 : void 0, [s2, c3 + 1, u3]); + for (let c5 = 0; c5 < l3.length; c5 += 1) { + o4(); + const u4 = c5 === l3.length - 1; + e3 = n3(l3[c5], u4 ? f4 : void 0, [s2, c5 + 1, u4]); } else - e3 = n2(l3, f4, [s2]); + e3 = n3(l3, f4, [s2]); } else - o3(i3, [s2]) && r3?.([i3], [s2]); + o4(i4, [s2]) && r3?.([i4], [s2]); } - o3(); + o4(); }; -var E = (t2, n2) => { - for (const [r3, e3, o3] of n2.reverse()) { +var E = (t2, n3) => { + for (const [r3, e3, o4] of n3.reverse()) { if (e3) { const s2 = t2[r3]; - let i3 = s2.slice(0, e3); - if (o3 || (i3 += s2.slice(e3 + 1)), i3 !== "-") { - t2[r3] = i3; + let i4 = s2.slice(0, e3); + if (o4 || (i4 += s2.slice(e3 + 1)), i4 !== "-") { + t2[r3] = i4; continue; } } t2.splice(r3, 1); } }; -var U = (t2, n2 = process.argv.slice(2), { ignore: r3 } = {}) => { - const e3 = [], o3 = K(t2), s2 = {}, i3 = []; - return i3[F] = [], $(n2, { onFlag(a4, l3, f4) { - const g4 = w(o3, a4); - if (!r3?.(g4 ? V : k, a4, l3)) { +var U = (t2, n3 = process.argv.slice(2), { ignore: r3 } = {}) => { + const e3 = [], o4 = K(t2), s2 = {}, i4 = []; + return i4[F] = [], $(n3, { onFlag(a5, l3, f4) { + const g4 = w(o4, a5); + if (!r3?.(g4 ? V : k, a5, l3)) { if (g4) { - const [c3, u3] = o3[a4], y6 = d(u3, l3), p4 = (P4, A5) => { - e3.push(f4), A5 && e3.push(A5), c3.push(m(u3, P4 || "")); + const [c5, u4] = o4[a5], y6 = d(u4, l3), p4 = (P4, A5) => { + e3.push(f4), A5 && e3.push(A5), c5.push(m(u4, P4 || "")); }; return y6 === void 0 ? p4 : p4(y6); } - w(s2, a4) || (s2[a4] = []), s2[a4].push(l3 === void 0 ? true : l3), e3.push(f4); + w(s2, a5) || (s2[a5] = []), s2[a5].push(l3 === void 0 ? true : l3), e3.push(f4); } - }, onArgument(a4, l3, f4) { - r3?.(C, n2[l3[0]]) || (i3.push(...a4), f4 ? (i3[F] = a4, n2.splice(l3[0])) : e3.push(l3)); - } }), E(n2, e3), { flags: _(t2, o3), unknownFlags: s2, _: i3 }; + }, onArgument(a5, l3, f4) { + r3?.(C, n3[l3[0]]) || (i4.push(...a5), f4 ? (i4[F] = a5, n3.splice(l3[0])) : e3.push(l3)); + } }), E(n3, e3), { flags: _(t2, o4), unknownFlags: s2, _: i4 }; }; // node_modules/cleye/dist/index.mjs @@ -24610,23 +24278,23 @@ var I = Object.getOwnPropertySymbols; var ED = Object.getPrototypeOf; var L2 = Object.prototype.hasOwnProperty; var eD = Object.prototype.propertyIsEnumerable; -var W = (D5, F5, u3) => F5 in D5 ? m2(D5, F5, { enumerable: true, configurable: true, writable: true, value: u3 }) : D5[F5] = u3; +var W = (D5, F5, u4) => F5 in D5 ? m2(D5, F5, { enumerable: true, configurable: true, writable: true, value: u4 }) : D5[F5] = u4; var p = (D5, F5) => { - for (var u3 in F5 || (F5 = {})) - L2.call(F5, u3) && W(D5, u3, F5[u3]); + for (var u4 in F5 || (F5 = {})) + L2.call(F5, u4) && W(D5, u4, F5[u4]); if (I) - for (var u3 of I(F5)) - eD.call(F5, u3) && W(D5, u3, F5[u3]); + for (var u4 of I(F5)) + eD.call(F5, u4) && W(D5, u4, F5[u4]); return D5; }; var c = (D5, F5) => uD(D5, CD(F5)); var nD = (D5) => m2(D5, "__esModule", { value: true }); var rD = (D5, F5) => () => (D5 && (F5 = D5(D5 = 0)), F5); var iD = (D5, F5) => () => (F5 || D5((F5 = { exports: {} }).exports, F5), F5.exports); -var oD = (D5, F5, u3, C5) => { +var oD = (D5, F5, u4, C5) => { if (F5 && typeof F5 == "object" || typeof F5 == "function") for (let t2 of tD(F5)) - !L2.call(D5, t2) && (u3 || t2 !== "default") && m2(D5, t2, { get: () => F5[t2], enumerable: !(C5 = FD(F5, t2)) || C5.enumerable }); + !L2.call(D5, t2) && (u4 || t2 !== "default") && m2(D5, t2, { get: () => F5[t2], enumerable: !(C5 = FD(F5, t2)) || C5.enumerable }); return D5; }; var BD = (D5, F5) => oD(nD(m2(D5 != null ? DD(ED(D5)) : {}, "default", !F5 && D5 && D5.__esModule ? { get: () => D5.default, enumerable: true } : { value: D5, enumerable: true })), D5); @@ -24643,8 +24311,8 @@ i(); i(); i(); var v2 = (D5) => { - var u3, C5, t2; - let F5 = (u3 = process.stdout.columns) != null ? u3 : Number.POSITIVE_INFINITY; + var u4, C5, t2; + let F5 = (u4 = process.stdout.columns) != null ? u4 : Number.POSITIVE_INFINITY; return typeof D5 == "function" && (D5 = D5(F5)), D5 || (D5 = {}), Array.isArray(D5) ? { columns: D5, stdoutColumns: F5 } : { columns: (C5 = D5.columns) != null ? C5 : [], stdoutColumns: (t2 = D5.stdoutColumns) != null ? t2 : F5 }; }; i(); @@ -24671,9 +24339,9 @@ function g(D5) { return 0; D5 = D5.replace((0, j.default)(), " "); let F5 = 0; - for (let u3 = 0; u3 < D5.length; u3++) { - let C5 = D5.codePointAt(u3); - C5 <= 31 || C5 >= 127 && C5 <= 159 || C5 >= 768 && C5 <= 879 || (C5 > 65535 && u3++, F5 += y(C5) ? 2 : 1); + for (let u4 = 0; u4 < D5.length; u4++) { + let C5 = D5.codePointAt(u4); + C5 <= 31 || C5 >= 127 && C5 <= 159 || C5 >= 768 && C5 <= 879 || (C5 > 65535 && u4++, F5 += y(C5) ? 2 : 1); } return F5; } @@ -24681,12 +24349,12 @@ var b2 = (D5) => Math.max(...D5.split(` `).map(g)); var k2 = (D5) => { let F5 = []; - for (let u3 of D5) { - let { length: C5 } = u3, t2 = C5 - F5.length; + for (let u4 of D5) { + let { length: C5 } = u4, t2 = C5 - F5.length; for (let E4 = 0; E4 < t2; E4 += 1) F5.push(0); for (let E4 = 0; E4 < C5; E4 += 1) { - let e3 = b2(u3[E4]); + let e3 = b2(u4[E4]); e3 > F5[E4] && (F5[E4] = e3); } } @@ -24697,69 +24365,69 @@ var _2 = /^\d+%$/; var z = { width: "auto", align: "left", contentWidth: 0, paddingLeft: 0, paddingRight: 0, paddingTop: 0, paddingBottom: 0, horizontalPadding: 0, paddingLeftString: "", paddingRightString: "" }; var sD = (D5, F5) => { var C5; - let u3 = []; + let u4 = []; for (let t2 = 0; t2 < D5.length; t2 += 1) { let E4 = (C5 = F5[t2]) != null ? C5 : "auto"; if (typeof E4 == "number" || E4 === "auto" || E4 === "content-width" || typeof E4 == "string" && _2.test(E4)) { - u3.push(c(p({}, z), { width: E4, contentWidth: D5[t2] })); + u4.push(c(p({}, z), { width: E4, contentWidth: D5[t2] })); continue; } if (E4 && typeof E4 == "object") { let e3 = c(p(p({}, z), E4), { contentWidth: D5[t2] }); - e3.horizontalPadding = e3.paddingLeft + e3.paddingRight, u3.push(e3); + e3.horizontalPadding = e3.paddingLeft + e3.paddingRight, u4.push(e3); continue; } throw new Error(`Invalid column width: ${JSON.stringify(E4)}`); } - return u3; + return u4; }; function aD(D5, F5) { - for (let u3 of D5) { - let { width: C5 } = u3; - if (C5 === "content-width" && (u3.width = u3.contentWidth), C5 === "auto") { - let n2 = Math.min(20, u3.contentWidth); - u3.width = n2, u3.autoOverflow = u3.contentWidth - n2; + for (let u4 of D5) { + let { width: C5 } = u4; + if (C5 === "content-width" && (u4.width = u4.contentWidth), C5 === "auto") { + let n3 = Math.min(20, u4.contentWidth); + u4.width = n3, u4.autoOverflow = u4.contentWidth - n3; } if (typeof C5 == "string" && _2.test(C5)) { - let n2 = Number.parseFloat(C5.slice(0, -1)) / 100; - u3.width = Math.floor(F5 * n2) - (u3.paddingLeft + u3.paddingRight); + let n3 = Number.parseFloat(C5.slice(0, -1)) / 100; + u4.width = Math.floor(F5 * n3) - (u4.paddingLeft + u4.paddingRight); } - let { horizontalPadding: t2 } = u3, E4 = 1, e3 = E4 + t2; + let { horizontalPadding: t2 } = u4, E4 = 1, e3 = E4 + t2; if (e3 >= F5) { - let n2 = e3 - F5, o3 = Math.ceil(u3.paddingLeft / t2 * n2), B3 = n2 - o3; - u3.paddingLeft -= o3, u3.paddingRight -= B3, u3.horizontalPadding = u3.paddingLeft + u3.paddingRight; + let n3 = e3 - F5, o4 = Math.ceil(u4.paddingLeft / t2 * n3), B3 = n3 - o4; + u4.paddingLeft -= o4, u4.paddingRight -= B3, u4.horizontalPadding = u4.paddingLeft + u4.paddingRight; } - u3.paddingLeftString = u3.paddingLeft ? " ".repeat(u3.paddingLeft) : "", u3.paddingRightString = u3.paddingRight ? " ".repeat(u3.paddingRight) : ""; - let r3 = F5 - u3.horizontalPadding; - u3.width = Math.max(Math.min(u3.width, r3), E4); + u4.paddingLeftString = u4.paddingLeft ? " ".repeat(u4.paddingLeft) : "", u4.paddingRightString = u4.paddingRight ? " ".repeat(u4.paddingRight) : ""; + let r3 = F5 - u4.horizontalPadding; + u4.width = Math.max(Math.min(u4.width, r3), E4); } } var G2 = () => Object.assign([], { columns: 0 }); function lD(D5, F5) { - let u3 = [G2()], [C5] = u3; + let u4 = [G2()], [C5] = u4; for (let t2 of D5) { let E4 = t2.width + t2.horizontalPadding; - C5.columns + E4 > F5 && (C5 = G2(), u3.push(C5)), C5.push(t2), C5.columns += E4; + C5.columns + E4 > F5 && (C5 = G2(), u4.push(C5)), C5.push(t2), C5.columns += E4; } - for (let t2 of u3) { + for (let t2 of u4) { let E4 = t2.reduce((s2, l3) => s2 + l3.width + l3.horizontalPadding, 0), e3 = F5 - E4; if (e3 === 0) continue; - let r3 = t2.filter((s2) => "autoOverflow" in s2), n2 = r3.filter((s2) => s2.autoOverflow > 0), o3 = n2.reduce((s2, l3) => s2 + l3.autoOverflow, 0), B3 = Math.min(o3, e3); - for (let s2 of n2) { - let l3 = Math.floor(s2.autoOverflow / o3 * B3); + let r3 = t2.filter((s2) => "autoOverflow" in s2), n3 = r3.filter((s2) => s2.autoOverflow > 0), o4 = n3.reduce((s2, l3) => s2 + l3.autoOverflow, 0), B3 = Math.min(o4, e3); + for (let s2 of n3) { + let l3 = Math.floor(s2.autoOverflow / o4 * B3); s2.width += l3, e3 -= l3; } - let a4 = Math.floor(e3 / r3.length); + let a5 = Math.floor(e3 / r3.length); for (let s2 = 0; s2 < r3.length; s2 += 1) { let l3 = r3[s2]; - s2 === r3.length - 1 ? l3.width += e3 : l3.width += a4, e3 -= a4; + s2 === r3.length - 1 ? l3.width += e3 : l3.width += a5, e3 -= a5; } } - return u3; + return u4; } -function Z(D5, F5, u3) { - let C5 = sD(u3, F5); +function Z(D5, F5, u4) { + let C5 = sD(u4, F5); return aD(C5, D5), lD(C5, D5); } i(); @@ -24768,42 +24436,42 @@ i(); var O2 = 10; var U2 = (D5 = 0) => (F5) => `\x1B[${F5 + D5}m`; var V2 = (D5 = 0) => (F5) => `\x1B[${38 + D5};5;${F5}m`; -var Y = (D5 = 0) => (F5, u3, C5) => `\x1B[${38 + D5};2;${F5};${u3};${C5}m`; +var Y = (D5 = 0) => (F5, u4, C5) => `\x1B[${38 + D5};2;${F5};${u4};${C5}m`; function AD() { let D5 = /* @__PURE__ */ new Map(), F5 = { modifier: { reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], overline: [53, 55], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29] }, color: { black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], blackBright: [90, 39], redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], blueBright: [94, 39], magentaBright: [95, 39], cyanBright: [96, 39], whiteBright: [97, 39] }, bgColor: { bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], bgBlackBright: [100, 49], bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49] } }; F5.color.gray = F5.color.blackBright, F5.bgColor.bgGray = F5.bgColor.bgBlackBright, F5.color.grey = F5.color.blackBright, F5.bgColor.bgGrey = F5.bgColor.bgBlackBright; - for (let [u3, C5] of Object.entries(F5)) { + for (let [u4, C5] of Object.entries(F5)) { for (let [t2, E4] of Object.entries(C5)) F5[t2] = { open: `\x1B[${E4[0]}m`, close: `\x1B[${E4[1]}m` }, C5[t2] = F5[t2], D5.set(E4[0], E4[1]); - Object.defineProperty(F5, u3, { value: C5, enumerable: false }); + Object.defineProperty(F5, u4, { value: C5, enumerable: false }); } - return Object.defineProperty(F5, "codes", { value: D5, enumerable: false }), F5.color.close = "\x1B[39m", F5.bgColor.close = "\x1B[49m", F5.color.ansi = U2(), F5.color.ansi256 = V2(), F5.color.ansi16m = Y(), F5.bgColor.ansi = U2(O2), F5.bgColor.ansi256 = V2(O2), F5.bgColor.ansi16m = Y(O2), Object.defineProperties(F5, { rgbToAnsi256: { value: (u3, C5, t2) => u3 === C5 && C5 === t2 ? u3 < 8 ? 16 : u3 > 248 ? 231 : Math.round((u3 - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u3 / 255 * 5) + 6 * Math.round(C5 / 255 * 5) + Math.round(t2 / 255 * 5), enumerable: false }, hexToRgb: { value: (u3) => { - let C5 = /(?[a-f\d]{6}|[a-f\d]{3})/i.exec(u3.toString(16)); + return Object.defineProperty(F5, "codes", { value: D5, enumerable: false }), F5.color.close = "\x1B[39m", F5.bgColor.close = "\x1B[49m", F5.color.ansi = U2(), F5.color.ansi256 = V2(), F5.color.ansi16m = Y(), F5.bgColor.ansi = U2(O2), F5.bgColor.ansi256 = V2(O2), F5.bgColor.ansi16m = Y(O2), Object.defineProperties(F5, { rgbToAnsi256: { value: (u4, C5, t2) => u4 === C5 && C5 === t2 ? u4 < 8 ? 16 : u4 > 248 ? 231 : Math.round((u4 - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u4 / 255 * 5) + 6 * Math.round(C5 / 255 * 5) + Math.round(t2 / 255 * 5), enumerable: false }, hexToRgb: { value: (u4) => { + let C5 = /(?[a-f\d]{6}|[a-f\d]{3})/i.exec(u4.toString(16)); if (!C5) return [0, 0, 0]; let { colorString: t2 } = C5.groups; t2.length === 3 && (t2 = t2.split("").map((e3) => e3 + e3).join("")); let E4 = Number.parseInt(t2, 16); return [E4 >> 16 & 255, E4 >> 8 & 255, E4 & 255]; - }, enumerable: false }, hexToAnsi256: { value: (u3) => F5.rgbToAnsi256(...F5.hexToRgb(u3)), enumerable: false }, ansi256ToAnsi: { value: (u3) => { - if (u3 < 8) - return 30 + u3; - if (u3 < 16) - return 90 + (u3 - 8); + }, enumerable: false }, hexToAnsi256: { value: (u4) => F5.rgbToAnsi256(...F5.hexToRgb(u4)), enumerable: false }, ansi256ToAnsi: { value: (u4) => { + if (u4 < 8) + return 30 + u4; + if (u4 < 16) + return 90 + (u4 - 8); let C5, t2, E4; - if (u3 >= 232) - C5 = ((u3 - 232) * 10 + 8) / 255, t2 = C5, E4 = C5; + if (u4 >= 232) + C5 = ((u4 - 232) * 10 + 8) / 255, t2 = C5, E4 = C5; else { - u3 -= 16; - let n2 = u3 % 36; - C5 = Math.floor(u3 / 36) / 5, t2 = Math.floor(n2 / 6) / 5, E4 = n2 % 6 / 5; + u4 -= 16; + let n3 = u4 % 36; + C5 = Math.floor(u4 / 36) / 5, t2 = Math.floor(n3 / 6) / 5, E4 = n3 % 6 / 5; } let e3 = Math.max(C5, t2, E4) * 2; if (e3 === 0) return 30; let r3 = 30 + (Math.round(E4) << 2 | Math.round(t2) << 1 | Math.round(C5)); return e3 === 2 && (r3 += 60), r3; - }, enumerable: false }, rgbToAnsi: { value: (u3, C5, t2) => F5.ansi256ToAnsi(F5.rgbToAnsi256(u3, C5, t2)), enumerable: false }, hexToAnsi: { value: (u3) => F5.ansi256ToAnsi(F5.hexToAnsi256(u3)), enumerable: false } }), F5; + }, enumerable: false }, rgbToAnsi: { value: (u4, C5, t2) => F5.ansi256ToAnsi(F5.rgbToAnsi256(u4, C5, t2)), enumerable: false }, hexToAnsi: { value: (u4) => F5.ansi256ToAnsi(F5.hexToAnsi256(u4)), enumerable: false } }), F5; } var fD = AD(); var K2 = fD; @@ -24817,114 +24485,114 @@ var M = `${pD}8;;`; var J = (D5) => `${x.values().next().value}${q}${D5}${H}`; var Q = (D5) => `${x.values().next().value}${M}${D5}${R2}`; var hD = (D5) => D5.split(" ").map((F5) => g(F5)); -var S = (D5, F5, u3) => { +var S = (D5, F5, u4) => { let C5 = [...F5], t2 = false, E4 = false, e3 = g(d2(D5[D5.length - 1])); - for (let [r3, n2] of C5.entries()) { - let o3 = g(n2); - if (e3 + o3 <= u3 ? D5[D5.length - 1] += n2 : (D5.push(n2), e3 = 0), x.has(n2) && (t2 = true, E4 = C5.slice(r3 + 1).join("").startsWith(M)), t2) { - E4 ? n2 === R2 && (t2 = false, E4 = false) : n2 === H && (t2 = false); + for (let [r3, n3] of C5.entries()) { + let o4 = g(n3); + if (e3 + o4 <= u4 ? D5[D5.length - 1] += n3 : (D5.push(n3), e3 = 0), x.has(n3) && (t2 = true, E4 = C5.slice(r3 + 1).join("").startsWith(M)), t2) { + E4 ? n3 === R2 && (t2 = false, E4 = false) : n3 === H && (t2 = false); continue; } - e3 += o3, e3 === u3 && r3 < C5.length - 1 && (D5.push(""), e3 = 0); + e3 += o4, e3 === u4 && r3 < C5.length - 1 && (D5.push(""), e3 = 0); } !e3 && D5[D5.length - 1].length > 0 && D5.length > 1 && (D5[D5.length - 2] += D5.pop()); }; var cD = (D5) => { - let F5 = D5.split(" "), u3 = F5.length; - for (; u3 > 0 && !(g(F5[u3 - 1]) > 0); ) - u3--; - return u3 === F5.length ? D5 : F5.slice(0, u3).join(" ") + F5.slice(u3).join(""); + let F5 = D5.split(" "), u4 = F5.length; + for (; u4 > 0 && !(g(F5[u4 - 1]) > 0); ) + u4--; + return u4 === F5.length ? D5 : F5.slice(0, u4).join(" ") + F5.slice(u4).join(""); }; -var dD = (D5, F5, u3 = {}) => { - if (u3.trim !== false && D5.trim() === "") +var dD = (D5, F5, u4 = {}) => { + if (u4.trim !== false && D5.trim() === "") return ""; let C5 = "", t2, E4, e3 = hD(D5), r3 = [""]; - for (let [o3, B3] of D5.split(" ").entries()) { - u3.trim !== false && (r3[r3.length - 1] = r3[r3.length - 1].trimStart()); - let a4 = g(r3[r3.length - 1]); - if (o3 !== 0 && (a4 >= F5 && (u3.wordWrap === false || u3.trim === false) && (r3.push(""), a4 = 0), (a4 > 0 || u3.trim === false) && (r3[r3.length - 1] += " ", a4++)), u3.hard && e3[o3] > F5) { - let s2 = F5 - a4, l3 = 1 + Math.floor((e3[o3] - s2 - 1) / F5); - Math.floor((e3[o3] - 1) / F5) < l3 && r3.push(""), S(r3, B3, F5); + for (let [o4, B3] of D5.split(" ").entries()) { + u4.trim !== false && (r3[r3.length - 1] = r3[r3.length - 1].trimStart()); + let a5 = g(r3[r3.length - 1]); + if (o4 !== 0 && (a5 >= F5 && (u4.wordWrap === false || u4.trim === false) && (r3.push(""), a5 = 0), (a5 > 0 || u4.trim === false) && (r3[r3.length - 1] += " ", a5++)), u4.hard && e3[o4] > F5) { + let s2 = F5 - a5, l3 = 1 + Math.floor((e3[o4] - s2 - 1) / F5); + Math.floor((e3[o4] - 1) / F5) < l3 && r3.push(""), S(r3, B3, F5); continue; } - if (a4 + e3[o3] > F5 && a4 > 0 && e3[o3] > 0) { - if (u3.wordWrap === false && a4 < F5) { + if (a5 + e3[o4] > F5 && a5 > 0 && e3[o4] > 0) { + if (u4.wordWrap === false && a5 < F5) { S(r3, B3, F5); continue; } r3.push(""); } - if (a4 + e3[o3] > F5 && u3.wordWrap === false) { + if (a5 + e3[o4] > F5 && u4.wordWrap === false) { S(r3, B3, F5); continue; } r3[r3.length - 1] += B3; } - u3.trim !== false && (r3 = r3.map((o3) => cD(o3))); - let n2 = [...r3.join(` + u4.trim !== false && (r3 = r3.map((o4) => cD(o4))); + let n3 = [...r3.join(` `)]; - for (let [o3, B3] of n2.entries()) { + for (let [o4, B3] of n3.entries()) { if (C5 += B3, x.has(B3)) { - let { groups: s2 } = new RegExp(`(?:\\${q}(?\\d+)m|\\${M}(?.*)${R2})`).exec(n2.slice(o3).join("")) || { groups: {} }; + let { groups: s2 } = new RegExp(`(?:\\${q}(?\\d+)m|\\${M}(?.*)${R2})`).exec(n3.slice(o4).join("")) || { groups: {} }; if (s2.code !== void 0) { let l3 = Number.parseFloat(s2.code); t2 = l3 === gD ? void 0 : l3; } else s2.uri !== void 0 && (E4 = s2.uri.length === 0 ? void 0 : s2.uri); } - let a4 = K2.codes.get(Number(t2)); - n2[o3 + 1] === ` -` ? (E4 && (C5 += Q("")), t2 && a4 && (C5 += J(a4))) : B3 === ` -` && (t2 && a4 && (C5 += J(t2)), E4 && (C5 += Q(E4))); + let a5 = K2.codes.get(Number(t2)); + n3[o4 + 1] === ` +` ? (E4 && (C5 += Q("")), t2 && a5 && (C5 += J(a5))) : B3 === ` +` && (t2 && a5 && (C5 += J(t2)), E4 && (C5 += Q(E4))); } return C5; }; -function T2(D5, F5, u3) { +function T2(D5, F5, u4) { return String(D5).normalize().replace(/\r\n/g, ` `).split(` -`).map((C5) => dD(C5, F5, u3)).join(` +`).map((C5) => dD(C5, F5, u4)).join(` `); } var X = (D5) => Array.from({ length: D5 }).fill(""); function P(D5, F5) { - let u3 = [], C5 = 0; + let u4 = [], C5 = 0; for (let t2 of D5) { - let E4 = 0, e3 = t2.map((n2) => { - var a4; - let o3 = (a4 = F5[C5]) != null ? a4 : ""; - C5 += 1, n2.preprocess && (o3 = n2.preprocess(o3)), b2(o3) > n2.width && (o3 = T2(o3, n2.width, { hard: true })); - let B3 = o3.split(` + let E4 = 0, e3 = t2.map((n3) => { + var a5; + let o4 = (a5 = F5[C5]) != null ? a5 : ""; + C5 += 1, n3.preprocess && (o4 = n3.preprocess(o4)), b2(o4) > n3.width && (o4 = T2(o4, n3.width, { hard: true })); + let B3 = o4.split(` `); - if (n2.postprocess) { - let { postprocess: s2 } = n2; - B3 = B3.map((l3, h4) => s2.call(n2, l3, h4)); + if (n3.postprocess) { + let { postprocess: s2 } = n3; + B3 = B3.map((l3, h5) => s2.call(n3, l3, h5)); } - return n2.paddingTop && B3.unshift(...X(n2.paddingTop)), n2.paddingBottom && B3.push(...X(n2.paddingBottom)), B3.length > E4 && (E4 = B3.length), c(p({}, n2), { lines: B3 }); + return n3.paddingTop && B3.unshift(...X(n3.paddingTop)), n3.paddingBottom && B3.push(...X(n3.paddingBottom)), B3.length > E4 && (E4 = B3.length), c(p({}, n3), { lines: B3 }); }), r3 = []; - for (let n2 = 0; n2 < E4; n2 += 1) { - let o3 = e3.map((B3) => { - var h4; - let a4 = (h4 = B3.lines[n2]) != null ? h4 : "", s2 = Number.isFinite(B3.width) ? " ".repeat(B3.width - g(a4)) : "", l3 = B3.paddingLeftString; - return B3.align === "right" && (l3 += s2), l3 += a4, B3.align === "left" && (l3 += s2), l3 + B3.paddingRightString; + for (let n3 = 0; n3 < E4; n3 += 1) { + let o4 = e3.map((B3) => { + var h5; + let a5 = (h5 = B3.lines[n3]) != null ? h5 : "", s2 = Number.isFinite(B3.width) ? " ".repeat(B3.width - g(a5)) : "", l3 = B3.paddingLeftString; + return B3.align === "right" && (l3 += s2), l3 += a5, B3.align === "left" && (l3 += s2), l3 + B3.paddingRightString; }).join(""); - r3.push(o3); + r3.push(o4); } - u3.push(r3.join(` + u4.push(r3.join(` `)); } - return u3.join(` + return u4.join(` `); } function mD(D5, F5) { if (!D5 || D5.length === 0) return ""; - let u3 = k2(D5), C5 = u3.length; + let u4 = k2(D5), C5 = u4.length; if (C5 === 0) return ""; let { stdoutColumns: t2, columns: E4 } = v2(F5); if (E4.length > C5) throw new Error(`${E4.length} columns defined, but only ${C5} columns found`); - let e3 = Z(t2, E4, u3); + let e3 = Z(t2, E4, u4); return D5.map((r3) => P(e3, r3)).join(` `); } @@ -24935,18 +24603,18 @@ function xD(D5) { throw new TypeError(`Invalid breakpoint operator: ${D5}`); } function wD(D5) { - let F5 = Object.keys(D5).map((u3) => { - let [C5, t2] = u3.split(" "); + let F5 = Object.keys(D5).map((u4) => { + let [C5, t2] = u4.split(" "); xD(C5); let E4 = Number.parseInt(t2, 10); if (Number.isNaN(E4)) throw new TypeError(`Invalid breakpoint value: ${t2}`); - let e3 = D5[u3]; + let e3 = D5[u4]; return { operator: C5, breakpoint: E4, value: e3 }; - }).sort((u3, C5) => C5.breakpoint - u3.breakpoint); - return (u3) => { + }).sort((u4, C5) => C5.breakpoint - u4.breakpoint); + return (u4) => { var C5; - return (C5 = F5.find(({ operator: t2, breakpoint: E4 }) => t2 === "=" && u3 === E4 || t2 === ">" && u3 > E4 || t2 === "<" && u3 < E4 || t2 === ">=" && u3 >= E4 || t2 === "<=" && u3 <= E4)) == null ? void 0 : C5.value; + return (C5 = F5.find(({ operator: t2, breakpoint: E4 }) => t2 === "=" && u4 === E4 || t2 === ">" && u4 > E4 || t2 === "<" && u4 < E4 || t2 === ">=" && u4 >= E4 || t2 === "<=" && u4 <= E4)) == null ? void 0 : C5.value; }; } @@ -24956,10 +24624,10 @@ var q2 = (t2) => t2.replace(/\B([A-Z])/g, "-$1").toLowerCase(); var I2 = { "> 80": [{ width: "content-width", paddingLeft: 2, paddingRight: 8 }, { width: "auto" }], "> 40": [{ width: "auto", paddingLeft: 2, paddingRight: 8, preprocess: (t2) => t2.trim() }, { width: "100%", paddingLeft: 2, paddingBottom: 1 }], "> 0": { stdoutColumns: 1e3, columns: [{ width: "content-width", paddingLeft: 2, paddingRight: 8 }, { width: "content-width" }] } }; function D2(t2) { let e3 = false; - return { type: "table", data: { tableData: Object.keys(t2).sort((a4, i3) => a4.localeCompare(i3)).map((a4) => { - const i3 = t2[a4], s2 = "alias" in i3; - return s2 && (e3 = true), { name: a4, flag: i3, flagFormatted: `--${q2(a4)}`, aliasesEnabled: e3, aliasFormatted: s2 ? `-${i3.alias}` : void 0 }; - }).map((a4) => (a4.aliasesEnabled = e3, [{ type: "flagName", data: a4 }, { type: "flagDescription", data: a4 }])), tableBreakpoints: I2 } }; + return { type: "table", data: { tableData: Object.keys(t2).sort((a5, i4) => a5.localeCompare(i4)).map((a5) => { + const i4 = t2[a5], s2 = "alias" in i4; + return s2 && (e3 = true), { name: a5, flag: i4, flagFormatted: `--${q2(a5)}`, aliasesEnabled: e3, aliasFormatted: s2 ? `-${i4.alias}` : void 0 }; + }).map((a5) => (a5.aliasesEnabled = e3, [{ type: "flagName", data: a5 }, { type: "flagDescription", data: a5 }])), tableBreakpoints: I2 } }; } var A = (t2) => !t2 || (t2.version ?? (t2.help ? t2.help.version : void 0)); var C2 = (t2) => { @@ -24986,18 +24654,18 @@ function T3(t2) { return e3.usage ? { id: "usage", type: "section", data: { title: "Usage:", body: Array.isArray(e3.usage) ? e3.usage.join(` `) : e3.usage } } : void 0; if (t2.name) { - const r3 = [], n2 = [C2(t2)]; - if (t2.flags && Object.keys(t2.flags).length > 0 && n2.push("[flags...]"), t2.parameters && t2.parameters.length > 0) { - const { parameters: a4 } = t2, i3 = a4.indexOf("--"), s2 = i3 > -1 && a4.slice(i3 + 1).some((o3) => o3.startsWith("<")); - n2.push(a4.map((o3) => o3 !== "--" ? o3 : s2 ? "--" : "[--]").join(" ")); + const r3 = [], n3 = [C2(t2)]; + if (t2.flags && Object.keys(t2.flags).length > 0 && n3.push("[flags...]"), t2.parameters && t2.parameters.length > 0) { + const { parameters: a5 } = t2, i4 = a5.indexOf("--"), s2 = i4 > -1 && a5.slice(i4 + 1).some((o4) => o4.startsWith("<")); + n3.push(a5.map((o4) => o4 !== "--" ? o4 : s2 ? "--" : "[--]").join(" ")); } - if (n2.length > 1 && r3.push(n2.join(" ")), "commands" in t2 && t2.commands?.length && r3.push(`${t2.name} `), r3.length > 0) + if (n3.length > 1 && r3.push(n3.join(" ")), "commands" in t2 && t2.commands?.length && r3.push(`${t2.name} `), r3.length > 0) return { id: "usage", type: "section", data: { title: "Usage:", body: r3.join(` `) } }; } } function _3(t2) { - return !("commands" in t2) || !t2.commands?.length ? void 0 : { id: "commands", type: "section", data: { title: "Commands:", body: { type: "table", data: { tableData: t2.commands.map((n2) => [n2.options.name, n2.options.help ? n2.options.help.description : ""]), tableOptions: [{ width: "content-width", paddingLeft: 2, paddingRight: 8 }] } }, indentBody: 0 } }; + return !("commands" in t2) || !t2.commands?.length ? void 0 : { id: "commands", type: "section", data: { title: "Commands:", body: { type: "table", data: { tableData: t2.commands.map((n3) => [n3.options.name, n3.options.help ? n3.options.help.description : ""]), tableOptions: [{ width: "content-width", paddingLeft: 2, paddingRight: 8 }] } }, indentBody: 0 } }; } function k3(t2) { if (!(!t2.flags || Object.keys(t2.flags).length === 0)) @@ -25033,13 +24701,13 @@ var M2 = class { heading(e3) { return this.bold(e3); } - section({ title: e3, body: r3, indentBody: n2 = 2 }) { + section({ title: e3, body: r3, indentBody: n3 = 2 }) { return `${(e3 ? `${this.heading(e3)} -` : "") + (r3 ? this.indentText({ text: this.render(r3), spaces: n2 }) : "")} +` : "") + (r3 ? this.indentText({ text: this.render(r3), spaces: n3 }) : "")} `; } - table({ tableData: e3, tableOptions: r3, tableBreakpoints: n2 }) { - return mD(e3.map((a4) => a4.map((i3) => this.render(i3))), n2 ? wD(n2) : r3); + table({ tableData: e3, tableOptions: r3, tableBreakpoints: n3 }) { + return mD(e3.map((a5) => a5.map((i4) => this.render(i4))), n3 ? wD(n3) : r3); } flagParameter(e3) { return e3 === Boolean ? "" : e3 === String ? "" : e3 === Number ? "" : Array.isArray(e3) ? this.flagParameter(e3[0]) : ""; @@ -25048,13 +24716,13 @@ var M2 = class { return " "; } flagName(e3) { - const { flag: r3, flagFormatted: n2, aliasesEnabled: a4, aliasFormatted: i3 } = e3; + const { flag: r3, flagFormatted: n3, aliasesEnabled: a5, aliasFormatted: i4 } = e3; let s2 = ""; - if (i3 ? s2 += `${i3}, ` : a4 && (s2 += " "), s2 += n2, "placeholder" in r3 && typeof r3.placeholder == "string") + if (i4 ? s2 += `${i4}, ` : a5 && (s2 += " "), s2 += n3, "placeholder" in r3 && typeof r3.placeholder == "string") s2 += `${this.flagOperator(e3)}${r3.placeholder}`; else { - const o3 = this.flagParameter("type" in r3 ? r3.type : r3); - o3 && (s2 += `${this.flagOperator(e3)}${o3}`); + const o4 = this.flagParameter("type" in r3 ? r3.type : r3); + o4 && (s2 += `${this.flagOperator(e3)}${o4}`); } return s2; } @@ -25064,8 +24732,8 @@ var M2 = class { flagDescription({ flag: e3 }) { let r3 = "description" in e3 ? e3.description ?? "" : ""; if ("default" in e3) { - let { default: n2 } = e3; - typeof n2 == "function" && (n2 = n2()), n2 && (r3 += ` (default: ${this.flagDefault(n2)})`); + let { default: n3 } = e3; + typeof n3 == "function" && (n3 = n3()), n3 && (r3 += ` (default: ${this.flagDefault(n3)})`); } return r3; } @@ -25088,80 +24756,80 @@ var { stringify: d3 } = JSON; var V3 = /[|\\{}()[\]^$+*?.]/; function w3(t2) { const e3 = []; - let r3, n2; - for (const a4 of t2) { - if (n2) - throw new Error(`Invalid parameter: Spread parameter ${d3(n2)} must be last`); - const i3 = a4[0], s2 = a4[a4.length - 1]; - let o3; - if (i3 === "<" && s2 === ">" && (o3 = true, r3)) - throw new Error(`Invalid parameter: Required parameter ${d3(a4)} cannot come after optional parameter ${d3(r3)}`); - if (i3 === "[" && s2 === "]" && (o3 = false, r3 = a4), o3 === void 0) - throw new Error(`Invalid parameter: ${d3(a4)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`); - let l3 = a4.slice(1, -1); + let r3, n3; + for (const a5 of t2) { + if (n3) + throw new Error(`Invalid parameter: Spread parameter ${d3(n3)} must be last`); + const i4 = a5[0], s2 = a5[a5.length - 1]; + let o4; + if (i4 === "<" && s2 === ">" && (o4 = true, r3)) + throw new Error(`Invalid parameter: Required parameter ${d3(a5)} cannot come after optional parameter ${d3(r3)}`); + if (i4 === "[" && s2 === "]" && (o4 = false, r3 = a5), o4 === void 0) + throw new Error(`Invalid parameter: ${d3(a5)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`); + let l3 = a5.slice(1, -1); const f4 = l3.slice(-3) === "..."; - f4 && (n2 = a4, l3 = l3.slice(0, -3)); + f4 && (n3 = a5, l3 = l3.slice(0, -3)); const p4 = l3.match(V3); if (p4) - throw new Error(`Invalid parameter: ${d3(a4)}. Invalid character found ${d3(p4[0])}`); - e3.push({ name: l3, required: o3, spread: f4 }); + throw new Error(`Invalid parameter: ${d3(a5)}. Invalid character found ${d3(p4[0])}`); + e3.push({ name: l3, required: o4, spread: f4 }); } return e3; } -function b3(t2, e3, r3, n2) { - for (let a4 = 0; a4 < e3.length; a4 += 1) { - const { name: i3, required: s2, spread: o3 } = e3[a4], l3 = S2(i3); +function b3(t2, e3, r3, n3) { + for (let a5 = 0; a5 < e3.length; a5 += 1) { + const { name: i4, required: s2, spread: o4 } = e3[a5], l3 = S2(i4); if (l3 in t2) - throw new Error(`Invalid parameter: ${d3(i3)} is used more than once.`); - const f4 = o3 ? r3.slice(a4) : r3[a4]; - if (o3 && (a4 = e3.length), s2 && (!f4 || o3 && f4.length === 0)) - return console.error(`Error: Missing required parameter ${d3(i3)} -`), n2(), process.exit(1); + throw new Error(`Invalid parameter: ${d3(i4)} is used more than once.`); + const f4 = o4 ? r3.slice(a5) : r3[a5]; + if (o4 && (a5 = e3.length), s2 && (!f4 || o4 && f4.length === 0)) + return console.error(`Error: Missing required parameter ${d3(i4)} +`), n3(), process.exit(1); t2[l3] = f4; } } function W2(t2) { return t2 === void 0 || t2 !== false; } -function x2(t2, e3, r3, n2) { - const a4 = { ...e3.flags }, i3 = e3.version; - i3 && (a4.version = { type: Boolean, description: "Show version" }); - const { help: s2 } = e3, o3 = W2(s2); - o3 && !("help" in a4) && (a4.help = { type: Boolean, alias: "h", description: "Show help" }); - const l3 = U(a4, n2, { ignore: e3.ignoreArgv }), f4 = () => { +function x2(t2, e3, r3, n3) { + const a5 = { ...e3.flags }, i4 = e3.version; + i4 && (a5.version = { type: Boolean, description: "Show version" }); + const { help: s2 } = e3, o4 = W2(s2); + o4 && !("help" in a5) && (a5.help = { type: Boolean, alias: "h", description: "Show help" }); + const l3 = U(a5, n3, { ignore: e3.ignoreArgv }), f4 = () => { console.log(e3.version); }; - if (i3 && l3.flags.version === true) + if (i4 && l3.flags.version === true) return f4(), process.exit(0); - const p4 = new M2(), O5 = o3 && s2?.render ? s2.render : (c3) => p4.render(c3), u3 = (c3) => { - const m5 = U3({ ...e3, ...c3 ? { help: c3 } : {}, flags: a4 }); + const p4 = new M2(), O5 = o4 && s2?.render ? s2.render : (c5) => p4.render(c5), u4 = (c5) => { + const m5 = U3({ ...e3, ...c5 ? { help: c5 } : {}, flags: a5 }); console.log(O5(m5, p4)); }; - if (o3 && l3.flags.help === true) - return u3(), process.exit(0); + if (o4 && l3.flags.help === true) + return u4(), process.exit(0); if (e3.parameters) { - let { parameters: c3 } = e3, m5 = l3._; - const g4 = c3.indexOf("--"), v5 = c3.slice(g4 + 1), h4 = /* @__PURE__ */ Object.create(null); + let { parameters: c5 } = e3, m5 = l3._; + const g4 = c5.indexOf("--"), v5 = c5.slice(g4 + 1), h5 = /* @__PURE__ */ Object.create(null); if (g4 > -1 && v5.length > 0) { - c3 = c3.slice(0, g4); + c5 = c5.slice(0, g4); const E4 = l3._["--"]; - m5 = m5.slice(0, -E4.length || void 0), b3(h4, w3(c3), m5, u3), b3(h4, w3(v5), E4, u3); + m5 = m5.slice(0, -E4.length || void 0), b3(h5, w3(c5), m5, u4), b3(h5, w3(v5), E4, u4); } else - b3(h4, w3(c3), m5, u3); - Object.assign(l3._, h4); + b3(h5, w3(c5), m5, u4); + Object.assign(l3._, h5); } - const $6 = { ...l3, showVersion: f4, showHelp: u3 }; + const $6 = { ...l3, showVersion: f4, showHelp: u4 }; return typeof r3 == "function" && r3($6), { command: t2, ...$6 }; } function z2(t2, e3) { const r3 = /* @__PURE__ */ new Map(); - for (const n2 of e3) { - const a4 = [n2.options.name], { alias: i3 } = n2.options; - i3 && (Array.isArray(i3) ? a4.push(...i3) : a4.push(i3)); - for (const s2 of a4) { + for (const n3 of e3) { + const a5 = [n3.options.name], { alias: i4 } = n3.options; + i4 && (Array.isArray(i4) ? a5.push(...i4) : a5.push(i4)); + for (const s2 of a5) { if (r3.has(s2)) throw new Error(`Duplicate command name found: ${d3(s2)}`); - r3.set(s2, n2); + r3.set(s2, n3); } } return r3.get(t2); @@ -25171,11 +24839,11 @@ function Z2(t2, e3, r3 = process.argv.slice(2)) { throw new Error("Options is required"); if ("name" in t2 && (!t2.name || !y2.test(t2.name))) throw new Error(`Invalid script name: ${d3(t2.name)}`); - const n2 = r3[0]; - if (t2.commands && y2.test(n2)) { - const a4 = z2(n2, t2.commands); - if (a4) - return x2(a4.options.name, { ...a4.options, parent: t2 }, a4.callback, r3.slice(1)); + const n3 = r3[0]; + if (t2.commands && y2.test(n3)) { + const a5 = z2(n3, t2.commands); + if (a5) + return x2(a5.options.name, { ...a5.options, parent: t2 }, a5.callback, r3.slice(1)); } return x2(void 0, t2, e3, r3); } @@ -25193,7 +24861,7 @@ function G3(t2, e3) { // package.json var package_default = { name: "opencommit", - version: "3.1.0", + version: "3.1.2", description: "Auto-generate impressive commits in 1 second. Killing lame commits with AI \u{1F92F}\u{1F52B}", keywords: [ "git", @@ -25301,8 +24969,8 @@ var f = __toESM(require("node:readline"), 1); var import_node_readline = __toESM(require("node:readline"), 1); var import_node_tty = require("node:tty"); function q3({ onlyFirst: t2 = false } = {}) { - const u3 = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|"); - return new RegExp(u3, t2 ? void 0 : "g"); + const u4 = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|"); + return new RegExp(u4, t2 ? void 0 : "g"); } function S3(t2) { if (typeof t2 != "string") @@ -25314,31 +24982,31 @@ function j2(t2) { } var M3 = { exports: {} }; (function(t2) { - var u3 = {}; - t2.exports = u3, u3.eastAsianWidth = function(e3) { + var u4 = {}; + t2.exports = u4, u4.eastAsianWidth = function(e3) { var s2 = e3.charCodeAt(0), C5 = e3.length == 2 ? e3.charCodeAt(1) : 0, D5 = s2; return 55296 <= s2 && s2 <= 56319 && 56320 <= C5 && C5 <= 57343 && (s2 &= 1023, C5 &= 1023, D5 = s2 << 10 | C5, D5 += 65536), D5 == 12288 || 65281 <= D5 && D5 <= 65376 || 65504 <= D5 && D5 <= 65510 ? "F" : D5 == 8361 || 65377 <= D5 && D5 <= 65470 || 65474 <= D5 && D5 <= 65479 || 65482 <= D5 && D5 <= 65487 || 65490 <= D5 && D5 <= 65495 || 65498 <= D5 && D5 <= 65500 || 65512 <= D5 && D5 <= 65518 ? "H" : 4352 <= D5 && D5 <= 4447 || 4515 <= D5 && D5 <= 4519 || 4602 <= D5 && D5 <= 4607 || 9001 <= D5 && D5 <= 9002 || 11904 <= D5 && D5 <= 11929 || 11931 <= D5 && D5 <= 12019 || 12032 <= D5 && D5 <= 12245 || 12272 <= D5 && D5 <= 12283 || 12289 <= D5 && D5 <= 12350 || 12353 <= D5 && D5 <= 12438 || 12441 <= D5 && D5 <= 12543 || 12549 <= D5 && D5 <= 12589 || 12593 <= D5 && D5 <= 12686 || 12688 <= D5 && D5 <= 12730 || 12736 <= D5 && D5 <= 12771 || 12784 <= D5 && D5 <= 12830 || 12832 <= D5 && D5 <= 12871 || 12880 <= D5 && D5 <= 13054 || 13056 <= D5 && D5 <= 19903 || 19968 <= D5 && D5 <= 42124 || 42128 <= D5 && D5 <= 42182 || 43360 <= D5 && D5 <= 43388 || 44032 <= D5 && D5 <= 55203 || 55216 <= D5 && D5 <= 55238 || 55243 <= D5 && D5 <= 55291 || 63744 <= D5 && D5 <= 64255 || 65040 <= D5 && D5 <= 65049 || 65072 <= D5 && D5 <= 65106 || 65108 <= D5 && D5 <= 65126 || 65128 <= D5 && D5 <= 65131 || 110592 <= D5 && D5 <= 110593 || 127488 <= D5 && D5 <= 127490 || 127504 <= D5 && D5 <= 127546 || 127552 <= D5 && D5 <= 127560 || 127568 <= D5 && D5 <= 127569 || 131072 <= D5 && D5 <= 194367 || 177984 <= D5 && D5 <= 196605 || 196608 <= D5 && D5 <= 262141 ? "W" : 32 <= D5 && D5 <= 126 || 162 <= D5 && D5 <= 163 || 165 <= D5 && D5 <= 166 || D5 == 172 || D5 == 175 || 10214 <= D5 && D5 <= 10221 || 10629 <= D5 && D5 <= 10630 ? "Na" : D5 == 161 || D5 == 164 || 167 <= D5 && D5 <= 168 || D5 == 170 || 173 <= D5 && D5 <= 174 || 176 <= D5 && D5 <= 180 || 182 <= D5 && D5 <= 186 || 188 <= D5 && D5 <= 191 || D5 == 198 || D5 == 208 || 215 <= D5 && D5 <= 216 || 222 <= D5 && D5 <= 225 || D5 == 230 || 232 <= D5 && D5 <= 234 || 236 <= D5 && D5 <= 237 || D5 == 240 || 242 <= D5 && D5 <= 243 || 247 <= D5 && D5 <= 250 || D5 == 252 || D5 == 254 || D5 == 257 || D5 == 273 || D5 == 275 || D5 == 283 || 294 <= D5 && D5 <= 295 || D5 == 299 || 305 <= D5 && D5 <= 307 || D5 == 312 || 319 <= D5 && D5 <= 322 || D5 == 324 || 328 <= D5 && D5 <= 331 || D5 == 333 || 338 <= D5 && D5 <= 339 || 358 <= D5 && D5 <= 359 || D5 == 363 || D5 == 462 || D5 == 464 || D5 == 466 || D5 == 468 || D5 == 470 || D5 == 472 || D5 == 474 || D5 == 476 || D5 == 593 || D5 == 609 || D5 == 708 || D5 == 711 || 713 <= D5 && D5 <= 715 || D5 == 717 || D5 == 720 || 728 <= D5 && D5 <= 731 || D5 == 733 || D5 == 735 || 768 <= D5 && D5 <= 879 || 913 <= D5 && D5 <= 929 || 931 <= D5 && D5 <= 937 || 945 <= D5 && D5 <= 961 || 963 <= D5 && D5 <= 969 || D5 == 1025 || 1040 <= D5 && D5 <= 1103 || D5 == 1105 || D5 == 8208 || 8211 <= D5 && D5 <= 8214 || 8216 <= D5 && D5 <= 8217 || 8220 <= D5 && D5 <= 8221 || 8224 <= D5 && D5 <= 8226 || 8228 <= D5 && D5 <= 8231 || D5 == 8240 || 8242 <= D5 && D5 <= 8243 || D5 == 8245 || D5 == 8251 || D5 == 8254 || D5 == 8308 || D5 == 8319 || 8321 <= D5 && D5 <= 8324 || D5 == 8364 || D5 == 8451 || D5 == 8453 || D5 == 8457 || D5 == 8467 || D5 == 8470 || 8481 <= D5 && D5 <= 8482 || D5 == 8486 || D5 == 8491 || 8531 <= D5 && D5 <= 8532 || 8539 <= D5 && D5 <= 8542 || 8544 <= D5 && D5 <= 8555 || 8560 <= D5 && D5 <= 8569 || D5 == 8585 || 8592 <= D5 && D5 <= 8601 || 8632 <= D5 && D5 <= 8633 || D5 == 8658 || D5 == 8660 || D5 == 8679 || D5 == 8704 || 8706 <= D5 && D5 <= 8707 || 8711 <= D5 && D5 <= 8712 || D5 == 8715 || D5 == 8719 || D5 == 8721 || D5 == 8725 || D5 == 8730 || 8733 <= D5 && D5 <= 8736 || D5 == 8739 || D5 == 8741 || 8743 <= D5 && D5 <= 8748 || D5 == 8750 || 8756 <= D5 && D5 <= 8759 || 8764 <= D5 && D5 <= 8765 || D5 == 8776 || D5 == 8780 || D5 == 8786 || 8800 <= D5 && D5 <= 8801 || 8804 <= D5 && D5 <= 8807 || 8810 <= D5 && D5 <= 8811 || 8814 <= D5 && D5 <= 8815 || 8834 <= D5 && D5 <= 8835 || 8838 <= D5 && D5 <= 8839 || D5 == 8853 || D5 == 8857 || D5 == 8869 || D5 == 8895 || D5 == 8978 || 9312 <= D5 && D5 <= 9449 || 9451 <= D5 && D5 <= 9547 || 9552 <= D5 && D5 <= 9587 || 9600 <= D5 && D5 <= 9615 || 9618 <= D5 && D5 <= 9621 || 9632 <= D5 && D5 <= 9633 || 9635 <= D5 && D5 <= 9641 || 9650 <= D5 && D5 <= 9651 || 9654 <= D5 && D5 <= 9655 || 9660 <= D5 && D5 <= 9661 || 9664 <= D5 && D5 <= 9665 || 9670 <= D5 && D5 <= 9672 || D5 == 9675 || 9678 <= D5 && D5 <= 9681 || 9698 <= D5 && D5 <= 9701 || D5 == 9711 || 9733 <= D5 && D5 <= 9734 || D5 == 9737 || 9742 <= D5 && D5 <= 9743 || 9748 <= D5 && D5 <= 9749 || D5 == 9756 || D5 == 9758 || D5 == 9792 || D5 == 9794 || 9824 <= D5 && D5 <= 9825 || 9827 <= D5 && D5 <= 9829 || 9831 <= D5 && D5 <= 9834 || 9836 <= D5 && D5 <= 9837 || D5 == 9839 || 9886 <= D5 && D5 <= 9887 || 9918 <= D5 && D5 <= 9919 || 9924 <= D5 && D5 <= 9933 || 9935 <= D5 && D5 <= 9953 || D5 == 9955 || 9960 <= D5 && D5 <= 9983 || D5 == 10045 || D5 == 10071 || 10102 <= D5 && D5 <= 10111 || 11093 <= D5 && D5 <= 11097 || 12872 <= D5 && D5 <= 12879 || 57344 <= D5 && D5 <= 63743 || 65024 <= D5 && D5 <= 65039 || D5 == 65533 || 127232 <= D5 && D5 <= 127242 || 127248 <= D5 && D5 <= 127277 || 127280 <= D5 && D5 <= 127337 || 127344 <= D5 && D5 <= 127386 || 917760 <= D5 && D5 <= 917999 || 983040 <= D5 && D5 <= 1048573 || 1048576 <= D5 && D5 <= 1114109 ? "A" : "N"; - }, u3.characterLength = function(e3) { + }, u4.characterLength = function(e3) { var s2 = this.eastAsianWidth(e3); return s2 == "F" || s2 == "W" || s2 == "A" ? 2 : 1; }; function F5(e3) { return e3.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || []; } - u3.length = function(e3) { + u4.length = function(e3) { for (var s2 = F5(e3), C5 = 0, D5 = 0; D5 < s2.length; D5++) C5 = C5 + this.characterLength(s2[D5]); return C5; - }, u3.slice = function(e3, s2, C5) { - textLen = u3.length(e3), s2 = s2 || 0, C5 = C5 || 1, s2 < 0 && (s2 = textLen + s2), C5 < 0 && (C5 = textLen + C5); - for (var D5 = "", i3 = 0, n2 = F5(e3), E4 = 0; E4 < n2.length; E4++) { - var h4 = n2[E4], o3 = u3.length(h4); - if (i3 >= s2 - (o3 == 2 ? 1 : 0)) - if (i3 + o3 <= C5) - D5 += h4; + }, u4.slice = function(e3, s2, C5) { + textLen = u4.length(e3), s2 = s2 || 0, C5 = C5 || 1, s2 < 0 && (s2 = textLen + s2), C5 < 0 && (C5 = textLen + C5); + for (var D5 = "", i4 = 0, n3 = F5(e3), E4 = 0; E4 < n3.length; E4++) { + var h5 = n3[E4], o4 = u4.length(h5); + if (i4 >= s2 - (o4 == 2 ? 1 : 0)) + if (i4 + o4 <= C5) + D5 += h5; else break; - i3 += o3; + i4 += o4; } return D5; }; @@ -25349,11 +25017,11 @@ var X2 = function() { return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g; }; var DD2 = j2(X2); -function A2(t2, u3 = {}) { - if (typeof t2 != "string" || t2.length === 0 || (u3 = { ambiguousIsNarrow: true, ...u3 }, t2 = S3(t2), t2.length === 0)) +function A2(t2, u4 = {}) { + if (typeof t2 != "string" || t2.length === 0 || (u4 = { ambiguousIsNarrow: true, ...u4 }, t2 = S3(t2), t2.length === 0)) return 0; t2 = t2.replace(DD2(), " "); - const F5 = u3.ambiguousIsNarrow ? 1 : 2; + const F5 = u4.ambiguousIsNarrow ? 1 : 2; let e3 = 0; for (const s2 of t2) { const C5 = s2.codePointAt(0); @@ -25374,9 +25042,9 @@ function A2(t2, u3 = {}) { return e3; } var m3 = 10; -var T4 = (t2 = 0) => (u3) => `\x1B[${u3 + t2}m`; -var P2 = (t2 = 0) => (u3) => `\x1B[${38 + t2};5;${u3}m`; -var W3 = (t2 = 0) => (u3, F5, e3) => `\x1B[${38 + t2};2;${u3};${F5};${e3}m`; +var T4 = (t2 = 0) => (u4) => `\x1B[${u4 + t2}m`; +var P2 = (t2 = 0) => (u4) => `\x1B[${38 + t2};5;${u4}m`; +var W3 = (t2 = 0) => (u4, F5, e3) => `\x1B[${38 + t2};2;${u4};${F5};${e3}m`; var r = { modifier: { reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], overline: [53, 55], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29] }, color: { black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], blackBright: [90, 39], gray: [90, 39], grey: [90, 39], redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], blueBright: [94, 39], magentaBright: [95, 39], cyanBright: [96, 39], whiteBright: [97, 39] }, bgColor: { bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], bgBlackBright: [100, 49], bgGray: [100, 49], bgGrey: [100, 49], bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49] } }; Object.keys(r.modifier); var uD2 = Object.keys(r.color); @@ -25384,38 +25052,38 @@ var FD2 = Object.keys(r.bgColor); [...uD2, ...FD2]; function tD2() { const t2 = /* @__PURE__ */ new Map(); - for (const [u3, F5] of Object.entries(r)) { + for (const [u4, F5] of Object.entries(r)) { for (const [e3, s2] of Object.entries(F5)) r[e3] = { open: `\x1B[${s2[0]}m`, close: `\x1B[${s2[1]}m` }, F5[e3] = r[e3], t2.set(s2[0], s2[1]); - Object.defineProperty(r, u3, { value: F5, enumerable: false }); + Object.defineProperty(r, u4, { value: F5, enumerable: false }); } - return Object.defineProperty(r, "codes", { value: t2, enumerable: false }), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi = T4(), r.color.ansi256 = P2(), r.color.ansi16m = W3(), r.bgColor.ansi = T4(m3), r.bgColor.ansi256 = P2(m3), r.bgColor.ansi16m = W3(m3), Object.defineProperties(r, { rgbToAnsi256: { value: (u3, F5, e3) => u3 === F5 && F5 === e3 ? u3 < 8 ? 16 : u3 > 248 ? 231 : Math.round((u3 - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u3 / 255 * 5) + 6 * Math.round(F5 / 255 * 5) + Math.round(e3 / 255 * 5), enumerable: false }, hexToRgb: { value: (u3) => { - const F5 = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u3.toString(16)); + return Object.defineProperty(r, "codes", { value: t2, enumerable: false }), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi = T4(), r.color.ansi256 = P2(), r.color.ansi16m = W3(), r.bgColor.ansi = T4(m3), r.bgColor.ansi256 = P2(m3), r.bgColor.ansi16m = W3(m3), Object.defineProperties(r, { rgbToAnsi256: { value: (u4, F5, e3) => u4 === F5 && F5 === e3 ? u4 < 8 ? 16 : u4 > 248 ? 231 : Math.round((u4 - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u4 / 255 * 5) + 6 * Math.round(F5 / 255 * 5) + Math.round(e3 / 255 * 5), enumerable: false }, hexToRgb: { value: (u4) => { + const F5 = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u4.toString(16)); if (!F5) return [0, 0, 0]; let [e3] = F5; e3.length === 3 && (e3 = [...e3].map((C5) => C5 + C5).join("")); const s2 = Number.parseInt(e3, 16); return [s2 >> 16 & 255, s2 >> 8 & 255, s2 & 255]; - }, enumerable: false }, hexToAnsi256: { value: (u3) => r.rgbToAnsi256(...r.hexToRgb(u3)), enumerable: false }, ansi256ToAnsi: { value: (u3) => { - if (u3 < 8) - return 30 + u3; - if (u3 < 16) - return 90 + (u3 - 8); + }, enumerable: false }, hexToAnsi256: { value: (u4) => r.rgbToAnsi256(...r.hexToRgb(u4)), enumerable: false }, ansi256ToAnsi: { value: (u4) => { + if (u4 < 8) + return 30 + u4; + if (u4 < 16) + return 90 + (u4 - 8); let F5, e3, s2; - if (u3 >= 232) - F5 = ((u3 - 232) * 10 + 8) / 255, e3 = F5, s2 = F5; + if (u4 >= 232) + F5 = ((u4 - 232) * 10 + 8) / 255, e3 = F5, s2 = F5; else { - u3 -= 16; - const i3 = u3 % 36; - F5 = Math.floor(u3 / 36) / 5, e3 = Math.floor(i3 / 6) / 5, s2 = i3 % 6 / 5; + u4 -= 16; + const i4 = u4 % 36; + F5 = Math.floor(u4 / 36) / 5, e3 = Math.floor(i4 / 6) / 5, s2 = i4 % 6 / 5; } const C5 = Math.max(F5, e3, s2) * 2; if (C5 === 0) return 30; let D5 = 30 + (Math.round(s2) << 2 | Math.round(e3) << 1 | Math.round(F5)); return C5 === 2 && (D5 += 60), D5; - }, enumerable: false }, rgbToAnsi: { value: (u3, F5, e3) => r.ansi256ToAnsi(r.rgbToAnsi256(u3, F5, e3)), enumerable: false }, hexToAnsi: { value: (u3) => r.ansi256ToAnsi(r.hexToAnsi256(u3)), enumerable: false } }), r; + }, enumerable: false }, rgbToAnsi: { value: (u4, F5, e3) => r.ansi256ToAnsi(r.rgbToAnsi256(u4, F5, e3)), enumerable: false }, hexToAnsi: { value: (u4) => r.ansi256ToAnsi(r.hexToAnsi256(u4)), enumerable: false } }), r; } var eD2 = tD2(); var g2 = /* @__PURE__ */ new Set(["\x1B", "\x9B"]); @@ -25427,87 +25095,87 @@ var I3 = "m"; var w4 = `${CD2}8;;`; var N3 = (t2) => `${g2.values().next().value}${O3}${t2}${I3}`; var L4 = (t2) => `${g2.values().next().value}${w4}${t2}${b4}`; -var iD2 = (t2) => t2.split(" ").map((u3) => A2(u3)); -var y3 = (t2, u3, F5) => { - const e3 = [...u3]; +var iD2 = (t2) => t2.split(" ").map((u4) => A2(u4)); +var y3 = (t2, u4, F5) => { + const e3 = [...u4]; let s2 = false, C5 = false, D5 = A2(S3(t2[t2.length - 1])); - for (const [i3, n2] of e3.entries()) { - const E4 = A2(n2); - if (D5 + E4 <= F5 ? t2[t2.length - 1] += n2 : (t2.push(n2), D5 = 0), g2.has(n2) && (s2 = true, C5 = e3.slice(i3 + 1).join("").startsWith(w4)), s2) { - C5 ? n2 === b4 && (s2 = false, C5 = false) : n2 === I3 && (s2 = false); + for (const [i4, n3] of e3.entries()) { + const E4 = A2(n3); + if (D5 + E4 <= F5 ? t2[t2.length - 1] += n3 : (t2.push(n3), D5 = 0), g2.has(n3) && (s2 = true, C5 = e3.slice(i4 + 1).join("").startsWith(w4)), s2) { + C5 ? n3 === b4 && (s2 = false, C5 = false) : n3 === I3 && (s2 = false); continue; } - D5 += E4, D5 === F5 && i3 < e3.length - 1 && (t2.push(""), D5 = 0); + D5 += E4, D5 === F5 && i4 < e3.length - 1 && (t2.push(""), D5 = 0); } !D5 && t2[t2.length - 1].length > 0 && t2.length > 1 && (t2[t2.length - 2] += t2.pop()); }; var rD2 = (t2) => { - const u3 = t2.split(" "); - let F5 = u3.length; - for (; F5 > 0 && !(A2(u3[F5 - 1]) > 0); ) + const u4 = t2.split(" "); + let F5 = u4.length; + for (; F5 > 0 && !(A2(u4[F5 - 1]) > 0); ) F5--; - return F5 === u3.length ? t2 : u3.slice(0, F5).join(" ") + u3.slice(F5).join(""); + return F5 === u4.length ? t2 : u4.slice(0, F5).join(" ") + u4.slice(F5).join(""); }; -var ED2 = (t2, u3, F5 = {}) => { +var ED2 = (t2, u4, F5 = {}) => { if (F5.trim !== false && t2.trim() === "") return ""; let e3 = "", s2, C5; const D5 = iD2(t2); - let i3 = [""]; - for (const [E4, h4] of t2.split(" ").entries()) { - F5.trim !== false && (i3[i3.length - 1] = i3[i3.length - 1].trimStart()); - let o3 = A2(i3[i3.length - 1]); - if (E4 !== 0 && (o3 >= u3 && (F5.wordWrap === false || F5.trim === false) && (i3.push(""), o3 = 0), (o3 > 0 || F5.trim === false) && (i3[i3.length - 1] += " ", o3++)), F5.hard && D5[E4] > u3) { - const B3 = u3 - o3, p4 = 1 + Math.floor((D5[E4] - B3 - 1) / u3); - Math.floor((D5[E4] - 1) / u3) < p4 && i3.push(""), y3(i3, h4, u3); + let i4 = [""]; + for (const [E4, h5] of t2.split(" ").entries()) { + F5.trim !== false && (i4[i4.length - 1] = i4[i4.length - 1].trimStart()); + let o4 = A2(i4[i4.length - 1]); + if (E4 !== 0 && (o4 >= u4 && (F5.wordWrap === false || F5.trim === false) && (i4.push(""), o4 = 0), (o4 > 0 || F5.trim === false) && (i4[i4.length - 1] += " ", o4++)), F5.hard && D5[E4] > u4) { + const B3 = u4 - o4, p4 = 1 + Math.floor((D5[E4] - B3 - 1) / u4); + Math.floor((D5[E4] - 1) / u4) < p4 && i4.push(""), y3(i4, h5, u4); continue; } - if (o3 + D5[E4] > u3 && o3 > 0 && D5[E4] > 0) { - if (F5.wordWrap === false && o3 < u3) { - y3(i3, h4, u3); + if (o4 + D5[E4] > u4 && o4 > 0 && D5[E4] > 0) { + if (F5.wordWrap === false && o4 < u4) { + y3(i4, h5, u4); continue; } - i3.push(""); + i4.push(""); } - if (o3 + D5[E4] > u3 && F5.wordWrap === false) { - y3(i3, h4, u3); + if (o4 + D5[E4] > u4 && F5.wordWrap === false) { + y3(i4, h5, u4); continue; } - i3[i3.length - 1] += h4; + i4[i4.length - 1] += h5; } - F5.trim !== false && (i3 = i3.map((E4) => rD2(E4))); - const n2 = [...i3.join(` + F5.trim !== false && (i4 = i4.map((E4) => rD2(E4))); + const n3 = [...i4.join(` `)]; - for (const [E4, h4] of n2.entries()) { - if (e3 += h4, g2.has(h4)) { - const { groups: B3 } = new RegExp(`(?:\\${O3}(?\\d+)m|\\${w4}(?.*)${b4})`).exec(n2.slice(E4).join("")) || { groups: {} }; + for (const [E4, h5] of n3.entries()) { + if (e3 += h5, g2.has(h5)) { + const { groups: B3 } = new RegExp(`(?:\\${O3}(?\\d+)m|\\${w4}(?.*)${b4})`).exec(n3.slice(E4).join("")) || { groups: {} }; if (B3.code !== void 0) { const p4 = Number.parseFloat(B3.code); s2 = p4 === sD2 ? void 0 : p4; } else B3.uri !== void 0 && (C5 = B3.uri.length === 0 ? void 0 : B3.uri); } - const o3 = eD2.codes.get(Number(s2)); - n2[E4 + 1] === ` -` ? (C5 && (e3 += L4("")), s2 && o3 && (e3 += N3(o3))) : h4 === ` -` && (s2 && o3 && (e3 += N3(s2)), C5 && (e3 += L4(C5))); + const o4 = eD2.codes.get(Number(s2)); + n3[E4 + 1] === ` +` ? (C5 && (e3 += L4("")), s2 && o4 && (e3 += N3(o4))) : h5 === ` +` && (s2 && o4 && (e3 += N3(s2)), C5 && (e3 += L4(C5))); } return e3; }; -function R4(t2, u3, F5) { +function R4(t2, u4, F5) { return String(t2).normalize().replace(/\r\n/g, ` `).split(` -`).map((e3) => ED2(e3, u3, F5)).join(` +`).map((e3) => ED2(e3, u4, F5)).join(` `); } var oD2 = Object.defineProperty; -var nD2 = (t2, u3, F5) => u3 in t2 ? oD2(t2, u3, { enumerable: true, configurable: true, writable: true, value: F5 }) : t2[u3] = F5; -var a = (t2, u3, F5) => (nD2(t2, typeof u3 != "symbol" ? u3 + "" : u3, F5), F5); -function aD2(t2, u3) { - if (t2 === u3) +var nD2 = (t2, u4, F5) => u4 in t2 ? oD2(t2, u4, { enumerable: true, configurable: true, writable: true, value: F5 }) : t2[u4] = F5; +var a = (t2, u4, F5) => (nD2(t2, typeof u4 != "symbol" ? u4 + "" : u4, F5), F5); +function aD2(t2, u4) { + if (t2 === u4) return; const F5 = t2.split(` -`), e3 = u3.split(` +`), e3 = u4.split(` `), s2 = []; for (let C5 = 0; C5 < Math.max(F5.length, e3.length); C5++) F5[C5] !== e3[C5] && s2.push(C5); @@ -25517,20 +25185,20 @@ var V4 = Symbol("clack:cancel"); function hD2(t2) { return t2 === V4; } -function v3(t2, u3) { - t2.isTTY && t2.setRawMode(u3); +function v3(t2, u4) { + t2.isTTY && t2.setRawMode(u4); } var z3 = /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"]]); var lD2 = /* @__PURE__ */ new Set(["up", "down", "left", "right", "space", "enter"]); var x3 = class { - constructor({ render: u3, input: F5 = import_node_process.stdin, output: e3 = import_node_process.stdout, ...s2 }, C5 = true) { - a(this, "input"), a(this, "output"), a(this, "rl"), a(this, "opts"), a(this, "_track", false), a(this, "_render"), a(this, "_cursor", 0), a(this, "state", "initial"), a(this, "value"), a(this, "error", ""), a(this, "subscribers", /* @__PURE__ */ new Map()), a(this, "_prevFrame", ""), this.opts = s2, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = u3.bind(this), this._track = C5, this.input = F5, this.output = e3; + constructor({ render: u4, input: F5 = import_node_process.stdin, output: e3 = import_node_process.stdout, ...s2 }, C5 = true) { + a(this, "input"), a(this, "output"), a(this, "rl"), a(this, "opts"), a(this, "_track", false), a(this, "_render"), a(this, "_cursor", 0), a(this, "state", "initial"), a(this, "value"), a(this, "error", ""), a(this, "subscribers", /* @__PURE__ */ new Map()), a(this, "_prevFrame", ""), this.opts = s2, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = u4.bind(this), this._track = C5, this.input = F5, this.output = e3; } prompt() { - const u3 = new import_node_tty.WriteStream(0); - return u3._write = (F5, e3, s2) => { + const u4 = new import_node_tty.WriteStream(0); + return u4._write = (F5, e3, s2) => { this._track && (this.value = this.rl.line.replace(/\t/g, ""), this._cursor = this.rl.cursor, this.emit("value", this.value)), s2(); - }, this.input.pipe(u3), this.rl = import_node_readline.default.createInterface({ input: this.input, output: u3, tabSize: 2, prompt: "", escapeCodeTimeout: 50 }), import_node_readline.default.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== void 0 && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), v3(this.input, true), this.output.on("resize", this.render), this.render(), new Promise((F5, e3) => { + }, this.input.pipe(u4), this.rl = import_node_readline.default.createInterface({ input: this.input, output: u4, tabSize: 2, prompt: "", escapeCodeTimeout: 50 }), import_node_readline.default.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== void 0 && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), v3(this.input, true), this.output.on("resize", this.render), this.render(), new Promise((F5, e3) => { this.once("submit", () => { this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), v3(this.input, false), F5(this.value); }), this.once("cancel", () => { @@ -25538,16 +25206,16 @@ var x3 = class { }); }); } - on(u3, F5) { - const e3 = this.subscribers.get(u3) ?? []; - e3.push({ cb: F5 }), this.subscribers.set(u3, e3); + on(u4, F5) { + const e3 = this.subscribers.get(u4) ?? []; + e3.push({ cb: F5 }), this.subscribers.set(u4, e3); } - once(u3, F5) { - const e3 = this.subscribers.get(u3) ?? []; - e3.push({ cb: F5, once: true }), this.subscribers.set(u3, e3); + once(u4, F5) { + const e3 = this.subscribers.get(u4) ?? []; + e3.push({ cb: F5, once: true }), this.subscribers.set(u4, e3); } - emit(u3, ...F5) { - const e3 = this.subscribers.get(u3) ?? [], s2 = []; + emit(u4, ...F5) { + const e3 = this.subscribers.get(u4) ?? [], s2 = []; for (const C5 of e3) C5.cb(...F5), C5.once && s2.push(() => e3.splice(e3.indexOf(C5), 1)); for (const C5 of s2) @@ -25556,51 +25224,51 @@ var x3 = class { unsubscribe() { this.subscribers.clear(); } - onKeypress(u3, F5) { - if (this.state === "error" && (this.state = "active"), F5?.name && !this._track && z3.has(F5.name) && this.emit("cursor", z3.get(F5.name)), F5?.name && lD2.has(F5.name) && this.emit("cursor", F5.name), u3 && (u3.toLowerCase() === "y" || u3.toLowerCase() === "n") && this.emit("confirm", u3.toLowerCase() === "y"), u3 === " " && this.opts.placeholder && (this.value || (this.rl.write(this.opts.placeholder), this.emit("value", this.opts.placeholder))), u3 && this.emit("key", u3.toLowerCase()), F5?.name === "return") { + onKeypress(u4, F5) { + if (this.state === "error" && (this.state = "active"), F5?.name && !this._track && z3.has(F5.name) && this.emit("cursor", z3.get(F5.name)), F5?.name && lD2.has(F5.name) && this.emit("cursor", F5.name), u4 && (u4.toLowerCase() === "y" || u4.toLowerCase() === "n") && this.emit("confirm", u4.toLowerCase() === "y"), u4 === " " && this.opts.placeholder && (this.value || (this.rl.write(this.opts.placeholder), this.emit("value", this.opts.placeholder))), u4 && this.emit("key", u4.toLowerCase()), F5?.name === "return") { if (this.opts.validate) { const e3 = this.opts.validate(this.value); e3 && (this.error = e3, this.state = "error", this.rl.write(this.value)); } this.state !== "error" && (this.state = "submit"); } - u3 === "" && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close(); + u4 === "" && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close(); } close() { this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(` `), v3(this.input, false), this.rl.close(), this.emit(`${this.state}`, this.value), this.unsubscribe(); } restoreCursor() { - const u3 = R4(this._prevFrame, process.stdout.columns, { hard: true }).split(` + const u4 = R4(this._prevFrame, process.stdout.columns, { hard: true }).split(` `).length - 1; - this.output.write(import_sisteransi.cursor.move(-999, u3 * -1)); + this.output.write(import_sisteransi.cursor.move(-999, u4 * -1)); } render() { - const u3 = R4(this._render(this) ?? "", process.stdout.columns, { hard: true }); - if (u3 !== this._prevFrame) { + const u4 = R4(this._render(this) ?? "", process.stdout.columns, { hard: true }); + if (u4 !== this._prevFrame) { if (this.state === "initial") this.output.write(import_sisteransi.cursor.hide); else { - const F5 = aD2(this._prevFrame, u3); + const F5 = aD2(this._prevFrame, u4); if (this.restoreCursor(), F5 && F5?.length === 1) { const e3 = F5[0]; this.output.write(import_sisteransi.cursor.move(0, e3)), this.output.write(import_sisteransi.erase.lines(1)); - const s2 = u3.split(` + const s2 = u4.split(` `); - this.output.write(s2[e3]), this._prevFrame = u3, this.output.write(import_sisteransi.cursor.move(0, s2.length - e3 - 1)); + this.output.write(s2[e3]), this._prevFrame = u4, this.output.write(import_sisteransi.cursor.move(0, s2.length - e3 - 1)); return; } else if (F5 && F5?.length > 1) { const e3 = F5[0]; this.output.write(import_sisteransi.cursor.move(0, e3)), this.output.write(import_sisteransi.erase.down()); - const s2 = u3.split(` + const s2 = u4.split(` `).slice(e3); this.output.write(s2.join(` -`)), this._prevFrame = u3; +`)), this._prevFrame = u4; return; } this.output.write(import_sisteransi.erase.down()); } - this.output.write(u3), this.state === "initial" && (this.state = "active"), this._prevFrame = u3; + this.output.write(u4), this.state === "initial" && (this.state = "active"), this._prevFrame = u4; } } }; @@ -25611,8 +25279,8 @@ var xD2 = class extends x3 { get _value() { return this.cursor === 0; } - constructor(u3) { - super(u3, false), this.value = !!u3.initialValue, this.on("value", () => { + constructor(u4) { + super(u4, false), this.value = !!u4.initialValue, this.on("value", () => { this.value = this._value; }), this.on("confirm", (F5) => { this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = F5, this.state = "submit", this.close(); @@ -25622,11 +25290,11 @@ var xD2 = class extends x3 { } }; var pD2 = Object.defineProperty; -var fD2 = (t2, u3, F5) => u3 in t2 ? pD2(t2, u3, { enumerable: true, configurable: true, writable: true, value: F5 }) : t2[u3] = F5; -var K3 = (t2, u3, F5) => (fD2(t2, typeof u3 != "symbol" ? u3 + "" : u3, F5), F5); +var fD2 = (t2, u4, F5) => u4 in t2 ? pD2(t2, u4, { enumerable: true, configurable: true, writable: true, value: F5 }) : t2[u4] = F5; +var K3 = (t2, u4, F5) => (fD2(t2, typeof u4 != "symbol" ? u4 + "" : u4, F5), F5); var gD2 = class extends x3 { - constructor(u3) { - super(u3, false), K3(this, "options"), K3(this, "cursor", 0), this.options = u3.options, this.value = [...u3.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: F5 }) => F5 === u3.cursorAt), 0), this.on("key", (F5) => { + constructor(u4) { + super(u4, false), K3(this, "options"), K3(this, "cursor", 0), this.options = u4.options, this.value = [...u4.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: F5 }) => F5 === u4.cursorAt), 0), this.on("key", (F5) => { F5 === "a" && this.toggleAll(); }), this.on("cursor", (F5) => { switch (F5) { @@ -25648,20 +25316,20 @@ var gD2 = class extends x3 { return this.options[this.cursor].value; } toggleAll() { - const u3 = this.value.length === this.options.length; - this.value = u3 ? [] : this.options.map((F5) => F5.value); + const u4 = this.value.length === this.options.length; + this.value = u4 ? [] : this.options.map((F5) => F5.value); } toggleValue() { - const u3 = this.value.includes(this._value); - this.value = u3 ? this.value.filter((F5) => F5 !== this._value) : [...this.value, this._value]; + const u4 = this.value.includes(this._value); + this.value = u4 ? this.value.filter((F5) => F5 !== this._value) : [...this.value, this._value]; } }; var bD2 = Object.defineProperty; -var wD2 = (t2, u3, F5) => u3 in t2 ? bD2(t2, u3, { enumerable: true, configurable: true, writable: true, value: F5 }) : t2[u3] = F5; -var Z3 = (t2, u3, F5) => (wD2(t2, typeof u3 != "symbol" ? u3 + "" : u3, F5), F5); +var wD2 = (t2, u4, F5) => u4 in t2 ? bD2(t2, u4, { enumerable: true, configurable: true, writable: true, value: F5 }) : t2[u4] = F5; +var Z3 = (t2, u4, F5) => (wD2(t2, typeof u4 != "symbol" ? u4 + "" : u4, F5), F5); var yD = class extends x3 { - constructor(u3) { - super(u3, false), Z3(this, "options"), Z3(this, "cursor", 0), this.options = u3.options, this.cursor = this.options.findIndex(({ value: F5 }) => F5 === u3.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (F5) => { + constructor(u4) { + super(u4, false), Z3(this, "options"), Z3(this, "cursor", 0), this.options = u4.options, this.cursor = this.options.findIndex(({ value: F5 }) => F5 === u4.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (F5) => { switch (F5) { case "left": case "up": @@ -25683,15 +25351,15 @@ var yD = class extends x3 { } }; var PD = globalThis.process.platform.startsWith("win"); -function WD({ input: t2 = import_node_process.stdin, output: u3 = import_node_process.stdout, overwrite: F5 = true, hideCursor: e3 = true } = {}) { - const s2 = f.createInterface({ input: t2, output: u3, prompt: "", tabSize: 1 }); +function WD({ input: t2 = import_node_process.stdin, output: u4 = import_node_process.stdout, overwrite: F5 = true, hideCursor: e3 = true } = {}) { + const s2 = f.createInterface({ input: t2, output: u4, prompt: "", tabSize: 1 }); f.emitKeypressEvents(t2, s2), t2.isTTY && t2.setRawMode(true); - const C5 = (D5, { name: i3 }) => { + const C5 = (D5, { name: i4 }) => { if (String(D5) === "" && process.exit(0), !F5) return; - let n2 = i3 === "return" ? 0 : -1, E4 = i3 === "return" ? -1 : 0; - f.moveCursor(u3, n2, E4, () => { - f.clearLine(u3, 1, () => { + let n3 = i4 === "return" ? 0 : -1, E4 = i4 === "return" ? -1 : 0; + f.moveCursor(u4, n3, E4, () => { + f.clearLine(u4, 1, () => { t2.once("keypress", C5); }); }); @@ -25709,7 +25377,7 @@ function N4() { return import_node_process2.default.platform !== "win32" ? import_node_process2.default.env.TERM !== "linux" : Boolean(import_node_process2.default.env.CI) || Boolean(import_node_process2.default.env.WT_SESSION) || Boolean(import_node_process2.default.env.TERMINUS_SUBLIME) || import_node_process2.default.env.ConEmuTask === "{cmd::Cmder}" || import_node_process2.default.env.TERM_PROGRAM === "Terminus-Sublime" || import_node_process2.default.env.TERM_PROGRAM === "vscode" || import_node_process2.default.env.TERM === "xterm-256color" || import_node_process2.default.env.TERM === "alacritty" || import_node_process2.default.env.TERMINAL_EMULATOR === "JetBrains-JediTerm"; } var p2 = N4(); -var u = (r3, n2) => p2 ? r3 : n2; +var u = (r3, n3) => p2 ? r3 : n3; var W4 = u("\u25C6", "*"); var D3 = u("\u25A0", "x"); var F3 = u("\u25B2", "x"); @@ -25745,28 +25413,28 @@ var h2 = (r3) => { } }; var Q3 = (r3) => { - const n2 = r3.active ?? "Yes", s2 = r3.inactive ?? "No"; - return new xD2({ active: n2, inactive: s2, initialValue: r3.initialValue ?? true, render() { + const n3 = r3.active ?? "Yes", s2 = r3.inactive ?? "No"; + return new xD2({ active: n3, inactive: s2, initialValue: r3.initialValue ?? true, render() { const t2 = `${import_picocolors.default.gray(a2)} ${h2(this.state)} ${r3.message} -`, i3 = this.value ? n2 : s2; +`, i4 = this.value ? n3 : s2; switch (this.state) { case "submit": - return `${t2}${import_picocolors.default.gray(a2)} ${import_picocolors.default.dim(i3)}`; + return `${t2}${import_picocolors.default.gray(a2)} ${import_picocolors.default.dim(i4)}`; case "cancel": - return `${t2}${import_picocolors.default.gray(a2)} ${import_picocolors.default.strikethrough(import_picocolors.default.dim(i3))} + return `${t2}${import_picocolors.default.gray(a2)} ${import_picocolors.default.strikethrough(import_picocolors.default.dim(i4))} ${import_picocolors.default.gray(a2)}`; default: - return `${t2}${import_picocolors.default.cyan(a2)} ${this.value ? `${import_picocolors.default.green(w5)} ${n2}` : `${import_picocolors.default.dim(S4)} ${import_picocolors.default.dim(n2)}`} ${import_picocolors.default.dim("/")} ${this.value ? `${import_picocolors.default.dim(S4)} ${import_picocolors.default.dim(s2)}` : `${import_picocolors.default.green(w5)} ${s2}`} + return `${t2}${import_picocolors.default.cyan(a2)} ${this.value ? `${import_picocolors.default.green(w5)} ${n3}` : `${import_picocolors.default.dim(S4)} ${import_picocolors.default.dim(n3)}`} ${import_picocolors.default.dim("/")} ${this.value ? `${import_picocolors.default.dim(S4)} ${import_picocolors.default.dim(s2)}` : `${import_picocolors.default.green(w5)} ${s2}`} ${import_picocolors.default.cyan(o)} `; } } }).prompt(); }; var ee = (r3) => { - const n2 = (s2, t2) => { - const i3 = s2.label ?? String(s2.value); - return t2 === "active" ? `${import_picocolors.default.green(w5)} ${i3} ${s2.hint ? import_picocolors.default.dim(`(${s2.hint})`) : ""}` : t2 === "selected" ? `${import_picocolors.default.dim(i3)}` : t2 === "cancelled" ? `${import_picocolors.default.strikethrough(import_picocolors.default.dim(i3))}` : `${import_picocolors.default.dim(S4)} ${import_picocolors.default.dim(i3)}`; + const n3 = (s2, t2) => { + const i4 = s2.label ?? String(s2.value); + return t2 === "active" ? `${import_picocolors.default.green(w5)} ${i4} ${s2.hint ? import_picocolors.default.dim(`(${s2.hint})`) : ""}` : t2 === "selected" ? `${import_picocolors.default.dim(i4)}` : t2 === "cancelled" ? `${import_picocolors.default.strikethrough(import_picocolors.default.dim(i4))}` : `${import_picocolors.default.dim(S4)} ${import_picocolors.default.dim(i4)}`; }; return new yD({ options: r3.options, initialValue: r3.initialValue, render() { const s2 = `${import_picocolors.default.gray(a2)} @@ -25774,12 +25442,12 @@ ${h2(this.state)} ${r3.message} `; switch (this.state) { case "submit": - return `${s2}${import_picocolors.default.gray(a2)} ${n2(this.options[this.cursor], "selected")}`; + return `${s2}${import_picocolors.default.gray(a2)} ${n3(this.options[this.cursor], "selected")}`; case "cancel": - return `${s2}${import_picocolors.default.gray(a2)} ${n2(this.options[this.cursor], "cancelled")} + return `${s2}${import_picocolors.default.gray(a2)} ${n3(this.options[this.cursor], "cancelled")} ${import_picocolors.default.gray(a2)}`; default: - return `${s2}${import_picocolors.default.cyan(a2)} ${this.options.map((t2, i3) => n2(t2, i3 === this.cursor ? "active" : "inactive")).join(` + return `${s2}${import_picocolors.default.cyan(a2)} ${this.options.map((t2, i4) => n3(t2, i4 === this.cursor ? "active" : "inactive")).join(` ${import_picocolors.default.cyan(a2)} `)} ${import_picocolors.default.cyan(o)} `; @@ -25787,9 +25455,9 @@ ${import_picocolors.default.cyan(o)} } }).prompt(); }; var re = (r3) => { - const n2 = (s2, t2) => { - const i3 = s2.label ?? String(s2.value); - return t2 === "active" ? `${import_picocolors.default.cyan(_5)} ${i3} ${s2.hint ? import_picocolors.default.dim(`(${s2.hint})`) : ""}` : t2 === "selected" ? `${import_picocolors.default.green(y4)} ${import_picocolors.default.dim(i3)}` : t2 === "cancelled" ? `${import_picocolors.default.strikethrough(import_picocolors.default.dim(i3))}` : t2 === "active-selected" ? `${import_picocolors.default.green(y4)} ${i3} ${s2.hint ? import_picocolors.default.dim(`(${s2.hint})`) : ""}` : t2 === "submitted" ? `${import_picocolors.default.dim(i3)}` : `${import_picocolors.default.dim(A3)} ${import_picocolors.default.dim(i3)}`; + const n3 = (s2, t2) => { + const i4 = s2.label ?? String(s2.value); + return t2 === "active" ? `${import_picocolors.default.cyan(_5)} ${i4} ${s2.hint ? import_picocolors.default.dim(`(${s2.hint})`) : ""}` : t2 === "selected" ? `${import_picocolors.default.green(y4)} ${import_picocolors.default.dim(i4)}` : t2 === "cancelled" ? `${import_picocolors.default.strikethrough(import_picocolors.default.dim(i4))}` : t2 === "active-selected" ? `${import_picocolors.default.green(y4)} ${i4} ${s2.hint ? import_picocolors.default.dim(`(${s2.hint})`) : ""}` : t2 === "submitted" ? `${import_picocolors.default.dim(i4)}` : `${import_picocolors.default.dim(A3)} ${import_picocolors.default.dim(i4)}`; }; return new gD2({ options: r3.options, initialValues: r3.initialValues, required: r3.required ?? true, cursorAt: r3.cursorAt, validate(s2) { if (this.required && s2.length === 0) @@ -25801,28 +25469,28 @@ ${h2(this.state)} ${r3.message} `; switch (this.state) { case "submit": - return `${s2}${import_picocolors.default.gray(a2)} ${this.options.filter(({ value: t2 }) => this.value.includes(t2)).map((t2) => n2(t2, "submitted")).join(import_picocolors.default.dim(", ")) || import_picocolors.default.dim("none")}`; + return `${s2}${import_picocolors.default.gray(a2)} ${this.options.filter(({ value: t2 }) => this.value.includes(t2)).map((t2) => n3(t2, "submitted")).join(import_picocolors.default.dim(", ")) || import_picocolors.default.dim("none")}`; case "cancel": { - const t2 = this.options.filter(({ value: i3 }) => this.value.includes(i3)).map((i3) => n2(i3, "cancelled")).join(import_picocolors.default.dim(", ")); + const t2 = this.options.filter(({ value: i4 }) => this.value.includes(i4)).map((i4) => n3(i4, "cancelled")).join(import_picocolors.default.dim(", ")); return `${s2}${import_picocolors.default.gray(a2)} ${t2.trim() ? `${t2} ${import_picocolors.default.gray(a2)}` : ""}`; } case "error": { const t2 = this.error.split(` -`).map((i3, c3) => c3 === 0 ? `${import_picocolors.default.yellow(o)} ${import_picocolors.default.yellow(i3)}` : ` ${i3}`).join(` +`).map((i4, c5) => c5 === 0 ? `${import_picocolors.default.yellow(o)} ${import_picocolors.default.yellow(i4)}` : ` ${i4}`).join(` `); - return s2 + import_picocolors.default.yellow(a2) + " " + this.options.map((i3, c3) => { - const l3 = this.value.includes(i3.value), $6 = c3 === this.cursor; - return $6 && l3 ? n2(i3, "active-selected") : l3 ? n2(i3, "selected") : n2(i3, $6 ? "active" : "inactive"); + return s2 + import_picocolors.default.yellow(a2) + " " + this.options.map((i4, c5) => { + const l3 = this.value.includes(i4.value), $6 = c5 === this.cursor; + return $6 && l3 ? n3(i4, "active-selected") : l3 ? n3(i4, "selected") : n3(i4, $6 ? "active" : "inactive"); }).join(` ${import_picocolors.default.yellow(a2)} `) + ` ` + t2 + ` `; } default: - return `${s2}${import_picocolors.default.cyan(a2)} ${this.options.map((t2, i3) => { - const c3 = this.value.includes(t2.value), l3 = i3 === this.cursor; - return l3 && c3 ? n2(t2, "active-selected") : c3 ? n2(t2, "selected") : n2(t2, l3 ? "active" : "inactive"); + return `${s2}${import_picocolors.default.cyan(a2)} ${this.options.map((t2, i4) => { + const c5 = this.value.includes(t2.value), l3 = i4 === this.cursor; + return l3 && c5 ? n3(t2, "active-selected") : c5 ? n3(t2, "selected") : n3(t2, l3 ? "active" : "inactive"); }).join(` ${import_picocolors.default.cyan(a2)} `)} ${import_picocolors.default.cyan(o)} @@ -25831,15 +25499,15 @@ ${import_picocolors.default.cyan(o)} } }).prompt(); }; var b5 = (r3) => r3.replace(ue(), ""); -var ie = (r3 = "", n2 = "") => { +var ie = (r3 = "", n3 = "") => { const s2 = ` ${r3} `.split(` -`), t2 = Math.max(s2.reduce((c3, l3) => (l3 = b5(l3), l3.length > c3 ? l3.length : c3), 0), b5(n2).length) + 2, i3 = s2.map((c3) => `${import_picocolors.default.gray(a2)} ${import_picocolors.default.dim(c3)}${" ".repeat(t2 - b5(c3).length)}${import_picocolors.default.gray(a2)}`).join(` +`), t2 = Math.max(s2.reduce((c5, l3) => (l3 = b5(l3), l3.length > c5 ? l3.length : c5), 0), b5(n3).length) + 2, i4 = s2.map((c5) => `${import_picocolors.default.gray(a2)} ${import_picocolors.default.dim(c5)}${" ".repeat(t2 - b5(c5).length)}${import_picocolors.default.gray(a2)}`).join(` `); process.stdout.write(`${import_picocolors.default.gray(a2)} -${import_picocolors.default.green(f2)} ${import_picocolors.default.reset(n2)} ${import_picocolors.default.gray(R5.repeat(Math.max(t2 - n2.length - 1, 1)) + G4)} -${i3} +${import_picocolors.default.green(f2)} ${import_picocolors.default.reset(n3)} ${import_picocolors.default.gray(R5.repeat(Math.max(t2 - n3.length - 1, 1)) + G4)} +${i4} ${import_picocolors.default.gray(H3 + R5.repeat(t2 + 2) + K4)} `); }; @@ -25855,20 +25523,20 @@ ${import_picocolors.default.gray(o)} ${r3} }; var C3 = p2 ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"]; var le = () => { - let r3, n2; + let r3, n3; const s2 = p2 ? 80 : 120; return { start(t2 = "") { t2 = t2.replace(/\.?\.?\.$/, ""), r3 = WD(), process.stdout.write(`${import_picocolors.default.gray(a2)} ${import_picocolors.default.magenta("\u25CB")} ${t2} `); - let i3 = 0, c3 = 0; - n2 = setInterval(() => { - let l3 = C3[i3]; - process.stdout.write(import_sisteransi2.cursor.move(-999, -1)), process.stdout.write(`${import_picocolors.default.magenta(l3)} ${t2}${Math.floor(c3) >= 1 ? ".".repeat(Math.floor(c3)).slice(0, 3) : ""} -`), i3 = i3 === C3.length - 1 ? 0 : i3 + 1, c3 = c3 === C3.length ? 0 : c3 + 0.125; + let i4 = 0, c5 = 0; + n3 = setInterval(() => { + let l3 = C3[i4]; + process.stdout.write(import_sisteransi2.cursor.move(-999, -1)), process.stdout.write(`${import_picocolors.default.magenta(l3)} ${t2}${Math.floor(c5) >= 1 ? ".".repeat(Math.floor(c5)).slice(0, 3) : ""} +`), i4 = i4 === C3.length - 1 ? 0 : i4 + 1, c5 = c5 === C3.length ? 0 : c5 + 0.125; }, s2); }, stop(t2 = "") { - process.stdout.write(import_sisteransi2.cursor.move(-999, -2)), process.stdout.write(import_sisteransi2.erase.down(2)), clearInterval(n2), process.stdout.write(`${import_picocolors.default.gray(a2)} + process.stdout.write(import_sisteransi2.cursor.move(-999, -2)), process.stdout.write(import_sisteransi2.erase.down(2)), clearInterval(n3), process.stdout.write(`${import_picocolors.default.gray(a2)} ${import_picocolors.default.green(f2)} ${t2} `), r3(); } }; @@ -25882,7 +25550,7 @@ function ue() { var ANSI_BACKGROUND_OFFSET = 10; var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`; var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`; -var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`; +var wrapAnsi16m = (offset = 0) => (red2, green2, blue2) => `\x1B[${38 + offset};2;${red2};${green2};${blue2}m`; var styles = { modifier: { reset: [0, 0], @@ -25970,17 +25638,17 @@ function assembleStyles() { styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET); Object.defineProperties(styles, { rgbToAnsi256: { - value(red, green, blue) { - if (red === green && green === blue) { - if (red < 8) { + value(red2, green2, blue2) { + if (red2 === green2 && green2 === blue2) { + if (red2 < 8) { return 16; } - if (red > 248) { + if (red2 > 248) { return 231; } - return Math.round((red - 8) / 247 * 24) + 232; + return Math.round((red2 - 8) / 247 * 24) + 232; } - return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5); + return 16 + 36 * Math.round(red2 / 255 * 5) + 6 * Math.round(green2 / 255 * 5) + Math.round(blue2 / 255 * 5); }, enumerable: false }, @@ -26015,25 +25683,25 @@ function assembleStyles() { if (code < 16) { return 90 + (code - 8); } - let red; - let green; - let blue; + let red2; + let green2; + let blue2; if (code >= 232) { - red = ((code - 232) * 10 + 8) / 255; - green = red; - blue = red; + red2 = ((code - 232) * 10 + 8) / 255; + green2 = red2; + blue2 = red2; } else { code -= 16; const remainder = code % 36; - red = Math.floor(code / 36) / 5; - green = Math.floor(remainder / 6) / 5; - blue = remainder % 6 / 5; + red2 = Math.floor(code / 36) / 5; + green2 = Math.floor(remainder / 6) / 5; + blue2 = remainder % 6 / 5; } - const value = Math.max(red, green, blue) * 2; + const value = Math.max(red2, green2, blue2) * 2; if (value === 0) { return 30; } - let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red)); + let result = 30 + (Math.round(blue2) << 2 | Math.round(green2) << 1 | Math.round(red2)); if (value === 2) { result += 60; } @@ -26042,7 +25710,7 @@ function assembleStyles() { enumerable: false }, rgbToAnsi: { - value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)), + value: (red2, green2, blue2) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red2, green2, blue2)), enumerable: false }, hexToAnsi: { @@ -26358,38 +26026,857 @@ var chalk = createChalk(); var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 }); var source_default = chalk; -// node_modules/execa/index.js -var import_node_buffer2 = require("node:buffer"); -var import_node_path2 = __toESM(require("node:path"), 1); -var import_node_child_process3 = __toESM(require("node:child_process"), 1); -var import_node_process7 = __toESM(require("node:process"), 1); -var import_cross_spawn = __toESM(require_cross_spawn(), 1); - -// node_modules/execa/node_modules/strip-final-newline/index.js -function stripFinalNewline(input) { - const LF = typeof input === "string" ? "\n" : "\n".charCodeAt(); - const CR = typeof input === "string" ? "\r" : "\r".charCodeAt(); - if (input[input.length - 1] === LF) { - input = input.slice(0, -1); +// node_modules/is-plain-obj/index.js +function isPlainObject(value) { + if (typeof value !== "object" || value === null) { + return false; } - if (input[input.length - 1] === CR) { - input = input.slice(0, -1); - } - return input; + const prototype3 = Object.getPrototypeOf(value); + return (prototype3 === null || prototype3 === Object.prototype || Object.getPrototypeOf(prototype3) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value); } -// node_modules/npm-run-path/index.js -var import_node_process4 = __toESM(require("node:process"), 1); -var import_node_path = __toESM(require("node:path"), 1); +// node_modules/execa/lib/arguments/file-url.js var import_node_url = require("node:url"); +var safeNormalizeFileUrl = (file, name) => { + const fileString = normalizeFileUrl(file); + if (typeof fileString !== "string") { + throw new TypeError(`${name} must be a string or a file URL: ${fileString}.`); + } + return fileString; +}; +var normalizeFileUrl = (file) => file instanceof URL ? (0, import_node_url.fileURLToPath)(file) : file; + +// node_modules/execa/lib/methods/parameters.js +var normalizeParameters = (rawFile, rawArguments = [], rawOptions = {}) => { + const filePath = safeNormalizeFileUrl(rawFile, "First argument"); + const [commandArguments, options] = isPlainObject(rawArguments) ? [[], rawArguments] : [rawArguments, rawOptions]; + if (!Array.isArray(commandArguments)) { + throw new TypeError(`Second argument must be either an array of arguments or an options object: ${commandArguments}`); + } + if (commandArguments.some((commandArgument) => typeof commandArgument === "object" && commandArgument !== null)) { + throw new TypeError(`Second argument must be an array of strings: ${commandArguments}`); + } + const normalizedArguments = commandArguments.map(String); + const nullByteArgument = normalizedArguments.find((normalizedArgument) => normalizedArgument.includes("\0")); + if (nullByteArgument !== void 0) { + throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${nullByteArgument}`); + } + if (!isPlainObject(options)) { + throw new TypeError(`Last argument must be an options object: ${options}`); + } + return [filePath, normalizedArguments, options]; +}; + +// node_modules/execa/lib/methods/template.js +var import_node_child_process = require("node:child_process"); + +// node_modules/execa/lib/utils/uint-array.js +var import_node_string_decoder = require("node:string_decoder"); +var { toString: objectToString } = Object.prototype; +var isArrayBuffer = (value) => objectToString.call(value) === "[object ArrayBuffer]"; +var isUint8Array = (value) => objectToString.call(value) === "[object Uint8Array]"; +var bufferToUint8Array = (buffer) => new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength); +var textEncoder = new TextEncoder(); +var stringToUint8Array = (string) => textEncoder.encode(string); +var textDecoder = new TextDecoder(); +var uint8ArrayToString = (uint8Array) => textDecoder.decode(uint8Array); +var joinToString = (uint8ArraysOrStrings, encoding) => { + const strings = uint8ArraysToStrings(uint8ArraysOrStrings, encoding); + return strings.join(""); +}; +var uint8ArraysToStrings = (uint8ArraysOrStrings, encoding) => { + if (encoding === "utf8" && uint8ArraysOrStrings.every((uint8ArrayOrString) => typeof uint8ArrayOrString === "string")) { + return uint8ArraysOrStrings; + } + const decoder = new import_node_string_decoder.StringDecoder(encoding); + const strings = uint8ArraysOrStrings.map((uint8ArrayOrString) => typeof uint8ArrayOrString === "string" ? stringToUint8Array(uint8ArrayOrString) : uint8ArrayOrString).map((uint8Array) => decoder.write(uint8Array)); + const finalString = decoder.end(); + return finalString === "" ? strings : [...strings, finalString]; +}; +var joinToUint8Array = (uint8ArraysOrStrings) => { + if (uint8ArraysOrStrings.length === 1 && isUint8Array(uint8ArraysOrStrings[0])) { + return uint8ArraysOrStrings[0]; + } + return concatUint8Arrays(stringsToUint8Arrays(uint8ArraysOrStrings)); +}; +var stringsToUint8Arrays = (uint8ArraysOrStrings) => uint8ArraysOrStrings.map((uint8ArrayOrString) => typeof uint8ArrayOrString === "string" ? stringToUint8Array(uint8ArrayOrString) : uint8ArrayOrString); +var concatUint8Arrays = (uint8Arrays) => { + const result = new Uint8Array(getJoinLength(uint8Arrays)); + let index = 0; + for (const uint8Array of uint8Arrays) { + result.set(uint8Array, index); + index += uint8Array.length; + } + return result; +}; +var getJoinLength = (uint8Arrays) => { + let joinLength = 0; + for (const uint8Array of uint8Arrays) { + joinLength += uint8Array.length; + } + return joinLength; +}; + +// node_modules/execa/lib/methods/template.js +var isTemplateString = (templates) => Array.isArray(templates) && Array.isArray(templates.raw); +var parseTemplates = (templates, expressions) => { + let tokens = []; + for (const [index, template] of templates.entries()) { + tokens = parseTemplate({ + templates, + expressions, + tokens, + index, + template + }); + } + if (tokens.length === 0) { + throw new TypeError("Template script must not be empty"); + } + const [file, ...commandArguments] = tokens; + return [file, commandArguments, {}]; +}; +var parseTemplate = ({ templates, expressions, tokens, index, template }) => { + if (template === void 0) { + throw new TypeError(`Invalid backslash sequence: ${templates.raw[index]}`); + } + const { nextTokens, leadingWhitespaces, trailingWhitespaces } = splitByWhitespaces(template, templates.raw[index]); + const newTokens = concatTokens(tokens, nextTokens, leadingWhitespaces); + if (index === expressions.length) { + return newTokens; + } + const expression = expressions[index]; + const expressionTokens = Array.isArray(expression) ? expression.map((expression2) => parseExpression(expression2)) : [parseExpression(expression)]; + return concatTokens(newTokens, expressionTokens, trailingWhitespaces); +}; +var splitByWhitespaces = (template, rawTemplate) => { + if (rawTemplate.length === 0) { + return { nextTokens: [], leadingWhitespaces: false, trailingWhitespaces: false }; + } + const nextTokens = []; + let templateStart = 0; + const leadingWhitespaces = DELIMITERS.has(rawTemplate[0]); + for (let templateIndex = 0, rawIndex = 0; templateIndex < template.length; templateIndex += 1, rawIndex += 1) { + const rawCharacter = rawTemplate[rawIndex]; + if (DELIMITERS.has(rawCharacter)) { + if (templateStart !== templateIndex) { + nextTokens.push(template.slice(templateStart, templateIndex)); + } + templateStart = templateIndex + 1; + } else if (rawCharacter === "\\") { + const nextRawCharacter = rawTemplate[rawIndex + 1]; + if (nextRawCharacter === "u" && rawTemplate[rawIndex + 2] === "{") { + rawIndex = rawTemplate.indexOf("}", rawIndex + 3); + } else { + rawIndex += ESCAPE_LENGTH[nextRawCharacter] ?? 1; + } + } + } + const trailingWhitespaces = templateStart === template.length; + if (!trailingWhitespaces) { + nextTokens.push(template.slice(templateStart)); + } + return { nextTokens, leadingWhitespaces, trailingWhitespaces }; +}; +var DELIMITERS = /* @__PURE__ */ new Set([" ", " ", "\r", "\n"]); +var ESCAPE_LENGTH = { x: 3, u: 5 }; +var concatTokens = (tokens, nextTokens, isSeparated) => isSeparated || tokens.length === 0 || nextTokens.length === 0 ? [...tokens, ...nextTokens] : [ + ...tokens.slice(0, -1), + `${tokens.at(-1)}${nextTokens[0]}`, + ...nextTokens.slice(1) +]; +var parseExpression = (expression) => { + const typeOfExpression = typeof expression; + if (typeOfExpression === "string") { + return expression; + } + if (typeOfExpression === "number") { + return String(expression); + } + if (isPlainObject(expression) && ("stdout" in expression || "isMaxBuffer" in expression)) { + return getSubprocessResult(expression); + } + if (expression instanceof import_node_child_process.ChildProcess || Object.prototype.toString.call(expression) === "[object Promise]") { + throw new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."); + } + throw new TypeError(`Unexpected "${typeOfExpression}" in template expression`); +}; +var getSubprocessResult = ({ stdout }) => { + if (typeof stdout === "string") { + return stdout; + } + if (isUint8Array(stdout)) { + return uint8ArrayToString(stdout); + } + if (stdout === void 0) { + throw new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`); + } + throw new TypeError(`Unexpected "${typeof stdout}" stdout in template expression`); +}; + +// node_modules/execa/lib/methods/main-sync.js +var import_node_child_process2 = require("node:child_process"); + +// node_modules/execa/lib/arguments/specific.js +var import_node_util = require("node:util"); + +// node_modules/execa/lib/utils/standard-stream.js +var import_node_process4 = __toESM(require("node:process"), 1); +var isStandardStream = (stream4) => STANDARD_STREAMS.includes(stream4); +var STANDARD_STREAMS = [import_node_process4.default.stdin, import_node_process4.default.stdout, import_node_process4.default.stderr]; +var STANDARD_STREAMS_ALIASES = ["stdin", "stdout", "stderr"]; +var getStreamName = (fdNumber) => STANDARD_STREAMS_ALIASES[fdNumber] ?? `stdio[${fdNumber}]`; + +// node_modules/execa/lib/arguments/specific.js +var normalizeFdSpecificOptions = (options) => { + const optionsCopy = { ...options }; + for (const optionName of FD_SPECIFIC_OPTIONS) { + optionsCopy[optionName] = normalizeFdSpecificOption(options, optionName); + } + return optionsCopy; +}; +var normalizeFdSpecificOption = (options, optionName) => { + const optionBaseArray = Array.from({ length: getStdioLength(options) + 1 }); + const optionArray = normalizeFdSpecificValue(options[optionName], optionBaseArray, optionName); + return addDefaultValue(optionArray, optionName); +}; +var getStdioLength = ({ stdio }) => Array.isArray(stdio) ? Math.max(stdio.length, STANDARD_STREAMS_ALIASES.length) : STANDARD_STREAMS_ALIASES.length; +var normalizeFdSpecificValue = (optionValue, optionArray, optionName) => isPlainObject(optionValue) ? normalizeOptionObject(optionValue, optionArray, optionName) : optionArray.fill(optionValue); +var normalizeOptionObject = (optionValue, optionArray, optionName) => { + for (const fdName of Object.keys(optionValue).sort(compareFdName)) { + for (const fdNumber of parseFdName(fdName, optionName, optionArray)) { + optionArray[fdNumber] = optionValue[fdName]; + } + } + return optionArray; +}; +var compareFdName = (fdNameA, fdNameB) => getFdNameOrder(fdNameA) < getFdNameOrder(fdNameB) ? 1 : -1; +var getFdNameOrder = (fdName) => { + if (fdName === "stdout" || fdName === "stderr") { + return 0; + } + return fdName === "all" ? 2 : 1; +}; +var parseFdName = (fdName, optionName, optionArray) => { + if (fdName === "ipc") { + return [optionArray.length - 1]; + } + const fdNumber = parseFd(fdName); + if (fdNumber === void 0 || fdNumber === 0) { + throw new TypeError(`"${optionName}.${fdName}" is invalid. +It must be "${optionName}.stdout", "${optionName}.stderr", "${optionName}.all", "${optionName}.ipc", or "${optionName}.fd3", "${optionName}.fd4" (and so on).`); + } + if (fdNumber >= optionArray.length) { + throw new TypeError(`"${optionName}.${fdName}" is invalid: that file descriptor does not exist. +Please set the "stdio" option to ensure that file descriptor exists.`); + } + return fdNumber === "all" ? [1, 2] : [fdNumber]; +}; +var parseFd = (fdName) => { + if (fdName === "all") { + return fdName; + } + if (STANDARD_STREAMS_ALIASES.includes(fdName)) { + return STANDARD_STREAMS_ALIASES.indexOf(fdName); + } + const regexpResult = FD_REGEXP.exec(fdName); + if (regexpResult !== null) { + return Number(regexpResult[1]); + } +}; +var FD_REGEXP = /^fd(\d+)$/; +var addDefaultValue = (optionArray, optionName) => optionArray.map((optionValue) => optionValue === void 0 ? DEFAULT_OPTIONS[optionName] : optionValue); +var verboseDefault = (0, import_node_util.debuglog)("execa").enabled ? "full" : "none"; +var DEFAULT_OPTIONS = { + lines: false, + buffer: true, + maxBuffer: 1e3 * 1e3 * 100, + verbose: verboseDefault, + stripFinalNewline: true +}; +var FD_SPECIFIC_OPTIONS = ["lines", "buffer", "maxBuffer", "verbose", "stripFinalNewline"]; +var getFdSpecificValue = (optionArray, fdNumber) => fdNumber === "ipc" ? optionArray.at(-1) : optionArray[fdNumber]; + +// node_modules/execa/lib/verbose/values.js +var isVerbose = ({ verbose }, fdNumber) => getFdVerbose(verbose, fdNumber) !== "none"; +var isFullVerbose = ({ verbose }, fdNumber) => !["none", "short"].includes(getFdVerbose(verbose, fdNumber)); +var getVerboseFunction = ({ verbose }, fdNumber) => { + const fdVerbose = getFdVerbose(verbose, fdNumber); + return isVerboseFunction(fdVerbose) ? fdVerbose : void 0; +}; +var getFdVerbose = (verbose, fdNumber) => fdNumber === void 0 ? getFdGenericVerbose(verbose) : getFdSpecificValue(verbose, fdNumber); +var getFdGenericVerbose = (verbose) => verbose.find((fdVerbose) => isVerboseFunction(fdVerbose)) ?? VERBOSE_VALUES.findLast((fdVerbose) => verbose.includes(fdVerbose)); +var isVerboseFunction = (fdVerbose) => typeof fdVerbose === "function"; +var VERBOSE_VALUES = ["none", "short", "full"]; + +// node_modules/execa/lib/verbose/log.js +var import_node_fs = require("node:fs"); +var import_node_util3 = require("node:util"); + +// node_modules/execa/lib/arguments/escape.js +var import_node_process5 = require("node:process"); +var import_node_util2 = require("node:util"); +var joinCommand = (filePath, rawArguments) => { + const fileAndArguments = [filePath, ...rawArguments]; + const command = fileAndArguments.join(" "); + const escapedCommand = fileAndArguments.map((fileAndArgument) => quoteString(escapeControlCharacters(fileAndArgument))).join(" "); + return { command, escapedCommand }; +}; +var escapeLines = (lines) => (0, import_node_util2.stripVTControlCharacters)(lines).split("\n").map((line) => escapeControlCharacters(line)).join("\n"); +var escapeControlCharacters = (line) => line.replaceAll(SPECIAL_CHAR_REGEXP, (character) => escapeControlCharacter(character)); +var escapeControlCharacter = (character) => { + const commonEscape = COMMON_ESCAPES[character]; + if (commonEscape !== void 0) { + return commonEscape; + } + const codepoint = character.codePointAt(0); + const codepointHex = codepoint.toString(16); + return codepoint <= ASTRAL_START ? `\\u${codepointHex.padStart(4, "0")}` : `\\U${codepointHex}`; +}; +var getSpecialCharRegExp = () => { + try { + return new RegExp("\\p{Separator}|\\p{Other}", "gu"); + } catch { + return /[\s\u0000-\u001F\u007F-\u009F\u00AD]/g; + } +}; +var SPECIAL_CHAR_REGEXP = getSpecialCharRegExp(); +var COMMON_ESCAPES = { + " ": " ", + "\b": "\\b", + "\f": "\\f", + "\n": "\\n", + "\r": "\\r", + " ": "\\t" +}; +var ASTRAL_START = 65535; +var quoteString = (escapedArgument) => { + if (NO_ESCAPE_REGEXP.test(escapedArgument)) { + return escapedArgument; + } + return import_node_process5.platform === "win32" ? `"${escapedArgument.replaceAll('"', '""')}"` : `'${escapedArgument.replaceAll("'", "'\\''")}'`; +}; +var NO_ESCAPE_REGEXP = /^[\w./-]+$/; + +// node_modules/execa/node_modules/is-unicode-supported/index.js +var import_node_process6 = __toESM(require("node:process"), 1); +function isUnicodeSupported() { + if (import_node_process6.default.platform !== "win32") { + return import_node_process6.default.env.TERM !== "linux"; + } + return Boolean(import_node_process6.default.env.WT_SESSION) || Boolean(import_node_process6.default.env.TERMINUS_SUBLIME) || import_node_process6.default.env.ConEmuTask === "{cmd::Cmder}" || import_node_process6.default.env.TERM_PROGRAM === "Terminus-Sublime" || import_node_process6.default.env.TERM_PROGRAM === "vscode" || import_node_process6.default.env.TERM === "xterm-256color" || import_node_process6.default.env.TERM === "alacritty" || import_node_process6.default.env.TERMINAL_EMULATOR === "JetBrains-JediTerm"; +} + +// node_modules/execa/node_modules/figures/index.js +var common = { + circleQuestionMark: "(?)", + questionMarkPrefix: "(?)", + square: "\u2588", + squareDarkShade: "\u2593", + squareMediumShade: "\u2592", + squareLightShade: "\u2591", + squareTop: "\u2580", + squareBottom: "\u2584", + squareLeft: "\u258C", + squareRight: "\u2590", + squareCenter: "\u25A0", + bullet: "\u25CF", + dot: "\u2024", + ellipsis: "\u2026", + pointerSmall: "\u203A", + triangleUp: "\u25B2", + triangleUpSmall: "\u25B4", + triangleDown: "\u25BC", + triangleDownSmall: "\u25BE", + triangleLeftSmall: "\u25C2", + triangleRightSmall: "\u25B8", + home: "\u2302", + heart: "\u2665", + musicNote: "\u266A", + musicNoteBeamed: "\u266B", + arrowUp: "\u2191", + arrowDown: "\u2193", + arrowLeft: "\u2190", + arrowRight: "\u2192", + arrowLeftRight: "\u2194", + arrowUpDown: "\u2195", + almostEqual: "\u2248", + notEqual: "\u2260", + lessOrEqual: "\u2264", + greaterOrEqual: "\u2265", + identical: "\u2261", + infinity: "\u221E", + subscriptZero: "\u2080", + subscriptOne: "\u2081", + subscriptTwo: "\u2082", + subscriptThree: "\u2083", + subscriptFour: "\u2084", + subscriptFive: "\u2085", + subscriptSix: "\u2086", + subscriptSeven: "\u2087", + subscriptEight: "\u2088", + subscriptNine: "\u2089", + oneHalf: "\xBD", + oneThird: "\u2153", + oneQuarter: "\xBC", + oneFifth: "\u2155", + oneSixth: "\u2159", + oneEighth: "\u215B", + twoThirds: "\u2154", + twoFifths: "\u2156", + threeQuarters: "\xBE", + threeFifths: "\u2157", + threeEighths: "\u215C", + fourFifths: "\u2158", + fiveSixths: "\u215A", + fiveEighths: "\u215D", + sevenEighths: "\u215E", + line: "\u2500", + lineBold: "\u2501", + lineDouble: "\u2550", + lineDashed0: "\u2504", + lineDashed1: "\u2505", + lineDashed2: "\u2508", + lineDashed3: "\u2509", + lineDashed4: "\u254C", + lineDashed5: "\u254D", + lineDashed6: "\u2574", + lineDashed7: "\u2576", + lineDashed8: "\u2578", + lineDashed9: "\u257A", + lineDashed10: "\u257C", + lineDashed11: "\u257E", + lineDashed12: "\u2212", + lineDashed13: "\u2013", + lineDashed14: "\u2010", + lineDashed15: "\u2043", + lineVertical: "\u2502", + lineVerticalBold: "\u2503", + lineVerticalDouble: "\u2551", + lineVerticalDashed0: "\u2506", + lineVerticalDashed1: "\u2507", + lineVerticalDashed2: "\u250A", + lineVerticalDashed3: "\u250B", + lineVerticalDashed4: "\u254E", + lineVerticalDashed5: "\u254F", + lineVerticalDashed6: "\u2575", + lineVerticalDashed7: "\u2577", + lineVerticalDashed8: "\u2579", + lineVerticalDashed9: "\u257B", + lineVerticalDashed10: "\u257D", + lineVerticalDashed11: "\u257F", + lineDownLeft: "\u2510", + lineDownLeftArc: "\u256E", + lineDownBoldLeftBold: "\u2513", + lineDownBoldLeft: "\u2512", + lineDownLeftBold: "\u2511", + lineDownDoubleLeftDouble: "\u2557", + lineDownDoubleLeft: "\u2556", + lineDownLeftDouble: "\u2555", + lineDownRight: "\u250C", + lineDownRightArc: "\u256D", + lineDownBoldRightBold: "\u250F", + lineDownBoldRight: "\u250E", + lineDownRightBold: "\u250D", + lineDownDoubleRightDouble: "\u2554", + lineDownDoubleRight: "\u2553", + lineDownRightDouble: "\u2552", + lineUpLeft: "\u2518", + lineUpLeftArc: "\u256F", + lineUpBoldLeftBold: "\u251B", + lineUpBoldLeft: "\u251A", + lineUpLeftBold: "\u2519", + lineUpDoubleLeftDouble: "\u255D", + lineUpDoubleLeft: "\u255C", + lineUpLeftDouble: "\u255B", + lineUpRight: "\u2514", + lineUpRightArc: "\u2570", + lineUpBoldRightBold: "\u2517", + lineUpBoldRight: "\u2516", + lineUpRightBold: "\u2515", + lineUpDoubleRightDouble: "\u255A", + lineUpDoubleRight: "\u2559", + lineUpRightDouble: "\u2558", + lineUpDownLeft: "\u2524", + lineUpBoldDownBoldLeftBold: "\u252B", + lineUpBoldDownBoldLeft: "\u2528", + lineUpDownLeftBold: "\u2525", + lineUpBoldDownLeftBold: "\u2529", + lineUpDownBoldLeftBold: "\u252A", + lineUpDownBoldLeft: "\u2527", + lineUpBoldDownLeft: "\u2526", + lineUpDoubleDownDoubleLeftDouble: "\u2563", + lineUpDoubleDownDoubleLeft: "\u2562", + lineUpDownLeftDouble: "\u2561", + lineUpDownRight: "\u251C", + lineUpBoldDownBoldRightBold: "\u2523", + lineUpBoldDownBoldRight: "\u2520", + lineUpDownRightBold: "\u251D", + lineUpBoldDownRightBold: "\u2521", + lineUpDownBoldRightBold: "\u2522", + lineUpDownBoldRight: "\u251F", + lineUpBoldDownRight: "\u251E", + lineUpDoubleDownDoubleRightDouble: "\u2560", + lineUpDoubleDownDoubleRight: "\u255F", + lineUpDownRightDouble: "\u255E", + lineDownLeftRight: "\u252C", + lineDownBoldLeftBoldRightBold: "\u2533", + lineDownLeftBoldRightBold: "\u252F", + lineDownBoldLeftRight: "\u2530", + lineDownBoldLeftBoldRight: "\u2531", + lineDownBoldLeftRightBold: "\u2532", + lineDownLeftRightBold: "\u252E", + lineDownLeftBoldRight: "\u252D", + lineDownDoubleLeftDoubleRightDouble: "\u2566", + lineDownDoubleLeftRight: "\u2565", + lineDownLeftDoubleRightDouble: "\u2564", + lineUpLeftRight: "\u2534", + lineUpBoldLeftBoldRightBold: "\u253B", + lineUpLeftBoldRightBold: "\u2537", + lineUpBoldLeftRight: "\u2538", + lineUpBoldLeftBoldRight: "\u2539", + lineUpBoldLeftRightBold: "\u253A", + lineUpLeftRightBold: "\u2536", + lineUpLeftBoldRight: "\u2535", + lineUpDoubleLeftDoubleRightDouble: "\u2569", + lineUpDoubleLeftRight: "\u2568", + lineUpLeftDoubleRightDouble: "\u2567", + lineUpDownLeftRight: "\u253C", + lineUpBoldDownBoldLeftBoldRightBold: "\u254B", + lineUpDownBoldLeftBoldRightBold: "\u2548", + lineUpBoldDownLeftBoldRightBold: "\u2547", + lineUpBoldDownBoldLeftRightBold: "\u254A", + lineUpBoldDownBoldLeftBoldRight: "\u2549", + lineUpBoldDownLeftRight: "\u2540", + lineUpDownBoldLeftRight: "\u2541", + lineUpDownLeftBoldRight: "\u253D", + lineUpDownLeftRightBold: "\u253E", + lineUpBoldDownBoldLeftRight: "\u2542", + lineUpDownLeftBoldRightBold: "\u253F", + lineUpBoldDownLeftBoldRight: "\u2543", + lineUpBoldDownLeftRightBold: "\u2544", + lineUpDownBoldLeftBoldRight: "\u2545", + lineUpDownBoldLeftRightBold: "\u2546", + lineUpDoubleDownDoubleLeftDoubleRightDouble: "\u256C", + lineUpDoubleDownDoubleLeftRight: "\u256B", + lineUpDownLeftDoubleRightDouble: "\u256A", + lineCross: "\u2573", + lineBackslash: "\u2572", + lineSlash: "\u2571" +}; +var specialMainSymbols = { + tick: "\u2714", + info: "\u2139", + warning: "\u26A0", + cross: "\u2718", + squareSmall: "\u25FB", + squareSmallFilled: "\u25FC", + circle: "\u25EF", + circleFilled: "\u25C9", + circleDotted: "\u25CC", + circleDouble: "\u25CE", + circleCircle: "\u24DE", + circleCross: "\u24E7", + circlePipe: "\u24BE", + radioOn: "\u25C9", + radioOff: "\u25EF", + checkboxOn: "\u2612", + checkboxOff: "\u2610", + checkboxCircleOn: "\u24E7", + checkboxCircleOff: "\u24BE", + pointer: "\u276F", + triangleUpOutline: "\u25B3", + triangleLeft: "\u25C0", + triangleRight: "\u25B6", + lozenge: "\u25C6", + lozengeOutline: "\u25C7", + hamburger: "\u2630", + smiley: "\u32E1", + mustache: "\u0DF4", + star: "\u2605", + play: "\u25B6", + nodejs: "\u2B22", + oneSeventh: "\u2150", + oneNinth: "\u2151", + oneTenth: "\u2152" +}; +var specialFallbackSymbols = { + tick: "\u221A", + info: "i", + warning: "\u203C", + cross: "\xD7", + squareSmall: "\u25A1", + squareSmallFilled: "\u25A0", + circle: "( )", + circleFilled: "(*)", + circleDotted: "( )", + circleDouble: "( )", + circleCircle: "(\u25CB)", + circleCross: "(\xD7)", + circlePipe: "(\u2502)", + radioOn: "(*)", + radioOff: "( )", + checkboxOn: "[\xD7]", + checkboxOff: "[ ]", + checkboxCircleOn: "(\xD7)", + checkboxCircleOff: "( )", + pointer: ">", + triangleUpOutline: "\u2206", + triangleLeft: "\u25C4", + triangleRight: "\u25BA", + lozenge: "\u2666", + lozengeOutline: "\u25CA", + hamburger: "\u2261", + smiley: "\u263A", + mustache: "\u250C\u2500\u2510", + star: "\u2736", + play: "\u25BA", + nodejs: "\u2666", + oneSeventh: "1/7", + oneNinth: "1/9", + oneTenth: "1/10" +}; +var mainSymbols = { ...common, ...specialMainSymbols }; +var fallbackSymbols = { ...common, ...specialFallbackSymbols }; +var shouldUseMain = isUnicodeSupported(); +var figures = shouldUseMain ? mainSymbols : fallbackSymbols; +var figures_default = figures; +var replacements = Object.entries(specialMainSymbols); + +// node_modules/yoctocolors/base.js +var import_node_tty3 = __toESM(require("node:tty"), 1); +var hasColors = import_node_tty3.default?.WriteStream?.prototype?.hasColors?.() ?? false; +var format = (open, close) => { + if (!hasColors) { + return (input) => input; + } + const openCode = `\x1B[${open}m`; + const closeCode = `\x1B[${close}m`; + return (input) => { + const string = input + ""; + let index = string.indexOf(closeCode); + if (index === -1) { + return openCode + string + closeCode; + } + let result = openCode; + let lastIndex = 0; + while (index !== -1) { + result += string.slice(lastIndex, index) + openCode; + lastIndex = index + closeCode.length; + index = string.indexOf(closeCode, lastIndex); + } + result += string.slice(lastIndex) + closeCode; + return result; + }; +}; +var reset = format(0, 0); +var bold = format(1, 22); +var dim = format(2, 22); +var italic = format(3, 23); +var underline = format(4, 24); +var overline = format(53, 55); +var inverse = format(7, 27); +var hidden = format(8, 28); +var strikethrough = format(9, 29); +var black = format(30, 39); +var red = format(31, 39); +var green = format(32, 39); +var yellow = format(33, 39); +var blue = format(34, 39); +var magenta = format(35, 39); +var cyan = format(36, 39); +var white = format(37, 39); +var gray = format(90, 39); +var bgBlack = format(40, 49); +var bgRed = format(41, 49); +var bgGreen = format(42, 49); +var bgYellow = format(43, 49); +var bgBlue = format(44, 49); +var bgMagenta = format(45, 49); +var bgCyan = format(46, 49); +var bgWhite = format(47, 49); +var bgGray = format(100, 49); +var redBright = format(91, 39); +var greenBright = format(92, 39); +var yellowBright = format(93, 39); +var blueBright = format(94, 39); +var magentaBright = format(95, 39); +var cyanBright = format(96, 39); +var whiteBright = format(97, 39); +var bgRedBright = format(101, 49); +var bgGreenBright = format(102, 49); +var bgYellowBright = format(103, 49); +var bgBlueBright = format(104, 49); +var bgMagentaBright = format(105, 49); +var bgCyanBright = format(106, 49); +var bgWhiteBright = format(107, 49); + +// node_modules/execa/lib/verbose/default.js +var defaultVerboseFunction = ({ + type: type2, + message, + timestamp, + piped, + commandId, + result: { failed = false } = {}, + options: { reject = true } +}) => { + const timestampString = serializeTimestamp(timestamp); + const icon = ICONS[type2]({ failed, reject, piped }); + const color = COLORS[type2]({ reject }); + return `${gray(`[${timestampString}]`)} ${gray(`[${commandId}]`)} ${color(icon)} ${color(message)}`; +}; +var serializeTimestamp = (timestamp) => `${padField(timestamp.getHours(), 2)}:${padField(timestamp.getMinutes(), 2)}:${padField(timestamp.getSeconds(), 2)}.${padField(timestamp.getMilliseconds(), 3)}`; +var padField = (field, padding) => String(field).padStart(padding, "0"); +var getFinalIcon = ({ failed, reject }) => { + if (!failed) { + return figures_default.tick; + } + return reject ? figures_default.cross : figures_default.warning; +}; +var ICONS = { + command: ({ piped }) => piped ? "|" : "$", + output: () => " ", + ipc: () => "*", + error: getFinalIcon, + duration: getFinalIcon +}; +var identity = (string) => string; +var COLORS = { + command: () => bold, + output: () => identity, + ipc: () => identity, + error: ({ reject }) => reject ? redBright : yellowBright, + duration: () => gray +}; + +// node_modules/execa/lib/verbose/custom.js +var applyVerboseOnLines = (printedLines, verboseInfo, fdNumber) => { + const verboseFunction = getVerboseFunction(verboseInfo, fdNumber); + return printedLines.map(({ verboseLine, verboseObject }) => applyVerboseFunction(verboseLine, verboseObject, verboseFunction)).filter((printedLine) => printedLine !== void 0).map((printedLine) => appendNewline(printedLine)).join(""); +}; +var applyVerboseFunction = (verboseLine, verboseObject, verboseFunction) => { + if (verboseFunction === void 0) { + return verboseLine; + } + const printedLine = verboseFunction(verboseLine, verboseObject); + if (typeof printedLine === "string") { + return printedLine; + } +}; +var appendNewline = (printedLine) => printedLine.endsWith("\n") ? printedLine : `${printedLine} +`; + +// node_modules/execa/lib/verbose/log.js +var verboseLog = ({ type: type2, verboseMessage, fdNumber, verboseInfo, result }) => { + const verboseObject = getVerboseObject({ type: type2, result, verboseInfo }); + const printedLines = getPrintedLines(verboseMessage, verboseObject); + const finalLines = applyVerboseOnLines(printedLines, verboseInfo, fdNumber); + (0, import_node_fs.writeFileSync)(STDERR_FD, finalLines); +}; +var getVerboseObject = ({ + type: type2, + result, + verboseInfo: { escapedCommand, commandId, rawOptions: { piped = false, ...options } } +}) => ({ + type: type2, + escapedCommand, + commandId: `${commandId}`, + timestamp: new Date(), + piped, + result, + options +}); +var getPrintedLines = (verboseMessage, verboseObject) => verboseMessage.split("\n").map((message) => getPrintedLine({ ...verboseObject, message })); +var getPrintedLine = (verboseObject) => { + const verboseLine = defaultVerboseFunction(verboseObject); + return { verboseLine, verboseObject }; +}; +var STDERR_FD = 2; +var serializeVerboseMessage = (message) => { + const messageString = typeof message === "string" ? message : (0, import_node_util3.inspect)(message); + const escapedMessage = escapeLines(messageString); + return escapedMessage.replaceAll(" ", " ".repeat(TAB_SIZE)); +}; +var TAB_SIZE = 2; + +// node_modules/execa/lib/verbose/start.js +var logCommand = (escapedCommand, verboseInfo) => { + if (!isVerbose(verboseInfo)) { + return; + } + verboseLog({ + type: "command", + verboseMessage: escapedCommand, + verboseInfo + }); +}; + +// node_modules/execa/lib/verbose/info.js +var getVerboseInfo = (verbose, escapedCommand, rawOptions) => { + validateVerbose(verbose); + const commandId = getCommandId(verbose); + return { + verbose, + escapedCommand, + commandId, + rawOptions + }; +}; +var getCommandId = (verbose) => isVerbose({ verbose }) ? COMMAND_ID++ : void 0; +var COMMAND_ID = 0n; +var validateVerbose = (verbose) => { + for (const fdVerbose of verbose) { + if (fdVerbose === false) { + throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`); + } + if (fdVerbose === true) { + throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`); + } + if (!VERBOSE_VALUES.includes(fdVerbose) && !isVerboseFunction(fdVerbose)) { + const allowedValues = VERBOSE_VALUES.map((allowedValue) => `'${allowedValue}'`).join(", "); + throw new TypeError(`The "verbose" option must not be ${fdVerbose}. Allowed values are: ${allowedValues} or a function.`); + } + } +}; + +// node_modules/execa/lib/return/duration.js +var import_node_process7 = require("node:process"); +var getStartTime = () => import_node_process7.hrtime.bigint(); +var getDurationMs = (startTime) => Number(import_node_process7.hrtime.bigint() - startTime) / 1e6; + +// node_modules/execa/lib/arguments/command.js +var handleCommand = (filePath, rawArguments, rawOptions) => { + const startTime = getStartTime(); + const { command, escapedCommand } = joinCommand(filePath, rawArguments); + const verbose = normalizeFdSpecificOption(rawOptions, "verbose"); + const verboseInfo = getVerboseInfo(verbose, escapedCommand, { ...rawOptions }); + logCommand(escapedCommand, verboseInfo); + return { + command, + escapedCommand, + startTime, + verboseInfo + }; +}; + +// node_modules/execa/lib/arguments/options.js +var import_node_path4 = __toESM(require("node:path"), 1); +var import_node_process11 = __toESM(require("node:process"), 1); +var import_cross_spawn = __toESM(require_cross_spawn(), 1); + +// node_modules/npm-run-path/index.js +var import_node_process8 = __toESM(require("node:process"), 1); +var import_node_path = __toESM(require("node:path"), 1); +var import_node_url2 = require("node:url"); // node_modules/npm-run-path/node_modules/path-key/index.js function pathKey(options = {}) { const { env: env2 = process.env, - platform = process.platform + platform: platform2 = process.platform } = options; - if (platform !== "win32") { + if (platform2 !== "win32") { return "PATH"; } return Object.keys(env2).reverse().find((key) => key.toUpperCase() === "PATH") || "Path"; @@ -26397,20 +26884,20 @@ function pathKey(options = {}) { // node_modules/npm-run-path/index.js var npmRunPath = ({ - cwd = import_node_process4.default.cwd(), - path: pathOption = import_node_process4.default.env[pathKey()], + cwd = import_node_process8.default.cwd(), + path: pathOption = import_node_process8.default.env[pathKey()], preferLocal = true, - execPath = import_node_process4.default.execPath, + execPath: execPath2 = import_node_process8.default.execPath, addExecPath = true } = {}) => { - const cwdString = cwd instanceof URL ? (0, import_node_url.fileURLToPath)(cwd) : cwd; + const cwdString = cwd instanceof URL ? (0, import_node_url2.fileURLToPath)(cwd) : cwd; const cwdPath = import_node_path.default.resolve(cwdString); const result = []; if (preferLocal) { applyPreferLocal(result, cwdPath); } if (addExecPath) { - applyExecPath(result, execPath, cwdPath); + applyExecPath(result, execPath2, cwdPath); } return [...result, pathOption].join(import_node_path.default.delimiter); }; @@ -26422,11 +26909,11 @@ var applyPreferLocal = (result, cwdPath) => { cwdPath = import_node_path.default.resolve(cwdPath, ".."); } }; -var applyExecPath = (result, execPath, cwdPath) => { - const execPathString = execPath instanceof URL ? (0, import_node_url.fileURLToPath)(execPath) : execPath; +var applyExecPath = (result, execPath2, cwdPath) => { + const execPathString = execPath2 instanceof URL ? (0, import_node_url2.fileURLToPath)(execPath2) : execPath2; result.push(import_node_path.default.resolve(cwdPath, execPathString, "..")); }; -var npmRunPathEnv = ({ env: env2 = import_node_process4.default.env, ...options } = {}) => { +var npmRunPathEnv = ({ env: env2 = import_node_process8.default.env, ...options } = {}) => { env2 = { ...env2 }; const pathName = pathKey({ env: env2 }); options.path = env2[pathName]; @@ -26434,84 +26921,43 @@ var npmRunPathEnv = ({ env: env2 = import_node_process4.default.env, ...options return env2; }; -// node_modules/mimic-fn/index.js -var copyProperty = (to, from, property, ignoreNonConfigurable) => { - if (property === "length" || property === "prototype") { - return; - } - if (property === "arguments" || property === "caller") { - return; - } - const toDescriptor = Object.getOwnPropertyDescriptor(to, property); - const fromDescriptor = Object.getOwnPropertyDescriptor(from, property); - if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) { - return; - } - Object.defineProperty(to, property, fromDescriptor); -}; -var canCopyProperty = function(toDescriptor, fromDescriptor) { - return toDescriptor === void 0 || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value); -}; -var changePrototype = (to, from) => { - const fromPrototype = Object.getPrototypeOf(from); - if (fromPrototype === Object.getPrototypeOf(to)) { - return; - } - Object.setPrototypeOf(to, fromPrototype); -}; -var wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}*/ -${fromBody}`; -var toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, "toString"); -var toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, "name"); -var changeToString = (to, from, name) => { - const withName = name === "" ? "" : `with ${name.trim()}() `; - const newToString = wrappedToString.bind(null, withName, from.toString()); - Object.defineProperty(newToString, "name", toStringName); - Object.defineProperty(to, "toString", { ...toStringDescriptor, value: newToString }); -}; -function mimicFunction(to, from, { ignoreNonConfigurable = false } = {}) { - const { name } = to; - for (const property of Reflect.ownKeys(from)) { - copyProperty(to, from, property, ignoreNonConfigurable); - } - changePrototype(to, from); - changeToString(to, from, name); - return to; -} +// node_modules/execa/lib/terminate/kill.js +var import_promises = require("node:timers/promises"); -// node_modules/onetime/index.js -var calledFunctions = /* @__PURE__ */ new WeakMap(); -var onetime = (function_, options = {}) => { - if (typeof function_ !== "function") { - throw new TypeError("Expected a function"); - } - let returnValue; - let callCount = 0; - const functionName = function_.displayName || function_.name || ""; - const onetime2 = function(...arguments_) { - calledFunctions.set(onetime2, ++callCount); - if (callCount === 1) { - returnValue = function_.apply(this, arguments_); - function_ = null; - } else if (options.throw === true) { - throw new Error(`Function \`${functionName}\` can only be called once`); - } - return returnValue; - }; - mimicFunction(onetime2, function_); - calledFunctions.set(onetime2, callCount); - return onetime2; +// node_modules/execa/lib/return/final-error.js +var getFinalError = (originalError, message, isSync) => { + const ErrorClass = isSync ? ExecaSyncError : ExecaError; + const options = originalError instanceof DiscardedError ? {} : { cause: originalError }; + return new ErrorClass(message, options); }; -onetime.callCount = (function_) => { - if (!calledFunctions.has(function_)) { - throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`); - } - return calledFunctions.get(function_); +var DiscardedError = class extends Error { }; -var onetime_default = onetime; +var setErrorName = (ErrorClass, value) => { + Object.defineProperty(ErrorClass.prototype, "name", { + value, + writable: true, + enumerable: false, + configurable: true + }); + Object.defineProperty(ErrorClass.prototype, execaErrorSymbol, { + value: true, + writable: false, + enumerable: false, + configurable: false + }); +}; +var isExecaError = (error) => isErrorInstance(error) && execaErrorSymbol in error; +var execaErrorSymbol = Symbol("isExecaError"); +var isErrorInstance = (value) => Object.prototype.toString.call(value) === "[object Error]"; +var ExecaError = class extends Error { +}; +setErrorName(ExecaError, ExecaError.name); +var ExecaSyncError = class extends Error { +}; +setErrorName(ExecaSyncError, ExecaSyncError.name); -// node_modules/execa/lib/error.js -var import_node_process5 = __toESM(require("node:process"), 1); +// node_modules/execa/lib/terminate/signal.js +var import_node_os4 = require("node:os"); // node_modules/human-signals/build/src/main.js var import_node_os3 = require("node:os"); @@ -26810,8 +27256,8 @@ var SIGNALS = [ // node_modules/human-signals/build/src/signals.js var getSignals = () => { const realtimeSignals = getRealtimeSignals(); - const signals = [...SIGNALS, ...realtimeSignals].map(normalizeSignal); - return signals; + const signals2 = [...SIGNALS, ...realtimeSignals].map(normalizeSignal); + return signals2; }; var normalizeSignal = ({ name, @@ -26831,8 +27277,8 @@ var normalizeSignal = ({ // node_modules/human-signals/build/src/main.js var getSignalsByName = () => { - const signals = getSignals(); - return Object.fromEntries(signals.map(getSignalByName)); + const signals2 = getSignals(); + return Object.fromEntries(signals2.map(getSignalByName)); }; var getSignalByName = ({ name, @@ -26845,13 +27291,16 @@ var getSignalByName = ({ }) => [name, { name, number, description, supported, action, forced, standard }]; var signalsByName = getSignalsByName(); var getSignalsByNumber = () => { - const signals = getSignals(); + const signals2 = getSignals(); const length = SIGRTMAX + 1; - const signalsA = Array.from({ length }, (value, number) => getSignalByNumber(number, signals)); + const signalsA = Array.from( + { length }, + (value, number) => getSignalByNumber(number, signals2) + ); return Object.assign({}, ...signalsA); }; -var getSignalByNumber = (number, signals) => { - const signal = findSignalByNumber(number, signals); +var getSignalByNumber = (number, signals2) => { + const signal = findSignalByNumber(number, signals2); if (signal === void 0) { return {}; } @@ -26868,637 +27317,5401 @@ var getSignalByNumber = (number, signals) => { } }; }; -var findSignalByNumber = (number, signals) => { - const signal = signals.find(({ name }) => import_node_os3.constants.signals[name] === number); +var findSignalByNumber = (number, signals2) => { + const signal = signals2.find(({ name }) => import_node_os3.constants.signals[name] === number); if (signal !== void 0) { return signal; } - return signals.find((signalA) => signalA.number === number); + return signals2.find((signalA) => signalA.number === number); }; var signalsByNumber = getSignalsByNumber(); -// node_modules/execa/lib/error.js -var getErrorPrefix = ({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled }) => { - if (timedOut) { - return `timed out after ${timeout} milliseconds`; +// node_modules/execa/lib/terminate/signal.js +var normalizeKillSignal = (killSignal) => { + const optionName = "option `killSignal`"; + if (killSignal === 0) { + throw new TypeError(`Invalid ${optionName}: 0 cannot be used.`); } - if (isCanceled) { - return "was canceled"; - } - if (errorCode !== void 0) { - return `failed with ${errorCode}`; - } - if (signal !== void 0) { - return `was killed with ${signal} (${signalDescription})`; - } - if (exitCode !== void 0) { - return `failed with exit code ${exitCode}`; - } - return "failed"; + return normalizeSignal2(killSignal, optionName); }; -var makeError = ({ - stdout, - stderr: stderr2, - all: all3, - error, - signal, - exitCode, - command, - escapedCommand, - timedOut, - isCanceled, - killed, - parsed: { options: { timeout, cwd = import_node_process5.default.cwd() } } -}) => { - exitCode = exitCode === null ? void 0 : exitCode; - signal = signal === null ? void 0 : signal; - const signalDescription = signal === void 0 ? void 0 : signalsByName[signal].description; - const errorCode = error && error.code; - const prefix = getErrorPrefix({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled }); - const execaMessage = `Command ${prefix}: ${command}`; - const isError2 = Object.prototype.toString.call(error) === "[object Error]"; - const shortMessage = isError2 ? `${execaMessage} -${error.message}` : execaMessage; - const message = [shortMessage, stderr2, stdout].filter(Boolean).join("\n"); - if (isError2) { - error.originalMessage = error.message; - error.message = message; - } else { - error = new Error(message); +var normalizeSignalArgument = (signal) => signal === 0 ? signal : normalizeSignal2(signal, "`subprocess.kill()`'s argument"); +var normalizeSignal2 = (signalNameOrInteger, optionName) => { + if (Number.isInteger(signalNameOrInteger)) { + return normalizeSignalInteger(signalNameOrInteger, optionName); } - error.shortMessage = shortMessage; - error.command = command; - error.escapedCommand = escapedCommand; - error.exitCode = exitCode; - error.signal = signal; - error.signalDescription = signalDescription; - error.stdout = stdout; - error.stderr = stderr2; - error.cwd = cwd; - if (all3 !== void 0) { - error.all = all3; + if (typeof signalNameOrInteger === "string") { + return normalizeSignalName(signalNameOrInteger, optionName); } - if ("bufferedData" in error) { - delete error.bufferedData; + throw new TypeError(`Invalid ${optionName} ${String(signalNameOrInteger)}: it must be a string or an integer. +${getAvailableSignals()}`); +}; +var normalizeSignalInteger = (signalInteger, optionName) => { + if (signalsIntegerToName.has(signalInteger)) { + return signalsIntegerToName.get(signalInteger); } - error.failed = true; - error.timedOut = Boolean(timedOut); - error.isCanceled = isCanceled; - error.killed = killed && !timedOut; + throw new TypeError(`Invalid ${optionName} ${signalInteger}: this signal integer does not exist. +${getAvailableSignals()}`); +}; +var getSignalsIntegerToName = () => new Map(Object.entries(import_node_os4.constants.signals).reverse().map(([signalName, signalInteger]) => [signalInteger, signalName])); +var signalsIntegerToName = getSignalsIntegerToName(); +var normalizeSignalName = (signalName, optionName) => { + if (signalName in import_node_os4.constants.signals) { + return signalName; + } + if (signalName.toUpperCase() in import_node_os4.constants.signals) { + throw new TypeError(`Invalid ${optionName} '${signalName}': please rename it to '${signalName.toUpperCase()}'.`); + } + throw new TypeError(`Invalid ${optionName} '${signalName}': this signal name does not exist. +${getAvailableSignals()}`); +}; +var getAvailableSignals = () => `Available signal names: ${getAvailableSignalNames()}. +Available signal numbers: ${getAvailableSignalIntegers()}.`; +var getAvailableSignalNames = () => Object.keys(import_node_os4.constants.signals).sort().map((signalName) => `'${signalName}'`).join(", "); +var getAvailableSignalIntegers = () => [...new Set(Object.values(import_node_os4.constants.signals).sort((signalInteger, signalIntegerTwo) => signalInteger - signalIntegerTwo))].join(", "); +var getSignalDescription = (signal) => signalsByName[signal].description; + +// node_modules/execa/lib/terminate/kill.js +var normalizeForceKillAfterDelay = (forceKillAfterDelay) => { + if (forceKillAfterDelay === false) { + return forceKillAfterDelay; + } + if (forceKillAfterDelay === true) { + return DEFAULT_FORCE_KILL_TIMEOUT; + } + if (!Number.isFinite(forceKillAfterDelay) || forceKillAfterDelay < 0) { + throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${forceKillAfterDelay}\` (${typeof forceKillAfterDelay})`); + } + return forceKillAfterDelay; +}; +var DEFAULT_FORCE_KILL_TIMEOUT = 1e3 * 5; +var subprocessKill = ({ kill, options: { forceKillAfterDelay, killSignal }, onInternalError, context, controller }, signalOrError, errorArgument) => { + const { signal, error } = parseKillArguments(signalOrError, errorArgument, killSignal); + emitKillError(error, onInternalError); + const killResult = kill(signal); + setKillTimeout({ + kill, + signal, + forceKillAfterDelay, + killSignal, + killResult, + context, + controller + }); + return killResult; +}; +var parseKillArguments = (signalOrError, errorArgument, killSignal) => { + const [signal = killSignal, error] = isErrorInstance(signalOrError) ? [void 0, signalOrError] : [signalOrError, errorArgument]; + if (typeof signal !== "string" && !Number.isInteger(signal)) { + throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(signal)}`); + } + if (error !== void 0 && !isErrorInstance(error)) { + throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${error}`); + } + return { signal: normalizeSignalArgument(signal), error }; +}; +var emitKillError = (error, onInternalError) => { + if (error !== void 0) { + onInternalError.reject(error); + } +}; +var setKillTimeout = async ({ kill, signal, forceKillAfterDelay, killSignal, killResult, context, controller }) => { + if (signal === killSignal && killResult) { + killOnTimeout({ + kill, + forceKillAfterDelay, + context, + controllerSignal: controller.signal + }); + } +}; +var killOnTimeout = async ({ kill, forceKillAfterDelay, context, controllerSignal }) => { + if (forceKillAfterDelay === false) { + return; + } + try { + await (0, import_promises.setTimeout)(forceKillAfterDelay, void 0, { signal: controllerSignal }); + if (kill("SIGKILL")) { + context.isForcefullyTerminated ??= true; + } + } catch { + } +}; + +// node_modules/execa/lib/utils/abort-signal.js +var import_node_events = require("node:events"); +var onAbortedSignal = async (mainSignal, stopSignal) => { + if (!mainSignal.aborted) { + await (0, import_node_events.once)(mainSignal, "abort", { signal: stopSignal }); + } +}; + +// node_modules/execa/lib/terminate/cancel.js +var validateCancelSignal = ({ cancelSignal }) => { + if (cancelSignal !== void 0 && Object.prototype.toString.call(cancelSignal) !== "[object AbortSignal]") { + throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(cancelSignal)}`); + } +}; +var throwOnCancel = ({ subprocess, cancelSignal, gracefulCancel, context, controller }) => cancelSignal === void 0 || gracefulCancel ? [] : [terminateOnCancel(subprocess, cancelSignal, context, controller)]; +var terminateOnCancel = async (subprocess, cancelSignal, context, { signal }) => { + await onAbortedSignal(cancelSignal, signal); + context.terminationReason ??= "cancel"; + subprocess.kill(); + throw cancelSignal.reason; +}; + +// node_modules/execa/lib/ipc/graceful.js +var import_promises3 = require("node:timers/promises"); + +// node_modules/execa/lib/ipc/send.js +var import_node_util4 = require("node:util"); + +// node_modules/execa/lib/ipc/validation.js +var validateIpcMethod = ({ methodName, isSubprocess, ipc, isConnected: isConnected2 }) => { + validateIpcOption(methodName, isSubprocess, ipc); + validateConnection(methodName, isSubprocess, isConnected2); +}; +var validateIpcOption = (methodName, isSubprocess, ipc) => { + if (!ipc) { + throw new Error(`${getMethodName(methodName, isSubprocess)} can only be used if the \`ipc\` option is \`true\`.`); + } +}; +var validateConnection = (methodName, isSubprocess, isConnected2) => { + if (!isConnected2) { + throw new Error(`${getMethodName(methodName, isSubprocess)} cannot be used: the ${getOtherProcessName(isSubprocess)} has already exited or disconnected.`); + } +}; +var throwOnEarlyDisconnect = (isSubprocess) => { + throw new Error(`${getMethodName("getOneMessage", isSubprocess)} could not complete: the ${getOtherProcessName(isSubprocess)} exited or disconnected.`); +}; +var throwOnStrictDeadlockError = (isSubprocess) => { + throw new Error(`${getMethodName("sendMessage", isSubprocess)} failed: the ${getOtherProcessName(isSubprocess)} is sending a message too, instead of listening to incoming messages. +This can be fixed by both sending a message and listening to incoming messages at the same time: + +const [receivedMessage] = await Promise.all([ + ${getMethodName("getOneMessage", isSubprocess)}, + ${getMethodName("sendMessage", isSubprocess, "message, {strict: true}")}, +]);`); +}; +var getStrictResponseError = (error, isSubprocess) => new Error(`${getMethodName("sendMessage", isSubprocess)} failed when sending an acknowledgment response to the ${getOtherProcessName(isSubprocess)}.`, { cause: error }); +var throwOnMissingStrict = (isSubprocess) => { + throw new Error(`${getMethodName("sendMessage", isSubprocess)} failed: the ${getOtherProcessName(isSubprocess)} is not listening to incoming messages.`); +}; +var throwOnStrictDisconnect = (isSubprocess) => { + throw new Error(`${getMethodName("sendMessage", isSubprocess)} failed: the ${getOtherProcessName(isSubprocess)} exited without listening to incoming messages.`); +}; +var getAbortDisconnectError = () => new Error(`\`cancelSignal\` aborted: the ${getOtherProcessName(true)} disconnected.`); +var throwOnMissingParent = () => { + throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option."); +}; +var handleEpipeError = ({ error, methodName, isSubprocess }) => { + if (error.code === "EPIPE") { + throw new Error(`${getMethodName(methodName, isSubprocess)} cannot be used: the ${getOtherProcessName(isSubprocess)} is disconnecting.`, { cause: error }); + } +}; +var handleSerializationError = ({ error, methodName, isSubprocess, message }) => { + if (isSerializationError(error)) { + throw new Error(`${getMethodName(methodName, isSubprocess)}'s argument type is invalid: the message cannot be serialized: ${String(message)}.`, { cause: error }); + } +}; +var isSerializationError = ({ code, message }) => SERIALIZATION_ERROR_CODES.has(code) || SERIALIZATION_ERROR_MESSAGES.some((serializationErrorMessage) => message.includes(serializationErrorMessage)); +var SERIALIZATION_ERROR_CODES = /* @__PURE__ */ new Set([ + "ERR_MISSING_ARGS", + "ERR_INVALID_ARG_TYPE" +]); +var SERIALIZATION_ERROR_MESSAGES = [ + "could not be cloned", + "circular structure", + "call stack size exceeded" +]; +var getMethodName = (methodName, isSubprocess, parameters = "") => methodName === "cancelSignal" ? "`cancelSignal`'s `controller.abort()`" : `${getNamespaceName(isSubprocess)}${methodName}(${parameters})`; +var getNamespaceName = (isSubprocess) => isSubprocess ? "" : "subprocess."; +var getOtherProcessName = (isSubprocess) => isSubprocess ? "parent process" : "subprocess"; +var disconnect = (anyProcess) => { + if (anyProcess.connected) { + anyProcess.disconnect(); + } +}; + +// node_modules/execa/lib/utils/deferred.js +var createDeferred = () => { + const methods = {}; + const promise = new Promise((resolve, reject) => { + Object.assign(methods, { resolve, reject }); + }); + return Object.assign(promise, methods); +}; + +// node_modules/execa/lib/arguments/fd-options.js +var getToStream = (destination, to = "stdin") => { + const isWritable = true; + const { options, fileDescriptors } = SUBPROCESS_OPTIONS.get(destination); + const fdNumber = getFdNumber(fileDescriptors, to, isWritable); + const destinationStream = destination.stdio[fdNumber]; + if (destinationStream === null) { + throw new TypeError(getInvalidStdioOptionMessage(fdNumber, to, options, isWritable)); + } + return destinationStream; +}; +var getFromStream = (source, from = "stdout") => { + const isWritable = false; + const { options, fileDescriptors } = SUBPROCESS_OPTIONS.get(source); + const fdNumber = getFdNumber(fileDescriptors, from, isWritable); + const sourceStream = fdNumber === "all" ? source.all : source.stdio[fdNumber]; + if (sourceStream === null || sourceStream === void 0) { + throw new TypeError(getInvalidStdioOptionMessage(fdNumber, from, options, isWritable)); + } + return sourceStream; +}; +var SUBPROCESS_OPTIONS = /* @__PURE__ */ new WeakMap(); +var getFdNumber = (fileDescriptors, fdName, isWritable) => { + const fdNumber = parseFdNumber(fdName, isWritable); + validateFdNumber(fdNumber, fdName, isWritable, fileDescriptors); + return fdNumber; +}; +var parseFdNumber = (fdName, isWritable) => { + const fdNumber = parseFd(fdName); + if (fdNumber !== void 0) { + return fdNumber; + } + const { validOptions, defaultValue } = isWritable ? { validOptions: '"stdin"', defaultValue: "stdin" } : { validOptions: '"stdout", "stderr", "all"', defaultValue: "stdout" }; + throw new TypeError(`"${getOptionName(isWritable)}" must not be "${fdName}". +It must be ${validOptions} or "fd3", "fd4" (and so on). +It is optional and defaults to "${defaultValue}".`); +}; +var validateFdNumber = (fdNumber, fdName, isWritable, fileDescriptors) => { + const fileDescriptor = fileDescriptors[getUsedDescriptor(fdNumber)]; + if (fileDescriptor === void 0) { + throw new TypeError(`"${getOptionName(isWritable)}" must not be ${fdName}. That file descriptor does not exist. +Please set the "stdio" option to ensure that file descriptor exists.`); + } + if (fileDescriptor.direction === "input" && !isWritable) { + throw new TypeError(`"${getOptionName(isWritable)}" must not be ${fdName}. It must be a readable stream, not writable.`); + } + if (fileDescriptor.direction !== "input" && isWritable) { + throw new TypeError(`"${getOptionName(isWritable)}" must not be ${fdName}. It must be a writable stream, not readable.`); + } +}; +var getInvalidStdioOptionMessage = (fdNumber, fdName, options, isWritable) => { + if (fdNumber === "all" && !options.all) { + return `The "all" option must be true to use "from: 'all'".`; + } + const { optionName, optionValue } = getInvalidStdioOption(fdNumber, options); + return `The "${optionName}: ${serializeOptionValue(optionValue)}" option is incompatible with using "${getOptionName(isWritable)}: ${serializeOptionValue(fdName)}". +Please set this option with "pipe" instead.`; +}; +var getInvalidStdioOption = (fdNumber, { stdin, stdout, stderr: stderr2, stdio }) => { + const usedDescriptor = getUsedDescriptor(fdNumber); + if (usedDescriptor === 0 && stdin !== void 0) { + return { optionName: "stdin", optionValue: stdin }; + } + if (usedDescriptor === 1 && stdout !== void 0) { + return { optionName: "stdout", optionValue: stdout }; + } + if (usedDescriptor === 2 && stderr2 !== void 0) { + return { optionName: "stderr", optionValue: stderr2 }; + } + return { optionName: `stdio[${usedDescriptor}]`, optionValue: stdio[usedDescriptor] }; +}; +var getUsedDescriptor = (fdNumber) => fdNumber === "all" ? 1 : fdNumber; +var getOptionName = (isWritable) => isWritable ? "to" : "from"; +var serializeOptionValue = (value) => { + if (typeof value === "string") { + return `'${value}'`; + } + return typeof value === "number" ? `${value}` : "Stream"; +}; + +// node_modules/execa/lib/ipc/strict.js +var import_node_events5 = require("node:events"); + +// node_modules/execa/lib/utils/max-listeners.js +var import_node_events2 = require("node:events"); +var incrementMaxListeners = (eventEmitter, maxListenersIncrement, signal) => { + const maxListeners = eventEmitter.getMaxListeners(); + if (maxListeners === 0 || maxListeners === Number.POSITIVE_INFINITY) { + return; + } + eventEmitter.setMaxListeners(maxListeners + maxListenersIncrement); + (0, import_node_events2.addAbortListener)(signal, () => { + eventEmitter.setMaxListeners(eventEmitter.getMaxListeners() - maxListenersIncrement); + }); +}; + +// node_modules/execa/lib/ipc/forward.js +var import_node_events4 = require("node:events"); + +// node_modules/execa/lib/ipc/incoming.js +var import_node_events3 = require("node:events"); +var import_promises2 = require("node:timers/promises"); + +// node_modules/execa/lib/ipc/reference.js +var addReference = (channel, reference) => { + if (reference) { + addReferenceCount(channel); + } +}; +var addReferenceCount = (channel) => { + channel.refCounted(); +}; +var removeReference = (channel, reference) => { + if (reference) { + removeReferenceCount(channel); + } +}; +var removeReferenceCount = (channel) => { + channel.unrefCounted(); +}; +var undoAddedReferences = (channel, isSubprocess) => { + if (isSubprocess) { + removeReferenceCount(channel); + removeReferenceCount(channel); + } +}; +var redoAddedReferences = (channel, isSubprocess) => { + if (isSubprocess) { + addReferenceCount(channel); + addReferenceCount(channel); + } +}; + +// node_modules/execa/lib/ipc/incoming.js +var onMessage = async ({ anyProcess, channel, isSubprocess, ipcEmitter }, wrappedMessage) => { + if (handleStrictResponse(wrappedMessage) || handleAbort(wrappedMessage)) { + return; + } + if (!INCOMING_MESSAGES.has(anyProcess)) { + INCOMING_MESSAGES.set(anyProcess, []); + } + const incomingMessages = INCOMING_MESSAGES.get(anyProcess); + incomingMessages.push(wrappedMessage); + if (incomingMessages.length > 1) { + return; + } + while (incomingMessages.length > 0) { + await waitForOutgoingMessages(anyProcess, ipcEmitter, wrappedMessage); + await import_promises2.scheduler.yield(); + const message = await handleStrictRequest({ + wrappedMessage: incomingMessages[0], + anyProcess, + channel, + isSubprocess, + ipcEmitter + }); + incomingMessages.shift(); + ipcEmitter.emit("message", message); + ipcEmitter.emit("message:done"); + } +}; +var onDisconnect = async ({ anyProcess, channel, isSubprocess, ipcEmitter, boundOnMessage }) => { + abortOnDisconnect(); + const incomingMessages = INCOMING_MESSAGES.get(anyProcess); + while (incomingMessages?.length > 0) { + await (0, import_node_events3.once)(ipcEmitter, "message:done"); + } + anyProcess.removeListener("message", boundOnMessage); + redoAddedReferences(channel, isSubprocess); + ipcEmitter.connected = false; + ipcEmitter.emit("disconnect"); +}; +var INCOMING_MESSAGES = /* @__PURE__ */ new WeakMap(); + +// node_modules/execa/lib/ipc/forward.js +var getIpcEmitter = (anyProcess, channel, isSubprocess) => { + if (IPC_EMITTERS.has(anyProcess)) { + return IPC_EMITTERS.get(anyProcess); + } + const ipcEmitter = new import_node_events4.EventEmitter(); + ipcEmitter.connected = true; + IPC_EMITTERS.set(anyProcess, ipcEmitter); + forwardEvents({ + ipcEmitter, + anyProcess, + channel, + isSubprocess + }); + return ipcEmitter; +}; +var IPC_EMITTERS = /* @__PURE__ */ new WeakMap(); +var forwardEvents = ({ ipcEmitter, anyProcess, channel, isSubprocess }) => { + const boundOnMessage = onMessage.bind(void 0, { + anyProcess, + channel, + isSubprocess, + ipcEmitter + }); + anyProcess.on("message", boundOnMessage); + anyProcess.once("disconnect", onDisconnect.bind(void 0, { + anyProcess, + channel, + isSubprocess, + ipcEmitter, + boundOnMessage + })); + undoAddedReferences(channel, isSubprocess); +}; +var isConnected = (anyProcess) => { + const ipcEmitter = IPC_EMITTERS.get(anyProcess); + return ipcEmitter === void 0 ? anyProcess.channel !== null : ipcEmitter.connected; +}; + +// node_modules/execa/lib/ipc/strict.js +var handleSendStrict = ({ anyProcess, channel, isSubprocess, message, strict }) => { + if (!strict) { + return message; + } + const ipcEmitter = getIpcEmitter(anyProcess, channel, isSubprocess); + const hasListeners = hasMessageListeners(anyProcess, ipcEmitter); + return { + id: count++, + type: REQUEST_TYPE, + message, + hasListeners + }; +}; +var count = 0n; +var validateStrictDeadlock = (outgoingMessages, wrappedMessage) => { + if (wrappedMessage?.type !== REQUEST_TYPE || wrappedMessage.hasListeners) { + return; + } + for (const { id } of outgoingMessages) { + if (id !== void 0) { + STRICT_RESPONSES[id].resolve({ isDeadlock: true, hasListeners: false }); + } + } +}; +var handleStrictRequest = async ({ wrappedMessage, anyProcess, channel, isSubprocess, ipcEmitter }) => { + if (wrappedMessage?.type !== REQUEST_TYPE || !anyProcess.connected) { + return wrappedMessage; + } + const { id, message } = wrappedMessage; + const response = { id, type: RESPONSE_TYPE, message: hasMessageListeners(anyProcess, ipcEmitter) }; + try { + await sendMessage({ + anyProcess, + channel, + isSubprocess, + ipc: true + }, response); + } catch (error) { + ipcEmitter.emit("strict:error", error); + } + return message; +}; +var handleStrictResponse = (wrappedMessage) => { + if (wrappedMessage?.type !== RESPONSE_TYPE) { + return false; + } + const { id, message: hasListeners } = wrappedMessage; + STRICT_RESPONSES[id]?.resolve({ isDeadlock: false, hasListeners }); + return true; +}; +var waitForStrictResponse = async (wrappedMessage, anyProcess, isSubprocess) => { + if (wrappedMessage?.type !== REQUEST_TYPE) { + return; + } + const deferred = createDeferred(); + STRICT_RESPONSES[wrappedMessage.id] = deferred; + const controller = new AbortController(); + try { + const { isDeadlock, hasListeners } = await Promise.race([ + deferred, + throwOnDisconnect(anyProcess, isSubprocess, controller) + ]); + if (isDeadlock) { + throwOnStrictDeadlockError(isSubprocess); + } + if (!hasListeners) { + throwOnMissingStrict(isSubprocess); + } + } finally { + controller.abort(); + delete STRICT_RESPONSES[wrappedMessage.id]; + } +}; +var STRICT_RESPONSES = {}; +var throwOnDisconnect = async (anyProcess, isSubprocess, { signal }) => { + incrementMaxListeners(anyProcess, 1, signal); + await (0, import_node_events5.once)(anyProcess, "disconnect", { signal }); + throwOnStrictDisconnect(isSubprocess); +}; +var REQUEST_TYPE = "execa:ipc:request"; +var RESPONSE_TYPE = "execa:ipc:response"; + +// node_modules/execa/lib/ipc/outgoing.js +var startSendMessage = (anyProcess, wrappedMessage, strict) => { + if (!OUTGOING_MESSAGES.has(anyProcess)) { + OUTGOING_MESSAGES.set(anyProcess, /* @__PURE__ */ new Set()); + } + const outgoingMessages = OUTGOING_MESSAGES.get(anyProcess); + const onMessageSent = createDeferred(); + const id = strict ? wrappedMessage.id : void 0; + const outgoingMessage = { onMessageSent, id }; + outgoingMessages.add(outgoingMessage); + return { outgoingMessages, outgoingMessage }; +}; +var endSendMessage = ({ outgoingMessages, outgoingMessage }) => { + outgoingMessages.delete(outgoingMessage); + outgoingMessage.onMessageSent.resolve(); +}; +var waitForOutgoingMessages = async (anyProcess, ipcEmitter, wrappedMessage) => { + while (!hasMessageListeners(anyProcess, ipcEmitter) && OUTGOING_MESSAGES.get(anyProcess)?.size > 0) { + const outgoingMessages = [...OUTGOING_MESSAGES.get(anyProcess)]; + validateStrictDeadlock(outgoingMessages, wrappedMessage); + await Promise.all(outgoingMessages.map(({ onMessageSent }) => onMessageSent)); + } +}; +var OUTGOING_MESSAGES = /* @__PURE__ */ new WeakMap(); +var hasMessageListeners = (anyProcess, ipcEmitter) => ipcEmitter.listenerCount("message") > getMinListenerCount(anyProcess); +var getMinListenerCount = (anyProcess) => SUBPROCESS_OPTIONS.has(anyProcess) && !getFdSpecificValue(SUBPROCESS_OPTIONS.get(anyProcess).options.buffer, "ipc") ? 1 : 0; + +// node_modules/execa/lib/ipc/send.js +var sendMessage = ({ anyProcess, channel, isSubprocess, ipc }, message, { strict = false } = {}) => { + const methodName = "sendMessage"; + validateIpcMethod({ + methodName, + isSubprocess, + ipc, + isConnected: anyProcess.connected + }); + return sendMessageAsync({ + anyProcess, + channel, + methodName, + isSubprocess, + message, + strict + }); +}; +var sendMessageAsync = async ({ anyProcess, channel, methodName, isSubprocess, message, strict }) => { + const wrappedMessage = handleSendStrict({ + anyProcess, + channel, + isSubprocess, + message, + strict + }); + const outgoingMessagesState = startSendMessage(anyProcess, wrappedMessage, strict); + try { + await sendOneMessage({ + anyProcess, + methodName, + isSubprocess, + wrappedMessage, + message + }); + } catch (error) { + disconnect(anyProcess); + throw error; + } finally { + endSendMessage(outgoingMessagesState); + } +}; +var sendOneMessage = async ({ anyProcess, methodName, isSubprocess, wrappedMessage, message }) => { + const sendMethod = getSendMethod(anyProcess); + try { + await Promise.all([ + waitForStrictResponse(wrappedMessage, anyProcess, isSubprocess), + sendMethod(wrappedMessage) + ]); + } catch (error) { + handleEpipeError({ error, methodName, isSubprocess }); + handleSerializationError({ + error, + methodName, + isSubprocess, + message + }); + throw error; + } +}; +var getSendMethod = (anyProcess) => { + if (PROCESS_SEND_METHODS.has(anyProcess)) { + return PROCESS_SEND_METHODS.get(anyProcess); + } + const sendMethod = (0, import_node_util4.promisify)(anyProcess.send.bind(anyProcess)); + PROCESS_SEND_METHODS.set(anyProcess, sendMethod); + return sendMethod; +}; +var PROCESS_SEND_METHODS = /* @__PURE__ */ new WeakMap(); + +// node_modules/execa/lib/ipc/graceful.js +var sendAbort = (subprocess, message) => { + const methodName = "cancelSignal"; + validateConnection(methodName, false, subprocess.connected); + return sendOneMessage({ + anyProcess: subprocess, + methodName, + isSubprocess: false, + wrappedMessage: { type: GRACEFUL_CANCEL_TYPE, message }, + message + }); +}; +var getCancelSignal = async ({ anyProcess, channel, isSubprocess, ipc }) => { + await startIpc({ + anyProcess, + channel, + isSubprocess, + ipc + }); + return cancelController.signal; +}; +var startIpc = async ({ anyProcess, channel, isSubprocess, ipc }) => { + if (cancelListening) { + return; + } + cancelListening = true; + if (!ipc) { + throwOnMissingParent(); + return; + } + if (channel === null) { + abortOnDisconnect(); + return; + } + getIpcEmitter(anyProcess, channel, isSubprocess); + await import_promises3.scheduler.yield(); +}; +var cancelListening = false; +var handleAbort = (wrappedMessage) => { + if (wrappedMessage?.type !== GRACEFUL_CANCEL_TYPE) { + return false; + } + cancelController.abort(wrappedMessage.message); + return true; +}; +var GRACEFUL_CANCEL_TYPE = "execa:ipc:cancel"; +var abortOnDisconnect = () => { + cancelController.abort(getAbortDisconnectError()); +}; +var cancelController = new AbortController(); + +// node_modules/execa/lib/terminate/graceful.js +var validateGracefulCancel = ({ gracefulCancel, cancelSignal, ipc, serialization }) => { + if (!gracefulCancel) { + return; + } + if (cancelSignal === void 0) { + throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option."); + } + if (!ipc) { + throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option."); + } + if (serialization === "json") { + throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option."); + } +}; +var throwOnGracefulCancel = ({ + subprocess, + cancelSignal, + gracefulCancel, + forceKillAfterDelay, + context, + controller +}) => gracefulCancel ? [sendOnAbort({ + subprocess, + cancelSignal, + forceKillAfterDelay, + context, + controller +})] : []; +var sendOnAbort = async ({ subprocess, cancelSignal, forceKillAfterDelay, context, controller: { signal } }) => { + await onAbortedSignal(cancelSignal, signal); + const reason = getReason(cancelSignal); + await sendAbort(subprocess, reason); + killOnTimeout({ + kill: subprocess.kill, + forceKillAfterDelay, + context, + controllerSignal: signal + }); + context.terminationReason ??= "gracefulCancel"; + throw cancelSignal.reason; +}; +var getReason = ({ reason }) => { + if (!(reason instanceof DOMException)) { + return reason; + } + const error = new Error(reason.message); + Object.defineProperty(error, "stack", { + value: reason.stack, + enumerable: false, + configurable: true, + writable: true + }); return error; }; -// node_modules/execa/lib/stdio.js -var aliases = ["stdin", "stdout", "stderr"]; -var hasAlias = (options) => aliases.some((alias) => options[alias] !== void 0); -var normalizeStdio = (options) => { - if (!options) { - return; - } - const { stdio } = options; - if (stdio === void 0) { - return aliases.map((alias) => options[alias]); - } - if (hasAlias(options)) { - throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map((alias) => `\`${alias}\``).join(", ")}`); - } - if (typeof stdio === "string") { - return stdio; - } - if (!Array.isArray(stdio)) { - throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``); - } - const length = Math.max(stdio.length, aliases.length); - return Array.from({ length }, (value, index) => stdio[index]); -}; - -// node_modules/execa/lib/kill.js -var import_node_os4 = __toESM(require("node:os"), 1); -var import_signal_exit = __toESM(require_signal_exit(), 1); -var DEFAULT_FORCE_KILL_TIMEOUT = 1e3 * 5; -var spawnedKill = (kill, signal = "SIGTERM", options = {}) => { - const killResult = kill(signal); - setKillTimeout(kill, signal, options, killResult); - return killResult; -}; -var setKillTimeout = (kill, signal, options, killResult) => { - if (!shouldForceKill(signal, options, killResult)) { - return; - } - const timeout = getForceKillAfterTimeout(options); - const t2 = setTimeout(() => { - kill("SIGKILL"); - }, timeout); - if (t2.unref) { - t2.unref(); - } -}; -var shouldForceKill = (signal, { forceKillAfterTimeout }, killResult) => isSigterm(signal) && forceKillAfterTimeout !== false && killResult; -var isSigterm = (signal) => signal === import_node_os4.default.constants.signals.SIGTERM || typeof signal === "string" && signal.toUpperCase() === "SIGTERM"; -var getForceKillAfterTimeout = ({ forceKillAfterTimeout = true }) => { - if (forceKillAfterTimeout === true) { - return DEFAULT_FORCE_KILL_TIMEOUT; - } - if (!Number.isFinite(forceKillAfterTimeout) || forceKillAfterTimeout < 0) { - throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${forceKillAfterTimeout}\` (${typeof forceKillAfterTimeout})`); - } - return forceKillAfterTimeout; -}; -var spawnedCancel = (spawned, context) => { - const killResult = spawned.kill(); - if (killResult) { - context.isCanceled = true; - } -}; -var timeoutKill = (spawned, signal, reject) => { - spawned.kill(signal); - reject(Object.assign(new Error("Timed out"), { timedOut: true, signal })); -}; -var setupTimeout = (spawned, { timeout, killSignal = "SIGTERM" }, spawnedPromise) => { - if (timeout === 0 || timeout === void 0) { - return spawnedPromise; - } - let timeoutId; - const timeoutPromise = new Promise((resolve, reject) => { - timeoutId = setTimeout(() => { - timeoutKill(spawned, killSignal, reject); - }, timeout); - }); - const safeSpawnedPromise = spawnedPromise.finally(() => { - clearTimeout(timeoutId); - }); - return Promise.race([timeoutPromise, safeSpawnedPromise]); -}; +// node_modules/execa/lib/terminate/timeout.js +var import_promises4 = require("node:timers/promises"); var validateTimeout = ({ timeout }) => { if (timeout !== void 0 && (!Number.isFinite(timeout) || timeout < 0)) { throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout}\` (${typeof timeout})`); } }; -var setExitHandler = async (spawned, { cleanup, detached }, timedPromise) => { - if (!cleanup || detached) { - return timedPromise; +var throwOnTimeout = (subprocess, timeout, context, controller) => timeout === 0 || timeout === void 0 ? [] : [killAfterTimeout(subprocess, timeout, context, controller)]; +var killAfterTimeout = async (subprocess, timeout, context, { signal }) => { + await (0, import_promises4.setTimeout)(timeout, void 0, { signal }); + context.terminationReason ??= "timeout"; + subprocess.kill(); + throw new DiscardedError(); +}; + +// node_modules/execa/lib/methods/node.js +var import_node_process9 = require("node:process"); +var import_node_path2 = __toESM(require("node:path"), 1); +var mapNode = ({ options }) => { + if (options.node === false) { + throw new TypeError('The "node" option cannot be false with `execaNode()`.'); } - const removeExitHandler = (0, import_signal_exit.default)(() => { - spawned.kill(); + return { options: { ...options, node: true } }; +}; +var handleNodeOption = (file, commandArguments, { + node: shouldHandleNode = false, + nodePath = import_node_process9.execPath, + nodeOptions = import_node_process9.execArgv.filter((nodeOption) => !nodeOption.startsWith("--inspect")), + cwd, + execPath: formerNodePath, + ...options +}) => { + if (formerNodePath !== void 0) { + throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.'); + } + const normalizedNodePath = safeNormalizeFileUrl(nodePath, 'The "nodePath" option'); + const resolvedNodePath = import_node_path2.default.resolve(cwd, normalizedNodePath); + const newOptions = { + ...options, + nodePath: resolvedNodePath, + node: shouldHandleNode, + cwd + }; + if (!shouldHandleNode) { + return [file, commandArguments, newOptions]; + } + if (import_node_path2.default.basename(file, ".exe") === "node") { + throw new TypeError('When the "node" option is true, the first argument does not need to be "node".'); + } + return [ + resolvedNodePath, + [...nodeOptions, file, ...commandArguments], + { ipc: true, ...newOptions, shell: false } + ]; +}; + +// node_modules/execa/lib/ipc/ipc-input.js +var import_node_v8 = require("node:v8"); +var validateIpcInputOption = ({ ipcInput, ipc, serialization }) => { + if (ipcInput === void 0) { + return; + } + if (!ipc) { + throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`."); + } + validateIpcInput[serialization](ipcInput); +}; +var validateAdvancedInput = (ipcInput) => { + try { + (0, import_node_v8.serialize)(ipcInput); + } catch (error) { + throw new Error("The `ipcInput` option is not serializable with a structured clone.", { cause: error }); + } +}; +var validateJsonInput = (ipcInput) => { + try { + JSON.stringify(ipcInput); + } catch (error) { + throw new Error("The `ipcInput` option is not serializable with JSON.", { cause: error }); + } +}; +var validateIpcInput = { + advanced: validateAdvancedInput, + json: validateJsonInput +}; +var sendIpcInput = async (subprocess, ipcInput) => { + if (ipcInput === void 0) { + return; + } + await subprocess.sendMessage(ipcInput); +}; + +// node_modules/execa/lib/arguments/encoding-option.js +var validateEncoding = ({ encoding }) => { + if (ENCODINGS.has(encoding)) { + return; + } + const correctEncoding = getCorrectEncoding(encoding); + if (correctEncoding !== void 0) { + throw new TypeError(`Invalid option \`encoding: ${serializeEncoding(encoding)}\`. +Please rename it to ${serializeEncoding(correctEncoding)}.`); + } + const correctEncodings = [...ENCODINGS].map((correctEncoding2) => serializeEncoding(correctEncoding2)).join(", "); + throw new TypeError(`Invalid option \`encoding: ${serializeEncoding(encoding)}\`. +Please rename it to one of: ${correctEncodings}.`); +}; +var TEXT_ENCODINGS = /* @__PURE__ */ new Set(["utf8", "utf16le"]); +var BINARY_ENCODINGS = /* @__PURE__ */ new Set(["buffer", "hex", "base64", "base64url", "latin1", "ascii"]); +var ENCODINGS = /* @__PURE__ */ new Set([...TEXT_ENCODINGS, ...BINARY_ENCODINGS]); +var getCorrectEncoding = (encoding) => { + if (encoding === null) { + return "buffer"; + } + if (typeof encoding !== "string") { + return; + } + const lowerEncoding = encoding.toLowerCase(); + if (lowerEncoding in ENCODING_ALIASES) { + return ENCODING_ALIASES[lowerEncoding]; + } + if (ENCODINGS.has(lowerEncoding)) { + return lowerEncoding; + } +}; +var ENCODING_ALIASES = { + "utf-8": "utf8", + "utf-16le": "utf16le", + "ucs-2": "utf16le", + ucs2: "utf16le", + binary: "latin1" +}; +var serializeEncoding = (encoding) => typeof encoding === "string" ? `"${encoding}"` : String(encoding); + +// node_modules/execa/lib/arguments/cwd.js +var import_node_fs2 = require("node:fs"); +var import_node_path3 = __toESM(require("node:path"), 1); +var import_node_process10 = __toESM(require("node:process"), 1); +var normalizeCwd = (cwd = getDefaultCwd()) => { + const cwdString = safeNormalizeFileUrl(cwd, 'The "cwd" option'); + return import_node_path3.default.resolve(cwdString); +}; +var getDefaultCwd = () => { + try { + return import_node_process10.default.cwd(); + } catch (error) { + error.message = `The current directory does not exist. +${error.message}`; + throw error; + } +}; +var fixCwdError = (originalMessage, cwd) => { + if (cwd === getDefaultCwd()) { + return originalMessage; + } + let cwdStat; + try { + cwdStat = (0, import_node_fs2.statSync)(cwd); + } catch (error) { + return `The "cwd" option is invalid: ${cwd}. +${error.message} +${originalMessage}`; + } + if (!cwdStat.isDirectory()) { + return `The "cwd" option is not a directory: ${cwd}. +${originalMessage}`; + } + return originalMessage; +}; + +// node_modules/execa/lib/arguments/options.js +var normalizeOptions = (filePath, rawArguments, rawOptions) => { + rawOptions.cwd = normalizeCwd(rawOptions.cwd); + const [processedFile, processedArguments, processedOptions] = handleNodeOption(filePath, rawArguments, rawOptions); + const { command: file, args: commandArguments, options: initialOptions } = import_cross_spawn.default._parse(processedFile, processedArguments, processedOptions); + const fdOptions = normalizeFdSpecificOptions(initialOptions); + const options = addDefaultOptions(fdOptions); + validateTimeout(options); + validateEncoding(options); + validateIpcInputOption(options); + validateCancelSignal(options); + validateGracefulCancel(options); + options.shell = normalizeFileUrl(options.shell); + options.env = getEnv(options); + options.killSignal = normalizeKillSignal(options.killSignal); + options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay); + options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]); + if (import_node_process11.default.platform === "win32" && import_node_path4.default.basename(file, ".exe") === "cmd") { + commandArguments.unshift("/q"); + } + return { file, commandArguments, options }; +}; +var addDefaultOptions = ({ + extendEnv = true, + preferLocal = false, + cwd, + localDir: localDirectory = cwd, + encoding = "utf8", + reject = true, + cleanup = true, + all: all3 = false, + windowsHide = true, + killSignal = "SIGTERM", + forceKillAfterDelay = true, + gracefulCancel = false, + ipcInput, + ipc = ipcInput !== void 0 || gracefulCancel, + serialization = "advanced", + ...options +}) => ({ + ...options, + extendEnv, + preferLocal, + cwd, + localDirectory, + encoding, + reject, + cleanup, + all: all3, + windowsHide, + killSignal, + forceKillAfterDelay, + gracefulCancel, + ipcInput, + ipc, + serialization +}); +var getEnv = ({ env: envOption, extendEnv, preferLocal, node, localDirectory, nodePath }) => { + const env2 = extendEnv ? { ...import_node_process11.default.env, ...envOption } : envOption; + if (preferLocal || node) { + return npmRunPathEnv({ + env: env2, + cwd: localDirectory, + execPath: nodePath, + preferLocal, + addExecPath: node + }); + } + return env2; +}; + +// node_modules/execa/lib/return/message.js +var import_node_util5 = require("node:util"); + +// node_modules/execa/node_modules/strip-final-newline/index.js +function stripFinalNewline(input) { + if (typeof input === "string") { + return stripFinalNewlineString(input); + } + if (!(ArrayBuffer.isView(input) && input.BYTES_PER_ELEMENT === 1)) { + throw new Error("Input must be a string or a Uint8Array"); + } + return stripFinalNewlineBinary(input); +} +var stripFinalNewlineString = (input) => input.at(-1) === LF ? input.slice(0, input.at(-2) === CR ? -2 : -1) : input; +var stripFinalNewlineBinary = (input) => input.at(-1) === LF_BINARY ? input.subarray(0, input.at(-2) === CR_BINARY ? -2 : -1) : input; +var LF = "\n"; +var LF_BINARY = LF.codePointAt(0); +var CR = "\r"; +var CR_BINARY = CR.codePointAt(0); + +// node_modules/execa/node_modules/get-stream/source/index.js +var import_node_events6 = require("node:events"); +var import_promises5 = require("node:stream/promises"); + +// node_modules/is-stream/index.js +function isStream(stream4, { checkOpen = true } = {}) { + return stream4 !== null && typeof stream4 === "object" && (stream4.writable || stream4.readable || !checkOpen || stream4.writable === void 0 && stream4.readable === void 0) && typeof stream4.pipe === "function"; +} +function isWritableStream(stream4, { checkOpen = true } = {}) { + return isStream(stream4, { checkOpen }) && (stream4.writable || !checkOpen) && typeof stream4.write === "function" && typeof stream4.end === "function" && typeof stream4.writable === "boolean" && typeof stream4.writableObjectMode === "boolean" && typeof stream4.destroy === "function" && typeof stream4.destroyed === "boolean"; +} +function isReadableStream(stream4, { checkOpen = true } = {}) { + return isStream(stream4, { checkOpen }) && (stream4.readable || !checkOpen) && typeof stream4.read === "function" && typeof stream4.readable === "boolean" && typeof stream4.readableObjectMode === "boolean" && typeof stream4.destroy === "function" && typeof stream4.destroyed === "boolean"; +} +function isDuplexStream(stream4, options) { + return isWritableStream(stream4, options) && isReadableStream(stream4, options); +} + +// node_modules/@sec-ant/readable-stream/dist/ponyfill/asyncIterator.js +var a3 = Object.getPrototypeOf( + Object.getPrototypeOf( + async function* () { + } + ).prototype +); +var c2 = class { + #t; + #n; + #r = false; + #e = void 0; + constructor(e3, t2) { + this.#t = e3, this.#n = t2; + } + next() { + const e3 = () => this.#s(); + return this.#e = this.#e ? this.#e.then(e3, e3) : e3(), this.#e; + } + return(e3) { + const t2 = () => this.#i(e3); + return this.#e ? this.#e.then(t2, t2) : t2(); + } + async #s() { + if (this.#r) + return { + done: true, + value: void 0 + }; + let e3; + try { + e3 = await this.#t.read(); + } catch (t2) { + throw this.#e = void 0, this.#r = true, this.#t.releaseLock(), t2; + } + return e3.done && (this.#e = void 0, this.#r = true, this.#t.releaseLock()), e3; + } + async #i(e3) { + if (this.#r) + return { + done: true, + value: e3 + }; + if (this.#r = true, !this.#n) { + const t2 = this.#t.cancel(e3); + return this.#t.releaseLock(), await t2, { + done: true, + value: e3 + }; + } + return this.#t.releaseLock(), { + done: true, + value: e3 + }; + } +}; +var n = Symbol(); +function i2() { + return this[n].next(); +} +Object.defineProperty(i2, "name", { value: "next" }); +function o2(r3) { + return this[n].return(r3); +} +Object.defineProperty(o2, "name", { value: "return" }); +var u2 = Object.create(a3, { + next: { + enumerable: true, + configurable: true, + writable: true, + value: i2 + }, + return: { + enumerable: true, + configurable: true, + writable: true, + value: o2 + } +}); +function h3({ preventCancel: r3 = false } = {}) { + const e3 = this.getReader(), t2 = new c2( + e3, + r3 + ), s2 = Object.create(u2); + return s2[n] = t2, s2; +} + +// node_modules/execa/node_modules/get-stream/source/stream.js +var getAsyncIterable = (stream4) => { + if (isReadableStream(stream4, { checkOpen: false }) && nodeImports.on !== void 0) { + return getStreamIterable(stream4); + } + if (typeof stream4?.[Symbol.asyncIterator] === "function") { + return stream4; + } + if (toString.call(stream4) === "[object ReadableStream]") { + return h3.call(stream4); + } + throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable."); +}; +var { toString } = Object.prototype; +var getStreamIterable = async function* (stream4) { + const controller = new AbortController(); + const state2 = {}; + handleStreamEnd(stream4, controller, state2); + try { + for await (const [chunk] of nodeImports.on(stream4, "data", { signal: controller.signal })) { + yield chunk; + } + } catch (error) { + if (state2.error !== void 0) { + throw state2.error; + } else if (!controller.signal.aborted) { + throw error; + } + } finally { + stream4.destroy(); + } +}; +var handleStreamEnd = async (stream4, controller, state2) => { + try { + await nodeImports.finished(stream4, { + cleanup: true, + readable: true, + writable: false, + error: false + }); + } catch (error) { + state2.error = error; + } finally { + controller.abort(); + } +}; +var nodeImports = {}; + +// node_modules/execa/node_modules/get-stream/source/contents.js +var getStreamContents = async (stream4, { init, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, finalize }, { maxBuffer = Number.POSITIVE_INFINITY } = {}) => { + const asyncIterable = getAsyncIterable(stream4); + const state2 = init(); + state2.length = 0; + try { + for await (const chunk of asyncIterable) { + const chunkType = getChunkType(chunk); + const convertedChunk = convertChunk[chunkType](chunk, state2); + appendChunk({ + convertedChunk, + state: state2, + getSize, + truncateChunk, + addChunk, + maxBuffer + }); + } + appendFinalChunk({ + state: state2, + convertChunk, + getSize, + truncateChunk, + addChunk, + getFinalChunk, + maxBuffer + }); + return finalize(state2); + } catch (error) { + const normalizedError = typeof error === "object" && error !== null ? error : new Error(error); + normalizedError.bufferedData = finalize(state2); + throw normalizedError; + } +}; +var appendFinalChunk = ({ state: state2, getSize, truncateChunk, addChunk, getFinalChunk, maxBuffer }) => { + const convertedChunk = getFinalChunk(state2); + if (convertedChunk !== void 0) { + appendChunk({ + convertedChunk, + state: state2, + getSize, + truncateChunk, + addChunk, + maxBuffer + }); + } +}; +var appendChunk = ({ convertedChunk, state: state2, getSize, truncateChunk, addChunk, maxBuffer }) => { + const chunkSize = getSize(convertedChunk); + const newLength = state2.length + chunkSize; + if (newLength <= maxBuffer) { + addNewChunk(convertedChunk, state2, addChunk, newLength); + return; + } + const truncatedChunk = truncateChunk(convertedChunk, maxBuffer - state2.length); + if (truncatedChunk !== void 0) { + addNewChunk(truncatedChunk, state2, addChunk, maxBuffer); + } + throw new MaxBufferError(); +}; +var addNewChunk = (convertedChunk, state2, addChunk, newLength) => { + state2.contents = addChunk(convertedChunk, state2, newLength); + state2.length = newLength; +}; +var getChunkType = (chunk) => { + const typeOfChunk = typeof chunk; + if (typeOfChunk === "string") { + return "string"; + } + if (typeOfChunk !== "object" || chunk === null) { + return "others"; + } + if (globalThis.Buffer?.isBuffer(chunk)) { + return "buffer"; + } + const prototypeName = objectToString2.call(chunk); + if (prototypeName === "[object ArrayBuffer]") { + return "arrayBuffer"; + } + if (prototypeName === "[object DataView]") { + return "dataView"; + } + if (Number.isInteger(chunk.byteLength) && Number.isInteger(chunk.byteOffset) && objectToString2.call(chunk.buffer) === "[object ArrayBuffer]") { + return "typedArray"; + } + return "others"; +}; +var { toString: objectToString2 } = Object.prototype; +var MaxBufferError = class extends Error { + name = "MaxBufferError"; + constructor() { + super("maxBuffer exceeded"); + } +}; + +// node_modules/execa/node_modules/get-stream/source/utils.js +var identity2 = (value) => value; +var noop = () => void 0; +var getContentsProperty = ({ contents }) => contents; +var throwObjectStream = (chunk) => { + throw new Error(`Streams in object mode are not supported: ${String(chunk)}`); +}; +var getLengthProperty = (convertedChunk) => convertedChunk.length; + +// node_modules/execa/node_modules/get-stream/source/array.js +async function getStreamAsArray(stream4, options) { + return getStreamContents(stream4, arrayMethods, options); +} +var initArray = () => ({ contents: [] }); +var increment = () => 1; +var addArrayChunk = (convertedChunk, { contents }) => { + contents.push(convertedChunk); + return contents; +}; +var arrayMethods = { + init: initArray, + convertChunk: { + string: identity2, + buffer: identity2, + arrayBuffer: identity2, + dataView: identity2, + typedArray: identity2, + others: identity2 + }, + getSize: increment, + truncateChunk: noop, + addChunk: addArrayChunk, + getFinalChunk: noop, + finalize: getContentsProperty +}; + +// node_modules/execa/node_modules/get-stream/source/array-buffer.js +async function getStreamAsArrayBuffer(stream4, options) { + return getStreamContents(stream4, arrayBufferMethods, options); +} +var initArrayBuffer = () => ({ contents: new ArrayBuffer(0) }); +var useTextEncoder = (chunk) => textEncoder2.encode(chunk); +var textEncoder2 = new TextEncoder(); +var useUint8Array = (chunk) => new Uint8Array(chunk); +var useUint8ArrayWithOffset = (chunk) => new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength); +var truncateArrayBufferChunk = (convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize); +var addArrayBufferChunk = (convertedChunk, { contents, length: previousLength }, length) => { + const newContents = hasArrayBufferResize() ? resizeArrayBuffer(contents, length) : resizeArrayBufferSlow(contents, length); + new Uint8Array(newContents).set(convertedChunk, previousLength); + return newContents; +}; +var resizeArrayBufferSlow = (contents, length) => { + if (length <= contents.byteLength) { + return contents; + } + const arrayBuffer = new ArrayBuffer(getNewContentsLength(length)); + new Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0); + return arrayBuffer; +}; +var resizeArrayBuffer = (contents, length) => { + if (length <= contents.maxByteLength) { + contents.resize(length); + return contents; + } + const arrayBuffer = new ArrayBuffer(length, { maxByteLength: getNewContentsLength(length) }); + new Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0); + return arrayBuffer; +}; +var getNewContentsLength = (length) => SCALE_FACTOR ** Math.ceil(Math.log(length) / Math.log(SCALE_FACTOR)); +var SCALE_FACTOR = 2; +var finalizeArrayBuffer = ({ contents, length }) => hasArrayBufferResize() ? contents : contents.slice(0, length); +var hasArrayBufferResize = () => "resize" in ArrayBuffer.prototype; +var arrayBufferMethods = { + init: initArrayBuffer, + convertChunk: { + string: useTextEncoder, + buffer: useUint8Array, + arrayBuffer: useUint8Array, + dataView: useUint8ArrayWithOffset, + typedArray: useUint8ArrayWithOffset, + others: throwObjectStream + }, + getSize: getLengthProperty, + truncateChunk: truncateArrayBufferChunk, + addChunk: addArrayBufferChunk, + getFinalChunk: noop, + finalize: finalizeArrayBuffer +}; + +// node_modules/execa/node_modules/get-stream/source/string.js +async function getStreamAsString(stream4, options) { + return getStreamContents(stream4, stringMethods, options); +} +var initString = () => ({ contents: "", textDecoder: new TextDecoder() }); +var useTextDecoder = (chunk, { textDecoder: textDecoder2 }) => textDecoder2.decode(chunk, { stream: true }); +var addStringChunk = (convertedChunk, { contents }) => contents + convertedChunk; +var truncateStringChunk = (convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize); +var getFinalStringChunk = ({ textDecoder: textDecoder2 }) => { + const finalChunk = textDecoder2.decode(); + return finalChunk === "" ? void 0 : finalChunk; +}; +var stringMethods = { + init: initString, + convertChunk: { + string: identity2, + buffer: useTextDecoder, + arrayBuffer: useTextDecoder, + dataView: useTextDecoder, + typedArray: useTextDecoder, + others: throwObjectStream + }, + getSize: getLengthProperty, + truncateChunk: truncateStringChunk, + addChunk: addStringChunk, + getFinalChunk: getFinalStringChunk, + finalize: getContentsProperty +}; + +// node_modules/execa/node_modules/get-stream/source/index.js +Object.assign(nodeImports, { on: import_node_events6.on, finished: import_promises5.finished }); + +// node_modules/execa/lib/io/max-buffer.js +var handleMaxBuffer = ({ error, stream: stream4, readableObjectMode, lines, encoding, fdNumber }) => { + if (!(error instanceof MaxBufferError)) { + throw error; + } + if (fdNumber === "all") { + return error; + } + const unit = getMaxBufferUnit(readableObjectMode, lines, encoding); + error.maxBufferInfo = { fdNumber, unit }; + stream4.destroy(); + throw error; +}; +var getMaxBufferUnit = (readableObjectMode, lines, encoding) => { + if (readableObjectMode) { + return "objects"; + } + if (lines) { + return "lines"; + } + if (encoding === "buffer") { + return "bytes"; + } + return "characters"; +}; +var checkIpcMaxBuffer = (subprocess, ipcOutput, maxBuffer) => { + if (ipcOutput.length !== maxBuffer) { + return; + } + const error = new MaxBufferError(); + error.maxBufferInfo = { fdNumber: "ipc" }; + throw error; +}; +var getMaxBufferMessage = (error, maxBuffer) => { + const { streamName, threshold, unit } = getMaxBufferInfo(error, maxBuffer); + return `Command's ${streamName} was larger than ${threshold} ${unit}`; +}; +var getMaxBufferInfo = (error, maxBuffer) => { + if (error?.maxBufferInfo === void 0) { + return { streamName: "output", threshold: maxBuffer[1], unit: "bytes" }; + } + const { maxBufferInfo: { fdNumber, unit } } = error; + delete error.maxBufferInfo; + const threshold = getFdSpecificValue(maxBuffer, fdNumber); + if (fdNumber === "ipc") { + return { streamName: "IPC output", threshold, unit: "messages" }; + } + return { streamName: getStreamName(fdNumber), threshold, unit }; +}; +var isMaxBufferSync = (resultError, output, maxBuffer) => resultError?.code === "ENOBUFS" && output !== null && output.some((result) => result !== null && result.length > getMaxBufferSync(maxBuffer)); +var truncateMaxBufferSync = (result, isMaxBuffer, maxBuffer) => { + if (!isMaxBuffer) { + return result; + } + const maxBufferValue = getMaxBufferSync(maxBuffer); + return result.length > maxBufferValue ? result.slice(0, maxBufferValue) : result; +}; +var getMaxBufferSync = ([, stdoutMaxBuffer]) => stdoutMaxBuffer; + +// node_modules/execa/lib/return/message.js +var createMessages = ({ + stdio, + all: all3, + ipcOutput, + originalError, + signal, + signalDescription, + exitCode, + escapedCommand, + timedOut, + isCanceled, + isGracefullyCanceled, + isMaxBuffer, + isForcefullyTerminated, + forceKillAfterDelay, + killSignal, + maxBuffer, + timeout, + cwd +}) => { + const errorCode = originalError?.code; + const prefix = getErrorPrefix({ + originalError, + timedOut, + timeout, + isMaxBuffer, + maxBuffer, + errorCode, + signal, + signalDescription, + exitCode, + isCanceled, + isGracefullyCanceled, + isForcefullyTerminated, + forceKillAfterDelay, + killSignal }); - return timedPromise.finally(() => { + const originalMessage = getOriginalMessage(originalError, cwd); + const suffix = originalMessage === void 0 ? "" : ` +${originalMessage}`; + const shortMessage = `${prefix}: ${escapedCommand}${suffix}`; + const messageStdio = all3 === void 0 ? [stdio[2], stdio[1]] : [all3]; + const message = [ + shortMessage, + ...messageStdio, + ...stdio.slice(3), + ipcOutput.map((ipcMessage) => serializeIpcMessage(ipcMessage)).join("\n") + ].map((messagePart) => escapeLines(stripFinalNewline(serializeMessagePart(messagePart)))).filter(Boolean).join("\n\n"); + return { originalMessage, shortMessage, message }; +}; +var getErrorPrefix = ({ + originalError, + timedOut, + timeout, + isMaxBuffer, + maxBuffer, + errorCode, + signal, + signalDescription, + exitCode, + isCanceled, + isGracefullyCanceled, + isForcefullyTerminated, + forceKillAfterDelay, + killSignal +}) => { + const forcefulSuffix = getForcefulSuffix(isForcefullyTerminated, forceKillAfterDelay); + if (timedOut) { + return `Command timed out after ${timeout} milliseconds${forcefulSuffix}`; + } + if (isGracefullyCanceled) { + if (signal === void 0) { + return `Command was gracefully canceled with exit code ${exitCode}`; + } + return isForcefullyTerminated ? `Command was gracefully canceled${forcefulSuffix}` : `Command was gracefully canceled with ${signal} (${signalDescription})`; + } + if (isCanceled) { + return `Command was canceled${forcefulSuffix}`; + } + if (isMaxBuffer) { + return `${getMaxBufferMessage(originalError, maxBuffer)}${forcefulSuffix}`; + } + if (errorCode !== void 0) { + return `Command failed with ${errorCode}${forcefulSuffix}`; + } + if (isForcefullyTerminated) { + return `Command was killed with ${killSignal} (${getSignalDescription(killSignal)})${forcefulSuffix}`; + } + if (signal !== void 0) { + return `Command was killed with ${signal} (${signalDescription})`; + } + if (exitCode !== void 0) { + return `Command failed with exit code ${exitCode}`; + } + return "Command failed"; +}; +var getForcefulSuffix = (isForcefullyTerminated, forceKillAfterDelay) => isForcefullyTerminated ? ` and was forcefully terminated after ${forceKillAfterDelay} milliseconds` : ""; +var getOriginalMessage = (originalError, cwd) => { + if (originalError instanceof DiscardedError) { + return; + } + const originalMessage = isExecaError(originalError) ? originalError.originalMessage : String(originalError?.message ?? originalError); + const escapedOriginalMessage = escapeLines(fixCwdError(originalMessage, cwd)); + return escapedOriginalMessage === "" ? void 0 : escapedOriginalMessage; +}; +var serializeIpcMessage = (ipcMessage) => typeof ipcMessage === "string" ? ipcMessage : (0, import_node_util5.inspect)(ipcMessage); +var serializeMessagePart = (messagePart) => Array.isArray(messagePart) ? messagePart.map((messageItem) => stripFinalNewline(serializeMessageItem(messageItem))).filter(Boolean).join("\n") : serializeMessageItem(messagePart); +var serializeMessageItem = (messageItem) => { + if (typeof messageItem === "string") { + return messageItem; + } + if (isUint8Array(messageItem)) { + return uint8ArrayToString(messageItem); + } + return ""; +}; + +// node_modules/execa/lib/return/result.js +var makeSuccessResult = ({ + command, + escapedCommand, + stdio, + all: all3, + ipcOutput, + options: { cwd }, + startTime +}) => omitUndefinedProperties({ + command, + escapedCommand, + cwd, + durationMs: getDurationMs(startTime), + failed: false, + timedOut: false, + isCanceled: false, + isGracefullyCanceled: false, + isTerminated: false, + isMaxBuffer: false, + isForcefullyTerminated: false, + exitCode: 0, + stdout: stdio[1], + stderr: stdio[2], + all: all3, + stdio, + ipcOutput, + pipedFrom: [] +}); +var makeEarlyError = ({ + error, + command, + escapedCommand, + fileDescriptors, + options, + startTime, + isSync +}) => makeError({ + error, + command, + escapedCommand, + startTime, + timedOut: false, + isCanceled: false, + isGracefullyCanceled: false, + isMaxBuffer: false, + isForcefullyTerminated: false, + stdio: Array.from({ length: fileDescriptors.length }), + ipcOutput: [], + options, + isSync +}); +var makeError = ({ + error: originalError, + command, + escapedCommand, + startTime, + timedOut, + isCanceled, + isGracefullyCanceled, + isMaxBuffer, + isForcefullyTerminated, + exitCode: rawExitCode, + signal: rawSignal, + stdio, + all: all3, + ipcOutput, + options: { + timeoutDuration, + timeout = timeoutDuration, + forceKillAfterDelay, + killSignal, + cwd, + maxBuffer + }, + isSync +}) => { + const { exitCode, signal, signalDescription } = normalizeExitPayload(rawExitCode, rawSignal); + const { originalMessage, shortMessage, message } = createMessages({ + stdio, + all: all3, + ipcOutput, + originalError, + signal, + signalDescription, + exitCode, + escapedCommand, + timedOut, + isCanceled, + isGracefullyCanceled, + isMaxBuffer, + isForcefullyTerminated, + forceKillAfterDelay, + killSignal, + maxBuffer, + timeout, + cwd + }); + const error = getFinalError(originalError, message, isSync); + Object.assign(error, getErrorProperties({ + error, + command, + escapedCommand, + startTime, + timedOut, + isCanceled, + isGracefullyCanceled, + isMaxBuffer, + isForcefullyTerminated, + exitCode, + signal, + signalDescription, + stdio, + all: all3, + ipcOutput, + cwd, + originalMessage, + shortMessage + })); + return error; +}; +var getErrorProperties = ({ + error, + command, + escapedCommand, + startTime, + timedOut, + isCanceled, + isGracefullyCanceled, + isMaxBuffer, + isForcefullyTerminated, + exitCode, + signal, + signalDescription, + stdio, + all: all3, + ipcOutput, + cwd, + originalMessage, + shortMessage +}) => omitUndefinedProperties({ + shortMessage, + originalMessage, + command, + escapedCommand, + cwd, + durationMs: getDurationMs(startTime), + failed: true, + timedOut, + isCanceled, + isGracefullyCanceled, + isTerminated: signal !== void 0, + isMaxBuffer, + isForcefullyTerminated, + exitCode, + signal, + signalDescription, + code: error.cause?.code, + stdout: stdio[1], + stderr: stdio[2], + all: all3, + stdio, + ipcOutput, + pipedFrom: [] +}); +var omitUndefinedProperties = (result) => Object.fromEntries(Object.entries(result).filter(([, value]) => value !== void 0)); +var normalizeExitPayload = (rawExitCode, rawSignal) => { + const exitCode = rawExitCode === null ? void 0 : rawExitCode; + const signal = rawSignal === null ? void 0 : rawSignal; + const signalDescription = signal === void 0 ? void 0 : getSignalDescription(rawSignal); + return { exitCode, signal, signalDescription }; +}; + +// node_modules/parse-ms/index.js +var toZeroIfInfinity = (value) => Number.isFinite(value) ? value : 0; +function parseNumber(milliseconds) { + return { + days: Math.trunc(milliseconds / 864e5), + hours: Math.trunc(milliseconds / 36e5 % 24), + minutes: Math.trunc(milliseconds / 6e4 % 60), + seconds: Math.trunc(milliseconds / 1e3 % 60), + milliseconds: Math.trunc(milliseconds % 1e3), + microseconds: Math.trunc(toZeroIfInfinity(milliseconds * 1e3) % 1e3), + nanoseconds: Math.trunc(toZeroIfInfinity(milliseconds * 1e6) % 1e3) + }; +} +function parseBigint(milliseconds) { + return { + days: milliseconds / 86400000n, + hours: milliseconds / 3600000n % 24n, + minutes: milliseconds / 60000n % 60n, + seconds: milliseconds / 1000n % 60n, + milliseconds: milliseconds % 1000n, + microseconds: 0n, + nanoseconds: 0n + }; +} +function parseMilliseconds(milliseconds) { + switch (typeof milliseconds) { + case "number": { + if (Number.isFinite(milliseconds)) { + return parseNumber(milliseconds); + } + break; + } + case "bigint": { + return parseBigint(milliseconds); + } + } + throw new TypeError("Expected a finite number or bigint"); +} + +// node_modules/pretty-ms/index.js +var isZero = (value) => value === 0 || value === 0n; +var pluralize = (word, count2) => count2 === 1 || count2 === 1n ? word : `${word}s`; +var SECOND_ROUNDING_EPSILON = 1e-7; +var ONE_DAY_IN_MILLISECONDS = 24n * 60n * 60n * 1000n; +function prettyMilliseconds(milliseconds, options) { + const isBigInt = typeof milliseconds === "bigint"; + if (!isBigInt && !Number.isFinite(milliseconds)) { + throw new TypeError("Expected a finite number or bigint"); + } + options = { ...options }; + const sign = milliseconds < 0 ? "-" : ""; + milliseconds = milliseconds < 0 ? -milliseconds : milliseconds; + if (options.colonNotation) { + options.compact = false; + options.formatSubMilliseconds = false; + options.separateMilliseconds = false; + options.verbose = false; + } + if (options.compact) { + options.unitCount = 1; + options.secondsDecimalDigits = 0; + options.millisecondsDecimalDigits = 0; + } + let result = []; + const floorDecimals = (value, decimalDigits) => { + const flooredInterimValue = Math.floor(value * 10 ** decimalDigits + SECOND_ROUNDING_EPSILON); + const flooredValue = Math.round(flooredInterimValue) / 10 ** decimalDigits; + return flooredValue.toFixed(decimalDigits); + }; + const add = (value, long, short, valueString) => { + if ((result.length === 0 || !options.colonNotation) && isZero(value) && !(options.colonNotation && short === "m")) { + return; + } + valueString ??= String(value); + if (options.colonNotation) { + const wholeDigits = valueString.includes(".") ? valueString.split(".")[0].length : valueString.length; + const minLength = result.length > 0 ? 2 : 1; + valueString = "0".repeat(Math.max(0, minLength - wholeDigits)) + valueString; + } else { + valueString += options.verbose ? " " + pluralize(long, value) : short; + } + result.push(valueString); + }; + const parsed = parseMilliseconds(milliseconds); + const days = BigInt(parsed.days); + add(days / 365n, "year", "y"); + add(days % 365n, "day", "d"); + add(Number(parsed.hours), "hour", "h"); + add(Number(parsed.minutes), "minute", "m"); + if (options.separateMilliseconds || options.formatSubMilliseconds || !options.colonNotation && milliseconds < 1e3) { + const seconds = Number(parsed.seconds); + const milliseconds2 = Number(parsed.milliseconds); + const microseconds = Number(parsed.microseconds); + const nanoseconds = Number(parsed.nanoseconds); + add(seconds, "second", "s"); + if (options.formatSubMilliseconds) { + add(milliseconds2, "millisecond", "ms"); + add(microseconds, "microsecond", "\xB5s"); + add(nanoseconds, "nanosecond", "ns"); + } else { + const millisecondsAndBelow = milliseconds2 + microseconds / 1e3 + nanoseconds / 1e6; + const millisecondsDecimalDigits = typeof options.millisecondsDecimalDigits === "number" ? options.millisecondsDecimalDigits : 0; + const roundedMilliseconds = millisecondsAndBelow >= 1 ? Math.round(millisecondsAndBelow) : Math.ceil(millisecondsAndBelow); + const millisecondsString = millisecondsDecimalDigits ? millisecondsAndBelow.toFixed(millisecondsDecimalDigits) : roundedMilliseconds; + add( + Number.parseFloat(millisecondsString), + "millisecond", + "ms", + millisecondsString + ); + } + } else { + const seconds = (isBigInt ? Number(milliseconds % ONE_DAY_IN_MILLISECONDS) : milliseconds) / 1e3 % 60; + const secondsDecimalDigits = typeof options.secondsDecimalDigits === "number" ? options.secondsDecimalDigits : 1; + const secondsFixed = floorDecimals(seconds, secondsDecimalDigits); + const secondsString = options.keepDecimalsOnWholeSeconds ? secondsFixed : secondsFixed.replace(/\.0+$/, ""); + add(Number.parseFloat(secondsString), "second", "s", secondsString); + } + if (result.length === 0) { + return sign + "0" + (options.verbose ? " milliseconds" : "ms"); + } + const separator = options.colonNotation ? ":" : " "; + if (typeof options.unitCount === "number") { + result = result.slice(0, Math.max(options.unitCount, 1)); + } + return sign + result.join(separator); +} + +// node_modules/execa/lib/verbose/error.js +var logError = (result, verboseInfo) => { + if (result.failed) { + verboseLog({ + type: "error", + verboseMessage: result.shortMessage, + verboseInfo, + result + }); + } +}; + +// node_modules/execa/lib/verbose/complete.js +var logResult = (result, verboseInfo) => { + if (!isVerbose(verboseInfo)) { + return; + } + logError(result, verboseInfo); + logDuration(result, verboseInfo); +}; +var logDuration = (result, verboseInfo) => { + const verboseMessage = `(done in ${prettyMilliseconds(result.durationMs)})`; + verboseLog({ + type: "duration", + verboseMessage, + verboseInfo, + result + }); +}; + +// node_modules/execa/lib/return/reject.js +var handleResult = (result, verboseInfo, { reject }) => { + logResult(result, verboseInfo); + if (result.failed && reject) { + throw result; + } + return result; +}; + +// node_modules/execa/lib/stdio/handle-sync.js +var import_node_fs4 = require("node:fs"); + +// node_modules/execa/lib/stdio/type.js +var getStdioItemType = (value, optionName) => { + if (isAsyncGenerator(value)) { + return "asyncGenerator"; + } + if (isSyncGenerator(value)) { + return "generator"; + } + if (isUrl(value)) { + return "fileUrl"; + } + if (isFilePathObject(value)) { + return "filePath"; + } + if (isWebStream(value)) { + return "webStream"; + } + if (isStream(value, { checkOpen: false })) { + return "native"; + } + if (isUint8Array(value)) { + return "uint8Array"; + } + if (isAsyncIterableObject(value)) { + return "asyncIterable"; + } + if (isIterableObject(value)) { + return "iterable"; + } + if (isTransformStream(value)) { + return getTransformStreamType({ transform: value }, optionName); + } + if (isTransformOptions(value)) { + return getTransformObjectType(value, optionName); + } + return "native"; +}; +var getTransformObjectType = (value, optionName) => { + if (isDuplexStream(value.transform, { checkOpen: false })) { + return getDuplexType(value, optionName); + } + if (isTransformStream(value.transform)) { + return getTransformStreamType(value, optionName); + } + return getGeneratorObjectType(value, optionName); +}; +var getDuplexType = (value, optionName) => { + validateNonGeneratorType(value, optionName, "Duplex stream"); + return "duplex"; +}; +var getTransformStreamType = (value, optionName) => { + validateNonGeneratorType(value, optionName, "web TransformStream"); + return "webTransform"; +}; +var validateNonGeneratorType = ({ final, binary, objectMode }, optionName, typeName) => { + checkUndefinedOption(final, `${optionName}.final`, typeName); + checkUndefinedOption(binary, `${optionName}.binary`, typeName); + checkBooleanOption(objectMode, `${optionName}.objectMode`); +}; +var checkUndefinedOption = (value, optionName, typeName) => { + if (value !== void 0) { + throw new TypeError(`The \`${optionName}\` option can only be defined when using a generator, not a ${typeName}.`); + } +}; +var getGeneratorObjectType = ({ transform, final, binary, objectMode }, optionName) => { + if (transform !== void 0 && !isGenerator(transform)) { + throw new TypeError(`The \`${optionName}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`); + } + if (isDuplexStream(final, { checkOpen: false })) { + throw new TypeError(`The \`${optionName}.final\` option must not be a Duplex stream.`); + } + if (isTransformStream(final)) { + throw new TypeError(`The \`${optionName}.final\` option must not be a web TransformStream.`); + } + if (final !== void 0 && !isGenerator(final)) { + throw new TypeError(`The \`${optionName}.final\` option must be a generator.`); + } + checkBooleanOption(binary, `${optionName}.binary`); + checkBooleanOption(objectMode, `${optionName}.objectMode`); + return isAsyncGenerator(transform) || isAsyncGenerator(final) ? "asyncGenerator" : "generator"; +}; +var checkBooleanOption = (value, optionName) => { + if (value !== void 0 && typeof value !== "boolean") { + throw new TypeError(`The \`${optionName}\` option must use a boolean.`); + } +}; +var isGenerator = (value) => isAsyncGenerator(value) || isSyncGenerator(value); +var isAsyncGenerator = (value) => Object.prototype.toString.call(value) === "[object AsyncGeneratorFunction]"; +var isSyncGenerator = (value) => Object.prototype.toString.call(value) === "[object GeneratorFunction]"; +var isTransformOptions = (value) => isPlainObject(value) && (value.transform !== void 0 || value.final !== void 0); +var isUrl = (value) => Object.prototype.toString.call(value) === "[object URL]"; +var isRegularUrl = (value) => isUrl(value) && value.protocol !== "file:"; +var isFilePathObject = (value) => isPlainObject(value) && Object.keys(value).length === 1 && isFilePathString(value.file); +var isFilePathString = (file) => typeof file === "string"; +var isUnknownStdioString = (type2, value) => type2 === "native" && typeof value === "string" && !KNOWN_STDIO_STRINGS.has(value); +var KNOWN_STDIO_STRINGS = /* @__PURE__ */ new Set(["ipc", "ignore", "inherit", "overlapped", "pipe"]); +var isReadableStream2 = (value) => Object.prototype.toString.call(value) === "[object ReadableStream]"; +var isWritableStream2 = (value) => Object.prototype.toString.call(value) === "[object WritableStream]"; +var isWebStream = (value) => isReadableStream2(value) || isWritableStream2(value); +var isTransformStream = (value) => isReadableStream2(value?.readable) && isWritableStream2(value?.writable); +var isAsyncIterableObject = (value) => isObject(value) && typeof value[Symbol.asyncIterator] === "function"; +var isIterableObject = (value) => isObject(value) && typeof value[Symbol.iterator] === "function"; +var isObject = (value) => typeof value === "object" && value !== null; +var TRANSFORM_TYPES = /* @__PURE__ */ new Set(["generator", "asyncGenerator", "duplex", "webTransform"]); +var FILE_TYPES = /* @__PURE__ */ new Set(["fileUrl", "filePath", "fileNumber"]); +var SPECIAL_DUPLICATE_TYPES_SYNC = /* @__PURE__ */ new Set(["fileUrl", "filePath"]); +var SPECIAL_DUPLICATE_TYPES = /* @__PURE__ */ new Set([...SPECIAL_DUPLICATE_TYPES_SYNC, "webStream", "nodeStream"]); +var FORBID_DUPLICATE_TYPES = /* @__PURE__ */ new Set(["webTransform", "duplex"]); +var TYPE_TO_MESSAGE = { + generator: "a generator", + asyncGenerator: "an async generator", + fileUrl: "a file URL", + filePath: "a file path string", + fileNumber: "a file descriptor number", + webStream: "a web stream", + nodeStream: "a Node.js stream", + webTransform: "a web TransformStream", + duplex: "a Duplex stream", + native: "any value", + iterable: "an iterable", + asyncIterable: "an async iterable", + string: "a string", + uint8Array: "a Uint8Array" +}; + +// node_modules/execa/lib/transform/object-mode.js +var getTransformObjectModes = (objectMode, index, newTransforms, direction) => direction === "output" ? getOutputObjectModes(objectMode, index, newTransforms) : getInputObjectModes(objectMode, index, newTransforms); +var getOutputObjectModes = (objectMode, index, newTransforms) => { + const writableObjectMode = index !== 0 && newTransforms[index - 1].value.readableObjectMode; + const readableObjectMode = objectMode ?? writableObjectMode; + return { writableObjectMode, readableObjectMode }; +}; +var getInputObjectModes = (objectMode, index, newTransforms) => { + const writableObjectMode = index === 0 ? objectMode === true : newTransforms[index - 1].value.readableObjectMode; + const readableObjectMode = index !== newTransforms.length - 1 && (objectMode ?? writableObjectMode); + return { writableObjectMode, readableObjectMode }; +}; +var getFdObjectMode = (stdioItems, direction) => { + const lastTransform = stdioItems.findLast(({ type: type2 }) => TRANSFORM_TYPES.has(type2)); + if (lastTransform === void 0) { + return false; + } + return direction === "input" ? lastTransform.value.writableObjectMode : lastTransform.value.readableObjectMode; +}; + +// node_modules/execa/lib/transform/normalize.js +var normalizeTransforms = (stdioItems, optionName, direction, options) => [ + ...stdioItems.filter(({ type: type2 }) => !TRANSFORM_TYPES.has(type2)), + ...getTransforms(stdioItems, optionName, direction, options) +]; +var getTransforms = (stdioItems, optionName, direction, { encoding }) => { + const transforms = stdioItems.filter(({ type: type2 }) => TRANSFORM_TYPES.has(type2)); + const newTransforms = Array.from({ length: transforms.length }); + for (const [index, stdioItem] of Object.entries(transforms)) { + newTransforms[index] = normalizeTransform({ + stdioItem, + index: Number(index), + newTransforms, + optionName, + direction, + encoding + }); + } + return sortTransforms(newTransforms, direction); +}; +var normalizeTransform = ({ stdioItem, stdioItem: { type: type2 }, index, newTransforms, optionName, direction, encoding }) => { + if (type2 === "duplex") { + return normalizeDuplex({ stdioItem, optionName }); + } + if (type2 === "webTransform") { + return normalizeTransformStream({ + stdioItem, + index, + newTransforms, + direction + }); + } + return normalizeGenerator({ + stdioItem, + index, + newTransforms, + direction, + encoding + }); +}; +var normalizeDuplex = ({ + stdioItem, + stdioItem: { + value: { + transform, + transform: { writableObjectMode, readableObjectMode }, + objectMode = readableObjectMode + } + }, + optionName +}) => { + if (objectMode && !readableObjectMode) { + throw new TypeError(`The \`${optionName}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`); + } + if (!objectMode && readableObjectMode) { + throw new TypeError(`The \`${optionName}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`); + } + return { + ...stdioItem, + value: { transform, writableObjectMode, readableObjectMode } + }; +}; +var normalizeTransformStream = ({ stdioItem, stdioItem: { value }, index, newTransforms, direction }) => { + const { transform, objectMode } = isPlainObject(value) ? value : { transform: value }; + const { writableObjectMode, readableObjectMode } = getTransformObjectModes(objectMode, index, newTransforms, direction); + return { + ...stdioItem, + value: { transform, writableObjectMode, readableObjectMode } + }; +}; +var normalizeGenerator = ({ stdioItem, stdioItem: { value }, index, newTransforms, direction, encoding }) => { + const { + transform, + final, + binary: binaryOption = false, + preserveNewlines = false, + objectMode + } = isPlainObject(value) ? value : { transform: value }; + const binary = binaryOption || BINARY_ENCODINGS.has(encoding); + const { writableObjectMode, readableObjectMode } = getTransformObjectModes(objectMode, index, newTransforms, direction); + return { + ...stdioItem, + value: { + transform, + final, + binary, + preserveNewlines, + writableObjectMode, + readableObjectMode + } + }; +}; +var sortTransforms = (newTransforms, direction) => direction === "input" ? newTransforms.reverse() : newTransforms; + +// node_modules/execa/lib/stdio/direction.js +var import_node_process12 = __toESM(require("node:process"), 1); +var getStreamDirection = (stdioItems, fdNumber, optionName) => { + const directions = stdioItems.map((stdioItem) => getStdioItemDirection(stdioItem, fdNumber)); + if (directions.includes("input") && directions.includes("output")) { + throw new TypeError(`The \`${optionName}\` option must not be an array of both readable and writable values.`); + } + return directions.find(Boolean) ?? DEFAULT_DIRECTION; +}; +var getStdioItemDirection = ({ type: type2, value }, fdNumber) => KNOWN_DIRECTIONS[fdNumber] ?? guessStreamDirection[type2](value); +var KNOWN_DIRECTIONS = ["input", "output", "output"]; +var anyDirection = () => void 0; +var alwaysInput = () => "input"; +var guessStreamDirection = { + generator: anyDirection, + asyncGenerator: anyDirection, + fileUrl: anyDirection, + filePath: anyDirection, + iterable: alwaysInput, + asyncIterable: alwaysInput, + uint8Array: alwaysInput, + webStream: (value) => isWritableStream2(value) ? "output" : "input", + nodeStream(value) { + if (!isReadableStream(value, { checkOpen: false })) { + return "output"; + } + return isWritableStream(value, { checkOpen: false }) ? void 0 : "input"; + }, + webTransform: anyDirection, + duplex: anyDirection, + native(value) { + const standardStreamDirection = getStandardStreamDirection(value); + if (standardStreamDirection !== void 0) { + return standardStreamDirection; + } + if (isStream(value, { checkOpen: false })) { + return guessStreamDirection.nodeStream(value); + } + } +}; +var getStandardStreamDirection = (value) => { + if ([0, import_node_process12.default.stdin].includes(value)) { + return "input"; + } + if ([1, 2, import_node_process12.default.stdout, import_node_process12.default.stderr].includes(value)) { + return "output"; + } +}; +var DEFAULT_DIRECTION = "output"; + +// node_modules/execa/lib/ipc/array.js +var normalizeIpcStdioArray = (stdioArray, ipc) => ipc && !stdioArray.includes("ipc") ? [...stdioArray, "ipc"] : stdioArray; + +// node_modules/execa/lib/stdio/stdio-option.js +var normalizeStdioOption = ({ stdio, ipc, buffer, ...options }, verboseInfo, isSync) => { + const stdioArray = getStdioArray(stdio, options).map((stdioOption, fdNumber) => addDefaultValue2(stdioOption, fdNumber)); + return isSync ? normalizeStdioSync(stdioArray, buffer, verboseInfo) : normalizeIpcStdioArray(stdioArray, ipc); +}; +var getStdioArray = (stdio, options) => { + if (stdio === void 0) { + return STANDARD_STREAMS_ALIASES.map((alias) => options[alias]); + } + if (hasAlias(options)) { + throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${STANDARD_STREAMS_ALIASES.map((alias) => `\`${alias}\``).join(", ")}`); + } + if (typeof stdio === "string") { + return [stdio, stdio, stdio]; + } + if (!Array.isArray(stdio)) { + throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``); + } + const length = Math.max(stdio.length, STANDARD_STREAMS_ALIASES.length); + return Array.from({ length }, (_7, fdNumber) => stdio[fdNumber]); +}; +var hasAlias = (options) => STANDARD_STREAMS_ALIASES.some((alias) => options[alias] !== void 0); +var addDefaultValue2 = (stdioOption, fdNumber) => { + if (Array.isArray(stdioOption)) { + return stdioOption.map((item) => addDefaultValue2(item, fdNumber)); + } + if (stdioOption === null || stdioOption === void 0) { + return fdNumber >= STANDARD_STREAMS_ALIASES.length ? "ignore" : "pipe"; + } + return stdioOption; +}; +var normalizeStdioSync = (stdioArray, buffer, verboseInfo) => stdioArray.map((stdioOption, fdNumber) => !buffer[fdNumber] && fdNumber !== 0 && !isFullVerbose(verboseInfo, fdNumber) && isOutputPipeOnly(stdioOption) ? "ignore" : stdioOption); +var isOutputPipeOnly = (stdioOption) => stdioOption === "pipe" || Array.isArray(stdioOption) && stdioOption.every((item) => item === "pipe"); + +// node_modules/execa/lib/stdio/native.js +var import_node_fs3 = require("node:fs"); +var import_node_tty4 = __toESM(require("node:tty"), 1); +var handleNativeStream = ({ stdioItem, stdioItem: { type: type2 }, isStdioArray, fdNumber, direction, isSync }) => { + if (!isStdioArray || type2 !== "native") { + return stdioItem; + } + return isSync ? handleNativeStreamSync({ stdioItem, fdNumber, direction }) : handleNativeStreamAsync({ stdioItem, fdNumber }); +}; +var handleNativeStreamSync = ({ stdioItem, stdioItem: { value, optionName }, fdNumber, direction }) => { + const targetFd = getTargetFd({ + value, + optionName, + fdNumber, + direction + }); + if (targetFd !== void 0) { + return targetFd; + } + if (isStream(value, { checkOpen: false })) { + throw new TypeError(`The \`${optionName}: Stream\` option cannot both be an array and include a stream with synchronous methods.`); + } + return stdioItem; +}; +var getTargetFd = ({ value, optionName, fdNumber, direction }) => { + const targetFdNumber = getTargetFdNumber(value, fdNumber); + if (targetFdNumber === void 0) { + return; + } + if (direction === "output") { + return { type: "fileNumber", value: targetFdNumber, optionName }; + } + if (import_node_tty4.default.isatty(targetFdNumber)) { + throw new TypeError(`The \`${optionName}: ${serializeOptionValue(value)}\` option is invalid: it cannot be a TTY with synchronous methods.`); + } + return { type: "uint8Array", value: bufferToUint8Array((0, import_node_fs3.readFileSync)(targetFdNumber)), optionName }; +}; +var getTargetFdNumber = (value, fdNumber) => { + if (value === "inherit") { + return fdNumber; + } + if (typeof value === "number") { + return value; + } + const standardStreamIndex = STANDARD_STREAMS.indexOf(value); + if (standardStreamIndex !== -1) { + return standardStreamIndex; + } +}; +var handleNativeStreamAsync = ({ stdioItem, stdioItem: { value, optionName }, fdNumber }) => { + if (value === "inherit") { + return { type: "nodeStream", value: getStandardStream(fdNumber, value, optionName), optionName }; + } + if (typeof value === "number") { + return { type: "nodeStream", value: getStandardStream(value, value, optionName), optionName }; + } + if (isStream(value, { checkOpen: false })) { + return { type: "nodeStream", value, optionName }; + } + return stdioItem; +}; +var getStandardStream = (fdNumber, value, optionName) => { + const standardStream = STANDARD_STREAMS[fdNumber]; + if (standardStream === void 0) { + throw new TypeError(`The \`${optionName}: ${value}\` option is invalid: no such standard stream.`); + } + return standardStream; +}; + +// node_modules/execa/lib/stdio/input-option.js +var handleInputOptions = ({ input, inputFile }, fdNumber) => fdNumber === 0 ? [ + ...handleInputOption(input), + ...handleInputFileOption(inputFile) +] : []; +var handleInputOption = (input) => input === void 0 ? [] : [{ + type: getInputType(input), + value: input, + optionName: "input" +}]; +var getInputType = (input) => { + if (isReadableStream(input, { checkOpen: false })) { + return "nodeStream"; + } + if (typeof input === "string") { + return "string"; + } + if (isUint8Array(input)) { + return "uint8Array"; + } + throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream."); +}; +var handleInputFileOption = (inputFile) => inputFile === void 0 ? [] : [{ + ...getInputFileType(inputFile), + optionName: "inputFile" +}]; +var getInputFileType = (inputFile) => { + if (isUrl(inputFile)) { + return { type: "fileUrl", value: inputFile }; + } + if (isFilePathString(inputFile)) { + return { type: "filePath", value: { file: inputFile } }; + } + throw new Error("The `inputFile` option must be a file path string or a file URL."); +}; + +// node_modules/execa/lib/stdio/duplicate.js +var filterDuplicates = (stdioItems) => stdioItems.filter((stdioItemOne, indexOne) => stdioItems.every((stdioItemTwo, indexTwo) => stdioItemOne.value !== stdioItemTwo.value || indexOne >= indexTwo || stdioItemOne.type === "generator" || stdioItemOne.type === "asyncGenerator")); +var getDuplicateStream = ({ stdioItem: { type: type2, value, optionName }, direction, fileDescriptors, isSync }) => { + const otherStdioItems = getOtherStdioItems(fileDescriptors, type2); + if (otherStdioItems.length === 0) { + return; + } + if (isSync) { + validateDuplicateStreamSync({ + otherStdioItems, + type: type2, + value, + optionName, + direction + }); + return; + } + if (SPECIAL_DUPLICATE_TYPES.has(type2)) { + return getDuplicateStreamInstance({ + otherStdioItems, + type: type2, + value, + optionName, + direction + }); + } + if (FORBID_DUPLICATE_TYPES.has(type2)) { + validateDuplicateTransform({ + otherStdioItems, + type: type2, + value, + optionName + }); + } +}; +var getOtherStdioItems = (fileDescriptors, type2) => fileDescriptors.flatMap(({ direction, stdioItems }) => stdioItems.filter((stdioItem) => stdioItem.type === type2).map((stdioItem) => ({ ...stdioItem, direction }))); +var validateDuplicateStreamSync = ({ otherStdioItems, type: type2, value, optionName, direction }) => { + if (SPECIAL_DUPLICATE_TYPES_SYNC.has(type2)) { + getDuplicateStreamInstance({ + otherStdioItems, + type: type2, + value, + optionName, + direction + }); + } +}; +var getDuplicateStreamInstance = ({ otherStdioItems, type: type2, value, optionName, direction }) => { + const duplicateStdioItems = otherStdioItems.filter((stdioItem) => hasSameValue(stdioItem, value)); + if (duplicateStdioItems.length === 0) { + return; + } + const differentStdioItem = duplicateStdioItems.find((stdioItem) => stdioItem.direction !== direction); + throwOnDuplicateStream(differentStdioItem, optionName, type2); + return direction === "output" ? duplicateStdioItems[0].stream : void 0; +}; +var hasSameValue = ({ type: type2, value }, secondValue) => { + if (type2 === "filePath") { + return value.file === secondValue.file; + } + if (type2 === "fileUrl") { + return value.href === secondValue.href; + } + return value === secondValue; +}; +var validateDuplicateTransform = ({ otherStdioItems, type: type2, value, optionName }) => { + const duplicateStdioItem = otherStdioItems.find(({ value: { transform } }) => transform === value.transform); + throwOnDuplicateStream(duplicateStdioItem, optionName, type2); +}; +var throwOnDuplicateStream = (stdioItem, optionName, type2) => { + if (stdioItem !== void 0) { + throw new TypeError(`The \`${stdioItem.optionName}\` and \`${optionName}\` options must not target ${TYPE_TO_MESSAGE[type2]} that is the same.`); + } +}; + +// node_modules/execa/lib/stdio/handle.js +var handleStdio = (addProperties3, options, verboseInfo, isSync) => { + const stdio = normalizeStdioOption(options, verboseInfo, isSync); + const initialFileDescriptors = stdio.map((stdioOption, fdNumber) => getFileDescriptor({ + stdioOption, + fdNumber, + options, + isSync + })); + const fileDescriptors = getFinalFileDescriptors({ + initialFileDescriptors, + addProperties: addProperties3, + options, + isSync + }); + options.stdio = fileDescriptors.map(({ stdioItems }) => forwardStdio(stdioItems)); + return fileDescriptors; +}; +var getFileDescriptor = ({ stdioOption, fdNumber, options, isSync }) => { + const optionName = getStreamName(fdNumber); + const { stdioItems: initialStdioItems, isStdioArray } = initializeStdioItems({ + stdioOption, + fdNumber, + options, + optionName + }); + const direction = getStreamDirection(initialStdioItems, fdNumber, optionName); + const stdioItems = initialStdioItems.map((stdioItem) => handleNativeStream({ + stdioItem, + isStdioArray, + fdNumber, + direction, + isSync + })); + const normalizedStdioItems = normalizeTransforms(stdioItems, optionName, direction, options); + const objectMode = getFdObjectMode(normalizedStdioItems, direction); + validateFileObjectMode(normalizedStdioItems, objectMode); + return { direction, objectMode, stdioItems: normalizedStdioItems }; +}; +var initializeStdioItems = ({ stdioOption, fdNumber, options, optionName }) => { + const values = Array.isArray(stdioOption) ? stdioOption : [stdioOption]; + const initialStdioItems = [ + ...values.map((value) => initializeStdioItem(value, optionName)), + ...handleInputOptions(options, fdNumber) + ]; + const stdioItems = filterDuplicates(initialStdioItems); + const isStdioArray = stdioItems.length > 1; + validateStdioArray(stdioItems, isStdioArray, optionName); + validateStreams(stdioItems); + return { stdioItems, isStdioArray }; +}; +var initializeStdioItem = (value, optionName) => ({ + type: getStdioItemType(value, optionName), + value, + optionName +}); +var validateStdioArray = (stdioItems, isStdioArray, optionName) => { + if (stdioItems.length === 0) { + throw new TypeError(`The \`${optionName}\` option must not be an empty array.`); + } + if (!isStdioArray) { + return; + } + for (const { value, optionName: optionName2 } of stdioItems) { + if (INVALID_STDIO_ARRAY_OPTIONS.has(value)) { + throw new Error(`The \`${optionName2}\` option must not include \`${value}\`.`); + } + } +}; +var INVALID_STDIO_ARRAY_OPTIONS = /* @__PURE__ */ new Set(["ignore", "ipc"]); +var validateStreams = (stdioItems) => { + for (const stdioItem of stdioItems) { + validateFileStdio(stdioItem); + } +}; +var validateFileStdio = ({ type: type2, value, optionName }) => { + if (isRegularUrl(value)) { + throw new TypeError(`The \`${optionName}: URL\` option must use the \`file:\` scheme. +For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`); + } + if (isUnknownStdioString(type2, value)) { + throw new TypeError(`The \`${optionName}: { file: '...' }\` option must be used instead of \`${optionName}: '...'\`.`); + } +}; +var validateFileObjectMode = (stdioItems, objectMode) => { + if (!objectMode) { + return; + } + const fileStdioItem = stdioItems.find(({ type: type2 }) => FILE_TYPES.has(type2)); + if (fileStdioItem !== void 0) { + throw new TypeError(`The \`${fileStdioItem.optionName}\` option cannot use both files and transforms in objectMode.`); + } +}; +var getFinalFileDescriptors = ({ initialFileDescriptors, addProperties: addProperties3, options, isSync }) => { + const fileDescriptors = []; + try { + for (const fileDescriptor of initialFileDescriptors) { + fileDescriptors.push(getFinalFileDescriptor({ + fileDescriptor, + fileDescriptors, + addProperties: addProperties3, + options, + isSync + })); + } + return fileDescriptors; + } catch (error) { + cleanupCustomStreams(fileDescriptors); + throw error; + } +}; +var getFinalFileDescriptor = ({ + fileDescriptor: { direction, objectMode, stdioItems }, + fileDescriptors, + addProperties: addProperties3, + options, + isSync +}) => { + const finalStdioItems = stdioItems.map((stdioItem) => addStreamProperties({ + stdioItem, + addProperties: addProperties3, + direction, + options, + fileDescriptors, + isSync + })); + return { direction, objectMode, stdioItems: finalStdioItems }; +}; +var addStreamProperties = ({ stdioItem, addProperties: addProperties3, direction, options, fileDescriptors, isSync }) => { + const duplicateStream = getDuplicateStream({ + stdioItem, + direction, + fileDescriptors, + isSync + }); + if (duplicateStream !== void 0) { + return { ...stdioItem, stream: duplicateStream }; + } + return { + ...stdioItem, + ...addProperties3[direction][stdioItem.type](stdioItem, options) + }; +}; +var cleanupCustomStreams = (fileDescriptors) => { + for (const { stdioItems } of fileDescriptors) { + for (const { stream: stream4 } of stdioItems) { + if (stream4 !== void 0 && !isStandardStream(stream4)) { + stream4.destroy(); + } + } + } +}; +var forwardStdio = (stdioItems) => { + if (stdioItems.length > 1) { + return stdioItems.some(({ value: value2 }) => value2 === "overlapped") ? "overlapped" : "pipe"; + } + const [{ type: type2, value }] = stdioItems; + return type2 === "native" ? value : "pipe"; +}; + +// node_modules/execa/lib/stdio/handle-sync.js +var handleStdioSync = (options, verboseInfo) => handleStdio(addPropertiesSync, options, verboseInfo, true); +var forbiddenIfSync = ({ type: type2, optionName }) => { + throwInvalidSyncValue(optionName, TYPE_TO_MESSAGE[type2]); +}; +var forbiddenNativeIfSync = ({ optionName, value }) => { + if (value === "ipc" || value === "overlapped") { + throwInvalidSyncValue(optionName, `"${value}"`); + } + return {}; +}; +var throwInvalidSyncValue = (optionName, value) => { + throw new TypeError(`The \`${optionName}\` option cannot be ${value} with synchronous methods.`); +}; +var addProperties = { + generator() { + }, + asyncGenerator: forbiddenIfSync, + webStream: forbiddenIfSync, + nodeStream: forbiddenIfSync, + webTransform: forbiddenIfSync, + duplex: forbiddenIfSync, + asyncIterable: forbiddenIfSync, + native: forbiddenNativeIfSync +}; +var addPropertiesSync = { + input: { + ...addProperties, + fileUrl: ({ value }) => ({ contents: [bufferToUint8Array((0, import_node_fs4.readFileSync)(value))] }), + filePath: ({ value: { file } }) => ({ contents: [bufferToUint8Array((0, import_node_fs4.readFileSync)(file))] }), + fileNumber: forbiddenIfSync, + iterable: ({ value }) => ({ contents: [...value] }), + string: ({ value }) => ({ contents: [value] }), + uint8Array: ({ value }) => ({ contents: [value] }) + }, + output: { + ...addProperties, + fileUrl: ({ value }) => ({ path: value }), + filePath: ({ value: { file } }) => ({ path: file }), + fileNumber: ({ value }) => ({ path: value }), + iterable: forbiddenIfSync, + string: forbiddenIfSync, + uint8Array: forbiddenIfSync + } +}; + +// node_modules/execa/lib/io/strip-newline.js +var stripNewline = (value, { stripFinalNewline: stripFinalNewline2 }, fdNumber) => getStripFinalNewline(stripFinalNewline2, fdNumber) && value !== void 0 && !Array.isArray(value) ? stripFinalNewline(value) : value; +var getStripFinalNewline = (stripFinalNewline2, fdNumber) => fdNumber === "all" ? stripFinalNewline2[1] || stripFinalNewline2[2] : stripFinalNewline2[fdNumber]; + +// node_modules/execa/lib/transform/generator.js +var import_node_stream = require("node:stream"); + +// node_modules/execa/lib/transform/split.js +var getSplitLinesGenerator = (binary, preserveNewlines, skipped, state2) => binary || skipped ? void 0 : initializeSplitLines(preserveNewlines, state2); +var splitLinesSync = (chunk, preserveNewlines, objectMode) => objectMode ? chunk.flatMap((item) => splitLinesItemSync(item, preserveNewlines)) : splitLinesItemSync(chunk, preserveNewlines); +var splitLinesItemSync = (chunk, preserveNewlines) => { + const { transform, final } = initializeSplitLines(preserveNewlines, {}); + return [...transform(chunk), ...final()]; +}; +var initializeSplitLines = (preserveNewlines, state2) => { + state2.previousChunks = ""; + return { + transform: splitGenerator.bind(void 0, state2, preserveNewlines), + final: linesFinal.bind(void 0, state2) + }; +}; +var splitGenerator = function* (state2, preserveNewlines, chunk) { + if (typeof chunk !== "string") { + yield chunk; + return; + } + let { previousChunks } = state2; + let start = -1; + for (let end = 0; end < chunk.length; end += 1) { + if (chunk[end] === "\n") { + const newlineLength = getNewlineLength(chunk, end, preserveNewlines, state2); + let line = chunk.slice(start + 1, end + 1 - newlineLength); + if (previousChunks.length > 0) { + line = concatString(previousChunks, line); + previousChunks = ""; + } + yield line; + start = end; + } + } + if (start !== chunk.length - 1) { + previousChunks = concatString(previousChunks, chunk.slice(start + 1)); + } + state2.previousChunks = previousChunks; +}; +var getNewlineLength = (chunk, end, preserveNewlines, state2) => { + if (preserveNewlines) { + return 0; + } + state2.isWindowsNewline = end !== 0 && chunk[end - 1] === "\r"; + return state2.isWindowsNewline ? 2 : 1; +}; +var linesFinal = function* ({ previousChunks }) { + if (previousChunks.length > 0) { + yield previousChunks; + } +}; +var getAppendNewlineGenerator = ({ binary, preserveNewlines, readableObjectMode, state: state2 }) => binary || preserveNewlines || readableObjectMode ? void 0 : { transform: appendNewlineGenerator.bind(void 0, state2) }; +var appendNewlineGenerator = function* ({ isWindowsNewline = false }, chunk) { + const { unixNewline, windowsNewline, LF: LF2, concatBytes } = typeof chunk === "string" ? linesStringInfo : linesUint8ArrayInfo; + if (chunk.at(-1) === LF2) { + yield chunk; + return; + } + const newline = isWindowsNewline ? windowsNewline : unixNewline; + yield concatBytes(chunk, newline); +}; +var concatString = (firstChunk, secondChunk) => `${firstChunk}${secondChunk}`; +var linesStringInfo = { + windowsNewline: "\r\n", + unixNewline: "\n", + LF: "\n", + concatBytes: concatString +}; +var concatUint8Array = (firstChunk, secondChunk) => { + const chunk = new Uint8Array(firstChunk.length + secondChunk.length); + chunk.set(firstChunk, 0); + chunk.set(secondChunk, firstChunk.length); + return chunk; +}; +var linesUint8ArrayInfo = { + windowsNewline: new Uint8Array([13, 10]), + unixNewline: new Uint8Array([10]), + LF: 10, + concatBytes: concatUint8Array +}; + +// node_modules/execa/lib/transform/validate.js +var import_node_buffer = require("node:buffer"); +var getValidateTransformInput = (writableObjectMode, optionName) => writableObjectMode ? void 0 : validateStringTransformInput.bind(void 0, optionName); +var validateStringTransformInput = function* (optionName, chunk) { + if (typeof chunk !== "string" && !isUint8Array(chunk) && !import_node_buffer.Buffer.isBuffer(chunk)) { + throw new TypeError(`The \`${optionName}\` option's transform must use "objectMode: true" to receive as input: ${typeof chunk}.`); + } + yield chunk; +}; +var getValidateTransformReturn = (readableObjectMode, optionName) => readableObjectMode ? validateObjectTransformReturn.bind(void 0, optionName) : validateStringTransformReturn.bind(void 0, optionName); +var validateObjectTransformReturn = function* (optionName, chunk) { + validateEmptyReturn(optionName, chunk); + yield chunk; +}; +var validateStringTransformReturn = function* (optionName, chunk) { + validateEmptyReturn(optionName, chunk); + if (typeof chunk !== "string" && !isUint8Array(chunk)) { + throw new TypeError(`The \`${optionName}\` option's function must yield a string or an Uint8Array, not ${typeof chunk}.`); + } + yield chunk; +}; +var validateEmptyReturn = (optionName, chunk) => { + if (chunk === null || chunk === void 0) { + throw new TypeError(`The \`${optionName}\` option's function must not call \`yield ${chunk}\`. +Instead, \`yield\` should either be called with a value, or not be called at all. For example: + if (condition) { yield value; }`); + } +}; + +// node_modules/execa/lib/transform/encoding-transform.js +var import_node_buffer2 = require("node:buffer"); +var import_node_string_decoder2 = require("node:string_decoder"); +var getEncodingTransformGenerator = (binary, encoding, skipped) => { + if (skipped) { + return; + } + if (binary) { + return { transform: encodingUint8ArrayGenerator.bind(void 0, new TextEncoder()) }; + } + const stringDecoder = new import_node_string_decoder2.StringDecoder(encoding); + return { + transform: encodingStringGenerator.bind(void 0, stringDecoder), + final: encodingStringFinal.bind(void 0, stringDecoder) + }; +}; +var encodingUint8ArrayGenerator = function* (textEncoder4, chunk) { + if (import_node_buffer2.Buffer.isBuffer(chunk)) { + yield bufferToUint8Array(chunk); + } else if (typeof chunk === "string") { + yield textEncoder4.encode(chunk); + } else { + yield chunk; + } +}; +var encodingStringGenerator = function* (stringDecoder, chunk) { + yield isUint8Array(chunk) ? stringDecoder.write(chunk) : chunk; +}; +var encodingStringFinal = function* (stringDecoder) { + const lastChunk = stringDecoder.end(); + if (lastChunk !== "") { + yield lastChunk; + } +}; + +// node_modules/execa/lib/transform/run-async.js +var import_node_util6 = require("node:util"); +var pushChunks = (0, import_node_util6.callbackify)(async (getChunks, state2, getChunksArguments, transformStream) => { + state2.currentIterable = getChunks(...getChunksArguments); + try { + for await (const chunk of state2.currentIterable) { + transformStream.push(chunk); + } + } finally { + delete state2.currentIterable; + } +}); +var transformChunk = async function* (chunk, generators, index) { + if (index === generators.length) { + yield chunk; + return; + } + const { transform = identityGenerator } = generators[index]; + for await (const transformedChunk of transform(chunk)) { + yield* transformChunk(transformedChunk, generators, index + 1); + } +}; +var finalChunks = async function* (generators) { + for (const [index, { final }] of Object.entries(generators)) { + yield* generatorFinalChunks(final, Number(index), generators); + } +}; +var generatorFinalChunks = async function* (final, index, generators) { + if (final === void 0) { + return; + } + for await (const finalChunk of final()) { + yield* transformChunk(finalChunk, generators, index + 1); + } +}; +var destroyTransform = (0, import_node_util6.callbackify)(async ({ currentIterable }, error) => { + if (currentIterable !== void 0) { + await (error ? currentIterable.throw(error) : currentIterable.return()); + return; + } + if (error) { + throw error; + } +}); +var identityGenerator = function* (chunk) { + yield chunk; +}; + +// node_modules/execa/lib/transform/run-sync.js +var pushChunksSync = (getChunksSync, getChunksArguments, transformStream, done) => { + try { + for (const chunk of getChunksSync(...getChunksArguments)) { + transformStream.push(chunk); + } + done(); + } catch (error) { + done(error); + } +}; +var runTransformSync = (generators, chunks) => [ + ...chunks.flatMap((chunk) => [...transformChunkSync(chunk, generators, 0)]), + ...finalChunksSync(generators) +]; +var transformChunkSync = function* (chunk, generators, index) { + if (index === generators.length) { + yield chunk; + return; + } + const { transform = identityGenerator2 } = generators[index]; + for (const transformedChunk of transform(chunk)) { + yield* transformChunkSync(transformedChunk, generators, index + 1); + } +}; +var finalChunksSync = function* (generators) { + for (const [index, { final }] of Object.entries(generators)) { + yield* generatorFinalChunksSync(final, Number(index), generators); + } +}; +var generatorFinalChunksSync = function* (final, index, generators) { + if (final === void 0) { + return; + } + for (const finalChunk of final()) { + yield* transformChunkSync(finalChunk, generators, index + 1); + } +}; +var identityGenerator2 = function* (chunk) { + yield chunk; +}; + +// node_modules/execa/lib/transform/generator.js +var generatorToStream = ({ + value, + value: { transform, final, writableObjectMode, readableObjectMode }, + optionName +}, { encoding }) => { + const state2 = {}; + const generators = addInternalGenerators(value, encoding, optionName); + const transformAsync = isAsyncGenerator(transform); + const finalAsync = isAsyncGenerator(final); + const transformMethod = transformAsync ? pushChunks.bind(void 0, transformChunk, state2) : pushChunksSync.bind(void 0, transformChunkSync); + const finalMethod = transformAsync || finalAsync ? pushChunks.bind(void 0, finalChunks, state2) : pushChunksSync.bind(void 0, finalChunksSync); + const destroyMethod = transformAsync || finalAsync ? destroyTransform.bind(void 0, state2) : void 0; + const stream4 = new import_node_stream.Transform({ + writableObjectMode, + writableHighWaterMark: (0, import_node_stream.getDefaultHighWaterMark)(writableObjectMode), + readableObjectMode, + readableHighWaterMark: (0, import_node_stream.getDefaultHighWaterMark)(readableObjectMode), + transform(chunk, encoding2, done) { + transformMethod([chunk, generators, 0], this, done); + }, + flush(done) { + finalMethod([generators], this, done); + }, + destroy: destroyMethod + }); + return { stream: stream4 }; +}; +var runGeneratorsSync = (chunks, stdioItems, encoding, isInput) => { + const generators = stdioItems.filter(({ type: type2 }) => type2 === "generator"); + const reversedGenerators = isInput ? generators.reverse() : generators; + for (const { value, optionName } of reversedGenerators) { + const generators2 = addInternalGenerators(value, encoding, optionName); + chunks = runTransformSync(generators2, chunks); + } + return chunks; +}; +var addInternalGenerators = ({ transform, final, binary, writableObjectMode, readableObjectMode, preserveNewlines }, encoding, optionName) => { + const state2 = {}; + return [ + { transform: getValidateTransformInput(writableObjectMode, optionName) }, + getEncodingTransformGenerator(binary, encoding, writableObjectMode), + getSplitLinesGenerator(binary, preserveNewlines, writableObjectMode, state2), + { transform, final }, + { transform: getValidateTransformReturn(readableObjectMode, optionName) }, + getAppendNewlineGenerator({ + binary, + preserveNewlines, + readableObjectMode, + state: state2 + }) + ].filter(Boolean); +}; + +// node_modules/execa/lib/io/input-sync.js +var addInputOptionsSync = (fileDescriptors, options) => { + for (const fdNumber of getInputFdNumbers(fileDescriptors)) { + addInputOptionSync(fileDescriptors, fdNumber, options); + } +}; +var getInputFdNumbers = (fileDescriptors) => new Set(Object.entries(fileDescriptors).filter(([, { direction }]) => direction === "input").map(([fdNumber]) => Number(fdNumber))); +var addInputOptionSync = (fileDescriptors, fdNumber, options) => { + const { stdioItems } = fileDescriptors[fdNumber]; + const allStdioItems = stdioItems.filter(({ contents }) => contents !== void 0); + if (allStdioItems.length === 0) { + return; + } + if (fdNumber !== 0) { + const [{ type: type2, optionName }] = allStdioItems; + throw new TypeError(`Only the \`stdin\` option, not \`${optionName}\`, can be ${TYPE_TO_MESSAGE[type2]} with synchronous methods.`); + } + const allContents = allStdioItems.map(({ contents }) => contents); + const transformedContents = allContents.map((contents) => applySingleInputGeneratorsSync(contents, stdioItems)); + options.input = joinToUint8Array(transformedContents); +}; +var applySingleInputGeneratorsSync = (contents, stdioItems) => { + const newContents = runGeneratorsSync(contents, stdioItems, "utf8", true); + validateSerializable(newContents); + return joinToUint8Array(newContents); +}; +var validateSerializable = (newContents) => { + const invalidItem = newContents.find((item) => typeof item !== "string" && !isUint8Array(item)); + if (invalidItem !== void 0) { + throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${invalidItem}.`); + } +}; + +// node_modules/execa/lib/io/output-sync.js +var import_node_fs5 = require("node:fs"); + +// node_modules/execa/lib/verbose/output.js +var shouldLogOutput = ({ stdioItems, encoding, verboseInfo, fdNumber }) => fdNumber !== "all" && isFullVerbose(verboseInfo, fdNumber) && !BINARY_ENCODINGS.has(encoding) && fdUsesVerbose(fdNumber) && (stdioItems.some(({ type: type2, value }) => type2 === "native" && PIPED_STDIO_VALUES.has(value)) || stdioItems.every(({ type: type2 }) => TRANSFORM_TYPES.has(type2))); +var fdUsesVerbose = (fdNumber) => fdNumber === 1 || fdNumber === 2; +var PIPED_STDIO_VALUES = /* @__PURE__ */ new Set(["pipe", "overlapped"]); +var logLines = async (linesIterable, stream4, fdNumber, verboseInfo) => { + for await (const line of linesIterable) { + if (!isPipingStream(stream4)) { + logLine(line, fdNumber, verboseInfo); + } + } +}; +var logLinesSync = (linesArray, fdNumber, verboseInfo) => { + for (const line of linesArray) { + logLine(line, fdNumber, verboseInfo); + } +}; +var isPipingStream = (stream4) => stream4._readableState.pipes.length > 0; +var logLine = (line, fdNumber, verboseInfo) => { + const verboseMessage = serializeVerboseMessage(line); + verboseLog({ + type: "output", + verboseMessage, + fdNumber, + verboseInfo + }); +}; + +// node_modules/execa/lib/io/output-sync.js +var transformOutputSync = ({ fileDescriptors, syncResult: { output }, options, isMaxBuffer, verboseInfo }) => { + if (output === null) { + return { output: Array.from({ length: 3 }) }; + } + const state2 = {}; + const outputFiles = /* @__PURE__ */ new Set([]); + const transformedOutput = output.map((result, fdNumber) => transformOutputResultSync({ + result, + fileDescriptors, + fdNumber, + state: state2, + outputFiles, + isMaxBuffer, + verboseInfo + }, options)); + return { output: transformedOutput, ...state2 }; +}; +var transformOutputResultSync = ({ result, fileDescriptors, fdNumber, state: state2, outputFiles, isMaxBuffer, verboseInfo }, { buffer, encoding, lines, stripFinalNewline: stripFinalNewline2, maxBuffer }) => { + if (result === null) { + return; + } + const truncatedResult = truncateMaxBufferSync(result, isMaxBuffer, maxBuffer); + const uint8ArrayResult = bufferToUint8Array(truncatedResult); + const { stdioItems, objectMode } = fileDescriptors[fdNumber]; + const chunks = runOutputGeneratorsSync([uint8ArrayResult], stdioItems, encoding, state2); + const { serializedResult, finalResult = serializedResult } = serializeChunks({ + chunks, + objectMode, + encoding, + lines, + stripFinalNewline: stripFinalNewline2, + fdNumber + }); + logOutputSync({ + serializedResult, + fdNumber, + state: state2, + verboseInfo, + encoding, + stdioItems, + objectMode + }); + const returnedResult = buffer[fdNumber] ? finalResult : void 0; + try { + if (state2.error === void 0) { + writeToFiles(serializedResult, stdioItems, outputFiles); + } + return returnedResult; + } catch (error) { + state2.error = error; + return returnedResult; + } +}; +var runOutputGeneratorsSync = (chunks, stdioItems, encoding, state2) => { + try { + return runGeneratorsSync(chunks, stdioItems, encoding, false); + } catch (error) { + state2.error = error; + return chunks; + } +}; +var serializeChunks = ({ chunks, objectMode, encoding, lines, stripFinalNewline: stripFinalNewline2, fdNumber }) => { + if (objectMode) { + return { serializedResult: chunks }; + } + if (encoding === "buffer") { + return { serializedResult: joinToUint8Array(chunks) }; + } + const serializedResult = joinToString(chunks, encoding); + if (lines[fdNumber]) { + return { serializedResult, finalResult: splitLinesSync(serializedResult, !stripFinalNewline2[fdNumber], objectMode) }; + } + return { serializedResult }; +}; +var logOutputSync = ({ serializedResult, fdNumber, state: state2, verboseInfo, encoding, stdioItems, objectMode }) => { + if (!shouldLogOutput({ + stdioItems, + encoding, + verboseInfo, + fdNumber + })) { + return; + } + const linesArray = splitLinesSync(serializedResult, false, objectMode); + try { + logLinesSync(linesArray, fdNumber, verboseInfo); + } catch (error) { + state2.error ??= error; + } +}; +var writeToFiles = (serializedResult, stdioItems, outputFiles) => { + for (const { path: path7 } of stdioItems.filter(({ type: type2 }) => FILE_TYPES.has(type2))) { + const pathString = typeof path7 === "string" ? path7 : path7.toString(); + if (outputFiles.has(pathString)) { + (0, import_node_fs5.appendFileSync)(path7, serializedResult); + } else { + outputFiles.add(pathString); + (0, import_node_fs5.writeFileSync)(path7, serializedResult); + } + } +}; + +// node_modules/execa/lib/resolve/all-sync.js +var getAllSync = ([, stdout, stderr2], options) => { + if (!options.all) { + return; + } + if (stdout === void 0) { + return stderr2; + } + if (stderr2 === void 0) { + return stdout; + } + if (Array.isArray(stdout)) { + return Array.isArray(stderr2) ? [...stdout, ...stderr2] : [...stdout, stripNewline(stderr2, options, "all")]; + } + if (Array.isArray(stderr2)) { + return [stripNewline(stdout, options, "all"), ...stderr2]; + } + if (isUint8Array(stdout) && isUint8Array(stderr2)) { + return concatUint8Arrays([stdout, stderr2]); + } + return `${stdout}${stderr2}`; +}; + +// node_modules/execa/lib/resolve/exit-async.js +var import_node_events7 = require("node:events"); +var waitForExit = async (subprocess, context) => { + const [exitCode, signal] = await waitForExitOrError(subprocess); + context.isForcefullyTerminated ??= false; + return [exitCode, signal]; +}; +var waitForExitOrError = async (subprocess) => { + const [spawnPayload, exitPayload] = await Promise.allSettled([ + (0, import_node_events7.once)(subprocess, "spawn"), + (0, import_node_events7.once)(subprocess, "exit") + ]); + if (spawnPayload.status === "rejected") { + return []; + } + return exitPayload.status === "rejected" ? waitForSubprocessExit(subprocess) : exitPayload.value; +}; +var waitForSubprocessExit = async (subprocess) => { + try { + return await (0, import_node_events7.once)(subprocess, "exit"); + } catch { + return waitForSubprocessExit(subprocess); + } +}; +var waitForSuccessfulExit = async (exitPromise) => { + const [exitCode, signal] = await exitPromise; + if (!isSubprocessErrorExit(exitCode, signal) && isFailedExit(exitCode, signal)) { + throw new DiscardedError(); + } + return [exitCode, signal]; +}; +var isSubprocessErrorExit = (exitCode, signal) => exitCode === void 0 && signal === void 0; +var isFailedExit = (exitCode, signal) => exitCode !== 0 || signal !== null; + +// node_modules/execa/lib/resolve/exit-sync.js +var getExitResultSync = ({ error, status: exitCode, signal, output }, { maxBuffer }) => { + const resultError = getResultError(error, exitCode, signal); + const timedOut = resultError?.code === "ETIMEDOUT"; + const isMaxBuffer = isMaxBufferSync(resultError, output, maxBuffer); + return { + resultError, + exitCode, + signal, + timedOut, + isMaxBuffer + }; +}; +var getResultError = (error, exitCode, signal) => { + if (error !== void 0) { + return error; + } + return isFailedExit(exitCode, signal) ? new DiscardedError() : void 0; +}; + +// node_modules/execa/lib/methods/main-sync.js +var execaCoreSync = (rawFile, rawArguments, rawOptions) => { + const { file, commandArguments, command, escapedCommand, startTime, verboseInfo, options, fileDescriptors } = handleSyncArguments(rawFile, rawArguments, rawOptions); + const result = spawnSubprocessSync({ + file, + commandArguments, + options, + command, + escapedCommand, + verboseInfo, + fileDescriptors, + startTime + }); + return handleResult(result, verboseInfo, options); +}; +var handleSyncArguments = (rawFile, rawArguments, rawOptions) => { + const { command, escapedCommand, startTime, verboseInfo } = handleCommand(rawFile, rawArguments, rawOptions); + const syncOptions = normalizeSyncOptions(rawOptions); + const { file, commandArguments, options } = normalizeOptions(rawFile, rawArguments, syncOptions); + validateSyncOptions(options); + const fileDescriptors = handleStdioSync(options, verboseInfo); + return { + file, + commandArguments, + command, + escapedCommand, + startTime, + verboseInfo, + options, + fileDescriptors + }; +}; +var normalizeSyncOptions = (options) => options.node && !options.ipc ? { ...options, ipc: false } : options; +var validateSyncOptions = ({ ipc, ipcInput, detached, cancelSignal }) => { + if (ipcInput) { + throwInvalidSyncOption("ipcInput"); + } + if (ipc) { + throwInvalidSyncOption("ipc: true"); + } + if (detached) { + throwInvalidSyncOption("detached: true"); + } + if (cancelSignal) { + throwInvalidSyncOption("cancelSignal"); + } +}; +var throwInvalidSyncOption = (value) => { + throw new TypeError(`The "${value}" option cannot be used with synchronous methods.`); +}; +var spawnSubprocessSync = ({ file, commandArguments, options, command, escapedCommand, verboseInfo, fileDescriptors, startTime }) => { + const syncResult = runSubprocessSync({ + file, + commandArguments, + options, + command, + escapedCommand, + fileDescriptors, + startTime + }); + if (syncResult.failed) { + return syncResult; + } + const { resultError, exitCode, signal, timedOut, isMaxBuffer } = getExitResultSync(syncResult, options); + const { output, error = resultError } = transformOutputSync({ + fileDescriptors, + syncResult, + options, + isMaxBuffer, + verboseInfo + }); + const stdio = output.map((stdioOutput, fdNumber) => stripNewline(stdioOutput, options, fdNumber)); + const all3 = stripNewline(getAllSync(output, options), options, "all"); + return getSyncResult({ + error, + exitCode, + signal, + timedOut, + isMaxBuffer, + stdio, + all: all3, + options, + command, + escapedCommand, + startTime + }); +}; +var runSubprocessSync = ({ file, commandArguments, options, command, escapedCommand, fileDescriptors, startTime }) => { + try { + addInputOptionsSync(fileDescriptors, options); + const normalizedOptions = normalizeSpawnSyncOptions(options); + return (0, import_node_child_process2.spawnSync)(file, commandArguments, normalizedOptions); + } catch (error) { + return makeEarlyError({ + error, + command, + escapedCommand, + fileDescriptors, + options, + startTime, + isSync: true + }); + } +}; +var normalizeSpawnSyncOptions = ({ encoding, maxBuffer, ...options }) => ({ ...options, encoding: "buffer", maxBuffer: getMaxBufferSync(maxBuffer) }); +var getSyncResult = ({ error, exitCode, signal, timedOut, isMaxBuffer, stdio, all: all3, options, command, escapedCommand, startTime }) => error === void 0 ? makeSuccessResult({ + command, + escapedCommand, + stdio, + all: all3, + ipcOutput: [], + options, + startTime +}) : makeError({ + error, + command, + escapedCommand, + timedOut, + isCanceled: false, + isGracefullyCanceled: false, + isMaxBuffer, + isForcefullyTerminated: false, + exitCode, + signal, + stdio, + all: all3, + ipcOutput: [], + options, + startTime, + isSync: true +}); + +// node_modules/execa/lib/methods/main-async.js +var import_node_events14 = require("node:events"); +var import_node_child_process4 = require("node:child_process"); + +// node_modules/execa/lib/ipc/methods.js +var import_node_process13 = __toESM(require("node:process"), 1); + +// node_modules/execa/lib/ipc/get-one.js +var import_node_events8 = require("node:events"); +var getOneMessage = ({ anyProcess, channel, isSubprocess, ipc }, { reference = true, filter: filter2 } = {}) => { + validateIpcMethod({ + methodName: "getOneMessage", + isSubprocess, + ipc, + isConnected: isConnected(anyProcess) + }); + return getOneMessageAsync({ + anyProcess, + channel, + isSubprocess, + filter: filter2, + reference + }); +}; +var getOneMessageAsync = async ({ anyProcess, channel, isSubprocess, filter: filter2, reference }) => { + addReference(channel, reference); + const ipcEmitter = getIpcEmitter(anyProcess, channel, isSubprocess); + const controller = new AbortController(); + try { + return await Promise.race([ + getMessage(ipcEmitter, filter2, controller), + throwOnDisconnect2(ipcEmitter, isSubprocess, controller), + throwOnStrictError(ipcEmitter, isSubprocess, controller) + ]); + } catch (error) { + disconnect(anyProcess); + throw error; + } finally { + controller.abort(); + removeReference(channel, reference); + } +}; +var getMessage = async (ipcEmitter, filter2, { signal }) => { + if (filter2 === void 0) { + const [message] = await (0, import_node_events8.once)(ipcEmitter, "message", { signal }); + return message; + } + for await (const [message] of (0, import_node_events8.on)(ipcEmitter, "message", { signal })) { + if (filter2(message)) { + return message; + } + } +}; +var throwOnDisconnect2 = async (ipcEmitter, isSubprocess, { signal }) => { + await (0, import_node_events8.once)(ipcEmitter, "disconnect", { signal }); + throwOnEarlyDisconnect(isSubprocess); +}; +var throwOnStrictError = async (ipcEmitter, isSubprocess, { signal }) => { + const [error] = await (0, import_node_events8.once)(ipcEmitter, "strict:error", { signal }); + throw getStrictResponseError(error, isSubprocess); +}; + +// node_modules/execa/lib/ipc/get-each.js +var import_node_events9 = require("node:events"); +var getEachMessage = ({ anyProcess, channel, isSubprocess, ipc }, { reference = true } = {}) => loopOnMessages({ + anyProcess, + channel, + isSubprocess, + ipc, + shouldAwait: !isSubprocess, + reference +}); +var loopOnMessages = ({ anyProcess, channel, isSubprocess, ipc, shouldAwait, reference }) => { + validateIpcMethod({ + methodName: "getEachMessage", + isSubprocess, + ipc, + isConnected: isConnected(anyProcess) + }); + addReference(channel, reference); + const ipcEmitter = getIpcEmitter(anyProcess, channel, isSubprocess); + const controller = new AbortController(); + const state2 = {}; + stopOnDisconnect(anyProcess, ipcEmitter, controller); + abortOnStrictError({ + ipcEmitter, + isSubprocess, + controller, + state: state2 + }); + return iterateOnMessages({ + anyProcess, + channel, + ipcEmitter, + isSubprocess, + shouldAwait, + controller, + state: state2, + reference + }); +}; +var stopOnDisconnect = async (anyProcess, ipcEmitter, controller) => { + try { + await (0, import_node_events9.once)(ipcEmitter, "disconnect", { signal: controller.signal }); + controller.abort(); + } catch { + } +}; +var abortOnStrictError = async ({ ipcEmitter, isSubprocess, controller, state: state2 }) => { + try { + const [error] = await (0, import_node_events9.once)(ipcEmitter, "strict:error", { signal: controller.signal }); + state2.error = getStrictResponseError(error, isSubprocess); + controller.abort(); + } catch { + } +}; +var iterateOnMessages = async function* ({ anyProcess, channel, ipcEmitter, isSubprocess, shouldAwait, controller, state: state2, reference }) { + try { + for await (const [message] of (0, import_node_events9.on)(ipcEmitter, "message", { signal: controller.signal })) { + throwIfStrictError(state2); + yield message; + } + } catch { + throwIfStrictError(state2); + } finally { + controller.abort(); + removeReference(channel, reference); + if (!isSubprocess) { + disconnect(anyProcess); + } + if (shouldAwait) { + await anyProcess; + } + } +}; +var throwIfStrictError = ({ error }) => { + if (error) { + throw error; + } +}; + +// node_modules/execa/lib/ipc/methods.js +var addIpcMethods = (subprocess, { ipc }) => { + Object.assign(subprocess, getIpcMethods(subprocess, false, ipc)); +}; +var getIpcExport = () => { + const anyProcess = import_node_process13.default; + const isSubprocess = true; + const ipc = import_node_process13.default.channel !== void 0; + return { + ...getIpcMethods(anyProcess, isSubprocess, ipc), + getCancelSignal: getCancelSignal.bind(void 0, { + anyProcess, + channel: anyProcess.channel, + isSubprocess, + ipc + }) + }; +}; +var getIpcMethods = (anyProcess, isSubprocess, ipc) => ({ + sendMessage: sendMessage.bind(void 0, { + anyProcess, + channel: anyProcess.channel, + isSubprocess, + ipc + }), + getOneMessage: getOneMessage.bind(void 0, { + anyProcess, + channel: anyProcess.channel, + isSubprocess, + ipc + }), + getEachMessage: getEachMessage.bind(void 0, { + anyProcess, + channel: anyProcess.channel, + isSubprocess, + ipc + }) +}); + +// node_modules/execa/lib/return/early-error.js +var import_node_child_process3 = require("node:child_process"); +var import_node_stream2 = require("node:stream"); +var handleEarlyError = ({ error, command, escapedCommand, fileDescriptors, options, startTime, verboseInfo }) => { + cleanupCustomStreams(fileDescriptors); + const subprocess = new import_node_child_process3.ChildProcess(); + createDummyStreams(subprocess, fileDescriptors); + Object.assign(subprocess, { readable, writable, duplex }); + const earlyError = makeEarlyError({ + error, + command, + escapedCommand, + fileDescriptors, + options, + startTime, + isSync: false + }); + const promise = handleDummyPromise(earlyError, verboseInfo, options); + return { subprocess, promise }; +}; +var createDummyStreams = (subprocess, fileDescriptors) => { + const stdin = createDummyStream(); + const stdout = createDummyStream(); + const stderr2 = createDummyStream(); + const extraStdio = Array.from({ length: fileDescriptors.length - 3 }, createDummyStream); + const all3 = createDummyStream(); + const stdio = [stdin, stdout, stderr2, ...extraStdio]; + Object.assign(subprocess, { + stdin, + stdout, + stderr: stderr2, + all: all3, + stdio + }); +}; +var createDummyStream = () => { + const stream4 = new import_node_stream2.PassThrough(); + stream4.end(); + return stream4; +}; +var readable = () => new import_node_stream2.Readable({ read() { +} }); +var writable = () => new import_node_stream2.Writable({ write() { +} }); +var duplex = () => new import_node_stream2.Duplex({ read() { +}, write() { +} }); +var handleDummyPromise = async (error, verboseInfo, options) => handleResult(error, verboseInfo, options); + +// node_modules/execa/lib/stdio/handle-async.js +var import_node_fs6 = require("node:fs"); +var import_node_buffer3 = require("node:buffer"); +var import_node_stream3 = require("node:stream"); +var handleStdioAsync = (options, verboseInfo) => handleStdio(addPropertiesAsync, options, verboseInfo, false); +var forbiddenIfAsync = ({ type: type2, optionName }) => { + throw new TypeError(`The \`${optionName}\` option cannot be ${TYPE_TO_MESSAGE[type2]}.`); +}; +var addProperties2 = { + fileNumber: forbiddenIfAsync, + generator: generatorToStream, + asyncGenerator: generatorToStream, + nodeStream: ({ value }) => ({ stream: value }), + webTransform({ value: { transform, writableObjectMode, readableObjectMode } }) { + const objectMode = writableObjectMode || readableObjectMode; + const stream4 = import_node_stream3.Duplex.fromWeb(transform, { objectMode }); + return { stream: stream4 }; + }, + duplex: ({ value: { transform } }) => ({ stream: transform }), + native() { + } +}; +var addPropertiesAsync = { + input: { + ...addProperties2, + fileUrl: ({ value }) => ({ stream: (0, import_node_fs6.createReadStream)(value) }), + filePath: ({ value: { file } }) => ({ stream: (0, import_node_fs6.createReadStream)(file) }), + webStream: ({ value }) => ({ stream: import_node_stream3.Readable.fromWeb(value) }), + iterable: ({ value }) => ({ stream: import_node_stream3.Readable.from(value) }), + asyncIterable: ({ value }) => ({ stream: import_node_stream3.Readable.from(value) }), + string: ({ value }) => ({ stream: import_node_stream3.Readable.from(value) }), + uint8Array: ({ value }) => ({ stream: import_node_stream3.Readable.from(import_node_buffer3.Buffer.from(value)) }) + }, + output: { + ...addProperties2, + fileUrl: ({ value }) => ({ stream: (0, import_node_fs6.createWriteStream)(value) }), + filePath: ({ value: { file } }) => ({ stream: (0, import_node_fs6.createWriteStream)(file) }), + webStream: ({ value }) => ({ stream: import_node_stream3.Writable.fromWeb(value) }), + iterable: forbiddenIfAsync, + asyncIterable: forbiddenIfAsync, + string: forbiddenIfAsync, + uint8Array: forbiddenIfAsync + } +}; + +// node_modules/@sindresorhus/merge-streams/index.js +var import_node_events10 = require("node:events"); +var import_node_stream4 = require("node:stream"); +var import_promises6 = require("node:stream/promises"); +function mergeStreams(streams) { + if (!Array.isArray(streams)) { + throw new TypeError(`Expected an array, got \`${typeof streams}\`.`); + } + for (const stream4 of streams) { + validateStream(stream4); + } + const objectMode = streams.some(({ readableObjectMode }) => readableObjectMode); + const highWaterMark = getHighWaterMark(streams, objectMode); + const passThroughStream = new MergedStream({ + objectMode, + writableHighWaterMark: highWaterMark, + readableHighWaterMark: highWaterMark + }); + for (const stream4 of streams) { + passThroughStream.add(stream4); + } + return passThroughStream; +} +var getHighWaterMark = (streams, objectMode) => { + if (streams.length === 0) { + return (0, import_node_stream4.getDefaultHighWaterMark)(objectMode); + } + const highWaterMarks = streams.filter(({ readableObjectMode }) => readableObjectMode === objectMode).map(({ readableHighWaterMark }) => readableHighWaterMark); + return Math.max(...highWaterMarks); +}; +var MergedStream = class extends import_node_stream4.PassThrough { + #streams = /* @__PURE__ */ new Set([]); + #ended = /* @__PURE__ */ new Set([]); + #aborted = /* @__PURE__ */ new Set([]); + #onFinished; + #unpipeEvent = Symbol("unpipe"); + #streamPromises = /* @__PURE__ */ new WeakMap(); + add(stream4) { + validateStream(stream4); + if (this.#streams.has(stream4)) { + return; + } + this.#streams.add(stream4); + this.#onFinished ??= onMergedStreamFinished(this, this.#streams, this.#unpipeEvent); + const streamPromise = endWhenStreamsDone({ + passThroughStream: this, + stream: stream4, + streams: this.#streams, + ended: this.#ended, + aborted: this.#aborted, + onFinished: this.#onFinished, + unpipeEvent: this.#unpipeEvent + }); + this.#streamPromises.set(stream4, streamPromise); + stream4.pipe(this, { end: false }); + } + async remove(stream4) { + validateStream(stream4); + if (!this.#streams.has(stream4)) { + return false; + } + const streamPromise = this.#streamPromises.get(stream4); + if (streamPromise === void 0) { + return false; + } + this.#streamPromises.delete(stream4); + stream4.unpipe(this); + await streamPromise; + return true; + } +}; +var onMergedStreamFinished = async (passThroughStream, streams, unpipeEvent) => { + updateMaxListeners(passThroughStream, PASSTHROUGH_LISTENERS_COUNT); + const controller = new AbortController(); + try { + await Promise.race([ + onMergedStreamEnd(passThroughStream, controller), + onInputStreamsUnpipe(passThroughStream, streams, unpipeEvent, controller) + ]); + } finally { + controller.abort(); + updateMaxListeners(passThroughStream, -PASSTHROUGH_LISTENERS_COUNT); + } +}; +var onMergedStreamEnd = async (passThroughStream, { signal }) => { + try { + await (0, import_promises6.finished)(passThroughStream, { signal, cleanup: true }); + } catch (error) { + errorOrAbortStream(passThroughStream, error); + throw error; + } +}; +var onInputStreamsUnpipe = async (passThroughStream, streams, unpipeEvent, { signal }) => { + for await (const [unpipedStream] of (0, import_node_events10.on)(passThroughStream, "unpipe", { signal })) { + if (streams.has(unpipedStream)) { + unpipedStream.emit(unpipeEvent); + } + } +}; +var validateStream = (stream4) => { + if (typeof stream4?.pipe !== "function") { + throw new TypeError(`Expected a readable stream, got: \`${typeof stream4}\`.`); + } +}; +var endWhenStreamsDone = async ({ passThroughStream, stream: stream4, streams, ended, aborted: aborted2, onFinished, unpipeEvent }) => { + updateMaxListeners(passThroughStream, PASSTHROUGH_LISTENERS_PER_STREAM); + const controller = new AbortController(); + try { + await Promise.race([ + afterMergedStreamFinished(onFinished, stream4, controller), + onInputStreamEnd({ + passThroughStream, + stream: stream4, + streams, + ended, + aborted: aborted2, + controller + }), + onInputStreamUnpipe({ + stream: stream4, + streams, + ended, + aborted: aborted2, + unpipeEvent, + controller + }) + ]); + } finally { + controller.abort(); + updateMaxListeners(passThroughStream, -PASSTHROUGH_LISTENERS_PER_STREAM); + } + if (streams.size > 0 && streams.size === ended.size + aborted2.size) { + if (ended.size === 0 && aborted2.size > 0) { + abortStream(passThroughStream); + } else { + endStream(passThroughStream); + } + } +}; +var afterMergedStreamFinished = async (onFinished, stream4, { signal }) => { + try { + await onFinished; + if (!signal.aborted) { + abortStream(stream4); + } + } catch (error) { + if (!signal.aborted) { + errorOrAbortStream(stream4, error); + } + } +}; +var onInputStreamEnd = async ({ passThroughStream, stream: stream4, streams, ended, aborted: aborted2, controller: { signal } }) => { + try { + await (0, import_promises6.finished)(stream4, { + signal, + cleanup: true, + readable: true, + writable: false + }); + if (streams.has(stream4)) { + ended.add(stream4); + } + } catch (error) { + if (signal.aborted || !streams.has(stream4)) { + return; + } + if (isAbortError(error)) { + aborted2.add(stream4); + } else { + errorStream(passThroughStream, error); + } + } +}; +var onInputStreamUnpipe = async ({ stream: stream4, streams, ended, aborted: aborted2, unpipeEvent, controller: { signal } }) => { + await (0, import_node_events10.once)(stream4, unpipeEvent, { signal }); + if (!stream4.readable) { + return (0, import_node_events10.once)(signal, "abort", { signal }); + } + streams.delete(stream4); + ended.delete(stream4); + aborted2.delete(stream4); +}; +var endStream = (stream4) => { + if (stream4.writable) { + stream4.end(); + } +}; +var errorOrAbortStream = (stream4, error) => { + if (isAbortError(error)) { + abortStream(stream4); + } else { + errorStream(stream4, error); + } +}; +var isAbortError = (error) => error?.code === "ERR_STREAM_PREMATURE_CLOSE"; +var abortStream = (stream4) => { + if (stream4.readable || stream4.writable) { + stream4.destroy(); + } +}; +var errorStream = (stream4, error) => { + if (!stream4.destroyed) { + stream4.once("error", noop2); + stream4.destroy(error); + } +}; +var noop2 = () => { +}; +var updateMaxListeners = (passThroughStream, increment2) => { + const maxListeners = passThroughStream.getMaxListeners(); + if (maxListeners !== 0 && maxListeners !== Number.POSITIVE_INFINITY) { + passThroughStream.setMaxListeners(maxListeners + increment2); + } +}; +var PASSTHROUGH_LISTENERS_COUNT = 2; +var PASSTHROUGH_LISTENERS_PER_STREAM = 1; + +// node_modules/execa/lib/io/pipeline.js +var import_promises7 = require("node:stream/promises"); +var pipeStreams = (source, destination) => { + source.pipe(destination); + onSourceFinish(source, destination); + onDestinationFinish(source, destination); +}; +var onSourceFinish = async (source, destination) => { + if (isStandardStream(source) || isStandardStream(destination)) { + return; + } + try { + await (0, import_promises7.finished)(source, { cleanup: true, readable: true, writable: false }); + } catch { + } + endDestinationStream(destination); +}; +var endDestinationStream = (destination) => { + if (destination.writable) { + destination.end(); + } +}; +var onDestinationFinish = async (source, destination) => { + if (isStandardStream(source) || isStandardStream(destination)) { + return; + } + try { + await (0, import_promises7.finished)(destination, { cleanup: true, readable: false, writable: true }); + } catch { + } + abortSourceStream(source); +}; +var abortSourceStream = (source) => { + if (source.readable) { + source.destroy(); + } +}; + +// node_modules/execa/lib/io/output-async.js +var pipeOutputAsync = (subprocess, fileDescriptors, controller) => { + const pipeGroups = /* @__PURE__ */ new Map(); + for (const [fdNumber, { stdioItems, direction }] of Object.entries(fileDescriptors)) { + for (const { stream: stream4 } of stdioItems.filter(({ type: type2 }) => TRANSFORM_TYPES.has(type2))) { + pipeTransform(subprocess, stream4, direction, fdNumber); + } + for (const { stream: stream4 } of stdioItems.filter(({ type: type2 }) => !TRANSFORM_TYPES.has(type2))) { + pipeStdioItem({ + subprocess, + stream: stream4, + direction, + fdNumber, + pipeGroups, + controller + }); + } + } + for (const [outputStream, inputStreams] of pipeGroups.entries()) { + const inputStream = inputStreams.length === 1 ? inputStreams[0] : mergeStreams(inputStreams); + pipeStreams(inputStream, outputStream); + } +}; +var pipeTransform = (subprocess, stream4, direction, fdNumber) => { + if (direction === "output") { + pipeStreams(subprocess.stdio[fdNumber], stream4); + } else { + pipeStreams(stream4, subprocess.stdio[fdNumber]); + } + const streamProperty = SUBPROCESS_STREAM_PROPERTIES[fdNumber]; + if (streamProperty !== void 0) { + subprocess[streamProperty] = stream4; + } + subprocess.stdio[fdNumber] = stream4; +}; +var SUBPROCESS_STREAM_PROPERTIES = ["stdin", "stdout", "stderr"]; +var pipeStdioItem = ({ subprocess, stream: stream4, direction, fdNumber, pipeGroups, controller }) => { + if (stream4 === void 0) { + return; + } + setStandardStreamMaxListeners(stream4, controller); + const [inputStream, outputStream] = direction === "output" ? [stream4, subprocess.stdio[fdNumber]] : [subprocess.stdio[fdNumber], stream4]; + const outputStreams = pipeGroups.get(inputStream) ?? []; + pipeGroups.set(inputStream, [...outputStreams, outputStream]); +}; +var setStandardStreamMaxListeners = (stream4, { signal }) => { + if (isStandardStream(stream4)) { + incrementMaxListeners(stream4, MAX_LISTENERS_INCREMENT, signal); + } +}; +var MAX_LISTENERS_INCREMENT = 2; + +// node_modules/execa/lib/terminate/cleanup.js +var import_node_events11 = require("node:events"); + +// node_modules/execa/node_modules/signal-exit/dist/mjs/signals.js +var signals = []; +signals.push("SIGHUP", "SIGINT", "SIGTERM"); +if (process.platform !== "win32") { + signals.push( + "SIGALRM", + "SIGABRT", + "SIGVTALRM", + "SIGXCPU", + "SIGXFSZ", + "SIGUSR2", + "SIGTRAP", + "SIGSYS", + "SIGQUIT", + "SIGIOT" + ); +} +if (process.platform === "linux") { + signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT"); +} + +// node_modules/execa/node_modules/signal-exit/dist/mjs/index.js +var processOk = (process13) => !!process13 && typeof process13 === "object" && typeof process13.removeListener === "function" && typeof process13.emit === "function" && typeof process13.reallyExit === "function" && typeof process13.listeners === "function" && typeof process13.kill === "function" && typeof process13.pid === "number" && typeof process13.on === "function"; +var kExitEmitter = Symbol.for("signal-exit emitter"); +var global2 = globalThis; +var ObjectDefineProperty = Object.defineProperty.bind(Object); +var Emitter = class { + emitted = { + afterExit: false, + exit: false + }; + listeners = { + afterExit: [], + exit: [] + }; + count = 0; + id = Math.random(); + constructor() { + if (global2[kExitEmitter]) { + return global2[kExitEmitter]; + } + ObjectDefineProperty(global2, 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 i4 = list.indexOf(fn); + if (i4 === -1) { + return; + } + if (i4 === 0 && list.length === 1) { + list.length = 0; + } else { + list.splice(i4, 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 { +}; +var 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 { + #hupSig = process10.platform === "win32" ? "SIGINT" : "SIGHUP"; + #emitter = new Emitter(); + #process; + #originalProcessEmit; + #originalProcessReallyExit; + #sigListeners = {}; + #loaded = false; + constructor(process13) { + super(); + this.#process = process13; + this.#sigListeners = {}; + for (const sig of signals) { + this.#sigListeners[sig] = () => { + const listeners = this.#process.listeners(sig); + let { count: count2 } = this.#emitter; + const p4 = process13; + if (typeof p4.__signal_exit_emitter__ === "object" && typeof p4.__signal_exit_emitter__.count === "number") { + count2 += p4.__signal_exit_emitter__.count; + } + if (listeners.length === count2) { + this.unload(); + const ret = this.#emitter.emit("exit", null, sig); + const s2 = sig === "SIGHUP" ? this.#hupSig : sig; + if (!ret) + process13.kill(process13.pid, s2); + } + }; + } + this.#originalProcessReallyExit = process13.reallyExit; + this.#originalProcessEmit = process13.emit; + } + onExit(cb, opts) { + if (!processOk(this.#process)) { + return () => { + }; + } + 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) { + try { + const fn = this.#sigListeners[sig]; + if (fn) + this.#process.on(sig, fn); + } catch (_7) { + } + } + this.#process.emit = (ev, ...a5) => { + return this.#processEmit(ev, ...a5); + }; + this.#process.reallyExit = (code) => { + return this.#processReallyExit(code); + }; + } + unload() { + if (!this.#loaded) { + return; + } + this.#loaded = false; + signals.forEach((sig) => { + const listener = this.#sigListeners[sig]; + if (!listener) { + throw new Error("Listener not defined for signal: " + sig); + } + try { + this.#process.removeListener(sig, listener); + } catch (_7) { + } + }); + this.#process.emit = this.#originalProcessEmit; + this.#process.reallyExit = this.#originalProcessReallyExit; + this.#emitter.count -= 1; + } + #processReallyExit(code) { + if (!processOk(this.#process)) { + return 0; + } + this.#process.exitCode = code || 0; + 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]; + } + const ret = og.call(this.#process, ev, ...args); + this.#emitter.emit("exit", this.#process.exitCode, null); + return ret; + } else { + return og.call(this.#process, ev, ...args); + } + } +}; +var process10 = globalThis.process; +var { + onExit, + load, + unload +} = signalExitWrap(processOk(process10) ? new SignalExit(process10) : new SignalExitFallback()); + +// node_modules/execa/lib/terminate/cleanup.js +var cleanupOnExit = (subprocess, { cleanup, detached }, { signal }) => { + if (!cleanup || detached) { + return; + } + const removeExitHandler = onExit(() => { + subprocess.kill(); + }); + (0, import_node_events11.addAbortListener)(signal, () => { removeExitHandler(); }); }; -// node_modules/execa/lib/pipe.js -var import_node_fs = require("node:fs"); -var import_node_child_process = require("node:child_process"); - -// node_modules/is-stream/index.js -function isStream(stream4) { - return stream4 !== null && typeof stream4 === "object" && typeof stream4.pipe === "function"; -} -function isWritableStream(stream4) { - return isStream(stream4) && stream4.writable !== false && typeof stream4._write === "function" && typeof stream4._writableState === "object"; -} - -// node_modules/execa/lib/pipe.js -var isExecaChildProcess = (target) => target instanceof import_node_child_process.ChildProcess && typeof target.then === "function"; -var pipeToTarget = (spawned, streamName, target) => { - if (typeof target === "string") { - spawned[streamName].pipe((0, import_node_fs.createWriteStream)(target)); - return spawned; - } - if (isWritableStream(target)) { - spawned[streamName].pipe(target); - return spawned; - } - if (!isExecaChildProcess(target)) { - throw new TypeError("The second argument must be a string, a stream or an Execa child process."); - } - if (!isWritableStream(target.stdin)) { - throw new TypeError("The target child process's stdin must be available."); - } - spawned[streamName].pipe(target.stdin); - return target; +// node_modules/execa/lib/pipe/pipe-arguments.js +var normalizePipeArguments = ({ source, sourcePromise, boundOptions, createNested }, ...pipeArguments) => { + const startTime = getStartTime(); + const { + destination, + destinationStream, + destinationError, + from, + unpipeSignal + } = getDestinationStream(boundOptions, createNested, pipeArguments); + const { sourceStream, sourceError } = getSourceStream(source, from); + const { options: sourceOptions, fileDescriptors } = SUBPROCESS_OPTIONS.get(source); + return { + sourcePromise, + sourceStream, + sourceOptions, + sourceError, + destination, + destinationStream, + destinationError, + unpipeSignal, + fileDescriptors, + startTime + }; }; -var addPipeMethods = (spawned) => { - if (spawned.stdout !== null) { - spawned.pipeStdout = pipeToTarget.bind(void 0, spawned, "stdout"); +var getDestinationStream = (boundOptions, createNested, pipeArguments) => { + try { + const { + destination, + pipeOptions: { from, to, unpipeSignal } = {} + } = getDestination(boundOptions, createNested, ...pipeArguments); + const destinationStream = getToStream(destination, to); + return { + destination, + destinationStream, + from, + unpipeSignal + }; + } catch (error) { + return { destinationError: error }; } - if (spawned.stderr !== null) { - spawned.pipeStderr = pipeToTarget.bind(void 0, spawned, "stderr"); +}; +var getDestination = (boundOptions, createNested, firstArgument, ...pipeArguments) => { + if (Array.isArray(firstArgument)) { + const destination = createNested(mapDestinationArguments, boundOptions)(firstArgument, ...pipeArguments); + return { destination, pipeOptions: boundOptions }; } - if (spawned.all !== void 0) { - spawned.pipeAll = pipeToTarget.bind(void 0, spawned, "all"); + if (typeof firstArgument === "string" || firstArgument instanceof URL) { + if (Object.keys(boundOptions).length > 0) { + throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).'); + } + const [rawFile, rawArguments, rawOptions] = normalizeParameters(firstArgument, ...pipeArguments); + const destination = createNested(mapDestinationArguments)(rawFile, rawArguments, rawOptions); + return { destination, pipeOptions: rawOptions }; + } + if (SUBPROCESS_OPTIONS.has(firstArgument)) { + if (Object.keys(boundOptions).length > 0) { + throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`)."); + } + return { destination: firstArgument, pipeOptions: pipeArguments[0] }; + } + throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${firstArgument}`); +}; +var mapDestinationArguments = ({ options }) => ({ options: { ...options, stdin: "pipe", piped: true } }); +var getSourceStream = (source, from) => { + try { + const sourceStream = getFromStream(source, from); + return { sourceStream }; + } catch (error) { + return { sourceError: error }; } }; -// node_modules/execa/lib/stream.js -var import_node_fs2 = require("node:fs"); -var import_get_stream = __toESM(require_get_stream(), 1); -var import_merge_stream = __toESM(require_merge_stream(), 1); -var validateInputOptions = (input) => { - if (input !== void 0) { - throw new TypeError("The `input` and `inputFile` options cannot be both set."); +// node_modules/execa/lib/pipe/throw.js +var handlePipeArgumentsError = ({ + sourceStream, + sourceError, + destinationStream, + destinationError, + fileDescriptors, + sourceOptions, + startTime +}) => { + const error = getPipeArgumentsError({ + sourceStream, + sourceError, + destinationStream, + destinationError + }); + if (error !== void 0) { + throw createNonCommandError({ + error, + fileDescriptors, + sourceOptions, + startTime + }); } }; -var getInputSync = ({ input, inputFile }) => { - if (typeof inputFile !== "string") { - return input; +var getPipeArgumentsError = ({ sourceStream, sourceError, destinationStream, destinationError }) => { + if (sourceError !== void 0 && destinationError !== void 0) { + return destinationError; } - validateInputOptions(input); - return (0, import_node_fs2.readFileSync)(inputFile); -}; -var handleInputSync = (options) => { - const input = getInputSync(options); - if (isStream(input)) { - throw new TypeError("The `input` option cannot be a stream in sync mode"); + if (destinationError !== void 0) { + abortSourceStream(sourceStream); + return destinationError; } - return input; -}; -var getInput = ({ input, inputFile }) => { - if (typeof inputFile !== "string") { - return input; + if (sourceError !== void 0) { + endDestinationStream(destinationStream); + return sourceError; } - validateInputOptions(input); - return (0, import_node_fs2.createReadStream)(inputFile); }; -var handleInput = (spawned, options) => { - const input = getInput(options); - if (input === void 0) { +var createNonCommandError = ({ error, fileDescriptors, sourceOptions, startTime }) => makeEarlyError({ + error, + command: PIPE_COMMAND_MESSAGE, + escapedCommand: PIPE_COMMAND_MESSAGE, + fileDescriptors, + options: sourceOptions, + startTime, + isSync: false +}); +var PIPE_COMMAND_MESSAGE = "source.pipe(destination)"; + +// node_modules/execa/lib/pipe/sequence.js +var waitForBothSubprocesses = async (subprocessPromises) => { + const [ + { status: sourceStatus, reason: sourceReason, value: sourceResult = sourceReason }, + { status: destinationStatus, reason: destinationReason, value: destinationResult = destinationReason } + ] = await subprocessPromises; + if (!destinationResult.pipedFrom.includes(sourceResult)) { + destinationResult.pipedFrom.push(sourceResult); + } + if (destinationStatus === "rejected") { + throw destinationResult; + } + if (sourceStatus === "rejected") { + throw sourceResult; + } + return destinationResult; +}; + +// node_modules/execa/lib/pipe/streaming.js +var import_promises8 = require("node:stream/promises"); +var pipeSubprocessStream = (sourceStream, destinationStream, maxListenersController) => { + const mergedStream = MERGED_STREAMS.has(destinationStream) ? pipeMoreSubprocessStream(sourceStream, destinationStream) : pipeFirstSubprocessStream(sourceStream, destinationStream); + incrementMaxListeners(sourceStream, SOURCE_LISTENERS_PER_PIPE, maxListenersController.signal); + incrementMaxListeners(destinationStream, DESTINATION_LISTENERS_PER_PIPE, maxListenersController.signal); + cleanupMergedStreamsMap(destinationStream); + return mergedStream; +}; +var pipeFirstSubprocessStream = (sourceStream, destinationStream) => { + const mergedStream = mergeStreams([sourceStream]); + pipeStreams(mergedStream, destinationStream); + MERGED_STREAMS.set(destinationStream, mergedStream); + return mergedStream; +}; +var pipeMoreSubprocessStream = (sourceStream, destinationStream) => { + const mergedStream = MERGED_STREAMS.get(destinationStream); + mergedStream.add(sourceStream); + return mergedStream; +}; +var cleanupMergedStreamsMap = async (destinationStream) => { + try { + await (0, import_promises8.finished)(destinationStream, { cleanup: true, readable: false, writable: true }); + } catch { + } + MERGED_STREAMS.delete(destinationStream); +}; +var MERGED_STREAMS = /* @__PURE__ */ new WeakMap(); +var SOURCE_LISTENERS_PER_PIPE = 2; +var DESTINATION_LISTENERS_PER_PIPE = 1; + +// node_modules/execa/lib/pipe/abort.js +var import_node_util7 = require("node:util"); +var unpipeOnAbort = (unpipeSignal, unpipeContext) => unpipeSignal === void 0 ? [] : [unpipeOnSignalAbort(unpipeSignal, unpipeContext)]; +var unpipeOnSignalAbort = async (unpipeSignal, { sourceStream, mergedStream, fileDescriptors, sourceOptions, startTime }) => { + await (0, import_node_util7.aborted)(unpipeSignal, sourceStream); + await mergedStream.remove(sourceStream); + const error = new Error("Pipe canceled by `unpipeSignal` option."); + throw createNonCommandError({ + error, + fileDescriptors, + sourceOptions, + startTime + }); +}; + +// node_modules/execa/lib/pipe/setup.js +var pipeToSubprocess = (sourceInfo, ...pipeArguments) => { + if (isPlainObject(pipeArguments[0])) { + return pipeToSubprocess.bind(void 0, { + ...sourceInfo, + boundOptions: { ...sourceInfo.boundOptions, ...pipeArguments[0] } + }); + } + const { destination, ...normalizedInfo } = normalizePipeArguments(sourceInfo, ...pipeArguments); + const promise = handlePipePromise({ ...normalizedInfo, destination }); + promise.pipe = pipeToSubprocess.bind(void 0, { + ...sourceInfo, + source: destination, + sourcePromise: promise, + boundOptions: {} + }); + return promise; +}; +var handlePipePromise = async ({ + sourcePromise, + sourceStream, + sourceOptions, + sourceError, + destination, + destinationStream, + destinationError, + unpipeSignal, + fileDescriptors, + startTime +}) => { + const subprocessPromises = getSubprocessPromises(sourcePromise, destination); + handlePipeArgumentsError({ + sourceStream, + sourceError, + destinationStream, + destinationError, + fileDescriptors, + sourceOptions, + startTime + }); + const maxListenersController = new AbortController(); + try { + const mergedStream = pipeSubprocessStream(sourceStream, destinationStream, maxListenersController); + return await Promise.race([ + waitForBothSubprocesses(subprocessPromises), + ...unpipeOnAbort(unpipeSignal, { + sourceStream, + mergedStream, + sourceOptions, + fileDescriptors, + startTime + }) + ]); + } finally { + maxListenersController.abort(); + } +}; +var getSubprocessPromises = (sourcePromise, destination) => Promise.allSettled([sourcePromise, destination]); + +// node_modules/execa/lib/io/contents.js +var import_promises9 = require("node:timers/promises"); + +// node_modules/execa/lib/io/iterate.js +var import_node_events12 = require("node:events"); +var import_node_stream5 = require("node:stream"); +var iterateOnSubprocessStream = ({ subprocessStdout, subprocess, binary, shouldEncode, encoding, preserveNewlines }) => { + const controller = new AbortController(); + stopReadingOnExit(subprocess, controller); + return iterateOnStream({ + stream: subprocessStdout, + controller, + binary, + shouldEncode: !subprocessStdout.readableObjectMode && shouldEncode, + encoding, + shouldSplit: !subprocessStdout.readableObjectMode, + preserveNewlines + }); +}; +var stopReadingOnExit = async (subprocess, controller) => { + try { + await subprocess; + } catch { + } finally { + controller.abort(); + } +}; +var iterateForResult = ({ stream: stream4, onStreamEnd, lines, encoding, stripFinalNewline: stripFinalNewline2, allMixed }) => { + const controller = new AbortController(); + stopReadingOnStreamEnd(onStreamEnd, controller, stream4); + const objectMode = stream4.readableObjectMode && !allMixed; + return iterateOnStream({ + stream: stream4, + controller, + binary: encoding === "buffer", + shouldEncode: !objectMode, + encoding, + shouldSplit: !objectMode && lines, + preserveNewlines: !stripFinalNewline2 + }); +}; +var stopReadingOnStreamEnd = async (onStreamEnd, controller, stream4) => { + try { + await onStreamEnd; + } catch { + stream4.destroy(); + } finally { + controller.abort(); + } +}; +var iterateOnStream = ({ stream: stream4, controller, binary, shouldEncode, encoding, shouldSplit, preserveNewlines }) => { + const onStdoutChunk = (0, import_node_events12.on)(stream4, "data", { + signal: controller.signal, + highWaterMark: HIGH_WATER_MARK, + highWatermark: HIGH_WATER_MARK + }); + return iterateOnData({ + onStdoutChunk, + controller, + binary, + shouldEncode, + encoding, + shouldSplit, + preserveNewlines + }); +}; +var DEFAULT_OBJECT_HIGH_WATER_MARK = (0, import_node_stream5.getDefaultHighWaterMark)(true); +var HIGH_WATER_MARK = DEFAULT_OBJECT_HIGH_WATER_MARK; +var iterateOnData = async function* ({ onStdoutChunk, controller, binary, shouldEncode, encoding, shouldSplit, preserveNewlines }) { + const generators = getGenerators({ + binary, + shouldEncode, + encoding, + shouldSplit, + preserveNewlines + }); + try { + for await (const [chunk] of onStdoutChunk) { + yield* transformChunkSync(chunk, generators, 0); + } + } catch (error) { + if (!controller.signal.aborted) { + throw error; + } + } finally { + yield* finalChunksSync(generators); + } +}; +var getGenerators = ({ binary, shouldEncode, encoding, shouldSplit, preserveNewlines }) => [ + getEncodingTransformGenerator(binary, encoding, !shouldEncode), + getSplitLinesGenerator(binary, preserveNewlines, !shouldSplit, {}) +].filter(Boolean); + +// node_modules/execa/lib/io/contents.js +var getStreamOutput = async ({ stream: stream4, onStreamEnd, fdNumber, encoding, buffer, maxBuffer, lines, allMixed, stripFinalNewline: stripFinalNewline2, verboseInfo, streamInfo }) => { + const logPromise = logOutputAsync({ + stream: stream4, + onStreamEnd, + fdNumber, + encoding, + allMixed, + verboseInfo, + streamInfo + }); + if (!buffer) { + await Promise.all([resumeStream(stream4), logPromise]); return; } - if (isStream(input)) { - input.pipe(spawned.stdin); - } else { - spawned.stdin.end(input); - } + const stripFinalNewlineValue = getStripFinalNewline(stripFinalNewline2, fdNumber); + const iterable = iterateForResult({ + stream: stream4, + onStreamEnd, + lines, + encoding, + stripFinalNewline: stripFinalNewlineValue, + allMixed + }); + const [output] = await Promise.all([ + getStreamContents2({ + stream: stream4, + iterable, + fdNumber, + encoding, + maxBuffer, + lines + }), + logPromise + ]); + return output; }; -var makeAllStream = (spawned, { all: all3 }) => { - if (!all3 || !spawned.stdout && !spawned.stderr) { +var logOutputAsync = async ({ stream: stream4, onStreamEnd, fdNumber, encoding, allMixed, verboseInfo, streamInfo: { fileDescriptors } }) => { + if (!shouldLogOutput({ + stdioItems: fileDescriptors[fdNumber]?.stdioItems, + encoding, + verboseInfo, + fdNumber + })) { return; } - const mixed = (0, import_merge_stream.default)(); - if (spawned.stdout) { - mixed.add(spawned.stdout); - } - if (spawned.stderr) { - mixed.add(spawned.stderr); - } - return mixed; + const linesIterable = iterateForResult({ + stream: stream4, + onStreamEnd, + lines: true, + encoding, + stripFinalNewline: true, + allMixed + }); + await logLines(linesIterable, stream4, fdNumber, verboseInfo); }; -var getBufferedData = async (stream4, streamPromise) => { - if (!stream4 || streamPromise === void 0) { - return; +var resumeStream = async (stream4) => { + await (0, import_promises9.setImmediate)(); + if (stream4.readableFlowing === null) { + stream4.resume(); } - stream4.destroy(); +}; +var getStreamContents2 = async ({ stream: stream4, stream: { readableObjectMode }, iterable, fdNumber, encoding, maxBuffer, lines }) => { + try { + if (readableObjectMode || lines) { + return await getStreamAsArray(iterable, { maxBuffer }); + } + if (encoding === "buffer") { + return new Uint8Array(await getStreamAsArrayBuffer(iterable, { maxBuffer })); + } + return await getStreamAsString(iterable, { maxBuffer }); + } catch (error) { + return handleBufferedData(handleMaxBuffer({ + error, + stream: stream4, + readableObjectMode, + lines, + encoding, + fdNumber + })); + } +}; +var getBufferedData = async (streamPromise) => { try { return await streamPromise; } catch (error) { - return error.bufferedData; + return handleBufferedData(error); } }; -var getStreamPromise = (stream4, { encoding, buffer, maxBuffer }) => { - if (!stream4 || !buffer) { +var handleBufferedData = ({ bufferedData }) => isArrayBuffer(bufferedData) ? new Uint8Array(bufferedData) : bufferedData; + +// node_modules/execa/lib/resolve/wait-stream.js +var import_promises10 = require("node:stream/promises"); +var waitForStream = async (stream4, fdNumber, streamInfo, { isSameDirection, stopOnExit = false } = {}) => { + const state2 = handleStdinDestroy(stream4, streamInfo); + const abortController = new AbortController(); + try { + await Promise.race([ + ...stopOnExit ? [streamInfo.exitPromise] : [], + (0, import_promises10.finished)(stream4, { cleanup: true, signal: abortController.signal }) + ]); + } catch (error) { + if (!state2.stdinCleanedUp) { + handleStreamError(error, fdNumber, streamInfo, isSameDirection); + } + } finally { + abortController.abort(); + } +}; +var handleStdinDestroy = (stream4, { originalStreams: [originalStdin], subprocess }) => { + const state2 = { stdinCleanedUp: false }; + if (stream4 === originalStdin) { + spyOnStdinDestroy(stream4, subprocess, state2); + } + return state2; +}; +var spyOnStdinDestroy = (subprocessStdin, subprocess, state2) => { + const { _destroy } = subprocessStdin; + subprocessStdin._destroy = (...destroyArguments) => { + setStdinCleanedUp(subprocess, state2); + _destroy.call(subprocessStdin, ...destroyArguments); + }; +}; +var setStdinCleanedUp = ({ exitCode, signalCode }, state2) => { + if (exitCode !== null || signalCode !== null) { + state2.stdinCleanedUp = true; + } +}; +var handleStreamError = (error, fdNumber, streamInfo, isSameDirection) => { + if (!shouldIgnoreStreamError(error, fdNumber, streamInfo, isSameDirection)) { + throw error; + } +}; +var shouldIgnoreStreamError = (error, fdNumber, streamInfo, isSameDirection = true) => { + if (streamInfo.propagating) { + return isStreamEpipe(error) || isStreamAbort(error); + } + streamInfo.propagating = true; + return isInputFileDescriptor(streamInfo, fdNumber) === isSameDirection ? isStreamEpipe(error) : isStreamAbort(error); +}; +var isInputFileDescriptor = ({ fileDescriptors }, fdNumber) => fdNumber !== "all" && fileDescriptors[fdNumber].direction === "input"; +var isStreamAbort = (error) => error?.code === "ERR_STREAM_PREMATURE_CLOSE"; +var isStreamEpipe = (error) => error?.code === "EPIPE"; + +// node_modules/execa/lib/resolve/stdio.js +var waitForStdioStreams = ({ subprocess, encoding, buffer, maxBuffer, lines, stripFinalNewline: stripFinalNewline2, verboseInfo, streamInfo }) => subprocess.stdio.map((stream4, fdNumber) => waitForSubprocessStream({ + stream: stream4, + fdNumber, + encoding, + buffer: buffer[fdNumber], + maxBuffer: maxBuffer[fdNumber], + lines: lines[fdNumber], + allMixed: false, + stripFinalNewline: stripFinalNewline2, + verboseInfo, + streamInfo +})); +var waitForSubprocessStream = async ({ stream: stream4, fdNumber, encoding, buffer, maxBuffer, lines, allMixed, stripFinalNewline: stripFinalNewline2, verboseInfo, streamInfo }) => { + if (!stream4) { return; } - if (encoding) { - return (0, import_get_stream.default)(stream4, { encoding, maxBuffer }); + const onStreamEnd = waitForStream(stream4, fdNumber, streamInfo); + if (isInputFileDescriptor(streamInfo, fdNumber)) { + await onStreamEnd; + return; } - return import_get_stream.default.buffer(stream4, { maxBuffer }); + const [output] = await Promise.all([ + getStreamOutput({ + stream: stream4, + onStreamEnd, + fdNumber, + encoding, + buffer, + maxBuffer, + lines, + allMixed, + stripFinalNewline: stripFinalNewline2, + verboseInfo, + streamInfo + }), + onStreamEnd + ]); + return output; }; -var getSpawnedResult = async ({ stdout, stderr: stderr2, all: all3 }, { encoding, buffer, maxBuffer }, processDone) => { - const stdoutPromise = getStreamPromise(stdout, { encoding, buffer, maxBuffer }); - const stderrPromise = getStreamPromise(stderr2, { encoding, buffer, maxBuffer }); - const allPromise = getStreamPromise(all3, { encoding, buffer, maxBuffer: maxBuffer * 2 }); + +// node_modules/execa/lib/resolve/all-async.js +var makeAllStream = ({ stdout, stderr: stderr2 }, { all: all3 }) => all3 && (stdout || stderr2) ? mergeStreams([stdout, stderr2].filter(Boolean)) : void 0; +var waitForAllStream = ({ subprocess, encoding, buffer, maxBuffer, lines, stripFinalNewline: stripFinalNewline2, verboseInfo, streamInfo }) => waitForSubprocessStream({ + ...getAllStream(subprocess, buffer), + fdNumber: "all", + encoding, + maxBuffer: maxBuffer[1] + maxBuffer[2], + lines: lines[1] || lines[2], + allMixed: getAllMixed(subprocess), + stripFinalNewline: stripFinalNewline2, + verboseInfo, + streamInfo +}); +var getAllStream = ({ stdout, stderr: stderr2, all: all3 }, [, bufferStdout, bufferStderr]) => { + const buffer = bufferStdout || bufferStderr; + if (!buffer) { + return { stream: all3, buffer }; + } + if (!bufferStdout) { + return { stream: stderr2, buffer }; + } + if (!bufferStderr) { + return { stream: stdout, buffer }; + } + return { stream: all3, buffer }; +}; +var getAllMixed = ({ all: all3, stdout, stderr: stderr2 }) => all3 && stdout && stderr2 && stdout.readableObjectMode !== stderr2.readableObjectMode; + +// node_modules/execa/lib/resolve/wait-subprocess.js +var import_node_events13 = require("node:events"); + +// node_modules/execa/lib/verbose/ipc.js +var shouldLogIpc = (verboseInfo) => isFullVerbose(verboseInfo, "ipc"); +var logIpcOutput = (message, verboseInfo) => { + const verboseMessage = serializeVerboseMessage(message); + verboseLog({ + type: "ipc", + verboseMessage, + fdNumber: "ipc", + verboseInfo + }); +}; + +// node_modules/execa/lib/ipc/buffer-messages.js +var waitForIpcOutput = async ({ + subprocess, + buffer: bufferArray, + maxBuffer: maxBufferArray, + ipc, + ipcOutput, + verboseInfo +}) => { + if (!ipc) { + return ipcOutput; + } + const isVerbose2 = shouldLogIpc(verboseInfo); + const buffer = getFdSpecificValue(bufferArray, "ipc"); + const maxBuffer = getFdSpecificValue(maxBufferArray, "ipc"); + for await (const message of loopOnMessages({ + anyProcess: subprocess, + channel: subprocess.channel, + isSubprocess: false, + ipc, + shouldAwait: false, + reference: true + })) { + if (buffer) { + checkIpcMaxBuffer(subprocess, ipcOutput, maxBuffer); + ipcOutput.push(message); + } + if (isVerbose2) { + logIpcOutput(message, verboseInfo); + } + } + return ipcOutput; +}; +var getBufferedIpcOutput = async (ipcOutputPromise, ipcOutput) => { + await Promise.allSettled([ipcOutputPromise]); + return ipcOutput; +}; + +// node_modules/execa/lib/resolve/wait-subprocess.js +var waitForSubprocessResult = async ({ + subprocess, + options: { + encoding, + buffer, + maxBuffer, + lines, + timeoutDuration: timeout, + cancelSignal, + gracefulCancel, + forceKillAfterDelay, + stripFinalNewline: stripFinalNewline2, + ipc, + ipcInput + }, + context, + verboseInfo, + fileDescriptors, + originalStreams, + onInternalError, + controller +}) => { + const exitPromise = waitForExit(subprocess, context); + const streamInfo = { + originalStreams, + fileDescriptors, + subprocess, + exitPromise, + propagating: false + }; + const stdioPromises = waitForStdioStreams({ + subprocess, + encoding, + buffer, + maxBuffer, + lines, + stripFinalNewline: stripFinalNewline2, + verboseInfo, + streamInfo + }); + const allPromise = waitForAllStream({ + subprocess, + encoding, + buffer, + maxBuffer, + lines, + stripFinalNewline: stripFinalNewline2, + verboseInfo, + streamInfo + }); + const ipcOutput = []; + const ipcOutputPromise = waitForIpcOutput({ + subprocess, + buffer, + maxBuffer, + ipc, + ipcOutput, + verboseInfo + }); + const originalPromises = waitForOriginalStreams(originalStreams, subprocess, streamInfo); + const customStreamsEndPromises = waitForCustomStreamsEnd(fileDescriptors, streamInfo); try { - return await Promise.all([processDone, stdoutPromise, stderrPromise, allPromise]); + return await Promise.race([ + Promise.all([ + {}, + waitForSuccessfulExit(exitPromise), + Promise.all(stdioPromises), + allPromise, + ipcOutputPromise, + sendIpcInput(subprocess, ipcInput), + ...originalPromises, + ...customStreamsEndPromises + ]), + onInternalError, + throwOnSubprocessError(subprocess, controller), + ...throwOnTimeout(subprocess, timeout, context, controller), + ...throwOnCancel({ + subprocess, + cancelSignal, + gracefulCancel, + context, + controller + }), + ...throwOnGracefulCancel({ + subprocess, + cancelSignal, + gracefulCancel, + forceKillAfterDelay, + context, + controller + }) + ]); } catch (error) { + context.terminationReason ??= "other"; return Promise.all([ - { error, signal: error.signal, timedOut: error.timedOut }, - getBufferedData(stdout, stdoutPromise), - getBufferedData(stderr2, stderrPromise), - getBufferedData(all3, allPromise) + { error }, + exitPromise, + Promise.all(stdioPromises.map((stdioPromise) => getBufferedData(stdioPromise))), + getBufferedData(allPromise), + getBufferedIpcOutput(ipcOutputPromise, ipcOutput), + Promise.allSettled(originalPromises), + Promise.allSettled(customStreamsEndPromises) ]); } }; +var waitForOriginalStreams = (originalStreams, subprocess, streamInfo) => originalStreams.map((stream4, fdNumber) => stream4 === subprocess.stdio[fdNumber] ? void 0 : waitForStream(stream4, fdNumber, streamInfo)); +var waitForCustomStreamsEnd = (fileDescriptors, streamInfo) => fileDescriptors.flatMap(({ stdioItems }, fdNumber) => stdioItems.filter(({ value, stream: stream4 = value }) => isStream(stream4, { checkOpen: false }) && !isStandardStream(stream4)).map(({ type: type2, value, stream: stream4 = value }) => waitForStream(stream4, fdNumber, streamInfo, { + isSameDirection: TRANSFORM_TYPES.has(type2), + stopOnExit: type2 === "native" +}))); +var throwOnSubprocessError = async (subprocess, { signal }) => { + const [error] = await (0, import_node_events13.once)(subprocess, "error", { signal }); + throw error; +}; -// node_modules/execa/lib/promise.js +// node_modules/execa/lib/convert/concurrent.js +var initializeConcurrentStreams = () => ({ + readableDestroy: /* @__PURE__ */ new WeakMap(), + writableFinal: /* @__PURE__ */ new WeakMap(), + writableDestroy: /* @__PURE__ */ new WeakMap() +}); +var addConcurrentStream = (concurrentStreams, stream4, waitName) => { + const weakMap = concurrentStreams[waitName]; + if (!weakMap.has(stream4)) { + weakMap.set(stream4, []); + } + const promises = weakMap.get(stream4); + const promise = createDeferred(); + promises.push(promise); + const resolve = promise.resolve.bind(promise); + return { resolve, promises }; +}; +var waitForConcurrentStreams = async ({ resolve, promises }, subprocess) => { + resolve(); + const [isSubprocessExit] = await Promise.race([ + Promise.allSettled([true, subprocess]), + Promise.all([false, ...promises]) + ]); + return !isSubprocessExit; +}; + +// node_modules/execa/lib/convert/readable.js +var import_node_stream6 = require("node:stream"); +var import_node_util8 = require("node:util"); + +// node_modules/execa/lib/convert/shared.js +var import_promises11 = require("node:stream/promises"); +var safeWaitForSubprocessStdin = async (subprocessStdin) => { + if (subprocessStdin === void 0) { + return; + } + try { + await waitForSubprocessStdin(subprocessStdin); + } catch { + } +}; +var safeWaitForSubprocessStdout = async (subprocessStdout) => { + if (subprocessStdout === void 0) { + return; + } + try { + await waitForSubprocessStdout(subprocessStdout); + } catch { + } +}; +var waitForSubprocessStdin = async (subprocessStdin) => { + await (0, import_promises11.finished)(subprocessStdin, { cleanup: true, readable: false, writable: true }); +}; +var waitForSubprocessStdout = async (subprocessStdout) => { + await (0, import_promises11.finished)(subprocessStdout, { cleanup: true, readable: true, writable: false }); +}; +var waitForSubprocess = async (subprocess, error) => { + await subprocess; + if (error) { + throw error; + } +}; +var destroyOtherStream = (stream4, isOpen, error) => { + if (error && !isStreamAbort(error)) { + stream4.destroy(error); + } else if (isOpen) { + stream4.destroy(); + } +}; + +// node_modules/execa/lib/convert/readable.js +var createReadable = ({ subprocess, concurrentStreams, encoding }, { from, binary: binaryOption = true, preserveNewlines = true } = {}) => { + const binary = binaryOption || BINARY_ENCODINGS.has(encoding); + const { subprocessStdout, waitReadableDestroy } = getSubprocessStdout(subprocess, from, concurrentStreams); + const { readableEncoding, readableObjectMode, readableHighWaterMark } = getReadableOptions(subprocessStdout, binary); + const { read, onStdoutDataDone } = getReadableMethods({ + subprocessStdout, + subprocess, + binary, + encoding, + preserveNewlines + }); + const readable2 = new import_node_stream6.Readable({ + read, + destroy: (0, import_node_util8.callbackify)(onReadableDestroy.bind(void 0, { subprocessStdout, subprocess, waitReadableDestroy })), + highWaterMark: readableHighWaterMark, + objectMode: readableObjectMode, + encoding: readableEncoding + }); + onStdoutFinished({ + subprocessStdout, + onStdoutDataDone, + readable: readable2, + subprocess + }); + return readable2; +}; +var getSubprocessStdout = (subprocess, from, concurrentStreams) => { + const subprocessStdout = getFromStream(subprocess, from); + const waitReadableDestroy = addConcurrentStream(concurrentStreams, subprocessStdout, "readableDestroy"); + return { subprocessStdout, waitReadableDestroy }; +}; +var getReadableOptions = ({ readableEncoding, readableObjectMode, readableHighWaterMark }, binary) => binary ? { readableEncoding, readableObjectMode, readableHighWaterMark } : { readableEncoding, readableObjectMode: true, readableHighWaterMark: DEFAULT_OBJECT_HIGH_WATER_MARK }; +var getReadableMethods = ({ subprocessStdout, subprocess, binary, encoding, preserveNewlines }) => { + const onStdoutDataDone = createDeferred(); + const onStdoutData = iterateOnSubprocessStream({ + subprocessStdout, + subprocess, + binary, + shouldEncode: !binary, + encoding, + preserveNewlines + }); + return { + read() { + onRead(this, onStdoutData, onStdoutDataDone); + }, + onStdoutDataDone + }; +}; +var onRead = async (readable2, onStdoutData, onStdoutDataDone) => { + try { + const { value, done } = await onStdoutData.next(); + if (done) { + onStdoutDataDone.resolve(); + } else { + readable2.push(value); + } + } catch { + } +}; +var onStdoutFinished = async ({ subprocessStdout, onStdoutDataDone, readable: readable2, subprocess, subprocessStdin }) => { + try { + await waitForSubprocessStdout(subprocessStdout); + await subprocess; + await safeWaitForSubprocessStdin(subprocessStdin); + await onStdoutDataDone; + if (readable2.readable) { + readable2.push(null); + } + } catch (error) { + await safeWaitForSubprocessStdin(subprocessStdin); + destroyOtherReadable(readable2, error); + } +}; +var onReadableDestroy = async ({ subprocessStdout, subprocess, waitReadableDestroy }, error) => { + if (await waitForConcurrentStreams(waitReadableDestroy, subprocess)) { + destroyOtherReadable(subprocessStdout, error); + await waitForSubprocess(subprocess, error); + } +}; +var destroyOtherReadable = (stream4, error) => { + destroyOtherStream(stream4, stream4.readable, error); +}; + +// node_modules/execa/lib/convert/writable.js +var import_node_stream7 = require("node:stream"); +var import_node_util9 = require("node:util"); +var createWritable = ({ subprocess, concurrentStreams }, { to } = {}) => { + const { subprocessStdin, waitWritableFinal, waitWritableDestroy } = getSubprocessStdin(subprocess, to, concurrentStreams); + const writable2 = new import_node_stream7.Writable({ + ...getWritableMethods(subprocessStdin, subprocess, waitWritableFinal), + destroy: (0, import_node_util9.callbackify)(onWritableDestroy.bind(void 0, { + subprocessStdin, + subprocess, + waitWritableFinal, + waitWritableDestroy + })), + highWaterMark: subprocessStdin.writableHighWaterMark, + objectMode: subprocessStdin.writableObjectMode + }); + onStdinFinished(subprocessStdin, writable2); + return writable2; +}; +var getSubprocessStdin = (subprocess, to, concurrentStreams) => { + const subprocessStdin = getToStream(subprocess, to); + const waitWritableFinal = addConcurrentStream(concurrentStreams, subprocessStdin, "writableFinal"); + const waitWritableDestroy = addConcurrentStream(concurrentStreams, subprocessStdin, "writableDestroy"); + return { subprocessStdin, waitWritableFinal, waitWritableDestroy }; +}; +var getWritableMethods = (subprocessStdin, subprocess, waitWritableFinal) => ({ + write: onWrite.bind(void 0, subprocessStdin), + final: (0, import_node_util9.callbackify)(onWritableFinal.bind(void 0, subprocessStdin, subprocess, waitWritableFinal)) +}); +var onWrite = (subprocessStdin, chunk, encoding, done) => { + if (subprocessStdin.write(chunk, encoding)) { + done(); + } else { + subprocessStdin.once("drain", done); + } +}; +var onWritableFinal = async (subprocessStdin, subprocess, waitWritableFinal) => { + if (await waitForConcurrentStreams(waitWritableFinal, subprocess)) { + if (subprocessStdin.writable) { + subprocessStdin.end(); + } + await subprocess; + } +}; +var onStdinFinished = async (subprocessStdin, writable2, subprocessStdout) => { + try { + await waitForSubprocessStdin(subprocessStdin); + if (writable2.writable) { + writable2.end(); + } + } catch (error) { + await safeWaitForSubprocessStdout(subprocessStdout); + destroyOtherWritable(writable2, error); + } +}; +var onWritableDestroy = async ({ subprocessStdin, subprocess, waitWritableFinal, waitWritableDestroy }, error) => { + await waitForConcurrentStreams(waitWritableFinal, subprocess); + if (await waitForConcurrentStreams(waitWritableDestroy, subprocess)) { + destroyOtherWritable(subprocessStdin, error); + await waitForSubprocess(subprocess, error); + } +}; +var destroyOtherWritable = (stream4, error) => { + destroyOtherStream(stream4, stream4.writable, error); +}; + +// node_modules/execa/lib/convert/duplex.js +var import_node_stream8 = require("node:stream"); +var import_node_util10 = require("node:util"); +var createDuplex = ({ subprocess, concurrentStreams, encoding }, { from, to, binary: binaryOption = true, preserveNewlines = true } = {}) => { + const binary = binaryOption || BINARY_ENCODINGS.has(encoding); + const { subprocessStdout, waitReadableDestroy } = getSubprocessStdout(subprocess, from, concurrentStreams); + const { subprocessStdin, waitWritableFinal, waitWritableDestroy } = getSubprocessStdin(subprocess, to, concurrentStreams); + const { readableEncoding, readableObjectMode, readableHighWaterMark } = getReadableOptions(subprocessStdout, binary); + const { read, onStdoutDataDone } = getReadableMethods({ + subprocessStdout, + subprocess, + binary, + encoding, + preserveNewlines + }); + const duplex2 = new import_node_stream8.Duplex({ + read, + ...getWritableMethods(subprocessStdin, subprocess, waitWritableFinal), + destroy: (0, import_node_util10.callbackify)(onDuplexDestroy.bind(void 0, { + subprocessStdout, + subprocessStdin, + subprocess, + waitReadableDestroy, + waitWritableFinal, + waitWritableDestroy + })), + readableHighWaterMark, + writableHighWaterMark: subprocessStdin.writableHighWaterMark, + readableObjectMode, + writableObjectMode: subprocessStdin.writableObjectMode, + encoding: readableEncoding + }); + onStdoutFinished({ + subprocessStdout, + onStdoutDataDone, + readable: duplex2, + subprocess, + subprocessStdin + }); + onStdinFinished(subprocessStdin, duplex2, subprocessStdout); + return duplex2; +}; +var onDuplexDestroy = async ({ subprocessStdout, subprocessStdin, subprocess, waitReadableDestroy, waitWritableFinal, waitWritableDestroy }, error) => { + await Promise.all([ + onReadableDestroy({ subprocessStdout, subprocess, waitReadableDestroy }, error), + onWritableDestroy({ + subprocessStdin, + subprocess, + waitWritableFinal, + waitWritableDestroy + }, error) + ]); +}; + +// node_modules/execa/lib/convert/iterable.js +var createIterable = (subprocess, encoding, { + from, + binary: binaryOption = false, + preserveNewlines = false +} = {}) => { + const binary = binaryOption || BINARY_ENCODINGS.has(encoding); + const subprocessStdout = getFromStream(subprocess, from); + const onStdoutData = iterateOnSubprocessStream({ + subprocessStdout, + subprocess, + binary, + shouldEncode: true, + encoding, + preserveNewlines + }); + return iterateOnStdoutData(onStdoutData, subprocessStdout, subprocess); +}; +var iterateOnStdoutData = async function* (onStdoutData, subprocessStdout, subprocess) { + try { + yield* onStdoutData; + } finally { + if (subprocessStdout.readable) { + subprocessStdout.destroy(); + } + await subprocess; + } +}; + +// node_modules/execa/lib/convert/add.js +var addConvertedStreams = (subprocess, { encoding }) => { + const concurrentStreams = initializeConcurrentStreams(); + subprocess.readable = createReadable.bind(void 0, { subprocess, concurrentStreams, encoding }); + subprocess.writable = createWritable.bind(void 0, { subprocess, concurrentStreams }); + subprocess.duplex = createDuplex.bind(void 0, { subprocess, concurrentStreams, encoding }); + subprocess.iterable = createIterable.bind(void 0, subprocess, encoding); + subprocess[Symbol.asyncIterator] = createIterable.bind(void 0, subprocess, encoding, {}); +}; + +// node_modules/execa/lib/methods/promise.js +var mergePromise = (subprocess, promise) => { + for (const [property, descriptor] of descriptors) { + const value = descriptor.value.bind(promise); + Reflect.defineProperty(subprocess, property, { ...descriptor, value }); + } +}; var nativePromisePrototype = (async () => { })().constructor.prototype; var descriptors = ["then", "catch", "finally"].map((property) => [ property, Reflect.getOwnPropertyDescriptor(nativePromisePrototype, property) ]); -var mergePromise = (spawned, promise) => { - for (const [property, descriptor] of descriptors) { - const value = typeof promise === "function" ? (...args) => Reflect.apply(descriptor.value, promise(), args) : descriptor.value.bind(promise); - Reflect.defineProperty(spawned, property, { ...descriptor, value }); - } + +// node_modules/execa/lib/methods/main-async.js +var execaCoreAsync = (rawFile, rawArguments, rawOptions, createNested) => { + const { file, commandArguments, command, escapedCommand, startTime, verboseInfo, options, fileDescriptors } = handleAsyncArguments(rawFile, rawArguments, rawOptions); + const { subprocess, promise } = spawnSubprocessAsync({ + file, + commandArguments, + options, + startTime, + verboseInfo, + command, + escapedCommand, + fileDescriptors + }); + subprocess.pipe = pipeToSubprocess.bind(void 0, { + source: subprocess, + sourcePromise: promise, + boundOptions: {}, + createNested + }); + mergePromise(subprocess, promise); + SUBPROCESS_OPTIONS.set(subprocess, { options, fileDescriptors }); + return subprocess; }; -var getSpawnedPromise = (spawned) => new Promise((resolve, reject) => { - spawned.on("exit", (exitCode, signal) => { - resolve({ exitCode, signal }); - }); - spawned.on("error", (error) => { - reject(error); - }); - if (spawned.stdin) { - spawned.stdin.on("error", (error) => { - reject(error); +var handleAsyncArguments = (rawFile, rawArguments, rawOptions) => { + const { command, escapedCommand, startTime, verboseInfo } = handleCommand(rawFile, rawArguments, rawOptions); + const { file, commandArguments, options: normalizedOptions } = normalizeOptions(rawFile, rawArguments, rawOptions); + const options = handleAsyncOptions(normalizedOptions); + const fileDescriptors = handleStdioAsync(options, verboseInfo); + return { + file, + commandArguments, + command, + escapedCommand, + startTime, + verboseInfo, + options, + fileDescriptors + }; +}; +var handleAsyncOptions = ({ timeout, signal, ...options }) => { + if (signal !== void 0) { + throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.'); + } + return { ...options, timeoutDuration: timeout }; +}; +var spawnSubprocessAsync = ({ file, commandArguments, options, startTime, verboseInfo, command, escapedCommand, fileDescriptors }) => { + let subprocess; + try { + subprocess = (0, import_node_child_process4.spawn)(file, commandArguments, options); + } catch (error) { + return handleEarlyError({ + error, + command, + escapedCommand, + fileDescriptors, + options, + startTime, + verboseInfo }); } + const controller = new AbortController(); + (0, import_node_events14.setMaxListeners)(Number.POSITIVE_INFINITY, controller.signal); + const originalStreams = [...subprocess.stdio]; + pipeOutputAsync(subprocess, fileDescriptors, controller); + cleanupOnExit(subprocess, options, controller); + const context = {}; + const onInternalError = createDeferred(); + subprocess.kill = subprocessKill.bind(void 0, { + kill: subprocess.kill.bind(subprocess), + options, + onInternalError, + context, + controller + }); + subprocess.all = makeAllStream(subprocess, options); + addConvertedStreams(subprocess, options); + addIpcMethods(subprocess, options); + const promise = handlePromise({ + subprocess, + options, + startTime, + verboseInfo, + fileDescriptors, + originalStreams, + command, + escapedCommand, + context, + onInternalError, + controller + }); + return { subprocess, promise }; +}; +var handlePromise = async ({ subprocess, options, startTime, verboseInfo, fileDescriptors, originalStreams, command, escapedCommand, context, onInternalError, controller }) => { + const [ + errorInfo, + [exitCode, signal], + stdioResults, + allResult, + ipcOutput + ] = await waitForSubprocessResult({ + subprocess, + options, + context, + verboseInfo, + fileDescriptors, + originalStreams, + onInternalError, + controller + }); + controller.abort(); + onInternalError.resolve(); + const stdio = stdioResults.map((stdioResult, fdNumber) => stripNewline(stdioResult, options, fdNumber)); + const all3 = stripNewline(allResult, options, "all"); + const result = getAsyncResult({ + errorInfo, + exitCode, + signal, + stdio, + all: all3, + ipcOutput, + context, + options, + command, + escapedCommand, + startTime + }); + return handleResult(result, verboseInfo, options); +}; +var getAsyncResult = ({ errorInfo, exitCode, signal, stdio, all: all3, ipcOutput, context, options, command, escapedCommand, startTime }) => "error" in errorInfo ? makeError({ + error: errorInfo.error, + command, + escapedCommand, + timedOut: context.terminationReason === "timeout", + isCanceled: context.terminationReason === "cancel" || context.terminationReason === "gracefulCancel", + isGracefullyCanceled: context.terminationReason === "gracefulCancel", + isMaxBuffer: errorInfo.error instanceof MaxBufferError, + isForcefullyTerminated: context.isForcefullyTerminated, + exitCode, + signal, + stdio, + all: all3, + ipcOutput, + options, + startTime, + isSync: false +}) : makeSuccessResult({ + command, + escapedCommand, + stdio, + all: all3, + ipcOutput, + options, + startTime }); -// node_modules/execa/lib/command.js -var import_node_buffer = require("node:buffer"); -var import_node_child_process2 = require("node:child_process"); -var normalizeArgs = (file, args = []) => { - if (!Array.isArray(args)) { - return [file]; - } - return [file, ...args]; -}; -var NO_ESCAPE_REGEXP = /^[\w.-]+$/; -var DOUBLE_QUOTES_REGEXP = /"/g; -var escapeArg = (arg) => { - if (typeof arg !== "string" || NO_ESCAPE_REGEXP.test(arg)) { - return arg; - } - return `"${arg.replace(DOUBLE_QUOTES_REGEXP, '\\"')}"`; -}; -var joinCommand = (file, args) => normalizeArgs(file, args).join(" "); -var getEscapedCommand = (file, args) => normalizeArgs(file, args).map((arg) => escapeArg(arg)).join(" "); -var SPACES_REGEXP = / +/g; -var parseExpression = (expression) => { - const typeOfExpression = typeof expression; - if (typeOfExpression === "string") { - return expression; - } - if (typeOfExpression === "number") { - return String(expression); - } - if (typeOfExpression === "object" && expression !== null && !(expression instanceof import_node_child_process2.ChildProcess) && "stdout" in expression) { - const typeOfStdout = typeof expression.stdout; - if (typeOfStdout === "string") { - return expression.stdout; - } - if (import_node_buffer.Buffer.isBuffer(expression.stdout)) { - return expression.stdout.toString(); - } - throw new TypeError(`Unexpected "${typeOfStdout}" stdout in template expression`); - } - throw new TypeError(`Unexpected "${typeOfExpression}" in template expression`); -}; -var concatTokens = (tokens, nextTokens, isNew) => isNew || tokens.length === 0 || nextTokens.length === 0 ? [...tokens, ...nextTokens] : [ - ...tokens.slice(0, -1), - `${tokens[tokens.length - 1]}${nextTokens[0]}`, - ...nextTokens.slice(1) -]; -var parseTemplate = ({ templates, expressions, tokens, index, template }) => { - const templateString = template ?? templates.raw[index]; - const templateTokens = templateString.split(SPACES_REGEXP).filter(Boolean); - const newTokens = concatTokens( - tokens, - templateTokens, - templateString.startsWith(" ") - ); - if (index === expressions.length) { - return newTokens; - } - const expression = expressions[index]; - const expressionTokens = Array.isArray(expression) ? expression.map((expression2) => parseExpression(expression2)) : [parseExpression(expression)]; - return concatTokens( - newTokens, - expressionTokens, - templateString.endsWith(" ") +// node_modules/execa/lib/methods/bind.js +var mergeOptions = (boundOptions, options) => { + const newOptions = Object.fromEntries( + Object.entries(options).map(([optionName, optionValue]) => [ + optionName, + mergeOption(optionName, boundOptions[optionName], optionValue) + ]) ); + return { ...boundOptions, ...newOptions }; }; -var parseTemplates = (templates, expressions) => { - let tokens = []; - for (const [index, template] of templates.entries()) { - tokens = parseTemplate({ templates, expressions, tokens, index, template }); +var mergeOption = (optionName, boundOptionValue, optionValue) => { + if (DEEP_OPTIONS.has(optionName) && isPlainObject(boundOptionValue) && isPlainObject(optionValue)) { + return { ...boundOptionValue, ...optionValue }; + } + return optionValue; +}; +var DEEP_OPTIONS = /* @__PURE__ */ new Set(["env", ...FD_SPECIFIC_OPTIONS]); + +// node_modules/execa/lib/methods/create.js +var createExeca = (mapArguments, boundOptions, deepOptions, setBoundExeca) => { + const createNested = (mapArguments2, boundOptions2, setBoundExeca2) => createExeca(mapArguments2, boundOptions2, deepOptions, setBoundExeca2); + const boundExeca = (...execaArguments) => callBoundExeca({ + mapArguments, + deepOptions, + boundOptions, + setBoundExeca, + createNested + }, ...execaArguments); + if (setBoundExeca !== void 0) { + setBoundExeca(boundExeca, createNested, boundOptions); + } + return boundExeca; +}; +var callBoundExeca = ({ mapArguments, deepOptions = {}, boundOptions = {}, setBoundExeca, createNested }, firstArgument, ...nextArguments) => { + if (isPlainObject(firstArgument)) { + return createNested(mapArguments, mergeOptions(boundOptions, firstArgument), setBoundExeca); + } + const { file, commandArguments, options, isSync } = parseArguments({ + mapArguments, + firstArgument, + nextArguments, + deepOptions, + boundOptions + }); + return isSync ? execaCoreSync(file, commandArguments, options) : execaCoreAsync(file, commandArguments, options, createNested); +}; +var parseArguments = ({ mapArguments, firstArgument, nextArguments, deepOptions, boundOptions }) => { + const callArguments = isTemplateString(firstArgument) ? parseTemplates(firstArgument, nextArguments) : [firstArgument, ...nextArguments]; + const [initialFile, initialArguments, initialOptions] = normalizeParameters(...callArguments); + const mergedOptions = mergeOptions(mergeOptions(deepOptions, boundOptions), initialOptions); + const { + file = initialFile, + commandArguments = initialArguments, + options = mergedOptions, + isSync = false + } = mapArguments({ file: initialFile, commandArguments: initialArguments, options: mergedOptions }); + return { + file, + commandArguments, + options, + isSync + }; +}; + +// node_modules/execa/lib/methods/command.js +var mapCommandAsync = ({ file, commandArguments }) => parseCommand(file, commandArguments); +var mapCommandSync = ({ file, commandArguments }) => ({ ...parseCommand(file, commandArguments), isSync: true }); +var parseCommand = (command, unusedArguments) => { + if (unusedArguments.length > 0) { + throw new TypeError(`The command and its arguments must be passed as a single string: ${command} ${unusedArguments}.`); + } + const [file, ...commandArguments] = parseCommandString(command); + return { file, commandArguments }; +}; +var parseCommandString = (command) => { + if (typeof command !== "string") { + throw new TypeError(`The command must be a string: ${String(command)}.`); + } + const trimmedCommand = command.trim(); + if (trimmedCommand === "") { + return []; + } + const tokens = []; + for (const token of trimmedCommand.split(SPACES_REGEXP)) { + const previousToken = tokens.at(-1); + if (previousToken && previousToken.endsWith("\\")) { + tokens[tokens.length - 1] = `${previousToken.slice(0, -1)} ${token}`; + } else { + tokens.push(token); + } } return tokens; }; +var SPACES_REGEXP = / +/g; -// node_modules/execa/lib/verbose.js -var import_node_util = require("node:util"); -var import_node_process6 = __toESM(require("node:process"), 1); -var verboseDefault = (0, import_node_util.debuglog)("execa").enabled; -var padField = (field, padding) => String(field).padStart(padding, "0"); -var getTimestamp = () => { - const date = new Date(); - return `${padField(date.getHours(), 2)}:${padField(date.getMinutes(), 2)}:${padField(date.getSeconds(), 2)}.${padField(date.getMilliseconds(), 3)}`; -}; -var logCommand = (escapedCommand, { verbose }) => { - if (!verbose) { - return; - } - import_node_process6.default.stderr.write(`[${getTimestamp()}] ${escapedCommand} -`); +// node_modules/execa/lib/methods/script.js +var setScriptSync = (boundExeca, createNested, boundOptions) => { + boundExeca.sync = createNested(mapScriptSync, boundOptions); + boundExeca.s = boundExeca.sync; }; +var mapScriptAsync = ({ options }) => getScriptOptions(options); +var mapScriptSync = ({ options }) => ({ ...getScriptOptions(options), isSync: true }); +var getScriptOptions = (options) => ({ options: { ...getScriptStdinOption(options), ...options } }); +var getScriptStdinOption = ({ input, inputFile, stdio }) => input === void 0 && inputFile === void 0 && stdio === void 0 ? { stdin: "inherit" } : {}; +var deepScriptOptions = { preferLocal: true }; // node_modules/execa/index.js -var DEFAULT_MAX_BUFFER = 1e3 * 1e3 * 100; -var getEnv = ({ env: envOption, extendEnv, preferLocal, localDir, execPath }) => { - const env2 = extendEnv ? { ...import_node_process7.default.env, ...envOption } : envOption; - if (preferLocal) { - return npmRunPathEnv({ env: env2, cwd: localDir, execPath }); - } - return env2; -}; -var handleArguments = (file, args, options = {}) => { - const parsed = import_cross_spawn.default._parse(file, args, options); - file = parsed.command; - args = parsed.args; - options = parsed.options; - options = { - maxBuffer: DEFAULT_MAX_BUFFER, - buffer: true, - stripFinalNewline: true, - extendEnv: true, - preferLocal: false, - localDir: options.cwd || import_node_process7.default.cwd(), - execPath: import_node_process7.default.execPath, - encoding: "utf8", - reject: true, - cleanup: true, - all: false, - windowsHide: true, - verbose: verboseDefault, - ...options - }; - options.env = getEnv(options); - options.stdio = normalizeStdio(options); - if (import_node_process7.default.platform === "win32" && import_node_path2.default.basename(file, ".exe") === "cmd") { - args.unshift("/q"); - } - return { file, args, options, parsed }; -}; -var handleOutput = (options, value, error) => { - if (typeof value !== "string" && !import_node_buffer2.Buffer.isBuffer(value)) { - return error === void 0 ? void 0 : ""; - } - if (options.stripFinalNewline) { - return stripFinalNewline(value); - } - return value; -}; -function execa(file, args, options) { - const parsed = handleArguments(file, args, options); - const command = joinCommand(file, args); - const escapedCommand = getEscapedCommand(file, args); - logCommand(escapedCommand, parsed.options); - validateTimeout(parsed.options); - let spawned; - try { - spawned = import_node_child_process3.default.spawn(parsed.file, parsed.args, parsed.options); - } catch (error) { - const dummySpawned = new import_node_child_process3.default.ChildProcess(); - const errorPromise = Promise.reject(makeError({ - error, - stdout: "", - stderr: "", - all: "", - command, - escapedCommand, - parsed, - timedOut: false, - isCanceled: false, - killed: false - })); - mergePromise(dummySpawned, errorPromise); - return dummySpawned; - } - const spawnedPromise = getSpawnedPromise(spawned); - const timedPromise = setupTimeout(spawned, parsed.options, spawnedPromise); - const processDone = setExitHandler(spawned, parsed.options, timedPromise); - const context = { isCanceled: false }; - spawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned)); - spawned.cancel = spawnedCancel.bind(null, spawned, context); - const handlePromise = async () => { - const [{ error, exitCode, signal, timedOut }, stdoutResult, stderrResult, allResult] = await getSpawnedResult(spawned, parsed.options, processDone); - const stdout = handleOutput(parsed.options, stdoutResult); - const stderr2 = handleOutput(parsed.options, stderrResult); - const all3 = handleOutput(parsed.options, allResult); - if (error || exitCode !== 0 || signal !== null) { - const returnedError = makeError({ - error, - exitCode, - signal, - stdout, - stderr: stderr2, - all: all3, - command, - escapedCommand, - parsed, - timedOut, - isCanceled: context.isCanceled || (parsed.options.signal ? parsed.options.signal.aborted : false), - killed: spawned.killed - }); - if (!parsed.options.reject) { - return returnedError; - } - throw returnedError; - } - return { - command, - escapedCommand, - exitCode: 0, - stdout, - stderr: stderr2, - all: all3, - failed: false, - timedOut: false, - isCanceled: false, - killed: false - }; - }; - const handlePromiseOnce = onetime_default(handlePromise); - handleInput(spawned, parsed.options); - spawned.all = makeAllStream(spawned, parsed.options); - addPipeMethods(spawned); - mergePromise(spawned, handlePromiseOnce); - return spawned; -} -function execaSync(file, args, options) { - const parsed = handleArguments(file, args, options); - const command = joinCommand(file, args); - const escapedCommand = getEscapedCommand(file, args); - logCommand(escapedCommand, parsed.options); - const input = handleInputSync(parsed.options); - let result; - try { - result = import_node_child_process3.default.spawnSync(parsed.file, parsed.args, { ...parsed.options, input }); - } catch (error) { - throw makeError({ - error, - stdout: "", - stderr: "", - all: "", - command, - escapedCommand, - parsed, - timedOut: false, - isCanceled: false, - killed: false - }); - } - const stdout = handleOutput(parsed.options, result.stdout, result.error); - const stderr2 = handleOutput(parsed.options, result.stderr, result.error); - if (result.error || result.status !== 0 || result.signal !== null) { - const error = makeError({ - stdout, - stderr: stderr2, - error: result.error, - signal: result.signal, - exitCode: result.status, - command, - escapedCommand, - parsed, - timedOut: result.error && result.error.code === "ETIMEDOUT", - isCanceled: false, - killed: result.signal !== null - }); - if (!parsed.options.reject) { - return error; - } - throw error; - } - return { - command, - escapedCommand, - exitCode: 0, - stdout, - stderr: stderr2, - failed: false, - timedOut: false, - isCanceled: false, - killed: false - }; -} -var normalizeScriptStdin = ({ input, inputFile, stdio }) => input === void 0 && inputFile === void 0 && stdio === void 0 ? { stdin: "inherit" } : {}; -var normalizeScriptOptions = (options = {}) => ({ - preferLocal: true, - ...normalizeScriptStdin(options), - ...options -}); -function create$(options) { - function $6(templatesOrOptions, ...expressions) { - if (!Array.isArray(templatesOrOptions)) { - return create$({ ...options, ...templatesOrOptions }); - } - const [file, ...args] = parseTemplates(templatesOrOptions, expressions); - return execa(file, args, normalizeScriptOptions(options)); - } - $6.sync = (templates, ...expressions) => { - if (!Array.isArray(templates)) { - throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`."); - } - const [file, ...args] = parseTemplates(templates, expressions); - return execaSync(file, args, normalizeScriptOptions(options)); - }; - return $6; -} -var $4 = create$(); +var execa = createExeca(() => ({})); +var execaSync = createExeca(() => ({ isSync: true })); +var execaCommand = createExeca(mapCommandAsync); +var execaCommandSync = createExeca(mapCommandSync); +var execaNode = createExeca(mapNode); +var $4 = createExeca(mapScriptAsync, {}, deepScriptOptions, setScriptSync); +var { + sendMessage: sendMessage2, + getOneMessage: getOneMessage2, + getEachMessage: getEachMessage2, + getCancelSignal: getCancelSignal2 +} = getIpcExport(); // src/commands/config.ts var dotenv = __toESM(require_main(), 1); @@ -27730,8 +32943,8 @@ var I18N_CONFIG_ALIAS = { }; function getI18nLocal(value) { for (const key in I18N_CONFIG_ALIAS) { - const aliases2 = I18N_CONFIG_ALIAS[key]; - if (aliases2.includes(value)) { + const aliases = I18N_CONFIG_ALIAS[key]; + if (aliases.includes(value)) { return key; } } @@ -27752,6 +32965,7 @@ var CONFIG_KEYS = /* @__PURE__ */ ((CONFIG_KEYS2) => { CONFIG_KEYS2["OCO_EMOJI"] = "OCO_EMOJI"; CONFIG_KEYS2["OCO_MODEL"] = "OCO_MODEL"; CONFIG_KEYS2["OCO_LANGUAGE"] = "OCO_LANGUAGE"; + CONFIG_KEYS2["OCO_WHY"] = "OCO_WHY"; CONFIG_KEYS2["OCO_MESSAGE_TEMPLATE_PLACEHOLDER"] = "OCO_MESSAGE_TEMPLATE_PLACEHOLDER"; CONFIG_KEYS2["OCO_PROMPT_MODULE"] = "OCO_PROMPT_MODULE"; CONFIG_KEYS2["OCO_AI_PROVIDER"] = "OCO_AI_PROVIDER"; @@ -28042,6 +33256,7 @@ var DEFAULT_CONFIG = { OCO_ONE_LINE_COMMIT: false, OCO_TEST_MOCK_TYPE: "commit-message", OCO_FLOWISE_ENDPOINT: ":", + OCO_WHY: false, OCO_GITPUSH: true }; var initGlobalConfig = (configPath = defaultConfigPath) => { @@ -28358,7 +33573,7 @@ init_File(); // node_modules/@anthropic-ai/sdk/_shims/node-runtime.mjs var import_agentkeepalive = __toESM(require_agentkeepalive(), 1); var import_abort_controller = __toESM(require_abort_controller(), 1); -var import_node_fs3 = require("node:fs"); +var import_node_fs7 = require("node:fs"); // node_modules/form-data-encoder/lib/esm/util/createBoundary.js var alphabet = "abcdefghijklmnopqrstuvwxyz0123456789"; @@ -28374,7 +33589,7 @@ var createBoundary_default = createBoundary; // node_modules/form-data-encoder/lib/esm/util/isPlainObject.js var getType = (value) => Object.prototype.toString.call(value).slice(8, -1).toLowerCase(); -function isPlainObject(value) { +function isPlainObject2(value) { if (getType(value) !== "object") { return false; } @@ -28385,11 +33600,11 @@ function isPlainObject(value) { const Ctor = pp.constructor && pp.constructor.toString(); return Ctor === Object.toString(); } -var isPlainObject_default = isPlainObject; +var isPlainObject_default = isPlainObject2; // node_modules/form-data-encoder/lib/esm/util/normalizeValue.js -var normalizeValue = (value) => String(value).replace(/\r|\n/g, (match, i3, str2) => { - if (match === "\r" && str2[i3 + 1] !== "\n" || match === "\n" && str2[i3 - 1] !== "\r") { +var normalizeValue = (value) => String(value).replace(/\r|\n/g, (match, i4, str2) => { + if (match === "\r" && str2[i4 + 1] !== "\n" || match === "\n" && str2[i4 - 1] !== "\r") { return "\r\n"; } return match; @@ -28537,7 +33752,7 @@ var FormDataEncoder = class { }; // node_modules/@anthropic-ai/sdk/_shims/node-runtime.mjs -var import_node_stream = require("node:stream"); +var import_node_stream9 = require("node:stream"); // node_modules/@anthropic-ai/sdk/_shims/MultipartBody.mjs var MultipartBody = class { @@ -28552,20 +33767,20 @@ var MultipartBody = class { // node_modules/@anthropic-ai/sdk/_shims/node-runtime.mjs var import_ponyfill_es2018 = __toESM(require_ponyfill_es2018(), 1); var fileFromPathWarned = false; -async function fileFromPath3(path5, ...args) { +async function fileFromPath3(path7, ...args) { const { fileFromPath: _fileFromPath } = await Promise.resolve().then(() => (init_fileFromPath(), fileFromPath_exports)); if (!fileFromPathWarned) { - console.warn(`fileFromPath is deprecated; use fs.createReadStream(${JSON.stringify(path5)}) instead`); + console.warn(`fileFromPath is deprecated; use fs.createReadStream(${JSON.stringify(path7)}) instead`); fileFromPathWarned = true; } - return await _fileFromPath(path5, ...args); + return await _fileFromPath(path7, ...args); } var defaultHttpAgent = new import_agentkeepalive.default({ keepAlive: true, timeout: 5 * 60 * 1e3 }); var defaultHttpsAgent = new import_agentkeepalive.default.HttpsAgent({ keepAlive: true, timeout: 5 * 60 * 1e3 }); async function getMultipartRequestOptions2(form, opts) { const encoder = new FormDataEncoder(form); - const readable = import_node_stream.Readable.from(encoder); - const body = new MultipartBody(readable); + const readable2 = import_node_stream9.Readable.from(encoder); + const body = new MultipartBody(readable2); const headers = { ...opts.headers, ...encoder.headers, @@ -28590,7 +33805,7 @@ function getRuntime() { getMultipartRequestOptions: getMultipartRequestOptions2, getDefaultAgent: (url2) => url2.startsWith("https") ? defaultHttpsAgent : defaultHttpAgent, fileFromPath: fileFromPath3, - isFsReadStream: (value) => value instanceof import_node_fs3.ReadStream + isFsReadStream: (value) => value instanceof import_node_fs7.ReadStream }; } @@ -28922,15 +34137,15 @@ async function* iterSSEChunks(iterator) { function findDoubleNewlineIndex(buffer) { const newline = 10; const carriage = 13; - for (let i3 = 0; i3 < buffer.length - 2; i3++) { - if (buffer[i3] === newline && buffer[i3 + 1] === newline) { - return i3 + 2; + for (let i4 = 0; i4 < buffer.length - 2; i4++) { + if (buffer[i4] === newline && buffer[i4 + 1] === newline) { + return i4 + 2; } - if (buffer[i3] === carriage && buffer[i3 + 1] === carriage) { - return i3 + 2; + if (buffer[i4] === carriage && buffer[i4 + 1] === carriage) { + return i4 + 2; } - if (buffer[i3] === carriage && buffer[i3 + 1] === newline && i3 + 3 < buffer.length && buffer[i3 + 2] === carriage && buffer[i3 + 3] === newline) { - return i3 + 4; + if (buffer[i4] === carriage && buffer[i4 + 1] === newline && i4 + 3 < buffer.length && buffer[i4 + 2] === carriage && buffer[i4 + 3] === newline) { + return i4 + 4; } } return -1; @@ -29243,26 +34458,26 @@ var APIClient = class { defaultIdempotencyKey() { return `stainless-node-retry-${uuid4()}`; } - get(path5, opts) { - return this.methodRequest("get", path5, opts); + get(path7, opts) { + return this.methodRequest("get", path7, opts); } - post(path5, opts) { - return this.methodRequest("post", path5, opts); + post(path7, opts) { + return this.methodRequest("post", path7, opts); } - patch(path5, opts) { - return this.methodRequest("patch", path5, opts); + patch(path7, opts) { + return this.methodRequest("patch", path7, opts); } - put(path5, opts) { - return this.methodRequest("put", path5, opts); + put(path7, opts) { + return this.methodRequest("put", path7, opts); } - delete(path5, opts) { - return this.methodRequest("delete", path5, opts); + delete(path7, opts) { + return this.methodRequest("delete", path7, opts); } - methodRequest(method, path5, opts) { - return this.request(Promise.resolve(opts).then((opts2) => ({ method, path: path5, ...opts2 }))); + methodRequest(method, path7, opts) { + return this.request(Promise.resolve(opts).then((opts2) => ({ method, path: path7, ...opts2 }))); } - getAPIList(path5, Page2, opts) { - return this.requestAPIList(Page2, { method: "get", path: path5, ...opts }); + getAPIList(path7, Page2, opts) { + return this.requestAPIList(Page2, { method: "get", path: path7, ...opts }); } calculateContentLength(body) { if (typeof body === "string") { @@ -29278,10 +34493,10 @@ var APIClient = class { return null; } buildRequest(options) { - const { method, path: path5, query, headers = {} } = options; + const { method, path: path7, query, headers = {} } = options; const body = isMultipartBody(options.body) ? options.body.body : options.body ? JSON.stringify(options.body, null, 2) : null; const contentLength = this.calculateContentLength(body); - const url2 = this.buildURL(path5, query); + const url2 = this.buildURL(path7, query); if ("timeout" in options) validatePositiveInteger("timeout", options.timeout); const timeout = options.timeout ?? this.timeout; @@ -29379,8 +34594,8 @@ var APIClient = class { const request3 = this.makeRequest(options, null); return new PagePromise(this, request3, Page2); } - buildURL(path5, query) { - const url2 = isAbsoluteURL(path5) ? new URL(path5) : new URL(this.baseURL + (this.baseURL.endsWith("/") && path5.startsWith("/") ? path5.slice(1) : path5)); + buildURL(path7, query) { + const url2 = isAbsoluteURL(path7) ? new URL(path7) : new URL(this.baseURL + (this.baseURL.endsWith("/") && path7.startsWith("/") ? path7.slice(1) : path7)); const defaultQuery = this.defaultQuery(); if (!isEmptyObj(defaultQuery)) { query = { ...defaultQuery, ...query }; @@ -29622,24 +34837,24 @@ var normalizeArch = (arch2) => { return `other:${arch2}`; return "unknown"; }; -var normalizePlatform = (platform) => { - platform = platform.toLowerCase(); - if (platform.includes("ios")) +var normalizePlatform = (platform2) => { + platform2 = platform2.toLowerCase(); + if (platform2.includes("ios")) return "iOS"; - if (platform === "android") + if (platform2 === "android") return "Android"; - if (platform === "darwin") + if (platform2 === "darwin") return "MacOS"; - if (platform === "win32") + if (platform2 === "win32") return "Windows"; - if (platform === "freebsd") + if (platform2 === "freebsd") return "FreeBSD"; - if (platform === "openbsd") + if (platform2 === "openbsd") return "OpenBSD"; - if (platform === "linux") + if (platform2 === "linux") return "Linux"; - if (platform) - return `Other:${platform}`; + if (platform2) + return `Other:${platform2}`; return "Unknown"; }; var _platformHeaders; @@ -29658,14 +34873,14 @@ var isAbsoluteURL = (url2) => { return startsWithSchemeRegexp.test(url2); }; var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); -var validatePositiveInteger = (name, n2) => { - if (typeof n2 !== "number" || !Number.isInteger(n2)) { +var validatePositiveInteger = (name, n3) => { + if (typeof n3 !== "number" || !Number.isInteger(n3)) { throw new AnthropicError(`${name} must be an integer`); } - if (n2 < 0) { + if (n3 < 0) { throw new AnthropicError(`${name} must be a positive integer`); } - return n2; + return n3; }; var castToError = (err) => { if (err instanceof Error) @@ -29712,9 +34927,9 @@ function debug(action, ...args) { } } var uuid4 = () => { - return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c3) => { + return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c5) => { const r3 = Math.random() * 16 | 0; - const v5 = c3 === "x" ? r3 : r3 & 3 | 8; + const v5 = c5 === "x" ? r3 : r3 & 3 | 8; return v5.toString(16); }); }; @@ -30262,10 +35477,10 @@ function bind(fn, thisArg) { } // node_modules/axios/lib/utils.js -var { toString } = Object.prototype; +var { toString: toString2 } = Object.prototype; var { getPrototypeOf } = Object; var kindOf = ((cache) => (thing) => { - const str2 = toString.call(thing); + const str2 = toString2.call(thing); return cache[str2] || (cache[str2] = str2.slice(8, -1).toLowerCase()); })(/* @__PURE__ */ Object.create(null)); var kindOfTest = (type2) => { @@ -30278,22 +35493,22 @@ var isUndefined = typeOfTest("undefined"); function isBuffer(val) { return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction3(val.constructor.isBuffer) && val.constructor.isBuffer(val); } -var isArrayBuffer = kindOfTest("ArrayBuffer"); +var isArrayBuffer2 = kindOfTest("ArrayBuffer"); function isArrayBufferView(val) { let result; if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) { result = ArrayBuffer.isView(val); } else { - result = val && val.buffer && isArrayBuffer(val.buffer); + result = val && val.buffer && isArrayBuffer2(val.buffer); } return result; } var isString = typeOfTest("string"); var isFunction3 = typeOfTest("function"); var isNumber = typeOfTest("number"); -var isObject = (thing) => thing !== null && typeof thing === "object"; +var isObject2 = (thing) => thing !== null && typeof thing === "object"; var isBoolean = (thing) => thing === true || thing === false; -var isPlainObject3 = (val) => { +var isPlainObject4 = (val) => { if (kindOf(val) !== "object") { return false; } @@ -30304,33 +35519,33 @@ var isDate = kindOfTest("Date"); var isFile2 = kindOfTest("File"); var isBlob2 = kindOfTest("Blob"); var isFileList = kindOfTest("FileList"); -var isStream2 = (val) => isObject(val) && isFunction3(val.pipe); +var isStream2 = (val) => isObject2(val) && isFunction3(val.pipe); var isFormData2 = (thing) => { let kind3; return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction3(thing.append) && ((kind3 = kindOf(thing)) === "formdata" || kind3 === "object" && isFunction3(thing.toString) && thing.toString() === "[object FormData]")); }; var isURLSearchParams = kindOfTest("URLSearchParams"); -var [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest); +var [isReadableStream3, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest); var trim = (str2) => str2.trim ? str2.trim() : str2.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""); function forEach(obj, fn, { allOwnKeys = false } = {}) { if (obj === null || typeof obj === "undefined") { return; } - let i3; + let i4; let l3; if (typeof obj !== "object") { obj = [obj]; } if (isArray(obj)) { - for (i3 = 0, l3 = obj.length; i3 < l3; i3++) { - fn.call(null, obj[i3], i3, obj); + for (i4 = 0, l3 = obj.length; i4 < l3; i4++) { + fn.call(null, obj[i4], i4, obj); } } else { const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); const len = keys.length; let key; - for (i3 = 0; i3 < len; i3++) { - key = keys[i3]; + for (i4 = 0; i4 < len; i4++) { + key = keys[i4]; fn.call(null, obj[key], key, obj); } } @@ -30338,10 +35553,10 @@ function forEach(obj, fn, { allOwnKeys = false } = {}) { function findKey(obj, key) { key = key.toLowerCase(); const keys = Object.keys(obj); - let i3 = keys.length; + let i4 = keys.length; let _key; - while (i3-- > 0) { - _key = keys[i3]; + while (i4-- > 0) { + _key = keys[i4]; if (key === _key.toLowerCase()) { return _key; } @@ -30359,9 +35574,9 @@ function merge() { const result = {}; const assignValue = (val, key) => { const targetKey = caseless && findKey(result, key) || key; - if (isPlainObject3(result[targetKey]) && isPlainObject3(val)) { + if (isPlainObject4(result[targetKey]) && isPlainObject4(val)) { result[targetKey] = merge(result[targetKey], val); - } else if (isPlainObject3(val)) { + } else if (isPlainObject4(val)) { result[targetKey] = merge({}, val); } else if (isArray(val)) { result[targetKey] = val.slice(); @@ -30369,20 +35584,20 @@ function merge() { result[targetKey] = val; } }; - for (let i3 = 0, l3 = arguments.length; i3 < l3; i3++) { - arguments[i3] && forEach(arguments[i3], assignValue); + for (let i4 = 0, l3 = arguments.length; i4 < l3; i4++) { + arguments[i4] && forEach(arguments[i4], assignValue); } return result; } -var extend = (a4, b7, thisArg, { allOwnKeys } = {}) => { +var extend = (a5, b7, thisArg, { allOwnKeys } = {}) => { forEach(b7, (val, key) => { if (thisArg && isFunction3(val)) { - a4[key] = bind(val, thisArg); + a5[key] = bind(val, thisArg); } else { - a4[key] = val; + a5[key] = val; } }, { allOwnKeys }); - return a4; + return a5; }; var stripBOM = (content) => { if (content.charCodeAt(0) === 65279) { @@ -30400,7 +35615,7 @@ var inherits = (constructor, superConstructor, props, descriptors3) => { }; var toFlatObject = (sourceObj, destObj, filter2, propFilter) => { let props; - let i3; + let i4; let prop; const merged = {}; destObj = destObj || {}; @@ -30408,9 +35623,9 @@ var toFlatObject = (sourceObj, destObj, filter2, propFilter) => { return destObj; do { props = Object.getOwnPropertyNames(sourceObj); - i3 = props.length; - while (i3-- > 0) { - prop = props[i3]; + i4 = props.length; + while (i4-- > 0) { + prop = props[i4]; if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { destObj[prop] = sourceObj[prop]; merged[prop] = true; @@ -30434,12 +35649,12 @@ var toArray = (thing) => { return null; if (isArray(thing)) return thing; - let i3 = thing.length; - if (!isNumber(i3)) + let i4 = thing.length; + if (!isNumber(i4)) return null; - const arr = new Array(i3); - while (i3-- > 0) { - arr[i3] = thing[i3]; + const arr = new Array(i4); + while (i4-- > 0) { + arr[i4] = thing[i4]; } return arr; }; @@ -30517,7 +35732,7 @@ var toObjectSet = (arrayOrString, delimiter) => { isArray(arrayOrString) ? define2(arrayOrString) : define2(String(arrayOrString).split(delimiter)); return obj; }; -var noop = () => { +var noop3 = () => { }; var toFiniteNumber = (value, defaultValue) => { return value != null && Number.isFinite(value = +value) ? value : defaultValue; @@ -30542,19 +35757,19 @@ function isSpecCompliantForm(thing) { } var toJSONObject = (obj) => { const stack = new Array(10); - const visit = (source, i3) => { - if (isObject(source)) { + const visit = (source, i4) => { + if (isObject2(source)) { if (stack.indexOf(source) >= 0) { return; } if (!("toJSON" in source)) { - stack[i3] = source; + stack[i4] = source; const target = isArray(source) ? [] : {}; forEach(source, (value, key) => { - const reducedValue = visit(value, i3 + 1); + const reducedValue = visit(value, i4 + 1); !isUndefined(reducedValue) && (target[key] = reducedValue); }); - stack[i3] = void 0; + stack[i4] = void 0; return target; } } @@ -30563,7 +35778,7 @@ var toJSONObject = (obj) => { return visit(obj, 0); }; var isAsyncFn = kindOfTest("AsyncFunction"); -var isThenable = (thing) => thing && (isObject(thing) || isFunction3(thing)) && isFunction3(thing.then) && isFunction3(thing.catch); +var isThenable = (thing) => thing && (isObject2(thing) || isFunction3(thing)) && isFunction3(thing.then) && isFunction3(thing.catch); var _setImmediate = ((setImmediateSupported, postMessageSupported) => { if (setImmediateSupported) { return setImmediate; @@ -30586,16 +35801,16 @@ var _setImmediate = ((setImmediateSupported, postMessageSupported) => { var asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate; var utils_default = { isArray, - isArrayBuffer, + isArrayBuffer: isArrayBuffer2, isBuffer, isFormData: isFormData2, isArrayBufferView, isString, isNumber, isBoolean, - isObject, - isPlainObject: isPlainObject3, - isReadableStream, + isObject: isObject2, + isPlainObject: isPlainObject4, + isReadableStream: isReadableStream3, isRequest, isResponse, isHeaders, @@ -30629,7 +35844,7 @@ var utils_default = { freezeMethods, toObjectSet, toCamelCase, - noop, + noop: noop3, toFiniteNumber, findKey, global: _global, @@ -30722,12 +35937,12 @@ function isVisitable(thing) { function removeBrackets(key) { return utils_default.endsWith(key, "[]") ? key.slice(0, -2) : key; } -function renderKey(path5, key, dots) { - if (!path5) +function renderKey(path7, key, dots) { + if (!path7) return key; - return path5.concat(key).map(function each(token, i3) { + return path7.concat(key).map(function each(token, i4) { token = removeBrackets(token); - return !dots && i3 ? "[" + token + "]" : token; + return !dots && i4 ? "[" + token + "]" : token; }).join(dots ? "." : ""); } function isFlatArray(arr) { @@ -30771,9 +35986,9 @@ function toFormData(obj, formData, options) { } return value; } - function defaultVisitor(value, key, path5) { + function defaultVisitor(value, key, path7) { let arr = value; - if (value && !path5 && typeof value === "object") { + if (value && !path7 && typeof value === "object") { if (utils_default.endsWith(key, "{}")) { key = metaTokens ? key : key.slice(0, -2); value = JSON.stringify(value); @@ -30791,7 +36006,7 @@ function toFormData(obj, formData, options) { if (isVisitable(value)) { return true; } - formData.append(renderKey(path5, key, dots), convertValue(value)); + formData.append(renderKey(path7, key, dots), convertValue(value)); return false; } const stack = []; @@ -30800,11 +36015,11 @@ function toFormData(obj, formData, options) { convertValue, isVisitable }); - function build(value, path5) { + function build(value, path7) { if (utils_default.isUndefined(value)) return; if (stack.indexOf(value) !== -1) { - throw Error("Circular reference detected in " + path5.join(".")); + throw Error("Circular reference detected in " + path7.join(".")); } stack.push(value); utils_default.forEach(value, function each(el, key) { @@ -30812,11 +36027,11 @@ function toFormData(obj, formData, options) { formData, el, utils_default.isString(key) ? key.trim() : key, - path5, + path7, exposedHelpers ); if (result === true) { - build(el, path5 ? path5.concat(key) : [key]); + build(el, path7 ? path7.concat(key) : [key]); } }); stack.pop(); @@ -30852,7 +36067,7 @@ var prototype2 = AxiosURLSearchParams.prototype; prototype2.append = function append(name, value) { this._pairs.push([name, value]); }; -prototype2.toString = function toString2(encoder) { +prototype2.toString = function toString3(encoder) { const _encode = encoder ? function(value) { return encoder.call(this, value, encode); } : encode; @@ -30913,9 +36128,9 @@ var InterceptorManager = class { } } forEach(fn) { - utils_default.forEach(this.handlers, function forEachHandler(h4) { - if (h4 !== null) { - fn(h4); + utils_default.forEach(this.handlers, function forEachHandler(h5) { + if (h5 !== null) { + fn(h5); } }); } @@ -30970,7 +36185,7 @@ var platform_default = { // node_modules/axios/lib/helpers/toURLEncodedForm.js function toURLEncodedForm(data, options) { return toFormData_default(data, new platform_default.classes.URLSearchParams(), Object.assign({ - visitor: function(value, key, path5, helpers) { + visitor: function(value, key, path7, helpers) { if (platform_default.isNode && utils_default.isBuffer(value)) { this.append(key, value.toString("base64")); return false; @@ -30989,22 +36204,22 @@ function parsePropPath(name) { function arrayToObject(arr) { const obj = {}; const keys = Object.keys(arr); - let i3; + let i4; const len = keys.length; let key; - for (i3 = 0; i3 < len; i3++) { - key = keys[i3]; + for (i4 = 0; i4 < len; i4++) { + key = keys[i4]; obj[key] = arr[key]; } return obj; } function formDataToJSON(formData) { - function buildPath(path5, value, target, index) { - let name = path5[index++]; + function buildPath(path7, value, target, index) { + let name = path7[index++]; if (name === "__proto__") return true; const isNumericKey = Number.isFinite(+name); - const isLast = index >= path5.length; + const isLast = index >= path7.length; name = !name && utils_default.isArray(target) ? target.length : name; if (isLast) { if (utils_default.hasOwnProp(target, name)) { @@ -31017,7 +36232,7 @@ function formDataToJSON(formData) { if (!target[name] || !utils_default.isObject(target[name])) { target[name] = []; } - const result = buildPath(path5, value, target[name], index); + const result = buildPath(path7, value, target[name], index); if (result && utils_default.isArray(target[name])) { target[name] = arrayToObject(target[name]); } @@ -31163,11 +36378,11 @@ var parseHeaders_default = (rawHeaders) => { const parsed = {}; let key; let val; - let i3; + let i4; rawHeaders && rawHeaders.split("\n").forEach(function parser(line) { - i3 = line.indexOf(":"); - key = line.substring(0, i3).trim().toLowerCase(); - val = line.substring(i3 + 1).trim(); + i4 = line.indexOf(":"); + key = line.substring(0, i4).trim().toLowerCase(); + val = line.substring(i4 + 1).trim(); if (!key || parsed[key] && ignoreDuplicateOf[key]) { return; } @@ -31319,10 +36534,10 @@ var AxiosHeaders = class { } clear(matcher) { const keys = Object.keys(this); - let i3 = keys.length; + let i4 = keys.length; let deleted = false; - while (i3--) { - const key = keys[i3]; + while (i4--) { + const key = keys[i4]; if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { delete this[key]; deleted = true; @@ -31330,7 +36545,7 @@ var AxiosHeaders = class { } return deleted; } - normalize(format) { + normalize(format2) { const self2 = this; const headers = {}; utils_default.forEach(this, (value, header) => { @@ -31340,7 +36555,7 @@ var AxiosHeaders = class { delete self2[header]; return; } - const normalized = format ? formatHeader(header) : String(header).trim(); + const normalized = format2 ? formatHeader(header) : String(header).trim(); if (normalized !== header) { delete self2[header]; } @@ -31515,12 +36730,12 @@ function fromDataURI(uri, asBlob, options) { } // node_modules/axios/lib/adapters/http.js -var import_stream5 = __toESM(require("stream"), 1); +var import_stream6 = __toESM(require("stream"), 1); // node_modules/axios/lib/helpers/AxiosTransformStream.js -var import_stream2 = __toESM(require("stream"), 1); +var import_stream3 = __toESM(require("stream"), 1); var kInternals = Symbol("internals"); -var AxiosTransformStream = class extends import_stream2.default.Transform { +var AxiosTransformStream = class extends import_stream3.default.Transform { constructor(options) { options = utils_default.toFlatObject(options, { maxRate: 0, @@ -31584,7 +36799,7 @@ var AxiosTransformStream = class extends import_stream2.default.Transform { }; } }; - const transformChunk = (_chunk, _callback) => { + const transformChunk2 = (_chunk, _callback) => { const chunkSize = Buffer.byteLength(_chunk); let chunkRemainder = null; let maxChunkSize = readableHighWaterMark; @@ -31618,12 +36833,12 @@ var AxiosTransformStream = class extends import_stream2.default.Transform { process.nextTick(_callback, null, chunkRemainder); } : _callback); }; - transformChunk(chunk, function transformNextChunk(err, _chunk) { + transformChunk2(chunk, function transformNextChunk(err, _chunk) { if (err) { return callback(err); } if (_chunk) { - transformChunk(_chunk, transformNextChunk); + transformChunk2(_chunk, transformNextChunk); } else { callback(null); } @@ -31637,7 +36852,7 @@ var import_events = require("events"); // node_modules/axios/lib/helpers/formDataToStream.js var import_util3 = require("util"); -var import_stream3 = require("stream"); +var import_stream4 = require("stream"); // node_modules/axios/lib/helpers/readBlob.js var { asyncIterator } = Symbol; @@ -31656,9 +36871,9 @@ var readBlob_default = readBlob; // node_modules/axios/lib/helpers/formDataToStream.js var BOUNDARY_ALPHABET = utils_default.ALPHABET.ALPHA_DIGIT + "-_"; -var textEncoder = new import_util3.TextEncoder(); +var textEncoder3 = new import_util3.TextEncoder(); var CRLF = "\r\n"; -var CRLF_BYTES = textEncoder.encode(CRLF); +var CRLF_BYTES = textEncoder3.encode(CRLF); var CRLF_BYTES_COUNT = 2; var FormDataPart = class { constructor(name, value) { @@ -31666,11 +36881,11 @@ var FormDataPart = class { const isStringValue = utils_default.isString(value); let headers = `Content-Disposition: form-data; name="${escapeName2(name)}"${!isStringValue && value.name ? `; filename="${escapeName2(value.name)}"` : ""}${CRLF}`; if (isStringValue) { - value = textEncoder.encode(String(value).replace(/\r?\n|\r\n?/g, CRLF)); + value = textEncoder3.encode(String(value).replace(/\r?\n|\r\n?/g, CRLF)); } else { headers += `Content-Type: ${value.type || "application/octet-stream"}${CRLF}`; } - this.headers = textEncoder.encode(headers + CRLF); + this.headers = textEncoder3.encode(headers + CRLF); this.contentLength = isStringValue ? value.byteLength : value.size; this.size = this.headers.byteLength + this.contentLength + CRLF_BYTES_COUNT; this.name = name; @@ -31706,8 +36921,8 @@ var formDataToStream = (form, headersHandler, options) => { if (boundary.length < 1 || boundary.length > 70) { throw Error("boundary must be 10-70 characters long"); } - const boundaryBytes = textEncoder.encode("--" + boundary + CRLF); - const footerBytes = textEncoder.encode("--" + boundary + "--" + CRLF + CRLF); + const boundaryBytes = textEncoder3.encode("--" + boundary + CRLF); + const footerBytes = textEncoder3.encode("--" + boundary + "--" + CRLF + CRLF); let contentLength = footerBytes.byteLength; const parts = Array.from(form.entries()).map(([name, value]) => { const part = new FormDataPart(name, value); @@ -31723,7 +36938,7 @@ var formDataToStream = (form, headersHandler, options) => { computedHeaders["Content-Length"] = contentLength; } headersHandler && headersHandler(computedHeaders); - return import_stream3.Readable.from(async function* () { + return import_stream4.Readable.from(async function* () { for (const part of parts) { yield boundaryBytes; yield* part.encode(); @@ -31734,8 +36949,8 @@ var formDataToStream = (form, headersHandler, options) => { var formDataToStream_default = formDataToStream; // node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js -var import_stream4 = __toESM(require("stream"), 1); -var ZlibHeaderTransformStream = class extends import_stream4.default.Transform { +var import_stream5 = __toESM(require("stream"), 1); +var ZlibHeaderTransformStream = class extends import_stream5.default.Transform { __transform(chunk, encoding, callback) { this.push(chunk); callback(); @@ -31756,7 +36971,7 @@ var ZlibHeaderTransformStream = class extends import_stream4.default.Transform { var ZlibHeaderTransformStream_default = ZlibHeaderTransformStream; // node_modules/axios/lib/helpers/callbackify.js -var callbackify = (fn, reducer) => { +var callbackify5 = (fn, reducer) => { return utils_default.isAsyncFn(fn) ? function(...args) { const cb = args.pop(); fn.apply(this, args).then((value) => { @@ -31768,7 +36983,7 @@ var callbackify = (fn, reducer) => { }, cb); } : fn; }; -var callbackify_default = callbackify; +var callbackify_default = callbackify5; // node_modules/axios/lib/helpers/speedometer.js function speedometer(samplesCount, min) { @@ -31787,11 +37002,11 @@ function speedometer(samplesCount, min) { } bytes[head] = chunkLength; timestamps[head] = now; - let i3 = tail; + let i4 = tail; let bytesCount = 0; - while (i3 !== head) { - bytesCount += bytes[i3++]; - i3 = i3 % samplesCount; + while (i4 !== head) { + bytesCount += bytes[i4++]; + i4 = i4 % samplesCount; } head = (head + 1) % samplesCount; if (head === tail) { @@ -32041,7 +37256,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config7) { convertedData = utils_default.stripBOM(convertedData); } } else if (responseType === "stream") { - convertedData = import_stream5.default.Readable.from(convertedData); + convertedData = import_stream6.default.Readable.from(convertedData); } return settle(resolve, reject, { data: convertedData, @@ -32084,7 +37299,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config7) { } else if (utils_default.isBlob(data)) { data.size && headers.setContentType(data.type || "application/octet-stream"); headers.setContentLength(data.size || 0); - data = import_stream5.default.Readable.from(readBlob_default(data)); + data = import_stream6.default.Readable.from(readBlob_default(data)); } else if (data && !utils_default.isStream(data)) { if (Buffer.isBuffer(data)) { } else if (utils_default.isArrayBuffer(data)) { @@ -32116,9 +37331,9 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config7) { } if (data && (onUploadProgress || maxUploadRate)) { if (!utils_default.isStream(data)) { - data = import_stream5.default.Readable.from(data, { objectMode: false }); + data = import_stream6.default.Readable.from(data, { objectMode: false }); } - data = import_stream5.default.pipeline([data, new AxiosTransformStream_default({ + data = import_stream6.default.pipeline([data, new AxiosTransformStream_default({ maxRate: utils_default.toFiniteNumber(maxUploadRate) })], utils_default.noop); onUploadProgress && data.on("progress", flushOnFinish( @@ -32141,9 +37356,9 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config7) { auth = urlUsername + ":" + urlPassword; } auth && headers.delete("authorization"); - let path5; + let path7; try { - path5 = buildURL( + path7 = buildURL( parsed.pathname + parsed.search, config7.params, config7.paramsSerializer @@ -32161,7 +37376,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config7) { false ); const options = { - path: path5, + path: path7, method, headers: headers.toJSON(), agents: { http: config7.httpAgent, https: config7.httpsAgent }, @@ -32247,8 +37462,8 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config7) { } } } - responseStream = streams.length > 1 ? import_stream5.default.pipeline(streams, utils_default.noop) : streams[0]; - const offListeners = import_stream5.default.finished(responseStream, () => { + responseStream = streams.length > 1 ? import_stream6.default.pipeline(streams, utils_default.noop) : streams[0]; + const offListeners = import_stream6.default.finished(responseStream, () => { offListeners(); onFinished(); }); @@ -32292,12 +37507,12 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config7) { responseStream.destroy(err); reject(err); }); - responseStream.on("error", function handleStreamError(err) { + responseStream.on("error", function handleStreamError2(err) { if (req.destroyed) return; reject(AxiosError_default.from(err, null, config7, lastRequest)); }); - responseStream.on("end", function handleStreamEnd() { + responseStream.on("end", function handleStreamEnd2() { try { let responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer); if (responseType !== "arraybuffer") { @@ -32416,10 +37631,10 @@ var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? function // node_modules/axios/lib/helpers/cookies.js var cookies_default = platform_default.hasStandardBrowserEnv ? { - write(name, value, expires, path5, domain, secure) { + write(name, value, expires, path7, domain, secure) { const cookie = [name + "=" + encodeURIComponent(value)]; utils_default.isNumber(expires) && cookie.push("expires=" + new Date(expires).toGMTString()); - utils_default.isString(path5) && cookie.push("path=" + path5); + utils_default.isString(path7) && cookie.push("path=" + path7); utils_default.isString(domain) && cookie.push("domain=" + domain); secure === true && cookie.push("secure"); document.cookie = cookie.join("; "); @@ -32456,30 +37671,30 @@ function mergeConfig(config1, config22) { } return source; } - function mergeDeepProperties(a4, b7, caseless) { + function mergeDeepProperties(a5, b7, caseless) { if (!utils_default.isUndefined(b7)) { - return getMergedValue(a4, b7, caseless); - } else if (!utils_default.isUndefined(a4)) { - return getMergedValue(void 0, a4, caseless); + return getMergedValue(a5, b7, caseless); + } else if (!utils_default.isUndefined(a5)) { + return getMergedValue(void 0, a5, caseless); } } - function valueFromConfig2(a4, b7) { + function valueFromConfig2(a5, b7) { if (!utils_default.isUndefined(b7)) { return getMergedValue(void 0, b7); } } - function defaultToConfig2(a4, b7) { + function defaultToConfig2(a5, b7) { if (!utils_default.isUndefined(b7)) { return getMergedValue(void 0, b7); - } else if (!utils_default.isUndefined(a4)) { - return getMergedValue(void 0, a4); + } else if (!utils_default.isUndefined(a5)) { + return getMergedValue(void 0, a5); } } - function mergeDirectKeys(a4, b7, prop) { + function mergeDirectKeys(a5, b7, prop) { if (prop in config22) { - return getMergedValue(a4, b7); + return getMergedValue(a5, b7); } else if (prop in config1) { - return getMergedValue(void 0, a4); + return getMergedValue(void 0, a5); } } const mergeMap = { @@ -32511,7 +37726,7 @@ function mergeConfig(config1, config22) { socketPath: defaultToConfig2, responseEncoding: defaultToConfig2, validateStatus: mergeDirectKeys, - headers: (a4, b7) => mergeDeepProperties(headersToObject(a4), headersToObject(b7), true) + headers: (a5, b7) => mergeDeepProperties(headersToObject(a5), headersToObject(b7), true) }; utils_default.forEach(Object.keys(Object.assign({}, config1, config22)), function computeConfigValue(prop) { const merge2 = mergeMap[prop] || mergeDeepProperties; @@ -32612,7 +37827,7 @@ var xhr_default = isXHRAdapterSupported && function(config7) { setTimeout(onloadend); }; } - request3.onabort = function handleAbort() { + request3.onabort = function handleAbort2() { if (!request3) { return; } @@ -32682,12 +37897,12 @@ var xhr_default = isXHRAdapterSupported && function(config7) { }; // node_modules/axios/lib/helpers/composeSignals.js -var composeSignals = (signals, timeout) => { +var composeSignals = (signals2, timeout) => { let controller = new AbortController(); - let aborted; + let aborted2; const onabort = function(cancel) { - if (!aborted) { - aborted = true; + if (!aborted2) { + aborted2 = true; unsubscribe(); const err = cancel instanceof Error ? cancel : this.reason; controller.abort(err instanceof AxiosError_default ? err : new CanceledError_default(err instanceof Error ? err.message : err)); @@ -32697,16 +37912,16 @@ var composeSignals = (signals, timeout) => { onabort(new AxiosError_default(`timeout ${timeout} of ms exceeded`, AxiosError_default.ETIMEDOUT)); }, timeout); const unsubscribe = () => { - if (signals) { + if (signals2) { timer && clearTimeout(timer); timer = null; - signals.forEach((signal2) => { + signals2.forEach((signal2) => { signal2 && (signal2.removeEventListener ? signal2.removeEventListener("abort", onabort) : signal2.unsubscribe(onabort)); }); - signals = null; + signals2 = null; } }; - signals.forEach((signal2) => signal2 && signal2.addEventListener && signal2.addEventListener("abort", onabort)); + signals2.forEach((signal2) => signal2 && signal2.addEventListener && signal2.addEventListener("abort", onabort)); const { signal } = controller; signal.unsubscribe = unsubscribe; return [signal, () => { @@ -32851,12 +38066,12 @@ var fetch_default = isFetchSupported && (async (config7) => { } = resolveConfig_default(config7); responseType = responseType ? (responseType + "").toLowerCase() : "text"; let [composedSignal, stopTimeout] = signal || cancelToken || timeout ? composeSignals_default([signal, cancelToken], timeout) : []; - let finished, request3; + let finished7, request3; const onFinish = () => { - !finished && setTimeout(() => { + !finished7 && setTimeout(() => { composedSignal && composedSignal.unsubscribe(); }); - finished = true; + finished7 = true; }; let requestContentLength; try { @@ -32962,8 +38177,8 @@ var adapters_default = { let nameOrAdapter; let adapter; const rejectedReasons = {}; - for (let i3 = 0; i3 < length; i3++) { - nameOrAdapter = adapters[i3]; + for (let i4 = 0; i4 < length; i4++) { + nameOrAdapter = adapters[i4]; let id; adapter = nameOrAdapter; if (!isResolvedHandle(nameOrAdapter)) { @@ -32975,7 +38190,7 @@ var adapters_default = { if (adapter) { break; } - rejectedReasons[id || "#" + i3] = adapter; + rejectedReasons[id || "#" + i4] = adapter; } if (!adapter) { const reasons = Object.entries(rejectedReasons).map( @@ -33039,9 +38254,9 @@ function dispatchRequest(config7) { // node_modules/axios/lib/helpers/validator.js var validators = {}; -["object", "boolean", "number", "function", "string", "symbol"].forEach((type2, i3) => { +["object", "boolean", "number", "function", "string", "symbol"].forEach((type2, i4) => { validators[type2] = function validator(thing) { - return typeof thing === type2 || "a" + (i3 < 1 ? "n " : " ") + type2; + return typeof thing === type2 || "a" + (i4 < 1 ? "n " : " ") + type2; }; }); var deprecatedWarnings = {}; @@ -33073,9 +38288,9 @@ function assertOptions(options, schema, allowUnknown) { throw new AxiosError_default("options must be an object", AxiosError_default.ERR_BAD_OPTION_VALUE); } const keys = Object.keys(options); - let i3 = keys.length; - while (i3-- > 0) { - const opt = keys[i3]; + let i4 = keys.length; + while (i4-- > 0) { + const opt = keys[i4]; const validator = schema[opt]; if (validator) { const value = options[opt]; @@ -33179,7 +38394,7 @@ var Axios = class { responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); }); let promise; - let i3 = 0; + let i4 = 0; let len; if (!synchronousRequestInterceptors) { const chain = [dispatchRequest.bind(this), void 0]; @@ -33187,17 +38402,17 @@ var Axios = class { chain.push.apply(chain, responseInterceptorChain); len = chain.length; promise = Promise.resolve(config7); - while (i3 < len) { - promise = promise.then(chain[i3++], chain[i3++]); + while (i4 < len) { + promise = promise.then(chain[i4++], chain[i4++]); } return promise; } len = requestInterceptorChain.length; let newConfig = config7; - i3 = 0; - while (i3 < len) { - const onFulfilled = requestInterceptorChain[i3++]; - const onRejected = requestInterceptorChain[i3++]; + i4 = 0; + while (i4 < len) { + const onFulfilled = requestInterceptorChain[i4++]; + const onRejected = requestInterceptorChain[i4++]; try { newConfig = onFulfilled(newConfig); } catch (error) { @@ -33210,10 +38425,10 @@ var Axios = class { } catch (error) { return Promise.reject(error); } - i3 = 0; + i4 = 0; len = responseInterceptorChain.length; - while (i3 < len) { - promise = promise.then(responseInterceptorChain[i3++], responseInterceptorChain[i3++]); + while (i4 < len) { + promise = promise.then(responseInterceptorChain[i4++], responseInterceptorChain[i4++]); } return promise; } @@ -33264,9 +38479,9 @@ var CancelToken = class { this.promise.then((cancel) => { if (!token._listeners) return; - let i3 = token._listeners.length; - while (i3-- > 0) { - token._listeners[i3](cancel); + let i4 = token._listeners.length; + while (i4-- > 0) { + token._listeners[i4](cancel); } token._listeners = null; }); @@ -33316,8 +38531,8 @@ var CancelToken = class { } static source() { let cancel; - const token = new CancelToken(function executor(c3) { - cancel = c3; + const token = new CancelToken(function executor(c5) { + cancel = c5; }); return { token, @@ -33496,7 +38711,7 @@ var AnthropicEngine = class { max_tokens: this.config.maxTokensOutput }; try { - const REQUEST_TOKENS = messages.map((msg) => tokenCount(msg.content) + 4).reduce((a4, b7) => a4 + b7, 0); + const REQUEST_TOKENS = messages.map((msg) => tokenCount(msg.content) + 4).reduce((a5, b7) => a5 + b7, 0); if (REQUEST_TOKENS > this.config.maxTokensInput - this.config.maxTokensOutput) { throw new Error("TOO_MUCH_TOKENS" /* tooMuchTokens */); } @@ -33555,13 +38770,13 @@ function getRandomIntegerInclusive(min, max) { } // node_modules/@azure/core-util/dist/esm/object.js -function isObject2(input) { +function isObject3(input) { return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date); } // node_modules/@azure/core-util/dist/esm/error.js function isError(e3) { - if (isObject2(e3)) { + if (isObject3(e3)) { const hasName = typeof e3.name === "string"; const hasMessage = typeof e3.message === "string"; return hasName && hasMessage; @@ -33608,8 +38823,8 @@ var isNode = isNodeLike; var isReactNative = typeof navigator !== "undefined" && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === "ReactNative"; // node_modules/@azure/core-util/dist/esm/bytesEncoding.js -function stringToUint8Array(value, format) { - return Buffer.from(value, format); +function stringToUint8Array2(value, format2) { + return Buffer.from(value, format2); } // node_modules/@azure/core-auth/dist/esm/tokenCredential.js @@ -33837,10 +39052,10 @@ function createEmptyPipeline() { // node_modules/@azure/logger/dist/esm/log.js var import_node_os5 = require("node:os"); -var import_node_util2 = __toESM(require("node:util"), 1); -var process7 = __toESM(require("node:process"), 1); +var import_node_util11 = __toESM(require("node:util"), 1); +var process11 = __toESM(require("node:process"), 1); function log(message, ...args) { - process7.stderr.write(`${import_node_util2.default.format(message, ...args)}${import_node_os5.EOL}`); + process11.stderr.write(`${import_node_util11.default.format(message, ...args)}${import_node_os5.EOL}`); } // node_modules/@azure/logger/dist/esm/debug.js @@ -34053,7 +39268,7 @@ var Sanitizer = class { constructor({ additionalAllowedHeaderNames: allowedHeaderNames = [], additionalAllowedQueryParameters: allowedQueryParameters = [] } = {}) { allowedHeaderNames = defaultAllowedHeaderNames.concat(allowedHeaderNames); allowedQueryParameters = defaultAllowedQueryParameters.concat(allowedQueryParameters); - this.allowedHeaderNames = new Set(allowedHeaderNames.map((n2) => n2.toLowerCase())); + this.allowedHeaderNames = new Set(allowedHeaderNames.map((n3) => n3.toLowerCase())); this.allowedQueryParameters = new Set(allowedQueryParameters.map((p4) => p4.toLowerCase())); } sanitize(obj) { @@ -34074,7 +39289,7 @@ var Sanitizer = class { return void 0; } else if (key === "operationSpec") { return void 0; - } else if (Array.isArray(value) || isObject2(value)) { + } else if (Array.isArray(value) || isObject3(value)) { if (seen.has(value)) { return "[Circular]"; } @@ -34181,13 +39396,13 @@ async function handleRedirect(next, response, maxRetries, currentRetries = 0) { } // node_modules/@azure/core-rest-pipeline/dist/esm/util/userAgentPlatform.js -var os3 = __toESM(require("node:os"), 1); -var process8 = __toESM(require("node:process"), 1); +var os2 = __toESM(require("node:os"), 1); +var process12 = __toESM(require("node:process"), 1); function getHeaderName() { return "User-Agent"; } function setPlatformSpecificData(map) { - const versions2 = process8.versions; + const versions2 = process12.versions; if (versions2.bun) { map.set("Bun", versions2.bun); } else if (versions2.deno) { @@ -34195,7 +39410,7 @@ function setPlatformSpecificData(map) { } else if (versions2.node) { map.set("Node", versions2.node); } - map.set("OS", `(${os3.arch()}-${os3.type()}-${os3.release()})`); + map.set("OS", `(${os2.arch()}-${os2.type()}-${os2.release()})`); } // node_modules/@azure/core-rest-pipeline/dist/esm/constants.js @@ -34240,7 +39455,7 @@ function userAgentPolicy(options = {}) { } // node_modules/@azure/core-rest-pipeline/dist/esm/util/concat.js -var import_node_stream2 = require("node:stream"); +var import_node_stream10 = require("node:stream"); // node_modules/@azure/core-rest-pipeline/dist/esm/util/typeGuards.js function isBlob3(x5) { @@ -34307,14 +39522,14 @@ function makeAsyncIterable(webStream) { function ensureNodeStream(stream4) { if (stream4 instanceof ReadableStream) { makeAsyncIterable(stream4); - return import_node_stream2.Readable.fromWeb(stream4); + return import_node_stream10.Readable.fromWeb(stream4); } else { return stream4; } } function toStream(source) { if (source instanceof Uint8Array) { - return import_node_stream2.Readable.from(Buffer.from(source)); + return import_node_stream10.Readable.from(Buffer.from(source)); } else if (isBlob3(source)) { return toStream(getRawContent(source)); } else { @@ -34324,7 +39539,7 @@ function toStream(source) { async function concat(sources) { return function() { const streams = sources.map((x5) => typeof x5 === "function" ? x5() : x5).map(toStream); - return import_node_stream2.Readable.from(function() { + return import_node_stream10.Readable.from(function() { return __asyncGenerator(this, arguments, function* () { var _a5, e_1, _b2, _c2; for (const stream4 of streams) { @@ -34387,16 +39602,16 @@ function getTotalLength(sources) { } async function buildRequestBody(request3, parts, boundary) { const sources = [ - stringToUint8Array(`--${boundary}`, "utf-8"), + stringToUint8Array2(`--${boundary}`, "utf-8"), ...parts.flatMap((part) => [ - stringToUint8Array("\r\n", "utf-8"), - stringToUint8Array(encodeHeaders(part.headers), "utf-8"), - stringToUint8Array("\r\n", "utf-8"), + stringToUint8Array2("\r\n", "utf-8"), + stringToUint8Array2(encodeHeaders(part.headers), "utf-8"), + stringToUint8Array2("\r\n", "utf-8"), part.body, - stringToUint8Array(`\r + stringToUint8Array2(`\r --${boundary}`, "utf-8") ]), - stringToUint8Array("--\r\n\r\n", "utf-8") + stringToUint8Array2("--\r\n\r\n", "utf-8") ]; const contentLength = getTotalLength(sources); if (contentLength) { @@ -34788,7 +40003,7 @@ async function prepareFormData(formData, request3) { headers: createHttpHeaders({ "Content-Disposition": `form-data; name="${fieldName}"` }), - body: stringToUint8Array(value, "utf-8") + body: stringToUint8Array2(value, "utf-8") }); } else if (value === void 0 || value === null || typeof value !== "object") { throw new Error(`Unexpected value for key ${fieldName}: ${value}. Value should be serialized to string first.`); @@ -35090,8 +40305,8 @@ function createTracingClient(options) { } // node_modules/@azure/core-rest-pipeline/dist/esm/util/inspect.js -var import_node_util3 = require("node:util"); -var custom = import_node_util3.inspect.custom; +var import_node_util12 = require("node:util"); +var custom = import_node_util12.inspect.custom; // node_modules/@azure/core-rest-pipeline/dist/esm/restError.js var errorSanitizer = new Sanitizer(); @@ -35243,9 +40458,9 @@ function createPipelineFromOptions(options) { var http2 = __toESM(require("node:http"), 1); var https2 = __toESM(require("node:https"), 1); var zlib2 = __toESM(require("node:zlib"), 1); -var import_node_stream3 = require("node:stream"); +var import_node_stream11 = require("node:stream"); var DEFAULT_TLS_SETTINGS = {}; -function isReadableStream2(body) { +function isReadableStream4(body) { return body && typeof body.pipe === "function"; } function isStreamComplete(stream4) { @@ -35255,10 +40470,10 @@ function isStreamComplete(stream4) { stream4.on("error", resolve); }); } -function isArrayBuffer2(body) { +function isArrayBuffer3(body) { return body && typeof body.byteLength === "number"; } -var ReportTransform = class extends import_node_stream3.Transform { +var ReportTransform = class extends import_node_stream11.Transform { _transform(chunk, _encoding, callback) { this.push(chunk); this.loadedBytes += chunk.length; @@ -35316,7 +40531,7 @@ var NodeHttpClient = class { uploadReportStream.on("error", (e3) => { logger.error("Error in upload progress", e3); }); - if (isReadableStream2(body)) { + if (isReadableStream4(body)) { body.pipe(uploadReportStream); } else { uploadReportStream.end(body); @@ -35354,11 +40569,11 @@ var NodeHttpClient = class { } finally { if (request3.abortSignal && abortListener) { let uploadStreamDone = Promise.resolve(); - if (isReadableStream2(body)) { + if (isReadableStream4(body)) { uploadStreamDone = isStreamComplete(body); } let downloadStreamDone = Promise.resolve(); - if (isReadableStream2(responseStream)) { + if (isReadableStream4(responseStream)) { downloadStreamDone = isStreamComplete(responseStream); } Promise.all([uploadStreamDone, downloadStreamDone]).then(() => { @@ -35399,12 +40614,12 @@ var NodeHttpClient = class { req.destroy(abortError); reject(abortError); }); - if (body && isReadableStream2(body)) { + if (body && isReadableStream4(body)) { body.pipe(req); } else if (body) { if (typeof body === "string" || Buffer.isBuffer(body)) { req.end(body); - } else if (isArrayBuffer2(body)) { + } else if (isArrayBuffer3(body)) { req.end(ArrayBuffer.isView(body) ? Buffer.from(body.buffer) : Buffer.from(body)); } else { logger.error("Unrecognized body type", body); @@ -35500,9 +40715,9 @@ function getBodyLength2(body) { return 0; } else if (Buffer.isBuffer(body)) { return body.length; - } else if (isReadableStream2(body)) { + } else if (isReadableStream4(body)) { return null; - } else if (isArrayBuffer2(body)) { + } else if (isArrayBuffer3(body)) { return body.byteLength; } else if (typeof body === "string") { return Buffer.from(body).length; @@ -35775,7 +40990,7 @@ function operationOptionsToRequestParameters(options) { } // node_modules/@azure-rest/core-client/dist/esm/helpers/isReadableStream.js -function isReadableStream3(body) { +function isReadableStream5(body) { return Boolean(body) && typeof body.pipe === "function"; } @@ -35845,7 +41060,7 @@ function getRequestBody(body, contentType = "") { if (body === void 0) { return { body: void 0 }; } - if (isReadableStream3(body)) { + if (isReadableStream5(body)) { return { body }; } const firstType = contentType.split(";")[0]; @@ -36014,8 +41229,8 @@ function getClient(endpoint, credentialsOrPipelineOptions, clientOptions = {}) { } const { allowInsecureConnection, httpClient } = clientOptions; const endpointUrl = (_b2 = clientOptions.endpoint) !== null && _b2 !== void 0 ? _b2 : endpoint; - const client = (path5, ...args) => { - const getUrl = (requestOptions) => buildRequestUrl(endpointUrl, path5, args, Object.assign({ allowInsecureConnection }, requestOptions)); + const client = (path7, ...args) => { + const getUrl = (requestOptions) => buildRequestUrl(endpointUrl, path7, args, Object.assign({ allowInsecureConnection }, requestOptions)); return { get: (requestOptions = {}) => { return buildOperation("GET", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); @@ -36115,9 +41330,9 @@ function isUnexpected(response) { } return !pathDetails.includes(response.status); } -function getParametrizedPathSuccess(method, path5) { +function getParametrizedPathSuccess(method, path7) { var _a5, _b2, _c2, _d2; - const pathParts = path5.split("/"); + const pathParts = path7.split("/"); let matchedLen = -1, matchedValue = []; for (const [key, value] of Object.entries(responseMap)) { if (!key.startsWith(method)) { @@ -36126,17 +41341,17 @@ function getParametrizedPathSuccess(method, path5) { const candidatePath = getPathFromMapKey(key); const candidateParts = candidatePath.split("/"); let found = true; - for (let i3 = candidateParts.length - 1, j4 = pathParts.length - 1; i3 >= 1 && j4 >= 1; i3--, j4--) { - if (((_a5 = candidateParts[i3]) === null || _a5 === void 0 ? void 0 : _a5.startsWith("{")) && ((_b2 = candidateParts[i3]) === null || _b2 === void 0 ? void 0 : _b2.indexOf("}")) !== -1) { - const start = candidateParts[i3].indexOf("}") + 1, end = (_c2 = candidateParts[i3]) === null || _c2 === void 0 ? void 0 : _c2.length; - const isMatched = new RegExp(`${(_d2 = candidateParts[i3]) === null || _d2 === void 0 ? void 0 : _d2.slice(start, end)}`).test(pathParts[j4] || ""); + for (let i4 = candidateParts.length - 1, j4 = pathParts.length - 1; i4 >= 1 && j4 >= 1; i4--, j4--) { + if (((_a5 = candidateParts[i4]) === null || _a5 === void 0 ? void 0 : _a5.startsWith("{")) && ((_b2 = candidateParts[i4]) === null || _b2 === void 0 ? void 0 : _b2.indexOf("}")) !== -1) { + const start = candidateParts[i4].indexOf("}") + 1, end = (_c2 = candidateParts[i4]) === null || _c2 === void 0 ? void 0 : _c2.length; + const isMatched = new RegExp(`${(_d2 = candidateParts[i4]) === null || _d2 === void 0 ? void 0 : _d2.slice(start, end)}`).test(pathParts[j4] || ""); if (!isMatched) { found = false; break; } continue; } - if (candidateParts[i3] !== pathParts[j4]) { + if (candidateParts[i4] !== pathParts[j4]) { found = false; break; } @@ -36452,7 +41667,7 @@ function serializeOnYourDataVectorizationSourceUnion(obj) { } // node_modules/@azure/openai/dist-esm/src/api/getSSEs.js -async function getStream2(response) { +async function getStream(response) { const { body, status } = await response.asNodeStream(); if (status !== "200" && body !== void 0) { const text = await streamToText2(body); @@ -36526,7 +41741,7 @@ function iteratorToStream(iterator, cancel) { }); } function ensureAsyncIterable(stream4) { - if (isReadableStream4(stream4)) { + if (isReadableStream6(stream4)) { makeAsyncIterable2(stream4); return { cancel: () => stream4.cancel(), @@ -36541,7 +41756,7 @@ function ensureAsyncIterable(stream4) { }; } } -function isReadableStream4(body) { +function isReadableStream6(body) { return Boolean(body && typeof body.getReader === "function" && typeof body.tee === "function"); } function toAsyncIterable(stream4) { @@ -36576,10 +41791,10 @@ function createSseStream(chunkStream) { const asyncIter = toMessage(toLine(iterable)); return createStream(asyncIter, cancel); } -function concatBuffer(a4, b7) { - const res = new Uint8Array(a4.length + b7.length); - res.set(a4); - res.set(b7, a4.length); +function concatBuffer(a5, b7) { + const res = new Uint8Array(a5.length + b7.length); + res.set(a5); + res.set(b7, a5.length); return res; } function createMessage() { @@ -36747,7 +41962,7 @@ function toAsyncIterable2(stream4) { // node_modules/@azure/openai/dist-esm/src/api/oaiSse.js async function getOaiSSEs(response, toEvent) { - const stringStream = await getStream2(response); + const stringStream = await getStream(response); const eventStream = createSseStream(stringStream); const jsonParser = new TransformStream({ transform: async (chunk, controller) => { @@ -37182,7 +42397,7 @@ var AzureEngine = class { constructor(config7) { this.generateCommitMessage = async (messages) => { try { - const REQUEST_TOKENS = messages.map((msg) => tokenCount(msg.content) + 4).reduce((a4, b7) => a4 + b7, 0); + const REQUEST_TOKENS = messages.map((msg) => tokenCount(msg.content) + 4).reduce((a5, b7) => a5 + b7, 0); if (REQUEST_TOKENS > this.config.maxTokensInput - this.config.maxTokensOutput) { throw new Error("TOO_MUCH_TOKENS" /* tooMuchTokens */); } @@ -37558,21 +42773,21 @@ function __await2(v5) { function __asyncGenerator2(thisArg, _arguments, generator) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g4 = generator.apply(thisArg, _arguments || []), i3, q6 = []; - return i3 = {}, verb("next"), verb("throw"), verb("return"), i3[Symbol.asyncIterator] = function() { + var g4 = generator.apply(thisArg, _arguments || []), i4, q6 = []; + return i4 = {}, verb("next"), verb("throw"), verb("return"), i4[Symbol.asyncIterator] = function() { return this; - }, i3; - function verb(n2) { - if (g4[n2]) - i3[n2] = function(v5) { - return new Promise(function(a4, b7) { - q6.push([n2, v5, a4, b7]) > 1 || resume(n2, v5); + }, i4; + function verb(n3) { + if (g4[n3]) + i4[n3] = function(v5) { + return new Promise(function(a5, b7) { + q6.push([n3, v5, a5, b7]) > 1 || resume(n3, v5); }); }; } - function resume(n2, v5) { + function resume(n3, v5) { try { - step(g4[n2](v5)); + step(g4[n3](v5)); } catch (e3) { settle2(q6[0][3], e3); } @@ -37669,22 +42884,22 @@ function aggregateResponses(responses) { for (const response of responses) { if (response.candidates) { for (const candidate of response.candidates) { - const i3 = candidate.index; + const i4 = candidate.index; if (!aggregatedResponse.candidates) { aggregatedResponse.candidates = []; } - if (!aggregatedResponse.candidates[i3]) { - aggregatedResponse.candidates[i3] = { + if (!aggregatedResponse.candidates[i4]) { + aggregatedResponse.candidates[i4] = { index: candidate.index }; } - aggregatedResponse.candidates[i3].citationMetadata = candidate.citationMetadata; - aggregatedResponse.candidates[i3].finishReason = candidate.finishReason; - aggregatedResponse.candidates[i3].finishMessage = candidate.finishMessage; - aggregatedResponse.candidates[i3].safetyRatings = candidate.safetyRatings; + aggregatedResponse.candidates[i4].citationMetadata = candidate.citationMetadata; + aggregatedResponse.candidates[i4].finishReason = candidate.finishReason; + aggregatedResponse.candidates[i4].finishMessage = candidate.finishMessage; + aggregatedResponse.candidates[i4].safetyRatings = candidate.safetyRatings; if (candidate.content && candidate.content.parts) { - if (!aggregatedResponse.candidates[i3].content) { - aggregatedResponse.candidates[i3].content = { + if (!aggregatedResponse.candidates[i4].content) { + aggregatedResponse.candidates[i4].content = { role: candidate.content.role || "user", parts: [] }; @@ -37700,7 +42915,7 @@ function aggregateResponses(responses) { if (Object.keys(newPart).length === 0) { newPart.text = ""; } - aggregatedResponse.candidates[i3].content.parts.push(newPart); + aggregatedResponse.candidates[i4].content.parts.push(newPart); } } } @@ -38088,7 +43303,10 @@ var OllamaAi = class { stream: false }; try { - const response = await this.client.post("", params); + const response = await this.client.post( + this.client.getUri(this.config), + params + ); const message = response.data.message; return message?.content; } catch (err) { @@ -38163,8 +43381,8 @@ function setShims2(shims, options = { auto: false }) { var nf2 = __toESM(require_lib2(), 1); var import_agentkeepalive2 = __toESM(require_agentkeepalive(), 1); var import_abort_controller6 = __toESM(require_abort_controller(), 1); -var import_node_fs4 = require("node:fs"); -var import_node_stream4 = require("node:stream"); +var import_node_fs8 = require("node:fs"); +var import_node_stream12 = require("node:stream"); // node_modules/openai/_shims/MultipartBody.mjs var MultipartBody2 = class { @@ -38179,20 +43397,20 @@ var MultipartBody2 = class { // node_modules/openai/_shims/node-runtime.mjs var import_web = require("node:stream/web"); var fileFromPathWarned2 = false; -async function fileFromPath5(path5, ...args) { +async function fileFromPath5(path7, ...args) { const { fileFromPath: _fileFromPath } = await Promise.resolve().then(() => (init_fileFromPath(), fileFromPath_exports)); if (!fileFromPathWarned2) { - console.warn(`fileFromPath is deprecated; use fs.createReadStream(${JSON.stringify(path5)}) instead`); + console.warn(`fileFromPath is deprecated; use fs.createReadStream(${JSON.stringify(path7)}) instead`); fileFromPathWarned2 = true; } - return await _fileFromPath(path5, ...args); + return await _fileFromPath(path7, ...args); } var defaultHttpAgent2 = new import_agentkeepalive2.default({ keepAlive: true, timeout: 5 * 60 * 1e3 }); var defaultHttpsAgent2 = new import_agentkeepalive2.default.HttpsAgent({ keepAlive: true, timeout: 5 * 60 * 1e3 }); async function getMultipartRequestOptions4(form, opts) { const encoder = new FormDataEncoder(form); - const readable = import_node_stream4.Readable.from(encoder); - const body = new MultipartBody2(readable); + const readable2 = import_node_stream12.Readable.from(encoder); + const body = new MultipartBody2(readable2); const headers = { ...opts.headers, ...encoder.headers, @@ -38217,7 +43435,7 @@ function getRuntime2() { getMultipartRequestOptions: getMultipartRequestOptions4, getDefaultAgent: (url2) => url2.startsWith("https") ? defaultHttpsAgent2 : defaultHttpAgent2, fileFromPath: fileFromPath5, - isFsReadStream: (value) => value instanceof import_node_fs4.ReadStream + isFsReadStream: (value) => value instanceof import_node_fs8.ReadStream }; } @@ -38420,15 +43638,15 @@ async function* iterSSEChunks2(iterator) { function findDoubleNewlineIndex2(buffer) { const newline = 10; const carriage = 13; - for (let i3 = 0; i3 < buffer.length - 2; i3++) { - if (buffer[i3] === newline && buffer[i3 + 1] === newline) { - return i3 + 2; + for (let i4 = 0; i4 < buffer.length - 2; i4++) { + if (buffer[i4] === newline && buffer[i4 + 1] === newline) { + return i4 + 2; } - if (buffer[i3] === carriage && buffer[i3 + 1] === carriage) { - return i3 + 2; + if (buffer[i4] === carriage && buffer[i4 + 1] === carriage) { + return i4 + 2; } - if (buffer[i3] === carriage && buffer[i3 + 1] === newline && i3 + 3 < buffer.length && buffer[i3 + 2] === carriage && buffer[i3 + 3] === newline) { - return i3 + 4; + if (buffer[i4] === carriage && buffer[i4 + 1] === newline && i4 + 3 < buffer.length && buffer[i4 + 2] === carriage && buffer[i4 + 3] === newline) { + return i4 + 4; } } return -1; @@ -38772,29 +43990,29 @@ var APIClient2 = class { defaultIdempotencyKey() { return `stainless-node-retry-${uuid42()}`; } - get(path5, opts) { - return this.methodRequest("get", path5, opts); + get(path7, opts) { + return this.methodRequest("get", path7, opts); } - post(path5, opts) { - return this.methodRequest("post", path5, opts); + post(path7, opts) { + return this.methodRequest("post", path7, opts); } - patch(path5, opts) { - return this.methodRequest("patch", path5, opts); + patch(path7, opts) { + return this.methodRequest("patch", path7, opts); } - put(path5, opts) { - return this.methodRequest("put", path5, opts); + put(path7, opts) { + return this.methodRequest("put", path7, opts); } - delete(path5, opts) { - return this.methodRequest("delete", path5, opts); + delete(path7, opts) { + return this.methodRequest("delete", path7, opts); } - methodRequest(method, path5, opts) { + methodRequest(method, path7, opts) { return this.request(Promise.resolve(opts).then(async (opts2) => { const body = opts2 && isBlobLike2(opts2?.body) ? new DataView(await opts2.body.arrayBuffer()) : opts2?.body instanceof DataView ? opts2.body : opts2?.body instanceof ArrayBuffer ? new DataView(opts2.body) : opts2 && ArrayBuffer.isView(opts2?.body) ? new DataView(opts2.body.buffer) : opts2?.body; - return { method, path: path5, ...opts2, body }; + return { method, path: path7, ...opts2, body }; })); } - getAPIList(path5, Page2, opts) { - return this.requestAPIList(Page2, { method: "get", path: path5, ...opts }); + getAPIList(path7, Page2, opts) { + return this.requestAPIList(Page2, { method: "get", path: path7, ...opts }); } calculateContentLength(body) { if (typeof body === "string") { @@ -38812,10 +44030,10 @@ var APIClient2 = class { return null; } buildRequest(options) { - const { method, path: path5, query, headers = {} } = options; + const { method, path: path7, query, headers = {} } = options; const body = ArrayBuffer.isView(options.body) || options.__binaryRequest && typeof options.body === "string" ? options.body : isMultipartBody2(options.body) ? options.body.body : options.body ? JSON.stringify(options.body, null, 2) : null; const contentLength = this.calculateContentLength(body); - const url2 = this.buildURL(path5, query); + const url2 = this.buildURL(path7, query); if ("timeout" in options) validatePositiveInteger2("timeout", options.timeout); const timeout = options.timeout ?? this.timeout; @@ -38913,8 +44131,8 @@ var APIClient2 = class { const request3 = this.makeRequest(options, null); return new PagePromise2(this, request3, Page2); } - buildURL(path5, query) { - const url2 = isAbsoluteURL3(path5) ? new URL(path5) : new URL(this.baseURL + (this.baseURL.endsWith("/") && path5.startsWith("/") ? path5.slice(1) : path5)); + buildURL(path7, query) { + const url2 = isAbsoluteURL3(path7) ? new URL(path7) : new URL(this.baseURL + (this.baseURL.endsWith("/") && path7.startsWith("/") ? path7.slice(1) : path7)); const defaultQuery = this.defaultQuery(); if (!isEmptyObj2(defaultQuery)) { query = { ...defaultQuery, ...query }; @@ -39175,24 +44393,24 @@ var normalizeArch2 = (arch2) => { return `other:${arch2}`; return "unknown"; }; -var normalizePlatform2 = (platform) => { - platform = platform.toLowerCase(); - if (platform.includes("ios")) +var normalizePlatform2 = (platform2) => { + platform2 = platform2.toLowerCase(); + if (platform2.includes("ios")) return "iOS"; - if (platform === "android") + if (platform2 === "android") return "Android"; - if (platform === "darwin") + if (platform2 === "darwin") return "MacOS"; - if (platform === "win32") + if (platform2 === "win32") return "Windows"; - if (platform === "freebsd") + if (platform2 === "freebsd") return "FreeBSD"; - if (platform === "openbsd") + if (platform2 === "openbsd") return "OpenBSD"; - if (platform === "linux") + if (platform2 === "linux") return "Linux"; - if (platform) - return `Other:${platform}`; + if (platform2) + return `Other:${platform2}`; return "Unknown"; }; var _platformHeaders2; @@ -39211,14 +44429,14 @@ var isAbsoluteURL3 = (url2) => { return startsWithSchemeRegexp2.test(url2); }; var sleep2 = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); -var validatePositiveInteger2 = (name, n2) => { - if (typeof n2 !== "number" || !Number.isInteger(n2)) { +var validatePositiveInteger2 = (name, n3) => { + if (typeof n3 !== "number" || !Number.isInteger(n3)) { throw new OpenAIError(`${name} must be an integer`); } - if (n2 < 0) { + if (n3 < 0) { throw new OpenAIError(`${name} must be a positive integer`); } - return n2; + return n3; }; var castToError2 = (err) => { if (err instanceof Error) @@ -39265,9 +44483,9 @@ function debug2(action, ...args) { } } var uuid42 = () => { - return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c3) => { + return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c5) => { const r3 = Math.random() * 16 | 0; - const v5 = c3 === "x" ? r3 : r3 & 3 | 8; + const v5 = c5 === "x" ? r3 : r3 & 3 | 8; return v5.toString(16); }); }; @@ -39972,7 +45190,7 @@ var AbstractChatCompletionRunner = class extends EventStream { const finalFunctionCallResult = __classPrivateFieldGet11(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalFunctionCallResult).call(this); if (finalFunctionCallResult != null) this._emit("finalFunctionCallResult", finalFunctionCallResult); - if (this._chatCompletions.some((c3) => c3.usage)) { + if (this._chatCompletions.some((c5) => c5.usage)) { this._emit("totalUsage", __classPrivateFieldGet11(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_calculateTotalUsage).call(this)); } } @@ -40011,7 +45229,7 @@ var AbstractChatCompletionRunner = class extends EventStream { for (const message of params.messages) { this._addMessage(message, false); } - for (let i3 = 0; i3 < maxChatCompletions; ++i3) { + for (let i4 = 0; i4 < maxChatCompletions; ++i4) { const chatCompletion = await this._createChatCompletion(client, { ...restParams, function_call, @@ -40095,7 +45313,7 @@ var AbstractChatCompletionRunner = class extends EventStream { for (const message of params.messages) { this._addMessage(message, false); } - for (let i3 = 0; i3 < maxChatCompletions; ++i3) { + for (let i4 = 0; i4 < maxChatCompletions; ++i4) { const chatCompletion = await this._createChatCompletion(client, { ...restParams, tool_choice, @@ -40146,9 +45364,9 @@ var AbstractChatCompletionRunner = class extends EventStream { _AbstractChatCompletionRunner_instances = /* @__PURE__ */ new WeakSet(), _AbstractChatCompletionRunner_getFinalContent = function _AbstractChatCompletionRunner_getFinalContent2() { return __classPrivateFieldGet11(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalMessage).call(this).content ?? null; }, _AbstractChatCompletionRunner_getFinalMessage = function _AbstractChatCompletionRunner_getFinalMessage2() { - let i3 = this.messages.length; - while (i3-- > 0) { - const message = this.messages[i3]; + let i4 = this.messages.length; + while (i4-- > 0) { + const message = this.messages[i4]; if (isAssistantMessage(message)) { const { function_call, ...rest } = message; const ret = { @@ -40164,8 +45382,8 @@ _AbstractChatCompletionRunner_instances = /* @__PURE__ */ new WeakSet(), _Abstra } throw new OpenAIError("stream ended without producing a ChatCompletionMessage with role=assistant"); }, _AbstractChatCompletionRunner_getFinalFunctionCall = function _AbstractChatCompletionRunner_getFinalFunctionCall2() { - for (let i3 = this.messages.length - 1; i3 >= 0; i3--) { - const message = this.messages[i3]; + for (let i4 = this.messages.length - 1; i4 >= 0; i4--) { + const message = this.messages[i4]; if (isAssistantMessage(message) && message?.function_call) { return message.function_call; } @@ -40175,8 +45393,8 @@ _AbstractChatCompletionRunner_instances = /* @__PURE__ */ new WeakSet(), _Abstra } return; }, _AbstractChatCompletionRunner_getFinalFunctionCallResult = function _AbstractChatCompletionRunner_getFinalFunctionCallResult2() { - for (let i3 = this.messages.length - 1; i3 >= 0; i3--) { - const message = this.messages[i3]; + for (let i4 = this.messages.length - 1; i4 >= 0; i4--) { + const message = this.messages[i4]; if (isFunctionMessage(message) && message.content != null) { return message.content; } @@ -40896,23 +46114,23 @@ function finalizeChatCompletion(snapshot, params) { role, content, refusal: message.refusal ?? null, - tool_calls: tool_calls.map((tool_call, i3) => { + tool_calls: tool_calls.map((tool_call, i4) => { const { function: fn, type: type2, id: id2, ...toolRest } = tool_call; const { arguments: args, name, ...fnRest } = fn || {}; if (id2 == null) { - throw new OpenAIError(`missing choices[${index}].tool_calls[${i3}].id + throw new OpenAIError(`missing choices[${index}].tool_calls[${i4}].id ${str(snapshot)}`); } if (type2 == null) { - throw new OpenAIError(`missing choices[${index}].tool_calls[${i3}].type + throw new OpenAIError(`missing choices[${index}].tool_calls[${i4}].type ${str(snapshot)}`); } if (name == null) { - throw new OpenAIError(`missing choices[${index}].tool_calls[${i3}].function.name + throw new OpenAIError(`missing choices[${index}].tool_calls[${i4}].function.name ${str(snapshot)}`); } if (args == null) { - throw new OpenAIError(`missing choices[${index}].tool_calls[${i3}].function.arguments + throw new OpenAIError(`missing choices[${index}].tool_calls[${i4}].function.arguments ${str(snapshot)}`); } return { ...toolRest, id: id2, type: type2, function: { ...fnRest, name, arguments: args } }; @@ -42363,7 +47581,7 @@ var OpenAiEngine = class { max_tokens: this.config.maxTokensOutput }; try { - const REQUEST_TOKENS = messages.map((msg) => tokenCount(msg.content) + 4).reduce((a4, b7) => a4 + b7, 0); + const REQUEST_TOKENS = messages.map((msg) => tokenCount(msg.content) + 4).reduce((a5, b7) => a5 + b7, 0); if (REQUEST_TOKENS > this.config.maxTokensInput - this.config.maxTokensOutput) throw new Error("TOO_MUCH_TOKENS" /* tooMuchTokens */); const completion = await this.client.chat.completions.create(params); @@ -42568,7 +47786,7 @@ Example Git Diff is to follow:` ]; var INIT_MAIN_PROMPT = (language, prompts) => ({ role: "system", - content: `${IDENTITY} Your mission is to create clean and comprehensive commit messages in the given @commitlint convention and explain WHAT were the changes and WHY the changes were done. I'll send you an output of 'git diff --staged' command, and you convert it into a commit message. + content: `${IDENTITY} Your mission is to create clean and comprehensive commit messages in the given @commitlint convention and explain WHAT were the changes ${config2.OCO_WHY ? "and WHY the changes were done" : ""}. I'll send you an output of 'git diff --staged' command, and you convert it into a commit message. ${config2.OCO_EMOJI ? "Use GitMoji convention to preface the commit." : "Do not preface the commit with anything."} ${config2.OCO_DESCRIPTION ? `Add a short description of WHY the changes are done after the commit message. Don't start it with "This commit", just describe the changes.` : "Don't add any descriptions to the commit, only commit message."} Use the present tense. Use ${language} to answer. @@ -42586,7 +47804,7 @@ var commitlintPrompts = { }; // src/modules/commitlint/pwd-commitlint.ts -var import_promises = __toESM(require("fs/promises"), 1); +var import_promises12 = __toESM(require("fs/promises"), 1); var import_path3 = __toESM(require("path"), 1); var findModulePath = (moduleName) => { const searchPaths = [ @@ -42605,13 +47823,18 @@ var findModulePath = (moduleName) => { var getCommitLintModuleType = async () => { const packageFile = "@commitlint/load/package.json"; const packageJsonPath = findModulePath(packageFile); +<<<<<<< HEAD const packageJson = JSON.parse(await import_promises.default.readFile(packageJsonPath, "utf8")); +======= + const packageJson = JSON.parse(await import_promises12.default.readFile(packageJsonPath, "utf8")); +>>>>>>> origin/dev if (!packageJson) { throw new Error(`Failed to parse ${packageFile}`); } return packageJson.type === "module" ? "esm" : "cjs"; }; var getCommitLintPWDConfig = async () => { +<<<<<<< HEAD let load, modulePath; switch (await getCommitLintModuleType()) { case "cjs": @@ -42621,16 +47844,27 @@ var getCommitLintPWDConfig = async () => { case "esm": modulePath = await findModulePath("@commitlint/load/lib/load.js"); load = (await import(modulePath)).default; +======= + let load2, modulePath; + switch (await getCommitLintModuleType()) { + case "cjs": + modulePath = findModulePath("@commitlint/load"); + load2 = require(modulePath).default; + break; + case "esm": + modulePath = await findModulePath("@commitlint/load/lib/load.js"); + load2 = (await import(modulePath)).default; +>>>>>>> origin/dev break; } - if (load && typeof load === "function") { - return await load(); + if (load2 && typeof load2 === "function") { + return await load2(); } return null; }; // src/modules/commitlint/utils.ts -var import_promises2 = __toESM(require("fs/promises"), 1); +var import_promises13 = __toESM(require("fs/promises"), 1); var removeDoubleNewlines = (input) => { const pattern = /\\n\\n/g; if (pattern.test(input)) { @@ -42651,7 +47885,7 @@ var getJSONBlock = (input) => { var commitlintLLMConfigExists = async () => { let exists; try { - await import_promises2.default.access(COMMITLINT_LLM_CONFIG_PATH); + await import_promises13.default.access(COMMITLINT_LLM_CONFIG_PATH); exists = true; } catch (e3) { exists = false; @@ -42659,13 +47893,13 @@ var commitlintLLMConfigExists = async () => { return exists; }; var writeCommitlintLLMConfig = async (commitlintLLMConfig) => { - await import_promises2.default.writeFile( + await import_promises13.default.writeFile( COMMITLINT_LLM_CONFIG_PATH, JSON.stringify(commitlintLLMConfig, null, 2) ); }; var getCommitlintLLMConfig = async () => { - const content = await import_promises2.default.readFile(COMMITLINT_LLM_CONFIG_PATH); + const content = await import_promises13.default.readFile(COMMITLINT_LLM_CONFIG_PATH); const commitLintLLMConfig = JSON.parse( content.toString() ); @@ -42937,7 +48171,7 @@ var generateCommitMessageByDiff = async (diff, fullGitMojiSpec = false) => { const INIT_MESSAGES_PROMPT = await getMainCommitPrompt(fullGitMojiSpec); const INIT_MESSAGES_PROMPT_LENGTH = INIT_MESSAGES_PROMPT.map( (msg) => tokenCount(msg.content) + 4 - ).reduce((a4, b7) => a4 + b7, 0); + ).reduce((a5, b7) => a5 + b7, 0); const MAX_REQUEST_TOKENS = MAX_TOKENS_INPUT - ADJUSTMENT_FACTOR - INIT_MESSAGES_PROMPT_LENGTH - MAX_TOKENS_OUTPUT; if (tokenCount(diff) >= MAX_REQUEST_TOKENS) { const commitMessagePromises = await getCommitMsgsPromisesFromFileDiffs( @@ -43374,7 +48608,7 @@ var commitlintConfigCommand = G3( // src/commands/githook.ts var import_fs4 = require("fs"); -var import_promises3 = __toESM(require("fs/promises"), 1); +var import_promises14 = __toESM(require("fs/promises"), 1); var import_path4 = __toESM(require("path"), 1); var HOOK_NAME = "prepare-commit-msg"; var DEFAULT_SYMLINK_URL = import_path4.default.join(".git", "hooks", HOOK_NAME); @@ -43410,7 +48644,7 @@ var hookCommand = G3( if (await isHookExists()) { let realPath; try { - realPath = await import_promises3.default.realpath(SYMLINK_URL); + realPath = await import_promises14.default.realpath(SYMLINK_URL); } catch (error) { ce(error); realPath = null; @@ -43421,9 +48655,9 @@ var hookCommand = G3( `Different ${HOOK_NAME} is already set. Remove it before setting opencommit as '${HOOK_NAME}' hook.` ); } - await import_promises3.default.mkdir(import_path4.default.dirname(SYMLINK_URL), { recursive: true }); - await import_promises3.default.symlink(HOOK_URL, SYMLINK_URL, "file"); - await import_promises3.default.chmod(SYMLINK_URL, 493); + await import_promises14.default.mkdir(import_path4.default.dirname(SYMLINK_URL), { recursive: true }); + await import_promises14.default.symlink(HOOK_URL, SYMLINK_URL, "file"); + await import_promises14.default.chmod(SYMLINK_URL, 493); return ce(`${source_default.green("\u2714")} Hook set`); } if (mode === "unset") { @@ -43435,13 +48669,13 @@ var hookCommand = G3( `OpenCommit wasn't previously set as '${HOOK_NAME}' hook, nothing to remove` ); } - const realpath = await import_promises3.default.realpath(SYMLINK_URL); + const realpath = await import_promises14.default.realpath(SYMLINK_URL); if (realpath !== HOOK_URL) { return ce( `OpenCommit wasn't previously set as '${HOOK_NAME}' hook, but different hook was, if you want to remove it \u2014 do it manually` ); } - await import_promises3.default.rm(SYMLINK_URL); + await import_promises14.default.rm(SYMLINK_URL); return ce(`${source_default.green("\u2714")} Hook is removed`); } throw new Error( @@ -43455,7 +48689,7 @@ var hookCommand = G3( ); // src/commands/prepare-commit-msg-hook.ts -var import_promises4 = __toESM(require("fs/promises"), 1); +var import_promises15 = __toESM(require("fs/promises"), 1); var [messageFilePath, commitSource] = process.argv.slice(2); var prepareCommitMessageHook = async (isStageAllFlag = false) => { try { @@ -43492,8 +48726,8 @@ var prepareCommitMessageHook = async (isStageAllFlag = false) => { await getDiff({ files: staged }) ); spin.stop("Done"); - const fileContent = await import_promises4.default.readFile(messageFilePath); - await import_promises4.default.writeFile( + const fileContent = await import_promises15.default.readFile(messageFilePath); + await import_promises15.default.writeFile( messageFilePath, commitMessage + "\n" + fileContent.toString() ); diff --git a/out/github-action.cjs b/out/github-action.cjs index 4c78380..65729f6 100644 --- a/out/github-action.cjs +++ b/out/github-action.cjs @@ -46564,6 +46564,7 @@ var CONFIG_KEYS = /* @__PURE__ */ ((CONFIG_KEYS2) => { CONFIG_KEYS2["OCO_EMOJI"] = "OCO_EMOJI"; CONFIG_KEYS2["OCO_MODEL"] = "OCO_MODEL"; CONFIG_KEYS2["OCO_LANGUAGE"] = "OCO_LANGUAGE"; + CONFIG_KEYS2["OCO_WHY"] = "OCO_WHY"; CONFIG_KEYS2["OCO_MESSAGE_TEMPLATE_PLACEHOLDER"] = "OCO_MESSAGE_TEMPLATE_PLACEHOLDER"; CONFIG_KEYS2["OCO_PROMPT_MODULE"] = "OCO_PROMPT_MODULE"; CONFIG_KEYS2["OCO_AI_PROVIDER"] = "OCO_AI_PROVIDER"; @@ -46854,6 +46855,7 @@ var DEFAULT_CONFIG = { OCO_ONE_LINE_COMMIT: false, OCO_TEST_MOCK_TYPE: "commit-message", OCO_FLOWISE_ENDPOINT: ":", + OCO_WHY: false, OCO_GITPUSH: true }; var initGlobalConfig = (configPath = defaultConfigPath) => { @@ -56900,7 +56902,10 @@ var OllamaAi = class { stream: false }; try { - const response = await this.client.post("", params); + const response = await this.client.post( + this.client.getUri(this.config), + params + ); const message = response.data.message; return message?.content; } catch (err) { @@ -61380,7 +61385,7 @@ Example Git Diff is to follow:` ]; var INIT_MAIN_PROMPT = (language, prompts) => ({ role: "system", - content: `${IDENTITY} Your mission is to create clean and comprehensive commit messages in the given @commitlint convention and explain WHAT were the changes and WHY the changes were done. I'll send you an output of 'git diff --staged' command, and you convert it into a commit message. + content: `${IDENTITY} Your mission is to create clean and comprehensive commit messages in the given @commitlint convention and explain WHAT were the changes ${config2.OCO_WHY ? "and WHY the changes were done" : ""}. I'll send you an output of 'git diff --staged' command, and you convert it into a commit message. ${config2.OCO_EMOJI ? "Use GitMoji convention to preface the commit." : "Do not preface the commit with anything."} ${config2.OCO_DESCRIPTION ? `Add a short description of WHY the changes are done after the commit message. Don't start it with "This commit", just describe the changes.` : "Don't add any descriptions to the commit, only commit message."} Use the present tense. Use ${language} to answer. diff --git a/package-lock.json b/package-lock.json index c8d9da4..21a7dab 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "opencommit", - "version": "3.0.20", + "version": "3.1.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "opencommit", - "version": "3.0.20", + "version": "3.1.2", "license": "MIT", "dependencies": { "@actions/core": "^1.10.0", diff --git a/package.json b/package.json index dfcf180..cc682ab 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "opencommit", - "version": "3.1.0", + "version": "3.1.2", "description": "Auto-generate impressive commits in 1 second. Killing lame commits with AI 🤯🔫", "keywords": [ "git", diff --git a/src/commands/config.ts b/src/commands/config.ts index 78b435a..1391f35 100644 --- a/src/commands/config.ts +++ b/src/commands/config.ts @@ -23,6 +23,7 @@ export enum CONFIG_KEYS { OCO_EMOJI = 'OCO_EMOJI', OCO_MODEL = 'OCO_MODEL', OCO_LANGUAGE = 'OCO_LANGUAGE', + OCO_WHY = 'OCO_WHY', OCO_MESSAGE_TEMPLATE_PLACEHOLDER = 'OCO_MESSAGE_TEMPLATE_PLACEHOLDER', OCO_PROMPT_MODULE = 'OCO_PROMPT_MODULE', OCO_AI_PROVIDER = 'OCO_AI_PROVIDER', @@ -376,6 +377,7 @@ export type ConfigType = { [CONFIG_KEYS.OCO_OPENAI_BASE_PATH]?: string; [CONFIG_KEYS.OCO_DESCRIPTION]: boolean; [CONFIG_KEYS.OCO_EMOJI]: boolean; + [CONFIG_KEYS.OCO_WHY]: boolean; [CONFIG_KEYS.OCO_MODEL]: string; [CONFIG_KEYS.OCO_LANGUAGE]: string; [CONFIG_KEYS.OCO_MESSAGE_TEMPLATE_PLACEHOLDER]: string; @@ -435,6 +437,7 @@ export const DEFAULT_CONFIG = { OCO_ONE_LINE_COMMIT: false, OCO_TEST_MOCK_TYPE: 'commit-message', OCO_FLOWISE_ENDPOINT: ':', + OCO_WHY: false, OCO_GITPUSH: true // todo: deprecate }; diff --git a/src/engine/ollama.ts b/src/engine/ollama.ts index 885eca8..0347fc6 100644 --- a/src/engine/ollama.ts +++ b/src/engine/ollama.ts @@ -28,7 +28,10 @@ export class OllamaAi implements AiEngine { stream: false }; try { - const response = await this.client.post('', params); + const response = await this.client.post( + this.client.getUri(this.config), + params + ); const message = response.data.message; diff --git a/src/modules/commitlint/prompts.ts b/src/modules/commitlint/prompts.ts index 7ff7ecb..8a1c91a 100644 --- a/src/modules/commitlint/prompts.ts +++ b/src/modules/commitlint/prompts.ts @@ -258,7 +258,9 @@ const INIT_MAIN_PROMPT = ( prompts: string[] ): OpenAI.Chat.Completions.ChatCompletionMessageParam => ({ role: 'system', - content: `${IDENTITY} Your mission is to create clean and comprehensive commit messages in the given @commitlint convention and explain WHAT were the changes and WHY the changes were done. I'll send you an output of 'git diff --staged' command, and you convert it into a commit message. + content: `${IDENTITY} Your mission is to create clean and comprehensive commit messages in the given @commitlint convention and explain WHAT were the changes ${ + config.OCO_WHY ? 'and WHY the changes were done' : '' + }. I'll send you an output of 'git diff --staged' command, and you convert it into a commit message. ${ config.OCO_EMOJI ? 'Use GitMoji convention to preface the commit.'