@cmflow/agents 3.4.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +403 -0
- package/bin/cm-agents.ts +0 -0
- package/dist/bin/cm-agents.d.mts +2 -0
- package/dist/bin/cm-agents.mjs +372 -0
- package/dist/bin/cm-agents.mjs.map +1 -0
- package/package.json +37 -0
- package/scripts/clubmed-models.json +33 -0
- package/scripts/setup.ps1 +63 -0
- package/scripts/setup.sh +29 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cm-agents.mjs","names":["process","program","NO_TRUNCATION","fastStringTruncatedWidth","stringWidth","cursor","erase","u$1","n","isUnicodeSupported","ConfirmPrompt","l","PasswordPrompt","cursor","erase","u","i","TextPrompt","constants","fs","util","path","path","path","path","path","path","path","path","path","path","path","path","objectToString","textEncoder","process","addDefaultValue","process","identity","execFileCallback","process","normalizeSignal","setTimeout","sendMessage","throwOnDisconnect","sendMessage","getCancelSignal","setTimeout","sendMessage","isWindows","process","process","Buffer","process","process","isWritableStream","isReadableStream","#t","#n","#s","#e","#i","#r","isReadableStream","asyncIterator","getStreamContents","noop","getStreamContents","noop","getStreamContents","noop","getStreamContents","prettyMs","isNodeStream","isPlainObj","isPlainObj","isNodeReadableStream","isNodeWritableStream","isNodeStream","process","isNodeStream","isReadableStream","addProperties","stripFinalNewline","stripFinalNewlineFunction","Buffer","Buffer","identityGenerator","getOneMessage","stopOnAbort","getEachMessage","process","getCancelSignal","sendMessage","getOneMessage","getEachMessage","Buffer","PassThroughStream","#streams","#onFinished","#unpipeEvent","#ended","#aborted","#streamPromises","process","path","global","process","#process","#sigListeners","#emitter","#hupSig","#originalProcessReallyExit","#originalProcessEmit","#loaded","#processEmit","#processReallyExit","getStream","isNodeStream","#hasDate","#hasTime","#offset","fs","codex","git","mise","codex","fs","styles","process","os","Table","fs","Table","fs","p.group","p.text","p.confirm","p.password","fs","p.spinner","codex","registerInstallCommand","registerCheckCommand","registerCodexModelsCommand"],"sources":["../../../../node_modules/commander/lib/error.js","../../../../node_modules/commander/lib/argument.js","../../../../node_modules/commander/lib/help.js","../../../../node_modules/commander/lib/option.js","../../../../node_modules/commander/lib/suggestSimilar.js","../../../../node_modules/commander/lib/command.js","../../../../node_modules/commander/index.js","../../../../node_modules/fast-string-truncated-width/dist/utils.js","../../../../node_modules/fast-string-truncated-width/dist/index.js","../../../../node_modules/fast-string-width/dist/index.js","../../../../node_modules/fast-wrap-ansi/lib/main.js","../../../../node_modules/sisteransi/src/index.js","../../../../node_modules/@clack/core/dist/index.mjs","../../../../node_modules/@clack/prompts/dist/index.mjs","../../../../node_modules/universalify/index.js","../../../../node_modules/graceful-fs/polyfills.js","../../../../node_modules/graceful-fs/legacy-streams.js","../../../../node_modules/graceful-fs/clone.js","../../../../node_modules/graceful-fs/graceful-fs.js","../../../../node_modules/fs-extra/lib/fs/index.js","../../../../node_modules/fs-extra/lib/mkdirs/utils.js","../../../../node_modules/fs-extra/lib/mkdirs/make-dir.js","../../../../node_modules/fs-extra/lib/mkdirs/index.js","../../../../node_modules/fs-extra/lib/path-exists/index.js","../../../../node_modules/fs-extra/lib/util/utimes.js","../../../../node_modules/fs-extra/lib/util/stat.js","../../../../node_modules/fs-extra/lib/util/async.js","../../../../node_modules/fs-extra/lib/copy/copy.js","../../../../node_modules/fs-extra/lib/copy/copy-sync.js","../../../../node_modules/fs-extra/lib/copy/index.js","../../../../node_modules/fs-extra/lib/remove/index.js","../../../../node_modules/fs-extra/lib/empty/index.js","../../../../node_modules/fs-extra/lib/ensure/file.js","../../../../node_modules/fs-extra/lib/ensure/link.js","../../../../node_modules/fs-extra/lib/ensure/symlink-paths.js","../../../../node_modules/fs-extra/lib/ensure/symlink-type.js","../../../../node_modules/fs-extra/lib/ensure/symlink.js","../../../../node_modules/fs-extra/lib/ensure/index.js","../../../../node_modules/jsonfile/utils.js","../../../../node_modules/jsonfile/index.js","../../../../node_modules/fs-extra/lib/json/jsonfile.js","../../../../node_modules/fs-extra/lib/output-file/index.js","../../../../node_modules/fs-extra/lib/json/output-json.js","../../../../node_modules/fs-extra/lib/json/output-json-sync.js","../../../../node_modules/fs-extra/lib/json/index.js","../../../../node_modules/fs-extra/lib/move/move.js","../../../../node_modules/fs-extra/lib/move/move-sync.js","../../../../node_modules/fs-extra/lib/move/index.js","../../../../node_modules/fs-extra/lib/index.js","../../src/config/config.ts","../../../../node_modules/is-plain-obj/index.js","../../../../node_modules/execa/lib/arguments/file-url.js","../../../../node_modules/execa/lib/methods/parameters.js","../../../../node_modules/execa/lib/utils/uint-array.js","../../../../node_modules/execa/lib/methods/template.js","../../../../node_modules/execa/lib/utils/standard-stream.js","../../../../node_modules/execa/lib/arguments/specific.js","../../../../node_modules/execa/lib/verbose/values.js","../../../../node_modules/execa/lib/arguments/escape.js","../../../../node_modules/is-unicode-supported/index.js","../../../../node_modules/figures/index.js","../../../../node_modules/yoctocolors/base.js","../../../../node_modules/execa/lib/verbose/default.js","../../../../node_modules/execa/lib/verbose/custom.js","../../../../node_modules/execa/lib/verbose/log.js","../../../../node_modules/execa/lib/verbose/start.js","../../../../node_modules/execa/lib/verbose/info.js","../../../../node_modules/execa/lib/return/duration.js","../../../../node_modules/execa/lib/arguments/command.js","../../../../node_modules/path-key/index.js","../../../../node_modules/unicorn-magic/node.js","../../../../node_modules/npm-run-path/index.js","../../../../node_modules/execa/lib/return/final-error.js","../../../../node_modules/human-signals/build/src/realtime.js","../../../../node_modules/human-signals/build/src/core.js","../../../../node_modules/human-signals/build/src/signals.js","../../../../node_modules/human-signals/build/src/main.js","../../../../node_modules/execa/lib/terminate/signal.js","../../../../node_modules/execa/lib/terminate/kill.js","../../../../node_modules/execa/lib/utils/abort-signal.js","../../../../node_modules/execa/lib/terminate/cancel.js","../../../../node_modules/execa/lib/ipc/validation.js","../../../../node_modules/execa/lib/utils/deferred.js","../../../../node_modules/execa/lib/utils/max-listeners.js","../../../../node_modules/execa/lib/ipc/reference.js","../../../../node_modules/execa/lib/ipc/incoming.js","../../../../node_modules/execa/lib/ipc/forward.js","../../../../node_modules/execa/lib/ipc/strict.js","../../../../node_modules/execa/lib/ipc/outgoing.js","../../../../node_modules/execa/lib/ipc/send.js","../../../../node_modules/execa/lib/ipc/graceful.js","../../../../node_modules/execa/lib/terminate/graceful.js","../../../../node_modules/execa/lib/terminate/timeout.js","../../../../node_modules/execa/lib/methods/node.js","../../../../node_modules/execa/lib/ipc/ipc-input.js","../../../../node_modules/execa/lib/arguments/encoding-option.js","../../../../node_modules/which-command/index.js","../../../../node_modules/execa/lib/arguments/command-file.js","../../../../node_modules/execa/lib/arguments/cwd.js","../../../../node_modules/execa/lib/arguments/options.js","../../../../node_modules/execa/lib/arguments/shell.js","../../../../node_modules/strip-final-newline/index.js","../../../../node_modules/is-stream/index.js","../../../../node_modules/@sec-ant/readable-stream/dist/ponyfill/asyncIterator.js","../../../../node_modules/get-stream/source/stream.js","../../../../node_modules/get-stream/source/contents.js","../../../../node_modules/get-stream/source/utils.js","../../../../node_modules/get-stream/source/array.js","../../../../node_modules/get-stream/source/array-buffer.js","../../../../node_modules/get-stream/source/string.js","../../../../node_modules/execa/lib/io/max-buffer.js","../../../../node_modules/execa/lib/return/message.js","../../../../node_modules/execa/lib/return/result.js","../../../../node_modules/parse-ms/index.js","../../../../node_modules/pretty-ms/index.js","../../../../node_modules/execa/lib/verbose/error.js","../../../../node_modules/execa/lib/verbose/complete.js","../../../../node_modules/execa/lib/return/reject.js","../../../../node_modules/execa/lib/stdio/type.js","../../../../node_modules/execa/lib/transform/object-mode.js","../../../../node_modules/execa/lib/transform/normalize.js","../../../../node_modules/execa/lib/stdio/direction.js","../../../../node_modules/execa/lib/ipc/array.js","../../../../node_modules/execa/lib/stdio/stdio-option.js","../../../../node_modules/execa/lib/arguments/fd-options.js","../../../../node_modules/execa/lib/stdio/native.js","../../../../node_modules/execa/lib/stdio/input-option.js","../../../../node_modules/execa/lib/stdio/duplicate.js","../../../../node_modules/execa/lib/stdio/handle.js","../../../../node_modules/execa/lib/stdio/handle-sync.js","../../../../node_modules/execa/lib/io/strip-newline.js","../../../../node_modules/execa/lib/transform/split.js","../../../../node_modules/execa/lib/transform/validate.js","../../../../node_modules/execa/lib/transform/encoding-transform.js","../../../../node_modules/execa/lib/transform/run-async.js","../../../../node_modules/execa/lib/transform/run-sync.js","../../../../node_modules/execa/lib/transform/generator.js","../../../../node_modules/execa/lib/io/input-sync.js","../../../../node_modules/execa/lib/verbose/output.js","../../../../node_modules/execa/lib/io/output-sync.js","../../../../node_modules/execa/lib/resolve/all-sync.js","../../../../node_modules/execa/lib/resolve/exit-async.js","../../../../node_modules/execa/lib/resolve/exit-sync.js","../../../../node_modules/execa/lib/methods/main-sync.js","../../../../node_modules/execa/lib/ipc/get-one.js","../../../../node_modules/execa/lib/ipc/get-each.js","../../../../node_modules/execa/lib/ipc/methods.js","../../../../node_modules/execa/lib/return/early-error.js","../../../../node_modules/execa/lib/stdio/handle-async.js","../../../../node_modules/@sindresorhus/merge-streams/index.js","../../../../node_modules/execa/lib/io/pipeline.js","../../../../node_modules/execa/lib/io/output-async.js","../../../../node_modules/execa/lib/terminate/kill-descendants.js","../../../../node_modules/signal-exit/dist/mjs/signals.js","../../../../node_modules/signal-exit/dist/mjs/index.js","../../../../node_modules/execa/lib/terminate/cleanup.js","../../../../node_modules/execa/lib/convert/concurrent.js","../../../../node_modules/execa/lib/io/iterate.js","../../../../node_modules/execa/lib/convert/iterable.js","../../../../node_modules/execa/lib/resolve/wait-stream.js","../../../../node_modules/execa/lib/convert/shared.js","../../../../node_modules/execa/lib/convert/readable.js","../../../../node_modules/execa/lib/convert/web.js","../../../../node_modules/execa/lib/pipe/pipe-arguments.js","../../../../node_modules/execa/lib/pipe/throw.js","../../../../node_modules/execa/lib/pipe/sequence.js","../../../../node_modules/execa/lib/pipe/streaming.js","../../../../node_modules/execa/lib/pipe/abort.js","../../../../node_modules/execa/lib/pipe/setup.js","../../../../node_modules/execa/lib/io/contents.js","../../../../node_modules/execa/lib/resolve/stdio.js","../../../../node_modules/execa/lib/resolve/all-async.js","../../../../node_modules/execa/lib/verbose/ipc.js","../../../../node_modules/execa/lib/ipc/buffer-messages.js","../../../../node_modules/execa/lib/resolve/wait-subprocess.js","../../../../node_modules/execa/lib/convert/writable.js","../../../../node_modules/execa/lib/convert/duplex.js","../../../../node_modules/execa/lib/convert/add.js","../../../../node_modules/execa/lib/methods/promise.js","../../../../node_modules/execa/lib/methods/main-async.js","../../../../node_modules/execa/lib/methods/bind.js","../../../../node_modules/execa/lib/methods/create.js","../../../../node_modules/execa/lib/methods/script.js","../../../../node_modules/execa/index.js","../../src/services/cli/cli.ts","../../src/services/cli/claude.ts","../../../../node_modules/smol-toml/dist/date.js","../../../../node_modules/smol-toml/dist/error.js","../../../../node_modules/smol-toml/dist/util.js","../../../../node_modules/smol-toml/dist/primitive.js","../../../../node_modules/smol-toml/dist/extract.js","../../../../node_modules/smol-toml/dist/struct.js","../../../../node_modules/smol-toml/dist/parse.js","../../../../node_modules/smol-toml/dist/stringify.js","../../src/services/cli/codex.ts","../../src/commands/check.ts","../../node_modules/chalk/source/utilities.js","../../node_modules/chalk/source/vendor/ansi-styles/index.js","../../node_modules/chalk/source/vendor/supports-color/index.js","../../node_modules/chalk/source/index.js","../../../../node_modules/cli-table3/src/debug.js","../../../../node_modules/string-width/node_modules/ansi-regex/index.js","../../../../node_modules/string-width/node_modules/strip-ansi/index.js","../../../../node_modules/is-fullwidth-code-point/index.js","../../../../node_modules/emoji-regex/index.js","../../../../node_modules/string-width/index.js","../../../../node_modules/cli-table3/src/utils.js","../../../../node_modules/@colors/colors/lib/styles.js","../../../../node_modules/@colors/colors/lib/system/has-flag.js","../../../../node_modules/@colors/colors/lib/system/supports-colors.js","../../../../node_modules/@colors/colors/lib/custom/trap.js","../../../../node_modules/@colors/colors/lib/custom/zalgo.js","../../../../node_modules/@colors/colors/lib/maps/america.js","../../../../node_modules/@colors/colors/lib/maps/zebra.js","../../../../node_modules/@colors/colors/lib/maps/rainbow.js","../../../../node_modules/@colors/colors/lib/maps/random.js","../../../../node_modules/@colors/colors/lib/colors.js","../../../../node_modules/@colors/colors/safe.js","../../../../node_modules/cli-table3/src/cell.js","../../../../node_modules/cli-table3/src/layout-manager.js","../../../../node_modules/cli-table3/src/table.js","../../../../node_modules/cli-table3/index.js","../../src/services/logger.ts","../../src/utils/constant.ts","../../src/services/http/httpClient.ts","../../src/services/litellm/liteLLMClient.ts","../../src/commands/codex/models.ts","../../src/services/cli/git.ts","../../src/services/cli/npm.ts","../../src/utils/linux/getShellRc.ts","../../src/utils/windows/setWindowsUserEnv.ts","../../src/services/vars/envsClient.ts","../../src/commands/install.ts","../../src/bin/cm-agents.ts"],"sourcesContent":["/**\n * CommanderError class\n */\nexport class CommanderError extends Error {\n /**\n * Constructs the CommanderError class\n * @param {number} exitCode suggested exit code which could be used with process.exit\n * @param {string} code an id string representing the error\n * @param {string} message human-readable description of the error\n */\n constructor(exitCode, code, message) {\n super(message);\n // properly capture stack trace in Node.js\n Error.captureStackTrace(this, this.constructor);\n this.name = this.constructor.name;\n this.code = code;\n this.exitCode = exitCode;\n this.nestedError = undefined;\n }\n}\n\n/**\n * InvalidArgumentError class\n */\nexport class InvalidArgumentError extends CommanderError {\n /**\n * Constructs the InvalidArgumentError class\n * @param {string} [message] explanation of why argument is invalid\n */\n constructor(message) {\n super(1, 'commander.invalidArgument', message);\n // properly capture stack trace in Node.js\n Error.captureStackTrace(this, this.constructor);\n this.name = this.constructor.name;\n }\n}\n","import { InvalidArgumentError } from './error.js';\n\nexport class Argument {\n /**\n * Initialize a new command argument with the given name and description.\n * The default is that the argument is required, and you can explicitly\n * indicate this with <> around the name. Put [] around the name for an optional argument.\n *\n * @param {string} name\n * @param {string} [description]\n */\n\n constructor(name, description) {\n this.description = description || '';\n this.variadic = false;\n this.parseArg = undefined;\n this.defaultValue = undefined;\n this.defaultValueDescription = undefined;\n this.argChoices = undefined;\n\n switch (name[0]) {\n case '<': // e.g. <required>\n this.required = true;\n this._name = name.slice(1, -1);\n break;\n case '[': // e.g. [optional]\n this.required = false;\n this._name = name.slice(1, -1);\n break;\n default:\n this.required = true;\n this._name = name;\n break;\n }\n\n if (this._name.endsWith('...')) {\n this.variadic = true;\n this._name = this._name.slice(0, -3);\n }\n }\n\n /**\n * Return argument name.\n *\n * @return {string}\n */\n\n name() {\n return this._name;\n }\n\n /**\n * @package\n */\n\n _collectValue(value, previous) {\n if (previous === this.defaultValue || !Array.isArray(previous)) {\n return [value];\n }\n\n previous.push(value);\n return previous;\n }\n\n /**\n * Set the default value, and optionally supply the description to be displayed in the help.\n *\n * @param {*} value\n * @param {string} [description]\n * @return {Argument}\n */\n\n default(value, description) {\n this.defaultValue = value;\n this.defaultValueDescription = description;\n return this;\n }\n\n /**\n * Set the custom handler for processing CLI command arguments into argument values.\n *\n * @param {Function} [fn]\n * @return {Argument}\n */\n\n argParser(fn) {\n this.parseArg = fn;\n return this;\n }\n\n /**\n * Only allow argument value to be one of choices.\n *\n * @param {string[]} values\n * @return {Argument}\n */\n\n choices(values) {\n this.argChoices = values.slice();\n this.parseArg = (arg, previous) => {\n if (!this.argChoices.includes(arg)) {\n throw new InvalidArgumentError(\n `Allowed choices are ${this.argChoices.join(', ')}.`,\n );\n }\n if (this.variadic) {\n return this._collectValue(arg, previous);\n }\n return arg;\n };\n return this;\n }\n\n /**\n * Make argument required.\n *\n * @returns {Argument}\n */\n argRequired() {\n this.required = true;\n return this;\n }\n\n /**\n * Make argument optional.\n *\n * @returns {Argument}\n */\n argOptional() {\n this.required = false;\n return this;\n }\n}\n\n/**\n * Takes an argument and returns its human readable equivalent for help usage.\n *\n * @param {Argument} arg\n * @return {string}\n * @private\n */\n\nexport function humanReadableArgName(arg) {\n const nameOutput = arg.name() + (arg.variadic === true ? '...' : '');\n\n return arg.required ? '<' + nameOutput + '>' : '[' + nameOutput + ']';\n}\n","import { humanReadableArgName } from './argument.js';\nimport { stripVTControlCharacters } from 'node:util';\n\n/**\n * TypeScript import types for JSDoc, used by Visual Studio Code IntelliSense and `npm run typescript-checkJS`\n * https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html#import-types\n * @typedef { import(\"./argument.js\").Argument } Argument\n * @typedef { import(\"./command.js\").Command } Command\n * @typedef { import(\"./option.js\").Option } Option\n */\n\n// Although this is a class, methods are static in style to allow override using subclass or just functions.\nexport class Help {\n constructor() {\n this.helpWidth = undefined;\n this.minWidthToWrap = 40;\n this.sortSubcommands = false;\n this.sortOptions = false;\n this.showGlobalOptions = false;\n }\n\n /**\n * prepareContext is called by Commander after applying overrides from `Command.configureHelp()`\n * and just before calling `formatHelp()`.\n *\n * Commander just uses the helpWidth and the rest is provided for optional use by more complex subclasses.\n *\n * @param {{ error?: boolean, helpWidth?: number, outputHasColors?: boolean }} contextOptions\n */\n prepareContext(contextOptions) {\n this.helpWidth = this.helpWidth ?? contextOptions.helpWidth ?? 80;\n }\n\n /**\n * Get an array of the visible subcommands. Includes a placeholder for the implicit help command, if there is one.\n *\n * @param {Command} cmd\n * @returns {Command[]}\n */\n\n visibleCommands(cmd) {\n const visibleCommands = cmd.commands.filter((cmd) => !cmd._hidden);\n const helpCommand = cmd._getHelpCommand();\n if (helpCommand && !helpCommand._hidden) {\n visibleCommands.push(helpCommand);\n }\n if (this.sortSubcommands) {\n visibleCommands.sort((a, b) => {\n // @ts-ignore: because overloaded return type\n return a.name().localeCompare(b.name());\n });\n }\n return visibleCommands;\n }\n\n /**\n * Compare options for sort.\n *\n * @param {Option} a\n * @param {Option} b\n * @returns {number}\n */\n compareOptions(a, b) {\n const getSortKey = (option) => {\n // WYSIWYG for order displayed in help. Short used for comparison if present. No special handling for negated.\n return option.short\n ? option.short.replace(/^-/, '')\n : option.long.replace(/^--/, '');\n };\n return getSortKey(a).localeCompare(getSortKey(b));\n }\n\n /**\n * Get an array of the visible options. Includes a placeholder for the implicit help option, if there is one.\n *\n * @param {Command} cmd\n * @returns {Option[]}\n */\n\n visibleOptions(cmd) {\n const visibleOptions = cmd.options.filter((option) => !option.hidden);\n // Built-in help option.\n const helpOption = cmd._getHelpOption();\n if (helpOption && !helpOption.hidden) {\n // Automatically hide conflicting flags. Bit dubious but a historical behaviour that is convenient for single-command programs.\n const removeShort = helpOption.short && cmd._findOption(helpOption.short);\n const removeLong = helpOption.long && cmd._findOption(helpOption.long);\n if (!removeShort && !removeLong) {\n visibleOptions.push(helpOption); // no changes needed\n } else if (helpOption.long && !removeLong) {\n visibleOptions.push(\n cmd.createOption(helpOption.long, helpOption.description),\n );\n } else if (helpOption.short && !removeShort) {\n visibleOptions.push(\n cmd.createOption(helpOption.short, helpOption.description),\n );\n }\n }\n if (this.sortOptions) {\n visibleOptions.sort(this.compareOptions);\n }\n return visibleOptions;\n }\n\n /**\n * Get an array of the visible global options. (Not including help.)\n *\n * @param {Command} cmd\n * @returns {Option[]}\n */\n\n visibleGlobalOptions(cmd) {\n if (!this.showGlobalOptions) return [];\n\n const globalOptions = [];\n for (\n let ancestorCmd = cmd.parent;\n ancestorCmd;\n ancestorCmd = ancestorCmd.parent\n ) {\n const visibleOptions = ancestorCmd.options.filter(\n (option) => !option.hidden,\n );\n globalOptions.push(...visibleOptions);\n }\n if (this.sortOptions) {\n globalOptions.sort(this.compareOptions);\n }\n return globalOptions;\n }\n\n /**\n * Get an array of the arguments if any have a description.\n *\n * @param {Command} cmd\n * @returns {Argument[]}\n */\n\n visibleArguments(cmd) {\n // Side effect! Apply the legacy descriptions before the arguments are displayed.\n if (cmd._argsDescription) {\n cmd.registeredArguments.forEach((argument) => {\n argument.description =\n argument.description || cmd._argsDescription[argument.name()] || '';\n });\n }\n\n // If there are any arguments with a description then return all the arguments.\n if (cmd.registeredArguments.find((argument) => argument.description)) {\n return cmd.registeredArguments;\n }\n return [];\n }\n\n /**\n * Get the command term to show in the list of subcommands.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n subcommandTerm(cmd) {\n // Legacy. Ignores custom usage string, and nested commands.\n const args = cmd.registeredArguments\n .map((arg) => humanReadableArgName(arg))\n .join(' ');\n return (\n cmd._name +\n (cmd._aliases[0] ? '|' + cmd._aliases[0] : '') +\n (cmd.options.length ? ' [options]' : '') + // simplistic check for non-help option\n (args ? ' ' + args : '')\n );\n }\n\n /**\n * Get the option term to show in the list of options.\n *\n * @param {Option} option\n * @returns {string}\n */\n\n optionTerm(option) {\n return option.flags;\n }\n\n /**\n * Get the argument term to show in the list of arguments.\n *\n * @param {Argument} argument\n * @returns {string}\n */\n\n argumentTerm(argument) {\n return argument.name();\n }\n\n /**\n * Get the longest command term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestSubcommandTermLength(cmd, helper) {\n return helper.visibleCommands(cmd).reduce((max, command) => {\n return Math.max(\n max,\n this.displayWidth(\n helper.styleSubcommandTerm(helper.subcommandTerm(command)),\n ),\n );\n }, 0);\n }\n\n /**\n * Get the longest option term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestOptionTermLength(cmd, helper) {\n return helper.visibleOptions(cmd).reduce((max, option) => {\n return Math.max(\n max,\n this.displayWidth(helper.styleOptionTerm(helper.optionTerm(option))),\n );\n }, 0);\n }\n\n /**\n * Get the longest global option term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestGlobalOptionTermLength(cmd, helper) {\n return helper.visibleGlobalOptions(cmd).reduce((max, option) => {\n return Math.max(\n max,\n this.displayWidth(helper.styleOptionTerm(helper.optionTerm(option))),\n );\n }, 0);\n }\n\n /**\n * Get the longest argument term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestArgumentTermLength(cmd, helper) {\n return helper.visibleArguments(cmd).reduce((max, argument) => {\n return Math.max(\n max,\n this.displayWidth(\n helper.styleArgumentTerm(helper.argumentTerm(argument)),\n ),\n );\n }, 0);\n }\n\n /**\n * Get the command usage to be displayed at the top of the built-in help.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n commandUsage(cmd) {\n // Usage\n let cmdName = cmd._name;\n if (cmd._aliases[0]) {\n cmdName = cmdName + '|' + cmd._aliases[0];\n }\n let ancestorCmdNames = '';\n for (\n let ancestorCmd = cmd.parent;\n ancestorCmd;\n ancestorCmd = ancestorCmd.parent\n ) {\n ancestorCmdNames = ancestorCmd.name() + ' ' + ancestorCmdNames;\n }\n return ancestorCmdNames + cmdName + ' ' + cmd.usage();\n }\n\n /**\n * Get the description for the command.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n commandDescription(cmd) {\n // @ts-ignore: because overloaded return type\n return cmd.description();\n }\n\n /**\n * Get the subcommand summary to show in the list of subcommands.\n * (Fallback to description for backwards compatibility.)\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n subcommandDescription(cmd) {\n // @ts-ignore: because overloaded return type\n return cmd.summary() || cmd.description();\n }\n\n /**\n * Get the option description to show in the list of options.\n *\n * @param {Option} option\n * @return {string}\n */\n\n optionDescription(option) {\n const extraInfo = [];\n\n if (option.argChoices) {\n extraInfo.push(\n // use stringify to match the display of the default value\n `choices: ${option.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`,\n );\n }\n if (option.defaultValue !== undefined) {\n // default for boolean and negated more for programmer than end user,\n // but show true/false for boolean option as may be for hand-rolled env or config processing.\n const showDefault =\n option.required ||\n option.optional ||\n (option.isBoolean() && typeof option.defaultValue === 'boolean');\n if (showDefault) {\n extraInfo.push(\n `default: ${option.defaultValueDescription || JSON.stringify(option.defaultValue)}`,\n );\n }\n }\n // preset for boolean and negated are more for programmer than end user\n if (option.presetArg !== undefined && option.optional) {\n extraInfo.push(`preset: ${JSON.stringify(option.presetArg)}`);\n }\n if (option.envVar !== undefined) {\n extraInfo.push(`env: ${option.envVar}`);\n }\n if (extraInfo.length > 0) {\n const extraDescription = `(${extraInfo.join(', ')})`;\n if (option.description) {\n return `${option.description} ${extraDescription}`;\n }\n return extraDescription;\n }\n\n return option.description;\n }\n\n /**\n * Get the argument description to show in the list of arguments.\n *\n * @param {Argument} argument\n * @return {string}\n */\n\n argumentDescription(argument) {\n const extraInfo = [];\n if (argument.argChoices) {\n extraInfo.push(\n // use stringify to match the display of the default value\n `choices: ${argument.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`,\n );\n }\n if (argument.defaultValue !== undefined) {\n extraInfo.push(\n `default: ${argument.defaultValueDescription || JSON.stringify(argument.defaultValue)}`,\n );\n }\n if (extraInfo.length > 0) {\n const extraDescription = `(${extraInfo.join(', ')})`;\n if (argument.description) {\n return `${argument.description} ${extraDescription}`;\n }\n return extraDescription;\n }\n return argument.description;\n }\n\n /**\n * Format a list of items, given a heading and an array of formatted items.\n *\n * @param {string} heading\n * @param {string[]} items\n * @param {Help} helper\n * @returns string[]\n */\n formatItemList(heading, items, helper) {\n if (items.length === 0) return [];\n\n return [helper.styleTitle(heading), ...items, ''];\n }\n\n /**\n * Group items by their help group heading.\n *\n * @param {Command[] | Option[]} unsortedItems\n * @param {Command[] | Option[]} visibleItems\n * @param {Function} getGroup\n * @returns {Map<string, Command[] | Option[]>}\n */\n groupItems(unsortedItems, visibleItems, getGroup) {\n const result = new Map();\n // Add groups in order of appearance in unsortedItems.\n unsortedItems.forEach((item) => {\n const group = getGroup(item);\n if (!result.has(group)) result.set(group, []);\n });\n // Add items in order of appearance in visibleItems.\n visibleItems.forEach((item) => {\n const group = getGroup(item);\n if (!result.has(group)) {\n result.set(group, []);\n }\n result.get(group).push(item);\n });\n return result;\n }\n\n /**\n * Generate the built-in help text.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {string}\n */\n\n formatHelp(cmd, helper) {\n const termWidth = helper.padWidth(cmd, helper);\n const helpWidth = helper.helpWidth ?? 80; // in case prepareContext() was not called\n\n function callFormatItem(term, description) {\n return helper.formatItem(term, termWidth, description, helper);\n }\n\n // Usage\n let output = [\n `${helper.styleTitle('Usage:')} ${helper.styleUsage(helper.commandUsage(cmd))}`,\n '',\n ];\n\n // Description\n const commandDescription = helper.commandDescription(cmd);\n if (commandDescription.length > 0) {\n output = output.concat([\n helper.boxWrap(\n helper.styleCommandDescription(commandDescription),\n helpWidth,\n ),\n '',\n ]);\n }\n\n // Arguments\n const argumentList = helper.visibleArguments(cmd).map((argument) => {\n return callFormatItem(\n helper.styleArgumentTerm(helper.argumentTerm(argument)),\n helper.styleArgumentDescription(helper.argumentDescription(argument)),\n );\n });\n output = output.concat(\n this.formatItemList('Arguments:', argumentList, helper),\n );\n\n // Options\n const optionGroups = this.groupItems(\n cmd.options,\n helper.visibleOptions(cmd),\n (option) => option.helpGroupHeading ?? 'Options:',\n );\n optionGroups.forEach((options, group) => {\n const optionList = options.map((option) => {\n return callFormatItem(\n helper.styleOptionTerm(helper.optionTerm(option)),\n helper.styleOptionDescription(helper.optionDescription(option)),\n );\n });\n output = output.concat(this.formatItemList(group, optionList, helper));\n });\n\n if (helper.showGlobalOptions) {\n const globalOptionList = helper\n .visibleGlobalOptions(cmd)\n .map((option) => {\n return callFormatItem(\n helper.styleOptionTerm(helper.optionTerm(option)),\n helper.styleOptionDescription(helper.optionDescription(option)),\n );\n });\n output = output.concat(\n this.formatItemList('Global Options:', globalOptionList, helper),\n );\n }\n\n // Commands\n const commandGroups = this.groupItems(\n cmd.commands,\n helper.visibleCommands(cmd),\n (sub) => sub.helpGroup() || 'Commands:',\n );\n commandGroups.forEach((commands, group) => {\n const commandList = commands.map((sub) => {\n return callFormatItem(\n helper.styleSubcommandTerm(helper.subcommandTerm(sub)),\n helper.styleSubcommandDescription(helper.subcommandDescription(sub)),\n );\n });\n output = output.concat(this.formatItemList(group, commandList, helper));\n });\n\n return output.join('\\n');\n }\n\n /**\n * Return display width of string, ignoring ANSI escape sequences. Used in padding and wrapping calculations.\n *\n * @param {string} str\n * @returns {number}\n */\n displayWidth(str) {\n return stripVTControlCharacters(str).length;\n }\n\n /**\n * Style the title for displaying in the help. Called with 'Usage:', 'Options:', etc.\n *\n * @param {string} str\n * @returns {string}\n */\n styleTitle(str) {\n return str;\n }\n\n styleUsage(str) {\n // Usage has lots of parts the user might like to color separately! Assume default usage string which is formed like:\n // command subcommand [options] [command] <foo> [bar]\n return str\n .split(' ')\n .map((word) => {\n if (word === '[options]') return this.styleOptionText(word);\n if (word === '[command]') return this.styleSubcommandText(word);\n if (word[0] === '[' || word[0] === '<')\n return this.styleArgumentText(word);\n return this.styleCommandText(word); // Restrict to initial words?\n })\n .join(' ');\n }\n styleCommandDescription(str) {\n return this.styleDescriptionText(str);\n }\n styleOptionDescription(str) {\n return this.styleDescriptionText(str);\n }\n styleSubcommandDescription(str) {\n return this.styleDescriptionText(str);\n }\n styleArgumentDescription(str) {\n return this.styleDescriptionText(str);\n }\n styleDescriptionText(str) {\n return str;\n }\n styleOptionTerm(str) {\n return this.styleOptionText(str);\n }\n styleSubcommandTerm(str) {\n // This is very like usage with lots of parts! Assume default string which is formed like:\n // subcommand [options] <foo> [bar]\n return str\n .split(' ')\n .map((word) => {\n if (word === '[options]') return this.styleOptionText(word);\n if (word[0] === '[' || word[0] === '<')\n return this.styleArgumentText(word);\n return this.styleSubcommandText(word); // Restrict to initial words?\n })\n .join(' ');\n }\n styleArgumentTerm(str) {\n return this.styleArgumentText(str);\n }\n styleOptionText(str) {\n return str;\n }\n styleArgumentText(str) {\n return str;\n }\n styleSubcommandText(str) {\n return str;\n }\n styleCommandText(str) {\n return str;\n }\n\n /**\n * Calculate the pad width from the maximum term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n padWidth(cmd, helper) {\n return Math.max(\n helper.longestOptionTermLength(cmd, helper),\n helper.longestGlobalOptionTermLength(cmd, helper),\n helper.longestSubcommandTermLength(cmd, helper),\n helper.longestArgumentTermLength(cmd, helper),\n );\n }\n\n /**\n * Detect manually wrapped and indented strings by checking for line break followed by whitespace.\n *\n * @param {string} str\n * @returns {boolean}\n */\n preformatted(str) {\n return /\\n[^\\S\\r\\n]/.test(str);\n }\n\n /**\n * Format the \"item\", which consists of a term and description. Pad the term and wrap the description, indenting the following lines.\n *\n * So \"TTT\", 5, \"DDD DDDD DD DDD\" might be formatted for this.helpWidth=17 like so:\n * TTT DDD DDDD\n * DD DDD\n *\n * @param {string} term\n * @param {number} termWidth\n * @param {string} description\n * @param {Help} helper\n * @returns {string}\n */\n formatItem(term, termWidth, description, helper) {\n const itemIndent = 2;\n const itemIndentStr = ' '.repeat(itemIndent);\n if (!description) return itemIndentStr + term;\n\n // Pad the term out to a consistent width, so descriptions are aligned.\n const paddedTerm = term.padEnd(\n termWidth + term.length - helper.displayWidth(term),\n );\n\n // Format the description.\n const spacerWidth = 2; // between term and description\n const helpWidth = this.helpWidth ?? 80; // in case prepareContext() was not called\n const remainingWidth = helpWidth - termWidth - spacerWidth - itemIndent;\n let formattedDescription;\n if (\n remainingWidth < this.minWidthToWrap ||\n helper.preformatted(description)\n ) {\n formattedDescription = description;\n } else {\n const wrappedDescription = helper.boxWrap(description, remainingWidth);\n formattedDescription = wrappedDescription.replace(\n /\\n/g,\n '\\n' + ' '.repeat(termWidth + spacerWidth),\n );\n }\n\n // Construct and overall indent.\n return (\n itemIndentStr +\n paddedTerm +\n ' '.repeat(spacerWidth) +\n formattedDescription.replace(/\\n/g, `\\n${itemIndentStr}`)\n );\n }\n\n /**\n * Wrap a string at whitespace, preserving existing line breaks.\n * Wrapping is skipped if the width is less than `minWidthToWrap`.\n *\n * @param {string} str\n * @param {number} width\n * @returns {string}\n */\n boxWrap(str, width) {\n if (width < this.minWidthToWrap) return str;\n\n const rawLines = str.split(/\\r\\n|\\n/);\n // split up text by whitespace\n const chunkPattern = /[\\s]*[^\\s]+/g;\n const wrappedLines = [];\n rawLines.forEach((line) => {\n const chunks = line.match(chunkPattern);\n if (chunks === null) {\n wrappedLines.push('');\n return;\n }\n\n let sumChunks = [chunks.shift()];\n let sumWidth = this.displayWidth(sumChunks[0]);\n chunks.forEach((chunk) => {\n const visibleWidth = this.displayWidth(chunk);\n // Accumulate chunks while they fit into width.\n if (sumWidth + visibleWidth <= width) {\n sumChunks.push(chunk);\n sumWidth += visibleWidth;\n return;\n }\n wrappedLines.push(sumChunks.join(''));\n\n const nextChunk = chunk.trimStart(); // trim space at line break\n sumChunks = [nextChunk];\n sumWidth = this.displayWidth(nextChunk);\n });\n wrappedLines.push(sumChunks.join(''));\n });\n\n return wrappedLines.join('\\n');\n }\n}\n","import { InvalidArgumentError } from './error.js';\n\nexport class Option {\n /**\n * Initialize a new `Option` with the given `flags` and `description`.\n *\n * @param {string} flags\n * @param {string} [description]\n */\n\n constructor(flags, description) {\n this.flags = flags;\n this.description = description || '';\n\n this.required = flags.includes('<'); // A value must be supplied when the option is specified.\n this.optional = flags.includes('['); // A value is optional when the option is specified.\n // variadic test ignores <value,...> et al which might be used to describe custom splitting of single argument\n this.variadic = /\\w\\.\\.\\.[>\\]]$/.test(flags); // The option can take multiple values.\n this.mandatory = false; // The option must have a value after parsing, which usually means it must be specified on command line.\n const optionFlags = splitOptionFlags(flags);\n this.short = optionFlags.shortFlag; // May be a short flag, undefined, or even a long flag (if option has two long flags).\n this.long = optionFlags.longFlag;\n this.negate = false;\n if (this.long) {\n this.negate = this.long.startsWith('--no-');\n }\n this.defaultValue = undefined;\n this.defaultValueDescription = undefined;\n this.presetArg = undefined;\n this.envVar = undefined;\n this.parseArg = undefined;\n this.hidden = false;\n this.argChoices = undefined;\n this.conflictsWith = [];\n this.implied = undefined;\n this.helpGroupHeading = undefined; // soft initialised when option added to command\n }\n\n /**\n * Set the default value, and optionally supply the description to be displayed in the help.\n *\n * @param {*} value\n * @param {string} [description]\n * @return {Option}\n */\n\n default(value, description) {\n this.defaultValue = value;\n this.defaultValueDescription = description;\n return this;\n }\n\n /**\n * Preset to use when option used without option-argument, especially optional but also boolean and negated.\n * The custom processing (parseArg) is called.\n *\n * @example\n * new Option('--color').default('GREYSCALE').preset('RGB');\n * new Option('--donate [amount]').preset('20').argParser(parseFloat);\n *\n * @param {*} arg\n * @return {Option}\n */\n\n preset(arg) {\n this.presetArg = arg;\n return this;\n }\n\n /**\n * Add option name(s) that conflict with this option.\n * An error will be displayed if conflicting options are found during parsing.\n *\n * @example\n * new Option('--rgb').conflicts('cmyk');\n * new Option('--js').conflicts(['ts', 'jsx']);\n *\n * @param {(string | string[])} names\n * @return {Option}\n */\n\n conflicts(names) {\n this.conflictsWith = this.conflictsWith.concat(names);\n return this;\n }\n\n /**\n * Specify implied option values for when this option is set and the implied options are not.\n *\n * The custom processing (parseArg) is not called on the implied values.\n *\n * @example\n * program\n * .addOption(new Option('--log', 'write logging information to file'))\n * .addOption(new Option('--trace', 'log extra details').implies({ log: 'trace.txt' }));\n *\n * @param {object} impliedOptionValues\n * @return {Option}\n */\n implies(impliedOptionValues) {\n let newImplied = impliedOptionValues;\n if (typeof impliedOptionValues === 'string') {\n // string is not documented, but easy mistake and we can do what user probably intended.\n newImplied = { [impliedOptionValues]: true };\n }\n this.implied = Object.assign(this.implied || {}, newImplied);\n return this;\n }\n\n /**\n * Set environment variable to check for option value.\n *\n * An environment variable is only used if when processed the current option value is\n * undefined, or the source of the current value is 'default' or 'config' or 'env'.\n *\n * @param {string} name\n * @return {Option}\n */\n\n env(name) {\n this.envVar = name;\n return this;\n }\n\n /**\n * Set the custom handler for processing CLI option arguments into option values.\n *\n * @param {Function} [fn]\n * @return {Option}\n */\n\n argParser(fn) {\n this.parseArg = fn;\n return this;\n }\n\n /**\n * Whether the option is mandatory and must have a value after parsing.\n *\n * @param {boolean} [mandatory=true]\n * @return {Option}\n */\n\n makeOptionMandatory(mandatory = true) {\n this.mandatory = !!mandatory;\n return this;\n }\n\n /**\n * Hide option in help.\n *\n * @param {boolean} [hide=true]\n * @return {Option}\n */\n\n hideHelp(hide = true) {\n this.hidden = !!hide;\n return this;\n }\n\n /**\n * @package\n */\n\n _collectValue(value, previous) {\n if (previous === this.defaultValue || !Array.isArray(previous)) {\n return [value];\n }\n\n previous.push(value);\n return previous;\n }\n\n /**\n * Only allow option value to be one of choices.\n *\n * @param {string[]} values\n * @return {Option}\n */\n\n choices(values) {\n this.argChoices = values.slice();\n this.parseArg = (arg, previous) => {\n if (!this.argChoices.includes(arg)) {\n throw new InvalidArgumentError(\n `Allowed choices are ${this.argChoices.join(', ')}.`,\n );\n }\n if (this.variadic) {\n return this._collectValue(arg, previous);\n }\n return arg;\n };\n return this;\n }\n\n /**\n * Return option name.\n *\n * @return {string}\n */\n\n name() {\n if (this.long) {\n return this.long.replace(/^--/, '');\n }\n return this.short.replace(/^-/, '');\n }\n\n /**\n * Return option name, in a camelcase format that can be used\n * as an object attribute key.\n *\n * @return {string}\n */\n\n attributeName() {\n if (this.negate) {\n return camelcase(this.name().replace(/^no-/, ''));\n }\n return camelcase(this.name());\n }\n\n /**\n * Set the help group heading.\n *\n * @param {string} heading\n * @return {Option}\n */\n helpGroup(heading) {\n this.helpGroupHeading = heading;\n return this;\n }\n\n /**\n * Check if `arg` matches the short or long flag.\n *\n * @param {string} arg\n * @return {boolean}\n * @package\n */\n\n is(arg) {\n return this.short === arg || this.long === arg;\n }\n\n /**\n * Return whether a boolean option.\n *\n * Options are one of boolean, negated, required argument, or optional argument.\n *\n * @return {boolean}\n * @package\n */\n\n isBoolean() {\n return !this.required && !this.optional && !this.negate;\n }\n}\n\n/**\n * This class is to make it easier to work with dual options, without changing the existing\n * implementation. We support separate dual options for separate positive and negative options,\n * like `--build` and `--no-build`, which share a single option value. This works nicely for some\n * use cases, but is tricky for others where we want separate behaviours despite\n * the single shared option value.\n */\nexport class DualOptions {\n /**\n * @param {Option[]} options\n */\n constructor(options) {\n this.positiveOptions = new Map();\n this.negativeOptions = new Map();\n this.dualOptions = new Set();\n options.forEach((option) => {\n if (option.negate) {\n this.negativeOptions.set(option.attributeName(), option);\n } else {\n this.positiveOptions.set(option.attributeName(), option);\n }\n });\n this.negativeOptions.forEach((value, key) => {\n if (this.positiveOptions.has(key)) {\n this.dualOptions.add(key);\n }\n });\n }\n\n /**\n * Did the value come from the option, and not from possible matching dual option?\n *\n * @param {*} value\n * @param {Option} option\n * @returns {boolean}\n */\n valueFromOption(value, option) {\n const optionKey = option.attributeName();\n if (!this.dualOptions.has(optionKey)) return true;\n\n // Use the value to deduce if (probably) came from the option.\n const preset = this.negativeOptions.get(optionKey).presetArg;\n const negativeValue = preset !== undefined ? preset : false;\n return option.negate === (negativeValue === value);\n }\n}\n\n/**\n * Convert string from kebab-case to camelCase.\n *\n * @param {string} str\n * @return {string}\n * @private\n */\n\nfunction camelcase(str) {\n return str.split('-').reduce((str, word) => {\n return str + word[0].toUpperCase() + word.slice(1);\n });\n}\n\n/**\n * Split the short and long flag out of something like '-m,--mixed <value>'\n *\n * @private\n */\n\nfunction splitOptionFlags(flags) {\n let shortFlag;\n let longFlag;\n // short flag, single dash and single character\n const shortFlagExp = /^-[^-]$/;\n // long flag, double dash and at least one character\n const longFlagExp = /^--[^-]/;\n\n const flagParts = flags.split(/[ |,]+/).concat('guard');\n // Normal is short and/or long.\n if (shortFlagExp.test(flagParts[0])) shortFlag = flagParts.shift();\n if (longFlagExp.test(flagParts[0])) longFlag = flagParts.shift();\n // Long then short. Rarely used but fine.\n if (!shortFlag && shortFlagExp.test(flagParts[0]))\n shortFlag = flagParts.shift();\n // Allow two long flags, like '--ws, --workspace'\n // This is the supported way to have a shortish option flag.\n if (!shortFlag && longFlagExp.test(flagParts[0])) {\n shortFlag = longFlag;\n longFlag = flagParts.shift();\n }\n\n // Check for unprocessed flag. Fail noisily rather than silently ignore.\n if (flagParts[0].startsWith('-')) {\n const unsupportedFlag = flagParts[0];\n const baseError = `option creation failed due to '${unsupportedFlag}' in option flags '${flags}'`;\n if (/^-[^-][^-]/.test(unsupportedFlag))\n throw new Error(\n `${baseError}\n- a short flag is a single dash and a single character\n - either use a single dash and a single character (for a short flag)\n - or use a double dash for a long option (and can have two, like '--ws, --workspace')`,\n );\n if (shortFlagExp.test(unsupportedFlag))\n throw new Error(`${baseError}\n- too many short flags`);\n if (longFlagExp.test(unsupportedFlag))\n throw new Error(`${baseError}\n- too many long flags`);\n\n throw new Error(`${baseError}\n- unrecognised flag format`);\n }\n if (shortFlag === undefined && longFlag === undefined)\n throw new Error(\n `option creation failed due to no flags found in '${flags}'.`,\n );\n\n return { shortFlag, longFlag };\n}\n","const maxDistance = 3;\n\nfunction editDistance(a, b) {\n // https://en.wikipedia.org/wiki/Damerau–Levenshtein_distance\n // Calculating optimal string alignment distance, no substring is edited more than once.\n // (Simple implementation.)\n\n // Quick early exit, return worst case.\n if (Math.abs(a.length - b.length) > maxDistance)\n return Math.max(a.length, b.length);\n\n // distance between prefix substrings of a and b\n const d = [];\n\n // pure deletions turn a into empty string\n for (let i = 0; i <= a.length; i++) {\n d[i] = [i];\n }\n // pure insertions turn empty string into b\n for (let j = 0; j <= b.length; j++) {\n d[0][j] = j;\n }\n\n // fill matrix\n for (let j = 1; j <= b.length; j++) {\n for (let i = 1; i <= a.length; i++) {\n let cost;\n if (a[i - 1] === b[j - 1]) {\n cost = 0;\n } else {\n cost = 1;\n }\n d[i][j] = Math.min(\n d[i - 1][j] + 1, // deletion\n d[i][j - 1] + 1, // insertion\n d[i - 1][j - 1] + cost, // substitution\n );\n // transposition\n if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) {\n d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + 1);\n }\n }\n }\n\n return d[a.length][b.length];\n}\n\n/**\n * Find close matches, restricted to same number of edits.\n *\n * @param {string} word\n * @param {string[]} candidates\n * @returns {string}\n */\n\nexport function suggestSimilar(word, candidates) {\n if (!candidates || candidates.length === 0) return '';\n // remove possible duplicates\n candidates = Array.from(new Set(candidates));\n\n const searchingOptions = word.startsWith('--');\n if (searchingOptions) {\n word = word.slice(2);\n candidates = candidates.map((candidate) => candidate.slice(2));\n }\n\n let similar = [];\n let bestDistance = maxDistance;\n const minSimilarity = 0.4;\n candidates.forEach((candidate) => {\n if (candidate.length <= 1) return; // no one character guesses\n\n const distance = editDistance(word, candidate);\n const length = Math.max(word.length, candidate.length);\n const similarity = (length - distance) / length;\n if (similarity > minSimilarity) {\n if (distance < bestDistance) {\n // better edit distance, throw away previous worse matches\n bestDistance = distance;\n similar = [candidate];\n } else if (distance === bestDistance) {\n similar.push(candidate);\n }\n }\n });\n\n similar.sort((a, b) => a.localeCompare(b));\n if (searchingOptions) {\n similar = similar.map((candidate) => `--${candidate}`);\n }\n\n if (similar.length > 1) {\n return `\\n(Did you mean one of ${similar.join(', ')}?)`;\n }\n if (similar.length === 1) {\n return `\\n(Did you mean ${similar[0]}?)`;\n }\n return '';\n}\n","import { EventEmitter } from 'node:events';\nimport childProcess from 'node:child_process';\nimport path from 'node:path';\nimport fs from 'node:fs';\nimport process from 'node:process';\nimport { stripVTControlCharacters } from 'node:util';\n\nimport { Argument, humanReadableArgName } from './argument.js';\nimport { CommanderError } from './error.js';\nimport { Help } from './help.js';\nimport { Option, DualOptions } from './option.js';\nimport { suggestSimilar } from './suggestSimilar.js';\n\nexport class Command extends EventEmitter {\n /**\n * Initialize a new `Command`.\n *\n * @param {string} [name]\n */\n\n constructor(name) {\n super();\n /** @type {Command[]} */\n this.commands = [];\n /** @type {Option[]} */\n this.options = [];\n this.parent = null;\n this._allowUnknownOption = false;\n this._allowExcessArguments = false;\n /** @type {Argument[]} */\n this.registeredArguments = [];\n this._args = this.registeredArguments; // deprecated old name\n /** @type {string[]} */\n this.args = []; // cli args with options removed\n this.rawArgs = [];\n this.processedArgs = []; // like .args but after custom processing and collecting variadic\n this._scriptPath = null;\n this._name = name || '';\n this._optionValues = {};\n this._optionValueSources = {}; // default, env, cli etc\n this._storeOptionsAsProperties = false;\n this._actionHandler = null;\n this._executableHandler = false;\n this._executableFile = null; // custom name for executable\n this._executableDir = null; // custom search directory for subcommands\n this._defaultCommandName = null;\n this._exitCallback = null;\n this._aliases = [];\n this._combineFlagAndOptionalValue = true;\n this._description = '';\n this._summary = '';\n this._argsDescription = undefined; // legacy\n this._enablePositionalOptions = false;\n this._passThroughOptions = false;\n this._lifeCycleHooks = {}; // a hash of arrays\n /** @type {(boolean | string)} */\n this._showHelpAfterError = false;\n this._showSuggestionAfterError = true;\n this._savedState = null; // used in save/restoreStateBeforeParse\n\n // see configureOutput() for docs\n this._outputConfiguration = {\n writeOut: (str) => process.stdout.write(str),\n writeErr: (str) => process.stderr.write(str),\n outputError: (str, write) => write(str),\n getOutHelpWidth: () =>\n process.stdout.isTTY ? process.stdout.columns : undefined,\n getErrHelpWidth: () =>\n process.stderr.isTTY ? process.stderr.columns : undefined,\n getOutHasColors: () =>\n useColor() ?? (process.stdout.isTTY && process.stdout.hasColors?.()),\n getErrHasColors: () =>\n useColor() ?? (process.stderr.isTTY && process.stderr.hasColors?.()),\n stripColor: (str) => stripVTControlCharacters(str),\n };\n\n this._hidden = false;\n /** @type {(Option | null | undefined)} */\n this._helpOption = undefined; // Lazy created on demand. May be null if help option is disabled.\n this._addImplicitHelpCommand = undefined; // undecided whether true or false yet, not inherited\n /** @type {Command} */\n this._helpCommand = undefined; // lazy initialised, inherited\n this._helpConfiguration = {};\n /** @type {string | undefined} */\n this._helpGroupHeading = undefined; // soft initialised when added to parent\n /** @type {string | undefined} */\n this._defaultCommandGroup = undefined;\n /** @type {string | undefined} */\n this._defaultOptionGroup = undefined;\n }\n\n /**\n * Copy settings that are useful to have in common across root command and subcommands.\n *\n * (Used internally when adding a command using `.command()` so subcommands inherit parent settings.)\n *\n * @param {Command} sourceCommand\n * @return {Command} `this` command for chaining\n */\n copyInheritedSettings(sourceCommand) {\n this._outputConfiguration = sourceCommand._outputConfiguration;\n this._helpOption = sourceCommand._helpOption;\n this._helpCommand = sourceCommand._helpCommand;\n this._helpConfiguration = sourceCommand._helpConfiguration;\n this._exitCallback = sourceCommand._exitCallback;\n this._storeOptionsAsProperties = sourceCommand._storeOptionsAsProperties;\n this._combineFlagAndOptionalValue =\n sourceCommand._combineFlagAndOptionalValue;\n this._allowExcessArguments = sourceCommand._allowExcessArguments;\n this._enablePositionalOptions = sourceCommand._enablePositionalOptions;\n this._showHelpAfterError = sourceCommand._showHelpAfterError;\n this._showSuggestionAfterError = sourceCommand._showSuggestionAfterError;\n\n return this;\n }\n\n /**\n * @returns {Command[]}\n * @private\n */\n\n _getCommandAndAncestors() {\n const result = [];\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n for (let command = this; command; command = command.parent) {\n result.push(command);\n }\n return result;\n }\n\n /**\n * Define a command.\n *\n * There are two styles of command: pay attention to where to put the description.\n *\n * @example\n * // Command implemented using action handler (description is supplied separately to `.command`)\n * program\n * .command('clone <source> [destination]')\n * .description('clone a repository into a newly created directory')\n * .action((source, destination) => {\n * console.log('clone command called');\n * });\n *\n * // Command implemented using separate executable file (description is second parameter to `.command`)\n * program\n * .command('start <service>', 'start named service')\n * .command('stop [service]', 'stop named service, or all if no name supplied');\n *\n * @param {string} nameAndArgs - command name and arguments, args are `<required>` or `[optional]` and last may also be `variadic...`\n * @param {(object | string)} [actionOptsOrExecDesc] - configuration options (for action), or description (for executable)\n * @param {object} [execOpts] - configuration options (for executable)\n * @return {Command} returns new command for action handler, or `this` for executable command\n */\n\n command(nameAndArgs, actionOptsOrExecDesc, execOpts) {\n let desc = actionOptsOrExecDesc;\n let opts = execOpts;\n if (typeof desc === 'object' && desc !== null) {\n opts = desc;\n desc = null;\n }\n opts = opts || {};\n const [, name, args] = nameAndArgs.match(/([^ ]+) *(.*)/);\n\n const cmd = this.createCommand(name);\n if (desc) {\n cmd.description(desc);\n cmd._executableHandler = true;\n }\n if (opts.isDefault) this._defaultCommandName = cmd._name;\n cmd._hidden = !!(opts.noHelp || opts.hidden); // noHelp is deprecated old name for hidden\n cmd._executableFile = opts.executableFile || null; // Custom name for executable file, set missing to null to match constructor\n if (args) cmd.arguments(args);\n this._registerCommand(cmd);\n cmd.parent = this;\n cmd.copyInheritedSettings(this);\n\n if (desc) return this;\n return cmd;\n }\n\n /**\n * Factory routine to create a new unattached command.\n *\n * See .command() for creating an attached subcommand, which uses this routine to\n * create the command. You can override createCommand to customise subcommands.\n *\n * @param {string} [name]\n * @return {Command} new command\n */\n\n createCommand(name) {\n return new Command(name);\n }\n\n /**\n * You can customise the help with a subclass of Help by overriding createHelp,\n * or by overriding Help properties using configureHelp().\n *\n * @return {Help}\n */\n\n createHelp() {\n return Object.assign(new Help(), this.configureHelp());\n }\n\n /**\n * You can customise the help by overriding Help properties using configureHelp(),\n * or with a subclass of Help by overriding createHelp().\n *\n * @param {object} [configuration] - configuration options\n * @return {(Command | object)} `this` command for chaining, or stored configuration\n */\n\n configureHelp(configuration) {\n if (configuration === undefined) return this._helpConfiguration;\n\n this._helpConfiguration = configuration;\n return this;\n }\n\n /**\n * The default output goes to stdout and stderr. You can customise this for special\n * applications. You can also customise the display of errors by overriding outputError.\n *\n * The configuration properties are all functions:\n *\n * // change how output being written, defaults to stdout and stderr\n * writeOut(str)\n * writeErr(str)\n * // change how output being written for errors, defaults to writeErr\n * outputError(str, write) // used for displaying errors and not used for displaying help\n * // specify width for wrapping help\n * getOutHelpWidth()\n * getErrHelpWidth()\n * // color support, currently only used with Help\n * getOutHasColors()\n * getErrHasColors()\n * stripColor() // used to remove ANSI escape codes if output does not have colors\n *\n * @param {object} [configuration] - configuration options\n * @return {(Command | object)} `this` command for chaining, or stored configuration\n */\n\n configureOutput(configuration) {\n if (configuration === undefined) return this._outputConfiguration;\n\n this._outputConfiguration = {\n ...this._outputConfiguration,\n ...configuration,\n };\n return this;\n }\n\n /**\n * Display the help or a custom message after an error occurs.\n *\n * @param {(boolean|string)} [displayHelp]\n * @return {Command} `this` command for chaining\n */\n showHelpAfterError(displayHelp = true) {\n if (typeof displayHelp !== 'string') displayHelp = !!displayHelp;\n this._showHelpAfterError = displayHelp;\n return this;\n }\n\n /**\n * Display suggestion of similar commands for unknown commands, or options for unknown options.\n *\n * @param {boolean} [displaySuggestion]\n * @return {Command} `this` command for chaining\n */\n showSuggestionAfterError(displaySuggestion = true) {\n this._showSuggestionAfterError = !!displaySuggestion;\n return this;\n }\n\n /**\n * Add a prepared subcommand.\n *\n * See .command() for creating an attached subcommand which inherits settings from its parent.\n *\n * @param {Command} cmd - new subcommand\n * @param {object} [opts] - configuration options\n * @return {Command} `this` command for chaining\n */\n\n addCommand(cmd, opts) {\n if (!cmd._name) {\n throw new Error(`Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()`);\n }\n\n opts = opts || {};\n if (opts.isDefault) this._defaultCommandName = cmd._name;\n if (opts.noHelp || opts.hidden) cmd._hidden = true; // modifying passed command due to existing implementation\n\n this._registerCommand(cmd);\n cmd.parent = this;\n cmd._checkForBrokenPassThrough();\n\n return this;\n }\n\n /**\n * Factory routine to create a new unattached argument.\n *\n * See .argument() for creating an attached argument, which uses this routine to\n * create the argument. You can override createArgument to return a custom argument.\n *\n * @param {string} name\n * @param {string} [description]\n * @return {Argument} new argument\n */\n\n createArgument(name, description) {\n return new Argument(name, description);\n }\n\n /**\n * Define argument syntax for command.\n *\n * The default is that the argument is required, and you can explicitly\n * indicate this with <> around the name. Put [] around the name for an optional argument.\n *\n * @example\n * program.argument('<input-file>');\n * program.argument('[output-file]');\n *\n * @param {string} name\n * @param {string} [description]\n * @param {(Function|*)} [parseArg] - custom argument processing function or default value\n * @param {*} [defaultValue]\n * @return {Command} `this` command for chaining\n */\n argument(name, description, parseArg, defaultValue) {\n const argument = this.createArgument(name, description);\n if (typeof parseArg === 'function') {\n argument.default(defaultValue).argParser(parseArg);\n } else {\n argument.default(parseArg);\n }\n this.addArgument(argument);\n return this;\n }\n\n /**\n * Define argument syntax for command, adding multiple at once (without descriptions).\n *\n * See also .argument().\n *\n * @example\n * program.arguments('<cmd> [env]');\n *\n * @param {string} names\n * @return {Command} `this` command for chaining\n */\n\n arguments(names) {\n names\n .trim()\n .split(/ +/)\n .forEach((detail) => {\n this.argument(detail);\n });\n return this;\n }\n\n /**\n * Define argument syntax for command, adding a prepared argument.\n *\n * @param {Argument} argument\n * @return {Command} `this` command for chaining\n */\n addArgument(argument) {\n const previousArgument = this.registeredArguments.slice(-1)[0];\n if (previousArgument?.variadic) {\n throw new Error(\n `only the last argument can be variadic '${previousArgument.name()}'`,\n );\n }\n if (\n argument.required &&\n argument.defaultValue !== undefined &&\n argument.parseArg === undefined\n ) {\n throw new Error(\n `a default value for a required argument is never used: '${argument.name()}'`,\n );\n }\n this.registeredArguments.push(argument);\n return this;\n }\n\n /**\n * Customise or override default help command. By default a help command is automatically added if your command has subcommands.\n *\n * @example\n * program.helpCommand('help [cmd]');\n * program.helpCommand('help [cmd]', 'show help');\n * program.helpCommand(false); // suppress default help command\n * program.helpCommand(true); // add help command even if no subcommands\n *\n * @param {string|boolean} enableOrNameAndArgs - enable with custom name and/or arguments, or boolean to override whether added\n * @param {string} [description] - custom description\n * @return {Command} `this` command for chaining\n */\n\n helpCommand(enableOrNameAndArgs, description) {\n if (typeof enableOrNameAndArgs === 'boolean') {\n this._addImplicitHelpCommand = enableOrNameAndArgs;\n if (enableOrNameAndArgs && this._defaultCommandGroup) {\n // make the command to store the group\n this._initCommandGroup(this._getHelpCommand());\n }\n return this;\n }\n\n const nameAndArgs = enableOrNameAndArgs ?? 'help [command]';\n const [, helpName, helpArgs] = nameAndArgs.match(/([^ ]+) *(.*)/);\n const helpDescription = description ?? 'display help for command';\n\n const helpCommand = this.createCommand(helpName);\n helpCommand.helpOption(false);\n if (helpArgs) helpCommand.arguments(helpArgs);\n if (helpDescription) helpCommand.description(helpDescription);\n\n this._addImplicitHelpCommand = true;\n this._helpCommand = helpCommand;\n // init group unless lazy create\n if (enableOrNameAndArgs || description) this._initCommandGroup(helpCommand);\n\n return this;\n }\n\n /**\n * Add prepared custom help command.\n *\n * @param {(Command|string|boolean)} helpCommand - custom help command, or deprecated enableOrNameAndArgs as for `.helpCommand()`\n * @param {string} [deprecatedDescription] - deprecated custom description used with custom name only\n * @return {Command} `this` command for chaining\n */\n addHelpCommand(helpCommand, deprecatedDescription) {\n // If not passed an object, call through to helpCommand for backwards compatibility,\n // as addHelpCommand was originally used like helpCommand is now.\n if (typeof helpCommand !== 'object') {\n this.helpCommand(helpCommand, deprecatedDescription);\n return this;\n }\n\n this._addImplicitHelpCommand = true;\n this._helpCommand = helpCommand;\n this._initCommandGroup(helpCommand);\n return this;\n }\n\n /**\n * Lazy create help command.\n *\n * @return {(Command|null)}\n * @package\n */\n _getHelpCommand() {\n const hasImplicitHelpCommand =\n this._addImplicitHelpCommand ??\n (this.commands.length &&\n !this._actionHandler &&\n !this._findCommand('help'));\n\n if (hasImplicitHelpCommand) {\n if (this._helpCommand === undefined) {\n this.helpCommand(undefined, undefined); // use default name and description\n }\n return this._helpCommand;\n }\n return null;\n }\n\n /**\n * Add hook for life cycle event.\n *\n * @param {string} event\n * @param {Function} listener\n * @return {Command} `this` command for chaining\n */\n\n hook(event, listener) {\n const allowedValues = ['preSubcommand', 'preAction', 'postAction'];\n if (!allowedValues.includes(event)) {\n throw new Error(`Unexpected value for event passed to hook : '${event}'.\nExpecting one of '${allowedValues.join(\"', '\")}'`);\n }\n if (this._lifeCycleHooks[event]) {\n this._lifeCycleHooks[event].push(listener);\n } else {\n this._lifeCycleHooks[event] = [listener];\n }\n return this;\n }\n\n /**\n * Register callback to use as replacement for calling process.exit.\n *\n * @param {Function} [fn] optional callback which will be passed a CommanderError, defaults to throwing\n * @return {Command} `this` command for chaining\n */\n\n exitOverride(fn) {\n if (fn) {\n this._exitCallback = fn;\n } else {\n this._exitCallback = (err) => {\n if (err.code !== 'commander.executeSubCommandAsync') {\n throw err;\n } else {\n // Async callback from spawn events, not useful to throw.\n }\n };\n }\n return this;\n }\n\n /**\n * Call process.exit, and _exitCallback if defined.\n *\n * @param {number} exitCode exit code for using with process.exit\n * @param {string} code an id string representing the error\n * @param {string} message human-readable description of the error\n * @return never\n * @private\n */\n\n _exit(exitCode, code, message) {\n if (this._exitCallback) {\n this._exitCallback(new CommanderError(exitCode, code, message));\n // Expecting this line is not reached.\n }\n process.exit(exitCode);\n }\n\n /**\n * Register callback `fn` for the command.\n *\n * @example\n * program\n * .command('serve')\n * .description('start service')\n * .action(function() {\n * // do work here\n * });\n *\n * @param {Function} fn\n * @return {Command} `this` command for chaining\n */\n\n action(fn) {\n const listener = (args) => {\n // The .action callback takes an extra parameter which is the command or options.\n const expectedArgsCount = this.registeredArguments.length;\n const actionArgs = args.slice(0, expectedArgsCount);\n if (this._storeOptionsAsProperties) {\n actionArgs[expectedArgsCount] = this; // backwards compatible \"options\"\n } else {\n actionArgs[expectedArgsCount] = this.opts();\n }\n actionArgs.push(this);\n\n return fn.apply(this, actionArgs);\n };\n this._actionHandler = listener;\n return this;\n }\n\n /**\n * Factory routine to create a new unattached option.\n *\n * See .option() for creating an attached option, which uses this routine to\n * create the option. You can override createOption to return a custom option.\n *\n * @param {string} flags\n * @param {string} [description]\n * @return {Option} new option\n */\n\n createOption(flags, description) {\n return new Option(flags, description);\n }\n\n /**\n * Wrap parseArgs to catch 'commander.invalidArgument'.\n *\n * @param {(Option | Argument)} target\n * @param {string} value\n * @param {*} previous\n * @param {string} invalidArgumentMessage\n * @private\n */\n\n _callParseArg(target, value, previous, invalidArgumentMessage) {\n try {\n return target.parseArg(value, previous);\n } catch (err) {\n if (err.code === 'commander.invalidArgument') {\n const message = `${invalidArgumentMessage} ${err.message}`;\n this.error(message, { exitCode: err.exitCode, code: err.code });\n }\n throw err;\n }\n }\n\n /**\n * Check for option flag conflicts.\n * Register option if no conflicts found, or throw on conflict.\n *\n * @param {Option} option\n * @private\n */\n\n _registerOption(option) {\n const matchingOption =\n (option.short && this._findOption(option.short)) ||\n (option.long && this._findOption(option.long));\n if (matchingOption) {\n const matchingFlag =\n option.long && this._findOption(option.long)\n ? option.long\n : option.short;\n throw new Error(`Cannot add option '${option.flags}'${this._name && ` to command '${this._name}'`} due to conflicting flag '${matchingFlag}'\n- already used by option '${matchingOption.flags}'`);\n }\n\n this._initOptionGroup(option);\n this.options.push(option);\n }\n\n /**\n * Check for command name and alias conflicts with existing commands.\n * Register command if no conflicts found, or throw on conflict.\n *\n * @param {Command} command\n * @private\n */\n\n _registerCommand(command) {\n const knownBy = (cmd) => {\n return [cmd.name()].concat(cmd.aliases());\n };\n\n const alreadyUsed = knownBy(command).find((name) =>\n this._findCommand(name),\n );\n if (alreadyUsed) {\n const existingCmd = knownBy(this._findCommand(alreadyUsed)).join('|');\n const newCmd = knownBy(command).join('|');\n throw new Error(\n `cannot add command '${newCmd}' as already have command '${existingCmd}'`,\n );\n }\n\n this._initCommandGroup(command);\n this.commands.push(command);\n }\n\n /**\n * Add an option.\n *\n * @param {Option} option\n * @return {Command} `this` command for chaining\n */\n addOption(option) {\n this._registerOption(option);\n\n const oname = option.name();\n const name = option.attributeName();\n\n // store default value\n if (option.defaultValue !== undefined) {\n this.setOptionValueWithSource(name, option.defaultValue, 'default');\n }\n\n // handler for cli and env supplied values\n const handleOptionValue = (val, invalidValueMessage, valueSource) => {\n // val is null for optional option used without an optional-argument.\n // val is undefined for boolean and negated option.\n if (val == null && option.presetArg !== undefined) {\n val = option.presetArg;\n }\n\n // custom processing\n const oldValue = this.getOptionValue(name);\n if (val !== null && option.parseArg) {\n val = this._callParseArg(option, val, oldValue, invalidValueMessage);\n } else if (val !== null && option.variadic) {\n val = option._collectValue(val, oldValue);\n }\n\n // Fill-in appropriate missing values. Long winded but easy to follow.\n if (val == null) {\n if (option.negate) {\n val = false;\n } else if (option.isBoolean() || option.optional) {\n val = true;\n } else {\n val = ''; // not normal, parseArg might have failed or be a mock function for testing\n }\n }\n this.setOptionValueWithSource(name, val, valueSource);\n };\n\n this.on('option:' + oname, (val) => {\n const invalidValueMessage = `error: option '${option.flags}' argument '${val}' is invalid.`;\n handleOptionValue(val, invalidValueMessage, 'cli');\n });\n\n if (option.envVar) {\n this.on('optionEnv:' + oname, (val) => {\n const invalidValueMessage = `error: option '${option.flags}' value '${val}' from env '${option.envVar}' is invalid.`;\n handleOptionValue(val, invalidValueMessage, 'env');\n });\n }\n\n return this;\n }\n\n /**\n * Internal implementation shared by .option() and .requiredOption()\n *\n * @return {Command} `this` command for chaining\n * @private\n */\n _optionEx(config, flags, description, fn, defaultValue) {\n if (typeof flags === 'object' && flags instanceof Option) {\n throw new Error(\n 'To add an Option object use addOption() instead of option() or requiredOption()',\n );\n }\n const option = this.createOption(flags, description);\n option.makeOptionMandatory(!!config.mandatory);\n if (typeof fn === 'function') {\n option.default(defaultValue).argParser(fn);\n } else if (fn instanceof RegExp) {\n // deprecated\n const regex = fn;\n fn = (val, def) => {\n const m = regex.exec(val);\n return m ? m[0] : def;\n };\n option.default(defaultValue).argParser(fn);\n } else {\n option.default(fn);\n }\n\n return this.addOption(option);\n }\n\n /**\n * Define option with `flags`, `description`, and optional argument parsing function or `defaultValue` or both.\n *\n * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space. A required\n * option-argument is indicated by `<>` and an optional option-argument by `[]`.\n *\n * See the README for more details, and see also addOption() and requiredOption().\n *\n * @example\n * program\n * .option('-p, --pepper', 'add pepper')\n * .option('--pt, --pizza-type <TYPE>', 'type of pizza') // required option-argument\n * .option('-c, --cheese [CHEESE]', 'add extra cheese', 'mozzarella') // optional option-argument with default\n * .option('-t, --tip <VALUE>', 'add tip to purchase cost', parseFloat) // custom parse function\n *\n * @param {string} flags\n * @param {string} [description]\n * @param {(Function|*)} [parseArg] - custom option processing function or default value\n * @param {*} [defaultValue]\n * @return {Command} `this` command for chaining\n */\n\n option(flags, description, parseArg, defaultValue) {\n return this._optionEx({}, flags, description, parseArg, defaultValue);\n }\n\n /**\n * Add a required option which must have a value after parsing. This usually means\n * the option must be specified on the command line. (Otherwise the same as .option().)\n *\n * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space.\n *\n * @param {string} flags\n * @param {string} [description]\n * @param {(Function|*)} [parseArg] - custom option processing function or default value\n * @param {*} [defaultValue]\n * @return {Command} `this` command for chaining\n */\n\n requiredOption(flags, description, parseArg, defaultValue) {\n return this._optionEx(\n { mandatory: true },\n flags,\n description,\n parseArg,\n defaultValue,\n );\n }\n\n /**\n * Alter parsing of short flags with optional values.\n *\n * @example\n * // for `.option('-f,--flag [value]'):\n * program.combineFlagAndOptionalValue(true); // `-f80` is treated like `--flag=80`, this is the default behaviour\n * program.combineFlagAndOptionalValue(false) // `-fb` is treated like `-f -b`\n *\n * @param {boolean} [combine] - if `true` or omitted, an optional value can be specified directly after the flag.\n * @return {Command} `this` command for chaining\n */\n combineFlagAndOptionalValue(combine = true) {\n this._combineFlagAndOptionalValue = !!combine;\n return this;\n }\n\n /**\n * Allow unknown options on the command line.\n *\n * @param {boolean} [allowUnknown] - if `true` or omitted, no error will be thrown for unknown options.\n * @return {Command} `this` command for chaining\n */\n allowUnknownOption(allowUnknown = true) {\n this._allowUnknownOption = !!allowUnknown;\n return this;\n }\n\n /**\n * Allow excess command-arguments on the command line. Pass false to make excess arguments an error.\n *\n * @param {boolean} [allowExcess] - if `true` or omitted, no error will be thrown for excess arguments.\n * @return {Command} `this` command for chaining\n */\n allowExcessArguments(allowExcess = true) {\n this._allowExcessArguments = !!allowExcess;\n return this;\n }\n\n /**\n * Enable positional options. Positional means global options are specified before subcommands which lets\n * subcommands reuse the same option names, and also enables subcommands to turn on passThroughOptions.\n * The default behaviour is non-positional and global options may appear anywhere on the command line.\n *\n * @param {boolean} [positional]\n * @return {Command} `this` command for chaining\n */\n enablePositionalOptions(positional = true) {\n this._enablePositionalOptions = !!positional;\n return this;\n }\n\n /**\n * Pass through options that come after command-arguments rather than treat them as command-options,\n * so actual command-options come before command-arguments. Turning this on for a subcommand requires\n * positional options to have been enabled on the program (parent commands).\n * The default behaviour is non-positional and options may appear before or after command-arguments.\n *\n * @param {boolean} [passThrough] for unknown options.\n * @return {Command} `this` command for chaining\n */\n passThroughOptions(passThrough = true) {\n this._passThroughOptions = !!passThrough;\n this._checkForBrokenPassThrough();\n return this;\n }\n\n /**\n * @private\n */\n\n _checkForBrokenPassThrough() {\n if (\n this.parent &&\n this._passThroughOptions &&\n !this.parent._enablePositionalOptions\n ) {\n throw new Error(\n `passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`,\n );\n }\n }\n\n /**\n * Whether to store option values as properties on command object,\n * or store separately (specify false). In both cases the option values can be accessed using .opts().\n *\n * @param {boolean} [storeAsProperties=true]\n * @return {Command} `this` command for chaining\n */\n\n storeOptionsAsProperties(storeAsProperties = true) {\n if (this.options.length) {\n throw new Error('call .storeOptionsAsProperties() before adding options');\n }\n if (Object.keys(this._optionValues).length) {\n throw new Error(\n 'call .storeOptionsAsProperties() before setting option values',\n );\n }\n this._storeOptionsAsProperties = !!storeAsProperties;\n return this;\n }\n\n /**\n * Retrieve option value.\n *\n * @param {string} key\n * @return {object} value\n */\n\n getOptionValue(key) {\n if (this._storeOptionsAsProperties) {\n return this[key];\n }\n return this._optionValues[key];\n }\n\n /**\n * Store option value.\n *\n * @param {string} key\n * @param {object} value\n * @return {Command} `this` command for chaining\n */\n\n setOptionValue(key, value) {\n return this.setOptionValueWithSource(key, value, undefined);\n }\n\n /**\n * Store option value and where the value came from.\n *\n * @param {string} key\n * @param {object} value\n * @param {string} source - expected values are default/config/env/cli/implied\n * @return {Command} `this` command for chaining\n */\n\n setOptionValueWithSource(key, value, source) {\n if (this._storeOptionsAsProperties) {\n this[key] = value;\n } else {\n this._optionValues[key] = value;\n }\n this._optionValueSources[key] = source;\n return this;\n }\n\n /**\n * Get source of option value.\n * Expected values are default | config | env | cli | implied\n *\n * @param {string} key\n * @return {string}\n */\n\n getOptionValueSource(key) {\n return this._optionValueSources[key];\n }\n\n /**\n * Get source of option value. See also .optsWithGlobals().\n * Expected values are default | config | env | cli | implied\n *\n * @param {string} key\n * @return {string}\n */\n\n getOptionValueSourceWithGlobals(key) {\n // global overwrites local, like optsWithGlobals\n let source;\n this._getCommandAndAncestors().forEach((cmd) => {\n if (cmd.getOptionValueSource(key) !== undefined) {\n source = cmd.getOptionValueSource(key);\n }\n });\n return source;\n }\n\n /**\n * Get user arguments from implied or explicit arguments.\n * Side-effects: set _scriptPath if args included script. Used for default program name, and subcommand searches.\n *\n * @private\n */\n\n _prepareUserArgs(argv, parseOptions) {\n if (argv !== undefined && !Array.isArray(argv)) {\n throw new Error('first parameter to parse must be array or undefined');\n }\n parseOptions = parseOptions || {};\n\n // auto-detect argument conventions if nothing supplied\n if (argv === undefined && parseOptions.from === undefined) {\n if (process.versions?.electron) {\n parseOptions.from = 'electron';\n }\n // check node specific options for scenarios where user CLI args follow executable without scriptname\n const execArgv = process.execArgv ?? [];\n if (\n execArgv.includes('-e') ||\n execArgv.includes('--eval') ||\n execArgv.includes('-p') ||\n execArgv.includes('--print')\n ) {\n parseOptions.from = 'eval'; // internal usage, not documented\n }\n }\n\n // default to using process.argv\n if (argv === undefined) {\n argv = process.argv;\n }\n this.rawArgs = argv.slice();\n\n // extract the user args and scriptPath\n let userArgs;\n switch (parseOptions.from) {\n case undefined:\n case 'node':\n this._scriptPath = argv[1];\n userArgs = argv.slice(2);\n break;\n case 'electron':\n // @ts-ignore: because defaultApp is an unknown property\n if (process.defaultApp) {\n this._scriptPath = argv[1];\n userArgs = argv.slice(2);\n } else {\n userArgs = argv.slice(1);\n }\n break;\n case 'user':\n userArgs = argv.slice(0);\n break;\n case 'eval':\n userArgs = argv.slice(1);\n break;\n default:\n throw new Error(\n `unexpected parse option { from: '${parseOptions.from}' }`,\n );\n }\n\n // Find default name for program from arguments.\n if (!this._name && this._scriptPath)\n this.nameFromFilename(this._scriptPath);\n this._name = this._name || 'program';\n\n return userArgs;\n }\n\n /**\n * Parse `argv`, setting options and invoking commands when defined.\n *\n * Use parseAsync instead of parse if any of your action handlers are async.\n *\n * Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode!\n *\n * Or call with an array of strings to parse, and optionally where the user arguments start by specifying where the arguments are `from`:\n * - `'node'`: default, `argv[0]` is the application and `argv[1]` is the script being run, with user arguments after that\n * - `'electron'`: `argv[0]` is the application and `argv[1]` varies depending on whether the electron application is packaged\n * - `'user'`: just user arguments\n *\n * @example\n * program.parse(); // parse process.argv and auto-detect electron and special node flags\n * program.parse(process.argv); // assume argv[0] is app and argv[1] is script\n * program.parse(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]\n *\n * @param {string[]} [argv] - optional, defaults to process.argv\n * @param {object} [parseOptions] - optionally specify style of options with from: node/user/electron\n * @param {string} [parseOptions.from] - where the args are from: 'node', 'user', 'electron'\n * @return {Command} `this` command for chaining\n */\n\n parse(argv, parseOptions) {\n this._prepareForParse();\n const userArgs = this._prepareUserArgs(argv, parseOptions);\n this._parseCommand([], userArgs);\n\n return this;\n }\n\n /**\n * Parse `argv`, setting options and invoking commands when defined.\n *\n * Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode!\n *\n * Or call with an array of strings to parse, and optionally where the user arguments start by specifying where the arguments are `from`:\n * - `'node'`: default, `argv[0]` is the application and `argv[1]` is the script being run, with user arguments after that\n * - `'electron'`: `argv[0]` is the application and `argv[1]` varies depending on whether the electron application is packaged\n * - `'user'`: just user arguments\n *\n * @example\n * await program.parseAsync(); // parse process.argv and auto-detect electron and special node flags\n * await program.parseAsync(process.argv); // assume argv[0] is app and argv[1] is script\n * await program.parseAsync(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]\n *\n * @param {string[]} [argv]\n * @param {object} [parseOptions]\n * @param {string} parseOptions.from - where the args are from: 'node', 'user', 'electron'\n * @return {Promise}\n */\n\n async parseAsync(argv, parseOptions) {\n this._prepareForParse();\n const userArgs = this._prepareUserArgs(argv, parseOptions);\n await this._parseCommand([], userArgs);\n\n return this;\n }\n\n _prepareForParse() {\n // Save the state the first time, then restore the state before each subsequent parse.\n if (this._savedState === null) {\n // Do the special default of lone negated option to true, now that we have all the options.\n // Filter for negated options that have not been processed already.\n this.options\n .filter(\n (option) =>\n option.negate &&\n option.defaultValue === undefined &&\n this.getOptionValue(option.attributeName()) === undefined,\n )\n .forEach((option) => {\n // check for lone negated option: --no-foo without a --foo option\n const positiveLongFlag = option.long.replace(/^--no-/, '--');\n if (!this._findOption(positiveLongFlag)) {\n this.setOptionValueWithSource(\n option.attributeName(),\n true,\n 'default',\n );\n }\n });\n\n this.saveStateBeforeParse();\n } else {\n this.restoreStateBeforeParse();\n }\n }\n\n /**\n * Called the first time parse is called to save state and allow a restore before subsequent calls to parse.\n * Not usually called directly, but available for subclasses to save their custom state.\n *\n * This is called in a lazy way. Only commands used in parsing chain will have state saved.\n */\n saveStateBeforeParse() {\n this._savedState = {\n // name is stable if supplied by author, but may be unspecified for root command and deduced during parsing\n _name: this._name,\n // option values before parse have default values (including false for negated options)\n // shallow clones\n _optionValues: { ...this._optionValues },\n _optionValueSources: { ...this._optionValueSources },\n };\n }\n\n /**\n * Restore state before parse for calls after the first.\n * Not usually called directly, but available for subclasses to save their custom state.\n *\n * This is called in a lazy way. Only commands used in parsing chain will have state restored.\n */\n restoreStateBeforeParse() {\n if (this._storeOptionsAsProperties)\n throw new Error(`Can not call parse again when storeOptionsAsProperties is true.\n- either make a new Command for each call to parse, or stop storing options as properties`);\n\n // clear state from _prepareUserArgs\n this._name = this._savedState._name;\n this._scriptPath = null;\n this.rawArgs = [];\n // clear state from setOptionValueWithSource\n this._optionValues = { ...this._savedState._optionValues };\n this._optionValueSources = { ...this._savedState._optionValueSources };\n // clear state from _parseCommand\n this.args = [];\n // clear state from _processArguments\n this.processedArgs = [];\n }\n\n /**\n * Throw if expected executable is missing. Add lots of help for author.\n *\n * @param {string} executableFile\n * @param {string} executableDir\n * @param {string} subcommandName\n */\n _checkForMissingExecutable(executableFile, executableDir, subcommandName) {\n if (fs.existsSync(executableFile)) return;\n\n const executableDirMessage = executableDir\n ? `searched for local subcommand relative to directory '${executableDir}'`\n : 'no directory for search for local subcommand, use .executableDir() to supply a custom directory';\n const executableMissing = `'${executableFile}' does not exist\n - if '${subcommandName}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${executableDirMessage}`;\n throw new Error(executableMissing);\n }\n\n /**\n * Execute a sub-command executable.\n *\n * @private\n */\n\n _executeSubCommand(subcommand, args) {\n args = args.slice();\n const sourceExt = ['.js', '.ts', '.tsx', '.mjs', '.cjs'];\n\n function findFile(baseDir, baseName) {\n // Look for specified file\n const localBin = path.resolve(baseDir, baseName);\n if (fs.existsSync(localBin)) return localBin;\n\n // Stop looking if candidate already has an expected extension.\n if (sourceExt.includes(path.extname(baseName))) return undefined;\n\n // Try all the extensions.\n const foundExt = sourceExt.find((ext) =>\n fs.existsSync(`${localBin}${ext}`),\n );\n if (foundExt) return `${localBin}${foundExt}`;\n\n return undefined;\n }\n\n // Not checking for help first. Unlikely to have mandatory and executable, and can't robustly test for help flags in external command.\n this._checkForMissingMandatoryOptions();\n this._checkForConflictingOptions();\n\n // executableFile and executableDir might be full path, or just a name\n let executableFile =\n subcommand._executableFile || `${this._name}-${subcommand._name}`;\n let executableDir = this._executableDir || '';\n if (this._scriptPath) {\n let resolvedScriptPath; // resolve possible symlink for installed npm binary\n try {\n resolvedScriptPath = fs.realpathSync(this._scriptPath);\n } catch {\n resolvedScriptPath = this._scriptPath;\n }\n executableDir = path.resolve(\n path.dirname(resolvedScriptPath),\n executableDir,\n );\n }\n\n // Look for a local file in preference to a command in PATH.\n if (executableDir) {\n let localFile = findFile(executableDir, executableFile);\n\n // Legacy search using prefix of script name instead of command name\n if (!localFile && !subcommand._executableFile && this._scriptPath) {\n const legacyName = path.basename(\n this._scriptPath,\n path.extname(this._scriptPath),\n );\n if (legacyName !== this._name) {\n localFile = findFile(\n executableDir,\n `${legacyName}-${subcommand._name}`,\n );\n }\n }\n executableFile = localFile || executableFile;\n }\n\n const launchWithNode = sourceExt.includes(path.extname(executableFile));\n\n let proc;\n if (process.platform !== 'win32') {\n if (launchWithNode) {\n args.unshift(executableFile);\n // add executable arguments to spawn\n args = incrementNodeInspectorPort(process.execArgv).concat(args);\n\n proc = childProcess.spawn(process.argv[0], args, { stdio: 'inherit' });\n } else {\n proc = childProcess.spawn(executableFile, args, { stdio: 'inherit' });\n }\n } else {\n this._checkForMissingExecutable(\n executableFile,\n executableDir,\n subcommand._name,\n );\n args.unshift(executableFile);\n // add executable arguments to spawn\n args = incrementNodeInspectorPort(process.execArgv).concat(args);\n proc = childProcess.spawn(process.execPath, args, { stdio: 'inherit' });\n }\n\n if (!proc.killed) {\n // testing mainly to avoid leak warnings during unit tests with mocked spawn\n const signals = ['SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGINT', 'SIGHUP'];\n signals.forEach((signal) => {\n process.on(signal, () => {\n if (proc.killed === false && proc.exitCode === null) {\n // @ts-ignore because signals not typed to known strings\n proc.kill(signal);\n }\n });\n });\n }\n\n // By default terminate process when spawned process terminates.\n const exitCallback = this._exitCallback;\n proc.on('close', (code) => {\n code = code ?? 1; // code is null if spawned process terminated due to a signal\n if (!exitCallback) {\n process.exit(code);\n } else {\n exitCallback(\n new CommanderError(\n code,\n 'commander.executeSubCommandAsync',\n '(close)',\n ),\n );\n }\n });\n proc.on('error', (err) => {\n // @ts-ignore: because err.code is an unknown property\n if (err.code === 'ENOENT') {\n this._checkForMissingExecutable(\n executableFile,\n executableDir,\n subcommand._name,\n );\n // @ts-ignore: because err.code is an unknown property\n } else if (err.code === 'EACCES') {\n throw new Error(`'${executableFile}' not executable`);\n }\n if (!exitCallback) {\n process.exit(1);\n } else {\n const wrappedError = new CommanderError(\n 1,\n 'commander.executeSubCommandAsync',\n '(error)',\n );\n wrappedError.nestedError = err;\n exitCallback(wrappedError);\n }\n });\n\n // Store the reference to the child process\n this.runningCommand = proc;\n }\n\n /**\n * @private\n */\n\n _dispatchSubcommand(commandName, operands, unknown) {\n const subCommand = this._findCommand(commandName);\n if (!subCommand) this.help({ error: true });\n\n subCommand._prepareForParse();\n let promiseChain;\n promiseChain = this._chainOrCallSubCommandHook(\n promiseChain,\n subCommand,\n 'preSubcommand',\n );\n promiseChain = this._chainOrCall(promiseChain, () => {\n if (subCommand._executableHandler) {\n this._executeSubCommand(subCommand, operands.concat(unknown));\n } else {\n return subCommand._parseCommand(operands, unknown);\n }\n });\n return promiseChain;\n }\n\n /**\n * Invoke help directly if possible, or dispatch if necessary.\n * e.g. help foo\n *\n * @private\n */\n\n _dispatchHelpCommand(subcommandName) {\n if (!subcommandName) {\n this.help();\n }\n const subCommand = this._findCommand(subcommandName);\n if (subCommand && !subCommand._executableHandler) {\n subCommand.help();\n }\n\n // Fallback to parsing the help flag to invoke the help.\n return this._dispatchSubcommand(\n subcommandName,\n [],\n [this._getHelpOption()?.long ?? this._getHelpOption()?.short ?? '--help'],\n );\n }\n\n /**\n * Check this.args against expected this.registeredArguments.\n *\n * @private\n */\n\n _checkNumberOfArguments() {\n // too few\n this.registeredArguments.forEach((arg, i) => {\n if (arg.required && this.args[i] == null) {\n this.missingArgument(arg.name());\n }\n });\n // too many\n if (\n this.registeredArguments.length > 0 &&\n this.registeredArguments[this.registeredArguments.length - 1].variadic\n ) {\n return;\n }\n if (this.args.length > this.registeredArguments.length) {\n this._excessArguments(this.args);\n }\n }\n\n /**\n * Process this.args using this.registeredArguments and save as this.processedArgs!\n *\n * @private\n */\n\n _processArguments() {\n const myParseArg = (argument, value, previous) => {\n // Extra processing for nice error message on parsing failure.\n let parsedValue = value;\n if (value !== null && argument.parseArg) {\n const invalidValueMessage = `error: command-argument value '${value}' is invalid for argument '${argument.name()}'.`;\n parsedValue = this._callParseArg(\n argument,\n value,\n previous,\n invalidValueMessage,\n );\n }\n return parsedValue;\n };\n\n this._checkNumberOfArguments();\n\n const processedArgs = [];\n this.registeredArguments.forEach((declaredArg, index) => {\n let value = declaredArg.defaultValue;\n if (declaredArg.variadic) {\n // Collect together remaining arguments for passing together as an array.\n if (index < this.args.length) {\n value = this.args.slice(index);\n if (declaredArg.parseArg) {\n value = value.reduce((processed, v) => {\n return myParseArg(declaredArg, v, processed);\n }, declaredArg.defaultValue);\n }\n } else if (value === undefined) {\n value = [];\n }\n } else if (index < this.args.length) {\n value = this.args[index];\n if (declaredArg.parseArg) {\n value = myParseArg(declaredArg, value, declaredArg.defaultValue);\n }\n }\n processedArgs[index] = value;\n });\n this.processedArgs = processedArgs;\n }\n\n /**\n * Once we have a promise we chain, but call synchronously until then.\n *\n * @param {(Promise|undefined)} promise\n * @param {Function} fn\n * @return {(Promise|undefined)}\n * @private\n */\n\n _chainOrCall(promise, fn) {\n // thenable\n if (promise?.then && typeof promise.then === 'function') {\n // already have a promise, chain callback\n return promise.then(() => fn());\n }\n // callback might return a promise\n return fn();\n }\n\n /**\n *\n * @param {(Promise|undefined)} promise\n * @param {string} event\n * @return {(Promise|undefined)}\n * @private\n */\n\n _chainOrCallHooks(promise, event) {\n let result = promise;\n const hooks = [];\n this._getCommandAndAncestors()\n .reverse()\n .filter((cmd) => cmd._lifeCycleHooks[event] !== undefined)\n .forEach((hookedCommand) => {\n hookedCommand._lifeCycleHooks[event].forEach((callback) => {\n hooks.push({ hookedCommand, callback });\n });\n });\n if (event === 'postAction') {\n hooks.reverse();\n }\n\n hooks.forEach((hookDetail) => {\n result = this._chainOrCall(result, () => {\n return hookDetail.callback(hookDetail.hookedCommand, this);\n });\n });\n return result;\n }\n\n /**\n *\n * @param {(Promise|undefined)} promise\n * @param {Command} subCommand\n * @param {string} event\n * @return {(Promise|undefined)}\n * @private\n */\n\n _chainOrCallSubCommandHook(promise, subCommand, event) {\n let result = promise;\n if (this._lifeCycleHooks[event] !== undefined) {\n this._lifeCycleHooks[event].forEach((hook) => {\n result = this._chainOrCall(result, () => {\n return hook(this, subCommand);\n });\n });\n }\n return result;\n }\n\n /**\n * Process arguments in context of this command.\n * Returns action result, in case it is a promise.\n *\n * @private\n */\n\n _parseCommand(operands, unknown) {\n const parsed = this.parseOptions(unknown);\n this._parseOptionsEnv(); // after cli, so parseArg not called on both cli and env\n this._parseOptionsImplied();\n operands = operands.concat(parsed.operands);\n unknown = parsed.unknown;\n this.args = operands.concat(unknown);\n\n if (operands && this._findCommand(operands[0])) {\n return this._dispatchSubcommand(operands[0], operands.slice(1), unknown);\n }\n if (\n this._getHelpCommand() &&\n operands[0] === this._getHelpCommand().name()\n ) {\n return this._dispatchHelpCommand(operands[1]);\n }\n if (this._defaultCommandName) {\n this._outputHelpIfRequested(unknown); // Run the help for default command from parent rather than passing to default command\n return this._dispatchSubcommand(\n this._defaultCommandName,\n operands,\n unknown,\n );\n }\n if (\n this.commands.length &&\n this.args.length === 0 &&\n !this._actionHandler &&\n !this._defaultCommandName\n ) {\n // probably missing subcommand and no handler, user needs help (and exit)\n this.help({ error: true });\n }\n\n this._outputHelpIfRequested(parsed.unknown);\n this._checkForMissingMandatoryOptions();\n this._checkForConflictingOptions();\n\n // We do not always call this check to avoid masking a \"better\" error, like unknown command.\n const checkForUnknownOptions = () => {\n if (parsed.unknown.length > 0) {\n this.unknownOption(parsed.unknown[0]);\n }\n };\n\n const commandEvent = `command:${this.name()}`;\n if (this._actionHandler) {\n checkForUnknownOptions();\n this._processArguments();\n\n let promiseChain;\n promiseChain = this._chainOrCallHooks(promiseChain, 'preAction');\n promiseChain = this._chainOrCall(promiseChain, () =>\n this._actionHandler(this.processedArgs),\n );\n if (this.parent) {\n promiseChain = this._chainOrCall(promiseChain, () => {\n this.parent.emit(commandEvent, operands, unknown); // legacy\n });\n }\n promiseChain = this._chainOrCallHooks(promiseChain, 'postAction');\n return promiseChain;\n }\n if (this.parent?.listenerCount(commandEvent)) {\n checkForUnknownOptions();\n this._processArguments();\n this.parent.emit(commandEvent, operands, unknown); // legacy\n } else if (operands.length) {\n if (this._findCommand('*')) {\n // legacy default command\n return this._dispatchSubcommand('*', operands, unknown);\n }\n if (this.listenerCount('command:*')) {\n // skip option check, emit event for possible misspelling suggestion\n this.emit('command:*', operands, unknown);\n } else if (this.commands.length) {\n this.unknownCommand();\n } else {\n checkForUnknownOptions();\n this._processArguments();\n }\n } else if (this.commands.length) {\n checkForUnknownOptions();\n // This command has subcommands and nothing hooked up at this level, so display help (and exit).\n this.help({ error: true });\n } else {\n checkForUnknownOptions();\n this._processArguments();\n // fall through for caller to handle after calling .parse()\n }\n }\n\n /**\n * Find matching command.\n *\n * @private\n * @return {Command | undefined}\n */\n _findCommand(name) {\n if (!name) return undefined;\n return this.commands.find(\n (cmd) => cmd._name === name || cmd._aliases.includes(name),\n );\n }\n\n /**\n * Return an option matching `arg` if any.\n *\n * @param {string} arg\n * @return {Option}\n * @package\n */\n\n _findOption(arg) {\n return this.options.find((option) => option.is(arg));\n }\n\n /**\n * Display an error message if a mandatory option does not have a value.\n * Called after checking for help flags in leaf subcommand.\n *\n * @private\n */\n\n _checkForMissingMandatoryOptions() {\n // Walk up hierarchy so can call in subcommand after checking for displaying help.\n this._getCommandAndAncestors().forEach((cmd) => {\n cmd.options.forEach((anOption) => {\n if (\n anOption.mandatory &&\n cmd.getOptionValue(anOption.attributeName()) === undefined\n ) {\n cmd.missingMandatoryOptionValue(anOption);\n }\n });\n });\n }\n\n /**\n * Display an error message if conflicting options are used together in this.\n *\n * @private\n */\n _checkForConflictingLocalOptions() {\n const definedNonDefaultOptions = this.options.filter((option) => {\n const optionKey = option.attributeName();\n if (this.getOptionValue(optionKey) === undefined) {\n return false;\n }\n return this.getOptionValueSource(optionKey) !== 'default';\n });\n\n const optionsWithConflicting = definedNonDefaultOptions.filter(\n (option) => option.conflictsWith.length > 0,\n );\n\n optionsWithConflicting.forEach((option) => {\n const conflictingAndDefined = definedNonDefaultOptions.find((defined) =>\n option.conflictsWith.includes(defined.attributeName()),\n );\n if (conflictingAndDefined) {\n this._conflictingOption(option, conflictingAndDefined);\n }\n });\n }\n\n /**\n * Display an error message if conflicting options are used together.\n * Called after checking for help flags in leaf subcommand.\n *\n * @private\n */\n _checkForConflictingOptions() {\n // Walk up hierarchy so can call in subcommand after checking for displaying help.\n this._getCommandAndAncestors().forEach((cmd) => {\n cmd._checkForConflictingLocalOptions();\n });\n }\n\n /**\n * Parse options from `argv` removing known options,\n * and return argv split into operands and unknown arguments.\n *\n * Side effects: modifies command by storing options. Does not reset state if called again.\n *\n * Examples:\n *\n * argv => operands, unknown\n * --known kkk op => [op], []\n * op --known kkk => [op], []\n * sub --unknown uuu op => [sub], [--unknown uuu op]\n * sub -- --unknown uuu op => [sub --unknown uuu op], []\n *\n * @param {string[]} args\n * @return {{operands: string[], unknown: string[]}}\n */\n\n parseOptions(args) {\n const operands = []; // operands, not options or values\n const unknown = []; // first unknown option and remaining unknown args\n let dest = operands;\n\n function maybeOption(arg) {\n return arg.length > 1 && arg[0] === '-';\n }\n\n const negativeNumberArg = (arg) => {\n // return false if not a negative number\n if (!/^-(\\d+|\\d*\\.\\d+)(e[+-]?\\d+)?$/.test(arg)) return false;\n // negative number is ok unless digit used as an option in command hierarchy\n return !this._getCommandAndAncestors().some((cmd) =>\n cmd.options\n .map((opt) => opt.short)\n .some((short) => /^-\\d$/.test(short)),\n );\n };\n\n // parse options\n let activeVariadicOption = null;\n let activeGroup = null; // working through group of short options, like -abc\n let i = 0;\n while (i < args.length || activeGroup) {\n const arg = activeGroup ?? args[i++];\n activeGroup = null;\n\n // literal\n if (arg === '--') {\n if (dest === unknown) dest.push(arg);\n dest.push(...args.slice(i));\n break;\n }\n\n if (\n activeVariadicOption &&\n (!maybeOption(arg) || negativeNumberArg(arg))\n ) {\n this.emit(`option:${activeVariadicOption.name()}`, arg);\n continue;\n }\n activeVariadicOption = null;\n\n if (maybeOption(arg)) {\n const option = this._findOption(arg);\n // recognised option, call listener to assign value with possible custom processing\n if (option) {\n if (option.required) {\n const value = args[i++];\n if (value === undefined) this.optionMissingArgument(option);\n this.emit(`option:${option.name()}`, value);\n } else if (option.optional) {\n let value = null;\n // historical behaviour is optional value is following arg unless an option\n if (\n i < args.length &&\n (!maybeOption(args[i]) || negativeNumberArg(args[i]))\n ) {\n value = args[i++];\n }\n this.emit(`option:${option.name()}`, value);\n } else {\n // boolean flag\n this.emit(`option:${option.name()}`);\n }\n activeVariadicOption = option.variadic ? option : null;\n continue;\n }\n }\n\n // Look for combo options following single dash, eat first one if known.\n if (arg.length > 2 && arg[0] === '-' && arg[1] !== '-') {\n const option = this._findOption(`-${arg[1]}`);\n if (option) {\n if (\n option.required ||\n (option.optional && this._combineFlagAndOptionalValue)\n ) {\n // option with value following in same argument\n this.emit(`option:${option.name()}`, arg.slice(2));\n } else {\n // boolean option\n this.emit(`option:${option.name()}`);\n // remove the processed option and keep processing group\n activeGroup = `-${arg.slice(2)}`;\n }\n continue;\n }\n }\n\n // Look for known long flag with value, like --foo=bar\n if (/^--[^=]+=/.test(arg)) {\n const index = arg.indexOf('=');\n const option = this._findOption(arg.slice(0, index));\n if (option && (option.required || option.optional)) {\n this.emit(`option:${option.name()}`, arg.slice(index + 1));\n continue;\n }\n }\n\n // Not a recognised option by this command.\n // Might be a command-argument, or subcommand option, or unknown option, or help command or option.\n\n // An unknown option means further arguments also classified as unknown so can be reprocessed by subcommands.\n // A negative number in a leaf command is not an unknown option.\n if (\n dest === operands &&\n maybeOption(arg) &&\n !(this.commands.length === 0 && negativeNumberArg(arg))\n ) {\n dest = unknown;\n }\n\n // If using positionalOptions, stop processing our options at subcommand.\n if (\n (this._enablePositionalOptions || this._passThroughOptions) &&\n operands.length === 0 &&\n unknown.length === 0\n ) {\n if (this._findCommand(arg)) {\n operands.push(arg);\n unknown.push(...args.slice(i));\n break;\n } else if (\n this._getHelpCommand() &&\n arg === this._getHelpCommand().name()\n ) {\n operands.push(arg, ...args.slice(i));\n break;\n } else if (this._defaultCommandName) {\n unknown.push(arg, ...args.slice(i));\n break;\n }\n }\n\n // If using passThroughOptions, stop processing options at first command-argument.\n if (this._passThroughOptions) {\n dest.push(arg, ...args.slice(i));\n break;\n }\n\n // add arg\n dest.push(arg);\n }\n\n return { operands, unknown };\n }\n\n /**\n * Return an object containing local option values as key-value pairs.\n *\n * @return {object}\n */\n opts() {\n if (this._storeOptionsAsProperties) {\n // Preserve original behaviour so backwards compatible when still using properties\n const result = {};\n const len = this.options.length;\n\n for (let i = 0; i < len; i++) {\n const key = this.options[i].attributeName();\n result[key] =\n key === this._versionOptionName ? this._version : this[key];\n }\n return result;\n }\n\n return this._optionValues;\n }\n\n /**\n * Return an object containing merged local and global option values as key-value pairs.\n *\n * @return {object}\n */\n optsWithGlobals() {\n // globals overwrite locals\n return this._getCommandAndAncestors().reduce(\n (combinedOptions, cmd) => Object.assign(combinedOptions, cmd.opts()),\n {},\n );\n }\n\n /**\n * Display error message and exit (or call exitOverride).\n *\n * @param {string} message\n * @param {object} [errorOptions]\n * @param {string} [errorOptions.code] - an id string representing the error\n * @param {number} [errorOptions.exitCode] - used with process.exit\n */\n error(message, errorOptions) {\n // output handling\n this._outputConfiguration.outputError(\n `${message}\\n`,\n this._outputConfiguration.writeErr,\n );\n if (typeof this._showHelpAfterError === 'string') {\n this._outputConfiguration.writeErr(`${this._showHelpAfterError}\\n`);\n } else if (this._showHelpAfterError) {\n this._outputConfiguration.writeErr('\\n');\n this.outputHelp({ error: true });\n }\n\n // exit handling\n const config = errorOptions || {};\n const exitCode = config.exitCode || 1;\n const code = config.code || 'commander.error';\n this._exit(exitCode, code, message);\n }\n\n /**\n * Apply any option related environment variables, if option does\n * not have a value from cli or client code.\n *\n * @private\n */\n _parseOptionsEnv() {\n this.options.forEach((option) => {\n if (option.envVar && option.envVar in process.env) {\n const optionKey = option.attributeName();\n // Priority check. Do not overwrite cli or options from unknown source (client-code).\n if (\n this.getOptionValue(optionKey) === undefined ||\n ['default', 'config', 'env'].includes(\n this.getOptionValueSource(optionKey),\n )\n ) {\n if (option.required || option.optional) {\n // option can take a value\n // keep very simple, optional always takes value\n this.emit(`optionEnv:${option.name()}`, process.env[option.envVar]);\n } else {\n // boolean\n // keep very simple, only care that envVar defined and not the value\n this.emit(`optionEnv:${option.name()}`);\n }\n }\n }\n });\n }\n\n /**\n * Apply any implied option values, if option is undefined or default value.\n *\n * @private\n */\n _parseOptionsImplied() {\n const dualHelper = new DualOptions(this.options);\n const hasCustomOptionValue = (optionKey) => {\n return (\n this.getOptionValue(optionKey) !== undefined &&\n !['default', 'implied'].includes(this.getOptionValueSource(optionKey))\n );\n };\n this.options\n .filter(\n (option) =>\n option.implied !== undefined &&\n hasCustomOptionValue(option.attributeName()) &&\n dualHelper.valueFromOption(\n this.getOptionValue(option.attributeName()),\n option,\n ),\n )\n .forEach((option) => {\n Object.keys(option.implied)\n .filter((impliedKey) => !hasCustomOptionValue(impliedKey))\n .forEach((impliedKey) => {\n this.setOptionValueWithSource(\n impliedKey,\n option.implied[impliedKey],\n 'implied',\n );\n });\n });\n }\n\n /**\n * Argument `name` is missing.\n *\n * @param {string} name\n * @private\n */\n\n missingArgument(name) {\n const message = `error: missing required argument '${name}'`;\n this.error(message, { code: 'commander.missingArgument' });\n }\n\n /**\n * `Option` is missing an argument.\n *\n * @param {Option} option\n * @private\n */\n\n optionMissingArgument(option) {\n const message = `error: option '${option.flags}' argument missing`;\n this.error(message, { code: 'commander.optionMissingArgument' });\n }\n\n /**\n * `Option` does not have a value, and is a mandatory option.\n *\n * @param {Option} option\n * @private\n */\n\n missingMandatoryOptionValue(option) {\n const message = `error: required option '${option.flags}' not specified`;\n this.error(message, { code: 'commander.missingMandatoryOptionValue' });\n }\n\n /**\n * `Option` conflicts with another option.\n *\n * @param {Option} option\n * @param {Option} conflictingOption\n * @private\n */\n _conflictingOption(option, conflictingOption) {\n // The calling code does not know whether a negated option is the source of the\n // value, so do some work to take an educated guess.\n const findBestOptionFromValue = (option) => {\n const optionKey = option.attributeName();\n const optionValue = this.getOptionValue(optionKey);\n const negativeOption = this.options.find(\n (target) => target.negate && optionKey === target.attributeName(),\n );\n const positiveOption = this.options.find(\n (target) => !target.negate && optionKey === target.attributeName(),\n );\n if (\n negativeOption &&\n ((negativeOption.presetArg === undefined && optionValue === false) ||\n (negativeOption.presetArg !== undefined &&\n optionValue === negativeOption.presetArg))\n ) {\n return negativeOption;\n }\n return positiveOption || option;\n };\n\n const getErrorMessage = (option) => {\n const bestOption = findBestOptionFromValue(option);\n const optionKey = bestOption.attributeName();\n const source = this.getOptionValueSource(optionKey);\n if (source === 'env') {\n return `environment variable '${bestOption.envVar}'`;\n }\n return `option '${bestOption.flags}'`;\n };\n\n const message = `error: ${getErrorMessage(option)} cannot be used with ${getErrorMessage(conflictingOption)}`;\n this.error(message, { code: 'commander.conflictingOption' });\n }\n\n /**\n * Unknown option `flag`.\n *\n * @param {string} flag\n * @private\n */\n\n unknownOption(flag) {\n if (this._allowUnknownOption) return;\n let suggestion = '';\n\n if (flag.startsWith('--') && this._showSuggestionAfterError) {\n // Looping to pick up the global options too\n let candidateFlags = [];\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let command = this;\n do {\n const moreFlags = command\n .createHelp()\n .visibleOptions(command)\n .filter((option) => option.long)\n .map((option) => option.long);\n candidateFlags = candidateFlags.concat(moreFlags);\n command = command.parent;\n } while (command && !command._enablePositionalOptions);\n suggestion = suggestSimilar(flag, candidateFlags);\n }\n\n const message = `error: unknown option '${flag}'${suggestion}`;\n this.error(message, { code: 'commander.unknownOption' });\n }\n\n /**\n * Excess arguments, more than expected.\n *\n * @param {string[]} receivedArgs\n * @private\n */\n\n _excessArguments(receivedArgs) {\n if (this._allowExcessArguments) return;\n\n const expected = this.registeredArguments.length;\n const s = expected === 1 ? '' : 's';\n const received = receivedArgs.length;\n const forSubcommand = this.parent ? ` for '${this.name()}'` : '';\n const details = receivedArgs.join(', ');\n const message = `error: too many arguments${forSubcommand}. Expected ${expected} argument${s} but got ${received}: ${details}.`;\n this.error(message, { code: 'commander.excessArguments' });\n }\n\n /**\n * Unknown command.\n *\n * @private\n */\n\n unknownCommand() {\n const unknownName = this.args[0];\n let suggestion = '';\n\n if (this._showSuggestionAfterError) {\n const candidateNames = [];\n this.createHelp()\n .visibleCommands(this)\n .forEach((command) => {\n candidateNames.push(command.name());\n // just visible alias\n if (command.alias()) candidateNames.push(command.alias());\n });\n suggestion = suggestSimilar(unknownName, candidateNames);\n }\n\n const message = `error: unknown command '${unknownName}'${suggestion}`;\n this.error(message, { code: 'commander.unknownCommand' });\n }\n\n /**\n * Get or set the program version.\n *\n * This method auto-registers the \"-V, --version\" option which will print the version number.\n *\n * You can optionally supply the flags and description to override the defaults.\n *\n * @param {string} [str]\n * @param {string} [flags]\n * @param {string} [description]\n * @return {(this | string | undefined)} `this` command for chaining, or version string if no arguments\n */\n\n version(str, flags, description) {\n if (str === undefined) return this._version;\n this._version = str;\n flags = flags || '-V, --version';\n description = description || 'output the version number';\n const versionOption = this.createOption(flags, description);\n this._versionOptionName = versionOption.attributeName();\n this._registerOption(versionOption);\n\n this.on('option:' + versionOption.name(), () => {\n this._outputConfiguration.writeOut(`${str}\\n`);\n this._exit(0, 'commander.version', str);\n });\n return this;\n }\n\n /**\n * Set the description.\n *\n * @param {string} [str]\n * @param {object} [argsDescription]\n * @return {(string|Command)}\n */\n description(str, argsDescription) {\n if (str === undefined && argsDescription === undefined)\n return this._description;\n this._description = str;\n if (argsDescription) {\n this._argsDescription = argsDescription;\n }\n return this;\n }\n\n /**\n * Set the summary. Used when listed as subcommand of parent.\n *\n * @param {string} [str]\n * @return {(string|Command)}\n */\n summary(str) {\n if (str === undefined) return this._summary;\n this._summary = str;\n return this;\n }\n\n /**\n * Set an alias for the command.\n *\n * You may call more than once to add multiple aliases. Only the first alias is shown in the auto-generated help.\n *\n * @param {string} [alias]\n * @return {(string|Command)}\n */\n\n alias(alias) {\n if (alias === undefined) return this._aliases[0]; // just return first, for backwards compatibility\n\n /** @type {Command} */\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let command = this;\n if (\n this.commands.length !== 0 &&\n this.commands[this.commands.length - 1]._executableHandler\n ) {\n // assume adding alias for last added executable subcommand, rather than this\n command = this.commands[this.commands.length - 1];\n }\n\n if (alias === command._name)\n throw new Error(\"Command alias can't be the same as its name\");\n const matchingCommand = this.parent?._findCommand(alias);\n if (matchingCommand) {\n // c.f. _registerCommand\n const existingCmd = [matchingCommand.name()]\n .concat(matchingCommand.aliases())\n .join('|');\n throw new Error(\n `cannot add alias '${alias}' to command '${this.name()}' as already have command '${existingCmd}'`,\n );\n }\n\n command._aliases.push(alias);\n return this;\n }\n\n /**\n * Set aliases for the command.\n *\n * Only the first alias is shown in the auto-generated help.\n *\n * @param {string[]} [aliases]\n * @return {(string[]|Command)}\n */\n\n aliases(aliases) {\n // Getter for the array of aliases is the main reason for having aliases() in addition to alias().\n if (aliases === undefined) return this._aliases;\n\n aliases.forEach((alias) => this.alias(alias));\n return this;\n }\n\n /**\n * Set / get the command usage `str`.\n *\n * @param {string} [str]\n * @return {(string|Command)}\n */\n\n usage(str) {\n if (str === undefined) {\n if (this._usage) return this._usage;\n\n const args = this.registeredArguments.map((arg) => {\n return humanReadableArgName(arg);\n });\n return []\n .concat(\n this.options.length || this._helpOption !== null ? '[options]' : [],\n this.commands.length ? '[command]' : [],\n this.registeredArguments.length ? args : [],\n )\n .join(' ');\n }\n\n this._usage = str;\n return this;\n }\n\n /**\n * Get or set the name of the command.\n *\n * @param {string} [str]\n * @return {(string|Command)}\n */\n\n name(str) {\n if (str === undefined) return this._name;\n this._name = str;\n return this;\n }\n\n /**\n * Set/get the help group heading for this subcommand in parent command's help.\n *\n * @param {string} [heading]\n * @return {Command | string}\n */\n\n helpGroup(heading) {\n if (heading === undefined) return this._helpGroupHeading ?? '';\n this._helpGroupHeading = heading;\n return this;\n }\n\n /**\n * Set/get the default help group heading for subcommands added to this command.\n * (This does not override a group set directly on the subcommand using .helpGroup().)\n *\n * @example\n * program.commandsGroup('Development Commands:);\n * program.command('watch')...\n * program.command('lint')...\n * ...\n *\n * @param {string} [heading]\n * @returns {Command | string}\n */\n commandsGroup(heading) {\n if (heading === undefined) return this._defaultCommandGroup ?? '';\n this._defaultCommandGroup = heading;\n return this;\n }\n\n /**\n * Set/get the default help group heading for options added to this command.\n * (This does not override a group set directly on the option using .helpGroup().)\n *\n * @example\n * program\n * .optionsGroup('Development Options:')\n * .option('-d, --debug', 'output extra debugging')\n * .option('-p, --profile', 'output profiling information')\n *\n * @param {string} [heading]\n * @returns {Command | string}\n */\n optionsGroup(heading) {\n if (heading === undefined) return this._defaultOptionGroup ?? '';\n this._defaultOptionGroup = heading;\n return this;\n }\n\n /**\n * @param {Option} option\n * @private\n */\n _initOptionGroup(option) {\n if (this._defaultOptionGroup && !option.helpGroupHeading)\n option.helpGroup(this._defaultOptionGroup);\n }\n\n /**\n * @param {Command} cmd\n * @private\n */\n _initCommandGroup(cmd) {\n if (this._defaultCommandGroup && !cmd.helpGroup())\n cmd.helpGroup(this._defaultCommandGroup);\n }\n\n /**\n * Set the name of the command from script filename, such as process.argv[1],\n * or import.meta.filename.\n *\n * (Used internally and public although not documented in README.)\n *\n * @example\n * program.nameFromFilename(import.meta.filename);\n *\n * @param {string} filename\n * @return {Command}\n */\n\n nameFromFilename(filename) {\n this._name = path.basename(filename, path.extname(filename));\n\n return this;\n }\n\n /**\n * Get or set the directory for searching for executable subcommands of this command.\n *\n * @example\n * program.executableDir(import.meta.dirname);\n * // or\n * program.executableDir('subcommands');\n *\n * @param {string} [path]\n * @return {(string|null|Command)}\n */\n\n executableDir(path) {\n if (path === undefined) return this._executableDir;\n this._executableDir = path;\n return this;\n }\n\n /**\n * Return program help documentation.\n *\n * @param {{ error: boolean }} [contextOptions] - pass {error:true} to wrap for stderr instead of stdout\n * @return {string}\n */\n\n helpInformation(contextOptions) {\n const helper = this.createHelp();\n const context = this._getOutputContext(contextOptions);\n helper.prepareContext({\n error: context.error,\n helpWidth: context.helpWidth,\n outputHasColors: context.hasColors,\n });\n const text = helper.formatHelp(this, helper);\n if (context.hasColors) return text;\n return this._outputConfiguration.stripColor(text);\n }\n\n /**\n * @typedef HelpContext\n * @type {object}\n * @property {boolean} error\n * @property {number} helpWidth\n * @property {boolean} hasColors\n * @property {function} write - includes stripColor if needed\n *\n * @returns {HelpContext}\n * @private\n */\n\n _getOutputContext(contextOptions) {\n contextOptions = contextOptions || {};\n const error = !!contextOptions.error;\n let baseWrite;\n let hasColors;\n let helpWidth;\n if (error) {\n baseWrite = (str) => this._outputConfiguration.writeErr(str);\n hasColors = this._outputConfiguration.getErrHasColors();\n helpWidth = this._outputConfiguration.getErrHelpWidth();\n } else {\n baseWrite = (str) => this._outputConfiguration.writeOut(str);\n hasColors = this._outputConfiguration.getOutHasColors();\n helpWidth = this._outputConfiguration.getOutHelpWidth();\n }\n const write = (str) => {\n if (!hasColors) str = this._outputConfiguration.stripColor(str);\n return baseWrite(str);\n };\n return { error, write, hasColors, helpWidth };\n }\n\n /**\n * Output help information for this command.\n *\n * Outputs built-in help, and custom text added using `.addHelpText()`.\n *\n * @param {{ error: boolean } | Function} [contextOptions] - pass {error:true} to write to stderr instead of stdout\n */\n\n outputHelp(contextOptions) {\n let deprecatedCallback;\n if (typeof contextOptions === 'function') {\n deprecatedCallback = contextOptions;\n contextOptions = undefined;\n }\n\n const outputContext = this._getOutputContext(contextOptions);\n /** @type {HelpTextEventContext} */\n const eventContext = {\n error: outputContext.error,\n write: outputContext.write,\n command: this,\n };\n\n this._getCommandAndAncestors()\n .reverse()\n .forEach((command) => command.emit('beforeAllHelp', eventContext));\n this.emit('beforeHelp', eventContext);\n\n let helpInformation = this.helpInformation({ error: outputContext.error });\n if (deprecatedCallback) {\n helpInformation = deprecatedCallback(helpInformation);\n if (\n typeof helpInformation !== 'string' &&\n !Buffer.isBuffer(helpInformation)\n ) {\n throw new Error('outputHelp callback must return a string or a Buffer');\n }\n }\n outputContext.write(helpInformation);\n\n if (this._getHelpOption()?.long) {\n this.emit(this._getHelpOption().long); // deprecated\n }\n this.emit('afterHelp', eventContext);\n this._getCommandAndAncestors().forEach((command) =>\n command.emit('afterAllHelp', eventContext),\n );\n }\n\n /**\n * You can pass in flags and a description to customise the built-in help option.\n * Pass in false to disable the built-in help option.\n *\n * @example\n * program.helpOption('-?, --help' 'show help'); // customise\n * program.helpOption(false); // disable\n *\n * @param {(string | boolean)} flags\n * @param {string} [description]\n * @return {Command} `this` command for chaining\n */\n\n helpOption(flags, description) {\n // Support enabling/disabling built-in help option.\n if (typeof flags === 'boolean') {\n if (flags) {\n if (this._helpOption === null) this._helpOption = undefined; // reenable\n if (this._defaultOptionGroup) {\n // make the option to store the group\n this._initOptionGroup(this._getHelpOption());\n }\n } else {\n this._helpOption = null; // disable\n }\n return this;\n }\n\n // Customise flags and description.\n this._helpOption = this.createOption(\n flags ?? '-h, --help',\n description ?? 'display help for command',\n );\n // init group unless lazy create\n if (flags || description) this._initOptionGroup(this._helpOption);\n\n return this;\n }\n\n /**\n * Lazy create help option.\n * Returns null if has been disabled with .helpOption(false).\n *\n * @returns {(Option | null)} the help option\n * @package\n */\n _getHelpOption() {\n // Lazy create help option on demand.\n if (this._helpOption === undefined) {\n this.helpOption(undefined, undefined);\n }\n return this._helpOption;\n }\n\n /**\n * Supply your own option to use for the built-in help option.\n * This is an alternative to using helpOption() to customise the flags and description etc.\n *\n * @param {Option} option\n * @return {Command} `this` command for chaining\n */\n addHelpOption(option) {\n this._helpOption = option;\n this._initOptionGroup(option);\n return this;\n }\n\n /**\n * Output help information and exit.\n *\n * Outputs built-in help, and custom text added using `.addHelpText()`.\n *\n * @param {{ error: boolean }} [contextOptions] - pass {error:true} to write to stderr instead of stdout\n */\n\n help(contextOptions) {\n this.outputHelp(contextOptions);\n let exitCode = Number(process.exitCode ?? 0); // process.exitCode does allow a string or an integer, but we prefer just a number\n if (\n exitCode === 0 &&\n contextOptions &&\n typeof contextOptions !== 'function' &&\n contextOptions.error\n ) {\n exitCode = 1;\n }\n // message: do not have all displayed text available so only passing placeholder.\n this._exit(exitCode, 'commander.help', '(outputHelp)');\n }\n\n /**\n * // Do a little typing to coordinate emit and listener for the help text events.\n * @typedef HelpTextEventContext\n * @type {object}\n * @property {boolean} error\n * @property {Command} command\n * @property {function} write\n */\n\n /**\n * Add additional text to be displayed with the built-in help.\n *\n * Position is 'before' or 'after' to affect just this command,\n * and 'beforeAll' or 'afterAll' to affect this command and all its subcommands.\n *\n * @param {string} position - before or after built-in help\n * @param {(string | Function)} text - string to add, or a function returning a string\n * @return {Command} `this` command for chaining\n */\n\n addHelpText(position, text) {\n const allowedValues = ['beforeAll', 'before', 'after', 'afterAll'];\n if (!allowedValues.includes(position)) {\n throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${allowedValues.join(\"', '\")}'`);\n }\n\n const helpEvent = `${position}Help`;\n this.on(helpEvent, (/** @type {HelpTextEventContext} */ context) => {\n let helpStr;\n if (typeof text === 'function') {\n helpStr = text({ error: context.error, command: context.command });\n } else {\n helpStr = text;\n }\n // Ignore falsy value when nothing to output.\n if (helpStr) {\n context.write(`${helpStr}\\n`);\n }\n });\n return this;\n }\n\n /**\n * Output help information if help flags specified\n *\n * @param {Array} args - array of options to search for help flags\n * @private\n */\n\n _outputHelpIfRequested(args) {\n const helpOption = this._getHelpOption();\n const helpRequested = helpOption && args.find((arg) => helpOption.is(arg));\n if (helpRequested) {\n this.outputHelp();\n // (Do not have all displayed text available so only passing placeholder.)\n this._exit(0, 'commander.helpDisplayed', '(outputHelp)');\n }\n }\n}\n\n/**\n * Scan arguments and increment port number for inspect calls (to avoid conflicts when spawning new command).\n *\n * @param {string[]} args - array of arguments from node.execArgv\n * @returns {string[]}\n * @private\n */\n\nfunction incrementNodeInspectorPort(args) {\n // Testing for these options:\n // --inspect[=[host:]port]\n // --inspect-brk[=[host:]port]\n // --inspect-port=[host:]port\n return args.map((arg) => {\n if (!arg.startsWith('--inspect')) {\n return arg;\n }\n let debugOption;\n let debugHost = '127.0.0.1';\n let debugPort = '9229';\n let match;\n if ((match = arg.match(/^(--inspect(-brk)?)$/)) !== null) {\n // e.g. --inspect\n debugOption = match[1];\n } else if (\n (match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null\n ) {\n debugOption = match[1];\n if (/^\\d+$/.test(match[3])) {\n // e.g. --inspect=1234\n debugPort = match[3];\n } else {\n // e.g. --inspect=localhost\n debugHost = match[3];\n }\n } else if (\n (match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+):(\\d+)$/)) !== null\n ) {\n // e.g. --inspect=localhost:1234\n debugOption = match[1];\n debugHost = match[3];\n debugPort = match[4];\n }\n\n if (debugOption && debugPort !== '0') {\n return `${debugOption}=${debugHost}:${parseInt(debugPort) + 1}`;\n }\n return arg;\n });\n}\n\n/**\n * Exported for using from tests, not otherwise used outside this file.\n *\n * @returns {boolean | undefined}\n * @package\n */\nexport function useColor() {\n // Test for common conventions.\n // NB: the observed behaviour is in combination with how author adds color! For example:\n // - we do not test NODE_DISABLE_COLORS, but util:styletext does\n // - we do test NO_COLOR, but Chalk does not\n //\n // References:\n // https://no-color.org\n // https://bixense.com/clicolors/\n // https://github.com/nodejs/node/blob/0a00217a5f67ef4a22384cfc80eb6dd9a917fdc1/lib/internal/tty.js#L109\n // https://github.com/chalk/supports-color/blob/c214314a14bcb174b12b3014b2b0a8de375029ae/index.js#L33\n // (https://force-color.org recent web page from 2023, does not match major javascript implementations)\n\n if (\n process.env.NO_COLOR ||\n process.env.FORCE_COLOR === '0' ||\n process.env.FORCE_COLOR === 'false'\n )\n return false;\n if (process.env.FORCE_COLOR || process.env.CLICOLOR_FORCE !== undefined)\n return true;\n return undefined;\n}\n","import { Argument } from './lib/argument.js';\nimport { Command } from './lib/command.js';\nimport { CommanderError, InvalidArgumentError } from './lib/error.js';\nimport { Help } from './lib/help.js';\nimport { Option } from './lib/option.js';\n\nexport const program = new Command();\n\nexport const createCommand = (name) => new Command(name);\nexport const createOption = (flags, description) =>\n new Option(flags, description);\nexport const createArgument = (name, description) =>\n new Argument(name, description);\n\n/**\n * Expose classes\n */\n\nexport { Command, Option, Argument, Help };\nexport { CommanderError, InvalidArgumentError };\nexport { InvalidArgumentError as InvalidOptionArgumentError }; // Deprecated\n","/* MAIN */\nconst getCodePointsLength = (() => {\n const SURROGATE_PAIR_RE = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n return (input) => {\n let surrogatePairsNr = 0;\n SURROGATE_PAIR_RE.lastIndex = 0;\n while (SURROGATE_PAIR_RE.test(input)) {\n surrogatePairsNr += 1;\n }\n return input.length - surrogatePairsNr;\n };\n})();\nconst isFullWidth = (x) => {\n return x === 0x3000 || x >= 0xFF01 && x <= 0xFF60 || x >= 0xFFE0 && x <= 0xFFE6;\n};\nconst isWideNotCJKTNotEmoji = (x) => {\n return x === 0x231B || x === 0x2329 || x >= 0x2FF0 && x <= 0x2FFF || x >= 0x3001 && x <= 0x303E || x >= 0x3099 && x <= 0x30FF || x >= 0x3105 && x <= 0x312F || x >= 0x3131 && x <= 0x318E || x >= 0x3190 && x <= 0x31E3 || x >= 0x31EF && x <= 0x321E || x >= 0x3220 && x <= 0x3247 || x >= 0x3250 && x <= 0x4DBF || x >= 0xFE10 && x <= 0xFE19 || x >= 0xFE30 && x <= 0xFE52 || x >= 0xFE54 && x <= 0xFE66 || x >= 0xFE68 && x <= 0xFE6B || x >= 0x1F200 && x <= 0x1F202 || x >= 0x1F210 && x <= 0x1F23B || x >= 0x1F240 && x <= 0x1F248 || x >= 0x20000 && x <= 0x2FFFD || x >= 0x30000 && x <= 0x3FFFD;\n};\n/* EXPORT */\nexport { getCodePointsLength, isFullWidth, isWideNotCJKTNotEmoji };\n","/* IMPORT */\nimport { getCodePointsLength, isFullWidth, isWideNotCJKTNotEmoji } from './utils.js';\n/* HELPERS */\nconst ANSI_RE = /[\\u001b\\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\\u001b\\]8;[^;]*;.*?(?:\\u0007|\\u001b\\u005c)/y;\nconst CONTROL_RE = /[\\x00-\\x08\\x0A-\\x1F\\x7F-\\x9F]{1,1000}/y;\nconst CJKT_WIDE_RE = /(?:(?![\\uFF61-\\uFF9F\\uFF00-\\uFFEF])[\\p{Script=Han}\\p{Script=Hiragana}\\p{Script=Katakana}\\p{Script=Hangul}\\p{Script=Tangut}]){1,1000}/yu;\nconst TAB_RE = /\\t{1,1000}/y;\nconst EMOJI_RE = /[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*/yu;\nconst LATIN_RE = /(?:[\\x20-\\x7E\\xA0-\\xFF](?!\\uFE0F)){1,1000}/y;\nconst MODIFIER_RE = /\\p{M}+/gu;\nconst NO_TRUNCATION = { limit: Infinity, ellipsis: '' };\n/* MAIN */\nconst getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {}) => {\n /* CONSTANTS */\n const LIMIT = truncationOptions.limit ?? Infinity;\n const ELLIPSIS = truncationOptions.ellipsis ?? '';\n const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);\n const ANSI_WIDTH = 0;\n const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;\n const TAB_WIDTH = widthOptions.tabWidth ?? 8;\n const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;\n const FULL_WIDTH_WIDTH = 2;\n const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;\n const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;\n const PARSE_BLOCKS = [\n [LATIN_RE, REGULAR_WIDTH],\n [ANSI_RE, ANSI_WIDTH],\n [CONTROL_RE, CONTROL_WIDTH],\n [TAB_RE, TAB_WIDTH],\n [EMOJI_RE, EMOJI_WIDTH],\n [CJKT_WIDE_RE, WIDE_WIDTH],\n ];\n /* STATE */\n let indexPrev = 0;\n let index = 0;\n let length = input.length;\n let lengthExtra = 0;\n let truncationEnabled = false;\n let truncationIndex = length;\n let truncationLimit = Math.max(0, LIMIT - ELLIPSIS_WIDTH);\n let unmatchedStart = 0;\n let unmatchedEnd = 0;\n let width = 0;\n let widthExtra = 0;\n /* PARSE LOOP */\n outer: while (true) {\n /* UNMATCHED */\n if ((unmatchedEnd > unmatchedStart) || (index >= length && index > indexPrev)) {\n const unmatched = input.slice(unmatchedStart, unmatchedEnd) || input.slice(indexPrev, index);\n lengthExtra = 0;\n for (const char of unmatched.replaceAll(MODIFIER_RE, '')) {\n const codePoint = char.codePointAt(0) || 0;\n if (isFullWidth(codePoint)) {\n widthExtra = FULL_WIDTH_WIDTH;\n }\n else if (isWideNotCJKTNotEmoji(codePoint)) {\n widthExtra = WIDE_WIDTH;\n }\n else {\n widthExtra = REGULAR_WIDTH;\n }\n if ((width + widthExtra) > truncationLimit) {\n truncationIndex = Math.min(truncationIndex, Math.max(unmatchedStart, indexPrev) + lengthExtra);\n }\n if ((width + widthExtra) > LIMIT) {\n truncationEnabled = true;\n break outer;\n }\n lengthExtra += char.length;\n width += widthExtra;\n }\n unmatchedStart = unmatchedEnd = 0;\n }\n /* EXITING */\n if (index >= length) {\n break outer;\n }\n /* PARSE BLOCKS */\n for (let i = 0, l = PARSE_BLOCKS.length; i < l; i++) {\n const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i];\n BLOCK_RE.lastIndex = index;\n if (BLOCK_RE.test(input)) {\n lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index;\n widthExtra = lengthExtra * BLOCK_WIDTH;\n if ((width + widthExtra) > truncationLimit) {\n truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));\n }\n if ((width + widthExtra) > LIMIT) {\n truncationEnabled = true;\n break outer;\n }\n width += widthExtra;\n unmatchedStart = indexPrev;\n unmatchedEnd = index;\n index = indexPrev = BLOCK_RE.lastIndex;\n continue outer;\n }\n }\n /* UNMATCHED INDEX */\n index += 1;\n }\n /* RETURN */\n return {\n width: truncationEnabled ? truncationLimit : width,\n index: truncationEnabled ? truncationIndex : length,\n truncated: truncationEnabled,\n ellipsed: truncationEnabled && LIMIT >= ELLIPSIS_WIDTH\n };\n};\n/* EXPORT */\nexport default getStringTruncatedWidth;\n","/* IMPORT */\nimport fastStringTruncatedWidth from 'fast-string-truncated-width';\n/* HELPERS */\nconst NO_TRUNCATION = {\n limit: Infinity,\n ellipsis: '',\n ellipsisWidth: 0,\n};\n/* MAIN */\nconst fastStringWidth = (input, options = {}) => {\n return fastStringTruncatedWidth(input, NO_TRUNCATION, options).width;\n};\n/* EXPORT */\nexport default fastStringWidth;\n","import stringWidth from 'fast-string-width';\nconst ESC = '\\x1B';\nconst CSI = '\\x9B';\nconst END_CODE = 39;\nconst ANSI_ESCAPE_BELL = '\\u0007';\nconst ANSI_CSI = '[';\nconst ANSI_OSC = ']';\nconst ANSI_SGR_TERMINATOR = 'm';\nconst ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;\nconst GROUP_REGEX = new RegExp(`(?:\\\\${ANSI_CSI}(?<code>\\\\d+)m|\\\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`, 'y');\nconst getClosingCode = (openingCode) => {\n if (openingCode >= 30 && openingCode <= 37)\n return 39;\n if (openingCode >= 90 && openingCode <= 97)\n return 39;\n if (openingCode >= 40 && openingCode <= 47)\n return 49;\n if (openingCode >= 100 && openingCode <= 107)\n return 49;\n if (openingCode === 1 || openingCode === 2)\n return 22;\n if (openingCode === 3)\n return 23;\n if (openingCode === 4)\n return 24;\n if (openingCode === 7)\n return 27;\n if (openingCode === 8)\n return 28;\n if (openingCode === 9)\n return 29;\n if (openingCode === 0)\n return 0;\n return undefined;\n};\nconst wrapAnsiCode = (code) => `${ESC}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;\nconst wrapAnsiHyperlink = (url) => `${ESC}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;\nconst wrapWord = (rows, word, columns) => {\n const characters = word[Symbol.iterator]();\n let isInsideEscape = false;\n let isInsideLinkEscape = false;\n let lastRow = rows.at(-1);\n let visible = lastRow === undefined ? 0 : stringWidth(lastRow);\n let currentCharacter = characters.next();\n let nextCharacter = characters.next();\n let rawCharacterIndex = 0;\n while (!currentCharacter.done) {\n const character = currentCharacter.value;\n const characterLength = stringWidth(character);\n if (visible + characterLength <= columns) {\n rows[rows.length - 1] += character;\n }\n else {\n rows.push(character);\n visible = 0;\n }\n if (character === ESC || character === CSI) {\n isInsideEscape = true;\n isInsideLinkEscape = word.startsWith(ANSI_ESCAPE_LINK, rawCharacterIndex + 1);\n }\n if (isInsideEscape) {\n if (isInsideLinkEscape) {\n if (character === ANSI_ESCAPE_BELL) {\n isInsideEscape = false;\n isInsideLinkEscape = false;\n }\n }\n else if (character === ANSI_SGR_TERMINATOR) {\n isInsideEscape = false;\n }\n }\n else {\n visible += characterLength;\n if (visible === columns && !nextCharacter.done) {\n rows.push('');\n visible = 0;\n }\n }\n currentCharacter = nextCharacter;\n nextCharacter = characters.next();\n rawCharacterIndex += character.length;\n }\n lastRow = rows.at(-1);\n if (!visible && lastRow !== undefined && lastRow.length && rows.length > 1) {\n rows[rows.length - 2] += rows.pop();\n }\n};\nconst stringVisibleTrimSpacesRight = (string) => {\n const words = string.split(' ');\n let last = words.length;\n while (last) {\n if (stringWidth(words[last - 1])) {\n break;\n }\n last--;\n }\n if (last === words.length) {\n return string;\n }\n return words.slice(0, last).join(' ') + words.slice(last).join('');\n};\nconst exec = (string, columns, options = {}) => {\n if (options.trim !== false && string.trim() === '') {\n return '';\n }\n let returnValue = '';\n let escapeCode;\n let escapeUrl;\n const words = string.split(' ');\n let rows = [''];\n let rowLength = 0;\n for (let index = 0; index < words.length; index++) {\n const word = words[index];\n if (options.trim !== false) {\n const row = rows.at(-1) ?? '';\n const trimmed = row.trimStart();\n if (row.length !== trimmed.length) {\n rows[rows.length - 1] = trimmed;\n rowLength = stringWidth(trimmed);\n }\n }\n if (index !== 0) {\n if (rowLength >= columns &&\n (options.wordWrap === false || options.trim === false)) {\n rows.push('');\n rowLength = 0;\n }\n if (rowLength || options.trim === false) {\n rows[rows.length - 1] += ' ';\n rowLength++;\n }\n }\n const wordLength = stringWidth(word);\n if (options.hard && wordLength > columns) {\n const remainingColumns = columns - rowLength;\n const breaksStartingThisLine = 1 + Math.floor((wordLength - remainingColumns - 1) / columns);\n const breaksStartingNextLine = Math.floor((wordLength - 1) / columns);\n if (breaksStartingNextLine < breaksStartingThisLine) {\n rows.push('');\n }\n wrapWord(rows, word, columns);\n rowLength = stringWidth(rows.at(-1) ?? '');\n continue;\n }\n if (rowLength + wordLength > columns && rowLength && wordLength) {\n if (options.wordWrap === false && rowLength < columns) {\n wrapWord(rows, word, columns);\n rowLength = stringWidth(rows.at(-1) ?? '');\n continue;\n }\n rows.push('');\n rowLength = 0;\n }\n if (rowLength + wordLength > columns && options.wordWrap === false) {\n wrapWord(rows, word, columns);\n rowLength = stringWidth(rows.at(-1) ?? '');\n continue;\n }\n rows[rows.length - 1] += word;\n rowLength += wordLength;\n }\n if (options.trim !== false) {\n rows = rows.map((row) => stringVisibleTrimSpacesRight(row));\n }\n const preString = rows.join('\\n');\n let inSurrogate = false;\n for (let i = 0; i < preString.length; i++) {\n const character = preString[i];\n returnValue += character;\n if (!inSurrogate) {\n inSurrogate = character >= '\\ud800' && character <= '\\udbff';\n if (inSurrogate) {\n continue;\n }\n }\n else {\n inSurrogate = false;\n }\n if (character === ESC || character === CSI) {\n GROUP_REGEX.lastIndex = i + 1;\n const groupsResult = GROUP_REGEX.exec(preString);\n const groups = groupsResult?.groups;\n if (groups?.code !== undefined) {\n const code = Number.parseFloat(groups.code);\n escapeCode = code === END_CODE ? undefined : code;\n }\n else if (groups?.uri !== undefined) {\n escapeUrl = groups.uri.length === 0 ? undefined : groups.uri;\n }\n }\n if (preString[i + 1] === '\\n') {\n if (escapeUrl) {\n returnValue += wrapAnsiHyperlink('');\n }\n const closingCode = escapeCode ? getClosingCode(escapeCode) : undefined;\n if (escapeCode && closingCode) {\n returnValue += wrapAnsiCode(closingCode);\n }\n }\n else if (character === '\\n') {\n if (escapeCode && getClosingCode(escapeCode)) {\n returnValue += wrapAnsiCode(escapeCode);\n }\n if (escapeUrl) {\n returnValue += wrapAnsiHyperlink(escapeUrl);\n }\n }\n }\n return returnValue;\n};\nconst CRLF_OR_LF = /\\r?\\n/;\nexport function wrapAnsi(string, columns, options) {\n return String(string)\n .normalize()\n .split(CRLF_OR_LF)\n .map((line) => exec(line, columns, options))\n .join('\\n');\n}\n","'use strict';\n\nconst ESC = '\\x1B';\nconst CSI = `${ESC}[`;\nconst beep = '\\u0007';\n\nconst cursor = {\n to(x, y) {\n if (!y) return `${CSI}${x + 1}G`;\n return `${CSI}${y + 1};${x + 1}H`;\n },\n move(x, y) {\n let ret = '';\n\n if (x < 0) ret += `${CSI}${-x}D`;\n else if (x > 0) ret += `${CSI}${x}C`;\n\n if (y < 0) ret += `${CSI}${-y}A`;\n else if (y > 0) ret += `${CSI}${y}B`;\n\n return ret;\n },\n up: (count = 1) => `${CSI}${count}A`,\n down: (count = 1) => `${CSI}${count}B`,\n forward: (count = 1) => `${CSI}${count}C`,\n backward: (count = 1) => `${CSI}${count}D`,\n nextLine: (count = 1) => `${CSI}E`.repeat(count),\n prevLine: (count = 1) => `${CSI}F`.repeat(count),\n left: `${CSI}G`,\n hide: `${CSI}?25l`,\n show: `${CSI}?25h`,\n save: `${ESC}7`,\n restore: `${ESC}8`\n}\n\nconst scroll = {\n up: (count = 1) => `${CSI}S`.repeat(count),\n down: (count = 1) => `${CSI}T`.repeat(count)\n}\n\nconst erase = {\n screen: `${CSI}2J`,\n up: (count = 1) => `${CSI}1J`.repeat(count),\n down: (count = 1) => `${CSI}J`.repeat(count),\n line: `${CSI}2K`,\n lineEnd: `${CSI}K`,\n lineStart: `${CSI}1K`,\n lines(count) {\n let clear = '';\n for (let i = 0; i < count; i++)\n clear += this.line + (i < count - 1 ? cursor.up() : '');\n if (count)\n clear += cursor.left;\n return clear;\n }\n}\n\nmodule.exports = { cursor, scroll, erase, beep };\n","import { styleText } from 'node:util';\nimport { stdout, stdin } from 'node:process';\nimport * as l from 'node:readline';\nimport l__default from 'node:readline';\nimport { wrapAnsi } from 'fast-wrap-ansi';\nimport { cursor, erase } from 'sisteransi';\nimport { ReadStream } from 'node:tty';\n\nfunction findCursor(s, o, l) {\n if (!l.some((r) => !r.disabled))\n return s;\n const t = s + o, n = Math.max(l.length - 1, 0), e = t < 0 ? n : t > n ? 0 : t;\n return l[e]?.disabled ? findCursor(e, o < 0 ? -1 : 1, l) : e;\n}\nfunction findTextCursor(s, o, l, i) {\n const t = i.split(`\n`);\n let n = 0, e = s;\n for (const r of t) {\n if (e <= r.length)\n break;\n e -= r.length + 1, n++;\n }\n for (n = Math.max(0, Math.min(t.length - 1, n + l)), e = Math.min(e, t[n].length) + o; e < 0 && n > 0; )\n n--, e += t[n].length + 1;\n for (; e > t[n].length && n < t.length - 1; )\n e -= t[n].length + 1, n++;\n e = Math.max(0, Math.min(t[n].length, e));\n let h = 0;\n for (let r = 0; r < n; r++)\n h += t[r].length + 1;\n return h + e;\n}\n\nconst a$1 = [\"up\", \"down\", \"left\", \"right\", \"space\", \"enter\", \"cancel\"], t = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\"\n];\nconst settings = {\n actions: new Set(a$1),\n aliases: /* @__PURE__ */ new Map([\n // vim support\n [\"k\", \"up\"],\n [\"j\", \"down\"],\n [\"h\", \"left\"],\n [\"l\", \"right\"],\n [\"\u0003\", \"cancel\"],\n // opinionated defaults!\n [\"escape\", \"cancel\"]\n ]),\n messages: {\n cancel: \"Canceled\",\n error: \"Something went wrong\"\n },\n withGuide: true,\n date: {\n monthNames: [...t],\n messages: {\n required: \"Please enter a valid date\",\n invalidMonth: \"There are only 12 months in a year\",\n invalidDay: (n, e) => `There are only ${n} days in ${e}`,\n afterMin: (n) => `Date must be on or after ${n.toISOString().slice(0, 10)}`,\n beforeMax: (n) => `Date must be on or before ${n.toISOString().slice(0, 10)}`\n }\n }\n};\nfunction updateSettings(n) {\n if (n.aliases !== void 0) {\n const e = n.aliases;\n for (const s in e) {\n if (!Object.hasOwn(e, s)) continue;\n const i = e[s];\n i === void 0 || !settings.actions.has(i) || settings.aliases.has(s) || settings.aliases.set(s, i);\n }\n }\n if (n.messages !== void 0) {\n const e = n.messages;\n e.cancel !== void 0 && (settings.messages.cancel = e.cancel), e.error !== void 0 && (settings.messages.error = e.error);\n }\n if (n.withGuide !== void 0 && (settings.withGuide = n.withGuide !== false), n.date !== void 0) {\n const e = n.date;\n e.monthNames !== void 0 && (settings.date.monthNames = [...e.monthNames]), e.messages !== void 0 && (e.messages.required !== void 0 && (settings.date.messages.required = e.messages.required), e.messages.invalidMonth !== void 0 && (settings.date.messages.invalidMonth = e.messages.invalidMonth), e.messages.invalidDay !== void 0 && (settings.date.messages.invalidDay = e.messages.invalidDay), e.messages.afterMin !== void 0 && (settings.date.messages.afterMin = e.messages.afterMin), e.messages.beforeMax !== void 0 && (settings.date.messages.beforeMax = e.messages.beforeMax));\n }\n}\nfunction isActionKey(n, e) {\n if (typeof n == \"string\")\n return settings.aliases.get(n) === e;\n for (const s of n)\n if (s !== void 0 && isActionKey(s, e))\n return true;\n return false;\n}\n\nfunction diffLines(i, s) {\n if (i === s) return;\n const e = i.split(`\n`), t = s.split(`\n`), r = Math.max(e.length, t.length), f = [];\n for (let n = 0; n < r; n++)\n e[n] !== t[n] && f.push(n);\n return {\n lines: f,\n numLinesBefore: e.length,\n numLinesAfter: t.length,\n numLines: r\n };\n}\n\nconst R = globalThis.process.platform.startsWith(\"win\");\nconst CANCEL_SYMBOL = Symbol(\"clack:cancel\");\nfunction isCancel(e) {\n return e === CANCEL_SYMBOL;\n}\nfunction setRawMode(e, r) {\n const o = e;\n o.isTTY && o.setRawMode(r);\n}\nfunction block({\n input: e = stdin,\n output: r = stdout,\n overwrite: o = true,\n hideCursor: t = true\n} = {}) {\n const s = l.createInterface({\n input: e,\n output: r,\n prompt: \"\",\n tabSize: 1\n });\n l.emitKeypressEvents(e, s), e instanceof ReadStream && e.isTTY && e.setRawMode(true);\n const n = (f, { name: a, sequence: p }) => {\n const c = String(f);\n if (isActionKey([c, a, p], \"cancel\")) {\n t && r.write(cursor.show), process.exit(0);\n return;\n }\n if (!o) return;\n const i = a === \"return\" ? 0 : -1, m = a === \"return\" ? -1 : 0;\n l.moveCursor(r, i, m, () => {\n l.clearLine(r, 1, () => {\n e.once(\"keypress\", n);\n });\n });\n };\n return t && r.write(cursor.hide), e.once(\"keypress\", n), () => {\n e.off(\"keypress\", n), t && r.write(cursor.show), e instanceof ReadStream && e.isTTY && !R && e.setRawMode(false), s.terminal = false, s.close();\n };\n}\nconst getColumns = (e) => \"columns\" in e && typeof e.columns == \"number\" ? e.columns : 80, getRows = (e) => \"rows\" in e && typeof e.rows == \"number\" ? e.rows : 20;\nfunction wrapTextWithPrefix(e, r, o, t = o, s = o, n) {\n const f = getColumns(e ?? stdout);\n return wrapAnsi(r, f - o.length, {\n hard: true,\n trim: false\n }).split(`\n`).map((c, i, m) => {\n const d = n ? n(c, i) : c;\n return i === 0 ? `${t}${d}` : i === m.length - 1 ? `${s}${d}` : `${o}${d}`;\n }).join(`\n`);\n}\n\nfunction runValidation(e, n) {\n if (\"~standard\" in e) {\n const a = e[\"~standard\"].validate(n);\n if (a instanceof Promise)\n throw new TypeError(\n \"Schema validation must be synchronous. Update `validate()` and remove any asynchronous logic.\"\n );\n return a.issues?.at(0)?.message;\n }\n return e(n);\n}\n\nclass V {\n input;\n output;\n _abortSignal;\n rl;\n opts;\n _render;\n _track = false;\n _prevFrame = \"\";\n _subscribers = /* @__PURE__ */ new Map();\n _cursor = 0;\n state = \"initial\";\n error = \"\";\n value;\n userInput = \"\";\n constructor(t, e = true) {\n const { input: i = stdin, output: n = stdout, render: s, signal: r, ...o } = t;\n this.opts = o, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = s.bind(this), this._track = e, this._abortSignal = r, this.input = i, this.output = n;\n }\n /**\n * Unsubscribe all listeners\n */\n unsubscribe() {\n this._subscribers.clear();\n }\n /**\n * Set a subscriber with opts\n * @param event - The event name\n */\n setSubscriber(t, e) {\n const i = this._subscribers.get(t) ?? [];\n i.push(e), this._subscribers.set(t, i);\n }\n /**\n * Subscribe to an event\n * @param event - The event name\n * @param cb - The callback\n */\n on(t, e) {\n this.setSubscriber(t, { cb: e });\n }\n /**\n * Subscribe to an event once\n * @param event - The event name\n * @param cb - The callback\n */\n once(t, e) {\n this.setSubscriber(t, { cb: e, once: true });\n }\n /**\n * Emit an event with data\n * @param event - The event name\n * @param data - The data to pass to the callback\n */\n emit(t, ...e) {\n const i = this._subscribers.get(t) ?? [], n = [];\n for (const s of i)\n s.cb(...e), s.once && n.push(() => i.splice(i.indexOf(s), 1));\n for (const s of n)\n s();\n }\n prompt() {\n return new Promise((t) => {\n if (this._abortSignal) {\n if (this._abortSignal.aborted)\n return this.state = \"cancel\", this.close(), t(CANCEL_SYMBOL);\n this._abortSignal.addEventListener(\n \"abort\",\n () => {\n this.state = \"cancel\", this.close();\n },\n { once: true }\n );\n }\n this.rl = l__default.createInterface({\n input: this.input,\n tabSize: 2,\n prompt: \"\",\n escapeCodeTimeout: 50,\n terminal: true\n }), this.rl.prompt(), this.opts.initialUserInput !== void 0 && this._setUserInput(this.opts.initialUserInput, true), this.input.on(\"keypress\", this.onKeypress), setRawMode(this.input, true), this.output.on(\"resize\", this.render), this.render(), this.once(\"submit\", () => {\n this.output.write(cursor.show), this.output.off(\"resize\", this.render), setRawMode(this.input, false), t(this.value);\n }), this.once(\"cancel\", () => {\n this.output.write(cursor.show), this.output.off(\"resize\", this.render), setRawMode(this.input, false), t(CANCEL_SYMBOL);\n });\n });\n }\n _isActionKey(t, e) {\n return t === \"\t\";\n }\n _shouldSubmit(t, e) {\n return true;\n }\n _setValue(t) {\n this.value = t, this.emit(\"value\", this.value);\n }\n _setUserInput(t, e) {\n this.userInput = t ?? \"\", this.emit(\"userInput\", this.userInput), e && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);\n }\n _clearUserInput() {\n this.rl?.write(null, { ctrl: true, name: \"u\" }), this._setUserInput(\"\");\n }\n onKeypress(t, e) {\n if (this._track && e.name !== \"return\" && (e.name && this._isActionKey(t, e) && this.rl?.write(null, { ctrl: true, name: \"h\" }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === \"error\" && (this.state = \"active\"), e?.name && (!this._track && settings.aliases.has(e.name) && this.emit(\"cursor\", settings.aliases.get(e.name)), settings.actions.has(e.name) && this.emit(\"cursor\", e.name)), t && (t.toLowerCase() === \"y\" || t.toLowerCase() === \"n\") && this.emit(\"confirm\", t.toLowerCase() === \"y\"), this.emit(\"key\", t, e), e?.name === \"return\" && this._shouldSubmit(t, e)) {\n if (this.opts.validate) {\n const i = runValidation(this.opts.validate, this.value);\n i && (this.error = i instanceof Error ? i.message : i, this.state = \"error\", this.rl?.write(this.userInput));\n }\n this.state !== \"error\" && (this.state = \"submit\");\n }\n isActionKey([t, e?.name, e?.sequence], \"cancel\") && (this.state = \"cancel\"), (this.state === \"submit\" || this.state === \"cancel\") && this.emit(\"finalize\"), this.render(), (this.state === \"submit\" || this.state === \"cancel\") && this.close();\n }\n close() {\n this.input.unpipe(), this.input.removeListener(\"keypress\", this.onKeypress), this.output.write(`\n`), setRawMode(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();\n }\n restoreCursor() {\n const t = wrapAnsi(this._prevFrame, process.stdout.columns, { hard: true, trim: false }).split(`\n`).length - 1;\n this.output.write(cursor.move(-999, t * -1));\n }\n render() {\n const t = wrapAnsi(this._render(this) ?? \"\", process.stdout.columns, {\n hard: true,\n trim: false\n });\n if (t !== this._prevFrame) {\n if (this.state === \"initial\")\n this.output.write(cursor.hide);\n else {\n const e = diffLines(this._prevFrame, t), i = getRows(this.output);\n if (this.restoreCursor(), e) {\n const n = Math.max(0, e.numLinesAfter - i), s = Math.max(0, e.numLinesBefore - i);\n let r = e.lines.find((o) => o >= n);\n if (r === void 0) {\n this._prevFrame = t;\n return;\n }\n if (e.lines.length === 1) {\n this.output.write(cursor.move(0, r - s)), this.output.write(erase.lines(1));\n const o = t.split(`\n`);\n this.output.write(o[r]), this._prevFrame = t, this.output.write(cursor.move(0, o.length - r - 1));\n return;\n } else if (e.lines.length > 1) {\n if (n < s)\n r = n;\n else {\n const h = r - s;\n h > 0 && this.output.write(cursor.move(0, h));\n }\n this.output.write(erase.down());\n const f = t.split(`\n`).slice(r);\n this.output.write(f.join(`\n`)), this._prevFrame = t;\n return;\n }\n }\n this.output.write(erase.down());\n }\n this.output.write(t), this.state === \"initial\" && (this.state = \"active\"), this._prevFrame = t;\n }\n }\n}\n\nfunction p$1(l, e) {\n if (l === void 0 || e.length === 0)\n return 0;\n const i = e.findIndex((s) => s.value === l);\n return i !== -1 ? i : 0;\n}\nfunction g(l, e) {\n return (e.label ?? String(e.value)).toLowerCase().includes(l.toLowerCase());\n}\nfunction m(l, e) {\n if (e)\n return l ? e : e[0];\n}\nlet T$1 = class T extends V {\n filteredOptions;\n multiple;\n isNavigating = false;\n selectedValues = [];\n focusedValue;\n #e = 0;\n #s = \"\";\n #t;\n #i;\n #n;\n get cursor() {\n return this.#e;\n }\n get userInputWithCursor() {\n if (!this.userInput)\n return styleText([\"inverse\", \"hidden\"], \"_\");\n if (this._cursor >= this.userInput.length)\n return `${this.userInput}\\u2588`;\n const e = this.userInput.slice(0, this.cursor), t = this.userInput.slice(this.cursor, this.cursor + 1), i = this.userInput.slice(this.cursor + 1);\n return `${e}${styleText(\"inverse\", t)}${i}`;\n }\n get options() {\n return typeof this.#i == \"function\" ? this.#i() : this.#i;\n }\n constructor(e) {\n super(e), this.#i = e.options, this.#n = e.placeholder;\n const t = this.options;\n this.filteredOptions = [...t], this.multiple = e.multiple === true, this.#t = typeof e.options == \"function\" ? e.filter : e.filter ?? g;\n let i;\n if (e.initialValue && Array.isArray(e.initialValue) ? this.multiple ? i = e.initialValue : i = e.initialValue.slice(0, 1) : !this.multiple && this.options.length > 0 && (i = [this.options[0]?.value]), i)\n for (const s of i) {\n const n = t.findIndex((o) => o.value === s);\n n !== -1 && (this.toggleSelected(s), this.#e = n);\n }\n this.focusedValue = this.options[this.#e]?.value, this.on(\"key\", (s, n) => this.#l(s, n)), this.on(\"userInput\", (s) => this.#u(s));\n }\n _isActionKey(e, t) {\n return e === \"\t\" || this.multiple && this.isNavigating && t.name === \"space\" && e !== void 0 && e !== \"\";\n }\n #l(e, t) {\n const i = t.name === \"up\", s = t.name === \"down\", n = t.name === \"return\", o = this.userInput === \"\" || this.userInput === \"\t\", u = this.#n, a = this.options, f = u !== void 0 && u !== \"\" && a.some(\n (r) => !r.disabled && (this.#t ? this.#t(u, r) : true)\n );\n if (t.name === \"tab\" && o && f) {\n this.userInput === \"\t\" && this._clearUserInput(), this._setUserInput(u, true), this.isNavigating = false;\n return;\n }\n i || s ? (this.#e = findCursor(this.#e, i ? -1 : 1, this.filteredOptions), this.focusedValue = this.filteredOptions[this.#e]?.value, this.multiple || (this.selectedValues = [this.focusedValue]), this.isNavigating = true) : n ? this.value = m(this.multiple, this.selectedValues) : this.multiple ? this.focusedValue !== void 0 && (t.name === \"tab\" || this.isNavigating && t.name === \"space\") ? this.toggleSelected(this.focusedValue) : this.isNavigating = false : (this.focusedValue && (this.selectedValues = [this.focusedValue]), this.isNavigating = false);\n }\n deselectAll() {\n this.selectedValues = [];\n }\n toggleSelected(e) {\n this.filteredOptions.length !== 0 && (this.multiple ? this.selectedValues.includes(e) ? this.selectedValues = this.selectedValues.filter((t) => t !== e) : this.selectedValues = [...this.selectedValues, e] : this.selectedValues = [e]);\n }\n #u(e) {\n if (e !== this.#s) {\n this.#s = e;\n const t = this.options;\n e && this.#t ? this.filteredOptions = t.filter((n) => this.#t?.(e, n)) : this.filteredOptions = [...t];\n const i = p$1(this.focusedValue, this.filteredOptions);\n this.#e = findCursor(i, 0, this.filteredOptions);\n const s = this.filteredOptions[this.#e];\n s && !s.disabled ? this.focusedValue = s.value : this.focusedValue = void 0, this.multiple || (this.focusedValue !== void 0 ? this.toggleSelected(this.focusedValue) : this.deselectAll());\n }\n }\n};\n\nclass r extends V {\n get cursor() {\n return this.value ? 0 : 1;\n }\n get _value() {\n return this.cursor === 0;\n }\n constructor(t) {\n super(t, false), this.value = !!t.initialValue, this.on(\"userInput\", () => {\n this.value = this._value;\n }), this.on(\"confirm\", (i) => {\n this.output.write(cursor.move(0, -1)), this.value = i, this.state = \"submit\", this.close();\n }), this.on(\"cursor\", () => {\n this.value = !this.value;\n });\n }\n}\n\nconst _ = {\n Y: { type: \"year\", len: 4 },\n M: { type: \"month\", len: 2 },\n D: { type: \"day\", len: 2 }\n};\nfunction M(r) {\n return [...r].map((t) => _[t]);\n}\nfunction P(r) {\n const i = new Intl.DateTimeFormat(r, {\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\"\n }).formatToParts(new Date(2e3, 0, 15)), s = [];\n let n = \"/\";\n for (const e of i)\n e.type === \"literal\" ? n = e.value.trim() || e.value : (e.type === \"year\" || e.type === \"month\" || e.type === \"day\") && s.push({ type: e.type, len: e.type === \"year\" ? 4 : 2 });\n return { segments: s, separator: n };\n}\nfunction p(r) {\n return Number.parseInt((r || \"0\").replace(/_/g, \"0\"), 10) || 0;\n}\nfunction f(r) {\n return {\n year: p(r.year),\n month: p(r.month),\n day: p(r.day)\n };\n}\nfunction c(r, t) {\n return new Date(r || 2001, t || 1, 0).getDate();\n}\nfunction b(r) {\n const { year: t, month: i, day: s } = f(r);\n if (!t || t < 0 || t > 9999 || !i || i < 1 || i > 12 || !s || s < 1) return;\n const n = new Date(Date.UTC(t, i - 1, s));\n if (!(n.getUTCFullYear() !== t || n.getUTCMonth() !== i - 1 || n.getUTCDate() !== s))\n return { year: t, month: i, day: s };\n}\nfunction C(r) {\n const t = b(r);\n return t ? new Date(Date.UTC(t.year, t.month - 1, t.day)) : void 0;\n}\nfunction T(r, t, i, s) {\n const n = i ? {\n year: i.getUTCFullYear(),\n month: i.getUTCMonth() + 1,\n day: i.getUTCDate()\n } : null, e = s ? {\n year: s.getUTCFullYear(),\n month: s.getUTCMonth() + 1,\n day: s.getUTCDate()\n } : null;\n return r === \"year\" ? { min: n?.year ?? 1, max: e?.year ?? 9999 } : r === \"month\" ? {\n min: n && t.year === n.year ? n.month : 1,\n max: e && t.year === e.year ? e.month : 12\n } : {\n min: n && t.year === n.year && t.month === n.month ? n.day : 1,\n max: e && t.year === e.year && t.month === e.month ? e.day : c(t.year, t.month)\n };\n}\nclass U extends V {\n #i;\n #o;\n #t;\n #h;\n #u;\n #e = { segmentIndex: 0, positionInSegment: 0 };\n #n = true;\n #s = null;\n inlineError = \"\";\n get segmentCursor() {\n return { ...this.#e };\n }\n get segmentValues() {\n return { ...this.#t };\n }\n get segments() {\n return this.#i;\n }\n get separator() {\n return this.#o;\n }\n get formattedValue() {\n return this.#l(this.#t);\n }\n #l(t) {\n return this.#i.map((i) => t[i.type]).join(this.#o);\n }\n #r() {\n this._setUserInput(this.#l(this.#t)), this._setValue(C(this.#t) ?? void 0);\n }\n constructor(t) {\n const i = t.format ? { segments: M(t.format), separator: t.separator ?? \"/\" } : P(t.locale), s = t.separator ?? i.separator, n = t.format ? M(t.format) : i.segments, e = t.initialValue ?? t.defaultValue, m = e ? {\n year: String(e.getUTCFullYear()).padStart(4, \"0\"),\n month: String(e.getUTCMonth() + 1).padStart(2, \"0\"),\n day: String(e.getUTCDate()).padStart(2, \"0\")\n } : { year: \"____\", month: \"__\", day: \"__\" }, o = n.map((a) => m[a.type]).join(s);\n super({ ...t, initialUserInput: o }, false), this.#i = n, this.#o = s, this.#t = m, this.#h = t.minDate, this.#u = t.maxDate, this.#r(), this.on(\"cursor\", (a) => this.#f(a)), this.on(\"key\", (a, u) => this.#y(a, u)), this.on(\"finalize\", () => this.#p(t));\n }\n #a() {\n const t = Math.max(0, Math.min(this.#e.segmentIndex, this.#i.length - 1)), i = this.#i[t];\n if (i)\n return this.#e.positionInSegment = Math.max(\n 0,\n Math.min(this.#e.positionInSegment, i.len - 1)\n ), { segment: i, index: t };\n }\n #m(t) {\n this.inlineError = \"\", this.#s = null;\n const i = this.#a();\n i && (this.#e.segmentIndex = Math.max(\n 0,\n Math.min(this.#i.length - 1, i.index + t)\n ), this.#e.positionInSegment = 0, this.#n = true);\n }\n #d(t) {\n const i = this.#a();\n if (!i) return;\n const { segment: s } = i, n = this.#t[s.type], e = !n || n.replace(/_/g, \"\") === \"\", m = Number.parseInt((n || \"0\").replace(/_/g, \"0\"), 10) || 0, o = T(\n s.type,\n f(this.#t),\n this.#h,\n this.#u\n );\n let a;\n e ? a = t === 1 ? o.min : o.max : a = Math.max(Math.min(o.max, m + t), o.min), this.#t = {\n ...this.#t,\n [s.type]: a.toString().padStart(s.len, \"0\")\n }, this.#n = true, this.#s = null, this.#r();\n }\n #f(t) {\n if (t)\n switch (t) {\n case \"right\":\n return this.#m(1);\n case \"left\":\n return this.#m(-1);\n case \"up\":\n return this.#d(1);\n case \"down\":\n return this.#d(-1);\n }\n }\n #y(t, i) {\n if (i?.name === \"backspace\" || i?.sequence === \"\\x7F\" || i?.sequence === \"\\b\" || t === \"\\x7F\" || t === \"\\b\") {\n this.inlineError = \"\";\n const n = this.#a();\n if (!n) return;\n if (!this.#t[n.segment.type].replace(/_/g, \"\")) {\n this.#m(-1);\n return;\n }\n this.#t[n.segment.type] = \"_\".repeat(n.segment.len), this.#n = true, this.#e.positionInSegment = 0, this.#r();\n return;\n }\n if (i?.name === \"tab\") {\n this.inlineError = \"\";\n const n = this.#a();\n if (!n) return;\n const e = i.shift ? -1 : 1, m = n.index + e;\n m >= 0 && m < this.#i.length && (this.#e.segmentIndex = m, this.#e.positionInSegment = 0, this.#n = true);\n return;\n }\n if (t && /^[0-9]$/.test(t)) {\n const n = this.#a();\n if (!n) return;\n const { segment: e } = n, m = !this.#t[e.type].replace(/_/g, \"\");\n if (this.#n && this.#s !== null && !m) {\n const h = this.#s + t, d = { ...this.#t, [e.type]: h }, g = this.#g(d, e);\n if (g) {\n this.inlineError = g, this.#s = null, this.#n = false;\n return;\n }\n this.inlineError = \"\", this.#t[e.type] = h, this.#s = null, this.#n = false, this.#r(), n.index < this.#i.length - 1 && (this.#e.segmentIndex = n.index + 1, this.#e.positionInSegment = 0, this.#n = true);\n return;\n }\n this.#n && !m && (this.#t[e.type] = \"_\".repeat(e.len), this.#e.positionInSegment = 0), this.#n = false, this.#s = null;\n const o = this.#t[e.type], a = o.indexOf(\"_\"), u = a >= 0 ? a : Math.min(this.#e.positionInSegment, e.len - 1);\n if (u < 0 || u >= e.len) return;\n let l = o.slice(0, u) + t + o.slice(u + 1), D = false;\n if (u === 0 && o === \"__\" && (e.type === \"month\" || e.type === \"day\")) {\n const h = Number.parseInt(t, 10);\n l = `0${t}`, D = h <= (e.type === \"month\" ? 1 : 2);\n }\n if (e.type === \"year\" && (l = (o.replace(/_/g, \"\") + t).padStart(e.len, \"_\")), !l.includes(\"_\")) {\n const h = { ...this.#t, [e.type]: l }, d = this.#g(h, e);\n if (d) {\n this.inlineError = d;\n return;\n }\n }\n this.inlineError = \"\", this.#t[e.type] = l;\n const y = l.includes(\"_\") ? void 0 : b(this.#t);\n if (y) {\n const { year: h, month: d } = y, g = c(h, d);\n this.#t = {\n year: String(Math.max(0, Math.min(9999, h))).padStart(4, \"0\"),\n month: String(Math.max(1, Math.min(12, d))).padStart(2, \"0\"),\n day: String(Math.max(1, Math.min(g, y.day))).padStart(2, \"0\")\n };\n }\n this.#r();\n const S = l.indexOf(\"_\");\n D ? (this.#n = true, this.#s = t) : S >= 0 ? this.#e.positionInSegment = S : a >= 0 && n.index < this.#i.length - 1 ? (this.#e.segmentIndex = n.index + 1, this.#e.positionInSegment = 0, this.#n = true) : this.#e.positionInSegment = Math.min(u + 1, e.len - 1);\n }\n }\n #g(t, i) {\n const { month: s, day: n } = f(t);\n if (i.type === \"month\" && (s < 0 || s > 12))\n return settings.date.messages.invalidMonth;\n if (i.type === \"day\" && (n < 0 || n > 31))\n return settings.date.messages.invalidDay(31, \"any month\");\n }\n #p(t) {\n const { year: i, month: s, day: n } = f(this.#t);\n if (i && s && n) {\n const e = c(i, s);\n this.#t = {\n ...this.#t,\n day: String(Math.min(n, e)).padStart(2, \"0\")\n };\n }\n this.value = C(this.#t) ?? t.defaultValue ?? void 0;\n }\n}\n\nlet u$2 = class u extends V {\n options;\n cursor = 0;\n #t;\n getGroupItems(t) {\n return this.options.filter((r) => r.group === t);\n }\n isGroupSelected(t) {\n const r = this.getGroupItems(t), e = this.value;\n return e === void 0 ? false : r.every((s) => e.includes(s.value));\n }\n toggleValue() {\n const t = this.options[this.cursor];\n if (t !== void 0)\n if (this.value === void 0 && (this.value = []), t.group === true) {\n const r = t.value, e = this.getGroupItems(r);\n this.isGroupSelected(r) ? this.value = this.value.filter(\n (s) => e.findIndex((i) => i.value === s) === -1\n ) : this.value = [...this.value, ...e.map((s) => s.value)], this.value = Array.from(new Set(this.value));\n } else {\n const r = this.value.includes(t.value);\n this.value = r ? this.value.filter((e) => e !== t.value) : [...this.value, t.value];\n }\n }\n constructor(t) {\n super(t, false);\n const { options: r } = t;\n this.#t = t.selectableGroups !== false, this.options = Object.entries(r).flatMap(([e, s]) => [\n { value: e, group: true, label: e },\n ...s.map((i) => ({ ...i, group: e }))\n ]), this.value = [...t.initialValues ?? []], this.cursor = Math.max(\n this.options.findIndex(({ value: e }) => e === t.cursorAt),\n this.#t ? 0 : 1\n ), this.on(\"cursor\", (e) => {\n switch (e) {\n case \"left\":\n case \"up\": {\n this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;\n const s = this.options[this.cursor]?.group === true;\n !this.#t && s && (this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1);\n break;\n }\n case \"down\":\n case \"right\": {\n this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;\n const s = this.options[this.cursor]?.group === true;\n !this.#t && s && (this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1);\n break;\n }\n case \"space\":\n this.toggleValue();\n break;\n }\n });\n }\n};\n\nconst o = /* @__PURE__ */ new Set([\"up\", \"down\", \"left\", \"right\"]);\nclass h extends V {\n #t = false;\n #s;\n focused = \"editor\";\n get userInputWithCursor() {\n if (this.state === \"submit\")\n return this.userInput;\n const t = this.userInput;\n if (this.cursor >= t.length)\n return `${t}\\u2588`;\n const s = t.slice(0, this.cursor), r = t.slice(this.cursor, this.cursor + 1), i = t.slice(this.cursor + 1);\n return r === `\n` ? `${s}\\u2588\n${i}` : `${s}${styleText(\"inverse\", r)}${i}`;\n }\n get cursor() {\n return this._cursor;\n }\n #r(t) {\n if (this.userInput.length === 0) {\n this._setUserInput(t);\n return;\n }\n this._setUserInput(\n this.userInput.slice(0, this.cursor) + t + this.userInput.slice(this.cursor)\n );\n }\n #i(t) {\n const s = this.value ?? \"\";\n switch (t) {\n case \"up\":\n this._cursor = findTextCursor(this._cursor, 0, -1, s);\n return;\n case \"down\":\n this._cursor = findTextCursor(this._cursor, 0, 1, s);\n return;\n case \"left\":\n this._cursor = findTextCursor(this._cursor, -1, 0, s);\n return;\n case \"right\":\n this._cursor = findTextCursor(this._cursor, 1, 0, s);\n return;\n }\n }\n _shouldSubmit(t, s) {\n if (this.#s)\n return this.focused === \"submit\" ? true : (this.#r(`\n`), this._cursor++, false);\n const r = this.#t;\n return this.#t = true, r && this.cursor === this.userInput.length ? (this.userInput[this.cursor - 1] === `\n` && (this._setUserInput(\n this.userInput.slice(0, this.cursor - 1) + this.userInput.slice(this.cursor)\n ), this._cursor--), true) : (this.#r(`\n`), this._cursor++, false);\n }\n constructor(t) {\n const s = t.initialUserInput ?? t.initialValue;\n super(\n {\n ...t,\n initialUserInput: s\n },\n false\n ), s !== void 0 && (this._cursor = s.length), this.#s = t.showSubmit ?? false, this.on(\"key\", (r, i) => {\n if (i?.name && o.has(i.name)) {\n this.#t = false, this.#i(i.name);\n return;\n }\n if (r === \"\t\" && this.#s) {\n this.focused = this.focused === \"editor\" ? \"submit\" : \"editor\";\n return;\n }\n if (i?.name !== \"return\") {\n if (this.#t = false, i?.name === \"backspace\" && this.cursor > 0) {\n this._setUserInput(\n this.userInput.slice(0, this.cursor - 1) + this.userInput.slice(this.cursor)\n ), this._cursor--;\n return;\n }\n if (i?.name === \"delete\" && this.cursor < this.userInput.length) {\n this._setUserInput(\n this.userInput.slice(0, this.cursor) + this.userInput.slice(this.cursor + 1)\n );\n return;\n }\n r && (this.#s && this.focused === \"submit\" && (this.focused = \"editor\"), this.#r(r ?? \"\"), this._cursor++);\n }\n }), this.on(\"userInput\", (r) => {\n this._setValue(r);\n }), this.on(\"finalize\", () => {\n this.value || (this.value = t.defaultValue), this.value === void 0 && (this.value = \"\");\n });\n }\n}\n\nclass a extends V {\n options;\n cursor = 0;\n get _value() {\n return this.options[this.cursor]?.value;\n }\n get _enabledOptions() {\n return this.options.filter((e) => e.disabled !== true);\n }\n toggleAll() {\n const e = this._enabledOptions, i = this.value !== void 0 && this.value.length === e.length;\n this.value = i ? [] : e.map((t) => t.value);\n }\n toggleInvert() {\n const e = this.value;\n if (!e)\n return;\n const i = this._enabledOptions.filter((t) => !e.includes(t.value));\n this.value = i.map((t) => t.value);\n }\n toggleValue() {\n this.value === void 0 && (this.value = []);\n const e = this.value.includes(this._value);\n this.value = e ? this.value.filter((i) => i !== this._value) : [...this.value, this._value];\n }\n constructor(e) {\n super(e, false), this.options = e.options, this.value = [...e.initialValues ?? []];\n const i = Math.max(\n this.options.findIndex(({ value: t }) => t === e.cursorAt),\n 0\n );\n this.cursor = this.options[i]?.disabled ? findCursor(i, 1, this.options) : i, this.on(\"key\", (t, l) => {\n l.name === \"a\" && this.toggleAll(), l.name === \"i\" && this.toggleInvert();\n }), this.on(\"cursor\", (t) => {\n switch (t) {\n case \"left\":\n case \"up\":\n this.cursor = findCursor(this.cursor, -1, this.options);\n break;\n case \"down\":\n case \"right\":\n this.cursor = findCursor(this.cursor, 1, this.options);\n break;\n case \"space\":\n this.toggleValue();\n break;\n }\n });\n }\n}\n\nlet u$1 = class u extends V {\n _mask = \"\\u2022\";\n get cursor() {\n return this._cursor;\n }\n get masked() {\n return this.userInput.replaceAll(/./g, this._mask);\n }\n get userInputWithCursor() {\n if (this.state === \"submit\" || this.state === \"cancel\")\n return this.masked;\n const t = this.userInput;\n if (this.cursor >= t.length)\n return `${this.masked}${styleText([\"inverse\", \"hidden\"], \"_\")}`;\n const s = this.masked, r = s.slice(0, this.cursor), i = s.slice(this.cursor, this.cursor + 1), o = s.slice(this.cursor + 1);\n return `${r}${styleText(\"inverse\", i)}${o}`;\n }\n clear() {\n this._clearUserInput();\n }\n constructor({ mask: t, ...s }) {\n super(s), this._mask = t ?? \"\\u2022\", this.on(\"userInput\", (r) => {\n this._setValue(r);\n }), this.on(\"finalize\", () => {\n this.value === void 0 && (this.value = \"\");\n });\n }\n};\n\nlet n$1 = class n extends V {\n options;\n cursor = 0;\n get _selectedValue() {\n return this.options[this.cursor];\n }\n changeValue() {\n const e = this._selectedValue;\n this.value = e === void 0 ? void 0 : e.value;\n }\n constructor(e) {\n super(e, false), this.options = e.options;\n const o = this.options.findIndex(({ value: s }) => s === e.initialValue), t = o === -1 ? 0 : o;\n this.cursor = this.options[t]?.disabled ? findCursor(t, 1, this.options) : t, this.changeValue(), this.on(\"cursor\", (s) => {\n switch (s) {\n case \"left\":\n case \"up\":\n this.cursor = findCursor(this.cursor, -1, this.options);\n break;\n case \"down\":\n case \"right\":\n this.cursor = findCursor(this.cursor, 1, this.options);\n break;\n }\n this.changeValue();\n });\n }\n};\n\nclass u extends V {\n options;\n cursor = 0;\n constructor(t) {\n super(t, false), this.options = t.options;\n const s = t.caseSensitive === true, i = this.options.map(({ value: [e] }) => s ? e : e?.toLowerCase());\n this.cursor = Math.max(i.indexOf(t.initialValue), 0), this.on(\"key\", (e) => {\n if (!e)\n return;\n const o = s ? e : e.toLowerCase();\n if (!i.includes(o))\n return;\n const n = this.options.find(({ value: [r] }) => s ? r === o : r?.toLowerCase() === o);\n n && (this.value = n.value, this.state = \"submit\", this.emit(\"submit\"));\n });\n }\n}\n\nclass n extends V {\n get userInputWithCursor() {\n if (this.state === \"submit\")\n return this.userInput;\n const t = this.userInput;\n if (this.cursor >= t.length)\n return `${this.userInput}\\u2588`;\n const r = t.slice(0, this.cursor), s = t.slice(this.cursor, this.cursor + 1), e = t.slice(this.cursor + 1);\n return `${r}${styleText(\"inverse\", s)}${e}`;\n }\n get cursor() {\n return this._cursor;\n }\n constructor(t) {\n super({\n ...t,\n initialUserInput: t.initialUserInput ?? t.initialValue\n }), this.on(\"userInput\", (r) => {\n this._setValue(r);\n }), this.on(\"finalize\", () => {\n this.value || (this.value = t.defaultValue), this.value === void 0 && (this.value = \"\");\n });\n }\n}\n\nexport { T$1 as AutocompletePrompt, r as ConfirmPrompt, U as DatePrompt, u$2 as GroupMultiSelectPrompt, h as MultiLinePrompt, a as MultiSelectPrompt, u$1 as PasswordPrompt, V as Prompt, u as SelectKeyPrompt, n$1 as SelectPrompt, n as TextPrompt, block, getColumns, getRows, isCancel, runValidation, settings, updateSettings, wrapTextWithPrefix };\n","import { getColumns, getRows, AutocompletePrompt, settings, ConfirmPrompt, wrapTextWithPrefix, DatePrompt, runValidation, isCancel, MultiSelectPrompt, GroupMultiSelectPrompt, MultiLinePrompt, PasswordPrompt, block, SelectPrompt, SelectKeyPrompt, TextPrompt } from '@clack/core';\nexport { isCancel, settings, updateSettings } from '@clack/core';\nimport { styleText, stripVTControlCharacters } from 'node:util';\nimport process$1 from 'node:process';\nimport { wrapAnsi } from 'fast-wrap-ansi';\nimport l from 'fast-string-width';\nimport { existsSync, lstatSync, readdirSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { cursor, erase } from 'sisteransi';\n\nfunction isUnicodeSupported() {\n\tif (process$1.platform !== 'win32') {\n\t\treturn process$1.env.TERM !== 'linux'; // Linux console (kernel)\n\t}\n\n\treturn Boolean(process$1.env.CI)\n\t\t|| Boolean(process$1.env.WT_SESSION) // Windows Terminal\n\t\t|| Boolean(process$1.env.TERMINUS_SUBLIME) // Terminus (<0.2.27)\n\t\t|| process$1.env.ConEmuTask === '{cmd::Cmder}' // ConEmu and cmder\n\t\t|| process$1.env.TERM_PROGRAM === 'Terminus-Sublime'\n\t\t|| process$1.env.TERM_PROGRAM === 'vscode'\n\t\t|| process$1.env.TERM === 'xterm-256color'\n\t\t|| process$1.env.TERM === 'alacritty'\n\t\t|| process$1.env.TERMINAL_EMULATOR === 'JetBrains-JediTerm';\n}\n\nconst unicode = isUnicodeSupported(), isCI = () => process.env.CI === \"true\", isTTY = (o) => o.isTTY === true, unicodeOr = (o, e) => unicode ? o : e, S_STEP_ACTIVE = unicodeOr(\"\\u25C6\", \"*\"), S_STEP_CANCEL = unicodeOr(\"\\u25A0\", \"x\"), S_STEP_ERROR = unicodeOr(\"\\u25B2\", \"x\"), S_STEP_SUBMIT = unicodeOr(\"\\u25C7\", \"o\"), S_BAR_START = unicodeOr(\"\\u250C\", \"T\"), S_BAR = unicodeOr(\"\\u2502\", \"|\"), S_BAR_END = unicodeOr(\"\\u2514\", \"\\u2014\"), S_BAR_START_RIGHT = unicodeOr(\"\\u2510\", \"T\"), S_BAR_END_RIGHT = unicodeOr(\"\\u2518\", \"\\u2014\"), S_RADIO_ACTIVE = unicodeOr(\"\\u25CF\", \">\"), S_RADIO_INACTIVE = unicodeOr(\"\\u25CB\", \" \"), S_CHECKBOX_ACTIVE = unicodeOr(\"\\u25FB\", \"[\\u2022]\"), S_CHECKBOX_SELECTED = unicodeOr(\"\\u25FC\", \"[+]\"), S_CHECKBOX_INACTIVE = unicodeOr(\"\\u25FB\", \"[ ]\"), S_PASSWORD_MASK = unicodeOr(\"\\u25AA\", \"\\u2022\"), S_BAR_H = unicodeOr(\"\\u2500\", \"-\"), S_CORNER_TOP_RIGHT = unicodeOr(\"\\u256E\", \"+\"), S_CONNECT_LEFT = unicodeOr(\"\\u251C\", \"+\"), S_CORNER_BOTTOM_RIGHT = unicodeOr(\"\\u256F\", \"+\"), S_CORNER_BOTTOM_LEFT = unicodeOr(\"\\u2570\", \"+\"), S_CORNER_TOP_LEFT = unicodeOr(\"\\u256D\", \"+\"), S_INFO = unicodeOr(\"\\u25CF\", \"\\u2022\"), S_SUCCESS = unicodeOr(\"\\u25C6\", \"*\"), S_WARN = unicodeOr(\"\\u25B2\", \"!\"), S_ERROR = unicodeOr(\"\\u25A0\", \"x\"), symbol = (o) => {\n switch (o) {\n case \"initial\":\n case \"active\":\n return styleText(\"cyan\", S_STEP_ACTIVE);\n case \"cancel\":\n return styleText(\"red\", S_STEP_CANCEL);\n case \"error\":\n return styleText(\"yellow\", S_STEP_ERROR);\n case \"submit\":\n return styleText(\"green\", S_STEP_SUBMIT);\n }\n}, symbolBar = (o) => {\n switch (o) {\n case \"initial\":\n case \"active\":\n return styleText(\"cyan\", S_BAR);\n case \"cancel\":\n return styleText(\"red\", S_BAR);\n case \"error\":\n return styleText(\"yellow\", S_BAR);\n case \"submit\":\n return styleText(\"green\", S_BAR);\n }\n};\nfunction formatInstructionFooter(o, e) {\n const r = [`${e ? `${styleText(\"cyan\", S_BAR)} ` : \"\"}${o.join(\" \\u2022 \")}`];\n return e && r.push(styleText(\"cyan\", S_BAR_END)), r;\n}\n\nconst I = (l, e, w, p, b, C = false) => {\n let r = e, O = 0;\n if (C)\n for (let i = p - 1; i >= w; i--) {\n const m = l[i];\n if (m && (r -= m.length), O++, r <= b) break;\n }\n else\n for (let i = w; i < p; i++) {\n const m = l[i];\n if (m && (r -= m.length), O++, r <= b) break;\n }\n return { lineCount: r, removals: O };\n};\nconst limitOptions = ({\n cursor: l,\n options: e,\n style: w,\n output: p = process.stdout,\n maxItems: b = Number.POSITIVE_INFINITY,\n columnPadding: C = 0,\n rowPadding: r = 4\n}) => {\n const i = getColumns(p) - C, m = getRows(p), M = styleText(\"dim\", \"...\"), v = Math.max(m - r, 0), a = Math.max(Math.min(b, v), 5);\n let f = 0;\n l >= a - 3 && (f = Math.max(\n Math.min(l - a + 3, e.length - a),\n 0\n ));\n let d = a < e.length && f > 0, c = a < e.length && f + a < e.length;\n const W = Math.min(\n f + a,\n e.length\n ), s = [];\n let g = 0;\n d && g++, c && g++;\n const T = f + (d ? 1 : 0), y = W - (c ? 1 : 0);\n for (let t = T; t < y; t++) {\n const n = e[t], o = n ? w(n, t === l) : \"\", h = wrapAnsi(o, i, {\n hard: true,\n trim: false\n }).split(`\n`);\n s.push(h), g += h.length;\n }\n if (g > v) {\n let t = 0, n = 0, o = g;\n const h = l - T;\n let u = v;\n const L = () => I(s, o, 0, h, u), E = () => I(\n s,\n o,\n h + 1,\n s.length,\n u,\n true\n );\n d ? ({ lineCount: o, removals: t } = L(), o > u && (c || (u -= 1), { lineCount: o, removals: n } = E())) : (c || (u -= 1), { lineCount: o, removals: n } = E(), o > u && (u -= 1, { lineCount: o, removals: t } = L())), t > 0 && (d = true, s.splice(0, t)), n > 0 && (c = true, s.splice(s.length - n, n));\n }\n const x = [];\n d && x.push(M);\n for (const t of s)\n for (const n of t)\n x.push(n);\n return c && x.push(M), x;\n};\n\nfunction P(t) {\n return t.label ?? String(t.value ?? \"\");\n}\nfunction E(t, c) {\n if (!t)\n return true;\n const n = (c.label ?? String(c.value ?? \"\")).toLowerCase(), i = (c.hint ?? \"\").toLowerCase(), l = String(c.value).toLowerCase(), o = t.toLowerCase();\n return n.includes(o) || i.includes(o) || l.includes(o);\n}\nfunction N(t, c) {\n const n = [];\n for (const i of c)\n t.includes(i.value) && n.push(i);\n return n;\n}\nconst autocomplete = (t) => new AutocompletePrompt({\n options: t.options,\n initialValue: t.initialValue ? [t.initialValue] : void 0,\n initialUserInput: t.initialUserInput,\n placeholder: t.placeholder,\n filter: t.filter ?? ((n, i) => E(n, i)),\n signal: t.signal,\n input: t.input,\n output: t.output,\n validate: t.validate,\n render() {\n const n = t.withGuide ?? settings.withGuide, i = n ? [`${styleText(\"gray\", S_BAR)}`, `${symbol(this.state)} ${t.message}`] : [`${symbol(this.state)} ${t.message}`], l = this.userInput, o = this.options, m = t.placeholder, p = l === \"\" && m !== void 0, $ = (r, s) => {\n const a = P(r), u = r.hint && r.value === this.focusedValue ? styleText(\"dim\", ` (${r.hint})`) : \"\";\n switch (s) {\n case \"active\":\n return `${styleText(\"green\", S_RADIO_ACTIVE)} ${a}${u}`;\n case \"inactive\":\n return `${styleText(\"dim\", S_RADIO_INACTIVE)} ${styleText(\"dim\", a)}`;\n case \"disabled\":\n return `${styleText(\"gray\", S_RADIO_INACTIVE)} ${styleText([\"strikethrough\", \"gray\"], a)}`;\n }\n };\n switch (this.state) {\n case \"submit\": {\n const r = N(this.selectedValues, o), s = r.length > 0 ? ` ${styleText(\"dim\", r.map(P).join(\", \"))}` : \"\", a = n ? styleText(\"gray\", S_BAR) : \"\";\n return `${i.join(`\n`)}\n${a}${s}`;\n }\n case \"cancel\": {\n const r = l ? ` ${styleText([\"strikethrough\", \"dim\"], l)}` : \"\", s = n ? styleText(\"gray\", S_BAR) : \"\";\n return `${i.join(`\n`)}\n${s}${r}`;\n }\n default: {\n const r = this.state === \"error\" ? \"yellow\" : \"cyan\", s = n ? `${styleText(r, S_BAR)} ` : \"\", a = n ? styleText(r, S_BAR_END) : \"\";\n let u = \"\";\n if (this.isNavigating || p) {\n const d = p ? m : l;\n u = d !== \"\" ? ` ${styleText(\"dim\", d)}` : \"\";\n } else\n u = ` ${this.userInputWithCursor}`;\n const V = this.filteredOptions.length !== o.length ? styleText(\n \"dim\",\n ` (${this.filteredOptions.length} match${this.filteredOptions.length === 1 ? \"\" : \"es\"})`\n ) : \"\", y = this.filteredOptions.length === 0 && l ? [`${s}${styleText(\"yellow\", \"No matches found\")}`] : [], b = this.state === \"error\" ? [`${s}${styleText(\"yellow\", this.error)}`] : [];\n n && i.push(`${s.trimEnd()}`), i.push(\n `${s}${styleText(\"dim\", \"Search:\")}${u}${V}`,\n ...y,\n ...b\n );\n const v = [\n `${styleText(\"dim\", \"\\u2191/\\u2193\")} to select`,\n `${styleText(\"dim\", \"Enter:\")} confirm`,\n `${styleText(\"dim\", \"Type:\")} to search`\n ], g = [`${s}${v.join(\" \\u2022 \")}`, a], O = this.filteredOptions.length === 0 ? [] : limitOptions({\n cursor: this.cursor,\n options: this.filteredOptions,\n columnPadding: n ? 3 : 0,\n // for `| ` when guide is shown\n rowPadding: i.length + g.length,\n style: (d, f) => $(\n d,\n d.disabled ? \"disabled\" : f ? \"active\" : \"inactive\"\n ),\n maxItems: t.maxItems,\n output: t.output\n });\n return [\n ...i,\n ...O.map((d) => `${s}${d}`),\n ...g\n ].join(`\n`);\n }\n }\n }\n}).prompt(), autocompleteMultiselect = (t) => {\n const c = (i, l, o, m) => {\n const p = o.includes(i.value), $ = i.label ?? String(i.value ?? \"\"), r = i.hint && m !== void 0 && i.value === m ? styleText(\"dim\", ` (${i.hint})`) : \"\", s = p ? styleText(\"green\", S_CHECKBOX_SELECTED) : styleText(\"dim\", S_CHECKBOX_INACTIVE);\n return i.disabled ? `${styleText(\"gray\", S_CHECKBOX_INACTIVE)} ${styleText([\"strikethrough\", \"gray\"], $)}` : l ? `${s} ${$}${r}` : `${s} ${styleText(\"dim\", $)}`;\n }, n = new AutocompletePrompt({\n options: t.options,\n multiple: true,\n placeholder: t.placeholder,\n filter: t.filter ?? ((i, l) => E(i, l)),\n validate: () => {\n if (t.required && n.selectedValues.length === 0)\n return \"Please select at least one item\";\n },\n initialValue: t.initialValues,\n signal: t.signal,\n input: t.input,\n output: t.output,\n render() {\n const i = t.withGuide ?? settings.withGuide, l = `${i ? `${styleText(\"gray\", S_BAR)}\n` : \"\"}${symbol(this.state)} ${t.message}\n`, o = this.userInput, m = t.placeholder, p = o === \"\" && m !== void 0, $ = this.isNavigating || p ? styleText(\"dim\", p ? m : o) : this.userInputWithCursor, r = this.options, s = this.filteredOptions.length !== r.length ? styleText(\n \"dim\",\n ` (${this.filteredOptions.length} match${this.filteredOptions.length === 1 ? \"\" : \"es\"})`\n ) : \"\";\n switch (this.state) {\n case \"submit\":\n return `${l}${i ? `${styleText(\"gray\", S_BAR)} ` : \"\"}${styleText(\n \"dim\",\n `${this.selectedValues.length} items selected`\n )}`;\n case \"cancel\":\n return `${l}${i ? `${styleText(\"gray\", S_BAR)} ` : \"\"}${styleText(\n [\"strikethrough\", \"dim\"],\n o\n )}`;\n default: {\n const a = this.state === \"error\" ? \"yellow\" : \"cyan\", u = i ? `${styleText(a, S_BAR)} ` : \"\", V = i ? styleText(a, S_BAR_END) : \"\", y = [\n `${styleText(\"dim\", \"\\u2191/\\u2193\")} to navigate`,\n `${styleText(\"dim\", this.isNavigating ? \"Space/Tab:\" : \"Tab:\")} select`,\n `${styleText(\"dim\", \"Enter:\")} confirm`,\n `${styleText(\"dim\", \"Type:\")} to search`\n ], b = this.filteredOptions.length === 0 && o ? [`${u}${styleText(\"yellow\", \"No matches found\")}`] : [], v = this.state === \"error\" ? [`${u}${styleText(\"yellow\", this.error)}`] : [], g = [\n ...`${l}${i ? styleText(a, S_BAR) : \"\"}`.split(`\n`),\n `${u}${styleText(\"dim\", \"Search:\")} ${$}${s}`,\n ...b,\n ...v\n ], O = [`${u}${y.join(\" \\u2022 \")}`, V], d = limitOptions({\n cursor: this.cursor,\n options: this.filteredOptions,\n style: (f, _) => c(f, _, this.selectedValues, this.focusedValue),\n maxItems: t.maxItems,\n output: t.output,\n rowPadding: g.length + O.length\n });\n return [\n ...g,\n ...d.map((f) => `${u}${f}`),\n ...O\n ].join(`\n`);\n }\n }\n }\n });\n return n.prompt();\n};\n\nconst J = [\n S_CORNER_TOP_LEFT,\n S_CORNER_TOP_RIGHT,\n S_CORNER_BOTTOM_LEFT,\n S_CORNER_BOTTOM_RIGHT\n], K = [S_BAR_START, S_BAR_START_RIGHT, S_BAR_END, S_BAR_END_RIGHT];\nfunction A$1(n, e, t, o) {\n let i = t, f = t;\n return o === \"center\" ? i = Math.floor((e - n) / 2) : o === \"right\" && (i = e - n - t), f = e - i - n, [i, f];\n}\nconst Q = (n) => n;\nconst box = (n = \"\", e = \"\", t) => {\n const o = t?.output ?? process.stdout, i = getColumns(o), R = 1 * 2, u = t?.titlePadding ?? 1, h = t?.contentPadding ?? 2, w = t?.width === void 0 || t.width === \"auto\" ? 1 : Math.min(1, t.width), m = t?.withGuide ?? settings.withGuide ? `${S_BAR} ` : \"\", b = t?.formatBorder ?? Q, a = (t?.rounded ? J : K).map(b), _ = b(S_BAR_H), B = b(S_BAR), p = l(m), x = l(e), O = i - p;\n let r = Math.floor(i * w) - p;\n if (t?.width === \"auto\") {\n const c = n.split(`\n`);\n let s = x + u * 2;\n for (const G of c) {\n const P = l(G) + h * 2;\n P > s && (s = P);\n }\n const g = s + R;\n g < r && (r = g);\n }\n r % 2 !== 0 && (r < O ? r++ : r--);\n const d = r - R, S = d - u * 2, T = x > S ? `${e.slice(0, S - 3)}...` : e, [y, W] = A$1(\n l(T),\n d,\n u,\n t?.titleAlign\n ), L = wrapAnsi(n, d - h * 2, {\n hard: true,\n trim: false\n });\n o.write(\n `${m}${a[0]}${_.repeat(y)}${T}${_.repeat(W)}${a[1]}\n`\n );\n const E = L.split(`\n`);\n for (const c of E) {\n const [s, g] = A$1(\n l(c),\n d,\n h,\n t?.contentAlign\n );\n o.write(\n `${m}${B}${\" \".repeat(s)}${c}${\" \".repeat(g)}${B}\n`\n );\n }\n o.write(`${m}${a[2]}${_.repeat(d)}${a[3]}\n`);\n};\n\nconst confirm = (i) => {\n const a = i.active ?? \"Yes\", s = i.inactive ?? \"No\";\n return new ConfirmPrompt({\n active: a,\n inactive: s,\n signal: i.signal,\n input: i.input,\n output: i.output,\n initialValue: i.initialValue ?? true,\n render() {\n const e = i.withGuide ?? settings.withGuide, u = `${symbol(this.state)} `, l = e ? `${styleText(\"gray\", S_BAR)} ` : \"\", f = wrapTextWithPrefix(\n i.output,\n i.message,\n l,\n u\n ), o = `${e ? `${styleText(\"gray\", S_BAR)}\n` : \"\"}${f}\n`, c = this.value ? a : s;\n switch (this.state) {\n case \"submit\": {\n const r = e ? `${styleText(\"gray\", S_BAR)} ` : \"\";\n return `${o}${r}${styleText(\"dim\", c)}`;\n }\n case \"cancel\": {\n const r = e ? `${styleText(\"gray\", S_BAR)} ` : \"\";\n return `${o}${r}${styleText([\"strikethrough\", \"dim\"], c)}${e ? `\n${styleText(\"gray\", S_BAR)}` : \"\"}`;\n }\n default: {\n const r = e ? `${styleText(\"cyan\", S_BAR)} ` : \"\", g = e ? styleText(\"cyan\", S_BAR_END) : \"\";\n return `${o}${r}${this.value ? `${styleText(\"green\", S_RADIO_ACTIVE)} ${a}` : `${styleText(\"dim\", S_RADIO_INACTIVE)} ${styleText(\"dim\", a)}`}${i.vertical ? e ? `\n${styleText(\"cyan\", S_BAR)} ` : `\n` : ` ${styleText(\"dim\", \"/\")} `}${this.value ? `${styleText(\"dim\", S_RADIO_INACTIVE)} ${styleText(\"dim\", s)}` : `${styleText(\"green\", S_RADIO_ACTIVE)} ${s}`}\n${g}\n`;\n }\n }\n }\n }).prompt();\n};\n\nconst date = (e) => {\n const r = e.validate;\n return new DatePrompt({\n ...e,\n validate(t) {\n if (t === void 0)\n return e.defaultValue !== void 0 ? void 0 : r ? runValidation(r, t) : settings.date.messages.required;\n const o = (i) => i.toISOString().slice(0, 10);\n if (e.minDate && o(t) < o(e.minDate))\n return settings.date.messages.afterMin(e.minDate);\n if (e.maxDate && o(t) > o(e.maxDate))\n return settings.date.messages.beforeMax(e.maxDate);\n if (r) return runValidation(r, t);\n },\n render() {\n const t = (e?.withGuide ?? settings.withGuide) !== false, i = `${`${t ? `${styleText(\"gray\", S_BAR)}\n` : \"\"}${symbol(this.state)} `}${e.message}\n`, l = this.state !== \"initial\" ? this.state : \"active\", d = b(this, l), c = this.value instanceof Date ? this.formattedValue : \"\";\n switch (this.state) {\n case \"error\": {\n const a = this.error ? ` ${styleText(\"yellow\", this.error)}` : \"\", s = t ? `${styleText(\"yellow\", S_BAR)} ` : \"\", f = t ? styleText(\"yellow\", S_BAR_END) : \"\";\n return `${i.trim()}\n${s}${d}\n${f}${a}\n`;\n }\n case \"submit\": {\n const a = c ? ` ${styleText(\"dim\", c)}` : \"\", s = t ? styleText(\"gray\", S_BAR) : \"\";\n return `${i}${s}${a}`;\n }\n case \"cancel\": {\n const a = c ? ` ${styleText([\"strikethrough\", \"dim\"], c)}` : \"\", s = t ? styleText(\"gray\", S_BAR) : \"\";\n return `${i}${s}${a}${c.trim() ? `\n${s}` : \"\"}`;\n }\n default: {\n const a = t ? `${styleText(\"cyan\", S_BAR)} ` : \"\", s = t ? styleText(\"cyan\", S_BAR_END) : \"\", f = t ? `${styleText(\"cyan\", S_BAR)} ` : \"\", g = this.inlineError ? `\n${f}${styleText(\"yellow\", this.inlineError)}` : \"\";\n return `${i}${a}${d}${g}\n${s}\n`;\n }\n }\n }\n }).prompt();\n};\nfunction b(e, r) {\n const t = e.segmentValues, o = e.segmentCursor;\n if (r === \"submit\" || r === \"cancel\")\n return e.formattedValue;\n const i = styleText(\"gray\", e.separator);\n return e.segments.map((l, d) => {\n const c = d === o.segmentIndex && ![\"submit\", \"cancel\"].includes(r), a = p[l.type];\n return x(t[l.type], { isActive: c, label: a });\n }).join(i);\n}\nfunction x(e, r) {\n const t = !e || e.replace(/_/g, \"\") === \"\";\n return r.isActive ? styleText(\"inverse\", t ? r.label : e.replace(/_/g, \" \")) : t ? styleText(\"dim\", r.label) : e.replace(/_/g, styleText(\"dim\", \" \"));\n}\nconst p = {\n year: \"yyyy\",\n month: \"mm\",\n day: \"dd\"\n};\n\nconst group = async (o, r) => {\n const t = {}, p = Object.keys(o);\n for (const e of p) {\n const i = o[e], n = await i({ results: t })?.catch((a) => {\n throw a;\n });\n if (typeof r?.onCancel == \"function\" && isCancel(n)) {\n t[e] = \"canceled\", r.onCancel({ results: t });\n continue;\n }\n t[e] = n;\n }\n return t;\n};\n\nconst MULTISELECT_INSTRUCTIONS = [\n `${styleText(\"dim\", \"\\u2191/\\u2193\")} to navigate`,\n `${styleText(\"dim\", \"Space:\")} select`,\n `${styleText(\"dim\", \"Enter:\")} confirm`\n];\nconst m = (i, u) => i.split(`\n`).map((d) => u(d)).join(`\n`);\nconst multiselect = (i) => {\n const u = (t, a) => {\n const r = t.label ?? String(t.value);\n return a === \"disabled\" ? `${styleText(\"gray\", S_CHECKBOX_INACTIVE)} ${m(r, (o) => styleText([\"strikethrough\", \"gray\"], o))}${t.hint ? ` ${styleText(\"dim\", `(${t.hint ?? \"disabled\"})`)}` : \"\"}` : a === \"active\" ? `${styleText(\"cyan\", S_CHECKBOX_ACTIVE)} ${r}${t.hint ? ` ${styleText(\"dim\", `(${t.hint})`)}` : \"\"}` : a === \"selected\" ? `${styleText(\"green\", S_CHECKBOX_SELECTED)} ${m(r, (o) => styleText(\"dim\", o))}${t.hint ? ` ${styleText(\"dim\", `(${t.hint})`)}` : \"\"}` : a === \"cancelled\" ? `${m(r, (o) => styleText([\"strikethrough\", \"dim\"], o))}` : a === \"active-selected\" ? `${styleText(\"green\", S_CHECKBOX_SELECTED)} ${r}${t.hint ? ` ${styleText(\"dim\", `(${t.hint})`)}` : \"\"}` : a === \"submitted\" ? `${m(r, (o) => styleText(\"dim\", o))}` : `${styleText(\"dim\", S_CHECKBOX_INACTIVE)} ${m(r, (o) => styleText(\"dim\", o))}`;\n }, d = i.required ?? true, v = i.showInstructions ?? true;\n return new MultiSelectPrompt({\n options: i.options,\n signal: i.signal,\n input: i.input,\n output: i.output,\n initialValues: i.initialValues,\n required: d,\n cursorAt: i.cursorAt,\n validate(t) {\n if (d && (t === void 0 || t.length === 0))\n return `Please select at least one option.\n${styleText(\n \"reset\",\n styleText(\n \"dim\",\n `Press ${styleText([\"gray\", \"bgWhite\", \"inverse\"], \" space \")} to select, ${styleText(\n \"gray\",\n styleText(\"bgWhite\", styleText(\"inverse\", \" enter \"))\n )} to submit`\n )\n )}`;\n },\n render() {\n const t = i.withGuide ?? settings.withGuide, a = wrapTextWithPrefix(\n i.output,\n i.message,\n t ? `${symbolBar(this.state)} ` : \"\",\n `${symbol(this.state)} `\n ), r = `${t ? `${styleText(\"gray\", S_BAR)}\n` : \"\"}${a}\n`, o = this.value ?? [], p = (n, l) => {\n if (n.disabled)\n return u(n, \"disabled\");\n const s = o.includes(n.value);\n return l && s ? u(n, \"active-selected\") : s ? u(n, \"selected\") : u(n, l ? \"active\" : \"inactive\");\n };\n switch (this.state) {\n case \"submit\": {\n const n = this.options.filter(({ value: s }) => o.includes(s)).map((s) => u(s, \"submitted\")).join(styleText(\"dim\", \", \")) || styleText(\"dim\", \"none\"), l = wrapTextWithPrefix(\n i.output,\n n,\n t ? `${styleText(\"gray\", S_BAR)} ` : \"\"\n );\n return `${r}${l}`;\n }\n case \"cancel\": {\n const n = this.options.filter(({ value: s }) => o.includes(s)).map((s) => u(s, \"cancelled\")).join(styleText(\"dim\", \", \"));\n if (n.trim() === \"\")\n return `${r}${styleText(\"gray\", S_BAR)}`;\n const l = wrapTextWithPrefix(\n i.output,\n n,\n t ? `${styleText(\"gray\", S_BAR)} ` : \"\"\n );\n return `${r}${l}${t ? `\n${styleText(\"gray\", S_BAR)}` : \"\"}`;\n }\n case \"error\": {\n const n = t ? `${styleText(\"yellow\", S_BAR)} ` : \"\", l = this.error.split(`\n`).map(\n ($, C) => C === 0 ? `${t ? `${styleText(\"yellow\", S_BAR_END)} ` : \"\"}${styleText(\"yellow\", $)}` : ` ${$}`\n ).join(`\n`), s = r.split(`\n`).length, h = l.split(`\n`).length + 1;\n return `${r}${n}${limitOptions({\n output: i.output,\n options: this.options,\n cursor: this.cursor,\n maxItems: i.maxItems,\n columnPadding: n.length,\n rowPadding: s + h,\n style: p\n }).join(`\n${n}`)}\n${l}\n`;\n }\n default: {\n const n = t ? `${styleText(\"cyan\", S_BAR)} ` : \"\", l = r.split(`\n`).length, s = v ? formatInstructionFooter(MULTISELECT_INSTRUCTIONS, t) : t ? [styleText(\"cyan\", S_BAR_END)] : [], h = s.join(`\n`), $ = s.length + 1;\n return `${r}${n}${limitOptions({\n output: i.output,\n options: this.options,\n cursor: this.cursor,\n maxItems: i.maxItems,\n columnPadding: n.length,\n rowPadding: l + $,\n style: p\n }).join(`\n${n}`)}\n${h}\n`;\n }\n }\n }\n }).prompt();\n};\n\nconst groupMultiselect = (o) => {\n const { selectableGroups: h = true, groupSpacing: x = 0 } = o, m = (n, l, g = []) => {\n const a = n.label ?? String(n.value), t = typeof n.group == \"string\", s = t && (g[g.indexOf(n) + 1] ?? { group: true }), u = t && s && s.group === true;\n let r = \"\", c = \"\";\n t && (h ? (r = u ? `${S_BAR_END} ` : `${S_BAR} `, c = u ? \" \" : `${S_BAR} `) : r = \" \");\n let i = \"\";\n if (x > 0 && !t && (i = `\n`.repeat(x)), l === \"active\")\n return wrapTextWithPrefix(\n o.output,\n `${a}${n.hint ? ` ${styleText(\"dim\", `(${n.hint})`)}` : \"\"}`,\n `${i}${styleText(\"dim\", r)} `,\n `${i}${styleText(\"dim\", r)}${styleText(\"cyan\", S_CHECKBOX_ACTIVE)} `,\n `${i}${styleText(\"dim\", c)} `\n );\n if (l === \"group-active\")\n return wrapTextWithPrefix(\n o.output,\n a,\n `${i}${r} `,\n `${i}${r}${styleText(\"cyan\", S_CHECKBOX_ACTIVE)} `,\n `${i}${c} `,\n (d) => styleText(\"dim\", d)\n );\n if (l === \"group-active-selected\")\n return wrapTextWithPrefix(\n o.output,\n a,\n `${i}${r} `,\n `${i}${r}${styleText(\"green\", S_CHECKBOX_SELECTED)} `,\n `${i}${c} `,\n (d) => styleText(\"dim\", d)\n );\n if (l === \"selected\") {\n const d = t || h ? styleText(\"green\", S_CHECKBOX_SELECTED) : \"\";\n return wrapTextWithPrefix(\n o.output,\n `${a}${n.hint ? ` (${n.hint})` : \"\"}`,\n `${i}${styleText(\"dim\", r)} `,\n `${i}${styleText(\"dim\", r)}${d} `,\n `${i}${styleText(\"dim\", c)} `,\n (S) => styleText(\"dim\", S)\n );\n }\n if (l === \"cancelled\")\n return `${styleText([\"strikethrough\", \"dim\"], a)}`;\n if (l === \"active-selected\")\n return wrapTextWithPrefix(\n o.output,\n `${a}${n.hint ? ` ${styleText(\"dim\", `(${n.hint})`)}` : \"\"}`,\n `${i}${styleText(\"dim\", r)} `,\n `${i}${styleText(\"dim\", r)}${styleText(\"green\", S_CHECKBOX_SELECTED)} `,\n `${i}${styleText(\"dim\", c)} `\n );\n if (l === \"submitted\")\n return `${styleText(\"dim\", a)}`;\n const f = t || h ? styleText(\"dim\", S_CHECKBOX_INACTIVE) : \"\";\n return wrapTextWithPrefix(\n o.output,\n a,\n `${i}${styleText(\"dim\", r)} `,\n `${i}${styleText(\"dim\", r)}${f} `,\n `${i}${styleText(\"dim\", c)} `,\n (d) => styleText(\"dim\", d)\n );\n }, y = o.required ?? true, I = o.showInstructions ?? true;\n return new GroupMultiSelectPrompt({\n options: o.options,\n signal: o.signal,\n input: o.input,\n output: o.output,\n initialValues: o.initialValues,\n required: y,\n cursorAt: o.cursorAt,\n selectableGroups: h,\n validate(n) {\n if (y && (n === void 0 || n.length === 0))\n return `Please select at least one option.\n${styleText(\n \"reset\",\n styleText(\n \"dim\",\n `Press ${styleText([\"gray\", \"bgWhite\", \"inverse\"], \" space \")} to select, ${styleText(\n \"gray\",\n styleText([\"bgWhite\", \"inverse\"], \" enter \")\n )} to submit`\n )\n )}`;\n },\n render() {\n const n = o.withGuide ?? settings.withGuide, l = `${n ? `${styleText(\"gray\", S_BAR)}\n` : \"\"}${symbol(this.state)} ${o.message}\n`, g = this.value ?? [], a = (t, s) => {\n const u = this.options, r = g.includes(t.value) || t.group === true && this.isGroupSelected(`${t.value}`);\n return !s && typeof t.group == \"string\" && this.options[this.cursor]?.value === t.group ? m(t, r ? \"group-active-selected\" : \"group-active\", u) : s && r ? m(t, \"active-selected\", u) : r ? m(t, \"selected\", u) : m(t, s ? \"active\" : \"inactive\", u);\n };\n switch (this.state) {\n case \"submit\": {\n const t = this.options.filter(({ value: u }) => g.includes(u)).map((u) => m(u, \"submitted\")), s = t.length === 0 ? \"\" : ` ${t.join(styleText(\"dim\", \", \"))}`;\n return `${l}${n ? styleText(\"gray\", S_BAR) : \"\"}${s}`;\n }\n case \"cancel\": {\n const t = this.options.filter(({ value: s }) => g.includes(s)).map((s) => m(s, \"cancelled\")).join(styleText(\"dim\", \", \"));\n return `${l}${n ? `${styleText(\"gray\", S_BAR)} ` : \"\"}${t.trim() ? `${t}${n ? `\n${styleText(\"gray\", S_BAR)}` : \"\"}` : \"\"}`;\n }\n case \"error\": {\n const t = n ? `${styleText(\"yellow\", S_BAR)} ` : \"\", s = this.error.split(`\n`).map(\n (i, f) => f === 0 ? `${n ? `${styleText(\"yellow\", S_BAR_END)} ` : \"\"}${styleText(\"yellow\", i)}` : ` ${i}`\n ).join(`\n`), u = l.split(`\n`).length, r = s.split(`\n`).length + 1, c = limitOptions({\n output: o.output,\n options: this.options,\n cursor: this.cursor,\n maxItems: o.maxItems,\n columnPadding: t.length,\n rowPadding: u + r,\n style: a\n }).join(`\n${t}`);\n return `${l}${t}${c}\n${s}\n`;\n }\n default: {\n const t = n ? `${styleText(\"cyan\", S_BAR)} ` : \"\", s = l.split(`\n`).length, u = I ? formatInstructionFooter(MULTISELECT_INSTRUCTIONS, n) : n ? [styleText(\"cyan\", S_BAR_END)] : [], r = u.join(`\n`), c = u.length + 1, i = limitOptions({\n output: o.output,\n options: this.options,\n cursor: this.cursor,\n maxItems: o.maxItems,\n columnPadding: t.length,\n rowPadding: s + c,\n style: a\n }).join(`\n${t}`);\n return `${l}${t}${i}\n${r}\n`;\n }\n }\n }\n }).prompt();\n};\n\nconst log = {\n message: (s = [], {\n symbol: e = styleText(\"gray\", S_BAR),\n secondarySymbol: r = styleText(\"gray\", S_BAR),\n output: m = process.stdout,\n spacing: l = 1,\n withGuide: c\n } = {}) => {\n const t = [], o = c ?? settings.withGuide, f = o ? r : \"\", O = o ? `${e} ` : \"\", u = o ? `${r} ` : \"\";\n for (let i = 0; i < l; i++)\n t.push(f);\n const g = Array.isArray(s) ? s : s.split(`\n`);\n if (g.length > 0) {\n const [i, ...y] = g;\n i.length > 0 ? t.push(`${O}${i}`) : t.push(o ? e : \"\");\n for (const p of y)\n p.length > 0 ? t.push(`${u}${p}`) : t.push(o ? r : \"\");\n }\n m.write(`${t.join(`\n`)}\n`);\n },\n info: (s, e) => {\n log.message(s, { ...e, symbol: styleText(\"blue\", S_INFO) });\n },\n success: (s, e) => {\n log.message(s, { ...e, symbol: styleText(\"green\", S_SUCCESS) });\n },\n step: (s, e) => {\n log.message(s, { ...e, symbol: styleText(\"green\", S_STEP_SUBMIT) });\n },\n warn: (s, e) => {\n log.message(s, { ...e, symbol: styleText(\"yellow\", S_WARN) });\n },\n /** alias for `log.warn()`. */\n warning: (s, e) => {\n log.warn(s, e);\n },\n error: (s, e) => {\n log.message(s, { ...e, symbol: styleText(\"red\", S_ERROR) });\n }\n};\n\nconst cancel = (o = \"\", t) => {\n const i = t?.output ?? process.stdout, e = t?.withGuide ?? settings.withGuide ? `${styleText(\"gray\", S_BAR_END)} ` : \"\";\n i.write(`${e}${styleText(\"red\", o)}\n\n`);\n}, intro = (o = \"\", t) => {\n const i = t?.output ?? process.stdout, e = t?.withGuide ?? settings.withGuide ? `${styleText(\"gray\", S_BAR_START)} ` : \"\";\n i.write(`${e}${o}\n`);\n}, outro = (o = \"\", t) => {\n const i = t?.output ?? process.stdout, e = t?.withGuide ?? settings.withGuide ? `${styleText(\"gray\", S_BAR)}\n${styleText(\"gray\", S_BAR_END)} ` : \"\";\n i.write(`${e}${o}\n\n`);\n};\n\nconst multiline = (e) => new MultiLinePrompt({\n validate: e.validate,\n placeholder: e.placeholder,\n defaultValue: e.defaultValue,\n initialValue: e.initialValue,\n showSubmit: e.showSubmit,\n output: e.output,\n signal: e.signal,\n input: e.input,\n render() {\n const i = e?.withGuide ?? settings.withGuide, o = `${`${i ? `${styleText(\"gray\", S_BAR)}\n` : \"\"}${symbol(this.state)} `}${e.message}\n`, m = e.placeholder && e.placeholder.length > 0 ? (\n // biome-ignore lint/style/noNonNullAssertion: guarded by placeholder.length > 0\n styleText(\"inverse\", e.placeholder[0]) + styleText(\"dim\", e.placeholder.slice(1))\n ) : styleText([\"inverse\", \"hidden\"], \"_\"), a = this.userInput ? this.userInputWithCursor : m, l = this.value ?? \"\", c = e.showSubmit ? `\n ${styleText(this.focused === \"submit\" ? \"cyan\" : \"dim\", \"[ submit ]\")}` : \"\";\n switch (this.state) {\n case \"error\": {\n const n = `${styleText(\"yellow\", S_BAR)} `, r = i ? wrapTextWithPrefix(e.output, a, n, void 0) : a, u = styleText(\"yellow\", S_BAR_END);\n return `${o}${r}\n${u} ${styleText(\"yellow\", this.error)}${c}\n`;\n }\n case \"submit\": {\n const n = `${styleText(\"gray\", S_BAR)} `, r = i ? wrapTextWithPrefix(\n e.output,\n l,\n n,\n void 0,\n void 0,\n (u) => styleText(\"dim\", u)\n ) : l ? styleText(\"dim\", l) : \"\";\n return `${o}${r}`;\n }\n case \"cancel\": {\n const n = `${styleText(\"gray\", S_BAR)} `, r = i ? wrapTextWithPrefix(\n e.output,\n l,\n n,\n void 0,\n void 0,\n (u) => styleText([\"strikethrough\", \"dim\"], u)\n ) : l ? styleText([\"strikethrough\", \"dim\"], l) : \"\";\n return `${o}${r}`;\n }\n default: {\n const n = i ? `${styleText(\"cyan\", S_BAR)} ` : \"\", r = i ? styleText(\"cyan\", S_BAR_END) : \"\", u = i ? wrapTextWithPrefix(e.output, a, n) : a;\n return `${o}${u}\n${r}${c}\n`;\n }\n }\n }\n}).prompt();\n\nconst W$1 = (o) => o, C = (o, e, s) => {\n const a = {\n hard: true,\n trim: false\n }, i = wrapAnsi(o, e, a).split(`\n`), c = i.reduce((n, t) => Math.max(l(t), n), 0), u = i.map(s).reduce((n, t) => Math.max(l(t), n), 0), g = e - (u - c);\n return wrapAnsi(o, g, a);\n};\nconst note = (o = \"\", e = \"\", s) => {\n const a = s?.output ?? process$1.stdout, i = s?.withGuide ?? settings.withGuide, c = s?.format ?? W$1, g = [\"\", ...C(o, getColumns(a) - 6, c).split(`\n`).map(c), \"\"], n = l(e), t = Math.max(\n g.reduce((m, F) => {\n const O = l(F);\n return O > m ? O : m;\n }, 0),\n n\n ) + 2, h = g.map(\n (m) => `${styleText(\"gray\", S_BAR)} ${m}${\" \".repeat(t - l(m))}${styleText(\"gray\", S_BAR)}`\n ).join(`\n`), T = i ? `${styleText(\"gray\", S_BAR)}\n` : \"\", l$1 = i ? S_CONNECT_LEFT : S_CORNER_BOTTOM_LEFT;\n a.write(\n `${T}${styleText(\"green\", S_STEP_SUBMIT)} ${styleText(\"reset\", e)} ${styleText(\n \"gray\",\n S_BAR_H.repeat(Math.max(t - n - 1, 1)) + S_CORNER_TOP_RIGHT\n )}\n${h}\n${styleText(\"gray\", l$1 + S_BAR_H.repeat(t + 2) + S_CORNER_BOTTOM_RIGHT)}\n`\n );\n};\n\nconst password = (r) => new PasswordPrompt({\n validate: r.validate,\n mask: r.mask ?? S_PASSWORD_MASK,\n signal: r.signal,\n input: r.input,\n output: r.output,\n render() {\n const e = r.withGuide ?? settings.withGuide, o = `${e ? `${styleText(\"gray\", S_BAR)}\n` : \"\"}${symbol(this.state)} ${r.message}\n`, c = this.userInputWithCursor, i = this.masked;\n switch (this.state) {\n case \"error\": {\n const s = e ? `${styleText(\"yellow\", S_BAR)} ` : \"\", n = e ? `${styleText(\"yellow\", S_BAR_END)} ` : \"\", l = i ?? \"\";\n return r.clearOnError && this.clear(), `${o.trim()}\n${s}${l}\n${n}${styleText(\"yellow\", this.error)}\n`;\n }\n case \"submit\": {\n const s = e ? `${styleText(\"gray\", S_BAR)} ` : \"\", n = i ? styleText(\"dim\", i) : \"\";\n return `${o}${s}${n}`;\n }\n case \"cancel\": {\n const s = e ? `${styleText(\"gray\", S_BAR)} ` : \"\", n = i ? styleText([\"strikethrough\", \"dim\"], i) : \"\";\n return `${o}${s}${n}${i && e ? `\n${styleText(\"gray\", S_BAR)}` : \"\"}`;\n }\n default: {\n const s = e ? `${styleText(\"cyan\", S_BAR)} ` : \"\", n = e ? styleText(\"cyan\", S_BAR_END) : \"\";\n return `${o}${s}${c}\n${n}\n`;\n }\n }\n }\n}).prompt();\n\nconst path = (e) => {\n const a = e.validate;\n return autocomplete({\n ...e,\n initialUserInput: e.initialValue ?? e.root ?? process.cwd(),\n maxItems: 5,\n validate(t) {\n if (!Array.isArray(t)) {\n if (!t)\n return \"Please select a path\";\n if (a)\n return runValidation(a, t);\n }\n },\n options() {\n const t = this.userInput;\n if (t === \"\")\n return [];\n try {\n let i;\n existsSync(t) ? lstatSync(t).isDirectory() && (!e.directory || t.endsWith(\"/\")) ? i = t : i = dirname(t) : i = dirname(t);\n const c = t.length > 1 && t.endsWith(\"/\") ? t.slice(0, -1) : t;\n return readdirSync(i).map((r) => {\n const n = join(i, r), m = lstatSync(n);\n return {\n name: r,\n path: n,\n isDirectory: m.isDirectory()\n };\n }).filter(\n ({ path: r, isDirectory: n }) => r.startsWith(c) && (n || !e.directory)\n ).map((r) => ({\n value: r.path\n }));\n } catch {\n return [];\n }\n }\n });\n};\n\nconst W = (l) => styleText(\"magenta\", l);\nconst spinner = ({\n indicator: l = \"dots\",\n onCancel: h,\n output: n = process.stdout,\n cancelMessage: G,\n errorMessage: O,\n frames: E = unicode ? [\"\\u25D2\", \"\\u25D0\", \"\\u25D3\", \"\\u25D1\"] : [\"\\u2022\", \"o\", \"O\", \"0\"],\n delay: F = unicode ? 80 : 120,\n signal: m,\n ...I\n} = {}) => {\n const u = isCI();\n let M, T, d = false, S = false, s = \"\", p, w = performance.now();\n const x = getColumns(n), k = I?.styleFrame ?? W, g = (e) => {\n const r = e > 1 ? O ?? settings.messages.error : G ?? settings.messages.cancel;\n S = e === 1, d && (a(r, e), S && typeof h == \"function\" && h());\n }, f = () => g(2), i = () => g(1), A = () => {\n process.on(\"uncaughtExceptionMonitor\", f), process.on(\"unhandledRejection\", f), process.on(\"SIGINT\", i), process.on(\"SIGTERM\", i), process.on(\"exit\", g), m && m.addEventListener(\"abort\", i);\n }, H = () => {\n process.removeListener(\"uncaughtExceptionMonitor\", f), process.removeListener(\"unhandledRejection\", f), process.removeListener(\"SIGINT\", i), process.removeListener(\"SIGTERM\", i), process.removeListener(\"exit\", g), m && m.removeEventListener(\"abort\", i);\n }, y = () => {\n if (p === void 0) return;\n u && n.write(`\n`);\n const r = wrapAnsi(p, x, {\n hard: true,\n trim: false\n }).split(`\n`);\n r.length > 1 && n.write(cursor.up(r.length - 1)), n.write(cursor.to(0)), n.write(erase.down());\n }, C = (e) => e.replace(/\\.+$/, \"\"), _ = (e) => {\n const r = (performance.now() - e) / 1e3, t = Math.floor(r / 60), o = Math.floor(r % 60);\n return t > 0 ? `[${t}m ${o}s]` : `[${o}s]`;\n }, N = I.withGuide ?? settings.withGuide, P = (e = \"\") => {\n d = true, M = block({ output: n }), s = C(e), w = performance.now(), N && n.write(`${styleText(\"gray\", S_BAR)}\n`);\n let r = 0, t = 0;\n A(), T = setInterval(() => {\n if (u && s === p)\n return;\n y(), p = s;\n const o = k(E[r]);\n let v;\n if (u)\n v = `${o} ${s}...`;\n else if (l === \"timer\")\n v = `${o} ${s} ${_(w)}`;\n else {\n const B = \".\".repeat(Math.floor(t)).slice(0, 3);\n v = `${o} ${s}${B}`;\n }\n const j = wrapAnsi(v, x, {\n hard: true,\n trim: false\n });\n n.write(j), r = r + 1 < E.length ? r + 1 : 0, t = t < 4 ? t + 0.125 : 0;\n }, F);\n }, a = (e = \"\", r = 0, t = false) => {\n if (!d) return;\n d = false, clearInterval(T), y();\n const o = r === 0 ? styleText(\"green\", S_STEP_SUBMIT) : r === 1 ? styleText(\"red\", S_STEP_CANCEL) : styleText(\"red\", S_STEP_ERROR);\n s = e ?? s, t || (l === \"timer\" ? n.write(`${o} ${s} ${_(w)}\n`) : n.write(`${o} ${s}\n`)), H(), M();\n };\n return {\n start: P,\n stop: (e = \"\") => a(e, 0),\n message: (e = \"\") => {\n s = C(e ?? s);\n },\n cancel: (e = \"\") => a(e, 1),\n error: (e = \"\") => a(e, 2),\n clear: () => a(\"\", 0, true),\n get isCancelled() {\n return S;\n }\n };\n};\n\nconst u = {\n light: unicodeOr(\"\\u2500\", \"-\"),\n heavy: unicodeOr(\"\\u2501\", \"=\"),\n block: unicodeOr(\"\\u2588\", \"#\")\n};\nfunction progress({\n style: o = \"heavy\",\n max: d = 100,\n size: v = 40,\n ...x\n} = {}) {\n const r = spinner(x);\n let a = 0, n = \"\";\n const c = Math.max(1, d), l = Math.max(1, v), S = (t) => {\n switch (t) {\n case \"initial\":\n case \"active\":\n return (e) => styleText(\"magenta\", e);\n case \"error\":\n case \"cancel\":\n return (e) => styleText(\"red\", e);\n case \"submit\":\n return (e) => styleText(\"green\", e);\n default:\n return (e) => styleText(\"magenta\", e);\n }\n }, p = (t, e) => {\n const m = Math.floor(a / c * l);\n return `${S(t)(u[o].repeat(m))}${styleText(\"dim\", u[o].repeat(l - m))} ${e}`;\n }, h = (t = \"\") => {\n n = t, r.start(p(\"initial\", t));\n }, g = (t = 1, e) => {\n a = Math.min(c, t + a), r.message(p(\"active\", e ?? n)), n = e ?? n;\n };\n return {\n start: h,\n stop: r.stop,\n cancel: r.cancel,\n error: r.error,\n clear: r.clear,\n advance: g,\n isCancelled: r.isCancelled,\n message: (t) => g(0, t)\n };\n}\n\nconst SELECT_INSTRUCTIONS = [\n `${styleText(\"dim\", \"\\u2191/\\u2193\")} to navigate`,\n `${styleText(\"dim\", \"Enter:\")} confirm`\n];\nconst c = (t, o) => t.includes(`\n`) ? t.split(`\n`).map((d) => o(d)).join(`\n`) : o(t);\nconst select = (t) => {\n const o = (n, m) => {\n if (n === void 0)\n return \"\";\n const s = n.label ?? String(n.value);\n switch (m) {\n case \"disabled\":\n return `${styleText(\"gray\", S_RADIO_INACTIVE)} ${c(s, (i) => styleText(\"gray\", i))}${n.hint ? ` ${styleText(\"dim\", `(${n.hint ?? \"disabled\"})`)}` : \"\"}`;\n case \"selected\":\n return `${c(s, (i) => styleText(\"dim\", i))}`;\n case \"active\":\n return `${styleText(\"green\", S_RADIO_ACTIVE)} ${s}${n.hint ? ` ${styleText(\"dim\", `(${n.hint})`)}` : \"\"}`;\n case \"cancelled\":\n return `${c(s, (i) => styleText([\"strikethrough\", \"dim\"], i))}`;\n default:\n return `${styleText(\"dim\", S_RADIO_INACTIVE)} ${c(s, (i) => styleText(\"dim\", i))}`;\n }\n }, d = t.showInstructions ?? true;\n return new SelectPrompt({\n options: t.options,\n signal: t.signal,\n input: t.input,\n output: t.output,\n initialValue: t.initialValue,\n render() {\n const n = t.withGuide ?? settings.withGuide, m = `${symbol(this.state)} `, s = `${symbolBar(this.state)} `, i = wrapTextWithPrefix(\n t.output,\n t.message,\n s,\n m\n ), u = `${n ? `${styleText(\"gray\", S_BAR)}\n` : \"\"}${i}\n`;\n switch (this.state) {\n case \"submit\": {\n const r = n ? `${styleText(\"gray\", S_BAR)} ` : \"\", a = wrapTextWithPrefix(\n t.output,\n o(this.options[this.cursor], \"selected\"),\n r\n );\n return `${u}${a}`;\n }\n case \"cancel\": {\n const r = n ? `${styleText(\"gray\", S_BAR)} ` : \"\", a = wrapTextWithPrefix(\n t.output,\n o(this.options[this.cursor], \"cancelled\"),\n r\n );\n return `${u}${a}${n ? `\n${styleText(\"gray\", S_BAR)}` : \"\"}`;\n }\n default: {\n const r = n ? `${styleText(\"cyan\", S_BAR)} ` : \"\", a = u.split(`\n`).length, p = d ? formatInstructionFooter(SELECT_INSTRUCTIONS, n) : n ? [styleText(\"cyan\", S_BAR_END)] : [], b = p.join(`\n`), f = p.length + 1;\n return `${u}${r}${limitOptions({\n output: t.output,\n cursor: this.cursor,\n options: this.options,\n maxItems: t.maxItems,\n columnPadding: r.length,\n rowPadding: a + f,\n style: (g, x) => o(g, g.disabled ? \"disabled\" : x ? \"active\" : \"inactive\")\n }).join(`\n${r}`)}\n${b}\n`;\n }\n }\n }\n }).prompt();\n};\n\nconst selectKey = (t) => {\n const l = (e, a = \"inactive\") => {\n if (e === void 0)\n return \"\";\n const n = e.label ?? String(e.value);\n return a === \"selected\" ? `${styleText(\"dim\", n)}` : a === \"cancelled\" ? `${styleText([\"strikethrough\", \"dim\"], n)}` : a === \"active\" ? `${styleText([\"bgCyan\", \"gray\"], ` ${e.value} `)} ${n}${e.hint ? ` ${styleText(\"dim\", `(${e.hint})`)}` : \"\"}` : `${styleText([\"gray\", \"bgWhite\", \"inverse\"], ` ${e.value} `)} ${n}${e.hint ? ` ${styleText(\"dim\", `(${e.hint})`)}` : \"\"}`;\n };\n return new SelectKeyPrompt({\n options: t.options,\n signal: t.signal,\n input: t.input,\n output: t.output,\n initialValue: t.initialValue,\n caseSensitive: t.caseSensitive,\n render() {\n const e = t.withGuide ?? settings.withGuide, a = `${e ? `${styleText(\"gray\", S_BAR)}\n` : \"\"}${symbol(this.state)} ${t.message}\n`;\n switch (this.state) {\n case \"submit\": {\n const n = e ? `${styleText(\"gray\", S_BAR)} ` : \"\", s = this.options.find((u) => u.value === this.value) ?? t.options[0], c = wrapTextWithPrefix(\n t.output,\n l(s, \"selected\"),\n n\n );\n return `${a}${c}`;\n }\n case \"cancel\": {\n const n = e ? `${styleText(\"gray\", S_BAR)} ` : \"\", s = wrapTextWithPrefix(\n t.output,\n l(this.options[0], \"cancelled\"),\n n\n );\n return `${a}${s}${e ? `\n${styleText(\"gray\", S_BAR)}` : \"\"}`;\n }\n default: {\n const n = e ? `${styleText(\"cyan\", S_BAR)} ` : \"\", s = e ? styleText(\"cyan\", S_BAR_END) : \"\", c = this.options.map(\n (u, d) => wrapTextWithPrefix(\n t.output,\n l(u, d === this.cursor ? \"active\" : \"inactive\"),\n n\n )\n ).join(`\n`);\n return `${a}${c}\n${s}\n`;\n }\n }\n }\n }).prompt();\n};\n\nconst i = `${styleText(\"gray\", S_BAR)} `;\nconst stream = {\n message: async (e, { symbol: l = styleText(\"gray\", S_BAR) } = {}) => {\n process.stdout.write(`${styleText(\"gray\", S_BAR)}\n${l} `);\n let s = 3;\n for await (let r of e) {\n r = r.replace(/\\n/g, `\n${i}`), r.includes(`\n`) && (s = 3 + stripVTControlCharacters(r.slice(r.lastIndexOf(`\n`))).length);\n const o = stripVTControlCharacters(r).length;\n s + o < process.stdout.columns ? (s += o, process.stdout.write(r)) : (process.stdout.write(`\n${i}${r.trimStart()}`), s = 3 + stripVTControlCharacters(r.trimStart()).length);\n }\n process.stdout.write(`\n`);\n },\n info: (e) => stream.message(e, { symbol: styleText(\"blue\", S_INFO) }),\n success: (e) => stream.message(e, { symbol: styleText(\"green\", S_SUCCESS) }),\n step: (e) => stream.message(e, { symbol: styleText(\"green\", S_STEP_SUBMIT) }),\n warn: (e) => stream.message(e, { symbol: styleText(\"yellow\", S_WARN) }),\n /** alias for `log.warn()`. */\n warning: (e) => stream.warn(e),\n error: (e) => stream.message(e, { symbol: styleText(\"red\", S_ERROR) })\n};\n\nconst tasks = async (o, e) => {\n for (const t of o) {\n if (t.enabled === false) continue;\n const s = spinner(e);\n s.start(t.title);\n const n = await t.task(s.message);\n s.stop(n || t.title);\n }\n};\n\nconst A = (l) => l.replace(/\\x1b\\[(?:\\d+;)*\\d*[ABCDEFGHfJKSTsu]|\\x1b\\[(s|u)/g, \"\");\nconst taskLog = (l) => {\n const r = l.output ?? process.stdout, O = getColumns(r), i = styleText(\"gray\", S_BAR), p = l.spacing ?? 1, k = 3, m = l.retainLog === true, d = !isCI() && isTTY(r);\n r.write(`${i}\n`), r.write(`${styleText(\"green\", S_STEP_SUBMIT)} ${l.title}\n`);\n for (let e = 0; e < p; e++)\n r.write(`${i}\n`);\n const n = [\n {\n value: \"\",\n full: \"\"\n }\n ];\n let v = false;\n const f = (e) => {\n if (n.length === 0)\n return;\n let s = 0;\n e && (s += p + 2);\n for (const t of n) {\n const { value: o, result: a } = t;\n let g = a?.message ?? o;\n if (g.length === 0)\n continue;\n a === void 0 && t.header !== void 0 && t.header !== \"\" && (g += `\n${t.header}`);\n const E = g.split(`\n`).reduce((b, w) => w === \"\" ? b + 1 : b + Math.ceil((w.length + k) / O), 0);\n s += E;\n }\n s > 0 && (s += 1, r.write(erase.lines(s)));\n }, h = (e, s, t) => {\n const o = t ? `${e.full}\n${e.value}` : e.value;\n e.header !== void 0 && e.header !== \"\" && log.message(\n e.header.split(`\n`).map((a) => styleText(\"bold\", a)),\n {\n output: r,\n secondarySymbol: i,\n symbol: i,\n spacing: 0\n }\n ), log.message(\n o.split(`\n`).map((a) => styleText(\"dim\", a)),\n {\n output: r,\n secondarySymbol: i,\n symbol: i,\n spacing: s ?? p\n }\n );\n }, T = () => {\n for (const e of n) {\n const { header: s, value: t, full: o } = e;\n (s === void 0 || s.length === 0) && t.length === 0 || h(e, void 0, m === true && o.length > 0);\n }\n }, L = (e, s, t) => {\n if (f(false), (t?.raw !== true || !v) && e.value !== \"\" && (e.value += `\n`), e.value += A(s), v = t?.raw === true, l.limit !== void 0) {\n const o = e.value.split(`\n`), a = o.length - l.limit;\n if (a > 0) {\n const g = o.splice(0, a);\n m && (e.full += (e.full === \"\" ? \"\" : `\n`) + g.join(`\n`));\n }\n e.value = o.join(`\n`);\n }\n d && y();\n }, y = () => {\n for (const e of n)\n e.result ? e.result.status === \"error\" ? log.error(e.result.message, { output: r, secondarySymbol: i, spacing: 0 }) : log.success(e.result.message, { output: r, secondarySymbol: i, spacing: 0 }) : e.value !== \"\" && h(e, 0);\n }, B = (e, s) => {\n f(false), e.result = s, d && y();\n };\n return {\n message(e, s) {\n L(n[0], e, s);\n },\n group(e) {\n const s = {\n header: e,\n value: \"\",\n full: \"\"\n };\n return n.push(s), {\n message(t, o) {\n L(s, t, o);\n },\n error(t) {\n B(s, {\n status: \"error\",\n message: t\n });\n },\n success(t) {\n B(s, {\n status: \"success\",\n message: t\n });\n }\n };\n },\n error(e, s) {\n f(true), log.error(e, { output: r, secondarySymbol: i, spacing: 1 }), s?.showLog !== false && T(), n.splice(1, n.length - 1), n[0].value = \"\", n[0].full = \"\";\n },\n success(e, s) {\n f(true), log.success(e, { output: r, secondarySymbol: i, spacing: 1 }), s?.showLog === true && T(), n.splice(1, n.length - 1), n[0].value = \"\", n[0].full = \"\";\n }\n };\n};\n\nconst text = (e) => new TextPrompt({\n validate: e.validate,\n placeholder: e.placeholder,\n defaultValue: e.defaultValue,\n initialValue: e.initialValue,\n output: e.output,\n signal: e.signal,\n input: e.input,\n render() {\n const i = e?.withGuide ?? settings.withGuide, s = `${`${i ? `${styleText(\"gray\", S_BAR)}\n` : \"\"}${symbol(this.state)} `}${e.message}\n`, c = e.placeholder && e.placeholder.length > 0 ? (\n // biome-ignore lint/style/noNonNullAssertion: guarded by placeholder.length > 0\n styleText(\"inverse\", e.placeholder[0]) + styleText(\"dim\", e.placeholder.slice(1))\n ) : styleText([\"inverse\", \"hidden\"], \"_\"), o = this.userInput ? this.userInputWithCursor : c, l = this.value ?? \"\";\n switch (this.state) {\n case \"error\": {\n const n = this.error ? ` ${styleText(\"yellow\", this.error)}` : \"\", r = i ? `${styleText(\"yellow\", S_BAR)} ` : \"\", d = i ? styleText(\"yellow\", S_BAR_END) : \"\";\n return `${s.trim()}\n${r}${o}\n${d}${n}\n`;\n }\n case \"submit\": {\n const n = l ? ` ${styleText(\"dim\", l)}` : \"\", r = i ? styleText(\"gray\", S_BAR) : \"\";\n return `${s}${r}${n}`;\n }\n case \"cancel\": {\n const n = l ? ` ${styleText([\"strikethrough\", \"dim\"], l)}` : \"\", r = i ? styleText(\"gray\", S_BAR) : \"\";\n return `${s}${r}${n}${l.trim() ? `\n${r}` : \"\"}`;\n }\n default: {\n const n = i ? `${styleText(\"cyan\", S_BAR)} ` : \"\", r = i ? styleText(\"cyan\", S_BAR_END) : \"\";\n return `${s}${n}${o}\n${r}\n`;\n }\n }\n }\n}).prompt();\n\nexport { MULTISELECT_INSTRUCTIONS, SELECT_INSTRUCTIONS, S_BAR, S_BAR_END, S_BAR_END_RIGHT, S_BAR_H, S_BAR_START, S_BAR_START_RIGHT, S_CHECKBOX_ACTIVE, S_CHECKBOX_INACTIVE, S_CHECKBOX_SELECTED, S_CONNECT_LEFT, S_CORNER_BOTTOM_LEFT, S_CORNER_BOTTOM_RIGHT, S_CORNER_TOP_LEFT, S_CORNER_TOP_RIGHT, S_ERROR, S_INFO, S_PASSWORD_MASK, S_RADIO_ACTIVE, S_RADIO_INACTIVE, S_STEP_ACTIVE, S_STEP_CANCEL, S_STEP_ERROR, S_STEP_SUBMIT, S_SUCCESS, S_WARN, autocomplete, autocompleteMultiselect, box, cancel, confirm, date, formatInstructionFooter, group, groupMultiselect, intro, isCI, isTTY, limitOptions, log, multiline, multiselect, note, outro, password, path, progress, select, selectKey, spinner, stream, symbol, symbolBar, taskLog, tasks, text, unicode, unicodeOr };\n","'use strict'\n\nexports.fromCallback = function (fn) {\n return Object.defineProperty(function (...args) {\n if (typeof args[args.length - 1] === 'function') fn.apply(this, args)\n else {\n return new Promise((resolve, reject) => {\n args.push((err, res) => (err != null) ? reject(err) : resolve(res))\n fn.apply(this, args)\n })\n }\n }, 'name', { value: fn.name })\n}\n\nexports.fromPromise = function (fn) {\n return Object.defineProperty(function (...args) {\n const cb = args[args.length - 1]\n if (typeof cb !== 'function') return fn.apply(this, args)\n else {\n args.pop()\n fn.apply(this, args).then(r => cb(null, r), cb)\n }\n }, 'name', { value: fn.name })\n}\n","var constants = require('constants')\n\nvar origCwd = process.cwd\nvar cwd = null\n\nvar platform = process.env.GRACEFUL_FS_PLATFORM || process.platform\n\nprocess.cwd = function() {\n if (!cwd)\n cwd = origCwd.call(process)\n return cwd\n}\ntry {\n process.cwd()\n} catch (er) {}\n\n// This check is needed until node.js 12 is required\nif (typeof process.chdir === 'function') {\n var chdir = process.chdir\n process.chdir = function (d) {\n cwd = null\n chdir.call(process, d)\n }\n if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir)\n}\n\nmodule.exports = patch\n\nfunction patch (fs) {\n // (re-)implement some things that are known busted or missing.\n\n // lchmod, broken prior to 0.6.2\n // back-port the fix here.\n if (constants.hasOwnProperty('O_SYMLINK') &&\n process.version.match(/^v0\\.6\\.[0-2]|^v0\\.5\\./)) {\n patchLchmod(fs)\n }\n\n // lutimes implementation, or no-op\n if (!fs.lutimes) {\n patchLutimes(fs)\n }\n\n // https://github.com/isaacs/node-graceful-fs/issues/4\n // Chown should not fail on einval or eperm if non-root.\n // It should not fail on enosys ever, as this just indicates\n // that a fs doesn't support the intended operation.\n\n fs.chown = chownFix(fs.chown)\n fs.fchown = chownFix(fs.fchown)\n fs.lchown = chownFix(fs.lchown)\n\n fs.chmod = chmodFix(fs.chmod)\n fs.fchmod = chmodFix(fs.fchmod)\n fs.lchmod = chmodFix(fs.lchmod)\n\n fs.chownSync = chownFixSync(fs.chownSync)\n fs.fchownSync = chownFixSync(fs.fchownSync)\n fs.lchownSync = chownFixSync(fs.lchownSync)\n\n fs.chmodSync = chmodFixSync(fs.chmodSync)\n fs.fchmodSync = chmodFixSync(fs.fchmodSync)\n fs.lchmodSync = chmodFixSync(fs.lchmodSync)\n\n fs.stat = statFix(fs.stat)\n fs.fstat = statFix(fs.fstat)\n fs.lstat = statFix(fs.lstat)\n\n fs.statSync = statFixSync(fs.statSync)\n fs.fstatSync = statFixSync(fs.fstatSync)\n fs.lstatSync = statFixSync(fs.lstatSync)\n\n // if lchmod/lchown do not exist, then make them no-ops\n if (fs.chmod && !fs.lchmod) {\n fs.lchmod = function (path, mode, cb) {\n if (cb) process.nextTick(cb)\n }\n fs.lchmodSync = function () {}\n }\n if (fs.chown && !fs.lchown) {\n fs.lchown = function (path, uid, gid, cb) {\n if (cb) process.nextTick(cb)\n }\n fs.lchownSync = function () {}\n }\n\n // on Windows, A/V software can lock the directory, causing this\n // to fail with an EACCES or EPERM if the directory contains newly\n // created files. Try again on failure, for up to 60 seconds.\n\n // Set the timeout this long because some Windows Anti-Virus, such as Parity\n // bit9, may lock files for up to a minute, causing npm package install\n // failures. Also, take care to yield the scheduler. Windows scheduling gives\n // CPU to a busy looping process, which can cause the program causing the lock\n // contention to be starved of CPU by node, so the contention doesn't resolve.\n if (platform === \"win32\") {\n fs.rename = typeof fs.rename !== 'function' ? fs.rename\n : (function (fs$rename) {\n function rename (from, to, cb) {\n var start = Date.now()\n var backoff = 0;\n fs$rename(from, to, function CB (er) {\n if (er\n && (er.code === \"EACCES\" || er.code === \"EPERM\" || er.code === \"EBUSY\")\n && Date.now() - start < 60000) {\n setTimeout(function() {\n fs.stat(to, function (stater, st) {\n if (stater && stater.code === \"ENOENT\")\n fs$rename(from, to, CB);\n else\n cb(er)\n })\n }, backoff)\n if (backoff < 100)\n backoff += 10;\n return;\n }\n if (cb) cb(er)\n })\n }\n if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename)\n return rename\n })(fs.rename)\n }\n\n // if read() returns EAGAIN, then just try it again.\n fs.read = typeof fs.read !== 'function' ? fs.read\n : (function (fs$read) {\n function read (fd, buffer, offset, length, position, callback_) {\n var callback\n if (callback_ && typeof callback_ === 'function') {\n var eagCounter = 0\n callback = function (er, _, __) {\n if (er && er.code === 'EAGAIN' && eagCounter < 10) {\n eagCounter ++\n return fs$read.call(fs, fd, buffer, offset, length, position, callback)\n }\n callback_.apply(this, arguments)\n }\n }\n return fs$read.call(fs, fd, buffer, offset, length, position, callback)\n }\n\n // This ensures `util.promisify` works as it does for native `fs.read`.\n if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read)\n return read\n })(fs.read)\n\n fs.readSync = typeof fs.readSync !== 'function' ? fs.readSync\n : (function (fs$readSync) { return function (fd, buffer, offset, length, position) {\n var eagCounter = 0\n while (true) {\n try {\n return fs$readSync.call(fs, fd, buffer, offset, length, position)\n } catch (er) {\n if (er.code === 'EAGAIN' && eagCounter < 10) {\n eagCounter ++\n continue\n }\n throw er\n }\n }\n }})(fs.readSync)\n\n function patchLchmod (fs) {\n fs.lchmod = function (path, mode, callback) {\n fs.open( path\n , constants.O_WRONLY | constants.O_SYMLINK\n , mode\n , function (err, fd) {\n if (err) {\n if (callback) callback(err)\n return\n }\n // prefer to return the chmod error, if one occurs,\n // but still try to close, and report closing errors if they occur.\n fs.fchmod(fd, mode, function (err) {\n fs.close(fd, function(err2) {\n if (callback) callback(err || err2)\n })\n })\n })\n }\n\n fs.lchmodSync = function (path, mode) {\n var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode)\n\n // prefer to return the chmod error, if one occurs,\n // but still try to close, and report closing errors if they occur.\n var threw = true\n var ret\n try {\n ret = fs.fchmodSync(fd, mode)\n threw = false\n } finally {\n if (threw) {\n try {\n fs.closeSync(fd)\n } catch (er) {}\n } else {\n fs.closeSync(fd)\n }\n }\n return ret\n }\n }\n\n function patchLutimes (fs) {\n if (constants.hasOwnProperty(\"O_SYMLINK\") && fs.futimes) {\n fs.lutimes = function (path, at, mt, cb) {\n fs.open(path, constants.O_SYMLINK, function (er, fd) {\n if (er) {\n if (cb) cb(er)\n return\n }\n fs.futimes(fd, at, mt, function (er) {\n fs.close(fd, function (er2) {\n if (cb) cb(er || er2)\n })\n })\n })\n }\n\n fs.lutimesSync = function (path, at, mt) {\n var fd = fs.openSync(path, constants.O_SYMLINK)\n var ret\n var threw = true\n try {\n ret = fs.futimesSync(fd, at, mt)\n threw = false\n } finally {\n if (threw) {\n try {\n fs.closeSync(fd)\n } catch (er) {}\n } else {\n fs.closeSync(fd)\n }\n }\n return ret\n }\n\n } else if (fs.futimes) {\n fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) }\n fs.lutimesSync = function () {}\n }\n }\n\n function chmodFix (orig) {\n if (!orig) return orig\n return function (target, mode, cb) {\n return orig.call(fs, target, mode, function (er) {\n if (chownErOk(er)) er = null\n if (cb) cb.apply(this, arguments)\n })\n }\n }\n\n function chmodFixSync (orig) {\n if (!orig) return orig\n return function (target, mode) {\n try {\n return orig.call(fs, target, mode)\n } catch (er) {\n if (!chownErOk(er)) throw er\n }\n }\n }\n\n\n function chownFix (orig) {\n if (!orig) return orig\n return function (target, uid, gid, cb) {\n return orig.call(fs, target, uid, gid, function (er) {\n if (chownErOk(er)) er = null\n if (cb) cb.apply(this, arguments)\n })\n }\n }\n\n function chownFixSync (orig) {\n if (!orig) return orig\n return function (target, uid, gid) {\n try {\n return orig.call(fs, target, uid, gid)\n } catch (er) {\n if (!chownErOk(er)) throw er\n }\n }\n }\n\n function statFix (orig) {\n if (!orig) return orig\n // Older versions of Node erroneously returned signed integers for\n // uid + gid.\n return function (target, options, cb) {\n if (typeof options === 'function') {\n cb = options\n options = null\n }\n function callback (er, stats) {\n if (stats) {\n if (stats.uid < 0) stats.uid += 0x100000000\n if (stats.gid < 0) stats.gid += 0x100000000\n }\n if (cb) cb.apply(this, arguments)\n }\n return options ? orig.call(fs, target, options, callback)\n : orig.call(fs, target, callback)\n }\n }\n\n function statFixSync (orig) {\n if (!orig) return orig\n // Older versions of Node erroneously returned signed integers for\n // uid + gid.\n return function (target, options) {\n var stats = options ? orig.call(fs, target, options)\n : orig.call(fs, target)\n if (stats) {\n if (stats.uid < 0) stats.uid += 0x100000000\n if (stats.gid < 0) stats.gid += 0x100000000\n }\n return stats;\n }\n }\n\n // ENOSYS means that the fs doesn't support the op. Just ignore\n // that, because it doesn't matter.\n //\n // if there's no getuid, or if getuid() is something other\n // than 0, and the error is EINVAL or EPERM, then just ignore\n // it.\n //\n // This specific case is a silent failure in cp, install, tar,\n // and most other unix tools that manage permissions.\n //\n // When running as root, or if other types of errors are\n // encountered, then it's strict.\n function chownErOk (er) {\n if (!er)\n return true\n\n if (er.code === \"ENOSYS\")\n return true\n\n var nonroot = !process.getuid || process.getuid() !== 0\n if (nonroot) {\n if (er.code === \"EINVAL\" || er.code === \"EPERM\")\n return true\n }\n\n return false\n }\n}\n","var Stream = require('stream').Stream\n\nmodule.exports = legacy\n\nfunction legacy (fs) {\n return {\n ReadStream: ReadStream,\n WriteStream: WriteStream\n }\n\n function ReadStream (path, options) {\n if (!(this instanceof ReadStream)) return new ReadStream(path, options);\n\n Stream.call(this);\n\n var self = this;\n\n this.path = path;\n this.fd = null;\n this.readable = true;\n this.paused = false;\n\n this.flags = 'r';\n this.mode = 438; /*=0666*/\n this.bufferSize = 64 * 1024;\n\n options = options || {};\n\n // Mixin options into this\n var keys = Object.keys(options);\n for (var index = 0, length = keys.length; index < length; index++) {\n var key = keys[index];\n this[key] = options[key];\n }\n\n if (this.encoding) this.setEncoding(this.encoding);\n\n if (this.start !== undefined) {\n if ('number' !== typeof this.start) {\n throw TypeError('start must be a Number');\n }\n if (this.end === undefined) {\n this.end = Infinity;\n } else if ('number' !== typeof this.end) {\n throw TypeError('end must be a Number');\n }\n\n if (this.start > this.end) {\n throw new Error('start must be <= end');\n }\n\n this.pos = this.start;\n }\n\n if (this.fd !== null) {\n process.nextTick(function() {\n self._read();\n });\n return;\n }\n\n fs.open(this.path, this.flags, this.mode, function (err, fd) {\n if (err) {\n self.emit('error', err);\n self.readable = false;\n return;\n }\n\n self.fd = fd;\n self.emit('open', fd);\n self._read();\n })\n }\n\n function WriteStream (path, options) {\n if (!(this instanceof WriteStream)) return new WriteStream(path, options);\n\n Stream.call(this);\n\n this.path = path;\n this.fd = null;\n this.writable = true;\n\n this.flags = 'w';\n this.encoding = 'binary';\n this.mode = 438; /*=0666*/\n this.bytesWritten = 0;\n\n options = options || {};\n\n // Mixin options into this\n var keys = Object.keys(options);\n for (var index = 0, length = keys.length; index < length; index++) {\n var key = keys[index];\n this[key] = options[key];\n }\n\n if (this.start !== undefined) {\n if ('number' !== typeof this.start) {\n throw TypeError('start must be a Number');\n }\n if (this.start < 0) {\n throw new Error('start must be >= zero');\n }\n\n this.pos = this.start;\n }\n\n this.busy = false;\n this._queue = [];\n\n if (this.fd === null) {\n this._open = fs.open;\n this._queue.push([this._open, this.path, this.flags, this.mode, undefined]);\n this.flush();\n }\n }\n}\n","'use strict'\n\nmodule.exports = clone\n\nvar getPrototypeOf = Object.getPrototypeOf || function (obj) {\n return obj.__proto__\n}\n\nfunction clone (obj) {\n if (obj === null || typeof obj !== 'object')\n return obj\n\n if (obj instanceof Object)\n var copy = { __proto__: getPrototypeOf(obj) }\n else\n var copy = Object.create(null)\n\n Object.getOwnPropertyNames(obj).forEach(function (key) {\n Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key))\n })\n\n return copy\n}\n","var fs = require('fs')\nvar polyfills = require('./polyfills.js')\nvar legacy = require('./legacy-streams.js')\nvar clone = require('./clone.js')\n\nvar util = require('util')\n\n/* istanbul ignore next - node 0.x polyfill */\nvar gracefulQueue\nvar previousSymbol\n\n/* istanbul ignore else - node 0.x polyfill */\nif (typeof Symbol === 'function' && typeof Symbol.for === 'function') {\n gracefulQueue = Symbol.for('graceful-fs.queue')\n // This is used in testing by future versions\n previousSymbol = Symbol.for('graceful-fs.previous')\n} else {\n gracefulQueue = '___graceful-fs.queue'\n previousSymbol = '___graceful-fs.previous'\n}\n\nfunction noop () {}\n\nfunction publishQueue(context, queue) {\n Object.defineProperty(context, gracefulQueue, {\n get: function() {\n return queue\n }\n })\n}\n\nvar debug = noop\nif (util.debuglog)\n debug = util.debuglog('gfs4')\nelse if (/\\bgfs4\\b/i.test(process.env.NODE_DEBUG || ''))\n debug = function() {\n var m = util.format.apply(util, arguments)\n m = 'GFS4: ' + m.split(/\\n/).join('\\nGFS4: ')\n console.error(m)\n }\n\n// Once time initialization\nif (!fs[gracefulQueue]) {\n // This queue can be shared by multiple loaded instances\n var queue = global[gracefulQueue] || []\n publishQueue(fs, queue)\n\n // Patch fs.close/closeSync to shared queue version, because we need\n // to retry() whenever a close happens *anywhere* in the program.\n // This is essential when multiple graceful-fs instances are\n // in play at the same time.\n fs.close = (function (fs$close) {\n function close (fd, cb) {\n return fs$close.call(fs, fd, function (err) {\n // This function uses the graceful-fs shared queue\n if (!err) {\n resetQueue()\n }\n\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n })\n }\n\n Object.defineProperty(close, previousSymbol, {\n value: fs$close\n })\n return close\n })(fs.close)\n\n fs.closeSync = (function (fs$closeSync) {\n function closeSync (fd) {\n // This function uses the graceful-fs shared queue\n fs$closeSync.apply(fs, arguments)\n resetQueue()\n }\n\n Object.defineProperty(closeSync, previousSymbol, {\n value: fs$closeSync\n })\n return closeSync\n })(fs.closeSync)\n\n if (/\\bgfs4\\b/i.test(process.env.NODE_DEBUG || '')) {\n process.on('exit', function() {\n debug(fs[gracefulQueue])\n require('assert').equal(fs[gracefulQueue].length, 0)\n })\n }\n}\n\nif (!global[gracefulQueue]) {\n publishQueue(global, fs[gracefulQueue]);\n}\n\nmodule.exports = patch(clone(fs))\nif (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) {\n module.exports = patch(fs)\n fs.__patched = true;\n}\n\nfunction patch (fs) {\n // Everything that references the open() function needs to be in here\n polyfills(fs)\n fs.gracefulify = patch\n\n fs.createReadStream = createReadStream\n fs.createWriteStream = createWriteStream\n var fs$readFile = fs.readFile\n fs.readFile = readFile\n function readFile (path, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$readFile(path, options, cb)\n\n function go$readFile (path, options, cb, startTime) {\n return fs$readFile(path, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$readFile, [path, options, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$writeFile = fs.writeFile\n fs.writeFile = writeFile\n function writeFile (path, data, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$writeFile(path, data, options, cb)\n\n function go$writeFile (path, data, options, cb, startTime) {\n return fs$writeFile(path, data, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$writeFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$appendFile = fs.appendFile\n if (fs$appendFile)\n fs.appendFile = appendFile\n function appendFile (path, data, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$appendFile(path, data, options, cb)\n\n function go$appendFile (path, data, options, cb, startTime) {\n return fs$appendFile(path, data, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$appendFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$copyFile = fs.copyFile\n if (fs$copyFile)\n fs.copyFile = copyFile\n function copyFile (src, dest, flags, cb) {\n if (typeof flags === 'function') {\n cb = flags\n flags = 0\n }\n return go$copyFile(src, dest, flags, cb)\n\n function go$copyFile (src, dest, flags, cb, startTime) {\n return fs$copyFile(src, dest, flags, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$readdir = fs.readdir\n fs.readdir = readdir\n var noReaddirOptionVersions = /^v[0-5]\\./\n function readdir (path, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n var go$readdir = noReaddirOptionVersions.test(process.version)\n ? function go$readdir (path, options, cb, startTime) {\n return fs$readdir(path, fs$readdirCallback(\n path, options, cb, startTime\n ))\n }\n : function go$readdir (path, options, cb, startTime) {\n return fs$readdir(path, options, fs$readdirCallback(\n path, options, cb, startTime\n ))\n }\n\n return go$readdir(path, options, cb)\n\n function fs$readdirCallback (path, options, cb, startTime) {\n return function (err, files) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([\n go$readdir,\n [path, options, cb],\n err,\n startTime || Date.now(),\n Date.now()\n ])\n else {\n if (files && files.sort)\n files.sort()\n\n if (typeof cb === 'function')\n cb.call(this, err, files)\n }\n }\n }\n }\n\n if (process.version.substr(0, 4) === 'v0.8') {\n var legStreams = legacy(fs)\n ReadStream = legStreams.ReadStream\n WriteStream = legStreams.WriteStream\n }\n\n var fs$ReadStream = fs.ReadStream\n if (fs$ReadStream) {\n ReadStream.prototype = Object.create(fs$ReadStream.prototype)\n ReadStream.prototype.open = ReadStream$open\n }\n\n var fs$WriteStream = fs.WriteStream\n if (fs$WriteStream) {\n WriteStream.prototype = Object.create(fs$WriteStream.prototype)\n WriteStream.prototype.open = WriteStream$open\n }\n\n Object.defineProperty(fs, 'ReadStream', {\n get: function () {\n return ReadStream\n },\n set: function (val) {\n ReadStream = val\n },\n enumerable: true,\n configurable: true\n })\n Object.defineProperty(fs, 'WriteStream', {\n get: function () {\n return WriteStream\n },\n set: function (val) {\n WriteStream = val\n },\n enumerable: true,\n configurable: true\n })\n\n // legacy names\n var FileReadStream = ReadStream\n Object.defineProperty(fs, 'FileReadStream', {\n get: function () {\n return FileReadStream\n },\n set: function (val) {\n FileReadStream = val\n },\n enumerable: true,\n configurable: true\n })\n var FileWriteStream = WriteStream\n Object.defineProperty(fs, 'FileWriteStream', {\n get: function () {\n return FileWriteStream\n },\n set: function (val) {\n FileWriteStream = val\n },\n enumerable: true,\n configurable: true\n })\n\n function ReadStream (path, options) {\n if (this instanceof ReadStream)\n return fs$ReadStream.apply(this, arguments), this\n else\n return ReadStream.apply(Object.create(ReadStream.prototype), arguments)\n }\n\n function ReadStream$open () {\n var that = this\n open(that.path, that.flags, that.mode, function (err, fd) {\n if (err) {\n if (that.autoClose)\n that.destroy()\n\n that.emit('error', err)\n } else {\n that.fd = fd\n that.emit('open', fd)\n that.read()\n }\n })\n }\n\n function WriteStream (path, options) {\n if (this instanceof WriteStream)\n return fs$WriteStream.apply(this, arguments), this\n else\n return WriteStream.apply(Object.create(WriteStream.prototype), arguments)\n }\n\n function WriteStream$open () {\n var that = this\n open(that.path, that.flags, that.mode, function (err, fd) {\n if (err) {\n that.destroy()\n that.emit('error', err)\n } else {\n that.fd = fd\n that.emit('open', fd)\n }\n })\n }\n\n function createReadStream (path, options) {\n return new fs.ReadStream(path, options)\n }\n\n function createWriteStream (path, options) {\n return new fs.WriteStream(path, options)\n }\n\n var fs$open = fs.open\n fs.open = open\n function open (path, flags, mode, cb) {\n if (typeof mode === 'function')\n cb = mode, mode = null\n\n return go$open(path, flags, mode, cb)\n\n function go$open (path, flags, mode, cb, startTime) {\n return fs$open(path, flags, mode, function (err, fd) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$open, [path, flags, mode, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n return fs\n}\n\nfunction enqueue (elem) {\n debug('ENQUEUE', elem[0].name, elem[1])\n fs[gracefulQueue].push(elem)\n retry()\n}\n\n// keep track of the timeout between retry() calls\nvar retryTimer\n\n// reset the startTime and lastTime to now\n// this resets the start of the 60 second overall timeout as well as the\n// delay between attempts so that we'll retry these jobs sooner\nfunction resetQueue () {\n var now = Date.now()\n for (var i = 0; i < fs[gracefulQueue].length; ++i) {\n // entries that are only a length of 2 are from an older version, don't\n // bother modifying those since they'll be retried anyway.\n if (fs[gracefulQueue][i].length > 2) {\n fs[gracefulQueue][i][3] = now // startTime\n fs[gracefulQueue][i][4] = now // lastTime\n }\n }\n // call retry to make sure we're actively processing the queue\n retry()\n}\n\nfunction retry () {\n // clear the timer and remove it to help prevent unintended concurrency\n clearTimeout(retryTimer)\n retryTimer = undefined\n\n if (fs[gracefulQueue].length === 0)\n return\n\n var elem = fs[gracefulQueue].shift()\n var fn = elem[0]\n var args = elem[1]\n // these items may be unset if they were added by an older graceful-fs\n var err = elem[2]\n var startTime = elem[3]\n var lastTime = elem[4]\n\n // if we don't have a startTime we have no way of knowing if we've waited\n // long enough, so go ahead and retry this item now\n if (startTime === undefined) {\n debug('RETRY', fn.name, args)\n fn.apply(null, args)\n } else if (Date.now() - startTime >= 60000) {\n // it's been more than 60 seconds total, bail now\n debug('TIMEOUT', fn.name, args)\n var cb = args.pop()\n if (typeof cb === 'function')\n cb.call(null, err)\n } else {\n // the amount of time between the last attempt and right now\n var sinceAttempt = Date.now() - lastTime\n // the amount of time between when we first tried, and when we last tried\n // rounded up to at least 1\n var sinceStart = Math.max(lastTime - startTime, 1)\n // backoff. wait longer than the total time we've been retrying, but only\n // up to a maximum of 100ms\n var desiredDelay = Math.min(sinceStart * 1.2, 100)\n // it's been long enough since the last retry, do it again\n if (sinceAttempt >= desiredDelay) {\n debug('RETRY', fn.name, args)\n fn.apply(null, args.concat([startTime]))\n } else {\n // if we can't do this job yet, push it to the end of the queue\n // and let the next iteration check again\n fs[gracefulQueue].push(elem)\n }\n }\n\n // schedule our next run if one isn't already scheduled\n if (retryTimer === undefined) {\n retryTimer = setTimeout(retry, 0)\n }\n}\n","'use strict'\n// This is adapted from https://github.com/normalize/mz\n// Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and Contributors\nconst u = require('universalify').fromCallback\nconst fs = require('graceful-fs')\n\nconst api = [\n 'access',\n 'appendFile',\n 'chmod',\n 'chown',\n 'close',\n 'copyFile',\n 'cp',\n 'fchmod',\n 'fchown',\n 'fdatasync',\n 'fstat',\n 'fsync',\n 'ftruncate',\n 'futimes',\n 'glob',\n 'lchmod',\n 'lchown',\n 'lutimes',\n 'link',\n 'lstat',\n 'mkdir',\n 'mkdtemp',\n 'open',\n 'opendir',\n 'readdir',\n 'readFile',\n 'readlink',\n 'realpath',\n 'rename',\n 'rm',\n 'rmdir',\n 'stat',\n 'statfs',\n 'symlink',\n 'truncate',\n 'unlink',\n 'utimes',\n 'writeFile'\n].filter(key => {\n // Some commands are not available on some systems. Ex:\n // fs.cp was added in Node.js v16.7.0\n // fs.statfs was added in Node v19.6.0, v18.15.0\n // fs.glob was added in Node.js v22.0.0\n // fs.lchown is not available on at least some Linux\n return typeof fs[key] === 'function'\n})\n\n// Export cloned fs:\nObject.assign(exports, fs)\n\n// Universalify async methods:\napi.forEach(method => {\n exports[method] = u(fs[method])\n})\n\n// We differ from mz/fs in that we still ship the old, broken, fs.exists()\n// since we are a drop-in replacement for the native module\nexports.exists = function (filename, callback) {\n if (typeof callback === 'function') {\n return fs.exists(filename, callback)\n }\n return new Promise(resolve => {\n return fs.exists(filename, resolve)\n })\n}\n\n// fs.read(), fs.write(), fs.readv(), & fs.writev() need special treatment due to multiple callback args\n\nexports.read = function (fd, buffer, offset, length, position, callback) {\n if (typeof callback === 'function') {\n return fs.read(fd, buffer, offset, length, position, callback)\n }\n return new Promise((resolve, reject) => {\n fs.read(fd, buffer, offset, length, position, (err, bytesRead, buffer) => {\n if (err) return reject(err)\n resolve({ bytesRead, buffer })\n })\n })\n}\n\n// Function signature can be\n// fs.write(fd, buffer[, offset[, length[, position]]], callback)\n// OR\n// fs.write(fd, string[, position[, encoding]], callback)\n// We need to handle both cases, so we use ...args\nexports.write = function (fd, buffer, ...args) {\n if (typeof args[args.length - 1] === 'function') {\n return fs.write(fd, buffer, ...args)\n }\n\n return new Promise((resolve, reject) => {\n fs.write(fd, buffer, ...args, (err, bytesWritten, buffer) => {\n if (err) return reject(err)\n resolve({ bytesWritten, buffer })\n })\n })\n}\n\n// Function signature is\n// s.readv(fd, buffers[, position], callback)\n// We need to handle the optional arg, so we use ...args\nexports.readv = function (fd, buffers, ...args) {\n if (typeof args[args.length - 1] === 'function') {\n return fs.readv(fd, buffers, ...args)\n }\n\n return new Promise((resolve, reject) => {\n fs.readv(fd, buffers, ...args, (err, bytesRead, buffers) => {\n if (err) return reject(err)\n resolve({ bytesRead, buffers })\n })\n })\n}\n\n// Function signature is\n// s.writev(fd, buffers[, position], callback)\n// We need to handle the optional arg, so we use ...args\nexports.writev = function (fd, buffers, ...args) {\n if (typeof args[args.length - 1] === 'function') {\n return fs.writev(fd, buffers, ...args)\n }\n\n return new Promise((resolve, reject) => {\n fs.writev(fd, buffers, ...args, (err, bytesWritten, buffers) => {\n if (err) return reject(err)\n resolve({ bytesWritten, buffers })\n })\n })\n}\n\n// fs.realpath.native sometimes not available if fs is monkey-patched\nif (typeof fs.realpath.native === 'function') {\n exports.realpath.native = u(fs.realpath.native)\n} else {\n process.emitWarning(\n 'fs.realpath.native is not a function. Is fs being monkey-patched?',\n 'Warning', 'fs-extra-WARN0003'\n )\n}\n","// Adapted from https://github.com/sindresorhus/make-dir\n// Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n'use strict'\nconst path = require('path')\n\n// https://github.com/nodejs/node/issues/8987\n// https://github.com/libuv/libuv/pull/1088\nmodule.exports.checkPath = function checkPath (pth) {\n if (process.platform === 'win32') {\n const pathHasInvalidWinCharacters = /[<>:\"|?*]/.test(pth.replace(path.parse(pth).root, ''))\n\n if (pathHasInvalidWinCharacters) {\n const error = new Error(`Path contains invalid characters: ${pth}`)\n error.code = 'EINVAL'\n throw error\n }\n }\n}\n","'use strict'\nconst fs = require('../fs')\nconst { checkPath } = require('./utils')\n\nconst getMode = options => {\n const defaults = { mode: 0o777 }\n if (typeof options === 'number') return options\n return ({ ...defaults, ...options }).mode\n}\n\nmodule.exports.makeDir = async (dir, options) => {\n checkPath(dir)\n\n return fs.mkdir(dir, {\n mode: getMode(options),\n recursive: true\n })\n}\n\nmodule.exports.makeDirSync = (dir, options) => {\n checkPath(dir)\n\n return fs.mkdirSync(dir, {\n mode: getMode(options),\n recursive: true\n })\n}\n","'use strict'\nconst u = require('universalify').fromPromise\nconst { makeDir: _makeDir, makeDirSync } = require('./make-dir')\nconst makeDir = u(_makeDir)\n\nmodule.exports = {\n mkdirs: makeDir,\n mkdirsSync: makeDirSync,\n // alias\n mkdirp: makeDir,\n mkdirpSync: makeDirSync,\n ensureDir: makeDir,\n ensureDirSync: makeDirSync\n}\n","'use strict'\nconst u = require('universalify').fromPromise\nconst fs = require('../fs')\n\nfunction pathExists (path) {\n return fs.access(path).then(() => true).catch(() => false)\n}\n\nmodule.exports = {\n pathExists: u(pathExists),\n pathExistsSync: fs.existsSync\n}\n","'use strict'\n\nconst fs = require('../fs')\nconst u = require('universalify').fromPromise\n\nasync function utimesMillis (path, atime, mtime) {\n const fd = await fs.open(path, 'r+')\n\n let error = null\n\n try {\n await fs.futimes(fd, atime, mtime)\n } catch (futimesErr) {\n error = futimesErr\n } finally {\n try {\n await fs.close(fd)\n } catch (closeErr) {\n if (!error) error = closeErr\n }\n }\n\n if (error) {\n throw error\n }\n}\n\nfunction utimesMillisSync (path, atime, mtime) {\n const fd = fs.openSync(path, 'r+')\n\n let error = null\n\n try {\n fs.futimesSync(fd, atime, mtime)\n } catch (futimesErr) {\n error = futimesErr\n } finally {\n try {\n fs.closeSync(fd)\n } catch (closeErr) {\n if (!error) error = closeErr\n }\n }\n\n if (error) {\n throw error\n }\n}\n\nmodule.exports = {\n utimesMillis: u(utimesMillis),\n utimesMillisSync\n}\n","'use strict'\n\nconst fs = require('../fs')\nconst path = require('path')\nconst u = require('universalify').fromPromise\n\nfunction getStats (src, dest, opts) {\n const statFunc = opts.dereference\n ? (file) => fs.stat(file, { bigint: true })\n : (file) => fs.lstat(file, { bigint: true })\n return Promise.all([\n statFunc(src),\n statFunc(dest).catch(err => {\n if (err.code === 'ENOENT') return null\n throw err\n })\n ]).then(([srcStat, destStat]) => ({ srcStat, destStat }))\n}\n\nfunction getStatsSync (src, dest, opts) {\n let destStat\n const statFunc = opts.dereference\n ? (file) => fs.statSync(file, { bigint: true })\n : (file) => fs.lstatSync(file, { bigint: true })\n const srcStat = statFunc(src)\n try {\n destStat = statFunc(dest)\n } catch (err) {\n if (err.code === 'ENOENT') return { srcStat, destStat: null }\n throw err\n }\n return { srcStat, destStat }\n}\n\nasync function checkPaths (src, dest, funcName, opts) {\n const { srcStat, destStat } = await getStats(src, dest, opts)\n if (destStat) {\n if (areIdentical(srcStat, destStat)) {\n const srcBaseName = path.basename(src)\n const destBaseName = path.basename(dest)\n if (funcName === 'move' &&\n srcBaseName !== destBaseName &&\n srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {\n return { srcStat, destStat, isChangingCase: true }\n }\n throw new Error('Source and destination must not be the same.')\n }\n if (srcStat.isDirectory() && !destStat.isDirectory()) {\n throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`)\n }\n if (!srcStat.isDirectory() && destStat.isDirectory()) {\n throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`)\n }\n }\n\n if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {\n throw new Error(errMsg(src, dest, funcName))\n }\n\n return { srcStat, destStat }\n}\n\nfunction checkPathsSync (src, dest, funcName, opts) {\n const { srcStat, destStat } = getStatsSync(src, dest, opts)\n\n if (destStat) {\n if (areIdentical(srcStat, destStat)) {\n const srcBaseName = path.basename(src)\n const destBaseName = path.basename(dest)\n if (funcName === 'move' &&\n srcBaseName !== destBaseName &&\n srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {\n return { srcStat, destStat, isChangingCase: true }\n }\n throw new Error('Source and destination must not be the same.')\n }\n if (srcStat.isDirectory() && !destStat.isDirectory()) {\n throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`)\n }\n if (!srcStat.isDirectory() && destStat.isDirectory()) {\n throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`)\n }\n }\n\n if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {\n throw new Error(errMsg(src, dest, funcName))\n }\n return { srcStat, destStat }\n}\n\n// recursively check if dest parent is a subdirectory of src.\n// It works for all file types including symlinks since it\n// checks the src and dest inodes. It starts from the deepest\n// parent and stops once it reaches the src parent or the root path.\nasync function checkParentPaths (src, srcStat, dest, funcName) {\n const srcParent = path.resolve(path.dirname(src))\n const destParent = path.resolve(path.dirname(dest))\n if (destParent === srcParent || destParent === path.parse(destParent).root) return\n\n let destStat\n try {\n destStat = await fs.stat(destParent, { bigint: true })\n } catch (err) {\n // The destination parent does not exist yet, but a deeper ancestor might\n // (e.g. when it is a symlink into the source tree). Keep walking up so the\n // self-subdirectory check is not bypassed.\n if (err.code === 'ENOENT') return checkParentPaths(src, srcStat, destParent, funcName)\n throw err\n }\n\n if (areIdentical(srcStat, destStat)) {\n throw new Error(errMsg(src, dest, funcName))\n }\n\n return checkParentPaths(src, srcStat, destParent, funcName)\n}\n\nfunction checkParentPathsSync (src, srcStat, dest, funcName) {\n const srcParent = path.resolve(path.dirname(src))\n const destParent = path.resolve(path.dirname(dest))\n if (destParent === srcParent || destParent === path.parse(destParent).root) return\n let destStat\n try {\n destStat = fs.statSync(destParent, { bigint: true })\n } catch (err) {\n // The destination parent does not exist yet, but a deeper ancestor might\n // (e.g. when it is a symlink into the source tree). Keep walking up so the\n // self-subdirectory check is not bypassed.\n if (err.code === 'ENOENT') return checkParentPathsSync(src, srcStat, destParent, funcName)\n throw err\n }\n if (areIdentical(srcStat, destStat)) {\n throw new Error(errMsg(src, dest, funcName))\n }\n return checkParentPathsSync(src, srcStat, destParent, funcName)\n}\n\nfunction areIdentical (srcStat, destStat) {\n // stat.dev can be 0n on windows when node version >= 22.x.x\n return destStat.ino !== undefined && destStat.dev !== undefined && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev\n}\n\n// return true if dest is a subdir of src, otherwise false.\n// It only checks the path strings.\nfunction isSrcSubdir (src, dest) {\n const srcArr = path.resolve(src).split(path.sep).filter(i => i)\n const destArr = path.resolve(dest).split(path.sep).filter(i => i)\n return srcArr.every((cur, i) => destArr[i] === cur)\n}\n\nfunction errMsg (src, dest, funcName) {\n return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`\n}\n\nmodule.exports = {\n // checkPaths\n checkPaths: u(checkPaths),\n checkPathsSync,\n // checkParent\n checkParentPaths: u(checkParentPaths),\n checkParentPathsSync,\n // Misc\n isSrcSubdir,\n areIdentical\n}\n","'use strict'\n\n// https://github.com/jprichardson/node-fs-extra/issues/1056\n// Performing parallel operations on each item of an async iterator is\n// surprisingly hard; you need to have handlers in place to avoid getting an\n// UnhandledPromiseRejectionWarning.\n// NOTE: This function does not presently handle return values, only errors\nasync function asyncIteratorConcurrentProcess (iterator, fn) {\n const promises = []\n for await (const item of iterator) {\n promises.push(\n fn(item).then(\n () => null,\n (err) => err ?? new Error('unknown error')\n )\n )\n }\n await Promise.all(\n promises.map((promise) =>\n promise.then((possibleErr) => {\n if (possibleErr !== null) throw possibleErr\n })\n )\n )\n}\n\nmodule.exports = {\n asyncIteratorConcurrentProcess\n}\n","'use strict'\n\nconst fs = require('../fs')\nconst path = require('path')\nconst { mkdirs } = require('../mkdirs')\nconst { pathExists } = require('../path-exists')\nconst { utimesMillis } = require('../util/utimes')\nconst stat = require('../util/stat')\nconst { asyncIteratorConcurrentProcess } = require('../util/async')\n\nasync function copy (src, dest, opts = {}) {\n if (typeof opts === 'function') {\n opts = { filter: opts }\n }\n\n opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now\n opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber\n\n // Warn about using preserveTimestamps on 32-bit node\n if (opts.preserveTimestamps && process.arch === 'ia32') {\n process.emitWarning(\n 'Using the preserveTimestamps option in 32-bit node is not recommended;\\n\\n' +\n '\\tsee https://github.com/jprichardson/node-fs-extra/issues/269',\n 'Warning', 'fs-extra-WARN0001'\n )\n }\n\n const { srcStat, destStat } = await stat.checkPaths(src, dest, 'copy', opts)\n\n await stat.checkParentPaths(src, srcStat, dest, 'copy')\n\n const include = await runFilter(src, dest, opts)\n\n if (!include) return\n\n // check if the parent of dest exists, and create it if it doesn't exist\n const destParent = path.dirname(dest)\n const dirExists = await pathExists(destParent)\n if (!dirExists) {\n await mkdirs(destParent)\n }\n\n await getStatsAndPerformCopy(destStat, src, dest, opts)\n}\n\nasync function runFilter (src, dest, opts) {\n if (!opts.filter) return true\n return opts.filter(src, dest)\n}\n\nasync function getStatsAndPerformCopy (destStat, src, dest, opts) {\n const statFn = opts.dereference ? fs.stat : fs.lstat\n const srcStat = await statFn(src)\n\n if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts)\n\n if (\n srcStat.isFile() ||\n srcStat.isCharacterDevice() ||\n srcStat.isBlockDevice()\n ) return onFile(srcStat, destStat, src, dest, opts)\n\n if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts)\n if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`)\n if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`)\n throw new Error(`Unknown file: ${src}`)\n}\n\nasync function onFile (srcStat, destStat, src, dest, opts) {\n if (!destStat) return copyFile(srcStat, src, dest, opts)\n\n if (opts.overwrite) {\n await fs.unlink(dest)\n return copyFile(srcStat, src, dest, opts)\n }\n if (opts.errorOnExist) {\n throw new Error(`'${dest}' already exists`)\n }\n}\n\nasync function copyFile (srcStat, src, dest, opts) {\n await fs.copyFile(src, dest)\n if (opts.preserveTimestamps) {\n // Make sure the file is writable before setting the timestamp\n // otherwise open fails with EPERM when invoked with 'r+'\n // (through utimes call)\n if (fileIsNotWritable(srcStat.mode)) {\n await makeFileWritable(dest, srcStat.mode)\n }\n\n // Set timestamps and mode correspondingly\n\n // Note that The initial srcStat.atime cannot be trusted\n // because it is modified by the read(2) system call\n // (See https://nodejs.org/api/fs.html#fs_stat_time_values)\n const updatedSrcStat = await fs.stat(src)\n await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime)\n }\n\n return fs.chmod(dest, srcStat.mode)\n}\n\nfunction fileIsNotWritable (srcMode) {\n return (srcMode & 0o200) === 0\n}\n\nfunction makeFileWritable (dest, srcMode) {\n return fs.chmod(dest, srcMode | 0o200)\n}\n\nasync function onDir (srcStat, destStat, src, dest, opts) {\n // the dest directory might not exist, create it\n if (!destStat) {\n await fs.mkdir(dest)\n }\n\n // iterate through the files in the current directory to copy everything\n await asyncIteratorConcurrentProcess(await fs.opendir(src), async (item) => {\n const srcItem = path.join(src, item.name)\n const destItem = path.join(dest, item.name)\n\n const include = await runFilter(srcItem, destItem, opts)\n // only copy the item if it matches the filter function\n if (include) {\n const { destStat } = await stat.checkPaths(srcItem, destItem, 'copy', opts)\n // If the item is a copyable file, `getStatsAndPerformCopy` will copy it\n // If the item is a directory, `getStatsAndPerformCopy` will call `onDir` recursively\n await getStatsAndPerformCopy(destStat, srcItem, destItem, opts)\n }\n })\n\n if (!destStat) {\n await fs.chmod(dest, srcStat.mode)\n }\n}\n\nasync function onLink (destStat, src, dest, opts) {\n let resolvedSrc = await fs.readlink(src)\n if (opts.dereference) {\n resolvedSrc = path.resolve(process.cwd(), resolvedSrc)\n }\n if (!destStat) {\n return fs.symlink(resolvedSrc, dest)\n }\n\n let resolvedDest = null\n try {\n resolvedDest = await fs.readlink(dest)\n } catch (e) {\n // dest exists and is a regular file or directory,\n // Windows may throw UNKNOWN error. If dest already exists,\n // fs throws error anyway, so no need to guard against it here.\n if (e.code === 'EINVAL' || e.code === 'UNKNOWN') return fs.symlink(resolvedSrc, dest)\n throw e\n }\n if (opts.dereference) {\n resolvedDest = path.resolve(process.cwd(), resolvedDest)\n }\n // If both symlinks resolve to the same target, they are still distinct symlinks\n // that can be copied/overwritten. Only check subdirectory constraints when\n // the resolved paths are different.\n if (resolvedSrc !== resolvedDest) {\n if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {\n throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)\n }\n\n // do not copy if src is a subdir of dest since unlinking\n // dest in this case would result in removing src contents\n // and therefore a broken symlink would be created.\n if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {\n throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)\n }\n }\n\n // copy the link\n await fs.unlink(dest)\n return fs.symlink(resolvedSrc, dest)\n}\n\nmodule.exports = copy\n","'use strict'\n\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst mkdirsSync = require('../mkdirs').mkdirsSync\nconst utimesMillisSync = require('../util/utimes').utimesMillisSync\nconst stat = require('../util/stat')\n\nfunction copySync (src, dest, opts) {\n if (typeof opts === 'function') {\n opts = { filter: opts }\n }\n\n opts = opts || {}\n opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now\n opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber\n\n // Warn about using preserveTimestamps on 32-bit node\n if (opts.preserveTimestamps && process.arch === 'ia32') {\n process.emitWarning(\n 'Using the preserveTimestamps option in 32-bit node is not recommended;\\n\\n' +\n '\\tsee https://github.com/jprichardson/node-fs-extra/issues/269',\n 'Warning', 'fs-extra-WARN0002'\n )\n }\n\n const { srcStat, destStat } = stat.checkPathsSync(src, dest, 'copy', opts)\n stat.checkParentPathsSync(src, srcStat, dest, 'copy')\n if (opts.filter && !opts.filter(src, dest)) return\n const destParent = path.dirname(dest)\n if (!fs.existsSync(destParent)) mkdirsSync(destParent)\n return getStats(destStat, src, dest, opts)\n}\n\nfunction getStats (destStat, src, dest, opts) {\n const statSync = opts.dereference ? fs.statSync : fs.lstatSync\n const srcStat = statSync(src)\n\n if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts)\n else if (srcStat.isFile() ||\n srcStat.isCharacterDevice() ||\n srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts)\n else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts)\n else if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`)\n else if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`)\n throw new Error(`Unknown file: ${src}`)\n}\n\nfunction onFile (srcStat, destStat, src, dest, opts) {\n if (!destStat) return copyFile(srcStat, src, dest, opts)\n return mayCopyFile(srcStat, src, dest, opts)\n}\n\nfunction mayCopyFile (srcStat, src, dest, opts) {\n if (opts.overwrite) {\n fs.unlinkSync(dest)\n return copyFile(srcStat, src, dest, opts)\n } else if (opts.errorOnExist) {\n throw new Error(`'${dest}' already exists`)\n }\n}\n\nfunction copyFile (srcStat, src, dest, opts) {\n fs.copyFileSync(src, dest)\n if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest)\n return setDestMode(dest, srcStat.mode)\n}\n\nfunction handleTimestamps (srcMode, src, dest) {\n // Make sure the file is writable before setting the timestamp\n // otherwise open fails with EPERM when invoked with 'r+'\n // (through utimes call)\n if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode)\n return setDestTimestamps(src, dest)\n}\n\nfunction fileIsNotWritable (srcMode) {\n return (srcMode & 0o200) === 0\n}\n\nfunction makeFileWritable (dest, srcMode) {\n return setDestMode(dest, srcMode | 0o200)\n}\n\nfunction setDestMode (dest, srcMode) {\n return fs.chmodSync(dest, srcMode)\n}\n\nfunction setDestTimestamps (src, dest) {\n // The initial srcStat.atime cannot be trusted\n // because it is modified by the read(2) system call\n // (See https://nodejs.org/api/fs.html#fs_stat_time_values)\n const updatedSrcStat = fs.statSync(src)\n return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime)\n}\n\nfunction onDir (srcStat, destStat, src, dest, opts) {\n if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts)\n return copyDir(src, dest, opts)\n}\n\nfunction mkDirAndCopy (srcMode, src, dest, opts) {\n fs.mkdirSync(dest)\n copyDir(src, dest, opts)\n return setDestMode(dest, srcMode)\n}\n\nfunction copyDir (src, dest, opts) {\n const dir = fs.opendirSync(src)\n\n try {\n let dirent\n\n while ((dirent = dir.readSync()) !== null) {\n copyDirItem(dirent.name, src, dest, opts)\n }\n } finally {\n dir.closeSync()\n }\n}\n\nfunction copyDirItem (item, src, dest, opts) {\n const srcItem = path.join(src, item)\n const destItem = path.join(dest, item)\n if (opts.filter && !opts.filter(srcItem, destItem)) return\n const { destStat } = stat.checkPathsSync(srcItem, destItem, 'copy', opts)\n return getStats(destStat, srcItem, destItem, opts)\n}\n\nfunction onLink (destStat, src, dest, opts) {\n let resolvedSrc = fs.readlinkSync(src)\n if (opts.dereference) {\n resolvedSrc = path.resolve(process.cwd(), resolvedSrc)\n }\n\n if (!destStat) {\n return fs.symlinkSync(resolvedSrc, dest)\n } else {\n let resolvedDest\n try {\n resolvedDest = fs.readlinkSync(dest)\n } catch (err) {\n // dest exists and is a regular file or directory,\n // Windows may throw UNKNOWN error. If dest already exists,\n // fs throws error anyway, so no need to guard against it here.\n if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlinkSync(resolvedSrc, dest)\n throw err\n }\n if (opts.dereference) {\n resolvedDest = path.resolve(process.cwd(), resolvedDest)\n }\n // If both symlinks resolve to the same target, they are still distinct symlinks\n // that can be copied/overwritten. Only check subdirectory constraints when\n // the resolved paths are different.\n if (resolvedSrc !== resolvedDest) {\n if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {\n throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)\n }\n\n // prevent copy if src is a subdir of dest since unlinking\n // dest in this case would result in removing src contents\n // and therefore a broken symlink would be created.\n if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {\n throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)\n }\n }\n return copyLink(resolvedSrc, dest)\n }\n}\n\nfunction copyLink (resolvedSrc, dest) {\n fs.unlinkSync(dest)\n return fs.symlinkSync(resolvedSrc, dest)\n}\n\nmodule.exports = copySync\n","'use strict'\n\nconst u = require('universalify').fromPromise\nmodule.exports = {\n copy: u(require('./copy')),\n copySync: require('./copy-sync')\n}\n","'use strict'\n\nconst fs = require('graceful-fs')\nconst u = require('universalify').fromCallback\n\nfunction remove (path, callback) {\n fs.rm(path, { recursive: true, force: true }, callback)\n}\n\nfunction removeSync (path) {\n fs.rmSync(path, { recursive: true, force: true })\n}\n\nmodule.exports = {\n remove: u(remove),\n removeSync\n}\n","'use strict'\n\nconst u = require('universalify').fromPromise\nconst fs = require('../fs')\nconst path = require('path')\nconst mkdir = require('../mkdirs')\nconst remove = require('../remove')\n\nconst emptyDir = u(async function emptyDir (dir) {\n let items\n try {\n items = await fs.readdir(dir)\n } catch {\n return mkdir.mkdirs(dir)\n }\n\n return Promise.all(items.map(item => remove.remove(path.join(dir, item))))\n})\n\nfunction emptyDirSync (dir) {\n let items\n try {\n items = fs.readdirSync(dir)\n } catch {\n return mkdir.mkdirsSync(dir)\n }\n\n items.forEach(item => {\n item = path.join(dir, item)\n remove.removeSync(item)\n })\n}\n\nmodule.exports = {\n emptyDirSync,\n emptydirSync: emptyDirSync,\n emptyDir,\n emptydir: emptyDir\n}\n","'use strict'\n\nconst u = require('universalify').fromPromise\nconst path = require('path')\nconst fs = require('../fs')\nconst mkdir = require('../mkdirs')\n\nasync function createFile (file) {\n let stats\n try {\n stats = await fs.stat(file)\n } catch { }\n if (stats && stats.isFile()) return\n\n const dir = path.dirname(file)\n\n let dirStats = null\n try {\n dirStats = await fs.stat(dir)\n } catch (err) {\n // if the directory doesn't exist, make it\n if (err.code === 'ENOENT') {\n await mkdir.mkdirs(dir)\n await fs.writeFile(file, '')\n return\n } else {\n throw err\n }\n }\n\n if (dirStats.isDirectory()) {\n await fs.writeFile(file, '')\n } else {\n // parent is not a directory\n // This is just to cause an internal ENOTDIR error to be thrown\n await fs.readdir(dir)\n }\n}\n\nfunction createFileSync (file) {\n let stats\n try {\n stats = fs.statSync(file)\n } catch { }\n if (stats && stats.isFile()) return\n\n const dir = path.dirname(file)\n try {\n if (!fs.statSync(dir).isDirectory()) {\n // parent is not a directory\n // This is just to cause an internal ENOTDIR error to be thrown\n fs.readdirSync(dir)\n }\n } catch (err) {\n // If the stat call above failed because the directory doesn't exist, create it\n if (err && err.code === 'ENOENT') mkdir.mkdirsSync(dir)\n else throw err\n }\n\n fs.writeFileSync(file, '')\n}\n\nmodule.exports = {\n createFile: u(createFile),\n createFileSync\n}\n","'use strict'\n\nconst u = require('universalify').fromPromise\nconst path = require('path')\nconst fs = require('../fs')\nconst mkdir = require('../mkdirs')\nconst { pathExists } = require('../path-exists')\nconst { areIdentical } = require('../util/stat')\n\nasync function createLink (srcpath, dstpath) {\n let dstStat\n try {\n dstStat = await fs.lstat(dstpath, { bigint: true })\n } catch {\n // ignore error\n }\n\n let srcStat\n try {\n srcStat = await fs.lstat(srcpath, { bigint: true })\n } catch (err) {\n err.message = err.message.replace('lstat', 'ensureLink')\n throw err\n }\n\n if (dstStat && areIdentical(srcStat, dstStat)) return\n\n const dir = path.dirname(dstpath)\n\n const dirExists = await pathExists(dir)\n\n if (!dirExists) {\n await mkdir.mkdirs(dir)\n }\n\n await fs.link(srcpath, dstpath)\n}\n\nfunction createLinkSync (srcpath, dstpath) {\n let dstStat\n try {\n dstStat = fs.lstatSync(dstpath, { bigint: true })\n } catch {}\n\n try {\n const srcStat = fs.lstatSync(srcpath, { bigint: true })\n if (dstStat && areIdentical(srcStat, dstStat)) return\n } catch (err) {\n err.message = err.message.replace('lstat', 'ensureLink')\n throw err\n }\n\n const dir = path.dirname(dstpath)\n const dirExists = fs.existsSync(dir)\n if (dirExists) return fs.linkSync(srcpath, dstpath)\n mkdir.mkdirsSync(dir)\n\n return fs.linkSync(srcpath, dstpath)\n}\n\nmodule.exports = {\n createLink: u(createLink),\n createLinkSync\n}\n","'use strict'\n\nconst path = require('path')\nconst fs = require('../fs')\nconst { pathExists } = require('../path-exists')\n\nconst u = require('universalify').fromPromise\n\n/**\n * Function that returns two types of paths, one relative to symlink, and one\n * relative to the current working directory. Checks if path is absolute or\n * relative. If the path is relative, this function checks if the path is\n * relative to symlink or relative to current working directory. This is an\n * initiative to find a smarter `srcpath` to supply when building symlinks.\n * This allows you to determine which path to use out of one of three possible\n * types of source paths. The first is an absolute path. This is detected by\n * `path.isAbsolute()`. When an absolute path is provided, it is checked to\n * see if it exists. If it does it's used, if not an error is returned\n * (callback)/ thrown (sync). The other two options for `srcpath` are a\n * relative url. By default Node's `fs.symlink` works by creating a symlink\n * using `dstpath` and expects the `srcpath` to be relative to the newly\n * created symlink. If you provide a `srcpath` that does not exist on the file\n * system it results in a broken symlink. To minimize this, the function\n * checks to see if the 'relative to symlink' source file exists, and if it\n * does it will use it. If it does not, it checks if there's a file that\n * exists that is relative to the current working directory, if does its used.\n * This preserves the expectations of the original fs.symlink spec and adds\n * the ability to pass in `relative to current working direcotry` paths.\n */\n\nasync function symlinkPaths (srcpath, dstpath) {\n if (path.isAbsolute(srcpath)) {\n try {\n await fs.lstat(srcpath)\n } catch (err) {\n err.message = err.message.replace('lstat', 'ensureSymlink')\n throw err\n }\n\n return {\n toCwd: srcpath,\n toDst: srcpath\n }\n }\n\n const dstdir = path.dirname(dstpath)\n const relativeToDst = path.join(dstdir, srcpath)\n\n const exists = await pathExists(relativeToDst)\n if (exists) {\n return {\n toCwd: relativeToDst,\n toDst: srcpath\n }\n }\n\n try {\n await fs.lstat(srcpath)\n } catch (err) {\n err.message = err.message.replace('lstat', 'ensureSymlink')\n throw err\n }\n\n return {\n toCwd: srcpath,\n toDst: path.relative(dstdir, srcpath)\n }\n}\n\nfunction symlinkPathsSync (srcpath, dstpath) {\n if (path.isAbsolute(srcpath)) {\n const exists = fs.existsSync(srcpath)\n if (!exists) throw new Error('absolute srcpath does not exist')\n return {\n toCwd: srcpath,\n toDst: srcpath\n }\n }\n\n const dstdir = path.dirname(dstpath)\n const relativeToDst = path.join(dstdir, srcpath)\n const exists = fs.existsSync(relativeToDst)\n if (exists) {\n return {\n toCwd: relativeToDst,\n toDst: srcpath\n }\n }\n\n const srcExists = fs.existsSync(srcpath)\n if (!srcExists) throw new Error('relative srcpath does not exist')\n return {\n toCwd: srcpath,\n toDst: path.relative(dstdir, srcpath)\n }\n}\n\nmodule.exports = {\n symlinkPaths: u(symlinkPaths),\n symlinkPathsSync\n}\n","'use strict'\n\nconst fs = require('../fs')\nconst u = require('universalify').fromPromise\n\nasync function symlinkType (srcpath, type) {\n if (type) return type\n\n let stats\n try {\n stats = await fs.lstat(srcpath)\n } catch {\n return 'file'\n }\n\n return (stats && stats.isDirectory()) ? 'dir' : 'file'\n}\n\nfunction symlinkTypeSync (srcpath, type) {\n if (type) return type\n\n let stats\n try {\n stats = fs.lstatSync(srcpath)\n } catch {\n return 'file'\n }\n return (stats && stats.isDirectory()) ? 'dir' : 'file'\n}\n\nmodule.exports = {\n symlinkType: u(symlinkType),\n symlinkTypeSync\n}\n","'use strict'\n\nconst u = require('universalify').fromPromise\nconst path = require('path')\nconst fs = require('../fs')\n\nconst { mkdirs, mkdirsSync } = require('../mkdirs')\n\nconst { symlinkPaths, symlinkPathsSync } = require('./symlink-paths')\nconst { symlinkType, symlinkTypeSync } = require('./symlink-type')\n\nconst { pathExists } = require('../path-exists')\n\nconst { areIdentical } = require('../util/stat')\n\nasync function createSymlink (srcpath, dstpath, type) {\n let stats\n try {\n stats = await fs.lstat(dstpath)\n } catch { }\n\n if (stats && stats.isSymbolicLink()) {\n // When srcpath is relative, resolve it relative to dstpath's directory\n // (standard symlink behavior) or fall back to cwd if that doesn't exist\n let srcStat\n if (path.isAbsolute(srcpath)) {\n srcStat = await fs.stat(srcpath, { bigint: true })\n } else {\n const dstdir = path.dirname(dstpath)\n const relativeToDst = path.join(dstdir, srcpath)\n try {\n srcStat = await fs.stat(relativeToDst, { bigint: true })\n } catch {\n srcStat = await fs.stat(srcpath, { bigint: true })\n }\n }\n\n // Following the existing symlink fails with ENOENT if it's broken; in that\n // case fall through so fs.symlink reports EEXIST, rather than leaking the\n // stat ENOENT. Any other error is unexpected, so rethrow it.\n let dstStat\n try {\n dstStat = await fs.stat(dstpath, { bigint: true })\n } catch (err) {\n if (err.code !== 'ENOENT') throw err\n }\n if (dstStat && areIdentical(srcStat, dstStat)) return\n }\n\n const relative = await symlinkPaths(srcpath, dstpath)\n srcpath = relative.toDst\n const toType = await symlinkType(relative.toCwd, type)\n const dir = path.dirname(dstpath)\n\n if (!(await pathExists(dir))) {\n await mkdirs(dir)\n }\n\n return fs.symlink(srcpath, dstpath, toType)\n}\n\nfunction createSymlinkSync (srcpath, dstpath, type) {\n let stats\n try {\n stats = fs.lstatSync(dstpath)\n } catch { }\n if (stats && stats.isSymbolicLink()) {\n // When srcpath is relative, resolve it relative to dstpath's directory\n // (standard symlink behavior) or fall back to cwd if that doesn't exist\n let srcStat\n if (path.isAbsolute(srcpath)) {\n srcStat = fs.statSync(srcpath, { bigint: true })\n } else {\n const dstdir = path.dirname(dstpath)\n const relativeToDst = path.join(dstdir, srcpath)\n try {\n srcStat = fs.statSync(relativeToDst, { bigint: true })\n } catch {\n srcStat = fs.statSync(srcpath, { bigint: true })\n }\n }\n\n // Following the existing symlink fails with ENOENT if it's broken; in that\n // case fall through so fs.symlinkSync reports EEXIST, rather than leaking the\n // stat ENOENT. Any other error is unexpected, so rethrow it.\n let dstStat\n try {\n dstStat = fs.statSync(dstpath, { bigint: true })\n } catch (err) {\n if (err.code !== 'ENOENT') throw err\n }\n if (dstStat && areIdentical(srcStat, dstStat)) return\n }\n\n const relative = symlinkPathsSync(srcpath, dstpath)\n srcpath = relative.toDst\n type = symlinkTypeSync(relative.toCwd, type)\n const dir = path.dirname(dstpath)\n const exists = fs.existsSync(dir)\n if (exists) return fs.symlinkSync(srcpath, dstpath, type)\n mkdirsSync(dir)\n return fs.symlinkSync(srcpath, dstpath, type)\n}\n\nmodule.exports = {\n createSymlink: u(createSymlink),\n createSymlinkSync\n}\n","'use strict'\n\nconst { createFile, createFileSync } = require('./file')\nconst { createLink, createLinkSync } = require('./link')\nconst { createSymlink, createSymlinkSync } = require('./symlink')\n\nmodule.exports = {\n // file\n createFile,\n createFileSync,\n ensureFile: createFile,\n ensureFileSync: createFileSync,\n // link\n createLink,\n createLinkSync,\n ensureLink: createLink,\n ensureLinkSync: createLinkSync,\n // symlink\n createSymlink,\n createSymlinkSync,\n ensureSymlink: createSymlink,\n ensureSymlinkSync: createSymlinkSync\n}\n","function stringify (obj, { EOL = '\\n', finalEOL = true, replacer = null, spaces } = {}) {\n const EOF = finalEOL ? EOL : ''\n const str = JSON.stringify(obj, replacer, spaces)\n\n if (str === undefined) {\n throw new TypeError(`Converting ${typeof obj} value to JSON is not supported`)\n }\n\n return str.replace(/\\n/g, EOL) + EOF\n}\n\nfunction stripBom (content) {\n // we do this because JSON.parse would convert it to a utf8 string if encoding wasn't specified\n if (Buffer.isBuffer(content)) content = content.toString('utf8')\n return content.replace(/^\\uFEFF/, '')\n}\n\nmodule.exports = { stringify, stripBom }\n","let _fs\ntry {\n _fs = require('graceful-fs')\n} catch (_) {\n _fs = require('fs')\n}\nconst universalify = require('universalify')\nconst { stringify, stripBom } = require('./utils')\n\nasync function _readFile (file, options = {}) {\n if (typeof options === 'string') {\n options = { encoding: options }\n }\n\n const fs = options.fs || _fs\n\n const shouldThrow = 'throws' in options ? options.throws : true\n\n let data = await universalify.fromCallback(fs.readFile)(file, options)\n\n data = stripBom(data)\n\n let obj\n try {\n obj = JSON.parse(data, options ? options.reviver : null)\n } catch (err) {\n if (shouldThrow) {\n err.message = `${file}: ${err.message}`\n throw err\n } else {\n return null\n }\n }\n\n return obj\n}\n\nconst readFile = universalify.fromPromise(_readFile)\n\nfunction readFileSync (file, options = {}) {\n if (typeof options === 'string') {\n options = { encoding: options }\n }\n\n const fs = options.fs || _fs\n\n const shouldThrow = 'throws' in options ? options.throws : true\n\n try {\n let content = fs.readFileSync(file, options)\n content = stripBom(content)\n return JSON.parse(content, options.reviver)\n } catch (err) {\n if (shouldThrow) {\n err.message = `${file}: ${err.message}`\n throw err\n } else {\n return null\n }\n }\n}\n\nasync function _writeFile (file, obj, options = {}) {\n const fs = options.fs || _fs\n\n const str = stringify(obj, options)\n\n await universalify.fromCallback(fs.writeFile)(file, str, options)\n}\n\nconst writeFile = universalify.fromPromise(_writeFile)\n\nfunction writeFileSync (file, obj, options = {}) {\n const fs = options.fs || _fs\n\n const str = stringify(obj, options)\n // not sure if fs.writeFileSync returns anything, but just in case\n return fs.writeFileSync(file, str, options)\n}\n\n// NOTE: do not change this export format; required for ESM compat\n// see https://github.com/jprichardson/node-jsonfile/pull/162 for details\nmodule.exports = {\n readFile,\n readFileSync,\n writeFile,\n writeFileSync\n}\n","'use strict'\n\nconst jsonFile = require('jsonfile')\n\nmodule.exports = {\n // jsonfile exports\n readJson: jsonFile.readFile,\n readJsonSync: jsonFile.readFileSync,\n writeJson: jsonFile.writeFile,\n writeJsonSync: jsonFile.writeFileSync\n}\n","'use strict'\n\nconst u = require('universalify').fromPromise\nconst fs = require('../fs')\nconst path = require('path')\nconst mkdir = require('../mkdirs')\nconst pathExists = require('../path-exists').pathExists\n\nasync function outputFile (file, data, encoding = 'utf-8') {\n const dir = path.dirname(file)\n\n if (!(await pathExists(dir))) {\n await mkdir.mkdirs(dir)\n }\n\n return fs.writeFile(file, data, encoding)\n}\n\nfunction outputFileSync (file, ...args) {\n const dir = path.dirname(file)\n if (!fs.existsSync(dir)) {\n mkdir.mkdirsSync(dir)\n }\n\n fs.writeFileSync(file, ...args)\n}\n\nmodule.exports = {\n outputFile: u(outputFile),\n outputFileSync\n}\n","'use strict'\n\nconst { stringify } = require('jsonfile/utils')\nconst { outputFile } = require('../output-file')\n\nasync function outputJson (file, data, options = {}) {\n const str = stringify(data, options)\n\n await outputFile(file, str, options)\n}\n\nmodule.exports = outputJson\n","'use strict'\n\nconst { stringify } = require('jsonfile/utils')\nconst { outputFileSync } = require('../output-file')\n\nfunction outputJsonSync (file, data, options) {\n const str = stringify(data, options)\n\n outputFileSync(file, str, options)\n}\n\nmodule.exports = outputJsonSync\n","'use strict'\n\nconst u = require('universalify').fromPromise\nconst jsonFile = require('./jsonfile')\n\njsonFile.outputJson = u(require('./output-json'))\njsonFile.outputJsonSync = require('./output-json-sync')\n// aliases\njsonFile.outputJSON = jsonFile.outputJson\njsonFile.outputJSONSync = jsonFile.outputJsonSync\njsonFile.writeJSON = jsonFile.writeJson\njsonFile.writeJSONSync = jsonFile.writeJsonSync\njsonFile.readJSON = jsonFile.readJson\njsonFile.readJSONSync = jsonFile.readJsonSync\n\nmodule.exports = jsonFile\n","'use strict'\n\nconst fs = require('../fs')\nconst path = require('path')\nconst { copy } = require('../copy')\nconst { remove } = require('../remove')\nconst { mkdirp } = require('../mkdirs')\nconst { pathExists } = require('../path-exists')\nconst stat = require('../util/stat')\n\nasync function move (src, dest, opts = {}) {\n const overwrite = opts.overwrite || opts.clobber || false\n\n const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, 'move', opts)\n\n await stat.checkParentPaths(src, srcStat, dest, 'move')\n\n // If the parent of dest is not root, make sure it exists before proceeding\n const destParent = path.dirname(dest)\n const parsedParentPath = path.parse(destParent)\n if (parsedParentPath.root !== destParent) {\n await mkdirp(destParent)\n }\n\n return doRename(src, dest, overwrite, isChangingCase)\n}\n\nasync function doRename (src, dest, overwrite, isChangingCase) {\n if (!isChangingCase) {\n if (overwrite) {\n await remove(dest)\n } else if (await pathExists(dest)) {\n throw new Error('dest already exists.')\n }\n }\n\n try {\n // Try w/ rename first, and try copy + remove if EXDEV\n await fs.rename(src, dest)\n } catch (err) {\n if (err.code !== 'EXDEV') {\n throw err\n }\n await moveAcrossDevice(src, dest, overwrite)\n }\n}\n\nasync function moveAcrossDevice (src, dest, overwrite) {\n const opts = {\n overwrite,\n errorOnExist: true,\n preserveTimestamps: true\n }\n\n await copy(src, dest, opts)\n return remove(src)\n}\n\nmodule.exports = move\n","'use strict'\n\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst copySync = require('../copy').copySync\nconst removeSync = require('../remove').removeSync\nconst mkdirpSync = require('../mkdirs').mkdirpSync\nconst stat = require('../util/stat')\n\nfunction moveSync (src, dest, opts) {\n opts = opts || {}\n const overwrite = opts.overwrite || opts.clobber || false\n\n const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, 'move', opts)\n stat.checkParentPathsSync(src, srcStat, dest, 'move')\n if (!isParentRoot(dest)) mkdirpSync(path.dirname(dest))\n return doRename(src, dest, overwrite, isChangingCase)\n}\n\nfunction isParentRoot (dest) {\n const parent = path.dirname(dest)\n const parsedPath = path.parse(parent)\n return parsedPath.root === parent\n}\n\nfunction doRename (src, dest, overwrite, isChangingCase) {\n if (isChangingCase) return rename(src, dest, overwrite)\n if (overwrite) {\n removeSync(dest)\n return rename(src, dest, overwrite)\n }\n if (fs.existsSync(dest)) throw new Error('dest already exists.')\n return rename(src, dest, overwrite)\n}\n\nfunction rename (src, dest, overwrite) {\n try {\n fs.renameSync(src, dest)\n } catch (err) {\n if (err.code !== 'EXDEV') throw err\n return moveAcrossDevice(src, dest, overwrite)\n }\n}\n\nfunction moveAcrossDevice (src, dest, overwrite) {\n const opts = {\n overwrite,\n errorOnExist: true,\n preserveTimestamps: true\n }\n copySync(src, dest, opts)\n return removeSync(src)\n}\n\nmodule.exports = moveSync\n","'use strict'\n\nconst u = require('universalify').fromPromise\nmodule.exports = {\n move: u(require('./move')),\n moveSync: require('./move-sync')\n}\n","'use strict'\n\nmodule.exports = {\n // Export promiseified graceful-fs:\n ...require('./fs'),\n // Export extra methods:\n ...require('./copy'),\n ...require('./empty'),\n ...require('./ensure'),\n ...require('./json'),\n ...require('./mkdirs'),\n ...require('./move'),\n ...require('./output-file'),\n ...require('./path-exists'),\n ...require('./remove')\n}\n","import { homedir } from \"node:os\";\nimport { join } from \"node:path\";\n\nexport const IS_WINDOWS = process.platform === \"win32\";\nexport const HOME = homedir();\n\nexport const REPO_URL = \"https://github.com/ClubMediterranee/digital-api-team-skills.git\";\nexport const DEFAULT_INSTALL_DIR = join(HOME, \"workspaces\", \"digital-api-team-skills\");\nexport const ANTHROPIC_BASE_URL = \"https://apim-prdaiplatform-frc.azure-api.net/litellm-api/\";\nexport const LITELLM_BASE_URL = \"https://apim-prdaiplatform-frc.azure-api.net/litellm-api/v1\";\nexport const LITELLM_API_KEY = process.env[\"LITELLM_API_KEY\"];\nexport const CODEX_CONFIG_DIR = join(HOME, \".codex\");\nexport const CODEX_CONFIG_PATH = join(CODEX_CONFIG_DIR, \"config.toml\");\nexport const CODEX_MODELS_PATH = join(CODEX_CONFIG_DIR, \"clubmed-models.json\");\n\nexport const ENV_MARKER = \"# --- Club Med AI Tools ---\";\n\nexport const DEFAULT_MODELS = {\n fable: \"gmdt-swc-claude-fable-5\",\n opus: \"gmdt-swc-claude-opus-4-8\",\n sonnet: \"gmdt-swc-claude-sonnet-5\",\n haiku: \"gmdt-swc-claude-haiku-4-5\",\n codex: \"gmdt-swc-gpt-5.3-codex\"\n};\n\nexport const CLUBMED_API_KEY_DEFAULT = \"201801041426.test.clubmed.com\";\n\nexport type McpSection = Record<string, unknown>;\n\n/** JSON payloads passed to `codex mcp add-json <name> <json>` and `claude mcp add-json --scope user <name> <json>`. */\nexport const CODEX_MCP_SECTIONS: Record<string, string> = {\n clubmed_api: JSON.stringify({\n type: \"http\",\n url: \"https://portal.api.clubmed/mcp\",\n headers: { \"x-api-key\": \"${CLUBMED_API_MCP_KEY}\" }\n }),\n cms_api: JSON.stringify({\n type: \"http\",\n url: \"https://cms.api.clubmed/mcp\",\n headers: { Authorization: \"Bearer ${CMS_API_MCP_TOKEN}\" }\n }),\n atlassian: JSON.stringify({\n type: \"http\",\n url: \"https://mcp.atlassian.com/v1/mcp/authv2\",\n auth: { type: \"oauth\" }\n })\n};\n\n/** JSON payloads passed to `claude mcp add-json --scope user <name> <json>`. */\nexport const CLAUDE_MCP_SECTIONS: Record<string, string> = {\n clubmed_api: JSON.stringify({\n type: \"http\",\n url: \"https://portal.api.clubmed/mcp\",\n headers: { \"x-api-key\": \"${CLUBMED_API_MCP_KEY}\" }\n }),\n cms_api: JSON.stringify({\n type: \"http\",\n url: \"https://cms.api.clubmed/mcp\",\n headers: { Authorization: \"Bearer ${CMS_API_MCP_TOKEN}\" }\n })\n};\n\n/** Marketplace plugin to install via `claude plugin install`. */\nexport const CLAUDE_MARKETPLACE_PLUGINS = [\"atlassian@claude-plugins-official\"];\n\nexport const REQUIRED_ENV_VARS = [\n \"LITELLM_API_KEY\",\n \"ANTHROPIC_API_KEY\",\n \"ANTHROPIC_BASE_URL\",\n \"CLUBMED_API_MCP_KEY\",\n \"ANTHROPIC_DEFAULT_FABLE_MODEL\",\n \"ANTHROPIC_DEFAULT_OPUS_MODEL\",\n \"ANTHROPIC_DEFAULT_SONNET_MODEL\",\n \"ANTHROPIC_DEFAULT_HAIKU_MODEL\"\n] as const;\n\nexport const OPTIONAL_ENV_VARS = [\"CMS_API_MCP_TOKEN\"] as const;\n","export default function isPlainObject(value) {\n\tif (typeof value !== 'object' || value === null) {\n\t\treturn false;\n\t}\n\n\tconst prototype = Object.getPrototypeOf(value);\n\treturn (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value);\n}\n","import {fileURLToPath} from 'node:url';\n\n// Allow some arguments/options to be either a file path string or a file URL\nexport const safeNormalizeFileUrl = (file, name) => {\n\tconst fileString = normalizeFileUrl(normalizeDenoExecPath(file));\n\n\tif (typeof fileString !== 'string') {\n\t\tthrow new TypeError(`${name} must be a string or a file URL: ${fileString}.`);\n\t}\n\n\treturn fileString;\n};\n\n// In Deno node:process execPath is a special object, not just a string:\n// https://github.com/denoland/deno/blob/f460188e583f00144000aa0d8ade08218d47c3c1/ext/node/polyfills/process.ts#L344\nconst normalizeDenoExecPath = file => isDenoExecPath(file)\n\t? file.toString()\n\t: file;\n\nexport const isDenoExecPath = file => typeof file !== 'string'\n\t&& file\n\t&& Object.getPrototypeOf(file) === String.prototype;\n\n// Same but also allows other values, e.g. `boolean` for the `shell` option\nexport const normalizeFileUrl = file => file instanceof URL ? fileURLToPath(file) : file;\n","import isPlainObject from 'is-plain-obj';\nimport {safeNormalizeFileUrl} from '../arguments/file-url.js';\n\n// The command `arguments` and `options` are both optional.\n// This also does basic validation on them and on the command file.\nexport const normalizeParameters = (rawFile, rawArguments = [], rawOptions = {}) => {\n\tconst filePath = safeNormalizeFileUrl(rawFile, 'First argument');\n\tconst [commandArguments, options] = isPlainObject(rawArguments)\n\t\t? [[], rawArguments]\n\t\t: [rawArguments, rawOptions];\n\n\tif (!Array.isArray(commandArguments)) {\n\t\tthrow new TypeError(`Second argument must be either an array of arguments or an options object: ${commandArguments}`);\n\t}\n\n\tif (commandArguments.some(commandArgument => typeof commandArgument === 'object' && commandArgument !== null)) {\n\t\tthrow new TypeError(`Second argument must be an array of strings: ${commandArguments}`);\n\t}\n\n\tconst normalizedArguments = commandArguments.map(String);\n\tconst nullByteArgument = normalizedArguments.find(normalizedArgument => normalizedArgument.includes('\\0'));\n\tif (nullByteArgument !== undefined) {\n\t\tthrow new TypeError(`Arguments cannot contain null bytes (\"\\\\0\"): ${nullByteArgument}`);\n\t}\n\n\tif (!isPlainObject(options)) {\n\t\tthrow new TypeError(`Last argument must be an options object: ${options}`);\n\t}\n\n\t// Prevent prototype pollution by copying only own properties to a null-prototype object\n\treturn [filePath, normalizedArguments, {__proto__: null, ...options}];\n};\n","import {StringDecoder} from 'node:string_decoder';\n\nconst {toString: objectToString} = Object.prototype;\n\nexport const isArrayBuffer = value => objectToString.call(value) === '[object ArrayBuffer]';\n\n// Is either Uint8Array or Buffer\nexport const isUint8Array = value => objectToString.call(value) === '[object Uint8Array]';\n\nexport const bufferToUint8Array = buffer => new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength);\n\nconst textEncoder = new TextEncoder();\nconst stringToUint8Array = string => textEncoder.encode(string);\n\nconst textDecoder = new TextDecoder();\nexport const uint8ArrayToString = uint8Array => textDecoder.decode(uint8Array);\n\nexport const joinToString = (uint8ArraysOrStrings, encoding) => {\n\tconst strings = uint8ArraysToStrings(uint8ArraysOrStrings, encoding);\n\treturn strings.join('');\n};\n\nconst uint8ArraysToStrings = (uint8ArraysOrStrings, encoding) => {\n\tif (encoding === 'utf8' && uint8ArraysOrStrings.every(uint8ArrayOrString => typeof uint8ArrayOrString === 'string')) {\n\t\treturn uint8ArraysOrStrings;\n\t}\n\n\tconst decoder = new StringDecoder(encoding);\n\tconst strings = uint8ArraysOrStrings\n\t\t.map(uint8ArrayOrString => typeof uint8ArrayOrString === 'string'\n\t\t\t? stringToUint8Array(uint8ArrayOrString)\n\t\t\t: uint8ArrayOrString)\n\t\t.map(uint8Array => decoder.write(uint8Array));\n\tconst finalString = decoder.end();\n\treturn finalString === '' ? strings : [...strings, finalString];\n};\n\nexport const joinToUint8Array = uint8ArraysOrStrings => {\n\tif (uint8ArraysOrStrings.length === 1 && isUint8Array(uint8ArraysOrStrings[0])) {\n\t\treturn uint8ArraysOrStrings[0];\n\t}\n\n\treturn concatUint8Arrays(stringsToUint8Arrays(uint8ArraysOrStrings));\n};\n\nconst stringsToUint8Arrays = uint8ArraysOrStrings => uint8ArraysOrStrings.map(uint8ArrayOrString => typeof uint8ArrayOrString === 'string'\n\t? stringToUint8Array(uint8ArrayOrString)\n\t: uint8ArrayOrString);\n\nexport const concatUint8Arrays = uint8Arrays => {\n\tconst result = new Uint8Array(getJoinLength(uint8Arrays));\n\n\tlet index = 0;\n\tfor (const uint8Array of uint8Arrays) {\n\t\tresult.set(uint8Array, index);\n\t\tindex += uint8Array.length;\n\t}\n\n\treturn result;\n};\n\nconst getJoinLength = uint8Arrays => {\n\tlet joinLength = 0;\n\tfor (const uint8Array of uint8Arrays) {\n\t\tjoinLength += uint8Array.length;\n\t}\n\n\treturn joinLength;\n};\n","import {ChildProcess} from 'node:child_process';\nimport isPlainObject from 'is-plain-obj';\nimport {isUint8Array, uint8ArrayToString} from '../utils/uint-array.js';\n\n// Check whether the template string syntax is being used\nexport const isTemplateString = templates => Array.isArray(templates) && Array.isArray(templates.raw);\n\n// Convert execa`file ...commandArguments` to execa(file, commandArguments)\nexport const parseTemplates = (templates, expressions) => {\n\tlet tokens = [];\n\n\tfor (const [index, template] of templates.entries()) {\n\t\ttokens = parseTemplate({\n\t\t\ttemplates,\n\t\t\texpressions,\n\t\t\ttokens,\n\t\t\tindex,\n\t\t\ttemplate,\n\t\t});\n\t}\n\n\tif (tokens.length === 0) {\n\t\tthrow new TypeError('Template script must not be empty');\n\t}\n\n\tconst [file, ...commandArguments] = tokens;\n\treturn [file, commandArguments, {}];\n};\n\nconst parseTemplate = ({templates, expressions, tokens, index, template}) => {\n\tif (template === undefined) {\n\t\tthrow new TypeError(`Invalid backslash sequence: ${templates.raw[index]}`);\n\t}\n\n\tconst {nextTokens, leadingWhitespaces, trailingWhitespaces} = splitByWhitespaces(template, templates.raw[index]);\n\tconst newTokens = concatTokens(tokens, nextTokens, leadingWhitespaces);\n\n\tif (index === expressions.length) {\n\t\treturn newTokens;\n\t}\n\n\tconst expression = expressions[index];\n\tconst expressionTokens = Array.isArray(expression)\n\t\t? expression.map(expression => parseExpression(expression))\n\t\t: [parseExpression(expression)];\n\treturn concatTokens(newTokens, expressionTokens, trailingWhitespaces);\n};\n\n// Like `string.split(/[ \\t\\r\\n]+/)` except newlines and tabs are:\n// - ignored when input as a backslash sequence like: `echo foo\\n bar`\n// - not ignored when input directly\n// The only way to distinguish those in JavaScript is to use a tagged template and compare:\n// - the first array argument, which does not escape backslash sequences\n// - its `raw` property, which escapes them\nconst splitByWhitespaces = (template, rawTemplate) => {\n\tif (rawTemplate.length === 0) {\n\t\treturn {nextTokens: [], leadingWhitespaces: false, trailingWhitespaces: false};\n\t}\n\n\tconst nextTokens = [];\n\tlet templateStart = 0;\n\tconst isLeadingWhitespaces = DELIMITERS.has(rawTemplate[0]);\n\n\tfor (\n\t\tlet templateIndex = 0, rawIndex = 0;\n\t\ttemplateIndex < template.length;\n\t\ttemplateIndex += 1, rawIndex += 1\n\t) {\n\t\tconst rawCharacter = rawTemplate[rawIndex];\n\t\tif (DELIMITERS.has(rawCharacter)) {\n\t\t\tif (templateStart !== templateIndex) {\n\t\t\t\tnextTokens.push(template.slice(templateStart, templateIndex));\n\t\t\t}\n\n\t\t\ttemplateStart = templateIndex + 1;\n\t\t} else if (rawCharacter === '\\\\') {\n\t\t\tconst nextRawCharacter = rawTemplate[rawIndex + 1];\n\t\t\tif (nextRawCharacter === '\\n') {\n\t\t\t\t// Handles escaped newlines in templates\n\t\t\t\ttemplateIndex -= 1;\n\t\t\t\trawIndex += 1;\n\t\t\t} else if (nextRawCharacter === 'u' && rawTemplate[rawIndex + 2] === '{') {\n\t\t\t\trawIndex = rawTemplate.indexOf('}', rawIndex + 3);\n\t\t\t} else {\n\t\t\t\trawIndex += ESCAPE_LENGTH[nextRawCharacter] ?? 1;\n\t\t\t}\n\t\t}\n\t}\n\n\tconst isTrailingWhitespaces = templateStart === template.length;\n\tif (!isTrailingWhitespaces) {\n\t\tnextTokens.push(template.slice(templateStart));\n\t}\n\n\treturn {nextTokens, leadingWhitespaces: isLeadingWhitespaces, trailingWhitespaces: isTrailingWhitespaces};\n};\n\nconst DELIMITERS = new Set([' ', '\\t', '\\r', '\\n']);\n\n// Number of characters in backslash escape sequences: \\0 \\xXX or \\uXXXX\n// \\cX is allowed in RegExps but not in strings\n// Octal sequences are not allowed in strict mode\nconst ESCAPE_LENGTH = {x: 3, u: 5};\n\nconst concatTokens = (tokens, nextTokens, isSeparated) => isSeparated\n\t|| tokens.length === 0\n\t|| nextTokens.length === 0\n\t? [...tokens, ...nextTokens]\n\t: [\n\t\t...tokens.slice(0, -1),\n\t\t`${tokens.at(-1)}${nextTokens[0]}`,\n\t\t...nextTokens.slice(1),\n\t];\n\n// Handle `${expression}` inside the template string syntax\nconst parseExpression = expression => {\n\tconst typeOfExpression = typeof expression;\n\n\tif (typeOfExpression === 'string') {\n\t\treturn expression;\n\t}\n\n\tif (typeOfExpression === 'number') {\n\t\treturn String(expression);\n\t}\n\n\tif (isPlainObject(expression) && ('stdout' in expression || 'isMaxBuffer' in expression)) {\n\t\treturn getSubprocessResult(expression);\n\t}\n\n\tif (expression instanceof ChildProcess || Object.prototype.toString.call(expression) === '[object Promise]') {\n\t\t// eslint-disable-next-line no-template-curly-in-string\n\t\tthrow new TypeError('Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}.');\n\t}\n\n\tthrow new TypeError(`Unexpected \"${typeOfExpression}\" in template expression`);\n};\n\nconst getSubprocessResult = ({stdout}) => {\n\tif (typeof stdout === 'string') {\n\t\treturn stdout;\n\t}\n\n\tif (isUint8Array(stdout)) {\n\t\treturn uint8ArrayToString(stdout);\n\t}\n\n\tif (stdout === undefined) {\n\t\tthrow new TypeError('Missing result.stdout in template expression. This is probably due to the previous subprocess\\' \"stdout\" option.');\n\t}\n\n\tthrow new TypeError(`Unexpected \"${typeof stdout}\" stdout in template expression`);\n};\n","import process from 'node:process';\n\nexport const isStandardStream = stream => STANDARD_STREAMS.includes(stream);\nexport const STANDARD_STREAMS = [process.stdin, process.stdout, process.stderr];\nexport const STANDARD_STREAMS_ALIASES = ['stdin', 'stdout', 'stderr'];\nexport const getStreamName = fdNumber => STANDARD_STREAMS_ALIASES[fdNumber] ?? `stdio[${fdNumber}]`;\n","import {debuglog} from 'node:util';\nimport isPlainObject from 'is-plain-obj';\nimport {STANDARD_STREAMS_ALIASES} from '../utils/standard-stream.js';\n\n// Some options can have different values for `stdout`/`stderr`/`fd3`.\n// This normalizes those to array of values.\n// For example, `{verbose: {stdout: 'none', stderr: 'full'}}` becomes `{verbose: ['none', 'none', 'full']}`\nexport const normalizeFdSpecificOptions = options => {\n\tconst optionsCopy = {...options};\n\n\tfor (const optionName of FD_SPECIFIC_OPTIONS) {\n\t\toptionsCopy[optionName] = normalizeFdSpecificOption(options, optionName);\n\t}\n\n\treturn optionsCopy;\n};\n\nexport const normalizeFdSpecificOption = (options, optionName) => {\n\tconst stdioLength = getStdioLength(options);\n\tconst optionBaseArray = Array.from({length: stdioLength + 1});\n\tconst optionArray = normalizeFdSpecificValue(options[optionName], optionBaseArray, optionName, stdioLength);\n\treturn addDefaultValue(optionArray, optionName);\n};\n\nconst getStdioLength = ({stdio}) => Array.isArray(stdio)\n\t? Math.max(stdio.length, STANDARD_STREAMS_ALIASES.length)\n\t: STANDARD_STREAMS_ALIASES.length;\n\nconst normalizeFdSpecificValue = (optionValue, optionArray, optionName, stdioLength) => isPlainObject(optionValue)\n\t? normalizeOptionObject(optionValue, optionArray, optionName, stdioLength)\n\t: optionArray.fill(optionValue);\n\nconst normalizeOptionObject = (optionValue, optionArray, optionName, stdioLength) => {\n\tfor (const fdName of Object.keys(optionValue).sort(compareFdName)) {\n\t\tfor (const fdNumber of parseFdName(fdName, optionName, stdioLength)) {\n\t\t\toptionArray[fdNumber] = optionValue[fdName];\n\t\t}\n\t}\n\n\treturn optionArray;\n};\n\n// Ensure priority order when setting both `stdout`/`stderr`, `fd1`/`fd2`, and `all`\nconst compareFdName = (fdNameA, fdNameB) => getFdNameOrder(fdNameA) < getFdNameOrder(fdNameB) ? 1 : -1;\n\nconst getFdNameOrder = fdName => {\n\tif (fdName === 'stdout' || fdName === 'stderr') {\n\t\treturn 0;\n\t}\n\n\treturn fdName === 'all' ? 2 : 1;\n};\n\nconst parseFdName = (fdName, optionName, stdioLength) => {\n\tif (fdName === 'ipc') {\n\t\treturn [stdioLength];\n\t}\n\n\tconst fdNumber = parseFd(fdName);\n\tif (fdNumber === undefined || fdNumber === 0) {\n\t\tthrow new TypeError(`\"${optionName}.${fdName}\" is invalid.\nIt must be \"${optionName}.stdout\", \"${optionName}.stderr\", \"${optionName}.all\", \"${optionName}.ipc\", or \"${optionName}.fd3\", \"${optionName}.fd4\" (and so on).`);\n\t}\n\n\tif (fdNumber !== 'all' && fdNumber >= stdioLength) {\n\t\tthrow new TypeError(`\"${optionName}.${fdName}\" is invalid: that file descriptor does not exist.\nPlease set the \"stdio\" option to ensure that file descriptor exists.`);\n\t}\n\n\treturn fdNumber === 'all' ? [1, 2] : [fdNumber];\n};\n\n// Use the same syntax for fd-specific options and the `from`/`to` options\nexport const parseFd = fdName => {\n\tif (fdName === 'all') {\n\t\treturn fdName;\n\t}\n\n\tif (STANDARD_STREAMS_ALIASES.includes(fdName)) {\n\t\treturn STANDARD_STREAMS_ALIASES.indexOf(fdName);\n\t}\n\n\tconst regexpResult = FD_REGEXP.exec(fdName);\n\tif (regexpResult !== null) {\n\t\treturn Number(regexpResult.groups.fdNumber);\n\t}\n};\n\nconst FD_REGEXP = /^fd(?<fdNumber>\\d+)$/;\n\nconst addDefaultValue = (optionArray, optionName) => optionArray.map(optionValue => optionValue === undefined\n\t? DEFAULT_OPTIONS[optionName]\n\t: optionValue);\n\n// Default value for the `verbose` option\nconst verboseDefault = debuglog('execa').enabled ? 'full' : 'none';\n\nconst DEFAULT_OPTIONS = {\n\tlines: false,\n\tbuffer: true,\n\tmaxBuffer: 1000 * 1000 * 100,\n\tverbose: verboseDefault,\n\tstripFinalNewline: true,\n};\n\n// List of options which can have different values for `stdout`/`stderr`\nexport const FD_SPECIFIC_OPTIONS = ['lines', 'buffer', 'maxBuffer', 'verbose', 'stripFinalNewline'];\n\n// Retrieve fd-specific option\nexport const getFdSpecificValue = (optionArray, fdNumber) => fdNumber === 'ipc'\n\t? optionArray.at(-1)\n\t: optionArray[fdNumber];\n","import {getFdSpecificValue} from '../arguments/specific.js';\n\n// The `verbose` option can have different values for `stdout`/`stderr`\nexport const isVerbose = ({verbose}, fdNumber) => getFdVerbose(verbose, fdNumber) !== 'none';\n\n// Whether IPC and output and logged\nexport const isFullVerbose = ({verbose}, fdNumber) => !['none', 'short'].includes(getFdVerbose(verbose, fdNumber));\n\n// The `verbose` option can be a function to customize logging\nexport const getVerboseFunction = ({verbose}, fdNumber) => {\n\tconst fdVerbose = getFdVerbose(verbose, fdNumber);\n\treturn isVerboseFunction(fdVerbose) ? fdVerbose : undefined;\n};\n\n// When using `verbose: {stdout, stderr, fd3, ipc}`:\n// - `verbose.stdout|stderr|fd3` is used for 'output'\n// - `verbose.ipc` is only used for 'ipc'\n// - highest `verbose.*` value is used for 'command', 'error' and 'duration'\nconst getFdVerbose = (verbose, fdNumber) => fdNumber === undefined\n\t? getFdGenericVerbose(verbose)\n\t: getFdSpecificValue(verbose, fdNumber);\n\n// When using `verbose: {stdout, stderr, fd3, ipc}` and logging is not specific to a file descriptor.\n// We then use the highest `verbose.*` value, using the following order:\n// - function > 'full' > 'short' > 'none'\n// - if several functions are defined: stdout > stderr > fd3 > ipc\nconst getFdGenericVerbose = verbose => verbose.find(fdVerbose => isVerboseFunction(fdVerbose))\n\t?? VERBOSE_VALUES.findLast(fdVerbose => verbose.includes(fdVerbose));\n\n// Whether the `verbose` option is customized using a function\nexport const isVerboseFunction = fdVerbose => typeof fdVerbose === 'function';\n\nexport const VERBOSE_VALUES = ['none', 'short', 'full'];\n","import {platform} from 'node:process';\nimport {stripVTControlCharacters} from 'node:util';\n\n// Compute `result.command` and `result.escapedCommand`\nexport const joinCommand = (filePath, rawArguments) => {\n\tconst fileAndArguments = [filePath, ...rawArguments];\n\tconst command = fileAndArguments.join(' ');\n\tconst escapedCommand = fileAndArguments\n\t\t.map(fileAndArgument => quoteString(escapeControlCharacters(fileAndArgument)))\n\t\t.join(' ');\n\treturn {command, escapedCommand};\n};\n\n// Remove ANSI sequences and escape control characters and newlines\nexport const escapeLines = lines => stripVTControlCharacters(lines)\n\t.split('\\n')\n\t.map(line => escapeControlCharacters(line))\n\t.join('\\n');\n\nconst escapeControlCharacters = line => line.replaceAll(SPECIAL_CHAR_REGEXP, character => escapeControlCharacter(character));\n\nconst escapeControlCharacter = character => {\n\tconst commonEscape = COMMON_ESCAPES[character];\n\tif (commonEscape !== undefined) {\n\t\treturn commonEscape;\n\t}\n\n\tconst codepoint = character.codePointAt(0);\n\tconst codepointHex = codepoint.toString(16);\n\treturn codepoint <= ASTRAL_START\n\t\t? `\\\\u${codepointHex.padStart(4, '0')}`\n\t\t: `\\\\U${codepointHex}`;\n};\n\n// Characters that would create issues when printed are escaped using the \\u or \\U notation.\n// Those include control characters and newlines.\n// The \\u and \\U notation is Bash specific, but there is no way to do this in a shell-agnostic way.\n// Some shells do not even have a way to print those characters in an escaped fashion.\n// Therefore, we prioritize printing those safely, instead of allowing those to be copy-pasted.\n// List of Unicode character categories: https://www.fileformat.info/info/unicode/category/index.htm\nconst getSpecialCharRegExp = () => {\n\ttry {\n\t\t// This throws when using Node.js without ICU support.\n\t\t// When using a RegExp literal, this would throw at parsing-time, instead of runtime.\n\t\t// eslint-disable-next-line prefer-regex-literals\n\t\treturn new RegExp('\\\\p{Separator}|\\\\p{Other}', 'gu');\n\t} catch {\n\t\t// Similar to the above RegExp, but works even when Node.js has been built without ICU support.\n\t\t// Unlike the above RegExp, it only covers whitespaces and C0/C1 control characters.\n\t\t// It does not cover some edge cases, such as Unicode reserved characters.\n\t\t// See https://github.com/sindresorhus/execa/issues/1143\n\t\t// eslint-disable-next-line no-control-regex, regexp/no-control-character, unicorn/prefer-unicode-code-point-escapes\n\t\treturn /[\\s\\u0000-\\u001F\\u007F-\\u009F\\u00AD]/g;\n\t}\n};\n\nconst SPECIAL_CHAR_REGEXP = getSpecialCharRegExp();\n\n// Accepted by $'...' in Bash.\n// Exclude \\a \\e \\v which are accepted in Bash but not in JavaScript (except \\v) and JSON.\nconst COMMON_ESCAPES = {\n\t' ': ' ',\n\t'\\b': '\\\\b',\n\t'\\f': '\\\\f',\n\t'\\n': '\\\\n',\n\t'\\r': '\\\\r',\n\t'\\t': '\\\\t',\n};\n\n// Up until that codepoint, \\u notation can be used instead of \\U\nconst ASTRAL_START = 65_535;\n\n// Some characters are shell-specific, i.e. need to be escaped when the command is copy-pasted then run.\n// Escaping is shell-specific. We cannot know which shell is used: `process.platform` detection is not enough.\n// For example, Windows users could be using `cmd.exe`, Powershell or Bash for Windows which all use different escaping.\n// We use '...' on Unix, which is POSIX shell compliant and escape all characters but ' so this is fairly safe.\n// On Windows, we assume cmd.exe is used and escape with \"...\", which also works with Powershell.\nconst quoteString = escapedArgument => {\n\tif (NO_ESCAPE_REGEXP.test(escapedArgument)) {\n\t\treturn escapedArgument;\n\t}\n\n\treturn platform === 'win32'\n\t\t? `\"${escapedArgument.replaceAll('\"', '\"\"')}\"`\n\t\t: `'${escapedArgument.replaceAll('\\'', '\\'\\\\\\'\\'')}'`;\n};\n\nconst NO_ESCAPE_REGEXP = /^[\\w\\-./]+$/;\n","import process from 'node:process';\n\nexport default function isUnicodeSupported() {\n\tconst {env} = process;\n\tconst {TERM, TERM_PROGRAM} = env;\n\n\tif (process.platform !== 'win32') {\n\t\treturn TERM !== 'linux'; // Linux console (kernel)\n\t}\n\n\treturn Boolean(env.WT_SESSION) // Windows Terminal\n\t\t|| Boolean(env.TERMINUS_SUBLIME) // Terminus (<0.2.27)\n\t\t|| env.ConEmuTask === '{cmd::Cmder}' // ConEmu and cmder\n\t\t|| TERM_PROGRAM === 'Terminus-Sublime'\n\t\t|| TERM_PROGRAM === 'vscode'\n\t\t|| TERM === 'xterm-256color'\n\t\t|| TERM === 'alacritty'\n\t\t|| TERM === 'rxvt-unicode'\n\t\t|| TERM === 'rxvt-unicode-256color'\n\t\t|| env.TERMINAL_EMULATOR === 'JetBrains-JediTerm';\n}\n","import isUnicodeSupported from 'is-unicode-supported';\n\nconst common = {\n\tcircleQuestionMark: '(?)',\n\tquestionMarkPrefix: '(?)',\n\tsquare: '█',\n\tsquareDarkShade: '▓',\n\tsquareMediumShade: '▒',\n\tsquareLightShade: '░',\n\tsquareTop: '▀',\n\tsquareBottom: '▄',\n\tsquareLeft: '▌',\n\tsquareRight: '▐',\n\tsquareCenter: '■',\n\tbullet: '●',\n\tdot: '․',\n\tellipsis: '…',\n\tpointerSmall: '›',\n\ttriangleUp: '▲',\n\ttriangleUpSmall: '▴',\n\ttriangleDown: '▼',\n\ttriangleDownSmall: '▾',\n\ttriangleLeftSmall: '◂',\n\ttriangleRightSmall: '▸',\n\thome: '⌂',\n\theart: '♥',\n\tmusicNote: '♪',\n\tmusicNoteBeamed: '♫',\n\tarrowUp: '↑',\n\tarrowDown: '↓',\n\tarrowLeft: '←',\n\tarrowRight: '→',\n\tarrowLeftRight: '↔',\n\tarrowUpDown: '↕',\n\talmostEqual: '≈',\n\tnotEqual: '≠',\n\tlessOrEqual: '≤',\n\tgreaterOrEqual: '≥',\n\tidentical: '≡',\n\tinfinity: '∞',\n\tsubscriptZero: '₀',\n\tsubscriptOne: '₁',\n\tsubscriptTwo: '₂',\n\tsubscriptThree: '₃',\n\tsubscriptFour: '₄',\n\tsubscriptFive: '₅',\n\tsubscriptSix: '₆',\n\tsubscriptSeven: '₇',\n\tsubscriptEight: '₈',\n\tsubscriptNine: '₉',\n\toneHalf: '½',\n\toneThird: '⅓',\n\toneQuarter: '¼',\n\toneFifth: '⅕',\n\toneSixth: '⅙',\n\toneEighth: '⅛',\n\ttwoThirds: '⅔',\n\ttwoFifths: '⅖',\n\tthreeQuarters: '¾',\n\tthreeFifths: '⅗',\n\tthreeEighths: '⅜',\n\tfourFifths: '⅘',\n\tfiveSixths: '⅚',\n\tfiveEighths: '⅝',\n\tsevenEighths: '⅞',\n\tline: '─',\n\tlineBold: '━',\n\tlineDouble: '═',\n\tlineDashed0: '┄',\n\tlineDashed1: '┅',\n\tlineDashed2: '┈',\n\tlineDashed3: '┉',\n\tlineDashed4: '╌',\n\tlineDashed5: '╍',\n\tlineDashed6: '╴',\n\tlineDashed7: '╶',\n\tlineDashed8: '╸',\n\tlineDashed9: '╺',\n\tlineDashed10: '╼',\n\tlineDashed11: '╾',\n\tlineDashed12: '−',\n\tlineDashed13: '–',\n\tlineDashed14: '‐',\n\tlineDashed15: '⁃',\n\tlineVertical: '│',\n\tlineVerticalBold: '┃',\n\tlineVerticalDouble: '║',\n\tlineVerticalDashed0: '┆',\n\tlineVerticalDashed1: '┇',\n\tlineVerticalDashed2: '┊',\n\tlineVerticalDashed3: '┋',\n\tlineVerticalDashed4: '╎',\n\tlineVerticalDashed5: '╏',\n\tlineVerticalDashed6: '╵',\n\tlineVerticalDashed7: '╷',\n\tlineVerticalDashed8: '╹',\n\tlineVerticalDashed9: '╻',\n\tlineVerticalDashed10: '╽',\n\tlineVerticalDashed11: '╿',\n\tlineDownLeft: '┐',\n\tlineDownLeftArc: '╮',\n\tlineDownBoldLeftBold: '┓',\n\tlineDownBoldLeft: '┒',\n\tlineDownLeftBold: '┑',\n\tlineDownDoubleLeftDouble: '╗',\n\tlineDownDoubleLeft: '╖',\n\tlineDownLeftDouble: '╕',\n\tlineDownRight: '┌',\n\tlineDownRightArc: '╭',\n\tlineDownBoldRightBold: '┏',\n\tlineDownBoldRight: '┎',\n\tlineDownRightBold: '┍',\n\tlineDownDoubleRightDouble: '╔',\n\tlineDownDoubleRight: '╓',\n\tlineDownRightDouble: '╒',\n\tlineUpLeft: '┘',\n\tlineUpLeftArc: '╯',\n\tlineUpBoldLeftBold: '┛',\n\tlineUpBoldLeft: '┚',\n\tlineUpLeftBold: '┙',\n\tlineUpDoubleLeftDouble: '╝',\n\tlineUpDoubleLeft: '╜',\n\tlineUpLeftDouble: '╛',\n\tlineUpRight: '└',\n\tlineUpRightArc: '╰',\n\tlineUpBoldRightBold: '┗',\n\tlineUpBoldRight: '┖',\n\tlineUpRightBold: '┕',\n\tlineUpDoubleRightDouble: '╚',\n\tlineUpDoubleRight: '╙',\n\tlineUpRightDouble: '╘',\n\tlineUpDownLeft: '┤',\n\tlineUpBoldDownBoldLeftBold: '┫',\n\tlineUpBoldDownBoldLeft: '┨',\n\tlineUpDownLeftBold: '┥',\n\tlineUpBoldDownLeftBold: '┩',\n\tlineUpDownBoldLeftBold: '┪',\n\tlineUpDownBoldLeft: '┧',\n\tlineUpBoldDownLeft: '┦',\n\tlineUpDoubleDownDoubleLeftDouble: '╣',\n\tlineUpDoubleDownDoubleLeft: '╢',\n\tlineUpDownLeftDouble: '╡',\n\tlineUpDownRight: '├',\n\tlineUpBoldDownBoldRightBold: '┣',\n\tlineUpBoldDownBoldRight: '┠',\n\tlineUpDownRightBold: '┝',\n\tlineUpBoldDownRightBold: '┡',\n\tlineUpDownBoldRightBold: '┢',\n\tlineUpDownBoldRight: '┟',\n\tlineUpBoldDownRight: '┞',\n\tlineUpDoubleDownDoubleRightDouble: '╠',\n\tlineUpDoubleDownDoubleRight: '╟',\n\tlineUpDownRightDouble: '╞',\n\tlineDownLeftRight: '┬',\n\tlineDownBoldLeftBoldRightBold: '┳',\n\tlineDownLeftBoldRightBold: '┯',\n\tlineDownBoldLeftRight: '┰',\n\tlineDownBoldLeftBoldRight: '┱',\n\tlineDownBoldLeftRightBold: '┲',\n\tlineDownLeftRightBold: '┮',\n\tlineDownLeftBoldRight: '┭',\n\tlineDownDoubleLeftDoubleRightDouble: '╦',\n\tlineDownDoubleLeftRight: '╥',\n\tlineDownLeftDoubleRightDouble: '╤',\n\tlineUpLeftRight: '┴',\n\tlineUpBoldLeftBoldRightBold: '┻',\n\tlineUpLeftBoldRightBold: '┷',\n\tlineUpBoldLeftRight: '┸',\n\tlineUpBoldLeftBoldRight: '┹',\n\tlineUpBoldLeftRightBold: '┺',\n\tlineUpLeftRightBold: '┶',\n\tlineUpLeftBoldRight: '┵',\n\tlineUpDoubleLeftDoubleRightDouble: '╩',\n\tlineUpDoubleLeftRight: '╨',\n\tlineUpLeftDoubleRightDouble: '╧',\n\tlineUpDownLeftRight: '┼',\n\tlineUpBoldDownBoldLeftBoldRightBold: '╋',\n\tlineUpDownBoldLeftBoldRightBold: '╈',\n\tlineUpBoldDownLeftBoldRightBold: '╇',\n\tlineUpBoldDownBoldLeftRightBold: '╊',\n\tlineUpBoldDownBoldLeftBoldRight: '╉',\n\tlineUpBoldDownLeftRight: '╀',\n\tlineUpDownBoldLeftRight: '╁',\n\tlineUpDownLeftBoldRight: '┽',\n\tlineUpDownLeftRightBold: '┾',\n\tlineUpBoldDownBoldLeftRight: '╂',\n\tlineUpDownLeftBoldRightBold: '┿',\n\tlineUpBoldDownLeftBoldRight: '╃',\n\tlineUpBoldDownLeftRightBold: '╄',\n\tlineUpDownBoldLeftBoldRight: '╅',\n\tlineUpDownBoldLeftRightBold: '╆',\n\tlineUpDoubleDownDoubleLeftDoubleRightDouble: '╬',\n\tlineUpDoubleDownDoubleLeftRight: '╫',\n\tlineUpDownLeftDoubleRightDouble: '╪',\n\tlineCross: '╳',\n\tlineBackslash: '╲',\n\tlineSlash: '╱',\n};\n\nconst specialMainSymbols = {\n\ttick: '✔',\n\tinfo: 'ℹ',\n\twarning: '⚠',\n\tcross: '✘',\n\tsquareSmall: '◻',\n\tsquareSmallFilled: '◼',\n\tcircle: '◯',\n\tcircleFilled: '◉',\n\tcircleDotted: '◌',\n\tcircleDouble: '◎',\n\tcircleCircle: 'ⓞ',\n\tcircleCross: 'ⓧ',\n\tcirclePipe: 'Ⓘ',\n\tradioOn: '◉',\n\tradioOff: '◯',\n\tcheckboxOn: '☒',\n\tcheckboxOff: '☐',\n\tcheckboxCircleOn: 'ⓧ',\n\tcheckboxCircleOff: 'Ⓘ',\n\tpointer: '❯',\n\ttriangleUpOutline: '△',\n\ttriangleLeft: '◀',\n\ttriangleRight: '▶',\n\tlozenge: '◆',\n\tlozengeOutline: '◇',\n\thamburger: '☰',\n\tsmiley: '㋡',\n\tmustache: '෴',\n\tstar: '★',\n\tplay: '▶',\n\tnodejs: '⬢',\n\toneSeventh: '⅐',\n\toneNinth: '⅑',\n\toneTenth: '⅒',\n};\n\nconst specialFallbackSymbols = {\n\ttick: '√',\n\tinfo: 'i',\n\twarning: '‼',\n\tcross: '×',\n\tsquareSmall: '□',\n\tsquareSmallFilled: '■',\n\tcircle: '( )',\n\tcircleFilled: '(*)',\n\tcircleDotted: '( )',\n\tcircleDouble: '( )',\n\tcircleCircle: '(○)',\n\tcircleCross: '(×)',\n\tcirclePipe: '(│)',\n\tradioOn: '(*)',\n\tradioOff: '( )',\n\tcheckboxOn: '[×]',\n\tcheckboxOff: '[ ]',\n\tcheckboxCircleOn: '(×)',\n\tcheckboxCircleOff: '( )',\n\tpointer: '>',\n\ttriangleUpOutline: '∆',\n\ttriangleLeft: '◄',\n\ttriangleRight: '►',\n\tlozenge: '♦',\n\tlozengeOutline: '◊',\n\thamburger: '≡',\n\tsmiley: '☺',\n\tmustache: '┌─┐',\n\tstar: '✶',\n\tplay: '►',\n\tnodejs: '♦',\n\toneSeventh: '1/7',\n\toneNinth: '1/9',\n\toneTenth: '1/10',\n};\n\nexport const mainSymbols = {...common, ...specialMainSymbols};\nexport const fallbackSymbols = {...common, ...specialFallbackSymbols};\n\nconst shouldUseMain = isUnicodeSupported();\nconst figures = shouldUseMain ? mainSymbols : fallbackSymbols;\nexport default figures;\n\nconst replacements = Object.entries(specialMainSymbols);\n\n// On terminals which do not support Unicode symbols, substitute them to other symbols\nexport const replaceSymbols = (string, {useFallback = !shouldUseMain} = {}) => {\n\tif (useFallback) {\n\t\tfor (const [key, mainSymbol] of replacements) {\n\t\t\tstring = string.replaceAll(mainSymbol, fallbackSymbols[key]);\n\t\t}\n\t}\n\n\treturn string;\n};\n","import tty from 'node:tty';\n\n// eslint-disable-next-line no-warning-comments\n// TODO: Use a better method when it's added to Node.js (https://github.com/nodejs/node/pull/40240)\n// Lots of optionals here to support Deno.\nconst hasColors = tty?.WriteStream?.prototype?.hasColors?.() ?? false;\n\nconst format = (open, close) => {\n\tif (!hasColors) {\n\t\treturn input => input;\n\t}\n\n\tconst openCode = `\\u001B[${open}m`;\n\tconst closeCode = `\\u001B[${close}m`;\n\n\treturn input => {\n\t\tconst string = input + ''; // eslint-disable-line no-implicit-coercion -- This is faster.\n\t\tlet index = string.indexOf(closeCode);\n\n\t\tif (index === -1) {\n\t\t\t// Note: Intentionally not using string interpolation for performance reasons.\n\t\t\treturn openCode + string + closeCode;\n\t\t}\n\n\t\t// Handle nested colors.\n\n\t\t// We could have done this, but it's too slow (as of Node.js 22).\n\t\t// return openCode + string.replaceAll(closeCode, (close === 22 ? closeCode : '') + openCode) + closeCode;\n\n\t\tlet result = openCode;\n\t\tlet lastIndex = 0;\n\n\t\t// SGR 22 resets both bold (1) and dim (2). When we encounter a nested\n\t\t// close for styles that use 22, we need to re-open the outer style.\n\t\tconst reopenOnNestedClose = close === 22;\n\t\tconst replaceCode = (reopenOnNestedClose ? closeCode : '') + openCode;\n\n\t\twhile (index !== -1) {\n\t\t\tresult += string.slice(lastIndex, index) + replaceCode;\n\t\t\tlastIndex = index + closeCode.length;\n\t\t\tindex = string.indexOf(closeCode, lastIndex);\n\t\t}\n\n\t\tresult += string.slice(lastIndex) + closeCode;\n\n\t\treturn result;\n\t};\n};\n\nexport const reset = format(0, 0);\nexport const bold = format(1, 22);\nexport const dim = format(2, 22);\nexport const italic = format(3, 23);\nexport const underline = format(4, 24);\n// Extended underline styles (`SGR 4:x` sub-parameters).\nexport const underlineDouble = format('4:2', 24);\nexport const underlineCurly = format('4:3', 24);\nexport const underlineDotted = format('4:4', 24);\nexport const underlineDashed = format('4:5', 24);\nexport const overline = format(53, 55);\nexport const inverse = format(7, 27);\nexport const hidden = format(8, 28);\nexport const strikethrough = format(9, 29);\n\nexport const black = format(30, 39);\nexport const red = format(31, 39);\nexport const green = format(32, 39);\nexport const yellow = format(33, 39);\nexport const blue = format(34, 39);\nexport const magenta = format(35, 39);\nexport const cyan = format(36, 39);\nexport const white = format(37, 39);\nexport const gray = format(90, 39);\n\nexport const bgBlack = format(40, 49);\nexport const bgRed = format(41, 49);\nexport const bgGreen = format(42, 49);\nexport const bgYellow = format(43, 49);\nexport const bgBlue = format(44, 49);\nexport const bgMagenta = format(45, 49);\nexport const bgCyan = format(46, 49);\nexport const bgWhite = format(47, 49);\nexport const bgGray = format(100, 49);\n\nexport const redBright = format(91, 39);\nexport const greenBright = format(92, 39);\nexport const yellowBright = format(93, 39);\nexport const blueBright = format(94, 39);\nexport const magentaBright = format(95, 39);\nexport const cyanBright = format(96, 39);\nexport const whiteBright = format(97, 39);\n\nexport const bgRedBright = format(101, 49);\nexport const bgGreenBright = format(102, 49);\nexport const bgYellowBright = format(103, 49);\nexport const bgBlueBright = format(104, 49);\nexport const bgMagentaBright = format(105, 49);\nexport const bgCyanBright = format(106, 49);\nexport const bgWhiteBright = format(107, 49);\n\n// Underline color (`SGR 58`/`59`). It has no basic 16-color form, so the palette index is used.\nexport const underlineBlack = format('58;5;0', 59);\nexport const underlineRed = format('58;5;1', 59);\nexport const underlineGreen = format('58;5;2', 59);\nexport const underlineYellow = format('58;5;3', 59);\nexport const underlineBlue = format('58;5;4', 59);\nexport const underlineMagenta = format('58;5;5', 59);\nexport const underlineCyan = format('58;5;6', 59);\nexport const underlineWhite = format('58;5;7', 59);\nexport const underlineGray = format('58;5;8', 59);\n\nexport const underlineRedBright = format('58;5;9', 59);\nexport const underlineGreenBright = format('58;5;10', 59);\nexport const underlineYellowBright = format('58;5;11', 59);\nexport const underlineBlueBright = format('58;5;12', 59);\nexport const underlineMagentaBright = format('58;5;13', 59);\nexport const underlineCyanBright = format('58;5;14', 59);\nexport const underlineWhiteBright = format('58;5;15', 59);\n","import figures from 'figures';\nimport {\n\tgray,\n\tbold,\n\tredBright,\n\tyellowBright,\n} from 'yoctocolors';\n\n// Default when `verbose` is not a function\nexport const defaultVerboseFunction = ({\n\ttype,\n\tmessage,\n\ttimestamp,\n\tpiped,\n\tcommandId,\n\tresult: {failed = false} = {},\n\toptions: {reject = true},\n}) => {\n\tconst timestampString = serializeTimestamp(timestamp);\n\tconst icon = ICONS[type]({failed, reject, piped});\n\tconst color = COLORS[type]({reject});\n\treturn `${gray(`[${timestampString}]`)} ${gray(`[${commandId}]`)} ${color(icon)} ${color(message)}`;\n};\n\n// Prepending the timestamp allows debugging the slow paths of a subprocess\nconst serializeTimestamp = timestamp => `${padField(timestamp.getHours(), 2)}:${padField(timestamp.getMinutes(), 2)}:${padField(timestamp.getSeconds(), 2)}.${padField(timestamp.getMilliseconds(), 3)}`;\n\nconst padField = (field, padding) => String(field).padStart(padding, '0');\n\nconst getFinalIcon = ({failed, reject}) => {\n\tif (!failed) {\n\t\treturn figures.tick;\n\t}\n\n\treturn reject ? figures.cross : figures.warning;\n};\n\nconst ICONS = {\n\tcommand: ({piped}) => piped ? '|' : '$',\n\toutput: () => ' ',\n\tipc: () => '*',\n\terror: getFinalIcon,\n\tduration: getFinalIcon,\n};\n\nconst identity = string => string;\n\nconst COLORS = {\n\tcommand: () => bold,\n\toutput: () => identity,\n\tipc: () => identity,\n\terror: ({reject}) => reject ? redBright : yellowBright,\n\tduration: () => gray,\n};\n","import {getVerboseFunction} from './values.js';\n\n// Apply the `verbose` function on each line\nexport const applyVerboseOnLines = (printedLines, verboseInfo, fdNumber) => {\n\tconst verboseFunction = getVerboseFunction(verboseInfo, fdNumber);\n\treturn printedLines\n\t\t.map(({verboseLine, verboseObject}) => applyVerboseFunction(verboseLine, verboseObject, verboseFunction))\n\t\t.filter(printedLine => printedLine !== undefined)\n\t\t.map(printedLine => appendNewline(printedLine))\n\t\t.join('');\n};\n\nconst applyVerboseFunction = (verboseLine, verboseObject, verboseFunction) => {\n\tif (verboseFunction === undefined) {\n\t\treturn verboseLine;\n\t}\n\n\tconst printedLine = verboseFunction(verboseLine, verboseObject);\n\tif (typeof printedLine === 'string') {\n\t\treturn printedLine;\n\t}\n};\n\nconst appendNewline = printedLine => printedLine.endsWith('\\n')\n\t? printedLine\n\t: `${printedLine}\\n`;\n","import {inspect} from 'node:util';\nimport {escapeLines} from '../arguments/escape.js';\nimport {defaultVerboseFunction} from './default.js';\nimport {applyVerboseOnLines} from './custom.js';\n\n// This prints on stderr.\n// If the subprocess prints on stdout and is using `stdout: 'inherit'`,\n// there is a chance both writes will compete (introducing a race condition).\n// This means their respective order is not deterministic.\n// In particular, this means the verbose command lines might be after the start of the subprocess output.\n// Using synchronous I/O does not solve this problem.\n// However, this only seems to happen when the stdout/stderr target\n// (e.g. a terminal) is being written to by many subprocesses at once, which is unlikely in real scenarios.\nexport const verboseLog = ({type, verboseMessage, fdNumber, verboseInfo, result}) => {\n\tconst verboseObject = getVerboseObject({type, result, verboseInfo});\n\tconst printedLines = getPrintedLines(verboseMessage, verboseObject);\n\tconst finalLines = applyVerboseOnLines(printedLines, verboseInfo, fdNumber);\n\tif (finalLines !== '') {\n\t\tconsole.warn(finalLines.slice(0, -1));\n\t}\n};\n\nconst getVerboseObject = ({type, result, verboseInfo}) => {\n\tconst {escapedCommand, commandId, rawOptions} = verboseInfo;\n\tconst {piped = false, ...options} = rawOptions;\n\treturn {\n\t\ttype,\n\t\tescapedCommand,\n\t\tcommandId: `${commandId}`,\n\t\ttimestamp: new Date(),\n\t\tpiped,\n\t\tresult,\n\t\toptions,\n\t};\n};\n\nconst getPrintedLines = (verboseMessage, verboseObject) => verboseMessage\n\t.split('\\n')\n\t.map(message => getPrintedLine({...verboseObject, message}));\n\nconst getPrintedLine = verboseObject => {\n\tconst verboseLine = defaultVerboseFunction(verboseObject);\n\treturn {verboseLine, verboseObject};\n};\n\n// Serialize any type to a line string, for logging\nexport const serializeVerboseMessage = message => {\n\tconst messageString = typeof message === 'string' ? message : inspect(message);\n\tconst escapedMessage = escapeLines(messageString);\n\treturn escapedMessage.replaceAll('\\t', () => ' '.repeat(TAB_SIZE));\n};\n\n// Same as `util.inspect()`\nconst TAB_SIZE = 2;\n","import {isVerbose} from './values.js';\nimport {verboseLog} from './log.js';\n\n// When `verbose` is `short|full|custom`, print each command\nexport const logCommand = (escapedCommand, verboseInfo) => {\n\tif (!isVerbose(verboseInfo)) {\n\t\treturn;\n\t}\n\n\tverboseLog({\n\t\ttype: 'command',\n\t\tverboseMessage: escapedCommand,\n\t\tverboseInfo,\n\t});\n};\n","import {isVerbose, VERBOSE_VALUES, isVerboseFunction} from './values.js';\n\n// Information computed before spawning, used by the `verbose` option\nexport const getVerboseInfo = (verbose, escapedCommand, rawOptions) => {\n\tvalidateVerbose(verbose);\n\tconst commandId = getCommandId(verbose);\n\treturn {\n\t\tverbose,\n\t\tescapedCommand,\n\t\tcommandId,\n\t\trawOptions,\n\t};\n};\n\nconst getCommandId = verbose => isVerbose({verbose}) ? COMMAND_ID++ : undefined;\n\n// Prepending the `pid` is useful when multiple commands print their output at the same time.\n// However, we cannot use the real PID since this is not available with `child_process.spawnSync()`.\n// Also, we cannot use the real PID if we want to print it before `child_process.spawn()` is run.\n// As a pro, it is shorter than a normal PID and never re-uses the same id.\n// As a con, it cannot be used to send signals.\nlet COMMAND_ID = 0n;\n\nconst validateVerbose = verbose => {\n\tfor (const fdVerbose of verbose) {\n\t\tif (fdVerbose === false) {\n\t\t\tthrow new TypeError('The \"verbose: false\" option was renamed to \"verbose: \\'none\\'\".');\n\t\t}\n\n\t\tif (fdVerbose === true) {\n\t\t\tthrow new TypeError('The \"verbose: true\" option was renamed to \"verbose: \\'short\\'\".');\n\t\t}\n\n\t\tif (!VERBOSE_VALUES.includes(fdVerbose) && !isVerboseFunction(fdVerbose)) {\n\t\t\tconst allowedValues = VERBOSE_VALUES.map(allowedValue => `'${allowedValue}'`).join(', ');\n\t\t\tthrow new TypeError(`The \"verbose\" option must not be ${fdVerbose}. Allowed values are: ${allowedValues} or a function.`);\n\t\t}\n\t}\n};\n","import {hrtime} from 'node:process';\n\n// Start counting time before spawning the subprocess\nexport const getStartTime = () => hrtime.bigint();\n\n// Compute duration after the subprocess ended.\n// Printed by the `verbose` option.\nexport const getDurationMs = startTime => Number(hrtime.bigint() - startTime) / 1e6;\n","import {logCommand} from '../verbose/start.js';\nimport {getVerboseInfo} from '../verbose/info.js';\nimport {getStartTime} from '../return/duration.js';\nimport {joinCommand} from './escape.js';\nimport {normalizeFdSpecificOption} from './specific.js';\n\n// Compute `result.command`, `result.escapedCommand` and `verbose`-related information\nexport const handleCommand = (filePath, rawArguments, rawOptions) => {\n\tconst startTime = getStartTime();\n\tconst {command, escapedCommand} = joinCommand(filePath, rawArguments);\n\tconst verbose = normalizeFdSpecificOption(rawOptions, 'verbose');\n\tconst verboseInfo = getVerboseInfo(verbose, escapedCommand, {...rawOptions});\n\tlogCommand(escapedCommand, verboseInfo);\n\treturn {\n\t\tcommand,\n\t\tescapedCommand,\n\t\tstartTime,\n\t\tverboseInfo,\n\t};\n};\n","export default function pathKey(options = {}) {\n\tconst {\n\t\tenv = process.env,\n\t\tplatform = process.platform\n\t} = options;\n\n\tif (platform !== 'win32') {\n\t\treturn 'PATH';\n\t}\n\n\treturn Object.keys(env).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path';\n}\n","import {promisify} from 'node:util';\nimport {execFile as execFileCallback, execFileSync as execFileSyncOriginal} from 'node:child_process';\nimport path from 'node:path';\nimport {fileURLToPath} from 'node:url';\n\nconst execFileOriginal = promisify(execFileCallback);\n\nexport function toPath(urlOrPath) {\n\treturn urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;\n}\n\nexport function rootDirectory(pathInput) {\n\treturn path.parse(toPath(pathInput)).root;\n}\n\nexport function traversePathUp(startPath) {\n\treturn {\n\t\t* [Symbol.iterator]() {\n\t\t\tlet currentPath = path.resolve(toPath(startPath));\n\t\t\tlet previousPath;\n\n\t\t\twhile (previousPath !== currentPath) {\n\t\t\t\tyield currentPath;\n\t\t\t\tpreviousPath = currentPath;\n\t\t\t\tcurrentPath = path.resolve(currentPath, '..');\n\t\t\t}\n\t\t},\n\t};\n}\n\nconst TEN_MEGABYTES_IN_BYTES = 10 * 1024 * 1024;\n\nexport async function execFile(file, arguments_, options = {}) {\n\treturn execFileOriginal(file, arguments_, {\n\t\tmaxBuffer: TEN_MEGABYTES_IN_BYTES,\n\t\t...options,\n\t});\n}\n\nexport function execFileSync(file, arguments_ = [], options = {}) {\n\treturn execFileSyncOriginal(file, arguments_, {\n\t\tmaxBuffer: TEN_MEGABYTES_IN_BYTES,\n\t\tencoding: 'utf8',\n\t\tstdio: 'pipe',\n\t\t...options,\n\t});\n}\n\nexport * from './default.js';\n","import process from 'node:process';\nimport path from 'node:path';\nimport pathKey from 'path-key';\nimport {toPath, traversePathUp} from 'unicorn-magic';\n\nexport const npmRunPath = ({\n\tcwd = process.cwd(),\n\tpath: pathOption = process.env[pathKey()],\n\tpreferLocal = true,\n\texecPath = process.execPath,\n\taddExecPath = true,\n} = {}) => {\n\tconst cwdPath = path.resolve(toPath(cwd));\n\tconst result = [];\n\tconst pathParts = pathOption.split(path.delimiter);\n\n\tif (preferLocal) {\n\t\tapplyPreferLocal(result, pathParts, cwdPath);\n\t}\n\n\tif (addExecPath) {\n\t\tapplyExecPath(result, pathParts, execPath, cwdPath);\n\t}\n\n\treturn pathOption === '' || pathOption === path.delimiter\n\t\t? `${result.join(path.delimiter)}${pathOption}`\n\t\t: [...result, pathOption].join(path.delimiter);\n};\n\nconst applyPreferLocal = (result, pathParts, cwdPath) => {\n\tfor (const directory of traversePathUp(cwdPath)) {\n\t\tconst pathPart = path.join(directory, 'node_modules/.bin');\n\t\tif (!pathParts.includes(pathPart)) {\n\t\t\tresult.push(pathPart);\n\t\t}\n\t}\n};\n\n// Ensure the running `node` binary is used\nconst applyExecPath = (result, pathParts, execPath, cwdPath) => {\n\tconst pathPart = path.resolve(cwdPath, toPath(execPath), '..');\n\tif (!pathParts.includes(pathPart)) {\n\t\tresult.push(pathPart);\n\t}\n};\n\nexport const npmRunPathEnv = ({env = process.env, ...options} = {}) => {\n\tenv = {...env};\n\n\tconst pathName = pathKey({env});\n\toptions.path = env[pathName];\n\tenv[pathName] = npmRunPath(options);\n\n\treturn env;\n};\n","// When the subprocess fails, this is the error instance being returned.\n// If another error instance is being thrown, it is kept as `error.cause`.\nexport const getFinalError = (originalError, message, isSync) => {\n\tconst ErrorClass = isSync ? ExecaSyncError : ExecaError;\n\tconst options = originalError instanceof DiscardedError ? {} : {cause: originalError};\n\treturn new ErrorClass(message, options);\n};\n\n// Indicates that the error is used only to interrupt control flow, but not in the return value\nexport class DiscardedError extends Error {}\n\n// Proper way to set `error.name`: it should be inherited and non-enumerable\nconst setErrorName = (ErrorClass, value) => {\n\tObject.defineProperties(ErrorClass.prototype, {\n\t\tname: {\n\t\t\tvalue,\n\t\t\twritable: true,\n\t\t\tenumerable: false,\n\t\t\tconfigurable: true,\n\t\t},\n\t\t[execaErrorSymbol]: {\n\t\t\tvalue: true,\n\t\t\twritable: false,\n\t\t\tenumerable: false,\n\t\t\tconfigurable: false,\n\t\t},\n\t});\n};\n\n// Unlike `instanceof`, this works across realms\nexport const isExecaError = error => isErrorInstance(error) && execaErrorSymbol in error;\n\nconst execaErrorSymbol = Symbol('isExecaError');\n\nexport const isErrorInstance = value => Object.prototype.toString.call(value) === '[object Error]';\n\n// We use two different Error classes for async/sync methods since they have slightly different shape and types\nexport class ExecaError extends Error {}\n// eslint-disable-next-line unicorn/no-top-level-side-effects -- `error.name` must be set as soon as the class is defined\nsetErrorName(ExecaError, ExecaError.name);\n\nexport class ExecaSyncError extends Error {}\n// eslint-disable-next-line unicorn/no-top-level-side-effects -- `error.name` must be set as soon as the class is defined\nsetErrorName(ExecaSyncError, ExecaSyncError.name);\n","\nexport const getRealtimeSignals=()=>{\nconst length=SIGRTMAX-SIGRTMIN+1;\nreturn Array.from({length},getRealtimeSignal)\n};\n\nconst getRealtimeSignal=(value,index)=>({\nname:`SIGRT${index+1}`,\nnumber:SIGRTMIN+index,\naction:\"terminate\",\ndescription:\"Application-specific signal (realtime)\",\nstandard:\"posix\"\n});\n\nconst SIGRTMIN=34;\nexport const SIGRTMAX=64;","\n\nexport const SIGNALS=[\n{\nname:\"SIGHUP\",\nnumber:1,\naction:\"terminate\",\ndescription:\"Terminal closed\",\nstandard:\"posix\"\n},\n{\nname:\"SIGINT\",\nnumber:2,\naction:\"terminate\",\ndescription:\"User interruption with CTRL-C\",\nstandard:\"ansi\"\n},\n{\nname:\"SIGQUIT\",\nnumber:3,\naction:\"core\",\ndescription:\"User interruption with CTRL-\\\\\",\nstandard:\"posix\"\n},\n{\nname:\"SIGILL\",\nnumber:4,\naction:\"core\",\ndescription:\"Invalid machine instruction\",\nstandard:\"ansi\"\n},\n{\nname:\"SIGTRAP\",\nnumber:5,\naction:\"core\",\ndescription:\"Debugger breakpoint\",\nstandard:\"posix\"\n},\n{\nname:\"SIGABRT\",\nnumber:6,\naction:\"core\",\ndescription:\"Aborted\",\nstandard:\"ansi\"\n},\n{\nname:\"SIGIOT\",\nnumber:6,\naction:\"core\",\ndescription:\"Aborted\",\nstandard:\"bsd\"\n},\n{\nname:\"SIGBUS\",\nnumber:7,\naction:\"core\",\ndescription:\n\"Bus error due to misaligned, non-existing address or paging error\",\nstandard:\"bsd\"\n},\n{\nname:\"SIGEMT\",\nnumber:7,\naction:\"terminate\",\ndescription:\"Command should be emulated but is not implemented\",\nstandard:\"other\"\n},\n{\nname:\"SIGFPE\",\nnumber:8,\naction:\"core\",\ndescription:\"Floating point arithmetic error\",\nstandard:\"ansi\"\n},\n{\nname:\"SIGKILL\",\nnumber:9,\naction:\"terminate\",\ndescription:\"Forced termination\",\nstandard:\"posix\",\nforced:true\n},\n{\nname:\"SIGUSR1\",\nnumber:10,\naction:\"terminate\",\ndescription:\"Application-specific signal\",\nstandard:\"posix\"\n},\n{\nname:\"SIGSEGV\",\nnumber:11,\naction:\"core\",\ndescription:\"Segmentation fault\",\nstandard:\"ansi\"\n},\n{\nname:\"SIGUSR2\",\nnumber:12,\naction:\"terminate\",\ndescription:\"Application-specific signal\",\nstandard:\"posix\"\n},\n{\nname:\"SIGPIPE\",\nnumber:13,\naction:\"terminate\",\ndescription:\"Broken pipe or socket\",\nstandard:\"posix\"\n},\n{\nname:\"SIGALRM\",\nnumber:14,\naction:\"terminate\",\ndescription:\"Timeout or timer\",\nstandard:\"posix\"\n},\n{\nname:\"SIGTERM\",\nnumber:15,\naction:\"terminate\",\ndescription:\"Termination\",\nstandard:\"ansi\"\n},\n{\nname:\"SIGSTKFLT\",\nnumber:16,\naction:\"terminate\",\ndescription:\"Stack is empty or overflowed\",\nstandard:\"other\"\n},\n{\nname:\"SIGCHLD\",\nnumber:17,\naction:\"ignore\",\ndescription:\"Child process terminated, paused or unpaused\",\nstandard:\"posix\"\n},\n{\nname:\"SIGCLD\",\nnumber:17,\naction:\"ignore\",\ndescription:\"Child process terminated, paused or unpaused\",\nstandard:\"other\"\n},\n{\nname:\"SIGCONT\",\nnumber:18,\naction:\"unpause\",\ndescription:\"Unpaused\",\nstandard:\"posix\",\nforced:true\n},\n{\nname:\"SIGSTOP\",\nnumber:19,\naction:\"pause\",\ndescription:\"Paused\",\nstandard:\"posix\",\nforced:true\n},\n{\nname:\"SIGTSTP\",\nnumber:20,\naction:\"pause\",\ndescription:\"Paused using CTRL-Z or \\\"suspend\\\"\",\nstandard:\"posix\"\n},\n{\nname:\"SIGTTIN\",\nnumber:21,\naction:\"pause\",\ndescription:\"Background process cannot read terminal input\",\nstandard:\"posix\"\n},\n{\nname:\"SIGBREAK\",\nnumber:21,\naction:\"terminate\",\ndescription:\"User interruption with CTRL-BREAK\",\nstandard:\"other\"\n},\n{\nname:\"SIGTTOU\",\nnumber:22,\naction:\"pause\",\ndescription:\"Background process cannot write to terminal output\",\nstandard:\"posix\"\n},\n{\nname:\"SIGURG\",\nnumber:23,\naction:\"ignore\",\ndescription:\"Socket received out-of-band data\",\nstandard:\"bsd\"\n},\n{\nname:\"SIGXCPU\",\nnumber:24,\naction:\"core\",\ndescription:\"Process timed out\",\nstandard:\"bsd\"\n},\n{\nname:\"SIGXFSZ\",\nnumber:25,\naction:\"core\",\ndescription:\"File too big\",\nstandard:\"bsd\"\n},\n{\nname:\"SIGVTALRM\",\nnumber:26,\naction:\"terminate\",\ndescription:\"Timeout or timer\",\nstandard:\"bsd\"\n},\n{\nname:\"SIGPROF\",\nnumber:27,\naction:\"terminate\",\ndescription:\"Timeout or timer\",\nstandard:\"bsd\"\n},\n{\nname:\"SIGWINCH\",\nnumber:28,\naction:\"ignore\",\ndescription:\"Terminal window size changed\",\nstandard:\"bsd\"\n},\n{\nname:\"SIGIO\",\nnumber:29,\naction:\"terminate\",\ndescription:\"I/O is available\",\nstandard:\"other\"\n},\n{\nname:\"SIGPOLL\",\nnumber:29,\naction:\"terminate\",\ndescription:\"Watched event\",\nstandard:\"other\"\n},\n{\nname:\"SIGINFO\",\nnumber:29,\naction:\"ignore\",\ndescription:\"Request for process information\",\nstandard:\"other\"\n},\n{\nname:\"SIGPWR\",\nnumber:30,\naction:\"terminate\",\ndescription:\"Device running out of power\",\nstandard:\"systemv\"\n},\n{\nname:\"SIGSYS\",\nnumber:31,\naction:\"core\",\ndescription:\"Invalid system call\",\nstandard:\"other\"\n},\n{\nname:\"SIGUNUSED\",\nnumber:31,\naction:\"terminate\",\ndescription:\"Invalid system call\",\nstandard:\"other\"\n}];","import{constants}from\"node:os\";\n\nimport{SIGNALS}from\"./core.js\";\nimport{getRealtimeSignals}from\"./realtime.js\";\n\n\n\nexport const getSignals=()=>{\nconst realtimeSignals=getRealtimeSignals();\nconst signals=[...SIGNALS,...realtimeSignals].map(normalizeSignal);\nreturn signals\n};\n\n\n\n\n\n\n\nconst normalizeSignal=({\nname,\nnumber:defaultNumber,\ndescription,\naction,\nforced=false,\nstandard\n})=>{\nconst{\nsignals:{[name]:constantSignal}\n}=constants;\nconst supported=constantSignal!==undefined;\nconst number=supported?constantSignal:defaultNumber;\nreturn{name,number,description,supported,action,forced,standard}\n};","import{constants}from\"node:os\";\n\nimport{SIGRTMAX}from\"./realtime.js\";\nimport{getSignals}from\"./signals.js\";\n\n\n\nconst getSignalsByName=()=>{\nconst signals=getSignals();\nreturn Object.fromEntries(signals.map(getSignalByName))\n};\n\nconst getSignalByName=({\nname,\nnumber,\ndescription,\nsupported,\naction,\nforced,\nstandard\n})=>[name,{name,number,description,supported,action,forced,standard}];\n\nexport const signalsByName=getSignalsByName();\n\n\n\n\nconst getSignalsByNumber=()=>{\nconst signals=getSignals();\nconst length=SIGRTMAX+1;\nconst signalsA=Array.from({length},(value,number)=>\ngetSignalByNumber(number,signals)\n);\nreturn Object.assign({},...signalsA)\n};\n\nconst getSignalByNumber=(number,signals)=>{\nconst signal=findSignalByNumber(number,signals);\n\nif(signal===undefined){\nreturn{}\n}\n\nconst{name,description,supported,action,forced,standard}=signal;\nreturn{\n[number]:{\nname,\nnumber,\ndescription,\nsupported,\naction,\nforced,\nstandard\n}\n}\n};\n\n\n\nconst findSignalByNumber=(number,signals)=>{\nconst signal=signals.find(({name})=>constants.signals[name]===number);\n\nif(signal!==undefined){\nreturn signal\n}\n\nreturn signals.find((signalA)=>signalA.number===number)\n};\n\nexport const signalsByNumber=getSignalsByNumber();","import {constants} from 'node:os';\nimport {signalsByName} from 'human-signals';\n\n// Normalize signals for comparison purpose.\n// Also validate the signal exists.\nexport const normalizeKillSignal = killSignal => {\n\tconst optionName = 'option `killSignal`';\n\tif (killSignal === 0) {\n\t\tthrow new TypeError(`Invalid ${optionName}: 0 cannot be used.`);\n\t}\n\n\treturn normalizeSignal(killSignal, optionName);\n};\n\nexport const normalizeSignalArgument = signal => signal === 0\n\t? signal\n\t: normalizeSignal(signal, '`subprocess.kill()`\\'s argument');\n\nconst normalizeSignal = (signalNameOrInteger, optionName) => {\n\tif (Number.isInteger(signalNameOrInteger)) {\n\t\treturn normalizeSignalInteger(signalNameOrInteger, optionName);\n\t}\n\n\tif (typeof signalNameOrInteger === 'string') {\n\t\treturn normalizeSignalName(signalNameOrInteger, optionName);\n\t}\n\n\tthrow new TypeError(`Invalid ${optionName} ${String(signalNameOrInteger)}: it must be a string or an integer.\\n${getAvailableSignals()}`);\n};\n\nconst normalizeSignalInteger = (signalInteger, optionName) => {\n\tif (signalsIntegerToName.has(signalInteger)) {\n\t\treturn signalsIntegerToName.get(signalInteger);\n\t}\n\n\tthrow new TypeError(`Invalid ${optionName} ${signalInteger}: this signal integer does not exist.\\n${getAvailableSignals()}`);\n};\n\nconst getSignalsIntegerToName = () => new Map(Object.entries(constants.signals)\n\t.reverse()\n\t.map(([signalName, signalInteger]) => [signalInteger, signalName]));\n\nconst signalsIntegerToName = getSignalsIntegerToName();\n\nconst normalizeSignalName = (signalName, optionName) => {\n\tif (signalName in constants.signals) {\n\t\treturn signalName;\n\t}\n\n\tif (signalName.toUpperCase() in constants.signals) {\n\t\tthrow new TypeError(`Invalid ${optionName} '${signalName}': please rename it to '${signalName.toUpperCase()}'.`);\n\t}\n\n\tthrow new TypeError(`Invalid ${optionName} '${signalName}': this signal name does not exist.\\n${getAvailableSignals()}`);\n};\n\nconst getAvailableSignals = () => `Available signal names: ${getAvailableSignalNames()}.\nAvailable signal numbers: ${getAvailableSignalIntegers()}.`;\n\nconst getAvailableSignalNames = () => Object.keys(constants.signals)\n\t.sort()\n\t.map(signalName => `'${signalName}'`)\n\t.join(', ');\n\nconst getAvailableSignalIntegers = () => [...new Set(Object.values(constants.signals)\n\t.sort((signalInteger, signalIntegerTwo) => signalInteger - signalIntegerTwo))]\n\t.join(', ');\n\n// Human-friendly description of a signal\nexport const getSignalDescription = signal => signalsByName[signal].description;\n","import {setTimeout} from 'node:timers/promises';\nimport {isErrorInstance} from '../return/final-error.js';\nimport {normalizeSignalArgument} from './signal.js';\n\n// Normalize the `forceKillAfterDelay` option\nexport const normalizeForceKillAfterDelay = forceKillAfterDelay => {\n\tif (forceKillAfterDelay === false) {\n\t\treturn forceKillAfterDelay;\n\t}\n\n\tif (forceKillAfterDelay === true) {\n\t\treturn DEFAULT_FORCE_KILL_TIMEOUT;\n\t}\n\n\tif (!Number.isFinite(forceKillAfterDelay) || forceKillAfterDelay < 0) {\n\t\tthrow new TypeError(`Expected the \\`forceKillAfterDelay\\` option to be a non-negative integer, got \\`${forceKillAfterDelay}\\` (${typeof forceKillAfterDelay})`);\n\t}\n\n\treturn forceKillAfterDelay;\n};\n\nconst DEFAULT_FORCE_KILL_TIMEOUT = 1000 * 5;\n\n// Monkey-patches `subprocess.kill()` to add `forceKillAfterDelay` behavior and `.kill(error)`\nexport const subprocessKill = (\n\t{kill, options: {forceKillAfterDelay, killSignal}, onInternalError, context, controller},\n\tsignalOrError,\n\terrorArgument,\n) => {\n\tconst {signal, error} = parseKillArguments(signalOrError, errorArgument, killSignal);\n\temitKillError(error, onInternalError);\n\tconst killResult = kill(signal);\n\tsetKillTimeout({\n\t\tkill,\n\t\tsignal,\n\t\tforceKillAfterDelay,\n\t\tkillSignal,\n\t\tkillResult,\n\t\tcontext,\n\t\tcontroller,\n\t});\n\treturn killResult;\n};\n\nconst parseKillArguments = (signalOrError, errorArgument, killSignal) => {\n\tconst [signal = killSignal, error] = isErrorInstance(signalOrError)\n\t\t? [undefined, signalOrError]\n\t\t: [signalOrError, errorArgument];\n\n\tif (typeof signal !== 'string' && !Number.isInteger(signal)) {\n\t\tthrow new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(signal)}`);\n\t}\n\n\tif (error !== undefined && !isErrorInstance(error)) {\n\t\tthrow new TypeError(`The second argument is optional. If specified, it must be an error instance: ${error}`);\n\t}\n\n\treturn {signal: normalizeSignalArgument(signal), error};\n};\n\n// Fails right away when calling `subprocess.kill(error)`.\n// Does not wait for actual signal termination.\n// Uses a deferred promise instead of the `error` event on the subprocess, as this is less intrusive.\nconst emitKillError = (error, onInternalError) => {\n\tif (error !== undefined) {\n\t\tonInternalError.reject(error);\n\t}\n};\n\nconst setKillTimeout = async ({kill, signal, forceKillAfterDelay, killSignal, killResult, context, controller}) => {\n\tif (signal === killSignal && killResult) {\n\t\tkillOnTimeout({\n\t\t\tkill,\n\t\t\tforceKillAfterDelay,\n\t\t\tcontext,\n\t\t\tcontrollerSignal: controller.signal,\n\t\t});\n\t}\n};\n\n// Forcefully terminate a subprocess after a timeout\nexport const killOnTimeout = async ({kill, forceKillAfterDelay, context, controllerSignal}) => {\n\tif (forceKillAfterDelay === false) {\n\t\treturn;\n\t}\n\n\ttry {\n\t\tawait setTimeout(forceKillAfterDelay, undefined, {signal: controllerSignal});\n\t\tif (kill('SIGKILL')) {\n\t\t\tcontext.isForcefullyTerminated ??= true;\n\t\t}\n\t} catch {}\n};\n","import {once} from 'node:events';\n\n// Combines `util.aborted()` and `events.addAbortListener()`: promise-based and cleaned up with a stop signal\nexport const onAbortedSignal = async (mainSignal, stopSignal) => {\n\tif (!mainSignal.aborted) {\n\t\tawait once(mainSignal, 'abort', {signal: stopSignal});\n\t}\n};\n","import {onAbortedSignal} from '../utils/abort-signal.js';\n\n// Validate the `cancelSignal` option\nexport const validateCancelSignal = ({cancelSignal}) => {\n\tif (cancelSignal !== undefined && Object.prototype.toString.call(cancelSignal) !== '[object AbortSignal]') {\n\t\tthrow new Error(`The \\`cancelSignal\\` option must be an AbortSignal: ${String(cancelSignal)}`);\n\t}\n};\n\n// Terminate the subprocess when aborting the `cancelSignal` option and `gracefulSignal` is `false`\nexport const throwOnCancel = ({kill, cancelSignal, gracefulCancel, context, controller}) => cancelSignal === undefined || gracefulCancel\n\t? []\n\t: [terminateOnCancel(kill, cancelSignal, context, controller)];\n\nconst terminateOnCancel = async (kill, cancelSignal, context, {signal}) => {\n\tawait onAbortedSignal(cancelSignal, signal);\n\tcontext.terminationReason ??= 'cancel';\n\tkill();\n\tthrow cancelSignal.reason;\n};\n","// Validate the IPC channel is connected before receiving/sending messages\nexport const validateIpcMethod = ({methodName, isSubprocess, ipc, isConnected}) => {\n\tvalidateIpcOption(methodName, isSubprocess, ipc);\n\tvalidateConnection(methodName, isSubprocess, isConnected);\n};\n\n// Better error message when forgetting to set `ipc: true` and using the IPC methods\nconst validateIpcOption = (methodName, isSubprocess, ipc) => {\n\tif (!ipc) {\n\t\tthrow new Error(`${getMethodName(methodName, isSubprocess)} can only be used if the \\`ipc\\` option is \\`true\\`.`);\n\t}\n};\n\n// Better error message when one process does not send/receive messages once the other process has disconnected.\n// This also makes it clear that any buffered messages are lost once either process has disconnected.\n// Also when aborting `cancelSignal` after disconnecting the IPC.\nexport const validateConnection = (methodName, isSubprocess, isConnected) => {\n\tif (!isConnected) {\n\t\tthrow new Error(`${getMethodName(methodName, isSubprocess)} cannot be used: the ${getOtherProcessName(isSubprocess)} has already exited or disconnected.`);\n\t}\n};\n\n// When `getOneMessage()` could not complete due to an early disconnection\nexport const throwOnEarlyDisconnect = isSubprocess => {\n\tthrow new Error(`${getMethodName('getOneMessage', isSubprocess)} could not complete: the ${getOtherProcessName(isSubprocess)} exited or disconnected.`);\n};\n\n// When both processes use `sendMessage()` with `strict` at the same time\nexport const throwOnStrictDeadlockError = isSubprocess => {\n\tthrow new Error(`${getMethodName('sendMessage', isSubprocess)} failed: the ${getOtherProcessName(isSubprocess)} is sending a message too, instead of listening to incoming messages.\nThis can be fixed by both sending a message and listening to incoming messages at the same time:\n\nconst [receivedMessage] = await Promise.all([\n\t${getMethodName('getOneMessage', isSubprocess)},\n\t${getMethodName('sendMessage', isSubprocess, 'message, {strict: true}')},\n]);`);\n};\n\n// When the other process used `strict` but the current process had I/O error calling `sendMessage()` for the response\nexport const getStrictResponseError = (error, isSubprocess) => new Error(`${getMethodName('sendMessage', isSubprocess)} failed when sending an acknowledgment response to the ${getOtherProcessName(isSubprocess)}.`, {cause: error});\n\n// When using `strict` but the other process was not listening for messages\nexport const throwOnMissingStrict = isSubprocess => {\n\tthrow new Error(`${getMethodName('sendMessage', isSubprocess)} failed: the ${getOtherProcessName(isSubprocess)} is not listening to incoming messages.`);\n};\n\n// When using `strict` but the other process disconnected before receiving the message\nexport const throwOnStrictDisconnect = isSubprocess => {\n\tthrow new Error(`${getMethodName('sendMessage', isSubprocess)} failed: the ${getOtherProcessName(isSubprocess)} exited without listening to incoming messages.`);\n};\n\n// When the current process disconnects while the subprocess is listening to `cancelSignal`\nexport const getAbortDisconnectError = () => new Error(`\\`cancelSignal\\` aborted: the ${getOtherProcessName(true)} disconnected.`);\n\n// When the subprocess uses `cancelSignal` but not the current process\nexport const throwOnMissingParent = () => {\n\tthrow new Error('`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.');\n};\n\n// EPIPE can happen when sending a message to a subprocess that is closing but has not disconnected yet\nexport const handleEpipeError = ({error, methodName, isSubprocess}) => {\n\tif (error.code === 'EPIPE') {\n\t\tthrow new Error(`${getMethodName(methodName, isSubprocess)} cannot be used: the ${getOtherProcessName(isSubprocess)} is disconnecting.`, {cause: error});\n\t}\n};\n\n// Better error message when sending messages which cannot be serialized.\n// Works with both `serialization: 'advanced'` and `serialization: 'json'`.\nexport const handleSerializationError = ({error, methodName, isSubprocess, message}) => {\n\tif (isSerializationError(error)) {\n\t\tthrow new Error(`${getMethodName(methodName, isSubprocess)}'s argument type is invalid: the message cannot be serialized: ${String(message)}.`, {cause: error});\n\t}\n};\n\nconst isSerializationError = ({code, message}) => SERIALIZATION_ERROR_CODES.has(code)\n\t|| SERIALIZATION_ERROR_MESSAGES.some(serializationErrorMessage => message.includes(serializationErrorMessage));\n\n// `error.code` set by Node.js when it failed to serialize the message\nconst SERIALIZATION_ERROR_CODES = new Set([\n\t// Message is `undefined`\n\t'ERR_MISSING_ARGS',\n\t// Message is a function, a bigint, a symbol\n\t'ERR_INVALID_ARG_TYPE',\n]);\n\n// `error.message` set by Node.js when it failed to serialize the message\nconst SERIALIZATION_ERROR_MESSAGES = [\n\t// Message is a promise or a proxy, with `serialization: 'advanced'`\n\t'could not be cloned',\n\t// Message has cycles, with `serialization: 'json'`\n\t'circular structure',\n\t// Message has cycles inside toJSON(), with `serialization: 'json'`\n\t'call stack size exceeded',\n];\n\nconst getMethodName = (methodName, isSubprocess, parameters = '') => methodName === 'cancelSignal'\n\t? '`cancelSignal`\\'s `controller.abort()`'\n\t: `${getNamespaceName(isSubprocess)}${methodName}(${parameters})`;\n\nconst getNamespaceName = isSubprocess => isSubprocess ? '' : 'subprocess.';\n\nconst getOtherProcessName = isSubprocess => isSubprocess ? 'parent process' : 'subprocess';\n\n// When any error arises, we disconnect the IPC.\n// Otherwise, it is likely that one of the processes will stop sending/receiving messages.\n// This would leave the other process hanging.\nexport const disconnect = anyProcess => {\n\tif (anyProcess.connected) {\n\t\tanyProcess.disconnect();\n\t}\n};\n","export const createDeferred = () => {\n\tconst methods = {};\n\tconst promise = new Promise((resolve, reject) => {\n\t\tObject.assign(methods, {resolve, reject});\n\t});\n\treturn Object.assign(promise, methods);\n};\n","import {addAbortListener} from 'node:events';\n\n// Temporarily increase the maximum number of listeners on an eventEmitter\nexport const incrementMaxListeners = (eventEmitter, maxListenersIncrement, signal) => {\n\tconst maxListeners = eventEmitter.getMaxListeners();\n\tif (maxListeners === 0 || maxListeners === Infinity) {\n\t\treturn;\n\t}\n\n\teventEmitter.setMaxListeners(maxListeners + maxListenersIncrement);\n\taddAbortListener(signal, () => {\n\t\teventEmitter.setMaxListeners(eventEmitter.getMaxListeners() - maxListenersIncrement);\n\t});\n};\n","// By default, Node.js keeps the subprocess alive while it has a `message` or `disconnect` listener.\n// We replicate the same logic for the events that we proxy.\n// This ensures the subprocess is kept alive while `getOneMessage()` and `getEachMessage()` are ongoing.\n// This is not a problem with `sendMessage()` since Node.js handles that method automatically.\n// We do not use `anyProcess.channel.ref()` since this would prevent the automatic `.channel.refCounted()` Node.js is doing.\n// We keep a reference to `anyProcess.channel` since it might be `null` while `getOneMessage()` or `getEachMessage()` is still processing debounced messages.\n// See https://github.com/nodejs/node/blob/2aaeaa863c35befa2ebaa98fb7737ec84df4d8e9/lib/internal/child_process.js#L547\nexport const addReference = (channel, reference) => {\n\tif (reference) {\n\t\taddReferenceCount(channel);\n\t}\n};\n\nconst addReferenceCount = channel => {\n\tchannel.refCounted();\n};\n\nexport const removeReference = (channel, reference) => {\n\tif (reference) {\n\t\tremoveReferenceCount(channel);\n\t}\n};\n\nconst removeReferenceCount = channel => {\n\tchannel.unrefCounted();\n};\n\n// To proxy events, we setup some global listeners on the `message` and `disconnect` events.\n// Those should not keep the subprocess alive, so we remove the automatic counting that Node.js is doing.\n// See https://github.com/nodejs/node/blob/1b965270a9c273d4cf70e8808e9d28b9ada7844f/lib/child_process.js#L180\nexport const undoAddedReferences = (channel, isSubprocess) => {\n\tif (!isSubprocess) {\n\t\treturn;\n\t}\n\n\tremoveReferenceCount(channel);\n\tremoveReferenceCount(channel);\n};\n\n// Reverse it during `disconnect`\nexport const redoAddedReferences = (channel, isSubprocess) => {\n\tif (!isSubprocess) {\n\t\treturn;\n\t}\n\n\taddReferenceCount(channel);\n\taddReferenceCount(channel);\n};\n","import {once} from 'node:events';\nimport {scheduler} from 'node:timers/promises';\nimport {waitForOutgoingMessages} from './outgoing.js';\nimport {redoAddedReferences} from './reference.js';\nimport {handleStrictRequest, handleStrictResponse} from './strict.js';\nimport {handleAbort, abortOnDisconnect} from './graceful.js';\n\n// By default, Node.js buffers `message` events.\n// - Buffering happens when there is a `message` event is emitted but there is no handler.\n// - As soon as a `message` event handler is set, all buffered `message` events are emitted, emptying the buffer.\n// - This happens both in the current process and the subprocess.\n// - See https://github.com/nodejs/node/blob/501546e8f37059cd577041e23941b640d0d4d406/lib/internal/child_process.js#L719\n// This is helpful. Notably, this allows sending messages to a subprocess that's still initializing.\n// However, it has several problems.\n// - This works with `events.on()` but not `events.once()` since all buffered messages are emitted at once.\n// For example, users cannot call `await getOneMessage()`/`getEachMessage()` multiple times in a row.\n// - When a user intentionally starts listening to `message` at a specific point in time, past `message` events are replayed, which might be unexpected.\n// - Buffering is unlimited, which might lead to an out-of-memory crash.\n// - This does not work well with multiple consumers.\n// For example, Execa consumes events with both `result.ipcOutput` and manual IPC calls like `getOneMessage()`.\n// Since `result.ipcOutput` reads all incoming messages, no buffering happens for manual IPC calls.\n// - Forgetting to setup a `message` listener, or setting it up too late, is a programming mistake.\n// The default behavior does not allow users to realize they made that mistake.\n// To solve those problems, instead of buffering messages, we debounce them.\n// The `message` event so it is emitted at most once per macrotask.\nexport const onMessage = async ({anyProcess, channel, isSubprocess, ipcEmitter}, wrappedMessage) => {\n\tif (handleStrictResponse(wrappedMessage) || handleAbort(wrappedMessage)) {\n\t\treturn;\n\t}\n\n\tif (!INCOMING_MESSAGES.has(anyProcess)) {\n\t\tINCOMING_MESSAGES.set(anyProcess, []);\n\t}\n\n\tconst incomingMessages = INCOMING_MESSAGES.get(anyProcess);\n\tincomingMessages.push(wrappedMessage);\n\n\tif (incomingMessages.length > 1) {\n\t\treturn;\n\t}\n\n\twhile (incomingMessages.length > 0) {\n\t\t// eslint-disable-next-line no-await-in-loop\n\t\tawait waitForOutgoingMessages(anyProcess, ipcEmitter, wrappedMessage);\n\t\t// eslint-disable-next-line no-await-in-loop\n\t\tawait scheduler.yield();\n\n\t\t// eslint-disable-next-line no-await-in-loop\n\t\tconst message = await handleStrictRequest({\n\t\t\twrappedMessage: incomingMessages[0],\n\t\t\tanyProcess,\n\t\t\tchannel,\n\t\t\tisSubprocess,\n\t\t\tipcEmitter,\n\t\t});\n\n\t\tincomingMessages.shift();\n\t\tipcEmitter.emit('message', message);\n\t\tipcEmitter.emit('message:done');\n\t}\n};\n\n// If the `message` event is currently debounced, the `disconnect` event must wait for it\nexport const onDisconnect = async ({anyProcess, channel, isSubprocess, ipcEmitter, boundOnMessage}) => {\n\tabortOnDisconnect();\n\n\tconst incomingMessages = INCOMING_MESSAGES.get(anyProcess);\n\twhile (incomingMessages?.length > 0) {\n\t\t// eslint-disable-next-line no-await-in-loop\n\t\tawait once(ipcEmitter, 'message:done');\n\t}\n\n\tanyProcess.removeListener('message', boundOnMessage);\n\tredoAddedReferences(channel, isSubprocess);\n\tipcEmitter.connected = false;\n\tipcEmitter.emit('disconnect');\n};\n\nconst INCOMING_MESSAGES = new WeakMap();\n","import {EventEmitter} from 'node:events';\nimport {onMessage, onDisconnect} from './incoming.js';\nimport {undoAddedReferences} from './reference.js';\n\n// Forward the `message` and `disconnect` events from the process and subprocess to a proxy emitter.\n// This prevents the `error` event from stopping IPC.\n// This also allows debouncing the `message` event.\nexport const getIpcEmitter = (anyProcess, channel, isSubprocess) => {\n\tif (IPC_EMITTERS.has(anyProcess)) {\n\t\treturn IPC_EMITTERS.get(anyProcess);\n\t}\n\n\t// Use an `EventEmitter`, like the `process` that is being proxied\n\t// eslint-disable-next-line unicorn/prefer-event-target\n\tconst ipcEmitter = new EventEmitter();\n\tipcEmitter.connected = true;\n\tIPC_EMITTERS.set(anyProcess, ipcEmitter);\n\tforwardEvents({\n\t\tipcEmitter,\n\t\tanyProcess,\n\t\tchannel,\n\t\tisSubprocess,\n\t});\n\treturn ipcEmitter;\n};\n\nconst IPC_EMITTERS = new WeakMap();\n\n// The `message` and `disconnect` events are buffered in the subprocess until the first listener is setup.\n// However, unbuffering happens after one tick, so this give enough time for the caller to setup the listener on the proxy emitter first.\n// See https://github.com/nodejs/node/blob/2aaeaa863c35befa2ebaa98fb7737ec84df4d8e9/lib/internal/child_process.js#L721\nconst forwardEvents = ({ipcEmitter, anyProcess, channel, isSubprocess}) => {\n\tconst boundOnMessage = onMessage.bind(undefined, {\n\t\tanyProcess,\n\t\tchannel,\n\t\tisSubprocess,\n\t\tipcEmitter,\n\t});\n\tanyProcess.on('message', boundOnMessage);\n\tanyProcess.once('disconnect', onDisconnect.bind(undefined, {\n\t\tanyProcess,\n\t\tchannel,\n\t\tisSubprocess,\n\t\tipcEmitter,\n\t\tboundOnMessage,\n\t}));\n\tundoAddedReferences(channel, isSubprocess);\n};\n\n// Check whether there might still be some `message` events to receive\nexport const isConnected = anyProcess => {\n\tconst ipcEmitter = IPC_EMITTERS.get(anyProcess);\n\treturn ipcEmitter === undefined\n\t\t? anyProcess.channel !== undefined && anyProcess.channel !== null\n\t\t: ipcEmitter.connected;\n};\n","import {once} from 'node:events';\nimport {createDeferred} from '../utils/deferred.js';\nimport {incrementMaxListeners} from '../utils/max-listeners.js';\nimport {sendMessage} from './send.js';\nimport {throwOnMissingStrict, throwOnStrictDisconnect, throwOnStrictDeadlockError} from './validation.js';\nimport {getIpcEmitter} from './forward.js';\nimport {hasMessageListeners} from './outgoing.js';\n\n// When using the `strict` option, wrap the message with metadata during `sendMessage()`\nexport const handleSendStrict = ({anyProcess, channel, isSubprocess, message, strict}) => {\n\tif (!strict) {\n\t\treturn message;\n\t}\n\n\tconst ipcEmitter = getIpcEmitter(anyProcess, channel, isSubprocess);\n\tconst hasListeners = hasMessageListeners(anyProcess, ipcEmitter);\n\treturn {\n\t\tid: count++,\n\t\ttype: REQUEST_TYPE,\n\t\tmessage,\n\t\thasListeners,\n\t};\n};\n\nlet count = 0n;\n\n// Handles when both processes are calling `sendMessage()` with `strict` at the same time.\n// If neither process is listening, this would create a deadlock. We detect it and throw.\nexport const validateStrictDeadlock = (outgoingMessages, wrappedMessage) => {\n\tif (wrappedMessage?.type !== REQUEST_TYPE || wrappedMessage.hasListeners) {\n\t\treturn;\n\t}\n\n\tfor (const {id} of outgoingMessages) {\n\t\tif (id !== undefined) {\n\t\t\tSTRICT_RESPONSES[id].resolve({isDeadlock: true, hasListeners: false});\n\t\t}\n\t}\n};\n\n// The other process then sends the acknowledgment back as a response\nexport const handleStrictRequest = async ({wrappedMessage, anyProcess, channel, isSubprocess, ipcEmitter}) => {\n\tif (wrappedMessage?.type !== REQUEST_TYPE || !anyProcess.connected) {\n\t\treturn wrappedMessage;\n\t}\n\n\tconst {id, message} = wrappedMessage;\n\tconst response = {id, type: RESPONSE_TYPE, message: hasMessageListeners(anyProcess, ipcEmitter)};\n\n\ttry {\n\t\tawait sendMessage({\n\t\t\tanyProcess,\n\t\t\tchannel,\n\t\t\tisSubprocess,\n\t\t\tipc: true,\n\t\t}, response);\n\t} catch (error) {\n\t\tipcEmitter.emit('strict:error', error);\n\t}\n\n\treturn message;\n};\n\n// Reception of the acknowledgment response\nexport const handleStrictResponse = wrappedMessage => {\n\tif (wrappedMessage?.type !== RESPONSE_TYPE) {\n\t\treturn false;\n\t}\n\n\tconst {id, message: hasListeners} = wrappedMessage;\n\tSTRICT_RESPONSES[id]?.resolve({isDeadlock: false, hasListeners});\n\treturn true;\n};\n\n// Wait for the other process to receive the message from `sendMessage()`\nexport const waitForStrictResponse = async (wrappedMessage, anyProcess, isSubprocess) => {\n\tif (wrappedMessage?.type !== REQUEST_TYPE) {\n\t\treturn;\n\t}\n\n\tconst deferred = createDeferred();\n\tSTRICT_RESPONSES[wrappedMessage.id] = deferred;\n\tconst controller = new AbortController();\n\n\ttry {\n\t\tconst {isDeadlock, hasListeners} = await Promise.race([\n\t\t\tdeferred,\n\t\t\tthrowOnDisconnect(anyProcess, isSubprocess, controller),\n\t\t]);\n\n\t\tif (isDeadlock) {\n\t\t\tthrowOnStrictDeadlockError(isSubprocess);\n\t\t}\n\n\t\tif (!hasListeners) {\n\t\t\tthrowOnMissingStrict(isSubprocess);\n\t\t}\n\t} finally {\n\t\tcontroller.abort();\n\t\tdelete STRICT_RESPONSES[wrappedMessage.id];\n\t}\n};\n\nconst STRICT_RESPONSES = {};\n\nconst throwOnDisconnect = async (anyProcess, isSubprocess, {signal}) => {\n\tincrementMaxListeners(anyProcess, 1, signal);\n\tawait once(anyProcess, 'disconnect', {signal});\n\tthrowOnStrictDisconnect(isSubprocess);\n};\n\nconst REQUEST_TYPE = 'execa:ipc:request';\nconst RESPONSE_TYPE = 'execa:ipc:response';\n","import {createDeferred} from '../utils/deferred.js';\nimport {getFdSpecificValue} from '../arguments/specific.js';\nimport {validateStrictDeadlock} from './strict.js';\n\n// When `sendMessage()` is ongoing, any `message` being received waits before being emitted.\n// This allows calling one or multiple `await sendMessage()` followed by `await getOneMessage()`/`await getEachMessage()`.\n// Without running into a race condition when the other process sends a response too fast, before the current process set up a listener.\nexport const startSendMessage = (anyProcess, wrappedMessage, strict) => {\n\tif (!OUTGOING_MESSAGES.has(anyProcess)) {\n\t\tOUTGOING_MESSAGES.set(anyProcess, new Set());\n\t}\n\n\tconst outgoingMessages = OUTGOING_MESSAGES.get(anyProcess);\n\tconst onMessageSent = createDeferred();\n\tconst id = strict ? wrappedMessage.id : undefined;\n\tconst outgoingMessage = {onMessageSent, id};\n\toutgoingMessages.add(outgoingMessage);\n\treturn {outgoingMessages, outgoingMessage};\n};\n\nexport const endSendMessage = ({outgoingMessages, outgoingMessage}) => {\n\toutgoingMessages.delete(outgoingMessage);\n\toutgoingMessage.onMessageSent.resolve();\n};\n\n// Await while `sendMessage()` is ongoing, unless there is already a `message` listener\nexport const waitForOutgoingMessages = async (anyProcess, ipcEmitter, wrappedMessage) => {\n\twhile (!hasMessageListeners(anyProcess, ipcEmitter) && OUTGOING_MESSAGES.get(anyProcess)?.size > 0) {\n\t\tconst outgoingMessages = [...OUTGOING_MESSAGES.get(anyProcess)];\n\t\tvalidateStrictDeadlock(outgoingMessages, wrappedMessage);\n\t\t// eslint-disable-next-line no-await-in-loop\n\t\tawait Promise.all(outgoingMessages.map(({onMessageSent}) => onMessageSent));\n\t}\n};\n\nconst OUTGOING_MESSAGES = new WeakMap();\nconst IPC_SUBPROCESS_OPTIONS = new WeakMap();\n\nexport const setIpcSubprocessOptions = (subprocess, options) => {\n\tIPC_SUBPROCESS_OPTIONS.set(subprocess, options);\n};\n\n// Whether any `message` listener is setup\nexport const hasMessageListeners = (anyProcess, ipcEmitter) => ipcEmitter.listenerCount('message') > getMinListenerCount(anyProcess);\n\n// When `buffer` is `false`, we set up a `message` listener that should be ignored.\n// That listener is only meant to intercept `strict` acknowledgement responses.\nconst getMinListenerCount = anyProcess => getOptions(anyProcess) !== undefined\n\t&& !getFdSpecificValue(getOptions(anyProcess).buffer, 'ipc')\n\t? 1\n\t: 0;\n\nconst getOptions = anyProcess => IPC_SUBPROCESS_OPTIONS.get(anyProcess);\n","import {promisify} from 'node:util';\nimport {\n\tvalidateIpcMethod,\n\thandleEpipeError,\n\thandleSerializationError,\n\tdisconnect,\n} from './validation.js';\nimport {startSendMessage, endSendMessage} from './outgoing.js';\nimport {handleSendStrict, waitForStrictResponse} from './strict.js';\n\n// Like `[sub]process.send()` but promise-based.\n// We do not `await subprocess` during `.sendMessage()` nor `.getOneMessage()` since those methods are transient.\n// Users would still need to `await subprocess` after the method is done.\n// Also, this would prevent `unhandledRejection` event from being emitted, making it silent.\nexport const sendMessage = ({anyProcess, channel, isSubprocess, ipc}, message, {strict = false} = {}) => {\n\tconst methodName = 'sendMessage';\n\tvalidateIpcMethod({\n\t\tmethodName,\n\t\tisSubprocess,\n\t\tipc,\n\t\tisConnected: anyProcess.connected,\n\t});\n\n\treturn sendMessageAsync({\n\t\tanyProcess,\n\t\tchannel,\n\t\tmethodName,\n\t\tisSubprocess,\n\t\tmessage,\n\t\tstrict,\n\t});\n};\n\nconst sendMessageAsync = async ({anyProcess, channel, methodName, isSubprocess, message, strict}) => {\n\tconst wrappedMessage = handleSendStrict({\n\t\tanyProcess,\n\t\tchannel,\n\t\tisSubprocess,\n\t\tmessage,\n\t\tstrict,\n\t});\n\tconst outgoingMessagesState = startSendMessage(anyProcess, wrappedMessage, strict);\n\ttry {\n\t\tawait sendOneMessage({\n\t\t\tanyProcess,\n\t\t\tmethodName,\n\t\t\tisSubprocess,\n\t\t\twrappedMessage,\n\t\t\tmessage,\n\t\t});\n\t} catch (error) {\n\t\tdisconnect(anyProcess);\n\t\tthrow error;\n\t} finally {\n\t\tendSendMessage(outgoingMessagesState);\n\t}\n};\n\n// Used internally by `cancelSignal`\nexport const sendOneMessage = async ({anyProcess, methodName, isSubprocess, wrappedMessage, message}) => {\n\tconst sendMethod = getSendMethod(anyProcess);\n\n\ttry {\n\t\tawait Promise.all([\n\t\t\twaitForStrictResponse(wrappedMessage, anyProcess, isSubprocess),\n\t\t\tsendMethod(wrappedMessage),\n\t\t]);\n\t} catch (error) {\n\t\thandleEpipeError({error, methodName, isSubprocess});\n\t\thandleSerializationError({\n\t\t\terror,\n\t\t\tmethodName,\n\t\t\tisSubprocess,\n\t\t\tmessage,\n\t\t});\n\t\tthrow error;\n\t}\n};\n\n// [sub]process.send() promisified, memoized\nconst getSendMethod = anyProcess => {\n\tif (PROCESS_SEND_METHODS.has(anyProcess)) {\n\t\treturn PROCESS_SEND_METHODS.get(anyProcess);\n\t}\n\n\tconst sendMethod = promisify(anyProcess.send.bind(anyProcess));\n\tPROCESS_SEND_METHODS.set(anyProcess, sendMethod);\n\treturn sendMethod;\n};\n\nconst PROCESS_SEND_METHODS = new WeakMap();\n","import {scheduler} from 'node:timers/promises';\nimport {sendOneMessage} from './send.js';\nimport {getIpcEmitter} from './forward.js';\nimport {validateConnection, getAbortDisconnectError, throwOnMissingParent} from './validation.js';\n\n// Send an IPC message so the subprocess performs a graceful termination\nexport const sendAbort = (subprocess, message) => {\n\tconst methodName = 'cancelSignal';\n\tvalidateConnection(methodName, false, subprocess.connected);\n\treturn sendOneMessage({\n\t\tanyProcess: subprocess,\n\t\tmethodName,\n\t\tisSubprocess: false,\n\t\twrappedMessage: {type: GRACEFUL_CANCEL_TYPE, message},\n\t\tmessage,\n\t});\n};\n\n// When the signal is being used, start listening for incoming messages.\n// Unbuffering messages takes one microtask to complete, so this must be async.\nexport const getCancelSignal = async ({anyProcess, channel, isSubprocess, ipc}) => {\n\tawait startIpc({\n\t\tanyProcess,\n\t\tchannel,\n\t\tisSubprocess,\n\t\tipc,\n\t});\n\treturn cancelController.signal;\n};\n\nconst startIpc = async ({anyProcess, channel, isSubprocess, ipc}) => {\n\tif (isCancelListening) {\n\t\treturn;\n\t}\n\n\tisCancelListening = true;\n\n\tif (!ipc) {\n\t\tthrowOnMissingParent();\n\t\treturn;\n\t}\n\n\tif (channel === null) {\n\t\tabortOnDisconnect();\n\t\treturn;\n\t}\n\n\tgetIpcEmitter(anyProcess, channel, isSubprocess);\n\tawait scheduler.yield();\n};\n\nlet isCancelListening = false;\n\n// Reception of IPC message to perform a graceful termination\nexport const handleAbort = wrappedMessage => {\n\tif (wrappedMessage?.type !== GRACEFUL_CANCEL_TYPE) {\n\t\treturn false;\n\t}\n\n\tcancelController.abort(wrappedMessage.message);\n\treturn true;\n};\n\nconst GRACEFUL_CANCEL_TYPE = 'execa:ipc:cancel';\n\n// When the current process disconnects early, the subprocess `cancelSignal` is aborted.\n// Otherwise, the signal would never be able to be aborted later on.\nexport const abortOnDisconnect = () => {\n\tcancelController.abort(getAbortDisconnectError());\n};\n\nconst cancelController = new AbortController();\n","import {onAbortedSignal} from '../utils/abort-signal.js';\nimport {sendAbort} from '../ipc/graceful.js';\nimport {killOnTimeout} from './kill.js';\n\n// Validate the `gracefulCancel` option\nexport const validateGracefulCancel = ({gracefulCancel, cancelSignal, ipc, serialization}) => {\n\tif (!gracefulCancel) {\n\t\treturn;\n\t}\n\n\tif (cancelSignal === undefined) {\n\t\tthrow new Error('The `cancelSignal` option must be defined when setting the `gracefulCancel` option.');\n\t}\n\n\tif (!ipc) {\n\t\tthrow new Error('The `ipc` option cannot be false when setting the `gracefulCancel` option.');\n\t}\n\n\tif (serialization === 'json') {\n\t\tthrow new Error('The `serialization` option cannot be \\'json\\' when setting the `gracefulCancel` option.');\n\t}\n};\n\n// Send abort reason to the subprocess when aborting the `cancelSignal` option and `gracefulCancel` is `true`\nexport const throwOnGracefulCancel = ({\n\tsubprocess,\n\tkill,\n\tcancelSignal,\n\tgracefulCancel,\n\tforceKillAfterDelay,\n\tcontext,\n\tcontroller,\n}) => gracefulCancel\n\t? [sendOnAbort({\n\t\tsubprocess,\n\t\tkill,\n\t\tcancelSignal,\n\t\tforceKillAfterDelay,\n\t\tcontext,\n\t\tcontroller,\n\t})]\n\t: [];\n\nconst sendOnAbort = async ({subprocess, kill, cancelSignal, forceKillAfterDelay, context, controller: {signal}}) => {\n\tawait onAbortedSignal(cancelSignal, signal);\n\tconst reason = getReason(cancelSignal);\n\tawait sendAbort(subprocess, reason);\n\tkillOnTimeout({\n\t\tkill,\n\t\tforceKillAfterDelay,\n\t\tcontext,\n\t\tcontrollerSignal: signal,\n\t});\n\tcontext.terminationReason ??= 'gracefulCancel';\n\tthrow cancelSignal.reason;\n};\n\n// The default `reason` is a DOMException, which is not serializable with V8\n// See https://github.com/nodejs/node/issues/53225\nconst getReason = ({reason}) => {\n\tif (!(reason instanceof DOMException)) {\n\t\treturn reason;\n\t}\n\n\tconst error = new Error(reason.message);\n\tObject.defineProperty(error, 'stack', {\n\t\tvalue: reason.stack,\n\t\tenumerable: false,\n\t\tconfigurable: true,\n\t\twritable: true,\n\t});\n\treturn error;\n};\n","import {setTimeout} from 'node:timers/promises';\nimport {DiscardedError} from '../return/final-error.js';\n\n// Validate `timeout` option\nexport const validateTimeout = ({timeout}) => {\n\tif (timeout !== undefined && (!Number.isFinite(timeout) || timeout < 0)) {\n\t\tthrow new TypeError(`Expected the \\`timeout\\` option to be a non-negative integer, got \\`${timeout}\\` (${typeof timeout})`);\n\t}\n};\n\n// Fails when the `timeout` option is exceeded\nexport const throwOnTimeout = (kill, timeout, context, controller) => timeout === 0 || timeout === undefined\n\t? []\n\t: [killAfterTimeout(kill, timeout, context, controller)];\n\nconst killAfterTimeout = async (kill, timeout, context, {signal}) => {\n\tawait setTimeout(timeout, undefined, {signal});\n\tcontext.terminationReason ??= 'timeout';\n\tkill();\n\tthrow new DiscardedError();\n};\n","import {execPath, execArgv} from 'node:process';\nimport path from 'node:path';\nimport {safeNormalizeFileUrl} from '../arguments/file-url.js';\n\n// `execaNode()` is a shortcut for `execa(..., {node: true})`\nexport const mapNode = ({options}) => {\n\tif (options.node === false) {\n\t\tthrow new TypeError('The \"node\" option cannot be false with `execaNode()`.');\n\t}\n\n\treturn {options: {...options, node: true}};\n};\n\n// Applies the `node: true` option, and the related `nodePath`/`nodeOptions` options.\n// Modifies the file commands/arguments to ensure the same Node binary and flags are re-used.\n// Also adds `ipc: true` and `shell: false`.\nexport const handleNodeOption = (file, commandArguments, {\n\tnode: shouldHandleNode = false,\n\tnodePath = execPath,\n\tnodeOptions = execArgv.filter(nodeOption => !nodeOption.startsWith('--inspect')),\n\tcwd,\n\texecPath: formerNodePath,\n\t...options\n}) => {\n\tif (formerNodePath !== undefined) {\n\t\tthrow new TypeError('The \"execPath\" option has been removed. Please use the \"nodePath\" option instead.');\n\t}\n\n\tconst normalizedNodePath = safeNormalizeFileUrl(nodePath, 'The \"nodePath\" option');\n\tconst resolvedNodePath = path.resolve(cwd, normalizedNodePath);\n\t// Use spread (which only copies own properties) to safely get shell without reading polluted prototype\n\tconst newOptions = {\n\t\t__proto__: null,\n\t\tshell: false,\n\t\t...options,\n\t\tnodePath: resolvedNodePath,\n\t\tnode: shouldHandleNode,\n\t\tcwd,\n\t};\n\n\tif (!shouldHandleNode) {\n\t\treturn [file, commandArguments, newOptions];\n\t}\n\n\tif (path.basename(file, '.exe') === 'node') {\n\t\tthrow new TypeError('When the \"node\" option is true, the first argument does not need to be \"node\".');\n\t}\n\n\treturn [\n\t\tresolvedNodePath,\n\t\t[\n\t\t\t...nodeOptions,\n\t\t\tfile,\n\t\t\t...commandArguments,\n\t\t],\n\t\t{\n\t\t\t__proto__: null,\n\t\t\tipc: true,\n\t\t\t...newOptions,\n\t\t\tshell: false,\n\t\t},\n\t];\n};\n","import {serialize} from 'node:v8';\nimport {sendMessage} from './send.js';\n\n// Validate the `ipcInput` option\nexport const validateIpcInputOption = ({ipcInput, ipc, serialization}) => {\n\tif (ipcInput === undefined) {\n\t\treturn;\n\t}\n\n\tif (!ipc) {\n\t\tthrow new Error('The `ipcInput` option cannot be set unless the `ipc` option is `true`.');\n\t}\n\n\tvalidateIpcInput[serialization](ipcInput);\n};\n\nconst validateAdvancedInput = ipcInput => {\n\ttry {\n\t\tserialize(ipcInput);\n\t} catch (error) {\n\t\tthrow new Error('The `ipcInput` option is not serializable with a structured clone.', {cause: error});\n\t}\n};\n\nconst validateJsonInput = ipcInput => {\n\ttry {\n\t\tJSON.stringify(ipcInput);\n\t} catch (error) {\n\t\tthrow new Error('The `ipcInput` option is not serializable with JSON.', {cause: error});\n\t}\n};\n\nconst validateIpcInput = {\n\tadvanced: validateAdvancedInput,\n\tjson: validateJsonInput,\n};\n\n// When the `ipcInput` option is set, it is sent as an initial IPC message to the subprocess\nexport const sendIpcInput = async (subprocess, ipcInput, ipc) => {\n\tif (ipcInput === undefined) {\n\t\treturn;\n\t}\n\n\tawait sendMessage({\n\t\tanyProcess: subprocess,\n\t\tchannel: subprocess.channel,\n\t\tisSubprocess: false,\n\t\tipc,\n\t}, ipcInput);\n};\n","// Validate `encoding` option\nexport const validateEncoding = ({encoding}) => {\n\tif (ENCODINGS.has(encoding)) {\n\t\treturn;\n\t}\n\n\tconst correctEncoding = getCorrectEncoding(encoding);\n\tif (correctEncoding !== undefined) {\n\t\tthrow new TypeError(`Invalid option \\`encoding: ${serializeEncoding(encoding)}\\`.\nPlease rename it to ${serializeEncoding(correctEncoding)}.`);\n\t}\n\n\tconst correctEncodings = [...ENCODINGS].map(correctEncoding => serializeEncoding(correctEncoding)).join(', ');\n\tthrow new TypeError(`Invalid option \\`encoding: ${serializeEncoding(encoding)}\\`.\nPlease rename it to one of: ${correctEncodings}.`);\n};\n\nconst TEXT_ENCODINGS = new Set(['utf8', 'utf16le']);\nexport const BINARY_ENCODINGS = new Set(['buffer', 'hex', 'base64', 'base64url', 'latin1', 'ascii']);\nconst ENCODINGS = TEXT_ENCODINGS.union(BINARY_ENCODINGS);\n\nconst getCorrectEncoding = encoding => {\n\tif (encoding === null) {\n\t\treturn 'buffer';\n\t}\n\n\tif (typeof encoding !== 'string') {\n\t\treturn;\n\t}\n\n\tconst lowerEncoding = encoding.toLowerCase();\n\tif (lowerEncoding in ENCODING_ALIASES) {\n\t\treturn ENCODING_ALIASES[lowerEncoding];\n\t}\n\n\tif (ENCODINGS.has(lowerEncoding)) {\n\t\treturn lowerEncoding;\n\t}\n};\n\nconst ENCODING_ALIASES = {\n\t// eslint-disable-next-line unicorn/text-encoding-identifier-case\n\t'utf-8': 'utf8',\n\t'utf-16le': 'utf16le',\n\t'ucs-2': 'utf16le',\n\tucs2: 'utf16le',\n\tbinary: 'latin1',\n};\n\nconst serializeEncoding = encoding => typeof encoding === 'string' ? `\"${encoding}\"` : String(encoding);\n","import fs from 'node:fs';\nimport fsPromises from 'node:fs/promises';\nimport path from 'node:path';\nimport process from 'node:process';\n\nconst isWindows = process.platform === 'win32';\n\n// A command containing a directory separator is treated as a path and looked up directly, instead of being searched for in `PATH`. Backslash only counts as a separator on Windows, since it's a valid filename character on other platforms.\nconst separatorPattern = isWindows ? /[\\/\\\\]/v : /\\//v;\n\n// The standard Windows executable extensions, used when `PATHEXT` is not set.\nconst defaultPathExt = '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC';\n\nfunction resolveOptions(command, options) {\n\tif (typeof command !== 'string' || command.length === 0) {\n\t\tthrow new TypeError('Expected a non-empty string.');\n\t}\n\n\tconst {\n\t\tcwd = process.cwd(),\n\t\t// On Windows, `process.env.PATH` can be undefined in some contexts (for example, worker threads), where it's only exposed as `Path`.\n\t\tpath: searchPath = process.env.PATH ?? (isWindows ? process.env.Path : undefined) ?? '',\n\t\t// `||` (not `??`) so an empty `PATHEXT` falls back to the default instead of disabling all lookup on Windows.\n\t\tpathExt = process.env.PATHEXT || defaultPathExt,\n\t} = options;\n\n\treturn {cwd, searchPath, pathExt};\n}\n\nfunction windowsExtensions(command, pathExt) {\n\tconst extensions = pathExt.split(path.delimiter).filter(Boolean);\n\tconst commandExtension = path.extname(command).toLowerCase();\n\n\t// If the command already ends with a known executable extension, also try it verbatim.\n\tif (commandExtension !== '' && extensions.some(extension => extension.toLowerCase() === commandExtension)) {\n\t\treturn ['', ...extensions];\n\t}\n\n\treturn extensions;\n}\n\nfunction * candidatePaths(command, {cwd, searchPath, pathExt}) {\n\tconst extensions = isWindows ? windowsExtensions(command, pathExt) : [''];\n\n\tif (separatorPattern.test(command)) {\n\t\tconst base = path.resolve(cwd, command);\n\t\tfor (const extension of extensions) {\n\t\t\tyield base + extension;\n\t\t}\n\n\t\treturn;\n\t}\n\n\tconst directories = [\n\t\t// Windows searches the current directory before `PATH`.\n\t\t...(isWindows ? [cwd] : []),\n\t\t...searchPath.split(path.delimiter),\n\t];\n\n\tfor (const directory of directories) {\n\t\t// `PATH` entries can be wrapped in double quotes on Windows.\n\t\tconst unquoted = isWindows && directory.length > 1 && directory.startsWith('\"') && directory.endsWith('\"') ? directory.slice(1, -1) : directory;\n\n\t\t// Skip empty entries. Unlike a POSIX shell, an empty entry is not treated as the current directory, since implicitly searching the current directory is a security risk. Checked after unquoting so a quoted-empty entry (`\"\"`) is skipped too.\n\t\tif (unquoted === '') {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst base = path.resolve(cwd, unquoted, command);\n\t\tfor (const extension of extensions) {\n\t\t\tyield base + extension;\n\t\t}\n\t}\n}\n\nasync function isExecutable(filePath) {\n\tlet stats;\n\ttry {\n\t\tstats = await fsPromises.stat(filePath);\n\t} catch (error) {\n\t\t// Windows App Execution Aliases (in `WindowsApps`) throw `EACCES` on `stat`, but are valid, launchable executables.\n\t\treturn isWindows && error.code === 'EACCES';\n\t}\n\n\t// A directory can have the executable bit set, but it's not a command.\n\tif (!stats.isFile()) {\n\t\treturn false;\n\t}\n\n\t// On Windows, executability is determined by the file extension, which is already validated against `PATHEXT`.\n\tif (isWindows) {\n\t\treturn true;\n\t}\n\n\ttry {\n\t\tawait fsPromises.access(filePath, fs.constants.X_OK);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nfunction isExecutableSync(filePath) {\n\tlet stats;\n\ttry {\n\t\tstats = fs.statSync(filePath);\n\t} catch (error) {\n\t\treturn isWindows && error.code === 'EACCES';\n\t}\n\n\tif (!stats.isFile()) {\n\t\treturn false;\n\t}\n\n\tif (isWindows) {\n\t\treturn true;\n\t}\n\n\ttry {\n\t\tfs.accessSync(filePath, fs.constants.X_OK);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nexport async function whichCommand(command, options = {}) {\n\tconst resolved = resolveOptions(command, options);\n\n\tfor (const candidate of candidatePaths(command, resolved)) {\n\t\t// Checked sequentially so the first match in `PATH` order wins and the search can short-circuit.\n\t\tif (await isExecutable(candidate)) { // eslint-disable-line no-await-in-loop\n\t\t\treturn candidate;\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\nexport function whichCommandSync(command, options = {}) {\n\tconst resolved = resolveOptions(command, options);\n\n\tfor (const candidate of candidatePaths(command, resolved)) {\n\t\tif (isExecutableSync(candidate)) {\n\t\t\treturn candidate;\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\nexport async function whichCommandAll(command, options = {}) {\n\tconst resolved = resolveOptions(command, options);\n\tconst candidates = [...candidatePaths(command, resolved)];\n\tconst matches = await Promise.all(candidates.map(async candidate => (await isExecutable(candidate)) ? candidate : undefined));\n\treturn [...new Set(matches.filter(Boolean))];\n}\n\nexport function whichCommandAllSync(command, options = {}) {\n\tconst resolved = resolveOptions(command, options);\n\tconst found = [];\n\n\tfor (const candidate of candidatePaths(command, resolved)) {\n\t\tif (isExecutableSync(candidate)) {\n\t\t\tfound.push(candidate);\n\t\t}\n\t}\n\n\treturn [...new Set(found)];\n}\n","import {openSync, readSync, closeSync} from 'node:fs';\nimport {Buffer} from 'node:buffer';\nimport path from 'node:path';\nimport process from 'node:process';\nimport {whichCommandSync} from 'which-command';\n\n/*\nOn Windows, `node:child_process` cannot natively run many kinds of files (`.cmd`, `.bat`, shebang scripts, ...): without a shell it resolves neither `PATHEXT` nor shebangs, and it does not escape arguments. We resolve the command to its full file path and escape its arguments ourselves, so those work without an explicit shell, just like on Unix, where the OS handles all of this for us.\n*/\nexport const parseCommandFile = (file, commandArguments, options) => {\n\t// The arguments are cloned since a shebang interpreter might be prepended below, which must not mutate the caller's array\n\tconst parsed = {file, commandArguments: [...commandArguments], options};\n\n\t// Under a shell, or on Unix, the OS resolves the file and escapes the arguments itself\n\tif (options.shell || process.platform !== 'win32') {\n\t\treturn parsed;\n\t}\n\n\treturn escapeWindowsCommand(parsed);\n};\n\n// Only `.exe` and `.com` files can be spawned directly; anything else needs `cmd.exe`\nconst directlyExecutableRegExp = /\\.(?:com|exe)$/i;\n\n// `.cmd` and `.bat` files re-expand their own arguments via `%*`/`%1`, so metacharacters must survive being interpreted by `cmd.exe` twice: once when the batch file is invoked and once when it forwards the arguments\nconst batchFileRegExp = /\\.(?:bat|cmd)$/i;\n\nconst escapeWindowsCommand = parsed => {\n\t// Resolve the file to an absolute path, following its shebang to the interpreter if any\n\tconst resolvedFile = resolveWithShebang(parsed);\n\n\t// A directly executable file is spawned by its resolved path, bypassing `cmd.exe` and its escaping\n\tif (resolvedFile !== undefined && directlyExecutableRegExp.test(resolvedFile)) {\n\t\tif (parsed.options.argv0 === undefined) {\n\t\t\tparsed.options.argv0 = parsed.file;\n\t\t}\n\n\t\tparsed.file = resolvedFile;\n\t\treturn parsed;\n\t}\n\n\t/*\n\t`cmd.exe` treats CR and LF as command separators and offers no way to escape them, so allowing either would enable command injection.\n\tReject them instead.\n\t*/\n\tfor (const value of [parsed.file, ...parsed.commandArguments]) {\n\t\tassertNoLineBreak(value);\n\t}\n\n\tconst isDoubleEscape = resolvedFile !== undefined && batchFileRegExp.test(resolvedFile);\n\t// POSIX separators must become Windows ones (`foo/bar` -> `foo\\bar`), otherwise resolution always fails with ENOENT\n\tconst escapedFile = escapeMetaChars(path.normalize(resolvedFile ?? parsed.file));\n\tconst escapedArguments = parsed.commandArguments.map(argument => escapeArgument(argument, isDoubleEscape));\n\tconst commandLine = `\"${[escapedFile, ...escapedArguments].join(' ')}\"`;\n\n\t// Let `node:child_process` pass the already-escaped command line through untouched\n\tparsed.options.windowsVerbatimArguments = true;\n\treturn {\n\t\tfile: process.env.comspec || 'cmd.exe',\n\t\tcommandArguments: ['/d', '/s', '/c', commandLine],\n\t\toptions: parsed.options,\n\t};\n};\n\n// Resolve the command's absolute path, then, if it is a shebang script, resolve its interpreter instead, since Windows cannot run shebangs natively\nconst resolveWithShebang = parsed => {\n\tconst resolvedFile = resolvePath(parsed);\n\tconst interpreter = resolvedFile !== undefined && readShebang(resolvedFile);\n\tif (!interpreter) {\n\t\treturn resolvedFile;\n\t}\n\n\t// Run the interpreter with the script as its first argument, then resolve the interpreter's own path\n\tparsed.commandArguments.unshift(resolvedFile);\n\tparsed.file = interpreter;\n\treturn resolvePath(parsed);\n};\n\n// Search `PATH` for the command, resolving its Windows executable extension via `PATHEXT`\nconst resolvePath = parsed => {\n\tconst environment = parsed.options.env || process.env;\n\tconst cwd = parsed.options.cwd ?? process.cwd();\n\tconst environmentPathExt = getWindowsEnvironmentValue(environment, 'PATHEXT');\n\tconst commandExtension = path.extname(parsed.file);\n\t// Commands with an explicit extension must be tried verbatim so shebang scripts work even when their extension is excluded from PATHEXT.\n\tconst pathExt = commandExtension === '' ? environmentPathExt : `${commandExtension}${path.delimiter}${environmentPathExt ?? ''}`;\n\tif (hasWindowsPathSeparator(parsed.file)) {\n\t\treturn whichCommandSync(path.resolve(cwd, parsed.file), {cwd, pathExt});\n\t}\n\n\tconst searchPath = getWindowsEnvironmentValue(environment, 'PATH') ?? getWindowsEnvironmentValue(process.env, 'PATH') ?? '';\n\tconst resolveOptions = {\n\t\tcwd,\n\t\tpath: searchPath,\n\t\tpathExt,\n\t};\n\n\treturn shouldSearchCurrentDirectory(environment) ? whichCommandSync(parsed.file, resolveOptions) : resolvePathDirectories(parsed.file, resolveOptions);\n};\n\nconst hasWindowsPathSeparator = file => file.includes('/') || file.includes('\\\\') || file.includes(':');\n\nconst shouldSearchCurrentDirectory = environment => getWindowsEnvironmentValue(process.env, 'NODEFAULTCURRENTDIRECTORYINEXEPATH') === undefined && getWindowsEnvironmentValue(environment, 'NODEFAULTCURRENTDIRECTORYINEXEPATH') === undefined;\n\nconst resolvePathDirectories = (file, {cwd, path: searchPath, pathExt}) => {\n\tfor (const directory of searchPath.split(path.delimiter)) {\n\t\tconst unquotedDirectory = directory.length > 1 && directory.startsWith('\"') && directory.endsWith('\"') ? directory.slice(1, -1) : directory;\n\t\tif (unquotedDirectory === '') {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst resolvedFile = whichCommandSync(path.resolve(cwd, unquotedDirectory, file), {cwd, pathExt});\n\t\tif (resolvedFile !== undefined) {\n\t\t\treturn resolvedFile;\n\t\t}\n\t}\n};\n\n// Node sorts Windows environment keys and uses the first case-insensitive match when spawning.\nconst getWindowsEnvironmentValue = (environment, name) => {\n\tconst environmentKey = Object.keys(environment).sort().find(key => key.toUpperCase() === name);\n\treturn environmentKey === undefined ? undefined : environment[environmentKey];\n};\n\nconst SHEBANG_BYTE_LENGTH = 150;\n\n// Read the file's first bytes to find its shebang interpreter, if it has one\nconst readShebang = file => {\n\tconst buffer = Buffer.alloc(SHEBANG_BYTE_LENGTH);\n\n\ttry {\n\t\tconst fileDescriptor = openSync(file, 'r');\n\t\ttry {\n\t\t\treadSync(fileDescriptor, buffer, 0, SHEBANG_BYTE_LENGTH, 0);\n\t\t} finally {\n\t\t\tcloseSync(fileDescriptor);\n\t\t}\n\t} catch {\n\t\treturn undefined;\n\t}\n\n\treturn parseShebang(buffer.toString());\n};\n\nconst shebangRegExp = /^#!(?<line>.*)/;\n\n/*\nExtract the interpreter from a shebang line, e.g. `#!/usr/bin/env node` -> `node`.\n*/\nconst parseShebang = contents => {\n\tconst shebangLine = contents.match(shebangRegExp)?.groups.line.trim();\n\tif (!shebangLine) {\n\t\treturn undefined;\n\t}\n\n\tconst [interpreterPath, argument] = shebangLine.split(' ');\n\tconst interpreter = interpreterPath.split('/').at(-1);\n\tif (interpreter === 'env') {\n\t\treturn argument;\n\t}\n\n\treturn argument ? `${interpreter} ${argument}` : interpreter;\n};\n\nconst lineBreakRegExp = /[\\n\\r]/;\n\nconst assertNoLineBreak = value => {\n\tif (lineBreakRegExp.test(value)) {\n\t\tthrow new TypeError(`The command and its arguments cannot contain a line break on Windows without a shell.\\nThis would allow a command injection with \\`cmd.exe\\`.\\nInvalid value: ${JSON.stringify(`${value}`)}`);\n\t}\n};\n\n// See https://web.archive.org/web/20241220221102/https://www.robvanderwoude.com/escapechars.php\n// eslint-disable-next-line regexp/sort-character-class-elements\nconst metaCharsRegExp = /[()\\][%!^\"`<>&|;, *?]/g;\n\n// Prefix every `cmd.exe` metacharacter with a caret to neutralize it\nconst escapeMetaChars = value => value.replaceAll(metaCharsRegExp, '^$&');\n\nconst backslashRunRegExp = /\\\\+/g;\n\nconst escapeArgument = (rawArgument, doubleEscape) => {\n\t/*\n\tEscape backslashes and double quotes for `cmd.exe`, following the algorithm at https://web.archive.org/web/20240930203505/https://qntm.org/cmd.\n\n\tA run of backslashes only needs doubling when it precedes a double quote, or the end of the argument since that becomes a double quote once the argument is wrapped below. Otherwise the backslashes would be taken as escaping that quote. Every double quote is then escaped in turn.\n\n\tEach backslash run is matched exactly once and consumed, so a long run cannot trigger the quadratic backtracking a naive pattern would, which would be a denial-of-service risk.\n\t*/\n\tconst argument = `${rawArgument}`\n\t\t.replaceAll(backslashRunRegExp, (backslashes, offset, string) => {\n\t\t\tconst nextCharacter = string[offset + backslashes.length];\n\t\t\tconst isPrecedesDoubleQuote = nextCharacter === '\"' || nextCharacter === undefined;\n\t\t\treturn isPrecedesDoubleQuote ? backslashes.repeat(2) : backslashes;\n\t\t})\n\t\t.replaceAll('\"', '\\\\\"');\n\n\t// Wrap the whole argument in double quotes, then caret-escape the metacharacters, a second time when targeting a cmd-shim\n\tconst escapedArgument = escapeMetaChars(`\"${argument}\"`);\n\treturn doubleEscape ? escapeMetaChars(escapedArgument) : escapedArgument;\n};\n","import {statSync} from 'node:fs';\nimport path from 'node:path';\nimport process from 'node:process';\nimport {safeNormalizeFileUrl} from './file-url.js';\n\n// Normalize `cwd` option\nexport const normalizeCwd = (cwd = getDefaultCwd()) => {\n\tconst cwdString = safeNormalizeFileUrl(cwd, 'The \"cwd\" option');\n\treturn path.resolve(cwdString);\n};\n\nconst getDefaultCwd = () => {\n\ttry {\n\t\treturn process.cwd();\n\t} catch (error) {\n\t\terror.message = `The current directory does not exist.\\n${error.message}`;\n\t\tthrow error;\n\t}\n};\n\n// When `cwd` option has an invalid value, provide with a better error message\nexport const fixCwdError = (originalMessage, cwd) => {\n\tif (cwd === getDefaultCwd()) {\n\t\treturn originalMessage;\n\t}\n\n\tlet cwdStat;\n\ttry {\n\t\tcwdStat = statSync(cwd);\n\t} catch (error) {\n\t\treturn `The \"cwd\" option is invalid: ${cwd}.\\n${error.message}\\n${originalMessage}`;\n\t}\n\n\tif (!cwdStat.isDirectory()) {\n\t\treturn `The \"cwd\" option is not a directory: ${cwd}.\\n${originalMessage}`;\n\t}\n\n\treturn originalMessage;\n};\n","import path from 'node:path';\nimport process from 'node:process';\nimport {npmRunPathEnv} from 'npm-run-path';\nimport {normalizeForceKillAfterDelay} from '../terminate/kill.js';\nimport {normalizeKillSignal} from '../terminate/signal.js';\nimport {validateCancelSignal} from '../terminate/cancel.js';\nimport {validateGracefulCancel} from '../terminate/graceful.js';\nimport {validateTimeout} from '../terminate/timeout.js';\nimport {handleNodeOption} from '../methods/node.js';\nimport {validateIpcInputOption} from '../ipc/ipc-input.js';\nimport {validateEncoding, BINARY_ENCODINGS} from './encoding-option.js';\nimport {parseCommandFile} from './command-file.js';\nimport {normalizeCwd} from './cwd.js';\nimport {normalizeFileUrl} from './file-url.js';\nimport {normalizeFdSpecificOptions} from './specific.js';\n\nconst cmdExeRegExp = /^cmd(?:\\.exe)?$/i;\n\n// Normalize the options object, and sometimes also the file paths and arguments.\n// Applies default values, validate allowed options, normalize them.\nexport const normalizeOptions = (filePath, rawArguments, rawOptions) => {\n\t// Prevent prototype pollution by copying only own properties to a null-prototype object\n\tconst sanitizedOptions = {__proto__: null, ...rawOptions};\n\tsanitizedOptions.cwd = normalizeCwd(sanitizedOptions.cwd);\n\tconst [processedFile, processedArguments, processedOptions] = handleNodeOption(filePath, rawArguments, sanitizedOptions);\n\tconst fdOptions = normalizeFdSpecificOptions(processedOptions);\n\tconst options = addDefaultOptions(fdOptions);\n\toptions.env = getEnv(options);\n\n\tconst {file, commandArguments} = parseCommandFile(processedFile, processedArguments, options);\n\n\tvalidateTimeout(options);\n\tvalidateEncoding(options);\n\tvalidateIpcInputOption(options);\n\tvalidateCancelSignal(options);\n\tvalidateGracefulCancel(options);\n\toptions.shell = normalizeFileUrl(options.shell);\n\toptions.killSignal = normalizeKillSignal(options.killSignal);\n\toptions.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);\n\toptions.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);\n\n\t// The file is now an absolute path resolved via `PATHEXT`, so its extension might be uppercase (`cmd.EXE`)\n\tif (process.platform === 'win32' && cmdExeRegExp.test(path.basename(file))) {\n\t\t// #116\n\t\tcommandArguments.unshift('/q');\n\t}\n\n\treturn {file, commandArguments, options};\n};\n\n// Use null prototype to prevent prototype pollution from leaking through\nconst addDefaultOptions = ({\n\textendEnv = true,\n\tpreferLocal = false,\n\tcwd,\n\tlocalDir: localDirectory = cwd,\n\tencoding = 'utf8',\n\treject = true,\n\tcleanup = true,\n\tkillDescendants = false,\n\tall = false,\n\twindowsHide = true,\n\tkillSignal = 'SIGTERM',\n\tforceKillAfterDelay = true,\n\tgracefulCancel = false,\n\tipcInput,\n\tipc = ipcInput !== undefined || gracefulCancel,\n\tserialization = 'advanced',\n\t...options\n}) => ({\n\t__proto__: null,\n\t...options,\n\textendEnv,\n\tpreferLocal,\n\tcwd,\n\tlocalDirectory,\n\tencoding,\n\treject,\n\tcleanup,\n\tkillDescendants,\n\tall,\n\twindowsHide,\n\tkillSignal,\n\tforceKillAfterDelay,\n\tgracefulCancel,\n\tipcInput,\n\tipc,\n\tserialization,\n});\n\nconst getEnv = ({env: envOption, extendEnv, preferLocal, node, localDirectory, nodePath}) => {\n\tconst env = extendEnv ? {...process.env, ...envOption} : envOption;\n\n\tif (preferLocal || node) {\n\t\treturn npmRunPathEnv({\n\t\t\tenv,\n\t\t\tcwd: localDirectory,\n\t\t\texecPath: nodePath,\n\t\t\tpreferLocal,\n\t\t\taddExecPath: node,\n\t\t});\n\t}\n\n\treturn env;\n};\n","// When the `shell` option is set, any command argument is concatenated as a single string by Node.js:\n// https://github.com/nodejs/node/blob/e38ce27f3ca0a65f68a31cedd984cddb927d4002/lib/child_process.js#L614-L624\n// However, since Node 24, it also prints a deprecation warning.\n// To avoid this warning, we perform that same operation before calling `node:child_process`.\n// Shells only understand strings, which is why Node.js performs that concatenation.\n// However, we rely on users splitting command arguments as an array.\n// For example, this allows us to easily detect which arguments are passed.\n// So we do want users to pass array of arguments even with `shell: true`, but we also want to avoid any warning.\nexport const concatenateShell = (file, commandArguments, options) => options.shell && commandArguments.length > 0\n\t? [[file, ...commandArguments].join(' '), [], options]\n\t: [file, commandArguments, options];\n","export default function stripFinalNewline(input) {\n\tif (typeof input === 'string') {\n\t\treturn stripFinalNewlineString(input);\n\t}\n\n\tif (!(ArrayBuffer.isView(input) && input.BYTES_PER_ELEMENT === 1)) {\n\t\tthrow new Error('Input must be a string or a Uint8Array');\n\t}\n\n\treturn stripFinalNewlineBinary(input);\n}\n\nconst stripFinalNewlineString = input =>\n\tinput.at(-1) === LF\n\t\t? input.slice(0, input.at(-2) === CR ? -2 : -1)\n\t\t: input;\n\nconst stripFinalNewlineBinary = input =>\n\tinput.at(-1) === LF_BINARY\n\t\t? input.subarray(0, input.at(-2) === CR_BINARY ? -2 : -1)\n\t\t: input;\n\nconst LF = '\\n';\nconst LF_BINARY = LF.codePointAt(0);\nconst CR = '\\r';\nconst CR_BINARY = CR.codePointAt(0);\n","export function isStream(stream, {checkOpen = true} = {}) {\n\treturn stream !== null\n\t\t&& typeof stream === 'object'\n\t\t&& (stream.writable || stream.readable || !checkOpen || (stream.writable === undefined && stream.readable === undefined))\n\t\t&& typeof stream.pipe === 'function';\n}\n\nexport function isWritableStream(stream, {checkOpen = true} = {}) {\n\treturn isStream(stream, {checkOpen})\n\t\t&& (stream.writable || !checkOpen)\n\t\t&& typeof stream.write === 'function'\n\t\t&& typeof stream.end === 'function'\n\t\t&& typeof stream.writable === 'boolean'\n\t\t&& typeof stream.writableObjectMode === 'boolean'\n\t\t&& typeof stream.destroy === 'function'\n\t\t&& typeof stream.destroyed === 'boolean';\n}\n\nexport function isReadableStream(stream, {checkOpen = true} = {}) {\n\treturn isStream(stream, {checkOpen})\n\t\t&& (stream.readable || !checkOpen)\n\t\t&& typeof stream.read === 'function'\n\t\t&& typeof stream.readable === 'boolean'\n\t\t&& typeof stream.readableObjectMode === 'boolean'\n\t\t&& typeof stream.destroy === 'function'\n\t\t&& typeof stream.destroyed === 'boolean';\n}\n\nexport function isDuplexStream(stream, options) {\n\treturn isWritableStream(stream, options)\n\t\t&& isReadableStream(stream, options);\n}\n\nexport function isTransformStream(stream, options) {\n\treturn isDuplexStream(stream, options)\n\t\t&& typeof stream._transform === 'function';\n}\n","const a = Object.getPrototypeOf(\n Object.getPrototypeOf(\n /* istanbul ignore next */\n async function* () {\n }\n ).prototype\n);\nclass c {\n #t;\n #n;\n #r = !1;\n #e = void 0;\n constructor(e, t) {\n this.#t = e, this.#n = t;\n }\n next() {\n const e = () => this.#s();\n return this.#e = this.#e ? this.#e.then(e, e) : e(), this.#e;\n }\n return(e) {\n const t = () => this.#i(e);\n return this.#e ? this.#e.then(t, t) : t();\n }\n async #s() {\n if (this.#r)\n return {\n done: !0,\n value: void 0\n };\n let e;\n try {\n e = await this.#t.read();\n } catch (t) {\n throw this.#e = void 0, this.#r = !0, this.#t.releaseLock(), t;\n }\n return e.done && (this.#e = void 0, this.#r = !0, this.#t.releaseLock()), e;\n }\n async #i(e) {\n if (this.#r)\n return {\n done: !0,\n value: e\n };\n if (this.#r = !0, !this.#n) {\n const t = this.#t.cancel(e);\n return this.#t.releaseLock(), await t, {\n done: !0,\n value: e\n };\n }\n return this.#t.releaseLock(), {\n done: !0,\n value: e\n };\n }\n}\nconst n = Symbol();\nfunction i() {\n return this[n].next();\n}\nObject.defineProperty(i, \"name\", { value: \"next\" });\nfunction o(r) {\n return this[n].return(r);\n}\nObject.defineProperty(o, \"name\", { value: \"return\" });\nconst u = Object.create(a, {\n next: {\n enumerable: !0,\n configurable: !0,\n writable: !0,\n value: i\n },\n return: {\n enumerable: !0,\n configurable: !0,\n writable: !0,\n value: o\n }\n});\nfunction h({ preventCancel: r = !1 } = {}) {\n const e = this.getReader(), t = new c(\n e,\n r\n ), s = Object.create(u);\n return s[n] = t, s;\n}\nexport {\n h as asyncIterator\n};\n","import {isReadableStream} from 'is-stream';\nimport {asyncIterator} from '@sec-ant/readable-stream/ponyfill';\n\nexport const getAsyncIterable = stream => {\n\tif (isReadableStream(stream, {checkOpen: false}) && nodeImports.on !== undefined) {\n\t\treturn getStreamIterable(stream);\n\t}\n\n\tif (typeof stream?.[Symbol.asyncIterator] === 'function') {\n\t\treturn stream;\n\t}\n\n\t// `ReadableStream[Symbol.asyncIterator]` support is missing in multiple browsers, so we ponyfill it\n\tif (toString.call(stream) === '[object ReadableStream]') {\n\t\treturn asyncIterator.call(stream);\n\t}\n\n\tthrow new TypeError('The first argument must be a Readable, a ReadableStream, or an async iterable.');\n};\n\nconst {toString} = Object.prototype;\n\n// The default iterable for Node.js streams does not allow for multiple readers at once, so we re-implement it\nconst getStreamIterable = async function * (stream) {\n\tconst controller = new AbortController();\n\tconst state = {};\n\thandleStreamEnd(stream, controller, state);\n\n\ttry {\n\t\tfor await (const [chunk] of nodeImports.on(stream, 'data', {signal: controller.signal})) {\n\t\t\tyield chunk;\n\t\t}\n\t} catch (error) {\n\t\t// Stream failure, for example due to `stream.destroy(error)`\n\t\tif (state.error !== undefined) {\n\t\t\tthrow state.error;\n\t\t// `error` event directly emitted on stream\n\t\t} else if (!controller.signal.aborted) {\n\t\t\tthrow error;\n\t\t// Otherwise, stream completed successfully\n\t\t}\n\t\t// The `finally` block also runs when the caller throws, for example due to the `maxBuffer` option\n\t} finally {\n\t\tstream.destroy();\n\t}\n};\n\nconst handleStreamEnd = async (stream, controller, state) => {\n\ttry {\n\t\tawait nodeImports.finished(stream, {\n\t\t\tcleanup: true,\n\t\t\treadable: true,\n\t\t\twritable: false,\n\t\t\terror: false,\n\t\t});\n\t} catch (error) {\n\t\tstate.error = error;\n\t} finally {\n\t\tcontroller.abort();\n\t}\n};\n\n// Loaded by the Node entrypoint, but not by the browser one.\n// This prevents using dynamic imports.\nexport const nodeImports = {};\n","import {getAsyncIterable} from './stream.js';\n\nexport const getStreamContents = async (stream, {init, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, finalize}, {maxBuffer = Number.POSITIVE_INFINITY} = {}) => {\n\tconst asyncIterable = getAsyncIterable(stream);\n\n\tconst state = init();\n\tstate.length = 0;\n\n\ttry {\n\t\tfor await (const chunk of asyncIterable) {\n\t\t\tconst chunkType = getChunkType(chunk);\n\t\t\tconst convertedChunk = convertChunk[chunkType](chunk, state);\n\t\t\tappendChunk({\n\t\t\t\tconvertedChunk,\n\t\t\t\tstate,\n\t\t\t\tgetSize,\n\t\t\t\ttruncateChunk,\n\t\t\t\taddChunk,\n\t\t\t\tmaxBuffer,\n\t\t\t});\n\t\t}\n\n\t\tappendFinalChunk({\n\t\t\tstate,\n\t\t\tconvertChunk,\n\t\t\tgetSize,\n\t\t\ttruncateChunk,\n\t\t\taddChunk,\n\t\t\tgetFinalChunk,\n\t\t\tmaxBuffer,\n\t\t});\n\t\treturn finalize(state);\n\t} catch (error) {\n\t\tconst normalizedError = typeof error === 'object' && error !== null ? error : new Error(error);\n\t\tnormalizedError.bufferedData = finalize(state);\n\t\tthrow normalizedError;\n\t}\n};\n\nconst appendFinalChunk = ({state, getSize, truncateChunk, addChunk, getFinalChunk, maxBuffer}) => {\n\tconst convertedChunk = getFinalChunk(state);\n\tif (convertedChunk !== undefined) {\n\t\tappendChunk({\n\t\t\tconvertedChunk,\n\t\t\tstate,\n\t\t\tgetSize,\n\t\t\ttruncateChunk,\n\t\t\taddChunk,\n\t\t\tmaxBuffer,\n\t\t});\n\t}\n};\n\nconst appendChunk = ({convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer}) => {\n\tconst chunkSize = getSize(convertedChunk);\n\tconst newLength = state.length + chunkSize;\n\n\tif (newLength <= maxBuffer) {\n\t\taddNewChunk(convertedChunk, state, addChunk, newLength);\n\t\treturn;\n\t}\n\n\tconst truncatedChunk = truncateChunk(convertedChunk, maxBuffer - state.length);\n\n\tif (truncatedChunk !== undefined) {\n\t\taddNewChunk(truncatedChunk, state, addChunk, maxBuffer);\n\t}\n\n\tthrow new MaxBufferError();\n};\n\nconst addNewChunk = (convertedChunk, state, addChunk, newLength) => {\n\tstate.contents = addChunk(convertedChunk, state, newLength);\n\tstate.length = newLength;\n};\n\nconst getChunkType = chunk => {\n\tconst typeOfChunk = typeof chunk;\n\n\tif (typeOfChunk === 'string') {\n\t\treturn 'string';\n\t}\n\n\tif (typeOfChunk !== 'object' || chunk === null) {\n\t\treturn 'others';\n\t}\n\n\tif (globalThis.Buffer?.isBuffer(chunk)) {\n\t\treturn 'buffer';\n\t}\n\n\tconst prototypeName = objectToString.call(chunk);\n\n\tif (prototypeName === '[object ArrayBuffer]') {\n\t\treturn 'arrayBuffer';\n\t}\n\n\tif (prototypeName === '[object DataView]') {\n\t\treturn 'dataView';\n\t}\n\n\tif (\n\t\tNumber.isInteger(chunk.byteLength)\n\t\t&& Number.isInteger(chunk.byteOffset)\n\t\t&& objectToString.call(chunk.buffer) === '[object ArrayBuffer]'\n\t) {\n\t\treturn 'typedArray';\n\t}\n\n\treturn 'others';\n};\n\nconst {toString: objectToString} = Object.prototype;\n\nexport class MaxBufferError extends Error {\n\tname = 'MaxBufferError';\n\n\tconstructor() {\n\t\tsuper('maxBuffer exceeded');\n\t}\n}\n","export const identity = value => value;\n\nexport const noop = () => undefined;\n\nexport const getContentsProperty = ({contents}) => contents;\n\nexport const throwObjectStream = chunk => {\n\tthrow new Error(`Streams in object mode are not supported: ${String(chunk)}`);\n};\n\nexport const getLengthProperty = convertedChunk => convertedChunk.length;\n","import {getStreamContents} from './contents.js';\nimport {identity, noop, getContentsProperty} from './utils.js';\n\nexport async function getStreamAsArray(stream, options) {\n\treturn getStreamContents(stream, arrayMethods, options);\n}\n\nconst initArray = () => ({contents: []});\n\nconst increment = () => 1;\n\nconst addArrayChunk = (convertedChunk, {contents}) => {\n\tcontents.push(convertedChunk);\n\treturn contents;\n};\n\nconst arrayMethods = {\n\tinit: initArray,\n\tconvertChunk: {\n\t\tstring: identity,\n\t\tbuffer: identity,\n\t\tarrayBuffer: identity,\n\t\tdataView: identity,\n\t\ttypedArray: identity,\n\t\tothers: identity,\n\t},\n\tgetSize: increment,\n\ttruncateChunk: noop,\n\taddChunk: addArrayChunk,\n\tgetFinalChunk: noop,\n\tfinalize: getContentsProperty,\n};\n","import {getStreamContents} from './contents.js';\nimport {noop, throwObjectStream, getLengthProperty} from './utils.js';\n\nexport async function getStreamAsArrayBuffer(stream, options) {\n\treturn getStreamContents(stream, arrayBufferMethods, options);\n}\n\nconst initArrayBuffer = () => ({contents: new ArrayBuffer(0)});\n\nconst useTextEncoder = chunk => textEncoder.encode(chunk);\nconst textEncoder = new TextEncoder();\n\nconst useUint8Array = chunk => new Uint8Array(chunk);\n\nconst useUint8ArrayWithOffset = chunk => new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength);\n\nconst truncateArrayBufferChunk = (convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize);\n\n// `contents` is an increasingly growing `Uint8Array`.\nconst addArrayBufferChunk = (convertedChunk, {contents, length: previousLength}, length) => {\n\tconst newContents = hasArrayBufferResize() ? resizeArrayBuffer(contents, length) : resizeArrayBufferSlow(contents, length);\n\tnew Uint8Array(newContents).set(convertedChunk, previousLength);\n\treturn newContents;\n};\n\n// Without `ArrayBuffer.resize()`, `contents` size is always a power of 2.\n// This means its last bytes are zeroes (not stream data), which need to be\n// trimmed at the end with `ArrayBuffer.slice()`.\nconst resizeArrayBufferSlow = (contents, length) => {\n\tif (length <= contents.byteLength) {\n\t\treturn contents;\n\t}\n\n\tconst arrayBuffer = new ArrayBuffer(getNewContentsLength(length));\n\tnew Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0);\n\treturn arrayBuffer;\n};\n\n// With `ArrayBuffer.resize()`, `contents` size matches exactly the size of\n// the stream data. It does not include extraneous zeroes to trim at the end.\n// The underlying `ArrayBuffer` does allocate a number of bytes that is a power\n// of 2, but those bytes are only visible after calling `ArrayBuffer.resize()`.\nconst resizeArrayBuffer = (contents, length) => {\n\tif (length <= contents.maxByteLength) {\n\t\tcontents.resize(length);\n\t\treturn contents;\n\t}\n\n\tconst arrayBuffer = new ArrayBuffer(length, {maxByteLength: getNewContentsLength(length)});\n\tnew Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0);\n\treturn arrayBuffer;\n};\n\n// Retrieve the closest `length` that is both >= and a power of 2\nconst getNewContentsLength = length => SCALE_FACTOR ** Math.ceil(Math.log(length) / Math.log(SCALE_FACTOR));\n\nconst SCALE_FACTOR = 2;\n\nconst finalizeArrayBuffer = ({contents, length}) => hasArrayBufferResize() ? contents : contents.slice(0, length);\n\n// `ArrayBuffer.slice()` is slow. When `ArrayBuffer.resize()` is available\n// (Node >=20.0.0, Safari >=16.4 and Chrome), we can use it instead.\n// eslint-disable-next-line no-warning-comments\n// TODO: remove after dropping support for Node 20.\n// eslint-disable-next-line no-warning-comments\n// TODO: use `ArrayBuffer.transferToFixedLength()` instead once it is available\nconst hasArrayBufferResize = () => 'resize' in ArrayBuffer.prototype;\n\nconst arrayBufferMethods = {\n\tinit: initArrayBuffer,\n\tconvertChunk: {\n\t\tstring: useTextEncoder,\n\t\tbuffer: useUint8Array,\n\t\tarrayBuffer: useUint8Array,\n\t\tdataView: useUint8ArrayWithOffset,\n\t\ttypedArray: useUint8ArrayWithOffset,\n\t\tothers: throwObjectStream,\n\t},\n\tgetSize: getLengthProperty,\n\ttruncateChunk: truncateArrayBufferChunk,\n\taddChunk: addArrayBufferChunk,\n\tgetFinalChunk: noop,\n\tfinalize: finalizeArrayBuffer,\n};\n","import {getStreamContents} from './contents.js';\nimport {\n\tidentity,\n\tgetContentsProperty,\n\tthrowObjectStream,\n\tgetLengthProperty,\n} from './utils.js';\n\nexport async function getStreamAsString(stream, options) {\n\treturn getStreamContents(stream, stringMethods, options);\n}\n\nconst initString = () => ({contents: '', textDecoder: new TextDecoder()});\n\nconst useTextDecoder = (chunk, {textDecoder}) => textDecoder.decode(chunk, {stream: true});\n\nconst addStringChunk = (convertedChunk, {contents}) => contents + convertedChunk;\n\nconst truncateStringChunk = (convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize);\n\nconst getFinalStringChunk = ({textDecoder}) => {\n\tconst finalChunk = textDecoder.decode();\n\treturn finalChunk === '' ? undefined : finalChunk;\n};\n\nconst stringMethods = {\n\tinit: initString,\n\tconvertChunk: {\n\t\tstring: identity,\n\t\tbuffer: useTextDecoder,\n\t\tarrayBuffer: useTextDecoder,\n\t\tdataView: useTextDecoder,\n\t\ttypedArray: useTextDecoder,\n\t\tothers: throwObjectStream,\n\t},\n\tgetSize: getLengthProperty,\n\ttruncateChunk: truncateStringChunk,\n\taddChunk: addStringChunk,\n\tgetFinalChunk: getFinalStringChunk,\n\tfinalize: getContentsProperty,\n};\n","import {MaxBufferError} from 'get-stream';\nimport {getStreamName} from '../utils/standard-stream.js';\nimport {getFdSpecificValue} from '../arguments/specific.js';\n\n// When the `maxBuffer` option is hit, a MaxBufferError is thrown.\n// The stream is aborted, then specific information is kept for the error message.\nexport const handleMaxBuffer = ({error, stream, readableObjectMode, lines, encoding, fdNumber}) => {\n\tif (!(error instanceof MaxBufferError)) {\n\t\tthrow error;\n\t}\n\n\tif (fdNumber === 'all') {\n\t\treturn error;\n\t}\n\n\tconst unit = getMaxBufferUnit(readableObjectMode, lines, encoding);\n\terror.maxBufferInfo = {fdNumber, unit};\n\tstream.destroy();\n\tthrow error;\n};\n\nconst getMaxBufferUnit = (readableObjectMode, lines, encoding) => {\n\tif (readableObjectMode) {\n\t\treturn 'objects';\n\t}\n\n\tif (lines) {\n\t\treturn 'lines';\n\t}\n\n\tif (encoding === 'buffer') {\n\t\treturn 'bytes';\n\t}\n\n\treturn 'characters';\n};\n\n// Check the `maxBuffer` option with `result.ipcOutput`\nexport const checkIpcMaxBuffer = (subprocess, ipcOutput, maxBuffer) => {\n\tif (ipcOutput.length !== maxBuffer) {\n\t\treturn;\n\t}\n\n\tconst error = new MaxBufferError();\n\terror.maxBufferInfo = {fdNumber: 'ipc'};\n\tthrow error;\n};\n\n// Error message when `maxBuffer` is hit\nexport const getMaxBufferMessage = (error, maxBuffer) => {\n\tconst {streamName, threshold, unit} = getMaxBufferInfo(error, maxBuffer);\n\treturn `Command's ${streamName} was larger than ${threshold} ${unit}`;\n};\n\nconst getMaxBufferInfo = (error, maxBuffer) => {\n\tif (error?.maxBufferInfo === undefined) {\n\t\treturn {streamName: 'output', threshold: maxBuffer[1], unit: 'bytes'};\n\t}\n\n\tconst {maxBufferInfo: {fdNumber, unit}} = error;\n\tdelete error.maxBufferInfo;\n\n\tconst threshold = getFdSpecificValue(maxBuffer, fdNumber);\n\tif (fdNumber === 'ipc') {\n\t\treturn {streamName: 'IPC output', threshold, unit: 'messages'};\n\t}\n\n\treturn {streamName: getStreamName(fdNumber), threshold, unit};\n};\n\n// The only way to apply `maxBuffer` with `spawnSync()` is to use the native `maxBuffer` option Node.js provides.\n// However, this has multiple limitations, and cannot behave the exact same way as the async behavior.\n// When the `maxBuffer` is hit, a `ENOBUFS` error is thrown.\nexport const isMaxBufferSync = (resultError, output, maxBuffer) => resultError?.code === 'ENOBUFS'\n\t&& output !== null\n\t&& output.some(result => result !== null && result.length > getMaxBufferSync(maxBuffer));\n\n// When `maxBuffer` is hit, ensure the result is truncated\nexport const truncateMaxBufferSync = (result, isMaxBuffer, maxBuffer) => {\n\tif (!isMaxBuffer) {\n\t\treturn result;\n\t}\n\n\tconst maxBufferValue = getMaxBufferSync(maxBuffer);\n\treturn result.length > maxBufferValue ? result.slice(0, maxBufferValue) : result;\n};\n\n// `spawnSync()` does not allow differentiating `maxBuffer` per file descriptor, so we always use `stdout`\nexport const getMaxBufferSync = ([, stdoutMaxBuffer]) => stdoutMaxBuffer;\n","import {inspect} from 'node:util';\nimport stripFinalNewline from 'strip-final-newline';\nimport {isUint8Array, uint8ArrayToString} from '../utils/uint-array.js';\nimport {fixCwdError} from '../arguments/cwd.js';\nimport {escapeLines} from '../arguments/escape.js';\nimport {getMaxBufferMessage} from '../io/max-buffer.js';\nimport {getSignalDescription} from '../terminate/signal.js';\nimport {DiscardedError, isExecaError} from './final-error.js';\n\n// Computes `error.message`, `error.shortMessage` and `error.originalMessage`\nexport const createMessages = ({\n\tstdio,\n\tall,\n\tipcOutput,\n\toriginalError,\n\tsignal,\n\tsignalDescription,\n\texitCode,\n\tescapedCommand,\n\ttimedOut,\n\tisCanceled,\n\tisGracefullyCanceled,\n\tisMaxBuffer,\n\tisForcefullyTerminated,\n\tforceKillAfterDelay,\n\tkillSignal,\n\tmaxBuffer,\n\ttimeout,\n\tcwd,\n}) => {\n\tconst errorCode = originalError?.code;\n\tconst prefix = getErrorPrefix({\n\t\toriginalError,\n\t\ttimedOut,\n\t\ttimeout,\n\t\tisMaxBuffer,\n\t\tmaxBuffer,\n\t\terrorCode,\n\t\tsignal,\n\t\tsignalDescription,\n\t\texitCode,\n\t\tisCanceled,\n\t\tisGracefullyCanceled,\n\t\tisForcefullyTerminated,\n\t\tforceKillAfterDelay,\n\t\tkillSignal,\n\t});\n\tconst originalMessage = getOriginalMessage(originalError, cwd);\n\tconst suffix = originalMessage === undefined ? '' : `\\n${originalMessage}`;\n\tconst shortMessage = `${prefix}: ${escapedCommand}${suffix}`;\n\tconst messageStdio = all === undefined ? [stdio[2], stdio[1]] : [all];\n\tconst message = [\n\t\tshortMessage,\n\t\t...messageStdio,\n\t\t...stdio.slice(3),\n\t\tipcOutput.map(ipcMessage => serializeIpcMessage(ipcMessage)).join('\\n'),\n\t]\n\t\t.map(messagePart => escapeLines(stripFinalNewline(serializeMessagePart(messagePart))))\n\t\t.filter(Boolean)\n\t\t.join('\\n\\n');\n\treturn {originalMessage, shortMessage, message};\n};\n\nconst getErrorPrefix = ({\n\toriginalError,\n\ttimedOut,\n\ttimeout,\n\tisMaxBuffer,\n\tmaxBuffer,\n\terrorCode,\n\tsignal,\n\tsignalDescription,\n\texitCode,\n\tisCanceled,\n\tisGracefullyCanceled,\n\tisForcefullyTerminated,\n\tforceKillAfterDelay,\n\tkillSignal,\n}) => {\n\tconst forcefulSuffix = getForcefulSuffix(isForcefullyTerminated, forceKillAfterDelay);\n\n\tif (timedOut) {\n\t\treturn `Command timed out after ${timeout} milliseconds${forcefulSuffix}`;\n\t}\n\n\tif (isGracefullyCanceled) {\n\t\tif (signal === undefined) {\n\t\t\treturn `Command was gracefully canceled with exit code ${exitCode}`;\n\t\t}\n\n\t\treturn isForcefullyTerminated\n\t\t\t? `Command was gracefully canceled${forcefulSuffix}`\n\t\t\t: `Command was gracefully canceled with ${signal} (${signalDescription})`;\n\t}\n\n\tif (isCanceled) {\n\t\treturn `Command was canceled${forcefulSuffix}`;\n\t}\n\n\tif (isMaxBuffer) {\n\t\treturn `${getMaxBufferMessage(originalError, maxBuffer)}${forcefulSuffix}`;\n\t}\n\n\tif (errorCode !== undefined) {\n\t\treturn `Command failed with ${errorCode}${forcefulSuffix}`;\n\t}\n\n\tif (isForcefullyTerminated) {\n\t\treturn `Command was killed with ${killSignal} (${getSignalDescription(killSignal)})${forcefulSuffix}`;\n\t}\n\n\tif (signal !== undefined) {\n\t\treturn `Command was killed with ${signal} (${signalDescription})`;\n\t}\n\n\tif (exitCode !== undefined) {\n\t\treturn `Command failed with exit code ${exitCode}`;\n\t}\n\n\treturn 'Command failed';\n};\n\nconst getForcefulSuffix = (isForcefullyTerminated, forceKillAfterDelay) => isForcefullyTerminated\n\t? ` and was forcefully terminated after ${forceKillAfterDelay} milliseconds`\n\t: '';\n\nconst getOriginalMessage = (originalError, cwd) => {\n\tif (originalError instanceof DiscardedError) {\n\t\treturn;\n\t}\n\n\tconst originalMessage = isExecaError(originalError)\n\t\t? originalError.originalMessage\n\t\t: String(originalError?.message ?? originalError);\n\tconst escapedOriginalMessage = escapeLines(fixCwdError(originalMessage, cwd));\n\treturn escapedOriginalMessage === '' ? undefined : escapedOriginalMessage;\n};\n\nconst serializeIpcMessage = ipcMessage => typeof ipcMessage === 'string'\n\t? ipcMessage\n\t: inspect(ipcMessage);\n\nconst serializeMessagePart = messagePart => Array.isArray(messagePart)\n\t? messagePart.map(messageItem => stripFinalNewline(serializeMessageItem(messageItem))).filter(Boolean).join('\\n')\n\t: serializeMessageItem(messagePart);\n\nconst serializeMessageItem = messageItem => {\n\tif (typeof messageItem === 'string') {\n\t\treturn messageItem;\n\t}\n\n\tif (isUint8Array(messageItem)) {\n\t\treturn uint8ArrayToString(messageItem);\n\t}\n\n\treturn '';\n};\n","import {getSignalDescription} from '../terminate/signal.js';\nimport {getDurationMs} from './duration.js';\nimport {getFinalError} from './final-error.js';\nimport {createMessages} from './message.js';\n\n// Object returned on subprocess success\nexport const makeSuccessResult = ({\n\tcommand,\n\tescapedCommand,\n\tstdio,\n\tall,\n\tipcOutput,\n\toptions: {cwd},\n\tstartTime,\n}) => omitUndefinedProperties({\n\tcommand,\n\tescapedCommand,\n\tcwd,\n\tdurationMs: getDurationMs(startTime),\n\tfailed: false,\n\ttimedOut: false,\n\tisCanceled: false,\n\tisGracefullyCanceled: false,\n\tisTerminated: false,\n\tisMaxBuffer: false,\n\tisForcefullyTerminated: false,\n\texitCode: 0,\n\tstdout: stdio[1],\n\tstderr: stdio[2],\n\tall,\n\tstdio,\n\tipcOutput,\n\tpipedFrom: [],\n});\n\n// Object returned on subprocess failure before spawning\nexport const makeEarlyError = ({\n\terror,\n\tcommand,\n\tescapedCommand,\n\tfileDescriptors,\n\toptions,\n\tstartTime,\n\tisSync,\n}) => makeError({\n\terror,\n\tcommand,\n\tescapedCommand,\n\tstartTime,\n\ttimedOut: false,\n\tisCanceled: false,\n\tisGracefullyCanceled: false,\n\tisMaxBuffer: false,\n\tisForcefullyTerminated: false,\n\tstdio: Array.from({length: fileDescriptors.length}),\n\tipcOutput: [],\n\toptions,\n\tisSync,\n});\n\n// Object returned on subprocess failure\nexport const makeError = ({\n\terror: originalError,\n\tcommand,\n\tescapedCommand,\n\tstartTime,\n\ttimedOut,\n\tisCanceled,\n\tisGracefullyCanceled,\n\tisMaxBuffer,\n\tisForcefullyTerminated,\n\texitCode: rawExitCode,\n\tsignal: rawSignal,\n\tstdio,\n\tall,\n\tipcOutput,\n\toptions: {\n\t\ttimeoutDuration,\n\t\ttimeout = timeoutDuration,\n\t\tforceKillAfterDelay,\n\t\tkillSignal,\n\t\tcwd,\n\t\tmaxBuffer,\n\t},\n\tisSync,\n}) => {\n\tconst {exitCode, signal, signalDescription} = normalizeExitPayload(rawExitCode, rawSignal);\n\tconst {originalMessage, shortMessage, message} = createMessages({\n\t\tstdio,\n\t\tall,\n\t\tipcOutput,\n\t\toriginalError,\n\t\tsignal,\n\t\tsignalDescription,\n\t\texitCode,\n\t\tescapedCommand,\n\t\ttimedOut,\n\t\tisCanceled,\n\t\tisGracefullyCanceled,\n\t\tisMaxBuffer,\n\t\tisForcefullyTerminated,\n\t\tforceKillAfterDelay,\n\t\tkillSignal,\n\t\tmaxBuffer,\n\t\ttimeout,\n\t\tcwd,\n\t});\n\tconst error = getFinalError(originalError, message, isSync);\n\tObject.assign(error, getErrorProperties({\n\t\terror,\n\t\tcommand,\n\t\tescapedCommand,\n\t\tstartTime,\n\t\ttimedOut,\n\t\tisCanceled,\n\t\tisGracefullyCanceled,\n\t\tisMaxBuffer,\n\t\tisForcefullyTerminated,\n\t\texitCode,\n\t\tsignal,\n\t\tsignalDescription,\n\t\tstdio,\n\t\tall,\n\t\tipcOutput,\n\t\tcwd,\n\t\toriginalMessage,\n\t\tshortMessage,\n\t}));\n\treturn error;\n};\n\nconst getErrorProperties = ({\n\terror,\n\tcommand,\n\tescapedCommand,\n\tstartTime,\n\ttimedOut,\n\tisCanceled,\n\tisGracefullyCanceled,\n\tisMaxBuffer,\n\tisForcefullyTerminated,\n\texitCode,\n\tsignal,\n\tsignalDescription,\n\tstdio,\n\tall,\n\tipcOutput,\n\tcwd,\n\toriginalMessage,\n\tshortMessage,\n}) => omitUndefinedProperties({\n\tshortMessage,\n\toriginalMessage,\n\tcommand,\n\tescapedCommand,\n\tcwd,\n\tdurationMs: getDurationMs(startTime),\n\tfailed: true,\n\ttimedOut,\n\tisCanceled,\n\tisGracefullyCanceled,\n\tisTerminated: signal !== undefined,\n\tisMaxBuffer,\n\tisForcefullyTerminated,\n\texitCode,\n\tsignal,\n\tsignalDescription,\n\tcode: error.cause?.code,\n\tstdout: stdio[1],\n\tstderr: stdio[2],\n\tall,\n\tstdio,\n\tipcOutput,\n\tpipedFrom: [],\n});\n\nconst omitUndefinedProperties = result => Object.fromEntries(Object.entries(result).filter(([, value]) => value !== undefined));\n\n// `signal` and `exitCode` emitted on `subprocess.on('exit')` event can be `null`.\n// We normalize them to `undefined`\nconst normalizeExitPayload = (rawExitCode, rawSignal) => {\n\tconst exitCode = rawExitCode === null ? undefined : rawExitCode;\n\tconst signal = rawSignal === null ? undefined : rawSignal;\n\tconst signalDescription = signal === undefined ? undefined : getSignalDescription(rawSignal);\n\treturn {exitCode, signal, signalDescription};\n};\n","const toZeroIfInfinity = value => Number.isFinite(value) ? value : 0;\n\nfunction parseNumber(milliseconds) {\n\treturn {\n\t\tdays: Math.trunc(milliseconds / 86_400_000),\n\t\thours: Math.trunc(milliseconds / 3_600_000 % 24),\n\t\tminutes: Math.trunc(milliseconds / 60_000 % 60),\n\t\tseconds: Math.trunc(milliseconds / 1000 % 60),\n\t\tmilliseconds: Math.trunc(milliseconds % 1000),\n\t\tmicroseconds: Math.trunc(toZeroIfInfinity(milliseconds * 1000) % 1000),\n\t\tnanoseconds: Math.trunc(toZeroIfInfinity(milliseconds * 1e6) % 1000),\n\t};\n}\n\nfunction parseBigint(milliseconds) {\n\treturn {\n\t\tdays: milliseconds / 86_400_000n,\n\t\thours: milliseconds / 3_600_000n % 24n,\n\t\tminutes: milliseconds / 60_000n % 60n,\n\t\tseconds: milliseconds / 1000n % 60n,\n\t\tmilliseconds: milliseconds % 1000n,\n\t\tmicroseconds: 0n,\n\t\tnanoseconds: 0n,\n\t};\n}\n\nexport default function parseMilliseconds(milliseconds) {\n\tswitch (typeof milliseconds) {\n\t\tcase 'number': {\n\t\t\tif (Number.isFinite(milliseconds)) {\n\t\t\t\treturn parseNumber(milliseconds);\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase 'bigint': {\n\t\t\treturn parseBigint(milliseconds);\n\t\t}\n\n\t\t// No default\n\t}\n\n\tthrow new TypeError('Expected a finite number or bigint');\n}\n","import parseMilliseconds from 'parse-ms';\n\nconst isZero = value => value === 0 || value === 0n;\nconst pluralize = (word, count) => (count === 1 || count === 1n) ? word : `${word}s`;\n\nconst SECOND_ROUNDING_EPSILON = 0.000_000_1;\nconst ONE_DAY_IN_MILLISECONDS = 24n * 60n * 60n * 1000n;\n\nexport default function prettyMilliseconds(milliseconds, options) {\n\tconst isBigInt = typeof milliseconds === 'bigint';\n\tif (!isBigInt && !Number.isFinite(milliseconds)) {\n\t\tthrow new TypeError('Expected a finite number or bigint');\n\t}\n\n\toptions = {...options};\n\n\tconst sign = milliseconds < 0 ? '-' : '';\n\tmilliseconds = milliseconds < 0 ? -milliseconds : milliseconds; // Cannot use `Math.abs()` because of BigInt support.\n\n\tif (options.colonNotation) {\n\t\toptions.compact = false;\n\t\toptions.formatSubMilliseconds = false;\n\t\toptions.separateMilliseconds = false;\n\t\toptions.verbose = false;\n\t}\n\n\tif (options.compact) {\n\t\toptions.unitCount = 1;\n\t\toptions.secondsDecimalDigits = 0;\n\t\toptions.millisecondsDecimalDigits = 0;\n\t}\n\n\tlet result = [];\n\n\tconst floorDecimals = (value, decimalDigits) => {\n\t\tconst flooredInterimValue = Math.floor((value * (10 ** decimalDigits)) + SECOND_ROUNDING_EPSILON);\n\t\tconst flooredValue = Math.round(flooredInterimValue) / (10 ** decimalDigits);\n\t\treturn flooredValue.toFixed(decimalDigits);\n\t};\n\n\tconst add = (value, long, short, valueString) => {\n\t\tif (\n\t\t\t(result.length === 0 || !options.colonNotation)\n\t\t\t&& isZero(value)\n\t\t\t&& !(options.colonNotation && short === 'm')) {\n\t\t\treturn;\n\t\t}\n\n\t\tvalueString ??= String(value);\n\t\tif (options.colonNotation) {\n\t\t\tconst wholeDigits = valueString.includes('.') ? valueString.split('.')[0].length : valueString.length;\n\t\t\tconst minLength = result.length > 0 ? 2 : 1;\n\t\t\tvalueString = '0'.repeat(Math.max(0, minLength - wholeDigits)) + valueString;\n\t\t} else {\n\t\t\tvalueString += options.verbose ? ' ' + pluralize(long, value) : short;\n\t\t}\n\n\t\tresult.push(valueString);\n\t};\n\n\tconst parsed = parseMilliseconds(milliseconds);\n\tconst days = BigInt(parsed.days);\n\n\tif (options.hideYearAndDays) {\n\t\tadd((BigInt(days) * 24n) + BigInt(parsed.hours), 'hour', 'h');\n\t} else {\n\t\tif (options.hideYear) {\n\t\t\tadd(days, 'day', 'd');\n\t\t} else {\n\t\t\tadd(days / 365n, 'year', 'y');\n\t\t\tadd(days % 365n, 'day', 'd');\n\t\t}\n\n\t\tadd(Number(parsed.hours), 'hour', 'h');\n\t}\n\n\tadd(Number(parsed.minutes), 'minute', 'm');\n\n\tif (!options.hideSeconds) {\n\t\tif (\n\t\t\toptions.separateMilliseconds\n\t\t\t|| options.formatSubMilliseconds\n\t\t\t|| (!options.colonNotation && milliseconds < 1000 && !options.subSecondsAsDecimals)\n\t\t) {\n\t\t\tconst seconds = Number(parsed.seconds);\n\t\t\tconst milliseconds = Number(parsed.milliseconds);\n\t\t\tconst microseconds = Number(parsed.microseconds);\n\t\t\tconst nanoseconds = Number(parsed.nanoseconds);\n\n\t\t\tadd(seconds, 'second', 's');\n\n\t\t\tif (options.formatSubMilliseconds) {\n\t\t\t\tadd(milliseconds, 'millisecond', 'ms');\n\t\t\t\tadd(microseconds, 'microsecond', 'µs');\n\t\t\t\tadd(nanoseconds, 'nanosecond', 'ns');\n\t\t\t} else {\n\t\t\t\tconst millisecondsAndBelow\n\t\t\t\t\t= milliseconds\n\t\t\t\t\t+ (microseconds / 1000)\n\t\t\t\t\t+ (nanoseconds / 1e6);\n\n\t\t\t\tconst millisecondsDecimalDigits\n\t\t\t\t\t= typeof options.millisecondsDecimalDigits === 'number'\n\t\t\t\t\t\t? options.millisecondsDecimalDigits\n\t\t\t\t\t\t: 0;\n\n\t\t\t\tconst roundedMilliseconds = millisecondsAndBelow >= 1\n\t\t\t\t\t? Math.round(millisecondsAndBelow)\n\t\t\t\t\t: Math.ceil(millisecondsAndBelow);\n\n\t\t\t\tconst millisecondsString = millisecondsDecimalDigits\n\t\t\t\t\t? millisecondsAndBelow.toFixed(millisecondsDecimalDigits)\n\t\t\t\t\t: roundedMilliseconds;\n\n\t\t\t\tadd(\n\t\t\t\t\tNumber.parseFloat(millisecondsString),\n\t\t\t\t\t'millisecond',\n\t\t\t\t\t'ms',\n\t\t\t\t\tmillisecondsString,\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\tconst seconds = (\n\t\t\t\t(isBigInt ? Number(milliseconds % ONE_DAY_IN_MILLISECONDS) : milliseconds)\n\t\t\t\t/ 1000\n\t\t\t) % 60;\n\t\t\tconst secondsDecimalDigits\n\t\t\t\t= typeof options.secondsDecimalDigits === 'number'\n\t\t\t\t\t? options.secondsDecimalDigits\n\t\t\t\t\t: 1;\n\t\t\tconst secondsFixed = floorDecimals(seconds, secondsDecimalDigits);\n\t\t\tconst secondsString = options.keepDecimalsOnWholeSeconds\n\t\t\t\t? secondsFixed\n\t\t\t\t: secondsFixed.replace(/\\.0+$/, '');\n\t\t\tadd(Number.parseFloat(secondsString), 'second', 's', secondsString);\n\t\t}\n\t}\n\n\tif (result.length === 0) {\n\t\treturn sign + '0' + (options.verbose ? ' milliseconds' : 'ms');\n\t}\n\n\tconst separator = options.colonNotation ? ':' : ' ';\n\tif (typeof options.unitCount === 'number') {\n\t\tresult = result.slice(0, Math.max(options.unitCount, 1));\n\t}\n\n\treturn sign + result.join(separator);\n}\n","import {verboseLog} from './log.js';\n\n// When `verbose` is `short|full|custom`, print each command's error when it fails\nexport const logError = (result, verboseInfo) => {\n\tif (result.failed) {\n\t\tverboseLog({\n\t\t\ttype: 'error',\n\t\t\tverboseMessage: result.shortMessage,\n\t\t\tverboseInfo,\n\t\t\tresult,\n\t\t});\n\t}\n};\n","import prettyMs from 'pretty-ms';\nimport {isVerbose} from './values.js';\nimport {verboseLog} from './log.js';\nimport {logError} from './error.js';\n\n// When `verbose` is `short|full|custom`, print each command's completion, duration and error\nexport const logResult = (result, verboseInfo) => {\n\tif (!isVerbose(verboseInfo)) {\n\t\treturn;\n\t}\n\n\tlogError(result, verboseInfo);\n\tlogDuration(result, verboseInfo);\n};\n\nconst logDuration = (result, verboseInfo) => {\n\tconst verboseMessage = `(done in ${prettyMs(result.durationMs)})`;\n\tverboseLog({\n\t\ttype: 'duration',\n\t\tverboseMessage,\n\t\tverboseInfo,\n\t\tresult,\n\t});\n};\n","import {logResult} from '../verbose/complete.js';\n\n// Applies the `reject` option.\n// Also print the final log line with `verbose`.\nexport const handleResult = (result, verboseInfo, {reject}) => {\n\tlogResult(result, verboseInfo);\n\n\tif (result.failed && reject) {\n\t\tthrow result;\n\t}\n\n\treturn result;\n};\n","import {isStream as isNodeStream, isDuplexStream} from 'is-stream';\nimport isPlainObj from 'is-plain-obj';\nimport {isUint8Array} from '../utils/uint-array.js';\n\n// The `stdin`/`stdout`/`stderr` option can be of many types. This detects it.\nexport const getStdioItemType = (value, optionName) => {\n\tif (isAsyncGenerator(value)) {\n\t\treturn 'asyncGenerator';\n\t}\n\n\tif (isSyncGenerator(value)) {\n\t\treturn 'generator';\n\t}\n\n\tif (isUrl(value)) {\n\t\treturn 'fileUrl';\n\t}\n\n\tif (isFilePathObject(value)) {\n\t\treturn 'filePath';\n\t}\n\n\tif (isWebStream(value)) {\n\t\treturn 'webStream';\n\t}\n\n\tif (isNodeStream(value, {checkOpen: false})) {\n\t\treturn 'native';\n\t}\n\n\tif (isUint8Array(value)) {\n\t\treturn 'uint8Array';\n\t}\n\n\tif (isAsyncIterableObject(value)) {\n\t\treturn 'asyncIterable';\n\t}\n\n\tif (isIterableObject(value)) {\n\t\treturn 'iterable';\n\t}\n\n\tif (isTransformStream(value)) {\n\t\treturn getTransformStreamType({transform: value}, optionName);\n\t}\n\n\tif (isTransformOptions(value)) {\n\t\treturn getTransformObjectType(value, optionName);\n\t}\n\n\treturn 'native';\n};\n\nconst getTransformObjectType = (value, optionName) => {\n\tif (isDuplexStream(value.transform, {checkOpen: false})) {\n\t\treturn getDuplexType(value, optionName);\n\t}\n\n\tif (isTransformStream(value.transform)) {\n\t\treturn getTransformStreamType(value, optionName);\n\t}\n\n\treturn getGeneratorObjectType(value, optionName);\n};\n\nconst getDuplexType = (value, optionName) => {\n\tvalidateNonGeneratorType(value, optionName, 'Duplex stream');\n\treturn 'duplex';\n};\n\nconst getTransformStreamType = (value, optionName) => {\n\tvalidateNonGeneratorType(value, optionName, 'web TransformStream');\n\treturn 'webTransform';\n};\n\nconst validateNonGeneratorType = ({final, binary, objectMode}, optionName, typeName) => {\n\tcheckUndefinedOption(final, `${optionName}.final`, typeName);\n\tcheckUndefinedOption(binary, `${optionName}.binary`, typeName);\n\tcheckBooleanOption(objectMode, `${optionName}.objectMode`);\n};\n\nconst checkUndefinedOption = (value, optionName, typeName) => {\n\tif (value !== undefined) {\n\t\tthrow new TypeError(`The \\`${optionName}\\` option can only be defined when using a generator, not a ${typeName}.`);\n\t}\n};\n\nconst getGeneratorObjectType = ({transform, final, binary, objectMode}, optionName) => {\n\tif (transform !== undefined && !isGenerator(transform)) {\n\t\tthrow new TypeError(`The \\`${optionName}.transform\\` option must be a generator, a Duplex stream or a web TransformStream.`);\n\t}\n\n\tif (isDuplexStream(final, {checkOpen: false})) {\n\t\tthrow new TypeError(`The \\`${optionName}.final\\` option must not be a Duplex stream.`);\n\t}\n\n\tif (isTransformStream(final)) {\n\t\tthrow new TypeError(`The \\`${optionName}.final\\` option must not be a web TransformStream.`);\n\t}\n\n\tif (final !== undefined && !isGenerator(final)) {\n\t\tthrow new TypeError(`The \\`${optionName}.final\\` option must be a generator.`);\n\t}\n\n\tcheckBooleanOption(binary, `${optionName}.binary`);\n\tcheckBooleanOption(objectMode, `${optionName}.objectMode`);\n\n\treturn isAsyncGenerator(transform) || isAsyncGenerator(final) ? 'asyncGenerator' : 'generator';\n};\n\nexport const checkBooleanOption = (value, optionName) => {\n\tif (value !== undefined && typeof value !== 'boolean') {\n\t\tthrow new TypeError(`The \\`${optionName}\\` option must use a boolean.`);\n\t}\n};\n\nconst isGenerator = value => isAsyncGenerator(value) || isSyncGenerator(value);\nexport const isAsyncGenerator = value => Object.prototype.toString.call(value) === '[object AsyncGeneratorFunction]';\nconst isSyncGenerator = value => Object.prototype.toString.call(value) === '[object GeneratorFunction]';\nconst isTransformOptions = value => isPlainObj(value)\n\t&& (value.transform !== undefined || value.final !== undefined);\n\nexport const isUrl = value => Object.prototype.toString.call(value) === '[object URL]';\nexport const isRegularUrl = value => isUrl(value) && value.protocol !== 'file:';\n\nconst isFilePathObject = value => isPlainObj(value)\n\t&& Object.keys(value).length > 0\n\t&& Object.keys(value).every(key => FILE_PATH_KEYS.has(key))\n\t&& isFilePathString(value.file);\nconst FILE_PATH_KEYS = new Set(['file', 'append']);\nexport const isFilePathString = file => typeof file === 'string';\n\n// The `{value, input}` object form marks an additional file descriptor's direction explicitly.\n// This is needed for direction-ambiguous values (like `'pipe'`, `'inherit'`, a file or a transform) on fd3+, which otherwise default to output.\nexport const isStdioValueObject = value => isPlainObj(value)\n\t&& Object.keys(value).length > 0\n\t&& Object.keys(value).every(key => STDIO_VALUE_KEYS.has(key))\n\t&& 'value' in value;\nconst STDIO_VALUE_KEYS = new Set(['value', 'input']);\n\nexport const isUnknownStdioString = (type, value) => type === 'native'\n\t&& typeof value === 'string'\n\t&& !KNOWN_STDIO_STRINGS.has(value);\nconst KNOWN_STDIO_STRINGS = new Set(['ipc', 'ignore', 'inherit', 'overlapped', 'pipe']);\n\nconst isReadableStream = value => Object.prototype.toString.call(value) === '[object ReadableStream]';\nexport const isWritableStream = value => Object.prototype.toString.call(value) === '[object WritableStream]';\nconst isWebStream = value => isReadableStream(value) || isWritableStream(value);\nconst isTransformStream = value => isReadableStream(value?.readable) && isWritableStream(value?.writable);\n\nconst isAsyncIterableObject = value => isObject(value) && typeof value[Symbol.asyncIterator] === 'function';\nconst isIterableObject = value => isObject(value) && typeof value[Symbol.iterator] === 'function';\nconst isObject = value => typeof value === 'object' && value !== null;\n\n// Types which modify `subprocess.std*`\nexport const TRANSFORM_TYPES = new Set(['generator', 'asyncGenerator', 'duplex', 'webTransform']);\n// Types which write to a file or a file descriptor\nexport const FILE_TYPES = new Set(['fileUrl', 'filePath', 'fileNumber']);\n// When two file descriptors of this type share the same target, we need to do some special logic\nexport const SPECIAL_DUPLICATE_TYPES_SYNC = new Set(['fileUrl', 'filePath']);\nexport const SPECIAL_DUPLICATE_TYPES = new Set([...SPECIAL_DUPLICATE_TYPES_SYNC, 'webStream', 'nodeStream']);\n// Do not allow two file descriptors of this type sharing the same target\nexport const FORBID_DUPLICATE_TYPES = new Set(['webTransform', 'duplex']);\n\n// Convert types to human-friendly strings for error messages\nexport const TYPE_TO_MESSAGE = {\n\tgenerator: 'a generator',\n\tasyncGenerator: 'an async generator',\n\tfileUrl: 'a file URL',\n\tfilePath: 'a file path string',\n\tfileNumber: 'a file descriptor number',\n\twebStream: 'a web stream',\n\tnodeStream: 'a Node.js stream',\n\twebTransform: 'a web TransformStream',\n\tduplex: 'a Duplex stream',\n\tnative: 'any value',\n\titerable: 'an iterable',\n\tasyncIterable: 'an async iterable',\n\tstring: 'a string',\n\tuint8Array: 'a Uint8Array',\n};\n","import {TRANSFORM_TYPES} from '../stdio/type.js';\n\n/*\nRetrieve the `objectMode`s of a single transform.\n`objectMode` determines the return value's type, i.e. the `readableObjectMode`.\nThe chunk argument's type is based on the previous generator's return value, i.e. the `writableObjectMode` is based on the previous `readableObjectMode`.\nThe last input's generator is read by `subprocess.stdin` which:\n- should not be in `objectMode` for performance reasons.\n- can only be strings, Buffers and Uint8Arrays.\nTherefore its `readableObjectMode` must be `false`.\nThe same applies to the first output's generator's `writableObjectMode`.\n*/\nexport const getTransformObjectModes = (objectMode, index, newTransforms, direction) => direction === 'output'\n\t? getOutputObjectModes(objectMode, index, newTransforms)\n\t: getInputObjectModes(objectMode, index, newTransforms);\n\nconst getOutputObjectModes = (objectMode, index, newTransforms) => {\n\tconst writableObjectMode = index !== 0 && newTransforms[index - 1].value.readableObjectMode;\n\tconst readableObjectMode = objectMode ?? writableObjectMode;\n\treturn {writableObjectMode, readableObjectMode};\n};\n\nconst getInputObjectModes = (objectMode, index, newTransforms) => {\n\tconst writableObjectMode = index === 0\n\t\t? objectMode === true\n\t\t: newTransforms[index - 1].value.readableObjectMode;\n\tconst readableObjectMode = index !== newTransforms.length - 1 && (objectMode ?? writableObjectMode);\n\treturn {writableObjectMode, readableObjectMode};\n};\n\n// Retrieve the `objectMode` of a file descriptor, e.g. `stdout` or `stderr`\nexport const getFdObjectMode = (stdioItems, direction) => {\n\tconst lastTransform = stdioItems.findLast(({type}) => TRANSFORM_TYPES.has(type));\n\tif (lastTransform === undefined) {\n\t\treturn false;\n\t}\n\n\treturn direction === 'input'\n\t\t? lastTransform.value.writableObjectMode\n\t\t: lastTransform.value.readableObjectMode;\n};\n","import isPlainObj from 'is-plain-obj';\nimport {BINARY_ENCODINGS} from '../arguments/encoding-option.js';\nimport {TRANSFORM_TYPES} from '../stdio/type.js';\nimport {getTransformObjectModes} from './object-mode.js';\n\n// Transforms generators/duplex/TransformStream can have multiple shapes.\n// This normalizes it and applies default values.\nexport const normalizeTransforms = (stdioItems, optionName, direction, options) => [\n\t...stdioItems.filter(({type}) => !TRANSFORM_TYPES.has(type)),\n\t...getTransforms(stdioItems, optionName, direction, options),\n];\n\nconst getTransforms = (stdioItems, optionName, direction, {encoding}) => {\n\tconst transforms = stdioItems.filter(({type}) => TRANSFORM_TYPES.has(type));\n\tconst newTransforms = Array.from({length: transforms.length});\n\n\tfor (const [index, stdioItem] of Object.entries(transforms)) {\n\t\tnewTransforms[index] = normalizeTransform({\n\t\t\tstdioItem,\n\t\t\tindex: Number(index),\n\t\t\tnewTransforms,\n\t\t\toptionName,\n\t\t\tdirection,\n\t\t\tencoding,\n\t\t});\n\t}\n\n\treturn sortTransforms(newTransforms, direction);\n};\n\nconst normalizeTransform = ({stdioItem, stdioItem: {type}, index, newTransforms, optionName, direction, encoding}) => {\n\tif (type === 'duplex') {\n\t\treturn normalizeDuplex({stdioItem, optionName});\n\t}\n\n\tif (type === 'webTransform') {\n\t\treturn normalizeTransformStream({\n\t\t\tstdioItem,\n\t\t\tindex,\n\t\t\tnewTransforms,\n\t\t\tdirection,\n\t\t});\n\t}\n\n\treturn normalizeGenerator({\n\t\tstdioItem,\n\t\tindex,\n\t\tnewTransforms,\n\t\tdirection,\n\t\tencoding,\n\t});\n};\n\nconst normalizeDuplex = ({stdioItem, optionName}) => {\n\tconst {value} = stdioItem;\n\tconst {transform} = value;\n\tconst {writableObjectMode, readableObjectMode} = transform;\n\tconst {objectMode = readableObjectMode} = value;\n\n\tif (objectMode && !readableObjectMode) {\n\t\tthrow new TypeError(`The \\`${optionName}.objectMode\\` option can only be \\`true\\` if \\`new Duplex({objectMode: true})\\` is used.`);\n\t}\n\n\tif (!objectMode && readableObjectMode) {\n\t\tthrow new TypeError(`The \\`${optionName}.objectMode\\` option cannot be \\`false\\` if \\`new Duplex({objectMode: true})\\` is used.`);\n\t}\n\n\treturn {\n\t\t...stdioItem,\n\t\tvalue: {transform, writableObjectMode, readableObjectMode},\n\t};\n};\n\nconst normalizeTransformStream = ({stdioItem, stdioItem: {value}, index, newTransforms, direction}) => {\n\tconst {transform, objectMode} = isPlainObj(value) ? value : {transform: value};\n\tconst {writableObjectMode, readableObjectMode} = getTransformObjectModes(objectMode, index, newTransforms, direction);\n\treturn ({\n\t\t...stdioItem,\n\t\tvalue: {transform, writableObjectMode, readableObjectMode},\n\t});\n};\n\nconst normalizeGenerator = ({stdioItem, stdioItem: {value}, index, newTransforms, direction, encoding}) => {\n\tconst {\n\t\ttransform,\n\t\tfinal,\n\t\tbinary: binaryOption = false,\n\t\tpreserveNewlines = false,\n\t\tobjectMode,\n\t} = isPlainObj(value) ? value : {transform: value};\n\tconst binary = binaryOption || BINARY_ENCODINGS.has(encoding);\n\tconst {writableObjectMode, readableObjectMode} = getTransformObjectModes(objectMode, index, newTransforms, direction);\n\treturn {\n\t\t...stdioItem,\n\t\tvalue: {\n\t\t\ttransform,\n\t\t\tfinal,\n\t\t\tbinary,\n\t\t\tpreserveNewlines,\n\t\t\twritableObjectMode,\n\t\t\treadableObjectMode,\n\t\t},\n\t};\n};\n\nconst sortTransforms = (newTransforms, direction) => direction === 'input' ? newTransforms.reverse() : newTransforms;\n","import process from 'node:process';\nimport {\n\tisStream as isNodeStream,\n\tisReadableStream as isNodeReadableStream,\n\tisWritableStream as isNodeWritableStream,\n} from 'is-stream';\nimport {isWritableStream} from './type.js';\n\n// For `stdio[fdNumber]` beyond stdin/stdout/stderr, we need to guess whether the value passed is intended for inputs or outputs.\n// This allows us to know whether to pipe _into_ or _from_ the stream.\n// When `stdio[fdNumber]` is a single value, this guess is fairly straightforward.\n// However, when it is an array instead, we also need to make sure the different values are not incompatible with each other.\nexport const getStreamDirection = (stdioItems, fdNumber, optionName) => {\n\tconst directions = stdioItems.map(stdioItem => getStdioItemDirection(stdioItem, fdNumber));\n\n\tif (directions.includes('input') && directions.includes('output')) {\n\t\tthrow new TypeError(`The \\`${optionName}\\` option must not be an array of both readable and writable values.`);\n\t}\n\n\treturn directions.find(Boolean) ?? DEFAULT_DIRECTION;\n};\n\n// `direction` is set when the user explicitly requests it, e.g. `{value: 'pipe', input: true}`.\n// It takes precedence over guessing, but not over the fixed direction of `stdin`/`stdout`/`stderr`.\nconst getStdioItemDirection = (stdioItem, fdNumber) => KNOWN_DIRECTIONS[fdNumber] ?? getRequestedDirection(stdioItem);\n\n// The explicitly requested `direction` must not contradict a value that is intrinsically the other direction.\n// For example, `{value: writableStream, input: true}` is invalid since a writable value can only be an output.\nconst getRequestedDirection = ({type, value, direction, optionName}) => {\n\tconst guessedDirection = guessStreamDirection[type](value);\n\tif (direction === 'input' && guessedDirection === 'output') {\n\t\tthrow new TypeError(`The \\`${optionName}\\` option is invalid: \\`input: true\\` cannot be used with a writable value, which is always an output.`);\n\t}\n\n\treturn direction ?? guessedDirection;\n};\n\n// `stdin`/`stdout`/`stderr` have a known direction\nconst KNOWN_DIRECTIONS = ['input', 'output', 'output'];\n\nconst anyDirection = () => undefined;\nconst alwaysInput = () => 'input';\n\n// `string` can only be added through the `input` option, i.e. does not need to be handled here\nconst guessStreamDirection = {\n\tgenerator: anyDirection,\n\tasyncGenerator: anyDirection,\n\tfileUrl: anyDirection,\n\tfilePath: anyDirection,\n\titerable: alwaysInput,\n\tasyncIterable: alwaysInput,\n\tuint8Array: alwaysInput,\n\twebStream: value => isWritableStream(value) ? 'output' : 'input',\n\tnodeStream(value) {\n\t\tif (!isNodeReadableStream(value, {checkOpen: false})) {\n\t\t\treturn 'output';\n\t\t}\n\n\t\treturn isNodeWritableStream(value, {checkOpen: false}) ? undefined : 'input';\n\t},\n\twebTransform: anyDirection,\n\tduplex: anyDirection,\n\tnative(value) {\n\t\tconst standardStreamDirection = getStandardStreamDirection(value);\n\t\tif (standardStreamDirection !== undefined) {\n\t\t\treturn standardStreamDirection;\n\t\t}\n\n\t\tif (isNodeStream(value, {checkOpen: false})) {\n\t\t\treturn guessStreamDirection.nodeStream(value);\n\t\t}\n\t},\n};\n\nconst getStandardStreamDirection = value => {\n\tif ([0, process.stdin].includes(value)) {\n\t\treturn 'input';\n\t}\n\n\tif ([1, 2, process.stdout, process.stderr].includes(value)) {\n\t\treturn 'output';\n\t}\n};\n\n// When ambiguous, we initially keep the direction as `undefined`.\n// This allows arrays of `stdio` values to resolve the ambiguity.\n// For example, `stdio[3]: DuplexStream` is ambiguous, but `stdio[3]: [DuplexStream, WritableStream]` is not.\n// When the ambiguity remains, we default to `output` since it is the most common use case for additional file descriptors.\nconst DEFAULT_DIRECTION = 'output';\n","// The `ipc` option adds an `ipc` item to the `stdio` option\nexport const normalizeIpcStdioArray = (stdioArray, ipc) => ipc\n\t? [...stdioArray, 'ipc']\n\t: stdioArray;\n","import {STANDARD_STREAMS_ALIASES} from '../utils/standard-stream.js';\nimport {normalizeIpcStdioArray} from '../ipc/array.js';\nimport {isFullVerbose} from '../verbose/values.js';\nimport {isStdioValueObject} from './type.js';\n\n// Add support for `stdin`/`stdout`/`stderr` as an alias for `stdio`.\n// Also normalize the `stdio` option.\nexport const normalizeStdioOption = ({stdio, ipc, buffer, ...options}, verboseInfo, isSync) => {\n\tconst stdioArray = getStdioArray(stdio, options).map((stdioOption, fdNumber) => addDefaultValue(stdioOption, fdNumber));\n\tvalidateIpcStdioOption(stdioArray);\n\treturn isSync\n\t\t? normalizeStdioSync(stdioArray, buffer, verboseInfo)\n\t\t: normalizeIpcStdioArray(stdioArray, ipc);\n};\n\n// The `stdio: 'ipc'` value (raw `child_process` syntax) was replaced by the `ipc: true` option\nconst validateIpcStdioOption = stdioArray => {\n\tif (stdioArray.some(stdioOption => hasIpcStdioOption(stdioOption))) {\n\t\tthrow new Error('The `ipc: true` option must be used instead of `stdio: \\'ipc\\'`.');\n\t}\n};\n\nconst hasIpcStdioOption = stdioOption => {\n\tif (Array.isArray(stdioOption)) {\n\t\treturn stdioOption.some(item => hasIpcStdioItem(item));\n\t}\n\n\treturn hasIpcStdioItem(stdioOption);\n};\n\nconst hasIpcStdioItem = stdioOption => {\n\tif (isStdioValueObject(stdioOption)) {\n\t\treturn stdioOption.value === 'ipc';\n\t}\n\n\treturn stdioOption === 'ipc';\n};\n\nconst getStdioArray = (stdio, options) => {\n\tif (stdio === undefined) {\n\t\treturn STANDARD_STREAMS_ALIASES.map(alias => options[alias]);\n\t}\n\n\tif (hasAlias(options)) {\n\t\tthrow new Error(`It's not possible to provide \\`stdio\\` in combination with one of ${STANDARD_STREAMS_ALIASES.map(alias => `\\`${alias}\\``).join(', ')}`);\n\t}\n\n\tif (typeof stdio === 'string') {\n\t\treturn [stdio, stdio, stdio];\n\t}\n\n\tif (!Array.isArray(stdio)) {\n\t\tthrow new TypeError(`Expected \\`stdio\\` to be of type \\`string\\` or \\`Array\\`, got \\`${typeof stdio}\\``);\n\t}\n\n\tconst length = Math.max(stdio.length, STANDARD_STREAMS_ALIASES.length);\n\treturn Array.from({length}, (_, fdNumber) => stdio[fdNumber]);\n};\n\nconst hasAlias = options => STANDARD_STREAMS_ALIASES.some(alias => options[alias] !== undefined);\n\nconst addDefaultValue = (stdioOption, fdNumber) => {\n\tif (Array.isArray(stdioOption)) {\n\t\treturn stdioOption.map(item => addDefaultValue(item, fdNumber));\n\t}\n\n\tif (stdioOption === null || stdioOption === undefined) {\n\t\treturn fdNumber >= STANDARD_STREAMS_ALIASES.length ? 'ignore' : 'pipe';\n\t}\n\n\treturn stdioOption;\n};\n\n// Using `buffer: false` with synchronous methods implies `stdout`/`stderr`: `ignore`.\n// Unless the output is needed, e.g. due to `verbose: 'full'` or to redirecting to a file.\nconst normalizeStdioSync = (stdioArray, buffer, verboseInfo) => stdioArray.map((stdioOption, fdNumber) =>\n\t!buffer[fdNumber]\n\t&& fdNumber !== 0\n\t&& !isFullVerbose(verboseInfo, fdNumber)\n\t&& isOutputPipeOnly(stdioOption, fdNumber)\n\t\t? 'ignore'\n\t\t: stdioOption);\n\nconst isOutputPipeOnly = (stdioOption, fdNumber) => isOutputPipe(stdioOption, fdNumber)\n\t|| (Array.isArray(stdioOption) && stdioOption.every(item => isOutputPipe(item, fdNumber)));\n\nconst isOutputPipe = (stdioOption, fdNumber) => stdioOption === 'pipe'\n\t|| isOutputPipeObject(stdioOption, fdNumber);\n\nconst isOutputPipeObject = (stdioOption, fdNumber) => isStdioValueObject(stdioOption)\n\t&& stdioOption.value === 'pipe'\n\t&& (stdioOption.input === undefined || stdioOption.input === false || isFixedOutputPipe(fdNumber, stdioOption.input));\n\n// On `stdout`/`stderr`, the direction is always output, so `input: true` is ignored and the pipe stays output.\nconst isFixedOutputPipe = (fdNumber, input) => input === true && (fdNumber === 1 || fdNumber === 2);\n","import {parseFd} from './specific.js';\n\n// Retrieve stream targeted by the `to` option\nexport const getToStream = (destination, to = 'stdin') => {\n\tconst isWritable = true;\n\tconst {options, fileDescriptors} = SUBPROCESS_OPTIONS.get(destination);\n\tconst fdNumber = getFdNumber(fileDescriptors, to, isWritable);\n\tconst destinationStream = destination.stdio[fdNumber];\n\n\tif (destinationStream === null) {\n\t\tthrow new TypeError(getInvalidStdioOptionMessage(fdNumber, to, options, isWritable));\n\t}\n\n\treturn destinationStream;\n};\n\n// Retrieve stream targeted by the `from` option\nexport const getFromStream = (source, from = 'stdout') => {\n\tconst isWritable = false;\n\tconst {options, fileDescriptors} = SUBPROCESS_OPTIONS.get(source);\n\tconst fdNumber = getFdNumber(fileDescriptors, from, isWritable);\n\tconst sourceStream = fdNumber === 'all' ? source.all : source.stdio[fdNumber];\n\n\tif (sourceStream === null || sourceStream === undefined) {\n\t\tthrow new TypeError(getInvalidStdioOptionMessage(fdNumber, from, options, isWritable));\n\t}\n\n\treturn sourceStream;\n};\n\n// Keeps track of the options passed to each Execa call\nexport const SUBPROCESS_OPTIONS = new WeakMap();\n\nconst getFdNumber = (fileDescriptors, fdName, isWritable) => {\n\tconst fdNumber = parseFdNumber(fdName, isWritable);\n\tvalidateFdNumber(fdNumber, fdName, isWritable, fileDescriptors);\n\treturn fdNumber;\n};\n\nconst parseFdNumber = (fdName, isWritable) => {\n\tconst fdNumber = parseFd(fdName);\n\tif (fdNumber !== undefined) {\n\t\treturn fdNumber;\n\t}\n\n\tconst {validOptions, defaultValue} = isWritable\n\t\t? {validOptions: '\"stdin\"', defaultValue: 'stdin'}\n\t\t: {validOptions: '\"stdout\", \"stderr\", \"all\"', defaultValue: 'stdout'};\n\tthrow new TypeError(`\"${getOptionName(isWritable)}\" must not be \"${fdName}\".\nIt must be ${validOptions} or \"fd3\", \"fd4\" (and so on).\nIt is optional and defaults to \"${defaultValue}\".`);\n};\n\nconst validateFdNumber = (fdNumber, fdName, isWritable, fileDescriptors) => {\n\tconst fileDescriptor = fileDescriptors[getUsedDescriptor(fdNumber)];\n\tif (fileDescriptor === undefined) {\n\t\tthrow new TypeError(`\"${getOptionName(isWritable)}\" must not be ${fdName}. That file descriptor does not exist.\nPlease set the \"stdio\" option to ensure that file descriptor exists.`);\n\t}\n\n\tif (fileDescriptor.direction === 'input' && !isWritable) {\n\t\tthrow new TypeError(`\"${getOptionName(isWritable)}\" must not be ${fdName}. It must be a readable stream, not writable.`);\n\t}\n\n\tif (fileDescriptor.direction !== 'input' && isWritable) {\n\t\tthrow new TypeError(`\"${getOptionName(isWritable)}\" must not be ${fdName}. It must be a writable stream, not readable.\nIf you meant to use it as input, please set its \"stdio\" option to \\`{value: 'pipe', input: true}\\`.`);\n\t}\n};\n\nconst getInvalidStdioOptionMessage = (fdNumber, fdName, options, isWritable) => {\n\tif (fdNumber === 'all' && !options.all) {\n\t\treturn 'The \"all\" option must be true to use \"from: \\'all\\'\".';\n\t}\n\n\tconst {optionName, optionValue} = getInvalidStdioOption(fdNumber, options);\n\treturn `The \"${optionName}: ${serializeOptionValue(optionValue)}\" option is incompatible with using \"${getOptionName(isWritable)}: ${serializeOptionValue(fdName)}\".\nPlease set this option with \"pipe\" instead.`;\n};\n\nconst getInvalidStdioOption = (fdNumber, {stdin, stdout, stderr, stdio}) => {\n\tconst usedDescriptor = getUsedDescriptor(fdNumber);\n\n\tif (usedDescriptor === 0 && stdin !== undefined) {\n\t\treturn {optionName: 'stdin', optionValue: stdin};\n\t}\n\n\tif (usedDescriptor === 1 && stdout !== undefined) {\n\t\treturn {optionName: 'stdout', optionValue: stdout};\n\t}\n\n\tif (usedDescriptor === 2 && stderr !== undefined) {\n\t\treturn {optionName: 'stderr', optionValue: stderr};\n\t}\n\n\treturn {optionName: `stdio[${usedDescriptor}]`, optionValue: stdio[usedDescriptor]};\n};\n\nconst getUsedDescriptor = fdNumber => fdNumber === 'all' ? 1 : fdNumber;\n\nconst getOptionName = isWritable => isWritable ? 'to' : 'from';\n\nexport const serializeOptionValue = value => {\n\tif (typeof value === 'string') {\n\t\treturn `'${value}'`;\n\t}\n\n\treturn typeof value === 'number' ? `${value}` : 'Stream';\n};\n","import {readFileSync} from 'node:fs';\nimport tty from 'node:tty';\nimport {isStream as isNodeStream} from 'is-stream';\nimport {STANDARD_STREAMS} from '../utils/standard-stream.js';\nimport {bufferToUint8Array} from '../utils/uint-array.js';\nimport {serializeOptionValue} from '../arguments/fd-options.js';\n\n// When we use multiple `stdio` values for the same streams, we pass 'pipe' to `child_process.spawn()`.\n// We then emulate the piping done by core Node.js.\n// To do so, we transform the following values:\n// - Node.js streams are marked as `type: nodeStream`\n// - 'inherit' becomes `process.stdin|stdout|stderr`\n// - any file descriptor integer becomes `process.stdio[fdNumber]`\n// All of the above transformations tell Execa to perform manual piping.\nexport const handleNativeStream = ({stdioItem, stdioItem: {type}, isStdioArray, fdNumber, direction, isSync}) => {\n\tif (!isStdioArray || type !== 'native') {\n\t\treturn stdioItem;\n\t}\n\n\treturn isSync\n\t\t? handleNativeStreamSync({stdioItem, fdNumber, direction})\n\t\t: handleNativeStreamAsync({stdioItem, fdNumber});\n};\n\n// Synchronous methods use a different logic.\n// 'inherit', file descriptors and process.std* are handled by readFileSync()/writeFileSync().\nconst handleNativeStreamSync = ({stdioItem, stdioItem: {value, optionName}, fdNumber, direction}) => {\n\tconst targetFd = getTargetFd({\n\t\tvalue,\n\t\toptionName,\n\t\tfdNumber,\n\t\tdirection,\n\t});\n\tif (targetFd !== undefined) {\n\t\treturn targetFd;\n\t}\n\n\tif (isNodeStream(value, {checkOpen: false})) {\n\t\tthrow new TypeError(`The \\`${optionName}: Stream\\` option cannot both be an array and include a stream with synchronous methods.`);\n\t}\n\n\treturn stdioItem;\n};\n\nconst getTargetFd = ({value, optionName, fdNumber, direction}) => {\n\tconst targetFdNumber = getTargetFdNumber(value, fdNumber);\n\tif (targetFdNumber === undefined) {\n\t\treturn;\n\t}\n\n\tif (direction === 'output') {\n\t\treturn {type: 'fileNumber', value: targetFdNumber, optionName};\n\t}\n\n\tif (tty.isatty(targetFdNumber)) {\n\t\tthrow new TypeError(`The \\`${optionName}: ${serializeOptionValue(value)}\\` option is invalid: it cannot be a TTY with synchronous methods.`);\n\t}\n\n\treturn {type: 'uint8Array', value: bufferToUint8Array(readFileSync(targetFdNumber)), optionName};\n};\n\nconst getTargetFdNumber = (value, fdNumber) => {\n\tif (value === 'inherit') {\n\t\treturn fdNumber;\n\t}\n\n\tif (typeof value === 'number') {\n\t\treturn value;\n\t}\n\n\tconst standardStreamIndex = STANDARD_STREAMS.indexOf(value);\n\tif (standardStreamIndex !== -1) {\n\t\treturn standardStreamIndex;\n\t}\n};\n\nconst handleNativeStreamAsync = ({stdioItem, stdioItem: {value, optionName}, fdNumber}) => {\n\tif (value === 'inherit') {\n\t\treturn {type: 'nodeStream', value: getStandardStream(fdNumber, value, optionName), optionName};\n\t}\n\n\tif (typeof value === 'number') {\n\t\treturn {type: 'nodeStream', value: getStandardStream(value, value, optionName), optionName};\n\t}\n\n\tif (isNodeStream(value, {checkOpen: false})) {\n\t\treturn {type: 'nodeStream', value, optionName};\n\t}\n\n\treturn stdioItem;\n};\n\n// Node.js does not allow to easily retrieve file descriptors beyond stdin/stdout/stderr as streams.\n// - `fs.createReadStream()`/`fs.createWriteStream()` with the `fd` option do not work with character devices that use blocking reads/writes (such as interactive TTYs).\n// - Using a TCP `Socket` would work but be rather complex to implement.\n// Since this is an edge case, we simply throw an error message.\n// See https://github.com/sindresorhus/execa/pull/643#discussion_r1435905707\nconst getStandardStream = (fdNumber, value, optionName) => {\n\tconst standardStream = STANDARD_STREAMS[fdNumber];\n\n\tif (standardStream === undefined) {\n\t\tthrow new TypeError(`The \\`${optionName}: ${value}\\` option is invalid: no such standard stream.`);\n\t}\n\n\treturn standardStream;\n};\n","import {isReadableStream} from 'is-stream';\nimport {isUint8Array} from '../utils/uint-array.js';\nimport {isUrl, isFilePathString} from './type.js';\n\n// Append the `stdin` option with the `input` and `inputFile` options\nexport const handleInputOptions = ({input, inputFile}, fdNumber) => fdNumber === 0\n\t? [\n\t\t...handleInputOption(input),\n\t\t...handleInputFileOption(inputFile),\n\t]\n\t: [];\n\nconst handleInputOption = input => input === undefined\n\t? []\n\t: [{\n\t\ttype: getInputType(input),\n\t\tvalue: input,\n\t\toptionName: 'input',\n\t}];\n\nconst getInputType = input => {\n\tif (isReadableStream(input, {checkOpen: false})) {\n\t\treturn 'nodeStream';\n\t}\n\n\tif (typeof input === 'string') {\n\t\treturn 'string';\n\t}\n\n\tif (isUint8Array(input)) {\n\t\treturn 'uint8Array';\n\t}\n\n\tthrow new Error('The `input` option must be a string, a Uint8Array or a Node.js Readable stream.');\n};\n\nconst handleInputFileOption = inputFile => inputFile === undefined\n\t? []\n\t: [{\n\t\t...getInputFileType(inputFile),\n\t\toptionName: 'inputFile',\n\t}];\n\nconst getInputFileType = inputFile => {\n\tif (isUrl(inputFile)) {\n\t\treturn {type: 'fileUrl', value: inputFile};\n\t}\n\n\tif (isFilePathString(inputFile)) {\n\t\treturn {type: 'filePath', value: {file: inputFile}};\n\t}\n\n\tthrow new Error('The `inputFile` option must be a file path string or a file URL.');\n};\n","import {\n\tSPECIAL_DUPLICATE_TYPES_SYNC,\n\tSPECIAL_DUPLICATE_TYPES,\n\tFORBID_DUPLICATE_TYPES,\n\tTYPE_TO_MESSAGE,\n} from './type.js';\n\n// Duplicates in the same file descriptor is most likely an error.\n// However, this can be useful with generators.\nexport const filterDuplicates = stdioItems => stdioItems.filter((stdioItemOne, indexOne) =>\n\tstdioItems.every((stdioItemTwo, indexTwo) => !hasSameValueAndDirection(stdioItemOne, stdioItemTwo)\n\t\t|| indexOne >= indexTwo\n\t\t|| stdioItemOne.type === 'generator'\n\t\t|| stdioItemOne.type === 'asyncGenerator'));\n\nconst hasSameValueAndDirection = (stdioItemOne, stdioItemTwo) => stdioItemOne.value === stdioItemTwo.value\n\t&& stdioItemOne.direction === stdioItemTwo.direction;\n\n// Check if two file descriptors are sharing the same target.\n// For example `{stdout: {file: './output.txt'}, stderr: {file: './output.txt'}}`.\nexport const getDuplicateStream = ({stdioItem: {type, value, optionName}, direction, fileDescriptors, isSync}) => {\n\tconst otherStdioItems = getOtherStdioItems(fileDescriptors, type);\n\tif (otherStdioItems.length === 0) {\n\t\treturn;\n\t}\n\n\tif (isSync) {\n\t\tvalidateDuplicateStreamSync({\n\t\t\totherStdioItems,\n\t\t\ttype,\n\t\t\tvalue,\n\t\t\toptionName,\n\t\t\tdirection,\n\t\t});\n\t\treturn;\n\t}\n\n\tif (SPECIAL_DUPLICATE_TYPES.has(type)) {\n\t\treturn getDuplicateStreamInstance({\n\t\t\totherStdioItems,\n\t\t\ttype,\n\t\t\tvalue,\n\t\t\toptionName,\n\t\t\tdirection,\n\t\t});\n\t}\n\n\tif (FORBID_DUPLICATE_TYPES.has(type)) {\n\t\tvalidateDuplicateTransform({\n\t\t\totherStdioItems,\n\t\t\ttype,\n\t\t\tvalue,\n\t\t\toptionName,\n\t\t});\n\t}\n};\n\n// Values shared by multiple file descriptors\nconst getOtherStdioItems = (fileDescriptors, type) => fileDescriptors\n\t.flatMap(({direction, stdioItems}) => stdioItems\n\t\t.filter(stdioItem => stdioItem.type === type)\n\t\t.map((stdioItem => ({...stdioItem, direction}))));\n\n// With `execaSync()`, do not allow setting a file path both in input and output\nconst validateDuplicateStreamSync = ({otherStdioItems, type, value, optionName, direction}) => {\n\tif (SPECIAL_DUPLICATE_TYPES_SYNC.has(type)) {\n\t\tgetDuplicateStreamInstance({\n\t\t\totherStdioItems,\n\t\t\ttype,\n\t\t\tvalue,\n\t\t\toptionName,\n\t\t\tdirection,\n\t\t});\n\t}\n};\n\n// When two file descriptors share the file or stream, we need to re-use the same underlying stream.\n// Otherwise, the stream would be closed twice when piping ends.\n// This is only an issue with output file descriptors.\n// This is not a problem with generator functions since those create a new instance for each file descriptor.\n// We also forbid input and output file descriptors sharing the same file or stream, since that does not make sense.\nconst getDuplicateStreamInstance = ({otherStdioItems, type, value, optionName, direction}) => {\n\tconst duplicateStdioItems = otherStdioItems.filter(stdioItem => hasSameValue(stdioItem, value));\n\tif (duplicateStdioItems.length === 0) {\n\t\treturn;\n\t}\n\n\tconst differentStdioItem = duplicateStdioItems.find(stdioItem => stdioItem.direction !== direction);\n\tthrowOnDuplicateStream(differentStdioItem, optionName, type);\n\n\treturn direction === 'output' ? duplicateStdioItems[0].stream : undefined;\n};\n\nconst hasSameValue = ({type, value}, secondValue) => {\n\tif (type === 'filePath') {\n\t\treturn value.file === secondValue.file;\n\t}\n\n\tif (type === 'fileUrl') {\n\t\treturn value.href === secondValue.href;\n\t}\n\n\treturn value === secondValue;\n};\n\n// We do not allow two file descriptors to share the same Duplex or TransformStream.\n// This is because those are set directly to `subprocess.std*`.\n// For example, this could result in `subprocess.stdout` and `subprocess.stderr` being the same value.\n// This means reading from either would get data from both stdout and stderr.\nconst validateDuplicateTransform = ({otherStdioItems, type, value, optionName}) => {\n\tconst duplicateStdioItem = otherStdioItems.find(({value: {transform}}) => transform === value.transform);\n\tthrowOnDuplicateStream(duplicateStdioItem, optionName, type);\n};\n\nconst throwOnDuplicateStream = (stdioItem, optionName, type) => {\n\tif (stdioItem !== undefined) {\n\t\tthrow new TypeError(`The \\`${stdioItem.optionName}\\` and \\`${optionName}\\` options must not target ${TYPE_TO_MESSAGE[type]} that is the same.`);\n\t}\n};\n","import {getStreamName, isStandardStream} from '../utils/standard-stream.js';\nimport {normalizeTransforms} from '../transform/normalize.js';\nimport {getFdObjectMode} from '../transform/object-mode.js';\nimport {\n\tgetStdioItemType,\n\tisRegularUrl,\n\tisUnknownStdioString,\n\tisStdioValueObject,\n\tcheckBooleanOption,\n\tFILE_TYPES,\n} from './type.js';\nimport {getStreamDirection} from './direction.js';\nimport {normalizeStdioOption} from './stdio-option.js';\nimport {handleNativeStream} from './native.js';\nimport {handleInputOptions} from './input-option.js';\nimport {filterDuplicates, getDuplicateStream} from './duplicate.js';\n\n// Handle `input`, `inputFile`, `stdin`, `stdout` and `stderr` options, before spawning, in async/sync mode\n// They are converted into an array of `fileDescriptors`.\n// Each `fileDescriptor` is normalized, validated and contains all information necessary for further handling.\nexport const handleStdio = (addProperties, options, verboseInfo, isSync) => {\n\tconst stdio = normalizeStdioOption(options, verboseInfo, isSync);\n\tconst initialFileDescriptors = stdio.map((stdioOption, fdNumber) => getFileDescriptor({\n\t\tstdioOption,\n\t\tfdNumber,\n\t\toptions,\n\t\tisSync,\n\t}));\n\tconst fileDescriptors = getFinalFileDescriptors({\n\t\tinitialFileDescriptors,\n\t\taddProperties,\n\t\toptions,\n\t\tisSync,\n\t});\n\toptions.stdio = fileDescriptors.map(({stdioItems}) => forwardStdio(stdioItems));\n\treturn fileDescriptors;\n};\n\nconst getFileDescriptor = ({stdioOption, fdNumber, options, isSync}) => {\n\tconst optionName = getStreamName(fdNumber);\n\tconst {stdioItems: initialStdioItems, isStdioArray} = initializeStdioItems({\n\t\tstdioOption,\n\t\tfdNumber,\n\t\toptions,\n\t\toptionName,\n\t});\n\tconst direction = getStreamDirection(initialStdioItems, fdNumber, optionName);\n\tconst stdioItems = initialStdioItems.map(stdioItem => handleNativeStream({\n\t\tstdioItem,\n\t\tisStdioArray,\n\t\tfdNumber,\n\t\tdirection,\n\t\tisSync,\n\t}));\n\tconst normalizedStdioItems = normalizeTransforms(stdioItems, optionName, direction, options);\n\tconst objectMode = getFdObjectMode(normalizedStdioItems, direction);\n\tvalidateFileObjectMode(normalizedStdioItems, objectMode);\n\treturn {direction, objectMode, stdioItems: normalizedStdioItems};\n};\n\n// We make sure passing an array with a single item behaves the same as passing that item without an array.\n// This is what users would expect.\n// For example, `stdout: ['ignore']` behaves the same as `stdout: 'ignore'`.\nconst initializeStdioItems = ({stdioOption, fdNumber, options, optionName}) => {\n\tconst values = Array.isArray(stdioOption) ? stdioOption : [stdioOption];\n\tconst inputStdioItems = handleInputOptions(options, fdNumber);\n\tconst initialStdioItems = [\n\t\t...omitInheritedStdin(values.map(value => initializeStdioItem(value, optionName)), inputStdioItems),\n\t\t...inputStdioItems,\n\t];\n\n\tconst stdioItems = filterDuplicates(initialStdioItems);\n\tconst isStdioArray = stdioItems.length > 1;\n\tvalidateStdioArray(stdioItems, isStdioArray, optionName);\n\tvalidateStreams(stdioItems);\n\treturn {stdioItems, isStdioArray};\n};\n\nconst omitInheritedStdin = (stdioItems, inputStdioItems) => inputStdioItems.length > 0 && isInheritedStdinOnly(stdioItems)\n\t? []\n\t: stdioItems;\n\nconst isInheritedStdinOnly = stdioItems => stdioItems.length === 1\n\t&& stdioItems[0].type === 'native'\n\t&& stdioItems[0].value === 'inherit';\n\nconst initializeStdioItem = (value, optionName) => {\n\tif (isStdioValueObject(value)) {\n\t\treturn initializeStdioValueObject(value, optionName);\n\t}\n\n\treturn {\n\t\ttype: getStdioItemType(value, optionName),\n\t\tvalue,\n\t\toptionName,\n\t};\n};\n\n// The `{value, input}` object form wraps any stdio value with an explicit direction.\nconst initializeStdioValueObject = ({value, input}, optionName) => {\n\tcheckBooleanOption(input, `${optionName}.input`);\n\n\treturn {\n\t\ttype: getStdioItemType(value, optionName),\n\t\tvalue,\n\t\tdirection: input ? 'input' : undefined,\n\t\toptionName,\n\t};\n};\n\nconst validateStdioArray = (stdioItems, isStdioArray, optionName) => {\n\tif (stdioItems.length === 0) {\n\t\tthrow new TypeError(`The \\`${optionName}\\` option must not be an empty array.`);\n\t}\n\n\tif (!isStdioArray) {\n\t\treturn;\n\t}\n\n\tfor (const {value, optionName} of stdioItems) {\n\t\tif (INVALID_STDIO_ARRAY_OPTIONS.has(value)) {\n\t\t\tthrow new Error(`The \\`${optionName}\\` option must not include \\`${value}\\`.`);\n\t\t}\n\t}\n};\n\n// Using the `ignore` value together with others for the same stream does not make sense, so we make it fail.\n// However, we do allow it if the array has a single item.\nconst INVALID_STDIO_ARRAY_OPTIONS = new Set(['ignore']);\n\nconst validateStreams = stdioItems => {\n\tfor (const stdioItem of stdioItems) {\n\t\tvalidateFileStdio(stdioItem);\n\t}\n};\n\nconst validateFileStdio = ({type, value, optionName}) => {\n\tif (isRegularUrl(value)) {\n\t\tthrow new TypeError(`The \\`${optionName}: URL\\` option must use the \\`file:\\` scheme.\nFor example, you can use the \\`pathToFileURL()\\` method of the \\`url\\` core module.`);\n\t}\n\n\tif (isUnknownStdioString(type, value)) {\n\t\tthrow new TypeError(`The \\`${optionName}: { file: '...' }\\` option must be used instead of \\`${optionName}: '...'\\`.`);\n\t}\n};\n\nconst validateFileObjectMode = (stdioItems, objectMode) => {\n\tif (!objectMode) {\n\t\treturn;\n\t}\n\n\tconst fileStdioItem = stdioItems.find(({type}) => FILE_TYPES.has(type));\n\tif (fileStdioItem !== undefined) {\n\t\tthrow new TypeError(`The \\`${fileStdioItem.optionName}\\` option cannot use both files and transforms in objectMode.`);\n\t}\n};\n\n// Some `stdio` values require Execa to create streams.\n// For example, file paths create file read/write streams.\n// Those transformations are specified in `addProperties`, which is both direction-specific and type-specific.\nconst getFinalFileDescriptors = ({initialFileDescriptors, addProperties, options, isSync}) => {\n\tconst fileDescriptors = [];\n\n\ttry {\n\t\tfor (const fileDescriptor of initialFileDescriptors) {\n\t\t\tfileDescriptors.push(getFinalFileDescriptor({\n\t\t\t\tfileDescriptor,\n\t\t\t\tfileDescriptors,\n\t\t\t\taddProperties,\n\t\t\t\toptions,\n\t\t\t\tisSync,\n\t\t\t}));\n\t\t}\n\n\t\treturn fileDescriptors;\n\t} catch (error) {\n\t\tcleanupCustomStreams(fileDescriptors);\n\t\tthrow error;\n\t}\n};\n\nconst getFinalFileDescriptor = ({\n\tfileDescriptor: {direction, objectMode, stdioItems},\n\tfileDescriptors,\n\taddProperties,\n\toptions,\n\tisSync,\n}) => {\n\tconst finalStdioItems = stdioItems.map(stdioItem => addStreamProperties({\n\t\tstdioItem,\n\t\taddProperties,\n\t\tdirection,\n\t\toptions,\n\t\tfileDescriptors,\n\t\tisSync,\n\t}));\n\treturn {direction, objectMode, stdioItems: finalStdioItems};\n};\n\nconst addStreamProperties = ({stdioItem, addProperties, direction, options, fileDescriptors, isSync}) => {\n\tconst duplicateStream = getDuplicateStream({\n\t\tstdioItem,\n\t\tdirection,\n\t\tfileDescriptors,\n\t\tisSync,\n\t});\n\n\tif (duplicateStream !== undefined) {\n\t\treturn {...stdioItem, stream: duplicateStream};\n\t}\n\n\treturn {\n\t\t...stdioItem,\n\t\t...addProperties[direction][stdioItem.type](stdioItem, options),\n\t};\n};\n\n// The stream error handling is performed by the piping logic above, which cannot be performed before subprocess spawning.\n// If the subprocess spawning fails (e.g. due to an invalid command), the streams need to be manually destroyed.\n// We need to create those streams before subprocess spawning, in case their creation fails, e.g. when passing an invalid generator as argument.\n// Like this, an exception would be thrown, which would prevent spawning a subprocess.\nexport const cleanupCustomStreams = fileDescriptors => {\n\tfor (const {stdioItems} of fileDescriptors) {\n\t\tfor (const {stream} of stdioItems) {\n\t\t\tif (stream !== undefined && !isStandardStream(stream)) {\n\t\t\t\tstream.destroy();\n\t\t\t}\n\t\t}\n\t}\n};\n\n// When the `std*: Iterable | WebStream | URL | filePath`, `input` or `inputFile` option is used, we pipe to `subprocess.std*`.\n// When the `std*: Array` option is used, we emulate some of the native values ('inherit', Node.js stream and file descriptor integer). To do so, we also need to pipe to `subprocess.std*`.\n// Therefore the `std*` options must be either `pipe` or `overlapped`. Other values do not set `subprocess.std*`.\nconst forwardStdio = stdioItems => {\n\tif (stdioItems.length > 1) {\n\t\treturn stdioItems.some(({value}) => value === 'overlapped') ? 'overlapped' : 'pipe';\n\t}\n\n\tconst [{type, value}] = stdioItems;\n\treturn type === 'native' ? value : 'pipe';\n};\n","import {readFileSync} from 'node:fs';\nimport {bufferToUint8Array} from '../utils/uint-array.js';\nimport {handleStdio} from './handle.js';\nimport {TYPE_TO_MESSAGE} from './type.js';\n\n// Normalize `input`, `inputFile`, `stdin`, `stdout` and `stderr` options, before spawning, in sync mode\nexport const handleStdioSync = (options, verboseInfo) => handleStdio(addPropertiesSync, options, verboseInfo, true);\n\nconst forbiddenIfSync = ({type, optionName}) => {\n\tthrowInvalidSyncValue(optionName, TYPE_TO_MESSAGE[type]);\n};\n\nconst forbiddenNativeIfSync = ({optionName, value}) => {\n\tif (value === 'overlapped') {\n\t\tthrowInvalidSyncValue(optionName, `\"${value}\"`);\n\t}\n\n\treturn {};\n};\n\n// A native input pipe on an additional file descriptor cannot be fed in sync mode, since there is no way to write to it after spawning, so it would hang.\nconst forbiddenNativeInputIfSync = stdioItem => {\n\tconst {optionName, value} = stdioItem;\n\tif (value === 'pipe' && optionName !== 'stdin') {\n\t\tthrow new TypeError(`Only the \\`stdin\\` option, not \\`${optionName}\\`, can be an input pipe with synchronous methods.`);\n\t}\n\n\treturn forbiddenNativeIfSync(stdioItem);\n};\n\nconst throwInvalidSyncValue = (optionName, value) => {\n\tthrow new TypeError(`The \\`${optionName}\\` option cannot be ${value} with synchronous methods.`);\n};\n\n// Create streams used internally for redirecting when using specific values for the `std*` options, in sync mode.\n// For example, `stdin: {file}` reads the file synchronously, then passes it as the `input` option.\nconst addProperties = {\n\tgenerator() {},\n\tasyncGenerator: forbiddenIfSync,\n\twebStream: forbiddenIfSync,\n\tnodeStream: forbiddenIfSync,\n\twebTransform: forbiddenIfSync,\n\tduplex: forbiddenIfSync,\n\tasyncIterable: forbiddenIfSync,\n\tnative: forbiddenNativeIfSync,\n};\n\nconst addPropertiesSync = {\n\tinput: {\n\t\t...addProperties,\n\t\tnative: forbiddenNativeInputIfSync,\n\t\tfileUrl: ({value}) => ({contents: [bufferToUint8Array(readFileSync(value))]}),\n\t\tfilePath: ({value: {file}}) => ({contents: [bufferToUint8Array(readFileSync(file))]}),\n\t\tfileNumber: forbiddenIfSync,\n\t\titerable: ({value}) => ({contents: [...value]}),\n\t\tstring: ({value}) => ({contents: [value]}),\n\t\tuint8Array: ({value}) => ({contents: [value]}),\n\t},\n\toutput: {\n\t\t...addProperties,\n\t\tfileUrl: ({value}) => ({path: value}),\n\t\tfilePath: ({value: {file, append}}) => ({path: file, append}),\n\t\tfileNumber: ({value}) => ({path: value}),\n\t\titerable: forbiddenIfSync,\n\t\tstring: forbiddenIfSync,\n\t\tuint8Array: forbiddenIfSync,\n\t},\n};\n","import stripFinalNewlineFunction from 'strip-final-newline';\n\n// Apply `stripFinalNewline` option, which applies to `result.stdout|stderr|all|stdio[*]`.\n// If the `lines` option is used, it is applied on each line, but using a different function.\nexport const stripNewline = (value, {stripFinalNewline}, fdNumber) => getStripFinalNewline(stripFinalNewline, fdNumber) && value !== undefined && !Array.isArray(value)\n\t? stripFinalNewlineFunction(value)\n\t: value;\n\n// Retrieve `stripFinalNewline` option value, including with `subprocess.all`\nexport const getStripFinalNewline = (stripFinalNewline, fdNumber) => fdNumber === 'all'\n\t? stripFinalNewline[1] || stripFinalNewline[2]\n\t: stripFinalNewline[fdNumber];\n","// Split chunks line-wise for generators passed to the `std*` options\nexport const getSplitLinesGenerator = (binary, preserveNewlines, skipped, state) => binary || skipped\n\t? undefined\n\t: initializeSplitLines(preserveNewlines, state);\n\n// Same but for synchronous methods\nexport const splitLinesSync = (chunk, preserveNewlines, objectMode) => objectMode\n\t? chunk.flatMap(item => splitLinesItemSync(item, preserveNewlines))\n\t: splitLinesItemSync(chunk, preserveNewlines);\n\nconst splitLinesItemSync = (chunk, preserveNewlines) => {\n\tconst {transform, final} = initializeSplitLines(preserveNewlines, {});\n\treturn [...transform(chunk), ...final()];\n};\n\nconst initializeSplitLines = (preserveNewlines, state) => {\n\tstate.previousChunks = '';\n\treturn {\n\t\ttransform: splitGenerator.bind(undefined, state, preserveNewlines),\n\t\tfinal: linesFinal.bind(undefined, state),\n\t};\n};\n\n// This imperative logic is much faster than using `String.split()` and uses very low memory.\nconst splitGenerator = function * (state, preserveNewlines, chunk) {\n\tif (typeof chunk !== 'string') {\n\t\tyield chunk;\n\t\treturn;\n\t}\n\n\tlet {previousChunks} = state;\n\tlet start = -1;\n\n\tfor (let end = 0; end < chunk.length; end += 1) {\n\t\tif (chunk[end] !== '\\n') {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst newlineLength = getNewlineLength(chunk, end, preserveNewlines, state);\n\t\tlet line = chunk.slice(start + 1, end + 1 - newlineLength);\n\n\t\tif (previousChunks.length > 0) {\n\t\t\tline = concatString(previousChunks, line);\n\t\t\tpreviousChunks = '';\n\t\t}\n\n\t\tyield line;\n\t\tstart = end;\n\t}\n\n\tif (start !== chunk.length - 1) {\n\t\tpreviousChunks = concatString(previousChunks, chunk.slice(start + 1));\n\t}\n\n\tstate.previousChunks = previousChunks;\n};\n\nconst getNewlineLength = (chunk, end, preserveNewlines, state) => {\n\tif (preserveNewlines) {\n\t\treturn 0;\n\t}\n\n\tstate.isWindowsNewline = end !== 0 && chunk[end - 1] === '\\r';\n\treturn state.isWindowsNewline ? 2 : 1;\n};\n\nconst linesFinal = function * ({previousChunks}) {\n\tif (previousChunks.length > 0) {\n\t\tyield previousChunks;\n\t}\n};\n\n// Unless `preserveNewlines: true` is used, we strip the newline of each line.\n// This re-adds them after the user `transform` code has run.\nexport const getAppendNewlineGenerator = ({binary, preserveNewlines, readableObjectMode, state}) => binary || preserveNewlines || readableObjectMode\n\t? undefined\n\t: {transform: appendNewlineGenerator.bind(undefined, state)};\n\nconst appendNewlineGenerator = function * ({isWindowsNewline = false}, chunk) {\n\tconst {unixNewline, windowsNewline, LF, concatBytes} = typeof chunk === 'string' ? linesStringInfo : linesUint8ArrayInfo;\n\n\tif (chunk.at(-1) === LF) {\n\t\tyield chunk;\n\t\treturn;\n\t}\n\n\tconst newline = isWindowsNewline ? windowsNewline : unixNewline;\n\tyield concatBytes(chunk, newline);\n};\n\nconst concatString = (firstChunk, secondChunk) => `${firstChunk}${secondChunk}`;\n\nconst linesStringInfo = {\n\twindowsNewline: '\\r\\n',\n\tunixNewline: '\\n',\n\tLF: '\\n',\n\tconcatBytes: concatString,\n};\n\nconst concatUint8Array = (firstChunk, secondChunk) => {\n\tconst chunk = new Uint8Array(firstChunk.length + secondChunk.length);\n\tchunk.set(firstChunk, 0);\n\tchunk.set(secondChunk, firstChunk.length);\n\treturn chunk;\n};\n\nconst linesUint8ArrayInfo = {\n\twindowsNewline: new Uint8Array([0x0D, 0x0A]),\n\tunixNewline: new Uint8Array([0x0A]),\n\tLF: 0x0A,\n\tconcatBytes: concatUint8Array,\n};\n","import {Buffer} from 'node:buffer';\nimport {isUint8Array} from '../utils/uint-array.js';\n\n// Validate the type of chunk argument passed to transform generators\nexport const getValidateTransformInput = (writableObjectMode, optionName) => writableObjectMode\n\t? undefined\n\t: validateStringTransformInput.bind(undefined, optionName);\n\nconst validateStringTransformInput = function * (optionName, chunk) {\n\tif (typeof chunk !== 'string' && !isUint8Array(chunk) && !Buffer.isBuffer(chunk)) {\n\t\tthrow new TypeError(`The \\`${optionName}\\` option's transform must use \"objectMode: true\" to receive as input: ${typeof chunk}.`);\n\t}\n\n\tyield chunk;\n};\n\n// Validate the type of the value returned by transform generators\nexport const getValidateTransformReturn = (readableObjectMode, optionName) => readableObjectMode\n\t? validateObjectTransformReturn.bind(undefined, optionName)\n\t: validateStringTransformReturn.bind(undefined, optionName);\n\nconst validateObjectTransformReturn = function * (optionName, chunk) {\n\tvalidateEmptyReturn(optionName, chunk);\n\tyield chunk;\n};\n\nconst validateStringTransformReturn = function * (optionName, chunk) {\n\tvalidateEmptyReturn(optionName, chunk);\n\n\tif (typeof chunk !== 'string' && !isUint8Array(chunk)) {\n\t\tthrow new TypeError(`The \\`${optionName}\\` option's function must yield a string or an Uint8Array, not ${typeof chunk}.`);\n\t}\n\n\tyield chunk;\n};\n\nconst validateEmptyReturn = (optionName, chunk) => {\n\tif (chunk === null || chunk === undefined) {\n\t\tthrow new TypeError(`The \\`${optionName}\\` option's function must not call \\`yield ${chunk}\\`.\nInstead, \\`yield\\` should either be called with a value, or not be called at all. For example:\n if (condition) { yield value; }`);\n\t}\n};\n","import {Buffer} from 'node:buffer';\nimport {StringDecoder} from 'node:string_decoder';\nimport {isUint8Array, bufferToUint8Array} from '../utils/uint-array.js';\n\n/*\nWhen using binary encodings, add an internal generator that converts chunks from `Buffer` to `string` or `Uint8Array`.\nChunks might be Buffer, Uint8Array or strings since:\n- `subprocess.stdout|stderr` emits Buffers\n- `subprocess.stdin.write()` accepts Buffer, Uint8Array or string\n- Previous generators might return Uint8Array or string\n\nHowever, those are converted to Buffer:\n- on writes: `Duplex.writable` `decodeStrings: true` default option\n- on reads: `Duplex.readable` `readableEncoding: null` default option\n*/\nexport const getEncodingTransformGenerator = (binary, encoding, skipped) => {\n\tif (skipped) {\n\t\treturn;\n\t}\n\n\tif (binary) {\n\t\treturn {transform: encodingUint8ArrayGenerator.bind(undefined, new TextEncoder())};\n\t}\n\n\tconst stringDecoder = new StringDecoder(encoding);\n\treturn {\n\t\ttransform: encodingStringGenerator.bind(undefined, stringDecoder),\n\t\tfinal: encodingStringFinal.bind(undefined, stringDecoder),\n\t};\n};\n\nconst encodingUint8ArrayGenerator = function * (textEncoder, chunk) {\n\tif (Buffer.isBuffer(chunk)) {\n\t\tyield bufferToUint8Array(chunk);\n\t} else if (typeof chunk === 'string') {\n\t\tyield textEncoder.encode(chunk);\n\t} else {\n\t\tyield chunk;\n\t}\n};\n\nconst encodingStringGenerator = function * (stringDecoder, chunk) {\n\tyield isUint8Array(chunk) ? stringDecoder.write(chunk) : chunk;\n};\n\nconst encodingStringFinal = function * (stringDecoder) {\n\tconst lastChunk = stringDecoder.end();\n\tif (lastChunk !== '') {\n\t\tyield lastChunk;\n\t}\n};\n","import {callbackify} from 'node:util';\n\n// Applies a series of generator functions asynchronously\nexport const pushChunks = callbackify(async (getChunks, state, getChunksArguments, transformStream) => {\n\tstate.currentIterable = getChunks(...getChunksArguments);\n\n\ttry {\n\t\tfor await (const chunk of state.currentIterable) {\n\t\t\ttransformStream.push(chunk);\n\t\t}\n\t} finally {\n\t\tdelete state.currentIterable;\n\t}\n});\n\n// For each new chunk, apply each `transform()` method\nexport const transformChunk = async function * (chunk, generators, index) {\n\tif (index === generators.length) {\n\t\tyield chunk;\n\t\treturn;\n\t}\n\n\tconst {transform = identityGenerator} = generators[index];\n\tfor await (const transformedChunk of transform(chunk)) {\n\t\tyield * transformChunk(transformedChunk, generators, index + 1);\n\t}\n};\n\n// At the end, apply each `final()` method, followed by the `transform()` method of the next transforms\nexport const finalChunks = async function * (generators) {\n\tfor (const [index, {final}] of Object.entries(generators)) {\n\t\tyield * generatorFinalChunks(final, Number(index), generators);\n\t}\n};\n\nconst generatorFinalChunks = async function * (final, index, generators) {\n\tif (final === undefined) {\n\t\treturn;\n\t}\n\n\tfor await (const finalChunk of final()) {\n\t\tyield * transformChunk(finalChunk, generators, index + 1);\n\t}\n};\n\n// Cancel any ongoing async generator when the Transform is destroyed, e.g. when the subprocess errors\nexport const destroyTransform = callbackify(async ({currentIterable}, error) => {\n\tif (currentIterable !== undefined) {\n\t\tawait (error ? currentIterable.throw(error) : currentIterable.return());\n\t\treturn;\n\t}\n\n\tif (error) {\n\t\tthrow error;\n\t}\n});\n\nconst identityGenerator = function * (chunk) {\n\tyield chunk;\n};\n","// Duplicate the code from `run-async.js` but as synchronous functions\nexport const pushChunksSync = (getChunksSync, getChunksArguments, transformStream, done) => {\n\ttry {\n\t\tfor (const chunk of getChunksSync(...getChunksArguments)) {\n\t\t\ttransformStream.push(chunk);\n\t\t}\n\n\t\tdone();\n\t} catch (error) {\n\t\tdone(error);\n\t}\n};\n\n// Run synchronous generators with `execaSync()`\nexport const runTransformSync = (generators, chunks) => [\n\t...chunks.flatMap(chunk => [...transformChunkSync(chunk, generators, 0)]),\n\t...finalChunksSync(generators),\n];\n\nexport const transformChunkSync = function * (chunk, generators, index) {\n\tif (index === generators.length) {\n\t\tyield chunk;\n\t\treturn;\n\t}\n\n\tconst {transform = identityGenerator} = generators[index];\n\tfor (const transformedChunk of transform(chunk)) {\n\t\tyield * transformChunkSync(transformedChunk, generators, index + 1);\n\t}\n};\n\nexport const finalChunksSync = function * (generators) {\n\tfor (const [index, {final}] of Object.entries(generators)) {\n\t\tyield * generatorFinalChunksSync(final, Number(index), generators);\n\t}\n};\n\nconst generatorFinalChunksSync = function * (final, index, generators) {\n\tif (final === undefined) {\n\t\treturn;\n\t}\n\n\tfor (const finalChunk of final()) {\n\t\tyield * transformChunkSync(finalChunk, generators, index + 1);\n\t}\n};\n\nconst identityGenerator = function * (chunk) {\n\tyield chunk;\n};\n","import {Transform, getDefaultHighWaterMark} from 'node:stream';\nimport {isAsyncGenerator} from '../stdio/type.js';\nimport {getSplitLinesGenerator, getAppendNewlineGenerator} from './split.js';\nimport {getValidateTransformInput, getValidateTransformReturn} from './validate.js';\nimport {getEncodingTransformGenerator} from './encoding-transform.js';\nimport {\n\tpushChunks,\n\ttransformChunk,\n\tfinalChunks,\n\tdestroyTransform,\n} from './run-async.js';\nimport {\n\tpushChunksSync,\n\ttransformChunkSync,\n\tfinalChunksSync,\n\trunTransformSync,\n} from './run-sync.js';\n\n/*\nGenerators can be used to transform/filter standard streams.\n\nGenerators have a simple syntax, yet allows all of the following:\n- Sharing `state` between chunks\n- Flushing logic, by using a `final` function\n- Asynchronous logic\n- Emitting multiple chunks from a single source chunk, even if spaced in time, by using multiple `yield`\n- Filtering, by using no `yield`\n\nTherefore, there is no need to allow Node.js or web transform streams.\n\nThe `highWaterMark` is kept as the default value, since this is what `subprocess.std*` uses.\n\nChunks are currently processed serially. We could add a `concurrency` option to parallelize in the future.\n\nTransform an array of generator functions into a `Transform` stream.\n`Duplex.from(generator)` cannot be used because it does not allow setting the `objectMode` and `highWaterMark`.\n*/\nexport const generatorToStream = ({\n\tvalue,\n\tvalue: {transform, final, writableObjectMode, readableObjectMode},\n\toptionName,\n}, {encoding}) => {\n\tconst state = {};\n\tconst generators = addInternalGenerators(value, encoding, optionName);\n\n\tconst transformAsync = isAsyncGenerator(transform);\n\tconst finalAsync = isAsyncGenerator(final);\n\tconst transformMethod = transformAsync\n\t\t? pushChunks.bind(undefined, transformChunk, state)\n\t\t: pushChunksSync.bind(undefined, transformChunkSync);\n\tconst finalMethod = transformAsync || finalAsync\n\t\t? pushChunks.bind(undefined, finalChunks, state)\n\t\t: pushChunksSync.bind(undefined, finalChunksSync);\n\tconst destroyMethod = transformAsync || finalAsync\n\t\t? destroyTransform.bind(undefined, state)\n\t\t: undefined;\n\n\tconst stream = new Transform({\n\t\twritableObjectMode,\n\t\twritableHighWaterMark: getDefaultHighWaterMark(writableObjectMode),\n\t\treadableObjectMode,\n\t\treadableHighWaterMark: getDefaultHighWaterMark(readableObjectMode),\n\t\ttransform(chunk, encoding, done) {\n\t\t\ttransformMethod([chunk, generators, 0], this, done);\n\t\t},\n\t\tflush(done) {\n\t\t\tfinalMethod([generators], this, done);\n\t\t},\n\t\tdestroy: destroyMethod,\n\t});\n\treturn {stream};\n};\n\n// Applies transform generators in sync mode\nexport const runGeneratorsSync = (chunks, stdioItems, encoding, isInput) => {\n\tconst generators = stdioItems.filter(({type}) => type === 'generator');\n\tconst reversedGenerators = isInput ? generators.reverse() : generators;\n\n\tfor (const {value, optionName} of reversedGenerators) {\n\t\tconst generators = addInternalGenerators(value, encoding, optionName);\n\t\tchunks = runTransformSync(generators, chunks);\n\t}\n\n\treturn chunks;\n};\n\n// Generators used internally to convert the chunk type, validate it, and split into lines\nconst addInternalGenerators = (\n\t{transform, final, binary, writableObjectMode, readableObjectMode, preserveNewlines},\n\tencoding,\n\toptionName,\n) => {\n\tconst state = {};\n\treturn [\n\t\t{transform: getValidateTransformInput(writableObjectMode, optionName)},\n\t\tgetEncodingTransformGenerator(binary, encoding, writableObjectMode),\n\t\tgetSplitLinesGenerator(binary, preserveNewlines, writableObjectMode, state),\n\t\t{transform, final},\n\t\t{transform: getValidateTransformReturn(readableObjectMode, optionName)},\n\t\tgetAppendNewlineGenerator({\n\t\t\tbinary,\n\t\t\tpreserveNewlines,\n\t\t\treadableObjectMode,\n\t\t\tstate,\n\t\t}),\n\t].filter(Boolean);\n};\n","import {runGeneratorsSync} from '../transform/generator.js';\nimport {joinToUint8Array, isUint8Array} from '../utils/uint-array.js';\nimport {TYPE_TO_MESSAGE} from '../stdio/type.js';\n\n// Apply `stdin`/`input`/`inputFile` options, before spawning, in sync mode, by converting it to the `input` option\nexport const addInputOptionsSync = (fileDescriptors, options) => {\n\tfor (const fdNumber of getInputFdNumbers(fileDescriptors)) {\n\t\taddInputOptionSync(fileDescriptors, fdNumber, options);\n\t}\n};\n\nconst getInputFdNumbers = fileDescriptors => new Set(Object.entries(fileDescriptors)\n\t.filter(([, {direction}]) => direction === 'input')\n\t.map(([fdNumber]) => Number(fdNumber)));\n\nconst addInputOptionSync = (fileDescriptors, fdNumber, options) => {\n\tconst {stdioItems} = fileDescriptors[fdNumber];\n\tconst allStdioItems = stdioItems.filter(({contents}) => contents !== undefined);\n\tif (allStdioItems.length === 0) {\n\t\treturn;\n\t}\n\n\tif (fdNumber !== 0) {\n\t\tconst [{type, optionName}] = allStdioItems;\n\t\tthrow new TypeError(`Only the \\`stdin\\` option, not \\`${optionName}\\`, can be ${TYPE_TO_MESSAGE[type]} with synchronous methods.`);\n\t}\n\n\tconst allContents = allStdioItems.map(({contents}) => contents);\n\tconst transformedContents = allContents.map(contents => applySingleInputGeneratorsSync(contents, stdioItems));\n\toptions.input = joinToUint8Array(transformedContents);\n};\n\nconst applySingleInputGeneratorsSync = (contents, stdioItems) => {\n\tconst newContents = runGeneratorsSync(contents, stdioItems, 'utf8', true);\n\tvalidateSerializable(newContents);\n\treturn joinToUint8Array(newContents);\n};\n\nconst validateSerializable = newContents => {\n\tconst invalidItem = newContents.find(item => typeof item !== 'string' && !isUint8Array(item));\n\tif (invalidItem !== undefined) {\n\t\tthrow 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}.`);\n\t}\n};\n","import {BINARY_ENCODINGS} from '../arguments/encoding-option.js';\nimport {TRANSFORM_TYPES} from '../stdio/type.js';\nimport {verboseLog, serializeVerboseMessage} from './log.js';\nimport {isFullVerbose} from './values.js';\n\n// `ignore` opts-out of `verbose` for a specific stream.\n// `ipc` cannot use piping.\n// `inherit` would result in double printing.\n// They can also lead to double printing when passing file descriptor integers or `process.std*`.\n// This only leaves with `pipe` and `overlapped`.\nexport const shouldLogOutput = ({stdioItems, encoding, verboseInfo, fdNumber}) => fdNumber !== 'all'\n\t&& isFullVerbose(verboseInfo, fdNumber)\n\t&& !BINARY_ENCODINGS.has(encoding)\n\t&& isFdVerbose(fdNumber)\n\t&& (stdioItems.some(({type, value}) => type === 'native' && PIPED_STDIO_VALUES.has(value))\n\t\t|| stdioItems.every(({type}) => TRANSFORM_TYPES.has(type)));\n\n// Printing input streams would be confusing.\n// Files and streams can produce big outputs, which we don't want to print.\n// We could print `stdio[3+]` but it often is redirected to files and streams, with the same issue.\n// So we only print stdout and stderr.\nconst isFdVerbose = fdNumber => fdNumber === 1 || fdNumber === 2;\n\nconst PIPED_STDIO_VALUES = new Set(['pipe', 'overlapped']);\n\n// `verbose: 'full'` printing logic with async methods\nexport const logLines = async (linesIterable, stream, fdNumber, verboseInfo) => {\n\tfor await (const line of linesIterable) {\n\t\tif (!isPipingStream(stream)) {\n\t\t\tlogLine(line, fdNumber, verboseInfo);\n\t\t}\n\t}\n};\n\n// `verbose: 'full'` printing logic with sync methods\nexport const logLinesSync = (linesArray, fdNumber, verboseInfo) => {\n\tfor (const line of linesArray) {\n\t\tlogLine(line, fdNumber, verboseInfo);\n\t}\n};\n\n// When `subprocess.stdout|stderr.pipe()` is called, `verbose` becomes a noop.\n// This prevents the following problems:\n// - `.pipe()` achieves the same result as using `stdout: 'inherit'`, `stdout: stream`, etc. which also make `verbose` a noop.\n// For example, `subprocess.stdout.pipe(process.stdin)` would print each line twice.\n// - When chaining subprocesses with `subprocess.pipe(otherSubprocess)`, only the last one should print its output.\n// Detecting whether `.pipe()` is impossible without monkey-patching it, so we use the following undocumented property.\n// This is not a critical behavior since changes of the following property would only make `verbose` more verbose.\nconst isPipingStream = stream => stream._readableState.pipes.length > 0;\n\n// When `verbose` is `full`, print stdout|stderr\nconst logLine = (line, fdNumber, verboseInfo) => {\n\tconst verboseMessage = serializeVerboseMessage(line);\n\tverboseLog({\n\t\ttype: 'output',\n\t\tverboseMessage,\n\t\tfdNumber,\n\t\tverboseInfo,\n\t});\n};\n","import {writeFileSync, appendFileSync} from 'node:fs';\nimport {shouldLogOutput, logLinesSync} from '../verbose/output.js';\nimport {runGeneratorsSync} from '../transform/generator.js';\nimport {splitLinesSync} from '../transform/split.js';\nimport {joinToString, joinToUint8Array, bufferToUint8Array} from '../utils/uint-array.js';\nimport {FILE_TYPES} from '../stdio/type.js';\nimport {truncateMaxBufferSync} from './max-buffer.js';\n\n// Apply `stdout`/`stderr` options, after spawning, in sync mode\nexport const transformOutputSync = ({fileDescriptors, syncResult: {output}, options, isMaxBuffer, verboseInfo}) => {\n\tif (output === null) {\n\t\treturn {output: Array.from({length: 3})};\n\t}\n\n\tconst state = {};\n\tconst outputFiles = new Set();\n\tconst transformedOutput = output.map((result, fdNumber) =>\n\t\ttransformOutputResultSync({\n\t\t\tresult,\n\t\t\tfileDescriptors,\n\t\t\tfdNumber,\n\t\t\tstate,\n\t\t\toutputFiles,\n\t\t\tisMaxBuffer,\n\t\t\tverboseInfo,\n\t\t}, options));\n\treturn {output: transformedOutput, ...state};\n};\n\nconst transformOutputResultSync = (\n\t{result, fileDescriptors, fdNumber, state, outputFiles, isMaxBuffer, verboseInfo},\n\t{buffer, encoding, lines, stripFinalNewline, maxBuffer},\n) => {\n\tif (result === null) {\n\t\treturn;\n\t}\n\n\tconst truncatedResult = truncateMaxBufferSync(result, isMaxBuffer, maxBuffer);\n\tconst uint8ArrayResult = bufferToUint8Array(truncatedResult);\n\tconst {stdioItems, objectMode} = fileDescriptors[fdNumber];\n\tconst chunks = runOutputGeneratorsSync([uint8ArrayResult], stdioItems, encoding, state);\n\tconst {serializedResult, finalResult = serializedResult} = serializeChunks({\n\t\tchunks,\n\t\tobjectMode,\n\t\tencoding,\n\t\tlines,\n\t\tstripFinalNewline,\n\t\tfdNumber,\n\t});\n\n\tlogOutputSync({\n\t\tserializedResult,\n\t\tfdNumber,\n\t\tstate,\n\t\tverboseInfo,\n\t\tencoding,\n\t\tstdioItems,\n\t\tobjectMode,\n\t});\n\n\tconst returnedResult = buffer[fdNumber] ? finalResult : undefined;\n\n\ttry {\n\t\tif (state.error === undefined) {\n\t\t\twriteToFiles(serializedResult, stdioItems, outputFiles);\n\t\t}\n\n\t\treturn returnedResult;\n\t} catch (error) {\n\t\tstate.error = error;\n\t\treturn returnedResult;\n\t}\n};\n\n// Applies transform generators to `stdout`/`stderr`\nconst runOutputGeneratorsSync = (chunks, stdioItems, encoding, state) => {\n\ttry {\n\t\treturn runGeneratorsSync(chunks, stdioItems, encoding, false);\n\t} catch (error) {\n\t\tstate.error = error;\n\t\treturn chunks;\n\t}\n};\n\n// The contents is converted to three stages:\n// - serializedResult: used when the target is a file path/URL or a file descriptor (including 'inherit')\n// - finalResult/returnedResult: returned as `result.std*`\nconst serializeChunks = ({chunks, objectMode, encoding, lines, stripFinalNewline, fdNumber}) => {\n\tif (objectMode) {\n\t\treturn {serializedResult: chunks};\n\t}\n\n\tif (encoding === 'buffer') {\n\t\treturn {serializedResult: joinToUint8Array(chunks)};\n\t}\n\n\tconst serializedResult = joinToString(chunks, encoding);\n\tif (lines[fdNumber]) {\n\t\treturn {serializedResult, finalResult: splitLinesSync(serializedResult, !stripFinalNewline[fdNumber], objectMode)};\n\t}\n\n\treturn {serializedResult};\n};\n\nconst logOutputSync = ({serializedResult, fdNumber, state, verboseInfo, encoding, stdioItems, objectMode}) => {\n\tif (!shouldLogOutput({\n\t\tstdioItems,\n\t\tencoding,\n\t\tverboseInfo,\n\t\tfdNumber,\n\t})) {\n\t\treturn;\n\t}\n\n\tconst linesArray = splitLinesSync(serializedResult, false, objectMode);\n\n\ttry {\n\t\tlogLinesSync(linesArray, fdNumber, verboseInfo);\n\t} catch (error) {\n\t\tstate.error ??= error;\n\t}\n};\n\n// When the `std*` target is a file path/URL or a file descriptor\nconst writeToFiles = (serializedResult, stdioItems, outputFiles) => {\n\tconst fileItems = stdioItems.filter(({type}) => FILE_TYPES.has(type));\n\tfor (const {path, append} of fileItems) {\n\t\tconst pathString = typeof path === 'string' ? path : path.toString();\n\t\tif (append || outputFiles.has(pathString)) {\n\t\t\tappendFileSync(path, serializedResult);\n\t\t} else {\n\t\t\toutputFiles.add(pathString);\n\t\t\twriteFileSync(path, serializedResult);\n\t\t}\n\t}\n};\n","import {isUint8Array, concatUint8Arrays} from '../utils/uint-array.js';\nimport {stripNewline} from '../io/strip-newline.js';\n\n// Retrieve `result.all` with synchronous methods\nexport const getAllSync = ([, stdout, stderr], options) => {\n\tif (!options.all) {\n\t\treturn;\n\t}\n\n\tif (stdout === undefined) {\n\t\treturn stderr;\n\t}\n\n\tif (stderr === undefined) {\n\t\treturn stdout;\n\t}\n\n\tif (Array.isArray(stdout)) {\n\t\treturn Array.isArray(stderr)\n\t\t\t? [...stdout, ...stderr]\n\t\t\t: [...stdout, stripNewline(stderr, options, 'all')];\n\t}\n\n\tif (Array.isArray(stderr)) {\n\t\treturn [stripNewline(stdout, options, 'all'), ...stderr];\n\t}\n\n\tif (isUint8Array(stdout) && isUint8Array(stderr)) {\n\t\treturn concatUint8Arrays([stdout, stderr]);\n\t}\n\n\treturn `${stdout}${stderr}`;\n};\n","import {once} from 'node:events';\nimport {DiscardedError} from '../return/final-error.js';\n\n// If `error` is emitted before `spawn`, `exit` will never be emitted.\n// However, `error` might be emitted after `spawn`.\n// In that case, `exit` will still be emitted.\n// Since the `exit` event contains the signal name, we want to make sure we are listening for it.\n// This function also takes into account the following unlikely cases:\n// - `exit` being emitted in the same microtask as `spawn`\n// - `error` being emitted multiple times\nexport const waitForExit = async (subprocess, context) => {\n\tconst [exitCode, signal] = await waitForExitOrError(subprocess);\n\tcontext.isForcefullyTerminated ??= false;\n\treturn [exitCode, signal];\n};\n\nconst waitForExitOrError = async subprocess => {\n\tconst [spawnPayload, exitPayload] = await Promise.allSettled([\n\t\tonce(subprocess, 'spawn'),\n\t\tonce(subprocess, 'exit'),\n\t]);\n\n\tif (spawnPayload.status === 'rejected') {\n\t\treturn [];\n\t}\n\n\treturn exitPayload.status === 'rejected'\n\t\t? waitForSubprocessExit(subprocess)\n\t\t: exitPayload.value;\n};\n\nconst waitForSubprocessExit = async subprocess => {\n\ttry {\n\t\treturn await once(subprocess, 'exit');\n\t} catch {\n\t\treturn waitForSubprocessExit(subprocess);\n\t}\n};\n\n// Retrieve the final exit code and|or signal name\nexport const waitForSuccessfulExit = async exitPromise => {\n\tconst [exitCode, signal] = await exitPromise;\n\n\tif (!isSubprocessErrorExit(exitCode, signal) && isFailedExit(exitCode, signal)) {\n\t\tthrow new DiscardedError();\n\t}\n\n\treturn [exitCode, signal];\n};\n\n// When the subprocess fails due to an `error` event\nconst isSubprocessErrorExit = (exitCode, signal) => exitCode === undefined && signal === undefined;\n// When the subprocess fails due to a non-0 exit code or to a signal termination\nexport const isFailedExit = (exitCode, signal) => exitCode !== 0 || signal !== null;\n","import {DiscardedError} from '../return/final-error.js';\nimport {isMaxBufferSync} from '../io/max-buffer.js';\nimport {isFailedExit} from './exit-async.js';\n\n// Retrieve exit code, signal name and error information, with synchronous methods\nexport const getExitResultSync = ({error, status: exitCode, signal, output}, {maxBuffer}) => {\n\tconst resultError = getResultError(error, exitCode, signal);\n\tconst isTimedOut = resultError?.code === 'ETIMEDOUT';\n\tconst isMaxBuffer = isMaxBufferSync(resultError, output, maxBuffer);\n\treturn {\n\t\tresultError,\n\t\texitCode,\n\t\tsignal,\n\t\ttimedOut: isTimedOut,\n\t\tisMaxBuffer,\n\t};\n};\n\nconst getResultError = (error, exitCode, signal) => {\n\tif (error !== undefined) {\n\t\treturn error;\n\t}\n\n\treturn isFailedExit(exitCode, signal) ? new DiscardedError() : undefined;\n};\n","import {spawnSync} from 'node:child_process';\nimport {handleCommand} from '../arguments/command.js';\nimport {normalizeOptions} from '../arguments/options.js';\nimport {concatenateShell} from '../arguments/shell.js';\nimport {makeError, makeEarlyError, makeSuccessResult} from '../return/result.js';\nimport {handleResult} from '../return/reject.js';\nimport {handleStdioSync} from '../stdio/handle-sync.js';\nimport {stripNewline} from '../io/strip-newline.js';\nimport {addInputOptionsSync} from '../io/input-sync.js';\nimport {transformOutputSync} from '../io/output-sync.js';\nimport {getMaxBufferSync} from '../io/max-buffer.js';\nimport {getAllSync} from '../resolve/all-sync.js';\nimport {getExitResultSync} from '../resolve/exit-sync.js';\n\n// Main shared logic for all sync methods: `execaSync()`, `$.sync()`\nexport const execaCoreSync = (rawFile, rawArguments, rawOptions) => {\n\tconst {file, commandArguments, command, escapedCommand, startTime, verboseInfo, options, fileDescriptors} = handleSyncArguments(rawFile, rawArguments, rawOptions);\n\tconst result = spawnSubprocessSync({\n\t\tfile,\n\t\tcommandArguments,\n\t\toptions,\n\t\tcommand,\n\t\tescapedCommand,\n\t\tverboseInfo,\n\t\tfileDescriptors,\n\t\tstartTime,\n\t});\n\treturn handleResult(result, verboseInfo, options);\n};\n\n// Compute arguments to pass to `child_process.spawnSync()`\nconst handleSyncArguments = (rawFile, rawArguments, rawOptions) => {\n\tconst {command, escapedCommand, startTime, verboseInfo} = handleCommand(rawFile, rawArguments, rawOptions);\n\tconst syncOptions = normalizeSyncOptions(rawOptions);\n\tconst {file, commandArguments, options} = normalizeOptions(rawFile, rawArguments, syncOptions);\n\tvalidateSyncOptions(options);\n\tconst fileDescriptors = handleStdioSync(options, verboseInfo);\n\treturn {\n\t\tfile,\n\t\tcommandArguments,\n\t\tcommand,\n\t\tescapedCommand,\n\t\tstartTime,\n\t\tverboseInfo,\n\t\toptions,\n\t\tfileDescriptors,\n\t};\n};\n\n// Options normalization logic specific to sync methods\nconst normalizeSyncOptions = options => options.node && !options.ipc ? {...options, ipc: false} : options;\n\n// Options validation logic specific to sync methods\nconst validateSyncOptions = ({ipc, ipcInput, detached, cancelSignal, killDescendants}) => {\n\tif (ipcInput) {\n\t\tthrowInvalidSyncOption('ipcInput');\n\t}\n\n\tif (ipc) {\n\t\tthrowInvalidSyncOption('ipc: true');\n\t}\n\n\tif (detached) {\n\t\tthrowInvalidSyncOption('detached: true');\n\t}\n\n\tif (killDescendants) {\n\t\tthrowInvalidSyncOption('killDescendants: true');\n\t}\n\n\tif (cancelSignal) {\n\t\tthrowInvalidSyncOption('cancelSignal');\n\t}\n};\n\nconst throwInvalidSyncOption = value => {\n\tthrow new TypeError(`The \"${value}\" option cannot be used with synchronous methods.`);\n};\n\nconst spawnSubprocessSync = ({file, commandArguments, options, command, escapedCommand, verboseInfo, fileDescriptors, startTime}) => {\n\tconst syncResult = runSubprocessSync({\n\t\tfile,\n\t\tcommandArguments,\n\t\toptions,\n\t\tcommand,\n\t\tescapedCommand,\n\t\tfileDescriptors,\n\t\tstartTime,\n\t});\n\tif (syncResult.failed) {\n\t\treturn syncResult;\n\t}\n\n\tconst {resultError, exitCode, signal, timedOut, isMaxBuffer} = getExitResultSync(syncResult, options);\n\tconst {output, error = resultError} = transformOutputSync({\n\t\tfileDescriptors,\n\t\tsyncResult,\n\t\toptions,\n\t\tisMaxBuffer,\n\t\tverboseInfo,\n\t});\n\tconst stdio = output.map((stdioOutput, fdNumber) => stripNewline(stdioOutput, options, fdNumber));\n\tconst all = stripNewline(getAllSync(output, options), options, 'all');\n\treturn getSyncResult({\n\t\terror,\n\t\texitCode,\n\t\tsignal,\n\t\ttimedOut,\n\t\tisMaxBuffer,\n\t\tstdio,\n\t\tall,\n\t\toptions,\n\t\tcommand,\n\t\tescapedCommand,\n\t\tstartTime,\n\t});\n};\n\nconst runSubprocessSync = ({file, commandArguments, options, command, escapedCommand, fileDescriptors, startTime}) => {\n\ttry {\n\t\taddInputOptionsSync(fileDescriptors, options);\n\t\tconst normalizedOptions = normalizeSpawnSyncOptions(options);\n\t\treturn spawnSync(...concatenateShell(file, commandArguments, normalizedOptions));\n\t} catch (error) {\n\t\treturn makeEarlyError({\n\t\t\terror,\n\t\t\tcommand,\n\t\t\tescapedCommand,\n\t\t\tfileDescriptors,\n\t\t\toptions,\n\t\t\tstartTime,\n\t\t\tisSync: true,\n\t\t});\n\t}\n};\n\n// The `encoding` option is handled by Execa, not by `child_process.spawnSync()`\nconst normalizeSpawnSyncOptions = ({encoding, maxBuffer, ...options}) => ({...options, encoding: 'buffer', maxBuffer: getMaxBufferSync(maxBuffer)});\n\nconst getSyncResult = ({error, exitCode, signal, timedOut, isMaxBuffer, stdio, all, options, command, escapedCommand, startTime}) => error === undefined\n\t? makeSuccessResult({\n\t\tcommand,\n\t\tescapedCommand,\n\t\tstdio,\n\t\tall,\n\t\tipcOutput: [],\n\t\toptions,\n\t\tstartTime,\n\t})\n\t: makeError({\n\t\terror,\n\t\tcommand,\n\t\tescapedCommand,\n\t\ttimedOut,\n\t\tisCanceled: false,\n\t\tisGracefullyCanceled: false,\n\t\tisMaxBuffer,\n\t\tisForcefullyTerminated: false,\n\t\texitCode,\n\t\tsignal,\n\t\tstdio,\n\t\tall,\n\t\tipcOutput: [],\n\t\toptions,\n\t\tstartTime,\n\t\tisSync: true,\n\t});\n","import {once, on} from 'node:events';\nimport {\n\tvalidateIpcMethod,\n\tthrowOnEarlyDisconnect,\n\tdisconnect,\n\tgetStrictResponseError,\n} from './validation.js';\nimport {getIpcEmitter, isConnected} from './forward.js';\nimport {addReference, removeReference} from './reference.js';\n\nexport const internalGetOneMessageOptions = Symbol('internalGetOneMessageOptions');\n\n// Like `[sub]process.once('message')` but promise-based\nexport const getOneMessage = ({anyProcess, channel, isSubprocess, ipc}, options = {}) => {\n\tconst {reference = true, filter} = options;\n\tconst {signal} = options[internalGetOneMessageOptions] ?? {};\n\n\tvalidateIpcMethod({\n\t\tmethodName: 'getOneMessage',\n\t\tisSubprocess,\n\t\tipc,\n\t\tisConnected: isConnected(anyProcess),\n\t});\n\n\treturn getOneMessageAsync({\n\t\tanyProcess,\n\t\tchannel,\n\t\tisSubprocess,\n\t\tfilter,\n\t\treference,\n\t\tsignal,\n\t});\n};\n\nconst getOneMessageAsync = async ({anyProcess, channel, isSubprocess, filter, reference, signal}) => {\n\taddReference(channel, reference);\n\tconst ipcEmitter = getIpcEmitter(anyProcess, channel, isSubprocess);\n\tconst controller = new AbortController();\n\tstopOnAbort(signal, controller);\n\n\ttry {\n\t\treturn await Promise.race([\n\t\t\tgetMessage(ipcEmitter, filter, controller),\n\t\t\tthrowOnDisconnect(ipcEmitter, isSubprocess, controller),\n\t\t\tthrowOnStrictError(ipcEmitter, isSubprocess, controller),\n\t\t]);\n\t} catch (error) {\n\t\tdisconnect(anyProcess);\n\t\tthrow error;\n\t} finally {\n\t\tcontroller.abort();\n\t\tremoveReference(channel, reference);\n\t}\n};\n\nconst stopOnAbort = (signal, controller) => {\n\tif (signal === undefined) {\n\t\treturn;\n\t}\n\n\tif (signal.aborted) {\n\t\tcontroller.abort();\n\t\treturn;\n\t}\n\n\tsignal.addEventListener('abort', () => {\n\t\tcontroller.abort();\n\t}, {once: true, signal: controller.signal});\n};\n\nconst getMessage = async (ipcEmitter, filter, {signal}) => {\n\tif (filter === undefined) {\n\t\tconst [message] = await once(ipcEmitter, 'message', {signal});\n\t\treturn message;\n\t}\n\n\tfor await (const [message] of on(ipcEmitter, 'message', {signal})) {\n\t\tif (filter(message)) {\n\t\t\treturn message;\n\t\t}\n\t}\n};\n\nconst throwOnDisconnect = async (ipcEmitter, isSubprocess, {signal}) => {\n\tawait once(ipcEmitter, 'disconnect', {signal});\n\tthrowOnEarlyDisconnect(isSubprocess);\n};\n\nconst throwOnStrictError = async (ipcEmitter, isSubprocess, {signal}) => {\n\tconst [error] = await once(ipcEmitter, 'strict:error', {signal});\n\tthrow getStrictResponseError(error, isSubprocess);\n};\n","import {once, on} from 'node:events';\nimport {validateIpcMethod, disconnect, getStrictResponseError} from './validation.js';\nimport {getIpcEmitter, isConnected} from './forward.js';\nimport {addReference, removeReference} from './reference.js';\n\nexport const internalGetEachMessageOptions = Symbol('internalGetEachMessageOptions');\n\n// Like `[sub]process.on('message')` but promise-based\nexport const getEachMessage = (subprocessInfo, options = {}) => {\n\tconst {reference = true} = options;\n\t// Internal callers can stop the IPC listener without exposing cancellation or pipe-awaiting options as public API.\n\tconst {signal, shouldAwait = !subprocessInfo.isSubprocess} = options[internalGetEachMessageOptions] ?? {};\n\n\treturn loopOnMessages({\n\t\t...subprocessInfo,\n\t\tshouldAwait,\n\t\treference,\n\t\tsignal,\n\t});\n};\n\n// Same but used internally\nexport const loopOnMessages = ({anyProcess, waitProcess = anyProcess, channel, isSubprocess, ipc, shouldAwait, reference, signal}) => {\n\tvalidateIpcMethod({\n\t\tmethodName: 'getEachMessage',\n\t\tisSubprocess,\n\t\tipc,\n\t\tisConnected: isConnected(anyProcess),\n\t});\n\n\taddReference(channel, reference);\n\tconst ipcEmitter = getIpcEmitter(anyProcess, channel, isSubprocess);\n\tconst controller = new AbortController();\n\tconst state = {};\n\tstopOnAbort(signal, controller);\n\tstopOnDisconnect(anyProcess, ipcEmitter, controller);\n\tabortOnStrictError({\n\t\tipcEmitter,\n\t\tisSubprocess,\n\t\tcontroller,\n\t\tstate,\n\t});\n\treturn iterateOnMessages({\n\t\tanyProcess,\n\t\twaitProcess,\n\t\tchannel,\n\t\tipcEmitter,\n\t\tisSubprocess,\n\t\tshouldAwait,\n\t\tcontroller,\n\t\tstate,\n\t\treference,\n\t});\n};\n\nconst stopOnAbort = (signal, controller) => {\n\tif (signal === undefined) {\n\t\treturn;\n\t}\n\n\tif (signal.aborted) {\n\t\tcontroller.abort();\n\t\treturn;\n\t}\n\n\t// Reuse the iterator controller for listener cleanup when iteration ends before the internal signal aborts.\n\tsignal.addEventListener('abort', () => {\n\t\tcontroller.abort();\n\t}, {once: true, signal: controller.signal});\n};\n\nconst stopOnDisconnect = async (anyProcess, ipcEmitter, controller) => {\n\ttry {\n\t\tawait once(ipcEmitter, 'disconnect', {signal: controller.signal});\n\t\tcontroller.abort();\n\t} catch {}\n};\n\nconst abortOnStrictError = async ({ipcEmitter, isSubprocess, controller, state}) => {\n\ttry {\n\t\tconst [error] = await once(ipcEmitter, 'strict:error', {signal: controller.signal});\n\t\tstate.error = getStrictResponseError(error, isSubprocess);\n\t\tcontroller.abort();\n\t} catch {}\n};\n\nconst iterateOnMessages = async function * ({anyProcess, waitProcess, channel, ipcEmitter, isSubprocess, shouldAwait, controller, state, reference}) {\n\ttry {\n\t\tfor await (const [message] of on(ipcEmitter, 'message', {signal: controller.signal})) {\n\t\t\tthrowIfStrictError(state);\n\t\t\tyield message;\n\t\t}\n\t} catch {\n\t\tthrowIfStrictError(state);\n\t} finally {\n\t\tcontroller.abort();\n\t\tremoveReference(channel, reference);\n\n\t\tif (!isSubprocess) {\n\t\t\tdisconnect(anyProcess);\n\t\t}\n\n\t\tif (shouldAwait) {\n\t\t\tawait waitProcess;\n\t\t}\n\t}\n};\n\nconst throwIfStrictError = ({error}) => {\n\tif (error) {\n\t\tthrow error;\n\t}\n};\n","import process from 'node:process';\nimport {sendMessage} from './send.js';\nimport {getOneMessage} from './get-one.js';\nimport {getEachMessage} from './get-each.js';\nimport {getCancelSignal} from './graceful.js';\n\n// Add promise-based IPC methods in current process\nexport const addIpcMethods = (target, subprocess, {ipc}) => {\n\tObject.assign(target, getIpcMethods(subprocess, false, ipc, target));\n};\n\n// Get promise-based IPC in the subprocess\nexport const getIpcExport = () => {\n\tconst anyProcess = process;\n\tconst isSubprocess = true;\n\tconst isIpc = process.channel !== undefined;\n\n\treturn {\n\t\t...getIpcMethods(anyProcess, isSubprocess, isIpc),\n\t\tgetCancelSignal: getCancelSignal.bind(undefined, {\n\t\t\tanyProcess,\n\t\t\tchannel: anyProcess.channel,\n\t\t\tisSubprocess,\n\t\t\tipc: isIpc,\n\t\t}),\n\t};\n};\n\n// Retrieve the `ipc` shared by both the current process and the subprocess\nconst getIpcMethods = (anyProcess, isSubprocess, ipc, waitProcess = anyProcess) => ({\n\tsendMessage: sendMessage.bind(undefined, {\n\t\tanyProcess,\n\t\tchannel: anyProcess.channel,\n\t\tisSubprocess,\n\t\tipc,\n\t}),\n\tgetOneMessage: getOneMessage.bind(undefined, {\n\t\tanyProcess,\n\t\tchannel: anyProcess.channel,\n\t\tisSubprocess,\n\t\tipc,\n\t}),\n\tgetEachMessage: getEachMessage.bind(undefined, {\n\t\tanyProcess,\n\t\tchannel: anyProcess.channel,\n\t\tisSubprocess,\n\t\tipc,\n\t\twaitProcess,\n\t}),\n});\n","import {ChildProcess} from 'node:child_process';\nimport {\n\tPassThrough,\n\tReadable,\n\tWritable,\n\tDuplex,\n} from 'node:stream';\nimport {cleanupCustomStreams} from '../stdio/handle.js';\nimport {makeEarlyError} from './result.js';\nimport {handleResult} from './reject.js';\n\n// When the subprocess fails to spawn.\n// We ensure the returned error is always both a promise and a subprocess.\nexport const handleEarlyError = ({error, command, escapedCommand, fileDescriptors, options, startTime, verboseInfo}) => {\n\tcleanupCustomStreams(fileDescriptors);\n\n\tconst subprocess = new ChildProcess();\n\tconst all = createDummyStreams(subprocess, fileDescriptors);\n\n\tconst earlyError = makeEarlyError({\n\t\terror,\n\t\tcommand,\n\t\tescapedCommand,\n\t\tfileDescriptors,\n\t\toptions,\n\t\tstartTime,\n\t\tisSync: false,\n\t});\n\tconst promise = handleDummyPromise(earlyError, verboseInfo, options);\n\treturn {\n\t\tsubprocess,\n\t\tpromise,\n\t\tall: options.all ? all : undefined,\n\t\tconvertedStreams: {\n\t\t\treadable,\n\t\t\twritable,\n\t\t\tduplex,\n\t\t\treadableStream,\n\t\t\twritableStream,\n\t\t\ttransformStream,\n\t\t\titerable,\n\t\t\t[Symbol.asyncIterator]: iterable,\n\t\t},\n\t};\n};\n\nconst createDummyStreams = (subprocess, fileDescriptors) => {\n\tconst stdin = createDummyStream();\n\tconst stdout = createDummyStream();\n\tconst stderr = createDummyStream();\n\tconst extraStdio = Array.from({length: fileDescriptors.length - 3}, createDummyStream);\n\tconst all = createDummyStream();\n\tconst stdio = [stdin, stdout, stderr, ...extraStdio];\n\tObject.assign(subprocess, {\n\t\tstdin,\n\t\tstdout,\n\t\tstderr,\n\t\tstdio,\n\t});\n\treturn all;\n};\n\nconst createDummyStream = () => {\n\tconst stream = new PassThrough();\n\tstream.end();\n\treturn stream;\n};\n\nconst readable = () => new Readable({read() {}});\nconst writable = () => new Writable({write() {}});\nconst duplex = () => new Duplex({read() {}, write() {}});\nconst readableStream = () => Readable.toWeb(readable());\nconst writableStream = () => Writable.toWeb(writable());\nconst transformStream = () => Duplex.toWeb(duplex());\nconst iterable = async function * () {};\n\nconst handleDummyPromise = async (error, verboseInfo, options) => handleResult(error, verboseInfo, options);\n","import {createReadStream, createWriteStream} from 'node:fs';\nimport {Buffer} from 'node:buffer';\nimport {Readable, Writable, Duplex} from 'node:stream';\nimport {generatorToStream} from '../transform/generator.js';\nimport {handleStdio} from './handle.js';\nimport {TYPE_TO_MESSAGE} from './type.js';\n\n// Handle `input`, `inputFile`, `stdin`, `stdout` and `stderr` options, before spawning, in async mode\nexport const handleStdioAsync = (options, verboseInfo) => handleStdio(addPropertiesAsync, options, verboseInfo, false);\n\nconst forbiddenIfAsync = ({type, optionName}) => {\n\tthrow new TypeError(`The \\`${optionName}\\` option cannot be ${TYPE_TO_MESSAGE[type]}.`);\n};\n\n// Create streams used internally for piping when using specific values for the `std*` options, in async mode.\n// For example, `stdout: {file}` creates a file stream, which is piped from/to.\nconst addProperties = {\n\tfileNumber: forbiddenIfAsync,\n\tgenerator: generatorToStream,\n\tasyncGenerator: generatorToStream,\n\tnodeStream: ({value}) => ({stream: value}),\n\twebTransform({value: {transform, writableObjectMode, readableObjectMode}}) {\n\t\tconst objectMode = writableObjectMode || readableObjectMode;\n\t\tconst stream = Duplex.fromWeb(transform, {objectMode});\n\t\treturn {stream};\n\t},\n\tduplex: ({value: {transform}}) => ({stream: transform}),\n\tnative() {},\n};\n\nconst addPropertiesAsync = {\n\tinput: {\n\t\t...addProperties,\n\t\tfileUrl: ({value}) => ({stream: createReadStream(value)}),\n\t\tfilePath: ({value: {file}}) => ({stream: createReadStream(file)}),\n\t\twebStream: ({value}) => ({stream: Readable.fromWeb(value)}),\n\t\titerable: ({value}) => ({stream: Readable.from(value)}),\n\t\tasyncIterable: ({value}) => ({stream: Readable.from(value)}),\n\t\tstring: ({value}) => ({stream: Readable.from(value)}),\n\t\tuint8Array: ({value}) => ({stream: Readable.from(Buffer.from(value))}),\n\t},\n\toutput: {\n\t\t...addProperties,\n\t\tfileUrl: ({value}) => ({stream: createWriteStream(value)}),\n\t\tfilePath: ({value: {file, append}}) => ({stream: createWriteStream(file, append ? {flags: 'a'} : {})}),\n\t\twebStream: ({value}) => ({stream: Writable.fromWeb(value)}),\n\t\titerable: forbiddenIfAsync,\n\t\tasyncIterable: forbiddenIfAsync,\n\t\tstring: forbiddenIfAsync,\n\t\tuint8Array: forbiddenIfAsync,\n\t},\n};\n","import {on, once} from 'node:events';\nimport {PassThrough as PassThroughStream, getDefaultHighWaterMark} from 'node:stream';\nimport {finished} from 'node:stream/promises';\n\nexport default function mergeStreams(streams) {\n\tif (!Array.isArray(streams)) {\n\t\tthrow new TypeError(`Expected an array, got \\`${typeof streams}\\`.`);\n\t}\n\n\tfor (const stream of streams) {\n\t\tvalidateStream(stream);\n\t}\n\n\tconst objectMode = streams.some(({readableObjectMode}) => readableObjectMode);\n\tconst highWaterMark = getHighWaterMark(streams, objectMode);\n\tconst passThroughStream = new MergedStream({\n\t\tobjectMode,\n\t\twritableHighWaterMark: highWaterMark,\n\t\treadableHighWaterMark: highWaterMark,\n\t});\n\n\tfor (const stream of streams) {\n\t\tpassThroughStream.add(stream);\n\t}\n\n\treturn passThroughStream;\n}\n\nconst getHighWaterMark = (streams, objectMode) => {\n\tif (streams.length === 0) {\n\t\treturn getDefaultHighWaterMark(objectMode);\n\t}\n\n\tconst highWaterMarks = streams\n\t\t.filter(({readableObjectMode}) => readableObjectMode === objectMode)\n\t\t.map(({readableHighWaterMark}) => readableHighWaterMark);\n\treturn Math.max(...highWaterMarks);\n};\n\nclass MergedStream extends PassThroughStream {\n\t#streams = new Set([]);\n\t#ended = new Set([]);\n\t#aborted = new Set([]);\n\t#onFinished;\n\t#unpipeEvent = Symbol('unpipe');\n\t#streamPromises = new WeakMap();\n\n\tadd(stream) {\n\t\tvalidateStream(stream);\n\n\t\tif (this.#streams.has(stream)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#streams.add(stream);\n\n\t\tthis.#onFinished ??= onMergedStreamFinished(this, this.#streams, this.#unpipeEvent);\n\t\tconst streamPromise = endWhenStreamsDone({\n\t\t\tpassThroughStream: this,\n\t\t\tstream,\n\t\t\tstreams: this.#streams,\n\t\t\tended: this.#ended,\n\t\t\taborted: this.#aborted,\n\t\t\tonFinished: this.#onFinished,\n\t\t\tunpipeEvent: this.#unpipeEvent,\n\t\t});\n\t\tthis.#streamPromises.set(stream, streamPromise);\n\n\t\tstream.pipe(this, {end: false});\n\t}\n\n\tasync remove(stream) {\n\t\tvalidateStream(stream);\n\n\t\tif (!this.#streams.has(stream)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst streamPromise = this.#streamPromises.get(stream);\n\t\tif (streamPromise === undefined) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.#streamPromises.delete(stream);\n\n\t\tstream.unpipe(this);\n\t\tawait streamPromise;\n\t\treturn true;\n\t}\n}\n\nconst onMergedStreamFinished = async (passThroughStream, streams, unpipeEvent) => {\n\tupdateMaxListeners(passThroughStream, PASSTHROUGH_LISTENERS_COUNT);\n\tconst controller = new AbortController();\n\n\ttry {\n\t\tawait Promise.race([\n\t\t\tonMergedStreamEnd(passThroughStream, controller),\n\t\t\tonInputStreamsUnpipe(passThroughStream, streams, unpipeEvent, controller),\n\t\t]);\n\t} finally {\n\t\tcontroller.abort();\n\t\tupdateMaxListeners(passThroughStream, -PASSTHROUGH_LISTENERS_COUNT);\n\t}\n};\n\nconst onMergedStreamEnd = async (passThroughStream, {signal}) => {\n\ttry {\n\t\tawait finished(passThroughStream, {signal, cleanup: true});\n\t} catch (error) {\n\t\terrorOrAbortStream(passThroughStream, error);\n\t\tthrow error;\n\t}\n};\n\nconst onInputStreamsUnpipe = async (passThroughStream, streams, unpipeEvent, {signal}) => {\n\tfor await (const [unpipedStream] of on(passThroughStream, 'unpipe', {signal})) {\n\t\tif (streams.has(unpipedStream)) {\n\t\t\tunpipedStream.emit(unpipeEvent);\n\t\t}\n\t}\n};\n\nconst validateStream = stream => {\n\tif (typeof stream?.pipe !== 'function') {\n\t\tthrow new TypeError(`Expected a readable stream, got: \\`${typeof stream}\\`.`);\n\t}\n};\n\nconst endWhenStreamsDone = async ({passThroughStream, stream, streams, ended, aborted, onFinished, unpipeEvent}) => {\n\tupdateMaxListeners(passThroughStream, PASSTHROUGH_LISTENERS_PER_STREAM);\n\tconst controller = new AbortController();\n\n\ttry {\n\t\tawait Promise.race([\n\t\t\tafterMergedStreamFinished(onFinished, stream, controller),\n\t\t\tonInputStreamEnd({\n\t\t\t\tpassThroughStream,\n\t\t\t\tstream,\n\t\t\t\tstreams,\n\t\t\t\tended,\n\t\t\t\taborted,\n\t\t\t\tcontroller,\n\t\t\t}),\n\t\t\tonInputStreamUnpipe({\n\t\t\t\tstream,\n\t\t\t\tstreams,\n\t\t\t\tended,\n\t\t\t\taborted,\n\t\t\t\tunpipeEvent,\n\t\t\t\tcontroller,\n\t\t\t}),\n\t\t]);\n\t} finally {\n\t\tcontroller.abort();\n\t\tupdateMaxListeners(passThroughStream, -PASSTHROUGH_LISTENERS_PER_STREAM);\n\t}\n\n\tif (streams.size > 0 && streams.size === ended.size + aborted.size) {\n\t\tif (ended.size === 0 && aborted.size > 0) {\n\t\t\tabortStream(passThroughStream);\n\t\t} else {\n\t\t\tendStream(passThroughStream);\n\t\t}\n\t}\n};\n\nconst afterMergedStreamFinished = async (onFinished, stream, {signal}) => {\n\ttry {\n\t\tawait onFinished;\n\t\tif (!signal.aborted) {\n\t\t\tabortStream(stream);\n\t\t}\n\t} catch (error) {\n\t\tif (!signal.aborted) {\n\t\t\terrorOrAbortStream(stream, error);\n\t\t}\n\t}\n};\n\nconst onInputStreamEnd = async ({passThroughStream, stream, streams, ended, aborted, controller: {signal}}) => {\n\ttry {\n\t\tawait finished(stream, {\n\t\t\tsignal,\n\t\t\tcleanup: true,\n\t\t\treadable: true,\n\t\t\twritable: false,\n\t\t});\n\t\tif (streams.has(stream)) {\n\t\t\tended.add(stream);\n\t\t}\n\t} catch (error) {\n\t\tif (signal.aborted || !streams.has(stream)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (isAbortError(error)) {\n\t\t\taborted.add(stream);\n\t\t} else {\n\t\t\terrorStream(passThroughStream, error);\n\t\t}\n\t}\n};\n\nconst onInputStreamUnpipe = async ({stream, streams, ended, aborted, unpipeEvent, controller: {signal}}) => {\n\tawait once(stream, unpipeEvent, {signal});\n\n\tif (!stream.readable) {\n\t\treturn once(signal, 'abort', {signal});\n\t}\n\n\tstreams.delete(stream);\n\tended.delete(stream);\n\taborted.delete(stream);\n};\n\nconst endStream = stream => {\n\tif (stream.writable) {\n\t\tstream.end();\n\t}\n};\n\nconst errorOrAbortStream = (stream, error) => {\n\tif (isAbortError(error)) {\n\t\tabortStream(stream);\n\t} else {\n\t\terrorStream(stream, error);\n\t}\n};\n\n// This is the error thrown by `finished()` on `stream.destroy()`\nconst isAbortError = error => error?.code === 'ERR_STREAM_PREMATURE_CLOSE';\n\nconst abortStream = stream => {\n\tif (stream.readable || stream.writable) {\n\t\tstream.destroy();\n\t}\n};\n\n// `stream.destroy(error)` crashes the process with `uncaughtException` if no `error` event listener exists on `stream`.\n// We take care of error handling on user behalf, so we do not want this to happen.\nconst errorStream = (stream, error) => {\n\tif (!stream.destroyed) {\n\t\tstream.once('error', noop);\n\t\tstream.destroy(error);\n\t}\n};\n\nconst noop = () => {};\n\nconst updateMaxListeners = (passThroughStream, increment) => {\n\tconst maxListeners = passThroughStream.getMaxListeners();\n\tif (maxListeners !== 0 && maxListeners !== Number.POSITIVE_INFINITY) {\n\t\tpassThroughStream.setMaxListeners(maxListeners + increment);\n\t}\n};\n\n// Number of times `passThroughStream.on()` is called regardless of streams:\n// - once due to `finished(passThroughStream)`\n// - once due to `on(passThroughStream)`\nconst PASSTHROUGH_LISTENERS_COUNT = 2;\n\n// Number of times `passThroughStream.on()` is called per stream:\n// - once due to `stream.pipe(passThroughStream)`\nconst PASSTHROUGH_LISTENERS_PER_STREAM = 1;\n","import {finished} from 'node:stream/promises';\nimport {isStandardStream} from '../utils/standard-stream.js';\n\n// Similar to `Stream.pipeline(source, destination)`, but does not destroy standard streams\nexport const pipeStreams = (source, destination) => {\n\tsource.pipe(destination);\n\tonSourceFinish(source, destination);\n\tonDestinationFinish(source, destination);\n};\n\n// `source.pipe(destination)` makes `destination` end when `source` ends.\n// But it does not propagate aborts or errors. This function does it.\nconst onSourceFinish = async (source, destination) => {\n\tif (isStandardStream(source) || isStandardStream(destination)) {\n\t\treturn;\n\t}\n\n\ttry {\n\t\tawait finished(source, {cleanup: true, readable: true, writable: false});\n\t} catch {}\n\n\tendDestinationStream(destination);\n};\n\nexport const endDestinationStream = destination => {\n\tif (destination.writable) {\n\t\tdestination.end();\n\t}\n};\n\n// We do the same thing in the other direction as well.\nconst onDestinationFinish = async (source, destination) => {\n\tif (isStandardStream(source) || isStandardStream(destination)) {\n\t\treturn;\n\t}\n\n\ttry {\n\t\tawait finished(destination, {cleanup: true, readable: false, writable: true});\n\t} catch {}\n\n\tabortSourceStream(source);\n};\n\nexport const abortSourceStream = source => {\n\tif (source.readable) {\n\t\tsource.destroy();\n\t}\n};\n","import mergeStreams from '@sindresorhus/merge-streams';\nimport {isStandardStream} from '../utils/standard-stream.js';\nimport {incrementMaxListeners} from '../utils/max-listeners.js';\nimport {TRANSFORM_TYPES} from '../stdio/type.js';\nimport {pipeStreams} from './pipeline.js';\n\n// Handle `input`, `inputFile`, `stdin`, `stdout` and `stderr` options, after spawning, in async mode\n// When multiple input streams are used, we merge them to ensure the output stream ends only once each input stream has ended\nexport const pipeOutputAsync = (subprocess, fileDescriptors, controller) => {\n\tconst pipeGroups = new Map();\n\n\tfor (const [fdNumber, {stdioItems, direction}] of Object.entries(fileDescriptors)) {\n\t\tconst transformItems = stdioItems.filter(({type}) => TRANSFORM_TYPES.has(type));\n\t\tfor (const {stream} of transformItems) {\n\t\t\tpipeTransform(subprocess, stream, direction, fdNumber);\n\t\t}\n\n\t\tconst nonTransformItems = stdioItems.filter(({type}) => !TRANSFORM_TYPES.has(type));\n\t\tfor (const {stream} of nonTransformItems) {\n\t\t\tpipeStdioItem({\n\t\t\t\tsubprocess,\n\t\t\t\tstream,\n\t\t\t\tdirection,\n\t\t\t\tfdNumber,\n\t\t\t\tpipeGroups,\n\t\t\t\tcontroller,\n\t\t\t});\n\t\t}\n\t}\n\n\tfor (const [outputStream, inputStreams] of pipeGroups) {\n\t\tconst inputStream = inputStreams.length === 1 ? inputStreams[0] : mergeStreams(inputStreams);\n\t\tpipeStreams(inputStream, outputStream);\n\t}\n};\n\n// When using transforms, `subprocess.stdin|stdout|stderr|stdio` is directly mutated\nconst pipeTransform = (subprocess, stream, direction, fdNumber) => {\n\tif (direction === 'output') {\n\t\tpipeStreams(subprocess.stdio[fdNumber], stream);\n\t} else {\n\t\tpipeStreams(stream, subprocess.stdio[fdNumber]);\n\t}\n\n\tconst streamProperty = SUBPROCESS_STREAM_PROPERTIES[fdNumber];\n\tif (streamProperty !== undefined) {\n\t\tsubprocess[streamProperty] = stream;\n\t}\n\n\tsubprocess.stdio[fdNumber] = stream;\n};\n\nconst SUBPROCESS_STREAM_PROPERTIES = ['stdin', 'stdout', 'stderr'];\n\n// Most `std*` option values involve piping `subprocess.std*` to a stream.\n// The stream is either passed by the user or created internally.\nconst pipeStdioItem = ({subprocess, stream, direction, fdNumber, pipeGroups, controller}) => {\n\tif (stream === undefined) {\n\t\treturn;\n\t}\n\n\tsetStandardStreamMaxListeners(stream, controller);\n\n\tconst [inputStream, outputStream] = direction === 'output'\n\t\t? [stream, subprocess.stdio[fdNumber]]\n\t\t: [subprocess.stdio[fdNumber], stream];\n\tconst outputStreams = pipeGroups.get(inputStream) ?? [];\n\tpipeGroups.set(inputStream, [...outputStreams, outputStream]);\n};\n\n// Multiple subprocesses might be piping from/to `process.std*` at the same time.\n// This is not necessarily an error and should not print a `maxListeners` warning.\nconst setStandardStreamMaxListeners = (stream, {signal}) => {\n\tif (isStandardStream(stream)) {\n\t\tincrementMaxListeners(stream, MAX_LISTENERS_INCREMENT, signal);\n\t}\n};\n\n// `source.pipe(destination)` adds at most 1 listener for each event.\n// If `stdin` option is an array, the values might be combined with `merge-streams`.\n// That library also listens for `source` end, which adds 1 more listener.\nconst MAX_LISTENERS_INCREMENT = 2;\n","import process from 'node:process';\nimport {execFile} from 'node:child_process';\nimport path from 'node:path/win32';\n\nconst isWindows = process.platform === 'win32';\n\n// The `killDescendants` option terminates the whole process tree, not just the direct child.\n// On Unix, this requires spawning the subprocess in its own process group, so we override the\n// `detached` argument passed to `child_process.spawn()`.\n// This is kept separate from the user-facing `detached` option, which must keep its own value,\n// so the `cleanup` behavior is not affected.\nexport const getSpawnOptions = options => options.killDescendants && !isWindows\n\t? {...options, detached: true}\n\t: options;\n\n// Returns the low-level function used to send a signal to the subprocess.\n// With the `killDescendants` option, the signal is sent to the whole process tree.\nexport const getKillFunction = (subprocess, {killDescendants}) => {\n\tif (!killDescendants) {\n\t\treturn subprocess.kill.bind(subprocess);\n\t}\n\n\tconst killDescendantsFunction = isWindows ? killDescendantsWindows : killDescendantsUnix;\n\treturn killDescendantsFunction.bind(undefined, subprocess);\n};\n\n// On Unix, the subprocess is its own process group leader (its PGID equals its PID), since it\n// was spawned with `detached: true`. Sending the signal to `-pid` targets the whole group.\nconst killDescendantsUnix = (subprocess, signal) => {\n\tif (subprocess.pid === undefined) {\n\t\treturn false;\n\t}\n\n\ttry {\n\t\treturn process.kill(-subprocess.pid, signal);\n\t} catch {\n\t\t// The process group might already be gone, or signaling it might not be permitted, so we\n\t\t// fall back to the direct child. Like `ChildProcess.kill()`, this returns `false` instead of throwing.\n\t\treturn subprocess.kill(signal);\n\t}\n};\n\n// Windows has no process groups. Instead, `taskkill /T` recursively terminates the process tree.\n// It must run while the tree is still intact, so direct subprocess termination is only used as a\n// fallback: killing the direct subprocess first would orphan its descendants before `taskkill` could enumerate them.\n// If `taskkill` is unavailable or fails, the fallback only terminates the direct subprocess.\n// `taskkill` ignores the signal (`/F` terminates the tree).\nconst killDescendantsWindows = (subprocess, signal) => {\n\tif (subprocess.pid === undefined) {\n\t\treturn false;\n\t}\n\n\tconst taskkillFile = getTaskkillFile();\n\tif (taskkillFile === undefined) {\n\t\treturn subprocess.kill(signal);\n\t}\n\n\t// This is best-effort: if `taskkill` fails, still try the direct subprocess.\n\texecFile(taskkillFile, ['/pid', `${subprocess.pid}`, '/T', '/F'], error => {\n\t\tif (error) {\n\t\t\tsubprocess.kill(signal);\n\t\t}\n\t});\n\treturn true;\n};\n\nexport const getTaskkillFile = () => {\n\tconst windowsDirectory = [process.env.SystemRoot, process.env.windir]\n\t\t.find(directory => directory && isWindowsDriveAbsolutePath(directory));\n\n\treturn windowsDirectory === undefined\n\t\t? undefined\n\t\t: path.join(windowsDirectory, 'System32', 'taskkill.exe');\n};\n\nconst isWindowsDriveAbsolutePath = directory => {\n\tconst {root} = path.parse(directory);\n\treturn /^[a-z]:[/\\\\]/i.test(root);\n};\n","/**\n * This is not the set of all possible signals.\n *\n * It IS, however, the set of all signals that trigger\n * an exit on either Linux or BSD systems. Linux is a\n * superset of the signal names supported on BSD, and\n * the unknown signals just fail to register, so we can\n * catch that easily enough.\n *\n * Windows signals are a different set, since there are\n * signals that terminate Windows processes, but don't\n * terminate (or don't even exist) on Posix systems.\n *\n * Don't bother with SIGKILL. It's uncatchable, which\n * means that we can't fire any callbacks anyway.\n *\n * If a user does happen to register a handler on a non-\n * fatal signal like SIGWINCH or something, and then\n * exit, it'll end up firing `process.emit('exit')`, so\n * the handler will be fired anyway.\n *\n * SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised\n * artificially, inherently leave the process in a\n * state from which it is not safe to try and enter JS\n * listeners.\n */\nexport const signals = [];\nsignals.push('SIGHUP', 'SIGINT', 'SIGTERM');\nif (process.platform !== 'win32') {\n signals.push('SIGALRM', 'SIGABRT', 'SIGVTALRM', 'SIGXCPU', 'SIGXFSZ', 'SIGUSR2', 'SIGTRAP', 'SIGSYS', 'SIGQUIT', 'SIGIOT'\n // should detect profiler and enable/disable accordingly.\n // see #21\n // 'SIGPROF'\n );\n}\nif (process.platform === 'linux') {\n signals.push('SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT');\n}\n//# sourceMappingURL=signals.js.map","// Note: since nyc uses this module to output coverage, any lines\n// that are in the direct sync flow of nyc's outputCoverage are\n// ignored, since we can never get coverage for them.\n// grab a reference to node's real process object right away\nimport { signals } from './signals.js';\nexport { signals };\nconst processOk = (process) => !!process &&\n typeof process === 'object' &&\n typeof process.removeListener === 'function' &&\n typeof process.emit === 'function' &&\n typeof process.reallyExit === 'function' &&\n typeof process.listeners === 'function' &&\n typeof process.kill === 'function' &&\n typeof process.pid === 'number' &&\n typeof process.on === 'function';\nconst kExitEmitter = Symbol.for('signal-exit emitter');\nconst global = globalThis;\nconst ObjectDefineProperty = Object.defineProperty.bind(Object);\n// teeny special purpose ee\nclass Emitter {\n emitted = {\n afterExit: false,\n exit: false,\n };\n listeners = {\n afterExit: [],\n exit: [],\n };\n count = 0;\n id = Math.random();\n constructor() {\n if (global[kExitEmitter]) {\n return global[kExitEmitter];\n }\n ObjectDefineProperty(global, kExitEmitter, {\n value: this,\n writable: false,\n enumerable: false,\n configurable: false,\n });\n }\n on(ev, fn) {\n this.listeners[ev].push(fn);\n }\n removeListener(ev, fn) {\n const list = this.listeners[ev];\n const i = list.indexOf(fn);\n /* c8 ignore start */\n if (i === -1) {\n return;\n }\n /* c8 ignore stop */\n if (i === 0 && list.length === 1) {\n list.length = 0;\n }\n else {\n list.splice(i, 1);\n }\n }\n emit(ev, code, signal) {\n if (this.emitted[ev]) {\n return false;\n }\n this.emitted[ev] = true;\n let ret = false;\n for (const fn of this.listeners[ev]) {\n ret = fn(code, signal) === true || ret;\n }\n if (ev === 'exit') {\n ret = this.emit('afterExit', code, signal) || ret;\n }\n return ret;\n }\n}\nclass SignalExitBase {\n}\nconst signalExitWrap = (handler) => {\n return {\n onExit(cb, opts) {\n return handler.onExit(cb, opts);\n },\n load() {\n return handler.load();\n },\n unload() {\n return handler.unload();\n },\n };\n};\nclass SignalExitFallback extends SignalExitBase {\n onExit() {\n return () => { };\n }\n load() { }\n unload() { }\n}\nclass SignalExit extends SignalExitBase {\n // \"SIGHUP\" throws an `ENOSYS` error on Windows,\n // so use a supported signal instead\n /* c8 ignore start */\n #hupSig = process.platform === 'win32' ? 'SIGINT' : 'SIGHUP';\n /* c8 ignore stop */\n #emitter = new Emitter();\n #process;\n #originalProcessEmit;\n #originalProcessReallyExit;\n #sigListeners = {};\n #loaded = false;\n constructor(process) {\n super();\n this.#process = process;\n // { <signal>: <listener fn>, ... }\n this.#sigListeners = {};\n for (const sig of signals) {\n this.#sigListeners[sig] = () => {\n // If there are no other listeners, an exit is coming!\n // Simplest way: remove us and then re-send the signal.\n // We know that this will kill the process, so we can\n // safely emit now.\n const listeners = this.#process.listeners(sig);\n let { count } = this.#emitter;\n // This is a workaround for the fact that signal-exit v3 and signal\n // exit v4 are not aware of each other, and each will attempt to let\n // the other handle it, so neither of them do. To correct this, we\n // detect if we're the only handler *except* for previous versions\n // of signal-exit, and increment by the count of listeners it has\n // created.\n /* c8 ignore start */\n const p = process;\n if (typeof p.__signal_exit_emitter__ === 'object' &&\n typeof p.__signal_exit_emitter__.count === 'number') {\n count += p.__signal_exit_emitter__.count;\n }\n /* c8 ignore stop */\n if (listeners.length === count) {\n this.unload();\n const ret = this.#emitter.emit('exit', null, sig);\n /* c8 ignore start */\n const s = sig === 'SIGHUP' ? this.#hupSig : sig;\n if (!ret)\n process.kill(process.pid, s);\n /* c8 ignore stop */\n }\n };\n }\n this.#originalProcessReallyExit = process.reallyExit;\n this.#originalProcessEmit = process.emit;\n }\n onExit(cb, opts) {\n /* c8 ignore start */\n if (!processOk(this.#process)) {\n return () => { };\n }\n /* c8 ignore stop */\n if (this.#loaded === false) {\n this.load();\n }\n const ev = opts?.alwaysLast ? 'afterExit' : 'exit';\n this.#emitter.on(ev, cb);\n return () => {\n this.#emitter.removeListener(ev, cb);\n if (this.#emitter.listeners['exit'].length === 0 &&\n this.#emitter.listeners['afterExit'].length === 0) {\n this.unload();\n }\n };\n }\n load() {\n if (this.#loaded) {\n return;\n }\n this.#loaded = true;\n // This is the number of onSignalExit's that are in play.\n // It's important so that we can count the correct number of\n // listeners on signals, and don't wait for the other one to\n // handle it instead of us.\n this.#emitter.count += 1;\n for (const sig of signals) {\n try {\n const fn = this.#sigListeners[sig];\n if (fn)\n this.#process.on(sig, fn);\n }\n catch (_) { }\n }\n this.#process.emit = (ev, ...a) => {\n return this.#processEmit(ev, ...a);\n };\n this.#process.reallyExit = (code) => {\n return this.#processReallyExit(code);\n };\n }\n unload() {\n if (!this.#loaded) {\n return;\n }\n this.#loaded = false;\n signals.forEach(sig => {\n const listener = this.#sigListeners[sig];\n /* c8 ignore start */\n if (!listener) {\n throw new Error('Listener not defined for signal: ' + sig);\n }\n /* c8 ignore stop */\n try {\n this.#process.removeListener(sig, listener);\n /* c8 ignore start */\n }\n catch (_) { }\n /* c8 ignore stop */\n });\n this.#process.emit = this.#originalProcessEmit;\n this.#process.reallyExit = this.#originalProcessReallyExit;\n this.#emitter.count -= 1;\n }\n #processReallyExit(code) {\n /* c8 ignore start */\n if (!processOk(this.#process)) {\n return 0;\n }\n this.#process.exitCode = code || 0;\n /* c8 ignore stop */\n this.#emitter.emit('exit', this.#process.exitCode, null);\n return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);\n }\n #processEmit(ev, ...args) {\n const og = this.#originalProcessEmit;\n if (ev === 'exit' && processOk(this.#process)) {\n if (typeof args[0] === 'number') {\n this.#process.exitCode = args[0];\n /* c8 ignore start */\n }\n /* c8 ignore start */\n const ret = og.call(this.#process, ev, ...args);\n /* c8 ignore start */\n this.#emitter.emit('exit', this.#process.exitCode, null);\n /* c8 ignore stop */\n return ret;\n }\n else {\n return og.call(this.#process, ev, ...args);\n }\n }\n}\nconst process = globalThis.process;\n// wrap so that we call the method on the actual handler, without\n// exporting it directly.\nexport const { \n/**\n * Called when the process is exiting, whether via signal, explicit\n * exit, or running out of stuff to do.\n *\n * If the global process object is not suitable for instrumentation,\n * then this will be a no-op.\n *\n * Returns a function that may be used to unload signal-exit.\n */\nonExit, \n/**\n * Load the listeners. Likely you never need to call this, unless\n * doing a rather deep integration with signal-exit functionality.\n * Mostly exposed for the benefit of testing.\n *\n * @internal\n */\nload, \n/**\n * Unload the listeners. Likely you never need to call this, unless\n * doing a rather deep integration with signal-exit functionality.\n * Mostly exposed for the benefit of testing.\n *\n * @internal\n */\nunload, } = signalExitWrap(processOk(process) ? new SignalExit(process) : new SignalExitFallback());\n//# sourceMappingURL=index.js.map","import {addAbortListener} from 'node:events';\nimport {onExit} from 'signal-exit';\n\n// If the `cleanup` option is used, call `subprocess.kill()` when the parent process exits\nexport const cleanupOnExit = (kill, {cleanup, detached}, {signal}) => {\n\tif (!cleanup || detached) {\n\t\treturn;\n\t}\n\n\tconst removeExitHandler = onExit(() => {\n\t\tkill();\n\t});\n\taddAbortListener(signal, () => {\n\t\tremoveExitHandler();\n\t});\n};\n","import {createDeferred} from '../utils/deferred.js';\n\n// When using multiple `.readable()`/`.writable()`/`.duplex()`, `final` and `destroy` should wait for other streams\nexport const initializeConcurrentStreams = () => ({\n\treadableDestroy: new WeakMap(),\n\twritableFinal: new WeakMap(),\n\twritableDestroy: new WeakMap(),\n});\n\n// Each file descriptor + `waitName` has its own array of promises.\n// Each promise is a single `.readable()`/`.writable()`/`.duplex()` call.\nexport const addConcurrentStream = (concurrentStreams, stream, waitName) => {\n\tconst weakMap = concurrentStreams[waitName];\n\tif (!weakMap.has(stream)) {\n\t\tweakMap.set(stream, []);\n\t}\n\n\tconst promises = weakMap.get(stream);\n\tconst promise = createDeferred();\n\tpromises.push(promise);\n\tconst resolve = promise.resolve.bind(promise);\n\treturn {resolve, promises};\n};\n\n// Wait for other streams, but stop waiting when subprocess ends\nexport const waitForConcurrentStreams = async ({resolve, promises}, subprocess) => {\n\tresolve();\n\tconst [isSubprocessExit] = await Promise.race([\n\t\tPromise.allSettled([true, subprocess]),\n\t\tPromise.all([false, ...promises]),\n\t]);\n\treturn !isSubprocessExit;\n};\n","import {on} from 'node:events';\nimport {getDefaultHighWaterMark} from 'node:stream';\nimport {getEncodingTransformGenerator} from '../transform/encoding-transform.js';\nimport {getSplitLinesGenerator} from '../transform/split.js';\nimport {transformChunkSync, finalChunksSync} from '../transform/run-sync.js';\n\n// Iterate over lines of `subprocess.stdout`, used by `subprocess.readable|duplex|iterable()`\nexport const iterateOnSubprocessStream = ({subprocessStdout, subprocess, binary, shouldEncode, encoding, preserveNewlines}) => {\n\tconst controller = new AbortController();\n\tstopReadingOnExit(subprocess, controller);\n\treturn iterateOnStream({\n\t\tstream: subprocessStdout,\n\t\tcontroller,\n\t\tbinary,\n\t\tshouldEncode: !subprocessStdout.readableObjectMode && shouldEncode,\n\t\tencoding,\n\t\tshouldSplit: !subprocessStdout.readableObjectMode,\n\t\tpreserveNewlines,\n\t});\n};\n\nconst stopReadingOnExit = async (subprocess, controller) => {\n\ttry {\n\t\tawait subprocess;\n\t} catch {} finally {\n\t\tcontroller.abort();\n\t}\n};\n\n// Iterate over lines of `subprocess.stdout`, used by `result.stdout` and the `verbose: 'full'` option.\n// Applies the `lines` and `encoding` options.\nexport const iterateForResult = ({stream, onStreamEnd, lines, encoding, stripFinalNewline, allMixed}) => {\n\tconst controller = new AbortController();\n\tstopReadingOnStreamEnd(onStreamEnd, controller, stream);\n\tconst objectMode = stream.readableObjectMode && !allMixed;\n\treturn iterateOnStream({\n\t\tstream,\n\t\tcontroller,\n\t\tbinary: encoding === 'buffer',\n\t\tshouldEncode: !objectMode,\n\t\tencoding,\n\t\tshouldSplit: !objectMode && lines,\n\t\tpreserveNewlines: !stripFinalNewline,\n\t});\n};\n\nconst stopReadingOnStreamEnd = async (onStreamEnd, controller, stream) => {\n\ttry {\n\t\tawait onStreamEnd;\n\t} catch {\n\t\tstream.destroy();\n\t} finally {\n\t\tcontroller.abort();\n\t}\n};\n\nconst iterateOnStream = ({stream, controller, binary, shouldEncode, encoding, shouldSplit, preserveNewlines}) => {\n\tconst onStdoutChunk = on(stream, 'data', {\n\t\tsignal: controller.signal,\n\t\thighWaterMark: HIGH_WATER_MARK,\n\t\t// Backward compatibility with older name for this option\n\t\t// See https://github.com/nodejs/node/pull/52080#discussion_r1525227861\n\t\t// @todo Remove after removing support for Node 21\n\t\thighWatermark: HIGH_WATER_MARK,\n\t});\n\treturn iterateOnData({\n\t\tonStdoutChunk,\n\t\tcontroller,\n\t\tbinary,\n\t\tshouldEncode,\n\t\tencoding,\n\t\tshouldSplit,\n\t\tpreserveNewlines,\n\t});\n};\n\nexport const DEFAULT_OBJECT_HIGH_WATER_MARK = getDefaultHighWaterMark(true);\n\n// The `highWaterMark` of `events.on()` is measured in number of events, not in bytes.\n// Not knowing the average amount of bytes per `data` event, we use the same heuristic as streams in objectMode, since they have the same issue.\n// Therefore, we use the value of `getDefaultHighWaterMark(true)`.\n// Note: this option does not exist on Node 18, but this is ok since the logic works without it. It just consumes more memory.\nconst HIGH_WATER_MARK = DEFAULT_OBJECT_HIGH_WATER_MARK;\n\nconst iterateOnData = async function * ({onStdoutChunk, controller, binary, shouldEncode, encoding, shouldSplit, preserveNewlines}) {\n\tconst generators = getGenerators({\n\t\tbinary,\n\t\tshouldEncode,\n\t\tencoding,\n\t\tshouldSplit,\n\t\tpreserveNewlines,\n\t});\n\n\ttry {\n\t\tfor await (const [chunk] of onStdoutChunk) {\n\t\t\tyield * transformChunkSync(chunk, generators, 0);\n\t\t}\n\t} catch (error) {\n\t\tif (!controller.signal.aborted) {\n\t\t\tthrow error;\n\t\t}\n\t} finally {\n\t\tyield * finalChunksSync(generators);\n\t}\n};\n\nconst getGenerators = ({binary, shouldEncode, encoding, shouldSplit, preserveNewlines}) => [\n\tgetEncodingTransformGenerator(binary, encoding, !shouldEncode),\n\tgetSplitLinesGenerator(binary, preserveNewlines, !shouldSplit, {}),\n].filter(Boolean);\n","import {BINARY_ENCODINGS} from '../arguments/encoding-option.js';\nimport {getFromStream} from '../arguments/fd-options.js';\nimport {iterateOnSubprocessStream} from '../io/iterate.js';\n\n// Convert the subprocess to an async iterable\nexport const createIterable = (subprocess, encoding, {\n\tfrom,\n\tbinary: binaryOption = false,\n\tpreserveNewlines = false,\n} = {}) => {\n\tconst binary = binaryOption || BINARY_ENCODINGS.has(encoding);\n\tconst subprocessStdout = getFromStream(subprocess, from);\n\tconst onStdoutData = iterateOnSubprocessStream({\n\t\tsubprocessStdout,\n\t\tsubprocess,\n\t\tbinary,\n\t\tshouldEncode: true,\n\t\tencoding,\n\t\tpreserveNewlines,\n\t});\n\treturn iterateOnStdoutData(onStdoutData, subprocessStdout, subprocess);\n};\n\nconst iterateOnStdoutData = async function * (onStdoutData, subprocessStdout, subprocess) {\n\ttry {\n\t\tyield * onStdoutData;\n\t} finally {\n\t\tif (subprocessStdout.readable) {\n\t\t\tsubprocessStdout.destroy();\n\t\t}\n\n\t\tawait subprocess;\n\t}\n};\n","import {finished} from 'node:stream/promises';\n\n// Wraps `finished(stream)` to handle the following case:\n// - When the subprocess exits, Node.js automatically calls `subprocess.stdin.destroy()`, which we need to ignore.\n// - However, we still need to throw if `subprocess.stdin.destroy()` is called before subprocess exit.\nexport const waitForStream = async (stream, fdNumber, streamInfo, {isSameDirection, stopOnExit = false} = {}) => {\n\tconst state = handleStdinDestroy(stream, streamInfo);\n\tconst abortController = new AbortController();\n\ttry {\n\t\tawait Promise.race([\n\t\t\t...(stopOnExit ? [streamInfo.exitPromise] : []),\n\t\t\tfinished(stream, {cleanup: true, signal: abortController.signal}),\n\t\t]);\n\t} catch (error) {\n\t\tif (!state.stdinCleanedUp) {\n\t\t\thandleStreamError(error, fdNumber, streamInfo, isSameDirection);\n\t\t}\n\t} finally {\n\t\tabortController.abort();\n\t}\n};\n\n// If `subprocess.stdin` is destroyed before being fully written to, it is considered aborted and should throw an error.\n// This can happen for example when user called `subprocess.stdin.destroy()` before `subprocess.stdin.end()`.\n// However, Node.js calls `subprocess.stdin.destroy()` on exit for cleanup purposes.\n// https://github.com/nodejs/node/blob/0b4cdb4b42956cbd7019058e409e06700a199e11/lib/internal/child_process.js#L278\n// This is normal and should not throw an error.\n// Therefore, we need to differentiate between both situations to know whether to throw an error.\n// Unfortunately, events (`close`, `error`, `end`, `exit`) cannot be used because `.destroy()` can take an arbitrary amount of time.\n// For example, `stdin: 'pipe'` is implemented as a TCP socket, and its `.destroy()` method waits for TCP disconnection.\n// Therefore `.destroy()` might end before or after subprocess exit, based on OS speed and load.\n// The only way to detect this is to spy on `subprocess.stdin._destroy()` by wrapping it.\n// If `subprocess.exitCode` or `subprocess.signalCode` is set, it means `.destroy()` is being called by Node.js itself.\nconst handleStdinDestroy = (stream, {originalStreams, subprocess}) => {\n\tconst [originalStdin] = originalStreams;\n\tconst state = {stdinCleanedUp: false};\n\tif (stream === originalStdin) {\n\t\tspyOnStdinDestroy(stream, subprocess, state);\n\t}\n\n\treturn state;\n};\n\nconst spyOnStdinDestroy = (subprocessStdin, subprocess, state) => {\n\tconst {_destroy} = subprocessStdin;\n\tsubprocessStdin._destroy = (...destroyArguments) => {\n\t\tsetStdinCleanedUp(subprocess, state);\n\t\t_destroy.call(subprocessStdin, ...destroyArguments);\n\t};\n};\n\nconst setStdinCleanedUp = ({exitCode, signalCode}, state) => {\n\tif (exitCode !== null || signalCode !== null) {\n\t\tstate.stdinCleanedUp = true;\n\t}\n};\n\n// We ignore EPIPEs on writable streams and aborts on readable streams since those can happen normally.\n// When one stream errors, the error is propagated to the other streams on the same file descriptor.\n// Those other streams might have a different direction due to the above.\n// When this happens, the direction of both the initial stream and the others should then be taken into account.\n// Therefore, we keep track of whether a stream error is currently propagating.\nconst handleStreamError = (error, fdNumber, streamInfo, isSameDirection) => {\n\tif (!shouldIgnoreStreamError(error, fdNumber, streamInfo, isSameDirection)) {\n\t\tthrow error;\n\t}\n};\n\nconst shouldIgnoreStreamError = (error, fdNumber, streamInfo, isSameDirection = true) => {\n\tif (streamInfo.propagating) {\n\t\treturn isStreamEpipe(error) || isStreamAbort(error);\n\t}\n\n\tstreamInfo.propagating = true;\n\treturn isInputFileDescriptor(streamInfo, fdNumber) === isSameDirection\n\t\t? isStreamEpipe(error)\n\t\t: isStreamAbort(error);\n};\n\n// Unfortunately, we cannot use the stream's class or properties to know whether it is readable or writable.\n// For example, `subprocess.stdin` is technically a Duplex, but can only be used as a writable.\n// Therefore, we need to use the file descriptor's direction (`stdin` is input, `stdout` is output, etc.).\n// However, while `subprocess.std*` and transforms follow that direction, any stream passed the `std*` option has the opposite direction.\n// For example, `subprocess.stdin` is a writable, but the `stdin` option is a readable.\nexport const isInputFileDescriptor = ({fileDescriptors}, fdNumber) => fdNumber !== 'all' && fileDescriptors[fdNumber].direction === 'input';\n\n// When `stream.destroy()` is called without an `error` argument, stream is aborted.\n// This is the only way to abort a readable stream, which can be useful in some instances.\n// Therefore, we ignore this error on readable streams.\nexport const isStreamAbort = error => error?.code === 'ERR_STREAM_PREMATURE_CLOSE';\n\n// When `stream.write()` is called but the underlying source has been closed, `EPIPE` is emitted.\n// When piping subprocesses, the source subprocess usually decides when to stop piping.\n// However, there are some instances when the destination does instead, such as `... | head -n1`.\n// It notifies the source by using `EPIPE`.\n// Therefore, we ignore this error on writable streams.\nconst isStreamEpipe = error => error?.code === 'EPIPE';\n","import {finished} from 'node:stream/promises';\nimport {isStreamAbort} from '../resolve/wait-stream.js';\n\nexport const safeWaitForSubprocessStdin = async subprocessStdin => {\n\tif (subprocessStdin === undefined) {\n\t\treturn;\n\t}\n\n\ttry {\n\t\tawait waitForSubprocessStdin(subprocessStdin);\n\t} catch {}\n};\n\nexport const safeWaitForSubprocessStdout = async subprocessStdout => {\n\tif (subprocessStdout === undefined) {\n\t\treturn;\n\t}\n\n\ttry {\n\t\tawait waitForSubprocessStdout(subprocessStdout);\n\t} catch {}\n};\n\nexport const waitForSubprocessStdin = async subprocessStdin => {\n\tawait finished(subprocessStdin, {cleanup: true, readable: false, writable: true});\n};\n\nexport const waitForSubprocessStdout = async subprocessStdout => {\n\tawait finished(subprocessStdout, {cleanup: true, readable: true, writable: false});\n};\n\n// When `readable` or `writable` aborts/errors, awaits the subprocess, for the reason mentioned above\nexport const waitForSubprocess = async (subprocess, error) => {\n\tawait subprocess;\n\tif (error) {\n\t\tthrow error;\n\t}\n};\n\nexport const destroyOtherStream = (stream, isOpen, error) => {\n\tif (error && !isStreamAbort(error)) {\n\t\tstream.destroy(error);\n\t} else if (isOpen) {\n\t\tstream.destroy();\n\t}\n};\n","import {Readable} from 'node:stream';\nimport {callbackify} from 'node:util';\nimport {BINARY_ENCODINGS} from '../arguments/encoding-option.js';\nimport {getFromStream} from '../arguments/fd-options.js';\nimport {iterateOnSubprocessStream, DEFAULT_OBJECT_HIGH_WATER_MARK} from '../io/iterate.js';\nimport {createDeferred} from '../utils/deferred.js';\nimport {addConcurrentStream, waitForConcurrentStreams} from './concurrent.js';\nimport {\n\tsafeWaitForSubprocessStdin,\n\twaitForSubprocessStdout,\n\twaitForSubprocess,\n\tdestroyOtherStream,\n} from './shared.js';\n\n// Create a `Readable` stream that forwards from `stdout` and awaits the subprocess\nexport const createReadable = ({subprocess, concurrentStreams, encoding}, {from, binary: binaryOption = true, preserveNewlines = true} = {}) => {\n\tconst binary = binaryOption || BINARY_ENCODINGS.has(encoding);\n\tconst {subprocessStdout, waitReadableDestroy} = getSubprocessStdout(subprocess, from, concurrentStreams);\n\tconst {readableEncoding, readableObjectMode, readableHighWaterMark} = getReadableOptions(subprocessStdout, binary);\n\tconst {read, onStdoutDataDone} = getReadableMethods({\n\t\tsubprocessStdout,\n\t\tsubprocess,\n\t\tbinary,\n\t\tencoding,\n\t\tpreserveNewlines,\n\t});\n\tconst readable = new Readable({\n\t\tread,\n\t\tdestroy: callbackify(onReadableDestroy.bind(undefined, {subprocessStdout, subprocess, waitReadableDestroy})),\n\t\thighWaterMark: readableHighWaterMark,\n\t\tobjectMode: readableObjectMode,\n\t\tencoding: readableEncoding,\n\t});\n\tonStdoutFinished({\n\t\tsubprocessStdout,\n\t\tonStdoutDataDone,\n\t\treadable,\n\t\tsubprocess,\n\t});\n\treturn readable;\n};\n\n// Retrieve `stdout` (or other stream depending on `from`)\nexport const getSubprocessStdout = (subprocess, from, concurrentStreams) => {\n\tconst subprocessStdout = getFromStream(subprocess, from);\n\tconst waitReadableDestroy = addConcurrentStream(concurrentStreams, subprocessStdout, 'readableDestroy');\n\treturn {subprocessStdout, waitReadableDestroy};\n};\n\nexport const getReadableOptions = ({readableEncoding, readableObjectMode, readableHighWaterMark}, binary) => binary\n\t? {readableEncoding, readableObjectMode, readableHighWaterMark}\n\t: {readableEncoding, readableObjectMode: true, readableHighWaterMark: DEFAULT_OBJECT_HIGH_WATER_MARK};\n\nexport const getReadableMethods = ({subprocessStdout, subprocess, binary, encoding, preserveNewlines}) => {\n\tconst onStdoutDataDone = createDeferred();\n\tconst onStdoutData = iterateOnSubprocessStream({\n\t\tsubprocessStdout,\n\t\tsubprocess,\n\t\tbinary,\n\t\tshouldEncode: !binary,\n\t\tencoding,\n\t\tpreserveNewlines,\n\t});\n\n\treturn {\n\t\tread() {\n\t\t\tonRead(this, onStdoutData, onStdoutDataDone);\n\t\t},\n\t\tonStdoutDataDone,\n\t};\n};\n\n// Forwards data from `stdout` to `readable`\nconst onRead = async (readable, onStdoutData, onStdoutDataDone) => {\n\ttry {\n\t\tconst {value, done} = await onStdoutData.next();\n\t\tif (done) {\n\t\t\tonStdoutDataDone.resolve();\n\t\t} else {\n\t\t\treadable.push(value);\n\t\t}\n\t} catch {}\n};\n\n// When `subprocess.stdout` ends/aborts/errors, do the same on `readable`.\n// Await the subprocess, for the same reason as above.\nexport const onStdoutFinished = async ({subprocessStdout, onStdoutDataDone, readable, subprocess, subprocessStdin}) => {\n\ttry {\n\t\tawait waitForSubprocessStdout(subprocessStdout);\n\t\tawait subprocess;\n\t\tawait safeWaitForSubprocessStdin(subprocessStdin);\n\t\tawait onStdoutDataDone;\n\n\t\tif (readable.readable) {\n\t\t\treadable.push(null);\n\t\t}\n\t} catch (error) {\n\t\tawait safeWaitForSubprocessStdin(subprocessStdin);\n\t\tdestroyOtherReadable(readable, await getPrematureCloseError(subprocess, error));\n\t}\n};\n\nconst getPrematureCloseError = async (subprocess, error) => {\n\tif (error.code !== 'ERR_STREAM_PREMATURE_CLOSE') {\n\t\treturn error;\n\t}\n\n\ttry {\n\t\tawait subprocess;\n\t} catch (subprocessError) {\n\t\treturn subprocessError;\n\t}\n\n\treturn error;\n};\n\n// When `readable` aborts/errors, do the same on `subprocess.stdout`\nexport const onReadableDestroy = async ({subprocessStdout, subprocess, waitReadableDestroy}, error) => {\n\tif (!await waitForConcurrentStreams(waitReadableDestroy, subprocess)) {\n\t\treturn;\n\t}\n\n\tdestroyOtherReadable(subprocessStdout, error);\n\tawait waitForSubprocess(subprocess, error);\n};\n\nconst destroyOtherReadable = (stream, error) => {\n\tdestroyOtherStream(stream, stream.readable, error);\n};\n","import {Readable, Writable, Duplex} from 'node:stream';\n\n// Web stream versions of `subprocess.readable()`, `subprocess.writable()` and `subprocess.duplex()`.\n// They wrap those methods with `.toWeb()`, so all error and abort handling is reused as is.\nexport const createReadableStream = (subprocess, readableOptions) => Readable.toWeb(subprocess.readable(readableOptions));\nexport const createWritableStream = (subprocess, writableOptions) => Writable.toWeb(subprocess.writable(writableOptions));\nexport const createTransformStream = (subprocess, duplexOptions) => Duplex.toWeb(subprocess.duplex(duplexOptions));\n","import {normalizeParameters} from '../methods/parameters.js';\nimport {getStartTime} from '../return/duration.js';\nimport {SUBPROCESS_OPTIONS, getToStream, getFromStream} from '../arguments/fd-options.js';\nimport {isDenoExecPath} from '../arguments/file-url.js';\n\n// Normalize and validate arguments passed to `source.pipe(destination)`\nexport const normalizePipeArguments = ({source, sourcePromise, boundOptions, createNested}, ...pipeArguments) => {\n\tconst startTime = getStartTime();\n\tconst {\n\t\tdestination,\n\t\tdestinationStream,\n\t\tdestinationError,\n\t\tfrom,\n\t\tunpipeSignal,\n\t} = getDestinationStream(boundOptions, createNested, pipeArguments);\n\tconst {sourceStream, sourceError} = getSourceStream(source, from);\n\tconst {options: sourceOptions, fileDescriptors} = SUBPROCESS_OPTIONS.get(source);\n\treturn {\n\t\tsourcePromise,\n\t\tsourceStream,\n\t\tsourceOptions,\n\t\tsourceError,\n\t\tdestination,\n\t\tdestinationStream,\n\t\tdestinationError,\n\t\tunpipeSignal,\n\t\tfileDescriptors,\n\t\tstartTime,\n\t};\n};\n\nconst getDestinationStream = (boundOptions, createNested, pipeArguments) => {\n\ttry {\n\t\tconst {\n\t\t\tdestination,\n\t\t\tpipeOptions: {from, to, unpipeSignal} = {},\n\t\t} = getDestination(boundOptions, createNested, ...pipeArguments);\n\t\tconst destinationStream = getToStream(destination, to);\n\t\treturn {\n\t\t\tdestination,\n\t\t\tdestinationStream,\n\t\t\tfrom,\n\t\t\tunpipeSignal,\n\t\t};\n\t} catch (error) {\n\t\treturn {destinationError: error};\n\t}\n};\n\n// Piping subprocesses can use three syntaxes:\n// - source.pipe('command', commandArguments, pipeOptionsOrDestinationOptions)\n// - source.pipe`command commandArgument` or source.pipe(pipeOptionsOrDestinationOptions)`command commandArgument`\n// - source.pipe(execa(...), pipeOptions)\nconst getDestination = (boundOptions, createNested, firstArgument, ...pipeArguments) => {\n\tif (Array.isArray(firstArgument)) {\n\t\tconst destination = createNested(mapDestinationArguments, boundOptions)(firstArgument, ...pipeArguments);\n\t\treturn {destination, pipeOptions: boundOptions};\n\t}\n\n\tif (typeof firstArgument === 'string' || firstArgument instanceof URL || isDenoExecPath(firstArgument)) {\n\t\tif (Object.keys(boundOptions).length > 0) {\n\t\t\tthrow new TypeError('Please use .pipe(\"file\", ..., options) or .pipe(execa(\"file\", ..., options)) instead of .pipe(options)(\"file\", ...).');\n\t\t}\n\n\t\tconst [rawFile, rawArguments, rawOptions] = normalizeParameters(firstArgument, ...pipeArguments);\n\t\tconst destination = createNested(mapDestinationArguments)(rawFile, rawArguments, rawOptions);\n\t\treturn {destination, pipeOptions: rawOptions};\n\t}\n\n\tif (SUBPROCESS_OPTIONS.has(firstArgument)) {\n\t\tif (Object.keys(boundOptions).length > 0) {\n\t\t\tthrow new TypeError('Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).');\n\t\t}\n\n\t\treturn {destination: firstArgument, pipeOptions: pipeArguments[0]};\n\t}\n\n\tthrow new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${firstArgument}`);\n};\n\n// Force `stdin: 'pipe'` with the destination subprocess\nconst mapDestinationArguments = ({options}) => ({options: {...options, stdin: 'pipe', piped: true}});\n\nconst getSourceStream = (source, from) => {\n\ttry {\n\t\tconst sourceStream = getFromStream(source, from);\n\t\treturn {sourceStream};\n\t} catch (error) {\n\t\treturn {sourceError: error};\n\t}\n};\n","import {makeEarlyError} from '../return/result.js';\nimport {abortSourceStream, endDestinationStream} from '../io/pipeline.js';\n\n// When passing invalid arguments to `source.pipe()`, throw asynchronously.\n// We also abort both subprocesses.\nexport const handlePipeArgumentsError = ({\n\tsourceStream,\n\tsourceError,\n\tdestinationStream,\n\tdestinationError,\n\tfileDescriptors,\n\tsourceOptions,\n\tstartTime,\n}) => {\n\tconst error = getPipeArgumentsError({\n\t\tsourceStream,\n\t\tsourceError,\n\t\tdestinationStream,\n\t\tdestinationError,\n\t});\n\tif (error !== undefined) {\n\t\tthrow createNonCommandError({\n\t\t\terror,\n\t\t\tfileDescriptors,\n\t\t\tsourceOptions,\n\t\t\tstartTime,\n\t\t});\n\t}\n};\n\nconst getPipeArgumentsError = ({sourceStream, sourceError, destinationStream, destinationError}) => {\n\tif (sourceError !== undefined && destinationError !== undefined) {\n\t\treturn destinationError;\n\t}\n\n\tif (destinationError !== undefined) {\n\t\tabortSourceStream(sourceStream);\n\t\treturn destinationError;\n\t}\n\n\tif (sourceError !== undefined) {\n\t\tendDestinationStream(destinationStream);\n\t\treturn sourceError;\n\t}\n};\n\n// Specific error return value when passing invalid arguments to `subprocess.pipe()` or when using `unpipeSignal`\nexport const createNonCommandError = ({error, fileDescriptors, sourceOptions, startTime}) => makeEarlyError({\n\terror,\n\tcommand: PIPE_COMMAND_MESSAGE,\n\tescapedCommand: PIPE_COMMAND_MESSAGE,\n\tfileDescriptors,\n\toptions: sourceOptions,\n\tstartTime,\n\tisSync: false,\n});\n\nconst PIPE_COMMAND_MESSAGE = 'source.pipe(destination)';\n","// Like Bash, we await both subprocesses. This is unlike some other shells which only await the destination subprocess.\n// Like Bash with the `pipefail` option, if either subprocess fails, the whole pipe fails.\n// Like Bash, if both subprocesses fail, we return the failure of the destination.\n// This ensures both subprocesses' errors are present, using `error.pipedFrom`.\nexport const waitForBothSubprocesses = async subprocessPromises => {\n\tconst [\n\t\t{status: sourceStatus, reason: sourceReason, value: sourceResult = sourceReason},\n\t\t{status: destinationStatus, reason: destinationReason, value: destinationResult = destinationReason},\n\t] = await subprocessPromises;\n\n\tif (!destinationResult.pipedFrom.includes(sourceResult)) {\n\t\tdestinationResult.pipedFrom.push(sourceResult);\n\t}\n\n\tif (destinationStatus === 'rejected') {\n\t\tthrow destinationResult;\n\t}\n\n\tif (sourceStatus === 'rejected') {\n\t\tthrow sourceResult;\n\t}\n\n\treturn destinationResult;\n};\n","import {finished} from 'node:stream/promises';\nimport mergeStreams from '@sindresorhus/merge-streams';\nimport {incrementMaxListeners} from '../utils/max-listeners.js';\nimport {pipeStreams} from '../io/pipeline.js';\n\n// The piping behavior is like Bash.\n// In particular, when one subprocess exits, the other is not terminated by a signal.\n// Instead, its stdout (for the source) or stdin (for the destination) closes.\n// If the subprocess uses it, it will make it error with SIGPIPE or EPIPE (for the source) or end (for the destination).\n// If it does not use it, it will continue running.\n// This allows for subprocesses to gracefully exit and lower the coupling between subprocesses.\nexport const pipeSubprocessStream = (sourceStream, destinationStream, maxListenersController) => {\n\tconst mergedStream = MERGED_STREAMS.has(destinationStream)\n\t\t? pipeMoreSubprocessStream(sourceStream, destinationStream)\n\t\t: pipeFirstSubprocessStream(sourceStream, destinationStream);\n\tincrementMaxListeners(sourceStream, SOURCE_LISTENERS_PER_PIPE, maxListenersController.signal);\n\tincrementMaxListeners(destinationStream, DESTINATION_LISTENERS_PER_PIPE, maxListenersController.signal);\n\tcleanupMergedStreamsMap(destinationStream);\n\treturn mergedStream;\n};\n\n// We use `merge-streams` to allow for multiple sources to pipe to the same destination.\nconst pipeFirstSubprocessStream = (sourceStream, destinationStream) => {\n\tconst mergedStream = mergeStreams([sourceStream]);\n\tpipeStreams(mergedStream, destinationStream);\n\tMERGED_STREAMS.set(destinationStream, mergedStream);\n\treturn mergedStream;\n};\n\nconst pipeMoreSubprocessStream = (sourceStream, destinationStream) => {\n\tconst mergedStream = MERGED_STREAMS.get(destinationStream);\n\tmergedStream.add(sourceStream);\n\treturn mergedStream;\n};\n\nconst cleanupMergedStreamsMap = async destinationStream => {\n\ttry {\n\t\tawait finished(destinationStream, {cleanup: true, readable: false, writable: true});\n\t} catch {}\n\n\tMERGED_STREAMS.delete(destinationStream);\n};\n\nconst MERGED_STREAMS = new WeakMap();\n\n// Number of listeners set up on `sourceStream` by each `sourceStream.pipe(destinationStream)`\n// Those are added by `merge-streams`\nconst SOURCE_LISTENERS_PER_PIPE = 2;\n// Number of listeners set up on `destinationStream` by each `sourceStream.pipe(destinationStream)`\n// Those are added by `finished()` in `cleanupMergedStreamsMap()`\nconst DESTINATION_LISTENERS_PER_PIPE = 1;\n","import {aborted} from 'node:util';\nimport {createNonCommandError} from './throw.js';\n\n// When passing an `unpipeSignal` option, abort piping when the signal is aborted.\n// However, do not terminate the subprocesses.\nexport const unpipeOnAbort = (unpipeSignal, unpipeContext) => unpipeSignal === undefined\n\t? []\n\t: [unpipeOnSignalAbort(unpipeSignal, unpipeContext)];\n\nconst unpipeOnSignalAbort = async (unpipeSignal, {sourceStream, mergedStream, fileDescriptors, sourceOptions, startTime}) => {\n\tawait aborted(unpipeSignal, sourceStream);\n\tawait mergedStream.remove(sourceStream);\n\tconst error = new Error('Pipe canceled by `unpipeSignal` option.');\n\tthrow createNonCommandError({\n\t\terror,\n\t\tfileDescriptors,\n\t\tsourceOptions,\n\t\tstartTime,\n\t});\n};\n","import isPlainObject from 'is-plain-obj';\nimport {SUBPROCESS_OPTIONS} from '../arguments/fd-options.js';\nimport {initializeConcurrentStreams} from '../convert/concurrent.js';\nimport {createIterable} from '../convert/iterable.js';\nimport {createReadable} from '../convert/readable.js';\nimport {createReadableStream} from '../convert/web.js';\nimport {internalGetOneMessageOptions} from '../ipc/get-one.js';\nimport {internalGetEachMessageOptions} from '../ipc/get-each.js';\nimport {normalizePipeArguments} from './pipe-arguments.js';\nimport {handlePipeArgumentsError} from './throw.js';\nimport {waitForBothSubprocesses} from './sequence.js';\nimport {pipeSubprocessStream} from './streaming.js';\nimport {unpipeOnAbort} from './abort.js';\n\n// Pipe a subprocess' `stdout`/`stderr`/`stdio` into another subprocess' `stdin`\nexport const pipeToSubprocess = (sourceInfo, ...pipeArguments) => {\n\tif (isPlainObject(pipeArguments[0])) {\n\t\treturn pipeToSubprocess.bind(undefined, {\n\t\t\t...sourceInfo,\n\t\t\tboundOptions: {...sourceInfo.boundOptions, ...pipeArguments[0]},\n\t\t});\n\t}\n\n\tconst {destination, ...normalizedInfo} = normalizePipeArguments(sourceInfo, ...pipeArguments);\n\tconst pipeFailureController = new AbortController();\n\tconst promise = handlePipePromise({...normalizedInfo, destination, pipeFailureController});\n\tpromise.pipe = pipeToSubprocess.bind(undefined, {\n\t\t...sourceInfo,\n\t\tsource: destination,\n\t\tsourcePromise: promise,\n\t\tboundOptions: {},\n\t});\n\tforwardDestinationMethods(promise, destination, pipeFailureController.signal);\n\treturn promise;\n};\n\n/*\nThe return value of `.pipe()` exposes the destination subprocess' output, but its iteration and stream conversion methods must await the whole pipe so source failures are propagated too. The destination is `undefined` when `.pipe()` was passed invalid arguments, in which case the promise rejects and there is nothing to forward.\n*/\nconst forwardDestinationMethods = (promise, destination, pipeFailureSignal) => {\n\tif (destination === undefined) {\n\t\treturn;\n\t}\n\n\tforwardReadableMethods(promise, destination);\n\tforwardIpcMethods(promise, destination, pipeFailureSignal);\n};\n\nconst forwardReadableMethods = (promise, destination) => {\n\tconst subprocessOptions = SUBPROCESS_OPTIONS.get(destination);\n\tSUBPROCESS_OPTIONS.set(promise, subprocessOptions);\n\tpromise.stdio = destination.stdio;\n\tpromise.all = destination.all;\n\n\tconst {options: {encoding}} = subprocessOptions;\n\tconst concurrentStreams = initializeConcurrentStreams();\n\tpromise[Symbol.asyncIterator] = createIterable.bind(undefined, promise, encoding, {});\n\tpromise.iterable = createIterable.bind(undefined, promise, encoding);\n\tpromise.readable = createPipeReadable.bind(undefined, promise, {\n\t\tsubprocess: promise,\n\t\tconcurrentStreams,\n\t\tencoding,\n\t});\n\tpromise.readableStream = createReadableStream.bind(undefined, promise);\n\tforwardAll(promise, destination);\n};\n\nconst forwardAll = (promise, destination) => {\n\tif (destination.all === undefined) {\n\t\tpromise.all = undefined;\n\t\treturn;\n\t}\n\n\tObject.defineProperty(promise, 'all', {\n\t\tget() {\n\t\t\tsetAllProperty(promise, destination.all);\n\t\t\tconst all = promise.readable({from: 'all'});\n\t\t\tsetAllProperty(promise, all);\n\t\t\treturn all;\n\t\t},\n\t\tenumerable: true,\n\t\tconfigurable: true,\n\t});\n};\n\nconst setAllProperty = (promise, value) => {\n\tObject.defineProperty(promise, 'all', {\n\t\tvalue,\n\t\twritable: true,\n\t\tenumerable: true,\n\t\tconfigurable: true,\n\t});\n};\n\nconst createPipeReadable = (promise, readableOptions, ...arguments_) => {\n\tconst readable = createReadable(readableOptions, ...arguments_);\n\tdestroyOnPipeFailure(promise, readable);\n\treturn readable;\n};\n\nconst destroyOnPipeFailure = async (promise, readable) => {\n\ttry {\n\t\tawait promise;\n\t} catch (error) {\n\t\treadable.destroy(error);\n\t}\n};\n\nconst forwardIpcMethods = (promise, destination, pipeFailureSignal) => {\n\tpromise.sendMessage = destination.sendMessage;\n\tpromise.getOneMessage = getOnePipeMessage.bind(undefined, destination, pipeFailureSignal);\n\tpromise.getEachMessage = getEachPipeMessage.bind(undefined, promise, destination, pipeFailureSignal);\n};\n\nconst getOnePipeMessage = (destination, pipeFailureSignal, ...arguments_) => {\n\tconst controller = new AbortController();\n\tconst messagePromise = destination.getOneMessage(...addPipeOptions(arguments_, controller.signal, internalGetOneMessageOptions));\n\treturn waitForOnePipeMessage(pipeFailureSignal, messagePromise, controller);\n};\n\nconst waitForOnePipeMessage = async (pipeFailureSignal, messagePromise, controller) => {\n\ttry {\n\t\treturn await Promise.race([messagePromise, getSignalRejection(pipeFailureSignal, controller.signal)]);\n\t} finally {\n\t\tcontroller.abort();\n\t}\n};\n\nconst getSignalRejection = (signal, listenerSignal) => new Promise((_, reject) => {\n\tif (signal.aborted) {\n\t\treject(signal.reason);\n\t\treturn;\n\t}\n\n\tsignal.addEventListener('abort', () => {\n\t\treject(signal.reason);\n\t}, {once: true, signal: listenerSignal});\n});\n\nconst getEachPipeMessage = (promise, destination, pipeFailureSignal, ...arguments_) => {\n\tconst controller = new AbortController();\n\t// Create the destination iterator before awaiting the pipe so option validation stays synchronous.\n\tconst iterator = destination.getEachMessage(...addPipeOptions(arguments_, controller.signal, internalGetEachMessageOptions));\n\tabortOnSignal(pipeFailureSignal, controller);\n\treturn iterateOnPipeMessages(promise, iterator, controller);\n};\n\nconst iterateOnPipeMessages = async function * (promise, iterator, controller) {\n\ttry {\n\t\tyield * iterator;\n\t} finally {\n\t\tcontroller.abort();\n\t\tawait promise;\n\t}\n};\n\nconst addPipeOptions = (arguments_, signal, internalOptionsSymbol) => {\n\tif (arguments_[0] === null) {\n\t\t// Preserve the public validation error from `getEachMessage(null)` instead of masking it with a pipe failure.\n\t\treturn arguments_;\n\t}\n\n\tconst [options] = arguments_;\n\t// The returned pipe promise is awaited by the forwarded IPC iterator, so the destination IPC iterator must not also await the destination subprocess on close.\n\treturn [{...options, [internalOptionsSymbol]: {signal, shouldAwait: false}}];\n};\n\nconst abortOnSignal = (signal, controller) => {\n\tif (signal.aborted) {\n\t\tcontroller.abort();\n\t\treturn;\n\t}\n\n\t// Interrupt pending IPC reads when the pipe rejects, including `unpipeSignal` cancellation while the destination keeps running.\n\tsignal.addEventListener('abort', () => {\n\t\tcontroller.abort();\n\t}, {once: true, signal: controller.signal});\n};\n\n// `writable()`, `duplex()`, `writableStream()` and `transformStream()` are intentionally not forwarded: they write to the destination's `stdin`, which is already being piped from the source.\n\n// Asynchronous logic when piping subprocesses\nconst handlePipePromise = async ({\n\tsourcePromise,\n\tsourceStream,\n\tsourceOptions,\n\tsourceError,\n\tdestination,\n\tdestinationStream,\n\tdestinationError,\n\tunpipeSignal,\n\tfileDescriptors,\n\tstartTime,\n\tpipeFailureController,\n}) => {\n\tconst maxListenersController = new AbortController();\n\ttry {\n\t\tconst subprocessPromises = getSubprocessPromises(sourcePromise, destination);\n\t\thandlePipeArgumentsError({\n\t\t\tsourceStream,\n\t\t\tsourceError,\n\t\t\tdestinationStream,\n\t\t\tdestinationError,\n\t\t\tfileDescriptors,\n\t\t\tsourceOptions,\n\t\t\tstartTime,\n\t\t});\n\t\tconst mergedStream = pipeSubprocessStream(sourceStream, destinationStream, maxListenersController);\n\t\treturn await Promise.race([\n\t\t\twaitForBothSubprocesses(subprocessPromises),\n\t\t\t...unpipeOnAbort(unpipeSignal, {\n\t\t\t\tsourceStream,\n\t\t\t\tmergedStream,\n\t\t\t\tsourceOptions,\n\t\t\t\tfileDescriptors,\n\t\t\t\tstartTime,\n\t\t\t}),\n\t\t]);\n\t} catch (error) {\n\t\tpipeFailureController.abort(error);\n\t\tthrow error;\n\t} finally {\n\t\tmaxListenersController.abort();\n\t}\n};\n\n// `.pipe()` awaits the subprocess promises.\n// When invalid arguments are passed to `.pipe()`, we throw an error, which prevents awaiting them.\n// We need to ensure this does not create unhandled rejections.\nconst getSubprocessPromises = (sourcePromise, destination) => Promise.allSettled([sourcePromise, destination]);\n","import {setImmediate} from 'node:timers/promises';\nimport getStream, {getStreamAsArrayBuffer, getStreamAsArray} from 'get-stream';\nimport {isArrayBuffer} from '../utils/uint-array.js';\nimport {shouldLogOutput, logLines} from '../verbose/output.js';\nimport {iterateForResult} from './iterate.js';\nimport {handleMaxBuffer} from './max-buffer.js';\nimport {getStripFinalNewline} from './strip-newline.js';\n\n// Retrieve `result.stdout|stderr|all|stdio[*]`\nexport const getStreamOutput = async ({stream, onStreamEnd, fdNumber, encoding, buffer, maxBuffer, lines, allMixed, stripFinalNewline, verboseInfo, streamInfo}) => {\n\tconst logPromise = logOutputAsync({\n\t\tstream,\n\t\tonStreamEnd,\n\t\tfdNumber,\n\t\tencoding,\n\t\tallMixed,\n\t\tverboseInfo,\n\t\tstreamInfo,\n\t});\n\n\tif (!buffer) {\n\t\tawait Promise.all([resumeStream(stream), logPromise]);\n\t\treturn;\n\t}\n\n\tconst stripFinalNewlineValue = getStripFinalNewline(stripFinalNewline, fdNumber);\n\tconst iterable = iterateForResult({\n\t\tstream,\n\t\tonStreamEnd,\n\t\tlines,\n\t\tencoding,\n\t\tstripFinalNewline: stripFinalNewlineValue,\n\t\tallMixed,\n\t});\n\tconst [output] = await Promise.all([\n\t\tgetStreamContents({\n\t\t\tstream,\n\t\t\titerable,\n\t\t\tfdNumber,\n\t\t\tencoding,\n\t\t\tmaxBuffer,\n\t\t\tlines,\n\t\t}),\n\t\tlogPromise,\n\t]);\n\treturn output;\n};\n\nconst logOutputAsync = async ({stream, onStreamEnd, fdNumber, encoding, allMixed, verboseInfo, streamInfo: {fileDescriptors}}) => {\n\tif (!shouldLogOutput({\n\t\tstdioItems: fileDescriptors[fdNumber]?.stdioItems,\n\t\tencoding,\n\t\tverboseInfo,\n\t\tfdNumber,\n\t})) {\n\t\treturn;\n\t}\n\n\tconst linesIterable = iterateForResult({\n\t\tstream,\n\t\tonStreamEnd,\n\t\tlines: true,\n\t\tencoding,\n\t\tstripFinalNewline: true,\n\t\tallMixed,\n\t});\n\tawait logLines(linesIterable, stream, fdNumber, verboseInfo);\n};\n\n// When using `buffer: false`, users need to read `subprocess.stdout|stderr|all` right away\n// See https://github.com/sindresorhus/execa/issues/730 and https://github.com/sindresorhus/execa/pull/729#discussion_r1465496310\nconst resumeStream = async stream => {\n\tawait setImmediate();\n\tif (stream.readableFlowing === null) {\n\t\tstream.resume();\n\t}\n};\n\nconst getStreamContents = async ({stream, stream: {readableObjectMode}, iterable, fdNumber, encoding, maxBuffer, lines}) => {\n\ttry {\n\t\tif (readableObjectMode || lines) {\n\t\t\treturn await getStreamAsArray(iterable, {maxBuffer});\n\t\t}\n\n\t\tif (encoding === 'buffer') {\n\t\t\treturn new Uint8Array(await getStreamAsArrayBuffer(iterable, {maxBuffer}));\n\t\t}\n\n\t\treturn await getStream(iterable, {maxBuffer});\n\t} catch (error) {\n\t\treturn handleBufferedData(handleMaxBuffer({\n\t\t\terror,\n\t\t\tstream,\n\t\t\treadableObjectMode,\n\t\t\tlines,\n\t\t\tencoding,\n\t\t\tfdNumber,\n\t\t}));\n\t}\n};\n\n// On failure, `result.stdout|stderr|all` should contain the currently buffered stream\n// They are automatically closed and flushed by Node.js when the subprocess exits\n// When `buffer` is `false`, `streamPromise` is `undefined` and there is no buffered data to retrieve\nexport const getBufferedData = async streamPromise => {\n\ttry {\n\t\treturn await streamPromise;\n\t} catch (error) {\n\t\treturn handleBufferedData(error);\n\t}\n};\n\n// Ensure we are returning Uint8Arrays when using `encoding: 'buffer'`\nconst handleBufferedData = ({bufferedData}) => isArrayBuffer(bufferedData)\n\t? new Uint8Array(bufferedData)\n\t: bufferedData;\n","import {getStreamOutput} from '../io/contents.js';\nimport {waitForStream, isInputFileDescriptor} from './wait-stream.js';\n\n// Read the contents of `subprocess.std*` and|or wait for its completion\nexport const waitForStdioStreams = ({subprocess, encoding, buffer, maxBuffer, lines, stripFinalNewline, verboseInfo, streamInfo}) => subprocess.stdio.map((stream, fdNumber) => waitForSubprocessStream({\n\tstream,\n\tfdNumber,\n\tencoding,\n\tbuffer: buffer[fdNumber],\n\tmaxBuffer: maxBuffer[fdNumber],\n\tlines: lines[fdNumber],\n\tallMixed: false,\n\tstripFinalNewline,\n\tverboseInfo,\n\tstreamInfo,\n}));\n\n// Read the contents of `subprocess.std*` or `subprocess.all` and|or wait for its completion\nexport const waitForSubprocessStream = async ({stream, fdNumber, encoding, buffer, maxBuffer, lines, allMixed, stripFinalNewline, verboseInfo, streamInfo}) => {\n\tif (!stream) {\n\t\treturn;\n\t}\n\n\tconst onStreamEnd = waitForStream(stream, fdNumber, streamInfo);\n\tif (isInputFileDescriptor(streamInfo, fdNumber)) {\n\t\tawait onStreamEnd;\n\t\treturn;\n\t}\n\n\tconst [output] = await Promise.all([\n\t\tgetStreamOutput({\n\t\t\tstream,\n\t\t\tonStreamEnd,\n\t\t\tfdNumber,\n\t\t\tencoding,\n\t\t\tbuffer,\n\t\t\tmaxBuffer,\n\t\t\tlines,\n\t\t\tallMixed,\n\t\t\tstripFinalNewline,\n\t\t\tverboseInfo,\n\t\t\tstreamInfo,\n\t\t}),\n\t\tonStreamEnd,\n\t]);\n\treturn output;\n};\n","import mergeStreams from '@sindresorhus/merge-streams';\nimport {waitForSubprocessStream} from './stdio.js';\n\n// `all` interleaves `stdout` and `stderr`\nexport const makeAllStream = ({stdout, stderr}, {all}) => all && (stdout || stderr)\n\t? mergeStreams([stdout, stderr].filter(Boolean))\n\t: undefined;\n\n// Read the contents of `subprocess.all` and|or wait for its completion\nexport const waitForAllStream = ({subprocess, all, encoding, buffer, maxBuffer, lines, stripFinalNewline, verboseInfo, streamInfo}) => waitForSubprocessStream({\n\t...getAllStream(subprocess, all, buffer),\n\tfdNumber: 'all',\n\tencoding,\n\tmaxBuffer: maxBuffer[1] + maxBuffer[2],\n\tlines: lines[1] || lines[2],\n\tallMixed: getAllMixed(subprocess, all),\n\tstripFinalNewline,\n\tverboseInfo,\n\tstreamInfo,\n});\n\nconst getAllStream = ({stdout, stderr}, all, [, bufferStdout, bufferStderr]) => {\n\tconst buffer = bufferStdout || bufferStderr;\n\tif (!buffer) {\n\t\treturn {stream: all, buffer};\n\t}\n\n\tif (!bufferStdout) {\n\t\treturn {stream: stderr, buffer};\n\t}\n\n\tif (!bufferStderr) {\n\t\treturn {stream: stdout, buffer};\n\t}\n\n\treturn {stream: all, buffer};\n};\n\n// When `subprocess.stdout` is in objectMode but not `subprocess.stderr` (or the opposite), we need to use both:\n// - `getStreamAsArray()` for the chunks in objectMode, to return as an array without changing each chunk\n// - `getStreamAsArrayBuffer()` or `getStream()` for the chunks not in objectMode, to convert them from Buffers to string or Uint8Array\n// We do this by emulating the Buffer -> string|Uint8Array conversion performed by `get-stream` with our own, which is identical.\nconst getAllMixed = ({stdout, stderr}, all) => all\n\t&& stdout\n\t&& stderr\n\t&& stdout.readableObjectMode !== stderr.readableObjectMode;\n","import {verboseLog, serializeVerboseMessage} from './log.js';\nimport {isFullVerbose} from './values.js';\n\n// When `verbose` is `'full'`, print IPC messages from the subprocess\nexport const shouldLogIpc = verboseInfo => isFullVerbose(verboseInfo, 'ipc');\n\nexport const logIpcOutput = (message, verboseInfo) => {\n\tconst verboseMessage = serializeVerboseMessage(message);\n\tverboseLog({\n\t\ttype: 'ipc',\n\t\tverboseMessage,\n\t\tfdNumber: 'ipc',\n\t\tverboseInfo,\n\t});\n};\n","import {checkIpcMaxBuffer} from '../io/max-buffer.js';\nimport {shouldLogIpc, logIpcOutput} from '../verbose/ipc.js';\nimport {getFdSpecificValue} from '../arguments/specific.js';\nimport {loopOnMessages} from './get-each.js';\n\n// Iterate through IPC messages sent by the subprocess\nexport const waitForIpcOutput = async ({\n\tsubprocess,\n\tbuffer: bufferArray,\n\tmaxBuffer: maxBufferArray,\n\tipc,\n\tipcOutput,\n\tverboseInfo,\n}) => {\n\tif (!ipc) {\n\t\treturn ipcOutput;\n\t}\n\n\tconst isVerbose = shouldLogIpc(verboseInfo);\n\tconst buffer = getFdSpecificValue(bufferArray, 'ipc');\n\tconst maxBuffer = getFdSpecificValue(maxBufferArray, 'ipc');\n\n\tfor await (const message of loopOnMessages({\n\t\tanyProcess: subprocess,\n\t\tchannel: subprocess.channel,\n\t\tisSubprocess: false,\n\t\tipc,\n\t\tshouldAwait: false,\n\t\treference: true,\n\t})) {\n\t\tif (buffer) {\n\t\t\tcheckIpcMaxBuffer(subprocess, ipcOutput, maxBuffer);\n\t\t\tipcOutput.push(message);\n\t\t}\n\n\t\tif (isVerbose) {\n\t\t\tlogIpcOutput(message, verboseInfo);\n\t\t}\n\t}\n\n\treturn ipcOutput;\n};\n\nexport const getBufferedIpcOutput = async (ipcOutputPromise, ipcOutput) => {\n\tawait Promise.allSettled([ipcOutputPromise]);\n\treturn ipcOutput;\n};\n","import {once} from 'node:events';\nimport {isStream as isNodeStream} from 'is-stream';\nimport {throwOnTimeout} from '../terminate/timeout.js';\nimport {throwOnCancel} from '../terminate/cancel.js';\nimport {throwOnGracefulCancel} from '../terminate/graceful.js';\nimport {isStandardStream} from '../utils/standard-stream.js';\nimport {TRANSFORM_TYPES} from '../stdio/type.js';\nimport {getBufferedData} from '../io/contents.js';\nimport {waitForIpcOutput, getBufferedIpcOutput} from '../ipc/buffer-messages.js';\nimport {sendIpcInput} from '../ipc/ipc-input.js';\nimport {waitForAllStream} from './all-async.js';\nimport {waitForStdioStreams} from './stdio.js';\nimport {waitForExit, waitForSuccessfulExit} from './exit-async.js';\nimport {waitForStream} from './wait-stream.js';\n\n// Retrieve result of subprocess: exit code, signal, error, streams (stdout/stderr/all)\nexport const waitForSubprocessResult = async ({\n\tsubprocess,\n\tkill,\n\tall,\n\toptions: {\n\t\tencoding,\n\t\tbuffer,\n\t\tmaxBuffer,\n\t\tlines,\n\t\ttimeoutDuration: timeout,\n\t\tcancelSignal,\n\t\tgracefulCancel,\n\t\tforceKillAfterDelay,\n\t\tstripFinalNewline,\n\t\tipc,\n\t\tipcInput,\n\t},\n\tcontext,\n\tverboseInfo,\n\tfileDescriptors,\n\toriginalStreams,\n\tonInternalError,\n\tcontroller,\n}) => {\n\tconst exitPromise = waitForExit(subprocess, context);\n\tconst streamInfo = {\n\t\toriginalStreams,\n\t\tfileDescriptors,\n\t\tsubprocess,\n\t\texitPromise,\n\t\tpropagating: false,\n\t};\n\n\tconst stdioPromises = waitForStdioStreams({\n\t\tsubprocess,\n\t\tencoding,\n\t\tbuffer,\n\t\tmaxBuffer,\n\t\tlines,\n\t\tstripFinalNewline,\n\t\tverboseInfo,\n\t\tstreamInfo,\n\t});\n\tconst allPromise = waitForAllStream({\n\t\tsubprocess,\n\t\tall,\n\t\tencoding,\n\t\tbuffer,\n\t\tmaxBuffer,\n\t\tlines,\n\t\tstripFinalNewline,\n\t\tverboseInfo,\n\t\tstreamInfo,\n\t});\n\tconst ipcOutput = [];\n\tconst ipcOutputPromise = waitForIpcOutput({\n\t\tsubprocess,\n\t\tbuffer,\n\t\tmaxBuffer,\n\t\tipc,\n\t\tipcOutput,\n\t\tverboseInfo,\n\t});\n\tconst originalPromises = waitForOriginalStreams(originalStreams, subprocess, streamInfo);\n\tconst customStreamsEndPromises = waitForCustomStreamsEnd(fileDescriptors, streamInfo);\n\n\ttry {\n\t\treturn await Promise.race([\n\t\t\tPromise.all([\n\t\t\t\t{},\n\t\t\t\twaitForSuccessfulExit(exitPromise),\n\t\t\t\tPromise.all(stdioPromises),\n\t\t\t\tallPromise,\n\t\t\t\tipcOutputPromise,\n\t\t\t\tsendIpcInput(subprocess, ipcInput, ipc),\n\t\t\t\t...originalPromises,\n\t\t\t\t...customStreamsEndPromises,\n\t\t\t]),\n\t\t\tonInternalError,\n\t\t\tthrowOnSubprocessError(subprocess, controller),\n\t\t\t...throwOnTimeout(kill, timeout, context, controller),\n\t\t\t...throwOnCancel({\n\t\t\t\tkill,\n\t\t\t\tcancelSignal,\n\t\t\t\tgracefulCancel,\n\t\t\t\tcontext,\n\t\t\t\tcontroller,\n\t\t\t}),\n\t\t\t...throwOnGracefulCancel({\n\t\t\t\tsubprocess,\n\t\t\t\tkill,\n\t\t\t\tcancelSignal,\n\t\t\t\tgracefulCancel,\n\t\t\t\tforceKillAfterDelay,\n\t\t\t\tcontext,\n\t\t\t\tcontroller,\n\t\t\t}),\n\t\t]);\n\t} catch (error) {\n\t\tcontext.terminationReason ??= 'other';\n\t\treturn Promise.all([\n\t\t\t{error},\n\t\t\texitPromise,\n\t\t\tPromise.all(stdioPromises.map(stdioPromise => getBufferedData(stdioPromise))),\n\t\t\tgetBufferedData(allPromise),\n\t\t\tgetBufferedIpcOutput(ipcOutputPromise, ipcOutput),\n\t\t\tPromise.allSettled(originalPromises),\n\t\t\tPromise.allSettled(customStreamsEndPromises),\n\t\t]);\n\t}\n};\n\n// Transforms replace `subprocess.std*`, which means they are not exposed to users.\n// However, we still want to wait for their completion.\nconst waitForOriginalStreams = (originalStreams, subprocess, streamInfo) =>\n\toriginalStreams.map((stream, fdNumber) => stream === subprocess.stdio[fdNumber]\n\t\t? undefined\n\t\t: waitForStream(stream, fdNumber, streamInfo));\n\n// Some `stdin`/`stdout`/`stderr` options create a stream, e.g. when passing a file path.\n// The `.pipe()` method automatically ends that stream when `subprocess` ends.\n// This makes sure we wait for the completion of those streams, in order to catch any error.\nconst waitForCustomStreamsEnd = (fileDescriptors, streamInfo) => fileDescriptors.flatMap(({stdioItems}, fdNumber) => stdioItems\n\t.filter(({value, stream = value}) => isNodeStream(stream, {checkOpen: false}) && !isStandardStream(stream))\n\t.map(({type, value, stream = value}) => waitForStream(stream, fdNumber, streamInfo, {\n\t\tisSameDirection: TRANSFORM_TYPES.has(type),\n\t\tstopOnExit: type === 'native',\n\t})));\n\n// Fails when the subprocess emits an `error` event\nconst throwOnSubprocessError = async (subprocess, {signal}) => {\n\tconst [error] = await once(subprocess, 'error', {signal});\n\tthrow error;\n};\n","import {Writable} from 'node:stream';\nimport {callbackify} from 'node:util';\nimport {getToStream} from '../arguments/fd-options.js';\nimport {isStreamAbort} from '../resolve/wait-stream.js';\nimport {addConcurrentStream, waitForConcurrentStreams} from './concurrent.js';\nimport {\n\tsafeWaitForSubprocessStdout,\n\twaitForSubprocessStdin,\n\twaitForSubprocess,\n\tdestroyOtherStream,\n} from './shared.js';\n\n// Create a `Writable` stream that forwards to `stdin` and awaits the subprocess\nexport const createWritable = ({subprocess, concurrentStreams}, {to} = {}) => {\n\tconst {subprocessStdin, waitWritableFinal, waitWritableDestroy} = getSubprocessStdin(subprocess, to, concurrentStreams);\n\tconst writable = new Writable({\n\t\t...getWritableMethods(subprocessStdin, subprocess, waitWritableFinal),\n\t\tdestroy: callbackify(onWritableDestroy.bind(undefined, {\n\t\t\tsubprocessStdin,\n\t\t\tsubprocess,\n\t\t\twaitWritableFinal,\n\t\t\twaitWritableDestroy,\n\t\t})),\n\t\thighWaterMark: subprocessStdin.writableHighWaterMark,\n\t\tobjectMode: subprocessStdin.writableObjectMode,\n\t});\n\tonStdinFinished(subprocessStdin, writable, undefined, subprocess);\n\treturn writable;\n};\n\n// Retrieve `stdin` (or other stream depending on `to`)\nexport const getSubprocessStdin = (subprocess, to, concurrentStreams) => {\n\tconst subprocessStdin = getToStream(subprocess, to);\n\tconst waitWritableFinal = addConcurrentStream(concurrentStreams, subprocessStdin, 'writableFinal');\n\tconst waitWritableDestroy = addConcurrentStream(concurrentStreams, subprocessStdin, 'writableDestroy');\n\treturn {subprocessStdin, waitWritableFinal, waitWritableDestroy};\n};\n\nexport const getWritableMethods = (subprocessStdin, subprocess, waitWritableFinal) => ({\n\twrite: onWrite.bind(undefined, subprocessStdin),\n\tfinal: callbackify(onWritableFinal.bind(undefined, subprocessStdin, subprocess, waitWritableFinal)),\n});\n\n// Forwards data from `writable` to `stdin`\nconst onWrite = (subprocessStdin, chunk, encoding, done) => {\n\tif (subprocessStdin.write(chunk, encoding)) {\n\t\tdone();\n\t} else {\n\t\tsubprocessStdin.once('drain', done);\n\t}\n};\n\n// Ensures that the writable `final` and readable `end` events awaits the subprocess.\n// Like this, any subprocess failure is propagated as a stream `error` event, instead of being lost.\n// The user does not need to `await` the subprocess anymore, but now needs to await the stream completion or error.\n// When multiple writables are targeting the same stream, they wait for each other, unless the subprocess ends first.\nconst onWritableFinal = async (subprocessStdin, subprocess, waitWritableFinal) => {\n\tif (!await waitForConcurrentStreams(waitWritableFinal, subprocess)) {\n\t\treturn;\n\t}\n\n\tif (subprocessStdin.writable) {\n\t\tsubprocessStdin.end();\n\t}\n\n\tawait subprocess;\n};\n\n// When `subprocess.stdin` ends/aborts/errors, do the same on `writable`.\nexport const onStdinFinished = async (subprocessStdin, writable, subprocessStdout, subprocess) => {\n\ttry {\n\t\tawait waitForSubprocessStdin(subprocessStdin);\n\t\tawait subprocess;\n\t\tif (writable.writable) {\n\t\t\twritable.end();\n\t\t}\n\t} catch (error) {\n\t\tawait safeWaitForSubprocessStdout(subprocessStdout);\n\t\tdestroyOtherWritable(writable, await getSubprocessError(subprocess, error));\n\t}\n};\n\nconst getSubprocessError = async (subprocess, error) => {\n\tif (!shouldUseSubprocessError(error)) {\n\t\treturn error;\n\t}\n\n\ttry {\n\t\tawait subprocess;\n\t} catch (subprocessError) {\n\t\treturn subprocessError;\n\t}\n\n\treturn error;\n};\n\nconst shouldUseSubprocessError = error => error === undefined\n\t|| isStreamAbort(error);\n\n// When `writable` aborts/errors, do the same on `subprocess.stdin`\nexport const onWritableDestroy = async ({subprocessStdin, subprocess, waitWritableFinal, waitWritableDestroy}, error) => {\n\tawait waitForConcurrentStreams(waitWritableFinal, subprocess);\n\tif (await waitForConcurrentStreams(waitWritableDestroy, subprocess)) {\n\t\tdestroyOtherWritable(subprocessStdin, error);\n\t\tawait waitForSubprocess(subprocess, error);\n\t}\n};\n\nconst destroyOtherWritable = (stream, error) => {\n\tdestroyOtherStream(stream, stream.writable, error);\n};\n","import {Duplex} from 'node:stream';\nimport {callbackify} from 'node:util';\nimport {BINARY_ENCODINGS} from '../arguments/encoding-option.js';\nimport {\n\tgetSubprocessStdout,\n\tgetReadableOptions,\n\tgetReadableMethods,\n\tonStdoutFinished,\n\tonReadableDestroy,\n} from './readable.js';\nimport {\n\tgetSubprocessStdin,\n\tgetWritableMethods,\n\tonStdinFinished,\n\tonWritableDestroy,\n} from './writable.js';\n\n// Create a `Duplex` stream combining both `subprocess.readable()` and `subprocess.writable()`\nexport const createDuplex = ({subprocess, concurrentStreams, encoding}, {from, to, binary: binaryOption = true, preserveNewlines = true} = {}) => {\n\tconst binary = binaryOption || BINARY_ENCODINGS.has(encoding);\n\tconst {subprocessStdout, waitReadableDestroy} = getSubprocessStdout(subprocess, from, concurrentStreams);\n\tconst {subprocessStdin, waitWritableFinal, waitWritableDestroy} = getSubprocessStdin(subprocess, to, concurrentStreams);\n\tconst {readableEncoding, readableObjectMode, readableHighWaterMark} = getReadableOptions(subprocessStdout, binary);\n\tconst {read, onStdoutDataDone} = getReadableMethods({\n\t\tsubprocessStdout,\n\t\tsubprocess,\n\t\tbinary,\n\t\tencoding,\n\t\tpreserveNewlines,\n\t});\n\tconst duplex = new Duplex({\n\t\tread,\n\t\t...getWritableMethods(subprocessStdin, subprocess, waitWritableFinal),\n\t\tdestroy: callbackify(onDuplexDestroy.bind(undefined, {\n\t\t\tsubprocessStdout,\n\t\t\tsubprocessStdin,\n\t\t\tsubprocess,\n\t\t\twaitReadableDestroy,\n\t\t\twaitWritableFinal,\n\t\t\twaitWritableDestroy,\n\t\t})),\n\t\treadableHighWaterMark,\n\t\twritableHighWaterMark: subprocessStdin.writableHighWaterMark,\n\t\treadableObjectMode,\n\t\twritableObjectMode: subprocessStdin.writableObjectMode,\n\t\tencoding: readableEncoding,\n\t});\n\tonStdoutFinished({\n\t\tsubprocessStdout,\n\t\tonStdoutDataDone,\n\t\treadable: duplex,\n\t\tsubprocess,\n\t\tsubprocessStdin,\n\t});\n\tonStdinFinished(subprocessStdin, duplex, subprocessStdout, subprocess);\n\treturn duplex;\n};\n\nconst onDuplexDestroy = async ({subprocessStdout, subprocessStdin, subprocess, waitReadableDestroy, waitWritableFinal, waitWritableDestroy}, error) => {\n\tawait Promise.all([\n\t\tonReadableDestroy({subprocessStdout, subprocess, waitReadableDestroy}, error),\n\t\tonWritableDestroy({\n\t\t\tsubprocessStdin,\n\t\t\tsubprocess,\n\t\t\twaitWritableFinal,\n\t\t\twaitWritableDestroy,\n\t\t}, error),\n\t]);\n};\n","import {initializeConcurrentStreams} from './concurrent.js';\nimport {createReadable} from './readable.js';\nimport {createWritable} from './writable.js';\nimport {createDuplex} from './duplex.js';\nimport {createReadableStream, createWritableStream, createTransformStream} from './web.js';\nimport {createIterable} from './iterable.js';\n\n// Add methods to convert the subprocess to a stream or iterable\nexport const addConvertedStreams = (subprocess, {encoding}) => {\n\tconst concurrentStreams = initializeConcurrentStreams();\n\tsubprocess.readable = createReadable.bind(undefined, {subprocess, concurrentStreams, encoding});\n\tsubprocess.writable = createWritable.bind(undefined, {subprocess, concurrentStreams});\n\tsubprocess.duplex = createDuplex.bind(undefined, {subprocess, concurrentStreams, encoding});\n\tsubprocess.readableStream = createReadableStream.bind(undefined, subprocess);\n\tsubprocess.writableStream = createWritableStream.bind(undefined, subprocess);\n\tsubprocess.transformStream = createTransformStream.bind(undefined, subprocess);\n\tsubprocess.iterable = createIterable.bind(undefined, subprocess, encoding);\n\tsubprocess[Symbol.asyncIterator] = createIterable.bind(undefined, subprocess, encoding, {});\n};\n","// The return value is a native Promise with Execa-specific properties.\nexport const mergePromise = (promise, properties) => Object.assign(promise, properties);\n","import {setMaxListeners} from 'node:events';\nimport {spawn} from 'node:child_process';\nimport {MaxBufferError} from 'get-stream';\nimport {handleCommand} from '../arguments/command.js';\nimport {normalizeOptions} from '../arguments/options.js';\nimport {SUBPROCESS_OPTIONS} from '../arguments/fd-options.js';\nimport {concatenateShell} from '../arguments/shell.js';\nimport {addIpcMethods} from '../ipc/methods.js';\nimport {setIpcSubprocessOptions} from '../ipc/outgoing.js';\nimport {makeError, makeSuccessResult} from '../return/result.js';\nimport {handleResult} from '../return/reject.js';\nimport {handleEarlyError} from '../return/early-error.js';\nimport {handleStdioAsync} from '../stdio/handle-async.js';\nimport {stripNewline} from '../io/strip-newline.js';\nimport {pipeOutputAsync} from '../io/output-async.js';\nimport {subprocessKill} from '../terminate/kill.js';\nimport {getSpawnOptions, getKillFunction} from '../terminate/kill-descendants.js';\nimport {cleanupOnExit} from '../terminate/cleanup.js';\nimport {pipeToSubprocess} from '../pipe/setup.js';\nimport {makeAllStream} from '../resolve/all-async.js';\nimport {waitForSubprocessResult} from '../resolve/wait-subprocess.js';\nimport {addConvertedStreams} from '../convert/add.js';\nimport {createDeferred} from '../utils/deferred.js';\nimport {mergePromise} from './promise.js';\n\n// Main shared logic for all async methods: `execa()`, `$`, `execaNode()`\nexport const execaCoreAsync = (rawFile, rawArguments, rawOptions, createNested) => {\n\tconst {file, commandArguments, command, escapedCommand, startTime, verboseInfo, options, fileDescriptors} = handleAsyncArguments(rawFile, rawArguments, rawOptions);\n\tconst {subprocess: nodeChildProcess, promise, kill, all, convertedStreams} = spawnSubprocessAsync({\n\t\tfile,\n\t\tcommandArguments,\n\t\toptions,\n\t\tstartTime,\n\t\tverboseInfo,\n\t\tcommand,\n\t\tescapedCommand,\n\t\tfileDescriptors,\n\t});\n\tconst subprocess = getSubprocessPromise({\n\t\tpromise,\n\t\tnodeChildProcess,\n\t\tkill,\n\t\tall,\n\t\tconvertedStreams,\n\t\toptions,\n\t});\n\tsubprocess.pipe = pipeToSubprocess.bind(undefined, {\n\t\tsource: subprocess,\n\t\tsourcePromise: promise,\n\t\tboundOptions: {},\n\t\tcreateNested,\n\t});\n\tSUBPROCESS_OPTIONS.set(subprocess, {options, fileDescriptors});\n\treturn subprocess;\n};\n\n// Compute arguments to pass to `child_process.spawn()`\nconst handleAsyncArguments = (rawFile, rawArguments, rawOptions) => {\n\tconst {command, escapedCommand, startTime, verboseInfo} = handleCommand(rawFile, rawArguments, rawOptions);\n\tconst {file, commandArguments, options: normalizedOptions} = normalizeOptions(rawFile, rawArguments, rawOptions);\n\tconst options = handleAsyncOptions(normalizedOptions);\n\tconst fileDescriptors = handleStdioAsync(options, verboseInfo);\n\treturn {\n\t\tfile,\n\t\tcommandArguments,\n\t\tcommand,\n\t\tescapedCommand,\n\t\tstartTime,\n\t\tverboseInfo,\n\t\toptions,\n\t\tfileDescriptors,\n\t};\n};\n\n// Options normalization logic specific to async methods.\n// Prevent passing the `timeout` option directly to `child_process.spawn()`.\nconst handleAsyncOptions = ({timeout, signal, ...options}) => {\n\tif (signal !== undefined) {\n\t\tthrow new TypeError('The \"signal\" option has been renamed to \"cancelSignal\" instead.');\n\t}\n\n\treturn {...options, timeoutDuration: timeout};\n};\n\nconst spawnSubprocessAsync = ({file, commandArguments, options, startTime, verboseInfo, command, escapedCommand, fileDescriptors}) => {\n\tlet subprocess;\n\ttry {\n\t\tsubprocess = spawn(...concatenateShell(file, commandArguments, getSpawnOptions(options)));\n\t} catch (error) {\n\t\treturn handleEarlyError({\n\t\t\terror,\n\t\t\tcommand,\n\t\t\tescapedCommand,\n\t\t\tfileDescriptors,\n\t\t\toptions,\n\t\t\tstartTime,\n\t\t\tverboseInfo,\n\t\t});\n\t}\n\n\tconst controller = new AbortController();\n\tsetMaxListeners(Infinity, controller.signal);\n\n\tconst originalStreams = [...subprocess.stdio];\n\tpipeOutputAsync(subprocess, fileDescriptors, controller);\n\tsetIpcSubprocessOptions(subprocess, options);\n\n\tconst context = {};\n\tconst onInternalError = createDeferred();\n\tconst kill = subprocessKill.bind(undefined, {\n\t\tkill: getKillFunction(subprocess, options),\n\t\toptions,\n\t\tonInternalError,\n\t\tcontext,\n\t\tcontroller,\n\t});\n\tcleanupOnExit(kill, options, controller);\n\tconst all = makeAllStream(subprocess, options);\n\n\tconst promise = handlePromise({\n\t\tsubprocess,\n\t\tkill,\n\t\tall,\n\t\toptions,\n\t\tstartTime,\n\t\tverboseInfo,\n\t\tfileDescriptors,\n\t\toriginalStreams,\n\t\tcommand,\n\t\tescapedCommand,\n\t\tcontext,\n\t\tonInternalError,\n\t\tcontroller,\n\t});\n\treturn {\n\t\tsubprocess,\n\t\tpromise,\n\t\tkill,\n\t\tall,\n\t};\n};\n\nconst getSubprocessPromise = ({promise, nodeChildProcess, kill, all, convertedStreams, options}) => {\n\tconst subprocess = mergePromise(promise, getSubprocessProperties(nodeChildProcess, all));\n\tsubprocess.kill = kill ?? subprocess.kill;\n\tif (convertedStreams === undefined) {\n\t\taddConvertedStreams(subprocess, options);\n\t} else {\n\t\tObject.assign(subprocess, convertedStreams);\n\t}\n\n\taddIpcMethods(subprocess, nodeChildProcess, options);\n\treturn subprocess;\n};\n\nconst getSubprocessProperties = (nodeChildProcess, all) => ({\n\tnodeChildProcess,\n\tpid: nodeChildProcess.pid,\n\tstdin: nodeChildProcess.stdin,\n\tstdout: nodeChildProcess.stdout,\n\tstderr: nodeChildProcess.stderr,\n\tstdio: nodeChildProcess.stdio,\n\tall,\n\tkill: nodeChildProcess.kill.bind(nodeChildProcess),\n});\n\n// Asynchronous logic, as opposed to the previous logic which can be run synchronously, i.e. can be returned to user right away\nconst handlePromise = async ({subprocess, kill, all: allStream, options, startTime, verboseInfo, fileDescriptors, originalStreams, command, escapedCommand, context, onInternalError, controller}) => {\n\tconst [\n\t\terrorInfo,\n\t\t[exitCode, signal],\n\t\tstdioResults,\n\t\tallResult,\n\t\tipcOutput,\n\t] = await waitForSubprocessResult({\n\t\tsubprocess,\n\t\tkill,\n\t\tall: allStream,\n\t\toptions,\n\t\tcontext,\n\t\tverboseInfo,\n\t\tfileDescriptors,\n\t\toriginalStreams,\n\t\tonInternalError,\n\t\tcontroller,\n\t});\n\tcontroller.abort();\n\tonInternalError.resolve();\n\n\tconst stdio = stdioResults.map((stdioResult, fdNumber) => stripNewline(stdioResult, options, fdNumber));\n\tconst all = stripNewline(allResult, options, 'all');\n\tconst result = getAsyncResult({\n\t\terrorInfo,\n\t\texitCode,\n\t\tsignal,\n\t\tstdio,\n\t\tall,\n\t\tipcOutput,\n\t\tcontext,\n\t\toptions,\n\t\tcommand,\n\t\tescapedCommand,\n\t\tstartTime,\n\t});\n\treturn handleResult(result, verboseInfo, options);\n};\n\nconst getAsyncResult = ({errorInfo, exitCode, signal, stdio, all, ipcOutput, context, options, command, escapedCommand, startTime}) => 'error' in errorInfo\n\t? makeError({\n\t\terror: errorInfo.error,\n\t\tcommand,\n\t\tescapedCommand,\n\t\ttimedOut: context.terminationReason === 'timeout',\n\t\tisCanceled: context.terminationReason === 'cancel' || context.terminationReason === 'gracefulCancel',\n\t\tisGracefullyCanceled: context.terminationReason === 'gracefulCancel',\n\t\tisMaxBuffer: errorInfo.error instanceof MaxBufferError,\n\t\tisForcefullyTerminated: context.isForcefullyTerminated,\n\t\texitCode,\n\t\tsignal,\n\t\tstdio,\n\t\tall,\n\t\tipcOutput,\n\t\toptions,\n\t\tstartTime,\n\t\tisSync: false,\n\t})\n\t: makeSuccessResult({\n\t\tcommand,\n\t\tescapedCommand,\n\t\tstdio,\n\t\tall,\n\t\tipcOutput,\n\t\toptions,\n\t\tstartTime,\n\t});\n","import isPlainObject from 'is-plain-obj';\nimport {FD_SPECIFIC_OPTIONS} from '../arguments/specific.js';\n\n// Deep merge specific options like `env`. Shallow merge the other ones.\n// Use spread (which only copies own properties) to safely read from boundOptions without prototype pollution\nexport const mergeOptions = (boundOptions, options) => {\n\tconst safeBoundOptions = {__proto__: null, ...boundOptions};\n\tconst mergedOptions = Object.fromEntries(Object.entries(options).map(([optionName, optionValue]) => [\n\t\toptionName,\n\t\tmergeOption(optionName, safeBoundOptions[optionName], optionValue),\n\t]));\n\treturn {...safeBoundOptions, ...mergedOptions};\n};\n\nconst mergeOption = (optionName, boundOptionValue, optionValue) => {\n\tif (DEEP_OPTIONS.has(optionName) && isPlainObject(boundOptionValue) && isPlainObject(optionValue)) {\n\t\treturn {...boundOptionValue, ...optionValue};\n\t}\n\n\treturn optionValue;\n};\n\nconst DEEP_OPTIONS = new Set(['env', ...FD_SPECIFIC_OPTIONS]);\n","import isPlainObject from 'is-plain-obj';\nimport {normalizeParameters} from './parameters.js';\nimport {isTemplateString, parseTemplates} from './template.js';\nimport {execaCoreSync} from './main-sync.js';\nimport {execaCoreAsync} from './main-async.js';\nimport {mergeOptions} from './bind.js';\n\n// Wraps every exported methods to provide the following features:\n// - template string syntax: execa`command argument`\n// - options binding: boundExeca = execa(options)\n// - optional argument/options: execa(file), execa(file, args), execa(file, options), execa(file, args, options)\n// `mapArguments()` and `setBoundExeca()` allows for method-specific logic.\nexport const createExeca = (mapArguments, boundOptions, deepOptions, setBoundExeca) => {\n\tconst createNested = (mapArguments, boundOptions, setBoundExeca) => createExeca(mapArguments, boundOptions, deepOptions, setBoundExeca);\n\tconst boundExeca = (...execaArguments) => callBoundExeca({\n\t\tmapArguments,\n\t\tdeepOptions,\n\t\tboundOptions,\n\t\tsetBoundExeca,\n\t\tcreateNested,\n\t}, ...execaArguments);\n\n\tif (setBoundExeca !== undefined) {\n\t\tsetBoundExeca(boundExeca, createNested, boundOptions);\n\t}\n\n\treturn boundExeca;\n};\n\nconst callBoundExeca = ({mapArguments, deepOptions = {}, boundOptions = {}, setBoundExeca, createNested}, firstArgument, ...nextArguments) => {\n\tif (isPlainObject(firstArgument)) {\n\t\treturn createNested(mapArguments, mergeOptions(boundOptions, firstArgument), setBoundExeca);\n\t}\n\n\tconst {file, commandArguments, options, isSync} = parseArguments({\n\t\tmapArguments,\n\t\tfirstArgument,\n\t\tnextArguments,\n\t\tdeepOptions,\n\t\tboundOptions,\n\t});\n\treturn isSync\n\t\t? execaCoreSync(file, commandArguments, options)\n\t\t: execaCoreAsync(file, commandArguments, options, createNested);\n};\n\nconst parseArguments = ({mapArguments, firstArgument, nextArguments, deepOptions, boundOptions}) => {\n\tconst callArguments = isTemplateString(firstArgument)\n\t\t? parseTemplates(firstArgument, nextArguments)\n\t\t: [firstArgument, ...nextArguments];\n\tconst [initialFile, initialArguments, initialOptions] = normalizeParameters(...callArguments);\n\tconst mergedOptions = mergeOptions(mergeOptions(deepOptions, boundOptions), initialOptions);\n\tconst {\n\t\toptions = mergedOptions,\n\t\tisSync = false,\n\t} = mapArguments({options: mergedOptions});\n\treturn {\n\t\tfile: initialFile,\n\t\tcommandArguments: initialArguments,\n\t\toptions,\n\t\tisSync,\n\t};\n};\n","// Sets `$.sync` and `$.s`\nexport const setScriptSync = (boundExeca, createNested, boundOptions) => {\n\tboundExeca.sync = createNested(mapScriptSync, boundOptions);\n\tboundExeca.s = boundExeca.sync;\n};\n\n// Main logic for `$`\nexport const mapScriptAsync = ({options}) => getScriptOptions(options);\n\n// Main logic for `$.sync`\nconst mapScriptSync = ({options}) => ({...getScriptOptions(options), isSync: true});\n\n// `$` is like `execa` but with script-friendly options: `{stdin: 'inherit', preferLocal: true}`\nconst getScriptOptions = options => ({options: {...getScriptStdinOption(options), ...options}});\n\nconst getScriptStdinOption = ({input, inputFile, stdio}) => input === undefined && inputFile === undefined && stdio === undefined\n\t? {stdin: 'inherit'}\n\t: {};\n\n// When using $(...).pipe(...), most script-friendly options should apply to both commands.\n// However, some options (like `stdin: 'inherit'`) would create issues with piping, i.e. cannot be deep.\nexport const deepScriptOptions = {preferLocal: true};\n","import {createExeca} from './lib/methods/create.js';\nimport {mapNode} from './lib/methods/node.js';\nimport {mapScriptAsync, setScriptSync, deepScriptOptions} from './lib/methods/script.js';\nimport {getIpcExport} from './lib/ipc/methods.js';\n\nexport {parseCommandString} from './lib/methods/command.js';\nexport {ExecaError, ExecaSyncError} from './lib/return/final-error.js';\n\nexport const execa = createExeca(() => ({}));\nexport const execaSync = createExeca(() => ({isSync: true}));\nexport const execaNode = createExeca(mapNode);\nexport const $ = createExeca(mapScriptAsync, {}, deepScriptOptions, setScriptSync);\n\nconst {\n\tsendMessage,\n\tgetOneMessage,\n\tgetEachMessage,\n\tgetCancelSignal,\n} = getIpcExport();\nexport {\n\tsendMessage,\n\tgetOneMessage,\n\tgetEachMessage,\n\tgetCancelSignal,\n};\n","import { execa, execaSync } from \"execa\";\nimport type { Options, SyncOptions } from \"execa\";\nimport { IS_WINDOWS } from \"../../config/config\";\n\ntype RunOptions = Record<string, unknown>;\n\nexport type CliSyncResult = ReturnType<typeof execaSync>;\n\nexport interface CliResult extends Promise<unknown> {\n toStream(opt?: RunOptions): ReturnType<typeof execa>;\n cwd(cwd: string): CliResult;\n sync(opt?: RunOptions): CliSyncResult;\n getRaw(opt?: RunOptions): string;\n get(opt?: RunOptions): string;\n}\n\nexport class Cli {\n constructor(readonly cmd: string) {}\n\n sync(...args: string[]): CliSyncResult {\n return (Cli.run(this.cmd, args) as CliResult).sync();\n }\n\n run(...args: string[]): CliResult {\n return Cli.run(this.cmd, args);\n }\n\n /** Run synchronously and return stdout. Throws on non-zero exit. */\n get(...args: string[]): string {\n return execaSync(this.cmd, args, { reject: true }).stdout.trim();\n }\n\n /** Run synchronously, return stdout or null if the command fails. */\n tryGet(...args: string[]): string | null {\n try {\n return this.get(...args);\n } catch {\n return null;\n }\n }\n\n /** Returns true when the command is available in PATH. */\n available(): boolean {\n const checker = IS_WINDOWS ? \"where\" : \"which\";\n try {\n execaSync(checker, [this.cmd], { reject: true });\n return true;\n } catch {\n return false;\n }\n }\n\n static run(cmd: string, args: string[] = [], options: RunOptions = {}): CliResult {\n const build = (opt: RunOptions = {}): Options => ({ cwd: process.cwd(), ...opt, ...options }) as Options;\n\n let isPromise = true;\n\n const promise = new Promise<void>((resolve, reject) => {\n setTimeout(async () => {\n if (isPromise) {\n try {\n await execa(cmd, args, build({ stdio: \"inherit\" }));\n resolve();\n } catch (err) {\n reject(err);\n }\n } else {\n resolve();\n }\n }, 10);\n });\n\n const cliResult = promise as unknown as CliResult;\n\n cliResult.toStream = (opt?: RunOptions) => {\n isPromise = false;\n return execa(cmd, args, build(opt));\n };\n\n cliResult.cwd = (cwd: string) => {\n options = { ...options, cwd };\n return cliResult;\n };\n\n cliResult.sync = (opt?: RunOptions) => {\n isPromise = false;\n return execaSync(cmd, args, { cwd: process.cwd(), stdio: \"inherit\", ...options, ...opt } as SyncOptions);\n };\n\n cliResult.getRaw = (opt?: RunOptions): string => {\n isPromise = false;\n return Cli.getRaw(cmd, args, { cwd: process.cwd(), ...options, ...opt });\n };\n\n cliResult.get = cliResult.getRaw;\n\n return cliResult;\n }\n\n static getRaw(cmd: string, args: string[], options?: RunOptions): string {\n const result = execaSync(cmd, args, { encoding: \"utf8\", ...options } as SyncOptions);\n return (result.stdout as string).trim();\n }\n}\n","import { Cli } from \"./cli\";\n\nexport class ClaudeCli extends Cli {\n constructor() {\n super(\"claude\");\n }\n\n version(): string | null {\n return this.tryGet(\"--version\");\n }\n\n listMcp(): string {\n return this.tryGet(\"mcp\", \"list\") ?? \"\";\n }\n\n hasMcp(name: string): boolean {\n const list = this.listMcp();\n return list.includes(name) || list.includes(`plugin:${name}`);\n }\n\n /** Adds an MCP via `claude mcp add-json`. Returns false if already present and not reinstalling. */\n addMcp(name: string, jsonConfig: string, scope = \"user\", reinstall = false): boolean {\n if (!reinstall && this.hasMcp(name)) {\n return false;\n }\n if (reinstall && this.hasMcp(name)) {\n this.removeMcp(name);\n }\n this.tryGet(\"mcp\", \"add-json\", \"--scope\", scope, name, jsonConfig);\n return true;\n }\n\n /** Removes an MCP. Returns true if removed, false if not found. */\n removeMcp(name: string): boolean {\n if (!this.hasMcp(name)) {\n return false;\n }\n this.tryGet(\"mcp\", \"remove\", name);\n return true;\n }\n\n setDefaultModel(model: string): void {\n this.tryGet(\"config\", \"set\", \"--global\", \"model\", model);\n }\n\n /**\n * Installs a marketplace plugin and authenticates it.\n * Runs with inherited stdio so the user can complete OAuth interactively.\n */\n async addMarketplace(plugin: string): Promise<void> {\n await this.run(\"plugin\", \"install\", plugin);\n await this.run(\"mcp\", \"login\", `plugin:${plugin.split(\"@\")[0]}:${plugin.split(\"@\")[0]}`);\n }\n}\n\nexport const claude = new ClaudeCli();\n","/*!\n * Copyright (c) Squirrel Chat et al., All rights reserved.\n * SPDX-License-Identifier: BSD-3-Clause\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors\n * may be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nlet DATE_TIME_RE = /^(\\d{4}-\\d{2}-\\d{2})?[T ]?(?:(\\d{2}):\\d{2}(?::\\d{2}(?:\\.\\d+)?)?)?(Z|[-+]\\d{2}:\\d{2})?$/i;\nexport class TomlDate extends Date {\n #hasDate = false;\n #hasTime = false;\n #offset = null;\n constructor(date) {\n let hasDate = true;\n let hasTime = true;\n let offset = 'Z';\n if (typeof date === 'string') {\n let match = date.match(DATE_TIME_RE);\n if (match) {\n if (!match[1]) {\n hasDate = false;\n date = `0000-01-01T${date}`;\n }\n hasTime = !!match[2];\n // Make sure to use T instead of a space. Breaks in case of extreme values otherwise.\n hasTime && date[10] === ' ' && (date = date.replace(' ', 'T'));\n // Do not allow rollover hours.\n if (match[2] && +match[2] > 23) {\n date = '';\n }\n else {\n offset = match[3] || null;\n date = date.toUpperCase();\n if (!offset && hasTime)\n date += 'Z';\n }\n }\n else {\n date = '';\n }\n }\n super(date);\n if (!isNaN(this.getTime())) {\n this.#hasDate = hasDate;\n this.#hasTime = hasTime;\n this.#offset = offset;\n }\n }\n isDateTime() {\n return this.#hasDate && this.#hasTime;\n }\n isLocal() {\n return !this.#hasDate || !this.#hasTime || !this.#offset;\n }\n isDate() {\n return this.#hasDate && !this.#hasTime;\n }\n isTime() {\n return this.#hasTime && !this.#hasDate;\n }\n isValid() {\n return this.#hasDate || this.#hasTime;\n }\n toISOString() {\n let iso = super.toISOString();\n // Local Date\n if (this.isDate())\n return iso.slice(0, 10);\n // Local Time\n if (this.isTime())\n return iso.slice(11, 23);\n // Local DateTime\n if (this.#offset === null)\n return iso.slice(0, -1);\n // Offset DateTime\n if (this.#offset === 'Z')\n return iso;\n // This part is quite annoying: JS strips the original timezone from the ISO string representation\n // Instead of using a \"modified\" date and \"Z\", we restore the representation \"as authored\"\n let offset = (+(this.#offset.slice(1, 3)) * 60) + +(this.#offset.slice(4, 6));\n offset = this.#offset[0] === '-' ? offset : -offset;\n let offsetDate = new Date(this.getTime() - (offset * 60e3));\n return offsetDate.toISOString().slice(0, -1) + this.#offset;\n }\n static wrapAsOffsetDateTime(jsDate, offset = 'Z') {\n let date = new TomlDate(jsDate);\n date.#offset = offset;\n return date;\n }\n static wrapAsLocalDateTime(jsDate) {\n let date = new TomlDate(jsDate);\n date.#offset = null;\n return date;\n }\n static wrapAsLocalDate(jsDate) {\n let date = new TomlDate(jsDate);\n date.#hasTime = false;\n date.#offset = null;\n return date;\n }\n static wrapAsLocalTime(jsDate) {\n let date = new TomlDate(jsDate);\n date.#hasDate = false;\n date.#offset = null;\n return date;\n }\n}\n","/*!\n * Copyright (c) Squirrel Chat et al., All rights reserved.\n * SPDX-License-Identifier: BSD-3-Clause\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors\n * may be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nfunction getLineColFromPtr(string, ptr) {\n let lines = string.slice(0, ptr).split(/\\r\\n|\\n|\\r/g);\n return [lines.length, lines.pop().length + 1];\n}\nfunction makeCodeBlock(string, line, column) {\n let lines = string.split(/\\r\\n|\\n|\\r/g);\n let codeblock = '';\n let numberLen = (Math.log10(line + 1) | 0) + 1;\n for (let i = line - 1; i <= line + 1; i++) {\n let l = lines[i - 1];\n if (!l)\n continue;\n codeblock += i.toString().padEnd(numberLen, ' ');\n codeblock += ': ';\n codeblock += l;\n codeblock += '\\n';\n if (i === line) {\n codeblock += ' '.repeat(numberLen + column + 2);\n codeblock += '^\\n';\n }\n }\n return codeblock;\n}\nexport class TomlError extends Error {\n line;\n column;\n codeblock;\n constructor(message, options) {\n const [line, column] = getLineColFromPtr(options.toml, options.ptr);\n const codeblock = makeCodeBlock(options.toml, line, column);\n super(`Invalid TOML document: ${message}\\n\\n${codeblock}`, options);\n this.line = line;\n this.column = column;\n this.codeblock = codeblock;\n }\n}\n","/*!\n * Copyright (c) Squirrel Chat et al., All rights reserved.\n * SPDX-License-Identifier: BSD-3-Clause\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors\n * may be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nimport { TomlError } from './error.js';\n/** @internal */\nexport function indexOfNewline(str, start = 0) {\n let idx = str.indexOf('\\n', start);\n if (str.charCodeAt(idx - 1) === 0xd /* \\r */)\n idx--;\n return idx;\n}\n/** @internal */\nexport function skipComment(ctx) {\n for (; ctx.p < ctx.s.length; ctx.p++) {\n let c = ctx.s.charCodeAt(ctx.p);\n if (c === 0xa /* \\n */)\n break;\n if (c === 0xd /* \\r */ && ctx.s.charCodeAt(ctx.p + 1) === 0xa /* \\n */) {\n ctx.p++;\n break;\n }\n if ((c < 0x20 && c !== 0x9 /* \\t */) || c === 0x7f) {\n throw new TomlError('control characters are not allowed in comments', {\n toml: ctx.s,\n ptr: ctx.p,\n });\n }\n }\n}\n/** @internal */\nexport function skipVoid(ctx, banNewLines, banComments) {\n let c;\n while (1) {\n while ((c = ctx.s.charCodeAt(ctx.p)) === 0x20 ||\n c === 0x9 /* \\t */ ||\n (!banNewLines &&\n (c === 0xa /* \\n */ || (c === 0xd /* \\r */ && ctx.s.charCodeAt(ctx.p + 1) === 0xa /* \\n */))))\n ctx.p++;\n if (banComments || c !== 0x23 /* # */)\n break;\n skipComment(ctx);\n }\n}\n/** @internal */\nexport function skipUntil(ctx, sep, end) {\n let ptr = ctx.p;\n if (!end) {\n ptr = indexOfNewline(ctx.s, ptr);\n ctx.p = ptr < 0 ? ctx.s.length : ptr;\n return;\n }\n for (; ctx.p < ctx.s.length; ctx.p++) {\n let c = ctx.s.charCodeAt(ctx.p);\n if (c === 0x23 /* # */) {\n skipComment(ctx);\n }\n else if (c === end || c === sep) {\n return;\n }\n }\n throw new TomlError('cannot find end of structure', {\n toml: ctx.s,\n ptr,\n });\n}\n","/*!\n * Copyright (c) Squirrel Chat et al., All rights reserved.\n * SPDX-License-Identifier: BSD-3-Clause\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors\n * may be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nimport { TomlDate } from './date.js';\nimport { TomlError } from './error.js';\nimport { skipComment, skipUntil } from './util.js';\n// let CTRL_REGEX = /[\\x00-\\x08\\x0f-\\x1f\\x7f]/\nlet INT_REGEX = /^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\\d(_?\\d)*))$/;\nlet FLOAT_REGEX = /^[+-]?\\d(_?\\d)*(\\.\\d(_?\\d)*)?([eE][+-]?\\d(_?\\d)*)?$/;\nlet LEADING_ZERO = /^[+-]?0[0-9_]/;\n/** @internal */\nexport function parseString(ctx) {\n let start = ctx.p;\n let c = ctx.s.charCodeAt(ctx.p++);\n let first = c;\n let isLiteral = c === 0x27; /* ' */\n let isMultiline = c === ctx.s.charCodeAt(ctx.p) && c === ctx.s.charCodeAt(ctx.p + 1);\n if (isMultiline) {\n // Trim initial newline\n if ((c = ctx.s.charCodeAt(ctx.p += 2)) === 0xa /* \\n */)\n ctx.p++;\n else if (c === 0xd /* \\r */ && ctx.s.charCodeAt(ctx.p + 1) === 0xa /* \\n */)\n ctx.p += 2;\n }\n /*\n The fast path does not seem to bring significant performance gains, so it's commented out.\n Kept for reference and/or future fafoing.\n\n Without: spec 5.08 µs/iter 3.88 ipc (99.44% cache) 23.90 branch misses 28.61k cycles 111.01k instructions\n 5MB 115.73 ms/iter 2.51 ipc (98.36% cache) 3.12M branch misses 619.30M cycles 1.56G instructions\n\n With: spec 5.09 µs/iter 3.90 ipc (99.46% cache) 24.42 branch misses 28.57k cycles 111.49k instructions\n 5MB 113.89 ms/iter 2.47 ipc (98.38% cache) 3.12M branch misses 611.94M cycles 1.51G instructions\n\n if (c === \"'\") {\n // Literal strings fast path - no transform needs to occur; just grab the str and that's it\n let endPtr = str.indexOf(isMultiline ? \"'''\" : \"'\", ptr)\n if (endPtr < 0) {\n throw new TomlError(\"unfinished string literal\", { toml: str, ptr })\n }\n\n if (isMultiline) {\n // If the string ends with 4-5 quotes, then the first 1-2 are part of the string\n if (str[endPtr + 3] === \"'\") endPtr++\n if (str[endPtr + 3] === \"'\") endPtr++\n }\n\n let string = str.slice(ptr, endPtr)\n if (CTRL_REGEX.test(string)) {\n let match = string.match(CTRL_REGEX)!\n throw new TomlError('control characters are not allowed in strings', { toml: str, ptr: ptr + (match.index ?? 0) })\n }\n return [string, endPtr + (isMultiline ? 3 : 1)]\n }\n */\n let parsed = '';\n let sliceStart = ctx.p;\n // states:\n // 0 - decoding\n // 1 - decoding escape\n // 2 - whitespace escape (no newline encountered yet, must fail on non-whitespace)\n // 3 - whitespace escape (newline encountered, allowed to transition back to normal decode)\n let state = 0;\n for (; ctx.p < ctx.s.length; ctx.p++) {\n c = ctx.s.charCodeAt(ctx.p);\n // Deal with newlines first, since that simplifies control character checking and handling across all states\n if (isMultiline && (c === 0xa /* \\n */ || (c === 0xd /* \\r */ && ctx.s.charCodeAt(ctx.p + 1) === 0xa /* \\n */))) {\n state = state && 3;\n }\n // Control characters are banned in TOML, so we throw an error if we encounter them\n else if ((c < 0x20 && c !== 0x9 /* \\t */) || c === 0x7f) {\n throw new TomlError('control characters are not allowed in strings', {\n toml: ctx.s,\n ptr: ctx.p,\n });\n }\n // The string might terminate while we're parsing through a newline escape.\n // It must have encountered a newline; otherwise, it'll simply fail in another branch.\n else if ((!state || state === 3) && c === first && (!isMultiline || (ctx.s.charCodeAt(ctx.p + 1) === first && ctx.s.charCodeAt(ctx.p + 2) === first))) {\n if (isMultiline) {\n // If the string ends with 4-5 quotes, then the first 1-2 are part of the string\n if (ctx.s.charCodeAt(ctx.p + 3) === first)\n ctx.p++;\n if (ctx.s.charCodeAt(ctx.p + 3) === first)\n ctx.p++;\n }\n // If we're in a newline escape still, then there's nothing to add.\n if (!state)\n parsed += ctx.s.slice(sliceStart, ctx.p);\n ctx.p += isMultiline ? 3 : 1;\n return parsed;\n }\n else if (!state) {\n if (!isLiteral && c === 0x5c /* \\ */) {\n parsed += ctx.s.slice(sliceStart, (sliceStart = ctx.p));\n state = 1;\n }\n }\n else if (state === 1) {\n if (c === 0x78 /* x */ || c === 0x75 /* u */ || c === 0x55 /* U */) { // Unicode escape\n let value = 0;\n let len = c === 0x78 /* x */ ? 2 : c === 0x75 /* u */ ? 4 : 8;\n for (let j = 0; j < len; j++, ctx.p++) {\n let hex = ctx.s.charCodeAt(ctx.p + 1);\n let digit = \n /* 0-9 */ hex >= 0x30 && hex <= 0x39 ? hex - 0x30 :\n /* A-F */ hex >= 0x41 && hex <= 0x46 ? hex - 0x41 + 10 :\n /* a-f */ hex >= 0x61 && hex <= 0x66 ? hex - 0x61 + 10 : -1;\n if (digit < 0)\n throw new TomlError('invalid non-hex character in unicode escape', { toml: ctx.s, ptr: ctx.p + 1 });\n value = (value << 4) | digit;\n }\n // Because JS does bitwise on signed 32bit integers, all 0xfzzzzzzz values are actually seen as negative\n if (value < 0 || value > 0x10ffff || (value >= 0xd800 && value <= 0xdfff)) {\n throw new TomlError('invalid unicode escape', { toml: ctx.s, ptr: ctx.p });\n }\n parsed += String.fromCodePoint(value);\n sliceStart = ctx.p + 1;\n state = 0;\n }\n else if (c === 0x20 || c === 0x9 /* \\t */) { // If it was a newline, it'd have been handled earlier\n state = 2;\n }\n else {\n if (c === 0x62 /* b */)\n parsed += '\\b';\n else if (c === 0x74 /* t */)\n parsed += '\\t';\n else if (c === 0x6e /* n */)\n parsed += '\\n';\n else if (c === 0x66 /* f */)\n parsed += '\\f';\n else if (c === 0x72 /* r */)\n parsed += '\\r';\n else if (c === 0x65 /* e */)\n parsed += '\\x1b';\n else if (c === 0x22 /* \" */)\n parsed += '\"';\n else if (c === 0x5c /* \\ */)\n parsed += '\\\\';\n else\n throw new TomlError('unrecognized escape sequence', { toml: ctx.s, ptr: ctx.p });\n sliceStart = ctx.p + 1;\n state = 0;\n }\n }\n else if (c !== 0x20 && c !== 0x9 /* \\t */) {\n if (state === 2) {\n throw new TomlError('invalid escape: only line-ending whitespace may be escaped', {\n toml: ctx.s,\n ptr: sliceStart,\n });\n }\n // State cannot be zero, or we'd have branched earlier already.\n // If it's a backslash, immediately transition to the escape state so it can be processed.\n state = !isLiteral && c === 0x5c /* \\ */ ? 1 : 0;\n sliceStart = ctx.p;\n }\n }\n throw new TomlError('unfinished string', { toml: ctx.s, ptr: start });\n}\nfunction sliceAndTrimEndOf(ctx, start, end) {\n let value = ctx.s.slice(start, end);\n let commentIdx = value.indexOf('#');\n if (commentIdx > 0) {\n // The call to skipComment allows to \"validate\" the comment\n // (absence of control characters)\n skipComment({ s: value, p: commentIdx, d: 0 });\n value = value.slice(0, commentIdx);\n }\n return value.trimEnd();\n}\n/** @internal */\nexport function parseValue(ctx, integersAsBigInt, end) {\n let ptr = ctx.p;\n let err = { toml: ctx.s, ptr };\n skipUntil(ctx, 0x2c /* , */, end);\n let value = sliceAndTrimEndOf(ctx, ptr, ctx.p);\n if (!value)\n throw new TomlError('incomplete declaration: value expected', err);\n if (value === '-inf')\n return -Infinity;\n if (value === 'inf' || value === '+inf')\n return Infinity;\n if (value === 'nan' || value === '+nan' || value === '-nan')\n return NaN;\n // Avoid FP representation of -0\n if (value === '-0')\n return integersAsBigInt ? 0n : 0;\n // Numbers\n let isInt = INT_REGEX.test(value);\n if (isInt || FLOAT_REGEX.test(value)) {\n if (LEADING_ZERO.test(value)) {\n throw new TomlError('leading zeroes are not allowed', err);\n }\n value = value.replace(/_/g, '');\n let numeric = +value;\n if (isNaN(numeric)) {\n throw new TomlError('invalid number', err);\n }\n if (isInt) {\n if ((isInt = !Number.isSafeInteger(numeric)) && !integersAsBigInt) {\n throw new TomlError('integer value cannot be represented losslessly', err);\n }\n if (isInt || integersAsBigInt === true)\n numeric = BigInt(value);\n }\n return numeric;\n }\n const date = new TomlDate(value);\n if (!date.isValid())\n throw new TomlError('invalid value', err);\n return date;\n}\n","/*!\n * Copyright (c) Squirrel Chat et al., All rights reserved.\n * SPDX-License-Identifier: BSD-3-Clause\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors\n * may be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nimport { parseString, parseValue } from './primitive.js';\nimport { parseArray, parseInlineTable } from './struct.js';\nimport { TomlError } from './error.js';\n/** @internal */\nexport function extractValue(ctx, end, integersAsBigInt) {\n let ptr = ctx.p;\n let c = ctx.s.charCodeAt(ptr);\n // Structs\n if (c === 0x5b /* [ */ || c === 0x7b /* { */) {\n if (!ctx.d--) {\n throw new TomlError('document contains excessively nested structures. aborting.', {\n toml: ctx.s,\n ptr,\n });\n }\n let value = c === 0x5b /* [ */\n ? parseArray(ctx, integersAsBigInt)\n : parseInlineTable(ctx, integersAsBigInt);\n ctx.d++;\n return value;\n }\n // Strings\n if (c === 0x22 /* \" */ || c === 0x27 /* ' */) {\n return parseString(ctx);\n }\n // Booleans\n // We can fast-path because the first character is enough to know the only possible value\n if (c === 0x74 /* t */) { // Only possible valid value is `true`\n if (ctx.s.charCodeAt(++ctx.p) !== 0x72 || ctx.s.charCodeAt(++ctx.p) !== 0x75 || ctx.s.charCodeAt(++ctx.p) !== 0x65)\n throw new TomlError('invalid value', { toml: ctx.s, ptr });\n ctx.p++;\n return true;\n }\n if (c === 0x66 /* f */) { // Only possible valid value is `false`\n if (ctx.s.charCodeAt(++ctx.p) !== 0x61 || ctx.s.charCodeAt(++ctx.p) !== 0x6c || ctx.s.charCodeAt(++ctx.p) !== 0x73 || ctx.s.charCodeAt(++ctx.p) !== 0x65)\n throw new TomlError('invalid value', { toml: ctx.s, ptr });\n ctx.p++;\n return false;\n }\n // Legacy logic for numbers and dates. Slow and needs to be rewritten.\n return parseValue(ctx, integersAsBigInt, end);\n}\n","/*!\n * Copyright (c) Squirrel Chat et al., All rights reserved.\n * SPDX-License-Identifier: BSD-3-Clause\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors\n * may be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nimport { parseString } from './primitive.js';\nimport { extractValue } from './extract.js';\nimport { indexOfNewline, skipVoid } from './util.js';\nimport { TomlError } from './error.js';\nlet KEY_PART_RE = /^[a-zA-Z0-9-_]+[ \\t]*$/;\n/** @internal */\nexport function parseKey(ctx, end = '=') {\n let start = ctx.p;\n let dot = start - 1;\n let parsed = [];\n let endPtr = ctx.s.indexOf(end, start);\n if (endPtr < 0) {\n throw new TomlError('incomplete key-value: cannot find end of key', {\n toml: ctx.s,\n ptr: start,\n });\n }\n do {\n let c = ctx.s.charCodeAt(ctx.p = ++dot);\n // If it's whitespace, ignore\n if (c !== 0x20 && c !== 0x9 /* \\t */) {\n // If it's a string\n if (c === 0x22 /* \" */ || c === 0x27 /* ' */) {\n if (c === ctx.s.charCodeAt(ctx.p + 1) && c === ctx.s.charCodeAt(ctx.p + 2)) {\n throw new TomlError('multiline strings are not allowed in keys', {\n toml: ctx.s,\n ptr: ctx.p,\n });\n }\n let part = parseString(ctx);\n dot = ctx.s.indexOf('.', ctx.p);\n let strEnd = ctx.s.slice(ctx.p, dot < 0 || dot > endPtr ? endPtr : dot);\n let newLine = indexOfNewline(strEnd);\n if (newLine > -1) {\n throw new TomlError('newlines are not allowed in keys', {\n toml: ctx.s,\n ptr: newLine,\n });\n }\n if (strEnd.trimStart()) {\n throw new TomlError('found extra tokens after the string part', {\n toml: ctx.s,\n ptr: ctx.p,\n });\n }\n if (endPtr < ctx.p) {\n endPtr = ctx.s.indexOf(end, ctx.p);\n if (endPtr < 0) {\n throw new TomlError('incomplete key-value: cannot find end of key', {\n toml: ctx.s,\n ptr: start,\n });\n }\n }\n parsed.push(part);\n }\n else {\n // Normal raw key part consumption and validation\n dot = ctx.s.indexOf('.', ctx.p);\n let part = ctx.s.slice(ctx.p, dot < 0 || dot > endPtr ? endPtr : dot);\n if (!KEY_PART_RE.test(part)) {\n throw new TomlError('only letter, numbers, dashes and underscores are allowed in keys', {\n toml: ctx.s,\n ptr: ctx.p,\n });\n }\n parsed.push(part.trimEnd());\n }\n }\n // Until there's no more dot\n } while (dot + 1 && dot < endPtr);\n ctx.p = endPtr + 1;\n skipVoid(ctx, true, true);\n return parsed;\n}\n/** @internal */\nexport function parseInlineTable(ctx, integersAsBigInt) {\n let res = {};\n let seen = new Set();\n let c;\n ctx.p++;\n while (ctx.p < ctx.s.length) {\n skipVoid(ctx);\n if ((c = ctx.s.charCodeAt(ctx.p)) === 0x7d /* } */) {\n ctx.p++;\n return res;\n }\n let k;\n let t = res;\n let hasOwn = false;\n let p = ctx.p;\n let key = parseKey(ctx);\n for (let i = 0; i < key.length; i++) {\n if (i)\n t = hasOwn ? t[k] : (t[k] = {});\n k = key[i];\n if ((hasOwn = Object.hasOwn(t, k)) && (typeof t[k] !== 'object' || seen.has(t[k]))) {\n throw new TomlError('trying to redefine an already defined value', {\n toml: ctx.s,\n ptr: p,\n });\n }\n if (!hasOwn && k === '__proto__') {\n Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true });\n }\n }\n if (hasOwn) {\n throw new TomlError('trying to redefine an already defined value', {\n toml: ctx.s,\n ptr: ctx.p,\n });\n }\n let value = extractValue(ctx, 0x7d /* } */, integersAsBigInt);\n seen.add(t[k] = value);\n skipVoid(ctx);\n if ((c = ctx.s.charCodeAt(ctx.p++)) === 0x7d /* } */) {\n return res;\n }\n if (c !== 0x2c /* , */) {\n throw new TomlError('expected comma or end of structure', { toml: ctx.s, ptr: ctx.p - 1 });\n }\n }\n throw new TomlError('unfinished table encountered', {\n toml: ctx.s,\n ptr: ctx.p,\n });\n}\n/** @internal */\nexport function parseArray(ctx, integersAsBigInt) {\n let res = [];\n let c;\n ctx.p++;\n while (ctx.p < ctx.s.length) {\n skipVoid(ctx);\n if ((c = ctx.s.charCodeAt(ctx.p)) === 0x5d /* ] */) {\n ctx.p++;\n return res;\n }\n res.push(extractValue(ctx, 0x5d /* ] */, integersAsBigInt));\n skipVoid(ctx);\n if ((c = ctx.s.charCodeAt(ctx.p++)) === 0x5d /* ] */) {\n return res;\n }\n if (c !== 0x2c /* , */) {\n throw new TomlError('expected comma or end of structure', { toml: ctx.s, ptr: ctx.p - 1 });\n }\n }\n throw new TomlError('unfinished array encountered', {\n toml: ctx.s,\n ptr: ctx.p,\n });\n}\n","/*!\n * Copyright (c) Squirrel Chat et al., All rights reserved.\n * SPDX-License-Identifier: BSD-3-Clause\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors\n * may be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nimport { parseKey } from './struct.js';\nimport { extractValue } from './extract.js';\nimport { skipVoid } from './util.js';\nimport { TomlError } from './error.js';\nfunction peekTable(key, table, meta, type) {\n let t = table;\n let m = meta;\n let k;\n let hasOwn = false;\n let state;\n for (let i = 0; i < key.length; i++) {\n if (i) {\n t = hasOwn ? t[k] : (t[k] = {});\n m = (state = m[k]).c;\n if (type === 0 /* Type.DOTTED */ && (state.t === 1 /* Type.EXPLICIT */ || state.t === 2 /* Type.ARRAY */)) {\n return null;\n }\n if (state.t === 2 /* Type.ARRAY */) {\n let l = t.length - 1;\n t = t[l];\n m = m[l].c;\n }\n }\n k = key[i];\n if ((hasOwn = Object.hasOwn(t, k)) && m[k]?.t === 0 /* Type.DOTTED */ && m[k]?.d) {\n return null;\n }\n if (!hasOwn) {\n if (k === '__proto__') {\n Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true });\n Object.defineProperty(m, k, { enumerable: true, configurable: true, writable: true });\n }\n m[k] = {\n t: i < key.length - 1 && type === 2 /* Type.ARRAY */\n ? 3 /* Type.ARRAY_DOTTED */ : type,\n d: false,\n i: 0,\n c: {},\n };\n }\n }\n state = m[k];\n if (state.t !== type && !(type === 1 /* Type.EXPLICIT */ && state.t === 3 /* Type.ARRAY_DOTTED */)) {\n // Bad key type!\n return null;\n }\n if (type === 2 /* Type.ARRAY */) {\n if (!state.d) {\n state.d = true;\n t[k] = [];\n }\n t[k].push(t = {});\n state.c[state.i++] = (state = { t: 1 /* Type.EXPLICIT */, d: false, i: 0, c: {} });\n }\n if (state.d) {\n // Redefining a table!\n return null;\n }\n state.d = true;\n if (type === 1 /* Type.EXPLICIT */) {\n t = hasOwn ? t[k] : (t[k] = {});\n }\n else if (type === 0 /* Type.DOTTED */ && hasOwn) {\n return null;\n }\n return [k, t, state.c];\n}\nexport function parse(toml, { maxDepth = 1000, integersAsBigInt } = {}) {\n let ctx = { s: toml, p: 0, d: maxDepth };\n let res = {};\n let meta = {};\n let tmp;\n let tbl = res;\n let m = meta;\n skipVoid(ctx);\n while (ctx.p < toml.length) {\n if (toml.charCodeAt(ctx.p) === 0x5b /* [ */) {\n let isTableArray = toml.charCodeAt(++ctx.p) === 0x5b; /* [ */\n tmp = ctx.p += +isTableArray;\n let k = parseKey(ctx, ']');\n if (isTableArray) {\n if (toml.charCodeAt(ctx.p - 1) !== 0x5d /* ] */) {\n throw new TomlError('expected end of table declaration', {\n toml: toml,\n ptr: ctx.p - 1,\n });\n }\n ctx.p++;\n }\n let p = peekTable(k, res, meta, isTableArray ? 2 /* Type.ARRAY */ : 1 /* Type.EXPLICIT */);\n if (!p) {\n throw new TomlError('trying to redefine an already defined table or value', {\n toml: toml,\n ptr: tmp,\n });\n }\n m = p[2];\n tbl = p[1];\n }\n else {\n tmp = ctx.p;\n let k = parseKey(ctx);\n let p = peekTable(k, tbl, m, 0 /* Type.DOTTED */);\n if (!p) {\n throw new TomlError('trying to redefine an already defined table or value', {\n toml: toml,\n ptr: tmp,\n });\n }\n p[1][p[0]] = extractValue(ctx, void 0, integersAsBigInt);\n }\n skipVoid(ctx, true);\n if (ctx.p < toml.length && (tmp = toml.charCodeAt(ctx.p)) !== 0xa /* \\n */ && tmp !== 0xd /* \\r */) {\n throw new TomlError('each key-value declaration must be followed by an end-of-line', {\n toml: toml,\n ptr: ctx.p,\n });\n }\n skipVoid(ctx);\n }\n return res;\n}\n","/*!\n * Copyright (c) Squirrel Chat et al., All rights reserved.\n * SPDX-License-Identifier: BSD-3-Clause\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors\n * may be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nlet BARE_KEY = /^[a-z0-9-_]+$/i;\nfunction extendedTypeOf(obj) {\n let type = typeof obj;\n if (type === 'object') {\n if (Array.isArray(obj))\n return 'array';\n if (typeof obj?.getUTCDate === 'function' && obj instanceof Date)\n return 'date';\n if (globalThis.Temporal &&\n // check for the 'since' property as an early bailout that avoids running all 5 instanceof checks\n typeof obj?.since === 'function' &&\n (obj instanceof Temporal.Instant ||\n obj instanceof Temporal.PlainDate ||\n obj instanceof Temporal.PlainDateTime ||\n obj instanceof Temporal.PlainTime ||\n obj instanceof Temporal.ZonedDateTime)) {\n return 'temporal';\n }\n }\n return type;\n}\nfunction isArrayOfTables(obj) {\n for (let i = 0; i < obj.length; i++) {\n if (extendedTypeOf(obj[i]) !== 'object')\n return false;\n }\n return obj.length != 0;\n}\nfunction formatString(s) {\n return JSON.stringify(s).replace(/\\x7f/g, '\\\\u007f');\n}\nfunction stringifyTemporal(temporal) {\n return temporal.toString({\n calendarName: 'never',\n timeZoneName: 'never',\n });\n}\nfunction stringifyValue(val, type, depth, numberAsFloat) {\n if (depth === 0) {\n throw new Error('Could not stringify the object: maximum object depth exceeded');\n }\n switch (type) {\n // @ts-expect-error -- intentional fallthrough case\n case 'number':\n if (isNaN(val))\n return 'nan';\n if (val === Infinity)\n return 'inf';\n if (val === -Infinity)\n return '-inf';\n if (Number.isInteger(val) && (numberAsFloat || !Number.isSafeInteger(val)))\n return val.toFixed(1);\n case 'bigint':\n case 'boolean':\n return val.toString();\n case 'string':\n return formatString(val);\n case 'date':\n if (isNaN(val.getTime()))\n throw new TypeError('cannot serialize invalid date');\n return val.toISOString();\n case 'object':\n return stringifyInlineTable(val, depth, numberAsFloat);\n case 'array':\n return stringifyArray(val, depth, numberAsFloat);\n case 'temporal':\n return stringifyTemporal(val);\n }\n}\nfunction stringifyInlineTable(obj, depth, numberAsFloat) {\n let keys = Object.keys(obj);\n if (keys.length === 0)\n return '{}';\n let res = '{ ';\n for (let i = 0; i < keys.length; i++) {\n let k = keys[i];\n if (i)\n res += ', ';\n res += BARE_KEY.test(k) ? k : formatString(k);\n res += ' = ';\n res += stringifyValue(obj[k], extendedTypeOf(obj[k]), depth - 1, numberAsFloat);\n }\n return res + ' }';\n}\nfunction stringifyArray(array, depth, numberAsFloat) {\n if (array.length === 0)\n return '[]';\n let res = '[ ';\n for (let i = 0; i < array.length; i++) {\n if (i)\n res += ', ';\n if (array[i] === null || array[i] === void 0) {\n throw new TypeError('arrays cannot contain null or undefined values');\n }\n res += stringifyValue(array[i], extendedTypeOf(array[i]), depth - 1, numberAsFloat);\n }\n return res + ' ]';\n}\nfunction stringifyArrayTable(array, key, depth, numberAsFloat) {\n if (depth === 0) {\n throw new Error('Could not stringify the object: maximum object depth exceeded');\n }\n let res = '';\n for (let i = 0; i < array.length; i++) {\n res += `${res && '\\n'}[[${key}]]\\n`;\n res += stringifyTable(0, array[i], key, depth, numberAsFloat);\n }\n return res;\n}\nfunction stringifyTable(tableKey, obj, prefix, depth, numberAsFloat) {\n if (depth === 0) {\n throw new Error('Could not stringify the object: maximum object depth exceeded');\n }\n let preamble = '';\n let tables = '';\n let keys = Object.keys(obj);\n for (let i = 0; i < keys.length; i++) {\n let k = keys[i];\n if (obj[k] !== null && obj[k] !== void 0) {\n let type = extendedTypeOf(obj[k]);\n if (type === 'symbol' || type === 'function') {\n throw new TypeError(`cannot serialize values of type '${type}'`);\n }\n let key = BARE_KEY.test(k) ? k : formatString(k);\n if (type === 'array' && isArrayOfTables(obj[k])) {\n tables += (tables && '\\n') + stringifyArrayTable(obj[k], prefix ? `${prefix}.${key}` : key, depth - 1, numberAsFloat);\n }\n else if (type === 'object') {\n let tblKey = prefix ? `${prefix}.${key}` : key;\n tables += (tables && '\\n') + stringifyTable(tblKey, obj[k], tblKey, depth - 1, numberAsFloat);\n }\n else {\n preamble += key;\n preamble += ' = ';\n preamble += stringifyValue(obj[k], type, depth, numberAsFloat);\n preamble += '\\n';\n }\n }\n }\n if (tableKey && (preamble || !tables)) // Create table only if necessary\n preamble = preamble ? `[${tableKey}]\\n${preamble}` : `[${tableKey}]`;\n return preamble && tables\n ? `${preamble}\\n${tables}`\n : preamble || tables;\n}\nexport function stringify(obj, { maxDepth = 1000, numbersAsFloat = false } = {}) {\n if (extendedTypeOf(obj) !== 'object') {\n throw new TypeError('stringify can only be called with an object');\n }\n let str = stringifyTable(0, obj, '', maxDepth, numbersAsFloat);\n if (str[str.length - 1] !== '\\n')\n return str + '\\n';\n return str;\n}\n","import fs from \"fs-extra\";\nimport { dirname } from \"node:path\";\nimport { parse, stringify } from \"smol-toml\";\nimport { CODEX_CONFIG_PATH } from \"../../config/config.js\";\nimport type { CodexConfig } from \"../../interfaces/CodexConfig.js\";\nimport { Cli } from \"./cli\";\n\nexport class CodexCli extends Cli {\n constructor() {\n super(\"codex\");\n }\n\n version(): string | null {\n return this.tryGet(\"--version\");\n }\n\n // ── Base config (file, not CLI) ────────────────────────────────────────────\n\n getConfig(): CodexConfig | null {\n if (!fs.pathExistsSync(CODEX_CONFIG_PATH)) {\n return null;\n }\n try {\n return parse(fs.readFileSync(CODEX_CONFIG_PATH, \"utf8\")) as CodexConfig;\n } catch {\n return null;\n }\n }\n\n updateConfig(config: CodexConfig): void {\n fs.ensureDirSync(dirname(CODEX_CONFIG_PATH));\n fs.writeFileSync(CODEX_CONFIG_PATH, stringify(config as Parameters<typeof stringify>[0]), \"utf8\");\n }\n\n /** Writes initial config. Returns true if a backup was created. */\n writeBaseConfig(config: CodexConfig, reinstall: boolean): boolean {\n const backedUp = fs.pathExistsSync(CODEX_CONFIG_PATH) && reinstall;\n if (backedUp) {\n fs.copyFileSync(CODEX_CONFIG_PATH, `${CODEX_CONFIG_PATH}.bak`);\n }\n this.updateConfig(config);\n return backedUp;\n }\n\n // ── MCP management (via codex mcp CLI) ────────────────────────────────────\n\n listMcp(): string {\n return this.tryGet(\"mcp\", \"list\") ?? \"\";\n }\n\n hasMcp(name: string): boolean {\n return this.listMcp().includes(name);\n }\n\n /** Adds an MCP via `codex mcp add-json`. Returns false if already present and not reinstalling. */\n addMcp(name: string, jsonConfig: string, reinstall = false): boolean {\n if (!reinstall && this.hasMcp(name)) {\n return false;\n }\n\n if (reinstall && this.hasMcp(name)) {\n this.tryGet(\"mcp\", \"remove\", name);\n }\n\n this.tryGet(\"mcp\", \"add-json\", name, jsonConfig);\n\n return true;\n }\n\n /** Removes an MCP via `codex mcp remove`. Returns true if removed, false if not found. */\n removeMcp(name: string): boolean {\n if (!this.hasMcp(name)) {\n return false;\n }\n\n this.tryGet(\"mcp\", \"remove\", name);\n\n return true;\n }\n\n /**\n * Merges extra properties into an existing MCP section in config.toml.\n * Call after `addMcp()` for settings not supported by `codex mcp add-json`.\n * No-op if the MCP section is not found in the config.\n */\n addExtraMcpSettings(mcpName: string, options: Record<string, unknown>): void {\n const config = this.getConfig();\n\n if (!config?.mcp_servers?.[mcpName]) {\n return;\n }\n\n config.mcp_servers[mcpName] = {\n ...(config.mcp_servers[mcpName] as Record<string, unknown>),\n ...options\n };\n\n this.updateConfig(config);\n }\n}\n\nexport const codex = new CodexCli();\n","import * as p from \"@clack/prompts\";\nimport { Command } from \"commander\";\nimport fs from \"fs-extra\";\nimport { join } from \"node:path\";\nimport {\n CODEX_CONFIG_PATH,\n CODEX_MCP_SECTIONS,\n DEFAULT_INSTALL_DIR,\n IS_WINDOWS,\n OPTIONAL_ENV_VARS,\n REQUIRED_ENV_VARS\n} from \"../config/config\";\nimport { claude } from \"../services/cli/claude\";\nimport { Cli } from \"../services/cli/cli\";\nimport { codex } from \"../services/cli/codex\";\n\nconst git = new Cli(\"git\");\nconst mise = new Cli(\"mise\");\nconst node = new Cli(\"node\");\nconst python = new Cli(IS_WINDOWS ? \"python\" : \"python3\");\n\nclass CheckError extends Error {\n constructor(section: string, failures: string[]) {\n super(`${section}: ${failures.join(\", \")}`);\n this.name = \"CheckError\";\n }\n}\n\nfunction ok(label: string, detail = \"\") {\n p.log.success(detail ? `${label} — ${detail}` : label);\n}\n\nfunction warn(label: string, detail = \"\") {\n p.log.warn(detail ? `${label} — ${detail}` : label);\n}\n\nfunction fail(label: string, detail: string) {\n p.log.error(`${label} — ${detail}`);\n}\n\nfunction getEnvVar(name: string): string | undefined {\n if (!IS_WINDOWS) {\n return process.env[name];\n }\n return new Cli(\"powershell\").tryGet(\"-Command\", `[System.Environment]::GetEnvironmentVariable('${name}', 'User')`) ?? undefined;\n}\n\nfunction checkTools() {\n p.log.step(\"Tools\");\n\n const failures: string[] = [];\n\n const gitVer = git.tryGet(\"--version\");\n if (gitVer) {\n ok(\"git\", gitVer.replace(\"git version \", \"\"));\n } else {\n fail(\"git\", \"not found\");\n failures.push(\"git\");\n }\n\n const miseVer = mise.tryGet(\"--version\");\n if (miseVer) {\n ok(\"mise\", miseVer);\n } else {\n fail(\"mise\", \"not found\");\n failures.push(\"mise\");\n }\n\n const nodeVer = node.tryGet(\"-v\");\n if (nodeVer) {\n ok(\"node\", nodeVer);\n } else {\n fail(\"node\", \"not found\");\n failures.push(\"node\");\n }\n\n if (codex.available()) {\n ok(\"codex\");\n } else {\n fail(\"codex\", \"not found\");\n failures.push(\"codex\");\n }\n if (claude.available()) {\n ok(\"claude\");\n } else {\n fail(\"claude\", \"not found\");\n failures.push(\"claude\");\n }\n\n const pyVer = python.tryGet(\"--version\");\n if (pyVer) {\n ok(\"python\", pyVer);\n } else {\n warn(\"python\", \"not installed (optional)\");\n }\n\n if (failures.length) {\n throw new CheckError(\"Tools\", failures);\n }\n}\n\nfunction checkEnvVars() {\n p.log.step(\"Environment Variables\");\n\n const failures: string[] = [];\n\n for (const v of REQUIRED_ENV_VARS) {\n const val = getEnvVar(v);\n if (val) {\n ok(v);\n } else {\n fail(v, \"not set\");\n failures.push(v);\n }\n }\n\n for (const v of OPTIONAL_ENV_VARS) {\n const val = getEnvVar(v);\n if (val) {\n ok(v);\n } else {\n warn(v, \"not set (optional)\");\n }\n }\n\n if (failures.length) {\n throw new CheckError(\"Environment Variables\", failures);\n }\n}\n\nfunction checkCodexConfig() {\n p.log.step(\"Codex — config.toml\");\n\n if (!codex.getConfig()) {\n fail(\"config.toml\", \"not found (~/.codex/config.toml)\");\n throw new CheckError(\"Codex\", [\"config.toml missing\"]);\n }\n\n ok(\"config.toml\", CODEX_CONFIG_PATH);\n\n const failures: string[] = [];\n for (const key of Object.keys(CODEX_MCP_SECTIONS)) {\n const present = codex.hasMcp(key);\n if (present) {\n ok(`MCP ${key}`);\n } else {\n fail(`MCP ${key}`, \"not configured\");\n failures.push(key);\n }\n }\n\n if (failures.length) {\n throw new CheckError(\"Codex MCPs\", failures);\n }\n}\n\nfunction checkClaudeMcps() {\n p.log.step(\"Claude — MCPs\");\n\n if (!claude.available()) {\n fail(\"Claude MCPs\", \"claude CLI not found\");\n throw new CheckError(\"Claude MCPs\", [\"claude CLI not found\"]);\n }\n\n const mcpList = claude.listMcp();\n const failures: string[] = [];\n\n const checks: [string, boolean][] = [\n [\"clubmed_api\", mcpList.includes(\"clubmed_api\")],\n [\"cms_api\", mcpList.includes(\"cms_api\")],\n [\"atlassian\", mcpList.includes(\"atlassian\") || mcpList.includes(\"plugin:atlassian\")]\n ];\n\n for (const [name, present] of checks) {\n if (present) {\n ok(`MCP ${name}`);\n } else {\n fail(`MCP ${name}`, \"not configured\");\n failures.push(name);\n }\n }\n\n if (failures.length) {\n throw new CheckError(\"Claude MCPs\", failures);\n }\n}\n\nfunction checkRepo() {\n p.log.step(\"Repository\");\n\n const repoDir = process.env[\"CLUBMED_REPO_DIR\"] ?? DEFAULT_INSTALL_DIR;\n if (fs.pathExistsSync(join(repoDir, \".git\"))) {\n ok(\"Repository\", repoDir);\n } else {\n fail(\"Repository\", repoDir);\n throw new CheckError(\"Repository\", [\"not cloned\"]);\n }\n}\n\nexport default (program: Command): void =>\n void program\n .command(\"check\")\n .description(\"Check the installation state of the workstation\")\n .action(() => {\n p.intro(`Club Med — AI Tools Check (${IS_WINDOWS ? \"Windows\" : \"macOS/Linux\"})`);\n\n const errors: CheckError[] = [];\n for (const check of [checkTools, checkEnvVars, checkCodexConfig, checkClaudeMcps, checkRepo]) {\n try {\n check();\n } catch (e) {\n if (e instanceof CheckError) {\n errors.push(e);\n } else {\n throw e;\n }\n }\n }\n\n if (errors.length) {\n p.outro(\"Some checks failed — run cm-agents install to fix.\");\n process.exit(1);\n } else {\n p.outro(\"Everything is correctly configured.\");\n }\n });\n","// Note: Each match is kept and `postfix` is inserted after it. `String#replaceAll(substring, substring + postfix)` does the same, but it has to scan the replacement for `$` patterns and it is several times slower on the no-match path that most calls take.\nexport function stringReplaceAll(string, substring, postfix) {\n\tlet index = string.indexOf(substring);\n\tif (index === -1) {\n\t\treturn string;\n\t}\n\n\tconst substringLength = substring.length;\n\tlet endIndex = 0;\n\tlet returnValue = '';\n\tdo {\n\t\treturnValue += string.slice(endIndex, index) + substring + postfix;\n\t\tendIndex = index + substringLength;\n\t\tindex = string.indexOf(substring, endIndex);\n\t} while (index !== -1);\n\n\treturnValue += string.slice(endIndex);\n\treturn returnValue;\n}\n\nexport function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {\n\tlet endIndex = 0;\n\tlet returnValue = '';\n\tdo {\n\t\tconst isGotCR = string[index - 1] === '\\r';\n\t\treturnValue += string.slice(endIndex, (isGotCR ? index - 1 : index)) + prefix + (isGotCR ? '\\r\\n' : '\\n') + postfix;\n\t\tendIndex = index + 1;\n\t\tindex = string.indexOf('\\n', endIndex);\n\t} while (index !== -1);\n\n\treturnValue += string.slice(endIndex);\n\treturn returnValue;\n}\n","const ANSI_BACKGROUND_OFFSET = 10;\nconst ANSI_UNDERLINE_OFFSET = 20;\n\nconst wrapAnsi16 = (offset = 0) => code => `\\u{1B}[${code + offset}m`;\n\nconst wrapAnsi256 = (offset = 0) => code => `\\u{1B}[${38 + offset};5;${code}m`;\n\nconst wrapAnsi16m = (offset = 0) => (red, green, blue) => `\\u{1B}[${38 + offset};2;${red};${green};${blue}m`;\n\n// `SGR 58` has no basic 16-color form, so the basic color code is mapped to its palette index instead.\nconst wrapUnderlineAnsi = code => `\\u{1B}[58;5;${code < 90 ? code - 30 : code - 90 + 8}m`;\n\nconst styles = {\n\tmodifier: {\n\t\treset: [0, 0],\n\t\t// 21 isn't widely supported and 22 does the same thing\n\t\tbold: [1, 22],\n\t\tdim: [2, 22],\n\t\titalic: [3, 23],\n\t\tunderline: [4, 24],\n\t\t// Extended underline styles (`SGR 4:x` sub-parameters). Not in upstream `ansi-styles`.\n\t\tunderlineDouble: ['4:2', 24],\n\t\tunderlineCurly: ['4:3', 24],\n\t\tunderlineDotted: ['4:4', 24],\n\t\tunderlineDashed: ['4:5', 24],\n\t\toverline: [53, 55],\n\t\tinverse: [7, 27],\n\t\thidden: [8, 28],\n\t\tstrikethrough: [9, 29],\n\t},\n\tcolor: {\n\t\tblack: [30, 39],\n\t\tred: [31, 39],\n\t\tgreen: [32, 39],\n\t\tyellow: [33, 39],\n\t\tblue: [34, 39],\n\t\tmagenta: [35, 39],\n\t\tcyan: [36, 39],\n\t\twhite: [37, 39],\n\n\t\t// Bright color\n\t\tblackBright: [90, 39],\n\t\tgray: [90, 39], // Alias of `blackBright`\n\t\tgrey: [90, 39], // Alias of `blackBright`\n\t\tredBright: [91, 39],\n\t\tgreenBright: [92, 39],\n\t\tyellowBright: [93, 39],\n\t\tblueBright: [94, 39],\n\t\tmagentaBright: [95, 39],\n\t\tcyanBright: [96, 39],\n\t\twhiteBright: [97, 39],\n\t},\n\tbgColor: {\n\t\tbgBlack: [40, 49],\n\t\tbgRed: [41, 49],\n\t\tbgGreen: [42, 49],\n\t\tbgYellow: [43, 49],\n\t\tbgBlue: [44, 49],\n\t\tbgMagenta: [45, 49],\n\t\tbgCyan: [46, 49],\n\t\tbgWhite: [47, 49],\n\n\t\t// Bright color\n\t\tbgBlackBright: [100, 49],\n\t\tbgGray: [100, 49], // Alias of `bgBlackBright`\n\t\tbgGrey: [100, 49], // Alias of `bgBlackBright`\n\t\tbgRedBright: [101, 49],\n\t\tbgGreenBright: [102, 49],\n\t\tbgYellowBright: [103, 49],\n\t\tbgBlueBright: [104, 49],\n\t\tbgMagentaBright: [105, 49],\n\t\tbgCyanBright: [106, 49],\n\t\tbgWhiteBright: [107, 49],\n\t},\n\t// Underline color (`SGR 58`/`59`). Not in upstream `ansi-styles`.\n\tunderlineColor: {\n\t\tunderlineBlack: ['58;5;0', 59],\n\t\tunderlineRed: ['58;5;1', 59],\n\t\tunderlineGreen: ['58;5;2', 59],\n\t\tunderlineYellow: ['58;5;3', 59],\n\t\tunderlineBlue: ['58;5;4', 59],\n\t\tunderlineMagenta: ['58;5;5', 59],\n\t\tunderlineCyan: ['58;5;6', 59],\n\t\tunderlineWhite: ['58;5;7', 59],\n\n\t\t// Bright color\n\t\tunderlineBlackBright: ['58;5;8', 59],\n\t\tunderlineGray: ['58;5;8', 59], // Alias of `underlineBlackBright`\n\t\tunderlineGrey: ['58;5;8', 59], // Alias of `underlineBlackBright`\n\t\tunderlineRedBright: ['58;5;9', 59],\n\t\tunderlineGreenBright: ['58;5;10', 59],\n\t\tunderlineYellowBright: ['58;5;11', 59],\n\t\tunderlineBlueBright: ['58;5;12', 59],\n\t\tunderlineMagentaBright: ['58;5;13', 59],\n\t\tunderlineCyanBright: ['58;5;14', 59],\n\t\tunderlineWhiteBright: ['58;5;15', 59],\n\t},\n};\n\nexport const modifierNames = Object.keys(styles.modifier);\nexport const foregroundColorNames = Object.keys(styles.color);\nexport const backgroundColorNames = Object.keys(styles.bgColor);\nexport const underlineColorNames = Object.keys(styles.underlineColor);\nexport const colorNames = [...foregroundColorNames, ...backgroundColorNames];\n\nfunction assembleStyles() {\n\tconst codes = new Map();\n\n\tfor (const [groupName, group] of Object.entries(styles)) {\n\t\tfor (const [styleName, style] of Object.entries(group)) {\n\t\t\tstyles[styleName] = {\n\t\t\t\topen: `\\u{1B}[${style[0]}m`,\n\t\t\t\tclose: `\\u{1B}[${style[1]}m`,\n\t\t\t};\n\n\t\t\tgroup[styleName] = styles[styleName];\n\n\t\t\t// Only the leading SGR parameter identifies a style, so `4:3` and `58;5;1` are keyed as `4` and `58`.\n\t\t\tcodes.set(Number.parseInt(style[0], 10), style[1]);\n\t\t}\n\n\t\tObject.defineProperty(styles, groupName, {\n\t\t\tvalue: group,\n\t\t\tenumerable: false,\n\t\t});\n\t}\n\n\tObject.defineProperty(styles, 'codes', {\n\t\tvalue: codes,\n\t\tenumerable: false,\n\t});\n\n\tstyles.color.close = '\\u{1B}[39m';\n\tstyles.bgColor.close = '\\u{1B}[49m';\n\tstyles.underlineColor.close = '\\u{1B}[59m';\n\n\tstyles.color.ansi = wrapAnsi16();\n\tstyles.color.ansi256 = wrapAnsi256();\n\tstyles.color.ansi16m = wrapAnsi16m();\n\tstyles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);\n\tstyles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);\n\tstyles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);\n\tstyles.underlineColor.ansi = wrapUnderlineAnsi;\n\tstyles.underlineColor.ansi256 = wrapAnsi256(ANSI_UNDERLINE_OFFSET);\n\tstyles.underlineColor.ansi16m = wrapAnsi16m(ANSI_UNDERLINE_OFFSET);\n\n\t// From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js\n\tObject.defineProperties(styles, {\n\t\trgbToAnsi256: {\n\t\t\tvalue(red, green, blue) {\n\t\t\t\t// We use the extended greyscale palette here, with the exception of\n\t\t\t\t// black and white. normal palette only has 4 greyscale shades.\n\t\t\t\tif (red === green && green === blue) {\n\t\t\t\t\tif (red < 8) {\n\t\t\t\t\t\treturn 16;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (red > 248) {\n\t\t\t\t\t\treturn 231;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn Math.round(((red - 8) / 247) * 24) + 232;\n\t\t\t\t}\n\n\t\t\t\treturn 16\n\t\t\t\t\t+ (36 * Math.round(red / 255 * 5))\n\t\t\t\t\t+ (6 * Math.round(green / 255 * 5))\n\t\t\t\t\t+ Math.round(blue / 255 * 5);\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToRgb: {\n\t\t\tvalue(hex) {\n\t\t\t\tconst matches = /[\\da-f]{6}|[\\da-f]{3}/i.exec(hex.toString(16));\n\t\t\t\tif (!matches) {\n\t\t\t\t\treturn [0, 0, 0];\n\t\t\t\t}\n\n\t\t\t\tlet [colorString] = matches;\n\n\t\t\t\tif (colorString.length === 3) {\n\t\t\t\t\tcolorString = [...colorString].map(character => character + character).join('');\n\t\t\t\t}\n\n\t\t\t\tconst integer = Number.parseInt(colorString, 16);\n\n\t\t\t\treturn [\n\t\t\t\t\t/* eslint-disable no-bitwise -- We need the speed */\n\t\t\t\t\t(integer >> 16) & 0xFF,\n\t\t\t\t\t(integer >> 8) & 0xFF,\n\t\t\t\t\tinteger & 0xFF,\n\t\t\t\t\t/* eslint-enable no-bitwise */\n\t\t\t\t];\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToAnsi256: {\n\t\t\tvalue: hex => styles.rgbToAnsi256(...styles.hexToRgb(hex)),\n\t\t\tenumerable: false,\n\t\t},\n\t\tansi256ToAnsi: {\n\t\t\tvalue(code) {\n\t\t\t\tif (code < 8) {\n\t\t\t\t\treturn 30 + code;\n\t\t\t\t}\n\n\t\t\t\tif (code < 16) {\n\t\t\t\t\treturn 90 + (code - 8);\n\t\t\t\t}\n\n\t\t\t\tlet red;\n\t\t\t\tlet green;\n\t\t\t\tlet blue;\n\n\t\t\t\tif (code >= 232) {\n\t\t\t\t\tred = (((code - 232) * 10) + 8) / 255;\n\t\t\t\t\tgreen = red;\n\t\t\t\t\tblue = red;\n\t\t\t\t} else {\n\t\t\t\t\tcode -= 16;\n\n\t\t\t\t\tconst remainder = code % 36;\n\n\t\t\t\t\tred = Math.floor(code / 36) / 5;\n\t\t\t\t\tgreen = Math.floor(remainder / 6) / 5;\n\t\t\t\t\tblue = (remainder % 6) / 5;\n\t\t\t\t}\n\n\t\t\t\tconst value = Math.max(red, green, blue) * 2;\n\n\t\t\t\tif (value === 0) {\n\t\t\t\t\treturn 30;\n\t\t\t\t}\n\n\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\tlet result = 30 + ((Math.round(blue) << 2) | (Math.round(green) << 1) | Math.round(red));\n\n\t\t\t\tif (value === 2) {\n\t\t\t\t\tresult += 60;\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\trgbToAnsi: {\n\t\t\tvalue: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToAnsi: {\n\t\t\tvalue: hex => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),\n\t\t\tenumerable: false,\n\t\t},\n\t});\n\n\treturn styles;\n}\n\nconst ansiStyles = assembleStyles();\n\nexport default ansiStyles;\n","import process from 'node:process';\nimport os from 'node:os';\nimport tty from 'node:tty';\n\n// From: https://github.com/sindresorhus/has-flag/blob/main/index.js\n/// function hasFlag(flag, argv = globalThis.Deno?.args ?? process.argv) {\nfunction hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process.argv) {\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst position = argv.indexOf(prefix + flag);\n\tconst terminatorPosition = argv.indexOf('--');\n\treturn position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);\n}\n\nconst {env} = process;\n\nlet flagForceColor;\nif (\n\thasFlag('no-color')\n\t|| hasFlag('no-colors')\n\t|| hasFlag('color=false')\n\t|| hasFlag('color=never')\n) {\n\tflagForceColor = 0;\n} else if (\n\thasFlag('color')\n\t|| hasFlag('colors')\n\t|| hasFlag('color=true')\n\t|| hasFlag('color=always')\n) {\n\tflagForceColor = 1;\n}\n\n// Whether `FORCE_COLOR` names a level. Shared with the exact-level check below so that the two cannot disagree on what counts as numeric.\nfunction hasNumericForceColor() {\n\treturn /^\\d+$/.test(env.FORCE_COLOR);\n}\n\nfunction envForceColor() {\n\tif (!('FORCE_COLOR' in env)) {\n\t\treturn;\n\t}\n\n\tif (env.FORCE_COLOR === 'false') {\n\t\treturn 0;\n\t}\n\n\tif (env.FORCE_COLOR === 'true' || env.FORCE_COLOR.length === 0) {\n\t\treturn 1;\n\t}\n\n\tif (!hasNumericForceColor()) {\n\t\treturn;\n\t}\n\n\treturn Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3,\n\t};\n}\n\nfunction _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) {\n\tconst noFlagForceColor = envForceColor();\n\tif (noFlagForceColor !== undefined) {\n\t\tflagForceColor = noFlagForceColor;\n\t}\n\n\tconst forceColor = sniffFlags ? flagForceColor : noFlagForceColor;\n\n\tif (forceColor === 0) {\n\t\treturn 0;\n\t}\n\n\tif (sniffFlags) {\n\t\tif (hasFlag('color=16m')\n\t\t\t|| hasFlag('color=full')\n\t\t\t|| hasFlag('color=truecolor')) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (hasFlag('color=256')) {\n\t\t\treturn 2;\n\t\t}\n\t}\n\n\t// A numeric `FORCE_COLOR` requests an exact level, while `FORCE_COLOR=true` and `FORCE_COLOR=` only enable color and let the level be detected.\n\tif (forceColor !== undefined && hasNumericForceColor()) {\n\t\treturn forceColor;\n\t}\n\n\t// Check for Azure DevOps pipelines.\n\t// Has to be above the `!streamIsTTY` check.\n\tif ('TF_BUILD' in env && 'AGENT_NAME' in env) {\n\t\treturn 1;\n\t}\n\n\tif (haveStream && !streamIsTTY && forceColor === undefined) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor || 0;\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\tif (process.platform === 'win32') {\n\t\t// Windows 10 build 10586 is the first Windows release that supports 256 colors.\n\t\t// Windows 10 build 14931 is the first release that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(osRelease[0]) >= 10\n\t\t\t&& Number(osRelease[2]) >= 10_586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14_931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif (['GITHUB_ACTIONS', 'GITEA_ACTIONS', 'CIRCLECI'].some(key => key in env)) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (['TRAVIS', 'APPVEYOR', 'GITLAB_CI', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(?:9\\.0*[1-9]\\d*\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'xterm-kitty') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'xterm-ghostty') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'wezterm') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.', 1)[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app': {\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\t}\n\n\t\t\tcase 'Apple_Terminal': {\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(?:color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\treturn min;\n}\n\nexport function createSupportsColor(stream, options = {}) {\n\tconst level = _supportsColor(stream, {\n\t\tstreamIsTTY: stream && stream.isTTY,\n\t\t...options,\n\t});\n\n\treturn translateLevel(level);\n}\n\nconst supportsColor = {\n\tstdout: createSupportsColor({isTTY: tty.isatty(1)}),\n\tstderr: createSupportsColor({isTTY: tty.isatty(2)}),\n};\n\nexport default supportsColor;\n","import {\n\tstringReplaceAll,\n\tstringEncaseCRLFWithFirstIndex,\n} from './utilities.js';\nimport ansiStyles from '#ansi-styles';\nimport supportsColor from '#supports-color';\n\nconst {stdout: stdoutColor, stderr: stderrColor} = supportsColor;\n\nconst GENERATOR = Symbol('GENERATOR');\nconst STYLER = Symbol('STYLER');\nconst IS_EMPTY = Symbol('IS_EMPTY');\nconst LEVEL = Symbol('LEVEL');\n\nconst styles = Object.create(null);\n\nconst assertValidLevel = level => {\n\tif (!Number.isSafeInteger(level) || level < 0 || level > 3) {\n\t\tthrow new Error('The `level` should be an integer from 0 to 3');\n\t}\n};\n\n// The level is stored under a symbol so the hot path can read it as a plain property, while `level` itself is an accessor that rejects values the rest of the code could not handle.\nconst levelDescriptor = {\n\tenumerable: true,\n\tget() {\n\t\treturn this[LEVEL];\n\t},\n\tset(level) {\n\t\tassertValidLevel(level);\n\t\tthis[LEVEL] = level;\n\t},\n};\n\nconst applyOptions = (object, options = {}) => {\n\tif (options.level !== undefined) {\n\t\tassertValidLevel(options.level);\n\t}\n\n\t// Detect level if not set manually. Written under the symbol rather than through `level`, as the prototype carrying that accessor is not installed until after this runs.\n\tconst colorLevel = stdoutColor ? stdoutColor.level : 0;\n\tobject[LEVEL] = options.level === undefined ? colorLevel : options.level;\n};\n\nexport class Chalk {\n\tconstructor(options) {\n\t\t// eslint-disable-next-line no-constructor-return\n\t\treturn chalkFactory(options);\n\t}\n}\n\nconst chalkFactory = options => {\n\tconst chalk = (...strings) => strings.join(' ');\n\tapplyOptions(chalk, options);\n\n\tObject.setPrototypeOf(chalk, createChalk.prototype);\n\n\treturn chalk;\n};\n\nfunction createChalk(options) {\n\treturn chalkFactory(options);\n}\n\n// eslint-disable-next-line unicorn/no-top-level-side-effects -- The prototype chain must be set up at module load.\nObject.setPrototypeOf(createChalk.prototype, Function.prototype);\n\nfor (const [styleName, style] of Object.entries(ansiStyles)) {\n\tstyles[styleName] = {\n\t\tget() {\n\t\t\tconst builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);\n\t\t\tObject.defineProperty(this, styleName, {value: builder});\n\t\t\treturn builder;\n\t\t},\n\t};\n}\n\nstyles.visible = {\n\tget() {\n\t\tconst builder = createBuilder(this, this[STYLER], true);\n\t\tObject.defineProperty(this, 'visible', {value: builder});\n\t\treturn builder;\n\t},\n};\n\n// Resolve a color model to one converter per `level`, so that a call only has to look up the converter for the current level instead of re-deciding the model and level every time.\nconst createModelConverters = (model, type) => {\n\tconst style = ansiStyles[type];\n\n\tif (model === 'rgb') {\n\t\tconst ansi = (red, green, blue) => style.ansi(ansiStyles.rgbToAnsi(red, green, blue));\n\t\tconst ansi256 = (red, green, blue) => style.ansi256(ansiStyles.rgbToAnsi256(red, green, blue));\n\t\treturn [ansi, ansi, ansi256, style.ansi16m];\n\t}\n\n\tif (model === 'hex') {\n\t\tconst ansi = hex => style.ansi(ansiStyles.hexToAnsi(hex));\n\t\tconst ansi256 = hex => style.ansi256(ansiStyles.hexToAnsi256(hex));\n\t\treturn [ansi, ansi, ansi256, hex => style.ansi16m(...ansiStyles.hexToRgb(hex))];\n\t}\n\n\t// `ansi256` is already the native form, so only the 16-color levels need converting.\n\tconst ansi = code => style.ansi(ansiStyles.ansi256ToAnsi(code));\n\treturn [ansi, ansi, style.ansi256, style.ansi256];\n};\n\nconst usedModels = ['rgb', 'hex', 'ansi256'];\n\nfor (const model of usedModels) {\n\tconst capitalizedModel = model[0].toUpperCase() + model.slice(1);\n\n\tfor (const [styleName, type] of [\n\t\t[model, 'color'],\n\t\t['bg' + capitalizedModel, 'bgColor'],\n\t\t['underline' + capitalizedModel, 'underlineColor'],\n\t]) {\n\t\tconst {close} = ansiStyles[type];\n\t\tconst converters = createModelConverters(model, type);\n\n\t\tstyles[styleName] = {\n\t\t\tget() {\n\t\t\t\t// The level is read on call rather than captured here so the function can be cached on the instance instead of being reallocated on every property access.\n\t\t\t\t// `rgb` is the widest model, so naming the three parameters avoids a rest array.\n\t\t\t\tconst styleFunction = function (first, second, third) {\n\t\t\t\t\tconst open = converters[this.level](first, second, third);\n\t\t\t\t\treturn createBuilder(this, createStyler(open, close, this[STYLER]), this[IS_EMPTY]);\n\t\t\t\t};\n\n\t\t\t\tObject.defineProperty(this, styleName, {value: styleFunction});\n\t\t\t\treturn styleFunction;\n\t\t\t},\n\t\t};\n\t}\n}\n\nconst proto = Object.defineProperties(\n\t() => {},\n\t{\n\t\t...styles,\n\t\tlevel: {\n\t\t\tenumerable: true,\n\t\t\tget() {\n\t\t\t\treturn this[GENERATOR].level;\n\t\t\t},\n\t\t\tset(level) {\n\t\t\t\tthis[GENERATOR].level = level;\n\t\t\t},\n\t\t},\n\t},\n);\n\nconst createStyler = (open, close, parent) => {\n\tlet openAll;\n\tlet closeAll;\n\tif (parent === undefined) {\n\t\topenAll = open;\n\t\tcloseAll = close;\n\t} else {\n\t\topenAll = parent.openAll + open;\n\t\tcloseAll = close + parent.closeAll;\n\t}\n\n\treturn {\n\t\topen,\n\t\tclose,\n\t\topenAll,\n\t\tcloseAll,\n\t\tparent,\n\t};\n};\n\nconst createBuilder = (self, _styler, _isEmpty) => {\n\t// Single argument is hot path, implicit coercion is faster than anything\n\tconst builder = (...arguments_) => {\n\t\tif (arguments_.length === 1) {\n\t\t\t// eslint-disable-next-line no-implicit-coercion\n\t\t\treturn applyStyle(builder, '' + arguments_[0]);\n\t\t}\n\n\t\tif (arguments_.length === 2) {\n\t\t\treturn applyStyle(builder, arguments_[0] + ' ' + arguments_[1]);\n\t\t}\n\n\t\treturn applyStyle(builder, arguments_.join(' '));\n\t};\n\n\t// We alter the prototype because we must return a function, but there is\n\t// no way to create a function with a different prototype\n\tObject.setPrototypeOf(builder, proto);\n\n\t// Point every builder at the root generator instead of its immediate parent, so reading the level costs one property load rather than walking a `level` getter per link of the chain.\n\tbuilder[GENERATOR] = self[GENERATOR] ?? self;\n\tbuilder[STYLER] = _styler;\n\tbuilder[IS_EMPTY] = _isEmpty;\n\n\treturn builder;\n};\n\nconst applyStyle = (self, string) => {\n\t// Read the level directly off the generator to skip the `level` getter dispatch on this hot path\n\tif (self[GENERATOR][LEVEL] <= 0 || !string) {\n\t\t// eslint-disable-next-line unicorn/no-computed-property-existence-check -- Reads the boolean value, not a property existence check.\n\t\treturn self[IS_EMPTY] ? '' : string;\n\t}\n\n\tlet styler = self[STYLER];\n\n\tif (styler === undefined) {\n\t\treturn string;\n\t}\n\n\tconst {openAll, closeAll} = styler;\n\tif (string.includes('\\u{1B}')) {\n\t\twhile (styler !== undefined) {\n\t\t\t// Replace any instances already present with a re-opening code\n\t\t\t// otherwise only the part of the string until said closing code\n\t\t\t// will be colored, and the rest will simply be 'plain'.\n\t\t\tstring = stringReplaceAll(string, styler.close, styler.open);\n\n\t\t\tstyler = styler.parent;\n\t\t}\n\t}\n\n\t// We can move both next actions out of loop, because remaining actions in loop won't have\n\t// any/visible effect on parts we add here. Close the styling before a linebreak and reopen\n\t// after next line to fix a bleed issue on macOS: https://github.com/chalk/chalk/pull/92\n\tconst lfIndex = string.indexOf('\\n');\n\tif (lfIndex !== -1) {\n\t\tstring = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);\n\t}\n\n\treturn openAll + string + closeAll;\n};\n\n// `level` lives on the prototype rather than on each instance, so it costs nothing to construct an instance and matches how builders already expose it. It is inherited rather than own, so it does not show up in `Object.keys()`, same as for a builder.\n// eslint-disable-next-line unicorn/no-top-level-side-effects -- The style getters must be installed at module load.\nObject.defineProperties(createChalk.prototype, {...styles, level: levelDescriptor});\n\nconst chalk = createChalk();\nexport const chalkStderr = createChalk({level: stderrColor ? stderrColor.level : 0});\n\nexport {\n\tmodifierNames,\n\tforegroundColorNames,\n\tbackgroundColorNames,\n\tunderlineColorNames,\n\tcolorNames,\n\n\t// TODO: Remove these aliases in the next major version\n\tmodifierNames as modifiers,\n\tforegroundColorNames as foregroundColors,\n\tbackgroundColorNames as backgroundColors,\n\tcolorNames as colors,\n} from './vendor/ansi-styles/index.js';\n\nexport {\n\tstdoutColor as supportsColor,\n\tstderrColor as supportsColorStderr,\n};\n\nexport default chalk;\n","let messages = [];\nlet level = 0;\n\nconst debug = (msg, min) => {\n if (level >= min) {\n messages.push(msg);\n }\n};\n\ndebug.WARN = 1;\ndebug.INFO = 2;\ndebug.DEBUG = 3;\n\ndebug.reset = () => {\n messages = [];\n};\n\ndebug.setDebugLevel = (v) => {\n level = v;\n};\n\ndebug.warn = (msg) => debug(msg, debug.WARN);\ndebug.info = (msg) => debug(msg, debug.INFO);\ndebug.debug = (msg) => debug(msg, debug.DEBUG);\n\ndebug.debugMessages = () => messages;\n\nmodule.exports = debug;\n","'use strict';\n\nmodule.exports = ({onlyFirst = false} = {}) => {\n\tconst pattern = [\n\t\t'[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]+)*|[a-zA-Z\\\\d]+(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]*)*)?\\\\u0007)',\n\t\t'(?:(?:\\\\d{1,4}(?:;\\\\d{0,4})*)?[\\\\dA-PR-TZcf-ntqry=><~]))'\n\t].join('|');\n\n\treturn new RegExp(pattern, onlyFirst ? undefined : 'g');\n};\n","'use strict';\nconst ansiRegex = require('ansi-regex');\n\nmodule.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string;\n","/* eslint-disable yoda */\n'use strict';\n\nconst isFullwidthCodePoint = codePoint => {\n\tif (Number.isNaN(codePoint)) {\n\t\treturn false;\n\t}\n\n\t// Code points are derived from:\n\t// http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt\n\tif (\n\t\tcodePoint >= 0x1100 && (\n\t\t\tcodePoint <= 0x115F || // Hangul Jamo\n\t\t\tcodePoint === 0x2329 || // LEFT-POINTING ANGLE BRACKET\n\t\t\tcodePoint === 0x232A || // RIGHT-POINTING ANGLE BRACKET\n\t\t\t// CJK Radicals Supplement .. Enclosed CJK Letters and Months\n\t\t\t(0x2E80 <= codePoint && codePoint <= 0x3247 && codePoint !== 0x303F) ||\n\t\t\t// Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A\n\t\t\t(0x3250 <= codePoint && codePoint <= 0x4DBF) ||\n\t\t\t// CJK Unified Ideographs .. Yi Radicals\n\t\t\t(0x4E00 <= codePoint && codePoint <= 0xA4C6) ||\n\t\t\t// Hangul Jamo Extended-A\n\t\t\t(0xA960 <= codePoint && codePoint <= 0xA97C) ||\n\t\t\t// Hangul Syllables\n\t\t\t(0xAC00 <= codePoint && codePoint <= 0xD7A3) ||\n\t\t\t// CJK Compatibility Ideographs\n\t\t\t(0xF900 <= codePoint && codePoint <= 0xFAFF) ||\n\t\t\t// Vertical Forms\n\t\t\t(0xFE10 <= codePoint && codePoint <= 0xFE19) ||\n\t\t\t// CJK Compatibility Forms .. Small Form Variants\n\t\t\t(0xFE30 <= codePoint && codePoint <= 0xFE6B) ||\n\t\t\t// Halfwidth and Fullwidth Forms\n\t\t\t(0xFF01 <= codePoint && codePoint <= 0xFF60) ||\n\t\t\t(0xFFE0 <= codePoint && codePoint <= 0xFFE6) ||\n\t\t\t// Kana Supplement\n\t\t\t(0x1B000 <= codePoint && codePoint <= 0x1B001) ||\n\t\t\t// Enclosed Ideographic Supplement\n\t\t\t(0x1F200 <= codePoint && codePoint <= 0x1F251) ||\n\t\t\t// CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane\n\t\t\t(0x20000 <= codePoint && codePoint <= 0x3FFFD)\n\t\t)\n\t) {\n\t\treturn true;\n\t}\n\n\treturn false;\n};\n\nmodule.exports = isFullwidthCodePoint;\nmodule.exports.default = isFullwidthCodePoint;\n","\"use strict\";\n\nmodule.exports = function () {\n // https://mths.be/emoji\n return /\\uD83C\\uDFF4\\uDB40\\uDC67\\uDB40\\uDC62(?:\\uDB40\\uDC65\\uDB40\\uDC6E\\uDB40\\uDC67|\\uDB40\\uDC73\\uDB40\\uDC63\\uDB40\\uDC74|\\uDB40\\uDC77\\uDB40\\uDC6C\\uDB40\\uDC73)\\uDB40\\uDC7F|\\uD83D\\uDC68(?:\\uD83C\\uDFFC\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68\\uD83C\\uDFFB|\\uD83C[\\uDF3E\\uDF73\\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\\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])|\\uD83C[\\uDF3E\\uDF73\\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])|\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\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])|(?:\\uD83D[\\uDC68\\uDC69])\\u200D(?:\\uD83D[\\uDC66\\uDC67])|[\\u2695\\u2696\\u2708]\\uFE0F|\\uD83D[\\uDC66\\uDC67]|\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|(?:\\uD83C\\uDFFB\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708])\\uFE0F|\\uD83C\\uDFFB\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C[\\uDFFB-\\uDFFF])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFB\\u200D\\uD83E\\uDD1D\\u200D\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83E\\uDD1D\\u200D\\uD83D\\uDC69)\\uD83C\\uDFFB|\\uD83E\\uDDD1(?:\\uD83C\\uDFFF\\u200D\\uD83E\\uDD1D\\u200D\\uD83E\\uDDD1(?:\\uD83C[\\uDFFB-\\uDFFF])|\\u200D\\uD83E\\uDD1D\\u200D\\uD83E\\uDDD1)|(?:\\uD83E\\uDDD1\\uD83C\\uDFFE\\u200D\\uD83E\\uDD1D\\u200D\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB-\\uDFFE])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFC\\u200D\\uD83E\\uDD1D\\u200D\\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:\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D(?:\\uD83D[\\uDC68\\uDC69])|\\uD83D[\\uDC68\\uDC69])|\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFF\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD]))|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D(?:\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67]))|(?:\\uD83E\\uDDD1\\uD83C\\uDFFD\\u200D\\uD83E\\uDD1D\\u200D\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83E\\uDD1D\\u200D\\uD83D\\uDC69)(?:\\uD83C[\\uDFFB-\\uDFFD])|\\uD83D\\uDC69\\u200D\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D(?:\\uD83D[\\uDC66\\uDC67])|(?:\\uD83D\\uDC41\\uFE0F\\u200D\\uD83D\\uDDE8|\\uD83D\\uDC69(?:\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFB\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\u200D[\\u2695\\u2696\\u2708])|(?:(?:\\u26F9|\\uD83C[\\uDFCB\\uDFCC]|\\uD83D\\uDD75)\\uFE0F|\\uD83D\\uDC6F|\\uD83E[\\uDD3C\\uDDDE\\uDDDF])\\u200D[\\u2640\\u2642]|(?:\\u26F9|\\uD83C[\\uDFCB\\uDFCC]|\\uD83D\\uDD75)(?:\\uD83C[\\uDFFB-\\uDFFF])\\u200D[\\u2640\\u2642]|(?:\\uD83C[\\uDFC3\\uDFC4\\uDFCA]|\\uD83D[\\uDC6E\\uDC71\\uDC73\\uDC77\\uDC81\\uDC82\\uDC86\\uDC87\\uDE45-\\uDE47\\uDE4B\\uDE4D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD6-\\uDDDD])(?:(?:\\uD83C[\\uDFFB-\\uDFFF])\\u200D[\\u2640\\u2642]|\\u200D[\\u2640\\u2642])|\\uD83C\\uDFF4\\u200D\\u2620)\\uFE0F|\\uD83D\\uDC69\\u200D\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67])|\\uD83C\\uDFF3\\uFE0F\\u200D\\uD83C\\uDF08|\\uD83D\\uDC15\\u200D\\uD83E\\uDDBA|\\uD83D\\uDC69\\u200D\\uD83D\\uDC66|\\uD83D\\uDC69\\u200D\\uD83D\\uDC67|\\uD83C\\uDDFD\\uD83C\\uDDF0|\\uD83C\\uDDF4\\uD83C\\uDDF2|\\uD83C\\uDDF6\\uD83C\\uDDE6|[#\\*0-9]\\uFE0F\\u20E3|\\uD83C\\uDDE7(?:\\uD83C[\\uDDE6\\uDDE7\\uDDE9-\\uDDEF\\uDDF1-\\uDDF4\\uDDF6-\\uDDF9\\uDDFB\\uDDFC\\uDDFE\\uDDFF])|\\uD83C\\uDDF9(?:\\uD83C[\\uDDE6\\uDDE8\\uDDE9\\uDDEB-\\uDDED\\uDDEF-\\uDDF4\\uDDF7\\uDDF9\\uDDF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uDC46-\\uDC50\\uDC66\\uDC67\\uDC6B-\\uDC6D\\uDC70\\uDC72\\uDC74-\\uDC76\\uDC78\\uDC7C\\uDC83\\uDC85\\uDCAA\\uDD74\\uDD7A\\uDD90\\uDD95\\uDD96\\uDE4C\\uDE4F\\uDEC0\\uDECC]|\\uD83E[\\uDD0F\\uDD18-\\uDD1C\\uDD1E\\uDD1F\\uDD30-\\uDD36\\uDDB5\\uDDB6\\uDDBB\\uDDD2-\\uDDD5])(?:\\uD83C[\\uDFFB-\\uDFFF])|(?:[\\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\\uDEEB\\uDEEC\\uDEF4-\\uDEFA\\uDFE0-\\uDFEB]|\\uD83E[\\uDD0D-\\uDD3A\\uDD3C-\\uDD45\\uDD47-\\uDD71\\uDD73-\\uDD76\\uDD7A-\\uDDA2\\uDDA5-\\uDDAA\\uDDAE-\\uDDCA\\uDDCD-\\uDDFF\\uDE70-\\uDE73\\uDE78-\\uDE7A\\uDE80-\\uDE82\\uDE90-\\uDE95])|(?:[#\\*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\\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-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ripAnsi = require('strip-ansi');\nconst isFullwidthCodePoint = require('is-fullwidth-code-point');\nconst emojiRegex = require('emoji-regex');\n\nconst stringWidth = string => {\n\tif (typeof string !== 'string' || string.length === 0) {\n\t\treturn 0;\n\t}\n\n\tstring = stripAnsi(string);\n\n\tif (string.length === 0) {\n\t\treturn 0;\n\t}\n\n\tstring = string.replace(emojiRegex(), ' ');\n\n\tlet width = 0;\n\n\tfor (let i = 0; i < string.length; i++) {\n\t\tconst code = string.codePointAt(i);\n\n\t\t// Ignore control characters\n\t\tif (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Ignore combining characters\n\t\tif (code >= 0x300 && code <= 0x36F) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Surrogates\n\t\tif (code > 0xFFFF) {\n\t\t\ti++;\n\t\t}\n\n\t\twidth += isFullwidthCodePoint(code) ? 2 : 1;\n\t}\n\n\treturn width;\n};\n\nmodule.exports = stringWidth;\n// TODO: remove this in the next major version\nmodule.exports.default = stringWidth;\n","const stringWidth = require('string-width');\n\nfunction codeRegex(capture) {\n return capture ? /\\u001b\\[((?:\\d*;){0,5}\\d*)m/g : /\\u001b\\[(?:\\d*;){0,5}\\d*m/g;\n}\n\nfunction strlen(str) {\n let code = codeRegex();\n let stripped = ('' + str).replace(code, '');\n let split = stripped.split('\\n');\n return split.reduce(function (memo, s) {\n return stringWidth(s) > memo ? stringWidth(s) : memo;\n }, 0);\n}\n\nfunction repeat(str, times) {\n return Array(times + 1).join(str);\n}\n\nfunction pad(str, len, pad, dir) {\n let length = strlen(str);\n if (len + 1 >= length) {\n let padlen = len - length;\n switch (dir) {\n case 'right': {\n str = repeat(pad, padlen) + str;\n break;\n }\n case 'center': {\n let right = Math.ceil(padlen / 2);\n let left = padlen - right;\n str = repeat(pad, left) + str + repeat(pad, right);\n break;\n }\n default: {\n str = str + repeat(pad, padlen);\n break;\n }\n }\n }\n return str;\n}\n\nlet codeCache = {};\n\nfunction addToCodeCache(name, on, off) {\n on = '\\u001b[' + on + 'm';\n off = '\\u001b[' + off + 'm';\n codeCache[on] = { set: name, to: true };\n codeCache[off] = { set: name, to: false };\n codeCache[name] = { on: on, off: off };\n}\n\n//https://github.com/Marak/colors.js/blob/master/lib/styles.js\naddToCodeCache('bold', 1, 22);\naddToCodeCache('italics', 3, 23);\naddToCodeCache('underline', 4, 24);\naddToCodeCache('inverse', 7, 27);\naddToCodeCache('strikethrough', 9, 29);\n\nfunction updateState(state, controlChars) {\n let controlCode = controlChars[1] ? parseInt(controlChars[1].split(';')[0]) : 0;\n if ((controlCode >= 30 && controlCode <= 39) || (controlCode >= 90 && controlCode <= 97)) {\n state.lastForegroundAdded = controlChars[0];\n return;\n }\n if ((controlCode >= 40 && controlCode <= 49) || (controlCode >= 100 && controlCode <= 107)) {\n state.lastBackgroundAdded = controlChars[0];\n return;\n }\n if (controlCode === 0) {\n for (let i in state) {\n /* istanbul ignore else */\n if (Object.prototype.hasOwnProperty.call(state, i)) {\n delete state[i];\n }\n }\n return;\n }\n let info = codeCache[controlChars[0]];\n if (info) {\n state[info.set] = info.to;\n }\n}\n\nfunction readState(line) {\n let code = codeRegex(true);\n let controlChars = code.exec(line);\n let state = {};\n while (controlChars !== null) {\n updateState(state, controlChars);\n controlChars = code.exec(line);\n }\n return state;\n}\n\nfunction unwindState(state, ret) {\n let lastBackgroundAdded = state.lastBackgroundAdded;\n let lastForegroundAdded = state.lastForegroundAdded;\n\n delete state.lastBackgroundAdded;\n delete state.lastForegroundAdded;\n\n Object.keys(state).forEach(function (key) {\n if (state[key]) {\n ret += codeCache[key].off;\n }\n });\n\n if (lastBackgroundAdded && lastBackgroundAdded != '\\u001b[49m') {\n ret += '\\u001b[49m';\n }\n if (lastForegroundAdded && lastForegroundAdded != '\\u001b[39m') {\n ret += '\\u001b[39m';\n }\n\n return ret;\n}\n\nfunction rewindState(state, ret) {\n let lastBackgroundAdded = state.lastBackgroundAdded;\n let lastForegroundAdded = state.lastForegroundAdded;\n\n delete state.lastBackgroundAdded;\n delete state.lastForegroundAdded;\n\n Object.keys(state).forEach(function (key) {\n if (state[key]) {\n ret = codeCache[key].on + ret;\n }\n });\n\n if (lastBackgroundAdded && lastBackgroundAdded != '\\u001b[49m') {\n ret = lastBackgroundAdded + ret;\n }\n if (lastForegroundAdded && lastForegroundAdded != '\\u001b[39m') {\n ret = lastForegroundAdded + ret;\n }\n\n return ret;\n}\n\nfunction truncateWidth(str, desiredLength) {\n if (str.length === strlen(str)) {\n return str.substr(0, desiredLength);\n }\n\n while (strlen(str) > desiredLength) {\n str = str.slice(0, -1);\n }\n\n return str;\n}\n\nfunction truncateWidthWithAnsi(str, desiredLength) {\n let code = codeRegex(true);\n let split = str.split(codeRegex());\n let splitIndex = 0;\n let retLen = 0;\n let ret = '';\n let myArray;\n let state = {};\n\n while (retLen < desiredLength) {\n myArray = code.exec(str);\n let toAdd = split[splitIndex];\n splitIndex++;\n if (retLen + strlen(toAdd) > desiredLength) {\n toAdd = truncateWidth(toAdd, desiredLength - retLen);\n }\n ret += toAdd;\n retLen += strlen(toAdd);\n\n if (retLen < desiredLength) {\n if (!myArray) {\n break;\n } // full-width chars may cause a whitespace which cannot be filled\n ret += myArray[0];\n updateState(state, myArray);\n }\n }\n\n return unwindState(state, ret);\n}\n\nfunction truncate(str, desiredLength, truncateChar) {\n truncateChar = truncateChar || '…';\n let lengthOfStr = strlen(str);\n if (lengthOfStr <= desiredLength) {\n return str;\n }\n desiredLength -= strlen(truncateChar);\n\n let ret = truncateWidthWithAnsi(str, desiredLength);\n\n ret += truncateChar;\n\n const hrefTag = '\\x1B]8;;\\x07';\n\n if (str.includes(hrefTag) && !ret.includes(hrefTag)) {\n ret += hrefTag;\n }\n\n return ret;\n}\n\nfunction defaultOptions() {\n return {\n chars: {\n top: '─',\n 'top-mid': '┬',\n 'top-left': '┌',\n 'top-right': '┐',\n bottom: '─',\n 'bottom-mid': '┴',\n 'bottom-left': '└',\n 'bottom-right': '┘',\n left: '│',\n 'left-mid': '├',\n mid: '─',\n 'mid-mid': '┼',\n right: '│',\n 'right-mid': '┤',\n middle: '│',\n },\n truncate: '…',\n colWidths: [],\n rowHeights: [],\n colAligns: [],\n rowAligns: [],\n style: {\n 'padding-left': 1,\n 'padding-right': 1,\n head: ['red'],\n border: ['grey'],\n compact: false,\n },\n head: [],\n };\n}\n\nfunction mergeOptions(options, defaults) {\n options = options || {};\n defaults = defaults || defaultOptions();\n let ret = Object.assign({}, defaults, options);\n ret.chars = Object.assign({}, defaults.chars, options.chars);\n ret.style = Object.assign({}, defaults.style, options.style);\n return ret;\n}\n\n// Wrap on word boundary\nfunction wordWrap(maxLength, input) {\n let lines = [];\n let split = input.split(/(\\s+)/g);\n let line = [];\n let lineLength = 0;\n let whitespace;\n for (let i = 0; i < split.length; i += 2) {\n let word = split[i];\n let newLength = lineLength + strlen(word);\n if (lineLength > 0 && whitespace) {\n newLength += whitespace.length;\n }\n if (newLength > maxLength) {\n if (lineLength !== 0) {\n lines.push(line.join(''));\n }\n line = [word];\n lineLength = strlen(word);\n } else {\n line.push(whitespace || '', word);\n lineLength = newLength;\n }\n whitespace = split[i + 1];\n }\n if (lineLength) {\n lines.push(line.join(''));\n }\n return lines;\n}\n\n// Wrap text (ignoring word boundaries)\nfunction textWrap(maxLength, input) {\n let lines = [];\n let line = '';\n function pushLine(str, ws) {\n if (line.length && ws) line += ws;\n line += str;\n while (line.length > maxLength) {\n lines.push(line.slice(0, maxLength));\n line = line.slice(maxLength);\n }\n }\n let split = input.split(/(\\s+)/g);\n for (let i = 0; i < split.length; i += 2) {\n pushLine(split[i], i && split[i - 1]);\n }\n if (line.length) lines.push(line);\n return lines;\n}\n\nfunction multiLineWordWrap(maxLength, input, wrapOnWordBoundary = true) {\n let output = [];\n input = input.split('\\n');\n const handler = wrapOnWordBoundary ? wordWrap : textWrap;\n for (let i = 0; i < input.length; i++) {\n output.push.apply(output, handler(maxLength, input[i]));\n }\n return output;\n}\n\nfunction colorizeLines(input) {\n let state = {};\n let output = [];\n for (let i = 0; i < input.length; i++) {\n let line = rewindState(state, input[i]);\n state = readState(line);\n let temp = Object.assign({}, state);\n output.push(unwindState(temp, line));\n }\n return output;\n}\n\n/**\n * Credit: Matheus Sampaio https://github.com/matheussampaio\n */\nfunction hyperlink(url, text) {\n const OSC = '\\u001B]';\n const BEL = '\\u0007';\n const SEP = ';';\n\n return [OSC, '8', SEP, SEP, url || text, BEL, text, OSC, '8', SEP, SEP, BEL].join('');\n}\n\nmodule.exports = {\n strlen: strlen,\n repeat: repeat,\n pad: pad,\n truncate: truncate,\n mergeOptions: mergeOptions,\n wordWrap: multiLineWordWrap,\n colorizeLines: colorizeLines,\n hyperlink,\n};\n","/*\nThe MIT License (MIT)\n\nCopyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n*/\n\nvar styles = {};\nmodule['exports'] = styles;\n\nvar codes = {\n reset: [0, 0],\n\n bold: [1, 22],\n dim: [2, 22],\n italic: [3, 23],\n underline: [4, 24],\n inverse: [7, 27],\n hidden: [8, 28],\n strikethrough: [9, 29],\n\n black: [30, 39],\n red: [31, 39],\n green: [32, 39],\n yellow: [33, 39],\n blue: [34, 39],\n magenta: [35, 39],\n cyan: [36, 39],\n white: [37, 39],\n gray: [90, 39],\n grey: [90, 39],\n\n brightRed: [91, 39],\n brightGreen: [92, 39],\n brightYellow: [93, 39],\n brightBlue: [94, 39],\n brightMagenta: [95, 39],\n brightCyan: [96, 39],\n brightWhite: [97, 39],\n\n bgBlack: [40, 49],\n bgRed: [41, 49],\n bgGreen: [42, 49],\n bgYellow: [43, 49],\n bgBlue: [44, 49],\n bgMagenta: [45, 49],\n bgCyan: [46, 49],\n bgWhite: [47, 49],\n bgGray: [100, 49],\n bgGrey: [100, 49],\n\n bgBrightRed: [101, 49],\n bgBrightGreen: [102, 49],\n bgBrightYellow: [103, 49],\n bgBrightBlue: [104, 49],\n bgBrightMagenta: [105, 49],\n bgBrightCyan: [106, 49],\n bgBrightWhite: [107, 49],\n\n // legacy styles for colors pre v1.0.0\n blackBG: [40, 49],\n redBG: [41, 49],\n greenBG: [42, 49],\n yellowBG: [43, 49],\n blueBG: [44, 49],\n magentaBG: [45, 49],\n cyanBG: [46, 49],\n whiteBG: [47, 49],\n\n};\n\nObject.keys(codes).forEach(function(key) {\n var val = codes[key];\n var style = styles[key] = [];\n style.open = '\\u001b[' + val[0] + 'm';\n style.close = '\\u001b[' + val[1] + 'm';\n});\n","/*\nMIT License\n\nCopyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*/\n\n'use strict';\n\nmodule.exports = function(flag, argv) {\n argv = argv || process.argv;\n\n var terminatorPos = argv.indexOf('--');\n var prefix = /^-{1,2}/.test(flag) ? '' : '--';\n var pos = argv.indexOf(prefix + flag);\n\n return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);\n};\n","/*\nThe MIT License (MIT)\n\nCopyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n*/\n\n'use strict';\n\nvar os = require('os');\nvar hasFlag = require('./has-flag.js');\n\nvar env = process.env;\n\nvar forceColor = void 0;\nif (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false')) {\n forceColor = false;\n} else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true')\n || hasFlag('color=always')) {\n forceColor = true;\n}\nif ('FORCE_COLOR' in env) {\n forceColor = env.FORCE_COLOR.length === 0\n || parseInt(env.FORCE_COLOR, 10) !== 0;\n}\n\nfunction translateLevel(level) {\n if (level === 0) {\n return false;\n }\n\n return {\n level: level,\n hasBasic: true,\n has256: level >= 2,\n has16m: level >= 3,\n };\n}\n\nfunction supportsColor(stream) {\n if (forceColor === false) {\n return 0;\n }\n\n if (hasFlag('color=16m') || hasFlag('color=full')\n || hasFlag('color=truecolor')) {\n return 3;\n }\n\n if (hasFlag('color=256')) {\n return 2;\n }\n\n if (stream && !stream.isTTY && forceColor !== true) {\n return 0;\n }\n\n var min = forceColor ? 1 : 0;\n\n if (process.platform === 'win32') {\n // Node.js 7.5.0 is the first version of Node.js to include a patch to\n // libuv that enables 256 color output on Windows. Anything earlier and it\n // won't work. However, here we target Node.js 8 at minimum as it is an LTS\n // release, and Node.js 7 is not. Windows 10 build 10586 is the first\n // Windows release that supports 256 colors. Windows 10 build 14931 is the\n // first release that supports 16m/TrueColor.\n var osRelease = os.release().split('.');\n if (Number(process.versions.node.split('.')[0]) >= 8\n && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {\n return Number(osRelease[2]) >= 14931 ? 3 : 2;\n }\n\n return 1;\n }\n\n if ('CI' in env) {\n if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(function(sign) {\n return sign in env;\n }) || env.CI_NAME === 'codeship') {\n return 1;\n }\n\n return min;\n }\n\n if ('TEAMCITY_VERSION' in env) {\n return (/^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0\n );\n }\n\n if ('TERM_PROGRAM' in env) {\n var version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n switch (env.TERM_PROGRAM) {\n case 'iTerm.app':\n return version >= 3 ? 3 : 2;\n case 'Hyper':\n return 3;\n case 'Apple_Terminal':\n return 2;\n // No default\n }\n }\n\n if (/-256(color)?$/i.test(env.TERM)) {\n return 2;\n }\n\n if (/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n return 1;\n }\n\n if ('COLORTERM' in env) {\n return 1;\n }\n\n if (env.TERM === 'dumb') {\n return min;\n }\n\n return min;\n}\n\nfunction getSupportLevel(stream) {\n var level = supportsColor(stream);\n return translateLevel(level);\n}\n\nmodule.exports = {\n supportsColor: getSupportLevel,\n stdout: getSupportLevel(process.stdout),\n stderr: getSupportLevel(process.stderr),\n};\n","module['exports'] = function runTheTrap(text, options) {\n var result = '';\n text = text || 'Run the trap, drop the bass';\n text = text.split('');\n var trap = {\n a: ['\\u0040', '\\u0104', '\\u023a', '\\u0245', '\\u0394', '\\u039b', '\\u0414'],\n b: ['\\u00df', '\\u0181', '\\u0243', '\\u026e', '\\u03b2', '\\u0e3f'],\n c: ['\\u00a9', '\\u023b', '\\u03fe'],\n d: ['\\u00d0', '\\u018a', '\\u0500', '\\u0501', '\\u0502', '\\u0503'],\n e: ['\\u00cb', '\\u0115', '\\u018e', '\\u0258', '\\u03a3', '\\u03be', '\\u04bc',\n '\\u0a6c'],\n f: ['\\u04fa'],\n g: ['\\u0262'],\n h: ['\\u0126', '\\u0195', '\\u04a2', '\\u04ba', '\\u04c7', '\\u050a'],\n i: ['\\u0f0f'],\n j: ['\\u0134'],\n k: ['\\u0138', '\\u04a0', '\\u04c3', '\\u051e'],\n l: ['\\u0139'],\n m: ['\\u028d', '\\u04cd', '\\u04ce', '\\u0520', '\\u0521', '\\u0d69'],\n n: ['\\u00d1', '\\u014b', '\\u019d', '\\u0376', '\\u03a0', '\\u048a'],\n o: ['\\u00d8', '\\u00f5', '\\u00f8', '\\u01fe', '\\u0298', '\\u047a', '\\u05dd',\n '\\u06dd', '\\u0e4f'],\n p: ['\\u01f7', '\\u048e'],\n q: ['\\u09cd'],\n r: ['\\u00ae', '\\u01a6', '\\u0210', '\\u024c', '\\u0280', '\\u042f'],\n s: ['\\u00a7', '\\u03de', '\\u03df', '\\u03e8'],\n t: ['\\u0141', '\\u0166', '\\u0373'],\n u: ['\\u01b1', '\\u054d'],\n v: ['\\u05d8'],\n w: ['\\u0428', '\\u0460', '\\u047c', '\\u0d70'],\n x: ['\\u04b2', '\\u04fe', '\\u04fc', '\\u04fd'],\n y: ['\\u00a5', '\\u04b0', '\\u04cb'],\n z: ['\\u01b5', '\\u0240'],\n };\n text.forEach(function(c) {\n c = c.toLowerCase();\n var chars = trap[c] || [' '];\n var rand = Math.floor(Math.random() * chars.length);\n if (typeof trap[c] !== 'undefined') {\n result += trap[c][rand];\n } else {\n result += c;\n }\n });\n return result;\n};\n","// please no\nmodule['exports'] = function zalgo(text, options) {\n text = text || ' he is here ';\n var soul = {\n 'up': [\n '̍', '̎', '̄', '̅',\n '̿', '̑', '̆', '̐',\n '͒', '͗', '͑', '̇',\n '̈', '̊', '͂', '̓',\n '̈', '͊', '͋', '͌',\n '̃', '̂', '̌', '͐',\n '̀', '́', '̋', '̏',\n '̒', '̓', '̔', '̽',\n '̉', 'ͣ', 'ͤ', 'ͥ',\n 'ͦ', 'ͧ', 'ͨ', 'ͩ',\n 'ͪ', 'ͫ', 'ͬ', 'ͭ',\n 'ͮ', 'ͯ', '̾', '͛',\n '͆', '̚',\n ],\n 'down': [\n '̖', '̗', '̘', '̙',\n '̜', '̝', '̞', '̟',\n '̠', '̤', '̥', '̦',\n '̩', '̪', '̫', '̬',\n '̭', '̮', '̯', '̰',\n '̱', '̲', '̳', '̹',\n '̺', '̻', '̼', 'ͅ',\n '͇', '͈', '͉', '͍',\n '͎', '͓', '͔', '͕',\n '͖', '͙', '͚', '̣',\n ],\n 'mid': [\n '̕', '̛', '̀', '́',\n '͘', '̡', '̢', '̧',\n '̨', '̴', '̵', '̶',\n '͜', '͝', '͞',\n '͟', '͠', '͢', '̸',\n '̷', '͡', ' ҉',\n ],\n };\n var all = [].concat(soul.up, soul.down, soul.mid);\n\n function randomNumber(range) {\n var r = Math.floor(Math.random() * range);\n return r;\n }\n\n function isChar(character) {\n var bool = false;\n all.filter(function(i) {\n bool = (i === character);\n });\n return bool;\n }\n\n\n function heComes(text, options) {\n var result = '';\n var counts;\n var l;\n options = options || {};\n options['up'] =\n typeof options['up'] !== 'undefined' ? options['up'] : true;\n options['mid'] =\n typeof options['mid'] !== 'undefined' ? options['mid'] : true;\n options['down'] =\n typeof options['down'] !== 'undefined' ? options['down'] : true;\n options['size'] =\n typeof options['size'] !== 'undefined' ? options['size'] : 'maxi';\n text = text.split('');\n for (l in text) {\n if (isChar(l)) {\n continue;\n }\n result = result + text[l];\n counts = {'up': 0, 'down': 0, 'mid': 0};\n switch (options.size) {\n case 'mini':\n counts.up = randomNumber(8);\n counts.mid = randomNumber(2);\n counts.down = randomNumber(8);\n break;\n case 'maxi':\n counts.up = randomNumber(16) + 3;\n counts.mid = randomNumber(4) + 1;\n counts.down = randomNumber(64) + 3;\n break;\n default:\n counts.up = randomNumber(8) + 1;\n counts.mid = randomNumber(6) / 2;\n counts.down = randomNumber(8) + 1;\n break;\n }\n\n var arr = ['up', 'mid', 'down'];\n for (var d in arr) {\n var index = arr[d];\n for (var i = 0; i <= counts[index]; i++) {\n if (options[index]) {\n result = result + soul[index][randomNumber(soul[index].length)];\n }\n }\n }\n }\n return result;\n }\n // don't summon him\n return heComes(text, options);\n};\n\n","module['exports'] = function(colors) {\n return function(letter, i, exploded) {\n if (letter === ' ') return letter;\n switch (i%3) {\n case 0: return colors.red(letter);\n case 1: return colors.white(letter);\n case 2: return colors.blue(letter);\n }\n };\n};\n","module['exports'] = function(colors) {\n return function(letter, i, exploded) {\n return i % 2 === 0 ? letter : colors.inverse(letter);\n };\n};\n","module['exports'] = function(colors) {\n // RoY G BiV\n var rainbowColors = ['red', 'yellow', 'green', 'blue', 'magenta'];\n return function(letter, i, exploded) {\n if (letter === ' ') {\n return letter;\n } else {\n return colors[rainbowColors[i++ % rainbowColors.length]](letter);\n }\n };\n};\n\n","module['exports'] = function(colors) {\n var available = ['underline', 'inverse', 'grey', 'yellow', 'red', 'green',\n 'blue', 'white', 'cyan', 'magenta', 'brightYellow', 'brightRed',\n 'brightGreen', 'brightBlue', 'brightWhite', 'brightCyan', 'brightMagenta'];\n return function(letter, i, exploded) {\n return letter === ' ' ? letter :\n colors[\n available[Math.round(Math.random() * (available.length - 2))]\n ](letter);\n };\n};\n","/*\n\nThe MIT License (MIT)\n\nOriginal Library\n - Copyright (c) Marak Squires\n\nAdditional functionality\n - Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n*/\n\nvar colors = {};\nmodule['exports'] = colors;\n\ncolors.themes = {};\n\nvar util = require('util');\nvar ansiStyles = colors.styles = require('./styles');\nvar defineProps = Object.defineProperties;\nvar newLineRegex = new RegExp(/[\\r\\n]+/g);\n\ncolors.supportsColor = require('./system/supports-colors').supportsColor;\n\nif (typeof colors.enabled === 'undefined') {\n colors.enabled = colors.supportsColor() !== false;\n}\n\ncolors.enable = function() {\n colors.enabled = true;\n};\n\ncolors.disable = function() {\n colors.enabled = false;\n};\n\ncolors.stripColors = colors.strip = function(str) {\n return ('' + str).replace(/\\x1B\\[\\d+m/g, '');\n};\n\n// eslint-disable-next-line no-unused-vars\nvar stylize = colors.stylize = function stylize(str, style) {\n if (!colors.enabled) {\n return str+'';\n }\n\n var styleMap = ansiStyles[style];\n\n // Stylize should work for non-ANSI styles, too\n if (!styleMap && style in colors) {\n // Style maps like trap operate as functions on strings;\n // they don't have properties like open or close.\n return colors[style](str);\n }\n\n return styleMap.open + str + styleMap.close;\n};\n\nvar matchOperatorsRe = /[|\\\\{}()[\\]^$+*?.]/g;\nvar escapeStringRegexp = function(str) {\n if (typeof str !== 'string') {\n throw new TypeError('Expected a string');\n }\n return str.replace(matchOperatorsRe, '\\\\$&');\n};\n\nfunction build(_styles) {\n var builder = function builder() {\n return applyStyle.apply(builder, arguments);\n };\n builder._styles = _styles;\n // __proto__ is used because we must return a function, but there is\n // no way to create a function with a different prototype.\n builder.__proto__ = proto;\n return builder;\n}\n\nvar styles = (function() {\n var ret = {};\n ansiStyles.grey = ansiStyles.gray;\n Object.keys(ansiStyles).forEach(function(key) {\n ansiStyles[key].closeRe =\n new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');\n ret[key] = {\n get: function() {\n return build(this._styles.concat(key));\n },\n };\n });\n return ret;\n})();\n\nvar proto = defineProps(function colors() {}, styles);\n\nfunction applyStyle() {\n var args = Array.prototype.slice.call(arguments);\n\n var str = args.map(function(arg) {\n // Use weak equality check so we can colorize null/undefined in safe mode\n if (arg != null && arg.constructor === String) {\n return arg;\n } else {\n return util.inspect(arg);\n }\n }).join(' ');\n\n if (!colors.enabled || !str) {\n return str;\n }\n\n var newLinesPresent = str.indexOf('\\n') != -1;\n\n var nestedStyles = this._styles;\n\n var i = nestedStyles.length;\n while (i--) {\n var code = ansiStyles[nestedStyles[i]];\n str = code.open + str.replace(code.closeRe, code.open) + code.close;\n if (newLinesPresent) {\n str = str.replace(newLineRegex, function(match) {\n return code.close + match + code.open;\n });\n }\n }\n\n return str;\n}\n\ncolors.setTheme = function(theme) {\n if (typeof theme === 'string') {\n console.log('colors.setTheme now only accepts an object, not a string. ' +\n 'If you are trying to set a theme from a file, it is now your (the ' +\n 'caller\\'s) responsibility to require the file. The old syntax ' +\n 'looked like colors.setTheme(__dirname + ' +\n '\\'/../themes/generic-logging.js\\'); The new syntax looks like '+\n 'colors.setTheme(require(__dirname + ' +\n '\\'/../themes/generic-logging.js\\'));');\n return;\n }\n for (var style in theme) {\n (function(style) {\n colors[style] = function(str) {\n if (typeof theme[style] === 'object') {\n var out = str;\n for (var i in theme[style]) {\n out = colors[theme[style][i]](out);\n }\n return out;\n }\n return colors[theme[style]](str);\n };\n })(style);\n }\n};\n\nfunction init() {\n var ret = {};\n Object.keys(styles).forEach(function(name) {\n ret[name] = {\n get: function() {\n return build([name]);\n },\n };\n });\n return ret;\n}\n\nvar sequencer = function sequencer(map, str) {\n var exploded = str.split('');\n exploded = exploded.map(map);\n return exploded.join('');\n};\n\n// custom formatter methods\ncolors.trap = require('./custom/trap');\ncolors.zalgo = require('./custom/zalgo');\n\n// maps\ncolors.maps = {};\ncolors.maps.america = require('./maps/america')(colors);\ncolors.maps.zebra = require('./maps/zebra')(colors);\ncolors.maps.rainbow = require('./maps/rainbow')(colors);\ncolors.maps.random = require('./maps/random')(colors);\n\nfor (var map in colors.maps) {\n (function(map) {\n colors[map] = function(str) {\n return sequencer(colors.maps[map], str);\n };\n })(map);\n}\n\ndefineProps(colors, init());\n","//\n// Remark: Requiring this file will use the \"safe\" colors API,\n// which will not touch String.prototype.\n//\n// var colors = require('colors/safe');\n// colors.red(\"foo\")\n//\n//\nvar colors = require('./lib/colors');\nmodule['exports'] = colors;\n","const { info, debug } = require('./debug');\nconst utils = require('./utils');\n\nclass Cell {\n /**\n * A representation of a cell within the table.\n * Implementations must have `init` and `draw` methods,\n * as well as `colSpan`, `rowSpan`, `desiredHeight` and `desiredWidth` properties.\n * @param options\n * @constructor\n */\n constructor(options) {\n this.setOptions(options);\n\n /**\n * Each cell will have it's `x` and `y` values set by the `layout-manager` prior to\n * `init` being called;\n * @type {Number}\n */\n this.x = null;\n this.y = null;\n }\n\n setOptions(options) {\n if (['boolean', 'number', 'bigint', 'string'].indexOf(typeof options) !== -1) {\n options = { content: '' + options };\n }\n options = options || {};\n this.options = options;\n let content = options.content;\n if (['boolean', 'number', 'bigint', 'string'].indexOf(typeof content) !== -1) {\n this.content = String(content);\n } else if (!content) {\n this.content = this.options.href || '';\n } else {\n throw new Error('Content needs to be a primitive, got: ' + typeof content);\n }\n this.colSpan = options.colSpan || 1;\n this.rowSpan = options.rowSpan || 1;\n if (this.options.href) {\n Object.defineProperty(this, 'href', {\n get() {\n return this.options.href;\n },\n });\n }\n }\n\n mergeTableOptions(tableOptions, cells) {\n this.cells = cells;\n\n let optionsChars = this.options.chars || {};\n let tableChars = tableOptions.chars;\n let chars = (this.chars = {});\n CHAR_NAMES.forEach(function (name) {\n setOption(optionsChars, tableChars, name, chars);\n });\n\n this.truncate = this.options.truncate || tableOptions.truncate;\n\n let style = (this.options.style = this.options.style || {});\n let tableStyle = tableOptions.style;\n setOption(style, tableStyle, 'padding-left', this);\n setOption(style, tableStyle, 'padding-right', this);\n this.head = style.head || tableStyle.head;\n this.border = style.border || tableStyle.border;\n\n this.fixedWidth = tableOptions.colWidths[this.x];\n this.lines = this.computeLines(tableOptions);\n\n this.desiredWidth = utils.strlen(this.content) + this.paddingLeft + this.paddingRight;\n this.desiredHeight = this.lines.length;\n }\n\n computeLines(tableOptions) {\n const tableWordWrap = tableOptions.wordWrap || tableOptions.textWrap;\n const { wordWrap = tableWordWrap } = this.options;\n if (this.fixedWidth && wordWrap) {\n this.fixedWidth -= this.paddingLeft + this.paddingRight;\n if (this.colSpan) {\n let i = 1;\n while (i < this.colSpan) {\n this.fixedWidth += tableOptions.colWidths[this.x + i];\n i++;\n }\n }\n const { wrapOnWordBoundary: tableWrapOnWordBoundary = true } = tableOptions;\n const { wrapOnWordBoundary = tableWrapOnWordBoundary } = this.options;\n return this.wrapLines(utils.wordWrap(this.fixedWidth, this.content, wrapOnWordBoundary));\n }\n return this.wrapLines(this.content.split('\\n'));\n }\n\n wrapLines(computedLines) {\n const lines = utils.colorizeLines(computedLines);\n if (this.href) {\n return lines.map((line) => utils.hyperlink(this.href, line));\n }\n return lines;\n }\n\n /**\n * Initializes the Cells data structure.\n *\n * @param tableOptions - A fully populated set of tableOptions.\n * In addition to the standard default values, tableOptions must have fully populated the\n * `colWidths` and `rowWidths` arrays. Those arrays must have lengths equal to the number\n * of columns or rows (respectively) in this table, and each array item must be a Number.\n *\n */\n init(tableOptions) {\n let x = this.x;\n let y = this.y;\n this.widths = tableOptions.colWidths.slice(x, x + this.colSpan);\n this.heights = tableOptions.rowHeights.slice(y, y + this.rowSpan);\n this.width = this.widths.reduce(sumPlusOne, -1);\n this.height = this.heights.reduce(sumPlusOne, -1);\n\n this.hAlign = this.options.hAlign || tableOptions.colAligns[x];\n this.vAlign = this.options.vAlign || tableOptions.rowAligns[y];\n\n this.drawRight = x + this.colSpan == tableOptions.colWidths.length;\n }\n\n /**\n * Draws the given line of the cell.\n * This default implementation defers to methods `drawTop`, `drawBottom`, `drawLine` and `drawEmpty`.\n * @param lineNum - can be `top`, `bottom` or a numerical line number.\n * @param spanningCell - will be a number if being called from a RowSpanCell, and will represent how\n * many rows below it's being called from. Otherwise it's undefined.\n * @returns {String} The representation of this line.\n */\n draw(lineNum, spanningCell) {\n if (lineNum == 'top') return this.drawTop(this.drawRight);\n if (lineNum == 'bottom') return this.drawBottom(this.drawRight);\n let content = utils.truncate(this.content, 10, this.truncate);\n if (!lineNum) {\n info(`${this.y}-${this.x}: ${this.rowSpan - lineNum}x${this.colSpan} Cell ${content}`);\n } else {\n // debug(`${lineNum}-${this.x}: 1x${this.colSpan} RowSpanCell ${content}`);\n }\n let padLen = Math.max(this.height - this.lines.length, 0);\n let padTop;\n switch (this.vAlign) {\n case 'center':\n padTop = Math.ceil(padLen / 2);\n break;\n case 'bottom':\n padTop = padLen;\n break;\n default:\n padTop = 0;\n }\n if (lineNum < padTop || lineNum >= padTop + this.lines.length) {\n return this.drawEmpty(this.drawRight, spanningCell);\n }\n let forceTruncation = this.lines.length > this.height && lineNum + 1 >= this.height;\n return this.drawLine(lineNum - padTop, this.drawRight, forceTruncation, spanningCell);\n }\n\n /**\n * Renders the top line of the cell.\n * @param drawRight - true if this method should render the right edge of the cell.\n * @returns {String}\n */\n drawTop(drawRight) {\n let content = [];\n if (this.cells) {\n //TODO: cells should always exist - some tests don't fill it in though\n this.widths.forEach(function (width, index) {\n content.push(this._topLeftChar(index));\n content.push(utils.repeat(this.chars[this.y == 0 ? 'top' : 'mid'], width));\n }, this);\n } else {\n content.push(this._topLeftChar(0));\n content.push(utils.repeat(this.chars[this.y == 0 ? 'top' : 'mid'], this.width));\n }\n if (drawRight) {\n content.push(this.chars[this.y == 0 ? 'topRight' : 'rightMid']);\n }\n return this.wrapWithStyleColors('border', content.join(''));\n }\n\n _topLeftChar(offset) {\n let x = this.x + offset;\n let leftChar;\n if (this.y == 0) {\n leftChar = x == 0 ? 'topLeft' : offset == 0 ? 'topMid' : 'top';\n } else {\n if (x == 0) {\n leftChar = 'leftMid';\n } else {\n leftChar = offset == 0 ? 'midMid' : 'bottomMid';\n if (this.cells) {\n //TODO: cells should always exist - some tests don't fill it in though\n let spanAbove = this.cells[this.y - 1][x] instanceof Cell.ColSpanCell;\n if (spanAbove) {\n leftChar = offset == 0 ? 'topMid' : 'mid';\n }\n if (offset == 0) {\n let i = 1;\n while (this.cells[this.y][x - i] instanceof Cell.ColSpanCell) {\n i++;\n }\n if (this.cells[this.y][x - i] instanceof Cell.RowSpanCell) {\n leftChar = 'leftMid';\n }\n }\n }\n }\n }\n return this.chars[leftChar];\n }\n\n wrapWithStyleColors(styleProperty, content) {\n if (this[styleProperty] && this[styleProperty].length) {\n try {\n let colors = require('@colors/colors/safe');\n for (let i = this[styleProperty].length - 1; i >= 0; i--) {\n colors = colors[this[styleProperty][i]];\n }\n return colors(content);\n } catch (e) {\n return content;\n }\n } else {\n return content;\n }\n }\n\n /**\n * Renders a line of text.\n * @param lineNum - Which line of text to render. This is not necessarily the line within the cell.\n * There may be top-padding above the first line of text.\n * @param drawRight - true if this method should render the right edge of the cell.\n * @param forceTruncationSymbol - `true` if the rendered text should end with the truncation symbol even\n * if the text fits. This is used when the cell is vertically truncated. If `false` the text should\n * only include the truncation symbol if the text will not fit horizontally within the cell width.\n * @param spanningCell - a number of if being called from a RowSpanCell. (how many rows below). otherwise undefined.\n * @returns {String}\n */\n drawLine(lineNum, drawRight, forceTruncationSymbol, spanningCell) {\n let left = this.chars[this.x == 0 ? 'left' : 'middle'];\n if (this.x && spanningCell && this.cells) {\n let cellLeft = this.cells[this.y + spanningCell][this.x - 1];\n while (cellLeft instanceof ColSpanCell) {\n cellLeft = this.cells[cellLeft.y][cellLeft.x - 1];\n }\n if (!(cellLeft instanceof RowSpanCell)) {\n left = this.chars['rightMid'];\n }\n }\n let leftPadding = utils.repeat(' ', this.paddingLeft);\n let right = drawRight ? this.chars['right'] : '';\n let rightPadding = utils.repeat(' ', this.paddingRight);\n let line = this.lines[lineNum];\n let len = this.width - (this.paddingLeft + this.paddingRight);\n if (forceTruncationSymbol) line += this.truncate || '…';\n let content = utils.truncate(line, len, this.truncate);\n content = utils.pad(content, len, ' ', this.hAlign);\n content = leftPadding + content + rightPadding;\n return this.stylizeLine(left, content, right);\n }\n\n stylizeLine(left, content, right) {\n left = this.wrapWithStyleColors('border', left);\n right = this.wrapWithStyleColors('border', right);\n if (this.y === 0) {\n content = this.wrapWithStyleColors('head', content);\n }\n return left + content + right;\n }\n\n /**\n * Renders the bottom line of the cell.\n * @param drawRight - true if this method should render the right edge of the cell.\n * @returns {String}\n */\n drawBottom(drawRight) {\n let left = this.chars[this.x == 0 ? 'bottomLeft' : 'bottomMid'];\n let content = utils.repeat(this.chars.bottom, this.width);\n let right = drawRight ? this.chars['bottomRight'] : '';\n return this.wrapWithStyleColors('border', left + content + right);\n }\n\n /**\n * Renders a blank line of text within the cell. Used for top and/or bottom padding.\n * @param drawRight - true if this method should render the right edge of the cell.\n * @param spanningCell - a number of if being called from a RowSpanCell. (how many rows below). otherwise undefined.\n * @returns {String}\n */\n drawEmpty(drawRight, spanningCell) {\n let left = this.chars[this.x == 0 ? 'left' : 'middle'];\n if (this.x && spanningCell && this.cells) {\n let cellLeft = this.cells[this.y + spanningCell][this.x - 1];\n while (cellLeft instanceof ColSpanCell) {\n cellLeft = this.cells[cellLeft.y][cellLeft.x - 1];\n }\n if (!(cellLeft instanceof RowSpanCell)) {\n left = this.chars['rightMid'];\n }\n }\n let right = drawRight ? this.chars['right'] : '';\n let content = utils.repeat(' ', this.width);\n return this.stylizeLine(left, content, right);\n }\n}\n\nclass ColSpanCell {\n /**\n * A Cell that doesn't do anything. It just draws empty lines.\n * Used as a placeholder in column spanning.\n * @constructor\n */\n constructor() {}\n\n draw(lineNum) {\n if (typeof lineNum === 'number') {\n debug(`${this.y}-${this.x}: 1x1 ColSpanCell`);\n }\n return '';\n }\n\n init() {}\n\n mergeTableOptions() {}\n}\n\nclass RowSpanCell {\n /**\n * A placeholder Cell for a Cell that spans multiple rows.\n * It delegates rendering to the original cell, but adds the appropriate offset.\n * @param originalCell\n * @constructor\n */\n constructor(originalCell) {\n this.originalCell = originalCell;\n }\n\n init(tableOptions) {\n let y = this.y;\n let originalY = this.originalCell.y;\n this.cellOffset = y - originalY;\n this.offset = findDimension(tableOptions.rowHeights, originalY, this.cellOffset);\n }\n\n draw(lineNum) {\n if (lineNum == 'top') {\n return this.originalCell.draw(this.offset, this.cellOffset);\n }\n if (lineNum == 'bottom') {\n return this.originalCell.draw('bottom');\n }\n debug(`${this.y}-${this.x}: 1x${this.colSpan} RowSpanCell for ${this.originalCell.content}`);\n return this.originalCell.draw(this.offset + 1 + lineNum);\n }\n\n mergeTableOptions() {}\n}\n\nfunction firstDefined(...args) {\n return args.filter((v) => v !== undefined && v !== null).shift();\n}\n\n// HELPER FUNCTIONS\nfunction setOption(objA, objB, nameB, targetObj) {\n let nameA = nameB.split('-');\n if (nameA.length > 1) {\n nameA[1] = nameA[1].charAt(0).toUpperCase() + nameA[1].substr(1);\n nameA = nameA.join('');\n targetObj[nameA] = firstDefined(objA[nameA], objA[nameB], objB[nameA], objB[nameB]);\n } else {\n targetObj[nameB] = firstDefined(objA[nameB], objB[nameB]);\n }\n}\n\nfunction findDimension(dimensionTable, startingIndex, span) {\n let ret = dimensionTable[startingIndex];\n for (let i = 1; i < span; i++) {\n ret += 1 + dimensionTable[startingIndex + i];\n }\n return ret;\n}\n\nfunction sumPlusOne(a, b) {\n return a + b + 1;\n}\n\nlet CHAR_NAMES = [\n 'top',\n 'top-mid',\n 'top-left',\n 'top-right',\n 'bottom',\n 'bottom-mid',\n 'bottom-left',\n 'bottom-right',\n 'left',\n 'left-mid',\n 'mid',\n 'mid-mid',\n 'right',\n 'right-mid',\n 'middle',\n];\n\nmodule.exports = Cell;\nmodule.exports.ColSpanCell = ColSpanCell;\nmodule.exports.RowSpanCell = RowSpanCell;\n","const { warn, debug } = require('./debug');\nconst Cell = require('./cell');\nconst { ColSpanCell, RowSpanCell } = Cell;\n\n(function () {\n function next(alloc, col) {\n if (alloc[col] > 0) {\n return next(alloc, col + 1);\n }\n return col;\n }\n\n function layoutTable(table) {\n let alloc = {};\n table.forEach(function (row, rowIndex) {\n let col = 0;\n row.forEach(function (cell) {\n cell.y = rowIndex;\n // Avoid erroneous call to next() on first row\n cell.x = rowIndex ? next(alloc, col) : col;\n const rowSpan = cell.rowSpan || 1;\n const colSpan = cell.colSpan || 1;\n if (rowSpan > 1) {\n for (let cs = 0; cs < colSpan; cs++) {\n alloc[cell.x + cs] = rowSpan;\n }\n }\n col = cell.x + colSpan;\n });\n Object.keys(alloc).forEach((idx) => {\n alloc[idx]--;\n if (alloc[idx] < 1) delete alloc[idx];\n });\n });\n }\n\n function maxWidth(table) {\n let mw = 0;\n table.forEach(function (row) {\n row.forEach(function (cell) {\n mw = Math.max(mw, cell.x + (cell.colSpan || 1));\n });\n });\n return mw;\n }\n\n function maxHeight(table) {\n return table.length;\n }\n\n function cellsConflict(cell1, cell2) {\n let yMin1 = cell1.y;\n let yMax1 = cell1.y - 1 + (cell1.rowSpan || 1);\n let yMin2 = cell2.y;\n let yMax2 = cell2.y - 1 + (cell2.rowSpan || 1);\n let yConflict = !(yMin1 > yMax2 || yMin2 > yMax1);\n\n let xMin1 = cell1.x;\n let xMax1 = cell1.x - 1 + (cell1.colSpan || 1);\n let xMin2 = cell2.x;\n let xMax2 = cell2.x - 1 + (cell2.colSpan || 1);\n let xConflict = !(xMin1 > xMax2 || xMin2 > xMax1);\n\n return yConflict && xConflict;\n }\n\n function conflictExists(rows, x, y) {\n let i_max = Math.min(rows.length - 1, y);\n let cell = { x: x, y: y };\n for (let i = 0; i <= i_max; i++) {\n let row = rows[i];\n for (let j = 0; j < row.length; j++) {\n if (cellsConflict(cell, row[j])) {\n return true;\n }\n }\n }\n return false;\n }\n\n function allBlank(rows, y, xMin, xMax) {\n for (let x = xMin; x < xMax; x++) {\n if (conflictExists(rows, x, y)) {\n return false;\n }\n }\n return true;\n }\n\n function addRowSpanCells(table) {\n table.forEach(function (row, rowIndex) {\n row.forEach(function (cell) {\n for (let i = 1; i < cell.rowSpan; i++) {\n let rowSpanCell = new RowSpanCell(cell);\n rowSpanCell.x = cell.x;\n rowSpanCell.y = cell.y + i;\n rowSpanCell.colSpan = cell.colSpan;\n insertCell(rowSpanCell, table[rowIndex + i]);\n }\n });\n });\n }\n\n function addColSpanCells(cellRows) {\n for (let rowIndex = cellRows.length - 1; rowIndex >= 0; rowIndex--) {\n let cellColumns = cellRows[rowIndex];\n for (let columnIndex = 0; columnIndex < cellColumns.length; columnIndex++) {\n let cell = cellColumns[columnIndex];\n for (let k = 1; k < cell.colSpan; k++) {\n let colSpanCell = new ColSpanCell();\n colSpanCell.x = cell.x + k;\n colSpanCell.y = cell.y;\n cellColumns.splice(columnIndex + 1, 0, colSpanCell);\n }\n }\n }\n }\n\n function insertCell(cell, row) {\n let x = 0;\n while (x < row.length && row[x].x < cell.x) {\n x++;\n }\n row.splice(x, 0, cell);\n }\n\n function fillInTable(table) {\n let h_max = maxHeight(table);\n let w_max = maxWidth(table);\n debug(`Max rows: ${h_max}; Max cols: ${w_max}`);\n for (let y = 0; y < h_max; y++) {\n for (let x = 0; x < w_max; x++) {\n if (!conflictExists(table, x, y)) {\n let opts = { x: x, y: y, colSpan: 1, rowSpan: 1 };\n x++;\n while (x < w_max && !conflictExists(table, x, y)) {\n opts.colSpan++;\n x++;\n }\n let y2 = y + 1;\n while (y2 < h_max && allBlank(table, y2, opts.x, opts.x + opts.colSpan)) {\n opts.rowSpan++;\n y2++;\n }\n let cell = new Cell(opts);\n cell.x = opts.x;\n cell.y = opts.y;\n warn(`Missing cell at ${cell.y}-${cell.x}.`);\n insertCell(cell, table[y]);\n }\n }\n }\n }\n\n function generateCells(rows) {\n return rows.map(function (row) {\n if (!Array.isArray(row)) {\n let key = Object.keys(row)[0];\n row = row[key];\n if (Array.isArray(row)) {\n row = row.slice();\n row.unshift(key);\n } else {\n row = [key, row];\n }\n }\n return row.map(function (cell) {\n return new Cell(cell);\n });\n });\n }\n\n function makeTableLayout(rows) {\n let cellRows = generateCells(rows);\n layoutTable(cellRows);\n fillInTable(cellRows);\n addRowSpanCells(cellRows);\n addColSpanCells(cellRows);\n return cellRows;\n }\n\n module.exports = {\n makeTableLayout: makeTableLayout,\n layoutTable: layoutTable,\n addRowSpanCells: addRowSpanCells,\n maxWidth: maxWidth,\n fillInTable: fillInTable,\n computeWidths: makeComputeWidths('colSpan', 'desiredWidth', 'x', 1),\n computeHeights: makeComputeWidths('rowSpan', 'desiredHeight', 'y', 1),\n };\n})();\n\nfunction makeComputeWidths(colSpan, desiredWidth, x, forcedMin) {\n return function (vals, table) {\n let result = [];\n let spanners = [];\n let auto = {};\n table.forEach(function (row) {\n row.forEach(function (cell) {\n if ((cell[colSpan] || 1) > 1) {\n spanners.push(cell);\n } else {\n result[cell[x]] = Math.max(result[cell[x]] || 0, cell[desiredWidth] || 0, forcedMin);\n }\n });\n });\n\n vals.forEach(function (val, index) {\n if (typeof val === 'number') {\n result[index] = val;\n }\n });\n\n //spanners.forEach(function(cell){\n for (let k = spanners.length - 1; k >= 0; k--) {\n let cell = spanners[k];\n let span = cell[colSpan];\n let col = cell[x];\n let existingWidth = result[col];\n let editableCols = typeof vals[col] === 'number' ? 0 : 1;\n if (typeof existingWidth === 'number') {\n for (let i = 1; i < span; i++) {\n existingWidth += 1 + result[col + i];\n if (typeof vals[col + i] !== 'number') {\n editableCols++;\n }\n }\n } else {\n existingWidth = desiredWidth === 'desiredWidth' ? cell.desiredWidth - 1 : 1;\n if (!auto[col] || auto[col] < existingWidth) {\n auto[col] = existingWidth;\n }\n }\n\n if (cell[desiredWidth] > existingWidth) {\n let i = 0;\n while (editableCols > 0 && cell[desiredWidth] > existingWidth) {\n if (typeof vals[col + i] !== 'number') {\n let dif = Math.round((cell[desiredWidth] - existingWidth) / editableCols);\n existingWidth += dif;\n result[col + i] += dif;\n editableCols--;\n }\n i++;\n }\n }\n }\n\n Object.assign(vals, result, auto);\n for (let j = 0; j < vals.length; j++) {\n vals[j] = Math.max(forcedMin, vals[j] || 0);\n }\n };\n}\n","const debug = require('./debug');\nconst utils = require('./utils');\nconst tableLayout = require('./layout-manager');\n\nclass Table extends Array {\n constructor(opts) {\n super();\n\n const options = utils.mergeOptions(opts);\n Object.defineProperty(this, 'options', {\n value: options,\n enumerable: options.debug,\n });\n\n if (options.debug) {\n switch (typeof options.debug) {\n case 'boolean':\n debug.setDebugLevel(debug.WARN);\n break;\n case 'number':\n debug.setDebugLevel(options.debug);\n break;\n case 'string':\n debug.setDebugLevel(parseInt(options.debug, 10));\n break;\n default:\n debug.setDebugLevel(debug.WARN);\n debug.warn(`Debug option is expected to be boolean, number, or string. Received a ${typeof options.debug}`);\n }\n Object.defineProperty(this, 'messages', {\n get() {\n return debug.debugMessages();\n },\n });\n }\n }\n\n toString() {\n let array = this;\n let headersPresent = this.options.head && this.options.head.length;\n if (headersPresent) {\n array = [this.options.head];\n if (this.length) {\n array.push.apply(array, this);\n }\n } else {\n this.options.style.head = [];\n }\n\n let cells = tableLayout.makeTableLayout(array);\n\n cells.forEach(function (row) {\n row.forEach(function (cell) {\n cell.mergeTableOptions(this.options, cells);\n }, this);\n }, this);\n\n tableLayout.computeWidths(this.options.colWidths, cells);\n tableLayout.computeHeights(this.options.rowHeights, cells);\n\n cells.forEach(function (row) {\n row.forEach(function (cell) {\n cell.init(this.options);\n }, this);\n }, this);\n\n let result = [];\n\n for (let rowIndex = 0; rowIndex < cells.length; rowIndex++) {\n let row = cells[rowIndex];\n let heightOfRow = this.options.rowHeights[rowIndex];\n\n if (rowIndex === 0 || !this.options.style.compact || (rowIndex == 1 && headersPresent)) {\n doDraw(row, 'top', result);\n }\n\n for (let lineNum = 0; lineNum < heightOfRow; lineNum++) {\n doDraw(row, lineNum, result);\n }\n\n if (rowIndex + 1 == cells.length) {\n doDraw(row, 'bottom', result);\n }\n }\n\n return result.join('\\n');\n }\n\n get width() {\n let str = this.toString().split('\\n');\n return str[0].length;\n }\n}\n\nTable.reset = () => debug.reset();\n\nfunction doDraw(row, lineNum, result) {\n let line = [];\n row.forEach(function (cell) {\n line.push(cell.draw(lineNum));\n });\n let str = line.join('');\n if (str.length) result.push(str);\n}\n\nmodule.exports = Table;\n","module.exports = require('./src/table');","/* eslint-disable no-console */\nimport chalk from \"chalk\";\nimport figures from \"figures\";\nimport Table from \"cli-table3\";\n\nexport class Logger {\n step(label: string) {\n console.log(`\\n${chalk.bold.cyan(`${figures.pointer} ${label}`)}`);\n }\n\n ok(msg: string) {\n console.log(` ${chalk.green(figures.tick)} ${msg}`);\n }\n\n warn(msg: string) {\n console.log(` ${chalk.yellow(figures.warning)} ${msg}`);\n }\n\n info(msg: string) {\n console.log(` ${msg}`);\n }\n\n err(msg: string) {\n console.error(` ${chalk.red(figures.cross)} ${msg}`);\n }\n\n header(title: string) {\n const line = \"═\".repeat(47);\n console.log(`\\n${chalk.bold(line)}`);\n console.log(`${chalk.bold(` ${title}`)}`);\n console.log(`${chalk.bold(line)}\\n`);\n }\n\n table(rows: Array<[string, \"ok\" | \"warn\" | \"fail\", string?]>, opts?: { colWidths?: number[] }) {\n const table = new Table({\n chars: { mid: \"\", \"left-mid\": \"\", \"mid-mid\": \"\", \"right-mid\": \"\" },\n style: { border: [\"grey\"], head: [] },\n colWidths: opts?.colWidths ?? [4, 40, 30]\n });\n\n for (const [label, status, detail = \"\"] of rows) {\n const icon =\n status === \"ok\" ? chalk.green(figures.tick) : status === \"warn\" ? chalk.yellow(figures.warning) : chalk.red(figures.cross);\n const detailStyled = status === \"ok\" ? chalk.grey(detail) : status === \"warn\" ? chalk.yellow(detail) : chalk.red(detail);\n table.push([icon, label, detailStyled]);\n }\n\n console.log(table.toString());\n }\n\n section(title: string, rows: Array<[string, \"ok\" | \"warn\" | \"fail\", string?]>) {\n console.log(`\\n${chalk.bold(title)}`);\n this.table(rows);\n }\n\n /** Print raw formatted content (e.g. cli-table3 output). */\n print(content: string) {\n console.log(content);\n }\n\n /** Print a blank line. */\n break() {\n console.log();\n }\n}\n\nexport const logger = new Logger();\n","import { IS_WINDOWS } from \"../config/config\";\nimport { Cli } from \"../services/cli/cli\";\n\nexport function constant<T = string>(name: string, defaultValue?: T): T | null | undefined {\n if (!IS_WINDOWS) {\n return (process.env[name] as T) ?? defaultValue;\n }\n\n return (new Cli(\"powershell\").tryGet(\"-Command\", `[System.Environment]::GetEnvironmentVariable('${name}', 'User')`) as T) ?? defaultValue;\n}\n","class HttpClient {\n async fetch(url: string, init: RequestInit & { onProgress: (content: string) => void }): Promise<string | unknown>;\n async fetch(url: string, init?: RequestInit): Promise<Response>;\n async fetch(url: string, init?: RequestInit & { onProgress?: (content: string) => void }): Promise<Response | string | unknown> {\n const headers = { accept: \"application/json\", ...init?.headers };\n\n const response = await fetch(url, {\n ...init,\n headers\n });\n\n if (!response.ok) {\n throw new Error(`Unable to fetch ${url}: ${response.status} ${response.statusText}`);\n }\n\n if (init?.onProgress) {\n const reader = response.body?.getReader();\n\n if (!reader) {\n return response.json() as unknown;\n }\n\n const decoder = new TextDecoder();\n let content = \"\";\n\n while (true) {\n const { done, value } = await reader.read();\n if (done) {\n break;\n }\n\n content += decoder.decode(value, { stream: true });\n\n init.onProgress(content);\n }\n\n return content + decoder.decode();\n }\n\n return response;\n }\n\n async get<T>(url: string, init?: RequestInit): Promise<T> {\n const response = await this.fetch(url, init);\n return response.json() as Promise<T>;\n }\n}\n\nexport const httpClient = new HttpClient();\n","import { constant } from \"../../utils/constant\";\nimport { httpClient } from \"../http/httpClient.js\";\n\nexport interface LiteLLMModel {\n id: string;\n object: string;\n owned_by?: string;\n max_input_tokens?: number;\n max_output_tokens?: number;\n}\n\ninterface ModelsResponse {\n object: string;\n data: LiteLLMModel[];\n}\n\nexport class LiteLLMClient {\n constructor(\n protected baseUrl = constant(\"LITELLM_BASE_URL\", \"\"),\n protected apiKey = constant(\"LITELLM_API_KEY\", \"\")\n ) {}\n\n getModels(opts?: { apiKey?: string }): Promise<ModelsResponse> {\n const apiKey = opts?.apiKey ?? this.apiKey;\n\n return httpClient.get<ModelsResponse>(`${this.baseUrl}/models`, {\n headers: {\n Accept: \"application/json\",\n ...(apiKey ? { Authorization: `Bearer ${apiKey}` } : {})\n }\n });\n }\n}\n\nexport const liteLLMClient = new LiteLLMClient();\n","import { Command } from \"commander\";\nimport fs from \"fs-extra\";\nimport chalk from \"chalk\";\nimport Table from \"cli-table3\";\nimport { CODEX_CONFIG_PATH, CODEX_MODELS_PATH } from \"../../config/config.js\";\nimport { logger } from \"../../services/logger.js\";\nimport { liteLLMClient } from \"../../services/litellm/liteLLMClient\";\nimport type { LiteLLMModel } from \"../../services/litellm/liteLLMClient\";\n\ninterface ModelsSnapshot {\n object: string;\n data: LiteLLMModel[];\n}\n\nfunction isClubMedModel(id: string): boolean {\n return (id.startsWith(\"gmdt-\") || id.startsWith(\"eus2-\")) && !id.includes(\"text-embedding\");\n}\n\nfunction printCurrentConfig() {\n if (!fs.pathExistsSync(CODEX_CONFIG_PATH)) {\n logger.warn('config.toml not found (~/.codex/config.toml). Run \"cm-agents install\" first.');\n return;\n }\n\n const content = fs.readFileSync(CODEX_CONFIG_PATH, \"utf8\");\n const modelMatch = content.match(/^model\\s*=\\s*\"([^\"]+)\"/m);\n const catalogMatch = content.match(/^model_catalog_json\\s*=\\s*\"([^\"]+)\"/m);\n\n logger.header(\"Codex — current configuration\");\n\n const configTable = new Table({ style: { border: [\"grey\"], head: [] } });\n configTable.push(\n [chalk.dim(\"Model\"), modelMatch?.[1] ?? chalk.red(\"not set\")],\n [chalk.dim(\"Catalog\"), catalogMatch?.[1] ?? chalk.red(\"not set\")]\n );\n logger.print(configTable.toString());\n\n if (!fs.pathExistsSync(CODEX_MODELS_PATH)) {\n return;\n }\n\n const snapshot = JSON.parse(fs.readFileSync(CODEX_MODELS_PATH, \"utf8\")) as ModelsSnapshot;\n logger.step(`Available models (${snapshot.data.length})`);\n\n const table = new Table({\n head: [chalk.bold(\"Model\"), chalk.bold(\"Context in\"), chalk.bold(\"Context out\")],\n style: { border: [\"grey\"], head: [] },\n colWidths: [36, 13, 13]\n });\n\n for (const m of snapshot.data) {\n table.push([\n m.id,\n m.max_input_tokens ? `${(m.max_input_tokens / 1000).toFixed(0)}k` : \"—\",\n m.max_output_tokens ? `${(m.max_output_tokens / 1000).toFixed(0)}k` : \"—\"\n ]);\n }\n\n logger.print(table.toString());\n}\n\nexport default (program: Command): void =>\n void program\n .command(\"models\")\n .description(\"Show Codex config or refresh the LiteLLM model list\")\n .option(\"--refresh\", \"Refresh clubmed-models.json from the LiteLLM API\")\n .action(async (opts: { refresh?: boolean }) => {\n if (!opts.refresh) {\n printCurrentConfig();\n return;\n }\n\n logger.info(\"Fetching models from LiteLLM...\");\n try {\n const { data } = await liteLLMClient.getModels();\n const models = data.filter((m) => isClubMedModel(m.id));\n\n const snapshot: ModelsSnapshot = {\n object: \"list\",\n data: models.map(({ id, object, owned_by }) => ({ id, object, owned_by: owned_by ?? \"clubmed\" }))\n };\n\n fs.writeFileSync(CODEX_MODELS_PATH, JSON.stringify(snapshot, null, 2), \"utf8\");\n logger.ok(`${models.length} models written to ${CODEX_MODELS_PATH}`);\n\n const table = new Table({\n head: [chalk.bold(\"Model\"), chalk.bold(\"In\"), chalk.bold(\"Out\")],\n style: { border: [\"grey\"], head: [] },\n colWidths: [36, 10, 10]\n });\n\n for (const m of models) {\n table.push([\n m.id,\n m.max_input_tokens ? `${(m.max_input_tokens / 1000).toFixed(0)}k` : \"—\",\n m.max_output_tokens ? `${(m.max_output_tokens / 1000).toFixed(0)}k` : \"—\"\n ]);\n }\n\n logger.print(table.toString());\n } catch (e) {\n logger.err(e instanceof Error ? e.message : String(e));\n process.exit(1);\n }\n });\n","import { type CliResult, type CliSyncResult, Cli } from \"./cli.js\";\n\nclass GitCli extends Cli {\n constructor() {\n super(\"git\");\n }\n\n init(...args: string[]): CliResult {\n return this.run(\"init\", ...args);\n }\n\n add(...args: string[]): CliResult {\n return this.run(\"add\", ...args);\n }\n\n status(...args: string[]): CliSyncResult {\n return this.sync(\"status\", ...args);\n }\n\n branch(...args: string[]): CliResult {\n return this.run(\"branch\", ...args);\n }\n\n clean(...args: string[]): CliResult {\n return this.run(\"clean\", ...args);\n }\n\n config(...args: string[]) {\n return this.run(\"config\", ...args).get();\n }\n\n checkout(...args: string[]): CliResult {\n return this.run(\"checkout\", ...args);\n }\n\n commit(...args: string[]): CliResult {\n return this.run(\"commit\", ...args);\n }\n\n fetch(...args: string[]): CliResult {\n return this.run(\"fetch\", ...args);\n }\n\n prune(...args: string[]): CliResult {\n return this.run(\"prune\", ...args);\n }\n\n merge(...args: string[]): CliSyncResult {\n return this.sync(\"merge\", ...args);\n }\n\n reset(...args: string[]): CliSyncResult {\n return this.sync(\"reset\", ...args);\n }\n\n remote(...args: string[]): CliResult {\n return this.run(\"remote\", ...args);\n }\n\n rebase(...args: string[]): CliResult {\n return this.run(\"rebase\", ...args);\n }\n\n getCommitTag(ref = \"HEAD\") {\n return this.get(\"rev-parse\", \"--short\", ref);\n }\n\n getBranchName(ref = \"HEAD\") {\n return this.get(\"rev-parse\", \"--abbrev-ref\", ref);\n }\n\n getLastCommitMsg() {\n return this.get(\"log\", \"-1\", \"--pretty=%B\");\n }\n\n push(...args: string[]): CliResult {\n return this.run(\"push\", ...args);\n }\n\n clone(...args: string[]): CliResult {\n return this.run(\"clone\", ...args);\n }\n\n branchExists(branch: string, origin = \"origin\") {\n return this.run(\"branch\", \"-a\").getRaw().trim().includes(`remotes/${origin}/${branch}`);\n }\n\n checkBranchRemoteStatus(branch: string, origin = \"origin\") {\n return this.run(\"cherry\", branch, `${origin}/${branch}`).get();\n }\n\n branches(...args: string[]) {\n return this.run(\"branch\", ...args)\n .get()\n .split(\"\\n\")\n .map((branch) => branch.trim().replace(\"* \", \"\"))\n .filter((branch) => !!branch)\n .filter((branch) => !String(branch).includes(\"/HEAD\"));\n }\n\n show(branch: string) {\n return this.run(\"show\", '--format=\"%ci|%cr|%an\"', branch, \"--\").getRaw().split(\"\\n\")[0].trim();\n }\n}\n\nexport const git = new GitCli();\n","import { type CliResult, type CliSyncResult, Cli } from \"./cli.js\";\n\nclass NpmCli extends Cli {\n constructor() {\n super(\"npm\");\n }\n\n newVersion(version: string): CliSyncResult {\n return this.version(\"--no-git-tag-version\", version);\n }\n\n version(...args: string[]): CliSyncResult {\n return this.sync(\"version\", ...args);\n }\n\n run(...args: string[]): CliResult {\n return super.run(\"run\", ...args);\n }\n\n install(...args: string[]): CliResult {\n return super.run(\"install\", ...args);\n }\n\n publish(...args: string[]): CliResult {\n return super.run(\"publish\", ...args);\n }\n\n pack(...args: string[]): CliResult {\n return super.run(\"pack\", ...args);\n }\n\n /**\n * Reinstall dependencies without package-lock mutation\n * @returns {Promise<unknown>}\n */\n restore(): CliResult {\n return super.run(\"ci\");\n }\n}\n\nexport const npm = new NpmCli();\n","import { join } from \"node:path\";\n\nexport function getShellRc(): string | null {\n const shell = process.env[\"SHELL\"] ?? \"\";\n\n if (shell.includes(\"zsh\")) {\n return join(process.env[\"HOME\"] ?? \"~\", \".zshrc\");\n }\n\n if (shell.includes(\"bash\")) {\n return join(process.env[\"HOME\"] ?? \"~\", \".bashrc\");\n }\n\n return null;\n}\n","import { execaSync } from \"execa\";\n\nexport function setWindowsUserEnv(name: string, value: string) {\n execaSync(\"powershell\", [\"-Command\", `[System.Environment]::SetEnvironmentVariable('${name}', '${value}', 'User')`]);\n process.env[name] = value;\n}\n","import fs from \"fs-extra\";\nimport { ENV_MARKER, IS_WINDOWS } from \"../../config/config\";\nimport { getShellRc } from \"../../utils/linux/getShellRc\";\nimport { setWindowsUserEnv } from \"../../utils/windows/setWindowsUserEnv\";\n\nexport class EnvsClient {\n load() {\n if (IS_WINDOWS) {\n return;\n }\n\n const rc = getShellRc();\n if (!rc || !fs.pathExistsSync(rc)) {\n return;\n }\n\n let inBlock = false;\n\n for (const line of fs.readFileSync(rc, \"utf8\").split(\"\\n\")) {\n if (line.includes(ENV_MARKER)) {\n inBlock = true;\n continue;\n }\n\n if (!inBlock) {\n continue;\n }\n\n const m = line.match(/^export\\s+([A-Z_]+)=\"(.*)\"$/);\n\n if (m && !process.env[m[1]]) {\n process.env[m[1]] = m[2];\n }\n }\n }\n\n save(vars: Record<string, string>) {\n if (IS_WINDOWS) {\n for (const [k, v] of Object.entries(vars)) {\n setWindowsUserEnv(k, v);\n }\n\n return { platform: \"windows\" };\n }\n\n const rc = getShellRc();\n\n if (!rc) {\n return { platform: \"unknown\" };\n }\n\n if (fs.readFileSync(rc, \"utf8\").includes(ENV_MARKER)) {\n return { platform: \"unix\", rc, written: false };\n }\n\n const lines = [`\\n${ENV_MARKER}`, ...Object.entries(vars).map(([k, v]) => `export ${k}=\"${v}\"`)];\n fs.appendFileSync(rc, lines.join(\"\\n\") + \"\\n\", \"utf8\");\n return { platform: \"unix\", rc, written: true };\n }\n}\n\nexport const envsClient = new EnvsClient();\n","import { git } from \"../services/cli/git\";\nimport { npm } from \"../services/cli/npm\";\nimport { Command } from \"commander\";\nimport * as p from \"@clack/prompts\";\nimport fs from \"fs-extra\";\nimport { join } from \"node:path\";\nimport {\n ANTHROPIC_BASE_URL,\n CLAUDE_MARKETPLACE_PLUGINS,\n CLAUDE_MCP_SECTIONS,\n CLUBMED_API_KEY_DEFAULT,\n CODEX_CONFIG_DIR,\n CODEX_CONFIG_PATH,\n CODEX_MODELS_PATH,\n CODEX_MCP_SECTIONS,\n DEFAULT_INSTALL_DIR,\n DEFAULT_MODELS,\n IS_WINDOWS,\n LITELLM_BASE_URL,\n REPO_URL\n} from \"../config/config\";\nimport { Cli } from \"../services/cli/cli\";\nimport { claude } from \"../services/cli/claude\";\nimport { codex } from \"../services/cli/codex\";\nimport { envsClient } from \"../services/vars/envsClient\";\n\nconst mise = new Cli(\"mise\");\n\n// ── Install steps ──────────────────────────────────────────────────────────\n\nfunction stepGit() {\n if (!git.available()) {\n p.log.error(\"git not found. Install Git from https://git-scm.com/downloads and re-run.\");\n process.exit(1);\n }\n p.log.success(`git ${git.get(\"--version\").replace(\"git version \", \"\")}`);\n}\n\nasync function stepPrompts() {\n envsClient.load();\n\n const onCancel = () => {\n p.cancel(\"Setup cancelled.\");\n process.exit(0);\n };\n\n const pyAlreadyInstalled = !!mise.tryGet(\"ls\", \"--current\")?.includes(\"python\");\n\n const config = await p.group(\n {\n installDir: () => {\n if (process.env[\"CLUBMED_REPO_DIR\"]) {\n p.log.info(`Repository directory: ${process.env[\"CLUBMED_REPO_DIR\"]} (saved)`);\n return Promise.resolve(process.env[\"CLUBMED_REPO_DIR\"]!);\n }\n return p.text({ message: \"Repository install directory\", placeholder: DEFAULT_INSTALL_DIR, defaultValue: DEFAULT_INSTALL_DIR });\n },\n installPython: () => {\n if (pyAlreadyInstalled) {\n p.log.info(\"Python 3.12 already installed via mise.\");\n return Promise.resolve(true);\n }\n return p.confirm({ message: \"Install Python (optional)?\", initialValue: false });\n },\n litellmKey: () => {\n if (process.env[\"LITELLM_API_KEY\"]) {\n p.log.info(\"LITELLM_API_KEY already set, reusing.\");\n return Promise.resolve(process.env[\"LITELLM_API_KEY\"]!);\n }\n return p.password({ message: \"LITELLM_API_KEY (LiteLLM portal — VPN required)\" });\n },\n anthropicKey: ({ results }) => {\n if (process.env[\"ANTHROPIC_API_KEY\"]) {\n p.log.info(\"ANTHROPIC_API_KEY already set, reusing.\");\n return Promise.resolve(process.env[\"ANTHROPIC_API_KEY\"]!);\n }\n if (results.litellmKey) {\n p.log.info(\"ANTHROPIC_API_KEY ← LITELLM_API_KEY\");\n return Promise.resolve(results.litellmKey as string);\n }\n return p.password({ message: \"ANTHROPIC_API_KEY (same LiteLLM portal)\" });\n },\n clubmedApiKey: () => {\n if (process.env[\"CLUBMED_API_MCP_KEY\"]) {\n p.log.info(`CLUBMED_API_MCP_KEY already set (${process.env[\"CLUBMED_API_MCP_KEY\"]}), reusing.`);\n return Promise.resolve(process.env[\"CLUBMED_API_MCP_KEY\"]!);\n }\n return p.text({ message: \"CLUBMED_API_MCP_KEY\", placeholder: CLUBMED_API_KEY_DEFAULT, defaultValue: CLUBMED_API_KEY_DEFAULT });\n },\n cmsToken: () => {\n if (process.env[\"CMS_API_MCP_TOKEN\"]) {\n p.log.info(\"CMS_API_MCP_TOKEN already set, reusing.\");\n return Promise.resolve(process.env[\"CMS_API_MCP_TOKEN\"]!);\n }\n return p.password({ message: \"CMS_API_MCP_TOKEN (Directus — press Enter to skip)\" });\n }\n },\n { onCancel }\n );\n\n return config as {\n installDir: string;\n installPython: boolean;\n litellmKey: string;\n anthropicKey: string;\n clubmedApiKey: string;\n cmsToken: string;\n };\n}\n\nasync function stepCheckout(installDir: string) {\n if (fs.pathExistsSync(join(installDir, \".git\"))) {\n p.log.success(`Repository already present in ${installDir}`);\n const s = p.spinner();\n s.start(\"Updating from origin/main...\");\n try {\n await git.fetch(\"origin\").cwd(installDir);\n await git.rebase(\"origin/main\").cwd(installDir);\n s.stop(\"Repository up to date\");\n } catch {\n s.stop(\"Rebase failed — check the repository manually.\");\n p.log.warn(\"Run: git -C \" + installDir + \" rebase --abort\");\n }\n } else {\n fs.ensureDirSync(join(installDir, \"..\"));\n const s = p.spinner();\n s.start(\"Cloning repository...\");\n await git.clone(REPO_URL, installDir);\n s.stop(`Repository cloned to ${installDir}`);\n }\n}\n\nfunction stepEnvVars(vars: Record<string, string>) {\n const result = envsClient.save(vars);\n if (result.platform === \"windows\") {\n p.log.success(\"Environment variables set (user scope)\");\n p.log.info(\"→ Close and reopen any terminal or app for them to take effect.\");\n } else if (result.platform === \"unix\") {\n if (result.written) {\n p.log.success(`Environment variables written to ${result.rc}`);\n p.log.info(`→ source ${result.rc} or restart the terminal.`);\n } else {\n p.log.success(`Env block already present in ${result.rc}`);\n }\n } else {\n p.log.warn(\"Unknown shell — add env vars manually.\");\n }\n}\n\nasync function stepCodex(reinstall: boolean) {\n const s = p.spinner();\n\n if (!codex.available() || reinstall) {\n s.start(\"Installing Codex CLI...\");\n await npm.install(\"-g\", \"@openai/codex\");\n s.stop(\"Codex CLI installed\");\n } else {\n p.log.success(\"Codex CLI already present\");\n }\n\n if (!fs.pathExistsSync(CODEX_MODELS_PATH) || reinstall) {\n const modelsSource = join(import.meta.dirname, \"..\", \"..\", \"scripts\", \"clubmed-models.json\");\n if (fs.pathExistsSync(modelsSource)) {\n fs.ensureDirSync(CODEX_CONFIG_DIR);\n fs.copyFileSync(modelsSource, CODEX_MODELS_PATH);\n }\n p.log.success(\"~/.codex/clubmed-models.json written\");\n } else {\n p.log.success(\"~/.codex/clubmed-models.json already present\");\n }\n\n if (!codex.getConfig() || reinstall) {\n const baseConfig = {\n model: DEFAULT_MODELS.codex,\n model_provider: \"litellm\",\n model_catalog_json: CODEX_MODELS_PATH.replace(/\\\\/g, \"/\"),\n openai_base_url: LITELLM_BASE_URL,\n model_reasoning_effort: \"medium\",\n personality: \"pragmatic\",\n mcp_oauth_credentials_store: \"file\",\n model_providers: {\n litellm: { name: \"LiteLLM\", base_url: LITELLM_BASE_URL, env_key: \"LITELLM_API_KEY\", wire_api: \"responses\" }\n }\n };\n const backedUp = codex.writeBaseConfig(baseConfig, reinstall);\n if (backedUp) {\n p.log.info(`Backup → ${CODEX_CONFIG_PATH}.bak`);\n }\n p.log.success(\"~/.codex/config.toml written\");\n }\n\n if (codex.removeMcp(\"jira\")) {\n p.log.info(\"Migration: [mcp_servers.jira] removed\");\n }\n\n for (const [key, section] of Object.entries(CODEX_MCP_SECTIONS)) {\n p.log.success(codex.addMcp(key, section, reinstall) ? `Codex MCP ${key} added` : `Codex MCP ${key} already present`);\n }\n}\n\nasync function stepClaude(reinstall: boolean) {\n const s = p.spinner();\n\n if (!claude.available() || reinstall) {\n s.start(\"Installing Claude CLI...\");\n await npm.install(\"-g\", \"@anthropic-ai/claude-code\");\n s.stop(\"Claude CLI installed\");\n } else {\n p.log.success(\"Claude CLI already present\");\n }\n\n claude.removeMcp(\"jira\");\n claude.removeMcp(\"atlassian\");\n\n for (const [name, json] of Object.entries(CLAUDE_MCP_SECTIONS)) {\n p.log.success(claude.addMcp(name, json, \"user\", reinstall) ? `Claude MCP ${name} added` : `Claude MCP ${name} already present`);\n }\n\n for (const plugin of CLAUDE_MARKETPLACE_PLUGINS) {\n const pluginName = plugin.split(\"@\")[0];\n if (!claude.hasMcp(`plugin:${pluginName}`) || reinstall) {\n s.start(`Installing Claude marketplace plugin ${pluginName}...`);\n try {\n await claude.addMarketplace(plugin);\n s.stop(`Claude marketplace plugin ${pluginName} installed`);\n } catch {\n s.stop(`Could not install ${pluginName} automatically`);\n p.log.warn(`Install manually: claude plugin install ${plugin}`);\n }\n } else {\n p.log.success(`Claude marketplace plugin ${pluginName} already installed`);\n }\n }\n\n try {\n claude.setDefaultModel(DEFAULT_MODELS.sonnet);\n p.log.success(`Claude default model: ${DEFAULT_MODELS.sonnet}`);\n } catch {\n p.log.warn(`Set model manually: claude config set --global model ${DEFAULT_MODELS.sonnet}`);\n }\n}\n\nasync function stepPython(install: boolean, reinstall: boolean) {\n if (!install) {\n p.log.info(\"Python skipped.\");\n return;\n }\n\n const s = p.spinner();\n const installed = !!mise.tryGet(\"ls\", \"python\")?.includes(\"3.12\");\n if (!installed || reinstall) {\n s.start(\"Installing Python 3.12 via mise...\");\n await mise.run(\"use\", \"-g\", \"python@3.12\");\n s.stop(\"Python 3.12 installed\");\n } else {\n p.log.success(\"Python 3.12 already installed\");\n }\n}\n\n// ── Command ────────────────────────────────────────────────────────────────\n\nexport default (program: Command): void =>\n void program\n .command(\"install\")\n .description(\"Install and configure AI tools (Codex, Claude, MCPs…)\")\n .option(\"--reinstall\", \"Force reinstall of every tool\")\n .action(async (opts: { reinstall?: boolean }) => {\n const reinstall = !!opts.reinstall;\n\n p.intro(`Club Med — AI Tools Setup (${IS_WINDOWS ? \"Windows\" : \"macOS/Linux\"})`);\n if (reinstall) {\n p.log.warn(\"--reinstall mode: all tools will be reinstalled.\");\n }\n\n p.log.step(\"1 — Git\");\n stepGit();\n\n p.log.step(\"2 — Configuration\");\n const { installDir, installPython, litellmKey, anthropicKey, clubmedApiKey, cmsToken } = await stepPrompts();\n\n p.log.step(\"3 — Repository\");\n await stepCheckout(installDir);\n\n p.log.step(\"4 — Environment Variables\");\n stepEnvVars({\n LITELLM_API_KEY: litellmKey,\n ANTHROPIC_BASE_URL,\n ANTHROPIC_API_KEY: anthropicKey,\n CLUBMED_API_MCP_KEY: clubmedApiKey,\n ANTHROPIC_DEFAULT_FABLE_MODEL: DEFAULT_MODELS.fable,\n ANTHROPIC_DEFAULT_OPUS_MODEL: DEFAULT_MODELS.opus,\n ANTHROPIC_DEFAULT_SONNET_MODEL: DEFAULT_MODELS.sonnet,\n ANTHROPIC_DEFAULT_HAIKU_MODEL: DEFAULT_MODELS.haiku,\n CLUBMED_REPO_DIR: installDir,\n ...(cmsToken ? { CMS_API_MCP_TOKEN: cmsToken } : {})\n });\n\n p.log.step(\"5 — Codex CLI + configuration\");\n await stepCodex(reinstall);\n\n p.log.step(\"6 — Claude CLI + MCPs\");\n await stepClaude(reinstall);\n\n p.log.step(\"7 — Python\");\n await stepPython(installPython, reinstall);\n\n p.note(\n [\n \"1. Restart the terminal to load env vars.\",\n \"2. Authenticate Atlassian for Codex:\",\n \" codex mcp login atlassian\",\n \"3. Install the ChatGPT app (Codex UI):\",\n \" https://chatgpt.com/download\",\n \"4. Install Claude Desktop:\",\n \" https://claude.ai/download\",\n \"\",\n `Repository: ${installDir}`\n ].join(\"\\n\"),\n \"Manual steps remaining\"\n );\n\n p.outro(\"Setup complete!\");\n });\n","#!/usr/bin/env node\n\nimport { Command } from \"commander\";\nimport registerCheckCommand from \"../commands/check.js\";\nimport registerCodexModelsCommand from \"../commands/codex/models.js\";\nimport registerInstallCommand from \"../commands/install.js\";\n\ndeclare const __VERSION__: string;\n\nconst program = new Command();\n\nprogram\n .name(\"cm-agents\")\n .description(\"Club Med — AI tools setup and configuration\")\n .version(typeof __VERSION__ !== \"undefined\" ? __VERSION__ : \"dev\");\n\nregisterInstallCommand(program);\nregisterCheckCommand(program);\n\nconst codex = program.command(\"codex\").description(\"Codex-related commands\");\nregisterCodexModelsCommand(codex);\n\nawait program.parseAsync(process.argv);\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,186,187,188,189,190,191,192,193,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221],"mappings":";;;86DAGa,GAAb,cAAoC,KAAM,CAOxC,YAAY,EAAU,EAAM,EAAS,CACnC,MAAM,CAAO,EAEb,MAAM,kBAAkB,KAAM,KAAK,WAAW,EAC9C,KAAK,KAAO,KAAK,YAAY,KAC7B,KAAK,KAAO,EACZ,KAAK,SAAW,EAChB,KAAK,YAAc,IAAA,EACrB,CACF,EAKa,GAAb,cAA0C,EAAe,CAKvD,YAAY,EAAS,CACnB,MAAM,EAAG,4BAA6B,CAAO,EAE7C,MAAM,kBAAkB,KAAM,KAAK,WAAW,EAC9C,KAAK,KAAO,KAAK,YAAY,IAC/B,CACF,ECjCa,GAAb,KAAsB,CAUpB,YAAY,EAAM,EAAa,CAQ7B,OAPA,KAAK,YAAc,GAAe,GAClC,KAAK,SAAW,GAChB,KAAK,SAAW,IAAA,GAChB,KAAK,aAAe,IAAA,GACpB,KAAK,wBAA0B,IAAA,GAC/B,KAAK,WAAa,IAAA,GAEV,EAAK,GAAb,CACE,IAAK,IACH,KAAK,SAAW,GAChB,KAAK,MAAQ,EAAK,MAAM,EAAG,EAAE,EAC7B,MACF,IAAK,IACH,KAAK,SAAW,GAChB,KAAK,MAAQ,EAAK,MAAM,EAAG,EAAE,EAC7B,MACF,QACE,KAAK,SAAW,GAChB,KAAK,MAAQ,CAEjB,CAEI,KAAK,MAAM,SAAS,KAA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SAAS,MACT,EACA,CACA,KAAK,UACL,OAAO,EACP,OAAO,OACP,YAAY,sBACZ,SAAS,OACT,EACA,CACA,KAAK,UACL,OAAO,EACP,OAAO,OACP,YAAY,UACZ,SAAS,MACT,EACA,CACA,KAAK,SACL,OAAO,EACP,OAAO,OACP,YAAY,UACZ,SAAS,KACT,EACA,CACA,KAAK,SACL,OAAO,EACP,OAAO,OACP,YACA,oEACA,SAAS,KACT,EACA,CACA,KAAK,SACL,OAAO,EACP,OAAO,YACP,YAAY,oDACZ,SAAS,OACT,EACA,CACA,KAAK,SACL,OAAO,EACP,OAAO,OACP,YAAY,kCACZ,SAAS,MACT,EACA,CACA,KAAK,UACL,OAAO,EACP,OAAO,YACP,YAAY,qBACZ,SAAS,QACT,OAAO,EACP,EACA,CACA,KAAK,UACL,OAAO,GACP,OAAO,YACP,YAAY,8BACZ,SAAS,OACT,EACA,CACA,KAAK,UACL,OAAO,GACP,OAAO,OACP,YAAY,qBACZ,SAAS,MACT,EACA,CACA,KAAK,UACL,OAAO,GACP,OAAO,YACP,YAAY,8BACZ,SAAS,OACT,EACA,CACA,KAAK,UACL,OAAO,GACP,OAAO,YACP,YAAY,wBACZ,SAAS,OACT,EACA,CACA,KAAK,UACL,OAAO,GACP,OAAO,YACP,YAAY,mBACZ,SAAS,OACT,EACA,CACA,KAAK,UACL,OAAO,GACP,OAAO,YACP,YAAY,cACZ,SAAS,MACT,EACA,CACA,KAAK,YACL,OAAO,GACP,OAAO,YACP,YAAY,+BACZ,SAAS,OACT,EACA,CACA,KAAK,UACL,OAAO,GACP,OAAO,SACP,YAAY,+CACZ,SAAS,OACT,EACA,CACA,KAAK,SACL,OAAO,GACP,OAAO,SACP,YAAY,+CACZ,SAAS,OACT,EACA,CACA,KAAK,UACL,OAAO,GACP,OAAO,UACP,YAAY,WACZ,SAAS,QACT,OAAO,EACP,EACA,CACA,KAAK,UACL,OAAO,GACP,OAAO,QACP,YAAY,SACZ,SAAS,QACT,OAAO,EACP,EACA,CACA,KAAK,UACL,OAAO,GACP,OAAO,QACP,YAAY,mCACZ,SAAS,OACT,EACA,CACA,KAAK,UACL,OAAO,GACP,OAAO,QACP,YAAY,gDACZ,SAAS,OACT,EACA,CACA,KAAK,WACL,OAAO,GACP,OAAO,YACP,YAAY,oCACZ,SAAS,OACT,EACA,CACA,KAAK,UACL,OAAO,GACP,OAAO,QACP,YAAY,qDACZ,SAAS,OACT,EACA,CACA,KAAK,SACL,OAAO,GACP,OAAO,SACP,YAAY,mCACZ,SAAS,KACT,EACA,CACA,KAAK,UACL,OAAO,GACP,OAAO,OACP,YAAY,oBACZ,SAAS,KACT,EACA,CACA,KAAK,UACL,OAAO,GACP,OAAO,OACP,YAAY,eACZ,SAAS,KACT,EACA,CACA,KAAK,YACL,OAAO,GACP,OAAO,YACP,YAAY,mBACZ,SAAS,KACT,EACA,CACA,KAAK,UACL,OAAO,GACP,OAAO,YACP,YAAY,mBACZ,SAAS,KACT,EACA,CACA,KAAK,WACL,OAAO,GACP,OAAO,SACP,YAAY,+BACZ,SAAS,KACT,EACA,CACA,KAAK,QACL,OAAO,GACP,OAAO,YACP,YAAY,mBACZ,SAAS,OACT,EACA,CACA,KAAK,UACL,OAAO,GACP,OAAO,YACP,YAAY,gBACZ,SAAS,OACT,EACA,CACA,KAAK,UACL,OAAO,GACP,OAAO,SACP,YAAY,kCACZ,SAAS,OACT,EACA,CACA,KAAK,SACL,OAAO,GACP,OAAO,YACP,YAAY,8BACZ,SAAS,SACT,EACA,CACA,KAAK,SACL,OAAO,GACP,OAAO,OACP,YAAY,sBACZ,SAAS,OACT,EACA,CACA,KAAK,YACL,OAAO,GACP,OAAO,YACP,YAAY,sBACZ,SAAS,OACT,CAAC,ECzQY,OAAe,CAC5B,IAAM,EAAgB,GAAmB,EAEzC,MADc,CAAC,GAAG,GAAQ,GAAG,CAAe,CAAC,CAAC,IAAIC,EACrC,CACb,EAQMA,IAAiB,CACvB,OACA,OAAO,EACP,cACA,SACA,SAAO,GACP,cACI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EACpB,GAAmB,CAAW,EAG/B,GCrJK,IAAqB,CACjC,UACA,iBACA,QACA,MACA,YACA,QAAS,CAAC,OACV,eACK,GAAwB,CAC7B,UACA,iBACA,MACA,WAAY,GAAc,CAAS,EACnC,OAAQ,GACR,SAAU,GACV,WAAY,GACZ,qBAAsB,GACtB,aAAc,GACd,YAAa,GACb,uBAAwB,GACxB,SAAU,EACV,OAAQ,EAAM,GACd,OAAQ,EAAM,GACd,MACA,QACA,YACA,UAAW,CAAC,CACb,CAAC,EAGY,IAAkB,CAC9B,QACA,UACA,iBACA,kBACA,UACA,YACA,YACK,GAAU,CACf,QACA,UACA,iBACA,YACA,SAAU,GACV,WAAY,GACZ,qBAAsB,GACtB,YAAa,GACb,uBAAwB,GACxB,MAAO,MAAM,KAAK,CAAC,OAAQ,EAAgB,MAAM,CAAC,EAClD,UAAW,CAAC,EACZ,UACA,QACD,CAAC,EAGY,IAAa,CACzB,MAAO,EACP,UACA,iBACA,YACA,WACA,aACA,uBACA,cACA,yBACA,SAAU,EACV,OAAQ,EACR,QACA,MACA,YACA,QAAS,CACR,kBACA,UAAU,EACV,sBACA,aACA,MACA,aAED,YACK,CACL,GAAM,CAAC,WAAU,SAAQ,qBAAqB,GAAqB,EAAa,CAAS,EACnF,CAAC,kBAAiB,gBAAc,YAAW,GAAe,CAC/D,QACA,MACA,YACA,gBACA,SACA,oBACA,WACA,iBACA,WACA,aACA,uBACA,cACA,yBACA,sBACA,aACA,YACA,UACA,KACD,CAAC,EACK,GAAQ,GAAc,EAAe,GAAS,CAAM,EAqB1D,OApBA,OAAO,OAAO,GAAO,GAAmB,CACvC,SACA,UACA,iBACA,YACA,WACA,aACA,uBACA,cACA,yBACA,WACA,SACA,oBACA,QACA,MACA,YACA,MACA,kBACA,eACD,CAAC,CAAC,EACK,EACR,EAEM,IAAsB,CAC3B,QACA,UACA,iBACA,YACA,WACA,aACA,uBACA,cACA,yBACA,WACA,SACA,oBACA,QACA,MACA,YACA,MACA,kBACA,kBAC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