@terai/dev 0.0.2 → 0.0.4
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/bin.js +2 -1
- package/dist/cli.default.js +18982 -53
- package/dist/cli.default.js.map +1 -1
- package/dist/cli.default.mjs +19002 -53
- package/dist/cli.default.mjs.map +1 -1
- package/dist/cli.js +18969 -53
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +18978 -53
- package/dist/cli.mjs.map +1 -1
- package/dist/commands/extract.js +688 -10
- package/dist/commands/extract.js.map +1 -1
- package/dist/commands/extract.mjs +656 -10
- package/dist/commands/extract.mjs.map +1 -1
- package/dist/commands/index.js +997 -13
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/index.mjs +959 -13
- package/dist/commands/index.mjs.map +1 -1
- package/dist/commands/init.js +777 -11
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/init.mjs +741 -11
- package/dist/commands/init.mjs.map +1 -1
- package/dist/commands/translate.js +725 -10
- package/dist/commands/translate.js.map +1 -1
- package/dist/commands/translate.mjs +687 -10
- package/dist/commands/translate.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +37 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -8
- package/dist/types.d.mts +0 -2
- package/dist/types.d.ts +0 -2
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
- package/dist/types.mjs +0 -1
- package/dist/types.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/commands/translate.ts","../../../generator/src/generate.ts","../../../logger/src/logger.ts","../../../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/ansi-styles/index.js","../../../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/supports-color/index.js","../../../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/utilities.js","../../../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/index.js"],"sourcesContent":["// Dependencies\nimport { generate } from '@terai/generator'\nimport { loadConfig, runtime } from '@terai/runtime'\nimport { logger } from '@terai/logger'\nimport { translate } from '@terai/translator'\nimport { merge, stringify, groupDictionaryByChunks } from '@terai/utils'\n\n// Types\nimport type { CAC } from 'cac'\nimport type { Dictionary, BuildManifest } from '@terai/types'\n\nexport type TranslateOptions = {\n cwd: string\n}\n\nexport function createTranslateCommand(cli: CAC, cwd: string) {\n return cli\n .command('translate', 'Translate messages from your project')\n .option('--cwd <cwd>', 'Current working directory', { default: cwd })\n .action(translateCmd)\n}\n\nexport async function translateCmd({ cwd }: TranslateOptions) {\n logger.heading('translate', 'Translate messages from your project')\n const done = logger.time.success()\n\n const config = await loadConfig({ cwd })\n\n const outDirPath = runtime.path.resolve(cwd, config.outDir)\n const tmuDirPath = runtime.path.resolve(cwd, config.outDir, '.terai')\n const manifestPath = runtime.path.resolve(tmuDirPath, 'locale-manifest.json')\n const existsManifest = runtime.fs.exists(manifestPath)\n if (!existsManifest) {\n return logger.error(\n 'translate',\n `No locale-manifest.json found in ${tmuDirPath}. Please run \"extract\" first.`\n )\n }\n\n const buildManifest = JSON.parse(\n runtime.fs.readFile(manifestPath)\n ) as BuildManifest\n\n let totalTranslatedMsgs = 0\n let totalCachedMsgs = 0\n\n await Promise.all(\n config.outLocales.map(async locale => {\n try {\n let translatedDictionary: Dictionary = {}\n const untranslatedDictionary: Dictionary = {}\n const localeDirPath = runtime.path.resolve(outDirPath, locale)\n const localeCachePath = runtime.path.resolve(\n tmuDirPath,\n 'cache',\n `${locale}.cache.json`\n )\n const cacheExists = runtime.fs.exists(localeCachePath)\n let cache: Dictionary = cacheExists\n ? JSON.parse(runtime.fs.readFile(localeCachePath))\n : {}\n\n let localeCachedMsgs = 0\n let localeTranslatedMsgs = 0\n\n for (const id in buildManifest.messages) {\n const { value, chunksIds } = buildManifest.messages[id]\n const chnks = chunksIds.length ? chunksIds : [locale]\n\n for (const chunkId of chnks) {\n const chunkPath = runtime.path.resolve(\n localeDirPath,\n `${chunkId}.json`\n )\n const existsChunk = runtime.fs.exists(chunkPath)\n const chunk: Dictionary = existsChunk\n ? JSON.parse(runtime.fs.readFile(chunkPath))\n : {}\n const localeValue = chunk[id] ?? cache[id]\n\n if (!localeValue) {\n untranslatedDictionary[id] = value\n localeTranslatedMsgs++\n } else {\n translatedDictionary[id] = localeValue\n // Update cache in case local value is different\n cache[id] = localeValue\n localeCachedMsgs++\n }\n }\n }\n\n if (localeTranslatedMsgs > 0) {\n const translation = await translate({\n ...config,\n dictionary: untranslatedDictionary,\n locale\n })\n\n translatedDictionary = merge(translation, translatedDictionary)\n }\n\n cache = {\n ...cache,\n ...translatedDictionary\n }\n\n runtime.fs.remove(localeDirPath)\n\n const dictionaries = groupDictionaryByChunks(\n translatedDictionary,\n buildManifest,\n locale\n )\n\n await generate({\n ...config,\n dictionaries: dictionaries,\n locale,\n cwd\n })\n\n runtime.fs.write(localeCachePath, stringify(cache))\n\n totalTranslatedMsgs += localeTranslatedMsgs\n totalCachedMsgs += localeCachedMsgs\n\n logger.info(\n `Locale ${locale.toUpperCase()}:`,\n `${localeTranslatedMsgs} new messages translated, ${localeCachedMsgs} recovered from cache`\n )\n } catch (err) {\n if (err instanceof Error) {\n logger.error(\n `${locale} translation:`,\n `Error translating to ${locale}: ${err.message}\\n`\n )\n }\n }\n })\n )\n\n if (!totalTranslatedMsgs) {\n return done('Everything up-to-date')\n }\n\n done(\n `Translated ${totalTranslatedMsgs} messages, ${totalCachedMsgs} read from cache`\n )\n}\n","// Dependencies\nimport { runtime } from '@terai/runtime'\nimport { stringify } from '@terai/utils'\n\n// Types\nimport type { Config, Locale, Dictionaries } from '@terai/types'\n\ntype GenerateOptions = {\n cwd: string\n locale: Locale\n dictionaries: Dictionaries\n} & Pick<Config, 'outDir'>\n\nexport async function generate({\n dictionaries,\n locale,\n cwd,\n outDir\n}: GenerateOptions) {\n const folderPath = runtime.path.resolve(cwd, outDir, locale)\n const output = []\n\n for (const id in dictionaries) {\n const fileDir = runtime.path.resolve(folderPath, id + '.json')\n const fileContent = dictionaries[id]\n const idOutput = stringify(fileContent)\n\n runtime.fs.write(fileDir, idOutput)\n\n output.push(idOutput)\n }\n\n return output\n}\n","// Dependencies\nimport process from 'node:process'\nimport chalk from 'chalk'\n\nfunction log(message: string) {\n return process.stdout.write(message + '\\n')\n}\n\nfunction logError(message: string) {\n return process.stderr.write(message + '\\n')\n}\n\nfunction logBullet(\n logger: typeof log | typeof logError,\n colorizePrefix: typeof chalk,\n colorizeText: typeof chalk,\n symbol: string,\n prefix: string,\n text?: string | string[]\n) {\n const textParts = Array.isArray(text) ? text : [text || ''].filter(Boolean)\n const formattedText = textParts\n .map(textPart => colorizeText(textPart))\n .join('')\n\n logger(\n `${' '.repeat(3)} ${colorizePrefix(symbol)} ${colorizePrefix(\n prefix\n )} ${formattedText}`\n )\n}\n\nfunction warn(prefix: string, text?: string | string[]) {\n logBullet(log, chalk.yellow, chalk.yellow, '●', prefix, text)\n}\n\nfunction debug(prefix: string, text?: string | string[]) {\n logBullet(log, chalk.yellow, chalk.dim, '●', prefix, text)\n}\n\nfunction info(prefix: string, text?: string | string[]) {\n logBullet(log, chalk.cyan, chalk.dim, '◼', prefix, text)\n}\n\nfunction success(text: string) {\n logBullet(log, chalk.green, chalk.dim, '✔', text)\n}\n\nfunction error(prefix: string, text?: string | string[]) {\n log('')\n logBullet(logError, chalk.red, chalk.red, '▲', prefix, text)\n}\n\nfunction heading(heading: string, description?: string) {\n return log(\n `\\n${chalk.bgWhite(` ${chalk.whiteBright(heading)} `)} ${chalk.bold(\n description\n )}\\n`\n )\n}\n\nconst timing = (fn: (str: string) => any) => () => {\n const start = performance.now()\n return (msg: string) => {\n const end = performance.now()\n const ms = end - start\n fn(`${msg} ${chalk.gray(`(${ms.toFixed(2)}ms)`)}`)\n }\n}\n\nexport const logger = {\n colors: chalk,\n log,\n heading,\n debug,\n info,\n warn,\n success,\n error,\n time: {\n success: timing(success),\n info: timing(info),\n debug: timing(debug)\n }\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\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\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 || 'GITEA_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` → `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"],"mappings":"skBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,4BAAAE,GAAA,iBAAAC,KAAA,eAAAC,GAAAJ,ICCA,IAAAK,EAAwB,0BACxBC,EAA0B,wBAW1B,eAAsBC,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AO,MACL,GAAGS,CAAM,gBACT,wBAAwBA,CAAM,KAAKkB,EAAI,OAAO;AAAA,CAChD,CAEJ,CACF,CAAC,CACH,EAEI,CAACpB,EACH,OAAON,EAAK,uBAAuB,EAGrCA,EACE,cAAcM,CAAmB,cAAcC,CAAe,kBAChE,CACF","names":["translate_exports","__export","createTranslateCommand","translateCmd","__toCommonJS","import_runtime","import_utils","generate","dictionaries","locale","cwd","outDir","folderPath","runtime","output","id","fileDir","fileContent","idOutput","stringify","import_runtime","import_node_process","import_node_os","import_node_tty","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","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","postfix","gotCR","stdoutColor","stderrColor","GENERATOR","STYLER","IS_EMPTY","levelMapping","applyOptions","object","colorLevel","chalkFactory","chalk","strings","createChalk","builder","createBuilder","createStyler","getModelAnsi","model","type","arguments_","usedModels","styler","bgModel","proto","open","close","parent","openAll","closeAll","self","_styler","_isEmpty","applyStyle","lfIndex","chalkStderr","source_default","log","message","logError","logBullet","logger","colorizePrefix","colorizeText","symbol","text","formattedText","textPart","warn","debug","info","success","error","heading","description","timing","fn","start","msg","ms","import_translator","import_utils","createTranslateCommand","cli","cwd","translateCmd","ve","done","config","outDirPath","tmuDirPath","manifestPath","buildManifest","totalTranslatedMsgs","totalCachedMsgs","locale","translatedDictionary","untranslatedDictionary","localeDirPath","localeCachePath","cache","localeCachedMsgs","localeTranslatedMsgs","id","value","chunksIds","chnks","chunkId","chunkPath","localeValue","translation","dictionaries","d","err"]}
|
|
1
|
+
{"version":3,"sources":["../../src/commands/translate.ts","../../../generator/src/generate.ts","../../../logger/src/logger.ts","../../../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/ansi-styles/index.js","../../../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/supports-color/index.js","../../../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/utilities.js","../../../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/index.js"],"sourcesContent":["// Dependencies\nimport { generate } from '@terai/generator'\nimport { loadConfig, runtime } from '@terai/runtime'\nimport { logger } from '@terai/logger'\nimport { translate } from '@terai/translator'\nimport { merge, stringify, groupDictionaryByChunks } from '@terai/utils'\n\n// Types\nimport type { CAC } from 'cac'\nimport type { Dictionary, BuildManifest } from '@terai/types'\n\nexport type TranslateOptions = {\n\tcwd: string\n}\n\nexport function createTranslateCommand(cli: CAC, cwd: string) {\n\treturn cli\n\t\t.command('translate', 'Translate messages from your project')\n\t\t.option('--cwd <cwd>', 'Current working directory', { default: cwd })\n\t\t.action(translateCmd)\n}\n\nexport async function translateCmd({ cwd }: TranslateOptions) {\n\tlogger.heading('translate', 'Translate messages from your project')\n\tconst done = logger.time.success()\n\n\tconst config = await loadConfig({ cwd })\n\n\tconst outDirPath = runtime.path.resolve(cwd, config.outDir)\n\tconst tmuDirPath = runtime.path.resolve(cwd, config.outDir, '.terai')\n\tconst manifestPath = runtime.path.resolve(tmuDirPath, 'locale-manifest.json')\n\tconst existsManifest = runtime.fs.exists(manifestPath)\n\tif (!existsManifest) {\n\t\treturn logger.error(\n\t\t\t'translate',\n\t\t\t`No locale-manifest.json found in ${tmuDirPath}. Please run \"extract\" first.`\n\t\t)\n\t}\n\n\tconst buildManifest = JSON.parse(\n\t\truntime.fs.readFile(manifestPath)\n\t) as BuildManifest\n\n\tlet totalTranslatedMsgs = 0\n\tlet totalCachedMsgs = 0\n\n\tawait Promise.all(\n\t\tconfig.outLocales.map(async (locale) => {\n\t\t\ttry {\n\t\t\t\tlet translatedDictionary: Dictionary = {}\n\t\t\t\tconst untranslatedDictionary: Dictionary = {}\n\t\t\t\tconst localeDirPath = runtime.path.resolve(outDirPath, locale)\n\t\t\t\tconst localeCachePath = runtime.path.resolve(\n\t\t\t\t\ttmuDirPath,\n\t\t\t\t\t'cache',\n\t\t\t\t\t`${locale}.cache.json`\n\t\t\t\t)\n\t\t\t\tconst cacheExists = runtime.fs.exists(localeCachePath)\n\t\t\t\tlet cache: Dictionary = cacheExists\n\t\t\t\t\t? JSON.parse(runtime.fs.readFile(localeCachePath))\n\t\t\t\t\t: {}\n\n\t\t\t\tlet localeCachedMsgs = 0\n\t\t\t\tlet localeTranslatedMsgs = 0\n\n\t\t\t\tfor (const id in buildManifest.messages) {\n\t\t\t\t\tconst { value, chunksIds } = buildManifest.messages[id]\n\t\t\t\t\tconst chnks = chunksIds.length ? chunksIds : [locale]\n\n\t\t\t\t\tfor (const chunkId of chnks) {\n\t\t\t\t\t\tconst chunkPath = runtime.path.resolve(\n\t\t\t\t\t\t\tlocaleDirPath,\n\t\t\t\t\t\t\t`${chunkId}.json`\n\t\t\t\t\t\t)\n\t\t\t\t\t\tconst existsChunk = runtime.fs.exists(chunkPath)\n\t\t\t\t\t\tconst chunk: Dictionary = existsChunk\n\t\t\t\t\t\t\t? JSON.parse(runtime.fs.readFile(chunkPath))\n\t\t\t\t\t\t\t: {}\n\t\t\t\t\t\tconst localeValue = chunk[id] ?? cache[id]\n\n\t\t\t\t\t\tif (!localeValue) {\n\t\t\t\t\t\t\tuntranslatedDictionary[id] = value\n\t\t\t\t\t\t\tlocaleTranslatedMsgs++\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttranslatedDictionary[id] = localeValue\n\t\t\t\t\t\t\t// Update cache in case local value is different\n\t\t\t\t\t\t\tcache[id] = localeValue\n\t\t\t\t\t\t\tlocaleCachedMsgs++\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (localeTranslatedMsgs > 0) {\n\t\t\t\t\tconst translation = await translate({\n\t\t\t\t\t\t...config,\n\t\t\t\t\t\tdictionary: untranslatedDictionary,\n\t\t\t\t\t\tlocale\n\t\t\t\t\t})\n\n\t\t\t\t\ttranslatedDictionary = merge(translation, translatedDictionary)\n\t\t\t\t}\n\n\t\t\t\tcache = {\n\t\t\t\t\t...cache,\n\t\t\t\t\t...translatedDictionary\n\t\t\t\t}\n\n\t\t\t\truntime.fs.remove(localeDirPath)\n\n\t\t\t\tconst dictionaries = groupDictionaryByChunks(\n\t\t\t\t\ttranslatedDictionary,\n\t\t\t\t\tbuildManifest,\n\t\t\t\t\tlocale\n\t\t\t\t)\n\n\t\t\t\tawait generate({\n\t\t\t\t\t...config,\n\t\t\t\t\tdictionaries: dictionaries,\n\t\t\t\t\tlocale,\n\t\t\t\t\tcwd\n\t\t\t\t})\n\n\t\t\t\truntime.fs.write(localeCachePath, stringify(cache))\n\n\t\t\t\ttotalTranslatedMsgs += localeTranslatedMsgs\n\t\t\t\ttotalCachedMsgs += localeCachedMsgs\n\n\t\t\t\tlogger.info(\n\t\t\t\t\t`Locale ${locale.toUpperCase()}:`,\n\t\t\t\t\t`${localeTranslatedMsgs} new messages translated, ${localeCachedMsgs} recovered from cache`\n\t\t\t\t)\n\t\t\t} catch (err) {\n\t\t\t\tif (err instanceof Error) {\n\t\t\t\t\tlogger.error(\n\t\t\t\t\t\t`${locale} translation:`,\n\t\t\t\t\t\t`Error translating to ${locale}: ${err.message}\\n`\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t)\n\n\tif (!totalTranslatedMsgs) {\n\t\treturn done('Everything up-to-date')\n\t}\n\n\tdone(\n\t\t`Translated ${totalTranslatedMsgs} messages, ${totalCachedMsgs} read from cache`\n\t)\n}\n","// Dependencies\nimport { runtime } from '@terai/runtime'\nimport { stringify } from '@terai/utils'\n\n// Types\nimport type { Config, Locale, Dictionaries } from '@terai/types'\n\ntype GenerateOptions = {\n\tcwd: string\n\tlocale: Locale\n\tdictionaries: Dictionaries\n} & Pick<Config, 'outDir'>\n\nexport async function generate({\n\tdictionaries,\n\tlocale,\n\tcwd,\n\toutDir\n}: GenerateOptions) {\n\tconst folderPath = runtime.path.resolve(cwd, outDir, locale)\n\tconst output = []\n\n\tfor (const id in dictionaries) {\n\t\tconst fileDir = runtime.path.resolve(folderPath, `${id}.json`)\n\t\tconst fileContent = dictionaries[id]\n\t\tconst idOutput = stringify(fileContent)\n\n\t\truntime.fs.write(fileDir, idOutput)\n\n\t\toutput.push(idOutput)\n\t}\n\n\treturn output\n}\n","// Dependencies\nimport process from 'node:process'\nimport chalk from 'chalk'\n\nfunction log(message: string) {\n\treturn process.stdout.write(`${message}\\n`)\n}\n\nfunction logError(message: string) {\n\treturn process.stderr.write(`${message}\\n`)\n}\n\nfunction logBullet(\n\tlogger: typeof log | typeof logError,\n\tcolorizePrefix: typeof chalk,\n\tcolorizeText: typeof chalk,\n\tsymbol: string,\n\tprefix: string,\n\ttext?: string | string[]\n) {\n\tconst textParts = Array.isArray(text) ? text : [text || ''].filter(Boolean)\n\tconst formattedText = textParts\n\t\t.map((textPart) => colorizeText(textPart))\n\t\t.join('')\n\n\tlogger(\n\t\t`${' '.repeat(3)} ${colorizePrefix(symbol)} ${colorizePrefix(\n\t\t\tprefix\n\t\t)} ${formattedText}`\n\t)\n}\n\nfunction warn(prefix: string, text?: string | string[]) {\n\tlogBullet(log, chalk.yellow, chalk.yellow, '●', prefix, text)\n}\n\nfunction debug(prefix: string, text?: string | string[]) {\n\tlogBullet(log, chalk.yellow, chalk.dim, '●', prefix, text)\n}\n\nfunction info(prefix: string, text?: string | string[]) {\n\tlogBullet(log, chalk.cyan, chalk.dim, '◼', prefix, text)\n}\n\nfunction success(text: string) {\n\tlogBullet(log, chalk.green, chalk.dim, '✔', text)\n}\n\nfunction error(prefix: string, text?: string | string[]) {\n\tlog('')\n\tlogBullet(logError, chalk.red, chalk.red, '▲', prefix, text)\n}\n\nfunction heading(heading: string, description?: string) {\n\treturn log(\n\t\t`\\n${chalk.bgWhite(` ${chalk.whiteBright(heading)} `)} ${chalk.bold(\n\t\t\tdescription\n\t\t)}\\n`\n\t)\n}\n\nconst timing = (fn: (str: string) => any) => () => {\n\tconst start = performance.now()\n\treturn (msg: string) => {\n\t\tconst end = performance.now()\n\t\tconst ms = end - start\n\t\tfn(`${msg} ${chalk.gray(`(${ms.toFixed(2)}ms)`)}`)\n\t}\n}\n\nexport const logger = {\n\tcolors: chalk,\n\tlog,\n\theading,\n\tdebug,\n\tinfo,\n\twarn,\n\tsuccess,\n\terror,\n\ttime: {\n\t\tsuccess: timing(success),\n\t\tinfo: timing(info),\n\t\tdebug: timing(debug)\n\t}\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\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\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 || 'GITEA_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` → `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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,qBAAwB;AACxB,mBAA0B;AAW1B,eAAsB,SAAS;EAC9B;EACA;EACA;EACA;AACD,GAAoB;AACnB,QAAM,aAAa,uBAAQ,KAAK,QAAQ,KAAK,QAAQ,MAAM;AAC3D,QAAM,SAAS,CAAC;AAEhB,aAAW,MAAM,cAAc;AAC9B,UAAM,UAAU,uBAAQ,KAAK,QAAQ,YAAY,GAAG,EAAE,OAAO;AAC7D,UAAM,cAAc,aAAa,EAAE;AACnC,UAAM,eAAW,wBAAU,WAAW;AAEtC,2BAAQ,GAAG,MAAM,SAAS,QAAQ;AAElC,WAAO,KAAK,QAAQ;EACrB;AAEA,SAAO;AACR;;;AD/BA,IAAAA,kBAAoC;;;AEDpC,0BAAoB;AEDpB,IAAAC,uBAAoB;AACpB,qBAAe;AACf,sBAAgB;ADFhB,IAAM,yBAAyB;AAE/B,IAAM,aAAa,CAAC,SAAS,MAAM,CAAA,SAAQ,QAAU,OAAO,MAAM;AAElE,IAAM,cAAc,CAAC,SAAS,MAAM,CAAA,SAAQ,QAAU,KAAK,MAAM,MAAM,IAAI;AAE3E,IAAM,cAAc,CAAC,SAAS,MAAM,CAAC,KAAK,OAAO,SAAS,QAAU,KAAK,MAAM,MAAM,GAAG,IAAI,KAAK,IAAI,IAAI;AAEzG,IAAM,SAAS;EACd,UAAU;IACT,OAAO,CAAC,GAAG,CAAC;;IAEZ,MAAM,CAAC,GAAG,EAA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AAA,IACC,cAAc,mBAAmB,cAAc,eAAe;AAAA,EAC/D;AACD;","names":["import_runtime","import_node_process","process","os","tty","styles","chalk","logger","heading","import_utils"]}
|