varlock 0.7.1 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/dist/auto-load.js +2 -2
  2. package/dist/chunk-3I5FHXMJ.js +162 -0
  3. package/dist/chunk-3I5FHXMJ.js.map +1 -0
  4. package/dist/{chunk-EQGPMXDI.js → chunk-3LT4WWHG.js} +6 -5
  5. package/dist/chunk-3LT4WWHG.js.map +1 -0
  6. package/dist/{chunk-UGUCGDKH.js → chunk-AJCLNVYI.js} +6 -5
  7. package/dist/chunk-AJCLNVYI.js.map +1 -0
  8. package/dist/chunk-AKWP77PS.js +387 -0
  9. package/dist/chunk-AKWP77PS.js.map +1 -0
  10. package/dist/{chunk-GCEP6UVQ.js → chunk-BIIYEXRU.js} +4 -4
  11. package/dist/{chunk-GCEP6UVQ.js.map → chunk-BIIYEXRU.js.map} +1 -1
  12. package/dist/chunk-CHQDS2PI.js +138 -0
  13. package/dist/chunk-CHQDS2PI.js.map +1 -0
  14. package/dist/chunk-D5YM4IWS.js +79 -0
  15. package/dist/chunk-D5YM4IWS.js.map +1 -0
  16. package/dist/{chunk-WHSHSZQR.js → chunk-EBOBYFMY.js} +4 -4
  17. package/dist/{chunk-WHSHSZQR.js.map → chunk-EBOBYFMY.js.map} +1 -1
  18. package/dist/{chunk-4KSIULUK.js → chunk-EPWHAD6X.js} +5 -4
  19. package/dist/chunk-EPWHAD6X.js.map +1 -0
  20. package/dist/{chunk-B6SVDIAN.js → chunk-G2GPGCAP.js} +1435 -202
  21. package/dist/chunk-G2GPGCAP.js.map +1 -0
  22. package/dist/chunk-GXNQVEXD.js +15 -0
  23. package/dist/chunk-GXNQVEXD.js.map +1 -0
  24. package/dist/{chunk-BEV4WCAI.js → chunk-GYK3QFZB.js} +8 -4
  25. package/dist/chunk-GYK3QFZB.js.map +1 -0
  26. package/dist/{chunk-TQDVHRUW.js → chunk-LQ25CRHF.js} +7 -136
  27. package/dist/chunk-LQ25CRHF.js.map +1 -0
  28. package/dist/{chunk-4MCJ5H6K.js → chunk-MOXREUY6.js} +3 -3
  29. package/dist/{chunk-4MCJ5H6K.js.map → chunk-MOXREUY6.js.map} +1 -1
  30. package/dist/chunk-N5O4Z32O.js +74 -0
  31. package/dist/chunk-N5O4Z32O.js.map +1 -0
  32. package/dist/{chunk-MC4SUVBY.js → chunk-P4WZ2JXY.js} +5 -5
  33. package/dist/{chunk-MC4SUVBY.js.map → chunk-P4WZ2JXY.js.map} +1 -1
  34. package/dist/{chunk-WKQ6WUA7.js → chunk-TY6CHCQK.js} +6 -5
  35. package/dist/chunk-TY6CHCQK.js.map +1 -0
  36. package/dist/{chunk-JTK7LTYE.js → chunk-U3UHTU2X.js} +8 -17
  37. package/dist/chunk-U3UHTU2X.js.map +1 -0
  38. package/dist/{chunk-CHWXFSUK.js → chunk-WUI34NTD.js} +5 -5
  39. package/dist/{chunk-CHWXFSUK.js.map → chunk-WUI34NTD.js.map} +1 -1
  40. package/dist/cli/cli-executable.js +177 -26
  41. package/dist/cli/cli-executable.js.map +1 -1
  42. package/dist/config-item-I7ZL2FXU.js +5 -0
  43. package/dist/{config-item-VMLNH4QK.js.map → config-item-I7ZL2FXU.js.map} +1 -1
  44. package/dist/dotenv-compat.js +2 -2
  45. package/dist/{env-graph-BI5ASRYd.d.ts → env-graph-CwJhXKDk.d.ts} +51 -1
  46. package/dist/explain.command-IQOZKKSF.js +12 -0
  47. package/dist/explain.command-IQOZKKSF.js.map +1 -0
  48. package/dist/index.d.ts +2 -2
  49. package/dist/index.js +6 -5
  50. package/dist/index.js.map +1 -1
  51. package/dist/init.command-NVADFQ55.js +12 -0
  52. package/dist/{init.command-C2WNQ4UP.js.map → init.command-NVADFQ55.js.map} +1 -1
  53. package/dist/install-plugin.command-WE66PLU2.js +11 -0
  54. package/dist/install-plugin.command-WE66PLU2.js.map +1 -0
  55. package/dist/lib/exec-sync-varlock.d.ts +7 -0
  56. package/dist/lib/exec-sync-varlock.js +1 -1
  57. package/dist/load.command-NKKZAEE5.js +12 -0
  58. package/dist/{load.command-5X3BSCLF.js.map → load.command-NKKZAEE5.js.map} +1 -1
  59. package/dist/plugin-lib.d.ts +2 -2
  60. package/dist/printenv.command-TY5KCVC3.js +12 -0
  61. package/dist/{printenv.command-XZEQ3CZB.js.map → printenv.command-TY5KCVC3.js.map} +1 -1
  62. package/dist/run.command-PI2VAO7M.js +13 -0
  63. package/dist/{run.command-FE26WTNO.js.map → run.command-PI2VAO7M.js.map} +1 -1
  64. package/dist/runtime/env.d.ts +1 -1
  65. package/dist/scan.command-YIYJ6NTJ.js +14 -0
  66. package/dist/{scan.command-2M4RN4ZP.js.map → scan.command-YIYJ6NTJ.js.map} +1 -1
  67. package/dist/telemetry.command-WYD4SOWI.js +11 -0
  68. package/dist/{telemetry.command-SPOD3GAJ.js.map → telemetry.command-WYD4SOWI.js.map} +1 -1
  69. package/dist/typegen.command-5WQGI3CE.js +12 -0
  70. package/dist/{typegen.command-RUNVYBAM.js.map → typegen.command-5WQGI3CE.js.map} +1 -1
  71. package/package.json +1 -1
  72. package/dist/chunk-4KSIULUK.js.map +0 -1
  73. package/dist/chunk-B6SVDIAN.js.map +0 -1
  74. package/dist/chunk-BEV4WCAI.js.map +0 -1
  75. package/dist/chunk-EQGPMXDI.js.map +0 -1
  76. package/dist/chunk-JMJCAFEL.js +0 -1434
  77. package/dist/chunk-JMJCAFEL.js.map +0 -1
  78. package/dist/chunk-JTK7LTYE.js.map +0 -1
  79. package/dist/chunk-K6M42GW2.js +0 -59
  80. package/dist/chunk-K6M42GW2.js.map +0 -1
  81. package/dist/chunk-TQDVHRUW.js.map +0 -1
  82. package/dist/chunk-UGUCGDKH.js.map +0 -1
  83. package/dist/chunk-WKQ6WUA7.js.map +0 -1
  84. package/dist/config-item-VMLNH4QK.js +0 -5
  85. package/dist/init.command-C2WNQ4UP.js +0 -11
  86. package/dist/load.command-5X3BSCLF.js +0 -11
  87. package/dist/printenv.command-XZEQ3CZB.js +0 -11
  88. package/dist/run.command-FE26WTNO.js +0 -12
  89. package/dist/scan.command-2M4RN4ZP.js +0 -12
  90. package/dist/telemetry.command-SPOD3GAJ.js +0 -10
  91. package/dist/typegen.command-RUNVYBAM.js +0 -11
@@ -5,79 +5,82 @@ import fs2, { access } from 'fs/promises';
5
5
  import os from 'os';
6
6
  import fs4, { accessSync, existsSync } from 'fs';
7
7
  import { exec } from 'child_process';
8
- import { promisify } from 'util';
8
+ import { styleText, promisify } from 'util';
9
9
  import { createRequire } from 'module';
10
10
  import { pathToFileURL } from 'url';
11
11
  import crypto from 'crypto';
12
12
  import https from 'https';
13
+ import N2, { stdin, stdout } from 'process';
14
+ import ot from 'readline';
15
+ import { WriteStream } from 'tty';
13
16
  import { AsyncLocalStorage } from 'async_hooks';
14
17
 
15
18
  // ../../node_modules/.bun/ansis@4.2.0/node_modules/ansis/index.cjs
