@donotdev/cli 0.1.45 → 0.2.0

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 (47) hide show
  1. package/dependencies-matrix.json +191 -150
  2. package/dist/bin/commands/agent-setup.js +632 -524
  3. package/dist/bin/commands/build.js +1239 -935
  4. package/dist/bin/commands/bump.js +1285 -946
  5. package/dist/bin/commands/cacheout.js +543 -405
  6. package/dist/bin/commands/coach.js +546 -408
  7. package/dist/bin/commands/create-app.js +1198 -862
  8. package/dist/bin/commands/create-project.js +1238 -902
  9. package/dist/bin/commands/db.js +139128 -93775
  10. package/dist/bin/commands/deploy.js +2308 -1936
  11. package/dist/bin/commands/dev.js +912 -662
  12. package/dist/bin/commands/doctor.js +634 -526
  13. package/dist/bin/commands/emu.js +1093 -785
  14. package/dist/bin/commands/format.js +588 -450
  15. package/dist/bin/commands/get-demo.js +1043 -756
  16. package/dist/bin/commands/make-admin.js +20974 -38424
  17. package/dist/bin/commands/preview.js +913 -663
  18. package/dist/bin/commands/seed.js +139129 -93776
  19. package/dist/bin/commands/setup-cicd.js +1130 -817
  20. package/dist/bin/commands/setup.js +1299 -960
  21. package/dist/bin/commands/staging.js +2308 -1936
  22. package/dist/bin/commands/sync-secrets.js +996 -733
  23. package/dist/bin/commands/type-check.js +733 -598
  24. package/dist/bin/commands/wai.js +533 -395
  25. package/dist/bin/dndev.js +9 -8
  26. package/dist/index.js +2720 -2290
  27. package/package.json +3 -3
  28. package/templates/app-next/src/app/ClientLayout.tsx.example +11 -1
  29. package/templates/app-next/src/app/layout.tsx.example +19 -1
  30. package/templates/functions-firebase/src/billing/handleStripeWebhook.ts.example +8 -18
  31. package/templates/functions-firebase/src/billing/index.ts.example +0 -1
  32. package/templates/functions-firebase/src/billing/refreshSubscriptionStatus.ts.example +4 -8
  33. package/templates/functions-firebase/src/index.ts.example +0 -1
  34. package/templates/functions-supabase/supabase/config.toml.example +4 -0
  35. package/templates/functions-supabase/supabase/functions/stripe-webhook/index.ts.example +12 -0
  36. package/templates/functions-supabase/supabase/migrations/20250101000005_webhook_events.sql +133 -0
  37. package/templates/functions-vercel/.env.example +9 -0
  38. package/templates/functions-vercel/src/api/billing/handleStripeWebhook.ts.example +12 -14
  39. package/templates/functions-vercel/src/api/billing/refreshSubscriptionStatus.ts.example +4 -14
  40. package/templates/overlay-supabase/src/config/providers.ts.example +2 -2
  41. package/templates/root-consumer/.claude/hooks/guard-write.sh.example +32 -0
  42. package/templates/root-consumer/.claude/hooks/record-lookup.sh.example +22 -0
  43. package/templates/root-consumer/.claude/rules/definition-of-done.md.example +7 -0
  44. package/templates/root-consumer/.claude/rules/framework.md.example +6 -0
  45. package/templates/root-consumer/.claude/settings.json.example +11 -1
  46. package/templates/functions-firebase/src/billing/processPaymentSuccess.ts.example +0 -14
  47. package/templates/functions-vercel/src/api/billing/processPaymentSuccess.ts.example +0 -20
@@ -5,16 +5,25 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
8
+ get: (a2, b) => (typeof require !== "undefined" ? require : a2)[b]
9
9
  }) : x)(function(x) {
10
10
  if (typeof require !== "undefined") return require.apply(this, arguments);
11
11
  throw Error('Dynamic require of "' + x + '" is not supported');
12
12
  });
