ccusage 18.0.1 → 18.0.3

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/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
- import { $ as inspectError, D as calculateBurnRate, E as DEFAULT_SESSION_DURATION_HOURS, F as BLOCKS_COMPACT_WIDTH_THRESHOLD, H as DEFAULT_LOCALE, I as BLOCKS_DEFAULT_TERMINAL_WIDTH, J as uniq, K as WEEK_DAYS, L as BLOCKS_WARNING_THRESHOLD, M as getFileModifiedTime, N as unreachable, O as filterRecentBlocks, P as _usingCtx, Q as map$2, U as DEFAULT_RECENT_DAYS, V as DEFAULT_CONTEXT_USAGE_THRESHOLDS, W as DEFAULT_REFRESH_INTERVAL_SECONDS, X as try_, Y as unwrap, Z as pipe, _ as loadWeeklyUsageData, at as __commonJSMin, et as inspect, f as loadDailyUsageData, g as loadSessionUsageById, h as loadSessionData, it as toArray, j as formatDateCompact, k as projectBlockUsage, m as loadSessionBlockData, n as calculateContextTokens, nt as isSuccess, ot as __require, p as loadMonthlyUsageData, rt as isFailure, s as getClaudePaths, st as __toESM, tt as succeed, z as CONFIG_FILE_NAME } from "./data-loader-Cn1U7E-7.js";
2
+ import { $ as DEFAULT_RECENT_DAYS, B as pushBreakdownRows, D as calculateBurnRate, E as DEFAULT_SESSION_DURATION_HOURS, F as formatDateCompact, G as BLOCKS_COMPACT_WIDTH_THRESHOLD, H as getFileModifiedTime, I as formatModelsDisplayMultiline, K as BLOCKS_DEFAULT_TERMINAL_WIDTH, L as formatNumber, M as addEmptySeparatorRow, N as createUsageReportTable, O as filterRecentBlocks, P as formatCurrency, Q as DEFAULT_LOCALE, R as formatTotalsRow, U as unreachable, V as require_picocolors, W as _usingCtx, Y as CONFIG_FILE_NAME, Z as DEFAULT_CONTEXT_USAGE_THRESHOLDS, _ as loadWeeklyUsageData, at as try_, ct as inspectError, dt as isSuccess, et as DEFAULT_REFRESH_INTERVAL_SECONDS, f as loadDailyUsageData, ft as isFailure, g as loadSessionUsageById, h as loadSessionData, it as unwrap, j as ResponsiveTable, k as projectBlockUsage, lt as inspect, m as loadSessionBlockData, mt as __toESM, n as calculateContextTokens, nt as WEEK_DAYS, ot as pipe, p as loadMonthlyUsageData, pt as toArray, q as BLOCKS_WARNING_THRESHOLD, s as getClaudePaths, st as map$1, ut as succeed, z as formatUsageDataRow } from "./data-loader-DcHYMoHv.js";
3
3
  import { D as maxValue, E as integer$1, F as string, I as transform, L as trim, M as parse$1, N as pipe$1, O as minValue, P as safeParse, R as union, T as flatten, d as filterDateSchema, k as number, n as SortOrders, t as CostModes, w as check, y as statuslineHookJsonSchema, z as getTotalTokens } from "./_types-BFL_bTNX.js";
4
4
  import { n as createTotalsObject, t as calculateTotals } from "./calculate-cost-CKH-OC_c.js";
5
- import { a as version, i as name, n as logger, r as description, t as log } from "./logger-ClkaWGUb.js";
6
- import { n as printMismatchReport, t as detectMismatches } from "./debug-DjEsvIbZ.js";
5
+ import { a as version, i as name, n as logger, r as description, t as log } from "./logger-CKyYzFzc.js";
6
+ import { n as printMismatchReport, t as detectMismatches } from "./debug-B95zJbM3.js";
7
7
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
8
8
  import a from "node:fs/promises";
9
9
  import path, { join } from "node:path";
@@ -154,12 +154,12 @@ var DefaultTranslation = class {
154
154
  }
155
155
  };
156
156
  const BUILT_IN_PREFIX_CODE = BUILT_IN_PREFIX.codePointAt(0);
