{
  "version": 3,
  "sources": ["../src/index.ts", "../../../node_modules/.pnpm/ansi-escapes@6.0.0/node_modules/ansi-escapes/index.js", "../src/platform/node-bun.ts", "../src/log.ts", "../../../node_modules/.pnpm/chalk@5.2.0/node_modules/chalk/source/vendor/ansi-styles/index.js", "../../../node_modules/.pnpm/chalk@5.2.0/node_modules/chalk/source/vendor/supports-color/index.js", "../../../node_modules/.pnpm/chalk@5.2.0/node_modules/chalk/source/utilities.js", "../../../node_modules/.pnpm/chalk@5.2.0/node_modules/chalk/source/index.js", "../src/error.ts", "../../../node_modules/.pnpm/ansi-regex@6.0.1/node_modules/ansi-regex/index.js", "../../../node_modules/.pnpm/strip-ansi@7.0.1/node_modules/strip-ansi/index.js", "../src/log-base.ts", "../src/filter.ts", "../src/unicode.ts", "../src/widget.ts", "../src/spinner.ts", "../src/inject.ts", "../src/hsv.ts", "../src/progress.ts", "../src/default-export.ts"],
  "sourcesContent": ["export { LogWidget } from './widget';\nexport { CLIError, type PrintableError } from './error';\nexport { setLogFilter } from './filter';\nexport { injectLogger } from './inject';\nexport * from './log';\nexport {\n  BarStyle,\n  Progress,\n  withProgress,\n  type BarSpinnerOptions,\n  type ProgressOptions,\n  type WithProgressOptions,\n} from './progress';\nexport { Spinner, withSpinner, type SpinnerOptions } from './spinner';\nexport type { CustomLoggerColor, CustomLoggerOptions, LogFunction, StringLike } from './types';\nexport { isUnicodeSupported, logSymbols } from './unicode';\nexport { default, default as Logger } from './default-export';\n\n// These two modules are only shipped in ESM, but we bundle them so commonjs imports work fine,\n// and might as well export bindings to the base libraries for ease of use.\nexport { default as chalk } from 'chalk';\nexport * as ansiEscapes from 'ansi-escapes';\n", "import process from 'node:process';\n\nconst ESC = '\\u001B[';\nconst OSC = '\\u001B]';\nconst BEL = '\\u0007';\nconst SEP = ';';\n\nconst isTerminalApp = process.env.TERM_PROGRAM === 'Apple_Terminal';\n\nconst ansiEscapes = {};\n\nansiEscapes.cursorTo = (x, y) => {\n\tif (typeof x !== 'number') {\n\t\tthrow new TypeError('The `x` argument is required');\n\t}\n\n\tif (typeof y !== 'number') {\n\t\treturn ESC + (x + 1) + 'G';\n\t}\n\n\treturn ESC + (y + 1) + SEP + (x + 1) + 'H';\n};\n\nansiEscapes.cursorMove = (x, y) => {\n\tif (typeof x !== 'number') {\n\t\tthrow new TypeError('The `x` argument is required');\n\t}\n\n\tlet returnValue = '';\n\n\tif (x < 0) {\n\t\treturnValue += ESC + (-x) + 'D';\n\t} else if (x > 0) {\n\t\treturnValue += ESC + x + 'C';\n\t}\n\n\tif (y < 0) {\n\t\treturnValue += ESC + (-y) + 'A';\n\t} else if (y > 0) {\n\t\treturnValue += ESC + y + 'B';\n\t}\n\n\treturn returnValue;\n};\n\nansiEscapes.cursorUp = (count = 1) => ESC + count + 'A';\nansiEscapes.cursorDown = (count = 1) => ESC + count + 'B';\nansiEscapes.cursorForward = (count = 1) => ESC + count + 'C';\nansiEscapes.cursorBackward = (count = 1) => ESC + count + 'D';\n\nansiEscapes.cursorLeft = ESC + 'G';\nansiEscapes.cursorSavePosition = isTerminalApp ? '\\u001B7' : ESC + 's';\nansiEscapes.cursorRestorePosition = isTerminalApp ? '\\u001B8' : ESC + 'u';\nansiEscapes.cursorGetPosition = ESC + '6n';\nansiEscapes.cursorNextLine = ESC + 'E';\nansiEscapes.cursorPrevLine = ESC + 'F';\nansiEscapes.cursorHide = ESC + '?25l';\nansiEscapes.cursorShow = ESC + '?25h';\n\nansiEscapes.eraseLines = count => {\n\tlet clear = '';\n\n\tfor (let i = 0; i < count; i++) {\n\t\tclear += ansiEscapes.eraseLine + (i < count - 1 ? ansiEscapes.cursorUp() : '');\n\t}\n\n\tif (count) {\n\t\tclear += ansiEscapes.cursorLeft;\n\t}\n\n\treturn clear;\n};\n\nansiEscapes.eraseEndLine = ESC + 'K';\nansiEscapes.eraseStartLine = ESC + '1K';\nansiEscapes.eraseLine = ESC + '2K';\nansiEscapes.eraseDown = ESC + 'J';\nansiEscapes.eraseUp = ESC + '1J';\nansiEscapes.eraseScreen = ESC + '2J';\nansiEscapes.scrollUp = ESC + 'S';\nansiEscapes.scrollDown = ESC + 'T';\n\nansiEscapes.clearScreen = '\\u001Bc';\n\nansiEscapes.clearTerminal = process.platform === 'win32'\n\t? `${ansiEscapes.eraseScreen}${ESC}0f`\n\t// 1. Erases the screen (Only done in case `2` is not supported)\n\t// 2. Erases the whole screen including scrollback buffer\n\t// 3. Moves cursor to the top-left position\n\t// More info: https://www.real-world-systems.com/docs/ANSIcode.html\n\t: `${ansiEscapes.eraseScreen}${ESC}3J${ESC}H`;\n\nansiEscapes.beep = BEL;\n\nansiEscapes.link = (text, url) => [\n\tOSC,\n\t'8',\n\tSEP,\n\tSEP,\n\turl,\n\tBEL,\n\ttext,\n\tOSC,\n\t'8',\n\tSEP,\n\tSEP,\n\tBEL,\n].join('');\n\nansiEscapes.image = (buffer, options = {}) => {\n\tlet returnValue = `${OSC}1337;File=inline=1`;\n\n\tif (options.width) {\n\t\treturnValue += `;width=${options.width}`;\n\t}\n\n\tif (options.height) {\n\t\treturnValue += `;height=${options.height}`;\n\t}\n\n\tif (options.preserveAspectRatio === false) {\n\t\treturnValue += ';preserveAspectRatio=0';\n\t}\n\n\treturn returnValue + ':' + buffer.toString('base64') + BEL;\n};\n\nansiEscapes.iTerm = {\n\tsetCwd: (cwd = process.cwd()) => `${OSC}50;CurrentDir=${cwd}${BEL}`,\n\n\tannotation(message, options = {}) {\n\t\tlet returnValue = `${OSC}1337;`;\n\n\t\tconst hasX = typeof options.x !== 'undefined';\n\t\tconst hasY = typeof options.y !== 'undefined';\n\t\tif ((hasX || hasY) && !(hasX && hasY && typeof options.length !== 'undefined')) {\n\t\t\tthrow new Error('`x`, `y` and `length` must be defined when `x` or `y` is defined');\n\t\t}\n\n\t\tmessage = message.replace(/\\|/g, '');\n\n\t\treturnValue += options.isHidden ? 'AddHiddenAnnotation=' : 'AddAnnotation=';\n\n\t\tif (options.length > 0) {\n\t\t\treturnValue += (\n\t\t\t\thasX\n\t\t\t\t\t? [message, options.length, options.x, options.y]\n\t\t\t\t\t: [options.length, message]\n\t\t\t).join('|');\n\t\t} else {\n\t\t\treturnValue += message;\n\t\t}\n\n\t\treturn returnValue + BEL;\n\t},\n};\n\nexport default ansiEscapes;\n", "import { writeSync } from 'fs';\n\n/** File Descriptor for standard output. */\nexport const STDOUT = 1;\n\n/** File Descriptor for standard error. */\nexport const STDERR = 2;\n\n/** File Descriptor for standard input. */\nexport const STDIN = 0;\n\nexport const platformWidgetEnabled = true;\n\nexport const platformWrite = {\n  info(content: string) {\n    writeSync(STDOUT, content + '\\n');\n  },\n  error(content: string) {\n    writeSync(STDERR, content + '\\n');\n  },\n  warn(content: string) {\n    writeSync(STDOUT, content + '\\n');\n  },\n  debug(content: string) {\n    writeSync(STDOUT, content + '\\n');\n  },\n  widget(content: string) {\n    writeSync(STDERR, content);\n  },\n};\n\n// Inlined from\n// https://github.com/sindresorhus/is-unicode-supported/blob/main/index.js\nexport const platformUnicodeSupported =\n  process.platform === 'win32'\n    ? Boolean(process.env.CI) ||\n    Boolean(process.env.WT_SESSION) || // Windows Terminal\n    process.env.ConEmuTask === '{cmd::Cmder}' || // ConEmu and cmder\n    process.env.TERM_PROGRAM === 'vscode' ||\n    process.env.TERM === 'xterm-256color' ||\n    process.env.TERM === 'alacritty' ||\n    process.env.TERMINAL_EMULATOR === 'JetBrains-JediTerm'\n    : process.env.TERM !== 'linux';\n\nconst cwd = process.cwd();\n\nexport function platformSimplifyErrorPath(filepath: string) {\n  if (filepath.startsWith(cwd)) {\n    return '.' + filepath.slice(cwd.length);\n  }\n  return filepath;\n}\n\nexport { builtinModules } from 'module'\n", "import { platformWrite } from '$platform';\nimport { formatStackTrace } from './error';\nimport { createLogger } from './log-base';\nimport { logSymbols } from './unicode';\nimport { clearWidgets, redrawWidgets } from './widget';\n\n/** Built in blue \"info\" logger. */\nexport const info = createLogger('info', {\n  color: 'blueBright',\n});\n\n/** Built in yellow \"warn\" logger. */\nexport const warn = createLogger('warn', {\n  color: 'yellowBright',\n  coloredText: true,\n});\n\nconst _trace = createLogger('trace', {\n  color: 208,\n  type: 'error',\n});\n\n/** Built in orange \"trace\" logger. Prints a stack trace after the message. */\nexport const trace = function trace(...data: any[]) {\n  if (_trace.visible) {\n    _trace(...(data.length === 0 ? [' '] : data));\n    platformWrite.error(formatStackTrace(new Error()).split('\\n').slice(1).join('\\n'));\n  }\n} as typeof _trace;\nObject.defineProperty(trace, 'visible', { get: () => _trace.visible });\n\n/** Built in red \"error\" logger, uses a unicode X instead of the word Error. */\nexport const error = createLogger(logSymbols.error, {\n  id: 'error',\n  color: 'redBright',\n  coloredText: true,\n  boldText: true,\n  type: 'error',\n});\n\n/** Built in cyan \"debug\" logger. */\nexport const debug = createLogger('debug', {\n  color: 'cyanBright',\n  debug: true,\n});\n\n/** Built in green \"success\" logger, uses a unicode Check instead of the word Success. */\nexport const success = createLogger(logSymbols.success, {\n  id: 'success',\n  color: 'greenBright',\n  coloredText: true,\n  boldText: true,\n});\n\n/** Writes raw line of text without a prefix or filtering. Does NOT support formatting features. */\nexport function writeLine(message = '') {\n  clearWidgets();\n  platformWrite.info(message);\n  redrawWidgets();\n}\n", "const ANSI_BACKGROUND_OFFSET = 10;\n\nconst wrapAnsi16 = (offset = 0) => code => `\\u001B[${code + offset}m`;\n\nconst wrapAnsi256 = (offset = 0) => code => `\\u001B[${38 + offset};5;${code}m`;\n\nconst wrapAnsi16m = (offset = 0) => (red, green, blue) => `\\u001B[${38 + offset};2;${red};${green};${blue}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\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};\n\nexport const modifierNames = Object.keys(styles.modifier);\nexport const foregroundColorNames = Object.keys(styles.color);\nexport const backgroundColorNames = Object.keys(styles.bgColor);\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: `\\u001B[${style[0]}m`,\n\t\t\t\tclose: `\\u001B[${style[1]}m`,\n\t\t\t};\n\n\t\t\tgroup[styleName] = styles[styleName];\n\n\t\t\tcodes.set(style[0], 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 = '\\u001B[39m';\n\tstyles.bgColor.close = '\\u001B[49m';\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\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 = /[a-f\\d]{6}|[a-f\\d]{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 */\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\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\nfunction envForceColor() {\n\tif ('FORCE_COLOR' in env) {\n\t\tif (env.FORCE_COLOR === 'true') {\n\t\t\treturn 1;\n\t\t}\n\n\t\tif (env.FORCE_COLOR === 'false') {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);\n\t}\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// 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' in env) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (['TRAVIS', 'CIRCLECI', '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 ('TERM_PROGRAM' in env) {\n\t\tconst version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[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", "// TODO: When targeting Node.js 16, use `String.prototype.replaceAll`.\nexport function stringReplaceAll(string, substring, replacer) {\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 + replacer;\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 gotCR = string[index - 1] === '\\r';\n\t\treturnValue += string.slice(endIndex, (gotCR ? index - 1 : index)) + prefix + (gotCR ? '\\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", "import ansiStyles from '#ansi-styles';\nimport supportsColor from '#supports-color';\nimport { // eslint-disable-line import/order\n\tstringReplaceAll,\n\tstringEncaseCRLFWithFirstIndex,\n} from './utilities.js';\n\nconst {stdout: stdoutColor, stderr: stderrColor} = supportsColor;\n\nconst GENERATOR = Symbol('GENERATOR');\nconst STYLER = Symbol('STYLER');\nconst IS_EMPTY = Symbol('IS_EMPTY');\n\n// `supportsColor.level` \u2192 `ansiStyles.color[name]` mapping\nconst levelMapping = [\n\t'ansi',\n\t'ansi',\n\t'ansi256',\n\t'ansi16m',\n];\n\nconst styles = Object.create(null);\n\nconst applyOptions = (object, options = {}) => {\n\tif (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {\n\t\tthrow new Error('The `level` option should be an integer from 0 to 3');\n\t}\n\n\t// Detect level if not set manually\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\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\nconst getModelAnsi = (model, level, type, ...arguments_) => {\n\tif (model === 'rgb') {\n\t\tif (level === 'ansi16m') {\n\t\t\treturn ansiStyles[type].ansi16m(...arguments_);\n\t\t}\n\n\t\tif (level === 'ansi256') {\n\t\t\treturn ansiStyles[type].ansi256(ansiStyles.rgbToAnsi256(...arguments_));\n\t\t}\n\n\t\treturn ansiStyles[type].ansi(ansiStyles.rgbToAnsi(...arguments_));\n\t}\n\n\tif (model === 'hex') {\n\t\treturn getModelAnsi('rgb', level, type, ...ansiStyles.hexToRgb(...arguments_));\n\t}\n\n\treturn ansiStyles[type][model](...arguments_);\n};\n\nconst usedModels = ['rgb', 'hex', 'ansi256'];\n\nfor (const model of usedModels) {\n\tstyles[model] = {\n\t\tget() {\n\t\t\tconst {level} = this;\n\t\t\treturn function (...arguments_) {\n\t\t\t\tconst styler = createStyler(getModelAnsi(model, levelMapping[level], 'color', ...arguments_), ansiStyles.color.close, this[STYLER]);\n\t\t\t\treturn createBuilder(this, styler, this[IS_EMPTY]);\n\t\t\t};\n\t\t},\n\t};\n\n\tconst bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);\n\tstyles[bgModel] = {\n\t\tget() {\n\t\t\tconst {level} = this;\n\t\t\treturn function (...arguments_) {\n\t\t\t\tconst styler = createStyler(getModelAnsi(model, levelMapping[level], 'bgColor', ...arguments_), ansiStyles.bgColor.close, this[STYLER]);\n\t\t\t\treturn createBuilder(this, styler, this[IS_EMPTY]);\n\t\t\t};\n\t\t},\n\t};\n}\n\nconst proto = Object.defineProperties(() => {}, {\n\t...styles,\n\tlevel: {\n\t\tenumerable: true,\n\t\tget() {\n\t\t\treturn this[GENERATOR].level;\n\t\t},\n\t\tset(level) {\n\t\t\tthis[GENERATOR].level = level;\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\t// eslint-disable-next-line no-implicit-coercion\n\tconst builder = (...arguments_) => applyStyle(builder, (arguments_.length === 1) ? ('' + arguments_[0]) : arguments_.join(' '));\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\tbuilder[GENERATOR] = self;\n\tbuilder[STYLER] = _styler;\n\tbuilder[IS_EMPTY] = _isEmpty;\n\n\treturn builder;\n};\n\nconst applyStyle = (self, string) => {\n\tif (self.level <= 0 || !string) {\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('\\u001B')) {\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\nObject.defineProperties(createChalk.prototype, styles);\n\nconst chalk = createChalk();\nexport const chalkStderr = createChalk({level: stderrColor ? stderrColor.level : 0});\n\nexport {\n\tmodifierNames,\n\tforegroundColorNames,\n\tbackgroundColorNames,\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", "import chalk from 'chalk';\nimport path from 'path';\nimport { platformSimplifyErrorPath, builtinModules } from '$platform';\n\n/**\n * A PrintableError is an error that defines some extra fields. `@paperdave/logger` handles these\n * objects within logs which allows customizing their appearance. It can be useful when building\n * CLIs to throw formatted error objects that instruct the user what they did wrong, without\n * printing a huge piece of text with a useless stack trace.\n *\n * @see {CLIError} an easy class to construct these objects.\n */\nexport interface PrintableError extends Error {\n  description: string;\n  hideStack?: boolean;\n  hideName?: boolean;\n}\n\nexport function isBuiltin(pathname: string): boolean {\n  return pathname.startsWith('node:') || builtinModules.includes(pathname);\n}\n\n/** Utility function we use internally for formatting the stack trace of an error. */\nexport function formatStackTrace(err: Error) {\n  if (!err.stack) {\n    return '';\n  }\n  const v8firstLine = `${err.name}${err.message ? ': ' + err.message : ''}\\n`;\n  const parsed = err.stack.startsWith(v8firstLine)\n    ? err.stack\n      .slice(v8firstLine.length)\n      .split('\\n')\n      .map(line => {\n        const match = /at (.*) \\((.*):(\\d+):(\\d+)\\)/.exec(line);\n        if (!match) {\n          const match2 = /at (.*):(\\d+):(\\d+)/.exec(line);\n          if (match2) {\n            return {\n              method: '<top level>',\n              file: match2[1],\n              line: match2[2],\n              column: match2[3],\n            };\n          }\n          return { method: '<unknown>', file: null, line: null, column: null };\n        }\n        return {\n          method: match[1],\n          file: match[2],\n          line: parseInt(match[3], 10),\n          column: parseInt(match[4], 10),\n          native: line.includes('[native code]'),\n        };\n      })\n    : err.stack.split('\\n').map(line => {\n      const at = line.indexOf('@');\n      const method = line.slice(0, at);\n      const file = line.slice(at + 1);\n      const fileSplit = /^(.*?):(\\d+):(\\d+)$/.exec(file);\n      return {\n        method: (['module code'].includes(method) ? '' : method) || '',\n        file: fileSplit ? platformSimplifyErrorPath(fileSplit[1]) : null,\n        line: fileSplit ? parseInt(fileSplit[2], 10) : null,\n        column: fileSplit ? parseInt(fileSplit[3], 10) : null,\n        native: file === '[native code]',\n      };\n    });\n\n  const nodeModuleJobIndex = parsed.findIndex(\n    line => line.file === 'node:internal/modules/esm/module_job'\n  );\n  if (nodeModuleJobIndex !== -1) {\n    parsed.splice(nodeModuleJobIndex, Infinity);\n  }\n\n  parsed.reverse();\n  const sliceAt = parsed.findIndex(line => !line.native);\n  if (sliceAt !== -1) {\n    // remove the first native lines\n    parsed.splice(0, sliceAt);\n  }\n  parsed.reverse();\n\n  return parsed\n    .map(({ method, file, line, column, native }) => {\n      function getColoredDirname(filename: string) {\n        const dirname =\n          process.platform === 'win32'\n            ? path.dirname(filename).replace(/^file:\\/\\/\\//g, '')\n            : path.dirname(filename).replace(/^file:\\/\\//g, '') + path.sep;\n\n        if (dirname === '/' || dirname === './') {\n          return dirname;\n        }\n        return chalk.cyan(dirname);\n      }\n\n      const source = native\n        ? `[native code]`\n        : file\n          ? isBuiltin(file)\n            ? `(${chalk.magenta(file)})`\n            : [\n              '(',\n              getColoredDirname(file),\n              // Leave the first slash on linux.\n              chalk.green(path.basename(file)),\n              ':',\n              line + ':' + column,\n              ')',\n            ].join('')\n          : '<unknown>';\n\n      return chalk.blackBright(`  at ${method === '' ? '' : `${method} `}${source}`);\n    })\n    .join('\\n');\n}\n\n/** Formats the given error as a full log string. */\nexport function formatErrorObj(err: Error | PrintableError) {\n  const { name, message, description, hideStack, hideName, stack } = err as PrintableError;\n\n  return [\n    hideName ? '' : (name ?? 'Error') + ': ',\n    message ?? 'Unknown error',\n    description ? '\\n' + description : '',\n    hideStack || !stack ? '' : '\\n' + chalk.reset(formatStackTrace(err)),\n    description || (!hideStack && stack) ? '\\n' : '',\n  ].join('');\n}\n\n/**\n * When this error is passed to `log.error`, it will be printed with a custom long-description. This\n * is useful to give users a better description on what the error actually is. Does not show a stack\n * trace by default.\n *\n * For example, in Purplet we throw this error if the `$DISCORD_BOT_TOKEN` environment variable is missing.\n *\n * ```ts\n * new CLIError(\n *   'Missing DISCORD_BOT_TOKEN environment variable!',\n *   dedent`\n *     Please create an ${chalk.cyan('.env')} file with the following contents:\n *\n *     ${chalk.cyanBright('DISCORD_BOT_TOKEN')}=${chalk.grey('<your bot token>')}\n *\n *     You can create or reset your bot token at ${devPortalLink}\n *   `\n * );\n * ```\n */\nexport class CLIError extends Error implements PrintableError {\n  constructor(public message: string, public description: string) {\n    super(message);\n    this.name = 'CLIError';\n  }\n\n  get hideStack() {\n    return true;\n  }\n\n  get hideName() {\n    return true;\n  }\n}\n", "export default function ansiRegex({onlyFirst = false} = {}) {\n\tconst pattern = [\n\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", "import ansiRegex from 'ansi-regex';\n\nexport default function stripAnsi(string) {\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError(`Expected a \\`string\\`, got \\`${typeof string}\\``);\n\t}\n\n\treturn string.replace(ansiRegex(), '');\n}\n", "import chalk, { ChalkInstance } from 'chalk';\nimport stripAnsi from 'strip-ansi';\nimport { platformWrite } from '$platform';\nimport { inspect } from 'util';\nimport { formatErrorObj } from './error';\nimport { isLogVisible } from './filter';\nimport { CustomLoggerColor, CustomLoggerOptions, LogFunction, StringLike } from './types';\nimport { clearWidgets, redrawWidgets } from './widget';\n\n/** Taken from https://github.com/debug-js/debug/blob/d1616622e4d404863c5a98443f755b4006e971dc/src/node.js#L35. */\nconst COLORS = [\n  20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, 69, 74, 75, 76, 77,\n  78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, 135, 148, 149, 160, 161, 162, 163, 164,\n  165, 166, 167, 168, 169, 170, 171, 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201,\n  202, 203, 204, 205, 206, 207, 208, 209, 214, 215, 220, 221,\n];\n\n/** Converts non string objects into a string the way Node.js' console.log does it. */\nfunction stringify(...data: any[]) {\n  return data\n    .map(obj => {\n      if (typeof obj === 'string') {\n        return obj;\n      } else if (obj instanceof Error) {\n        return formatErrorObj(obj);\n      }\n      return inspect(obj, false, 4, true);\n    })\n    .join(' ');\n}\n\n/**\n * Selects a color for a debug namespace.\n *\n * Taken from https://github.com/debug-js/debug/blob/master/src/common.js.\n */\nfunction selectColor(namespace: string) {\n  let hash = 0;\n\n  for (let i = 0; i < namespace.length; i++) {\n    hash = (hash << 5) - hash + namespace.charCodeAt(i);\n    hash |= 0; // Convert to 32bit integer\n  }\n\n  return COLORS[Math.abs(hash) % COLORS.length];\n}\n\nfunction getColor(color: CustomLoggerColor): ChalkInstance {\n  if (typeof color === 'string') {\n    return color in chalk ? (chalk as any)[color] : chalk.hex(color);\n  } else if (Array.isArray(color)) {\n    return chalk.rgb(color[0], color[1], color[2]);\n  }\n  return chalk.ansi256(color);\n}\n\nconst formatImplementation = {\n  '%s': (data: StringLike) => String(data),\n  '%d': (data: number) => String(data),\n  '%i': (data: number) => String(Math.floor(data)),\n  '%f': (data: number) => String(data),\n  '%x': (data: number) => data.toString(16),\n  '%X': (data: number) => data.toString(16).toUpperCase(),\n  '%o': (data: any) => JSON.stringify(data),\n  '%O': (data: any) => JSON.stringify(data, null, 2),\n  '%c': () => '',\n  '%j': (data: any) => JSON.stringify(data),\n};\n\nfunction format(fmt: any, ...args: any[]) {\n  if (typeof fmt === 'string') {\n    let index = 0;\n    const result = fmt.replace(/%[%sdifoxXcj]/g, match => {\n      if (match === '%%') {\n        return '%';\n      }\n      const arg = args[index++];\n      return (formatImplementation as any)[match](arg);\n    });\n\n    if (index === 0 && args.length > 0) {\n      return result + ' ' + stringify(...args);\n    }\n\n    return result;\n  }\n  return stringify(fmt, ...args);\n}\n\nconst LogFunction = {\n  __proto__: Function.prototype,\n  get visible() {\n    return isLogVisible((this as any).name);\n  },\n  [Symbol.for('nodejs.util.inspect.custom')](depth: number, options: any) {\n    return options.stylize(`[LogFunction: ${(this as any).name}]`, 'special');\n  },\n};\n\nexport function createLogger(\n  name: string,\n  opts: CustomLoggerOptions | CustomLoggerColor = {}\n): LogFunction {\n  if (typeof opts === 'string' || Array.isArray(opts) || typeof opts === 'number') {\n    opts = { color: opts };\n  }\n\n  const {\n    //\n    id = name,\n    color = undefined,\n    coloredText = false,\n    boldText = false,\n    type = 'info',\n    debug = false,\n  } = opts;\n\n  const strippedName = stripAnsi(name);\n\n  const colorFn = name.includes('\\x1b')\n    ? chalk\n    : color\n    ? getColor(color)\n    : chalk.ansi256(selectColor(name));\n  const coloredName = colorFn.bold(name);\n\n  const fn = (fmt: unknown, ...args: any[]) => {\n    if (!isLogVisible(id, !debug)) {\n      return;\n    }\n\n    const data = format(fmt, ...args).replace(/\\n/g, '\\n ' + ' '.repeat(strippedName.length));\n\n    clearWidgets();\n    if (fmt === undefined && args.length === 0) {\n      platformWrite[type]('');\n    } else {\n      platformWrite[type](\n        coloredName + ' ' + (coloredText ? (boldText ? colorFn.bold(data) : colorFn(data)) : data)\n      );\n    }\n    redrawWidgets();\n  };\n  fn.__proto__ = LogFunction;\n\n  Object.defineProperty(fn, 'name', { value: id });\n\n  return fn as unknown as LogFunction;\n}\n", "let filters: string[] = [];\nexport function setLogFilter(...newFilters: Array<string | string[]>) {\n  filters = newFilters.flat().map(filter => filter.toLowerCase());\n}\n\nexport function isLogVisible(id: string, defaultVisibility = true) {\n  for (const filter of filters) {\n    if (filter === '*') {\n      defaultVisibility = true;\n    } else if (filter === '-*') {\n      defaultVisibility = false;\n    } else if (filter === id || id.startsWith(filter + ':')) {\n      defaultVisibility = true;\n    } else if (filter === '-' + id || id.startsWith('-' + filter + ':')) {\n      defaultVisibility = false;\n    }\n  }\n  return defaultVisibility;\n}\n\nif (process.env.DEBUG !== undefined) {\n  const aliasesToAll = ['1', 'true', 'all'];\n  setLogFilter(\n    String(process.env.DEBUG)\n      .split(',')\n      .map(x => x.trim())\n      .map(x => (aliasesToAll.includes(x.toLowerCase()) ? '*' : x))\n  );\n}\n", "import { platformUnicodeSupported } from '$platform';\n\n/**\n * Boolean if the current environment supports unicode. Functions identically to the\n * `is-unicode-supported` package.\n */\nexport const isUnicodeSupported = platformUnicodeSupported;\n\n// Inlined without chalk from\n// https://github.com/sindresorhus/log-symbols/blob/main/index.js\n\n/**\n * Contains unicode symbols for various log symbols, falling to non-unicode characters if needed.\n * Does not have colors, unlike the `log-symbols` package this is based off of.\n */\nexport const logSymbols = isUnicodeSupported\n  ? {\n      error: '\u2716',\n      success: '\u2714',\n      info: '\u2139',\n      warning: '\u26A0',\n    }\n  : {\n      error: 'x',\n      success: '\u221A',\n      info: 'i',\n      warning: '\u203C',\n    };\n", "import ansi from 'ansi-escapes';\nimport { platformWidgetEnabled, platformWrite } from '$platform';\nimport { Timer } from '@paperdave/utils';\nimport { error, success } from './log';\nimport { STDOUT } from './util';\n\nconst widgets: LogWidget[] = [];\nlet widgetLineCount = 0;\nlet widgetTimer: Timer | undefined;\nlet widgetDrawingDisabled = platformWidgetEnabled ? 0 : Infinity;\n\nexport interface Key {\n  sequence?: string;\n  text?: string;\n  name?: string;\n  ctrl: boolean;\n  meta: boolean;\n  shift: boolean;\n}\n\n/**\n * A Log Widget is a piece of log content that is held at the bottom of the console log, and can be\n * animated/dynamically updated. It is used to create spinners, progress bars, and other rich visuals.\n */\nexport abstract class LogWidget {\n  constructor() {\n    widgets.push(this);\n\n    if (!widgetTimer) {\n      widgetTimer = setInterval(redrawWidgets, 1000 / 60);\n    }\n\n    if (!platformWidgetEnabled) {\n      console.warn('LogWidget does not work in the browser.');\n    }\n  }\n\n  /**\n   * Returns a string of what the widget looks like. Called 15 times per second to allow for smooth\n   * animation. The value passed to now is the result of `performance.now`.\n   */\n  protected abstract format(now: number): string;\n  /**\n   * The current FPS of the widget. If this is set to 0, the widget will not automatically update,\n   * and you must call `update`.\n   */\n  protected abstract fps: number;\n\n  /** Removes this widget from the log. */\n  stop(finalMessage?: string) {\n    const index = widgets.indexOf(this);\n    if (index >= 0) {\n      widgets.splice(index, 1);\n    }\n    clearWidgets();\n    if (finalMessage) {\n      platformWrite.info(finalMessage + '\\n');\n    }\n    if (widgets.length === 0) {\n      clearInterval(widgetTimer);\n      widgetTimer = undefined;\n      // writeSync(STDERR, ansi.cursorShow);\n    } else {\n      redrawWidgets();\n    }\n  }\n\n  /** Forces a redraw to happen immediately. */\n  protected redraw() {\n    this.#nextUpdate = 0;\n    redrawWidgets();\n  }\n\n  #nextUpdate = 0;\n  #text = '';\n  #newlines = 0;\n\n  /** @internal */\n  private __internalUpdate(now: number) {\n    if (now > this.#nextUpdate) {\n      this.#nextUpdate = this.fps === 0 ? Infinity : now + 1000 / this.fps;\n      const text = this.format(now);\n      if (text !== this.#text) {\n        this.#text = text + '\\n';\n        this.#newlines = text.split('\\n').length;\n      }\n      return true;\n    }\n    return false;\n  }\n\n  /** @interal */\n  private __internalGetText() {\n    widgetLineCount += this.#newlines;\n    return this.#text;\n  }\n\n  /**\n   * Runs the given function without redrawing anything, then runs a redraws. This is used to batch\n   * some updates together without having to redraw the current widgets more than once per frame.\n   */\n  static batchRedraw(fn: () => void) {\n    widgetDrawingDisabled++;\n    try {\n      fn();\n    } catch { }\n    widgetDrawingDisabled--;\n    redrawWidgets();\n  }\n\n  /** Remove this widget with a success message. */\n  success(message: string) {\n    LogWidget.batchRedraw(() => {\n      success(message);\n      this.stop();\n    });\n  }\n\n  /** Remove this widget with a failure message. */\n  error(message: string | Error) {\n    LogWidget.batchRedraw(() => {\n      error(message);\n      this.stop();\n    });\n  }\n\n  get active() {\n    return widgets.includes(this);\n  }\n}\n\nexport function clearWidgets() {\n  if (widgetLineCount) {\n    platformWrite.widget(\n      ansi.eraseLine + (ansi.cursorUp(1) + ansi.eraseLine).repeat(widgetLineCount) + '\\r'\n    );\n    widgetLineCount = 0;\n  }\n}\n\nexport function redrawWidgets() {\n  if (!widgetTimer || widgetDrawingDisabled !== 0) {\n    return;\n  }\n\n  const now = performance.now();\n  const hasUpdate = widgets.filter(widget => widget['__internalUpdate'](now)).length > 0;\n\n  if (hasUpdate || widgetLineCount === 0) {\n    clearWidgets();\n    platformWrite.widget(widgets.map(widget => widget['__internalGetText']()).join(''));\n  }\n}\n\nexport function errorAllWidgets() {\n  LogWidget.batchRedraw(() => {\n    for (const w of widgets) {\n      if ('text' in w) {\n        w.error((w as any).text);\n      } else {\n        w.stop();\n      }\n    }\n  });\n}\n", "import chalk from 'chalk';\nimport { EmptyObject } from '@paperdave/utils';\nimport { Color } from './util';\nimport { LogWidget } from './widget';\n\nexport interface SpinnerOptions<Props extends Record<string, unknown>> {\n  /** Text displayed to the right of the spinner. */\n  text: string | ((props: Props) => string);\n  /** Color of the spinner. */\n  color?: Color | `${Color}` | false;\n  /** Sequence of frames for the spinner. */\n  frames?: string[];\n  /** Frames per second of the Spinner. */\n  fps?: number;\n  /** Properties to be passed to the `text` formatting function. */\n  props?: Props;\n}\n\nexport const defaultSpinnerOptions = {\n  text: 'Loading...',\n  color: Color.BlueBright,\n  frames: ['\u280B', '\u2819', '\u2839', '\u2838', '\u283C', '\u2834', '\u2826', '\u2827', '\u2807', '\u280F'],\n  fps: 12.5,\n};\n\nexport class Spinner<Props extends Record<string, unknown> = EmptyObject> extends LogWidget {\n  #text: string | ((props: Props) => string);\n  #color: Color | `${Color}` | false;\n  #frames: string[];\n  #props: Props;\n  protected fps: number;\n\n  constructor(options: SpinnerOptions<Props> | string) {\n    super();\n    if (typeof options === 'string') {\n      options = { text: options };\n    }\n    this.#text = options.text ?? defaultSpinnerOptions.text;\n    this.#color = options.color ?? defaultSpinnerOptions.color;\n    this.#frames = options.frames ?? defaultSpinnerOptions.frames;\n    this.fps = options.fps ?? defaultSpinnerOptions.fps;\n    this.#props = options.props ?? ({} as Props);\n  }\n\n  /** Text displayed to the right of the spinner. */\n  get text(): string {\n    return typeof this.#text === 'function' ? this.#text(this.#props) : this.#text;\n  }\n\n  set text(value: string | (() => string)) {\n    this.#text = value;\n    this.redraw();\n  }\n\n  /** Properties to be passed to `text` and `beforeText` formatting functions. */\n  set props(value: Partial<Props>) {\n    this.#props = {\n      ...this.#props,\n      ...value,\n    };\n    this.redraw();\n  }\n\n  get props(): Props {\n    return {\n      ...this.#props,\n    };\n  }\n\n  /**\n   * Updates the spinner by supplying either a new `message` string or a partial object of props to\n   * be used by the custom message function.\n   */\n  update(newProps: Partial<Props>): void;\n  update(newMessage: string): void;\n  update(newData: string | Partial<Props>) {\n    if (typeof newData === 'string') {\n      this.text = newData;\n    } else {\n      this.#props = { ...this.#props, ...newData };\n      this.redraw();\n    }\n  }\n\n  protected format(now: number): string {\n    const frame = Math.floor(now / (1000 / this.fps)) % this.#frames.length;\n\n    return (\n      (this.#color ? chalk[this.#color](this.#frames[frame]) : this.#frames[frame]) +\n      ' ' +\n      this.text\n    );\n  }\n\n  success(message?: string): void {\n    super.success(message ?? this.text);\n  }\n\n  error(message?: string | Error): void {\n    super.error(message ?? this.text);\n  }\n}\n\nexport interface WithSpinnerOptions<Props extends Record<string, unknown>, T>\n  extends SpinnerOptions<Props> {\n  successText?: string | ((result: T) => string);\n  failureText?: string | ((error: Error) => string);\n}\n\n/** Calls a function with a spinner. */\nexport async function withSpinner<Props extends Record<string, unknown>, T>(\n  spinnerOptions: WithSpinnerOptions<Props, T> | string,\n  fn: (spinner: Spinner<Props>) => Promise<T>\n): Promise<T>;\nexport async function withSpinner(opts: any, fn: any) {\n  const spinner = new Spinner(opts);\n\n  try {\n    const result = await fn(spinner);\n    if (spinner.active) {\n      spinner.success(\n        opts.successText\n          ? typeof opts.successText === 'function'\n            ? opts.successText(result)\n            : opts.successText\n          : opts.text\n          ? typeof opts.text === 'function'\n            ? opts.text(spinner.props)\n            : opts.text\n          : 'Completed'\n      );\n    }\n  } catch (error: any) {\n    spinner.error(\n      typeof opts.failureText === 'function' ? opts.failureText(error) : opts.failureText ?? error\n    );\n    throw error;\n  }\n}\n", "import chalk from 'chalk';\nimport { debug, error, info, trace, warn, writeLine } from './log';\nimport { Spinner } from './spinner';\nimport { errorAllWidgets } from './widget';\n\nexport interface InjectOptions {\n  console?: typeof console;\n  process?: typeof process;\n  uncaughtExceptions?: boolean;\n  unhandledRejections?: boolean;\n  exitOnError?: boolean;\n}\n\n/**\n * Injects the logger into `globalThis.console`, or whatever is given. Only fills the following\n * functions: `log`, `info`, `warn`, `error`, `debug`.\n *\n * For accessing some special functions, use the `log` object directly.\n */\nexport function injectLogger(opts?: InjectOptions): void;\nexport function injectLogger(opts: InjectOptions = {}) {\n  const {\n    console: injectConsole = globalThis.console,\n    process: injectProcess = globalThis.process,\n    uncaughtExceptions = true,\n    unhandledRejections = true,\n    exitOnError = true,\n  } = opts as InjectOptions;\n\n  // Basic Logging Functions\n  injectConsole.log = info;\n  injectConsole.info = info;\n  injectConsole.warn = warn;\n  injectConsole.error = error;\n  injectConsole.debug = debug;\n\n  // Assert\n  injectConsole.assert = (condition, ...msg: Parameters<typeof error>) => {\n    if (!condition) {\n      error(...msg);\n    }\n  };\n\n  // Time\n  const timers = new Map<string, { start: number; spinner: Spinner }>();\n  injectConsole.time = (label: string) => {\n    if (timers.has(label)) {\n      injectConsole.warn(`Timer '${label}' already exists.`);\n      return;\n    }\n    timers.set(label, {\n      start: performance.now(),\n      spinner: new Spinner({\n        text: label,\n      }),\n    });\n  };\n  injectConsole.timeEnd = (label: string) => {\n    if (!timers.has(label)) {\n      injectConsole.warn(`Timer '${label}' does not exist.`);\n      return;\n    }\n    const { start, spinner } = timers.get(label)!;\n    timers.delete(label);\n    spinner.success(label + chalk.blackBright(` [${(performance.now() - start).toFixed(3)}ms]`));\n  };\n  injectConsole.timeLog = (label: string) => {\n    if (!timers.has(label)) {\n      injectConsole.warn(`Timer '${label}' does not exist.`);\n      return;\n    }\n    const { start } = timers.get(label)!;\n    injectConsole.log(label + chalk.blackBright(` [${(performance.now() - start).toFixed(3)}ms]`));\n  };\n\n  const counters = new Map<string, number>();\n  injectConsole.count = (label: string) => {\n    const n = (counters.get(label) || 0) + 1;\n    counters.set(label, n);\n    injectConsole.log(`${label}: ${n}`);\n  };\n  injectConsole.countReset = (label: string) => {\n    counters.set(label, 0);\n  };\n\n  injectConsole.trace = trace;\n\n  // TODO: Implement `group`, `groupEnd`, `groupCollapsed`, `table`\n\n  if (uncaughtExceptions) {\n    (injectProcess as any).on?.('uncaughtException', (exception: any) => {\n      if (exitOnError) {\n        errorAllWidgets();\n      }\n\n      error(exception);\n\n      if (exitOnError) {\n        writeLine('The above error was not caught by a catch block, execution cannot continue.');\n\n        process.exit(1);\n      }\n    });\n  }\n  if (unhandledRejections) {\n    (injectProcess as any).on?.('unhandledRejection', (reason: any) => {\n      if (exitOnError) {\n        errorAllWidgets();\n      }\n\n      error(reason);\n\n      if (exitOnError) {\n        writeLine(\n          '\\nThe above error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch()'\n        );\n        process.exit(1);\n      }\n    });\n  }\n}\n", "export function convertHSVtoRGB(h: number, s: number, v: number): [number, number, number] {\n  let r, g, b;\n  const i = Math.floor(h * 6);\n  const f = h * 6 - i;\n  const p = v * (1 - s);\n  const q = v * (1 - f * s);\n  const t = v * (1 - (1 - f) * s);\n  switch (i % 6) {\n    case 0:\n      (r = v), (g = t), (b = p);\n      break;\n    case 1:\n      (r = q), (g = v), (b = p);\n      break;\n    case 2:\n      (r = p), (g = v), (b = t);\n      break;\n    case 3:\n      (r = p), (g = q), (b = v);\n      break;\n    case 4:\n      (r = t), (g = p), (b = v);\n      break;\n    case 5:\n      (r = v), (g = p), (b = q);\n      break;\n    default:\n      return [0, 0, 0];\n  }\n  return [Math.round(r * 255), Math.round(g * 255), Math.round(b * 255)];\n}\n", "import chalk from 'chalk';\nimport { EmptyObject } from '@paperdave/utils';\nimport { convertHSVtoRGB } from './hsv';\nimport { defaultSpinnerOptions } from './spinner';\nimport { isUnicodeSupported } from './unicode';\nimport { Color } from './util';\nimport { LogWidget } from './widget';\n\nconst boxChars = [' ', '\u258F', '\u258E', '\u258D', '\u258C', '\u258B', '\u258A', '\u2589'];\nconst fullBox = '\u2588';\nconst asciiChars = {\n  start: '[',\n  end: ']',\n  empty: ' ',\n  fill: '=',\n};\n\n/**\n * This function is derived from an old program I wrote back in 2020 called `f` which did ffmpeg\n * handling. It is probably one of the coolest progress bars ever imagined. The original had the HSL\n * colors baked in, but this one doesn't do that.\n *\n * For those interested:\n * https://github.com/paperdave/f/blob/fcc418f11c7abe979ec01d90d5fdf7e50fb6ec25/src/render.ts.\n */\nfunction getUnicodeBar(progress: number, width: number) {\n  if (progress >= 1) {\n    return fullBox.repeat(width);\n  }\n  if (progress <= 0 || isNaN(progress)) {\n    return ' '.repeat(width);\n  }\n\n  const wholeWidth = Math.floor(progress * width);\n  const remainderWidth = (progress * width) % 1;\n  const partWidth = Math.floor(remainderWidth * 8);\n  let partChar = boxChars[partWidth];\n  if (width - wholeWidth - 1 < 0) {\n    partChar = '';\n  }\n\n  const fill = fullBox.repeat(wholeWidth);\n  const empty = ' '.repeat(width - wholeWidth - 1);\n\n  return `${fill}${partChar}${empty}`;\n}\n\n/** Get an ascii progress bar. Boring. */\nfunction getAsciiBar(progress: number, width: number) {\n  return [\n    asciiChars.start,\n    asciiChars.fill.repeat(Math.floor(progress * (width - 2))),\n    asciiChars.empty.repeat(width - Math.ceil(progress * (width - 2))),\n    asciiChars.end,\n  ].join('');\n}\n\n/** A Progress Bar Style. Ascii is forced in non-unicode terminals. */\nexport enum BarStyle {\n  Unicode = 'unicode',\n  Ascii = 'ascii',\n}\n\n/** Options to be passed to `new Progress` */\nexport interface ProgressOptions<Props extends Record<string, unknown> = EmptyObject> {\n  /** Text displayed to the right of the bar. */\n  text: string | ((props: ExtendedProps<Props>) => string);\n  /** Text displayed to the left of the bar, if specified. */\n  beforeText?: string | ((props: ExtendedProps<Props>) => string);\n  /** Properties to be passed to `text` and `beforeText` formatting functions. */\n  props?: Props;\n  /** Width of the progress bar itself. Default: 35. */\n  barWidth?: number;\n  /** Progress bar style, default `BarStyle.Unicode` */\n  barStyle?: BarStyle | `${BarStyle}`;\n  /** Spinner settings. Set to `null` to disable the spinner. */\n  spinner?: Partial<BarSpinnerOptions> | null;\n  /** Starting value. Default: 0. */\n  value?: number;\n  /** Ending value. Default: 100. */\n  total?: number;\n}\n\nexport interface BarSpinnerOptions {\n  /** Frames per second of the Spinner. */\n  fps: number;\n  /** Sequence of frames for the spinner. */\n  frames: string[];\n  /** Color of the spinner. If set to `match` it will match the bar. */\n  color: Color | `${Color}` | 'match';\n}\n\nconst defaultOptions = {\n  beforeText: '',\n  barWidth: 35,\n  barColor: 'rgb',\n  barStyle: BarStyle.Unicode,\n  spinner: {\n    ...defaultSpinnerOptions,\n    color: 'match',\n  },\n  value: 0,\n  total: 100,\n} as const;\n\ntype ExtendedProps<T> = T & {\n  value: number;\n  total: number;\n  /** Number 0-1, inclusive. */\n  progress: number;\n};\n\nexport class Progress<Props extends Record<string, unknown>> extends LogWidget {\n  #text: string | ((props: ExtendedProps<Props>) => string);\n  #beforeText: string | ((props: ExtendedProps<Props>) => string);\n  #barWidth: number;\n  #barStyle: NonNullable<ProgressOptions['barStyle']>;\n  #spinnerColor: NonNullable<BarSpinnerOptions['color']>;\n  #spinnerFrames?: string[];\n  #props: Props;\n  #spinnerFPS: number;\n  #value: number;\n  #total: number;\n  protected fps: number;\n\n  constructor(options: ProgressOptions<Props> | string) {\n    super();\n\n    if (typeof options === 'string') {\n      options = { text: options };\n    }\n\n    this.#text = options.text;\n    this.#beforeText = options.beforeText ?? defaultOptions.beforeText;\n    this.#barWidth = options.barWidth ?? defaultOptions.barWidth;\n    this.#barStyle = options.barStyle ?? defaultOptions.barStyle;\n    this.#props = options.props ?? ({} as Props);\n    this.#value = options.value ?? defaultOptions.value;\n    this.#total = options.total ?? defaultOptions.total;\n\n    // Undefined will trigger the \"no spinner\"\n    // eslint-disable-next-line eqeqeq\n    if (options.spinner !== null) {\n      this.fps = 15;\n      this.#spinnerFPS = options.spinner?.fps ?? defaultOptions.spinner.fps;\n      this.#spinnerFrames = options.spinner?.frames ?? defaultOptions.spinner.frames;\n      this.#spinnerColor = options.spinner?.color ?? defaultOptions.spinner.color;\n    } else {\n      this.fps = 0;\n      this.#spinnerFPS = defaultOptions.spinner.fps;\n      this.#spinnerFrames = undefined;\n      this.#spinnerColor = defaultOptions.spinner.color;\n    }\n  }\n\n  /** Properties to be passed to `text` and `beforeText` formatting functions. */\n  set props(value: Partial<Props>) {\n    this.#props = {\n      ...this.#props,\n      ...value,\n    };\n    this.redraw();\n  }\n\n  get props(): ExtendedProps<Props> {\n    return {\n      ...this.#props,\n      value: this.#value,\n      total: this.#total,\n      progress: this.#total === 0 ? 1 : this.#value / this.#total,\n    };\n  }\n\n  /** Text displayed to the right of the bar. */\n  get text(): string {\n    return typeof this.#text === 'function' ? this.#text(this.props) : this.#text;\n  }\n\n  set text(value: string | (() => string)) {\n    this.#text = value;\n    this.redraw();\n  }\n\n  /** Text displayed to the left of the bar, if specified. */\n  get beforeText(): string {\n    return typeof this.#beforeText === 'function' ? this.#beforeText(this.props) : this.#beforeText;\n  }\n\n  set beforeText(value: string | (() => string)) {\n    this.#beforeText = value;\n    this.redraw();\n  }\n  /** Current value of progress bar. */\n  get value() {\n    return this.value;\n  }\n\n  set value(value: number) {\n    this.#value = value;\n    this.redraw();\n  }\n\n  /** Total value of progress bar. When value === total, the bar is full. */\n  get total() {\n    return this.value;\n  }\n\n  set total(value: number) {\n    this.#total = value;\n    this.redraw();\n  }\n\n  /** Updates the progress bar with a new value and props. */\n  update(value: number, props?: Partial<Props>) {\n    this.#value = value;\n    if (props) {\n      this.#props = {\n        ...this.props,\n        ...props,\n      };\n    }\n    this.redraw();\n  }\n\n  protected format(now: number): string {\n    const progress = this.#total === 0 ? 1 : this.#value / this.#total;\n\n    const hue = Math.min(Math.max(progress, 0), 1) / 3;\n    const barColor = chalk\n      .rgb(...convertHSVtoRGB(hue, 0.8, 1))\n      .bgRgb(...convertHSVtoRGB(hue, 0.8, 0.5));\n\n    let spinner;\n    if (this.#spinnerFrames) {\n      const frame = Math.floor(now / (1000 / this.#spinnerFPS)) % this.#spinnerFrames.length;\n      spinner = this.#spinnerColor\n        ? (this.#spinnerColor === 'match'\n            ? chalk.rgb(...convertHSVtoRGB(hue, 0.8, 1))\n            : chalk[this.#spinnerColor])(this.#spinnerFrames[frame])\n        : this.#spinnerFrames[frame];\n    }\n\n    const getBar = isUnicodeSupported && this.#barStyle === 'unicode' ? getUnicodeBar : getAsciiBar;\n\n    const beforeText = this.beforeText;\n\n    return [\n      spinner ? spinner + ' ' : '',\n      beforeText ? beforeText + ' ' : '',\n      barColor(getBar(progress, this.#barWidth)),\n      ' ',\n      this.text,\n    ]\n      .filter(Boolean)\n      .join('');\n  }\n\n  success(message?: string): void {\n    super.success(message ?? this.text);\n  }\n\n  error(message?: string | Error): void {\n    super.error(message ?? this.text);\n  }\n}\n\nexport interface WithProgressOptions<Props extends Record<string, unknown>, T>\n  extends ProgressOptions<Props> {\n  /** Message to print on success. If a function, the result is passed. */\n  successText?: string | ((result: T) => string);\n  /** Message to print on fail. If a function, the error is passed. */\n  failureText?: string | ((error: Error) => string);\n}\n\n/** Calls a function with a progress bar. */\nexport async function withProgress<Props extends Record<string, unknown>, T>(\n  opts: WithProgressOptions<Props, T> | string,\n  fn: (bar: Progress<Props>) => Promise<T>\n): Promise<T>;\nexport async function withProgress(opts: any, fn: any) {\n  const bar = new Progress(opts);\n\n  try {\n    const result = await fn(bar);\n    bar.success(\n      opts.successText\n        ? typeof opts.successText === 'function'\n          ? opts.successText(result)\n          : opts.successText\n        : opts.text\n        ? typeof opts.text === 'function'\n          ? opts.text(bar.props)\n          : opts.text\n        : 'Completed'\n    );\n  } catch (error: any) {\n    bar.error(\n      typeof opts.failureText === 'function' ? opts.failureText(error) : opts.failureText ?? error\n    );\n    throw error;\n  }\n}\n", "import * as logBuiltins from './log';\nimport { createLogger } from './log-base';\nimport { CustomLoggerOptions, LogFunction } from './types';\nimport type { info, warn, debug, error, success, trace, writeLine } from './log';\n\ntype LogConstructor = {\n  /**\n   * Creates a logger function with a psuedo-random color based off the namespace.\n   *\n   * A custom color can be assigned by doing any of the following:\n   *\n   * - Passing a color argument with a color name \"blue\"\n   * - Passing a color argument with a hex value \"#0000FF\"\n   * - Passing a color argument with an ANSI 256 palette value (0-255)\n   * - Passing a color argument with a RGB value [0, 0, 255]\n   * - Using chalk or another formatter on the namespace name.\n   */\n  new(name: string, options?: CustomLoggerOptions): LogFunction;\n  /**\n   * Creates a logger function with a psuedo-random color based off the namespace.\n   *\n   * A custom color can be assigned by doing any of the following:\n   *\n   * - Passing a color argument with a color name \"blue\"\n   * - Passing a color argument with a hex value \"#0000FF\"\n   * - Passing a color argument with an ANSI 256 palette value (0-255)\n   * - Passing a color argument with a RGB value [0, 0, 255]\n   * - Using chalk or another formatter on the namespace name.\n   */\n  (name: string, options?: CustomLoggerOptions): LogFunction;\n\n  info: typeof info;\n  warn: typeof warn;\n  debug: typeof debug;\n  error: typeof error;\n  success: typeof success;\n  trace: typeof trace;\n  writeLine: typeof writeLine;\n};\n\nfor (const key in logBuiltins) {\n  (createLogger as any)[key] = (logBuiltins as any)[key];\n}\n\n/**\n * The logger class contains static methods for basic logging operations, but can be constructed to\n * create custom loggers.\n */\nexport default createLogger as unknown as LogConstructor;\n"],
  "mappings": "ykBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,cAAAE,GAAA,aAAAC,GAAA,cAAAC,EAAA,WAAAC,GAAA,aAAAC,EAAA,YAAAC,EAAA,gBAAAC,GAAA,UAAAC,EAAA,UAAAC,GAAA,YAAAL,GAAA,UAAAM,EAAA,SAAAC,EAAA,iBAAAC,GAAA,uBAAAC,EAAA,eAAAC,EAAA,iBAAAC,GAAA,YAAAC,GAAA,UAAAC,EAAA,SAAAC,GAAA,iBAAAC,GAAA,gBAAAC,GAAA,cAAAC,IAAA,eAAAC,GAAAvB,ICAA,IAAAwB,GAAA,GAAAC,GAAAD,GAAA,aAAAE,IAAA,IAAAC,EAAoB,6BAEdC,EAAM,QACNC,EAAM,QACNC,EAAM,OACNC,EAAM,IAENC,GAAgB,EAAAC,QAAQ,IAAI,eAAiB,iBAE7CC,EAAc,CAAC,EAErBA,EAAY,SAAW,CAACC,EAAGC,IAAM,CAChC,GAAI,OAAOD,GAAM,SAChB,MAAM,IAAI,UAAU,8BAA8B,EAGnD,OAAI,OAAOC,GAAM,SACTR,GAAOO,EAAI,GAAK,IAGjBP,GAAOQ,EAAI,GAAKL,GAAOI,EAAI,GAAK,GACxC,EAEAD,EAAY,WAAa,CAACC,EAAGC,IAAM,CAClC,GAAI,OAAOD,GAAM,SAChB,MAAM,IAAI,UAAU,8BAA8B,EAGnD,IAAIE,EAAc,GAElB,OAAIF,EAAI,EACPE,GAAeT,EAAO,CAACO,EAAK,IAClBA,EAAI,IACdE,GAAeT,EAAMO,EAAI,KAGtBC,EAAI,EACPC,GAAeT,EAAO,CAACQ,EAAK,IAClBA,EAAI,IACdC,GAAeT,EAAMQ,EAAI,KAGnBC,CACR,EAEAH,EAAY,SAAW,CAACI,EAAQ,IAAMV,EAAMU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ACrD,IAAMC,EAAM,IAAI7B,EAAS2B,CAAI,EAE7B,GAAI,CACF,IAAMG,EAAS,MAAMF,EAAGC,CAAG,EAC3BA,EAAI,QACFF,EAAK,YACD,OAAOA,EAAK,aAAgB,WAC1BA,EAAK,YAAYG,CAAM,EACvBH,EAAK,YACPA,EAAK,KACL,OAAOA,EAAK,MAAS,WACnBA,EAAK,KAAKE,EAAI,KAAK,EACnBF,EAAK,KACP,WACN,CACF,OAASI,EAAP,CACA,MAAAF,EAAI,MACF,OAAOF,EAAK,aAAgB,WAAaA,EAAK,YAAYI,CAAK,EAAIJ,EAAK,aAAeI,CACzF,EACMA,CACR,CACF,CCrQA,QAAWC,KAAOC,GACfC,EAAqBF,GAAQC,GAAoBD,GAOpD,IAAOG,GAAQD",
  "names": ["src_exports", "__export", "BarStyle", "CLIError", "LogWidget", "default_export_default", "Progress", "Spinner", "ansi_escapes_exports", "source_default", "debug", "error", "info", "injectLogger", "isUnicodeSupported", "logSymbols", "setLogFilter", "success", "trace", "warn", "withProgress", "withSpinner", "writeLine", "__toCommonJS", "ansi_escapes_exports", "__export", "ansi_escapes_default", "import_node_process", "ESC", "OSC", "BEL", "SEP", "isTerminalApp", "process", "ansiEscapes", "x", "y", "returnValue", "count", "clear", "i", "text", "url", "buffer", "options", "cwd", "message", "hasX", "hasY", "import_fs", "import_module", "STDOUT", "STDERR", "platformWidgetEnabled", "platformWrite", "content", "STDOUT", "STDERR", "platformUnicodeSupported", "cwd", "platformSimplifyErrorPath", "filepath", "log_exports", "__export", "debug", "error", "info", "success", "trace", "warn", "writeLine", "wrapAnsi16", "offset", "code", "wrapAnsi256", "wrapAnsi16m", "red", "green", "blue", "styles", "modifierNames", "foregroundColorNames", "backgroundColorNames", "colorNames", "assembleStyles", "codes", "groupName", "group", "styleName", "style", "hex", "matches", "colorString", "character", "integer", "remainder", "value", "result", "ansiStyles", "ansi_styles_default", "import_node_process", "import_node_os", "import_node_tty", "hasFlag", "flag", "argv", "process", "prefix", "position", "terminatorPosition", "env", "flagForceColor", "envForceColor", "translateLevel", "level", "_supportsColor", "haveStream", "streamIsTTY", "sniffFlags", "noFlagForceColor", "forceColor", "min", "osRelease", "os", "sign", "version", "createSupportsColor", "stream", "options", "supportsColor", "tty", "supports_color_default", "stringReplaceAll", "string", "substring", "replacer", "index", "substringLength", "endIndex", "returnValue", "stringEncaseCRLFWithFirstIndex", "prefix", "postfix", "gotCR", "stdoutColor", "stderrColor", "supports_color_default", "GENERATOR", "STYLER", "IS_EMPTY", "levelMapping", "styles", "applyOptions", "object", "options", "colorLevel", "chalkFactory", "options", "chalk", "strings", "applyOptions", "createChalk", "styleName", "style", "ansi_styles_default", "styles", "builder", "createBuilder", "createStyler", "STYLER", "IS_EMPTY", "getModelAnsi", "model", "level", "type", "arguments_", "usedModels", "styler", "levelMapping", "bgModel", "proto", "GENERATOR", "open", "close", "parent", "openAll", "closeAll", "self", "_styler", "_isEmpty", "applyStyle", "string", "stringReplaceAll", "lfIndex", "stringEncaseCRLFWithFirstIndex", "chalkStderr", "stderrColor", "source_default", "chalk", "import_path", "isBuiltin", "pathname", "formatStackTrace", "err", "v8firstLine", "parsed", "line", "match", "match2", "at", "method", "file", "fileSplit", "platformSimplifyErrorPath", "nodeModuleJobIndex", "sliceAt", "column", "native", "getColoredDirname", "filename", "dirname", "path", "source_default", "source", "formatErrorObj", "name", "message", "description", "hideStack", "hideName", "stack", "CLIError", "ansiRegex", "onlyFirst", "pattern", "stripAnsi", "string", "ansiRegex", "import_util", "filters", "setLogFilter", "newFilters", "filter", "isLogVisible", "id", "defaultVisibility", "aliasesToAll", "x", "COLORS", "stringify", "data", "obj", "formatErrorObj", "selectColor", "namespace", "hash", "i", "getColor", "color", "source_default", "formatImplementation", "format", "fmt", "args", "index", "result", "match", "arg", "LogFunction", "isLogVisible", "depth", "options", "createLogger", "name", "opts", "id", "coloredText", "boldText", "type", "debug", "strippedName", "stripAnsi", "colorFn", "coloredName", "fn", "clearWidgets", "platformWrite", "redrawWidgets", "isUnicodeSupported", "platformUnicodeSupported", "logSymbols", "info", "createLogger", "warn", "_trace", "trace", "data", "platformWrite", "formatStackTrace", "error", "logSymbols", "debug", "success", "writeLine", "message", "clearWidgets", "redrawWidgets", "widgets", "widgetLineCount", "widgetTimer", "widgetDrawingDisabled", "platformWidgetEnabled", "LogWidget", "redrawWidgets", "finalMessage", "index", "clearWidgets", "platformWrite", "#nextUpdate", "#text", "#newlines", "now", "text", "fn", "message", "success", "error", "ansi_escapes_default", "widget", "errorAllWidgets", "w", "defaultSpinnerOptions", "Spinner", "LogWidget", "#text", "#color", "#frames", "#props", "options", "value", "newData", "now", "frame", "source_default", "message", "withSpinner", "opts", "fn", "spinner", "result", "error", "injectLogger", "opts", "injectConsole", "injectProcess", "uncaughtExceptions", "unhandledRejections", "exitOnError", "info", "warn", "error", "debug", "condition", "msg", "timers", "label", "Spinner", "start", "spinner", "source_default", "counters", "n", "trace", "exception", "errorAllWidgets", "writeLine", "reason", "convertHSVtoRGB", "h", "s", "v", "r", "g", "b", "f", "p", "q", "t", "boxChars", "fullBox", "asciiChars", "getUnicodeBar", "progress", "width", "wholeWidth", "remainderWidth", "partWidth", "partChar", "fill", "empty", "getAsciiBar", "BarStyle", "defaultOptions", "defaultSpinnerOptions", "Progress", "LogWidget", "#text", "#beforeText", "#barWidth", "#barStyle", "#spinnerColor", "#spinnerFrames", "#props", "#spinnerFPS", "#value", "#total", "options", "value", "props", "now", "hue", "barColor", "source_default", "convertHSVtoRGB", "spinner", "frame", "getBar", "isUnicodeSupported", "beforeText", "message", "withProgress", "opts", "fn", "bar", "result", "error", "key", "log_exports", "createLogger", "default_export_default"]
}
