rolldown 1.0.0-beta.1-commit.35fb1f8 → 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-Busnx6mE.cjs → src-Db20iysW.cjs} +25 -9
  16. package/dist/shared/{src-DNOXsZr0.mjs → src-mclDryX0.mjs} +25 -9
  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 +42 -3
  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,859 +0,0 @@
1
- "use strict";
2
- const require_chunk = require('./chunk-qZFfknuJ.cjs');
3
- const node_process = require_chunk.__toESM(require("node:process"));
4
- const node_path = require_chunk.__toESM(require("node:path"));
5
- const node_util = require_chunk.__toESM(require("node:util"));
6
- const node_tty = require_chunk.__toESM(require("node:tty"));
7
-
8
- //#region ../../node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/core.mjs
9
- const LogLevels = {
10
- silent: Number.NEGATIVE_INFINITY,
11
- fatal: 0,
12
- error: 0,
13
- warn: 1,
14
- log: 2,
15
- info: 3,
16
- success: 3,
17
- fail: 3,
18
- ready: 3,
19
- start: 3,
20
- box: 3,
21
- debug: 4,
22
- trace: 5,
23
- verbose: Number.POSITIVE_INFINITY
24
- };
25
- const LogTypes = {
26
- silent: { level: -1 },
27
- fatal: { level: LogLevels.fatal },
28
- error: { level: LogLevels.error },
29
- warn: { level: LogLevels.warn },
30
- log: { level: LogLevels.log },
31
- info: { level: LogLevels.info },
32
- success: { level: LogLevels.success },
33
- fail: { level: LogLevels.fail },
34
- ready: { level: LogLevels.info },
35
- start: { level: LogLevels.info },
36
- box: { level: LogLevels.info },
37
- debug: { level: LogLevels.debug },
38
- trace: { level: LogLevels.trace },
39
- verbose: { level: LogLevels.verbose }
40
- };
41
- function isObject(value) {
42
- return value !== null && typeof value === "object";
43
- }
44
- function _defu(baseObject, defaults, namespace = ".", merger) {
45
- if (!isObject(defaults)) return _defu(baseObject, {}, namespace, merger);
46
- const object = Object.assign({}, defaults);
47
- for (const key in baseObject) {
48
- if (key === "__proto__" || key === "constructor") continue;
49
- const value = baseObject[key];
50
- if (value === null || value === void 0) continue;
51
- if (merger && merger(object, key, value, namespace)) continue;
52
- if (Array.isArray(value) && Array.isArray(object[key])) object[key] = [...value, ...object[key]];
53
- else if (isObject(value) && isObject(object[key])) object[key] = _defu(value, object[key], (namespace ? `${namespace}.` : "") + key.toString(), merger);
54
- else object[key] = value;
55
- }
56
- return object;
57
- }
58
- function createDefu(merger) {
59
- return (...arguments_) => arguments_.reduce((p, c) => _defu(p, c, "", merger), {});
60
- }
61
- const defu = createDefu();
62
- function isPlainObject(obj) {
63
- return Object.prototype.toString.call(obj) === "[object Object]";
64
- }
65
- function isLogObj(arg) {
66
- if (!isPlainObject(arg)) return false;
67
- if (!arg.message && !arg.args) return false;
68
- if (arg.stack) return false;
69
- return true;
70
- }
71
- let paused = false;
72
- const queue = [];
73
- var Consola = class Consola {
74
- constructor(options = {}) {
75
- const types = options.types || LogTypes;
76
- this.options = defu({
77
- ...options,
78
- defaults: { ...options.defaults },
79
- level: _normalizeLogLevel(options.level, types),
80
- reporters: [...options.reporters || []]
81
- }, {
82
- types: LogTypes,
83
- throttle: 1e3,
84
- throttleMin: 5,
85
- formatOptions: {
86
- date: true,
87
- colors: false,
88
- compact: true
89
- }
90
- });
91
- for (const type in types) {
92
- const defaults = {
93
- type,
94
- ...this.options.defaults,
95
- ...types[type]
96
- };
97
- this[type] = this._wrapLogFn(defaults);
98
- this[type].raw = this._wrapLogFn(defaults, true);
99
- }
100
- if (this.options.mockFn) this.mockTypes();
101
- this._lastLog = {};
102
- }
103
- get level() {
104
- return this.options.level;
105
- }
106
- set level(level) {
107
- this.options.level = _normalizeLogLevel(level, this.options.types, this.options.level);
108
- }
109
- prompt(message, opts) {
110
- if (!this.options.prompt) throw new Error("prompt is not supported!");
111
- return this.options.prompt(message, opts);
112
- }
113
- create(options) {
114
- const instance = new Consola({
115
- ...this.options,
116
- ...options
117
- });
118
- if (this._mockFn) instance.mockTypes(this._mockFn);
119
- return instance;
120
- }
121
- withDefaults(defaults) {
122
- return this.create({
123
- ...this.options,
124
- defaults: {
125
- ...this.options.defaults,
126
- ...defaults
127
- }
128
- });
129
- }
130
- withTag(tag) {
131
- return this.withDefaults({ tag: this.options.defaults.tag ? this.options.defaults.tag + ":" + tag : tag });
132
- }
133
- addReporter(reporter) {
134
- this.options.reporters.push(reporter);
135
- return this;
136
- }
137
- removeReporter(reporter) {
138
- if (reporter) {
139
- const i = this.options.reporters.indexOf(reporter);
140
- if (i >= 0) return this.options.reporters.splice(i, 1);
141
- } else this.options.reporters.splice(0);
142
- return this;
143
- }
144
- setReporters(reporters) {
145
- this.options.reporters = Array.isArray(reporters) ? reporters : [reporters];
146
- return this;
147
- }
148
- wrapAll() {
149
- this.wrapConsole();
150
- this.wrapStd();
151
- }
152
- restoreAll() {
153
- this.restoreConsole();
154
- this.restoreStd();
155
- }
156
- wrapConsole() {
157
- for (const type in this.options.types) {
158
- if (!console["__" + type]) console["__" + type] = console[type];
159
- console[type] = this[type].raw;
160
- }
161
- }
162
- restoreConsole() {
163
- for (const type in this.options.types) if (console["__" + type]) {
164
- console[type] = console["__" + type];
165
- delete console["__" + type];
166
- }
167
- }
168
- wrapStd() {
169
- this._wrapStream(this.options.stdout, "log");
170
- this._wrapStream(this.options.stderr, "log");
171
- }
172
- _wrapStream(stream, type) {
173
- if (!stream) return;
174
- if (!stream.__write) stream.__write = stream.write;
175
- stream.write = (data) => {
176
- this[type].raw(String(data).trim());
177
- };
178
- }
179
- restoreStd() {
180
- this._restoreStream(this.options.stdout);
181
- this._restoreStream(this.options.stderr);
182
- }
183
- _restoreStream(stream) {
184
- if (!stream) return;
185
- if (stream.__write) {
186
- stream.write = stream.__write;
187
- delete stream.__write;
188
- }
189
- }
190
- pauseLogs() {
191
- paused = true;
192
- }
193
- resumeLogs() {
194
- paused = false;
195
- const _queue = queue.splice(0);
196
- for (const item of _queue) item[0]._logFn(item[1], item[2]);
197
- }
198
- mockTypes(mockFn) {
199
- const _mockFn = mockFn || this.options.mockFn;
200
- this._mockFn = _mockFn;
201
- if (typeof _mockFn !== "function") return;
202
- for (const type in this.options.types) {
203
- this[type] = _mockFn(type, this.options.types[type]) || this[type];
204
- this[type].raw = this[type];
205
- }
206
- }
207
- _wrapLogFn(defaults, isRaw) {
208
- return (...args) => {
209
- if (paused) {
210
- queue.push([
211
- this,
212
- defaults,
213
- args,
214
- isRaw
215
- ]);
216
- return;
217
- }
218
- return this._logFn(defaults, args, isRaw);
219
- };
220
- }
221
- _logFn(defaults, args, isRaw) {
222
- if ((defaults.level || 0) > this.level) return false;
223
- const logObj = {
224
- date: /* @__PURE__ */ new Date(),
225
- args: [],
226
- ...defaults,
227
- level: _normalizeLogLevel(defaults.level, this.options.types)
228
- };
229
- if (!isRaw && args.length === 1 && isLogObj(args[0])) Object.assign(logObj, args[0]);
230
- else logObj.args = [...args];
231
- if (logObj.message) {
232
- logObj.args.unshift(logObj.message);
233
- delete logObj.message;
234
- }
235
- if (logObj.additional) {
236
- if (!Array.isArray(logObj.additional)) logObj.additional = logObj.additional.split("\n");
237
- logObj.args.push("\n" + logObj.additional.join("\n"));
238
- delete logObj.additional;
239
- }
240
- logObj.type = typeof logObj.type === "string" ? logObj.type.toLowerCase() : "log";
241
- logObj.tag = typeof logObj.tag === "string" ? logObj.tag : "";
242
- const resolveLog = (newLog = false) => {
243
- const repeated = (this._lastLog.count || 0) - this.options.throttleMin;
244
- if (this._lastLog.object && repeated > 0) {
245
- const args2 = [...this._lastLog.object.args];
246
- if (repeated > 1) args2.push(`(repeated ${repeated} times)`);
247
- this._log({
248
- ...this._lastLog.object,
249
- args: args2
250
- });
251
- this._lastLog.count = 1;
252
- }
253
- if (newLog) {
254
- this._lastLog.object = logObj;
255
- this._log(logObj);
256
- }
257
- };
258
- clearTimeout(this._lastLog.timeout);
259
- const diffTime = this._lastLog.time && logObj.date ? logObj.date.getTime() - this._lastLog.time.getTime() : 0;
260
- this._lastLog.time = logObj.date;
261
- if (diffTime < this.options.throttle) try {
262
- const serializedLog = JSON.stringify([
263
- logObj.type,
264
- logObj.tag,
265
- logObj.args
266
- ]);
267
- const isSameLog = this._lastLog.serialized === serializedLog;
268
- this._lastLog.serialized = serializedLog;
269
- if (isSameLog) {
270
- this._lastLog.count = (this._lastLog.count || 0) + 1;
271
- if (this._lastLog.count > this.options.throttleMin) {
272
- this._lastLog.timeout = setTimeout(resolveLog, this.options.throttle);
273
- return;
274
- }
275
- }
276
- } catch {}
277
- resolveLog(true);
278
- }
279
- _log(logObj) {
280
- for (const reporter of this.options.reporters) reporter.log(logObj, { options: this.options });
281
- }
282
- };
283
- function _normalizeLogLevel(input, types = {}, defaultLevel = 3) {
284
- if (input === void 0) return defaultLevel;
285
- if (typeof input === "number") return input;
286
- if (types[input] && types[input].level !== void 0) return types[input].level;
287
- return defaultLevel;
288
- }
289
- Consola.prototype.add = Consola.prototype.addReporter;
290
- Consola.prototype.remove = Consola.prototype.removeReporter;
291
- Consola.prototype.clear = Consola.prototype.removeReporter;
292
- Consola.prototype.withScope = Consola.prototype.withTag;
293
- Consola.prototype.mock = Consola.prototype.mockTypes;
294
- Consola.prototype.pause = Consola.prototype.pauseLogs;
295
- Consola.prototype.resume = Consola.prototype.resumeLogs;
296
- function createConsola$1(options = {}) {
297
- return new Consola(options);
298
- }
299
-
300
- //#endregion
301
- //#region ../../node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/shared/consola.06ad8a64.mjs
302
- function parseStack(stack) {
303
- const cwd = process.cwd() + node_path.sep;
304
- const lines = stack.split("\n").splice(1).map((l) => l.trim().replace("file://", "").replace(cwd, ""));
305
- return lines;
306
- }
307
- function writeStream(data, stream) {
308
- const write = stream.__write || stream.write;
309
- return write.call(stream, data);
310
- }
311
- const bracket = (x) => x ? `[${x}]` : "";
312
- var BasicReporter = class {
313
- formatStack(stack, opts) {
314
- return " " + parseStack(stack).join("\n ");
315
- }
316
- formatArgs(args, opts) {
317
- const _args = args.map((arg) => {
318
- if (arg && typeof arg.stack === "string") return arg.message + "\n" + this.formatStack(arg.stack, opts);
319
- return arg;
320
- });
321
- return (0, node_util.formatWithOptions)(opts, ..._args);
322
- }
323
- formatDate(date, opts) {
324
- return opts.date ? date.toLocaleTimeString() : "";
325
- }
326
- filterAndJoin(arr) {
327
- return arr.filter(Boolean).join(" ");
328
- }
329
- formatLogObj(logObj, opts) {
330
- const message = this.formatArgs(logObj.args, opts);
331
- if (logObj.type === "box") return "\n" + [
332
- bracket(logObj.tag),
333
- logObj.title && logObj.title,
334
- ...message.split("\n")
335
- ].filter(Boolean).map((l) => " > " + l).join("\n") + "\n";
336
- return this.filterAndJoin([
337
- bracket(logObj.type),
338
- bracket(logObj.tag),
339
- message
340
- ]);
341
- }
342
- log(logObj, ctx) {
343
- const line = this.formatLogObj(logObj, {
344
- columns: ctx.options.stdout.columns || 0,
345
- ...ctx.options.formatOptions
346
- });
347
- return writeStream(line + "\n", logObj.level < 2 ? ctx.options.stderr || process.stderr : ctx.options.stdout || process.stdout);
348
- }
349
- };
350
-
351
- //#endregion
352
- //#region ../../node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/utils.mjs
353
- const { env = {}, argv = [], platform = "" } = typeof process === "undefined" ? {} : process;
354
- const isDisabled = "NO_COLOR" in env || argv.includes("--no-color");
355
- const isForced = "FORCE_COLOR" in env || argv.includes("--color");
356
- const isWindows = platform === "win32";
357
- const isDumbTerminal = env.TERM === "dumb";
358
- const isCompatibleTerminal = node_tty && node_tty.isatty && node_tty.isatty(1) && env.TERM && !isDumbTerminal;
359
- const isCI$1 = "CI" in env && ("GITHUB_ACTIONS" in env || "GITLAB_CI" in env || "CIRCLECI" in env);
360
- const isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI$1);
361
- 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)) {
362
- return head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
363
- }
364
- function clearBleed(index, string, open, close, replace) {
365
- return index < 0 ? open + string + close : open + replaceClose(index, string, close, replace) + close;
366
- }
367
- function filterEmpty(open, close, replace = open, at = open.length + 1) {
368
- return (string) => string || !(string === "" || string === void 0) ? clearBleed(("" + string).indexOf(close, at), string, open, close, replace) : "";
369
- }
370
- function init(open, close, replace) {
371
- return filterEmpty(`\x1B[${open}m`, `\x1B[${close}m`, replace);
372
- }
373
- const colorDefs = {
374
- reset: init(0, 0),
375
- bold: init(1, 22, "\x1B[22m\x1B[1m"),
376
- dim: init(2, 22, "\x1B[22m\x1B[2m"),
377
- italic: init(3, 23),
378
- underline: init(4, 24),
379
- inverse: init(7, 27),
380
- hidden: init(8, 28),
381
- strikethrough: init(9, 29),
382
- black: init(30, 39),
383
- red: init(31, 39),
384
- green: init(32, 39),
385
- yellow: init(33, 39),
386
- blue: init(34, 39),
387
- magenta: init(35, 39),
388
- cyan: init(36, 39),
389
- white: init(37, 39),
390
- gray: init(90, 39),
391
- bgBlack: init(40, 49),
392
- bgRed: init(41, 49),
393
- bgGreen: init(42, 49),
394
- bgYellow: init(43, 49),
395
- bgBlue: init(44, 49),
396
- bgMagenta: init(45, 49),
397
- bgCyan: init(46, 49),
398
- bgWhite: init(47, 49),
399
- blackBright: init(90, 39),
400
- redBright: init(91, 39),
401
- greenBright: init(92, 39),
402
- yellowBright: init(93, 39),
403
- blueBright: init(94, 39),
404
- magentaBright: init(95, 39),
405
- cyanBright: init(96, 39),
406
- whiteBright: init(97, 39),
407
- bgBlackBright: init(100, 49),
408
- bgRedBright: init(101, 49),
409
- bgGreenBright: init(102, 49),
410
- bgYellowBright: init(103, 49),
411
- bgBlueBright: init(104, 49),
412
- bgMagentaBright: init(105, 49),
413
- bgCyanBright: init(106, 49),
414
- bgWhiteBright: init(107, 49)
415
- };
416
- function createColors(useColor = isColorSupported) {
417
- return useColor ? colorDefs : Object.fromEntries(Object.keys(colorDefs).map((key) => [key, String]));
418
- }
419
- const colors = createColors();
420
- function getColor$1(color, fallback = "reset") {
421
- return colors[color] || colors[fallback];
422
- }
423
- 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("|");
424
- function stripAnsi$1(text) {
425
- return text.replace(new RegExp(ansiRegex$1, "g"), "");
426
- }
427
- const boxStylePresets = {
428
- solid: {
429
- tl: "┌",
430
- tr: "┐",
431
- bl: "└",
432
- br: "┘",
433
- h: "─",
434
- v: "│"
435
- },
436
- double: {
437
- tl: "╔",
438
- tr: "╗",
439
- bl: "╚",
440
- br: "╝",
441
- h: "═",
442
- v: "║"
443
- },
444
- doubleSingle: {
445
- tl: "╓",
446
- tr: "╖",
447
- bl: "╙",
448
- br: "╜",
449
- h: "─",
450
- v: "║"
451
- },
452
- doubleSingleRounded: {
453
- tl: "╭",
454
- tr: "╮",
455
- bl: "╰",
456
- br: "╯",
457
- h: "─",
458
- v: "║"
459
- },
460
- singleThick: {
461
- tl: "┏",
462
- tr: "┓",
463
- bl: "┗",
464
- br: "┛",
465
- h: "━",
466
- v: "┃"
467
- },
468
- singleDouble: {
469
- tl: "╒",
470
- tr: "╕",
471
- bl: "╘",
472
- br: "╛",
473
- h: "═",
474
- v: "│"
475
- },
476
- singleDoubleRounded: {
477
- tl: "╭",
478
- tr: "╮",
479
- bl: "╰",
480
- br: "╯",
481
- h: "═",
482
- v: "│"
483
- },
484
- rounded: {
485
- tl: "╭",
486
- tr: "╮",
487
- bl: "╰",
488
- br: "╯",
489
- h: "─",
490
- v: "│"
491
- }
492
- };
493
- const defaultStyle = {
494
- borderColor: "white",
495
- borderStyle: "rounded",
496
- valign: "center",
497
- padding: 2,
498
- marginLeft: 1,
499
- marginTop: 1,
500
- marginBottom: 1
501
- };
502
- function box(text, _opts = {}) {
503
- const opts = {
504
- ..._opts,
505
- style: {
506
- ...defaultStyle,
507
- ..._opts.style
508
- }
509
- };
510
- const textLines = text.split("\n");
511
- const boxLines = [];
512
- const _color = getColor$1(opts.style.borderColor);
513
- const borderStyle = { ...typeof opts.style.borderStyle === "string" ? boxStylePresets[opts.style.borderStyle] || boxStylePresets.solid : opts.style.borderStyle };
514
- if (_color) for (const key in borderStyle) borderStyle[key] = _color(borderStyle[key]);
515
- const paddingOffset = opts.style.padding % 2 === 0 ? opts.style.padding : opts.style.padding + 1;
516
- const height = textLines.length + paddingOffset;
517
- const width = Math.max(...textLines.map((line) => line.length)) + paddingOffset;
518
- const widthOffset = width + paddingOffset;
519
- const leftSpace = opts.style.marginLeft > 0 ? " ".repeat(opts.style.marginLeft) : "";
520
- if (opts.style.marginTop > 0) boxLines.push("".repeat(opts.style.marginTop));
521
- if (opts.title) {
522
- const left = borderStyle.h.repeat(Math.floor((width - stripAnsi$1(opts.title).length) / 2));
523
- const right = borderStyle.h.repeat(width - stripAnsi$1(opts.title).length - stripAnsi$1(left).length + paddingOffset);
524
- boxLines.push(`${leftSpace}${borderStyle.tl}${left}${opts.title}${right}${borderStyle.tr}`);
525
- } else boxLines.push(`${leftSpace}${borderStyle.tl}${borderStyle.h.repeat(widthOffset)}${borderStyle.tr}`);
526
- const valignOffset = opts.style.valign === "center" ? Math.floor((height - textLines.length) / 2) : opts.style.valign === "top" ? height - textLines.length - paddingOffset : height - textLines.length;
527
- for (let i = 0; i < height; i++) if (i < valignOffset || i >= valignOffset + textLines.length) boxLines.push(`${leftSpace}${borderStyle.v}${" ".repeat(widthOffset)}${borderStyle.v}`);
528
- else {
529
- const line = textLines[i - valignOffset];
530
- const left = " ".repeat(paddingOffset);
531
- const right = " ".repeat(width - stripAnsi$1(line).length);
532
- boxLines.push(`${leftSpace}${borderStyle.v}${left}${line}${right}${borderStyle.v}`);
533
- }
534
- boxLines.push(`${leftSpace}${borderStyle.bl}${borderStyle.h.repeat(widthOffset)}${borderStyle.br}`);
535
- if (opts.style.marginBottom > 0) boxLines.push("".repeat(opts.style.marginBottom));
536
- return boxLines.join("\n");
537
- }
538
-
539
- //#endregion
540
- //#region ../../node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/shared/consola.36c0034f.mjs
541
- const providers = [
542
- ["APPVEYOR"],
543
- ["AZURE_PIPELINES", "SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],
544
- ["AZURE_STATIC", "INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],
545
- ["APPCIRCLE", "AC_APPCIRCLE"],
546
- ["BAMBOO", "bamboo_planKey"],
547
- ["BITBUCKET", "BITBUCKET_COMMIT"],
548
- ["BITRISE", "BITRISE_IO"],
549
- ["BUDDY", "BUDDY_WORKSPACE_ID"],
550
- ["BUILDKITE"],
551
- ["CIRCLE", "CIRCLECI"],
552
- ["CIRRUS", "CIRRUS_CI"],
553
- [
554
- "CLOUDFLARE_PAGES",
555
- "CF_PAGES",
556
- { ci: true }
557
- ],
558
- ["CODEBUILD", "CODEBUILD_BUILD_ARN"],
559
- ["CODEFRESH", "CF_BUILD_ID"],
560
- ["DRONE"],
561
- ["DRONE", "DRONE_BUILD_EVENT"],
562
- ["DSARI"],
563
- ["GITHUB_ACTIONS"],
564
- ["GITLAB", "GITLAB_CI"],
565
- ["GITLAB", "CI_MERGE_REQUEST_ID"],
566
- ["GOCD", "GO_PIPELINE_LABEL"],
567
- ["LAYERCI"],
568
- ["HUDSON", "HUDSON_URL"],
569
- ["JENKINS", "JENKINS_URL"],
570
- ["MAGNUM"],
571
- ["NETLIFY"],
572
- [
573
- "NETLIFY",
574
- "NETLIFY_LOCAL",
575
- { ci: false }
576
- ],
577
- ["NEVERCODE"],
578
- ["RENDER"],
579
- ["SAIL", "SAILCI"],
580
- ["SEMAPHORE"],
581
- ["SCREWDRIVER"],
582
- ["SHIPPABLE"],
583
- ["SOLANO", "TDDIUM"],
584
- ["STRIDER"],
585
- ["TEAMCITY", "TEAMCITY_VERSION"],
586
- ["TRAVIS"],
587
- ["VERCEL", "NOW_BUILDER"],
588
- ["APPCENTER", "APPCENTER_BUILD_ID"],
589
- [
590
- "CODESANDBOX",
591
- "CODESANDBOX_SSE",
592
- { ci: false }
593
- ],
594
- ["STACKBLITZ"],
595
- ["STORMKIT"],
596
- ["CLEAVR"]
597
- ];
598
- function detectProvider(env$1) {
599
- for (const provider of providers) {
600
- const envName = provider[1] || provider[0];
601
- if (env$1[envName]) return {
602
- name: provider[0].toLowerCase(),
603
- ...provider[2]
604
- };
605
- }
606
- if (env$1.SHELL && env$1.SHELL === "/bin/jsh") return {
607
- name: "stackblitz",
608
- ci: false
609
- };
610
- return {
611
- name: "",
612
- ci: false
613
- };
614
- }
615
- const processShim = typeof process !== "undefined" ? process : {};
616
- const envShim = processShim.env || {};
617
- const providerInfo = detectProvider(envShim);
618
- const nodeENV = typeof process !== "undefined" && process.env && process.env.NODE_ENV || "";
619
- processShim.platform;
620
- providerInfo.name;
621
- const isCI = toBoolean(envShim.CI) || providerInfo.ci !== false;
622
- const hasTTY = toBoolean(processShim.stdout && processShim.stdout.isTTY);
623
- const isDebug = toBoolean(envShim.DEBUG);
624
- const isTest = nodeENV === "test" || toBoolean(envShim.TEST);
625
- toBoolean(envShim.MINIMAL) || isCI || isTest || !hasTTY;
626
- function toBoolean(val) {
627
- return val ? val !== "false" : false;
628
- }
629
- function ansiRegex({ onlyFirst = false } = {}) {
630
- 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("|");
631
- return new RegExp(pattern, onlyFirst ? undefined : "g");
632
- }
633
- const regex = ansiRegex();
634
- function stripAnsi(string) {
635
- if (typeof string !== "string") throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
636
- return string.replace(regex, "");
637
- }
638
- function getDefaultExportFromCjs(x) {
639
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
640
- }
641
- var eastasianwidth = { exports: {} };
642
- (function(module$1) {
643
- var eaw = {};
644
- module$1.exports = eaw;
645
- eaw.eastAsianWidth = function(character) {
646
- var x = character.charCodeAt(0);
647
- var y = character.length == 2 ? character.charCodeAt(1) : 0;
648
- var codePoint = x;
649
- if (55296 <= x && x <= 56319 && 56320 <= y && y <= 57343) {
650
- x &= 1023;
651
- y &= 1023;
652
- codePoint = x << 10 | y;
653
- codePoint += 65536;
654
- }
655
- if (12288 == codePoint || 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510) return "F";
656
- 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";
657
- 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";
658
- 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";
659
- 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";
660
- return "N";
661
- };
662
- eaw.characterLength = function(character) {
663
- var code = this.eastAsianWidth(character);
664
- if (code == "F" || code == "W" || code == "A") return 2;
665
- else return 1;
666
- };
667
- function stringToArray(string) {
668
- return string.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
669
- }
670
- eaw.length = function(string) {
671
- var characters = stringToArray(string);
672
- var len = 0;
673
- for (var i = 0; i < characters.length; i++) len = len + this.characterLength(characters[i]);
674
- return len;
675
- };
676
- eaw.slice = function(text, start, end) {
677
- textLen = eaw.length(text);
678
- start = start ? start : 0;
679
- end = end ? end : 1;
680
- if (start < 0) start = textLen + start;
681
- if (end < 0) end = textLen + end;
682
- var result = "";
683
- var eawLen = 0;
684
- var chars = stringToArray(text);
685
- for (var i = 0; i < chars.length; i++) {
686
- var char = chars[i];
687
- var charLen = eaw.length(char);
688
- if (eawLen >= start - (charLen == 2 ? 1 : 0)) if (eawLen + charLen <= end) result += char;
689
- else break;
690
- eawLen += charLen;
691
- }
692
- return result;
693
- };
694
- })(eastasianwidth);
695
- var eastasianwidthExports = eastasianwidth.exports;
696
- const eastAsianWidth = /*@__PURE__*/ getDefaultExportFromCjs(eastasianwidthExports);
697
- const emojiRegex = () => {
698
- 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;
699
- };
700
- function stringWidth$1(string, options) {
701
- if (typeof string !== "string" || string.length === 0) return 0;
702
- options = {
703
- ambiguousIsNarrow: true,
704
- countAnsiEscapeCodes: false,
705
- ...options
706
- };
707
- if (!options.countAnsiEscapeCodes) string = stripAnsi(string);
708
- if (string.length === 0) return 0;
709
- const ambiguousCharacterWidth = options.ambiguousIsNarrow ? 1 : 2;
710
- let width = 0;
711
- for (const { segment: character } of new Intl.Segmenter().segment(string)) {
712
- const codePoint = character.codePointAt(0);
713
- if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) continue;
714
- if (codePoint >= 768 && codePoint <= 879) continue;
715
- if (emojiRegex().test(character)) {
716
- width += 2;
717
- continue;
718
- }
719
- const code = eastAsianWidth.eastAsianWidth(character);
720
- switch (code) {
721
- case "F":
722
- case "W": {
723
- width += 2;
724
- break;
725
- }
726
- case "A": {
727
- width += ambiguousCharacterWidth;
728
- break;
729
- }
730
- default: width += 1;
731
- }
732
- }
733
- return width;
734
- }
735
- function isUnicodeSupported() {
736
- if (node_process.default.platform !== "win32") return node_process.default.env.TERM !== "linux";
737
- return Boolean(node_process.default.env.CI) || Boolean(node_process.default.env.WT_SESSION) || Boolean(node_process.default.env.TERMINUS_SUBLIME) || node_process.default.env.ConEmuTask === "{cmd::Cmder}" || node_process.default.env.TERM_PROGRAM === "Terminus-Sublime" || node_process.default.env.TERM_PROGRAM === "vscode" || node_process.default.env.TERM === "xterm-256color" || node_process.default.env.TERM === "alacritty" || node_process.default.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
738
- }
739
- const TYPE_COLOR_MAP = {
740
- info: "cyan",
741
- fail: "red",
742
- success: "green",
743
- ready: "green",
744
- start: "magenta"
745
- };
746
- const LEVEL_COLOR_MAP = {
747
- 0: "red",
748
- 1: "yellow"
749
- };
750
- const unicode = isUnicodeSupported();
751
- const s = (c, fallback) => unicode ? c : fallback;
752
- const TYPE_ICONS = {
753
- error: s("✖", "×"),
754
- fatal: s("✖", "×"),
755
- ready: s("✔", "√"),
756
- warn: s("⚠", "‼"),
757
- info: s("ℹ", "i"),
758
- success: s("✔", "√"),
759
- debug: s("⚙", "D"),
760
- trace: s("→", "→"),
761
- fail: s("✖", "×"),
762
- start: s("◐", "o"),
763
- log: ""
764
- };
765
- function stringWidth(str) {
766
- if (!Intl.Segmenter) return stripAnsi$1(str).length;
767
- return stringWidth$1(str);
768
- }
769
- var FancyReporter = class extends BasicReporter {
770
- formatStack(stack) {
771
- return "\n" + parseStack(stack).map((line) => " " + line.replace(/^at +/, (m) => colors.gray(m)).replace(/\((.+)\)/, (_, m) => `(${colors.cyan(m)})`)).join("\n");
772
- }
773
- formatType(logObj, isBadge, opts) {
774
- const typeColor = TYPE_COLOR_MAP[logObj.type] || LEVEL_COLOR_MAP[logObj.level] || "gray";
775
- if (isBadge) return getBgColor(typeColor)(colors.black(` ${logObj.type.toUpperCase()} `));
776
- const _type = typeof TYPE_ICONS[logObj.type] === "string" ? TYPE_ICONS[logObj.type] : logObj.icon || logObj.type;
777
- return _type ? getColor(typeColor)(_type) : "";
778
- }
779
- formatLogObj(logObj, opts) {
780
- const [message, ...additional] = this.formatArgs(logObj.args, opts).split("\n");
781
- if (logObj.type === "box") return box(characterFormat(message + (additional.length > 0 ? "\n" + additional.join("\n") : "")), {
782
- title: logObj.title ? characterFormat(logObj.title) : void 0,
783
- style: logObj.style
784
- });
785
- const date = this.formatDate(logObj.date, opts);
786
- const coloredDate = date && colors.gray(date);
787
- const isBadge = logObj.badge ?? logObj.level < 2;
788
- const type = this.formatType(logObj, isBadge, opts);
789
- const tag = logObj.tag ? colors.gray(logObj.tag) : "";
790
- let line;
791
- const left = this.filterAndJoin([type, characterFormat(message)]);
792
- const right = this.filterAndJoin(opts.columns ? [tag, coloredDate] : [tag]);
793
- const space = (opts.columns || 0) - stringWidth(left) - stringWidth(right) - 2;
794
- line = space > 0 && (opts.columns || 0) >= 80 ? left + " ".repeat(space) + right : (right ? `${colors.gray(`[${right}]`)} ` : "") + left;
795
- line += characterFormat(additional.length > 0 ? "\n" + additional.join("\n") : "");
796
- if (logObj.type === "trace") {
797
- const _err = new Error("Trace: " + logObj.message);
798
- line += this.formatStack(_err.stack || "");
799
- }
800
- return isBadge ? "\n" + line + "\n" : line;
801
- }
802
- };
803
- function characterFormat(str) {
804
- return str.replace(/`([^`]+)`/gm, (_, m) => colors.cyan(m)).replace(/\s+_([^_]+)_\s+/gm, (_, m) => ` ${colors.underline(m)} `);
805
- }
806
- function getColor(color = "white") {
807
- return colors[color] || colors.white;
808
- }
809
- function getBgColor(color = "bgWhite") {
810
- return colors[`bg${color[0].toUpperCase()}${color.slice(1)}`] || colors.bgWhite;
811
- }
812
- function createConsola(options = {}) {
813
- let level = _getDefaultLogLevel();
814
- if (process.env.CONSOLA_LEVEL) level = Number.parseInt(process.env.CONSOLA_LEVEL) ?? level;
815
- const consola2 = createConsola$1({
816
- level,
817
- defaults: { level },
818
- stdout: process.stdout,
819
- stderr: process.stderr,
820
- prompt: (...args) => Promise.resolve().then(function() {
821
- return require("./prompt-B58MxVuU.cjs");
822
- }).then((m) => m.prompt(...args)),
823
- reporters: options.reporters || [options.fancy ?? !(isCI || isTest) ? new FancyReporter() : new BasicReporter()],
824
- ...options
825
- });
826
- return consola2;
827
- }
828
- function _getDefaultLogLevel() {
829
- if (isDebug) return LogLevels.debug;
830
- if (isTest) return LogLevels.warn;
831
- return LogLevels.info;
832
- }
833
- const consola = createConsola();
834
-
835
- //#endregion
836
- Object.defineProperty(exports, 'colors$1', {
837
- enumerable: true,
838
- get: function () {
839
- return colors;
840
- }
841
- });
842
- Object.defineProperty(exports, 'createConsola', {
843
- enumerable: true,
844
- get: function () {
845
- return createConsola;
846
- }
847
- });
848
- Object.defineProperty(exports, 'getDefaultExportFromCjs', {
849
- enumerable: true,
850
- get: function () {
851
- return getDefaultExportFromCjs;
852
- }
853
- });
854
- Object.defineProperty(exports, 'isUnicodeSupported', {
855
- enumerable: true,
856
- get: function () {
857
- return isUnicodeSupported;
858
- }
859
- });