@jannael/glinter 1.2.2 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +93 -80
  2. package/dist/index.js +646 -583
  3. package/package.json +27 -14
package/dist/index.js CHANGED
@@ -120,8 +120,8 @@ var AVAILABLE_COMMANDS = [
120
120
  ];
121
121
 
122
122
  // apps/cli/error/error-constructor.ts
123
+ var capitalize = (text) => text.charAt(0).toUpperCase() + text.slice(1);
123
124
  function CreateError(name) {
124
- const capitalize = (text) => text.charAt(0).toUpperCase() + text.slice(1);
125
125
  return class extends Error {
126
126
  description;
127
127
  constructor(message, description) {
@@ -174,25 +174,34 @@ function errorHandler(error) {
174
174
  }
175
175
 
176
176
  // node_modules/@clack/core/dist/index.mjs
177
- import { styleText as y } from "util";
178
- import { stdout as S, stdin as $ } from "process";
179
- import * as _ from "readline";
180
- import P from "readline";
177
+ import { styleText as v } from "util";
178
+ import { stdout as x, stdin as D } from "process";
179
+ import * as b from "readline";
180
+ import E from "readline";
181
181
 
182
182
  // node_modules/fast-string-truncated-width/dist/utils.js
183
- var isAmbiguous = (x) => {
184
- return x === 161 || x === 164 || x === 167 || x === 168 || x === 170 || x === 173 || x === 174 || x >= 176 && x <= 180 || x >= 182 && x <= 186 || x >= 188 && x <= 191 || x === 198 || x === 208 || x === 215 || x === 216 || x >= 222 && x <= 225 || x === 230 || x >= 232 && x <= 234 || x === 236 || x === 237 || x === 240 || x === 242 || x === 243 || x >= 247 && x <= 250 || x === 252 || x === 254 || x === 257 || x === 273 || x === 275 || x === 283 || x === 294 || x === 295 || x === 299 || x >= 305 && x <= 307 || x === 312 || x >= 319 && x <= 322 || x === 324 || x >= 328 && x <= 331 || x === 333 || x === 338 || x === 339 || x === 358 || x === 359 || x === 363 || x === 462 || x === 464 || x === 466 || x === 468 || x === 470 || x === 472 || x === 474 || x === 476 || x === 593 || x === 609 || x === 708 || x === 711 || x >= 713 && x <= 715 || x === 717 || x === 720 || x >= 728 && x <= 731 || x === 733 || x === 735 || x >= 768 && x <= 879 || x >= 913 && x <= 929 || x >= 931 && x <= 937 || x >= 945 && x <= 961 || x >= 963 && x <= 969 || x === 1025 || x >= 1040 && x <= 1103 || x === 1105 || x === 8208 || x >= 8211 && x <= 8214 || x === 8216 || x === 8217 || x === 8220 || x === 8221 || x >= 8224 && x <= 8226 || x >= 8228 && x <= 8231 || x === 8240 || x === 8242 || x === 8243 || x === 8245 || x === 8251 || x === 8254 || x === 8308 || x === 8319 || x >= 8321 && x <= 8324 || x === 8364 || x === 8451 || x === 8453 || x === 8457 || x === 8467 || x === 8470 || x === 8481 || x === 8482 || x === 8486 || x === 8491 || x === 8531 || x === 8532 || x >= 8539 && x <= 8542 || x >= 8544 && x <= 8555 || x >= 8560 && x <= 8569 || x === 8585 || x >= 8592 && x <= 8601 || x === 8632 || x === 8633 || x === 8658 || x === 8660 || x === 8679 || x === 8704 || x === 8706 || x === 8707 || x === 8711 || x === 8712 || x === 8715 || x === 8719 || x === 8721 || x === 8725 || x === 8730 || x >= 8733 && x <= 8736 || x === 8739 || x === 8741 || x >= 8743 && x <= 8748 || x === 8750 || x >= 8756 && x <= 8759 || x === 8764 || x === 8765 || x === 8776 || x === 8780 || x === 8786 || x === 8800 || x === 8801 || x >= 8804 && x <= 8807 || x === 8810 || x === 8811 || x === 8814 || x === 8815 || x === 8834 || x === 8835 || x === 8838 || x === 8839 || x === 8853 || x === 8857 || x === 8869 || x === 8895 || x === 8978 || x >= 9312 && x <= 9449 || x >= 9451 && x <= 9547 || x >= 9552 && x <= 9587 || x >= 9600 && x <= 9615 || x >= 9618 && x <= 9621 || x === 9632 || x === 9633 || x >= 9635 && x <= 9641 || x === 9650 || x === 9651 || x === 9654 || x === 9655 || x === 9660 || x === 9661 || x === 9664 || x === 9665 || x >= 9670 && x <= 9672 || x === 9675 || x >= 9678 && x <= 9681 || x >= 9698 && x <= 9701 || x === 9711 || x === 9733 || x === 9734 || x === 9737 || x === 9742 || x === 9743 || x === 9756 || x === 9758 || x === 9792 || x === 9794 || x === 9824 || x === 9825 || x >= 9827 && x <= 9829 || x >= 9831 && x <= 9834 || x === 9836 || x === 9837 || x === 9839 || x === 9886 || x === 9887 || x === 9919 || x >= 9926 && x <= 9933 || x >= 9935 && x <= 9939 || x >= 9941 && x <= 9953 || x === 9955 || x === 9960 || x === 9961 || x >= 9963 && x <= 9969 || x === 9972 || x >= 9974 && x <= 9977 || x === 9979 || x === 9980 || x === 9982 || x === 9983 || x === 10045 || x >= 10102 && x <= 10111 || x >= 11094 && x <= 11097 || x >= 12872 && x <= 12879 || x >= 57344 && x <= 63743 || x >= 65024 && x <= 65039 || x === 65533 || x >= 127232 && x <= 127242 || x >= 127248 && x <= 127277 || x >= 127280 && x <= 127337 || x >= 127344 && x <= 127373 || x === 127375 || x === 127376 || x >= 127387 && x <= 127404 || x >= 917760 && x <= 917999 || x >= 983040 && x <= 1048573 || x >= 1048576 && x <= 1114109;
185
- };
183
+ var getCodePointsLength = (() => {
184
+ const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
185
+ return (input) => {
186
+ let surrogatePairsNr = 0;
187
+ SURROGATE_PAIR_RE.lastIndex = 0;
188
+ while (SURROGATE_PAIR_RE.test(input)) {
189
+ surrogatePairsNr += 1;
190
+ }
191
+ return input.length - surrogatePairsNr;
192
+ };
193
+ })();
186
194
  var isFullWidth = (x) => {
187
195
  return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
188
196
  };
189
- var isWide = (x) => {
190
- return x >= 4352 && x <= 4447 || x === 8986 || x === 8987 || x === 9001 || x === 9002 || x >= 9193 && x <= 9196 || x === 9200 || x === 9203 || x === 9725 || x === 9726 || x === 9748 || x === 9749 || x >= 9800 && x <= 9811 || x === 9855 || x === 9875 || x === 9889 || x === 9898 || x === 9899 || x === 9917 || x === 9918 || x === 9924 || x === 9925 || x === 9934 || x === 9940 || x === 9962 || x === 9970 || x === 9971 || x === 9973 || x === 9978 || x === 9981 || x === 9989 || x === 9994 || x === 9995 || x === 10024 || x === 10060 || x === 10062 || x >= 10067 && x <= 10069 || x === 10071 || x >= 10133 && x <= 10135 || x === 10160 || x === 10175 || x === 11035 || x === 11036 || x === 11088 || x === 11093 || x >= 11904 && x <= 11929 || x >= 11931 && x <= 12019 || x >= 12032 && x <= 12245 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12353 && x <= 12438 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12771 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 19903 || x >= 19968 && x <= 42124 || x >= 42128 && x <= 42182 || x >= 43360 && x <= 43388 || x >= 44032 && x <= 55203 || x >= 63744 && x <= 64255 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 94176 && x <= 94180 || x === 94192 || x === 94193 || x >= 94208 && x <= 100343 || x >= 100352 && x <= 101589 || x >= 101632 && x <= 101640 || x >= 110576 && x <= 110579 || x >= 110581 && x <= 110587 || x === 110589 || x === 110590 || x >= 110592 && x <= 110882 || x === 110898 || x >= 110928 && x <= 110930 || x === 110933 || x >= 110948 && x <= 110951 || x >= 110960 && x <= 111355 || x === 126980 || x === 127183 || x === 127374 || x >= 127377 && x <= 127386 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x === 127568 || x === 127569 || x >= 127584 && x <= 127589 || x >= 127744 && x <= 127776 || x >= 127789 && x <= 127797 || x >= 127799 && x <= 127868 || x >= 127870 && x <= 127891 || x >= 127904 && x <= 127946 || x >= 127951 && x <= 127955 || x >= 127968 && x <= 127984 || x === 127988 || x >= 127992 && x <= 128062 || x === 128064 || x >= 128066 && x <= 128252 || x >= 128255 && x <= 128317 || x >= 128331 && x <= 128334 || x >= 128336 && x <= 128359 || x === 128378 || x === 128405 || x === 128406 || x === 128420 || x >= 128507 && x <= 128591 || x >= 128640 && x <= 128709 || x === 128716 || x >= 128720 && x <= 128722 || x >= 128725 && x <= 128727 || x >= 128732 && x <= 128735 || x === 128747 || x === 128748 || x >= 128756 && x <= 128764 || x >= 128992 && x <= 129003 || x === 129008 || x >= 129292 && x <= 129338 || x >= 129340 && x <= 129349 || x >= 129351 && x <= 129535 || x >= 129648 && x <= 129660 || x >= 129664 && x <= 129672 || x >= 129680 && x <= 129725 || x >= 129727 && x <= 129733 || x >= 129742 && x <= 129755 || x >= 129760 && x <= 129768 || x >= 129776 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
197
+ var isWideNotCJKTNotEmoji = (x) => {
198
+ return x === 8987 || x === 9001 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12771 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 19903 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
191
199
  };
192
200
 
193
201
  // node_modules/fast-string-truncated-width/dist/index.js
194
- var ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;
202
+ var ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
195
203
  var CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
204
+ var CJKT_WIDE_RE = /(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu;
196
205
  var TAB_RE = /\t{1,1000}/y;
197
206
  var EMOJI_RE = /[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu;
198
207
  var LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
@@ -202,14 +211,21 @@ var getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {})
202
211
  const LIMIT = truncationOptions.limit ?? Infinity;
203
212
  const ELLIPSIS = truncationOptions.ellipsis ?? "";
204
213
  const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);
205
- const ANSI_WIDTH = widthOptions.ansiWidth ?? 0;
214
+ const ANSI_WIDTH = 0;
206
215
  const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
207
216
  const TAB_WIDTH = widthOptions.tabWidth ?? 8;
208
- const AMBIGUOUS_WIDTH = widthOptions.ambiguousWidth ?? 1;
209
217
  const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
210
- const FULL_WIDTH_WIDTH = widthOptions.fullWidthWidth ?? 2;
218
+ const FULL_WIDTH_WIDTH = 2;
211
219
  const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
212
- const WIDE_WIDTH = widthOptions.wideWidth ?? 2;
220
+ const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;
221
+ const PARSE_BLOCKS = [
222
+ [LATIN_RE, REGULAR_WIDTH],
223
+ [ANSI_RE, ANSI_WIDTH],
224
+ [CONTROL_RE, CONTROL_WIDTH],
225
+ [TAB_RE, TAB_WIDTH],
226
+ [EMOJI_RE, EMOJI_WIDTH],
227
+ [CJKT_WIDE_RE, WIDE_WIDTH]
228
+ ];
213
229
  let indexPrev = 0;
214
230
  let index = 0;
215
231
  let length = input.length;
@@ -230,10 +246,8 @@ var getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {})
230
246
  const codePoint = char.codePointAt(0) || 0;
231
247
  if (isFullWidth(codePoint)) {
232
248
  widthExtra = FULL_WIDTH_WIDTH;
233
- } else if (isWide(codePoint)) {
249
+ } else if (isWideNotCJKTNotEmoji(codePoint)) {
234
250
  widthExtra = WIDE_WIDTH;
235
- } else if (AMBIGUOUS_WIDTH !== REGULAR_WIDTH && isAmbiguous(codePoint)) {
236
- widthExtra = AMBIGUOUS_WIDTH;
237
251
  } else {
238
252
  widthExtra = REGULAR_WIDTH;
239
253
  }
@@ -249,88 +263,28 @@ var getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {})
249
263
  }
250
264
  unmatchedStart = unmatchedEnd = 0;
251
265
  }
252
- if (index >= length)
253
- break;
254
- LATIN_RE.lastIndex = index;
255
- if (LATIN_RE.test(input)) {
256
- lengthExtra = LATIN_RE.lastIndex - index;
257
- widthExtra = lengthExtra * REGULAR_WIDTH;
258
- if (width + widthExtra > truncationLimit) {
259
- truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / REGULAR_WIDTH));
260
- }
261
- if (width + widthExtra > LIMIT) {
262
- truncationEnabled = true;
263
- break;
264
- }
265
- width += widthExtra;
266
- unmatchedStart = indexPrev;
267
- unmatchedEnd = index;
268
- index = indexPrev = LATIN_RE.lastIndex;
269
- continue;
270
- }
271
- ANSI_RE.lastIndex = index;
272
- if (ANSI_RE.test(input)) {
273
- if (width + ANSI_WIDTH > truncationLimit) {
274
- truncationIndex = Math.min(truncationIndex, index);
275
- }
276
- if (width + ANSI_WIDTH > LIMIT) {
277
- truncationEnabled = true;
278
- break;
279
- }
280
- width += ANSI_WIDTH;
281
- unmatchedStart = indexPrev;
282
- unmatchedEnd = index;
283
- index = indexPrev = ANSI_RE.lastIndex;
284
- continue;
285
- }
286
- CONTROL_RE.lastIndex = index;
287
- if (CONTROL_RE.test(input)) {
288
- lengthExtra = CONTROL_RE.lastIndex - index;
289
- widthExtra = lengthExtra * CONTROL_WIDTH;
290
- if (width + widthExtra > truncationLimit) {
291
- truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / CONTROL_WIDTH));
292
- }
293
- if (width + widthExtra > LIMIT) {
294
- truncationEnabled = true;
295
- break;
296
- }
297
- width += widthExtra;
298
- unmatchedStart = indexPrev;
299
- unmatchedEnd = index;
300
- index = indexPrev = CONTROL_RE.lastIndex;
301
- continue;
302
- }
303
- TAB_RE.lastIndex = index;
304
- if (TAB_RE.test(input)) {
305
- lengthExtra = TAB_RE.lastIndex - index;
306
- widthExtra = lengthExtra * TAB_WIDTH;
307
- if (width + widthExtra > truncationLimit) {
308
- truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / TAB_WIDTH));
309
- }
310
- if (width + widthExtra > LIMIT) {
311
- truncationEnabled = true;
312
- break;
313
- }
314
- width += widthExtra;
315
- unmatchedStart = indexPrev;
316
- unmatchedEnd = index;
317
- index = indexPrev = TAB_RE.lastIndex;
318
- continue;
266
+ if (index >= length) {
267
+ break outer;
319
268
  }
