storybook 10.1.0-alpha.12 → 10.1.0-alpha.14

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 (99) hide show
  1. package/dist/_browser-chunks/{chunk-74YHFU5B.js → chunk-2XZMBGTA.js} +1 -1
  2. package/dist/_browser-chunks/{chunk-EBHB6RPS.js → chunk-FQ7SLVLR.js} +6 -1
  3. package/dist/_browser-chunks/{chunk-X3DUQ5RA.js → chunk-GFY5R5EY.js} +1 -1
  4. package/dist/_browser-chunks/{chunk-WXP2XJ3O.js → chunk-P4F4UVXX.js} +1 -0
  5. package/dist/_browser-chunks/{chunk-BE2DAXKJ.js → chunk-SS2NHR7W.js} +4 -1
  6. package/dist/_browser-chunks/{syntaxhighlighter-WKBQ5RC7.js → syntaxhighlighter-IQDEPFLK.js} +1 -1
  7. package/dist/_node-chunks/{builder-manager-YUOHSIUB.js → builder-manager-FQ5J6V3U.js} +32 -22
  8. package/dist/_node-chunks/{chunk-B6JWY6PC.js → camelcase-VGUYV77Z.js} +8 -8
  9. package/dist/_node-chunks/{chunk-FZLRAH4N.js → chunk-2JR3QBT2.js} +7 -7
  10. package/dist/_node-chunks/chunk-3EBH66BB.js +23 -0
  11. package/dist/_node-chunks/{chunk-E5FJS66Z.js → chunk-4ZFHN3ZY.js} +6 -6
  12. package/dist/_node-chunks/{chunk-5HV3B5OP.js → chunk-63PL4NNE.js} +1104 -13
  13. package/dist/_node-chunks/{chunk-NAOYEL54.js → chunk-A4KENTXT.js} +7 -7
  14. package/dist/_node-chunks/{chunk-4FT2DHGE.js → chunk-ALIA3J6S.js} +44 -10
  15. package/dist/_node-chunks/{chunk-WFLWJO24.js → chunk-C2HKH2XQ.js} +5710 -2414
  16. package/dist/_node-chunks/{chunk-WA6KZQZ2.js → chunk-DQNBAQYT.js} +6 -6
  17. package/dist/_node-chunks/{chunk-JARUEMEP.js → chunk-F74UHHR6.js} +7 -7
  18. package/dist/_node-chunks/{chunk-WUXQMQCB.js → chunk-H5XWXVWR.js} +6 -6
  19. package/dist/_node-chunks/{chunk-OP3INKUD.js → chunk-JMP7YFX2.js} +6 -6
  20. package/dist/_node-chunks/{chunk-DWXTZT3D.js → chunk-JZR4DHG2.js} +19 -7
  21. package/dist/_node-chunks/{chunk-QCO2ZM7F.js → chunk-KEA7CVMZ.js} +122 -32
  22. package/dist/_node-chunks/{chunk-DUXPWBOK.js → chunk-KF3WTAEP.js} +7 -7
  23. package/dist/_node-chunks/{chunk-2D2IODUU.js → chunk-LPPM7L5D.js} +51 -71
  24. package/dist/_node-chunks/{chunk-2DMESZFJ.js → chunk-MJUDR7HQ.js} +7 -7
  25. package/dist/_node-chunks/chunk-NPB4THZQ.js +18 -0
  26. package/dist/_node-chunks/chunk-NZBK3DSJ.js +29 -0
  27. package/dist/_node-chunks/{chunk-5KLIDWFN.js → chunk-Q2QUNQK6.js} +7 -7
  28. package/dist/_node-chunks/{chunk-EZWWR7AR.js → chunk-TMCKISJR.js} +101 -118
  29. package/dist/_node-chunks/chunk-TWK7AR3U.js +6024 -0
  30. package/dist/_node-chunks/{chunk-CZ5GHJCC.js → chunk-V7CXWJXC.js} +7 -7
  31. package/dist/_node-chunks/chunk-W4F3T6CY.js +3781 -0
  32. package/dist/_node-chunks/{chunk-SEMIAAWG.js → chunk-WACDSFMO.js} +9 -9
  33. package/dist/_node-chunks/{chunk-A4APXFQ2.js → chunk-WVXZFQQU.js} +14 -8
  34. package/dist/_node-chunks/chunk-XBPE4PT7.js +78 -0
  35. package/dist/_node-chunks/chunk-YMM6BYF2.js +61 -0
  36. package/dist/_node-chunks/{chunk-XXPJ7XR3.js → chunk-ZGZKNZ5S.js} +6 -6
  37. package/dist/_node-chunks/{dist-DS2B5A3J.js → dist-DR3AP3RJ.js} +9 -9
  38. package/dist/_node-chunks/{globby-6THB7HVX.js → globby-D4FPSHY2.js} +9 -9
  39. package/dist/_node-chunks/{lib-5NKX4YGG.js → lib-ZEFOVNTK.js} +7 -7
  40. package/dist/_node-chunks/{mdx-N42X6CFJ-ZLT3QOFF.js → mdx-N42X6CFJ-PJF3ICCG.js} +8 -8
  41. package/dist/_node-chunks/{p-limit-PDMWNG7W.js → p-limit-CYQOFYPV.js} +7 -7
  42. package/dist/babel/index.js +10 -11
  43. package/dist/bin/core.js +33 -26
  44. package/dist/bin/dispatcher.js +31 -20
  45. package/dist/bin/loader.js +10 -13
  46. package/dist/cli/index.d.ts +1479 -133
  47. package/dist/cli/index.js +30 -5159
  48. package/dist/common/index.d.ts +139 -62
  49. package/dist/common/index.js +66 -51
  50. package/dist/components/index.d.ts +136 -26
  51. package/dist/components/index.js +3163 -2859
  52. package/dist/core-server/index.d.ts +3 -2
  53. package/dist/core-server/index.js +112 -1486
  54. package/dist/core-server/presets/common-manager.js +5 -5
  55. package/dist/core-server/presets/common-override-preset.js +9 -9
  56. package/dist/core-server/presets/common-preset.js +272 -81
  57. package/dist/csf/index.js +2 -2
  58. package/dist/csf-tools/index.js +9 -9
  59. package/dist/manager/globals-runtime.js +21557 -21133
  60. package/dist/manager/manager-stores.d.ts +1 -0
  61. package/dist/manager/manager-stores.js +23 -0
  62. package/dist/manager/runtime.js +6695 -720
  63. package/dist/manager-api/index.d.ts +1802 -1
  64. package/dist/manager-api/index.js +105 -11
  65. package/dist/manager-errors.d.ts +6 -0
  66. package/dist/manager-errors.js +2 -2
  67. package/dist/mocking-utils/index.d.ts +1126 -0
  68. package/dist/{_node-chunks/chunk-ZXSD6L3S.js → mocking-utils/index.js} +441 -16
  69. package/dist/node-logger/index.d.ts +192 -24
  70. package/dist/node-logger/index.js +23 -3148
  71. package/dist/preview/runtime.js +35 -3
  72. package/dist/preview-api/index.d.ts +69 -68
  73. package/dist/preview-api/index.js +2 -2
  74. package/dist/preview-errors.d.ts +6 -0
  75. package/dist/preview-errors.js +2 -2
  76. package/dist/server-errors.d.ts +31 -1
  77. package/dist/server-errors.js +17 -10
  78. package/dist/telemetry/index.d.ts +24 -3
  79. package/dist/telemetry/index.js +25 -24
  80. package/dist/types/index.d.ts +71 -8
  81. package/dist/types/index.js +25 -1
  82. package/package.json +11 -9
  83. package/dist/_node-chunks/camelcase-JREIL7NV.js +0 -18
  84. package/dist/_node-chunks/chunk-FDXFVHIL.js +0 -1114
  85. package/dist/_node-chunks/chunk-HZG65SU3.js +0 -34
  86. package/dist/_node-chunks/chunk-IXVYNBMD.js +0 -18
  87. package/dist/_node-chunks/chunk-LIH7MTP7.js +0 -3214
  88. package/dist/_node-chunks/chunk-N5GIRUP5.js +0 -1047
  89. package/dist/_node-chunks/chunk-O5DA7YLO.js +0 -3171
  90. package/dist/_node-chunks/chunk-QYQIZBS6.js +0 -26
  91. package/dist/_node-chunks/chunk-TS2UUH2J.js +0 -301
  92. package/dist/_node-chunks/chunk-Y4E6IGQF.js +0 -61
  93. package/dist/_node-chunks/chunk-ZL3AFKRX.js +0 -1029
  94. package/dist/_node-chunks/plugin-6XMWOGPO.js +0 -123
  95. package/dist/_node-chunks/plugin-LTOXVT6A.js +0 -109
  96. package/dist/_node-chunks/webpack-inject-mocker-runtime-plugin-2SFE5LQS.js +0 -46582
  97. package/dist/_node-chunks/webpack-mock-plugin-CX5J2U56.js +0 -92
  98. package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +0 -32
  99. package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +0 -28
@@ -1,3160 +1,35 @@
1
- import CJS_COMPAT_NODE_URL_57ru1wfqqjv from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_57ru1wfqqjv from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_57ru1wfqqjv from "node:module";
1
+ import CJS_COMPAT_NODE_URL_yntchggdu3k from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_yntchggdu3k from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_yntchggdu3k from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_57ru1wfqqjv.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_57ru1wfqqjv.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_57ru1wfqqjv.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_yntchggdu3k.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_yntchggdu3k.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_yntchggdu3k.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
11
  // ------------------------------------------------------------
