@chat-js/cli 0.4.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/dist/index.js +1548 -969
  2. package/package.json +4 -3
  3. package/templates/chat-app/app/(auth)/device-login/page.tsx +37 -0
  4. package/templates/chat-app/app/(auth)/login/page.tsx +26 -2
  5. package/templates/chat-app/app/(auth)/register/page.tsx +0 -12
  6. package/templates/chat-app/app/(chat)/api/chat/filter-reasoning-parts.ts +1 -1
  7. package/templates/chat-app/app/(chat)/api/chat/route.ts +13 -5
  8. package/templates/chat-app/app/(chat)/layout.tsx +4 -1
  9. package/templates/chat-app/app/api/trpc/[trpc]/route.ts +1 -0
  10. package/templates/chat-app/app/globals.css +9 -9
  11. package/templates/chat-app/app/layout.tsx +4 -2
  12. package/templates/chat-app/biome.jsonc +3 -3
  13. package/templates/chat-app/chat.config.ts +144 -141
  14. package/templates/chat-app/components/ai-elements/prompt-input.tsx +1 -1
  15. package/templates/chat-app/components/anonymous-session-init.tsx +10 -6
  16. package/templates/chat-app/components/artifact-actions.tsx +81 -18
  17. package/templates/chat-app/components/artifact-panel.tsx +142 -41
  18. package/templates/chat-app/components/attachment-list.tsx +1 -1
  19. package/templates/chat-app/components/{social-auth-providers.tsx → auth-providers.tsx} +49 -4
  20. package/templates/chat-app/components/chat/chat-welcome.tsx +3 -3
  21. package/templates/chat-app/components/chat-menu-items.tsx +1 -1
  22. package/templates/chat-app/components/chat-sync.tsx +3 -8
  23. package/templates/chat-app/components/console.tsx +9 -9
  24. package/templates/chat-app/components/context-usage.tsx +2 -2
  25. package/templates/chat-app/components/create-artifact.tsx +15 -5
  26. package/templates/chat-app/components/data-stream-handler.tsx +57 -16
  27. package/templates/chat-app/components/device-login-page.tsx +191 -0
  28. package/templates/chat-app/components/diffview.tsx +8 -2
  29. package/templates/chat-app/components/electron-auth-handler.tsx +184 -0
  30. package/templates/chat-app/components/electron-auth-ui.tsx +121 -0
  31. package/templates/chat-app/components/favicon-group.tsx +1 -1
  32. package/templates/chat-app/components/feedback-actions.tsx +1 -1
  33. package/templates/chat-app/components/greeting.tsx +1 -1
  34. package/templates/chat-app/components/interactive-chart-impl.tsx +3 -4
  35. package/templates/chat-app/components/interactive-charts.tsx +1 -1
  36. package/templates/chat-app/components/login-form.tsx +52 -10
  37. package/templates/chat-app/components/message-editor.tsx +4 -5
  38. package/templates/chat-app/components/model-selector.tsx +661 -655
  39. package/templates/chat-app/components/multimodal-input.tsx +13 -10
  40. package/templates/chat-app/components/parallel-response-cards.tsx +53 -35
  41. package/templates/chat-app/components/part/code-execution.tsx +8 -2
  42. package/templates/chat-app/components/part/document-common.tsx +1 -1
  43. package/templates/chat-app/components/part/document-preview.tsx +5 -5
  44. package/templates/chat-app/components/part/retrieve-url.tsx +12 -12
  45. package/templates/chat-app/components/part/text-message-part.tsx +13 -9
  46. package/templates/chat-app/components/project-chat-item.tsx +1 -1
  47. package/templates/chat-app/components/project-menu-items.tsx +1 -1
  48. package/templates/chat-app/components/research-task.tsx +1 -1
  49. package/templates/chat-app/components/research-tasks.tsx +1 -1
  50. package/templates/chat-app/components/retry-button.tsx +1 -1
  51. package/templates/chat-app/components/sandbox.tsx +1 -1
  52. package/templates/chat-app/components/sheet-editor.tsx +7 -7
  53. package/templates/chat-app/components/sidebar-chats-list.tsx +1 -1
  54. package/templates/chat-app/components/sidebar-toggle.tsx +15 -2
  55. package/templates/chat-app/components/sidebar-top-row.tsx +27 -12
  56. package/templates/chat-app/components/sidebar-user-nav.tsx +10 -1
  57. package/templates/chat-app/components/signup-form.tsx +49 -10
  58. package/templates/chat-app/components/sources.tsx +4 -4
  59. package/templates/chat-app/components/text-editor.tsx +5 -2
  60. package/templates/chat-app/components/toolbar.tsx +3 -3
  61. package/templates/chat-app/components/ui/sidebar.tsx +0 -1
  62. package/templates/chat-app/components/upgrade-cta/limit-display.tsx +1 -1
  63. package/templates/chat-app/components/user-message.tsx +135 -134
  64. package/templates/chat-app/electron.d.ts +41 -0
  65. package/templates/chat-app/evals/my-eval.eval.ts +3 -1
  66. package/templates/chat-app/hooks/use-artifact.tsx +13 -13
  67. package/templates/chat-app/lib/ai/gateways/provider-types.ts +19 -10
  68. package/templates/chat-app/lib/ai/stream-errors.test.ts +72 -0
  69. package/templates/chat-app/lib/ai/stream-errors.ts +94 -0
  70. package/templates/chat-app/lib/ai/tools/code-execution.javascript.ts +171 -0
  71. package/templates/chat-app/lib/ai/tools/code-execution.python.ts +336 -0
  72. package/templates/chat-app/lib/ai/tools/code-execution.shared.test.ts +71 -0
  73. package/templates/chat-app/lib/ai/tools/code-execution.shared.ts +59 -0
  74. package/templates/chat-app/lib/ai/tools/code-execution.ts +62 -391
  75. package/templates/chat-app/lib/ai/tools/code-execution.types.ts +24 -0
  76. package/templates/chat-app/lib/ai/tools/steps/multi-query-web-search.ts +3 -2
  77. package/templates/chat-app/lib/anonymous-session-client.ts +0 -3
  78. package/templates/chat-app/lib/artifacts/code/client.tsx +35 -5
  79. package/templates/chat-app/lib/artifacts/sheet/client.tsx +11 -3
  80. package/templates/chat-app/lib/auth-client.ts +23 -1
  81. package/templates/chat-app/lib/auth.ts +18 -1
  82. package/templates/chat-app/lib/blob.ts +1 -1
  83. package/templates/chat-app/lib/clone-messages.ts +1 -1
  84. package/templates/chat-app/lib/config-schema.ts +13 -1
  85. package/templates/chat-app/lib/constants.ts +3 -4
  86. package/templates/chat-app/lib/db/migrations/meta/0044_snapshot.json +42 -129
  87. package/templates/chat-app/lib/db/migrations/meta/_journal.json +1 -1
  88. package/templates/chat-app/lib/editor/config.ts +4 -4
  89. package/templates/chat-app/lib/electron-auth.ts +96 -0
  90. package/templates/chat-app/lib/env-schema.ts +33 -4
  91. package/templates/chat-app/lib/message-conversion.ts +1 -1
  92. package/templates/chat-app/lib/playwright-test-environment.ts +18 -0
  93. package/templates/chat-app/lib/social-auth.ts +5 -0
  94. package/templates/chat-app/lib/stores/hooks-threads.ts +2 -1
  95. package/templates/chat-app/lib/stores/with-threads.test.ts +1 -1
  96. package/templates/chat-app/lib/stores/with-threads.ts +5 -6
  97. package/templates/chat-app/lib/stores/with-tracing.ts +1 -1
  98. package/templates/chat-app/lib/thread-utils.ts +19 -21
  99. package/templates/chat-app/lib/utils/download-assets.ts +6 -7
  100. package/templates/chat-app/lib/utils/rate-limit.ts +9 -3
  101. package/templates/chat-app/package.json +22 -19
  102. package/templates/chat-app/playwright.config.ts +0 -19
  103. package/templates/chat-app/providers/chat-input-provider.tsx +1 -1
  104. package/templates/chat-app/proxy.ts +28 -3
  105. package/templates/chat-app/scripts/check-env.ts +10 -0
  106. package/templates/chat-app/trpc/server.tsx +7 -2
  107. package/templates/chat-app/tsconfig.json +2 -1
  108. package/templates/chat-app/vercel.json +0 -10
  109. package/templates/electron/CHANGELOG.md +7 -0
  110. package/templates/electron/README.md +54 -0
  111. package/templates/electron/entitlements.mac.plist +10 -0
  112. package/templates/electron/forge.config.ts +152 -0
  113. package/templates/electron/icon.png +0 -0
  114. package/templates/electron/package.json +53 -0
  115. package/templates/electron/scripts/generate-icons.test.js +37 -0
  116. package/templates/electron/scripts/generate-icons.ts +29 -0
  117. package/templates/electron/scripts/run-forge.cjs +28 -0
  118. package/templates/electron/scripts/write-branding.ts +18 -0
  119. package/templates/electron/src/config.ts +16 -0
  120. package/templates/electron/src/lib/auth-client.ts +64 -0
  121. package/templates/electron/src/main.ts +670 -0
  122. package/templates/electron/src/preload.d.ts +27 -0
  123. package/templates/electron/src/preload.ts +25 -0
  124. package/templates/electron/tsconfig.json +18 -0
package/dist/index.js CHANGED
@@ -28,7 +28,7 @@ var __export = (target, all) => {
28
28
  };
29
29
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
30
30
 