320
- EMOJI_RE.lastIndex = index;
321
- if (EMOJI_RE.test(input)) {
322
- if (width + EMOJI_WIDTH > truncationLimit) {
323
- truncationIndex = Math.min(truncationIndex, index);
324
- }
325
- if (width + EMOJI_WIDTH > LIMIT) {
326
- truncationEnabled = true;
327
- break;
269
+ for (let i = 0, l = PARSE_BLOCKS.length;i < l; i++) {
270
+ const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i];
271
+ BLOCK_RE.lastIndex = index;
272
+ if (BLOCK_RE.test(input)) {
273
+ lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index;
274
+ widthExtra = lengthExtra * BLOCK_WIDTH;
275
+ if (width + widthExtra > truncationLimit) {
276
+ truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));
277
+ }
278
+ if (width + widthExtra > LIMIT) {
279
+ truncationEnabled = true;
280
+ break outer;
281
+ }
282
+ width += widthExtra;
283
+ unmatchedStart = indexPrev;
284
+ unmatchedEnd = index;
285
+ index = indexPrev = BLOCK_RE.lastIndex;
286
+ continue outer;
328
287
  }
329
- width += EMOJI_WIDTH;
330
- unmatchedStart = indexPrev;
331
- unmatchedEnd = index;
332
- index = indexPrev = EMOJI_RE.lastIndex;
333
- continue;
334
288
  }
335
289
  index += 1;
336
290
  }
