@exem-ui/cli 0.3.2 → 0.3.3-next.20260326004724

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -873,6 +873,19 @@ function getInstallCommand(pm, packages) {
873
873
  return `npm install ${pkgs}`;
874
874
  }
875
875
  }
876
+ function getUninstallCommand(pm, packages) {
877
+ const pkgs = packages.join(" ");
878
+ switch (pm) {
879
+ case "pnpm":
880
+ return `pnpm remove ${pkgs}`;
881
+ case "yarn":
882
+ return `yarn remove ${pkgs}`;
883
+ case "bun":
884
+ return `bun remove ${pkgs}`;
885
+ case "npm":
886
+ return `npm uninstall ${pkgs}`;
887
+ }
888
+ }
876
889
 
877
890
  // src/utils/file-ops.ts
878
891
  import { existsSync as existsSync2, readFileSync, writeFileSync } from "fs";
@@ -905,6 +918,25 @@ function writeFile(filePath, content) {
905
918
  function resolveFromCwd(...segments) {
906
919
  return resolve2(process.cwd(), ...segments);
907
920
  }
921
+ function pinDistTag(packages, tag) {
922
+ const pkgPath = resolveFromCwd("package.json");
923
+ const pkg = readJson(pkgPath);
924
+ if (!pkg) {
925
+ return;
926
+ }
927
+ const deps = pkg.dependencies ?? {};
928
+ let changed = false;
929
+ for (const name of packages) {
930
+ if (deps[name] && deps[name] !== tag) {
931
+ deps[name] = tag;
932
+ changed = true;
933
+ }
934
+ }
935
+ if (changed) {
936
+ pkg.dependencies = deps;
937
+ writeJson(pkgPath, pkg);
938
+ }
939
+ }
908
940
 
909
941
  // src/utils/packages.ts
910
942
  var PACKAGES = [
@@ -930,6 +962,40 @@ var PACKAGES = [
930
962
  // src/commands/init.ts
931
963
  async function init() {
932
964
  we(import_picocolors2.default.bgCyan(import_picocolors2.default.black(" Exem UI Setup ")));
965
+ const configPath = resolveFromCwd("exem-ui.config.json");
966
+ const prevConfig = readJson(configPath);
967
+ if (prevConfig) {
968
+ v2.info(
969
+ `Existing setup detected (${import_picocolors2.default.cyan(prevConfig.channel)} channel, ${prevConfig.packages.length} packages).`
970
+ );
971
+ v2.info("Previous packages will be removed before re-installing.");
972
+ }
973
+ const options = await promptOptions(prevConfig);
974
+ await installPackages(options, prevConfig !== null);
975
+ writeJson(configPath, {
976
+ packages: options.packages,
977
+ tailwind: options.tailwind,
978
+ channel: options.channel
979
+ });
980
+ v2.success(`Created ${import_picocolors2.default.cyan("exem-ui.config.json")}`);
981
+ configureTailwind(options.tailwind);
982
+ configureBaseStyles(options.tailwind);
983
+ const addScript = await me({
984
+ message: "Add an update:exem-ui script to package.json?",
985
+ initialValue: true
986
+ });
987
+ if (!BD(addScript) && addScript) {
988
+ addUpdateScript(options);
989
+ }
990
+ fe(import_picocolors2.default.green("Exem UI setup complete!"));
991
+ }
992
+ function cancelAndExit(value) {
993
+ if (BD(value)) {
994
+ ve("Setup cancelled.");
995
+ process.exit(0);
996
+ }
997
+ }
998
+ async function promptOptions(prevConfig) {
933
999
  const detectedPm = detectPackageManager();
934
1000
  const pm = await de({
935
1001
  message: "Which package manager do you use?",
@@ -938,103 +1004,89 @@ async function init() {
938
1004
  ...["pnpm", "npm", "yarn", "bun"].filter((v3) => v3 !== detectedPm).map((v3) => ({ value: v3, label: v3 }))
939
1005
  ]
940
1006
  });
941
- if (BD(pm)) {
942
- ve("Setup cancelled.");
943
- process.exit(0);
944
- }
1007
+ cancelAndExit(pm);
1008
+ const prevHasReact = prevConfig?.packages.includes("@exem-ui/react");
945
1009
  const framework = await de({
946
1010
  message: "Which framework are you using?",
947
1011
  options: [
948
1012
  { value: "react", label: "React", hint: "React 19+ components available" },
949
- {
950
- value: "none",
951
- label: "Other / None",
952
- hint: "Core tokens + Tailwind preset only"
953
- }
954
- ]
1013
+ { value: "none", label: "Other / None", hint: "Core tokens + Tailwind preset only" }
1014
+ ],
1015
+ initialValue: prevHasReact ? "react" : void 0
955
1016
  });
956
- if (BD(framework)) {
957
- ve("Setup cancelled.");
958
- process.exit(0);
959
- }
1017
+ cancelAndExit(framework);
960
1018
  const tailwind = await de({
961
1019
  message: "Which Tailwind CSS version are you using?",
962
1020
  options: [
963
1021
  { value: "v4", label: "Tailwind CSS v4", hint: "CSS-first configuration" },
964
1022
  { value: "v3", label: "Tailwind CSS v3", hint: "Plugin-based configuration" },
965
1023
  { value: "none", label: "Not using Tailwind CSS" }
966
- ]
1024
+ ],
1025
+ initialValue: prevConfig?.tailwind
967
1026
  });
968
- if (BD(tailwind)) {
969
- ve("Setup cancelled.");
970
- process.exit(0);
971
- }
972
- const initialPackages = ["@exem-ui/core"];
973
- if (framework === "react") {
974
- initialPackages.push("@exem-ui/react");
975
- }
976
- if (tailwind === "v3") {
977
- initialPackages.push("@exem-ui/tailwindcss3");
978
- } else if (tailwind === "v4") {
979
- initialPackages.push("@exem-ui/tailwindcss4");
980
- }
981
- const packageOptions = PACKAGES.filter((pkg) => {
982
- if (tailwind === "v3" && pkg.name === "@exem-ui/tailwindcss4") {
983
- return false;
984
- }
985
- if (tailwind === "v4" && pkg.name === "@exem-ui/tailwindcss3") {
986
- return false;
987
- }
988
- if (tailwind === "none") {
989
- if (pkg.name === "@exem-ui/tailwindcss3" || pkg.name === "@exem-ui/tailwindcss4") {
990
- return false;
991
- }
992
- }
993
- return true;
1027
+ cancelAndExit(tailwind);
1028
+ const selectedPackages = await promptPackages(prevConfig, framework, tailwind);
1029
+ const channel = await de({
1030
+ message: "Which release channel?",
1031
+ options: [
1032
+ { value: "latest", label: "Stable (latest)", hint: "Recommended" },
1033
+ { value: "next", label: "Experimental (next)", hint: "Pre-release versions" }
1034
+ ],
1035
+ initialValue: prevConfig?.channel
994
1036
  });
995
- const selectedPackages = await pe({
1037
+ cancelAndExit(channel);
1038
+ return { packageManager: pm, framework, packages: selectedPackages, tailwind, channel };
1039
+ }
1040
+ async function promptPackages(prevConfig, framework, tailwind) {
1041
+ const defaults = prevConfig ? prevConfig.packages : buildDefaultPackages(framework, tailwind);
1042
+ const packageOptions = filterPackageOptions(tailwind);
1043
+ const selected = await pe({
996
1044
  message: "Which packages do you want to install?",
997
1045
  options: packageOptions.map((pkg) => ({
998
1046
  value: pkg.name,
999
1047
  label: pkg.name,
1000
1048
  hint: pkg.description
1001
1049
  })),
1002
- initialValues: initialPackages,
1050
+ initialValues: defaults.filter((name) => packageOptions.some((opt) => opt.name === name)),
1003
1051
  required: true
1004
1052
  });
1005
- if (BD(selectedPackages)) {
1006
- ve("Setup cancelled.");
1007
- process.exit(0);
1008
- }
1009
- if (!selectedPackages.includes("@exem-ui/core")) {
1010
- selectedPackages.unshift("@exem-ui/core");
1053
+ cancelAndExit(selected);
1054
+ if (!selected.includes("@exem-ui/core")) {
1055
+ selected.unshift("@exem-ui/core");
1011
1056
  v2.info(`${import_picocolors2.default.cyan("@exem-ui/core")} is required and has been added.`);
1012
1057
  }
1013
- const channel = await de({
1014
- message: "Which release channel?",
1015
- options: [
1016
- { value: "latest", label: "Stable (latest)", hint: "Recommended" },
1017
- { value: "next", label: "Experimental (next)", hint: "Pre-release versions" }
1018
- ]
1019
- });
1020
- if (BD(channel)) {
1021
- ve("Setup cancelled.");
1022
- process.exit(0);
1023
- }
1024
- const options = {
1025
- packageManager: pm,
1026
- framework,
1027
- packages: selectedPackages,
1028
- tailwind,
1029
- channel
1030
- };
1031
- const versionSuffix = channel === "next" ? "@next" : "";
1032
- const packagesToInstall = options.packages.map((pkg) => `${pkg}${versionSuffix}`);
1033
- const installCmd = getInstallCommand(options.packageManager, packagesToInstall);
1058
+ return selected;
1059
+ }
1060
+ async function installPackages(options, isReinit) {
1034
1061
  const s = L2();
1062
+ if (isReinit) {
1063
+ const pkgsToRemove = findInstalledExemPackages();
1064
+ if (pkgsToRemove.length > 0) {
1065
+ s.start("Removing existing packages...");
1066
+ try {
1067
+ const removeCmd = getUninstallCommand(options.packageManager, pkgsToRemove);
1068
+ execSync(removeCmd, { stdio: "pipe", cwd: process.cwd() });
1069
+ s.stop("Existing packages removed.");
1070
+ } catch {
1071
+ s.stop("Failed to remove packages. Retrying with --force...");
1072
+ try {
1073
+ const forceCmd = `${getUninstallCommand(options.packageManager, pkgsToRemove)} --force`;
1074
+ execSync(forceCmd, { stdio: "pipe", cwd: process.cwd() });
1075
+ } catch {
1076
+ v2.warning("Could not remove existing packages. Install may override them.");
1077
+ }
1078
+ }
1079
+ }
1080
+ }
1081
+ const versionSuffix = options.channel === "next" ? "@next" : "";
1082
+ const pkgs = options.packages.map((pkg) => `${pkg}${versionSuffix}`);
1083
+ const installCmd = getInstallCommand(options.packageManager, pkgs);
1035
1084
  s.start("Installing packages...");
1036
1085
  try {
1037
1086
  execSync(installCmd, { stdio: "pipe", cwd: process.cwd() });
1087
+ if (options.channel === "next") {
1088
+ pinDistTag(options.packages, "next");
1089
+ }
1038
1090
  s.stop("Packages installed.");
1039
1091
  } catch {
1040
1092
  s.stop("Installation failed.");
@@ -1042,27 +1094,13 @@ async function init() {
1042
1094
  v2.error("Please install the packages manually.");
1043
1095
  process.exit(1);
1044
1096
  }
1045
- const configPath = resolveFromCwd("exem-ui.config.json");
1046
- writeJson(configPath, {
1047
- packages: options.packages,
1048
- tailwind: options.tailwind,
1049
- channel: options.channel
1050
- });
1051
- v2.success(`Created ${import_picocolors2.default.cyan("exem-ui.config.json")}`);
1052
- if (options.tailwind === "v3") {
1097
+ }
1098
+ function configureTailwind(tailwind) {
1099
+ if (tailwind === "v3") {
1053
1100
  configureTailwindV3();
1054
- } else if (options.tailwind === "v4") {
1101
+ } else if (tailwind === "v4") {
1055
1102
  configureTailwindV4();
1056
1103
  }
1057
- configureBaseStyles(options.tailwind);
1058
- const addScript = await me({
1059
- message: "Add an update:exem-ui script to package.json?",
1060
- initialValue: true
1061
- });
1062
- if (!BD(addScript) && addScript) {
1063
- addUpdateScript(options);
1064
- }
1065
- fe(import_picocolors2.default.green("Exem UI setup complete!"));
1066
1104
  }
1067
1105
  function configureTailwindV3() {
1068
1106
  const configPath = resolveFromCwd("tailwind.config.ts");
@@ -1075,15 +1113,7 @@ function configureTailwindV3() {
1075
1113
  }
1076
1114
  }
1077
1115
  function configureTailwindV4() {
1078
- const cssFiles = ["src/index.css", "src/app.css", "src/global.css", "app/globals.css"];
1079
- let targetCss = null;
1080
- for (const file of cssFiles) {
1081
- const resolved = resolveFromCwd(file);
1082
- if (fileExists(resolved)) {
1083
- targetCss = resolved;
1084
- break;
1085
- }
1086
- }
1116
+ const targetCss = findCssEntryFile();
1087
1117
  if (targetCss) {
1088
1118
  const content = readFile(targetCss);
1089
1119
  if (content?.includes("@exem-ui/tailwindcss4")) {
@@ -1108,15 +1138,7 @@ function configureBaseStyles(tailwind) {
1108
1138
  if (tailwind === "none") {
1109
1139
  return;
1110
1140
  }
1111
- const cssFiles = ["src/index.css", "src/app.css", "src/global.css", "app/globals.css"];
1112
- let targetCss = null;
1113
- for (const file of cssFiles) {
1114
- const resolved = resolveFromCwd(file);
1115
- if (fileExists(resolved)) {
1116
- targetCss = resolved;
1117
- break;
1118
- }
1119
- }
1141
+ const targetCss = findCssEntryFile();
1120
1142
  if (!targetCss) {
1121
1143
  return;
1122
1144
  }
@@ -1142,6 +1164,55 @@ function addUpdateScript(options) {
1142
1164
  writeJson(pkgPath, pkg);
1143
1165
  v2.success(`Added ${import_picocolors2.default.cyan("update:exem-ui")} script to package.json.`);
1144
1166
  }
1167
+ var CSS_ENTRY_FILES = ["src/index.css", "src/app.css", "src/global.css", "app/globals.css"];
1168
+ function findCssEntryFile() {
1169
+ for (const file of CSS_ENTRY_FILES) {
1170
+ const resolved = resolveFromCwd(file);
1171
+ if (fileExists(resolved)) {
1172
+ return resolved;
1173
+ }
1174
+ }
1175
+ return null;
1176
+ }
1177
+ function buildDefaultPackages(framework, tailwind) {
1178
+ const pkgs = ["@exem-ui/core"];
1179
+ if (framework === "react") {
1180
+ pkgs.push("@exem-ui/react");
1181
+ }
1182
+ if (tailwind === "v3") {
1183
+ pkgs.push("@exem-ui/tailwindcss3");
1184
+ } else if (tailwind === "v4") {
1185
+ pkgs.push("@exem-ui/tailwindcss4");
1186
+ }
1187
+ return pkgs;
1188
+ }
1189
+ function filterPackageOptions(tailwind) {
1190
+ return PACKAGES.filter((pkg) => {
1191
+ if (tailwind === "v3" && pkg.name === "@exem-ui/tailwindcss4") {
1192
+ return false;
1193
+ }
1194
+ if (tailwind === "v4" && pkg.name === "@exem-ui/tailwindcss3") {
1195
+ return false;
1196
+ }
1197
+ if (tailwind === "none") {
1198
+ if (pkg.name === "@exem-ui/tailwindcss3" || pkg.name === "@exem-ui/tailwindcss4") {
1199
+ return false;
1200
+ }
1201
+ }
1202
+ return true;
1203
+ });
1204
+ }
1205
+ function findInstalledExemPackages() {
1206
+ const pkgPath = resolveFromCwd("package.json");
1207
+ const pkg = readJson(pkgPath);
1208
+ if (!pkg) {
1209
+ return [];
1210
+ }
1211
+ const deps = pkg.dependencies ?? {};
1212
+ const devDeps = pkg.devDependencies ?? {};
1213
+ const allDeps = { ...deps, ...devDeps };
1214
+ return Object.keys(allDeps).filter((name) => name.startsWith("@exem-ui/"));
1215
+ }
1145
1216
 
1146
1217
  // src/index.ts
1147
1218
  var VERSION = "0.1.0";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js","../../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js","../src/commands/init.ts","../../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/node_modules/.pnpm/ansi-regex@6.1.0/node_modules/ansi-regex/index.js","../../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/node_modules/.pnpm/strip-ansi@7.1.0/node_modules/strip-ansi/index.js","../../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/node_modules/.pnpm/eastasianwidth@0.2.0/node_modules/eastasianwidth/eastasianwidth.js","../../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/node_modules/.pnpm/emoji-regex@9.2.2/node_modules/emoji-regex/index.js","../../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/node_modules/.pnpm/string-width@5.1.2/node_modules/string-width/index.js","../../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/node_modules/.pnpm/ansi-styles@6.2.1/node_modules/ansi-styles/index.js","../../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/node_modules/.pnpm/wrap-ansi@8.1.0/node_modules/wrap-ansi/index.js","../../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/@clack/core/src/utils/settings.ts","../../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/@clack/core/src/utils/string.ts","../../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/@clack/core/src/utils/index.ts","../../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/@clack/core/src/prompts/prompt.ts","../../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/@clack/core/src/prompts/confirm.ts","../../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/@clack/core/src/prompts/group-multiselect.ts","../../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/@clack/core/src/prompts/multi-select.ts","../../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/@clack/core/src/prompts/password.ts","../../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/@clack/core/src/prompts/select.ts","../../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/@clack/core/src/prompts/select-key.ts","../../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/@clack/core/src/prompts/text.ts","../../../node_modules/.pnpm/@clack+prompts@0.9.1/node_modules/node_modules/.pnpm/is-unicode-supported@1.3.0/node_modules/is-unicode-supported/index.js","../../../node_modules/.pnpm/@clack+prompts@0.9.1/node_modules/@clack/prompts/src/index.ts","../src/templates/tailwind-v3.ts","../src/templates/tailwind-v4.ts","../src/utils/detect-pm.ts","../src/utils/file-ops.ts","../src/utils/packages.ts","../src/index.ts"],"sourcesContent":["'use strict';\n\nconst ESC = '\\x1B';\nconst CSI = `${ESC}[`;\nconst beep = '\\u0007';\n\nconst cursor = {\n to(x, y) {\n if (!y) return `${CSI}${x + 1}G`;\n return `${CSI}${y + 1};${x + 1}H`;\n },\n move(x, y) {\n let ret = '';\n\n if (x < 0) ret += `${CSI}${-x}D`;\n else if (x > 0) ret += `${CSI}${x}C`;\n\n if (y < 0) ret += `${CSI}${-y}A`;\n else if (y > 0) ret += `${CSI}${y}B`;\n\n return ret;\n },\n up: (count = 1) => `${CSI}${count}A`,\n down: (count = 1) => `${CSI}${count}B`,\n forward: (count = 1) => `${CSI}${count}C`,\n backward: (count = 1) => `${CSI}${count}D`,\n nextLine: (count = 1) => `${CSI}E`.repeat(count),\n prevLine: (count = 1) => `${CSI}F`.repeat(count),\n left: `${CSI}G`,\n hide: `${CSI}?25l`,\n show: `${CSI}?25h`,\n save: `${ESC}7`,\n restore: `${ESC}8`\n}\n\nconst scroll = {\n up: (count = 1) => `${CSI}S`.repeat(count),\n down: (count = 1) => `${CSI}T`.repeat(count)\n}\n\nconst erase = {\n screen: `${CSI}2J`,\n up: (count = 1) => `${CSI}1J`.repeat(count),\n down: (count = 1) => `${CSI}J`.repeat(count),\n line: `${CSI}2K`,\n lineEnd: `${CSI}K`,\n lineStart: `${CSI}1K`,\n lines(count) {\n let clear = '';\n for (let i = 0; i < count; i++)\n clear += this.line + (i < count - 1 ? cursor.up() : '');\n if (count)\n clear += cursor.left;\n return clear;\n }\n}\n\nmodule.exports = { cursor, scroll, erase, beep };\n","let p = process || {}, argv = p.argv || [], env = p.env || {}\nlet isColorSupported =\n\t!(!!env.NO_COLOR || argv.includes(\"--no-color\")) &&\n\t(!!env.FORCE_COLOR || argv.includes(\"--color\") || p.platform === \"win32\" || ((p.stdout || {}).isTTY && env.TERM !== \"dumb\") || !!env.CI)\n\nlet formatter = (open, close, replace = open) =>\n\tinput => {\n\t\tlet string = \"\" + input, index = string.indexOf(close, open.length)\n\t\treturn ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close\n\t}\n\nlet replaceClose = (string, close, replace, index) => {\n\tlet result = \"\", cursor = 0\n\tdo {\n\t\tresult += string.substring(cursor, index) + replace\n\t\tcursor = index + close.length\n\t\tindex = string.indexOf(close, cursor)\n\t} while (~index)\n\treturn result + string.substring(cursor)\n}\n\nlet createColors = (enabled = isColorSupported) => {\n\tlet f = enabled ? formatter : () => String\n\treturn {\n\t\tisColorSupported: enabled,\n\t\treset: f(\"\\x1b[0m\", \"\\x1b[0m\"),\n\t\tbold: f(\"\\x1b[1m\", \"\\x1b[22m\", \"\\x1b[22m\\x1b[1m\"),\n\t\tdim: f(\"\\x1b[2m\", \"\\x1b[22m\", \"\\x1b[22m\\x1b[2m\"),\n\t\titalic: f(\"\\x1b[3m\", \"\\x1b[23m\"),\n\t\tunderline: f(\"\\x1b[4m\", \"\\x1b[24m\"),\n\t\tinverse: f(\"\\x1b[7m\", \"\\x1b[27m\"),\n\t\thidden: f(\"\\x1b[8m\", \"\\x1b[28m\"),\n\t\tstrikethrough: f(\"\\x1b[9m\", \"\\x1b[29m\"),\n\n\t\tblack: f(\"\\x1b[30m\", \"\\x1b[39m\"),\n\t\tred: f(\"\\x1b[31m\", \"\\x1b[39m\"),\n\t\tgreen: f(\"\\x1b[32m\", \"\\x1b[39m\"),\n\t\tyellow: f(\"\\x1b[33m\", \"\\x1b[39m\"),\n\t\tblue: f(\"\\x1b[34m\", \"\\x1b[39m\"),\n\t\tmagenta: f(\"\\x1b[35m\", \"\\x1b[39m\"),\n\t\tcyan: f(\"\\x1b[36m\", \"\\x1b[39m\"),\n\t\twhite: f(\"\\x1b[37m\", \"\\x1b[39m\"),\n\t\tgray: f(\"\\x1b[90m\", \"\\x1b[39m\"),\n\n\t\tbgBlack: f(\"\\x1b[40m\", \"\\x1b[49m\"),\n\t\tbgRed: f(\"\\x1b[41m\", \"\\x1b[49m\"),\n\t\tbgGreen: f(\"\\x1b[42m\", \"\\x1b[49m\"),\n\t\tbgYellow: f(\"\\x1b[43m\", \"\\x1b[49m\"),\n\t\tbgBlue: f(\"\\x1b[44m\", \"\\x1b[49m\"),\n\t\tbgMagenta: f(\"\\x1b[45m\", \"\\x1b[49m\"),\n\t\tbgCyan: f(\"\\x1b[46m\", \"\\x1b[49m\"),\n\t\tbgWhite: f(\"\\x1b[47m\", \"\\x1b[49m\"),\n\n\t\tblackBright: f(\"\\x1b[90m\", \"\\x1b[39m\"),\n\t\tredBright: f(\"\\x1b[91m\", \"\\x1b[39m\"),\n\t\tgreenBright: f(\"\\x1b[92m\", \"\\x1b[39m\"),\n\t\tyellowBright: f(\"\\x1b[93m\", \"\\x1b[39m\"),\n\t\tblueBright: f(\"\\x1b[94m\", \"\\x1b[39m\"),\n\t\tmagentaBright: f(\"\\x1b[95m\", \"\\x1b[39m\"),\n\t\tcyanBright: f(\"\\x1b[96m\", \"\\x1b[39m\"),\n\t\twhiteBright: f(\"\\x1b[97m\", \"\\x1b[39m\"),\n\n\t\tbgBlackBright: f(\"\\x1b[100m\", \"\\x1b[49m\"),\n\t\tbgRedBright: f(\"\\x1b[101m\", \"\\x1b[49m\"),\n\t\tbgGreenBright: f(\"\\x1b[102m\", \"\\x1b[49m\"),\n\t\tbgYellowBright: f(\"\\x1b[103m\", \"\\x1b[49m\"),\n\t\tbgBlueBright: f(\"\\x1b[104m\", \"\\x1b[49m\"),\n\t\tbgMagentaBright: f(\"\\x1b[105m\", \"\\x1b[49m\"),\n\t\tbgCyanBright: f(\"\\x1b[106m\", \"\\x1b[49m\"),\n\t\tbgWhiteBright: f(\"\\x1b[107m\", \"\\x1b[49m\"),\n\t}\n}\n\nmodule.exports = createColors()\nmodule.exports.createColors = createColors\n","import { execSync } from 'node:child_process';\nimport * as p from '@clack/prompts';\nimport pc from 'picocolors';\nimport { TAILWIND_V3_CONFIG, TAILWIND_V3_MANUAL_MSG } from '../templates/tailwind-v3';\nimport { TAILWIND_V4_IMPORT, TAILWIND_V4_MANUAL_MSG } from '../templates/tailwind-v4';\nimport type {\n Framework,\n InitOptions,\n PackageManager,\n ReleaseChannel,\n TailwindVersion,\n} from '../types';\nimport { detectPackageManager, getInstallCommand } from '../utils/detect-pm';\nimport {\n fileExists,\n readFile,\n readJson,\n resolveFromCwd,\n writeFile,\n writeJson,\n} from '../utils/file-ops';\nimport { PACKAGES } from '../utils/packages';\n\nexport async function init() {\n p.intro(pc.bgCyan(pc.black(' Exem UI Setup ')));\n\n // 1. Package manager\n const detectedPm = detectPackageManager();\n\n const pm = (await p.select({\n message: 'Which package manager do you use?',\n options: [\n { value: detectedPm, label: `${detectedPm} (detected)` },\n ...(['pnpm', 'npm', 'yarn', 'bun'] as const)\n .filter((v) => v !== detectedPm)\n .map((v) => ({ value: v, label: v })),\n ],\n })) as PackageManager;\n\n if (p.isCancel(pm)) {\n p.cancel('Setup cancelled.');\n process.exit(0);\n }\n\n // 2. Framework\n const framework = (await p.select({\n message: 'Which framework are you using?',\n options: [\n { value: 'react', label: 'React', hint: 'React 19+ components available' },\n {\n value: 'none',\n label: 'Other / None',\n hint: 'Core tokens + Tailwind preset only',\n },\n ],\n })) as Framework;\n\n if (p.isCancel(framework)) {\n p.cancel('Setup cancelled.');\n process.exit(0);\n }\n\n // 3. Tailwind version\n const tailwind = (await p.select({\n message: 'Which Tailwind CSS version are you using?',\n options: [\n { value: 'v4', label: 'Tailwind CSS v4', hint: 'CSS-first configuration' },\n { value: 'v3', label: 'Tailwind CSS v3', hint: 'Plugin-based configuration' },\n { value: 'none', label: 'Not using Tailwind CSS' },\n ],\n })) as TailwindVersion;\n\n if (p.isCancel(tailwind)) {\n p.cancel('Setup cancelled.');\n process.exit(0);\n }\n\n // 4. Packages (auto-defaults based on framework + tailwind)\n const initialPackages = ['@exem-ui/core'];\n if (framework === 'react') {\n initialPackages.push('@exem-ui/react');\n }\n if (tailwind === 'v3') {\n initialPackages.push('@exem-ui/tailwindcss3');\n } else if (tailwind === 'v4') {\n initialPackages.push('@exem-ui/tailwindcss4');\n }\n\n const packageOptions = PACKAGES.filter((pkg) => {\n if (tailwind === 'v3' && pkg.name === '@exem-ui/tailwindcss4') {\n return false;\n }\n if (tailwind === 'v4' && pkg.name === '@exem-ui/tailwindcss3') {\n return false;\n }\n if (tailwind === 'none') {\n if (pkg.name === '@exem-ui/tailwindcss3' || pkg.name === '@exem-ui/tailwindcss4') {\n return false;\n }\n }\n return true;\n });\n\n const selectedPackages = (await p.multiselect({\n message: 'Which packages do you want to install?',\n options: packageOptions.map((pkg) => ({\n value: pkg.name,\n label: pkg.name,\n hint: pkg.description,\n })),\n initialValues: initialPackages,\n required: true,\n })) as string[];\n\n if (p.isCancel(selectedPackages)) {\n p.cancel('Setup cancelled.');\n process.exit(0);\n }\n\n if (!selectedPackages.includes('@exem-ui/core')) {\n selectedPackages.unshift('@exem-ui/core');\n p.log.info(`${pc.cyan('@exem-ui/core')} is required and has been added.`);\n }\n\n // 5. Release channel\n const channel = (await p.select({\n message: 'Which release channel?',\n options: [\n { value: 'latest', label: 'Stable (latest)', hint: 'Recommended' },\n { value: 'next', label: 'Experimental (next)', hint: 'Pre-release versions' },\n ],\n })) as ReleaseChannel;\n\n if (p.isCancel(channel)) {\n p.cancel('Setup cancelled.');\n process.exit(0);\n }\n\n const options: InitOptions = {\n packageManager: pm,\n framework,\n packages: selectedPackages,\n tailwind,\n channel,\n };\n\n // Install packages\n const versionSuffix = channel === 'next' ? '@next' : '';\n const packagesToInstall = options.packages.map((pkg) => `${pkg}${versionSuffix}`);\n const installCmd = getInstallCommand(options.packageManager, packagesToInstall);\n\n const s = p.spinner();\n s.start('Installing packages...');\n\n try {\n execSync(installCmd, { stdio: 'pipe', cwd: process.cwd() });\n s.stop('Packages installed.');\n } catch {\n s.stop('Installation failed.');\n p.log.error(`Failed to run: ${pc.dim(installCmd)}`);\n p.log.error('Please install the packages manually.');\n process.exit(1);\n }\n\n // Generate config file\n const configPath = resolveFromCwd('exem-ui.config.json');\n writeJson(configPath, {\n packages: options.packages,\n tailwind: options.tailwind,\n channel: options.channel,\n });\n p.log.success(`Created ${pc.cyan('exem-ui.config.json')}`);\n\n // Tailwind configuration\n if (options.tailwind === 'v3') {\n configureTailwindV3();\n } else if (options.tailwind === 'v4') {\n configureTailwindV4();\n }\n\n // Configure base styles\n configureBaseStyles(options.tailwind);\n\n // 6. Offer update script\n const addScript = await p.confirm({\n message: 'Add an update:exem-ui script to package.json?',\n initialValue: true,\n });\n\n if (!p.isCancel(addScript) && addScript) {\n addUpdateScript(options);\n }\n\n p.outro(pc.green('Exem UI setup complete!'));\n}\n\nfunction configureTailwindV3() {\n const configPath = resolveFromCwd('tailwind.config.ts');\n if (!fileExists(configPath)) {\n writeFile(configPath, TAILWIND_V3_CONFIG);\n p.log.success(`Created ${pc.cyan('tailwind.config.ts')} with Exem UI preset.`);\n } else {\n p.log.warning(`${pc.cyan('tailwind.config.ts')} already exists.`);\n p.log.message(TAILWIND_V3_MANUAL_MSG);\n }\n}\n\nfunction configureTailwindV4() {\n const cssFiles = ['src/index.css', 'src/app.css', 'src/global.css', 'app/globals.css'];\n let targetCss: string | null = null;\n\n for (const file of cssFiles) {\n const resolved = resolveFromCwd(file);\n if (fileExists(resolved)) {\n targetCss = resolved;\n break;\n }\n }\n\n if (targetCss) {\n const content = readFile(targetCss);\n if (content?.includes('@exem-ui/tailwindcss4')) {\n p.log.info('Exem UI Tailwind v4 import already present. Skipping.');\n return;\n }\n writeFile(targetCss, TAILWIND_V4_IMPORT + (content ?? ''));\n p.log.success(`Added Exem UI import to ${pc.cyan(targetCss)}.`);\n } else {\n p.log.warning('Could not find a CSS entry file.');\n p.log.message(TAILWIND_V4_MANUAL_MSG);\n }\n}\n\nconst BASE_STYLES = `\n/* Exem UI base styles */\nbody {\n background-color: var(--color-background-primary);\n color: var(--color-text-primary);\n}\n`;\n\nfunction configureBaseStyles(tailwind: TailwindVersion) {\n if (tailwind === 'none') {\n return;\n }\n\n const cssFiles = ['src/index.css', 'src/app.css', 'src/global.css', 'app/globals.css'];\n let targetCss: string | null = null;\n\n for (const file of cssFiles) {\n const resolved = resolveFromCwd(file);\n if (fileExists(resolved)) {\n targetCss = resolved;\n break;\n }\n }\n\n if (!targetCss) {\n return;\n }\n\n const content = readFile(targetCss);\n if (content?.includes('--color-background-primary')) {\n return;\n }\n\n writeFile(targetCss, (content ?? '') + BASE_STYLES);\n p.log.success(`Added base body styles to ${pc.cyan(targetCss)}.`);\n}\n\nfunction addUpdateScript(options: InitOptions) {\n const pkgPath = resolveFromCwd('package.json');\n const pkg = readJson<Record<string, unknown>>(pkgPath);\n if (!pkg) {\n return;\n }\n\n const versionSuffix = options.channel === 'next' ? '@next' : '@latest';\n const pkgs = options.packages.map((p) => `${p}${versionSuffix}`).join(' ');\n const cmd = getInstallCommand(options.packageManager, [pkgs]);\n\n const scripts = (pkg.scripts ?? {}) as Record<string, string>;\n scripts['update:exem-ui'] = cmd;\n pkg.scripts = scripts;\n\n writeJson(pkgPath, pkg);\n p.log.success(`Added ${pc.cyan('update:exem-ui')} script to package.json.`);\n}\n","export default function ansiRegex({onlyFirst = false} = {}) {\n\t// Valid string terminator sequences are BEL, ESC\\, and 0x9c\n\tconst ST = '(?:\\\\u0007|\\\\u001B\\\\u005C|\\\\u009C)';\n\tconst pattern = [\n\t\t`[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]+)*|[a-zA-Z\\\\d]+(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]*)*)?${ST})`,\n\t\t'(?:(?:\\\\d{1,4}(?:;\\\\d{0,4})*)?[\\\\dA-PR-TZcf-nq-uy=><~]))',\n\t].join('|');\n\n\treturn new RegExp(pattern, onlyFirst ? undefined : 'g');\n}\n","import ansiRegex from 'ansi-regex';\n\nconst regex = ansiRegex();\n\nexport default function stripAnsi(string) {\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError(`Expected a \\`string\\`, got \\`${typeof string}\\``);\n\t}\n\n\t// Even though the regex is global, we don't need to reset the `.lastIndex`\n\t// because unlike `.exec()` and `.test()`, `.replace()` does it automatically\n\t// and doing it manually has a performance penalty.\n\treturn string.replace(regex, '');\n}\n","var eaw = {};\n\nif ('undefined' == typeof module) {\n window.eastasianwidth = eaw;\n} else {\n module.exports = eaw;\n}\n\neaw.eastAsianWidth = function(character) {\n var x = character.charCodeAt(0);\n var y = (character.length == 2) ? character.charCodeAt(1) : 0;\n var codePoint = x;\n if ((0xD800 <= x && x <= 0xDBFF) && (0xDC00 <= y && y <= 0xDFFF)) {\n x &= 0x3FF;\n y &= 0x3FF;\n codePoint = (x << 10) | y;\n codePoint += 0x10000;\n }\n\n if ((0x3000 == codePoint) ||\n (0xFF01 <= codePoint && codePoint <= 0xFF60) ||\n (0xFFE0 <= codePoint && codePoint <= 0xFFE6)) {\n return 'F';\n }\n if ((0x20A9 == codePoint) ||\n (0xFF61 <= codePoint && codePoint <= 0xFFBE) ||\n (0xFFC2 <= codePoint && codePoint <= 0xFFC7) ||\n (0xFFCA <= codePoint && codePoint <= 0xFFCF) ||\n (0xFFD2 <= codePoint && codePoint <= 0xFFD7) ||\n (0xFFDA <= codePoint && codePoint <= 0xFFDC) ||\n (0xFFE8 <= codePoint && codePoint <= 0xFFEE)) {\n return 'H';\n }\n if ((0x1100 <= codePoint && codePoint <= 0x115F) ||\n (0x11A3 <= codePoint && codePoint <= 0x11A7) ||\n (0x11FA <= codePoint && codePoint <= 0x11FF) ||\n (0x2329 <= codePoint && codePoint <= 0x232A) ||\n (0x2E80 <= codePoint && codePoint <= 0x2E99) ||\n (0x2E9B <= codePoint && codePoint <= 0x2EF3) ||\n (0x2F00 <= codePoint && codePoint <= 0x2FD5) ||\n (0x2FF0 <= codePoint && codePoint <= 0x2FFB) ||\n (0x3001 <= codePoint && codePoint <= 0x303E) ||\n (0x3041 <= codePoint && codePoint <= 0x3096) ||\n (0x3099 <= codePoint && codePoint <= 0x30FF) ||\n (0x3105 <= codePoint && codePoint <= 0x312D) ||\n (0x3131 <= codePoint && codePoint <= 0x318E) ||\n (0x3190 <= codePoint && codePoint <= 0x31BA) ||\n (0x31C0 <= codePoint && codePoint <= 0x31E3) ||\n (0x31F0 <= codePoint && codePoint <= 0x321E) ||\n (0x3220 <= codePoint && codePoint <= 0x3247) ||\n (0x3250 <= codePoint && codePoint <= 0x32FE) ||\n (0x3300 <= codePoint && codePoint <= 0x4DBF) ||\n (0x4E00 <= codePoint && codePoint <= 0xA48C) ||\n (0xA490 <= codePoint && codePoint <= 0xA4C6) ||\n (0xA960 <= codePoint && codePoint <= 0xA97C) ||\n (0xAC00 <= codePoint && codePoint <= 0xD7A3) ||\n (0xD7B0 <= codePoint && codePoint <= 0xD7C6) ||\n (0xD7CB <= codePoint && codePoint <= 0xD7FB) ||\n (0xF900 <= codePoint && codePoint <= 0xFAFF) ||\n (0xFE10 <= codePoint && codePoint <= 0xFE19) ||\n (0xFE30 <= codePoint && codePoint <= 0xFE52) ||\n (0xFE54 <= codePoint && codePoint <= 0xFE66) ||\n (0xFE68 <= codePoint && codePoint <= 0xFE6B) ||\n (0x1B000 <= codePoint && codePoint <= 0x1B001) ||\n (0x1F200 <= codePoint && codePoint <= 0x1F202) ||\n (0x1F210 <= codePoint && codePoint <= 0x1F23A) ||\n (0x1F240 <= codePoint && codePoint <= 0x1F248) ||\n (0x1F250 <= codePoint && codePoint <= 0x1F251) ||\n (0x20000 <= codePoint && codePoint <= 0x2F73F) ||\n (0x2B740 <= codePoint && codePoint <= 0x2FFFD) ||\n (0x30000 <= codePoint && codePoint <= 0x3FFFD)) {\n return 'W';\n }\n if ((0x0020 <= codePoint && codePoint <= 0x007E) ||\n (0x00A2 <= codePoint && codePoint <= 0x00A3) ||\n (0x00A5 <= codePoint && codePoint <= 0x00A6) ||\n (0x00AC == codePoint) ||\n (0x00AF == codePoint) ||\n (0x27E6 <= codePoint && codePoint <= 0x27ED) ||\n (0x2985 <= codePoint && codePoint <= 0x2986)) {\n return 'Na';\n }\n if ((0x00A1 == codePoint) ||\n (0x00A4 == codePoint) ||\n (0x00A7 <= codePoint && codePoint <= 0x00A8) ||\n (0x00AA == codePoint) ||\n (0x00AD <= codePoint && codePoint <= 0x00AE) ||\n (0x00B0 <= codePoint && codePoint <= 0x00B4) ||\n (0x00B6 <= codePoint && codePoint <= 0x00BA) ||\n (0x00BC <= codePoint && codePoint <= 0x00BF) ||\n (0x00C6 == codePoint) ||\n (0x00D0 == codePoint) ||\n (0x00D7 <= codePoint && codePoint <= 0x00D8) ||\n (0x00DE <= codePoint && codePoint <= 0x00E1) ||\n (0x00E6 == codePoint) ||\n (0x00E8 <= codePoint && codePoint <= 0x00EA) ||\n (0x00EC <= codePoint && codePoint <= 0x00ED) ||\n (0x00F0 == codePoint) ||\n (0x00F2 <= codePoint && codePoint <= 0x00F3) ||\n (0x00F7 <= codePoint && codePoint <= 0x00FA) ||\n (0x00FC == codePoint) ||\n (0x00FE == codePoint) ||\n (0x0101 == codePoint) ||\n (0x0111 == codePoint) ||\n (0x0113 == codePoint) ||\n (0x011B == codePoint) ||\n (0x0126 <= codePoint && codePoint <= 0x0127) ||\n (0x012B == codePoint) ||\n (0x0131 <= codePoint && codePoint <= 0x0133) ||\n (0x0138 == codePoint) ||\n (0x013F <= codePoint && codePoint <= 0x0142) ||\n (0x0144 == codePoint) ||\n (0x0148 <= codePoint && codePoint <= 0x014B) ||\n (0x014D == codePoint) ||\n (0x0152 <= codePoint && codePoint <= 0x0153) ||\n (0x0166 <= codePoint && codePoint <= 0x0167) ||\n (0x016B == codePoint) ||\n (0x01CE == codePoint) ||\n (0x01D0 == codePoint) ||\n (0x01D2 == codePoint) ||\n (0x01D4 == codePoint) ||\n (0x01D6 == codePoint) ||\n (0x01D8 == codePoint) ||\n (0x01DA == codePoint) ||\n (0x01DC == codePoint) ||\n (0x0251 == codePoint) ||\n (0x0261 == codePoint) ||\n (0x02C4 == codePoint) ||\n (0x02C7 == codePoint) ||\n (0x02C9 <= codePoint && codePoint <= 0x02CB) ||\n (0x02CD == codePoint) ||\n (0x02D0 == codePoint) ||\n (0x02D8 <= codePoint && codePoint <= 0x02DB) ||\n (0x02DD == codePoint) ||\n (0x02DF == codePoint) ||\n (0x0300 <= codePoint && codePoint <= 0x036F) ||\n (0x0391 <= codePoint && codePoint <= 0x03A1) ||\n (0x03A3 <= codePoint && codePoint <= 0x03A9) ||\n (0x03B1 <= codePoint && codePoint <= 0x03C1) ||\n (0x03C3 <= codePoint && codePoint <= 0x03C9) ||\n (0x0401 == codePoint) ||\n (0x0410 <= codePoint && codePoint <= 0x044F) ||\n (0x0451 == codePoint) ||\n (0x2010 == codePoint) ||\n (0x2013 <= codePoint && codePoint <= 0x2016) ||\n (0x2018 <= codePoint && codePoint <= 0x2019) ||\n (0x201C <= codePoint && codePoint <= 0x201D) ||\n (0x2020 <= codePoint && codePoint <= 0x2022) ||\n (0x2024 <= codePoint && codePoint <= 0x2027) ||\n (0x2030 == codePoint) ||\n (0x2032 <= codePoint && codePoint <= 0x2033) ||\n (0x2035 == codePoint) ||\n (0x203B == codePoint) ||\n (0x203E == codePoint) ||\n (0x2074 == codePoint) ||\n (0x207F == codePoint) ||\n (0x2081 <= codePoint && codePoint <= 0x2084) ||\n (0x20AC == codePoint) ||\n (0x2103 == codePoint) ||\n (0x2105 == codePoint) ||\n (0x2109 == codePoint) ||\n (0x2113 == codePoint) ||\n (0x2116 == codePoint) ||\n (0x2121 <= codePoint && codePoint <= 0x2122) ||\n (0x2126 == codePoint) ||\n (0x212B == codePoint) ||\n (0x2153 <= codePoint && codePoint <= 0x2154) ||\n (0x215B <= codePoint && codePoint <= 0x215E) ||\n (0x2160 <= codePoint && codePoint <= 0x216B) ||\n (0x2170 <= codePoint && codePoint <= 0x2179) ||\n (0x2189 == codePoint) ||\n (0x2190 <= codePoint && codePoint <= 0x2199) ||\n (0x21B8 <= codePoint && codePoint <= 0x21B9) ||\n (0x21D2 == codePoint) ||\n (0x21D4 == codePoint) ||\n (0x21E7 == codePoint) ||\n (0x2200 == codePoint) ||\n (0x2202 <= codePoint && codePoint <= 0x2203) ||\n (0x2207 <= codePoint && codePoint <= 0x2208) ||\n (0x220B == codePoint) ||\n (0x220F == codePoint) ||\n (0x2211 == codePoint) ||\n (0x2215 == codePoint) ||\n (0x221A == codePoint) ||\n (0x221D <= codePoint && codePoint <= 0x2220) ||\n (0x2223 == codePoint) ||\n (0x2225 == codePoint) ||\n (0x2227 <= codePoint && codePoint <= 0x222C) ||\n (0x222E == codePoint) ||\n (0x2234 <= codePoint && codePoint <= 0x2237) ||\n (0x223C <= codePoint && codePoint <= 0x223D) ||\n (0x2248 == codePoint) ||\n (0x224C == codePoint) ||\n (0x2252 == codePoint) ||\n (0x2260 <= codePoint && codePoint <= 0x2261) ||\n (0x2264 <= codePoint && codePoint <= 0x2267) ||\n (0x226A <= codePoint && codePoint <= 0x226B) ||\n (0x226E <= codePoint && codePoint <= 0x226F) ||\n (0x2282 <= codePoint && codePoint <= 0x2283) ||\n (0x2286 <= codePoint && codePoint <= 0x2287) ||\n (0x2295 == codePoint) ||\n (0x2299 == codePoint) ||\n (0x22A5 == codePoint) ||\n (0x22BF == codePoint) ||\n (0x2312 == codePoint) ||\n (0x2460 <= codePoint && codePoint <= 0x24E9) ||\n (0x24EB <= codePoint && codePoint <= 0x254B) ||\n (0x2550 <= codePoint && codePoint <= 0x2573) ||\n (0x2580 <= codePoint && codePoint <= 0x258F) ||\n (0x2592 <= codePoint && codePoint <= 0x2595) ||\n (0x25A0 <= codePoint && codePoint <= 0x25A1) ||\n (0x25A3 <= codePoint && codePoint <= 0x25A9) ||\n (0x25B2 <= codePoint && codePoint <= 0x25B3) ||\n (0x25B6 <= codePoint && codePoint <= 0x25B7) ||\n (0x25BC <= codePoint && codePoint <= 0x25BD) ||\n (0x25C0 <= codePoint && codePoint <= 0x25C1) ||\n (0x25C6 <= codePoint && codePoint <= 0x25C8) ||\n (0x25CB == codePoint) ||\n (0x25CE <= codePoint && codePoint <= 0x25D1) ||\n (0x25E2 <= codePoint && codePoint <= 0x25E5) ||\n (0x25EF == codePoint) ||\n (0x2605 <= codePoint && codePoint <= 0x2606) ||\n (0x2609 == codePoint) ||\n (0x260E <= codePoint && codePoint <= 0x260F) ||\n (0x2614 <= codePoint && codePoint <= 0x2615) ||\n (0x261C == codePoint) ||\n (0x261E == codePoint) ||\n (0x2640 == codePoint) ||\n (0x2642 == codePoint) ||\n (0x2660 <= codePoint && codePoint <= 0x2661) ||\n (0x2663 <= codePoint && codePoint <= 0x2665) ||\n (0x2667 <= codePoint && codePoint <= 0x266A) ||\n (0x266C <= codePoint && codePoint <= 0x266D) ||\n (0x266F == codePoint) ||\n (0x269E <= codePoint && codePoint <= 0x269F) ||\n (0x26BE <= codePoint && codePoint <= 0x26BF) ||\n (0x26C4 <= codePoint && codePoint <= 0x26CD) ||\n (0x26CF <= codePoint && codePoint <= 0x26E1) ||\n (0x26E3 == codePoint) ||\n (0x26E8 <= codePoint && codePoint <= 0x26FF) ||\n (0x273D == codePoint) ||\n (0x2757 == codePoint) ||\n (0x2776 <= codePoint && codePoint <= 0x277F) ||\n (0x2B55 <= codePoint && codePoint <= 0x2B59) ||\n (0x3248 <= codePoint && codePoint <= 0x324F) ||\n (0xE000 <= codePoint && codePoint <= 0xF8FF) ||\n (0xFE00 <= codePoint && codePoint <= 0xFE0F) ||\n (0xFFFD == codePoint) ||\n (0x1F100 <= codePoint && codePoint <= 0x1F10A) ||\n (0x1F110 <= codePoint && codePoint <= 0x1F12D) ||\n (0x1F130 <= codePoint && codePoint <= 0x1F169) ||\n (0x1F170 <= codePoint && codePoint <= 0x1F19A) ||\n (0xE0100 <= codePoint && codePoint <= 0xE01EF) ||\n (0xF0000 <= codePoint && codePoint <= 0xFFFFD) ||\n (0x100000 <= codePoint && codePoint <= 0x10FFFD)) {\n return 'A';\n }\n\n return 'N';\n};\n\neaw.characterLength = function(character) {\n var code = this.eastAsianWidth(character);\n if (code == 'F' || code == 'W' || code == 'A') {\n return 2;\n } else {\n return 1;\n }\n};\n\n// Split a string considering surrogate-pairs.\nfunction stringToArray(string) {\n return string.match(/[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[^\\uD800-\\uDFFF]/g) || [];\n}\n\neaw.length = function(string) {\n var characters = stringToArray(string);\n var len = 0;\n for (var i = 0; i < characters.length; i++) {\n len = len + this.characterLength(characters[i]);\n }\n return len;\n};\n\neaw.slice = function(text, start, end) {\n textLen = eaw.length(text)\n start = start ? start : 0;\n end = end ? end : 1;\n if (start < 0) {\n start = textLen + start;\n }\n if (end < 0) {\n end = textLen + end;\n }\n var result = '';\n var eawLen = 0;\n var chars = stringToArray(text);\n for (var i = 0; i < chars.length; i++) {\n var char = chars[i];\n var charLen = eaw.length(char);\n if (eawLen >= start - (charLen == 2 ? 1 : 0)) {\n if (eawLen + charLen <= end) {\n result += char;\n } else {\n break;\n }\n }\n eawLen += charLen;\n }\n return result;\n};\n","\"use strict\";\n\nmodule.exports = function () {\n // https://mths.be/emoji\n return /\\uD83C\\uDFF4\\uDB40\\uDC67\\uDB40\\uDC62(?:\\uDB40\\uDC77\\uDB40\\uDC6C\\uDB40\\uDC73|\\uDB40\\uDC73\\uDB40\\uDC63\\uDB40\\uDC74|\\uDB40\\uDC65\\uDB40\\uDC6E\\uDB40\\uDC67)\\uDB40\\uDC7F|(?:\\uD83E\\uDDD1\\uD83C\\uDFFF\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB-\\uDFFE])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFE\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFD\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFC\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFB\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFC-\\uDFFF])|\\uD83D\\uDC68(?:\\uD83C\\uDFFB(?:\\u200D(?:\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF]))|\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFC-\\uDFFF])|[\\u2695\\u2696\\u2708]\\uFE0F|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD]))?|(?:\\uD83C[\\uDFFC-\\uDFFF])\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF]))|\\u200D(?:\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83D\\uDC68|(?:\\uD83D[\\uDC68\\uDC69])\\u200D(?:\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67]))|\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFF\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFE])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFE\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFD\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFC\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|(?:\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708]|\\u200D[\\u2695\\u2696\\u2708])\\uFE0F|\\u200D(?:(?:\\uD83D[\\uDC68\\uDC69])\\u200D(?:\\uD83D[\\uDC66\\uDC67])|\\uD83D[\\uDC66\\uDC67])|\\uD83C\\uDFFF|\\uD83C\\uDFFE|\\uD83C\\uDFFD|\\uD83C\\uDFFC)?|(?:\\uD83D\\uDC69(?:\\uD83C\\uDFFB\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D(?:\\uD83D[\\uDC68\\uDC69])|\\uD83D[\\uDC68\\uDC69])|(?:\\uD83C[\\uDFFC-\\uDFFF])\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D(?:\\uD83D[\\uDC68\\uDC69])|\\uD83D[\\uDC68\\uDC69]))|\\uD83E\\uDDD1(?:\\uD83C[\\uDFFB-\\uDFFF])\\u200D\\uD83E\\uDD1D\\u200D\\uD83E\\uDDD1)(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D(?:\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\u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C\\uDFFB\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD]))|\\uD83D\\uDC69\\u200D\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D(?:\\uD83D[\\uDC66\\uDC67])|\\uD83D\\uDC69\\u200D\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67])|(?:\\uD83D\\uDC41\\uFE0F\\u200D\\uD83D\\uDDE8|\\uD83E\\uDDD1(?:\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFB\\u200D[\\u2695\\u2696\\u2708]|\\u200D[\\u2695\\u2696\\u2708])|\\uD83D\\uDC69(?:\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFB\\u200D[\\u2695\\u2696\\u2708]|\\u200D[\\u2695\\u2696\\u2708])|\\uD83D\\uDE36\\u200D\\uD83C\\uDF2B|\\uD83C\\uDFF3\\uFE0F\\u200D\\u26A7|\\uD83D\\uDC3B\\u200D\\u2744|(?:(?:\\uD83C[\\uDFC3\\uDFC4\\uDFCA]|\\uD83D[\\uDC6E\\uDC70\\uDC71\\uDC73\\uDC77\\uDC81\\uDC82\\uDC86\\uDC87\\uDE45-\\uDE47\\uDE4B\\uDE4D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD35\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD4\\uDDD6-\\uDDDD])(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC6F|\\uD83E[\\uDD3C\\uDDDE\\uDDDF])\\u200D[\\u2640\\u2642]|(?:\\u26F9|\\uD83C[\\uDFCB\\uDFCC]|\\uD83D\\uDD75)(?:\\uFE0F|\\uD83C[\\uDFFB-\\uDFFF])\\u200D[\\u2640\\u2642]|\\uD83C\\uDFF4\\u200D\\u2620|(?:\\uD83C[\\uDFC3\\uDFC4\\uDFCA]|\\uD83D[\\uDC6E\\uDC70\\uDC71\\uDC73\\uDC77\\uDC81\\uDC82\\uDC86\\uDC87\\uDE45-\\uDE47\\uDE4B\\uDE4D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD35\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD4\\uDDD6-\\uDDDD])\\u200D[\\u2640\\u2642]|[\\xA9\\xAE\\u203C\\u2049\\u2122\\u2139\\u2194-\\u2199\\u21A9\\u21AA\\u2328\\u23CF\\u23ED-\\u23EF\\u23F1\\u23F2\\u23F8-\\u23FA\\u24C2\\u25AA\\u25AB\\u25B6\\u25C0\\u25FB\\u25FC\\u2600-\\u2604\\u260E\\u2611\\u2618\\u2620\\u2622\\u2623\\u2626\\u262A\\u262E\\u262F\\u2638-\\u263A\\u2640\\u2642\\u265F\\u2660\\u2663\\u2665\\u2666\\u2668\\u267B\\u267E\\u2692\\u2694-\\u2697\\u2699\\u269B\\u269C\\u26A0\\u26A7\\u26B0\\u26B1\\u26C8\\u26CF\\u26D1\\u26D3\\u26E9\\u26F0\\u26F1\\u26F4\\u26F7\\u26F8\\u2702\\u2708\\u2709\\u270F\\u2712\\u2714\\u2716\\u271D\\u2721\\u2733\\u2734\\u2744\\u2747\\u2763\\u27A1\\u2934\\u2935\\u2B05-\\u2B07\\u3030\\u303D\\u3297\\u3299]|\\uD83C[\\uDD70\\uDD71\\uDD7E\\uDD7F\\uDE02\\uDE37\\uDF21\\uDF24-\\uDF2C\\uDF36\\uDF7D\\uDF96\\uDF97\\uDF99-\\uDF9B\\uDF9E\\uDF9F\\uDFCD\\uDFCE\\uDFD4-\\uDFDF\\uDFF5\\uDFF7]|\\uD83D[\\uDC3F\\uDCFD\\uDD49\\uDD4A\\uDD6F\\uDD70\\uDD73\\uDD76-\\uDD79\\uDD87\\uDD8A-\\uDD8D\\uDDA5\\uDDA8\\uDDB1\\uDDB2\\uDDBC\\uDDC2-\\uDDC4\\uDDD1-\\uDDD3\\uDDDC-\\uDDDE\\uDDE1\\uDDE3\\uDDE8\\uDDEF\\uDDF3\\uDDFA\\uDECB\\uDECD-\\uDECF\\uDEE0-\\uDEE5\\uDEE9\\uDEF0\\uDEF3])\\uFE0F|\\uD83C\\uDFF3\\uFE0F\\u200D\\uD83C\\uDF08|\\uD83D\\uDC69\\u200D\\uD83D\\uDC67|\\uD83D\\uDC69\\u200D\\uD83D\\uDC66|\\uD83D\\uDE35\\u200D\\uD83D\\uDCAB|\\uD83D\\uDE2E\\u200D\\uD83D\\uDCA8|\\uD83D\\uDC15\\u200D\\uD83E\\uDDBA|\\uD83E\\uDDD1(?:\\uD83C\\uDFFF|\\uD83C\\uDFFE|\\uD83C\\uDFFD|\\uD83C\\uDFFC|\\uD83C\\uDFFB)?|\\uD83D\\uDC69(?:\\uD83C\\uDFFF|\\uD83C\\uDFFE|\\uD83C\\uDFFD|\\uD83C\\uDFFC|\\uD83C\\uDFFB)?|\\uD83C\\uDDFD\\uD83C\\uDDF0|\\uD83C\\uDDF6\\uD83C\\uDDE6|\\uD83C\\uDDF4\\uD83C\\uDDF2|\\uD83D\\uDC08\\u200D\\u2B1B|\\u2764\\uFE0F\\u200D(?:\\uD83D\\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]|\\uD83D[\\uDC6E\\uDC70\\uDC71\\uDC73\\uDC77\\uDC81\\uDC82\\uDC86\\uDC87\\uDE45-\\uDE47\\uDE4B\\uDE4D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD35\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD4\\uDDD6-\\uDDDD]|\\uD83D\\uDC6F|\\uD83E[\\uDD3C\\uDDDE\\uDDDF]|[\\u231A\\u231B\\u23E9-\\u23EC\\u23F0\\u23F3\\u25FD\\u25FE\\u2614\\u2615\\u2648-\\u2653\\u267F\\u2693\\u26A1\\u26AA\\u26AB\\u26BD\\u26BE\\u26C4\\u26C5\\u26CE\\u26D4\\u26EA\\u26F2\\u26F3\\u26F5\\u26FA\\u26FD\\u2705\\u2728\\u274C\\u274E\\u2753-\\u2755\\u2757\\u2795-\\u2797\\u27B0\\u27BF\\u2B1B\\u2B1C\\u2B50\\u2B55]|\\uD83C[\\uDC04\\uDCCF\\uDD8E\\uDD91-\\uDD9A\\uDE01\\uDE1A\\uDE2F\\uDE32-\\uDE36\\uDE38-\\uDE3A\\uDE50\\uDE51\\uDF00-\\uDF20\\uDF2D-\\uDF35\\uDF37-\\uDF7C\\uDF7E-\\uDF84\\uDF86-\\uDF93\\uDFA0-\\uDFC1\\uDFC5\\uDFC6\\uDFC8\\uDFC9\\uDFCF-\\uDFD3\\uDFE0-\\uDFF0\\uDFF8-\\uDFFF]|\\uD83D[\\uDC00-\\uDC07\\uDC09-\\uDC14\\uDC16-\\uDC3A\\uDC3C-\\uDC3E\\uDC40\\uDC44\\uDC45\\uDC51-\\uDC65\\uDC6A\\uDC79-\\uDC7B\\uDC7D-\\uDC80\\uDC84\\uDC88-\\uDC8E\\uDC90\\uDC92-\\uDCA9\\uDCAB-\\uDCFC\\uDCFF-\\uDD3D\\uDD4B-\\uDD4E\\uDD50-\\uDD67\\uDDA4\\uDDFB-\\uDE2D\\uDE2F-\\uDE34\\uDE37-\\uDE44\\uDE48-\\uDE4A\\uDE80-\\uDEA2\\uDEA4-\\uDEB3\\uDEB7-\\uDEBF\\uDEC1-\\uDEC5\\uDED0-\\uDED2\\uDED5-\\uDED7\\uDEEB\\uDEEC\\uDEF4-\\uDEFC\\uDFE0-\\uDFEB]|\\uD83E[\\uDD0D\\uDD0E\\uDD10-\\uDD17\\uDD1D\\uDD20-\\uDD25\\uDD27-\\uDD2F\\uDD3A\\uDD3F-\\uDD45\\uDD47-\\uDD76\\uDD78\\uDD7A-\\uDDB4\\uDDB7\\uDDBA\\uDDBC-\\uDDCB\\uDDD0\\uDDE0-\\uDDFF\\uDE70-\\uDE74\\uDE78-\\uDE7A\\uDE80-\\uDE86\\uDE90-\\uDEA8\\uDEB0-\\uDEB6\\uDEC0-\\uDEC2\\uDED0-\\uDED6]|(?:[\\u231A\\u231B\\u23E9-\\u23EC\\u23F0\\u23F3\\u25FD\\u25FE\\u2614\\u2615\\u2648-\\u2653\\u267F\\u2693\\u26A1\\u26AA\\u26AB\\u26BD\\u26BE\\u26C4\\u26C5\\u26CE\\u26D4\\u26EA\\u26F2\\u26F3\\u26F5\\u26FA\\u26FD\\u2705\\u270A\\u270B\\u2728\\u274C\\u274E\\u2753-\\u2755\\u2757\\u2795-\\u2797\\u27B0\\u27BF\\u2B1B\\u2B1C\\u2B50\\u2B55]|\\uD83C[\\uDC04\\uDCCF\\uDD8E\\uDD91-\\uDD9A\\uDDE6-\\uDDFF\\uDE01\\uDE1A\\uDE2F\\uDE32-\\uDE36\\uDE38-\\uDE3A\\uDE50\\uDE51\\uDF00-\\uDF20\\uDF2D-\\uDF35\\uDF37-\\uDF7C\\uDF7E-\\uDF93\\uDFA0-\\uDFCA\\uDFCF-\\uDFD3\\uDFE0-\\uDFF0\\uDFF4\\uDFF8-\\uDFFF]|\\uD83D[\\uDC00-\\uDC3E\\uDC40\\uDC42-\\uDCFC\\uDCFF-\\uDD3D\\uDD4B-\\uDD4E\\uDD50-\\uDD67\\uDD7A\\uDD95\\uDD96\\uDDA4\\uDDFB-\\uDE4F\\uDE80-\\uDEC5\\uDECC\\uDED0-\\uDED2\\uDED5-\\uDED7\\uDEEB\\uDEEC\\uDEF4-\\uDEFC\\uDFE0-\\uDFEB]|\\uD83E[\\uDD0C-\\uDD3A\\uDD3C-\\uDD45\\uDD47-\\uDD78\\uDD7A-\\uDDCB\\uDDCD-\\uDDFF\\uDE70-\\uDE74\\uDE78-\\uDE7A\\uDE80-\\uDE86\\uDE90-\\uDEA8\\uDEB0-\\uDEB6\\uDEC0-\\uDEC2\\uDED0-\\uDED6])|(?:[#\\*0-9\\xA9\\xAE\\u203C\\u2049\\u2122\\u2139\\u2194-\\u2199\\u21A9\\u21AA\\u231A\\u231B\\u2328\\u23CF\\u23E9-\\u23F3\\u23F8-\\u23FA\\u24C2\\u25AA\\u25AB\\u25B6\\u25C0\\u25FB-\\u25FE\\u2600-\\u2604\\u260E\\u2611\\u2614\\u2615\\u2618\\u261D\\u2620\\u2622\\u2623\\u2626\\u262A\\u262E\\u262F\\u2638-\\u263A\\u2640\\u2642\\u2648-\\u2653\\u265F\\u2660\\u2663\\u2665\\u2666\\u2668\\u267B\\u267E\\u267F\\u2692-\\u2697\\u2699\\u269B\\u269C\\u26A0\\u26A1\\u26A7\\u26AA\\u26AB\\u26B0\\u26B1\\u26BD\\u26BE\\u26C4\\u26C5\\u26C8\\u26CE\\u26CF\\u26D1\\u26D3\\u26D4\\u26E9\\u26EA\\u26F0-\\u26F5\\u26F7-\\u26FA\\u26FD\\u2702\\u2705\\u2708-\\u270D\\u270F\\u2712\\u2714\\u2716\\u271D\\u2721\\u2728\\u2733\\u2734\\u2744\\u2747\\u274C\\u274E\\u2753-\\u2755\\u2757\\u2763\\u2764\\u2795-\\u2797\\u27A1\\u27B0\\u27BF\\u2934\\u2935\\u2B05-\\u2B07\\u2B1B\\u2B1C\\u2B50\\u2B55\\u3030\\u303D\\u3297\\u3299]|\\uD83C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DE4B-\\uDE4F\\uDEA3\\uDEB4-\\uDEB6\\uDEC0\\uDECC]|\\uD83E[\\uDD0C\\uDD0F\\uDD18-\\uDD1F\\uDD26\\uDD30-\\uDD39\\uDD3C-\\uDD3E\\uDD77\\uDDB5\\uDDB6\\uDDB8\\uDDB9\\uDDBB\\uDDCD-\\uDDCF\\uDDD1-\\uDDDD])/g;\n};\n","import stripAnsi from 'strip-ansi';\nimport eastAsianWidth from 'eastasianwidth';\nimport emojiRegex from 'emoji-regex';\n\nexport default function stringWidth(string, options = {}) {\n\tif (typeof string !== 'string' || string.length === 0) {\n\t\treturn 0;\n\t}\n\n\toptions = {\n\t\tambiguousIsNarrow: true,\n\t\t...options\n\t};\n\n\tstring = stripAnsi(string);\n\n\tif (string.length === 0) {\n\t\treturn 0;\n\t}\n\n\tstring = string.replace(emojiRegex(), ' ');\n\n\tconst ambiguousCharacterWidth = options.ambiguousIsNarrow ? 1 : 2;\n\tlet width = 0;\n\n\tfor (const character of string) {\n\t\tconst codePoint = character.codePointAt(0);\n\n\t\t// Ignore control characters\n\t\tif (codePoint <= 0x1F || (codePoint >= 0x7F && codePoint <= 0x9F)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Ignore combining characters\n\t\tif (codePoint >= 0x300 && codePoint <= 0x36F) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst code = eastAsianWidth.eastAsianWidth(character);\n\t\tswitch (code) {\n\t\t\tcase 'F':\n\t\t\tcase 'W':\n\t\t\t\twidth += 2;\n\t\t\t\tbreak;\n\t\t\tcase 'A':\n\t\t\t\twidth += ambiguousCharacterWidth;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\twidth += 1;\n\t\t}\n\t}\n\n\treturn width;\n}\n","const ANSI_BACKGROUND_OFFSET = 10;\n\nconst wrapAnsi16 = (offset = 0) => code => `\\u001B[${code + offset}m`;\n\nconst wrapAnsi256 = (offset = 0) => code => `\\u001B[${38 + offset};5;${code}m`;\n\nconst wrapAnsi16m = (offset = 0) => (red, green, blue) => `\\u001B[${38 + offset};2;${red};${green};${blue}m`;\n\nconst styles = {\n\tmodifier: {\n\t\treset: [0, 0],\n\t\t// 21 isn't widely supported and 22 does the same thing\n\t\tbold: [1, 22],\n\t\tdim: [2, 22],\n\t\titalic: [3, 23],\n\t\tunderline: [4, 24],\n\t\toverline: [53, 55],\n\t\tinverse: [7, 27],\n\t\thidden: [8, 28],\n\t\tstrikethrough: [9, 29],\n\t},\n\tcolor: {\n\t\tblack: [30, 39],\n\t\tred: [31, 39],\n\t\tgreen: [32, 39],\n\t\tyellow: [33, 39],\n\t\tblue: [34, 39],\n\t\tmagenta: [35, 39],\n\t\tcyan: [36, 39],\n\t\twhite: [37, 39],\n\n\t\t// Bright color\n\t\tblackBright: [90, 39],\n\t\tgray: [90, 39], // Alias of `blackBright`\n\t\tgrey: [90, 39], // Alias of `blackBright`\n\t\tredBright: [91, 39],\n\t\tgreenBright: [92, 39],\n\t\tyellowBright: [93, 39],\n\t\tblueBright: [94, 39],\n\t\tmagentaBright: [95, 39],\n\t\tcyanBright: [96, 39],\n\t\twhiteBright: [97, 39],\n\t},\n\tbgColor: {\n\t\tbgBlack: [40, 49],\n\t\tbgRed: [41, 49],\n\t\tbgGreen: [42, 49],\n\t\tbgYellow: [43, 49],\n\t\tbgBlue: [44, 49],\n\t\tbgMagenta: [45, 49],\n\t\tbgCyan: [46, 49],\n\t\tbgWhite: [47, 49],\n\n\t\t// Bright color\n\t\tbgBlackBright: [100, 49],\n\t\tbgGray: [100, 49], // Alias of `bgBlackBright`\n\t\tbgGrey: [100, 49], // Alias of `bgBlackBright`\n\t\tbgRedBright: [101, 49],\n\t\tbgGreenBright: [102, 49],\n\t\tbgYellowBright: [103, 49],\n\t\tbgBlueBright: [104, 49],\n\t\tbgMagentaBright: [105, 49],\n\t\tbgCyanBright: [106, 49],\n\t\tbgWhiteBright: [107, 49],\n\t},\n};\n\nexport const modifierNames = Object.keys(styles.modifier);\nexport const foregroundColorNames = Object.keys(styles.color);\nexport const backgroundColorNames = Object.keys(styles.bgColor);\nexport const colorNames = [...foregroundColorNames, ...backgroundColorNames];\n\nfunction assembleStyles() {\n\tconst codes = new Map();\n\n\tfor (const [groupName, group] of Object.entries(styles)) {\n\t\tfor (const [styleName, style] of Object.entries(group)) {\n\t\t\tstyles[styleName] = {\n\t\t\t\topen: `\\u001B[${style[0]}m`,\n\t\t\t\tclose: `\\u001B[${style[1]}m`,\n\t\t\t};\n\n\t\t\tgroup[styleName] = styles[styleName];\n\n\t\t\tcodes.set(style[0], style[1]);\n\t\t}\n\n\t\tObject.defineProperty(styles, groupName, {\n\t\t\tvalue: group,\n\t\t\tenumerable: false,\n\t\t});\n\t}\n\n\tObject.defineProperty(styles, 'codes', {\n\t\tvalue: codes,\n\t\tenumerable: false,\n\t});\n\n\tstyles.color.close = '\\u001B[39m';\n\tstyles.bgColor.close = '\\u001B[49m';\n\n\tstyles.color.ansi = wrapAnsi16();\n\tstyles.color.ansi256 = wrapAnsi256();\n\tstyles.color.ansi16m = wrapAnsi16m();\n\tstyles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);\n\tstyles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);\n\tstyles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);\n\n\t// From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js\n\tObject.defineProperties(styles, {\n\t\trgbToAnsi256: {\n\t\t\tvalue: (red, green, blue) => {\n\t\t\t\t// We use the extended greyscale palette here, with the exception of\n\t\t\t\t// black and white. normal palette only has 4 greyscale shades.\n\t\t\t\tif (red === green && green === blue) {\n\t\t\t\t\tif (red < 8) {\n\t\t\t\t\t\treturn 16;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (red > 248) {\n\t\t\t\t\t\treturn 231;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn Math.round(((red - 8) / 247) * 24) + 232;\n\t\t\t\t}\n\n\t\t\t\treturn 16\n\t\t\t\t\t+ (36 * Math.round(red / 255 * 5))\n\t\t\t\t\t+ (6 * Math.round(green / 255 * 5))\n\t\t\t\t\t+ Math.round(blue / 255 * 5);\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToRgb: {\n\t\t\tvalue: hex => {\n\t\t\t\tconst matches = /[a-f\\d]{6}|[a-f\\d]{3}/i.exec(hex.toString(16));\n\t\t\t\tif (!matches) {\n\t\t\t\t\treturn [0, 0, 0];\n\t\t\t\t}\n\n\t\t\t\tlet [colorString] = matches;\n\n\t\t\t\tif (colorString.length === 3) {\n\t\t\t\t\tcolorString = [...colorString].map(character => character + character).join('');\n\t\t\t\t}\n\n\t\t\t\tconst integer = Number.parseInt(colorString, 16);\n\n\t\t\t\treturn [\n\t\t\t\t\t/* eslint-disable no-bitwise */\n\t\t\t\t\t(integer >> 16) & 0xFF,\n\t\t\t\t\t(integer >> 8) & 0xFF,\n\t\t\t\t\tinteger & 0xFF,\n\t\t\t\t\t/* eslint-enable no-bitwise */\n\t\t\t\t];\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToAnsi256: {\n\t\t\tvalue: hex => styles.rgbToAnsi256(...styles.hexToRgb(hex)),\n\t\t\tenumerable: false,\n\t\t},\n\t\tansi256ToAnsi: {\n\t\t\tvalue: code => {\n\t\t\t\tif (code < 8) {\n\t\t\t\t\treturn 30 + code;\n\t\t\t\t}\n\n\t\t\t\tif (code < 16) {\n\t\t\t\t\treturn 90 + (code - 8);\n\t\t\t\t}\n\n\t\t\t\tlet red;\n\t\t\t\tlet green;\n\t\t\t\tlet blue;\n\n\t\t\t\tif (code >= 232) {\n\t\t\t\t\tred = (((code - 232) * 10) + 8) / 255;\n\t\t\t\t\tgreen = red;\n\t\t\t\t\tblue = red;\n\t\t\t\t} else {\n\t\t\t\t\tcode -= 16;\n\n\t\t\t\t\tconst remainder = code % 36;\n\n\t\t\t\t\tred = Math.floor(code / 36) / 5;\n\t\t\t\t\tgreen = Math.floor(remainder / 6) / 5;\n\t\t\t\t\tblue = (remainder % 6) / 5;\n\t\t\t\t}\n\n\t\t\t\tconst value = Math.max(red, green, blue) * 2;\n\n\t\t\t\tif (value === 0) {\n\t\t\t\t\treturn 30;\n\t\t\t\t}\n\n\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\tlet result = 30 + ((Math.round(blue) << 2) | (Math.round(green) << 1) | Math.round(red));\n\n\t\t\t\tif (value === 2) {\n\t\t\t\t\tresult += 60;\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\trgbToAnsi: {\n\t\t\tvalue: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToAnsi: {\n\t\t\tvalue: hex => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),\n\t\t\tenumerable: false,\n\t\t},\n\t});\n\n\treturn styles;\n}\n\nconst ansiStyles = assembleStyles();\n\nexport default ansiStyles;\n","import stringWidth from 'string-width';\nimport stripAnsi from 'strip-ansi';\nimport ansiStyles from 'ansi-styles';\n\nconst ESCAPES = new Set([\n\t'\\u001B',\n\t'\\u009B',\n]);\n\nconst END_CODE = 39;\nconst ANSI_ESCAPE_BELL = '\\u0007';\nconst ANSI_CSI = '[';\nconst ANSI_OSC = ']';\nconst ANSI_SGR_TERMINATOR = 'm';\nconst ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;\n\nconst wrapAnsiCode = code => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;\nconst wrapAnsiHyperlink = uri => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${uri}${ANSI_ESCAPE_BELL}`;\n\n// Calculate the length of words split on ' ', ignoring\n// the extra characters added by ansi escape codes\nconst wordLengths = string => string.split(' ').map(character => stringWidth(character));\n\n// Wrap a long word across multiple rows\n// Ansi escape codes do not count towards length\nconst wrapWord = (rows, word, columns) => {\n\tconst characters = [...word];\n\n\tlet isInsideEscape = false;\n\tlet isInsideLinkEscape = false;\n\tlet visible = stringWidth(stripAnsi(rows[rows.length - 1]));\n\n\tfor (const [index, character] of characters.entries()) {\n\t\tconst characterLength = stringWidth(character);\n\n\t\tif (visible + characterLength <= columns) {\n\t\t\trows[rows.length - 1] += character;\n\t\t} else {\n\t\t\trows.push(character);\n\t\t\tvisible = 0;\n\t\t}\n\n\t\tif (ESCAPES.has(character)) {\n\t\t\tisInsideEscape = true;\n\t\t\tisInsideLinkEscape = characters.slice(index + 1).join('').startsWith(ANSI_ESCAPE_LINK);\n\t\t}\n\n\t\tif (isInsideEscape) {\n\t\t\tif (isInsideLinkEscape) {\n\t\t\t\tif (character === ANSI_ESCAPE_BELL) {\n\t\t\t\t\tisInsideEscape = false;\n\t\t\t\t\tisInsideLinkEscape = false;\n\t\t\t\t}\n\t\t\t} else if (character === ANSI_SGR_TERMINATOR) {\n\t\t\t\tisInsideEscape = false;\n\t\t\t}\n\n\t\t\tcontinue;\n\t\t}\n\n\t\tvisible += characterLength;\n\n\t\tif (visible === columns && index < characters.length - 1) {\n\t\t\trows.push('');\n\t\t\tvisible = 0;\n\t\t}\n\t}\n\n\t// It's possible that the last row we copy over is only\n\t// ansi escape characters, handle this edge-case\n\tif (!visible && rows[rows.length - 1].length > 0 && rows.length > 1) {\n\t\trows[rows.length - 2] += rows.pop();\n\t}\n};\n\n// Trims spaces from a string ignoring invisible sequences\nconst stringVisibleTrimSpacesRight = string => {\n\tconst words = string.split(' ');\n\tlet last = words.length;\n\n\twhile (last > 0) {\n\t\tif (stringWidth(words[last - 1]) > 0) {\n\t\t\tbreak;\n\t\t}\n\n\t\tlast--;\n\t}\n\n\tif (last === words.length) {\n\t\treturn string;\n\t}\n\n\treturn words.slice(0, last).join(' ') + words.slice(last).join('');\n};\n\n// The wrap-ansi module can be invoked in either 'hard' or 'soft' wrap mode\n//\n// 'hard' will never allow a string to take up more than columns characters\n//\n// 'soft' allows long words to expand past the column length\nconst exec = (string, columns, options = {}) => {\n\tif (options.trim !== false && string.trim() === '') {\n\t\treturn '';\n\t}\n\n\tlet returnValue = '';\n\tlet escapeCode;\n\tlet escapeUrl;\n\n\tconst lengths = wordLengths(string);\n\tlet rows = [''];\n\n\tfor (const [index, word] of string.split(' ').entries()) {\n\t\tif (options.trim !== false) {\n\t\t\trows[rows.length - 1] = rows[rows.length - 1].trimStart();\n\t\t}\n\n\t\tlet rowLength = stringWidth(rows[rows.length - 1]);\n\n\t\tif (index !== 0) {\n\t\t\tif (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {\n\t\t\t\t// If we start with a new word but the current row length equals the length of the columns, add a new row\n\t\t\t\trows.push('');\n\t\t\t\trowLength = 0;\n\t\t\t}\n\n\t\t\tif (rowLength > 0 || options.trim === false) {\n\t\t\t\trows[rows.length - 1] += ' ';\n\t\t\t\trowLength++;\n\t\t\t}\n\t\t}\n\n\t\t// In 'hard' wrap mode, the length of a line is never allowed to extend past 'columns'\n\t\tif (options.hard && lengths[index] > columns) {\n\t\t\tconst remainingColumns = (columns - rowLength);\n\t\t\tconst breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);\n\t\t\tconst breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns);\n\t\t\tif (breaksStartingNextLine < breaksStartingThisLine) {\n\t\t\t\trows.push('');\n\t\t\t}\n\n\t\t\twrapWord(rows, word, columns);\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) {\n\t\t\tif (options.wordWrap === false && rowLength < columns) {\n\t\t\t\twrapWord(rows, word, columns);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\trows.push('');\n\t\t}\n\n\t\tif (rowLength + lengths[index] > columns && options.wordWrap === false) {\n\t\t\twrapWord(rows, word, columns);\n\t\t\tcontinue;\n\t\t}\n\n\t\trows[rows.length - 1] += word;\n\t}\n\n\tif (options.trim !== false) {\n\t\trows = rows.map(row => stringVisibleTrimSpacesRight(row));\n\t}\n\n\tconst pre = [...rows.join('\\n')];\n\n\tfor (const [index, character] of pre.entries()) {\n\t\treturnValue += character;\n\n\t\tif (ESCAPES.has(character)) {\n\t\t\tconst {groups} = new RegExp(`(?:\\\\${ANSI_CSI}(?<code>\\\\d+)m|\\\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`).exec(pre.slice(index).join('')) || {groups: {}};\n\t\t\tif (groups.code !== undefined) {\n\t\t\t\tconst code = Number.parseFloat(groups.code);\n\t\t\t\tescapeCode = code === END_CODE ? undefined : code;\n\t\t\t} else if (groups.uri !== undefined) {\n\t\t\t\tescapeUrl = groups.uri.length === 0 ? undefined : groups.uri;\n\t\t\t}\n\t\t}\n\n\t\tconst code = ansiStyles.codes.get(Number(escapeCode));\n\n\t\tif (pre[index + 1] === '\\n') {\n\t\t\tif (escapeUrl) {\n\t\t\t\treturnValue += wrapAnsiHyperlink('');\n\t\t\t}\n\n\t\t\tif (escapeCode && code) {\n\t\t\t\treturnValue += wrapAnsiCode(code);\n\t\t\t}\n\t\t} else if (character === '\\n') {\n\t\t\tif (escapeCode && code) {\n\t\t\t\treturnValue += wrapAnsiCode(escapeCode);\n\t\t\t}\n\n\t\t\tif (escapeUrl) {\n\t\t\t\treturnValue += wrapAnsiHyperlink(escapeUrl);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn returnValue;\n};\n\n// For each newline, invoke the method separately\nexport default function wrapAnsi(string, columns, options) {\n\treturn String(string)\n\t\t.normalize()\n\t\t.replace(/\\r\\n/g, '\\n')\n\t\t.split('\\n')\n\t\t.map(line => exec(line, columns, options))\n\t\t.join('\\n');\n}\n","const actions = ['up', 'down', 'left', 'right', 'space', 'enter', 'cancel'] as const;\nexport type Action = (typeof actions)[number];\n\n/** Global settings for Clack programs, stored in memory */\ninterface InternalClackSettings {\n\tactions: Set<Action>;\n\taliases: Map<string, Action>;\n}\n\nexport const settings: InternalClackSettings = {\n\tactions: new Set(actions),\n\taliases: new Map<string, Action>([\n\t\t// vim support\n\t\t['k', 'up'],\n\t\t['j', 'down'],\n\t\t['h', 'left'],\n\t\t['l', 'right'],\n\t\t['\\x03', 'cancel'],\n\t\t// opinionated defaults!\n\t\t['escape', 'cancel'],\n\t]),\n};\n\nexport interface ClackSettings {\n\t/**\n\t * Set custom global aliases for the default actions.\n\t * This will not overwrite existing aliases, it will only add new ones!\n\t *\n\t * @param aliases - An object that maps aliases to actions\n\t * @default { k: 'up', j: 'down', h: 'left', l: 'right', '\\x03': 'cancel', 'escape': 'cancel' }\n\t */\n\taliases: Record<string, Action>;\n}\n\nexport function updateSettings(updates: ClackSettings) {\n\tfor (const _key in updates) {\n\t\tconst key = _key as keyof ClackSettings;\n\t\tif (!Object.hasOwn(updates, key)) continue;\n\t\tconst value = updates[key];\n\n\t\tswitch (key) {\n\t\t\tcase 'aliases': {\n\t\t\t\tfor (const alias in value) {\n\t\t\t\t\tif (!Object.hasOwn(value, alias)) continue;\n\t\t\t\t\tif (!settings.aliases.has(alias)) {\n\t\t\t\t\t\tsettings.aliases.set(alias, value[alias]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Check if a key is an alias for a default action\n * @param key - The raw key which might match to an action\n * @param action - The action to match\n * @returns boolean\n */\nexport function isActionKey(key: string | Array<string | undefined>, action: Action) {\n\tif (typeof key === 'string') {\n\t\treturn settings.aliases.get(key) === action;\n\t}\n\n\tfor (const value of key) {\n\t\tif (value === undefined) continue;\n\t\tif (isActionKey(value, action)) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n","export function diffLines(a: string, b: string) {\n\tif (a === b) return;\n\n\tconst aLines = a.split('\\n');\n\tconst bLines = b.split('\\n');\n\tconst diff: number[] = [];\n\n\tfor (let i = 0; i < Math.max(aLines.length, bLines.length); i++) {\n\t\tif (aLines[i] !== bLines[i]) diff.push(i);\n\t}\n\n\treturn diff;\n}\n","import { stdin, stdout } from 'node:process';\nimport type { Key } from 'node:readline';\nimport * as readline from 'node:readline';\nimport type { Readable } from 'node:stream';\nimport { cursor } from 'sisteransi';\nimport { isActionKey } from './settings';\n\nexport * from './string';\nexport * from './settings';\n\nconst isWindows = globalThis.process.platform.startsWith('win');\n\nexport const CANCEL_SYMBOL = Symbol('clack:cancel');\n\nexport function isCancel(value: unknown): value is symbol {\n\treturn value === CANCEL_SYMBOL;\n}\n\nexport function setRawMode(input: Readable, value: boolean) {\n\tconst i = input as typeof stdin;\n\n\tif (i.isTTY) i.setRawMode(value);\n}\n\nexport function block({\n\tinput = stdin,\n\toutput = stdout,\n\toverwrite = true,\n\thideCursor = true,\n} = {}) {\n\tconst rl = readline.createInterface({\n\t\tinput,\n\t\toutput,\n\t\tprompt: '',\n\t\ttabSize: 1,\n\t});\n\treadline.emitKeypressEvents(input, rl);\n\tif (input.isTTY) input.setRawMode(true);\n\n\tconst clear = (data: Buffer, { name, sequence }: Key) => {\n\t\tconst str = String(data);\n\t\tif (isActionKey([str, name, sequence], 'cancel')) {\n\t\t\tif (hideCursor) output.write(cursor.show);\n\t\t\tprocess.exit(0);\n\t\t\treturn;\n\t\t}\n\t\tif (!overwrite) return;\n\t\tconst dx = name === 'return' ? 0 : -1;\n\t\tconst dy = name === 'return' ? -1 : 0;\n\n\t\treadline.moveCursor(output, dx, dy, () => {\n\t\t\treadline.clearLine(output, 1, () => {\n\t\t\t\tinput.once('keypress', clear);\n\t\t\t});\n\t\t});\n\t};\n\tif (hideCursor) output.write(cursor.hide);\n\tinput.once('keypress', clear);\n\n\treturn () => {\n\t\tinput.off('keypress', clear);\n\t\tif (hideCursor) output.write(cursor.show);\n\n\t\t// Prevent Windows specific issues: https://github.com/natemoo-re/clack/issues/176\n\t\tif (input.isTTY && !isWindows) input.setRawMode(false);\n\n\t\t// @ts-expect-error fix for https://github.com/nodejs/node/issues/31762#issuecomment-1441223907\n\t\trl.terminal = false;\n\t\trl.close();\n\t};\n}\n","import { stdin, stdout } from 'node:process';\nimport readline, { type Key, type ReadLine } from 'node:readline';\nimport type { Readable, Writable } from 'node:stream';\nimport { WriteStream } from 'node:tty';\nimport { cursor, erase } from 'sisteransi';\nimport wrap from 'wrap-ansi';\n\nimport { CANCEL_SYMBOL, diffLines, isActionKey, setRawMode, settings } from '../utils';\n\nimport type { ClackEvents, ClackState } from '../types';\nimport type { Action } from '../utils';\n\nexport interface PromptOptions<Self extends Prompt> {\n\trender(this: Omit<Self, 'prompt'>): string | undefined;\n\tplaceholder?: string;\n\tinitialValue?: any;\n\tvalidate?: ((value: any) => string | Error | undefined) | undefined;\n\tinput?: Readable;\n\toutput?: Writable;\n\tdebug?: boolean;\n\tsignal?: AbortSignal;\n}\n\nexport default class Prompt {\n\tprotected input: Readable;\n\tprotected output: Writable;\n\tprivate _abortSignal?: AbortSignal;\n\n\tprivate rl: ReadLine | undefined;\n\tprivate opts: Omit<PromptOptions<Prompt>, 'render' | 'input' | 'output'>;\n\tprivate _render: (context: Omit<Prompt, 'prompt'>) => string | undefined;\n\tprivate _track = false;\n\tprivate _prevFrame = '';\n\tprivate _subscribers = new Map<string, { cb: (...args: any) => any; once?: boolean }[]>();\n\tprotected _cursor = 0;\n\n\tpublic state: ClackState = 'initial';\n\tpublic error = '';\n\tpublic value: any;\n\n\tconstructor(options: PromptOptions<Prompt>, trackValue = true) {\n\t\tconst { input = stdin, output = stdout, render, signal, ...opts } = options;\n\n\t\tthis.opts = opts;\n\t\tthis.onKeypress = this.onKeypress.bind(this);\n\t\tthis.close = this.close.bind(this);\n\t\tthis.render = this.render.bind(this);\n\t\tthis._render = render.bind(this);\n\t\tthis._track = trackValue;\n\t\tthis._abortSignal = signal;\n\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t}\n\n\t/**\n\t * Unsubscribe all listeners\n\t */\n\tprotected unsubscribe() {\n\t\tthis._subscribers.clear();\n\t}\n\n\t/**\n\t * Set a subscriber with opts\n\t * @param event - The event name\n\t */\n\tprivate setSubscriber<T extends keyof ClackEvents>(\n\t\tevent: T,\n\t\topts: { cb: ClackEvents[T]; once?: boolean }\n\t) {\n\t\tconst params = this._subscribers.get(event) ?? [];\n\t\tparams.push(opts);\n\t\tthis._subscribers.set(event, params);\n\t}\n\n\t/**\n\t * Subscribe to an event\n\t * @param event - The event name\n\t * @param cb - The callback\n\t */\n\tpublic on<T extends keyof ClackEvents>(event: T, cb: ClackEvents[T]) {\n\t\tthis.setSubscriber(event, { cb });\n\t}\n\n\t/**\n\t * Subscribe to an event once\n\t * @param event - The event name\n\t * @param cb - The callback\n\t */\n\tpublic once<T extends keyof ClackEvents>(event: T, cb: ClackEvents[T]) {\n\t\tthis.setSubscriber(event, { cb, once: true });\n\t}\n\n\t/**\n\t * Emit an event with data\n\t * @param event - The event name\n\t * @param data - The data to pass to the callback\n\t */\n\tpublic emit<T extends keyof ClackEvents>(event: T, ...data: Parameters<ClackEvents[T]>) {\n\t\tconst cbs = this._subscribers.get(event) ?? [];\n\t\tconst cleanup: (() => void)[] = [];\n\n\t\tfor (const subscriber of cbs) {\n\t\t\tsubscriber.cb(...data);\n\n\t\t\tif (subscriber.once) {\n\t\t\t\tcleanup.push(() => cbs.splice(cbs.indexOf(subscriber), 1));\n\t\t\t}\n\t\t}\n\n\t\tfor (const cb of cleanup) {\n\t\t\tcb();\n\t\t}\n\t}\n\n\tpublic prompt() {\n\t\treturn new Promise<string | symbol>((resolve, reject) => {\n\t\t\tif (this._abortSignal) {\n\t\t\t\tif (this._abortSignal.aborted) {\n\t\t\t\t\tthis.state = 'cancel';\n\n\t\t\t\t\tthis.close();\n\t\t\t\t\treturn resolve(CANCEL_SYMBOL);\n\t\t\t\t}\n\n\t\t\t\tthis._abortSignal.addEventListener(\n\t\t\t\t\t'abort',\n\t\t\t\t\t() => {\n\t\t\t\t\t\tthis.state = 'cancel';\n\t\t\t\t\t\tthis.close();\n\t\t\t\t\t},\n\t\t\t\t\t{ once: true }\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst sink = new WriteStream(0);\n\t\t\tsink._write = (chunk, encoding, done) => {\n\t\t\t\tif (this._track) {\n\t\t\t\t\tthis.value = this.rl?.line.replace(/\\t/g, '');\n\t\t\t\t\tthis._cursor = this.rl?.cursor ?? 0;\n\t\t\t\t\tthis.emit('value', this.value);\n\t\t\t\t}\n\t\t\t\tdone();\n\t\t\t};\n\t\t\tthis.input.pipe(sink);\n\n\t\t\tthis.rl = readline.createInterface({\n\t\t\t\tinput: this.input,\n\t\t\t\toutput: sink,\n\t\t\t\ttabSize: 2,\n\t\t\t\tprompt: '',\n\t\t\t\tescapeCodeTimeout: 50,\n\t\t\t});\n\t\t\treadline.emitKeypressEvents(this.input, this.rl);\n\t\t\tthis.rl.prompt();\n\t\t\tif (this.opts.initialValue !== undefined && this._track) {\n\t\t\t\tthis.rl.write(this.opts.initialValue);\n\t\t\t}\n\n\t\t\tthis.input.on('keypress', this.onKeypress);\n\t\t\tsetRawMode(this.input, true);\n\t\t\tthis.output.on('resize', this.render);\n\n\t\t\tthis.render();\n\n\t\t\tthis.once('submit', () => {\n\t\t\t\tthis.output.write(cursor.show);\n\t\t\t\tthis.output.off('resize', this.render);\n\t\t\t\tsetRawMode(this.input, false);\n\t\t\t\tresolve(this.value);\n\t\t\t});\n\t\t\tthis.once('cancel', () => {\n\t\t\t\tthis.output.write(cursor.show);\n\t\t\t\tthis.output.off('resize', this.render);\n\t\t\t\tsetRawMode(this.input, false);\n\t\t\t\tresolve(CANCEL_SYMBOL);\n\t\t\t});\n\t\t});\n\t}\n\n\tprivate onKeypress(char: string, key?: Key) {\n\t\tif (this.state === 'error') {\n\t\t\tthis.state = 'active';\n\t\t}\n\t\tif (key?.name) {\n\t\t\tif (!this._track && settings.aliases.has(key.name)) {\n\t\t\t\tthis.emit('cursor', settings.aliases.get(key.name));\n\t\t\t}\n\t\t\tif (settings.actions.has(key.name as Action)) {\n\t\t\t\tthis.emit('cursor', key.name as Action);\n\t\t\t}\n\t\t}\n\t\tif (char && (char.toLowerCase() === 'y' || char.toLowerCase() === 'n')) {\n\t\t\tthis.emit('confirm', char.toLowerCase() === 'y');\n\t\t}\n\t\tif (char === '\\t' && this.opts.placeholder) {\n\t\t\tif (!this.value) {\n\t\t\t\tthis.rl?.write(this.opts.placeholder);\n\t\t\t\tthis.emit('value', this.opts.placeholder);\n\t\t\t}\n\t\t}\n\t\tif (char) {\n\t\t\tthis.emit('key', char.toLowerCase());\n\t\t}\n\n\t\tif (key?.name === 'return') {\n\t\t\tif (this.opts.validate) {\n\t\t\t\tconst problem = this.opts.validate(this.value);\n\t\t\t\tif (problem) {\n\t\t\t\t\tthis.error = problem instanceof Error ? problem.message : problem;\n\t\t\t\t\tthis.state = 'error';\n\t\t\t\t\tthis.rl?.write(this.value);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (this.state !== 'error') {\n\t\t\t\tthis.state = 'submit';\n\t\t\t}\n\t\t}\n\n\t\tif (isActionKey([char, key?.name, key?.sequence], 'cancel')) {\n\t\t\tthis.state = 'cancel';\n\t\t}\n\t\tif (this.state === 'submit' || this.state === 'cancel') {\n\t\t\tthis.emit('finalize');\n\t\t}\n\t\tthis.render();\n\t\tif (this.state === 'submit' || this.state === 'cancel') {\n\t\t\tthis.close();\n\t\t}\n\t}\n\n\tprotected close() {\n\t\tthis.input.unpipe();\n\t\tthis.input.removeListener('keypress', this.onKeypress);\n\t\tthis.output.write('\\n');\n\t\tsetRawMode(this.input, false);\n\t\tthis.rl?.close();\n\t\tthis.rl = undefined;\n\t\tthis.emit(`${this.state}`, this.value);\n\t\tthis.unsubscribe();\n\t}\n\n\tprivate restoreCursor() {\n\t\tconst lines =\n\t\t\twrap(this._prevFrame, process.stdout.columns, { hard: true }).split('\\n').length - 1;\n\t\tthis.output.write(cursor.move(-999, lines * -1));\n\t}\n\n\tprivate render() {\n\t\tconst frame = wrap(this._render(this) ?? '', process.stdout.columns, { hard: true });\n\t\tif (frame === this._prevFrame) return;\n\n\t\tif (this.state === 'initial') {\n\t\t\tthis.output.write(cursor.hide);\n\t\t} else {\n\t\t\tconst diff = diffLines(this._prevFrame, frame);\n\t\t\tthis.restoreCursor();\n\t\t\t// If a single line has changed, only update that line\n\t\t\tif (diff && diff?.length === 1) {\n\t\t\t\tconst diffLine = diff[0];\n\t\t\t\tthis.output.write(cursor.move(0, diffLine));\n\t\t\t\tthis.output.write(erase.lines(1));\n\t\t\t\tconst lines = frame.split('\\n');\n\t\t\t\tthis.output.write(lines[diffLine]);\n\t\t\t\tthis._prevFrame = frame;\n\t\t\t\tthis.output.write(cursor.move(0, lines.length - diffLine - 1));\n\t\t\t\treturn;\n\t\t\t\t// If many lines have changed, rerender everything past the first line\n\t\t\t}\n\t\t\tif (diff && diff?.length > 1) {\n\t\t\t\tconst diffLine = diff[0];\n\t\t\t\tthis.output.write(cursor.move(0, diffLine));\n\t\t\t\tthis.output.write(erase.down());\n\t\t\t\tconst lines = frame.split('\\n');\n\t\t\t\tconst newLines = lines.slice(diffLine);\n\t\t\t\tthis.output.write(newLines.join('\\n'));\n\t\t\t\tthis._prevFrame = frame;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.output.write(erase.down());\n\t\t}\n\n\t\tthis.output.write(frame);\n\t\tif (this.state === 'initial') {\n\t\t\tthis.state = 'active';\n\t\t}\n\t\tthis._prevFrame = frame;\n\t}\n}\n","import { cursor } from 'sisteransi';\nimport Prompt, { type PromptOptions } from './prompt';\n\ninterface ConfirmOptions extends PromptOptions<ConfirmPrompt> {\n\tactive: string;\n\tinactive: string;\n\tinitialValue?: boolean;\n}\nexport default class ConfirmPrompt extends Prompt {\n\tget cursor() {\n\t\treturn this.value ? 0 : 1;\n\t}\n\n\tprivate get _value() {\n\t\treturn this.cursor === 0;\n\t}\n\n\tconstructor(opts: ConfirmOptions) {\n\t\tsuper(opts, false);\n\t\tthis.value = !!opts.initialValue;\n\n\t\tthis.on('value', () => {\n\t\t\tthis.value = this._value;\n\t\t});\n\n\t\tthis.on('confirm', (confirm) => {\n\t\t\tthis.output.write(cursor.move(0, -1));\n\t\t\tthis.value = confirm;\n\t\t\tthis.state = 'submit';\n\t\t\tthis.close();\n\t\t});\n\n\t\tthis.on('cursor', () => {\n\t\t\tthis.value = !this.value;\n\t\t});\n\t}\n}\n","import Prompt, { type PromptOptions } from './prompt';\n\ninterface GroupMultiSelectOptions<T extends { value: any }>\n\textends PromptOptions<GroupMultiSelectPrompt<T>> {\n\toptions: Record<string, T[]>;\n\tinitialValues?: T['value'][];\n\trequired?: boolean;\n\tcursorAt?: T['value'];\n}\nexport default class GroupMultiSelectPrompt<T extends { value: any }> extends Prompt {\n\toptions: (T & { group: string | boolean })[];\n\tcursor = 0;\n\n\tgetGroupItems(group: string): T[] {\n\t\treturn this.options.filter((o) => o.group === group);\n\t}\n\n\tisGroupSelected(group: string) {\n\t\tconst items = this.getGroupItems(group);\n\t\treturn items.every((i) => this.value.includes(i.value));\n\t}\n\n\tprivate toggleValue() {\n\t\tconst item = this.options[this.cursor];\n\t\tif (item.group === true) {\n\t\t\tconst group = item.value;\n\t\t\tconst groupedItems = this.getGroupItems(group);\n\t\t\tif (this.isGroupSelected(group)) {\n\t\t\t\tthis.value = this.value.filter(\n\t\t\t\t\t(v: string) => groupedItems.findIndex((i) => i.value === v) === -1\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tthis.value = [...this.value, ...groupedItems.map((i) => i.value)];\n\t\t\t}\n\t\t\tthis.value = Array.from(new Set(this.value));\n\t\t} else {\n\t\t\tconst selected = this.value.includes(item.value);\n\t\t\tthis.value = selected\n\t\t\t\t? this.value.filter((v: T['value']) => v !== item.value)\n\t\t\t\t: [...this.value, item.value];\n\t\t}\n\t}\n\n\tconstructor(opts: GroupMultiSelectOptions<T>) {\n\t\tsuper(opts, false);\n\t\tconst { options } = opts;\n\t\tthis.options = Object.entries(options).flatMap(([key, option]) => [\n\t\t\t{ value: key, group: true, label: key },\n\t\t\t...option.map((opt) => ({ ...opt, group: key })),\n\t\t]) as any;\n\t\tthis.value = [...(opts.initialValues ?? [])];\n\t\tthis.cursor = Math.max(\n\t\t\tthis.options.findIndex(({ value }) => value === opts.cursorAt),\n\t\t\t0\n\t\t);\n\n\t\tthis.on('cursor', (key) => {\n\t\t\tswitch (key) {\n\t\t\t\tcase 'left':\n\t\t\t\tcase 'up':\n\t\t\t\t\tthis.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'down':\n\t\t\t\tcase 'right':\n\t\t\t\t\tthis.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'space':\n\t\t\t\t\tthis.toggleValue();\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t});\n\t}\n}\n","import Prompt, { type PromptOptions } from './prompt';\n\ninterface MultiSelectOptions<T extends { value: any }> extends PromptOptions<MultiSelectPrompt<T>> {\n\toptions: T[];\n\tinitialValues?: T['value'][];\n\trequired?: boolean;\n\tcursorAt?: T['value'];\n}\nexport default class MultiSelectPrompt<T extends { value: any }> extends Prompt {\n\toptions: T[];\n\tcursor = 0;\n\n\tprivate get _value() {\n\t\treturn this.options[this.cursor].value;\n\t}\n\n\tprivate toggleAll() {\n\t\tconst allSelected = this.value.length === this.options.length;\n\t\tthis.value = allSelected ? [] : this.options.map((v) => v.value);\n\t}\n\n\tprivate toggleValue() {\n\t\tconst selected = this.value.includes(this._value);\n\t\tthis.value = selected\n\t\t\t? this.value.filter((value: T['value']) => value !== this._value)\n\t\t\t: [...this.value, this._value];\n\t}\n\n\tconstructor(opts: MultiSelectOptions<T>) {\n\t\tsuper(opts, false);\n\n\t\tthis.options = opts.options;\n\t\tthis.value = [...(opts.initialValues ?? [])];\n\t\tthis.cursor = Math.max(\n\t\t\tthis.options.findIndex(({ value }) => value === opts.cursorAt),\n\t\t\t0\n\t\t);\n\t\tthis.on('key', (char) => {\n\t\t\tif (char === 'a') {\n\t\t\t\tthis.toggleAll();\n\t\t\t}\n\t\t});\n\n\t\tthis.on('cursor', (key) => {\n\t\t\tswitch (key) {\n\t\t\t\tcase 'left':\n\t\t\t\tcase 'up':\n\t\t\t\t\tthis.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'down':\n\t\t\t\tcase 'right':\n\t\t\t\t\tthis.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'space':\n\t\t\t\t\tthis.toggleValue();\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t});\n\t}\n}\n","import color from 'picocolors';\nimport Prompt, { type PromptOptions } from './prompt';\n\ninterface PasswordOptions extends PromptOptions<PasswordPrompt> {\n\tmask?: string;\n}\nexport default class PasswordPrompt extends Prompt {\n\tvalueWithCursor = '';\n\tprivate _mask = '•';\n\tget cursor() {\n\t\treturn this._cursor;\n\t}\n\tget masked() {\n\t\treturn this.value.replaceAll(/./g, this._mask);\n\t}\n\tconstructor({ mask, ...opts }: PasswordOptions) {\n\t\tsuper(opts);\n\t\tthis._mask = mask ?? '•';\n\n\t\tthis.on('finalize', () => {\n\t\t\tthis.valueWithCursor = this.masked;\n\t\t});\n\t\tthis.on('value', () => {\n\t\t\tif (this.cursor >= this.value.length) {\n\t\t\t\tthis.valueWithCursor = `${this.masked}${color.inverse(color.hidden('_'))}`;\n\t\t\t} else {\n\t\t\t\tconst s1 = this.masked.slice(0, this.cursor);\n\t\t\t\tconst s2 = this.masked.slice(this.cursor);\n\t\t\t\tthis.valueWithCursor = `${s1}${color.inverse(s2[0])}${s2.slice(1)}`;\n\t\t\t}\n\t\t});\n\t}\n}\n","import Prompt, { type PromptOptions } from './prompt';\n\ninterface SelectOptions<T extends { value: any }> extends PromptOptions<SelectPrompt<T>> {\n\toptions: T[];\n\tinitialValue?: T['value'];\n}\nexport default class SelectPrompt<T extends { value: any }> extends Prompt {\n\toptions: T[];\n\tcursor = 0;\n\n\tprivate get _value() {\n\t\treturn this.options[this.cursor];\n\t}\n\n\tprivate changeValue() {\n\t\tthis.value = this._value.value;\n\t}\n\n\tconstructor(opts: SelectOptions<T>) {\n\t\tsuper(opts, false);\n\n\t\tthis.options = opts.options;\n\t\tthis.cursor = this.options.findIndex(({ value }) => value === opts.initialValue);\n\t\tif (this.cursor === -1) this.cursor = 0;\n\t\tthis.changeValue();\n\n\t\tthis.on('cursor', (key) => {\n\t\t\tswitch (key) {\n\t\t\t\tcase 'left':\n\t\t\t\tcase 'up':\n\t\t\t\t\tthis.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'down':\n\t\t\t\tcase 'right':\n\t\t\t\t\tthis.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tthis.changeValue();\n\t\t});\n\t}\n}\n","import Prompt, { type PromptOptions } from './prompt';\n\ninterface SelectKeyOptions<T extends { value: any }> extends PromptOptions<SelectKeyPrompt<T>> {\n\toptions: T[];\n}\nexport default class SelectKeyPrompt<T extends { value: any }> extends Prompt {\n\toptions: T[];\n\tcursor = 0;\n\n\tconstructor(opts: SelectKeyOptions<T>) {\n\t\tsuper(opts, false);\n\n\t\tthis.options = opts.options;\n\t\tconst keys = this.options.map(({ value: [initial] }) => initial?.toLowerCase());\n\t\tthis.cursor = Math.max(keys.indexOf(opts.initialValue), 0);\n\n\t\tthis.on('key', (key) => {\n\t\t\tif (!keys.includes(key)) return;\n\t\t\tconst value = this.options.find(({ value: [initial] }) => initial?.toLowerCase() === key);\n\t\t\tif (value) {\n\t\t\t\tthis.value = value.value;\n\t\t\t\tthis.state = 'submit';\n\t\t\t\tthis.emit('submit');\n\t\t\t}\n\t\t});\n\t}\n}\n","import color from 'picocolors';\nimport Prompt, { type PromptOptions } from './prompt';\n\nexport interface TextOptions extends PromptOptions<TextPrompt> {\n\tplaceholder?: string;\n\tdefaultValue?: string;\n}\n\nexport default class TextPrompt extends Prompt {\n\tget valueWithCursor() {\n\t\tif (this.state === 'submit') {\n\t\t\treturn this.value;\n\t\t}\n\t\tif (this.cursor >= this.value.length) {\n\t\t\treturn `${this.value}█`;\n\t\t}\n\t\tconst s1 = this.value.slice(0, this.cursor);\n\t\tconst [s2, ...s3] = this.value.slice(this.cursor);\n\t\treturn `${s1}${color.inverse(s2)}${s3.join('')}`;\n\t}\n\tget cursor() {\n\t\treturn this._cursor;\n\t}\n\tconstructor(opts: TextOptions) {\n\t\tsuper(opts);\n\n\t\tthis.on('finalize', () => {\n\t\t\tif (!this.value) {\n\t\t\t\tthis.value = opts.defaultValue;\n\t\t\t}\n\t\t});\n\t}\n}\n","import process from 'node:process';\n\nexport default function isUnicodeSupported() {\n\tif (process.platform !== 'win32') {\n\t\treturn process.env.TERM !== 'linux'; // Linux console (kernel)\n\t}\n\n\treturn Boolean(process.env.CI)\n\t\t|| Boolean(process.env.WT_SESSION) // Windows Terminal\n\t\t|| Boolean(process.env.TERMINUS_SUBLIME) // Terminus (<0.2.27)\n\t\t|| process.env.ConEmuTask === '{cmd::Cmder}' // ConEmu and cmder\n\t\t|| process.env.TERM_PROGRAM === 'Terminus-Sublime'\n\t\t|| process.env.TERM_PROGRAM === 'vscode'\n\t\t|| process.env.TERM === 'xterm-256color'\n\t\t|| process.env.TERM === 'alacritty'\n\t\t|| process.env.TERMINAL_EMULATOR === 'JetBrains-JediTerm';\n}\n","import { stripVTControlCharacters as strip } from 'node:util';\nimport {\n\tConfirmPrompt,\n\tGroupMultiSelectPrompt,\n\tMultiSelectPrompt,\n\tPasswordPrompt,\n\tSelectKeyPrompt,\n\tSelectPrompt,\n\ttype State,\n\tTextPrompt,\n\tblock,\n\tisCancel,\n} from '@clack/core';\nimport isUnicodeSupported from 'is-unicode-supported';\nimport color from 'picocolors';\nimport { cursor, erase } from 'sisteransi';\n\nexport { isCancel } from '@clack/core';\nexport { updateSettings, type ClackSettings } from '@clack/core';\n\nconst unicode = isUnicodeSupported();\nconst s = (c: string, fallback: string) => (unicode ? c : fallback);\nconst S_STEP_ACTIVE = s('◆', '*');\nconst S_STEP_CANCEL = s('■', 'x');\nconst S_STEP_ERROR = s('▲', 'x');\nconst S_STEP_SUBMIT = s('◇', 'o');\n\nconst S_BAR_START = s('┌', 'T');\nconst S_BAR = s('│', '|');\nconst S_BAR_END = s('└', '—');\n\nconst S_RADIO_ACTIVE = s('●', '>');\nconst S_RADIO_INACTIVE = s('○', ' ');\nconst S_CHECKBOX_ACTIVE = s('◻', '[•]');\nconst S_CHECKBOX_SELECTED = s('◼', '[+]');\nconst S_CHECKBOX_INACTIVE = s('◻', '[ ]');\nconst S_PASSWORD_MASK = s('▪', '•');\n\nconst S_BAR_H = s('─', '-');\nconst S_CORNER_TOP_RIGHT = s('╮', '+');\nconst S_CONNECT_LEFT = s('├', '+');\nconst S_CORNER_BOTTOM_RIGHT = s('╯', '+');\n\nconst S_INFO = s('●', '•');\nconst S_SUCCESS = s('◆', '*');\nconst S_WARN = s('▲', '!');\nconst S_ERROR = s('■', 'x');\n\nconst symbol = (state: State) => {\n\tswitch (state) {\n\t\tcase 'initial':\n\t\tcase 'active':\n\t\t\treturn color.cyan(S_STEP_ACTIVE);\n\t\tcase 'cancel':\n\t\t\treturn color.red(S_STEP_CANCEL);\n\t\tcase 'error':\n\t\t\treturn color.yellow(S_STEP_ERROR);\n\t\tcase 'submit':\n\t\t\treturn color.green(S_STEP_SUBMIT);\n\t}\n};\n\ninterface LimitOptionsParams<TOption> {\n\toptions: TOption[];\n\tmaxItems: number | undefined;\n\tcursor: number;\n\tstyle: (option: TOption, active: boolean) => string;\n}\n\nconst limitOptions = <TOption>(params: LimitOptionsParams<TOption>): string[] => {\n\tconst { cursor, options, style } = params;\n\n\tconst paramMaxItems = params.maxItems ?? Number.POSITIVE_INFINITY;\n\tconst outputMaxItems = Math.max(process.stdout.rows - 4, 0);\n\t// We clamp to minimum 5 because anything less doesn't make sense UX wise\n\tconst maxItems = Math.min(outputMaxItems, Math.max(paramMaxItems, 5));\n\tlet slidingWindowLocation = 0;\n\n\tif (cursor >= slidingWindowLocation + maxItems - 3) {\n\t\tslidingWindowLocation = Math.max(Math.min(cursor - maxItems + 3, options.length - maxItems), 0);\n\t} else if (cursor < slidingWindowLocation + 2) {\n\t\tslidingWindowLocation = Math.max(cursor - 2, 0);\n\t}\n\n\tconst shouldRenderTopEllipsis = maxItems < options.length && slidingWindowLocation > 0;\n\tconst shouldRenderBottomEllipsis =\n\t\tmaxItems < options.length && slidingWindowLocation + maxItems < options.length;\n\n\treturn options\n\t\t.slice(slidingWindowLocation, slidingWindowLocation + maxItems)\n\t\t.map((option, i, arr) => {\n\t\t\tconst isTopLimit = i === 0 && shouldRenderTopEllipsis;\n\t\t\tconst isBottomLimit = i === arr.length - 1 && shouldRenderBottomEllipsis;\n\t\t\treturn isTopLimit || isBottomLimit\n\t\t\t\t? color.dim('...')\n\t\t\t\t: style(option, i + slidingWindowLocation === cursor);\n\t\t});\n};\n\nexport interface TextOptions {\n\tmessage: string;\n\tplaceholder?: string;\n\tdefaultValue?: string;\n\tinitialValue?: string;\n\tvalidate?: (value: string) => string | Error | undefined;\n}\nexport const text = (opts: TextOptions) => {\n\treturn new TextPrompt({\n\t\tvalidate: opts.validate,\n\t\tplaceholder: opts.placeholder,\n\t\tdefaultValue: opts.defaultValue,\n\t\tinitialValue: opts.initialValue,\n\t\trender() {\n\t\t\tconst title = `${color.gray(S_BAR)}\\n${symbol(this.state)} ${opts.message}\\n`;\n\t\t\tconst placeholder = opts.placeholder\n\t\t\t\t? color.inverse(opts.placeholder[0]) + color.dim(opts.placeholder.slice(1))\n\t\t\t\t: color.inverse(color.hidden('_'));\n\t\t\tconst value = !this.value ? placeholder : this.valueWithCursor;\n\n\t\t\tswitch (this.state) {\n\t\t\t\tcase 'error':\n\t\t\t\t\treturn `${title.trim()}\\n${color.yellow(S_BAR)} ${value}\\n${color.yellow(\n\t\t\t\t\t\tS_BAR_END\n\t\t\t\t\t)} ${color.yellow(this.error)}\\n`;\n\t\t\t\tcase 'submit':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${color.dim(this.value || opts.placeholder)}`;\n\t\t\t\tcase 'cancel':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${color.strikethrough(\n\t\t\t\t\t\tcolor.dim(this.value ?? '')\n\t\t\t\t\t)}${this.value?.trim() ? `\\n${color.gray(S_BAR)}` : ''}`;\n\t\t\t\tdefault:\n\t\t\t\t\treturn `${title}${color.cyan(S_BAR)} ${value}\\n${color.cyan(S_BAR_END)}\\n`;\n\t\t\t}\n\t\t},\n\t}).prompt() as Promise<string | symbol>;\n};\n\nexport interface PasswordOptions {\n\tmessage: string;\n\tmask?: string;\n\tvalidate?: (value: string) => string | Error | undefined;\n}\nexport const password = (opts: PasswordOptions) => {\n\treturn new PasswordPrompt({\n\t\tvalidate: opts.validate,\n\t\tmask: opts.mask ?? S_PASSWORD_MASK,\n\t\trender() {\n\t\t\tconst title = `${color.gray(S_BAR)}\\n${symbol(this.state)} ${opts.message}\\n`;\n\t\t\tconst value = this.valueWithCursor;\n\t\t\tconst masked = this.masked;\n\n\t\t\tswitch (this.state) {\n\t\t\t\tcase 'error':\n\t\t\t\t\treturn `${title.trim()}\\n${color.yellow(S_BAR)} ${masked}\\n${color.yellow(\n\t\t\t\t\t\tS_BAR_END\n\t\t\t\t\t)} ${color.yellow(this.error)}\\n`;\n\t\t\t\tcase 'submit':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${color.dim(masked)}`;\n\t\t\t\tcase 'cancel':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${color.strikethrough(color.dim(masked ?? ''))}${\n\t\t\t\t\t\tmasked ? `\\n${color.gray(S_BAR)}` : ''\n\t\t\t\t\t}`;\n\t\t\t\tdefault:\n\t\t\t\t\treturn `${title}${color.cyan(S_BAR)} ${value}\\n${color.cyan(S_BAR_END)}\\n`;\n\t\t\t}\n\t\t},\n\t}).prompt() as Promise<string | symbol>;\n};\n\nexport interface ConfirmOptions {\n\tmessage: string;\n\tactive?: string;\n\tinactive?: string;\n\tinitialValue?: boolean;\n}\nexport const confirm = (opts: ConfirmOptions) => {\n\tconst active = opts.active ?? 'Yes';\n\tconst inactive = opts.inactive ?? 'No';\n\treturn new ConfirmPrompt({\n\t\tactive,\n\t\tinactive,\n\t\tinitialValue: opts.initialValue ?? true,\n\t\trender() {\n\t\t\tconst title = `${color.gray(S_BAR)}\\n${symbol(this.state)} ${opts.message}\\n`;\n\t\t\tconst value = this.value ? active : inactive;\n\n\t\t\tswitch (this.state) {\n\t\t\t\tcase 'submit':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${color.dim(value)}`;\n\t\t\t\tcase 'cancel':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${color.strikethrough(\n\t\t\t\t\t\tcolor.dim(value)\n\t\t\t\t\t)}\\n${color.gray(S_BAR)}`;\n\t\t\t\tdefault: {\n\t\t\t\t\treturn `${title}${color.cyan(S_BAR)} ${\n\t\t\t\t\t\tthis.value\n\t\t\t\t\t\t\t? `${color.green(S_RADIO_ACTIVE)} ${active}`\n\t\t\t\t\t\t\t: `${color.dim(S_RADIO_INACTIVE)} ${color.dim(active)}`\n\t\t\t\t\t} ${color.dim('/')} ${\n\t\t\t\t\t\t!this.value\n\t\t\t\t\t\t\t? `${color.green(S_RADIO_ACTIVE)} ${inactive}`\n\t\t\t\t\t\t\t: `${color.dim(S_RADIO_INACTIVE)} ${color.dim(inactive)}`\n\t\t\t\t\t}\\n${color.cyan(S_BAR_END)}\\n`;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t}).prompt() as Promise<boolean | symbol>;\n};\n\ntype Primitive = Readonly<string | boolean | number>;\n\nexport type Option<Value> = Value extends Primitive\n\t? {\n\t\t\t/**\n\t\t\t * Internal data for this option.\n\t\t\t */\n\t\t\tvalue: Value;\n\t\t\t/**\n\t\t\t * The optional, user-facing text for this option.\n\t\t\t *\n\t\t\t * By default, the `value` is converted to a string.\n\t\t\t */\n\t\t\tlabel?: string;\n\t\t\t/**\n\t\t\t * An optional hint to display to the user when\n\t\t\t * this option might be selected.\n\t\t\t *\n\t\t\t * By default, no `hint` is displayed.\n\t\t\t */\n\t\t\thint?: string;\n\t\t}\n\t: {\n\t\t\t/**\n\t\t\t * Internal data for this option.\n\t\t\t */\n\t\t\tvalue: Value;\n\t\t\t/**\n\t\t\t * Required. The user-facing text for this option.\n\t\t\t */\n\t\t\tlabel: string;\n\t\t\t/**\n\t\t\t * An optional hint to display to the user when\n\t\t\t * this option might be selected.\n\t\t\t *\n\t\t\t * By default, no `hint` is displayed.\n\t\t\t */\n\t\t\thint?: string;\n\t\t};\n\nexport interface SelectOptions<Value> {\n\tmessage: string;\n\toptions: Option<Value>[];\n\tinitialValue?: Value;\n\tmaxItems?: number;\n}\n\nexport const select = <Value>(opts: SelectOptions<Value>) => {\n\tconst opt = (option: Option<Value>, state: 'inactive' | 'active' | 'selected' | 'cancelled') => {\n\t\tconst label = option.label ?? String(option.value);\n\t\tswitch (state) {\n\t\t\tcase 'selected':\n\t\t\t\treturn `${color.dim(label)}`;\n\t\t\tcase 'active':\n\t\t\t\treturn `${color.green(S_RADIO_ACTIVE)} ${label} ${\n\t\t\t\t\toption.hint ? color.dim(`(${option.hint})`) : ''\n\t\t\t\t}`;\n\t\t\tcase 'cancelled':\n\t\t\t\treturn `${color.strikethrough(color.dim(label))}`;\n\t\t\tdefault:\n\t\t\t\treturn `${color.dim(S_RADIO_INACTIVE)} ${color.dim(label)}`;\n\t\t}\n\t};\n\n\treturn new SelectPrompt({\n\t\toptions: opts.options,\n\t\tinitialValue: opts.initialValue,\n\t\trender() {\n\t\t\tconst title = `${color.gray(S_BAR)}\\n${symbol(this.state)} ${opts.message}\\n`;\n\n\t\t\tswitch (this.state) {\n\t\t\t\tcase 'submit':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${opt(this.options[this.cursor], 'selected')}`;\n\t\t\t\tcase 'cancel':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${opt(\n\t\t\t\t\t\tthis.options[this.cursor],\n\t\t\t\t\t\t'cancelled'\n\t\t\t\t\t)}\\n${color.gray(S_BAR)}`;\n\t\t\t\tdefault: {\n\t\t\t\t\treturn `${title}${color.cyan(S_BAR)} ${limitOptions({\n\t\t\t\t\t\tcursor: this.cursor,\n\t\t\t\t\t\toptions: this.options,\n\t\t\t\t\t\tmaxItems: opts.maxItems,\n\t\t\t\t\t\tstyle: (item, active) => opt(item, active ? 'active' : 'inactive'),\n\t\t\t\t\t}).join(`\\n${color.cyan(S_BAR)} `)}\\n${color.cyan(S_BAR_END)}\\n`;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t}).prompt() as Promise<Value | symbol>;\n};\n\nexport const selectKey = <Value extends string>(opts: SelectOptions<Value>) => {\n\tconst opt = (\n\t\toption: Option<Value>,\n\t\tstate: 'inactive' | 'active' | 'selected' | 'cancelled' = 'inactive'\n\t) => {\n\t\tconst label = option.label ?? String(option.value);\n\t\tif (state === 'selected') {\n\t\t\treturn `${color.dim(label)}`;\n\t\t}\n\t\tif (state === 'cancelled') {\n\t\t\treturn `${color.strikethrough(color.dim(label))}`;\n\t\t}\n\t\tif (state === 'active') {\n\t\t\treturn `${color.bgCyan(color.gray(` ${option.value} `))} ${label} ${\n\t\t\t\toption.hint ? color.dim(`(${option.hint})`) : ''\n\t\t\t}`;\n\t\t}\n\t\treturn `${color.gray(color.bgWhite(color.inverse(` ${option.value} `)))} ${label} ${\n\t\t\toption.hint ? color.dim(`(${option.hint})`) : ''\n\t\t}`;\n\t};\n\n\treturn new SelectKeyPrompt({\n\t\toptions: opts.options,\n\t\tinitialValue: opts.initialValue,\n\t\trender() {\n\t\t\tconst title = `${color.gray(S_BAR)}\\n${symbol(this.state)} ${opts.message}\\n`;\n\n\t\t\tswitch (this.state) {\n\t\t\t\tcase 'submit':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${opt(\n\t\t\t\t\t\tthis.options.find((opt) => opt.value === this.value) ?? opts.options[0],\n\t\t\t\t\t\t'selected'\n\t\t\t\t\t)}`;\n\t\t\t\tcase 'cancel':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${opt(this.options[0], 'cancelled')}\\n${color.gray(\n\t\t\t\t\t\tS_BAR\n\t\t\t\t\t)}`;\n\t\t\t\tdefault: {\n\t\t\t\t\treturn `${title}${color.cyan(S_BAR)} ${this.options\n\t\t\t\t\t\t.map((option, i) => opt(option, i === this.cursor ? 'active' : 'inactive'))\n\t\t\t\t\t\t.join(`\\n${color.cyan(S_BAR)} `)}\\n${color.cyan(S_BAR_END)}\\n`;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t}).prompt() as Promise<Value | symbol>;\n};\n\nexport interface MultiSelectOptions<Value> {\n\tmessage: string;\n\toptions: Option<Value>[];\n\tinitialValues?: Value[];\n\tmaxItems?: number;\n\trequired?: boolean;\n\tcursorAt?: Value;\n}\nexport const multiselect = <Value>(opts: MultiSelectOptions<Value>) => {\n\tconst opt = (\n\t\toption: Option<Value>,\n\t\tstate: 'inactive' | 'active' | 'selected' | 'active-selected' | 'submitted' | 'cancelled'\n\t) => {\n\t\tconst label = option.label ?? String(option.value);\n\t\tif (state === 'active') {\n\t\t\treturn `${color.cyan(S_CHECKBOX_ACTIVE)} ${label} ${\n\t\t\t\toption.hint ? color.dim(`(${option.hint})`) : ''\n\t\t\t}`;\n\t\t}\n\t\tif (state === 'selected') {\n\t\t\treturn `${color.green(S_CHECKBOX_SELECTED)} ${color.dim(label)}`;\n\t\t}\n\t\tif (state === 'cancelled') {\n\t\t\treturn `${color.strikethrough(color.dim(label))}`;\n\t\t}\n\t\tif (state === 'active-selected') {\n\t\t\treturn `${color.green(S_CHECKBOX_SELECTED)} ${label} ${\n\t\t\t\toption.hint ? color.dim(`(${option.hint})`) : ''\n\t\t\t}`;\n\t\t}\n\t\tif (state === 'submitted') {\n\t\t\treturn `${color.dim(label)}`;\n\t\t}\n\t\treturn `${color.dim(S_CHECKBOX_INACTIVE)} ${color.dim(label)}`;\n\t};\n\n\treturn new MultiSelectPrompt({\n\t\toptions: opts.options,\n\t\tinitialValues: opts.initialValues,\n\t\trequired: opts.required ?? true,\n\t\tcursorAt: opts.cursorAt,\n\t\tvalidate(selected: Value[]) {\n\t\t\tif (this.required && selected.length === 0)\n\t\t\t\treturn `Please select at least one option.\\n${color.reset(\n\t\t\t\t\tcolor.dim(\n\t\t\t\t\t\t`Press ${color.gray(color.bgWhite(color.inverse(' space ')))} to select, ${color.gray(\n\t\t\t\t\t\t\tcolor.bgWhite(color.inverse(' enter '))\n\t\t\t\t\t\t)} to submit`\n\t\t\t\t\t)\n\t\t\t\t)}`;\n\t\t},\n\t\trender() {\n\t\t\tconst title = `${color.gray(S_BAR)}\\n${symbol(this.state)} ${opts.message}\\n`;\n\n\t\t\tconst styleOption = (option: Option<Value>, active: boolean) => {\n\t\t\t\tconst selected = this.value.includes(option.value);\n\t\t\t\tif (active && selected) {\n\t\t\t\t\treturn opt(option, 'active-selected');\n\t\t\t\t}\n\t\t\t\tif (selected) {\n\t\t\t\t\treturn opt(option, 'selected');\n\t\t\t\t}\n\t\t\t\treturn opt(option, active ? 'active' : 'inactive');\n\t\t\t};\n\n\t\t\tswitch (this.state) {\n\t\t\t\tcase 'submit': {\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${\n\t\t\t\t\t\tthis.options\n\t\t\t\t\t\t\t.filter(({ value }) => this.value.includes(value))\n\t\t\t\t\t\t\t.map((option) => opt(option, 'submitted'))\n\t\t\t\t\t\t\t.join(color.dim(', ')) || color.dim('none')\n\t\t\t\t\t}`;\n\t\t\t\t}\n\t\t\t\tcase 'cancel': {\n\t\t\t\t\tconst label = this.options\n\t\t\t\t\t\t.filter(({ value }) => this.value.includes(value))\n\t\t\t\t\t\t.map((option) => opt(option, 'cancelled'))\n\t\t\t\t\t\t.join(color.dim(', '));\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${\n\t\t\t\t\t\tlabel.trim() ? `${label}\\n${color.gray(S_BAR)}` : ''\n\t\t\t\t\t}`;\n\t\t\t\t}\n\t\t\t\tcase 'error': {\n\t\t\t\t\tconst footer = this.error\n\t\t\t\t\t\t.split('\\n')\n\t\t\t\t\t\t.map((ln, i) =>\n\t\t\t\t\t\t\ti === 0 ? `${color.yellow(S_BAR_END)} ${color.yellow(ln)}` : ` ${ln}`\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.join('\\n');\n\t\t\t\t\treturn `${title + color.yellow(S_BAR)} ${limitOptions({\n\t\t\t\t\t\toptions: this.options,\n\t\t\t\t\t\tcursor: this.cursor,\n\t\t\t\t\t\tmaxItems: opts.maxItems,\n\t\t\t\t\t\tstyle: styleOption,\n\t\t\t\t\t}).join(`\\n${color.yellow(S_BAR)} `)}\\n${footer}\\n`;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\treturn `${title}${color.cyan(S_BAR)} ${limitOptions({\n\t\t\t\t\t\toptions: this.options,\n\t\t\t\t\t\tcursor: this.cursor,\n\t\t\t\t\t\tmaxItems: opts.maxItems,\n\t\t\t\t\t\tstyle: styleOption,\n\t\t\t\t\t}).join(`\\n${color.cyan(S_BAR)} `)}\\n${color.cyan(S_BAR_END)}\\n`;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t}).prompt() as Promise<Value[] | symbol>;\n};\n\nexport interface GroupMultiSelectOptions<Value> {\n\tmessage: string;\n\toptions: Record<string, Option<Value>[]>;\n\tinitialValues?: Value[];\n\trequired?: boolean;\n\tcursorAt?: Value;\n}\nexport const groupMultiselect = <Value>(opts: GroupMultiSelectOptions<Value>) => {\n\tconst opt = (\n\t\toption: Option<Value>,\n\t\tstate:\n\t\t\t| 'inactive'\n\t\t\t| 'active'\n\t\t\t| 'selected'\n\t\t\t| 'active-selected'\n\t\t\t| 'group-active'\n\t\t\t| 'group-active-selected'\n\t\t\t| 'submitted'\n\t\t\t| 'cancelled',\n\t\toptions: Option<Value>[] = []\n\t) => {\n\t\tconst label = option.label ?? String(option.value);\n\t\tconst isItem = typeof (option as any).group === 'string';\n\t\tconst next = isItem && (options[options.indexOf(option) + 1] ?? { group: true });\n\t\tconst isLast = isItem && (next as any).group === true;\n\t\tconst prefix = isItem ? `${isLast ? S_BAR_END : S_BAR} ` : '';\n\n\t\tif (state === 'active') {\n\t\t\treturn `${color.dim(prefix)}${color.cyan(S_CHECKBOX_ACTIVE)} ${label} ${\n\t\t\t\toption.hint ? color.dim(`(${option.hint})`) : ''\n\t\t\t}`;\n\t\t}\n\t\tif (state === 'group-active') {\n\t\t\treturn `${prefix}${color.cyan(S_CHECKBOX_ACTIVE)} ${color.dim(label)}`;\n\t\t}\n\t\tif (state === 'group-active-selected') {\n\t\t\treturn `${prefix}${color.green(S_CHECKBOX_SELECTED)} ${color.dim(label)}`;\n\t\t}\n\t\tif (state === 'selected') {\n\t\t\treturn `${color.dim(prefix)}${color.green(S_CHECKBOX_SELECTED)} ${color.dim(label)}`;\n\t\t}\n\t\tif (state === 'cancelled') {\n\t\t\treturn `${color.strikethrough(color.dim(label))}`;\n\t\t}\n\t\tif (state === 'active-selected') {\n\t\t\treturn `${color.dim(prefix)}${color.green(S_CHECKBOX_SELECTED)} ${label} ${\n\t\t\t\toption.hint ? color.dim(`(${option.hint})`) : ''\n\t\t\t}`;\n\t\t}\n\t\tif (state === 'submitted') {\n\t\t\treturn `${color.dim(label)}`;\n\t\t}\n\t\treturn `${color.dim(prefix)}${color.dim(S_CHECKBOX_INACTIVE)} ${color.dim(label)}`;\n\t};\n\n\treturn new GroupMultiSelectPrompt({\n\t\toptions: opts.options,\n\t\tinitialValues: opts.initialValues,\n\t\trequired: opts.required ?? true,\n\t\tcursorAt: opts.cursorAt,\n\t\tvalidate(selected: Value[]) {\n\t\t\tif (this.required && selected.length === 0)\n\t\t\t\treturn `Please select at least one option.\\n${color.reset(\n\t\t\t\t\tcolor.dim(\n\t\t\t\t\t\t`Press ${color.gray(color.bgWhite(color.inverse(' space ')))} to select, ${color.gray(\n\t\t\t\t\t\t\tcolor.bgWhite(color.inverse(' enter '))\n\t\t\t\t\t\t)} to submit`\n\t\t\t\t\t)\n\t\t\t\t)}`;\n\t\t},\n\t\trender() {\n\t\t\tconst title = `${color.gray(S_BAR)}\\n${symbol(this.state)} ${opts.message}\\n`;\n\n\t\t\tswitch (this.state) {\n\t\t\t\tcase 'submit': {\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${this.options\n\t\t\t\t\t\t.filter(({ value }) => this.value.includes(value))\n\t\t\t\t\t\t.map((option) => opt(option, 'submitted'))\n\t\t\t\t\t\t.join(color.dim(', '))}`;\n\t\t\t\t}\n\t\t\t\tcase 'cancel': {\n\t\t\t\t\tconst label = this.options\n\t\t\t\t\t\t.filter(({ value }) => this.value.includes(value))\n\t\t\t\t\t\t.map((option) => opt(option, 'cancelled'))\n\t\t\t\t\t\t.join(color.dim(', '));\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${\n\t\t\t\t\t\tlabel.trim() ? `${label}\\n${color.gray(S_BAR)}` : ''\n\t\t\t\t\t}`;\n\t\t\t\t}\n\t\t\t\tcase 'error': {\n\t\t\t\t\tconst footer = this.error\n\t\t\t\t\t\t.split('\\n')\n\t\t\t\t\t\t.map((ln, i) =>\n\t\t\t\t\t\t\ti === 0 ? `${color.yellow(S_BAR_END)} ${color.yellow(ln)}` : ` ${ln}`\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.join('\\n');\n\t\t\t\t\treturn `${title}${color.yellow(S_BAR)} ${this.options\n\t\t\t\t\t\t.map((option, i, options) => {\n\t\t\t\t\t\t\tconst selected =\n\t\t\t\t\t\t\t\tthis.value.includes(option.value) ||\n\t\t\t\t\t\t\t\t(option.group === true && this.isGroupSelected(`${option.value}`));\n\t\t\t\t\t\t\tconst active = i === this.cursor;\n\t\t\t\t\t\t\tconst groupActive =\n\t\t\t\t\t\t\t\t!active &&\n\t\t\t\t\t\t\t\ttypeof option.group === 'string' &&\n\t\t\t\t\t\t\t\tthis.options[this.cursor].value === option.group;\n\t\t\t\t\t\t\tif (groupActive) {\n\t\t\t\t\t\t\t\treturn opt(option, selected ? 'group-active-selected' : 'group-active', options);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (active && selected) {\n\t\t\t\t\t\t\t\treturn opt(option, 'active-selected', options);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (selected) {\n\t\t\t\t\t\t\t\treturn opt(option, 'selected', options);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn opt(option, active ? 'active' : 'inactive', options);\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.join(`\\n${color.yellow(S_BAR)} `)}\\n${footer}\\n`;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\treturn `${title}${color.cyan(S_BAR)} ${this.options\n\t\t\t\t\t\t.map((option, i, options) => {\n\t\t\t\t\t\t\tconst selected =\n\t\t\t\t\t\t\t\tthis.value.includes(option.value) ||\n\t\t\t\t\t\t\t\t(option.group === true && this.isGroupSelected(`${option.value}`));\n\t\t\t\t\t\t\tconst active = i === this.cursor;\n\t\t\t\t\t\t\tconst groupActive =\n\t\t\t\t\t\t\t\t!active &&\n\t\t\t\t\t\t\t\ttypeof option.group === 'string' &&\n\t\t\t\t\t\t\t\tthis.options[this.cursor].value === option.group;\n\t\t\t\t\t\t\tif (groupActive) {\n\t\t\t\t\t\t\t\treturn opt(option, selected ? 'group-active-selected' : 'group-active', options);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (active && selected) {\n\t\t\t\t\t\t\t\treturn opt(option, 'active-selected', options);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (selected) {\n\t\t\t\t\t\t\t\treturn opt(option, 'selected', options);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn opt(option, active ? 'active' : 'inactive', options);\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.join(`\\n${color.cyan(S_BAR)} `)}\\n${color.cyan(S_BAR_END)}\\n`;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t}).prompt() as Promise<Value[] | symbol>;\n};\n\nexport const note = (message = '', title = '') => {\n\tconst lines = `\\n${message}\\n`.split('\\n');\n\tconst titleLen = strip(title).length;\n\tconst len =\n\t\tMath.max(\n\t\t\tlines.reduce((sum, ln) => {\n\t\t\t\tconst line = strip(ln);\n\t\t\t\treturn line.length > sum ? line.length : sum;\n\t\t\t}, 0),\n\t\t\ttitleLen\n\t\t) + 2;\n\tconst msg = lines\n\t\t.map(\n\t\t\t(ln) =>\n\t\t\t\t`${color.gray(S_BAR)} ${color.dim(ln)}${' '.repeat(len - strip(ln).length)}${color.gray(\n\t\t\t\t\tS_BAR\n\t\t\t\t)}`\n\t\t)\n\t\t.join('\\n');\n\tprocess.stdout.write(\n\t\t`${color.gray(S_BAR)}\\n${color.green(S_STEP_SUBMIT)} ${color.reset(title)} ${color.gray(\n\t\t\tS_BAR_H.repeat(Math.max(len - titleLen - 1, 1)) + S_CORNER_TOP_RIGHT\n\t\t)}\\n${msg}\\n${color.gray(S_CONNECT_LEFT + S_BAR_H.repeat(len + 2) + S_CORNER_BOTTOM_RIGHT)}\\n`\n\t);\n};\n\nexport const cancel = (message = '') => {\n\tprocess.stdout.write(`${color.gray(S_BAR_END)} ${color.red(message)}\\n\\n`);\n};\n\nexport const intro = (title = '') => {\n\tprocess.stdout.write(`${color.gray(S_BAR_START)} ${title}\\n`);\n};\n\nexport const outro = (message = '') => {\n\tprocess.stdout.write(`${color.gray(S_BAR)}\\n${color.gray(S_BAR_END)} ${message}\\n\\n`);\n};\n\nexport type LogMessageOptions = {\n\tsymbol?: string;\n};\nexport const log = {\n\tmessage: (message = '', { symbol = color.gray(S_BAR) }: LogMessageOptions = {}) => {\n\t\tconst parts = [`${color.gray(S_BAR)}`];\n\t\tif (message) {\n\t\t\tconst [firstLine, ...lines] = message.split('\\n');\n\t\t\tparts.push(`${symbol} ${firstLine}`, ...lines.map((ln) => `${color.gray(S_BAR)} ${ln}`));\n\t\t}\n\t\tprocess.stdout.write(`${parts.join('\\n')}\\n`);\n\t},\n\tinfo: (message: string) => {\n\t\tlog.message(message, { symbol: color.blue(S_INFO) });\n\t},\n\tsuccess: (message: string) => {\n\t\tlog.message(message, { symbol: color.green(S_SUCCESS) });\n\t},\n\tstep: (message: string) => {\n\t\tlog.message(message, { symbol: color.green(S_STEP_SUBMIT) });\n\t},\n\twarn: (message: string) => {\n\t\tlog.message(message, { symbol: color.yellow(S_WARN) });\n\t},\n\t/** alias for `log.warn()`. */\n\twarning: (message: string) => {\n\t\tlog.warn(message);\n\t},\n\terror: (message: string) => {\n\t\tlog.message(message, { symbol: color.red(S_ERROR) });\n\t},\n};\n\nexport const spinner = () => {\n\tconst frames = unicode ? ['◒', '◐', '◓', '◑'] : ['•', 'o', 'O', '0'];\n\tconst delay = unicode ? 80 : 120;\n\tconst isCI = process.env.CI === 'true';\n\n\tlet unblock: () => void;\n\tlet loop: NodeJS.Timeout;\n\tlet isSpinnerActive = false;\n\tlet _message = '';\n\tlet _prevMessage: string | undefined = undefined;\n\n\tconst handleExit = (code: number) => {\n\t\tconst msg = code > 1 ? 'Something went wrong' : 'Canceled';\n\t\tif (isSpinnerActive) stop(msg, code);\n\t};\n\n\tconst errorEventHandler = () => handleExit(2);\n\tconst signalEventHandler = () => handleExit(1);\n\n\tconst registerHooks = () => {\n\t\t// Reference: https://nodejs.org/api/process.html#event-uncaughtexception\n\t\tprocess.on('uncaughtExceptionMonitor', errorEventHandler);\n\t\t// Reference: https://nodejs.org/api/process.html#event-unhandledrejection\n\t\tprocess.on('unhandledRejection', errorEventHandler);\n\t\t// Reference Signal Events: https://nodejs.org/api/process.html#signal-events\n\t\tprocess.on('SIGINT', signalEventHandler);\n\t\tprocess.on('SIGTERM', signalEventHandler);\n\t\tprocess.on('exit', handleExit);\n\t};\n\n\tconst clearHooks = () => {\n\t\tprocess.removeListener('uncaughtExceptionMonitor', errorEventHandler);\n\t\tprocess.removeListener('unhandledRejection', errorEventHandler);\n\t\tprocess.removeListener('SIGINT', signalEventHandler);\n\t\tprocess.removeListener('SIGTERM', signalEventHandler);\n\t\tprocess.removeListener('exit', handleExit);\n\t};\n\n\tconst clearPrevMessage = () => {\n\t\tif (_prevMessage === undefined) return;\n\t\tif (isCI) process.stdout.write('\\n');\n\t\tconst prevLines = _prevMessage.split('\\n');\n\t\tprocess.stdout.write(cursor.move(-999, prevLines.length - 1));\n\t\tprocess.stdout.write(erase.down(prevLines.length));\n\t};\n\n\tconst parseMessage = (msg: string): string => {\n\t\treturn msg.replace(/\\.+$/, '');\n\t};\n\n\tconst start = (msg = ''): void => {\n\t\tisSpinnerActive = true;\n\t\tunblock = block();\n\t\t_message = parseMessage(msg);\n\t\tprocess.stdout.write(`${color.gray(S_BAR)}\\n`);\n\t\tlet frameIndex = 0;\n\t\tlet dotsTimer = 0;\n\t\tregisterHooks();\n\t\tloop = setInterval(() => {\n\t\t\tif (isCI && _message === _prevMessage) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tclearPrevMessage();\n\t\t\t_prevMessage = _message;\n\t\t\tconst frame = color.magenta(frames[frameIndex]);\n\t\t\tconst loadingDots = isCI ? '...' : '.'.repeat(Math.floor(dotsTimer)).slice(0, 3);\n\t\t\tprocess.stdout.write(`${frame} ${_message}${loadingDots}`);\n\t\t\tframeIndex = frameIndex + 1 < frames.length ? frameIndex + 1 : 0;\n\t\t\tdotsTimer = dotsTimer < frames.length ? dotsTimer + 0.125 : 0;\n\t\t}, delay);\n\t};\n\n\tconst stop = (msg = '', code = 0): void => {\n\t\tisSpinnerActive = false;\n\t\tclearInterval(loop);\n\t\tclearPrevMessage();\n\t\tconst step =\n\t\t\tcode === 0\n\t\t\t\t? color.green(S_STEP_SUBMIT)\n\t\t\t\t: code === 1\n\t\t\t\t\t? color.red(S_STEP_CANCEL)\n\t\t\t\t\t: color.red(S_STEP_ERROR);\n\t\t_message = parseMessage(msg ?? _message);\n\t\tprocess.stdout.write(`${step} ${_message}\\n`);\n\t\tclearHooks();\n\t\tunblock();\n\t};\n\n\tconst message = (msg = ''): void => {\n\t\t_message = parseMessage(msg ?? _message);\n\t};\n\n\treturn {\n\t\tstart,\n\t\tstop,\n\t\tmessage,\n\t};\n};\n\nexport type PromptGroupAwaitedReturn<T> = {\n\t[P in keyof T]: Exclude<Awaited<T[P]>, symbol>;\n};\n\nexport interface PromptGroupOptions<T> {\n\t/**\n\t * Control how the group can be canceled\n\t * if one of the prompts is canceled.\n\t */\n\tonCancel?: (opts: { results: Prettify<Partial<PromptGroupAwaitedReturn<T>>> }) => void;\n}\n\ntype Prettify<T> = {\n\t[P in keyof T]: T[P];\n} & {};\n\nexport type PromptGroup<T> = {\n\t[P in keyof T]: (opts: {\n\t\tresults: Prettify<Partial<PromptGroupAwaitedReturn<Omit<T, P>>>>;\n\t}) => undefined | Promise<T[P] | undefined>;\n};\n\n/**\n * Define a group of prompts to be displayed\n * and return a results of objects within the group\n */\nexport const group = async <T>(\n\tprompts: PromptGroup<T>,\n\topts?: PromptGroupOptions<T>\n): Promise<Prettify<PromptGroupAwaitedReturn<T>>> => {\n\tconst results = {} as any;\n\tconst promptNames = Object.keys(prompts);\n\n\tfor (const name of promptNames) {\n\t\tconst prompt = prompts[name as keyof T];\n\t\tconst result = await prompt({ results })?.catch((e) => {\n\t\t\tthrow e;\n\t\t});\n\n\t\t// Pass the results to the onCancel function\n\t\t// so the user can decide what to do with the results\n\t\t// TODO: Switch to callback within core to avoid isCancel Fn\n\t\tif (typeof opts?.onCancel === 'function' && isCancel(result)) {\n\t\t\tresults[name] = 'canceled';\n\t\t\topts.onCancel({ results });\n\t\t\tcontinue;\n\t\t}\n\n\t\tresults[name] = result;\n\t}\n\n\treturn results;\n};\n\nexport type Task = {\n\t/**\n\t * Task title\n\t */\n\ttitle: string;\n\t/**\n\t * Task function\n\t */\n\ttask: (message: (string: string) => void) => string | Promise<string> | void | Promise<void>;\n\n\t/**\n\t * If enabled === false the task will be skipped\n\t */\n\tenabled?: boolean;\n};\n\n/**\n * Define a group of tasks to be executed\n */\nexport const tasks = async (tasks: Task[]) => {\n\tfor (const task of tasks) {\n\t\tif (task.enabled === false) continue;\n\n\t\tconst s = spinner();\n\t\ts.start(task.title);\n\t\tconst result = await task.task(s.message);\n\t\ts.stop(result || task.title);\n\t}\n};\n","export const TAILWIND_V3_CONFIG = `import type { Config } from 'tailwindcss';\nimport exemPlugin from '@exem-ui/tailwindcss3/plugin';\n\nconst config: Config = {\n darkMode: 'class',\n plugins: [exemPlugin],\n content: [\n './src/**/*.{js,ts,jsx,tsx}',\n './node_modules/@exem-ui/react/dist/**/*.{js,mjs}',\n ],\n};\n\nexport default config;\n`;\n\nexport const TAILWIND_V3_MANUAL_MSG = `\nAdd the Exem UI plugin to your existing tailwind.config.ts:\n\n import exemPlugin from '@exem-ui/tailwindcss3/plugin';\n\n export default {\n darkMode: 'class',\n plugins: [exemPlugin],\n content: [\n // ... your existing content paths\n './node_modules/@exem-ui/react/dist/**/*.{js,mjs}',\n ],\n };\n\n 📖 https://ui.ex-em.com/getting-started/installation\n`;\n","export const TAILWIND_V4_IMPORT = `@import '@exem-ui/tailwindcss4';\n`;\n\nexport const TAILWIND_V4_MANUAL_MSG = `\nAdd the following import to the top of your main CSS file:\n\n @import '@exem-ui/tailwindcss4';\n`;\n","import { existsSync } from 'node:fs';\nimport { resolve } from 'node:path';\nimport type { PackageManager } from '../types';\n\nconst LOCKFILE_MAP: Record<string, PackageManager> = {\n 'pnpm-lock.yaml': 'pnpm',\n 'yarn.lock': 'yarn',\n 'package-lock.json': 'npm',\n 'bun.lockb': 'bun',\n 'bun.lock': 'bun',\n};\n\nexport function detectPackageManager(cwd: string = process.cwd()): PackageManager {\n for (const [lockfile, pm] of Object.entries(LOCKFILE_MAP)) {\n if (existsSync(resolve(cwd, lockfile))) {\n return pm;\n }\n }\n\n const userAgent = process.env.npm_config_user_agent ?? '';\n if (userAgent.startsWith('pnpm')) {\n return 'pnpm';\n }\n if (userAgent.startsWith('yarn')) {\n return 'yarn';\n }\n if (userAgent.startsWith('bun')) {\n return 'bun';\n }\n\n return 'npm';\n}\n\nexport function getInstallCommand(pm: PackageManager, packages: string[]): string {\n const pkgs = packages.join(' ');\n switch (pm) {\n case 'pnpm':\n return `pnpm add ${pkgs}`;\n case 'yarn':\n return `yarn add ${pkgs}`;\n case 'bun':\n return `bun add ${pkgs}`;\n case 'npm':\n return `npm install ${pkgs}`;\n }\n}\n","import { existsSync, readFileSync, writeFileSync } from 'node:fs';\nimport { resolve } from 'node:path';\n\nexport function readJson<T>(filePath: string): T | null {\n try {\n const content = readFileSync(filePath, 'utf-8');\n return JSON.parse(content) as T;\n } catch {\n return null;\n }\n}\n\nexport function writeJson(filePath: string, data: unknown): void {\n writeFileSync(filePath, `${JSON.stringify(data, null, 2)}\\n`);\n}\n\nexport function fileExists(filePath: string): boolean {\n return existsSync(filePath);\n}\n\nexport function readFile(filePath: string): string | null {\n try {\n return readFileSync(filePath, 'utf-8');\n } catch {\n return null;\n }\n}\n\nexport function writeFile(filePath: string, content: string): void {\n writeFileSync(filePath, content);\n}\n\nexport function resolveFromCwd(...segments: string[]): string {\n return resolve(process.cwd(), ...segments);\n}\n","import type { PackageInfo } from '../types';\n\nexport const PACKAGES: PackageInfo[] = [\n {\n name: '@exem-ui/core',\n description: 'CSS variables, design tokens, utilities, types',\n required: true,\n },\n {\n name: '@exem-ui/react',\n description: 'React UI components (20+)',\n },\n {\n name: '@exem-ui/tailwindcss3',\n description: 'Tailwind CSS v3 plugin',\n },\n {\n name: '@exem-ui/tailwindcss4',\n description: 'Tailwind CSS v4 theme',\n },\n];\n","import { init } from './commands/init';\n\nconst VERSION = '0.1.0';\n\nconst args = process.argv.slice(2);\nconst command = args[0];\n\nfunction showHelp() {\n process.stdout.write(`\n @exem-ui/cli v${VERSION}\n\n Usage: npx @exem-ui/cli [command]\n\n Commands:\n init Set up Exem UI in your project (default)\n\n Options:\n --help, -h Show this help message\n --version, -v Show version number\n\n`);\n}\n\nasync function main() {\n if (command === '--help' || command === '-h') {\n showHelp();\n return;\n }\n\n if (command === '--version' || command === '-v') {\n process.stdout.write(`${VERSION}\\n`);\n return;\n }\n\n if (!command || command === 'init') {\n await init();\n } else {\n process.stderr.write(`Unknown command: ${command}\\n`);\n showHelp();\n process.exit(1);\n }\n}\n\nmain().catch(() => {\n process.exit(1);\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAEA,QAAM,MAAM;AACZ,QAAM,MAAM,GAAG,GAAG;AAClB,QAAM,OAAO;AAEb,QAAM,SAAS;AAAA,MACb,GAAGA,IAAGC,IAAG;AACP,YAAI,CAACA,GAAG,QAAO,GAAG,GAAG,GAAGD,KAAI,CAAC;AAC7B,eAAO,GAAG,GAAG,GAAGC,KAAI,CAAC,IAAID,KAAI,CAAC;AAAA,MAChC;AAAA,MACA,KAAKA,IAAGC,IAAG;AACT,YAAI,MAAM;AAEV,YAAID,KAAI,EAAG,QAAO,GAAG,GAAG,GAAG,CAACA,EAAC;AAAA,iBACpBA,KAAI,EAAG,QAAO,GAAG,GAAG,GAAGA,EAAC;AAEjC,YAAIC,KAAI,EAAG,QAAO,GAAG,GAAG,GAAG,CAACA,EAAC;AAAA,iBACpBA,KAAI,EAAG,QAAO,GAAG,GAAG,GAAGA,EAAC;AAEjC,eAAO;AAAA,MACT;AAAA,MACA,IAAI,CAAC,QAAQ,MAAM,GAAG,GAAG,GAAG,KAAK;AAAA,MACjC,MAAM,CAAC,QAAQ,MAAM,GAAG,GAAG,GAAG,KAAK;AAAA,MACnC,SAAS,CAAC,QAAQ,MAAM,GAAG,GAAG,GAAG,KAAK;AAAA,MACtC,UAAU,CAAC,QAAQ,MAAM,GAAG,GAAG,GAAG,KAAK;AAAA,MACvC,UA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kC,OAAO;AACrD,MAAI,CAAC,KAAK;AACR;AAAA,EACF;AAEA,QAAM,gBAAgB,QAAQ,YAAY,SAAS,UAAU;AAC7D,QAAM,OAAO,QAAQ,SAAS,IAAI,CAACG,OAAM,GAAGA,EAAC,GAAG,aAAa,EAAE,EAAE,KAAK,GAAG;AACzE,QAAM,MAAM,kBAAkB,QAAQ,gBAAgB,CAAC,IAAI,CAAC;AAE5D,QAAM,UAAW,IAAI,WAAW,CAAC;AACjC,UAAQ,gBAAgB,IAAI;AAC5B,MAAI,UAAU;AAEd,YAAU,SAAS,GAAG;AACtB,EAAEF,GAAI,QAAQ,SAAS,mBAAAD,QAAG,KAAK,gBAAgB,CAAC,0BAA0B;AAC5E;;;A0B7RA,IAAM,UAAU;AAEhB,IAAM,OAAO,QAAQ,KAAK,MAAM,CAAC;AACjC,IAAM,UAAU,KAAK,CAAC;AAEtB,SAAS,WAAW;AAClB,UAAQ,OAAO,MAAM;AAAA,kBACL,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAWxB;AACD;AAEA,eAAe,OAAO;AACpB,MAAI,YAAY,YAAY,YAAY,MAAM;AAC5C,aAAS;AACT;AAAA,EACF;AAEA,MAAI,YAAY,eAAe,YAAY,MAAM;AAC/C,YAAQ,OAAO,MAAM,GAAG,OAAO;AAAA,CAAI;AACnC;AAAA,EACF;AAEA,MAAI,CAAC,WAAW,YAAY,QAAQ;AAClC,UAAM,KAAK;AAAA,EACb,OAAO;AACL,YAAQ,OAAO,MAAM,oBAAoB,OAAO;AAAA,CAAI;AACpD,aAAS;AACT,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF;AAEA,KAAK,EAAE,MAAM,MAAM;AACjB,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":["x","y","p","f","ansiRegex","onlyFirst","pattern","regex","stripAnsi","string","eaw","module","character","x","y","codePoint","code","stringToArray","characters","len","i","text","start","end","result","eawLen","chars","char","charLen","emojiRegex","stringWidth","options","ambiguousCharacterWidth","width","eastAsianWidth","ANSI_BACKGROUND_OFFSET","wrapAnsi16","offset","wrapAnsi256","wrapAnsi16m","red","green","blue","styles","foregroundColorNames","backgroundColorNames","assembleStyles","codes","groupName","group","styleName","style","hex","matches","colorString","integer","remainder","value","ansiStyles","ESCAPES","END_CODE","ANSI_ESCAPE_BELL","ANSI_CSI","ANSI_OSC","ANSI_SGR_TERMINATOR","ANSI_ESCAPE_LINK","wrapAnsiCode","wrapAnsiHyperlink","uri","wordLengths","wrapWord","rows","word","columns","isInsideEscape","isInsideLinkEscape","visible","index","characterLength","stringVisibleTrimSpacesRight","words","last","exec","returnValue","escapeCode","escapeUrl","lengths","rowLength","remainingColumns","breaksStartingThisLine","row","pre","groups","wrapAnsi","line","actions","settings","isActionKey","key","action","settings","value","diffLines","a","b","aLines","bLines","diff","i","isWindows","CANCEL_SYMBOL","isCancel","setRawMode","input","block","stdin","output","stdout","overwrite","hideCursor","rl","readline","clear","data","name","sequence","str","cursor","dx","dy","v","t","e","s","Prompt","options","trackValue","__publicField","render","signal","opts","event","params","cb","cbs","cleanup","subscriber","resolve","reject","sink","WriteStream","chunk","encoding","done","char","problem","lines","wrap","frame","diffLine","erase","newLines","ConfirmPrompt","confirm","o","a","i","s","t","l","Prompt","opts","__publicField","value","char","key","allSelected","v","selected","u","SelectPrompt","Prompt","opts","__publicField","value","key","isUnicodeSupported","process","unicode","s","c","fallback","S_STEP_ACTIVE","S_STEP_CANCEL","S_STEP_ERROR","S_STEP_SUBMIT","S_BAR_START","S_BAR","S_BAR_END","S_RADIO_ACTIVE","S_RADIO_INACTIVE","S_CHECKBOX_ACTIVE","S_CHECKBOX_SELECTED","S_CHECKBOX_INACTIVE","S_PASSWORD_MASK","S_BAR_H","S_CORNER_TOP_RIGHT","S_CONNECT_LEFT","S_CORNER_BOTTOM_RIGHT","S_INFO","S_SUCCESS","S_WARN","S_ERROR","symbol","state","color","limitOptions","params","cursor","options","style","paramMaxItems","outputMaxItems","maxItems","slidingWindowLocation","shouldRenderTopEllipsis","shouldRenderBottomEllipsis","option","i","arr","isTopLimit","isBottomLimit","confirm","opts","active","inactive","ConfirmPrompt","title","color","S_BAR","symbol","value","S_RADIO_ACTIVE","S_RADIO_INACTIVE","S_BAR_END","select","opt","option","state","label","SelectPrompt","limitOptions","item","multiselect","opts","opt","option","state","label","color","S_CHECKBOX_ACTIVE","S_CHECKBOX_SELECTED","S_CHECKBOX_INACTIVE","MultiSelectPrompt","selected","title","S_BAR","symbol","styleOption","active","value","footer","ln","i","S_BAR_END","limitOptions","cancel","message","color","S_BAR_END","intro","title","S_BAR_START","outro","S_BAR","log","symbol","parts","firstLine","lines","ln","S_INFO","S_SUCCESS","S_STEP_SUBMIT","S_WARN","S_ERROR","spinner","frames","unicode","delay","isCI","unblock","loop","isSpinnerActive","_message","_prevMessage","handleExit","code","msg","stop","errorEventHandler","signalEventHandler","registerHooks","clearHooks","clearPrevMessage","prevLines","cursor","erase","parseMessage","start","block","frameIndex","dotsTimer","frame","loadingDots","step","S_STEP_CANCEL","S_STEP_ERROR","import_picocolors","existsSync","resolve","pc","v","L","p"]}
1
+ {"version":3,"sources":["../../../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js","../../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js","../src/commands/init.ts","../../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/node_modules/.pnpm/ansi-regex@6.1.0/node_modules/ansi-regex/index.js","../../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/node_modules/.pnpm/strip-ansi@7.1.0/node_modules/strip-ansi/index.js","../../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/node_modules/.pnpm/eastasianwidth@0.2.0/node_modules/eastasianwidth/eastasianwidth.js","../../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/node_modules/.pnpm/emoji-regex@9.2.2/node_modules/emoji-regex/index.js","../../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/node_modules/.pnpm/string-width@5.1.2/node_modules/string-width/index.js","../../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/node_modules/.pnpm/ansi-styles@6.2.1/node_modules/ansi-styles/index.js","../../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/node_modules/.pnpm/wrap-ansi@8.1.0/node_modules/wrap-ansi/index.js","../../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/@clack/core/src/utils/settings.ts","../../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/@clack/core/src/utils/string.ts","../../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/@clack/core/src/utils/index.ts","../../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/@clack/core/src/prompts/prompt.ts","../../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/@clack/core/src/prompts/confirm.ts","../../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/@clack/core/src/prompts/group-multiselect.ts","../../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/@clack/core/src/prompts/multi-select.ts","../../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/@clack/core/src/prompts/password.ts","../../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/@clack/core/src/prompts/select.ts","../../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/@clack/core/src/prompts/select-key.ts","../../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/@clack/core/src/prompts/text.ts","../../../node_modules/.pnpm/@clack+prompts@0.9.1/node_modules/node_modules/.pnpm/is-unicode-supported@1.3.0/node_modules/is-unicode-supported/index.js","../../../node_modules/.pnpm/@clack+prompts@0.9.1/node_modules/@clack/prompts/src/index.ts","../src/templates/tailwind-v3.ts","../src/templates/tailwind-v4.ts","../src/utils/detect-pm.ts","../src/utils/file-ops.ts","../src/utils/packages.ts","../src/index.ts"],"sourcesContent":["'use strict';\n\nconst ESC = '\\x1B';\nconst CSI = `${ESC}[`;\nconst beep = '\\u0007';\n\nconst cursor = {\n to(x, y) {\n if (!y) return `${CSI}${x + 1}G`;\n return `${CSI}${y + 1};${x + 1}H`;\n },\n move(x, y) {\n let ret = '';\n\n if (x < 0) ret += `${CSI}${-x}D`;\n else if (x > 0) ret += `${CSI}${x}C`;\n\n if (y < 0) ret += `${CSI}${-y}A`;\n else if (y > 0) ret += `${CSI}${y}B`;\n\n return ret;\n },\n up: (count = 1) => `${CSI}${count}A`,\n down: (count = 1) => `${CSI}${count}B`,\n forward: (count = 1) => `${CSI}${count}C`,\n backward: (count = 1) => `${CSI}${count}D`,\n nextLine: (count = 1) => `${CSI}E`.repeat(count),\n prevLine: (count = 1) => `${CSI}F`.repeat(count),\n left: `${CSI}G`,\n hide: `${CSI}?25l`,\n show: `${CSI}?25h`,\n save: `${ESC}7`,\n restore: `${ESC}8`\n}\n\nconst scroll = {\n up: (count = 1) => `${CSI}S`.repeat(count),\n down: (count = 1) => `${CSI}T`.repeat(count)\n}\n\nconst erase = {\n screen: `${CSI}2J`,\n up: (count = 1) => `${CSI}1J`.repeat(count),\n down: (count = 1) => `${CSI}J`.repeat(count),\n line: `${CSI}2K`,\n lineEnd: `${CSI}K`,\n lineStart: `${CSI}1K`,\n lines(count) {\n let clear = '';\n for (let i = 0; i < count; i++)\n clear += this.line + (i < count - 1 ? cursor.up() : '');\n if (count)\n clear += cursor.left;\n return clear;\n }\n}\n\nmodule.exports = { cursor, scroll, erase, beep };\n","let p = process || {}, argv = p.argv || [], env = p.env || {}\nlet isColorSupported =\n\t!(!!env.NO_COLOR || argv.includes(\"--no-color\")) &&\n\t(!!env.FORCE_COLOR || argv.includes(\"--color\") || p.platform === \"win32\" || ((p.stdout || {}).isTTY && env.TERM !== \"dumb\") || !!env.CI)\n\nlet formatter = (open, close, replace = open) =>\n\tinput => {\n\t\tlet string = \"\" + input, index = string.indexOf(close, open.length)\n\t\treturn ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close\n\t}\n\nlet replaceClose = (string, close, replace, index) => {\n\tlet result = \"\", cursor = 0\n\tdo {\n\t\tresult += string.substring(cursor, index) + replace\n\t\tcursor = index + close.length\n\t\tindex = string.indexOf(close, cursor)\n\t} while (~index)\n\treturn result + string.substring(cursor)\n}\n\nlet createColors = (enabled = isColorSupported) => {\n\tlet f = enabled ? formatter : () => String\n\treturn {\n\t\tisColorSupported: enabled,\n\t\treset: f(\"\\x1b[0m\", \"\\x1b[0m\"),\n\t\tbold: f(\"\\x1b[1m\", \"\\x1b[22m\", \"\\x1b[22m\\x1b[1m\"),\n\t\tdim: f(\"\\x1b[2m\", \"\\x1b[22m\", \"\\x1b[22m\\x1b[2m\"),\n\t\titalic: f(\"\\x1b[3m\", \"\\x1b[23m\"),\n\t\tunderline: f(\"\\x1b[4m\", \"\\x1b[24m\"),\n\t\tinverse: f(\"\\x1b[7m\", \"\\x1b[27m\"),\n\t\thidden: f(\"\\x1b[8m\", \"\\x1b[28m\"),\n\t\tstrikethrough: f(\"\\x1b[9m\", \"\\x1b[29m\"),\n\n\t\tblack: f(\"\\x1b[30m\", \"\\x1b[39m\"),\n\t\tred: f(\"\\x1b[31m\", \"\\x1b[39m\"),\n\t\tgreen: f(\"\\x1b[32m\", \"\\x1b[39m\"),\n\t\tyellow: f(\"\\x1b[33m\", \"\\x1b[39m\"),\n\t\tblue: f(\"\\x1b[34m\", \"\\x1b[39m\"),\n\t\tmagenta: f(\"\\x1b[35m\", \"\\x1b[39m\"),\n\t\tcyan: f(\"\\x1b[36m\", \"\\x1b[39m\"),\n\t\twhite: f(\"\\x1b[37m\", \"\\x1b[39m\"),\n\t\tgray: f(\"\\x1b[90m\", \"\\x1b[39m\"),\n\n\t\tbgBlack: f(\"\\x1b[40m\", \"\\x1b[49m\"),\n\t\tbgRed: f(\"\\x1b[41m\", \"\\x1b[49m\"),\n\t\tbgGreen: f(\"\\x1b[42m\", \"\\x1b[49m\"),\n\t\tbgYellow: f(\"\\x1b[43m\", \"\\x1b[49m\"),\n\t\tbgBlue: f(\"\\x1b[44m\", \"\\x1b[49m\"),\n\t\tbgMagenta: f(\"\\x1b[45m\", \"\\x1b[49m\"),\n\t\tbgCyan: f(\"\\x1b[46m\", \"\\x1b[49m\"),\n\t\tbgWhite: f(\"\\x1b[47m\", \"\\x1b[49m\"),\n\n\t\tblackBright: f(\"\\x1b[90m\", \"\\x1b[39m\"),\n\t\tredBright: f(\"\\x1b[91m\", \"\\x1b[39m\"),\n\t\tgreenBright: f(\"\\x1b[92m\", \"\\x1b[39m\"),\n\t\tyellowBright: f(\"\\x1b[93m\", \"\\x1b[39m\"),\n\t\tblueBright: f(\"\\x1b[94m\", \"\\x1b[39m\"),\n\t\tmagentaBright: f(\"\\x1b[95m\", \"\\x1b[39m\"),\n\t\tcyanBright: f(\"\\x1b[96m\", \"\\x1b[39m\"),\n\t\twhiteBright: f(\"\\x1b[97m\", \"\\x1b[39m\"),\n\n\t\tbgBlackBright: f(\"\\x1b[100m\", \"\\x1b[49m\"),\n\t\tbgRedBright: f(\"\\x1b[101m\", \"\\x1b[49m\"),\n\t\tbgGreenBright: f(\"\\x1b[102m\", \"\\x1b[49m\"),\n\t\tbgYellowBright: f(\"\\x1b[103m\", \"\\x1b[49m\"),\n\t\tbgBlueBright: f(\"\\x1b[104m\", \"\\x1b[49m\"),\n\t\tbgMagentaBright: f(\"\\x1b[105m\", \"\\x1b[49m\"),\n\t\tbgCyanBright: f(\"\\x1b[106m\", \"\\x1b[49m\"),\n\t\tbgWhiteBright: f(\"\\x1b[107m\", \"\\x1b[49m\"),\n\t}\n}\n\nmodule.exports = createColors()\nmodule.exports.createColors = createColors\n","import { execSync } from 'node:child_process';\nimport * as p from '@clack/prompts';\nimport pc from 'picocolors';\nimport { TAILWIND_V3_CONFIG, TAILWIND_V3_MANUAL_MSG } from '../templates/tailwind-v3';\nimport { TAILWIND_V4_IMPORT, TAILWIND_V4_MANUAL_MSG } from '../templates/tailwind-v4';\nimport type {\n Framework,\n InitOptions,\n PackageManager,\n ReleaseChannel,\n TailwindVersion,\n} from '../types';\nimport { detectPackageManager, getInstallCommand, getUninstallCommand } from '../utils/detect-pm';\nimport {\n fileExists,\n pinDistTag,\n readFile,\n readJson,\n resolveFromCwd,\n writeFile,\n writeJson,\n} from '../utils/file-ops';\nimport { PACKAGES } from '../utils/packages';\n\ninterface ExemConfig {\n packages: string[];\n tailwind: TailwindVersion;\n channel: ReleaseChannel;\n}\n\nexport async function init() {\n p.intro(pc.bgCyan(pc.black(' Exem UI Setup ')));\n\n const configPath = resolveFromCwd('exem-ui.config.json');\n const prevConfig = readJson<ExemConfig>(configPath);\n\n if (prevConfig) {\n p.log.info(\n `Existing setup detected (${pc.cyan(prevConfig.channel)} channel, ${prevConfig.packages.length} packages).`,\n );\n p.log.info('Previous packages will be removed before re-installing.');\n }\n\n const options = await promptOptions(prevConfig);\n\n await installPackages(options, prevConfig !== null);\n\n writeJson(configPath, {\n packages: options.packages,\n tailwind: options.tailwind,\n channel: options.channel,\n });\n p.log.success(`Created ${pc.cyan('exem-ui.config.json')}`);\n\n configureTailwind(options.tailwind);\n configureBaseStyles(options.tailwind);\n\n const addScript = await p.confirm({\n message: 'Add an update:exem-ui script to package.json?',\n initialValue: true,\n });\n\n if (!p.isCancel(addScript) && addScript) {\n addUpdateScript(options);\n }\n\n p.outro(pc.green('Exem UI setup complete!'));\n}\n\n// --- Prompts ---\n\nfunction cancelAndExit<T>(value: T): asserts value is Exclude<T, symbol> {\n if (p.isCancel(value)) {\n p.cancel('Setup cancelled.');\n process.exit(0);\n }\n}\n\nasync function promptOptions(prevConfig: ExemConfig | null): Promise<InitOptions> {\n const detectedPm = detectPackageManager();\n\n const pm = (await p.select({\n message: 'Which package manager do you use?',\n options: [\n { value: detectedPm, label: `${detectedPm} (detected)` },\n ...(['pnpm', 'npm', 'yarn', 'bun'] as const)\n .filter((v) => v !== detectedPm)\n .map((v) => ({ value: v, label: v })),\n ],\n })) as PackageManager;\n cancelAndExit(pm);\n\n const prevHasReact = prevConfig?.packages.includes('@exem-ui/react');\n const framework = (await p.select({\n message: 'Which framework are you using?',\n options: [\n { value: 'react', label: 'React', hint: 'React 19+ components available' },\n { value: 'none', label: 'Other / None', hint: 'Core tokens + Tailwind preset only' },\n ],\n initialValue: prevHasReact ? 'react' : undefined,\n })) as Framework;\n cancelAndExit(framework);\n\n const tailwind = (await p.select({\n message: 'Which Tailwind CSS version are you using?',\n options: [\n { value: 'v4', label: 'Tailwind CSS v4', hint: 'CSS-first configuration' },\n { value: 'v3', label: 'Tailwind CSS v3', hint: 'Plugin-based configuration' },\n { value: 'none', label: 'Not using Tailwind CSS' },\n ],\n initialValue: prevConfig?.tailwind,\n })) as TailwindVersion;\n cancelAndExit(tailwind);\n\n const selectedPackages = await promptPackages(prevConfig, framework, tailwind);\n\n const channel = (await p.select({\n message: 'Which release channel?',\n options: [\n { value: 'latest', label: 'Stable (latest)', hint: 'Recommended' },\n { value: 'next', label: 'Experimental (next)', hint: 'Pre-release versions' },\n ],\n initialValue: prevConfig?.channel,\n })) as ReleaseChannel;\n cancelAndExit(channel);\n\n return { packageManager: pm, framework, packages: selectedPackages, tailwind, channel };\n}\n\nasync function promptPackages(\n prevConfig: ExemConfig | null,\n framework: Framework,\n tailwind: TailwindVersion,\n): Promise<string[]> {\n const defaults = prevConfig ? prevConfig.packages : buildDefaultPackages(framework, tailwind);\n\n const packageOptions = filterPackageOptions(tailwind);\n\n const selected = (await p.multiselect({\n message: 'Which packages do you want to install?',\n options: packageOptions.map((pkg) => ({\n value: pkg.name,\n label: pkg.name,\n hint: pkg.description,\n })),\n initialValues: defaults.filter((name) => packageOptions.some((opt) => opt.name === name)),\n required: true,\n })) as string[];\n cancelAndExit(selected);\n\n if (!selected.includes('@exem-ui/core')) {\n selected.unshift('@exem-ui/core');\n p.log.info(`${pc.cyan('@exem-ui/core')} is required and has been added.`);\n }\n\n return selected;\n}\n\n// --- Install / Uninstall ---\n\nasync function installPackages(options: InitOptions, isReinit: boolean) {\n const s = p.spinner();\n\n if (isReinit) {\n const pkgsToRemove = findInstalledExemPackages();\n if (pkgsToRemove.length > 0) {\n s.start('Removing existing packages...');\n try {\n const removeCmd = getUninstallCommand(options.packageManager, pkgsToRemove);\n execSync(removeCmd, { stdio: 'pipe', cwd: process.cwd() });\n s.stop('Existing packages removed.');\n } catch {\n s.stop('Failed to remove packages. Retrying with --force...');\n try {\n const forceCmd = `${getUninstallCommand(options.packageManager, pkgsToRemove)} --force`;\n execSync(forceCmd, { stdio: 'pipe', cwd: process.cwd() });\n } catch {\n p.log.warning('Could not remove existing packages. Install may override them.');\n }\n }\n }\n }\n\n const versionSuffix = options.channel === 'next' ? '@next' : '';\n const pkgs = options.packages.map((pkg) => `${pkg}${versionSuffix}`);\n const installCmd = getInstallCommand(options.packageManager, pkgs);\n\n s.start('Installing packages...');\n\n try {\n execSync(installCmd, { stdio: 'pipe', cwd: process.cwd() });\n\n if (options.channel === 'next') {\n pinDistTag(options.packages, 'next');\n }\n\n s.stop('Packages installed.');\n } catch {\n s.stop('Installation failed.');\n p.log.error(`Failed to run: ${pc.dim(installCmd)}`);\n p.log.error('Please install the packages manually.');\n process.exit(1);\n }\n}\n\n// --- Configuration ---\n\nfunction configureTailwind(tailwind: TailwindVersion) {\n if (tailwind === 'v3') {\n configureTailwindV3();\n } else if (tailwind === 'v4') {\n configureTailwindV4();\n }\n}\n\nfunction configureTailwindV3() {\n const configPath = resolveFromCwd('tailwind.config.ts');\n if (!fileExists(configPath)) {\n writeFile(configPath, TAILWIND_V3_CONFIG);\n p.log.success(`Created ${pc.cyan('tailwind.config.ts')} with Exem UI preset.`);\n } else {\n p.log.warning(`${pc.cyan('tailwind.config.ts')} already exists.`);\n p.log.message(TAILWIND_V3_MANUAL_MSG);\n }\n}\n\nfunction configureTailwindV4() {\n const targetCss = findCssEntryFile();\n\n if (targetCss) {\n const content = readFile(targetCss);\n if (content?.includes('@exem-ui/tailwindcss4')) {\n p.log.info('Exem UI Tailwind v4 import already present. Skipping.');\n return;\n }\n writeFile(targetCss, TAILWIND_V4_IMPORT + (content ?? ''));\n p.log.success(`Added Exem UI import to ${pc.cyan(targetCss)}.`);\n } else {\n p.log.warning('Could not find a CSS entry file.');\n p.log.message(TAILWIND_V4_MANUAL_MSG);\n }\n}\n\nconst BASE_STYLES = `\n/* Exem UI base styles */\nbody {\n background-color: var(--color-background-primary);\n color: var(--color-text-primary);\n}\n`;\n\nfunction configureBaseStyles(tailwind: TailwindVersion) {\n if (tailwind === 'none') {\n return;\n }\n\n const targetCss = findCssEntryFile();\n if (!targetCss) {\n return;\n }\n\n const content = readFile(targetCss);\n if (content?.includes('--color-background-primary')) {\n return;\n }\n\n writeFile(targetCss, (content ?? '') + BASE_STYLES);\n p.log.success(`Added base body styles to ${pc.cyan(targetCss)}.`);\n}\n\nfunction addUpdateScript(options: InitOptions) {\n const pkgPath = resolveFromCwd('package.json');\n const pkg = readJson<Record<string, unknown>>(pkgPath);\n if (!pkg) {\n return;\n }\n\n const versionSuffix = options.channel === 'next' ? '@next' : '@latest';\n const pkgs = options.packages.map((p) => `${p}${versionSuffix}`).join(' ');\n const cmd = getInstallCommand(options.packageManager, [pkgs]);\n\n const scripts = (pkg.scripts ?? {}) as Record<string, string>;\n scripts['update:exem-ui'] = cmd;\n pkg.scripts = scripts;\n\n writeJson(pkgPath, pkg);\n p.log.success(`Added ${pc.cyan('update:exem-ui')} script to package.json.`);\n}\n\n// --- Helpers ---\n\nconst CSS_ENTRY_FILES = ['src/index.css', 'src/app.css', 'src/global.css', 'app/globals.css'];\n\nfunction findCssEntryFile(): string | null {\n for (const file of CSS_ENTRY_FILES) {\n const resolved = resolveFromCwd(file);\n if (fileExists(resolved)) {\n return resolved;\n }\n }\n return null;\n}\n\nfunction buildDefaultPackages(framework: Framework, tailwind: TailwindVersion): string[] {\n const pkgs = ['@exem-ui/core'];\n if (framework === 'react') {\n pkgs.push('@exem-ui/react');\n }\n if (tailwind === 'v3') {\n pkgs.push('@exem-ui/tailwindcss3');\n } else if (tailwind === 'v4') {\n pkgs.push('@exem-ui/tailwindcss4');\n }\n return pkgs;\n}\n\nfunction filterPackageOptions(tailwind: TailwindVersion) {\n return PACKAGES.filter((pkg) => {\n if (tailwind === 'v3' && pkg.name === '@exem-ui/tailwindcss4') {\n return false;\n }\n if (tailwind === 'v4' && pkg.name === '@exem-ui/tailwindcss3') {\n return false;\n }\n if (tailwind === 'none') {\n if (pkg.name === '@exem-ui/tailwindcss3' || pkg.name === '@exem-ui/tailwindcss4') {\n return false;\n }\n }\n return true;\n });\n}\n\nfunction findInstalledExemPackages(): string[] {\n const pkgPath = resolveFromCwd('package.json');\n const pkg = readJson<Record<string, unknown>>(pkgPath);\n if (!pkg) {\n return [];\n }\n\n const deps = (pkg.dependencies ?? {}) as Record<string, string>;\n const devDeps = (pkg.devDependencies ?? {}) as Record<string, string>;\n const allDeps = { ...deps, ...devDeps };\n return Object.keys(allDeps).filter((name) => name.startsWith('@exem-ui/'));\n}\n","export default function ansiRegex({onlyFirst = false} = {}) {\n\t// Valid string terminator sequences are BEL, ESC\\, and 0x9c\n\tconst ST = '(?:\\\\u0007|\\\\u001B\\\\u005C|\\\\u009C)';\n\tconst pattern = [\n\t\t`[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]+)*|[a-zA-Z\\\\d]+(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]*)*)?${ST})`,\n\t\t'(?:(?:\\\\d{1,4}(?:;\\\\d{0,4})*)?[\\\\dA-PR-TZcf-nq-uy=><~]))',\n\t].join('|');\n\n\treturn new RegExp(pattern, onlyFirst ? undefined : 'g');\n}\n","import ansiRegex from 'ansi-regex';\n\nconst regex = ansiRegex();\n\nexport default function stripAnsi(string) {\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError(`Expected a \\`string\\`, got \\`${typeof string}\\``);\n\t}\n\n\t// Even though the regex is global, we don't need to reset the `.lastIndex`\n\t// because unlike `.exec()` and `.test()`, `.replace()` does it automatically\n\t// and doing it manually has a performance penalty.\n\treturn string.replace(regex, '');\n}\n","var eaw = {};\n\nif ('undefined' == typeof module) {\n window.eastasianwidth = eaw;\n} else {\n module.exports = eaw;\n}\n\neaw.eastAsianWidth = function(character) {\n var x = character.charCodeAt(0);\n var y = (character.length == 2) ? character.charCodeAt(1) : 0;\n var codePoint = x;\n if ((0xD800 <= x && x <= 0xDBFF) && (0xDC00 <= y && y <= 0xDFFF)) {\n x &= 0x3FF;\n y &= 0x3FF;\n codePoint = (x << 10) | y;\n codePoint += 0x10000;\n }\n\n if ((0x3000 == codePoint) ||\n (0xFF01 <= codePoint && codePoint <= 0xFF60) ||\n (0xFFE0 <= codePoint && codePoint <= 0xFFE6)) {\n return 'F';\n }\n if ((0x20A9 == codePoint) ||\n (0xFF61 <= codePoint && codePoint <= 0xFFBE) ||\n (0xFFC2 <= codePoint && codePoint <= 0xFFC7) ||\n (0xFFCA <= codePoint && codePoint <= 0xFFCF) ||\n (0xFFD2 <= codePoint && codePoint <= 0xFFD7) ||\n (0xFFDA <= codePoint && codePoint <= 0xFFDC) ||\n (0xFFE8 <= codePoint && codePoint <= 0xFFEE)) {\n return 'H';\n }\n if ((0x1100 <= codePoint && codePoint <= 0x115F) ||\n (0x11A3 <= codePoint && codePoint <= 0x11A7) ||\n (0x11FA <= codePoint && codePoint <= 0x11FF) ||\n (0x2329 <= codePoint && codePoint <= 0x232A) ||\n (0x2E80 <= codePoint && codePoint <= 0x2E99) ||\n (0x2E9B <= codePoint && codePoint <= 0x2EF3) ||\n (0x2F00 <= codePoint && codePoint <= 0x2FD5) ||\n (0x2FF0 <= codePoint && codePoint <= 0x2FFB) ||\n (0x3001 <= codePoint && codePoint <= 0x303E) ||\n (0x3041 <= codePoint && codePoint <= 0x3096) ||\n (0x3099 <= codePoint && codePoint <= 0x30FF) ||\n (0x3105 <= codePoint && codePoint <= 0x312D) ||\n (0x3131 <= codePoint && codePoint <= 0x318E) ||\n (0x3190 <= codePoint && codePoint <= 0x31BA) ||\n (0x31C0 <= codePoint && codePoint <= 0x31E3) ||\n (0x31F0 <= codePoint && codePoint <= 0x321E) ||\n (0x3220 <= codePoint && codePoint <= 0x3247) ||\n (0x3250 <= codePoint && codePoint <= 0x32FE) ||\n (0x3300 <= codePoint && codePoint <= 0x4DBF) ||\n (0x4E00 <= codePoint && codePoint <= 0xA48C) ||\n (0xA490 <= codePoint && codePoint <= 0xA4C6) ||\n (0xA960 <= codePoint && codePoint <= 0xA97C) ||\n (0xAC00 <= codePoint && codePoint <= 0xD7A3) ||\n (0xD7B0 <= codePoint && codePoint <= 0xD7C6) ||\n (0xD7CB <= codePoint && codePoint <= 0xD7FB) ||\n (0xF900 <= codePoint && codePoint <= 0xFAFF) ||\n (0xFE10 <= codePoint && codePoint <= 0xFE19) ||\n (0xFE30 <= codePoint && codePoint <= 0xFE52) ||\n (0xFE54 <= codePoint && codePoint <= 0xFE66) ||\n (0xFE68 <= codePoint && codePoint <= 0xFE6B) ||\n (0x1B000 <= codePoint && codePoint <= 0x1B001) ||\n (0x1F200 <= codePoint && codePoint <= 0x1F202) ||\n (0x1F210 <= codePoint && codePoint <= 0x1F23A) ||\n (0x1F240 <= codePoint && codePoint <= 0x1F248) ||\n (0x1F250 <= codePoint && codePoint <= 0x1F251) ||\n (0x20000 <= codePoint && codePoint <= 0x2F73F) ||\n (0x2B740 <= codePoint && codePoint <= 0x2FFFD) ||\n (0x30000 <= codePoint && codePoint <= 0x3FFFD)) {\n return 'W';\n }\n if ((0x0020 <= codePoint && codePoint <= 0x007E) ||\n (0x00A2 <= codePoint && codePoint <= 0x00A3) ||\n (0x00A5 <= codePoint && codePoint <= 0x00A6) ||\n (0x00AC == codePoint) ||\n (0x00AF == codePoint) ||\n (0x27E6 <= codePoint && codePoint <= 0x27ED) ||\n (0x2985 <= codePoint && codePoint <= 0x2986)) {\n return 'Na';\n }\n if ((0x00A1 == codePoint) ||\n (0x00A4 == codePoint) ||\n (0x00A7 <= codePoint && codePoint <= 0x00A8) ||\n (0x00AA == codePoint) ||\n (0x00AD <= codePoint && codePoint <= 0x00AE) ||\n (0x00B0 <= codePoint && codePoint <= 0x00B4) ||\n (0x00B6 <= codePoint && codePoint <= 0x00BA) ||\n (0x00BC <= codePoint && codePoint <= 0x00BF) ||\n (0x00C6 == codePoint) ||\n (0x00D0 == codePoint) ||\n (0x00D7 <= codePoint && codePoint <= 0x00D8) ||\n (0x00DE <= codePoint && codePoint <= 0x00E1) ||\n (0x00E6 == codePoint) ||\n (0x00E8 <= codePoint && codePoint <= 0x00EA) ||\n (0x00EC <= codePoint && codePoint <= 0x00ED) ||\n (0x00F0 == codePoint) ||\n (0x00F2 <= codePoint && codePoint <= 0x00F3) ||\n (0x00F7 <= codePoint && codePoint <= 0x00FA) ||\n (0x00FC == codePoint) ||\n (0x00FE == codePoint) ||\n (0x0101 == codePoint) ||\n (0x0111 == codePoint) ||\n (0x0113 == codePoint) ||\n (0x011B == codePoint) ||\n (0x0126 <= codePoint && codePoint <= 0x0127) ||\n (0x012B == codePoint) ||\n (0x0131 <= codePoint && codePoint <= 0x0133) ||\n (0x0138 == codePoint) ||\n (0x013F <= codePoint && codePoint <= 0x0142) ||\n (0x0144 == codePoint) ||\n (0x0148 <= codePoint && codePoint <= 0x014B) ||\n (0x014D == codePoint) ||\n (0x0152 <= codePoint && codePoint <= 0x0153) ||\n (0x0166 <= codePoint && codePoint <= 0x0167) ||\n (0x016B == codePoint) ||\n (0x01CE == codePoint) ||\n (0x01D0 == codePoint) ||\n (0x01D2 == codePoint) ||\n (0x01D4 == codePoint) ||\n (0x01D6 == codePoint) ||\n (0x01D8 == codePoint) ||\n (0x01DA == codePoint) ||\n (0x01DC == codePoint) ||\n (0x0251 == codePoint) ||\n (0x0261 == codePoint) ||\n (0x02C4 == codePoint) ||\n (0x02C7 == codePoint) ||\n (0x02C9 <= codePoint && codePoint <= 0x02CB) ||\n (0x02CD == codePoint) ||\n (0x02D0 == codePoint) ||\n (0x02D8 <= codePoint && codePoint <= 0x02DB) ||\n (0x02DD == codePoint) ||\n (0x02DF == codePoint) ||\n (0x0300 <= codePoint && codePoint <= 0x036F) ||\n (0x0391 <= codePoint && codePoint <= 0x03A1) ||\n (0x03A3 <= codePoint && codePoint <= 0x03A9) ||\n (0x03B1 <= codePoint && codePoint <= 0x03C1) ||\n (0x03C3 <= codePoint && codePoint <= 0x03C9) ||\n (0x0401 == codePoint) ||\n (0x0410 <= codePoint && codePoint <= 0x044F) ||\n (0x0451 == codePoint) ||\n (0x2010 == codePoint) ||\n (0x2013 <= codePoint && codePoint <= 0x2016) ||\n (0x2018 <= codePoint && codePoint <= 0x2019) ||\n (0x201C <= codePoint && codePoint <= 0x201D) ||\n (0x2020 <= codePoint && codePoint <= 0x2022) ||\n (0x2024 <= codePoint && codePoint <= 0x2027) ||\n (0x2030 == codePoint) ||\n (0x2032 <= codePoint && codePoint <= 0x2033) ||\n (0x2035 == codePoint) ||\n (0x203B == codePoint) ||\n (0x203E == codePoint) ||\n (0x2074 == codePoint) ||\n (0x207F == codePoint) ||\n (0x2081 <= codePoint && codePoint <= 0x2084) ||\n (0x20AC == codePoint) ||\n (0x2103 == codePoint) ||\n (0x2105 == codePoint) ||\n (0x2109 == codePoint) ||\n (0x2113 == codePoint) ||\n (0x2116 == codePoint) ||\n (0x2121 <= codePoint && codePoint <= 0x2122) ||\n (0x2126 == codePoint) ||\n (0x212B == codePoint) ||\n (0x2153 <= codePoint && codePoint <= 0x2154) ||\n (0x215B <= codePoint && codePoint <= 0x215E) ||\n (0x2160 <= codePoint && codePoint <= 0x216B) ||\n (0x2170 <= codePoint && codePoint <= 0x2179) ||\n (0x2189 == codePoint) ||\n (0x2190 <= codePoint && codePoint <= 0x2199) ||\n (0x21B8 <= codePoint && codePoint <= 0x21B9) ||\n (0x21D2 == codePoint) ||\n (0x21D4 == codePoint) ||\n (0x21E7 == codePoint) ||\n (0x2200 == codePoint) ||\n (0x2202 <= codePoint && codePoint <= 0x2203) ||\n (0x2207 <= codePoint && codePoint <= 0x2208) ||\n (0x220B == codePoint) ||\n (0x220F == codePoint) ||\n (0x2211 == codePoint) ||\n (0x2215 == codePoint) ||\n (0x221A == codePoint) ||\n (0x221D <= codePoint && codePoint <= 0x2220) ||\n (0x2223 == codePoint) ||\n (0x2225 == codePoint) ||\n (0x2227 <= codePoint && codePoint <= 0x222C) ||\n (0x222E == codePoint) ||\n (0x2234 <= codePoint && codePoint <= 0x2237) ||\n (0x223C <= codePoint && codePoint <= 0x223D) ||\n (0x2248 == codePoint) ||\n (0x224C == codePoint) ||\n (0x2252 == codePoint) ||\n (0x2260 <= codePoint && codePoint <= 0x2261) ||\n (0x2264 <= codePoint && codePoint <= 0x2267) ||\n (0x226A <= codePoint && codePoint <= 0x226B) ||\n (0x226E <= codePoint && codePoint <= 0x226F) ||\n (0x2282 <= codePoint && codePoint <= 0x2283) ||\n (0x2286 <= codePoint && codePoint <= 0x2287) ||\n (0x2295 == codePoint) ||\n (0x2299 == codePoint) ||\n (0x22A5 == codePoint) ||\n (0x22BF == codePoint) ||\n (0x2312 == codePoint) ||\n (0x2460 <= codePoint && codePoint <= 0x24E9) ||\n (0x24EB <= codePoint && codePoint <= 0x254B) ||\n (0x2550 <= codePoint && codePoint <= 0x2573) ||\n (0x2580 <= codePoint && codePoint <= 0x258F) ||\n (0x2592 <= codePoint && codePoint <= 0x2595) ||\n (0x25A0 <= codePoint && codePoint <= 0x25A1) ||\n (0x25A3 <= codePoint && codePoint <= 0x25A9) ||\n (0x25B2 <= codePoint && codePoint <= 0x25B3) ||\n (0x25B6 <= codePoint && codePoint <= 0x25B7) ||\n (0x25BC <= codePoint && codePoint <= 0x25BD) ||\n (0x25C0 <= codePoint && codePoint <= 0x25C1) ||\n (0x25C6 <= codePoint && codePoint <= 0x25C8) ||\n (0x25CB == codePoint) ||\n (0x25CE <= codePoint && codePoint <= 0x25D1) ||\n (0x25E2 <= codePoint && codePoint <= 0x25E5) ||\n (0x25EF == codePoint) ||\n (0x2605 <= codePoint && codePoint <= 0x2606) ||\n (0x2609 == codePoint) ||\n (0x260E <= codePoint && codePoint <= 0x260F) ||\n (0x2614 <= codePoint && codePoint <= 0x2615) ||\n (0x261C == codePoint) ||\n (0x261E == codePoint) ||\n (0x2640 == codePoint) ||\n (0x2642 == codePoint) ||\n (0x2660 <= codePoint && codePoint <= 0x2661) ||\n (0x2663 <= codePoint && codePoint <= 0x2665) ||\n (0x2667 <= codePoint && codePoint <= 0x266A) ||\n (0x266C <= codePoint && codePoint <= 0x266D) ||\n (0x266F == codePoint) ||\n (0x269E <= codePoint && codePoint <= 0x269F) ||\n (0x26BE <= codePoint && codePoint <= 0x26BF) ||\n (0x26C4 <= codePoint && codePoint <= 0x26CD) ||\n (0x26CF <= codePoint && codePoint <= 0x26E1) ||\n (0x26E3 == codePoint) ||\n (0x26E8 <= codePoint && codePoint <= 0x26FF) ||\n (0x273D == codePoint) ||\n (0x2757 == codePoint) ||\n (0x2776 <= codePoint && codePoint <= 0x277F) ||\n (0x2B55 <= codePoint && codePoint <= 0x2B59) ||\n (0x3248 <= codePoint && codePoint <= 0x324F) ||\n (0xE000 <= codePoint && codePoint <= 0xF8FF) ||\n (0xFE00 <= codePoint && codePoint <= 0xFE0F) ||\n (0xFFFD == codePoint) ||\n (0x1F100 <= codePoint && codePoint <= 0x1F10A) ||\n (0x1F110 <= codePoint && codePoint <= 0x1F12D) ||\n (0x1F130 <= codePoint && codePoint <= 0x1F169) ||\n (0x1F170 <= codePoint && codePoint <= 0x1F19A) ||\n (0xE0100 <= codePoint && codePoint <= 0xE01EF) ||\n (0xF0000 <= codePoint && codePoint <= 0xFFFFD) ||\n (0x100000 <= codePoint && codePoint <= 0x10FFFD)) {\n return 'A';\n }\n\n return 'N';\n};\n\neaw.characterLength = function(character) {\n var code = this.eastAsianWidth(character);\n if (code == 'F' || code == 'W' || code == 'A') {\n return 2;\n } else {\n return 1;\n }\n};\n\n// Split a string considering surrogate-pairs.\nfunction stringToArray(string) {\n return string.match(/[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[^\\uD800-\\uDFFF]/g) || [];\n}\n\neaw.length = function(string) {\n var characters = stringToArray(string);\n var len = 0;\n for (var i = 0; i < characters.length; i++) {\n len = len + this.characterLength(characters[i]);\n }\n return len;\n};\n\neaw.slice = function(text, start, end) {\n textLen = eaw.length(text)\n start = start ? start : 0;\n end = end ? end : 1;\n if (start < 0) {\n start = textLen + start;\n }\n if (end < 0) {\n end = textLen + end;\n }\n var result = '';\n var eawLen = 0;\n var chars = stringToArray(text);\n for (var i = 0; i < chars.length; i++) {\n var char = chars[i];\n var charLen = eaw.length(char);\n if (eawLen >= start - (charLen == 2 ? 1 : 0)) {\n if (eawLen + charLen <= end) {\n result += char;\n } else {\n break;\n }\n }\n eawLen += charLen;\n }\n return result;\n};\n","\"use strict\";\n\nmodule.exports = function () {\n // https://mths.be/emoji\n return /\\uD83C\\uDFF4\\uDB40\\uDC67\\uDB40\\uDC62(?:\\uDB40\\uDC77\\uDB40\\uDC6C\\uDB40\\uDC73|\\uDB40\\uDC73\\uDB40\\uDC63\\uDB40\\uDC74|\\uDB40\\uDC65\\uDB40\\uDC6E\\uDB40\\uDC67)\\uDB40\\uDC7F|(?:\\uD83E\\uDDD1\\uD83C\\uDFFF\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB-\\uDFFE])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFE\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFD\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFC\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFB\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFC-\\uDFFF])|\\uD83D\\uDC68(?:\\uD83C\\uDFFB(?:\\u200D(?:\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF]))|\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFC-\\uDFFF])|[\\u2695\\u2696\\u2708]\\uFE0F|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD]))?|(?:\\uD83C[\\uDFFC-\\uDFFF])\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF]))|\\u200D(?:\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83D\\uDC68|(?:\\uD83D[\\uDC68\\uDC69])\\u200D(?:\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67]))|\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFF\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFE])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFE\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFD\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFC\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|(?:\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708]|\\u200D[\\u2695\\u2696\\u2708])\\uFE0F|\\u200D(?:(?:\\uD83D[\\uDC68\\uDC69])\\u200D(?:\\uD83D[\\uDC66\\uDC67])|\\uD83D[\\uDC66\\uDC67])|\\uD83C\\uDFFF|\\uD83C\\uDFFE|\\uD83C\\uDFFD|\\uD83C\\uDFFC)?|(?:\\uD83D\\uDC69(?:\\uD83C\\uDFFB\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D(?:\\uD83D[\\uDC68\\uDC69])|\\uD83D[\\uDC68\\uDC69])|(?:\\uD83C[\\uDFFC-\\uDFFF])\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D(?:\\uD83D[\\uDC68\\uDC69])|\\uD83D[\\uDC68\\uDC69]))|\\uD83E\\uDDD1(?:\\uD83C[\\uDFFB-\\uDFFF])\\u200D\\uD83E\\uDD1D\\u200D\\uD83E\\uDDD1)(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D(?:\\uD83D\\uDC66\\u200D\\uD83D\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C\\uDDBD])|\\uD83C\\uDFFB\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD]))|\\uD83D\\uDC69\\u200D\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D(?:\\uD83D[\\uDC66\\uDC67])|\\uD83D\\uDC69\\u200D\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67])|(?:\\uD83D\\uDC41\\uFE0F\\u200D\\uD83D\\uDDE8|\\uD83E\\uDDD1(?:\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFB\\u200D[\\u2695\\u2696\\u2708]|\\u200D[\\u2695\\u2696\\u2708])|\\uD83D\\uDC69(?:\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFB\\u200D[\\u2695\\u2696\\u2708]|\\u200D[\\u2695\\u2696\\u2708])|\\uD83D\\uDE36\\u200D\\uD83C\\uDF2B|\\uD83C\\uDFF3\\uFE0F\\u200D\\u26A7|\\uD83D\\uDC3B\\u200D\\u2744|(?:(?:\\uD83C[\\uDFC3\\uDFC4\\uDFCA]|\\uD83D[\\uDC6E\\uDC70\\uDC71\\uDC73\\uDC77\\uDC81\\uDC82\\uDC86\\uDC87\\uDE45-\\uDE47\\uDE4B\\uDE4D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD35\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD4\\uDDD6-\\uDDDD])(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC6F|\\uD83E[\\uDD3C\\uDDDE\\uDDDF])\\u200D[\\u2640\\u2642]|(?:\\u26F9|\\uD83C[\\uDFCB\\uDFCC]|\\uD83D\\uDD75)(?:\\uFE0F|\\uD83C[\\uDFFB-\\uDFFF])\\u200D[\\u2640\\u2642]|\\uD83C\\uDFF4\\u200D\\u2620|(?:\\uD83C[\\uDFC3\\uDFC4\\uDFCA]|\\uD83D[\\uDC6E\\uDC70\\uDC71\\uDC73\\uDC77\\uDC81\\uDC82\\uDC86\\uDC87\\uDE45-\\uDE47\\uDE4B\\uDE4D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD35\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD4\\uDDD6-\\uDDDD])\\u200D[\\u2640\\u2642]|[\\xA9\\xAE\\u203C\\u2049\\u2122\\u2139\\u2194-\\u2199\\u21A9\\u21AA\\u2328\\u23CF\\u23ED-\\u23EF\\u23F1\\u23F2\\u23F8-\\u23FA\\u24C2\\u25AA\\u25AB\\u25B6\\u25C0\\u25FB\\u25FC\\u2600-\\u2604\\u260E\\u2611\\u2618\\u2620\\u2622\\u2623\\u2626\\u262A\\u262E\\u262F\\u2638-\\u263A\\u2640\\u2642\\u265F\\u2660\\u2663\\u2665\\u2666\\u2668\\u267B\\u267E\\u2692\\u2694-\\u2697\\u2699\\u269B\\u269C\\u26A0\\u26A7\\u26B0\\u26B1\\u26C8\\u26CF\\u26D1\\u26D3\\u26E9\\u26F0\\u26F1\\u26F4\\u26F7\\u26F8\\u2702\\u2708\\u2709\\u270F\\u2712\\u2714\\u2716\\u271D\\u2721\\u2733\\u2734\\u2744\\u2747\\u2763\\u27A1\\u2934\\u2935\\u2B05-\\u2B07\\u3030\\u303D\\u3297\\u3299]|\\uD83C[\\uDD70\\uDD71\\uDD7E\\uDD7F\\uDE02\\uDE37\\uDF21\\uDF24-\\uDF2C\\uDF36\\uDF7D\\uDF96\\uDF97\\uDF99-\\uDF9B\\uDF9E\\uDF9F\\uDFCD\\uDFCE\\uDFD4-\\uDFDF\\uDFF5\\uDFF7]|\\uD83D[\\uDC3F\\uDCFD\\uDD49\\uDD4A\\uDD6F\\uDD70\\uDD73\\uDD76-\\uDD79\\uDD87\\uDD8A-\\uDD8D\\uDDA5\\uDDA8\\uDDB1\\uDDB2\\uDDBC\\uDDC2-\\uDDC4\\uDDD1-\\uDDD3\\uDDDC-\\uDDDE\\uDDE1\\uDDE3\\uDDE8\\uDDEF\\uDDF3\\uDDFA\\uDECB\\uDECD-\\uDECF\\uDEE0-\\uDEE5\\uDEE9\\uDEF0\\uDEF3])\\uFE0F|\\uD83C\\uDFF3\\uFE0F\\u200D\\uD83C\\uDF08|\\uD83D\\uDC69\\u200D\\uD83D\\uDC67|\\uD83D\\uDC69\\u200D\\uD83D\\uDC66|\\uD83D\\uDE35\\u200D\\uD83D\\uDCAB|\\uD83D\\uDE2E\\u200D\\uD83D\\uDCA8|\\uD83D\\uDC15\\u200D\\uD83E\\uDDBA|\\uD83E\\uDDD1(?:\\uD83C\\uDFFF|\\uD83C\\uDFFE|\\uD83C\\uDFFD|\\uD83C\\uDFFC|\\uD83C\\uDFFB)?|\\uD83D\\uDC69(?:\\uD83C\\uDFFF|\\uD83C\\uDFFE|\\uD83C\\uDFFD|\\uD83C\\uDFFC|\\uD83C\\uDFFB)?|\\uD83C\\uDDFD\\uD83C\\uDDF0|\\uD83C\\uDDF6\\uD83C\\uDDE6|\\uD83C\\uDDF4\\uD83C\\uDDF2|\\uD83D\\uDC08\\u200D\\u2B1B|\\u2764\\uFE0F\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3\\uDFC4\\uDFCA]|\\uD83D[\\uDC6E\\uDC70\\uDC71\\uDC73\\uDC77\\uDC81\\uDC82\\uDC86\\uDC87\\uDE45-\\uDE47\\uDE4B\\uDE4D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD35\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD4\\uDDD6-\\uDDDD]|\\uD83D\\uDC6F|\\uD83E[\\uDD3C\\uDDDE\\uDDDF]|[\\u231A\\u231B\\u23E9-\\u23EC\\u23F0\\u23F3\\u25FD\\u25FE\\u2614\\u2615\\u2648-\\u2653\\u267F\\u2693\\u26A1\\u26AA\\u26AB\\u26BD\\u26BE\\u26C4\\u26C5\\u26CE\\u26D4\\u26EA\\u26F2\\u26F3\\u26F5\\u26FA\\u26FD\\u2705\\u2728\\u274C\\u274E\\u2753-\\u2755\\u2757\\u2795-\\u2797\\u27B0\\u27BF\\u2B1B\\u2B1C\\u2B50\\u2B55]|\\uD83C[\\uDC04\\uDCCF\\uDD8E\\uDD91-\\uDD9A\\uDE01\\uDE1A\\uDE2F\\uDE32-\\uDE36\\uDE38-\\uDE3A\\uDE50\\uDE51\\uDF00-\\uDF20\\uDF2D-\\uDF35\\uDF37-\\uDF7C\\uDF7E-\\uDF84\\uDF86-\\uDF93\\uDFA0-\\uDFC1\\uDFC5\\uDFC6\\uDFC8\\uDFC9\\uDFCF-\\uDFD3\\uDFE0-\\uDFF0\\uDFF8-\\uDFFF]|\\uD83D[\\uDC00-\\uDC07\\uDC09-\\uDC14\\uDC16-\\uDC3A\\uDC3C-\\uDC3E\\uDC40\\uDC44\\uDC45\\uDC51-\\uDC65\\uDC6A\\uDC79-\\uDC7B\\uDC7D-\\uDC80\\uDC84\\uDC88-\\uDC8E\\uDC90\\uDC92-\\uDCA9\\uDCAB-\\uDCFC\\uDCFF-\\uDD3D\\uDD4B-\\uDD4E\\uDD50-\\uDD67\\uDDA4\\uDDFB-\\uDE2D\\uDE2F-\\uDE34\\uDE37-\\uDE44\\uDE48-\\uDE4A\\uDE80-\\uDEA2\\uDEA4-\\uDEB3\\uDEB7-\\uDEBF\\uDEC1-\\uDEC5\\uDED0-\\uDED2\\uDED5-\\uDED7\\uDEEB\\uDEEC\\uDEF4-\\uDEFC\\uDFE0-\\uDFEB]|\\uD83E[\\uDD0D\\uDD0E\\uDD10-\\uDD17\\uDD1D\\uDD20-\\uDD25\\uDD27-\\uDD2F\\uDD3A\\uDD3F-\\uDD45\\uDD47-\\uDD76\\uDD78\\uDD7A-\\uDDB4\\uDDB7\\uDDBA\\uDDBC-\\uDDCB\\uDDD0\\uDDE0-\\uDDFF\\uDE70-\\uDE74\\uDE78-\\uDE7A\\uDE80-\\uDE86\\uDE90-\\uDEA8\\uDEB0-\\uDEB6\\uDEC0-\\uDEC2\\uDED0-\\uDED6]|(?:[\\u231A\\u231B\\u23E9-\\u23EC\\u23F0\\u23F3\\u25FD\\u25FE\\u2614\\u2615\\u2648-\\u2653\\u267F\\u2693\\u26A1\\u26AA\\u26AB\\u26BD\\u26BE\\u26C4\\u26C5\\u26CE\\u26D4\\u26EA\\u26F2\\u26F3\\u26F5\\u26FA\\u26FD\\u2705\\u270A\\u270B\\u2728\\u274C\\u274E\\u2753-\\u2755\\u2757\\u2795-\\u2797\\u27B0\\u27BF\\u2B1B\\u2B1C\\u2B50\\u2B55]|\\uD83C[\\uDC04\\uDCCF\\uDD8E\\uDD91-\\uDD9A\\uDDE6-\\uDDFF\\uDE01\\uDE1A\\uDE2F\\uDE32-\\uDE36\\uDE38-\\uDE3A\\uDE50\\uDE51\\uDF00-\\uDF20\\uDF2D-\\uDF35\\uDF37-\\uDF7C\\uDF7E-\\uDF93\\uDFA0-\\uDFCA\\uDFCF-\\uDFD3\\uDFE0-\\uDFF0\\uDFF4\\uDFF8-\\uDFFF]|\\uD83D[\\uDC00-\\uDC3E\\uDC40\\uDC42-\\uDCFC\\uDCFF-\\uDD3D\\uDD4B-\\uDD4E\\uDD50-\\uDD67\\uDD7A\\uDD95\\uDD96\\uDDA4\\uDDFB-\\uDE4F\\uDE80-\\uDEC5\\uDECC\\uDED0-\\uDED2\\uDED5-\\uDED7\\uDEEB\\uDEEC\\uDEF4-\\uDEFC\\uDFE0-\\uDFEB]|\\uD83E[\\uDD0C-\\uDD3A\\uDD3C-\\uDD45\\uDD47-\\uDD78\\uDD7A-\\uDDCB\\uDDCD-\\uDDFF\\uDE70-\\uDE74\\uDE78-\\uDE7A\\uDE80-\\uDE86\\uDE90-\\uDEA8\\uDEB0-\\uDEB6\\uDEC0-\\uDEC2\\uDED0-\\uDED6])|(?:[#\\*0-9\\xA9\\xAE\\u203C\\u2049\\u2122\\u2139\\u2194-\\u2199\\u21A9\\u21AA\\u231A\\u231B\\u2328\\u23CF\\u23E9-\\u23F3\\u23F8-\\u23FA\\u24C2\\u25AA\\u25AB\\u25B6\\u25C0\\u25FB-\\u25FE\\u2600-\\u2604\\u260E\\u2611\\u2614\\u2615\\u2618\\u261D\\u2620\\u2622\\u2623\\u2626\\u262A\\u262E\\u262F\\u2638-\\u263A\\u2640\\u2642\\u2648-\\u2653\\u265F\\u2660\\u2663\\u2665\\u2666\\u2668\\u267B\\u267E\\u267F\\u2692-\\u2697\\u2699\\u269B\\u269C\\u26A0\\u26A1\\u26A7\\u26AA\\u26AB\\u26B0\\u26B1\\u26BD\\u26BE\\u26C4\\u26C5\\u26C8\\u26CE\\u26CF\\u26D1\\u26D3\\u26D4\\u26E9\\u26EA\\u26F0-\\u26F5\\u26F7-\\u26FA\\u26FD\\u2702\\u2705\\u2708-\\u270D\\u270F\\u2712\\u2714\\u2716\\u271D\\u2721\\u2728\\u2733\\u2734\\u2744\\u2747\\u274C\\u274E\\u2753-\\u2755\\u2757\\u2763\\u2764\\u2795-\\u2797\\u27A1\\u27B0\\u27BF\\u2934\\u2935\\u2B05-\\u2B07\\u2B1B\\u2B1C\\u2B50\\u2B55\\u3030\\u303D\\u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\uDE45-\\uDE47\\uDE4B-\\uDE4F\\uDEA3\\uDEB4-\\uDEB6\\uDEC0\\uDECC]|\\uD83E[\\uDD0C\\uDD0F\\uDD18-\\uDD1F\\uDD26\\uDD30-\\uDD39\\uDD3C-\\uDD3E\\uDD77\\uDDB5\\uDDB6\\uDDB8\\uDDB9\\uDDBB\\uDDCD-\\uDDCF\\uDDD1-\\uDDDD])/g;\n};\n","import stripAnsi from 'strip-ansi';\nimport eastAsianWidth from 'eastasianwidth';\nimport emojiRegex from 'emoji-regex';\n\nexport default function stringWidth(string, options = {}) {\n\tif (typeof string !== 'string' || string.length === 0) {\n\t\treturn 0;\n\t}\n\n\toptions = {\n\t\tambiguousIsNarrow: true,\n\t\t...options\n\t};\n\n\tstring = stripAnsi(string);\n\n\tif (string.length === 0) {\n\t\treturn 0;\n\t}\n\n\tstring = string.replace(emojiRegex(), ' ');\n\n\tconst ambiguousCharacterWidth = options.ambiguousIsNarrow ? 1 : 2;\n\tlet width = 0;\n\n\tfor (const character of string) {\n\t\tconst codePoint = character.codePointAt(0);\n\n\t\t// Ignore control characters\n\t\tif (codePoint <= 0x1F || (codePoint >= 0x7F && codePoint <= 0x9F)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Ignore combining characters\n\t\tif (codePoint >= 0x300 && codePoint <= 0x36F) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst code = eastAsianWidth.eastAsianWidth(character);\n\t\tswitch (code) {\n\t\t\tcase 'F':\n\t\t\tcase 'W':\n\t\t\t\twidth += 2;\n\t\t\t\tbreak;\n\t\t\tcase 'A':\n\t\t\t\twidth += ambiguousCharacterWidth;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\twidth += 1;\n\t\t}\n\t}\n\n\treturn width;\n}\n","const ANSI_BACKGROUND_OFFSET = 10;\n\nconst wrapAnsi16 = (offset = 0) => code => `\\u001B[${code + offset}m`;\n\nconst wrapAnsi256 = (offset = 0) => code => `\\u001B[${38 + offset};5;${code}m`;\n\nconst wrapAnsi16m = (offset = 0) => (red, green, blue) => `\\u001B[${38 + offset};2;${red};${green};${blue}m`;\n\nconst styles = {\n\tmodifier: {\n\t\treset: [0, 0],\n\t\t// 21 isn't widely supported and 22 does the same thing\n\t\tbold: [1, 22],\n\t\tdim: [2, 22],\n\t\titalic: [3, 23],\n\t\tunderline: [4, 24],\n\t\toverline: [53, 55],\n\t\tinverse: [7, 27],\n\t\thidden: [8, 28],\n\t\tstrikethrough: [9, 29],\n\t},\n\tcolor: {\n\t\tblack: [30, 39],\n\t\tred: [31, 39],\n\t\tgreen: [32, 39],\n\t\tyellow: [33, 39],\n\t\tblue: [34, 39],\n\t\tmagenta: [35, 39],\n\t\tcyan: [36, 39],\n\t\twhite: [37, 39],\n\n\t\t// Bright color\n\t\tblackBright: [90, 39],\n\t\tgray: [90, 39], // Alias of `blackBright`\n\t\tgrey: [90, 39], // Alias of `blackBright`\n\t\tredBright: [91, 39],\n\t\tgreenBright: [92, 39],\n\t\tyellowBright: [93, 39],\n\t\tblueBright: [94, 39],\n\t\tmagentaBright: [95, 39],\n\t\tcyanBright: [96, 39],\n\t\twhiteBright: [97, 39],\n\t},\n\tbgColor: {\n\t\tbgBlack: [40, 49],\n\t\tbgRed: [41, 49],\n\t\tbgGreen: [42, 49],\n\t\tbgYellow: [43, 49],\n\t\tbgBlue: [44, 49],\n\t\tbgMagenta: [45, 49],\n\t\tbgCyan: [46, 49],\n\t\tbgWhite: [47, 49],\n\n\t\t// Bright color\n\t\tbgBlackBright: [100, 49],\n\t\tbgGray: [100, 49], // Alias of `bgBlackBright`\n\t\tbgGrey: [100, 49], // Alias of `bgBlackBright`\n\t\tbgRedBright: [101, 49],\n\t\tbgGreenBright: [102, 49],\n\t\tbgYellowBright: [103, 49],\n\t\tbgBlueBright: [104, 49],\n\t\tbgMagentaBright: [105, 49],\n\t\tbgCyanBright: [106, 49],\n\t\tbgWhiteBright: [107, 49],\n\t},\n};\n\nexport const modifierNames = Object.keys(styles.modifier);\nexport const foregroundColorNames = Object.keys(styles.color);\nexport const backgroundColorNames = Object.keys(styles.bgColor);\nexport const colorNames = [...foregroundColorNames, ...backgroundColorNames];\n\nfunction assembleStyles() {\n\tconst codes = new Map();\n\n\tfor (const [groupName, group] of Object.entries(styles)) {\n\t\tfor (const [styleName, style] of Object.entries(group)) {\n\t\t\tstyles[styleName] = {\n\t\t\t\topen: `\\u001B[${style[0]}m`,\n\t\t\t\tclose: `\\u001B[${style[1]}m`,\n\t\t\t};\n\n\t\t\tgroup[styleName] = styles[styleName];\n\n\t\t\tcodes.set(style[0], style[1]);\n\t\t}\n\n\t\tObject.defineProperty(styles, groupName, {\n\t\t\tvalue: group,\n\t\t\tenumerable: false,\n\t\t});\n\t}\n\n\tObject.defineProperty(styles, 'codes', {\n\t\tvalue: codes,\n\t\tenumerable: false,\n\t});\n\n\tstyles.color.close = '\\u001B[39m';\n\tstyles.bgColor.close = '\\u001B[49m';\n\n\tstyles.color.ansi = wrapAnsi16();\n\tstyles.color.ansi256 = wrapAnsi256();\n\tstyles.color.ansi16m = wrapAnsi16m();\n\tstyles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);\n\tstyles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);\n\tstyles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);\n\n\t// From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js\n\tObject.defineProperties(styles, {\n\t\trgbToAnsi256: {\n\t\t\tvalue: (red, green, blue) => {\n\t\t\t\t// We use the extended greyscale palette here, with the exception of\n\t\t\t\t// black and white. normal palette only has 4 greyscale shades.\n\t\t\t\tif (red === green && green === blue) {\n\t\t\t\t\tif (red < 8) {\n\t\t\t\t\t\treturn 16;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (red > 248) {\n\t\t\t\t\t\treturn 231;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn Math.round(((red - 8) / 247) * 24) + 232;\n\t\t\t\t}\n\n\t\t\t\treturn 16\n\t\t\t\t\t+ (36 * Math.round(red / 255 * 5))\n\t\t\t\t\t+ (6 * Math.round(green / 255 * 5))\n\t\t\t\t\t+ Math.round(blue / 255 * 5);\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToRgb: {\n\t\t\tvalue: hex => {\n\t\t\t\tconst matches = /[a-f\\d]{6}|[a-f\\d]{3}/i.exec(hex.toString(16));\n\t\t\t\tif (!matches) {\n\t\t\t\t\treturn [0, 0, 0];\n\t\t\t\t}\n\n\t\t\t\tlet [colorString] = matches;\n\n\t\t\t\tif (colorString.length === 3) {\n\t\t\t\t\tcolorString = [...colorString].map(character => character + character).join('');\n\t\t\t\t}\n\n\t\t\t\tconst integer = Number.parseInt(colorString, 16);\n\n\t\t\t\treturn [\n\t\t\t\t\t/* eslint-disable no-bitwise */\n\t\t\t\t\t(integer >> 16) & 0xFF,\n\t\t\t\t\t(integer >> 8) & 0xFF,\n\t\t\t\t\tinteger & 0xFF,\n\t\t\t\t\t/* eslint-enable no-bitwise */\n\t\t\t\t];\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToAnsi256: {\n\t\t\tvalue: hex => styles.rgbToAnsi256(...styles.hexToRgb(hex)),\n\t\t\tenumerable: false,\n\t\t},\n\t\tansi256ToAnsi: {\n\t\t\tvalue: code => {\n\t\t\t\tif (code < 8) {\n\t\t\t\t\treturn 30 + code;\n\t\t\t\t}\n\n\t\t\t\tif (code < 16) {\n\t\t\t\t\treturn 90 + (code - 8);\n\t\t\t\t}\n\n\t\t\t\tlet red;\n\t\t\t\tlet green;\n\t\t\t\tlet blue;\n\n\t\t\t\tif (code >= 232) {\n\t\t\t\t\tred = (((code - 232) * 10) + 8) / 255;\n\t\t\t\t\tgreen = red;\n\t\t\t\t\tblue = red;\n\t\t\t\t} else {\n\t\t\t\t\tcode -= 16;\n\n\t\t\t\t\tconst remainder = code % 36;\n\n\t\t\t\t\tred = Math.floor(code / 36) / 5;\n\t\t\t\t\tgreen = Math.floor(remainder / 6) / 5;\n\t\t\t\t\tblue = (remainder % 6) / 5;\n\t\t\t\t}\n\n\t\t\t\tconst value = Math.max(red, green, blue) * 2;\n\n\t\t\t\tif (value === 0) {\n\t\t\t\t\treturn 30;\n\t\t\t\t}\n\n\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\tlet result = 30 + ((Math.round(blue) << 2) | (Math.round(green) << 1) | Math.round(red));\n\n\t\t\t\tif (value === 2) {\n\t\t\t\t\tresult += 60;\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\trgbToAnsi: {\n\t\t\tvalue: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToAnsi: {\n\t\t\tvalue: hex => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),\n\t\t\tenumerable: false,\n\t\t},\n\t});\n\n\treturn styles;\n}\n\nconst ansiStyles = assembleStyles();\n\nexport default ansiStyles;\n","import stringWidth from 'string-width';\nimport stripAnsi from 'strip-ansi';\nimport ansiStyles from 'ansi-styles';\n\nconst ESCAPES = new Set([\n\t'\\u001B',\n\t'\\u009B',\n]);\n\nconst END_CODE = 39;\nconst ANSI_ESCAPE_BELL = '\\u0007';\nconst ANSI_CSI = '[';\nconst ANSI_OSC = ']';\nconst ANSI_SGR_TERMINATOR = 'm';\nconst ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;\n\nconst wrapAnsiCode = code => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;\nconst wrapAnsiHyperlink = uri => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${uri}${ANSI_ESCAPE_BELL}`;\n\n// Calculate the length of words split on ' ', ignoring\n// the extra characters added by ansi escape codes\nconst wordLengths = string => string.split(' ').map(character => stringWidth(character));\n\n// Wrap a long word across multiple rows\n// Ansi escape codes do not count towards length\nconst wrapWord = (rows, word, columns) => {\n\tconst characters = [...word];\n\n\tlet isInsideEscape = false;\n\tlet isInsideLinkEscape = false;\n\tlet visible = stringWidth(stripAnsi(rows[rows.length - 1]));\n\n\tfor (const [index, character] of characters.entries()) {\n\t\tconst characterLength = stringWidth(character);\n\n\t\tif (visible + characterLength <= columns) {\n\t\t\trows[rows.length - 1] += character;\n\t\t} else {\n\t\t\trows.push(character);\n\t\t\tvisible = 0;\n\t\t}\n\n\t\tif (ESCAPES.has(character)) {\n\t\t\tisInsideEscape = true;\n\t\t\tisInsideLinkEscape = characters.slice(index + 1).join('').startsWith(ANSI_ESCAPE_LINK);\n\t\t}\n\n\t\tif (isInsideEscape) {\n\t\t\tif (isInsideLinkEscape) {\n\t\t\t\tif (character === ANSI_ESCAPE_BELL) {\n\t\t\t\t\tisInsideEscape = false;\n\t\t\t\t\tisInsideLinkEscape = false;\n\t\t\t\t}\n\t\t\t} else if (character === ANSI_SGR_TERMINATOR) {\n\t\t\t\tisInsideEscape = false;\n\t\t\t}\n\n\t\t\tcontinue;\n\t\t}\n\n\t\tvisible += characterLength;\n\n\t\tif (visible === columns && index < characters.length - 1) {\n\t\t\trows.push('');\n\t\t\tvisible = 0;\n\t\t}\n\t}\n\n\t// It's possible that the last row we copy over is only\n\t// ansi escape characters, handle this edge-case\n\tif (!visible && rows[rows.length - 1].length > 0 && rows.length > 1) {\n\t\trows[rows.length - 2] += rows.pop();\n\t}\n};\n\n// Trims spaces from a string ignoring invisible sequences\nconst stringVisibleTrimSpacesRight = string => {\n\tconst words = string.split(' ');\n\tlet last = words.length;\n\n\twhile (last > 0) {\n\t\tif (stringWidth(words[last - 1]) > 0) {\n\t\t\tbreak;\n\t\t}\n\n\t\tlast--;\n\t}\n\n\tif (last === words.length) {\n\t\treturn string;\n\t}\n\n\treturn words.slice(0, last).join(' ') + words.slice(last).join('');\n};\n\n// The wrap-ansi module can be invoked in either 'hard' or 'soft' wrap mode\n//\n// 'hard' will never allow a string to take up more than columns characters\n//\n// 'soft' allows long words to expand past the column length\nconst exec = (string, columns, options = {}) => {\n\tif (options.trim !== false && string.trim() === '') {\n\t\treturn '';\n\t}\n\n\tlet returnValue = '';\n\tlet escapeCode;\n\tlet escapeUrl;\n\n\tconst lengths = wordLengths(string);\n\tlet rows = [''];\n\n\tfor (const [index, word] of string.split(' ').entries()) {\n\t\tif (options.trim !== false) {\n\t\t\trows[rows.length - 1] = rows[rows.length - 1].trimStart();\n\t\t}\n\n\t\tlet rowLength = stringWidth(rows[rows.length - 1]);\n\n\t\tif (index !== 0) {\n\t\t\tif (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {\n\t\t\t\t// If we start with a new word but the current row length equals the length of the columns, add a new row\n\t\t\t\trows.push('');\n\t\t\t\trowLength = 0;\n\t\t\t}\n\n\t\t\tif (rowLength > 0 || options.trim === false) {\n\t\t\t\trows[rows.length - 1] += ' ';\n\t\t\t\trowLength++;\n\t\t\t}\n\t\t}\n\n\t\t// In 'hard' wrap mode, the length of a line is never allowed to extend past 'columns'\n\t\tif (options.hard && lengths[index] > columns) {\n\t\t\tconst remainingColumns = (columns - rowLength);\n\t\t\tconst breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);\n\t\t\tconst breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns);\n\t\t\tif (breaksStartingNextLine < breaksStartingThisLine) {\n\t\t\t\trows.push('');\n\t\t\t}\n\n\t\t\twrapWord(rows, word, columns);\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) {\n\t\t\tif (options.wordWrap === false && rowLength < columns) {\n\t\t\t\twrapWord(rows, word, columns);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\trows.push('');\n\t\t}\n\n\t\tif (rowLength + lengths[index] > columns && options.wordWrap === false) {\n\t\t\twrapWord(rows, word, columns);\n\t\t\tcontinue;\n\t\t}\n\n\t\trows[rows.length - 1] += word;\n\t}\n\n\tif (options.trim !== false) {\n\t\trows = rows.map(row => stringVisibleTrimSpacesRight(row));\n\t}\n\n\tconst pre = [...rows.join('\\n')];\n\n\tfor (const [index, character] of pre.entries()) {\n\t\treturnValue += character;\n\n\t\tif (ESCAPES.has(character)) {\n\t\t\tconst {groups} = new RegExp(`(?:\\\\${ANSI_CSI}(?<code>\\\\d+)m|\\\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`).exec(pre.slice(index).join('')) || {groups: {}};\n\t\t\tif (groups.code !== undefined) {\n\t\t\t\tconst code = Number.parseFloat(groups.code);\n\t\t\t\tescapeCode = code === END_CODE ? undefined : code;\n\t\t\t} else if (groups.uri !== undefined) {\n\t\t\t\tescapeUrl = groups.uri.length === 0 ? undefined : groups.uri;\n\t\t\t}\n\t\t}\n\n\t\tconst code = ansiStyles.codes.get(Number(escapeCode));\n\n\t\tif (pre[index + 1] === '\\n') {\n\t\t\tif (escapeUrl) {\n\t\t\t\treturnValue += wrapAnsiHyperlink('');\n\t\t\t}\n\n\t\t\tif (escapeCode && code) {\n\t\t\t\treturnValue += wrapAnsiCode(code);\n\t\t\t}\n\t\t} else if (character === '\\n') {\n\t\t\tif (escapeCode && code) {\n\t\t\t\treturnValue += wrapAnsiCode(escapeCode);\n\t\t\t}\n\n\t\t\tif (escapeUrl) {\n\t\t\t\treturnValue += wrapAnsiHyperlink(escapeUrl);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn returnValue;\n};\n\n// For each newline, invoke the method separately\nexport default function wrapAnsi(string, columns, options) {\n\treturn String(string)\n\t\t.normalize()\n\t\t.replace(/\\r\\n/g, '\\n')\n\t\t.split('\\n')\n\t\t.map(line => exec(line, columns, options))\n\t\t.join('\\n');\n}\n","const actions = ['up', 'down', 'left', 'right', 'space', 'enter', 'cancel'] as const;\nexport type Action = (typeof actions)[number];\n\n/** Global settings for Clack programs, stored in memory */\ninterface InternalClackSettings {\n\tactions: Set<Action>;\n\taliases: Map<string, Action>;\n}\n\nexport const settings: InternalClackSettings = {\n\tactions: new Set(actions),\n\taliases: new Map<string, Action>([\n\t\t// vim support\n\t\t['k', 'up'],\n\t\t['j', 'down'],\n\t\t['h', 'left'],\n\t\t['l', 'right'],\n\t\t['\\x03', 'cancel'],\n\t\t// opinionated defaults!\n\t\t['escape', 'cancel'],\n\t]),\n};\n\nexport interface ClackSettings {\n\t/**\n\t * Set custom global aliases for the default actions.\n\t * This will not overwrite existing aliases, it will only add new ones!\n\t *\n\t * @param aliases - An object that maps aliases to actions\n\t * @default { k: 'up', j: 'down', h: 'left', l: 'right', '\\x03': 'cancel', 'escape': 'cancel' }\n\t */\n\taliases: Record<string, Action>;\n}\n\nexport function updateSettings(updates: ClackSettings) {\n\tfor (const _key in updates) {\n\t\tconst key = _key as keyof ClackSettings;\n\t\tif (!Object.hasOwn(updates, key)) continue;\n\t\tconst value = updates[key];\n\n\t\tswitch (key) {\n\t\t\tcase 'aliases': {\n\t\t\t\tfor (const alias in value) {\n\t\t\t\t\tif (!Object.hasOwn(value, alias)) continue;\n\t\t\t\t\tif (!settings.aliases.has(alias)) {\n\t\t\t\t\t\tsettings.aliases.set(alias, value[alias]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Check if a key is an alias for a default action\n * @param key - The raw key which might match to an action\n * @param action - The action to match\n * @returns boolean\n */\nexport function isActionKey(key: string | Array<string | undefined>, action: Action) {\n\tif (typeof key === 'string') {\n\t\treturn settings.aliases.get(key) === action;\n\t}\n\n\tfor (const value of key) {\n\t\tif (value === undefined) continue;\n\t\tif (isActionKey(value, action)) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n","export function diffLines(a: string, b: string) {\n\tif (a === b) return;\n\n\tconst aLines = a.split('\\n');\n\tconst bLines = b.split('\\n');\n\tconst diff: number[] = [];\n\n\tfor (let i = 0; i < Math.max(aLines.length, bLines.length); i++) {\n\t\tif (aLines[i] !== bLines[i]) diff.push(i);\n\t}\n\n\treturn diff;\n}\n","import { stdin, stdout } from 'node:process';\nimport type { Key } from 'node:readline';\nimport * as readline from 'node:readline';\nimport type { Readable } from 'node:stream';\nimport { cursor } from 'sisteransi';\nimport { isActionKey } from './settings';\n\nexport * from './string';\nexport * from './settings';\n\nconst isWindows = globalThis.process.platform.startsWith('win');\n\nexport const CANCEL_SYMBOL = Symbol('clack:cancel');\n\nexport function isCancel(value: unknown): value is symbol {\n\treturn value === CANCEL_SYMBOL;\n}\n\nexport function setRawMode(input: Readable, value: boolean) {\n\tconst i = input as typeof stdin;\n\n\tif (i.isTTY) i.setRawMode(value);\n}\n\nexport function block({\n\tinput = stdin,\n\toutput = stdout,\n\toverwrite = true,\n\thideCursor = true,\n} = {}) {\n\tconst rl = readline.createInterface({\n\t\tinput,\n\t\toutput,\n\t\tprompt: '',\n\t\ttabSize: 1,\n\t});\n\treadline.emitKeypressEvents(input, rl);\n\tif (input.isTTY) input.setRawMode(true);\n\n\tconst clear = (data: Buffer, { name, sequence }: Key) => {\n\t\tconst str = String(data);\n\t\tif (isActionKey([str, name, sequence], 'cancel')) {\n\t\t\tif (hideCursor) output.write(cursor.show);\n\t\t\tprocess.exit(0);\n\t\t\treturn;\n\t\t}\n\t\tif (!overwrite) return;\n\t\tconst dx = name === 'return' ? 0 : -1;\n\t\tconst dy = name === 'return' ? -1 : 0;\n\n\t\treadline.moveCursor(output, dx, dy, () => {\n\t\t\treadline.clearLine(output, 1, () => {\n\t\t\t\tinput.once('keypress', clear);\n\t\t\t});\n\t\t});\n\t};\n\tif (hideCursor) output.write(cursor.hide);\n\tinput.once('keypress', clear);\n\n\treturn () => {\n\t\tinput.off('keypress', clear);\n\t\tif (hideCursor) output.write(cursor.show);\n\n\t\t// Prevent Windows specific issues: https://github.com/natemoo-re/clack/issues/176\n\t\tif (input.isTTY && !isWindows) input.setRawMode(false);\n\n\t\t// @ts-expect-error fix for https://github.com/nodejs/node/issues/31762#issuecomment-1441223907\n\t\trl.terminal = false;\n\t\trl.close();\n\t};\n}\n","import { stdin, stdout } from 'node:process';\nimport readline, { type Key, type ReadLine } from 'node:readline';\nimport type { Readable, Writable } from 'node:stream';\nimport { WriteStream } from 'node:tty';\nimport { cursor, erase } from 'sisteransi';\nimport wrap from 'wrap-ansi';\n\nimport { CANCEL_SYMBOL, diffLines, isActionKey, setRawMode, settings } from '../utils';\n\nimport type { ClackEvents, ClackState } from '../types';\nimport type { Action } from '../utils';\n\nexport interface PromptOptions<Self extends Prompt> {\n\trender(this: Omit<Self, 'prompt'>): string | undefined;\n\tplaceholder?: string;\n\tinitialValue?: any;\n\tvalidate?: ((value: any) => string | Error | undefined) | undefined;\n\tinput?: Readable;\n\toutput?: Writable;\n\tdebug?: boolean;\n\tsignal?: AbortSignal;\n}\n\nexport default class Prompt {\n\tprotected input: Readable;\n\tprotected output: Writable;\n\tprivate _abortSignal?: AbortSignal;\n\n\tprivate rl: ReadLine | undefined;\n\tprivate opts: Omit<PromptOptions<Prompt>, 'render' | 'input' | 'output'>;\n\tprivate _render: (context: Omit<Prompt, 'prompt'>) => string | undefined;\n\tprivate _track = false;\n\tprivate _prevFrame = '';\n\tprivate _subscribers = new Map<string, { cb: (...args: any) => any; once?: boolean }[]>();\n\tprotected _cursor = 0;\n\n\tpublic state: ClackState = 'initial';\n\tpublic error = '';\n\tpublic value: any;\n\n\tconstructor(options: PromptOptions<Prompt>, trackValue = true) {\n\t\tconst { input = stdin, output = stdout, render, signal, ...opts } = options;\n\n\t\tthis.opts = opts;\n\t\tthis.onKeypress = this.onKeypress.bind(this);\n\t\tthis.close = this.close.bind(this);\n\t\tthis.render = this.render.bind(this);\n\t\tthis._render = render.bind(this);\n\t\tthis._track = trackValue;\n\t\tthis._abortSignal = signal;\n\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t}\n\n\t/**\n\t * Unsubscribe all listeners\n\t */\n\tprotected unsubscribe() {\n\t\tthis._subscribers.clear();\n\t}\n\n\t/**\n\t * Set a subscriber with opts\n\t * @param event - The event name\n\t */\n\tprivate setSubscriber<T extends keyof ClackEvents>(\n\t\tevent: T,\n\t\topts: { cb: ClackEvents[T]; once?: boolean }\n\t) {\n\t\tconst params = this._subscribers.get(event) ?? [];\n\t\tparams.push(opts);\n\t\tthis._subscribers.set(event, params);\n\t}\n\n\t/**\n\t * Subscribe to an event\n\t * @param event - The event name\n\t * @param cb - The callback\n\t */\n\tpublic on<T extends keyof ClackEvents>(event: T, cb: ClackEvents[T]) {\n\t\tthis.setSubscriber(event, { cb });\n\t}\n\n\t/**\n\t * Subscribe to an event once\n\t * @param event - The event name\n\t * @param cb - The callback\n\t */\n\tpublic once<T extends keyof ClackEvents>(event: T, cb: ClackEvents[T]) {\n\t\tthis.setSubscriber(event, { cb, once: true });\n\t}\n\n\t/**\n\t * Emit an event with data\n\t * @param event - The event name\n\t * @param data - The data to pass to the callback\n\t */\n\tpublic emit<T extends keyof ClackEvents>(event: T, ...data: Parameters<ClackEvents[T]>) {\n\t\tconst cbs = this._subscribers.get(event) ?? [];\n\t\tconst cleanup: (() => void)[] = [];\n\n\t\tfor (const subscriber of cbs) {\n\t\t\tsubscriber.cb(...data);\n\n\t\t\tif (subscriber.once) {\n\t\t\t\tcleanup.push(() => cbs.splice(cbs.indexOf(subscriber), 1));\n\t\t\t}\n\t\t}\n\n\t\tfor (const cb of cleanup) {\n\t\t\tcb();\n\t\t}\n\t}\n\n\tpublic prompt() {\n\t\treturn new Promise<string | symbol>((resolve, reject) => {\n\t\t\tif (this._abortSignal) {\n\t\t\t\tif (this._abortSignal.aborted) {\n\t\t\t\t\tthis.state = 'cancel';\n\n\t\t\t\t\tthis.close();\n\t\t\t\t\treturn resolve(CANCEL_SYMBOL);\n\t\t\t\t}\n\n\t\t\t\tthis._abortSignal.addEventListener(\n\t\t\t\t\t'abort',\n\t\t\t\t\t() => {\n\t\t\t\t\t\tthis.state = 'cancel';\n\t\t\t\t\t\tthis.close();\n\t\t\t\t\t},\n\t\t\t\t\t{ once: true }\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst sink = new WriteStream(0);\n\t\t\tsink._write = (chunk, encoding, done) => {\n\t\t\t\tif (this._track) {\n\t\t\t\t\tthis.value = this.rl?.line.replace(/\\t/g, '');\n\t\t\t\t\tthis._cursor = this.rl?.cursor ?? 0;\n\t\t\t\t\tthis.emit('value', this.value);\n\t\t\t\t}\n\t\t\t\tdone();\n\t\t\t};\n\t\t\tthis.input.pipe(sink);\n\n\t\t\tthis.rl = readline.createInterface({\n\t\t\t\tinput: this.input,\n\t\t\t\toutput: sink,\n\t\t\t\ttabSize: 2,\n\t\t\t\tprompt: '',\n\t\t\t\tescapeCodeTimeout: 50,\n\t\t\t});\n\t\t\treadline.emitKeypressEvents(this.input, this.rl);\n\t\t\tthis.rl.prompt();\n\t\t\tif (this.opts.initialValue !== undefined && this._track) {\n\t\t\t\tthis.rl.write(this.opts.initialValue);\n\t\t\t}\n\n\t\t\tthis.input.on('keypress', this.onKeypress);\n\t\t\tsetRawMode(this.input, true);\n\t\t\tthis.output.on('resize', this.render);\n\n\t\t\tthis.render();\n\n\t\t\tthis.once('submit', () => {\n\t\t\t\tthis.output.write(cursor.show);\n\t\t\t\tthis.output.off('resize', this.render);\n\t\t\t\tsetRawMode(this.input, false);\n\t\t\t\tresolve(this.value);\n\t\t\t});\n\t\t\tthis.once('cancel', () => {\n\t\t\t\tthis.output.write(cursor.show);\n\t\t\t\tthis.output.off('resize', this.render);\n\t\t\t\tsetRawMode(this.input, false);\n\t\t\t\tresolve(CANCEL_SYMBOL);\n\t\t\t});\n\t\t});\n\t}\n\n\tprivate onKeypress(char: string, key?: Key) {\n\t\tif (this.state === 'error') {\n\t\t\tthis.state = 'active';\n\t\t}\n\t\tif (key?.name) {\n\t\t\tif (!this._track && settings.aliases.has(key.name)) {\n\t\t\t\tthis.emit('cursor', settings.aliases.get(key.name));\n\t\t\t}\n\t\t\tif (settings.actions.has(key.name as Action)) {\n\t\t\t\tthis.emit('cursor', key.name as Action);\n\t\t\t}\n\t\t}\n\t\tif (char && (char.toLowerCase() === 'y' || char.toLowerCase() === 'n')) {\n\t\t\tthis.emit('confirm', char.toLowerCase() === 'y');\n\t\t}\n\t\tif (char === '\\t' && this.opts.placeholder) {\n\t\t\tif (!this.value) {\n\t\t\t\tthis.rl?.write(this.opts.placeholder);\n\t\t\t\tthis.emit('value', this.opts.placeholder);\n\t\t\t}\n\t\t}\n\t\tif (char) {\n\t\t\tthis.emit('key', char.toLowerCase());\n\t\t}\n\n\t\tif (key?.name === 'return') {\n\t\t\tif (this.opts.validate) {\n\t\t\t\tconst problem = this.opts.validate(this.value);\n\t\t\t\tif (problem) {\n\t\t\t\t\tthis.error = problem instanceof Error ? problem.message : problem;\n\t\t\t\t\tthis.state = 'error';\n\t\t\t\t\tthis.rl?.write(this.value);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (this.state !== 'error') {\n\t\t\t\tthis.state = 'submit';\n\t\t\t}\n\t\t}\n\n\t\tif (isActionKey([char, key?.name, key?.sequence], 'cancel')) {\n\t\t\tthis.state = 'cancel';\n\t\t}\n\t\tif (this.state === 'submit' || this.state === 'cancel') {\n\t\t\tthis.emit('finalize');\n\t\t}\n\t\tthis.render();\n\t\tif (this.state === 'submit' || this.state === 'cancel') {\n\t\t\tthis.close();\n\t\t}\n\t}\n\n\tprotected close() {\n\t\tthis.input.unpipe();\n\t\tthis.input.removeListener('keypress', this.onKeypress);\n\t\tthis.output.write('\\n');\n\t\tsetRawMode(this.input, false);\n\t\tthis.rl?.close();\n\t\tthis.rl = undefined;\n\t\tthis.emit(`${this.state}`, this.value);\n\t\tthis.unsubscribe();\n\t}\n\n\tprivate restoreCursor() {\n\t\tconst lines =\n\t\t\twrap(this._prevFrame, process.stdout.columns, { hard: true }).split('\\n').length - 1;\n\t\tthis.output.write(cursor.move(-999, lines * -1));\n\t}\n\n\tprivate render() {\n\t\tconst frame = wrap(this._render(this) ?? '', process.stdout.columns, { hard: true });\n\t\tif (frame === this._prevFrame) return;\n\n\t\tif (this.state === 'initial') {\n\t\t\tthis.output.write(cursor.hide);\n\t\t} else {\n\t\t\tconst diff = diffLines(this._prevFrame, frame);\n\t\t\tthis.restoreCursor();\n\t\t\t// If a single line has changed, only update that line\n\t\t\tif (diff && diff?.length === 1) {\n\t\t\t\tconst diffLine = diff[0];\n\t\t\t\tthis.output.write(cursor.move(0, diffLine));\n\t\t\t\tthis.output.write(erase.lines(1));\n\t\t\t\tconst lines = frame.split('\\n');\n\t\t\t\tthis.output.write(lines[diffLine]);\n\t\t\t\tthis._prevFrame = frame;\n\t\t\t\tthis.output.write(cursor.move(0, lines.length - diffLine - 1));\n\t\t\t\treturn;\n\t\t\t\t// If many lines have changed, rerender everything past the first line\n\t\t\t}\n\t\t\tif (diff && diff?.length > 1) {\n\t\t\t\tconst diffLine = diff[0];\n\t\t\t\tthis.output.write(cursor.move(0, diffLine));\n\t\t\t\tthis.output.write(erase.down());\n\t\t\t\tconst lines = frame.split('\\n');\n\t\t\t\tconst newLines = lines.slice(diffLine);\n\t\t\t\tthis.output.write(newLines.join('\\n'));\n\t\t\t\tthis._prevFrame = frame;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.output.write(erase.down());\n\t\t}\n\n\t\tthis.output.write(frame);\n\t\tif (this.state === 'initial') {\n\t\t\tthis.state = 'active';\n\t\t}\n\t\tthis._prevFrame = frame;\n\t}\n}\n","import { cursor } from 'sisteransi';\nimport Prompt, { type PromptOptions } from './prompt';\n\ninterface ConfirmOptions extends PromptOptions<ConfirmPrompt> {\n\tactive: string;\n\tinactive: string;\n\tinitialValue?: boolean;\n}\nexport default class ConfirmPrompt extends Prompt {\n\tget cursor() {\n\t\treturn this.value ? 0 : 1;\n\t}\n\n\tprivate get _value() {\n\t\treturn this.cursor === 0;\n\t}\n\n\tconstructor(opts: ConfirmOptions) {\n\t\tsuper(opts, false);\n\t\tthis.value = !!opts.initialValue;\n\n\t\tthis.on('value', () => {\n\t\t\tthis.value = this._value;\n\t\t});\n\n\t\tthis.on('confirm', (confirm) => {\n\t\t\tthis.output.write(cursor.move(0, -1));\n\t\t\tthis.value = confirm;\n\t\t\tthis.state = 'submit';\n\t\t\tthis.close();\n\t\t});\n\n\t\tthis.on('cursor', () => {\n\t\t\tthis.value = !this.value;\n\t\t});\n\t}\n}\n","import Prompt, { type PromptOptions } from './prompt';\n\ninterface GroupMultiSelectOptions<T extends { value: any }>\n\textends PromptOptions<GroupMultiSelectPrompt<T>> {\n\toptions: Record<string, T[]>;\n\tinitialValues?: T['value'][];\n\trequired?: boolean;\n\tcursorAt?: T['value'];\n}\nexport default class GroupMultiSelectPrompt<T extends { value: any }> extends Prompt {\n\toptions: (T & { group: string | boolean })[];\n\tcursor = 0;\n\n\tgetGroupItems(group: string): T[] {\n\t\treturn this.options.filter((o) => o.group === group);\n\t}\n\n\tisGroupSelected(group: string) {\n\t\tconst items = this.getGroupItems(group);\n\t\treturn items.every((i) => this.value.includes(i.value));\n\t}\n\n\tprivate toggleValue() {\n\t\tconst item = this.options[this.cursor];\n\t\tif (item.group === true) {\n\t\t\tconst group = item.value;\n\t\t\tconst groupedItems = this.getGroupItems(group);\n\t\t\tif (this.isGroupSelected(group)) {\n\t\t\t\tthis.value = this.value.filter(\n\t\t\t\t\t(v: string) => groupedItems.findIndex((i) => i.value === v) === -1\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tthis.value = [...this.value, ...groupedItems.map((i) => i.value)];\n\t\t\t}\n\t\t\tthis.value = Array.from(new Set(this.value));\n\t\t} else {\n\t\t\tconst selected = this.value.includes(item.value);\n\t\t\tthis.value = selected\n\t\t\t\t? this.value.filter((v: T['value']) => v !== item.value)\n\t\t\t\t: [...this.value, item.value];\n\t\t}\n\t}\n\n\tconstructor(opts: GroupMultiSelectOptions<T>) {\n\t\tsuper(opts, false);\n\t\tconst { options } = opts;\n\t\tthis.options = Object.entries(options).flatMap(([key, option]) => [\n\t\t\t{ value: key, group: true, label: key },\n\t\t\t...option.map((opt) => ({ ...opt, group: key })),\n\t\t]) as any;\n\t\tthis.value = [...(opts.initialValues ?? [])];\n\t\tthis.cursor = Math.max(\n\t\t\tthis.options.findIndex(({ value }) => value === opts.cursorAt),\n\t\t\t0\n\t\t);\n\n\t\tthis.on('cursor', (key) => {\n\t\t\tswitch (key) {\n\t\t\t\tcase 'left':\n\t\t\t\tcase 'up':\n\t\t\t\t\tthis.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'down':\n\t\t\t\tcase 'right':\n\t\t\t\t\tthis.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'space':\n\t\t\t\t\tthis.toggleValue();\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t});\n\t}\n}\n","import Prompt, { type PromptOptions } from './prompt';\n\ninterface MultiSelectOptions<T extends { value: any }> extends PromptOptions<MultiSelectPrompt<T>> {\n\toptions: T[];\n\tinitialValues?: T['value'][];\n\trequired?: boolean;\n\tcursorAt?: T['value'];\n}\nexport default class MultiSelectPrompt<T extends { value: any }> extends Prompt {\n\toptions: T[];\n\tcursor = 0;\n\n\tprivate get _value() {\n\t\treturn this.options[this.cursor].value;\n\t}\n\n\tprivate toggleAll() {\n\t\tconst allSelected = this.value.length === this.options.length;\n\t\tthis.value = allSelected ? [] : this.options.map((v) => v.value);\n\t}\n\n\tprivate toggleValue() {\n\t\tconst selected = this.value.includes(this._value);\n\t\tthis.value = selected\n\t\t\t? this.value.filter((value: T['value']) => value !== this._value)\n\t\t\t: [...this.value, this._value];\n\t}\n\n\tconstructor(opts: MultiSelectOptions<T>) {\n\t\tsuper(opts, false);\n\n\t\tthis.options = opts.options;\n\t\tthis.value = [...(opts.initialValues ?? [])];\n\t\tthis.cursor = Math.max(\n\t\t\tthis.options.findIndex(({ value }) => value === opts.cursorAt),\n\t\t\t0\n\t\t);\n\t\tthis.on('key', (char) => {\n\t\t\tif (char === 'a') {\n\t\t\t\tthis.toggleAll();\n\t\t\t}\n\t\t});\n\n\t\tthis.on('cursor', (key) => {\n\t\t\tswitch (key) {\n\t\t\t\tcase 'left':\n\t\t\t\tcase 'up':\n\t\t\t\t\tthis.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'down':\n\t\t\t\tcase 'right':\n\t\t\t\t\tthis.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'space':\n\t\t\t\t\tthis.toggleValue();\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t});\n\t}\n}\n","import color from 'picocolors';\nimport Prompt, { type PromptOptions } from './prompt';\n\ninterface PasswordOptions extends PromptOptions<PasswordPrompt> {\n\tmask?: string;\n}\nexport default class PasswordPrompt extends Prompt {\n\tvalueWithCursor = '';\n\tprivate _mask = '•';\n\tget cursor() {\n\t\treturn this._cursor;\n\t}\n\tget masked() {\n\t\treturn this.value.replaceAll(/./g, this._mask);\n\t}\n\tconstructor({ mask, ...opts }: PasswordOptions) {\n\t\tsuper(opts);\n\t\tthis._mask = mask ?? '•';\n\n\t\tthis.on('finalize', () => {\n\t\t\tthis.valueWithCursor = this.masked;\n\t\t});\n\t\tthis.on('value', () => {\n\t\t\tif (this.cursor >= this.value.length) {\n\t\t\t\tthis.valueWithCursor = `${this.masked}${color.inverse(color.hidden('_'))}`;\n\t\t\t} else {\n\t\t\t\tconst s1 = this.masked.slice(0, this.cursor);\n\t\t\t\tconst s2 = this.masked.slice(this.cursor);\n\t\t\t\tthis.valueWithCursor = `${s1}${color.inverse(s2[0])}${s2.slice(1)}`;\n\t\t\t}\n\t\t});\n\t}\n}\n","import Prompt, { type PromptOptions } from './prompt';\n\ninterface SelectOptions<T extends { value: any }> extends PromptOptions<SelectPrompt<T>> {\n\toptions: T[];\n\tinitialValue?: T['value'];\n}\nexport default class SelectPrompt<T extends { value: any }> extends Prompt {\n\toptions: T[];\n\tcursor = 0;\n\n\tprivate get _value() {\n\t\treturn this.options[this.cursor];\n\t}\n\n\tprivate changeValue() {\n\t\tthis.value = this._value.value;\n\t}\n\n\tconstructor(opts: SelectOptions<T>) {\n\t\tsuper(opts, false);\n\n\t\tthis.options = opts.options;\n\t\tthis.cursor = this.options.findIndex(({ value }) => value === opts.initialValue);\n\t\tif (this.cursor === -1) this.cursor = 0;\n\t\tthis.changeValue();\n\n\t\tthis.on('cursor', (key) => {\n\t\t\tswitch (key) {\n\t\t\t\tcase 'left':\n\t\t\t\tcase 'up':\n\t\t\t\t\tthis.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'down':\n\t\t\t\tcase 'right':\n\t\t\t\t\tthis.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tthis.changeValue();\n\t\t});\n\t}\n}\n","import Prompt, { type PromptOptions } from './prompt';\n\ninterface SelectKeyOptions<T extends { value: any }> extends PromptOptions<SelectKeyPrompt<T>> {\n\toptions: T[];\n}\nexport default class SelectKeyPrompt<T extends { value: any }> extends Prompt {\n\toptions: T[];\n\tcursor = 0;\n\n\tconstructor(opts: SelectKeyOptions<T>) {\n\t\tsuper(opts, false);\n\n\t\tthis.options = opts.options;\n\t\tconst keys = this.options.map(({ value: [initial] }) => initial?.toLowerCase());\n\t\tthis.cursor = Math.max(keys.indexOf(opts.initialValue), 0);\n\n\t\tthis.on('key', (key) => {\n\t\t\tif (!keys.includes(key)) return;\n\t\t\tconst value = this.options.find(({ value: [initial] }) => initial?.toLowerCase() === key);\n\t\t\tif (value) {\n\t\t\t\tthis.value = value.value;\n\t\t\t\tthis.state = 'submit';\n\t\t\t\tthis.emit('submit');\n\t\t\t}\n\t\t});\n\t}\n}\n","import color from 'picocolors';\nimport Prompt, { type PromptOptions } from './prompt';\n\nexport interface TextOptions extends PromptOptions<TextPrompt> {\n\tplaceholder?: string;\n\tdefaultValue?: string;\n}\n\nexport default class TextPrompt extends Prompt {\n\tget valueWithCursor() {\n\t\tif (this.state === 'submit') {\n\t\t\treturn this.value;\n\t\t}\n\t\tif (this.cursor >= this.value.length) {\n\t\t\treturn `${this.value}█`;\n\t\t}\n\t\tconst s1 = this.value.slice(0, this.cursor);\n\t\tconst [s2, ...s3] = this.value.slice(this.cursor);\n\t\treturn `${s1}${color.inverse(s2)}${s3.join('')}`;\n\t}\n\tget cursor() {\n\t\treturn this._cursor;\n\t}\n\tconstructor(opts: TextOptions) {\n\t\tsuper(opts);\n\n\t\tthis.on('finalize', () => {\n\t\t\tif (!this.value) {\n\t\t\t\tthis.value = opts.defaultValue;\n\t\t\t}\n\t\t});\n\t}\n}\n","import process from 'node:process';\n\nexport default function isUnicodeSupported() {\n\tif (process.platform !== 'win32') {\n\t\treturn process.env.TERM !== 'linux'; // Linux console (kernel)\n\t}\n\n\treturn Boolean(process.env.CI)\n\t\t|| Boolean(process.env.WT_SESSION) // Windows Terminal\n\t\t|| Boolean(process.env.TERMINUS_SUBLIME) // Terminus (<0.2.27)\n\t\t|| process.env.ConEmuTask === '{cmd::Cmder}' // ConEmu and cmder\n\t\t|| process.env.TERM_PROGRAM === 'Terminus-Sublime'\n\t\t|| process.env.TERM_PROGRAM === 'vscode'\n\t\t|| process.env.TERM === 'xterm-256color'\n\t\t|| process.env.TERM === 'alacritty'\n\t\t|| process.env.TERMINAL_EMULATOR === 'JetBrains-JediTerm';\n}\n","import { stripVTControlCharacters as strip } from 'node:util';\nimport {\n\tConfirmPrompt,\n\tGroupMultiSelectPrompt,\n\tMultiSelectPrompt,\n\tPasswordPrompt,\n\tSelectKeyPrompt,\n\tSelectPrompt,\n\ttype State,\n\tTextPrompt,\n\tblock,\n\tisCancel,\n} from '@clack/core';\nimport isUnicodeSupported from 'is-unicode-supported';\nimport color from 'picocolors';\nimport { cursor, erase } from 'sisteransi';\n\nexport { isCancel } from '@clack/core';\nexport { updateSettings, type ClackSettings } from '@clack/core';\n\nconst unicode = isUnicodeSupported();\nconst s = (c: string, fallback: string) => (unicode ? c : fallback);\nconst S_STEP_ACTIVE = s('◆', '*');\nconst S_STEP_CANCEL = s('■', 'x');\nconst S_STEP_ERROR = s('▲', 'x');\nconst S_STEP_SUBMIT = s('◇', 'o');\n\nconst S_BAR_START = s('┌', 'T');\nconst S_BAR = s('│', '|');\nconst S_BAR_END = s('└', '—');\n\nconst S_RADIO_ACTIVE = s('●', '>');\nconst S_RADIO_INACTIVE = s('○', ' ');\nconst S_CHECKBOX_ACTIVE = s('◻', '[•]');\nconst S_CHECKBOX_SELECTED = s('◼', '[+]');\nconst S_CHECKBOX_INACTIVE = s('◻', '[ ]');\nconst S_PASSWORD_MASK = s('▪', '•');\n\nconst S_BAR_H = s('─', '-');\nconst S_CORNER_TOP_RIGHT = s('╮', '+');\nconst S_CONNECT_LEFT = s('├', '+');\nconst S_CORNER_BOTTOM_RIGHT = s('╯', '+');\n\nconst S_INFO = s('●', '•');\nconst S_SUCCESS = s('◆', '*');\nconst S_WARN = s('▲', '!');\nconst S_ERROR = s('■', 'x');\n\nconst symbol = (state: State) => {\n\tswitch (state) {\n\t\tcase 'initial':\n\t\tcase 'active':\n\t\t\treturn color.cyan(S_STEP_ACTIVE);\n\t\tcase 'cancel':\n\t\t\treturn color.red(S_STEP_CANCEL);\n\t\tcase 'error':\n\t\t\treturn color.yellow(S_STEP_ERROR);\n\t\tcase 'submit':\n\t\t\treturn color.green(S_STEP_SUBMIT);\n\t}\n};\n\ninterface LimitOptionsParams<TOption> {\n\toptions: TOption[];\n\tmaxItems: number | undefined;\n\tcursor: number;\n\tstyle: (option: TOption, active: boolean) => string;\n}\n\nconst limitOptions = <TOption>(params: LimitOptionsParams<TOption>): string[] => {\n\tconst { cursor, options, style } = params;\n\n\tconst paramMaxItems = params.maxItems ?? Number.POSITIVE_INFINITY;\n\tconst outputMaxItems = Math.max(process.stdout.rows - 4, 0);\n\t// We clamp to minimum 5 because anything less doesn't make sense UX wise\n\tconst maxItems = Math.min(outputMaxItems, Math.max(paramMaxItems, 5));\n\tlet slidingWindowLocation = 0;\n\n\tif (cursor >= slidingWindowLocation + maxItems - 3) {\n\t\tslidingWindowLocation = Math.max(Math.min(cursor - maxItems + 3, options.length - maxItems), 0);\n\t} else if (cursor < slidingWindowLocation + 2) {\n\t\tslidingWindowLocation = Math.max(cursor - 2, 0);\n\t}\n\n\tconst shouldRenderTopEllipsis = maxItems < options.length && slidingWindowLocation > 0;\n\tconst shouldRenderBottomEllipsis =\n\t\tmaxItems < options.length && slidingWindowLocation + maxItems < options.length;\n\n\treturn options\n\t\t.slice(slidingWindowLocation, slidingWindowLocation + maxItems)\n\t\t.map((option, i, arr) => {\n\t\t\tconst isTopLimit = i === 0 && shouldRenderTopEllipsis;\n\t\t\tconst isBottomLimit = i === arr.length - 1 && shouldRenderBottomEllipsis;\n\t\t\treturn isTopLimit || isBottomLimit\n\t\t\t\t? color.dim('...')\n\t\t\t\t: style(option, i + slidingWindowLocation === cursor);\n\t\t});\n};\n\nexport interface TextOptions {\n\tmessage: string;\n\tplaceholder?: string;\n\tdefaultValue?: string;\n\tinitialValue?: string;\n\tvalidate?: (value: string) => string | Error | undefined;\n}\nexport const text = (opts: TextOptions) => {\n\treturn new TextPrompt({\n\t\tvalidate: opts.validate,\n\t\tplaceholder: opts.placeholder,\n\t\tdefaultValue: opts.defaultValue,\n\t\tinitialValue: opts.initialValue,\n\t\trender() {\n\t\t\tconst title = `${color.gray(S_BAR)}\\n${symbol(this.state)} ${opts.message}\\n`;\n\t\t\tconst placeholder = opts.placeholder\n\t\t\t\t? color.inverse(opts.placeholder[0]) + color.dim(opts.placeholder.slice(1))\n\t\t\t\t: color.inverse(color.hidden('_'));\n\t\t\tconst value = !this.value ? placeholder : this.valueWithCursor;\n\n\t\t\tswitch (this.state) {\n\t\t\t\tcase 'error':\n\t\t\t\t\treturn `${title.trim()}\\n${color.yellow(S_BAR)} ${value}\\n${color.yellow(\n\t\t\t\t\t\tS_BAR_END\n\t\t\t\t\t)} ${color.yellow(this.error)}\\n`;\n\t\t\t\tcase 'submit':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${color.dim(this.value || opts.placeholder)}`;\n\t\t\t\tcase 'cancel':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${color.strikethrough(\n\t\t\t\t\t\tcolor.dim(this.value ?? '')\n\t\t\t\t\t)}${this.value?.trim() ? `\\n${color.gray(S_BAR)}` : ''}`;\n\t\t\t\tdefault:\n\t\t\t\t\treturn `${title}${color.cyan(S_BAR)} ${value}\\n${color.cyan(S_BAR_END)}\\n`;\n\t\t\t}\n\t\t},\n\t}).prompt() as Promise<string | symbol>;\n};\n\nexport interface PasswordOptions {\n\tmessage: string;\n\tmask?: string;\n\tvalidate?: (value: string) => string | Error | undefined;\n}\nexport const password = (opts: PasswordOptions) => {\n\treturn new PasswordPrompt({\n\t\tvalidate: opts.validate,\n\t\tmask: opts.mask ?? S_PASSWORD_MASK,\n\t\trender() {\n\t\t\tconst title = `${color.gray(S_BAR)}\\n${symbol(this.state)} ${opts.message}\\n`;\n\t\t\tconst value = this.valueWithCursor;\n\t\t\tconst masked = this.masked;\n\n\t\t\tswitch (this.state) {\n\t\t\t\tcase 'error':\n\t\t\t\t\treturn `${title.trim()}\\n${color.yellow(S_BAR)} ${masked}\\n${color.yellow(\n\t\t\t\t\t\tS_BAR_END\n\t\t\t\t\t)} ${color.yellow(this.error)}\\n`;\n\t\t\t\tcase 'submit':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${color.dim(masked)}`;\n\t\t\t\tcase 'cancel':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${color.strikethrough(color.dim(masked ?? ''))}${\n\t\t\t\t\t\tmasked ? `\\n${color.gray(S_BAR)}` : ''\n\t\t\t\t\t}`;\n\t\t\t\tdefault:\n\t\t\t\t\treturn `${title}${color.cyan(S_BAR)} ${value}\\n${color.cyan(S_BAR_END)}\\n`;\n\t\t\t}\n\t\t},\n\t}).prompt() as Promise<string | symbol>;\n};\n\nexport interface ConfirmOptions {\n\tmessage: string;\n\tactive?: string;\n\tinactive?: string;\n\tinitialValue?: boolean;\n}\nexport const confirm = (opts: ConfirmOptions) => {\n\tconst active = opts.active ?? 'Yes';\n\tconst inactive = opts.inactive ?? 'No';\n\treturn new ConfirmPrompt({\n\t\tactive,\n\t\tinactive,\n\t\tinitialValue: opts.initialValue ?? true,\n\t\trender() {\n\t\t\tconst title = `${color.gray(S_BAR)}\\n${symbol(this.state)} ${opts.message}\\n`;\n\t\t\tconst value = this.value ? active : inactive;\n\n\t\t\tswitch (this.state) {\n\t\t\t\tcase 'submit':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${color.dim(value)}`;\n\t\t\t\tcase 'cancel':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${color.strikethrough(\n\t\t\t\t\t\tcolor.dim(value)\n\t\t\t\t\t)}\\n${color.gray(S_BAR)}`;\n\t\t\t\tdefault: {\n\t\t\t\t\treturn `${title}${color.cyan(S_BAR)} ${\n\t\t\t\t\t\tthis.value\n\t\t\t\t\t\t\t? `${color.green(S_RADIO_ACTIVE)} ${active}`\n\t\t\t\t\t\t\t: `${color.dim(S_RADIO_INACTIVE)} ${color.dim(active)}`\n\t\t\t\t\t} ${color.dim('/')} ${\n\t\t\t\t\t\t!this.value\n\t\t\t\t\t\t\t? `${color.green(S_RADIO_ACTIVE)} ${inactive}`\n\t\t\t\t\t\t\t: `${color.dim(S_RADIO_INACTIVE)} ${color.dim(inactive)}`\n\t\t\t\t\t}\\n${color.cyan(S_BAR_END)}\\n`;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t}).prompt() as Promise<boolean | symbol>;\n};\n\ntype Primitive = Readonly<string | boolean | number>;\n\nexport type Option<Value> = Value extends Primitive\n\t? {\n\t\t\t/**\n\t\t\t * Internal data for this option.\n\t\t\t */\n\t\t\tvalue: Value;\n\t\t\t/**\n\t\t\t * The optional, user-facing text for this option.\n\t\t\t *\n\t\t\t * By default, the `value` is converted to a string.\n\t\t\t */\n\t\t\tlabel?: string;\n\t\t\t/**\n\t\t\t * An optional hint to display to the user when\n\t\t\t * this option might be selected.\n\t\t\t *\n\t\t\t * By default, no `hint` is displayed.\n\t\t\t */\n\t\t\thint?: string;\n\t\t}\n\t: {\n\t\t\t/**\n\t\t\t * Internal data for this option.\n\t\t\t */\n\t\t\tvalue: Value;\n\t\t\t/**\n\t\t\t * Required. The user-facing text for this option.\n\t\t\t */\n\t\t\tlabel: string;\n\t\t\t/**\n\t\t\t * An optional hint to display to the user when\n\t\t\t * this option might be selected.\n\t\t\t *\n\t\t\t * By default, no `hint` is displayed.\n\t\t\t */\n\t\t\thint?: string;\n\t\t};\n\nexport interface SelectOptions<Value> {\n\tmessage: string;\n\toptions: Option<Value>[];\n\tinitialValue?: Value;\n\tmaxItems?: number;\n}\n\nexport const select = <Value>(opts: SelectOptions<Value>) => {\n\tconst opt = (option: Option<Value>, state: 'inactive' | 'active' | 'selected' | 'cancelled') => {\n\t\tconst label = option.label ?? String(option.value);\n\t\tswitch (state) {\n\t\t\tcase 'selected':\n\t\t\t\treturn `${color.dim(label)}`;\n\t\t\tcase 'active':\n\t\t\t\treturn `${color.green(S_RADIO_ACTIVE)} ${label} ${\n\t\t\t\t\toption.hint ? color.dim(`(${option.hint})`) : ''\n\t\t\t\t}`;\n\t\t\tcase 'cancelled':\n\t\t\t\treturn `${color.strikethrough(color.dim(label))}`;\n\t\t\tdefault:\n\t\t\t\treturn `${color.dim(S_RADIO_INACTIVE)} ${color.dim(label)}`;\n\t\t}\n\t};\n\n\treturn new SelectPrompt({\n\t\toptions: opts.options,\n\t\tinitialValue: opts.initialValue,\n\t\trender() {\n\t\t\tconst title = `${color.gray(S_BAR)}\\n${symbol(this.state)} ${opts.message}\\n`;\n\n\t\t\tswitch (this.state) {\n\t\t\t\tcase 'submit':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${opt(this.options[this.cursor], 'selected')}`;\n\t\t\t\tcase 'cancel':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${opt(\n\t\t\t\t\t\tthis.options[this.cursor],\n\t\t\t\t\t\t'cancelled'\n\t\t\t\t\t)}\\n${color.gray(S_BAR)}`;\n\t\t\t\tdefault: {\n\t\t\t\t\treturn `${title}${color.cyan(S_BAR)} ${limitOptions({\n\t\t\t\t\t\tcursor: this.cursor,\n\t\t\t\t\t\toptions: this.options,\n\t\t\t\t\t\tmaxItems: opts.maxItems,\n\t\t\t\t\t\tstyle: (item, active) => opt(item, active ? 'active' : 'inactive'),\n\t\t\t\t\t}).join(`\\n${color.cyan(S_BAR)} `)}\\n${color.cyan(S_BAR_END)}\\n`;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t}).prompt() as Promise<Value | symbol>;\n};\n\nexport const selectKey = <Value extends string>(opts: SelectOptions<Value>) => {\n\tconst opt = (\n\t\toption: Option<Value>,\n\t\tstate: 'inactive' | 'active' | 'selected' | 'cancelled' = 'inactive'\n\t) => {\n\t\tconst label = option.label ?? String(option.value);\n\t\tif (state === 'selected') {\n\t\t\treturn `${color.dim(label)}`;\n\t\t}\n\t\tif (state === 'cancelled') {\n\t\t\treturn `${color.strikethrough(color.dim(label))}`;\n\t\t}\n\t\tif (state === 'active') {\n\t\t\treturn `${color.bgCyan(color.gray(` ${option.value} `))} ${label} ${\n\t\t\t\toption.hint ? color.dim(`(${option.hint})`) : ''\n\t\t\t}`;\n\t\t}\n\t\treturn `${color.gray(color.bgWhite(color.inverse(` ${option.value} `)))} ${label} ${\n\t\t\toption.hint ? color.dim(`(${option.hint})`) : ''\n\t\t}`;\n\t};\n\n\treturn new SelectKeyPrompt({\n\t\toptions: opts.options,\n\t\tinitialValue: opts.initialValue,\n\t\trender() {\n\t\t\tconst title = `${color.gray(S_BAR)}\\n${symbol(this.state)} ${opts.message}\\n`;\n\n\t\t\tswitch (this.state) {\n\t\t\t\tcase 'submit':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${opt(\n\t\t\t\t\t\tthis.options.find((opt) => opt.value === this.value) ?? opts.options[0],\n\t\t\t\t\t\t'selected'\n\t\t\t\t\t)}`;\n\t\t\t\tcase 'cancel':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${opt(this.options[0], 'cancelled')}\\n${color.gray(\n\t\t\t\t\t\tS_BAR\n\t\t\t\t\t)}`;\n\t\t\t\tdefault: {\n\t\t\t\t\treturn `${title}${color.cyan(S_BAR)} ${this.options\n\t\t\t\t\t\t.map((option, i) => opt(option, i === this.cursor ? 'active' : 'inactive'))\n\t\t\t\t\t\t.join(`\\n${color.cyan(S_BAR)} `)}\\n${color.cyan(S_BAR_END)}\\n`;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t}).prompt() as Promise<Value | symbol>;\n};\n\nexport interface MultiSelectOptions<Value> {\n\tmessage: string;\n\toptions: Option<Value>[];\n\tinitialValues?: Value[];\n\tmaxItems?: number;\n\trequired?: boolean;\n\tcursorAt?: Value;\n}\nexport const multiselect = <Value>(opts: MultiSelectOptions<Value>) => {\n\tconst opt = (\n\t\toption: Option<Value>,\n\t\tstate: 'inactive' | 'active' | 'selected' | 'active-selected' | 'submitted' | 'cancelled'\n\t) => {\n\t\tconst label = option.label ?? String(option.value);\n\t\tif (state === 'active') {\n\t\t\treturn `${color.cyan(S_CHECKBOX_ACTIVE)} ${label} ${\n\t\t\t\toption.hint ? color.dim(`(${option.hint})`) : ''\n\t\t\t}`;\n\t\t}\n\t\tif (state === 'selected') {\n\t\t\treturn `${color.green(S_CHECKBOX_SELECTED)} ${color.dim(label)}`;\n\t\t}\n\t\tif (state === 'cancelled') {\n\t\t\treturn `${color.strikethrough(color.dim(label))}`;\n\t\t}\n\t\tif (state === 'active-selected') {\n\t\t\treturn `${color.green(S_CHECKBOX_SELECTED)} ${label} ${\n\t\t\t\toption.hint ? color.dim(`(${option.hint})`) : ''\n\t\t\t}`;\n\t\t}\n\t\tif (state === 'submitted') {\n\t\t\treturn `${color.dim(label)}`;\n\t\t}\n\t\treturn `${color.dim(S_CHECKBOX_INACTIVE)} ${color.dim(label)}`;\n\t};\n\n\treturn new MultiSelectPrompt({\n\t\toptions: opts.options,\n\t\tinitialValues: opts.initialValues,\n\t\trequired: opts.required ?? true,\n\t\tcursorAt: opts.cursorAt,\n\t\tvalidate(selected: Value[]) {\n\t\t\tif (this.required && selected.length === 0)\n\t\t\t\treturn `Please select at least one option.\\n${color.reset(\n\t\t\t\t\tcolor.dim(\n\t\t\t\t\t\t`Press ${color.gray(color.bgWhite(color.inverse(' space ')))} to select, ${color.gray(\n\t\t\t\t\t\t\tcolor.bgWhite(color.inverse(' enter '))\n\t\t\t\t\t\t)} to submit`\n\t\t\t\t\t)\n\t\t\t\t)}`;\n\t\t},\n\t\trender() {\n\t\t\tconst title = `${color.gray(S_BAR)}\\n${symbol(this.state)} ${opts.message}\\n`;\n\n\t\t\tconst styleOption = (option: Option<Value>, active: boolean) => {\n\t\t\t\tconst selected = this.value.includes(option.value);\n\t\t\t\tif (active && selected) {\n\t\t\t\t\treturn opt(option, 'active-selected');\n\t\t\t\t}\n\t\t\t\tif (selected) {\n\t\t\t\t\treturn opt(option, 'selected');\n\t\t\t\t}\n\t\t\t\treturn opt(option, active ? 'active' : 'inactive');\n\t\t\t};\n\n\t\t\tswitch (this.state) {\n\t\t\t\tcase 'submit': {\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${\n\t\t\t\t\t\tthis.options\n\t\t\t\t\t\t\t.filter(({ value }) => this.value.includes(value))\n\t\t\t\t\t\t\t.map((option) => opt(option, 'submitted'))\n\t\t\t\t\t\t\t.join(color.dim(', ')) || color.dim('none')\n\t\t\t\t\t}`;\n\t\t\t\t}\n\t\t\t\tcase 'cancel': {\n\t\t\t\t\tconst label = this.options\n\t\t\t\t\t\t.filter(({ value }) => this.value.includes(value))\n\t\t\t\t\t\t.map((option) => opt(option, 'cancelled'))\n\t\t\t\t\t\t.join(color.dim(', '));\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${\n\t\t\t\t\t\tlabel.trim() ? `${label}\\n${color.gray(S_BAR)}` : ''\n\t\t\t\t\t}`;\n\t\t\t\t}\n\t\t\t\tcase 'error': {\n\t\t\t\t\tconst footer = this.error\n\t\t\t\t\t\t.split('\\n')\n\t\t\t\t\t\t.map((ln, i) =>\n\t\t\t\t\t\t\ti === 0 ? `${color.yellow(S_BAR_END)} ${color.yellow(ln)}` : ` ${ln}`\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.join('\\n');\n\t\t\t\t\treturn `${title + color.yellow(S_BAR)} ${limitOptions({\n\t\t\t\t\t\toptions: this.options,\n\t\t\t\t\t\tcursor: this.cursor,\n\t\t\t\t\t\tmaxItems: opts.maxItems,\n\t\t\t\t\t\tstyle: styleOption,\n\t\t\t\t\t}).join(`\\n${color.yellow(S_BAR)} `)}\\n${footer}\\n`;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\treturn `${title}${color.cyan(S_BAR)} ${limitOptions({\n\t\t\t\t\t\toptions: this.options,\n\t\t\t\t\t\tcursor: this.cursor,\n\t\t\t\t\t\tmaxItems: opts.maxItems,\n\t\t\t\t\t\tstyle: styleOption,\n\t\t\t\t\t}).join(`\\n${color.cyan(S_BAR)} `)}\\n${color.cyan(S_BAR_END)}\\n`;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t}).prompt() as Promise<Value[] | symbol>;\n};\n\nexport interface GroupMultiSelectOptions<Value> {\n\tmessage: string;\n\toptions: Record<string, Option<Value>[]>;\n\tinitialValues?: Value[];\n\trequired?: boolean;\n\tcursorAt?: Value;\n}\nexport const groupMultiselect = <Value>(opts: GroupMultiSelectOptions<Value>) => {\n\tconst opt = (\n\t\toption: Option<Value>,\n\t\tstate:\n\t\t\t| 'inactive'\n\t\t\t| 'active'\n\t\t\t| 'selected'\n\t\t\t| 'active-selected'\n\t\t\t| 'group-active'\n\t\t\t| 'group-active-selected'\n\t\t\t| 'submitted'\n\t\t\t| 'cancelled',\n\t\toptions: Option<Value>[] = []\n\t) => {\n\t\tconst label = option.label ?? String(option.value);\n\t\tconst isItem = typeof (option as any).group === 'string';\n\t\tconst next = isItem && (options[options.indexOf(option) + 1] ?? { group: true });\n\t\tconst isLast = isItem && (next as any).group === true;\n\t\tconst prefix = isItem ? `${isLast ? S_BAR_END : S_BAR} ` : '';\n\n\t\tif (state === 'active') {\n\t\t\treturn `${color.dim(prefix)}${color.cyan(S_CHECKBOX_ACTIVE)} ${label} ${\n\t\t\t\toption.hint ? color.dim(`(${option.hint})`) : ''\n\t\t\t}`;\n\t\t}\n\t\tif (state === 'group-active') {\n\t\t\treturn `${prefix}${color.cyan(S_CHECKBOX_ACTIVE)} ${color.dim(label)}`;\n\t\t}\n\t\tif (state === 'group-active-selected') {\n\t\t\treturn `${prefix}${color.green(S_CHECKBOX_SELECTED)} ${color.dim(label)}`;\n\t\t}\n\t\tif (state === 'selected') {\n\t\t\treturn `${color.dim(prefix)}${color.green(S_CHECKBOX_SELECTED)} ${color.dim(label)}`;\n\t\t}\n\t\tif (state === 'cancelled') {\n\t\t\treturn `${color.strikethrough(color.dim(label))}`;\n\t\t}\n\t\tif (state === 'active-selected') {\n\t\t\treturn `${color.dim(prefix)}${color.green(S_CHECKBOX_SELECTED)} ${label} ${\n\t\t\t\toption.hint ? color.dim(`(${option.hint})`) : ''\n\t\t\t}`;\n\t\t}\n\t\tif (state === 'submitted') {\n\t\t\treturn `${color.dim(label)}`;\n\t\t}\n\t\treturn `${color.dim(prefix)}${color.dim(S_CHECKBOX_INACTIVE)} ${color.dim(label)}`;\n\t};\n\n\treturn new GroupMultiSelectPrompt({\n\t\toptions: opts.options,\n\t\tinitialValues: opts.initialValues,\n\t\trequired: opts.required ?? true,\n\t\tcursorAt: opts.cursorAt,\n\t\tvalidate(selected: Value[]) {\n\t\t\tif (this.required && selected.length === 0)\n\t\t\t\treturn `Please select at least one option.\\n${color.reset(\n\t\t\t\t\tcolor.dim(\n\t\t\t\t\t\t`Press ${color.gray(color.bgWhite(color.inverse(' space ')))} to select, ${color.gray(\n\t\t\t\t\t\t\tcolor.bgWhite(color.inverse(' enter '))\n\t\t\t\t\t\t)} to submit`\n\t\t\t\t\t)\n\t\t\t\t)}`;\n\t\t},\n\t\trender() {\n\t\t\tconst title = `${color.gray(S_BAR)}\\n${symbol(this.state)} ${opts.message}\\n`;\n\n\t\t\tswitch (this.state) {\n\t\t\t\tcase 'submit': {\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${this.options\n\t\t\t\t\t\t.filter(({ value }) => this.value.includes(value))\n\t\t\t\t\t\t.map((option) => opt(option, 'submitted'))\n\t\t\t\t\t\t.join(color.dim(', '))}`;\n\t\t\t\t}\n\t\t\t\tcase 'cancel': {\n\t\t\t\t\tconst label = this.options\n\t\t\t\t\t\t.filter(({ value }) => this.value.includes(value))\n\t\t\t\t\t\t.map((option) => opt(option, 'cancelled'))\n\t\t\t\t\t\t.join(color.dim(', '));\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${\n\t\t\t\t\t\tlabel.trim() ? `${label}\\n${color.gray(S_BAR)}` : ''\n\t\t\t\t\t}`;\n\t\t\t\t}\n\t\t\t\tcase 'error': {\n\t\t\t\t\tconst footer = this.error\n\t\t\t\t\t\t.split('\\n')\n\t\t\t\t\t\t.map((ln, i) =>\n\t\t\t\t\t\t\ti === 0 ? `${color.yellow(S_BAR_END)} ${color.yellow(ln)}` : ` ${ln}`\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.join('\\n');\n\t\t\t\t\treturn `${title}${color.yellow(S_BAR)} ${this.options\n\t\t\t\t\t\t.map((option, i, options) => {\n\t\t\t\t\t\t\tconst selected =\n\t\t\t\t\t\t\t\tthis.value.includes(option.value) ||\n\t\t\t\t\t\t\t\t(option.group === true && this.isGroupSelected(`${option.value}`));\n\t\t\t\t\t\t\tconst active = i === this.cursor;\n\t\t\t\t\t\t\tconst groupActive =\n\t\t\t\t\t\t\t\t!active &&\n\t\t\t\t\t\t\t\ttypeof option.group === 'string' &&\n\t\t\t\t\t\t\t\tthis.options[this.cursor].value === option.group;\n\t\t\t\t\t\t\tif (groupActive) {\n\t\t\t\t\t\t\t\treturn opt(option, selected ? 'group-active-selected' : 'group-active', options);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (active && selected) {\n\t\t\t\t\t\t\t\treturn opt(option, 'active-selected', options);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (selected) {\n\t\t\t\t\t\t\t\treturn opt(option, 'selected', options);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn opt(option, active ? 'active' : 'inactive', options);\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.join(`\\n${color.yellow(S_BAR)} `)}\\n${footer}\\n`;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\treturn `${title}${color.cyan(S_BAR)} ${this.options\n\t\t\t\t\t\t.map((option, i, options) => {\n\t\t\t\t\t\t\tconst selected =\n\t\t\t\t\t\t\t\tthis.value.includes(option.value) ||\n\t\t\t\t\t\t\t\t(option.group === true && this.isGroupSelected(`${option.value}`));\n\t\t\t\t\t\t\tconst active = i === this.cursor;\n\t\t\t\t\t\t\tconst groupActive =\n\t\t\t\t\t\t\t\t!active &&\n\t\t\t\t\t\t\t\ttypeof option.group === 'string' &&\n\t\t\t\t\t\t\t\tthis.options[this.cursor].value === option.group;\n\t\t\t\t\t\t\tif (groupActive) {\n\t\t\t\t\t\t\t\treturn opt(option, selected ? 'group-active-selected' : 'group-active', options);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (active && selected) {\n\t\t\t\t\t\t\t\treturn opt(option, 'active-selected', options);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (selected) {\n\t\t\t\t\t\t\t\treturn opt(option, 'selected', options);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn opt(option, active ? 'active' : 'inactive', options);\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.join(`\\n${color.cyan(S_BAR)} `)}\\n${color.cyan(S_BAR_END)}\\n`;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t}).prompt() as Promise<Value[] | symbol>;\n};\n\nexport const note = (message = '', title = '') => {\n\tconst lines = `\\n${message}\\n`.split('\\n');\n\tconst titleLen = strip(title).length;\n\tconst len =\n\t\tMath.max(\n\t\t\tlines.reduce((sum, ln) => {\n\t\t\t\tconst line = strip(ln);\n\t\t\t\treturn line.length > sum ? line.length : sum;\n\t\t\t}, 0),\n\t\t\ttitleLen\n\t\t) + 2;\n\tconst msg = lines\n\t\t.map(\n\t\t\t(ln) =>\n\t\t\t\t`${color.gray(S_BAR)} ${color.dim(ln)}${' '.repeat(len - strip(ln).length)}${color.gray(\n\t\t\t\t\tS_BAR\n\t\t\t\t)}`\n\t\t)\n\t\t.join('\\n');\n\tprocess.stdout.write(\n\t\t`${color.gray(S_BAR)}\\n${color.green(S_STEP_SUBMIT)} ${color.reset(title)} ${color.gray(\n\t\t\tS_BAR_H.repeat(Math.max(len - titleLen - 1, 1)) + S_CORNER_TOP_RIGHT\n\t\t)}\\n${msg}\\n${color.gray(S_CONNECT_LEFT + S_BAR_H.repeat(len + 2) + S_CORNER_BOTTOM_RIGHT)}\\n`\n\t);\n};\n\nexport const cancel = (message = '') => {\n\tprocess.stdout.write(`${color.gray(S_BAR_END)} ${color.red(message)}\\n\\n`);\n};\n\nexport const intro = (title = '') => {\n\tprocess.stdout.write(`${color.gray(S_BAR_START)} ${title}\\n`);\n};\n\nexport const outro = (message = '') => {\n\tprocess.stdout.write(`${color.gray(S_BAR)}\\n${color.gray(S_BAR_END)} ${message}\\n\\n`);\n};\n\nexport type LogMessageOptions = {\n\tsymbol?: string;\n};\nexport const log = {\n\tmessage: (message = '', { symbol = color.gray(S_BAR) }: LogMessageOptions = {}) => {\n\t\tconst parts = [`${color.gray(S_BAR)}`];\n\t\tif (message) {\n\t\t\tconst [firstLine, ...lines] = message.split('\\n');\n\t\t\tparts.push(`${symbol} ${firstLine}`, ...lines.map((ln) => `${color.gray(S_BAR)} ${ln}`));\n\t\t}\n\t\tprocess.stdout.write(`${parts.join('\\n')}\\n`);\n\t},\n\tinfo: (message: string) => {\n\t\tlog.message(message, { symbol: color.blue(S_INFO) });\n\t},\n\tsuccess: (message: string) => {\n\t\tlog.message(message, { symbol: color.green(S_SUCCESS) });\n\t},\n\tstep: (message: string) => {\n\t\tlog.message(message, { symbol: color.green(S_STEP_SUBMIT) });\n\t},\n\twarn: (message: string) => {\n\t\tlog.message(message, { symbol: color.yellow(S_WARN) });\n\t},\n\t/** alias for `log.warn()`. */\n\twarning: (message: string) => {\n\t\tlog.warn(message);\n\t},\n\terror: (message: string) => {\n\t\tlog.message(message, { symbol: color.red(S_ERROR) });\n\t},\n};\n\nexport const spinner = () => {\n\tconst frames = unicode ? ['◒', '◐', '◓', '◑'] : ['•', 'o', 'O', '0'];\n\tconst delay = unicode ? 80 : 120;\n\tconst isCI = process.env.CI === 'true';\n\n\tlet unblock: () => void;\n\tlet loop: NodeJS.Timeout;\n\tlet isSpinnerActive = false;\n\tlet _message = '';\n\tlet _prevMessage: string | undefined = undefined;\n\n\tconst handleExit = (code: number) => {\n\t\tconst msg = code > 1 ? 'Something went wrong' : 'Canceled';\n\t\tif (isSpinnerActive) stop(msg, code);\n\t};\n\n\tconst errorEventHandler = () => handleExit(2);\n\tconst signalEventHandler = () => handleExit(1);\n\n\tconst registerHooks = () => {\n\t\t// Reference: https://nodejs.org/api/process.html#event-uncaughtexception\n\t\tprocess.on('uncaughtExceptionMonitor', errorEventHandler);\n\t\t// Reference: https://nodejs.org/api/process.html#event-unhandledrejection\n\t\tprocess.on('unhandledRejection', errorEventHandler);\n\t\t// Reference Signal Events: https://nodejs.org/api/process.html#signal-events\n\t\tprocess.on('SIGINT', signalEventHandler);\n\t\tprocess.on('SIGTERM', signalEventHandler);\n\t\tprocess.on('exit', handleExit);\n\t};\n\n\tconst clearHooks = () => {\n\t\tprocess.removeListener('uncaughtExceptionMonitor', errorEventHandler);\n\t\tprocess.removeListener('unhandledRejection', errorEventHandler);\n\t\tprocess.removeListener('SIGINT', signalEventHandler);\n\t\tprocess.removeListener('SIGTERM', signalEventHandler);\n\t\tprocess.removeListener('exit', handleExit);\n\t};\n\n\tconst clearPrevMessage = () => {\n\t\tif (_prevMessage === undefined) return;\n\t\tif (isCI) process.stdout.write('\\n');\n\t\tconst prevLines = _prevMessage.split('\\n');\n\t\tprocess.stdout.write(cursor.move(-999, prevLines.length - 1));\n\t\tprocess.stdout.write(erase.down(prevLines.length));\n\t};\n\n\tconst parseMessage = (msg: string): string => {\n\t\treturn msg.replace(/\\.+$/, '');\n\t};\n\n\tconst start = (msg = ''): void => {\n\t\tisSpinnerActive = true;\n\t\tunblock = block();\n\t\t_message = parseMessage(msg);\n\t\tprocess.stdout.write(`${color.gray(S_BAR)}\\n`);\n\t\tlet frameIndex = 0;\n\t\tlet dotsTimer = 0;\n\t\tregisterHooks();\n\t\tloop = setInterval(() => {\n\t\t\tif (isCI && _message === _prevMessage) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tclearPrevMessage();\n\t\t\t_prevMessage = _message;\n\t\t\tconst frame = color.magenta(frames[frameIndex]);\n\t\t\tconst loadingDots = isCI ? '...' : '.'.repeat(Math.floor(dotsTimer)).slice(0, 3);\n\t\t\tprocess.stdout.write(`${frame} ${_message}${loadingDots}`);\n\t\t\tframeIndex = frameIndex + 1 < frames.length ? frameIndex + 1 : 0;\n\t\t\tdotsTimer = dotsTimer < frames.length ? dotsTimer + 0.125 : 0;\n\t\t}, delay);\n\t};\n\n\tconst stop = (msg = '', code = 0): void => {\n\t\tisSpinnerActive = false;\n\t\tclearInterval(loop);\n\t\tclearPrevMessage();\n\t\tconst step =\n\t\t\tcode === 0\n\t\t\t\t? color.green(S_STEP_SUBMIT)\n\t\t\t\t: code === 1\n\t\t\t\t\t? color.red(S_STEP_CANCEL)\n\t\t\t\t\t: color.red(S_STEP_ERROR);\n\t\t_message = parseMessage(msg ?? _message);\n\t\tprocess.stdout.write(`${step} ${_message}\\n`);\n\t\tclearHooks();\n\t\tunblock();\n\t};\n\n\tconst message = (msg = ''): void => {\n\t\t_message = parseMessage(msg ?? _message);\n\t};\n\n\treturn {\n\t\tstart,\n\t\tstop,\n\t\tmessage,\n\t};\n};\n\nexport type PromptGroupAwaitedReturn<T> = {\n\t[P in keyof T]: Exclude<Awaited<T[P]>, symbol>;\n};\n\nexport interface PromptGroupOptions<T> {\n\t/**\n\t * Control how the group can be canceled\n\t * if one of the prompts is canceled.\n\t */\n\tonCancel?: (opts: { results: Prettify<Partial<PromptGroupAwaitedReturn<T>>> }) => void;\n}\n\ntype Prettify<T> = {\n\t[P in keyof T]: T[P];\n} & {};\n\nexport type PromptGroup<T> = {\n\t[P in keyof T]: (opts: {\n\t\tresults: Prettify<Partial<PromptGroupAwaitedReturn<Omit<T, P>>>>;\n\t}) => undefined | Promise<T[P] | undefined>;\n};\n\n/**\n * Define a group of prompts to be displayed\n * and return a results of objects within the group\n */\nexport const group = async <T>(\n\tprompts: PromptGroup<T>,\n\topts?: PromptGroupOptions<T>\n): Promise<Prettify<PromptGroupAwaitedReturn<T>>> => {\n\tconst results = {} as any;\n\tconst promptNames = Object.keys(prompts);\n\n\tfor (const name of promptNames) {\n\t\tconst prompt = prompts[name as keyof T];\n\t\tconst result = await prompt({ results })?.catch((e) => {\n\t\t\tthrow e;\n\t\t});\n\n\t\t// Pass the results to the onCancel function\n\t\t// so the user can decide what to do with the results\n\t\t// TODO: Switch to callback within core to avoid isCancel Fn\n\t\tif (typeof opts?.onCancel === 'function' && isCancel(result)) {\n\t\t\tresults[name] = 'canceled';\n\t\t\topts.onCancel({ results });\n\t\t\tcontinue;\n\t\t}\n\n\t\tresults[name] = result;\n\t}\n\n\treturn results;\n};\n\nexport type Task = {\n\t/**\n\t * Task title\n\t */\n\ttitle: string;\n\t/**\n\t * Task function\n\t */\n\ttask: (message: (string: string) => void) => string | Promise<string> | void | Promise<void>;\n\n\t/**\n\t * If enabled === false the task will be skipped\n\t */\n\tenabled?: boolean;\n};\n\n/**\n * Define a group of tasks to be executed\n */\nexport const tasks = async (tasks: Task[]) => {\n\tfor (const task of tasks) {\n\t\tif (task.enabled === false) continue;\n\n\t\tconst s = spinner();\n\t\ts.start(task.title);\n\t\tconst result = await task.task(s.message);\n\t\ts.stop(result || task.title);\n\t}\n};\n","export const TAILWIND_V3_CONFIG = `import type { Config } from 'tailwindcss';\nimport exemPlugin from '@exem-ui/tailwindcss3/plugin';\n\nconst config: Config = {\n darkMode: 'class',\n plugins: [exemPlugin],\n content: [\n './src/**/*.{js,ts,jsx,tsx}',\n './node_modules/@exem-ui/react/dist/**/*.{js,mjs}',\n ],\n};\n\nexport default config;\n`;\n\nexport const TAILWIND_V3_MANUAL_MSG = `\nAdd the Exem UI plugin to your existing tailwind.config.ts:\n\n import exemPlugin from '@exem-ui/tailwindcss3/plugin';\n\n export default {\n darkMode: 'class',\n plugins: [exemPlugin],\n content: [\n // ... your existing content paths\n './node_modules/@exem-ui/react/dist/**/*.{js,mjs}',\n ],\n };\n\n 📖 https://ui.ex-em.com/getting-started/installation\n`;\n","export const TAILWIND_V4_IMPORT = `@import '@exem-ui/tailwindcss4';\n`;\n\nexport const TAILWIND_V4_MANUAL_MSG = `\nAdd the following import to the top of your main CSS file:\n\n @import '@exem-ui/tailwindcss4';\n`;\n","import { existsSync } from 'node:fs';\nimport { resolve } from 'node:path';\nimport type { PackageManager } from '../types';\n\nconst LOCKFILE_MAP: Record<string, PackageManager> = {\n 'pnpm-lock.yaml': 'pnpm',\n 'yarn.lock': 'yarn',\n 'package-lock.json': 'npm',\n 'bun.lockb': 'bun',\n 'bun.lock': 'bun',\n};\n\nexport function detectPackageManager(cwd: string = process.cwd()): PackageManager {\n for (const [lockfile, pm] of Object.entries(LOCKFILE_MAP)) {\n if (existsSync(resolve(cwd, lockfile))) {\n return pm;\n }\n }\n\n const userAgent = process.env.npm_config_user_agent ?? '';\n if (userAgent.startsWith('pnpm')) {\n return 'pnpm';\n }\n if (userAgent.startsWith('yarn')) {\n return 'yarn';\n }\n if (userAgent.startsWith('bun')) {\n return 'bun';\n }\n\n return 'npm';\n}\n\nexport function getInstallCommand(pm: PackageManager, packages: string[]): string {\n const pkgs = packages.join(' ');\n switch (pm) {\n case 'pnpm':\n return `pnpm add ${pkgs}`;\n case 'yarn':\n return `yarn add ${pkgs}`;\n case 'bun':\n return `bun add ${pkgs}`;\n case 'npm':\n return `npm install ${pkgs}`;\n }\n}\n\nexport function getUninstallCommand(pm: PackageManager, packages: string[]): string {\n const pkgs = packages.join(' ');\n switch (pm) {\n case 'pnpm':\n return `pnpm remove ${pkgs}`;\n case 'yarn':\n return `yarn remove ${pkgs}`;\n case 'bun':\n return `bun remove ${pkgs}`;\n case 'npm':\n return `npm uninstall ${pkgs}`;\n }\n}\n","import { existsSync, readFileSync, writeFileSync } from 'node:fs';\nimport { resolve } from 'node:path';\n\nexport function readJson<T>(filePath: string): T | null {\n try {\n const content = readFileSync(filePath, 'utf-8');\n return JSON.parse(content) as T;\n } catch {\n return null;\n }\n}\n\nexport function writeJson(filePath: string, data: unknown): void {\n writeFileSync(filePath, `${JSON.stringify(data, null, 2)}\\n`);\n}\n\nexport function fileExists(filePath: string): boolean {\n return existsSync(filePath);\n}\n\nexport function readFile(filePath: string): string | null {\n try {\n return readFileSync(filePath, 'utf-8');\n } catch {\n return null;\n }\n}\n\nexport function writeFile(filePath: string, content: string): void {\n writeFileSync(filePath, content);\n}\n\nexport function resolveFromCwd(...segments: string[]): string {\n return resolve(process.cwd(), ...segments);\n}\n\nexport function pinDistTag(packages: string[], tag: string): void {\n const pkgPath = resolveFromCwd('package.json');\n const pkg = readJson<Record<string, unknown>>(pkgPath);\n if (!pkg) {\n return;\n }\n\n const deps = (pkg.dependencies ?? {}) as Record<string, string>;\n let changed = false;\n for (const name of packages) {\n if (deps[name] && deps[name] !== tag) {\n deps[name] = tag;\n changed = true;\n }\n }\n if (changed) {\n pkg.dependencies = deps;\n writeJson(pkgPath, pkg);\n }\n}\n","import type { PackageInfo } from '../types';\n\nexport const PACKAGES: PackageInfo[] = [\n {\n name: '@exem-ui/core',\n description: 'CSS variables, design tokens, utilities, types',\n required: true,\n },\n {\n name: '@exem-ui/react',\n description: 'React UI components (20+)',\n },\n {\n name: '@exem-ui/tailwindcss3',\n description: 'Tailwind CSS v3 plugin',\n },\n {\n name: '@exem-ui/tailwindcss4',\n description: 'Tailwind CSS v4 theme',\n },\n];\n","import { init } from './commands/init';\n\nconst VERSION = '0.1.0';\n\nconst args = process.argv.slice(2);\nconst command = args[0];\n\nfunction showHelp() {\n process.stdout.write(`\n @exem-ui/cli v${VERSION}\n\n Usage: npx @exem-ui/cli [command]\n\n Commands:\n init Set up Exem UI in your project (default)\n\n Options:\n --help, -h Show this help message\n --version, -v Show version number\n\n`);\n}\n\nasync function main() {\n if (command === '--help' || command === '-h') {\n showHelp();\n return;\n }\n\n if (command === '--version' || command === '-v') {\n process.stdout.write(`${VERSION}\\n`);\n return;\n }\n\n if (!command || command === 'init') {\n await init();\n } else {\n process.stderr.write(`Unknown command: ${command}\\n`);\n showHelp();\n process.exit(1);\n }\n}\n\nmain().catch(() => {\n process.exit(1);\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAEA,QAAM,MAAM;AACZ,QAAM,MAAM,GAAG,GAAG;AAClB,QAAM,OAAO;AAEb,QAAM,SAAS;AAAA,MACb,GAAGA,IAAGC,IAAG;AACP,YAAI,CAACA,GAAG,QAAO,GAAG,GAAG,GAAGD,KAAI,CAAC;AAC7B,eAAO,GAAG,GAAG,GAAGC,KAAI,CAAC,IAAID,KAAI,CAAC;AAAA,MAChC;AAAA,MACA,KAAKA,IAAGC,IAAG;AACT,YAAI,MAAM;AAEV,YAAID,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AChB,CAAC;","names":["x","y","p","f","ansiRegex","onlyFirst","pattern","regex","stripAnsi","string","eaw","module","character","x","y","codePoint","code","stringToArray","characters","len","i","text","start","end","result","eawLen","chars","char","charLen","emojiRegex","stringWidth","options","ambiguousCharacterWidth","width","eastAsianWidth","ANSI_BACKGROUND_OFFSET","wrapAnsi16","offset","wrapAnsi256","wrapAnsi16m","red","green","blue","styles","foregroundColorNames","backgroundColorNames","assembleStyles","codes","groupName","group","styleName","style","hex","matches","colorString","integer","remainder","value","ansiStyles","ESCAPES","END_CODE","ANSI_ESCAPE_BELL","ANSI_CSI","ANSI_OSC","ANSI_SGR_TERMINATOR","ANSI_ESCAPE_LINK","wrapAnsiCode","wrapAnsiHyperlink","uri","wordLengths","wrapWord","rows","word","columns","isInsideEscape","isInsideLinkEscape","visible","index","characterLength","stringVisibleTrimSpacesRight","words","last","exec","returnValue","escapeCode","escapeUrl","lengths","rowLength","remainingColumns","breaksStartingThisLine","row","pre","groups","wrapAnsi","line","actions","settings","isActionKey","key","action","settings","value","diffLines","a","b","aLines","bLines","diff","i","isWindows","CANCEL_SYMBOL","isCancel","setRawMode","input","block","stdin","output","stdout","overwrite","hideCursor","rl","readline","clear","data","name","sequence","str","cursor","dx","dy","v","t","e","s","Prompt","options","trackValue","__publicField","render","signal","opts","event","params","cb","cbs","cleanup","subscriber","resolve","reject","sink","WriteStream","chunk","encoding","done","char","problem","lines","wrap","frame","diffLine","erase","newLines","ConfirmPrompt","confirm","o","a","i","s","t","l","Prompt","opts","__publicField","value","char","key","allSelected","v","selected","u","SelectPrompt","Prompt","opts","__publicField","value","key","isUnicodeSupported","process","unicode","s","c","fallback","S_STEP_ACTIVE","S_STEP_CANCEL","S_STEP_ERROR","S_STEP_SUBMIT","S_BAR_START","S_BAR","S_BAR_END","S_RADIO_ACTIVE","S_RADIO_INACTIVE","S_CHECKBOX_ACTIVE","S_CHECKBOX_SELECTED","S_CHECKBOX_INACTIVE","S_PASSWORD_MASK","S_BAR_H","S_CORNER_TOP_RIGHT","S_CONNECT_LEFT","S_CORNER_BOTTOM_RIGHT","S_INFO","S_SUCCESS","S_WARN","S_ERROR","symbol","state","color","limitOptions","params","cursor","options","style","paramMaxItems","outputMaxItems","maxItems","slidingWindowLocation","shouldRenderTopEllipsis","shouldRenderBottomEllipsis","option","i","arr","isTopLimit","isBottomLimit","confirm","opts","active","inactive","ConfirmPrompt","title","color","S_BAR","symbol","value","S_RADIO_ACTIVE","S_RADIO_INACTIVE","S_BAR_END","select","opt","option","state","label","SelectPrompt","limitOptions","item","multiselect","opts","opt","option","state","label","color","S_CHECKBOX_ACTIVE","S_CHECKBOX_SELECTED","S_CHECKBOX_INACTIVE","MultiSelectPrompt","selected","title","S_BAR","symbol","styleOption","active","value","footer","ln","i","S_BAR_END","limitOptions","cancel","message","color","S_BAR_END","intro","title","S_BAR_START","outro","S_BAR","log","symbol","parts","firstLine","lines","ln","S_INFO","S_SUCCESS","S_STEP_SUBMIT","S_WARN","S_ERROR","spinner","frames","unicode","delay","isCI","unblock","loop","isSpinnerActive","_message","_prevMessage","handleExit","code","msg","stop","errorEventHandler","signalEventHandler","registerHooks","clearHooks","clearPrevMessage","prevLines","cursor","erase","parseMessage","start","block","frameIndex","dotsTimer","frame","loadingDots","step","S_STEP_CANCEL","S_STEP_ERROR","import_picocolors","existsSync","resolve","pc","v","L","p"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exem-ui/cli",
3
- "version": "0.3.2",
3
+ "version": "0.3.3-next.20260326004724",
4
4
  "description": "CLI for setting up Exem UI in your project",
5
5
  "author": "Exem Design Team",
6
6
  "license": "Apache-2.0",