12
12
  import {
13
- require_pretty_hrtime
14
- } from "../_node-chunks/chunk-HZG65SU3.js";
15
- import {
16
- ansi_styles_default,
17
- boxen,
18
- require_string_width,
19
- stripAnsi
20
- } from "../_node-chunks/chunk-N5GIRUP5.js";
21
- import "../_node-chunks/chunk-B6JWY6PC.js";
22
- import {
23
- execaSync,
24
- optionalEnvToBoolean
25
- } from "../_node-chunks/chunk-O5DA7YLO.js";
26
- import "../_node-chunks/chunk-DWXTZT3D.js";
27
- import {
28
- require_prompts,
29
- require_src
30
- } from "../_node-chunks/chunk-LIH7MTP7.js";
31
- import {
32
- require_picocolors
33
- } from "../_node-chunks/chunk-NAOYEL54.js";
34
- import {
35
- __commonJS,
36
- __export,
37
- __require,
38
- __toESM
39
- } from "../_node-chunks/chunk-OP3INKUD.js";
40
-
41
- // ../node_modules/are-we-there-yet/lib/tracker-base.js
42
- var require_tracker_base = __commonJS({
43
- "../node_modules/are-we-there-yet/lib/tracker-base.js"(exports, module) {
44
- "use strict";
45
- var EventEmitter = __require("events"), trackerId = 0, TrackerBase = class extends EventEmitter {
46
- constructor(name) {
47
- super(), this.id = ++trackerId, this.name = name;
48
- }
49
- };
50
- module.exports = TrackerBase;
51
- }
52
- });
53
-
54
- // ../node_modules/are-we-there-yet/lib/tracker.js
55
- var require_tracker = __commonJS({
56
- "../node_modules/are-we-there-yet/lib/tracker.js"(exports, module) {
57
- "use strict";
58
- var TrackerBase = require_tracker_base(), Tracker = class extends TrackerBase {
59
- constructor(name, todo) {
60
- super(name), this.workDone = 0, this.workTodo = todo || 0;
61
- }
62
- completed() {
63
- return this.workTodo === 0 ? 0 : this.workDone / this.workTodo;
64
- }
65
- addWork(work) {
66
- this.workTodo += work, this.emit("change", this.name, this.completed(), this);
67
- }
68
- completeWork(work) {
69
- this.workDone += work, this.workDone > this.workTodo && (this.workDone = this.workTodo), this.emit("change", this.name, this.completed(), this);
70
- }
71
- finish() {
72
- this.workTodo = this.workDone = 1, this.emit("change", this.name, 1, this);
73
- }
74
- };
75
- module.exports = Tracker;
76
- }
77
- });
78
-
79
- // ../node_modules/are-we-there-yet/lib/tracker-stream.js
80
- var require_tracker_stream = __commonJS({
81
- "../node_modules/are-we-there-yet/lib/tracker-stream.js"(exports, module) {
82
- "use strict";
83
- var stream = __require("stream"), Tracker = require_tracker(), TrackerStream = class extends stream.Transform {
84
- constructor(name, size, options) {
85
- super(options), this.tracker = new Tracker(name, size), this.name = name, this.id = this.tracker.id, this.tracker.on("change", this.trackerChange.bind(this));
86
- }
87
- trackerChange(name, completion) {
88
- this.emit("change", name, completion, this);
89
- }
90
- _transform(data, encoding, cb) {
91
- this.tracker.completeWork(data.length ? data.length : 1), this.push(data), cb();
92
- }
93
- _flush(cb) {
94
- this.tracker.finish(), cb();
95
- }
96
- completed() {
97
- return this.tracker.completed();
98
- }
99
- addWork(work) {
100
- return this.tracker.addWork(work);
101
- }
102
- finish() {
103
- return this.tracker.finish();
104
- }
105
- };
106
- module.exports = TrackerStream;
107
- }
108
- });
109
-
110
- // ../node_modules/are-we-there-yet/lib/tracker-group.js
111
- var require_tracker_group = __commonJS({
112
- "../node_modules/are-we-there-yet/lib/tracker-group.js"(exports, module) {
113
- "use strict";
114
- var TrackerBase = require_tracker_base(), Tracker = require_tracker(), TrackerStream = require_tracker_stream(), TrackerGroup = class _TrackerGroup extends TrackerBase {
115
- parentGroup = null;
116
- trackers = [];
117
- completion = {};
118
- weight = {};
119
- totalWeight = 0;
120
- finished = !1;
121
- bubbleChange = bubbleChange(this);
122
- nameInTree() {
123
- for (var names = [], from = this; from; )
124
- names.unshift(from.name), from = from.parentGroup;
125
- return names.join("/");
126
- }
127
- addUnit(unit, weight) {
128
- if (unit.addUnit) {
129
- for (var toTest = this; toTest; ) {
130
- if (unit === toTest)
131
- throw new Error(
132
- "Attempted to add tracker group " + unit.name + " to tree that already includes it " + this.nameInTree(this)
133
- );
134
- toTest = toTest.parentGroup;
135
- }
136
- unit.parentGroup = this;
137
- }
138
- return this.weight[unit.id] = weight || 1, this.totalWeight += this.weight[unit.id], this.trackers.push(unit), this.completion[unit.id] = unit.completed(), unit.on("change", this.bubbleChange), this.finished || this.emit("change", unit.name, this.completion[unit.id], unit), unit;
139
- }
140
- completed() {
141
- if (this.trackers.length === 0)
142
- return 0;
143
- for (var valPerWeight = 1 / this.totalWeight, completed = 0, ii = 0; ii < this.trackers.length; ii++) {
144
- var trackerId = this.trackers[ii].id;
145
- completed += valPerWeight * this.weight[trackerId] * this.completion[trackerId];
146
- }
147
- return completed;
148
- }
149
- newGroup(name, weight) {
150
- return this.addUnit(new _TrackerGroup(name), weight);
151
- }
152
- newItem(name, todo, weight) {
153
- return this.addUnit(new Tracker(name, todo), weight);
154
- }
155
- newStream(name, todo, weight) {
156
- return this.addUnit(new TrackerStream(name, todo), weight);
157
- }
158
- finish() {
159
- this.finished = !0, this.trackers.length || this.addUnit(new Tracker(), 1, !0);
160
- for (var ii = 0; ii < this.trackers.length; ii++) {
161
- var tracker = this.trackers[ii];
162
- tracker.finish(), tracker.removeListener("change", this.bubbleChange);
163
- }
164
- this.emit("change", this.name, 1, this);
165
- }
166
- debug(depth = 0) {
167
- let indent = " ".repeat(depth), output = `${indent}${this.name || "top"}: ${this.completed()}
168
- `;
169
- return this.trackers.forEach(function(tracker) {
170
- output += tracker instanceof _TrackerGroup ? tracker.debug(depth + 1) : `${indent} ${tracker.name}: ${tracker.completed()}
171
- `;
172
- }), output;
173
- }
174
- };
175
- function bubbleChange(trackerGroup) {
176
- return function(name, completed, tracker) {
177
- trackerGroup.completion[tracker.id] = completed, !trackerGroup.finished && trackerGroup.emit("change", name || trackerGroup.name, trackerGroup.completed(), trackerGroup);
178
- };
179
- }
180
- module.exports = TrackerGroup;
181
- }
182
- });
183
-
184
- // ../node_modules/are-we-there-yet/lib/index.js
185
- var require_lib = __commonJS({
186
- "../node_modules/are-we-there-yet/lib/index.js"(exports) {
187
- "use strict";
188
- exports.TrackerGroup = require_tracker_group();
189
- exports.Tracker = require_tracker();
190
- exports.TrackerStream = require_tracker_stream();
191
- }
192
- });
193
-
194
- // ../node_modules/console-control-strings/index.js
195
- var require_console_control_strings = __commonJS({
196
- "../node_modules/console-control-strings/index.js"(exports) {
197
- "use strict";
198
- var prefix = "\x1B[";
199
- exports.up = function(num) {
200
- return prefix + (num || "") + "A";
201
- };
202
- exports.down = function(num) {
203
- return prefix + (num || "") + "B";
204
- };
205
- exports.forward = function(num) {
206
- return prefix + (num || "") + "C";
207
- };
208
- exports.back = function(num) {
209
- return prefix + (num || "") + "D";
210
- };
211
- exports.nextLine = function(num) {
212
- return prefix + (num || "") + "E";
213
- };
214
- exports.previousLine = function(num) {
215
- return prefix + (num || "") + "F";
216
- };
217
- exports.horizontalAbsolute = function(num) {
218
- if (num == null) throw new Error("horizontalAboslute requires a column to position to");
219
- return prefix + num + "G";
220
- };
221
- exports.eraseData = function() {
222
- return prefix + "J";
223
- };
224
- exports.eraseLine = function() {
225
- return prefix + "K";
226
- };
227
- exports.goto = function(x2, y2) {
228
- return prefix + y2 + ";" + x2 + "H";
229
- };
230
- exports.gotoSOL = function() {
231
- return "\r";
232
- };
233
- exports.beep = function() {
234
- return "\x07";
235
- };
236
- exports.hideCursor = function() {
237
- return prefix + "?25l";
238
- };
239
- exports.showCursor = function() {
240
- return prefix + "?25h";
241
- };
242
- var colors2 = {
243
- reset: 0,
244
- // styles
245
- bold: 1,
246
- italic: 3,
247
- underline: 4,
248
- inverse: 7,
249
- // resets
250
- stopBold: 22,
251
- stopItalic: 23,
252
- stopUnderline: 24,
253
- stopInverse: 27,
254
- // colors
255
- white: 37,
256
- black: 30,
257
- blue: 34,
258
- cyan: 36,
259
- green: 32,
260
- magenta: 35,
261
- red: 31,
262
- yellow: 33,
263
- bgWhite: 47,
264
- bgBlack: 40,
265
- bgBlue: 44,
266
- bgCyan: 46,
267
- bgGreen: 42,
268
- bgMagenta: 45,
269
- bgRed: 41,
270
- bgYellow: 43,
271
- grey: 90,
272
- brightBlack: 90,
273
- brightRed: 91,
274
- brightGreen: 92,
275
- brightYellow: 93,
276
- brightBlue: 94,
277
- brightMagenta: 95,
278
- brightCyan: 96,
279
- brightWhite: 97,
280
- bgGrey: 100,
281
- bgBrightBlack: 100,
282
- bgBrightRed: 101,
283
- bgBrightGreen: 102,
284
- bgBrightYellow: 103,
285
- bgBrightBlue: 104,
286
- bgBrightMagenta: 105,
287
- bgBrightCyan: 106,
288
- bgBrightWhite: 107
289
- };
290
- exports.color = function(colorWith) {
291
- return (arguments.length !== 1 || !Array.isArray(colorWith)) && (colorWith = Array.prototype.slice.call(arguments)), prefix + colorWith.map(colorNameToCode).join(";") + "m";
292
- };
293
- function colorNameToCode(color) {
294
- if (colors2[color] != null) return colors2[color];
295
- throw new Error("Unknown color or style name: " + color);
296
- }
297
- }
298
- });
299
-
300
- // ../node_modules/wide-align/align.js
301
- var require_align = __commonJS({
302
- "../node_modules/wide-align/align.js"(exports) {
303
- "use strict";
304
- var stringWidth2 = require_string_width();
305
- exports.center = alignCenter;
306
- exports.left = alignLeft;
307
- exports.right = alignRight;
308
- function createPadding(width) {
309
- var result = "", string = " ", n = width;
310
- do
311
- n % 2 && (result += string), n = Math.floor(n / 2), string += string;
312
- while (n);
313
- return result;
314
- }
315
- function alignLeft(str, width) {
316
- var trimmed = str.trimRight();
317
- if (trimmed.length === 0 && str.length >= width) return str;
318
- var padding = "", strWidth = stringWidth2(trimmed);
319
- return strWidth < width && (padding = createPadding(width - strWidth)), trimmed + padding;
320
- }
321
- function alignRight(str, width) {
322
- var trimmed = str.trimLeft();
323
- if (trimmed.length === 0 && str.length >= width) return str;
324
- var padding = "", strWidth = stringWidth2(trimmed);
325
- return strWidth < width && (padding = createPadding(width - strWidth)), padding + trimmed;
326
- }
327
- function alignCenter(str, width) {
328
- var trimmed = str.trim();
329
- if (trimmed.length === 0 && str.length >= width) return str;
330
- var padLeft = "", padRight = "", strWidth = stringWidth2(trimmed);
331
- if (strWidth < width) {
332
- var padLeftBy = parseInt((width - strWidth) / 2, 10);
333
- padLeft = createPadding(padLeftBy), padRight = createPadding(width - (strWidth + padLeftBy));
334
- }
335
- return padLeft + trimmed + padRight;
336
- }
337
- }
338
- });
339
-
340
- // ../node_modules/aproba/index.js
341
- var require_aproba = __commonJS({
342
- "../node_modules/aproba/index.js"(exports, module) {
343
- "use strict";
344
- module.exports = validate;
345
- function isArguments(thingy) {
346
- return thingy != null && typeof thingy == "object" && thingy.hasOwnProperty("callee");
347
- }
348
- var types = {
349
- "*": { label: "any", check: () => !0 },
350
- A: { label: "array", check: (_) => Array.isArray(_) || isArguments(_) },
351
- S: { label: "string", check: (_) => typeof _ == "string" },
352
- N: { label: "number", check: (_) => typeof _ == "number" },
353
- F: { label: "function", check: (_) => typeof _ == "function" },
354
- O: { label: "object", check: (_) => typeof _ == "object" && _ != null && !types.A.check(_) && !types.E.check(_) },
355
- B: { label: "boolean", check: (_) => typeof _ == "boolean" },
356
- E: { label: "error", check: (_) => _ instanceof Error },
357
- Z: { label: "null", check: (_) => _ == null }
358
- };
359
- function addSchema(schema, arity) {
360
- let group = arity[schema.length] = arity[schema.length] || [];
361
- group.indexOf(schema) === -1 && group.push(schema);
362
- }
363
- function validate(rawSchemas, args) {
364
- if (arguments.length !== 2) throw wrongNumberOfArgs(["SA"], arguments.length);
365
- if (!rawSchemas) throw missingRequiredArg(0, "rawSchemas");
366
- if (!args) throw missingRequiredArg(1, "args");
367
- if (!types.S.check(rawSchemas)) throw invalidType(0, ["string"], rawSchemas);
368
- if (!types.A.check(args)) throw invalidType(1, ["array"], args);
369
- let schemas = rawSchemas.split("|"), arity = {};
370
- schemas.forEach((schema) => {
371
- for (let ii = 0; ii < schema.length; ++ii) {
372
- let type = schema[ii];
373
- if (!types[type]) throw unknownType(ii, type);
374
- }
375
- if (/E.*E/.test(schema)) throw moreThanOneError(schema);
376
- addSchema(schema, arity), /E/.test(schema) && (addSchema(schema.replace(/E.*$/, "E"), arity), addSchema(schema.replace(/E/, "Z"), arity), schema.length === 1 && addSchema("", arity));
377
- });
378
- let matching = arity[args.length];
379
- if (!matching)
380
- throw wrongNumberOfArgs(Object.keys(arity), args.length);
381
- for (let ii = 0; ii < args.length; ++ii) {
382
- let newMatching = matching.filter((schema) => {
383
- let type = schema[ii], typeCheck = types[type].check;
384
- return typeCheck(args[ii]);
385
- });
386
- if (!newMatching.length) {
387
- let labels = matching.map((_) => types[_[ii]].label).filter((_) => _ != null);
388
- throw invalidType(ii, labels, args[ii]);
389
- }
390
- matching = newMatching;
391
- }
392
- }
393
- function missingRequiredArg(num) {
394
- return newException("EMISSINGARG", "Missing required argument #" + (num + 1));
395
- }
396
- function unknownType(num, type) {
397
- return newException("EUNKNOWNTYPE", "Unknown type " + type + " in argument #" + (num + 1));
398
- }
399
- function invalidType(num, expectedTypes, value) {
400
- let valueType;
401
- return Object.keys(types).forEach((typeCode) => {
402
- types[typeCode].check(value) && (valueType = types[typeCode].label);
403
- }), newException("EINVALIDTYPE", "Argument #" + (num + 1) + ": Expected " + englishList(expectedTypes) + " but got " + valueType);
404
- }
405
- function englishList(list) {
406
- return list.join(", ").replace(/, ([^,]+)$/, " or $1");
407
- }
408
- function wrongNumberOfArgs(expected, got) {
409
- let english = englishList(expected), args = expected.every((ex) => ex.length === 1) ? "argument" : "arguments";
410
- return newException("EWRONGARGCOUNT", "Expected " + english + " " + args + " but got " + got);
411
- }
412
- function moreThanOneError(schema) {
413
- return newException(
414
- "ETOOMANYERRORTYPES",
415
- 'Only one error type per argument signature is allowed, more than one found in "' + schema + '"'
416
- );
417
- }
418
- function newException(code, msg) {
419
- let err = new TypeError(msg);
420
- return err.code = code, Error.captureStackTrace && Error.captureStackTrace(err, validate), err;
421
- }
422
- }
423
- });
424
-
425
- // ../node_modules/gauge/node_modules/ansi-regex/index.js
426
- var require_ansi_regex = __commonJS({
427
- "../node_modules/gauge/node_modules/ansi-regex/index.js"(exports, module) {
428
- "use strict";
429
- module.exports = ({ onlyFirst = !1 } = {}) => {
430
- let pattern = [
431
- "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
432
- "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
433
- ].join("|");
434
- return new RegExp(pattern, onlyFirst ? void 0 : "g");
435
- };
436
- }
437
- });
438
-
439
- // ../node_modules/gauge/node_modules/strip-ansi/index.js
440
- var require_strip_ansi = __commonJS({
441
- "../node_modules/gauge/node_modules/strip-ansi/index.js"(exports, module) {
442
- "use strict";
443
- var ansiRegex2 = require_ansi_regex();
444
- module.exports = (string) => typeof string == "string" ? string.replace(ansiRegex2(), "") : string;
445
- }
446
- });
447
-
448
- // ../node_modules/gauge/lib/wide-truncate.js
449
- var require_wide_truncate = __commonJS({
450
- "../node_modules/gauge/lib/wide-truncate.js"(exports, module) {
451
- "use strict";
452
- var stringWidth2 = require_string_width(), stripAnsi3 = require_strip_ansi();
453
- module.exports = wideTruncate;
454
- function wideTruncate(str, target) {
455
- if (stringWidth2(str) === 0)
456
- return str;
457
- if (target <= 0)
458
- return "";
459
- if (stringWidth2(str) <= target)
460
- return str;
461
- for (var noAnsi = stripAnsi3(str), ansiSize = str.length + noAnsi.length, truncated = str.slice(0, target + ansiSize); stringWidth2(truncated) > target; )
462
- truncated = truncated.slice(0, -1);
463
- return truncated;
464
- }
465
- }
466
- });
467
-
468
- // ../node_modules/gauge/lib/error.js
469
- var require_error = __commonJS({
470
- "../node_modules/gauge/lib/error.js"(exports) {
471
- "use strict";
472
- var util = __require("util"), User = exports.User = function User2(msg) {
473
- var err = new Error(msg);
474
- return Error.captureStackTrace(err, User2), err.code = "EGAUGE", err;
475
- };
476
- exports.MissingTemplateValue = function MissingTemplateValue(item, values) {
477
- var err = new User(util.format('Missing template value "%s"', item.type));
478
- return Error.captureStackTrace(err, MissingTemplateValue), err.template = item, err.values = values, err;
479
- };
480
- exports.Internal = function Internal(msg) {
481
- var err = new Error(msg);
482
- return Error.captureStackTrace(err, Internal), err.code = "EGAUGEINTERNAL", err;
483
- };
484
- }
485
- });
486
-
487
- // ../node_modules/gauge/lib/template-item.js
488
- var require_template_item = __commonJS({
489
- "../node_modules/gauge/lib/template-item.js"(exports, module) {
490
- "use strict";
491
- var stringWidth2 = require_string_width();
492
- module.exports = TemplateItem;
493
- function isPercent(num) {
494
- return typeof num != "string" ? !1 : num.slice(-1) === "%";
495
- }
496
- function percent(num) {
497
- return Number(num.slice(0, -1)) / 100;
498
- }
499
- function TemplateItem(values, outputLength) {
500
- if (this.overallOutputLength = outputLength, this.finished = !1, this.type = null, this.value = null, this.length = null, this.maxLength = null, this.minLength = null, this.kerning = null, this.align = "left", this.padLeft = 0, this.padRight = 0, this.index = null, this.first = null, this.last = null, typeof values == "string")
501
- this.value = values;
502
- else
503
- for (var prop in values)
504
- this[prop] = values[prop];
505
- return isPercent(this.length) && (this.length = Math.round(this.overallOutputLength * percent(this.length))), isPercent(this.minLength) && (this.minLength = Math.round(this.overallOutputLength * percent(this.minLength))), isPercent(this.maxLength) && (this.maxLength = Math.round(this.overallOutputLength * percent(this.maxLength))), this;
506
- }
507
- TemplateItem.prototype = {};
508
- TemplateItem.prototype.getBaseLength = function() {
509
- var length = this.length;
510
- return length == null && typeof this.value == "string" && this.maxLength == null && this.minLength == null && (length = stringWidth2(this.value)), length;
511
- };
512
- TemplateItem.prototype.getLength = function() {
513
- var length = this.getBaseLength();
514
- return length == null ? null : length + this.padLeft + this.padRight;
515
- };
516
- TemplateItem.prototype.getMaxLength = function() {
517
- return this.maxLength == null ? null : this.maxLength + this.padLeft + this.padRight;
518
- };
519
- TemplateItem.prototype.getMinLength = function() {
520
- return this.minLength == null ? null : this.minLength + this.padLeft + this.padRight;
521
- };
522
- }
523
- });
524
-
525
- // ../node_modules/gauge/lib/render-template.js
526
- var require_render_template = __commonJS({
527
- "../node_modules/gauge/lib/render-template.js"(exports, module) {
528
- "use strict";
529
- var align = require_align(), validate = require_aproba(), wideTruncate = require_wide_truncate(), error2 = require_error(), TemplateItem = require_template_item();
530
- function renderValueWithValues(values) {
531
- return function(item) {
532
- return renderValue(item, values);
533
- };
534
- }
535
- var renderTemplate = module.exports = function(width, template, values) {
536
- var items = prepareItems(width, template, values), rendered = items.map(renderValueWithValues(values)).join("");
537
- return align.left(wideTruncate(rendered, width), width);
538
- };
539
- function preType(item) {
540
- var cappedTypeName = item.type[0].toUpperCase() + item.type.slice(1);
541
- return "pre" + cappedTypeName;
542
- }
543
- function postType(item) {
544
- var cappedTypeName = item.type[0].toUpperCase() + item.type.slice(1);
545
- return "post" + cappedTypeName;
546
- }
547
- function hasPreOrPost(item, values) {
548
- if (item.type)
549
- return values[preType(item)] || values[postType(item)];
550
- }
551
- function generatePreAndPost(baseItem, parentValues) {
552
- var item = Object.assign({}, baseItem), values = Object.create(parentValues), template = [], pre = preType(item), post = postType(item);
553
- return values[pre] && (template.push({ value: values[pre] }), values[pre] = null), item.minLength = null, item.length = null, item.maxLength = null, template.push(item), values[item.type] = values[item.type], values[post] && (template.push({ value: values[post] }), values[post] = null), function($1, $2, length) {
554
- return renderTemplate(length, template, values);
555
- };
556
- }
557
- function prepareItems(width, template, values) {
558
- function cloneAndObjectify(item, index, arr) {
559
- var cloned = new TemplateItem(item, width), type = cloned.type;
560
- if (cloned.value == null)
561
- if (type in values)
562
- cloned.value = values[type];
563
- else {
564
- if (cloned.default == null)
565
- throw new error2.MissingTemplateValue(cloned, values);
566
- cloned.value = cloned.default;
567
- }
568
- return cloned.value == null || cloned.value === "" ? null : (cloned.index = index, cloned.first = index === 0, cloned.last = index === arr.length - 1, hasPreOrPost(cloned, values) && (cloned.value = generatePreAndPost(cloned, values)), cloned);
569
- }
570
- var output = template.map(cloneAndObjectify).filter(function(item) {
571
- return item != null;
572
- }), remainingSpace = width, variableCount = output.length;
573
- function consumeSpace(length) {
574
- length > remainingSpace && (length = remainingSpace), remainingSpace -= length;
575
- }
576
- function finishSizing(item, length) {
577
- if (item.finished)
578
- throw new error2.Internal("Tried to finish template item that was already finished");
579
- if (length === 1 / 0)
580
- throw new error2.Internal("Length of template item cannot be infinity");
581
- if (length != null && (item.length = length), item.minLength = null, item.maxLength = null, --variableCount, item.finished = !0, item.length == null && (item.length = item.getBaseLength()), item.length == null)
582
- throw new error2.Internal("Finished template items must have a length");
583
- consumeSpace(item.getLength());
584
- }
585
- output.forEach(function(item) {
586
- if (item.kerning) {
587
- var prevPadRight = item.first ? 0 : output[item.index - 1].padRight;
588
- !item.first && prevPadRight < item.kerning && (item.padLeft = item.kerning - prevPadRight), item.last || (item.padRight = item.kerning);
589
- }
590
- }), output.forEach(function(item) {
591
- item.getBaseLength() != null && finishSizing(item);
592
- });
593
- var resized = 0, resizing, hunkSize;
594
- do
595
- resizing = !1, hunkSize = Math.round(remainingSpace / variableCount), output.forEach(function(item) {
596
- item.finished || item.maxLength && item.getMaxLength() < hunkSize && (finishSizing(item, item.maxLength), resizing = !0);
597
- });
598
- while (resizing && resized++ < output.length);
599
- if (resizing)
600
- throw new error2.Internal("Resize loop iterated too many times while determining maxLength");
601
- resized = 0;
602
- do
603
- resizing = !1, hunkSize = Math.round(remainingSpace / variableCount), output.forEach(function(item) {
604
- item.finished || item.minLength && item.getMinLength() >= hunkSize && (finishSizing(item, item.minLength), resizing = !0);
605
- });
606
- while (resizing && resized++ < output.length);
607
- if (resizing)
608
- throw new error2.Internal("Resize loop iterated too many times while determining minLength");
609
- return hunkSize = Math.round(remainingSpace / variableCount), output.forEach(function(item) {
610
- item.finished || finishSizing(item, hunkSize);
611
- }), output;
612
- }
613
- function renderFunction(item, values, length) {
614
- return validate("OON", arguments), item.type ? item.value(values, values[item.type + "Theme"] || {}, length) : item.value(values, {}, length);
615
- }
616
- function renderValue(item, values) {
617
- var length = item.getBaseLength(), value = typeof item.value == "function" ? renderFunction(item, values, length) : item.value;
618
- if (value == null || value === "")
619
- return "";
620
- var alignWith = align[item.align] || align.left, leftPadding = item.padLeft ? align.left("", item.padLeft) : "", rightPadding = item.padRight ? align.right("", item.padRight) : "", truncated = wideTruncate(String(value), length), aligned = alignWith(truncated, length);
621
- return leftPadding + aligned + rightPadding;
622
- }
623
- }
624
- });
625
-
626
- // ../node_modules/gauge/lib/plumbing.js
627
- var require_plumbing = __commonJS({
628
- "../node_modules/gauge/lib/plumbing.js"(exports, module) {
629
- "use strict";
630
- var consoleControl = require_console_control_strings(), renderTemplate = require_render_template(), validate = require_aproba(), Plumbing = module.exports = function(theme, template, width) {
631
- width || (width = 80), validate("OAN", [theme, template, width]), this.showing = !1, this.theme = theme, this.width = width, this.template = template;
632
- };
633
- Plumbing.prototype = {};
634
- Plumbing.prototype.setTheme = function(theme) {
635
- validate("O", [theme]), this.theme = theme;
636
- };
637
- Plumbing.prototype.setTemplate = function(template) {
638
- validate("A", [template]), this.template = template;
639
- };
640
- Plumbing.prototype.setWidth = function(width) {
641
- validate("N", [width]), this.width = width;
642
- };
643
- Plumbing.prototype.hide = function() {
644
- return consoleControl.gotoSOL() + consoleControl.eraseLine();
645
- };
646
- Plumbing.prototype.hideCursor = consoleControl.hideCursor;
647
- Plumbing.prototype.showCursor = consoleControl.showCursor;
648
- Plumbing.prototype.show = function(status) {
649
- var values = Object.create(this.theme);
650
- for (var key in status)
651
- values[key] = status[key];
652
- return renderTemplate(this.width, this.template, values).trim() + consoleControl.color("reset") + consoleControl.eraseLine() + consoleControl.gotoSOL();
653
- };
654
- }
655
- });
656
-
657
- // ../node_modules/has-unicode/index.js
658
- var require_has_unicode = __commonJS({
659
- "../node_modules/has-unicode/index.js"(exports, module) {
660
- "use strict";
661
- var os = __require("os"), hasUnicode = module.exports = function() {
662
- if (os.type() == "Windows_NT")
663
- return !1;
664
- var isUTF8 = /UTF-?8$/i, ctype = process.env.LC_ALL || process.env.LC_CTYPE || process.env.LANG;
665
- return isUTF8.test(ctype);
666
- };
667
- }
668
- });
669
-
670
- // ../node_modules/color-support/index.js
671
- var require_color_support = __commonJS({
672
- "../node_modules/color-support/index.js"(exports, module) {
673
- module.exports = colorSupport({ alwaysReturn: !0 }, colorSupport);
674
- function hasNone(obj, options) {
675
- return obj.level = 0, obj.hasBasic = !1, obj.has256 = !1, obj.has16m = !1, options.alwaysReturn ? obj : !1;
676
- }
677
- function hasBasic(obj) {
678
- return obj.hasBasic = !0, obj.has256 = !1, obj.has16m = !1, obj.level = 1, obj;
679
- }
680
- function has256(obj) {
681
- return obj.hasBasic = !0, obj.has256 = !0, obj.has16m = !1, obj.level = 2, obj;
682
- }
683
- function has16m(obj) {
684
- return obj.hasBasic = !0, obj.has256 = !0, obj.has16m = !0, obj.level = 3, obj;
685
- }
686
- function colorSupport(options, obj) {
687
- if (options = options || {}, obj = obj || {}, typeof options.level == "number")
688
- switch (options.level) {
689
- case 0:
690
- return hasNone(obj, options);
691
- case 1:
692
- return hasBasic(obj);
693
- case 2:
694
- return has256(obj);
695
- case 3:
696
- return has16m(obj);
697
- }
698
- if (obj.level = 0, obj.hasBasic = !1, obj.has256 = !1, obj.has16m = !1, typeof process > "u" || !process || !process.stdout || !process.env || !process.platform)
699
- return hasNone(obj, options);
700
- var env = options.env || process.env, stream = options.stream || process.stdout, term = options.term || env.TERM || "", platform = options.platform || process.platform;
701
- if (!options.ignoreTTY && !stream.isTTY || !options.ignoreDumb && term === "dumb" && !env.COLORTERM)
702
- return hasNone(obj, options);
703
- if (platform === "win32")
704
- return hasBasic(obj);
705
- if (env.TMUX)
706
- return has256(obj);
707
- if (!options.ignoreCI && (env.CI || env.TEAMCITY_VERSION))
708
- return env.TRAVIS ? has256(obj) : hasNone(obj, options);
709
- switch (env.TERM_PROGRAM) {
710
- case "iTerm.app":
711
- var ver = env.TERM_PROGRAM_VERSION || "0.";
712
- return /^[0-2]\./.test(ver) ? has256(obj) : has16m(obj);
713
- case "HyperTerm":
714
- case "Hyper":
715
- return has16m(obj);
716
- case "MacTerm":
717
- return has16m(obj);
718
- case "Apple_Terminal":
719
- return has256(obj);
720
- }
721
- return /^xterm-256/.test(term) ? has256(obj) : /^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(term) || env.COLORTERM ? hasBasic(obj) : hasNone(obj, options);
722
- }
723
- }
724
- });
725
-
726
- // ../node_modules/gauge/lib/has-color.js
727
- var require_has_color = __commonJS({
728
- "../node_modules/gauge/lib/has-color.js"(exports, module) {
729
- "use strict";
730
- var colorSupport = require_color_support();
731
- module.exports = colorSupport().hasBasic;
732
- }
733
- });
734
-
735
- // ../node_modules/gauge/node_modules/signal-exit/dist/cjs/signals.js
736
- var require_signals = __commonJS({
737
- "../node_modules/gauge/node_modules/signal-exit/dist/cjs/signals.js"(exports) {
738
- "use strict";
739
- Object.defineProperty(exports, "__esModule", { value: !0 });
740
- exports.signals = void 0;
741
- exports.signals = [];
742
- exports.signals.push("SIGHUP", "SIGINT", "SIGTERM");
743
- process.platform !== "win32" && exports.signals.push(
744
- "SIGALRM",
745
- "SIGABRT",
746
- "SIGVTALRM",
747
- "SIGXCPU",
748
- "SIGXFSZ",
749
- "SIGUSR2",
750
- "SIGTRAP",
751
- "SIGSYS",
752
- "SIGQUIT",
753
- "SIGIOT"
754
- // should detect profiler and enable/disable accordingly.
755
- // see #21
756
- // 'SIGPROF'
757
- );
758
- process.platform === "linux" && exports.signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
759
- }
760
- });
761
-
762
- // ../node_modules/gauge/node_modules/signal-exit/dist/cjs/index.js
763
- var require_cjs = __commonJS({
764
- "../node_modules/gauge/node_modules/signal-exit/dist/cjs/index.js"(exports) {
765
- "use strict";
766
- var _a;
767
- Object.defineProperty(exports, "__esModule", { value: !0 });
768
- exports.unload = exports.load = exports.onExit = exports.signals = void 0;
769
- var signals_js_1 = require_signals();
770
- Object.defineProperty(exports, "signals", { enumerable: !0, get: function() {
771
- return signals_js_1.signals;
772
- } });
773
- var processOk = (process3) => !!process3 && typeof process3 == "object" && typeof process3.removeListener == "function" && typeof process3.emit == "function" && typeof process3.reallyExit == "function" && typeof process3.listeners == "function" && typeof process3.kill == "function" && typeof process3.pid == "number" && typeof process3.on == "function", kExitEmitter = Symbol.for("signal-exit emitter"), global = globalThis, ObjectDefineProperty = Object.defineProperty.bind(Object), Emitter = class {
774
- emitted = {
775
- afterExit: !1,
776
- exit: !1
777
- };
778
- listeners = {
779
- afterExit: [],
780
- exit: []
781
- };
782
- count = 0;
783
- id = Math.random();
784
- constructor() {
785
- if (global[kExitEmitter])
786
- return global[kExitEmitter];
787
- ObjectDefineProperty(global, kExitEmitter, {
788
- value: this,
789
- writable: !1,
790
- enumerable: !1,
791
- configurable: !1
792
- });
793
- }
794
- on(ev, fn) {
795
- this.listeners[ev].push(fn);
796
- }
797
- removeListener(ev, fn) {
798
- let list = this.listeners[ev], i = list.indexOf(fn);
799
- i !== -1 && (i === 0 && list.length === 1 ? list.length = 0 : list.splice(i, 1));
800
- }
801
- emit(ev, code, signal) {
802
- if (this.emitted[ev])
803
- return !1;
804
- this.emitted[ev] = !0;
805
- let ret = !1;
806
- for (let fn of this.listeners[ev])
807
- ret = fn(code, signal) === !0 || ret;
808
- return ev === "exit" && (ret = this.emit("afterExit", code, signal) || ret), ret;
809
- }
810
- }, SignalExitBase = class {
811
- }, signalExitWrap = (handler) => ({
812
- onExit(cb, opts) {
813
- return handler.onExit(cb, opts);
814
- },
815
- load() {
816
- return handler.load();
817
- },
818
- unload() {
819
- return handler.unload();
820
- }
821
- }), SignalExitFallback = class extends SignalExitBase {
822
- onExit() {
823
- return () => {
824
- };
825
- }
826
- load() {
827
- }
828
- unload() {
829
- }
830
- }, SignalExit = class extends SignalExitBase {
831
- // "SIGHUP" throws an `ENOSYS` error on Windows,
832
- // so use a supported signal instead
833
- /* c8 ignore start */
834
- #hupSig = process2.platform === "win32" ? "SIGINT" : "SIGHUP";
835
- /* c8 ignore stop */
836
- #emitter = new Emitter();
837
- #process;
838
- #originalProcessEmit;
839
- #originalProcessReallyExit;
840
- #sigListeners = {};
841
- #loaded = !1;
842
- constructor(process3) {
843
- super(), this.#process = process3, this.#sigListeners = {};
844
- for (let sig of signals_js_1.signals)
845
- this.#sigListeners[sig] = () => {
846
- let listeners = this.#process.listeners(sig), { count } = this.#emitter, p = process3;
847
- if (typeof p.__signal_exit_emitter__ == "object" && typeof p.__signal_exit_emitter__.count == "number" && (count += p.__signal_exit_emitter__.count), listeners.length === count) {
848
- this.unload();
849
- let ret = this.#emitter.emit("exit", null, sig), s = sig === "SIGHUP" ? this.#hupSig : sig;
850
- ret || process3.kill(process3.pid, s);
851
- }
852
- };
853
- this.#originalProcessReallyExit = process3.reallyExit, this.#originalProcessEmit = process3.emit;
854
- }
855
- onExit(cb, opts) {
856
- if (!processOk(this.#process))
857
- return () => {
858
- };
859
- this.#loaded === !1 && this.load();
860
- let ev = opts?.alwaysLast ? "afterExit" : "exit";
861
- return this.#emitter.on(ev, cb), () => {
862
- this.#emitter.removeListener(ev, cb), this.#emitter.listeners.exit.length === 0 && this.#emitter.listeners.afterExit.length === 0 && this.unload();
863
- };
864
- }
865
- load() {
866
- if (!this.#loaded) {
867
- this.#loaded = !0, this.#emitter.count += 1;
868
- for (let sig of signals_js_1.signals)
869
- try {
870
- let fn = this.#sigListeners[sig];
871
- fn && this.#process.on(sig, fn);
872
- } catch {
873
- }
874
- this.#process.emit = (ev, ...a) => this.#processEmit(ev, ...a), this.#process.reallyExit = (code) => this.#processReallyExit(code);
875
- }
876
- }
877
- unload() {
878
- this.#loaded && (this.#loaded = !1, signals_js_1.signals.forEach((sig) => {
879
- let listener = this.#sigListeners[sig];
880
- if (!listener)
881
- throw new Error("Listener not defined for signal: " + sig);
882
- try {
883
- this.#process.removeListener(sig, listener);
884
- } catch {
885
- }
886
- }), this.#process.emit = this.#originalProcessEmit, this.#process.reallyExit = this.#originalProcessReallyExit, this.#emitter.count -= 1);
887
- }
888
- #processReallyExit(code) {
889
- return processOk(this.#process) ? (this.#process.exitCode = code || 0, this.#emitter.emit("exit", this.#process.exitCode, null), this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode)) : 0;
890
- }
891
- #processEmit(ev, ...args) {
892
- let og = this.#originalProcessEmit;
893
- if (ev === "exit" && processOk(this.#process)) {
894
- typeof args[0] == "number" && (this.#process.exitCode = args[0]);
895
- let ret = og.call(this.#process, ev, ...args);
896
- return this.#emitter.emit("exit", this.#process.exitCode, null), ret;
897
- } else
898
- return og.call(this.#process, ev, ...args);
899
- }
900
- }, process2 = globalThis.process;
901
- _a = signalExitWrap(processOk(process2) ? new SignalExit(process2) : new SignalExitFallback()), /**
902
- * Called when the process is exiting, whether via signal, explicit
903
- * exit, or running out of stuff to do.
904
- *
905
- * If the global process object is not suitable for instrumentation,
906
- * then this will be a no-op.
907
- *
908
- * Returns a function that may be used to unload signal-exit.
909
- */
910
- exports.onExit = _a.onExit, /**
911
- * Load the listeners. Likely you never need to call this, unless
912
- * doing a rather deep integration with signal-exit functionality.
913
- * Mostly exposed for the benefit of testing.
914
- *
915
- * @internal
916
- */
917
- exports.load = _a.load, /**
918
- * Unload the listeners. Likely you never need to call this, unless
919
- * doing a rather deep integration with signal-exit functionality.
920
- * Mostly exposed for the benefit of testing.
921
- *
922
- * @internal
923
- */
924
- exports.unload = _a.unload;
925
- }
926
- });
927
-
928
- // ../node_modules/gauge/lib/spin.js
929
- var require_spin = __commonJS({
930
- "../node_modules/gauge/lib/spin.js"(exports, module) {
931
- "use strict";
932
- module.exports = function(spinstr, spun) {
933
- return spinstr[spun % spinstr.length];
934
- };
935
- }
936
- });
937
-
938
- // ../node_modules/gauge/lib/progress-bar.js
939
- var require_progress_bar = __commonJS({
940
- "../node_modules/gauge/lib/progress-bar.js"(exports, module) {
941
- "use strict";
942
- var validate = require_aproba(), renderTemplate = require_render_template(), wideTruncate = require_wide_truncate(), stringWidth2 = require_string_width();
943
- module.exports = function(theme, width, completed) {
944
- if (validate("ONN", [theme, width, completed]), completed < 0 && (completed = 0), completed > 1 && (completed = 1), width <= 0)
945
- return "";
946
- var sofar = Math.round(width * completed), rest = width - sofar, template = [
947
- { type: "complete", value: repeat(theme.complete, sofar), length: sofar },
948
- { type: "remaining", value: repeat(theme.remaining, rest), length: rest }
949
- ];
950
- return renderTemplate(width, template, theme);
951
- };
952
- function repeat(string, width) {
953
- var result = "", n = width;
954
- do
955
- n % 2 && (result += string), n = Math.floor(n / 2), string += string;
956
- while (n && stringWidth2(result) < width);
957
- return wideTruncate(result, width);
958
- }
959
- }
960
- });
961
-
962
- // ../node_modules/gauge/lib/base-theme.js
963
- var require_base_theme = __commonJS({
964
- "../node_modules/gauge/lib/base-theme.js"(exports, module) {
965
- "use strict";
966
- var spin = require_spin(), progressBar = require_progress_bar();
967
- module.exports = {
968
- activityIndicator: function(values, theme) {
969
- if (values.spun != null)
970
- return spin(theme, values.spun);
971
- },
972
- progressbar: function(values, theme, width) {
973
- if (values.completed != null)
974
- return progressBar(theme, width, values.completed);
975
- }
976
- };
977
- }
978
- });
979
-
980
- // ../node_modules/gauge/lib/theme-set.js
981
- var require_theme_set = __commonJS({
982
- "../node_modules/gauge/lib/theme-set.js"(exports, module) {
983
- "use strict";
984
- module.exports = function() {
985
- return ThemeSetProto.newThemeSet();
986
- };
987
- var ThemeSetProto = {};
988
- ThemeSetProto.baseTheme = require_base_theme();
989
- ThemeSetProto.newTheme = function(parent, theme) {
990
- return theme || (theme = parent, parent = this.baseTheme), Object.assign({}, parent, theme);
991
- };
992
- ThemeSetProto.getThemeNames = function() {
993
- return Object.keys(this.themes);
994
- };
995
- ThemeSetProto.addTheme = function(name, parent, theme) {
996
- this.themes[name] = this.newTheme(parent, theme);
997
- };
998
- ThemeSetProto.addToAllThemes = function(theme) {
999
- var themes = this.themes;
1000
- Object.keys(themes).forEach(function(name) {
1001
- Object.assign(themes[name], theme);
1002
- }), Object.assign(this.baseTheme, theme);
1003
- };
1004
- ThemeSetProto.getTheme = function(name) {
1005
- if (!this.themes[name])
1006
- throw this.newMissingThemeError(name);
1007
- return this.themes[name];
1008
- };
1009
- ThemeSetProto.setDefault = function(opts, name) {
1010
- name == null && (name = opts, opts = {});
1011
- var platform = opts.platform == null ? "fallback" : opts.platform, hasUnicode = !!opts.hasUnicode, hasColor = !!opts.hasColor;
1012
- this.defaults[platform] || (this.defaults[platform] = { true: {}, false: {} }), this.defaults[platform][hasUnicode][hasColor] = name;
1013
- };
1014
- ThemeSetProto.getDefault = function(opts) {
1015
- opts || (opts = {});
1016
- var platformName = opts.platform || process.platform, platform = this.defaults[platformName] || this.defaults.fallback, hasUnicode = !!opts.hasUnicode, hasColor = !!opts.hasColor;
1017
- if (!platform)
1018
- throw this.newMissingDefaultThemeError(platformName, hasUnicode, hasColor);
1019
- if (!platform[hasUnicode][hasColor]) {
1020
- if (hasUnicode && hasColor && platform[!hasUnicode][hasColor])
1021
- hasUnicode = !1;
1022
- else if (hasUnicode && hasColor && platform[hasUnicode][!hasColor])
1023
- hasColor = !1;
1024
- else if (hasUnicode && hasColor && platform[!hasUnicode][!hasColor])
1025
- hasUnicode = !1, hasColor = !1;
1026
- else if (hasUnicode && !hasColor && platform[!hasUnicode][hasColor])
1027
- hasUnicode = !1;
1028
- else if (!hasUnicode && hasColor && platform[hasUnicode][!hasColor])
1029
- hasColor = !1;
1030
- else if (platform === this.defaults.fallback)
1031
- throw this.newMissingDefaultThemeError(platformName, hasUnicode, hasColor);
1032
- }
1033
- return platform[hasUnicode][hasColor] ? this.getTheme(platform[hasUnicode][hasColor]) : this.getDefault(Object.assign({}, opts, { platform: "fallback" }));
1034
- };
1035
- ThemeSetProto.newMissingThemeError = function newMissingThemeError(name) {
1036
- var err = new Error('Could not find a gauge theme named "' + name + '"');
1037
- return Error.captureStackTrace.call(err, newMissingThemeError), err.theme = name, err.code = "EMISSINGTHEME", err;
1038
- };
1039
- ThemeSetProto.newMissingDefaultThemeError = function newMissingDefaultThemeError(platformName, hasUnicode, hasColor) {
1040
- var err = new Error(
1041
- `Could not find a gauge theme for your platform/unicode/color use combo:
1042
- platform = ` + platformName + `
1043
- hasUnicode = ` + hasUnicode + `
1044
- hasColor = ` + hasColor
1045
- );
1046
- return Error.captureStackTrace.call(err, newMissingDefaultThemeError), err.platform = platformName, err.hasUnicode = hasUnicode, err.hasColor = hasColor, err.code = "EMISSINGTHEME", err;
1047
- };
1048
- ThemeSetProto.newThemeSet = function() {
1049
- var themeset = function(opts) {
1050
- return themeset.getDefault(opts);
1051
- };
1052
- return Object.assign(themeset, ThemeSetProto, {
1053
- themes: Object.assign({}, this.themes),
1054
- baseTheme: Object.assign({}, this.baseTheme),
1055
- defaults: JSON.parse(JSON.stringify(this.defaults || {}))
1056
- });
1057
- };
1058
- }
1059
- });
1060
-
1061
- // ../node_modules/gauge/lib/themes.js
1062
- var require_themes = __commonJS({
1063
- "../node_modules/gauge/lib/themes.js"(exports, module) {
1064
- "use strict";
1065
- var color = require_console_control_strings().color, ThemeSet = require_theme_set(), themes = module.exports = new ThemeSet();
1066
- themes.addTheme("ASCII", {
1067
- preProgressbar: "[",
1068
- postProgressbar: "]",
1069
- progressbarTheme: {
1070
- complete: "#",
1071
- remaining: "."
1072
- },
1073
- activityIndicatorTheme: "-\\|/",
1074
- preSubsection: ">"
1075
- });
1076
- themes.addTheme("colorASCII", themes.getTheme("ASCII"), {
1077
- progressbarTheme: {
1078
- preComplete: color("bgBrightWhite", "brightWhite"),
1079
- complete: "#",
1080
- postComplete: color("reset"),
1081
- preRemaining: color("bgBrightBlack", "brightBlack"),
1082
- remaining: ".",
1083
- postRemaining: color("reset")
1084
- }
1085
- });
1086
- themes.addTheme("brailleSpinner", {
1087
- preProgressbar: "(",
1088
- postProgressbar: ")",
1089
- progressbarTheme: {
1090
- complete: "#",
1091
- remaining: "\u2802"
1092
- },
1093
- activityIndicatorTheme: "\u280B\u2819\u2839\u2838\u283C\u2834\u2826\u2827\u2807\u280F",
1094
- preSubsection: ">"
1095
- });
1096
- themes.addTheme("colorBrailleSpinner", themes.getTheme("brailleSpinner"), {
1097
- progressbarTheme: {
1098
- preComplete: color("bgBrightWhite", "brightWhite"),
1099
- complete: "#",
1100
- postComplete: color("reset"),
1101
- preRemaining: color("bgBrightBlack", "brightBlack"),
1102
- remaining: "\u2802",
1103
- postRemaining: color("reset")
1104
- }
1105
- });
1106
- themes.setDefault({}, "ASCII");
1107
- themes.setDefault({ hasColor: !0 }, "colorASCII");
1108
- themes.setDefault({ platform: "darwin", hasUnicode: !0 }, "brailleSpinner");
1109
- themes.setDefault({ platform: "darwin", hasUnicode: !0, hasColor: !0 }, "colorBrailleSpinner");
1110
- themes.setDefault({ platform: "linux", hasUnicode: !0 }, "brailleSpinner");
1111
- themes.setDefault({ platform: "linux", hasUnicode: !0, hasColor: !0 }, "colorBrailleSpinner");
1112
- }
1113
- });
1114
-
1115
- // ../node_modules/gauge/lib/set-interval.js
1116
- var require_set_interval = __commonJS({
1117
- "../node_modules/gauge/lib/set-interval.js"(exports, module) {
1118
- "use strict";
1119
- module.exports = setInterval;
1120
- }
1121
- });
1122
-
1123
- // ../node_modules/gauge/lib/process.js
1124
- var require_process = __commonJS({
1125
- "../node_modules/gauge/lib/process.js"(exports, module) {
1126
- "use strict";
1127
- module.exports = process;
1128
- }
1129
- });
1130
-
1131
- // ../node_modules/gauge/lib/set-immediate.js
1132
- var require_set_immediate = __commonJS({
1133
- "../node_modules/gauge/lib/set-immediate.js"(exports, module) {
1134
- "use strict";
1135
- var process2 = require_process();
1136
- try {
1137
- module.exports = setImmediate;
1138
- } catch {
1139
- module.exports = process2.nextTick;
1140
- }
1141
- }
1142
- });
1143
-
1144
- // ../node_modules/gauge/lib/index.js
1145
- var require_lib2 = __commonJS({
1146
- "../node_modules/gauge/lib/index.js"(exports, module) {
1147
- "use strict";
1148
- var Plumbing = require_plumbing(), hasUnicode = require_has_unicode(), hasColor = require_has_color(), onExit = require_cjs().onExit, defaultThemes = require_themes(), setInterval2 = require_set_interval(), process2 = require_process(), setImmediate2 = require_set_immediate();
1149
- module.exports = Gauge;
1150
- function callWith(obj, method) {
1151
- return function() {
1152
- return method.call(obj);
1153
- };
1154
- }
1155
- function Gauge(arg1, arg2) {
1156
- var options, writeTo;
1157
- arg1 && arg1.write ? (writeTo = arg1, options = arg2 || {}) : arg2 && arg2.write ? (writeTo = arg2, options = arg1 || {}) : (writeTo = process2.stderr, options = arg1 || arg2 || {}), this._status = {
1158
- spun: 0,
1159
- section: "",
1160
- subsection: ""
1161
- }, this._paused = !1, this._disabled = !0, this._showing = !1, this._onScreen = !1, this._needsRedraw = !1, this._hideCursor = options.hideCursor == null ? !0 : options.hideCursor, this._fixedFramerate = options.fixedFramerate == null ? !/^v0\.8\./.test(process2.version) : options.fixedFramerate, this._lastUpdateAt = null, this._updateInterval = options.updateInterval == null ? 50 : options.updateInterval, this._themes = options.themes || defaultThemes, this._theme = options.theme;
1162
- var theme = this._computeTheme(options.theme), template = options.template || [
1163
- { type: "progressbar", length: 20 },
1164
- { type: "activityIndicator", kerning: 1, length: 1 },
1165
- { type: "section", kerning: 1, default: "" },
1166
- { type: "subsection", kerning: 1, default: "" }
1167
- ];
1168
- this.setWriteTo(writeTo, options.tty);
1169
- var PlumbingClass = options.Plumbing || Plumbing;
1170
- this._gauge = new PlumbingClass(theme, template, this.getWidth()), this._$$doRedraw = callWith(this, this._doRedraw), this._$$handleSizeChange = callWith(this, this._handleSizeChange), this._cleanupOnExit = options.cleanupOnExit == null || options.cleanupOnExit, this._removeOnExit = null, options.enabled || options.enabled == null && this._tty && this._tty.isTTY ? this.enable() : this.disable();
1171
- }
1172
- Gauge.prototype = {};
1173
- Gauge.prototype.isEnabled = function() {
1174
- return !this._disabled;
1175
- };
1176
- Gauge.prototype.setTemplate = function(template) {
1177
- this._gauge.setTemplate(template), this._showing && this._requestRedraw();
1178
- };
1179
- Gauge.prototype._computeTheme = function(theme) {
1180
- if (theme || (theme = {}), typeof theme == "string")
1181
- theme = this._themes.getTheme(theme);
1182
- else if (Object.keys(theme).length === 0 || theme.hasUnicode != null || theme.hasColor != null) {
1183
- var useUnicode = theme.hasUnicode == null ? hasUnicode() : theme.hasUnicode, useColor = theme.hasColor == null ? hasColor : theme.hasColor;
1184
- theme = this._themes.getDefault({
1185
- hasUnicode: useUnicode,
1186
- hasColor: useColor,
1187
- platform: theme.platform
1188
- });
1189
- }
1190
- return theme;
1191
- };
1192
- Gauge.prototype.setThemeset = function(themes) {
1193
- this._themes = themes, this.setTheme(this._theme);
1194
- };
1195
- Gauge.prototype.setTheme = function(theme) {
1196
- this._gauge.setTheme(this._computeTheme(theme)), this._showing && this._requestRedraw(), this._theme = theme;
1197
- };
1198
- Gauge.prototype._requestRedraw = function() {
1199
- this._needsRedraw = !0, this._fixedFramerate || this._doRedraw();
1200
- };
1201
- Gauge.prototype.getWidth = function() {
1202
- return (this._tty && this._tty.columns || 80) - 1;
1203
- };
1204
- Gauge.prototype.setWriteTo = function(writeTo, tty) {
1205
- var enabled = !this._disabled;
1206
- enabled && this.disable(), this._writeTo = writeTo, this._tty = tty || writeTo === process2.stderr && process2.stdout.isTTY && process2.stdout || writeTo.isTTY && writeTo || this._tty, this._gauge && this._gauge.setWidth(this.getWidth()), enabled && this.enable();
1207
- };
1208
- Gauge.prototype.enable = function() {
1209
- this._disabled && (this._disabled = !1, this._tty && this._enableEvents(), this._showing && this.show());
1210
- };
1211
- Gauge.prototype.disable = function() {
1212
- this._disabled || (this._showing && (this._lastUpdateAt = null, this._showing = !1, this._doRedraw(), this._showing = !0), this._disabled = !0, this._tty && this._disableEvents());
1213
- };
1214
- Gauge.prototype._enableEvents = function() {
1215
- this._cleanupOnExit && (this._removeOnExit = onExit(callWith(this, this.disable))), this._tty.on("resize", this._$$handleSizeChange), this._fixedFramerate && (this.redrawTracker = setInterval2(this._$$doRedraw, this._updateInterval), this.redrawTracker.unref && this.redrawTracker.unref());
1216
- };
1217
- Gauge.prototype._disableEvents = function() {
1218
- this._tty.removeListener("resize", this._$$handleSizeChange), this._fixedFramerate && clearInterval(this.redrawTracker), this._removeOnExit && this._removeOnExit();
1219
- };
1220
- Gauge.prototype.hide = function(cb) {
1221
- if (this._disabled || !this._showing)
1222
- return cb && process2.nextTick(cb);
1223
- this._showing = !1, this._doRedraw(), cb && setImmediate2(cb);
1224
- };
1225
- Gauge.prototype.show = function(section, completed) {
1226
- if (this._showing = !0, typeof section == "string")
1227
- this._status.section = section;
1228
- else if (typeof section == "object")
1229
- for (var sectionKeys = Object.keys(section), ii = 0; ii < sectionKeys.length; ++ii) {
1230
- var key = sectionKeys[ii];
1231
- this._status[key] = section[key];
1232
- }
1233
- completed != null && (this._status.completed = completed), !this._disabled && this._requestRedraw();
1234
- };
1235
- Gauge.prototype.pulse = function(subsection) {
1236
- this._status.subsection = subsection || "", this._status.spun++, !this._disabled && this._showing && this._requestRedraw();
1237
- };
1238
- Gauge.prototype._handleSizeChange = function() {
1239
- this._gauge.setWidth(this._tty.columns - 1), this._requestRedraw();
1240
- };
1241
- Gauge.prototype._doRedraw = function() {
1242
- if (!(this._disabled || this._paused)) {
1243
- if (!this._fixedFramerate) {
1244
- var now = Date.now();
1245
- if (this._lastUpdateAt && now - this._lastUpdateAt < this._updateInterval)
1246
- return;
1247
- this._lastUpdateAt = now;
1248
- }
1249
- if (!this._showing && this._onScreen) {
1250
- this._onScreen = !1;
1251
- var result = this._gauge.hide();
1252
- return this._hideCursor && (result += this._gauge.showCursor()), this._writeTo.write(result);
1253
- }
1254
- !this._showing && !this._onScreen || (this._showing && !this._onScreen && (this._onScreen = !0, this._needsRedraw = !0, this._hideCursor && this._writeTo.write(this._gauge.hideCursor())), this._needsRedraw && (this._writeTo.write(this._gauge.show(this._status)) || (this._paused = !0, this._writeTo.on("drain", callWith(this, function() {
1255
- this._paused = !1, this._doRedraw();
1256
- })))));
1257
- }
1258
- };
1259
- }
1260
- });
1261
-
1262
- // ../node_modules/set-blocking/index.js
1263
- var require_set_blocking = __commonJS({
1264
- "../node_modules/set-blocking/index.js"(exports, module) {
1265
- module.exports = function(blocking) {
1266
- [process.stdout, process.stderr].forEach(function(stream) {
1267
- stream._handle && stream.isTTY && typeof stream._handle.setBlocking == "function" && stream._handle.setBlocking(blocking);
1268
- });
1269
- };
1270
- }
1271
- });
1272
-
1273
- // ../node_modules/npmlog/lib/log.js
1274
- var require_log = __commonJS({
1275
- "../node_modules/npmlog/lib/log.js"(exports, module) {
1276
- "use strict";
1277
- var Progress = require_lib(), Gauge = require_lib2(), EE = __require("events").EventEmitter, log2 = exports = module.exports = new EE(), util = __require("util"), setBlocking = require_set_blocking(), consoleControl = require_console_control_strings();
1278
- setBlocking(!0);
1279
- var stream = process.stderr;
1280
- Object.defineProperty(log2, "stream", {
1281
- set: function(newStream) {
1282
- stream = newStream, this.gauge && this.gauge.setWriteTo(stream, stream);
1283
- },
1284
- get: function() {
1285
- return stream;
1286
- }
1287
- });
1288
- var colorEnabled;
1289
- log2.useColor = function() {
1290
- return colorEnabled ?? stream.isTTY;
1291
- };
1292
- log2.enableColor = function() {
1293
- colorEnabled = !0, this.gauge.setTheme({ hasColor: colorEnabled, hasUnicode: unicodeEnabled });
1294
- };
1295
- log2.disableColor = function() {
1296
- colorEnabled = !1, this.gauge.setTheme({ hasColor: colorEnabled, hasUnicode: unicodeEnabled });
1297
- };
1298
- log2.level = "info";
1299
- log2.gauge = new Gauge(stream, {
1300
- enabled: !1,
1301
- // no progress bars unless asked
1302
- theme: { hasColor: log2.useColor() },
1303
- template: [
1304
- { type: "progressbar", length: 20 },
1305
- { type: "activityIndicator", kerning: 1, length: 1 },
1306
- { type: "section", default: "" },
1307
- ":",
1308
- { type: "logline", kerning: 1, default: "" }
1309
- ]
1310
- });
1311
- log2.tracker = new Progress.TrackerGroup();
1312
- log2.progressEnabled = log2.gauge.isEnabled();
1313
- var unicodeEnabled;
1314
- log2.enableUnicode = function() {
1315
- unicodeEnabled = !0, this.gauge.setTheme({ hasColor: this.useColor(), hasUnicode: unicodeEnabled });
1316
- };
1317
- log2.disableUnicode = function() {
1318
- unicodeEnabled = !1, this.gauge.setTheme({ hasColor: this.useColor(), hasUnicode: unicodeEnabled });
1319
- };
1320
- log2.setGaugeThemeset = function(themes) {
1321
- this.gauge.setThemeset(themes);
1322
- };
1323
- log2.setGaugeTemplate = function(template) {
1324
- this.gauge.setTemplate(template);
1325
- };
1326
- log2.enableProgress = function() {
1327
- this.progressEnabled || this._paused || (this.progressEnabled = !0, this.tracker.on("change", this.showProgress), this.gauge.enable());
1328
- };
1329
- log2.disableProgress = function() {
1330
- this.progressEnabled && (this.progressEnabled = !1, this.tracker.removeListener("change", this.showProgress), this.gauge.disable());
1331
- };
1332
- var trackerConstructors = ["newGroup", "newItem", "newStream"], mixinLog = function(tracker) {
1333
- return Object.keys(log2).forEach(function(P2) {
1334
- if (P2[0] !== "_" && !trackerConstructors.filter(function(C) {
1335
- return C === P2;
1336
- }).length && !tracker[P2] && typeof log2[P2] == "function") {
1337
- var func = log2[P2];
1338
- tracker[P2] = function() {
1339
- return func.apply(log2, arguments);
1340
- };
1341
- }
1342
- }), tracker instanceof Progress.TrackerGroup && trackerConstructors.forEach(function(C) {
1343
- var func = tracker[C];
1344
- tracker[C] = function() {
1345
- return mixinLog(func.apply(tracker, arguments));
1346
- };
1347
- }), tracker;
1348
- };
1349
- trackerConstructors.forEach(function(C) {
1350
- log2[C] = function() {
1351
- return mixinLog(this.tracker[C].apply(this.tracker, arguments));
1352
- };
1353
- });
1354
- log2.clearProgress = function(cb) {
1355
- if (!this.progressEnabled)
1356
- return cb && process.nextTick(cb);
1357
- this.gauge.hide(cb);
1358
- };
1359
- log2.showProgress = function(name, completed) {
1360
- if (this.progressEnabled) {
1361
- var values = {};
1362
- name && (values.section = name);
1363
- var last = log2.record[log2.record.length - 1];
1364
- if (last) {
1365
- values.subsection = last.prefix;
1366
- var disp = log2.disp[last.level] || last.level, logline = this._format(disp, log2.style[last.level]);
1367
- last.prefix && (logline += " " + this._format(last.prefix, this.prefixStyle)), logline += " " + last.message.split(/\r?\n/)[0], values.logline = logline;
1368
- }
1369
- values.completed = completed || this.tracker.completed(), this.gauge.show(values);
1370
- }
1371
- }.bind(log2);
1372
- log2.pause = function() {
1373
- this._paused = !0, this.progressEnabled && this.gauge.disable();
1374
- };
1375
- log2.resume = function() {
1376
- if (this._paused) {
1377
- this._paused = !1;
1378
- var b2 = this._buffer;
1379
- this._buffer = [], b2.forEach(function(m) {
1380
- this.emitLog(m);
1381
- }, this), this.progressEnabled && this.gauge.enable();
1382
- }
1383
- };
1384
- log2._buffer = [];
1385
- var id = 0;
1386
- log2.record = [];
1387
- log2.maxRecordSize = 1e4;
1388
- log2.log = function(lvl, prefix, message) {
1389
- var l = this.levels[lvl];
1390
- if (l === void 0)
1391
- return this.emit("error", new Error(util.format(
1392
- "Undefined log level: %j",
1393
- lvl
1394
- )));
1395
- for (var a = new Array(arguments.length - 2), stack = null, i = 2; i < arguments.length; i++) {
1396
- var arg = a[i - 2] = arguments[i];
1397
- typeof arg == "object" && arg instanceof Error && arg.stack && Object.defineProperty(arg, "stack", {
1398
- value: stack = arg.stack + "",
1399
- enumerable: !0,
1400
- writable: !0
1401
- });
1402
- }
1403
- stack && a.unshift(stack + `
1404
- `), message = util.format.apply(util, a);
1405
- var m = {
1406
- id: id++,
1407
- level: lvl,
1408
- prefix: String(prefix || ""),
1409
- message,
1410
- messageRaw: a
1411
- };
1412
- this.emit("log", m), this.emit("log." + lvl, m), m.prefix && this.emit(m.prefix, m), this.record.push(m);
1413
- var mrs = this.maxRecordSize, n = this.record.length - mrs;
1414
- if (n > mrs / 10) {
1415
- var newSize = Math.floor(mrs * 0.9);
1416
- this.record = this.record.slice(-1 * newSize);
1417
- }
1418
- this.emitLog(m);
1419
- }.bind(log2);
1420
- log2.emitLog = function(m) {
1421
- if (this._paused) {
1422
- this._buffer.push(m);
1423
- return;
1424
- }
1425
- this.progressEnabled && this.gauge.pulse(m.prefix);
1426
- var l = this.levels[m.level];
1427
- if (l !== void 0 && !(l < this.levels[this.level]) && !(l > 0 && !isFinite(l))) {
1428
- var disp = log2.disp[m.level] != null ? log2.disp[m.level] : m.level;
1429
- this.clearProgress(), m.message.split(/\r?\n/).forEach(function(line) {
1430
- var heading = this.heading;
1431
- heading && (this.write(heading, this.headingStyle), this.write(" ")), this.write(disp, log2.style[m.level]);
1432
- var p = m.prefix || "";
1433
- p && this.write(" "), this.write(p, this.prefixStyle), this.write(" " + line + `
1434
- `);
1435
- }, this), this.showProgress();
1436
- }
1437
- };
1438
- log2._format = function(msg, style) {
1439
- if (stream) {
1440
- var output = "";
1441
- if (this.useColor()) {
1442
- style = style || {};
1443
- var settings = [];
1444
- style.fg && settings.push(style.fg), style.bg && settings.push("bg" + style.bg[0].toUpperCase() + style.bg.slice(1)), style.bold && settings.push("bold"), style.underline && settings.push("underline"), style.inverse && settings.push("inverse"), settings.length && (output += consoleControl.color(settings)), style.beep && (output += consoleControl.beep());
1445
- }
1446
- return output += msg, this.useColor() && (output += consoleControl.color("reset")), output;
1447
- }
1448
- };
1449
- log2.write = function(msg, style) {
1450
- stream && stream.write(this._format(msg, style));
1451
- };
1452
- log2.addLevel = function(lvl, n, style, disp) {
1453
- disp == null && (disp = lvl), this.levels[lvl] = n, this.style[lvl] = style, this[lvl] || (this[lvl] = function() {
1454
- var a = new Array(arguments.length + 1);
1455
- a[0] = lvl;
1456
- for (var i = 0; i < arguments.length; i++)
1457
- a[i + 1] = arguments[i];
1458
- return this.log.apply(this, a);
1459
- }.bind(this)), this.disp[lvl] = disp;
1460
- };
1461
- log2.prefixStyle = { fg: "magenta" };
1462
- log2.headingStyle = { fg: "white", bg: "black" };
1463
- log2.style = {};
1464
- log2.levels = {};
1465
- log2.disp = {};
1466
- log2.addLevel("silly", -1 / 0, { inverse: !0 }, "sill");
1467
- log2.addLevel("verbose", 1e3, { fg: "cyan", bg: "black" }, "verb");
1468
- log2.addLevel("info", 2e3, { fg: "green" });
1469
- log2.addLevel("timing", 2500, { fg: "green", bg: "black" });
1470
- log2.addLevel("http", 3e3, { fg: "green", bg: "black" });
1471
- log2.addLevel("notice", 3500, { fg: "cyan", bg: "black" });
1472
- log2.addLevel("warn", 4e3, { fg: "black", bg: "yellow" }, "WARN");
1473
- log2.addLevel("error", 5e3, { fg: "red", bg: "black" }, "ERR!");
1474
- log2.addLevel("silent", 1 / 0);
1475
- log2.on("error", function() {
1476
- });
1477
- }
1478
- });
1479
-
1480
- // ../node_modules/eastasianwidth/eastasianwidth.js
1481
- var require_eastasianwidth = __commonJS({
1482
- "../node_modules/eastasianwidth/eastasianwidth.js"(exports, module) {
1483
- var eaw = {};
1484
- typeof module > "u" ? window.eastasianwidth = eaw : module.exports = eaw;
1485
- eaw.eastAsianWidth = function(character) {
1486
- var x2 = character.charCodeAt(0), y2 = character.length == 2 ? character.charCodeAt(1) : 0, codePoint = x2;
1487
- return 55296 <= x2 && x2 <= 56319 && 56320 <= y2 && y2 <= 57343 && (x2 &= 1023, y2 &= 1023, codePoint = x2 << 10 | y2, codePoint += 65536), codePoint == 12288 || 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510 ? "F" : codePoint == 8361 || 65377 <= codePoint && codePoint <= 65470 || 65474 <= codePoint && codePoint <= 65479 || 65482 <= codePoint && codePoint <= 65487 || 65490 <= codePoint && codePoint <= 65495 || 65498 <= codePoint && codePoint <= 65500 || 65512 <= codePoint && codePoint <= 65518 ? "H" : 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 ? "W" : 32 <= codePoint && codePoint <= 126 || 162 <= codePoint && codePoint <= 163 || 165 <= codePoint && codePoint <= 166 || codePoint == 172 || codePoint == 175 || 10214 <= codePoint && codePoint <= 10221 || 10629 <= codePoint && codePoint <= 10630 ? "Na" : codePoint == 161 || codePoint == 164 || 167 <= codePoint && codePoint <= 168 || codePoint == 170 || 173 <= codePoint && codePoint <= 174 || 176 <= codePoint && codePoint <= 180 || 182 <= codePoint && codePoint <= 186 || 188 <= codePoint && codePoint <= 191 || codePoint == 198 || codePoint == 208 || 215 <= codePoint && codePoint <= 216 || 222 <= codePoint && codePoint <= 225 || codePoint == 230 || 232 <= codePoint && codePoint <= 234 || 236 <= codePoint && codePoint <= 237 || codePoint == 240 || 242 <= codePoint && codePoint <= 243 || 247 <= codePoint && codePoint <= 250 || codePoint == 252 || codePoint == 254 || codePoint == 257 || codePoint == 273 || codePoint == 275 || codePoint == 283 || 294 <= codePoint && codePoint <= 295 || codePoint == 299 || 305 <= codePoint && codePoint <= 307 || codePoint == 312 || 319 <= codePoint && codePoint <= 322 || codePoint == 324 || 328 <= codePoint && codePoint <= 331 || codePoint == 333 || 338 <= codePoint && codePoint <= 339 || 358 <= codePoint && codePoint <= 359 || codePoint == 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 || 713 <= codePoint && codePoint <= 715 || codePoint == 717 || codePoint == 720 || 728 <= codePoint && codePoint <= 731 || codePoint == 733 || codePoint == 735 || 768 <= codePoint && codePoint <= 879 || 913 <= codePoint && codePoint <= 929 || 931 <= codePoint && codePoint <= 937 || 945 <= codePoint && codePoint <= 961 || 963 <= codePoint && codePoint <= 969 || codePoint == 1025 || 1040 <= codePoint && codePoint <= 1103 || codePoint == 1105 || codePoint == 8208 || 8211 <= codePoint && codePoint <= 8214 || 8216 <= codePoint && codePoint <= 8217 || 8220 <= codePoint && codePoint <= 8221 || 8224 <= codePoint && codePoint <= 8226 || 8228 <= codePoint && codePoint <= 8231 || codePoint == 8240 || 8242 <= codePoint && codePoint <= 8243 || codePoint == 8245 || codePoint == 8251 || codePoint == 8254 || codePoint == 8308 || codePoint == 8319 || 8321 <= codePoint && codePoint <= 8324 || codePoint == 8364 || codePoint == 8451 || codePoint == 8453 || codePoint == 8457 || codePoint == 8467 || codePoint == 8470 || 8481 <= codePoint && codePoint <= 8482 || codePoint == 8486 || codePoint == 8491 || 8531 <= codePoint && codePoint <= 8532 || 8539 <= codePoint && codePoint <= 8542 || 8544 <= codePoint && codePoint <= 8555 || 8560 <= codePoint && codePoint <= 8569 || codePoint == 8585 || 8592 <= codePoint && codePoint <= 8601 || 8632 <= codePoint && codePoint <= 8633 || codePoint == 8658 || codePoint == 8660 || codePoint == 8679 || codePoint == 8704 || 8706 <= codePoint && codePoint <= 8707 || 8711 <= codePoint && codePoint <= 8712 || codePoint == 8715 || codePoint == 8719 || codePoint == 8721 || codePoint == 8725 || codePoint == 8730 || 8733 <= codePoint && codePoint <= 8736 || codePoint == 8739 || codePoint == 8741 || 8743 <= codePoint && codePoint <= 8748 || codePoint == 8750 || 8756 <= codePoint && codePoint <= 8759 || 8764 <= codePoint && codePoint <= 8765 || codePoint == 8776 || codePoint == 8780 || codePoint == 8786 || 8800 <= codePoint && codePoint <= 8801 || 8804 <= codePoint && codePoint <= 8807 || 8810 <= codePoint && codePoint <= 8811 || 8814 <= codePoint && codePoint <= 8815 || 8834 <= codePoint && codePoint <= 8835 || 8838 <= codePoint && codePoint <= 8839 || codePoint == 8853 || codePoint == 8857 || codePoint == 8869 || codePoint == 8895 || codePoint == 8978 || 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 || codePoint == 9675 || 9678 <= codePoint && codePoint <= 9681 || 9698 <= codePoint && codePoint <= 9701 || codePoint == 9711 || 9733 <= codePoint && codePoint <= 9734 || codePoint == 9737 || 9742 <= codePoint && codePoint <= 9743 || 9748 <= codePoint && codePoint <= 9749 || codePoint == 9756 || codePoint == 9758 || codePoint == 9792 || codePoint == 9794 || 9824 <= codePoint && codePoint <= 9825 || 9827 <= codePoint && codePoint <= 9829 || 9831 <= codePoint && codePoint <= 9834 || 9836 <= codePoint && codePoint <= 9837 || codePoint == 9839 || 9886 <= codePoint && codePoint <= 9887 || 9918 <= codePoint && codePoint <= 9919 || 9924 <= codePoint && codePoint <= 9933 || 9935 <= codePoint && codePoint <= 9953 || codePoint == 9955 || 9960 <= codePoint && codePoint <= 9983 || codePoint == 10045 || codePoint == 10071 || 10102 <= codePoint && codePoint <= 10111 || 11093 <= codePoint && codePoint <= 11097 || 12872 <= codePoint && codePoint <= 12879 || 57344 <= codePoint && codePoint <= 63743 || 65024 <= codePoint && codePoint <= 65039 || codePoint == 65533 || 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 ? "A" : "N";
1488
- };
1489
- eaw.characterLength = function(character) {
1490
- var code = this.eastAsianWidth(character);
1491
- return code == "F" || code == "W" || code == "A" ? 2 : 1;
1492
- };
1493
- function stringToArray(string) {
1494
- return string.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
1495
- }
1496
- eaw.length = function(string) {
1497
- for (var characters = stringToArray(string), len = 0, i = 0; i < characters.length; i++)
1498
- len = len + this.characterLength(characters[i]);
1499
- return len;
1500
- };
1501
- eaw.slice = function(text2, start, end) {
1502
- textLen = eaw.length(text2), start = start || 0, end = end || 1, start < 0 && (start = textLen + start), end < 0 && (end = textLen + end);
1503
- for (var result = "", eawLen = 0, chars = stringToArray(text2), i = 0; i < chars.length; i++) {
1504
- var char = chars[i], charLen = eaw.length(char);
1505
- if (eawLen >= start - (charLen == 2 ? 1 : 0))
1506
- if (eawLen + charLen <= end)
1507
- result += char;
1508
- else
1509
- break;
1510
- eawLen += charLen;
1511
- }
1512
- return result;
1513
- };
1514
- }
1515
- });
1516
-
1517
- // ../node_modules/emoji-regex/index.js
1518
- var require_emoji_regex = __commonJS({
1519
- "../node_modules/emoji-regex/index.js"(exports, module) {
1520
- "use strict";
1521
- module.exports = function() {
1522
- return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\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]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\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]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\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\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
1523
- };
1524
- }
1525
- });
1526
-
1527
- // src/node-logger/index.ts
1528
- var import_npmlog = __toESM(require_log(), 1), import_pretty_hrtime = __toESM(require_pretty_hrtime(), 1);
1529
-
1530
- // src/node-logger/logger/logger.ts
1531
- var logger_exports = {};
1532
- __export(logger_exports, {
1533
- SYMBOLS: () => SYMBOLS,
1534
- debug: () => debug,
1535
- error: () => error,
1536
- getLogLevel: () => getLogLevel,
1537
- info: () => info,
1538
- intro: () => intro,
1539
- log: () => log,
1540
- logBox: () => logBox,
1541
- outro: () => outro,
1542
- setLogLevel: () => setLogLevel,
1543
- shouldLog: () => shouldLog,
1544
- step: () => step,
1545
- warn: () => warn,
1546
- wrapTextForClack: () => wrapTextForClack
1547
- });
1548
-
1549
- // ../node_modules/@clack/core/dist/index.mjs
1550
- var import_picocolors = __toESM(require_picocolors(), 1), import_sisteransi = __toESM(require_src(), 1);
1551
- import { stdout as z, stdin as Y } from "node:process";
1552
- import * as k from "node:readline";
1553
- import nt from "node:readline";
1554
- import { ReadStream as q } from "node:tty";
1555
- var ut = (t2) => t2 === 161 || t2 === 164 || t2 === 167 || t2 === 168 || t2 === 170 || t2 === 173 || t2 === 174 || t2 >= 176 && t2 <= 180 || t2 >= 182 && t2 <= 186 || t2 >= 188 && t2 <= 191 || t2 === 198 || t2 === 208 || t2 === 215 || t2 === 216 || t2 >= 222 && t2 <= 225 || t2 === 230 || t2 >= 232 && t2 <= 234 || t2 === 236 || t2 === 237 || t2 === 240 || t2 === 242 || t2 === 243 || t2 >= 247 && t2 <= 250 || t2 === 252 || t2 === 254 || t2 === 257 || t2 === 273 || t2 === 275 || t2 === 283 || t2 === 294 || t2 === 295 || t2 === 299 || t2 >= 305 && t2 <= 307 || t2 === 312 || t2 >= 319 && t2 <= 322 || t2 === 324 || t2 >= 328 && t2 <= 331 || t2 === 333 || t2 === 338 || t2 === 339 || t2 === 358 || t2 === 359 || t2 === 363 || t2 === 462 || t2 === 464 || t2 === 466 || t2 === 468 || t2 === 470 || t2 === 472 || t2 === 474 || t2 === 476 || t2 === 593 || t2 === 609 || t2 === 708 || t2 === 711 || t2 >= 713 && t2 <= 715 || t2 === 717 || t2 === 720 || t2 >= 728 && t2 <= 731 || t2 === 733 || t2 === 735 || t2 >= 768 && t2 <= 879 || t2 >= 913 && t2 <= 929 || t2 >= 931 && t2 <= 937 || t2 >= 945 && t2 <= 961 || t2 >= 963 && t2 <= 969 || t2 === 1025 || t2 >= 1040 && t2 <= 1103 || t2 === 1105 || t2 === 8208 || t2 >= 8211 && t2 <= 8214 || t2 === 8216 || t2 === 8217 || t2 === 8220 || t2 === 8221 || t2 >= 8224 && t2 <= 8226 || t2 >= 8228 && t2 <= 8231 || t2 === 8240 || t2 === 8242 || t2 === 8243 || t2 === 8245 || t2 === 8251 || t2 === 8254 || t2 === 8308 || t2 === 8319 || t2 >= 8321 && t2 <= 8324 || t2 === 8364 || t2 === 8451 || t2 === 8453 || t2 === 8457 || t2 === 8467 || t2 === 8470 || t2 === 8481 || t2 === 8482 || t2 === 8486 || t2 === 8491 || t2 === 8531 || t2 === 8532 || t2 >= 8539 && t2 <= 8542 || t2 >= 8544 && t2 <= 8555 || t2 >= 8560 && t2 <= 8569 || t2 === 8585 || t2 >= 8592 && t2 <= 8601 || t2 === 8632 || t2 === 8633 || t2 === 8658 || t2 === 8660 || t2 === 8679 || t2 === 8704 || t2 === 8706 || t2 === 8707 || t2 === 8711 || t2 === 8712 || t2 === 8715 || t2 === 8719 || t2 === 8721 || t2 === 8725 || t2 === 8730 || t2 >= 8733 && t2 <= 8736 || t2 === 8739 || t2 === 8741 || t2 >= 8743 && t2 <= 8748 || t2 === 8750 || t2 >= 8756 && t2 <= 8759 || t2 === 8764 || t2 === 8765 || t2 === 8776 || t2 === 8780 || t2 === 8786 || t2 === 8800 || t2 === 8801 || t2 >= 8804 && t2 <= 8807 || t2 === 8810 || t2 === 8811 || t2 === 8814 || t2 === 8815 || t2 === 8834 || t2 === 8835 || t2 === 8838 || t2 === 8839 || t2 === 8853 || t2 === 8857 || t2 === 8869 || t2 === 8895 || t2 === 8978 || t2 >= 9312 && t2 <= 9449 || t2 >= 9451 && t2 <= 9547 || t2 >= 9552 && t2 <= 9587 || t2 >= 9600 && t2 <= 9615 || t2 >= 9618 && t2 <= 9621 || t2 === 9632 || t2 === 9633 || t2 >= 9635 && t2 <= 9641 || t2 === 9650 || t2 === 9651 || t2 === 9654 || t2 === 9655 || t2 === 9660 || t2 === 9661 || t2 === 9664 || t2 === 9665 || t2 >= 9670 && t2 <= 9672 || t2 === 9675 || t2 >= 9678 && t2 <= 9681 || t2 >= 9698 && t2 <= 9701 || t2 === 9711 || t2 === 9733 || t2 === 9734 || t2 === 9737 || t2 === 9742 || t2 === 9743 || t2 === 9756 || t2 === 9758 || t2 === 9792 || t2 === 9794 || t2 === 9824 || t2 === 9825 || t2 >= 9827 && t2 <= 9829 || t2 >= 9831 && t2 <= 9834 || t2 === 9836 || t2 === 9837 || t2 === 9839 || t2 === 9886 || t2 === 9887 || t2 === 9919 || t2 >= 9926 && t2 <= 9933 || t2 >= 9935 && t2 <= 9939 || t2 >= 9941 && t2 <= 9953 || t2 === 9955 || t2 === 9960 || t2 === 9961 || t2 >= 9963 && t2 <= 9969 || t2 === 9972 || t2 >= 9974 && t2 <= 9977 || t2 === 9979 || t2 === 9980 || t2 === 9982 || t2 === 9983 || t2 === 10045 || t2 >= 10102 && t2 <= 10111 || t2 >= 11094 && t2 <= 11097 || t2 >= 12872 && t2 <= 12879 || t2 >= 57344 && t2 <= 63743 || t2 >= 65024 && t2 <= 65039 || t2 === 65533 || t2 >= 127232 && t2 <= 127242 || t2 >= 127248 && t2 <= 127277 || t2 >= 127280 && t2 <= 127337 || t2 >= 127344 && t2 <= 127373 || t2 === 127375 || t2 === 127376 || t2 >= 127387 && t2 <= 127404 || t2 >= 917760 && t2 <= 917999 || t2 >= 983040 && t2 <= 1048573 || t2 >= 1048576 && t2 <= 1114109, ot = (t2) => t2 === 12288 || t2 >= 65281 && t2 <= 65376 || t2 >= 65504 && t2 <= 65510, at = (t2) => t2 >= 4352 && t2 <= 4447 || t2 === 8986 || t2 === 8987 || t2 === 9001 || t2 === 9002 || t2 >= 9193 && t2 <= 9196 || t2 === 9200 || t2 === 9203 || t2 === 9725 || t2 === 9726 || t2 === 9748 || t2 === 9749 || t2 >= 9800 && t2 <= 9811 || t2 === 9855 || t2 === 9875 || t2 === 9889 || t2 === 9898 || t2 === 9899 || t2 === 9917 || t2 === 9918 || t2 === 9924 || t2 === 9925 || t2 === 9934 || t2 === 9940 || t2 === 9962 || t2 === 9970 || t2 === 9971 || t2 === 9973 || t2 === 9978 || t2 === 9981 || t2 === 9989 || t2 === 9994 || t2 === 9995 || t2 === 10024 || t2 === 10060 || t2 === 10062 || t2 >= 10067 && t2 <= 10069 || t2 === 10071 || t2 >= 10133 && t2 <= 10135 || t2 === 10160 || t2 === 10175 || t2 === 11035 || t2 === 11036 || t2 === 11088 || t2 === 11093 || t2 >= 11904 && t2 <= 11929 || t2 >= 11931 && t2 <= 12019 || t2 >= 12032 && t2 <= 12245 || t2 >= 12272 && t2 <= 12287 || t2 >= 12289 && t2 <= 12350 || t2 >= 12353 && t2 <= 12438 || t2 >= 12441 && t2 <= 12543 || t2 >= 12549 && t2 <= 12591 || t2 >= 12593 && t2 <= 12686 || t2 >= 12688 && t2 <= 12771 || t2 >= 12783 && t2 <= 12830 || t2 >= 12832 && t2 <= 12871 || t2 >= 12880 && t2 <= 19903 || t2 >= 19968 && t2 <= 42124 || t2 >= 42128 && t2 <= 42182 || t2 >= 43360 && t2 <= 43388 || t2 >= 44032 && t2 <= 55203 || t2 >= 63744 && t2 <= 64255 || t2 >= 65040 && t2 <= 65049 || t2 >= 65072 && t2 <= 65106 || t2 >= 65108 && t2 <= 65126 || t2 >= 65128 && t2 <= 65131 || t2 >= 94176 && t2 <= 94180 || t2 === 94192 || t2 === 94193 || t2 >= 94208 && t2 <= 100343 || t2 >= 100352 && t2 <= 101589 || t2 >= 101632 && t2 <= 101640 || t2 >= 110576 && t2 <= 110579 || t2 >= 110581 && t2 <= 110587 || t2 === 110589 || t2 === 110590 || t2 >= 110592 && t2 <= 110882 || t2 === 110898 || t2 >= 110928 && t2 <= 110930 || t2 === 110933 || t2 >= 110948 && t2 <= 110951 || t2 >= 110960 && t2 <= 111355 || t2 === 126980 || t2 === 127183 || t2 === 127374 || t2 >= 127377 && t2 <= 127386 || t2 >= 127488 && t2 <= 127490 || t2 >= 127504 && t2 <= 127547 || t2 >= 127552 && t2 <= 127560 || t2 === 127568 || t2 === 127569 || t2 >= 127584 && t2 <= 127589 || t2 >= 127744 && t2 <= 127776 || t2 >= 127789 && t2 <= 127797 || t2 >= 127799 && t2 <= 127868 || t2 >= 127870 && t2 <= 127891 || t2 >= 127904 && t2 <= 127946 || t2 >= 127951 && t2 <= 127955 || t2 >= 127968 && t2 <= 127984 || t2 === 127988 || t2 >= 127992 && t2 <= 128062 || t2 === 128064 || t2 >= 128066 && t2 <= 128252 || t2 >= 128255 && t2 <= 128317 || t2 >= 128331 && t2 <= 128334 || t2 >= 128336 && t2 <= 128359 || t2 === 128378 || t2 === 128405 || t2 === 128406 || t2 === 128420 || t2 >= 128507 && t2 <= 128591 || t2 >= 128640 && t2 <= 128709 || t2 === 128716 || t2 >= 128720 && t2 <= 128722 || t2 >= 128725 && t2 <= 128727 || t2 >= 128732 && t2 <= 128735 || t2 === 128747 || t2 === 128748 || t2 >= 128756 && t2 <= 128764 || t2 >= 128992 && t2 <= 129003 || t2 === 129008 || t2 >= 129292 && t2 <= 129338 || t2 >= 129340 && t2 <= 129349 || t2 >= 129351 && t2 <= 129535 || t2 >= 129648 && t2 <= 129660 || t2 >= 129664 && t2 <= 129672 || t2 >= 129680 && t2 <= 129725 || t2 >= 129727 && t2 <= 129733 || t2 >= 129742 && t2 <= 129755 || t2 >= 129760 && t2 <= 129768 || t2 >= 129776 && t2 <= 129784 || t2 >= 131072 && t2 <= 196605 || t2 >= 196608 && t2 <= 262141, N = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y, y = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y, M = /\t{1,1000}/y, O = new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*", "yu"), L = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y, lt = new RegExp("\\p{M}+", "gu"), ht = { limit: 1 / 0, ellipsis: "" }, J = (t2, s = {}, e = {}) => {
1556
- let i = s.limit ?? 1 / 0, r = s.ellipsis ?? "", n = s?.ellipsisWidth ?? (r ? J(r, ht, e).width : 0), F = e.ansiWidth ?? 0, l = e.controlWidth ?? 0, a = e.tabWidth ?? 8, v = e.ambiguousWidth ?? 1, g = e.emojiWidth ?? 2, m = e.fullWidthWidth ?? 2, A = e.regularWidth ?? 1, V = e.wideWidth ?? 2, o = 0, u = 0, p = t2.length, E = 0, f = !1, d2 = p, _ = Math.max(0, i - n), C = 0, x2 = 0, h = 0, c = 0;
1557
- t: for (; ; ) {
1558
- if (x2 > C || u >= p && u > o) {
1559
- let rt = t2.slice(C, x2) || t2.slice(o, u);
1560
- E = 0;
1561
- for (let H2 of rt.replaceAll(lt, "")) {
1562
- let R2 = H2.codePointAt(0) || 0;
1563
- if (ot(R2) ? c = m : at(R2) ? c = V : v !== A && ut(R2) ? c = v : c = A, h + c > _ && (d2 = Math.min(d2, Math.max(C, o) + E)), h + c > i) {
1564
- f = !0;
1565
- break t;
1566
- }
1567
- E += H2.length, h += c;
1568
- }
1569
- C = x2 = 0;
1570
- }
1571
- if (u >= p) break;
1572
- if (L.lastIndex = u, L.test(t2)) {
1573
- if (E = L.lastIndex - u, c = E * A, h + c > _ && (d2 = Math.min(d2, u + Math.floor((_ - h) / A))), h + c > i) {
1574
- f = !0;
1575
- break;
1576
- }
1577
- h += c, C = o, x2 = u, u = o = L.lastIndex;
1578
- continue;
1579
- }
1580
- if (N.lastIndex = u, N.test(t2)) {
1581
- if (h + F > _ && (d2 = Math.min(d2, u)), h + F > i) {
1582
- f = !0;
1583
- break;
1584
- }
1585
- h += F, C = o, x2 = u, u = o = N.lastIndex;
1586
- continue;
1587
- }
1588
- if (y.lastIndex = u, y.test(t2)) {
1589
- if (E = y.lastIndex - u, c = E * l, h + c > _ && (d2 = Math.min(d2, u + Math.floor((_ - h) / l))), h + c > i) {
1590
- f = !0;
1591
- break;
1592
- }
1593
- h += c, C = o, x2 = u, u = o = y.lastIndex;
1594
- continue;
1595
- }
1596
- if (M.lastIndex = u, M.test(t2)) {
1597
- if (E = M.lastIndex - u, c = E * a, h + c > _ && (d2 = Math.min(d2, u + Math.floor((_ - h) / a))), h + c > i) {
1598
- f = !0;
1599
- break;
1600
- }
1601
- h += c, C = o, x2 = u, u = o = M.lastIndex;
1602
- continue;
1603
- }
1604
- if (O.lastIndex = u, O.test(t2)) {
1605
- if (h + g > _ && (d2 = Math.min(d2, u)), h + g > i) {
1606
- f = !0;
1607
- break;
1608
- }
1609
- h += g, C = o, x2 = u, u = o = O.lastIndex;
1610
- continue;
1611
- }
1612
- u += 1;
1613
- }
1614
- return { width: f ? _ : h, index: f ? d2 : p, truncated: f, ellipsed: f && i >= n };
1615
- }, ct = { limit: 1 / 0, ellipsis: "", ellipsisWidth: 0 }, S = (t2, s = {}) => J(t2, ct, s).width, W = "\x1B", X = "\x9B", Ft = 39, P = "\x07", Z = "[", pt = "]", Q = "m", j = `${pt}8;;`, tt = new RegExp(`(?:\\${Z}(?<code>\\d+)m|\\${j}(?<uri>.*)${P})`, "y"), ft = (t2) => {
1616
- if (t2 >= 30 && t2 <= 37 || t2 >= 90 && t2 <= 97) return 39;
1617
- if (t2 >= 40 && t2 <= 47 || t2 >= 100 && t2 <= 107) return 49;
1618
- if (t2 === 1 || t2 === 2) return 22;
1619
- if (t2 === 3) return 23;
1620
- if (t2 === 4) return 24;
1621
- if (t2 === 7) return 27;
1622
- if (t2 === 8) return 28;
1623
- if (t2 === 9) return 29;
1624
- if (t2 === 0) return 0;
1625
- }, st = (t2) => `${W}${Z}${t2}${Q}`, et = (t2) => `${W}${j}${t2}${P}`, dt = (t2) => t2.map((s) => S(s)), U = (t2, s, e) => {
1626
- let i = s[Symbol.iterator](), r = !1, n = !1, F = t2.at(-1), l = F === void 0 ? 0 : S(F), a = i.next(), v = i.next(), g = 0;
1627
- for (; !a.done; ) {
1628
- let m = a.value, A = S(m);
1629
- l + A <= e ? t2[t2.length - 1] += m : (t2.push(m), l = 0), (m === W || m === X) && (r = !0, n = s.startsWith(j, g + 1)), r ? n ? m === P && (r = !1, n = !1) : m === Q && (r = !1) : (l += A, l === e && !v.done && (t2.push(""), l = 0)), a = v, v = i.next(), g += m.length;
1630
- }
1631
- F = t2.at(-1), !l && F !== void 0 && F.length > 0 && t2.length > 1 && (t2[t2.length - 2] += t2.pop());
1632
- }, mt = (t2) => {
1633
- let s = t2.split(" "), e = s.length;
1634
- for (; e > 0 && !(S(s[e - 1]) > 0); ) e--;
1635
- return e === s.length ? t2 : s.slice(0, e).join(" ") + s.slice(e).join("");
1636
- }, gt = (t2, s, e = {}) => {
1637
- if (e.trim !== !1 && t2.trim() === "") return "";
1638
- let i = "", r, n, F = t2.split(" "), l = dt(F), a = [""];
1639
- for (let [o, u] of F.entries()) {
1640
- e.trim !== !1 && (a[a.length - 1] = (a.at(-1) ?? "").trimStart());
1641
- let p = S(a.at(-1) ?? "");
1642
- if (o !== 0 && (p >= s && (e.wordWrap === !1 || e.trim === !1) && (a.push(""), p = 0), (p > 0 || e.trim === !1) && (a[a.length - 1] += " ", p++)), e.hard && l[o] > s) {
1643
- let E = s - p, f = 1 + Math.floor((l[o] - E - 1) / s);
1644
- Math.floor((l[o] - 1) / s) < f && a.push(""), U(a, u, s);
1645
- continue;
1646
- }
1647
- if (p + l[o] > s && p > 0 && l[o] > 0) {
1648
- if (e.wordWrap === !1 && p < s) {
1649
- U(a, u, s);
1650
- continue;
1651
- }
1652
- a.push("");
1653
- }
1654
- if (p + l[o] > s && e.wordWrap === !1) {
1655
- U(a, u, s);
1656
- continue;
1657
- }
1658
- a[a.length - 1] += u;
1659
- }
1660
- e.trim !== !1 && (a = a.map((o) => mt(o)));
1661
- let v = a.join(`
1662
- `), g = v[Symbol.iterator](), m = g.next(), A = g.next(), V = 0;
1663
- for (; !m.done; ) {
1664
- let o = m.value, u = A.value;
1665
- if (i += o, o === W || o === X) {
1666
- tt.lastIndex = V + 1;
1667
- let f = tt.exec(v)?.groups;
1668
- if (f?.code !== void 0) {
1669
- let d2 = Number.parseFloat(f.code);
1670
- r = d2 === Ft ? void 0 : d2;
1671
- } else f?.uri !== void 0 && (n = f.uri.length === 0 ? void 0 : f.uri);
1672
- }
1673
- let p = r ? ft(r) : void 0;
1674
- u === `
1675
- ` ? (n && (i += et("")), r && p && (i += st(p))) : o === `
1676
- ` && (r && p && (i += st(r)), n && (i += et(n))), V += o.length, m = A, A = g.next();
1677
- }
1678
- return i;
1679
- };
1680
- function it(t2, s, e) {
1681
- return String(t2).normalize().replaceAll(`\r
1682
- `, `
1683
- `).split(`
1684
- `).map((i) => gt(i, s, e)).join(`
1685
- `);
1686
- }
1687
- var Et = ["up", "down", "left", "right", "space", "enter", "cancel"], b = { actions: new Set(Et), aliases: /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["", "cancel"], ["escape", "cancel"]]), messages: { cancel: "Canceled", error: "Something went wrong" } };
1688
- function G(t2, s) {
1689
- if (typeof t2 == "string") return b.aliases.get(t2) === s;
1690
- for (let e of t2) if (e !== void 0 && G(e, s)) return !0;
1691
- return !1;
1692
- }
1693
- function At(t2, s) {
1694
- if (t2 === s) return;
1695
- let e = t2.split(`
1696
- `), i = s.split(`
1697
- `), r = [];
1698
- for (let n = 0; n < Math.max(e.length, i.length); n++) e[n] !== i[n] && r.push(n);
1699
- return r;
1700
- }
1701
- var It = globalThis.process.platform.startsWith("win"), K = Symbol("clack:cancel");
1702
- function _t(t2) {
1703
- return t2 === K;
1704
- }
1705
- function T(t2, s) {
1706
- let e = t2;
1707
- e.isTTY && e.setRawMode(s);
1708
- }
1709
- function bt({ input: t2 = Y, output: s = z, overwrite: e = !0, hideCursor: i = !0 } = {}) {
1710
- let r = k.createInterface({ input: t2, output: s, prompt: "", tabSize: 1 });
1711
- k.emitKeypressEvents(t2, r), t2 instanceof q && t2.isTTY && t2.setRawMode(!0);
1712
- let n = (F, { name: l, sequence: a }) => {
1713
- let v = String(F);
1714
- if (G([v, l, a], "cancel")) {
1715
- i && s.write(import_sisteransi.cursor.show), process.exit(0);
1716
- return;
1717
- }
1718
- if (!e) return;
1719
- k.moveCursor(s, l === "return" ? 0 : -1, l === "return" ? -1 : 0, () => {
1720
- k.clearLine(s, 1, () => {
1721
- t2.once("keypress", n);
1722
- });
1723
- });
1724
- };
1725
- return i && s.write(import_sisteransi.cursor.hide), t2.once("keypress", n), () => {
1726
- t2.off("keypress", n), i && s.write(import_sisteransi.cursor.show), t2 instanceof q && t2.isTTY && !It && t2.setRawMode(!1), r.terminal = !1, r.close();
1727
- };
1728
- }
1729
- var Ct = (t2) => "columns" in t2 && typeof t2.columns == "number" ? t2.columns : 80, Bt = (t2) => "rows" in t2 && typeof t2.rows == "number" ? t2.rows : 20, B = class {
1730
- input;
1731
- output;
1732
- _abortSignal;
1733
- rl;
1734
- opts;
1735
- _render;
1736
- _track = !1;
1737
- _prevFrame = "";
1738
- _subscribers = /* @__PURE__ */ new Map();
1739
- _cursor = 0;
1740
- state = "initial";
1741
- error = "";
1742
- value;
1743
- userInput = "";
1744
- constructor(s, e = !0) {
1745
- let { input: i = Y, output: r = z, render: n, signal: F, ...l } = s;
1746
- this.opts = l, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = n.bind(this), this._track = e, this._abortSignal = F, this.input = i, this.output = r;
1747
- }
1748
- unsubscribe() {
1749
- this._subscribers.clear();
1750
- }
1751
- setSubscriber(s, e) {
1752
- let i = this._subscribers.get(s) ?? [];
1753
- i.push(e), this._subscribers.set(s, i);
1754
- }
1755
- on(s, e) {
1756
- this.setSubscriber(s, { cb: e });
1757
- }
1758
- once(s, e) {
1759
- this.setSubscriber(s, { cb: e, once: !0 });
1760
- }
1761
- emit(s, ...e) {
1762
- let i = this._subscribers.get(s) ?? [], r = [];
1763
- for (let n of i) n.cb(...e), n.once && r.push(() => i.splice(i.indexOf(n), 1));
1764
- for (let n of r) n();
1765
- }
1766
- prompt() {
1767
- return new Promise((s) => {
1768
- if (this._abortSignal) {
1769
- if (this._abortSignal.aborted) return this.state = "cancel", this.close(), s(K);
1770
- this._abortSignal.addEventListener("abort", () => {
1771
- this.state = "cancel", this.close();
1772
- }, { once: !0 });
1773
- }
1774
- this.rl = nt.createInterface({ input: this.input, tabSize: 2, prompt: "", escapeCodeTimeout: 50, terminal: !0 }), this.rl.prompt(), this.opts.initialUserInput !== void 0 && this._setUserInput(this.opts.initialUserInput, !0), this.input.on("keypress", this.onKeypress), T(this.input, !0), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
1775
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), T(this.input, !1), s(this.value);
1776
- }), this.once("cancel", () => {
1777
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), T(this.input, !1), s(K);
1778
- });
1779
- });
1780
- }
1781
- _isActionKey(s, e) {
1782
- return s === " ";
1783
- }
1784
- _setValue(s) {
1785
- this.value = s, this.emit("value", this.value);
1786
- }
1787
- _setUserInput(s, e) {
1788
- this.userInput = s ?? "", this.emit("userInput", this.userInput), e && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
1789
- }
1790
- _clearUserInput() {
1791
- this.rl?.write(null, { ctrl: !0, name: "u" }), this._setUserInput("");
1792
- }
1793
- onKeypress(s, e) {
1794
- if (this._track && e.name !== "return" && (e.name && this._isActionKey(s, e) && this.rl?.write(null, { ctrl: !0, name: "h" }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), e?.name && (!this._track && b.aliases.has(e.name) && this.emit("cursor", b.aliases.get(e.name)), b.actions.has(e.name) && this.emit("cursor", e.name)), s && (s.toLowerCase() === "y" || s.toLowerCase() === "n") && this.emit("confirm", s.toLowerCase() === "y"), this.emit("key", s?.toLowerCase(), e), e?.name === "return") {
1795
- if (this.opts.validate) {
1796
- let i = this.opts.validate(this.value);
1797
- i && (this.error = i instanceof Error ? i.message : i, this.state = "error", this.rl?.write(this.userInput));
1798
- }
1799
- this.state !== "error" && (this.state = "submit");
1800
- }
1801
- G([s, e?.name, e?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
1802
- }
1803
- close() {
1804
- this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
1805
- `), T(this.input, !1), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
1806
- }
1807
- restoreCursor() {
1808
- let s = it(this._prevFrame, process.stdout.columns, { hard: !0, trim: !1 }).split(`
1809
- `).length - 1;
1810
- this.output.write(import_sisteransi.cursor.move(-999, s * -1));
1811
- }
1812
- render() {
1813
- let s = it(this._render(this) ?? "", process.stdout.columns, { hard: !0, trim: !1 });
1814
- if (s !== this._prevFrame) {
1815
- if (this.state === "initial") this.output.write(import_sisteransi.cursor.hide);
1816
- else {
1817
- let e = At(this._prevFrame, s);
1818
- if (this.restoreCursor(), e && e?.length === 1) {
1819
- let i = e[0];
1820
- this.output.write(import_sisteransi.cursor.move(0, i)), this.output.write(import_sisteransi.erase.lines(1));
1821
- let r = s.split(`
1822
- `);
1823
- this.output.write(r[i]), this._prevFrame = s, this.output.write(import_sisteransi.cursor.move(0, r.length - i - 1));
1824
- return;
1825
- }
1826
- if (e && e?.length > 1) {
1827
- let i = e[0];
1828
- this.output.write(import_sisteransi.cursor.move(0, i)), this.output.write(import_sisteransi.erase.down());
1829
- let r = s.split(`
1830
- `).slice(i);
1831
- this.output.write(r.join(`
1832
- `)), this._prevFrame = s;
1833
- return;
1834
- }
1835
- this.output.write(import_sisteransi.erase.down());
1836
- }
1837
- this.output.write(s), this.state === "initial" && (this.state = "active"), this._prevFrame = s;
1838
- }
1839
- }
1840
- };
1841
- var Vt = class extends B {
1842
- get cursor() {
1843
- return this.value ? 0 : 1;
1844
- }
1845
- get _value() {
1846
- return this.cursor === 0;
1847
- }
1848
- constructor(s) {
1849
- super(s, !1), this.value = !!s.initialValue, this.on("userInput", () => {
1850
- this.value = this._value;
1851
- }), this.on("confirm", (e) => {
1852
- this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = e, this.state = "submit", this.close();
1853
- }), this.on("cursor", () => {
1854
- this.value = !this.value;
1855
- });
1856
- }
1857
- };
1858
- function w(t2, s, e) {
1859
- let i = t2 + s, r = Math.max(e.length - 1, 0), n = i < 0 ? r : i > r ? 0 : i;
1860
- return e[n].disabled ? w(n, s < 0 ? -1 : 1, e) : n;
1861
- }
1862
- var yt = class extends B {
1863
- options;
1864
- cursor = 0;
1865
- get _value() {
1866
- return this.options[this.cursor].value;
1867
- }
1868
- get _enabledOptions() {
1869
- return this.options.filter((s) => s.disabled !== !0);
1870
- }
1871
- toggleAll() {
1872
- let s = this._enabledOptions, e = this.value !== void 0 && this.value.length === s.length;
1873
- this.value = e ? [] : s.map((i) => i.value);
1874
- }
1875
- toggleInvert() {
1876
- let s = this.value;
1877
- if (!s) return;
1878
- let e = this._enabledOptions.filter((i) => !s.includes(i.value));
1879
- this.value = e.map((i) => i.value);
1880
- }
1881
- toggleValue() {
1882
- this.value === void 0 && (this.value = []);
1883
- let s = this.value.includes(this._value);
1884
- this.value = s ? this.value.filter((e) => e !== this._value) : [...this.value, this._value];
1885
- }
1886
- constructor(s) {
1887
- super(s, !1), this.options = s.options, this.value = [...s.initialValues ?? []];
1888
- let e = Math.max(this.options.findIndex(({ value: i }) => i === s.cursorAt), 0);
1889
- this.cursor = this.options[e].disabled ? w(e, 1, this.options) : e, this.on("key", (i) => {
1890
- i === "a" && this.toggleAll(), i === "i" && this.toggleInvert();
1891
- }), this.on("cursor", (i) => {
1892
- switch (i) {
1893
- case "left":
1894
- case "up":
1895
- this.cursor = w(this.cursor, -1, this.options);
1896
- break;
1897
- case "down":
1898
- case "right":
1899
- this.cursor = w(this.cursor, 1, this.options);
1900
- break;
1901
- case "space":
1902
- this.toggleValue();
1903
- break;
1904
- }
1905
- });
1906
- }
1907
- };
1908
- var Lt = class extends B {
1909
- options;
1910
- cursor = 0;
1911
- get _selectedValue() {
1912
- return this.options[this.cursor];
1913
- }
1914
- changeValue() {
1915
- this.value = this._selectedValue.value;
1916
- }
1917
- constructor(s) {
1918
- super(s, !1), this.options = s.options;
1919
- let e = this.options.findIndex(({ value: r }) => r === s.initialValue), i = e === -1 ? 0 : e;
1920
- this.cursor = this.options[i].disabled ? w(i, 1, this.options) : i, this.changeValue(), this.on("cursor", (r) => {
1921
- switch (r) {
1922
- case "left":
1923
- case "up":
1924
- this.cursor = w(this.cursor, -1, this.options);
1925
- break;
1926
- case "down":
1927
- case "right":
1928
- this.cursor = w(this.cursor, 1, this.options);
1929
- break;
1930
- }
1931
- this.changeValue();
1932
- });
1933
- }
1934
- };
1935
- var Tt = class extends B {
1936
- get userInputWithCursor() {
1937
- if (this.state === "submit") return this.userInput;
1938
- let s = this.userInput;
1939
- if (this.cursor >= s.length) return `${this.userInput}\u2588`;
1940
- let e = s.slice(0, this.cursor), [i, ...r] = s.slice(this.cursor);
1941
- return `${e}${import_picocolors.default.inverse(i)}${r.join("")}`;
1942
- }
1943
- get cursor() {
1944
- return this._cursor;
1945
- }
1946
- constructor(s) {
1947
- super({ ...s, initialUserInput: s.initialUserInput ?? s.initialValue }), this.on("userInput", (e) => {
1948
- this._setValue(e);
1949
- }), this.on("finalize", () => {
1950
- this.value || (this.value = s.defaultValue), this.value === void 0 && (this.value = "");
1951
- });
1952
- }
1953
- };
1954
-
1955
- // ../node_modules/@clack/prompts/dist/index.mjs
1956
- var import_picocolors2 = __toESM(require_picocolors(), 1);
1957
- import N2 from "node:process";
1958
- var import_sisteransi2 = __toESM(require_src(), 1);
1959
- function ut2() {
1960
- return N2.platform !== "win32" ? N2.env.TERM !== "linux" : !!N2.env.CI || !!N2.env.WT_SESSION || !!N2.env.TERMINUS_SUBLIME || N2.env.ConEmuTask === "{cmd::Cmder}" || N2.env.TERM_PROGRAM === "Terminus-Sublime" || N2.env.TERM_PROGRAM === "vscode" || N2.env.TERM === "xterm-256color" || N2.env.TERM === "alacritty" || N2.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
1961
- }
1962
- var z2 = ut2(), ne = () => process.env.CI === "true", Be = (e) => e.isTTY === !0, I2 = (e, i) => z2 ? e : i, be = I2("\u25C6", "*"), ae = I2("\u25A0", "x"), oe = I2("\u25B2", "x"), W2 = I2("\u25C7", "o"), le = I2("\u250C", "T"), d = I2("\u2502", "|"), x = I2("\u2514", "\u2014"), xe = I2("\u2510", "T"), _e = I2("\u2518", "\u2014"), J2 = I2("\u25CF", ">"), H = I2("\u25CB", " "), Z2 = I2("\u25FB", "[\u2022]"), j2 = I2("\u25FC", "[+]"), X2 = I2("\u25FB", "[ ]"), De = I2("\u25AA", "\u2022"), Q2 = I2("\u2500", "-"), ue = I2("\u256E", "+"), Te = I2("\u251C", "+"), ce = I2("\u256F", "+"), Me = I2("\u2570", "+"), Re = I2("\u256D", "+"), de = I2("\u25CF", "\u2022"), $e = I2("\u25C6", "*"), he = I2("\u25B2", "!"), me = I2("\u25A0", "x"), L2 = (e) => {
1963
- switch (e) {
1964
- case "initial":
1965
- case "active":
1966
- return import_picocolors2.default.cyan(be);
1967
- case "cancel":
1968
- return import_picocolors2.default.red(ae);
1969
- case "error":
1970
- return import_picocolors2.default.yellow(oe);
1971
- case "submit":
1972
- return import_picocolors2.default.green(W2);
1973
- }
1974
- }, ct2 = (e) => e === 161 || e === 164 || e === 167 || e === 168 || e === 170 || e === 173 || e === 174 || e >= 176 && e <= 180 || e >= 182 && e <= 186 || e >= 188 && e <= 191 || e === 198 || e === 208 || e === 215 || e === 216 || e >= 222 && e <= 225 || e === 230 || e >= 232 && e <= 234 || e === 236 || e === 237 || e === 240 || e === 242 || e === 243 || e >= 247 && e <= 250 || e === 252 || e === 254 || e === 257 || e === 273 || e === 275 || e === 283 || e === 294 || e === 295 || e === 299 || e >= 305 && e <= 307 || e === 312 || e >= 319 && e <= 322 || e === 324 || e >= 328 && e <= 331 || e === 333 || e === 338 || e === 339 || e === 358 || e === 359 || e === 363 || e === 462 || e === 464 || e === 466 || e === 468 || e === 470 || e === 472 || e === 474 || e === 476 || e === 593 || e === 609 || e === 708 || e === 711 || e >= 713 && e <= 715 || e === 717 || e === 720 || e >= 728 && e <= 731 || e === 733 || e === 735 || e >= 768 && e <= 879 || e >= 913 && e <= 929 || e >= 931 && e <= 937 || e >= 945 && e <= 961 || e >= 963 && e <= 969 || e === 1025 || e >= 1040 && e <= 1103 || e === 1105 || e === 8208 || e >= 8211 && e <= 8214 || e === 8216 || e === 8217 || e === 8220 || e === 8221 || e >= 8224 && e <= 8226 || e >= 8228 && e <= 8231 || e === 8240 || e === 8242 || e === 8243 || e === 8245 || e === 8251 || e === 8254 || e === 8308 || e === 8319 || e >= 8321 && e <= 8324 || e === 8364 || e === 8451 || e === 8453 || e === 8457 || e === 8467 || e === 8470 || e === 8481 || e === 8482 || e === 8486 || e === 8491 || e === 8531 || e === 8532 || e >= 8539 && e <= 8542 || e >= 8544 && e <= 8555 || e >= 8560 && e <= 8569 || e === 8585 || e >= 8592 && e <= 8601 || e === 8632 || e === 8633 || e === 8658 || e === 8660 || e === 8679 || e === 8704 || e === 8706 || e === 8707 || e === 8711 || e === 8712 || e === 8715 || e === 8719 || e === 8721 || e === 8725 || e === 8730 || e >= 8733 && e <= 8736 || e === 8739 || e === 8741 || e >= 8743 && e <= 8748 || e === 8750 || e >= 8756 && e <= 8759 || e === 8764 || e === 8765 || e === 8776 || e === 8780 || e === 8786 || e === 8800 || e === 8801 || e >= 8804 && e <= 8807 || e === 8810 || e === 8811 || e === 8814 || e === 8815 || e === 8834 || e === 8835 || e === 8838 || e === 8839 || e === 8853 || e === 8857 || e === 8869 || e === 8895 || e === 8978 || e >= 9312 && e <= 9449 || e >= 9451 && e <= 9547 || e >= 9552 && e <= 9587 || e >= 9600 && e <= 9615 || e >= 9618 && e <= 9621 || e === 9632 || e === 9633 || e >= 9635 && e <= 9641 || e === 9650 || e === 9651 || e === 9654 || e === 9655 || e === 9660 || e === 9661 || e === 9664 || e === 9665 || e >= 9670 && e <= 9672 || e === 9675 || e >= 9678 && e <= 9681 || e >= 9698 && e <= 9701 || e === 9711 || e === 9733 || e === 9734 || e === 9737 || e === 9742 || e === 9743 || e === 9756 || e === 9758 || e === 9792 || e === 9794 || e === 9824 || e === 9825 || e >= 9827 && e <= 9829 || e >= 9831 && e <= 9834 || e === 9836 || e === 9837 || e === 9839 || e === 9886 || e === 9887 || e === 9919 || e >= 9926 && e <= 9933 || e >= 9935 && e <= 9939 || e >= 9941 && e <= 9953 || e === 9955 || e === 9960 || e === 9961 || e >= 9963 && e <= 9969 || e === 9972 || e >= 9974 && e <= 9977 || e === 9979 || e === 9980 || e === 9982 || e === 9983 || e === 10045 || e >= 10102 && e <= 10111 || e >= 11094 && e <= 11097 || e >= 12872 && e <= 12879 || e >= 57344 && e <= 63743 || e >= 65024 && e <= 65039 || e === 65533 || e >= 127232 && e <= 127242 || e >= 127248 && e <= 127277 || e >= 127280 && e <= 127337 || e >= 127344 && e <= 127373 || e === 127375 || e === 127376 || e >= 127387 && e <= 127404 || e >= 917760 && e <= 917999 || e >= 983040 && e <= 1048573 || e >= 1048576 && e <= 1114109, dt2 = (e) => e === 12288 || e >= 65281 && e <= 65376 || e >= 65504 && e <= 65510, $t = (e) => e >= 4352 && e <= 4447 || e === 8986 || e === 8987 || e === 9001 || e === 9002 || e >= 9193 && e <= 9196 || e === 9200 || e === 9203 || e === 9725 || e === 9726 || e === 9748 || e === 9749 || e >= 9800 && e <= 9811 || e === 9855 || e === 9875 || e === 9889 || e === 9898 || e === 9899 || e === 9917 || e === 9918 || e === 9924 || e === 9925 || e === 9934 || e === 9940 || e === 9962 || e === 9970 || e === 9971 || e === 9973 || e === 9978 || e === 9981 || e === 9989 || e === 9994 || e === 9995 || e === 10024 || e === 10060 || e === 10062 || e >= 10067 && e <= 10069 || e === 10071 || e >= 10133 && e <= 10135 || e === 10160 || e === 10175 || e === 11035 || e === 11036 || e === 11088 || e === 11093 || e >= 11904 && e <= 11929 || e >= 11931 && e <= 12019 || e >= 12032 && e <= 12245 || e >= 12272 && e <= 12287 || e >= 12289 && e <= 12350 || e >= 12353 && e <= 12438 || e >= 12441 && e <= 12543 || e >= 12549 && e <= 12591 || e >= 12593 && e <= 12686 || e >= 12688 && e <= 12771 || e >= 12783 && e <= 12830 || e >= 12832 && e <= 12871 || e >= 12880 && e <= 19903 || e >= 19968 && e <= 42124 || e >= 42128 && e <= 42182 || e >= 43360 && e <= 43388 || e >= 44032 && e <= 55203 || e >= 63744 && e <= 64255 || e >= 65040 && e <= 65049 || e >= 65072 && e <= 65106 || e >= 65108 && e <= 65126 || e >= 65128 && e <= 65131 || e >= 94176 && e <= 94180 || e === 94192 || e === 94193 || e >= 94208 && e <= 100343 || e >= 100352 && e <= 101589 || e >= 101632 && e <= 101640 || e >= 110576 && e <= 110579 || e >= 110581 && e <= 110587 || e === 110589 || e === 110590 || e >= 110592 && e <= 110882 || e === 110898 || e >= 110928 && e <= 110930 || e === 110933 || e >= 110948 && e <= 110951 || e >= 110960 && e <= 111355 || e === 126980 || e === 127183 || e === 127374 || e >= 127377 && e <= 127386 || e >= 127488 && e <= 127490 || e >= 127504 && e <= 127547 || e >= 127552 && e <= 127560 || e === 127568 || e === 127569 || e >= 127584 && e <= 127589 || e >= 127744 && e <= 127776 || e >= 127789 && e <= 127797 || e >= 127799 && e <= 127868 || e >= 127870 && e <= 127891 || e >= 127904 && e <= 127946 || e >= 127951 && e <= 127955 || e >= 127968 && e <= 127984 || e === 127988 || e >= 127992 && e <= 128062 || e === 128064 || e >= 128066 && e <= 128252 || e >= 128255 && e <= 128317 || e >= 128331 && e <= 128334 || e >= 128336 && e <= 128359 || e === 128378 || e === 128405 || e === 128406 || e === 128420 || e >= 128507 && e <= 128591 || e >= 128640 && e <= 128709 || e === 128716 || e >= 128720 && e <= 128722 || e >= 128725 && e <= 128727 || e >= 128732 && e <= 128735 || e === 128747 || e === 128748 || e >= 128756 && e <= 128764 || e >= 128992 && e <= 129003 || e === 129008 || e >= 129292 && e <= 129338 || e >= 129340 && e <= 129349 || e >= 129351 && e <= 129535 || e >= 129648 && e <= 129660 || e >= 129664 && e <= 129672 || e >= 129680 && e <= 129725 || e >= 129727 && e <= 129733 || e >= 129742 && e <= 129755 || e >= 129760 && e <= 129768 || e >= 129776 && e <= 129784 || e >= 131072 && e <= 196605 || e >= 196608 && e <= 262141, pe = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y, ee = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y, te = /\t{1,1000}/y, ge = new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*", "yu"), se = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y, ht2 = new RegExp("\\p{M}+", "gu"), mt2 = { limit: 1 / 0, ellipsis: "" }, Oe = (e, i = {}, s = {}) => {
1975
- let r = i.limit ?? 1 / 0, n = i.ellipsis ?? "", o = i?.ellipsisWidth ?? (n ? Oe(n, mt2, s).width : 0), l = s.ansiWidth ?? 0, u = s.controlWidth ?? 0, a = s.tabWidth ?? 8, h = s.ambiguousWidth ?? 1, y2 = s.emojiWidth ?? 2, E = s.fullWidthWidth ?? 2, f = s.regularWidth ?? 1, F = s.wideWidth ?? 2, c = 0, m = 0, $2 = e.length, p = 0, g = !1, v = $2, S2 = Math.max(0, r - o), w2 = 0, b2 = 0, A = 0, C = 0;
1976
- e: for (; ; ) {
1977
- if (b2 > w2 || m >= $2 && m > c) {
1978
- let _ = e.slice(w2, b2) || e.slice(c, m);
1979
- p = 0;
1980
- for (let D2 of _.replaceAll(ht2, "")) {
1981
- let T2 = D2.codePointAt(0) || 0;
1982
- if (dt2(T2) ? C = E : $t(T2) ? C = F : h !== f && ct2(T2) ? C = h : C = f, A + C > S2 && (v = Math.min(v, Math.max(w2, c) + p)), A + C > r) {
1983
- g = !0;
1984
- break e;
1985
- }
1986
- p += D2.length, A += C;
1987
- }
1988
- w2 = b2 = 0;
1989
- }
1990
- if (m >= $2) break;
1991
- if (se.lastIndex = m, se.test(e)) {
1992
- if (p = se.lastIndex - m, C = p * f, A + C > S2 && (v = Math.min(v, m + Math.floor((S2 - A) / f))), A + C > r) {
1993
- g = !0;
1994
- break;
1995
- }
1996
- A += C, w2 = c, b2 = m, m = c = se.lastIndex;
1997
- continue;
1998
- }
1999
- if (pe.lastIndex = m, pe.test(e)) {
2000
- if (A + l > S2 && (v = Math.min(v, m)), A + l > r) {
2001
- g = !0;
2002
- break;
2003
- }
2004
- A += l, w2 = c, b2 = m, m = c = pe.lastIndex;
2005
- continue;
2006
- }
2007
- if (ee.lastIndex = m, ee.test(e)) {
2008
- if (p = ee.lastIndex - m, C = p * u, A + C > S2 && (v = Math.min(v, m + Math.floor((S2 - A) / u))), A + C > r) {
2009
- g = !0;
2010
- break;
2011
- }
2012
- A += C, w2 = c, b2 = m, m = c = ee.lastIndex;
2013
- continue;
2014
- }
2015
- if (te.lastIndex = m, te.test(e)) {
2016
- if (p = te.lastIndex - m, C = p * a, A + C > S2 && (v = Math.min(v, m + Math.floor((S2 - A) / a))), A + C > r) {
2017
- g = !0;
2018
- break;
2019
- }
2020
- A += C, w2 = c, b2 = m, m = c = te.lastIndex;
2021
- continue;
2022
- }
2023
- if (ge.lastIndex = m, ge.test(e)) {
2024
- if (A + y2 > S2 && (v = Math.min(v, m)), A + y2 > r) {
2025
- g = !0;
2026
- break;
2027
- }
2028
- A += y2, w2 = c, b2 = m, m = c = ge.lastIndex;
2029
- continue;
2030
- }
2031
- m += 1;
2032
- }
2033
- return { width: g ? S2 : A, index: g ? v : $2, truncated: g, ellipsed: g && r >= o };
2034
- }, pt2 = { limit: 1 / 0, ellipsis: "", ellipsisWidth: 0 }, M2 = (e, i = {}) => Oe(e, pt2, i).width, re = "\x1B", Ne = "\x9B", gt2 = 39, fe = "\x07", Pe = "[", ft2 = "]", Le = "m", Fe = `${ft2}8;;`, We = new RegExp(`(?:\\${Pe}(?<code>\\d+)m|\\${Fe}(?<uri>.*)${fe})`, "y"), Ft2 = (e) => {
2035
- if (e >= 30 && e <= 37 || e >= 90 && e <= 97) return 39;
2036
- if (e >= 40 && e <= 47 || e >= 100 && e <= 107) return 49;
2037
- if (e === 1 || e === 2) return 22;
2038
- if (e === 3) return 23;
2039
- if (e === 4) return 24;
2040
- if (e === 7) return 27;
2041
- if (e === 8) return 28;
2042
- if (e === 9) return 29;
2043
- if (e === 0) return 0;
2044
- }, je = (e) => `${re}${Pe}${e}${Le}`, Ve = (e) => `${re}${Fe}${e}${fe}`, yt2 = (e) => e.map((i) => M2(i)), ye = (e, i, s) => {
2045
- let r = i[Symbol.iterator](), n = !1, o = !1, l = e.at(-1), u = l === void 0 ? 0 : M2(l), a = r.next(), h = r.next(), y2 = 0;
2046
- for (; !a.done; ) {
2047
- let E = a.value, f = M2(E);
2048
- u + f <= s ? e[e.length - 1] += E : (e.push(E), u = 0), (E === re || E === Ne) && (n = !0, o = i.startsWith(Fe, y2 + 1)), n ? o ? E === fe && (n = !1, o = !1) : E === Le && (n = !1) : (u += f, u === s && !h.done && (e.push(""), u = 0)), a = h, h = r.next(), y2 += E.length;
2049
- }
2050
- l = e.at(-1), !u && l !== void 0 && l.length > 0 && e.length > 1 && (e[e.length - 2] += e.pop());
2051
- }, Et2 = (e) => {
2052
- let i = e.split(" "), s = i.length;
2053
- for (; s > 0 && !(M2(i[s - 1]) > 0); ) s--;
2054
- return s === i.length ? e : i.slice(0, s).join(" ") + i.slice(s).join("");
2055
- }, vt2 = (e, i, s = {}) => {
2056
- if (s.trim !== !1 && e.trim() === "") return "";
2057
- let r = "", n, o, l = e.split(" "), u = yt2(l), a = [""];
2058
- for (let [c, m] of l.entries()) {
2059
- s.trim !== !1 && (a[a.length - 1] = (a.at(-1) ?? "").trimStart());
2060
- let $2 = M2(a.at(-1) ?? "");
2061
- if (c !== 0 && ($2 >= i && (s.wordWrap === !1 || s.trim === !1) && (a.push(""), $2 = 0), ($2 > 0 || s.trim === !1) && (a[a.length - 1] += " ", $2++)), s.hard && u[c] > i) {
2062
- let p = i - $2, g = 1 + Math.floor((u[c] - p - 1) / i);
2063
- Math.floor((u[c] - 1) / i) < g && a.push(""), ye(a, m, i);
2064
- continue;
2065
- }
2066
- if ($2 + u[c] > i && $2 > 0 && u[c] > 0) {
2067
- if (s.wordWrap === !1 && $2 < i) {
2068
- ye(a, m, i);
2069
- continue;
2070
- }
2071
- a.push("");
2072
- }
2073
- if ($2 + u[c] > i && s.wordWrap === !1) {
2074
- ye(a, m, i);
2075
- continue;
2076
- }
2077
- a[a.length - 1] += m;
2078
- }
2079
- s.trim !== !1 && (a = a.map((c) => Et2(c)));
2080
- let h = a.join(`
2081
- `), y2 = h[Symbol.iterator](), E = y2.next(), f = y2.next(), F = 0;
2082
- for (; !E.done; ) {
2083
- let c = E.value, m = f.value;
2084
- if (r += c, c === re || c === Ne) {
2085
- We.lastIndex = F + 1;
2086
- let g = We.exec(h)?.groups;
2087
- if (g?.code !== void 0) {
2088
- let v = Number.parseFloat(g.code);
2089
- n = v === gt2 ? void 0 : v;
2090
- } else g?.uri !== void 0 && (o = g.uri.length === 0 ? void 0 : g.uri);
2091
- }
2092
- let $2 = n ? Ft2(n) : void 0;
2093
- m === `
2094
- ` ? (o && (r += Ve("")), n && $2 && (r += je($2))) : c === `
2095
- ` && (n && $2 && (r += je(n)), o && (r += Ve(o))), F += c.length, E = f, f = y2.next();
2096
- }
2097
- return r;
2098
- };
2099
- function U2(e, i, s) {
2100
- return String(e).normalize().replaceAll(`\r
2101
- `, `
2102
- `).split(`
2103
- `).map((r) => vt2(r, i, s)).join(`
2104
- `);
2105
- }
2106
- var At2 = (e, i, s, r, n) => {
2107
- let o = i, l = 0;
2108
- for (let u = s; u < r; u++) {
2109
- let a = e[u];
2110
- if (o = o - a.length, l++, o <= n) break;
2111
- }
2112
- return { lineCount: o, removals: l };
2113
- }, K2 = (e) => {
2114
- let { cursor: i, options: s, style: r } = e, n = e.output ?? process.stdout, o = Ct(n), l = e.columnPadding ?? 0, u = e.rowPadding ?? 4, a = o - l, h = Bt(n), y2 = import_picocolors2.default.dim("..."), E = e.maxItems ?? Number.POSITIVE_INFINITY, f = Math.max(h - u, 0), F = Math.max(Math.min(E, f), 5), c = 0;
2115
- i >= F - 3 && (c = Math.max(Math.min(i - F + 3, s.length - F), 0));
2116
- let m = F < s.length && c > 0, $2 = F < s.length && c + F < s.length, p = Math.min(c + F, s.length), g = [], v = 0;
2117
- m && v++, $2 && v++;
2118
- let S2 = c + (m ? 1 : 0), w2 = p - ($2 ? 1 : 0);
2119
- for (let A = S2; A < w2; A++) {
2120
- let C = U2(r(s[A], A === i), a, { hard: !0, trim: !1 }).split(`
2121
- `);
2122
- g.push(C), v += C.length;
2123
- }
2124
- if (v > f) {
2125
- let A = 0, C = 0, _ = v, D2 = i - S2, T2 = (k2, B2) => At2(g, _, k2, B2, f);
2126
- m ? ({ lineCount: _, removals: A } = T2(0, D2), _ > f && ({ lineCount: _, removals: C } = T2(D2 + 1, g.length))) : ({ lineCount: _, removals: C } = T2(D2 + 1, g.length), _ > f && ({ lineCount: _, removals: A } = T2(0, D2))), A > 0 && (m = !0, g.splice(0, A)), C > 0 && ($2 = !0, g.splice(g.length - C, C));
2127
- }
2128
- let b2 = [];
2129
- m && b2.push(y2);
2130
- for (let A of g) for (let C of A) b2.push(C);
2131
- return $2 && b2.push(y2), b2;
2132
- };
2133
- var xt = (e) => {
2134
- let i = e.active ?? "Yes", s = e.inactive ?? "No";
2135
- return new Vt({ active: i, inactive: s, signal: e.signal, input: e.input, output: e.output, initialValue: e.initialValue ?? !0, render() {
2136
- let r = `${import_picocolors2.default.gray(d)}
2137
- ${L2(this.state)} ${e.message}
2138
- `, n = this.value ? i : s;
2139
- switch (this.state) {
2140
- case "submit":
2141
- return `${r}${import_picocolors2.default.gray(d)} ${import_picocolors2.default.dim(n)}`;
2142
- case "cancel":
2143
- return `${r}${import_picocolors2.default.gray(d)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(n))}
2144
- ${import_picocolors2.default.gray(d)}`;
2145
- default:
2146
- return `${r}${import_picocolors2.default.cyan(d)} ${this.value ? `${import_picocolors2.default.green(J2)} ${i}` : `${import_picocolors2.default.dim(H)} ${import_picocolors2.default.dim(i)}`} ${import_picocolors2.default.dim("/")} ${this.value ? `${import_picocolors2.default.dim(H)} ${import_picocolors2.default.dim(s)}` : `${import_picocolors2.default.green(J2)} ${s}`}
2147
- ${import_picocolors2.default.cyan(x)}
2148
- `;
2149
- }
2150
- } }).prompt();
2151
- };
2152
- var R = { message: (e = [], { symbol: i = import_picocolors2.default.gray(d), secondarySymbol: s = import_picocolors2.default.gray(d), output: r = process.stdout, spacing: n = 1 } = {}) => {
2153
- let o = [];
2154
- for (let u = 0; u < n; u++) o.push(`${s}`);
2155
- let l = Array.isArray(e) ? e : e.split(`
2156
- `);
2157
- if (l.length > 0) {
2158
- let [u, ...a] = l;
2159
- u.length > 0 ? o.push(`${i} ${u}`) : o.push(i);
2160
- for (let h of a) h.length > 0 ? o.push(`${s} ${h}`) : o.push(s);
2161
- }
2162
- r.write(`${o.join(`
2163
- `)}
2164
- `);
2165
- }, info: (e, i) => {
2166
- R.message(e, { ...i, symbol: import_picocolors2.default.blue(de) });
2167
- }, success: (e, i) => {
2168
- R.message(e, { ...i, symbol: import_picocolors2.default.green($e) });
2169
- }, step: (e, i) => {
2170
- R.message(e, { ...i, symbol: import_picocolors2.default.green(W2) });
2171
- }, warn: (e, i) => {
2172
- R.message(e, { ...i, symbol: import_picocolors2.default.yellow(he) });
2173
- }, warning: (e, i) => {
2174
- R.warn(e, i);
2175
- }, error: (e, i) => {
2176
- R.message(e, { ...i, symbol: import_picocolors2.default.red(me) });
2177
- } }, Tt2 = (e = "", i) => {
2178
- (i?.output ?? process.stdout).write(`${import_picocolors2.default.gray(x)} ${import_picocolors2.default.red(e)}
2179
-
2180
- `);
2181
- }, Mt2 = (e = "", i) => {
2182
- (i?.output ?? process.stdout).write(`${import_picocolors2.default.gray(le)} ${e}
2183
- `);
2184
- }, Rt = (e = "", i) => {
2185
- (i?.output ?? process.stdout).write(`${import_picocolors2.default.gray(d)}
2186
- ${import_picocolors2.default.gray(x)} ${e}
2187
-
2188
- `);
2189
- }, Ot = (e) => {
2190
- let i = (r, n) => {
2191
- let o = r.label ?? String(r.value);
2192
- return n === "disabled" ? `${import_picocolors2.default.gray(X2)} ${import_picocolors2.default.gray(o)}${r.hint ? ` ${import_picocolors2.default.dim(`(${r.hint ?? "disabled"})`)}` : ""}` : n === "active" ? `${import_picocolors2.default.cyan(Z2)} ${o}${r.hint ? ` ${import_picocolors2.default.dim(`(${r.hint})`)}` : ""}` : n === "selected" ? `${import_picocolors2.default.green(j2)} ${import_picocolors2.default.dim(o)}${r.hint ? ` ${import_picocolors2.default.dim(`(${r.hint})`)}` : ""}` : n === "cancelled" ? `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(o))}` : n === "active-selected" ? `${import_picocolors2.default.green(j2)} ${o}${r.hint ? ` ${import_picocolors2.default.dim(`(${r.hint})`)}` : ""}` : n === "submitted" ? `${import_picocolors2.default.dim(o)}` : `${import_picocolors2.default.dim(X2)} ${import_picocolors2.default.dim(o)}`;
2193
- }, s = e.required ?? !0;
2194
- return new yt({ options: e.options, signal: e.signal, input: e.input, output: e.output, initialValues: e.initialValues, required: s, cursorAt: e.cursorAt, validate(r) {
2195
- if (s && (r === void 0 || r.length === 0)) return `Please select at least one option.
2196
- ${import_picocolors2.default.reset(import_picocolors2.default.dim(`Press ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" space ")))} to select, ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" enter ")))} to submit`))}`;
2197
- }, render() {
2198
- let r = `${import_picocolors2.default.gray(d)}
2199
- ${L2(this.state)} ${e.message}
2200
- `, n = this.value ?? [], o = (l, u) => {
2201
- if (l.disabled) return i(l, "disabled");
2202
- let a = n.includes(l.value);
2203
- return u && a ? i(l, "active-selected") : a ? i(l, "selected") : i(l, u ? "active" : "inactive");
2204
- };
2205
- switch (this.state) {
2206
- case "submit":
2207
- return `${r}${import_picocolors2.default.gray(d)} ${this.options.filter(({ value: l }) => n.includes(l)).map((l) => i(l, "submitted")).join(import_picocolors2.default.dim(", ")) || import_picocolors2.default.dim("none")}`;
2208
- case "cancel": {
2209
- let l = this.options.filter(({ value: u }) => n.includes(u)).map((u) => i(u, "cancelled")).join(import_picocolors2.default.dim(", "));
2210
- return `${r}${import_picocolors2.default.gray(d)}${l.trim() ? ` ${l}
2211
- ${import_picocolors2.default.gray(d)}` : ""}`;
2212
- }
2213
- case "error": {
2214
- let l = `${import_picocolors2.default.yellow(d)} `, u = this.error.split(`
2215
- `).map((a, h) => h === 0 ? `${import_picocolors2.default.yellow(x)} ${import_picocolors2.default.yellow(a)}` : ` ${a}`).join(`
2216
- `);
2217
- return `${r}${l}${K2({ output: e.output, options: this.options, cursor: this.cursor, maxItems: e.maxItems, columnPadding: l.length, style: o }).join(`
2218
- ${l}`)}
2219
- ${u}
2220
- `;
2221
- }
2222
- default: {
2223
- let l = `${import_picocolors2.default.cyan(d)} `;
2224
- return `${r}${l}${K2({ output: e.output, options: this.options, cursor: this.cursor, maxItems: e.maxItems, columnPadding: l.length, style: o }).join(`
2225
- ${l}`)}
2226
- ${import_picocolors2.default.cyan(x)}
2227
- `;
2228
- }
2229
- }
2230
- } }).prompt();
2231
- };
2232
- var Vt2 = import_picocolors2.default.magenta, Ee = ({ indicator: e = "dots", onCancel: i, output: s = process.stdout, cancelMessage: r, errorMessage: n, frames: o = z2 ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"], delay: l = z2 ? 80 : 120, signal: u, ...a } = {}) => {
2233
- let h = ne(), y2, E, f = !1, F = !1, c = "", m, $2 = performance.now(), p = Ct(s), g = a?.styleFrame ?? Vt2, v = (B2) => {
2234
- let O2 = B2 > 1 ? n ?? b.messages.error : r ?? b.messages.cancel;
2235
- F = B2 === 1, f && (k2(O2, B2), F && typeof i == "function" && i());
2236
- }, S2 = () => v(2), w2 = () => v(1), b2 = () => {
2237
- process.on("uncaughtExceptionMonitor", S2), process.on("unhandledRejection", S2), process.on("SIGINT", w2), process.on("SIGTERM", w2), process.on("exit", v), u && u.addEventListener("abort", w2);
2238
- }, A = () => {
2239
- process.removeListener("uncaughtExceptionMonitor", S2), process.removeListener("unhandledRejection", S2), process.removeListener("SIGINT", w2), process.removeListener("SIGTERM", w2), process.removeListener("exit", v), u && u.removeEventListener("abort", w2);
2240
- }, C = () => {
2241
- if (m === void 0) return;
2242
- h && s.write(`
2243
- `);
2244
- let B2 = U2(m, p, { hard: !0, trim: !1 }).split(`
2245
- `);
2246
- B2.length > 1 && s.write(import_sisteransi2.cursor.up(B2.length - 1)), s.write(import_sisteransi2.cursor.to(0)), s.write(import_sisteransi2.erase.down());
2247
- }, _ = (B2) => B2.replace(/\.+$/, ""), D2 = (B2) => {
2248
- let O2 = (performance.now() - B2) / 1e3, P2 = Math.floor(O2 / 60), G2 = Math.floor(O2 % 60);
2249
- return P2 > 0 ? `[${P2}m ${G2}s]` : `[${G2}s]`;
2250
- }, T2 = (B2 = "") => {
2251
- f = !0, y2 = bt({ output: s }), c = _(B2), $2 = performance.now(), s.write(`${import_picocolors2.default.gray(d)}
2252
- `);
2253
- let O2 = 0, P2 = 0;
2254
- b2(), E = setInterval(() => {
2255
- if (h && c === m) return;
2256
- C(), m = c;
2257
- let G2 = g(o[O2]), Y2;
2258
- if (h) Y2 = `${G2} ${c}...`;
2259
- else if (e === "timer") Y2 = `${G2} ${c} ${D2($2)}`;
2260
- else {
2261
- let Xe = ".".repeat(Math.floor(P2)).slice(0, 3);
2262
- Y2 = `${G2} ${c}${Xe}`;
2263
- }
2264
- let Je = U2(Y2, p, { hard: !0, trim: !1 });
2265
- s.write(Je), O2 = O2 + 1 < o.length ? O2 + 1 : 0, P2 = P2 < 4 ? P2 + 0.125 : 0;
2266
- }, l);
2267
- }, k2 = (B2 = "", O2 = 0) => {
2268
- if (!f) return;
2269
- f = !1, clearInterval(E), C();
2270
- let P2 = O2 === 0 ? import_picocolors2.default.green(W2) : O2 === 1 ? import_picocolors2.default.red(ae) : import_picocolors2.default.red(oe);
2271
- c = B2 ?? c, e === "timer" ? s.write(`${P2} ${c} ${D2($2)}
2272
- `) : s.write(`${P2} ${c}
2273
- `), A(), y2();
2274
- };
2275
- return { start: T2, stop: k2, message: (B2 = "") => {
2276
- c = _(B2 ?? c);
2277
- }, get isCancelled() {
2278
- return F;
2279
- } };
2280
- }, Ke = { light: I2("\u2500", "-"), heavy: I2("\u2501", "="), block: I2("\u2588", "#") };
2281
- var Gt = (e) => {
2282
- let i = (s, r) => {
2283
- let n = s.label ?? String(s.value);
2284
- switch (r) {
2285
- case "disabled":
2286
- return `${import_picocolors2.default.gray(H)} ${import_picocolors2.default.gray(n)}${s.hint ? ` ${import_picocolors2.default.dim(`(${s.hint ?? "disabled"})`)}` : ""}`;
2287
- case "selected":
2288
- return `${import_picocolors2.default.dim(n)}`;
2289
- case "active":
2290
- return `${import_picocolors2.default.green(J2)} ${n}${s.hint ? ` ${import_picocolors2.default.dim(`(${s.hint})`)}` : ""}`;
2291
- case "cancelled":
2292
- return `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(n))}`;
2293
- default:
2294
- return `${import_picocolors2.default.dim(H)} ${import_picocolors2.default.dim(n)}`;
2295
- }
2296
- };
2297
- return new Lt({ options: e.options, signal: e.signal, input: e.input, output: e.output, initialValue: e.initialValue, render() {
2298
- let s = `${import_picocolors2.default.gray(d)}
2299
- ${L2(this.state)} ${e.message}
2300
- `;
2301
- switch (this.state) {
2302
- case "submit":
2303
- return `${s}${import_picocolors2.default.gray(d)} ${i(this.options[this.cursor], "selected")}`;
2304
- case "cancel":
2305
- return `${s}${import_picocolors2.default.gray(d)} ${i(this.options[this.cursor], "cancelled")}
2306
- ${import_picocolors2.default.gray(d)}`;
2307
- default: {
2308
- let r = `${import_picocolors2.default.cyan(d)} `;
2309
- return `${s}${r}${K2({ output: e.output, cursor: this.cursor, options: this.options, maxItems: e.maxItems, columnPadding: r.length, style: (n, o) => i(n, n.disabled ? "disabled" : o ? "active" : "inactive") }).join(`
2310
- ${r}`)}
2311
- ${import_picocolors2.default.cyan(x)}
2312
- `;
2313
- }
2314
- }
2315
- } }).prompt();
2316
- };
2317
- var qe = `${import_picocolors2.default.gray(d)} `;
2318
- var Kt = (e) => {
2319
- let i = e.output ?? process.stdout, s = Ct(i), r = import_picocolors2.default.gray(d), n = e.spacing ?? 1, o = 3, l = e.retainLog === !0, u = !ne() && Be(i);
2320
- i.write(`${r}
2321
- `), i.write(`${import_picocolors2.default.green(W2)} ${e.title}
2322
- `);
2323
- for (let $2 = 0; $2 < n; $2++) i.write(`${r}
2324
- `);
2325
- let a = [{ value: "", full: "" }], h = !1, y2 = ($2) => {
2326
- if (a.length === 0) return;
2327
- let p = 0;
2328
- $2 && (p += n + 2);
2329
- for (let g of a) {
2330
- let { value: v, result: S2 } = g, w2 = S2?.message ?? v;
2331
- if (w2.length === 0) continue;
2332
- S2 === void 0 && g.header !== void 0 && g.header !== "" && (w2 += `
2333
- ${g.header}`);
2334
- let b2 = w2.split(`
2335
- `).reduce((A, C) => C === "" ? A + 1 : A + Math.ceil((C.length + o) / s), 0);
2336
- p += b2;
2337
- }
2338
- p > 0 && (p += 1, i.write(import_sisteransi2.erase.lines(p)));
2339
- }, E = ($2, p, g) => {
2340
- let v = g ? `${$2.full}
2341
- ${$2.value}` : $2.value;
2342
- $2.header !== void 0 && $2.header !== "" && R.message($2.header.split(`
2343
- `).map(import_picocolors2.default.bold), { output: i, secondarySymbol: r, symbol: r, spacing: 0 }), R.message(v.split(`
2344
- `).map(import_picocolors2.default.dim), { output: i, secondarySymbol: r, symbol: r, spacing: p ?? n });
2345
- }, f = () => {
2346
- for (let $2 of a) {
2347
- let { header: p, value: g, full: v } = $2;
2348
- (p === void 0 || p.length === 0) && g.length === 0 || E($2, void 0, l === !0 && v.length > 0);
2349
- }
2350
- }, F = ($2, p, g) => {
2351
- if (y2(!1), (g?.raw !== !0 || !h) && $2.value !== "" && ($2.value += `
2352
- `), $2.value += p, h = g?.raw === !0, e.limit !== void 0) {
2353
- let v = $2.value.split(`
2354
- `), S2 = v.length - e.limit;
2355
- if (S2 > 0) {
2356
- let w2 = v.splice(0, S2);
2357
- l && ($2.full += ($2.full === "" ? "" : `
2358
- `) + w2.join(`
2359
- `));
2360
- }
2361
- $2.value = v.join(`
2362
- `);
2363
- }
2364
- u && c();
2365
- }, c = () => {
2366
- for (let $2 of a) $2.result ? $2.result.status === "error" ? R.error($2.result.message, { output: i, secondarySymbol: r, spacing: 0 }) : R.success($2.result.message, { output: i, secondarySymbol: r, spacing: 0 }) : $2.value !== "" && E($2, 0);
2367
- }, m = ($2, p) => {
2368
- y2(!1), $2.result = p, u && c();
2369
- };
2370
- return { message($2, p) {
2371
- F(a[0], $2, p);
2372
- }, group($2) {
2373
- let p = { header: $2, value: "", full: "" };
2374
- return a.push(p), { message(g, v) {
2375
- F(p, g, v);
2376
- }, error(g) {
2377
- m(p, { status: "error", message: g });
2378
- }, success(g) {
2379
- m(p, { status: "success", message: g });
2380
- } };
2381
- }, error($2, p) {
2382
- y2(!0), R.error($2, { output: i, secondarySymbol: r, spacing: 1 }), p?.showLog !== !1 && f(), a.splice(1, a.length - 1), a[0].value = "", a[0].full = "";
2383
- }, success($2, p) {
2384
- y2(!0), R.success($2, { output: i, secondarySymbol: r, spacing: 1 }), p?.showLog === !0 && f(), a.splice(1, a.length - 1), a[0].value = "", a[0].full = "";
2385
- } };
2386
- }, qt = (e) => new Tt({ validate: e.validate, placeholder: e.placeholder, defaultValue: e.defaultValue, initialValue: e.initialValue, output: e.output, signal: e.signal, input: e.input, render() {
2387
- let i = `${import_picocolors2.default.gray(d)}
2388
- ${L2(this.state)} ${e.message}
2389
- `, s = e.placeholder ? import_picocolors2.default.inverse(e.placeholder[0]) + import_picocolors2.default.dim(e.placeholder.slice(1)) : import_picocolors2.default.inverse(import_picocolors2.default.hidden("_")), r = this.userInput ? this.userInputWithCursor : s, n = this.value ?? "";
2390
- switch (this.state) {
2391
- case "error": {
2392
- let o = this.error ? ` ${import_picocolors2.default.yellow(this.error)}` : "";
2393
- return `${i.trim()}
2394
- ${import_picocolors2.default.yellow(d)} ${r}
2395
- ${import_picocolors2.default.yellow(x)}${o}
2396
- `;
2397
- }
2398
- case "submit": {
2399
- let o = n ? ` ${import_picocolors2.default.dim(n)}` : "";
2400
- return `${i}${import_picocolors2.default.gray(d)}${o}`;
2401
- }
2402
- case "cancel": {
2403
- let o = n ? ` ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(n))}` : "";
2404
- return `${i}${import_picocolors2.default.gray(d)}${o}${n.trim() ? `
2405
- ${import_picocolors2.default.gray(d)}` : ""}`;
2406
- }
2407
- default:
2408
- return `${i}${import_picocolors2.default.cyan(d)} ${r}
2409
- ${import_picocolors2.default.cyan(x)}
2410
- `;
2411
- }
2412
- } }).prompt();
2413
-
2414
- // src/node-logger/prompts/prompt-config.ts
2415
- var prompt_config_exports = {};
2416
- __export(prompt_config_exports, {
2417
- getPreferredStdio: () => getPreferredStdio,
2418
- getPromptLibrary: () => getPromptLibrary,
2419
- getPromptProvider: () => getPromptProvider,
2420
- isClackEnabled: () => isClackEnabled,
2421
- isPromptsEnabled: () => isPromptsEnabled,
2422
- setPromptLibrary: () => setPromptLibrary
2423
- });
2424
-
2425
- // src/node-logger/logger/log-tracker.ts
2426
- import { promises as fs } from "node:fs";
2427
- import path, { join } from "node:path";
2428
- import { isCI } from "storybook/internal/common";
2429
-
2430
- // ../lib/cli-storybook/src/automigrate/helpers/cleanLog.ts
2431
- import { EOL } from "node:os";
2432
- var ansiRegex = ({ onlyFirst = !1 } = {}) => {
2433
- let pattern = [
2434
- "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
2435
- "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
2436
- ].join("|");
2437
- return new RegExp(pattern, onlyFirst ? void 0 : "g");
2438
- }, cleanLog = (str) => str.replace(ansiRegex(), "").replace(/╮│/g, `\u256E
2439
- \u2502`).replace(/││/g, `\u2502
2440
- \u2502`).replace(/│╰/g, `\u2502
2441
- \u2570`).replace(/⚠️ {2}failed to check/g, `${EOL}\u26A0\uFE0F failed to check`);
2442
-
2443
- // src/node-logger/logger/log-tracker.ts
2444
- var DEBUG_LOG_FILE_NAME = "debug-storybook.log", LogTracker = class {
2445
- /** Array to store log entries */
2446
- #logs = [];
2447
- /** Path where log file will be written */
2448
- #logFilePath = "";
2449
- /**
2450
- * Flag indicating if logs should be written to file it is enabled either by users providing the
2451
- * `--write-logs` flag to a CLI command or when we explicitly enable it by calling
2452
- * `logTracker.enableLogWriting()` e.g. in automigrate or doctor command when there are issues
2453
- */
2454
- #shouldWriteLogsToFile = !1;
2455
- constructor() {
2456
- this.#logFilePath = join(process.cwd(), DEBUG_LOG_FILE_NAME);
2457
- }
2458
- /** Enables writing logs to file. */
2459
- enableLogWriting() {
2460
- this.#shouldWriteLogsToFile = !0;
2461
- }
2462
- /** Returns whether logs should be written to file. */
2463
- get shouldWriteLogsToFile() {
2464
- return this.#shouldWriteLogsToFile;
2465
- }
2466
- /** Returns the configured log file path. */
2467
- get logFilePath() {
2468
- return this.#logFilePath;
2469
- }
2470
- /** Returns a copy of all stored logs. */
2471
- get logs() {
2472
- return [...this.#logs];
2473
- }
2474
- /**
2475
- * Adds a new log entry.
2476
- *
2477
- * @param level - The log level
2478
- * @param message - The log message
2479
- * @param metadata - Optional metadata to attach to the log, can be any JSON serializable value
2480
- */
2481
- addLog(level, message, metadata) {
2482
- this.#logs.push({
2483
- timestamp: /* @__PURE__ */ new Date(),
2484
- level,
2485
- message: cleanLog(message),
2486
- metadata
2487
- });
2488
- }
2489
- /** Clears all stored logs. */
2490
- clear() {
2491
- this.#logs = [];
2492
- }
2493
- /**
2494
- * Writes all stored logs to a file and clears the log store.
2495
- *
2496
- * @param filePath - Optional custom file path to write logs to
2497
- * @returns The path where logs were written, by default is debug-storybook.log in current working
2498
- * directory
2499
- */
2500
- async writeToFile(filePath = this.#logFilePath) {
2501
- let logContent = this.#logs.map((log2) => {
2502
- let timestamp = log2.timestamp.toLocaleTimeString("en-US", { hour12: !1 }) + `.${log2.timestamp.getMilliseconds().toString().padStart(3, "0")}`, metadata = log2.metadata ? ` ${JSON.stringify(log2.metadata)}` : "";
2503
- return `[${timestamp}] [${log2.level.toUpperCase()}] ${log2.message}${metadata}`;
2504
- }).join(`
2505
- `);
2506
- return await fs.writeFile(filePath, logContent, "utf-8"), this.#logs = [], isCI() ? filePath : path.relative(process.cwd(), filePath);
2507
- }
2508
- }, logTracker = new LogTracker();
2509
-
2510
- // src/node-logger/prompts/prompt-provider-base.ts
2511
- var PromptProvider = class {
2512
- };
2513
-
2514
- // src/node-logger/prompts/prompt-provider-clack.ts
2515
- var currentTaskLog = null, ClackPromptProvider = class extends PromptProvider {
2516
- handleCancel(result, promptOptions) {
2517
- _t(result) && (promptOptions?.onCancel ? promptOptions.onCancel() : (Tt2("Operation canceled."), process.exit(0)));
2518
- }
2519
- async text(options, promptOptions) {
2520
- let result = await qt(options);
2521
- return this.handleCancel(result, promptOptions), logTracker.addLog("prompt", options.message, { choice: result }), result.toString();
2522
- }
2523
- async confirm(options, promptOptions) {
2524
- let result = await xt(options);
2525
- return this.handleCancel(result, promptOptions), logTracker.addLog("prompt", options.message, { choice: result }), !!result;
2526
- }
2527
- async select(options, promptOptions) {
2528
- let result = await Gt(options);
2529
- return this.handleCancel(result, promptOptions), logTracker.addLog("prompt", options.message, { choice: result }), result;
2530
- }
2531
- async multiselect(options, promptOptions) {
2532
- let result = await Ot({
2533
- ...options,
2534
- required: options.required
2535
- });
2536
- return this.handleCancel(result, promptOptions), logTracker.addLog("prompt", options.message, { choice: result }), result;
2537
- }
2538
- spinner(options) {
2539
- let task = Ee(), spinnerId = `${options.id}-spinner`;
2540
- return {
2541
- start: (message) => {
2542
- logTracker.addLog("info", `${spinnerId}-start: ${message}`), task.start(message);
2543
- },
2544
- message: (message) => {
2545
- logTracker.addLog("info", `${spinnerId}: ${message}`), task.message(message);
2546
- },
2547
- stop: (message) => {
2548
- logTracker.addLog("info", `${spinnerId}-stop: ${message}`), task.stop(message);
2549
- }
2550
- };
2551
- }
2552
- taskLog(options) {
2553
- let task = Kt(options), taskId = `${options.id}-task`;
2554
- return logTracker.addLog("info", `${taskId}-start: ${options.title}`), currentTaskLog = task, {
2555
- message: (message) => {
2556
- logTracker.addLog("info", `${taskId}: ${message}`), task.message(message);
2557
- },
2558
- error: (message) => {
2559
- logTracker.addLog("error", `${taskId}-error: ${message}`), task.error(message, { showLog: !0 }), currentTaskLog = null;
2560
- },
2561
- success: (message, options2) => {
2562
- logTracker.addLog("info", `${taskId}-success: ${message}`), task.success(message, options2), currentTaskLog = null;
2563
- }
2564
- };
2565
- }
2566
- };
2567
-
2568
- // src/node-logger/prompts/prompt-provider-prompts.ts
2569
- var import_prompts = __toESM(require_prompts(), 1);
2570
- var PromptsPromptProvider = class extends PromptProvider {
2571
- getBaseOptions(promptOptions) {
2572
- return {
2573
- onCancel: () => {
2574
- promptOptions?.onCancel ? promptOptions.onCancel() : (logger.info("Operation canceled."), process.exit(0));
2575
- }
2576
- };
2577
- }
2578
- async text(options, promptOptions) {
2579
- let validate = options.validate ? (value) => {
2580
- let result2 = options.validate(value);
2581
- return result2 instanceof Error ? result2.message : typeof result2 == "string" ? result2 : !0;
2582
- } : void 0, result = await (0, import_prompts.default)(
2583
- {
2584
- type: "text",
2585
- name: "value",
2586
- message: options.message,
2587
- initial: options.initialValue,
2588
- validate
2589
- },
2590
- { ...this.getBaseOptions(promptOptions) }
2591
- );
2592
- return logTracker.addLog("prompt", options.message, { choice: result.value }), result.value;
2593
- }
2594
- async confirm(options, promptOptions) {
2595
- let result = await (0, import_prompts.default)(
2596
- {
2597
- type: "confirm",
2598
- name: "value",
2599
- message: options.message,
2600
- initial: options.initialValue,
2601
- active: options.active,
2602
- inactive: options.inactive
2603
- },
2604
- { ...this.getBaseOptions(promptOptions) }
2605
- );
2606
- return logTracker.addLog("prompt", options.message, { choice: result.value }), result.value;
2607
- }
2608
- async select(options, promptOptions) {
2609
- let result = await (0, import_prompts.default)(
2610
- {
2611
- type: "select",
2612
- name: "value",
2613
- message: options.message,
2614
- choices: options.options.map((opt) => ({
2615
- title: opt.label || String(opt.value),
2616
- value: opt.value,
2617
- description: opt.hint,
2618
- selected: opt.value === options.initialValue
2619
- }))
2620
- },
2621
- { ...this.getBaseOptions(promptOptions) }
2622
- );
2623
- return logTracker.addLog("prompt", options.message, { choice: result.value }), result.value;
2624
- }
2625
- async multiselect(options, promptOptions) {
2626
- let result = await (0, import_prompts.default)(
2627
- {
2628
- type: "multiselect",
2629
- name: "value",
2630
- message: options.message,
2631
- choices: options.options.map((opt) => ({
2632
- title: opt.label || String(opt.value),
2633
- value: opt.value,
2634
- description: opt.hint,
2635
- selected: options.initialValues?.includes(opt.value)
2636
- })),
2637
- min: options.required ? 1 : 0
2638
- },
2639
- { ...this.getBaseOptions(promptOptions) }
2640
- );
2641
- return logTracker.addLog("prompt", options.message, { choice: result.value }), result.value;
2642
- }
2643
- spinner(options) {
2644
- let interval, chars = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"], i = 0, spinnerId = `${options.id}-spinner`;
2645
- return {
2646
- start: (message) => {
2647
- logTracker.addLog("info", `${spinnerId}-start: ${message}`), process.stdout.write("\x1B[?25l"), interval = setInterval(() => {
2648
- process.stdout.write(`\r${chars[i]} ${message || "Loading..."}`), i = (i + 1) % chars.length;
2649
- }, 100);
2650
- },
2651
- stop: (message) => {
2652
- logTracker.addLog("info", `${spinnerId}-stop: ${message}`), clearInterval(interval), process.stdout.write("\x1B[?25h"), message ? process.stdout.write(`\r\u2713 ${message}
2653
- `) : process.stdout.write("\r\x1B[K");
2654
- },
2655
- message: (text2) => {
2656
- logTracker.addLog("info", `${spinnerId}: ${text2}`), process.stdout.write(`\r${text2}`);
2657
- }
2658
- };
2659
- }
2660
- taskLog(options) {
2661
- logger.info(`${options.title}
2662
- `);
2663
- let taskId = `${options.id}-task`;
2664
- return logTracker.addLog("info", `${taskId}-start: ${options.title}`), {
2665
- message: (text2) => {
2666
- logger.info(text2), logTracker.addLog("info", `${taskId}: ${text2}`);
2667
- },
2668
- success: (message) => {
2669
- logger.info(message), logTracker.addLog("info", `${taskId}-success: ${message}`);
2670
- },
2671
- error: (message) => {
2672
- logger.error(message), logTracker.addLog("error", `${taskId}-error: ${message}`);
2673
- }
2674
- };
2675
- }
2676
- };
2677
-
2678
- // src/node-logger/prompts/prompt-config.ts
2679
- var PROVIDERS = {
2680
- clack: new ClackPromptProvider(),
2681
- prompts: new PromptsPromptProvider()
2682
- }, currentPromptLibrary = optionalEnvToBoolean(process.env.USE_CLACK) ? "clack" : "prompts", setPromptLibrary = (library) => {
2683
- currentPromptLibrary = library;
2684
- }, getPromptLibrary = () => currentPromptLibrary, getPromptProvider = () => PROVIDERS[currentPromptLibrary], isClackEnabled = () => currentPromptLibrary === "clack", isPromptsEnabled = () => currentPromptLibrary === "prompts", getPreferredStdio = () => isClackEnabled() ? "pipe" : "inherit";
2685
-
2686
- // src/node-logger/wrap-utils.ts
2687
- var import_picocolors3 = __toESM(require_picocolors(), 1);
2688
-
2689
- // ../node_modules/wrap-ansi/node_modules/string-width/index.js
2690
- var import_eastasianwidth = __toESM(require_eastasianwidth(), 1), import_emoji_regex = __toESM(require_emoji_regex(), 1);
2691
- function stringWidth(string, options = {}) {
2692
- if (typeof string != "string" || string.length === 0 || (options = {
2693
- ambiguousIsNarrow: !0,
2694
- ...options
2695
- }, string = stripAnsi(string), string.length === 0))
2696
- return 0;
2697
- string = string.replace((0, import_emoji_regex.default)(), " ");
2698
- let ambiguousCharacterWidth = options.ambiguousIsNarrow ? 1 : 2, width = 0;
2699
- for (let character of string) {
2700
- let codePoint = character.codePointAt(0);
2701
- if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159 || codePoint >= 768 && codePoint <= 879)
2702
- continue;
2703
- switch (import_eastasianwidth.default.eastAsianWidth(character)) {
2704
- case "F":
2705
- case "W":
2706
- width += 2;
2707
- break;
2708
- case "A":
2709
- width += ambiguousCharacterWidth;
2710
- break;
2711
- default:
2712
- width += 1;
2713
- }
2714
- }
2715
- return width;
2716
- }
2717
-
2718
- // ../node_modules/wrap-ansi/index.js
2719
- var ESCAPES = /* @__PURE__ */ new Set([
2720
- "\x1B",
2721
- "\x9B"
2722
- ]), END_CODE = 39, ANSI_ESCAPE_BELL = "\x07", ANSI_CSI = "[", ANSI_OSC = "]", ANSI_SGR_TERMINATOR = "m", ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`, wrapAnsiCode = (code) => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`, wrapAnsiHyperlink = (uri) => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${uri}${ANSI_ESCAPE_BELL}`, wordLengths = (string) => string.split(" ").map((character) => stringWidth(character)), wrapWord = (rows, word, columns) => {
2723
- let characters = [...word], isInsideEscape = !1, isInsideLinkEscape = !1, visible = stringWidth(stripAnsi(rows[rows.length - 1]));
2724
- for (let [index, character] of characters.entries()) {
2725
- let characterLength = stringWidth(character);
2726
- if (visible + characterLength <= columns ? rows[rows.length - 1] += character : (rows.push(character), visible = 0), ESCAPES.has(character) && (isInsideEscape = !0, isInsideLinkEscape = characters.slice(index + 1).join("").startsWith(ANSI_ESCAPE_LINK)), isInsideEscape) {
2727
- isInsideLinkEscape ? character === ANSI_ESCAPE_BELL && (isInsideEscape = !1, isInsideLinkEscape = !1) : character === ANSI_SGR_TERMINATOR && (isInsideEscape = !1);
2728
- continue;
2729
- }
2730
- visible += characterLength, visible === columns && index < characters.length - 1 && (rows.push(""), visible = 0);
2731
- }
2732
- !visible && rows[rows.length - 1].length > 0 && rows.length > 1 && (rows[rows.length - 2] += rows.pop());
2733
- }, stringVisibleTrimSpacesRight = (string) => {
2734
- let words = string.split(" "), last = words.length;
2735
- for (; last > 0 && !(stringWidth(words[last - 1]) > 0); )
2736
- last--;
2737
- return last === words.length ? string : words.slice(0, last).join(" ") + words.slice(last).join("");
2738
- }, exec = (string, columns, options = {}) => {
2739
- if (options.trim !== !1 && string.trim() === "")
2740
- return "";
2741
- let returnValue = "", escapeCode, escapeUrl, lengths = wordLengths(string), rows = [""];
2742
- for (let [index, word] of string.split(" ").entries()) {
2743
- options.trim !== !1 && (rows[rows.length - 1] = rows[rows.length - 1].trimStart());
2744
- let rowLength = stringWidth(rows[rows.length - 1]);
2745
- if (index !== 0 && (rowLength >= columns && (options.wordWrap === !1 || options.trim === !1) && (rows.push(""), rowLength = 0), (rowLength > 0 || options.trim === !1) && (rows[rows.length - 1] += " ", rowLength++)), options.hard && lengths[index] > columns) {
2746
- let remainingColumns = columns - rowLength, breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);
2747
- Math.floor((lengths[index] - 1) / columns) < breaksStartingThisLine && rows.push(""), wrapWord(rows, word, columns);
2748
- continue;
2749
- }
2750
- if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) {
2751
- if (options.wordWrap === !1 && rowLength < columns) {
2752
- wrapWord(rows, word, columns);
2753
- continue;
2754
- }
2755
- rows.push("");
2756
- }
2757
- if (rowLength + lengths[index] > columns && options.wordWrap === !1) {
2758
- wrapWord(rows, word, columns);
2759
- continue;
2760
- }
2761
- rows[rows.length - 1] += word;
2762
- }
2763
- options.trim !== !1 && (rows = rows.map((row) => stringVisibleTrimSpacesRight(row)));
2764
- let pre = [...rows.join(`
2765
- `)];
2766
- for (let [index, character] of pre.entries()) {
2767
- if (returnValue += character, ESCAPES.has(character)) {
2768
- let { groups } = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`).exec(pre.slice(index).join("")) || { groups: {} };
2769
- if (groups.code !== void 0) {
2770
- let code2 = Number.parseFloat(groups.code);
2771
- escapeCode = code2 === END_CODE ? void 0 : code2;
2772
- } else groups.uri !== void 0 && (escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri);
2773
- }
2774
- let code = ansi_styles_default.codes.get(Number(escapeCode));
2775
- pre[index + 1] === `
2776
- ` ? (escapeUrl && (returnValue += wrapAnsiHyperlink("")), escapeCode && code && (returnValue += wrapAnsiCode(code))) : character === `
2777
- ` && (escapeCode && code && (returnValue += wrapAnsiCode(escapeCode)), escapeUrl && (returnValue += wrapAnsiHyperlink(escapeUrl)));
2778
- }
2779
- return returnValue;
2780
- };
2781
- function wrapAnsi(string, columns, options) {
2782
- return String(string).normalize().replace(/\r\n/g, `
2783
- `).split(`
2784
- `).map((line) => exec(line, columns, options)).join(`
2785
- `);
2786
- }
2787
-
2788
- // src/node-logger/wrap-utils.ts
2789
- function getTerminalWidth() {
2790
- try {
2791
- return process.stdout.columns || 80;
2792
- } catch {
2793
- return 80;
2794
- }
2795
- }
2796
- var ANSI_REGEX = /\u001b\[[0-9;]*m|\u001b\]8;;[^\u0007]*\u0007|\u001b\]8;;\u0007/g, URL_REGEX = /(https?:\/\/[^\s\u0000-\u001F\u007F]+)/g;
2797
- function stripAnsi2(str) {
2798
- return str.replace(ANSI_REGEX, "");
2799
- }
2800
- function getVisibleLength(str) {
2801
- return stripAnsi2(str).length;
2802
- }
2803
- function getEnvFromTerminal(key) {
2804
- return execaSync("echo", [`$${key}`], { shell: !0 }).stdout.trim();
2805
- }
2806
- function supportsHyperlinks() {
2807
- try {
2808
- let termProgram = getEnvFromTerminal("TERM_PROGRAM"), termProgramVersion = getEnvFromTerminal("TERM_PROGRAM_VERSION");
2809
- switch (termProgram) {
2810
- case "iTerm.app":
2811
- if (termProgramVersion.trim()) {
2812
- let version = termProgramVersion.trim().split(".").map(Number);
2813
- return version[0] > 3 || version[0] === 3 && version[1] >= 1;
2814
- }
2815
- return !0;
2816
- // Assume recent version
2817
- case "Apple_Terminal":
2818
- return !1;
2819
- default:
2820
- return !0;
2821
- }
2822
- } catch {
2823
- return !1;
2824
- }
2825
- }
2826
- function protectUrls(text2, options) {
2827
- let defaultMaxUrlLength = Math.floor(getTerminalWidth() * 0.8), maxLineWidth = options?.maxLineWidth ?? getTerminalWidth(), useHyperlinks = supportsHyperlinks();
2828
- return text2.replace(URL_REGEX, (match, capturedUrl, offset) => {
2829
- if (!useHyperlinks)
2830
- return match;
2831
- let searchPos = 0;
2832
- for (; ; ) {
2833
- let hyperlinkStart = text2.indexOf("\x1B]8;;", searchPos);
2834
- if (hyperlinkStart === -1)
2835
- break;
2836
- let hyperlinkEnd = text2.indexOf("\x1B]8;;\x07", hyperlinkStart);
2837
- if (hyperlinkEnd === -1) {
2838
- searchPos = hyperlinkStart + 1;
2839
- continue;
2840
- }
2841
- if (offset >= hyperlinkStart && offset < hyperlinkEnd + 7)
2842
- return match;
2843
- searchPos = hyperlinkEnd + 1;
2844
- }
2845
- let textBeforeUrl = text2.substring(0, offset), lastNewlineIndex = textBeforeUrl.lastIndexOf(`
2846
- `), currentLinePrefix = lastNewlineIndex === -1 ? textBeforeUrl : textBeforeUrl.substring(lastNewlineIndex + 1), prefixLength = getVisibleLength(currentLinePrefix), availableSpace = maxLineWidth - prefixLength, minUrlLength = 20, configuredMax = options?.maxUrlLength ?? defaultMaxUrlLength, effectiveMaxLength = Math.min(configuredMax, defaultMaxUrlLength, availableSpace);
2847
- if ((capturedUrl.length <= minUrlLength || effectiveMaxLength < minUrlLength) && (effectiveMaxLength = capturedUrl.length), capturedUrl.length > effectiveMaxLength) {
2848
- let truncatedText = capturedUrl.substring(0, effectiveMaxLength - 3) + "...";
2849
- return `\x1B]8;;${capturedUrl}\x07${truncatedText}\x1B]8;;\x07`;
2850
- }
2851
- return `\x1B]8;;${capturedUrl}\x07${capturedUrl}\x1B]8;;\x07`;
2852
- });
2853
- }
2854
- function createHyperlink(title, url) {
2855
- return supportsHyperlinks() ? `\x1B]8;;${url}\x07${title}\x1B]8;;\x07` : `${title}: ${url}`;
2856
- }
2857
- function splitTextPreservingUrls(text2) {
2858
- let parts = [], lastIndex = 0, match;
2859
- for (URL_REGEX.lastIndex = 0; (match = URL_REGEX.exec(text2)) !== null; ) {
2860
- if (match.index > lastIndex) {
2861
- let beforeUrl = text2.slice(lastIndex, match.index);
2862
- parts.push(...beforeUrl.split(" ").filter((part) => part.length > 0));
2863
- }
2864
- parts.push(match[0]), lastIndex = match.index + match[0].length;
2865
- }
2866
- if (lastIndex < text2.length) {
2867
- let remaining = text2.slice(lastIndex);
2868
- parts.push(...remaining.split(" ").filter((part) => part.length > 0));
2869
- }
2870
- return parts;
2871
- }
2872
- var MAX_OPTIMAL_WIDTH = 80;
2873
- function getOptimalWidth(width) {
2874
- return Math.min(width, MAX_OPTIMAL_WIDTH);
2875
- }
2876
- function wrapTextForClack(text2, width) {
2877
- let terminalWidth = width || getTerminalWidth(), contentWidth = Math.max(terminalWidth - 10, 40), maxOptimalWidth = getOptimalWidth(contentWidth), protectedText = protectUrls(text2, { maxLineWidth: maxOptimalWidth });
2878
- return wrapAnsi(protectedText, maxOptimalWidth);
2879
- }
2880
- function wrapTextForClackHint(text2, width, label) {
2881
- let terminalWidth = width || getTerminalWidth(), reservedSpaceFirstLine = 8 + (label ? getVisibleLength(label) : 0), firstLineWidth = Math.min(
2882
- MAX_OPTIMAL_WIDTH - reservedSpaceFirstLine,
2883
- Math.max(terminalWidth - reservedSpaceFirstLine, 30)
2884
- ), indentSpaces = 4, continuationLineWidth = getOptimalWidth(Math.max(terminalWidth - indentSpaces, 30)), protectedText = protectUrls(text2, { maxLineWidth: continuationLineWidth }), initialWrap = wrapAnsi(protectedText, continuationLineWidth), lines = initialWrap.split(`
2885
- `);
2886
- if (lines.length > 0 && getVisibleLength(lines[0]) > firstLineWidth) {
2887
- let words = splitTextPreservingUrls(text2), firstLinePart = "", remainingPart = "";
2888
- for (let i = 0; i < words.length; i++) {
2889
- let testLine = i === 0 ? words[i] : firstLinePart + " " + words[i];
2890
- if (getVisibleLength(testLine) <= firstLineWidth)
2891
- firstLinePart = testLine;
2892
- else {
2893
- remainingPart = words.slice(i).join(" ");
2894
- break;
2895
- }
2896
- }
2897
- !firstLinePart && words.length > 0 && (firstLinePart = words[0], remainingPart = words.slice(1).join(" "));
2898
- let finalLines = [firstLinePart];
2899
- if (remainingPart.trim()) {
2900
- let protectedRemainder = protectUrls(remainingPart.trim(), {
2901
- maxLineWidth: continuationLineWidth
2902
- }), wrappedRemainder = wrapAnsi(protectedRemainder, continuationLineWidth);
2903
- finalLines = finalLines.concat(wrappedRemainder.split(`
2904
- `));
2905
- }
2906
- if (finalLines.length <= 1)
2907
- return finalLines[0] || "";
2908
- let indentation2 = (0, import_picocolors3.reset)((0, import_picocolors3.cyan)(d)) + " ".repeat(indentSpaces);
2909
- return finalLines.map((line, index) => index === 0 ? line : `${indentation2}${(0, import_picocolors3.dim)(line)}`).join(`
2910
- `);
2911
- }
2912
- if (lines.length <= 1)
2913
- return initialWrap;
2914
- let indentation = (0, import_picocolors3.reset)((0, import_picocolors3.cyan)(d)) + " ".repeat(indentSpaces);
2915
- return lines.map((line, index) => index === 0 ? line : `${indentation}${(0, import_picocolors3.dim)(line)}`).join(`
2916
- `);
2917
- }
2918
-
2919
- // src/node-logger/logger/colors.ts
2920
- var import_picocolors4 = __toESM(require_picocolors(), 1), CLI_COLORS = {
2921
- success: import_picocolors4.default.green,
2922
- error: import_picocolors4.default.red,
2923
- warning: import_picocolors4.default.yellow,
2924
- info: import_picocolors4.default.blue,
2925
- debug: import_picocolors4.default.gray,
2926
- // Only color a link if it is the primary call to action, otherwise links shouldn't be colored
2927
- cta: import_picocolors4.default.cyan
2928
- };
2929
-
2930
- // src/node-logger/logger/logger.ts
2931
- var createLogFunction = (clackFn, consoleFn) => () => isClackEnabled() ? (message) => {
2932
- currentTaskLog ? currentTaskLog.message(message) : clackFn(wrapTextForClack(message));
2933
- } : consoleFn, LOG_FUNCTIONS = {
2934
- log: createLogFunction(R.message, console.log),
2935
- info: createLogFunction(R.info, console.log),
2936
- warn: createLogFunction(R.warn, console.warn),
2937
- error: createLogFunction(R.error, console.error),
2938
- intro: createLogFunction(Mt2, console.log),
2939
- outro: createLogFunction(Rt, console.log),
2940
- step: createLogFunction(R.step, console.log)
2941
- }, LOG_LEVELS = {
2942
- trace: 1,
2943
- debug: 2,
2944
- info: 3,
2945
- warn: 4,
2946
- error: 5,
2947
- silent: 10
2948
- }, currentLogLevel = "info", setLogLevel = (level) => {
2949
- currentLogLevel = level;
2950
- }, getLogLevel = () => currentLogLevel, shouldLog = (level) => LOG_LEVELS[currentLogLevel] <= LOG_LEVELS[level];
2951
- function getMinimalTrace() {
2952
- let stack = new Error().stack;
2953
- if (!stack)
2954
- return;
2955
- let userStackLines = stack.split(`
2956
- `).slice(1).filter(
2957
- (line) => !["getMinimalTrace", "createLogger", "logFunction"].some((fn) => line.includes(fn))
2958
- );
2959
- return userStackLines.length === 0 ? void 0 : `
2960
- ` + userStackLines.slice(0, 2).join(`
2961
- `);
2962
- }
2963
- var formatLogMessage = (args) => args.map((arg) => typeof arg == "string" ? arg : typeof arg == "object" ? JSON.stringify(arg, null, 2) : String(arg)).join(" ");
2964
- function createLogger(level, logFn, prefix) {
2965
- return function(...args) {
2966
- let message = formatLogMessage(args);
2967
- if (logTracker.addLog(level, message), level === "prompt" && (level = "info"), shouldLog(level)) {
2968
- let formattedMessage = prefix ? `${prefix} ${message}` : message;
2969
- logFn(formattedMessage);
2970
- }
2971
- };
2972
- }
2973
- var debug = createLogger(
2974
- "debug",
2975
- function(message) {
2976
- shouldLog("trace") && (message += getMinimalTrace()), LOG_FUNCTIONS.log()(message);
2977
- },
2978
- "[DEBUG]"
2979
- ), log = createLogger("info", (...args) => LOG_FUNCTIONS.log()(...args)), info = createLogger("info", (...args) => LOG_FUNCTIONS.info()(...args)), warn = createLogger("warn", (...args) => LOG_FUNCTIONS.warn()(...args)), error = createLogger("error", (...args) => LOG_FUNCTIONS.error()(...args)), logBox = (message, options) => {
2980
- shouldLog("info") && (logTracker.addLog("info", message), isClackEnabled() ? (options?.title && log(options.title), log(message)) : console.log(
2981
- boxen(message, {
2982
- borderStyle: "round",
2983
- padding: 1,
2984
- borderColor: "#F1618C",
2985
- // pink
2986
- ...options
2987
- })
2988
- ));
2989
- }, intro = (message) => {
2990
- logTracker.addLog("info", message), console.log(`
2991
- `), LOG_FUNCTIONS.intro()(message);
2992
- }, outro = (message) => {
2993
- logTracker.addLog("info", message), LOG_FUNCTIONS.outro()(message), console.log(`
2994
- `);
2995
- }, step = (message) => {
2996
- logTracker.addLog("info", message), LOG_FUNCTIONS.step()(message);
2997
- }, SYMBOLS = {
2998
- success: CLI_COLORS.success("\u2714"),
2999
- error: CLI_COLORS.error("\u2715")
3000
- };
3001
-
3002
- // src/node-logger/prompts/prompt-functions.ts
3003
- var prompt_functions_exports = {};
3004
- __export(prompt_functions_exports, {
3005
- confirm: () => confirm,
3006
- multiselect: () => multiselect,
3007
- select: () => select,
3008
- spinner: () => spinner,
3009
- taskLog: () => taskLog,
3010
- text: () => text
3011
- });
3012
- var activeSpinner = null, activeTaskLog = null, originalConsoleLog = null, patchConsoleLog = () => {
3013
- originalConsoleLog || (originalConsoleLog = console.log, console.log = (...args) => {
3014
- let message = args.map((arg) => typeof arg == "string" ? arg : JSON.stringify(arg)).join(" ");
3015
- activeTaskLog ? activeTaskLog.message(message) : activeSpinner ? activeSpinner.message(message) : originalConsoleLog(...args);
3016
- });
3017
- }, restoreConsoleLog = () => {
3018
- originalConsoleLog && !activeSpinner && !activeTaskLog && (console.log = originalConsoleLog, originalConsoleLog = null);
3019
- }, text = async (options, promptOptions) => getPromptProvider().text(options, promptOptions), confirm = async (options, promptOptions) => getPromptProvider().confirm(options, promptOptions), select = async (options, promptOptions) => getPromptProvider().select(options, promptOptions), multiselect = async (options, promptOptions) => getPromptProvider().multiselect(
3020
- {
3021
- ...options,
3022
- options: options.options.map((opt) => ({
3023
- ...opt,
3024
- hint: opt.hint ? wrapTextForClackHint(opt.hint, void 0, opt.label || String(opt.value)) : void 0
3025
- }))
3026
- },
3027
- promptOptions
3028
- ), spinner = (options) => {
3029
- let spinnerInstance = getPromptProvider().spinner(options), wrappedSpinner = {
3030
- start: (message) => {
3031
- activeSpinner = wrappedSpinner, patchConsoleLog(), spinnerInstance.start(message);
3032
- },
3033
- stop: (message) => {
3034
- activeSpinner = null, restoreConsoleLog(), spinnerInstance.stop(message);
3035
- },
3036
- message: (text2) => {
3037
- spinnerInstance.message(text2);
3038
- }
3039
- };
3040
- return wrappedSpinner;
3041
- }, taskLog = (options) => {
3042
- let task = getPromptProvider().taskLog(options), wrappedTaskLog = {
3043
- message: (message) => {
3044
- task.message(wrapTextForClack(message));
3045
- },
3046
- success: (message, options2) => {
3047
- activeTaskLog = null, restoreConsoleLog(), task.success(message, options2);
3048
- },
3049
- error: (message) => {
3050
- activeTaskLog = null, restoreConsoleLog(), task.error(message);
3051
- }
3052
- };
3053
- return activeTaskLog = wrappedTaskLog, patchConsoleLog(), wrappedTaskLog;
3054
- };
3055
-
3056
- // src/node-logger/tasks.ts
3057
- var executeTask = async (childProcessFactories, {
3058
- id,
3059
- intro: intro2,
3060
- error: error2,
3061
- success,
3062
- limitLines = 4
3063
- }) => {
3064
- logTracker.addLog("info", intro2);
3065
- let task = taskLog({
3066
- id,
3067
- title: intro2,
3068
- retainLog: !1,
3069
- limit: limitLines
3070
- }), factories = Array.isArray(childProcessFactories) ? childProcessFactories : [childProcessFactories];
3071
- try {
3072
- for (let factory of factories) {
3073
- let childProcess = factory();
3074
- childProcess.stdout?.on("data", (data) => {
3075
- let message = data.toString().trim();
3076
- logTracker.addLog("info", message), task.message(message);
3077
- }), await childProcess;
3078
- }
3079
- logTracker.addLog("info", success), task.success(success);
3080
- } catch (err) {
3081
- let errorMessage = err instanceof Error ? err.stack ?? err.message : String(err);
3082
- throw logTracker.addLog("error", error2, { error: errorMessage }), task.error(error2), err;
3083
- }
3084
- }, executeTaskWithSpinner = async (childProcessFactories, { id, intro: intro2, error: error2, success }) => {
3085
- logTracker.addLog("info", intro2);
3086
- let task = spinner({ id });
3087
- task.start(intro2);
3088
- let factories = Array.isArray(childProcessFactories) ? childProcessFactories : [childProcessFactories];
3089
- try {
3090
- for (let factory of factories) {
3091
- let childProcess = factory();
3092
- childProcess.stdout?.on("data", (data) => {
3093
- let message = data.toString().trim().slice(0, 25);
3094
- logTracker.addLog("info", `${intro2}: ${data.toString()}`), task.message(`${intro2}: ${message}`);
3095
- }), await childProcess;
3096
- }
3097
- logTracker.addLog("info", success), task.stop(success);
3098
- } catch (err) {
3099
- throw logTracker.addLog("error", error2, { error: err }), task.stop(error2), err;
3100
- }
3101
- };
3102
-
3103
- // src/node-logger/prompts/index.ts
3104
- var prompt = {
3105
- ...prompt_functions_exports,
3106
- ...prompt_config_exports,
3107
- executeTask,
3108
- executeTaskWithSpinner
3109
- };
3110
-
3111
- // src/node-logger/index.ts
3112
- import_npmlog.default.stream = process.stdout;
3113
- function hex(hexColor) {
3114
- if (!/^#?[0-9A-Fa-f]{6}$/.test(hexColor))
3115
- throw new Error("Invalid hex color. It must be a 6-character hex code.");
3116
- hexColor.startsWith("#") && (hexColor = hexColor.slice(1));
3117
- let r = parseInt(hexColor.slice(0, 2), 16), g = parseInt(hexColor.slice(2, 4), 16), b2 = parseInt(hexColor.slice(4, 6), 16);
3118
- return (text2) => `\x1B[38;2;${r};${g};${b2}m${text2}\x1B[39m`;
3119
- }
3120
- var colors = {
3121
- pink: hex("#F1618C"),
3122
- purple: hex("#B57EE5"),
3123
- orange: hex("#F3AD38"),
3124
- green: hex("#A2E05E"),
3125
- blue: hex("#6DABF5"),
3126
- red: hex("#F16161"),
3127
- gray: hex("#B8C2CC")
3128
- }, logger = {
3129
- ...logger_exports,
3130
- verbose: (message) => debug(message),
3131
- info: (message) => isClackEnabled() ? info(message) : import_npmlog.default.info("", message),
3132
- plain: (message) => log(message),
3133
- line: (count = 1) => log(`${Array(count - 1).fill(`
3134
- `)}`),
3135
- warn: (message) => warn(message),
3136
- trace: ({ message, time }) => debug(`${message} (${colors.purple((0, import_pretty_hrtime.default)(time))})`),
3137
- setLevel: (level = "info") => {
3138
- import_npmlog.default.level = level, setLogLevel(level);
3139
- },
3140
- error: (message) => {
3141
- let msg;
3142
- message instanceof Error && message.stack ? msg = message.stack.toString().replace(message.toString(), colors.red(message.toString())) : typeof message == "string" ? msg = message.toString() : msg = String(message), error(msg.replaceAll(process.cwd(), "."));
3143
- }
3144
- };
3145
- var logged = /* @__PURE__ */ new Set(), once = (type) => (message) => {
3146
- if (!logged.has(message))
3147
- return logged.add(message), logger[type](message);
3148
- };
3149
- once.clear = () => logged.clear();
3150
- once.verbose = once("verbose");
3151
- once.info = once("info");
3152
- once.warn = once("warn");
3153
- once.error = once("error");
3154
- var deprecate = once("warn");
13
+ CLI_COLORS,
14
+ ConsoleLogger,
15
+ StyledConsoleLogger,
16
+ colors,
17
+ createHyperlink,
18
+ deprecate,
19
+ import_npmlog,
20
+ logTracker,
21
+ logger,
22
+ once,
23
+ prompt,
24
+ protectUrls
25
+ } from "../_node-chunks/chunk-W4F3T6CY.js";
26
+ import "../_node-chunks/chunk-A4KENTXT.js";
27
+ import "../_node-chunks/chunk-JMP7YFX2.js";
3155
28
  var export_instance = import_npmlog.default;
3156
29
  export {
3157
30
  CLI_COLORS,
31
+ ConsoleLogger,
32
+ StyledConsoleLogger,
3158
33
  colors,
3159
34
  createHyperlink,
3160
35
  deprecate,