@@ -522,8 +476,11 @@ var exec = (string, columns, options = {}) => {
522
476
  returnValue += character;
523
477
  if (!inSurrogate) {
524
478
  inSurrogate = character >= "\uD800" && character <= "\uDBFF";
479
+ if (inSurrogate) {
480
+ continue;
481
+ }
525
482
  } else {
526
- continue;
483
+ inSurrogate = false;
527
484
  }
528
485
  if (character === ESC || character === CSI) {
529
486
  GROUP_REGEX.lastIndex = i + 1;
@@ -565,74 +522,96 @@ function wrapAnsi(string, columns, options) {
565
522
 
566
523
  // node_modules/@clack/core/dist/index.mjs
567
524
  var import_sisteransi = __toESM(require_src(), 1);
568
- import { ReadStream as D } from "tty";
569
- function d(r, t, e) {
570
- if (!e.some((o) => !o.disabled))
525
+ import { ReadStream as O } from "tty";
526
+ function f(r, t, s) {
527
+ if (!s.some((o) => !o.disabled))
571
528
  return r;
572
- const s = r + t, i = Math.max(e.length - 1, 0), n = s < 0 ? i : s > i ? 0 : s;
573
- return e[n].disabled ? d(n, t < 0 ? -1 : 1, e) : n;
529
+ const e = r + t, i = Math.max(s.length - 1, 0), n = e < 0 ? i : e > i ? 0 : e;
530
+ return s[n].disabled ? f(n, t < 0 ? -1 : 1, s) : n;
531
+ }
532
+ function I(r, t, s, e) {
533
+ const i = e.split(`
534
+ `);
535
+ let n = 0, o = r;
536
+ for (const a of i) {
537
+ if (o <= a.length)
538
+ break;
539
+ o -= a.length + 1, n++;
540
+ }
541
+ for (n = Math.max(0, Math.min(i.length - 1, n + s)), o = Math.min(o, i[n].length) + t;o < 0 && n > 0; )
542
+ n--, o += i[n].length + 1;
543
+ for (;o > i[n].length && n < i.length - 1; )
544
+ o -= i[n].length + 1, n++;
545
+ o = Math.max(0, Math.min(i[n].length, o));
546
+ let u = 0;
547
+ for (let a = 0;a < n; a++)
548
+ u += i[a].length + 1;
549
+ return u + o;
574
550
  }
575
- var E = ["up", "down", "left", "right", "space", "enter", "cancel"];
576
- var G = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
577
- var u = { actions: new Set(E), aliases: new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["\x03", "cancel"], ["escape", "cancel"]]), messages: { cancel: "Canceled", error: "Something went wrong" }, withGuide: true, date: { monthNames: [...G], messages: { required: "Please enter a valid date", invalidMonth: "There are only 12 months in a year", invalidDay: (r, t) => `There are only ${r} days in ${t}`, afterMin: (r) => `Date must be on or after ${r.toISOString().slice(0, 10)}`, beforeMax: (r) => `Date must be on or before ${r.toISOString().slice(0, 10)}` } } };
578
- function V(r, t) {
551
+ var G = ["up", "down", "left", "right", "space", "enter", "cancel"];
552
+ var K = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
553
+ var h = { actions: new Set(G), aliases: new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["\x03", "cancel"], ["escape", "cancel"]]), messages: { cancel: "Canceled", error: "Something went wrong" }, withGuide: true, date: { monthNames: [...K], messages: { required: "Please enter a valid date", invalidMonth: "There are only 12 months in a year", invalidDay: (r, t) => `There are only ${r} days in ${t}`, afterMin: (r) => `Date must be on or after ${r.toISOString().slice(0, 10)}`, beforeMax: (r) => `Date must be on or before ${r.toISOString().slice(0, 10)}` } } };
554
+ function C(r, t) {
579
555
  if (typeof r == "string")
580
- return u.aliases.get(r) === t;
581
- for (const e of r)
582
- if (e !== undefined && V(e, t))
556
+ return h.aliases.get(r) === t;
557
+ for (const s of r)
558
+ if (s !== undefined && C(s, t))
583
559
  return true;
584
560
  return false;
585
561
  }
586
- function j(r, t) {
562
+ function z(r, t) {
587
563
  if (r === t)
588
564
  return;
589
- const e = r.split(`
590
- `), s = t.split(`
591
- `), i = Math.max(e.length, s.length), n = [];
565
+ const s = r.split(`
566
+ `), e = t.split(`
567
+ `), i = Math.max(s.length, e.length), n = [];
592
568
  for (let o = 0;o < i; o++)
593
- e[o] !== s[o] && n.push(o);
594
- return { lines: n, numLinesBefore: e.length, numLinesAfter: s.length, numLines: i };
569
+ s[o] !== e[o] && n.push(o);
570
+ return { lines: n, numLinesBefore: s.length, numLinesAfter: e.length, numLines: i };
595
571
  }
596
572
  var Y = globalThis.process.platform.startsWith("win");
597
- var C = Symbol("clack:cancel");
573
+ var k = Symbol("clack:cancel");
598
574
  function q(r) {
599
- return r === C;
575
+ return r === k;
600
576
  }
601
577
  function w(r, t) {
602
- const e = r;
603
- e.isTTY && e.setRawMode(t);
578
+ const s = r;
579
+ s.isTTY && s.setRawMode(t);
604
580
  }
605
- function z({ input: r = $, output: t = S, overwrite: e = true, hideCursor: s = true } = {}) {
606
- const i = _.createInterface({ input: r, output: t, prompt: "", tabSize: 1 });
607
- _.emitKeypressEvents(r, i), r instanceof D && r.isTTY && r.setRawMode(true);
608
- const n = (o, { name: a, sequence: h }) => {
581
+ function R({ input: r = D, output: t = x, overwrite: s = true, hideCursor: e = true } = {}) {
582
+ const i = b.createInterface({ input: r, output: t, prompt: "", tabSize: 1 });
583
+ b.emitKeypressEvents(r, i), r instanceof O && r.isTTY && r.setRawMode(true);
584
+ const n = (o, { name: u, sequence: a }) => {
609
585
  const l = String(o);
610
- if (V([l, a, h], "cancel")) {
611
- s && t.write(import_sisteransi.cursor.show), process.exit(0);
586
+ if (C([l, u, a], "cancel")) {
587
+ e && t.write(import_sisteransi.cursor.show), process.exit(0);
612
588
  return;
613
589
  }
614
- if (!e)
590
+ if (!s)
615
591
  return;
616
- const f = a === "return" ? 0 : -1, v = a === "return" ? -1 : 0;
617
- _.moveCursor(t, f, v, () => {
618
- _.clearLine(t, 1, () => {
592
+ const c = u === "return" ? 0 : -1, y = u === "return" ? -1 : 0;
593
+ b.moveCursor(t, c, y, () => {
594
+ b.clearLine(t, 1, () => {
619
595
  r.once("keypress", n);
620
596
  });
621
597
  });
622
598
  };
623
- return s && t.write(import_sisteransi.cursor.hide), r.once("keypress", n), () => {
624
- r.off("keypress", n), s && t.write(import_sisteransi.cursor.show), r instanceof D && r.isTTY && !Y && r.setRawMode(false), i.terminal = false, i.close();
599
+ return e && t.write(import_sisteransi.cursor.hide), r.once("keypress", n), () => {
600
+ r.off("keypress", n), e && t.write(import_sisteransi.cursor.show), r instanceof O && r.isTTY && !Y && r.setRawMode(false), i.terminal = false, i.close();
625
601
  };
626
602
  }
627
- var O = (r) => ("columns" in r) && typeof r.columns == "number" ? r.columns : 80;
628
- var A = (r) => ("rows" in r) && typeof r.rows == "number" ? r.rows : 20;
629
- function R(r, t, e, s = e) {
630
- const i = O(r ?? S);
631
- return wrapAnsi(t, i - e.length, { hard: true, trim: false }).split(`
632
- `).map((n, o) => `${o === 0 ? s : e}${n}`).join(`
603
+ var A = (r) => ("columns" in r) && typeof r.columns == "number" ? r.columns : 80;
604
+ var L = (r) => ("rows" in r) && typeof r.rows == "number" ? r.rows : 20;
605
+ function W(r, t, s, e = s, i = s, n) {
606
+ const o = A(r ?? x);
607
+ return wrapAnsi(t, o - s.length, { hard: true, trim: false }).split(`
608
+ `).map((u, a, l) => {
609
+ const c = n ? n(u, a) : u;
610
+ return a === 0 ? `${e}${c}` : a === l.length - 1 ? `${i}${c}` : `${s}${c}`;
611
+ }).join(`
633
612
  `);
634
613
  }
635
- var p = class {
614
+ var m = class {
636
615
  input;
637
616
  output;
638
617
  _abortSignal;
@@ -647,27 +626,27 @@ var p = class {
647
626
  error = "";
648
627
  value;
649
628
  userInput = "";
650
- constructor(t, e = true) {
651
- const { input: s = $, output: i = S, render: n, signal: o, ...a } = t;
652
- this.opts = a, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = n.bind(this), this._track = e, this._abortSignal = o, this.input = s, this.output = i;
629
+ constructor(t, s = true) {
630
+ const { input: e = D, output: i = x, render: n, signal: o, ...u } = t;
631
+ this.opts = u, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = n.bind(this), this._track = s, this._abortSignal = o, this.input = e, this.output = i;
653
632
  }
654
633
  unsubscribe() {
655
634
  this._subscribers.clear();
656
635
  }
657
- setSubscriber(t, e) {
658
- const s = this._subscribers.get(t) ?? [];
659
- s.push(e), this._subscribers.set(t, s);
636
+ setSubscriber(t, s) {
637
+ const e = this._subscribers.get(t) ?? [];
638
+ e.push(s), this._subscribers.set(t, e);
660
639
  }
661
- on(t, e) {
662
- this.setSubscriber(t, { cb: e });
640
+ on(t, s) {
641
+ this.setSubscriber(t, { cb: s });
663
642
  }
664
- once(t, e) {
665
- this.setSubscriber(t, { cb: e, once: true });
643
+ once(t, s) {
644
+ this.setSubscriber(t, { cb: s, once: true });
666
645
  }
667
- emit(t, ...e) {
668
- const s = this._subscribers.get(t) ?? [], i = [];
669
- for (const n of s)
670
- n.cb(...e), n.once && i.push(() => s.splice(s.indexOf(n), 1));
646
+ emit(t, ...s) {
647
+ const e = this._subscribers.get(t) ?? [], i = [];
648
+ for (const n of e)
649
+ n.cb(...s), n.once && i.push(() => e.splice(e.indexOf(n), 1));
671
650
  for (const n of i)
672
651
  n();
673
652
  }
@@ -675,39 +654,42 @@ var p = class {
675
654
  return new Promise((t) => {
676
655
  if (this._abortSignal) {
677
656
  if (this._abortSignal.aborted)
678
- return this.state = "cancel", this.close(), t(C);
657
+ return this.state = "cancel", this.close(), t(k);
679
658
  this._abortSignal.addEventListener("abort", () => {
680
659
  this.state = "cancel", this.close();
681
660
  }, { once: true });
682
661
  }
683
- this.rl = P.createInterface({ input: this.input, tabSize: 2, prompt: "", escapeCodeTimeout: 50, terminal: true }), this.rl.prompt(), this.opts.initialUserInput !== undefined && this._setUserInput(this.opts.initialUserInput, true), this.input.on("keypress", this.onKeypress), w(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
662
+ this.rl = E.createInterface({ input: this.input, tabSize: 2, prompt: "", escapeCodeTimeout: 50, terminal: true }), this.rl.prompt(), this.opts.initialUserInput !== undefined && this._setUserInput(this.opts.initialUserInput, true), this.input.on("keypress", this.onKeypress), w(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
684
663
  this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), w(this.input, false), t(this.value);
685
664
  }), this.once("cancel", () => {
686
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), w(this.input, false), t(C);
665
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), w(this.input, false), t(k);
687
666
  });
688
667
  });
689
668
  }
690
- _isActionKey(t, e) {
669
+ _isActionKey(t, s) {
691
670
  return t === "\t";
692
671
  }
672
+ _shouldSubmit(t, s) {
673
+ return true;
674
+ }
693
675
  _setValue(t) {
694
676
  this.value = t, this.emit("value", this.value);
695
677
  }
696
- _setUserInput(t, e) {
697
- this.userInput = t ?? "", this.emit("userInput", this.userInput), e && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
678
+ _setUserInput(t, s) {
679
+ this.userInput = t ?? "", this.emit("userInput", this.userInput), s && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
698
680
  }
699
681
  _clearUserInput() {
700
682
  this.rl?.write(null, { ctrl: true, name: "u" }), this._setUserInput("");
701
683
  }
702
- onKeypress(t, e) {
703
- if (this._track && e.name !== "return" && (e.name && this._isActionKey(t, e) && this.rl?.write(null, { ctrl: true, name: "h" }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), e?.name && (!this._track && u.aliases.has(e.name) && this.emit("cursor", u.aliases.get(e.name)), u.actions.has(e.name) && this.emit("cursor", e.name)), t && (t.toLowerCase() === "y" || t.toLowerCase() === "n") && this.emit("confirm", t.toLowerCase() === "y"), this.emit("key", t?.toLowerCase(), e), e?.name === "return") {
684
+ onKeypress(t, s) {
685
+ if (this._track && s.name !== "return" && (s.name && this._isActionKey(t, s) && this.rl?.write(null, { ctrl: true, name: "h" }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), s?.name && (!this._track && h.aliases.has(s.name) && this.emit("cursor", h.aliases.get(s.name)), h.actions.has(s.name) && this.emit("cursor", s.name)), t && (t.toLowerCase() === "y" || t.toLowerCase() === "n") && this.emit("confirm", t.toLowerCase() === "y"), this.emit("key", t?.toLowerCase(), s), s?.name === "return" && this._shouldSubmit(t, s)) {
704
686
  if (this.opts.validate) {
705
- const s = this.opts.validate(this.value);
706
- s && (this.error = s instanceof Error ? s.message : s, this.state = "error", this.rl?.write(this.userInput));
687
+ const e = this.opts.validate(this.value);
688
+ e && (this.error = e instanceof Error ? e.message : e, this.state = "error", this.rl?.write(this.userInput));
707
689
  }
708
690
  this.state !== "error" && (this.state = "submit");
709
691
  }
710
- V([t, e?.name, e?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
692
+ C([t, s?.name, s?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
711
693
  }
712
694
  close() {
713
695
  this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
@@ -724,31 +706,31 @@ var p = class {
724
706
  if (this.state === "initial")
725
707
  this.output.write(import_sisteransi.cursor.hide);
726
708
  else {
727
- const e = j(this._prevFrame, t), s = A(this.output);
728
- if (this.restoreCursor(), e) {
729
- const i = Math.max(0, e.numLinesAfter - s), n = Math.max(0, e.numLinesBefore - s);
730
- let o = e.lines.find((a) => a >= i);
709
+ const s = z(this._prevFrame, t), e = L(this.output);
710
+ if (this.restoreCursor(), s) {
711
+ const i = Math.max(0, s.numLinesAfter - e), n = Math.max(0, s.numLinesBefore - e);
712
+ let o = s.lines.find((u) => u >= i);
731
713
  if (o === undefined) {
732
714
  this._prevFrame = t;
733
715
  return;
734
716
  }
735
- if (e.lines.length === 1) {
717
+ if (s.lines.length === 1) {
736
718
  this.output.write(import_sisteransi.cursor.move(0, o - n)), this.output.write(import_sisteransi.erase.lines(1));
737
- const a = t.split(`
719
+ const u = t.split(`
738
720
  `);
739
- this.output.write(a[o]), this._prevFrame = t, this.output.write(import_sisteransi.cursor.move(0, a.length - o - 1));
721
+ this.output.write(u[o]), this._prevFrame = t, this.output.write(import_sisteransi.cursor.move(0, u.length - o - 1));
740
722
  return;
741
- } else if (e.lines.length > 1) {
723
+ } else if (s.lines.length > 1) {
742
724
  if (i < n)
743
725
  o = i;
744
726
  else {
745
- const h = o - n;
746
- h > 0 && this.output.write(import_sisteransi.cursor.move(0, h));
727
+ const a = o - n;
728
+ a > 0 && this.output.write(import_sisteransi.cursor.move(0, a));
747
729
  }
748
730
  this.output.write(import_sisteransi.erase.down());
749
- const a = t.split(`
731
+ const u = t.split(`
750
732
  `).slice(o);
751
- this.output.write(a.join(`
733
+ this.output.write(u.join(`
752
734
  `)), this._prevFrame = t;
753
735
  return;
754
736
  }
@@ -759,87 +741,87 @@ var p = class {
759
741
  }
760
742
  }
761
743
  };
762
- function W(r, t) {
744
+ function B(r, t) {
763
745
  if (r === undefined || t.length === 0)
764
746
  return 0;
765
- const e = t.findIndex((s) => s.value === r);
766
- return e !== -1 ? e : 0;
747
+ const s = t.findIndex((e) => e.value === r);
748
+ return s !== -1 ? s : 0;
767
749
  }
768
- function B(r, t) {
750
+ function J(r, t) {
769
751
  return (t.label ?? String(t.value)).toLowerCase().includes(r.toLowerCase());
770
752
  }
771
- function J(r, t) {
753
+ function H(r, t) {
772
754
  if (t)
773
755
  return r ? t : t[0];
774
756
  }
775
- var H = class extends p {
757
+ var Q = class extends m {
776
758
  filteredOptions;
777
759
  multiple;
778
760
  isNavigating = false;
779
761
  selectedValues = [];
780
762
  focusedValue;
781
- #e = 0;
782
- #o = "";
763
+ #s = 0;
764
+ #r = "";
783
765
  #t;
784
766
  #n;
785
- #a;
767
+ #u;
786
768
  get cursor() {
787
- return this.#e;
769
+ return this.#s;
788
770
  }
789
771
  get userInputWithCursor() {
790
772
  if (!this.userInput)
791
- return y(["inverse", "hidden"], "_");
773
+ return v(["inverse", "hidden"], "_");
792
774
  if (this._cursor >= this.userInput.length)
793
775
  return `${this.userInput}\u2588`;
794
- const t = this.userInput.slice(0, this._cursor), [e, ...s] = this.userInput.slice(this._cursor);
795
- return `${t}${y("inverse", e)}${s.join("")}`;
776
+ const t = this.userInput.slice(0, this._cursor), [s, ...e] = this.userInput.slice(this._cursor);
777
+ return `${t}${v("inverse", s)}${e.join("")}`;
796
778
  }
797
779
  get options() {
798
780
  return typeof this.#n == "function" ? this.#n() : this.#n;
799
781
  }
800
782
  constructor(t) {
801
- super(t), this.#n = t.options, this.#a = t.placeholder;
802
- const e = this.options;
803
- this.filteredOptions = [...e], this.multiple = t.multiple === true, this.#t = typeof t.options == "function" ? t.filter : t.filter ?? B;
804
- let s;
805
- if (t.initialValue && Array.isArray(t.initialValue) ? this.multiple ? s = t.initialValue : s = t.initialValue.slice(0, 1) : !this.multiple && this.options.length > 0 && (s = [this.options[0].value]), s)
806
- for (const i of s) {
807
- const n = e.findIndex((o) => o.value === i);
808
- n !== -1 && (this.toggleSelected(i), this.#e = n);
783
+ super(t), this.#n = t.options, this.#u = t.placeholder;
784
+ const s = this.options;
785
+ this.filteredOptions = [...s], this.multiple = t.multiple === true, this.#t = typeof t.options == "function" ? t.filter : t.filter ?? J;
786
+ let e;
787
+ if (t.initialValue && Array.isArray(t.initialValue) ? this.multiple ? e = t.initialValue : e = t.initialValue.slice(0, 1) : !this.multiple && this.options.length > 0 && (e = [this.options[0].value]), e)
788
+ for (const i of e) {
789
+ const n = s.findIndex((o) => o.value === i);
790
+ n !== -1 && (this.toggleSelected(i), this.#s = n);
809
791
  }
810
- this.focusedValue = this.options[this.#e]?.value, this.on("key", (i, n) => this.#s(i, n)), this.on("userInput", (i) => this.#i(i));
792
+ this.focusedValue = this.options[this.#s]?.value, this.on("key", (i, n) => this.#e(i, n)), this.on("userInput", (i) => this.#i(i));
811
793
  }
812
- _isActionKey(t, e) {
813
- return t === "\t" || this.multiple && this.isNavigating && e.name === "space" && t !== undefined && t !== "";
794
+ _isActionKey(t, s) {
795
+ return t === "\t" || this.multiple && this.isNavigating && s.name === "space" && t !== undefined && t !== "";
814
796
  }
815
- #s(t, e) {
816
- const s = e.name === "up", i = e.name === "down", n = e.name === "return", o = this.userInput === "" || this.userInput === "\t", a = this.#a, h = this.options, l = a !== undefined && a !== "" && h.some((f) => !f.disabled && (this.#t ? this.#t(a, f) : true));
817
- if (e.name === "tab" && o && l) {
818
- this.userInput === "\t" && this._clearUserInput(), this._setUserInput(a, true), this.isNavigating = false;
797
+ #e(t, s) {
798
+ const e = s.name === "up", i = s.name === "down", n = s.name === "return", o = this.userInput === "" || this.userInput === "\t", u = this.#u, a = this.options, l = u !== undefined && u !== "" && a.some((c) => !c.disabled && (this.#t ? this.#t(u, c) : true));
799
+ if (s.name === "tab" && o && l) {
800
+ this.userInput === "\t" && this._clearUserInput(), this._setUserInput(u, true), this.isNavigating = false;
819
801
  return;
820
802
  }
821
- s || i ? (this.#e = d(this.#e, s ? -1 : 1, this.filteredOptions), this.focusedValue = this.filteredOptions[this.#e]?.value, this.multiple || (this.selectedValues = [this.focusedValue]), this.isNavigating = true) : n ? this.value = J(this.multiple, this.selectedValues) : this.multiple ? this.focusedValue !== undefined && (e.name === "tab" || this.isNavigating && e.name === "space") ? this.toggleSelected(this.focusedValue) : this.isNavigating = false : (this.focusedValue && (this.selectedValues = [this.focusedValue]), this.isNavigating = false);
803
+ e || i ? (this.#s = f(this.#s, e ? -1 : 1, this.filteredOptions), this.focusedValue = this.filteredOptions[this.#s]?.value, this.multiple || (this.selectedValues = [this.focusedValue]), this.isNavigating = true) : n ? this.value = H(this.multiple, this.selectedValues) : this.multiple ? this.focusedValue !== undefined && (s.name === "tab" || this.isNavigating && s.name === "space") ? this.toggleSelected(this.focusedValue) : this.isNavigating = false : (this.focusedValue && (this.selectedValues = [this.focusedValue]), this.isNavigating = false);
822
804
  }
823
805
  deselectAll() {
824
806
  this.selectedValues = [];
825
807
  }
826
808
  toggleSelected(t) {
827
- this.filteredOptions.length !== 0 && (this.multiple ? this.selectedValues.includes(t) ? this.selectedValues = this.selectedValues.filter((e) => e !== t) : this.selectedValues = [...this.selectedValues, t] : this.selectedValues = [t]);
809
+ this.filteredOptions.length !== 0 && (this.multiple ? this.selectedValues.includes(t) ? this.selectedValues = this.selectedValues.filter((s) => s !== t) : this.selectedValues = [...this.selectedValues, t] : this.selectedValues = [t]);
828
810
  }
829
811
  #i(t) {
830
- if (t !== this.#o) {
831
- this.#o = t;
832
- const e = this.options;
833
- t && this.#t ? this.filteredOptions = e.filter((n) => this.#t?.(t, n)) : this.filteredOptions = [...e];
834
- const s = W(this.focusedValue, this.filteredOptions);
835
- this.#e = d(s, 0, this.filteredOptions);
836
- const i = this.filteredOptions[this.#e];
812
+ if (t !== this.#r) {
813
+ this.#r = t;
814
+ const s = this.options;
815
+ t && this.#t ? this.filteredOptions = s.filter((n) => this.#t?.(t, n)) : this.filteredOptions = [...s];
816
+ const e = B(this.focusedValue, this.filteredOptions);
817
+ this.#s = f(e, 0, this.filteredOptions);
818
+ const i = this.filteredOptions[this.#s];
837
819
  i && !i.disabled ? this.focusedValue = i.value : this.focusedValue = undefined, this.multiple || (this.focusedValue !== undefined ? this.toggleSelected(this.focusedValue) : this.deselectAll());
838
820
  }
839
821
  }
840
822
  };
841
823
 
842
- class Q extends p {
824
+ class X2 extends m {
843
825
  get cursor() {
844
826
  return this.value ? 0 : 1;
845
827
  }
@@ -849,102 +831,102 @@ class Q extends p {
849
831
  constructor(t) {
850
832
  super(t, false), this.value = !!t.initialValue, this.on("userInput", () => {
851
833
  this.value = this._value;
852
- }), this.on("confirm", (e) => {
853
- this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = e, this.state = "submit", this.close();
834
+ }), this.on("confirm", (s) => {
835
+ this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = s, this.state = "submit", this.close();
854
836
  }), this.on("cursor", () => {
855
837
  this.value = !this.value;
856
838
  });
857
839
  }
858
840
  }
859
- var X2 = { Y: { type: "year", len: 4 }, M: { type: "month", len: 2 }, D: { type: "day", len: 2 } };
860
- function L(r) {
861
- return [...r].map((t) => X2[t]);
841
+ var Z = { Y: { type: "year", len: 4 }, M: { type: "month", len: 2 }, D: { type: "day", len: 2 } };
842
+ function P(r) {
843
+ return [...r].map((t) => Z[t]);
862
844
  }
863
- function Z(r) {
864
- const t = new Intl.DateTimeFormat(r, { year: "numeric", month: "2-digit", day: "2-digit" }).formatToParts(new Date(2000, 0, 15)), e = [];
865
- let s = "/";
845
+ function tt(r) {
846
+ const t = new Intl.DateTimeFormat(r, { year: "numeric", month: "2-digit", day: "2-digit" }).formatToParts(new Date(2000, 0, 15)), s = [];
847
+ let e = "/";
866
848
  for (const i of t)
867
- i.type === "literal" ? s = i.value.trim() || i.value : (i.type === "year" || i.type === "month" || i.type === "day") && e.push({ type: i.type, len: i.type === "year" ? 4 : 2 });
868
- return { segments: e, separator: s };
849
+ i.type === "literal" ? e = i.value.trim() || i.value : (i.type === "year" || i.type === "month" || i.type === "day") && s.push({ type: i.type, len: i.type === "year" ? 4 : 2 });
850
+ return { segments: s, separator: e };
869
851
  }
870
- function k(r) {
852
+ function $(r) {
871
853
  return Number.parseInt((r || "0").replace(/_/g, "0"), 10) || 0;
872
854
  }
873
- function I(r) {
874
- return { year: k(r.year), month: k(r.month), day: k(r.day) };
855
+ function S(r) {
856
+ return { year: $(r.year), month: $(r.month), day: $(r.day) };
875
857
  }
876
- function T(r, t) {
858
+ function U(r, t) {
877
859
  return new Date(r || 2001, t || 1, 0).getDate();
878
860
  }
879
861
  function F(r) {
880
- const { year: t, month: e, day: s } = I(r);
881
- if (!t || t < 0 || t > 9999 || !e || e < 1 || e > 12 || !s || s < 1)
862
+ const { year: t, month: s, day: e } = S(r);
863
+ if (!t || t < 0 || t > 9999 || !s || s < 1 || s > 12 || !e || e < 1)
882
864
  return;
883
- const i = new Date(Date.UTC(t, e - 1, s));
884
- if (!(i.getUTCFullYear() !== t || i.getUTCMonth() !== e - 1 || i.getUTCDate() !== s))
885
- return { year: t, month: e, day: s };
865
+ const i = new Date(Date.UTC(t, s - 1, e));
866
+ if (!(i.getUTCFullYear() !== t || i.getUTCMonth() !== s - 1 || i.getUTCDate() !== e))
867
+ return { year: t, month: s, day: e };
886
868
  }
887
869
  function N(r) {
888
870
  const t = F(r);
889
871
  return t ? new Date(Date.UTC(t.year, t.month - 1, t.day)) : undefined;
890
872
  }
891
- function tt(r, t, e, s) {
892
- const i = e ? { year: e.getUTCFullYear(), month: e.getUTCMonth() + 1, day: e.getUTCDate() } : null, n = s ? { year: s.getUTCFullYear(), month: s.getUTCMonth() + 1, day: s.getUTCDate() } : null;
893
- return r === "year" ? { min: i?.year ?? 1, max: n?.year ?? 9999 } : r === "month" ? { min: i && t.year === i.year ? i.month : 1, max: n && t.year === n.year ? n.month : 12 } : { min: i && t.year === i.year && t.month === i.month ? i.day : 1, max: n && t.year === n.year && t.month === n.month ? n.day : T(t.year, t.month) };
873
+ function st(r, t, s, e) {
874
+ const i = s ? { year: s.getUTCFullYear(), month: s.getUTCMonth() + 1, day: s.getUTCDate() } : null, n = e ? { year: e.getUTCFullYear(), month: e.getUTCMonth() + 1, day: e.getUTCDate() } : null;
875
+ return r === "year" ? { min: i?.year ?? 1, max: n?.year ?? 9999 } : r === "month" ? { min: i && t.year === i.year ? i.month : 1, max: n && t.year === n.year ? n.month : 12 } : { min: i && t.year === i.year && t.month === i.month ? i.day : 1, max: n && t.year === n.year && t.month === n.month ? n.day : U(t.year, t.month) };
894
876
  }
895
877
 
896
- class et extends p {
897
- #e;
898
- #o;
878
+ class et extends m {
879
+ #s;
880
+ #r;
899
881
  #t;
900
882
  #n;
901
- #a;
902
- #s = { segmentIndex: 0, positionInSegment: 0 };
883
+ #u;
884
+ #e = { segmentIndex: 0, positionInSegment: 0 };
903
885
  #i = true;
904
- #r = null;
886
+ #o = null;
905
887
  inlineError = "";
906
888
  get segmentCursor() {
907
- return { ...this.#s };
889
+ return { ...this.#e };
908
890
  }
909
891
  get segmentValues() {
910
892
  return { ...this.#t };
911
893
  }
912
894
  get segments() {
913
- return this.#e;
895
+ return this.#s;
914
896
  }
915
897
  get separator() {
916
- return this.#o;
898
+ return this.#r;
917
899
  }
918
900
  get formattedValue() {
919
901
  return this.#c(this.#t);
920
902
  }
921
903
  #c(t) {
922
- return this.#e.map((e) => t[e.type]).join(this.#o);
904
+ return this.#s.map((s) => t[s.type]).join(this.#r);
923
905
  }
924
- #h() {
906
+ #a() {
925
907
  this._setUserInput(this.#c(this.#t)), this._setValue(N(this.#t) ?? undefined);
926
908
  }
927
909
  constructor(t) {
928
- const e = t.format ? { segments: L(t.format), separator: t.separator ?? "/" } : Z(t.locale), s = t.separator ?? e.separator, i = t.format ? L(t.format) : e.segments, n = t.initialValue ?? t.defaultValue, o = n ? { year: String(n.getUTCFullYear()).padStart(4, "0"), month: String(n.getUTCMonth() + 1).padStart(2, "0"), day: String(n.getUTCDate()).padStart(2, "0") } : { year: "____", month: "__", day: "__" }, a = i.map((h) => o[h.type]).join(s);
929
- super({ ...t, initialUserInput: a }, false), this.#e = i, this.#o = s, this.#t = o, this.#n = t.minDate, this.#a = t.maxDate, this.#h(), this.on("cursor", (h) => this.#d(h)), this.on("key", (h, l) => this.#f(h, l)), this.on("finalize", () => this.#g(t));
910
+ const s = t.format ? { segments: P(t.format), separator: t.separator ?? "/" } : tt(t.locale), e = t.separator ?? s.separator, i = t.format ? P(t.format) : s.segments, n = t.initialValue ?? t.defaultValue, o = n ? { year: String(n.getUTCFullYear()).padStart(4, "0"), month: String(n.getUTCMonth() + 1).padStart(2, "0"), day: String(n.getUTCDate()).padStart(2, "0") } : { year: "____", month: "__", day: "__" }, u = i.map((a) => o[a.type]).join(e);
911
+ super({ ...t, initialUserInput: u }, false), this.#s = i, this.#r = e, this.#t = o, this.#n = t.minDate, this.#u = t.maxDate, this.#a(), this.on("cursor", (a) => this.#d(a)), this.on("key", (a, l) => this.#f(a, l)), this.on("finalize", () => this.#g(t));
930
912
  }
931
- #u() {
932
- const t = Math.max(0, Math.min(this.#s.segmentIndex, this.#e.length - 1)), e = this.#e[t];
933
- if (e)
934
- return this.#s.positionInSegment = Math.max(0, Math.min(this.#s.positionInSegment, e.len - 1)), { segment: e, index: t };
913
+ #h() {
914
+ const t = Math.max(0, Math.min(this.#e.segmentIndex, this.#s.length - 1)), s = this.#s[t];
915
+ if (s)
916
+ return this.#e.positionInSegment = Math.max(0, Math.min(this.#e.positionInSegment, s.len - 1)), { segment: s, index: t };
935
917
  }
936
918
  #l(t) {
937
- this.inlineError = "", this.#r = null;
938
- const e = this.#u();
939
- e && (this.#s.segmentIndex = Math.max(0, Math.min(this.#e.length - 1, e.index + t)), this.#s.positionInSegment = 0, this.#i = true);
919
+ this.inlineError = "", this.#o = null;
920
+ const s = this.#h();
921
+ s && (this.#e.segmentIndex = Math.max(0, Math.min(this.#s.length - 1, s.index + t)), this.#e.positionInSegment = 0, this.#i = true);
940
922
  }
941
923
  #p(t) {
942
- const e = this.#u();
943
- if (!e)
924
+ const s = this.#h();
925
+ if (!s)
944
926
  return;
945
- const { segment: s } = e, i = this.#t[s.type], n = !i || i.replace(/_/g, "") === "", o = Number.parseInt((i || "0").replace(/_/g, "0"), 10) || 0, a = tt(s.type, I(this.#t), this.#n, this.#a);
946
- let h;
947
- n ? h = t === 1 ? a.min : a.max : h = Math.max(Math.min(a.max, o + t), a.min), this.#t = { ...this.#t, [s.type]: h.toString().padStart(s.len, "0") }, this.#i = true, this.#r = null, this.#h();
927
+ const { segment: e } = s, i = this.#t[e.type], n = !i || i.replace(/_/g, "") === "", o = Number.parseInt((i || "0").replace(/_/g, "0"), 10) || 0, u = st(e.type, S(this.#t), this.#n, this.#u);
928
+ let a;
929
+ n ? a = t === 1 ? u.min : u.max : a = Math.max(Math.min(u.max, o + t), u.min), this.#t = { ...this.#t, [e.type]: a.toString().padStart(e.len, "0") }, this.#i = true, this.#o = null, this.#a();
948
930
  }
949
931
  #d(t) {
950
932
  if (t)
@@ -959,124 +941,124 @@ class et extends p {
959
941
  return this.#p(-1);
960
942
  }
961
943
  }
962
- #f(t, e) {
963
- if (e?.name === "backspace" || e?.sequence === "\x7F" || e?.sequence === "\b" || t === "\x7F" || t === "\b") {
944
+ #f(t, s) {
945
+ if (s?.name === "backspace" || s?.sequence === "\x7F" || s?.sequence === "\b" || t === "\x7F" || t === "\b") {
964
946
  this.inlineError = "";
965
- const s = this.#u();
966
- if (!s)
947
+ const e = this.#h();
948
+ if (!e)
967
949
  return;
968
- if (!this.#t[s.segment.type].replace(/_/g, "")) {
950
+ if (!this.#t[e.segment.type].replace(/_/g, "")) {
969
951
  this.#l(-1);
970
952
  return;
971
953
  }
972
- this.#t[s.segment.type] = "_".repeat(s.segment.len), this.#i = true, this.#s.positionInSegment = 0, this.#h();
954
+ this.#t[e.segment.type] = "_".repeat(e.segment.len), this.#i = true, this.#e.positionInSegment = 0, this.#a();
973
955
  return;
974
956
  }
975
- if (e?.name === "tab") {
957
+ if (s?.name === "tab") {
976
958
  this.inlineError = "";
977
- const s = this.#u();
978
- if (!s)
959
+ const e = this.#h();
960
+ if (!e)
979
961
  return;
980
- const i = e.shift ? -1 : 1, n = s.index + i;
981
- n >= 0 && n < this.#e.length && (this.#s.segmentIndex = n, this.#s.positionInSegment = 0, this.#i = true);
962
+ const i = s.shift ? -1 : 1, n = e.index + i;
963
+ n >= 0 && n < this.#s.length && (this.#e.segmentIndex = n, this.#e.positionInSegment = 0, this.#i = true);
982
964
  return;
983
965
  }
984
966
  if (t && /^[0-9]$/.test(t)) {
985
- const s = this.#u();
986
- if (!s)
967
+ const e = this.#h();
968
+ if (!e)
987
969
  return;
988
- const { segment: i } = s, n = !this.#t[i.type].replace(/_/g, "");
989
- if (this.#i && this.#r !== null && !n) {
990
- const m = this.#r + t, g = { ...this.#t, [i.type]: m }, b = this.#m(g, i);
991
- if (b) {
992
- this.inlineError = b, this.#r = null, this.#i = false;
970
+ const { segment: i } = e, n = !this.#t[i.type].replace(/_/g, "");
971
+ if (this.#i && this.#o !== null && !n) {
972
+ const d = this.#o + t, g = { ...this.#t, [i.type]: d }, _ = this.#m(g, i);
973
+ if (_) {
974
+ this.inlineError = _, this.#o = null, this.#i = false;
993
975
  return;
994
976
  }
995
- this.inlineError = "", this.#t[i.type] = m, this.#r = null, this.#i = false, this.#h(), s.index < this.#e.length - 1 && (this.#s.segmentIndex = s.index + 1, this.#s.positionInSegment = 0, this.#i = true);
977
+ this.inlineError = "", this.#t[i.type] = d, this.#o = null, this.#i = false, this.#a(), e.index < this.#s.length - 1 && (this.#e.segmentIndex = e.index + 1, this.#e.positionInSegment = 0, this.#i = true);
996
978
  return;
997
979
  }
998
- this.#i && !n && (this.#t[i.type] = "_".repeat(i.len), this.#s.positionInSegment = 0), this.#i = false, this.#r = null;
999
- const o = this.#t[i.type], a = o.indexOf("_"), h = a >= 0 ? a : Math.min(this.#s.positionInSegment, i.len - 1);
1000
- if (h < 0 || h >= i.len)
980
+ this.#i && !n && (this.#t[i.type] = "_".repeat(i.len), this.#e.positionInSegment = 0), this.#i = false, this.#o = null;
981
+ const o = this.#t[i.type], u = o.indexOf("_"), a = u >= 0 ? u : Math.min(this.#e.positionInSegment, i.len - 1);
982
+ if (a < 0 || a >= i.len)
1001
983
  return;
1002
- let l = o.slice(0, h) + t + o.slice(h + 1), f = false;
1003
- if (h === 0 && o === "__" && (i.type === "month" || i.type === "day")) {
1004
- const m = Number.parseInt(t, 10);
1005
- l = `0${t}`, f = m <= (i.type === "month" ? 1 : 2);
984
+ let l = o.slice(0, a) + t + o.slice(a + 1), c = false;
985
+ if (a === 0 && o === "__" && (i.type === "month" || i.type === "day")) {
986
+ const d = Number.parseInt(t, 10);
987
+ l = `0${t}`, c = d <= (i.type === "month" ? 1 : 2);
1006
988
  }
1007
989
  if (i.type === "year" && (l = (o.replace(/_/g, "") + t).padStart(i.len, "_")), !l.includes("_")) {
1008
- const m = { ...this.#t, [i.type]: l }, g = this.#m(m, i);
990
+ const d = { ...this.#t, [i.type]: l }, g = this.#m(d, i);
1009
991
  if (g) {
1010
992
  this.inlineError = g;
1011
993
  return;
1012
994
  }
1013
995
  }
1014
996
  this.inlineError = "", this.#t[i.type] = l;
1015
- const v = l.includes("_") ? undefined : F(this.#t);
1016
- if (v) {
1017
- const { year: m, month: g } = v, b = T(m, g);
1018
- this.#t = { year: String(Math.max(0, Math.min(9999, m))).padStart(4, "0"), month: String(Math.max(1, Math.min(12, g))).padStart(2, "0"), day: String(Math.max(1, Math.min(b, v.day))).padStart(2, "0") };
997
+ const y = l.includes("_") ? undefined : F(this.#t);
998
+ if (y) {
999
+ const { year: d, month: g } = y, _ = U(d, g);
1000
+ this.#t = { year: String(Math.max(0, Math.min(9999, d))).padStart(4, "0"), month: String(Math.max(1, Math.min(12, g))).padStart(2, "0"), day: String(Math.max(1, Math.min(_, y.day))).padStart(2, "0") };
1019
1001
  }
1020
- this.#h();
1021
- const U = l.indexOf("_");
1022
- f ? (this.#i = true, this.#r = t) : U >= 0 ? this.#s.positionInSegment = U : a >= 0 && s.index < this.#e.length - 1 ? (this.#s.segmentIndex = s.index + 1, this.#s.positionInSegment = 0, this.#i = true) : this.#s.positionInSegment = Math.min(h + 1, i.len - 1);
1002
+ this.#a();
1003
+ const T = l.indexOf("_");
1004
+ c ? (this.#i = true, this.#o = t) : T >= 0 ? this.#e.positionInSegment = T : u >= 0 && e.index < this.#s.length - 1 ? (this.#e.segmentIndex = e.index + 1, this.#e.positionInSegment = 0, this.#i = true) : this.#e.positionInSegment = Math.min(a + 1, i.len - 1);
1023
1005
  }
1024
1006
  }
1025
- #m(t, e) {
1026
- const { month: s, day: i } = I(t);
1027
- if (e.type === "month" && (s < 0 || s > 12))
1028
- return u.date.messages.invalidMonth;
1029
- if (e.type === "day" && (i < 0 || i > 31))
1030
- return u.date.messages.invalidDay(31, "any month");
1007
+ #m(t, s) {
1008
+ const { month: e, day: i } = S(t);
1009
+ if (s.type === "month" && (e < 0 || e > 12))
1010
+ return h.date.messages.invalidMonth;
1011
+ if (s.type === "day" && (i < 0 || i > 31))
1012
+ return h.date.messages.invalidDay(31, "any month");
1031
1013
  }
1032
1014
  #g(t) {
1033
- const { year: e, month: s, day: i } = I(this.#t);
1034
- if (e && s && i) {
1035
- const n = T(e, s);
1015
+ const { year: s, month: e, day: i } = S(this.#t);
1016
+ if (s && e && i) {
1017
+ const n = U(s, e);
1036
1018
  this.#t = { ...this.#t, day: String(Math.min(i, n)).padStart(2, "0") };
1037
1019
  }
1038
1020
  this.value = N(this.#t) ?? t.defaultValue ?? undefined;
1039
1021
  }
1040
1022
  }
1041
1023
 
1042
- class st extends p {
1024
+ class it extends m {
1043
1025
  options;
1044
1026
  cursor = 0;
1045
- #e;
1027
+ #s;
1046
1028
  getGroupItems(t) {
1047
- return this.options.filter((e) => e.group === t);
1029
+ return this.options.filter((s) => s.group === t);
1048
1030
  }
1049
1031
  isGroupSelected(t) {
1050
- const e = this.getGroupItems(t), s = this.value;
1051
- return s === undefined ? false : e.every((i) => s.includes(i.value));
1032
+ const s = this.getGroupItems(t), e = this.value;
1033
+ return e === undefined ? false : s.every((i) => e.includes(i.value));
1052
1034
  }
1053
1035
  toggleValue() {
1054
1036
  const t = this.options[this.cursor];
1055
1037
  if (this.value === undefined && (this.value = []), t.group === true) {
1056
- const e = t.value, s = this.getGroupItems(e);
1057
- this.isGroupSelected(e) ? this.value = this.value.filter((i) => s.findIndex((n) => n.value === i) === -1) : this.value = [...this.value, ...s.map((i) => i.value)], this.value = Array.from(new Set(this.value));
1038
+ const s = t.value, e = this.getGroupItems(s);
1039
+ this.isGroupSelected(s) ? this.value = this.value.filter((i) => e.findIndex((n) => n.value === i) === -1) : this.value = [...this.value, ...e.map((i) => i.value)], this.value = Array.from(new Set(this.value));
1058
1040
  } else {
1059
- const e = this.value.includes(t.value);
1060
- this.value = e ? this.value.filter((s) => s !== t.value) : [...this.value, t.value];
1041
+ const s = this.value.includes(t.value);
1042
+ this.value = s ? this.value.filter((e) => e !== t.value) : [...this.value, t.value];
1061
1043
  }
1062
1044
  }
1063
1045
  constructor(t) {
1064
1046
  super(t, false);
1065
- const { options: e } = t;
1066
- this.#e = t.selectableGroups !== false, this.options = Object.entries(e).flatMap(([s, i]) => [{ value: s, group: true, label: s }, ...i.map((n) => ({ ...n, group: s }))]), this.value = [...t.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: s }) => s === t.cursorAt), this.#e ? 0 : 1), this.on("cursor", (s) => {
1067
- switch (s) {
1047
+ const { options: s } = t;
1048
+ this.#s = t.selectableGroups !== false, this.options = Object.entries(s).flatMap(([e, i]) => [{ value: e, group: true, label: e }, ...i.map((n) => ({ ...n, group: e }))]), this.value = [...t.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: e }) => e === t.cursorAt), this.#s ? 0 : 1), this.on("cursor", (e) => {
1049
+ switch (e) {
1068
1050
  case "left":
1069
1051
  case "up": {
1070
1052
  this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
1071
1053
  const i = this.options[this.cursor]?.group === true;
1072
- !this.#e && i && (this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1);
1054
+ !this.#s && i && (this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1);
1073
1055
  break;
1074
1056
  }
1075
1057
  case "down":
1076
1058
  case "right": {
1077
1059
  this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
1078
1060
  const i = this.options[this.cursor]?.group === true;
1079
- !this.#e && i && (this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1);
1061
+ !this.#s && i && (this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1);
1080
1062
  break;
1081
1063
  }
1082
1064
  case "space":
@@ -1086,7 +1068,87 @@ class st extends p {
1086
1068
  });
1087
1069
  }
1088
1070
  }
1089
- var it = class extends p {
1071
+
1072
+ class rt extends m {
1073
+ #s = false;
1074
+ #r;
1075
+ focused = "editor";
1076
+ get userInputWithCursor() {
1077
+ if (this.state === "submit")
1078
+ return this.userInput;
1079
+ const t = this.userInput;
1080
+ if (this.cursor >= t.length)
1081
+ return `${t}\u2588`;
1082
+ const s = t.slice(0, this.cursor), e = t[this.cursor], i = t.slice(this.cursor + 1);
1083
+ return e === `
1084
+ ` ? `${s}\u2588
1085
+ ${i}` : `${s}${v("inverse", e)}${i}`;
1086
+ }
1087
+ get cursor() {
1088
+ return this._cursor;
1089
+ }
1090
+ #t(t) {
1091
+ if (this.userInput.length === 0) {
1092
+ this._setUserInput(t);
1093
+ return;
1094
+ }
1095
+ this._setUserInput(this.userInput.slice(0, this.cursor) + t + this.userInput.slice(this.cursor));
1096
+ }
1097
+ #n(t) {
1098
+ const s = this.value ?? "";
1099
+ switch (t) {
1100
+ case "up":
1101
+ this._cursor = I(this._cursor, 0, -1, s);
1102
+ return;
1103
+ case "down":
1104
+ this._cursor = I(this._cursor, 0, 1, s);
1105
+ return;
1106
+ case "left":
1107
+ this._cursor = I(this._cursor, -1, 0, s);
1108
+ return;
1109
+ case "right":
1110
+ this._cursor = I(this._cursor, 1, 0, s);
1111
+ return;
1112
+ }
1113
+ }
1114
+ _shouldSubmit(t, s) {
1115
+ if (this.#r)
1116
+ return this.focused === "submit" ? true : (this.#t(`
1117
+ `), this._cursor++, false);
1118
+ const e = this.#s;
1119
+ return this.#s = true, e ? (this.userInput[this.cursor - 1] === `
1120
+ ` && (this._setUserInput(this.userInput.slice(0, this.cursor - 1) + this.userInput.slice(this.cursor)), this._cursor--), true) : (this.#t(`
1121
+ `), this._cursor++, false);
1122
+ }
1123
+ constructor(t) {
1124
+ super(t, false), this.#r = t.showSubmit ?? false, this.on("key", (s, e) => {
1125
+ if (e?.name && h.actions.has(e.name)) {
1126
+ this.#n(e.name);
1127
+ return;
1128
+ }
1129
+ if (s === "\t" && this.#r) {
1130
+ this.focused = this.focused === "editor" ? "submit" : "editor";
1131
+ return;
1132
+ }
1133
+ if (e?.name !== "return") {
1134
+ if (this.#s = false, e?.name === "backspace" && this.cursor > 0) {
1135
+ this._setUserInput(this.userInput.slice(0, this.cursor - 1) + this.userInput.slice(this.cursor)), this._cursor--;
1136
+ return;
1137
+ }
1138
+ if (e?.name === "delete" && this.cursor < this.userInput.length) {
1139
+ this._setUserInput(this.userInput.slice(0, this.cursor) + this.userInput.slice(this.cursor + 1));
1140
+ return;
1141
+ }
1142
+ s && (this.#r && this.focused === "submit" && (this.focused = "editor"), this.#t(s ?? ""), this._cursor++);
1143
+ }
1144
+ }), this.on("userInput", (s) => {
1145
+ this._setValue(s);
1146
+ }), this.on("finalize", () => {
1147
+ this.value || (this.value = t.defaultValue), this.value === undefined && (this.value = "");
1148
+ });
1149
+ }
1150
+ }
1151
+ var nt = class extends m {
1090
1152
  options;
1091
1153
  cursor = 0;
1092
1154
  get _value() {
@@ -1096,35 +1158,35 @@ var it = class extends p {
1096
1158
  return this.options.filter((t) => t.disabled !== true);
1097
1159
  }
1098
1160
  toggleAll() {
1099
- const t = this._enabledOptions, e = this.value !== undefined && this.value.length === t.length;
1100
- this.value = e ? [] : t.map((s) => s.value);
1161
+ const t = this._enabledOptions, s = this.value !== undefined && this.value.length === t.length;
1162
+ this.value = s ? [] : t.map((e) => e.value);
1101
1163
  }
1102
1164
  toggleInvert() {
1103
1165
  const t = this.value;
1104
1166
  if (!t)
1105
1167
  return;
1106
- const e = this._enabledOptions.filter((s) => !t.includes(s.value));
1107
- this.value = e.map((s) => s.value);
1168
+ const s = this._enabledOptions.filter((e) => !t.includes(e.value));
1169
+ this.value = s.map((e) => e.value);
1108
1170
  }
1109
1171
  toggleValue() {
1110
1172
  this.value === undefined && (this.value = []);
1111
1173
  const t = this.value.includes(this._value);
1112
- this.value = t ? this.value.filter((e) => e !== this._value) : [...this.value, this._value];
1174
+ this.value = t ? this.value.filter((s) => s !== this._value) : [...this.value, this._value];
1113
1175
  }
1114
1176
  constructor(t) {
1115
1177
  super(t, false), this.options = t.options, this.value = [...t.initialValues ?? []];
1116
- const e = Math.max(this.options.findIndex(({ value: s }) => s === t.cursorAt), 0);
1117
- this.cursor = this.options[e].disabled ? d(e, 1, this.options) : e, this.on("key", (s) => {
1118
- s === "a" && this.toggleAll(), s === "i" && this.toggleInvert();
1119
- }), this.on("cursor", (s) => {
1120
- switch (s) {
1178
+ const s = Math.max(this.options.findIndex(({ value: e }) => e === t.cursorAt), 0);
1179
+ this.cursor = this.options[s].disabled ? f(s, 1, this.options) : s, this.on("key", (e) => {
1180
+ e === "a" && this.toggleAll(), e === "i" && this.toggleInvert();
1181
+ }), this.on("cursor", (e) => {
1182
+ switch (e) {
1121
1183
  case "left":
1122
1184
  case "up":
1123
- this.cursor = d(this.cursor, -1, this.options);
1185
+ this.cursor = f(this.cursor, -1, this.options);
1124
1186
  break;
1125
1187
  case "down":
1126
1188
  case "right":
1127
- this.cursor = d(this.cursor, 1, this.options);
1189
+ this.cursor = f(this.cursor, 1, this.options);
1128
1190
  break;
1129
1191
  case "space":
1130
1192
  this.toggleValue();
@@ -1133,7 +1195,7 @@ var it = class extends p {
1133
1195
  });
1134
1196
  }
1135
1197
  };
1136
- class nt extends p {
1198
+ class ut extends m {
1137
1199
  options;
1138
1200
  cursor = 0;
1139
1201
  get _selectedValue() {
@@ -1144,38 +1206,38 @@ class nt extends p {
1144
1206
  }
1145
1207
  constructor(t) {
1146
1208
  super(t, false), this.options = t.options;
1147
- const e = this.options.findIndex(({ value: i }) => i === t.initialValue), s = e === -1 ? 0 : e;
1148
- this.cursor = this.options[s].disabled ? d(s, 1, this.options) : s, this.changeValue(), this.on("cursor", (i) => {
1209
+ const s = this.options.findIndex(({ value: i }) => i === t.initialValue), e = s === -1 ? 0 : s;
1210
+ this.cursor = this.options[e].disabled ? f(e, 1, this.options) : e, this.changeValue(), this.on("cursor", (i) => {
1149
1211
  switch (i) {
1150
1212
  case "left":
1151
1213
  case "up":
1152
- this.cursor = d(this.cursor, -1, this.options);
1214
+ this.cursor = f(this.cursor, -1, this.options);
1153
1215
  break;
1154
1216
  case "down":
1155
1217
  case "right":
1156
- this.cursor = d(this.cursor, 1, this.options);
1218
+ this.cursor = f(this.cursor, 1, this.options);
1157
1219
  break;
1158
1220
  }
1159
1221
  this.changeValue();
1160
1222
  });
1161
1223
  }
1162
1224
  }
1163
- class at extends p {
1225
+ class ht extends m {
1164
1226
  get userInputWithCursor() {
1165
1227
  if (this.state === "submit")
1166
1228
  return this.userInput;
1167
1229
  const t = this.userInput;
1168
1230
  if (this.cursor >= t.length)
1169
1231
  return `${this.userInput}\u2588`;
1170
- const e = t.slice(0, this.cursor), [s, ...i] = t.slice(this.cursor);
1171
- return `${e}${y("inverse", s)}${i.join("")}`;
1232
+ const s = t.slice(0, this.cursor), [e, ...i] = t.slice(this.cursor);
1233
+ return `${s}${v("inverse", e)}${i.join("")}`;
1172
1234
  }
1173
1235
  get cursor() {
1174
1236
  return this._cursor;
1175
1237
  }
1176
1238
  constructor(t) {
1177
- super({ ...t, initialUserInput: t.initialUserInput ?? t.initialValue }), this.on("userInput", (e) => {
1178
- this._setValue(e);
1239
+ super({ ...t, initialUserInput: t.initialUserInput ?? t.initialValue }), this.on("userInput", (s) => {
1240
+ this._setValue(s);
1179
1241
  }), this.on("finalize", () => {
1180
1242
  this.value || (this.value = t.defaultValue), this.value === undefined && (this.value = "");
1181
1243
  });
@@ -1183,332 +1245,335 @@ class at extends p {
1183
1245
  }
1184
1246
 
1185
1247
  // node_modules/@clack/prompts/dist/index.mjs
1186
- import { styleText as t, stripVTControlCharacters as ne } from "util";
1187
- import P2 from "process";
1248
+ import { styleText as e, stripVTControlCharacters as nt2 } from "util";
1249
+ import V2 from "process";
1188
1250
  var import_sisteransi2 = __toESM(require_src(), 1);
1189
- function Ze() {
1190
- return P2.platform !== "win32" ? P2.env.TERM !== "linux" : !!P2.env.CI || !!P2.env.WT_SESSION || !!P2.env.TERMINUS_SUBLIME || P2.env.ConEmuTask === "{cmd::Cmder}" || P2.env.TERM_PROGRAM === "Terminus-Sublime" || P2.env.TERM_PROGRAM === "vscode" || P2.env.TERM === "xterm-256color" || P2.env.TERM === "alacritty" || P2.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
1251
+ function ee() {
1252
+ return V2.platform !== "win32" ? V2.env.TERM !== "linux" : !!V2.env.CI || !!V2.env.WT_SESSION || !!V2.env.TERMINUS_SUBLIME || V2.env.ConEmuTask === "{cmd::Cmder}" || V2.env.TERM_PROGRAM === "Terminus-Sublime" || V2.env.TERM_PROGRAM === "vscode" || V2.env.TERM === "xterm-256color" || V2.env.TERM === "alacritty" || V2.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
1191
1253
  }
1192
- var ee = Ze();
1193
- var ae = () => process.env.CI === "true";
1194
- var w2 = (e, i) => ee ? e : i;
1195
- var _e = w2("\u25C6", "*");
1196
- var oe = w2("\u25A0", "x");
1197
- var ue = w2("\u25B2", "x");
1198
- var F2 = w2("\u25C7", "o");
1199
- var le = w2("\u250C", "T");
1200
- var d2 = w2("\u2502", "|");
1201
- var E2 = w2("\u2514", "\u2014");
1202
- var Ie = w2("\u2510", "T");
1203
- var Ee = w2("\u2518", "\u2014");
1254
+ var tt2 = ee();
1255
+ var ot2 = () => process.env.CI === "true";
1256
+ var w2 = (t, i) => tt2 ? t : i;
1257
+ var Tt = w2("\u25C6", "*");
1258
+ var at2 = w2("\u25A0", "x");
1259
+ var ut2 = w2("\u25B2", "x");
1260
+ var H2 = w2("\u25C7", "o");
1261
+ var lt = w2("\u250C", "T");
1262
+ var $2 = w2("\u2502", "|");
1263
+ var x2 = w2("\u2514", "\u2014");
1264
+ var _t = w2("\u2510", "T");
1265
+ var xt = w2("\u2518", "\u2014");
1204
1266
  var z2 = w2("\u25CF", ">");
1205
- var H2 = w2("\u25CB", " ");
1206
- var te = w2("\u25FB", "[\u2022]");
1207
- var U = w2("\u25FC", "[+]");
1208
- var J2 = w2("\u25FB", "[ ]");
1209
- var xe = w2("\u25AA", "\u2022");
1210
- var se = w2("\u2500", "-");
1211
- var ce = w2("\u256E", "+");
1212
- var Ge = w2("\u251C", "+");
1213
- var $e = w2("\u256F", "+");
1214
- var de = w2("\u2570", "+");
1215
- var Oe = w2("\u256D", "+");
1216
- var he = w2("\u25CF", "\u2022");
1217
- var pe = w2("\u25C6", "*");
1218
- var me = w2("\u25B2", "!");
1219
- var ge = w2("\u25A0", "x");
1220
- var V2 = (e) => {
1221
- switch (e) {
1267
+ var U2 = w2("\u25CB", " ");
1268
+ var et2 = w2("\u25FB", "[\u2022]");
1269
+ var K2 = w2("\u25FC", "[+]");
1270
+ var Y2 = w2("\u25FB", "[ ]");
1271
+ var Et = w2("\u25AA", "\u2022");
1272
+ var st2 = w2("\u2500", "-");
1273
+ var ct = w2("\u256E", "+");
1274
+ var Gt = w2("\u251C", "+");
1275
+ var $t = w2("\u256F", "+");
1276
+ var dt = w2("\u2570", "+");
1277
+ var Mt = w2("\u256D", "+");
1278
+ var ht2 = w2("\u25CF", "\u2022");
1279
+ var pt = w2("\u25C6", "*");
1280
+ var mt = w2("\u25B2", "!");
1281
+ var gt = w2("\u25A0", "x");
1282
+ var P2 = (t) => {
1283
+ switch (t) {
1222
1284
  case "initial":
1223
1285
  case "active":
1224
- return t("cyan", _e);
1286
+ return e("cyan", Tt);
1225
1287
  case "cancel":
1226
- return t("red", oe);
1288
+ return e("red", at2);
1227
1289
  case "error":
1228
- return t("yellow", ue);
1290
+ return e("yellow", ut2);
1229
1291
  case "submit":
1230
- return t("green", F2);
1292
+ return e("green", H2);
1231
1293
  }
1232
1294
  };
1233
- var ye = (e) => {
1234
- switch (e) {
1295
+ var yt = (t) => {
1296
+ switch (t) {
1235
1297
  case "initial":
1236
1298
  case "active":
1237
- return t("cyan", d2);
1299
+ return e("cyan", $2);
1238
1300
  case "cancel":
1239
- return t("red", d2);
1301
+ return e("red", $2);
1240
1302
  case "error":
1241
- return t("yellow", d2);
1303
+ return e("yellow", $2);
1242
1304
  case "submit":
1243
- return t("green", d2);
1305
+ return e("green", $2);
1244
1306
  }
1245
1307
  };
1246
- var et2 = (e, i, s, r, u2) => {
1247
- let n = i, o = 0;
1248
- for (let c2 = s;c2 < r; c2++) {
1249
- const a = e[c2];
1250
- if (n = n - a.length, o++, n <= u2)
1251
- break;
1252
- }
1253
- return { lineCount: n, removals: o };
1308
+ var Ot = (t, i, s, r, u, n = false) => {
1309
+ let a = i, c = 0;
1310
+ if (n)
1311
+ for (let o = r - 1;o >= s && (a -= t[o].length, c++, !(a <= u)); o--)
1312
+ ;
1313
+ else
1314
+ for (let o = s;o < r && (a -= t[o].length, c++, !(a <= u)); o++)
1315
+ ;
1316
+ return { lineCount: a, removals: c };
1254
1317
  };
1255
- var Y2 = ({ cursor: e, options: i, style: s, output: r = process.stdout, maxItems: u2 = Number.POSITIVE_INFINITY, columnPadding: n = 0, rowPadding: o = 4 }) => {
1256
- const c2 = O(r) - n, a = A(r), l = t("dim", "..."), $2 = Math.max(a - o, 0), y2 = Math.max(Math.min(u2, $2), 5);
1318
+ var F2 = ({ cursor: t, options: i, style: s, output: r = process.stdout, maxItems: u = Number.POSITIVE_INFINITY, columnPadding: n = 0, rowPadding: a = 4 }) => {
1319
+ const c = A(r) - n, o = L(r), l = e("dim", "..."), d = Math.max(o - a, 0), g = Math.max(Math.min(u, d), 5);
1257
1320
  let p2 = 0;
1258
- e >= y2 - 3 && (p2 = Math.max(Math.min(e - y2 + 3, i.length - y2), 0));
1259
- let m = y2 < i.length && p2 > 0, g = y2 < i.length && p2 + y2 < i.length;
1260
- const S2 = Math.min(p2 + y2, i.length), h = [];
1261
- let f = 0;
1262
- m && f++, g && f++;
1263
- const v = p2 + (m ? 1 : 0), T2 = S2 - (g ? 1 : 0);
1264
- for (let b = v;b < T2; b++) {
1265
- const x = wrapAnsi(s(i[b], b === e), c2, { hard: true, trim: false }).split(`
1321
+ t >= g - 3 && (p2 = Math.max(Math.min(t - g + 3, i.length - g), 0));
1322
+ let f2 = g < i.length && p2 > 0, h2 = g < i.length && p2 + g < i.length;
1323
+ const I2 = Math.min(p2 + g, i.length), m2 = [];
1324
+ let y = 0;
1325
+ f2 && y++, h2 && y++;
1326
+ const v2 = p2 + (f2 ? 1 : 0), C2 = I2 - (h2 ? 1 : 0);
1327
+ for (let b2 = v2;b2 < C2; b2++) {
1328
+ const G2 = wrapAnsi(s(i[b2], b2 === t), c, { hard: true, trim: false }).split(`
1266
1329
  `);
1267
- h.push(x), f += x.length;
1268
- }
1269
- if (f > $2) {
1270
- let b = 0, x = 0, G2 = f;
1271
- const M2 = e - v, R2 = (j2, D2) => et2(h, G2, j2, D2, $2);
1272
- m ? ({ lineCount: G2, removals: b } = R2(0, M2), G2 > $2 && ({ lineCount: G2, removals: x } = R2(M2 + 1, h.length))) : ({ lineCount: G2, removals: x } = R2(M2 + 1, h.length), G2 > $2 && ({ lineCount: G2, removals: b } = R2(0, M2))), b > 0 && (m = true, h.splice(0, b)), x > 0 && (g = true, h.splice(h.length - x, x));
1273
- }
1274
- const C2 = [];
1275
- m && C2.push(l);
1276
- for (const b of h)
1277
- for (const x of b)
1278
- C2.push(x);
1279
- return g && C2.push(l), C2;
1330
+ m2.push(G2), y += G2.length;
1331
+ }
1332
+ if (y > d) {
1333
+ let b2 = 0, G2 = 0, M = y;
1334
+ const N2 = t - v2;
1335
+ let O2 = d;
1336
+ const j2 = () => Ot(m2, M, 0, N2, O2), k2 = () => Ot(m2, M, N2 + 1, m2.length, O2, true);
1337
+ f2 ? ({ lineCount: M, removals: b2 } = j2(), M > O2 && (h2 || (O2 -= 1), { lineCount: M, removals: G2 } = k2())) : (h2 || (O2 -= 1), { lineCount: M, removals: G2 } = k2(), M > O2 && (O2 -= 1, { lineCount: M, removals: b2 } = j2())), b2 > 0 && (f2 = true, m2.splice(0, b2)), G2 > 0 && (h2 = true, m2.splice(m2.length - G2, G2));
1338
+ }
1339
+ const S2 = [];
1340
+ f2 && S2.push(l);
1341
+ for (const b2 of m2)
1342
+ for (const G2 of b2)
1343
+ S2.push(G2);
1344
+ return h2 && S2.push(l), S2;
1280
1345
  };
1281
- var ot2 = (e) => {
1282
- const i = e.active ?? "Yes", s = e.inactive ?? "No";
1283
- return new Q({ active: i, inactive: s, signal: e.signal, input: e.input, output: e.output, initialValue: e.initialValue ?? true, render() {
1284
- const r = e.withGuide ?? u.withGuide, u2 = `${V2(this.state)} `, n = r ? `${t("gray", d2)} ` : "", o = R(e.output, e.message, n, u2), c2 = `${r ? `${t("gray", d2)}
1285
- ` : ""}${o}
1286
- `, a = this.value ? i : s;
1346
+ var ue = (t) => {
1347
+ const i = t.active ?? "Yes", s = t.inactive ?? "No";
1348
+ return new X2({ active: i, inactive: s, signal: t.signal, input: t.input, output: t.output, initialValue: t.initialValue ?? true, render() {
1349
+ const r = t.withGuide ?? h.withGuide, u = `${P2(this.state)} `, n = r ? `${e("gray", $2)} ` : "", a = W(t.output, t.message, n, u), c = `${r ? `${e("gray", $2)}
1350
+ ` : ""}${a}
1351
+ `, o = this.value ? i : s;
1287
1352
  switch (this.state) {
1288
1353
  case "submit": {
1289
- const l = r ? `${t("gray", d2)} ` : "";
1290
- return `${c2}${l}${t("dim", a)}`;
1354
+ const l = r ? `${e("gray", $2)} ` : "";
1355
+ return `${c}${l}${e("dim", o)}`;
1291
1356
  }
1292
1357
  case "cancel": {
1293
- const l = r ? `${t("gray", d2)} ` : "";
1294
- return `${c2}${l}${t(["strikethrough", "dim"], a)}${r ? `
1295
- ${t("gray", d2)}` : ""}`;
1358
+ const l = r ? `${e("gray", $2)} ` : "";
1359
+ return `${c}${l}${e(["strikethrough", "dim"], o)}${r ? `
1360
+ ${e("gray", $2)}` : ""}`;
1296
1361
  }
1297
1362
  default: {
1298
- const l = r ? `${t("cyan", d2)} ` : "", $2 = r ? t("cyan", E2) : "";
1299
- return `${c2}${l}${this.value ? `${t("green", z2)} ${i}` : `${t("dim", H2)} ${t("dim", i)}`}${e.vertical ? r ? `
1300
- ${t("cyan", d2)} ` : `
1301
- ` : ` ${t("dim", "/")} `}${this.value ? `${t("dim", H2)} ${t("dim", s)}` : `${t("green", z2)} ${s}`}
1302
- ${$2}
1363
+ const l = r ? `${e("cyan", $2)} ` : "", d = r ? e("cyan", x2) : "";
1364
+ return `${c}${l}${this.value ? `${e("green", z2)} ${i}` : `${e("dim", U2)} ${e("dim", i)}`}${t.vertical ? r ? `
1365
+ ${e("cyan", $2)} ` : `
1366
+ ` : ` ${e("dim", "/")} `}${this.value ? `${e("dim", U2)} ${e("dim", s)}` : `${e("green", z2)} ${s}`}
1367
+ ${d}
1303
1368
  `;
1304
1369
  }
1305
1370
  }
1306
1371
  } }).prompt();
1307
1372
  };
1308
- var pt = (e = "", i) => {
1309
- const s = i?.output ?? process.stdout, r = i?.withGuide ?? u.withGuide ? `${t("gray", E2)} ` : "";
1310
- s.write(`${r}${t("red", e)}
1373
+ var me = (t = "", i) => {
1374
+ const s = i?.output ?? process.stdout, r = i?.withGuide ?? h.withGuide ? `${e("gray", x2)} ` : "";
1375
+ s.write(`${r}${e("red", t)}
1311
1376
 
1312
1377
  `);
1313
1378
  };
1314
- var mt = (e = "", i) => {
1315
- const s = i?.output ?? process.stdout, r = i?.withGuide ?? u.withGuide ? `${t("gray", le)} ` : "";
1316
- s.write(`${r}${e}
1379
+ var ge = (t = "", i) => {
1380
+ const s = i?.output ?? process.stdout, r = i?.withGuide ?? h.withGuide ? `${e("gray", lt)} ` : "";
1381
+ s.write(`${r}${t}
1317
1382
  `);
1318
1383
  };
1319
- var gt = (e = "", i) => {
1320
- const s = i?.output ?? process.stdout, r = i?.withGuide ?? u.withGuide ? `${t("gray", d2)}
1321
- ${t("gray", E2)} ` : "";
1322
- s.write(`${r}${e}
1384
+ var ye = (t = "", i) => {
1385
+ const s = i?.output ?? process.stdout, r = i?.withGuide ?? h.withGuide ? `${e("gray", $2)}
1386
+ ${e("gray", x2)} ` : "";
1387
+ s.write(`${r}${t}
1323
1388
 
1324
1389
  `);
1325
1390
  };
1326
- var Q2 = (e, i) => e.split(`
1391
+ var Q2 = (t, i) => t.split(`
1327
1392
  `).map((s) => i(s)).join(`
1328
1393
  `);
1329
- var yt = (e) => {
1330
- const i = (r, u2) => {
1394
+ var ve = (t) => {
1395
+ const i = (r, u) => {
1331
1396
  const n = r.label ?? String(r.value);
1332
- return u2 === "disabled" ? `${t("gray", J2)} ${Q2(n, (o) => t(["strikethrough", "gray"], o))}${r.hint ? ` ${t("dim", `(${r.hint ?? "disabled"})`)}` : ""}` : u2 === "active" ? `${t("cyan", te)} ${n}${r.hint ? ` ${t("dim", `(${r.hint})`)}` : ""}` : u2 === "selected" ? `${t("green", U)} ${Q2(n, (o) => t("dim", o))}${r.hint ? ` ${t("dim", `(${r.hint})`)}` : ""}` : u2 === "cancelled" ? `${Q2(n, (o) => t(["strikethrough", "dim"], o))}` : u2 === "active-selected" ? `${t("green", U)} ${n}${r.hint ? ` ${t("dim", `(${r.hint})`)}` : ""}` : u2 === "submitted" ? `${Q2(n, (o) => t("dim", o))}` : `${t("dim", J2)} ${Q2(n, (o) => t("dim", o))}`;
1333
- }, s = e.required ?? true;
1334
- return new it({ options: e.options, signal: e.signal, input: e.input, output: e.output, initialValues: e.initialValues, required: s, cursorAt: e.cursorAt, validate(r) {
1397
+ return u === "disabled" ? `${e("gray", Y2)} ${Q2(n, (a) => e(["strikethrough", "gray"], a))}${r.hint ? ` ${e("dim", `(${r.hint ?? "disabled"})`)}` : ""}` : u === "active" ? `${e("cyan", et2)} ${n}${r.hint ? ` ${e("dim", `(${r.hint})`)}` : ""}` : u === "selected" ? `${e("green", K2)} ${Q2(n, (a) => e("dim", a))}${r.hint ? ` ${e("dim", `(${r.hint})`)}` : ""}` : u === "cancelled" ? `${Q2(n, (a) => e(["strikethrough", "dim"], a))}` : u === "active-selected" ? `${e("green", K2)} ${n}${r.hint ? ` ${e("dim", `(${r.hint})`)}` : ""}` : u === "submitted" ? `${Q2(n, (a) => e("dim", a))}` : `${e("dim", Y2)} ${Q2(n, (a) => e("dim", a))}`;
1398
+ }, s = t.required ?? true;
1399
+ return new nt({ options: t.options, signal: t.signal, input: t.input, output: t.output, initialValues: t.initialValues, required: s, cursorAt: t.cursorAt, validate(r) {
1335
1400
  if (s && (r === undefined || r.length === 0))
1336
1401
  return `Please select at least one option.
1337
- ${t("reset", t("dim", `Press ${t(["gray", "bgWhite", "inverse"], " space ")} to select, ${t("gray", t("bgWhite", t("inverse", " enter ")))} to submit`))}`;
1402
+ ${e("reset", e("dim", `Press ${e(["gray", "bgWhite", "inverse"], " space ")} to select, ${e("gray", e("bgWhite", e("inverse", " enter ")))} to submit`))}`;
1338
1403
  }, render() {
1339
- const r = e.withGuide ?? u.withGuide, u2 = R(e.output, e.message, r ? `${ye(this.state)} ` : "", `${V2(this.state)} `), n = `${r ? `${t("gray", d2)}
1340
- ` : ""}${u2}
1341
- `, o = this.value ?? [], c2 = (a, l) => {
1342
- if (a.disabled)
1343
- return i(a, "disabled");
1344
- const $2 = o.includes(a.value);
1345
- return l && $2 ? i(a, "active-selected") : $2 ? i(a, "selected") : i(a, l ? "active" : "inactive");
1404
+ const r = t.withGuide ?? h.withGuide, u = W(t.output, t.message, r ? `${yt(this.state)} ` : "", `${P2(this.state)} `), n = `${r ? `${e("gray", $2)}
1405
+ ` : ""}${u}
1406
+ `, a = this.value ?? [], c = (o, l) => {
1407
+ if (o.disabled)
1408
+ return i(o, "disabled");
1409
+ const d = a.includes(o.value);
1410
+ return l && d ? i(o, "active-selected") : d ? i(o, "selected") : i(o, l ? "active" : "inactive");
1346
1411
  };
1347
1412
  switch (this.state) {
1348
1413
  case "submit": {
1349
- const a = this.options.filter(({ value: $2 }) => o.includes($2)).map(($2) => i($2, "submitted")).join(t("dim", ", ")) || t("dim", "none"), l = R(e.output, a, r ? `${t("gray", d2)} ` : "");
1414
+ const o = this.options.filter(({ value: d }) => a.includes(d)).map((d) => i(d, "submitted")).join(e("dim", ", ")) || e("dim", "none"), l = W(t.output, o, r ? `${e("gray", $2)} ` : "");
1350
1415
  return `${n}${l}`;
1351
1416
  }
1352
1417
  case "cancel": {
1353
- const a = this.options.filter(({ value: $2 }) => o.includes($2)).map(($2) => i($2, "cancelled")).join(t("dim", ", "));
1354
- if (a.trim() === "")
1355
- return `${n}${t("gray", d2)}`;
1356
- const l = R(e.output, a, r ? `${t("gray", d2)} ` : "");
1418
+ const o = this.options.filter(({ value: d }) => a.includes(d)).map((d) => i(d, "cancelled")).join(e("dim", ", "));
1419
+ if (o.trim() === "")
1420
+ return `${n}${e("gray", $2)}`;
1421
+ const l = W(t.output, o, r ? `${e("gray", $2)} ` : "");
1357
1422
  return `${n}${l}${r ? `
1358
- ${t("gray", d2)}` : ""}`;
1423
+ ${e("gray", $2)}` : ""}`;
1359
1424
  }
1360
1425
  case "error": {
1361
- const a = r ? `${t("yellow", d2)} ` : "", l = this.error.split(`
1362
- `).map((p2, m) => m === 0 ? `${r ? `${t("yellow", E2)} ` : ""}${t("yellow", p2)}` : ` ${p2}`).join(`
1363
- `), $2 = n.split(`
1364
- `).length, y2 = l.split(`
1426
+ const o = r ? `${e("yellow", $2)} ` : "", l = this.error.split(`
1427
+ `).map((p2, f2) => f2 === 0 ? `${r ? `${e("yellow", x2)} ` : ""}${e("yellow", p2)}` : ` ${p2}`).join(`
1428
+ `), d = n.split(`
1429
+ `).length, g = l.split(`
1365
1430
  `).length + 1;
1366
- return `${n}${a}${Y2({ output: e.output, options: this.options, cursor: this.cursor, maxItems: e.maxItems, columnPadding: a.length, rowPadding: $2 + y2, style: c2 }).join(`
1367
- ${a}`)}
1431
+ return `${n}${o}${F2({ output: t.output, options: this.options, cursor: this.cursor, maxItems: t.maxItems, columnPadding: o.length, rowPadding: d + g, style: c }).join(`
1432
+ ${o}`)}
1368
1433
  ${l}
1369
1434
  `;
1370
1435
  }
1371
1436
  default: {
1372
- const a = r ? `${t("cyan", d2)} ` : "", l = n.split(`
1373
- `).length, $2 = r ? 2 : 1;
1374
- return `${n}${a}${Y2({ output: e.output, options: this.options, cursor: this.cursor, maxItems: e.maxItems, columnPadding: a.length, rowPadding: l + $2, style: c2 }).join(`
1375
- ${a}`)}
1376
- ${r ? t("cyan", E2) : ""}
1437
+ const o = r ? `${e("cyan", $2)} ` : "", l = n.split(`
1438
+ `).length, d = r ? 2 : 1;
1439
+ return `${n}${o}${F2({ output: t.output, options: this.options, cursor: this.cursor, maxItems: t.maxItems, columnPadding: o.length, rowPadding: l + d, style: c }).join(`
1440
+ ${o}`)}
1441
+ ${r ? e("cyan", x2) : ""}
1377
1442
  `;
1378
1443
  }
1379
1444
  }
1380
1445
  } }).prompt();
1381
1446
  };
1382
- var Ct = (e) => t("magenta", e);
1383
- var fe = ({ indicator: e = "dots", onCancel: i, output: s = process.stdout, cancelMessage: r, errorMessage: u2, frames: n = ee ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"], delay: o = ee ? 80 : 120, signal: c2, ...a } = {}) => {
1384
- const l = ae();
1385
- let $2, y2, p2 = false, m = false, g = "", S2, h = performance.now();
1386
- const f = O(s), v = a?.styleFrame ?? Ct, T2 = (_2) => {
1387
- const A2 = _2 > 1 ? u2 ?? u.messages.error : r ?? u.messages.cancel;
1388
- m = _2 === 1, p2 && (W2(A2, _2), m && typeof i == "function" && i());
1389
- }, C2 = () => T2(2), b = () => T2(1), x = () => {
1390
- process.on("uncaughtExceptionMonitor", C2), process.on("unhandledRejection", C2), process.on("SIGINT", b), process.on("SIGTERM", b), process.on("exit", T2), c2 && c2.addEventListener("abort", b);
1391
- }, G2 = () => {
1392
- process.removeListener("uncaughtExceptionMonitor", C2), process.removeListener("unhandledRejection", C2), process.removeListener("SIGINT", b), process.removeListener("SIGTERM", b), process.removeListener("exit", T2), c2 && c2.removeEventListener("abort", b);
1393
- }, M2 = () => {
1394
- if (S2 === undefined)
1447
+ var Te = (t) => e("magenta", t);
1448
+ var ft = ({ indicator: t = "dots", onCancel: i, output: s = process.stdout, cancelMessage: r, errorMessage: u, frames: n = tt2 ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"], delay: a = tt2 ? 80 : 120, signal: c, ...o } = {}) => {
1449
+ const l = ot2();
1450
+ let d, g, p2 = false, f2 = false, h2 = "", I2, m2 = performance.now();
1451
+ const y = A(s), v2 = o?.styleFrame ?? Te, C2 = (_) => {
1452
+ const A2 = _ > 1 ? u ?? h.messages.error : r ?? h.messages.cancel;
1453
+ f2 = _ === 1, p2 && (W2(A2, _), f2 && typeof i == "function" && i());
1454
+ }, S2 = () => C2(2), b2 = () => C2(1), G2 = () => {
1455
+ process.on("uncaughtExceptionMonitor", S2), process.on("unhandledRejection", S2), process.on("SIGINT", b2), process.on("SIGTERM", b2), process.on("exit", C2), c && c.addEventListener("abort", b2);
1456
+ }, M = () => {
1457
+ process.removeListener("uncaughtExceptionMonitor", S2), process.removeListener("unhandledRejection", S2), process.removeListener("SIGINT", b2), process.removeListener("SIGTERM", b2), process.removeListener("exit", C2), c && c.removeEventListener("abort", b2);
1458
+ }, N2 = () => {
1459
+ if (I2 === undefined)
1395
1460
  return;
1396
1461
  l && s.write(`
1397
1462
  `);
1398
- const _2 = wrapAnsi(S2, f, { hard: true, trim: false }).split(`
1463
+ const _ = wrapAnsi(I2, y, { hard: true, trim: false }).split(`
1399
1464
  `);
1400
- _2.length > 1 && s.write(import_sisteransi2.cursor.up(_2.length - 1)), s.write(import_sisteransi2.cursor.to(0)), s.write(import_sisteransi2.erase.down());
1401
- }, R2 = (_2) => _2.replace(/\.+$/, ""), j2 = (_2) => {
1402
- const A2 = (performance.now() - _2) / 1000, k2 = Math.floor(A2 / 60), L2 = Math.floor(A2 % 60);
1403
- return k2 > 0 ? `[${k2}m ${L2}s]` : `[${L2}s]`;
1404
- }, D2 = a.withGuide ?? u.withGuide, ie = (_2 = "") => {
1405
- p2 = true, $2 = z({ output: s }), g = R2(_2), h = performance.now(), D2 && s.write(`${t("gray", d2)}
1465
+ _.length > 1 && s.write(import_sisteransi2.cursor.up(_.length - 1)), s.write(import_sisteransi2.cursor.to(0)), s.write(import_sisteransi2.erase.down());
1466
+ }, O2 = (_) => _.replace(/\.+$/, ""), j2 = (_) => {
1467
+ const A2 = (performance.now() - _) / 1000, L2 = Math.floor(A2 / 60), D2 = Math.floor(A2 % 60);
1468
+ return L2 > 0 ? `[${L2}m ${D2}s]` : `[${D2}s]`;
1469
+ }, k2 = o.withGuide ?? h.withGuide, rt2 = (_ = "") => {
1470
+ p2 = true, d = R({ output: s }), h2 = O2(_), m2 = performance.now(), k2 && s.write(`${e("gray", $2)}
1406
1471
  `);
1407
- let A2 = 0, k2 = 0;
1408
- x(), y2 = setInterval(() => {
1409
- if (l && g === S2)
1472
+ let A2 = 0, L2 = 0;
1473
+ G2(), g = setInterval(() => {
1474
+ if (l && h2 === I2)
1410
1475
  return;
1411
- M2(), S2 = g;
1412
- const L2 = v(n[A2]);
1476
+ N2(), I2 = h2;
1477
+ const D2 = v2(n[A2]);
1413
1478
  let Z2;
1414
1479
  if (l)
1415
- Z2 = `${L2} ${g}...`;
1416
- else if (e === "timer")
1417
- Z2 = `${L2} ${g} ${j2(h)}`;
1480
+ Z2 = `${D2} ${h2}...`;
1481
+ else if (t === "timer")
1482
+ Z2 = `${D2} ${h2} ${j2(m2)}`;
1418
1483
  else {
1419
- const Be = ".".repeat(Math.floor(k2)).slice(0, 3);
1420
- Z2 = `${L2} ${g}${Be}`;
1484
+ const kt = ".".repeat(Math.floor(L2)).slice(0, 3);
1485
+ Z2 = `${D2} ${h2}${kt}`;
1421
1486
  }
1422
- const Ne = wrapAnsi(Z2, f, { hard: true, trim: false });
1423
- s.write(Ne), A2 = A2 + 1 < n.length ? A2 + 1 : 0, k2 = k2 < 4 ? k2 + 0.125 : 0;
1424
- }, o);
1425
- }, W2 = (_2 = "", A2 = 0, k2 = false) => {
1487
+ const Bt = wrapAnsi(Z2, y, { hard: true, trim: false });
1488
+ s.write(Bt), A2 = A2 + 1 < n.length ? A2 + 1 : 0, L2 = L2 < 4 ? L2 + 0.125 : 0;
1489
+ }, a);
1490
+ }, W2 = (_ = "", A2 = 0, L2 = false) => {
1426
1491
  if (!p2)
1427
1492
  return;
1428
- p2 = false, clearInterval(y2), M2();
1429
- const L2 = A2 === 0 ? t("green", F2) : A2 === 1 ? t("red", oe) : t("red", ue);
1430
- g = _2 ?? g, k2 || (e === "timer" ? s.write(`${L2} ${g} ${j2(h)}
1431
- `) : s.write(`${L2} ${g}
1432
- `)), G2(), $2();
1493
+ p2 = false, clearInterval(g), N2();
1494
+ const D2 = A2 === 0 ? e("green", H2) : A2 === 1 ? e("red", at2) : e("red", ut2);
1495
+ h2 = _ ?? h2, L2 || (t === "timer" ? s.write(`${D2} ${h2} ${j2(m2)}
1496
+ `) : s.write(`${D2} ${h2}
1497
+ `)), M(), d();
1433
1498
  };
1434
- return { start: ie, stop: (_2 = "") => W2(_2, 0), message: (_2 = "") => {
1435
- g = R2(_2 ?? g);
1436
- }, cancel: (_2 = "") => W2(_2, 1), error: (_2 = "") => W2(_2, 2), clear: () => W2("", 0, true), get isCancelled() {
1437
- return m;
1499
+ return { start: rt2, stop: (_ = "") => W2(_, 0), message: (_ = "") => {
1500
+ h2 = O2(_ ?? h2);
1501
+ }, cancel: (_ = "") => W2(_, 1), error: (_ = "") => W2(_, 2), clear: () => W2("", 0, true), get isCancelled() {
1502
+ return f2;
1438
1503
  } };
1439
1504
  };
1440
- var Ve = { light: w2("\u2500", "-"), heavy: w2("\u2501", "="), block: w2("\u2588", "#") };
1441
- var re = (e, i) => e.includes(`
1442
- `) ? e.split(`
1505
+ var jt = { light: w2("\u2500", "-"), heavy: w2("\u2501", "="), block: w2("\u2588", "#") };
1506
+ var it2 = (t, i) => t.includes(`
1507
+ `) ? t.split(`
1443
1508
  `).map((s) => i(s)).join(`
1444
- `) : i(e);
1445
- var _t = (e) => {
1509
+ `) : i(t);
1510
+ var xe = (t) => {
1446
1511
  const i = (s, r) => {
1447
- const u2 = s.label ?? String(s.value);
1512
+ const u = s.label ?? String(s.value);
1448
1513
  switch (r) {
1449
1514
  case "disabled":
1450
- return `${t("gray", H2)} ${re(u2, (n) => t("gray", n))}${s.hint ? ` ${t("dim", `(${s.hint ?? "disabled"})`)}` : ""}`;
1515
+ return `${e("gray", U2)} ${it2(u, (n) => e("gray", n))}${s.hint ? ` ${e("dim", `(${s.hint ?? "disabled"})`)}` : ""}`;
1451
1516
  case "selected":
1452
- return `${re(u2, (n) => t("dim", n))}`;
1517
+ return `${it2(u, (n) => e("dim", n))}`;
1453
1518
  case "active":
1454
- return `${t("green", z2)} ${u2}${s.hint ? ` ${t("dim", `(${s.hint})`)}` : ""}`;
1519
+ return `${e("green", z2)} ${u}${s.hint ? ` ${e("dim", `(${s.hint})`)}` : ""}`;
1455
1520
  case "cancelled":
1456
- return `${re(u2, (n) => t(["strikethrough", "dim"], n))}`;
1521
+ return `${it2(u, (n) => e(["strikethrough", "dim"], n))}`;
1457
1522
  default:
1458
- return `${t("dim", H2)} ${re(u2, (n) => t("dim", n))}`;
1523
+ return `${e("dim", U2)} ${it2(u, (n) => e("dim", n))}`;
1459
1524
  }
1460
1525
  };
1461
- return new nt({ options: e.options, signal: e.signal, input: e.input, output: e.output, initialValue: e.initialValue, render() {
1462
- const s = e.withGuide ?? u.withGuide, r = `${V2(this.state)} `, u2 = `${ye(this.state)} `, n = R(e.output, e.message, u2, r), o = `${s ? `${t("gray", d2)}
1526
+ return new ut({ options: t.options, signal: t.signal, input: t.input, output: t.output, initialValue: t.initialValue, render() {
1527
+ const s = t.withGuide ?? h.withGuide, r = `${P2(this.state)} `, u = `${yt(this.state)} `, n = W(t.output, t.message, u, r), a = `${s ? `${e("gray", $2)}
1463
1528
  ` : ""}${n}
1464
1529
  `;
1465
1530
  switch (this.state) {
1466
1531
  case "submit": {
1467
- const c2 = s ? `${t("gray", d2)} ` : "", a = R(e.output, i(this.options[this.cursor], "selected"), c2);
1468
- return `${o}${a}`;
1532
+ const c = s ? `${e("gray", $2)} ` : "", o = W(t.output, i(this.options[this.cursor], "selected"), c);
1533
+ return `${a}${o}`;
1469
1534
  }
1470
1535
  case "cancel": {
1471
- const c2 = s ? `${t("gray", d2)} ` : "", a = R(e.output, i(this.options[this.cursor], "cancelled"), c2);
1472
- return `${o}${a}${s ? `
1473
- ${t("gray", d2)}` : ""}`;
1536
+ const c = s ? `${e("gray", $2)} ` : "", o = W(t.output, i(this.options[this.cursor], "cancelled"), c);
1537
+ return `${a}${o}${s ? `
1538
+ ${e("gray", $2)}` : ""}`;
1474
1539
  }
1475
1540
  default: {
1476
- const c2 = s ? `${t("cyan", d2)} ` : "", a = s ? t("cyan", E2) : "", l = o.split(`
1477
- `).length, $2 = s ? 2 : 1;
1478
- return `${o}${c2}${Y2({ output: e.output, cursor: this.cursor, options: this.options, maxItems: e.maxItems, columnPadding: c2.length, rowPadding: l + $2, style: (y2, p2) => i(y2, y2.disabled ? "disabled" : p2 ? "active" : "inactive") }).join(`
1479
- ${c2}`)}
1480
- ${a}
1541
+ const c = s ? `${e("cyan", $2)} ` : "", o = s ? e("cyan", x2) : "", l = a.split(`
1542
+ `).length, d = s ? 2 : 1;
1543
+ return `${a}${c}${F2({ output: t.output, cursor: this.cursor, options: this.options, maxItems: t.maxItems, columnPadding: c.length, rowPadding: l + d, style: (g, p2) => i(g, g.disabled ? "disabled" : p2 ? "active" : "inactive") }).join(`
1544
+ ${c}`)}
1545
+ ${o}
1481
1546
  `;
1482
1547
  }
1483
1548
  }
1484
1549
  } }).prompt();
1485
1550
  };
1486
- var je = `${t("gray", d2)} `;
1487
- var Ot = (e) => new at({ validate: e.validate, placeholder: e.placeholder, defaultValue: e.defaultValue, initialValue: e.initialValue, output: e.output, signal: e.signal, input: e.input, render() {
1488
- const i = e?.withGuide ?? u.withGuide, s = `${`${i ? `${t("gray", d2)}
1489
- ` : ""}${V2(this.state)} `}${e.message}
1490
- `, r = e.placeholder ? t("inverse", e.placeholder[0]) + t("dim", e.placeholder.slice(1)) : t(["inverse", "hidden"], "_"), u2 = this.userInput ? this.userInputWithCursor : r, n = this.value ?? "";
1551
+ var Nt = `${e("gray", $2)} `;
1552
+ var Pe = (t) => new ht({ validate: t.validate, placeholder: t.placeholder, defaultValue: t.defaultValue, initialValue: t.initialValue, output: t.output, signal: t.signal, input: t.input, render() {
1553
+ const i = t?.withGuide ?? h.withGuide, s = `${`${i ? `${e("gray", $2)}
1554
+ ` : ""}${P2(this.state)} `}${t.message}
1555
+ `, r = t.placeholder ? e("inverse", t.placeholder[0]) + e("dim", t.placeholder.slice(1)) : e(["inverse", "hidden"], "_"), u = this.userInput ? this.userInputWithCursor : r, n = this.value ?? "";
1491
1556
  switch (this.state) {
1492
1557
  case "error": {
1493
- const o = this.error ? ` ${t("yellow", this.error)}` : "", c2 = i ? `${t("yellow", d2)} ` : "", a = i ? t("yellow", E2) : "";
1558
+ const a = this.error ? ` ${e("yellow", this.error)}` : "", c = i ? `${e("yellow", $2)} ` : "", o = i ? e("yellow", x2) : "";
1494
1559
  return `${s.trim()}
1495
- ${c2}${u2}
1496
- ${a}${o}
1560
+ ${c}${u}
1561
+ ${o}${a}
1497
1562
  `;
1498
1563
  }
1499
1564
  case "submit": {
1500
- const o = n ? ` ${t("dim", n)}` : "", c2 = i ? t("gray", d2) : "";
1501
- return `${s}${c2}${o}`;
1565
+ const a = n ? ` ${e("dim", n)}` : "", c = i ? e("gray", $2) : "";
1566
+ return `${s}${c}${a}`;
1502
1567
  }
1503
1568
  case "cancel": {
1504
- const o = n ? ` ${t(["strikethrough", "dim"], n)}` : "", c2 = i ? t("gray", d2) : "";
1505
- return `${s}${c2}${o}${n.trim() ? `
1506
- ${c2}` : ""}`;
1569
+ const a = n ? ` ${e(["strikethrough", "dim"], n)}` : "", c = i ? e("gray", $2) : "";
1570
+ return `${s}${c}${a}${n.trim() ? `
1571
+ ${c}` : ""}`;
1507
1572
  }
1508
1573
  default: {
1509
- const o = i ? `${t("cyan", d2)} ` : "", c2 = i ? t("cyan", E2) : "";
1510
- return `${s}${o}${u2}
1511
- ${c2}
1574
+ const a = i ? `${e("cyan", $2)} ` : "", c = i ? e("cyan", x2) : "";
1575
+ return `${s}${a}${u}
1576
+ ${c}
1512
1577
  `;
1513
1578
  }
1514
1579
  }
@@ -1519,13 +1584,13 @@ async function MultiSelect({
1519
1584
  message,
1520
1585
  options
1521
1586
  }) {
1522
- const selected = await yt({
1587
+ const selected = await ve({
1523
1588
  message,
1524
1589
  options,
1525
1590
  required: true
1526
1591
  });
1527
1592
  if (q(selected)) {
1528
- pt("Operation cancelled.");
1593
+ me("Operation cancelled.");
1529
1594
  process.exit(0);
1530
1595
  }
1531
1596
  return selected;
@@ -1546,9 +1611,7 @@ class AddCommand {
1546
1611
  console.log(`${CHECK({ text: "All changes are either staged or sensitive (like .env)." })}`);
1547
1612
  return;
1548
1613
  }
1549
- const options = [
1550
- ...changes.map((c2) => ({ value: c2.value, label: c2.label }))
1551
- ];
1614
+ const options = changes.map((c) => ({ value: c.value, label: c.label }));
1552
1615
  const selectedChanges = await MultiSelect({
1553
1616
  message: `Select the changes you want to commit.
1554
1617
  ` + BLUE({ text: "[space] to select" }) + `
@@ -1560,7 +1623,7 @@ class AddCommand {
1560
1623
  });
1561
1624
  let selected = selectedChanges.map((file) => file.trim());
1562
1625
  if (selected.includes("all")) {
1563
- selected = changes.map((c2) => c2.value);
1626
+ selected = changes.map((c) => c.value);
1564
1627
  }
1565
1628
  if (selected.length > 0) {
1566
1629
  await this.stageChangesUseCase.execute(selected);
@@ -1687,11 +1750,11 @@ class StageChangesUseCase {
1687
1750
  }
1688
1751
 
1689
1752
  // apps/cli/modules/add/infra/bun-git.repository.ts
1690
- var {$: $2 } = globalThis.Bun;
1753
+ var {$: $3 } = globalThis.Bun;
1691
1754
  class BunGitRepository {
1692
1755
  async getEntries() {
1693
1756
  try {
1694
- const output = await $2`git status --porcelain -z`.quiet().text();
1757
+ const output = await $3`git status --porcelain -z`.quiet().text();
1695
1758
  if (!output.trim()) {
1696
1759
  return [];
1697
1760
  }
@@ -1718,8 +1781,8 @@ async function addCommand() {
1718
1781
  const gitRepository = new BunGitRepository;
1719
1782
  const getChangesUseCase = new GetChangesUseCase(gitRepository);
1720
1783
  const stageChangesUseCase = new StageChangesUseCase(gitRepository);
1721
- const addCommand2 = new AddCommand(getChangesUseCase, stageChangesUseCase);
1722
- await addCommand2.execute();
1784
+ const addCmd = new AddCommand(getChangesUseCase, stageChangesUseCase);
1785
+ await addCmd.execute();
1723
1786
  }
1724
1787
 
1725
1788
  // apps/cli/alias.ts
@@ -1828,7 +1891,7 @@ async function Input({
1828
1891
  message,
1829
1892
  placeholder
1830
1893
  }) {
1831
- const value = await Ot({
1894
+ const value = await Pe({
1832
1895
  message,
1833
1896
  placeholder,
1834
1897
  validate(input) {
@@ -1838,7 +1901,7 @@ async function Input({
1838
1901
  }
1839
1902
  });
1840
1903
  if (q(value)) {
1841
- pt("Operation cancelled.");
1904
+ me("Operation cancelled.");
1842
1905
  process.exit(0);
1843
1906
  }
1844
1907
  return value.trim();
@@ -1849,12 +1912,12 @@ async function Select({
1849
1912
  message,
1850
1913
  options
1851
1914
  }) {
1852
- const selected = await _t({
1915
+ const selected = await xe({
1853
1916
  message,
1854
1917
  options
1855
1918
  });
1856
1919
  if (q(selected)) {
1857
- pt("Operation cancelled.");
1920
+ me("Operation cancelled.");
1858
1921
  process.exit(0);
1859
1922
  }
1860
1923
  return selected;
@@ -1902,8 +1965,8 @@ class BunCommitRepository {
1902
1965
  async function commitCommand() {
1903
1966
  const commitRepository = new BunCommitRepository;
1904
1967
  const commitUseCase = new CommitUseCase(commitRepository);
1905
- const commitCommand2 = new CommitCommand(commitUseCase);
1906
- await commitCommand2.execute();
1968
+ const commitCmd = new CommitCommand(commitUseCase);
1969
+ await commitCmd.execute();
1907
1970
  }
1908
1971
 
1909
1972
  // apps/cli/modules/setup/app/setup-aliases.use-case.ts
@@ -1931,12 +1994,12 @@ async function Confirm({
1931
1994
  cancelMessage,
1932
1995
  exitOnCancel = true
1933
1996
  }) {
1934
- const confirmed = await ot2({
1997
+ const confirmed = await ue({
1935
1998
  message
1936
1999
  });
1937
2000
  if (q(confirmed)) {
1938
2001
  if (exitOnCancel) {
1939
- pt(cancelMessage ?? "Operation cancelled.");
2002
+ me(cancelMessage ?? "Operation cancelled.");
1940
2003
  process.exit(0);
1941
2004
  }
1942
2005
  return null;
@@ -1946,17 +2009,17 @@ async function Confirm({
1946
2009
 
1947
2010
  // apps/cli/utils/intro.ts
1948
2011
  function Intro(message) {
1949
- mt(message);
2012
+ ge(message);
1950
2013
  }
1951
2014
 
1952
2015
  // apps/cli/utils/outro.ts
1953
2016
  function Outro(message) {
1954
- gt(message);
2017
+ ye(message);
1955
2018
  }
1956
2019
 
1957
2020
  // apps/cli/utils/spinner.ts
1958
2021
  function Spinner() {
1959
- return fe();
2022
+ return ft();
1960
2023
  }
1961
2024
 
1962
2025
  // apps/cli/modules/setup/app/setup-command.ts
@@ -2116,8 +2179,8 @@ class BunAliasRepository {
2116
2179
  async function setupCommand() {
2117
2180
  const aliasRepository = new BunAliasRepository;
2118
2181
  const setupAliasesUseCase = new SetupAliasesUseCase(aliasRepository);
2119
- const setupCommand2 = new SetupCommand(setupAliasesUseCase);
2120
- await setupCommand2.execute();
2182
+ const setupCmd = new SetupCommand(setupAliasesUseCase);
2183
+ await setupCmd.execute();
2121
2184
  }
2122
2185
 
2123
2186
  // apps/cli/modules/switch/domain/branch.ts
@@ -2226,11 +2289,11 @@ class SwitchCommand {
2226
2289
  }
2227
2290
 
2228
2291
  // apps/cli/modules/switch/infra/bun-switch-repository.ts
2229
- var {$: $3 } = globalThis.Bun;
2292
+ var {$: $4 } = globalThis.Bun;
2230
2293
  class BunSwitchRepository {
2231
2294
  async getBranches() {
2232
2295
  try {
2233
- const output = await $3`git branch -a`.quiet().text();
2296
+ const output = await $4`git branch -a`.quiet().text();
2234
2297
  if (!output.trim()) {
2235
2298
  return [];
2236
2299
  }
@@ -2256,8 +2319,8 @@ async function switchCommand() {
2256
2319
  const switchRepo = new BunSwitchRepository;
2257
2320
  const switchBranchUseCase = new SwitchBranch(switchRepo);
2258
2321
  const getBranchesUseCase = new GetBranchesUseCase(switchRepo);
2259
- const switchCommand2 = new SwitchCommand(getBranchesUseCase, switchBranchUseCase);
2260
- await switchCommand2.execute();
2322
+ const switchCmd = new SwitchCommand(getBranchesUseCase, switchBranchUseCase);
2323
+ await switchCmd.execute();
2261
2324
  }
2262
2325
 
2263
2326
  // apps/cli/commands-fn.ts
@@ -2271,7 +2334,7 @@ var COMMANDS_FN = {
2271
2334
 
2272
2335
  // apps/cli/index.ts
2273
2336
  var args = Bun.argv.slice(2);
2274
- var command = AVAILABLE_COMMANDS.find((command2) => command2.name === args[0]);
2337
+ var command = AVAILABLE_COMMANDS.find((cmd) => cmd.name === args[0]);
2275
2338
  if (command && args.length === 1) {
2276
2339
  await COMMANDS_FN[command.name]?.(args.slice(1));
2277
2340
  } else {