create-zenith 0.6.6

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/cli.js ADDED
@@ -0,0 +1,2989 @@
1
+ #!/usr/bin/env node
2
+ var __create = Object.create;
3
+ var __getProtoOf = Object.getPrototypeOf;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __toESM = (mod, isNodeMode, target) => {
8
+ target = mod != null ? __create(__getProtoOf(mod)) : {};
9
+ const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
10
+ for (let key of __getOwnPropNames(mod))
11
+ if (!__hasOwnProp.call(to, key))
12
+ __defProp(to, key, {
13
+ get: () => mod[key],
14
+ enumerable: true
15
+ });
16
+ return to;
17
+ };
18
+ var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
19
+
20
+ // node_modules/picocolors/picocolors.js
21
+ var require_picocolors = __commonJS((exports, module) => {
22
+ var p = process || {};
23
+ var argv = p.argv || [];
24
+ var env = p.env || {};
25
+ var isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
26
+ var formatter = (open, close, replace = open) => (input) => {
27
+ let string = "" + input, index = string.indexOf(close, open.length);
28
+ return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
29
+ };
30
+ var replaceClose = (string, close, replace, index) => {
31
+ let result = "", cursor = 0;
32
+ do {
33
+ result += string.substring(cursor, index) + replace;
34
+ cursor = index + close.length;
35
+ index = string.indexOf(close, cursor);
36
+ } while (~index);
37
+ return result + string.substring(cursor);
38
+ };
39
+ var createColors = (enabled = isColorSupported) => {
40
+ let f = enabled ? formatter : () => String;
41
+ return {
42
+ isColorSupported: enabled,
43
+ reset: f("\x1B[0m", "\x1B[0m"),
44
+ bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
45
+ dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
46
+ italic: f("\x1B[3m", "\x1B[23m"),
47
+ underline: f("\x1B[4m", "\x1B[24m"),
48
+ inverse: f("\x1B[7m", "\x1B[27m"),
49
+ hidden: f("\x1B[8m", "\x1B[28m"),
50
+ strikethrough: f("\x1B[9m", "\x1B[29m"),
51
+ black: f("\x1B[30m", "\x1B[39m"),
52
+ red: f("\x1B[31m", "\x1B[39m"),
53
+ green: f("\x1B[32m", "\x1B[39m"),
54
+ yellow: f("\x1B[33m", "\x1B[39m"),
55
+ blue: f("\x1B[34m", "\x1B[39m"),
56
+ magenta: f("\x1B[35m", "\x1B[39m"),
57
+ cyan: f("\x1B[36m", "\x1B[39m"),
58
+ white: f("\x1B[37m", "\x1B[39m"),
59
+ gray: f("\x1B[90m", "\x1B[39m"),
60
+ bgBlack: f("\x1B[40m", "\x1B[49m"),
61
+ bgRed: f("\x1B[41m", "\x1B[49m"),
62
+ bgGreen: f("\x1B[42m", "\x1B[49m"),
63
+ bgYellow: f("\x1B[43m", "\x1B[49m"),
64
+ bgBlue: f("\x1B[44m", "\x1B[49m"),
65
+ bgMagenta: f("\x1B[45m", "\x1B[49m"),
66
+ bgCyan: f("\x1B[46m", "\x1B[49m"),
67
+ bgWhite: f("\x1B[47m", "\x1B[49m"),
68
+ blackBright: f("\x1B[90m", "\x1B[39m"),
69
+ redBright: f("\x1B[91m", "\x1B[39m"),
70
+ greenBright: f("\x1B[92m", "\x1B[39m"),
71
+ yellowBright: f("\x1B[93m", "\x1B[39m"),
72
+ blueBright: f("\x1B[94m", "\x1B[39m"),
73
+ magentaBright: f("\x1B[95m", "\x1B[39m"),
74
+ cyanBright: f("\x1B[96m", "\x1B[39m"),
75
+ whiteBright: f("\x1B[97m", "\x1B[39m"),
76
+ bgBlackBright: f("\x1B[100m", "\x1B[49m"),
77
+ bgRedBright: f("\x1B[101m", "\x1B[49m"),
78
+ bgGreenBright: f("\x1B[102m", "\x1B[49m"),
79
+ bgYellowBright: f("\x1B[103m", "\x1B[49m"),
80
+ bgBlueBright: f("\x1B[104m", "\x1B[49m"),
81
+ bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
82
+ bgCyanBright: f("\x1B[106m", "\x1B[49m"),
83
+ bgWhiteBright: f("\x1B[107m", "\x1B[49m")
84
+ };
85
+ };
86
+ module.exports = createColors();
87
+ module.exports.createColors = createColors;
88
+ });
89
+
90
+ // node_modules/tinycolor2/cjs/tinycolor.js
91
+ var require_tinycolor = __commonJS((exports, module) => {
92
+ (function(global, factory) {
93
+ typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, global.tinycolor = factory());
94
+ })(exports, function() {
95
+ function _typeof(obj) {
96
+ "@babel/helpers - typeof";
97
+ return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(obj2) {
98
+ return typeof obj2;
99
+ } : function(obj2) {
100
+ return obj2 && typeof Symbol == "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
101
+ }, _typeof(obj);
102
+ }
103
+ var trimLeft = /^\s+/;
104
+ var trimRight = /\s+$/;
105
+ function tinycolor(color, opts) {
106
+ color = color ? color : "";
107
+ opts = opts || {};
108
+ if (color instanceof tinycolor) {
109
+ return color;
110
+ }
111
+ if (!(this instanceof tinycolor)) {
112
+ return new tinycolor(color, opts);
113
+ }
114
+ var rgb = inputToRGB(color);
115
+ this._originalInput = color, this._r = rgb.r, this._g = rgb.g, this._b = rgb.b, this._a = rgb.a, this._roundA = Math.round(100 * this._a) / 100, this._format = opts.format || rgb.format;
116
+ this._gradientType = opts.gradientType;
117
+ if (this._r < 1)
118
+ this._r = Math.round(this._r);
119
+ if (this._g < 1)
120
+ this._g = Math.round(this._g);
121
+ if (this._b < 1)
122
+ this._b = Math.round(this._b);
123
+ this._ok = rgb.ok;
124
+ }
125
+ tinycolor.prototype = {
126
+ isDark: function isDark() {
127
+ return this.getBrightness() < 128;
128
+ },
129
+ isLight: function isLight() {
130
+ return !this.isDark();
131
+ },
132
+ isValid: function isValid() {
133
+ return this._ok;
134
+ },
135
+ getOriginalInput: function getOriginalInput() {
136
+ return this._originalInput;
137
+ },
138
+ getFormat: function getFormat() {
139
+ return this._format;
140
+ },
141
+ getAlpha: function getAlpha() {
142
+ return this._a;
143
+ },
144
+ getBrightness: function getBrightness() {
145
+ var rgb = this.toRgb();
146
+ return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;
147
+ },
148
+ getLuminance: function getLuminance() {
149
+ var rgb = this.toRgb();
150
+ var RsRGB, GsRGB, BsRGB, R, G, B;
151
+ RsRGB = rgb.r / 255;
152
+ GsRGB = rgb.g / 255;
153
+ BsRGB = rgb.b / 255;
154
+ if (RsRGB <= 0.03928)
155
+ R = RsRGB / 12.92;
156
+ else
157
+ R = Math.pow((RsRGB + 0.055) / 1.055, 2.4);
158
+ if (GsRGB <= 0.03928)
159
+ G = GsRGB / 12.92;
160
+ else
161
+ G = Math.pow((GsRGB + 0.055) / 1.055, 2.4);
162
+ if (BsRGB <= 0.03928)
163
+ B = BsRGB / 12.92;
164
+ else
165
+ B = Math.pow((BsRGB + 0.055) / 1.055, 2.4);
166
+ return 0.2126 * R + 0.7152 * G + 0.0722 * B;
167
+ },
168
+ setAlpha: function setAlpha(value) {
169
+ this._a = boundAlpha(value);
170
+ this._roundA = Math.round(100 * this._a) / 100;
171
+ return this;
172
+ },
173
+ toHsv: function toHsv() {
174
+ var hsv = rgbToHsv(this._r, this._g, this._b);
175
+ return {
176
+ h: hsv.h * 360,
177
+ s: hsv.s,
178
+ v: hsv.v,
179
+ a: this._a
180
+ };
181
+ },
182
+ toHsvString: function toHsvString() {
183
+ var hsv = rgbToHsv(this._r, this._g, this._b);
184
+ var h = Math.round(hsv.h * 360), s = Math.round(hsv.s * 100), v = Math.round(hsv.v * 100);
185
+ return this._a == 1 ? "hsv(" + h + ", " + s + "%, " + v + "%)" : "hsva(" + h + ", " + s + "%, " + v + "%, " + this._roundA + ")";
186
+ },
187
+ toHsl: function toHsl() {
188
+ var hsl = rgbToHsl(this._r, this._g, this._b);
189
+ return {
190
+ h: hsl.h * 360,
191
+ s: hsl.s,
192
+ l: hsl.l,
193
+ a: this._a
194
+ };
195
+ },
196
+ toHslString: function toHslString() {
197
+ var hsl = rgbToHsl(this._r, this._g, this._b);
198
+ var h = Math.round(hsl.h * 360), s = Math.round(hsl.s * 100), l = Math.round(hsl.l * 100);
199
+ return this._a == 1 ? "hsl(" + h + ", " + s + "%, " + l + "%)" : "hsla(" + h + ", " + s + "%, " + l + "%, " + this._roundA + ")";
200
+ },
201
+ toHex: function toHex(allow3Char) {
202
+ return rgbToHex(this._r, this._g, this._b, allow3Char);
203
+ },
204
+ toHexString: function toHexString(allow3Char) {
205
+ return "#" + this.toHex(allow3Char);
206
+ },
207
+ toHex8: function toHex8(allow4Char) {
208
+ return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);
209
+ },
210
+ toHex8String: function toHex8String(allow4Char) {
211
+ return "#" + this.toHex8(allow4Char);
212
+ },
213
+ toRgb: function toRgb() {
214
+ return {
215
+ r: Math.round(this._r),
216
+ g: Math.round(this._g),
217
+ b: Math.round(this._b),
218
+ a: this._a
219
+ };
220
+ },
221
+ toRgbString: function toRgbString() {
222
+ return this._a == 1 ? "rgb(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ")" : "rgba(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ", " + this._roundA + ")";
223
+ },
224
+ toPercentageRgb: function toPercentageRgb() {
225
+ return {
226
+ r: Math.round(bound01(this._r, 255) * 100) + "%",
227
+ g: Math.round(bound01(this._g, 255) * 100) + "%",
228
+ b: Math.round(bound01(this._b, 255) * 100) + "%",
229
+ a: this._a
230
+ };
231
+ },
232
+ toPercentageRgbString: function toPercentageRgbString() {
233
+ return this._a == 1 ? "rgb(" + Math.round(bound01(this._r, 255) * 100) + "%, " + Math.round(bound01(this._g, 255) * 100) + "%, " + Math.round(bound01(this._b, 255) * 100) + "%)" : "rgba(" + Math.round(bound01(this._r, 255) * 100) + "%, " + Math.round(bound01(this._g, 255) * 100) + "%, " + Math.round(bound01(this._b, 255) * 100) + "%, " + this._roundA + ")";
234
+ },
235
+ toName: function toName() {
236
+ if (this._a === 0) {
237
+ return "transparent";
238
+ }
239
+ if (this._a < 1) {
240
+ return false;
241
+ }
242
+ return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;
243
+ },
244
+ toFilter: function toFilter(secondColor) {
245
+ var hex8String = "#" + rgbaToArgbHex(this._r, this._g, this._b, this._a);
246
+ var secondHex8String = hex8String;
247
+ var gradientType = this._gradientType ? "GradientType = 1, " : "";
248
+ if (secondColor) {
249
+ var s = tinycolor(secondColor);
250
+ secondHex8String = "#" + rgbaToArgbHex(s._r, s._g, s._b, s._a);
251
+ }
252
+ return "progid:DXImageTransform.Microsoft.gradient(" + gradientType + "startColorstr=" + hex8String + ",endColorstr=" + secondHex8String + ")";
253
+ },
254
+ toString: function toString(format) {
255
+ var formatSet = !!format;
256
+ format = format || this._format;
257
+ var formattedString = false;
258
+ var hasAlpha = this._a < 1 && this._a >= 0;
259
+ var needsAlphaFormat = !formatSet && hasAlpha && (format === "hex" || format === "hex6" || format === "hex3" || format === "hex4" || format === "hex8" || format === "name");
260
+ if (needsAlphaFormat) {
261
+ if (format === "name" && this._a === 0) {
262
+ return this.toName();
263
+ }
264
+ return this.toRgbString();
265
+ }
266
+ if (format === "rgb") {
267
+ formattedString = this.toRgbString();
268
+ }
269
+ if (format === "prgb") {
270
+ formattedString = this.toPercentageRgbString();
271
+ }
272
+ if (format === "hex" || format === "hex6") {
273
+ formattedString = this.toHexString();
274
+ }
275
+ if (format === "hex3") {
276
+ formattedString = this.toHexString(true);
277
+ }
278
+ if (format === "hex4") {
279
+ formattedString = this.toHex8String(true);
280
+ }
281
+ if (format === "hex8") {
282
+ formattedString = this.toHex8String();
283
+ }
284
+ if (format === "name") {
285
+ formattedString = this.toName();
286
+ }
287
+ if (format === "hsl") {
288
+ formattedString = this.toHslString();
289
+ }
290
+ if (format === "hsv") {
291
+ formattedString = this.toHsvString();
292
+ }
293
+ return formattedString || this.toHexString();
294
+ },
295
+ clone: function clone() {
296
+ return tinycolor(this.toString());
297
+ },
298
+ _applyModification: function _applyModification(fn, args) {
299
+ var color = fn.apply(null, [this].concat([].slice.call(args)));
300
+ this._r = color._r;
301
+ this._g = color._g;
302
+ this._b = color._b;
303
+ this.setAlpha(color._a);
304
+ return this;
305
+ },
306
+ lighten: function lighten() {
307
+ return this._applyModification(_lighten, arguments);
308
+ },
309
+ brighten: function brighten() {
310
+ return this._applyModification(_brighten, arguments);
311
+ },
312
+ darken: function darken() {
313
+ return this._applyModification(_darken, arguments);
314
+ },
315
+ desaturate: function desaturate() {
316
+ return this._applyModification(_desaturate, arguments);
317
+ },
318
+ saturate: function saturate() {
319
+ return this._applyModification(_saturate, arguments);
320
+ },
321
+ greyscale: function greyscale() {
322
+ return this._applyModification(_greyscale, arguments);
323
+ },
324
+ spin: function spin() {
325
+ return this._applyModification(_spin, arguments);
326
+ },
327
+ _applyCombination: function _applyCombination(fn, args) {
328
+ return fn.apply(null, [this].concat([].slice.call(args)));
329
+ },
330
+ analogous: function analogous() {
331
+ return this._applyCombination(_analogous, arguments);
332
+ },
333
+ complement: function complement() {
334
+ return this._applyCombination(_complement, arguments);
335
+ },
336
+ monochromatic: function monochromatic() {
337
+ return this._applyCombination(_monochromatic, arguments);
338
+ },
339
+ splitcomplement: function splitcomplement() {
340
+ return this._applyCombination(_splitcomplement, arguments);
341
+ },
342
+ triad: function triad() {
343
+ return this._applyCombination(polyad, [3]);
344
+ },
345
+ tetrad: function tetrad() {
346
+ return this._applyCombination(polyad, [4]);
347
+ }
348
+ };
349
+ tinycolor.fromRatio = function(color, opts) {
350
+ if (_typeof(color) == "object") {
351
+ var newColor = {};
352
+ for (var i in color) {
353
+ if (color.hasOwnProperty(i)) {
354
+ if (i === "a") {
355
+ newColor[i] = color[i];
356
+ } else {
357
+ newColor[i] = convertToPercentage(color[i]);
358
+ }
359
+ }
360
+ }
361
+ color = newColor;
362
+ }
363
+ return tinycolor(color, opts);
364
+ };
365
+ function inputToRGB(color) {
366
+ var rgb = {
367
+ r: 0,
368
+ g: 0,
369
+ b: 0
370
+ };
371
+ var a = 1;
372
+ var s = null;
373
+ var v = null;
374
+ var l = null;
375
+ var ok = false;
376
+ var format = false;
377
+ if (typeof color == "string") {
378
+ color = stringInputToObject(color);
379
+ }
380
+ if (_typeof(color) == "object") {
381
+ if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
382
+ rgb = rgbToRgb(color.r, color.g, color.b);
383
+ ok = true;
384
+ format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
385
+ } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
386
+ s = convertToPercentage(color.s);
387
+ v = convertToPercentage(color.v);
388
+ rgb = hsvToRgb(color.h, s, v);
389
+ ok = true;
390
+ format = "hsv";
391
+ } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
392
+ s = convertToPercentage(color.s);
393
+ l = convertToPercentage(color.l);
394
+ rgb = hslToRgb(color.h, s, l);
395
+ ok = true;
396
+ format = "hsl";
397
+ }
398
+ if (color.hasOwnProperty("a")) {
399
+ a = color.a;
400
+ }
401
+ }
402
+ a = boundAlpha(a);
403
+ return {
404
+ ok,
405
+ format: color.format || format,
406
+ r: Math.min(255, Math.max(rgb.r, 0)),
407
+ g: Math.min(255, Math.max(rgb.g, 0)),
408
+ b: Math.min(255, Math.max(rgb.b, 0)),
409
+ a
410
+ };
411
+ }
412
+ function rgbToRgb(r, g, b) {
413
+ return {
414
+ r: bound01(r, 255) * 255,
415
+ g: bound01(g, 255) * 255,
416
+ b: bound01(b, 255) * 255
417
+ };
418
+ }
419
+ function rgbToHsl(r, g, b) {
420
+ r = bound01(r, 255);
421
+ g = bound01(g, 255);
422
+ b = bound01(b, 255);
423
+ var max = Math.max(r, g, b), min = Math.min(r, g, b);
424
+ var h, s, l = (max + min) / 2;
425
+ if (max == min) {
426
+ h = s = 0;
427
+ } else {
428
+ var d = max - min;
429
+ s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
430
+ switch (max) {
431
+ case r:
432
+ h = (g - b) / d + (g < b ? 6 : 0);
433
+ break;
434
+ case g:
435
+ h = (b - r) / d + 2;
436
+ break;
437
+ case b:
438
+ h = (r - g) / d + 4;
439
+ break;
440
+ }
441
+ h /= 6;
442
+ }
443
+ return {
444
+ h,
445
+ s,
446
+ l
447
+ };
448
+ }
449
+ function hslToRgb(h, s, l) {
450
+ var r, g, b;
451
+ h = bound01(h, 360);
452
+ s = bound01(s, 100);
453
+ l = bound01(l, 100);
454
+ function hue2rgb(p2, q2, t) {
455
+ if (t < 0)
456
+ t += 1;
457
+ if (t > 1)
458
+ t -= 1;
459
+ if (t < 1 / 6)
460
+ return p2 + (q2 - p2) * 6 * t;
461
+ if (t < 1 / 2)
462
+ return q2;
463
+ if (t < 2 / 3)
464
+ return p2 + (q2 - p2) * (2 / 3 - t) * 6;
465
+ return p2;
466
+ }
467
+ if (s === 0) {
468
+ r = g = b = l;
469
+ } else {
470
+ var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
471
+ var p = 2 * l - q;
472
+ r = hue2rgb(p, q, h + 1 / 3);
473
+ g = hue2rgb(p, q, h);
474
+ b = hue2rgb(p, q, h - 1 / 3);
475
+ }
476
+ return {
477
+ r: r * 255,
478
+ g: g * 255,
479
+ b: b * 255
480
+ };
481
+ }
482
+ function rgbToHsv(r, g, b) {
483
+ r = bound01(r, 255);
484
+ g = bound01(g, 255);
485
+ b = bound01(b, 255);
486
+ var max = Math.max(r, g, b), min = Math.min(r, g, b);
487
+ var h, s, v = max;
488
+ var d = max - min;
489
+ s = max === 0 ? 0 : d / max;
490
+ if (max == min) {
491
+ h = 0;
492
+ } else {
493
+ switch (max) {
494
+ case r:
495
+ h = (g - b) / d + (g < b ? 6 : 0);
496
+ break;
497
+ case g:
498
+ h = (b - r) / d + 2;
499
+ break;
500
+ case b:
501
+ h = (r - g) / d + 4;
502
+ break;
503
+ }
504
+ h /= 6;
505
+ }
506
+ return {
507
+ h,
508
+ s,
509
+ v
510
+ };
511
+ }
512
+ function hsvToRgb(h, s, v) {
513
+ h = bound01(h, 360) * 6;
514
+ s = bound01(s, 100);
515
+ v = bound01(v, 100);
516
+ var i = Math.floor(h), f = h - i, p = v * (1 - s), q = v * (1 - f * s), t = v * (1 - (1 - f) * s), mod = i % 6, r = [v, q, p, p, t, v][mod], g = [t, v, v, q, p, p][mod], b = [p, p, t, v, v, q][mod];
517
+ return {
518
+ r: r * 255,
519
+ g: g * 255,
520
+ b: b * 255
521
+ };
522
+ }
523
+ function rgbToHex(r, g, b, allow3Char) {
524
+ var hex = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))];
525
+ if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {
526
+ return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
527
+ }
528
+ return hex.join("");
529
+ }
530
+ function rgbaToHex(r, g, b, a, allow4Char) {
531
+ var hex = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16)), pad2(convertDecimalToHex(a))];
532
+ if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {
533
+ return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
534
+ }
535
+ return hex.join("");
536
+ }
537
+ function rgbaToArgbHex(r, g, b, a) {
538
+ var hex = [pad2(convertDecimalToHex(a)), pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))];
539
+ return hex.join("");
540
+ }
541
+ tinycolor.equals = function(color1, color2) {
542
+ if (!color1 || !color2)
543
+ return false;
544
+ return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();
545
+ };
546
+ tinycolor.random = function() {
547
+ return tinycolor.fromRatio({
548
+ r: Math.random(),
549
+ g: Math.random(),
550
+ b: Math.random()
551
+ });
552
+ };
553
+ function _desaturate(color, amount) {
554
+ amount = amount === 0 ? 0 : amount || 10;
555
+ var hsl = tinycolor(color).toHsl();
556
+ hsl.s -= amount / 100;
557
+ hsl.s = clamp01(hsl.s);
558
+ return tinycolor(hsl);
559
+ }
560
+ function _saturate(color, amount) {
561
+ amount = amount === 0 ? 0 : amount || 10;
562
+ var hsl = tinycolor(color).toHsl();
563
+ hsl.s += amount / 100;
564
+ hsl.s = clamp01(hsl.s);
565
+ return tinycolor(hsl);
566
+ }
567
+ function _greyscale(color) {
568
+ return tinycolor(color).desaturate(100);
569
+ }
570
+ function _lighten(color, amount) {
571
+ amount = amount === 0 ? 0 : amount || 10;
572
+ var hsl = tinycolor(color).toHsl();
573
+ hsl.l += amount / 100;
574
+ hsl.l = clamp01(hsl.l);
575
+ return tinycolor(hsl);
576
+ }
577
+ function _brighten(color, amount) {
578
+ amount = amount === 0 ? 0 : amount || 10;
579
+ var rgb = tinycolor(color).toRgb();
580
+ rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))));
581
+ rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))));
582
+ rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))));
583
+ return tinycolor(rgb);
584
+ }
585
+ function _darken(color, amount) {
586
+ amount = amount === 0 ? 0 : amount || 10;
587
+ var hsl = tinycolor(color).toHsl();
588
+ hsl.l -= amount / 100;
589
+ hsl.l = clamp01(hsl.l);
590
+ return tinycolor(hsl);
591
+ }
592
+ function _spin(color, amount) {
593
+ var hsl = tinycolor(color).toHsl();
594
+ var hue = (hsl.h + amount) % 360;
595
+ hsl.h = hue < 0 ? 360 + hue : hue;
596
+ return tinycolor(hsl);
597
+ }
598
+ function _complement(color) {
599
+ var hsl = tinycolor(color).toHsl();
600
+ hsl.h = (hsl.h + 180) % 360;
601
+ return tinycolor(hsl);
602
+ }
603
+ function polyad(color, number) {
604
+ if (isNaN(number) || number <= 0) {
605
+ throw new Error("Argument to polyad must be a positive number");
606
+ }
607
+ var hsl = tinycolor(color).toHsl();
608
+ var result = [tinycolor(color)];
609
+ var step = 360 / number;
610
+ for (var i = 1;i < number; i++) {
611
+ result.push(tinycolor({
612
+ h: (hsl.h + i * step) % 360,
613
+ s: hsl.s,
614
+ l: hsl.l
615
+ }));
616
+ }
617
+ return result;
618
+ }
619
+ function _splitcomplement(color) {
620
+ var hsl = tinycolor(color).toHsl();
621
+ var h = hsl.h;
622
+ return [tinycolor(color), tinycolor({
623
+ h: (h + 72) % 360,
624
+ s: hsl.s,
625
+ l: hsl.l
626
+ }), tinycolor({
627
+ h: (h + 216) % 360,
628
+ s: hsl.s,
629
+ l: hsl.l
630
+ })];
631
+ }
632
+ function _analogous(color, results, slices) {
633
+ results = results || 6;
634
+ slices = slices || 30;
635
+ var hsl = tinycolor(color).toHsl();
636
+ var part = 360 / slices;
637
+ var ret = [tinycolor(color)];
638
+ for (hsl.h = (hsl.h - (part * results >> 1) + 720) % 360;--results; ) {
639
+ hsl.h = (hsl.h + part) % 360;
640
+ ret.push(tinycolor(hsl));
641
+ }
642
+ return ret;
643
+ }
644
+ function _monochromatic(color, results) {
645
+ results = results || 6;
646
+ var hsv = tinycolor(color).toHsv();
647
+ var { h, s, v } = hsv;
648
+ var ret = [];
649
+ var modification = 1 / results;
650
+ while (results--) {
651
+ ret.push(tinycolor({
652
+ h,
653
+ s,
654
+ v
655
+ }));
656
+ v = (v + modification) % 1;
657
+ }
658
+ return ret;
659
+ }
660
+ tinycolor.mix = function(color1, color2, amount) {
661
+ amount = amount === 0 ? 0 : amount || 50;
662
+ var rgb1 = tinycolor(color1).toRgb();
663
+ var rgb2 = tinycolor(color2).toRgb();
664
+ var p = amount / 100;
665
+ var rgba = {
666
+ r: (rgb2.r - rgb1.r) * p + rgb1.r,
667
+ g: (rgb2.g - rgb1.g) * p + rgb1.g,
668
+ b: (rgb2.b - rgb1.b) * p + rgb1.b,
669
+ a: (rgb2.a - rgb1.a) * p + rgb1.a
670
+ };
671
+ return tinycolor(rgba);
672
+ };
673
+ tinycolor.readability = function(color1, color2) {
674
+ var c1 = tinycolor(color1);
675
+ var c2 = tinycolor(color2);
676
+ return (Math.max(c1.getLuminance(), c2.getLuminance()) + 0.05) / (Math.min(c1.getLuminance(), c2.getLuminance()) + 0.05);
677
+ };
678
+ tinycolor.isReadable = function(color1, color2, wcag2) {
679
+ var readability = tinycolor.readability(color1, color2);
680
+ var wcag2Parms, out;
681
+ out = false;
682
+ wcag2Parms = validateWCAG2Parms(wcag2);
683
+ switch (wcag2Parms.level + wcag2Parms.size) {
684
+ case "AAsmall":
685
+ case "AAAlarge":
686
+ out = readability >= 4.5;
687
+ break;
688
+ case "AAlarge":
689
+ out = readability >= 3;
690
+ break;
691
+ case "AAAsmall":
692
+ out = readability >= 7;
693
+ break;
694
+ }
695
+ return out;
696
+ };
697
+ tinycolor.mostReadable = function(baseColor, colorList, args) {
698
+ var bestColor = null;
699
+ var bestScore = 0;
700
+ var readability;
701
+ var includeFallbackColors, level, size;
702
+ args = args || {};
703
+ includeFallbackColors = args.includeFallbackColors;
704
+ level = args.level;
705
+ size = args.size;
706
+ for (var i = 0;i < colorList.length; i++) {
707
+ readability = tinycolor.readability(baseColor, colorList[i]);
708
+ if (readability > bestScore) {
709
+ bestScore = readability;
710
+ bestColor = tinycolor(colorList[i]);
711
+ }
712
+ }
713
+ if (tinycolor.isReadable(baseColor, bestColor, {
714
+ level,
715
+ size
716
+ }) || !includeFallbackColors) {
717
+ return bestColor;
718
+ } else {
719
+ args.includeFallbackColors = false;
720
+ return tinycolor.mostReadable(baseColor, ["#fff", "#000"], args);
721
+ }
722
+ };
723
+ var names = tinycolor.names = {
724
+ aliceblue: "f0f8ff",
725
+ antiquewhite: "faebd7",
726
+ aqua: "0ff",
727
+ aquamarine: "7fffd4",
728
+ azure: "f0ffff",
729
+ beige: "f5f5dc",
730
+ bisque: "ffe4c4",
731
+ black: "000",
732
+ blanchedalmond: "ffebcd",
733
+ blue: "00f",
734
+ blueviolet: "8a2be2",
735
+ brown: "a52a2a",
736
+ burlywood: "deb887",
737
+ burntsienna: "ea7e5d",
738
+ cadetblue: "5f9ea0",
739
+ chartreuse: "7fff00",
740
+ chocolate: "d2691e",
741
+ coral: "ff7f50",
742
+ cornflowerblue: "6495ed",
743
+ cornsilk: "fff8dc",
744
+ crimson: "dc143c",
745
+ cyan: "0ff",
746
+ darkblue: "00008b",
747
+ darkcyan: "008b8b",
748
+ darkgoldenrod: "b8860b",
749
+ darkgray: "a9a9a9",
750
+ darkgreen: "006400",
751
+ darkgrey: "a9a9a9",
752
+ darkkhaki: "bdb76b",
753
+ darkmagenta: "8b008b",
754
+ darkolivegreen: "556b2f",
755
+ darkorange: "ff8c00",
756
+ darkorchid: "9932cc",
757
+ darkred: "8b0000",
758
+ darksalmon: "e9967a",
759
+ darkseagreen: "8fbc8f",
760
+ darkslateblue: "483d8b",
761
+ darkslategray: "2f4f4f",
762
+ darkslategrey: "2f4f4f",
763
+ darkturquoise: "00ced1",
764
+ darkviolet: "9400d3",
765
+ deeppink: "ff1493",
766
+ deepskyblue: "00bfff",
767
+ dimgray: "696969",
768
+ dimgrey: "696969",
769
+ dodgerblue: "1e90ff",
770
+ firebrick: "b22222",
771
+ floralwhite: "fffaf0",
772
+ forestgreen: "228b22",
773
+ fuchsia: "f0f",
774
+ gainsboro: "dcdcdc",
775
+ ghostwhite: "f8f8ff",
776
+ gold: "ffd700",
777
+ goldenrod: "daa520",
778
+ gray: "808080",
779
+ green: "008000",
780
+ greenyellow: "adff2f",
781
+ grey: "808080",
782
+ honeydew: "f0fff0",
783
+ hotpink: "ff69b4",
784
+ indianred: "cd5c5c",
785
+ indigo: "4b0082",
786
+ ivory: "fffff0",
787
+ khaki: "f0e68c",
788
+ lavender: "e6e6fa",
789
+ lavenderblush: "fff0f5",
790
+ lawngreen: "7cfc00",
791
+ lemonchiffon: "fffacd",
792
+ lightblue: "add8e6",
793
+ lightcoral: "f08080",
794
+ lightcyan: "e0ffff",
795
+ lightgoldenrodyellow: "fafad2",
796
+ lightgray: "d3d3d3",
797
+ lightgreen: "90ee90",
798
+ lightgrey: "d3d3d3",
799
+ lightpink: "ffb6c1",
800
+ lightsalmon: "ffa07a",
801
+ lightseagreen: "20b2aa",
802
+ lightskyblue: "87cefa",
803
+ lightslategray: "789",
804
+ lightslategrey: "789",
805
+ lightsteelblue: "b0c4de",
806
+ lightyellow: "ffffe0",
807
+ lime: "0f0",
808
+ limegreen: "32cd32",
809
+ linen: "faf0e6",
810
+ magenta: "f0f",
811
+ maroon: "800000",
812
+ mediumaquamarine: "66cdaa",
813
+ mediumblue: "0000cd",
814
+ mediumorchid: "ba55d3",
815
+ mediumpurple: "9370db",
816
+ mediumseagreen: "3cb371",
817
+ mediumslateblue: "7b68ee",
818
+ mediumspringgreen: "00fa9a",
819
+ mediumturquoise: "48d1cc",
820
+ mediumvioletred: "c71585",
821
+ midnightblue: "191970",
822
+ mintcream: "f5fffa",
823
+ mistyrose: "ffe4e1",
824
+ moccasin: "ffe4b5",
825
+ navajowhite: "ffdead",
826
+ navy: "000080",
827
+ oldlace: "fdf5e6",
828
+ olive: "808000",
829
+ olivedrab: "6b8e23",
830
+ orange: "ffa500",
831
+ orangered: "ff4500",
832
+ orchid: "da70d6",
833
+ palegoldenrod: "eee8aa",
834
+ palegreen: "98fb98",
835
+ paleturquoise: "afeeee",
836
+ palevioletred: "db7093",
837
+ papayawhip: "ffefd5",
838
+ peachpuff: "ffdab9",
839
+ peru: "cd853f",
840
+ pink: "ffc0cb",
841
+ plum: "dda0dd",
842
+ powderblue: "b0e0e6",
843
+ purple: "800080",
844
+ rebeccapurple: "663399",
845
+ red: "f00",
846
+ rosybrown: "bc8f8f",
847
+ royalblue: "4169e1",
848
+ saddlebrown: "8b4513",
849
+ salmon: "fa8072",
850
+ sandybrown: "f4a460",
851
+ seagreen: "2e8b57",
852
+ seashell: "fff5ee",
853
+ sienna: "a0522d",
854
+ silver: "c0c0c0",
855
+ skyblue: "87ceeb",
856
+ slateblue: "6a5acd",
857
+ slategray: "708090",
858
+ slategrey: "708090",
859
+ snow: "fffafa",
860
+ springgreen: "00ff7f",
861
+ steelblue: "4682b4",
862
+ tan: "d2b48c",
863
+ teal: "008080",
864
+ thistle: "d8bfd8",
865
+ tomato: "ff6347",
866
+ turquoise: "40e0d0",
867
+ violet: "ee82ee",
868
+ wheat: "f5deb3",
869
+ white: "fff",
870
+ whitesmoke: "f5f5f5",
871
+ yellow: "ff0",
872
+ yellowgreen: "9acd32"
873
+ };
874
+ var hexNames = tinycolor.hexNames = flip(names);
875
+ function flip(o) {
876
+ var flipped = {};
877
+ for (var i in o) {
878
+ if (o.hasOwnProperty(i)) {
879
+ flipped[o[i]] = i;
880
+ }
881
+ }
882
+ return flipped;
883
+ }
884
+ function boundAlpha(a) {
885
+ a = parseFloat(a);
886
+ if (isNaN(a) || a < 0 || a > 1) {
887
+ a = 1;
888
+ }
889
+ return a;
890
+ }
891
+ function bound01(n, max) {
892
+ if (isOnePointZero(n))
893
+ n = "100%";
894
+ var processPercent = isPercentage(n);
895
+ n = Math.min(max, Math.max(0, parseFloat(n)));
896
+ if (processPercent) {
897
+ n = parseInt(n * max, 10) / 100;
898
+ }
899
+ if (Math.abs(n - max) < 0.000001) {
900
+ return 1;
901
+ }
902
+ return n % max / parseFloat(max);
903
+ }
904
+ function clamp01(val) {
905
+ return Math.min(1, Math.max(0, val));
906
+ }
907
+ function parseIntFromHex(val) {
908
+ return parseInt(val, 16);
909
+ }
910
+ function isOnePointZero(n) {
911
+ return typeof n == "string" && n.indexOf(".") != -1 && parseFloat(n) === 1;
912
+ }
913
+ function isPercentage(n) {
914
+ return typeof n === "string" && n.indexOf("%") != -1;
915
+ }
916
+ function pad2(c) {
917
+ return c.length == 1 ? "0" + c : "" + c;
918
+ }
919
+ function convertToPercentage(n) {
920
+ if (n <= 1) {
921
+ n = n * 100 + "%";
922
+ }
923
+ return n;
924
+ }
925
+ function convertDecimalToHex(d) {
926
+ return Math.round(parseFloat(d) * 255).toString(16);
927
+ }
928
+ function convertHexToDecimal(h) {
929
+ return parseIntFromHex(h) / 255;
930
+ }
931
+ var matchers = function() {
932
+ var CSS_INTEGER = "[-\\+]?\\d+%?";
933
+ var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
934
+ var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")";
935
+ var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
936
+ var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
937
+ return {
938
+ CSS_UNIT: new RegExp(CSS_UNIT),
939
+ rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
940
+ rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
941
+ hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
942
+ hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
943
+ hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
944
+ hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
945
+ hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
946
+ hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
947
+ hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
948
+ hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
949
+ };
950
+ }();
951
+ function isValidCSSUnit(color) {
952
+ return !!matchers.CSS_UNIT.exec(color);
953
+ }
954
+ function stringInputToObject(color) {
955
+ color = color.replace(trimLeft, "").replace(trimRight, "").toLowerCase();
956
+ var named = false;
957
+ if (names[color]) {
958
+ color = names[color];
959
+ named = true;
960
+ } else if (color == "transparent") {
961
+ return {
962
+ r: 0,
963
+ g: 0,
964
+ b: 0,
965
+ a: 0,
966
+ format: "name"
967
+ };
968
+ }
969
+ var match;
970
+ if (match = matchers.rgb.exec(color)) {
971
+ return {
972
+ r: match[1],
973
+ g: match[2],
974
+ b: match[3]
975
+ };
976
+ }
977
+ if (match = matchers.rgba.exec(color)) {
978
+ return {
979
+ r: match[1],
980
+ g: match[2],
981
+ b: match[3],
982
+ a: match[4]
983
+ };
984
+ }
985
+ if (match = matchers.hsl.exec(color)) {
986
+ return {
987
+ h: match[1],
988
+ s: match[2],
989
+ l: match[3]
990
+ };
991
+ }
992
+ if (match = matchers.hsla.exec(color)) {
993
+ return {
994
+ h: match[1],
995
+ s: match[2],
996
+ l: match[3],
997
+ a: match[4]
998
+ };
999
+ }
1000
+ if (match = matchers.hsv.exec(color)) {
1001
+ return {
1002
+ h: match[1],
1003
+ s: match[2],
1004
+ v: match[3]
1005
+ };
1006
+ }
1007
+ if (match = matchers.hsva.exec(color)) {
1008
+ return {
1009
+ h: match[1],
1010
+ s: match[2],
1011
+ v: match[3],
1012
+ a: match[4]
1013
+ };
1014
+ }
1015
+ if (match = matchers.hex8.exec(color)) {
1016
+ return {
1017
+ r: parseIntFromHex(match[1]),
1018
+ g: parseIntFromHex(match[2]),
1019
+ b: parseIntFromHex(match[3]),
1020
+ a: convertHexToDecimal(match[4]),
1021
+ format: named ? "name" : "hex8"
1022
+ };
1023
+ }
1024
+ if (match = matchers.hex6.exec(color)) {
1025
+ return {
1026
+ r: parseIntFromHex(match[1]),
1027
+ g: parseIntFromHex(match[2]),
1028
+ b: parseIntFromHex(match[3]),
1029
+ format: named ? "name" : "hex"
1030
+ };
1031
+ }
1032
+ if (match = matchers.hex4.exec(color)) {
1033
+ return {
1034
+ r: parseIntFromHex(match[1] + "" + match[1]),
1035
+ g: parseIntFromHex(match[2] + "" + match[2]),
1036
+ b: parseIntFromHex(match[3] + "" + match[3]),
1037
+ a: convertHexToDecimal(match[4] + "" + match[4]),
1038
+ format: named ? "name" : "hex8"
1039
+ };
1040
+ }
1041
+ if (match = matchers.hex3.exec(color)) {
1042
+ return {
1043
+ r: parseIntFromHex(match[1] + "" + match[1]),
1044
+ g: parseIntFromHex(match[2] + "" + match[2]),
1045
+ b: parseIntFromHex(match[3] + "" + match[3]),
1046
+ format: named ? "name" : "hex"
1047
+ };
1048
+ }
1049
+ return false;
1050
+ }
1051
+ function validateWCAG2Parms(parms) {
1052
+ var level, size;
1053
+ parms = parms || {
1054
+ level: "AA",
1055
+ size: "small"
1056
+ };
1057
+ level = (parms.level || "AA").toUpperCase();
1058
+ size = (parms.size || "small").toLowerCase();
1059
+ if (level !== "AA" && level !== "AAA") {
1060
+ level = "AA";
1061
+ }
1062
+ if (size !== "small" && size !== "large") {
1063
+ size = "small";
1064
+ }
1065
+ return {
1066
+ level,
1067
+ size
1068
+ };
1069
+ }
1070
+ return tinycolor;
1071
+ });
1072
+ });
1073
+
1074
+ // node_modules/tinygradient/index.js
1075
+ var require_tinygradient = __commonJS((exports, module) => {
1076
+ var tinycolor = require_tinycolor();
1077
+ var RGBA_MAX = { r: 256, g: 256, b: 256, a: 1 };
1078
+ var HSVA_MAX = { h: 360, s: 1, v: 1, a: 1 };
1079
+ function stepize(start, end, steps) {
1080
+ let step = {};
1081
+ for (let k in start) {
1082
+ if (start.hasOwnProperty(k)) {
1083
+ step[k] = steps === 0 ? 0 : (end[k] - start[k]) / steps;
1084
+ }
1085
+ }
1086
+ return step;
1087
+ }
1088
+ function interpolate(step, start, i, max) {
1089
+ let color = {};
1090
+ for (let k in start) {
1091
+ if (start.hasOwnProperty(k)) {
1092
+ color[k] = step[k] * i + start[k];
1093
+ color[k] = color[k] < 0 ? color[k] + max[k] : max[k] !== 1 ? color[k] % max[k] : color[k];
1094
+ }
1095
+ }
1096
+ return color;
1097
+ }
1098
+ function interpolateRgb(stop1, stop2, steps) {
1099
+ const start = stop1.color.toRgb();
1100
+ const end = stop2.color.toRgb();
1101
+ const step = stepize(start, end, steps);
1102
+ let gradient = [stop1.color];
1103
+ for (let i = 1;i < steps; i++) {
1104
+ const color = interpolate(step, start, i, RGBA_MAX);
1105
+ gradient.push(tinycolor(color));
1106
+ }
1107
+ return gradient;
1108
+ }
1109
+ function interpolateHsv(stop1, stop2, steps, mode) {
1110
+ const start = stop1.color.toHsv();
1111
+ const end = stop2.color.toHsv();
1112
+ if (start.s === 0 || end.s === 0) {
1113
+ return interpolateRgb(stop1, stop2, steps);
1114
+ }
1115
+ let trigonometric;
1116
+ if (typeof mode === "boolean") {
1117
+ trigonometric = mode;
1118
+ } else {
1119
+ const trigShortest = start.h < end.h && end.h - start.h < 180 || start.h > end.h && start.h - end.h > 180;
1120
+ trigonometric = mode === "long" && trigShortest || mode === "short" && !trigShortest;
1121
+ }
1122
+ const step = stepize(start, end, steps);
1123
+ let gradient = [stop1.color];
1124
+ let diff;
1125
+ if (start.h <= end.h && !trigonometric || start.h >= end.h && trigonometric) {
1126
+ diff = end.h - start.h;
1127
+ } else if (trigonometric) {
1128
+ diff = 360 - end.h + start.h;
1129
+ } else {
1130
+ diff = 360 - start.h + end.h;
1131
+ }
1132
+ step.h = Math.pow(-1, trigonometric ? 1 : 0) * Math.abs(diff) / steps;
1133
+ for (let i = 1;i < steps; i++) {
1134
+ const color = interpolate(step, start, i, HSVA_MAX);
1135
+ gradient.push(tinycolor(color));
1136
+ }
1137
+ return gradient;
1138
+ }
1139
+ function computeSubsteps(stops, steps) {
1140
+ const l = stops.length;
1141
+ steps = parseInt(steps, 10);
1142
+ if (isNaN(steps) || steps < 2) {
1143
+ throw new Error("Invalid number of steps (< 2)");
1144
+ }
1145
+ if (steps < l) {
1146
+ throw new Error("Number of steps cannot be inferior to number of stops");
1147
+ }
1148
+ let substeps = [];
1149
+ for (let i = 1;i < l; i++) {
1150
+ const step = (steps - 1) * (stops[i].pos - stops[i - 1].pos);
1151
+ substeps.push(Math.max(1, Math.round(step)));
1152
+ }
1153
+ let totalSubsteps = 1;
1154
+ for (let n = l - 1;n--; )
1155
+ totalSubsteps += substeps[n];
1156
+ while (totalSubsteps !== steps) {
1157
+ if (totalSubsteps < steps) {
1158
+ const min = Math.min.apply(null, substeps);
1159
+ substeps[substeps.indexOf(min)]++;
1160
+ totalSubsteps++;
1161
+ } else {
1162
+ const max = Math.max.apply(null, substeps);
1163
+ substeps[substeps.indexOf(max)]--;
1164
+ totalSubsteps--;
1165
+ }
1166
+ }
1167
+ return substeps;
1168
+ }
1169
+ function computeAt(stops, pos, method, max) {
1170
+ if (pos < 0 || pos > 1) {
1171
+ throw new Error("Position must be between 0 and 1");
1172
+ }
1173
+ let start, end;
1174
+ for (let i = 0, l = stops.length;i < l - 1; i++) {
1175
+ if (pos >= stops[i].pos && pos < stops[i + 1].pos) {
1176
+ start = stops[i];
1177
+ end = stops[i + 1];
1178
+ break;
1179
+ }
1180
+ }
1181
+ if (!start) {
1182
+ start = end = stops[stops.length - 1];
1183
+ }
1184
+ const step = stepize(start.color[method](), end.color[method](), (end.pos - start.pos) * 100);
1185
+ const color = interpolate(step, start.color[method](), (pos - start.pos) * 100, max);
1186
+ return tinycolor(color);
1187
+ }
1188
+
1189
+ class TinyGradient {
1190
+ constructor(stops) {
1191
+ if (stops.length < 2) {
1192
+ throw new Error("Invalid number of stops (< 2)");
1193
+ }
1194
+ const havingPositions = stops[0].pos !== undefined;
1195
+ let l = stops.length;
1196
+ let p = -1;
1197
+ let lastColorLess = false;
1198
+ this.stops = stops.map((stop, i) => {
1199
+ const hasPosition = stop.pos !== undefined;
1200
+ if (havingPositions ^ hasPosition) {
1201
+ throw new Error("Cannot mix positionned and not posionned color stops");
1202
+ }
1203
+ if (hasPosition) {
1204
+ const hasColor = stop.color !== undefined;
1205
+ if (!hasColor && (lastColorLess || i === 0 || i === l - 1)) {
1206
+ throw new Error("Cannot define two consecutive position-only stops");
1207
+ }
1208
+ lastColorLess = !hasColor;
1209
+ stop = {
1210
+ color: hasColor ? tinycolor(stop.color) : null,
1211
+ colorLess: !hasColor,
1212
+ pos: stop.pos
1213
+ };
1214
+ if (stop.pos < 0 || stop.pos > 1) {
1215
+ throw new Error("Color stops positions must be between 0 and 1");
1216
+ } else if (stop.pos < p) {
1217
+ throw new Error("Color stops positions are not ordered");
1218
+ }
1219
+ p = stop.pos;
1220
+ } else {
1221
+ stop = {
1222
+ color: tinycolor(stop.color !== undefined ? stop.color : stop),
1223
+ pos: i / (l - 1)
1224
+ };
1225
+ }
1226
+ return stop;
1227
+ });
1228
+ if (this.stops[0].pos !== 0) {
1229
+ this.stops.unshift({
1230
+ color: this.stops[0].color,
1231
+ pos: 0
1232
+ });
1233
+ l++;
1234
+ }
1235
+ if (this.stops[l - 1].pos !== 1) {
1236
+ this.stops.push({
1237
+ color: this.stops[l - 1].color,
1238
+ pos: 1
1239
+ });
1240
+ }
1241
+ }
1242
+ reverse() {
1243
+ let stops = [];
1244
+ this.stops.forEach(function(stop) {
1245
+ stops.push({
1246
+ color: stop.color,
1247
+ pos: 1 - stop.pos
1248
+ });
1249
+ });
1250
+ return new TinyGradient(stops.reverse());
1251
+ }
1252
+ loop() {
1253
+ let stops1 = [];
1254
+ let stops2 = [];
1255
+ this.stops.forEach((stop) => {
1256
+ stops1.push({
1257
+ color: stop.color,
1258
+ pos: stop.pos / 2
1259
+ });
1260
+ });
1261
+ this.stops.slice(0, -1).forEach((stop) => {
1262
+ stops2.push({
1263
+ color: stop.color,
1264
+ pos: 1 - stop.pos / 2
1265
+ });
1266
+ });
1267
+ return new TinyGradient(stops1.concat(stops2.reverse()));
1268
+ }
1269
+ rgb(steps) {
1270
+ const substeps = computeSubsteps(this.stops, steps);
1271
+ let gradient = [];
1272
+ this.stops.forEach((stop, i) => {
1273
+ if (stop.colorLess) {
1274
+ stop.color = interpolateRgb(this.stops[i - 1], this.stops[i + 1], 2)[1];
1275
+ }
1276
+ });
1277
+ for (let i = 0, l = this.stops.length;i < l - 1; i++) {
1278
+ const rgb = interpolateRgb(this.stops[i], this.stops[i + 1], substeps[i]);
1279
+ gradient.splice(gradient.length, 0, ...rgb);
1280
+ }
1281
+ gradient.push(this.stops[this.stops.length - 1].color);
1282
+ return gradient;
1283
+ }
1284
+ hsv(steps, mode) {
1285
+ const substeps = computeSubsteps(this.stops, steps);
1286
+ let gradient = [];
1287
+ this.stops.forEach((stop, i) => {
1288
+ if (stop.colorLess) {
1289
+ stop.color = interpolateHsv(this.stops[i - 1], this.stops[i + 1], 2, mode)[1];
1290
+ }
1291
+ });
1292
+ for (let i = 0, l = this.stops.length;i < l - 1; i++) {
1293
+ const hsv = interpolateHsv(this.stops[i], this.stops[i + 1], substeps[i], mode);
1294
+ gradient.splice(gradient.length, 0, ...hsv);
1295
+ }
1296
+ gradient.push(this.stops[this.stops.length - 1].color);
1297
+ return gradient;
1298
+ }
1299
+ css(mode, direction) {
1300
+ mode = mode || "linear";
1301
+ direction = direction || (mode === "linear" ? "to right" : "ellipse at center");
1302
+ let css = mode + "-gradient(" + direction;
1303
+ this.stops.forEach(function(stop) {
1304
+ css += ", " + (stop.colorLess ? "" : stop.color.toRgbString() + " ") + stop.pos * 100 + "%";
1305
+ });
1306
+ css += ")";
1307
+ return css;
1308
+ }
1309
+ rgbAt(pos) {
1310
+ return computeAt(this.stops, pos, "toRgb", RGBA_MAX);
1311
+ }
1312
+ hsvAt(pos) {
1313
+ return computeAt(this.stops, pos, "toHsv", HSVA_MAX);
1314
+ }
1315
+ }
1316
+ module.exports = function(stops) {
1317
+ if (arguments.length === 1) {
1318
+ if (!Array.isArray(arguments[0])) {
1319
+ throw new Error('"stops" is not an array');
1320
+ }
1321
+ stops = arguments[0];
1322
+ } else {
1323
+ stops = Array.prototype.slice.call(arguments);
1324
+ }
1325
+ return new TinyGradient(stops);
1326
+ };
1327
+ });
1328
+
1329
+ // node_modules/sisteransi/src/index.js
1330
+ var require_src = __commonJS((exports, module) => {
1331
+ var ESC = "\x1B";
1332
+ var CSI = `${ESC}[`;
1333
+ var beep = "\x07";
1334
+ var cursor = {
1335
+ to(x, y) {
1336
+ if (!y)
1337
+ return `${CSI}${x + 1}G`;
1338
+ return `${CSI}${y + 1};${x + 1}H`;
1339
+ },
1340
+ move(x, y) {
1341
+ let ret = "";
1342
+ if (x < 0)
1343
+ ret += `${CSI}${-x}D`;
1344
+ else if (x > 0)
1345
+ ret += `${CSI}${x}C`;
1346
+ if (y < 0)
1347
+ ret += `${CSI}${-y}A`;
1348
+ else if (y > 0)
1349
+ ret += `${CSI}${y}B`;
1350
+ return ret;
1351
+ },
1352
+ up: (count = 1) => `${CSI}${count}A`,
1353
+ down: (count = 1) => `${CSI}${count}B`,
1354
+ forward: (count = 1) => `${CSI}${count}C`,
1355
+ backward: (count = 1) => `${CSI}${count}D`,
1356
+ nextLine: (count = 1) => `${CSI}E`.repeat(count),
1357
+ prevLine: (count = 1) => `${CSI}F`.repeat(count),
1358
+ left: `${CSI}G`,
1359
+ hide: `${CSI}?25l`,
1360
+ show: `${CSI}?25h`,
1361
+ save: `${ESC}7`,
1362
+ restore: `${ESC}8`
1363
+ };
1364
+ var scroll = {
1365
+ up: (count = 1) => `${CSI}S`.repeat(count),
1366
+ down: (count = 1) => `${CSI}T`.repeat(count)
1367
+ };
1368
+ var erase = {
1369
+ screen: `${CSI}2J`,
1370
+ up: (count = 1) => `${CSI}1J`.repeat(count),
1371
+ down: (count = 1) => `${CSI}J`.repeat(count),
1372
+ line: `${CSI}2K`,
1373
+ lineEnd: `${CSI}K`,
1374
+ lineStart: `${CSI}1K`,
1375
+ lines(count) {
1376
+ let clear = "";
1377
+ for (let i = 0;i < count; i++)
1378
+ clear += this.line + (i < count - 1 ? cursor.up() : "");
1379
+ if (count)
1380
+ clear += cursor.left;
1381
+ return clear;
1382
+ }
1383
+ };
1384
+ module.exports = { cursor, scroll, erase, beep };
1385
+ });
1386
+
1387
+ // src/index.ts
1388
+ import * as fs from "node:fs";
1389
+ import * as path from "node:path";
1390
+ import * as os2 from "node:os";
1391
+ import { execSync } from "node:child_process";
1392
+
1393
+ // src/branding.ts
1394
+ var import_picocolors = __toESM(require_picocolors(), 1);
1395
+
1396
+ // node_modules/chalk/source/vendor/ansi-styles/index.js
1397
+ var ANSI_BACKGROUND_OFFSET = 10;
1398
+ var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
1399
+ var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
1400
+ var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
1401
+ var styles = {
1402
+ modifier: {
1403
+ reset: [0, 0],
1404
+ bold: [1, 22],
1405
+ dim: [2, 22],
1406
+ italic: [3, 23],
1407
+ underline: [4, 24],
1408
+ overline: [53, 55],
1409
+ inverse: [7, 27],
1410
+ hidden: [8, 28],
1411
+ strikethrough: [9, 29]
1412
+ },
1413
+ color: {
1414
+ black: [30, 39],
1415
+ red: [31, 39],
1416
+ green: [32, 39],
1417
+ yellow: [33, 39],
1418
+ blue: [34, 39],
1419
+ magenta: [35, 39],
1420
+ cyan: [36, 39],
1421
+ white: [37, 39],
1422
+ blackBright: [90, 39],
1423
+ gray: [90, 39],
1424
+ grey: [90, 39],
1425
+ redBright: [91, 39],
1426
+ greenBright: [92, 39],
1427
+ yellowBright: [93, 39],
1428
+ blueBright: [94, 39],
1429
+ magentaBright: [95, 39],
1430
+ cyanBright: [96, 39],
1431
+ whiteBright: [97, 39]
1432
+ },
1433
+ bgColor: {
1434
+ bgBlack: [40, 49],
1435
+ bgRed: [41, 49],
1436
+ bgGreen: [42, 49],
1437
+ bgYellow: [43, 49],
1438
+ bgBlue: [44, 49],
1439
+ bgMagenta: [45, 49],
1440
+ bgCyan: [46, 49],
1441
+ bgWhite: [47, 49],
1442
+ bgBlackBright: [100, 49],
1443
+ bgGray: [100, 49],
1444
+ bgGrey: [100, 49],
1445
+ bgRedBright: [101, 49],
1446
+ bgGreenBright: [102, 49],
1447
+ bgYellowBright: [103, 49],
1448
+ bgBlueBright: [104, 49],
1449
+ bgMagentaBright: [105, 49],
1450
+ bgCyanBright: [106, 49],
1451
+ bgWhiteBright: [107, 49]
1452
+ }
1453
+ };
1454
+ var modifierNames = Object.keys(styles.modifier);
1455
+ var foregroundColorNames = Object.keys(styles.color);
1456
+ var backgroundColorNames = Object.keys(styles.bgColor);
1457
+ var colorNames = [...foregroundColorNames, ...backgroundColorNames];
1458
+ function assembleStyles() {
1459
+ const codes = new Map;
1460
+ for (const [groupName, group] of Object.entries(styles)) {
1461
+ for (const [styleName, style] of Object.entries(group)) {
1462
+ styles[styleName] = {
1463
+ open: `\x1B[${style[0]}m`,
1464
+ close: `\x1B[${style[1]}m`
1465
+ };
1466
+ group[styleName] = styles[styleName];
1467
+ codes.set(style[0], style[1]);
1468
+ }
1469
+ Object.defineProperty(styles, groupName, {
1470
+ value: group,
1471
+ enumerable: false
1472
+ });
1473
+ }
1474
+ Object.defineProperty(styles, "codes", {
1475
+ value: codes,
1476
+ enumerable: false
1477
+ });
1478
+ styles.color.close = "\x1B[39m";
1479
+ styles.bgColor.close = "\x1B[49m";
1480
+ styles.color.ansi = wrapAnsi16();
1481
+ styles.color.ansi256 = wrapAnsi256();
1482
+ styles.color.ansi16m = wrapAnsi16m();
1483
+ styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
1484
+ styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
1485
+ styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
1486
+ Object.defineProperties(styles, {
1487
+ rgbToAnsi256: {
1488
+ value(red, green, blue) {
1489
+ if (red === green && green === blue) {
1490
+ if (red < 8) {
1491
+ return 16;
1492
+ }
1493
+ if (red > 248) {
1494
+ return 231;
1495
+ }
1496
+ return Math.round((red - 8) / 247 * 24) + 232;
1497
+ }
1498
+ return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
1499
+ },
1500
+ enumerable: false
1501
+ },
1502
+ hexToRgb: {
1503
+ value(hex) {
1504
+ const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
1505
+ if (!matches) {
1506
+ return [0, 0, 0];
1507
+ }
1508
+ let [colorString] = matches;
1509
+ if (colorString.length === 3) {
1510
+ colorString = [...colorString].map((character) => character + character).join("");
1511
+ }
1512
+ const integer = Number.parseInt(colorString, 16);
1513
+ return [
1514
+ integer >> 16 & 255,
1515
+ integer >> 8 & 255,
1516
+ integer & 255
1517
+ ];
1518
+ },
1519
+ enumerable: false
1520
+ },
1521
+ hexToAnsi256: {
1522
+ value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
1523
+ enumerable: false
1524
+ },
1525
+ ansi256ToAnsi: {
1526
+ value(code) {
1527
+ if (code < 8) {
1528
+ return 30 + code;
1529
+ }
1530
+ if (code < 16) {
1531
+ return 90 + (code - 8);
1532
+ }
1533
+ let red;
1534
+ let green;
1535
+ let blue;
1536
+ if (code >= 232) {
1537
+ red = ((code - 232) * 10 + 8) / 255;
1538
+ green = red;
1539
+ blue = red;
1540
+ } else {
1541
+ code -= 16;
1542
+ const remainder = code % 36;
1543
+ red = Math.floor(code / 36) / 5;
1544
+ green = Math.floor(remainder / 6) / 5;
1545
+ blue = remainder % 6 / 5;
1546
+ }
1547
+ const value = Math.max(red, green, blue) * 2;
1548
+ if (value === 0) {
1549
+ return 30;
1550
+ }
1551
+ let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
1552
+ if (value === 2) {
1553
+ result += 60;
1554
+ }
1555
+ return result;
1556
+ },
1557
+ enumerable: false
1558
+ },
1559
+ rgbToAnsi: {
1560
+ value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
1561
+ enumerable: false
1562
+ },
1563
+ hexToAnsi: {
1564
+ value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
1565
+ enumerable: false
1566
+ }
1567
+ });
1568
+ return styles;
1569
+ }
1570
+ var ansiStyles = assembleStyles();
1571
+ var ansi_styles_default = ansiStyles;
1572
+
1573
+ // node_modules/chalk/source/vendor/supports-color/index.js
1574
+ import process2 from "node:process";
1575
+ import os from "node:os";
1576
+ import tty from "node:tty";
1577
+ function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process2.argv) {
1578
+ const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
1579
+ const position = argv.indexOf(prefix + flag);
1580
+ const terminatorPosition = argv.indexOf("--");
1581
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
1582
+ }
1583
+ var { env } = process2;
1584
+ var flagForceColor;
1585
+ if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
1586
+ flagForceColor = 0;
1587
+ } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
1588
+ flagForceColor = 1;
1589
+ }
1590
+ function envForceColor() {
1591
+ if ("FORCE_COLOR" in env) {
1592
+ if (env.FORCE_COLOR === "true") {
1593
+ return 1;
1594
+ }
1595
+ if (env.FORCE_COLOR === "false") {
1596
+ return 0;
1597
+ }
1598
+ return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
1599
+ }
1600
+ }
1601
+ function translateLevel(level) {
1602
+ if (level === 0) {
1603
+ return false;
1604
+ }
1605
+ return {
1606
+ level,
1607
+ hasBasic: true,
1608
+ has256: level >= 2,
1609
+ has16m: level >= 3
1610
+ };
1611
+ }
1612
+ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
1613
+ const noFlagForceColor = envForceColor();
1614
+ if (noFlagForceColor !== undefined) {
1615
+ flagForceColor = noFlagForceColor;
1616
+ }
1617
+ const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
1618
+ if (forceColor === 0) {
1619
+ return 0;
1620
+ }
1621
+ if (sniffFlags) {
1622
+ if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
1623
+ return 3;
1624
+ }
1625
+ if (hasFlag("color=256")) {
1626
+ return 2;
1627
+ }
1628
+ }
1629
+ if ("TF_BUILD" in env && "AGENT_NAME" in env) {
1630
+ return 1;
1631
+ }
1632
+ if (haveStream && !streamIsTTY && forceColor === undefined) {
1633
+ return 0;
1634
+ }
1635
+ const min = forceColor || 0;
1636
+ if (env.TERM === "dumb") {
1637
+ return min;
1638
+ }
1639
+ if (process2.platform === "win32") {
1640
+ const osRelease = os.release().split(".");
1641
+ if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
1642
+ return Number(osRelease[2]) >= 14931 ? 3 : 2;
1643
+ }
1644
+ return 1;
1645
+ }
1646
+ if ("CI" in env) {
1647
+ if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => (key in env))) {
1648
+ return 3;
1649
+ }
1650
+ if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => (sign in env)) || env.CI_NAME === "codeship") {
1651
+ return 1;
1652
+ }
1653
+ return min;
1654
+ }
1655
+ if ("TEAMCITY_VERSION" in env) {
1656
+ return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
1657
+ }
1658
+ if (env.COLORTERM === "truecolor") {
1659
+ return 3;
1660
+ }
1661
+ if (env.TERM === "xterm-kitty") {
1662
+ return 3;
1663
+ }
1664
+ if (env.TERM === "xterm-ghostty") {
1665
+ return 3;
1666
+ }
1667
+ if (env.TERM === "wezterm") {
1668
+ return 3;
1669
+ }
1670
+ if ("TERM_PROGRAM" in env) {
1671
+ const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
1672
+ switch (env.TERM_PROGRAM) {
1673
+ case "iTerm.app": {
1674
+ return version >= 3 ? 3 : 2;
1675
+ }
1676
+ case "Apple_Terminal": {
1677
+ return 2;
1678
+ }
1679
+ }
1680
+ }
1681
+ if (/-256(color)?$/i.test(env.TERM)) {
1682
+ return 2;
1683
+ }
1684
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
1685
+ return 1;
1686
+ }
1687
+ if ("COLORTERM" in env) {
1688
+ return 1;
1689
+ }
1690
+ return min;
1691
+ }
1692
+ function createSupportsColor(stream, options = {}) {
1693
+ const level = _supportsColor(stream, {
1694
+ streamIsTTY: stream && stream.isTTY,
1695
+ ...options
1696
+ });
1697
+ return translateLevel(level);
1698
+ }
1699
+ var supportsColor = {
1700
+ stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
1701
+ stderr: createSupportsColor({ isTTY: tty.isatty(2) })
1702
+ };
1703
+ var supports_color_default = supportsColor;
1704
+
1705
+ // node_modules/chalk/source/utilities.js
1706
+ function stringReplaceAll(string, substring, replacer) {
1707
+ let index = string.indexOf(substring);
1708
+ if (index === -1) {
1709
+ return string;
1710
+ }
1711
+ const substringLength = substring.length;
1712
+ let endIndex = 0;
1713
+ let returnValue = "";
1714
+ do {
1715
+ returnValue += string.slice(endIndex, index) + substring + replacer;
1716
+ endIndex = index + substringLength;
1717
+ index = string.indexOf(substring, endIndex);
1718
+ } while (index !== -1);
1719
+ returnValue += string.slice(endIndex);
1720
+ return returnValue;
1721
+ }
1722
+ function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
1723
+ let endIndex = 0;
1724
+ let returnValue = "";
1725
+ do {
1726
+ const gotCR = string[index - 1] === "\r";
1727
+ returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? `\r
1728
+ ` : `
1729
+ `) + postfix;
1730
+ endIndex = index + 1;
1731
+ index = string.indexOf(`
1732
+ `, endIndex);
1733
+ } while (index !== -1);
1734
+ returnValue += string.slice(endIndex);
1735
+ return returnValue;
1736
+ }
1737
+
1738
+ // node_modules/chalk/source/index.js
1739
+ var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
1740
+ var GENERATOR = Symbol("GENERATOR");
1741
+ var STYLER = Symbol("STYLER");
1742
+ var IS_EMPTY = Symbol("IS_EMPTY");
1743
+ var levelMapping = [
1744
+ "ansi",
1745
+ "ansi",
1746
+ "ansi256",
1747
+ "ansi16m"
1748
+ ];
1749
+ var styles2 = Object.create(null);
1750
+ var applyOptions = (object, options = {}) => {
1751
+ if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
1752
+ throw new Error("The `level` option should be an integer from 0 to 3");
1753
+ }
1754
+ const colorLevel = stdoutColor ? stdoutColor.level : 0;
1755
+ object.level = options.level === undefined ? colorLevel : options.level;
1756
+ };
1757
+ var chalkFactory = (options) => {
1758
+ const chalk = (...strings) => strings.join(" ");
1759
+ applyOptions(chalk, options);
1760
+ Object.setPrototypeOf(chalk, createChalk.prototype);
1761
+ return chalk;
1762
+ };
1763
+ function createChalk(options) {
1764
+ return chalkFactory(options);
1765
+ }
1766
+ Object.setPrototypeOf(createChalk.prototype, Function.prototype);
1767
+ for (const [styleName, style] of Object.entries(ansi_styles_default)) {
1768
+ styles2[styleName] = {
1769
+ get() {
1770
+ const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
1771
+ Object.defineProperty(this, styleName, { value: builder });
1772
+ return builder;
1773
+ }
1774
+ };
1775
+ }
1776
+ styles2.visible = {
1777
+ get() {
1778
+ const builder = createBuilder(this, this[STYLER], true);
1779
+ Object.defineProperty(this, "visible", { value: builder });
1780
+ return builder;
1781
+ }
1782
+ };
1783
+ var getModelAnsi = (model, level, type, ...arguments_) => {
1784
+ if (model === "rgb") {
1785
+ if (level === "ansi16m") {
1786
+ return ansi_styles_default[type].ansi16m(...arguments_);
1787
+ }
1788
+ if (level === "ansi256") {
1789
+ return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
1790
+ }
1791
+ return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
1792
+ }
1793
+ if (model === "hex") {
1794
+ return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
1795
+ }
1796
+ return ansi_styles_default[type][model](...arguments_);
1797
+ };
1798
+ var usedModels = ["rgb", "hex", "ansi256"];
1799
+ for (const model of usedModels) {
1800
+ styles2[model] = {
1801
+ get() {
1802
+ const { level } = this;
1803
+ return function(...arguments_) {
1804
+ const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
1805
+ return createBuilder(this, styler, this[IS_EMPTY]);
1806
+ };
1807
+ }
1808
+ };
1809
+ const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
1810
+ styles2[bgModel] = {
1811
+ get() {
1812
+ const { level } = this;
1813
+ return function(...arguments_) {
1814
+ const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
1815
+ return createBuilder(this, styler, this[IS_EMPTY]);
1816
+ };
1817
+ }
1818
+ };
1819
+ }
1820
+ var proto = Object.defineProperties(() => {}, {
1821
+ ...styles2,
1822
+ level: {
1823
+ enumerable: true,
1824
+ get() {
1825
+ return this[GENERATOR].level;
1826
+ },
1827
+ set(level) {
1828
+ this[GENERATOR].level = level;
1829
+ }
1830
+ }
1831
+ });
1832
+ var createStyler = (open, close, parent) => {
1833
+ let openAll;
1834
+ let closeAll;
1835
+ if (parent === undefined) {
1836
+ openAll = open;
1837
+ closeAll = close;
1838
+ } else {
1839
+ openAll = parent.openAll + open;
1840
+ closeAll = close + parent.closeAll;
1841
+ }
1842
+ return {
1843
+ open,
1844
+ close,
1845
+ openAll,
1846
+ closeAll,
1847
+ parent
1848
+ };
1849
+ };
1850
+ var createBuilder = (self2, _styler, _isEmpty) => {
1851
+ const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
1852
+ Object.setPrototypeOf(builder, proto);
1853
+ builder[GENERATOR] = self2;
1854
+ builder[STYLER] = _styler;
1855
+ builder[IS_EMPTY] = _isEmpty;
1856
+ return builder;
1857
+ };
1858
+ var applyStyle = (self2, string) => {
1859
+ if (self2.level <= 0 || !string) {
1860
+ return self2[IS_EMPTY] ? "" : string;
1861
+ }
1862
+ let styler = self2[STYLER];
1863
+ if (styler === undefined) {
1864
+ return string;
1865
+ }
1866
+ const { openAll, closeAll } = styler;
1867
+ if (string.includes("\x1B")) {
1868
+ while (styler !== undefined) {
1869
+ string = stringReplaceAll(string, styler.close, styler.open);
1870
+ styler = styler.parent;
1871
+ }
1872
+ }
1873
+ const lfIndex = string.indexOf(`
1874
+ `);
1875
+ if (lfIndex !== -1) {
1876
+ string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
1877
+ }
1878
+ return openAll + string + closeAll;
1879
+ };
1880
+ Object.defineProperties(createChalk.prototype, styles2);
1881
+ var chalk = createChalk();
1882
+ var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
1883
+ var source_default = chalk;
1884
+
1885
+ // node_modules/gradient-string/dist/index.js
1886
+ var import_tinygradient = __toESM(require_tinygradient(), 1);
1887
+ var gradient = (...colors) => {
1888
+ let gradient2;
1889
+ let options;
1890
+ if (colors.length === 0) {
1891
+ throw new Error("Missing gradient colors");
1892
+ }
1893
+ if (!Array.isArray(colors[0])) {
1894
+ if (colors.length === 1) {
1895
+ throw new Error(`Expected an array of colors, received ${JSON.stringify(colors[0])}`);
1896
+ }
1897
+ gradient2 = import_tinygradient.default(...colors);
1898
+ } else {
1899
+ gradient2 = import_tinygradient.default(colors[0]);
1900
+ options = validateOptions(colors[1]);
1901
+ }
1902
+ const fn = (str, deprecatedOptions) => {
1903
+ return applyGradient(str ? str.toString() : "", gradient2, deprecatedOptions ?? options);
1904
+ };
1905
+ fn.multiline = (str, deprecatedOptions) => multiline(str ? str.toString() : "", gradient2, deprecatedOptions ?? options);
1906
+ return fn;
1907
+ };
1908
+ var getColors = (gradient2, options, count) => {
1909
+ return options.interpolation?.toLowerCase() === "hsv" ? gradient2.hsv(count, options.hsvSpin?.toLowerCase() || false) : gradient2.rgb(count);
1910
+ };
1911
+ function applyGradient(str, gradient2, opts) {
1912
+ const options = validateOptions(opts);
1913
+ const colorsCount = Math.max(str.replace(/\s/g, "").length, gradient2.stops.length);
1914
+ const colors = getColors(gradient2, options, colorsCount);
1915
+ let result = "";
1916
+ for (const s of str) {
1917
+ result += s.match(/\s/g) ? s : source_default.hex(colors.shift()?.toHex() || "#000")(s);
1918
+ }
1919
+ return result;
1920
+ }
1921
+ function multiline(str, gradient2, opts) {
1922
+ const options = validateOptions(opts);
1923
+ const lines = str.split(`
1924
+ `);
1925
+ const maxLength = Math.max(...lines.map((l) => l.length), gradient2.stops.length);
1926
+ const colors = getColors(gradient2, options, maxLength);
1927
+ const results = [];
1928
+ for (const line of lines) {
1929
+ const lineColors = colors.slice(0);
1930
+ let lineResult = "";
1931
+ for (const l of line) {
1932
+ lineResult += source_default.hex(lineColors.shift()?.toHex() || "#000")(l);
1933
+ }
1934
+ results.push(lineResult);
1935
+ }
1936
+ return results.join(`
1937
+ `);
1938
+ }
1939
+ function validateOptions(opts) {
1940
+ const options = { interpolation: "rgb", hsvSpin: "short", ...opts };
1941
+ if (opts !== undefined && typeof opts !== "object") {
1942
+ throw new TypeError(`Expected \`options\` to be an \`object\`, got \`${typeof opts}\``);
1943
+ }
1944
+ if (typeof options.interpolation !== "string") {
1945
+ throw new TypeError(`Expected \`options.interpolation\` to be \`rgb\` or \`hsv\`, got \`${typeof options.interpolation}\``);
1946
+ }
1947
+ if (options.interpolation.toLowerCase() === "hsv" && typeof options.hsvSpin !== "string") {
1948
+ throw new TypeError(`Expected \`options.hsvSpin\` to be a \`short\` or \`long\`, got \`${typeof options.hsvSpin}\``);
1949
+ }
1950
+ return options;
1951
+ }
1952
+ var aliases = {
1953
+ atlas: { colors: ["#feac5e", "#c779d0", "#4bc0c8"], options: {} },
1954
+ cristal: { colors: ["#bdfff3", "#4ac29a"], options: {} },
1955
+ teen: { colors: ["#77a1d3", "#79cbca", "#e684ae"], options: {} },
1956
+ mind: { colors: ["#473b7b", "#3584a7", "#30d2be"], options: {} },
1957
+ morning: { colors: ["#ff5f6d", "#ffc371"], options: { interpolation: "hsv" } },
1958
+ vice: { colors: ["#5ee7df", "#b490ca"], options: { interpolation: "hsv" } },
1959
+ passion: { colors: ["#f43b47", "#453a94"], options: {} },
1960
+ fruit: { colors: ["#ff4e50", "#f9d423"], options: {} },
1961
+ instagram: { colors: ["#833ab4", "#fd1d1d", "#fcb045"], options: {} },
1962
+ retro: {
1963
+ colors: ["#3f51b1", "#5a55ae", "#7b5fac", "#8f6aae", "#a86aa4", "#cc6b8e", "#f18271", "#f3a469", "#f7c978"],
1964
+ options: {}
1965
+ },
1966
+ summer: { colors: ["#fdbb2d", "#22c1c3"], options: {} },
1967
+ rainbow: { colors: ["#ff0000", "#ff0100"], options: { interpolation: "hsv", hsvSpin: "long" } },
1968
+ pastel: { colors: ["#74ebd5", "#74ecd5"], options: { interpolation: "hsv", hsvSpin: "long" } }
1969
+ };
1970
+ function gradientAlias(alias) {
1971
+ const result = (str) => gradient(...alias.colors)(str, alias.options);
1972
+ result.multiline = (str = "") => gradient(...alias.colors).multiline(str, alias.options);
1973
+ return result;
1974
+ }
1975
+ var dist_default = gradient;
1976
+ var atlas = gradientAlias(aliases.atlas);
1977
+ var cristal = gradientAlias(aliases.cristal);
1978
+ var teen = gradientAlias(aliases.teen);
1979
+ var mind = gradientAlias(aliases.mind);
1980
+ var morning = gradientAlias(aliases.morning);
1981
+ var vice = gradientAlias(aliases.vice);
1982
+ var passion = gradientAlias(aliases.passion);
1983
+ var fruit = gradientAlias(aliases.fruit);
1984
+ var instagram = gradientAlias(aliases.instagram);
1985
+ var retro = gradientAlias(aliases.retro);
1986
+ var summer = gradientAlias(aliases.summer);
1987
+ var rainbow = gradientAlias(aliases.rainbow);
1988
+ var pastel = gradientAlias(aliases.pastel);
1989
+ gradient.atlas = atlas;
1990
+ gradient.cristal = cristal;
1991
+ gradient.teen = teen;
1992
+ gradient.mind = mind;
1993
+ gradient.morning = morning;
1994
+ gradient.vice = vice;
1995
+ gradient.passion = passion;
1996
+ gradient.fruit = fruit;
1997
+ gradient.instagram = instagram;
1998
+ gradient.retro = retro;
1999
+ gradient.summer = summer;
2000
+ gradient.rainbow = rainbow;
2001
+ gradient.pastel = pastel;
2002
+
2003
+ // src/branding.ts
2004
+ var colors = {
2005
+ primary: import_picocolors.default.blue,
2006
+ secondary: import_picocolors.default.cyan,
2007
+ success: import_picocolors.default.green,
2008
+ warning: import_picocolors.default.yellow,
2009
+ error: import_picocolors.default.red,
2010
+ muted: import_picocolors.default.gray,
2011
+ bold: import_picocolors.default.bold,
2012
+ dim: import_picocolors.default.dim
2013
+ };
2014
+ var zenithGradient = dist_default(["#3b82f6", "#06b6d4", "#22d3ee"]);
2015
+ function isTTY() {
2016
+ return Boolean(process.stdout.isTTY && !process.env.CI && !process.env.GITHUB_ACTIONS && !process.env.CONTINUOUS_INTEGRATION);
2017
+ }
2018
+ var LOGO_LINES = [
2019
+ " ███████╗███████╗███╗ ██╗██╗████████╗██╗ ██╗",
2020
+ " ╚══███╔╝██╔════╝████╗ ██║██║╚══██╔══╝██║ ██║",
2021
+ " ███╔╝ █████╗ ██╔██╗ ██║██║ ██║ ███████║",
2022
+ " ███╔╝ ██╔══╝ ██║╚██╗██║██║ ██║ ██╔══██║",
2023
+ " ███████╗███████╗██║ ╚████║██║ ██║ ██║ ██║",
2024
+ " ╚══════╝╚══════╝╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═╝ ╚═╝"
2025
+ ];
2026
+ var TAGLINE = "The Modern Reactive Web Framework";
2027
+ var LOGO = `
2028
+ ${import_picocolors.default.cyan("╔" + "═".repeat(55) + "╗")}
2029
+ ${import_picocolors.default.cyan("║")}${" ".repeat(55)}${import_picocolors.default.cyan("║")}
2030
+ ${LOGO_LINES.map((line) => `${import_picocolors.default.cyan("║")} ${zenithGradient(line)} ${import_picocolors.default.cyan("║")}`).join(`
2031
+ `)}
2032
+ ${import_picocolors.default.cyan("║")}${" ".repeat(55)}${import_picocolors.default.cyan("║")}
2033
+ ${import_picocolors.default.cyan("║")}${" ".repeat(10)}${import_picocolors.default.dim(TAGLINE)}${" ".repeat(10)}${import_picocolors.default.cyan("║")}
2034
+ ${import_picocolors.default.cyan("║")}${" ".repeat(55)}${import_picocolors.default.cyan("║")}
2035
+ ${import_picocolors.default.cyan("╚" + "═".repeat(55) + "╝")}
2036
+ `;
2037
+ var LOGO_COMPACT = `
2038
+ ${import_picocolors.default.bold(zenithGradient("⚡ ZENITH"))} ${import_picocolors.default.dim("- Modern Reactive Framework")}
2039
+ `;
2040
+ function sleep(ms) {
2041
+ return new Promise((resolve) => setTimeout(resolve, ms));
2042
+ }
2043
+ async function animateLogo() {
2044
+ if (!isTTY()) {
2045
+ showLogo();
2046
+ return;
2047
+ }
2048
+ console.clear();
2049
+ console.log(import_picocolors.default.cyan("╔" + "═".repeat(55) + "╗"));
2050
+ console.log(import_picocolors.default.cyan("║") + " ".repeat(55) + import_picocolors.default.cyan("║"));
2051
+ for (let i = 0;i < LOGO_LINES.length; i++) {
2052
+ const line = LOGO_LINES[i];
2053
+ process.stdout.write(import_picocolors.default.cyan("║") + " ");
2054
+ const chars = [...line];
2055
+ const chunkSize = Math.ceil(chars.length / 8);
2056
+ for (let j = 0;j < chars.length; j += chunkSize) {
2057
+ const chunk = chars.slice(j, j + chunkSize).join("");
2058
+ process.stdout.write(zenithGradient(chunk));
2059
+ await sleep(30);
2060
+ }
2061
+ console.log(" " + import_picocolors.default.cyan("║"));
2062
+ }
2063
+ console.log(import_picocolors.default.cyan("║") + " ".repeat(55) + import_picocolors.default.cyan("║"));
2064
+ process.stdout.write(import_picocolors.default.cyan("║") + " ".repeat(10));
2065
+ const taglineChars = [...TAGLINE];
2066
+ for (let i = 0;i < taglineChars.length; i += 4) {
2067
+ const chunk = taglineChars.slice(i, i + 4).join("");
2068
+ process.stdout.write(import_picocolors.default.dim(chunk));
2069
+ await sleep(20);
2070
+ }
2071
+ console.log(" ".repeat(10) + import_picocolors.default.cyan("║"));
2072
+ console.log(import_picocolors.default.cyan("║") + " ".repeat(55) + import_picocolors.default.cyan("║"));
2073
+ console.log(import_picocolors.default.cyan("╚" + "═".repeat(55) + "╝"));
2074
+ await sleep(150);
2075
+ }
2076
+ function showLogo() {
2077
+ console.log(LOGO);
2078
+ }
2079
+ function showCompactLogo() {
2080
+ console.log(LOGO_COMPACT);
2081
+ }
2082
+ async function showCompletionAnimation() {
2083
+ if (!isTTY()) {
2084
+ console.log(`${import_picocolors.default.green("✓")} ${import_picocolors.default.bold("Done!")}`);
2085
+ return;
2086
+ }
2087
+ const frames = ["✓", "✨", "✓", "✨", "✓"];
2088
+ const colors2 = [import_picocolors.default.green, import_picocolors.default.yellow, import_picocolors.default.green, import_picocolors.default.yellow, import_picocolors.default.green];
2089
+ for (let i = 0;i < frames.length; i++) {
2090
+ process.stdout.write(`\r${colors2[i](frames[i])} ${import_picocolors.default.bold("Done!")}`);
2091
+ await sleep(100);
2092
+ }
2093
+ console.log();
2094
+ }
2095
+ function error(text) {
2096
+ console.log(`${import_picocolors.default.red("✗")} ${text}`);
2097
+ }
2098
+ function warn(text) {
2099
+ console.log(`${import_picocolors.default.yellow("⚠")} ${text}`);
2100
+ }
2101
+ function bold(text) {
2102
+ return import_picocolors.default.bold(text);
2103
+ }
2104
+ function showNextSteps(projectName, packageManager = "bun") {
2105
+ const pm = packageManager;
2106
+ const runCmd = pm === "npm" ? "npm run dev" : `${pm} run dev`;
2107
+ const cdLine = `cd ${projectName}`;
2108
+ const maxLineLen = 45;
2109
+ const cdPadding = Math.max(1, maxLineLen - cdLine.length - 6);
2110
+ const runPadding = Math.max(1, maxLineLen - runCmd.length - 6);
2111
+ console.log(`
2112
+ ${import_picocolors.default.cyan("┌" + "─".repeat(50) + "┐")}
2113
+ ${import_picocolors.default.cyan("│")}${" ".repeat(50)}${import_picocolors.default.cyan("│")}
2114
+ ${import_picocolors.default.cyan("│")} ${import_picocolors.default.green("✨")} ${zenithGradient.multiline(import_picocolors.default.bold("Your Zenith app is ready!"))}${" ".repeat(17)}${import_picocolors.default.cyan("│")}
2115
+ ${import_picocolors.default.cyan("│")}${" ".repeat(50)}${import_picocolors.default.cyan("│")}
2116
+ ${import_picocolors.default.cyan("│")} ${import_picocolors.default.dim("Next steps:")}${" ".repeat(36)}${import_picocolors.default.cyan("│")}
2117
+ ${import_picocolors.default.cyan("│")}${" ".repeat(50)}${import_picocolors.default.cyan("│")}
2118
+ ${import_picocolors.default.cyan("│")} ${import_picocolors.default.cyan("$")} ${import_picocolors.default.bold(cdLine)}${" ".repeat(cdPadding)}${import_picocolors.default.cyan("│")}
2119
+ ${import_picocolors.default.cyan("│")} ${import_picocolors.default.cyan("$")} ${import_picocolors.default.bold(runCmd)}${" ".repeat(runPadding)}${import_picocolors.default.cyan("│")}
2120
+ ${import_picocolors.default.cyan("│")}${" ".repeat(50)}${import_picocolors.default.cyan("│")}
2121
+ ${import_picocolors.default.cyan("│")} ${import_picocolors.default.dim("Then open")} ${import_picocolors.default.underline(import_picocolors.default.blue("http://localhost:3000"))}${" ".repeat(9)}${import_picocolors.default.cyan("│")}
2122
+ ${import_picocolors.default.cyan("│")}${" ".repeat(50)}${import_picocolors.default.cyan("│")}
2123
+ ${import_picocolors.default.cyan("└" + "─".repeat(50) + "┘")}
2124
+ `);
2125
+ }
2126
+
2127
+ // node_modules/@clack/core/dist/index.mjs
2128
+ var import_sisteransi = __toESM(require_src(), 1);
2129
+ var import_picocolors2 = __toESM(require_picocolors(), 1);
2130
+ import { stdin as j, stdout as M } from "node:process";
2131
+ import * as g from "node:readline";
2132
+ import O from "node:readline";
2133
+ import { Writable as X } from "node:stream";
2134
+ function DD({ onlyFirst: e = false } = {}) {
2135
+ const t = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
2136
+ return new RegExp(t, e ? undefined : "g");
2137
+ }
2138
+ var uD = DD();
2139
+ function P(e) {
2140
+ if (typeof e != "string")
2141
+ throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);
2142
+ return e.replace(uD, "");
2143
+ }
2144
+ function L(e) {
2145
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
2146
+ }
2147
+ var W = { exports: {} };
2148
+ (function(e) {
2149
+ var u = {};
2150
+ e.exports = u, u.eastAsianWidth = function(F) {
2151
+ var s = F.charCodeAt(0), i = F.length == 2 ? F.charCodeAt(1) : 0, D = s;
2152
+ return 55296 <= s && s <= 56319 && 56320 <= i && i <= 57343 && (s &= 1023, i &= 1023, D = s << 10 | i, 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";
2153
+ }, u.characterLength = function(F) {
2154
+ var s = this.eastAsianWidth(F);
2155
+ return s == "F" || s == "W" || s == "A" ? 2 : 1;
2156
+ };
2157
+ function t(F) {
2158
+ return F.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
2159
+ }
2160
+ u.length = function(F) {
2161
+ for (var s = t(F), i = 0, D = 0;D < s.length; D++)
2162
+ i = i + this.characterLength(s[D]);
2163
+ return i;
2164
+ }, u.slice = function(F, s, i) {
2165
+ textLen = u.length(F), s = s || 0, i = i || 1, s < 0 && (s = textLen + s), i < 0 && (i = textLen + i);
2166
+ for (var D = "", C = 0, n = t(F), E = 0;E < n.length; E++) {
2167
+ var a = n[E], o = u.length(a);
2168
+ if (C >= s - (o == 2 ? 1 : 0))
2169
+ if (C + o <= i)
2170
+ D += a;
2171
+ else
2172
+ break;
2173
+ C += o;
2174
+ }
2175
+ return D;
2176
+ };
2177
+ })(W);
2178
+ var tD = W.exports;
2179
+ var eD = L(tD);
2180
+ var FD = function() {
2181
+ 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;
2182
+ };
2183
+ var sD = L(FD);
2184
+ function p(e, u = {}) {
2185
+ if (typeof e != "string" || e.length === 0 || (u = { ambiguousIsNarrow: true, ...u }, e = P(e), e.length === 0))
2186
+ return 0;
2187
+ e = e.replace(sD(), " ");
2188
+ const t = u.ambiguousIsNarrow ? 1 : 2;
2189
+ let F = 0;
2190
+ for (const s of e) {
2191
+ const i = s.codePointAt(0);
2192
+ if (i <= 31 || i >= 127 && i <= 159 || i >= 768 && i <= 879)
2193
+ continue;
2194
+ switch (eD.eastAsianWidth(s)) {
2195
+ case "F":
2196
+ case "W":
2197
+ F += 2;
2198
+ break;
2199
+ case "A":
2200
+ F += t;
2201
+ break;
2202
+ default:
2203
+ F += 1;
2204
+ }
2205
+ }
2206
+ return F;
2207
+ }
2208
+ var w = 10;
2209
+ var N = (e = 0) => (u) => `\x1B[${u + e}m`;
2210
+ var I = (e = 0) => (u) => `\x1B[${38 + e};5;${u}m`;
2211
+ var R = (e = 0) => (u, t, F) => `\x1B[${38 + e};2;${u};${t};${F}m`;
2212
+ var 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] } };
2213
+ Object.keys(r.modifier);
2214
+ var iD = Object.keys(r.color);
2215
+ var CD = Object.keys(r.bgColor);
2216
+ [...iD, ...CD];
2217
+ function rD() {
2218
+ const e = new Map;
2219
+ for (const [u, t] of Object.entries(r)) {
2220
+ for (const [F, s] of Object.entries(t))
2221
+ r[F] = { open: `\x1B[${s[0]}m`, close: `\x1B[${s[1]}m` }, t[F] = r[F], e.set(s[0], s[1]);
2222
+ Object.defineProperty(r, u, { value: t, enumerable: false });
2223
+ }
2224
+ return Object.defineProperty(r, "codes", { value: e, enumerable: false }), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi = N(), r.color.ansi256 = I(), r.color.ansi16m = R(), r.bgColor.ansi = N(w), r.bgColor.ansi256 = I(w), r.bgColor.ansi16m = R(w), Object.defineProperties(r, { rgbToAnsi256: { value: (u, t, F) => u === t && t === F ? u < 8 ? 16 : u > 248 ? 231 : Math.round((u - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u / 255 * 5) + 6 * Math.round(t / 255 * 5) + Math.round(F / 255 * 5), enumerable: false }, hexToRgb: { value: (u) => {
2225
+ const t = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));
2226
+ if (!t)
2227
+ return [0, 0, 0];
2228
+ let [F] = t;
2229
+ F.length === 3 && (F = [...F].map((i) => i + i).join(""));
2230
+ const s = Number.parseInt(F, 16);
2231
+ return [s >> 16 & 255, s >> 8 & 255, s & 255];
2232
+ }, enumerable: false }, hexToAnsi256: { value: (u) => r.rgbToAnsi256(...r.hexToRgb(u)), enumerable: false }, ansi256ToAnsi: { value: (u) => {
2233
+ if (u < 8)
2234
+ return 30 + u;
2235
+ if (u < 16)
2236
+ return 90 + (u - 8);
2237
+ let t, F, s;
2238
+ if (u >= 232)
2239
+ t = ((u - 232) * 10 + 8) / 255, F = t, s = t;
2240
+ else {
2241
+ u -= 16;
2242
+ const C = u % 36;
2243
+ t = Math.floor(u / 36) / 5, F = Math.floor(C / 6) / 5, s = C % 6 / 5;
2244
+ }
2245
+ const i = Math.max(t, F, s) * 2;
2246
+ if (i === 0)
2247
+ return 30;
2248
+ let D = 30 + (Math.round(s) << 2 | Math.round(F) << 1 | Math.round(t));
2249
+ return i === 2 && (D += 60), D;
2250
+ }, enumerable: false }, rgbToAnsi: { value: (u, t, F) => r.ansi256ToAnsi(r.rgbToAnsi256(u, t, F)), enumerable: false }, hexToAnsi: { value: (u) => r.ansi256ToAnsi(r.hexToAnsi256(u)), enumerable: false } }), r;
2251
+ }
2252
+ var ED = rD();
2253
+ var d = new Set(["\x1B", "›"]);
2254
+ var oD = 39;
2255
+ var y = "\x07";
2256
+ var V = "[";
2257
+ var nD = "]";
2258
+ var G = "m";
2259
+ var _ = `${nD}8;;`;
2260
+ var z = (e) => `${d.values().next().value}${V}${e}${G}`;
2261
+ var K = (e) => `${d.values().next().value}${_}${e}${y}`;
2262
+ var aD = (e) => e.split(" ").map((u) => p(u));
2263
+ var k = (e, u, t) => {
2264
+ const F = [...u];
2265
+ let s = false, i = false, D = p(P(e[e.length - 1]));
2266
+ for (const [C, n] of F.entries()) {
2267
+ const E = p(n);
2268
+ if (D + E <= t ? e[e.length - 1] += n : (e.push(n), D = 0), d.has(n) && (s = true, i = F.slice(C + 1).join("").startsWith(_)), s) {
2269
+ i ? n === y && (s = false, i = false) : n === G && (s = false);
2270
+ continue;
2271
+ }
2272
+ D += E, D === t && C < F.length - 1 && (e.push(""), D = 0);
2273
+ }
2274
+ !D && e[e.length - 1].length > 0 && e.length > 1 && (e[e.length - 2] += e.pop());
2275
+ };
2276
+ var hD = (e) => {
2277
+ const u = e.split(" ");
2278
+ let t = u.length;
2279
+ for (;t > 0 && !(p(u[t - 1]) > 0); )
2280
+ t--;
2281
+ return t === u.length ? e : u.slice(0, t).join(" ") + u.slice(t).join("");
2282
+ };
2283
+ var lD = (e, u, t = {}) => {
2284
+ if (t.trim !== false && e.trim() === "")
2285
+ return "";
2286
+ let F = "", s, i;
2287
+ const D = aD(e);
2288
+ let C = [""];
2289
+ for (const [E, a] of e.split(" ").entries()) {
2290
+ t.trim !== false && (C[C.length - 1] = C[C.length - 1].trimStart());
2291
+ let o = p(C[C.length - 1]);
2292
+ if (E !== 0 && (o >= u && (t.wordWrap === false || t.trim === false) && (C.push(""), o = 0), (o > 0 || t.trim === false) && (C[C.length - 1] += " ", o++)), t.hard && D[E] > u) {
2293
+ const c = u - o, f = 1 + Math.floor((D[E] - c - 1) / u);
2294
+ Math.floor((D[E] - 1) / u) < f && C.push(""), k(C, a, u);
2295
+ continue;
2296
+ }
2297
+ if (o + D[E] > u && o > 0 && D[E] > 0) {
2298
+ if (t.wordWrap === false && o < u) {
2299
+ k(C, a, u);
2300
+ continue;
2301
+ }
2302
+ C.push("");
2303
+ }
2304
+ if (o + D[E] > u && t.wordWrap === false) {
2305
+ k(C, a, u);
2306
+ continue;
2307
+ }
2308
+ C[C.length - 1] += a;
2309
+ }
2310
+ t.trim !== false && (C = C.map((E) => hD(E)));
2311
+ const n = [...C.join(`
2312
+ `)];
2313
+ for (const [E, a] of n.entries()) {
2314
+ if (F += a, d.has(a)) {
2315
+ const { groups: c } = new RegExp(`(?:\\${V}(?<code>\\d+)m|\\${_}(?<uri>.*)${y})`).exec(n.slice(E).join("")) || { groups: {} };
2316
+ if (c.code !== undefined) {
2317
+ const f = Number.parseFloat(c.code);
2318
+ s = f === oD ? undefined : f;
2319
+ } else
2320
+ c.uri !== undefined && (i = c.uri.length === 0 ? undefined : c.uri);
2321
+ }
2322
+ const o = ED.codes.get(Number(s));
2323
+ n[E + 1] === `
2324
+ ` ? (i && (F += K("")), s && o && (F += z(o))) : a === `
2325
+ ` && (s && o && (F += z(s)), i && (F += K(i)));
2326
+ }
2327
+ return F;
2328
+ };
2329
+ function Y(e, u, t) {
2330
+ return String(e).normalize().replace(/\r\n/g, `
2331
+ `).split(`
2332
+ `).map((F) => lD(F, u, t)).join(`
2333
+ `);
2334
+ }
2335
+ var xD = ["up", "down", "left", "right", "space", "enter", "cancel"];
2336
+ var B = { actions: new Set(xD), aliases: new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["\x03", "cancel"], ["escape", "cancel"]]) };
2337
+ function $(e, u) {
2338
+ if (typeof e == "string")
2339
+ return B.aliases.get(e) === u;
2340
+ for (const t of e)
2341
+ if (t !== undefined && $(t, u))
2342
+ return true;
2343
+ return false;
2344
+ }
2345
+ function BD(e, u) {
2346
+ if (e === u)
2347
+ return;
2348
+ const t = e.split(`
2349
+ `), F = u.split(`
2350
+ `), s = [];
2351
+ for (let i = 0;i < Math.max(t.length, F.length); i++)
2352
+ t[i] !== F[i] && s.push(i);
2353
+ return s;
2354
+ }
2355
+ var AD = globalThis.process.platform.startsWith("win");
2356
+ var S = Symbol("clack:cancel");
2357
+ function pD(e) {
2358
+ return e === S;
2359
+ }
2360
+ function m(e, u) {
2361
+ const t = e;
2362
+ t.isTTY && t.setRawMode(u);
2363
+ }
2364
+ function fD({ input: e = j, output: u = M, overwrite: t = true, hideCursor: F = true } = {}) {
2365
+ const s = g.createInterface({ input: e, output: u, prompt: "", tabSize: 1 });
2366
+ g.emitKeypressEvents(e, s), e.isTTY && e.setRawMode(true);
2367
+ const i = (D, { name: C, sequence: n }) => {
2368
+ const E = String(D);
2369
+ if ($([E, C, n], "cancel")) {
2370
+ F && u.write(import_sisteransi.cursor.show), process.exit(0);
2371
+ return;
2372
+ }
2373
+ if (!t)
2374
+ return;
2375
+ const a = C === "return" ? 0 : -1, o = C === "return" ? -1 : 0;
2376
+ g.moveCursor(u, a, o, () => {
2377
+ g.clearLine(u, 1, () => {
2378
+ e.once("keypress", i);
2379
+ });
2380
+ });
2381
+ };
2382
+ return F && u.write(import_sisteransi.cursor.hide), e.once("keypress", i), () => {
2383
+ e.off("keypress", i), F && u.write(import_sisteransi.cursor.show), e.isTTY && !AD && e.setRawMode(false), s.terminal = false, s.close();
2384
+ };
2385
+ }
2386
+ var gD = Object.defineProperty;
2387
+ var vD = (e, u, t) => (u in e) ? gD(e, u, { enumerable: true, configurable: true, writable: true, value: t }) : e[u] = t;
2388
+ var h = (e, u, t) => (vD(e, typeof u != "symbol" ? u + "" : u, t), t);
2389
+
2390
+ class x {
2391
+ constructor(u, t = true) {
2392
+ h(this, "input"), h(this, "output"), h(this, "_abortSignal"), h(this, "rl"), h(this, "opts"), h(this, "_render"), h(this, "_track", false), h(this, "_prevFrame", ""), h(this, "_subscribers", new Map), h(this, "_cursor", 0), h(this, "state", "initial"), h(this, "error", ""), h(this, "value");
2393
+ const { input: F = j, output: s = M, render: i, signal: D, ...C } = u;
2394
+ this.opts = C, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = i.bind(this), this._track = t, this._abortSignal = D, this.input = F, this.output = s;
2395
+ }
2396
+ unsubscribe() {
2397
+ this._subscribers.clear();
2398
+ }
2399
+ setSubscriber(u, t) {
2400
+ const F = this._subscribers.get(u) ?? [];
2401
+ F.push(t), this._subscribers.set(u, F);
2402
+ }
2403
+ on(u, t) {
2404
+ this.setSubscriber(u, { cb: t });
2405
+ }
2406
+ once(u, t) {
2407
+ this.setSubscriber(u, { cb: t, once: true });
2408
+ }
2409
+ emit(u, ...t) {
2410
+ const F = this._subscribers.get(u) ?? [], s = [];
2411
+ for (const i of F)
2412
+ i.cb(...t), i.once && s.push(() => F.splice(F.indexOf(i), 1));
2413
+ for (const i of s)
2414
+ i();
2415
+ }
2416
+ prompt() {
2417
+ return new Promise((u, t) => {
2418
+ if (this._abortSignal) {
2419
+ if (this._abortSignal.aborted)
2420
+ return this.state = "cancel", this.close(), u(S);
2421
+ this._abortSignal.addEventListener("abort", () => {
2422
+ this.state = "cancel", this.close();
2423
+ }, { once: true });
2424
+ }
2425
+ const F = new X;
2426
+ F._write = (s, i, D) => {
2427
+ this._track && (this.value = this.rl?.line.replace(/\t/g, ""), this._cursor = this.rl?.cursor ?? 0, this.emit("value", this.value)), D();
2428
+ }, this.input.pipe(F), this.rl = O.createInterface({ input: this.input, output: F, tabSize: 2, prompt: "", escapeCodeTimeout: 50, terminal: true }), O.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), m(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
2429
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), m(this.input, false), u(this.value);
2430
+ }), this.once("cancel", () => {
2431
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), m(this.input, false), u(S);
2432
+ });
2433
+ });
2434
+ }
2435
+ onKeypress(u, t) {
2436
+ if (this.state === "error" && (this.state = "active"), t?.name && (!this._track && B.aliases.has(t.name) && this.emit("cursor", B.aliases.get(t.name)), B.actions.has(t.name) && this.emit("cursor", t.name)), u && (u.toLowerCase() === "y" || u.toLowerCase() === "n") && this.emit("confirm", u.toLowerCase() === "y"), u === "\t" && this.opts.placeholder && (this.value || (this.rl?.write(this.opts.placeholder), this.emit("value", this.opts.placeholder))), u && this.emit("key", u.toLowerCase()), t?.name === "return") {
2437
+ if (this.opts.validate) {
2438
+ const F = this.opts.validate(this.value);
2439
+ F && (this.error = F instanceof Error ? F.message : F, this.state = "error", this.rl?.write(this.value));
2440
+ }
2441
+ this.state !== "error" && (this.state = "submit");
2442
+ }
2443
+ $([u, t?.name, t?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
2444
+ }
2445
+ close() {
2446
+ this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
2447
+ `), m(this.input, false), this.rl?.close(), this.rl = undefined, this.emit(`${this.state}`, this.value), this.unsubscribe();
2448
+ }
2449
+ restoreCursor() {
2450
+ const u = Y(this._prevFrame, process.stdout.columns, { hard: true }).split(`
2451
+ `).length - 1;
2452
+ this.output.write(import_sisteransi.cursor.move(-999, u * -1));
2453
+ }
2454
+ render() {
2455
+ const u = Y(this._render(this) ?? "", process.stdout.columns, { hard: true });
2456
+ if (u !== this._prevFrame) {
2457
+ if (this.state === "initial")
2458
+ this.output.write(import_sisteransi.cursor.hide);
2459
+ else {
2460
+ const t = BD(this._prevFrame, u);
2461
+ if (this.restoreCursor(), t && t?.length === 1) {
2462
+ const F = t[0];
2463
+ this.output.write(import_sisteransi.cursor.move(0, F)), this.output.write(import_sisteransi.erase.lines(1));
2464
+ const s = u.split(`
2465
+ `);
2466
+ this.output.write(s[F]), this._prevFrame = u, this.output.write(import_sisteransi.cursor.move(0, s.length - F - 1));
2467
+ return;
2468
+ }
2469
+ if (t && t?.length > 1) {
2470
+ const F = t[0];
2471
+ this.output.write(import_sisteransi.cursor.move(0, F)), this.output.write(import_sisteransi.erase.down());
2472
+ const s = u.split(`
2473
+ `).slice(F);
2474
+ this.output.write(s.join(`
2475
+ `)), this._prevFrame = u;
2476
+ return;
2477
+ }
2478
+ this.output.write(import_sisteransi.erase.down());
2479
+ }
2480
+ this.output.write(u), this.state === "initial" && (this.state = "active"), this._prevFrame = u;
2481
+ }
2482
+ }
2483
+ }
2484
+
2485
+ class dD extends x {
2486
+ get cursor() {
2487
+ return this.value ? 0 : 1;
2488
+ }
2489
+ get _value() {
2490
+ return this.cursor === 0;
2491
+ }
2492
+ constructor(u) {
2493
+ super(u, false), this.value = !!u.initialValue, this.on("value", () => {
2494
+ this.value = this._value;
2495
+ }), this.on("confirm", (t) => {
2496
+ this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = t, this.state = "submit", this.close();
2497
+ }), this.on("cursor", () => {
2498
+ this.value = !this.value;
2499
+ });
2500
+ }
2501
+ }
2502
+ var A;
2503
+ A = new WeakMap;
2504
+ class RD extends x {
2505
+ get valueWithCursor() {
2506
+ if (this.state === "submit")
2507
+ return this.value;
2508
+ if (this.cursor >= this.value.length)
2509
+ return `${this.value}█`;
2510
+ const u = this.value.slice(0, this.cursor), [t, ...F] = this.value.slice(this.cursor);
2511
+ return `${u}${import_picocolors2.default.inverse(t)}${F.join("")}`;
2512
+ }
2513
+ get cursor() {
2514
+ return this._cursor;
2515
+ }
2516
+ constructor(u) {
2517
+ super(u), this.on("finalize", () => {
2518
+ this.value || (this.value = u.defaultValue);
2519
+ });
2520
+ }
2521
+ }
2522
+
2523
+ // node_modules/@clack/prompts/dist/index.mjs
2524
+ var import_picocolors3 = __toESM(require_picocolors(), 1);
2525
+ var import_sisteransi2 = __toESM(require_src(), 1);
2526
+ import y2 from "node:process";
2527
+ function ce() {
2528
+ return y2.platform !== "win32" ? y2.env.TERM !== "linux" : !!y2.env.CI || !!y2.env.WT_SESSION || !!y2.env.TERMINUS_SUBLIME || y2.env.ConEmuTask === "{cmd::Cmder}" || y2.env.TERM_PROGRAM === "Terminus-Sublime" || y2.env.TERM_PROGRAM === "vscode" || y2.env.TERM === "xterm-256color" || y2.env.TERM === "alacritty" || y2.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
2529
+ }
2530
+ var V2 = ce();
2531
+ var u = (t, n) => V2 ? t : n;
2532
+ var le = u("◆", "*");
2533
+ var L2 = u("■", "x");
2534
+ var W2 = u("▲", "x");
2535
+ var C = u("◇", "o");
2536
+ var ue = u("┌", "T");
2537
+ var o = u("│", "|");
2538
+ var d2 = u("└", "—");
2539
+ var k2 = u("●", ">");
2540
+ var P2 = u("○", " ");
2541
+ var A2 = u("◻", "[•]");
2542
+ var T = u("◼", "[+]");
2543
+ var F = u("◻", "[ ]");
2544
+ var $e = u("▪", "•");
2545
+ var _2 = u("─", "-");
2546
+ var me = u("╮", "+");
2547
+ var de = u("├", "+");
2548
+ var pe = u("╯", "+");
2549
+ var q = u("●", "•");
2550
+ var D = u("◆", "*");
2551
+ var U = u("▲", "!");
2552
+ var K2 = u("■", "x");
2553
+ var b2 = (t) => {
2554
+ switch (t) {
2555
+ case "initial":
2556
+ case "active":
2557
+ return import_picocolors3.default.cyan(le);
2558
+ case "cancel":
2559
+ return import_picocolors3.default.red(L2);
2560
+ case "error":
2561
+ return import_picocolors3.default.yellow(W2);
2562
+ case "submit":
2563
+ return import_picocolors3.default.green(C);
2564
+ }
2565
+ };
2566
+ var he = (t) => new RD({ validate: t.validate, placeholder: t.placeholder, defaultValue: t.defaultValue, initialValue: t.initialValue, render() {
2567
+ const n = `${import_picocolors3.default.gray(o)}
2568
+ ${b2(this.state)} ${t.message}
2569
+ `, r2 = t.placeholder ? import_picocolors3.default.inverse(t.placeholder[0]) + import_picocolors3.default.dim(t.placeholder.slice(1)) : import_picocolors3.default.inverse(import_picocolors3.default.hidden("_")), i = this.value ? this.valueWithCursor : r2;
2570
+ switch (this.state) {
2571
+ case "error":
2572
+ return `${n.trim()}
2573
+ ${import_picocolors3.default.yellow(o)} ${i}
2574
+ ${import_picocolors3.default.yellow(d2)} ${import_picocolors3.default.yellow(this.error)}
2575
+ `;
2576
+ case "submit":
2577
+ return `${n}${import_picocolors3.default.gray(o)} ${import_picocolors3.default.dim(this.value || t.placeholder)}`;
2578
+ case "cancel":
2579
+ return `${n}${import_picocolors3.default.gray(o)} ${import_picocolors3.default.strikethrough(import_picocolors3.default.dim(this.value ?? ""))}${this.value?.trim() ? `
2580
+ ${import_picocolors3.default.gray(o)}` : ""}`;
2581
+ default:
2582
+ return `${n}${import_picocolors3.default.cyan(o)} ${i}
2583
+ ${import_picocolors3.default.cyan(d2)}
2584
+ `;
2585
+ }
2586
+ } }).prompt();
2587
+ var ye = (t) => {
2588
+ const n = t.active ?? "Yes", r2 = t.inactive ?? "No";
2589
+ return new dD({ active: n, inactive: r2, initialValue: t.initialValue ?? true, render() {
2590
+ const i = `${import_picocolors3.default.gray(o)}
2591
+ ${b2(this.state)} ${t.message}
2592
+ `, s = this.value ? n : r2;
2593
+ switch (this.state) {
2594
+ case "submit":
2595
+ return `${i}${import_picocolors3.default.gray(o)} ${import_picocolors3.default.dim(s)}`;
2596
+ case "cancel":
2597
+ return `${i}${import_picocolors3.default.gray(o)} ${import_picocolors3.default.strikethrough(import_picocolors3.default.dim(s))}
2598
+ ${import_picocolors3.default.gray(o)}`;
2599
+ default:
2600
+ return `${i}${import_picocolors3.default.cyan(o)} ${this.value ? `${import_picocolors3.default.green(k2)} ${n}` : `${import_picocolors3.default.dim(P2)} ${import_picocolors3.default.dim(n)}`} ${import_picocolors3.default.dim("/")} ${this.value ? `${import_picocolors3.default.dim(P2)} ${import_picocolors3.default.dim(r2)}` : `${import_picocolors3.default.green(k2)} ${r2}`}
2601
+ ${import_picocolors3.default.cyan(d2)}
2602
+ `;
2603
+ }
2604
+ } }).prompt();
2605
+ };
2606
+ var xe = (t = "") => {
2607
+ process.stdout.write(`${import_picocolors3.default.gray(d2)} ${import_picocolors3.default.red(t)}
2608
+
2609
+ `);
2610
+ };
2611
+ var Ie = (t = "") => {
2612
+ process.stdout.write(`${import_picocolors3.default.gray(ue)} ${t}
2613
+ `);
2614
+ };
2615
+ var M2 = { message: (t = "", { symbol: n = import_picocolors3.default.gray(o) } = {}) => {
2616
+ const r2 = [`${import_picocolors3.default.gray(o)}`];
2617
+ if (t) {
2618
+ const [i, ...s] = t.split(`
2619
+ `);
2620
+ r2.push(`${n} ${i}`, ...s.map((c) => `${import_picocolors3.default.gray(o)} ${c}`));
2621
+ }
2622
+ process.stdout.write(`${r2.join(`
2623
+ `)}
2624
+ `);
2625
+ }, info: (t) => {
2626
+ M2.message(t, { symbol: import_picocolors3.default.blue(q) });
2627
+ }, success: (t) => {
2628
+ M2.message(t, { symbol: import_picocolors3.default.green(D) });
2629
+ }, step: (t) => {
2630
+ M2.message(t, { symbol: import_picocolors3.default.green(C) });
2631
+ }, warn: (t) => {
2632
+ M2.message(t, { symbol: import_picocolors3.default.yellow(U) });
2633
+ }, warning: (t) => {
2634
+ M2.warn(t);
2635
+ }, error: (t) => {
2636
+ M2.message(t, { symbol: import_picocolors3.default.red(K2) });
2637
+ } };
2638
+ var J = `${import_picocolors3.default.gray(o)} `;
2639
+ var Y2 = ({ indicator: t = "dots" } = {}) => {
2640
+ const n = V2 ? ["◒", "◐", "◓", "◑"] : ["•", "o", "O", "0"], r2 = V2 ? 80 : 120, i = process.env.CI === "true";
2641
+ let s, c, a = false, l2 = "", $2, g2 = performance.now();
2642
+ const p2 = (m2) => {
2643
+ const h2 = m2 > 1 ? "Something went wrong" : "Canceled";
2644
+ a && N2(h2, m2);
2645
+ }, v2 = () => p2(2), f = () => p2(1), j2 = () => {
2646
+ process.on("uncaughtExceptionMonitor", v2), process.on("unhandledRejection", v2), process.on("SIGINT", f), process.on("SIGTERM", f), process.on("exit", p2);
2647
+ }, E = () => {
2648
+ process.removeListener("uncaughtExceptionMonitor", v2), process.removeListener("unhandledRejection", v2), process.removeListener("SIGINT", f), process.removeListener("SIGTERM", f), process.removeListener("exit", p2);
2649
+ }, B2 = () => {
2650
+ if ($2 === undefined)
2651
+ return;
2652
+ i && process.stdout.write(`
2653
+ `);
2654
+ const m2 = $2.split(`
2655
+ `);
2656
+ process.stdout.write(import_sisteransi2.cursor.move(-999, m2.length - 1)), process.stdout.write(import_sisteransi2.erase.down(m2.length));
2657
+ }, R2 = (m2) => m2.replace(/\.+$/, ""), O2 = (m2) => {
2658
+ const h2 = (performance.now() - m2) / 1000, w2 = Math.floor(h2 / 60), I2 = Math.floor(h2 % 60);
2659
+ return w2 > 0 ? `[${w2}m ${I2}s]` : `[${I2}s]`;
2660
+ }, H = (m2 = "") => {
2661
+ a = true, s = fD(), l2 = R2(m2), g2 = performance.now(), process.stdout.write(`${import_picocolors3.default.gray(o)}
2662
+ `);
2663
+ let h2 = 0, w2 = 0;
2664
+ j2(), c = setInterval(() => {
2665
+ if (i && l2 === $2)
2666
+ return;
2667
+ B2(), $2 = l2;
2668
+ const I2 = import_picocolors3.default.magenta(n[h2]);
2669
+ if (i)
2670
+ process.stdout.write(`${I2} ${l2}...`);
2671
+ else if (t === "timer")
2672
+ process.stdout.write(`${I2} ${l2} ${O2(g2)}`);
2673
+ else {
2674
+ const z2 = ".".repeat(Math.floor(w2)).slice(0, 3);
2675
+ process.stdout.write(`${I2} ${l2}${z2}`);
2676
+ }
2677
+ h2 = h2 + 1 < n.length ? h2 + 1 : 0, w2 = w2 < n.length ? w2 + 0.125 : 0;
2678
+ }, r2);
2679
+ }, N2 = (m2 = "", h2 = 0) => {
2680
+ a = false, clearInterval(c), B2();
2681
+ const w2 = h2 === 0 ? import_picocolors3.default.green(C) : h2 === 1 ? import_picocolors3.default.red(L2) : import_picocolors3.default.red(W2);
2682
+ l2 = R2(m2 ?? l2), t === "timer" ? process.stdout.write(`${w2} ${l2} ${O2(g2)}
2683
+ `) : process.stdout.write(`${w2} ${l2}
2684
+ `), E(), s();
2685
+ };
2686
+ return { start: H, stop: N2, message: (m2 = "") => {
2687
+ l2 = R2(m2 ?? l2);
2688
+ } };
2689
+ };
2690
+
2691
+ // src/prompts.ts
2692
+ var import_picocolors4 = __toESM(require_picocolors(), 1);
2693
+ async function intro() {
2694
+ await animateLogo();
2695
+ console.log();
2696
+ Ie(import_picocolors4.default.bgCyan(import_picocolors4.default.black(" create-zenith ")));
2697
+ }
2698
+ async function text(opts) {
2699
+ if (!isTTY()) {
2700
+ return opts.defaultValue || "";
2701
+ }
2702
+ return await he({
2703
+ message: opts.message,
2704
+ placeholder: opts.placeholder,
2705
+ defaultValue: opts.defaultValue,
2706
+ validate: opts.validate
2707
+ });
2708
+ }
2709
+ async function confirm(opts) {
2710
+ if (!isTTY()) {
2711
+ return opts.initialValue ?? true;
2712
+ }
2713
+ return await ye({
2714
+ message: opts.message,
2715
+ initialValue: opts.initialValue ?? true
2716
+ });
2717
+ }
2718
+ function isCancel(value) {
2719
+ return pD(value);
2720
+ }
2721
+ function handleCancel() {
2722
+ xe("Operation cancelled.");
2723
+ process.exit(0);
2724
+ }
2725
+ function spinner() {
2726
+ return Y2();
2727
+ }
2728
+ async function outro(projectName, packageManager) {
2729
+ await showCompletionAnimation();
2730
+ showNextSteps(projectName, packageManager);
2731
+ }
2732
+ var log = {
2733
+ info: (message) => M2.info(message),
2734
+ success: (message) => M2.success(message),
2735
+ warn: (message) => M2.warn(message),
2736
+ error: (message) => M2.error(message),
2737
+ step: (message) => M2.step(message),
2738
+ message: (message) => M2.message(message)
2739
+ };
2740
+
2741
+ // src/index.ts
2742
+ var VERSION = "0.6.6";
2743
+ var GITHUB_REPO = "zenithbuild/create-zenith";
2744
+ var DEFAULT_TEMPLATE = "examples/starter";
2745
+ var TAILWIND_TEMPLATE = "examples/starter-tailwindcss";
2746
+ function detectPackageManager() {
2747
+ const userAgent = process.env.npm_config_user_agent || "";
2748
+ if (userAgent.includes("bun"))
2749
+ return "bun";
2750
+ if (userAgent.includes("pnpm"))
2751
+ return "pnpm";
2752
+ if (userAgent.includes("yarn"))
2753
+ return "yarn";
2754
+ if (userAgent.includes("npm"))
2755
+ return "npm";
2756
+ try {
2757
+ execSync("bun --version", { stdio: "pipe" });
2758
+ return "bun";
2759
+ } catch {
2760
+ try {
2761
+ execSync("pnpm --version", { stdio: "pipe" });
2762
+ return "pnpm";
2763
+ } catch {
2764
+ return "npm";
2765
+ }
2766
+ }
2767
+ }
2768
+ function hasGit() {
2769
+ try {
2770
+ execSync("git --version", { stdio: "pipe" });
2771
+ return true;
2772
+ } catch {
2773
+ return false;
2774
+ }
2775
+ }
2776
+ async function downloadTemplate(targetDir, templatePath) {
2777
+ const tempDir = path.join(os2.tmpdir(), `zenith-template-${Date.now()}`);
2778
+ try {
2779
+ if (hasGit()) {
2780
+ execSync(`git clone --depth 1 --filter=blob:none --sparse https://github.com/${GITHUB_REPO}.git "${tempDir}"`, {
2781
+ stdio: "pipe"
2782
+ });
2783
+ execSync(`git sparse-checkout set ${templatePath}`, {
2784
+ cwd: tempDir,
2785
+ stdio: "pipe"
2786
+ });
2787
+ const templateSource = path.join(tempDir, templatePath);
2788
+ fs.cpSync(templateSource, targetDir, { recursive: true });
2789
+ } else {
2790
+ const tarballUrl = `https://github.com/${GITHUB_REPO}/archive/refs/heads/main.tar.gz`;
2791
+ const tarballPath = path.join(os2.tmpdir(), `zenith-${Date.now()}.tar.gz`);
2792
+ execSync(`curl -sL "${tarballUrl}" -o "${tarballPath}"`, { stdio: "pipe" });
2793
+ fs.mkdirSync(tempDir, { recursive: true });
2794
+ execSync(`tar -xzf "${tarballPath}" -C "${tempDir}"`, { stdio: "pipe" });
2795
+ const extractedDir = fs.readdirSync(tempDir).find((f) => f.startsWith("create-zenith"));
2796
+ if (!extractedDir) {
2797
+ throw new Error("Failed to extract template from GitHub");
2798
+ }
2799
+ const templateSource = path.join(tempDir, extractedDir, templatePath);
2800
+ fs.cpSync(templateSource, targetDir, { recursive: true });
2801
+ fs.unlinkSync(tarballPath);
2802
+ }
2803
+ } finally {
2804
+ if (fs.existsSync(tempDir)) {
2805
+ fs.rmSync(tempDir, { recursive: true, force: true });
2806
+ }
2807
+ }
2808
+ }
2809
+ async function gatherOptions(providedName, withTailwind) {
2810
+ let name = providedName;
2811
+ if (!name) {
2812
+ const nameResult = await text({
2813
+ message: "What is your project named?",
2814
+ placeholder: "my-zenith-app",
2815
+ validate: (value) => {
2816
+ if (!value)
2817
+ return "Project name is required";
2818
+ if (fs.existsSync(path.resolve(process.cwd(), value))) {
2819
+ return `Directory "${value}" already exists`;
2820
+ }
2821
+ }
2822
+ });
2823
+ if (isCancel(nameResult)) {
2824
+ handleCancel();
2825
+ }
2826
+ name = nameResult;
2827
+ }
2828
+ if (!name) {
2829
+ error("Project name is required");
2830
+ console.log("");
2831
+ console.log("Usage: npx create-zenith <project-name>");
2832
+ console.log("");
2833
+ console.log("Examples:");
2834
+ console.log(" npx create-zenith my-app");
2835
+ console.log(" bunx create-zenith my-app");
2836
+ process.exit(1);
2837
+ }
2838
+ const targetDir = path.resolve(process.cwd(), name);
2839
+ if (fs.existsSync(targetDir)) {
2840
+ error(`Directory "${name}" already exists`);
2841
+ process.exit(1);
2842
+ }
2843
+ if (!isTTY()) {
2844
+ log.info("Non-interactive mode detected, using defaults...");
2845
+ return {
2846
+ name,
2847
+ eslint: true,
2848
+ prettier: true,
2849
+ pathAlias: true,
2850
+ tailwind: withTailwind ?? false
2851
+ };
2852
+ }
2853
+ const tailwindResult = withTailwind !== undefined ? withTailwind : await confirm({
2854
+ message: "Add Tailwind CSS for styling?",
2855
+ initialValue: true
2856
+ });
2857
+ if (isCancel(tailwindResult))
2858
+ handleCancel();
2859
+ const eslintResult = await confirm({
2860
+ message: "Add ESLint for code linting?",
2861
+ initialValue: true
2862
+ });
2863
+ if (isCancel(eslintResult))
2864
+ handleCancel();
2865
+ const prettierResult = await confirm({
2866
+ message: "Add Prettier for code formatting?",
2867
+ initialValue: true
2868
+ });
2869
+ if (isCancel(prettierResult))
2870
+ handleCancel();
2871
+ const pathAliasResult = await confirm({
2872
+ message: "Add TypeScript path alias (@/*)?",
2873
+ initialValue: true
2874
+ });
2875
+ if (isCancel(pathAliasResult))
2876
+ handleCancel();
2877
+ return {
2878
+ name,
2879
+ eslint: eslintResult,
2880
+ prettier: prettierResult,
2881
+ pathAlias: pathAliasResult,
2882
+ tailwind: tailwindResult
2883
+ };
2884
+ }
2885
+ async function createProject(options) {
2886
+ const targetDir = path.resolve(process.cwd(), options.name);
2887
+ const templatePath = options.tailwind ? TAILWIND_TEMPLATE : DEFAULT_TEMPLATE;
2888
+ await downloadTemplate(targetDir, templatePath);
2889
+ const pkgPath = path.join(targetDir, "package.json");
2890
+ if (fs.existsSync(pkgPath)) {
2891
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
2892
+ pkg.name = options.name;
2893
+ pkg.version = "0.1.0";
2894
+ if (!options.eslint) {
2895
+ delete pkg.devDependencies?.["eslint"];
2896
+ delete pkg.devDependencies?.["@typescript-eslint/eslint-plugin"];
2897
+ delete pkg.devDependencies?.["@typescript-eslint/parser"];
2898
+ delete pkg.scripts?.lint;
2899
+ const eslintPath = path.join(targetDir, ".eslintrc.json");
2900
+ if (fs.existsSync(eslintPath))
2901
+ fs.unlinkSync(eslintPath);
2902
+ }
2903
+ if (!options.prettier) {
2904
+ delete pkg.devDependencies?.["prettier"];
2905
+ delete pkg.scripts?.format;
2906
+ const prettierRc = path.join(targetDir, ".prettierrc");
2907
+ const prettierIgnore = path.join(targetDir, ".prettierignore");
2908
+ if (fs.existsSync(prettierRc))
2909
+ fs.unlinkSync(prettierRc);
2910
+ if (fs.existsSync(prettierIgnore))
2911
+ fs.unlinkSync(prettierIgnore);
2912
+ }
2913
+ fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 4));
2914
+ }
2915
+ const tsconfigPath = path.join(targetDir, "tsconfig.json");
2916
+ if (fs.existsSync(tsconfigPath)) {
2917
+ const tsconfig = JSON.parse(fs.readFileSync(tsconfigPath, "utf8"));
2918
+ if (options.pathAlias) {
2919
+ tsconfig.compilerOptions = tsconfig.compilerOptions || {};
2920
+ tsconfig.compilerOptions.baseUrl = ".";
2921
+ tsconfig.compilerOptions.paths = {
2922
+ "@/*": [`./src/*`]
2923
+ };
2924
+ } else if (tsconfig.compilerOptions?.paths) {
2925
+ delete tsconfig.compilerOptions.paths;
2926
+ }
2927
+ fs.writeFileSync(tsconfigPath, JSON.stringify(tsconfig, null, 4));
2928
+ }
2929
+ }
2930
+ async function create(appName, withTailwind) {
2931
+ await intro();
2932
+ const options = await gatherOptions(appName, withTailwind);
2933
+ console.log("");
2934
+ log.step(`Creating ${bold(options.name)}...`);
2935
+ const s = spinner();
2936
+ s.start("Downloading starter template...");
2937
+ try {
2938
+ await createProject(options);
2939
+ s.stop("Project created");
2940
+ s.start("Installing dependencies...");
2941
+ const targetDir = path.resolve(process.cwd(), options.name);
2942
+ const pm = detectPackageManager();
2943
+ try {
2944
+ execSync(`${pm} install`, {
2945
+ cwd: targetDir,
2946
+ stdio: "pipe"
2947
+ });
2948
+ s.stop("Dependencies installed");
2949
+ } catch {
2950
+ s.stop("Could not install dependencies automatically");
2951
+ warn(`Run "${pm} install" manually in the project directory`);
2952
+ }
2953
+ await outro(options.name, pm);
2954
+ } catch (err) {
2955
+ s.stop("Failed to create project");
2956
+ const message = err instanceof Error ? err.message : String(err);
2957
+ error(message);
2958
+ process.exit(1);
2959
+ }
2960
+ }
2961
+ var args = process.argv.slice(2);
2962
+ if (args.includes("--help") || args.includes("-h")) {
2963
+ showCompactLogo();
2964
+ console.log(`Usage: npx create-zenith [project-name]
2965
+ `);
2966
+ console.log(`Create a new Zenith application.
2967
+ `);
2968
+ console.log("Options:");
2969
+ console.log(" -h, --help Show this help message");
2970
+ console.log(" -v, --version Show version number");
2971
+ console.log(" --with-tailwind Initialize with Tailwind CSS v4 template");
2972
+ console.log("");
2973
+ console.log("Examples:");
2974
+ console.log(" npx create-zenith my-app");
2975
+ console.log(" bunx create-zenith my-app");
2976
+ console.log(" npm create zenith my-app");
2977
+ console.log(" bun create zenith my-app");
2978
+ process.exit(0);
2979
+ }
2980
+ if (args.includes("--version") || args.includes("-v")) {
2981
+ console.log(`create-zenith ${VERSION}`);
2982
+ process.exit(0);
2983
+ }
2984
+ var projectName = args.find((arg) => !arg.startsWith("-"));
2985
+ var withTailwind = args.includes("--with-tailwind") ? true : undefined;
2986
+ create(projectName, withTailwind).catch((err) => {
2987
+ error(err instanceof Error ? err.message : String(err));
2988
+ process.exit(1);
2989
+ });