16
19
  var require_ansis = __commonJS({
17
20
  "../../node_modules/.bun/ansis@4.2.0/node_modules/ansis/index.cjs"(exports$1, module) {
18
21
  var e;
19
- var t;
22
+ var t2;
20
23
  var r;
21
24
  var { defineProperty: l, setPrototypeOf: n, create: o, keys: s } = Object;
22
25
  var i = "";
23
26
  var { round: c, max: a2 } = Math;
24
27
  var p = /* @__PURE__ */ __name((e2) => {
25
- let t2 = /([a-f\d]{3,6})/i.exec(e2)?.[1], r2 = t2?.length, l2 = parseInt(6 ^ r2 ? 3 ^ r2 ? "0" : t2[0] + t2[0] + t2[1] + t2[1] + t2[2] + t2[2] : t2, 16);
28
+ let t3 = /([a-f\d]{3,6})/i.exec(e2)?.[1], r2 = t3?.length, l2 = parseInt(6 ^ r2 ? 3 ^ r2 ? "0" : t3[0] + t3[0] + t3[1] + t3[1] + t3[2] + t3[2] : t3, 16);
26
29
  return [l2 >> 16 & 255, l2 >> 8 & 255, 255 & l2];
27
30
  }, "p");
28
- var u = /* @__PURE__ */ __name((e2, t2, r2) => e2 ^ t2 || t2 ^ r2 ? 16 + 36 * c(e2 / 51) + 6 * c(t2 / 51) + c(r2 / 51) : 8 > e2 ? 16 : e2 > 248 ? 231 : c(24 * (e2 - 8) / 247) + 232, "u");
31
+ var u = /* @__PURE__ */ __name((e2, t3, r2) => e2 ^ t3 || t3 ^ r2 ? 16 + 36 * c(e2 / 51) + 6 * c(t3 / 51) + c(r2 / 51) : 8 > e2 ? 16 : e2 > 248 ? 231 : c(24 * (e2 - 8) / 247) + 232, "u");
29
32
  var d = /* @__PURE__ */ __name((e2) => {
30
- let t2, r2, l2, n2, o2;
31
- return 8 > e2 ? 30 + e2 : 16 > e2 ? e2 - 8 + 90 : (232 > e2 ? (o2 = (e2 -= 16) % 36, t2 = (e2 / 36 | 0) / 5, r2 = (o2 / 6 | 0) / 5, l2 = o2 % 6 / 5) : t2 = r2 = l2 = (10 * (e2 - 232) + 8) / 255, n2 = 2 * a2(t2, r2, l2), n2 ? 30 + (c(l2) << 2 | c(r2) << 1 | c(t2)) + (2 ^ n2 ? 0 : 60) : 30);
33
+ let t3, r2, l2, n2, o2;
34
+ return 8 > e2 ? 30 + e2 : 16 > e2 ? e2 - 8 + 90 : (232 > e2 ? (o2 = (e2 -= 16) % 36, t3 = (e2 / 36 | 0) / 5, r2 = (o2 / 6 | 0) / 5, l2 = o2 % 6 / 5) : t3 = r2 = l2 = (10 * (e2 - 232) + 8) / 255, n2 = 2 * a2(t3, r2, l2), n2 ? 30 + (c(l2) << 2 | c(r2) << 1 | c(t3)) + (2 ^ n2 ? 0 : 60) : 30);
32
35
  }, "d");
33
36
  var f = (() => {
34
- let r2 = /* @__PURE__ */ __name((e2) => o2.some(((t2) => e2.test(t2))), "r"), l2 = globalThis, n2 = l2.process ?? {}, o2 = n2.argv ?? [], i2 = n2.env ?? {}, c2 = -1;
37
+ let r2 = /* @__PURE__ */ __name((e2) => o2.some(((t3) => e2.test(t3))), "r"), l2 = globalThis, n2 = l2.process ?? {}, o2 = n2.argv ?? [], i2 = n2.env ?? {}, c2 = -1;
35
38
  try {
36
39
  e = "," + s(i2).join(",");
37
40
  } catch (e2) {
38
41
  i2 = {}, c2 = 0;
39
42
  }
40
43
  let a3 = "FORCE_COLOR", p2 = { false: 0, 0: 0, 1: 1, 2: 2, 3: 3 }[i2[a3]] ?? -1, u2 = a3 in i2 && p2 || r2(/^--color=?(true|always)?$/);
41
- return u2 && (c2 = p2), ~c2 || (c2 = ((r3, l3, n3) => (t = r3.TERM, { "24bit": 3, truecolor: 3, ansi256: 2, ansi: 1 }[r3.COLORTERM] || (r3.CI ? /,GITHUB/.test(e) ? 3 : 1 : l3 && "dumb" !== t ? n3 ? 3 : /-256/.test(t) ? 2 : 1 : 0)))(i2, !!i2.PM2_HOME || i2.NEXT_RUNTIME?.includes("edge") || !!n2.stdout?.isTTY, "win32" === n2.platform)), !p2 || i2.NO_COLOR || r2(/^--(no-color|color=(false|never))$/) ? 0 : l2.window?.chrome || u2 && !c2 ? 3 : c2;
44
+ return u2 && (c2 = p2), ~c2 || (c2 = ((r3, l3, n3) => (t2 = r3.TERM, { "24bit": 3, truecolor: 3, ansi256: 2, ansi: 1 }[r3.COLORTERM] || (r3.CI ? /,GITHUB/.test(e) ? 3 : 1 : l3 && "dumb" !== t2 ? n3 ? 3 : /-256/.test(t2) ? 2 : 1 : 0)))(i2, !!i2.PM2_HOME || i2.NEXT_RUNTIME?.includes("edge") || !!n2.stdout?.isTTY, "win32" === n2.platform)), !p2 || i2.NO_COLOR || r2(/^--(no-color|color=(false|never))$/) ? 0 : l2.window?.chrome || u2 && !c2 ? 3 : c2;
42
45
  })();
43
46
  var g = { open: i, close: i };
44
- var h = 39;
47
+ var h2 = 39;
45
48
  var b = 49;
46
- var O = {};
47
- var m = /* @__PURE__ */ __name(({ p: e2 }, { open: t2, close: l2 }) => {
49
+ var O2 = {};
50
+ var m = /* @__PURE__ */ __name(({ p: e2 }, { open: t3, close: l2 }) => {
48
51
  let o2 = /* @__PURE__ */ __name((e3, ...r2) => {
49
52
  if (!e3) {
50
- if (t2 && t2 === l2) return t2;
53
+ if (t3 && t3 === l2) return t3;
51
54
  if ((e3 ?? i) === i) return i;
52
55
  }
53
56
  let n2, s3 = e3.raw ? String.raw({ raw: e3 }, ...r2) : i + e3, c3 = o2.p, a3 = c3.o, p2 = c3.c;
54
57
  if (s3.includes("\x1B")) for (; c3; c3 = c3.p) {
55
- let { open: e4, close: t3 } = c3, r3 = t3.length, l3 = i, o3 = 0;
56
- if (r3) for (; ~(n2 = s3.indexOf(t3, o3)); o3 = n2 + r3) l3 += s3.slice(o3, n2) + e4;
58
+ let { open: e4, close: t4 } = c3, r3 = t4.length, l3 = i, o3 = 0;
59
+ if (r3) for (; ~(n2 = s3.indexOf(t4, o3)); o3 = n2 + r3) l3 += s3.slice(o3, n2) + e4;
57
60
  s3 = l3 + s3.slice(o3);
58
61
  }
59
62
  return a3 + (s3.includes("\n") ? s3.replace(/(\r?\n)/g, p2 + "$1" + a3) : s3) + p2;
60
- }, "o"), s2 = t2, c2 = l2;
61
- return e2 && (s2 = e2.o + t2, c2 = l2 + e2.c), n(o2, r), o2.p = { open: t2, close: l2, o: s2, c: c2, p: e2 }, o2.open = s2, o2.close = c2, o2;
63
+ }, "o"), s2 = t3, c2 = l2;
64
+ return e2 && (s2 = e2.o + t3, c2 = l2 + e2.c), n(o2, r), o2.p = { open: t3, close: l2, o: s2, c: c2, p: e2 }, o2.open = s2, o2.close = c2, o2;
62
65
  }, "m");
63
- var w = new (/* @__PURE__ */ __name(function e2(t2 = f) {
64
- let s2 = { Ansis: e2, level: t2, isSupported: /* @__PURE__ */ __name(() => a3, "isSupported"), strip: /* @__PURE__ */ __name((e3) => e3.replace(/[›][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, i), "strip"), extend(e3) {
65
- for (let t3 in e3) {
66
- let r2 = e3[t3], l2 = (typeof r2)[0];
67
- "s" === l2 ? (c2(t3, T(...p(r2))), c2(_2(t3), v(...p(r2)))) : c2(t3, r2, "f" === l2);
68
- }
69
- return r = o({}, O), n(s2, r), s2;
70
- } }, c2 = /* @__PURE__ */ __name((e3, t3, r2) => {
71
- O[e3] = { get() {
72
- let n2 = r2 ? (...e4) => m(this, t3(...e4)) : m(this, t3);
66
+ var w = new (/* @__PURE__ */ __name(function e2(t3 = f) {
67
+ let s2 = { Ansis: e2, level: t3, isSupported: /* @__PURE__ */ __name(() => a3, "isSupported"), strip: /* @__PURE__ */ __name((e3) => e3.replace(/[›][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, i), "strip"), extend(e3) {
68
+ for (let t4 in e3) {
69
+ let r2 = e3[t4], l2 = (typeof r2)[0];
70
+ "s" === l2 ? (c2(t4, T2(...p(r2))), c2(_3(t4), v(...p(r2)))) : c2(t4, r2, "f" === l2);
71
+ }
72
+ return r = o({}, O2), n(s2, r), s2;
73
+ } }, c2 = /* @__PURE__ */ __name((e3, t4, r2) => {
74
+ O2[e3] = { get() {
75
+ let n2 = r2 ? (...e4) => m(this, t4(...e4)) : m(this, t4);
73
76
  return l(this, e3, { value: n2 }), n2;
74
77
  } };
75
- }, "c"), a3 = t2 > 0, w2 = /* @__PURE__ */ __name((e3, t3) => a3 ? { open: `\x1B[${e3}m`, close: `\x1B[${t3}m` } : g, "w"), y = /* @__PURE__ */ __name((e3) => (t3) => e3(...p(t3)), "y"), R = /* @__PURE__ */ __name((e3, t3) => (r2, l2, n2) => w2(`${e3}8;2;${r2};${l2};${n2}`, t3), "R"), $ = /* @__PURE__ */ __name((e3, t3) => (r2, l2, n2) => w2(((e4, t4, r3) => d(u(e4, t4, r3)))(r2, l2, n2) + e3, t3), "$"), x = /* @__PURE__ */ __name((e3) => (t3, r2, l2) => e3(u(t3, r2, l2)), "x"), T = R(3, h), v = R(4, b), C = /* @__PURE__ */ __name((e3) => w2("38;5;" + e3, h), "C"), E = /* @__PURE__ */ __name((e3) => w2("48;5;" + e3, b), "E");
76
- 2 === t2 ? (T = x(C), v = x(E)) : 1 === t2 && (T = $(0, h), v = $(10, b), C = /* @__PURE__ */ __name((e3) => w2(d(e3), h), "C"), E = /* @__PURE__ */ __name((e3) => w2(d(e3) + 10, b), "E"));
77
- let M, I = { fg: C, bg: E, rgb: T, bgRgb: v, hex: y(T), bgHex: y(v), visible: g, reset: w2(0, 0), bold: w2(1, 22), dim: w2(2, 22), italic: w2(3, 23), underline: w2(4, 24), inverse: w2(7, 27), hidden: w2(8, 28), strikethrough: w2(9, 29) }, _2 = /* @__PURE__ */ __name((e3) => "bg" + e3[0].toUpperCase() + e3.slice(1), "_"), k = "Bright";
78
- return "black,red,green,yellow,blue,magenta,cyan,white,gray".split(",").map(((e3, t3) => {
79
- M = _2(e3), 8 > t3 ? (I[e3 + k] = w2(90 + t3, h), I[M + k] = w2(100 + t3, b)) : t3 = 60, I[e3] = w2(30 + t3, h), I[M] = w2(40 + t3, b);
80
- })), s2.extend(I);
78
+ }, "c"), a3 = t3 > 0, w2 = /* @__PURE__ */ __name((e3, t4) => a3 ? { open: `\x1B[${e3}m`, close: `\x1B[${t4}m` } : g, "w"), y2 = /* @__PURE__ */ __name((e3) => (t4) => e3(...p(t4)), "y"), R2 = /* @__PURE__ */ __name((e3, t4) => (r2, l2, n2) => w2(`${e3}8;2;${r2};${l2};${n2}`, t4), "R"), $ = /* @__PURE__ */ __name((e3, t4) => (r2, l2, n2) => w2(((e4, t5, r3) => d(u(e4, t5, r3)))(r2, l2, n2) + e3, t4), "$"), x3 = /* @__PURE__ */ __name((e3) => (t4, r2, l2) => e3(u(t4, r2, l2)), "x"), T2 = R2(3, h2), v = R2(4, b), C = /* @__PURE__ */ __name((e3) => w2("38;5;" + e3, h2), "C"), E = /* @__PURE__ */ __name((e3) => w2("48;5;" + e3, b), "E");
79
+ 2 === t3 ? (T2 = x3(C), v = x3(E)) : 1 === t3 && (T2 = $(0, h2), v = $(10, b), C = /* @__PURE__ */ __name((e3) => w2(d(e3), h2), "C"), E = /* @__PURE__ */ __name((e3) => w2(d(e3) + 10, b), "E"));
80
+ let M2, I3 = { fg: C, bg: E, rgb: T2, bgRgb: v, hex: y2(T2), bgHex: y2(v), visible: g, reset: w2(0, 0), bold: w2(1, 22), dim: w2(2, 22), italic: w2(3, 23), underline: w2(4, 24), inverse: w2(7, 27), hidden: w2(8, 28), strikethrough: w2(9, 29) }, _3 = /* @__PURE__ */ __name((e3) => "bg" + e3[0].toUpperCase() + e3.slice(1), "_"), k2 = "Bright";
81
+ return "black,red,green,yellow,blue,magenta,cyan,white,gray".split(",").map(((e3, t4) => {
82
+ M2 = _3(e3), 8 > t4 ? (I3[e3 + k2] = w2(90 + t4, h2), I3[M2 + k2] = w2(100 + t4, b)) : t4 = 60, I3[e3] = w2(30 + t4, h2), I3[M2] = w2(40 + t4, b);
83
+ })), s2.extend(I3);
81
84
  }, "e"))();
82
85
  module.exports = w, w.default = w;
83
86
  }
@@ -133,12 +136,12 @@ var require_re = __commonJS({
133
136
  } = require_constants();
134
137
  var debug2 = require_debug();
135
138
  exports$1 = module.exports = {};
136
- var re = exports$1.re = [];
139
+ var re2 = exports$1.re = [];
137
140
  var safeRe = exports$1.safeRe = [];
138
141
  var src = exports$1.src = [];
139
142
  var safeSrc = exports$1.safeSrc = [];
140
- var t = exports$1.t = {};
141
- var R = 0;
143
+ var t2 = exports$1.t = {};
144
+ var R2 = 0;
142
145
  var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
143
146
  var safeRegexReplacements = [
144
147
  ["\\s", 1],
@@ -153,57 +156,57 @@ var require_re = __commonJS({
153
156
  }, "makeSafeRegex");
154
157
  var createToken = /* @__PURE__ */ __name((name, value, isGlobal) => {
155
158
  const safe = makeSafeRegex(value);
156
- const index = R++;
159
+ const index = R2++;
157
160
  debug2(name, index, value);
158
- t[name] = index;
161
+ t2[name] = index;
159
162
  src[index] = value;
160
163
  safeSrc[index] = safe;
161
- re[index] = new RegExp(value, isGlobal ? "g" : void 0);
164
+ re2[index] = new RegExp(value, isGlobal ? "g" : void 0);
162
165
  safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
163
166
  }, "createToken");
164
167
  createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
165
168
  createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
166
169
  createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
167
- createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
168
- createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
169
- createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);
170
- createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);
171
- createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
172
- createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
170
+ createToken("MAINVERSION", `(${src[t2.NUMERICIDENTIFIER]})\\.(${src[t2.NUMERICIDENTIFIER]})\\.(${src[t2.NUMERICIDENTIFIER]})`);
171
+ createToken("MAINVERSIONLOOSE", `(${src[t2.NUMERICIDENTIFIERLOOSE]})\\.(${src[t2.NUMERICIDENTIFIERLOOSE]})\\.(${src[t2.NUMERICIDENTIFIERLOOSE]})`);
172
+ createToken("PRERELEASEIDENTIFIER", `(?:${src[t2.NONNUMERICIDENTIFIER]}|${src[t2.NUMERICIDENTIFIER]})`);
173
+ createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t2.NONNUMERICIDENTIFIER]}|${src[t2.NUMERICIDENTIFIERLOOSE]})`);
174
+ createToken("PRERELEASE", `(?:-(${src[t2.PRERELEASEIDENTIFIER]}(?:\\.${src[t2.PRERELEASEIDENTIFIER]})*))`);
175
+ createToken("PRERELEASELOOSE", `(?:-?(${src[t2.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t2.PRERELEASEIDENTIFIERLOOSE]})*))`);
173
176
  createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
174
- createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
175
- createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
176
- createToken("FULL", `^${src[t.FULLPLAIN]}$`);
177
- createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
178
- createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
177
+ createToken("BUILD", `(?:\\+(${src[t2.BUILDIDENTIFIER]}(?:\\.${src[t2.BUILDIDENTIFIER]})*))`);
178
+ createToken("FULLPLAIN", `v?${src[t2.MAINVERSION]}${src[t2.PRERELEASE]}?${src[t2.BUILD]}?`);
179
+ createToken("FULL", `^${src[t2.FULLPLAIN]}$`);
180
+ createToken("LOOSEPLAIN", `[v=\\s]*${src[t2.MAINVERSIONLOOSE]}${src[t2.PRERELEASELOOSE]}?${src[t2.BUILD]}?`);
181
+ createToken("LOOSE", `^${src[t2.LOOSEPLAIN]}$`);
179
182
  createToken("GTLT", "((?:<|>)?=?)");
180
- createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
181
- createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
182
- createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
183
- createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
184
- createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
185
- createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
183
+ createToken("XRANGEIDENTIFIERLOOSE", `${src[t2.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
184
+ createToken("XRANGEIDENTIFIER", `${src[t2.NUMERICIDENTIFIER]}|x|X|\\*`);
185
+ createToken("XRANGEPLAIN", `[v=\\s]*(${src[t2.XRANGEIDENTIFIER]})(?:\\.(${src[t2.XRANGEIDENTIFIER]})(?:\\.(${src[t2.XRANGEIDENTIFIER]})(?:${src[t2.PRERELEASE]})?${src[t2.BUILD]}?)?)?`);
186
+ createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t2.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t2.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t2.XRANGEIDENTIFIERLOOSE]})(?:${src[t2.PRERELEASELOOSE]})?${src[t2.BUILD]}?)?)?`);
187
+ createToken("XRANGE", `^${src[t2.GTLT]}\\s*${src[t2.XRANGEPLAIN]}$`);
188
+ createToken("XRANGELOOSE", `^${src[t2.GTLT]}\\s*${src[t2.XRANGEPLAINLOOSE]}$`);
186
189
  createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
187
- createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
188
- createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
189
- createToken("COERCERTL", src[t.COERCE], true);
190
- createToken("COERCERTLFULL", src[t.COERCEFULL], true);
190
+ createToken("COERCE", `${src[t2.COERCEPLAIN]}(?:$|[^\\d])`);
191
+ createToken("COERCEFULL", src[t2.COERCEPLAIN] + `(?:${src[t2.PRERELEASE]})?(?:${src[t2.BUILD]})?(?:$|[^\\d])`);
192
+ createToken("COERCERTL", src[t2.COERCE], true);
193
+ createToken("COERCERTLFULL", src[t2.COERCEFULL], true);
191
194
  createToken("LONETILDE", "(?:~>?)");
192
- createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
195
+ createToken("TILDETRIM", `(\\s*)${src[t2.LONETILDE]}\\s+`, true);
193
196
  exports$1.tildeTrimReplace = "$1~";
194
- createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
195
- createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
197
+ createToken("TILDE", `^${src[t2.LONETILDE]}${src[t2.XRANGEPLAIN]}$`);
198
+ createToken("TILDELOOSE", `^${src[t2.LONETILDE]}${src[t2.XRANGEPLAINLOOSE]}$`);
196
199
  createToken("LONECARET", "(?:\\^)");
197
- createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
200
+ createToken("CARETTRIM", `(\\s*)${src[t2.LONECARET]}\\s+`, true);
198
201
  exports$1.caretTrimReplace = "$1^";
199
- createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
200
- createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
201
- createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
202
- createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
203
- createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
202
+ createToken("CARET", `^${src[t2.LONECARET]}${src[t2.XRANGEPLAIN]}$`);
203
+ createToken("CARETLOOSE", `^${src[t2.LONECARET]}${src[t2.XRANGEPLAINLOOSE]}$`);
204
+ createToken("COMPARATORLOOSE", `^${src[t2.GTLT]}\\s*(${src[t2.LOOSEPLAIN]})$|^$`);
205
+ createToken("COMPARATOR", `^${src[t2.GTLT]}\\s*(${src[t2.FULLPLAIN]})$|^$`);
206
+ createToken("COMPARATORTRIM", `(\\s*)${src[t2.GTLT]}\\s*(${src[t2.LOOSEPLAIN]}|${src[t2.XRANGEPLAIN]})`, true);
204
207
  exports$1.comparatorTrimReplace = "$1$2$3";
205
- createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
206
- createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
208
+ createToken("HYPHENRANGE", `^\\s*(${src[t2.XRANGEPLAIN]})\\s+-\\s+(${src[t2.XRANGEPLAIN]})\\s*$`);
209
+ createToken("HYPHENRANGELOOSE", `^\\s*(${src[t2.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t2.XRANGEPLAINLOOSE]})\\s*$`);
207
210
  createToken("STAR", "(<|>)?=?\\s*\\*");
208
211
  createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
209
212
  createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
@@ -257,7 +260,7 @@ var require_semver = __commonJS({
257
260
  "../../node_modules/.bun/semver@7.7.4/node_modules/semver/classes/semver.js"(exports$1, module) {
258
261
  var debug2 = require_debug();
259
262
  var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
260
- var { safeRe: re, t } = require_re();
263
+ var { safeRe: re2, t: t2 } = require_re();
261
264
  var parseOptions = require_parse_options();
262
265
  var { compareIdentifiers } = require_identifiers();
263
266
  var SemVer = class _SemVer {
@@ -284,7 +287,7 @@ var require_semver = __commonJS({
284
287
  this.options = options;
285
288
  this.loose = !!options.loose;
286
289
  this.includePrerelease = !!options.includePrerelease;
287
- const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
290
+ const m = version.trim().match(options.loose ? re2[t2.LOOSE] : re2[t2.FULL]);
288
291
  if (!m) {
289
292
  throw new TypeError(`Invalid Version: ${version}`);
290
293
  }
@@ -423,7 +426,7 @@ var require_semver = __commonJS({
423
426
  throw new Error("invalid increment argument: identifier is empty");
424
427
  }
425
428
  if (identifier) {
426
- const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
429
+ const match = `-${identifier}`.match(this.options.loose ? re2[t2.PRERELEASELOOSE] : re2[t2.PRERELEASE]);
427
430
  if (!match || match[1] !== identifier) {
428
431
  throw new Error(`invalid identifier: ${identifier}`);
429
432
  }
@@ -745,8 +748,8 @@ var require_rsort = __commonJS({
745
748
  var require_gt = __commonJS({
746
749
  "../../node_modules/.bun/semver@7.7.4/node_modules/semver/functions/gt.js"(exports$1, module) {
747
750
  var compare = require_compare();
748
- var gt = /* @__PURE__ */ __name((a2, b, loose) => compare(a2, b, loose) > 0, "gt");
749
- module.exports = gt;
751
+ var gt3 = /* @__PURE__ */ __name((a2, b, loose) => compare(a2, b, loose) > 0, "gt");
752
+ module.exports = gt3;
750
753
  }
751
754
  });
752
755
 
@@ -754,8 +757,8 @@ var require_gt = __commonJS({
754
757
  var require_lt = __commonJS({
755
758
  "../../node_modules/.bun/semver@7.7.4/node_modules/semver/functions/lt.js"(exports$1, module) {
756
759
  var compare = require_compare();
757
- var lt = /* @__PURE__ */ __name((a2, b, loose) => compare(a2, b, loose) < 0, "lt");
758
- module.exports = lt;
760
+ var lt2 = /* @__PURE__ */ __name((a2, b, loose) => compare(a2, b, loose) < 0, "lt");
761
+ module.exports = lt2;
759
762
  }
760
763
  });
761
764
 
@@ -800,9 +803,9 @@ var require_cmp = __commonJS({
800
803
  "../../node_modules/.bun/semver@7.7.4/node_modules/semver/functions/cmp.js"(exports$1, module) {
801
804
  var eq = require_eq();
802
805
  var neq = require_neq();
803
- var gt = require_gt();
806
+ var gt3 = require_gt();
804
807
  var gte = require_gte();
805
- var lt = require_lt();
808
+ var lt2 = require_lt();
806
809
  var lte = require_lte();
807
810
  var cmp = /* @__PURE__ */ __name((a2, op, b, loose) => {
808
811
  switch (op) {
@@ -829,11 +832,11 @@ var require_cmp = __commonJS({
829
832
  case "!=":
830
833
  return neq(a2, b, loose);
831
834
  case ">":
832
- return gt(a2, b, loose);
835
+ return gt3(a2, b, loose);
833
836
  case ">=":
834
837
  return gte(a2, b, loose);
835
838
  case "<":
836
- return lt(a2, b, loose);
839
+ return lt2(a2, b, loose);
837
840
  case "<=":
838
841
  return lte(a2, b, loose);
839
842
  default:
@@ -849,7 +852,7 @@ var require_coerce = __commonJS({
849
852
  "../../node_modules/.bun/semver@7.7.4/node_modules/semver/functions/coerce.js"(exports$1, module) {
850
853
  var SemVer = require_semver();
851
854
  var parse = require_parse();
852
- var { safeRe: re, t } = require_re();
855
+ var { safeRe: re2, t: t2 } = require_re();
853
856
  var coerce = /* @__PURE__ */ __name((version, options) => {
854
857
  if (version instanceof SemVer) {
855
858
  return version;
@@ -863,9 +866,9 @@ var require_coerce = __commonJS({
863
866
  options = options || {};
864
867
  let match = null;
865
868
  if (!options.rtl) {
866
- match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
869
+ match = version.match(options.includePrerelease ? re2[t2.COERCEFULL] : re2[t2.COERCE]);
867
870
  } else {
868
- const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
871
+ const coerceRtlRegex = options.includePrerelease ? re2[t2.COERCERTLFULL] : re2[t2.COERCERTL];
869
872
  let next;
870
873
  while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) {
871
874
  if (!match || next.index + next[0].length !== match.index + match[0].length) {
@@ -984,11 +987,11 @@ var require_range = __commonJS({
984
987
  this.formatted += "||";
985
988
  }
986
989
  const comps = this.set[i];
987
- for (let k = 0; k < comps.length; k++) {
988
- if (k > 0) {
990
+ for (let k2 = 0; k2 < comps.length; k2++) {
991
+ if (k2 > 0) {
989
992
  this.formatted += " ";
990
993
  }
991
- this.formatted += comps[k].toString().trim();
994
+ this.formatted += comps[k2].toString().trim();
992
995
  }
993
996
  }
994
997
  }
@@ -1008,20 +1011,20 @@ var require_range = __commonJS({
1008
1011
  return cached;
1009
1012
  }
1010
1013
  const loose = this.options.loose;
1011
- const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
1014
+ const hr = loose ? re2[t2.HYPHENRANGELOOSE] : re2[t2.HYPHENRANGE];
1012
1015
  range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
1013
1016
  debug2("hyphen replace", range);
1014
- range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
1017
+ range = range.replace(re2[t2.COMPARATORTRIM], comparatorTrimReplace);
1015
1018
  debug2("comparator trim", range);
1016
- range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
1019
+ range = range.replace(re2[t2.TILDETRIM], tildeTrimReplace);
1017
1020
  debug2("tilde trim", range);
1018
- range = range.replace(re[t.CARETTRIM], caretTrimReplace);
1021
+ range = range.replace(re2[t2.CARETTRIM], caretTrimReplace);
1019
1022
  debug2("caret trim", range);
1020
1023
  let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
1021
1024
  if (loose) {
1022
1025
  rangeList = rangeList.filter((comp) => {
1023
1026
  debug2("loose invalid filter", comp, this.options);
1024
- return !!comp.match(re[t.COMPARATORLOOSE]);
1027
+ return !!comp.match(re2[t2.COMPARATORLOOSE]);
1025
1028
  });
1026
1029
  }
1027
1030
  debug2("range list", rangeList);
@@ -1082,8 +1085,8 @@ var require_range = __commonJS({
1082
1085
  var debug2 = require_debug();
1083
1086
  var SemVer = require_semver();
1084
1087
  var {
1085
- safeRe: re,
1086
- t,
1088
+ safeRe: re2,
1089
+ t: t2,
1087
1090
  comparatorTrimReplace,
1088
1091
  tildeTrimReplace,
1089
1092
  caretTrimReplace
@@ -1104,7 +1107,7 @@ var require_range = __commonJS({
1104
1107
  return result;
1105
1108
  }, "isSatisfiable");
1106
1109
  var parseComparator = /* @__PURE__ */ __name((comp, options) => {
1107
- comp = comp.replace(re[t.BUILD], "");
1110
+ comp = comp.replace(re2[t2.BUILD], "");
1108
1111
  debug2("comp", comp, options);
1109
1112
  comp = replaceCarets(comp, options);
1110
1113
  debug2("caret", comp);
@@ -1121,21 +1124,21 @@ var require_range = __commonJS({
1121
1124
  return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
1122
1125
  }, "replaceTildes");
1123
1126
  var replaceTilde = /* @__PURE__ */ __name((comp, options) => {
1124
- const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
1125
- return comp.replace(r, (_2, M, m, p, pr) => {
1126
- debug2("tilde", comp, _2, M, m, p, pr);
1127
+ const r = options.loose ? re2[t2.TILDELOOSE] : re2[t2.TILDE];
1128
+ return comp.replace(r, (_3, M2, m, p, pr) => {
1129
+ debug2("tilde", comp, _3, M2, m, p, pr);
1127
1130
  let ret;
1128
- if (isX(M)) {
1131
+ if (isX(M2)) {
1129
1132
  ret = "";
1130
1133
  } else if (isX(m)) {
1131
- ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
1134
+ ret = `>=${M2}.0.0 <${+M2 + 1}.0.0-0`;
1132
1135
  } else if (isX(p)) {
1133
- ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
1136
+ ret = `>=${M2}.${m}.0 <${M2}.${+m + 1}.0-0`;
1134
1137
  } else if (pr) {
1135
1138
  debug2("replaceTilde pr", pr);
1136
- ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
1139
+ ret = `>=${M2}.${m}.${p}-${pr} <${M2}.${+m + 1}.0-0`;
1137
1140
  } else {
1138
- ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
1141
+ ret = `>=${M2}.${m}.${p} <${M2}.${+m + 1}.0-0`;
1139
1142
  }
1140
1143
  debug2("tilde return", ret);
1141
1144
  return ret;
@@ -1146,42 +1149,42 @@ var require_range = __commonJS({
1146
1149
  }, "replaceCarets");
1147
1150
  var replaceCaret = /* @__PURE__ */ __name((comp, options) => {
1148
1151
  debug2("caret", comp, options);
1149
- const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
1150
- const z = options.includePrerelease ? "-0" : "";
1151
- return comp.replace(r, (_2, M, m, p, pr) => {
1152
- debug2("caret", comp, _2, M, m, p, pr);
1152
+ const r = options.loose ? re2[t2.CARETLOOSE] : re2[t2.CARET];
1153
+ const z3 = options.includePrerelease ? "-0" : "";
1154
+ return comp.replace(r, (_3, M2, m, p, pr) => {
1155
+ debug2("caret", comp, _3, M2, m, p, pr);
1153
1156
  let ret;
1154
- if (isX(M)) {
1157
+ if (isX(M2)) {
1155
1158
  ret = "";
1156
1159
  } else if (isX(m)) {
1157
- ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
1160
+ ret = `>=${M2}.0.0${z3} <${+M2 + 1}.0.0-0`;
1158
1161
  } else if (isX(p)) {
1159
- if (M === "0") {
1160
- ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
1162
+ if (M2 === "0") {
1163
+ ret = `>=${M2}.${m}.0${z3} <${M2}.${+m + 1}.0-0`;
1161
1164
  } else {
1162
- ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
1165
+ ret = `>=${M2}.${m}.0${z3} <${+M2 + 1}.0.0-0`;
1163
1166
  }
1164
1167
  } else if (pr) {
1165
1168
  debug2("replaceCaret pr", pr);
1166
- if (M === "0") {
1169
+ if (M2 === "0") {
1167
1170
  if (m === "0") {
1168
- ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
1171
+ ret = `>=${M2}.${m}.${p}-${pr} <${M2}.${m}.${+p + 1}-0`;
1169
1172
  } else {
1170
- ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
1173
+ ret = `>=${M2}.${m}.${p}-${pr} <${M2}.${+m + 1}.0-0`;
1171
1174
  }
1172
1175
  } else {
1173
- ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
1176
+ ret = `>=${M2}.${m}.${p}-${pr} <${+M2 + 1}.0.0-0`;
1174
1177
  }
1175
1178
  } else {
1176
1179
  debug2("no pr");
1177
- if (M === "0") {
1180
+ if (M2 === "0") {
1178
1181
  if (m === "0") {
1179
- ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
1182
+ ret = `>=${M2}.${m}.${p}${z3} <${M2}.${m}.${+p + 1}-0`;
1180
1183
  } else {
1181
- ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`;
1184
+ ret = `>=${M2}.${m}.${p}${z3} <${M2}.${+m + 1}.0-0`;
1182
1185
  }
1183
1186
  } else {
1184
- ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
1187
+ ret = `>=${M2}.${m}.${p} <${+M2 + 1}.0.0-0`;
1185
1188
  }