31
- // ../../node_modules/commander/lib/error.js
31
+ // ../../node_modules/.bun/commander@14.0.3/node_modules/commander/lib/error.js
32
32
  var require_error = __commonJS((exports) => {
33
33
  class CommanderError extends Error {
34
34
  constructor(exitCode, code, message) {
@@ -52,7 +52,7 @@ var require_error = __commonJS((exports) => {
52
52
  exports.InvalidArgumentError = InvalidArgumentError;
53
53
  });
54
54
 
55
- // ../../node_modules/commander/lib/argument.js
55
+ // ../../node_modules/.bun/commander@14.0.3/node_modules/commander/lib/argument.js
56
56
  var require_argument = __commonJS((exports) => {
57
57
  var { InvalidArgumentError } = require_error();
58
58
 
@@ -132,7 +132,7 @@ var require_argument = __commonJS((exports) => {
132
132
  exports.humanReadableArgName = humanReadableArgName;
133
133
  });
134
134
 
135
- // ../../node_modules/commander/lib/help.js
135
+ // ../../node_modules/.bun/commander@14.0.3/node_modules/commander/lib/help.js
136
136
  var require_help = __commonJS((exports) => {
137
137
  var { humanReadableArgName } = require_argument();
138
138
 
@@ -489,7 +489,7 @@ ${itemIndentStr}`);
489
489
  exports.stripColor = stripColor;
490
490
  });
491
491
 
492
- // ../../node_modules/commander/lib/option.js
492
+ // ../../node_modules/.bun/commander@14.0.3/node_modules/commander/lib/option.js
493
493
  var require_option = __commonJS((exports) => {
494
494
  var { InvalidArgumentError } = require_error();
495
495
 
@@ -673,7 +673,7 @@ var require_option = __commonJS((exports) => {
673
673
  exports.DualOptions = DualOptions;
674
674
  });
675
675
 
676
- // ../../node_modules/commander/lib/suggestSimilar.js
676
+ // ../../node_modules/.bun/commander@14.0.3/node_modules/commander/lib/suggestSimilar.js
677
677
  var require_suggestSimilar = __commonJS((exports) => {
678
678
  var maxDistance = 3;
679
679
  function editDistance(a, b) {
@@ -746,7 +746,7 @@ var require_suggestSimilar = __commonJS((exports) => {
746
746
  exports.suggestSimilar = suggestSimilar;
747
747
  });
748
748
 
749
- // ../../node_modules/commander/lib/command.js
749
+ // ../../node_modules/.bun/commander@14.0.3/node_modules/commander/lib/command.js
750
750
  var require_command = __commonJS((exports) => {
751
751
  var EventEmitter = __require("node:events").EventEmitter;
752
752
  var childProcess = __require("node:child_process");
@@ -2101,7 +2101,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
2101
2101
  exports.useColor = useColor;
2102
2102
  });
2103
2103
 
2104
- // ../../node_modules/commander/index.js
2104
+ // ../../node_modules/.bun/commander@14.0.3/node_modules/commander/index.js
2105
2105
  var require_commander = __commonJS((exports) => {
2106
2106
  var { Argument } = require_argument();
2107
2107
  var { Command } = require_command();
@@ -2121,122 +2121,52 @@ var require_commander = __commonJS((exports) => {
2121
2121
  exports.InvalidOptionArgumentError = InvalidArgumentError;
2122
2122
  });
2123
2123
 
2124
- // ../../node_modules/picocolors/picocolors.js
2125
- var require_picocolors = __commonJS((exports, module) => {
2126
- var p = process || {};
2127
- var argv = p.argv || [];
2128
- var env = p.env || {};
2129
- var isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
2130
- var formatter = (open, close, replace = open) => (input) => {
2131
- let string4 = "" + input, index = string4.indexOf(close, open.length);
2132
- return ~index ? open + replaceClose(string4, close, replace, index) + close : open + string4 + close;
2133
- };
2134
- var replaceClose = (string4, close, replace, index) => {
2135
- let result = "", cursor = 0;
2136
- do {
2137
- result += string4.substring(cursor, index) + replace;
2138
- cursor = index + close.length;
2139
- index = string4.indexOf(close, cursor);
2140
- } while (~index);
2141
- return result + string4.substring(cursor);
2142
- };
2143
- var createColors = (enabled = isColorSupported) => {
2144
- let f = enabled ? formatter : () => String;
2145
- return {
2146
- isColorSupported: enabled,
2147
- reset: f("\x1B[0m", "\x1B[0m"),
2148
- bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
2149
- dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
2150
- italic: f("\x1B[3m", "\x1B[23m"),
2151
- underline: f("\x1B[4m", "\x1B[24m"),
2152
- inverse: f("\x1B[7m", "\x1B[27m"),
2153
- hidden: f("\x1B[8m", "\x1B[28m"),
2154
- strikethrough: f("\x1B[9m", "\x1B[29m"),
2155
- black: f("\x1B[30m", "\x1B[39m"),
2156
- red: f("\x1B[31m", "\x1B[39m"),
2157
- green: f("\x1B[32m", "\x1B[39m"),
2158
- yellow: f("\x1B[33m", "\x1B[39m"),
2159
- blue: f("\x1B[34m", "\x1B[39m"),
2160
- magenta: f("\x1B[35m", "\x1B[39m"),
2161
- cyan: f("\x1B[36m", "\x1B[39m"),
2162
- white: f("\x1B[37m", "\x1B[39m"),
2163
- gray: f("\x1B[90m", "\x1B[39m"),
2164
- bgBlack: f("\x1B[40m", "\x1B[49m"),
2165
- bgRed: f("\x1B[41m", "\x1B[49m"),
2166
- bgGreen: f("\x1B[42m", "\x1B[49m"),
2167
- bgYellow: f("\x1B[43m", "\x1B[49m"),
2168
- bgBlue: f("\x1B[44m", "\x1B[49m"),
2169
- bgMagenta: f("\x1B[45m", "\x1B[49m"),
2170
- bgCyan: f("\x1B[46m", "\x1B[49m"),
2171
- bgWhite: f("\x1B[47m", "\x1B[49m"),
2172
- blackBright: f("\x1B[90m", "\x1B[39m"),
2173
- redBright: f("\x1B[91m", "\x1B[39m"),
2174
- greenBright: f("\x1B[92m", "\x1B[39m"),
2175
- yellowBright: f("\x1B[93m", "\x1B[39m"),
2176
- blueBright: f("\x1B[94m", "\x1B[39m"),
2177
- magentaBright: f("\x1B[95m", "\x1B[39m"),
2178
- cyanBright: f("\x1B[96m", "\x1B[39m"),
2179
- whiteBright: f("\x1B[97m", "\x1B[39m"),
2180
- bgBlackBright: f("\x1B[100m", "\x1B[49m"),
2181
- bgRedBright: f("\x1B[101m", "\x1B[49m"),
2182
- bgGreenBright: f("\x1B[102m", "\x1B[49m"),
2183
- bgYellowBright: f("\x1B[103m", "\x1B[49m"),
2184
- bgBlueBright: f("\x1B[104m", "\x1B[49m"),
2185
- bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
2186
- bgCyanBright: f("\x1B[106m", "\x1B[49m"),
2187
- bgWhiteBright: f("\x1B[107m", "\x1B[49m")
2188
- };
2189
- };
2190
- module.exports = createColors();
2191
- module.exports.createColors = createColors;
2192
- });
2193
-
2194
- // ../../node_modules/sisteransi/src/index.js
2124
+ // ../../node_modules/.bun/sisteransi@1.0.5/node_modules/sisteransi/src/index.js
2195
2125
  var require_src = __commonJS((exports, module) => {
2196
- var ESC = "\x1B";
2197
- var CSI = `${ESC}[`;
2126
+ var ESC2 = "\x1B";
2127
+ var CSI2 = `${ESC2}[`;
2198
2128
  var beep = "\x07";
2199
2129
  var cursor = {
2200
2130
  to(x, y) {
2201
2131
  if (!y)
2202
- return `${CSI}${x + 1}G`;
2203
- return `${CSI}${y + 1};${x + 1}H`;
2132
+ return `${CSI2}${x + 1}G`;
2133
+ return `${CSI2}${y + 1};${x + 1}H`;
2204
2134
  },
2205
2135
  move(x, y) {
2206
2136
  let ret = "";
2207
2137
  if (x < 0)
2208
- ret += `${CSI}${-x}D`;
2138
+ ret += `${CSI2}${-x}D`;
2209
2139
  else if (x > 0)
2210
- ret += `${CSI}${x}C`;
2140
+ ret += `${CSI2}${x}C`;
2211
2141
  if (y < 0)
2212
- ret += `${CSI}${-y}A`;
2142
+ ret += `${CSI2}${-y}A`;
2213
2143
  else if (y > 0)
2214
- ret += `${CSI}${y}B`;
2144
+ ret += `${CSI2}${y}B`;
2215
2145
  return ret;
2216
2146
  },
2217
- up: (count = 1) => `${CSI}${count}A`,
2218
- down: (count = 1) => `${CSI}${count}B`,
2219
- forward: (count = 1) => `${CSI}${count}C`,
2220
- backward: (count = 1) => `${CSI}${count}D`,
2221
- nextLine: (count = 1) => `${CSI}E`.repeat(count),
2222
- prevLine: (count = 1) => `${CSI}F`.repeat(count),
2223
- left: `${CSI}G`,
2224
- hide: `${CSI}?25l`,
2225
- show: `${CSI}?25h`,
2226
- save: `${ESC}7`,
2227
- restore: `${ESC}8`
2147
+ up: (count = 1) => `${CSI2}${count}A`,
2148
+ down: (count = 1) => `${CSI2}${count}B`,
2149
+ forward: (count = 1) => `${CSI2}${count}C`,
2150
+ backward: (count = 1) => `${CSI2}${count}D`,
2151
+ nextLine: (count = 1) => `${CSI2}E`.repeat(count),
2152
+ prevLine: (count = 1) => `${CSI2}F`.repeat(count),
2153
+ left: `${CSI2}G`,
2154
+ hide: `${CSI2}?25l`,
2155
+ show: `${CSI2}?25h`,
2156
+ save: `${ESC2}7`,
2157
+ restore: `${ESC2}8`
2228
2158
  };
2229
2159
  var scroll = {
2230
- up: (count = 1) => `${CSI}S`.repeat(count),
2231
- down: (count = 1) => `${CSI}T`.repeat(count)
2160
+ up: (count = 1) => `${CSI2}S`.repeat(count),
2161
+ down: (count = 1) => `${CSI2}T`.repeat(count)
2232
2162
  };
2233
2163
  var erase = {
2234
- screen: `${CSI}2J`,
2235
- up: (count = 1) => `${CSI}1J`.repeat(count),
2236
- down: (count = 1) => `${CSI}J`.repeat(count),
2237
- line: `${CSI}2K`,
2238
- lineEnd: `${CSI}K`,
2239
- lineStart: `${CSI}1K`,
2164
+ screen: `${CSI2}2J`,
2165
+ up: (count = 1) => `${CSI2}1J`.repeat(count),
2166
+ down: (count = 1) => `${CSI2}J`.repeat(count),
2167
+ line: `${CSI2}2K`,
2168
+ lineEnd: `${CSI2}K`,
2169
+ lineStart: `${CSI2}1K`,
2240
2170
  lines(count) {
2241
2171
  let clear = "";
2242
2172
  for (let i = 0;i < count; i++)
@@ -2249,7 +2179,7 @@ var require_src = __commonJS((exports, module) => {
2249
2179
  module.exports = { cursor, scroll, erase, beep };
2250
2180
  });
2251
2181
 
2252
- // ../../node_modules/cli-spinners/spinners.json
2182
+ // ../../node_modules/.bun/cli-spinners@2.9.2/node_modules/cli-spinners/spinners.json
2253
2183
  var require_spinners = __commonJS((exports, module) => {
2254
2184
  module.exports = {
2255
2185
  dots: {
@@ -3875,7 +3805,7 @@ var require_spinners = __commonJS((exports, module) => {
3875
3805
  };
3876
3806
  });
3877
3807
 
3878
- // ../../node_modules/cli-spinners/index.js
3808
+ // ../../node_modules/.bun/cli-spinners@2.9.2/node_modules/cli-spinners/index.js
3879
3809
  var require_cli_spinners = __commonJS((exports, module) => {
3880
3810
  var spinners = Object.assign({}, require_spinners());
3881
3811
  var spinnersList = Object.keys(spinners);
@@ -3889,14 +3819,14 @@ var require_cli_spinners = __commonJS((exports, module) => {
3889
3819
  module.exports = spinners;
3890
3820
  });
3891
3821
 
3892
- // ../../node_modules/emoji-regex/index.js
3822
+ // ../../node_modules/.bun/emoji-regex@10.6.0/node_modules/emoji-regex/index.js
3893
3823
  var require_emoji_regex = __commonJS((exports, module) => {
3894
3824
  module.exports = () => {
3895
3825
  return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
3896
3826
  };
3897
3827
  });
3898
3828
 
3899
- // ../../node_modules/commander/esm.mjs
3829
+ // ../../node_modules/.bun/commander@14.0.3/node_modules/commander/esm.mjs
3900
3830
  var import__ = __toESM(require_commander(), 1);
3901
3831
  var {
3902
3832
  program,
@@ -3914,7 +3844,7 @@ var {
3914
3844
  // package.json
3915
3845
  var package_default = {
3916
3846
  name: "@chat-js/cli",
3917
- version: "0.4.0",
3847
+ version: "0.6.1",
3918
3848
  description: "CLI for creating and extending ChatJS apps",
3919
3849
  license: "Apache-2.0",
3920
3850
  repository: {
@@ -3953,9 +3883,10 @@ var package_default = {
3953
3883
  },
3954
3884
  scripts: {
3955
3885
  start: "bun src/index.ts",
3956
- build: "bun build ./src/index.ts --target=node --format=esm --outfile ./dist/index.js",
3886
+ build: "bun run template:sync && bun build ./src/index.ts --target=node --format=esm --outfile ./dist/index.js",
3887
+ "test:unit": "bun run template:sync && bun test src",
3957
3888
  "template:sync": "bun ../../scripts/sync-template.ts",
3958
- prepublishOnly: "bun run template:sync && bun run build && node ./dist/index.js --help >/dev/null"
3889
+ prepublishOnly: "bun run build && node ./dist/index.js --help >/dev/null"
3959
3890
  },
3960
3891
  type: "module",
3961
3892
  devDependencies: {
@@ -3963,7 +3894,7 @@ var package_default = {
3963
3894
  }
3964
3895
  };
3965
3896
 
3966
- // ../../node_modules/zod/v4/classic/external.js
3897
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/classic/external.js
3967
3898
  var exports_external = {};
3968
3899
  __export(exports_external, {
3969
3900
  xor: () => xor,
@@ -4204,7 +4135,7 @@ __export(exports_external, {
4204
4135
  $brand: () => $brand
4205
4136
  });
4206
4137
 
4207
- // ../../node_modules/zod/v4/core/index.js
4138
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/index.js
4208
4139
  var exports_core2 = {};
4209
4140
  __export(exports_core2, {
4210
4141
  version: () => version,
@@ -4482,7 +4413,7 @@ __export(exports_core2, {
4482
4413
  $ZodAny: () => $ZodAny
4483
4414
  });
4484
4415
 
4485
- // ../../node_modules/zod/v4/core/core.js
4416
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/core.js
4486
4417
  var NEVER = Object.freeze({
4487
4418
  status: "aborted"
4488
4419
  });
@@ -4558,7 +4489,7 @@ function config(newConfig) {
4558
4489
  Object.assign(globalConfig, newConfig);
4559
4490
  return globalConfig;
4560
4491
  }
4561
- // ../../node_modules/zod/v4/core/util.js
4492
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/util.js
4562
4493
  var exports_util = {};
4563
4494
  __export(exports_util, {
4564
4495
  unwrapMessage: () => unwrapMessage,
@@ -5232,7 +5163,7 @@ class Class {
5232
5163
  constructor(..._args) {}
5233
5164
  }
5234
5165
 
5235
- // ../../node_modules/zod/v4/core/errors.js
5166
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/errors.js
5236
5167
  var initializer = (inst, def) => {
5237
5168
  inst.name = "$ZodError";
5238
5169
  Object.defineProperty(inst, "_zod", {
@@ -5369,7 +5300,7 @@ function prettifyError(error) {
5369
5300
  `);
5370
5301
  }
5371
5302
 
5372
- // ../../node_modules/zod/v4/core/parse.js
5303
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/parse.js
5373
5304
  var _parse = (_Err) => (schema, value, _ctx, _params) => {
5374
5305
  const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
5375
5306
  const result = schema._zod.run({ value, issues: [] }, ctx);
@@ -5456,7 +5387,7 @@ var _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
5456
5387
  return _safeParseAsync(_Err)(schema, value, _ctx);
5457
5388
  };
5458
5389
  var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync($ZodRealError);
5459
- // ../../node_modules/zod/v4/core/regexes.js
5390
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/regexes.js
5460
5391
  var exports_regexes = {};
5461
5392
  __export(exports_regexes, {
5462
5393
  xid: () => xid,
@@ -5613,7 +5544,7 @@ var sha512_hex = /^[0-9a-fA-F]{128}$/;
5613
5544
  var sha512_base64 = /* @__PURE__ */ fixedBase64(86, "==");
5614
5545
  var sha512_base64url = /* @__PURE__ */ fixedBase64url(86);
5615
5546
 
5616
- // ../../node_modules/zod/v4/core/checks.js
5547
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/checks.js
5617
5548
  var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
5618
5549
  var _a;
5619
5550
  inst._zod ?? (inst._zod = {});
@@ -6160,7 +6091,7 @@ var $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (ins
6160
6091
  };
6161
6092
  });
6162
6093
 
6163
- // ../../node_modules/zod/v4/core/doc.js
6094
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/doc.js
6164
6095
  class Doc {
6165
6096
  constructor(args = []) {
6166
6097
  this.content = [];
@@ -6198,14 +6129,14 @@ class Doc {
6198
6129
  }
6199
6130
  }
6200
6131
 
6201
- // ../../node_modules/zod/v4/core/versions.js
6132
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/versions.js
6202
6133
  var version = {
6203
6134
  major: 4,
6204
6135
  minor: 3,
6205
6136
  patch: 6
6206
6137
  };
6207
6138
 
6208
- // ../../node_modules/zod/v4/core/schemas.js
6139
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/schemas.js
6209
6140
  var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
6210
6141
  var _a;
6211
6142
  inst ?? (inst = {});
@@ -8167,7 +8098,7 @@ function handleRefineResult(result, payload, input, inst) {
8167
8098
  payload.issues.push(issue(_iss));
8168
8099
  }
8169
8100
  }
8170
- // ../../node_modules/zod/v4/locales/index.js
8101
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/index.js
8171
8102
  var exports_locales = {};
8172
8103
  __export(exports_locales, {
8173
8104
  zhTW: () => zh_TW_default,
@@ -8221,7 +8152,7 @@ __export(exports_locales, {
8221
8152
  ar: () => ar_default
8222
8153
  });
8223
8154
 
8224
- // ../../node_modules/zod/v4/locales/ar.js
8155
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/ar.js
8225
8156
  var error = () => {
8226
8157
  const Sizable = {
8227
8158
  string: { unit: "حرف", verb: "أن يحوي" },
@@ -8327,7 +8258,7 @@ function ar_default() {
8327
8258
  localeError: error()
8328
8259
  };
8329
8260
  }
8330
- // ../../node_modules/zod/v4/locales/az.js
8261
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/az.js
8331
8262
  var error2 = () => {
8332
8263
  const Sizable = {
8333
8264
  string: { unit: "simvol", verb: "olmalıdır" },
@@ -8432,7 +8363,7 @@ function az_default() {
8432
8363
  localeError: error2()
8433
8364
  };
8434
8365
  }
8435
- // ../../node_modules/zod/v4/locales/be.js
8366
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/be.js
8436
8367
  function getBelarusianPlural(count, one, few, many) {
8437
8368
  const absCount = Math.abs(count);
8438
8369
  const lastDigit = absCount % 10;
@@ -8588,7 +8519,7 @@ function be_default() {
8588
8519
  localeError: error3()
8589
8520
  };
8590
8521
  }
8591
- // ../../node_modules/zod/v4/locales/bg.js
8522
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/bg.js
8592
8523
  var error4 = () => {
8593
8524
  const Sizable = {
8594
8525
  string: { unit: "символа", verb: "да съдържа" },
@@ -8708,7 +8639,7 @@ function bg_default() {
8708
8639
  localeError: error4()
8709
8640
  };
8710
8641
  }
8711
- // ../../node_modules/zod/v4/locales/ca.js
8642
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/ca.js
8712
8643
  var error5 = () => {
8713
8644
  const Sizable = {
8714
8645
  string: { unit: "caràcters", verb: "contenir" },
@@ -8815,7 +8746,7 @@ function ca_default() {
8815
8746
  localeError: error5()
8816
8747
  };
8817
8748
  }
8818
- // ../../node_modules/zod/v4/locales/cs.js
8749
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/cs.js
8819
8750
  var error6 = () => {
8820
8751
  const Sizable = {
8821
8752
  string: { unit: "znaků", verb: "mít" },
@@ -8926,7 +8857,7 @@ function cs_default() {
8926
8857
  localeError: error6()
8927
8858
  };
8928
8859
  }
8929
- // ../../node_modules/zod/v4/locales/da.js
8860
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/da.js
8930
8861
  var error7 = () => {
8931
8862
  const Sizable = {
8932
8863
  string: { unit: "tegn", verb: "havde" },
@@ -9041,7 +8972,7 @@ function da_default() {
9041
8972
  localeError: error7()
9042
8973
  };
9043
8974
  }
9044
- // ../../node_modules/zod/v4/locales/de.js
8975
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/de.js
9045
8976
  var error8 = () => {
9046
8977
  const Sizable = {
9047
8978
  string: { unit: "Zeichen", verb: "zu haben" },
@@ -9149,7 +9080,7 @@ function de_default() {
9149
9080
  localeError: error8()
9150
9081
  };
9151
9082
  }
9152
- // ../../node_modules/zod/v4/locales/en.js
9083
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/en.js
9153
9084
  var error9 = () => {
9154
9085
  const Sizable = {
9155
9086
  string: { unit: "characters", verb: "to have" },
@@ -9255,7 +9186,7 @@ function en_default() {
9255
9186
  localeError: error9()
9256
9187
  };
9257
9188
  }
9258
- // ../../node_modules/zod/v4/locales/eo.js
9189
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/eo.js
9259
9190
  var error10 = () => {
9260
9191
  const Sizable = {
9261
9192
  string: { unit: "karaktrojn", verb: "havi" },
@@ -9364,7 +9295,7 @@ function eo_default() {
9364
9295
  localeError: error10()
9365
9296
  };
9366
9297
  }
9367
- // ../../node_modules/zod/v4/locales/es.js
9298
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/es.js
9368
9299
  var error11 = () => {
9369
9300
  const Sizable = {
9370
9301
  string: { unit: "caracteres", verb: "tener" },
@@ -9496,7 +9427,7 @@ function es_default() {
9496
9427
  localeError: error11()
9497
9428
  };
9498
9429
  }
9499
- // ../../node_modules/zod/v4/locales/fa.js
9430
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/fa.js
9500
9431
  var error12 = () => {
9501
9432
  const Sizable = {
9502
9433
  string: { unit: "کاراکتر", verb: "داشته باشد" },
@@ -9610,7 +9541,7 @@ function fa_default() {
9610
9541
  localeError: error12()
9611
9542
  };
9612
9543
  }
9613
- // ../../node_modules/zod/v4/locales/fi.js
9544
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/fi.js
9614
9545
  var error13 = () => {
9615
9546
  const Sizable = {
9616
9547
  string: { unit: "merkkiä", subject: "merkkijonon" },
@@ -9722,7 +9653,7 @@ function fi_default() {
9722
9653
  localeError: error13()
9723
9654
  };
9724
9655
  }
9725
- // ../../node_modules/zod/v4/locales/fr.js
9656
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/fr.js
9726
9657
  var error14 = () => {
9727
9658
  const Sizable = {
9728
9659
  string: { unit: "caractères", verb: "avoir" },
@@ -9830,7 +9761,7 @@ function fr_default() {
9830
9761
  localeError: error14()
9831
9762
  };
9832
9763
  }
9833
- // ../../node_modules/zod/v4/locales/fr-CA.js
9764
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/fr-CA.js
9834
9765
  var error15 = () => {
9835
9766
  const Sizable = {
9836
9767
  string: { unit: "caractères", verb: "avoir" },
@@ -9937,7 +9868,7 @@ function fr_CA_default() {
9937
9868
  localeError: error15()
9938
9869
  };
9939
9870
  }
9940
- // ../../node_modules/zod/v4/locales/he.js
9871
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/he.js
9941
9872
  var error16 = () => {
9942
9873
  const TypeNames = {
9943
9874
  string: { label: "מחרוזת", gender: "f" },
@@ -10130,7 +10061,7 @@ function he_default() {
10130
10061
  localeError: error16()
10131
10062
  };
10132
10063
  }
10133
- // ../../node_modules/zod/v4/locales/hu.js
10064
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/hu.js
10134
10065
  var error17 = () => {
10135
10066
  const Sizable = {
10136
10067
  string: { unit: "karakter", verb: "legyen" },
@@ -10238,7 +10169,7 @@ function hu_default() {
10238
10169
  localeError: error17()
10239
10170
  };
10240
10171
  }
10241
- // ../../node_modules/zod/v4/locales/hy.js
10172
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/hy.js
10242
10173
  function getArmenianPlural(count, one, many) {
10243
10174
  return Math.abs(count) === 1 ? one : many;
10244
10175
  }
@@ -10385,7 +10316,7 @@ function hy_default() {
10385
10316
  localeError: error18()
10386
10317
  };
10387
10318
  }
10388
- // ../../node_modules/zod/v4/locales/id.js
10319
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/id.js
10389
10320
  var error19 = () => {
10390
10321
  const Sizable = {
10391
10322
  string: { unit: "karakter", verb: "memiliki" },
@@ -10491,7 +10422,7 @@ function id_default() {
10491
10422
  localeError: error19()
10492
10423
  };
10493
10424
  }
10494
- // ../../node_modules/zod/v4/locales/is.js
10425
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/is.js
10495
10426
  var error20 = () => {
10496
10427
  const Sizable = {
10497
10428
  string: { unit: "stafi", verb: "að hafa" },
@@ -10600,7 +10531,7 @@ function is_default() {
10600
10531
  localeError: error20()
10601
10532
  };
10602
10533
  }
10603
- // ../../node_modules/zod/v4/locales/it.js
10534
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/it.js
10604
10535
  var error21 = () => {
10605
10536
  const Sizable = {
10606
10537
  string: { unit: "caratteri", verb: "avere" },
@@ -10708,7 +10639,7 @@ function it_default() {
10708
10639
  localeError: error21()
10709
10640
  };
10710
10641
  }
10711
- // ../../node_modules/zod/v4/locales/ja.js
10642
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/ja.js
10712
10643
  var error22 = () => {
10713
10644
  const Sizable = {
10714
10645
  string: { unit: "文字", verb: "である" },
@@ -10815,7 +10746,7 @@ function ja_default() {
10815
10746
  localeError: error22()
10816
10747
  };
10817
10748
  }
10818
- // ../../node_modules/zod/v4/locales/ka.js
10749
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/ka.js
10819
10750
  var error23 = () => {
10820
10751
  const Sizable = {
10821
10752
  string: { unit: "სიმბოლო", verb: "უნდა შეიცავდეს" },
@@ -10927,7 +10858,7 @@ function ka_default() {
10927
10858
  localeError: error23()
10928
10859
  };
10929
10860
  }
10930
- // ../../node_modules/zod/v4/locales/km.js
10861
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/km.js
10931
10862
  var error24 = () => {
10932
10863
  const Sizable = {
10933
10864
  string: { unit: "តួអក្សរ", verb: "គួរមាន" },
@@ -11038,11 +10969,11 @@ function km_default() {
11038
10969
  };
11039
10970
  }
11040
10971
 
11041
- // ../../node_modules/zod/v4/locales/kh.js
10972
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/kh.js
11042
10973
  function kh_default() {
11043
10974
  return km_default();
11044
10975
  }
11045
- // ../../node_modules/zod/v4/locales/ko.js
10976
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/ko.js
11046
10977
  var error25 = () => {
11047
10978
  const Sizable = {
11048
10979
  string: { unit: "문자", verb: "to have" },
@@ -11153,7 +11084,7 @@ function ko_default() {
11153
11084
  localeError: error25()
11154
11085
  };
11155
11086
  }
11156
- // ../../node_modules/zod/v4/locales/lt.js
11087
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/lt.js
11157
11088
  var capitalizeFirstCharacter = (text) => {
11158
11089
  return text.charAt(0).toUpperCase() + text.slice(1);
11159
11090
  };
@@ -11356,7 +11287,7 @@ function lt_default() {
11356
11287
  localeError: error26()
11357
11288
  };
11358
11289
  }
11359
- // ../../node_modules/zod/v4/locales/mk.js
11290
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/mk.js
11360
11291
  var error27 = () => {
11361
11292
  const Sizable = {
11362
11293
  string: { unit: "знаци", verb: "да имаат" },
@@ -11465,7 +11396,7 @@ function mk_default() {
11465
11396
  localeError: error27()
11466
11397
  };
11467
11398
  }
11468
- // ../../node_modules/zod/v4/locales/ms.js
11399
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/ms.js
11469
11400
  var error28 = () => {
11470
11401
  const Sizable = {
11471
11402
  string: { unit: "aksara", verb: "mempunyai" },
@@ -11572,7 +11503,7 @@ function ms_default() {
11572
11503
  localeError: error28()
11573
11504
  };
11574
11505
  }
11575
- // ../../node_modules/zod/v4/locales/nl.js
11506
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/nl.js
11576
11507
  var error29 = () => {
11577
11508
  const Sizable = {
11578
11509
  string: { unit: "tekens", verb: "heeft" },
@@ -11682,7 +11613,7 @@ function nl_default() {
11682
11613
  localeError: error29()
11683
11614
  };
11684
11615
  }
11685
- // ../../node_modules/zod/v4/locales/no.js
11616
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/no.js
11686
11617
  var error30 = () => {
11687
11618
  const Sizable = {
11688
11619
  string: { unit: "tegn", verb: "å ha" },
@@ -11790,7 +11721,7 @@ function no_default() {
11790
11721
  localeError: error30()
11791
11722
  };
11792
11723
  }
11793
- // ../../node_modules/zod/v4/locales/ota.js
11724
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/ota.js
11794
11725
  var error31 = () => {
11795
11726
  const Sizable = {
11796
11727
  string: { unit: "harf", verb: "olmalıdır" },
@@ -11899,7 +11830,7 @@ function ota_default() {
11899
11830
  localeError: error31()
11900
11831
  };
11901
11832
  }
11902
- // ../../node_modules/zod/v4/locales/ps.js
11833
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/ps.js
11903
11834
  var error32 = () => {
11904
11835
  const Sizable = {
11905
11836
  string: { unit: "توکي", verb: "ولري" },
@@ -12013,7 +11944,7 @@ function ps_default() {
12013
11944
  localeError: error32()
12014
11945
  };
12015
11946
  }
12016
- // ../../node_modules/zod/v4/locales/pl.js
11947
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/pl.js
12017
11948
  var error33 = () => {
12018
11949
  const Sizable = {
12019
11950
  string: { unit: "znaków", verb: "mieć" },
@@ -12122,7 +12053,7 @@ function pl_default() {
12122
12053
  localeError: error33()
12123
12054
  };
12124
12055
  }
12125
- // ../../node_modules/zod/v4/locales/pt.js
12056
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/pt.js
12126
12057
  var error34 = () => {
12127
12058
  const Sizable = {
12128
12059
  string: { unit: "caracteres", verb: "ter" },
@@ -12230,7 +12161,7 @@ function pt_default() {
12230
12161
  localeError: error34()
12231
12162
  };
12232
12163
  }
12233
- // ../../node_modules/zod/v4/locales/ru.js
12164
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/ru.js
12234
12165
  function getRussianPlural(count, one, few, many) {
12235
12166
  const absCount = Math.abs(count);
12236
12167
  const lastDigit = absCount % 10;
@@ -12386,7 +12317,7 @@ function ru_default() {
12386
12317
  localeError: error35()
12387
12318
  };
12388
12319
  }
12389
- // ../../node_modules/zod/v4/locales/sl.js
12320
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/sl.js
12390
12321
  var error36 = () => {
12391
12322
  const Sizable = {
12392
12323
  string: { unit: "znakov", verb: "imeti" },
@@ -12495,7 +12426,7 @@ function sl_default() {
12495
12426
  localeError: error36()
12496
12427
  };
12497
12428
  }
12498
- // ../../node_modules/zod/v4/locales/sv.js
12429
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/sv.js
12499
12430
  var error37 = () => {
12500
12431
  const Sizable = {
12501
12432
  string: { unit: "tecken", verb: "att ha" },
@@ -12605,7 +12536,7 @@ function sv_default() {
12605
12536
  localeError: error37()
12606
12537
  };
12607
12538
  }
12608
- // ../../node_modules/zod/v4/locales/ta.js
12539
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/ta.js
12609
12540
  var error38 = () => {
12610
12541
  const Sizable = {
12611
12542
  string: { unit: "எழுத்துக்கள்", verb: "கொண்டிருக்க வேண்டும்" },
@@ -12715,7 +12646,7 @@ function ta_default() {
12715
12646
  localeError: error38()
12716
12647
  };
12717
12648
  }
12718
- // ../../node_modules/zod/v4/locales/th.js
12649
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/th.js
12719
12650
  var error39 = () => {
12720
12651
  const Sizable = {
12721
12652
  string: { unit: "ตัวอักษร", verb: "ควรมี" },
@@ -12825,7 +12756,7 @@ function th_default() {
12825
12756
  localeError: error39()
12826
12757
  };
12827
12758
  }
12828
- // ../../node_modules/zod/v4/locales/tr.js
12759
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/tr.js
12829
12760
  var error40 = () => {
12830
12761
  const Sizable = {
12831
12762
  string: { unit: "karakter", verb: "olmalı" },
@@ -12930,7 +12861,7 @@ function tr_default() {
12930
12861
  localeError: error40()
12931
12862
  };
12932
12863
  }
12933
- // ../../node_modules/zod/v4/locales/uk.js
12864
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/uk.js
12934
12865
  var error41 = () => {
12935
12866
  const Sizable = {
12936
12867
  string: { unit: "символів", verb: "матиме" },
@@ -13039,11 +12970,11 @@ function uk_default() {
13039
12970
  };
13040
12971
  }
13041
12972
 
13042
- // ../../node_modules/zod/v4/locales/ua.js
12973
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/ua.js
13043
12974
  function ua_default() {
13044
12975
  return uk_default();
13045
12976
  }
13046
- // ../../node_modules/zod/v4/locales/ur.js
12977
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/ur.js
13047
12978
  var error42 = () => {
13048
12979
  const Sizable = {
13049
12980
  string: { unit: "حروف", verb: "ہونا" },
@@ -13153,7 +13084,7 @@ function ur_default() {
13153
13084
  localeError: error42()
13154
13085
  };
13155
13086
  }
13156
- // ../../node_modules/zod/v4/locales/uz.js
13087
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/uz.js
13157
13088
  var error43 = () => {
13158
13089
  const Sizable = {
13159
13090
  string: { unit: "belgi", verb: "bo‘lishi kerak" },
@@ -13262,7 +13193,7 @@ function uz_default() {
13262
13193
  localeError: error43()
13263
13194
  };
13264
13195
  }
13265
- // ../../node_modules/zod/v4/locales/vi.js
13196
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/vi.js
13266
13197
  var error44 = () => {
13267
13198
  const Sizable = {
13268
13199
  string: { unit: "ký tự", verb: "có" },
@@ -13370,7 +13301,7 @@ function vi_default() {
13370
13301
  localeError: error44()
13371
13302
  };
13372
13303
  }
13373
- // ../../node_modules/zod/v4/locales/zh-CN.js
13304
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/zh-CN.js
13374
13305
  var error45 = () => {
13375
13306
  const Sizable = {
13376
13307
  string: { unit: "字符", verb: "包含" },
@@ -13479,7 +13410,7 @@ function zh_CN_default() {
13479
13410
  localeError: error45()
13480
13411
  };
13481
13412
  }
13482
- // ../../node_modules/zod/v4/locales/zh-TW.js
13413
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/zh-TW.js
13483
13414
  var error46 = () => {
13484
13415
  const Sizable = {
13485
13416
  string: { unit: "字元", verb: "擁有" },
@@ -13586,7 +13517,7 @@ function zh_TW_default() {
13586
13517
  localeError: error46()
13587
13518
  };
13588
13519
  }
13589
- // ../../node_modules/zod/v4/locales/yo.js
13520
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/locales/yo.js
13590
13521
  var error47 = () => {
13591
13522
  const Sizable = {
13592
13523
  string: { unit: "àmi", verb: "ní" },
@@ -13693,7 +13624,7 @@ function yo_default() {
13693
13624
  localeError: error47()
13694
13625
  };
13695
13626
  }
13696
- // ../../node_modules/zod/v4/core/registries.js
13627
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/registries.js
13697
13628
  var _a;
13698
13629
  var $output = Symbol("ZodOutput");
13699
13630
  var $input = Symbol("ZodInput");
@@ -13743,7 +13674,7 @@ function registry() {
13743
13674
  }
13744
13675
  (_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
13745
13676
  var globalRegistry = globalThis.__zod_globalRegistry;
13746
- // ../../node_modules/zod/v4/core/api.js
13677
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/api.js
13747
13678
  function _string(Class2, params) {
13748
13679
  return new Class2({
13749
13680
  type: "string",
@@ -14663,7 +14594,7 @@ function _stringFormat(Class2, format, fnOrRegex, _params = {}) {
14663
14594
  const inst = new Class2(def);
14664
14595
  return inst;
14665
14596
  }
14666
- // ../../node_modules/zod/v4/core/to-json-schema.js
14597
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/to-json-schema.js
14667
14598
  function initializeContext(params) {
14668
14599
  let target = params?.target ?? "draft-2020-12";
14669
14600
  if (target === "draft-4")
@@ -15008,7 +14939,7 @@ var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) =
15008
14939
  extractDefs(ctx, schema);
15009
14940
  return finalize(ctx, schema);
15010
14941
  };
15011
- // ../../node_modules/zod/v4/core/json-schema-processors.js
14942
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/json-schema-processors.js
15012
14943
  var formatMap = {
15013
14944
  guid: "uuid",
15014
14945
  url: "uri",
@@ -15553,7 +15484,7 @@ function toJSONSchema(input, params) {
15553
15484
  extractDefs(ctx, input);
15554
15485
  return finalize(ctx, input);
15555
15486
  }
15556
- // ../../node_modules/zod/v4/core/json-schema-generator.js
15487
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/json-schema-generator.js
15557
15488
  class JSONSchemaGenerator {
15558
15489
  get metadataRegistry() {
15559
15490
  return this.ctx.metadataRegistry;
@@ -15612,9 +15543,9 @@ class JSONSchemaGenerator {
15612
15543
  return plainResult;
15613
15544
  }
15614
15545
  }
15615
- // ../../node_modules/zod/v4/core/json-schema.js
15546
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/json-schema.js
15616
15547
  var exports_json_schema = {};
15617
- // ../../node_modules/zod/v4/classic/schemas.js
15548
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/classic/schemas.js
15618
15549
  var exports_schemas2 = {};
15619
15550
  __export(exports_schemas2, {
15620
15551
  xor: () => xor,
@@ -15783,7 +15714,7 @@ __export(exports_schemas2, {
15783
15714
  ZodAny: () => ZodAny
15784
15715
  });
15785
15716
 
15786
- // ../../node_modules/zod/v4/classic/checks.js
15717
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/classic/checks.js
15787
15718
  var exports_checks2 = {};
15788
15719
  __export(exports_checks2, {
15789
15720
  uppercase: () => _uppercase,
@@ -15817,7 +15748,7 @@ __export(exports_checks2, {
15817
15748
  endsWith: () => _endsWith
15818
15749
  });
15819
15750
 
15820
- // ../../node_modules/zod/v4/classic/iso.js
15751
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/classic/iso.js
15821
15752
  var exports_iso = {};
15822
15753
  __export(exports_iso, {
15823
15754
  time: () => time2,
@@ -15858,7 +15789,7 @@ function duration2(params) {
15858
15789
  return _isoDuration(ZodISODuration, params);
15859
15790
  }
15860
15791
 
15861
- // ../../node_modules/zod/v4/classic/errors.js
15792
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/classic/errors.js
15862
15793
  var initializer2 = (inst, issues) => {
15863
15794
  $ZodError.init(inst, issues);
15864
15795
  inst.name = "ZodError";
@@ -15893,7 +15824,7 @@ var ZodRealError = $constructor("ZodError", initializer2, {
15893
15824
  Parent: Error
15894
15825
  });
15895
15826
 
15896
- // ../../node_modules/zod/v4/classic/parse.js
15827
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/classic/parse.js
15897
15828
  var parse3 = /* @__PURE__ */ _parse(ZodRealError);
15898
15829
  var parseAsync2 = /* @__PURE__ */ _parseAsync(ZodRealError);
15899
15830
  var safeParse2 = /* @__PURE__ */ _safeParse(ZodRealError);
@@ -15907,7 +15838,7 @@ var safeDecode2 = /* @__PURE__ */ _safeDecode(ZodRealError);
15907
15838
  var safeEncodeAsync2 = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
15908
15839
  var safeDecodeAsync2 = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
15909
15840
 
15910
- // ../../node_modules/zod/v4/classic/schemas.js
15841
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/classic/schemas.js
15911
15842
  var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
15912
15843
  $ZodType.init(inst, def);
15913
15844
  Object.assign(inst["~standard"], {
@@ -16983,7 +16914,7 @@ function json(params) {
16983
16914
  function preprocess(fn, schema) {
16984
16915
  return pipe(transform(fn), schema);
16985
16916
  }
16986
- // ../../node_modules/zod/v4/classic/compat.js
16917
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/classic/compat.js
16987
16918
  var ZodIssueCode = {
16988
16919
  invalid_type: "invalid_type",
16989
16920
  too_big: "too_big",
@@ -17007,7 +16938,7 @@ function getErrorMap() {
17007
16938
  }
17008
16939
  var ZodFirstPartyTypeKind;
17009
16940
  (function(ZodFirstPartyTypeKind2) {})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
17010
- // ../../node_modules/zod/v4/classic/from-json-schema.js
16941
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/classic/from-json-schema.js
17011
16942
  var z = {
17012
16943
  ...exports_schemas2,
17013
16944
  ...exports_checks2,
@@ -17468,7 +17399,7 @@ function fromJSONSchema(schema, params) {
17468
17399
  };
17469
17400
  return convertSchema(schema, ctx);
17470
17401
  }
17471
- // ../../node_modules/zod/v4/classic/coerce.js
17402
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/classic/coerce.js
17472
17403
  var exports_coerce = {};
17473
17404
  __export(exports_coerce, {
17474
17405
  string: () => string3,
@@ -17493,9 +17424,9 @@ function date4(params) {
17493
17424
  return _coercedDate(ZodDate, params);
17494
17425
  }
17495
17426
 
17496
- // ../../node_modules/zod/v4/classic/external.js
17427
+ // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/classic/external.js
17497
17428
  config(en_default());
17498
- // ../../node_modules/kleur/colors.mjs
17429
+ // ../../node_modules/.bun/kleur@4.1.5/node_modules/kleur/colors.mjs
17499
17430
  var FORCE_COLOR;
17500
17431
  var NODE_DISABLE_COLORS;
17501
17432
  var NO_COLOR;
@@ -17677,239 +17608,445 @@ ${stderr.join("").trim()}`));
17677
17608
  });
17678
17609
 
17679
17610
  // src/commands/create.ts
17680
- import { readFile, writeFile } from "node:fs/promises";
17611
+ import { readFile as readFile2, writeFile as writeFile2 } from "node:fs/promises";
17681
17612
  import { join as join2, resolve as resolve2 } from "node:path";
17682
17613
 
17683
- // ../../node_modules/@clack/core/dist/index.mjs
17684
- var import_picocolors = __toESM(require_picocolors(), 1);
17685
- import { stdout as R, stdin as q } from "node:process";
17686
- var import_sisteransi = __toESM(require_src(), 1);
17687
- import ot from "node:readline";
17688
- function B(t, e, s) {
17689
- if (!s.some((u) => !u.disabled))
17690
- return t;
17691
- const i = t + e, r = Math.max(s.length - 1, 0), n = i < 0 ? r : i > r ? 0 : i;
17692
- return s[n].disabled ? B(n, e < 0 ? -1 : 1, s) : n;
17693
- }
17694
- var at = (t) => t === 161 || t === 164 || t === 167 || t === 168 || t === 170 || t === 173 || t === 174 || t >= 176 && t <= 180 || t >= 182 && t <= 186 || t >= 188 && t <= 191 || t === 198 || t === 208 || t === 215 || t === 216 || t >= 222 && t <= 225 || t === 230 || t >= 232 && t <= 234 || t === 236 || t === 237 || t === 240 || t === 242 || t === 243 || t >= 247 && t <= 250 || t === 252 || t === 254 || t === 257 || t === 273 || t === 275 || t === 283 || t === 294 || t === 295 || t === 299 || t >= 305 && t <= 307 || t === 312 || t >= 319 && t <= 322 || t === 324 || t >= 328 && t <= 331 || t === 333 || t === 338 || t === 339 || t === 358 || t === 359 || t === 363 || t === 462 || t === 464 || t === 466 || t === 468 || t === 470 || t === 472 || t === 474 || t === 476 || t === 593 || t === 609 || t === 708 || t === 711 || t >= 713 && t <= 715 || t === 717 || t === 720 || t >= 728 && t <= 731 || t === 733 || t === 735 || t >= 768 && t <= 879 || t >= 913 && t <= 929 || t >= 931 && t <= 937 || t >= 945 && t <= 961 || t >= 963 && t <= 969 || t === 1025 || t >= 1040 && t <= 1103 || t === 1105 || t === 8208 || t >= 8211 && t <= 8214 || t === 8216 || t === 8217 || t === 8220 || t === 8221 || t >= 8224 && t <= 8226 || t >= 8228 && t <= 8231 || t === 8240 || t === 8242 || t === 8243 || t === 8245 || t === 8251 || t === 8254 || t === 8308 || t === 8319 || t >= 8321 && t <= 8324 || t === 8364 || t === 8451 || t === 8453 || t === 8457 || t === 8467 || t === 8470 || t === 8481 || t === 8482 || t === 8486 || t === 8491 || t === 8531 || t === 8532 || t >= 8539 && t <= 8542 || t >= 8544 && t <= 8555 || t >= 8560 && t <= 8569 || t === 8585 || t >= 8592 && t <= 8601 || t === 8632 || t === 8633 || t === 8658 || t === 8660 || t === 8679 || t === 8704 || t === 8706 || t === 8707 || t === 8711 || t === 8712 || t === 8715 || t === 8719 || t === 8721 || t === 8725 || t === 8730 || t >= 8733 && t <= 8736 || t === 8739 || t === 8741 || t >= 8743 && t <= 8748 || t === 8750 || t >= 8756 && t <= 8759 || t === 8764 || t === 8765 || t === 8776 || t === 8780 || t === 8786 || t === 8800 || t === 8801 || t >= 8804 && t <= 8807 || t === 8810 || t === 8811 || t === 8814 || t === 8815 || t === 8834 || t === 8835 || t === 8838 || t === 8839 || t === 8853 || t === 8857 || t === 8869 || t === 8895 || t === 8978 || t >= 9312 && t <= 9449 || t >= 9451 && t <= 9547 || t >= 9552 && t <= 9587 || t >= 9600 && t <= 9615 || t >= 9618 && t <= 9621 || t === 9632 || t === 9633 || t >= 9635 && t <= 9641 || t === 9650 || t === 9651 || t === 9654 || t === 9655 || t === 9660 || t === 9661 || t === 9664 || t === 9665 || t >= 9670 && t <= 9672 || t === 9675 || t >= 9678 && t <= 9681 || t >= 9698 && t <= 9701 || t === 9711 || t === 9733 || t === 9734 || t === 9737 || t === 9742 || t === 9743 || t === 9756 || t === 9758 || t === 9792 || t === 9794 || t === 9824 || t === 9825 || t >= 9827 && t <= 9829 || t >= 9831 && t <= 9834 || t === 9836 || t === 9837 || t === 9839 || t === 9886 || t === 9887 || t === 9919 || t >= 9926 && t <= 9933 || t >= 9935 && t <= 9939 || t >= 9941 && t <= 9953 || t === 9955 || t === 9960 || t === 9961 || t >= 9963 && t <= 9969 || t === 9972 || t >= 9974 && t <= 9977 || t === 9979 || t === 9980 || t === 9982 || t === 9983 || t === 10045 || t >= 10102 && t <= 10111 || t >= 11094 && t <= 11097 || t >= 12872 && t <= 12879 || t >= 57344 && t <= 63743 || t >= 65024 && t <= 65039 || t === 65533 || t >= 127232 && t <= 127242 || t >= 127248 && t <= 127277 || t >= 127280 && t <= 127337 || t >= 127344 && t <= 127373 || t === 127375 || t === 127376 || t >= 127387 && t <= 127404 || t >= 917760 && t <= 917999 || t >= 983040 && t <= 1048573 || t >= 1048576 && t <= 1114109;
17695
- var lt = (t) => t === 12288 || t >= 65281 && t <= 65376 || t >= 65504 && t <= 65510;
17696
- var ht = (t) => t >= 4352 && t <= 4447 || t === 8986 || t === 8987 || t === 9001 || t === 9002 || t >= 9193 && t <= 9196 || t === 9200 || t === 9203 || t === 9725 || t === 9726 || t === 9748 || t === 9749 || t >= 9800 && t <= 9811 || t === 9855 || t === 9875 || t === 9889 || t === 9898 || t === 9899 || t === 9917 || t === 9918 || t === 9924 || t === 9925 || t === 9934 || t === 9940 || t === 9962 || t === 9970 || t === 9971 || t === 9973 || t === 9978 || t === 9981 || t === 9989 || t === 9994 || t === 9995 || t === 10024 || t === 10060 || t === 10062 || t >= 10067 && t <= 10069 || t === 10071 || t >= 10133 && t <= 10135 || t === 10160 || t === 10175 || t === 11035 || t === 11036 || t === 11088 || t === 11093 || t >= 11904 && t <= 11929 || t >= 11931 && t <= 12019 || t >= 12032 && t <= 12245 || t >= 12272 && t <= 12287 || t >= 12289 && t <= 12350 || t >= 12353 && t <= 12438 || t >= 12441 && t <= 12543 || t >= 12549 && t <= 12591 || t >= 12593 && t <= 12686 || t >= 12688 && t <= 12771 || t >= 12783 && t <= 12830 || t >= 12832 && t <= 12871 || t >= 12880 && t <= 19903 || t >= 19968 && t <= 42124 || t >= 42128 && t <= 42182 || t >= 43360 && t <= 43388 || t >= 44032 && t <= 55203 || t >= 63744 && t <= 64255 || t >= 65040 && t <= 65049 || t >= 65072 && t <= 65106 || t >= 65108 && t <= 65126 || t >= 65128 && t <= 65131 || t >= 94176 && t <= 94180 || t === 94192 || t === 94193 || t >= 94208 && t <= 100343 || t >= 100352 && t <= 101589 || t >= 101632 && t <= 101640 || t >= 110576 && t <= 110579 || t >= 110581 && t <= 110587 || t === 110589 || t === 110590 || t >= 110592 && t <= 110882 || t === 110898 || t >= 110928 && t <= 110930 || t === 110933 || t >= 110948 && t <= 110951 || t >= 110960 && t <= 111355 || t === 126980 || t === 127183 || t === 127374 || t >= 127377 && t <= 127386 || t >= 127488 && t <= 127490 || t >= 127504 && t <= 127547 || t >= 127552 && t <= 127560 || t === 127568 || t === 127569 || t >= 127584 && t <= 127589 || t >= 127744 && t <= 127776 || t >= 127789 && t <= 127797 || t >= 127799 && t <= 127868 || t >= 127870 && t <= 127891 || t >= 127904 && t <= 127946 || t >= 127951 && t <= 127955 || t >= 127968 && t <= 127984 || t === 127988 || t >= 127992 && t <= 128062 || t === 128064 || t >= 128066 && t <= 128252 || t >= 128255 && t <= 128317 || t >= 128331 && t <= 128334 || t >= 128336 && t <= 128359 || t === 128378 || t === 128405 || t === 128406 || t === 128420 || t >= 128507 && t <= 128591 || t >= 128640 && t <= 128709 || t === 128716 || t >= 128720 && t <= 128722 || t >= 128725 && t <= 128727 || t >= 128732 && t <= 128735 || t === 128747 || t === 128748 || t >= 128756 && t <= 128764 || t >= 128992 && t <= 129003 || t === 129008 || t >= 129292 && t <= 129338 || t >= 129340 && t <= 129349 || t >= 129351 && t <= 129535 || t >= 129648 && t <= 129660 || t >= 129664 && t <= 129672 || t >= 129680 && t <= 129725 || t >= 129727 && t <= 129733 || t >= 129742 && t <= 129755 || t >= 129760 && t <= 129768 || t >= 129776 && t <= 129784 || t >= 131072 && t <= 196605 || t >= 196608 && t <= 262141;
17697
- var O = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;
17698
- var y = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
17699
- var L = /\t{1,1000}/y;
17700
- var P = /[\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;
17701
- var M = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
17702
- var ct = /\p{M}+/gu;
17703
- var ft = { limit: 1 / 0, ellipsis: "" };
17704
- var X = (t, e = {}, s = {}) => {
17705
- const i = e.limit ?? 1 / 0, r = e.ellipsis ?? "", n = e?.ellipsisWidth ?? (r ? X(r, ft, s).width : 0), u = s.ansiWidth ?? 0, a = s.controlWidth ?? 0, l = s.tabWidth ?? 8, E = s.ambiguousWidth ?? 1, g = s.emojiWidth ?? 2, m = s.fullWidthWidth ?? 2, A = s.regularWidth ?? 1, V = s.wideWidth ?? 2;
17706
- let h = 0, o = 0, p = t.length, v = 0, F = false, d = p, b = Math.max(0, i - n), C = 0, w = 0, c = 0, f = 0;
17707
- t:
17708
- for (;; ) {
17709
- if (w > C || o >= p && o > h) {
17710
- const ut = t.slice(C, w) || t.slice(h, o);
17711
- v = 0;
17712
- for (const Y of ut.replaceAll(ct, "")) {
17713
- const $2 = Y.codePointAt(0) || 0;
17714
- if (lt($2) ? f = m : ht($2) ? f = V : E !== A && at($2) ? f = E : f = A, c + f > b && (d = Math.min(d, Math.max(C, h) + v)), c + f > i) {
17715
- F = true;
17716
- break t;
17614
+ // ../../node_modules/.bun/@clack+core@1.2.0/node_modules/@clack/core/dist/index.mjs
17615
+ import { styleText as y } from "node:util";
17616
+ import { stdout as S, stdin as $2 } from "node:process";
17617
+ import P from "node:readline";
17618
+
17619
+ // ../../node_modules/.bun/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/utils.js
17620
+ var isAmbiguous = (x) => {
17621
+ 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;
17622
+ };
17623
+ var isFullWidth = (x) => {
17624
+ return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
17625
+ };
17626
+ var isWide = (x) => {
17627
+ 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;
17628
+ };
17629
+
17630
+ // ../../node_modules/.bun/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/index.js
17631
+ var ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;
17632
+ var CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
17633
+ var TAB_RE = /\t{1,1000}/y;
17634
+ var EMOJI_RE = /[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu;
17635
+ var LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
17636
+ var MODIFIER_RE = /\p{M}+/gu;
17637
+ var NO_TRUNCATION = { limit: Infinity, ellipsis: "" };
17638
+ var getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {}) => {
17639
+ const LIMIT = truncationOptions.limit ?? Infinity;
17640
+ const ELLIPSIS = truncationOptions.ellipsis ?? "";
17641
+ const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);
17642
+ const ANSI_WIDTH = widthOptions.ansiWidth ?? 0;
17643
+ const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
17644
+ const TAB_WIDTH = widthOptions.tabWidth ?? 8;
17645
+ const AMBIGUOUS_WIDTH = widthOptions.ambiguousWidth ?? 1;
17646
+ const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
17647
+ const FULL_WIDTH_WIDTH = widthOptions.fullWidthWidth ?? 2;
17648
+ const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
17649
+ const WIDE_WIDTH = widthOptions.wideWidth ?? 2;
17650
+ let indexPrev = 0;
17651
+ let index = 0;
17652
+ let length = input.length;
17653
+ let lengthExtra = 0;
17654
+ let truncationEnabled = false;
17655
+ let truncationIndex = length;
17656
+ let truncationLimit = Math.max(0, LIMIT - ELLIPSIS_WIDTH);
17657
+ let unmatchedStart = 0;
17658
+ let unmatchedEnd = 0;
17659
+ let width = 0;
17660
+ let widthExtra = 0;
17661
+ outer:
17662
+ while (true) {
17663
+ if (unmatchedEnd > unmatchedStart || index >= length && index > indexPrev) {
17664
+ const unmatched = input.slice(unmatchedStart, unmatchedEnd) || input.slice(indexPrev, index);
17665
+ lengthExtra = 0;
17666
+ for (const char of unmatched.replaceAll(MODIFIER_RE, "")) {
17667
+ const codePoint = char.codePointAt(0) || 0;
17668
+ if (isFullWidth(codePoint)) {
17669
+ widthExtra = FULL_WIDTH_WIDTH;
17670
+ } else if (isWide(codePoint)) {
17671
+ widthExtra = WIDE_WIDTH;
17672
+ } else if (AMBIGUOUS_WIDTH !== REGULAR_WIDTH && isAmbiguous(codePoint)) {
17673
+ widthExtra = AMBIGUOUS_WIDTH;
17674
+ } else {
17675
+ widthExtra = REGULAR_WIDTH;
17676
+ }
17677
+ if (width + widthExtra > truncationLimit) {
17678
+ truncationIndex = Math.min(truncationIndex, Math.max(unmatchedStart, indexPrev) + lengthExtra);
17717
17679
  }
17718
- v += Y.length, c += f;
17680
+ if (width + widthExtra > LIMIT) {
17681
+ truncationEnabled = true;
17682
+ break outer;
17683
+ }
17684
+ lengthExtra += char.length;
17685
+ width += widthExtra;
17719
17686
  }
17720
- C = w = 0;
17687
+ unmatchedStart = unmatchedEnd = 0;
17721
17688
  }
17722
- if (o >= p)
17689
+ if (index >= length)
17723
17690
  break;
17724
- if (M.lastIndex = o, M.test(t)) {
17725
- if (v = M.lastIndex - o, f = v * A, c + f > b && (d = Math.min(d, o + Math.floor((b - c) / A))), c + f > i) {
17726
- F = true;
17691
+ LATIN_RE.lastIndex = index;
17692
+ if (LATIN_RE.test(input)) {
17693
+ lengthExtra = LATIN_RE.lastIndex - index;
17694
+ widthExtra = lengthExtra * REGULAR_WIDTH;
17695
+ if (width + widthExtra > truncationLimit) {
17696
+ truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / REGULAR_WIDTH));
17697
+ }
17698
+ if (width + widthExtra > LIMIT) {
17699
+ truncationEnabled = true;
17727
17700
  break;
17728
17701
  }
17729
- c += f, C = h, w = o, o = h = M.lastIndex;
17702
+ width += widthExtra;
17703
+ unmatchedStart = indexPrev;
17704
+ unmatchedEnd = index;
17705
+ index = indexPrev = LATIN_RE.lastIndex;
17730
17706
  continue;
17731
17707
  }
17732
- if (O.lastIndex = o, O.test(t)) {
17733
- if (c + u > b && (d = Math.min(d, o)), c + u > i) {
17734
- F = true;
17708
+ ANSI_RE.lastIndex = index;
17709
+ if (ANSI_RE.test(input)) {
17710
+ if (width + ANSI_WIDTH > truncationLimit) {
17711
+ truncationIndex = Math.min(truncationIndex, index);
17712
+ }
17713
+ if (width + ANSI_WIDTH > LIMIT) {
17714
+ truncationEnabled = true;
17735
17715
  break;
17736
17716
  }
17737
- c += u, C = h, w = o, o = h = O.lastIndex;
17717
+ width += ANSI_WIDTH;
17718
+ unmatchedStart = indexPrev;
17719
+ unmatchedEnd = index;
17720
+ index = indexPrev = ANSI_RE.lastIndex;
17738
17721
  continue;
17739
17722
  }
17740
- if (y.lastIndex = o, y.test(t)) {
17741
- if (v = y.lastIndex - o, f = v * a, c + f > b && (d = Math.min(d, o + Math.floor((b - c) / a))), c + f > i) {
17742
- F = true;
17723
+ CONTROL_RE.lastIndex = index;
17724
+ if (CONTROL_RE.test(input)) {
17725
+ lengthExtra = CONTROL_RE.lastIndex - index;
17726
+ widthExtra = lengthExtra * CONTROL_WIDTH;
17727
+ if (width + widthExtra > truncationLimit) {
17728
+ truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / CONTROL_WIDTH));
17729
+ }
17730
+ if (width + widthExtra > LIMIT) {
17731
+ truncationEnabled = true;
17743
17732
  break;
17744
17733
  }
17745
- c += f, C = h, w = o, o = h = y.lastIndex;
17734
+ width += widthExtra;
17735
+ unmatchedStart = indexPrev;
17736
+ unmatchedEnd = index;
17737
+ index = indexPrev = CONTROL_RE.lastIndex;
17746
17738
  continue;
17747
17739
  }
17748
- if (L.lastIndex = o, L.test(t)) {
17749
- if (v = L.lastIndex - o, f = v * l, c + f > b && (d = Math.min(d, o + Math.floor((b - c) / l))), c + f > i) {
17750
- F = true;
17740
+ TAB_RE.lastIndex = index;
17741
+ if (TAB_RE.test(input)) {
17742
+ lengthExtra = TAB_RE.lastIndex - index;
17743
+ widthExtra = lengthExtra * TAB_WIDTH;
17744
+ if (width + widthExtra > truncationLimit) {
17745
+ truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / TAB_WIDTH));
17746
+ }
17747
+ if (width + widthExtra > LIMIT) {
17748
+ truncationEnabled = true;
17751
17749
  break;
17752
17750
  }
17753
- c += f, C = h, w = o, o = h = L.lastIndex;
17751
+ width += widthExtra;
17752
+ unmatchedStart = indexPrev;
17753
+ unmatchedEnd = index;
17754
+ index = indexPrev = TAB_RE.lastIndex;
17754
17755
  continue;
17755
17756
  }
17756
- if (P.lastIndex = o, P.test(t)) {
17757
- if (c + g > b && (d = Math.min(d, o)), c + g > i) {
17758
- F = true;
17757
+ EMOJI_RE.lastIndex = index;
17758
+ if (EMOJI_RE.test(input)) {
17759
+ if (width + EMOJI_WIDTH > truncationLimit) {
17760
+ truncationIndex = Math.min(truncationIndex, index);
17761
+ }
17762
+ if (width + EMOJI_WIDTH > LIMIT) {
17763
+ truncationEnabled = true;
17759
17764
  break;
17760
17765
  }
17761
- c += g, C = h, w = o, o = h = P.lastIndex;
17766
+ width += EMOJI_WIDTH;
17767
+ unmatchedStart = indexPrev;
17768
+ unmatchedEnd = index;
17769
+ index = indexPrev = EMOJI_RE.lastIndex;
17762
17770
  continue;
17763
17771
  }
17764
- o += 1;
17772
+ index += 1;
17765
17773
  }
17766
- return { width: F ? b : c, index: F ? d : p, truncated: F, ellipsed: F && i >= n };
17774
+ return {
17775
+ width: truncationEnabled ? truncationLimit : width,
17776
+ index: truncationEnabled ? truncationIndex : length,
17777
+ truncated: truncationEnabled,
17778
+ ellipsed: truncationEnabled && LIMIT >= ELLIPSIS_WIDTH
17779
+ };
17780
+ };
17781
+ var dist_default = getStringTruncatedWidth;
17782
+
17783
+ // ../../node_modules/.bun/fast-string-width@1.1.0/node_modules/fast-string-width/dist/index.js
17784
+ var NO_TRUNCATION2 = {
17785
+ limit: Infinity,
17786
+ ellipsis: "",
17787
+ ellipsisWidth: 0
17767
17788
  };
17768
- var pt = { limit: 1 / 0, ellipsis: "", ellipsisWidth: 0 };
17769
- var S = (t, e = {}) => X(t, pt, e).width;
17770
- var W = "\x1B";
17771
- var Z = "›";
17772
- var Ft = 39;
17773
- var j = "\x07";
17774
- var Q = "[";
17775
- var dt = "]";
17776
- var tt = "m";
17777
- var U = `${dt}8;;`;
17778
- var et = new RegExp(`(?:\\${Q}(?<code>\\d+)m|\\${U}(?<uri>.*)${j})`, "y");
17779
- var mt = (t) => {
17780
- if (t >= 30 && t <= 37 || t >= 90 && t <= 97)
17789
+ var fastStringWidth = (input, options = {}) => {
17790
+ return dist_default(input, NO_TRUNCATION2, options).width;
17791
+ };
17792
+ var dist_default2 = fastStringWidth;
17793
+
17794
+ // ../../node_modules/.bun/fast-wrap-ansi@0.1.6/node_modules/fast-wrap-ansi/lib/main.js
17795
+ var ESC = "\x1B";
17796
+ var CSI = "›";
17797
+ var END_CODE = 39;
17798
+ var ANSI_ESCAPE_BELL = "\x07";
17799
+ var ANSI_CSI = "[";
17800
+ var ANSI_OSC = "]";
17801
+ var ANSI_SGR_TERMINATOR = "m";
17802
+ var ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
17803
+ var GROUP_REGEX = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`, "y");
17804
+ var getClosingCode = (openingCode) => {
17805
+ if (openingCode >= 30 && openingCode <= 37)
17781
17806
  return 39;
17782
- if (t >= 40 && t <= 47 || t >= 100 && t <= 107)
17807
+ if (openingCode >= 90 && openingCode <= 97)
17808
+ return 39;
17809
+ if (openingCode >= 40 && openingCode <= 47)
17810
+ return 49;
17811
+ if (openingCode >= 100 && openingCode <= 107)
17783
17812
  return 49;
17784
- if (t === 1 || t === 2)
17813
+ if (openingCode === 1 || openingCode === 2)
17785
17814
  return 22;
17786
- if (t === 3)
17815
+ if (openingCode === 3)
17787
17816
  return 23;
17788
- if (t === 4)
17817
+ if (openingCode === 4)
17789
17818
  return 24;
17790
- if (t === 7)
17819
+ if (openingCode === 7)
17791
17820
  return 27;
17792
- if (t === 8)
17821
+ if (openingCode === 8)
17793
17822
  return 28;
17794
- if (t === 9)
17823
+ if (openingCode === 9)
17795
17824
  return 29;
17796
- if (t === 0)
17825
+ if (openingCode === 0)
17797
17826
  return 0;
17827
+ return;
17798
17828
  };
17799
- var st = (t) => `${W}${Q}${t}${tt}`;
17800
- var it = (t) => `${W}${U}${t}${j}`;
17801
- var gt = (t) => t.map((e) => S(e));
17802
- var G = (t, e, s) => {
17803
- const i = e[Symbol.iterator]();
17804
- let r = false, n = false, u = t.at(-1), a = u === undefined ? 0 : S(u), l = i.next(), E = i.next(), g = 0;
17805
- for (;!l.done; ) {
17806
- const m = l.value, A = S(m);
17807
- a + A <= s ? t[t.length - 1] += m : (t.push(m), a = 0), (m === W || m === Z) && (r = true, n = e.startsWith(U, g + 1)), r ? n ? m === j && (r = false, n = false) : m === tt && (r = false) : (a += A, a === s && !E.done && (t.push(""), a = 0)), l = E, E = i.next(), g += m.length;
17808
- }
17809
- u = t.at(-1), !a && u !== undefined && u.length > 0 && t.length > 1 && (t[t.length - 2] += t.pop());
17829
+ var wrapAnsiCode = (code) => `${ESC}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
17830
+ var wrapAnsiHyperlink = (url2) => `${ESC}${ANSI_ESCAPE_LINK}${url2}${ANSI_ESCAPE_BELL}`;
17831
+ var wrapWord = (rows, word, columns) => {
17832
+ const characters = word[Symbol.iterator]();
17833
+ let isInsideEscape = false;
17834
+ let isInsideLinkEscape = false;
17835
+ let lastRow = rows.at(-1);
17836
+ let visible = lastRow === undefined ? 0 : dist_default2(lastRow);
17837
+ let currentCharacter = characters.next();
17838
+ let nextCharacter = characters.next();
17839
+ let rawCharacterIndex = 0;
17840
+ while (!currentCharacter.done) {
17841
+ const character = currentCharacter.value;
17842
+ const characterLength = dist_default2(character);
17843
+ if (visible + characterLength <= columns) {
17844
+ rows[rows.length - 1] += character;
17845
+ } else {
17846
+ rows.push(character);
17847
+ visible = 0;
17848
+ }
17849
+ if (character === ESC || character === CSI) {
17850
+ isInsideEscape = true;
17851
+ isInsideLinkEscape = word.startsWith(ANSI_ESCAPE_LINK, rawCharacterIndex + 1);
17852
+ }
17853
+ if (isInsideEscape) {
17854
+ if (isInsideLinkEscape) {
17855
+ if (character === ANSI_ESCAPE_BELL) {
17856
+ isInsideEscape = false;
17857
+ isInsideLinkEscape = false;
17858
+ }
17859
+ } else if (character === ANSI_SGR_TERMINATOR) {
17860
+ isInsideEscape = false;
17861
+ }
17862
+ } else {
17863
+ visible += characterLength;
17864
+ if (visible === columns && !nextCharacter.done) {
17865
+ rows.push("");
17866
+ visible = 0;
17867
+ }
17868
+ }
17869
+ currentCharacter = nextCharacter;
17870
+ nextCharacter = characters.next();
17871
+ rawCharacterIndex += character.length;
17872
+ }
17873
+ lastRow = rows.at(-1);
17874
+ if (!visible && lastRow !== undefined && lastRow.length && rows.length > 1) {
17875
+ rows[rows.length - 2] += rows.pop();
17876
+ }
17810
17877
  };
17811
- var vt = (t) => {
17812
- const e = t.split(" ");
17813
- let s = e.length;
17814
- for (;s > 0 && !(S(e[s - 1]) > 0); )
17815
- s--;
17816
- return s === e.length ? t : e.slice(0, s).join(" ") + e.slice(s).join("");
17878
+ var stringVisibleTrimSpacesRight = (string4) => {
17879
+ const words = string4.split(" ");
17880
+ let last = words.length;
17881
+ while (last) {
17882
+ if (dist_default2(words[last - 1])) {
17883
+ break;
17884
+ }
17885
+ last--;
17886
+ }
17887
+ if (last === words.length) {
17888
+ return string4;
17889
+ }
17890
+ return words.slice(0, last).join(" ") + words.slice(last).join("");
17817
17891
  };
17818
- var Et = (t, e, s = {}) => {
17819
- if (s.trim !== false && t.trim() === "")
17892
+ var exec = (string4, columns, options = {}) => {
17893
+ if (options.trim !== false && string4.trim() === "") {
17820
17894
  return "";
17821
- let i = "", r, n;
17822
- const u = t.split(" "), a = gt(u);
17823
- let l = [""];
17824
- for (const [h, o] of u.entries()) {
17825
- s.trim !== false && (l[l.length - 1] = (l.at(-1) ?? "").trimStart());
17826
- let p = S(l.at(-1) ?? "");
17827
- if (h !== 0 && (p >= e && (s.wordWrap === false || s.trim === false) && (l.push(""), p = 0), (p > 0 || s.trim === false) && (l[l.length - 1] += " ", p++)), s.hard && a[h] > e) {
17828
- const v = e - p, F = 1 + Math.floor((a[h] - v - 1) / e);
17829
- Math.floor((a[h] - 1) / e) < F && l.push(""), G(l, o, e);
17895
+ }
17896
+ let returnValue = "";
17897
+ let escapeCode;
17898
+ let escapeUrl;
17899
+ const words = string4.split(" ");
17900
+ let rows = [""];
17901
+ let rowLength = 0;
17902
+ for (let index = 0;index < words.length; index++) {
17903
+ const word = words[index];
17904
+ if (options.trim !== false) {
17905
+ const row = rows.at(-1) ?? "";
17906
+ const trimmed = row.trimStart();
17907
+ if (row.length !== trimmed.length) {
17908
+ rows[rows.length - 1] = trimmed;
17909
+ rowLength = dist_default2(trimmed);
17910
+ }
17911
+ }
17912
+ if (index !== 0) {
17913
+ if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
17914
+ rows.push("");
17915
+ rowLength = 0;
17916
+ }
17917
+ if (rowLength || options.trim === false) {
17918
+ rows[rows.length - 1] += " ";
17919
+ rowLength++;
17920
+ }
17921
+ }
17922
+ const wordLength = dist_default2(word);
17923
+ if (options.hard && wordLength > columns) {
17924
+ const remainingColumns = columns - rowLength;
17925
+ const breaksStartingThisLine = 1 + Math.floor((wordLength - remainingColumns - 1) / columns);
17926
+ const breaksStartingNextLine = Math.floor((wordLength - 1) / columns);
17927
+ if (breaksStartingNextLine < breaksStartingThisLine) {
17928
+ rows.push("");
17929
+ }
17930
+ wrapWord(rows, word, columns);
17931
+ rowLength = dist_default2(rows.at(-1) ?? "");
17830
17932
  continue;
17831
17933
  }
17832
- if (p + a[h] > e && p > 0 && a[h] > 0) {
17833
- if (s.wordWrap === false && p < e) {
17834
- G(l, o, e);
17934
+ if (rowLength + wordLength > columns && rowLength && wordLength) {
17935
+ if (options.wordWrap === false && rowLength < columns) {
17936
+ wrapWord(rows, word, columns);
17937
+ rowLength = dist_default2(rows.at(-1) ?? "");
17835
17938
  continue;
17836
17939
  }
17837
- l.push("");
17940
+ rows.push("");
17941
+ rowLength = 0;
17838
17942
  }
17839
- if (p + a[h] > e && s.wordWrap === false) {
17840
- G(l, o, e);
17943
+ if (rowLength + wordLength > columns && options.wordWrap === false) {
17944
+ wrapWord(rows, word, columns);
17945
+ rowLength = dist_default2(rows.at(-1) ?? "");
17841
17946
  continue;
17842
17947
  }
17843
- l[l.length - 1] += o;
17844
- }
17845
- s.trim !== false && (l = l.map((h) => vt(h)));
17846
- const E = l.join(`
17847
- `), g = E[Symbol.iterator]();
17848
- let m = g.next(), A = g.next(), V = 0;
17849
- for (;!m.done; ) {
17850
- const h = m.value, o = A.value;
17851
- if (i += h, h === W || h === Z) {
17852
- et.lastIndex = V + 1;
17853
- const F = et.exec(E)?.groups;
17854
- if (F?.code !== undefined) {
17855
- const d = Number.parseFloat(F.code);
17856
- r = d === Ft ? undefined : d;
17857
- } else
17858
- F?.uri !== undefined && (n = F.uri.length === 0 ? undefined : F.uri);
17948
+ rows[rows.length - 1] += word;
17949
+ rowLength += wordLength;
17950
+ }
17951
+ if (options.trim !== false) {
17952
+ rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
17953
+ }
17954
+ const preString = rows.join(`
17955
+ `);
17956
+ let inSurrogate = false;
17957
+ for (let i = 0;i < preString.length; i++) {
17958
+ const character = preString[i];
17959
+ returnValue += character;
17960
+ if (!inSurrogate) {
17961
+ inSurrogate = character >= "\uD800" && character <= "\uDBFF";
17962
+ } else {
17963
+ continue;
17964
+ }
17965
+ if (character === ESC || character === CSI) {
17966
+ GROUP_REGEX.lastIndex = i + 1;
17967
+ const groupsResult = GROUP_REGEX.exec(preString);
17968
+ const groups = groupsResult?.groups;
17969
+ if (groups?.code !== undefined) {
17970
+ const code = Number.parseFloat(groups.code);
17971
+ escapeCode = code === END_CODE ? undefined : code;
17972
+ } else if (groups?.uri !== undefined) {
17973
+ escapeUrl = groups.uri.length === 0 ? undefined : groups.uri;
17974
+ }
17975
+ }
17976
+ if (preString[i + 1] === `
17977
+ `) {
17978
+ if (escapeUrl) {
17979
+ returnValue += wrapAnsiHyperlink("");
17980
+ }
17981
+ const closingCode = escapeCode ? getClosingCode(escapeCode) : undefined;
17982
+ if (escapeCode && closingCode) {
17983
+ returnValue += wrapAnsiCode(closingCode);
17984
+ }
17985
+ } else if (character === `
17986
+ `) {
17987
+ if (escapeCode && getClosingCode(escapeCode)) {
17988
+ returnValue += wrapAnsiCode(escapeCode);
17989
+ }
17990
+ if (escapeUrl) {
17991
+ returnValue += wrapAnsiHyperlink(escapeUrl);
17992
+ }
17859
17993
  }
17860
- const p = r ? mt(r) : undefined;
17861
- o === `
17862
- ` ? (n && (i += it("")), r && p && (i += st(p))) : h === `
17863
- ` && (r && p && (i += st(r)), n && (i += it(n))), V += h.length, m = A, A = g.next();
17864
17994
  }
17865
- return i;
17995
+ return returnValue;
17866
17996
  };
17867
- function K(t, e, s) {
17868
- return String(t).normalize().replaceAll(`\r
17869
- `, `
17870
- `).split(`
17871
- `).map((i) => Et(i, e, s)).join(`
17997
+ var CRLF_OR_LF = /\r?\n/;
17998
+ function wrapAnsi(string4, columns, options) {
17999
+ return String(string4).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join(`
17872
18000
  `);
17873
18001
  }
17874
- var At = ["up", "down", "left", "right", "space", "enter", "cancel"];
17875
- var _ = { actions: new Set(At), aliases: new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["\x03", "cancel"], ["escape", "cancel"]]), messages: { cancel: "Canceled", error: "Something went wrong" }, withGuide: true };
17876
- function H(t, e) {
17877
- if (typeof t == "string")
17878
- return _.aliases.get(t) === e;
17879
- for (const s of t)
17880
- if (s !== undefined && H(s, e))
18002
+
18003
+ // ../../node_modules/.bun/@clack+core@1.2.0/node_modules/@clack/core/dist/index.mjs
18004
+ var import_sisteransi = __toESM(require_src(), 1);
18005
+ function d(r, t, e) {
18006
+ if (!e.some((o) => !o.disabled))
18007
+ return r;
18008
+ const s = r + t, i = Math.max(e.length - 1, 0), n = s < 0 ? i : s > i ? 0 : s;
18009
+ return e[n].disabled ? d(n, t < 0 ? -1 : 1, e) : n;
18010
+ }
18011
+ var E = ["up", "down", "left", "right", "space", "enter", "cancel"];
18012
+ var G = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
18013
+ var u = { actions: new Set(E), aliases: new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["\x03", "cancel"], ["escape", "cancel"]]), messages: { cancel: "Canceled", error: "Something went wrong" }, withGuide: true, date: { monthNames: [...G], messages: { required: "Please enter a valid date", invalidMonth: "There are only 12 months in a year", invalidDay: (r, t) => `There are only ${r} days in ${t}`, afterMin: (r) => `Date must be on or after ${r.toISOString().slice(0, 10)}`, beforeMax: (r) => `Date must be on or before ${r.toISOString().slice(0, 10)}` } } };
18014
+ function V(r, t) {
18015
+ if (typeof r == "string")
18016
+ return u.aliases.get(r) === t;
18017
+ for (const e of r)
18018
+ if (e !== undefined && V(e, t))
17881
18019
  return true;
17882
18020
  return false;
17883
18021
  }
17884
- function _t(t, e) {
17885
- if (t === e)
18022
+ function j(r, t) {
18023
+ if (r === t)
17886
18024
  return;
17887
- const s = t.split(`
17888
- `), i = e.split(`
17889
- `), r = Math.max(s.length, i.length), n = [];
17890
- for (let u = 0;u < r; u++)
17891
- s[u] !== i[u] && n.push(u);
17892
- return { lines: n, numLinesBefore: s.length, numLinesAfter: i.length, numLines: r };
17893
- }
17894
- var bt = globalThis.process.platform.startsWith("win");
17895
- var z2 = Symbol("clack:cancel");
17896
- function Ct(t) {
17897
- return t === z2;
17898
- }
17899
- function T(t, e) {
17900
- const s = t;
17901
- s.isTTY && s.setRawMode(e);
17902
- }
17903
- var rt = (t) => ("columns" in t) && typeof t.columns == "number" ? t.columns : 80;
17904
- var nt = (t) => ("rows" in t) && typeof t.rows == "number" ? t.rows : 20;
17905
- function xt(t, e, s, i = s) {
17906
- const r = rt(t ?? R);
17907
- return K(e, r - s.length, { hard: true, trim: false }).split(`
17908
- `).map((n, u) => `${u === 0 ? i : s}${n}`).join(`
18025
+ const e = r.split(`
18026
+ `), s = t.split(`
18027
+ `), i = Math.max(e.length, s.length), n = [];
18028
+ for (let o = 0;o < i; o++)
18029
+ e[o] !== s[o] && n.push(o);
18030
+ return { lines: n, numLinesBefore: e.length, numLinesAfter: s.length, numLines: i };
18031
+ }
18032
+ var Y = globalThis.process.platform.startsWith("win");
18033
+ var C = Symbol("clack:cancel");
18034
+ function q(r) {
18035
+ return r === C;
18036
+ }
18037
+ function w(r, t) {
18038
+ const e = r;
18039
+ e.isTTY && e.setRawMode(t);
18040
+ }
18041
+ var O = (r) => ("columns" in r) && typeof r.columns == "number" ? r.columns : 80;
18042
+ var A = (r) => ("rows" in r) && typeof r.rows == "number" ? r.rows : 20;
18043
+ function R(r, t, e, s = e) {
18044
+ const i = O(r ?? S);
18045
+ return wrapAnsi(t, i - e.length, { hard: true, trim: false }).split(`
18046
+ `).map((n, o) => `${o === 0 ? s : e}${n}`).join(`
17909
18047
  `);
17910
18048
  }
17911
-
17912
- class x {
18049
+ var p = class {
17913
18050
  input;
17914
18051
  output;
17915
18052
  _abortSignal;
@@ -17924,250 +18061,436 @@ class x {
17924
18061
  error = "";
17925
18062
  value;
17926
18063
  userInput = "";
17927
- constructor(e, s = true) {
17928
- const { input: i = q, output: r = R, render: n, signal: u, ...a } = e;
17929
- 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 = s, this._abortSignal = u, this.input = i, this.output = r;
18064
+ constructor(t, e = true) {
18065
+ const { input: s = $2, output: i = S, render: n, signal: o, ...a } = t;
18066
+ 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;
17930
18067
  }
17931
18068
  unsubscribe() {
17932
18069
  this._subscribers.clear();
17933
18070
  }
17934
- setSubscriber(e, s) {
17935
- const i = this._subscribers.get(e) ?? [];
17936
- i.push(s), this._subscribers.set(e, i);
18071
+ setSubscriber(t, e) {
18072
+ const s = this._subscribers.get(t) ?? [];
18073
+ s.push(e), this._subscribers.set(t, s);
17937
18074
  }
17938
- on(e, s) {
17939
- this.setSubscriber(e, { cb: s });
18075
+ on(t, e) {
18076
+ this.setSubscriber(t, { cb: e });
17940
18077
  }
17941
- once(e, s) {
17942
- this.setSubscriber(e, { cb: s, once: true });
18078
+ once(t, e) {
18079
+ this.setSubscriber(t, { cb: e, once: true });
17943
18080
  }
17944
- emit(e, ...s) {
17945
- const i = this._subscribers.get(e) ?? [], r = [];
18081
+ emit(t, ...e) {
18082
+ const s = this._subscribers.get(t) ?? [], i = [];
18083
+ for (const n of s)
18084
+ n.cb(...e), n.once && i.push(() => s.splice(s.indexOf(n), 1));
17946
18085
  for (const n of i)
17947
- n.cb(...s), n.once && r.push(() => i.splice(i.indexOf(n), 1));
17948
- for (const n of r)
17949
18086
  n();
17950
18087
  }
17951
18088
  prompt() {
17952
- return new Promise((e) => {
18089
+ return new Promise((t) => {
17953
18090
  if (this._abortSignal) {
17954
18091
  if (this._abortSignal.aborted)
17955
- return this.state = "cancel", this.close(), e(z2);
18092
+ return this.state = "cancel", this.close(), t(C);
17956
18093
  this._abortSignal.addEventListener("abort", () => {
17957
18094
  this.state = "cancel", this.close();
17958
18095
  }, { once: true });
17959
18096
  }
17960
- this.rl = ot.createInterface({ input: this.input, tabSize: 2, prompt: "", escapeCodeTimeout: 50, terminal: true }), this.rl.prompt(), this.opts.initialUserInput !== undefined && this._setUserInput(this.opts.initialUserInput, true), this.input.on("keypress", this.onKeypress), T(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
17961
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), T(this.input, false), e(this.value);
18097
+ this.rl = P.createInterface({ input: this.input, tabSize: 2, prompt: "", escapeCodeTimeout: 50, terminal: true }), this.rl.prompt(), this.opts.initialUserInput !== undefined && this._setUserInput(this.opts.initialUserInput, true), this.input.on("keypress", this.onKeypress), w(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
18098
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), w(this.input, false), t(this.value);
17962
18099
  }), this.once("cancel", () => {
17963
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), T(this.input, false), e(z2);
18100
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), w(this.input, false), t(C);
17964
18101
  });
17965
18102
  });
17966
18103
  }
17967
- _isActionKey(e, s) {
17968
- return e === "\t";
18104
+ _isActionKey(t, e) {
18105
+ return t === "\t";
17969
18106
  }
17970
- _setValue(e) {
17971
- this.value = e, this.emit("value", this.value);
18107
+ _setValue(t) {
18108
+ this.value = t, this.emit("value", this.value);
17972
18109
  }
17973
- _setUserInput(e, s) {
17974
- this.userInput = e ?? "", this.emit("userInput", this.userInput), s && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
18110
+ _setUserInput(t, e) {
18111
+ this.userInput = t ?? "", this.emit("userInput", this.userInput), e && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
17975
18112
  }
17976
18113
  _clearUserInput() {
17977
18114
  this.rl?.write(null, { ctrl: true, name: "u" }), this._setUserInput("");
17978
18115
  }
17979
- onKeypress(e, s) {
17980
- if (this._track && s.name !== "return" && (s.name && this._isActionKey(e, s) && this.rl?.write(null, { ctrl: true, name: "h" }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), s?.name && (!this._track && _.aliases.has(s.name) && this.emit("cursor", _.aliases.get(s.name)), _.actions.has(s.name) && this.emit("cursor", s.name)), e && (e.toLowerCase() === "y" || e.toLowerCase() === "n") && this.emit("confirm", e.toLowerCase() === "y"), this.emit("key", e?.toLowerCase(), s), s?.name === "return") {
18116
+ onKeypress(t, e) {
18117
+ if (this._track && e.name !== "return" && (e.name && this._isActionKey(t, e) && this.rl?.write(null, { ctrl: true, name: "h" }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), e?.name && (!this._track && u.aliases.has(e.name) && this.emit("cursor", u.aliases.get(e.name)), u.actions.has(e.name) && this.emit("cursor", e.name)), t && (t.toLowerCase() === "y" || t.toLowerCase() === "n") && this.emit("confirm", t.toLowerCase() === "y"), this.emit("key", t?.toLowerCase(), e), e?.name === "return") {
17981
18118
  if (this.opts.validate) {
17982
- const i = this.opts.validate(this.value);
17983
- i && (this.error = i instanceof Error ? i.message : i, this.state = "error", this.rl?.write(this.userInput));
18119
+ const s = this.opts.validate(this.value);
18120
+ s && (this.error = s instanceof Error ? s.message : s, this.state = "error", this.rl?.write(this.userInput));
17984
18121
  }
17985
18122
  this.state !== "error" && (this.state = "submit");
17986
18123
  }
17987
- H([e, s?.name, s?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
18124
+ V([t, e?.name, e?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
17988
18125
  }
17989
18126
  close() {
17990
18127
  this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
17991
- `), T(this.input, false), this.rl?.close(), this.rl = undefined, this.emit(`${this.state}`, this.value), this.unsubscribe();
18128
+ `), w(this.input, false), this.rl?.close(), this.rl = undefined, this.emit(`${this.state}`, this.value), this.unsubscribe();
17992
18129
  }
17993
18130
  restoreCursor() {
17994
- const e = K(this._prevFrame, process.stdout.columns, { hard: true, trim: false }).split(`
18131
+ const t = wrapAnsi(this._prevFrame, process.stdout.columns, { hard: true, trim: false }).split(`
17995
18132
  `).length - 1;
17996
- this.output.write(import_sisteransi.cursor.move(-999, e * -1));
18133
+ this.output.write(import_sisteransi.cursor.move(-999, t * -1));
17997
18134
  }
17998
18135
  render() {
17999
- const e = K(this._render(this) ?? "", process.stdout.columns, { hard: true, trim: false });
18000
- if (e !== this._prevFrame) {
18136
+ const t = wrapAnsi(this._render(this) ?? "", process.stdout.columns, { hard: true, trim: false });
18137
+ if (t !== this._prevFrame) {
18001
18138
  if (this.state === "initial")
18002
18139
  this.output.write(import_sisteransi.cursor.hide);
18003
18140
  else {
18004
- const s = _t(this._prevFrame, e), i = nt(this.output);
18005
- if (this.restoreCursor(), s) {
18006
- const r = Math.max(0, s.numLinesAfter - i), n = Math.max(0, s.numLinesBefore - i);
18007
- let u = s.lines.find((a) => a >= r);
18008
- if (u === undefined) {
18009
- this._prevFrame = e;
18141
+ const e = j(this._prevFrame, t), s = A(this.output);
18142
+ if (this.restoreCursor(), e) {
18143
+ const i = Math.max(0, e.numLinesAfter - s), n = Math.max(0, e.numLinesBefore - s);
18144
+ let o = e.lines.find((a) => a >= i);
18145
+ if (o === undefined) {
18146
+ this._prevFrame = t;
18010
18147
  return;
18011
18148
  }
18012
- if (s.lines.length === 1) {
18013
- this.output.write(import_sisteransi.cursor.move(0, u - n)), this.output.write(import_sisteransi.erase.lines(1));
18014
- const a = e.split(`
18149
+ if (e.lines.length === 1) {
18150
+ this.output.write(import_sisteransi.cursor.move(0, o - n)), this.output.write(import_sisteransi.erase.lines(1));
18151
+ const a = t.split(`
18015
18152
  `);
18016
- this.output.write(a[u]), this._prevFrame = e, this.output.write(import_sisteransi.cursor.move(0, a.length - u - 1));
18153
+ this.output.write(a[o]), this._prevFrame = t, this.output.write(import_sisteransi.cursor.move(0, a.length - o - 1));
18017
18154
  return;
18018
- } else if (s.lines.length > 1) {
18019
- if (r < n)
18020
- u = r;
18155
+ } else if (e.lines.length > 1) {
18156
+ if (i < n)
18157
+ o = i;
18021
18158
  else {
18022
- const l = u - n;
18023
- l > 0 && this.output.write(import_sisteransi.cursor.move(0, l));
18159
+ const h = o - n;
18160
+ h > 0 && this.output.write(import_sisteransi.cursor.move(0, h));
18024
18161
  }
18025
18162
  this.output.write(import_sisteransi.erase.down());
18026
- const a = e.split(`
18027
- `).slice(u);
18163
+ const a = t.split(`
18164
+ `).slice(o);
18028
18165
  this.output.write(a.join(`
18029
- `)), this._prevFrame = e;
18166
+ `)), this._prevFrame = t;
18030
18167
  return;
18031
18168
  }
18032
18169
  }
18033
18170
  this.output.write(import_sisteransi.erase.down());
18034
18171
  }
18035
- this.output.write(e), this.state === "initial" && (this.state = "active"), this._prevFrame = e;
18172
+ this.output.write(t), this.state === "initial" && (this.state = "active"), this._prevFrame = t;
18036
18173
  }
18037
18174
  }
18038
- }
18039
- function wt(t, e) {
18040
- if (t === undefined || e.length === 0)
18175
+ };
18176
+ function W(r, t) {
18177
+ if (r === undefined || t.length === 0)
18041
18178
  return 0;
18042
- const s = e.findIndex((i) => i.value === t);
18043
- return s !== -1 ? s : 0;
18179
+ const e = t.findIndex((s) => s.value === r);
18180
+ return e !== -1 ? e : 0;
18044
18181
  }
18045
- function Dt(t, e) {
18046
- return (e.label ?? String(e.value)).toLowerCase().includes(t.toLowerCase());
18182
+ function B(r, t) {
18183
+ return (t.label ?? String(t.value)).toLowerCase().includes(r.toLowerCase());
18047
18184
  }
18048
- function St(t, e) {
18049
- if (e)
18050
- return t ? e : e[0];
18185
+ function J(r, t) {
18186
+ if (t)
18187
+ return r ? t : t[0];
18051
18188
  }
18052
-
18053
- class Vt extends x {
18189
+ var H = class extends p {
18054
18190
  filteredOptions;
18055
18191
  multiple;
18056
18192
  isNavigating = false;
18057
18193
  selectedValues = [];
18058
18194
  focusedValue;
18059
- #t = 0;
18060
- #s = "";
18061
- #i;
18062
- #e;
18195
+ #e = 0;
18196
+ #o = "";
18197
+ #t;
18198
+ #n;
18199
+ #a;
18063
18200
  get cursor() {
18064
- return this.#t;
18201
+ return this.#e;
18065
18202
  }
18066
18203
  get userInputWithCursor() {
18067
18204
  if (!this.userInput)
18068
- return import_picocolors.default.inverse(import_picocolors.default.hidden("_"));
18205
+ return y(["inverse", "hidden"], "_");
18069
18206
  if (this._cursor >= this.userInput.length)
18070
18207
  return `${this.userInput}█`;
18071
- const e = this.userInput.slice(0, this._cursor), [s, ...i] = this.userInput.slice(this._cursor);
18072
- return `${e}${import_picocolors.default.inverse(s)}${i.join("")}`;
18208
+ const t = this.userInput.slice(0, this._cursor), [e, ...s] = this.userInput.slice(this._cursor);
18209
+ return `${t}${y("inverse", e)}${s.join("")}`;
18073
18210
  }
18074
18211
  get options() {
18075
- return typeof this.#e == "function" ? this.#e() : this.#e;
18076
- }
18077
- constructor(e) {
18078
- super(e), this.#e = e.options;
18079
- const s = this.options;
18080
- this.filteredOptions = [...s], this.multiple = e.multiple === true, this.#i = e.filter ?? Dt;
18081
- let i;
18082
- if (e.initialValue && Array.isArray(e.initialValue) ? this.multiple ? i = e.initialValue : i = e.initialValue.slice(0, 1) : !this.multiple && this.options.length > 0 && (i = [this.options[0].value]), i)
18083
- for (const r of i) {
18084
- const n = s.findIndex((u) => u.value === r);
18085
- n !== -1 && (this.toggleSelected(r), this.#t = n);
18086
- }
18087
- this.focusedValue = this.options[this.#t]?.value, this.on("key", (r, n) => this.#r(r, n)), this.on("userInput", (r) => this.#n(r));
18088
- }
18089
- _isActionKey(e, s) {
18090
- return e === "\t" || this.multiple && this.isNavigating && s.name === "space" && e !== undefined && e !== "";
18091
- }
18092
- #r(e, s) {
18093
- const i = s.name === "up", r = s.name === "down", n = s.name === "return";
18094
- i || r ? (this.#t = B(this.#t, i ? -1 : 1, this.filteredOptions), this.focusedValue = this.filteredOptions[this.#t]?.value, this.multiple || (this.selectedValues = [this.focusedValue]), this.isNavigating = true) : n ? this.value = St(this.multiple, this.selectedValues) : this.multiple ? this.focusedValue !== undefined && (s.name === "tab" || this.isNavigating && s.name === "space") ? this.toggleSelected(this.focusedValue) : this.isNavigating = false : (this.focusedValue && (this.selectedValues = [this.focusedValue]), this.isNavigating = false);
18212
+ return typeof this.#n == "function" ? this.#n() : this.#n;
18213
+ }
18214
+ constructor(t) {
18215
+ super(t), this.#n = t.options, this.#a = t.placeholder;
18216
+ const e = this.options;
18217
+ this.filteredOptions = [...e], this.multiple = t.multiple === true, this.#t = typeof t.options == "function" ? t.filter : t.filter ?? B;
18218
+ let s;
18219
+ if (t.initialValue && Array.isArray(t.initialValue) ? this.multiple ? s = t.initialValue : s = t.initialValue.slice(0, 1) : !this.multiple && this.options.length > 0 && (s = [this.options[0].value]), s)
18220
+ for (const i of s) {
18221
+ const n = e.findIndex((o) => o.value === i);
18222
+ n !== -1 && (this.toggleSelected(i), this.#e = n);
18223
+ }
18224
+ this.focusedValue = this.options[this.#e]?.value, this.on("key", (i, n) => this.#s(i, n)), this.on("userInput", (i) => this.#i(i));
18225
+ }
18226
+ _isActionKey(t, e) {
18227
+ return t === "\t" || this.multiple && this.isNavigating && e.name === "space" && t !== undefined && t !== "";
18228
+ }
18229
+ #s(t, e) {
18230
+ const s = e.name === "up", i = e.name === "down", n = e.name === "return", o = this.userInput === "" || this.userInput === "\t", a = this.#a, h = this.options, l = a !== undefined && a !== "" && h.some((f) => !f.disabled && (this.#t ? this.#t(a, f) : true));
18231
+ if (e.name === "tab" && o && l) {
18232
+ this.userInput === "\t" && this._clearUserInput(), this._setUserInput(a, true), this.isNavigating = false;
18233
+ return;
18234
+ }
18235
+ s || i ? (this.#e = d(this.#e, s ? -1 : 1, this.filteredOptions), this.focusedValue = this.filteredOptions[this.#e]?.value, this.multiple || (this.selectedValues = [this.focusedValue]), this.isNavigating = true) : n ? this.value = J(this.multiple, this.selectedValues) : this.multiple ? this.focusedValue !== undefined && (e.name === "tab" || this.isNavigating && e.name === "space") ? this.toggleSelected(this.focusedValue) : this.isNavigating = false : (this.focusedValue && (this.selectedValues = [this.focusedValue]), this.isNavigating = false);
18095
18236
  }
18096
18237
  deselectAll() {
18097
18238
  this.selectedValues = [];
18098
18239
  }
18099
- toggleSelected(e) {
18100
- this.filteredOptions.length !== 0 && (this.multiple ? this.selectedValues.includes(e) ? this.selectedValues = this.selectedValues.filter((s) => s !== e) : this.selectedValues = [...this.selectedValues, e] : this.selectedValues = [e]);
18240
+ toggleSelected(t) {
18241
+ this.filteredOptions.length !== 0 && (this.multiple ? this.selectedValues.includes(t) ? this.selectedValues = this.selectedValues.filter((e) => e !== t) : this.selectedValues = [...this.selectedValues, t] : this.selectedValues = [t]);
18101
18242
  }
18102
- #n(e) {
18103
- if (e !== this.#s) {
18104
- this.#s = e;
18105
- const s = this.options;
18106
- e ? this.filteredOptions = s.filter((n) => this.#i(e, n)) : this.filteredOptions = [...s];
18107
- const i = wt(this.focusedValue, this.filteredOptions);
18108
- this.#t = B(i, 0, this.filteredOptions);
18109
- const r = this.filteredOptions[this.#t];
18110
- r && !r.disabled ? this.focusedValue = r.value : this.focusedValue = undefined, this.multiple || (this.focusedValue !== undefined ? this.toggleSelected(this.focusedValue) : this.deselectAll());
18243
+ #i(t) {
18244
+ if (t !== this.#o) {
18245
+ this.#o = t;
18246
+ const e = this.options;
18247
+ t && this.#t ? this.filteredOptions = e.filter((n) => this.#t?.(t, n)) : this.filteredOptions = [...e];
18248
+ const s = W(this.focusedValue, this.filteredOptions);
18249
+ this.#e = d(s, 0, this.filteredOptions);
18250
+ const i = this.filteredOptions[this.#e];
18251
+ i && !i.disabled ? this.focusedValue = i.value : this.focusedValue = undefined, this.multiple || (this.focusedValue !== undefined ? this.toggleSelected(this.focusedValue) : this.deselectAll());
18111
18252
  }
18112
18253
  }
18113
- }
18254
+ };
18114
18255
 
18115
- class kt extends x {
18256
+ class Q extends p {
18116
18257
  get cursor() {
18117
18258
  return this.value ? 0 : 1;
18118
18259
  }
18119
18260
  get _value() {
18120
18261
  return this.cursor === 0;
18121
18262
  }
18122
- constructor(e) {
18123
- super(e, false), this.value = !!e.initialValue, this.on("userInput", () => {
18263
+ constructor(t) {
18264
+ super(t, false), this.value = !!t.initialValue, this.on("userInput", () => {
18124
18265
  this.value = this._value;
18125
- }), this.on("confirm", (s) => {
18126
- this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = s, this.state = "submit", this.close();
18266
+ }), this.on("confirm", (e) => {
18267
+ this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = e, this.state = "submit", this.close();
18127
18268
  }), this.on("cursor", () => {
18128
18269
  this.value = !this.value;
18129
18270
  });
18130
18271
  }
18131
18272
  }
18273
+ var X = { Y: { type: "year", len: 4 }, M: { type: "month", len: 2 }, D: { type: "day", len: 2 } };
18274
+ function L(r) {
18275
+ return [...r].map((t) => X[t]);
18276
+ }
18277
+ function Z(r) {
18278
+ const t = new Intl.DateTimeFormat(r, { year: "numeric", month: "2-digit", day: "2-digit" }).formatToParts(new Date(2000, 0, 15)), e = [];
18279
+ let s = "/";
18280
+ for (const i of t)
18281
+ i.type === "literal" ? s = i.value.trim() || i.value : (i.type === "year" || i.type === "month" || i.type === "day") && e.push({ type: i.type, len: i.type === "year" ? 4 : 2 });
18282
+ return { segments: e, separator: s };
18283
+ }
18284
+ function k(r) {
18285
+ return Number.parseInt((r || "0").replace(/_/g, "0"), 10) || 0;
18286
+ }
18287
+ function I(r) {
18288
+ return { year: k(r.year), month: k(r.month), day: k(r.day) };
18289
+ }
18290
+ function T(r, t) {
18291
+ return new Date(r || 2001, t || 1, 0).getDate();
18292
+ }
18293
+ function F(r) {
18294
+ const { year: t, month: e, day: s } = I(r);
18295
+ if (!t || t < 0 || t > 9999 || !e || e < 1 || e > 12 || !s || s < 1)
18296
+ return;
18297
+ const i = new Date(Date.UTC(t, e - 1, s));
18298
+ if (!(i.getUTCFullYear() !== t || i.getUTCMonth() !== e - 1 || i.getUTCDate() !== s))
18299
+ return { year: t, month: e, day: s };
18300
+ }
18301
+ function N(r) {
18302
+ const t = F(r);
18303
+ return t ? new Date(Date.UTC(t.year, t.month - 1, t.day)) : undefined;
18304
+ }
18305
+ function tt(r, t, e, s) {
18306
+ const i = e ? { year: e.getUTCFullYear(), month: e.getUTCMonth() + 1, day: e.getUTCDate() } : null, n = s ? { year: s.getUTCFullYear(), month: s.getUTCMonth() + 1, day: s.getUTCDate() } : null;
18307
+ return r === "year" ? { min: i?.year ?? 1, max: n?.year ?? 9999 } : r === "month" ? { min: i && t.year === i.year ? i.month : 1, max: n && t.year === n.year ? n.month : 12 } : { min: i && t.year === i.year && t.month === i.month ? i.day : 1, max: n && t.year === n.year && t.month === n.month ? n.day : T(t.year, t.month) };
18308
+ }
18309
+
18310
+ class et extends p {
18311
+ #e;
18312
+ #o;
18313
+ #t;
18314
+ #n;
18315
+ #a;
18316
+ #s = { segmentIndex: 0, positionInSegment: 0 };
18317
+ #i = true;
18318
+ #r = null;
18319
+ inlineError = "";
18320
+ get segmentCursor() {
18321
+ return { ...this.#s };
18322
+ }
18323
+ get segmentValues() {
18324
+ return { ...this.#t };
18325
+ }
18326
+ get segments() {
18327
+ return this.#e;
18328
+ }
18329
+ get separator() {
18330
+ return this.#o;
18331
+ }
18332
+ get formattedValue() {
18333
+ return this.#c(this.#t);
18334
+ }
18335
+ #c(t) {
18336
+ return this.#e.map((e) => t[e.type]).join(this.#o);
18337
+ }
18338
+ #h() {
18339
+ this._setUserInput(this.#c(this.#t)), this._setValue(N(this.#t) ?? undefined);
18340
+ }
18341
+ constructor(t) {
18342
+ const e = t.format ? { segments: L(t.format), separator: t.separator ?? "/" } : Z(t.locale), s = t.separator ?? e.separator, i = t.format ? L(t.format) : e.segments, n = t.initialValue ?? t.defaultValue, o = n ? { year: String(n.getUTCFullYear()).padStart(4, "0"), month: String(n.getUTCMonth() + 1).padStart(2, "0"), day: String(n.getUTCDate()).padStart(2, "0") } : { year: "____", month: "__", day: "__" }, a = i.map((h) => o[h.type]).join(s);
18343
+ super({ ...t, initialUserInput: a }, false), this.#e = i, this.#o = s, this.#t = o, this.#n = t.minDate, this.#a = t.maxDate, this.#h(), this.on("cursor", (h) => this.#d(h)), this.on("key", (h, l) => this.#f(h, l)), this.on("finalize", () => this.#g(t));
18344
+ }
18345
+ #u() {
18346
+ const t = Math.max(0, Math.min(this.#s.segmentIndex, this.#e.length - 1)), e = this.#e[t];
18347
+ if (e)
18348
+ return this.#s.positionInSegment = Math.max(0, Math.min(this.#s.positionInSegment, e.len - 1)), { segment: e, index: t };
18349
+ }
18350
+ #l(t) {
18351
+ this.inlineError = "", this.#r = null;
18352
+ const e = this.#u();
18353
+ e && (this.#s.segmentIndex = Math.max(0, Math.min(this.#e.length - 1, e.index + t)), this.#s.positionInSegment = 0, this.#i = true);
18354
+ }
18355
+ #p(t) {
18356
+ const e = this.#u();
18357
+ if (!e)
18358
+ return;
18359
+ const { segment: s } = e, i = this.#t[s.type], n = !i || i.replace(/_/g, "") === "", o = Number.parseInt((i || "0").replace(/_/g, "0"), 10) || 0, a = tt(s.type, I(this.#t), this.#n, this.#a);
18360
+ let h;
18361
+ n ? h = t === 1 ? a.min : a.max : h = Math.max(Math.min(a.max, o + t), a.min), this.#t = { ...this.#t, [s.type]: h.toString().padStart(s.len, "0") }, this.#i = true, this.#r = null, this.#h();
18362
+ }
18363
+ #d(t) {
18364
+ if (t)
18365
+ switch (t) {
18366
+ case "right":
18367
+ return this.#l(1);
18368
+ case "left":
18369
+ return this.#l(-1);
18370
+ case "up":
18371
+ return this.#p(1);
18372
+ case "down":
18373
+ return this.#p(-1);
18374
+ }
18375
+ }
18376
+ #f(t, e) {
18377
+ if (e?.name === "backspace" || e?.sequence === "" || e?.sequence === "\b" || t === "" || t === "\b") {
18378
+ this.inlineError = "";
18379
+ const s = this.#u();
18380
+ if (!s)
18381
+ return;
18382
+ if (!this.#t[s.segment.type].replace(/_/g, "")) {
18383
+ this.#l(-1);
18384
+ return;
18385
+ }
18386
+ this.#t[s.segment.type] = "_".repeat(s.segment.len), this.#i = true, this.#s.positionInSegment = 0, this.#h();
18387
+ return;
18388
+ }
18389
+ if (e?.name === "tab") {
18390
+ this.inlineError = "";
18391
+ const s = this.#u();
18392
+ if (!s)
18393
+ return;
18394
+ const i = e.shift ? -1 : 1, n = s.index + i;
18395
+ n >= 0 && n < this.#e.length && (this.#s.segmentIndex = n, this.#s.positionInSegment = 0, this.#i = true);
18396
+ return;
18397
+ }
18398
+ if (t && /^[0-9]$/.test(t)) {
18399
+ const s = this.#u();
18400
+ if (!s)
18401
+ return;
18402
+ const { segment: i } = s, n = !this.#t[i.type].replace(/_/g, "");
18403
+ if (this.#i && this.#r !== null && !n) {
18404
+ const m = this.#r + t, g = { ...this.#t, [i.type]: m }, b = this.#m(g, i);
18405
+ if (b) {
18406
+ this.inlineError = b, this.#r = null, this.#i = false;
18407
+ return;
18408
+ }
18409
+ this.inlineError = "", this.#t[i.type] = m, this.#r = null, this.#i = false, this.#h(), s.index < this.#e.length - 1 && (this.#s.segmentIndex = s.index + 1, this.#s.positionInSegment = 0, this.#i = true);
18410
+ return;
18411
+ }
18412
+ this.#i && !n && (this.#t[i.type] = "_".repeat(i.len), this.#s.positionInSegment = 0), this.#i = false, this.#r = null;
18413
+ const o = this.#t[i.type], a = o.indexOf("_"), h = a >= 0 ? a : Math.min(this.#s.positionInSegment, i.len - 1);
18414
+ if (h < 0 || h >= i.len)
18415
+ return;
18416
+ let l = o.slice(0, h) + t + o.slice(h + 1), f = false;
18417
+ if (h === 0 && o === "__" && (i.type === "month" || i.type === "day")) {
18418
+ const m = Number.parseInt(t, 10);
18419
+ l = `0${t}`, f = m <= (i.type === "month" ? 1 : 2);
18420
+ }
18421
+ if (i.type === "year" && (l = (o.replace(/_/g, "") + t).padStart(i.len, "_")), !l.includes("_")) {
18422
+ const m = { ...this.#t, [i.type]: l }, g = this.#m(m, i);
18423
+ if (g) {
18424
+ this.inlineError = g;
18425
+ return;
18426
+ }
18427
+ }
18428
+ this.inlineError = "", this.#t[i.type] = l;
18429
+ const v = l.includes("_") ? undefined : F(this.#t);
18430
+ if (v) {
18431
+ const { year: m, month: g } = v, b = T(m, g);
18432
+ this.#t = { year: String(Math.max(0, Math.min(9999, m))).padStart(4, "0"), month: String(Math.max(1, Math.min(12, g))).padStart(2, "0"), day: String(Math.max(1, Math.min(b, v.day))).padStart(2, "0") };
18433
+ }
18434
+ this.#h();
18435
+ const U = l.indexOf("_");
18436
+ f ? (this.#i = true, this.#r = t) : U >= 0 ? this.#s.positionInSegment = U : a >= 0 && s.index < this.#e.length - 1 ? (this.#s.segmentIndex = s.index + 1, this.#s.positionInSegment = 0, this.#i = true) : this.#s.positionInSegment = Math.min(h + 1, i.len - 1);
18437
+ }
18438
+ }
18439
+ #m(t, e) {
18440
+ const { month: s, day: i } = I(t);
18441
+ if (e.type === "month" && (s < 0 || s > 12))
18442
+ return u.date.messages.invalidMonth;
18443
+ if (e.type === "day" && (i < 0 || i > 31))
18444
+ return u.date.messages.invalidDay(31, "any month");
18445
+ }
18446
+ #g(t) {
18447
+ const { year: e, month: s, day: i } = I(this.#t);
18448
+ if (e && s && i) {
18449
+ const n = T(e, s);
18450
+ this.#t = { ...this.#t, day: String(Math.min(i, n)).padStart(2, "0") };
18451
+ }
18452
+ this.value = N(this.#t) ?? t.defaultValue ?? undefined;
18453
+ }
18454
+ }
18132
18455
 
18133
- class yt extends x {
18456
+ class st extends p {
18134
18457
  options;
18135
18458
  cursor = 0;
18136
- #t;
18137
- getGroupItems(e) {
18138
- return this.options.filter((s) => s.group === e);
18459
+ #e;
18460
+ getGroupItems(t) {
18461
+ return this.options.filter((e) => e.group === t);
18139
18462
  }
18140
- isGroupSelected(e) {
18141
- const s = this.getGroupItems(e), i = this.value;
18142
- return i === undefined ? false : s.every((r) => i.includes(r.value));
18463
+ isGroupSelected(t) {
18464
+ const e = this.getGroupItems(t), s = this.value;
18465
+ return s === undefined ? false : e.every((i) => s.includes(i.value));
18143
18466
  }
18144
18467
  toggleValue() {
18145
- const e = this.options[this.cursor];
18146
- if (this.value === undefined && (this.value = []), e.group === true) {
18147
- const s = e.value, i = this.getGroupItems(s);
18148
- this.isGroupSelected(s) ? this.value = this.value.filter((r) => i.findIndex((n) => n.value === r) === -1) : this.value = [...this.value, ...i.map((r) => r.value)], this.value = Array.from(new Set(this.value));
18468
+ const t = this.options[this.cursor];
18469
+ if (this.value === undefined && (this.value = []), t.group === true) {
18470
+ const e = t.value, s = this.getGroupItems(e);
18471
+ this.isGroupSelected(e) ? this.value = this.value.filter((i) => s.findIndex((n) => n.value === i) === -1) : this.value = [...this.value, ...s.map((i) => i.value)], this.value = Array.from(new Set(this.value));
18149
18472
  } else {
18150
- const s = this.value.includes(e.value);
18151
- this.value = s ? this.value.filter((i) => i !== e.value) : [...this.value, e.value];
18473
+ const e = this.value.includes(t.value);
18474
+ this.value = e ? this.value.filter((s) => s !== t.value) : [...this.value, t.value];
18152
18475
  }
18153
18476
  }
18154
- constructor(e) {
18155
- super(e, false);
18156
- const { options: s } = e;
18157
- this.#t = e.selectableGroups !== false, this.options = Object.entries(s).flatMap(([i, r]) => [{ value: i, group: true, label: i }, ...r.map((n) => ({ ...n, group: i }))]), this.value = [...e.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: i }) => i === e.cursorAt), this.#t ? 0 : 1), this.on("cursor", (i) => {
18158
- switch (i) {
18477
+ constructor(t) {
18478
+ super(t, false);
18479
+ const { options: e } = t;
18480
+ this.#e = t.selectableGroups !== false, this.options = Object.entries(e).flatMap(([s, i]) => [{ value: s, group: true, label: s }, ...i.map((n) => ({ ...n, group: s }))]), this.value = [...t.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: s }) => s === t.cursorAt), this.#e ? 0 : 1), this.on("cursor", (s) => {
18481
+ switch (s) {
18159
18482
  case "left":
18160
18483
  case "up": {
18161
18484
  this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
18162
- const r = this.options[this.cursor]?.group === true;
18163
- !this.#t && r && (this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1);
18485
+ const i = this.options[this.cursor]?.group === true;
18486
+ !this.#e && i && (this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1);
18164
18487
  break;
18165
18488
  }
18166
18489
  case "down":
18167
18490
  case "right": {
18168
18491
  this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
18169
- const r = this.options[this.cursor]?.group === true;
18170
- !this.#t && r && (this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1);
18492
+ const i = this.options[this.cursor]?.group === true;
18493
+ !this.#e && i && (this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1);
18171
18494
  break;
18172
18495
  }
18173
18496
  case "space":
@@ -18177,46 +18500,45 @@ class yt extends x {
18177
18500
  });
18178
18501
  }
18179
18502
  }
18180
-
18181
- class Lt extends x {
18503
+ var it = class extends p {
18182
18504
  options;
18183
18505
  cursor = 0;
18184
18506
  get _value() {
18185
18507
  return this.options[this.cursor].value;
18186
18508
  }
18187
18509
  get _enabledOptions() {
18188
- return this.options.filter((e) => e.disabled !== true);
18510
+ return this.options.filter((t) => t.disabled !== true);
18189
18511
  }
18190
18512
  toggleAll() {
18191
- const e = this._enabledOptions, s = this.value !== undefined && this.value.length === e.length;
18192
- this.value = s ? [] : e.map((i) => i.value);
18513
+ const t = this._enabledOptions, e = this.value !== undefined && this.value.length === t.length;
18514
+ this.value = e ? [] : t.map((s) => s.value);
18193
18515
  }
18194
18516
  toggleInvert() {
18195
- const e = this.value;
18196
- if (!e)
18517
+ const t = this.value;
18518
+ if (!t)
18197
18519
  return;
18198
- const s = this._enabledOptions.filter((i) => !e.includes(i.value));
18199
- this.value = s.map((i) => i.value);
18520
+ const e = this._enabledOptions.filter((s) => !t.includes(s.value));
18521
+ this.value = e.map((s) => s.value);
18200
18522
  }
18201
18523
  toggleValue() {
18202
18524
  this.value === undefined && (this.value = []);
18203
- const e = this.value.includes(this._value);
18204
- this.value = e ? this.value.filter((s) => s !== this._value) : [...this.value, this._value];
18205
- }
18206
- constructor(e) {
18207
- super(e, false), this.options = e.options, this.value = [...e.initialValues ?? []];
18208
- const s = Math.max(this.options.findIndex(({ value: i }) => i === e.cursorAt), 0);
18209
- this.cursor = this.options[s].disabled ? B(s, 1, this.options) : s, this.on("key", (i) => {
18210
- i === "a" && this.toggleAll(), i === "i" && this.toggleInvert();
18211
- }), this.on("cursor", (i) => {
18212
- switch (i) {
18525
+ const t = this.value.includes(this._value);
18526
+ this.value = t ? this.value.filter((e) => e !== this._value) : [...this.value, this._value];
18527
+ }
18528
+ constructor(t) {
18529
+ super(t, false), this.options = t.options, this.value = [...t.initialValues ?? []];
18530
+ const e = Math.max(this.options.findIndex(({ value: s }) => s === t.cursorAt), 0);
18531
+ this.cursor = this.options[e].disabled ? d(e, 1, this.options) : e, this.on("key", (s) => {
18532
+ s === "a" && this.toggleAll(), s === "i" && this.toggleInvert();
18533
+ }), this.on("cursor", (s) => {
18534
+ switch (s) {
18213
18535
  case "left":
18214
18536
  case "up":
18215
- this.cursor = B(this.cursor, -1, this.options);
18537
+ this.cursor = d(this.cursor, -1, this.options);
18216
18538
  break;
18217
18539
  case "down":
18218
18540
  case "right":
18219
- this.cursor = B(this.cursor, 1, this.options);
18541
+ this.cursor = d(this.cursor, 1, this.options);
18220
18542
  break;
18221
18543
  case "space":
18222
18544
  this.toggleValue();
@@ -18224,8 +18546,8 @@ class Lt extends x {
18224
18546
  }
18225
18547
  });
18226
18548
  }
18227
- }
18228
- class Wt extends x {
18549
+ };
18550
+ class nt extends p {
18229
18551
  options;
18230
18552
  cursor = 0;
18231
18553
  get _selectedValue() {
@@ -18234,492 +18556,314 @@ class Wt extends x {
18234
18556
  changeValue() {
18235
18557
  this.value = this._selectedValue.value;
18236
18558
  }
18237
- constructor(e) {
18238
- super(e, false), this.options = e.options;
18239
- const s = this.options.findIndex(({ value: r }) => r === e.initialValue), i = s === -1 ? 0 : s;
18240
- this.cursor = this.options[i].disabled ? B(i, 1, this.options) : i, this.changeValue(), this.on("cursor", (r) => {
18241
- switch (r) {
18559
+ constructor(t) {
18560
+ super(t, false), this.options = t.options;
18561
+ const e = this.options.findIndex(({ value: i }) => i === t.initialValue), s = e === -1 ? 0 : e;
18562
+ this.cursor = this.options[s].disabled ? d(s, 1, this.options) : s, this.changeValue(), this.on("cursor", (i) => {
18563
+ switch (i) {
18242
18564
  case "left":
18243
18565
  case "up":
18244
- this.cursor = B(this.cursor, -1, this.options);
18566
+ this.cursor = d(this.cursor, -1, this.options);
18245
18567
  break;
18246
18568
  case "down":
18247
18569
  case "right":
18248
- this.cursor = B(this.cursor, 1, this.options);
18570
+ this.cursor = d(this.cursor, 1, this.options);
18249
18571
  break;
18250
18572
  }
18251
18573
  this.changeValue();
18252
18574
  });
18253
18575
  }
18254
18576
  }
18255
- class $t extends x {
18577
+ class at extends p {
18256
18578
  get userInputWithCursor() {
18257
18579
  if (this.state === "submit")
18258
18580
  return this.userInput;
18259
- const e = this.userInput;
18260
- if (this.cursor >= e.length)
18581
+ const t = this.userInput;
18582
+ if (this.cursor >= t.length)
18261
18583
  return `${this.userInput}█`;
18262
- const s = e.slice(0, this.cursor), [i, ...r] = e.slice(this.cursor);
18263
- return `${s}${import_picocolors.default.inverse(i)}${r.join("")}`;
18584
+ const e = t.slice(0, this.cursor), [s, ...i] = t.slice(this.cursor);
18585
+ return `${e}${y("inverse", s)}${i.join("")}`;
18264
18586
  }
18265
18587
  get cursor() {
18266
18588
  return this._cursor;
18267
18589
  }
18268
- constructor(e) {
18269
- super({ ...e, initialUserInput: e.initialUserInput ?? e.initialValue }), this.on("userInput", (s) => {
18270
- this._setValue(s);
18590
+ constructor(t) {
18591
+ super({ ...t, initialUserInput: t.initialUserInput ?? t.initialValue }), this.on("userInput", (e) => {
18592
+ this._setValue(e);
18271
18593
  }), this.on("finalize", () => {
18272
- this.value || (this.value = e.defaultValue), this.value === undefined && (this.value = "");
18594
+ this.value || (this.value = t.defaultValue), this.value === undefined && (this.value = "");
18273
18595
  });
18274
18596
  }
18275
18597
  }
18276
18598
 
18277
- // ../../node_modules/@clack/prompts/dist/index.mjs
18278
- var import_picocolors2 = __toESM(require_picocolors(), 1);
18279
- import N2 from "node:process";
18599
+ // ../../node_modules/.bun/@clack+prompts@1.2.0/node_modules/@clack/prompts/dist/index.mjs
18600
+ import { styleText as t, stripVTControlCharacters as ne } from "node:util";
18601
+ import P2 from "node:process";
18280
18602
  var import_sisteransi2 = __toESM(require_src(), 1);
18281
- function me() {
18282
- return N2.platform !== "win32" ? N2.env.TERM !== "linux" : !!N2.env.CI || !!N2.env.WT_SESSION || !!N2.env.TERMINUS_SUBLIME || N2.env.ConEmuTask === "{cmd::Cmder}" || N2.env.TERM_PROGRAM === "Terminus-Sublime" || N2.env.TERM_PROGRAM === "vscode" || N2.env.TERM === "xterm-256color" || N2.env.TERM === "alacritty" || N2.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
18283
- }
18284
- var et2 = me();
18285
- var C = (t, r) => et2 ? t : r;
18286
- var Rt = C("◆", "*");
18287
- var dt2 = C("■", "x");
18288
- var $t2 = C("▲", "x");
18289
- var V = C("◇", "o");
18290
- var ht2 = C("┌", "T");
18291
- var d = C("│", "|");
18292
- var x2 = C("└", "—");
18293
- var Ot = C("┐", "T");
18294
- var Pt = C("┘", "—");
18295
- var Q2 = C("●", ">");
18296
- var H2 = C("○", " ");
18297
- var st2 = C("◻", "[•]");
18298
- var U2 = C("◼", "[+]");
18299
- var q2 = C("◻", "[ ]");
18300
- var Nt = C("▪", "•");
18301
- var rt2 = C("─", "-");
18302
- var mt2 = C("╮", "+");
18303
- var Wt2 = C("├", "+");
18304
- var pt2 = C("╯", "+");
18305
- var gt2 = C("╰", "+");
18306
- var Lt2 = C("╭", "+");
18307
- var ft2 = C("●", "•");
18308
- var Ft2 = C("◆", "*");
18309
- var yt2 = C("▲", "!");
18310
- var Et2 = C("■", "x");
18311
- var W2 = (t) => {
18312
- switch (t) {
18603
+ function Ze() {
18604
+ 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";
18605
+ }
18606
+ var ee = Ze();
18607
+ var w2 = (e, i) => ee ? e : i;
18608
+ var _e = w2("◆", "*");
18609
+ var oe = w2("■", "x");
18610
+ var ue = w2("▲", "x");
18611
+ var F2 = w2("◇", "o");
18612
+ var le = w2("┌", "T");
18613
+ var d2 = w2("│", "|");
18614
+ var E2 = w2("└", "—");
18615
+ var Ie = w2("┐", "T");
18616
+ var Ee = w2("┘", "—");
18617
+ var z3 = w2("●", ">");
18618
+ var H2 = w2("○", " ");
18619
+ var te = w2("◻", "[•]");
18620
+ var U = w2("◼", "[+]");
18621
+ var J2 = w2("◻", "[ ]");
18622
+ var xe = w2("▪", "•");
18623
+ var se = w2("─", "-");
18624
+ var ce = w2("╮", "+");
18625
+ var Ge = w2("├", "+");
18626
+ var $e = w2("╯", "+");
18627
+ var de = w2("╰", "+");
18628
+ var Oe = w2("╭", "+");
18629
+ var he = w2("●", "•");
18630
+ var pe = w2("◆", "*");
18631
+ var me = w2("▲", "!");
18632
+ var ge = w2("■", "x");
18633
+ var V2 = (e) => {
18634
+ switch (e) {
18313
18635
  case "initial":
18314
18636
  case "active":
18315
- return import_picocolors2.default.cyan(Rt);
18637
+ return t("cyan", _e);
18316
18638
  case "cancel":
18317
- return import_picocolors2.default.red(dt2);
18639
+ return t("red", oe);
18318
18640
  case "error":
18319
- return import_picocolors2.default.yellow($t2);
18641
+ return t("yellow", ue);
18320
18642
  case "submit":
18321
- return import_picocolors2.default.green(V);
18643
+ return t("green", F2);
18322
18644
  }
18323
18645
  };
18324
- var vt2 = (t) => {
18325
- switch (t) {
18646
+ var ye = (e) => {
18647
+ switch (e) {
18326
18648
  case "initial":
18327
18649
  case "active":
18328
- return import_picocolors2.default.cyan(d);
18650
+ return t("cyan", d2);
18329
18651
  case "cancel":
18330
- return import_picocolors2.default.red(d);
18652
+ return t("red", d2);
18331
18653
  case "error":
18332
- return import_picocolors2.default.yellow(d);
18654
+ return t("yellow", d2);
18333
18655
  case "submit":
18334
- return import_picocolors2.default.green(d);
18656
+ return t("green", d2);
18335
18657
  }
18336
18658
  };
18337
- var pe = (t) => t === 161 || t === 164 || t === 167 || t === 168 || t === 170 || t === 173 || t === 174 || t >= 176 && t <= 180 || t >= 182 && t <= 186 || t >= 188 && t <= 191 || t === 198 || t === 208 || t === 215 || t === 216 || t >= 222 && t <= 225 || t === 230 || t >= 232 && t <= 234 || t === 236 || t === 237 || t === 240 || t === 242 || t === 243 || t >= 247 && t <= 250 || t === 252 || t === 254 || t === 257 || t === 273 || t === 275 || t === 283 || t === 294 || t === 295 || t === 299 || t >= 305 && t <= 307 || t === 312 || t >= 319 && t <= 322 || t === 324 || t >= 328 && t <= 331 || t === 333 || t === 338 || t === 339 || t === 358 || t === 359 || t === 363 || t === 462 || t === 464 || t === 466 || t === 468 || t === 470 || t === 472 || t === 474 || t === 476 || t === 593 || t === 609 || t === 708 || t === 711 || t >= 713 && t <= 715 || t === 717 || t === 720 || t >= 728 && t <= 731 || t === 733 || t === 735 || t >= 768 && t <= 879 || t >= 913 && t <= 929 || t >= 931 && t <= 937 || t >= 945 && t <= 961 || t >= 963 && t <= 969 || t === 1025 || t >= 1040 && t <= 1103 || t === 1105 || t === 8208 || t >= 8211 && t <= 8214 || t === 8216 || t === 8217 || t === 8220 || t === 8221 || t >= 8224 && t <= 8226 || t >= 8228 && t <= 8231 || t === 8240 || t === 8242 || t === 8243 || t === 8245 || t === 8251 || t === 8254 || t === 8308 || t === 8319 || t >= 8321 && t <= 8324 || t === 8364 || t === 8451 || t === 8453 || t === 8457 || t === 8467 || t === 8470 || t === 8481 || t === 8482 || t === 8486 || t === 8491 || t === 8531 || t === 8532 || t >= 8539 && t <= 8542 || t >= 8544 && t <= 8555 || t >= 8560 && t <= 8569 || t === 8585 || t >= 8592 && t <= 8601 || t === 8632 || t === 8633 || t === 8658 || t === 8660 || t === 8679 || t === 8704 || t === 8706 || t === 8707 || t === 8711 || t === 8712 || t === 8715 || t === 8719 || t === 8721 || t === 8725 || t === 8730 || t >= 8733 && t <= 8736 || t === 8739 || t === 8741 || t >= 8743 && t <= 8748 || t === 8750 || t >= 8756 && t <= 8759 || t === 8764 || t === 8765 || t === 8776 || t === 8780 || t === 8786 || t === 8800 || t === 8801 || t >= 8804 && t <= 8807 || t === 8810 || t === 8811 || t === 8814 || t === 8815 || t === 8834 || t === 8835 || t === 8838 || t === 8839 || t === 8853 || t === 8857 || t === 8869 || t === 8895 || t === 8978 || t >= 9312 && t <= 9449 || t >= 9451 && t <= 9547 || t >= 9552 && t <= 9587 || t >= 9600 && t <= 9615 || t >= 9618 && t <= 9621 || t === 9632 || t === 9633 || t >= 9635 && t <= 9641 || t === 9650 || t === 9651 || t === 9654 || t === 9655 || t === 9660 || t === 9661 || t === 9664 || t === 9665 || t >= 9670 && t <= 9672 || t === 9675 || t >= 9678 && t <= 9681 || t >= 9698 && t <= 9701 || t === 9711 || t === 9733 || t === 9734 || t === 9737 || t === 9742 || t === 9743 || t === 9756 || t === 9758 || t === 9792 || t === 9794 || t === 9824 || t === 9825 || t >= 9827 && t <= 9829 || t >= 9831 && t <= 9834 || t === 9836 || t === 9837 || t === 9839 || t === 9886 || t === 9887 || t === 9919 || t >= 9926 && t <= 9933 || t >= 9935 && t <= 9939 || t >= 9941 && t <= 9953 || t === 9955 || t === 9960 || t === 9961 || t >= 9963 && t <= 9969 || t === 9972 || t >= 9974 && t <= 9977 || t === 9979 || t === 9980 || t === 9982 || t === 9983 || t === 10045 || t >= 10102 && t <= 10111 || t >= 11094 && t <= 11097 || t >= 12872 && t <= 12879 || t >= 57344 && t <= 63743 || t >= 65024 && t <= 65039 || t === 65533 || t >= 127232 && t <= 127242 || t >= 127248 && t <= 127277 || t >= 127280 && t <= 127337 || t >= 127344 && t <= 127373 || t === 127375 || t === 127376 || t >= 127387 && t <= 127404 || t >= 917760 && t <= 917999 || t >= 983040 && t <= 1048573 || t >= 1048576 && t <= 1114109;
18338
- var ge = (t) => t === 12288 || t >= 65281 && t <= 65376 || t >= 65504 && t <= 65510;
18339
- var fe = (t) => t >= 4352 && t <= 4447 || t === 8986 || t === 8987 || t === 9001 || t === 9002 || t >= 9193 && t <= 9196 || t === 9200 || t === 9203 || t === 9725 || t === 9726 || t === 9748 || t === 9749 || t >= 9800 && t <= 9811 || t === 9855 || t === 9875 || t === 9889 || t === 9898 || t === 9899 || t === 9917 || t === 9918 || t === 9924 || t === 9925 || t === 9934 || t === 9940 || t === 9962 || t === 9970 || t === 9971 || t === 9973 || t === 9978 || t === 9981 || t === 9989 || t === 9994 || t === 9995 || t === 10024 || t === 10060 || t === 10062 || t >= 10067 && t <= 10069 || t === 10071 || t >= 10133 && t <= 10135 || t === 10160 || t === 10175 || t === 11035 || t === 11036 || t === 11088 || t === 11093 || t >= 11904 && t <= 11929 || t >= 11931 && t <= 12019 || t >= 12032 && t <= 12245 || t >= 12272 && t <= 12287 || t >= 12289 && t <= 12350 || t >= 12353 && t <= 12438 || t >= 12441 && t <= 12543 || t >= 12549 && t <= 12591 || t >= 12593 && t <= 12686 || t >= 12688 && t <= 12771 || t >= 12783 && t <= 12830 || t >= 12832 && t <= 12871 || t >= 12880 && t <= 19903 || t >= 19968 && t <= 42124 || t >= 42128 && t <= 42182 || t >= 43360 && t <= 43388 || t >= 44032 && t <= 55203 || t >= 63744 && t <= 64255 || t >= 65040 && t <= 65049 || t >= 65072 && t <= 65106 || t >= 65108 && t <= 65126 || t >= 65128 && t <= 65131 || t >= 94176 && t <= 94180 || t === 94192 || t === 94193 || t >= 94208 && t <= 100343 || t >= 100352 && t <= 101589 || t >= 101632 && t <= 101640 || t >= 110576 && t <= 110579 || t >= 110581 && t <= 110587 || t === 110589 || t === 110590 || t >= 110592 && t <= 110882 || t === 110898 || t >= 110928 && t <= 110930 || t === 110933 || t >= 110948 && t <= 110951 || t >= 110960 && t <= 111355 || t === 126980 || t === 127183 || t === 127374 || t >= 127377 && t <= 127386 || t >= 127488 && t <= 127490 || t >= 127504 && t <= 127547 || t >= 127552 && t <= 127560 || t === 127568 || t === 127569 || t >= 127584 && t <= 127589 || t >= 127744 && t <= 127776 || t >= 127789 && t <= 127797 || t >= 127799 && t <= 127868 || t >= 127870 && t <= 127891 || t >= 127904 && t <= 127946 || t >= 127951 && t <= 127955 || t >= 127968 && t <= 127984 || t === 127988 || t >= 127992 && t <= 128062 || t === 128064 || t >= 128066 && t <= 128252 || t >= 128255 && t <= 128317 || t >= 128331 && t <= 128334 || t >= 128336 && t <= 128359 || t === 128378 || t === 128405 || t === 128406 || t === 128420 || t >= 128507 && t <= 128591 || t >= 128640 && t <= 128709 || t === 128716 || t >= 128720 && t <= 128722 || t >= 128725 && t <= 128727 || t >= 128732 && t <= 128735 || t === 128747 || t === 128748 || t >= 128756 && t <= 128764 || t >= 128992 && t <= 129003 || t === 129008 || t >= 129292 && t <= 129338 || t >= 129340 && t <= 129349 || t >= 129351 && t <= 129535 || t >= 129648 && t <= 129660 || t >= 129664 && t <= 129672 || t >= 129680 && t <= 129725 || t >= 129727 && t <= 129733 || t >= 129742 && t <= 129755 || t >= 129760 && t <= 129768 || t >= 129776 && t <= 129784 || t >= 131072 && t <= 196605 || t >= 196608 && t <= 262141;
18340
- var At2 = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;
18341
- var it2 = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
18342
- var nt2 = /\t{1,1000}/y;
18343
- var wt2 = /[\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;
18344
- var at2 = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
18345
- var Fe = /\p{M}+/gu;
18346
- var ye = { limit: 1 / 0, ellipsis: "" };
18347
- var jt = (t, r = {}, s = {}) => {
18348
- const i = r.limit ?? 1 / 0, a = r.ellipsis ?? "", o = r?.ellipsisWidth ?? (a ? jt(a, ye, s).width : 0), u = s.ansiWidth ?? 0, l = s.controlWidth ?? 0, n = s.tabWidth ?? 8, c = s.ambiguousWidth ?? 1, g = s.emojiWidth ?? 2, F = s.fullWidthWidth ?? 2, p = s.regularWidth ?? 1, E = s.wideWidth ?? 2;
18349
- let $2 = 0, m = 0, h = t.length, y2 = 0, f = false, v = h, S2 = Math.max(0, i - o), I2 = 0, B2 = 0, A = 0, w = 0;
18350
- t:
18351
- for (;; ) {
18352
- if (B2 > I2 || m >= h && m > $2) {
18353
- const _2 = t.slice(I2, B2) || t.slice($2, m);
18354
- y2 = 0;
18355
- for (const D2 of _2.replaceAll(Fe, "")) {
18356
- const T2 = D2.codePointAt(0) || 0;
18357
- if (ge(T2) ? w = F : fe(T2) ? w = E : c !== p && pe(T2) ? w = c : w = p, A + w > S2 && (v = Math.min(v, Math.max(I2, $2) + y2)), A + w > i) {
18358
- f = true;
18359
- break t;
18360
- }
18361
- y2 += D2.length, A += w;
18362
- }
18363
- I2 = B2 = 0;
18364
- }
18365
- if (m >= h)
18366
- break;
18367
- if (at2.lastIndex = m, at2.test(t)) {
18368
- if (y2 = at2.lastIndex - m, w = y2 * p, A + w > S2 && (v = Math.min(v, m + Math.floor((S2 - A) / p))), A + w > i) {
18369
- f = true;
18370
- break;
18371
- }
18372
- A += w, I2 = $2, B2 = m, m = $2 = at2.lastIndex;
18373
- continue;
18374
- }
18375
- if (At2.lastIndex = m, At2.test(t)) {
18376
- if (A + u > S2 && (v = Math.min(v, m)), A + u > i) {
18377
- f = true;
18378
- break;
18379
- }
18380
- A += u, I2 = $2, B2 = m, m = $2 = At2.lastIndex;
18381
- continue;
18382
- }
18383
- if (it2.lastIndex = m, it2.test(t)) {
18384
- if (y2 = it2.lastIndex - m, w = y2 * l, A + w > S2 && (v = Math.min(v, m + Math.floor((S2 - A) / l))), A + w > i) {
18385
- f = true;
18386
- break;
18387
- }
18388
- A += w, I2 = $2, B2 = m, m = $2 = it2.lastIndex;
18389
- continue;
18390
- }
18391
- if (nt2.lastIndex = m, nt2.test(t)) {
18392
- if (y2 = nt2.lastIndex - m, w = y2 * n, A + w > S2 && (v = Math.min(v, m + Math.floor((S2 - A) / n))), A + w > i) {
18393
- f = true;
18394
- break;
18395
- }
18396
- A += w, I2 = $2, B2 = m, m = $2 = nt2.lastIndex;
18397
- continue;
18398
- }
18399
- if (wt2.lastIndex = m, wt2.test(t)) {
18400
- if (A + g > S2 && (v = Math.min(v, m)), A + g > i) {
18401
- f = true;
18402
- break;
18403
- }
18404
- A += g, I2 = $2, B2 = m, m = $2 = wt2.lastIndex;
18405
- continue;
18406
- }
18407
- m += 1;
18408
- }
18409
- return { width: f ? S2 : A, index: f ? v : h, truncated: f, ellipsed: f && i >= o };
18410
- };
18411
- var Ee = { limit: 1 / 0, ellipsis: "", ellipsisWidth: 0 };
18412
- var M2 = (t, r = {}) => jt(t, Ee, r).width;
18413
- var ot2 = "\x1B";
18414
- var Gt = "›";
18415
- var ve = 39;
18416
- var Ct2 = "\x07";
18417
- var kt2 = "[";
18418
- var Ae = "]";
18419
- var Vt2 = "m";
18420
- var St2 = `${Ae}8;;`;
18421
- var Ht = new RegExp(`(?:\\${kt2}(?<code>\\d+)m|\\${St2}(?<uri>.*)${Ct2})`, "y");
18422
- var we = (t) => {
18423
- if (t >= 30 && t <= 37 || t >= 90 && t <= 97)
18424
- return 39;
18425
- if (t >= 40 && t <= 47 || t >= 100 && t <= 107)
18426
- return 49;
18427
- if (t === 1 || t === 2)
18428
- return 22;
18429
- if (t === 3)
18430
- return 23;
18431
- if (t === 4)
18432
- return 24;
18433
- if (t === 7)
18434
- return 27;
18435
- if (t === 8)
18436
- return 28;
18437
- if (t === 9)
18438
- return 29;
18439
- if (t === 0)
18440
- return 0;
18441
- };
18442
- var Ut = (t) => `${ot2}${kt2}${t}${Vt2}`;
18443
- var Kt = (t) => `${ot2}${St2}${t}${Ct2}`;
18444
- var Ce = (t) => t.map((r) => M2(r));
18445
- var It2 = (t, r, s) => {
18446
- const i = r[Symbol.iterator]();
18447
- let a = false, o = false, u = t.at(-1), l = u === undefined ? 0 : M2(u), n = i.next(), c = i.next(), g = 0;
18448
- for (;!n.done; ) {
18449
- const F = n.value, p = M2(F);
18450
- l + p <= s ? t[t.length - 1] += F : (t.push(F), l = 0), (F === ot2 || F === Gt) && (a = true, o = r.startsWith(St2, g + 1)), a ? o ? F === Ct2 && (a = false, o = false) : F === Vt2 && (a = false) : (l += p, l === s && !c.done && (t.push(""), l = 0)), n = c, c = i.next(), g += F.length;
18451
- }
18452
- u = t.at(-1), !l && u !== undefined && u.length > 0 && t.length > 1 && (t[t.length - 2] += t.pop());
18453
- };
18454
- var Se = (t) => {
18455
- const r = t.split(" ");
18456
- let s = r.length;
18457
- for (;s > 0 && !(M2(r[s - 1]) > 0); )
18458
- s--;
18459
- return s === r.length ? t : r.slice(0, s).join(" ") + r.slice(s).join("");
18460
- };
18461
- var Ie = (t, r, s = {}) => {
18462
- if (s.trim !== false && t.trim() === "")
18463
- return "";
18464
- let i = "", a, o;
18465
- const u = t.split(" "), l = Ce(u);
18466
- let n = [""];
18467
- for (const [$2, m] of u.entries()) {
18468
- s.trim !== false && (n[n.length - 1] = (n.at(-1) ?? "").trimStart());
18469
- let h = M2(n.at(-1) ?? "");
18470
- if ($2 !== 0 && (h >= r && (s.wordWrap === false || s.trim === false) && (n.push(""), h = 0), (h > 0 || s.trim === false) && (n[n.length - 1] += " ", h++)), s.hard && l[$2] > r) {
18471
- const y2 = r - h, f = 1 + Math.floor((l[$2] - y2 - 1) / r);
18472
- Math.floor((l[$2] - 1) / r) < f && n.push(""), It2(n, m, r);
18473
- continue;
18474
- }
18475
- if (h + l[$2] > r && h > 0 && l[$2] > 0) {
18476
- if (s.wordWrap === false && h < r) {
18477
- It2(n, m, r);
18478
- continue;
18479
- }
18480
- n.push("");
18481
- }
18482
- if (h + l[$2] > r && s.wordWrap === false) {
18483
- It2(n, m, r);
18484
- continue;
18485
- }
18486
- n[n.length - 1] += m;
18487
- }
18488
- s.trim !== false && (n = n.map(($2) => Se($2)));
18489
- const c = n.join(`
18490
- `), g = c[Symbol.iterator]();
18491
- let F = g.next(), p = g.next(), E = 0;
18492
- for (;!F.done; ) {
18493
- const $2 = F.value, m = p.value;
18494
- if (i += $2, $2 === ot2 || $2 === Gt) {
18495
- Ht.lastIndex = E + 1;
18496
- const f = Ht.exec(c)?.groups;
18497
- if (f?.code !== undefined) {
18498
- const v = Number.parseFloat(f.code);
18499
- a = v === ve ? undefined : v;
18500
- } else
18501
- f?.uri !== undefined && (o = f.uri.length === 0 ? undefined : f.uri);
18502
- }
18503
- const h = a ? we(a) : undefined;
18504
- m === `
18505
- ` ? (o && (i += Kt("")), a && h && (i += Ut(h))) : $2 === `
18506
- ` && (a && h && (i += Ut(a)), o && (i += Kt(o))), E += $2.length, F = p, p = g.next();
18507
- }
18508
- return i;
18509
- };
18510
- function J(t, r, s) {
18511
- return String(t).normalize().replaceAll(`\r
18512
- `, `
18513
- `).split(`
18514
- `).map((i) => Ie(i, r, s)).join(`
18515
- `);
18516
- }
18517
- var be = (t, r, s, i, a) => {
18518
- let o = r, u = 0;
18519
- for (let l = s;l < i; l++) {
18520
- const n = t[l];
18521
- if (o = o - n.length, u++, o <= a)
18659
+ var et2 = (e, i, s, r, u2) => {
18660
+ let n = i, o = 0;
18661
+ for (let c2 = s;c2 < r; c2++) {
18662
+ const a = e[c2];
18663
+ if (n = n - a.length, o++, n <= u2)
18522
18664
  break;
18523
18665
  }
18524
- return { lineCount: o, removals: u };
18666
+ return { lineCount: n, removals: o };
18525
18667
  };
18526
- var X2 = (t) => {
18527
- const { cursor: r, options: s, style: i } = t, a = t.output ?? process.stdout, o = rt(a), u = t.columnPadding ?? 0, l = t.rowPadding ?? 4, n = o - u, c = nt(a), g = import_picocolors2.default.dim("..."), F = t.maxItems ?? Number.POSITIVE_INFINITY, p = Math.max(c - l, 0), E = Math.max(Math.min(F, p), 5);
18528
- let $2 = 0;
18529
- r >= E - 3 && ($2 = Math.max(Math.min(r - E + 3, s.length - E), 0));
18530
- let m = E < s.length && $2 > 0, h = E < s.length && $2 + E < s.length;
18531
- const y2 = Math.min($2 + E, s.length), f = [];
18532
- let v = 0;
18533
- m && v++, h && v++;
18534
- const S2 = $2 + (m ? 1 : 0), I2 = y2 - (h ? 1 : 0);
18535
- for (let A = S2;A < I2; A++) {
18536
- const w = J(i(s[A], A === r), n, { hard: true, trim: false }).split(`
18668
+ var Y2 = ({ cursor: e, options: i, style: s, output: r = process.stdout, maxItems: u2 = Number.POSITIVE_INFINITY, columnPadding: n = 0, rowPadding: o = 4 }) => {
18669
+ const c2 = O(r) - n, a = A(r), l = t("dim", "..."), $3 = Math.max(a - o, 0), y2 = Math.max(Math.min(u2, $3), 5);
18670
+ let p2 = 0;
18671
+ e >= y2 - 3 && (p2 = Math.max(Math.min(e - y2 + 3, i.length - y2), 0));
18672
+ let m = y2 < i.length && p2 > 0, g = y2 < i.length && p2 + y2 < i.length;
18673
+ const S2 = Math.min(p2 + y2, i.length), h = [];
18674
+ let f = 0;
18675
+ m && f++, g && f++;
18676
+ const v = p2 + (m ? 1 : 0), T2 = S2 - (g ? 1 : 0);
18677
+ for (let b = v;b < T2; b++) {
18678
+ const x = wrapAnsi(s(i[b], b === e), c2, { hard: true, trim: false }).split(`
18537
18679
  `);
18538
- f.push(w), v += w.length;
18539
- }
18540
- if (v > p) {
18541
- let A = 0, w = 0, _2 = v;
18542
- const D2 = r - S2, T2 = (Y, L2) => be(f, _2, Y, L2, p);
18543
- m ? ({ lineCount: _2, removals: A } = T2(0, D2), _2 > p && ({ lineCount: _2, removals: w } = T2(D2 + 1, f.length))) : ({ lineCount: _2, removals: w } = T2(D2 + 1, f.length), _2 > p && ({ lineCount: _2, removals: A } = T2(0, D2))), A > 0 && (m = true, f.splice(0, A)), w > 0 && (h = true, f.splice(f.length - w, w));
18544
- }
18545
- const B2 = [];
18546
- m && B2.push(g);
18547
- for (const A of f)
18548
- for (const w of A)
18549
- B2.push(w);
18550
- return h && B2.push(g), B2;
18680
+ h.push(x), f += x.length;
18681
+ }
18682
+ if (f > $3) {
18683
+ let b = 0, x = 0, G2 = f;
18684
+ const M2 = e - v, R2 = (j2, D) => et2(h, G2, j2, D, $3);
18685
+ m ? ({ lineCount: G2, removals: b } = R2(0, M2), G2 > $3 && ({ lineCount: G2, removals: x } = R2(M2 + 1, h.length))) : ({ lineCount: G2, removals: x } = R2(M2 + 1, h.length), G2 > $3 && ({ 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));
18686
+ }
18687
+ const C2 = [];
18688
+ m && C2.push(l);
18689
+ for (const b of h)
18690
+ for (const x of b)
18691
+ C2.push(x);
18692
+ return g && C2.push(l), C2;
18551
18693
  };
18552
- var Re = (t) => {
18553
- const r = t.active ?? "Yes", s = t.inactive ?? "No";
18554
- return new kt({ active: r, inactive: s, signal: t.signal, input: t.input, output: t.output, initialValue: t.initialValue ?? true, render() {
18555
- const i = t.withGuide ?? _.withGuide, a = `${i ? `${import_picocolors2.default.gray(d)}
18556
- ` : ""}${W2(this.state)} ${t.message}
18557
- `, o = this.value ? r : s;
18694
+ var ot2 = (e) => {
18695
+ const i = e.active ?? "Yes", s = e.inactive ?? "No";
18696
+ return new Q({ active: i, inactive: s, signal: e.signal, input: e.input, output: e.output, initialValue: e.initialValue ?? true, render() {
18697
+ const r = e.withGuide ?? u.withGuide, u2 = `${V2(this.state)} `, n = r ? `${t("gray", d2)} ` : "", o = R(e.output, e.message, n, u2), c2 = `${r ? `${t("gray", d2)}
18698
+ ` : ""}${o}
18699
+ `, a = this.value ? i : s;
18558
18700
  switch (this.state) {
18559
18701
  case "submit": {
18560
- const u = i ? `${import_picocolors2.default.gray(d)} ` : "";
18561
- return `${a}${u}${import_picocolors2.default.dim(o)}`;
18702
+ const l = r ? `${t("gray", d2)} ` : "";
18703
+ return `${c2}${l}${t("dim", a)}`;
18562
18704
  }
18563
18705
  case "cancel": {
18564
- const u = i ? `${import_picocolors2.default.gray(d)} ` : "";
18565
- return `${a}${u}${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(o))}${i ? `
18566
- ${import_picocolors2.default.gray(d)}` : ""}`;
18706
+ const l = r ? `${t("gray", d2)} ` : "";
18707
+ return `${c2}${l}${t(["strikethrough", "dim"], a)}${r ? `
18708
+ ${t("gray", d2)}` : ""}`;
18567
18709
  }
18568
18710
  default: {
18569
- const u = i ? `${import_picocolors2.default.cyan(d)} ` : "", l = i ? import_picocolors2.default.cyan(x2) : "";
18570
- return `${a}${u}${this.value ? `${import_picocolors2.default.green(Q2)} ${r}` : `${import_picocolors2.default.dim(H2)} ${import_picocolors2.default.dim(r)}`}${t.vertical ? i ? `
18571
- ${import_picocolors2.default.cyan(d)} ` : `
18572
- ` : ` ${import_picocolors2.default.dim("/")} `}${this.value ? `${import_picocolors2.default.dim(H2)} ${import_picocolors2.default.dim(s)}` : `${import_picocolors2.default.green(Q2)} ${s}`}
18573
- ${l}
18711
+ const l = r ? `${t("cyan", d2)} ` : "", $3 = r ? t("cyan", E2) : "";
18712
+ return `${c2}${l}${this.value ? `${t("green", z3)} ${i}` : `${t("dim", H2)} ${t("dim", i)}`}${e.vertical ? r ? `
18713
+ ${t("cyan", d2)} ` : `
18714
+ ` : ` ${t("dim", "/")} `}${this.value ? `${t("dim", H2)} ${t("dim", s)}` : `${t("green", z3)} ${s}`}
18715
+ ${$3}
18574
18716
  `;
18575
18717
  }
18576
18718
  }
18577
18719
  } }).prompt();
18578
18720
  };
18579
- var Ne = (t = "", r) => {
18580
- (r?.output ?? process.stdout).write(`${import_picocolors2.default.gray(x2)} ${import_picocolors2.default.red(t)}
18721
+ var pt = (e = "", i) => {
18722
+ const s = i?.output ?? process.stdout, r = i?.withGuide ?? u.withGuide ? `${t("gray", E2)} ` : "";
18723
+ s.write(`${r}${t("red", e)}
18581
18724
 
18582
18725
  `);
18583
18726
  };
18584
- var We = (t = "", r) => {
18585
- (r?.output ?? process.stdout).write(`${import_picocolors2.default.gray(ht2)} ${t}
18727
+ var mt = (e = "", i) => {
18728
+ const s = i?.output ?? process.stdout, r = i?.withGuide ?? u.withGuide ? `${t("gray", le)} ` : "";
18729
+ s.write(`${r}${e}
18586
18730
  `);
18587
18731
  };
18588
- var Le = (t = "", r) => {
18589
- (r?.output ?? process.stdout).write(`${import_picocolors2.default.gray(d)}
18590
- ${import_picocolors2.default.gray(x2)} ${t}
18732
+ var gt = (e = "", i) => {
18733
+ const s = i?.output ?? process.stdout, r = i?.withGuide ?? u.withGuide ? `${t("gray", d2)}
18734
+ ${t("gray", E2)} ` : "";
18735
+ s.write(`${r}${e}
18591
18736
 
18592
18737
  `);
18593
18738
  };
18594
- var Z2 = (t, r) => t.split(`
18595
- `).map((s) => r(s)).join(`
18739
+ var Q2 = (e, i) => e.split(`
18740
+ `).map((s) => i(s)).join(`
18596
18741
  `);
18597
- var je = (t) => {
18598
- const r = (i, a) => {
18599
- const o = i.label ?? String(i.value);
18600
- return a === "disabled" ? `${import_picocolors2.default.gray(q2)} ${Z2(o, (u) => import_picocolors2.default.strikethrough(import_picocolors2.default.gray(u)))}${i.hint ? ` ${import_picocolors2.default.dim(`(${i.hint ?? "disabled"})`)}` : ""}` : a === "active" ? `${import_picocolors2.default.cyan(st2)} ${o}${i.hint ? ` ${import_picocolors2.default.dim(`(${i.hint})`)}` : ""}` : a === "selected" ? `${import_picocolors2.default.green(U2)} ${Z2(o, import_picocolors2.default.dim)}${i.hint ? ` ${import_picocolors2.default.dim(`(${i.hint})`)}` : ""}` : a === "cancelled" ? `${Z2(o, (u) => import_picocolors2.default.strikethrough(import_picocolors2.default.dim(u)))}` : a === "active-selected" ? `${import_picocolors2.default.green(U2)} ${o}${i.hint ? ` ${import_picocolors2.default.dim(`(${i.hint})`)}` : ""}` : a === "submitted" ? `${Z2(o, import_picocolors2.default.dim)}` : `${import_picocolors2.default.dim(q2)} ${Z2(o, import_picocolors2.default.dim)}`;
18601
- }, s = t.required ?? true;
18602
- return new Lt({ options: t.options, signal: t.signal, input: t.input, output: t.output, initialValues: t.initialValues, required: s, cursorAt: t.cursorAt, validate(i) {
18603
- if (s && (i === undefined || i.length === 0))
18742
+ var yt = (e) => {
18743
+ const i = (r, u2) => {
18744
+ const n = r.label ?? String(r.value);
18745
+ return u2 === "disabled" ? `${t("gray", J2)} ${Q2(n, (o) => t(["strikethrough", "gray"], o))}${r.hint ? ` ${t("dim", `(${r.hint ?? "disabled"})`)}` : ""}` : u2 === "active" ? `${t("cyan", te)} ${n}${r.hint ? ` ${t("dim", `(${r.hint})`)}` : ""}` : u2 === "selected" ? `${t("green", U)} ${Q2(n, (o) => t("dim", o))}${r.hint ? ` ${t("dim", `(${r.hint})`)}` : ""}` : u2 === "cancelled" ? `${Q2(n, (o) => t(["strikethrough", "dim"], o))}` : u2 === "active-selected" ? `${t("green", U)} ${n}${r.hint ? ` ${t("dim", `(${r.hint})`)}` : ""}` : u2 === "submitted" ? `${Q2(n, (o) => t("dim", o))}` : `${t("dim", J2)} ${Q2(n, (o) => t("dim", o))}`;
18746
+ }, s = e.required ?? true;
18747
+ return new it({ options: e.options, signal: e.signal, input: e.input, output: e.output, initialValues: e.initialValues, required: s, cursorAt: e.cursorAt, validate(r) {
18748
+ if (s && (r === undefined || r.length === 0))
18604
18749
  return `Please select at least one option.
18605
- ${import_picocolors2.default.reset(import_picocolors2.default.dim(`Press ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" space ")))} to select, ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" enter ")))} to submit`))}`;
18750
+ ${t("reset", t("dim", `Press ${t(["gray", "bgWhite", "inverse"], " space ")} to select, ${t("gray", t("bgWhite", t("inverse", " enter ")))} to submit`))}`;
18606
18751
  }, render() {
18607
- const i = xt(t.output, t.message, `${vt2(this.state)} `, `${W2(this.state)} `), a = `${import_picocolors2.default.gray(d)}
18608
- ${i}
18609
- `, o = this.value ?? [], u = (l, n) => {
18610
- if (l.disabled)
18611
- return r(l, "disabled");
18612
- const c = o.includes(l.value);
18613
- return n && c ? r(l, "active-selected") : c ? r(l, "selected") : r(l, n ? "active" : "inactive");
18752
+ const r = e.withGuide ?? u.withGuide, u2 = R(e.output, e.message, r ? `${ye(this.state)} ` : "", `${V2(this.state)} `), n = `${r ? `${t("gray", d2)}
18753
+ ` : ""}${u2}
18754
+ `, o = this.value ?? [], c2 = (a, l) => {
18755
+ if (a.disabled)
18756
+ return i(a, "disabled");
18757
+ const $3 = o.includes(a.value);
18758
+ return l && $3 ? i(a, "active-selected") : $3 ? i(a, "selected") : i(a, l ? "active" : "inactive");
18614
18759
  };
18615
18760
  switch (this.state) {
18616
18761
  case "submit": {
18617
- const l = this.options.filter(({ value: c }) => o.includes(c)).map((c) => r(c, "submitted")).join(import_picocolors2.default.dim(", ")) || import_picocolors2.default.dim("none"), n = xt(t.output, l, `${import_picocolors2.default.gray(d)} `);
18618
- return `${a}${n}`;
18762
+ const a = this.options.filter(({ value: $3 }) => o.includes($3)).map(($3) => i($3, "submitted")).join(t("dim", ", ")) || t("dim", "none"), l = R(e.output, a, r ? `${t("gray", d2)} ` : "");
18763
+ return `${n}${l}`;
18619
18764
  }
18620
18765
  case "cancel": {
18621
- const l = this.options.filter(({ value: c }) => o.includes(c)).map((c) => r(c, "cancelled")).join(import_picocolors2.default.dim(", "));
18622
- if (l.trim() === "")
18623
- return `${a}${import_picocolors2.default.gray(d)}`;
18624
- const n = xt(t.output, l, `${import_picocolors2.default.gray(d)} `);
18625
- return `${a}${n}
18626
- ${import_picocolors2.default.gray(d)}`;
18766
+ const a = this.options.filter(({ value: $3 }) => o.includes($3)).map(($3) => i($3, "cancelled")).join(t("dim", ", "));
18767
+ if (a.trim() === "")
18768
+ return `${n}${t("gray", d2)}`;
18769
+ const l = R(e.output, a, r ? `${t("gray", d2)} ` : "");
18770
+ return `${n}${l}${r ? `
18771
+ ${t("gray", d2)}` : ""}`;
18627
18772
  }
18628
18773
  case "error": {
18629
- const l = `${import_picocolors2.default.yellow(d)} `, n = this.error.split(`
18630
- `).map((F, p) => p === 0 ? `${import_picocolors2.default.yellow(x2)} ${import_picocolors2.default.yellow(F)}` : ` ${F}`).join(`
18631
- `), c = a.split(`
18632
- `).length, g = n.split(`
18774
+ const a = r ? `${t("yellow", d2)} ` : "", l = this.error.split(`
18775
+ `).map((p2, m) => m === 0 ? `${r ? `${t("yellow", E2)} ` : ""}${t("yellow", p2)}` : ` ${p2}`).join(`
18776
+ `), $3 = n.split(`
18777
+ `).length, y2 = l.split(`
18633
18778
  `).length + 1;
18634
- return `${a}${l}${X2({ output: t.output, options: this.options, cursor: this.cursor, maxItems: t.maxItems, columnPadding: l.length, rowPadding: c + g, style: u }).join(`
18635
- ${l}`)}
18636
- ${n}
18779
+ return `${n}${a}${Y2({ output: e.output, options: this.options, cursor: this.cursor, maxItems: e.maxItems, columnPadding: a.length, rowPadding: $3 + y2, style: c2 }).join(`
18780
+ ${a}`)}
18781
+ ${l}
18637
18782
  `;
18638
18783
  }
18639
18784
  default: {
18640
- const l = `${import_picocolors2.default.cyan(d)} `, n = a.split(`
18641
- `).length;
18642
- return `${a}${l}${X2({ output: t.output, options: this.options, cursor: this.cursor, maxItems: t.maxItems, columnPadding: l.length, rowPadding: n + 2, style: u }).join(`
18643
- ${l}`)}
18644
- ${import_picocolors2.default.cyan(x2)}
18785
+ const a = r ? `${t("cyan", d2)} ` : "", l = n.split(`
18786
+ `).length, $3 = r ? 2 : 1;
18787
+ return `${n}${a}${Y2({ output: e.output, options: this.options, cursor: this.cursor, maxItems: e.maxItems, columnPadding: a.length, rowPadding: l + $3, style: c2 }).join(`
18788
+ ${a}`)}
18789
+ ${r ? t("cyan", E2) : ""}
18645
18790
  `;
18646
18791
  }
18647
18792
  }
18648
18793
  } }).prompt();
18649
18794
  };
18650
- var Ke = import_picocolors2.default.magenta;
18651
- var zt = { light: C("─", "-"), heavy: C("━", "="), block: C("█", "#") };
18652
- var lt2 = (t, r) => t.includes(`
18653
- `) ? t.split(`
18654
- `).map((s) => r(s)).join(`
18655
- `) : r(t);
18656
- var Je = (t) => {
18657
- const r = (s, i) => {
18658
- const a = s.label ?? String(s.value);
18659
- switch (i) {
18795
+ var Ve = { light: w2("─", "-"), heavy: w2("━", "="), block: w2("█", "#") };
18796
+ var re = (e, i) => e.includes(`
18797
+ `) ? e.split(`
18798
+ `).map((s) => i(s)).join(`
18799
+ `) : i(e);
18800
+ var _t = (e) => {
18801
+ const i = (s, r) => {
18802
+ const u2 = s.label ?? String(s.value);
18803
+ switch (r) {
18660
18804
  case "disabled":
18661
- return `${import_picocolors2.default.gray(H2)} ${lt2(a, import_picocolors2.default.gray)}${s.hint ? ` ${import_picocolors2.default.dim(`(${s.hint ?? "disabled"})`)}` : ""}`;
18805
+ return `${t("gray", H2)} ${re(u2, (n) => t("gray", n))}${s.hint ? ` ${t("dim", `(${s.hint ?? "disabled"})`)}` : ""}`;
18662
18806
  case "selected":
18663
- return `${lt2(a, import_picocolors2.default.dim)}`;
18807
+ return `${re(u2, (n) => t("dim", n))}`;
18664
18808
  case "active":
18665
- return `${import_picocolors2.default.green(Q2)} ${a}${s.hint ? ` ${import_picocolors2.default.dim(`(${s.hint})`)}` : ""}`;
18809
+ return `${t("green", z3)} ${u2}${s.hint ? ` ${t("dim", `(${s.hint})`)}` : ""}`;
18666
18810
  case "cancelled":
18667
- return `${lt2(a, (o) => import_picocolors2.default.strikethrough(import_picocolors2.default.dim(o)))}`;
18811
+ return `${re(u2, (n) => t(["strikethrough", "dim"], n))}`;
18668
18812
  default:
18669
- return `${import_picocolors2.default.dim(H2)} ${lt2(a, import_picocolors2.default.dim)}`;
18813
+ return `${t("dim", H2)} ${re(u2, (n) => t("dim", n))}`;
18670
18814
  }
18671
18815
  };
18672
- return new Wt({ options: t.options, signal: t.signal, input: t.input, output: t.output, initialValue: t.initialValue, render() {
18673
- const s = t.withGuide ?? _.withGuide, i = `${W2(this.state)} `, a = `${vt2(this.state)} `, o = xt(t.output, t.message, a, i), u = `${s ? `${import_picocolors2.default.gray(d)}
18674
- ` : ""}${o}
18816
+ return new nt({ options: e.options, signal: e.signal, input: e.input, output: e.output, initialValue: e.initialValue, render() {
18817
+ 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)}
18818
+ ` : ""}${n}
18675
18819
  `;
18676
18820
  switch (this.state) {
18677
18821
  case "submit": {
18678
- const l = s ? `${import_picocolors2.default.gray(d)} ` : "", n = xt(t.output, r(this.options[this.cursor], "selected"), l);
18679
- return `${u}${n}`;
18822
+ const c2 = s ? `${t("gray", d2)} ` : "", a = R(e.output, i(this.options[this.cursor], "selected"), c2);
18823
+ return `${o}${a}`;
18680
18824
  }
18681
18825
  case "cancel": {
18682
- const l = s ? `${import_picocolors2.default.gray(d)} ` : "", n = xt(t.output, r(this.options[this.cursor], "cancelled"), l);
18683
- return `${u}${n}${s ? `
18684
- ${import_picocolors2.default.gray(d)}` : ""}`;
18826
+ const c2 = s ? `${t("gray", d2)} ` : "", a = R(e.output, i(this.options[this.cursor], "cancelled"), c2);
18827
+ return `${o}${a}${s ? `
18828
+ ${t("gray", d2)}` : ""}`;
18685
18829
  }
18686
18830
  default: {
18687
- const l = s ? `${import_picocolors2.default.cyan(d)} ` : "", n = s ? import_picocolors2.default.cyan(x2) : "", c = u.split(`
18688
- `).length, g = s ? 2 : 1;
18689
- return `${u}${l}${X2({ output: t.output, cursor: this.cursor, options: this.options, maxItems: t.maxItems, columnPadding: l.length, rowPadding: c + g, style: (F, p) => r(F, F.disabled ? "disabled" : p ? "active" : "inactive") }).join(`
18690
- ${l}`)}
18691
- ${n}
18831
+ const c2 = s ? `${t("cyan", d2)} ` : "", a = s ? t("cyan", E2) : "", l = o.split(`
18832
+ `).length, $3 = s ? 2 : 1;
18833
+ return `${o}${c2}${Y2({ output: e.output, cursor: this.cursor, options: this.options, maxItems: e.maxItems, columnPadding: c2.length, rowPadding: l + $3, style: (y2, p2) => i(y2, y2.disabled ? "disabled" : p2 ? "active" : "inactive") }).join(`
18834
+ ${c2}`)}
18835
+ ${a}
18692
18836
  `;
18693
18837
  }
18694
18838
  }
18695
18839
  } }).prompt();
18696
18840
  };
18697
- var Qt = `${import_picocolors2.default.gray(d)} `;
18698
- var Ze = (t) => new $t({ validate: t.validate, placeholder: t.placeholder, defaultValue: t.defaultValue, initialValue: t.initialValue, output: t.output, signal: t.signal, input: t.input, render() {
18699
- const r = t?.withGuide ?? _.withGuide, s = `${`${r ? `${import_picocolors2.default.gray(d)}
18700
- ` : ""}${W2(this.state)} `}${t.message}
18701
- `, i = t.placeholder ? import_picocolors2.default.inverse(t.placeholder[0]) + import_picocolors2.default.dim(t.placeholder.slice(1)) : import_picocolors2.default.inverse(import_picocolors2.default.hidden("_")), a = this.userInput ? this.userInputWithCursor : i, o = this.value ?? "";
18841
+ var je = `${t("gray", d2)} `;
18842
+ var Ot = (e) => new at({ validate: e.validate, placeholder: e.placeholder, defaultValue: e.defaultValue, initialValue: e.initialValue, output: e.output, signal: e.signal, input: e.input, render() {
18843
+ const i = e?.withGuide ?? u.withGuide, s = `${`${i ? `${t("gray", d2)}
18844
+ ` : ""}${V2(this.state)} `}${e.message}
18845
+ `, r = e.placeholder ? t("inverse", e.placeholder[0]) + t("dim", e.placeholder.slice(1)) : t(["inverse", "hidden"], "_"), u2 = this.userInput ? this.userInputWithCursor : r, n = this.value ?? "";
18702
18846
  switch (this.state) {
18703
18847
  case "error": {
18704
- const u = this.error ? ` ${import_picocolors2.default.yellow(this.error)}` : "", l = r ? `${import_picocolors2.default.yellow(d)} ` : "", n = r ? import_picocolors2.default.yellow(x2) : "";
18848
+ const o = this.error ? ` ${t("yellow", this.error)}` : "", c2 = i ? `${t("yellow", d2)} ` : "", a = i ? t("yellow", E2) : "";
18705
18849
  return `${s.trim()}
18706
- ${l}${a}
18707
- ${n}${u}
18850
+ ${c2}${u2}
18851
+ ${a}${o}
18708
18852
  `;
18709
18853
  }
18710
18854
  case "submit": {
18711
- const u = o ? ` ${import_picocolors2.default.dim(o)}` : "", l = r ? import_picocolors2.default.gray(d) : "";
18712
- return `${s}${l}${u}`;
18855
+ const o = n ? ` ${t("dim", n)}` : "", c2 = i ? t("gray", d2) : "";
18856
+ return `${s}${c2}${o}`;
18713
18857
  }
18714
18858
  case "cancel": {
18715
- const u = o ? ` ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(o))}` : "", l = r ? import_picocolors2.default.gray(d) : "";
18716
- return `${s}${l}${u}${o.trim() ? `
18717
- ${l}` : ""}`;
18859
+ const o = n ? ` ${t(["strikethrough", "dim"], n)}` : "", c2 = i ? t("gray", d2) : "";
18860
+ return `${s}${c2}${o}${n.trim() ? `
18861
+ ${c2}` : ""}`;
18718
18862
  }
18719
18863
  default: {
18720
- const u = r ? `${import_picocolors2.default.cyan(d)} ` : "", l = r ? import_picocolors2.default.cyan(x2) : "";
18721
- return `${s}${u}${a}
18722
- ${l}
18864
+ const o = i ? `${t("cyan", d2)} ` : "", c2 = i ? t("cyan", E2) : "";
18865
+ return `${s}${o}${u2}
18866
+ ${c2}
18723
18867
  `;
18724
18868
  }
18725
18869
  }
@@ -19066,6 +19210,11 @@ var authenticationConfigSchema = exports_external.object({
19066
19210
  github: true,
19067
19211
  vercel: false
19068
19212
  });
19213
+ var desktopAppConfigSchema = exports_external.object({
19214
+ enabled: exports_external.boolean().describe("Enable Electron desktop auth/runtime integration")
19215
+ }).default({
19216
+ enabled: false
19217
+ });
19069
19218
  var configSchema = exports_external.object({
19070
19219
  appPrefix: exports_external.string().default("chatjs"),
19071
19220
  appName: exports_external.string().default("My AI Chat"),
@@ -19119,6 +19268,7 @@ var configSchema = exports_external.object({
19119
19268
  terms: { title: "Terms of Service" }
19120
19269
  }),
19121
19270
  authentication: authenticationConfigSchema,
19271
+ desktopApp: desktopAppConfigSchema,
19122
19272
  ai: aiConfigSchema,
19123
19273
  anonymous: anonymousConfigSchema,
19124
19274
  attachments: attachmentsConfigSchema
@@ -19170,7 +19320,7 @@ ${spaces}]`;
19170
19320
  if (entries.length === 0)
19171
19321
  return "{}";
19172
19322
  return `{
19173
- ${entries.map(([k, v]) => `${inner}${formatKey(k)}: ${formatValue(v, indent + 1)}`).join(`,
19323
+ ${entries.map(([k2, v]) => `${inner}${formatKey(k2)}: ${formatValue(v, indent + 1)}`).join(`,
19174
19324
  `)},
19175
19325
  ${spaces}}`;
19176
19326
  }
@@ -19221,6 +19371,9 @@ function buildConfigTs(input) {
19221
19371
  terms: { title: "Terms of Service" }
19222
19372
  },
19223
19373
  authentication: input.auth,
19374
+ desktopApp: {
19375
+ enabled: input.withElectron
19376
+ },
19224
19377
  ai: { gateway: input.gateway },
19225
19378
  anonymous: {
19226
19379
  credits: 10,
@@ -19314,10 +19467,23 @@ var authEnvRequirements = {
19314
19467
  }
19315
19468
  };
19316
19469
 
19470
+ // ../../apps/chat/lib/playwright-test-environment.ts
19471
+ function isEnabledFlag(value) {
19472
+ if (!value) {
19473
+ return false;
19474
+ }
19475
+ const normalizedValue = value.trim().toLowerCase();
19476
+ return !["0", "false", "no", "off"].includes(normalizedValue);
19477
+ }
19478
+ function isPlaywrightTestEnvironment(env = process.env) {
19479
+ return Boolean(env.PLAYWRIGHT_TEST_BASE_URL || isEnabledFlag(env.PLAYWRIGHT) || isEnabledFlag(env.CI_PLAYWRIGHT));
19480
+ }
19481
+
19317
19482
  // ../../apps/chat/lib/env-schema.ts
19483
+ var isPlaywrightTestEnvironmentEnabled = isPlaywrightTestEnvironment(process.env);
19318
19484
  var serverEnvSchema = {
19319
- DATABASE_URL: exports_external.string().min(1).describe("Postgres connection string"),
19320
- AUTH_SECRET: exports_external.string().min(1).describe("NextAuth.js secret for signing session tokens"),
19485
+ DATABASE_URL: exports_external.preprocess((value) => isPlaywrightTestEnvironmentEnabled && (value == null || value === "") ? "postgres://postgres:postgres@127.0.0.1:5432/playwright" : value, exports_external.string().min(1)).describe("Postgres connection string"),
19486
+ AUTH_SECRET: exports_external.preprocess((value) => isPlaywrightTestEnvironmentEnabled && (value == null || value === "") ? "playwright-test-auth-secret" : value, exports_external.string().min(1)).describe("NextAuth.js secret for signing session tokens"),
19321
19487
  BLOB_READ_WRITE_TOKEN: exports_external.string().optional().describe("Vercel Blob storage token for file uploads"),
19322
19488
  AUTH_GOOGLE_ID: exports_external.string().optional().describe("Google OAuth client ID"),
19323
19489
  AUTH_GOOGLE_SECRET: exports_external.string().optional().describe("Google OAuth client secret"),
@@ -19340,7 +19506,9 @@ var serverEnvSchema = {
19340
19506
  VERCEL_TEAM_ID: exports_external.string().optional().describe("Vercel team ID for sandbox (non-Vercel deployments)"),
19341
19507
  VERCEL_PROJECT_ID: exports_external.string().optional().describe("Vercel project ID for sandbox (non-Vercel deployments)"),
19342
19508
  VERCEL_TOKEN: exports_external.string().optional().describe("Vercel API token for sandbox (non-Vercel deployments)"),
19343
- VERCEL_SANDBOX_RUNTIME: exports_external.string().optional().describe("Vercel sandbox runtime identifier"),
19509
+ VERCEL_SANDBOX_RUNTIME: exports_external.string().min(1).optional().describe("Legacy default Vercel sandbox runtime identifier for Python"),
19510
+ VERCEL_SANDBOX_RUNTIME_PYTHON: exports_external.string().min(1).optional().describe("Vercel sandbox runtime identifier for Python execution"),
19511
+ VERCEL_SANDBOX_RUNTIME_JAVASCRIPT: exports_external.string().min(1).optional().describe("Vercel sandbox runtime identifier for JavaScript execution"),
19344
19512
  APP_URL: exports_external.url().optional().describe("App URL for non-Vercel deployments (full URL including https://)"),
19345
19513
  VERCEL_URL: exports_external.string().optional().describe("Auto-set by Vercel platform")
19346
19514
  };
@@ -19455,8 +19623,8 @@ var AUTH_LABELS = {
19455
19623
  vercel: "Vercel OAuth"
19456
19624
  };
19457
19625
  function handleCancel(value) {
19458
- if (Ct(value)) {
19459
- Ne("Operation cancelled.");
19626
+ if (q(value)) {
19627
+ pt("Operation cancelled.");
19460
19628
  process.exit(1);
19461
19629
  }
19462
19630
  }
@@ -19466,7 +19634,7 @@ function toKebabCase(value) {
19466
19634
  async function promptProjectName(targetArg, skipPrompt) {
19467
19635
  if (skipPrompt)
19468
19636
  return toKebabCase(targetArg ?? "my-chat-app") || "my-chat-app";
19469
- const name = await Ze({
19637
+ const name = await Ot({
19470
19638
  message: "What is your project named?",
19471
19639
  initialValue: targetArg ?? "my-chat-app",
19472
19640
  validate: (value) => {
@@ -19482,7 +19650,7 @@ async function promptGateway(skipPrompt) {
19482
19650
  if (skipPrompt)
19483
19651
  return "vercel";
19484
19652
  const gateways = Object.keys(gatewayEnvRequirements);
19485
- const gateway = await Je({
19653
+ const gateway = await _t({
19486
19654
  message: `Which ${highlighter.info("AI gateway")} would you like to use?`,
19487
19655
  options: gateways.map((gw) => ({
19488
19656
  value: gw,
@@ -19498,7 +19666,7 @@ async function promptFeatures(skipPrompt) {
19498
19666
  if (skipPrompt)
19499
19667
  return { ...FEATURE_DEFAULTS };
19500
19668
  const defaultFeatures = FEATURE_KEYS.filter((key) => FEATURE_DEFAULTS[key]);
19501
- const selectedFeatures = await je({
19669
+ const selectedFeatures = await yt({
19502
19670
  message: `Which ${highlighter.info("features")} would you like to enable? ${highlighter.dim("(space to toggle, enter to submit)")}`,
19503
19671
  options: FEATURE_KEYS.map((key) => ({
19504
19672
  value: key,
@@ -19525,15 +19693,15 @@ async function promptAuth(skipPrompt) {
19525
19693
  if (skipPrompt)
19526
19694
  return { ...AUTH_DEFAULTS };
19527
19695
  const providers = Object.keys(authEnvRequirements);
19528
- const defaultProviders = providers.filter((p) => AUTH_DEFAULTS[p]);
19696
+ const defaultProviders = providers.filter((p2) => AUTH_DEFAULTS[p2]);
19529
19697
  let selectedProviders = [];
19530
19698
  while (selectedProviders.length === 0) {
19531
- const selected = await je({
19699
+ const selected = await yt({
19532
19700
  message: `Which ${highlighter.info("auth providers")} would you like to enable? ${highlighter.warn("(at least one required)")} ${highlighter.dim("(space to toggle, enter to submit)")}`,
19533
- options: providers.map((p) => ({
19534
- value: p,
19535
- label: AUTH_LABELS[p],
19536
- hint: authEnvRequirements[p].description
19701
+ options: providers.map((p2) => ({
19702
+ value: p2,
19703
+ label: AUTH_LABELS[p2],
19704
+ hint: authEnvRequirements[p2].description
19537
19705
  })),
19538
19706
  initialValues: defaultProviders,
19539
19707
  required: false
@@ -19549,15 +19717,28 @@ async function promptAuth(skipPrompt) {
19549
19717
  github: false,
19550
19718
  vercel: false
19551
19719
  };
19552
- for (const p of selectedProviders) {
19553
- auth[p] = true;
19720
+ for (const p2 of selectedProviders) {
19721
+ auth[p2] = true;
19554
19722
  }
19555
19723
  return auth;
19556
19724
  }
19725
+ async function promptElectron(skipPrompt, explicitChoice) {
19726
+ if (typeof explicitChoice === "boolean") {
19727
+ return explicitChoice;
19728
+ }
19729
+ if (skipPrompt)
19730
+ return false;
19731
+ const wantsElectron = await ot2({
19732
+ message: `Include an ${highlighter.info("Electron")} desktop app?`,
19733
+ initialValue: false
19734
+ });
19735
+ handleCancel(wantsElectron);
19736
+ return wantsElectron;
19737
+ }
19557
19738
  async function promptInstall(packageManager, skipPrompt) {
19558
19739
  if (skipPrompt)
19559
19740
  return true;
19560
- const install = await Re({
19741
+ const install = await ot2({
19561
19742
  message: `Install dependencies with ${highlighter.info(packageManager)}?`,
19562
19743
  initialValue: true
19563
19744
  });
@@ -19567,10 +19748,135 @@ async function promptInstall(packageManager, skipPrompt) {
19567
19748
 
19568
19749
  // src/helpers/scaffold.ts
19569
19750
  import { existsSync } from "node:fs";
19570
- import { cp, rm } from "node:fs/promises";
19571
- import { dirname, join, resolve } from "node:path";
19751
+ import { cp, readFile, rm, writeFile } from "node:fs/promises";
19752
+ import { dirname, join, relative, resolve, sep } from "node:path";
19572
19753
  import { fileURLToPath } from "node:url";
19573
19754
 
19755
+ // src/helpers/package-manifest.ts
19756
+ var ESBUILD_VERSION = "^0.28.0";
19757
+ var BETTER_AUTH_PACKAGES = [
19758
+ "@better-auth/core",
19759
+ "@better-auth/electron",
19760
+ "better-auth"
19761
+ ];
19762
+ function toExactVersion(range) {
19763
+ return range.replace(/^[~^]/, "");
19764
+ }
19765
+ function resolveBetterAuthVersion(packageJson) {
19766
+ for (const dependencyGroup of [
19767
+ packageJson.dependencies,
19768
+ packageJson.devDependencies
19769
+ ]) {
19770
+ if (!dependencyGroup) {
19771
+ continue;
19772
+ }
19773
+ for (const packageName of BETTER_AUTH_PACKAGES) {
19774
+ const version2 = dependencyGroup[packageName];
19775
+ if (version2) {
19776
+ return toExactVersion(version2);
19777
+ }
19778
+ }
19779
+ }
19780
+ return null;
19781
+ }
19782
+ function pinBetterAuthVersions(dependencyGroup, version2) {
19783
+ if (!dependencyGroup) {
19784
+ return;
19785
+ }
19786
+ for (const packageName of BETTER_AUTH_PACKAGES) {
19787
+ if (dependencyGroup[packageName]) {
19788
+ dependencyGroup[packageName] = version2;
19789
+ }
19790
+ }
19791
+ }
19792
+ function normalizeChatAppScripts(scripts) {
19793
+ const defaultBranchName = "$" + "{1:-dev-local}";
19794
+ scripts.prebuild = "tsx scripts/check-env.ts";
19795
+ scripts.dev = "tsx scripts/check-env.ts && bash scripts/with-db.sh next dev";
19796
+ scripts["dev:inspect"] = "tsx scripts/check-env.ts && bash scripts/with-db.sh next dev --inspect";
19797
+ scripts.prod = "tsx scripts/check-env.ts && tsx lib/db/migrate.ts && next build && next start";
19798
+ scripts.lint = "ultracite check";
19799
+ scripts.format = "ultracite fix";
19800
+ scripts["check-env"] = "tsx scripts/check-env.ts";
19801
+ scripts["db:migrate"] = "export VERCEL_ENV=production && bash scripts/with-db.sh tsx lib/db/migrate.ts";
19802
+ scripts["db:backfill-parts"] = "tsx lib/db/backfill-parts.ts";
19803
+ scripts["db:branch:start"] = `bash -c 'N=${defaultBranchName}; bash scripts/db-branch-create.sh "$N" && bash scripts/db-branch-use.sh "$N"' --`;
19804
+ scripts["db:branch:stop"] = `bash -c 'N=${defaultBranchName}; bash scripts/db-branch-use.sh main && bash scripts/db-branch-delete.sh "$N"' --`;
19805
+ scripts["db:branch:list"] = "npx neonctl branches list";
19806
+ scripts["skiller:apply"] = "npx skiller@latest apply";
19807
+ scripts.test = "export PLAYWRIGHT=True && playwright test --workers=4 && vitest run";
19808
+ scripts["test:e2e"] = "export PLAYWRIGHT=True && playwright test --workers=4";
19809
+ scripts["ai:devtools"] = "npx @ai-sdk/devtools";
19810
+ scripts["fetch:models"] = "tsx scripts/fetch-models.ts && ultracite fix";
19811
+ }
19812
+ function normalizeElectronScripts(scripts) {
19813
+ const prebuild = "tsx scripts/write-branding.ts && tsx scripts/generate-icons.ts";
19814
+ const build = "esbuild src/main.ts --bundle --platform=node --format=cjs --outfile=dist/main.js --external:electron --external:electron-updater --alias:@=.. && esbuild src/preload.ts --bundle --platform=browser --format=cjs --outfile=dist/preload.js --external:electron --alias:@=..";
19815
+ scripts.forge = "node ./scripts/run-forge.cjs";
19816
+ scripts["generate-icons"] = "tsx scripts/generate-icons.ts";
19817
+ scripts.prebuild = prebuild;
19818
+ scripts.build = build;
19819
+ scripts.start = "node ./scripts/run-forge.cjs start";
19820
+ scripts.dev = "node ./scripts/run-forge.cjs start";
19821
+ scripts.package = "node ./scripts/run-forge.cjs package";
19822
+ scripts.make = "node ./scripts/run-forge.cjs make";
19823
+ scripts["make:mac"] = "node ./scripts/run-forge.cjs make --platform=darwin --arch=universal";
19824
+ scripts["make:win"] = "node ./scripts/run-forge.cjs make --platform=win32 --arch=x64";
19825
+ scripts["make:linux"] = "node ./scripts/run-forge.cjs make --platform=linux --arch=x64";
19826
+ scripts.publish = "node ./scripts/run-forge.cjs publish";
19827
+ scripts["electron:build"] = build;
19828
+ scripts["electron:dev"] = scripts.dev;
19829
+ scripts["electron:make"] = scripts.make;
19830
+ scripts["electron:publish"] = scripts.publish;
19831
+ delete scripts["dist:mac"];
19832
+ delete scripts["dist:win"];
19833
+ delete scripts["dist:linux"];
19834
+ delete scripts["publish:mac"];
19835
+ delete scripts["publish:win"];
19836
+ }
19837
+ function normalizeElectronDevDependencies(devDependencies, tsxVersion) {
19838
+ if (!devDependencies) {
19839
+ return;
19840
+ }
19841
+ devDependencies.esbuild = ESBUILD_VERSION;
19842
+ if (tsxVersion) {
19843
+ devDependencies.tsx = tsxVersion;
19844
+ }
19845
+ }
19846
+ function normalizeScaffoldedPackageJson(packageJson, options) {
19847
+ const betterAuthVersion = resolveBetterAuthVersion(packageJson);
19848
+ if (betterAuthVersion) {
19849
+ pinBetterAuthVersions(packageJson.dependencies, betterAuthVersion);
19850
+ pinBetterAuthVersions(packageJson.devDependencies, betterAuthVersion);
19851
+ packageJson.overrides = {
19852
+ ...packageJson.overrides ?? {},
19853
+ "@better-auth/core": betterAuthVersion
19854
+ };
19855
+ }
19856
+ switch (options?.template) {
19857
+ case "chat-app":
19858
+ if (packageJson.scripts) {
19859
+ normalizeChatAppScripts(packageJson.scripts);
19860
+ }
19861
+ break;
19862
+ case "electron":
19863
+ if (packageJson.scripts) {
19864
+ normalizeElectronScripts(packageJson.scripts);
19865
+ }
19866
+ normalizeElectronDevDependencies(packageJson.devDependencies, options?.tsxVersion);
19867
+ break;
19868
+ default:
19869
+ break;
19870
+ }
19871
+ if (options?.persistPackageManager !== false) {
19872
+ const packageManager = options?.packageManager ?? "bun";
19873
+ if (packageManager !== "bun") {
19874
+ delete packageJson.packageManager;
19875
+ }
19876
+ }
19877
+ return packageJson;
19878
+ }
19879
+
19574
19880
  // src/utils/run-command.ts
19575
19881
  import { spawn as spawn2 } from "node:child_process";
19576
19882
  async function runCommand(command, args, cwd) {
@@ -19592,28 +19898,283 @@ ${stderr.join("")}`.trim()));
19592
19898
  }
19593
19899
 
19594
19900
  // src/helpers/scaffold.ts
19595
- function findTemplateDir() {
19901
+ var CHAT_APP_EXCLUDED_SEGMENTS = new Set([
19902
+ "node_modules",
19903
+ ".next",
19904
+ ".turbo",
19905
+ "playwright",
19906
+ "playwright-report",
19907
+ "test-results",
19908
+ "blob-report",
19909
+ "dist",
19910
+ "build"
19911
+ ]);
19912
+ var CHAT_APP_EXCLUDED_FILES = new Set([
19913
+ ".env.local",
19914
+ ".DS_Store",
19915
+ "bun.lock",
19916
+ "bun.lockb"
19917
+ ]);
19918
+ var ELECTRON_EXCLUDED_SEGMENTS = new Set([
19919
+ "node_modules",
19920
+ ".turbo",
19921
+ "build",
19922
+ "dist",
19923
+ "release"
19924
+ ]);
19925
+ var ELECTRON_EXCLUDED_FILES = new Set([
19926
+ ".DS_Store",
19927
+ "bun.lock",
19928
+ "bun.lockb",
19929
+ "branding.json"
19930
+ ]);
19931
+ function getCliPackageRoot() {
19596
19932
  const __dir = dirname(fileURLToPath(import.meta.url));
19597
- for (const relative of ["../templates/chat-app", "../../templates/chat-app"]) {
19598
- const candidate = resolve(__dir, relative);
19599
- if (existsSync(candidate))
19933
+ for (const relative2 of ["..", "../.."]) {
19934
+ const candidate = resolve(__dir, relative2);
19935
+ if (existsSync(join(candidate, "package.json"))) {
19600
19936
  return candidate;
19937
+ }
19938
+ }
19939
+ throw new Error("Could not locate the @chat-js/cli package root.");
19940
+ }
19941
+ function getRepoRoot() {
19942
+ return resolve(getCliPackageRoot(), "../..");
19943
+ }
19944
+ function findTemplateDir(name) {
19945
+ const cliRoot = getCliPackageRoot();
19946
+ const candidate = join(cliRoot, "templates", name);
19947
+ return existsSync(candidate) ? candidate : null;
19948
+ }
19949
+ function shouldCopyChatAppFilePath(sourceDir, filePath) {
19950
+ const relativePath = relative(sourceDir, filePath);
19951
+ const segments = relativePath.split(sep);
19952
+ if (segments.some((segment) => CHAT_APP_EXCLUDED_SEGMENTS.has(segment))) {
19953
+ return false;
19601
19954
  }
19602
- throw new Error("Template not found. Run `bun template:sync` to generate templates.");
19955
+ const fileName = segments.at(-1);
19956
+ return !(fileName && CHAT_APP_EXCLUDED_FILES.has(fileName));
19603
19957
  }
19604
- async function scaffoldFromTemplate(destination) {
19605
- const templateDir = findTemplateDir();
19606
- await cp(templateDir, destination, { recursive: true });
19958
+ function shouldCopyElectronFilePath(sourceDir, filePath) {
19959
+ const relativePath = relative(sourceDir, filePath);
19960
+ const segments = relativePath.split(sep);
19961
+ if (segments.some((segment) => ELECTRON_EXCLUDED_SEGMENTS.has(segment))) {
19962
+ return false;
19963
+ }
19964
+ const fileName = segments.at(-1);
19965
+ return !(fileName && ELECTRON_EXCLUDED_FILES.has(fileName));
19966
+ }
19967
+ function runScript(packageManager, script) {
19968
+ return `${packageManager} run ${script}`;
19969
+ }
19970
+ function execCommand(packageManager) {
19971
+ switch (packageManager) {
19972
+ case "bun":
19973
+ return "bunx";
19974
+ case "pnpm":
19975
+ return "pnpm dlx";
19976
+ case "yarn":
19977
+ return "yarn dlx";
19978
+ case "npm":
19979
+ return "npx";
19980
+ }
19981
+ }
19982
+ async function replaceInFile(filePath, replacements) {
19983
+ if (!existsSync(filePath)) {
19984
+ return;
19985
+ }
19986
+ let content = await readFile(filePath, "utf8");
19987
+ for (const [search, replacement] of replacements) {
19988
+ content = content.replaceAll(search, replacement);
19989
+ }
19990
+ await writeFile(filePath, content);
19991
+ }
19992
+ async function applyChatTemplateSourceTransforms(destination) {
19993
+ await Promise.all(["components/github-link.tsx", "components/docs-link.tsx"].map((file2) => rm(join(destination, file2), { force: true })));
19994
+ const headerPath = join(destination, "components", "header-actions.tsx");
19995
+ await replaceInFile(headerPath, [
19996
+ [`import { DocsLink } from "@/components/docs-link";
19997
+ `, ""],
19998
+ [`import { GitHubLink } from "@/components/github-link";
19999
+ `, ""],
20000
+ ["<DocsLink />", ""],
20001
+ ["<GitHubLink />", ""]
20002
+ ]);
20003
+ const globalsCssPath = join(destination, "app", "globals.css");
20004
+ await replaceInFile(globalsCssPath, [
20005
+ [
20006
+ `@source "../node_modules/streamdown/dist/*.js";
20007
+ @source "../../../node_modules/streamdown/dist/*.js";`,
20008
+ '@source "../node_modules/streamdown/dist/*.js";'
20009
+ ]
20010
+ ]);
20011
+ const repoPackageJsonPath = join(getRepoRoot(), "package.json");
20012
+ const rootPackageJson = JSON.parse(await readFile(repoPackageJsonPath, "utf8"));
20013
+ const packageJsonPath = join(destination, "package.json");
20014
+ const packageJson = JSON.parse(await readFile(packageJsonPath, "utf8"));
20015
+ packageJson.packageManager = rootPackageJson.packageManager;
20016
+ await writeFile(packageJsonPath, `${JSON.stringify(packageJson, null, 2)}
20017
+ `);
20018
+ }
20019
+ async function applyElectronTemplateSourceTransforms(destination) {
20020
+ const tsconfigPath = join(destination, "tsconfig.json");
20021
+ await replaceInFile(tsconfigPath, [['"../chat/*"', '"../*"']]);
20022
+ const packageJsonPath = join(destination, "package.json");
20023
+ await replaceInFile(packageJsonPath, [
20024
+ ['"name": "@chatjs/electron"', '"name": "__PROJECT_NAME__-electron"'],
20025
+ [
20026
+ '"url": "https://github.com/FranciscoMoretti/chat-js.git"',
20027
+ '"url": "https://github.com/__GITHUB_OWNER__/__GITHUB_REPO__.git"'
20028
+ ]
20029
+ ]);
20030
+ }
20031
+ async function copyChatTemplateFromRepoSource(destination) {
20032
+ const sourceDir = join(getRepoRoot(), "apps", "chat");
20033
+ await cp(sourceDir, destination, {
20034
+ recursive: true,
20035
+ filter: (filePath) => shouldCopyChatAppFilePath(sourceDir, filePath)
20036
+ });
20037
+ await applyChatTemplateSourceTransforms(destination);
20038
+ }
20039
+ async function copyElectronTemplateFromRepoSource(destination) {
20040
+ const sourceDir = join(getRepoRoot(), "apps", "electron");
20041
+ await cp(sourceDir, destination, {
20042
+ recursive: true,
20043
+ filter: (filePath) => shouldCopyElectronFilePath(sourceDir, filePath)
20044
+ });
20045
+ await applyElectronTemplateSourceTransforms(destination);
20046
+ }
20047
+ async function normalizeChatAppFiles(destination, packageManager) {
20048
+ await replaceInFile(join(destination, "playwright.config.ts"), [
20049
+ ['command: "bun dev"', `command: "${runScript(packageManager, "dev")}"`]
20050
+ ]);
20051
+ await replaceInFile(join(destination, "scripts", "check-env.ts"), [
20052
+ [
20053
+ " * Run via `bun run check-env` or automatically in prebuild.",
20054
+ ` * Run via \`${runScript(packageManager, "check-env")}\` or automatically in prebuild.`
20055
+ ],
20056
+ [
20057
+ "bun fetch:models",
20058
+ runScript(packageManager, "fetch:models")
20059
+ ]
20060
+ ]);
20061
+ await replaceInFile(join(destination, "lib", "ai", "gateways", "fallback-models.ts"), [
20062
+ [
20063
+ "bun fetch:models",
20064
+ runScript(packageManager, "fetch:models")
20065
+ ]
20066
+ ]);
20067
+ await replaceInFile(join(destination, "scripts", "with-db.sh"), [
20068
+ ["bunx neonctl", `${execCommand(packageManager)} neonctl`],
20069
+ ["filter out bun's package resolution output", `filter out ${execCommand(packageManager)} resolution output`],
20070
+ [
20071
+ "Run: bun db:branch:use main (to switch back to main)",
20072
+ "Run: bash scripts/db-branch-use.sh main (to switch back to main)"
20073
+ ]
20074
+ ]);
20075
+ await replaceInFile(join(destination, "scripts", "db-branch-create.sh"), [
20076
+ ["bunx neonctl", `${execCommand(packageManager)} neonctl`],
20077
+ [
20078
+ 'echo "To use it: bun db:branch:use $BRANCH_NAME"',
20079
+ 'echo "To use it: bash scripts/db-branch-use.sh $BRANCH_NAME"'
20080
+ ]
20081
+ ]);
20082
+ await replaceInFile(join(destination, "scripts", "db-branch-use.sh"), [
20083
+ ["bunx neonctl", `${execCommand(packageManager)} neonctl`],
20084
+ ['echo "Usage: bun db:branch:use <branch-name>"', 'echo "Usage: bash scripts/db-branch-use.sh <branch-name>"'],
20085
+ [
20086
+ 'echo " bun db:branch:use main (switch to production)"',
20087
+ 'echo " bash scripts/db-branch-use.sh main (switch to production)"'
20088
+ ],
20089
+ ['echo "Available branches: bun db:branch:list"', `echo "Available branches: ${execCommand(packageManager)} neonctl branches list"`],
20090
+ ['echo "Create branch: bun db:branch:create"', 'echo "Create branch: bash scripts/db-branch-create.sh"']
20091
+ ]);
20092
+ await replaceInFile(join(destination, "scripts", "db-branch-delete.sh"), [
20093
+ ["bunx neonctl", `${execCommand(packageManager)} neonctl`]
20094
+ ]);
20095
+ await replaceInFile(join(destination, "scripts", "worktree-setup.sh"), [
20096
+ ["bun i", `${packageManager} install`]
20097
+ ]);
20098
+ const vercelJsonPath = join(destination, "vercel.json");
20099
+ const vercelJson = JSON.parse(await readFile(vercelJsonPath, "utf8"));
20100
+ vercelJson.installCommand = `${packageManager} install`;
20101
+ vercelJson.buildCommand = runScript(packageManager, "build");
20102
+ await writeFile(vercelJsonPath, `${JSON.stringify(vercelJson, null, 2)}
20103
+ `);
20104
+ }
20105
+ async function normalizeElectronFiles(destination, packageManager) {
20106
+ const scriptPlaceholder = "$" + "{script}";
20107
+ await replaceInFile(join(destination, "forge.config.ts"), [
20108
+ ["Run \\`bun run prebuild\\`", "Run \\`" + runScript(packageManager, "prebuild") + "\\`"],
20109
+ ["function runBunScript", "function runPackageManagerScript"],
20110
+ ['spawnSync("bun", ["run", script], {', `spawnSync("${packageManager}", ["run", script], {`],
20111
+ [`bun run ${scriptPlaceholder} failed`, `${packageManager} run ${scriptPlaceholder} failed`],
20112
+ [' runBunScript("prebuild");', ' runPackageManagerScript("prebuild");'],
20113
+ [
20114
+ ' runBunScript("build", { NODE_ENV: "development" });',
20115
+ ' runPackageManagerScript("build", { NODE_ENV: "development" });'
20116
+ ],
20117
+ [
20118
+ ' runBunScript("build", { NODE_ENV: "production" });',
20119
+ ' runPackageManagerScript("build", { NODE_ENV: "production" });'
20120
+ ]
20121
+ ]);
20122
+ await replaceInFile(join(destination, "README.md"), [
20123
+ ["bun install", `${packageManager} install`],
20124
+ ["bun run dev", runScript(packageManager, "dev")],
20125
+ ["bun run generate-icons", runScript(packageManager, "generate-icons")],
20126
+ ["bun run make:mac", runScript(packageManager, "make:mac")],
20127
+ ["bun run make:win", runScript(packageManager, "make:win")],
20128
+ ["bun run make:linux", runScript(packageManager, "make:linux")]
20129
+ ]);
20130
+ }
20131
+ async function scaffoldFromTemplate(destination, options) {
20132
+ const packageManager = options?.packageManager ?? "bun";
20133
+ const templateDir = findTemplateDir("chat-app");
20134
+ if (templateDir) {
20135
+ await cp(templateDir, destination, { recursive: true });
20136
+ } else {
20137
+ await copyChatTemplateFromRepoSource(destination);
20138
+ }
20139
+ const packageJsonPath = join(destination, "package.json");
20140
+ const packageJson = normalizeScaffoldedPackageJson(JSON.parse(await readFile(packageJsonPath, "utf8")), {
20141
+ packageManager,
20142
+ template: "chat-app"
20143
+ });
20144
+ await writeFile(packageJsonPath, `${JSON.stringify(packageJson, null, 2)}
20145
+ `);
20146
+ await normalizeChatAppFiles(destination, packageManager);
20147
+ }
20148
+ async function scaffoldElectron(projectDir, opts) {
20149
+ const packageManager = opts.packageManager ?? "bun";
20150
+ const rootPackageJsonPath = join(projectDir, "package.json");
20151
+ const rootPackageJson = JSON.parse(await readFile(rootPackageJsonPath, "utf8"));
20152
+ const destination = join(projectDir, "electron");
20153
+ const templateDir = findTemplateDir("electron");
20154
+ if (templateDir) {
20155
+ await cp(templateDir, destination, { recursive: true });
20156
+ } else {
20157
+ await copyElectronTemplateFromRepoSource(destination);
20158
+ }
20159
+ const packageJsonPath = join(destination, "package.json");
20160
+ const packageJson = normalizeScaffoldedPackageJson(JSON.parse((await readFile(packageJsonPath, "utf8")).replace("__PROJECT_NAME__-electron", `${opts.projectName}-electron`).replace("__GITHUB_OWNER__", "your-github-username").replace("__GITHUB_REPO__", opts.projectName)), {
20161
+ packageManager,
20162
+ template: "electron",
20163
+ tsxVersion: rootPackageJson.devDependencies?.tsx
20164
+ });
20165
+ await writeFile(packageJsonPath, `${JSON.stringify(packageJson, null, 2)}
20166
+ `);
20167
+ await normalizeElectronFiles(destination, packageManager);
19607
20168
  }
19608
20169
  async function scaffoldFromGit(url2, destination) {
19609
20170
  await runCommand("git", ["clone", "--depth", "1", url2, destination], process.cwd());
19610
20171
  await rm(join(destination, ".git"), { recursive: true, force: true });
19611
20172
  }
19612
20173
 
19613
- // ../../node_modules/ora/index.js
20174
+ // ../../node_modules/.bun/ora@8.2.0/node_modules/ora/index.js
19614
20175
  import process10 from "node:process";
19615
20176
 
19616
- // ../../node_modules/chalk/source/vendor/ansi-styles/index.js
20177
+ // ../../node_modules/.bun/chalk@5.6.2/node_modules/chalk/source/vendor/ansi-styles/index.js
19617
20178
  var ANSI_BACKGROUND_OFFSET = 10;
19618
20179
  var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
19619
20180
  var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
@@ -19790,7 +20351,7 @@ function assembleStyles() {
19790
20351
  var ansiStyles = assembleStyles();
19791
20352
  var ansi_styles_default = ansiStyles;
19792
20353
 
19793
- // ../../node_modules/chalk/source/vendor/supports-color/index.js
20354
+ // ../../node_modules/.bun/chalk@5.6.2/node_modules/chalk/source/vendor/supports-color/index.js
19794
20355
  import process3 from "node:process";
19795
20356
  import os from "node:os";
19796
20357
  import tty from "node:tty";
@@ -19922,7 +20483,7 @@ var supportsColor = {
19922
20483
  };
19923
20484
  var supports_color_default = supportsColor;
19924
20485
 
19925
- // ../../node_modules/chalk/source/utilities.js
20486
+ // ../../node_modules/.bun/chalk@5.6.2/node_modules/chalk/source/utilities.js
19926
20487
  function stringReplaceAll(string4, substring, replacer) {
19927
20488
  let index = string4.indexOf(substring);
19928
20489
  if (index === -1) {
@@ -19955,7 +20516,7 @@ function stringEncaseCRLFWithFirstIndex(string4, prefix, postfix, index) {
19955
20516
  return returnValue;
19956
20517
  }
19957
20518
 
19958
- // ../../node_modules/chalk/source/index.js
20519
+ // ../../node_modules/.bun/chalk@5.6.2/node_modules/chalk/source/index.js
19959
20520
  var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
19960
20521
  var GENERATOR = Symbol("GENERATOR");
19961
20522
  var STYLER = Symbol("STYLER");
@@ -20102,13 +20663,13 @@ var chalk = createChalk();
20102
20663
  var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
20103
20664
  var source_default = chalk;
20104
20665
 
20105
- // ../../node_modules/cli-cursor/index.js
20666
+ // ../../node_modules/.bun/cli-cursor@5.0.0/node_modules/cli-cursor/index.js
20106
20667
  import process6 from "node:process";
20107
20668
 
20108
- // ../../node_modules/restore-cursor/index.js
20669
+ // ../../node_modules/.bun/restore-cursor@5.1.0/node_modules/restore-cursor/index.js
20109
20670
  import process5 from "node:process";
20110
20671
 
20111
- // ../../node_modules/mimic-function/index.js
20672
+ // ../../node_modules/.bun/mimic-function@5.0.1/node_modules/mimic-function/index.js
20112
20673
  var copyProperty = (to, from, property, ignoreNonConfigurable) => {
20113
20674
  if (property === "length" || property === "prototype") {
20114
20675
  return;
@@ -20154,7 +20715,7 @@ function mimicFunction(to, from, { ignoreNonConfigurable = false } = {}) {
20154
20715
  return to;
20155
20716
  }
20156
20717
 
20157
- // ../../node_modules/onetime/index.js
20718
+ // ../../node_modules/.bun/onetime@7.0.0/node_modules/onetime/index.js
20158
20719
  var calledFunctions = new WeakMap;
20159
20720
  var onetime = (function_, options = {}) => {
20160
20721
  if (typeof function_ !== "function") {
@@ -20185,7 +20746,7 @@ onetime.callCount = (function_) => {
20185
20746
  };
20186
20747
  var onetime_default = onetime;
20187
20748
 
20188
- // ../../node_modules/signal-exit/dist/mjs/signals.js
20749
+ // ../../node_modules/.bun/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
20189
20750
  var signals = [];
20190
20751
  signals.push("SIGHUP", "SIGINT", "SIGTERM");
20191
20752
  if (process.platform !== "win32") {
@@ -20195,7 +20756,7 @@ if (process.platform === "linux") {
20195
20756
  signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
20196
20757
  }
20197
20758
 
20198
- // ../../node_modules/signal-exit/dist/mjs/index.js
20759
+ // ../../node_modules/.bun/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js
20199
20760
  var processOk = (process4) => !!process4 && typeof process4 === "object" && typeof process4.removeListener === "function" && typeof process4.emit === "function" && typeof process4.reallyExit === "function" && typeof process4.listeners === "function" && typeof process4.kill === "function" && typeof process4.pid === "number" && typeof process4.on === "function";
20200
20761
  var kExitEmitter = Symbol.for("signal-exit emitter");
20201
20762
  var global = globalThis;
@@ -20294,9 +20855,9 @@ class SignalExit extends SignalExitBase {
20294
20855
  this.#sigListeners[sig] = () => {
20295
20856
  const listeners = this.#process.listeners(sig);
20296
20857
  let { count } = this.#emitter;
20297
- const p = process4;
20298
- if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") {
20299
- count += p.__signal_exit_emitter__.count;
20858
+ const p2 = process4;
20859
+ if (typeof p2.__signal_exit_emitter__ === "object" && typeof p2.__signal_exit_emitter__.count === "number") {
20860
+ count += p2.__signal_exit_emitter__.count;
20300
20861
  }
20301
20862
  if (listeners.length === count) {
20302
20863
  this.unload();
@@ -20337,7 +20898,7 @@ class SignalExit extends SignalExitBase {
20337
20898
  const fn = this.#sigListeners[sig];
20338
20899
  if (fn)
20339
20900
  this.#process.on(sig, fn);
20340
- } catch (_2) {}
20901
+ } catch (_) {}
20341
20902
  }
20342
20903
  this.#process.emit = (ev, ...a) => {
20343
20904
  return this.#processEmit(ev, ...a);
@@ -20358,7 +20919,7 @@ class SignalExit extends SignalExitBase {
20358
20919
  }
20359
20920
  try {
20360
20921
  this.#process.removeListener(sig, listener);
20361
- } catch (_2) {}
20922
+ } catch (_) {}
20362
20923
  });
20363
20924
  this.#process.emit = this.#originalProcessEmit;
20364
20925
  this.#process.reallyExit = this.#originalProcessReallyExit;
@@ -20393,7 +20954,7 @@ var {
20393
20954
  unload
20394
20955
  } = signalExitWrap(processOk(process4) ? new SignalExit(process4) : new SignalExitFallback);
20395
20956
 
20396
- // ../../node_modules/restore-cursor/index.js
20957
+ // ../../node_modules/.bun/restore-cursor@5.1.0/node_modules/restore-cursor/index.js
20397
20958
  var terminal = process5.stderr.isTTY ? process5.stderr : process5.stdout.isTTY ? process5.stdout : undefined;
20398
20959
  var restoreCursor = terminal ? onetime_default(() => {
20399
20960
  onExit(() => {
@@ -20402,7 +20963,7 @@ var restoreCursor = terminal ? onetime_default(() => {
20402
20963
  }) : () => {};
20403
20964
  var restore_cursor_default = restoreCursor;
20404
20965
 
20405
- // ../../node_modules/cli-cursor/index.js
20966
+ // ../../node_modules/.bun/cli-cursor@5.0.0/node_modules/cli-cursor/index.js
20406
20967
  var isHidden = false;
20407
20968
  var cliCursor = {};
20408
20969
  cliCursor.show = (writableStream = process6.stderr) => {
@@ -20432,10 +20993,10 @@ cliCursor.toggle = (force, writableStream) => {
20432
20993
  };
20433
20994
  var cli_cursor_default = cliCursor;
20434
20995
 
20435
- // ../../node_modules/ora/index.js
20996
+ // ../../node_modules/.bun/ora@8.2.0/node_modules/ora/index.js
20436
20997
  var import_cli_spinners = __toESM(require_cli_spinners(), 1);
20437
20998
 
20438
- // ../../node_modules/log-symbols/node_modules/is-unicode-supported/index.js
20999
+ // ../../node_modules/.bun/is-unicode-supported@1.3.0/node_modules/is-unicode-supported/index.js
20439
21000
  import process7 from "node:process";
20440
21001
  function isUnicodeSupported() {
20441
21002
  if (process7.platform !== "win32") {
@@ -20444,7 +21005,7 @@ function isUnicodeSupported() {
20444
21005
  return Boolean(process7.env.CI) || Boolean(process7.env.WT_SESSION) || Boolean(process7.env.TERMINUS_SUBLIME) || process7.env.ConEmuTask === "{cmd::Cmder}" || process7.env.TERM_PROGRAM === "Terminus-Sublime" || process7.env.TERM_PROGRAM === "vscode" || process7.env.TERM === "xterm-256color" || process7.env.TERM === "alacritty" || process7.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
20445
21006
  }
20446
21007
 
20447
- // ../../node_modules/log-symbols/index.js
21008
+ // ../../node_modules/.bun/log-symbols@6.0.0/node_modules/log-symbols/index.js
20448
21009
  var main = {
20449
21010
  info: source_default.blue("ℹ"),
20450
21011
  success: source_default.green("✔"),
@@ -20460,7 +21021,7 @@ var fallback = {
20460
21021
  var logSymbols = isUnicodeSupported() ? main : fallback;
20461
21022
  var log_symbols_default = logSymbols;
20462
21023
 
20463
- // ../../node_modules/ansi-regex/index.js
21024
+ // ../../node_modules/.bun/ansi-regex@6.2.2/node_modules/ansi-regex/index.js
20464
21025
  function ansiRegex({ onlyFirst = false } = {}) {
20465
21026
  const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
20466
21027
  const osc = `(?:\\u001B\\][\\s\\S]*?${ST})`;
@@ -20469,23 +21030,26 @@ function ansiRegex({ onlyFirst = false } = {}) {
20469
21030
  return new RegExp(pattern, onlyFirst ? undefined : "g");
20470
21031
  }
20471
21032
 
20472
- // ../../node_modules/strip-ansi/index.js
21033
+ // ../../node_modules/.bun/strip-ansi@7.2.0/node_modules/strip-ansi/index.js
20473
21034
  var regex = ansiRegex();
20474
21035
  function stripAnsi(string4) {
20475
21036
  if (typeof string4 !== "string") {
20476
21037
  throw new TypeError(`Expected a \`string\`, got \`${typeof string4}\``);
20477
21038
  }
21039
+ if (!string4.includes("\x1B") && !string4.includes("›")) {
21040
+ return string4;
21041
+ }
20478
21042
  return string4.replace(regex, "");
20479
21043
  }
20480
21044
 
20481
- // ../../node_modules/get-east-asian-width/lookup-data.js
21045
+ // ../../node_modules/.bun/get-east-asian-width@1.5.0/node_modules/get-east-asian-width/lookup-data.js
20482
21046
  var ambiguousRanges = [161, 161, 164, 164, 167, 168, 170, 170, 173, 174, 176, 180, 182, 186, 188, 191, 198, 198, 208, 208, 215, 216, 222, 225, 230, 230, 232, 234, 236, 237, 240, 240, 242, 243, 247, 250, 252, 252, 254, 254, 257, 257, 273, 273, 275, 275, 283, 283, 294, 295, 299, 299, 305, 307, 312, 312, 319, 322, 324, 324, 328, 331, 333, 333, 338, 339, 358, 359, 363, 363, 462, 462, 464, 464, 466, 466, 468, 468, 470, 470, 472, 472, 474, 474, 476, 476, 593, 593, 609, 609, 708, 708, 711, 711, 713, 715, 717, 717, 720, 720, 728, 731, 733, 733, 735, 735, 768, 879, 913, 929, 931, 937, 945, 961, 963, 969, 1025, 1025, 1040, 1103, 1105, 1105, 8208, 8208, 8211, 8214, 8216, 8217, 8220, 8221, 8224, 8226, 8228, 8231, 8240, 8240, 8242, 8243, 8245, 8245, 8251, 8251, 8254, 8254, 8308, 8308, 8319, 8319, 8321, 8324, 8364, 8364, 8451, 8451, 8453, 8453, 8457, 8457, 8467, 8467, 8470, 8470, 8481, 8482, 8486, 8486, 8491, 8491, 8531, 8532, 8539, 8542, 8544, 8555, 8560, 8569, 8585, 8585, 8592, 8601, 8632, 8633, 8658, 8658, 8660, 8660, 8679, 8679, 8704, 8704, 8706, 8707, 8711, 8712, 8715, 8715, 8719, 8719, 8721, 8721, 8725, 8725, 8730, 8730, 8733, 8736, 8739, 8739, 8741, 8741, 8743, 8748, 8750, 8750, 8756, 8759, 8764, 8765, 8776, 8776, 8780, 8780, 8786, 8786, 8800, 8801, 8804, 8807, 8810, 8811, 8814, 8815, 8834, 8835, 8838, 8839, 8853, 8853, 8857, 8857, 8869, 8869, 8895, 8895, 8978, 8978, 9312, 9449, 9451, 9547, 9552, 9587, 9600, 9615, 9618, 9621, 9632, 9633, 9635, 9641, 9650, 9651, 9654, 9655, 9660, 9661, 9664, 9665, 9670, 9672, 9675, 9675, 9678, 9681, 9698, 9701, 9711, 9711, 9733, 9734, 9737, 9737, 9742, 9743, 9756, 9756, 9758, 9758, 9792, 9792, 9794, 9794, 9824, 9825, 9827, 9829, 9831, 9834, 9836, 9837, 9839, 9839, 9886, 9887, 9919, 9919, 9926, 9933, 9935, 9939, 9941, 9953, 9955, 9955, 9960, 9961, 9963, 9969, 9972, 9972, 9974, 9977, 9979, 9980, 9982, 9983, 10045, 10045, 10102, 10111, 11094, 11097, 12872, 12879, 57344, 63743, 65024, 65039, 65533, 65533, 127232, 127242, 127248, 127277, 127280, 127337, 127344, 127373, 127375, 127376, 127387, 127404, 917760, 917999, 983040, 1048573, 1048576, 1114109];
20483
21047
  var fullwidthRanges = [12288, 12288, 65281, 65376, 65504, 65510];
20484
21048
  var halfwidthRanges = [8361, 8361, 65377, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65512, 65518];
20485
21049
  var narrowRanges = [32, 126, 162, 163, 165, 166, 172, 172, 175, 175, 10214, 10221, 10629, 10630];
20486
21050
  var wideRanges = [4352, 4447, 8986, 8987, 9001, 9002, 9193, 9196, 9200, 9200, 9203, 9203, 9725, 9726, 9748, 9749, 9776, 9783, 9800, 9811, 9855, 9855, 9866, 9871, 9875, 9875, 9889, 9889, 9898, 9899, 9917, 9918, 9924, 9925, 9934, 9934, 9940, 9940, 9962, 9962, 9970, 9971, 9973, 9973, 9978, 9978, 9981, 9981, 9989, 9989, 9994, 9995, 10024, 10024, 10060, 10060, 10062, 10062, 10067, 10069, 10071, 10071, 10133, 10135, 10160, 10160, 10175, 10175, 11035, 11036, 11088, 11088, 11093, 11093, 11904, 11929, 11931, 12019, 12032, 12245, 12272, 12287, 12289, 12350, 12353, 12438, 12441, 12543, 12549, 12591, 12593, 12686, 12688, 12773, 12783, 12830, 12832, 12871, 12880, 42124, 42128, 42182, 43360, 43388, 44032, 55203, 63744, 64255, 65040, 65049, 65072, 65106, 65108, 65126, 65128, 65131, 94176, 94180, 94192, 94198, 94208, 101589, 101631, 101662, 101760, 101874, 110576, 110579, 110581, 110587, 110589, 110590, 110592, 110882, 110898, 110898, 110928, 110930, 110933, 110933, 110948, 110951, 110960, 111355, 119552, 119638, 119648, 119670, 126980, 126980, 127183, 127183, 127374, 127374, 127377, 127386, 127488, 127490, 127504, 127547, 127552, 127560, 127568, 127569, 127584, 127589, 127744, 127776, 127789, 127797, 127799, 127868, 127870, 127891, 127904, 127946, 127951, 127955, 127968, 127984, 127988, 127988, 127992, 128062, 128064, 128064, 128066, 128252, 128255, 128317, 128331, 128334, 128336, 128359, 128378, 128378, 128405, 128406, 128420, 128420, 128507, 128591, 128640, 128709, 128716, 128716, 128720, 128722, 128725, 128728, 128732, 128735, 128747, 128748, 128756, 128764, 128992, 129003, 129008, 129008, 129292, 129338, 129340, 129349, 129351, 129535, 129648, 129660, 129664, 129674, 129678, 129734, 129736, 129736, 129741, 129756, 129759, 129770, 129775, 129784, 131072, 196605, 196608, 262141];
20487
21051
 
20488
- // ../../node_modules/get-east-asian-width/utilities.js
21052
+ // ../../node_modules/.bun/get-east-asian-width@1.5.0/node_modules/get-east-asian-width/utilities.js
20489
21053
  var isInRange = (ranges, codePoint) => {
20490
21054
  let low = 0;
20491
21055
  let high = Math.floor(ranges.length / 2) - 1;
@@ -20503,7 +21067,7 @@ var isInRange = (ranges, codePoint) => {
20503
21067
  return false;
20504
21068
  };
20505
21069
 
20506
- // ../../node_modules/get-east-asian-width/lookup.js
21070
+ // ../../node_modules/.bun/get-east-asian-width@1.5.0/node_modules/get-east-asian-width/lookup.js
20507
21071
  var minimumAmbiguousCodePoint = ambiguousRanges[0];
20508
21072
  var maximumAmbiguousCodePoint = ambiguousRanges.at(-1);
20509
21073
  var minimumFullWidthCodePoint = fullwidthRanges[0];
@@ -20532,19 +21096,19 @@ function findWideFastPathRange(ranges) {
20532
21096
  }
20533
21097
  return [fastPathStart, fastPathEnd];
20534
21098
  }
20535
- var isAmbiguous = (codePoint) => {
21099
+ var isAmbiguous2 = (codePoint) => {
20536
21100
  if (codePoint < minimumAmbiguousCodePoint || codePoint > maximumAmbiguousCodePoint) {
20537
21101
  return false;
20538
21102
  }
20539
21103
  return isInRange(ambiguousRanges, codePoint);
20540
21104
  };
20541
- var isFullWidth = (codePoint) => {
21105
+ var isFullWidth2 = (codePoint) => {
20542
21106
  if (codePoint < minimumFullWidthCodePoint || codePoint > maximumFullWidthCodePoint) {
20543
21107
  return false;
20544
21108
  }
20545
21109
  return isInRange(fullwidthRanges, codePoint);
20546
21110
  };
20547
- var isWide = (codePoint) => {
21111
+ var isWide2 = (codePoint) => {
20548
21112
  if (codePoint >= wideFastPathStart && codePoint <= wideFastPathEnd) {
20549
21113
  return true;
20550
21114
  }
@@ -20554,7 +21118,7 @@ var isWide = (codePoint) => {
20554
21118
  return isInRange(wideRanges, codePoint);
20555
21119
  };
20556
21120
 
20557
- // ../../node_modules/get-east-asian-width/index.js
21121
+ // ../../node_modules/.bun/get-east-asian-width@1.5.0/node_modules/get-east-asian-width/index.js
20558
21122
  function validate(codePoint) {
20559
21123
  if (!Number.isSafeInteger(codePoint)) {
20560
21124
  throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
@@ -20562,13 +21126,13 @@ function validate(codePoint) {
20562
21126
  }
20563
21127
  function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
20564
21128
  validate(codePoint);
20565
- if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) {
21129
+ if (isFullWidth2(codePoint) || isWide2(codePoint) || ambiguousAsWide && isAmbiguous2(codePoint)) {
20566
21130
  return 2;
20567
21131
  }
20568
21132
  return 1;
20569
21133
  }
20570
21134
 
20571
- // ../../node_modules/string-width/index.js
21135
+ // ../../node_modules/.bun/string-width@7.2.0/node_modules/string-width/index.js
20572
21136
  var import_emoji_regex = __toESM(require_emoji_regex(), 1);
20573
21137
  var segmenter = new Intl.Segmenter;
20574
21138
  var defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
@@ -20617,12 +21181,12 @@ function stringWidth(string4, options = {}) {
20617
21181
  return width;
20618
21182
  }
20619
21183
 
20620
- // ../../node_modules/is-interactive/index.js
21184
+ // ../../node_modules/.bun/is-interactive@2.0.0/node_modules/is-interactive/index.js
20621
21185
  function isInteractive({ stream = process.stdout } = {}) {
20622
21186
  return Boolean(stream && stream.isTTY && process.env.TERM !== "dumb" && !("CI" in process.env));
20623
21187
  }
20624
21188
 
20625
- // ../../node_modules/is-unicode-supported/index.js
21189
+ // ../../node_modules/.bun/is-unicode-supported@2.1.0/node_modules/is-unicode-supported/index.js
20626
21190
  import process8 from "node:process";
20627
21191
  function isUnicodeSupported2() {
20628
21192
  const { env: env2 } = process8;
@@ -20633,7 +21197,7 @@ function isUnicodeSupported2() {
20633
21197
  return Boolean(env2.WT_SESSION) || Boolean(env2.TERMINUS_SUBLIME) || env2.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM2 === "xterm-256color" || TERM2 === "alacritty" || TERM2 === "rxvt-unicode" || TERM2 === "rxvt-unicode-256color" || env2.TERMINAL_EMULATOR === "JetBrains-JediTerm";
20634
21198
  }
20635
21199
 
20636
- // ../../node_modules/stdin-discarder/index.js
21200
+ // ../../node_modules/.bun/stdin-discarder@0.2.2/node_modules/stdin-discarder/index.js
20637
21201
  import process9 from "node:process";
20638
21202
  var ASCII_ETX_CODE = 3;
20639
21203
 
@@ -20679,7 +21243,7 @@ class StdinDiscarder {
20679
21243
  var stdinDiscarder = new StdinDiscarder;
20680
21244
  var stdin_discarder_default = stdinDiscarder;
20681
21245
 
20682
- // ../../node_modules/ora/index.js
21246
+ // ../../node_modules/.bun/ora@8.2.0/node_modules/ora/index.js
20683
21247
  var import_cli_spinners2 = __toESM(require_cli_spinners(), 1);
20684
21248
 
20685
21249
  class Ora {
@@ -21005,34 +21569,43 @@ var createOptionsSchema = exports_external.object({
21005
21569
  target: exports_external.string().optional(),
21006
21570
  yes: exports_external.boolean(),
21007
21571
  install: exports_external.boolean(),
21008
- fromGit: exports_external.string().optional()
21572
+ electron: exports_external.boolean().optional(),
21573
+ fromGit: exports_external.string().optional(),
21574
+ packageManager: exports_external.enum(["bun", "npm", "pnpm", "yarn"]).optional()
21009
21575
  });
21010
- var create = new Command().name("create").description("scaffold a new ChatJS chat application").argument("[directory]", "target directory for the project").option("-y, --yes", "skip prompts and use defaults", false).option("--no-install", "skip dependency installation").option("--from-git <url>", "clone from a git repository instead of the built-in scaffold").action(async (directory, opts) => {
21576
+ var create = new Command().name("create").description("scaffold a new ChatJS chat application").argument("[directory]", "target directory for the project").option("-y, --yes", "skip prompts and use defaults", false).option("--no-install", "skip dependency installation").option("--electron", "include the Electron desktop app").option("--no-electron", "do not include the Electron desktop app").option("--package-manager <manager>", "package manager for install + next steps (bun, npm, pnpm, yarn)").option("--from-git <url>", "clone from a git repository instead of the built-in scaffold").action(async (directory, opts) => {
21011
21577
  try {
21012
21578
  const options = createOptionsSchema.parse({
21013
21579
  target: directory,
21014
21580
  ...opts
21015
21581
  });
21016
- const packageManager = inferPackageManager();
21582
+ const packageManager = options.packageManager ?? inferPackageManager();
21017
21583
  if (!options.yes) {
21018
- We("Create ChatJS App");
21584
+ mt("Create ChatJS App");
21019
21585
  }
21020
21586
  const projectName = await promptProjectName(options.target, options.yes);
21021
21587
  const targetDir = resolve2(process.cwd(), projectName);
21022
21588
  await ensureTargetEmpty(targetDir);
21023
- const appName = projectName.split("-").map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join(" ");
21589
+ const appName = projectName.split("-").map((w3) => w3.charAt(0).toUpperCase() + w3.slice(1)).join(" ");
21024
21590
  const appPrefix = projectName;
21025
21591
  const appUrl = "http://localhost:3000";
21026
21592
  const gateway = await promptGateway(options.yes);
21027
21593
  const features = await promptFeatures(options.yes);
21028
21594
  const auth = await promptAuth(options.yes);
21595
+ const withElectron = await promptElectron(options.yes, options.electron);
21029
21596
  logger.break();
21030
21597
  const scaffoldSpinner = spinner("Scaffolding project...").start();
21031
21598
  try {
21032
21599
  if (options.fromGit) {
21033
21600
  await scaffoldFromGit(options.fromGit, targetDir);
21034
21601
  } else {
21035
- await scaffoldFromTemplate(targetDir);
21602
+ await scaffoldFromTemplate(targetDir, { packageManager });
21603
+ }
21604
+ if (withElectron) {
21605
+ await scaffoldElectron(targetDir, {
21606
+ projectName,
21607
+ packageManager
21608
+ });
21036
21609
  }
21037
21610
  scaffoldSpinner.succeed("Project scaffolded.");
21038
21611
  } catch (error48) {
@@ -21042,19 +21615,20 @@ var create = new Command().name("create").description("scaffold a new ChatJS cha
21042
21615
  const configSpinner = spinner("Writing configuration...").start();
21043
21616
  try {
21044
21617
  const packageJsonPath = join2(targetDir, "package.json");
21045
- const packageJson = JSON.parse(await readFile(packageJsonPath, "utf8"));
21618
+ const packageJson = JSON.parse(await readFile2(packageJsonPath, "utf8"));
21046
21619
  packageJson.name = projectName;
21047
- await writeFile(packageJsonPath, `${JSON.stringify(packageJson, null, 2)}
21620
+ await writeFile2(packageJsonPath, `${JSON.stringify(packageJson, null, 2)}
21048
21621
  `);
21049
21622
  const configSource = buildConfigTs({
21050
21623
  appName,
21051
21624
  appPrefix,
21052
21625
  appUrl,
21626
+ withElectron,
21053
21627
  gateway,
21054
21628
  features,
21055
21629
  auth
21056
21630
  });
21057
- await writeFile(join2(targetDir, "chat.config.ts"), configSource);
21631
+ await writeFile2(join2(targetDir, "chat.config.ts"), configSource);
21058
21632
  configSpinner.succeed("Configuration written.");
21059
21633
  } catch (error48) {
21060
21634
  configSpinner.fail("Failed to write configuration.");
@@ -21072,7 +21646,7 @@ var create = new Command().name("create").description("scaffold a new ChatJS cha
21072
21646
  }
21073
21647
  }
21074
21648
  const envEntries = collectEnvChecklist({ gateway, features, auth });
21075
- Le("Your ChatJS app is ready!");
21649
+ gt("Your ChatJS app is ready!");
21076
21650
  logger.info("Next steps:");
21077
21651
  logger.break();
21078
21652
  logger.log(` ${highlighter.dim("1.")} cd ${highlighter.info(projectName)}`);
@@ -21085,6 +21659,11 @@ var create = new Command().name("create").description("scaffold a new ChatJS cha
21085
21659
  logger.log(` ${highlighter.dim("3.")} ${highlighter.info(`${packageManager} run db:push`)}`);
21086
21660
  logger.log(` ${highlighter.dim("4.")} ${highlighter.info(`${packageManager} run dev`)}`);
21087
21661
  }
21662
+ if (withElectron) {
21663
+ logger.break();
21664
+ logger.info("Electron desktop app:");
21665
+ logger.log(` Run the web app first, then: ${highlighter.info(`cd electron && ${packageManager} install && ${packageManager} run dev`)}`);
21666
+ }
21088
21667
  logger.break();
21089
21668
  printEnvChecklist(envEntries);
21090
21669
  logger.break();