13
- var __esm = (fn, res) => function __init() {
14
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
13
+ var __esm = (fn, res, err) => function __init() {
14
+ if (err) throw err[0];
15
+ try {
16
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
17
+ } catch (e) {
18
+ throw err = [e], e;
19
+ }
15
20
  };
16
21
  var __commonJS = (cb, mod) => function __require2() {
17
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
22
+ try {
23
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
24
+ } catch (e) {
25
+ throw mod = 0, e;
26
+ }
18
27
  };
19
28
  var __copyProps = (to, from, except, desc) => {
20
29
  if (from && typeof from === "object" || typeof from === "function") {
@@ -33,31 +42,40 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
33
42
  mod
34
43
  ));
35
44
 
36
- // node_modules/.bun/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/utils.js
37
- var isAmbiguous, isFullWidth, isWide;
45
+ // node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js
46
+ var getCodePointsLength, isFullWidth, isWideNotCJKTNotEmoji;
38
47
  var init_utils = __esm({
39
- "node_modules/.bun/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/utils.js"() {
48
+ "node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js"() {
40
49
  init_utils2();
41
- isAmbiguous = (x) => {
42
- 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;
43
- };
50
+ getCodePointsLength = /* @__PURE__ */ (() => {
51
+ const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
52
+ return (input) => {
53
+ let surrogatePairsNr = 0;
54
+ SURROGATE_PAIR_RE.lastIndex = 0;
55
+ while (SURROGATE_PAIR_RE.test(input)) {
56
+ surrogatePairsNr += 1;
57
+ }
58
+ return input.length - surrogatePairsNr;
59
+ };
60
+ })();
44
61
  isFullWidth = (x) => {
45
62
  return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
46
63
  };
47
- isWide = (x) => {
48
- 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;
64
+ isWideNotCJKTNotEmoji = (x) => {
65
+ 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;
49
66
  };
50
67
  }
51
68
  });
52
69
 
53
- // node_modules/.bun/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/index.js
54
- var ANSI_RE, CONTROL_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE, NO_TRUNCATION, getStringTruncatedWidth, dist_default;
70
+ // node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js
71
+ var ANSI_RE, CONTROL_RE, CJKT_WIDE_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE, NO_TRUNCATION, getStringTruncatedWidth, dist_default;
55
72
  var init_dist = __esm({
56
- "node_modules/.bun/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/index.js"() {
73
+ "node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js"() {
57
74
  init_utils2();
58
75
  init_utils();
59
- ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;
76
+ ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
60
77
  CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
78
+ 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;
61
79
  TAB_RE = /\t{1,1000}/y;
62
80
  EMOJI_RE = new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*", "yu");
63
81
  LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
@@ -67,14 +85,21 @@ var init_dist = __esm({
67
85
  const LIMIT = truncationOptions.limit ?? Infinity;
68
86
  const ELLIPSIS = truncationOptions.ellipsis ?? "";
69
87
  const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);
70
- const ANSI_WIDTH = widthOptions.ansiWidth ?? 0;
88
+ const ANSI_WIDTH = 0;
71
89
  const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
72
90
  const TAB_WIDTH = widthOptions.tabWidth ?? 8;
73
- const AMBIGUOUS_WIDTH = widthOptions.ambiguousWidth ?? 1;
74
91
  const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
75
- const FULL_WIDTH_WIDTH = widthOptions.fullWidthWidth ?? 2;
92
+ const FULL_WIDTH_WIDTH = 2;
76
93
  const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
77
- const WIDE_WIDTH = widthOptions.wideWidth ?? 2;
94
+ const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;
95
+ const PARSE_BLOCKS = [
96
+ [LATIN_RE, REGULAR_WIDTH],
97
+ [ANSI_RE, ANSI_WIDTH],
98
+ [CONTROL_RE, CONTROL_WIDTH],
99
+ [TAB_RE, TAB_WIDTH],
100
+ [EMOJI_RE, EMOJI_WIDTH],
101
+ [CJKT_WIDE_RE, WIDE_WIDTH]
102
+ ];
78
103
  let indexPrev = 0;
79
104
  let index = 0;
80
105
  let length = input.length;
@@ -94,10 +119,8 @@ var init_dist = __esm({
94
119
  const codePoint = char.codePointAt(0) || 0;
95
120
  if (isFullWidth(codePoint)) {
96
121
  widthExtra = FULL_WIDTH_WIDTH;
97
- } else if (isWide(codePoint)) {
122
+ } else if (isWideNotCJKTNotEmoji(codePoint)) {
98
123
  widthExtra = WIDE_WIDTH;
99
- } else if (AMBIGUOUS_WIDTH !== REGULAR_WIDTH && isAmbiguous(codePoint)) {
100
- widthExtra = AMBIGUOUS_WIDTH;
101
124
  } else {
102
125
  widthExtra = REGULAR_WIDTH;
103
126
  }
@@ -113,88 +136,28 @@ var init_dist = __esm({
113
136
  }
114
137
  unmatchedStart = unmatchedEnd = 0;
115
138
  }
116
- if (index >= length)
117
- break;
118
- LATIN_RE.lastIndex = index;
119
- if (LATIN_RE.test(input)) {
120
- lengthExtra = LATIN_RE.lastIndex - index;
121
- widthExtra = lengthExtra * REGULAR_WIDTH;
122
- if (width + widthExtra > truncationLimit) {
123
- truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / REGULAR_WIDTH));
124
- }
125
- if (width + widthExtra > LIMIT) {
126
- truncationEnabled = true;
127
- break;
128
- }
129
- width += widthExtra;
130
- unmatchedStart = indexPrev;
131
- unmatchedEnd = index;
132
- index = indexPrev = LATIN_RE.lastIndex;
133
- continue;
134
- }
135
- ANSI_RE.lastIndex = index;
136
- if (ANSI_RE.test(input)) {
137
- if (width + ANSI_WIDTH > truncationLimit) {
138
- truncationIndex = Math.min(truncationIndex, index);
139
- }
140
- if (width + ANSI_WIDTH > LIMIT) {
141
- truncationEnabled = true;
142
- break;
143
- }
144
- width += ANSI_WIDTH;
145
- unmatchedStart = indexPrev;
146
- unmatchedEnd = index;
147
- index = indexPrev = ANSI_RE.lastIndex;
148
- continue;
149
- }
150
- CONTROL_RE.lastIndex = index;
151
- if (CONTROL_RE.test(input)) {
152
- lengthExtra = CONTROL_RE.lastIndex - index;
153
- widthExtra = lengthExtra * CONTROL_WIDTH;
154
- if (width + widthExtra > truncationLimit) {
155
- truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / CONTROL_WIDTH));
156
- }
157
- if (width + widthExtra > LIMIT) {
158
- truncationEnabled = true;
159
- break;
160
- }
161
- width += widthExtra;
162
- unmatchedStart = indexPrev;
163
- unmatchedEnd = index;
164
- index = indexPrev = CONTROL_RE.lastIndex;
165
- continue;
166
- }
167
- TAB_RE.lastIndex = index;
168
- if (TAB_RE.test(input)) {
169
- lengthExtra = TAB_RE.lastIndex - index;
170
- widthExtra = lengthExtra * TAB_WIDTH;
171
- if (width + widthExtra > truncationLimit) {
172
- truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / TAB_WIDTH));
173
- }
174
- if (width + widthExtra > LIMIT) {
175
- truncationEnabled = true;
176
- break;
177
- }
178
- width += widthExtra;
179
- unmatchedStart = indexPrev;
180
- unmatchedEnd = index;
181
- index = indexPrev = TAB_RE.lastIndex;
182
- continue;
139
+ if (index >= length) {
140
+ break outer;
183
141
  }
184
- EMOJI_RE.lastIndex = index;
185
- if (EMOJI_RE.test(input)) {
186
- if (width + EMOJI_WIDTH > truncationLimit) {
187
- truncationIndex = Math.min(truncationIndex, index);
188
- }
189
- if (width + EMOJI_WIDTH > LIMIT) {
190
- truncationEnabled = true;
191
- break;
142
+ for (let i2 = 0, l2 = PARSE_BLOCKS.length; i2 < l2; i2++) {
143
+ const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i2];
144
+ BLOCK_RE.lastIndex = index;
145
+ if (BLOCK_RE.test(input)) {
146
+ lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index;
147
+ widthExtra = lengthExtra * BLOCK_WIDTH;
148
+ if (width + widthExtra > truncationLimit) {
149
+ truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));
150
+ }
151
+ if (width + widthExtra > LIMIT) {
152
+ truncationEnabled = true;
153
+ break outer;
154
+ }
155
+ width += widthExtra;
156
+ unmatchedStart = indexPrev;
157
+ unmatchedEnd = index;
158
+ index = indexPrev = BLOCK_RE.lastIndex;
159
+ continue outer;
192
160
  }
193
- width += EMOJI_WIDTH;
194
- unmatchedStart = indexPrev;
195
- unmatchedEnd = index;
196
- index = indexPrev = EMOJI_RE.lastIndex;
197
- continue;
198
161
  }
199
162
  index += 1;
200
163
  }
@@ -209,10 +172,10 @@ var init_dist = __esm({
209
172
  }
210
173
  });
211
174
 
212
- // node_modules/.bun/fast-string-width@1.1.0/node_modules/fast-string-width/dist/index.js
175
+ // node_modules/.bun/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js
213
176
  var NO_TRUNCATION2, fastStringWidth, dist_default2;
214
177
  var init_dist2 = __esm({
215
- "node_modules/.bun/fast-string-width@1.1.0/node_modules/fast-string-width/dist/index.js"() {
178
+ "node_modules/.bun/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js"() {
216
179
  init_utils2();
217
180
  init_dist();
218
181
  NO_TRUNCATION2 = {
@@ -227,13 +190,13 @@ var init_dist2 = __esm({
227
190
  }
228
191
  });
229
192
 
230
- // node_modules/.bun/fast-wrap-ansi@0.1.6/node_modules/fast-wrap-ansi/lib/main.js
193
+ // node_modules/.bun/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js
231
194
  function wrapAnsi(string, columns, options) {
232
195
  return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join("\n");
233
196
  }
234
197
  var ESC, CSI, END_CODE, ANSI_ESCAPE_BELL, ANSI_CSI, ANSI_OSC, ANSI_SGR_TERMINATOR, ANSI_ESCAPE_LINK, GROUP_REGEX, getClosingCode, wrapAnsiCode, wrapAnsiHyperlink, wrapWord, stringVisibleTrimSpacesRight, exec, CRLF_OR_LF;
235
198
  var init_main = __esm({
236
- "node_modules/.bun/fast-wrap-ansi@0.1.6/node_modules/fast-wrap-ansi/lib/main.js"() {
199
+ "node_modules/.bun/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js"() {
237
200
  init_utils2();
238
201
  init_dist2();
239
202
  ESC = "\x1B";
@@ -397,16 +360,19 @@ var init_main = __esm({
397
360
  }
398
361
  const preString = rows.join("\n");
399
362
  let inSurrogate = false;
400
- for (let i = 0; i < preString.length; i++) {
401
- const character = preString[i];
363
+ for (let i2 = 0; i2 < preString.length; i2++) {
364
+ const character = preString[i2];
402
365
  returnValue += character;
403
366
  if (!inSurrogate) {
404
367
  inSurrogate = character >= "\uD800" && character <= "\uDBFF";
368
+ if (inSurrogate) {
369
+ continue;
370
+ }
405
371
  } else {
406
- continue;
372
+ inSurrogate = false;
407
373
  }
408
374
  if (character === ESC || character === CSI) {
409
- GROUP_REGEX.lastIndex = i + 1;
375
+ GROUP_REGEX.lastIndex = i2 + 1;
410
376
  const groupsResult = GROUP_REGEX.exec(preString);
411
377
  const groups = groupsResult?.groups;
412
378
  if (groups?.code !== void 0) {
@@ -416,7 +382,7 @@ var init_main = __esm({
416
382
  escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
417
383
  }
418
384
  }
419
- if (preString[i + 1] === "\n") {
385
+ if (preString[i2 + 1] === "\n") {
420
386
  if (escapeUrl) {
421
387
  returnValue += wrapAnsiHyperlink("");
422
388
  }
@@ -447,7 +413,7 @@ var require_src = __commonJS({
447
413
  var ESC2 = "\x1B";
448
414
  var CSI2 = `${ESC2}[`;
449
415
  var beep = "\x07";
450
- var cursor = {
416
+ var cursor3 = {
451
417
  to(x, y2) {
452
418
  if (!y2) return `${CSI2}${x + 1}G`;
453
419
  return `${CSI2}${y2 + 1};${x + 1}H`;
@@ -476,7 +442,7 @@ var require_src = __commonJS({
476
442
  up: (count = 1) => `${CSI2}S`.repeat(count),
477
443
  down: (count = 1) => `${CSI2}T`.repeat(count)
478
444
  };
479
- var erase = {
445
+ var erase3 = {
480
446
  screen: `${CSI2}2J`,
481
447
  up: (count = 1) => `${CSI2}1J`.repeat(count),
482
448
  down: (count = 1) => `${CSI2}J`.repeat(count),
@@ -485,89 +451,169 @@ var require_src = __commonJS({
485
451
  lineStart: `${CSI2}1K`,
486
452
  lines(count) {
487
453
  let clear = "";
488
- for (let i = 0; i < count; i++)
489
- clear += this.line + (i < count - 1 ? cursor.up() : "");
454
+ for (let i2 = 0; i2 < count; i2++)
455
+ clear += this.line + (i2 < count - 1 ? cursor3.up() : "");
490
456
  if (count)
491
- clear += cursor.left;
457
+ clear += cursor3.left;
492
458
  return clear;
493
459
  }
494
460
  };
495
- module.exports = { cursor, scroll, erase, beep };
461
+ module.exports = { cursor: cursor3, scroll, erase: erase3, beep };
496
462
  }
497
463
  });
498
464
 
499
- // node_modules/.bun/@clack+core@1.2.0/node_modules/@clack/core/dist/index.mjs
500
- import { styleText as y } from "node:util";
501
- import { stdout as S, stdin as $ } from "node:process";
502
- import * as _ from "node:readline";
503
- import P from "node:readline";
504
- import { ReadStream as D } from "node:tty";
505
- function d(r, t2, e) {
506
- if (!e.some((o) => !o.disabled)) return r;
507
- const s = r + t2, i = Math.max(e.length - 1, 0), n = s < 0 ? i : s > i ? 0 : s;
508
- return e[n].disabled ? d(n, t2 < 0 ? -1 : 1, e) : n;
465
+ // node_modules/.bun/@clack+core@1.5.1/node_modules/@clack/core/dist/index.mjs
466
+ import { styleText } from "node:util";
467
+ import { stdout, stdin } from "node:process";
468
+ import * as l from "node:readline";
469
+ import l__default from "node:readline";
470
+ import { ReadStream } from "node:tty";
471
+ function findCursor(s, o, l2) {
472
+ if (!l2.some((r2) => !r2.disabled))
473
+ return s;
474
+ const t2 = s + o, n3 = Math.max(l2.length - 1, 0), e = t2 < 0 ? n3 : t2 > n3 ? 0 : t2;
475
+ return l2[e]?.disabled ? findCursor(e, o < 0 ? -1 : 1, l2) : e;
509
476
  }
510
- function V(r, t2) {
511
- if (typeof r == "string") return u.aliases.get(r) === t2;
512
- for (const e of r) if (e !== void 0 && V(e, t2)) return true;
477
+ function isAccessible(n3) {
478
+ if (n3 !== void 0) return n3;
479
+ if (settings.accessible !== void 0) return settings.accessible;
480
+ const e = process.env.ACCESSIBLE;
481
+ return e !== void 0 && e !== "" && e !== "0" && e !== "false";
482
+ }
483
+ function isActionKey(n3, e) {
484
+ if (typeof n3 == "string")
485
+ return settings.aliases.get(n3) === e;
486
+ for (const s of n3)
487
+ if (s !== void 0 && isActionKey(s, e))
488
+ return true;
513
489
  return false;
514
490
  }
515
- function j(r, t2) {
516
- if (r === t2) return;
517
- const e = r.split(`
518
- `), s = t2.split(`
519
- `), i = Math.max(e.length, s.length), n = [];
520
- for (let o = 0; o < i; o++) e[o] !== s[o] && n.push(o);
521
- return { lines: n, numLinesBefore: e.length, numLinesAfter: s.length, numLines: i };
491
+ function diffLines(i2, s) {
492
+ if (i2 === s) return;
493
+ const e = i2.split(`
494
+ `), t2 = s.split(`
495
+ `), r2 = Math.max(e.length, t2.length), f = [];
496
+ for (let n3 = 0; n3 < r2; n3++)
497
+ e[n3] !== t2[n3] && f.push(n3);
498
+ return {
499
+ lines: f,
500
+ numLinesBefore: e.length,
501
+ numLinesAfter: t2.length,
502
+ numLines: r2
503
+ };
522
504
  }
523
- function q(r) {
524
- return r === C;
505
+ function isCancel(e) {
506
+ return e === CANCEL_SYMBOL;
525
507
  }
526
- function w(r, t2) {
527
- const e = r;
528
- e.isTTY && e.setRawMode(t2);
508
+ function setRawMode(e, r2) {
509
+ const o = e;
510
+ o.isTTY && o.setRawMode(r2);
529
511
  }
530
- function z({ input: r = $, output: t2 = S, overwrite: e = true, hideCursor: s = true } = {}) {
531
- const i = _.createInterface({ input: r, output: t2, prompt: "", tabSize: 1 });
532
- _.emitKeypressEvents(r, i), r instanceof D && r.isTTY && r.setRawMode(true);
533
- const n = (o, { name: a, sequence: h }) => {
534
- const l = String(o);
535
- if (V([l, a, h], "cancel")) {
536
- s && t2.write(import_sisteransi.cursor.show), process.exit(0);
512
+ function block({
513
+ input: e = stdin,
514
+ output: r2 = stdout,
515
+ overwrite: o = true,
516
+ hideCursor: n3 = true
517
+ } = {}) {
518
+ const s = l.createInterface({
519
+ input: e,
520
+ output: r2,
521
+ prompt: "",
522
+ tabSize: 1
523
+ });
524
+ l.emitKeypressEvents(e, s), e instanceof ReadStream && e.isTTY && e.setRawMode(true);
525
+ const t2 = (f, { name: a2, sequence: w }) => {
526
+ const c2 = String(f);
527
+ if (isActionKey([c2, a2, w], "cancel")) {
528
+ n3 && r2.write(import_sisteransi.cursor.show), process.exit(0);
537
529
  return;
538
530
  }
539
- if (!e) return;
540
- const f = a === "return" ? 0 : -1, v = a === "return" ? -1 : 0;
541
- _.moveCursor(t2, f, v, () => {
542
- _.clearLine(t2, 1, () => {
543
- r.once("keypress", n);
531
+ if (!o) return;
532
+ const i2 = a2 === "return" ? 0 : -1, m = a2 === "return" ? -1 : 0;
533
+ l.moveCursor(r2, i2, m, () => {
534
+ l.clearLine(r2, 1, () => {
535
+ e.once("keypress", t2);
544
536
  });
545
537
  });
546
538
  };
547
- return s && t2.write(import_sisteransi.cursor.hide), r.once("keypress", n), () => {
548
- r.off("keypress", n), s && t2.write(import_sisteransi.cursor.show), r instanceof D && r.isTTY && !Y && r.setRawMode(false), i.terminal = false, i.close();
539
+ return n3 && r2.write(import_sisteransi.cursor.hide), e.once("keypress", t2), () => {
540
+ e.off("keypress", t2), n3 && r2.write(import_sisteransi.cursor.show), e instanceof ReadStream && e.isTTY && !R && e.setRawMode(false), s.terminal = false, s.close();
549
541
  };
550
542
  }
551
- function R(r, t2, e, s = e) {
552
- const i = O(r ?? S);
553
- return wrapAnsi(t2, i - e.length, { hard: true, trim: false }).split(`
554
- `).map((n, o) => `${o === 0 ? s : e}${n}`).join(`
543
+ function wrapTextWithPrefix(e, r2, o, n3 = o, s = o, t2) {
544
+ const f = getColumns(e ?? stdout);
545
+ return wrapAnsi(r2, f - o.length, {
546
+ hard: true,
547
+ trim: false
548
+ }).split(`
549
+ `).map((c2, i2, m) => {
550
+ const d = t2 ? t2(c2, i2) : c2;
551
+ return i2 === 0 ? `${n3}${d}` : i2 === m.length - 1 ? `${s}${d}` : `${o}${d}`;
552
+ }).join(`
555
553
  `);
556
554
  }
557
- var import_sisteransi, E, G, u, Y, C, O, A, p, nt;
555
+ function runValidation(e, a2) {
556
+ if ("~standard" in e) {
557
+ const n3 = e["~standard"].validate(a2);
558
+ return n3 instanceof Promise ? n3.then((r2) => r2.issues?.at(0)?.message) : n3.issues?.at(0)?.message;
559
+ }
560
+ return e(a2);
561
+ }
562
+ var import_sisteransi, a$1, t, settings, R, CANCEL_SYMBOL, getColumns, getRows, y, n$1;
558
563
  var init_dist3 = __esm({
559
- "node_modules/.bun/@clack+core@1.2.0/node_modules/@clack/core/dist/index.mjs"() {
564
+ "node_modules/.bun/@clack+core@1.5.1/node_modules/@clack/core/dist/index.mjs"() {
560
565
  init_utils2();
561
566
  init_main();
562
567
  import_sisteransi = __toESM(require_src(), 1);
563
- E = ["up", "down", "left", "right", "space", "enter", "cancel"];
564
- G = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
565
- u = { actions: new Set(E), aliases: /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["", "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, t2) => `There are only ${r} days in ${t2}`, 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)}` } } };
566
- Y = globalThis.process.platform.startsWith("win");
567
- C = /* @__PURE__ */ Symbol("clack:cancel");
568
- O = (r) => "columns" in r && typeof r.columns == "number" ? r.columns : 80;
569
- A = (r) => "rows" in r && typeof r.rows == "number" ? r.rows : 20;
570
- p = class {
568
+ a$1 = ["up", "down", "left", "right", "space", "enter", "cancel"];
569
+ t = [
570
+ "January",
571
+ "February",
572
+ "March",
573
+ "April",
574
+ "May",
575
+ "June",
576
+ "July",
577
+ "August",
578
+ "September",
579
+ "October",
580
+ "November",
581
+ "December"
582
+ ];
583
+ settings = {
584
+ actions: new Set(a$1),
585
+ aliases: /* @__PURE__ */ new Map([
586
+ // vim support
587
+ ["k", "up"],
588
+ ["j", "down"],
589
+ ["h", "left"],
590
+ ["l", "right"],
591
+ ["", "cancel"],
592
+ // opinionated defaults!
593
+ ["escape", "cancel"]
594
+ ]),
595
+ messages: {
596
+ cancel: "Canceled",
597
+ error: "Something went wrong"
598
+ },
599
+ withGuide: true,
600
+ accessible: void 0,
601
+ date: {
602
+ monthNames: [...t],
603
+ messages: {
604
+ required: "Please enter a valid date",
605
+ invalidMonth: "There are only 12 months in a year",
606
+ invalidDay: (n3, e) => `There are only ${n3} days in ${e}`,
607
+ afterMin: (n3) => `Date must be on or after ${n3.toISOString().slice(0, 10)}`,
608
+ beforeMax: (n3) => `Date must be on or before ${n3.toISOString().slice(0, 10)}`
609
+ }
610
+ }
611
+ };
612
+ R = globalThis.process.platform.startsWith("win");
613
+ CANCEL_SYMBOL = /* @__PURE__ */ Symbol("clack:cancel");
614
+ getColumns = (e) => "columns" in e && typeof e.columns == "number" ? e.columns : 80;
615
+ getRows = (e) => "rows" in e && typeof e.rows == "number" ? e.rows : 20;
616
+ y = class {
571
617
  input;
572
618
  output;
573
619
  _abortSignal;
@@ -582,46 +628,92 @@ var init_dist3 = __esm({
582
628
  error = "";
583
629
  value;
584
630
  userInput = "";
631
+ /**
632
+ * Whether accessible (static, screen-reader friendly) output is enabled for
633
+ * this prompt, resolved from the `accessible` option, the global setting,
634
+ * and the `ACCESSIBLE` env var.
635
+ */
636
+ get accessible() {
637
+ return isAccessible(this.opts.accessible);
638
+ }
585
639
  constructor(t2, e = true) {
586
- const { input: s = $, output: i = S, render: n, signal: o, ...a } = t2;
587
- 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;
640
+ const { input: i2 = stdin, output: s = stdout, render: r2, signal: n3, ...o } = t2;
641
+ this.opts = o, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = r2.bind(this), this._track = e, this._abortSignal = n3, this.input = i2, this.output = s;
588
642
  }
643
+ /**
644
+ * Unsubscribe all listeners
645
+ */
589
646
  unsubscribe() {
590
647
  this._subscribers.clear();
591
648
  }
649
+ /**
650
+ * Set a subscriber with opts
651
+ * @param event - The event name
652
+ */
592
653
  setSubscriber(t2, e) {
593
- const s = this._subscribers.get(t2) ?? [];
594
- s.push(e), this._subscribers.set(t2, s);
654
+ const i2 = this._subscribers.get(t2) ?? [];
655
+ i2.push(e), this._subscribers.set(t2, i2);
595
656
  }
657
+ /**
658
+ * Subscribe to an event
659
+ * @param event - The event name
660
+ * @param cb - The callback
661
+ */
596
662
  on(t2, e) {
597
663
  this.setSubscriber(t2, { cb: e });
598
664
  }
665
+ /**
666
+ * Subscribe to an event once
667
+ * @param event - The event name
668
+ * @param cb - The callback
669
+ */
599
670
  once(t2, e) {
600
671
  this.setSubscriber(t2, { cb: e, once: true });
601
672
  }
673
+ /**
674
+ * Emit an event with data
675
+ * @param event - The event name
676
+ * @param data - The data to pass to the callback
677
+ */
602
678
  emit(t2, ...e) {
603
- const s = this._subscribers.get(t2) ?? [], i = [];
604
- for (const n of s) n.cb(...e), n.once && i.push(() => s.splice(s.indexOf(n), 1));
605
- for (const n of i) n();
679
+ const i2 = this._subscribers.get(t2) ?? [], s = [];
680
+ for (const r2 of i2)
681
+ r2.cb(...e), r2.once && s.push(() => i2.splice(i2.indexOf(r2), 1));
682
+ for (const r2 of s)
683
+ r2();
606
684
  }
607
685
  prompt() {
608
686
  return new Promise((t2) => {
609
687
  if (this._abortSignal) {
610
- if (this._abortSignal.aborted) return this.state = "cancel", this.close(), t2(C);
611
- this._abortSignal.addEventListener("abort", () => {
612
- this.state = "cancel", this.close();
613
- }, { once: true });
688
+ if (this._abortSignal.aborted)
689
+ return this.state = "cancel", this.close(), t2(CANCEL_SYMBOL);
690
+ this._abortSignal.addEventListener(
691
+ "abort",
692
+ () => {
693
+ this.state = "cancel", this.close();
694
+ },
695
+ { once: true }
696
+ );
614
697
  }
615
- this.rl = P.createInterface({ input: this.input, tabSize: 2, prompt: "", escapeCodeTimeout: 50, terminal: true }), this.rl.prompt(), this.opts.initialUserInput !== void 0 && 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", () => {
616
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), w(this.input, false), t2(this.value);
698
+ this.rl = l__default.createInterface({
699
+ input: this.input,
700
+ tabSize: 2,
701
+ prompt: "",
702
+ escapeCodeTimeout: 50,
703
+ terminal: true
704
+ }), this.rl.prompt(), this.opts.initialUserInput !== void 0 && this._setUserInput(this.opts.initialUserInput, true), this.input.on("keypress", this.onKeypress), setRawMode(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
705
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(this.value);
617
706
  }), this.once("cancel", () => {
618
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), w(this.input, false), t2(C);
707
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(CANCEL_SYMBOL);
619
708
  });
620
709
  });
621
710
  }
622
711
  _isActionKey(t2, e) {
623
712
  return t2 === " ";
624
713
  }
714
+ _shouldSubmit(t2, e) {
715
+ return true;
716
+ }
625
717
  _setValue(t2) {
626
718
  this.value = t2, this.emit("value", this.value);
627
719
  }
@@ -631,19 +723,22 @@ var init_dist3 = __esm({
631
723
  _clearUserInput() {
632
724
  this.rl?.write(null, { ctrl: true, name: "u" }), this._setUserInput("");
633
725
  }
634
- onKeypress(t2, e) {
635
- if (this._track && e.name !== "return" && (e.name && this._isActionKey(t2, 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)), t2 && (t2.toLowerCase() === "y" || t2.toLowerCase() === "n") && this.emit("confirm", t2.toLowerCase() === "y"), this.emit("key", t2?.toLowerCase(), e), e?.name === "return") {
636
- if (this.opts.validate) {
637
- const s = this.opts.validate(this.value);
638
- s && (this.error = s instanceof Error ? s.message : s, this.state = "error", this.rl?.write(this.userInput));
726
+ async onKeypress(t2, e) {
727
+ if (this.state !== "validating") {
728
+ if (this._track && e.name !== "return" && (e.name && this._isActionKey(t2, 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 && settings.aliases.has(e.name) && this.emit("cursor", settings.aliases.get(e.name)), settings.actions.has(e.name) && this.emit("cursor", e.name)), t2 && (t2.toLowerCase() === "y" || t2.toLowerCase() === "n") && this.emit("confirm", t2.toLowerCase() === "y"), this.emit("key", t2, e), e?.name === "return" && this._shouldSubmit(t2, e)) {
729
+ if (this.opts.validate) {
730
+ const i2 = runValidation(this.opts.validate, this.value);
731
+ let s;
732
+ i2 instanceof Promise ? (this.state = "validating", this.render(), s = await i2) : s = i2, s && (this.error = s instanceof Error ? s.message : s, this.state = "error", this.rl?.write(this.userInput));
733
+ }
734
+ this.state !== "error" && (this.state = "submit");
639
735
  }
640
- this.state !== "error" && (this.state = "submit");
736
+ isActionKey([t2, 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();
641
737
  }
642
- V([t2, 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();
643
738
  }
644
739
  close() {
645
740
  this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
646
- `), w(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
741
+ `), setRawMode(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
647
742
  }
648
743
  restoreCursor() {
649
744
  const t2 = wrapAnsi(this._prevFrame, process.stdout.columns, { hard: true, trim: false }).split(`
@@ -651,34 +746,39 @@ var init_dist3 = __esm({
651
746
  this.output.write(import_sisteransi.cursor.move(-999, t2 * -1));
652
747
  }
653
748
  render() {
654
- const t2 = wrapAnsi(this._render(this) ?? "", process.stdout.columns, { hard: true, trim: false });
749
+ const t2 = wrapAnsi(this._render(this) ?? "", process.stdout.columns, {
750
+ hard: true,
751
+ trim: false
752
+ });
655
753
  if (t2 !== this._prevFrame) {
656
- if (this.state === "initial") this.output.write(import_sisteransi.cursor.hide);
754
+ if (this.state === "initial")
755
+ this.output.write(import_sisteransi.cursor.hide);
657
756
  else {
658
- const e = j(this._prevFrame, t2), s = A(this.output);
757
+ const e = diffLines(this._prevFrame, t2), i2 = getRows(this.output);
659
758
  if (this.restoreCursor(), e) {
660
- const i = Math.max(0, e.numLinesAfter - s), n = Math.max(0, e.numLinesBefore - s);
661
- let o = e.lines.find((a) => a >= i);
662
- if (o === void 0) {
759
+ const s = Math.max(0, e.numLinesAfter - i2), r2 = Math.max(0, e.numLinesBefore - i2);
760
+ let n3 = e.lines.find((o) => o >= s);
761
+ if (n3 === void 0) {
663
762
  this._prevFrame = t2;
664
763
  return;
665
764
  }
666
765
  if (e.lines.length === 1) {
667
- this.output.write(import_sisteransi.cursor.move(0, o - n)), this.output.write(import_sisteransi.erase.lines(1));
668
- const a = t2.split(`
766
+ this.output.write(import_sisteransi.cursor.move(0, n3 - r2)), this.output.write(import_sisteransi.erase.lines(1));
767
+ const o = t2.split(`
669
768
  `);
670
- this.output.write(a[o]), this._prevFrame = t2, this.output.write(import_sisteransi.cursor.move(0, a.length - o - 1));
769
+ this.output.write(o[n3]), this._prevFrame = t2, this.output.write(import_sisteransi.cursor.move(0, o.length - n3 - 1));
671
770
  return;
672
771
  } else if (e.lines.length > 1) {
673
- if (i < n) o = i;
772
+ if (s < r2)
773
+ n3 = s;
674
774
  else {
675
- const h = o - n;
676
- h > 0 && this.output.write(import_sisteransi.cursor.move(0, h));
775
+ const h2 = n3 - r2;
776
+ h2 > 0 && this.output.write(import_sisteransi.cursor.move(0, h2));
677
777
  }
678
778
  this.output.write(import_sisteransi.erase.down());
679
- const a = t2.split(`
680
- `).slice(o);
681
- this.output.write(a.join(`
779
+ const f = t2.split(`
780
+ `).slice(n3);
781
+ this.output.write(f.join(`
682
782
  `)), this._prevFrame = t2;
683
783
  return;
684
784
  }
@@ -689,27 +789,28 @@ var init_dist3 = __esm({
689
789
  }
690
790
  }
691
791
  };
692
- nt = class extends p {
792
+ n$1 = class n extends y {
693
793
  options;
694
794
  cursor = 0;
695
795
  get _selectedValue() {
696
796
  return this.options[this.cursor];
697
797
  }
698
798
  changeValue() {
699
- this.value = this._selectedValue.value;
700
- }
701
- constructor(t2) {
702
- super(t2, false), this.options = t2.options;
703
- const e = this.options.findIndex(({ value: i }) => i === t2.initialValue), s = e === -1 ? 0 : e;
704
- this.cursor = this.options[s].disabled ? d(s, 1, this.options) : s, this.changeValue(), this.on("cursor", (i) => {
705
- switch (i) {
799
+ const e = this._selectedValue;
800
+ this.value = e === void 0 ? void 0 : e.value;
801
+ }
802
+ constructor(e) {
803
+ super(e, false), this.options = e.options;
804
+ const o = this.options.findIndex(({ value: s }) => s === e.initialValue), t2 = o === -1 ? 0 : o;
805
+ this.cursor = this.options[t2]?.disabled ? findCursor(t2, 1, this.options) : t2, this.changeValue(), this.on("cursor", (s) => {
806
+ switch (s) {
706
807
  case "left":
707
808
  case "up":
708
- this.cursor = d(this.cursor, -1, this.options);
809
+ this.cursor = findCursor(this.cursor, -1, this.options);
709
810
  break;
710
811
  case "down":
711
812
  case "right":
712
- this.cursor = d(this.cursor, 1, this.options);
813
+ this.cursor = findCursor(this.cursor, 1, this.options);
713
814
  break;
714
815
  }
715
816
  this.changeValue();
@@ -719,253 +820,384 @@ var init_dist3 = __esm({
719
820
  }
720
821
  });
721
822
 
722
- // node_modules/.bun/@clack+prompts@1.2.0/node_modules/@clack/prompts/dist/index.mjs
723
- import { styleText as t, stripVTControlCharacters as ne } from "node:util";
724
- import P2 from "node:process";
725
- import { existsSync as Xe, lstatSync as we, readdirSync as ze } from "node:fs";
726
- import { dirname as be, join as Qe } from "node:path";
727
- function Ze() {
728
- 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";
823
+ // node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs
824
+ import { styleText as styleText2, stripVTControlCharacters } from "node:util";
825
+ import process$1 from "node:process";
826
+ import { existsSync, lstatSync, readdirSync } from "node:fs";
827
+ import { dirname, join } from "node:path";
828
+ function isUnicodeSupported() {
829
+ if (process$1.platform !== "win32") {
830
+ return process$1.env.TERM !== "linux";
831
+ }
832
+ return Boolean(process$1.env.CI) || Boolean(process$1.env.WT_SESSION) || Boolean(process$1.env.TERMINUS_SUBLIME) || process$1.env.ConEmuTask === "{cmd::Cmder}" || process$1.env.TERM_PROGRAM === "Terminus-Sublime" || process$1.env.TERM_PROGRAM === "vscode" || process$1.env.TERM === "xterm-256color" || process$1.env.TERM === "alacritty" || process$1.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
729
833
  }
730
- var import_sisteransi2, ee, ae, w2, _e, oe, ue, F, le, d2, E2, Ie, Ee, z2, H2, te, U, J, xe, se, ce, Ge, $e, de, Oe, he, pe, me, ge, V2, ye, et2, Y2, O2, pt, mt, gt, Ct, fe, Ve, re, _t, je;
834
+ function formatInstructionFooter(o, e) {
835
+ const r2 = [`${e ? `${styleText2("cyan", S_BAR)} ` : ""}${o.join(" \u2022 ")}`];
836
+ return e && r2.push(styleText2("cyan", S_BAR_END)), r2;
837
+ }
838
+ var import_sisteransi2, unicode, isCI, unicodeOr, S_STEP_ACTIVE, S_STEP_CANCEL, S_STEP_ERROR, S_STEP_SUBMIT, S_BAR_START, S_BAR, S_BAR_END, S_BAR_START_RIGHT, S_BAR_END_RIGHT, S_RADIO_ACTIVE, S_RADIO_INACTIVE, S_CHECKBOX_ACTIVE, S_CHECKBOX_SELECTED, S_CHECKBOX_INACTIVE, S_PASSWORD_MASK, S_BAR_H, S_CORNER_TOP_RIGHT, S_CONNECT_LEFT, S_CORNER_BOTTOM_RIGHT, S_CORNER_BOTTOM_LEFT, S_CORNER_TOP_LEFT, S_INFO, S_SUCCESS, S_WARN, S_ERROR, symbol, symbolBar, I, limitOptions, MULTISELECT_INSTRUCTIONS, log, cancel, intro, outro, W, spinner, u2, SELECT_INSTRUCTIONS, c, select, i;
731
839
  var init_dist4 = __esm({
732
- "node_modules/.bun/@clack+prompts@1.2.0/node_modules/@clack/prompts/dist/index.mjs"() {
840
+ "node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs"() {
733
841
  init_utils2();
734
842
  init_dist3();
735
843
  init_dist3();
736
844
  init_main();
737
845
  init_dist2();
738
846
  import_sisteransi2 = __toESM(require_src(), 1);
739
- ee = Ze();
740
- ae = () => process.env.CI === "true";
741
- w2 = (e, i) => ee ? e : i;
742
- _e = w2("\u25C6", "*");
743
- oe = w2("\u25A0", "x");
744
- ue = w2("\u25B2", "x");
745
- F = w2("\u25C7", "o");
746
- le = w2("\u250C", "T");
747
- d2 = w2("\u2502", "|");
748
- E2 = w2("\u2514", "\u2014");
749
- Ie = w2("\u2510", "T");
750
- Ee = w2("\u2518", "\u2014");
751
- z2 = w2("\u25CF", ">");
752
- H2 = w2("\u25CB", " ");
753
- te = w2("\u25FB", "[\u2022]");
754
- U = w2("\u25FC", "[+]");
755
- J = w2("\u25FB", "[ ]");
756
- xe = w2("\u25AA", "\u2022");
757
- se = w2("\u2500", "-");
758
- ce = w2("\u256E", "+");
759
- Ge = w2("\u251C", "+");
760
- $e = w2("\u256F", "+");
761
- de = w2("\u2570", "+");
762
- Oe = w2("\u256D", "+");
763
- he = w2("\u25CF", "\u2022");
764
- pe = w2("\u25C6", "*");
765
- me = w2("\u25B2", "!");
766
- ge = w2("\u25A0", "x");
767
- V2 = (e) => {
768
- switch (e) {
847
+ unicode = isUnicodeSupported();
848
+ isCI = () => process.env.CI === "true";
849
+ unicodeOr = (o, e) => unicode ? o : e;
850
+ S_STEP_ACTIVE = unicodeOr("\u25C6", "*");
851
+ S_STEP_CANCEL = unicodeOr("\u25A0", "x");
852
+ S_STEP_ERROR = unicodeOr("\u25B2", "x");
853
+ S_STEP_SUBMIT = unicodeOr("\u25C7", "o");
854
+ S_BAR_START = unicodeOr("\u250C", "T");
855
+ S_BAR = unicodeOr("\u2502", "|");
856
+ S_BAR_END = unicodeOr("\u2514", "\u2014");
857
+ S_BAR_START_RIGHT = unicodeOr("\u2510", "T");
858
+ S_BAR_END_RIGHT = unicodeOr("\u2518", "\u2014");
859
+ S_RADIO_ACTIVE = unicodeOr("\u25CF", ">");
860
+ S_RADIO_INACTIVE = unicodeOr("\u25CB", " ");
861
+ S_CHECKBOX_ACTIVE = unicodeOr("\u25FB", "[\u2022]");
862
+ S_CHECKBOX_SELECTED = unicodeOr("\u25FC", "[+]");
863
+ S_CHECKBOX_INACTIVE = unicodeOr("\u25FB", "[ ]");
864
+ S_PASSWORD_MASK = unicodeOr("\u25AA", "\u2022");
865
+ S_BAR_H = unicodeOr("\u2500", "-");
866
+ S_CORNER_TOP_RIGHT = unicodeOr("\u256E", "+");
867
+ S_CONNECT_LEFT = unicodeOr("\u251C", "+");
868
+ S_CORNER_BOTTOM_RIGHT = unicodeOr("\u256F", "+");
869
+ S_CORNER_BOTTOM_LEFT = unicodeOr("\u2570", "+");
870
+ S_CORNER_TOP_LEFT = unicodeOr("\u256D", "+");
871
+ S_INFO = unicodeOr("\u25CF", "\u2022");
872
+ S_SUCCESS = unicodeOr("\u25C6", "*");
873
+ S_WARN = unicodeOr("\u25B2", "!");
874
+ S_ERROR = unicodeOr("\u25A0", "x");
875
+ symbol = (o) => {
876
+ switch (o) {
769
877
  case "initial":
770
878
  case "active":
771
- return t("cyan", _e);
879
+ return styleText2("cyan", S_STEP_ACTIVE);
772
880
  case "cancel":
773
- return t("red", oe);
881
+ return styleText2("red", S_STEP_CANCEL);
774
882
  case "error":
775
- return t("yellow", ue);
883
+ return styleText2("yellow", S_STEP_ERROR);
776
884
  case "submit":
777
- return t("green", F);
885
+ return styleText2("green", S_STEP_SUBMIT);
886
+ case "validating":
887
+ return styleText2("dim", S_STEP_ACTIVE);
778
888
  }
779
889
  };
780
- ye = (e) => {
781
- switch (e) {
890
+ symbolBar = (o) => {
891
+ switch (o) {
782
892
  case "initial":
783
893
  case "active":
784
- return t("cyan", d2);
894
+ return styleText2("cyan", S_BAR);
785
895
  case "cancel":
786
- return t("red", d2);
896
+ return styleText2("red", S_BAR);
787
897
  case "error":
788
- return t("yellow", d2);
898
+ return styleText2("yellow", S_BAR);
789
899
  case "submit":
790
- return t("green", d2);
791
- }
792
- };
793
- et2 = (e, i, s, r, u2) => {
794
- let n = i, o = 0;
795
- for (let c2 = s; c2 < r; c2++) {
796
- const a = e[c2];
797
- if (n = n - a.length, o++, n <= u2) break;
798
- }
799
- return { lineCount: n, removals: o };
800
- };
801
- Y2 = ({ cursor: e, options: i, style: s, output: r = process.stdout, maxItems: u2 = Number.POSITIVE_INFINITY, columnPadding: n = 0, rowPadding: o = 4 }) => {
802
- 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);
803
- let p2 = 0;
804
- e >= y2 - 3 && (p2 = Math.max(Math.min(e - y2 + 3, i.length - y2), 0));
805
- let m = y2 < i.length && p2 > 0, g = y2 < i.length && p2 + y2 < i.length;
806
- const S2 = Math.min(p2 + y2, i.length), h = [];
900
+ return styleText2("green", S_BAR);
901
+ }
902
+ };
903
+ I = (l2, e, w, p, b, C = false) => {
904
+ let r2 = e, O = 0;
905
+ if (C)
906
+ for (let i2 = p - 1; i2 >= w; i2--) {
907
+ const m = l2[i2];
908
+ if (m && (r2 -= m.length), O++, r2 <= b) break;
909
+ }
910
+ else
911
+ for (let i2 = w; i2 < p; i2++) {
912
+ const m = l2[i2];
913
+ if (m && (r2 -= m.length), O++, r2 <= b) break;
914
+ }
915
+ return { lineCount: r2, removals: O };
916
+ };
917
+ limitOptions = ({
918
+ cursor: l2,
919
+ options: e,
920
+ style: w,
921
+ output: p = process.stdout,
922
+ maxItems: b = Number.POSITIVE_INFINITY,
923
+ columnPadding: C = 0,
924
+ rowPadding: r2 = 4
925
+ }) => {
926
+ const i2 = getColumns(p) - C, m = getRows(p), M = styleText2("dim", "..."), v = Math.max(m - r2, 0), a2 = Math.max(Math.min(b, v), 5);
807
927
  let f = 0;
808
- m && f++, g && f++;
809
- const v = p2 + (m ? 1 : 0), T = S2 - (g ? 1 : 0);
810
- for (let b = v; b < T; b++) {
811
- const x = wrapAnsi(s(i[b], b === e), c2, { hard: true, trim: false }).split(`
928
+ l2 >= a2 - 3 && (f = Math.max(
929
+ Math.min(l2 - a2 + 3, e.length - a2),
930
+ 0
931
+ ));
932
+ let d = a2 < e.length && f > 0, c2 = a2 < e.length && f + a2 < e.length;
933
+ const W2 = Math.min(
934
+ f + a2,
935
+ e.length
936
+ ), s = [];
937
+ let g = 0;
938
+ d && g++, c2 && g++;
939
+ const T = f + (d ? 1 : 0), y2 = W2 - (c2 ? 1 : 0);
940
+ for (let t2 = T; t2 < y2; t2++) {
941
+ const n3 = e[t2], o = n3 ? w(n3, t2 === l2) : "", h2 = wrapAnsi(o, i2, {
942
+ hard: true,
943
+ trim: false
944
+ }).split(`
812
945
  `);
813
- h.push(x), f += x.length;
814
- }
815
- if (f > $2) {
816
- let b = 0, x = 0, G2 = f;
817
- const M2 = e - v, R2 = (j2, D2) => et2(h, G2, j2, D2, $2);
818
- 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));
819
- }
820
- const C2 = [];
821
- m && C2.push(l);
822
- for (const b of h) for (const x of b) C2.push(x);
823
- return g && C2.push(l), C2;
824
- };
825
- O2 = { message: (e = [], { symbol: i = t("gray", d2), secondarySymbol: s = t("gray", d2), output: r = process.stdout, spacing: u2 = 1, withGuide: n } = {}) => {
826
- const o = [], c2 = n ?? u.withGuide, a = c2 ? s : "", l = c2 ? `${i} ` : "", $2 = c2 ? `${s} ` : "";
827
- for (let p2 = 0; p2 < u2; p2++) o.push(a);
828
- const y2 = Array.isArray(e) ? e : e.split(`
946
+ s.push(h2), g += h2.length;
947
+ }
948
+ if (g > v) {
949
+ let t2 = 0, n3 = 0, o = g;
950
+ const h2 = l2 - T;
951
+ let u3 = v;
952
+ const L = () => I(s, o, 0, h2, u3), E = () => I(
953
+ s,
954
+ o,
955
+ h2 + 1,
956
+ s.length,
957
+ u3,
958
+ true
959
+ );
960
+ d ? ({ lineCount: o, removals: t2 } = L(), o > u3 && (c2 || (u3 -= 1), { lineCount: o, removals: n3 } = E())) : (c2 || (u3 -= 1), { lineCount: o, removals: n3 } = E(), o > u3 && (u3 -= 1, { lineCount: o, removals: t2 } = L())), t2 > 0 && (d = true, s.splice(0, t2)), n3 > 0 && (c2 = true, s.splice(s.length - n3, n3));
961
+ }
962
+ const x = [];
963
+ d && x.push(M);
964
+ for (const t2 of s)
965
+ for (const n3 of t2)
966
+ x.push(n3);
967
+ return c2 && x.push(M), x;
968
+ };
969
+ MULTISELECT_INSTRUCTIONS = [
970
+ `${styleText2("dim", "\u2191/\u2193")} to navigate`,
971
+ `${styleText2("dim", "Space:")} select`,
972
+ `${styleText2("dim", "Enter:")} confirm`
973
+ ];
974
+ log = {
975
+ message: (s = [], {
976
+ symbol: e = styleText2("gray", S_BAR),
977
+ secondarySymbol: r2 = styleText2("gray", S_BAR),
978
+ output: m = process.stdout,
979
+ spacing: l2 = 1,
980
+ withGuide: c2
981
+ } = {}) => {
982
+ const t2 = [], o = c2 ?? settings.withGuide, f = o ? r2 : "", O = o ? `${e} ` : "", u3 = o ? `${r2} ` : "";
983
+ for (let i2 = 0; i2 < l2; i2++)
984
+ t2.push(f);
985
+ const g = Array.isArray(s) ? s : s.split(`
829
986
  `);
830
- if (y2.length > 0) {
831
- const [p2, ...m] = y2;
832
- p2.length > 0 ? o.push(`${l}${p2}`) : o.push(c2 ? i : "");
833
- for (const g of m) g.length > 0 ? o.push(`${$2}${g}`) : o.push(c2 ? s : "");
834
- }
835
- r.write(`${o.join(`
987
+ if (g.length > 0) {
988
+ const [i2, ...y2] = g;
989
+ i2.length > 0 ? t2.push(`${O}${i2}`) : t2.push(o ? e : "");
990
+ for (const p of y2)
991
+ p.length > 0 ? t2.push(`${u3}${p}`) : t2.push(o ? r2 : "");
992
+ }
993
+ m.write(`${t2.join(`
836
994
  `)}
837
995
  `);
838
- }, info: (e, i) => {
839
- O2.message(e, { ...i, symbol: t("blue", he) });
840
- }, success: (e, i) => {
841
- O2.message(e, { ...i, symbol: t("green", pe) });
842
- }, step: (e, i) => {
843
- O2.message(e, { ...i, symbol: t("green", F) });
844
- }, warn: (e, i) => {
845
- O2.message(e, { ...i, symbol: t("yellow", me) });
846
- }, warning: (e, i) => {
847
- O2.warn(e, i);
848
- }, error: (e, i) => {
849
- O2.message(e, { ...i, symbol: t("red", ge) });
850
- } };
851
- pt = (e = "", i) => {
852
- const s = i?.output ?? process.stdout, r = i?.withGuide ?? u.withGuide ? `${t("gray", E2)} ` : "";
853
- s.write(`${r}${t("red", e)}
996
+ },
997
+ info: (s, e) => {
998
+ log.message(s, { ...e, symbol: styleText2("blue", S_INFO) });
999
+ },
1000
+ success: (s, e) => {
1001
+ log.message(s, { ...e, symbol: styleText2("green", S_SUCCESS) });
1002
+ },
1003
+ step: (s, e) => {
1004
+ log.message(s, { ...e, symbol: styleText2("green", S_STEP_SUBMIT) });
1005
+ },
1006
+ warn: (s, e) => {
1007
+ log.message(s, { ...e, symbol: styleText2("yellow", S_WARN) });
1008
+ },
1009
+ /** alias for `log.warn()`. */
1010
+ warning: (s, e) => {
1011
+ log.warn(s, e);
1012
+ },
1013
+ error: (s, e) => {
1014
+ log.message(s, { ...e, symbol: styleText2("red", S_ERROR) });
1015
+ }
1016
+ };
1017
+ cancel = (o = "", t2) => {
1018
+ const i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR_END)} ` : "";
1019
+ i2.write(`${e}${styleText2("red", o)}
854
1020
 
855
1021
  `);
856
1022
  };
857
- mt = (e = "", i) => {
858
- const s = i?.output ?? process.stdout, r = i?.withGuide ?? u.withGuide ? `${t("gray", le)} ` : "";
859
- s.write(`${r}${e}
1023
+ intro = (o = "", t2) => {
1024
+ const i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR_START)} ` : "";
1025
+ i2.write(`${e}${o}
860
1026
  `);
861
1027
  };
862
- gt = (e = "", i) => {
863
- const s = i?.output ?? process.stdout, r = i?.withGuide ?? u.withGuide ? `${t("gray", d2)}
864
- ${t("gray", E2)} ` : "";
865
- s.write(`${r}${e}
1028
+ outro = (o = "", t2) => {
1029
+ const i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR)}
1030
+ ${styleText2("gray", S_BAR_END)} ` : "";
1031
+ i2.write(`${e}${o}
866
1032
 
867
1033
  `);
868
1034
  };
869
- Ct = (e) => t("magenta", e);
870
- 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 } = {}) => {
871
- const l = ae();
872
- let $2, y2, p2 = false, m = false, g = "", S2, h = performance.now();
873
- const f = O(s), v = a?.styleFrame ?? Ct, T = (_2) => {
874
- const A2 = _2 > 1 ? u2 ?? u.messages.error : r ?? u.messages.cancel;
875
- m = _2 === 1, p2 && (W(A2, _2), m && typeof i == "function" && i());
876
- }, C2 = () => T(2), b = () => T(1), x = () => {
877
- process.on("uncaughtExceptionMonitor", C2), process.on("unhandledRejection", C2), process.on("SIGINT", b), process.on("SIGTERM", b), process.on("exit", T), c2 && c2.addEventListener("abort", b);
878
- }, G2 = () => {
879
- process.removeListener("uncaughtExceptionMonitor", C2), process.removeListener("unhandledRejection", C2), process.removeListener("SIGINT", b), process.removeListener("SIGTERM", b), process.removeListener("exit", T), c2 && c2.removeEventListener("abort", b);
880
- }, M2 = () => {
881
- if (S2 === void 0) return;
882
- l && s.write(`
1035
+ W = (l2) => styleText2("magenta", l2);
1036
+ spinner = ({
1037
+ indicator: l2 = "dots",
1038
+ onCancel: h2,
1039
+ output: n3 = process.stdout,
1040
+ cancelMessage: G,
1041
+ errorMessage: O,
1042
+ frames: E = unicode ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"],
1043
+ delay: F = unicode ? 80 : 120,
1044
+ signal: m,
1045
+ ...I2
1046
+ } = {}) => {
1047
+ const u3 = isCI();
1048
+ let M, T, d = false, S = false, s = "", p, w = performance.now();
1049
+ const x = getColumns(n3), k = I2?.styleFrame ?? W, g = (e) => {
1050
+ const r2 = e > 1 ? O ?? settings.messages.error : G ?? settings.messages.cancel;
1051
+ S = e === 1, d && (a2(r2, e), S && typeof h2 == "function" && h2());
1052
+ }, f = () => g(2), i2 = () => g(1), A = () => {
1053
+ process.on("uncaughtExceptionMonitor", f), process.on("unhandledRejection", f), process.on("SIGINT", i2), process.on("SIGTERM", i2), process.on("exit", g), m && m.addEventListener("abort", i2);
1054
+ }, H = () => {
1055
+ process.removeListener("uncaughtExceptionMonitor", f), process.removeListener("unhandledRejection", f), process.removeListener("SIGINT", i2), process.removeListener("SIGTERM", i2), process.removeListener("exit", g), m && m.removeEventListener("abort", i2);
1056
+ }, y2 = () => {
1057
+ if (p === void 0) return;
1058
+ u3 && n3.write(`
883
1059
  `);
884
- const _2 = wrapAnsi(S2, f, { hard: true, trim: false }).split(`
1060
+ const r2 = wrapAnsi(p, x, {
1061
+ hard: true,
1062
+ trim: false
1063
+ }).split(`
885
1064
  `);
886
- _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());
887
- }, R2 = (_2) => _2.replace(/\.+$/, ""), j2 = (_2) => {
888
- const A2 = (performance.now() - _2) / 1e3, k = Math.floor(A2 / 60), L = Math.floor(A2 % 60);
889
- return k > 0 ? `[${k}m ${L}s]` : `[${L}s]`;
890
- }, D2 = a.withGuide ?? u.withGuide, ie = (_2 = "") => {
891
- p2 = true, $2 = z({ output: s }), g = R2(_2), h = performance.now(), D2 && s.write(`${t("gray", d2)}
1065
+ r2.length > 1 && n3.write(import_sisteransi2.cursor.up(r2.length - 1)), n3.write(import_sisteransi2.cursor.to(0)), n3.write(import_sisteransi2.erase.down());
1066
+ }, C = (e) => e.replace(/\.+$/, ""), _ = (e) => {
1067
+ const r2 = (performance.now() - e) / 1e3, t2 = Math.floor(r2 / 60), o = Math.floor(r2 % 60);
1068
+ return t2 > 0 ? `[${t2}m ${o}s]` : `[${o}s]`;
1069
+ }, N = I2.withGuide ?? settings.withGuide, P = (e = "") => {
1070
+ d = true, M = block({ output: n3 }), s = C(e), w = performance.now(), N && n3.write(`${styleText2("gray", S_BAR)}
892
1071
  `);
893
- let A2 = 0, k = 0;
894
- x(), y2 = setInterval(() => {
895
- if (l && g === S2) return;
896
- M2(), S2 = g;
897
- const L = v(n[A2]);
898
- let Z;
899
- if (l) Z = `${L} ${g}...`;
900
- else if (e === "timer") Z = `${L} ${g} ${j2(h)}`;
1072
+ let r2 = 0, t2 = 0;
1073
+ A(), T = setInterval(() => {
1074
+ if (u3 && s === p)
1075
+ return;
1076
+ y2(), p = s;
1077
+ const o = k(E[r2]);
1078
+ let v;
1079
+ if (u3)
1080
+ v = `${o} ${s}...`;
1081
+ else if (l2 === "timer")
1082
+ v = `${o} ${s} ${_(w)}`;
901
1083
  else {
902
- const Be = ".".repeat(Math.floor(k)).slice(0, 3);
903
- Z = `${L} ${g}${Be}`;
904
- }
905
- const Ne = wrapAnsi(Z, f, { hard: true, trim: false });
906
- s.write(Ne), A2 = A2 + 1 < n.length ? A2 + 1 : 0, k = k < 4 ? k + 0.125 : 0;
907
- }, o);
908
- }, W = (_2 = "", A2 = 0, k = false) => {
909
- if (!p2) return;
910
- p2 = false, clearInterval(y2), M2();
911
- const L = A2 === 0 ? t("green", F) : A2 === 1 ? t("red", oe) : t("red", ue);
912
- g = _2 ?? g, k || (e === "timer" ? s.write(`${L} ${g} ${j2(h)}
913
- `) : s.write(`${L} ${g}
914
- `)), G2(), $2();
1084
+ const B = ".".repeat(Math.floor(t2)).slice(0, 3);
1085
+ v = `${o} ${s}${B}`;
1086
+ }
1087
+ const j = wrapAnsi(v, x, {
1088
+ hard: true,
1089
+ trim: false
1090
+ });
1091
+ n3.write(j), r2 = r2 + 1 < E.length ? r2 + 1 : 0, t2 = t2 < 4 ? t2 + 0.125 : 0;
1092
+ }, F);
1093
+ }, a2 = (e = "", r2 = 0, t2 = false) => {
1094
+ if (!d) return;
1095
+ d = false, clearInterval(T), y2();
1096
+ const o = r2 === 0 ? styleText2("green", S_STEP_SUBMIT) : r2 === 1 ? styleText2("red", S_STEP_CANCEL) : styleText2("red", S_STEP_ERROR);
1097
+ s = e ?? s, t2 || (l2 === "timer" ? n3.write(`${o} ${s} ${_(w)}
1098
+ `) : n3.write(`${o} ${s}
1099
+ `)), H(), M();
1100
+ };
1101
+ return {
1102
+ start: P,
1103
+ stop: (e = "") => a2(e, 0),
1104
+ message: (e = "") => {
1105
+ s = C(e ?? s);
1106
+ },
1107
+ cancel: (e = "") => a2(e, 1),
1108
+ error: (e = "") => a2(e, 2),
1109
+ clear: () => a2("", 0, true),
1110
+ get isCancelled() {
1111
+ return S;
1112
+ }
915
1113
  };
916
- return { start: ie, stop: (_2 = "") => W(_2, 0), message: (_2 = "") => {
917
- g = R2(_2 ?? g);
918
- }, cancel: (_2 = "") => W(_2, 1), error: (_2 = "") => W(_2, 2), clear: () => W("", 0, true), get isCancelled() {
919
- return m;
920
- } };
921
- };
922
- Ve = { light: w2("\u2500", "-"), heavy: w2("\u2501", "="), block: w2("\u2588", "#") };
923
- re = (e, i) => e.includes(`
924
- `) ? e.split(`
925
- `).map((s) => i(s)).join(`
926
- `) : i(e);
927
- _t = (e) => {
928
- const i = (s, r) => {
929
- const u2 = s.label ?? String(s.value);
930
- switch (r) {
1114
+ };
1115
+ u2 = {
1116
+ light: unicodeOr("\u2500", "-"),
1117
+ heavy: unicodeOr("\u2501", "="),
1118
+ block: unicodeOr("\u2588", "#")
1119
+ };
1120
+ SELECT_INSTRUCTIONS = [
1121
+ `${styleText2("dim", "\u2191/\u2193")} to navigate`,
1122
+ `${styleText2("dim", "Enter:")} confirm`
1123
+ ];
1124
+ c = (t2, o) => t2.includes(`
1125
+ `) ? t2.split(`
1126
+ `).map((d) => o(d)).join(`
1127
+ `) : o(t2);
1128
+ select = (t2) => {
1129
+ const o = (n3, m) => {
1130
+ if (n3 === void 0)
1131
+ return "";
1132
+ const s = n3.label ?? String(n3.value);
1133
+ switch (m) {
931
1134
  case "disabled":
932
- return `${t("gray", H2)} ${re(u2, (n) => t("gray", n))}${s.hint ? ` ${t("dim", `(${s.hint ?? "disabled"})`)}` : ""}`;
1135
+ return `${styleText2("gray", S_RADIO_INACTIVE)} ${c(s, (i2) => styleText2("gray", i2))}${n3.hint ? ` ${styleText2("dim", `(${n3.hint ?? "disabled"})`)}` : ""}`;
933
1136
  case "selected":
934
- return `${re(u2, (n) => t("dim", n))}`;
1137
+ return `${c(s, (i2) => styleText2("dim", i2))}`;
935
1138
  case "active":
936
- return `${t("green", z2)} ${u2}${s.hint ? ` ${t("dim", `(${s.hint})`)}` : ""}`;
1139
+ return `${styleText2("green", S_RADIO_ACTIVE)} ${s}${n3.hint ? ` ${styleText2("dim", `(${n3.hint})`)}` : ""}`;
937
1140
  case "cancelled":
938
- return `${re(u2, (n) => t(["strikethrough", "dim"], n))}`;
1141
+ return `${c(s, (i2) => styleText2(["strikethrough", "dim"], i2))}`;
939
1142
  default:
940
- return `${t("dim", H2)} ${re(u2, (n) => t("dim", n))}`;
941
- }
942
- };
943
- return new nt({ options: e.options, signal: e.signal, input: e.input, output: e.output, initialValue: e.initialValue, render() {
944
- 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)}
945
- ` : ""}${n}
1143
+ return `${styleText2("dim", S_RADIO_INACTIVE)} ${c(s, (i2) => styleText2("dim", i2))}`;
1144
+ }
1145
+ }, d = t2.showInstructions ?? true;
1146
+ return new n$1({
1147
+ options: t2.options,
1148
+ signal: t2.signal,
1149
+ input: t2.input,
1150
+ output: t2.output,
1151
+ initialValue: t2.initialValue,
1152
+ render() {
1153
+ const n3 = t2.withGuide ?? settings.withGuide, m = `${symbol(this.state)} `, s = `${symbolBar(this.state)} `, i2 = wrapTextWithPrefix(
1154
+ t2.output,
1155
+ t2.message,
1156
+ s,
1157
+ m
1158
+ ), u3 = `${n3 ? `${styleText2("gray", S_BAR)}
1159
+ ` : ""}${i2}
946
1160
  `;
947
- switch (this.state) {
948
- case "submit": {
949
- const c2 = s ? `${t("gray", d2)} ` : "", a = R(e.output, i(this.options[this.cursor], "selected"), c2);
950
- return `${o}${a}`;
951
- }
952
- case "cancel": {
953
- const c2 = s ? `${t("gray", d2)} ` : "", a = R(e.output, i(this.options[this.cursor], "cancelled"), c2);
954
- return `${o}${a}${s ? `
955
- ${t("gray", d2)}` : ""}`;
956
- }
957
- default: {
958
- const c2 = s ? `${t("cyan", d2)} ` : "", a = s ? t("cyan", E2) : "", l = o.split(`
959
- `).length, $2 = s ? 2 : 1;
960
- 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(`
961
- ${c2}`)}
962
- ${a}
1161
+ switch (this.state) {
1162
+ case "submit": {
1163
+ const r2 = n3 ? `${styleText2("gray", S_BAR)} ` : "", a2 = wrapTextWithPrefix(
1164
+ t2.output,
1165
+ o(this.options[this.cursor], "selected"),
1166
+ r2
1167
+ );
1168
+ return `${u3}${a2}`;
1169
+ }
1170
+ case "cancel": {
1171
+ const r2 = n3 ? `${styleText2("gray", S_BAR)} ` : "", a2 = wrapTextWithPrefix(
1172
+ t2.output,
1173
+ o(this.options[this.cursor], "cancelled"),
1174
+ r2
1175
+ );
1176
+ return `${u3}${a2}${n3 ? `
1177
+ ${styleText2("gray", S_BAR)}` : ""}`;
1178
+ }
1179
+ default: {
1180
+ const r2 = n3 ? `${styleText2("cyan", S_BAR)} ` : "", a2 = u3.split(`
1181
+ `).length, p = d ? formatInstructionFooter(SELECT_INSTRUCTIONS, n3) : n3 ? [styleText2("cyan", S_BAR_END)] : [], f = p.join(`
1182
+ `), b = p.length + 1;
1183
+ return `${u3}${r2}${limitOptions({
1184
+ output: t2.output,
1185
+ cursor: this.cursor,
1186
+ options: this.options,
1187
+ maxItems: t2.maxItems,
1188
+ columnPadding: r2.length,
1189
+ rowPadding: a2 + b,
1190
+ style: (g, x) => o(g, g.disabled ? "disabled" : x ? "active" : "inactive")
1191
+ }).join(`
1192
+ ${r2}`)}
1193
+ ${f}
963
1194
  `;
1195
+ }
964
1196
  }
965
1197
  }
966
- } }).prompt();
1198
+ }).prompt();
967
1199
  };
968
- je = `${t("gray", d2)} `;
1200
+ i = `${styleText2("gray", S_BAR)} `;
969
1201
  }
970
1202
  });
971
1203
 
@@ -978,9 +1210,9 @@ function supportsColor() {
978
1210
  }
979
1211
  return process.stdout.isTTY === true;
980
1212
  }
981
- function colorize(text, color) {
982
- if (!supportsColor()) return text;
983
- return `${color}${text}${colors.reset}`;
1213
+ function colorize(text2, color) {
1214
+ if (!supportsColor()) return text2;
1215
+ return `${color}${text2}${colors.reset}`;
984
1216
  }
985
1217
  function stringify(value) {
986
1218
  if (typeof value === "string") return value;
@@ -1010,7 +1242,7 @@ function stringify(value) {
1010
1242
  function formatMessage(...args) {
1011
1243
  return args.map(stringify).join(" ");
1012
1244
  }
1013
- var colors, currentLogLevel, log, error, warn, info, success;
1245
+ var colors, currentLogLevel, log2, error, warn, info, success;
1014
1246
  var init_cli_output = __esm({
1015
1247
  "packages/tooling/src/utils/cli-output.ts"() {
1016
1248
  "use strict";
@@ -1043,7 +1275,7 @@ var init_cli_output = __esm({
1043
1275
  currentLogLevel = envLevel;
1044
1276
  }
1045
1277
  }
1046
- log = {
1278
+ log2 = {
1047
1279
  /**
1048
1280
  * Logs an error message (always shows unless Quiet level)
1049
1281
  * Uses clack's log.error + explicit red color
@@ -1051,7 +1283,7 @@ var init_cli_output = __esm({
1051
1283
  error(...args) {
1052
1284
  if (currentLogLevel < 0 /* Quiet */) return;
1053
1285
  const message = formatMessage(...args);
1054
- O2.error(colorize(message, colors.brightRed));
1286
+ log.error(colorize(message, colors.brightRed));
1055
1287
  },
1056
1288
  /**
1057
1289
  * Logs a warning message (shows at Normal level and above)
@@ -1060,7 +1292,7 @@ var init_cli_output = __esm({
1060
1292
  warn(...args) {
1061
1293
  if (currentLogLevel < 1 /* Normal */) return;
1062
1294
  const message = formatMessage(...args);
1063
- O2.warn(colorize(message, colors.brightYellow));
1295
+ log.warn(colorize(message, colors.brightYellow));
1064
1296
  },
1065
1297
  /**
1066
1298
  * Logs an info message (shows at Normal level and above)
@@ -1069,7 +1301,7 @@ var init_cli_output = __esm({
1069
1301
  info(...args) {
1070
1302
  if (currentLogLevel < 1 /* Normal */) return;
1071
1303
  const message = formatMessage(...args);
1072
- O2.info(colorize(message, colors.brightCyan));
1304
+ log.info(colorize(message, colors.brightCyan));
1073
1305
  },
1074
1306
  /**
1075
1307
  * Logs a success message (shows at Normal level and above)
@@ -1078,7 +1310,7 @@ var init_cli_output = __esm({
1078
1310
  success(...args) {
1079
1311
  if (currentLogLevel < 1 /* Normal */) return;
1080
1312
  const message = formatMessage(...args);
1081
- O2.success(colorize(message, colors.brightGreen));
1313
+ log.success(colorize(message, colors.brightGreen));
1082
1314
  },
1083
1315
  /**
1084
1316
  * Logs a debug message (only shows at Verbose level and above)
@@ -1087,7 +1319,7 @@ var init_cli_output = __esm({
1087
1319
  debug(...args) {
1088
1320
  if (currentLogLevel < 2 /* Verbose */) return;
1089
1321
  const timeStamp = (/* @__PURE__ */ new Date()).toISOString().slice(11, 19);
1090
- O2.message(
1322
+ log.message(
1091
1323
  colorize(
1092
1324
  `[${timeStamp}] \u{1F50D} DEBUG: ${formatMessage(...args)}`,
1093
1325
  colors.gray
@@ -1101,7 +1333,7 @@ var init_cli_output = __esm({
1101
1333
  trace(...args) {
1102
1334
  if (currentLogLevel < 3 /* Debug */) return;
1103
1335
  const timeStamp = (/* @__PURE__ */ new Date()).toISOString().slice(11, 19);
1104
- O2.message(
1336
+ log.message(
1105
1337
  colorize(
1106
1338
  `[${timeStamp}] \u{1F52C} TRACE: ${formatMessage(...args)}`,
1107
1339
  colors.gray
@@ -1109,10 +1341,10 @@ var init_cli_output = __esm({
1109
1341
  );
1110
1342
  }
1111
1343
  };
1112
- error = log.error.bind(log);
1113
- warn = log.warn.bind(log);
1114
- info = log.info.bind(log);
1115
- success = log.success.bind(log);
1344
+ error = log2.error.bind(log2);
1345
+ warn = log2.warn.bind(log2);
1346
+ info = log2.info.bind(log2);
1347
+ success = log2.success.bind(log2);
1116
1348
  }
1117
1349
  });
1118
1350
 
@@ -1330,9 +1562,9 @@ var require_is_glob = __commonJS({
1330
1562
  index += 2;
1331
1563
  var close = chars[open];
1332
1564
  if (close) {
1333
- var n = str.indexOf(close, index);
1334
- if (n !== -1) {
1335
- index = n + 1;
1565
+ var n3 = str.indexOf(close, index);
1566
+ if (n3 !== -1) {
1567
+ index = n3 + 1;
1336
1568
  }
1337
1569
  }
1338
1570
  if (str[index] === "!") {
@@ -1358,9 +1590,9 @@ var require_is_glob = __commonJS({
1358
1590
  index += 2;
1359
1591
  var close = chars[open];
1360
1592
  if (close) {
1361
- var n = str.indexOf(close, index);
1362
- if (n !== -1) {
1363
- index = n + 1;
1593
+ var n3 = str.indexOf(close, index);
1594
+ if (n3 !== -1) {
1595
+ index = n3 + 1;
1364
1596
  }
1365
1597
  }
1366
1598
  if (str[index] === "!") {
@@ -1438,8 +1670,8 @@ var require_utils = __commonJS({
1438
1670
  if (!exports.isInteger(min) || !exports.isInteger(max)) return false;
1439
1671
  return (Number(max) - Number(min)) / Number(step) >= limit;
1440
1672
  };
1441
- exports.escapeNode = (block, n = 0, type) => {
1442
- const node = block.nodes[n];
1673
+ exports.escapeNode = (block2, n3 = 0, type) => {
1674
+ const node = block2.nodes[n3];
1443
1675
  if (!node) return;
1444
1676
  if (type && node.type === type || node.type === "open" || node.type === "close") {
1445
1677
  if (node.escaped !== true) {
@@ -1456,15 +1688,15 @@ var require_utils = __commonJS({
1456
1688
  }
1457
1689
  return false;
1458
1690
  };
1459
- exports.isInvalidBrace = (block) => {
1460
- if (block.type !== "brace") return false;
1461
- if (block.invalid === true || block.dollar) return true;
1462
- if (block.commas >> 0 + block.ranges >> 0 === 0) {
1463
- block.invalid = true;
1691
+ exports.isInvalidBrace = (block2) => {
1692
+ if (block2.type !== "brace") return false;
1693
+ if (block2.invalid === true || block2.dollar) return true;
1694
+ if (block2.commas >> 0 + block2.ranges >> 0 === 0) {
1695
+ block2.invalid = true;
1464
1696
  return true;
1465
1697
  }
1466
- if (block.open !== true || block.close !== true) {
1467
- block.invalid = true;
1698
+ if (block2.open !== true || block2.close !== true) {
1699
+ block2.invalid = true;
1468
1700
  return true;
1469
1701
  }
1470
1702
  return false;
@@ -1483,8 +1715,8 @@ var require_utils = __commonJS({
1483
1715
  exports.flatten = (...args) => {
1484
1716
  const result = [];
1485
1717
  const flat = (arr) => {
1486
- for (let i = 0; i < arr.length; i++) {
1487
- const ele = arr[i];
1718
+ for (let i2 = 0; i2 < arr.length; i2++) {
1719
+ const ele = arr[i2];
1488
1720
  if (Array.isArray(ele)) {
1489
1721
  flat(ele);
1490
1722
  continue;
@@ -1578,9 +1810,9 @@ var require_to_regex_range = __commonJS({
1578
1810
  if (toRegexRange.cache.hasOwnProperty(cacheKey)) {
1579
1811
  return toRegexRange.cache[cacheKey].result;
1580
1812
  }
1581
- let a = Math.min(min, max);
1813
+ let a2 = Math.min(min, max);
1582
1814
  let b = Math.max(min, max);
1583
- if (Math.abs(a - b) === 1) {
1815
+ if (Math.abs(a2 - b) === 1) {
1584
1816
  let result = min + "|" + max;
1585
1817
  if (opts.capture) {
1586
1818
  return `(${result})`;
@@ -1591,20 +1823,20 @@ var require_to_regex_range = __commonJS({
1591
1823
  return `(?:${result})`;
1592
1824
  }
1593
1825
  let isPadded = hasPadding(min) || hasPadding(max);
1594
- let state = { min, max, a, b };
1826
+ let state = { min, max, a: a2, b };
1595
1827
  let positives = [];
1596
1828
  let negatives = [];
1597
1829
  if (isPadded) {
1598
1830
  state.isPadded = isPadded;
1599
1831
  state.maxLen = String(state.max).length;
1600
1832
  }
1601
- if (a < 0) {
1833
+ if (a2 < 0) {
1602
1834
  let newMin = b < 0 ? Math.abs(b) : 1;
1603
- negatives = splitToPatterns(newMin, Math.abs(a), state, opts);
1604
- a = state.a = 0;
1835
+ negatives = splitToPatterns(newMin, Math.abs(a2), state, opts);
1836
+ a2 = state.a = 0;
1605
1837
  }
1606
1838
  if (b >= 0) {
1607
- positives = splitToPatterns(a, b, state, opts);
1839
+ positives = splitToPatterns(a2, b, state, opts);
1608
1840
  }
1609
1841
  state.negatives = negatives;
1610
1842
  state.positives = positives;
@@ -1652,8 +1884,8 @@ var require_to_regex_range = __commonJS({
1652
1884
  let digits = zipped.length;
1653
1885
  let pattern = "";
1654
1886
  let count = 0;
1655
- for (let i = 0; i < digits; i++) {
1656
- let [startDigit, stopDigit] = zipped[i];
1887
+ for (let i2 = 0; i2 < digits; i2++) {
1888
+ let [startDigit, stopDigit] = zipped[i2];
1657
1889
  if (startDigit === stopDigit) {
1658
1890
  pattern += startDigit;
1659
1891
  } else if (startDigit !== "0" || stopDigit !== "9") {
@@ -1672,8 +1904,8 @@ var require_to_regex_range = __commonJS({
1672
1904
  let tokens = [];
1673
1905
  let start = min;
1674
1906
  let prev;
1675
- for (let i = 0; i < ranges.length; i++) {
1676
- let max2 = ranges[i];
1907
+ for (let i2 = 0; i2 < ranges.length; i2++) {
1908
+ let max2 = ranges[i2];
1677
1909
  let obj = rangeToPattern(String(start), String(max2), options);
1678
1910
  let zeros = "";
1679
1911
  if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
@@ -1708,13 +1940,13 @@ var require_to_regex_range = __commonJS({
1708
1940
  }
1709
1941
  return result;
1710
1942
  }
1711
- function zip(a, b) {
1943
+ function zip(a2, b) {
1712
1944
  let arr = [];
1713
- for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]);
1945
+ for (let i2 = 0; i2 < a2.length; i2++) arr.push([a2[i2], b[i2]]);
1714
1946
  return arr;
1715
1947
  }
1716
- function compare(a, b) {
1717
- return a > b ? 1 : b > a ? -1 : 0;
1948
+ function compare(a2, b) {
1949
+ return a2 > b ? 1 : b > a2 ? -1 : 0;
1718
1950
  }
1719
1951
  function contains(arr, key, val) {
1720
1952
  return arr.some((ele) => ele[key] === val);
@@ -1732,8 +1964,8 @@ var require_to_regex_range = __commonJS({
1732
1964
  }
1733
1965
  return "";
1734
1966
  }
1735
- function toCharacterClass(a, b, options) {
1736
- return `[${a}${b - a === 1 ? "" : "-"}${b}]`;
1967
+ function toCharacterClass(a2, b, options) {
1968
+ return `[${a2}${b - a2 === 1 ? "" : "-"}${b}]`;
1737
1969
  }
1738
1970
  function hasPadding(str) {
1739
1971
  return /^-?(0+)\d/.test(str);
@@ -1812,8 +2044,8 @@ var require_fill_range = __commonJS({
1812
2044
  return negative ? "-" + input : input;
1813
2045
  };
1814
2046
  var toSequence = (parts, options, maxLen) => {
1815
- parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
1816
- parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
2047
+ parts.negatives.sort((a2, b) => a2 < b ? -1 : a2 > b ? 1 : 0);
2048
+ parts.positives.sort((a2, b) => a2 < b ? -1 : a2 > b ? 1 : 0);
1817
2049
  let prefix = options.capture ? "" : "?:";
1818
2050
  let positives = "";
1819
2051
  let negatives = "";
@@ -1834,12 +2066,12 @@ var require_fill_range = __commonJS({
1834
2066
  }
1835
2067
  return result;
1836
2068
  };
1837
- var toRange = (a, b, isNumbers, options) => {
2069
+ var toRange = (a2, b, isNumbers, options) => {
1838
2070
  if (isNumbers) {
1839
- return toRegexRange(a, b, { wrap: false, ...options });
2071
+ return toRegexRange(a2, b, { wrap: false, ...options });
1840
2072
  }
1841
- let start = String.fromCharCode(a);
1842
- if (a === b) return start;
2073
+ let start = String.fromCharCode(a2);
2074
+ if (a2 === b) return start;
1843
2075
  let stop = String.fromCharCode(b);
1844
2076
  return `[${start}-${stop}]`;
1845
2077
  };
@@ -1865,15 +2097,15 @@ var require_fill_range = __commonJS({
1865
2097
  return [];
1866
2098
  };
1867
2099
  var fillNumbers = (start, end, step = 1, options = {}) => {
1868
- let a = Number(start);
2100
+ let a2 = Number(start);
1869
2101
  let b = Number(end);
1870
- if (!Number.isInteger(a) || !Number.isInteger(b)) {
2102
+ if (!Number.isInteger(a2) || !Number.isInteger(b)) {
1871
2103
  if (options.strictRanges === true) throw rangeError([start, end]);
1872
2104
  return [];
1873
2105
  }
1874
- if (a === 0) a = 0;
2106
+ if (a2 === 0) a2 = 0;
1875
2107
  if (b === 0) b = 0;
1876
- let descending = a > b;
2108
+ let descending = a2 > b;
1877
2109
  let startString = String(start);
1878
2110
  let endString = String(end);
1879
2111
  let stepString = String(step);
@@ -1889,13 +2121,13 @@ var require_fill_range = __commonJS({
1889
2121
  let push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
1890
2122
  let range = [];
1891
2123
  let index = 0;
1892
- while (descending ? a >= b : a <= b) {
2124
+ while (descending ? a2 >= b : a2 <= b) {
1893
2125
  if (options.toRegex === true && step > 1) {
1894
- push(a);
2126
+ push(a2);
1895
2127
  } else {
1896
- range.push(pad(format(a, index), maxLen, toNumber));
2128
+ range.push(pad(format(a2, index), maxLen, toNumber));
1897
2129
  }
1898
- a = descending ? a - step : a + step;
2130
+ a2 = descending ? a2 - step : a2 + step;
1899
2131
  index++;
1900
2132
  }
1901
2133
  if (options.toRegex === true) {
@@ -1908,19 +2140,19 @@ var require_fill_range = __commonJS({
1908
2140
  return invalidRange(start, end, options);
1909
2141
  }
1910
2142
  let format = options.transform || ((val) => String.fromCharCode(val));
1911
- let a = `${start}`.charCodeAt(0);
2143
+ let a2 = `${start}`.charCodeAt(0);
1912
2144
  let b = `${end}`.charCodeAt(0);
1913
- let descending = a > b;
1914
- let min = Math.min(a, b);
1915
- let max = Math.max(a, b);
2145
+ let descending = a2 > b;
2146
+ let min = Math.min(a2, b);
2147
+ let max = Math.max(a2, b);
1916
2148
  if (options.toRegex && step === 1) {
1917
2149
  return toRange(min, max, false, options);
1918
2150
  }
1919
2151
  let range = [];
1920
2152
  let index = 0;
1921
- while (descending ? a >= b : a <= b) {
1922
- range.push(format(a, index));
1923
- a = descending ? a - step : a + step;
2153
+ while (descending ? a2 >= b : a2 <= b) {
2154
+ range.push(format(a2, index));
2155
+ a2 = descending ? a2 - step : a2 + step;
1924
2156
  index++;
1925
2157
  }
1926
2158
  if (options.toRegex === true) {
@@ -2043,18 +2275,18 @@ var require_expand = __commonJS({
2043
2275
  const rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit;
2044
2276
  const walk = (node, parent = {}) => {
2045
2277
  node.queue = [];
2046
- let p2 = parent;
2047
- let q2 = parent.queue;
2048
- while (p2.type !== "brace" && p2.type !== "root" && p2.parent) {
2049
- p2 = p2.parent;
2050
- q2 = p2.queue;
2278
+ let p = parent;
2279
+ let q = parent.queue;
2280
+ while (p.type !== "brace" && p.type !== "root" && p.parent) {
2281
+ p = p.parent;
2282
+ q = p.queue;
2051
2283
  }
2052
2284
  if (node.invalid || node.dollar) {
2053
- q2.push(append(q2.pop(), stringify2(node, options)));
2285
+ q.push(append(q.pop(), stringify2(node, options)));
2054
2286
  return;
2055
2287
  }
2056
2288
  if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) {
2057
- q2.push(append(q2.pop(), ["{}"]));
2289
+ q.push(append(q.pop(), ["{}"]));
2058
2290
  return;
2059
2291
  }
2060
2292
  if (node.nodes && node.ranges > 0) {
@@ -2066,26 +2298,26 @@ var require_expand = __commonJS({
2066
2298
  if (range.length === 0) {
2067
2299
  range = stringify2(node, options);
2068
2300
  }
2069
- q2.push(append(q2.pop(), range));
2301
+ q.push(append(q.pop(), range));
2070
2302
  node.nodes = [];
2071
2303
  return;
2072
2304
  }
2073
2305
  const enclose = utils.encloseBrace(node);
2074
2306
  let queue = node.queue;
2075
- let block = node;
2076
- while (block.type !== "brace" && block.type !== "root" && block.parent) {
2077
- block = block.parent;
2078
- queue = block.queue;
2307
+ let block2 = node;
2308
+ while (block2.type !== "brace" && block2.type !== "root" && block2.parent) {
2309
+ block2 = block2.parent;
2310
+ queue = block2.queue;
2079
2311
  }
2080
- for (let i = 0; i < node.nodes.length; i++) {
2081
- const child = node.nodes[i];
2312
+ for (let i2 = 0; i2 < node.nodes.length; i2++) {
2313
+ const child = node.nodes[i2];
2082
2314
  if (child.type === "comma" && node.type === "brace") {
2083
- if (i === 1) queue.push("");
2315
+ if (i2 === 1) queue.push("");
2084
2316
  queue.push("");
2085
2317
  continue;
2086
2318
  }
2087
2319
  if (child.type === "close") {
2088
- q2.push(append(q2.pop(), queue, enclose));
2320
+ q.push(append(q.pop(), queue, enclose));
2089
2321
  continue;
2090
2322
  }
2091
2323
  if (child.value && child.type !== "open") {
@@ -2252,7 +2484,7 @@ var require_parse = __commonJS({
2252
2484
  }
2253
2485
  const ast = { type: "root", input, nodes: [] };
2254
2486
  const stack = [ast];
2255
- let block = ast;
2487
+ let block2 = ast;
2256
2488
  let prev = ast;
2257
2489
  let brackets = 0;
2258
2490
  const length = input.length;
@@ -2268,15 +2500,15 @@ var require_parse = __commonJS({
2268
2500
  prev.value += node.value;
2269
2501
  return;
2270
2502
  }
2271
- block.nodes.push(node);
2272
- node.parent = block;
2503
+ block2.nodes.push(node);
2504
+ node.parent = block2;
2273
2505
  node.prev = prev;
2274
2506
  prev = node;
2275
2507
  return node;
2276
2508
  };
2277
2509
  push({ type: "bos" });
2278
2510
  while (index < length) {
2279
- block = stack[stack.length - 1];
2511
+ block2 = stack[stack.length - 1];
2280
2512
  value = advance();
2281
2513
  if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) {
2282
2514
  continue;
@@ -2313,19 +2545,19 @@ var require_parse = __commonJS({
2313
2545
  continue;
2314
2546
  }
2315
2547
  if (value === CHAR_LEFT_PARENTHESES) {
2316
- block = push({ type: "paren", nodes: [] });
2317
- stack.push(block);
2548
+ block2 = push({ type: "paren", nodes: [] });
2549
+ stack.push(block2);
2318
2550
  push({ type: "text", value });
2319
2551
  continue;
2320
2552
  }
2321
2553
  if (value === CHAR_RIGHT_PARENTHESES) {
2322
- if (block.type !== "paren") {
2554
+ if (block2.type !== "paren") {
2323
2555
  push({ type: "text", value });
2324
2556
  continue;
2325
2557
  }
2326
- block = stack.pop();
2558
+ block2 = stack.pop();
2327
2559
  push({ type: "text", value });
2328
- block = stack[stack.length - 1];
2560
+ block2 = stack[stack.length - 1];
2329
2561
  continue;
2330
2562
  }
2331
2563
  if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
@@ -2350,7 +2582,7 @@ var require_parse = __commonJS({
2350
2582
  }
2351
2583
  if (value === CHAR_LEFT_CURLY_BRACE) {
2352
2584
  depth++;
2353
- const dollar = prev.value && prev.value.slice(-1) === "$" || block.dollar === true;
2585
+ const dollar = prev.value && prev.value.slice(-1) === "$" || block2.dollar === true;
2354
2586
  const brace = {
2355
2587
  type: "brace",
2356
2588
  open: true,
@@ -2361,52 +2593,52 @@ var require_parse = __commonJS({
2361
2593
  ranges: 0,
2362
2594
  nodes: []
2363
2595
  };
2364
- block = push(brace);
2365
- stack.push(block);
2596
+ block2 = push(brace);
2597
+ stack.push(block2);
2366
2598
  push({ type: "open", value });
2367
2599
  continue;
2368
2600
  }
2369
2601
  if (value === CHAR_RIGHT_CURLY_BRACE) {
2370
- if (block.type !== "brace") {
2602
+ if (block2.type !== "brace") {
2371
2603
  push({ type: "text", value });
2372
2604
  continue;
2373
2605
  }
2374
2606
  const type = "close";
2375
- block = stack.pop();
2376
- block.close = true;
2607
+ block2 = stack.pop();
2608
+ block2.close = true;
2377
2609
  push({ type, value });
2378
2610
  depth--;
2379
- block = stack[stack.length - 1];
2611
+ block2 = stack[stack.length - 1];
2380
2612
  continue;
2381
2613
  }
2382
2614
  if (value === CHAR_COMMA && depth > 0) {
2383
- if (block.ranges > 0) {
2384
- block.ranges = 0;
2385
- const open = block.nodes.shift();
2386
- block.nodes = [open, { type: "text", value: stringify2(block) }];
2615
+ if (block2.ranges > 0) {
2616
+ block2.ranges = 0;
2617
+ const open = block2.nodes.shift();
2618
+ block2.nodes = [open, { type: "text", value: stringify2(block2) }];
2387
2619
  }
2388
2620
  push({ type: "comma", value });
2389
- block.commas++;
2621
+ block2.commas++;
2390
2622
  continue;
2391
2623
  }
2392
- if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
2393
- const siblings = block.nodes;
2624
+ if (value === CHAR_DOT && depth > 0 && block2.commas === 0) {
2625
+ const siblings = block2.nodes;
2394
2626
  if (depth === 0 || siblings.length === 0) {
2395
2627
  push({ type: "text", value });
2396
2628
  continue;
2397
2629
  }
2398
2630
  if (prev.type === "dot") {
2399
- block.range = [];
2631
+ block2.range = [];
2400
2632
  prev.value += value;
2401
2633
  prev.type = "range";
2402
- if (block.nodes.length !== 3 && block.nodes.length !== 5) {
2403
- block.invalid = true;
2404
- block.ranges = 0;
2634
+ if (block2.nodes.length !== 3 && block2.nodes.length !== 5) {
2635
+ block2.invalid = true;
2636
+ block2.ranges = 0;
2405
2637
  prev.type = "text";
2406
2638
  continue;
2407
2639
  }
2408
- block.ranges++;
2409
- block.args = [];
2640
+ block2.ranges++;
2641
+ block2.args = [];
2410
2642
  continue;
2411
2643
  }
2412
2644
  if (prev.type === "range") {
@@ -2414,7 +2646,7 @@ var require_parse = __commonJS({
2414
2646
  const before = siblings[siblings.length - 1];
2415
2647
  before.value += prev.value + value;
2416
2648
  prev = before;
2417
- block.ranges--;
2649
+ block2.ranges--;
2418
2650
  continue;
2419
2651
  }
2420
2652
  push({ type: "dot", value });
@@ -2423,9 +2655,9 @@ var require_parse = __commonJS({
2423
2655
  push({ type: "text", value });
2424
2656
  }
2425
2657
  do {
2426
- block = stack.pop();
2427
- if (block.type !== "root") {
2428
- block.nodes.forEach((node) => {
2658
+ block2 = stack.pop();
2659
+ if (block2.type !== "root") {
2660
+ block2.nodes.forEach((node) => {
2429
2661
  if (!node.nodes) {
2430
2662
  if (node.type === "open") node.isOpen = true;
2431
2663
  if (node.type === "close") node.isClose = true;
@@ -2434,8 +2666,8 @@ var require_parse = __commonJS({
2434
2666
  }
2435
2667
  });
2436
2668
  const parent = stack[stack.length - 1];
2437
- const index2 = parent.nodes.indexOf(block);
2438
- parent.nodes.splice(index2, 1, ...block.nodes);
2669
+ const index2 = parent.nodes.indexOf(block2);
2670
+ parent.nodes.splice(index2, 1, ...block2.nodes);
2439
2671
  }
2440
2672
  } while (stack.length > 0);
2441
2673
  push({ type: "eos" });
@@ -3068,9 +3300,9 @@ var require_scan = __commonJS({
3068
3300
  if (opts.parts === true || opts.tokens === true) {
3069
3301
  let prevIndex;
3070
3302
  for (let idx = 0; idx < slashes.length; idx++) {
3071
- const n = prevIndex ? prevIndex + 1 : start;
3072
- const i = slashes[idx];
3073
- const value = input.slice(n, i);
3303
+ const n3 = prevIndex ? prevIndex + 1 : start;
3304
+ const i2 = slashes[idx];
3305
+ const value = input.slice(n3, i2);
3074
3306
  if (opts.tokens) {
3075
3307
  if (idx === 0 && start !== 0) {
3076
3308
  tokens[idx].isPrefix = true;
@@ -3084,7 +3316,7 @@ var require_scan = __commonJS({
3084
3316
  if (idx !== 0 || value !== "") {
3085
3317
  parts.push(value);
3086
3318
  }
3087
- prevIndex = i;
3319
+ prevIndex = i2;
3088
3320
  }
3089
3321
  if (prevIndex && prevIndex + 1 < input.length) {
3090
3322
  const value = input.slice(prevIndex + 1);
@@ -3213,15 +3445,15 @@ var require_parse2 = __commonJS({
3213
3445
  };
3214
3446
  var hasRepeatedCharPrefixOverlap = (branches) => {
3215
3447
  const values = branches.map(normalizeSimpleBranch).filter(Boolean);
3216
- for (let i = 0; i < values.length; i++) {
3217
- for (let j2 = i + 1; j2 < values.length; j2++) {
3218
- const a = values[i];
3219
- const b = values[j2];
3220
- const char = a[0];
3221
- if (!char || a !== char.repeat(a.length) || b !== char.repeat(b.length)) {
3448
+ for (let i2 = 0; i2 < values.length; i2++) {
3449
+ for (let j = i2 + 1; j < values.length; j++) {
3450
+ const a2 = values[i2];
3451
+ const b = values[j];
3452
+ const char = a2[0];
3453
+ if (!char || a2 !== char.repeat(a2.length) || b !== char.repeat(b.length)) {
3222
3454
  continue;
3223
3455
  }
3224
- if (a === b || a.startsWith(b) || b.startsWith(a)) {
3456
+ if (a2 === b || a2.startsWith(b) || b.startsWith(a2)) {
3225
3457
  return true;
3226
3458
  }
3227
3459
  }
@@ -3236,8 +3468,8 @@ var require_parse2 = __commonJS({
3236
3468
  let paren = 0;
3237
3469
  let quote = 0;
3238
3470
  let escaped = false;
3239
- for (let i = 1; i < pattern.length; i++) {
3240
- const ch = pattern[i];
3471
+ for (let i2 = 1; i2 < pattern.length; i2++) {
3472
+ const ch = pattern[i2];
3241
3473
  if (escaped === true) {
3242
3474
  escaped = false;
3243
3475
  continue;
@@ -3271,13 +3503,13 @@ var require_parse2 = __commonJS({
3271
3503
  if (ch === ")") {
3272
3504
  paren--;
3273
3505
  if (paren === 0) {
3274
- if (requireEnd === true && i !== pattern.length - 1) {
3506
+ if (requireEnd === true && i2 !== pattern.length - 1) {
3275
3507
  return;
3276
3508
  }
3277
3509
  return {
3278
3510
  type: pattern[0],
3279
- body: pattern.slice(2, i),
3280
- end: i
3511
+ body: pattern.slice(2, i2),
3512
+ end: i2
3281
3513
  };
3282
3514
  }
3283
3515
  }
@@ -3409,7 +3641,7 @@ var require_parse2 = __commonJS({
3409
3641
  let prev = bos;
3410
3642
  let value;
3411
3643
  const eos = () => state.index === len - 1;
3412
- const peek = state.peek = (n = 1) => input[state.index + n];
3644
+ const peek = state.peek = (n3 = 1) => input[state.index + n3];
3413
3645
  const advance = state.advance = () => input[++state.index] || "";
3414
3646
  const remaining = () => input.slice(state.index + 1);
3415
3647
  const consume = (value2 = "", num = 0) => {
@@ -3490,10 +3722,10 @@ var require_parse2 = __commonJS({
3490
3722
  open.type = "text";
3491
3723
  open.value = literal;
3492
3724
  open.output = safeOutput || utils.escapeRegex(literal);
3493
- for (let i = token.tokensIndex + 1; i < tokens.length; i++) {
3494
- tokens[i].value = "";
3495
- tokens[i].output = "";
3496
- delete tokens[i].suffix;
3725
+ for (let i2 = token.tokensIndex + 1; i2 < tokens.length; i2++) {
3726
+ tokens[i2].value = "";
3727
+ tokens[i2].output = "";
3728
+ delete tokens[i2].suffix;
3497
3729
  }
3498
3730
  state.output = token.output + open.output;
3499
3731
  state.backtrack = true;
@@ -3736,13 +3968,13 @@ var require_parse2 = __commonJS({
3736
3968
  if (brace.dots === true) {
3737
3969
  const arr = tokens.slice();
3738
3970
  const range = [];
3739
- for (let i = arr.length - 1; i >= 0; i--) {
3971
+ for (let i2 = arr.length - 1; i2 >= 0; i2--) {
3740
3972
  tokens.pop();
3741
- if (arr[i].type === "brace") {
3973
+ if (arr[i2].type === "brace") {
3742
3974
  break;
3743
3975
  }
3744
- if (arr[i].type !== "dots") {
3745
- range.unshift(arr[i].value);
3976
+ if (arr[i2].type !== "dots") {
3977
+ range.unshift(arr[i2].value);
3746
3978
  }
3747
3979
  }
3748
3980
  output = expandRange(range, opts);
@@ -4201,7 +4433,7 @@ var require_picomatch = __commonJS({
4201
4433
  };
4202
4434
  picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
4203
4435
  picomatch.parse = (pattern, options) => {
4204
- if (Array.isArray(pattern)) return pattern.map((p2) => picomatch.parse(p2, options));
4436
+ if (Array.isArray(pattern)) return pattern.map((p) => picomatch.parse(p, options));
4205
4437
  return parse2(pattern, { ...options, fastpaths: false });
4206
4438
  };
4207
4439
  picomatch.scan = (input, options) => scan(input, options);
@@ -4285,8 +4517,8 @@ var require_micromatch = __commonJS({
4285
4517
  options.onResult(state);
4286
4518
  }
4287
4519
  };
4288
- for (let i = 0; i < patterns.length; i++) {
4289
- let isMatch = picomatch(String(patterns[i]), { ...options, onResult }, true);
4520
+ for (let i2 = 0; i2 < patterns.length; i2++) {
4521
+ let isMatch = picomatch(String(patterns[i2]), { ...options, onResult }, true);
4290
4522
  let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
4291
4523
  if (negated) negatives++;
4292
4524
  for (let item of list) {
@@ -4308,7 +4540,7 @@ var require_micromatch = __commonJS({
4308
4540
  throw new Error(`No matches found for "${patterns.join(", ")}"`);
4309
4541
  }
4310
4542
  if (options.nonull === true || options.nullglob === true) {
4311
- return options.unescape ? patterns.map((p2) => p2.replace(/\\/g, "")) : patterns;
4543
+ return options.unescape ? patterns.map((p) => p.replace(/\\/g, "")) : patterns;
4312
4544
  }
4313
4545
  }
4314
4546
  return matches;
@@ -4338,7 +4570,7 @@ var require_micromatch = __commonJS({
4338
4570
  throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
4339
4571
  }
4340
4572
  if (Array.isArray(pattern)) {
4341
- return pattern.some((p2) => micromatch.contains(str, p2, options));
4573
+ return pattern.some((p) => micromatch.contains(str, p, options));
4342
4574
  }
4343
4575
  if (typeof pattern === "string") {
4344
4576
  if (isEmptyString(str) || isEmptyString(pattern)) {
@@ -4383,7 +4615,7 @@ var require_micromatch = __commonJS({
4383
4615
  if (typeof str !== "string") {
4384
4616
  throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
4385
4617
  }
4386
- return [].concat(patterns).every((p2) => picomatch(p2, options)(str));
4618
+ return [].concat(patterns).every((p) => picomatch(p, options)(str));
4387
4619
  };
4388
4620
  micromatch.capture = (glob2, input, options) => {
4389
4621
  let posix = utils.isWindows(options);
@@ -4534,7 +4766,7 @@ var require_pattern = __commonJS({
4534
4766
  exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
4535
4767
  function expandBraceExpansion(pattern) {
4536
4768
  const patterns = micromatch.braces(pattern, { expand: true, nodupes: true, keepEscaping: true });
4537
- patterns.sort((a, b) => a.length - b.length);
4769
+ patterns.sort((a2, b) => a2.length - b.length);
4538
4770
  return patterns.filter((pattern2) => pattern2 !== "");
4539
4771
  }
4540
4772
  exports.expandBraceExpansion = expandBraceExpansion;
@@ -4615,8 +4847,8 @@ var require_merge2 = __commonJS({
4615
4847
  }
4616
4848
  const mergedStream = PassThrough(options);
4617
4849
  function addStream() {
4618
- for (let i = 0, len = arguments.length; i < len; i++) {
4619
- streamsQueue.push(pauseStreams(arguments[i], options));
4850
+ for (let i2 = 0, len = arguments.length; i2 < len; i2++) {
4851
+ streamsQueue.push(pauseStreams(arguments[i2], options));
4620
4852
  }
4621
4853
  mergeStream();
4622
4854
  return this;
@@ -4665,8 +4897,8 @@ var require_merge2 = __commonJS({
4665
4897
  stream.pipe(mergedStream, { end: false });
4666
4898
  stream.resume();
4667
4899
  }
4668
- for (let i = 0; i < streams.length; i++) {
4669
- pipe(streams[i]);
4900
+ for (let i2 = 0; i2 < streams.length; i2++) {
4901
+ pipe(streams[i2]);
4670
4902
  }
4671
4903
  next();
4672
4904
  }
@@ -4697,8 +4929,8 @@ var require_merge2 = __commonJS({
4697
4929
  }
4698
4930
  streams.pause();
4699
4931
  } else {
4700
- for (let i = 0, len = streams.length; i < len; i++) {
4701
- streams[i] = pauseStreams(streams[i], options);
4932
+ for (let i2 = 0, len = streams.length; i2 < len; i2++) {
4933
+ streams[i2] = pauseStreams(streams[i2], options);
4702
4934
  }
4703
4935
  }
4704
4936
  return streams;
@@ -4780,13 +5012,13 @@ var require_tasks = __commonJS({
4780
5012
  Object.defineProperty(exports, "__esModule", { value: true });
4781
5013
  exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0;
4782
5014
  var utils = require_utils3();
4783
- function generate(input, settings) {
4784
- const patterns = processPatterns(input, settings);
4785
- const ignore = processPatterns(settings.ignore, settings);
5015
+ function generate(input, settings2) {
5016
+ const patterns = processPatterns(input, settings2);
5017
+ const ignore = processPatterns(settings2.ignore, settings2);
4786
5018
  const positivePatterns = getPositivePatterns(patterns);
4787
5019
  const negativePatterns = getNegativePatternsAsPositive(patterns, ignore);
4788
- const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings));
4789
- const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings));
5020
+ const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings2));
5021
+ const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings2));
4790
5022
  const staticTasks = convertPatternsToTasks(
4791
5023
  staticPatterns,
4792
5024
  negativePatterns,
@@ -4802,12 +5034,12 @@ var require_tasks = __commonJS({
4802
5034
  return staticTasks.concat(dynamicTasks);
4803
5035
  }
4804
5036
  exports.generate = generate;
4805
- function processPatterns(input, settings) {
5037
+ function processPatterns(input, settings2) {
4806
5038
  let patterns = input;
4807
- if (settings.braceExpansion) {
5039
+ if (settings2.braceExpansion) {
4808
5040
  patterns = utils.pattern.expandPatternsWithBraceExpansion(patterns);
4809
5041
  }
4810
- if (settings.baseNameMatch) {
5042
+ if (settings2.baseNameMatch) {
4811
5043
  patterns = patterns.map((pattern) => pattern.includes("/") ? pattern : `**/${pattern}`);
4812
5044
  }
4813
5045
  return patterns.map((pattern) => utils.pattern.removeDuplicateSlashes(pattern));
@@ -4838,7 +5070,7 @@ var require_tasks = __commonJS({
4838
5070
  }
4839
5071
  exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive;
4840
5072
  function groupPatternsByBaseDirectory(patterns) {
4841
- const group = {};
5073
+ const group2 = {};
4842
5074
  return patterns.reduce((collection, pattern) => {
4843
5075
  const base = utils.pattern.getBaseDirectory(pattern);
4844
5076
  if (base in collection) {
@@ -4847,7 +5079,7 @@ var require_tasks = __commonJS({
4847
5079
  collection[base] = [pattern];
4848
5080
  }
4849
5081
  return collection;
4850
- }, group);
5082
+ }, group2);
4851
5083
  }
4852
5084
  exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory;
4853
5085
  function convertPatternGroupsToTasks(positive, negative, dynamic) {
@@ -4876,26 +5108,26 @@ var require_async = __commonJS({
4876
5108
  init_utils2();
4877
5109
  Object.defineProperty(exports, "__esModule", { value: true });
4878
5110
  exports.read = void 0;
4879
- function read2(path, settings, callback) {
4880
- settings.fs.lstat(path, (lstatError, lstat) => {
5111
+ function read2(path, settings2, callback) {
5112
+ settings2.fs.lstat(path, (lstatError, lstat) => {
4881
5113
  if (lstatError !== null) {
4882
5114
  callFailureCallback(callback, lstatError);
4883
5115
  return;
4884
5116
  }
4885
- if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
5117
+ if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) {
4886
5118
  callSuccessCallback(callback, lstat);
4887
5119
  return;
4888
5120
  }
4889
- settings.fs.stat(path, (statError, stat) => {
5121
+ settings2.fs.stat(path, (statError, stat) => {
4890
5122
  if (statError !== null) {
4891
- if (settings.throwErrorOnBrokenSymbolicLink) {
5123
+ if (settings2.throwErrorOnBrokenSymbolicLink) {
4892
5124
  callFailureCallback(callback, statError);
4893
5125
  return;
4894
5126
  }
4895
5127
  callSuccessCallback(callback, lstat);
4896
5128
  return;
4897
5129
  }
4898
- if (settings.markSymbolicLink) {
5130
+ if (settings2.markSymbolicLink) {
4899
5131
  stat.isSymbolicLink = () => true;
4900
5132
  }
4901
5133
  callSuccessCallback(callback, stat);
@@ -4919,19 +5151,19 @@ var require_sync = __commonJS({
4919
5151
  init_utils2();
4920
5152
  Object.defineProperty(exports, "__esModule", { value: true });
4921
5153
  exports.read = void 0;
4922
- function read2(path, settings) {
4923
- const lstat = settings.fs.lstatSync(path);
4924
- if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
5154
+ function read2(path, settings2) {
5155
+ const lstat = settings2.fs.lstatSync(path);
5156
+ if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) {
4925
5157
  return lstat;
4926
5158
  }
4927
5159
  try {
4928
- const stat = settings.fs.statSync(path);
4929
- if (settings.markSymbolicLink) {
5160
+ const stat = settings2.fs.statSync(path);
5161
+ if (settings2.markSymbolicLink) {
4930
5162
  stat.isSymbolicLink = () => true;
4931
5163
  }
4932
5164
  return stat;
4933
5165
  } catch (error2) {
4934
- if (!settings.throwErrorOnBrokenSymbolicLink) {
5166
+ if (!settings2.throwErrorOnBrokenSymbolicLink) {
4935
5167
  return lstat;
4936
5168
  }
4937
5169
  throw error2;
@@ -5008,8 +5240,8 @@ var require_out = __commonJS({
5008
5240
  }
5009
5241
  exports.stat = stat;
5010
5242
  function statSync2(path, optionsOrSettings) {
5011
- const settings = getSettings(optionsOrSettings);
5012
- return sync.read(path, settings);
5243
+ const settings2 = getSettings(optionsOrSettings);
5244
+ return sync.read(path, settings2);
5013
5245
  }
5014
5246
  exports.statSync = statSync2;
5015
5247
  function getSettings(settingsOrOptions = {}) {
@@ -5057,8 +5289,8 @@ var require_run_parallel = __commonJS({
5057
5289
  if (isSync) queueMicrotask2(end);
5058
5290
  else end();
5059
5291
  }
5060
- function each(i, err, result) {
5061
- results[i] = result;
5292
+ function each(i2, err, result) {
5293
+ results[i2] = result;
5062
5294
  if (--pending === 0 || err) {
5063
5295
  done(err);
5064
5296
  }
@@ -5072,9 +5304,9 @@ var require_run_parallel = __commonJS({
5072
5304
  });
5073
5305
  });
5074
5306
  } else {
5075
- tasks.forEach(function(task, i) {
5307
+ tasks.forEach(function(task, i2) {
5076
5308
  task(function(err, result) {
5077
- each(i, err, result);
5309
+ each(i2, err, result);
5078
5310
  });
5079
5311
  });
5080
5312
  }
@@ -5149,11 +5381,11 @@ var require_common = __commonJS({
5149
5381
  init_utils2();
5150
5382
  Object.defineProperty(exports, "__esModule", { value: true });
5151
5383
  exports.joinPathSegments = void 0;
5152
- function joinPathSegments(a, b, separator) {
5153
- if (a.endsWith(separator)) {
5154
- return a + b;
5384
+ function joinPathSegments(a2, b, separator) {
5385
+ if (a2.endsWith(separator)) {
5386
+ return a2 + b;
5155
5387
  }
5156
- return a + separator + b;
5388
+ return a2 + separator + b;
5157
5389
  }
5158
5390
  exports.joinPathSegments = joinPathSegments;
5159
5391
  }
@@ -5171,16 +5403,16 @@ var require_async2 = __commonJS({
5171
5403
  var constants_1 = require_constants3();
5172
5404
  var utils = require_utils4();
5173
5405
  var common = require_common();
5174
- function read2(directory, settings, callback) {
5175
- if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
5176
- readdirWithFileTypes(directory, settings, callback);
5406
+ function read2(directory, settings2, callback) {
5407
+ if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
5408
+ readdirWithFileTypes(directory, settings2, callback);
5177
5409
  return;
5178
5410
  }
5179
- readdir(directory, settings, callback);
5411
+ readdir(directory, settings2, callback);
5180
5412
  }
5181
5413
  exports.read = read2;
5182
- function readdirWithFileTypes(directory, settings, callback) {
5183
- settings.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {
5414
+ function readdirWithFileTypes(directory, settings2, callback) {
5415
+ settings2.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {
5184
5416
  if (readdirError !== null) {
5185
5417
  callFailureCallback(callback, readdirError);
5186
5418
  return;
@@ -5188,13 +5420,13 @@ var require_async2 = __commonJS({
5188
5420
  const entries = dirents.map((dirent) => ({
5189
5421
  dirent,
5190
5422
  name: dirent.name,
5191
- path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
5423
+ path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator)
5192
5424
  }));
5193
- if (!settings.followSymbolicLinks) {
5425
+ if (!settings2.followSymbolicLinks) {
5194
5426
  callSuccessCallback(callback, entries);
5195
5427
  return;
5196
5428
  }
5197
- const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings));
5429
+ const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings2));
5198
5430
  rpl(tasks, (rplError, rplEntries) => {
5199
5431
  if (rplError !== null) {
5200
5432
  callFailureCallback(callback, rplError);
@@ -5205,15 +5437,15 @@ var require_async2 = __commonJS({
5205
5437
  });
5206
5438
  }
5207
5439
  exports.readdirWithFileTypes = readdirWithFileTypes;
5208
- function makeRplTaskEntry(entry, settings) {
5440
+ function makeRplTaskEntry(entry, settings2) {
5209
5441
  return (done) => {
5210
5442
  if (!entry.dirent.isSymbolicLink()) {
5211
5443
  done(null, entry);
5212
5444
  return;
5213
5445
  }
5214
- settings.fs.stat(entry.path, (statError, stats) => {
5446
+ settings2.fs.stat(entry.path, (statError, stats) => {
5215
5447
  if (statError !== null) {
5216
- if (settings.throwErrorOnBrokenSymbolicLink) {
5448
+ if (settings2.throwErrorOnBrokenSymbolicLink) {
5217
5449
  done(statError);
5218
5450
  return;
5219
5451
  }
@@ -5225,16 +5457,16 @@ var require_async2 = __commonJS({
5225
5457
  });
5226
5458
  };
5227
5459
  }
5228
- function readdir(directory, settings, callback) {
5229
- settings.fs.readdir(directory, (readdirError, names) => {
5460
+ function readdir(directory, settings2, callback) {
5461
+ settings2.fs.readdir(directory, (readdirError, names) => {
5230
5462
  if (readdirError !== null) {
5231
5463
  callFailureCallback(callback, readdirError);
5232
5464
  return;
5233
5465
  }
5234
5466
  const tasks = names.map((name) => {
5235
- const path = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
5467
+ const path = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
5236
5468
  return (done) => {
5237
- fsStat.stat(path, settings.fsStatSettings, (error2, stats) => {
5469
+ fsStat.stat(path, settings2.fsStatSettings, (error2, stats) => {
5238
5470
  if (error2 !== null) {
5239
5471
  done(error2);
5240
5472
  return;
@@ -5244,7 +5476,7 @@ var require_async2 = __commonJS({
5244
5476
  path,
5245
5477
  dirent: utils.fs.createDirentFromStats(name, stats)
5246
5478
  };
5247
- if (settings.stats) {
5479
+ if (settings2.stats) {
5248
5480
  entry.stats = stats;
5249
5481
  }
5250
5482
  done(null, entry);
@@ -5281,27 +5513,27 @@ var require_sync2 = __commonJS({
5281
5513
  var constants_1 = require_constants3();
5282
5514
  var utils = require_utils4();
5283
5515
  var common = require_common();
5284
- function read2(directory, settings) {
5285
- if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
5286
- return readdirWithFileTypes(directory, settings);
5516
+ function read2(directory, settings2) {
5517
+ if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
5518
+ return readdirWithFileTypes(directory, settings2);
5287
5519
  }
5288
- return readdir(directory, settings);
5520
+ return readdir(directory, settings2);
5289
5521
  }
5290
5522
  exports.read = read2;
5291
- function readdirWithFileTypes(directory, settings) {
5292
- const dirents = settings.fs.readdirSync(directory, { withFileTypes: true });
5523
+ function readdirWithFileTypes(directory, settings2) {
5524
+ const dirents = settings2.fs.readdirSync(directory, { withFileTypes: true });
5293
5525
  return dirents.map((dirent) => {
5294
5526
  const entry = {
5295
5527
  dirent,
5296
5528
  name: dirent.name,
5297
- path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
5529
+ path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator)
5298
5530
  };
5299
- if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) {
5531
+ if (entry.dirent.isSymbolicLink() && settings2.followSymbolicLinks) {
5300
5532
  try {
5301
- const stats = settings.fs.statSync(entry.path);
5533
+ const stats = settings2.fs.statSync(entry.path);
5302
5534
  entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
5303
5535
  } catch (error2) {
5304
- if (settings.throwErrorOnBrokenSymbolicLink) {
5536
+ if (settings2.throwErrorOnBrokenSymbolicLink) {
5305
5537
  throw error2;
5306
5538
  }
5307
5539
  }
@@ -5310,17 +5542,17 @@ var require_sync2 = __commonJS({
5310
5542
  });
5311
5543
  }
5312
5544
  exports.readdirWithFileTypes = readdirWithFileTypes;
5313
- function readdir(directory, settings) {
5314
- const names = settings.fs.readdirSync(directory);
5545
+ function readdir(directory, settings2) {
5546
+ const names = settings2.fs.readdirSync(directory);
5315
5547
  return names.map((name) => {
5316
- const entryPath = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
5317
- const stats = fsStat.statSync(entryPath, settings.fsStatSettings);
5548
+ const entryPath = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
5549
+ const stats = fsStat.statSync(entryPath, settings2.fsStatSettings);
5318
5550
  const entry = {
5319
5551
  name,
5320
5552
  path: entryPath,
5321
5553
  dirent: utils.fs.createDirentFromStats(name, stats)
5322
5554
  };
5323
- if (settings.stats) {
5555
+ if (settings2.stats) {
5324
5556
  entry.stats = stats;
5325
5557
  }
5326
5558
  return entry;
@@ -5407,8 +5639,8 @@ var require_out2 = __commonJS({
5407
5639
  }
5408
5640
  exports.scandir = scandir;
5409
5641
  function scandirSync(path, optionsOrSettings) {
5410
- const settings = getSettings(optionsOrSettings);
5411
- return sync.read(path, settings);
5642
+ const settings2 = getSettings(optionsOrSettings);
5643
+ return sync.read(path, settings2);
5412
5644
  }
5413
5645
  exports.scandirSync = scandirSync;
5414
5646
  function getSettings(settingsOrOptions = {}) {
@@ -5452,9 +5684,9 @@ var require_reusify = __commonJS({
5452
5684
  }
5453
5685
  });
5454
5686
 
5455
- // node_modules/.bun/fastq@1.20.1/node_modules/fastq/queue.js
5687
+ // node_modules/.bun/fastq@1.20.3/node_modules/fastq/queue.js
5456
5688
  var require_queue = __commonJS({
5457
- "node_modules/.bun/fastq@1.20.1/node_modules/fastq/queue.js"(exports, module) {
5689
+ "node_modules/.bun/fastq@1.20.3/node_modules/fastq/queue.js"(exports, module) {
5458
5690
  "use strict";
5459
5691
  init_utils2();
5460
5692
  var reusify = require_reusify();
@@ -5634,11 +5866,12 @@ var require_queue = __commonJS({
5634
5866
  current.value = null;
5635
5867
  current.callback = noop;
5636
5868
  current.errorHandler = null;
5869
+ current.next = null;
5637
5870
  if (errorHandler2) {
5638
5871
  errorHandler2(new Error("abort"), val);
5639
5872
  }
5640
5873
  callback.call(context2, new Error("abort"));
5641
- current.release(current);
5874
+ cache.release(current);
5642
5875
  current = next;
5643
5876
  }
5644
5877
  self.drain = noop;
@@ -5689,7 +5922,7 @@ var require_queue = __commonJS({
5689
5922
  queue.drained = drained;
5690
5923
  return queue;
5691
5924
  function push(value) {
5692
- var p2 = new Promise(function(resolve4, reject) {
5925
+ var p = new Promise(function(resolve4, reject) {
5693
5926
  pushCb(value, function(err, result) {
5694
5927
  if (err) {
5695
5928
  reject(err);
@@ -5698,11 +5931,11 @@ var require_queue = __commonJS({
5698
5931
  resolve4(result);
5699
5932
  });
5700
5933
  });
5701
- p2.catch(noop);
5702
- return p2;
5934
+ p.catch(noop);
5935
+ return p;
5703
5936
  }
5704
5937
  function unshift(value) {
5705
- var p2 = new Promise(function(resolve4, reject) {
5938
+ var p = new Promise(function(resolve4, reject) {
5706
5939
  unshiftCb(value, function(err, result) {
5707
5940
  if (err) {
5708
5941
  reject(err);
@@ -5711,11 +5944,11 @@ var require_queue = __commonJS({
5711
5944
  resolve4(result);
5712
5945
  });
5713
5946
  });
5714
- p2.catch(noop);
5715
- return p2;
5947
+ p.catch(noop);
5948
+ return p;
5716
5949
  }
5717
5950
  function drained() {
5718
- var p2 = new Promise(function(resolve4) {
5951
+ var p = new Promise(function(resolve4) {
5719
5952
  process.nextTick(function() {
5720
5953
  if (queue.idle()) {
5721
5954
  resolve4();
@@ -5729,7 +5962,7 @@ var require_queue = __commonJS({
5729
5962
  }
5730
5963
  });
5731
5964
  });
5732
- return p2;
5965
+ return p;
5733
5966
  }
5734
5967
  }
5735
5968
  module.exports = fastqueue;
@@ -5744,11 +5977,11 @@ var require_common2 = __commonJS({
5744
5977
  init_utils2();
5745
5978
  Object.defineProperty(exports, "__esModule", { value: true });
5746
5979
  exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0;
5747
- function isFatalError(settings, error2) {
5748
- if (settings.errorFilter === null) {
5980
+ function isFatalError(settings2, error2) {
5981
+ if (settings2.errorFilter === null) {
5749
5982
  return true;
5750
5983
  }
5751
- return !settings.errorFilter(error2);
5984
+ return !settings2.errorFilter(error2);
5752
5985
  }
5753
5986
  exports.isFatalError = isFatalError;
5754
5987
  function isAppliedFilter(filter, value) {
@@ -5759,14 +5992,14 @@ var require_common2 = __commonJS({
5759
5992
  return filepath.split(/[/\\]/).join(separator);
5760
5993
  }
5761
5994
  exports.replacePathSegmentSeparator = replacePathSegmentSeparator;
5762
- function joinPathSegments(a, b, separator) {
5763
- if (a === "") {
5995
+ function joinPathSegments(a2, b, separator) {
5996
+ if (a2 === "") {
5764
5997
  return b;
5765
5998
  }
5766
- if (a.endsWith(separator)) {
5767
- return a + b;
5999
+ if (a2.endsWith(separator)) {
6000
+ return a2 + b;
5768
6001
  }
5769
- return a + separator + b;
6002
+ return a2 + separator + b;
5770
6003
  }
5771
6004
  exports.joinPathSegments = joinPathSegments;
5772
6005
  }
@@ -6113,14 +6346,14 @@ var require_out3 = __commonJS({
6113
6346
  }
6114
6347
  exports.walk = walk;
6115
6348
  function walkSync(directory, optionsOrSettings) {
6116
- const settings = getSettings(optionsOrSettings);
6117
- const provider = new sync_1.default(directory, settings);
6349
+ const settings2 = getSettings(optionsOrSettings);
6350
+ const provider = new sync_1.default(directory, settings2);
6118
6351
  return provider.read();
6119
6352
  }
6120
6353
  exports.walkSync = walkSync;
6121
6354
  function walkStream(directory, optionsOrSettings) {
6122
- const settings = getSettings(optionsOrSettings);
6123
- const provider = new stream_1.default(directory, settings);
6355
+ const settings2 = getSettings(optionsOrSettings);
6356
+ const provider = new stream_1.default(directory, settings2);
6124
6357
  return provider.read();
6125
6358
  }
6126
6359
  exports.walkStream = walkStream;
@@ -6206,8 +6439,8 @@ var require_stream3 = __commonJS({
6206
6439
  done();
6207
6440
  }).catch(done);
6208
6441
  };
6209
- for (let i = 0; i < filepaths.length; i++) {
6210
- stream.write(i);
6442
+ for (let i2 = 0; i2 < filepaths.length; i2++) {
6443
+ stream.write(i2);
6211
6444
  }
6212
6445
  return stream;
6213
6446
  }
@@ -6868,14 +7101,14 @@ var require_out4 = __commonJS({
6868
7101
  function generateTasks(source, options) {
6869
7102
  assertPatternsInput(source);
6870
7103
  const patterns = [].concat(source);
6871
- const settings = new settings_1.default(options);
6872
- return taskManager.generate(patterns, settings);
7104
+ const settings2 = new settings_1.default(options);
7105
+ return taskManager.generate(patterns, settings2);
6873
7106
  }
6874
7107
  FastGlob2.generateTasks = generateTasks;
6875
7108
  function isDynamicPattern(source, options) {
6876
7109
  assertPatternsInput(source);
6877
- const settings = new settings_1.default(options);
6878
- return utils.pattern.isDynamicPattern(source, settings);
7110
+ const settings2 = new settings_1.default(options);
7111
+ return utils.pattern.isDynamicPattern(source, settings2);
6879
7112
  }
6880
7113
  FastGlob2.isDynamicPattern = isDynamicPattern;
6881
7114
  function escapePath(source) {
@@ -6917,9 +7150,9 @@ var require_out4 = __commonJS({
6917
7150
  })(FastGlob || (FastGlob = {}));
6918
7151
  function getWorks(source, _Provider, options) {
6919
7152
  const patterns = [].concat(source);
6920
- const settings = new settings_1.default(options);
6921
- const tasks = taskManager.generate(patterns, settings);
6922
- const provider = new _Provider(settings);
7153
+ const settings2 = new settings_1.default(options);
7154
+ const tasks = taskManager.generate(patterns, settings2);
7155
+ const provider = new _Provider(settings2);
6923
7156
  return tasks.map(provider.read, provider);
6924
7157
  }
6925
7158
  function assertPatternsInput(input) {
@@ -7097,14 +7330,14 @@ import "node:fs";
7097
7330
  import { createRequire } from "node:module";
7098
7331
  import {
7099
7332
  resolve,
7100
- join,
7101
- dirname,
7333
+ join as join2,
7334
+ dirname as dirname2,
7102
7335
  relative,
7103
7336
  normalize,
7104
7337
  sep,
7105
7338
  extname
7106
7339
  } from "node:path";
7107
- import "node:url";
7340
+ import { fileURLToPath } from "node:url";
7108
7341
  function safeExecuteAsync(fn, message) {
7109
7342
  return fn().catch((error2) => {
7110
7343
  throw new Error(
@@ -7112,7 +7345,7 @@ function safeExecuteAsync(fn, message) {
7112
7345
  );
7113
7346
  });
7114
7347
  }
7115
- var import_fast_glob, constants, log2, PACKAGE_PATHS, PathResolver;
7348
+ var import_fast_glob, constants, log3, PACKAGE_PATHS, PathResolver;
7116
7349
  var init_PathResolver = __esm({
7117
7350
  "packages/core/config/utils/PathResolver.ts"() {
7118
7351
  "use strict";
@@ -7125,7 +7358,7 @@ var init_PathResolver = __esm({
7125
7358
  getPatternsFor: getPatternsFor || void 0,
7126
7359
  I18N_PATHS: I18N_PATHS || void 0
7127
7360
  };
7128
- log2 = {
7361
+ log3 = {
7129
7362
  error: (message, error2) => {
7130
7363
  },
7131
7364
  warn: (message, error2) => {
@@ -7161,6 +7394,7 @@ var init_PathResolver = __esm({
7161
7394
  options;
7162
7395
  _repoRoot;
7163
7396
  _appRoot = null;
7397
+ _writtenPaths = null;
7164
7398
  /**
7165
7399
  * Get or create singleton instance
7166
7400
  * @param options - Configuration options
@@ -7246,7 +7480,7 @@ var init_PathResolver = __esm({
7246
7480
  */
7247
7481
  getDirname(path) {
7248
7482
  if (!path) return "";
7249
- return this.normalizePath(dirname(path));
7483
+ return this.normalizePath(dirname2(path));
7250
7484
  }
7251
7485
  /**
7252
7486
  * Resolve package path using Node's module resolution
@@ -7258,7 +7492,7 @@ var init_PathResolver = __esm({
7258
7492
  resolvePackage(packageSpecifier, fromPath = null) {
7259
7493
  try {
7260
7494
  const basePath = fromPath || this.getAppRoot();
7261
- const require3 = createRequire(join(basePath, "package.json"));
7495
+ const require3 = createRequire(join2(basePath, "package.json"));
7262
7496
  const resolved = require3.resolve(packageSpecifier);
7263
7497
  return this.normalizePath(resolved);
7264
7498
  } catch (error2) {
@@ -7410,7 +7644,7 @@ var init_PathResolver = __esm({
7410
7644
  return cleanContent;
7411
7645
  } catch (error2) {
7412
7646
  if (this.options.debug) {
7413
- log2.warn(`Failed to read file: ${filePath}`, error2);
7647
+ log3.warn(`Failed to read file: ${filePath}`, error2);
7414
7648
  }
7415
7649
  return null;
7416
7650
  }
@@ -7438,7 +7672,7 @@ var init_PathResolver = __esm({
7438
7672
  return cleanContent;
7439
7673
  } catch (error2) {
7440
7674
  if (this.options.debug) {
7441
- log2.warn(`Failed to read file: ${filePath}`, error2);
7675
+ log3.warn(`Failed to read file: ${filePath}`, error2);
7442
7676
  }
7443
7677
  return null;
7444
7678
  }
@@ -7460,16 +7694,16 @@ var init_PathResolver = __esm({
7460
7694
  verbose = false
7461
7695
  } = options;
7462
7696
  const normalizedPath = this.normalizePath(filePath);
7463
- const dir = this.normalizePath(dirname(normalizedPath));
7697
+ const dir = this.normalizePath(dirname2(normalizedPath));
7464
7698
  const fileExists = this.pathExists(normalizedPath);
7465
7699
  if (fileExists && !overwrite) {
7466
7700
  if (verbose) {
7467
- log2.info(`Skipping existing file: ${normalizedPath}`);
7701
+ log3.info(`Skipping existing file: ${normalizedPath}`);
7468
7702
  }
7469
7703
  return false;
7470
7704
  }
7471
7705
  if (dryRun) {
7472
- log2.info(`[DRY RUN] Would write file: ${normalizedPath}`);
7706
+ log3.info(`[DRY RUN] Would write file: ${normalizedPath}`);
7473
7707
  return true;
7474
7708
  }
7475
7709
  try {
@@ -7479,22 +7713,23 @@ var init_PathResolver = __esm({
7479
7713
  }
7480
7714
  const detectedFormat = this._detectFormat(filePath, format);
7481
7715
  let writeContent;
7482
- if (Buffer.isBuffer(content)) {
7716
+ if (Buffer2.isBuffer(content)) {
7483
7717
  writeContent = content;
7484
7718
  } else if (detectedFormat === "json" && typeof content === "object") {
7485
- writeContent = JSON.stringify(content, null, 2);
7719
+ writeContent = `${JSON.stringify(content, null, 2)}
7720
+ `;
7486
7721
  } else {
7487
7722
  writeContent = String(content);
7488
7723
  }
7489
7724
  try {
7490
7725
  return await safeExecuteAsync(async () => {
7491
- if (Buffer.isBuffer(writeContent)) {
7726
+ if (Buffer2.isBuffer(writeContent)) {
7492
7727
  await fs.promises.writeFile(normalizedPath, writeContent);
7493
7728
  } else {
7494
7729
  await fs.promises.writeFile(normalizedPath, writeContent, "utf8");
7495
7730
  }
7496
7731
  if (verbose) {
7497
- log2.info(
7732
+ log3.info(
7498
7733
  `${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
7499
7734
  );
7500
7735
  }
@@ -7521,16 +7756,16 @@ var init_PathResolver = __esm({
7521
7756
  verbose = false
7522
7757
  } = options;
7523
7758
  const normalizedPath = this.normalizePath(filePath);
7524
- const dir = this.normalizePath(dirname(normalizedPath));
7759
+ const dir = this.normalizePath(dirname2(normalizedPath));
7525
7760
  const fileExists = this.pathExists(normalizedPath);
7526
7761
  if (fileExists && !overwrite) {
7527
7762
  if (verbose) {
7528
- log2.info(`Skipping existing file: ${normalizedPath}`);
7763
+ log3.info(`Skipping existing file: ${normalizedPath}`);
7529
7764
  }
7530
7765
  return false;
7531
7766
  }
7532
7767
  if (dryRun) {
7533
- log2.info(`[DRY RUN] Would write file: ${normalizedPath}`);
7768
+ log3.info(`[DRY RUN] Would write file: ${normalizedPath}`);
7534
7769
  return true;
7535
7770
  }
7536
7771
  try {
@@ -7540,21 +7775,23 @@ var init_PathResolver = __esm({
7540
7775
  }
7541
7776
  const detectedFormat = this._detectFormat(filePath, format);
7542
7777
  let writeContent;
7543
- if (Buffer.isBuffer(content)) {
7778
+ if (Buffer2.isBuffer(content)) {
7544
7779
  writeContent = content;
7545
7780
  } else if (detectedFormat === "json" && typeof content === "object") {
7546
- writeContent = JSON.stringify(content, null, 2);
7781
+ writeContent = `${JSON.stringify(content, null, 2)}
7782
+ `;
7547
7783
  } else {
7548
7784
  writeContent = String(content);
7549
7785
  }
7550
7786
  try {
7551
- if (Buffer.isBuffer(writeContent)) {
7787
+ if (Buffer2.isBuffer(writeContent)) {
7552
7788
  fs.writeFileSync(normalizedPath, writeContent);
7553
7789
  } else {
7554
7790
  fs.writeFileSync(normalizedPath, writeContent, "utf8");
7555
7791
  }
7792
+ this._writtenPaths?.add(normalizedPath);
7556
7793
  if (verbose) {
7557
- log2.info(
7794
+ log3.info(
7558
7795
  `${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
7559
7796
  );
7560
7797
  }
@@ -7579,15 +7816,15 @@ var init_PathResolver = __esm({
7579
7816
  const fileExists = this.pathExists(normalizedDestPath);
7580
7817
  if (fileExists && !overwrite) {
7581
7818
  if (verbose) {
7582
- log2.info(`Skipping existing file: ${normalizedDestPath}`);
7819
+ log3.info(`Skipping existing file: ${normalizedDestPath}`);
7583
7820
  }
7584
7821
  return false;
7585
7822
  }
7586
7823
  if (dryRun) {
7587
- log2.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
7824
+ log3.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
7588
7825
  return true;
7589
7826
  }
7590
- const dir = this.normalizePath(dirname(normalizedDestPath));
7827
+ const dir = this.normalizePath(dirname2(normalizedDestPath));
7591
7828
  try {
7592
7829
  await fs.promises.mkdir(dir, { recursive: true });
7593
7830
  } catch (error2) {
@@ -7597,7 +7834,7 @@ var init_PathResolver = __esm({
7597
7834
  return await safeExecuteAsync(async () => {
7598
7835
  await fs.promises.copyFile(srcPath, normalizedDestPath);
7599
7836
  if (verbose) {
7600
- log2.info(
7837
+ log3.info(
7601
7838
  `${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
7602
7839
  );
7603
7840
  }
@@ -7621,15 +7858,15 @@ var init_PathResolver = __esm({
7621
7858
  const fileExists = this.pathExists(normalizedDestPath);
7622
7859
  if (fileExists && !overwrite) {
7623
7860
  if (verbose) {
7624
- log2.info(`Skipping existing file: ${normalizedDestPath}`);
7861
+ log3.info(`Skipping existing file: ${normalizedDestPath}`);
7625
7862
  }
7626
7863
  return false;
7627
7864
  }
7628
7865
  if (dryRun) {
7629
- log2.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
7866
+ log3.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
7630
7867
  return true;
7631
7868
  }
7632
- const dir = this.normalizePath(dirname(normalizedDestPath));
7869
+ const dir = this.normalizePath(dirname2(normalizedDestPath));
7633
7870
  try {
7634
7871
  fs.mkdirSync(dir, { recursive: true });
7635
7872
  } catch (error2) {
@@ -7637,8 +7874,9 @@ var init_PathResolver = __esm({
7637
7874
  }
7638
7875
  try {
7639
7876
  fs.copyFileSync(srcPath, normalizedDestPath);
7877
+ this._writtenPaths?.add(normalizedDestPath);
7640
7878
  if (verbose) {
7641
- log2.info(
7879
+ log3.info(
7642
7880
  `${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
7643
7881
  );
7644
7882
  }
@@ -7655,7 +7893,7 @@ var init_PathResolver = __esm({
7655
7893
  return fs.existsSync(filePath);
7656
7894
  } catch (error2) {
7657
7895
  if (!silent) {
7658
- log2.error(`Error checking path existence: ${filePath}`, error2);
7896
+ log3.error(`Error checking path existence: ${filePath}`, error2);
7659
7897
  }
7660
7898
  return false;
7661
7899
  }
@@ -7681,7 +7919,7 @@ var init_PathResolver = __esm({
7681
7919
  return fs.readdirSync(dirPath, options);
7682
7920
  } catch (error2) {
7683
7921
  if (this.options.debug) {
7684
- log2.warn(`Failed to read directory: ${dirPath}`, error2);
7922
+ log3.warn(`Failed to read directory: ${dirPath}`, error2);
7685
7923
  }
7686
7924
  const isObjectOptions = options && typeof options === "object" && "withFileTypes" in options;
7687
7925
  return isObjectOptions && options.withFileTypes ? [] : [];
@@ -7699,11 +7937,29 @@ var init_PathResolver = __esm({
7699
7937
  return fs.statSync(filePath);
7700
7938
  } catch (error2) {
7701
7939
  if (this.options.debug) {
7702
- log2.warn(`Failed to stat file: ${filePath}`, error2);
7940
+ log3.warn(`Failed to stat file: ${filePath}`, error2);
7703
7941
  }
7704
7942
  return null;
7705
7943
  }
7706
7944
  }
7945
+ /**
7946
+ * Resolve the real path of a file, following symlinks
7947
+ * @param filePath - Path to resolve
7948
+ * @returns Resolved real path
7949
+ */
7950
+ realpathSync(filePath) {
7951
+ return fs.realpathSync(filePath);
7952
+ }
7953
+ /**
7954
+ * Watch a directory for changes
7955
+ * @param dirPath - Directory to watch
7956
+ * @param options - fs.watch options
7957
+ * @param callback - Callback for change events
7958
+ * @returns FSWatcher instance
7959
+ */
7960
+ watch(dirPath, options, callback) {
7961
+ return fs.watch(dirPath, options, callback);
7962
+ }
7707
7963
  /**
7708
7964
  * Get file stats synchronously (follows symlinks)
7709
7965
  * Returns null if file doesn't exist (graceful degradation)
@@ -7716,7 +7972,7 @@ var init_PathResolver = __esm({
7716
7972
  return fs.lstatSync(filePath);
7717
7973
  } catch (error2) {
7718
7974
  if (this.options.debug) {
7719
- log2.warn(`Failed to lstat file: ${filePath}`, error2);
7975
+ log3.warn(`Failed to lstat file: ${filePath}`, error2);
7720
7976
  }
7721
7977
  return null;
7722
7978
  }
@@ -7783,6 +8039,28 @@ var init_PathResolver = __esm({
7783
8039
  * Get app root (where vite.config.ts is, Vite's config.root)
7784
8040
  * Falls back to repoRoot if not set
7785
8041
  */
8042
+ /**
8043
+ * Start recording every path written by writeSync/copySync.
8044
+ * Lets a generator know exactly which files the current run produced,
8045
+ * without comparing file timestamps to a clock.
8046
+ */
8047
+ startWriteRecording() {
8048
+ this._writtenPaths = /* @__PURE__ */ new Set();
8049
+ }
8050
+ /**
8051
+ * Stop recording and return the normalized paths written since
8052
+ * startWriteRecording().
8053
+ */
8054
+ stopWriteRecording() {
8055
+ if (!this._writtenPaths) {
8056
+ throw new Error(
8057
+ "stopWriteRecording() called without startWriteRecording()"
8058
+ );
8059
+ }
8060
+ const written = this._writtenPaths;
8061
+ this._writtenPaths = null;
8062
+ return written;
8063
+ }
7786
8064
  getAppRoot() {
7787
8065
  if (!this._appRoot) {
7788
8066
  return this._repoRoot;
@@ -7805,7 +8083,7 @@ var init_PathResolver = __esm({
7805
8083
  * @returns True if repoRoot is the monorepo (has packages directory)
7806
8084
  */
7807
8085
  isMonorepo() {
7808
- const packagesDir = join(this._repoRoot, "packages");
8086
+ const packagesDir = join2(this._repoRoot, "packages");
7809
8087
  return this.pathExists(packagesDir);
7810
8088
  }
7811
8089
  /**
@@ -7822,7 +8100,7 @@ var init_PathResolver = __esm({
7822
8100
  * Find files matching pattern within directory
7823
8101
  */
7824
8102
  async findFiles(directory, pattern, options = {}) {
7825
- const searchPattern = this.normalizePath(join(directory, pattern));
8103
+ const searchPattern = this.normalizePath(join2(directory, pattern));
7826
8104
  const appRoot = this.getAppRoot();
7827
8105
  const normalizeAppRoot = this.normalizePath(appRoot);
7828
8106
  const relativePattern = searchPattern.startsWith(normalizeAppRoot) ? searchPattern.slice(normalizeAppRoot.length + 1) : searchPattern;
@@ -7869,7 +8147,7 @@ var init_PathResolver = __esm({
7869
8147
  return null;
7870
8148
  }
7871
8149
  const resolvedPath = this.normalizePath(
7872
- join(corePackageRoot, I18N_PATHS2.PUBLISHED_ROOT, i18nSubpath)
8150
+ join2(corePackageRoot, I18N_PATHS2.PUBLISHED_ROOT, i18nSubpath)
7873
8151
  );
7874
8152
  const resolvedDir = resolvedPath.replace(/\/[^/]*\*.*$/, "");
7875
8153
  if (this.pathExists(resolvedDir)) {
@@ -8040,6 +8318,15 @@ var init_PathResolver = __esm({
8040
8318
  const cjsPath = this.getEmptyCjsModulePath();
8041
8319
  return cjsPath.replace(/\.cjs$/, ".js");
8042
8320
  }
8321
+ /**
8322
+ * Get absolute path to empty flag component module.
8323
+ * Returns `export default () => null;` — used by flag filtering plugins
8324
+ * to replace unused flag files at build time.
8325
+ */
8326
+ getEmptyFlagModulePath() {
8327
+ const __dirname2 = dirname2(fileURLToPath(import.meta.url));
8328
+ return this.normalizePath(resolve(__dirname2, "emptyFlag.js"));
8329
+ }
8043
8330
  /**
8044
8331
  * Get absolute path to empty CJS module for esbuild pre-bundling.
8045
8332
  * CJS because esbuild statically analyzes ESM exports — CJS has dynamic
@@ -8065,13 +8352,13 @@ var init_PathResolver = __esm({
8065
8352
  const maxLevels = this.options.maxLevels;
8066
8353
  while (levelsChecked < maxLevels) {
8067
8354
  const toolingPath = this.normalizePath(
8068
- join(currentDir, PACKAGE_PATHS.TOOLING)
8355
+ join2(currentDir, PACKAGE_PATHS.TOOLING)
8069
8356
  );
8070
- const corePath = this.normalizePath(join(currentDir, PACKAGE_PATHS.CORE));
8357
+ const corePath = this.normalizePath(join2(currentDir, PACKAGE_PATHS.CORE));
8071
8358
  if (this.pathExists(toolingPath) && this.pathExists(corePath)) {
8072
8359
  return currentDir;
8073
8360
  }
8074
- const appsDir = join(currentDir, "apps");
8361
+ const appsDir = join2(currentDir, "apps");
8075
8362
  if (this.pathExists(appsDir)) {
8076
8363
  const appsDirStat = this.statSync(appsDir);
8077
8364
  if (appsDirStat?.isDirectory()) {
@@ -8079,15 +8366,15 @@ var init_PathResolver = __esm({
8079
8366
  }
8080
8367
  }
8081
8368
  const packageJsonPath = this.normalizePath(
8082
- join(currentDir, "package.json")
8369
+ join2(currentDir, "package.json")
8083
8370
  );
8084
8371
  if (this.pathExists(packageJsonPath)) {
8085
- const parentDir2 = this.normalizePath(dirname(currentDir));
8372
+ const parentDir2 = this.normalizePath(dirname2(currentDir));
8086
8373
  if (parentDir2 === currentDir) {
8087
8374
  return currentDir;
8088
8375
  }
8089
8376
  }
8090
- const parentDir = this.normalizePath(dirname(currentDir));
8377
+ const parentDir = this.normalizePath(dirname2(currentDir));
8091
8378
  if (parentDir === currentDir) {
8092
8379
  break;
8093
8380
  }
@@ -8103,8 +8390,8 @@ var init_PathResolver = __esm({
8103
8390
  // packages/tooling/src/utils/pathResolver.ts
8104
8391
  import { createRequire as createRequire2 } from "node:module";
8105
8392
  import {
8106
- join as join2,
8107
- dirname as dirname2,
8393
+ join as join3,
8394
+ dirname as dirname3,
8108
8395
  basename as basename2,
8109
8396
  extname as extname2,
8110
8397
  relative as relative2,
@@ -8114,7 +8401,7 @@ import {
8114
8401
  } from "node:path";
8115
8402
  import { fileURLToPath as fileURLToPath2 } from "node:url";
8116
8403
  function getDirnameFromUrl(importMetaUrl) {
8117
- return dirname2(fileURLToPath2(importMetaUrl));
8404
+ return dirname3(fileURLToPath2(importMetaUrl));
8118
8405
  }
8119
8406
  function detectExecutionMode() {
8120
8407
  const fileUrlPath = fileURLToPath2(import.meta.url);
@@ -8130,7 +8417,7 @@ function getTemplatesRoot() {
8130
8417
  const mode = detectExecutionMode();
8131
8418
  if (mode === "development") {
8132
8419
  const fileUrlPath = fileURLToPath2(import.meta.url);
8133
- const frameworkRoot = normalizePath(dirname2(fileUrlPath), "../../../..");
8420
+ const frameworkRoot = normalizePath(dirname3(fileUrlPath), "../../../..");
8134
8421
  return normalizePath(frameworkRoot, PACKAGE_PATHS.CLI, "templates");
8135
8422
  } else {
8136
8423
  try {
@@ -8146,7 +8433,7 @@ function getTemplatesRoot() {
8146
8433
  try {
8147
8434
  const req = createRequire2(import.meta.url);
8148
8435
  const cliPackageJsonPath = req.resolve("@donotdev/cli/package.json");
8149
- const cliRoot2 = normalizePath(dirname2(cliPackageJsonPath));
8436
+ const cliRoot2 = normalizePath(dirname3(cliPackageJsonPath));
8150
8437
  const templatesPath = normalizePath(cliRoot2, "templates");
8151
8438
  if (pathExists(templatesPath)) {
8152
8439
  return templatesPath;
@@ -8198,8 +8485,8 @@ async function glob(pattern, options = {}) {
8198
8485
  const patterns = Array.isArray(pattern) ? pattern : [pattern];
8199
8486
  const cwd = options.cwd || pathResolverInstance.getAppRoot() || process.cwd();
8200
8487
  const normalizeCwd = pathResolverInstance.normalizePath(cwd);
8201
- const relativePatterns = patterns.map((p2) => {
8202
- const normalizedPattern = pathResolverInstance.normalizePath(p2);
8488
+ const relativePatterns = patterns.map((p) => {
8489
+ const normalizedPattern = pathResolverInstance.normalizePath(p);
8203
8490
  if (normalizedPattern.startsWith(normalizeCwd)) {
8204
8491
  return normalizedPattern.slice(normalizeCwd.length + 1);
8205
8492
  }
@@ -8230,7 +8517,7 @@ var init_pathResolver = __esm({
8230
8517
  pathResolverInstance = PathResolver.getInstance({ debug: false });
8231
8518
  resolveFrameworkPackage = (name, from) => pathResolverInstance.resolveFrameworkPackage(name, from || null);
8232
8519
  normalizePath = (...pathSegments) => {
8233
- return pathResolverInstance.normalizePath(join2(...pathSegments));
8520
+ return pathResolverInstance.normalizePath(join3(...pathSegments));
8234
8521
  };
8235
8522
  pathExists = (filePath, silent = false) => pathResolverInstance.pathExists(filePath, silent);
8236
8523
  read = async (filePath, options) => pathResolverInstance.read(filePath, options);
@@ -8243,7 +8530,7 @@ var init_pathResolver = __esm({
8243
8530
  return normalizePath(relative2(from, to));
8244
8531
  };
8245
8532
  getDirname = (filePath) => {
8246
- return normalizePath(dirname2(filePath));
8533
+ return normalizePath(dirname3(filePath));
8247
8534
  };
8248
8535
  joinPath = (...pathSegments) => {
8249
8536
  return normalizePath(...pathSegments);
@@ -8252,10 +8539,10 @@ var init_pathResolver = __esm({
8252
8539
  });
8253
8540
 
8254
8541
  // packages/tooling/src/bundler/utils.ts
8255
- import { Buffer } from "node:buffer";
8542
+ import { Buffer as Buffer2 } from "node:buffer";
8256
8543
  import { copyFileSync as copyFileSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
8257
8544
  import { createRequire as createRequire3 } from "node:module";
8258
- import { dirname as dirname3, resolve as resolve3 } from "node:path";
8545
+ import { dirname as dirname4, resolve as resolve3 } from "node:path";
8259
8546
  import process from "node:process";
8260
8547
  import { fileURLToPath as fileURLToPath3 } from "node:url";
8261
8548
  var require2, __filename, __dirname;
@@ -8264,12 +8551,12 @@ var init_utils2 = __esm({
8264
8551
  "use strict";
8265
8552
  require2 = createRequire3(import.meta.url);
8266
8553
  __filename = fileURLToPath3(import.meta.url);
8267
- __dirname = dirname3(__filename);
8554
+ __dirname = dirname4(__filename);
8268
8555
  if (typeof globalThis !== "undefined") {
8269
8556
  globalThis.require = require2;
8270
8557
  globalThis.__filename = __filename;
8271
8558
  globalThis.__dirname = __dirname;
8272
- globalThis.Buffer = Buffer;
8559
+ globalThis.Buffer = Buffer2;
8273
8560
  globalThis.process = process;
8274
8561
  if (typeof global === "undefined") {
8275
8562
  globalThis.global = globalThis;
@@ -8285,13 +8572,13 @@ async function askForSelection(message, choices, defaultValue = 0) {
8285
8572
  label: choice.title,
8286
8573
  hint: choice.hint
8287
8574
  }));
8288
- const result = await _t({
8575
+ const result = await select({
8289
8576
  message,
8290
8577
  options,
8291
8578
  initialValue: choices[defaultValue]?.value
8292
8579
  });
8293
- if (q(result)) {
8294
- pt("Operation cancelled.");
8580
+ if (isCancel(result)) {
8581
+ cancel("Operation cancelled.");
8295
8582
  process.exit(0);
8296
8583
  }
8297
8584
  return result;
@@ -8319,7 +8606,7 @@ init_cli_output();
8319
8606
  init_pathResolver();
8320
8607
  async function copyTemplateFiles(sourceDir, destDir, replacements) {
8321
8608
  if (!pathExists(sourceDir)) {
8322
- log.warn(`Warning: Template directory does not exist: ${sourceDir}`);
8609
+ log2.warn(`Warning: Template directory does not exist: ${sourceDir}`);
8323
8610
  return;
8324
8611
  }
8325
8612
  const files = await glob("**/*", {
@@ -8389,8 +8676,8 @@ async function isTextFile(filePath) {
8389
8676
  try {
8390
8677
  const buffer = await read(filePath, { format: "buffer" });
8391
8678
  if (buffer.length === 0) return true;
8392
- for (let i = 0; i < Math.min(buffer.length, 1e3); i++) {
8393
- if (buffer[i] === 0) return false;
8679
+ for (let i2 = 0; i2 < Math.min(buffer.length, 1e3); i2++) {
8680
+ if (buffer[i2] === 0) return false;
8394
8681
  }
8395
8682
  return true;
8396
8683
  } catch {
@@ -8415,7 +8702,7 @@ async function replacePlaceholders(filePath, replacements) {
8415
8702
  }
8416
8703
  await write(filePath, content, { overwrite: true });
8417
8704
  } catch (error2) {
8418
- log.warn(
8705
+ log2.warn(
8419
8706
  `Warning: Could not process file ${filePath}: ${error2.message || "Unknown error"}`
8420
8707
  );
8421
8708
  }
@@ -8522,16 +8809,16 @@ function loadMatrix(mode) {
8522
8809
  return cachedMatrix;
8523
8810
  }
8524
8811
  function resolveGroup(groupName, matrix) {
8525
- const group = matrix.groups[groupName];
8526
- if (!group) return {};
8812
+ const group2 = matrix.groups[groupName];
8813
+ if (!group2) return {};
8527
8814
  const result = {};
8528
- if (group.includes) {
8529
- for (const included of group.includes) {
8815
+ if (group2.includes) {
8816
+ for (const included of group2.includes) {
8530
8817
  Object.assign(result, resolveGroup(included, matrix));
8531
8818
  }
8532
8819
  }
8533
- if (group.packages) {
8534
- Object.assign(result, group.packages);
8820
+ if (group2.packages) {
8821
+ Object.assign(result, group2.packages);
8535
8822
  }
8536
8823
  return result;
8537
8824
  }
@@ -8714,9 +9001,9 @@ function generatePackageJson(templateName, mode, options = {}) {
8714
9001
  }
8715
9002
  if (mode === "published") {
8716
9003
  const overrides = {};
8717
- for (const [groupName, group] of Object.entries(matrix.groups || {})) {
9004
+ for (const [groupName, group2] of Object.entries(matrix.groups || {})) {
8718
9005
  if (groupName.startsWith("@donotdev/")) {
8719
- const version = group.packages?.[groupName];
9006
+ const version = group2.packages?.[groupName];
8720
9007
  if (version) {
8721
9008
  overrides[groupName] = version.replace(/^\^/, "");
8722
9009
  }
@@ -8738,15 +9025,15 @@ init_cli_input();
8738
9025
  init_cli_output();
8739
9026
  init_pathResolver();
8740
9027
  async function main(options) {
8741
- mt("get-demo");
9028
+ intro("get-demo");
8742
9029
  const cwd = normalizePath(process.cwd());
8743
9030
  const executionMode = detectExecutionMode();
8744
9031
  const templatesRoot = getTemplatesRoot();
8745
9032
  const demoTemplateDir = joinPath(templatesRoot, "app-demo");
8746
9033
  const demoAppDir = joinPath(cwd, "apps", "demo");
8747
9034
  if (!pathExists(demoTemplateDir)) {
8748
- log.error(`Demo template not found: ${demoTemplateDir}`);
8749
- gt("Failed");
9035
+ log2.error(`Demo template not found: ${demoTemplateDir}`);
9036
+ outro("Failed");
8750
9037
  return;
8751
9038
  }
8752
9039
  if (pathExists(demoAppDir)) {
@@ -8762,13 +9049,13 @@ async function main(options) {
8762
9049
  1
8763
9050
  );
8764
9051
  if (action === "cancel") {
8765
- gt("Cancelled");
9052
+ outro("Cancelled");
8766
9053
  return;
8767
9054
  }
8768
9055
  await remove(demoAppDir);
8769
9056
  }
8770
9057
  }
8771
- const s = fe();
9058
+ const s = spinner();
8772
9059
  s.start("Copying demo app...");
8773
9060
  const projectName = getProjectName(cwd);
8774
9061
  const firebaseProjectId = projectName.toLowerCase().replace(/\s+/g, "-");
@@ -8810,11 +9097,11 @@ async function main(options) {
8810
9097
  overwrite: true
8811
9098
  });
8812
9099
  s.stop("Demo app copied to apps/demo");
8813
- log.info("");
8814
- log.info("Next steps:");
8815
- log.info(" bun install");
8816
- log.info(" cd apps/demo && dndev dev");
8817
- gt("Done");
9100
+ log2.info("");
9101
+ log2.info("Next steps:");
9102
+ log2.info(" bun install");
9103
+ log2.info(" cd apps/demo && dndev dev");
9104
+ outro("Done");
8818
9105
  }
8819
9106
  function getProjectName(cwd) {
8820
9107
  try {