1186
1189
  }
1187
1190
  debug2("caret return", ret);
@@ -1194,10 +1197,10 @@ var require_range = __commonJS({
1194
1197
  }, "replaceXRanges");
1195
1198
  var replaceXRange = /* @__PURE__ */ __name((comp, options) => {
1196
1199
  comp = comp.trim();
1197
- const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
1198
- return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
1199
- debug2("xRange", comp, ret, gtlt, M, m, p, pr);
1200
- const xM = isX(M);
1200
+ const r = options.loose ? re2[t2.XRANGELOOSE] : re2[t2.XRANGE];
1201
+ return comp.replace(r, (ret, gtlt, M2, m, p, pr) => {
1202
+ debug2("xRange", comp, ret, gtlt, M2, m, p, pr);
1203
+ const xM = isX(M2);
1201
1204
  const xm = xM || isX(m);
1202
1205
  const xp = xm || isX(p);
1203
1206
  const anyX = xp;
@@ -1219,7 +1222,7 @@ var require_range = __commonJS({
1219
1222
  if (gtlt === ">") {
1220
1223
  gtlt = ">=";
1221
1224
  if (xm) {
1222
- M = +M + 1;
1225
+ M2 = +M2 + 1;
1223
1226
  m = 0;
1224
1227
  p = 0;
1225
1228
  } else {
@@ -1229,7 +1232,7 @@ var require_range = __commonJS({
1229
1232
  } else if (gtlt === "<=") {
1230
1233
  gtlt = "<";
1231
1234
  if (xm) {
1232
- M = +M + 1;
1235
+ M2 = +M2 + 1;
1233
1236
  } else {
1234
1237
  m = +m + 1;
1235
1238
  }
@@ -1237,11 +1240,11 @@ var require_range = __commonJS({
1237
1240
  if (gtlt === "<") {
1238
1241
  pr = "-0";
1239
1242
  }
1240
- ret = `${gtlt + M}.${m}.${p}${pr}`;
1243
+ ret = `${gtlt + M2}.${m}.${p}${pr}`;
1241
1244
  } else if (xm) {
1242
- ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
1245
+ ret = `>=${M2}.0.0${pr} <${+M2 + 1}.0.0-0`;
1243
1246
  } else if (xp) {
1244
- ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
1247
+ ret = `>=${M2}.${m}.0${pr} <${M2}.${+m + 1}.0-0`;
1245
1248
  }
1246
1249
  debug2("xRange return", ret);
1247
1250
  return ret;
@@ -1249,11 +1252,11 @@ var require_range = __commonJS({
1249
1252
  }, "replaceXRange");
1250
1253
  var replaceStars = /* @__PURE__ */ __name((comp, options) => {
1251
1254
  debug2("replaceStars", comp, options);
1252
- return comp.trim().replace(re[t.STAR], "");
1255
+ return comp.trim().replace(re2[t2.STAR], "");
1253
1256
  }, "replaceStars");
1254
1257
  var replaceGTE0 = /* @__PURE__ */ __name((comp, options) => {
1255
1258
  debug2("replaceGTE0", comp, options);
1256
- return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
1259
+ return comp.trim().replace(re2[options.includePrerelease ? t2.GTE0PRE : t2.GTE0], "");
1257
1260
  }, "replaceGTE0");
1258
1261
  var hyphenReplace = /* @__PURE__ */ __name((incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
1259
1262
  if (isX(fM)) {
@@ -1341,7 +1344,7 @@ var require_comparator = __commonJS({
1341
1344
  debug2("comp", this);
1342
1345
  }
1343
1346
  parse(comp) {
1344
- const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
1347
+ const r = this.options.loose ? re2[t2.COMPARATORLOOSE] : re2[t2.COMPARATOR];
1345
1348
  const m = comp.match(r);
1346
1349
  if (!m) {
1347
1350
  throw new TypeError(`Invalid comparator: ${comp}`);
@@ -1415,7 +1418,7 @@ var require_comparator = __commonJS({
1415
1418
  };
1416
1419
  module.exports = Comparator;
1417
1420
  var parseOptions = require_parse_options();
1418
- var { safeRe: re, t } = require_re();
1421
+ var { safeRe: re2, t: t2 } = require_re();
1419
1422
  var cmp = require_cmp();
1420
1423
  var debug2 = require_debug();
1421
1424
  var SemVer = require_semver();
@@ -1509,7 +1512,7 @@ var require_min_version = __commonJS({
1509
1512
  "../../node_modules/.bun/semver@7.7.4/node_modules/semver/ranges/min-version.js"(exports$1, module) {
1510
1513
  var SemVer = require_semver();
1511
1514
  var Range = require_range();
1512
- var gt = require_gt();
1515
+ var gt3 = require_gt();
1513
1516
  var minVersion = /* @__PURE__ */ __name((range, loose) => {
1514
1517
  range = new Range(range, loose);
1515
1518
  let minver = new SemVer("0.0.0");
@@ -1537,7 +1540,7 @@ var require_min_version = __commonJS({
1537
1540
  /* fallthrough */
1538
1541
  case "":
1539
1542
  case ">=":
1540
- if (!setMin || gt(compver, setMin)) {
1543
+ if (!setMin || gt3(compver, setMin)) {
1541
1544
  setMin = compver;
1542
1545
  }
1543
1546
  break;
@@ -1549,7 +1552,7 @@ var require_min_version = __commonJS({
1549
1552
  throw new Error(`Unexpected operation: ${comparator.operator}`);
1550
1553
  }
1551
1554
  });
1552
- if (setMin && (!minver || gt(minver, setMin))) {
1555
+ if (setMin && (!minver || gt3(minver, setMin))) {
1553
1556
  minver = setMin;
1554
1557
  }
1555
1558
  }
@@ -1585,8 +1588,8 @@ var require_outside = __commonJS({
1585
1588
  var { ANY } = Comparator;
1586
1589
  var Range = require_range();
1587
1590
  var satisfies = require_satisfies();
1588
- var gt = require_gt();
1589
- var lt = require_lt();
1591
+ var gt3 = require_gt();
1592
+ var lt2 = require_lt();
1590
1593
  var lte = require_lte();
1591
1594
  var gte = require_gte();
1592
1595
  var outside = /* @__PURE__ */ __name((version, range, hilo, options) => {
@@ -1595,16 +1598,16 @@ var require_outside = __commonJS({
1595
1598
  let gtfn, ltefn, ltfn, comp, ecomp;
1596
1599
  switch (hilo) {
1597
1600
  case ">":
1598
- gtfn = gt;
1601
+ gtfn = gt3;
1599
1602
  ltefn = lte;
1600
- ltfn = lt;
1603
+ ltfn = lt2;
1601
1604
  comp = ">";
1602
1605
  ecomp = ">=";
1603
1606
  break;
1604
1607
  case "<":
1605
- gtfn = lt;
1608
+ gtfn = lt2;
1606
1609
  ltefn = gte;
1607
- ltfn = gt;
1610
+ ltfn = gt3;
1608
1611
  comp = "<";
1609
1612
  ecomp = "<=";
1610
1613
  break;
@@ -1777,12 +1780,12 @@ var require_subset = __commonJS({
1777
1780
  }
1778
1781
  }
1779
1782
  const eqSet = /* @__PURE__ */ new Set();
1780
- let gt, lt;
1783
+ let gt3, lt2;
1781
1784
  for (const c of sub) {
1782
1785
  if (c.operator === ">" || c.operator === ">=") {
1783
- gt = higherGT(gt, c, options);
1786
+ gt3 = higherGT(gt3, c, options);
1784
1787
  } else if (c.operator === "<" || c.operator === "<=") {
1785
- lt = lowerLT(lt, c, options);
1788
+ lt2 = lowerLT(lt2, c, options);
1786
1789
  } else {
1787
1790
  eqSet.add(c.semver);
1788
1791
  }
@@ -1791,19 +1794,19 @@ var require_subset = __commonJS({
1791
1794
  return null;
1792
1795
  }
1793
1796
  let gtltComp;
1794
- if (gt && lt) {
1795
- gtltComp = compare(gt.semver, lt.semver, options);
1797
+ if (gt3 && lt2) {
1798
+ gtltComp = compare(gt3.semver, lt2.semver, options);
1796
1799
  if (gtltComp > 0) {
1797
1800
  return null;
1798
- } else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) {
1801
+ } else if (gtltComp === 0 && (gt3.operator !== ">=" || lt2.operator !== "<=")) {
1799
1802
  return null;
1800
1803
  }
1801
1804
  }
1802
1805
  for (const eq of eqSet) {
1803
- if (gt && !satisfies(eq, String(gt), options)) {
1806
+ if (gt3 && !satisfies(eq, String(gt3), options)) {
1804
1807
  return null;
1805
1808
  }
1806
- if (lt && !satisfies(eq, String(lt), options)) {
1809
+ if (lt2 && !satisfies(eq, String(lt2), options)) {
1807
1810
  return null;
1808
1811
  }
1809
1812
  for (const c of dom) {
@@ -1815,52 +1818,52 @@ var require_subset = __commonJS({
1815
1818
  }
1816
1819
  let higher, lower;
1817
1820
  let hasDomLT, hasDomGT;
1818
- let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
1819
- let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
1820
- if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) {
1821
+ let needDomLTPre = lt2 && !options.includePrerelease && lt2.semver.prerelease.length ? lt2.semver : false;
1822
+ let needDomGTPre = gt3 && !options.includePrerelease && gt3.semver.prerelease.length ? gt3.semver : false;
1823
+ if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt2.operator === "<" && needDomLTPre.prerelease[0] === 0) {
1821
1824
  needDomLTPre = false;
1822
1825
  }
1823
1826
  for (const c of dom) {
1824
1827
  hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
1825
1828
  hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
1826
- if (gt) {
1829
+ if (gt3) {
1827
1830
  if (needDomGTPre) {
1828
1831
  if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) {
1829
1832
  needDomGTPre = false;
1830
1833
  }
1831
1834
  }
1832
1835
  if (c.operator === ">" || c.operator === ">=") {
1833
- higher = higherGT(gt, c, options);
1834
- if (higher === c && higher !== gt) {
1836
+ higher = higherGT(gt3, c, options);
1837
+ if (higher === c && higher !== gt3) {
1835
1838
  return false;
1836
1839
  }
1837
- } else if (gt.operator === ">=" && !satisfies(gt.semver, String(c), options)) {
1840
+ } else if (gt3.operator === ">=" && !satisfies(gt3.semver, String(c), options)) {
1838
1841
  return false;
1839
1842
  }
1840
1843
  }
1841
- if (lt) {
1844
+ if (lt2) {
1842
1845
  if (needDomLTPre) {
1843
1846
  if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) {
1844
1847
  needDomLTPre = false;
1845
1848
  }
1846
1849
  }
1847
1850
  if (c.operator === "<" || c.operator === "<=") {
1848
- lower = lowerLT(lt, c, options);
1849
- if (lower === c && lower !== lt) {
1851
+ lower = lowerLT(lt2, c, options);
1852
+ if (lower === c && lower !== lt2) {
1850
1853
  return false;
1851
1854
  }
1852
- } else if (lt.operator === "<=" && !satisfies(lt.semver, String(c), options)) {
1855
+ } else if (lt2.operator === "<=" && !satisfies(lt2.semver, String(c), options)) {
1853
1856
  return false;
1854
1857
  }
1855
1858
  }
1856
- if (!c.operator && (lt || gt) && gtltComp !== 0) {
1859
+ if (!c.operator && (lt2 || gt3) && gtltComp !== 0) {
1857
1860
  return false;
1858
1861
  }
1859
1862
  }
1860
- if (gt && hasDomLT && !lt && gtltComp !== 0) {
1863
+ if (gt3 && hasDomLT && !lt2 && gtltComp !== 0) {
1861
1864
  return false;
1862
1865
  }
1863
- if (lt && hasDomGT && !gt && gtltComp !== 0) {
1866
+ if (lt2 && hasDomGT && !gt3 && gtltComp !== 0) {
1864
1867
  return false;
1865
1868
  }
1866
1869
  if (needDomGTPre || needDomLTPre) {
@@ -1908,8 +1911,8 @@ var require_semver2 = __commonJS({
1908
1911
  var compareBuild = require_compare_build();
1909
1912
  var sort = require_sort();
1910
1913
  var rsort = require_rsort();
1911
- var gt = require_gt();
1912
- var lt = require_lt();
1914
+ var gt3 = require_gt();
1915
+ var lt2 = require_lt();
1913
1916
  var eq = require_eq();
1914
1917
  var neq = require_neq();
1915
1918
  var gte = require_gte();
@@ -1946,8 +1949,8 @@ var require_semver2 = __commonJS({
1946
1949
  compareBuild,
1947
1950
  sort,
1948
1951
  rsort,
1949
- gt,
1950
- lt,
1952
+ gt: gt3,
1953
+ lt: lt2,
1951
1954
  eq,
1952
1955
  neq,
1953
1956
  gte,
@@ -1980,6 +1983,61 @@ var require_semver2 = __commonJS({
1980
1983
  }
1981
1984
  });
1982
1985
 
1986
+ // ../../node_modules/.bun/sisteransi@1.0.5/node_modules/sisteransi/src/index.js
1987
+ var require_src = __commonJS({
1988
+ "../../node_modules/.bun/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"(exports$1, module) {
1989
+ var ESC = "\x1B";
1990
+ var CSI = `${ESC}[`;
1991
+ var beep = "\x07";
1992
+ var cursor = {
1993
+ to(x3, y2) {
1994
+ if (!y2) return `${CSI}${x3 + 1}G`;
1995
+ return `${CSI}${y2 + 1};${x3 + 1}H`;
1996
+ },
1997
+ move(x3, y2) {
1998
+ let ret = "";
1999
+ if (x3 < 0) ret += `${CSI}${-x3}D`;
2000
+ else if (x3 > 0) ret += `${CSI}${x3}C`;
2001
+ if (y2 < 0) ret += `${CSI}${-y2}A`;
2002
+ else if (y2 > 0) ret += `${CSI}${y2}B`;
2003
+ return ret;
2004
+ },
2005
+ up: /* @__PURE__ */ __name((count = 1) => `${CSI}${count}A`, "up"),
2006
+ down: /* @__PURE__ */ __name((count = 1) => `${CSI}${count}B`, "down"),
2007
+ forward: /* @__PURE__ */ __name((count = 1) => `${CSI}${count}C`, "forward"),
2008
+ backward: /* @__PURE__ */ __name((count = 1) => `${CSI}${count}D`, "backward"),
2009
+ nextLine: /* @__PURE__ */ __name((count = 1) => `${CSI}E`.repeat(count), "nextLine"),
2010
+ prevLine: /* @__PURE__ */ __name((count = 1) => `${CSI}F`.repeat(count), "prevLine"),
2011
+ left: `${CSI}G`,
2012
+ hide: `${CSI}?25l`,
2013
+ show: `${CSI}?25h`,
2014
+ save: `${ESC}7`,
2015
+ restore: `${ESC}8`
2016
+ };
2017
+ var scroll = {
2018
+ up: /* @__PURE__ */ __name((count = 1) => `${CSI}S`.repeat(count), "up"),
2019
+ down: /* @__PURE__ */ __name((count = 1) => `${CSI}T`.repeat(count), "down")
2020
+ };
2021
+ var erase = {
2022
+ screen: `${CSI}2J`,
2023
+ up: /* @__PURE__ */ __name((count = 1) => `${CSI}1J`.repeat(count), "up"),
2024
+ down: /* @__PURE__ */ __name((count = 1) => `${CSI}J`.repeat(count), "down"),
2025
+ line: `${CSI}2K`,
2026
+ lineEnd: `${CSI}K`,
2027
+ lineStart: `${CSI}1K`,
2028
+ lines(count) {
2029
+ let clear = "";
2030
+ for (let i = 0; i < count; i++)
2031
+ clear += this.line + (i < count - 1 ? cursor.up() : "");
2032
+ if (count)
2033
+ clear += cursor.left;
2034
+ return clear;
2035
+ }
2036
+ };
2037
+ module.exports = { cursor, scroll, erase, beep };
2038
+ }
2039
+ });
2040
+
1983
2041
  // ../env-spec-parser/dist/chunk-XRNR4FE7.mjs
1984
2042
  var __defProp = Object.defineProperty;
1985
2043
  var __name2 = /* @__PURE__ */ __name((target, value) => __defProp(target, "name", { value, configurable: true }), "__name");
@@ -2692,9 +2750,9 @@ var peg$SyntaxError = class extends SyntaxError {
2692
2750
  let str = "Error: " + this.message;
2693
2751
  if (this.location) {
2694
2752
  let src = null;
2695
- const st = sources.find((s2) => s2.source === this.location.source);
2696
- if (st) {
2697
- src = st.text.split(/\r\n|\n|\r/g);
2753
+ const st2 = sources.find((s2) => s2.source === this.location.source);
2754
+ if (st2) {
2755
+ src = st2.text.split(/\r\n|\n|\r/g);
2698
2756
  }
2699
2757
  const s = this.location.start;
2700
2758
  const offset_s = this.location.source && typeof this.location.source.offset === "function" ? this.location.source.offset(s) : s;
@@ -2766,14 +2824,14 @@ var peg$SyntaxError = class extends SyntaxError {
2766
2824
  const descriptions = expected2.map(describeExpectation);
2767
2825
  descriptions.sort();
2768
2826
  if (descriptions.length > 0) {
2769
- let j = 1;
2827
+ let j2 = 1;
2770
2828
  for (let i = 1; i < descriptions.length; i++) {
2771
2829
  if (descriptions[i - 1] !== descriptions[i]) {
2772
- descriptions[j] = descriptions[i];
2773
- j++;
2830
+ descriptions[j2] = descriptions[i];
2831
+ j2++;
2774
2832
  }
2775
2833
  }
2776
- descriptions.length = j;
2834
+ descriptions.length = j2;
2777
2835
  }
2778
2836
  switch (descriptions.length) {
2779
2837
  case 1:
@@ -3112,8 +3170,8 @@ function peg$parse(input, options) {
3112
3170
  }
3113
3171
  __name(peg$literalExpectation, "peg$literalExpectation");
3114
3172
  __name2(peg$literalExpectation, "peg$literalExpectation");
3115
- function peg$classExpectation(parts, inverted, ignoreCase, unicode) {
3116
- return { type: "class", parts, inverted, ignoreCase, unicode };
3173
+ function peg$classExpectation(parts, inverted, ignoreCase, unicode2) {
3174
+ return { type: "class", parts, inverted, ignoreCase, unicode: unicode2 };
3117
3175
  }
3118
3176
  __name(peg$classExpectation, "peg$classExpectation");
3119
3177
  __name2(peg$classExpectation, "peg$classExpectation");
@@ -7197,6 +7255,749 @@ var { Ansis, fg, bg, rgb, bgRgb, hex, bgHex, reset, inverse, hidden, visible, bo
7197
7255
 
7198
7256
  // src/env-graph/lib/plugins.ts
7199
7257
  var import_semver = __toESM(require_semver2(), 1);
7258
+
7259
+ // ../../node_modules/.bun/@clack+core@1.1.0/node_modules/@clack/core/dist/index.mjs
7260
+ var import_sisteransi = __toESM(require_src(), 1);
7261
+ function x(t2, e, s) {
7262
+ if (!s.some((u) => !u.disabled)) return t2;
7263
+ const i = t2 + e, r = Math.max(s.length - 1, 0), n = i < 0 ? r : i > r ? 0 : i;
7264
+ return s[n].disabled ? x(n, e < 0 ? -1 : 1, s) : n;
7265
+ }
7266
+ __name(x, "x");
7267
+ var at = /* @__PURE__ */ __name((t2) => t2 === 161 || t2 === 164 || t2 === 167 || t2 === 168 || t2 === 170 || t2 === 173 || t2 === 174 || t2 >= 176 && t2 <= 180 || t2 >= 182 && t2 <= 186 || t2 >= 188 && t2 <= 191 || t2 === 198 || t2 === 208 || t2 === 215 || t2 === 216 || t2 >= 222 && t2 <= 225 || t2 === 230 || t2 >= 232 && t2 <= 234 || t2 === 236 || t2 === 237 || t2 === 240 || t2 === 242 || t2 === 243 || t2 >= 247 && t2 <= 250 || t2 === 252 || t2 === 254 || t2 === 257 || t2 === 273 || t2 === 275 || t2 === 283 || t2 === 294 || t2 === 295 || t2 === 299 || t2 >= 305 && t2 <= 307 || t2 === 312 || t2 >= 319 && t2 <= 322 || t2 === 324 || t2 >= 328 && t2 <= 331 || t2 === 333 || t2 === 338 || t2 === 339 || t2 === 358 || t2 === 359 || t2 === 363 || t2 === 462 || t2 === 464 || t2 === 466 || t2 === 468 || t2 === 470 || t2 === 472 || t2 === 474 || t2 === 476 || t2 === 593 || t2 === 609 || t2 === 708 || t2 === 711 || t2 >= 713 && t2 <= 715 || t2 === 717 || t2 === 720 || t2 >= 728 && t2 <= 731 || t2 === 733 || t2 === 735 || t2 >= 768 && t2 <= 879 || t2 >= 913 && t2 <= 929 || t2 >= 931 && t2 <= 937 || t2 >= 945 && t2 <= 961 || t2 >= 963 && t2 <= 969 || t2 === 1025 || t2 >= 1040 && t2 <= 1103 || t2 === 1105 || t2 === 8208 || t2 >= 8211 && t2 <= 8214 || t2 === 8216 || t2 === 8217 || t2 === 8220 || t2 === 8221 || t2 >= 8224 && t2 <= 8226 || t2 >= 8228 && t2 <= 8231 || t2 === 8240 || t2 === 8242 || t2 === 8243 || t2 === 8245 || t2 === 8251 || t2 === 8254 || t2 === 8308 || t2 === 8319 || t2 >= 8321 && t2 <= 8324 || t2 === 8364 || t2 === 8451 || t2 === 8453 || t2 === 8457 || t2 === 8467 || t2 === 8470 || t2 === 8481 || t2 === 8482 || t2 === 8486 || t2 === 8491 || t2 === 8531 || t2 === 8532 || t2 >= 8539 && t2 <= 8542 || t2 >= 8544 && t2 <= 8555 || t2 >= 8560 && t2 <= 8569 || t2 === 8585 || t2 >= 8592 && t2 <= 8601 || t2 === 8632 || t2 === 8633 || t2 === 8658 || t2 === 8660 || t2 === 8679 || t2 === 8704 || t2 === 8706 || t2 === 8707 || t2 === 8711 || t2 === 8712 || t2 === 8715 || t2 === 8719 || t2 === 8721 || t2 === 8725 || t2 === 8730 || t2 >= 8733 && t2 <= 8736 || t2 === 8739 || t2 === 8741 || t2 >= 8743 && t2 <= 8748 || t2 === 8750 || t2 >= 8756 && t2 <= 8759 || t2 === 8764 || t2 === 8765 || t2 === 8776 || t2 === 8780 || t2 === 8786 || t2 === 8800 || t2 === 8801 || t2 >= 8804 && t2 <= 8807 || t2 === 8810 || t2 === 8811 || t2 === 8814 || t2 === 8815 || t2 === 8834 || t2 === 8835 || t2 === 8838 || t2 === 8839 || t2 === 8853 || t2 === 8857 || t2 === 8869 || t2 === 8895 || t2 === 8978 || t2 >= 9312 && t2 <= 9449 || t2 >= 9451 && t2 <= 9547 || t2 >= 9552 && t2 <= 9587 || t2 >= 9600 && t2 <= 9615 || t2 >= 9618 && t2 <= 9621 || t2 === 9632 || t2 === 9633 || t2 >= 9635 && t2 <= 9641 || t2 === 9650 || t2 === 9651 || t2 === 9654 || t2 === 9655 || t2 === 9660 || t2 === 9661 || t2 === 9664 || t2 === 9665 || t2 >= 9670 && t2 <= 9672 || t2 === 9675 || t2 >= 9678 && t2 <= 9681 || t2 >= 9698 && t2 <= 9701 || t2 === 9711 || t2 === 9733 || t2 === 9734 || t2 === 9737 || t2 === 9742 || t2 === 9743 || t2 === 9756 || t2 === 9758 || t2 === 9792 || t2 === 9794 || t2 === 9824 || t2 === 9825 || t2 >= 9827 && t2 <= 9829 || t2 >= 9831 && t2 <= 9834 || t2 === 9836 || t2 === 9837 || t2 === 9839 || t2 === 9886 || t2 === 9887 || t2 === 9919 || t2 >= 9926 && t2 <= 9933 || t2 >= 9935 && t2 <= 9939 || t2 >= 9941 && t2 <= 9953 || t2 === 9955 || t2 === 9960 || t2 === 9961 || t2 >= 9963 && t2 <= 9969 || t2 === 9972 || t2 >= 9974 && t2 <= 9977 || t2 === 9979 || t2 === 9980 || t2 === 9982 || t2 === 9983 || t2 === 10045 || t2 >= 10102 && t2 <= 10111 || t2 >= 11094 && t2 <= 11097 || t2 >= 12872 && t2 <= 12879 || t2 >= 57344 && t2 <= 63743 || t2 >= 65024 && t2 <= 65039 || t2 === 65533 || t2 >= 127232 && t2 <= 127242 || t2 >= 127248 && t2 <= 127277 || t2 >= 127280 && t2 <= 127337 || t2 >= 127344 && t2 <= 127373 || t2 === 127375 || t2 === 127376 || t2 >= 127387 && t2 <= 127404 || t2 >= 917760 && t2 <= 917999 || t2 >= 983040 && t2 <= 1048573 || t2 >= 1048576 && t2 <= 1114109, "at");
7268
+ var lt = /* @__PURE__ */ __name((t2) => t2 === 12288 || t2 >= 65281 && t2 <= 65376 || t2 >= 65504 && t2 <= 65510, "lt");
7269
+ var ht = /* @__PURE__ */ __name((t2) => t2 >= 4352 && t2 <= 4447 || t2 === 8986 || t2 === 8987 || t2 === 9001 || t2 === 9002 || t2 >= 9193 && t2 <= 9196 || t2 === 9200 || t2 === 9203 || t2 === 9725 || t2 === 9726 || t2 === 9748 || t2 === 9749 || t2 >= 9800 && t2 <= 9811 || t2 === 9855 || t2 === 9875 || t2 === 9889 || t2 === 9898 || t2 === 9899 || t2 === 9917 || t2 === 9918 || t2 === 9924 || t2 === 9925 || t2 === 9934 || t2 === 9940 || t2 === 9962 || t2 === 9970 || t2 === 9971 || t2 === 9973 || t2 === 9978 || t2 === 9981 || t2 === 9989 || t2 === 9994 || t2 === 9995 || t2 === 10024 || t2 === 10060 || t2 === 10062 || t2 >= 10067 && t2 <= 10069 || t2 === 10071 || t2 >= 10133 && t2 <= 10135 || t2 === 10160 || t2 === 10175 || t2 === 11035 || t2 === 11036 || t2 === 11088 || t2 === 11093 || t2 >= 11904 && t2 <= 11929 || t2 >= 11931 && t2 <= 12019 || t2 >= 12032 && t2 <= 12245 || t2 >= 12272 && t2 <= 12287 || t2 >= 12289 && t2 <= 12350 || t2 >= 12353 && t2 <= 12438 || t2 >= 12441 && t2 <= 12543 || t2 >= 12549 && t2 <= 12591 || t2 >= 12593 && t2 <= 12686 || t2 >= 12688 && t2 <= 12771 || t2 >= 12783 && t2 <= 12830 || t2 >= 12832 && t2 <= 12871 || t2 >= 12880 && t2 <= 19903 || t2 >= 19968 && t2 <= 42124 || t2 >= 42128 && t2 <= 42182 || t2 >= 43360 && t2 <= 43388 || t2 >= 44032 && t2 <= 55203 || t2 >= 63744 && t2 <= 64255 || t2 >= 65040 && t2 <= 65049 || t2 >= 65072 && t2 <= 65106 || t2 >= 65108 && t2 <= 65126 || t2 >= 65128 && t2 <= 65131 || t2 >= 94176 && t2 <= 94180 || t2 === 94192 || t2 === 94193 || t2 >= 94208 && t2 <= 100343 || t2 >= 100352 && t2 <= 101589 || t2 >= 101632 && t2 <= 101640 || t2 >= 110576 && t2 <= 110579 || t2 >= 110581 && t2 <= 110587 || t2 === 110589 || t2 === 110590 || t2 >= 110592 && t2 <= 110882 || t2 === 110898 || t2 >= 110928 && t2 <= 110930 || t2 === 110933 || t2 >= 110948 && t2 <= 110951 || t2 >= 110960 && t2 <= 111355 || t2 === 126980 || t2 === 127183 || t2 === 127374 || t2 >= 127377 && t2 <= 127386 || t2 >= 127488 && t2 <= 127490 || t2 >= 127504 && t2 <= 127547 || t2 >= 127552 && t2 <= 127560 || t2 === 127568 || t2 === 127569 || t2 >= 127584 && t2 <= 127589 || t2 >= 127744 && t2 <= 127776 || t2 >= 127789 && t2 <= 127797 || t2 >= 127799 && t2 <= 127868 || t2 >= 127870 && t2 <= 127891 || t2 >= 127904 && t2 <= 127946 || t2 >= 127951 && t2 <= 127955 || t2 >= 127968 && t2 <= 127984 || t2 === 127988 || t2 >= 127992 && t2 <= 128062 || t2 === 128064 || t2 >= 128066 && t2 <= 128252 || t2 >= 128255 && t2 <= 128317 || t2 >= 128331 && t2 <= 128334 || t2 >= 128336 && t2 <= 128359 || t2 === 128378 || t2 === 128405 || t2 === 128406 || t2 === 128420 || t2 >= 128507 && t2 <= 128591 || t2 >= 128640 && t2 <= 128709 || t2 === 128716 || t2 >= 128720 && t2 <= 128722 || t2 >= 128725 && t2 <= 128727 || t2 >= 128732 && t2 <= 128735 || t2 === 128747 || t2 === 128748 || t2 >= 128756 && t2 <= 128764 || t2 >= 128992 && t2 <= 129003 || t2 === 129008 || t2 >= 129292 && t2 <= 129338 || t2 >= 129340 && t2 <= 129349 || t2 >= 129351 && t2 <= 129535 || t2 >= 129648 && t2 <= 129660 || t2 >= 129664 && t2 <= 129672 || t2 >= 129680 && t2 <= 129725 || t2 >= 129727 && t2 <= 129733 || t2 >= 129742 && t2 <= 129755 || t2 >= 129760 && t2 <= 129768 || t2 >= 129776 && t2 <= 129784 || t2 >= 131072 && t2 <= 196605 || t2 >= 196608 && t2 <= 262141, "ht");
7270
+ var O = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;
7271
+ var y = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
7272
+ var L = /\t{1,1000}/y;
7273
+ var P = new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*", "yu");
7274
+ var M = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
7275
+ var ct = new RegExp("\\p{M}+", "gu");
7276
+ var ft = { limit: 1 / 0, ellipsis: "" };
7277
+ var X = /* @__PURE__ */ __name((t2, e = {}, s = {}) => {
7278
+ const i = e.limit ?? 1 / 0, r = e.ellipsis ?? "", n = e?.ellipsisWidth ?? (r ? X(r, ft, s).width : 0), u = s.ansiWidth ?? 0, a2 = s.controlWidth ?? 0, l = s.tabWidth ?? 8, E = s.ambiguousWidth ?? 1, g = s.emojiWidth ?? 2, m = s.fullWidthWidth ?? 2, A = s.regularWidth ?? 1, V2 = s.wideWidth ?? 2;
7279
+ let h2 = 0, o = 0, p = t2.length, v = 0, F = false, d = p, b = Math.max(0, i - n), C = 0, w = 0, c = 0, f = 0;
7280
+ t: for (; ; ) {
7281
+ if (w > C || o >= p && o > h2) {
7282
+ const ut = t2.slice(C, w) || t2.slice(h2, o);
7283
+ v = 0;
7284
+ for (const Y of ut.replaceAll(ct, "")) {
7285
+ const $ = Y.codePointAt(0) || 0;
7286
+ if (lt($) ? f = m : ht($) ? f = V2 : E !== A && at($) ? f = E : f = A, c + f > b && (d = Math.min(d, Math.max(C, h2) + v)), c + f > i) {
7287
+ F = true;
7288
+ break t;
7289
+ }
7290
+ v += Y.length, c += f;
7291
+ }
7292
+ C = w = 0;
7293
+ }
7294
+ if (o >= p) break;
7295
+ if (M.lastIndex = o, M.test(t2)) {
7296
+ if (v = M.lastIndex - o, f = v * A, c + f > b && (d = Math.min(d, o + Math.floor((b - c) / A))), c + f > i) {
7297
+ F = true;
7298
+ break;
7299
+ }
7300
+ c += f, C = h2, w = o, o = h2 = M.lastIndex;
7301
+ continue;
7302
+ }
7303
+ if (O.lastIndex = o, O.test(t2)) {
7304
+ if (c + u > b && (d = Math.min(d, o)), c + u > i) {
7305
+ F = true;
7306
+ break;
7307
+ }
7308
+ c += u, C = h2, w = o, o = h2 = O.lastIndex;
7309
+ continue;
7310
+ }
7311
+ if (y.lastIndex = o, y.test(t2)) {
7312
+ if (v = y.lastIndex - o, f = v * a2, c + f > b && (d = Math.min(d, o + Math.floor((b - c) / a2))), c + f > i) {
7313
+ F = true;
7314
+ break;
7315
+ }
7316
+ c += f, C = h2, w = o, o = h2 = y.lastIndex;
7317
+ continue;
7318
+ }
7319
+ if (L.lastIndex = o, L.test(t2)) {
7320
+ if (v = L.lastIndex - o, f = v * l, c + f > b && (d = Math.min(d, o + Math.floor((b - c) / l))), c + f > i) {
7321
+ F = true;
7322
+ break;
7323
+ }
7324
+ c += f, C = h2, w = o, o = h2 = L.lastIndex;
7325
+ continue;
7326
+ }
7327
+ if (P.lastIndex = o, P.test(t2)) {
7328
+ if (c + g > b && (d = Math.min(d, o)), c + g > i) {
7329
+ F = true;
7330
+ break;
7331
+ }
7332
+ c += g, C = h2, w = o, o = h2 = P.lastIndex;
7333
+ continue;
7334
+ }
7335
+ o += 1;
7336
+ }
7337
+ return { width: F ? b : c, index: F ? d : p, truncated: F, ellipsed: F && i >= n };
7338
+ }, "X");
7339
+ var pt = { limit: 1 / 0, ellipsis: "", ellipsisWidth: 0 };
7340
+ var S = /* @__PURE__ */ __name((t2, e = {}) => X(t2, pt, e).width, "S");
7341
+ var T = "\x1B";
7342
+ var Z = "\x9B";
7343
+ var Ft = 39;
7344
+ var j = "\x07";
7345
+ var Q = "[";
7346
+ var dt = "]";
7347
+ var tt = "m";
7348
+ var U = `${dt}8;;`;
7349
+ var et = new RegExp(`(?:\\${Q}(?<code>\\d+)m|\\${U}(?<uri>.*)${j})`, "y");
7350
+ var mt = /* @__PURE__ */ __name((t2) => {
7351
+ if (t2 >= 30 && t2 <= 37 || t2 >= 90 && t2 <= 97) return 39;
7352
+ if (t2 >= 40 && t2 <= 47 || t2 >= 100 && t2 <= 107) return 49;
7353
+ if (t2 === 1 || t2 === 2) return 22;
7354
+ if (t2 === 3) return 23;
7355
+ if (t2 === 4) return 24;
7356
+ if (t2 === 7) return 27;
7357
+ if (t2 === 8) return 28;
7358
+ if (t2 === 9) return 29;
7359
+ if (t2 === 0) return 0;
7360
+ }, "mt");
7361
+ var st = /* @__PURE__ */ __name((t2) => `${T}${Q}${t2}${tt}`, "st");
7362
+ var it = /* @__PURE__ */ __name((t2) => `${T}${U}${t2}${j}`, "it");
7363
+ var gt = /* @__PURE__ */ __name((t2) => t2.map((e) => S(e)), "gt");
7364
+ var G = /* @__PURE__ */ __name((t2, e, s) => {
7365
+ const i = e[Symbol.iterator]();
7366
+ let r = false, n = false, u = t2.at(-1), a2 = u === void 0 ? 0 : S(u), l = i.next(), E = i.next(), g = 0;
7367
+ for (; !l.done; ) {
7368
+ const m = l.value, A = S(m);
7369
+ a2 + A <= s ? t2[t2.length - 1] += m : (t2.push(m), a2 = 0), (m === T || m === Z) && (r = true, n = e.startsWith(U, g + 1)), r ? n ? m === j && (r = false, n = false) : m === tt && (r = false) : (a2 += A, a2 === s && !E.done && (t2.push(""), a2 = 0)), l = E, E = i.next(), g += m.length;
7370
+ }
7371
+ u = t2.at(-1), !a2 && u !== void 0 && u.length > 0 && t2.length > 1 && (t2[t2.length - 2] += t2.pop());
7372
+ }, "G");
7373
+ var vt = /* @__PURE__ */ __name((t2) => {
7374
+ const e = t2.split(" ");
7375
+ let s = e.length;
7376
+ for (; s > 0 && !(S(e[s - 1]) > 0); ) s--;
7377
+ return s === e.length ? t2 : e.slice(0, s).join(" ") + e.slice(s).join("");
7378
+ }, "vt");
7379
+ var Et = /* @__PURE__ */ __name((t2, e, s = {}) => {
7380
+ if (s.trim !== false && t2.trim() === "") return "";
7381
+ let i = "", r, n;
7382
+ const u = t2.split(" "), a2 = gt(u);
7383
+ let l = [""];
7384
+ for (const [h2, o] of u.entries()) {
7385
+ s.trim !== false && (l[l.length - 1] = (l.at(-1) ?? "").trimStart());
7386
+ let p = S(l.at(-1) ?? "");
7387
+ if (h2 !== 0 && (p >= e && (s.wordWrap === false || s.trim === false) && (l.push(""), p = 0), (p > 0 || s.trim === false) && (l[l.length - 1] += " ", p++)), s.hard && a2[h2] > e) {
7388
+ const v = e - p, F = 1 + Math.floor((a2[h2] - v - 1) / e);
7389
+ Math.floor((a2[h2] - 1) / e) < F && l.push(""), G(l, o, e);
7390
+ continue;
7391
+ }
7392
+ if (p + a2[h2] > e && p > 0 && a2[h2] > 0) {
7393
+ if (s.wordWrap === false && p < e) {
7394
+ G(l, o, e);
7395
+ continue;
7396
+ }
7397
+ l.push("");
7398
+ }
7399
+ if (p + a2[h2] > e && s.wordWrap === false) {
7400
+ G(l, o, e);
7401
+ continue;
7402
+ }
7403
+ l[l.length - 1] += o;
7404
+ }
7405
+ s.trim !== false && (l = l.map((h2) => vt(h2)));
7406
+ const E = l.join(`
7407
+ `), g = E[Symbol.iterator]();
7408
+ let m = g.next(), A = g.next(), V2 = 0;
7409
+ for (; !m.done; ) {
7410
+ const h2 = m.value, o = A.value;
7411
+ if (i += h2, h2 === T || h2 === Z) {
7412
+ et.lastIndex = V2 + 1;
7413
+ const F = et.exec(E)?.groups;
7414
+ if (F?.code !== void 0) {
7415
+ const d = Number.parseFloat(F.code);
7416
+ r = d === Ft ? void 0 : d;
7417
+ } else F?.uri !== void 0 && (n = F.uri.length === 0 ? void 0 : F.uri);
7418
+ }
7419
+ const p = r ? mt(r) : void 0;
7420
+ o === `
7421
+ ` ? (n && (i += it("")), r && p && (i += st(p))) : h2 === `
7422
+ ` && (r && p && (i += st(r)), n && (i += it(n))), V2 += h2.length, m = A, A = g.next();
7423
+ }
7424
+ return i;
7425
+ }, "Et");
7426
+ function K(t2, e, s) {
7427
+ return String(t2).normalize().replaceAll(`\r
7428
+ `, `
7429
+ `).split(`
7430
+ `).map((i) => Et(i, e, s)).join(`
7431
+ `);
7432
+ }
7433
+ __name(K, "K");
7434
+ var At = ["up", "down", "left", "right", "space", "enter", "cancel"];
7435
+ var _ = { actions: new Set(At), aliases: /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["", "cancel"], ["escape", "cancel"]]), withGuide: true };
7436
+ function H(t2, e) {
7437
+ if (typeof t2 == "string") return _.aliases.get(t2) === e;
7438
+ for (const s of t2) if (s !== void 0 && H(s, e)) return true;
7439
+ return false;
7440
+ }
7441
+ __name(H, "H");
7442
+ function _t(t2, e) {
7443
+ if (t2 === e) return;
7444
+ const s = t2.split(`
7445
+ `), i = e.split(`
7446
+ `), r = Math.max(s.length, i.length), n = [];
7447
+ for (let u = 0; u < r; u++) s[u] !== i[u] && n.push(u);
7448
+ return { lines: n, numLinesBefore: s.length, numLinesAfter: i.length, numLines: r };
7449
+ }
7450
+ __name(_t, "_t");
7451
+ globalThis.process.platform.startsWith("win");
7452
+ var z = /* @__PURE__ */ Symbol("clack:cancel");
7453
+ function Ct(t2) {
7454
+ return t2 === z;
7455
+ }
7456
+ __name(Ct, "Ct");
7457
+ function W(t2, e) {
7458
+ const s = t2;
7459
+ s.isTTY && s.setRawMode(e);
7460
+ }
7461
+ __name(W, "W");
7462
+ var rt = /* @__PURE__ */ __name((t2) => "columns" in t2 && typeof t2.columns == "number" ? t2.columns : 80, "rt");
7463
+ var nt = /* @__PURE__ */ __name((t2) => "rows" in t2 && typeof t2.rows == "number" ? t2.rows : 20, "nt");
7464
+ function Bt(t2, e, s, i = s) {
7465
+ const r = rt(t2 ?? stdout);
7466
+ return K(e, r - s.length, { hard: true, trim: false }).split(`
7467
+ `).map((n, u) => `${u === 0 ? i : s}${n}`).join(`
7468
+ `);
7469
+ }
7470
+ __name(Bt, "Bt");
7471
+ var B = class {
7472
+ static {
7473
+ __name(this, "B");
7474
+ }
7475
+ input;
7476
+ output;
7477
+ _abortSignal;
7478
+ rl;
7479
+ opts;
7480
+ _render;
7481
+ _track = false;
7482
+ _prevFrame = "";
7483
+ _subscribers = /* @__PURE__ */ new Map();
7484
+ _cursor = 0;
7485
+ state = "initial";
7486
+ error = "";
7487
+ value;
7488
+ userInput = "";
7489
+ constructor(e, s = true) {
7490
+ const { input: i = stdin, output: r = stdout, render: n, signal: u, ...a2 } = e;
7491
+ this.opts = a2, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = n.bind(this), this._track = s, this._abortSignal = u, this.input = i, this.output = r;
7492
+ }
7493
+ unsubscribe() {
7494
+ this._subscribers.clear();
7495
+ }
7496
+ setSubscriber(e, s) {
7497
+ const i = this._subscribers.get(e) ?? [];
7498
+ i.push(s), this._subscribers.set(e, i);
7499
+ }
7500
+ on(e, s) {
7501
+ this.setSubscriber(e, { cb: s });
7502
+ }
7503
+ once(e, s) {
7504
+ this.setSubscriber(e, { cb: s, once: true });
7505
+ }
7506
+ emit(e, ...s) {
7507
+ const i = this._subscribers.get(e) ?? [], r = [];
7508
+ for (const n of i) n.cb(...s), n.once && r.push(() => i.splice(i.indexOf(n), 1));
7509
+ for (const n of r) n();
7510
+ }
7511
+ prompt() {
7512
+ return new Promise((e) => {
7513
+ if (this._abortSignal) {
7514
+ if (this._abortSignal.aborted) return this.state = "cancel", this.close(), e(z);
7515
+ this._abortSignal.addEventListener("abort", () => {
7516
+ this.state = "cancel", this.close();
7517
+ }, { once: true });
7518
+ }
7519
+ this.rl = ot.createInterface({ input: this.input, tabSize: 2, prompt: "", escapeCodeTimeout: 50, terminal: true }), this.rl.prompt(), this.opts.initialUserInput !== void 0 && this._setUserInput(this.opts.initialUserInput, true), this.input.on("keypress", this.onKeypress), W(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
7520
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), W(this.input, false), e(this.value);
7521
+ }), this.once("cancel", () => {
7522
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), W(this.input, false), e(z);
7523
+ });
7524
+ });
7525
+ }
7526
+ _isActionKey(e, s) {
7527
+ return e === " ";
7528
+ }
7529
+ _setValue(e) {
7530
+ this.value = e, this.emit("value", this.value);
7531
+ }
7532
+ _setUserInput(e, s) {
7533
+ this.userInput = e ?? "", this.emit("userInput", this.userInput), s && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
7534
+ }
7535
+ _clearUserInput() {
7536
+ this.rl?.write(null, { ctrl: true, name: "u" }), this._setUserInput("");
7537
+ }
7538
+ onKeypress(e, s) {
7539
+ if (this._track && s.name !== "return" && (s.name && this._isActionKey(e, s) && this.rl?.write(null, { ctrl: true, name: "h" }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), s?.name && (!this._track && _.aliases.has(s.name) && this.emit("cursor", _.aliases.get(s.name)), _.actions.has(s.name) && this.emit("cursor", s.name)), e && (e.toLowerCase() === "y" || e.toLowerCase() === "n") && this.emit("confirm", e.toLowerCase() === "y"), this.emit("key", e?.toLowerCase(), s), s?.name === "return") {
7540
+ if (this.opts.validate) {
7541
+ const i = this.opts.validate(this.value);
7542
+ i && (this.error = i instanceof Error ? i.message : i, this.state = "error", this.rl?.write(this.userInput));
7543
+ }
7544
+ this.state !== "error" && (this.state = "submit");
7545
+ }
7546
+ H([e, s?.name, s?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
7547
+ }
7548
+ close() {
7549
+ this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
7550
+ `), W(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
7551
+ }
7552
+ restoreCursor() {
7553
+ const e = K(this._prevFrame, process.stdout.columns, { hard: true, trim: false }).split(`
7554
+ `).length - 1;
7555
+ this.output.write(import_sisteransi.cursor.move(-999, e * -1));
7556
+ }
7557
+ render() {
7558
+ const e = K(this._render(this) ?? "", process.stdout.columns, { hard: true, trim: false });
7559
+ if (e !== this._prevFrame) {
7560
+ if (this.state === "initial") this.output.write(import_sisteransi.cursor.hide);
7561
+ else {
7562
+ const s = _t(this._prevFrame, e), i = nt(this.output);
7563
+ if (this.restoreCursor(), s) {
7564
+ const r = Math.max(0, s.numLinesAfter - i), n = Math.max(0, s.numLinesBefore - i);
7565
+ let u = s.lines.find((a2) => a2 >= r);
7566
+ if (u === void 0) {
7567
+ this._prevFrame = e;
7568
+ return;
7569
+ }
7570
+ if (s.lines.length === 1) {
7571
+ this.output.write(import_sisteransi.cursor.move(0, u - n)), this.output.write(import_sisteransi.erase.lines(1));
7572
+ const a2 = e.split(`
7573
+ `);
7574
+ this.output.write(a2[u]), this._prevFrame = e, this.output.write(import_sisteransi.cursor.move(0, a2.length - u - 1));
7575
+ return;
7576
+ } else if (s.lines.length > 1) {
7577
+ if (r < n) u = r;
7578
+ else {
7579
+ const l = u - n;
7580
+ l > 0 && this.output.write(import_sisteransi.cursor.move(0, l));
7581
+ }
7582
+ this.output.write(import_sisteransi.erase.down());
7583
+ const a2 = e.split(`
7584
+ `).slice(u);
7585
+ this.output.write(a2.join(`
7586
+ `)), this._prevFrame = e;
7587
+ return;
7588
+ }
7589
+ }
7590
+ this.output.write(import_sisteransi.erase.down());
7591
+ }
7592
+ this.output.write(e), this.state === "initial" && (this.state = "active"), this._prevFrame = e;
7593
+ }
7594
+ }
7595
+ };
7596
+ var kt = class extends B {
7597
+ static {
7598
+ __name(this, "kt");
7599
+ }
7600
+ get cursor() {
7601
+ return this.value ? 0 : 1;
7602
+ }
7603
+ get _value() {
7604
+ return this.cursor === 0;
7605
+ }
7606
+ constructor(e) {
7607
+ super(e, false), this.value = !!e.initialValue, this.on("userInput", () => {
7608
+ this.value = this._value;
7609
+ }), this.on("confirm", (s) => {
7610
+ this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = s, this.state = "submit", this.close();
7611
+ }), this.on("cursor", () => {
7612
+ this.value = !this.value;
7613
+ });
7614
+ }
7615
+ };
7616
+ var Lt = class extends B {
7617
+ static {
7618
+ __name(this, "Lt");
7619
+ }
7620
+ options;
7621
+ cursor = 0;
7622
+ get _value() {
7623
+ return this.options[this.cursor].value;
7624
+ }
7625
+ get _enabledOptions() {
7626
+ return this.options.filter((e) => e.disabled !== true);
7627
+ }
7628
+ toggleAll() {
7629
+ const e = this._enabledOptions, s = this.value !== void 0 && this.value.length === e.length;
7630
+ this.value = s ? [] : e.map((i) => i.value);
7631
+ }
7632
+ toggleInvert() {
7633
+ const e = this.value;
7634
+ if (!e) return;
7635
+ const s = this._enabledOptions.filter((i) => !e.includes(i.value));
7636
+ this.value = s.map((i) => i.value);
7637
+ }
7638
+ toggleValue() {
7639
+ this.value === void 0 && (this.value = []);
7640
+ const e = this.value.includes(this._value);
7641
+ this.value = e ? this.value.filter((s) => s !== this._value) : [...this.value, this._value];
7642
+ }
7643
+ constructor(e) {
7644
+ super(e, false), this.options = e.options, this.value = [...e.initialValues ?? []];
7645
+ const s = Math.max(this.options.findIndex(({ value: i }) => i === e.cursorAt), 0);
7646
+ this.cursor = this.options[s].disabled ? x(s, 1, this.options) : s, this.on("key", (i) => {
7647
+ i === "a" && this.toggleAll(), i === "i" && this.toggleInvert();
7648
+ }), this.on("cursor", (i) => {
7649
+ switch (i) {
7650
+ case "left":
7651
+ case "up":
7652
+ this.cursor = x(this.cursor, -1, this.options);
7653
+ break;
7654
+ case "down":
7655
+ case "right":
7656
+ this.cursor = x(this.cursor, 1, this.options);
7657
+ break;
7658
+ case "space":
7659
+ this.toggleValue();
7660
+ break;
7661
+ }
7662
+ });
7663
+ }
7664
+ };
7665
+ var Tt = class extends B {
7666
+ static {
7667
+ __name(this, "Tt");
7668
+ }
7669
+ options;
7670
+ cursor = 0;
7671
+ get _selectedValue() {
7672
+ return this.options[this.cursor];
7673
+ }
7674
+ changeValue() {
7675
+ this.value = this._selectedValue.value;
7676
+ }
7677
+ constructor(e) {
7678
+ super(e, false), this.options = e.options;
7679
+ const s = this.options.findIndex(({ value: r }) => r === e.initialValue), i = s === -1 ? 0 : s;
7680
+ this.cursor = this.options[i].disabled ? x(i, 1, this.options) : i, this.changeValue(), this.on("cursor", (r) => {
7681
+ switch (r) {
7682
+ case "left":
7683
+ case "up":
7684
+ this.cursor = x(this.cursor, -1, this.options);
7685
+ break;
7686
+ case "down":
7687
+ case "right":
7688
+ this.cursor = x(this.cursor, 1, this.options);
7689
+ break;
7690
+ }
7691
+ this.changeValue();
7692
+ });
7693
+ }
7694
+ };
7695
+
7696
+ // ../../node_modules/.bun/@clack+prompts@1.1.0/node_modules/@clack/prompts/dist/index.mjs
7697
+ __toESM(require_src(), 1);
7698
+ function pt2() {
7699
+ return N2.platform !== "win32" ? N2.env.TERM !== "linux" : !!N2.env.CI || !!N2.env.WT_SESSION || !!N2.env.TERMINUS_SUBLIME || N2.env.ConEmuTask === "{cmd::Cmder}" || N2.env.TERM_PROGRAM === "Terminus-Sublime" || N2.env.TERM_PROGRAM === "vscode" || N2.env.TERM === "xterm-256color" || N2.env.TERM === "alacritty" || N2.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
7700
+ }
7701
+ __name(pt2, "pt");
7702
+ var ee = pt2();
7703
+ var I2 = /* @__PURE__ */ __name((e, r) => ee ? e : r, "I");
7704
+ var Re = I2("\u25C6", "*");
7705
+ var $e = I2("\u25A0", "x");
7706
+ var de = I2("\u25B2", "x");
7707
+ var V = I2("\u25C7", "o");
7708
+ I2("\u250C", "T");
7709
+ var h = I2("\u2502", "|");
7710
+ var x2 = I2("\u2514", "\u2014");
7711
+ I2("\u2510", "T");
7712
+ I2("\u2518", "\u2014");
7713
+ var z2 = I2("\u25CF", ">");
7714
+ var H2 = I2("\u25CB", " ");
7715
+ I2("\u25FB", "[\u2022]");
7716
+ I2("\u25FC", "[+]");
7717
+ I2("\u25FB", "[ ]");
7718
+ I2("\u25AA", "\u2022");
7719
+ I2("\u2500", "-");
7720
+ I2("\u256E", "+");
7721
+ I2("\u251C", "+");
7722
+ I2("\u256F", "+");
7723
+ I2("\u2570", "+");
7724
+ I2("\u256D", "+");
7725
+ I2("\u25CF", "\u2022");
7726
+ I2("\u25C6", "*");
7727
+ I2("\u25B2", "!");
7728
+ I2("\u25A0", "x");
7729
+ var W2 = /* @__PURE__ */ __name((e) => {
7730
+ switch (e) {
7731
+ case "initial":
7732
+ case "active":
7733
+ return styleText("cyan", Re);
7734
+ case "cancel":
7735
+ return styleText("red", $e);
7736
+ case "error":
7737
+ return styleText("yellow", de);
7738
+ case "submit":
7739
+ return styleText("green", V);
7740
+ }
7741
+ }, "W");
7742
+ var ve = /* @__PURE__ */ __name((e) => {
7743
+ switch (e) {
7744
+ case "initial":
7745
+ case "active":
7746
+ return styleText("cyan", h);
7747
+ case "cancel":
7748
+ return styleText("red", h);
7749
+ case "error":
7750
+ return styleText("yellow", h);
7751
+ case "submit":
7752
+ return styleText("green", h);
7753
+ }
7754
+ }, "ve");
7755
+ var mt2 = /* @__PURE__ */ __name((e) => e === 161 || e === 164 || e === 167 || e === 168 || e === 170 || e === 173 || e === 174 || e >= 176 && e <= 180 || e >= 182 && e <= 186 || e >= 188 && e <= 191 || e === 198 || e === 208 || e === 215 || e === 216 || e >= 222 && e <= 225 || e === 230 || e >= 232 && e <= 234 || e === 236 || e === 237 || e === 240 || e === 242 || e === 243 || e >= 247 && e <= 250 || e === 252 || e === 254 || e === 257 || e === 273 || e === 275 || e === 283 || e === 294 || e === 295 || e === 299 || e >= 305 && e <= 307 || e === 312 || e >= 319 && e <= 322 || e === 324 || e >= 328 && e <= 331 || e === 333 || e === 338 || e === 339 || e === 358 || e === 359 || e === 363 || e === 462 || e === 464 || e === 466 || e === 468 || e === 470 || e === 472 || e === 474 || e === 476 || e === 593 || e === 609 || e === 708 || e === 711 || e >= 713 && e <= 715 || e === 717 || e === 720 || e >= 728 && e <= 731 || e === 733 || e === 735 || e >= 768 && e <= 879 || e >= 913 && e <= 929 || e >= 931 && e <= 937 || e >= 945 && e <= 961 || e >= 963 && e <= 969 || e === 1025 || e >= 1040 && e <= 1103 || e === 1105 || e === 8208 || e >= 8211 && e <= 8214 || e === 8216 || e === 8217 || e === 8220 || e === 8221 || e >= 8224 && e <= 8226 || e >= 8228 && e <= 8231 || e === 8240 || e === 8242 || e === 8243 || e === 8245 || e === 8251 || e === 8254 || e === 8308 || e === 8319 || e >= 8321 && e <= 8324 || e === 8364 || e === 8451 || e === 8453 || e === 8457 || e === 8467 || e === 8470 || e === 8481 || e === 8482 || e === 8486 || e === 8491 || e === 8531 || e === 8532 || e >= 8539 && e <= 8542 || e >= 8544 && e <= 8555 || e >= 8560 && e <= 8569 || e === 8585 || e >= 8592 && e <= 8601 || e === 8632 || e === 8633 || e === 8658 || e === 8660 || e === 8679 || e === 8704 || e === 8706 || e === 8707 || e === 8711 || e === 8712 || e === 8715 || e === 8719 || e === 8721 || e === 8725 || e === 8730 || e >= 8733 && e <= 8736 || e === 8739 || e === 8741 || e >= 8743 && e <= 8748 || e === 8750 || e >= 8756 && e <= 8759 || e === 8764 || e === 8765 || e === 8776 || e === 8780 || e === 8786 || e === 8800 || e === 8801 || e >= 8804 && e <= 8807 || e === 8810 || e === 8811 || e === 8814 || e === 8815 || e === 8834 || e === 8835 || e === 8838 || e === 8839 || e === 8853 || e === 8857 || e === 8869 || e === 8895 || e === 8978 || e >= 9312 && e <= 9449 || e >= 9451 && e <= 9547 || e >= 9552 && e <= 9587 || e >= 9600 && e <= 9615 || e >= 9618 && e <= 9621 || e === 9632 || e === 9633 || e >= 9635 && e <= 9641 || e === 9650 || e === 9651 || e === 9654 || e === 9655 || e === 9660 || e === 9661 || e === 9664 || e === 9665 || e >= 9670 && e <= 9672 || e === 9675 || e >= 9678 && e <= 9681 || e >= 9698 && e <= 9701 || e === 9711 || e === 9733 || e === 9734 || e === 9737 || e === 9742 || e === 9743 || e === 9756 || e === 9758 || e === 9792 || e === 9794 || e === 9824 || e === 9825 || e >= 9827 && e <= 9829 || e >= 9831 && e <= 9834 || e === 9836 || e === 9837 || e === 9839 || e === 9886 || e === 9887 || e === 9919 || e >= 9926 && e <= 9933 || e >= 9935 && e <= 9939 || e >= 9941 && e <= 9953 || e === 9955 || e === 9960 || e === 9961 || e >= 9963 && e <= 9969 || e === 9972 || e >= 9974 && e <= 9977 || e === 9979 || e === 9980 || e === 9982 || e === 9983 || e === 10045 || e >= 10102 && e <= 10111 || e >= 11094 && e <= 11097 || e >= 12872 && e <= 12879 || e >= 57344 && e <= 63743 || e >= 65024 && e <= 65039 || e === 65533 || e >= 127232 && e <= 127242 || e >= 127248 && e <= 127277 || e >= 127280 && e <= 127337 || e >= 127344 && e <= 127373 || e === 127375 || e === 127376 || e >= 127387 && e <= 127404 || e >= 917760 && e <= 917999 || e >= 983040 && e <= 1048573 || e >= 1048576 && e <= 1114109, "mt");
7756
+ var gt2 = /* @__PURE__ */ __name((e) => e === 12288 || e >= 65281 && e <= 65376 || e >= 65504 && e <= 65510, "gt");
7757
+ var ft2 = /* @__PURE__ */ __name((e) => e >= 4352 && e <= 4447 || e === 8986 || e === 8987 || e === 9001 || e === 9002 || e >= 9193 && e <= 9196 || e === 9200 || e === 9203 || e === 9725 || e === 9726 || e === 9748 || e === 9749 || e >= 9800 && e <= 9811 || e === 9855 || e === 9875 || e === 9889 || e === 9898 || e === 9899 || e === 9917 || e === 9918 || e === 9924 || e === 9925 || e === 9934 || e === 9940 || e === 9962 || e === 9970 || e === 9971 || e === 9973 || e === 9978 || e === 9981 || e === 9989 || e === 9994 || e === 9995 || e === 10024 || e === 10060 || e === 10062 || e >= 10067 && e <= 10069 || e === 10071 || e >= 10133 && e <= 10135 || e === 10160 || e === 10175 || e === 11035 || e === 11036 || e === 11088 || e === 11093 || e >= 11904 && e <= 11929 || e >= 11931 && e <= 12019 || e >= 12032 && e <= 12245 || e >= 12272 && e <= 12287 || e >= 12289 && e <= 12350 || e >= 12353 && e <= 12438 || e >= 12441 && e <= 12543 || e >= 12549 && e <= 12591 || e >= 12593 && e <= 12686 || e >= 12688 && e <= 12771 || e >= 12783 && e <= 12830 || e >= 12832 && e <= 12871 || e >= 12880 && e <= 19903 || e >= 19968 && e <= 42124 || e >= 42128 && e <= 42182 || e >= 43360 && e <= 43388 || e >= 44032 && e <= 55203 || e >= 63744 && e <= 64255 || e >= 65040 && e <= 65049 || e >= 65072 && e <= 65106 || e >= 65108 && e <= 65126 || e >= 65128 && e <= 65131 || e >= 94176 && e <= 94180 || e === 94192 || e === 94193 || e >= 94208 && e <= 100343 || e >= 100352 && e <= 101589 || e >= 101632 && e <= 101640 || e >= 110576 && e <= 110579 || e >= 110581 && e <= 110587 || e === 110589 || e === 110590 || e >= 110592 && e <= 110882 || e === 110898 || e >= 110928 && e <= 110930 || e === 110933 || e >= 110948 && e <= 110951 || e >= 110960 && e <= 111355 || e === 126980 || e === 127183 || e === 127374 || e >= 127377 && e <= 127386 || e >= 127488 && e <= 127490 || e >= 127504 && e <= 127547 || e >= 127552 && e <= 127560 || e === 127568 || e === 127569 || e >= 127584 && e <= 127589 || e >= 127744 && e <= 127776 || e >= 127789 && e <= 127797 || e >= 127799 && e <= 127868 || e >= 127870 && e <= 127891 || e >= 127904 && e <= 127946 || e >= 127951 && e <= 127955 || e >= 127968 && e <= 127984 || e === 127988 || e >= 127992 && e <= 128062 || e === 128064 || e >= 128066 && e <= 128252 || e >= 128255 && e <= 128317 || e >= 128331 && e <= 128334 || e >= 128336 && e <= 128359 || e === 128378 || e === 128405 || e === 128406 || e === 128420 || e >= 128507 && e <= 128591 || e >= 128640 && e <= 128709 || e === 128716 || e >= 128720 && e <= 128722 || e >= 128725 && e <= 128727 || e >= 128732 && e <= 128735 || e === 128747 || e === 128748 || e >= 128756 && e <= 128764 || e >= 128992 && e <= 129003 || e === 129008 || e >= 129292 && e <= 129338 || e >= 129340 && e <= 129349 || e >= 129351 && e <= 129535 || e >= 129648 && e <= 129660 || e >= 129664 && e <= 129672 || e >= 129680 && e <= 129725 || e >= 129727 && e <= 129733 || e >= 129742 && e <= 129755 || e >= 129760 && e <= 129768 || e >= 129776 && e <= 129784 || e >= 131072 && e <= 196605 || e >= 196608 && e <= 262141, "ft");
7758
+ var we = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;
7759
+ var re = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
7760
+ var ie = /\t{1,1000}/y;
7761
+ var Ae = new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*", "yu");
7762
+ var ne = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
7763
+ var Ft2 = new RegExp("\\p{M}+", "gu");
7764
+ var yt2 = { limit: 1 / 0, ellipsis: "" };
7765
+ var Le = /* @__PURE__ */ __name((e, r = {}, s = {}) => {
7766
+ const i = r.limit ?? 1 / 0, a2 = r.ellipsis ?? "", o = r?.ellipsisWidth ?? (a2 ? Le(a2, yt2, s).width : 0), u = s.ansiWidth ?? 0, l = s.controlWidth ?? 0, n = s.tabWidth ?? 8, c = s.ambiguousWidth ?? 1, p = s.emojiWidth ?? 2, f = s.fullWidthWidth ?? 2, g = s.regularWidth ?? 1, E = s.wideWidth ?? 2;
7767
+ let $ = 0, m = 0, d = e.length, F = 0, y2 = false, v = d, C = Math.max(0, i - o), A = 0, b = 0, w = 0, S2 = 0;
7768
+ e: for (; ; ) {
7769
+ if (b > A || m >= d && m > $) {
7770
+ const T2 = e.slice(A, b) || e.slice($, m);
7771
+ F = 0;
7772
+ for (const M2 of T2.replaceAll(Ft2, "")) {
7773
+ const O2 = M2.codePointAt(0) || 0;
7774
+ if (gt2(O2) ? S2 = f : ft2(O2) ? S2 = E : c !== g && mt2(O2) ? S2 = c : S2 = g, w + S2 > C && (v = Math.min(v, Math.max(A, $) + F)), w + S2 > i) {
7775
+ y2 = true;
7776
+ break e;
7777
+ }
7778
+ F += M2.length, w += S2;
7779
+ }
7780
+ A = b = 0;
7781
+ }
7782
+ if (m >= d) break;
7783
+ if (ne.lastIndex = m, ne.test(e)) {
7784
+ if (F = ne.lastIndex - m, S2 = F * g, w + S2 > C && (v = Math.min(v, m + Math.floor((C - w) / g))), w + S2 > i) {
7785
+ y2 = true;
7786
+ break;
7787
+ }
7788
+ w += S2, A = $, b = m, m = $ = ne.lastIndex;
7789
+ continue;
7790
+ }
7791
+ if (we.lastIndex = m, we.test(e)) {
7792
+ if (w + u > C && (v = Math.min(v, m)), w + u > i) {
7793
+ y2 = true;
7794
+ break;
7795
+ }
7796
+ w += u, A = $, b = m, m = $ = we.lastIndex;
7797
+ continue;
7798
+ }
7799
+ if (re.lastIndex = m, re.test(e)) {
7800
+ if (F = re.lastIndex - m, S2 = F * l, w + S2 > C && (v = Math.min(v, m + Math.floor((C - w) / l))), w + S2 > i) {
7801
+ y2 = true;
7802
+ break;
7803
+ }
7804
+ w += S2, A = $, b = m, m = $ = re.lastIndex;
7805
+ continue;
7806
+ }
7807
+ if (ie.lastIndex = m, ie.test(e)) {
7808
+ if (F = ie.lastIndex - m, S2 = F * n, w + S2 > C && (v = Math.min(v, m + Math.floor((C - w) / n))), w + S2 > i) {
7809
+ y2 = true;
7810
+ break;
7811
+ }
7812
+ w += S2, A = $, b = m, m = $ = ie.lastIndex;
7813
+ continue;
7814
+ }
7815
+ if (Ae.lastIndex = m, Ae.test(e)) {
7816
+ if (w + p > C && (v = Math.min(v, m)), w + p > i) {
7817
+ y2 = true;
7818
+ break;
7819
+ }
7820
+ w += p, A = $, b = m, m = $ = Ae.lastIndex;
7821
+ continue;
7822
+ }
7823
+ m += 1;
7824
+ }
7825
+ return { width: y2 ? C : w, index: y2 ? v : d, truncated: y2, ellipsed: y2 && i >= o };
7826
+ }, "Le");
7827
+ var Et2 = { limit: 1 / 0, ellipsis: "", ellipsisWidth: 0 };
7828
+ var D2 = /* @__PURE__ */ __name((e, r = {}) => Le(e, Et2, r).width, "D");
7829
+ var ae = "\x1B";
7830
+ var je = "\x9B";
7831
+ var vt2 = 39;
7832
+ var Ce = "\x07";
7833
+ var ke = "[";
7834
+ var wt = "]";
7835
+ var Ve = "m";
7836
+ var Se = `${wt}8;;`;
7837
+ var He = new RegExp(`(?:\\${ke}(?<code>\\d+)m|\\${Se}(?<uri>.*)${Ce})`, "y");
7838
+ var At2 = /* @__PURE__ */ __name((e) => {
7839
+ if (e >= 30 && e <= 37 || e >= 90 && e <= 97) return 39;
7840
+ if (e >= 40 && e <= 47 || e >= 100 && e <= 107) return 49;
7841
+ if (e === 1 || e === 2) return 22;
7842
+ if (e === 3) return 23;
7843
+ if (e === 4) return 24;
7844
+ if (e === 7) return 27;
7845
+ if (e === 8) return 28;
7846
+ if (e === 9) return 29;
7847
+ if (e === 0) return 0;
7848
+ }, "At");
7849
+ var Ue = /* @__PURE__ */ __name((e) => `${ae}${ke}${e}${Ve}`, "Ue");
7850
+ var Ke = /* @__PURE__ */ __name((e) => `${ae}${Se}${e}${Ce}`, "Ke");
7851
+ var Ct2 = /* @__PURE__ */ __name((e) => e.map((r) => D2(r)), "Ct");
7852
+ var Ie = /* @__PURE__ */ __name((e, r, s) => {
7853
+ const i = r[Symbol.iterator]();
7854
+ let a2 = false, o = false, u = e.at(-1), l = u === void 0 ? 0 : D2(u), n = i.next(), c = i.next(), p = 0;
7855
+ for (; !n.done; ) {
7856
+ const f = n.value, g = D2(f);
7857
+ l + g <= s ? e[e.length - 1] += f : (e.push(f), l = 0), (f === ae || f === je) && (a2 = true, o = r.startsWith(Se, p + 1)), a2 ? o ? f === Ce && (a2 = false, o = false) : f === Ve && (a2 = false) : (l += g, l === s && !c.done && (e.push(""), l = 0)), n = c, c = i.next(), p += f.length;
7858
+ }
7859
+ u = e.at(-1), !l && u !== void 0 && u.length > 0 && e.length > 1 && (e[e.length - 2] += e.pop());
7860
+ }, "Ie");
7861
+ var St = /* @__PURE__ */ __name((e) => {
7862
+ const r = e.split(" ");
7863
+ let s = r.length;
7864
+ for (; s > 0 && !(D2(r[s - 1]) > 0); ) s--;
7865
+ return s === r.length ? e : r.slice(0, s).join(" ") + r.slice(s).join("");
7866
+ }, "St");
7867
+ var It2 = /* @__PURE__ */ __name((e, r, s = {}) => {
7868
+ if (s.trim !== false && e.trim() === "") return "";
7869
+ let i = "", a2, o;
7870
+ const u = e.split(" "), l = Ct2(u);
7871
+ let n = [""];
7872
+ for (const [$, m] of u.entries()) {
7873
+ s.trim !== false && (n[n.length - 1] = (n.at(-1) ?? "").trimStart());
7874
+ let d = D2(n.at(-1) ?? "");
7875
+ if ($ !== 0 && (d >= r && (s.wordWrap === false || s.trim === false) && (n.push(""), d = 0), (d > 0 || s.trim === false) && (n[n.length - 1] += " ", d++)), s.hard && l[$] > r) {
7876
+ const F = r - d, y2 = 1 + Math.floor((l[$] - F - 1) / r);
7877
+ Math.floor((l[$] - 1) / r) < y2 && n.push(""), Ie(n, m, r);
7878
+ continue;
7879
+ }
7880
+ if (d + l[$] > r && d > 0 && l[$] > 0) {
7881
+ if (s.wordWrap === false && d < r) {
7882
+ Ie(n, m, r);
7883
+ continue;
7884
+ }
7885
+ n.push("");
7886
+ }
7887
+ if (d + l[$] > r && s.wordWrap === false) {
7888
+ Ie(n, m, r);
7889
+ continue;
7890
+ }
7891
+ n[n.length - 1] += m;
7892
+ }
7893
+ s.trim !== false && (n = n.map(($) => St($)));
7894
+ const c = n.join(`
7895
+ `), p = c[Symbol.iterator]();
7896
+ let f = p.next(), g = p.next(), E = 0;
7897
+ for (; !f.done; ) {
7898
+ const $ = f.value, m = g.value;
7899
+ if (i += $, $ === ae || $ === je) {
7900
+ He.lastIndex = E + 1;
7901
+ const y2 = He.exec(c)?.groups;
7902
+ if (y2?.code !== void 0) {
7903
+ const v = Number.parseFloat(y2.code);
7904
+ a2 = v === vt2 ? void 0 : v;
7905
+ } else y2?.uri !== void 0 && (o = y2.uri.length === 0 ? void 0 : y2.uri);
7906
+ }
7907
+ const d = a2 ? At2(a2) : void 0;
7908
+ m === `
7909
+ ` ? (o && (i += Ke("")), a2 && d && (i += Ue(d))) : $ === `
7910
+ ` && (a2 && d && (i += Ue(a2)), o && (i += Ke(o))), E += $.length, f = g, g = p.next();
7911
+ }
7912
+ return i;
7913
+ }, "It");
7914
+ function J2(e, r, s) {
7915
+ return String(e).normalize().replaceAll(`\r
7916
+ `, `
7917
+ `).split(`
7918
+ `).map((i) => It2(i, r, s)).join(`
7919
+ `);
7920
+ }
7921
+ __name(J2, "J");
7922
+ var bt2 = /* @__PURE__ */ __name((e, r, s, i, a2) => {
7923
+ let o = r, u = 0;
7924
+ for (let l = s; l < i; l++) {
7925
+ const n = e[l];
7926
+ if (o = o - n.length, u++, o <= a2) break;
7927
+ }
7928
+ return { lineCount: o, removals: u };
7929
+ }, "bt");
7930
+ var X2 = /* @__PURE__ */ __name(({ cursor: e, options: r, style: s, output: i = process.stdout, maxItems: a2 = Number.POSITIVE_INFINITY, columnPadding: o = 0, rowPadding: u = 4 }) => {
7931
+ const l = rt(i) - o, n = nt(i), c = styleText("dim", "..."), p = Math.max(n - u, 0), f = Math.max(Math.min(a2, p), 5);
7932
+ let g = 0;
7933
+ e >= f - 3 && (g = Math.max(Math.min(e - f + 3, r.length - f), 0));
7934
+ let E = f < r.length && g > 0, $ = f < r.length && g + f < r.length;
7935
+ const m = Math.min(g + f, r.length), d = [];
7936
+ let F = 0;
7937
+ E && F++, $ && F++;
7938
+ const y2 = g + (E ? 1 : 0), v = m - ($ ? 1 : 0);
7939
+ for (let A = y2; A < v; A++) {
7940
+ const b = J2(s(r[A], A === e), l, { hard: true, trim: false }).split(`
7941
+ `);
7942
+ d.push(b), F += b.length;
7943
+ }
7944
+ if (F > p) {
7945
+ let A = 0, b = 0, w = F;
7946
+ const S2 = e - y2, T2 = /* @__PURE__ */ __name((M2, O2) => bt2(d, w, M2, O2, p), "T");
7947
+ E ? ({ lineCount: w, removals: A } = T2(0, S2), w > p && ({ lineCount: w, removals: b } = T2(S2 + 1, d.length))) : ({ lineCount: w, removals: b } = T2(S2 + 1, d.length), w > p && ({ lineCount: w, removals: A } = T2(0, S2))), A > 0 && (E = true, d.splice(0, A)), b > 0 && ($ = true, d.splice(d.length - b, b));
7948
+ }
7949
+ const C = [];
7950
+ E && C.push(c);
7951
+ for (const A of d) for (const b of A) C.push(b);
7952
+ return $ && C.push(c), C;
7953
+ }, "X");
7954
+ ({ light: I2("\u2500", "-"), heavy: I2("\u2501", "="), block: I2("\u2588", "#") });
7955
+ var oe = /* @__PURE__ */ __name((e, r) => e.includes(`
7956
+ `) ? e.split(`
7957
+ `).map((s) => r(s)).join(`
7958
+ `) : r(e), "oe");
7959
+ var Jt = /* @__PURE__ */ __name((e) => {
7960
+ const r = /* @__PURE__ */ __name((s, i) => {
7961
+ const a2 = s.label ?? String(s.value);
7962
+ switch (i) {
7963
+ case "disabled":
7964
+ return `${styleText("gray", H2)} ${oe(a2, (o) => styleText("gray", o))}${s.hint ? ` ${styleText("dim", `(${s.hint ?? "disabled"})`)}` : ""}`;
7965
+ case "selected":
7966
+ return `${oe(a2, (o) => styleText("dim", o))}`;
7967
+ case "active":
7968
+ return `${styleText("green", z2)} ${a2}${s.hint ? ` ${styleText("dim", `(${s.hint})`)}` : ""}`;
7969
+ case "cancelled":
7970
+ return `${oe(a2, (o) => styleText(["strikethrough", "dim"], o))}`;
7971
+ default:
7972
+ return `${styleText("dim", H2)} ${oe(a2, (o) => styleText("dim", o))}`;
7973
+ }
7974
+ }, "r");
7975
+ return new Tt({ options: e.options, signal: e.signal, input: e.input, output: e.output, initialValue: e.initialValue, render() {
7976
+ const s = e.withGuide ?? _.withGuide, i = `${W2(this.state)} `, a2 = `${ve(this.state)} `, o = Bt(e.output, e.message, a2, i), u = `${s ? `${styleText("gray", h)}
7977
+ ` : ""}${o}
7978
+ `;
7979
+ switch (this.state) {
7980
+ case "submit": {
7981
+ const l = s ? `${styleText("gray", h)} ` : "", n = Bt(e.output, r(this.options[this.cursor], "selected"), l);
7982
+ return `${u}${n}`;
7983
+ }
7984
+ case "cancel": {
7985
+ const l = s ? `${styleText("gray", h)} ` : "", n = Bt(e.output, r(this.options[this.cursor], "cancelled"), l);
7986
+ return `${u}${n}${s ? `
7987
+ ${styleText("gray", h)}` : ""}`;
7988
+ }
7989
+ default: {
7990
+ const l = s ? `${styleText("cyan", h)} ` : "", n = s ? styleText("cyan", x2) : "", c = u.split(`
7991
+ `).length, p = s ? 2 : 1;
7992
+ return `${u}${l}${X2({ output: e.output, cursor: this.cursor, options: this.options, maxItems: e.maxItems, columnPadding: l.length, rowPadding: c + p, style: /* @__PURE__ */ __name((f, g) => r(f, f.disabled ? "disabled" : g ? "active" : "inactive"), "style") }).join(`
7993
+ ${l}`)}
7994
+ ${n}
7995
+ `;
7996
+ }
7997
+ }
7998
+ } }).prompt();
7999
+ }, "Jt");
8000
+ `${styleText("gray", h)} `;
7200
8001
  function getUserVarlockDir() {
7201
8002
  const home = os.homedir();
7202
8003
  if (process.env.XDG_CONFIG_HOME) {
@@ -7209,6 +8010,251 @@ function getUserVarlockDir() {
7209
8010
  return join(home, ".config", "varlock");
7210
8011
  }
7211
8012
  __name(getUserVarlockDir, "getUserVarlockDir");
8013
+ function isUnicodeSupported() {
8014
+ const { env } = N2;
8015
+ const { TERM, TERM_PROGRAM } = env;
8016
+ if (N2.platform !== "win32") {
8017
+ return TERM !== "linux";
8018
+ }
8019
+ return Boolean(env.WT_SESSION) || Boolean(env.TERMINUS_SUBLIME) || env.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
8020
+ }
8021
+ __name(isUnicodeSupported, "isUnicodeSupported");
8022
+
8023
+ // src/cli/helpers/prompts.ts
8024
+ var unicode = isUnicodeSupported();
8025
+ var unicodeOr = /* @__PURE__ */ __name((c, fallback) => unicode ? c : fallback, "unicodeOr");
8026
+ var S_STEP_ACTIVE = unicodeOr("\u25C6", "*");
8027
+ var S_STEP_CANCEL = unicodeOr("\u25A0", "x");
8028
+ var S_STEP_ERROR = unicodeOr("\u25B2", "x");
8029
+ var S_STEP_SUBMIT = unicodeOr("\u25C7", "o");
8030
+ unicodeOr("\u250C", "T");
8031
+ var S_BAR = unicodeOr("\u2502", "|");
8032
+ var S_BAR_END = unicodeOr("\u2514", "\u2014");
8033
+ var S_RADIO_ACTIVE = unicodeOr("\u25CF", ">");
8034
+ var S_RADIO_INACTIVE = unicodeOr("\u25CB", " ");
8035
+ var S_CHECKBOX_ACTIVE = unicodeOr("\u25FB", "[\u2022]");
8036
+ var S_CHECKBOX_SELECTED = unicodeOr("\u25FC", "[+]");
8037
+ var S_CHECKBOX_INACTIVE = unicodeOr("\u25FB", "[ ]");
8038
+ unicodeOr("\u25AA", "\u2022");
8039
+ unicodeOr("\u2500", "-");
8040
+ unicodeOr("\u256E", "+");
8041
+ unicodeOr("\u251C", "+");
8042
+ unicodeOr("\u256F", "+");
8043
+ unicodeOr("\u25CF", "\u2022");
8044
+ unicodeOr("\u25C6", "*");
8045
+ unicodeOr("\u25B2", "!");
8046
+ unicodeOr("\u25A0", "x");
8047
+ var symbol = /* @__PURE__ */ __name((state) => {
8048
+ switch (state) {
8049
+ case "initial":
8050
+ case "active":
8051
+ return ansis_default.cyan(S_STEP_ACTIVE);
8052
+ case "cancel":
8053
+ return ansis_default.red(S_STEP_CANCEL);
8054
+ case "error":
8055
+ return ansis_default.yellow(S_STEP_ERROR);
8056
+ case "submit":
8057
+ return ansis_default.green(S_STEP_SUBMIT);
8058
+ }
8059
+ }, "symbol");
8060
+ var limitOptions = /* @__PURE__ */ __name((params) => {
8061
+ const { cursor, options, style } = params;
8062
+ const output = params.output ?? process.stdout;
8063
+ const rows = output instanceof WriteStream && output.rows !== void 0 ? output.rows : 10;
8064
+ const paramMaxItems = params.maxItems ?? Number.POSITIVE_INFINITY;
8065
+ const outputMaxItems = Math.max(rows - 4, 0);
8066
+ const maxItems = Math.min(outputMaxItems, Math.max(paramMaxItems, 5));
8067
+ let slidingWindowLocation = 0;
8068
+ if (cursor >= slidingWindowLocation + maxItems - 3) {
8069
+ slidingWindowLocation = Math.max(Math.min(cursor - maxItems + 3, options.length - maxItems), 0);
8070
+ } else if (cursor < slidingWindowLocation + 2) {
8071
+ slidingWindowLocation = Math.max(cursor - 2, 0);
8072
+ }
8073
+ const shouldRenderTopEllipsis = maxItems < options.length && slidingWindowLocation > 0;
8074
+ const shouldRenderBottomEllipsis = maxItems < options.length && slidingWindowLocation + maxItems < options.length;
8075
+ return options.slice(slidingWindowLocation, slidingWindowLocation + maxItems).map((option, i, arr) => {
8076
+ const isTopLimit = i === 0 && shouldRenderTopEllipsis;
8077
+ const isBottomLimit = i === arr.length - 1 && shouldRenderBottomEllipsis;
8078
+ return isTopLimit || isBottomLimit ? ansis_default.dim("...") : style(option, i + slidingWindowLocation === cursor);
8079
+ });
8080
+ }, "limitOptions");
8081
+ var confirm = /* @__PURE__ */ __name((opts) => {
8082
+ const active = opts.active ?? "Yes";
8083
+ const inactive = opts.inactive ?? "No";
8084
+ return new kt({
8085
+ active,
8086
+ inactive,
8087
+ input: opts.input,
8088
+ output: opts.output,
8089
+ initialValue: opts.initialValue ?? true,
8090
+ render() {
8091
+ const title = `
8092
+ ${symbol(this.state)} ${opts.message}
8093
+ `;
8094
+ const value = this.value ? active : inactive;
8095
+ switch (this.state) {
8096
+ case "submit":
8097
+ return `${title}\u200E ${ansis_default.dim(value)}`;
8098
+ case "cancel":
8099
+ return `${title}\u200E ${ansis_default.strikethrough(
8100
+ ansis_default.dim(value)
8101
+ )}
8102
+ `;
8103
+ default: {
8104
+ return `${title}\u200E ${this.value ? `${ansis_default.green(S_RADIO_ACTIVE)} ${active}` : `${ansis_default.dim(S_RADIO_INACTIVE)} ${ansis_default.dim(active)}`} ${ansis_default.dim("/")} ${!this.value ? `${ansis_default.green(S_RADIO_ACTIVE)} ${inactive}` : `${ansis_default.dim(S_RADIO_INACTIVE)} ${ansis_default.dim(inactive)}`}
8105
+ `;
8106
+ }
8107
+ }
8108
+ }
8109
+ }).prompt();
8110
+ }, "confirm");
8111
+ var select = /* @__PURE__ */ __name((opts) => {
8112
+ const opt = /* @__PURE__ */ __name((option, state) => {
8113
+ const label = option.label ?? String(option.value);
8114
+ switch (state) {
8115
+ case "selected":
8116
+ return `${ansis_default.dim(label)}`;
8117
+ case "active":
8118
+ return `${ansis_default.green(S_RADIO_ACTIVE)} ${label} ${option.hint ? ansis_default.dim(`(${option.hint})`) : ""}`;
8119
+ case "cancelled":
8120
+ return `${ansis_default.strikethrough(ansis_default.dim(label))}`;
8121
+ default:
8122
+ return `${ansis_default.dim(S_RADIO_INACTIVE)} ${ansis_default.dim(label)}`;
8123
+ }
8124
+ }, "opt");
8125
+ return new Tt({
8126
+ options: opts.options,
8127
+ input: opts.input,
8128
+ output: opts.output,
8129
+ initialValue: opts.initialValue,
8130
+ render() {
8131
+ const title = `${ansis_default.gray(S_BAR)}
8132
+ ${symbol(this.state)} ${opts.message}
8133
+ `;
8134
+ switch (this.state) {
8135
+ case "submit":
8136
+ return `${title}${ansis_default.gray(S_BAR)} ${opt(this.options[this.cursor], "selected")}`;
8137
+ case "cancel":
8138
+ return `${title}${ansis_default.gray(S_BAR)} ${opt(
8139
+ this.options[this.cursor],
8140
+ "cancelled"
8141
+ )}
8142
+ ${ansis_default.gray(S_BAR)}`;
8143
+ default: {
8144
+ return `${title}${ansis_default.cyan(S_BAR)} ${limitOptions({
8145
+ output: opts.output,
8146
+ cursor: this.cursor,
8147
+ options: this.options,
8148
+ maxItems: opts.maxItems,
8149
+ style: /* @__PURE__ */ __name((item, active) => opt(item, active ? "active" : "inactive"), "style")
8150
+ }).join(`
8151
+ ${ansis_default.cyan(S_BAR)} `)}
8152
+ ${ansis_default.cyan(S_BAR_END)}
8153
+ `;
8154
+ }
8155
+ }
8156
+ }
8157
+ }).prompt();
8158
+ }, "select");
8159
+ var multiselect = /* @__PURE__ */ __name((opts) => {
8160
+ const opt = /* @__PURE__ */ __name((option, state) => {
8161
+ const label = option.label ?? String(option.value);
8162
+ if (state === "active") {
8163
+ return `${ansis_default.cyan(S_CHECKBOX_ACTIVE)} ${label} ${option.hint ? ansis_default.dim(`(${option.hint})`) : ""}`;
8164
+ }
8165
+ if (state === "selected") {
8166
+ return `${ansis_default.green(S_CHECKBOX_SELECTED)} ${ansis_default.dim(label)} ${option.hint ? ansis_default.dim(`(${option.hint})`) : ""}`;
8167
+ }
8168
+ if (state === "cancelled") {
8169
+ return `${ansis_default.strikethrough(ansis_default.dim(label))}`;
8170
+ }
8171
+ if (state === "active-selected") {
8172
+ return `${ansis_default.green(S_CHECKBOX_SELECTED)} ${label} ${option.hint ? ansis_default.dim(`(${option.hint})`) : ""}`;
8173
+ }
8174
+ if (state === "submitted") {
8175
+ return `${ansis_default.dim(label)}`;
8176
+ }
8177
+ return `${ansis_default.dim(S_CHECKBOX_INACTIVE)} ${ansis_default.dim(label)}`;
8178
+ }, "opt");
8179
+ return new Lt({
8180
+ options: opts.options,
8181
+ input: opts.input,
8182
+ output: opts.output,
8183
+ initialValues: opts.initialValues,
8184
+ required: opts.required ?? true,
8185
+ cursorAt: opts.cursorAt,
8186
+ validate(selected) {
8187
+ if (this.required && (!selected || selected.length === 0)) {
8188
+ return `Please select at least one option.
8189
+ ${ansis_default.reset(
8190
+ ansis_default.dim(
8191
+ `Press ${ansis_default.gray(ansis_default.bgWhite(ansis_default.inverse(" space ")))} to select, ${ansis_default.gray(
8192
+ ansis_default.bgWhite(ansis_default.inverse(" enter "))
8193
+ )} to submit`
8194
+ )
8195
+ )}`;
8196
+ }
8197
+ },
8198
+ render() {
8199
+ let title = `${ansis_default.gray(S_BAR)}
8200
+ ${symbol(this.state)} ${opts.message}
8201
+ `;
8202
+ if (opts.details) title += `${ansis_default.gray(S_BAR)} ${opts.details}
8203
+ `;
8204
+ const styleOption = /* @__PURE__ */ __name((option, active) => {
8205
+ const selected = this.value?.includes(option.value);
8206
+ if (active && selected) {
8207
+ return opt(option, "active-selected");
8208
+ }
8209
+ if (selected) {
8210
+ return opt(option, "selected");
8211
+ }
8212
+ return opt(option, active ? "active" : "inactive");
8213
+ }, "styleOption");
8214
+ switch (this.state) {
8215
+ case "submit": {
8216
+ return `${title}${ansis_default.gray(S_BAR)} ${this.options.filter(({ value }) => this.value?.includes(value)).map((option) => opt(option, "submitted")).join(ansis_default.dim(", ")) || ansis_default.dim("none")}`;
8217
+ }
8218
+ case "cancel": {
8219
+ const label = this.options.filter(({ value }) => this.value?.includes(value)).map((option) => opt(option, "cancelled")).join(ansis_default.dim(", "));
8220
+ return `${title}${ansis_default.gray(S_BAR)} ${label.trim() ? `${label}
8221
+ ${ansis_default.gray(S_BAR)}` : ""}`;
8222
+ }
8223
+ case "error": {
8224
+ const footer = this.error.split("\n").map((ln, i) => i === 0 ? `${ansis_default.yellow(S_BAR_END)} ${ansis_default.yellow(ln)}` : ` ${ln}`).join("\n");
8225
+ return `${title + ansis_default.yellow(S_BAR)} ${limitOptions({
8226
+ output: opts.output,
8227
+ options: this.options,
8228
+ cursor: this.cursor,
8229
+ maxItems: opts.maxItems,
8230
+ style: styleOption
8231
+ }).join(`
8232
+ ${ansis_default.yellow(S_BAR)} `)}
8233
+ ${footer}
8234
+ `;
8235
+ }
8236
+ default: {
8237
+ return `${title}${ansis_default.cyan(S_BAR)} ${limitOptions({
8238
+ output: opts.output,
8239
+ options: this.options,
8240
+ cursor: this.cursor,
8241
+ maxItems: opts.maxItems,
8242
+ style: styleOption
8243
+ }).join(`
8244
+ ${ansis_default.cyan(S_BAR)} `)}
8245
+ ${ansis_default.cyan(S_BAR_END)}
8246
+ `;
8247
+ }
8248
+ }
8249
+ }
8250
+ }).prompt();
8251
+ }, "multiselect");
8252
+ var prompts = {
8253
+ confirm,
8254
+ select,
8255
+ multiselect
8256
+ };
8257
+ var prompts_default = prompts;
7212
8258
 
7213
8259
  // src/env-graph/lib/error-location.ts
7214
8260
  function getErrorLocation(source, parserNode) {
@@ -7571,7 +8617,7 @@ var builtInRootDecorators = [
7571
8617
  dataSource._loadingError = err instanceof SchemaError ? err : new SchemaError(err);
7572
8618
  return;
7573
8619
  }
7574
- const { ConfigItem: ConfigItem2 } = await import('./config-item-VMLNH4QK.js');
8620
+ const { ConfigItem: ConfigItem2 } = await import('./config-item-I7ZL2FXU.js');
7575
8621
  for (const [key, entry] of Object.entries(entries)) {
7576
8622
  const existsInSchema = key in graph.configSchema;
7577
8623
  if (!existsInSchema && !createMissing) {
@@ -8103,13 +9149,13 @@ function buildRaw(platform, env) {
8103
9149
  ];
8104
9150
  const raw = {};
8105
9151
  let hasAny = false;
8106
- for (const k of keys) {
8107
- const ext = platform[k];
9152
+ for (const k2 of keys) {
9153
+ const ext = platform[k2];
8108
9154
  if (typeof ext === "string" && env[ext]) {
8109
9155
  raw[ext] = env[ext];
8110
9156
  hasAny = true;
8111
9157
  }
8112
- if (k === "environment" && typeof ext === "object" && ext !== null && "var" in ext && env[ext.var]) {
9158
+ if (k2 === "environment" && typeof ext === "object" && ext !== null && "var" in ext && env[ext.var]) {
8113
9159
  raw[ext.var] = env[ext.var];
8114
9160
  hasAny = true;
8115
9161
  }
@@ -8918,10 +9964,10 @@ function detectWorkspaceInfo(opts) {
8918
9964
  break;
8919
9965
  }
8920
9966
  if (multipleLockfilesDetected) break;
9967
+ if (pathExistsSync(path2.join(cwd, ".git"))) break;
8921
9968
  const parentDir = path2.dirname(cwd);
8922
9969
  if (parentDir === cwd) break;
8923
9970
  cwd = parentDir;
8924
- if (pathExistsSync(path2.join(cwd, ".git"))) break;
8925
9971
  } while (cwd);
8926
9972
  if (!foundPm) {
8927
9973
  if (process.env.npm_config_user_agent) {
@@ -9135,7 +10181,7 @@ var VarlockPlugin = class {
9135
10181
  const { initDecorator, params } = this.standardVars;
9136
10182
  const resolved = Object.entries(params).map(([paramName, { key, dataType }]) => {
9137
10183
  const keys = Array.isArray(key) ? key : [key];
9138
- const matchedKey = keys.find((k) => graph.overrideValues[k]);
10184
+ const matchedKey = keys.find((k2) => graph.overrideValues[k2]);
9139
10185
  return {
9140
10186
  paramName,
9141
10187
  matchedKey,
@@ -9298,6 +10344,21 @@ async function registerPluginInGraph(graph, plugin, pluginDecorator) {
9298
10344
  }
9299
10345
  }
9300
10346
  __name(registerPluginInGraph, "registerPluginInGraph");
10347
+ async function isPluginCached(url) {
10348
+ const cacheDir = path2.join(getUserVarlockDir(), "plugins-cache");
10349
+ const indexPath = path2.join(cacheDir, "index.json");
10350
+ try {
10351
+ const indexRaw = await fs2.readFile(indexPath, "utf-8");
10352
+ const index = JSON.parse(indexRaw);
10353
+ if (index[url]) {
10354
+ const pluginDir = path2.join(cacheDir, index[url]);
10355
+ return fs2.stat(pluginDir).then(() => true, () => false);
10356
+ }
10357
+ } catch {
10358
+ }
10359
+ return false;
10360
+ }
10361
+ __name(isPluginCached, "isPluginCached");
9301
10362
  async function downloadPlugin(url) {
9302
10363
  const exec2 = promisify(exec);
9303
10364
  const cacheDir = path2.join(getUserVarlockDir(), "plugins-cache");
@@ -9353,6 +10414,23 @@ async function downloadPlugin(url) {
9353
10414
  return finalDir;
9354
10415
  }
9355
10416
  __name(downloadPlugin, "downloadPlugin");
10417
+ async function downloadPluginToCache(moduleName, versionDescriptor) {
10418
+ if (!import_semver.default.valid(versionDescriptor)) {
10419
+ throw new Error(`"${versionDescriptor}" is not a fixed version \u2014 use an exact version like 1.2.3`);
10420
+ }
10421
+ const npmInfoUrl = `https://registry.npmjs.org/${moduleName}/${versionDescriptor}`;
10422
+ const npmInfoReq = await fetch(npmInfoUrl);
10423
+ if (!npmInfoReq.ok) {
10424
+ throw new Error(`Failed to fetch plugin "${moduleName}@${versionDescriptor}" from npm: ${npmInfoReq.status} ${npmInfoReq.statusText}`);
10425
+ }
10426
+ const npmInfo = await npmInfoReq.json();
10427
+ const tarballUrl = npmInfo?.dist?.tarball;
10428
+ if (!tarballUrl) {
10429
+ throw new Error(`Failed to find tarball URL for plugin "${moduleName}@${versionDescriptor}" from npm`);
10430
+ }
10431
+ return downloadPlugin(tarballUrl);
10432
+ }
10433
+ __name(downloadPluginToCache, "downloadPluginToCache");
9356
10434
  async function processPluginInstallDecorators(dataSource) {
9357
10435
  const graph = dataSource.graph;
9358
10436
  if (!graph) throw new Error("Data source not attached to graph");
@@ -9393,9 +10471,6 @@ async function processPluginInstallDecorators(dataSource) {
9393
10471
  moduleName = pluginSourceDescriptor.slice(0, atLocation);
9394
10472
  versionDescriptor = pluginSourceDescriptor.slice(atLocation + 1);
9395
10473
  }
9396
- if (!moduleName.startsWith("@varlock/")) {
9397
- throw new SchemaError(`Plugin "${moduleName}" blocked - only official @varlock/* plugins are supported for now, third-party plugins will be supported in future releases`);
9398
- }
9399
10474
  const semverRange = import_semver.default.validRange(versionDescriptor);
9400
10475
  if (versionDescriptor && !semverRange) {
9401
10476
  throw new SchemaError(`Bad @plugin version descriptor: ${versionDescriptor}`);
@@ -9452,6 +10527,32 @@ async function processPluginInstallDecorators(dataSource) {
9452
10527
  if (!tarballUrl) {
9453
10528
  throw new Error(`Failed to find tarball URL for plugin "${moduleName}@${versionDescriptor}" from npm`);
9454
10529
  }
10530
+ if (!moduleName.startsWith("@varlock/") && !await isPluginCached(tarballUrl)) {
10531
+ if (!process.stdout.isTTY || !process.stdin.isTTY) {
10532
+ throw new SchemaError(
10533
+ `Third-party plugin "${moduleName}@${versionDescriptor}" must be confirmed before downloading, but no interactive terminal (TTY) is available. Run \`varlock install-plugin\` to pre-cache the plugin, or install it via your package.json.`
10534
+ );
10535
+ }
10536
+ process.stdout.write(
10537
+ `
10538
+ ${ansis_default.yellow("\u26A0")} Third-party plugin download requested
10539
+ Package: ${ansis_default.bold(`${moduleName}@${versionDescriptor}`)}
10540
+ Source: npm registry (https://registry.npmjs.org)
10541
+
10542
+ ${ansis_default.italic("Only install plugins from sources you trust.")}
10543
+
10544
+ `
10545
+ );
10546
+ const confirmed = await confirm({
10547
+ message: `Allow downloading "${moduleName}@${versionDescriptor}" from npm?`,
10548
+ active: "Yes, download it",
10549
+ inactive: "No, cancel",
10550
+ initialValue: false
10551
+ });
10552
+ if (Ct(confirmed) || !confirmed) {
10553
+ throw new SchemaError(`Third-party plugin "${moduleName}" download cancelled`);
10554
+ }
10555
+ }
9455
10556
  const downloadedPluginPath = await downloadPlugin(tarballUrl);
9456
10557
  pluginSrcPath = downloadedPluginPath;
9457
10558
  }
@@ -9484,7 +10585,8 @@ var DATA_SOURCE_TYPES = Object.freeze({
9484
10585
  overrides: {
9485
10586
  fileSuffixes: ["local", "override"]
9486
10587
  },
9487
- container: {}
10588
+ container: {},
10589
+ "import-alias": {}
9488
10590
  });
9489
10591
  var EnvGraphDataSource2 = class {
9490
10592
  static {
@@ -9547,9 +10649,11 @@ var EnvGraphDataSource2 = class {
9547
10649
  * Note: `applyForEnv` from filename parsing is only relevant for auto-loaded files.
9548
10650
  * Explicitly imported files (via `@import`) are controlled by the import mechanism,
9549
10651
  * not the auto-load-by-env logic, so their `applyForEnv` is ignored here.
10652
+ * Similarly, a file that is the explicit root entry point (no parent) is never
10653
+ * treated as env-specific even if its filename contains an env qualifier.
9550
10654
  */
9551
10655
  get isEnvSpecific() {
9552
- if (this.applyForEnv && !this.isImport) return true;
10656
+ if (this.applyForEnv && !this.isImport && this.parent) return true;
9553
10657
  if (this.type === "overrides") return true;
9554
10658
  if (this._hasConditionalDisable) return true;
9555
10659
  if (this.importMeta?.isConditionallyEnabled) return true;
@@ -9740,6 +10844,16 @@ var EnvGraphDataSource2 = class {
9740
10844
  }
9741
10845
  if (fullImportPath) {
9742
10846
  const fileName = path2.basename(fullImportPath);
10847
+ const existingSource = this.graph.getLoadedImportSource(fullImportPath);
10848
+ if (existingSource) {
10849
+ await this.addChild(new ImportAliasSource(existingSource), {
10850
+ isImport: true,
10851
+ importKeys,
10852
+ isConditionallyEnabled
10853
+ });
10854
+ this.graph.registerItemsForImport(existingSource, this, importKeys);
10855
+ continue;
10856
+ }
9743
10857
  if (this.graph.virtualImports) {
9744
10858
  if (importPath.endsWith("/")) {
9745
10859
  const dirExists = Object.keys(this.graph.virtualImports).some((p) => p.startsWith(fullImportPath));
@@ -9748,11 +10862,13 @@ var EnvGraphDataSource2 = class {
9748
10862
  this._loadingError = new Error(`Virtual directory import ${fullImportPath} not found`);
9749
10863
  return;
9750
10864
  }
9751
- await this.addChild(new DirectoryDataSource(fullImportPath), {
10865
+ const dirChild = new DirectoryDataSource(fullImportPath);
10866
+ await this.addChild(dirChild, {
9752
10867
  isImport: true,
9753
10868
  importKeys,
9754
10869
  isConditionallyEnabled
9755
10870
  });
10871
+ this.graph.recordLoadedImportPath(fullImportPath, dirChild);
9756
10872
  } else {
9757
10873
  const fileExists = this.graph.virtualImports[fullImportPath];
9758
10874
  if (!fileExists && allowMissing) continue;
@@ -9760,10 +10876,11 @@ var EnvGraphDataSource2 = class {
9760
10876
  this._loadingError = new Error(`Virtual import ${fullImportPath} not found`);
9761
10877
  return;
9762
10878
  }
9763
- const source = new DotEnvFileDataSource(fullImportPath, {
10879
+ const fileChild = new DotEnvFileDataSource(fullImportPath, {
9764
10880
  overrideContents: this.graph.virtualImports[fullImportPath]
9765
10881
  });
9766
- await this.addChild(source, { isImport: true, importKeys, isConditionallyEnabled });
10882
+ await this.addChild(fileChild, { isImport: true, importKeys, isConditionallyEnabled });
10883
+ this.graph.recordLoadedImportPath(fullImportPath, fileChild);
9767
10884
  }
9768
10885
  } else {
9769
10886
  const fsStat = await tryCatch(async () => fs2.stat(fullImportPath), (_err) => {
@@ -9775,11 +10892,13 @@ var EnvGraphDataSource2 = class {
9775
10892
  }
9776
10893
  if (importPath.endsWith("/")) {
9777
10894
  if (fsStat.isDirectory()) {
9778
- await this.addChild(new DirectoryDataSource(fullImportPath), {
10895
+ const dirChild = new DirectoryDataSource(fullImportPath);
10896
+ await this.addChild(dirChild, {
9779
10897
  isImport: true,
9780
10898
  importKeys,
9781
10899
  isConditionallyEnabled
9782
10900
  });
10901
+ this.graph.recordLoadedImportPath(fullImportPath, dirChild);
9783
10902
  } else {
9784
10903
  this._loadingError = new Error(`Imported path ending with "/" is not a directory: ${fullImportPath}`);
9785
10904
  return;
@@ -9792,11 +10911,13 @@ var EnvGraphDataSource2 = class {
9792
10911
  this._loadingError = new Error("imported file must be a .env.* file");
9793
10912
  return;
9794
10913
  }
9795
- await this.addChild(new DotEnvFileDataSource(fullImportPath), {
10914
+ const fileChild = new DotEnvFileDataSource(fullImportPath);
10915
+ await this.addChild(fileChild, {
9796
10916
  isImport: true,
9797
10917
  importKeys,
9798
10918
  isConditionallyEnabled
9799
10919
  });
10920
+ this.graph.recordLoadedImportPath(fullImportPath, fileChild);
9800
10921
  }
9801
10922
  }
9802
10923
  } else if (importPath.startsWith("http://") || importPath.startsWith("https://")) {
@@ -9878,6 +10999,27 @@ var EnvGraphDataSource2 = class {
9878
10999
  return this.rootDecorators.filter((d) => d.name === decName && d.isFunctionCall);
9879
11000
  }
9880
11001
  };
11002
+ var ImportAliasSource = class extends EnvGraphDataSource2 {
11003
+ constructor(original) {
11004
+ super();
11005
+ this.original = original;
11006
+ }
11007
+ static {
11008
+ __name(this, "ImportAliasSource");
11009
+ }
11010
+ type = "import-alias";
11011
+ typeLabel = "import-alias";
11012
+ get label() {
11013
+ return `re-import of ${this.original.label}`;
11014
+ }
11015
+ // no-op — the original was already fully initialized
11016
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
11017
+ async _finishInit() {
11018
+ }
11019
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
11020
+ async _processImports() {
11021
+ }
11022
+ };
9881
11023
  var FileBasedDataSource = class extends EnvGraphDataSource2 {
9882
11024
  static {
9883
11025
  __name(this, "FileBasedDataSource");
@@ -10337,6 +11479,52 @@ var EnvGraph2 = class {
10337
11479
  /** graph-level fallback value for environment flag */
10338
11480
  envFlagFallback;
10339
11481
  configSchema = {};
11482
+ /**
11483
+ * Tracks directory/file paths that have already been loaded as imports.
11484
+ * Maps each import path to the data source that was created for it.
11485
+ * Used to prevent diamond-dependency re-imports (same schema imported via multiple paths),
11486
+ * which would otherwise cause plugin init decorators to run multiple times.
11487
+ */
11488
+ _loadedImportPaths = /* @__PURE__ */ new Map();
11489
+ /** Returns the existing source for a path if already loaded, or undefined */
11490
+ getLoadedImportSource(importPath) {
11491
+ return this._loadedImportPaths.get(importPath);
11492
+ }
11493
+ /** Records the data source that was created for an import path */
11494
+ recordLoadedImportPath(importPath, dataSource) {
11495
+ this._loadedImportPaths.set(importPath, dataSource);
11496
+ }
11497
+ /**
11498
+ * Register ConfigItems for keys visible through an import
11499
+ * that may not have been registered during the original source's finishInit.
11500
+ */
11501
+ registerItemsForImport(source, importSite, importKeys) {
11502
+ const siteKeys = importSite.importKeys;
11503
+ let effectiveKeys;
11504
+ const hasFilter = importKeys && importKeys.length > 0;
11505
+ if (hasFilter && siteKeys?.length) {
11506
+ effectiveKeys = importKeys.filter((k2) => siteKeys.includes(k2));
11507
+ } else if (hasFilter) {
11508
+ effectiveKeys = importKeys;
11509
+ } else {
11510
+ effectiveKeys = siteKeys;
11511
+ }
11512
+ for (const s of this._getDescendants(source)) {
11513
+ const keys = effectiveKeys || my_dash_default.keys(s.configItemDefs);
11514
+ for (const itemKey of keys) {
11515
+ if (!s.configItemDefs[itemKey]) continue;
11516
+ this.configSchema[itemKey] ??= new ConfigItem(this, itemKey);
11517
+ }
11518
+ }
11519
+ }
11520
+ /** Get a data source and all its descendants (DFS) */
11521
+ _getDescendants(source) {
11522
+ const result = [source];
11523
+ for (const child of source.children) {
11524
+ result.push(...this._getDescendants(child));
11525
+ }
11526
+ return result;
11527
+ }
10340
11528
  /** virtual imports for testing */
10341
11529
  virtualImports;
10342
11530
  setVirtualImports(basePath, files) {
@@ -10352,6 +11540,31 @@ var EnvGraph2 = class {
10352
11540
  __name(getSourceAndChildren, "getSourceAndChildren");
10353
11541
  return this.rootDataSource ? getSourceAndChildren(this.rootDataSource) : [];
10354
11542
  }
11543
+ /**
11544
+ * Precedence-ordered list of definition sources, used by ConfigItem.defs.
11545
+ *
11546
+ * Unlike `sortedDataSources` (which contains each real source exactly once),
11547
+ * this list can contain the same source multiple times at different positions
11548
+ * when it's imported from multiple locations (diamond dependency). Each entry
11549
+ * carries its own `importKeys` filter for that specific import context.
11550
+ *
11551
+ * Built from `sortedDataSources` by expanding `ImportAliasSource` nodes into
11552
+ * the original source's full subtree at the alias's precedence position.
11553
+ */
11554
+ get sortedDefinitionSources() {
11555
+ const result = [];
11556
+ for (const source of this.sortedDataSources) {
11557
+ if (source instanceof ImportAliasSource) {
11558
+ const importKeys = source.importKeys;
11559
+ for (const descendant of this._getDescendants(source.original)) {
11560
+ result.push({ source: descendant, importKeys });
11561
+ }
11562
+ } else {
11563
+ result.push({ source, importKeys: source.importKeys });
11564
+ }
11565
+ }
11566
+ return result;
11567
+ }
10355
11568
  registeredResolverFunctions = {};
10356
11569
  registerResolver(resolverClass) {
10357
11570
  const fnName = resolverClass.fnName;
@@ -10604,6 +11817,7 @@ var EnvGraph2 = class {
10604
11817
  };
10605
11818
  for (const source of this.sortedDataSources) {
10606
11819
  serializedGraph.sources.push({
11820
+ type: source.type,
10607
11821
  label: source.label,
10608
11822
  enabled: !source.disabled,
10609
11823
  path: source instanceof FileBasedDataSource ? path2.relative(this.basePath ?? "", source.fullPath) : void 0
@@ -10719,17 +11933,16 @@ var ConfigItem = class {
10719
11933
  /** Programmatic definitions not tied to a data source (e.g. builtin vars) */
10720
11934
  _internalDefs = [];
10721
11935
  /**
10722
- * fetch ordered list of definitions for this item, by following up sorted data sources list
11936
+ * fetch ordered list of definitions for this item, by following the sorted definition sources list
10723
11937
  * internal defs (builtins) are appended last (lowest priority)
10724
11938
  */
10725
11939
  get defs() {
10726
11940
  const defs = [];
10727
- for (const source of this.envGraph.sortedDataSources) {
11941
+ for (const { source, importKeys } of this.envGraph.sortedDefinitionSources) {
10728
11942
  if (!source.configItemDefs[this.key]) continue;
10729
11943
  if (source.disabled) continue;
10730
- if (source.importKeys && !source.importKeys.includes(this.key)) continue;
10731
- const itemDef = source.configItemDefs[this.key];
10732
- if (itemDef) defs.push({ itemDef, source });
11944
+ if (importKeys && !importKeys.includes(this.key)) continue;
11945
+ defs.push({ itemDef: source.configItemDefs[this.key], source });
10733
11946
  }
10734
11947
  defs.push(...this._internalDefs);
10735
11948
  return defs;
@@ -10776,8 +11989,28 @@ var ConfigItem = class {
10776
11989
  }
10777
11990
  return links;
10778
11991
  }
11992
+ /** Whether the resolved value came from a process.env override rather than file definitions */
11993
+ get isOverridden() {
11994
+ return this.key in this.envGraph.overrideValues;
11995
+ }
11996
+ /**
11997
+ * Returns the definition+source that would provide the value resolver
11998
+ * (i.e. the "winning" definition), or undefined if no definition has a resolver.
11999
+ * This is useful for explaining where a value comes from regardless of overrides.
12000
+ */
12001
+ get activeValueDef() {
12002
+ const hasInternalResolver = this._internalDefs.some((d) => d.itemDef.resolver);
12003
+ for (const def of this.defs) {
12004
+ if (def.itemDef.resolver) {
12005
+ if (hasInternalResolver && def.itemDef.resolver instanceof StaticValueResolver && !def.itemDef.resolver.staticValue) {
12006
+ continue;
12007
+ }
12008
+ return def;
12009
+ }
12010
+ }
12011
+ }
10779
12012
  get valueResolver() {
10780
- if (this.key in this.envGraph.overrideValues) {
12013
+ if (this.isOverridden) {
10781
12014
  return new StaticValueResolver(this.envGraph.overrideValues[this.key]);
10782
12015
  }
10783
12016
  const hasInternalResolver = this._internalDefs.some((d) => d.itemDef.resolver);
@@ -11299,6 +12532,6 @@ var ConfigItem = class {
11299
12532
  }
11300
12533
  };
11301
12534
 
11302
- export { ConfigItem, DirectoryDataSource, DotEnvFileDataSource, EnvGraph2 as EnvGraph, FileBasedDataSource, ParsedEnvSpecStaticValue, ansis_default, detectWorkspaceInfo, envSpecUpdater, getUserVarlockDir, parseEnvSpecDotEnvFile, pathExists, require_semver2 as require_semver, runWithWorkspaceInfo, tryCatch };
11303
- //# sourceMappingURL=chunk-B6SVDIAN.js.map
11304
- //# sourceMappingURL=chunk-B6SVDIAN.js.map
12535
+ export { ConfigItem, Ct, DirectoryDataSource, DotEnvFileDataSource, EnvGraph2 as EnvGraph, FileBasedDataSource, Jt, ParsedEnvSpecStaticValue, StaticValueResolver, ansis_default, detectWorkspaceInfo, downloadPluginToCache, envSpecUpdater, getUserVarlockDir, parseEnvSpecDotEnvFile, pathExists, prompts_default, require_semver2 as require_semver, runWithWorkspaceInfo, tryCatch };
12536
+ //# sourceMappingURL=chunk-G2GPGCAP.js.map
12537
+ //# sourceMappingURL=chunk-G2GPGCAP.js.map