rolldown 1.0.0-beta.1-commit.7c52c94 → 1.0.0-beta.2-commit.afd0727

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.
Files changed (114) hide show
  1. package/dist/cjs/cli.cjs +981 -25
  2. package/dist/cjs/experimental-index.cjs +2 -2
  3. package/dist/cjs/index.cjs +2 -2
  4. package/dist/cjs/parallel-plugin-worker.cjs +2 -2
  5. package/dist/cjs/parse-ast-index.cjs +1 -1
  6. package/dist/esm/cli.mjs +981 -26
  7. package/dist/esm/experimental-index.mjs +2 -2
  8. package/dist/esm/index.mjs +2 -2
  9. package/dist/esm/parallel-plugin-worker.mjs +2 -2
  10. package/dist/esm/parse-ast-index.mjs +1 -1
  11. package/dist/shared/{binding-Bl7VQy7c.mjs → binding-l7VLSKnB.mjs} +3 -3
  12. package/dist/shared/{binding-fhgdIkpS.cjs → binding-orkvONpS.cjs} +3 -3
  13. package/dist/shared/prompt-B7tq3GL9.cjs +854 -0
  14. package/dist/shared/prompt-Nfm4Xz36.mjs +851 -0
  15. package/dist/shared/{src-lBcHSsjm.cjs → src-Db20iysW.cjs} +12 -6
  16. package/dist/shared/{src-CPCP99Z9.mjs → src-mclDryX0.mjs} +12 -6
  17. package/dist/types/api/build.js +22 -0
  18. package/dist/types/api/experimental.js +13 -0
  19. package/dist/types/api/rolldown/index.js +7 -0
  20. package/dist/types/api/rolldown/rolldown-build.js +43 -0
  21. package/dist/types/api/watch/index.js +8 -0
  22. package/dist/types/api/watch/watch-emitter.js +69 -0
  23. package/dist/types/api/watch/watcher.js +66 -0
  24. package/dist/types/binding.d.ts +40 -2
  25. package/dist/types/builtin-plugin/alias-plugin.js +4 -0
  26. package/dist/types/builtin-plugin/constructors.d.ts +2 -2
  27. package/dist/types/builtin-plugin/constructors.js +68 -0
  28. package/dist/types/builtin-plugin/replace-plugin.js +29 -0
  29. package/dist/types/builtin-plugin/transform-plugin.js +16 -0
  30. package/dist/types/builtin-plugin/utils.js +19 -0
  31. package/dist/types/cli/arguments/alias.js +63 -0
  32. package/dist/types/cli/arguments/index.js +127 -0
  33. package/dist/types/cli/arguments/normalize.js +48 -0
  34. package/dist/types/cli/arguments/utils.js +67 -0
  35. package/dist/types/cli/colors.js +17 -0
  36. package/dist/types/cli/commands/bundle.js +203 -0
  37. package/dist/types/cli/commands/help.js +88 -0
  38. package/dist/types/cli/index.js +27 -0
  39. package/dist/types/cli/load-config.js +95 -0
  40. package/dist/types/cli/logger.js +35 -0
  41. package/dist/types/constants/plugin-context.js +7 -0
  42. package/dist/types/constants/plugin.js +69 -0
  43. package/dist/types/experimental-index.js +9 -0
  44. package/dist/types/index.d.ts +2 -2
  45. package/dist/types/index.js +7 -0
  46. package/dist/types/log/logHandler.js +25 -0
  47. package/dist/types/log/logger.js +107 -0
  48. package/dist/types/log/logging.js +11 -0
  49. package/dist/types/log/logs.js +86 -0
  50. package/dist/types/options/input-options.d.ts +47 -2
  51. package/dist/types/options/input-options.js +1 -0
  52. package/dist/types/options/normalized-input-options.js +21 -0
  53. package/dist/types/options/normalized-output-options.js +99 -0
  54. package/dist/types/options/output-options.d.ts +6 -0
  55. package/dist/types/options/output-options.js +1 -0
  56. package/dist/types/options/watch-options.js +1 -0
  57. package/dist/types/parallel-plugin-worker.js +31 -0
  58. package/dist/types/parallel-plugin.js +1 -0
  59. package/dist/types/parse-ast-index.js +73 -0
  60. package/dist/types/plugin/bindingify-build-hooks.js +213 -0
  61. package/dist/types/plugin/bindingify-hook-filter.js +39 -0
  62. package/dist/types/plugin/bindingify-output-hooks.js +189 -0
  63. package/dist/types/plugin/bindingify-plugin-hook-meta.js +19 -0
  64. package/dist/types/plugin/bindingify-plugin.js +124 -0
  65. package/dist/types/plugin/bindingify-watch-hooks.js +29 -0
  66. package/dist/types/plugin/hook-filter.js +1 -0
  67. package/dist/types/plugin/index.js +1 -0
  68. package/dist/types/plugin/minimal-plugin-context.js +25 -0
  69. package/dist/types/plugin/parallel-plugin-implementation.js +3 -0
  70. package/dist/types/plugin/parallel-plugin.js +6 -0
  71. package/dist/types/plugin/plugin-context-data.js +55 -0
  72. package/dist/types/plugin/plugin-context.js +108 -0
  73. package/dist/types/plugin/plugin-driver.js +88 -0
  74. package/dist/types/plugin/transform-plugin-context.js +37 -0
  75. package/dist/types/types/assert.js +1 -0
  76. package/dist/types/types/config-export.js +1 -0
  77. package/dist/types/types/misc.js +1 -0
  78. package/dist/types/types/module-info.js +1 -0
  79. package/dist/types/types/module-side-effects.js +1 -0
  80. package/dist/types/types/output-bundle.js +1 -0
  81. package/dist/types/types/rolldown-options.js +1 -0
  82. package/dist/types/types/rolldown-output.js +1 -0
  83. package/dist/types/types/schema.js +1 -0
  84. package/dist/types/types/sourcemap.js +16 -0
  85. package/dist/types/types/utils.js +1 -0
  86. package/dist/types/utils/asset-source.js +8 -0
  87. package/dist/types/utils/async-flatten.js +7 -0
  88. package/dist/types/utils/bindingify-input-options.js +225 -0
  89. package/dist/types/utils/bindingify-output-options.js +92 -0
  90. package/dist/types/utils/code-frame.js +46 -0
  91. package/dist/types/utils/compose-js-plugins.js +400 -0
  92. package/dist/types/utils/create-bundler-option.js +53 -0
  93. package/dist/types/utils/create-bundler.js +15 -0
  94. package/dist/types/utils/define-config.js +3 -0
  95. package/dist/types/utils/error.js +65 -0
  96. package/dist/types/utils/initialize-parallel-plugins.js +54 -0
  97. package/dist/types/utils/misc.js +22 -0
  98. package/dist/types/utils/normalize-hook.js +21 -0
  99. package/dist/types/utils/normalize-plugin-option.js +35 -0
  100. package/dist/types/utils/normalize-string-or-regex.js +14 -0
  101. package/dist/types/utils/plugin/index.js +7 -0
  102. package/dist/types/utils/transform-module-info.js +19 -0
  103. package/dist/types/utils/transform-rendered-chunk.js +43 -0
  104. package/dist/types/utils/transform-rendered-module.js +10 -0
  105. package/dist/types/utils/transform-side-effects.js +16 -0
  106. package/dist/types/utils/transform-sourcemap.js +29 -0
  107. package/dist/types/utils/transform-to-rollup-output.js +165 -0
  108. package/dist/types/utils/validator.js +275 -0
  109. package/package.json +28 -25
  110. package/dist/shared/consola_36c0034f-Cx52UqEq.mjs +0 -832
  111. package/dist/shared/consola_36c0034f-CynBWXXO.cjs +0 -859
  112. package/dist/shared/prompt-B58MxVuU.cjs +0 -762
  113. package/dist/shared/prompt-DjjlOckE.mjs +0 -758
  114. package/dist/tsconfig.dts.tsbuildinfo +0 -1