157
- async function createCommandContext({ args, values, positionals, rest, argv: argv$1, tokens, command, cliOptions, callMode = "entry", omitted = false }) {
157
+ async function createCommandContext({ args, values, positionals, rest, argv, tokens, command, cliOptions, callMode = "entry", omitted = false }) {
158
158
  const _args = Object.entries(args).reduce((acc, [key, value$1]) => {
159
159
  acc[key] = Object.assign(create(), value$1);
160
160
  return acc;
161
161
  }, create());
162
- const env$2 = Object.assign(create(), COMMAND_OPTIONS_DEFAULT, cliOptions);
162
+ const env = Object.assign(create(), COMMAND_OPTIONS_DEFAULT, cliOptions);
163
163
  const locale = resolveLocale(cliOptions.locale);
164
164
  const localeStr = locale.toString();
165
165
  const adapter = (cliOptions.translationAdapterFactory || createTranslationAdapter)({
@@ -190,12 +190,12 @@ async function createCommandContext({ args, values, positionals, rest, argv: arg
190
190
  omitted,
191
191
  callMode,
192
192
  locale,
193
- env: env$2,
193
+ env,
194
194
  args: _args,
195
195
  values,
196
196
  positionals,
197
197
  rest,
198
- _: argv$1,
198
+ _: argv,
199
199
  tokens,
200
200
  toKebab: command.toKebab,
201
201
  log: cliOptions.usageSilent ? NOOP : log$1,
@@ -253,57 +253,57 @@ function renderHeader(ctx) {
253
253
  }
254
254
  const COMMON_ARGS_KEYS = Object.keys(COMMON_ARGS);
255
255
  async function renderUsage(ctx) {
256
- const messages$1 = [];
256
+ const messages = [];
257
257
  if (!ctx.omitted) {
258
258
  const description$1 = resolveDescription(ctx);
259
- if (description$1) messages$1.push(description$1, "");
259
+ if (description$1) messages.push(description$1, "");
260
260
  }
261
- messages$1.push(...await renderUsageSection(ctx), "");
262
- if (ctx.omitted && await hasCommands(ctx)) messages$1.push(...await renderCommandsSection(ctx), "");
263
- if (hasPositionalArgs(ctx)) messages$1.push(...await renderPositionalArgsSection(ctx), "");
264
- if (hasOptionalArgs(ctx)) messages$1.push(...await renderOptionalArgsSection(ctx), "");
261
+ messages.push(...await renderUsageSection(ctx), "");
262
+ if (ctx.omitted && await hasCommands(ctx)) messages.push(...await renderCommandsSection(ctx), "");
263
+ if (hasPositionalArgs(ctx)) messages.push(...await renderPositionalArgsSection(ctx), "");
264
+ if (hasOptionalArgs(ctx)) messages.push(...await renderOptionalArgsSection(ctx), "");
265
265
  const examples = await renderExamplesSection(ctx);
266
- if (examples.length > 0) messages$1.push(...examples, "");
267
- return messages$1.join("\n");
266
+ if (examples.length > 0) messages.push(...examples, "");
267
+ return messages.join("\n");
268
268
  }
269
269
  async function renderPositionalArgsSection(ctx) {
270
- const messages$1 = [];
271
- messages$1.push(`${ctx.translate(resolveBuiltInKey("ARGUMENTS"))}:`);
272
- messages$1.push(await generatePositionalArgsUsage(ctx));
273
- return messages$1;
270
+ const messages = [];
271
+ messages.push(`${ctx.translate(resolveBuiltInKey("ARGUMENTS"))}:`);
272
+ messages.push(await generatePositionalArgsUsage(ctx));
273
+ return messages;
274
274
  }
275
275
  async function renderOptionalArgsSection(ctx) {
276
- const messages$1 = [];
277
- messages$1.push(`${ctx.translate(resolveBuiltInKey("OPTIONS"))}:`);
278
- messages$1.push(await generateOptionalArgsUsage(ctx, getOptionalArgsPairs(ctx)));
279
- return messages$1;
276
+ const messages = [];
277
+ messages.push(`${ctx.translate(resolveBuiltInKey("OPTIONS"))}:`);
278
+ messages.push(await generateOptionalArgsUsage(ctx, getOptionalArgsPairs(ctx)));
279
+ return messages;
280
280
  }
281
281
  async function renderExamplesSection(ctx) {
282
- const messages$1 = [];
282
+ const messages = [];
283
283
  const resolvedExamples = await resolveExamples$1(ctx);
284
284
  if (resolvedExamples) {
285
285
  const examples = resolvedExamples.split("\n").map((example) => example.padStart(ctx.env.leftMargin + example.length));
286
- messages$1.push(`${ctx.translate(resolveBuiltInKey("EXAMPLES"))}:`, ...examples);
286
+ messages.push(`${ctx.translate(resolveBuiltInKey("EXAMPLES"))}:`, ...examples);
287
287
  }
288
- return messages$1;
288
+ return messages;
289
289
  }
290
290
  async function renderUsageSection(ctx) {
291
- const messages$1 = [`${ctx.translate(resolveBuiltInKey("USAGE"))}:`];
291
+ const messages = [`${ctx.translate(resolveBuiltInKey("USAGE"))}:`];
292
292
  if (ctx.omitted) {
293
293
  const defaultCommand = `${resolveEntry(ctx)}${await hasCommands(ctx) ? ` [${resolveSubCommand(ctx)}]` : ""} ${[generateOptionsSymbols(ctx), generatePositionalSymbols(ctx)].filter(Boolean).join(" ")}`;
294
- messages$1.push(defaultCommand.padStart(ctx.env.leftMargin + defaultCommand.length));
294
+ messages.push(defaultCommand.padStart(ctx.env.leftMargin + defaultCommand.length));
295
295
  if (await hasCommands(ctx)) {
296
296
  const commandsUsage = `${resolveEntry(ctx)} <${ctx.translate(resolveBuiltInKey("COMMANDS"))}>`;
297
- messages$1.push(commandsUsage.padStart(ctx.env.leftMargin + commandsUsage.length));
297
+ messages.push(commandsUsage.padStart(ctx.env.leftMargin + commandsUsage.length));
298
298
  }
299
299
  } else {
300
300
  const usageStr = `${resolveEntry(ctx)} ${resolveSubCommand(ctx)} ${[generateOptionsSymbols(ctx), generatePositionalSymbols(ctx)].filter(Boolean).join(" ")}`;
301
- messages$1.push(usageStr.padStart(ctx.env.leftMargin + usageStr.length));
301
+ messages.push(usageStr.padStart(ctx.env.leftMargin + usageStr.length));
302
302
  }
303
- return messages$1;
303
+ return messages;
304
304
  }
305
305
  async function renderCommandsSection(ctx) {
306
- const messages$1 = [`${ctx.translate(resolveBuiltInKey("COMMANDS"))}:`];
306
+ const messages = [`${ctx.translate(resolveBuiltInKey("COMMANDS"))}:`];
307
307
  const loadedCommands = await ctx.loadCommands();
308
308
  const commandMaxLength = Math.max(...loadedCommands.map((cmd) => (cmd.name || "").length));
309
309
  const commandsStr = await Promise.all(loadedCommands.map((cmd) => {
@@ -312,12 +312,12 @@ async function renderCommandsSection(ctx) {
312
312
  const command = `${key.padEnd(commandMaxLength + ctx.env.middleMargin)}${desc} `;
313
313
  return `${command.padStart(ctx.env.leftMargin + command.length)} `;
314
314
  }));
315
- messages$1.push(...commandsStr, "", ctx.translate(resolveBuiltInKey("FORMORE")));
316
- messages$1.push(...loadedCommands.map((cmd) => {
315
+ messages.push(...commandsStr, "", ctx.translate(resolveBuiltInKey("FORMORE")));
316
+ messages.push(...loadedCommands.map((cmd) => {
317
317
  const commandHelp = `${ctx.env.name} ${cmd.name} --help`;
318
318
  return `${commandHelp.padStart(ctx.env.leftMargin + commandHelp.length)}`;
319
319
  }));
320
- return messages$1;
320
+ return messages;
321
321
  }
322
322
  function resolveEntry(ctx) {
323
323
  return ctx.env.name || ctx.translate(resolveBuiltInKey("COMMAND"));
@@ -422,9 +422,9 @@ function generatePositionalSymbols(ctx) {
422
422
  return hasPositionalArgs(ctx) ? getPositionalArgs(ctx).map(([name$1]) => `<${name$1}>`).join(" ") : "";
423
423
  }
424
424
  function renderValidationErrors(_ctx, error) {
425
- const messages$1 = [];
426
- for (const err of error.errors) messages$1.push(err.message);
427
- return Promise.resolve(messages$1.join("\n"));
425
+ const messages = [];
426
+ for (const err of error.errors) messages.push(err.message);
427
+ return Promise.resolve(messages.join("\n"));
428
428
  }
429
429
  const HYPHEN_CHAR = "-";
430
430
  const HYPHEN_CODE = HYPHEN_CHAR.codePointAt(0);
@@ -749,9 +749,9 @@ function isNumeric(str$1) {
749
749
  function createTypeError(option, schema) {
750
750
  return new ArgResolveError(`Optional argument '--${option}' ${schema.short ? `or '-${schema.short}' ` : ""}should be '${schema.type}'`, option, "type", schema);
751
751
  }
752
- async function cli(argv$1, entry, options = {}) {
752
+ async function cli(argv, entry, options = {}) {
753
753
  const cliOptions = resolveCliOptions(options, entry);
754
- const tokens = parseArgs(argv$1);
754
+ const tokens = parseArgs(argv);
755
755
  const subCommand = getSubCommand(tokens);
756
756
  const { commandName: name$1, command, callMode } = await resolveCommand(subCommand, entry, cliOptions);
757
757
  if (!command) throw new Error(`Command not found: ${name$1 || ""}`);
@@ -766,7 +766,7 @@ async function cli(argv$1, entry, options = {}) {
766
766
  values,
767
767
  positionals,
768
768
  rest,
769
- argv: argv$1,
769
+ argv,
770
770
  tokens,
771
771
  omitted: !subCommand,
772
772
  callMode,
@@ -878,1897 +878,7 @@ async function executeCommand(cmd, ctx, name$1) {
878
878
  if (resolved.run == null) throw new Error(`'run' not found on Command \`${name$1}\``);
879
879
  await resolved.run(ctx);
880
880
  }
881
- var require_debug = /* @__PURE__ */ __commonJSMin(((exports, module) => {
882
- let messages = [];
883
- let level = 0;
884
- const debug$3 = (msg, min) => {
885
- if (level >= min) messages.push(msg);
886
- };
887
- debug$3.WARN = 1;
888
- debug$3.INFO = 2;
889
- debug$3.DEBUG = 3;
890
- debug$3.reset = () => {
891
- messages = [];
892
- };
893
- debug$3.setDebugLevel = (v) => {
894
- level = v;
895
- };
896
- debug$3.warn = (msg) => debug$3(msg, debug$3.WARN);
897
- debug$3.info = (msg) => debug$3(msg, debug$3.INFO);
898
- debug$3.debug = (msg) => debug$3(msg, debug$3.DEBUG);
899
- debug$3.debugMessages = () => messages;
900
- module.exports = debug$3;
901
- }));
902
- var require_ansi_regex = /* @__PURE__ */ __commonJSMin(((exports, module) => {
903
- module.exports = ({ onlyFirst = false } = {}) => {
904
- const pattern = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");
905
- return new RegExp(pattern, onlyFirst ? void 0 : "g");
906
- };
907
- }));
908
- var require_strip_ansi = /* @__PURE__ */ __commonJSMin(((exports, module) => {
909
- const ansiRegex$1 = require_ansi_regex();
910
- module.exports = (string$1) => typeof string$1 === "string" ? string$1.replace(ansiRegex$1(), "") : string$1;
911
- }));
912
- var require_is_fullwidth_code_point = /* @__PURE__ */ __commonJSMin(((exports, module) => {
913
- const isFullwidthCodePoint$1 = (codePoint) => {
914
- if (Number.isNaN(codePoint)) return false;
915
- if (codePoint >= 4352 && (codePoint <= 4447 || codePoint === 9001 || codePoint === 9002 || 11904 <= codePoint && codePoint <= 12871 && codePoint !== 12351 || 12880 <= codePoint && codePoint <= 19903 || 19968 <= codePoint && codePoint <= 42182 || 43360 <= codePoint && codePoint <= 43388 || 44032 <= codePoint && codePoint <= 55203 || 63744 <= codePoint && codePoint <= 64255 || 65040 <= codePoint && codePoint <= 65049 || 65072 <= codePoint && codePoint <= 65131 || 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510 || 110592 <= codePoint && codePoint <= 110593 || 127488 <= codePoint && codePoint <= 127569 || 131072 <= codePoint && codePoint <= 262141)) return true;
916
- return false;
917
- };
918
- module.exports = isFullwidthCodePoint$1;
919
- module.exports.default = isFullwidthCodePoint$1;
920
- }));
921
- var require_emoji_regex$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
922
- module.exports = function() {
923
- return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
924
- };
925
- }));
926
- var require_string_width = /* @__PURE__ */ __commonJSMin(((exports, module) => {
927
- const stripAnsi$1 = require_strip_ansi();
928
- const isFullwidthCodePoint = require_is_fullwidth_code_point();
929
- const emojiRegex$1 = require_emoji_regex$1();
930
- const stringWidth$2 = (string$1) => {
931
- if (typeof string$1 !== "string" || string$1.length === 0) return 0;
932
- string$1 = stripAnsi$1(string$1);
933
- if (string$1.length === 0) return 0;
934
- string$1 = string$1.replace(emojiRegex$1(), " ");
935
- let width = 0;
936
- for (let i = 0; i < string$1.length; i++) {
937
- const code = string$1.codePointAt(i);
938
- if (code <= 31 || code >= 127 && code <= 159) continue;
939
- if (code >= 768 && code <= 879) continue;
940
- if (code > 65535) i++;
941
- width += isFullwidthCodePoint(code) ? 2 : 1;
942
- }
943
- return width;
944
- };
945
- module.exports = stringWidth$2;
946
- module.exports.default = stringWidth$2;
947
- }));
948
- var require_utils = /* @__PURE__ */ __commonJSMin(((exports, module) => {
949
- const stringWidth$1 = require_string_width();
950
- function codeRegex(capture) {
951
- return capture ? /\u001b\[((?:\d*;){0,5}\d*)m/g : /\u001b\[(?:\d*;){0,5}\d*m/g;
952
- }
953
- function strlen(str$1) {
954
- let code = codeRegex();
955
- return ("" + str$1).replace(code, "").split("\n").reduce(function(memo, s) {
956
- return stringWidth$1(s) > memo ? stringWidth$1(s) : memo;
957
- }, 0);
958
- }
959
- function repeat(str$1, times) {
960
- return Array(times + 1).join(str$1);
961
- }
962
- function pad(str$1, len, pad$1, dir) {
963
- let length = strlen(str$1);
964
- if (len + 1 >= length) {
965
- let padlen = len - length;
966
- switch (dir) {
967
- case "right":
968
- str$1 = repeat(pad$1, padlen) + str$1;
969
- break;
970
- case "center": {
971
- let right = Math.ceil(padlen / 2);
972
- str$1 = repeat(pad$1, padlen - right) + str$1 + repeat(pad$1, right);
973
- break;
974
- }
975
- default:
976
- str$1 = str$1 + repeat(pad$1, padlen);
977
- break;
978
- }
979
- }
980
- return str$1;
981
- }
982
- let codeCache = {};
983
- function addToCodeCache(name$1, on$1, off) {
984
- on$1 = "\x1B[" + on$1 + "m";
985
- off = "\x1B[" + off + "m";
986
- codeCache[on$1] = {
987
- set: name$1,
988
- to: true
989
- };
990
- codeCache[off] = {
991
- set: name$1,
992
- to: false
993
- };
994
- codeCache[name$1] = {
995
- on: on$1,
996
- off
997
- };
998
- }
999
- addToCodeCache("bold", 1, 22);
1000
- addToCodeCache("italics", 3, 23);
1001
- addToCodeCache("underline", 4, 24);
1002
- addToCodeCache("inverse", 7, 27);
1003
- addToCodeCache("strikethrough", 9, 29);
1004
- function updateState(state, controlChars) {
1005
- let controlCode = controlChars[1] ? parseInt(controlChars[1].split(";")[0]) : 0;
1006
- if (controlCode >= 30 && controlCode <= 39 || controlCode >= 90 && controlCode <= 97) {
1007
- state.lastForegroundAdded = controlChars[0];
1008
- return;
1009
- }
1010
- if (controlCode >= 40 && controlCode <= 49 || controlCode >= 100 && controlCode <= 107) {
1011
- state.lastBackgroundAdded = controlChars[0];
1012
- return;
1013
- }
1014
- if (controlCode === 0) {
1015
- for (let i in state)
1016
- /* istanbul ignore else */
1017
- if (Object.prototype.hasOwnProperty.call(state, i)) delete state[i];
1018
- return;
1019
- }
1020
- let info$1 = codeCache[controlChars[0]];
1021
- if (info$1) state[info$1.set] = info$1.to;
1022
- }
1023
- function readState(line) {
1024
- let code = codeRegex(true);
1025
- let controlChars = code.exec(line);
1026
- let state = {};
1027
- while (controlChars !== null) {
1028
- updateState(state, controlChars);
1029
- controlChars = code.exec(line);
1030
- }
1031
- return state;
1032
- }
1033
- function unwindState(state, ret) {
1034
- let lastBackgroundAdded = state.lastBackgroundAdded;
1035
- let lastForegroundAdded = state.lastForegroundAdded;
1036
- delete state.lastBackgroundAdded;
1037
- delete state.lastForegroundAdded;
1038
- Object.keys(state).forEach(function(key) {
1039
- if (state[key]) ret += codeCache[key].off;
1040
- });
1041
- if (lastBackgroundAdded && lastBackgroundAdded != "\x1B[49m") ret += "\x1B[49m";
1042
- if (lastForegroundAdded && lastForegroundAdded != "\x1B[39m") ret += "\x1B[39m";
1043
- return ret;
1044
- }
1045
- function rewindState(state, ret) {
1046
- let lastBackgroundAdded = state.lastBackgroundAdded;
1047
- let lastForegroundAdded = state.lastForegroundAdded;
1048
- delete state.lastBackgroundAdded;
1049
- delete state.lastForegroundAdded;
1050
- Object.keys(state).forEach(function(key) {
1051
- if (state[key]) ret = codeCache[key].on + ret;
1052
- });
1053
- if (lastBackgroundAdded && lastBackgroundAdded != "\x1B[49m") ret = lastBackgroundAdded + ret;
1054
- if (lastForegroundAdded && lastForegroundAdded != "\x1B[39m") ret = lastForegroundAdded + ret;
1055
- return ret;
1056
- }
1057
- function truncateWidth(str$1, desiredLength) {
1058
- if (str$1.length === strlen(str$1)) return str$1.substr(0, desiredLength);
1059
- while (strlen(str$1) > desiredLength) str$1 = str$1.slice(0, -1);
1060
- return str$1;
1061
- }
1062
- function truncateWidthWithAnsi(str$1, desiredLength) {
1063
- let code = codeRegex(true);
1064
- let split = str$1.split(codeRegex());
1065
- let splitIndex = 0;
1066
- let retLen = 0;
1067
- let ret = "";
1068
- let myArray;
1069
- let state = {};
1070
- while (retLen < desiredLength) {
1071
- myArray = code.exec(str$1);
1072
- let toAdd = split[splitIndex];
1073
- splitIndex++;
1074
- if (retLen + strlen(toAdd) > desiredLength) toAdd = truncateWidth(toAdd, desiredLength - retLen);
1075
- ret += toAdd;
1076
- retLen += strlen(toAdd);
1077
- if (retLen < desiredLength) {
1078
- if (!myArray) break;
1079
- ret += myArray[0];
1080
- updateState(state, myArray);
1081
- }
1082
- }
1083
- return unwindState(state, ret);
1084
- }
1085
- function truncate(str$1, desiredLength, truncateChar) {
1086
- truncateChar = truncateChar || "…";
1087
- if (strlen(str$1) <= desiredLength) return str$1;
1088
- desiredLength -= strlen(truncateChar);
1089
- let ret = truncateWidthWithAnsi(str$1, desiredLength);
1090
- ret += truncateChar;
1091
- const hrefTag = "\x1B]8;;\x07";
1092
- if (str$1.includes(hrefTag) && !ret.includes(hrefTag)) ret += hrefTag;
1093
- return ret;
1094
- }
1095
- function defaultOptions() {
1096
- return {
1097
- chars: {
1098
- top: "─",
1099
- "top-mid": "┬",
1100
- "top-left": "┌",
1101
- "top-right": "┐",
1102
- bottom: "─",
1103
- "bottom-mid": "┴",
1104
- "bottom-left": "└",
1105
- "bottom-right": "┘",
1106
- left: "│",
1107
- "left-mid": "├",
1108
- mid: "─",
1109
- "mid-mid": "┼",
1110
- right: "│",
1111
- "right-mid": "┤",
1112
- middle: "│"
1113
- },
1114
- truncate: "…",
1115
- colWidths: [],
1116
- rowHeights: [],
1117
- colAligns: [],
1118
- rowAligns: [],
1119
- style: {
1120
- "padding-left": 1,
1121
- "padding-right": 1,
1122
- head: ["red"],
1123
- border: ["grey"],
1124
- compact: false
1125
- },
1126
- head: []
1127
- };
1128
- }
1129
- function mergeOptions(options, defaults) {
1130
- options = options || {};
1131
- defaults = defaults || defaultOptions();
1132
- let ret = Object.assign({}, defaults, options);
1133
- ret.chars = Object.assign({}, defaults.chars, options.chars);
1134
- ret.style = Object.assign({}, defaults.style, options.style);
1135
- return ret;
1136
- }
1137
- function wordWrap(maxLength, input) {
1138
- let lines = [];
1139
- let split = input.split(/(\s+)/g);
1140
- let line = [];
1141
- let lineLength = 0;
1142
- let whitespace;
1143
- for (let i = 0; i < split.length; i += 2) {
1144
- let word = split[i];
1145
- let newLength = lineLength + strlen(word);
1146
- if (lineLength > 0 && whitespace) newLength += whitespace.length;
1147
- if (newLength > maxLength) {
1148
- if (lineLength !== 0) lines.push(line.join(""));
1149
- line = [word];
1150
- lineLength = strlen(word);
1151
- } else {
1152
- line.push(whitespace || "", word);
1153
- lineLength = newLength;
1154
- }
1155
- whitespace = split[i + 1];
1156
- }
1157
- if (lineLength) lines.push(line.join(""));
1158
- return lines;
1159
- }
1160
- function textWrap(maxLength, input) {
1161
- let lines = [];
1162
- let line = "";
1163
- function pushLine(str$1, ws) {
1164
- if (line.length && ws) line += ws;
1165
- line += str$1;
1166
- while (line.length > maxLength) {
1167
- lines.push(line.slice(0, maxLength));
1168
- line = line.slice(maxLength);
1169
- }
1170
- }
1171
- let split = input.split(/(\s+)/g);
1172
- for (let i = 0; i < split.length; i += 2) pushLine(split[i], i && split[i - 1]);
1173
- if (line.length) lines.push(line);
1174
- return lines;
1175
- }
1176
- function multiLineWordWrap(maxLength, input, wrapOnWordBoundary = true) {
1177
- let output = [];
1178
- input = input.split("\n");
1179
- const handler = wrapOnWordBoundary ? wordWrap : textWrap;
1180
- for (let i = 0; i < input.length; i++) output.push.apply(output, handler(maxLength, input[i]));
1181
- return output;
1182
- }
1183
- function colorizeLines(input) {
1184
- let state = {};
1185
- let output = [];
1186
- for (let i = 0; i < input.length; i++) {
1187
- let line = rewindState(state, input[i]);
1188
- state = readState(line);
1189
- let temp = Object.assign({}, state);
1190
- output.push(unwindState(temp, line));
1191
- }
1192
- return output;
1193
- }
1194
- function hyperlink(url, text) {
1195
- const OSC = "\x1B]";
1196
- const BEL = "\x07";
1197
- const SEP = ";";
1198
- return [
1199
- OSC,
1200
- "8",
1201
- SEP,
1202
- SEP,
1203
- url || text,
1204
- BEL,
1205
- text,
1206
- OSC,
1207
- "8",
1208
- SEP,
1209
- SEP,
1210
- BEL
1211
- ].join("");
1212
- }
1213
- module.exports = {
1214
- strlen,
1215
- repeat,
1216
- pad,
1217
- truncate,
1218
- mergeOptions,
1219
- wordWrap: multiLineWordWrap,
1220
- colorizeLines,
1221
- hyperlink
1222
- };
1223
- }));
1224
- var require_styles = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1225
- var styles$1 = {};
1226
- module["exports"] = styles$1;
1227
- var codes = {
1228
- reset: [0, 0],
1229
- bold: [1, 22],
1230
- dim: [2, 22],
1231
- italic: [3, 23],
1232
- underline: [4, 24],
1233
- inverse: [7, 27],
1234
- hidden: [8, 28],
1235
- strikethrough: [9, 29],
1236
- black: [30, 39],
1237
- red: [31, 39],
1238
- green: [32, 39],
1239
- yellow: [33, 39],
1240
- blue: [34, 39],
1241
- magenta: [35, 39],
1242
- cyan: [36, 39],
1243
- white: [37, 39],
1244
- gray: [90, 39],
1245
- grey: [90, 39],
1246
- brightRed: [91, 39],
1247
- brightGreen: [92, 39],
1248
- brightYellow: [93, 39],
1249
- brightBlue: [94, 39],
1250
- brightMagenta: [95, 39],
1251
- brightCyan: [96, 39],
1252
- brightWhite: [97, 39],
1253
- bgBlack: [40, 49],
1254
- bgRed: [41, 49],
1255
- bgGreen: [42, 49],
1256
- bgYellow: [43, 49],
1257
- bgBlue: [44, 49],
1258
- bgMagenta: [45, 49],
1259
- bgCyan: [46, 49],
1260
- bgWhite: [47, 49],
1261
- bgGray: [100, 49],
1262
- bgGrey: [100, 49],
1263
- bgBrightRed: [101, 49],
1264
- bgBrightGreen: [102, 49],
1265
- bgBrightYellow: [103, 49],
1266
- bgBrightBlue: [104, 49],
1267
- bgBrightMagenta: [105, 49],
1268
- bgBrightCyan: [106, 49],
1269
- bgBrightWhite: [107, 49],
1270
- blackBG: [40, 49],
1271
- redBG: [41, 49],
1272
- greenBG: [42, 49],
1273
- yellowBG: [43, 49],
1274
- blueBG: [44, 49],
1275
- magentaBG: [45, 49],
1276
- cyanBG: [46, 49],
1277
- whiteBG: [47, 49]
1278
- };
1279
- Object.keys(codes).forEach(function(key) {
1280
- var val = codes[key];
1281
- var style = styles$1[key] = [];
1282
- style.open = "\x1B[" + val[0] + "m";
1283
- style.close = "\x1B[" + val[1] + "m";
1284
- });
1285
- }));
1286
- var require_has_flag = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1287
- module.exports = function(flag, argv$1) {
1288
- argv$1 = argv$1 || process.argv;
1289
- var terminatorPos = argv$1.indexOf("--");
1290
- var prefix = /^-{1,2}/.test(flag) ? "" : "--";
1291
- var pos = argv$1.indexOf(prefix + flag);
1292
- return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
1293
- };
1294
- }));
1295
- var require_supports_colors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1296
- var os = __require("node:os");
1297
- var hasFlag = require_has_flag();
1298
- var env$1 = process.env;
1299
- var forceColor = void 0;
1300
- if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false")) forceColor = false;
1301
- else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) forceColor = true;
1302
- if ("FORCE_COLOR" in env$1) forceColor = env$1.FORCE_COLOR.length === 0 || parseInt(env$1.FORCE_COLOR, 10) !== 0;
1303
- function translateLevel(level$1) {
1304
- if (level$1 === 0) return false;
1305
- return {
1306
- level: level$1,
1307
- hasBasic: true,
1308
- has256: level$1 >= 2,
1309
- has16m: level$1 >= 3
1310
- };
1311
- }
1312
- function supportsColor(stream) {
1313
- if (forceColor === false) return 0;
1314
- if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) return 3;
1315
- if (hasFlag("color=256")) return 2;
1316
- if (stream && !stream.isTTY && forceColor !== true) return 0;
1317
- var min = forceColor ? 1 : 0;
1318
- if (process.platform === "win32") {
1319
- var osRelease = os.release().split(".");
1320
- if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
1321
- return 1;
1322
- }
1323
- if ("CI" in env$1) {
1324
- if ([
1325
- "TRAVIS",
1326
- "CIRCLECI",
1327
- "APPVEYOR",
1328
- "GITLAB_CI"
1329
- ].some(function(sign) {
1330
- return sign in env$1;
1331
- }) || env$1.CI_NAME === "codeship") return 1;
1332
- return min;
1333
- }
1334
- if ("TEAMCITY_VERSION" in env$1) return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env$1.TEAMCITY_VERSION) ? 1 : 0;
1335
- if ("TERM_PROGRAM" in env$1) {
1336
- var version$1 = parseInt((env$1.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
1337
- switch (env$1.TERM_PROGRAM) {
1338
- case "iTerm.app": return version$1 >= 3 ? 3 : 2;
1339
- case "Hyper": return 3;
1340
- case "Apple_Terminal": return 2;
1341
- }
1342
- }
1343
- if (/-256(color)?$/i.test(env$1.TERM)) return 2;
1344
- if (/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(env$1.TERM)) return 1;
1345
- if ("COLORTERM" in env$1) return 1;
1346
- if (env$1.TERM === "dumb") return min;
1347
- return min;
1348
- }
1349
- function getSupportLevel(stream) {
1350
- return translateLevel(supportsColor(stream));
1351
- }
1352
- module.exports = {
1353
- supportsColor: getSupportLevel,
1354
- stdout: getSupportLevel(process.stdout),
1355
- stderr: getSupportLevel(process.stderr)
1356
- };
1357
- }));
1358
- var require_trap = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1359
- module["exports"] = function runTheTrap(text, options) {
1360
- var result = "";
1361
- text = text || "Run the trap, drop the bass";
1362
- text = text.split("");
1363
- var trap = {
1364
- a: [
1365
- "@",
1366
- "Ą",
1367
- "Ⱥ",
1368
- "Ʌ",
1369
- "Δ",
1370
- "Λ",
1371
- "Д"
1372
- ],
1373
- b: [
1374
- "ß",
1375
- "Ɓ",
1376
- "Ƀ",
1377
- "ɮ",
1378
- "β",
1379
- "฿"
1380
- ],
1381
- c: [
1382
- "©",
1383
- "Ȼ",
1384
- "Ͼ"
1385
- ],
1386
- d: [
1387
- "Ð",
1388
- "Ɗ",
1389
- "Ԁ",
1390
- "ԁ",
1391
- "Ԃ",
1392
- "ԃ"
1393
- ],
1394
- e: [
1395
- "Ë",
1396
- "ĕ",
1397
- "Ǝ",
1398
- "ɘ",
1399
- "Σ",
1400
- "ξ",
1401
- "Ҽ",
1402
- "੬"
1403
- ],
1404
- f: ["Ӻ"],
1405
- g: ["ɢ"],
1406
- h: [
1407
- "Ħ",
1408
- "ƕ",
1409
- "Ң",
1410
- "Һ",
1411
- "Ӈ",
1412
- "Ԋ"
1413
- ],
1414
- i: ["༏"],
1415
- j: ["Ĵ"],
1416
- k: [
1417
- "ĸ",
1418
- "Ҡ",
1419
- "Ӄ",
1420
- "Ԟ"
1421
- ],
1422
- l: ["Ĺ"],
1423
- m: [
1424
- "ʍ",
1425
- "Ӎ",
1426
- "ӎ",
1427
- "Ԡ",
1428
- "ԡ",
1429
- "൩"
1430
- ],
1431
- n: [
1432
- "Ñ",
1433
- "ŋ",
1434
- "Ɲ",
1435
- "Ͷ",
1436
- "Π",
1437
- "Ҋ"
1438
- ],
1439
- o: [
1440
- "Ø",
1441
- "õ",
1442
- "ø",
1443
- "Ǿ",
1444
- "ʘ",
1445
- "Ѻ",
1446
- "ם",
1447
- "۝",
1448
- "๏"
1449
- ],
1450
- p: ["Ƿ", "Ҏ"],
1451
- q: ["্"],
1452
- r: [
1453
- "®",
1454
- "Ʀ",
1455
- "Ȑ",
1456
- "Ɍ",
1457
- "ʀ",
1458
- "Я"
1459
- ],
1460
- s: [
1461
- "§",
1462
- "Ϟ",
1463
- "ϟ",
1464
- "Ϩ"
1465
- ],
1466
- t: [
1467
- "Ł",
1468
- "Ŧ",
1469
- "ͳ"
1470
- ],
1471
- u: ["Ʊ", "Ս"],
1472
- v: ["ט"],
1473
- w: [
1474
- "Ш",
1475
- "Ѡ",
1476
- "Ѽ",
1477
- "൰"
1478
- ],
1479
- x: [
1480
- "Ҳ",
1481
- "Ӿ",
1482
- "Ӽ",
1483
- "ӽ"
1484
- ],
1485
- y: [
1486
- "¥",
1487
- "Ұ",
1488
- "Ӌ"
1489
- ],
1490
- z: ["Ƶ", "ɀ"]
1491
- };
1492
- text.forEach(function(c) {
1493
- c = c.toLowerCase();
1494
- var chars = trap[c] || [" "];
1495
- var rand = Math.floor(Math.random() * chars.length);
1496
- if (typeof trap[c] !== "undefined") result += trap[c][rand];
1497
- else result += c;
1498
- });
1499
- return result;
1500
- };
1501
- }));
1502
- var require_zalgo = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1503
- module["exports"] = function zalgo(text, options) {
1504
- text = text || " he is here ";
1505
- var soul = {
1506
- "up": [
1507
- "̍",
1508
- "̎",
1509
- "̄",
1510
- "̅",
1511
- "̿",
1512
- "̑",
1513
- "̆",
1514
- "̐",
1515
- "͒",
1516
- "͗",
1517
- "͑",
1518
- "̇",
1519
- "̈",
1520
- "̊",
1521
- "͂",
1522
- "̓",
1523
- "̈",
1524
- "͊",
1525
- "͋",
1526
- "͌",
1527
- "̃",
1528
- "̂",
1529
- "̌",
1530
- "͐",
1531
- "̀",
1532
- "́",
1533
- "̋",
1534
- "̏",
1535
- "̒",
1536
- "̓",
1537
- "̔",
1538
- "̽",
1539
- "̉",
1540
- "ͣ",
1541
- "ͤ",
1542
- "ͥ",
1543
- "ͦ",
1544
- "ͧ",
1545
- "ͨ",
1546
- "ͩ",
1547
- "ͪ",
1548
- "ͫ",
1549
- "ͬ",
1550
- "ͭ",
1551
- "ͮ",
1552
- "ͯ",
1553
- "̾",
1554
- "͛",
1555
- "͆",
1556
- "̚"
1557
- ],
1558
- "down": [
1559
- "̖",
1560
- "̗",
1561
- "̘",
1562
- "̙",
1563
- "̜",
1564
- "̝",
1565
- "̞",
1566
- "̟",
1567
- "̠",
1568
- "̤",
1569
- "̥",
1570
- "̦",
1571
- "̩",
1572
- "̪",
1573
- "̫",
1574
- "̬",
1575
- "̭",
1576
- "̮",
1577
- "̯",
1578
- "̰",
1579
- "̱",
1580
- "̲",
1581
- "̳",
1582
- "̹",
1583
- "̺",
1584
- "̻",
1585
- "̼",
1586
- "ͅ",
1587
- "͇",
1588
- "͈",
1589
- "͉",
1590
- "͍",
1591
- "͎",
1592
- "͓",
1593
- "͔",
1594
- "͕",
1595
- "͖",
1596
- "͙",
1597
- "͚",
1598
- "̣"
1599
- ],
1600
- "mid": [
1601
- "̕",
1602
- "̛",
1603
- "̀",
1604
- "́",
1605
- "͘",
1606
- "̡",
1607
- "̢",
1608
- "̧",
1609
- "̨",
1610
- "̴",
1611
- "̵",
1612
- "̶",
1613
- "͜",
1614
- "͝",
1615
- "͞",
1616
- "͟",
1617
- "͠",
1618
- "͢",
1619
- "̸",
1620
- "̷",
1621
- "͡",
1622
- " ҉"
1623
- ]
1624
- };
1625
- var all = [].concat(soul.up, soul.down, soul.mid);
1626
- function randomNumber(range) {
1627
- return Math.floor(Math.random() * range);
1628
- }
1629
- function isChar(character$1) {
1630
- var bool$1 = false;
1631
- all.filter(function(i) {
1632
- bool$1 = i === character$1;
1633
- });
1634
- return bool$1;
1635
- }
1636
- function heComes(text$1, options$1) {
1637
- var result = "";
1638
- var counts;
1639
- var l;
1640
- options$1 = options$1 || {};
1641
- options$1["up"] = typeof options$1["up"] !== "undefined" ? options$1["up"] : true;
1642
- options$1["mid"] = typeof options$1["mid"] !== "undefined" ? options$1["mid"] : true;
1643
- options$1["down"] = typeof options$1["down"] !== "undefined" ? options$1["down"] : true;
1644
- options$1["size"] = typeof options$1["size"] !== "undefined" ? options$1["size"] : "maxi";
1645
- text$1 = text$1.split("");
1646
- for (l in text$1) {
1647
- if (isChar(l)) continue;
1648
- result = result + text$1[l];
1649
- counts = {
1650
- "up": 0,
1651
- "down": 0,
1652
- "mid": 0
1653
- };
1654
- switch (options$1.size) {
1655
- case "mini":
1656
- counts.up = randomNumber(8);
1657
- counts.mid = randomNumber(2);
1658
- counts.down = randomNumber(8);
1659
- break;
1660
- case "maxi":
1661
- counts.up = randomNumber(16) + 3;
1662
- counts.mid = randomNumber(4) + 1;
1663
- counts.down = randomNumber(64) + 3;
1664
- break;
1665
- default:
1666
- counts.up = randomNumber(8) + 1;
1667
- counts.mid = randomNumber(6) / 2;
1668
- counts.down = randomNumber(8) + 1;
1669
- break;
1670
- }
1671
- var arr = [
1672
- "up",
1673
- "mid",
1674
- "down"
1675
- ];
1676
- for (var d in arr) {
1677
- var index = arr[d];
1678
- for (var i = 0; i <= counts[index]; i++) if (options$1[index]) result = result + soul[index][randomNumber(soul[index].length)];
1679
- }
1680
- }
1681
- return result;
1682
- }
1683
- return heComes(text, options);
1684
- };
1685
- }));
1686
- var require_america = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1687
- module["exports"] = function(colors$2) {
1688
- return function(letter, i, exploded) {
1689
- if (letter === " ") return letter;
1690
- switch (i % 3) {
1691
- case 0: return colors$2.red(letter);
1692
- case 1: return colors$2.white(letter);
1693
- case 2: return colors$2.blue(letter);
1694
- }
1695
- };
1696
- };
1697
- }));
1698
- var require_zebra = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1699
- module["exports"] = function(colors$2) {
1700
- return function(letter, i, exploded) {
1701
- return i % 2 === 0 ? letter : colors$2.inverse(letter);
1702
- };
1703
- };
1704
- }));
1705
- var require_rainbow = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1706
- module["exports"] = function(colors$2) {
1707
- var rainbowColors = [
1708
- "red",
1709
- "yellow",
1710
- "green",
1711
- "blue",
1712
- "magenta"
1713
- ];
1714
- return function(letter, i, exploded) {
1715
- if (letter === " ") return letter;
1716
- else return colors$2[rainbowColors[i++ % rainbowColors.length]](letter);
1717
- };
1718
- };
1719
- }));
1720
- var require_random = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1721
- module["exports"] = function(colors$2) {
1722
- var available = [
1723
- "underline",
1724
- "inverse",
1725
- "grey",
1726
- "yellow",
1727
- "red",
1728
- "green",
1729
- "blue",
1730
- "white",
1731
- "cyan",
1732
- "magenta",
1733
- "brightYellow",
1734
- "brightRed",
1735
- "brightGreen",
1736
- "brightBlue",
1737
- "brightWhite",
1738
- "brightCyan",
1739
- "brightMagenta"
1740
- ];
1741
- return function(letter, i, exploded) {
1742
- return letter === " " ? letter : colors$2[available[Math.round(Math.random() * (available.length - 2))]](letter);
1743
- };
1744
- };
1745
- }));
1746
- var require_colors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1747
- var colors$1 = {};
1748
- module["exports"] = colors$1;
1749
- colors$1.themes = {};
1750
- var util = __require("node:util");
1751
- var ansiStyles = colors$1.styles = require_styles();
1752
- var defineProps = Object.defineProperties;
1753
- var newLineRegex = /* @__PURE__ */ new RegExp(/[\r\n]+/g);
1754
- colors$1.supportsColor = require_supports_colors().supportsColor;
1755
- if (typeof colors$1.enabled === "undefined") colors$1.enabled = colors$1.supportsColor() !== false;
1756
- colors$1.enable = function() {
1757
- colors$1.enabled = true;
1758
- };
1759
- colors$1.disable = function() {
1760
- colors$1.enabled = false;
1761
- };
1762
- colors$1.stripColors = colors$1.strip = function(str$1) {
1763
- return ("" + str$1).replace(/\x1B\[\d+m/g, "");
1764
- };
1765
- colors$1.stylize = function stylize(str$1, style) {
1766
- if (!colors$1.enabled) return str$1 + "";
1767
- var styleMap = ansiStyles[style];
1768
- if (!styleMap && style in colors$1) return colors$1[style](str$1);
1769
- return styleMap.open + str$1 + styleMap.close;
1770
- };
1771
- var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
1772
- var escapeStringRegexp = function(str$1) {
1773
- if (typeof str$1 !== "string") throw new TypeError("Expected a string");
1774
- return str$1.replace(matchOperatorsRe, "\\$&");
1775
- };
1776
- function build(_styles) {
1777
- var builder = function builder$1() {
1778
- return applyStyle.apply(builder$1, arguments);
1779
- };
1780
- builder._styles = _styles;
1781
- builder.__proto__ = proto;
1782
- return builder;
1783
- }
1784
- var styles = (function() {
1785
- var ret = {};
1786
- ansiStyles.grey = ansiStyles.gray;
1787
- Object.keys(ansiStyles).forEach(function(key) {
1788
- ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), "g");
1789
- ret[key] = { get: function() {
1790
- return build(this._styles.concat(key));
1791
- } };
1792
- });
1793
- return ret;
1794
- })();
1795
- var proto = defineProps(function colors$2() {}, styles);
1796
- function applyStyle() {
1797
- var str$1 = Array.prototype.slice.call(arguments).map(function(arg) {
1798
- if (arg != null && arg.constructor === String) return arg;
1799
- else return util.inspect(arg);
1800
- }).join(" ");
1801
- if (!colors$1.enabled || !str$1) return str$1;
1802
- var newLinesPresent = str$1.indexOf("\n") != -1;
1803
- var nestedStyles = this._styles;
1804
- var i = nestedStyles.length;
1805
- while (i--) {
1806
- var code = ansiStyles[nestedStyles[i]];
1807
- str$1 = code.open + str$1.replace(code.closeRe, code.open) + code.close;
1808
- if (newLinesPresent) str$1 = str$1.replace(newLineRegex, function(match) {
1809
- return code.close + match + code.open;
1810
- });
1811
- }
1812
- return str$1;
1813
- }
1814
- colors$1.setTheme = function(theme) {
1815
- if (typeof theme === "string") {
1816
- console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");
1817
- return;
1818
- }
1819
- for (var style in theme) (function(style$1) {
1820
- colors$1[style$1] = function(str$1) {
1821
- if (typeof theme[style$1] === "object") {
1822
- var out = str$1;
1823
- for (var i in theme[style$1]) out = colors$1[theme[style$1][i]](out);
1824
- return out;
1825
- }
1826
- return colors$1[theme[style$1]](str$1);
1827
- };
1828
- })(style);
1829
- };
1830
- function init() {
1831
- var ret = {};
1832
- Object.keys(styles).forEach(function(name$1) {
1833
- ret[name$1] = { get: function() {
1834
- return build([name$1]);
1835
- } };
1836
- });
1837
- return ret;
1838
- }
1839
- var sequencer = function sequencer$1(map$3, str$1) {
1840
- var exploded = str$1.split("");
1841
- exploded = exploded.map(map$3);
1842
- return exploded.join("");
1843
- };
1844
- colors$1.trap = require_trap();
1845
- colors$1.zalgo = require_zalgo();
1846
- colors$1.maps = {};
1847
- colors$1.maps.america = require_america()(colors$1);
1848
- colors$1.maps.zebra = require_zebra()(colors$1);
1849
- colors$1.maps.rainbow = require_rainbow()(colors$1);
1850
- colors$1.maps.random = require_random()(colors$1);
1851
- for (var map$1 in colors$1.maps) (function(map$3) {
1852
- colors$1[map$3] = function(str$1) {
1853
- return sequencer(colors$1.maps[map$3], str$1);
1854
- };
1855
- })(map$1);
1856
- defineProps(colors$1, init());
1857
- }));
1858
- var require_safe = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1859
- module["exports"] = require_colors();
1860
- }));
1861
- var require_cell = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1862
- const { info, debug: debug$2 } = require_debug();
1863
- const utils$1 = require_utils();
1864
- var Cell$1 = class Cell$1 {
1865
- constructor(options) {
1866
- this.setOptions(options);
1867
- this.x = null;
1868
- this.y = null;
1869
- }
1870
- setOptions(options) {
1871
- if ([
1872
- "boolean",
1873
- "number",
1874
- "bigint",
1875
- "string"
1876
- ].indexOf(typeof options) !== -1) options = { content: "" + options };
1877
- options = options || {};
1878
- this.options = options;
1879
- let content = options.content;
1880
- if ([
1881
- "boolean",
1882
- "number",
1883
- "bigint",
1884
- "string"
1885
- ].indexOf(typeof content) !== -1) this.content = String(content);
1886
- else if (!content) this.content = this.options.href || "";
1887
- else throw new Error("Content needs to be a primitive, got: " + typeof content);
1888
- this.colSpan = options.colSpan || 1;
1889
- this.rowSpan = options.rowSpan || 1;
1890
- if (this.options.href) Object.defineProperty(this, "href", { get() {
1891
- return this.options.href;
1892
- } });
1893
- }
1894
- mergeTableOptions(tableOptions, cells) {
1895
- this.cells = cells;
1896
- let optionsChars = this.options.chars || {};
1897
- let tableChars = tableOptions.chars;
1898
- let chars = this.chars = {};
1899
- CHAR_NAMES.forEach(function(name$1) {
1900
- setOption(optionsChars, tableChars, name$1, chars);
1901
- });
1902
- this.truncate = this.options.truncate || tableOptions.truncate;
1903
- let style = this.options.style = this.options.style || {};
1904
- let tableStyle = tableOptions.style;
1905
- setOption(style, tableStyle, "padding-left", this);
1906
- setOption(style, tableStyle, "padding-right", this);
1907
- this.head = style.head || tableStyle.head;
1908
- this.border = style.border || tableStyle.border;
1909
- this.fixedWidth = tableOptions.colWidths[this.x];
1910
- this.lines = this.computeLines(tableOptions);
1911
- this.desiredWidth = utils$1.strlen(this.content) + this.paddingLeft + this.paddingRight;
1912
- this.desiredHeight = this.lines.length;
1913
- }
1914
- computeLines(tableOptions) {
1915
- const tableWordWrap = tableOptions.wordWrap || tableOptions.textWrap;
1916
- const { wordWrap: wordWrap$1 = tableWordWrap } = this.options;
1917
- if (this.fixedWidth && wordWrap$1) {
1918
- this.fixedWidth -= this.paddingLeft + this.paddingRight;
1919
- if (this.colSpan) {
1920
- let i = 1;
1921
- while (i < this.colSpan) {
1922
- this.fixedWidth += tableOptions.colWidths[this.x + i];
1923
- i++;
1924
- }
1925
- }
1926
- const { wrapOnWordBoundary: tableWrapOnWordBoundary = true } = tableOptions;
1927
- const { wrapOnWordBoundary = tableWrapOnWordBoundary } = this.options;
1928
- return this.wrapLines(utils$1.wordWrap(this.fixedWidth, this.content, wrapOnWordBoundary));
1929
- }
1930
- return this.wrapLines(this.content.split("\n"));
1931
- }
1932
- wrapLines(computedLines) {
1933
- const lines = utils$1.colorizeLines(computedLines);
1934
- if (this.href) return lines.map((line) => utils$1.hyperlink(this.href, line));
1935
- return lines;
1936
- }
1937
- init(tableOptions) {
1938
- let x = this.x;
1939
- let y = this.y;
1940
- this.widths = tableOptions.colWidths.slice(x, x + this.colSpan);
1941
- this.heights = tableOptions.rowHeights.slice(y, y + this.rowSpan);
1942
- this.width = this.widths.reduce(sumPlusOne, -1);
1943
- this.height = this.heights.reduce(sumPlusOne, -1);
1944
- this.hAlign = this.options.hAlign || tableOptions.colAligns[x];
1945
- this.vAlign = this.options.vAlign || tableOptions.rowAligns[y];
1946
- this.drawRight = x + this.colSpan == tableOptions.colWidths.length;
1947
- }
1948
- draw(lineNum, spanningCell) {
1949
- if (lineNum == "top") return this.drawTop(this.drawRight);
1950
- if (lineNum == "bottom") return this.drawBottom(this.drawRight);
1951
- let content = utils$1.truncate(this.content, 10, this.truncate);
1952
- if (!lineNum) info(`${this.y}-${this.x}: ${this.rowSpan - lineNum}x${this.colSpan} Cell ${content}`);
1953
- let padLen = Math.max(this.height - this.lines.length, 0);
1954
- let padTop;
1955
- switch (this.vAlign) {
1956
- case "center":
1957
- padTop = Math.ceil(padLen / 2);
1958
- break;
1959
- case "bottom":
1960
- padTop = padLen;
1961
- break;
1962
- default: padTop = 0;
1963
- }
1964
- if (lineNum < padTop || lineNum >= padTop + this.lines.length) return this.drawEmpty(this.drawRight, spanningCell);
1965
- let forceTruncation = this.lines.length > this.height && lineNum + 1 >= this.height;
1966
- return this.drawLine(lineNum - padTop, this.drawRight, forceTruncation, spanningCell);
1967
- }
1968
- drawTop(drawRight) {
1969
- let content = [];
1970
- if (this.cells) this.widths.forEach(function(width, index) {
1971
- content.push(this._topLeftChar(index));
1972
- content.push(utils$1.repeat(this.chars[this.y == 0 ? "top" : "mid"], width));
1973
- }, this);
1974
- else {
1975
- content.push(this._topLeftChar(0));
1976
- content.push(utils$1.repeat(this.chars[this.y == 0 ? "top" : "mid"], this.width));
1977
- }
1978
- if (drawRight) content.push(this.chars[this.y == 0 ? "topRight" : "rightMid"]);
1979
- return this.wrapWithStyleColors("border", content.join(""));
1980
- }
1981
- _topLeftChar(offset) {
1982
- let x = this.x + offset;
1983
- let leftChar;
1984
- if (this.y == 0) leftChar = x == 0 ? "topLeft" : offset == 0 ? "topMid" : "top";
1985
- else if (x == 0) leftChar = "leftMid";
1986
- else {
1987
- leftChar = offset == 0 ? "midMid" : "bottomMid";
1988
- if (this.cells) {
1989
- if (this.cells[this.y - 1][x] instanceof Cell$1.ColSpanCell) leftChar = offset == 0 ? "topMid" : "mid";
1990
- if (offset == 0) {
1991
- let i = 1;
1992
- while (this.cells[this.y][x - i] instanceof Cell$1.ColSpanCell) i++;
1993
- if (this.cells[this.y][x - i] instanceof Cell$1.RowSpanCell) leftChar = "leftMid";
1994
- }
1995
- }
1996
- }
1997
- return this.chars[leftChar];
1998
- }
1999
- wrapWithStyleColors(styleProperty, content) {
2000
- if (this[styleProperty] && this[styleProperty].length) try {
2001
- let colors$2 = require_safe();
2002
- for (let i = this[styleProperty].length - 1; i >= 0; i--) colors$2 = colors$2[this[styleProperty][i]];
2003
- return colors$2(content);
2004
- } catch (e) {
2005
- return content;
2006
- }
2007
- else return content;
2008
- }
2009
- drawLine(lineNum, drawRight, forceTruncationSymbol, spanningCell) {
2010
- let left = this.chars[this.x == 0 ? "left" : "middle"];
2011
- if (this.x && spanningCell && this.cells) {
2012
- let cellLeft = this.cells[this.y + spanningCell][this.x - 1];
2013
- while (cellLeft instanceof ColSpanCell$1) cellLeft = this.cells[cellLeft.y][cellLeft.x - 1];
2014
- if (!(cellLeft instanceof RowSpanCell$1)) left = this.chars["rightMid"];
2015
- }
2016
- let leftPadding = utils$1.repeat(" ", this.paddingLeft);
2017
- let right = drawRight ? this.chars["right"] : "";
2018
- let rightPadding = utils$1.repeat(" ", this.paddingRight);
2019
- let line = this.lines[lineNum];
2020
- let len = this.width - (this.paddingLeft + this.paddingRight);
2021
- if (forceTruncationSymbol) line += this.truncate || "…";
2022
- let content = utils$1.truncate(line, len, this.truncate);
2023
- content = utils$1.pad(content, len, " ", this.hAlign);
2024
- content = leftPadding + content + rightPadding;
2025
- return this.stylizeLine(left, content, right);
2026
- }
2027
- stylizeLine(left, content, right) {
2028
- left = this.wrapWithStyleColors("border", left);
2029
- right = this.wrapWithStyleColors("border", right);
2030
- if (this.y === 0) content = this.wrapWithStyleColors("head", content);
2031
- return left + content + right;
2032
- }
2033
- drawBottom(drawRight) {
2034
- let left = this.chars[this.x == 0 ? "bottomLeft" : "bottomMid"];
2035
- let content = utils$1.repeat(this.chars.bottom, this.width);
2036
- let right = drawRight ? this.chars["bottomRight"] : "";
2037
- return this.wrapWithStyleColors("border", left + content + right);
2038
- }
2039
- drawEmpty(drawRight, spanningCell) {
2040
- let left = this.chars[this.x == 0 ? "left" : "middle"];
2041
- if (this.x && spanningCell && this.cells) {
2042
- let cellLeft = this.cells[this.y + spanningCell][this.x - 1];
2043
- while (cellLeft instanceof ColSpanCell$1) cellLeft = this.cells[cellLeft.y][cellLeft.x - 1];
2044
- if (!(cellLeft instanceof RowSpanCell$1)) left = this.chars["rightMid"];
2045
- }
2046
- let right = drawRight ? this.chars["right"] : "";
2047
- let content = utils$1.repeat(" ", this.width);
2048
- return this.stylizeLine(left, content, right);
2049
- }
2050
- };
2051
- var ColSpanCell$1 = class {
2052
- constructor() {}
2053
- draw(lineNum) {
2054
- if (typeof lineNum === "number") debug$2(`${this.y}-${this.x}: 1x1 ColSpanCell`);
2055
- return "";
2056
- }
2057
- init() {}
2058
- mergeTableOptions() {}
2059
- };
2060
- var RowSpanCell$1 = class {
2061
- constructor(originalCell) {
2062
- this.originalCell = originalCell;
2063
- }
2064
- init(tableOptions) {
2065
- let y = this.y;
2066
- let originalY = this.originalCell.y;
2067
- this.cellOffset = y - originalY;
2068
- this.offset = findDimension(tableOptions.rowHeights, originalY, this.cellOffset);
2069
- }
2070
- draw(lineNum) {
2071
- if (lineNum == "top") return this.originalCell.draw(this.offset, this.cellOffset);
2072
- if (lineNum == "bottom") return this.originalCell.draw("bottom");
2073
- debug$2(`${this.y}-${this.x}: 1x${this.colSpan} RowSpanCell for ${this.originalCell.content}`);
2074
- return this.originalCell.draw(this.offset + 1 + lineNum);
2075
- }
2076
- mergeTableOptions() {}
2077
- };
2078
- function firstDefined(...args) {
2079
- return args.filter((v) => v !== void 0 && v !== null).shift();
2080
- }
2081
- function setOption(objA, objB, nameB, targetObj) {
2082
- let nameA = nameB.split("-");
2083
- if (nameA.length > 1) {
2084
- nameA[1] = nameA[1].charAt(0).toUpperCase() + nameA[1].substr(1);
2085
- nameA = nameA.join("");
2086
- targetObj[nameA] = firstDefined(objA[nameA], objA[nameB], objB[nameA], objB[nameB]);
2087
- } else targetObj[nameB] = firstDefined(objA[nameB], objB[nameB]);
2088
- }
2089
- function findDimension(dimensionTable, startingIndex, span) {
2090
- let ret = dimensionTable[startingIndex];
2091
- for (let i = 1; i < span; i++) ret += 1 + dimensionTable[startingIndex + i];
2092
- return ret;
2093
- }
2094
- function sumPlusOne(a$1, b$1) {
2095
- return a$1 + b$1 + 1;
2096
- }
2097
- let CHAR_NAMES = [
2098
- "top",
2099
- "top-mid",
2100
- "top-left",
2101
- "top-right",
2102
- "bottom",
2103
- "bottom-mid",
2104
- "bottom-left",
2105
- "bottom-right",
2106
- "left",
2107
- "left-mid",
2108
- "mid",
2109
- "mid-mid",
2110
- "right",
2111
- "right-mid",
2112
- "middle"
2113
- ];
2114
- module.exports = Cell$1;
2115
- module.exports.ColSpanCell = ColSpanCell$1;
2116
- module.exports.RowSpanCell = RowSpanCell$1;
2117
- }));
2118
- var require_layout_manager = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2119
- const { warn, debug: debug$1 } = require_debug();
2120
- const Cell = require_cell();
2121
- const { ColSpanCell, RowSpanCell } = Cell;
2122
- (function() {
2123
- function next(alloc, col) {
2124
- if (alloc[col] > 0) return next(alloc, col + 1);
2125
- return col;
2126
- }
2127
- function layoutTable(table) {
2128
- let alloc = {};
2129
- table.forEach(function(row, rowIndex) {
2130
- let col = 0;
2131
- row.forEach(function(cell) {
2132
- cell.y = rowIndex;
2133
- cell.x = rowIndex ? next(alloc, col) : col;
2134
- const rowSpan = cell.rowSpan || 1;
2135
- const colSpan = cell.colSpan || 1;
2136
- if (rowSpan > 1) for (let cs = 0; cs < colSpan; cs++) alloc[cell.x + cs] = rowSpan;
2137
- col = cell.x + colSpan;
2138
- });
2139
- Object.keys(alloc).forEach((idx) => {
2140
- alloc[idx]--;
2141
- if (alloc[idx] < 1) delete alloc[idx];
2142
- });
2143
- });
2144
- }
2145
- function maxWidth(table) {
2146
- let mw = 0;
2147
- table.forEach(function(row) {
2148
- row.forEach(function(cell) {
2149
- mw = Math.max(mw, cell.x + (cell.colSpan || 1));
2150
- });
2151
- });
2152
- return mw;
2153
- }
2154
- function maxHeight(table) {
2155
- return table.length;
2156
- }
2157
- function cellsConflict(cell1, cell2) {
2158
- let yMin1 = cell1.y;
2159
- let yMax1 = cell1.y - 1 + (cell1.rowSpan || 1);
2160
- let yMin2 = cell2.y;
2161
- let yConflict = !(yMin1 > cell2.y - 1 + (cell2.rowSpan || 1) || yMin2 > yMax1);
2162
- let xMin1 = cell1.x;
2163
- let xMax1 = cell1.x - 1 + (cell1.colSpan || 1);
2164
- let xMin2 = cell2.x;
2165
- let xConflict = !(xMin1 > cell2.x - 1 + (cell2.colSpan || 1) || xMin2 > xMax1);
2166
- return yConflict && xConflict;
2167
- }
2168
- function conflictExists(rows, x, y) {
2169
- let i_max = Math.min(rows.length - 1, y);
2170
- let cell = {
2171
- x,
2172
- y
2173
- };
2174
- for (let i = 0; i <= i_max; i++) {
2175
- let row = rows[i];
2176
- for (let j = 0; j < row.length; j++) if (cellsConflict(cell, row[j])) return true;
2177
- }
2178
- return false;
2179
- }
2180
- function allBlank(rows, y, xMin, xMax) {
2181
- for (let x = xMin; x < xMax; x++) if (conflictExists(rows, x, y)) return false;
2182
- return true;
2183
- }
2184
- function addRowSpanCells(table) {
2185
- table.forEach(function(row, rowIndex) {
2186
- row.forEach(function(cell) {
2187
- for (let i = 1; i < cell.rowSpan; i++) {
2188
- let rowSpanCell = new RowSpanCell(cell);
2189
- rowSpanCell.x = cell.x;
2190
- rowSpanCell.y = cell.y + i;
2191
- rowSpanCell.colSpan = cell.colSpan;
2192
- insertCell(rowSpanCell, table[rowIndex + i]);
2193
- }
2194
- });
2195
- });
2196
- }
2197
- function addColSpanCells(cellRows) {
2198
- for (let rowIndex = cellRows.length - 1; rowIndex >= 0; rowIndex--) {
2199
- let cellColumns = cellRows[rowIndex];
2200
- for (let columnIndex = 0; columnIndex < cellColumns.length; columnIndex++) {
2201
- let cell = cellColumns[columnIndex];
2202
- for (let k = 1; k < cell.colSpan; k++) {
2203
- let colSpanCell = new ColSpanCell();
2204
- colSpanCell.x = cell.x + k;
2205
- colSpanCell.y = cell.y;
2206
- cellColumns.splice(columnIndex + 1, 0, colSpanCell);
2207
- }
2208
- }
2209
- }
2210
- }
2211
- function insertCell(cell, row) {
2212
- let x = 0;
2213
- while (x < row.length && row[x].x < cell.x) x++;
2214
- row.splice(x, 0, cell);
2215
- }
2216
- function fillInTable(table) {
2217
- let h_max = maxHeight(table);
2218
- let w_max = maxWidth(table);
2219
- debug$1(`Max rows: ${h_max}; Max cols: ${w_max}`);
2220
- for (let y = 0; y < h_max; y++) for (let x = 0; x < w_max; x++) if (!conflictExists(table, x, y)) {
2221
- let opts = {
2222
- x,
2223
- y,
2224
- colSpan: 1,
2225
- rowSpan: 1
2226
- };
2227
- x++;
2228
- while (x < w_max && !conflictExists(table, x, y)) {
2229
- opts.colSpan++;
2230
- x++;
2231
- }
2232
- let y2 = y + 1;
2233
- while (y2 < h_max && allBlank(table, y2, opts.x, opts.x + opts.colSpan)) {
2234
- opts.rowSpan++;
2235
- y2++;
2236
- }
2237
- let cell = new Cell(opts);
2238
- cell.x = opts.x;
2239
- cell.y = opts.y;
2240
- warn(`Missing cell at ${cell.y}-${cell.x}.`);
2241
- insertCell(cell, table[y]);
2242
- }
2243
- }
2244
- function generateCells(rows) {
2245
- return rows.map(function(row) {
2246
- if (!Array.isArray(row)) {
2247
- let key = Object.keys(row)[0];
2248
- row = row[key];
2249
- if (Array.isArray(row)) {
2250
- row = row.slice();
2251
- row.unshift(key);
2252
- } else row = [key, row];
2253
- }
2254
- return row.map(function(cell) {
2255
- return new Cell(cell);
2256
- });
2257
- });
2258
- }
2259
- function makeTableLayout(rows) {
2260
- let cellRows = generateCells(rows);
2261
- layoutTable(cellRows);
2262
- fillInTable(cellRows);
2263
- addRowSpanCells(cellRows);
2264
- addColSpanCells(cellRows);
2265
- return cellRows;
2266
- }
2267
- module.exports = {
2268
- makeTableLayout,
2269
- layoutTable,
2270
- addRowSpanCells,
2271
- maxWidth,
2272
- fillInTable,
2273
- computeWidths: makeComputeWidths("colSpan", "desiredWidth", "x", 1),
2274
- computeHeights: makeComputeWidths("rowSpan", "desiredHeight", "y", 1)
2275
- };
2276
- })();
2277
- function makeComputeWidths(colSpan, desiredWidth, x, forcedMin) {
2278
- return function(vals, table) {
2279
- let result = [];
2280
- let spanners = [];
2281
- let auto = {};
2282
- table.forEach(function(row) {
2283
- row.forEach(function(cell) {
2284
- if ((cell[colSpan] || 1) > 1) spanners.push(cell);
2285
- else result[cell[x]] = Math.max(result[cell[x]] || 0, cell[desiredWidth] || 0, forcedMin);
2286
- });
2287
- });
2288
- vals.forEach(function(val, index) {
2289
- if (typeof val === "number") result[index] = val;
2290
- });
2291
- for (let k = spanners.length - 1; k >= 0; k--) {
2292
- let cell = spanners[k];
2293
- let span = cell[colSpan];
2294
- let col = cell[x];
2295
- let existingWidth = result[col];
2296
- let editableCols = typeof vals[col] === "number" ? 0 : 1;
2297
- if (typeof existingWidth === "number") for (let i = 1; i < span; i++) {
2298
- existingWidth += 1 + result[col + i];
2299
- if (typeof vals[col + i] !== "number") editableCols++;
2300
- }
2301
- else {
2302
- existingWidth = desiredWidth === "desiredWidth" ? cell.desiredWidth - 1 : 1;
2303
- if (!auto[col] || auto[col] < existingWidth) auto[col] = existingWidth;
2304
- }
2305
- if (cell[desiredWidth] > existingWidth) {
2306
- let i = 0;
2307
- while (editableCols > 0 && cell[desiredWidth] > existingWidth) {
2308
- if (typeof vals[col + i] !== "number") {
2309
- let dif = Math.round((cell[desiredWidth] - existingWidth) / editableCols);
2310
- existingWidth += dif;
2311
- result[col + i] += dif;
2312
- editableCols--;
2313
- }
2314
- i++;
2315
- }
2316
- }
2317
- }
2318
- Object.assign(vals, result, auto);
2319
- for (let j = 0; j < vals.length; j++) vals[j] = Math.max(forcedMin, vals[j] || 0);
2320
- };
2321
- }
2322
- }));
2323
- var require_table = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2324
- const debug = require_debug();
2325
- const utils = require_utils();
2326
- const tableLayout = require_layout_manager();
2327
- var Table$1 = class extends Array {
2328
- constructor(opts) {
2329
- super();
2330
- const options = utils.mergeOptions(opts);
2331
- Object.defineProperty(this, "options", {
2332
- value: options,
2333
- enumerable: options.debug
2334
- });
2335
- if (options.debug) {
2336
- switch (typeof options.debug) {
2337
- case "boolean":
2338
- debug.setDebugLevel(debug.WARN);
2339
- break;
2340
- case "number":
2341
- debug.setDebugLevel(options.debug);
2342
- break;
2343
- case "string":
2344
- debug.setDebugLevel(parseInt(options.debug, 10));
2345
- break;
2346
- default:
2347
- debug.setDebugLevel(debug.WARN);
2348
- debug.warn(`Debug option is expected to be boolean, number, or string. Received a ${typeof options.debug}`);
2349
- }
2350
- Object.defineProperty(this, "messages", { get() {
2351
- return debug.debugMessages();
2352
- } });
2353
- }
2354
- }
2355
- toString() {
2356
- let array = this;
2357
- let headersPresent = this.options.head && this.options.head.length;
2358
- if (headersPresent) {
2359
- array = [this.options.head];
2360
- if (this.length) array.push.apply(array, this);
2361
- } else this.options.style.head = [];
2362
- let cells = tableLayout.makeTableLayout(array);
2363
- cells.forEach(function(row) {
2364
- row.forEach(function(cell) {
2365
- cell.mergeTableOptions(this.options, cells);
2366
- }, this);
2367
- }, this);
2368
- tableLayout.computeWidths(this.options.colWidths, cells);
2369
- tableLayout.computeHeights(this.options.rowHeights, cells);
2370
- cells.forEach(function(row) {
2371
- row.forEach(function(cell) {
2372
- cell.init(this.options);
2373
- }, this);
2374
- }, this);
2375
- let result = [];
2376
- for (let rowIndex = 0; rowIndex < cells.length; rowIndex++) {
2377
- let row = cells[rowIndex];
2378
- let heightOfRow = this.options.rowHeights[rowIndex];
2379
- if (rowIndex === 0 || !this.options.style.compact || rowIndex == 1 && headersPresent) doDraw(row, "top", result);
2380
- for (let lineNum = 0; lineNum < heightOfRow; lineNum++) doDraw(row, lineNum, result);
2381
- if (rowIndex + 1 == cells.length) doDraw(row, "bottom", result);
2382
- }
2383
- return result.join("\n");
2384
- }
2385
- get width() {
2386
- return this.toString().split("\n")[0].length;
2387
- }
2388
- };
2389
- Table$1.reset = () => debug.reset();
2390
- function doDraw(row, lineNum, result) {
2391
- let line = [];
2392
- row.forEach(function(cell) {
2393
- line.push(cell.draw(lineNum));
2394
- });
2395
- let str$1 = line.join("");
2396
- if (str$1.length) result.push(str$1);
2397
- }
2398
- module.exports = Table$1;
2399
- }));
2400
- var require_cli_table3 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2401
- module.exports = require_table();
2402
- }));
2403
- var require_picocolors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2404
- let p = process || {}, argv = p.argv || [], env = p.env || {};
2405
- let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
2406
- let formatter = (open, close, replace = open) => (input) => {
2407
- let string$1 = "" + input, index = string$1.indexOf(close, open.length);
2408
- return ~index ? open + replaceClose(string$1, close, replace, index) + close : open + string$1 + close;
2409
- };
2410
- let replaceClose = (string$1, close, replace, index) => {
2411
- let result = "", cursor = 0;
2412
- do {
2413
- result += string$1.substring(cursor, index) + replace;
2414
- cursor = index + close.length;
2415
- index = string$1.indexOf(close, cursor);
2416
- } while (~index);
2417
- return result + string$1.substring(cursor);
2418
- };
2419
- let createColors = (enabled = isColorSupported) => {
2420
- let f = enabled ? formatter : () => String;
2421
- return {
2422
- isColorSupported: enabled,
2423
- reset: f("\x1B[0m", "\x1B[0m"),
2424
- bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
2425
- dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
2426
- italic: f("\x1B[3m", "\x1B[23m"),
2427
- underline: f("\x1B[4m", "\x1B[24m"),
2428
- inverse: f("\x1B[7m", "\x1B[27m"),
2429
- hidden: f("\x1B[8m", "\x1B[28m"),
2430
- strikethrough: f("\x1B[9m", "\x1B[29m"),
2431
- black: f("\x1B[30m", "\x1B[39m"),
2432
- red: f("\x1B[31m", "\x1B[39m"),
2433
- green: f("\x1B[32m", "\x1B[39m"),
2434
- yellow: f("\x1B[33m", "\x1B[39m"),
2435
- blue: f("\x1B[34m", "\x1B[39m"),
2436
- magenta: f("\x1B[35m", "\x1B[39m"),
2437
- cyan: f("\x1B[36m", "\x1B[39m"),
2438
- white: f("\x1B[37m", "\x1B[39m"),
2439
- gray: f("\x1B[90m", "\x1B[39m"),
2440
- bgBlack: f("\x1B[40m", "\x1B[49m"),
2441
- bgRed: f("\x1B[41m", "\x1B[49m"),
2442
- bgGreen: f("\x1B[42m", "\x1B[49m"),
2443
- bgYellow: f("\x1B[43m", "\x1B[49m"),
2444
- bgBlue: f("\x1B[44m", "\x1B[49m"),
2445
- bgMagenta: f("\x1B[45m", "\x1B[49m"),
2446
- bgCyan: f("\x1B[46m", "\x1B[49m"),
2447
- bgWhite: f("\x1B[47m", "\x1B[49m"),
2448
- blackBright: f("\x1B[90m", "\x1B[39m"),
2449
- redBright: f("\x1B[91m", "\x1B[39m"),
2450
- greenBright: f("\x1B[92m", "\x1B[39m"),
2451
- yellowBright: f("\x1B[93m", "\x1B[39m"),
2452
- blueBright: f("\x1B[94m", "\x1B[39m"),
2453
- magentaBright: f("\x1B[95m", "\x1B[39m"),
2454
- cyanBright: f("\x1B[96m", "\x1B[39m"),
2455
- whiteBright: f("\x1B[97m", "\x1B[39m"),
2456
- bgBlackBright: f("\x1B[100m", "\x1B[49m"),
2457
- bgRedBright: f("\x1B[101m", "\x1B[49m"),
2458
- bgGreenBright: f("\x1B[102m", "\x1B[49m"),
2459
- bgYellowBright: f("\x1B[103m", "\x1B[49m"),
2460
- bgBlueBright: f("\x1B[104m", "\x1B[49m"),
2461
- bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
2462
- bgCyanBright: f("\x1B[106m", "\x1B[49m"),
2463
- bgWhiteBright: f("\x1B[107m", "\x1B[49m")
2464
- };
2465
- };
2466
- module.exports = createColors();
2467
- module.exports.createColors = createColors;
2468
- }));
2469
- var import_picocolors$3 = /* @__PURE__ */ __toESM(require_picocolors(), 1);
2470
- var import_cli_table3 = /* @__PURE__ */ __toESM(require_cli_table3(), 1);
2471
- function ansiRegex({ onlyFirst = false } = {}) {
2472
- return new RegExp(`(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]`, onlyFirst ? void 0 : "g");
2473
- }
2474
- const regex = ansiRegex();
2475
- function stripAnsi(string$1) {
2476
- if (typeof string$1 !== "string") throw new TypeError(`Expected a \`string\`, got \`${typeof string$1}\``);
2477
- return string$1.replace(regex, "");
2478
- }
2479
- function isAmbiguous(x) {
2480
- return x === 161 || x === 164 || x === 167 || x === 168 || x === 170 || x === 173 || x === 174 || x >= 176 && x <= 180 || x >= 182 && x <= 186 || x >= 188 && x <= 191 || x === 198 || x === 208 || x === 215 || x === 216 || x >= 222 && x <= 225 || x === 230 || x >= 232 && x <= 234 || x === 236 || x === 237 || x === 240 || x === 242 || x === 243 || x >= 247 && x <= 250 || x === 252 || x === 254 || x === 257 || x === 273 || x === 275 || x === 283 || x === 294 || x === 295 || x === 299 || x >= 305 && x <= 307 || x === 312 || x >= 319 && x <= 322 || x === 324 || x >= 328 && x <= 331 || x === 333 || x === 338 || x === 339 || x === 358 || x === 359 || x === 363 || x === 462 || x === 464 || x === 466 || x === 468 || x === 470 || x === 472 || x === 474 || x === 476 || x === 593 || x === 609 || x === 708 || x === 711 || x >= 713 && x <= 715 || x === 717 || x === 720 || x >= 728 && x <= 731 || x === 733 || x === 735 || x >= 768 && x <= 879 || x >= 913 && x <= 929 || x >= 931 && x <= 937 || x >= 945 && x <= 961 || x >= 963 && x <= 969 || x === 1025 || x >= 1040 && x <= 1103 || x === 1105 || x === 8208 || x >= 8211 && x <= 8214 || x === 8216 || x === 8217 || x === 8220 || x === 8221 || x >= 8224 && x <= 8226 || x >= 8228 && x <= 8231 || x === 8240 || x === 8242 || x === 8243 || x === 8245 || x === 8251 || x === 8254 || x === 8308 || x === 8319 || x >= 8321 && x <= 8324 || x === 8364 || x === 8451 || x === 8453 || x === 8457 || x === 8467 || x === 8470 || x === 8481 || x === 8482 || x === 8486 || x === 8491 || x === 8531 || x === 8532 || x >= 8539 && x <= 8542 || x >= 8544 && x <= 8555 || x >= 8560 && x <= 8569 || x === 8585 || x >= 8592 && x <= 8601 || x === 8632 || x === 8633 || x === 8658 || x === 8660 || x === 8679 || x === 8704 || x === 8706 || x === 8707 || x === 8711 || x === 8712 || x === 8715 || x === 8719 || x === 8721 || x === 8725 || x === 8730 || x >= 8733 && x <= 8736 || x === 8739 || x === 8741 || x >= 8743 && x <= 8748 || x === 8750 || x >= 8756 && x <= 8759 || x === 8764 || x === 8765 || x === 8776 || x === 8780 || x === 8786 || x === 8800 || x === 8801 || x >= 8804 && x <= 8807 || x === 8810 || x === 8811 || x === 8814 || x === 8815 || x === 8834 || x === 8835 || x === 8838 || x === 8839 || x === 8853 || x === 8857 || x === 8869 || x === 8895 || x === 8978 || x >= 9312 && x <= 9449 || x >= 9451 && x <= 9547 || x >= 9552 && x <= 9587 || x >= 9600 && x <= 9615 || x >= 9618 && x <= 9621 || x === 9632 || x === 9633 || x >= 9635 && x <= 9641 || x === 9650 || x === 9651 || x === 9654 || x === 9655 || x === 9660 || x === 9661 || x === 9664 || x === 9665 || x >= 9670 && x <= 9672 || x === 9675 || x >= 9678 && x <= 9681 || x >= 9698 && x <= 9701 || x === 9711 || x === 9733 || x === 9734 || x === 9737 || x === 9742 || x === 9743 || x === 9756 || x === 9758 || x === 9792 || x === 9794 || x === 9824 || x === 9825 || x >= 9827 && x <= 9829 || x >= 9831 && x <= 9834 || x === 9836 || x === 9837 || x === 9839 || x === 9886 || x === 9887 || x === 9919 || x >= 9926 && x <= 9933 || x >= 9935 && x <= 9939 || x >= 9941 && x <= 9953 || x === 9955 || x === 9960 || x === 9961 || x >= 9963 && x <= 9969 || x === 9972 || x >= 9974 && x <= 9977 || x === 9979 || x === 9980 || x === 9982 || x === 9983 || x === 10045 || x >= 10102 && x <= 10111 || x >= 11094 && x <= 11097 || x >= 12872 && x <= 12879 || x >= 57344 && x <= 63743 || x >= 65024 && x <= 65039 || x === 65533 || x >= 127232 && x <= 127242 || x >= 127248 && x <= 127277 || x >= 127280 && x <= 127337 || x >= 127344 && x <= 127373 || x === 127375 || x === 127376 || x >= 127387 && x <= 127404 || x >= 917760 && x <= 917999 || x >= 983040 && x <= 1048573 || x >= 1048576 && x <= 1114109;
2481
- }
2482
- function isFullWidth(x) {
2483
- return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
2484
- }
2485
- function isWide(x) {
2486
- return x >= 4352 && x <= 4447 || x === 8986 || x === 8987 || x === 9001 || x === 9002 || x >= 9193 && x <= 9196 || x === 9200 || x === 9203 || x === 9725 || x === 9726 || x === 9748 || x === 9749 || x >= 9776 && x <= 9783 || x >= 9800 && x <= 9811 || x === 9855 || x >= 9866 && x <= 9871 || x === 9875 || x === 9889 || x === 9898 || x === 9899 || x === 9917 || x === 9918 || x === 9924 || x === 9925 || x === 9934 || x === 9940 || x === 9962 || x === 9970 || x === 9971 || x === 9973 || x === 9978 || x === 9981 || x === 9989 || x === 9994 || x === 9995 || x === 10024 || x === 10060 || x === 10062 || x >= 10067 && x <= 10069 || x === 10071 || x >= 10133 && x <= 10135 || x === 10160 || x === 10175 || x === 11035 || x === 11036 || x === 11088 || x === 11093 || x >= 11904 && x <= 11929 || x >= 11931 && x <= 12019 || x >= 12032 && x <= 12245 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12353 && x <= 12438 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12773 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 42124 || x >= 42128 && x <= 42182 || x >= 43360 && x <= 43388 || x >= 44032 && x <= 55203 || x >= 63744 && x <= 64255 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 94176 && x <= 94180 || x >= 94192 && x <= 94198 || x >= 94208 && x <= 101589 || x >= 101631 && x <= 101662 || x >= 101760 && x <= 101874 || x >= 110576 && x <= 110579 || x >= 110581 && x <= 110587 || x === 110589 || x === 110590 || x >= 110592 && x <= 110882 || x === 110898 || x >= 110928 && x <= 110930 || x === 110933 || x >= 110948 && x <= 110951 || x >= 110960 && x <= 111355 || x >= 119552 && x <= 119638 || x >= 119648 && x <= 119670 || x === 126980 || x === 127183 || x === 127374 || x >= 127377 && x <= 127386 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x === 127568 || x === 127569 || x >= 127584 && x <= 127589 || x >= 127744 && x <= 127776 || x >= 127789 && x <= 127797 || x >= 127799 && x <= 127868 || x >= 127870 && x <= 127891 || x >= 127904 && x <= 127946 || x >= 127951 && x <= 127955 || x >= 127968 && x <= 127984 || x === 127988 || x >= 127992 && x <= 128062 || x === 128064 || x >= 128066 && x <= 128252 || x >= 128255 && x <= 128317 || x >= 128331 && x <= 128334 || x >= 128336 && x <= 128359 || x === 128378 || x === 128405 || x === 128406 || x === 128420 || x >= 128507 && x <= 128591 || x >= 128640 && x <= 128709 || x === 128716 || x >= 128720 && x <= 128722 || x >= 128725 && x <= 128728 || x >= 128732 && x <= 128735 || x === 128747 || x === 128748 || x >= 128756 && x <= 128764 || x >= 128992 && x <= 129003 || x === 129008 || x >= 129292 && x <= 129338 || x >= 129340 && x <= 129349 || x >= 129351 && x <= 129535 || x >= 129648 && x <= 129660 || x >= 129664 && x <= 129674 || x >= 129678 && x <= 129734 || x === 129736 || x >= 129741 && x <= 129756 || x >= 129759 && x <= 129770 || x >= 129775 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
2487
- }
2488
- function validate(codePoint) {
2489
- if (!Number.isSafeInteger(codePoint)) throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
2490
- }
2491
- function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
2492
- validate(codePoint);
2493
- if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) return 2;
2494
- return 1;
2495
- }
2496
- var import_emoji_regex = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
2497
- module.exports = () => {
2498
- return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
2499
- };
2500
- })))(), 1);
2501
- const segmenter = new Intl.Segmenter();
2502
- const defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
2503
- function stringWidth(string$1, options = {}) {
2504
- if (typeof string$1 !== "string" || string$1.length === 0) return 0;
2505
- const { ambiguousIsNarrow = true, countAnsiEscapeCodes = false } = options;
2506
- if (!countAnsiEscapeCodes) string$1 = stripAnsi(string$1);
2507
- if (string$1.length === 0) return 0;
2508
- let width = 0;
2509
- const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
2510
- for (const { segment: character$1 } of segmenter.segment(string$1)) {
2511
- const codePoint = character$1.codePointAt(0);
2512
- if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) continue;
2513
- if (codePoint >= 8203 && codePoint <= 8207 || codePoint === 65279) continue;
2514
- if (codePoint >= 768 && codePoint <= 879 || codePoint >= 6832 && codePoint <= 6911 || codePoint >= 7616 && codePoint <= 7679 || codePoint >= 8400 && codePoint <= 8447 || codePoint >= 65056 && codePoint <= 65071) continue;
2515
- if (codePoint >= 55296 && codePoint <= 57343) continue;
2516
- if (codePoint >= 65024 && codePoint <= 65039) continue;
2517
- if (defaultIgnorableCodePointRegex.test(character$1)) continue;
2518
- if ((0, import_emoji_regex.default)().test(character$1)) {
2519
- width += 2;
2520
- continue;
2521
- }
2522
- width += eastAsianWidth(codePoint, eastAsianWidthOptions);
2523
- }
2524
- return width;
2525
- }
2526
- var ResponsiveTable = class {
2527
- head;
2528
- rows = [];
2529
- colAligns;
2530
- style;
2531
- dateFormatter;
2532
- compactHead;
2533
- compactColAligns;
2534
- compactThreshold;
2535
- compactMode = false;
2536
- forceCompact;
2537
- logger;
2538
- constructor(options) {
2539
- this.head = options.head;
2540
- this.colAligns = options.colAligns ?? Array.from({ length: this.head.length }, () => "left");
2541
- this.style = options.style;
2542
- this.dateFormatter = options.dateFormatter;
2543
- this.compactHead = options.compactHead;
2544
- this.compactColAligns = options.compactColAligns;
2545
- this.compactThreshold = options.compactThreshold ?? 100;
2546
- this.forceCompact = options.forceCompact ?? false;
2547
- this.logger = options.logger ?? console.warn;
2548
- }
2549
- push(row) {
2550
- this.rows.push(row);
2551
- }
2552
- filterRowToCompact(row, compactIndices) {
2553
- return compactIndices.map((index) => row[index] ?? "");
2554
- }
2555
- getCurrentTableConfig() {
2556
- if (this.compactMode && this.compactHead != null && this.compactColAligns != null) return {
2557
- head: this.compactHead,
2558
- colAligns: this.compactColAligns
2559
- };
2560
- return {
2561
- head: this.head,
2562
- colAligns: this.colAligns
2563
- };
2564
- }
2565
- getCompactIndices() {
2566
- if (this.compactHead == null || !this.compactMode) return Array.from({ length: this.head.length }, (_$1, i) => i);
2567
- return this.compactHead.map((compactHeader) => {
2568
- const index = this.head.indexOf(compactHeader);
2569
- if (index < 0) {
2570
- this.logger(`Warning: Compact header "${compactHeader}" not found in table headers [${this.head.join(", ")}]. Using first column as fallback.`);
2571
- return 0;
2572
- }
2573
- return index;
2574
- });
2575
- }
2576
- isCompactMode() {
2577
- return this.compactMode;
2578
- }
2579
- toString() {
2580
- const terminalWidth = Number.parseInt(process$1.env.COLUMNS ?? "", 10) || process$1.stdout.columns || 120;
2581
- this.compactMode = this.forceCompact || terminalWidth < this.compactThreshold && this.compactHead != null;
2582
- const { head, colAligns } = this.getCurrentTableConfig();
2583
- const compactIndices = this.getCompactIndices();
2584
- const dataRows = this.rows.filter((row) => !this.isSeparatorRow(row));
2585
- const processedDataRows = this.compactMode ? dataRows.map((row) => this.filterRowToCompact(row, compactIndices)) : dataRows;
2586
- const allRows = [head.map(String), ...processedDataRows.map((row) => row.map((cell) => {
2587
- if (typeof cell === "object" && cell != null && "content" in cell) return String(cell.content);
2588
- return String(cell ?? "");
2589
- }))];
2590
- const contentWidths = head.map((_$1, colIndex) => {
2591
- return Math.max(...allRows.map((row) => stringWidth(String(row[colIndex] ?? ""))));
2592
- });
2593
- const tableOverhead = 3 * head.length + 1;
2594
- const availableWidth = terminalWidth - tableOverhead;
2595
- const columnWidths = contentWidths.map((width, index) => {
2596
- if (colAligns[index] === "right") return Math.max(width + 3, 11);
2597
- else if (index === 1) return Math.max(width + 2, 15);
2598
- return Math.max(width + 2, 10);
2599
- });
2600
- if (columnWidths.reduce((sum, width) => sum + width, 0) + tableOverhead > terminalWidth) {
2601
- const scaleFactor = availableWidth / columnWidths.reduce((sum, width) => sum + width, 0);
2602
- const adjustedWidths = columnWidths.map((width, index) => {
2603
- const align = colAligns[index];
2604
- let adjustedWidth = Math.floor(width * scaleFactor);
2605
- if (align === "right") adjustedWidth = Math.max(adjustedWidth, 10);
2606
- else if (index === 0) adjustedWidth = Math.max(adjustedWidth, 10);
2607
- else if (index === 1) adjustedWidth = Math.max(adjustedWidth, 12);
2608
- else adjustedWidth = Math.max(adjustedWidth, 8);
2609
- return adjustedWidth;
2610
- });
2611
- const table = new import_cli_table3.default({
2612
- head,
2613
- style: this.style,
2614
- colAligns,
2615
- colWidths: adjustedWidths,
2616
- wordWrap: true,
2617
- wrapOnWordBoundary: true
2618
- });
2619
- for (const row of this.rows) if (this.isSeparatorRow(row)) continue;
2620
- else {
2621
- let processedRow = row.map((cell, index) => {
2622
- if (index === 0 && this.dateFormatter != null && typeof cell === "string" && this.isDateString(cell)) return this.dateFormatter(cell);
2623
- return cell;
2624
- });
2625
- if (this.compactMode) processedRow = this.filterRowToCompact(processedRow, compactIndices);
2626
- table.push(processedRow);
2627
- }
2628
- return table.toString();
2629
- } else {
2630
- const table = new import_cli_table3.default({
2631
- head,
2632
- style: this.style,
2633
- colAligns,
2634
- colWidths: columnWidths,
2635
- wordWrap: true,
2636
- wrapOnWordBoundary: true
2637
- });
2638
- for (const row of this.rows) if (this.isSeparatorRow(row)) continue;
2639
- else {
2640
- const processedRow = this.compactMode ? this.filterRowToCompact(row, compactIndices) : row;
2641
- table.push(processedRow);
2642
- }
2643
- return table.toString();
2644
- }
2645
- }
2646
- isSeparatorRow(row) {
2647
- return row.every((cell) => {
2648
- if (typeof cell === "object" && cell != null && "content" in cell) return cell.content === "" || /^─+$/.test(cell.content);
2649
- return typeof cell === "string" && (cell === "" || /^─+$/.test(cell));
2650
- });
2651
- }
2652
- isDateString(text) {
2653
- return /^\d{4}-\d{2}-\d{2}$/.test(text);
2654
- }
2655
- };
2656
- function formatNumber(num) {
2657
- return num.toLocaleString("en-US");
2658
- }
2659
- function formatCurrency(amount) {
2660
- return `$${amount.toFixed(2)}`;
2661
- }
2662
- function formatModelName(modelName) {
2663
- const piMatch = modelName.match(/^\[pi\] (.+)$/);
2664
- if (piMatch?.[1] != null) return `[pi] ${formatModelName(piMatch[1])}`;
2665
- const anthropicMatch = modelName.match(/^anthropic\/claude-(\w+)-([\d.]+)$/);
2666
- if (anthropicMatch != null) return `${anthropicMatch[1]}-${anthropicMatch[2]}`;
2667
- const match = modelName.match(/^claude-(\w+)-([\d-]+)-(\d{8})$/);
2668
- if (match != null) return `${match[1]}-${match[2]}`;
2669
- const noDateMatch = modelName.match(/^claude-(\w+)-([\d-]+)$/);
2670
- if (noDateMatch != null) return `${noDateMatch[1]}-${noDateMatch[2]}`;
2671
- return modelName;
2672
- }
2673
- function formatModelsDisplayMultiline(models) {
2674
- return uniq(models.map(formatModelName)).sort().map((model) => `- ${model}`).join("\n");
2675
- }
2676
- function pushBreakdownRows(table, breakdowns, extraColumns = 1, trailingColumns = 0) {
2677
- for (const breakdown of breakdowns) {
2678
- const row = [` └─ ${formatModelName(breakdown.modelName)}`];
2679
- for (let i = 0; i < extraColumns; i++) row.push("");
2680
- const totalTokens = breakdown.inputTokens + breakdown.outputTokens + breakdown.cacheCreationTokens + breakdown.cacheReadTokens;
2681
- row.push(import_picocolors$3.default.gray(formatNumber(breakdown.inputTokens)), import_picocolors$3.default.gray(formatNumber(breakdown.outputTokens)), import_picocolors$3.default.gray(formatNumber(breakdown.cacheCreationTokens)), import_picocolors$3.default.gray(formatNumber(breakdown.cacheReadTokens)), import_picocolors$3.default.gray(formatNumber(totalTokens)), import_picocolors$3.default.gray(formatCurrency(breakdown.cost)));
2682
- for (let i = 0; i < trailingColumns; i++) row.push("");
2683
- table.push(row);
2684
- }
2685
- }
2686
- function createUsageReportTable(config) {
2687
- const baseHeaders = [
2688
- config.firstColumnName,
2689
- "Models",
2690
- "Input",
2691
- "Output",
2692
- "Cache Create",
2693
- "Cache Read",
2694
- "Total Tokens",
2695
- "Cost (USD)"
2696
- ];
2697
- const baseAligns = [
2698
- "left",
2699
- "left",
2700
- "right",
2701
- "right",
2702
- "right",
2703
- "right",
2704
- "right",
2705
- "right"
2706
- ];
2707
- const compactHeaders = [
2708
- config.firstColumnName,
2709
- "Models",
2710
- "Input",
2711
- "Output",
2712
- "Cost (USD)"
2713
- ];
2714
- const compactAligns = [
2715
- "left",
2716
- "left",
2717
- "right",
2718
- "right",
2719
- "right"
2720
- ];
2721
- if (config.includeLastActivity ?? false) {
2722
- baseHeaders.push("Last Activity");
2723
- baseAligns.push("left");
2724
- compactHeaders.push("Last Activity");
2725
- compactAligns.push("left");
2726
- }
2727
- return new ResponsiveTable({
2728
- head: baseHeaders,
2729
- style: { head: ["cyan"] },
2730
- colAligns: baseAligns,
2731
- dateFormatter: config.dateFormatter,
2732
- compactHead: compactHeaders,
2733
- compactColAligns: compactAligns,
2734
- compactThreshold: 100,
2735
- forceCompact: config.forceCompact
2736
- });
2737
- }
2738
- function formatUsageDataRow(firstColumnValue, data, lastActivity) {
2739
- const totalTokens = data.inputTokens + data.outputTokens + data.cacheCreationTokens + data.cacheReadTokens;
2740
- const row = [
2741
- firstColumnValue,
2742
- data.modelsUsed != null ? formatModelsDisplayMultiline(data.modelsUsed) : "",
2743
- formatNumber(data.inputTokens),
2744
- formatNumber(data.outputTokens),
2745
- formatNumber(data.cacheCreationTokens),
2746
- formatNumber(data.cacheReadTokens),
2747
- formatNumber(totalTokens),
2748
- formatCurrency(data.totalCost)
2749
- ];
2750
- if (lastActivity !== void 0) row.push(lastActivity);
2751
- return row;
2752
- }
2753
- function formatTotalsRow(totals, includeLastActivity = false) {
2754
- const totalTokens = totals.inputTokens + totals.outputTokens + totals.cacheCreationTokens + totals.cacheReadTokens;
2755
- const row = [
2756
- import_picocolors$3.default.yellow("Total"),
2757
- "",
2758
- import_picocolors$3.default.yellow(formatNumber(totals.inputTokens)),
2759
- import_picocolors$3.default.yellow(formatNumber(totals.outputTokens)),
2760
- import_picocolors$3.default.yellow(formatNumber(totals.cacheCreationTokens)),
2761
- import_picocolors$3.default.yellow(formatNumber(totals.cacheReadTokens)),
2762
- import_picocolors$3.default.yellow(formatNumber(totalTokens)),
2763
- import_picocolors$3.default.yellow(formatCurrency(totals.totalCost))
2764
- ];
2765
- if (includeLastActivity) row.push("");
2766
- return row;
2767
- }
2768
- function addEmptySeparatorRow(table, columnCount) {
2769
- const emptyRow = Array.from({ length: columnCount }, () => "");
2770
- table.push(emptyRow);
2771
- }
881
+ var import_picocolors$2 = /* @__PURE__ */ __toESM(require_picocolors(), 1);
2772
882
  function extractExplicitArgs(tokens) {
2773
883
  const explicit = {};
2774
884
  for (const token of tokens) if (typeof token === "object" && token !== null) {
@@ -2788,9 +898,9 @@ function validateConfigJson(data) {
2788
898
  if (config.commands != null && (typeof config.commands !== "object" || config.commands === null)) return false;
2789
899
  return true;
2790
900
  }
2791
- function loadConfigFile(filePath, debug$4 = false) {
901
+ function loadConfigFile(filePath, debug = false) {
2792
902
  if (!existsSync(filePath)) {
2793
- if (debug$4) logger.info(` • Checking: ${filePath} (not found)`);
903
+ if (debug) logger.info(` • Checking: ${filePath} (not found)`);
2794
904
  return;
2795
905
  }
2796
906
  return pipe(try_({
@@ -2804,23 +914,23 @@ function loadConfigFile(filePath, debug$4 = false) {
2804
914
  catch: (error) => error
2805
915
  })(), inspect(() => {
2806
916
  logger.debug(`Parsed configuration file: ${filePath}`);
2807
- if (debug$4) logger.info(` • Checking: ${filePath} (found ✓)`);
917
+ if (debug) logger.info(` • Checking: ${filePath} (found ✓)`);
2808
918
  }), inspectError((error) => {
2809
919
  const errorMessage = error instanceof Error ? error.message : String(error);
2810
920
  logger.warn(`Error parsing configuration file at ${filePath}: ${errorMessage}`);
2811
- if (debug$4) logger.info(` • Checking: ${filePath} (error: ${errorMessage})`);
921
+ if (debug) logger.info(` • Checking: ${filePath} (error: ${errorMessage})`);
2812
922
  }), unwrap(void 0));
2813
923
  }
2814
- function loadConfig(configPath, debug$4 = false) {
2815
- if (debug$4) logger.info("Debug mode enabled - showing config loading details\n");
924
+ function loadConfig(configPath, debug = false) {
925
+ if (debug) logger.info("Debug mode enabled - showing config loading details\n");
2816
926
  if (configPath != null) {
2817
- if (debug$4) {
927
+ if (debug) {
2818
928
  logger.info("Using specified config file:");
2819
929
  logger.info(` • Path: ${configPath}`);
2820
930
  }
2821
- const config = loadConfigFile(configPath, debug$4);
931
+ const config = loadConfigFile(configPath, debug);
2822
932
  if (config == null) logger.warn(`Configuration file not found or invalid: ${configPath}`);
2823
- else if (debug$4) {
933
+ else if (debug) {
2824
934
  logger.info("");
2825
935
  logger.info(`Loaded config from: ${configPath}`);
2826
936
  logger.info(` • Schema: ${config.$schema ?? "none"}`);
@@ -2829,11 +939,11 @@ function loadConfig(configPath, debug$4 = false) {
2829
939
  }
2830
940
  return config;
2831
941
  }
2832
- if (debug$4) logger.info("Searching for config files:");
942
+ if (debug) logger.info("Searching for config files:");
2833
943
  for (const searchPath of getConfigSearchPaths()) {
2834
- const config = loadConfigFile(searchPath, debug$4);
944
+ const config = loadConfigFile(searchPath, debug);
2835
945
  if (config != null) {
2836
- if (debug$4) {
946
+ if (debug) {
2837
947
  logger.info("");
2838
948
  logger.info(`Loaded config from: ${searchPath}`);
2839
949
  logger.info(` • Schema: ${config.$schema ?? "none"}`);
@@ -2844,14 +954,14 @@ function loadConfig(configPath, debug$4 = false) {
2844
954
  }
2845
955
  }
2846
956
  logger.debug("No valid configuration file found");
2847
- if (debug$4) {
957
+ if (debug) {
2848
958
  logger.info("");
2849
959
  logger.info("No valid configuration file found");
2850
960
  }
2851
961
  }
2852
- function mergeConfigWithArgs(ctx, config, debug$4 = false) {
962
+ function mergeConfigWithArgs(ctx, config, debug = false) {
2853
963
  if (config == null) {
2854
- if (debug$4) {
964
+ if (debug) {
2855
965
  logger.info("");
2856
966
  logger.info(`No config file loaded, using CLI args only for '${ctx.name ?? "unknown"}' command`);
2857
967
  }
@@ -2874,7 +984,7 @@ function mergeConfigWithArgs(ctx, config, debug$4 = false) {
2874
984
  sources[key] = "CLI";
2875
985
  }
2876
986
  logger.debug(`Merged config for ${commandName ?? "unknown"}:`, merged);
2877
- if (debug$4) {
987
+ if (debug) {
2878
988
  logger.info("");
2879
989
  logger.info(`Merging options for '${commandName ?? "unknown"}' command:`);
2880
990
  const bySource = {
@@ -2911,7 +1021,7 @@ const getOptions = ({ stdin: stdin$2, stdout: stdout$1, stderr, stdio = [
2911
1021
  stderr
2912
1022
  ], env: envOption, preferLocal, cwd: cwdOption = ".", ...options }) => {
2913
1023
  const cwd = cwdOption instanceof URL ? fileURLToPath(cwdOption) : path.resolve(cwdOption);
2914
- const env$2 = envOption ? {
1024
+ const env = envOption ? {
2915
1025
  ...process$1.env,
2916
1026
  ...envOption
2917
1027
  } : void 0;
@@ -2920,15 +1030,15 @@ const getOptions = ({ stdin: stdin$2, stdout: stdout$1, stderr, stdio = [
2920
1030
  ...options,
2921
1031
  input,
2922
1032
  stdio: input === void 0 ? stdio : ["pipe", ...stdio.slice(1)],
2923
- env: preferLocal ? addLocalPath(env$2 ?? process$1.env, cwd) : env$2,
1033
+ env: preferLocal ? addLocalPath(env ?? process$1.env, cwd) : env,
2924
1034
  cwd
2925
1035
  };
2926
1036
  };
2927
- const addLocalPath = ({ Path = "", PATH = Path, ...env$2 }, cwd) => {
1037
+ const addLocalPath = ({ Path = "", PATH = Path, ...env }, cwd) => {
2928
1038
  const pathParts = PATH.split(path.delimiter);
2929
1039
  const localPaths = getLocalPaths([], path.resolve(cwd)).map((localPath) => path.join(localPath, "node_modules/.bin")).filter((localPath) => !pathParts.includes(localPath));
2930
1040
  return {
2931
- ...env$2,
1041
+ ...env,
2932
1042
  PATH: [...localPaths, PATH].filter(Boolean).join(path.delimiter)
2933
1043
  };
2934
1044
  };
@@ -2945,7 +1055,7 @@ const applyForceShell = async (file, commandArguments, options) => await shouldF
2945
1055
  commandArguments,
2946
1056
  options
2947
1057
  ];
2948
- const shouldForceShell = async (file, { shell, cwd, env: env$2 = process$1.env }) => process$1.platform === "win32" && !shell && !await isExe(file, cwd, env$2);
1058
+ const shouldForceShell = async (file, { shell, cwd, env = process$1.env }) => process$1.platform === "win32" && !shell && !await isExe(file, cwd, env);
2949
1059
  const isExe = (file, cwd, { Path = "", PATH = Path }) => exeExtensions.some((extension) => file.toLowerCase().endsWith(extension)) || mIsExe(file, cwd, PATH);
2950
1060
  const EXE_MEMO = {};
2951
1061
  const memoize = (function_) => (...arguments_) => EXE_MEMO[arguments_.join("\0")] ??= function_(...arguments_);
@@ -3238,7 +1348,6 @@ const sharedCommandConfig = {
3238
1348
  args: sharedArgs,
3239
1349
  toKebab: true
3240
1350
  };
3241
- var import_picocolors$2 = /* @__PURE__ */ __toESM(require_picocolors(), 1);
3242
1351
  function formatBlockTime(block, compact = false, locale) {
3243
1352
  const start = compact ? block.startTime.toLocaleString(locale, {
3244
1353
  month: "2-digit",
@@ -4486,9 +2595,9 @@ function resolveYamlBinary(data) {
4486
2595
  let code;
4487
2596
  let bitlen = 0;
4488
2597
  const max = data.length;
4489
- const map$3 = BASE64_MAP;
2598
+ const map$2 = BASE64_MAP;
4490
2599
  for (let idx = 0; idx < max; idx++) {
4491
- code = map$3.indexOf(data.charAt(idx));
2600
+ code = map$2.indexOf(data.charAt(idx));
4492
2601
  if (code > 64) continue;
4493
2602
  if (code < 0) return false;
4494
2603
  bitlen += 6;
@@ -4498,7 +2607,7 @@ function resolveYamlBinary(data) {
4498
2607
  function constructYamlBinary(data) {
4499
2608
  const input = data.replace(/[\r\n=]/g, "");
4500
2609
  const max = input.length;
4501
- const map$3 = BASE64_MAP;
2610
+ const map$2 = BASE64_MAP;
4502
2611
  const result = [];
4503
2612
  let bits = 0;
4504
2613
  for (let idx = 0; idx < max; idx++) {
@@ -4507,7 +2616,7 @@ function constructYamlBinary(data) {
4507
2616
  result.push(bits >> 8 & 255);
4508
2617
  result.push(bits & 255);
4509
2618
  }
4510
- bits = bits << 6 | map$3.indexOf(input.charAt(idx));
2619
+ bits = bits << 6 | map$2.indexOf(input.charAt(idx));
4511
2620
  }
4512
2621
  const tailbits = max % 4 * 6;
4513
2622
  if (tailbits === 0) {
@@ -4522,34 +2631,34 @@ function constructYamlBinary(data) {
4522
2631
  }
4523
2632
  function representYamlBinary(object) {
4524
2633
  const max = object.length;
4525
- const map$3 = BASE64_MAP;
2634
+ const map$2 = BASE64_MAP;
4526
2635
  let result = "";
4527
2636
  let bits = 0;
4528
2637
  for (let idx = 0; idx < max; idx++) {
4529
2638
  if (idx % 3 === 0 && idx) {
4530
- result += map$3[bits >> 18 & 63];
4531
- result += map$3[bits >> 12 & 63];
4532
- result += map$3[bits >> 6 & 63];
4533
- result += map$3[bits & 63];
2639
+ result += map$2[bits >> 18 & 63];
2640
+ result += map$2[bits >> 12 & 63];
2641
+ result += map$2[bits >> 6 & 63];
2642
+ result += map$2[bits & 63];
4534
2643
  }
4535
2644
  bits = (bits << 8) + object[idx];
4536
2645
  }
4537
2646
  const tail = max % 3;
4538
2647
  if (tail === 0) {
4539
- result += map$3[bits >> 18 & 63];
4540
- result += map$3[bits >> 12 & 63];
4541
- result += map$3[bits >> 6 & 63];
4542
- result += map$3[bits & 63];
2648
+ result += map$2[bits >> 18 & 63];
2649
+ result += map$2[bits >> 12 & 63];
2650
+ result += map$2[bits >> 6 & 63];
2651
+ result += map$2[bits & 63];
4543
2652
  } else if (tail === 2) {
4544
- result += map$3[bits >> 10 & 63];
4545
- result += map$3[bits >> 4 & 63];
4546
- result += map$3[bits << 2 & 63];
4547
- result += map$3[64];
2653
+ result += map$2[bits >> 10 & 63];
2654
+ result += map$2[bits >> 4 & 63];
2655
+ result += map$2[bits << 2 & 63];
2656
+ result += map$2[64];
4548
2657
  } else if (tail === 1) {
4549
- result += map$3[bits >> 2 & 63];
4550
- result += map$3[bits << 4 & 63];
4551
- result += map$3[64];
4552
- result += map$3[64];
2658
+ result += map$2[bits >> 2 & 63];
2659
+ result += map$2[bits << 4 & 63];
2660
+ result += map$2[64];
2661
+ result += map$2[64];
4553
2662
  }
4554
2663
  return result;
4555
2664
  }
@@ -5178,7 +3287,7 @@ const statuslineCommand = define({
5178
3287
  }
5179
3288
  const hookData = hookDataParseResult.output;
5180
3289
  const sessionId = hookData.session_id;
5181
- const initialSemaphoreState = pipe(succeed(getSemaphore(sessionId)), map$2((semaphore) => semaphore.data), unwrap(void 0));
3290
+ const initialSemaphoreState = pipe(succeed(getSemaphore(sessionId)), map$1((semaphore) => semaphore.data), unwrap(void 0));
5182
3291
  const currentMtime = await getFileModifiedTime(hookData.transcript_path);
5183
3292
  if (mergedOptions.cache && initialSemaphoreState != null) {
5184
3293
  const isExpired = Date.now() - (initialSemaphoreState.lastUpdateTime ?? 0) >= refreshInterval * 1e3;
@@ -5239,7 +3348,7 @@ const statuslineCommand = define({
5239
3348
  offline: mergedOptions.offline
5240
3349
  }),
5241
3350
  catch: (error) => error
5242
- })(), map$2((sessionCost$1) => sessionCost$1?.totalCost), inspectError((error) => logger.error("Failed to load session data:", error)), unwrap(void 0));
3351
+ })(), map$1((sessionCost$1) => sessionCost$1?.totalCost), inspectError((error) => logger.error("Failed to load session data:", error)), unwrap(void 0));
5243
3352
  };
5244
3353
  if (costSource === "both") return {
5245
3354
  ccCost: hookData.cost?.total_cost_usd,
@@ -5263,7 +3372,7 @@ const statuslineCommand = define({
5263
3372
  offline: mergedOptions.offline
5264
3373
  }),
5265
3374
  catch: (error) => error
5266
- })(), map$2((dailyData) => {
3375
+ })(), map$1((dailyData) => {
5267
3376
  if (dailyData.length > 0) return calculateTotals(dailyData).totalCost;
5268
3377
  return 0;
5269
3378
  }), inspectError((error) => logger.error("Failed to load daily data:", error)), unwrap(0));
@@ -5273,7 +3382,7 @@ const statuslineCommand = define({
5273
3382
  offline: mergedOptions.offline
5274
3383
  }),
5275
3384
  catch: (error) => error
5276
- })(), map$2((blocks) => {
3385
+ })(), map$1((blocks) => {
5277
3386
  if (blocks.length === 0) return {
5278
3387
  blockInfo: "No active block",
5279
3388
  burnRateInfo: ""
@@ -5339,7 +3448,7 @@ const statuslineCommand = define({
5339
3448
  }) : await try_({
5340
3449
  try: async () => calculateContextTokens(hookData.transcript_path, hookData.model.id, mergedOptions.offline),
5341
3450
  catch: (error) => error
5342
- })(), inspectError((error) => logger.debug(`Failed to calculate context tokens: ${error instanceof Error ? error.message : String(error)}`)), map$2((contextResult) => {
3451
+ })(), inspectError((error) => logger.debug(`Failed to calculate context tokens: ${error instanceof Error ? error.message : String(error)}`)), map$1((contextResult) => {
5343
3452
  if (contextResult == null) return;
5344
3453
  return formatContextInfo(contextResult.inputTokens, contextResult.contextLimit);
5345
3454
  }), unwrap(void 0));