@stacksjs/utils 0.58.73 → 0.59.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,1780 +1,4 @@
1
1
  // @bun
2
- var __defProp = Object.defineProperty;
3
- var __export = (target, all) => {
4
- for (var name in all)
5
- __defProp(target, name, {
6
- get: all[name],
7
- enumerable: true,
8
- configurable: true,
9
- set: (newValue) => all[name] = () => newValue
10
- });
11
- };
12
- var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
13
-
14
- // ../../../../node_modules/consola/dist/core.mjs
15
- class Consola {
16
- constructor(options = {}) {
17
- const types2 = options.types || LogTypes;
18
- this.options = defu({
19
- ...options,
20
- defaults: { ...options.defaults },
21
- level: _normalizeLogLevel(options.level, types2),
22
- reporters: [...options.reporters || []]
23
- }, {
24
- types: LogTypes,
25
- throttle: 1000,
26
- throttleMin: 5,
27
- formatOptions: {
28
- date: true,
29
- colors: false,
30
- compact: true
31
- }
32
- });
33
- for (const type in types2) {
34
- const defaults = {
35
- type,
36
- ...this.options.defaults,
37
- ...types2[type]
38
- };
39
- this[type] = this._wrapLogFn(defaults);
40
- this[type].raw = this._wrapLogFn(defaults, true);
41
- }
42
- if (this.options.mockFn) {
43
- this.mockTypes();
44
- }
45
- this._lastLog = {};
46
- }
47
- get level() {
48
- return this.options.level;
49
- }
50
- set level(level) {
51
- this.options.level = _normalizeLogLevel(level, this.options.types, this.options.level);
52
- }
53
- prompt(message, opts) {
54
- if (!this.options.prompt) {
55
- throw new Error("prompt is not supported!");
56
- }
57
- return this.options.prompt(message, opts);
58
- }
59
- create(options) {
60
- const instance = new Consola({
61
- ...this.options,
62
- ...options
63
- });
64
- if (this._mockFn) {
65
- instance.mockTypes(this._mockFn);
66
- }
67
- return instance;
68
- }
69
- withDefaults(defaults) {
70
- return this.create({
71
- ...this.options,
72
- defaults: {
73
- ...this.options.defaults,
74
- ...defaults
75
- }
76
- });
77
- }
78
- withTag(tag) {
79
- return this.withDefaults({
80
- tag: this.options.defaults.tag ? this.options.defaults.tag + ":" + tag : tag
81
- });
82
- }
83
- addReporter(reporter) {
84
- this.options.reporters.push(reporter);
85
- return this;
86
- }
87
- removeReporter(reporter) {
88
- if (reporter) {
89
- const i = this.options.reporters.indexOf(reporter);
90
- if (i >= 0) {
91
- return this.options.reporters.splice(i, 1);
92
- }
93
- } else {
94
- this.options.reporters.splice(0);
95
- }
96
- return this;
97
- }
98
- setReporters(reporters) {
99
- this.options.reporters = Array.isArray(reporters) ? reporters : [reporters];
100
- return this;
101
- }
102
- wrapAll() {
103
- this.wrapConsole();
104
- this.wrapStd();
105
- }
106
- restoreAll() {
107
- this.restoreConsole();
108
- this.restoreStd();
109
- }
110
- wrapConsole() {
111
- for (const type in this.options.types) {
112
- if (!console["__" + type]) {
113
- console["__" + type] = console[type];
114
- }
115
- console[type] = this[type].raw;
116
- }
117
- }
118
- restoreConsole() {
119
- for (const type in this.options.types) {
120
- if (console["__" + type]) {
121
- console[type] = console["__" + type];
122
- delete console["__" + type];
123
- }
124
- }
125
- }
126
- wrapStd() {
127
- this._wrapStream(this.options.stdout, "log");
128
- this._wrapStream(this.options.stderr, "log");
129
- }
130
- _wrapStream(stream, type) {
131
- if (!stream) {
132
- return;
133
- }
134
- if (!stream.__write) {
135
- stream.__write = stream.write;
136
- }
137
- stream.write = (data) => {
138
- this[type].raw(String(data).trim());
139
- };
140
- }
141
- restoreStd() {
142
- this._restoreStream(this.options.stdout);
143
- this._restoreStream(this.options.stderr);
144
- }
145
- _restoreStream(stream) {
146
- if (!stream) {
147
- return;
148
- }
149
- if (stream.__write) {
150
- stream.write = stream.__write;
151
- delete stream.__write;
152
- }
153
- }
154
- pauseLogs() {
155
- paused = true;
156
- }
157
- resumeLogs() {
158
- paused = false;
159
- const _queue = queue.splice(0);
160
- for (const item of _queue) {
161
- item[0]._logFn(item[1], item[2]);
162
- }
163
- }
164
- mockTypes(mockFn) {
165
- const _mockFn = mockFn || this.options.mockFn;
166
- this._mockFn = _mockFn;
167
- if (typeof _mockFn !== "function") {
168
- return;
169
- }
170
- for (const type in this.options.types) {
171
- this[type] = _mockFn(type, this.options.types[type]) || this[type];
172
- this[type].raw = this[type];
173
- }
174
- }
175
- _wrapLogFn(defaults, isRaw) {
176
- return (...args) => {
177
- if (paused) {
178
- queue.push([this, defaults, args, isRaw]);
179
- return;
180
- }
181
- return this._logFn(defaults, args, isRaw);
182
- };
183
- }
184
- _logFn(defaults, args, isRaw) {
185
- if ((defaults.level || 0) > this.level) {
186
- return false;
187
- }
188
- const logObj = {
189
- date: new Date,
190
- args: [],
191
- ...defaults,
192
- level: _normalizeLogLevel(defaults.level, this.options.types)
193
- };
194
- if (!isRaw && args.length === 1 && isLogObj(args[0])) {
195
- Object.assign(logObj, args[0]);
196
- } else {
197
- logObj.args = [...args];
198
- }
199
- if (logObj.message) {
200
- logObj.args.unshift(logObj.message);
201
- delete logObj.message;
202
- }
203
- if (logObj.additional) {
204
- if (!Array.isArray(logObj.additional)) {
205
- logObj.additional = logObj.additional.split("\n");
206
- }
207
- logObj.args.push("\n" + logObj.additional.join("\n"));
208
- delete logObj.additional;
209
- }
210
- logObj.type = typeof logObj.type === "string" ? logObj.type.toLowerCase() : "log";
211
- logObj.tag = typeof logObj.tag === "string" ? logObj.tag : "";
212
- const resolveLog = (newLog = false) => {
213
- const repeated = (this._lastLog.count || 0) - this.options.throttleMin;
214
- if (this._lastLog.object && repeated > 0) {
215
- const args2 = [...this._lastLog.object.args];
216
- if (repeated > 1) {
217
- args2.push(`(repeated ${repeated} times)`);
218
- }
219
- this._log({ ...this._lastLog.object, args: args2 });
220
- this._lastLog.count = 1;
221
- }
222
- if (newLog) {
223
- this._lastLog.object = logObj;
224
- this._log(logObj);
225
- }
226
- };
227
- clearTimeout(this._lastLog.timeout);
228
- const diffTime = this._lastLog.time && logObj.date ? logObj.date.getTime() - this._lastLog.time.getTime() : 0;
229
- this._lastLog.time = logObj.date;
230
- if (diffTime < this.options.throttle) {
231
- try {
232
- const serializedLog = JSON.stringify([
233
- logObj.type,
234
- logObj.tag,
235
- logObj.args
236
- ]);
237
- const isSameLog = this._lastLog.serialized === serializedLog;
238
- this._lastLog.serialized = serializedLog;
239
- if (isSameLog) {
240
- this._lastLog.count = (this._lastLog.count || 0) + 1;
241
- if (this._lastLog.count > this.options.throttleMin) {
242
- this._lastLog.timeout = setTimeout(resolveLog, this.options.throttle);
243
- return;
244
- }
245
- }
246
- } catch {
247
- }
248
- }
249
- resolveLog(true);
250
- }
251
- _log(logObj) {
252
- for (const reporter of this.options.reporters) {
253
- reporter.log(logObj, {
254
- options: this.options
255
- });
256
- }
257
- }
258
- }
259
- var isObject, _defu, createDefu, isPlainObject, isLogObj, _normalizeLogLevel, createConsola, LogLevels, LogTypes, defu, paused, queue;
260
- var init_core = __esm(() => {
261
- isObject = function(value) {
262
- return value !== null && typeof value === "object";
263
- };
264
- _defu = function(baseObject, defaults, namespace = ".", merger) {
265
- if (!isObject(defaults)) {
266
- return _defu(baseObject, {}, namespace, merger);
267
- }
268
- const object = Object.assign({}, defaults);
269
- for (const key in baseObject) {
270
- if (key === "__proto__" || key === "constructor") {
271
- continue;
272
- }
273
- const value = baseObject[key];
274
- if (value === null || value === undefined) {
275
- continue;
276
- }
277
- if (merger && merger(object, key, value, namespace)) {
278
- continue;
279
- }
280
- if (Array.isArray(value) && Array.isArray(object[key])) {
281
- object[key] = [...value, ...object[key]];
282
- } else if (isObject(value) && isObject(object[key])) {
283
- object[key] = _defu(value, object[key], (namespace ? `${namespace}.` : "") + key.toString(), merger);
284
- } else {
285
- object[key] = value;
286
- }
287
- }
288
- return object;
289
- };
290
- createDefu = function(merger) {
291
- return (...arguments_) => arguments_.reduce((p2, c) => _defu(p2, c, "", merger), {});
292
- };
293
- isPlainObject = function(obj) {
294
- return Object.prototype.toString.call(obj) === "[object Object]";
295
- };
296
- isLogObj = function(arg) {
297
- if (!isPlainObject(arg)) {
298
- return false;
299
- }
300
- if (!arg.message && !arg.args) {
301
- return false;
302
- }
303
- if (arg.stack) {
304
- return false;
305
- }
306
- return true;
307
- };
308
- _normalizeLogLevel = function(input, types2 = {}, defaultLevel = 3) {
309
- if (input === undefined) {
310
- return defaultLevel;
311
- }
312
- if (typeof input === "number") {
313
- return input;
314
- }
315
- if (types2[input] && types2[input].level !== undefined) {
316
- return types2[input].level;
317
- }
318
- return defaultLevel;
319
- };
320
- createConsola = function(options = {}) {
321
- return new Consola(options);
322
- };
323
- LogLevels = {
324
- silent: Number.NEGATIVE_INFINITY,
325
- fatal: 0,
326
- error: 0,
327
- warn: 1,
328
- log: 2,
329
- info: 3,
330
- success: 3,
331
- fail: 3,
332
- ready: 3,
333
- start: 3,
334
- box: 3,
335
- debug: 4,
336
- trace: 5,
337
- verbose: Number.POSITIVE_INFINITY
338
- };
339
- LogTypes = {
340
- silent: {
341
- level: -1
342
- },
343
- fatal: {
344
- level: LogLevels.fatal
345
- },
346
- error: {
347
- level: LogLevels.error
348
- },
349
- warn: {
350
- level: LogLevels.warn
351
- },
352
- log: {
353
- level: LogLevels.log
354
- },
355
- info: {
356
- level: LogLevels.info
357
- },
358
- success: {
359
- level: LogLevels.success
360
- },
361
- fail: {
362
- level: LogLevels.fail
363
- },
364
- ready: {
365
- level: LogLevels.info
366
- },
367
- start: {
368
- level: LogLevels.info
369
- },
370
- box: {
371
- level: LogLevels.info
372
- },
373
- debug: {
374
- level: LogLevels.debug
375
- },
376
- trace: {
377
- level: LogLevels.trace
378
- },
379
- verbose: {
380
- level: LogLevels.verbose
381
- }
382
- };
383
- defu = createDefu();
384
- paused = false;
385
- queue = [];
386
- Consola.prototype.add = Consola.prototype.addReporter;
387
- Consola.prototype.remove = Consola.prototype.removeReporter;
388
- Consola.prototype.clear = Consola.prototype.removeReporter;
389
- Consola.prototype.withScope = Consola.prototype.withTag;
390
- Consola.prototype.mock = Consola.prototype.mockTypes;
391
- Consola.prototype.pause = Consola.prototype.pauseLogs;
392
- Consola.prototype.resume = Consola.prototype.resumeLogs;
393
- });
394
-
395
- // ../../../../node_modules/consola/dist/shared/consola.06ad8a64.mjs
396
- import {formatWithOptions} from "util";
397
- import {sep} from "path";
398
-
399
- class BasicReporter {
400
- formatStack(stack, opts) {
401
- return " " + parseStack(stack).join("\n ");
402
- }
403
- formatArgs(args, opts) {
404
- const _args = args.map((arg) => {
405
- if (arg && typeof arg.stack === "string") {
406
- return arg.message + "\n" + this.formatStack(arg.stack, opts);
407
- }
408
- return arg;
409
- });
410
- return formatWithOptions(opts, ..._args);
411
- }
412
- formatDate(date, opts) {
413
- return opts.date ? date.toLocaleTimeString() : "";
414
- }
415
- filterAndJoin(arr) {
416
- return arr.filter(Boolean).join(" ");
417
- }
418
- formatLogObj(logObj, opts) {
419
- const message = this.formatArgs(logObj.args, opts);
420
- if (logObj.type === "box") {
421
- return "\n" + [
422
- bracket(logObj.tag),
423
- logObj.title && logObj.title,
424
- ...message.split("\n")
425
- ].filter(Boolean).map((l) => " > " + l).join("\n") + "\n";
426
- }
427
- return this.filterAndJoin([
428
- bracket(logObj.type),
429
- bracket(logObj.tag),
430
- message
431
- ]);
432
- }
433
- log(logObj, ctx) {
434
- const line = this.formatLogObj(logObj, {
435
- columns: ctx.options.stdout.columns || 0,
436
- ...ctx.options.formatOptions
437
- });
438
- return writeStream(line + "\n", logObj.level < 2 ? ctx.options.stderr || process.stderr : ctx.options.stdout || process.stdout);
439
- }
440
- }
441
- var parseStack, writeStream, bracket;
442
- var init_consola_06ad8a64 = __esm(() => {
443
- parseStack = function(stack) {
444
- const cwd = process.cwd() + sep;
445
- const lines = stack.split("\n").splice(1).map((l) => l.trim().replace("file://", "").replace(cwd, ""));
446
- return lines;
447
- };
448
- writeStream = function(data, stream) {
449
- const write = stream.__write || stream.write;
450
- return write.call(stream, data);
451
- };
452
- bracket = (x) => x ? `[${x}]` : "";
453
- });
454
-
455
- // ../../../../node_modules/consola/dist/utils.mjs
456
- import * as tty from "tty";
457
- var replaceClose, clearBleed, filterEmpty, init, createColors, getColor, stripAnsi, box, env, argv, platform, isDisabled, isForced, isWindows, isDumbTerminal, isCompatibleTerminal, isCI, isColorSupported, colorDefs, colors, ansiRegex, boxStylePresets, defaultStyle;
458
- var init_utils = __esm(() => {
459
- replaceClose = function(index, string, close, replace, head = string.slice(0, Math.max(0, index)) + replace, tail = string.slice(Math.max(0, index + close.length)), next = tail.indexOf(close)) {
460
- return head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
461
- };
462
- clearBleed = function(index, string, open, close, replace) {
463
- return index < 0 ? open + string + close : open + replaceClose(index, string, close, replace) + close;
464
- };
465
- filterEmpty = function(open, close, replace = open, at = open.length + 1) {
466
- return (string) => string || !(string === "" || string === undefined) ? clearBleed(("" + string).indexOf(close, at), string, open, close, replace) : "";
467
- };
468
- init = function(open, close, replace) {
469
- return filterEmpty(`\x1B[${open}m`, `\x1B[${close}m`, replace);
470
- };
471
- createColors = function(useColor = isColorSupported) {
472
- return useColor ? colorDefs : Object.fromEntries(Object.keys(colorDefs).map((key) => [key, String]));
473
- };
474
- getColor = function(color, fallback = "reset") {
475
- return colors[color] || colors[fallback];
476
- };
477
- stripAnsi = function(text) {
478
- return text.replace(new RegExp(ansiRegex, "g"), "");
479
- };
480
- box = function(text, _opts = {}) {
481
- const opts = {
482
- ..._opts,
483
- style: {
484
- ...defaultStyle,
485
- ..._opts.style
486
- }
487
- };
488
- const textLines = text.split("\n");
489
- const boxLines = [];
490
- const _color = getColor(opts.style.borderColor);
491
- const borderStyle = {
492
- ...typeof opts.style.borderStyle === "string" ? boxStylePresets[opts.style.borderStyle] || boxStylePresets.solid : opts.style.borderStyle
493
- };
494
- if (_color) {
495
- for (const key in borderStyle) {
496
- borderStyle[key] = _color(borderStyle[key]);
497
- }
498
- }
499
- const paddingOffset = opts.style.padding % 2 === 0 ? opts.style.padding : opts.style.padding + 1;
500
- const height = textLines.length + paddingOffset;
501
- const width = Math.max(...textLines.map((line) => line.length)) + paddingOffset;
502
- const widthOffset = width + paddingOffset;
503
- const leftSpace = opts.style.marginLeft > 0 ? " ".repeat(opts.style.marginLeft) : "";
504
- if (opts.style.marginTop > 0) {
505
- boxLines.push("".repeat(opts.style.marginTop));
506
- }
507
- if (opts.title) {
508
- const left = borderStyle.h.repeat(Math.floor((width - stripAnsi(opts.title).length) / 2));
509
- const right = borderStyle.h.repeat(width - stripAnsi(opts.title).length - stripAnsi(left).length + paddingOffset);
510
- boxLines.push(`${leftSpace}${borderStyle.tl}${left}${opts.title}${right}${borderStyle.tr}`);
511
- } else {
512
- boxLines.push(`${leftSpace}${borderStyle.tl}${borderStyle.h.repeat(widthOffset)}${borderStyle.tr}`);
513
- }
514
- const valignOffset = opts.style.valign === "center" ? Math.floor((height - textLines.length) / 2) : opts.style.valign === "top" ? height - textLines.length - paddingOffset : height - textLines.length;
515
- for (let i = 0;i < height; i++) {
516
- if (i < valignOffset || i >= valignOffset + textLines.length) {
517
- boxLines.push(`${leftSpace}${borderStyle.v}${" ".repeat(widthOffset)}${borderStyle.v}`);
518
- } else {
519
- const line = textLines[i - valignOffset];
520
- const left = " ".repeat(paddingOffset);
521
- const right = " ".repeat(width - stripAnsi(line).length);
522
- boxLines.push(`${leftSpace}${borderStyle.v}${left}${line}${right}${borderStyle.v}`);
523
- }
524
- }
525
- boxLines.push(`${leftSpace}${borderStyle.bl}${borderStyle.h.repeat(widthOffset)}${borderStyle.br}`);
526
- if (opts.style.marginBottom > 0) {
527
- boxLines.push("".repeat(opts.style.marginBottom));
528
- }
529
- return boxLines.join("\n");
530
- };
531
- ({
532
- env = {},
533
- argv = [],
534
- platform = ""
535
- } = typeof process === "undefined" ? {} : process);
536
- isDisabled = "NO_COLOR" in env || argv.includes("--no-color");
537
- isForced = "FORCE_COLOR" in env || argv.includes("--color");
538
- isWindows = platform === "win32";
539
- isDumbTerminal = env.TERM === "dumb";
540
- isCompatibleTerminal = tty && tty.isatty && tty.isatty(1) && env.TERM && !isDumbTerminal;
541
- isCI = "CI" in env && (("GITHUB_ACTIONS" in env) || ("GITLAB_CI" in env) || ("CIRCLECI" in env));
542
- isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI);
543
- colorDefs = {
544
- reset: init(0, 0),
545
- bold: init(1, 22, "\x1B[22m\x1B[1m"),
546
- dim: init(2, 22, "\x1B[22m\x1B[2m"),
547
- italic: init(3, 23),
548
- underline: init(4, 24),
549
- inverse: init(7, 27),
550
- hidden: init(8, 28),
551
- strikethrough: init(9, 29),
552
- black: init(30, 39),
553
- red: init(31, 39),
554
- green: init(32, 39),
555
- yellow: init(33, 39),
556
- blue: init(34, 39),
557
- magenta: init(35, 39),
558
- cyan: init(36, 39),
559
- white: init(37, 39),
560
- gray: init(90, 39),
561
- bgBlack: init(40, 49),
562
- bgRed: init(41, 49),
563
- bgGreen: init(42, 49),
564
- bgYellow: init(43, 49),
565
- bgBlue: init(44, 49),
566
- bgMagenta: init(45, 49),
567
- bgCyan: init(46, 49),
568
- bgWhite: init(47, 49),
569
- blackBright: init(90, 39),
570
- redBright: init(91, 39),
571
- greenBright: init(92, 39),
572
- yellowBright: init(93, 39),
573
- blueBright: init(94, 39),
574
- magentaBright: init(95, 39),
575
- cyanBright: init(96, 39),
576
- whiteBright: init(97, 39),
577
- bgBlackBright: init(100, 49),
578
- bgRedBright: init(101, 49),
579
- bgGreenBright: init(102, 49),
580
- bgYellowBright: init(103, 49),
581
- bgBlueBright: init(104, 49),
582
- bgMagentaBright: init(105, 49),
583
- bgCyanBright: init(106, 49),
584
- bgWhiteBright: init(107, 49)
585
- };
586
- colors = createColors();
587
- ansiRegex = [
588
- "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
589
- "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"
590
- ].join("|");
591
- boxStylePresets = {
592
- solid: {
593
- tl: "\u250C",
594
- tr: "\u2510",
595
- bl: "\u2514",
596
- br: "\u2518",
597
- h: "\u2500",
598
- v: "\u2502"
599
- },
600
- double: {
601
- tl: "\u2554",
602
- tr: "\u2557",
603
- bl: "\u255A",
604
- br: "\u255D",
605
- h: "\u2550",
606
- v: "\u2551"
607
- },
608
- doubleSingle: {
609
- tl: "\u2553",
610
- tr: "\u2556",
611
- bl: "\u2559",
612
- br: "\u255C",
613
- h: "\u2500",
614
- v: "\u2551"
615
- },
616
- doubleSingleRounded: {
617
- tl: "\u256D",
618
- tr: "\u256E",
619
- bl: "\u2570",
620
- br: "\u256F",
621
- h: "\u2500",
622
- v: "\u2551"
623
- },
624
- singleThick: {
625
- tl: "\u250F",
626
- tr: "\u2513",
627
- bl: "\u2517",
628
- br: "\u251B",
629
- h: "\u2501",
630
- v: "\u2503"
631
- },
632
- singleDouble: {
633
- tl: "\u2552",
634
- tr: "\u2555",
635
- bl: "\u2558",
636
- br: "\u255B",
637
- h: "\u2550",
638
- v: "\u2502"
639
- },
640
- singleDoubleRounded: {
641
- tl: "\u256D",
642
- tr: "\u256E",
643
- bl: "\u2570",
644
- br: "\u256F",
645
- h: "\u2550",
646
- v: "\u2502"
647
- },
648
- rounded: {
649
- tl: "\u256D",
650
- tr: "\u256E",
651
- bl: "\u2570",
652
- br: "\u256F",
653
- h: "\u2500",
654
- v: "\u2502"
655
- }
656
- };
657
- defaultStyle = {
658
- borderColor: "white",
659
- borderStyle: "rounded",
660
- valign: "center",
661
- padding: 2,
662
- marginLeft: 1,
663
- marginTop: 1,
664
- marginBottom: 1
665
- };
666
- });
667
-
668
- // ../../../../node_modules/consola/dist/chunks/prompt.mjs
669
- var exports_prompt = {};
670
- __export(exports_prompt, {
671
- prompt: () => {
672
- {
673
- return prompt;
674
- }
675
- }
676
- });
677
- import {stdin, stdout} from "process";
678
- import f from "readline";
679
- import {WriteStream} from "tty";
680
- import require$$0 from "tty";
681
- async function prompt(message, opts = {}) {
682
- if (!opts.type || opts.type === "text") {
683
- return await text({
684
- message,
685
- defaultValue: opts.default,
686
- placeholder: opts.placeholder,
687
- initialValue: opts.initial
688
- });
689
- }
690
- if (opts.type === "confirm") {
691
- return await confirm({
692
- message,
693
- initialValue: opts.initial
694
- });
695
- }
696
- if (opts.type === "select") {
697
- return await select({
698
- message,
699
- options: opts.options.map((o) => typeof o === "string" ? { value: o, label: o } : o)
700
- });
701
- }
702
- if (opts.type === "multiselect") {
703
- return await multiselect({
704
- message,
705
- options: opts.options.map((o) => typeof o === "string" ? { value: o, label: o } : o),
706
- required: opts.required
707
- });
708
- }
709
- throw new Error(`Unknown prompt type: ${opts.type}`);
710
- }
711
-
712
- class h {
713
- constructor({ render: u, input: F = stdin, output: e = stdout, ...s }, C = true) {
714
- this._track = false, this._cursor = 0, this.state = "initial", this.error = "", this.subscribers = new Map, this._prevFrame = "", this.opts = s, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = u.bind(this), this._track = C, this.input = F, this.output = e;
715
- }
716
- prompt() {
717
- const u = new WriteStream(0);
718
- return u._write = (F, e, s) => {
719
- this._track && (this.value = this.rl.line.replace(/\t/g, ""), this._cursor = this.rl.cursor, this.emit("value", this.value)), s();
720
- }, this.input.pipe(u), this.rl = f.createInterface({ input: this.input, output: u, tabSize: 2, prompt: "", escapeCodeTimeout: 50 }), f.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== undefined && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), g(this.input, true), this.output.on("resize", this.render), this.render(), new Promise((F, e) => {
721
- this.once("submit", () => {
722
- this.output.write(src.cursor.show), this.output.off("resize", this.render), g(this.input, false), F(this.value);
723
- }), this.once("cancel", () => {
724
- this.output.write(src.cursor.show), this.output.off("resize", this.render), g(this.input, false), F(R);
725
- });
726
- });
727
- }
728
- on(u, F) {
729
- const e = this.subscribers.get(u) ?? [];
730
- e.push({ cb: F }), this.subscribers.set(u, e);
731
- }
732
- once(u, F) {
733
- const e = this.subscribers.get(u) ?? [];
734
- e.push({ cb: F, once: true }), this.subscribers.set(u, e);
735
- }
736
- emit(u, ...F) {
737
- const e = this.subscribers.get(u) ?? [], s = [];
738
- for (const C of e)
739
- C.cb(...F), C.once && s.push(() => e.splice(e.indexOf(C), 1));
740
- for (const C of s)
741
- C();
742
- }
743
- unsubscribe() {
744
- this.subscribers.clear();
745
- }
746
- onKeypress(u, F) {
747
- if (this.state === "error" && (this.state = "active"), F?.name && !this._track && V.has(F.name) && this.emit("cursor", V.get(F.name)), F?.name && tD.has(F.name) && this.emit("cursor", F.name), u && (u.toLowerCase() === "y" || u.toLowerCase() === "n") && this.emit("confirm", u.toLowerCase() === "y"), u && this.emit("key", u.toLowerCase()), F?.name === "return") {
748
- if (this.opts.validate) {
749
- const e = this.opts.validate(this.value);
750
- e && (this.error = e, this.state = "error", this.rl.write(this.value));
751
- }
752
- this.state !== "error" && (this.state = "submit");
753
- }
754
- u === "" && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
755
- }
756
- close() {
757
- this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
758
- `), g(this.input, false), this.rl.close(), this.emit(`${this.state}`, this.value), this.unsubscribe();
759
- }
760
- restoreCursor() {
761
- const u = P(this._prevFrame, process.stdout.columns, { hard: true }).split(`
762
- `).length - 1;
763
- this.output.write(src.cursor.move(-999, u * -1));
764
- }
765
- render() {
766
- const u = P(this._render(this) ?? "", process.stdout.columns, { hard: true });
767
- if (u !== this._prevFrame) {
768
- if (this.state === "initial")
769
- this.output.write(src.cursor.hide);
770
- else {
771
- const F = FD(this._prevFrame, u);
772
- if (this.restoreCursor(), F && F?.length === 1) {
773
- const e = F[0];
774
- this.output.write(src.cursor.move(0, e)), this.output.write(src.erase.lines(1));
775
- const s = u.split(`
776
- `);
777
- this.output.write(s[e]), this._prevFrame = u, this.output.write(src.cursor.move(0, s.length - e - 1));
778
- return;
779
- } else if (F && F?.length > 1) {
780
- const e = F[0];
781
- this.output.write(src.cursor.move(0, e)), this.output.write(src.erase.down());
782
- const C = u.split(`
783
- `).slice(e);
784
- this.output.write(C.join(`
785
- `)), this._prevFrame = u;
786
- return;
787
- }
788
- this.output.write(src.erase.down());
789
- }
790
- this.output.write(u), this.state === "initial" && (this.state = "active"), this._prevFrame = u;
791
- }
792
- }
793
- }
794
-
795
- class sD extends h {
796
- get cursor() {
797
- return this.value ? 0 : 1;
798
- }
799
- get _value() {
800
- return this.cursor === 0;
801
- }
802
- constructor(u) {
803
- super(u, false), this.value = !!u.initialValue, this.on("value", () => {
804
- this.value = this._value;
805
- }), this.on("confirm", (F) => {
806
- this.output.write(src.cursor.move(0, -1)), this.value = F, this.state = "submit", this.close();
807
- }), this.on("cursor", () => {
808
- this.value = !this.value;
809
- });
810
- }
811
- }
812
-
813
- class iD extends h {
814
- constructor(u) {
815
- super(u, false), this.cursor = 0, this.options = u.options, this.value = [...u.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: F }) => F === u.cursorAt), 0), this.on("key", (F) => {
816
- F === "a" && this.toggleAll();
817
- }), this.on("cursor", (F) => {
818
- switch (F) {
819
- case "left":
820
- case "up":
821
- this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
822
- break;
823
- case "down":
824
- case "right":
825
- this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
826
- break;
827
- case "space":
828
- this.toggleValue();
829
- break;
830
- }
831
- });
832
- }
833
- get _value() {
834
- return this.options[this.cursor].value;
835
- }
836
- toggleAll() {
837
- const u = this.value.length === this.options.length;
838
- this.value = u ? [] : this.options.map((F) => F.value);
839
- }
840
- toggleValue() {
841
- const u = this.value.includes(this._value);
842
- this.value = u ? this.value.filter((F) => F !== this._value) : [...this.value, this._value];
843
- }
844
- }
845
-
846
- class ED extends h {
847
- constructor(u) {
848
- super(u, false), this.cursor = 0, this.options = u.options, this.cursor = this.options.findIndex(({ value: F }) => F === u.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (F) => {
849
- switch (F) {
850
- case "left":
851
- case "up":
852
- this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
853
- break;
854
- case "down":
855
- case "right":
856
- this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
857
- break;
858
- }
859
- this.changeValue();
860
- });
861
- }
862
- get _value() {
863
- return this.options[this.cursor];
864
- }
865
- changeValue() {
866
- this.value = this._value.value;
867
- }
868
- }
869
-
870
- class oD extends h {
871
- constructor(u) {
872
- super(u), this.valueWithCursor = "", this.on("finalize", () => {
873
- this.value || (this.value = u.defaultValue), this.valueWithCursor = this.value;
874
- }), this.on("value", () => {
875
- if (this.cursor >= this.value.length)
876
- this.valueWithCursor = `${this.value}${l.inverse(l.hidden("_"))}`;
877
- else {
878
- const F = this.value.slice(0, this.cursor), e = this.value.slice(this.cursor);
879
- this.valueWithCursor = `${F}${l.inverse(e[0])}${e.slice(1)}`;
880
- }
881
- });
882
- }
883
- get cursor() {
884
- return this._cursor;
885
- }
886
- }
887
- var z, $, c, U, P, FD, g, ESC, CSI, beep, cursor, scroll, erase, src, picocolors, tty2, isColorSupported2, formatter, replaceClose2, createColors2, picocolorsExports, l, m, G, K, Y, v, L, M, T, r, Z, H, q, p2, J, b, W, Q, I, w, N, j, X, _, DD, uD, R, V, tD, unicode, s, S_STEP_ACTIVE, S_STEP_CANCEL, S_STEP_ERROR, S_STEP_SUBMIT, S_BAR, S_BAR_END, S_RADIO_ACTIVE, S_RADIO_INACTIVE, S_CHECKBOX_ACTIVE, S_CHECKBOX_SELECTED, S_CHECKBOX_INACTIVE, symbol, text, confirm, select, multiselect;
888
- var init_prompt = __esm(() => {
889
- init_consola_36c0034f();
890
- init_utils();
891
- init_core();
892
- init_consola_06ad8a64();
893
- z = function({ onlyFirst: t = false } = {}) {
894
- const u = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");
895
- return new RegExp(u, t ? undefined : "g");
896
- };
897
- $ = function(t) {
898
- if (typeof t != "string")
899
- throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);
900
- return t.replace(z(), "");
901
- };
902
- c = function(t, u = {}) {
903
- if (typeof t != "string" || t.length === 0 || (u = { ambiguousIsNarrow: true, ...u }, t = $(t), t.length === 0))
904
- return 0;
905
- t = t.replace(Y(), " ");
906
- const F = u.ambiguousIsNarrow ? 1 : 2;
907
- let e = 0;
908
- for (const s of t) {
909
- const C = s.codePointAt(0);
910
- if (C <= 31 || C >= 127 && C <= 159 || C >= 768 && C <= 879)
911
- continue;
912
- switch (K.eastAsianWidth(s)) {
913
- case "F":
914
- case "W":
915
- e += 2;
916
- break;
917
- case "A":
918
- e += F;
919
- break;
920
- default:
921
- e += 1;
922
- }
923
- }
924
- return e;
925
- };
926
- U = function() {
927
- const t = new Map;
928
- for (const [u, F] of Object.entries(r)) {
929
- for (const [e, s] of Object.entries(F))
930
- r[e] = { open: `\x1B[${s[0]}m`, close: `\x1B[${s[1]}m` }, F[e] = r[e], t.set(s[0], s[1]);
931
- Object.defineProperty(r, u, { value: F, enumerable: false });
932
- }
933
- return Object.defineProperty(r, "codes", { value: t, enumerable: false }), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi = L(), r.color.ansi256 = M(), r.color.ansi16m = T(), r.bgColor.ansi = L(v), r.bgColor.ansi256 = M(v), r.bgColor.ansi16m = T(v), Object.defineProperties(r, { rgbToAnsi256: { value: (u, F, e) => u === F && F === e ? u < 8 ? 16 : u > 248 ? 231 : Math.round((u - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u / 255 * 5) + 6 * Math.round(F / 255 * 5) + Math.round(e / 255 * 5), enumerable: false }, hexToRgb: { value: (u) => {
934
- const F = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));
935
- if (!F)
936
- return [0, 0, 0];
937
- let [e] = F;
938
- e.length === 3 && (e = [...e].map((C) => C + C).join(""));
939
- const s = Number.parseInt(e, 16);
940
- return [s >> 16 & 255, s >> 8 & 255, s & 255];
941
- }, enumerable: false }, hexToAnsi256: { value: (u) => r.rgbToAnsi256(...r.hexToRgb(u)), enumerable: false }, ansi256ToAnsi: { value: (u) => {
942
- if (u < 8)
943
- return 30 + u;
944
- if (u < 16)
945
- return 90 + (u - 8);
946
- let F, e, s;
947
- if (u >= 232)
948
- F = ((u - 232) * 10 + 8) / 255, e = F, s = F;
949
- else {
950
- u -= 16;
951
- const i = u % 36;
952
- F = Math.floor(u / 36) / 5, e = Math.floor(i / 6) / 5, s = i % 6 / 5;
953
- }
954
- const C = Math.max(F, e, s) * 2;
955
- if (C === 0)
956
- return 30;
957
- let D = 30 + (Math.round(s) << 2 | Math.round(e) << 1 | Math.round(F));
958
- return C === 2 && (D += 60), D;
959
- }, enumerable: false }, rgbToAnsi: { value: (u, F, e) => r.ansi256ToAnsi(r.rgbToAnsi256(u, F, e)), enumerable: false }, hexToAnsi: { value: (u) => r.ansi256ToAnsi(r.hexToAnsi256(u)), enumerable: false } }), r;
960
- };
961
- P = function(t, u, F) {
962
- return String(t).normalize().replace(/\r\n/g, `
963
- `).split(`
964
- `).map((e) => uD(e, u, F)).join(`
965
- `);
966
- };
967
- FD = function(t, u) {
968
- if (t === u)
969
- return;
970
- const F = t.split(`
971
- `), e = u.split(`
972
- `), s = [];
973
- for (let C = 0;C < Math.max(F.length, e.length); C++)
974
- F[C] !== e[C] && s.push(C);
975
- return s;
976
- };
977
- g = function(t, u) {
978
- t.isTTY && t.setRawMode(u);
979
- };
980
- ESC = "\x1B";
981
- CSI = `${ESC}[`;
982
- beep = "\x07";
983
- cursor = {
984
- to(x, y) {
985
- if (!y)
986
- return `${CSI}${x + 1}G`;
987
- return `${CSI}${y + 1};${x + 1}H`;
988
- },
989
- move(x, y) {
990
- let ret = "";
991
- if (x < 0)
992
- ret += `${CSI}${-x}D`;
993
- else if (x > 0)
994
- ret += `${CSI}${x}C`;
995
- if (y < 0)
996
- ret += `${CSI}${-y}A`;
997
- else if (y > 0)
998
- ret += `${CSI}${y}B`;
999
- return ret;
1000
- },
1001
- up: (count = 1) => `${CSI}${count}A`,
1002
- down: (count = 1) => `${CSI}${count}B`,
1003
- forward: (count = 1) => `${CSI}${count}C`,
1004
- backward: (count = 1) => `${CSI}${count}D`,
1005
- nextLine: (count = 1) => `${CSI}E`.repeat(count),
1006
- prevLine: (count = 1) => `${CSI}F`.repeat(count),
1007
- left: `${CSI}G`,
1008
- hide: `${CSI}?25l`,
1009
- show: `${CSI}?25h`,
1010
- save: `${ESC}7`,
1011
- restore: `${ESC}8`
1012
- };
1013
- scroll = {
1014
- up: (count = 1) => `${CSI}S`.repeat(count),
1015
- down: (count = 1) => `${CSI}T`.repeat(count)
1016
- };
1017
- erase = {
1018
- screen: `${CSI}2J`,
1019
- up: (count = 1) => `${CSI}1J`.repeat(count),
1020
- down: (count = 1) => `${CSI}J`.repeat(count),
1021
- line: `${CSI}2K`,
1022
- lineEnd: `${CSI}K`,
1023
- lineStart: `${CSI}1K`,
1024
- lines(count) {
1025
- let clear = "";
1026
- for (let i = 0;i < count; i++)
1027
- clear += this.line + (i < count - 1 ? cursor.up() : "");
1028
- if (count)
1029
- clear += cursor.left;
1030
- return clear;
1031
- }
1032
- };
1033
- src = { cursor, scroll, erase, beep };
1034
- picocolors = { exports: {} };
1035
- tty2 = require$$0;
1036
- isColorSupported2 = !(("NO_COLOR" in process.env) || process.argv.includes("--no-color")) && (("FORCE_COLOR" in process.env) || process.argv.includes("--color") || process.platform === "win32" || tty2.isatty(1) && process.env.TERM !== "dumb" || ("CI" in process.env));
1037
- formatter = (open, close, replace = open) => (input) => {
1038
- let string = "" + input;
1039
- let index = string.indexOf(close, open.length);
1040
- return ~index ? open + replaceClose2(string, close, replace, index) + close : open + string + close;
1041
- };
1042
- replaceClose2 = (string, close, replace, index) => {
1043
- let start = string.substring(0, index) + replace;
1044
- let end = string.substring(index + close.length);
1045
- let nextIndex = end.indexOf(close);
1046
- return ~nextIndex ? start + replaceClose2(end, close, replace, nextIndex) : start + end;
1047
- };
1048
- createColors2 = (enabled = isColorSupported2) => ({
1049
- isColorSupported: enabled,
1050
- reset: enabled ? (s) => `\x1B[0m${s}\x1B[0m` : String,
1051
- bold: enabled ? formatter("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m") : String,
1052
- dim: enabled ? formatter("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m") : String,
1053
- italic: enabled ? formatter("\x1B[3m", "\x1B[23m") : String,
1054
- underline: enabled ? formatter("\x1B[4m", "\x1B[24m") : String,
1055
- inverse: enabled ? formatter("\x1B[7m", "\x1B[27m") : String,
1056
- hidden: enabled ? formatter("\x1B[8m", "\x1B[28m") : String,
1057
- strikethrough: enabled ? formatter("\x1B[9m", "\x1B[29m") : String,
1058
- black: enabled ? formatter("\x1B[30m", "\x1B[39m") : String,
1059
- red: enabled ? formatter("\x1B[31m", "\x1B[39m") : String,
1060
- green: enabled ? formatter("\x1B[32m", "\x1B[39m") : String,
1061
- yellow: enabled ? formatter("\x1B[33m", "\x1B[39m") : String,
1062
- blue: enabled ? formatter("\x1B[34m", "\x1B[39m") : String,
1063
- magenta: enabled ? formatter("\x1B[35m", "\x1B[39m") : String,
1064
- cyan: enabled ? formatter("\x1B[36m", "\x1B[39m") : String,
1065
- white: enabled ? formatter("\x1B[37m", "\x1B[39m") : String,
1066
- gray: enabled ? formatter("\x1B[90m", "\x1B[39m") : String,
1067
- bgBlack: enabled ? formatter("\x1B[40m", "\x1B[49m") : String,
1068
- bgRed: enabled ? formatter("\x1B[41m", "\x1B[49m") : String,
1069
- bgGreen: enabled ? formatter("\x1B[42m", "\x1B[49m") : String,
1070
- bgYellow: enabled ? formatter("\x1B[43m", "\x1B[49m") : String,
1071
- bgBlue: enabled ? formatter("\x1B[44m", "\x1B[49m") : String,
1072
- bgMagenta: enabled ? formatter("\x1B[45m", "\x1B[49m") : String,
1073
- bgCyan: enabled ? formatter("\x1B[46m", "\x1B[49m") : String,
1074
- bgWhite: enabled ? formatter("\x1B[47m", "\x1B[49m") : String
1075
- });
1076
- picocolors.exports = createColors2();
1077
- picocolors.exports.createColors = createColors2;
1078
- picocolorsExports = picocolors.exports;
1079
- l = getDefaultExportFromCjs(picocolorsExports);
1080
- m = {};
1081
- G = { get exports() {
1082
- return m;
1083
- }, set exports(t) {
1084
- m = t;
1085
- } };
1086
- (function(t) {
1087
- var u = {};
1088
- t.exports = u, u.eastAsianWidth = function(e) {
1089
- var s = e.charCodeAt(0), C = e.length == 2 ? e.charCodeAt(1) : 0, D = s;
1090
- return 55296 <= s && s <= 56319 && 56320 <= C && C <= 57343 && (s &= 1023, C &= 1023, D = s << 10 | C, D += 65536), D == 12288 || 65281 <= D && D <= 65376 || 65504 <= D && D <= 65510 ? "F" : D == 8361 || 65377 <= D && D <= 65470 || 65474 <= D && D <= 65479 || 65482 <= D && D <= 65487 || 65490 <= D && D <= 65495 || 65498 <= D && D <= 65500 || 65512 <= D && D <= 65518 ? "H" : 4352 <= D && D <= 4447 || 4515 <= D && D <= 4519 || 4602 <= D && D <= 4607 || 9001 <= D && D <= 9002 || 11904 <= D && D <= 11929 || 11931 <= D && D <= 12019 || 12032 <= D && D <= 12245 || 12272 <= D && D <= 12283 || 12289 <= D && D <= 12350 || 12353 <= D && D <= 12438 || 12441 <= D && D <= 12543 || 12549 <= D && D <= 12589 || 12593 <= D && D <= 12686 || 12688 <= D && D <= 12730 || 12736 <= D && D <= 12771 || 12784 <= D && D <= 12830 || 12832 <= D && D <= 12871 || 12880 <= D && D <= 13054 || 13056 <= D && D <= 19903 || 19968 <= D && D <= 42124 || 42128 <= D && D <= 42182 || 43360 <= D && D <= 43388 || 44032 <= D && D <= 55203 || 55216 <= D && D <= 55238 || 55243 <= D && D <= 55291 || 63744 <= D && D <= 64255 || 65040 <= D && D <= 65049 || 65072 <= D && D <= 65106 || 65108 <= D && D <= 65126 || 65128 <= D && D <= 65131 || 110592 <= D && D <= 110593 || 127488 <= D && D <= 127490 || 127504 <= D && D <= 127546 || 127552 <= D && D <= 127560 || 127568 <= D && D <= 127569 || 131072 <= D && D <= 194367 || 177984 <= D && D <= 196605 || 196608 <= D && D <= 262141 ? "W" : 32 <= D && D <= 126 || 162 <= D && D <= 163 || 165 <= D && D <= 166 || D == 172 || D == 175 || 10214 <= D && D <= 10221 || 10629 <= D && D <= 10630 ? "Na" : D == 161 || D == 164 || 167 <= D && D <= 168 || D == 170 || 173 <= D && D <= 174 || 176 <= D && D <= 180 || 182 <= D && D <= 186 || 188 <= D && D <= 191 || D == 198 || D == 208 || 215 <= D && D <= 216 || 222 <= D && D <= 225 || D == 230 || 232 <= D && D <= 234 || 236 <= D && D <= 237 || D == 240 || 242 <= D && D <= 243 || 247 <= D && D <= 250 || D == 252 || D == 254 || D == 257 || D == 273 || D == 275 || D == 283 || 294 <= D && D <= 295 || D == 299 || 305 <= D && D <= 307 || D == 312 || 319 <= D && D <= 322 || D == 324 || 328 <= D && D <= 331 || D == 333 || 338 <= D && D <= 339 || 358 <= D && D <= 359 || D == 363 || D == 462 || D == 464 || D == 466 || D == 468 || D == 470 || D == 472 || D == 474 || D == 476 || D == 593 || D == 609 || D == 708 || D == 711 || 713 <= D && D <= 715 || D == 717 || D == 720 || 728 <= D && D <= 731 || D == 733 || D == 735 || 768 <= D && D <= 879 || 913 <= D && D <= 929 || 931 <= D && D <= 937 || 945 <= D && D <= 961 || 963 <= D && D <= 969 || D == 1025 || 1040 <= D && D <= 1103 || D == 1105 || D == 8208 || 8211 <= D && D <= 8214 || 8216 <= D && D <= 8217 || 8220 <= D && D <= 8221 || 8224 <= D && D <= 8226 || 8228 <= D && D <= 8231 || D == 8240 || 8242 <= D && D <= 8243 || D == 8245 || D == 8251 || D == 8254 || D == 8308 || D == 8319 || 8321 <= D && D <= 8324 || D == 8364 || D == 8451 || D == 8453 || D == 8457 || D == 8467 || D == 8470 || 8481 <= D && D <= 8482 || D == 8486 || D == 8491 || 8531 <= D && D <= 8532 || 8539 <= D && D <= 8542 || 8544 <= D && D <= 8555 || 8560 <= D && D <= 8569 || D == 8585 || 8592 <= D && D <= 8601 || 8632 <= D && D <= 8633 || D == 8658 || D == 8660 || D == 8679 || D == 8704 || 8706 <= D && D <= 8707 || 8711 <= D && D <= 8712 || D == 8715 || D == 8719 || D == 8721 || D == 8725 || D == 8730 || 8733 <= D && D <= 8736 || D == 8739 || D == 8741 || 8743 <= D && D <= 8748 || D == 8750 || 8756 <= D && D <= 8759 || 8764 <= D && D <= 8765 || D == 8776 || D == 8780 || D == 8786 || 8800 <= D && D <= 8801 || 8804 <= D && D <= 8807 || 8810 <= D && D <= 8811 || 8814 <= D && D <= 8815 || 8834 <= D && D <= 8835 || 8838 <= D && D <= 8839 || D == 8853 || D == 8857 || D == 8869 || D == 8895 || D == 8978 || 9312 <= D && D <= 9449 || 9451 <= D && D <= 9547 || 9552 <= D && D <= 9587 || 9600 <= D && D <= 9615 || 9618 <= D && D <= 9621 || 9632 <= D && D <= 9633 || 9635 <= D && D <= 9641 || 9650 <= D && D <= 9651 || 9654 <= D && D <= 9655 || 9660 <= D && D <= 9661 || 9664 <= D && D <= 9665 || 9670 <= D && D <= 9672 || D == 9675 || 9678 <= D && D <= 9681 || 9698 <= D && D <= 9701 || D == 9711 || 9733 <= D && D <= 9734 || D == 9737 || 9742 <= D && D <= 9743 || 9748 <= D && D <= 9749 || D == 9756 || D == 9758 || D == 9792 || D == 9794 || 9824 <= D && D <= 9825 || 9827 <= D && D <= 9829 || 9831 <= D && D <= 9834 || 9836 <= D && D <= 9837 || D == 9839 || 9886 <= D && D <= 9887 || 9918 <= D && D <= 9919 || 9924 <= D && D <= 9933 || 9935 <= D && D <= 9953 || D == 9955 || 9960 <= D && D <= 9983 || D == 10045 || D == 10071 || 10102 <= D && D <= 10111 || 11093 <= D && D <= 11097 || 12872 <= D && D <= 12879 || 57344 <= D && D <= 63743 || 65024 <= D && D <= 65039 || D == 65533 || 127232 <= D && D <= 127242 || 127248 <= D && D <= 127277 || 127280 <= D && D <= 127337 || 127344 <= D && D <= 127386 || 917760 <= D && D <= 917999 || 983040 <= D && D <= 1048573 || 1048576 <= D && D <= 1114109 ? "A" : "N";
1091
- }, u.characterLength = function(e) {
1092
- var s = this.eastAsianWidth(e);
1093
- return s == "F" || s == "W" || s == "A" ? 2 : 1;
1094
- };
1095
- function F(e) {
1096
- return e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
1097
- }
1098
- u.length = function(e) {
1099
- for (var s = F(e), C = 0, D = 0;D < s.length; D++)
1100
- C = C + this.characterLength(s[D]);
1101
- return C;
1102
- }, u.slice = function(e, s, C) {
1103
- textLen = u.length(e), s = s || 0, C = C || 1, s < 0 && (s = textLen + s), C < 0 && (C = textLen + C);
1104
- for (var D = "", i = 0, o = F(e), E = 0;E < o.length; E++) {
1105
- var a = o[E], n = u.length(a);
1106
- if (i >= s - (n == 2 ? 1 : 0))
1107
- if (i + n <= C)
1108
- D += a;
1109
- else
1110
- break;
1111
- i += n;
1112
- }
1113
- return D;
1114
- };
1115
- })(G);
1116
- K = m;
1117
- Y = function() {
1118
- 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;
1119
- };
1120
- v = 10;
1121
- L = (t = 0) => (u) => `\x1B[${u + t}m`;
1122
- M = (t = 0) => (u) => `\x1B[${38 + t};5;${u}m`;
1123
- T = (t = 0) => (u, F, e) => `\x1B[${38 + t};2;${u};${F};${e}m`;
1124
- r = { modifier: { reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], overline: [53, 55], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29] }, color: { black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], blackBright: [90, 39], gray: [90, 39], grey: [90, 39], redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], blueBright: [94, 39], magentaBright: [95, 39], cyanBright: [96, 39], whiteBright: [97, 39] }, bgColor: { bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], bgBlackBright: [100, 49], bgGray: [100, 49], bgGrey: [100, 49], bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49] } };
1125
- Object.keys(r.modifier);
1126
- Z = Object.keys(r.color);
1127
- H = Object.keys(r.bgColor);
1128
- [...Z];
1129
- q = U();
1130
- p2 = new Set(["\x1B", "\x9B"]);
1131
- J = 39;
1132
- b = "\x07";
1133
- W = "[";
1134
- Q = "]";
1135
- I = "m";
1136
- w = `${Q}8;;`;
1137
- N = (t) => `${p2.values().next().value}${W}${t}${I}`;
1138
- j = (t) => `${p2.values().next().value}${w}${t}${b}`;
1139
- X = (t) => t.split(" ").map((u) => c(u));
1140
- _ = (t, u, F) => {
1141
- const e = [...u];
1142
- let s = false, C = false, D = c($(t[t.length - 1]));
1143
- for (const [i, o] of e.entries()) {
1144
- const E = c(o);
1145
- if (D + E <= F ? t[t.length - 1] += o : (t.push(o), D = 0), p2.has(o) && (s = true, C = e.slice(i + 1).join("").startsWith(w)), s) {
1146
- C ? o === b && (s = false, C = false) : o === I && (s = false);
1147
- continue;
1148
- }
1149
- D += E, D === F && i < e.length - 1 && (t.push(""), D = 0);
1150
- }
1151
- !D && t[t.length - 1].length > 0 && t.length > 1 && (t[t.length - 2] += t.pop());
1152
- };
1153
- DD = (t) => {
1154
- const u = t.split(" ");
1155
- let F = u.length;
1156
- for (;F > 0 && !(c(u[F - 1]) > 0); )
1157
- F--;
1158
- return F === u.length ? t : u.slice(0, F).join(" ") + u.slice(F).join("");
1159
- };
1160
- uD = (t, u, F = {}) => {
1161
- if (F.trim !== false && t.trim() === "")
1162
- return "";
1163
- let e = "", s, C;
1164
- const D = X(t);
1165
- let i = [""];
1166
- for (const [E, a] of t.split(" ").entries()) {
1167
- F.trim !== false && (i[i.length - 1] = i[i.length - 1].trimStart());
1168
- let n = c(i[i.length - 1]);
1169
- if (E !== 0 && (n >= u && (F.wordWrap === false || F.trim === false) && (i.push(""), n = 0), (n > 0 || F.trim === false) && (i[i.length - 1] += " ", n++)), F.hard && D[E] > u) {
1170
- const B = u - n, A = 1 + Math.floor((D[E] - B - 1) / u);
1171
- Math.floor((D[E] - 1) / u) < A && i.push(""), _(i, a, u);
1172
- continue;
1173
- }
1174
- if (n + D[E] > u && n > 0 && D[E] > 0) {
1175
- if (F.wordWrap === false && n < u) {
1176
- _(i, a, u);
1177
- continue;
1178
- }
1179
- i.push("");
1180
- }
1181
- if (n + D[E] > u && F.wordWrap === false) {
1182
- _(i, a, u);
1183
- continue;
1184
- }
1185
- i[i.length - 1] += a;
1186
- }
1187
- F.trim !== false && (i = i.map((E) => DD(E)));
1188
- const o = [...i.join(`
1189
- `)];
1190
- for (const [E, a] of o.entries()) {
1191
- if (e += a, p2.has(a)) {
1192
- const { groups: B } = new RegExp(`(?:\\${W}(?<code>\\d+)m|\\${w}(?<uri>.*)${b})`).exec(o.slice(E).join("")) || { groups: {} };
1193
- if (B.code !== undefined) {
1194
- const A = Number.parseFloat(B.code);
1195
- s = A === J ? undefined : A;
1196
- } else
1197
- B.uri !== undefined && (C = B.uri.length === 0 ? undefined : B.uri);
1198
- }
1199
- const n = q.codes.get(Number(s));
1200
- o[E + 1] === `
1201
- ` ? (C && (e += j("")), s && n && (e += N(n))) : a === `
1202
- ` && (s && n && (e += N(s)), C && (e += j(C)));
1203
- }
1204
- return e;
1205
- };
1206
- R = Symbol("clack:cancel");
1207
- V = new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"]]);
1208
- tD = new Set(["up", "down", "left", "right", "space", "enter"]);
1209
- unicode = isUnicodeSupported();
1210
- s = (c2, fallback) => unicode ? c2 : fallback;
1211
- S_STEP_ACTIVE = s("\u276F", ">");
1212
- S_STEP_CANCEL = s("\u25A0", "x");
1213
- S_STEP_ERROR = s("\u25B2", "x");
1214
- S_STEP_SUBMIT = s("\u2714", "\u221A");
1215
- S_BAR = "";
1216
- S_BAR_END = "";
1217
- S_RADIO_ACTIVE = s("\u25CF", ">");
1218
- S_RADIO_INACTIVE = s("\u25CB", " ");
1219
- S_CHECKBOX_ACTIVE = s("\u25FB", "[\u2022]");
1220
- S_CHECKBOX_SELECTED = s("\u25FC", "[+]");
1221
- S_CHECKBOX_INACTIVE = s("\u25FB", "[ ]");
1222
- symbol = (state) => {
1223
- switch (state) {
1224
- case "initial":
1225
- case "active": {
1226
- return colors.cyan(S_STEP_ACTIVE);
1227
- }
1228
- case "cancel": {
1229
- return colors.red(S_STEP_CANCEL);
1230
- }
1231
- case "error": {
1232
- return colors.yellow(S_STEP_ERROR);
1233
- }
1234
- case "submit": {
1235
- return colors.green(S_STEP_SUBMIT);
1236
- }
1237
- }
1238
- };
1239
- text = (opts) => {
1240
- return new oD({
1241
- validate: opts.validate,
1242
- placeholder: opts.placeholder,
1243
- defaultValue: opts.defaultValue,
1244
- initialValue: opts.initialValue,
1245
- render() {
1246
- const title = `${colors.gray(S_BAR)}
1247
- ${symbol(this.state)} ${opts.message}
1248
- `;
1249
- const placeholder = opts.placeholder ? colors.inverse(opts.placeholder[0]) + colors.dim(opts.placeholder.slice(1)) : colors.inverse(colors.hidden("_"));
1250
- const value = this.value ? this.valueWithCursor : placeholder;
1251
- switch (this.state) {
1252
- case "error": {
1253
- return `${title.trim()}
1254
- ${colors.yellow(S_BAR)} ${value}
1255
- ${colors.yellow(S_BAR_END)} ${colors.yellow(this.error)}
1256
- `;
1257
- }
1258
- case "submit": {
1259
- return `${title}${colors.gray(S_BAR)} ${colors.dim(this.value || opts.placeholder)}`;
1260
- }
1261
- case "cancel": {
1262
- return `${title}${colors.gray(S_BAR)} ${colors.strikethrough(colors.dim(this.value ?? ""))}${this.value?.trim() ? "\n" + colors.gray(S_BAR) : ""}`;
1263
- }
1264
- default: {
1265
- return `${title}${colors.cyan(S_BAR)} ${value}
1266
- ${colors.cyan(S_BAR_END)}
1267
- `;
1268
- }
1269
- }
1270
- }
1271
- }).prompt();
1272
- };
1273
- confirm = (opts) => {
1274
- const active = opts.active ?? "Yes";
1275
- const inactive = opts.inactive ?? "No";
1276
- return new sD({
1277
- active,
1278
- inactive,
1279
- initialValue: opts.initialValue ?? true,
1280
- render() {
1281
- const title = `${colors.gray(S_BAR)}
1282
- ${symbol(this.state)} ${opts.message}
1283
- `;
1284
- const value = this.value ? active : inactive;
1285
- switch (this.state) {
1286
- case "submit": {
1287
- return `${title}${colors.gray(S_BAR)} ${colors.dim(value)}`;
1288
- }
1289
- case "cancel": {
1290
- return `${title}${colors.gray(S_BAR)} ${colors.strikethrough(colors.dim(value))}
1291
- ${colors.gray(S_BAR)}`;
1292
- }
1293
- default: {
1294
- return `${title}${colors.cyan(S_BAR)} ${this.value ? `${colors.green(S_RADIO_ACTIVE)} ${active}` : `${colors.dim(S_RADIO_INACTIVE)} ${colors.dim(active)}`} ${colors.dim("/")} ${this.value ? `${colors.dim(S_RADIO_INACTIVE)} ${colors.dim(inactive)}` : `${colors.green(S_RADIO_ACTIVE)} ${inactive}`}
1295
- ${colors.cyan(S_BAR_END)}
1296
- `;
1297
- }
1298
- }
1299
- }
1300
- }).prompt();
1301
- };
1302
- select = (opts) => {
1303
- const opt = (option, state) => {
1304
- const label = option.label ?? String(option.value);
1305
- switch (state) {
1306
- case "active": {
1307
- return `${colors.green(S_RADIO_ACTIVE)} ${label} ${option.hint ? colors.dim(`(${option.hint})`) : ""}`;
1308
- }
1309
- case "selected": {
1310
- return `${colors.dim(label)}`;
1311
- }
1312
- case "cancelled": {
1313
- return `${colors.strikethrough(colors.dim(label))}`;
1314
- }
1315
- }
1316
- return `${colors.dim(S_RADIO_INACTIVE)} ${colors.dim(label)}`;
1317
- };
1318
- return new ED({
1319
- options: opts.options,
1320
- initialValue: opts.initialValue,
1321
- render() {
1322
- const title = `${colors.gray(S_BAR)}
1323
- ${symbol(this.state)} ${opts.message}
1324
- `;
1325
- switch (this.state) {
1326
- case "submit": {
1327
- return `${title}${colors.gray(S_BAR)} ${opt(this.options[this.cursor], "selected")}`;
1328
- }
1329
- case "cancel": {
1330
- return `${title}${colors.gray(S_BAR)} ${opt(this.options[this.cursor], "cancelled")}
1331
- ${colors.gray(S_BAR)}`;
1332
- }
1333
- default: {
1334
- return `${title}${colors.cyan(S_BAR)} ${this.options.map((option, i) => opt(option, i === this.cursor ? "active" : "inactive")).join(`
1335
- ${colors.cyan(S_BAR)} `)}
1336
- ${colors.cyan(S_BAR_END)}
1337
- `;
1338
- }
1339
- }
1340
- }
1341
- }).prompt();
1342
- };
1343
- multiselect = (opts) => {
1344
- const opt = (option, state) => {
1345
- const label = option.label ?? String(option.value);
1346
- switch (state) {
1347
- case "active": {
1348
- return `${colors.cyan(S_CHECKBOX_ACTIVE)} ${label} ${option.hint ? colors.dim(`(${option.hint})`) : ""}`;
1349
- }
1350
- case "selected": {
1351
- return `${colors.green(S_CHECKBOX_SELECTED)} ${colors.dim(label)}`;
1352
- }
1353
- case "cancelled": {
1354
- return `${colors.strikethrough(colors.dim(label))}`;
1355
- }
1356
- case "active-selected": {
1357
- return `${colors.green(S_CHECKBOX_SELECTED)} ${label} ${option.hint ? colors.dim(`(${option.hint})`) : ""}`;
1358
- }
1359
- case "submitted": {
1360
- return `${colors.dim(label)}`;
1361
- }
1362
- }
1363
- return `${colors.dim(S_CHECKBOX_INACTIVE)} ${colors.dim(label)}`;
1364
- };
1365
- return new iD({
1366
- options: opts.options,
1367
- initialValues: opts.initialValues,
1368
- required: opts.required ?? true,
1369
- cursorAt: opts.cursorAt,
1370
- validate(selected) {
1371
- if (this.required && selected.length === 0) {
1372
- return `Please select at least one option.
1373
- ${colors.reset(colors.dim(`Press ${colors.gray(colors.bgWhite(colors.inverse(" space ")))} to select, ${colors.gray(colors.bgWhite(colors.inverse(" enter ")))} to submit`))}`;
1374
- }
1375
- },
1376
- render() {
1377
- const title = `${colors.gray(S_BAR)}
1378
- ${symbol(this.state)} ${opts.message}
1379
- `;
1380
- switch (this.state) {
1381
- case "submit": {
1382
- return `${title}${colors.gray(S_BAR)} ${this.options.filter(({ value }) => this.value.includes(value)).map((option) => opt(option, "submitted")).join(colors.dim(", ")) || colors.dim("none")}`;
1383
- }
1384
- case "cancel": {
1385
- const label = this.options.filter(({ value }) => this.value.includes(value)).map((option) => opt(option, "cancelled")).join(colors.dim(", "));
1386
- return `${title}${colors.gray(S_BAR)} ${label.trim() ? `${label}
1387
- ${colors.gray(S_BAR)}` : ""}`;
1388
- }
1389
- case "error": {
1390
- const footer = this.error.split("\n").map((ln, i) => i === 0 ? `${colors.yellow(S_BAR_END)} ${colors.yellow(ln)}` : ` ${ln}`).join("\n");
1391
- return title + colors.yellow(S_BAR) + " " + this.options.map((option, i) => {
1392
- const selected = this.value.includes(option.value);
1393
- const active = i === this.cursor;
1394
- if (active && selected) {
1395
- return opt(option, "active-selected");
1396
- }
1397
- if (selected) {
1398
- return opt(option, "selected");
1399
- }
1400
- return opt(option, active ? "active" : "inactive");
1401
- }).join(`
1402
- ${colors.yellow(S_BAR)} `) + "\n" + footer + "\n";
1403
- }
1404
- default: {
1405
- return `${title}${colors.cyan(S_BAR)} ${this.options.map((option, i) => {
1406
- const selected = this.value.includes(option.value);
1407
- const active = i === this.cursor;
1408
- if (active && selected) {
1409
- return opt(option, "active-selected");
1410
- }
1411
- if (selected) {
1412
- return opt(option, "selected");
1413
- }
1414
- return opt(option, active ? "active" : "inactive");
1415
- }).join(`
1416
- ${colors.cyan(S_BAR)} `)}
1417
- ${colors.cyan(S_BAR_END)}
1418
- `;
1419
- }
1420
- }
1421
- }
1422
- }).prompt();
1423
- };
1424
- });
1425
-
1426
- // ../../../../node_modules/consola/dist/shared/consola.36c0034f.mjs
1427
- import process$1 from "process";
1428
-
1429
- class FancyReporter extends BasicReporter {
1430
- formatStack(stack) {
1431
- return "\n" + parseStack(stack).map((line) => " " + line.replace(/^at +/, (m2) => colors.gray(m2)).replace(/\((.+)\)/, (_2, m2) => `(${colors.cyan(m2)})`)).join("\n");
1432
- }
1433
- formatType(logObj, isBadge, opts) {
1434
- const typeColor = TYPE_COLOR_MAP[logObj.type] || LEVEL_COLOR_MAP[logObj.level] || "gray";
1435
- if (isBadge) {
1436
- return getBgColor(typeColor)(colors.black(` ${logObj.type.toUpperCase()} `));
1437
- }
1438
- const _type = typeof TYPE_ICONS[logObj.type] === "string" ? TYPE_ICONS[logObj.type] : logObj.icon || logObj.type;
1439
- return _type ? getColor2(typeColor)(_type) : "";
1440
- }
1441
- formatLogObj(logObj, opts) {
1442
- const [message, ...additional] = this.formatArgs(logObj.args, opts).split("\n");
1443
- if (logObj.type === "box") {
1444
- return box(characterFormat(message + (additional.length > 0 ? "\n" + additional.join("\n") : "")), {
1445
- title: logObj.title ? characterFormat(logObj.title) : undefined,
1446
- style: logObj.style
1447
- });
1448
- }
1449
- const date = this.formatDate(logObj.date, opts);
1450
- const coloredDate = date && colors.gray(date);
1451
- const isBadge = logObj.badge ?? logObj.level < 2;
1452
- const type = this.formatType(logObj, isBadge, opts);
1453
- const tag = logObj.tag ? colors.gray(logObj.tag) : "";
1454
- let line;
1455
- const left = this.filterAndJoin([type, characterFormat(message)]);
1456
- const right = this.filterAndJoin(opts.columns ? [tag, coloredDate] : [tag]);
1457
- const space = (opts.columns || 0) - stringWidth(left) - stringWidth(right) - 2;
1458
- line = space > 0 && (opts.columns || 0) >= 80 ? left + " ".repeat(space) + right : (right ? `${colors.gray(`[${right}]`)} ` : "") + left;
1459
- line += characterFormat(additional.length > 0 ? "\n" + additional.join("\n") : "");
1460
- if (logObj.type === "trace") {
1461
- const _err = new Error("Trace: " + logObj.message);
1462
- line += this.formatStack(_err.stack || "");
1463
- }
1464
- return isBadge ? "\n" + line + "\n" : line;
1465
- }
1466
- }
1467
- var detectProvider, toBoolean, ansiRegex2, stripAnsi2, getDefaultExportFromCjs, stringWidth$1, isUnicodeSupported, stringWidth, characterFormat, getColor2, getBgColor, createConsola2, _getDefaultLogLevel, providers, processShim, envShim, providerInfo, nodeENV, isCI2, hasTTY, isDebug, isTest, regex, eastasianwidth, eastasianwidthExports, eastAsianWidth, emojiRegex, TYPE_COLOR_MAP, LEVEL_COLOR_MAP, unicode2, s2, TYPE_ICONS, consola;
1468
- var init_consola_36c0034f = __esm(() => {
1469
- init_core();
1470
- init_consola_06ad8a64();
1471
- init_utils();
1472
- detectProvider = function(env2) {
1473
- for (const provider of providers) {
1474
- const envName = provider[1] || provider[0];
1475
- if (env2[envName]) {
1476
- return {
1477
- name: provider[0].toLowerCase(),
1478
- ...provider[2]
1479
- };
1480
- }
1481
- }
1482
- if (env2.SHELL && env2.SHELL === "/bin/jsh") {
1483
- return {
1484
- name: "stackblitz",
1485
- ci: false
1486
- };
1487
- }
1488
- return {
1489
- name: "",
1490
- ci: false
1491
- };
1492
- };
1493
- toBoolean = function(val) {
1494
- return val ? val !== "false" : false;
1495
- };
1496
- ansiRegex2 = function({ onlyFirst = false } = {}) {
1497
- const pattern = [
1498
- "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
1499
- "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
1500
- ].join("|");
1501
- return new RegExp(pattern, onlyFirst ? undefined : "g");
1502
- };
1503
- stripAnsi2 = function(string) {
1504
- if (typeof string !== "string") {
1505
- throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
1506
- }
1507
- return string.replace(regex, "");
1508
- };
1509
- getDefaultExportFromCjs = function(x) {
1510
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
1511
- };
1512
- stringWidth$1 = function(string, options) {
1513
- if (typeof string !== "string" || string.length === 0) {
1514
- return 0;
1515
- }
1516
- options = {
1517
- ambiguousIsNarrow: true,
1518
- countAnsiEscapeCodes: false,
1519
- ...options
1520
- };
1521
- if (!options.countAnsiEscapeCodes) {
1522
- string = stripAnsi2(string);
1523
- }
1524
- if (string.length === 0) {
1525
- return 0;
1526
- }
1527
- const ambiguousCharacterWidth = options.ambiguousIsNarrow ? 1 : 2;
1528
- let width = 0;
1529
- for (const { segment: character } of new Intl.Segmenter().segment(string)) {
1530
- const codePoint = character.codePointAt(0);
1531
- if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) {
1532
- continue;
1533
- }
1534
- if (codePoint >= 768 && codePoint <= 879) {
1535
- continue;
1536
- }
1537
- if (emojiRegex().test(character)) {
1538
- width += 2;
1539
- continue;
1540
- }
1541
- const code = eastAsianWidth.eastAsianWidth(character);
1542
- switch (code) {
1543
- case "F":
1544
- case "W": {
1545
- width += 2;
1546
- break;
1547
- }
1548
- case "A": {
1549
- width += ambiguousCharacterWidth;
1550
- break;
1551
- }
1552
- default: {
1553
- width += 1;
1554
- }
1555
- }
1556
- }
1557
- return width;
1558
- };
1559
- isUnicodeSupported = function() {
1560
- if (process$1.platform !== "win32") {
1561
- return process$1.env.TERM !== "linux";
1562
- }
1563
- return Boolean(process$1.env.CI) || Boolean(process$1.env.WT_SESSION) || Boolean(process$1.env.TERMINUS_SUBLIME) || process$1.env.ConEmuTask === "{cmd::Cmder}" || process$1.env.TERM_PROGRAM === "Terminus-Sublime" || process$1.env.TERM_PROGRAM === "vscode" || process$1.env.TERM === "xterm-256color" || process$1.env.TERM === "alacritty" || process$1.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
1564
- };
1565
- stringWidth = function(str) {
1566
- if (!Intl.Segmenter) {
1567
- return stripAnsi(str).length;
1568
- }
1569
- return stringWidth$1(str);
1570
- };
1571
- characterFormat = function(str) {
1572
- return str.replace(/`([^`]+)`/gm, (_2, m2) => colors.cyan(m2)).replace(/\s+_([^_]+)_\s+/gm, (_2, m2) => ` ${colors.underline(m2)} `);
1573
- };
1574
- getColor2 = function(color = "white") {
1575
- return colors[color] || colors.white;
1576
- };
1577
- getBgColor = function(color = "bgWhite") {
1578
- return colors[`bg${color[0].toUpperCase()}${color.slice(1)}`] || colors.bgWhite;
1579
- };
1580
- createConsola2 = function(options = {}) {
1581
- let level = _getDefaultLogLevel();
1582
- if (process.env.CONSOLA_LEVEL) {
1583
- level = Number.parseInt(process.env.CONSOLA_LEVEL) ?? level;
1584
- }
1585
- const consola2 = createConsola({
1586
- level,
1587
- defaults: { level },
1588
- stdout: process.stdout,
1589
- stderr: process.stderr,
1590
- prompt: (...args) => Promise.resolve().then(() => (init_prompt(), exports_prompt)).then((m2) => m2.prompt(...args)),
1591
- reporters: options.reporters || [
1592
- options.fancy ?? !(isCI2 || isTest) ? new FancyReporter : new BasicReporter
1593
- ],
1594
- ...options
1595
- });
1596
- return consola2;
1597
- };
1598
- _getDefaultLogLevel = function() {
1599
- if (isDebug) {
1600
- return LogLevels.debug;
1601
- }
1602
- if (isTest) {
1603
- return LogLevels.warn;
1604
- }
1605
- return LogLevels.info;
1606
- };
1607
- providers = [
1608
- ["APPVEYOR"],
1609
- ["AZURE_PIPELINES", "SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],
1610
- ["AZURE_STATIC", "INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],
1611
- ["APPCIRCLE", "AC_APPCIRCLE"],
1612
- ["BAMBOO", "bamboo_planKey"],
1613
- ["BITBUCKET", "BITBUCKET_COMMIT"],
1614
- ["BITRISE", "BITRISE_IO"],
1615
- ["BUDDY", "BUDDY_WORKSPACE_ID"],
1616
- ["BUILDKITE"],
1617
- ["CIRCLE", "CIRCLECI"],
1618
- ["CIRRUS", "CIRRUS_CI"],
1619
- ["CLOUDFLARE_PAGES", "CF_PAGES", { ci: true }],
1620
- ["CODEBUILD", "CODEBUILD_BUILD_ARN"],
1621
- ["CODEFRESH", "CF_BUILD_ID"],
1622
- ["DRONE"],
1623
- ["DRONE", "DRONE_BUILD_EVENT"],
1624
- ["DSARI"],
1625
- ["GITHUB_ACTIONS"],
1626
- ["GITLAB", "GITLAB_CI"],
1627
- ["GITLAB", "CI_MERGE_REQUEST_ID"],
1628
- ["GOCD", "GO_PIPELINE_LABEL"],
1629
- ["LAYERCI"],
1630
- ["HUDSON", "HUDSON_URL"],
1631
- ["JENKINS", "JENKINS_URL"],
1632
- ["MAGNUM"],
1633
- ["NETLIFY"],
1634
- ["NETLIFY", "NETLIFY_LOCAL", { ci: false }],
1635
- ["NEVERCODE"],
1636
- ["RENDER"],
1637
- ["SAIL", "SAILCI"],
1638
- ["SEMAPHORE"],
1639
- ["SCREWDRIVER"],
1640
- ["SHIPPABLE"],
1641
- ["SOLANO", "TDDIUM"],
1642
- ["STRIDER"],
1643
- ["TEAMCITY", "TEAMCITY_VERSION"],
1644
- ["TRAVIS"],
1645
- ["VERCEL", "NOW_BUILDER"],
1646
- ["APPCENTER", "APPCENTER_BUILD_ID"],
1647
- ["CODESANDBOX", "CODESANDBOX_SSE", { ci: false }],
1648
- ["STACKBLITZ"],
1649
- ["STORMKIT"],
1650
- ["CLEAVR"]
1651
- ];
1652
- processShim = typeof process !== "undefined" ? process : {};
1653
- envShim = processShim.env || {};
1654
- providerInfo = detectProvider(envShim);
1655
- nodeENV = typeof process !== "undefined" && process.env && "development" || "";
1656
- processShim.platform;
1657
- providerInfo.name;
1658
- isCI2 = toBoolean(envShim.CI) || providerInfo.ci !== false;
1659
- hasTTY = toBoolean(processShim.stdout && processShim.stdout.isTTY);
1660
- isDebug = toBoolean(envShim.DEBUG);
1661
- isTest = nodeENV === "test" || toBoolean(envShim.TEST);
1662
- toBoolean(envShim.MINIMAL);
1663
- regex = ansiRegex2();
1664
- eastasianwidth = { exports: {} };
1665
- (function(module) {
1666
- var eaw = {};
1667
- {
1668
- module.exports = eaw;
1669
- }
1670
- eaw.eastAsianWidth = function(character) {
1671
- var x = character.charCodeAt(0);
1672
- var y = character.length == 2 ? character.charCodeAt(1) : 0;
1673
- var codePoint = x;
1674
- if (55296 <= x && x <= 56319 && (56320 <= y && y <= 57343)) {
1675
- x &= 1023;
1676
- y &= 1023;
1677
- codePoint = x << 10 | y;
1678
- codePoint += 65536;
1679
- }
1680
- if (codePoint == 12288 || 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510) {
1681
- return "F";
1682
- }
1683
- if (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) {
1684
- return "H";
1685
- }
1686
- if (4352 <= codePoint && codePoint <= 4447 || 4515 <= codePoint && codePoint <= 4519 || 4602 <= codePoint && codePoint <= 4607 || 9001 <= codePoint && codePoint <= 9002 || 11904 <= codePoint && codePoint <= 11929 || 11931 <= codePoint && codePoint <= 12019 || 12032 <= codePoint && codePoint <= 12245 || 12272 <= codePoint && codePoint <= 12283 || 12289 <= codePoint && codePoint <= 12350 || 12353 <= codePoint && codePoint <= 12438 || 12441 <= codePoint && codePoint <= 12543 || 12549 <= codePoint && codePoint <= 12589 || 12593 <= codePoint && codePoint <= 12686 || 12688 <= codePoint && codePoint <= 12730 || 12736 <= codePoint && codePoint <= 12771 || 12784 <= codePoint && codePoint <= 12830 || 12832 <= codePoint && codePoint <= 12871 || 12880 <= codePoint && codePoint <= 13054 || 13056 <= codePoint && codePoint <= 19903 || 19968 <= codePoint && codePoint <= 42124 || 42128 <= codePoint && codePoint <= 42182 || 43360 <= codePoint && codePoint <= 43388 || 44032 <= codePoint && codePoint <= 55203 || 55216 <= codePoint && codePoint <= 55238 || 55243 <= codePoint && codePoint <= 55291 || 63744 <= codePoint && codePoint <= 64255 || 65040 <= codePoint && codePoint <= 65049 || 65072 <= codePoint && codePoint <= 65106 || 65108 <= codePoint && codePoint <= 65126 || 65128 <= codePoint && codePoint <= 65131 || 110592 <= codePoint && codePoint <= 110593 || 127488 <= codePoint && codePoint <= 127490 || 127504 <= codePoint && codePoint <= 127546 || 127552 <= codePoint && codePoint <= 127560 || 127568 <= codePoint && codePoint <= 127569 || 131072 <= codePoint && codePoint <= 194367 || 177984 <= codePoint && codePoint <= 196605 || 196608 <= codePoint && codePoint <= 262141) {
1687
- return "W";
1688
- }
1689
- if (32 <= codePoint && codePoint <= 126 || 162 <= codePoint && codePoint <= 163 || 165 <= codePoint && codePoint <= 166 || codePoint == 172 || codePoint == 175 || 10214 <= codePoint && codePoint <= 10221 || 10629 <= codePoint && codePoint <= 10630) {
1690
- return "Na";
1691
- }
1692
- if (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) {
1693
- return "A";
1694
- }
1695
- return "N";
1696
- };
1697
- eaw.characterLength = function(character) {
1698
- var code = this.eastAsianWidth(character);
1699
- if (code == "F" || code == "W" || code == "A") {
1700
- return 2;
1701
- } else {
1702
- return 1;
1703
- }
1704
- };
1705
- function stringToArray(string) {
1706
- return string.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
1707
- }
1708
- eaw.length = function(string) {
1709
- var characters = stringToArray(string);
1710
- var len = 0;
1711
- for (var i = 0;i < characters.length; i++) {
1712
- len = len + this.characterLength(characters[i]);
1713
- }
1714
- return len;
1715
- };
1716
- eaw.slice = function(text2, start, end) {
1717
- textLen = eaw.length(text2);
1718
- start = start ? start : 0;
1719
- end = end ? end : 1;
1720
- if (start < 0) {
1721
- start = textLen + start;
1722
- }
1723
- if (end < 0) {
1724
- end = textLen + end;
1725
- }
1726
- var result = "";
1727
- var eawLen = 0;
1728
- var chars = stringToArray(text2);
1729
- for (var i = 0;i < chars.length; i++) {
1730
- var char = chars[i];
1731
- var charLen = eaw.length(char);
1732
- if (eawLen >= start - (charLen == 2 ? 1 : 0)) {
1733
- if (eawLen + charLen <= end) {
1734
- result += char;
1735
- } else {
1736
- break;
1737
- }
1738
- }
1739
- eawLen += charLen;
1740
- }
1741
- return result;
1742
- };
1743
- })(eastasianwidth);
1744
- eastasianwidthExports = eastasianwidth.exports;
1745
- eastAsianWidth = getDefaultExportFromCjs(eastasianwidthExports);
1746
- emojiRegex = () => {
1747
- return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC3\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC08\uDC26](?:\u200D\u2B1B)?|[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
1748
- };
1749
- TYPE_COLOR_MAP = {
1750
- info: "cyan",
1751
- fail: "red",
1752
- success: "green",
1753
- ready: "green",
1754
- start: "magenta"
1755
- };
1756
- LEVEL_COLOR_MAP = {
1757
- 0: "red",
1758
- 1: "yellow"
1759
- };
1760
- unicode2 = isUnicodeSupported();
1761
- s2 = (c2, fallback) => unicode2 ? c2 : fallback;
1762
- TYPE_ICONS = {
1763
- error: s2("\u2716", "\xD7"),
1764
- fatal: s2("\u2716", "\xD7"),
1765
- ready: s2("\u2714", "\u221A"),
1766
- warn: s2("\u26A0", "\u203C"),
1767
- info: s2("\u2139", "i"),
1768
- success: s2("\u2714", "\u221A"),
1769
- debug: s2("\u2699", "D"),
1770
- trace: s2("\u2192", "\u2192"),
1771
- fail: s2("\u2716", "\xD7"),
1772
- start: s2("\u25D0", "o"),
1773
- log: ""
1774
- };
1775
- consola = createConsola2();
1776
- });
1777
-
1778
2
  // src/base.ts
1779
3
  import {toString} from "@stacksjs/strings";
1780
4
  async function loop(times, callback) {
@@ -1782,24 +6,18 @@ async function loop(times, callback) {
1782
6
  }
1783
7
  // src/clean.ts
1784
8
  import {path as p} from "@stacksjs/path";
1785
-
1786
- // src/delete.ts
1787
- import {rimraf} from "rimraf";
1788
-
1789
- // src/clean.ts
9
+ var {$ } = globalThis.Bun;
1790
10
  async function cleanProject() {
1791
- return await rimraf([
1792
- p.projectPath("bun.lockb"),
1793
- p.projectPath("yarn.lock"),
1794
- p.projectPath("node_modules/"),
1795
- p.frameworkPath("dist"),
1796
- p.frameworkPath("node_modules"),
1797
- p.frameworkPath("**/dist"),
1798
- p.frameworkPath("**/node_modules"),
1799
- p.frameworkCloudPath("cdk.out/"),
1800
- p.frameworkCloudPath("cdk.context.json"),
1801
- p.frameworkCloudPath("dist.zip")
1802
- ]);
11
+ await $`rm -rf ${p.projectPath("bun.lockb")}`;
12
+ await $`rm -rf ${p.projectPath("yarn.lock")}`;
13
+ await $`rm -rf ${p.projectPath("node_modules/")}`;
14
+ await $`rm -rf ${p.frameworkPath("dist")}`;
15
+ await $`rm -rf ${p.frameworkPath("node_modules")}`;
16
+ await $`rm -rf ${p.frameworkPath("**/dist")}`;
17
+ await $`rm -rf ${p.frameworkPath("**/node_modules")}`;
18
+ await $`rm -rf ${p.frameworkCloudPath("cdk.out/")}`;
19
+ await $`rm -rf ${p.frameworkCloudPath("cdk.context.json")}`;
20
+ await $`rm -rf ${p.frameworkCloudPath("dist.zip")}`;
1803
21
  }
1804
22
  // src/config.ts
1805
23
  import {
@@ -1887,154 +105,70 @@ import {getExportsSize} from "export-size";
1887
105
  // src/find.ts
1888
106
  import os from "os";
1889
107
  import fs from "fs/promises";
1890
- import path3 from "path";
108
+ import path2 from "path";
1891
109
  import {italic} from "@stacksjs/cli";
1892
-
1893
- // ../logging/src/index.ts
1894
- import process2 from "process";
1895
-
1896
- // ../../../../node_modules/consola/dist/index.mjs
1897
- init_consola_36c0034f();
1898
- init_core();
1899
- init_consola_06ad8a64();
1900
- init_utils();
1901
-
1902
- // ../logging/src/index.ts
1903
- import {ExitCode} from "@stacksjs/types";
1904
- import {logger as logConfig} from "@stacksjs/config";
1905
- import {logsPath} from "@stacksjs/path";
1906
- import {handleError} from "@stacksjs/error-handling";
1907
- import {buddyOptions, prompt as getPrompt} from "@stacksjs/cli";
1908
- function logLevel() {
1909
- const verboseRegex = /--verbose(?!(\s*=\s*false|\s+false))(\s+|=true)?($|\s)/;
1910
- if (verboseRegex.test(buddyOptions().trim()))
1911
- return 4;
1912
- return logConfig.level;
1913
- }
1914
- async function writeToLogFile(message) {
1915
- const formattedMessage = `[${new Date().toISOString()}] ${message}\n`;
1916
- try {
1917
- const file = Bun.file(logFilePath);
1918
- const writer = file.writer();
1919
- const text2 = await file.text();
1920
- writer.write(`${text2}\n`);
1921
- writer.write(`${formattedMessage}\n`);
1922
- await writer.end();
1923
- } catch (error) {
1924
- const file = Bun.file(logFilePath);
1925
- const writer = file.writer();
1926
- writer.write(`${formattedMessage}\n`);
1927
- await writer.end();
1928
- }
1929
- }
1930
- function dump(...args) {
1931
- args.forEach((arg) => log2.debug(arg));
1932
- }
1933
- function dd(...args) {
1934
- args.forEach((arg) => log2.debug(arg));
1935
- process2.exit(ExitCode.FatalError);
1936
- }
1937
- function echo(...args) {
1938
- console.log(...args);
1939
- }
1940
- var logger = createConsola2({
1941
- level: logLevel()
1942
- });
1943
- var logFilePath = logsPath("console.log");
1944
- var log2 = {
1945
- async info(...arg) {
1946
- logger.info(...arg);
1947
- await writeToLogFile(`INFO: ${arg}`);
1948
- },
1949
- async success(msg) {
1950
- logger.success(msg);
1951
- await writeToLogFile(`SUCCESS: ${msg}`);
1952
- },
1953
- async error(err, options) {
1954
- handleError(err, options);
1955
- await writeToLogFile(`ERROR: ${err}`);
1956
- },
1957
- async warn(arg) {
1958
- logger.warn(arg);
1959
- await writeToLogFile(`WARN: ${arg}`);
1960
- },
1961
- async debug(...arg) {
1962
- if (process2.env.APP_ENV === "production" || process2.env.APP_ENV === "prod")
1963
- return await writeToLogFile(`DEBUG: ${arg}`);
1964
- logger.debug(arg);
1965
- await writeToLogFile(`DEBUG: ${arg}`);
1966
- },
1967
- async start(...arg) {
1968
- logger.start(arg);
1969
- await writeToLogFile(`START: ${arg}`);
1970
- },
1971
- box: logger.box,
1972
- get prompt() {
1973
- return getPrompt();
1974
- },
1975
- dump,
1976
- dd,
1977
- echo
1978
- };
1979
-
1980
- // src/find.ts
110
+ import {log as log2} from "@stacksjs/logging";
1981
111
  async function findStacksProjects(dir, options) {
1982
112
  dir = dir || os.homedir();
1983
113
  if (!options?.quiet) {
1984
- log2.info(`This may take a few moments, searching for Stacks projects in: ${italic(dir)}`);
114
+ log2.info(`Searching for Stacks projects in: ${italic(dir)}`);
115
+ log2.info(`This may take a few moments...`);
1985
116
  console.log("");
1986
117
  console.log(italic(" Please note, while Stacks is searching for projects on your machine,"));
1987
118
  console.log(italic(" you may be asked for permissions to scan certain directories."));
1988
119
  console.log("");
1989
120
  log2.debug(`Excluding directories: ${excludePatterns.join(", ")}`);
1990
121
  }
122
+ const foundProjects = await searchDirectory(dir);
123
+ if (!foundProjects)
124
+ throw new Error("No Stacks projects found");
125
+ return foundProjects;
126
+ }
127
+ async function searchDirectory(directory) {
1991
128
  const foundProjects = [];
1992
- async function searchDirectory(directory) {
1993
- if (path3.basename(directory).startsWith("."))
1994
- return;
1995
- const isExcluded = excludePatterns.some((pattern) => typeof pattern === "string" ? directory.includes(pattern) : pattern.test(directory));
1996
- if (isExcluded)
1997
- return;
1998
- let items;
1999
- try {
2000
- items = await fs.readdir(directory, { withFileTypes: true });
2001
- } catch (error) {
2002
- console.error(`Error reading directory ${directory}:`, error);
2003
- return;
2004
- }
2005
- let buddyFileFound = false;
2006
- let storageDirFound = false;
2007
- for (const item of items) {
2008
- if (item.isFile() && item.name === targetFileName) {
2009
- buddyFileFound = true;
2010
- } else if (item.isDirectory()) {
2011
- const fullPath = path3.join(directory, item.name);
2012
- if (item.name === "storage") {
2013
- try {
2014
- const storagePath = path3.join(fullPath, "framework/core/buddy");
2015
- await fs.access(storagePath);
2016
- storageDirFound = true;
2017
- } catch (error) {
2018
- }
129
+ const isExcluded = excludePatterns.some((pattern) => typeof pattern === "string" ? directory.includes(pattern) : pattern.test(directory));
130
+ if (isExcluded)
131
+ return;
132
+ let items;
133
+ try {
134
+ items = await fs.readdir(directory, { withFileTypes: true });
135
+ } catch (error) {
136
+ console.error(`Error reading directory ${directory}:`, error);
137
+ return;
138
+ }
139
+ let buddyFileFound = false;
140
+ let storageDirFound = false;
141
+ for (const item of items) {
142
+ if (item.isFile() && item.name === targetFileName) {
143
+ buddyFileFound = true;
144
+ } else if (item.isDirectory()) {
145
+ const fullPath = path2.join(directory, item.name);
146
+ if (item.name === "storage") {
147
+ try {
148
+ const storagePath = path2.join(fullPath, "framework/core/buddy");
149
+ await fs.access(storagePath);
150
+ storageDirFound = true;
151
+ } catch (error) {
2019
152
  }
2020
- await searchDirectory(fullPath);
2021
153
  }
154
+ await searchDirectory(fullPath);
2022
155
  }
2023
- if (buddyFileFound && storageDirFound)
2024
- foundProjects.push(directory);
2025
156
  }
2026
- await searchDirectory(dir);
157
+ if (buddyFileFound && storageDirFound)
158
+ foundProjects.push(directory);
2027
159
  return foundProjects;
2028
160
  }
2029
161
  var targetFileName = "buddy";
2030
162
  var excludePatterns = [
2031
163
  "node_modules",
2032
164
  "dist",
2033
- /.*out.*/,
165
+ "vendor",
2034
166
  `${os.homedir()}/Documents`,
2035
167
  `${os.homedir()}/Pictures`,
2036
168
  `${os.homedir()}/Library`,
2037
- `${os.homedir()}/.Trash`
169
+ `${os.homedir()}/.Trash`,
170
+ /.*out.*|.*\.out.*|out-.*/,
171
+ /.*\/\..*/
2038
172
  ];
2039
173
  // src/function.ts
2040
174
  function batchInvoke(functions) {
@@ -2055,25 +189,25 @@ function isGitClean() {
2055
189
  }
2056
190
  }
2057
191
  // src/guards.ts
2058
- function notNullish(v2) {
2059
- return v2 != null;
192
+ function notNullish(v) {
193
+ return v != null;
2060
194
  }
2061
- function noNull(v2) {
2062
- return v2 !== null;
195
+ function noNull(v) {
196
+ return v !== null;
2063
197
  }
2064
- function notUndefined(v2) {
2065
- return v2 !== undefined;
198
+ function notUndefined(v) {
199
+ return v !== undefined;
2066
200
  }
2067
- function isTruthy(v2) {
2068
- return Boolean(v2);
201
+ function isTruthy(v) {
202
+ return Boolean(v);
2069
203
  }
2070
204
  // src/hash.ts
2071
205
  import {hashPaths} from "@stacksjs/storage";
2072
- import {path as p3} from "@stacksjs/path";
2073
- import {config as config3} from "@stacksjs/config";
206
+ import {path as p2} from "@stacksjs/path";
207
+ import {config as config2} from "@stacksjs/config";
2074
208
  function originRequestFunctionHash() {
2075
209
  try {
2076
- return hashPaths(p3.cloudPath("src/edge"));
210
+ return hashPaths(p2.cloudPath("src/edge"));
2077
211
  } catch (error) {
2078
212
  log.error("Are we in a Docker container? Failed to hash paths. Error below:");
2079
213
  log.error(error);
@@ -2081,16 +215,16 @@ function originRequestFunctionHash() {
2081
215
  }
2082
216
  }
2083
217
  var docsSrc = [
2084
- p3.projectPath("docs"),
2085
- p3.projectPath("config/docs.ts")
218
+ p2.projectPath("docs"),
219
+ p2.projectPath("config/docs.ts")
2086
220
  ];
2087
221
  var websiteSrc = [
2088
- p3.projectPath("resources/views")
222
+ p2.projectPath("resources/views")
2089
223
  ];
2090
- var websiteSourceHash = config3.app.docMode === true ? hashPaths(docsSrc) : hashPaths(websiteSrc);
224
+ var websiteSourceHash = config2.app.docMode === true ? hashPaths(docsSrc) : hashPaths(websiteSrc);
2091
225
  // src/helpers.ts
2092
226
  import {log as log3, runCommand} from "@stacksjs/cli";
2093
- import {err, handleError as handleError2, ok} from "@stacksjs/error-handling";
227
+ import {err, handleError, ok} from "@stacksjs/error-handling";
2094
228
  import {frameworkPath, projectPath} from "@stacksjs/path";
2095
229
  import * as storage2 from "@stacksjs/storage";
2096
230
  import {Action} from "@stacksjs/enums";
@@ -2104,10 +238,10 @@ async function initProject() {
2104
238
  if (app.env !== "production")
2105
239
  log3.info("Project not yet initialized, generating application key...");
2106
240
  else
2107
- handleError2("Please run `buddy key:generate` to generate an application key");
241
+ handleError("Please run `buddy key:generate` to generate an application key");
2108
242
  const result = await runAction(Action.KeyGenerate, { cwd: projectPath() });
2109
243
  if (result.isErr())
2110
- return err(handleError2(result.error));
244
+ return err(handleError(result.error));
2111
245
  log3.info("Application key generated.");
2112
246
  return ok(result.value);
2113
247
  }
@@ -2126,8 +260,8 @@ async function frameworkVersion() {
2126
260
  return (await storage2.readPackageJson(frameworkPath("package.json"))).version;
2127
261
  }
2128
262
  async function isAppKeySet() {
2129
- const env2 = await storage2.readTextFile(".env", projectPath());
2130
- const lines = env2.data.split("\n");
263
+ const env = await storage2.readTextFile(".env", projectPath());
264
+ const lines = env.data.split("\n");
2131
265
  const appKey = lines.find((line) => line.startsWith("APP_KEY="));
2132
266
  return !!(appKey && appKey.length > 16);
2133
267
  }
@@ -2164,7 +298,7 @@ async function runNpmScript(script, options) {
2164
298
  const { data: manifest } = await storage2.readJsonFile("package.json", frameworkPath());
2165
299
  if (isManifest(manifest) && hasScript(manifest, script))
2166
300
  return await runCommand(`bun --bun run ${script}`, options);
2167
- return err(handleError2(`The ${script} script does not exist in the package.json file.`));
301
+ return err(handleError(`The ${script} script does not exist in the package.json file.`));
2168
302
  }
2169
303
  function hasScript(manifest, script) {
2170
304
  const scripts = manifest.scripts;
@@ -2183,7 +317,7 @@ function determineDebugLevel(options) {
2183
317
  function isIpv6(address) {
2184
318
  return address.family === "IPv6" || address.family === 6;
2185
319
  }
2186
- import {dump as dump2, load} from "js-yaml";
320
+ import {dump, load} from "js-yaml";
2187
321
  // src/macroable.ts
2188
322
  import {Macroable} from "macroable";
2189
323
  // src/math.ts
@@ -2216,7 +350,7 @@ useTrunc
2216
350
  var clamp = (n, min, max) => Math.min(max, Math.max(min, n));
2217
351
  // src/p.ts
2218
352
  import pLimit from "p-limit";
2219
- function p4(items, options) {
353
+ function p3(items, options) {
2220
354
  return new PInstance(items, options);
2221
355
  }
2222
356
  var VOID = Symbol("p-void");
@@ -2230,11 +364,11 @@ class PInstance extends Promise {
2230
364
  const items = [...Array.from(this.items), ...Array.from(this.promises)];
2231
365
  if (this.options?.concurrency) {
2232
366
  const limit = pLimit(this.options.concurrency);
2233
- batch = Promise.all(items.map((p5) => limit(() => p5)));
367
+ batch = Promise.all(items.map((p4) => limit(() => p4)));
2234
368
  } else {
2235
369
  batch = Promise.all(items);
2236
370
  }
2237
- return batch.then((l2) => l2.filter((i) => i !== VOID));
371
+ return batch.then((l) => l.filter((i) => i !== VOID));
2238
372
  }
2239
373
  constructor(items = [], options) {
2240
374
  super(() => {
@@ -2249,19 +383,19 @@ class PInstance extends Promise {
2249
383
  }
2250
384
  map(fn) {
2251
385
  return new PInstance(Array.from(this.items).map(async (i, idx) => {
2252
- const v2 = await i;
2253
- if (v2 === VOID)
386
+ const v = await i;
387
+ if (v === VOID)
2254
388
  return VOID;
2255
- return fn(v2, idx);
389
+ return fn(v, idx);
2256
390
  }), this.options);
2257
391
  }
2258
392
  filter(fn) {
2259
393
  return new PInstance(Array.from(this.items).map(async (i, idx) => {
2260
- const v2 = await i;
2261
- const r2 = await fn(v2, idx);
2262
- if (!r2)
394
+ const v = await i;
395
+ const r = await fn(v, idx);
396
+ if (!r)
2263
397
  return VOID;
2264
- return v2;
398
+ return v;
2265
399
  }), this.options);
2266
400
  }
2267
401
  forEach(fn) {
@@ -2274,10 +408,10 @@ class PInstance extends Promise {
2274
408
  this.promises.clear();
2275
409
  }
2276
410
  then(fn) {
2277
- const p5 = this.promise;
411
+ const p4 = this.promise;
2278
412
  if (fn)
2279
- return p5.then(fn);
2280
- return p5;
413
+ return p4.then(fn);
414
+ return p4;
2281
415
  }
2282
416
  catch(fn) {
2283
417
  return this.promise.catch(fn);
@@ -2307,12 +441,12 @@ function createPromiseLock() {
2307
441
  const locks = [];
2308
442
  return {
2309
443
  async run(fn) {
2310
- const p5 = fn();
2311
- locks.push(p5);
444
+ const p4 = fn();
445
+ locks.push(p4);
2312
446
  try {
2313
- return await p5;
447
+ return await p4;
2314
448
  } finally {
2315
- remove(locks, p5);
449
+ remove(locks, p4);
2316
450
  }
2317
451
  },
2318
452
  async wait() {
@@ -2336,89 +470,8 @@ function createControlledPromise() {
2336
470
  promise.reject = reject;
2337
471
  return promise;
2338
472
  }
2339
- // ../../../../node_modules/magic-regexp/dist/shared/magic-regexp.b7c910ac.mjs
2340
- var NO_WRAP_RE = /^(\(.*\)|\\?.)$/;
2341
- var wrap = (s3) => {
2342
- const v2 = s3.toString();
2343
- return NO_WRAP_RE.test(v2) ? v2 : `(?:${v2})`;
2344
- };
2345
- var GROUPED_AS_REPLACE_RE = /^(?:\(\?:(.+)\)|(\(?.+\)?))$/;
2346
- var GROUPED_REPLACE_RE = /^(?:\(\?:(.+)\)([?+*]|{[\d,]+})?|(.+))$/;
2347
- var createInput = (s3) => {
2348
- const groupedAsFn = (key) => createInput(`(?<${key}>${`${s3}`.replace(GROUPED_AS_REPLACE_RE, "$1$2")})`);
2349
- return {
2350
- toString: () => s3.toString(),
2351
- and: Object.assign((...inputs) => createInput(`${s3}${exactly(...inputs)}`), {
2352
- referenceTo: (groupName) => createInput(`${s3}\\k<${groupName}>`)
2353
- }),
2354
- or: (...inputs) => createInput(`(?:${s3}|${exactly(...inputs)})`),
2355
- after: (...input) => createInput(`(?<=${exactly(...input)})${s3}`),
2356
- before: (...input) => createInput(`${s3}(?=${exactly(...input)})`),
2357
- notAfter: (...input) => createInput(`(?<!${exactly(...input)})${s3}`),
2358
- notBefore: (...input) => createInput(`${s3}(?!${exactly(...input)})`),
2359
- times: Object.assign((number) => createInput(`${wrap(s3)}{${number}}`), {
2360
- any: () => createInput(`${wrap(s3)}*`),
2361
- atLeast: (min) => createInput(`${wrap(s3)}{${min},}`),
2362
- atMost: (max) => createInput(`${wrap(s3)}{0,${max}}`),
2363
- between: (min, max) => createInput(`${wrap(s3)}{${min},${max}}`)
2364
- }),
2365
- optionally: () => createInput(`${wrap(s3)}?`),
2366
- as: groupedAsFn,
2367
- groupedAs: groupedAsFn,
2368
- grouped: () => createInput(`${s3}`.replace(GROUPED_REPLACE_RE, "($1$3)$2")),
2369
- at: {
2370
- lineStart: () => createInput(`^${s3}`),
2371
- lineEnd: () => createInput(`${s3}\$`)
2372
- }
2373
- };
2374
- };
2375
- var ESCAPE_REPLACE_RE = /[.*+?^${}()|[\]\\/]/g;
2376
- var charIn = (chars) => createInput(`[${chars.replace(/[-\\^\]]/g, "\\$&")}]`);
2377
- var charNotIn = (chars) => createInput(`[^${chars.replace(/[-\\^\]]/g, "\\$&")}]`);
2378
- var anyOf = (...inputs) => createInput(`(?:${inputs.map((a) => exactly(a)).join("|")})`);
2379
- var char = createInput(".");
2380
- var word = createInput("\\b\\w+\\b");
2381
- var wordChar = createInput("\\w");
2382
- var wordBoundary = createInput("\\b");
2383
- var digit = createInput("\\d");
2384
- var whitespace = createInput("\\s");
2385
- var letter = Object.assign(createInput("[a-zA-Z]"), {
2386
- lowercase: createInput("[a-z]"),
2387
- uppercase: createInput("[A-Z]")
2388
- });
2389
- var tab = createInput("\\t");
2390
- var linefeed = createInput("\\n");
2391
- var carriageReturn = createInput("\\r");
2392
- var not = {
2393
- word: createInput("\\W+"),
2394
- wordChar: createInput("\\W"),
2395
- wordBoundary: createInput("\\B"),
2396
- digit: createInput("\\D"),
2397
- whitespace: createInput("\\S"),
2398
- letter: Object.assign(createInput("[^a-zA-Z]"), {
2399
- lowercase: createInput("[^a-z]"),
2400
- uppercase: createInput("[^A-Z]")
2401
- }),
2402
- tab: createInput("[^\\t]"),
2403
- linefeed: createInput("[^\\n]"),
2404
- carriageReturn: createInput("[^\\r]")
2405
- };
2406
- var maybe = (...inputs) => createInput(`${wrap(exactly(...inputs))}?`);
2407
- var exactly = (...inputs) => createInput(inputs.map((input) => typeof input === "string" ? input.replace(ESCAPE_REPLACE_RE, "\\$&") : input).join(""));
2408
- var oneOrMore = (...inputs) => createInput(`${wrap(exactly(...inputs))}+`);
2409
- var withIndices = "d";
2410
- var caseInsensitive = "i";
2411
- var global = "g";
2412
- var multiline = "m";
2413
- var dotAll = "s";
2414
- var unicode3 = "u";
2415
- var sticky = "y";
2416
-
2417
- // ../../../../node_modules/magic-regexp/dist/index.mjs
2418
- var createRegExp = (...inputs) => {
2419
- const flags = inputs.length > 1 && (Array.isArray(inputs[inputs.length - 1]) || inputs[inputs.length - 1] instanceof Set) ? inputs.pop() : undefined;
2420
- return new RegExp(exactly(...inputs).toString(), [...flags || ""].join(""));
2421
- };
473
+ // src/regex.ts
474
+ import {createRegExp, caseInsensitive, anyOf, carriageReturn, char, charIn, charNotIn, digit, dotAll, exactly, global, letter, linefeed, maybe, multiline, not, oneOrMore, sticky, tab, unicode, whitespace, withIndices, word, wordBoundary, wordChar} from "magic-regexp";
2422
475
  // src/retry.ts
2423
476
  function retry(fn, options) {
2424
477
  const { retries = 3, initialDelay = 1000, backoffFactor = 2, jitter = true } = options;
@@ -2846,7 +899,7 @@ function prettyBytes(number, options) {
2846
899
  return prefix + numberString + separator + unit;
2847
900
  }
2848
901
  // package.json
2849
- var version = "0.58.73";
902
+ var version = "0.59.1";
2850
903
  export {
2851
904
  wordChar,
2852
905
  wordBoundary,
@@ -3037,7 +1090,7 @@ export {
3037
1090
  useAbs,
3038
1091
  until,
3039
1092
  unrefElement,
3040
- unicode3 as unicode,
1093
+ unicode,
3041
1094
  tryOnUnmounted,
3042
1095
  tryOnScopeDispose,
3043
1096
  tryOnMounted,
@@ -3063,7 +1116,6 @@ export {
3063
1116
  setSSRHandler,
3064
1117
  setEnvValue,
3065
1118
  runNpmScript,
3066
- rimraf,
3067
1119
  retry,
3068
1120
  resolveUnref,
3069
1121
  resolveRef,
@@ -3084,7 +1136,7 @@ export {
3084
1136
  pausableWatch,
3085
1137
  parseYaml,
3086
1138
  packageManager,
3087
- p4 as p,
1139
+ p3 as p,
3088
1140
  originRequestFunctionHash,
3089
1141
  or,
3090
1142
  oneOrMore,
@@ -3147,7 +1199,7 @@ export {
3147
1199
  equal,
3148
1200
  ensureProjectIsInitialized,
3149
1201
  eagerComputed,
3150
- dump2 as dumpYaml,
1202
+ dump as dumpYaml,
3151
1203
  dotAll,
3152
1204
  dinero,
3153
1205
  digit,