@@ -1,832 +0,0 @@
1
- import process$1 from "node:process";
2
- import { sep } from "node:path";
3
- import { formatWithOptions } from "node:util";
4
- import * as tty from "node:tty";
5
-
6
- //#region ../../node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/core.mjs
7
- const LogLevels = {
8
- silent: Number.NEGATIVE_INFINITY,
9
- fatal: 0,
10
- error: 0,
11
- warn: 1,
12
- log: 2,
13
- info: 3,
14
- success: 3,
15
- fail: 3,
16
- ready: 3,
17
- start: 3,
18
- box: 3,
19
- debug: 4,
20
- trace: 5,
21
- verbose: Number.POSITIVE_INFINITY
22
- };
23
- const LogTypes = {
24
- silent: { level: -1 },
25
- fatal: { level: LogLevels.fatal },
26
- error: { level: LogLevels.error },
27
- warn: { level: LogLevels.warn },
28
- log: { level: LogLevels.log },
29
- info: { level: LogLevels.info },
30
- success: { level: LogLevels.success },
31
- fail: { level: LogLevels.fail },
32
- ready: { level: LogLevels.info },
33
- start: { level: LogLevels.info },
34
- box: { level: LogLevels.info },
35
- debug: { level: LogLevels.debug },
36
- trace: { level: LogLevels.trace },
37
- verbose: { level: LogLevels.verbose }
38
- };
39
- function isObject(value) {
40
- return value !== null && typeof value === "object";
41
- }
42
- function _defu(baseObject, defaults, namespace = ".", merger) {
43
- if (!isObject(defaults)) return _defu(baseObject, {}, namespace, merger);
44
- const object = Object.assign({}, defaults);
45
- for (const key in baseObject) {
46
- if (key === "__proto__" || key === "constructor") continue;
47
- const value = baseObject[key];
48
- if (value === null || value === void 0) continue;
49
- if (merger && merger(object, key, value, namespace)) continue;
50
- if (Array.isArray(value) && Array.isArray(object[key])) object[key] = [...value, ...object[key]];
51
- else if (isObject(value) && isObject(object[key])) object[key] = _defu(value, object[key], (namespace ? `${namespace}.` : "") + key.toString(), merger);
52
- else object[key] = value;
53
- }
54
- return object;
55
- }
56
- function createDefu(merger) {
57
- return (...arguments_) => arguments_.reduce((p, c) => _defu(p, c, "", merger), {});
58
- }
59
- const defu = createDefu();
60
- function isPlainObject(obj) {
61
- return Object.prototype.toString.call(obj) === "[object Object]";
62
- }
63
- function isLogObj(arg) {
64
- if (!isPlainObject(arg)) return false;
65
- if (!arg.message && !arg.args) return false;
66
- if (arg.stack) return false;
67
- return true;
68
- }
69
- let paused = false;
70
- const queue = [];
71
- var Consola = class Consola {
72
- constructor(options = {}) {
73
- const types = options.types || LogTypes;
74
- this.options = defu({
75
- ...options,
76
- defaults: { ...options.defaults },
77
- level: _normalizeLogLevel(options.level, types),
78
- reporters: [...options.reporters || []]
79
- }, {
80
- types: LogTypes,
81
- throttle: 1e3,
82
- throttleMin: 5,
83
- formatOptions: {
84
- date: true,
85
- colors: false,
86
- compact: true
87
- }
88
- });
89
- for (const type in types) {
90
- const defaults = {
91
- type,
92
- ...this.options.defaults,
93
- ...types[type]
94
- };
95
- this[type] = this._wrapLogFn(defaults);
96
- this[type].raw = this._wrapLogFn(defaults, true);
97
- }
98
- if (this.options.mockFn) this.mockTypes();
99
- this._lastLog = {};
100
- }
101
- get level() {
102
- return this.options.level;
103
- }
104
- set level(level) {
105
- this.options.level = _normalizeLogLevel(level, this.options.types, this.options.level);
106
- }
107
- prompt(message, opts) {
108
- if (!this.options.prompt) throw new Error("prompt is not supported!");
109
- return this.options.prompt(message, opts);
110
- }
111
- create(options) {
112
- const instance = new Consola({
113
- ...this.options,
114
- ...options
115
- });
116
- if (this._mockFn) instance.mockTypes(this._mockFn);
117
- return instance;
118
- }
119
- withDefaults(defaults) {
120
- return this.create({
121
- ...this.options,
122
- defaults: {
123
- ...this.options.defaults,
124
- ...defaults
125
- }
126
- });
127
- }
128
- withTag(tag) {
129
- return this.withDefaults({ tag: this.options.defaults.tag ? this.options.defaults.tag + ":" + tag : tag });
130
- }
131
- addReporter(reporter) {
132
- this.options.reporters.push(reporter);
133
- return this;
134
- }
135
- removeReporter(reporter) {
136
- if (reporter) {
137
- const i = this.options.reporters.indexOf(reporter);
138
- if (i >= 0) return this.options.reporters.splice(i, 1);
139
- } else this.options.reporters.splice(0);
140
- return this;
141
- }
142
- setReporters(reporters) {
143
- this.options.reporters = Array.isArray(reporters) ? reporters : [reporters];
144
- return this;
145
- }
146
- wrapAll() {
147
- this.wrapConsole();
148
- this.wrapStd();
149
- }
150
- restoreAll() {
151
- this.restoreConsole();
152
- this.restoreStd();
153
- }
154
- wrapConsole() {
155
- for (const type in this.options.types) {
156
- if (!console["__" + type]) console["__" + type] = console[type];
157
- console[type] = this[type].raw;
158
- }
159
- }
160
- restoreConsole() {
161
- for (const type in this.options.types) if (console["__" + type]) {
162
- console[type] = console["__" + type];
163
- delete console["__" + type];
164
- }
165
- }
166
- wrapStd() {
167
- this._wrapStream(this.options.stdout, "log");
168
- this._wrapStream(this.options.stderr, "log");
169
- }
170
- _wrapStream(stream, type) {
171
- if (!stream) return;
172
- if (!stream.__write) stream.__write = stream.write;
173
- stream.write = (data) => {
174
- this[type].raw(String(data).trim());
175
- };
176
- }
177
- restoreStd() {
178
- this._restoreStream(this.options.stdout);
179
- this._restoreStream(this.options.stderr);
180
- }
181
- _restoreStream(stream) {
182
- if (!stream) return;
183
- if (stream.__write) {
184
- stream.write = stream.__write;
185
- delete stream.__write;
186
- }
187
- }
188
- pauseLogs() {
189
- paused = true;
190
- }
191
- resumeLogs() {
192
- paused = false;
193
- const _queue = queue.splice(0);
194
- for (const item of _queue) item[0]._logFn(item[1], item[2]);
195
- }
196
- mockTypes(mockFn) {
197
- const _mockFn = mockFn || this.options.mockFn;
198
- this._mockFn = _mockFn;
199
- if (typeof _mockFn !== "function") return;
200
- for (const type in this.options.types) {
201
- this[type] = _mockFn(type, this.options.types[type]) || this[type];
202
- this[type].raw = this[type];
203
- }
204
- }
205
- _wrapLogFn(defaults, isRaw) {
206
- return (...args) => {
207
- if (paused) {
208
- queue.push([
209
- this,
210
- defaults,
211
- args,
212
- isRaw
213
- ]);
214
- return;
215
- }
216
- return this._logFn(defaults, args, isRaw);
217
- };
218
- }
219
- _logFn(defaults, args, isRaw) {
220
- if ((defaults.level || 0) > this.level) return false;
221
- const logObj = {
222
- date: /* @__PURE__ */ new Date(),
223
- args: [],
224
- ...defaults,
225
- level: _normalizeLogLevel(defaults.level, this.options.types)
226
- };
227
- if (!isRaw && args.length === 1 && isLogObj(args[0])) Object.assign(logObj, args[0]);
228
- else logObj.args = [...args];
229
- if (logObj.message) {
230
- logObj.args.unshift(logObj.message);
231
- delete logObj.message;
232
- }
233
- if (logObj.additional) {
234
- if (!Array.isArray(logObj.additional)) logObj.additional = logObj.additional.split("\n");
235
- logObj.args.push("\n" + logObj.additional.join("\n"));
236
- delete logObj.additional;
237
- }
238
- logObj.type = typeof logObj.type === "string" ? logObj.type.toLowerCase() : "log";
239
- logObj.tag = typeof logObj.tag === "string" ? logObj.tag : "";
240
- const resolveLog = (newLog = false) => {
241
- const repeated = (this._lastLog.count || 0) - this.options.throttleMin;
242
- if (this._lastLog.object && repeated > 0) {
243
- const args2 = [...this._lastLog.object.args];
244
- if (repeated > 1) args2.push(`(repeated ${repeated} times)`);
245
- this._log({
246
- ...this._lastLog.object,
247
- args: args2
248
- });
249
- this._lastLog.count = 1;
250
- }
251
- if (newLog) {
252
- this._lastLog.object = logObj;
253
- this._log(logObj);
254
- }
255
- };
256
- clearTimeout(this._lastLog.timeout);
257
- const diffTime = this._lastLog.time && logObj.date ? logObj.date.getTime() - this._lastLog.time.getTime() : 0;
258
- this._lastLog.time = logObj.date;
259
- if (diffTime < this.options.throttle) try {
260
- const serializedLog = JSON.stringify([
261
- logObj.type,
262
- logObj.tag,
263
- logObj.args
264
- ]);
265
- const isSameLog = this._lastLog.serialized === serializedLog;
266
- this._lastLog.serialized = serializedLog;
267
- if (isSameLog) {
268
- this._lastLog.count = (this._lastLog.count || 0) + 1;
269
- if (this._lastLog.count > this.options.throttleMin) {
270
- this._lastLog.timeout = setTimeout(resolveLog, this.options.throttle);
271
- return;
272
- }
273
- }
274
- } catch {}
275
- resolveLog(true);
276
- }
277
- _log(logObj) {
278
- for (const reporter of this.options.reporters) reporter.log(logObj, { options: this.options });
279
- }
280
- };
281
- function _normalizeLogLevel(input, types = {}, defaultLevel = 3) {
282
- if (input === void 0) return defaultLevel;
283
- if (typeof input === "number") return input;
284
- if (types[input] && types[input].level !== void 0) return types[input].level;
285
- return defaultLevel;
286
- }
287
- Consola.prototype.add = Consola.prototype.addReporter;
288
- Consola.prototype.remove = Consola.prototype.removeReporter;
289
- Consola.prototype.clear = Consola.prototype.removeReporter;
290
- Consola.prototype.withScope = Consola.prototype.withTag;
291
- Consola.prototype.mock = Consola.prototype.mockTypes;
292
- Consola.prototype.pause = Consola.prototype.pauseLogs;
293
- Consola.prototype.resume = Consola.prototype.resumeLogs;
294
- function createConsola$1(options = {}) {
295
- return new Consola(options);
296
- }
297
-
298
- //#endregion
299
- //#region ../../node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/shared/consola.06ad8a64.mjs
300
- function parseStack(stack) {
301
- const cwd$1 = process.cwd() + sep;
302
- const lines = stack.split("\n").splice(1).map((l) => l.trim().replace("file://", "").replace(cwd$1, ""));
303
- return lines;
304
- }
305
- function writeStream(data, stream) {
306
- const write = stream.__write || stream.write;
307
- return write.call(stream, data);
308
- }
309
- const bracket = (x) => x ? `[${x}]` : "";
310
- var BasicReporter = class {
311
- formatStack(stack, opts) {
312
- return " " + parseStack(stack).join("\n ");
313
- }
314
- formatArgs(args, opts) {
315
- const _args = args.map((arg) => {
316
- if (arg && typeof arg.stack === "string") return arg.message + "\n" + this.formatStack(arg.stack, opts);
317
- return arg;
318
- });
319
- return formatWithOptions(opts, ..._args);
320
- }
321
- formatDate(date, opts) {
322
- return opts.date ? date.toLocaleTimeString() : "";
323
- }
324
- filterAndJoin(arr) {
325
- return arr.filter(Boolean).join(" ");
326
- }
327
- formatLogObj(logObj, opts) {
328
- const message = this.formatArgs(logObj.args, opts);
329
- if (logObj.type === "box") return "\n" + [
330
- bracket(logObj.tag),
331
- logObj.title && logObj.title,
332
- ...message.split("\n")
333
- ].filter(Boolean).map((l) => " > " + l).join("\n") + "\n";
334
- return this.filterAndJoin([
335
- bracket(logObj.type),
336
- bracket(logObj.tag),
337
- message
338
- ]);
339
- }
340
- log(logObj, ctx) {
341
- const line = this.formatLogObj(logObj, {
342
- columns: ctx.options.stdout.columns || 0,
343
- ...ctx.options.formatOptions
344
- });
345
- return writeStream(line + "\n", logObj.level < 2 ? ctx.options.stderr || process.stderr : ctx.options.stdout || process.stdout);
346
- }
347
- };
348
-
349
- //#endregion
350
- //#region ../../node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/utils.mjs
351
- const { env: env$1 = {}, argv = [], platform = "" } = typeof process === "undefined" ? {} : process;
352
- const isDisabled = "NO_COLOR" in env$1 || argv.includes("--no-color");
353
- const isForced = "FORCE_COLOR" in env$1 || argv.includes("--color");
354
- const isWindows = platform === "win32";
355
- const isDumbTerminal = env$1.TERM === "dumb";
356
- const isCompatibleTerminal = tty && tty.isatty && tty.isatty(1) && env$1.TERM && !isDumbTerminal;
357
- const isCI$1 = "CI" in env$1 && ("GITHUB_ACTIONS" in env$1 || "GITLAB_CI" in env$1 || "CIRCLECI" in env$1);
358
- const isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI$1);
359
- function replaceClose(index, string, close, replace, head = string.slice(0, Math.max(0, index)) + replace, tail = string.slice(Math.max(0, index + close.length)), next = tail.indexOf(close)) {
360
- return head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
361
- }
362
- function clearBleed(index, string, open, close, replace) {
363
- return index < 0 ? open + string + close : open + replaceClose(index, string, close, replace) + close;
364
- }
365
- function filterEmpty(open, close, replace = open, at = open.length + 1) {
366
- return (string) => string || !(string === "" || string === void 0) ? clearBleed(("" + string).indexOf(close, at), string, open, close, replace) : "";
367
- }
368
- function init(open, close, replace) {
369
- return filterEmpty(`\x1B[${open}m`, `\x1B[${close}m`, replace);
370
- }
371
- const colorDefs = {
372
- reset: init(0, 0),
373
- bold: init(1, 22, "\x1B[22m\x1B[1m"),
374
- dim: init(2, 22, "\x1B[22m\x1B[2m"),
375
- italic: init(3, 23),
376
- underline: init(4, 24),
377
- inverse: init(7, 27),
378
- hidden: init(8, 28),
379
- strikethrough: init(9, 29),
380
- black: init(30, 39),
381
- red: init(31, 39),
382
- green: init(32, 39),
383
- yellow: init(33, 39),
384
- blue: init(34, 39),
385
- magenta: init(35, 39),
386
- cyan: init(36, 39),
387
- white: init(37, 39),
388
- gray: init(90, 39),
389
- bgBlack: init(40, 49),
390
- bgRed: init(41, 49),
391
- bgGreen: init(42, 49),
392
- bgYellow: init(43, 49),
393
- bgBlue: init(44, 49),
394
- bgMagenta: init(45, 49),
395
- bgCyan: init(46, 49),
396
- bgWhite: init(47, 49),
397
- blackBright: init(90, 39),
398
- redBright: init(91, 39),
399
- greenBright: init(92, 39),
400
- yellowBright: init(93, 39),
401
- blueBright: init(94, 39),
402
- magentaBright: init(95, 39),
403
- cyanBright: init(96, 39),
404
- whiteBright: init(97, 39),
405
- bgBlackBright: init(100, 49),
406
- bgRedBright: init(101, 49),
407
- bgGreenBright: init(102, 49),
408
- bgYellowBright: init(103, 49),
409
- bgBlueBright: init(104, 49),
410
- bgMagentaBright: init(105, 49),
411
- bgCyanBright: init(106, 49),
412
- bgWhiteBright: init(107, 49)
413
- };
414
- function createColors(useColor = isColorSupported) {
415
- return useColor ? colorDefs : Object.fromEntries(Object.keys(colorDefs).map((key) => [key, String]));
416
- }
417
- const colors = createColors();
418
- function getColor$1(color, fallback = "reset") {
419
- return colors[color] || colors[fallback];
420
- }
421
- const ansiRegex$1 = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
422
- function stripAnsi$1(text) {
423
- return text.replace(new RegExp(ansiRegex$1, "g"), "");
424
- }
425
- const boxStylePresets = {
426
- solid: {
427
- tl: "┌",
428
- tr: "┐",
429
- bl: "└",
430
- br: "┘",
431
- h: "─",
432
- v: "│"
433
- },
434
- double: {
435
- tl: "╔",
436
- tr: "╗",
437
- bl: "╚",
438
- br: "╝",
439
- h: "═",
440
- v: "║"
441
- },
442
- doubleSingle: {
443
- tl: "╓",
444
- tr: "╖",
445
- bl: "╙",
446
- br: "╜",
447
- h: "─",
448
- v: "║"
449
- },
450
- doubleSingleRounded: {
451
- tl: "╭",
452
- tr: "╮",
453
- bl: "╰",
454
- br: "╯",
455
- h: "─",
456
- v: "║"
457
- },
458
- singleThick: {
459
- tl: "┏",
460
- tr: "┓",
461
- bl: "┗",
462
- br: "┛",
463
- h: "━",
464
- v: "┃"
465
- },
466
- singleDouble: {
467
- tl: "╒",
468
- tr: "╕",
469
- bl: "╘",
470
- br: "╛",
471
- h: "═",
472
- v: "│"
473
- },
474
- singleDoubleRounded: {
475
- tl: "╭",
476
- tr: "╮",
477
- bl: "╰",
478
- br: "╯",
479
- h: "═",
480
- v: "│"
481
- },
482
- rounded: {
483
- tl: "╭",
484
- tr: "╮",
485
- bl: "╰",
486
- br: "╯",
487
- h: "─",
488
- v: "│"
489
- }
490
- };
491
- const defaultStyle = {
492
- borderColor: "white",
493
- borderStyle: "rounded",
494
- valign: "center",
495
- padding: 2,
496
- marginLeft: 1,
497
- marginTop: 1,
498
- marginBottom: 1
499
- };
500
- function box(text, _opts = {}) {
501
- const opts = {
502
- ..._opts,
503
- style: {
504
- ...defaultStyle,
505
- ..._opts.style
506
- }
507
- };
508
- const textLines = text.split("\n");
509
- const boxLines = [];
510
- const _color = getColor$1(opts.style.borderColor);
511
- const borderStyle = { ...typeof opts.style.borderStyle === "string" ? boxStylePresets[opts.style.borderStyle] || boxStylePresets.solid : opts.style.borderStyle };
512
- if (_color) for (const key in borderStyle) borderStyle[key] = _color(borderStyle[key]);
513
- const paddingOffset = opts.style.padding % 2 === 0 ? opts.style.padding : opts.style.padding + 1;
514
- const height = textLines.length + paddingOffset;
515
- const width = Math.max(...textLines.map((line) => line.length)) + paddingOffset;
516
- const widthOffset = width + paddingOffset;
517
- const leftSpace = opts.style.marginLeft > 0 ? " ".repeat(opts.style.marginLeft) : "";
518
- if (opts.style.marginTop > 0) boxLines.push("".repeat(opts.style.marginTop));
519
- if (opts.title) {
520
- const left = borderStyle.h.repeat(Math.floor((width - stripAnsi$1(opts.title).length) / 2));
521
- const right = borderStyle.h.repeat(width - stripAnsi$1(opts.title).length - stripAnsi$1(left).length + paddingOffset);
522
- boxLines.push(`${leftSpace}${borderStyle.tl}${left}${opts.title}${right}${borderStyle.tr}`);
523
- } else boxLines.push(`${leftSpace}${borderStyle.tl}${borderStyle.h.repeat(widthOffset)}${borderStyle.tr}`);
524
- const valignOffset = opts.style.valign === "center" ? Math.floor((height - textLines.length) / 2) : opts.style.valign === "top" ? height - textLines.length - paddingOffset : height - textLines.length;
525
- for (let i = 0; i < height; i++) if (i < valignOffset || i >= valignOffset + textLines.length) boxLines.push(`${leftSpace}${borderStyle.v}${" ".repeat(widthOffset)}${borderStyle.v}`);
526
- else {
527
- const line = textLines[i - valignOffset];
528
- const left = " ".repeat(paddingOffset);
529
- const right = " ".repeat(width - stripAnsi$1(line).length);
530
- boxLines.push(`${leftSpace}${borderStyle.v}${left}${line}${right}${borderStyle.v}`);
531
- }
532
- boxLines.push(`${leftSpace}${borderStyle.bl}${borderStyle.h.repeat(widthOffset)}${borderStyle.br}`);
533
- if (opts.style.marginBottom > 0) boxLines.push("".repeat(opts.style.marginBottom));
534
- return boxLines.join("\n");
535
- }
536
-
537
- //#endregion
538
- //#region ../../node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/shared/consola.36c0034f.mjs
539
- const providers = [
540
- ["APPVEYOR"],
541
- ["AZURE_PIPELINES", "SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],
542
- ["AZURE_STATIC", "INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],
543
- ["APPCIRCLE", "AC_APPCIRCLE"],
544
- ["BAMBOO", "bamboo_planKey"],
545
- ["BITBUCKET", "BITBUCKET_COMMIT"],
546
- ["BITRISE", "BITRISE_IO"],
547
- ["BUDDY", "BUDDY_WORKSPACE_ID"],
548
- ["BUILDKITE"],
549
- ["CIRCLE", "CIRCLECI"],
550
- ["CIRRUS", "CIRRUS_CI"],
551
- [
552
- "CLOUDFLARE_PAGES",
553
- "CF_PAGES",
554
- { ci: true }
555
- ],
556
- ["CODEBUILD", "CODEBUILD_BUILD_ARN"],
557
- ["CODEFRESH", "CF_BUILD_ID"],
558
- ["DRONE"],
559
- ["DRONE", "DRONE_BUILD_EVENT"],
560
- ["DSARI"],
561
- ["GITHUB_ACTIONS"],
562
- ["GITLAB", "GITLAB_CI"],
563
- ["GITLAB", "CI_MERGE_REQUEST_ID"],
564
- ["GOCD", "GO_PIPELINE_LABEL"],
565
- ["LAYERCI"],
566
- ["HUDSON", "HUDSON_URL"],
567
- ["JENKINS", "JENKINS_URL"],
568
- ["MAGNUM"],
569
- ["NETLIFY"],
570
- [
571
- "NETLIFY",
572
- "NETLIFY_LOCAL",
573
- { ci: false }
574
- ],
575
- ["NEVERCODE"],
576
- ["RENDER"],
577
- ["SAIL", "SAILCI"],
578
- ["SEMAPHORE"],
579
- ["SCREWDRIVER"],
580
- ["SHIPPABLE"],
581
- ["SOLANO", "TDDIUM"],
582
- ["STRIDER"],
583
- ["TEAMCITY", "TEAMCITY_VERSION"],
584
- ["TRAVIS"],
585
- ["VERCEL", "NOW_BUILDER"],
586
- ["APPCENTER", "APPCENTER_BUILD_ID"],
587
- [
588
- "CODESANDBOX",
589
- "CODESANDBOX_SSE",
590
- { ci: false }
591
- ],
592
- ["STACKBLITZ"],
593
- ["STORMKIT"],
594
- ["CLEAVR"]
595
- ];
596
- function detectProvider(env$2) {
597
- for (const provider of providers) {
598
- const envName = provider[1] || provider[0];
599
- if (env$2[envName]) return {
600
- name: provider[0].toLowerCase(),
601
- ...provider[2]
602
- };
603
- }
604
- if (env$2.SHELL && env$2.SHELL === "/bin/jsh") return {
605
- name: "stackblitz",
606
- ci: false
607
- };
608
- return {
609
- name: "",
610
- ci: false
611
- };
612
- }
613
- const processShim = typeof process !== "undefined" ? process : {};
614
- const envShim = processShim.env || {};
615
- const providerInfo = detectProvider(envShim);
616
- const nodeENV = typeof process !== "undefined" && process.env && process.env.NODE_ENV || "";
617
- processShim.platform;
618
- providerInfo.name;
619
- const isCI = toBoolean(envShim.CI) || providerInfo.ci !== false;
620
- const hasTTY = toBoolean(processShim.stdout && processShim.stdout.isTTY);
621
- const isDebug = toBoolean(envShim.DEBUG);
622
- const isTest = nodeENV === "test" || toBoolean(envShim.TEST);
623
- toBoolean(envShim.MINIMAL) || isCI || isTest || !hasTTY;
624
- function toBoolean(val) {
625
- return val ? val !== "false" : false;
626
- }
627
- function ansiRegex({ onlyFirst = false } = {}) {
628
- 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("|");
629
- return new RegExp(pattern, onlyFirst ? undefined : "g");
630
- }
631
- const regex = ansiRegex();
632
- function stripAnsi(string) {
633
- if (typeof string !== "string") throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
634
- return string.replace(regex, "");
635
- }
636
- function getDefaultExportFromCjs(x) {
637
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
638
- }
639
- var eastasianwidth = { exports: {} };
640
- (function(module) {
641
- var eaw = {};
642
- module.exports = eaw;
643
- eaw.eastAsianWidth = function(character) {
644
- var x = character.charCodeAt(0);
645
- var y = character.length == 2 ? character.charCodeAt(1) : 0;
646
- var codePoint = x;
647
- if (55296 <= x && x <= 56319 && 56320 <= y && y <= 57343) {
648
- x &= 1023;
649
- y &= 1023;
650
- codePoint = x << 10 | y;
651
- codePoint += 65536;
652
- }
653
- if (12288 == codePoint || 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510) return "F";
654
- if (8361 == codePoint || 65377 <= codePoint && codePoint <= 65470 || 65474 <= codePoint && codePoint <= 65479 || 65482 <= codePoint && codePoint <= 65487 || 65490 <= codePoint && codePoint <= 65495 || 65498 <= codePoint && codePoint <= 65500 || 65512 <= codePoint && codePoint <= 65518) return "H";
655
- if (4352 <= codePoint && codePoint <= 4447 || 4515 <= codePoint && codePoint <= 4519 || 4602 <= codePoint && codePoint <= 4607 || 9001 <= codePoint && codePoint <= 9002 || 11904 <= codePoint && codePoint <= 11929 || 11931 <= codePoint && codePoint <= 12019 || 12032 <= codePoint && codePoint <= 12245 || 12272 <= codePoint && codePoint <= 12283 || 12289 <= codePoint && codePoint <= 12350 || 12353 <= codePoint && codePoint <= 12438 || 12441 <= codePoint && codePoint <= 12543 || 12549 <= codePoint && codePoint <= 12589 || 12593 <= codePoint && codePoint <= 12686 || 12688 <= codePoint && codePoint <= 12730 || 12736 <= codePoint && codePoint <= 12771 || 12784 <= codePoint && codePoint <= 12830 || 12832 <= codePoint && codePoint <= 12871 || 12880 <= codePoint && codePoint <= 13054 || 13056 <= codePoint && codePoint <= 19903 || 19968 <= codePoint && codePoint <= 42124 || 42128 <= codePoint && codePoint <= 42182 || 43360 <= codePoint && codePoint <= 43388 || 44032 <= codePoint && codePoint <= 55203 || 55216 <= codePoint && codePoint <= 55238 || 55243 <= codePoint && codePoint <= 55291 || 63744 <= codePoint && codePoint <= 64255 || 65040 <= codePoint && codePoint <= 65049 || 65072 <= codePoint && codePoint <= 65106 || 65108 <= codePoint && codePoint <= 65126 || 65128 <= codePoint && codePoint <= 65131 || 110592 <= codePoint && codePoint <= 110593 || 127488 <= codePoint && codePoint <= 127490 || 127504 <= codePoint && codePoint <= 127546 || 127552 <= codePoint && codePoint <= 127560 || 127568 <= codePoint && codePoint <= 127569 || 131072 <= codePoint && codePoint <= 194367 || 177984 <= codePoint && codePoint <= 196605 || 196608 <= codePoint && codePoint <= 262141) return "W";
656
- if (32 <= codePoint && codePoint <= 126 || 162 <= codePoint && codePoint <= 163 || 165 <= codePoint && codePoint <= 166 || 172 == codePoint || 175 == codePoint || 10214 <= codePoint && codePoint <= 10221 || 10629 <= codePoint && codePoint <= 10630) return "Na";
657
- if (161 == codePoint || 164 == codePoint || 167 <= codePoint && codePoint <= 168 || 170 == codePoint || 173 <= codePoint && codePoint <= 174 || 176 <= codePoint && codePoint <= 180 || 182 <= codePoint && codePoint <= 186 || 188 <= codePoint && codePoint <= 191 || 198 == codePoint || 208 == codePoint || 215 <= codePoint && codePoint <= 216 || 222 <= codePoint && codePoint <= 225 || 230 == codePoint || 232 <= codePoint && codePoint <= 234 || 236 <= codePoint && codePoint <= 237 || 240 == codePoint || 242 <= codePoint && codePoint <= 243 || 247 <= codePoint && codePoint <= 250 || 252 == codePoint || 254 == codePoint || 257 == codePoint || 273 == codePoint || 275 == codePoint || 283 == codePoint || 294 <= codePoint && codePoint <= 295 || 299 == codePoint || 305 <= codePoint && codePoint <= 307 || 312 == codePoint || 319 <= codePoint && codePoint <= 322 || 324 == codePoint || 328 <= codePoint && codePoint <= 331 || 333 == codePoint || 338 <= codePoint && codePoint <= 339 || 358 <= codePoint && codePoint <= 359 || 363 == codePoint || 462 == codePoint || 464 == codePoint || 466 == codePoint || 468 == codePoint || 470 == codePoint || 472 == codePoint || 474 == codePoint || 476 == codePoint || 593 == codePoint || 609 == codePoint || 708 == codePoint || 711 == codePoint || 713 <= codePoint && codePoint <= 715 || 717 == codePoint || 720 == codePoint || 728 <= codePoint && codePoint <= 731 || 733 == codePoint || 735 == codePoint || 768 <= codePoint && codePoint <= 879 || 913 <= codePoint && codePoint <= 929 || 931 <= codePoint && codePoint <= 937 || 945 <= codePoint && codePoint <= 961 || 963 <= codePoint && codePoint <= 969 || 1025 == codePoint || 1040 <= codePoint && codePoint <= 1103 || 1105 == codePoint || 8208 == codePoint || 8211 <= codePoint && codePoint <= 8214 || 8216 <= codePoint && codePoint <= 8217 || 8220 <= codePoint && codePoint <= 8221 || 8224 <= codePoint && codePoint <= 8226 || 8228 <= codePoint && codePoint <= 8231 || 8240 == codePoint || 8242 <= codePoint && codePoint <= 8243 || 8245 == codePoint || 8251 == codePoint || 8254 == codePoint || 8308 == codePoint || 8319 == codePoint || 8321 <= codePoint && codePoint <= 8324 || 8364 == codePoint || 8451 == codePoint || 8453 == codePoint || 8457 == codePoint || 8467 == codePoint || 8470 == codePoint || 8481 <= codePoint && codePoint <= 8482 || 8486 == codePoint || 8491 == codePoint || 8531 <= codePoint && codePoint <= 8532 || 8539 <= codePoint && codePoint <= 8542 || 8544 <= codePoint && codePoint <= 8555 || 8560 <= codePoint && codePoint <= 8569 || 8585 == codePoint || 8592 <= codePoint && codePoint <= 8601 || 8632 <= codePoint && codePoint <= 8633 || 8658 == codePoint || 8660 == codePoint || 8679 == codePoint || 8704 == codePoint || 8706 <= codePoint && codePoint <= 8707 || 8711 <= codePoint && codePoint <= 8712 || 8715 == codePoint || 8719 == codePoint || 8721 == codePoint || 8725 == codePoint || 8730 == codePoint || 8733 <= codePoint && codePoint <= 8736 || 8739 == codePoint || 8741 == codePoint || 8743 <= codePoint && codePoint <= 8748 || 8750 == codePoint || 8756 <= codePoint && codePoint <= 8759 || 8764 <= codePoint && codePoint <= 8765 || 8776 == codePoint || 8780 == codePoint || 8786 == codePoint || 8800 <= codePoint && codePoint <= 8801 || 8804 <= codePoint && codePoint <= 8807 || 8810 <= codePoint && codePoint <= 8811 || 8814 <= codePoint && codePoint <= 8815 || 8834 <= codePoint && codePoint <= 8835 || 8838 <= codePoint && codePoint <= 8839 || 8853 == codePoint || 8857 == codePoint || 8869 == codePoint || 8895 == codePoint || 8978 == codePoint || 9312 <= codePoint && codePoint <= 9449 || 9451 <= codePoint && codePoint <= 9547 || 9552 <= codePoint && codePoint <= 9587 || 9600 <= codePoint && codePoint <= 9615 || 9618 <= codePoint && codePoint <= 9621 || 9632 <= codePoint && codePoint <= 9633 || 9635 <= codePoint && codePoint <= 9641 || 9650 <= codePoint && codePoint <= 9651 || 9654 <= codePoint && codePoint <= 9655 || 9660 <= codePoint && codePoint <= 9661 || 9664 <= codePoint && codePoint <= 9665 || 9670 <= codePoint && codePoint <= 9672 || 9675 == codePoint || 9678 <= codePoint && codePoint <= 9681 || 9698 <= codePoint && codePoint <= 9701 || 9711 == codePoint || 9733 <= codePoint && codePoint <= 9734 || 9737 == codePoint || 9742 <= codePoint && codePoint <= 9743 || 9748 <= codePoint && codePoint <= 9749 || 9756 == codePoint || 9758 == codePoint || 9792 == codePoint || 9794 == codePoint || 9824 <= codePoint && codePoint <= 9825 || 9827 <= codePoint && codePoint <= 9829 || 9831 <= codePoint && codePoint <= 9834 || 9836 <= codePoint && codePoint <= 9837 || 9839 == codePoint || 9886 <= codePoint && codePoint <= 9887 || 9918 <= codePoint && codePoint <= 9919 || 9924 <= codePoint && codePoint <= 9933 || 9935 <= codePoint && codePoint <= 9953 || 9955 == codePoint || 9960 <= codePoint && codePoint <= 9983 || 10045 == codePoint || 10071 == codePoint || 10102 <= codePoint && codePoint <= 10111 || 11093 <= codePoint && codePoint <= 11097 || 12872 <= codePoint && codePoint <= 12879 || 57344 <= codePoint && codePoint <= 63743 || 65024 <= codePoint && codePoint <= 65039 || 65533 == codePoint || 127232 <= codePoint && codePoint <= 127242 || 127248 <= codePoint && codePoint <= 127277 || 127280 <= codePoint && codePoint <= 127337 || 127344 <= codePoint && codePoint <= 127386 || 917760 <= codePoint && codePoint <= 917999 || 983040 <= codePoint && codePoint <= 1048573 || 1048576 <= codePoint && codePoint <= 1114109) return "A";
658
- return "N";
659
- };
660
- eaw.characterLength = function(character) {
661
- var code = this.eastAsianWidth(character);
662
- if (code == "F" || code == "W" || code == "A") return 2;
663
- else return 1;
664
- };
665
- function stringToArray(string) {
666
- return string.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
667
- }
668
- eaw.length = function(string) {
669
- var characters = stringToArray(string);
670
- var len = 0;
671
- for (var i = 0; i < characters.length; i++) len = len + this.characterLength(characters[i]);
672
- return len;
673
- };
674
- eaw.slice = function(text, start, end) {
675
- textLen = eaw.length(text);
676
- start = start ? start : 0;
677
- end = end ? end : 1;
678
- if (start < 0) start = textLen + start;
679
- if (end < 0) end = textLen + end;
680
- var result = "";
681
- var eawLen = 0;
682
- var chars = stringToArray(text);
683
- for (var i = 0; i < chars.length; i++) {
684
- var char = chars[i];
685
- var charLen = eaw.length(char);
686
- if (eawLen >= start - (charLen == 2 ? 1 : 0)) if (eawLen + charLen <= end) result += char;
687
- else break;
688
- eawLen += charLen;
689
- }
690
- return result;
691
- };
692
- })(eastasianwidth);
693
- var eastasianwidthExports = eastasianwidth.exports;
694
- const eastAsianWidth = /*@__PURE__*/ getDefaultExportFromCjs(eastasianwidthExports);
695
- const emojiRegex = () => {
696
- 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\u26D3\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](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\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]|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\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])?|[\uDFC3\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\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-\uDDF5\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]|\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(?:[\uDC08\uDC26](?:\u200D\u2B1B)?|[\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\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\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-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC15(?:\u200D\uD83E\uDDBA)?|\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-\uDDB3\uDDBC\uDDBD])|\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]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\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]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\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]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\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]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\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]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\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-\uDDB3\uDDBC\uDDBD])|\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]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\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\uDD3D\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-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\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-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1))|\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]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\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;
697
- };
698
- function stringWidth$1(string, options) {
699
- if (typeof string !== "string" || string.length === 0) return 0;
700
- options = {
701
- ambiguousIsNarrow: true,
702
- countAnsiEscapeCodes: false,
703
- ...options
704
- };
705
- if (!options.countAnsiEscapeCodes) string = stripAnsi(string);
706
- if (string.length === 0) return 0;
707
- const ambiguousCharacterWidth = options.ambiguousIsNarrow ? 1 : 2;
708
- let width = 0;
709
- for (const { segment: character } of new Intl.Segmenter().segment(string)) {
710
- const codePoint = character.codePointAt(0);
711
- if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) continue;
712
- if (codePoint >= 768 && codePoint <= 879) continue;
713
- if (emojiRegex().test(character)) {
714
- width += 2;
715
- continue;
716
- }
717
- const code = eastAsianWidth.eastAsianWidth(character);
718
- switch (code) {
719
- case "F":
720
- case "W": {
721
- width += 2;
722
- break;
723
- }
724
- case "A": {
725
- width += ambiguousCharacterWidth;
726
- break;
727
- }
728
- default: width += 1;
729
- }
730
- }
731
- return width;
732
- }
733
- function isUnicodeSupported() {
734
- if (process$1.platform !== "win32") return process$1.env.TERM !== "linux";
735
- return Boolean(process$1.env.CI) || Boolean(process$1.env.WT_SESSION) || Boolean(process$1.env.TERMINUS_SUBLIME) || process$1.env.ConEmuTask === "{cmd::Cmder}" || process$1.env.TERM_PROGRAM === "Terminus-Sublime" || process$1.env.TERM_PROGRAM === "vscode" || process$1.env.TERM === "xterm-256color" || process$1.env.TERM === "alacritty" || process$1.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
736
- }
737
- const TYPE_COLOR_MAP = {
738
- info: "cyan",
739
- fail: "red",
740
- success: "green",
741
- ready: "green",
742
- start: "magenta"
743
- };
744
- const LEVEL_COLOR_MAP = {
745
- 0: "red",
746
- 1: "yellow"
747
- };
748
- const unicode = isUnicodeSupported();
749
- const s = (c, fallback) => unicode ? c : fallback;
750
- const TYPE_ICONS = {
751
- error: s("✖", "×"),
752
- fatal: s("✖", "×"),
753
- ready: s("✔", "√"),
754
- warn: s("⚠", "‼"),
755
- info: s("ℹ", "i"),
756
- success: s("✔", "√"),
757
- debug: s("⚙", "D"),
758
- trace: s("→", "→"),
759
- fail: s("✖", "×"),
760
- start: s("◐", "o"),
761
- log: ""
762
- };
763
- function stringWidth(str) {
764
- if (!Intl.Segmenter) return stripAnsi$1(str).length;
765
- return stringWidth$1(str);
766
- }
767
- var FancyReporter = class extends BasicReporter {
768
- formatStack(stack) {
769
- return "\n" + parseStack(stack).map((line) => " " + line.replace(/^at +/, (m) => colors.gray(m)).replace(/\((.+)\)/, (_, m) => `(${colors.cyan(m)})`)).join("\n");
770
- }
771
- formatType(logObj, isBadge, opts) {
772
- const typeColor = TYPE_COLOR_MAP[logObj.type] || LEVEL_COLOR_MAP[logObj.level] || "gray";
773
- if (isBadge) return getBgColor(typeColor)(colors.black(` ${logObj.type.toUpperCase()} `));
774
- const _type = typeof TYPE_ICONS[logObj.type] === "string" ? TYPE_ICONS[logObj.type] : logObj.icon || logObj.type;
775
- return _type ? getColor(typeColor)(_type) : "";
776
- }
777
- formatLogObj(logObj, opts) {
778
- const [message, ...additional] = this.formatArgs(logObj.args, opts).split("\n");
779
- if (logObj.type === "box") return box(characterFormat(message + (additional.length > 0 ? "\n" + additional.join("\n") : "")), {
780
- title: logObj.title ? characterFormat(logObj.title) : void 0,
781
- style: logObj.style
782
- });
783
- const date = this.formatDate(logObj.date, opts);
784
- const coloredDate = date && colors.gray(date);
785
- const isBadge = logObj.badge ?? logObj.level < 2;
786
- const type = this.formatType(logObj, isBadge, opts);
787
- const tag = logObj.tag ? colors.gray(logObj.tag) : "";
788
- let line;
789
- const left = this.filterAndJoin([type, characterFormat(message)]);
790
- const right = this.filterAndJoin(opts.columns ? [tag, coloredDate] : [tag]);
791
- const space = (opts.columns || 0) - stringWidth(left) - stringWidth(right) - 2;
792
- line = space > 0 && (opts.columns || 0) >= 80 ? left + " ".repeat(space) + right : (right ? `${colors.gray(`[${right}]`)} ` : "") + left;
793
- line += characterFormat(additional.length > 0 ? "\n" + additional.join("\n") : "");
794
- if (logObj.type === "trace") {
795
- const _err = new Error("Trace: " + logObj.message);
796
- line += this.formatStack(_err.stack || "");
797
- }
798
- return isBadge ? "\n" + line + "\n" : line;
799
- }
800
- };
801
- function characterFormat(str) {
802
- return str.replace(/`([^`]+)`/gm, (_, m) => colors.cyan(m)).replace(/\s+_([^_]+)_\s+/gm, (_, m) => ` ${colors.underline(m)} `);
803
- }
804
- function getColor(color = "white") {
805
- return colors[color] || colors.white;
806
- }
807
- function getBgColor(color = "bgWhite") {
808
- return colors[`bg${color[0].toUpperCase()}${color.slice(1)}`] || colors.bgWhite;
809
- }
810
- function createConsola(options = {}) {
811
- let level = _getDefaultLogLevel();
812
- if (process.env.CONSOLA_LEVEL) level = Number.parseInt(process.env.CONSOLA_LEVEL) ?? level;
813
- const consola2 = createConsola$1({
814
- level,
815
- defaults: { level },
816
- stdout: process.stdout,
817
- stderr: process.stderr,
818
- prompt: (...args) => import("./prompt-DjjlOckE.mjs").then((m) => m.prompt(...args)),
819
- reporters: options.reporters || [options.fancy ?? !(isCI || isTest) ? new FancyReporter() : new BasicReporter()],
820
- ...options
821
- });
822
- return consola2;
823
- }
824
- function _getDefaultLogLevel() {
825
- if (isDebug) return LogLevels.debug;
826
- if (isTest) return LogLevels.warn;
827
- return LogLevels.info;
828
- }
829
- const consola = createConsola();
830
-
831
- //#endregion
832
- export { colors as colors$1, createConsola, getDefaultExportFromCjs, isUnicodeSupported };