@rotorsoft/act-diagram 1.0.10 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/act.js CHANGED
@@ -2142,7 +2142,7 @@ function format_markdown(idx) {
2142
2142
  import { writeFile } from "fs/promises";
2143
2143
  import { resolve as resolve3 } from "path";
2144
2144
 
2145
- // ../../node_modules/.pnpm/@clack+core@1.4.2/node_modules/@clack/core/dist/index.mjs
2145
+ // ../../node_modules/.pnpm/@clack+core@1.4.3/node_modules/@clack/core/dist/index.mjs
2146
2146
  import { styleText } from "util";
2147
2147
  import { stdout, stdin } from "process";
2148
2148
  import * as l from "readline";
@@ -2484,16 +2484,16 @@ function wrapAnsi(string, columns, options) {
2484
2484
  return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join("\n");
2485
2485
  }
2486
2486
 
2487
- // ../../node_modules/.pnpm/@clack+core@1.4.2/node_modules/@clack/core/dist/index.mjs
2487
+ // ../../node_modules/.pnpm/@clack+core@1.4.3/node_modules/@clack/core/dist/index.mjs
2488
2488
  var import_sisteransi = __toESM(require_src(), 1);
2489
2489
  import { ReadStream } from "tty";
2490
- function findCursor(s, o2, l2) {
2490
+ function findCursor(s, o, l2) {
2491
2491
  if (!l2.some((r2) => !r2.disabled))
2492
2492
  return s;
2493
- const t2 = s + o2, n2 = Math.max(l2.length - 1, 0), e = t2 < 0 ? n2 : t2 > n2 ? 0 : t2;
2494
- return l2[e].disabled ? findCursor(e, o2 < 0 ? -1 : 1, l2) : e;
2493
+ const t2 = s + o, n3 = Math.max(l2.length - 1, 0), e = t2 < 0 ? n3 : t2 > n3 ? 0 : t2;
2494
+ return l2[e]?.disabled ? findCursor(e, o < 0 ? -1 : 1, l2) : e;
2495
2495
  }
2496
- var a$2 = ["up", "down", "left", "right", "space", "enter", "cancel"];
2496
+ var a$1 = ["up", "down", "left", "right", "space", "enter", "cancel"];
2497
2497
  var t = [
2498
2498
  "January",
2499
2499
  "February",
@@ -2509,7 +2509,7 @@ var t = [
2509
2509
  "December"
2510
2510
  ];
2511
2511
  var settings = {
2512
- actions: new Set(a$2),
2512
+ actions: new Set(a$1),
2513
2513
  aliases: /* @__PURE__ */ new Map([
2514
2514
  // vim support
2515
2515
  ["k", "up"],
@@ -2530,16 +2530,16 @@ var settings = {
2530
2530
  messages: {
2531
2531
  required: "Please enter a valid date",
2532
2532
  invalidMonth: "There are only 12 months in a year",
2533
- invalidDay: (n2, e) => `There are only ${n2} days in ${e}`,
2534
- afterMin: (n2) => `Date must be on or after ${n2.toISOString().slice(0, 10)}`,
2535
- beforeMax: (n2) => `Date must be on or before ${n2.toISOString().slice(0, 10)}`
2533
+ invalidDay: (n3, e) => `There are only ${n3} days in ${e}`,
2534
+ afterMin: (n3) => `Date must be on or after ${n3.toISOString().slice(0, 10)}`,
2535
+ beforeMax: (n3) => `Date must be on or before ${n3.toISOString().slice(0, 10)}`
2536
2536
  }
2537
2537
  }
2538
2538
  };
2539
- function isActionKey(n2, e) {
2540
- if (typeof n2 == "string")
2541
- return settings.aliases.get(n2) === e;
2542
- for (const s of n2)
2539
+ function isActionKey(n3, e) {
2540
+ if (typeof n3 == "string")
2541
+ return settings.aliases.get(n3) === e;
2542
+ for (const s of n3)
2543
2543
  if (s !== void 0 && isActionKey(s, e))
2544
2544
  return true;
2545
2545
  return false;
@@ -2549,8 +2549,8 @@ function diffLines(i2, s) {
2549
2549
  const e = i2.split(`
2550
2550
  `), t2 = s.split(`
2551
2551
  `), r2 = Math.max(e.length, t2.length), f = [];
2552
- for (let n2 = 0; n2 < r2; n2++)
2553
- e[n2] !== t2[n2] && f.push(n2);
2552
+ for (let n3 = 0; n3 < r2; n3++)
2553
+ e[n3] !== t2[n3] && f.push(n3);
2554
2554
  return {
2555
2555
  lines: f,
2556
2556
  numLinesBefore: e.length,
@@ -2564,33 +2564,33 @@ function isCancel(e) {
2564
2564
  return e === CANCEL_SYMBOL;
2565
2565
  }
2566
2566
  function setRawMode(e, r2) {
2567
- const o2 = e;
2568
- o2.isTTY && o2.setRawMode(r2);
2567
+ const o = e;
2568
+ o.isTTY && o.setRawMode(r2);
2569
2569
  }
2570
2570
  var getColumns = (e) => "columns" in e && typeof e.columns == "number" ? e.columns : 80;
2571
2571
  var getRows = (e) => "rows" in e && typeof e.rows == "number" ? e.rows : 20;
2572
- function wrapTextWithPrefix(e, r2, o2, t2 = o2, s = o2, n2) {
2572
+ function wrapTextWithPrefix(e, r2, o, t2 = o, s = o, n3) {
2573
2573
  const f = getColumns(e ?? stdout);
2574
- return wrapAnsi(r2, f - o2.length, {
2574
+ return wrapAnsi(r2, f - o.length, {
2575
2575
  hard: true,
2576
2576
  trim: false
2577
2577
  }).split(`
2578
2578
  `).map((c2, i2, m) => {
2579
- const d = n2 ? n2(c2, i2) : c2;
2580
- return i2 === 0 ? `${t2}${d}` : i2 === m.length - 1 ? `${s}${d}` : `${o2}${d}`;
2579
+ const d = n3 ? n3(c2, i2) : c2;
2580
+ return i2 === 0 ? `${t2}${d}` : i2 === m.length - 1 ? `${s}${d}` : `${o}${d}`;
2581
2581
  }).join(`
2582
2582
  `);
2583
2583
  }
2584
- function runValidation(e, n2) {
2584
+ function runValidation(e, n3) {
2585
2585
  if ("~standard" in e) {
2586
- const a2 = e["~standard"].validate(n2);
2586
+ const a2 = e["~standard"].validate(n3);
2587
2587
  if (a2 instanceof Promise)
2588
2588
  throw new TypeError(
2589
2589
  "Schema validation must be synchronous. Update `validate()` and remove any asynchronous logic."
2590
2590
  );
2591
2591
  return a2.issues?.at(0)?.message;
2592
2592
  }
2593
- return e(n2);
2593
+ return e(n3);
2594
2594
  }
2595
2595
  var V = class {
2596
2596
  input;
@@ -2608,8 +2608,8 @@ var V = class {
2608
2608
  value;
2609
2609
  userInput = "";
2610
2610
  constructor(t2, e = true) {
2611
- const { input: i2 = stdin, output: n2 = stdout, render: s, signal: r2, ...o2 } = t2;
2612
- this.opts = o2, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = s.bind(this), this._track = e, this._abortSignal = r2, this.input = i2, this.output = n2;
2611
+ const { input: i2 = stdin, output: n3 = stdout, render: s, signal: r2, ...o } = t2;
2612
+ this.opts = o, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = s.bind(this), this._track = e, this._abortSignal = r2, this.input = i2, this.output = n3;
2613
2613
  }
2614
2614
  /**
2615
2615
  * Unsubscribe all listeners
@@ -2647,10 +2647,10 @@ var V = class {
2647
2647
  * @param data - The data to pass to the callback
2648
2648
  */
2649
2649
  emit(t2, ...e) {
2650
- const i2 = this._subscribers.get(t2) ?? [], n2 = [];
2650
+ const i2 = this._subscribers.get(t2) ?? [], n3 = [];
2651
2651
  for (const s of i2)
2652
- s.cb(...e), s.once && n2.push(() => i2.splice(i2.indexOf(s), 1));
2653
- for (const s of n2)
2652
+ s.cb(...e), s.once && n3.push(() => i2.splice(i2.indexOf(s), 1));
2653
+ for (const s of n3)
2654
2654
  s();
2655
2655
  }
2656
2656
  prompt() {
@@ -2724,21 +2724,21 @@ var V = class {
2724
2724
  else {
2725
2725
  const e = diffLines(this._prevFrame, t2), i2 = getRows(this.output);
2726
2726
  if (this.restoreCursor(), e) {
2727
- const n2 = Math.max(0, e.numLinesAfter - i2), s = Math.max(0, e.numLinesBefore - i2);
2728
- let r2 = e.lines.find((o2) => o2 >= n2);
2727
+ const n3 = Math.max(0, e.numLinesAfter - i2), s = Math.max(0, e.numLinesBefore - i2);
2728
+ let r2 = e.lines.find((o) => o >= n3);
2729
2729
  if (r2 === void 0) {
2730
2730
  this._prevFrame = t2;
2731
2731
  return;
2732
2732
  }
2733
2733
  if (e.lines.length === 1) {
2734
2734
  this.output.write(import_sisteransi.cursor.move(0, r2 - s)), this.output.write(import_sisteransi.erase.lines(1));
2735
- const o2 = t2.split(`
2735
+ const o = t2.split(`
2736
2736
  `);
2737
- this.output.write(o2[r2]), this._prevFrame = t2, this.output.write(import_sisteransi.cursor.move(0, o2.length - r2 - 1));
2737
+ this.output.write(o[r2]), this._prevFrame = t2, this.output.write(import_sisteransi.cursor.move(0, o.length - r2 - 1));
2738
2738
  return;
2739
2739
  } else if (e.lines.length > 1) {
2740
- if (n2 < s)
2741
- r2 = n2;
2740
+ if (n3 < s)
2741
+ r2 = n3;
2742
2742
  else {
2743
2743
  const h2 = r2 - s;
2744
2744
  h2 > 0 && this.output.write(import_sisteransi.cursor.move(0, h2));
@@ -2757,19 +2757,20 @@ var V = class {
2757
2757
  }
2758
2758
  }
2759
2759
  };
2760
- var a = class extends V {
2760
+ var n$1 = class n extends V {
2761
2761
  options;
2762
2762
  cursor = 0;
2763
2763
  get _selectedValue() {
2764
2764
  return this.options[this.cursor];
2765
2765
  }
2766
2766
  changeValue() {
2767
- this.value = this._selectedValue.value;
2767
+ const e = this._selectedValue;
2768
+ this.value = e === void 0 ? void 0 : e.value;
2768
2769
  }
2769
- constructor(t2) {
2770
- super(t2, false), this.options = t2.options;
2771
- const i2 = this.options.findIndex(({ value: s }) => s === t2.initialValue), e = i2 === -1 ? 0 : i2;
2772
- this.cursor = this.options[e].disabled ? findCursor(e, 1, this.options) : e, this.changeValue(), this.on("cursor", (s) => {
2770
+ constructor(e) {
2771
+ super(e, false), this.options = e.options;
2772
+ const o = this.options.findIndex(({ value: s }) => s === e.initialValue), t2 = o === -1 ? 0 : o;
2773
+ this.cursor = this.options[t2]?.disabled ? findCursor(t2, 1, this.options) : t2, this.changeValue(), this.on("cursor", (s) => {
2773
2774
  switch (s) {
2774
2775
  case "left":
2775
2776
  case "up":
@@ -2784,15 +2785,15 @@ var a = class extends V {
2784
2785
  });
2785
2786
  }
2786
2787
  };
2787
- var n = class extends V {
2788
+ var n2 = class extends V {
2788
2789
  get userInputWithCursor() {
2789
2790
  if (this.state === "submit")
2790
2791
  return this.userInput;
2791
2792
  const t2 = this.userInput;
2792
2793
  if (this.cursor >= t2.length)
2793
2794
  return `${this.userInput}\u2588`;
2794
- const e = t2.slice(0, this.cursor), [s, ...r2] = t2.slice(this.cursor);
2795
- return `${e}${styleText("inverse", s)}${r2.join("")}`;
2795
+ const r2 = t2.slice(0, this.cursor), s = t2.slice(this.cursor, this.cursor + 1), e = t2.slice(this.cursor + 1);
2796
+ return `${r2}${styleText("inverse", s)}${e}`;
2796
2797
  }
2797
2798
  get cursor() {
2798
2799
  return this._cursor;
@@ -2801,15 +2802,15 @@ var n = class extends V {
2801
2802
  super({
2802
2803
  ...t2,
2803
2804
  initialUserInput: t2.initialUserInput ?? t2.initialValue
2804
- }), this.on("userInput", (e) => {
2805
- this._setValue(e);
2805
+ }), this.on("userInput", (r2) => {
2806
+ this._setValue(r2);
2806
2807
  }), this.on("finalize", () => {
2807
2808
  this.value || (this.value = t2.defaultValue), this.value === void 0 && (this.value = "");
2808
2809
  });
2809
2810
  }
2810
2811
  };
2811
2812
 
2812
- // ../../node_modules/.pnpm/@clack+prompts@1.6.0/node_modules/@clack/prompts/dist/index.mjs
2813
+ // ../../node_modules/.pnpm/@clack+prompts@1.7.0/node_modules/@clack/prompts/dist/index.mjs
2813
2814
  import { styleText as styleText2, stripVTControlCharacters } from "util";
2814
2815
  import process$1 from "process";
2815
2816
  var import_sisteransi2 = __toESM(require_src(), 1);
@@ -2822,7 +2823,7 @@ function isUnicodeSupported() {
2822
2823
  return Boolean(process$1.env.CI) || Boolean(process$1.env.WT_SESSION) || Boolean(process$1.env.TERMINUS_SUBLIME) || process$1.env.ConEmuTask === "{cmd::Cmder}" || process$1.env.TERM_PROGRAM === "Terminus-Sublime" || process$1.env.TERM_PROGRAM === "vscode" || process$1.env.TERM === "xterm-256color" || process$1.env.TERM === "alacritty" || process$1.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
2823
2824
  }
2824
2825
  var unicode = isUnicodeSupported();
2825
- var unicodeOr = (o2, e) => unicode ? o2 : e;
2826
+ var unicodeOr = (o, e) => unicode ? o : e;
2826
2827
  var S_STEP_ACTIVE = unicodeOr("\u25C6", "*");
2827
2828
  var S_STEP_CANCEL = unicodeOr("\u25A0", "x");
2828
2829
  var S_STEP_ERROR = unicodeOr("\u25B2", "x");
@@ -2848,8 +2849,8 @@ var S_INFO = unicodeOr("\u25CF", "\u2022");
2848
2849
  var S_SUCCESS = unicodeOr("\u25C6", "*");
2849
2850
  var S_WARN = unicodeOr("\u25B2", "!");
2850
2851
  var S_ERROR = unicodeOr("\u25A0", "x");
2851
- var symbol = (o2) => {
2852
- switch (o2) {
2852
+ var symbol = (o) => {
2853
+ switch (o) {
2853
2854
  case "initial":
2854
2855
  case "active":
2855
2856
  return styleText2("cyan", S_STEP_ACTIVE);
@@ -2861,8 +2862,8 @@ var symbol = (o2) => {
2861
2862
  return styleText2("green", S_STEP_SUBMIT);
2862
2863
  }
2863
2864
  };
2864
- var symbolBar = (o2) => {
2865
- switch (o2) {
2865
+ var symbolBar = (o) => {
2866
+ switch (o) {
2866
2867
  case "initial":
2867
2868
  case "active":
2868
2869
  return styleText2("cyan", S_BAR);
@@ -2874,71 +2875,75 @@ var symbolBar = (o2) => {
2874
2875
  return styleText2("green", S_BAR);
2875
2876
  }
2876
2877
  };
2877
- function formatInstructionFooter(o2, e) {
2878
- const r2 = [`${e ? `${styleText2("cyan", S_BAR)} ` : ""}${o2.join(" \u2022 ")}`];
2878
+ function formatInstructionFooter(o, e) {
2879
+ const r2 = [`${e ? `${styleText2("cyan", S_BAR)} ` : ""}${o.join(" \u2022 ")}`];
2879
2880
  return e && r2.push(styleText2("cyan", S_BAR_END)), r2;
2880
2881
  }
2881
- var E$1 = (l2, o2, g, c2, h2, O = false) => {
2882
- let r2 = o2, w = 0;
2883
- if (O)
2884
- for (let i2 = c2 - 1; i2 >= g && (r2 -= l2[i2].length, w++, !(r2 <= h2)); i2--)
2885
- ;
2882
+ var I = (l2, e, w, p, b, C = false) => {
2883
+ let r2 = e, O = 0;
2884
+ if (C)
2885
+ for (let i2 = p - 1; i2 >= w; i2--) {
2886
+ const m = l2[i2];
2887
+ if (m && (r2 -= m.length), O++, r2 <= b) break;
2888
+ }
2886
2889
  else
2887
- for (let i2 = g; i2 < c2 && (r2 -= l2[i2].length, w++, !(r2 <= h2)); i2++)
2888
- ;
2889
- return { lineCount: r2, removals: w };
2890
+ for (let i2 = w; i2 < p; i2++) {
2891
+ const m = l2[i2];
2892
+ if (m && (r2 -= m.length), O++, r2 <= b) break;
2893
+ }
2894
+ return { lineCount: r2, removals: O };
2890
2895
  };
2891
2896
  var limitOptions = ({
2892
2897
  cursor: l2,
2893
- options: o2,
2894
- style: g,
2895
- output: c2 = process.stdout,
2896
- maxItems: h2 = Number.POSITIVE_INFINITY,
2897
- columnPadding: O = 0,
2898
+ options: e,
2899
+ style: w,
2900
+ output: p = process.stdout,
2901
+ maxItems: b = Number.POSITIVE_INFINITY,
2902
+ columnPadding: C = 0,
2898
2903
  rowPadding: r2 = 4
2899
2904
  }) => {
2900
- const i2 = getColumns(c2) - O, I = getRows(c2), C = styleText2("dim", "..."), x = Math.max(I - r2, 0), m = Math.max(Math.min(h2, x), 5);
2901
- let p = 0;
2902
- l2 >= m - 3 && (p = Math.max(
2903
- Math.min(l2 - m + 3, o2.length - m),
2905
+ const i2 = getColumns(p) - C, m = getRows(p), M = styleText2("dim", "..."), v = Math.max(m - r2, 0), a2 = Math.max(Math.min(b, v), 5);
2906
+ let f = 0;
2907
+ l2 >= a2 - 3 && (f = Math.max(
2908
+ Math.min(l2 - a2 + 3, e.length - a2),
2904
2909
  0
2905
2910
  ));
2906
- let f = m < o2.length && p > 0, u3 = m < o2.length && p + m < o2.length;
2911
+ let d = a2 < e.length && f > 0, c2 = a2 < e.length && f + a2 < e.length;
2907
2912
  const W = Math.min(
2908
- p + m,
2909
- o2.length
2910
- ), e = [];
2911
- let d = 0;
2912
- f && d++, u3 && d++;
2913
- const v = p + (f ? 1 : 0), P = W - (u3 ? 1 : 0);
2914
- for (let t2 = v; t2 < P; t2++) {
2915
- const n2 = wrapAnsi(g(o2[t2], t2 === l2), i2, {
2913
+ f + a2,
2914
+ e.length
2915
+ ), s = [];
2916
+ let g = 0;
2917
+ d && g++, c2 && g++;
2918
+ const T = f + (d ? 1 : 0), y = W - (c2 ? 1 : 0);
2919
+ for (let t2 = T; t2 < y; t2++) {
2920
+ const n3 = e[t2], o = n3 ? w(n3, t2 === l2) : "", h2 = wrapAnsi(o, i2, {
2916
2921
  hard: true,
2917
2922
  trim: false
2918
2923
  }).split(`
2919
2924
  `);
2920
- e.push(n2), d += n2.length;
2921
- }
2922
- if (d > x) {
2923
- let t2 = 0, n2 = 0, s = d;
2924
- const M = l2 - v;
2925
- let a2 = x;
2926
- const T = () => E$1(e, s, 0, M, a2), L = () => E$1(
2927
- e,
2925
+ s.push(h2), g += h2.length;
2926
+ }
2927
+ if (g > v) {
2928
+ let t2 = 0, n3 = 0, o = g;
2929
+ const h2 = l2 - T;
2930
+ let u3 = v;
2931
+ const L = () => I(s, o, 0, h2, u3), E = () => I(
2928
2932
  s,
2929
- M + 1,
2930
- e.length,
2931
- a2,
2933
+ o,
2934
+ h2 + 1,
2935
+ s.length,
2936
+ u3,
2932
2937
  true
2933
2938
  );
2934
- f ? ({ lineCount: s, removals: t2 } = T(), s > a2 && (u3 || (a2 -= 1), { lineCount: s, removals: n2 } = L())) : (u3 || (a2 -= 1), { lineCount: s, removals: n2 } = L(), s > a2 && (a2 -= 1, { lineCount: s, removals: t2 } = T())), t2 > 0 && (f = true, e.splice(0, t2)), n2 > 0 && (u3 = true, e.splice(e.length - n2, n2));
2935
- }
2936
- const b = [];
2937
- f && b.push(C);
2938
- for (const t2 of e)
2939
- for (const n2 of t2)
2940
- b.push(n2);
2941
- return u3 && b.push(C), b;
2939
+ d ? ({ lineCount: o, removals: t2 } = L(), o > u3 && (c2 || (u3 -= 1), { lineCount: o, removals: n3 } = E())) : (c2 || (u3 -= 1), { lineCount: o, removals: n3 } = E(), o > u3 && (u3 -= 1, { lineCount: o, removals: t2 } = L())), t2 > 0 && (d = true, s.splice(0, t2)), n3 > 0 && (c2 = true, s.splice(s.length - n3, n3));
2940
+ }
2941
+ const x = [];
2942
+ d && x.push(M);
2943
+ for (const t2 of s)
2944
+ for (const n3 of t2)
2945
+ x.push(n3);
2946
+ return c2 && x.push(M), x;
2942
2947
  };
2943
2948
  var MULTISELECT_INSTRUCTIONS = [
2944
2949
  `${styleText2("dim", "\u2191/\u2193")} to navigate`,
@@ -2953,16 +2958,16 @@ var log = {
2953
2958
  spacing: l2 = 1,
2954
2959
  withGuide: c2
2955
2960
  } = {}) => {
2956
- const t2 = [], o2 = c2 ?? settings.withGuide, f = o2 ? r2 : "", O = o2 ? `${e} ` : "", u3 = o2 ? `${r2} ` : "";
2961
+ const t2 = [], o = c2 ?? settings.withGuide, f = o ? r2 : "", O = o ? `${e} ` : "", u3 = o ? `${r2} ` : "";
2957
2962
  for (let i2 = 0; i2 < l2; i2++)
2958
2963
  t2.push(f);
2959
2964
  const g = Array.isArray(s) ? s : s.split(`
2960
2965
  `);
2961
2966
  if (g.length > 0) {
2962
2967
  const [i2, ...y] = g;
2963
- i2.length > 0 ? t2.push(`${O}${i2}`) : t2.push(o2 ? e : "");
2968
+ i2.length > 0 ? t2.push(`${O}${i2}`) : t2.push(o ? e : "");
2964
2969
  for (const p of y)
2965
- p.length > 0 ? t2.push(`${u3}${p}`) : t2.push(o2 ? r2 : "");
2970
+ p.length > 0 ? t2.push(`${u3}${p}`) : t2.push(o ? r2 : "");
2966
2971
  }
2967
2972
  m.write(`${t2.join(`
2968
2973
  `)}
@@ -2988,15 +2993,15 @@ var log = {
2988
2993
  log.message(s, { ...e, symbol: styleText2("red", S_ERROR) });
2989
2994
  }
2990
2995
  };
2991
- var intro = (o2 = "", t2) => {
2996
+ var intro = (o = "", t2) => {
2992
2997
  const i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR_START)} ` : "";
2993
- i2.write(`${e}${o2}
2998
+ i2.write(`${e}${o}
2994
2999
  `);
2995
3000
  };
2996
- var outro = (o2 = "", t2) => {
3001
+ var outro = (o = "", t2) => {
2997
3002
  const i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR)}
2998
3003
  ${styleText2("gray", S_BAR_END)} ` : "";
2999
- i2.write(`${e}${o2}
3004
+ i2.write(`${e}${o}
3000
3005
 
3001
3006
  `);
3002
3007
  };
@@ -3009,74 +3014,76 @@ var SELECT_INSTRUCTIONS = [
3009
3014
  `${styleText2("dim", "\u2191/\u2193")} to navigate`,
3010
3015
  `${styleText2("dim", "Enter:")} confirm`
3011
3016
  ];
3012
- var c = (t2, a2) => t2.includes(`
3017
+ var c = (t2, o) => t2.includes(`
3013
3018
  `) ? t2.split(`
3014
- `).map((i2) => a2(i2)).join(`
3015
- `) : a2(t2);
3019
+ `).map((d) => o(d)).join(`
3020
+ `) : o(t2);
3016
3021
  var select = (t2) => {
3017
- const a2 = (i2, m) => {
3018
- const s = i2.label ?? String(i2.value);
3022
+ const o = (n3, m) => {
3023
+ if (n3 === void 0)
3024
+ return "";
3025
+ const s = n3.label ?? String(n3.value);
3019
3026
  switch (m) {
3020
3027
  case "disabled":
3021
- return `${styleText2("gray", S_RADIO_INACTIVE)} ${c(s, (n2) => styleText2("gray", n2))}${i2.hint ? ` ${styleText2("dim", `(${i2.hint ?? "disabled"})`)}` : ""}`;
3028
+ return `${styleText2("gray", S_RADIO_INACTIVE)} ${c(s, (i2) => styleText2("gray", i2))}${n3.hint ? ` ${styleText2("dim", `(${n3.hint ?? "disabled"})`)}` : ""}`;
3022
3029
  case "selected":
3023
- return `${c(s, (n2) => styleText2("dim", n2))}`;
3030
+ return `${c(s, (i2) => styleText2("dim", i2))}`;
3024
3031
  case "active":
3025
- return `${styleText2("green", S_RADIO_ACTIVE)} ${s}${i2.hint ? ` ${styleText2("dim", `(${i2.hint})`)}` : ""}`;
3032
+ return `${styleText2("green", S_RADIO_ACTIVE)} ${s}${n3.hint ? ` ${styleText2("dim", `(${n3.hint})`)}` : ""}`;
3026
3033
  case "cancelled":
3027
- return `${c(s, (n2) => styleText2(["strikethrough", "dim"], n2))}`;
3034
+ return `${c(s, (i2) => styleText2(["strikethrough", "dim"], i2))}`;
3028
3035
  default:
3029
- return `${styleText2("dim", S_RADIO_INACTIVE)} ${c(s, (n2) => styleText2("dim", n2))}`;
3036
+ return `${styleText2("dim", S_RADIO_INACTIVE)} ${c(s, (i2) => styleText2("dim", i2))}`;
3030
3037
  }
3031
- };
3032
- return new a({
3038
+ }, d = t2.showInstructions ?? true;
3039
+ return new n$1({
3033
3040
  options: t2.options,
3034
3041
  signal: t2.signal,
3035
3042
  input: t2.input,
3036
3043
  output: t2.output,
3037
3044
  initialValue: t2.initialValue,
3038
3045
  render() {
3039
- const i2 = t2.withGuide ?? settings.withGuide, m = `${symbol(this.state)} `, s = `${symbolBar(this.state)} `, n2 = wrapTextWithPrefix(
3046
+ const n3 = t2.withGuide ?? settings.withGuide, m = `${symbol(this.state)} `, s = `${symbolBar(this.state)} `, i2 = wrapTextWithPrefix(
3040
3047
  t2.output,
3041
3048
  t2.message,
3042
3049
  s,
3043
3050
  m
3044
- ), u3 = `${i2 ? `${styleText2("gray", S_BAR)}
3045
- ` : ""}${n2}
3051
+ ), u3 = `${n3 ? `${styleText2("gray", S_BAR)}
3052
+ ` : ""}${i2}
3046
3053
  `;
3047
3054
  switch (this.state) {
3048
3055
  case "submit": {
3049
- const r2 = i2 ? `${styleText2("gray", S_BAR)} ` : "", o2 = wrapTextWithPrefix(
3056
+ const r2 = n3 ? `${styleText2("gray", S_BAR)} ` : "", a2 = wrapTextWithPrefix(
3050
3057
  t2.output,
3051
- a2(this.options[this.cursor], "selected"),
3058
+ o(this.options[this.cursor], "selected"),
3052
3059
  r2
3053
3060
  );
3054
- return `${u3}${o2}`;
3061
+ return `${u3}${a2}`;
3055
3062
  }
3056
3063
  case "cancel": {
3057
- const r2 = i2 ? `${styleText2("gray", S_BAR)} ` : "", o2 = wrapTextWithPrefix(
3064
+ const r2 = n3 ? `${styleText2("gray", S_BAR)} ` : "", a2 = wrapTextWithPrefix(
3058
3065
  t2.output,
3059
- a2(this.options[this.cursor], "cancelled"),
3066
+ o(this.options[this.cursor], "cancelled"),
3060
3067
  r2
3061
3068
  );
3062
- return `${u3}${o2}${i2 ? `
3069
+ return `${u3}${a2}${n3 ? `
3063
3070
  ${styleText2("gray", S_BAR)}` : ""}`;
3064
3071
  }
3065
3072
  default: {
3066
- const r2 = i2 ? `${styleText2("cyan", S_BAR)} ` : "", o2 = u3.split(`
3067
- `).length, $ = formatInstructionFooter(SELECT_INSTRUCTIONS, i2), h2 = $.join(`
3068
- `), b = $.length + 1;
3073
+ const r2 = n3 ? `${styleText2("cyan", S_BAR)} ` : "", a2 = u3.split(`
3074
+ `).length, p = d ? formatInstructionFooter(SELECT_INSTRUCTIONS, n3) : n3 ? [styleText2("cyan", S_BAR_END)] : [], b = p.join(`
3075
+ `), f = p.length + 1;
3069
3076
  return `${u3}${r2}${limitOptions({
3070
3077
  output: t2.output,
3071
3078
  cursor: this.cursor,
3072
3079
  options: this.options,
3073
3080
  maxItems: t2.maxItems,
3074
3081
  columnPadding: r2.length,
3075
- rowPadding: o2 + b,
3076
- style: (p, x) => a2(p, p.disabled ? "disabled" : x ? "active" : "inactive")
3082
+ rowPadding: a2 + f,
3083
+ style: (g, x) => o(g, g.disabled ? "disabled" : x ? "active" : "inactive")
3077
3084
  }).join(`
3078
3085
  ${r2}`)}
3079
- ${h2}
3086
+ ${b}
3080
3087
  `;
3081
3088
  }
3082
3089
  }
@@ -3084,38 +3091,41 @@ ${h2}
3084
3091
  }).prompt();
3085
3092
  };
3086
3093
  var i = `${styleText2("gray", S_BAR)} `;
3087
- var text = (t2) => new n({
3088
- validate: t2.validate,
3089
- placeholder: t2.placeholder,
3090
- defaultValue: t2.defaultValue,
3091
- initialValue: t2.initialValue,
3092
- output: t2.output,
3093
- signal: t2.signal,
3094
- input: t2.input,
3094
+ var text = (e) => new n2({
3095
+ validate: e.validate,
3096
+ placeholder: e.placeholder,
3097
+ defaultValue: e.defaultValue,
3098
+ initialValue: e.initialValue,
3099
+ output: e.output,
3100
+ signal: e.signal,
3101
+ input: e.input,
3095
3102
  render() {
3096
- const i2 = t2?.withGuide ?? settings.withGuide, s = `${`${i2 ? `${styleText2("gray", S_BAR)}
3097
- ` : ""}${symbol(this.state)} `}${t2.message}
3098
- `, c2 = t2.placeholder ? styleText2("inverse", t2.placeholder[0]) + styleText2("dim", t2.placeholder.slice(1)) : styleText2(["inverse", "hidden"], "_"), o2 = this.userInput ? this.userInputWithCursor : c2, a2 = this.value ?? "";
3103
+ const i2 = e?.withGuide ?? settings.withGuide, s = `${`${i2 ? `${styleText2("gray", S_BAR)}
3104
+ ` : ""}${symbol(this.state)} `}${e.message}
3105
+ `, c2 = e.placeholder && e.placeholder.length > 0 ? (
3106
+ // biome-ignore lint/style/noNonNullAssertion: guarded by placeholder.length > 0
3107
+ styleText2("inverse", e.placeholder[0]) + styleText2("dim", e.placeholder.slice(1))
3108
+ ) : styleText2(["inverse", "hidden"], "_"), o = this.userInput ? this.userInputWithCursor : c2, l2 = this.value ?? "";
3099
3109
  switch (this.state) {
3100
3110
  case "error": {
3101
- const n2 = this.error ? ` ${styleText2("yellow", this.error)}` : "", r2 = i2 ? `${styleText2("yellow", S_BAR)} ` : "", d = i2 ? styleText2("yellow", S_BAR_END) : "";
3111
+ const n3 = this.error ? ` ${styleText2("yellow", this.error)}` : "", r2 = i2 ? `${styleText2("yellow", S_BAR)} ` : "", d = i2 ? styleText2("yellow", S_BAR_END) : "";
3102
3112
  return `${s.trim()}
3103
- ${r2}${o2}
3104
- ${d}${n2}
3113
+ ${r2}${o}
3114
+ ${d}${n3}
3105
3115
  `;
3106
3116
  }
3107
3117
  case "submit": {
3108
- const n2 = a2 ? ` ${styleText2("dim", a2)}` : "", r2 = i2 ? styleText2("gray", S_BAR) : "";
3109
- return `${s}${r2}${n2}`;
3118
+ const n3 = l2 ? ` ${styleText2("dim", l2)}` : "", r2 = i2 ? styleText2("gray", S_BAR) : "";
3119
+ return `${s}${r2}${n3}`;
3110
3120
  }
3111
3121
  case "cancel": {
3112
- const n2 = a2 ? ` ${styleText2(["strikethrough", "dim"], a2)}` : "", r2 = i2 ? styleText2("gray", S_BAR) : "";
3113
- return `${s}${r2}${n2}${a2.trim() ? `
3122
+ const n3 = l2 ? ` ${styleText2(["strikethrough", "dim"], l2)}` : "", r2 = i2 ? styleText2("gray", S_BAR) : "";
3123
+ return `${s}${r2}${n3}${l2.trim() ? `
3114
3124
  ${r2}` : ""}`;
3115
3125
  }
3116
3126
  default: {
3117
- const n2 = i2 ? `${styleText2("cyan", S_BAR)} ` : "", r2 = i2 ? styleText2("cyan", S_BAR_END) : "";
3118
- return `${s}${n2}${o2}
3127
+ const n3 = i2 ? `${styleText2("cyan", S_BAR)} ` : "", r2 = i2 ? styleText2("cyan", S_BAR_END) : "";
3128
+ return `${s}${n3}${o}
3119
3129
  ${r2}
3120
3130
  `;
3121
3131
  }
@@ -3421,8 +3431,8 @@ function parse_args(argv) {
3421
3431
  else if (a2 === "-j" || a2 === "--json-schema" || a2 === "--json")
3422
3432
  json_schema = true;
3423
3433
  else if (a2 === "--max-files") {
3424
- const n2 = Number.parseInt(argv[++i2] ?? "", 10);
3425
- if (Number.isFinite(n2) && n2 > 0) max_files = n2;
3434
+ const n3 = Number.parseInt(argv[++i2] ?? "", 10);
3435
+ if (Number.isFinite(n3) && n3 > 0) max_files = n3;
3426
3436
  } else if (!a2.startsWith("-")) cwd = a2;
3427
3437
  }
3428
3438
  return { cwd, help, version, max_files, query, markdown, json_schema };