@bunli/test 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -14921,12 +14921,14 @@ var SchemaError = class extends Error {
14921
14921
  };
14922
14922
 
14923
14923
  // ../utils/dist/index.js
14924
- import { stripVTControlCharacters as S2 } from "util";
14925
- import { stdin as j, stdout as M } from "process";
14926
- import * as g from "readline";
14927
- import O from "readline";
14928
- import { Writable as X } from "stream";
14929
- import y2 from "process";
14924
+ import { stdout as R, stdin as q } from "process";
14925
+ import * as k from "readline";
14926
+ import ot from "readline";
14927
+ import { ReadStream as J } from "tty";
14928
+ import P2 from "process";
14929
+ import { readdirSync as ct2, existsSync as dt2, lstatSync as be } from "fs";
14930
+ import { dirname as xe, join as $t2 } from "path";
14931
+ import { stripVTControlCharacters as le } from "util";
14930
14932
  var __create2 = Object.create;
14931
14933
  var __getProtoOf2 = Object.getPrototypeOf;
14932
14934
  var __defProp2 = Object.defineProperty;
@@ -14953,62 +14955,6 @@ var __export2 = (target, all) => {
14953
14955
  set: (newValue) => all[name2] = () => newValue
14954
14956
  });
14955
14957
  };
14956
- var require_src2 = __commonJS2((exports, module) => {
14957
- var ESC = "\x1B";
14958
- var CSI = `${ESC}[`;
14959
- var beep = "\x07";
14960
- var cursor = {
14961
- to(x, y) {
14962
- if (!y)
14963
- return `${CSI}${x + 1}G`;
14964
- return `${CSI}${y + 1};${x + 1}H`;
14965
- },
14966
- move(x, y) {
14967
- let ret = "";
14968
- if (x < 0)
14969
- ret += `${CSI}${-x}D`;
14970
- else if (x > 0)
14971
- ret += `${CSI}${x}C`;
14972
- if (y < 0)
14973
- ret += `${CSI}${-y}A`;
14974
- else if (y > 0)
14975
- ret += `${CSI}${y}B`;
14976
- return ret;
14977
- },
14978
- up: (count = 1) => `${CSI}${count}A`,
14979
- down: (count = 1) => `${CSI}${count}B`,
14980
- forward: (count = 1) => `${CSI}${count}C`,
14981
- backward: (count = 1) => `${CSI}${count}D`,
14982
- nextLine: (count = 1) => `${CSI}E`.repeat(count),
14983
- prevLine: (count = 1) => `${CSI}F`.repeat(count),
14984
- left: `${CSI}G`,
14985
- hide: `${CSI}?25l`,
14986
- show: `${CSI}?25h`,
14987
- save: `${ESC}7`,
14988
- restore: `${ESC}8`
14989
- };
14990
- var scroll = {
14991
- up: (count = 1) => `${CSI}S`.repeat(count),
14992
- down: (count = 1) => `${CSI}T`.repeat(count)
14993
- };
14994
- var erase = {
14995
- screen: `${CSI}2J`,
14996
- up: (count = 1) => `${CSI}1J`.repeat(count),
14997
- down: (count = 1) => `${CSI}J`.repeat(count),
14998
- line: `${CSI}2K`,
14999
- lineEnd: `${CSI}K`,
15000
- lineStart: `${CSI}1K`,
15001
- lines(count) {
15002
- let clear = "";
15003
- for (let i = 0;i < count; i++)
15004
- clear += this.line + (i < count - 1 ? cursor.up() : "");
15005
- if (count)
15006
- clear += cursor.left;
15007
- return clear;
15008
- }
15009
- };
15010
- module.exports = { cursor, scroll, erase, beep };
15011
- });
15012
14958
  var require_picocolors = __commonJS2((exports, module) => {
15013
14959
  var p = process || {};
15014
14960
  var argv = p.argv || [];
@@ -15077,6 +15023,62 @@ var require_picocolors = __commonJS2((exports, module) => {
15077
15023
  module.exports = createColors();
15078
15024
  module.exports.createColors = createColors;
15079
15025
  });
15026
+ var require_src2 = __commonJS2((exports, module) => {
15027
+ var ESC = "\x1B";
15028
+ var CSI = `${ESC}[`;
15029
+ var beep = "\x07";
15030
+ var cursor = {
15031
+ to(x, y) {
15032
+ if (!y)
15033
+ return `${CSI}${x + 1}G`;
15034
+ return `${CSI}${y + 1};${x + 1}H`;
15035
+ },
15036
+ move(x, y) {
15037
+ let ret = "";
15038
+ if (x < 0)
15039
+ ret += `${CSI}${-x}D`;
15040
+ else if (x > 0)
15041
+ ret += `${CSI}${x}C`;
15042
+ if (y < 0)
15043
+ ret += `${CSI}${-y}A`;
15044
+ else if (y > 0)
15045
+ ret += `${CSI}${y}B`;
15046
+ return ret;
15047
+ },
15048
+ up: (count = 1) => `${CSI}${count}A`,
15049
+ down: (count = 1) => `${CSI}${count}B`,
15050
+ forward: (count = 1) => `${CSI}${count}C`,
15051
+ backward: (count = 1) => `${CSI}${count}D`,
15052
+ nextLine: (count = 1) => `${CSI}E`.repeat(count),
15053
+ prevLine: (count = 1) => `${CSI}F`.repeat(count),
15054
+ left: `${CSI}G`,
15055
+ hide: `${CSI}?25l`,
15056
+ show: `${CSI}?25h`,
15057
+ save: `${ESC}7`,
15058
+ restore: `${ESC}8`
15059
+ };
15060
+ var scroll = {
15061
+ up: (count = 1) => `${CSI}S`.repeat(count),
15062
+ down: (count = 1) => `${CSI}T`.repeat(count)
15063
+ };
15064
+ var erase = {
15065
+ screen: `${CSI}2J`,
15066
+ up: (count = 1) => `${CSI}1J`.repeat(count),
15067
+ down: (count = 1) => `${CSI}J`.repeat(count),
15068
+ line: `${CSI}2K`,
15069
+ lineEnd: `${CSI}K`,
15070
+ lineStart: `${CSI}1K`,
15071
+ lines(count) {
15072
+ let clear = "";
15073
+ for (let i = 0;i < count; i++)
15074
+ clear += this.line + (i < count - 1 ? cursor.up() : "");
15075
+ if (count)
15076
+ clear += cursor.left;
15077
+ return clear;
15078
+ }
15079
+ };
15080
+ module.exports = { cursor, scroll, erase, beep };
15081
+ });
15080
15082
  var colorCodes = {
15081
15083
  black: 30,
15082
15084
  red: 31,
@@ -15161,443 +15163,577 @@ var SchemaError2 = class extends Error {
15161
15163
  };
15162
15164
  var exports_dist = {};
15163
15165
  __export2(exports_dist, {
15164
- updateSettings: () => cD,
15165
- text: () => he,
15166
- tasks: () => Te,
15167
- stream: () => x2,
15168
- spinner: () => Y2,
15169
- selectKey: () => we,
15170
- select: () => ve,
15171
- password: () => ge,
15172
- outro: () => Se,
15173
- note: () => Me,
15174
- multiselect: () => fe,
15175
- log: () => M2,
15176
- isCancel: () => pD,
15177
- intro: () => Ie,
15178
- groupMultiselect: () => be,
15179
- group: () => Ce,
15180
- confirm: () => ye,
15181
- cancel: () => xe
15166
+ updateSettings: () => It,
15167
+ unicodeOr: () => w2,
15168
+ unicode: () => ee,
15169
+ text: () => Qt,
15170
+ tasks: () => Xt,
15171
+ taskLog: () => zt,
15172
+ symbolBar: () => Ee,
15173
+ symbol: () => N2,
15174
+ stream: () => H2,
15175
+ spinner: () => Ie,
15176
+ settings: () => _,
15177
+ selectKey: () => Jt,
15178
+ select: () => qt,
15179
+ progress: () => Kt,
15180
+ path: () => Ht,
15181
+ password: () => Gt,
15182
+ outro: () => Wt2,
15183
+ note: () => kt2,
15184
+ multiselect: () => Lt2,
15185
+ log: () => R2,
15186
+ limitOptions: () => J2,
15187
+ isTTY: () => Te,
15188
+ isCancel: () => Ct,
15189
+ isCI: () => ue,
15190
+ intro: () => Nt,
15191
+ groupMultiselect: () => Ot,
15192
+ group: () => Rt,
15193
+ confirm: () => Mt2,
15194
+ cancel: () => Pt,
15195
+ box: () => Tt2,
15196
+ autocompleteMultiselect: () => bt2,
15197
+ autocomplete: () => Je,
15198
+ S_WARN: () => Fe,
15199
+ S_SUCCESS: () => fe,
15200
+ S_STEP_SUBMIT: () => k2,
15201
+ S_STEP_ERROR: () => de,
15202
+ S_STEP_CANCEL: () => ce,
15203
+ S_STEP_ACTIVE: () => Me,
15204
+ S_RADIO_INACTIVE: () => K2,
15205
+ S_RADIO_ACTIVE: () => Y,
15206
+ S_PASSWORD_MASK: () => Pe,
15207
+ S_INFO: () => ge,
15208
+ S_ERROR: () => ye,
15209
+ S_CORNER_TOP_RIGHT: () => he,
15210
+ S_CORNER_TOP_LEFT: () => We,
15211
+ S_CORNER_BOTTOM_RIGHT: () => me,
15212
+ S_CORNER_BOTTOM_LEFT: () => pe,
15213
+ S_CONNECT_LEFT: () => Ne,
15214
+ S_CHECKBOX_SELECTED: () => G2,
15215
+ S_CHECKBOX_INACTIVE: () => z22,
15216
+ S_CHECKBOX_ACTIVE: () => te,
15217
+ S_BAR_START_RIGHT: () => Re,
15218
+ S_BAR_START: () => $e,
15219
+ S_BAR_H: () => se,
15220
+ S_BAR_END_RIGHT: () => Oe,
15221
+ S_BAR_END: () => x2,
15222
+ S_BAR: () => h
15182
15223
  });
15183
- var import_sisteransi = __toESM2(require_src2(), 1);
15184
15224
  var import_picocolors = __toESM2(require_picocolors(), 1);
15185
- function DD({ onlyFirst: e = false } = {}) {
15186
- const t = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
15187
- return new RegExp(t, e ? undefined : "g");
15188
- }
15189
- var uD = DD();
15190
- function P(e) {
15191
- if (typeof e != "string")
15192
- throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);
15193
- return e.replace(uD, "");
15194
- }
15195
- function L(e) {
15196
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
15197
- }
15198
- var W = { exports: {} };
15199
- (function(e) {
15200
- var u = {};
15201
- e.exports = u, u.eastAsianWidth = function(F) {
15202
- var s = F.charCodeAt(0), i = F.length == 2 ? F.charCodeAt(1) : 0, D = s;
15203
- return 55296 <= s && s <= 56319 && 56320 <= i && i <= 57343 && (s &= 1023, i &= 1023, D = s << 10 | i, D += 65536), D == 12288 || 65281 <= D && D <= 65376 || 65504 <= D && D <= 65510 ? "F" : D == 8361 || 65377 <= D && D <= 65470 || 65474 <= D && D <= 65479 || 65482 <= D && D <= 65487 || 65490 <= D && D <= 65495 || 65498 <= D && D <= 65500 || 65512 <= D && D <= 65518 ? "H" : 4352 <= D && D <= 4447 || 4515 <= D && D <= 4519 || 4602 <= D && D <= 4607 || 9001 <= D && D <= 9002 || 11904 <= D && D <= 11929 || 11931 <= D && D <= 12019 || 12032 <= D && D <= 12245 || 12272 <= D && D <= 12283 || 12289 <= D && D <= 12350 || 12353 <= D && D <= 12438 || 12441 <= D && D <= 12543 || 12549 <= D && D <= 12589 || 12593 <= D && D <= 12686 || 12688 <= D && D <= 12730 || 12736 <= D && D <= 12771 || 12784 <= D && D <= 12830 || 12832 <= D && D <= 12871 || 12880 <= D && D <= 13054 || 13056 <= D && D <= 19903 || 19968 <= D && D <= 42124 || 42128 <= D && D <= 42182 || 43360 <= D && D <= 43388 || 44032 <= D && D <= 55203 || 55216 <= D && D <= 55238 || 55243 <= D && D <= 55291 || 63744 <= D && D <= 64255 || 65040 <= D && D <= 65049 || 65072 <= D && D <= 65106 || 65108 <= D && D <= 65126 || 65128 <= D && D <= 65131 || 110592 <= D && D <= 110593 || 127488 <= D && D <= 127490 || 127504 <= D && D <= 127546 || 127552 <= D && D <= 127560 || 127568 <= D && D <= 127569 || 131072 <= D && D <= 194367 || 177984 <= D && D <= 196605 || 196608 <= D && D <= 262141 ? "W" : 32 <= D && D <= 126 || 162 <= D && D <= 163 || 165 <= D && D <= 166 || D == 172 || D == 175 || 10214 <= D && D <= 10221 || 10629 <= D && D <= 10630 ? "Na" : D == 161 || D == 164 || 167 <= D && D <= 168 || D == 170 || 173 <= D && D <= 174 || 176 <= D && D <= 180 || 182 <= D && D <= 186 || 188 <= D && D <= 191 || D == 198 || D == 208 || 215 <= D && D <= 216 || 222 <= D && D <= 225 || D == 230 || 232 <= D && D <= 234 || 236 <= D && D <= 237 || D == 240 || 242 <= D && D <= 243 || 247 <= D && D <= 250 || D == 252 || D == 254 || D == 257 || D == 273 || D == 275 || D == 283 || 294 <= D && D <= 295 || D == 299 || 305 <= D && D <= 307 || D == 312 || 319 <= D && D <= 322 || D == 324 || 328 <= D && D <= 331 || D == 333 || 338 <= D && D <= 339 || 358 <= D && D <= 359 || D == 363 || D == 462 || D == 464 || D == 466 || D == 468 || D == 470 || D == 472 || D == 474 || D == 476 || D == 593 || D == 609 || D == 708 || D == 711 || 713 <= D && D <= 715 || D == 717 || D == 720 || 728 <= D && D <= 731 || D == 733 || D == 735 || 768 <= D && D <= 879 || 913 <= D && D <= 929 || 931 <= D && D <= 937 || 945 <= D && D <= 961 || 963 <= D && D <= 969 || D == 1025 || 1040 <= D && D <= 1103 || D == 1105 || D == 8208 || 8211 <= D && D <= 8214 || 8216 <= D && D <= 8217 || 8220 <= D && D <= 8221 || 8224 <= D && D <= 8226 || 8228 <= D && D <= 8231 || D == 8240 || 8242 <= D && D <= 8243 || D == 8245 || D == 8251 || D == 8254 || D == 8308 || D == 8319 || 8321 <= D && D <= 8324 || D == 8364 || D == 8451 || D == 8453 || D == 8457 || D == 8467 || D == 8470 || 8481 <= D && D <= 8482 || D == 8486 || D == 8491 || 8531 <= D && D <= 8532 || 8539 <= D && D <= 8542 || 8544 <= D && D <= 8555 || 8560 <= D && D <= 8569 || D == 8585 || 8592 <= D && D <= 8601 || 8632 <= D && D <= 8633 || D == 8658 || D == 8660 || D == 8679 || D == 8704 || 8706 <= D && D <= 8707 || 8711 <= D && D <= 8712 || D == 8715 || D == 8719 || D == 8721 || D == 8725 || D == 8730 || 8733 <= D && D <= 8736 || D == 8739 || D == 8741 || 8743 <= D && D <= 8748 || D == 8750 || 8756 <= D && D <= 8759 || 8764 <= D && D <= 8765 || D == 8776 || D == 8780 || D == 8786 || 8800 <= D && D <= 8801 || 8804 <= D && D <= 8807 || 8810 <= D && D <= 8811 || 8814 <= D && D <= 8815 || 8834 <= D && D <= 8835 || 8838 <= D && D <= 8839 || D == 8853 || D == 8857 || D == 8869 || D == 8895 || D == 8978 || 9312 <= D && D <= 9449 || 9451 <= D && D <= 9547 || 9552 <= D && D <= 9587 || 9600 <= D && D <= 9615 || 9618 <= D && D <= 9621 || 9632 <= D && D <= 9633 || 9635 <= D && D <= 9641 || 9650 <= D && D <= 9651 || 9654 <= D && D <= 9655 || 9660 <= D && D <= 9661 || 9664 <= D && D <= 9665 || 9670 <= D && D <= 9672 || D == 9675 || 9678 <= D && D <= 9681 || 9698 <= D && D <= 9701 || D == 9711 || 9733 <= D && D <= 9734 || D == 9737 || 9742 <= D && D <= 9743 || 9748 <= D && D <= 9749 || D == 9756 || D == 9758 || D == 9792 || D == 9794 || 9824 <= D && D <= 9825 || 9827 <= D && D <= 9829 || 9831 <= D && D <= 9834 || 9836 <= D && D <= 9837 || D == 9839 || 9886 <= D && D <= 9887 || 9918 <= D && D <= 9919 || 9924 <= D && D <= 9933 || 9935 <= D && D <= 9953 || D == 9955 || 9960 <= D && D <= 9983 || D == 10045 || D == 10071 || 10102 <= D && D <= 10111 || 11093 <= D && D <= 11097 || 12872 <= D && D <= 12879 || 57344 <= D && D <= 63743 || 65024 <= D && D <= 65039 || D == 65533 || 127232 <= D && D <= 127242 || 127248 <= D && D <= 127277 || 127280 <= D && D <= 127337 || 127344 <= D && D <= 127386 || 917760 <= D && D <= 917999 || 983040 <= D && D <= 1048573 || 1048576 <= D && D <= 1114109 ? "A" : "N";
15204
- }, u.characterLength = function(F) {
15205
- var s = this.eastAsianWidth(F);
15206
- return s == "F" || s == "W" || s == "A" ? 2 : 1;
15207
- };
15208
- function t(F) {
15209
- return F.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
15210
- }
15211
- u.length = function(F) {
15212
- for (var s = t(F), i = 0, D = 0;D < s.length; D++)
15213
- i = i + this.characterLength(s[D]);
15214
- return i;
15215
- }, u.slice = function(F, s, i) {
15216
- textLen = u.length(F), s = s || 0, i = i || 1, s < 0 && (s = textLen + s), i < 0 && (i = textLen + i);
15217
- for (var D = "", r = 0, n = t(F), E = 0;E < n.length; E++) {
15218
- var a = n[E], o = u.length(a);
15219
- if (r >= s - (o == 2 ? 1 : 0))
15220
- if (r + o <= i)
15221
- D += a;
15222
- else
15225
+ var import_sisteransi = __toESM2(require_src2(), 1);
15226
+ var at = (t) => t === 161 || t === 164 || t === 167 || t === 168 || t === 170 || t === 173 || t === 174 || t >= 176 && t <= 180 || t >= 182 && t <= 186 || t >= 188 && t <= 191 || t === 198 || t === 208 || t === 215 || t === 216 || t >= 222 && t <= 225 || t === 230 || t >= 232 && t <= 234 || t === 236 || t === 237 || t === 240 || t === 242 || t === 243 || t >= 247 && t <= 250 || t === 252 || t === 254 || t === 257 || t === 273 || t === 275 || t === 283 || t === 294 || t === 295 || t === 299 || t >= 305 && t <= 307 || t === 312 || t >= 319 && t <= 322 || t === 324 || t >= 328 && t <= 331 || t === 333 || t === 338 || t === 339 || t === 358 || t === 359 || t === 363 || t === 462 || t === 464 || t === 466 || t === 468 || t === 470 || t === 472 || t === 474 || t === 476 || t === 593 || t === 609 || t === 708 || t === 711 || t >= 713 && t <= 715 || t === 717 || t === 720 || t >= 728 && t <= 731 || t === 733 || t === 735 || t >= 768 && t <= 879 || t >= 913 && t <= 929 || t >= 931 && t <= 937 || t >= 945 && t <= 961 || t >= 963 && t <= 969 || t === 1025 || t >= 1040 && t <= 1103 || t === 1105 || t === 8208 || t >= 8211 && t <= 8214 || t === 8216 || t === 8217 || t === 8220 || t === 8221 || t >= 8224 && t <= 8226 || t >= 8228 && t <= 8231 || t === 8240 || t === 8242 || t === 8243 || t === 8245 || t === 8251 || t === 8254 || t === 8308 || t === 8319 || t >= 8321 && t <= 8324 || t === 8364 || t === 8451 || t === 8453 || t === 8457 || t === 8467 || t === 8470 || t === 8481 || t === 8482 || t === 8486 || t === 8491 || t === 8531 || t === 8532 || t >= 8539 && t <= 8542 || t >= 8544 && t <= 8555 || t >= 8560 && t <= 8569 || t === 8585 || t >= 8592 && t <= 8601 || t === 8632 || t === 8633 || t === 8658 || t === 8660 || t === 8679 || t === 8704 || t === 8706 || t === 8707 || t === 8711 || t === 8712 || t === 8715 || t === 8719 || t === 8721 || t === 8725 || t === 8730 || t >= 8733 && t <= 8736 || t === 8739 || t === 8741 || t >= 8743 && t <= 8748 || t === 8750 || t >= 8756 && t <= 8759 || t === 8764 || t === 8765 || t === 8776 || t === 8780 || t === 8786 || t === 8800 || t === 8801 || t >= 8804 && t <= 8807 || t === 8810 || t === 8811 || t === 8814 || t === 8815 || t === 8834 || t === 8835 || t === 8838 || t === 8839 || t === 8853 || t === 8857 || t === 8869 || t === 8895 || t === 8978 || t >= 9312 && t <= 9449 || t >= 9451 && t <= 9547 || t >= 9552 && t <= 9587 || t >= 9600 && t <= 9615 || t >= 9618 && t <= 9621 || t === 9632 || t === 9633 || t >= 9635 && t <= 9641 || t === 9650 || t === 9651 || t === 9654 || t === 9655 || t === 9660 || t === 9661 || t === 9664 || t === 9665 || t >= 9670 && t <= 9672 || t === 9675 || t >= 9678 && t <= 9681 || t >= 9698 && t <= 9701 || t === 9711 || t === 9733 || t === 9734 || t === 9737 || t === 9742 || t === 9743 || t === 9756 || t === 9758 || t === 9792 || t === 9794 || t === 9824 || t === 9825 || t >= 9827 && t <= 9829 || t >= 9831 && t <= 9834 || t === 9836 || t === 9837 || t === 9839 || t === 9886 || t === 9887 || t === 9919 || t >= 9926 && t <= 9933 || t >= 9935 && t <= 9939 || t >= 9941 && t <= 9953 || t === 9955 || t === 9960 || t === 9961 || t >= 9963 && t <= 9969 || t === 9972 || t >= 9974 && t <= 9977 || t === 9979 || t === 9980 || t === 9982 || t === 9983 || t === 10045 || t >= 10102 && t <= 10111 || t >= 11094 && t <= 11097 || t >= 12872 && t <= 12879 || t >= 57344 && t <= 63743 || t >= 65024 && t <= 65039 || t === 65533 || t >= 127232 && t <= 127242 || t >= 127248 && t <= 127277 || t >= 127280 && t <= 127337 || t >= 127344 && t <= 127373 || t === 127375 || t === 127376 || t >= 127387 && t <= 127404 || t >= 917760 && t <= 917999 || t >= 983040 && t <= 1048573 || t >= 1048576 && t <= 1114109;
15227
+ var lt = (t) => t === 12288 || t >= 65281 && t <= 65376 || t >= 65504 && t <= 65510;
15228
+ var ht = (t) => t >= 4352 && t <= 4447 || t === 8986 || t === 8987 || t === 9001 || t === 9002 || t >= 9193 && t <= 9196 || t === 9200 || t === 9203 || t === 9725 || t === 9726 || t === 9748 || t === 9749 || t >= 9800 && t <= 9811 || t === 9855 || t === 9875 || t === 9889 || t === 9898 || t === 9899 || t === 9917 || t === 9918 || t === 9924 || t === 9925 || t === 9934 || t === 9940 || t === 9962 || t === 9970 || t === 9971 || t === 9973 || t === 9978 || t === 9981 || t === 9989 || t === 9994 || t === 9995 || t === 10024 || t === 10060 || t === 10062 || t >= 10067 && t <= 10069 || t === 10071 || t >= 10133 && t <= 10135 || t === 10160 || t === 10175 || t === 11035 || t === 11036 || t === 11088 || t === 11093 || t >= 11904 && t <= 11929 || t >= 11931 && t <= 12019 || t >= 12032 && t <= 12245 || t >= 12272 && t <= 12287 || t >= 12289 && t <= 12350 || t >= 12353 && t <= 12438 || t >= 12441 && t <= 12543 || t >= 12549 && t <= 12591 || t >= 12593 && t <= 12686 || t >= 12688 && t <= 12771 || t >= 12783 && t <= 12830 || t >= 12832 && t <= 12871 || t >= 12880 && t <= 19903 || t >= 19968 && t <= 42124 || t >= 42128 && t <= 42182 || t >= 43360 && t <= 43388 || t >= 44032 && t <= 55203 || t >= 63744 && t <= 64255 || t >= 65040 && t <= 65049 || t >= 65072 && t <= 65106 || t >= 65108 && t <= 65126 || t >= 65128 && t <= 65131 || t >= 94176 && t <= 94180 || t === 94192 || t === 94193 || t >= 94208 && t <= 100343 || t >= 100352 && t <= 101589 || t >= 101632 && t <= 101640 || t >= 110576 && t <= 110579 || t >= 110581 && t <= 110587 || t === 110589 || t === 110590 || t >= 110592 && t <= 110882 || t === 110898 || t >= 110928 && t <= 110930 || t === 110933 || t >= 110948 && t <= 110951 || t >= 110960 && t <= 111355 || t === 126980 || t === 127183 || t === 127374 || t >= 127377 && t <= 127386 || t >= 127488 && t <= 127490 || t >= 127504 && t <= 127547 || t >= 127552 && t <= 127560 || t === 127568 || t === 127569 || t >= 127584 && t <= 127589 || t >= 127744 && t <= 127776 || t >= 127789 && t <= 127797 || t >= 127799 && t <= 127868 || t >= 127870 && t <= 127891 || t >= 127904 && t <= 127946 || t >= 127951 && t <= 127955 || t >= 127968 && t <= 127984 || t === 127988 || t >= 127992 && t <= 128062 || t === 128064 || t >= 128066 && t <= 128252 || t >= 128255 && t <= 128317 || t >= 128331 && t <= 128334 || t >= 128336 && t <= 128359 || t === 128378 || t === 128405 || t === 128406 || t === 128420 || t >= 128507 && t <= 128591 || t >= 128640 && t <= 128709 || t === 128716 || t >= 128720 && t <= 128722 || t >= 128725 && t <= 128727 || t >= 128732 && t <= 128735 || t === 128747 || t === 128748 || t >= 128756 && t <= 128764 || t >= 128992 && t <= 129003 || t === 129008 || t >= 129292 && t <= 129338 || t >= 129340 && t <= 129349 || t >= 129351 && t <= 129535 || t >= 129648 && t <= 129660 || t >= 129664 && t <= 129672 || t >= 129680 && t <= 129725 || t >= 129727 && t <= 129733 || t >= 129742 && t <= 129755 || t >= 129760 && t <= 129768 || t >= 129776 && t <= 129784 || t >= 131072 && t <= 196605 || t >= 196608 && t <= 262141;
15229
+ var O = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;
15230
+ var y = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
15231
+ var M = /\t{1,1000}/y;
15232
+ var P = /[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu;
15233
+ var L = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
15234
+ var ct = /\p{M}+/gu;
15235
+ var pt = { limit: 1 / 0, ellipsis: "" };
15236
+ var X = (t, e = {}, s = {}) => {
15237
+ const i = e.limit ?? 1 / 0, r = e.ellipsis ?? "", n = e?.ellipsisWidth ?? (r ? X(r, pt, s).width : 0), u = s.ansiWidth ?? 0, a = s.controlWidth ?? 0, l = s.tabWidth ?? 8, E = s.ambiguousWidth ?? 1, g = s.emojiWidth ?? 2, m = s.fullWidthWidth ?? 2, A = s.regularWidth ?? 1, V = s.wideWidth ?? 2;
15238
+ let h = 0, o = 0, f = t.length, v = 0, F = false, d = f, b = Math.max(0, i - n), C = 0, B = 0, c = 0, p = 0;
15239
+ t:
15240
+ for (;; ) {
15241
+ if (B > C || o >= f && o > h) {
15242
+ const ut = t.slice(C, B) || t.slice(h, o);
15243
+ v = 0;
15244
+ for (const Y of ut.replaceAll(ct, "")) {
15245
+ const $ = Y.codePointAt(0) || 0;
15246
+ if (lt($) ? p = m : ht($) ? p = V : E !== A && at($) ? p = E : p = A, c + p > b && (d = Math.min(d, Math.max(C, h) + v)), c + p > i) {
15247
+ F = true;
15248
+ break t;
15249
+ }
15250
+ v += Y.length, c += p;
15251
+ }
15252
+ C = B = 0;
15253
+ }
15254
+ if (o >= f)
15255
+ break;
15256
+ if (L.lastIndex = o, L.test(t)) {
15257
+ if (v = L.lastIndex - o, p = v * A, c + p > b && (d = Math.min(d, o + Math.floor((b - c) / A))), c + p > i) {
15258
+ F = true;
15223
15259
  break;
15224
- r += o;
15260
+ }
15261
+ c += p, C = h, B = o, o = h = L.lastIndex;
15262
+ continue;
15263
+ }
15264
+ if (O.lastIndex = o, O.test(t)) {
15265
+ if (c + u > b && (d = Math.min(d, o)), c + u > i) {
15266
+ F = true;
15267
+ break;
15268
+ }
15269
+ c += u, C = h, B = o, o = h = O.lastIndex;
15270
+ continue;
15271
+ }
15272
+ if (y.lastIndex = o, y.test(t)) {
15273
+ if (v = y.lastIndex - o, p = v * a, c + p > b && (d = Math.min(d, o + Math.floor((b - c) / a))), c + p > i) {
15274
+ F = true;
15275
+ break;
15276
+ }
15277
+ c += p, C = h, B = o, o = h = y.lastIndex;
15278
+ continue;
15279
+ }
15280
+ if (M.lastIndex = o, M.test(t)) {
15281
+ if (v = M.lastIndex - o, p = v * l, c + p > b && (d = Math.min(d, o + Math.floor((b - c) / l))), c + p > i) {
15282
+ F = true;
15283
+ break;
15284
+ }
15285
+ c += p, C = h, B = o, o = h = M.lastIndex;
15286
+ continue;
15287
+ }
15288
+ if (P.lastIndex = o, P.test(t)) {
15289
+ if (c + g > b && (d = Math.min(d, o)), c + g > i) {
15290
+ F = true;
15291
+ break;
15292
+ }
15293
+ c += g, C = h, B = o, o = h = P.lastIndex;
15294
+ continue;
15295
+ }
15296
+ o += 1;
15225
15297
  }
15226
- return D;
15227
- };
15228
- })(W);
15229
- var tD = W.exports;
15230
- var eD = L(tD);
15231
- var FD = function() {
15232
- return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
15298
+ return { width: F ? b : c, index: F ? d : f, truncated: F, ellipsed: F && i >= n };
15233
15299
  };
15234
- var sD = L(FD);
15235
- function p(e, u = {}) {
15236
- if (typeof e != "string" || e.length === 0 || (u = { ambiguousIsNarrow: true, ...u }, e = P(e), e.length === 0))
15300
+ var ft = { limit: 1 / 0, ellipsis: "", ellipsisWidth: 0 };
15301
+ var S = (t, e = {}) => X(t, ft, e).width;
15302
+ var W = "\x1B";
15303
+ var Z = "\x9B";
15304
+ var Ft = 39;
15305
+ var j = "\x07";
15306
+ var Q = "[";
15307
+ var dt = "]";
15308
+ var tt = "m";
15309
+ var U = `${dt}8;;`;
15310
+ var et = new RegExp(`(?:\\${Q}(?<code>\\d+)m|\\${U}(?<uri>.*)${j})`, "y");
15311
+ var mt = (t) => {
15312
+ if (t >= 30 && t <= 37 || t >= 90 && t <= 97)
15313
+ return 39;
15314
+ if (t >= 40 && t <= 47 || t >= 100 && t <= 107)
15315
+ return 49;
15316
+ if (t === 1 || t === 2)
15317
+ return 22;
15318
+ if (t === 3)
15319
+ return 23;
15320
+ if (t === 4)
15321
+ return 24;
15322
+ if (t === 7)
15323
+ return 27;
15324
+ if (t === 8)
15325
+ return 28;
15326
+ if (t === 9)
15327
+ return 29;
15328
+ if (t === 0)
15237
15329
  return 0;
15238
- e = e.replace(sD(), " ");
15239
- const t = u.ambiguousIsNarrow ? 1 : 2;
15240
- let F = 0;
15241
- for (const s of e) {
15242
- const i = s.codePointAt(0);
15243
- if (i <= 31 || i >= 127 && i <= 159 || i >= 768 && i <= 879)
15244
- continue;
15245
- switch (eD.eastAsianWidth(s)) {
15246
- case "F":
15247
- case "W":
15248
- F += 2;
15249
- break;
15250
- case "A":
15251
- F += t;
15252
- break;
15253
- default:
15254
- F += 1;
15255
- }
15256
- }
15257
- return F;
15258
- }
15259
- var w = 10;
15260
- var N = (e = 0) => (u) => `\x1B[${u + e}m`;
15261
- var I = (e = 0) => (u) => `\x1B[${38 + e};5;${u}m`;
15262
- var R = (e = 0) => (u, t, F) => `\x1B[${38 + e};2;${u};${t};${F}m`;
15263
- var C = { modifier: { reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], overline: [53, 55], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29] }, color: { black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], blackBright: [90, 39], gray: [90, 39], grey: [90, 39], redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], blueBright: [94, 39], magentaBright: [95, 39], cyanBright: [96, 39], whiteBright: [97, 39] }, bgColor: { bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], bgBlackBright: [100, 49], bgGray: [100, 49], bgGrey: [100, 49], bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49] } };
15264
- Object.keys(C.modifier);
15265
- var iD = Object.keys(C.color);
15266
- var rD = Object.keys(C.bgColor);
15267
- [...iD, ...rD];
15268
- function CD() {
15269
- const e = new Map;
15270
- for (const [u, t] of Object.entries(C)) {
15271
- for (const [F, s] of Object.entries(t))
15272
- C[F] = { open: `\x1B[${s[0]}m`, close: `\x1B[${s[1]}m` }, t[F] = C[F], e.set(s[0], s[1]);
15273
- Object.defineProperty(C, u, { value: t, enumerable: false });
15274
- }
15275
- return Object.defineProperty(C, "codes", { value: e, enumerable: false }), C.color.close = "\x1B[39m", C.bgColor.close = "\x1B[49m", C.color.ansi = N(), C.color.ansi256 = I(), C.color.ansi16m = R(), C.bgColor.ansi = N(w), C.bgColor.ansi256 = I(w), C.bgColor.ansi16m = R(w), Object.defineProperties(C, { rgbToAnsi256: { value: (u, t, F) => u === t && t === F ? u < 8 ? 16 : u > 248 ? 231 : Math.round((u - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u / 255 * 5) + 6 * Math.round(t / 255 * 5) + Math.round(F / 255 * 5), enumerable: false }, hexToRgb: { value: (u) => {
15276
- const t = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));
15277
- if (!t)
15278
- return [0, 0, 0];
15279
- let [F] = t;
15280
- F.length === 3 && (F = [...F].map((i) => i + i).join(""));
15281
- const s = Number.parseInt(F, 16);
15282
- return [s >> 16 & 255, s >> 8 & 255, s & 255];
15283
- }, enumerable: false }, hexToAnsi256: { value: (u) => C.rgbToAnsi256(...C.hexToRgb(u)), enumerable: false }, ansi256ToAnsi: { value: (u) => {
15284
- if (u < 8)
15285
- return 30 + u;
15286
- if (u < 16)
15287
- return 90 + (u - 8);
15288
- let t, F, s;
15289
- if (u >= 232)
15290
- t = ((u - 232) * 10 + 8) / 255, F = t, s = t;
15291
- else {
15292
- u -= 16;
15293
- const r = u % 36;
15294
- t = Math.floor(u / 36) / 5, F = Math.floor(r / 6) / 5, s = r % 6 / 5;
15295
- }
15296
- const i = Math.max(t, F, s) * 2;
15297
- if (i === 0)
15298
- return 30;
15299
- let D = 30 + (Math.round(s) << 2 | Math.round(F) << 1 | Math.round(t));
15300
- return i === 2 && (D += 60), D;
15301
- }, enumerable: false }, rgbToAnsi: { value: (u, t, F) => C.ansi256ToAnsi(C.rgbToAnsi256(u, t, F)), enumerable: false }, hexToAnsi: { value: (u) => C.ansi256ToAnsi(C.hexToAnsi256(u)), enumerable: false } }), C;
15302
- }
15303
- var ED = CD();
15304
- var d = new Set(["\x1B", "\x9B"]);
15305
- var oD = 39;
15306
- var y = "\x07";
15307
- var V = "[";
15308
- var nD = "]";
15309
- var G = "m";
15310
- var _ = `${nD}8;;`;
15311
- var z2 = (e) => `${d.values().next().value}${V}${e}${G}`;
15312
- var K = (e) => `${d.values().next().value}${_}${e}${y}`;
15313
- var aD = (e) => e.split(" ").map((u) => p(u));
15314
- var k = (e, u, t) => {
15315
- const F = [...u];
15316
- let s = false, i = false, D = p(P(e[e.length - 1]));
15317
- for (const [r, n] of F.entries()) {
15318
- const E = p(n);
15319
- if (D + E <= t ? e[e.length - 1] += n : (e.push(n), D = 0), d.has(n) && (s = true, i = F.slice(r + 1).join("").startsWith(_)), s) {
15320
- i ? n === y && (s = false, i = false) : n === G && (s = false);
15321
- continue;
15322
- }
15323
- D += E, D === t && r < F.length - 1 && (e.push(""), D = 0);
15324
- }
15325
- !D && e[e.length - 1].length > 0 && e.length > 1 && (e[e.length - 2] += e.pop());
15326
15330
  };
15327
- var hD = (e) => {
15328
- const u = e.split(" ");
15329
- let t = u.length;
15330
- for (;t > 0 && !(p(u[t - 1]) > 0); )
15331
- t--;
15332
- return t === u.length ? e : u.slice(0, t).join(" ") + u.slice(t).join("");
15331
+ var st = (t) => `${W}${Q}${t}${tt}`;
15332
+ var it = (t) => `${W}${U}${t}${j}`;
15333
+ var gt = (t) => t.map((e) => S(e));
15334
+ var G = (t, e, s) => {
15335
+ const i = e[Symbol.iterator]();
15336
+ let r = false, n = false, u = t.at(-1), a = u === undefined ? 0 : S(u), l = i.next(), E = i.next(), g = 0;
15337
+ for (;!l.done; ) {
15338
+ const m = l.value, A = S(m);
15339
+ a + A <= s ? t[t.length - 1] += m : (t.push(m), a = 0), (m === W || m === Z) && (r = true, n = e.startsWith(U, g + 1)), r ? n ? m === j && (r = false, n = false) : m === tt && (r = false) : (a += A, a === s && !E.done && (t.push(""), a = 0)), l = E, E = i.next(), g += m.length;
15340
+ }
15341
+ u = t.at(-1), !a && u !== undefined && u.length > 0 && t.length > 1 && (t[t.length - 2] += t.pop());
15342
+ };
15343
+ var vt = (t) => {
15344
+ const e = t.split(" ");
15345
+ let s = e.length;
15346
+ for (;s > 0 && !(S(e[s - 1]) > 0); )
15347
+ s--;
15348
+ return s === e.length ? t : e.slice(0, s).join(" ") + e.slice(s).join("");
15333
15349
  };
15334
- var lD = (e, u, t = {}) => {
15335
- if (t.trim !== false && e.trim() === "")
15350
+ var Et = (t, e, s = {}) => {
15351
+ if (s.trim !== false && t.trim() === "")
15336
15352
  return "";
15337
- let F = "", s, i;
15338
- const D = aD(e);
15339
- let r = [""];
15340
- for (const [E, a] of e.split(" ").entries()) {
15341
- t.trim !== false && (r[r.length - 1] = r[r.length - 1].trimStart());
15342
- let o = p(r[r.length - 1]);
15343
- if (E !== 0 && (o >= u && (t.wordWrap === false || t.trim === false) && (r.push(""), o = 0), (o > 0 || t.trim === false) && (r[r.length - 1] += " ", o++)), t.hard && D[E] > u) {
15344
- const c = u - o, f = 1 + Math.floor((D[E] - c - 1) / u);
15345
- Math.floor((D[E] - 1) / u) < f && r.push(""), k(r, a, u);
15353
+ let i = "", r, n;
15354
+ const u = t.split(" "), a = gt(u);
15355
+ let l = [""];
15356
+ for (const [h, o] of u.entries()) {
15357
+ s.trim !== false && (l[l.length - 1] = (l.at(-1) ?? "").trimStart());
15358
+ let f = S(l.at(-1) ?? "");
15359
+ if (h !== 0 && (f >= e && (s.wordWrap === false || s.trim === false) && (l.push(""), f = 0), (f > 0 || s.trim === false) && (l[l.length - 1] += " ", f++)), s.hard && a[h] > e) {
15360
+ const v = e - f, F = 1 + Math.floor((a[h] - v - 1) / e);
15361
+ Math.floor((a[h] - 1) / e) < F && l.push(""), G(l, o, e);
15346
15362
  continue;
15347
15363
  }
15348
- if (o + D[E] > u && o > 0 && D[E] > 0) {
15349
- if (t.wordWrap === false && o < u) {
15350
- k(r, a, u);
15364
+ if (f + a[h] > e && f > 0 && a[h] > 0) {
15365
+ if (s.wordWrap === false && f < e) {
15366
+ G(l, o, e);
15351
15367
  continue;
15352
15368
  }
15353
- r.push("");
15369
+ l.push("");
15354
15370
  }
15355
- if (o + D[E] > u && t.wordWrap === false) {
15356
- k(r, a, u);
15371
+ if (f + a[h] > e && s.wordWrap === false) {
15372
+ G(l, o, e);
15357
15373
  continue;
15358
15374
  }
15359
- r[r.length - 1] += a;
15360
- }
15361
- t.trim !== false && (r = r.map((E) => hD(E)));
15362
- const n = [...r.join(`
15363
- `)];
15364
- for (const [E, a] of n.entries()) {
15365
- if (F += a, d.has(a)) {
15366
- const { groups: c } = new RegExp(`(?:\\${V}(?<code>\\d+)m|\\${_}(?<uri>.*)${y})`).exec(n.slice(E).join("")) || { groups: {} };
15367
- if (c.code !== undefined) {
15368
- const f = Number.parseFloat(c.code);
15369
- s = f === oD ? undefined : f;
15375
+ l[l.length - 1] += o;
15376
+ }
15377
+ s.trim !== false && (l = l.map((h) => vt(h)));
15378
+ const E = l.join(`
15379
+ `), g = E[Symbol.iterator]();
15380
+ let m = g.next(), A = g.next(), V = 0;
15381
+ for (;!m.done; ) {
15382
+ const h = m.value, o = A.value;
15383
+ if (i += h, h === W || h === Z) {
15384
+ et.lastIndex = V + 1;
15385
+ const F = et.exec(E)?.groups;
15386
+ if (F?.code !== undefined) {
15387
+ const d = Number.parseFloat(F.code);
15388
+ r = d === Ft ? undefined : d;
15370
15389
  } else
15371
- c.uri !== undefined && (i = c.uri.length === 0 ? undefined : c.uri);
15390
+ F?.uri !== undefined && (n = F.uri.length === 0 ? undefined : F.uri);
15372
15391
  }
15373
- const o = ED.codes.get(Number(s));
15374
- n[E + 1] === `
15375
- ` ? (i && (F += K("")), s && o && (F += z2(o))) : a === `
15376
- ` && (s && o && (F += z2(s)), i && (F += K(i)));
15392
+ const f = r ? mt(r) : undefined;
15393
+ o === `
15394
+ ` ? (n && (i += it("")), r && f && (i += st(f))) : h === `
15395
+ ` && (r && f && (i += st(r)), n && (i += it(n))), V += h.length, m = A, A = g.next();
15377
15396
  }
15378
- return F;
15397
+ return i;
15379
15398
  };
15380
- function Y(e, u, t) {
15381
- return String(e).normalize().replace(/\r\n/g, `
15399
+ function K(t, e, s) {
15400
+ return String(t).normalize().replaceAll(`\r
15401
+ `, `
15382
15402
  `).split(`
15383
- `).map((F) => lD(F, u, t)).join(`
15403
+ `).map((i) => Et(i, e, s)).join(`
15384
15404
  `);
15385
15405
  }
15386
- var xD = ["up", "down", "left", "right", "space", "enter", "cancel"];
15387
- var B = { actions: new Set(xD), aliases: new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["\x03", "cancel"], ["escape", "cancel"]]) };
15388
- function cD(e) {
15389
- for (const u in e) {
15390
- const t = u;
15391
- if (!Object.hasOwn(e, t))
15392
- continue;
15393
- const F = e[t];
15394
- switch (t) {
15395
- case "aliases": {
15396
- for (const s in F)
15397
- Object.hasOwn(F, s) && (B.aliases.has(s) || B.aliases.set(s, F[s]));
15398
- break;
15399
- }
15406
+ var At = ["up", "down", "left", "right", "space", "enter", "cancel"];
15407
+ var _ = { actions: new Set(At), aliases: new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["\x03", "cancel"], ["escape", "cancel"]]), messages: { cancel: "Canceled", error: "Something went wrong" }, withGuide: true };
15408
+ function It(t) {
15409
+ if (t.aliases !== undefined) {
15410
+ const e = t.aliases;
15411
+ for (const s in e) {
15412
+ if (!Object.hasOwn(e, s))
15413
+ continue;
15414
+ const i = e[s];
15415
+ _.actions.has(i) && (_.aliases.has(s) || _.aliases.set(s, i));
15400
15416
  }
15401
15417
  }
15418
+ if (t.messages !== undefined) {
15419
+ const e = t.messages;
15420
+ e.cancel !== undefined && (_.messages.cancel = e.cancel), e.error !== undefined && (_.messages.error = e.error);
15421
+ }
15422
+ t.withGuide !== undefined && (_.withGuide = t.withGuide !== false);
15402
15423
  }
15403
- function $(e, u) {
15404
- if (typeof e == "string")
15405
- return B.aliases.get(e) === u;
15406
- for (const t of e)
15407
- if (t !== undefined && $(t, u))
15424
+ function H(t, e) {
15425
+ if (typeof t == "string")
15426
+ return _.aliases.get(t) === e;
15427
+ for (const s of t)
15428
+ if (s !== undefined && H(s, e))
15408
15429
  return true;
15409
15430
  return false;
15410
15431
  }
15411
- function BD(e, u) {
15412
- if (e === u)
15432
+ function _t(t, e) {
15433
+ if (t === e)
15413
15434
  return;
15414
- const t = e.split(`
15415
- `), F = u.split(`
15416
- `), s = [];
15417
- for (let i = 0;i < Math.max(t.length, F.length); i++)
15418
- t[i] !== F[i] && s.push(i);
15419
- return s;
15420
- }
15421
- var AD = globalThis.process.platform.startsWith("win");
15422
- var S = Symbol("clack:cancel");
15423
- function pD(e) {
15424
- return e === S;
15425
- }
15426
- function m(e, u) {
15427
- const t = e;
15428
- t.isTTY && t.setRawMode(u);
15429
- }
15430
- function fD({ input: e = j, output: u = M, overwrite: t = true, hideCursor: F = true } = {}) {
15431
- const s = g.createInterface({ input: e, output: u, prompt: "", tabSize: 1 });
15432
- g.emitKeypressEvents(e, s), e.isTTY && e.setRawMode(true);
15433
- const i = (D, { name: r, sequence: n }) => {
15434
- const E = String(D);
15435
- if ($([E, r, n], "cancel")) {
15436
- F && u.write(import_sisteransi.cursor.show), process.exit(0);
15435
+ const s = t.split(`
15436
+ `), i = e.split(`
15437
+ `), r = Math.max(s.length, i.length), n = [];
15438
+ for (let u = 0;u < r; u++)
15439
+ s[u] !== i[u] && n.push(u);
15440
+ return { lines: n, numLinesBefore: s.length, numLinesAfter: i.length, numLines: r };
15441
+ }
15442
+ var bt = globalThis.process.platform.startsWith("win");
15443
+ var z2 = Symbol("clack:cancel");
15444
+ function Ct(t) {
15445
+ return t === z2;
15446
+ }
15447
+ function T(t, e) {
15448
+ const s = t;
15449
+ s.isTTY && s.setRawMode(e);
15450
+ }
15451
+ function xt({ input: t = q, output: e = R, overwrite: s = true, hideCursor: i = true } = {}) {
15452
+ const r = k.createInterface({ input: t, output: e, prompt: "", tabSize: 1 });
15453
+ k.emitKeypressEvents(t, r), t instanceof J && t.isTTY && t.setRawMode(true);
15454
+ const n = (u, { name: a, sequence: l }) => {
15455
+ const E = String(u);
15456
+ if (H([E, a, l], "cancel")) {
15457
+ i && e.write(import_sisteransi.cursor.show), process.exit(0);
15437
15458
  return;
15438
15459
  }
15439
- if (!t)
15460
+ if (!s)
15440
15461
  return;
15441
- const a = r === "return" ? 0 : -1, o = r === "return" ? -1 : 0;
15442
- g.moveCursor(u, a, o, () => {
15443
- g.clearLine(u, 1, () => {
15444
- e.once("keypress", i);
15462
+ const g = a === "return" ? 0 : -1, m = a === "return" ? -1 : 0;
15463
+ k.moveCursor(e, g, m, () => {
15464
+ k.clearLine(e, 1, () => {
15465
+ t.once("keypress", n);
15445
15466
  });
15446
15467
  });
15447
15468
  };
15448
- return F && u.write(import_sisteransi.cursor.hide), e.once("keypress", i), () => {
15449
- e.off("keypress", i), F && u.write(import_sisteransi.cursor.show), e.isTTY && !AD && e.setRawMode(false), s.terminal = false, s.close();
15469
+ return i && e.write(import_sisteransi.cursor.hide), t.once("keypress", n), () => {
15470
+ t.off("keypress", n), i && e.write(import_sisteransi.cursor.show), t instanceof J && t.isTTY && !bt && t.setRawMode(false), r.terminal = false, r.close();
15450
15471
  };
15451
15472
  }
15452
- var gD = Object.defineProperty;
15453
- var vD = (e, u, t) => (u in e) ? gD(e, u, { enumerable: true, configurable: true, writable: true, value: t }) : e[u] = t;
15454
- var h = (e, u, t) => (vD(e, typeof u != "symbol" ? u + "" : u, t), t);
15473
+ var rt = (t) => ("columns" in t) && typeof t.columns == "number" ? t.columns : 80;
15474
+ var nt = (t) => ("rows" in t) && typeof t.rows == "number" ? t.rows : 20;
15475
+ function Bt(t, e, s, i = s) {
15476
+ const r = rt(t ?? R);
15477
+ return K(e, r - s.length, { hard: true, trim: false }).split(`
15478
+ `).map((n, u) => `${u === 0 ? i : s}${n}`).join(`
15479
+ `);
15480
+ }
15455
15481
 
15456
15482
  class x {
15457
- constructor(u, t = true) {
15458
- h(this, "input"), h(this, "output"), h(this, "_abortSignal"), h(this, "rl"), h(this, "opts"), h(this, "_render"), h(this, "_track", false), h(this, "_prevFrame", ""), h(this, "_subscribers", new Map), h(this, "_cursor", 0), h(this, "state", "initial"), h(this, "error", ""), h(this, "value");
15459
- const { input: F = j, output: s = M, render: i, signal: D, ...r } = u;
15460
- this.opts = r, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = i.bind(this), this._track = t, this._abortSignal = D, this.input = F, this.output = s;
15483
+ input;
15484
+ output;
15485
+ _abortSignal;
15486
+ rl;
15487
+ opts;
15488
+ _render;
15489
+ _track = false;
15490
+ _prevFrame = "";
15491
+ _subscribers = new Map;
15492
+ _cursor = 0;
15493
+ state = "initial";
15494
+ error = "";
15495
+ value;
15496
+ userInput = "";
15497
+ constructor(e, s = true) {
15498
+ const { input: i = q, output: r = R, render: n, signal: u, ...a } = e;
15499
+ this.opts = a, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = n.bind(this), this._track = s, this._abortSignal = u, this.input = i, this.output = r;
15461
15500
  }
15462
15501
  unsubscribe() {
15463
15502
  this._subscribers.clear();
15464
15503
  }
15465
- setSubscriber(u, t) {
15466
- const F = this._subscribers.get(u) ?? [];
15467
- F.push(t), this._subscribers.set(u, F);
15504
+ setSubscriber(e, s) {
15505
+ const i = this._subscribers.get(e) ?? [];
15506
+ i.push(s), this._subscribers.set(e, i);
15468
15507
  }
15469
- on(u, t) {
15470
- this.setSubscriber(u, { cb: t });
15508
+ on(e, s) {
15509
+ this.setSubscriber(e, { cb: s });
15471
15510
  }
15472
- once(u, t) {
15473
- this.setSubscriber(u, { cb: t, once: true });
15511
+ once(e, s) {
15512
+ this.setSubscriber(e, { cb: s, once: true });
15474
15513
  }
15475
- emit(u, ...t) {
15476
- const F = this._subscribers.get(u) ?? [], s = [];
15477
- for (const i of F)
15478
- i.cb(...t), i.once && s.push(() => F.splice(F.indexOf(i), 1));
15479
- for (const i of s)
15480
- i();
15514
+ emit(e, ...s) {
15515
+ const i = this._subscribers.get(e) ?? [], r = [];
15516
+ for (const n of i)
15517
+ n.cb(...s), n.once && r.push(() => i.splice(i.indexOf(n), 1));
15518
+ for (const n of r)
15519
+ n();
15481
15520
  }
15482
15521
  prompt() {
15483
- return new Promise((u, t) => {
15522
+ return new Promise((e) => {
15484
15523
  if (this._abortSignal) {
15485
15524
  if (this._abortSignal.aborted)
15486
- return this.state = "cancel", this.close(), u(S);
15525
+ return this.state = "cancel", this.close(), e(z2);
15487
15526
  this._abortSignal.addEventListener("abort", () => {
15488
15527
  this.state = "cancel", this.close();
15489
15528
  }, { once: true });
15490
15529
  }
15491
- const F = new X;
15492
- F._write = (s, i, D) => {
15493
- this._track && (this.value = this.rl?.line.replace(/\t/g, ""), this._cursor = this.rl?.cursor ?? 0, this.emit("value", this.value)), D();
15494
- }, this.input.pipe(F), this.rl = O.createInterface({ input: this.input, output: F, tabSize: 2, prompt: "", escapeCodeTimeout: 50, terminal: true }), O.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== undefined && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), m(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
15495
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), m(this.input, false), u(this.value);
15530
+ this.rl = ot.createInterface({ input: this.input, tabSize: 2, prompt: "", escapeCodeTimeout: 50, terminal: true }), this.rl.prompt(), this.opts.initialUserInput !== undefined && this._setUserInput(this.opts.initialUserInput, true), this.input.on("keypress", this.onKeypress), T(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
15531
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), T(this.input, false), e(this.value);
15496
15532
  }), this.once("cancel", () => {
15497
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), m(this.input, false), u(S);
15533
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), T(this.input, false), e(z2);
15498
15534
  });
15499
15535
  });
15500
15536
  }
15501
- onKeypress(u, t) {
15502
- if (this.state === "error" && (this.state = "active"), t?.name && (!this._track && B.aliases.has(t.name) && this.emit("cursor", B.aliases.get(t.name)), B.actions.has(t.name) && this.emit("cursor", t.name)), u && (u.toLowerCase() === "y" || u.toLowerCase() === "n") && this.emit("confirm", u.toLowerCase() === "y"), u === "\t" && this.opts.placeholder && (this.value || (this.rl?.write(this.opts.placeholder), this.emit("value", this.opts.placeholder))), u && this.emit("key", u.toLowerCase()), t?.name === "return") {
15503
- if (!this.value && this.opts.placeholder && (this.rl?.write(this.opts.placeholder), this.emit("value", this.opts.placeholder)), this.opts.validate) {
15504
- const F = this.opts.validate(this.value);
15505
- F && (this.error = F instanceof Error ? F.message : F, this.state = "error", this.rl?.write(this.value));
15537
+ _isActionKey(e, s) {
15538
+ return e === "\t";
15539
+ }
15540
+ _setValue(e) {
15541
+ this.value = e, this.emit("value", this.value);
15542
+ }
15543
+ _setUserInput(e, s) {
15544
+ this.userInput = e ?? "", this.emit("userInput", this.userInput), s && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
15545
+ }
15546
+ _clearUserInput() {
15547
+ this.rl?.write(null, { ctrl: true, name: "u" }), this._setUserInput("");
15548
+ }
15549
+ onKeypress(e, s) {
15550
+ 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") {
15551
+ if (this.opts.validate) {
15552
+ const i = this.opts.validate(this.value);
15553
+ i && (this.error = i instanceof Error ? i.message : i, this.state = "error", this.rl?.write(this.userInput));
15506
15554
  }
15507
15555
  this.state !== "error" && (this.state = "submit");
15508
15556
  }
15509
- $([u, t?.name, t?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
15557
+ 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();
15510
15558
  }
15511
15559
  close() {
15512
15560
  this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
15513
- `), m(this.input, false), this.rl?.close(), this.rl = undefined, this.emit(`${this.state}`, this.value), this.unsubscribe();
15561
+ `), T(this.input, false), this.rl?.close(), this.rl = undefined, this.emit(`${this.state}`, this.value), this.unsubscribe();
15514
15562
  }
15515
15563
  restoreCursor() {
15516
- const u = Y(this._prevFrame, process.stdout.columns, { hard: true }).split(`
15564
+ const e = K(this._prevFrame, process.stdout.columns, { hard: true, trim: false }).split(`
15517
15565
  `).length - 1;
15518
- this.output.write(import_sisteransi.cursor.move(-999, u * -1));
15566
+ this.output.write(import_sisteransi.cursor.move(-999, e * -1));
15519
15567
  }
15520
15568
  render() {
15521
- const u = Y(this._render(this) ?? "", process.stdout.columns, { hard: true });
15522
- if (u !== this._prevFrame) {
15569
+ const e = K(this._render(this) ?? "", process.stdout.columns, { hard: true, trim: false });
15570
+ if (e !== this._prevFrame) {
15523
15571
  if (this.state === "initial")
15524
15572
  this.output.write(import_sisteransi.cursor.hide);
15525
15573
  else {
15526
- const t = BD(this._prevFrame, u);
15527
- if (this.restoreCursor(), t && t?.length === 1) {
15528
- const F = t[0];
15529
- this.output.write(import_sisteransi.cursor.move(0, F)), this.output.write(import_sisteransi.erase.lines(1));
15530
- const s = u.split(`
15574
+ const s = _t(this._prevFrame, e), i = nt(this.output);
15575
+ if (this.restoreCursor(), s) {
15576
+ const r = Math.max(0, s.numLinesAfter - i), n = Math.max(0, s.numLinesBefore - i);
15577
+ let u = s.lines.find((a) => a >= r);
15578
+ if (u === undefined) {
15579
+ this._prevFrame = e;
15580
+ return;
15581
+ }
15582
+ if (s.lines.length === 1) {
15583
+ this.output.write(import_sisteransi.cursor.move(0, u - n)), this.output.write(import_sisteransi.erase.lines(1));
15584
+ const a = e.split(`
15531
15585
  `);
15532
- this.output.write(s[F]), this._prevFrame = u, this.output.write(import_sisteransi.cursor.move(0, s.length - F - 1));
15533
- return;
15534
- }
15535
- if (t && t?.length > 1) {
15536
- const F = t[0];
15537
- this.output.write(import_sisteransi.cursor.move(0, F)), this.output.write(import_sisteransi.erase.down());
15538
- const s = u.split(`
15539
- `).slice(F);
15540
- this.output.write(s.join(`
15541
- `)), this._prevFrame = u;
15542
- return;
15586
+ this.output.write(a[u]), this._prevFrame = e, this.output.write(import_sisteransi.cursor.move(0, a.length - u - 1));
15587
+ return;
15588
+ } else if (s.lines.length > 1) {
15589
+ if (r < n)
15590
+ u = r;
15591
+ else {
15592
+ const l = u - n;
15593
+ l > 0 && this.output.write(import_sisteransi.cursor.move(0, l));
15594
+ }
15595
+ this.output.write(import_sisteransi.erase.down());
15596
+ const a = e.split(`
15597
+ `).slice(u);
15598
+ this.output.write(a.join(`
15599
+ `)), this._prevFrame = e;
15600
+ return;
15601
+ }
15543
15602
  }
15544
15603
  this.output.write(import_sisteransi.erase.down());
15545
15604
  }
15546
- this.output.write(u), this.state === "initial" && (this.state = "active"), this._prevFrame = u;
15605
+ this.output.write(e), this.state === "initial" && (this.state = "active"), this._prevFrame = e;
15547
15606
  }
15548
15607
  }
15549
15608
  }
15609
+ function wt(t, e) {
15610
+ if (t === undefined || e.length === 0)
15611
+ return 0;
15612
+ const s = e.findIndex((i) => i.value === t);
15613
+ return s !== -1 ? s : 0;
15614
+ }
15615
+ function Dt(t, e) {
15616
+ return (e.label ?? String(e.value)).toLowerCase().includes(t.toLowerCase());
15617
+ }
15618
+ function St(t, e) {
15619
+ if (e)
15620
+ return t ? e : e[0];
15621
+ }
15550
15622
 
15551
- class dD extends x {
15623
+ class Vt extends x {
15624
+ filteredOptions;
15625
+ multiple;
15626
+ isNavigating = false;
15627
+ selectedValues = [];
15628
+ focusedValue;
15629
+ #t = 0;
15630
+ #s = "";
15631
+ #i;
15632
+ #e;
15633
+ get cursor() {
15634
+ return this.#t;
15635
+ }
15636
+ get userInputWithCursor() {
15637
+ if (!this.userInput)
15638
+ return import_picocolors.default.inverse(import_picocolors.default.hidden("_"));
15639
+ if (this._cursor >= this.userInput.length)
15640
+ return `${this.userInput}\u2588`;
15641
+ const e = this.userInput.slice(0, this._cursor), [s, ...i] = this.userInput.slice(this._cursor);
15642
+ return `${e}${import_picocolors.default.inverse(s)}${i.join("")}`;
15643
+ }
15644
+ get options() {
15645
+ return typeof this.#e == "function" ? this.#e() : this.#e;
15646
+ }
15647
+ constructor(e) {
15648
+ super(e), this.#e = e.options;
15649
+ const s = this.options;
15650
+ this.filteredOptions = [...s], this.multiple = e.multiple === true, this.#i = e.filter ?? Dt;
15651
+ let i;
15652
+ if (e.initialValue && Array.isArray(e.initialValue) ? this.multiple ? i = e.initialValue : i = e.initialValue.slice(0, 1) : !this.multiple && this.options.length > 0 && (i = [this.options[0].value]), i)
15653
+ for (const r of i) {
15654
+ const n = s.findIndex((u) => u.value === r);
15655
+ n !== -1 && (this.toggleSelected(r), this.#t = n);
15656
+ }
15657
+ this.focusedValue = this.options[this.#t]?.value, this.on("key", (r, n) => this.#r(r, n)), this.on("userInput", (r) => this.#n(r));
15658
+ }
15659
+ _isActionKey(e, s) {
15660
+ return e === "\t" || this.multiple && this.isNavigating && s.name === "space" && e !== undefined && e !== "";
15661
+ }
15662
+ #r(e, s) {
15663
+ const i = s.name === "up", r = s.name === "down", n = s.name === "return";
15664
+ i || r ? (this.#t = Math.max(0, Math.min(this.#t + (i ? -1 : 1), this.filteredOptions.length - 1)), this.focusedValue = this.filteredOptions[this.#t]?.value, this.multiple || (this.selectedValues = [this.focusedValue]), this.isNavigating = true) : n ? this.value = St(this.multiple, this.selectedValues) : this.multiple ? this.focusedValue !== undefined && (s.name === "tab" || this.isNavigating && s.name === "space") ? this.toggleSelected(this.focusedValue) : this.isNavigating = false : (this.focusedValue && (this.selectedValues = [this.focusedValue]), this.isNavigating = false);
15665
+ }
15666
+ deselectAll() {
15667
+ this.selectedValues = [];
15668
+ }
15669
+ toggleSelected(e) {
15670
+ this.filteredOptions.length !== 0 && (this.multiple ? this.selectedValues.includes(e) ? this.selectedValues = this.selectedValues.filter((s) => s !== e) : this.selectedValues = [...this.selectedValues, e] : this.selectedValues = [e]);
15671
+ }
15672
+ #n(e) {
15673
+ if (e !== this.#s) {
15674
+ this.#s = e;
15675
+ const s = this.options;
15676
+ e ? this.filteredOptions = s.filter((i) => this.#i(e, i)) : this.filteredOptions = [...s], this.#t = wt(this.focusedValue, this.filteredOptions), this.focusedValue = this.filteredOptions[this.#t]?.value, this.multiple || (this.focusedValue !== undefined ? this.toggleSelected(this.focusedValue) : this.deselectAll());
15677
+ }
15678
+ }
15679
+ }
15680
+
15681
+ class kt extends x {
15552
15682
  get cursor() {
15553
15683
  return this.value ? 0 : 1;
15554
15684
  }
15555
15685
  get _value() {
15556
15686
  return this.cursor === 0;
15557
15687
  }
15558
- constructor(u) {
15559
- super(u, false), this.value = !!u.initialValue, this.on("value", () => {
15688
+ constructor(e) {
15689
+ super(e, false), this.value = !!e.initialValue, this.on("userInput", () => {
15560
15690
  this.value = this._value;
15561
- }), this.on("confirm", (t) => {
15562
- this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = t, this.state = "submit", this.close();
15691
+ }), this.on("confirm", (s) => {
15692
+ this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = s, this.state = "submit", this.close();
15563
15693
  }), this.on("cursor", () => {
15564
15694
  this.value = !this.value;
15565
15695
  });
15566
15696
  }
15567
15697
  }
15568
- var mD = Object.defineProperty;
15569
- var bD = (e, u, t) => (u in e) ? mD(e, u, { enumerable: true, configurable: true, writable: true, value: t }) : e[u] = t;
15570
- var Z = (e, u, t) => (bD(e, typeof u != "symbol" ? u + "" : u, t), t);
15571
- var q = (e, u, t) => {
15572
- if (!u.has(e))
15573
- throw TypeError("Cannot " + t);
15574
- };
15575
- var T = (e, u, t) => (q(e, u, "read from private field"), t ? t.call(e) : u.get(e));
15576
- var wD = (e, u, t) => {
15577
- if (u.has(e))
15578
- throw TypeError("Cannot add the same private member more than once");
15579
- u instanceof WeakSet ? u.add(e) : u.set(e, t);
15580
- };
15581
- var yD = (e, u, t, F) => (q(e, u, "write to private field"), F ? F.call(e, t) : u.set(e, t), t);
15582
- var A;
15583
- var _D = class extends x {
15584
- constructor(u) {
15585
- super(u, false), Z(this, "options"), Z(this, "cursor", 0), wD(this, A, undefined);
15586
- const { options: t } = u;
15587
- yD(this, A, u.selectableGroups !== false), this.options = Object.entries(t).flatMap(([F, s]) => [{ value: F, group: true, label: F }, ...s.map((i) => ({ ...i, group: F }))]), this.value = [...u.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: F }) => F === u.cursorAt), T(this, A) ? 0 : 1), this.on("cursor", (F) => {
15588
- switch (F) {
15698
+
15699
+ class yt extends x {
15700
+ options;
15701
+ cursor = 0;
15702
+ #t;
15703
+ getGroupItems(e) {
15704
+ return this.options.filter((s) => s.group === e);
15705
+ }
15706
+ isGroupSelected(e) {
15707
+ const s = this.getGroupItems(e), i = this.value;
15708
+ return i === undefined ? false : s.every((r) => i.includes(r.value));
15709
+ }
15710
+ toggleValue() {
15711
+ const e = this.options[this.cursor];
15712
+ if (this.value === undefined && (this.value = []), e.group === true) {
15713
+ const s = e.value, i = this.getGroupItems(s);
15714
+ this.isGroupSelected(s) ? this.value = this.value.filter((r) => i.findIndex((n) => n.value === r) === -1) : this.value = [...this.value, ...i.map((r) => r.value)], this.value = Array.from(new Set(this.value));
15715
+ } else {
15716
+ const s = this.value.includes(e.value);
15717
+ this.value = s ? this.value.filter((i) => i !== e.value) : [...this.value, e.value];
15718
+ }
15719
+ }
15720
+ constructor(e) {
15721
+ super(e, false);
15722
+ const { options: s } = e;
15723
+ this.#t = e.selectableGroups !== false, this.options = Object.entries(s).flatMap(([i, r]) => [{ value: i, group: true, label: i }, ...r.map((n) => ({ ...n, group: i }))]), this.value = [...e.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: i }) => i === e.cursorAt), this.#t ? 0 : 1), this.on("cursor", (i) => {
15724
+ switch (i) {
15589
15725
  case "left":
15590
15726
  case "up": {
15591
15727
  this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
15592
- const s = this.options[this.cursor]?.group === true;
15593
- !T(this, A) && s && (this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1);
15728
+ const r = this.options[this.cursor]?.group === true;
15729
+ !this.#t && r && (this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1);
15594
15730
  break;
15595
15731
  }
15596
15732
  case "down":
15597
15733
  case "right": {
15598
15734
  this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
15599
- const s = this.options[this.cursor]?.group === true;
15600
- !T(this, A) && s && (this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1);
15735
+ const r = this.options[this.cursor]?.group === true;
15736
+ !this.#t && r && (this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1);
15601
15737
  break;
15602
15738
  }
15603
15739
  case "space":
@@ -15606,40 +15742,51 @@ var _D = class extends x {
15606
15742
  }
15607
15743
  });
15608
15744
  }
15609
- getGroupItems(u) {
15610
- return this.options.filter((t) => t.group === u);
15745
+ }
15746
+ function D(t, e, s) {
15747
+ const i = t + e, r = Math.max(s.length - 1, 0), n = i < 0 ? r : i > r ? 0 : i;
15748
+ return s[n].disabled ? D(n, e < 0 ? -1 : 1, s) : n;
15749
+ }
15750
+
15751
+ class Mt extends x {
15752
+ options;
15753
+ cursor = 0;
15754
+ get _value() {
15755
+ return this.options[this.cursor].value;
15756
+ }
15757
+ get _enabledOptions() {
15758
+ return this.options.filter((e) => e.disabled !== true);
15611
15759
  }
15612
- isGroupSelected(u) {
15613
- return this.getGroupItems(u).every((t) => this.value.includes(t.value));
15760
+ toggleAll() {
15761
+ const e = this._enabledOptions, s = this.value !== undefined && this.value.length === e.length;
15762
+ this.value = s ? [] : e.map((i) => i.value);
15614
15763
  }
15615
- toggleValue() {
15616
- const u = this.options[this.cursor];
15617
- if (u.group === true) {
15618
- const t = u.value, F = this.getGroupItems(t);
15619
- this.isGroupSelected(t) ? this.value = this.value.filter((s) => F.findIndex((i) => i.value === s) === -1) : this.value = [...this.value, ...F.map((s) => s.value)], this.value = Array.from(new Set(this.value));
15620
- } else {
15621
- const t = this.value.includes(u.value);
15622
- this.value = t ? this.value.filter((F) => F !== u.value) : [...this.value, u.value];
15623
- }
15764
+ toggleInvert() {
15765
+ const e = this.value;
15766
+ if (!e)
15767
+ return;
15768
+ const s = this._enabledOptions.filter((i) => !e.includes(i.value));
15769
+ this.value = s.map((i) => i.value);
15624
15770
  }
15625
- };
15626
- A = new WeakMap;
15627
- var kD = Object.defineProperty;
15628
- var $D = (e, u, t) => (u in e) ? kD(e, u, { enumerable: true, configurable: true, writable: true, value: t }) : e[u] = t;
15629
- var H = (e, u, t) => ($D(e, typeof u != "symbol" ? u + "" : u, t), t);
15630
- var SD = class extends x {
15631
- constructor(u) {
15632
- super(u, false), H(this, "options"), H(this, "cursor", 0), this.options = u.options, this.value = [...u.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: t }) => t === u.cursorAt), 0), this.on("key", (t) => {
15633
- t === "a" && this.toggleAll();
15634
- }), this.on("cursor", (t) => {
15635
- switch (t) {
15771
+ toggleValue() {
15772
+ this.value === undefined && (this.value = []);
15773
+ const e = this.value.includes(this._value);
15774
+ this.value = e ? this.value.filter((s) => s !== this._value) : [...this.value, this._value];
15775
+ }
15776
+ constructor(e) {
15777
+ super(e, false), this.options = e.options, this.value = [...e.initialValues ?? []];
15778
+ const s = Math.max(this.options.findIndex(({ value: i }) => i === e.cursorAt), 0);
15779
+ this.cursor = this.options[s].disabled ? D(s, 1, this.options) : s, this.on("key", (i) => {
15780
+ i === "a" && this.toggleAll(), i === "i" && this.toggleInvert();
15781
+ }), this.on("cursor", (i) => {
15782
+ switch (i) {
15636
15783
  case "left":
15637
15784
  case "up":
15638
- this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
15785
+ this.cursor = D(this.cursor, -1, this.options);
15639
15786
  break;
15640
15787
  case "down":
15641
15788
  case "right":
15642
- this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
15789
+ this.cursor = D(this.cursor, 1, this.options);
15643
15790
  break;
15644
15791
  case "space":
15645
15792
  this.toggleValue();
@@ -15647,521 +15794,1057 @@ var SD = class extends x {
15647
15794
  }
15648
15795
  });
15649
15796
  }
15650
- get _value() {
15651
- return this.options[this.cursor].value;
15797
+ }
15798
+ var Lt = class extends x {
15799
+ _mask = "\u2022";
15800
+ get cursor() {
15801
+ return this._cursor;
15652
15802
  }
15653
- toggleAll() {
15654
- const u = this.value.length === this.options.length;
15655
- this.value = u ? [] : this.options.map((t) => t.value);
15803
+ get masked() {
15804
+ return this.userInput.replaceAll(/./g, this._mask);
15656
15805
  }
15657
- toggleValue() {
15658
- const u = this.value.includes(this._value);
15659
- this.value = u ? this.value.filter((t) => t !== this._value) : [...this.value, this._value];
15806
+ get userInputWithCursor() {
15807
+ if (this.state === "submit" || this.state === "cancel")
15808
+ return this.masked;
15809
+ const e = this.userInput;
15810
+ if (this.cursor >= e.length)
15811
+ return `${this.masked}${import_picocolors.default.inverse(import_picocolors.default.hidden("_"))}`;
15812
+ const s = this.masked, i = s.slice(0, this.cursor), r = s.slice(this.cursor);
15813
+ return `${i}${import_picocolors.default.inverse(r[0])}${r.slice(1)}`;
15660
15814
  }
15661
- };
15662
- var TD = Object.defineProperty;
15663
- var jD = (e, u, t) => (u in e) ? TD(e, u, { enumerable: true, configurable: true, writable: true, value: t }) : e[u] = t;
15664
- var U = (e, u, t) => (jD(e, typeof u != "symbol" ? u + "" : u, t), t);
15665
-
15666
- class MD extends x {
15667
- constructor({ mask: u, ...t }) {
15668
- super(t), U(this, "valueWithCursor", ""), U(this, "_mask", "\u2022"), this._mask = u ?? "\u2022", this.on("finalize", () => {
15669
- this.valueWithCursor = this.masked;
15670
- }), this.on("value", () => {
15671
- if (this.cursor >= this.value.length)
15672
- this.valueWithCursor = `${this.masked}${import_picocolors.default.inverse(import_picocolors.default.hidden("_"))}`;
15673
- else {
15674
- const F = this.masked.slice(0, this.cursor), s = this.masked.slice(this.cursor);
15675
- this.valueWithCursor = `${F}${import_picocolors.default.inverse(s[0])}${s.slice(1)}`;
15676
- }
15815
+ clear() {
15816
+ this._clearUserInput();
15817
+ }
15818
+ constructor({ mask: e, ...s }) {
15819
+ super(s), this._mask = e ?? "\u2022", this.on("userInput", (i) => {
15820
+ this._setValue(i);
15677
15821
  });
15678
15822
  }
15679
- get cursor() {
15680
- return this._cursor;
15823
+ };
15824
+
15825
+ class Wt extends x {
15826
+ options;
15827
+ cursor = 0;
15828
+ get _selectedValue() {
15829
+ return this.options[this.cursor];
15681
15830
  }
15682
- get masked() {
15683
- return this.value.replaceAll(/./g, this._mask);
15831
+ changeValue() {
15832
+ this.value = this._selectedValue.value;
15684
15833
  }
15685
- }
15686
- var OD = Object.defineProperty;
15687
- var PD = (e, u, t) => (u in e) ? OD(e, u, { enumerable: true, configurable: true, writable: true, value: t }) : e[u] = t;
15688
- var J = (e, u, t) => (PD(e, typeof u != "symbol" ? u + "" : u, t), t);
15689
-
15690
- class LD extends x {
15691
- constructor(u) {
15692
- super(u, false), J(this, "options"), J(this, "cursor", 0), this.options = u.options, this.cursor = this.options.findIndex(({ value: t }) => t === u.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (t) => {
15693
- switch (t) {
15834
+ constructor(e) {
15835
+ super(e, false), this.options = e.options;
15836
+ const s = this.options.findIndex(({ value: r }) => r === e.initialValue), i = s === -1 ? 0 : s;
15837
+ this.cursor = this.options[i].disabled ? D(i, 1, this.options) : i, this.changeValue(), this.on("cursor", (r) => {
15838
+ switch (r) {
15694
15839
  case "left":
15695
15840
  case "up":
15696
- this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
15841
+ this.cursor = D(this.cursor, -1, this.options);
15697
15842
  break;
15698
15843
  case "down":
15699
15844
  case "right":
15700
- this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
15845
+ this.cursor = D(this.cursor, 1, this.options);
15701
15846
  break;
15702
15847
  }
15703
15848
  this.changeValue();
15704
15849
  });
15705
15850
  }
15706
- get _value() {
15707
- return this.options[this.cursor];
15708
- }
15709
- changeValue() {
15710
- this.value = this._value.value;
15711
- }
15712
15851
  }
15713
- var WD = Object.defineProperty;
15714
- var ND = (e, u, t) => (u in e) ? WD(e, u, { enumerable: true, configurable: true, writable: true, value: t }) : e[u] = t;
15715
- var Q = (e, u, t) => (ND(e, typeof u != "symbol" ? u + "" : u, t), t);
15716
15852
 
15717
- class ID extends x {
15718
- constructor(u) {
15719
- super(u, false), Q(this, "options"), Q(this, "cursor", 0), this.options = u.options;
15720
- const t = this.options.map(({ value: [F] }) => F?.toLowerCase());
15721
- this.cursor = Math.max(t.indexOf(u.initialValue), 0), this.on("key", (F) => {
15722
- if (!t.includes(F))
15853
+ class Tt extends x {
15854
+ options;
15855
+ cursor = 0;
15856
+ constructor(e) {
15857
+ super(e, false), this.options = e.options;
15858
+ const s = e.caseSensitive === true, i = this.options.map(({ value: [r] }) => s ? r : r?.toLowerCase());
15859
+ this.cursor = Math.max(i.indexOf(e.initialValue), 0), this.on("key", (r, n) => {
15860
+ if (!r)
15723
15861
  return;
15724
- const s = this.options.find(({ value: [i] }) => i?.toLowerCase() === F);
15725
- s && (this.value = s.value, this.state = "submit", this.emit("submit"));
15862
+ const u = s && n.shift ? r.toUpperCase() : r;
15863
+ if (!i.includes(u))
15864
+ return;
15865
+ const a = this.options.find(({ value: [l] }) => s ? l === u : l?.toLowerCase() === r);
15866
+ a && (this.value = a.value, this.state = "submit", this.emit("submit"));
15726
15867
  });
15727
15868
  }
15728
15869
  }
15729
15870
 
15730
- class RD extends x {
15731
- get valueWithCursor() {
15871
+ class $t extends x {
15872
+ get userInputWithCursor() {
15732
15873
  if (this.state === "submit")
15733
- return this.value;
15734
- if (this.cursor >= this.value.length)
15735
- return `${this.value}\u2588`;
15736
- const u = this.value.slice(0, this.cursor), [t, ...F] = this.value.slice(this.cursor);
15737
- return `${u}${import_picocolors.default.inverse(t)}${F.join("")}`;
15874
+ return this.userInput;
15875
+ const e = this.userInput;
15876
+ if (this.cursor >= e.length)
15877
+ return `${this.userInput}\u2588`;
15878
+ const s = e.slice(0, this.cursor), [i, ...r] = e.slice(this.cursor);
15879
+ return `${s}${import_picocolors.default.inverse(i)}${r.join("")}`;
15738
15880
  }
15739
15881
  get cursor() {
15740
15882
  return this._cursor;
15741
15883
  }
15742
- constructor(u) {
15743
- super(u), this.on("finalize", () => {
15744
- this.value || (this.value = u.defaultValue);
15884
+ constructor(e) {
15885
+ super({ ...e, initialUserInput: e.initialUserInput ?? e.initialValue }), this.on("userInput", (s) => {
15886
+ this._setValue(s);
15887
+ }), this.on("finalize", () => {
15888
+ this.value || (this.value = e.defaultValue), this.value === undefined && (this.value = "");
15745
15889
  });
15746
15890
  }
15747
15891
  }
15748
15892
  var import_picocolors2 = __toESM2(require_picocolors(), 1);
15749
15893
  var import_sisteransi2 = __toESM2(require_src2(), 1);
15750
- function ce() {
15751
- return y2.platform !== "win32" ? y2.env.TERM !== "linux" : !!y2.env.CI || !!y2.env.WT_SESSION || !!y2.env.TERMINUS_SUBLIME || y2.env.ConEmuTask === "{cmd::Cmder}" || y2.env.TERM_PROGRAM === "Terminus-Sublime" || y2.env.TERM_PROGRAM === "vscode" || y2.env.TERM === "xterm-256color" || y2.env.TERM === "alacritty" || y2.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
15752
- }
15753
- var V2 = ce();
15754
- var u = (t, n) => V2 ? t : n;
15755
- var le = u("\u25C6", "*");
15756
- var L2 = u("\u25A0", "x");
15757
- var W2 = u("\u25B2", "x");
15758
- var C2 = u("\u25C7", "o");
15759
- var ue = u("\u250C", "T");
15760
- var o = u("\u2502", "|");
15761
- var d2 = u("\u2514", "\u2014");
15762
- var k2 = u("\u25CF", ">");
15763
- var P2 = u("\u25CB", " ");
15764
- var A2 = u("\u25FB", "[\u2022]");
15765
- var T2 = u("\u25FC", "[+]");
15766
- var F = u("\u25FB", "[ ]");
15767
- var $e = u("\u25AA", "\u2022");
15768
- var _2 = u("\u2500", "-");
15769
- var me = u("\u256E", "+");
15770
- var de = u("\u251C", "+");
15771
- var pe = u("\u256F", "+");
15772
- var q2 = u("\u25CF", "\u2022");
15773
- var D = u("\u25C6", "*");
15774
- var U2 = u("\u25B2", "!");
15775
- var K2 = u("\u25A0", "x");
15776
- var b2 = (t) => {
15777
- switch (t) {
15894
+ function ht2() {
15895
+ return P2.platform !== "win32" ? P2.env.TERM !== "linux" : !!P2.env.CI || !!P2.env.WT_SESSION || !!P2.env.TERMINUS_SUBLIME || P2.env.ConEmuTask === "{cmd::Cmder}" || P2.env.TERM_PROGRAM === "Terminus-Sublime" || P2.env.TERM_PROGRAM === "vscode" || P2.env.TERM === "xterm-256color" || P2.env.TERM === "alacritty" || P2.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
15896
+ }
15897
+ var ee = ht2();
15898
+ var ue = () => process.env.CI === "true";
15899
+ var Te = (e) => e.isTTY === true;
15900
+ var w2 = (e, r) => ee ? e : r;
15901
+ var Me = w2("\u25C6", "*");
15902
+ var ce = w2("\u25A0", "x");
15903
+ var de = w2("\u25B2", "x");
15904
+ var k2 = w2("\u25C7", "o");
15905
+ var $e = w2("\u250C", "T");
15906
+ var h = w2("\u2502", "|");
15907
+ var x2 = w2("\u2514", "\u2014");
15908
+ var Re = w2("\u2510", "T");
15909
+ var Oe = w2("\u2518", "\u2014");
15910
+ var Y = w2("\u25CF", ">");
15911
+ var K2 = w2("\u25CB", " ");
15912
+ var te = w2("\u25FB", "[\u2022]");
15913
+ var G2 = w2("\u25FC", "[+]");
15914
+ var z22 = w2("\u25FB", "[ ]");
15915
+ var Pe = w2("\u25AA", "\u2022");
15916
+ var se = w2("\u2500", "-");
15917
+ var he = w2("\u256E", "+");
15918
+ var Ne = w2("\u251C", "+");
15919
+ var me = w2("\u256F", "+");
15920
+ var pe = w2("\u2570", "+");
15921
+ var We = w2("\u256D", "+");
15922
+ var ge = w2("\u25CF", "\u2022");
15923
+ var fe = w2("\u25C6", "*");
15924
+ var Fe = w2("\u25B2", "!");
15925
+ var ye = w2("\u25A0", "x");
15926
+ var N2 = (e) => {
15927
+ switch (e) {
15778
15928
  case "initial":
15779
15929
  case "active":
15780
- return import_picocolors2.default.cyan(le);
15930
+ return import_picocolors2.default.cyan(Me);
15781
15931
  case "cancel":
15782
- return import_picocolors2.default.red(L2);
15932
+ return import_picocolors2.default.red(ce);
15783
15933
  case "error":
15784
- return import_picocolors2.default.yellow(W2);
15934
+ return import_picocolors2.default.yellow(de);
15785
15935
  case "submit":
15786
- return import_picocolors2.default.green(C2);
15936
+ return import_picocolors2.default.green(k2);
15787
15937
  }
15788
15938
  };
15789
- var G2 = (t) => {
15790
- const { cursor: n, options: r, style: i } = t, s = t.maxItems ?? Number.POSITIVE_INFINITY, c = Math.max(process.stdout.rows - 4, 0), a = Math.min(c, Math.max(s, 5));
15791
- let l2 = 0;
15792
- n >= l2 + a - 3 ? l2 = Math.max(Math.min(n - a + 3, r.length - a), 0) : n < l2 + 2 && (l2 = Math.max(n - 2, 0));
15793
- const $2 = a < r.length && l2 > 0, g2 = a < r.length && l2 + a < r.length;
15794
- return r.slice(l2, l2 + a).map((p2, v2, f) => {
15795
- const j2 = v2 === 0 && $2, E = v2 === f.length - 1 && g2;
15796
- return j2 || E ? import_picocolors2.default.dim("...") : i(p2, v2 + l2 === n);
15797
- });
15798
- };
15799
- var he = (t) => new RD({ validate: t.validate, placeholder: t.placeholder, defaultValue: t.defaultValue, initialValue: t.initialValue, render() {
15800
- const n = `${import_picocolors2.default.gray(o)}
15801
- ${b2(this.state)} ${t.message}
15802
- `, r = t.placeholder ? import_picocolors2.default.inverse(t.placeholder[0]) + import_picocolors2.default.dim(t.placeholder.slice(1)) : import_picocolors2.default.inverse(import_picocolors2.default.hidden("_")), i = this.value ? this.valueWithCursor : r;
15803
- switch (this.state) {
15939
+ var Ee = (e) => {
15940
+ switch (e) {
15941
+ case "initial":
15942
+ case "active":
15943
+ return import_picocolors2.default.cyan(h);
15944
+ case "cancel":
15945
+ return import_picocolors2.default.red(h);
15804
15946
  case "error":
15805
- return `${n.trim()}
15806
- ${import_picocolors2.default.yellow(o)} ${i}
15807
- ${import_picocolors2.default.yellow(d2)} ${import_picocolors2.default.yellow(this.error)}
15808
- `;
15947
+ return import_picocolors2.default.yellow(h);
15809
15948
  case "submit":
15810
- return `${n}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(this.value || t.placeholder)}`;
15811
- case "cancel":
15812
- return `${n}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(this.value ?? ""))}${this.value?.trim() ? `
15813
- ${import_picocolors2.default.gray(o)}` : ""}`;
15814
- default:
15815
- return `${n}${import_picocolors2.default.cyan(o)} ${i}
15816
- ${import_picocolors2.default.cyan(d2)}
15817
- `;
15949
+ return import_picocolors2.default.green(h);
15818
15950
  }
15819
- } }).prompt();
15820
- var ge = (t) => new MD({ validate: t.validate, mask: t.mask ?? $e, render() {
15821
- const n = `${import_picocolors2.default.gray(o)}
15822
- ${b2(this.state)} ${t.message}
15823
- `, r = this.valueWithCursor, i = this.masked;
15951
+ };
15952
+ var mt2 = (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;
15953
+ var pt2 = (e) => e === 12288 || e >= 65281 && e <= 65376 || e >= 65504 && e <= 65510;
15954
+ var gt2 = (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;
15955
+ var ve = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;
15956
+ var re = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
15957
+ var ie = /\t{1,1000}/y;
15958
+ var Ae = /[\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;
15959
+ var ne = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
15960
+ var ft2 = /\p{M}+/gu;
15961
+ var Ft2 = { limit: 1 / 0, ellipsis: "" };
15962
+ var Le = (e, r = {}, s = {}) => {
15963
+ const i = r.limit ?? 1 / 0, n = r.ellipsis ?? "", o = r?.ellipsisWidth ?? (n ? Le(n, Ft2, s).width : 0), u = s.ansiWidth ?? 0, l = s.controlWidth ?? 0, a = s.tabWidth ?? 8, d = s.ambiguousWidth ?? 1, g = s.emojiWidth ?? 2, E = s.fullWidthWidth ?? 2, p = s.regularWidth ?? 1, y2 = s.wideWidth ?? 2;
15964
+ let $ = 0, c = 0, m = e.length, f = 0, F = false, v = m, S2 = Math.max(0, i - o), B = 0, b = 0, A = 0, C = 0;
15965
+ e:
15966
+ for (;; ) {
15967
+ if (b > B || c >= m && c > $) {
15968
+ const _2 = e.slice(B, b) || e.slice($, c);
15969
+ f = 0;
15970
+ for (const D2 of _2.replaceAll(ft2, "")) {
15971
+ const T2 = D2.codePointAt(0) || 0;
15972
+ if (pt2(T2) ? C = E : gt2(T2) ? C = y2 : d !== p && mt2(T2) ? C = d : C = p, A + C > S2 && (v = Math.min(v, Math.max(B, $) + f)), A + C > i) {
15973
+ F = true;
15974
+ break e;
15975
+ }
15976
+ f += D2.length, A += C;
15977
+ }
15978
+ B = b = 0;
15979
+ }
15980
+ if (c >= m)
15981
+ break;
15982
+ if (ne.lastIndex = c, ne.test(e)) {
15983
+ if (f = ne.lastIndex - c, C = f * p, A + C > S2 && (v = Math.min(v, c + Math.floor((S2 - A) / p))), A + C > i) {
15984
+ F = true;
15985
+ break;
15986
+ }
15987
+ A += C, B = $, b = c, c = $ = ne.lastIndex;
15988
+ continue;
15989
+ }
15990
+ if (ve.lastIndex = c, ve.test(e)) {
15991
+ if (A + u > S2 && (v = Math.min(v, c)), A + u > i) {
15992
+ F = true;
15993
+ break;
15994
+ }
15995
+ A += u, B = $, b = c, c = $ = ve.lastIndex;
15996
+ continue;
15997
+ }
15998
+ if (re.lastIndex = c, re.test(e)) {
15999
+ if (f = re.lastIndex - c, C = f * l, A + C > S2 && (v = Math.min(v, c + Math.floor((S2 - A) / l))), A + C > i) {
16000
+ F = true;
16001
+ break;
16002
+ }
16003
+ A += C, B = $, b = c, c = $ = re.lastIndex;
16004
+ continue;
16005
+ }
16006
+ if (ie.lastIndex = c, ie.test(e)) {
16007
+ if (f = ie.lastIndex - c, C = f * a, A + C > S2 && (v = Math.min(v, c + Math.floor((S2 - A) / a))), A + C > i) {
16008
+ F = true;
16009
+ break;
16010
+ }
16011
+ A += C, B = $, b = c, c = $ = ie.lastIndex;
16012
+ continue;
16013
+ }
16014
+ if (Ae.lastIndex = c, Ae.test(e)) {
16015
+ if (A + g > S2 && (v = Math.min(v, c)), A + g > i) {
16016
+ F = true;
16017
+ break;
16018
+ }
16019
+ A += g, B = $, b = c, c = $ = Ae.lastIndex;
16020
+ continue;
16021
+ }
16022
+ c += 1;
16023
+ }
16024
+ return { width: F ? S2 : A, index: F ? v : m, truncated: F, ellipsed: F && i >= o };
16025
+ };
16026
+ var yt2 = { limit: 1 / 0, ellipsis: "", ellipsisWidth: 0 };
16027
+ var M2 = (e, r = {}) => Le(e, yt2, r).width;
16028
+ var ae = "\x1B";
16029
+ var je = "\x9B";
16030
+ var Et2 = 39;
16031
+ var Ce = "\x07";
16032
+ var Ve = "[";
16033
+ var vt2 = "]";
16034
+ var ke = "m";
16035
+ var we = `${vt2}8;;`;
16036
+ var Ge = new RegExp(`(?:\\${Ve}(?<code>\\d+)m|\\${we}(?<uri>.*)${Ce})`, "y");
16037
+ var At2 = (e) => {
16038
+ if (e >= 30 && e <= 37 || e >= 90 && e <= 97)
16039
+ return 39;
16040
+ if (e >= 40 && e <= 47 || e >= 100 && e <= 107)
16041
+ return 49;
16042
+ if (e === 1 || e === 2)
16043
+ return 22;
16044
+ if (e === 3)
16045
+ return 23;
16046
+ if (e === 4)
16047
+ return 24;
16048
+ if (e === 7)
16049
+ return 27;
16050
+ if (e === 8)
16051
+ return 28;
16052
+ if (e === 9)
16053
+ return 29;
16054
+ if (e === 0)
16055
+ return 0;
16056
+ };
16057
+ var He = (e) => `${ae}${Ve}${e}${ke}`;
16058
+ var Ue = (e) => `${ae}${we}${e}${Ce}`;
16059
+ var Ct2 = (e) => e.map((r) => M2(r));
16060
+ var Se = (e, r, s) => {
16061
+ const i = r[Symbol.iterator]();
16062
+ let n = false, o = false, u = e.at(-1), l = u === undefined ? 0 : M2(u), a = i.next(), d = i.next(), g = 0;
16063
+ for (;!a.done; ) {
16064
+ const E = a.value, p = M2(E);
16065
+ l + p <= s ? e[e.length - 1] += E : (e.push(E), l = 0), (E === ae || E === je) && (n = true, o = r.startsWith(we, g + 1)), n ? o ? E === Ce && (n = false, o = false) : E === ke && (n = false) : (l += p, l === s && !d.done && (e.push(""), l = 0)), a = d, d = i.next(), g += E.length;
16066
+ }
16067
+ u = e.at(-1), !l && u !== undefined && u.length > 0 && e.length > 1 && (e[e.length - 2] += e.pop());
16068
+ };
16069
+ var wt2 = (e) => {
16070
+ const r = e.split(" ");
16071
+ let s = r.length;
16072
+ for (;s > 0 && !(M2(r[s - 1]) > 0); )
16073
+ s--;
16074
+ return s === r.length ? e : r.slice(0, s).join(" ") + r.slice(s).join("");
16075
+ };
16076
+ var St2 = (e, r, s = {}) => {
16077
+ if (s.trim !== false && e.trim() === "")
16078
+ return "";
16079
+ let i = "", n, o;
16080
+ const u = e.split(" "), l = Ct2(u);
16081
+ let a = [""];
16082
+ for (const [$, c] of u.entries()) {
16083
+ s.trim !== false && (a[a.length - 1] = (a.at(-1) ?? "").trimStart());
16084
+ let m = M2(a.at(-1) ?? "");
16085
+ if ($ !== 0 && (m >= r && (s.wordWrap === false || s.trim === false) && (a.push(""), m = 0), (m > 0 || s.trim === false) && (a[a.length - 1] += " ", m++)), s.hard && l[$] > r) {
16086
+ const f = r - m, F = 1 + Math.floor((l[$] - f - 1) / r);
16087
+ Math.floor((l[$] - 1) / r) < F && a.push(""), Se(a, c, r);
16088
+ continue;
16089
+ }
16090
+ if (m + l[$] > r && m > 0 && l[$] > 0) {
16091
+ if (s.wordWrap === false && m < r) {
16092
+ Se(a, c, r);
16093
+ continue;
16094
+ }
16095
+ a.push("");
16096
+ }
16097
+ if (m + l[$] > r && s.wordWrap === false) {
16098
+ Se(a, c, r);
16099
+ continue;
16100
+ }
16101
+ a[a.length - 1] += c;
16102
+ }
16103
+ s.trim !== false && (a = a.map(($) => wt2($)));
16104
+ const d = a.join(`
16105
+ `), g = d[Symbol.iterator]();
16106
+ let E = g.next(), p = g.next(), y2 = 0;
16107
+ for (;!E.done; ) {
16108
+ const $ = E.value, c = p.value;
16109
+ if (i += $, $ === ae || $ === je) {
16110
+ Ge.lastIndex = y2 + 1;
16111
+ const F = Ge.exec(d)?.groups;
16112
+ if (F?.code !== undefined) {
16113
+ const v = Number.parseFloat(F.code);
16114
+ n = v === Et2 ? undefined : v;
16115
+ } else
16116
+ F?.uri !== undefined && (o = F.uri.length === 0 ? undefined : F.uri);
16117
+ }
16118
+ const m = n ? At2(n) : undefined;
16119
+ c === `
16120
+ ` ? (o && (i += Ue("")), n && m && (i += He(m))) : $ === `
16121
+ ` && (n && m && (i += He(n)), o && (i += Ue(o))), y2 += $.length, E = p, p = g.next();
16122
+ }
16123
+ return i;
16124
+ };
16125
+ function q2(e, r, s) {
16126
+ return String(e).normalize().replaceAll(`\r
16127
+ `, `
16128
+ `).split(`
16129
+ `).map((i) => St2(i, r, s)).join(`
16130
+ `);
16131
+ }
16132
+ var It2 = (e, r, s, i, n) => {
16133
+ let o = r, u = 0;
16134
+ for (let l = s;l < i; l++) {
16135
+ const a = e[l];
16136
+ if (o = o - a.length, u++, o <= n)
16137
+ break;
16138
+ }
16139
+ return { lineCount: o, removals: u };
16140
+ };
16141
+ var J2 = (e) => {
16142
+ const { cursor: r, options: s, style: i } = e, n = e.output ?? process.stdout, o = rt(n), u = e.columnPadding ?? 0, l = e.rowPadding ?? 4, a = o - u, d = nt(n), g = import_picocolors2.default.dim("..."), E = e.maxItems ?? Number.POSITIVE_INFINITY, p = Math.max(d - l, 0), y2 = Math.max(Math.min(E, p), 5);
16143
+ let $ = 0;
16144
+ r >= y2 - 3 && ($ = Math.max(Math.min(r - y2 + 3, s.length - y2), 0));
16145
+ let c = y2 < s.length && $ > 0, m = y2 < s.length && $ + y2 < s.length;
16146
+ const f = Math.min($ + y2, s.length), F = [];
16147
+ let v = 0;
16148
+ c && v++, m && v++;
16149
+ const S2 = $ + (c ? 1 : 0), B = f - (m ? 1 : 0);
16150
+ for (let A = S2;A < B; A++) {
16151
+ const C = q2(i(s[A], A === r), a, { hard: true, trim: false }).split(`
16152
+ `);
16153
+ F.push(C), v += C.length;
16154
+ }
16155
+ if (v > p) {
16156
+ let A = 0, C = 0, _2 = v;
16157
+ const D2 = r - S2, T2 = (W2, I2) => It2(F, _2, W2, I2, p);
16158
+ c ? ({ lineCount: _2, removals: A } = T2(0, D2), _2 > p && ({ lineCount: _2, removals: C } = T2(D2 + 1, F.length))) : ({ lineCount: _2, removals: C } = T2(D2 + 1, F.length), _2 > p && ({ lineCount: _2, removals: A } = T2(0, D2))), A > 0 && (c = true, F.splice(0, A)), C > 0 && (m = true, F.splice(F.length - C, C));
16159
+ }
16160
+ const b = [];
16161
+ c && b.push(g);
16162
+ for (const A of F)
16163
+ for (const C of A)
16164
+ b.push(C);
16165
+ return m && b.push(g), b;
16166
+ };
16167
+ function Ke(e) {
16168
+ return e.label ?? String(e.value ?? "");
16169
+ }
16170
+ function qe(e, r) {
16171
+ if (!e)
16172
+ return true;
16173
+ const s = (r.label ?? String(r.value ?? "")).toLowerCase(), i = (r.hint ?? "").toLowerCase(), n = String(r.value).toLowerCase(), o = e.toLowerCase();
16174
+ return s.includes(o) || i.includes(o) || n.includes(o);
16175
+ }
16176
+ function Bt2(e, r) {
16177
+ const s = [];
16178
+ for (const i of r)
16179
+ e.includes(i.value) && s.push(i);
16180
+ return s;
16181
+ }
16182
+ var Je = (e) => new Vt({ options: e.options, initialValue: e.initialValue ? [e.initialValue] : undefined, initialUserInput: e.initialUserInput, filter: e.filter ?? ((r, s) => qe(r, s)), signal: e.signal, input: e.input, output: e.output, validate: e.validate, render() {
16183
+ const r = [`${import_picocolors2.default.gray(h)}`, `${N2(this.state)} ${e.message}`], s = this.userInput, i = this.options, n = e.placeholder, o = s === "" && n !== undefined;
15824
16184
  switch (this.state) {
15825
- case "error":
15826
- return `${n.trim()}
15827
- ${import_picocolors2.default.yellow(o)} ${i}
15828
- ${import_picocolors2.default.yellow(d2)} ${import_picocolors2.default.yellow(this.error)}
15829
- `;
15830
- case "submit":
15831
- return `${n}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(i)}`;
15832
- case "cancel":
15833
- return `${n}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(i ?? ""))}${i ? `
15834
- ${import_picocolors2.default.gray(o)}` : ""}`;
15835
- default:
15836
- return `${n}${import_picocolors2.default.cyan(o)} ${r}
15837
- ${import_picocolors2.default.cyan(d2)}
15838
- `;
16185
+ case "submit": {
16186
+ const u = Bt2(this.selectedValues, i), l = u.length > 0 ? ` ${import_picocolors2.default.dim(u.map(Ke).join(", "))}` : "";
16187
+ return `${r.join(`
16188
+ `)}
16189
+ ${import_picocolors2.default.gray(h)}${l}`;
16190
+ }
16191
+ case "cancel": {
16192
+ const u = s ? ` ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(s))}` : "";
16193
+ return `${r.join(`
16194
+ `)}
16195
+ ${import_picocolors2.default.gray(h)}${u}`;
16196
+ }
16197
+ default: {
16198
+ const u = `${(this.state === "error" ? import_picocolors2.default.yellow : import_picocolors2.default.cyan)(h)} `, l = (this.state === "error" ? import_picocolors2.default.yellow : import_picocolors2.default.cyan)(x2);
16199
+ let a = "";
16200
+ if (this.isNavigating || o) {
16201
+ const c = o ? n : s;
16202
+ a = c !== "" ? ` ${import_picocolors2.default.dim(c)}` : "";
16203
+ } else
16204
+ a = ` ${this.userInputWithCursor}`;
16205
+ const d = this.filteredOptions.length !== i.length ? import_picocolors2.default.dim(` (${this.filteredOptions.length} match${this.filteredOptions.length === 1 ? "" : "es"})`) : "", g = this.filteredOptions.length === 0 && s ? [`${u}${import_picocolors2.default.yellow("No matches found")}`] : [], E = this.state === "error" ? [`${u}${import_picocolors2.default.yellow(this.error)}`] : [];
16206
+ r.push(`${u.trimEnd()}`, `${u}${import_picocolors2.default.dim("Search:")}${a}${d}`, ...g, ...E);
16207
+ const p = [`${import_picocolors2.default.dim("\u2191/\u2193")} to select`, `${import_picocolors2.default.dim("Enter:")} confirm`, `${import_picocolors2.default.dim("Type:")} to search`], y2 = [`${u}${import_picocolors2.default.dim(p.join(" \u2022 "))}`, `${l}`], $ = this.filteredOptions.length === 0 ? [] : J2({ cursor: this.cursor, options: this.filteredOptions, columnPadding: 3, rowPadding: r.length + y2.length, style: (c, m) => {
16208
+ const f = Ke(c), F = c.hint && c.value === this.focusedValue ? import_picocolors2.default.dim(` (${c.hint})`) : "";
16209
+ return m ? `${import_picocolors2.default.green(Y)} ${f}${F}` : `${import_picocolors2.default.dim(K2)} ${import_picocolors2.default.dim(f)}${F}`;
16210
+ }, maxItems: e.maxItems, output: e.output });
16211
+ return [...r, ...$.map((c) => `${u}${c}`), ...y2].join(`
16212
+ `);
16213
+ }
15839
16214
  }
15840
16215
  } }).prompt();
15841
- var ye = (t) => {
15842
- const n = t.active ?? "Yes", r = t.inactive ?? "No";
15843
- return new dD({ active: n, inactive: r, initialValue: t.initialValue ?? true, render() {
15844
- const i = `${import_picocolors2.default.gray(o)}
15845
- ${b2(this.state)} ${t.message}
15846
- `, s = this.value ? n : r;
16216
+ var bt2 = (e) => {
16217
+ const r = (i, n, o, u) => {
16218
+ const l = o.includes(i.value), a = i.label ?? String(i.value ?? ""), d = i.hint && u !== undefined && i.value === u ? import_picocolors2.default.dim(` (${i.hint})`) : "", g = l ? import_picocolors2.default.green(G2) : import_picocolors2.default.dim(z22);
16219
+ return n ? `${g} ${a}${d}` : `${g} ${import_picocolors2.default.dim(a)}`;
16220
+ }, s = new Vt({ options: e.options, multiple: true, filter: e.filter ?? ((i, n) => qe(i, n)), validate: () => {
16221
+ if (e.required && s.selectedValues.length === 0)
16222
+ return "Please select at least one item";
16223
+ }, initialValue: e.initialValues, signal: e.signal, input: e.input, output: e.output, render() {
16224
+ const i = `${import_picocolors2.default.gray(h)}
16225
+ ${N2(this.state)} ${e.message}
16226
+ `, n = this.userInput, o = e.placeholder, u = n === "" && o !== undefined, l = this.isNavigating || u ? import_picocolors2.default.dim(u ? o : n) : this.userInputWithCursor, a = this.options, d = this.filteredOptions.length !== a.length ? import_picocolors2.default.dim(` (${this.filteredOptions.length} match${this.filteredOptions.length === 1 ? "" : "es"})`) : "";
15847
16227
  switch (this.state) {
15848
16228
  case "submit":
15849
- return `${i}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(s)}`;
16229
+ return `${i}${import_picocolors2.default.gray(h)} ${import_picocolors2.default.dim(`${this.selectedValues.length} items selected`)}`;
15850
16230
  case "cancel":
15851
- return `${i}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(s))}
15852
- ${import_picocolors2.default.gray(o)}`;
15853
- default:
15854
- return `${i}${import_picocolors2.default.cyan(o)} ${this.value ? `${import_picocolors2.default.green(k2)} ${n}` : `${import_picocolors2.default.dim(P2)} ${import_picocolors2.default.dim(n)}`} ${import_picocolors2.default.dim("/")} ${this.value ? `${import_picocolors2.default.dim(P2)} ${import_picocolors2.default.dim(r)}` : `${import_picocolors2.default.green(k2)} ${r}`}
15855
- ${import_picocolors2.default.cyan(d2)}
15856
- `;
16231
+ return `${i}${import_picocolors2.default.gray(h)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(n))}`;
16232
+ default: {
16233
+ const g = this.state === "error" ? import_picocolors2.default.yellow : import_picocolors2.default.cyan, E = [`${import_picocolors2.default.dim("\u2191/\u2193")} to navigate`, `${import_picocolors2.default.dim(this.isNavigating ? "Space/Tab:" : "Tab:")} select`, `${import_picocolors2.default.dim("Enter:")} confirm`, `${import_picocolors2.default.dim("Type:")} to search`], p = this.filteredOptions.length === 0 && n ? [`${g(h)} ${import_picocolors2.default.yellow("No matches found")}`] : [], y2 = this.state === "error" ? [`${g(h)} ${import_picocolors2.default.yellow(this.error)}`] : [], $ = [...`${i}${g(h)}`.split(`
16234
+ `), `${g(h)} ${import_picocolors2.default.dim("Search:")} ${l}${d}`, ...p, ...y2], c = [`${g(h)} ${import_picocolors2.default.dim(E.join(" \u2022 "))}`, `${g(x2)}`], m = J2({ cursor: this.cursor, options: this.filteredOptions, style: (f, F) => r(f, F, this.selectedValues, this.focusedValue), maxItems: e.maxItems, output: e.output, rowPadding: $.length + c.length });
16235
+ return [...$, ...m.map((f) => `${g(h)} ${f}`), ...c].join(`
16236
+ `);
16237
+ }
15857
16238
  }
15858
- } }).prompt();
16239
+ } });
16240
+ return s.prompt();
15859
16241
  };
15860
- var ve = (t) => {
15861
- const n = (r, i) => {
15862
- const s = r.label ?? String(r.value);
15863
- switch (i) {
15864
- case "selected":
15865
- return `${import_picocolors2.default.dim(s)}`;
15866
- case "active":
15867
- return `${import_picocolors2.default.green(k2)} ${s} ${r.hint ? import_picocolors2.default.dim(`(${r.hint})`) : ""}`;
15868
- case "cancelled":
15869
- return `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(s))}`;
15870
- default:
15871
- return `${import_picocolors2.default.dim(P2)} ${import_picocolors2.default.dim(s)}`;
16242
+ var xt2 = [We, he, pe, me];
16243
+ var _t2 = [$e, Re, x2, Oe];
16244
+ function Xe(e, r, s, i) {
16245
+ let n = s, o = s;
16246
+ return i === "center" ? n = Math.floor((r - e) / 2) : i === "right" && (n = r - e - s), o = r - n - e, [n, o];
16247
+ }
16248
+ var Dt2 = (e) => e;
16249
+ var Tt2 = (e = "", r = "", s) => {
16250
+ const i = s?.output ?? process.stdout, n = rt(i), o = 2, u = s?.titlePadding ?? 1, l = s?.contentPadding ?? 2, a = s?.width === undefined || s.width === "auto" ? 1 : Math.min(1, s.width), d = (s?.withGuide ?? _.withGuide) !== false ? `${h} ` : "", g = s?.formatBorder ?? Dt2, E = ((s?.rounded) ? xt2 : _t2).map(g), p = g(se), y2 = g(h), $ = M2(d), c = M2(r), m = n - $;
16251
+ let f = Math.floor(n * a) - $;
16252
+ if (s?.width === "auto") {
16253
+ const _2 = e.split(`
16254
+ `);
16255
+ let D2 = c + u * 2;
16256
+ for (const W2 of _2) {
16257
+ const I2 = M2(W2) + l * 2;
16258
+ I2 > D2 && (D2 = I2);
15872
16259
  }
15873
- };
15874
- return new LD({ options: t.options, initialValue: t.initialValue, render() {
15875
- const r = `${import_picocolors2.default.gray(o)}
15876
- ${b2(this.state)} ${t.message}
15877
- `;
16260
+ const T2 = D2 + o;
16261
+ T2 < f && (f = T2);
16262
+ }
16263
+ f % 2 !== 0 && (f < m ? f++ : f--);
16264
+ const F = f - o, v = F - u * 2, S2 = c > v ? `${r.slice(0, v - 3)}...` : r, [B, b] = Xe(M2(S2), F, u, s?.titleAlign), A = q2(e, F - l * 2, { hard: true, trim: false });
16265
+ i.write(`${d}${E[0]}${p.repeat(B)}${S2}${p.repeat(b)}${E[1]}
16266
+ `);
16267
+ const C = A.split(`
16268
+ `);
16269
+ for (const _2 of C) {
16270
+ const [D2, T2] = Xe(M2(_2), F, l, s?.contentAlign);
16271
+ i.write(`${d}${y2}${" ".repeat(D2)}${_2}${" ".repeat(T2)}${y2}
16272
+ `);
16273
+ }
16274
+ i.write(`${d}${E[2]}${p.repeat(F)}${E[3]}
16275
+ `);
16276
+ };
16277
+ var Mt2 = (e) => {
16278
+ const r = e.active ?? "Yes", s = e.inactive ?? "No";
16279
+ return new kt({ active: r, inactive: s, signal: e.signal, input: e.input, output: e.output, initialValue: e.initialValue ?? true, render() {
16280
+ const i = `${import_picocolors2.default.gray(h)}
16281
+ ${N2(this.state)} ${e.message}
16282
+ `, n = this.value ? r : s;
15878
16283
  switch (this.state) {
15879
16284
  case "submit":
15880
- return `${r}${import_picocolors2.default.gray(o)} ${n(this.options[this.cursor], "selected")}`;
16285
+ return `${i}${import_picocolors2.default.gray(h)} ${import_picocolors2.default.dim(n)}`;
15881
16286
  case "cancel":
15882
- return `${r}${import_picocolors2.default.gray(o)} ${n(this.options[this.cursor], "cancelled")}
15883
- ${import_picocolors2.default.gray(o)}`;
16287
+ return `${i}${import_picocolors2.default.gray(h)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(n))}
16288
+ ${import_picocolors2.default.gray(h)}`;
15884
16289
  default:
15885
- return `${r}${import_picocolors2.default.cyan(o)} ${G2({ cursor: this.cursor, options: this.options, maxItems: t.maxItems, style: (i, s) => n(i, s ? "active" : "inactive") }).join(`
15886
- ${import_picocolors2.default.cyan(o)} `)}
15887
- ${import_picocolors2.default.cyan(d2)}
16290
+ return `${i}${import_picocolors2.default.cyan(h)} ${this.value ? `${import_picocolors2.default.green(Y)} ${r}` : `${import_picocolors2.default.dim(K2)} ${import_picocolors2.default.dim(r)}`} ${import_picocolors2.default.dim("/")} ${this.value ? `${import_picocolors2.default.dim(K2)} ${import_picocolors2.default.dim(s)}` : `${import_picocolors2.default.green(Y)} ${s}`}
16291
+ ${import_picocolors2.default.cyan(x2)}
15888
16292
  `;
15889
16293
  }
15890
16294
  } }).prompt();
15891
16295
  };
15892
- var we = (t) => {
15893
- const n = (r, i = "inactive") => {
15894
- const s = r.label ?? String(r.value);
15895
- return i === "selected" ? `${import_picocolors2.default.dim(s)}` : i === "cancelled" ? `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(s))}` : i === "active" ? `${import_picocolors2.default.bgCyan(import_picocolors2.default.gray(` ${r.value} `))} ${s} ${r.hint ? import_picocolors2.default.dim(`(${r.hint})`) : ""}` : `${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(` ${r.value} `)))} ${s} ${r.hint ? import_picocolors2.default.dim(`(${r.hint})`) : ""}`;
15896
- };
15897
- return new ID({ options: t.options, initialValue: t.initialValue, render() {
15898
- const r = `${import_picocolors2.default.gray(o)}
15899
- ${b2(this.state)} ${t.message}
15900
- `;
15901
- switch (this.state) {
15902
- case "submit":
15903
- return `${r}${import_picocolors2.default.gray(o)} ${n(this.options.find((i) => i.value === this.value) ?? t.options[0], "selected")}`;
15904
- case "cancel":
15905
- return `${r}${import_picocolors2.default.gray(o)} ${n(this.options[0], "cancelled")}
15906
- ${import_picocolors2.default.gray(o)}`;
15907
- default:
15908
- return `${r}${import_picocolors2.default.cyan(o)} ${this.options.map((i, s) => n(i, s === this.cursor ? "active" : "inactive")).join(`
15909
- ${import_picocolors2.default.cyan(o)} `)}
15910
- ${import_picocolors2.default.cyan(d2)}
15911
- `;
16296
+ var Rt = async (e, r) => {
16297
+ const s = {}, i = Object.keys(e);
16298
+ for (const n of i) {
16299
+ const o = e[n], u = await o({ results: s })?.catch((l) => {
16300
+ throw l;
16301
+ });
16302
+ if (typeof r?.onCancel == "function" && Ct(u)) {
16303
+ s[n] = "canceled", r.onCancel({ results: s });
16304
+ continue;
15912
16305
  }
15913
- } }).prompt();
16306
+ s[n] = u;
16307
+ }
16308
+ return s;
15914
16309
  };
15915
- var fe = (t) => {
15916
- const n = (r, i) => {
15917
- const s = r.label ?? String(r.value);
15918
- return i === "active" ? `${import_picocolors2.default.cyan(A2)} ${s} ${r.hint ? import_picocolors2.default.dim(`(${r.hint})`) : ""}` : i === "selected" ? `${import_picocolors2.default.green(T2)} ${import_picocolors2.default.dim(s)} ${r.hint ? import_picocolors2.default.dim(`(${r.hint})`) : ""}` : i === "cancelled" ? `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(s))}` : i === "active-selected" ? `${import_picocolors2.default.green(T2)} ${s} ${r.hint ? import_picocolors2.default.dim(`(${r.hint})`) : ""}` : i === "submitted" ? `${import_picocolors2.default.dim(s)}` : `${import_picocolors2.default.dim(F)} ${import_picocolors2.default.dim(s)}`;
15919
- };
15920
- return new SD({ options: t.options, initialValues: t.initialValues, required: t.required ?? true, cursorAt: t.cursorAt, validate(r) {
15921
- if (this.required && r.length === 0)
16310
+ var Ot = (e) => {
16311
+ const { selectableGroups: r = true, groupSpacing: s = 0 } = e, i = (o, u, l = []) => {
16312
+ const a = o.label ?? String(o.value), d = typeof o.group == "string", g = d && (l[l.indexOf(o) + 1] ?? { group: true }), E = d && g && g.group === true, p = d ? r ? `${E ? x2 : h} ` : " " : "";
16313
+ let y2 = "";
16314
+ if (s > 0 && !d) {
16315
+ const c = `
16316
+ ${import_picocolors2.default.cyan(h)}`;
16317
+ y2 = `${c.repeat(s - 1)}${c} `;
16318
+ }
16319
+ if (u === "active")
16320
+ return `${y2}${import_picocolors2.default.dim(p)}${import_picocolors2.default.cyan(te)} ${a}${o.hint ? ` ${import_picocolors2.default.dim(`(${o.hint})`)}` : ""}`;
16321
+ if (u === "group-active")
16322
+ return `${y2}${p}${import_picocolors2.default.cyan(te)} ${import_picocolors2.default.dim(a)}`;
16323
+ if (u === "group-active-selected")
16324
+ return `${y2}${p}${import_picocolors2.default.green(G2)} ${import_picocolors2.default.dim(a)}`;
16325
+ if (u === "selected") {
16326
+ const c = d || r ? import_picocolors2.default.green(G2) : "";
16327
+ return `${y2}${import_picocolors2.default.dim(p)}${c} ${import_picocolors2.default.dim(a)}${o.hint ? ` ${import_picocolors2.default.dim(`(${o.hint})`)}` : ""}`;
16328
+ }
16329
+ if (u === "cancelled")
16330
+ return `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(a))}`;
16331
+ if (u === "active-selected")
16332
+ return `${y2}${import_picocolors2.default.dim(p)}${import_picocolors2.default.green(G2)} ${a}${o.hint ? ` ${import_picocolors2.default.dim(`(${o.hint})`)}` : ""}`;
16333
+ if (u === "submitted")
16334
+ return `${import_picocolors2.default.dim(a)}`;
16335
+ const $ = d || r ? import_picocolors2.default.dim(z22) : "";
16336
+ return `${y2}${import_picocolors2.default.dim(p)}${$} ${import_picocolors2.default.dim(a)}`;
16337
+ }, n = e.required ?? true;
16338
+ return new yt({ options: e.options, signal: e.signal, input: e.input, output: e.output, initialValues: e.initialValues, required: n, cursorAt: e.cursorAt, selectableGroups: r, validate(o) {
16339
+ if (n && (o === undefined || o.length === 0))
15922
16340
  return `Please select at least one option.
15923
16341
  ${import_picocolors2.default.reset(import_picocolors2.default.dim(`Press ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" space ")))} to select, ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" enter ")))} to submit`))}`;
15924
16342
  }, render() {
15925
- const r = `${import_picocolors2.default.gray(o)}
15926
- ${b2(this.state)} ${t.message}
15927
- `, i = (s, c) => {
15928
- const a = this.value.includes(s.value);
15929
- return c && a ? n(s, "active-selected") : a ? n(s, "selected") : n(s, c ? "active" : "inactive");
15930
- };
16343
+ const o = `${import_picocolors2.default.gray(h)}
16344
+ ${N2(this.state)} ${e.message}
16345
+ `, u = this.value ?? [];
15931
16346
  switch (this.state) {
15932
- case "submit":
15933
- return `${r}${import_picocolors2.default.gray(o)} ${this.options.filter(({ value: s }) => this.value.includes(s)).map((s) => n(s, "submitted")).join(import_picocolors2.default.dim(", ")) || import_picocolors2.default.dim("none")}`;
16347
+ case "submit": {
16348
+ const l = this.options.filter(({ value: d }) => u.includes(d)).map((d) => i(d, "submitted")), a = l.length === 0 ? "" : ` ${l.join(import_picocolors2.default.dim(", "))}`;
16349
+ return `${o}${import_picocolors2.default.gray(h)}${a}`;
16350
+ }
15934
16351
  case "cancel": {
15935
- const s = this.options.filter(({ value: c }) => this.value.includes(c)).map((c) => n(c, "cancelled")).join(import_picocolors2.default.dim(", "));
15936
- return `${r}${import_picocolors2.default.gray(o)} ${s.trim() ? `${s}
15937
- ${import_picocolors2.default.gray(o)}` : ""}`;
16352
+ const l = this.options.filter(({ value: a }) => u.includes(a)).map((a) => i(a, "cancelled")).join(import_picocolors2.default.dim(", "));
16353
+ return `${o}${import_picocolors2.default.gray(h)} ${l.trim() ? `${l}
16354
+ ${import_picocolors2.default.gray(h)}` : ""}`;
15938
16355
  }
15939
16356
  case "error": {
15940
- const s = this.error.split(`
15941
- `).map((c, a) => a === 0 ? `${import_picocolors2.default.yellow(d2)} ${import_picocolors2.default.yellow(c)}` : ` ${c}`).join(`
16357
+ const l = this.error.split(`
16358
+ `).map((a, d) => d === 0 ? `${import_picocolors2.default.yellow(x2)} ${import_picocolors2.default.yellow(a)}` : ` ${a}`).join(`
15942
16359
  `);
15943
- return `${r + import_picocolors2.default.yellow(o)} ${G2({ options: this.options, cursor: this.cursor, maxItems: t.maxItems, style: i }).join(`
15944
- ${import_picocolors2.default.yellow(o)} `)}
15945
- ${s}
16360
+ return `${o}${import_picocolors2.default.yellow(h)} ${this.options.map((a, d, g) => {
16361
+ const E = u.includes(a.value) || a.group === true && this.isGroupSelected(`${a.value}`), p = d === this.cursor;
16362
+ return !p && typeof a.group == "string" && this.options[this.cursor].value === a.group ? i(a, E ? "group-active-selected" : "group-active", g) : p && E ? i(a, "active-selected", g) : E ? i(a, "selected", g) : i(a, p ? "active" : "inactive", g);
16363
+ }).join(`
16364
+ ${import_picocolors2.default.yellow(h)} `)}
16365
+ ${l}
15946
16366
  `;
15947
16367
  }
15948
- default:
15949
- return `${r}${import_picocolors2.default.cyan(o)} ${G2({ options: this.options, cursor: this.cursor, maxItems: t.maxItems, style: i }).join(`
15950
- ${import_picocolors2.default.cyan(o)} `)}
15951
- ${import_picocolors2.default.cyan(d2)}
16368
+ default: {
16369
+ const l = this.options.map((d, g, E) => {
16370
+ const p = u.includes(d.value) || d.group === true && this.isGroupSelected(`${d.value}`), y2 = g === this.cursor, $ = !y2 && typeof d.group == "string" && this.options[this.cursor].value === d.group;
16371
+ let c = "";
16372
+ return $ ? c = i(d, p ? "group-active-selected" : "group-active", E) : y2 && p ? c = i(d, "active-selected", E) : p ? c = i(d, "selected", E) : c = i(d, y2 ? "active" : "inactive", E), `${g !== 0 && !c.startsWith(`
16373
+ `) ? " " : ""}${c}`;
16374
+ }).join(`
16375
+ ${import_picocolors2.default.cyan(h)}`), a = l.startsWith(`
16376
+ `) ? "" : " ";
16377
+ return `${o}${import_picocolors2.default.cyan(h)}${a}${l}
16378
+ ${import_picocolors2.default.cyan(x2)}
15952
16379
  `;
16380
+ }
15953
16381
  }
15954
16382
  } }).prompt();
15955
16383
  };
15956
- var be = (t) => {
15957
- const { selectableGroups: n = true } = t, r = (i, s, c = []) => {
15958
- const a = i.label ?? String(i.value), l2 = typeof i.group == "string", $2 = l2 && (c[c.indexOf(i) + 1] ?? { group: true }), g2 = l2 && $2.group === true, p2 = l2 ? n ? `${g2 ? d2 : o} ` : " " : "";
15959
- if (s === "active")
15960
- return `${import_picocolors2.default.dim(p2)}${import_picocolors2.default.cyan(A2)} ${a} ${i.hint ? import_picocolors2.default.dim(`(${i.hint})`) : ""}`;
15961
- if (s === "group-active")
15962
- return `${p2}${import_picocolors2.default.cyan(A2)} ${import_picocolors2.default.dim(a)}`;
15963
- if (s === "group-active-selected")
15964
- return `${p2}${import_picocolors2.default.green(T2)} ${import_picocolors2.default.dim(a)}`;
15965
- if (s === "selected") {
15966
- const f = l2 || n ? import_picocolors2.default.green(T2) : "";
15967
- return `${import_picocolors2.default.dim(p2)}${f} ${import_picocolors2.default.dim(a)} ${i.hint ? import_picocolors2.default.dim(`(${i.hint})`) : ""}`;
15968
- }
15969
- if (s === "cancelled")
15970
- return `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(a))}`;
15971
- if (s === "active-selected")
15972
- return `${import_picocolors2.default.dim(p2)}${import_picocolors2.default.green(T2)} ${a} ${i.hint ? import_picocolors2.default.dim(`(${i.hint})`) : ""}`;
15973
- if (s === "submitted")
15974
- return `${import_picocolors2.default.dim(a)}`;
15975
- const v2 = l2 || n ? import_picocolors2.default.dim(F) : "";
15976
- return `${import_picocolors2.default.dim(p2)}${v2} ${import_picocolors2.default.dim(a)}`;
15977
- };
15978
- return new _D({ options: t.options, initialValues: t.initialValues, required: t.required ?? true, cursorAt: t.cursorAt, selectableGroups: n, validate(i) {
15979
- if (this.required && i.length === 0)
16384
+ var R2 = { message: (e = [], { symbol: r = import_picocolors2.default.gray(h), secondarySymbol: s = import_picocolors2.default.gray(h), output: i = process.stdout, spacing: n = 1, withGuide: o } = {}) => {
16385
+ const u = [], l = (o ?? _.withGuide) !== false, a = l ? s : "", d = l ? `${r} ` : "", g = l ? `${s} ` : "";
16386
+ for (let p = 0;p < n; p++)
16387
+ u.push(a);
16388
+ const E = Array.isArray(e) ? e : e.split(`
16389
+ `);
16390
+ if (E.length > 0) {
16391
+ const [p, ...y2] = E;
16392
+ p.length > 0 ? u.push(`${d}${p}`) : u.push(l ? r : "");
16393
+ for (const $ of y2)
16394
+ $.length > 0 ? u.push(`${g}${$}`) : u.push(l ? s : "");
16395
+ }
16396
+ i.write(`${u.join(`
16397
+ `)}
16398
+ `);
16399
+ }, info: (e, r) => {
16400
+ R2.message(e, { ...r, symbol: import_picocolors2.default.blue(ge) });
16401
+ }, success: (e, r) => {
16402
+ R2.message(e, { ...r, symbol: import_picocolors2.default.green(fe) });
16403
+ }, step: (e, r) => {
16404
+ R2.message(e, { ...r, symbol: import_picocolors2.default.green(k2) });
16405
+ }, warn: (e, r) => {
16406
+ R2.message(e, { ...r, symbol: import_picocolors2.default.yellow(Fe) });
16407
+ }, warning: (e, r) => {
16408
+ R2.warn(e, r);
16409
+ }, error: (e, r) => {
16410
+ R2.message(e, { ...r, symbol: import_picocolors2.default.red(ye) });
16411
+ } };
16412
+ var Pt = (e = "", r) => {
16413
+ (r?.output ?? process.stdout).write(`${import_picocolors2.default.gray(x2)} ${import_picocolors2.default.red(e)}
16414
+
16415
+ `);
16416
+ };
16417
+ var Nt = (e = "", r) => {
16418
+ (r?.output ?? process.stdout).write(`${import_picocolors2.default.gray($e)} ${e}
16419
+ `);
16420
+ };
16421
+ var Wt2 = (e = "", r) => {
16422
+ (r?.output ?? process.stdout).write(`${import_picocolors2.default.gray(h)}
16423
+ ${import_picocolors2.default.gray(x2)} ${e}
16424
+
16425
+ `);
16426
+ };
16427
+ var Q2 = (e, r) => e.split(`
16428
+ `).map((s) => r(s)).join(`
16429
+ `);
16430
+ var Lt2 = (e) => {
16431
+ const r = (i, n) => {
16432
+ const o = i.label ?? String(i.value);
16433
+ return n === "disabled" ? `${import_picocolors2.default.gray(z22)} ${Q2(o, (u) => import_picocolors2.default.strikethrough(import_picocolors2.default.gray(u)))}${i.hint ? ` ${import_picocolors2.default.dim(`(${i.hint ?? "disabled"})`)}` : ""}` : n === "active" ? `${import_picocolors2.default.cyan(te)} ${o}${i.hint ? ` ${import_picocolors2.default.dim(`(${i.hint})`)}` : ""}` : n === "selected" ? `${import_picocolors2.default.green(G2)} ${Q2(o, import_picocolors2.default.dim)}${i.hint ? ` ${import_picocolors2.default.dim(`(${i.hint})`)}` : ""}` : n === "cancelled" ? `${Q2(o, (u) => import_picocolors2.default.strikethrough(import_picocolors2.default.dim(u)))}` : n === "active-selected" ? `${import_picocolors2.default.green(G2)} ${o}${i.hint ? ` ${import_picocolors2.default.dim(`(${i.hint})`)}` : ""}` : n === "submitted" ? `${Q2(o, import_picocolors2.default.dim)}` : `${import_picocolors2.default.dim(z22)} ${Q2(o, import_picocolors2.default.dim)}`;
16434
+ }, s = e.required ?? true;
16435
+ return new Mt({ options: e.options, signal: e.signal, input: e.input, output: e.output, initialValues: e.initialValues, required: s, cursorAt: e.cursorAt, validate(i) {
16436
+ if (s && (i === undefined || i.length === 0))
15980
16437
  return `Please select at least one option.
15981
16438
  ${import_picocolors2.default.reset(import_picocolors2.default.dim(`Press ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" space ")))} to select, ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" enter ")))} to submit`))}`;
15982
16439
  }, render() {
15983
- const i = `${import_picocolors2.default.gray(o)}
15984
- ${b2(this.state)} ${t.message}
15985
- `;
16440
+ const i = Bt(e.output, e.message, `${Ee(this.state)} `, `${N2(this.state)} `), n = `${import_picocolors2.default.gray(h)}
16441
+ ${i}
16442
+ `, o = this.value ?? [], u = (l, a) => {
16443
+ if (l.disabled)
16444
+ return r(l, "disabled");
16445
+ const d = o.includes(l.value);
16446
+ return a && d ? r(l, "active-selected") : d ? r(l, "selected") : r(l, a ? "active" : "inactive");
16447
+ };
15986
16448
  switch (this.state) {
15987
- case "submit":
15988
- return `${i}${import_picocolors2.default.gray(o)} ${this.options.filter(({ value: s }) => this.value.includes(s)).map((s) => r(s, "submitted")).join(import_picocolors2.default.dim(", "))}`;
16449
+ case "submit": {
16450
+ const l = this.options.filter(({ value: d }) => o.includes(d)).map((d) => r(d, "submitted")).join(import_picocolors2.default.dim(", ")) || import_picocolors2.default.dim("none"), a = Bt(e.output, l, `${import_picocolors2.default.gray(h)} `);
16451
+ return `${n}${a}`;
16452
+ }
15989
16453
  case "cancel": {
15990
- const s = this.options.filter(({ value: c }) => this.value.includes(c)).map((c) => r(c, "cancelled")).join(import_picocolors2.default.dim(", "));
15991
- return `${i}${import_picocolors2.default.gray(o)} ${s.trim() ? `${s}
15992
- ${import_picocolors2.default.gray(o)}` : ""}`;
16454
+ const l = this.options.filter(({ value: d }) => o.includes(d)).map((d) => r(d, "cancelled")).join(import_picocolors2.default.dim(", "));
16455
+ if (l.trim() === "")
16456
+ return `${n}${import_picocolors2.default.gray(h)}`;
16457
+ const a = Bt(e.output, l, `${import_picocolors2.default.gray(h)} `);
16458
+ return `${n}${a}
16459
+ ${import_picocolors2.default.gray(h)}`;
15993
16460
  }
15994
16461
  case "error": {
15995
- const s = this.error.split(`
15996
- `).map((c, a) => a === 0 ? `${import_picocolors2.default.yellow(d2)} ${import_picocolors2.default.yellow(c)}` : ` ${c}`).join(`
15997
- `);
15998
- return `${i}${import_picocolors2.default.yellow(o)} ${this.options.map((c, a, l2) => {
15999
- const $2 = this.value.includes(c.value) || c.group === true && this.isGroupSelected(`${c.value}`), g2 = a === this.cursor;
16000
- return !g2 && typeof c.group == "string" && this.options[this.cursor].value === c.group ? r(c, $2 ? "group-active-selected" : "group-active", l2) : g2 && $2 ? r(c, "active-selected", l2) : $2 ? r(c, "selected", l2) : r(c, g2 ? "active" : "inactive", l2);
16001
- }).join(`
16002
- ${import_picocolors2.default.yellow(o)} `)}
16003
- ${s}
16462
+ const l = `${import_picocolors2.default.yellow(h)} `, a = this.error.split(`
16463
+ `).map((E, p) => p === 0 ? `${import_picocolors2.default.yellow(x2)} ${import_picocolors2.default.yellow(E)}` : ` ${E}`).join(`
16464
+ `), d = n.split(`
16465
+ `).length, g = a.split(`
16466
+ `).length + 1;
16467
+ return `${n}${l}${J2({ output: e.output, options: this.options, cursor: this.cursor, maxItems: e.maxItems, columnPadding: l.length, rowPadding: d + g, style: u }).join(`
16468
+ ${l}`)}
16469
+ ${a}
16004
16470
  `;
16005
16471
  }
16006
- default:
16007
- return `${i}${import_picocolors2.default.cyan(o)} ${this.options.map((s, c, a) => {
16008
- const l2 = this.value.includes(s.value) || s.group === true && this.isGroupSelected(`${s.value}`), $2 = c === this.cursor;
16009
- return !$2 && typeof s.group == "string" && this.options[this.cursor].value === s.group ? r(s, l2 ? "group-active-selected" : "group-active", a) : $2 && l2 ? r(s, "active-selected", a) : l2 ? r(s, "selected", a) : r(s, $2 ? "active" : "inactive", a);
16010
- }).join(`
16011
- ${import_picocolors2.default.cyan(o)} `)}
16012
- ${import_picocolors2.default.cyan(d2)}
16472
+ default: {
16473
+ const l = `${import_picocolors2.default.cyan(h)} `, a = n.split(`
16474
+ `).length;
16475
+ return `${n}${l}${J2({ output: e.output, options: this.options, cursor: this.cursor, maxItems: e.maxItems, columnPadding: l.length, rowPadding: a + 2, style: u }).join(`
16476
+ ${l}`)}
16477
+ ${import_picocolors2.default.cyan(x2)}
16013
16478
  `;
16479
+ }
16014
16480
  }
16015
16481
  } }).prompt();
16016
16482
  };
16017
- var Me = (t = "", n = "") => {
16018
- const r = `
16019
- ${t}
16020
- `.split(`
16021
- `), i = S2(n).length, s = Math.max(r.reduce((a, l2) => {
16022
- const $2 = S2(l2);
16023
- return $2.length > a ? $2.length : a;
16024
- }, 0), i) + 2, c = r.map((a) => `${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(a)}${" ".repeat(s - S2(a).length)}${import_picocolors2.default.gray(o)}`).join(`
16025
- `);
16026
- process.stdout.write(`${import_picocolors2.default.gray(o)}
16027
- ${import_picocolors2.default.green(C2)} ${import_picocolors2.default.reset(n)} ${import_picocolors2.default.gray(_2.repeat(Math.max(s - i - 1, 1)) + me)}
16028
- ${c}
16029
- ${import_picocolors2.default.gray(de + _2.repeat(s + 2) + pe)}
16030
- `);
16483
+ var jt = (e) => import_picocolors2.default.dim(e);
16484
+ var Vt2 = (e, r, s) => {
16485
+ const i = { hard: true, trim: false }, n = q2(e, r, i).split(`
16486
+ `), o = n.reduce((a, d) => Math.max(M2(d), a), 0), u = n.map(s).reduce((a, d) => Math.max(M2(d), a), 0), l = r - (u - o);
16487
+ return q2(e, l, i);
16031
16488
  };
16032
- var xe = (t = "") => {
16033
- process.stdout.write(`${import_picocolors2.default.gray(d2)} ${import_picocolors2.default.red(t)}
16034
-
16489
+ var kt2 = (e = "", r = "", s) => {
16490
+ const i = s?.output ?? P2.stdout, n = (s?.withGuide ?? _.withGuide) !== false, o = s?.format ?? jt, u = ["", ...Vt2(e, rt(i) - 6, o).split(`
16491
+ `).map(o), ""], l = M2(r), a = Math.max(u.reduce((p, y2) => {
16492
+ const $ = M2(y2);
16493
+ return $ > p ? $ : p;
16494
+ }, 0), l) + 2, d = u.map((p) => `${import_picocolors2.default.gray(h)} ${p}${" ".repeat(a - M2(p))}${import_picocolors2.default.gray(h)}`).join(`
16495
+ `), g = n ? `${import_picocolors2.default.gray(h)}
16496
+ ` : "", E = n ? Ne : pe;
16497
+ i.write(`${g}${import_picocolors2.default.green(k2)} ${import_picocolors2.default.reset(r)} ${import_picocolors2.default.gray(se.repeat(Math.max(a - l - 1, 1)) + he)}
16498
+ ${d}
16499
+ ${import_picocolors2.default.gray(E + se.repeat(a + 2) + me)}
16035
16500
  `);
16036
16501
  };
16037
- var Ie = (t = "") => {
16038
- process.stdout.write(`${import_picocolors2.default.gray(ue)} ${t}
16039
- `);
16502
+ var Gt = (e) => new Lt({ validate: e.validate, mask: e.mask ?? Pe, signal: e.signal, input: e.input, output: e.output, render() {
16503
+ const r = `${import_picocolors2.default.gray(h)}
16504
+ ${N2(this.state)} ${e.message}
16505
+ `, s = this.userInputWithCursor, i = this.masked;
16506
+ switch (this.state) {
16507
+ case "error": {
16508
+ const n = i ? ` ${i}` : "";
16509
+ return e.clearOnError && this.clear(), `${r.trim()}
16510
+ ${import_picocolors2.default.yellow(h)}${n}
16511
+ ${import_picocolors2.default.yellow(x2)} ${import_picocolors2.default.yellow(this.error)}
16512
+ `;
16513
+ }
16514
+ case "submit": {
16515
+ const n = i ? ` ${import_picocolors2.default.dim(i)}` : "";
16516
+ return `${r}${import_picocolors2.default.gray(h)}${n}`;
16517
+ }
16518
+ case "cancel": {
16519
+ const n = i ? ` ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(i))}` : "";
16520
+ return `${r}${import_picocolors2.default.gray(h)}${n}${i ? `
16521
+ ${import_picocolors2.default.gray(h)}` : ""}`;
16522
+ }
16523
+ default:
16524
+ return `${r}${import_picocolors2.default.cyan(h)} ${s}
16525
+ ${import_picocolors2.default.cyan(x2)}
16526
+ `;
16527
+ }
16528
+ } }).prompt();
16529
+ var Ht = (e) => {
16530
+ const r = e.validate;
16531
+ return Je({ ...e, initialUserInput: e.initialValue ?? e.root ?? process.cwd(), maxItems: 5, validate(s) {
16532
+ if (!Array.isArray(s)) {
16533
+ if (!s)
16534
+ return "Please select a path";
16535
+ if (r)
16536
+ return r(s);
16537
+ }
16538
+ }, options() {
16539
+ const s = this.userInput;
16540
+ if (s === "")
16541
+ return [];
16542
+ try {
16543
+ let i;
16544
+ return dt2(s) ? be(s).isDirectory() ? i = s : i = xe(s) : i = xe(s), ct2(i).map((n) => {
16545
+ const o = $t2(i, n), u = be(o);
16546
+ return { name: n, path: o, isDirectory: u.isDirectory() };
16547
+ }).filter(({ path: n, isDirectory: o }) => n.startsWith(s) && (e.directory || !o)).map((n) => ({ value: n.path }));
16548
+ } catch {
16549
+ return [];
16550
+ }
16551
+ } });
16040
16552
  };
16041
- var Se = (t = "") => {
16042
- process.stdout.write(`${import_picocolors2.default.gray(o)}
16043
- ${import_picocolors2.default.gray(d2)} ${t}
16044
-
16553
+ var Ut = import_picocolors2.default.magenta;
16554
+ var Ie = ({ indicator: e = "dots", onCancel: r, output: s = process.stdout, cancelMessage: i, errorMessage: n, frames: o = ee ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"], delay: u = ee ? 80 : 120, signal: l, ...a } = {}) => {
16555
+ const d = ue();
16556
+ let g, E, p = false, y2 = false, $ = "", c, m = performance.now();
16557
+ const f = rt(s), F = a?.styleFrame ?? Ut, v = (I2) => {
16558
+ const O2 = I2 > 1 ? n ?? _.messages.error : i ?? _.messages.cancel;
16559
+ y2 = I2 === 1, p && (W2(O2, I2), y2 && typeof r == "function" && r());
16560
+ }, S2 = () => v(2), B = () => v(1), b = () => {
16561
+ process.on("uncaughtExceptionMonitor", S2), process.on("unhandledRejection", S2), process.on("SIGINT", B), process.on("SIGTERM", B), process.on("exit", v), l && l.addEventListener("abort", B);
16562
+ }, A = () => {
16563
+ process.removeListener("uncaughtExceptionMonitor", S2), process.removeListener("unhandledRejection", S2), process.removeListener("SIGINT", B), process.removeListener("SIGTERM", B), process.removeListener("exit", v), l && l.removeEventListener("abort", B);
16564
+ }, C = () => {
16565
+ if (c === undefined)
16566
+ return;
16567
+ d && s.write(`
16045
16568
  `);
16046
- };
16047
- var M2 = { message: (t = "", { symbol: n = import_picocolors2.default.gray(o) } = {}) => {
16048
- const r = [`${import_picocolors2.default.gray(o)}`];
16049
- if (t) {
16050
- const [i, ...s] = t.split(`
16569
+ const I2 = q2(c, f, { hard: true, trim: false }).split(`
16051
16570
  `);
16052
- r.push(`${n} ${i}`, ...s.map((c) => `${import_picocolors2.default.gray(o)} ${c}`));
16053
- }
16054
- process.stdout.write(`${r.join(`
16055
- `)}
16571
+ I2.length > 1 && s.write(import_sisteransi2.cursor.up(I2.length - 1)), s.write(import_sisteransi2.cursor.to(0)), s.write(import_sisteransi2.erase.down());
16572
+ }, _2 = (I2) => I2.replace(/\.+$/, ""), D2 = (I2) => {
16573
+ const O2 = (performance.now() - I2) / 1000, L2 = Math.floor(O2 / 60), j2 = Math.floor(O2 % 60);
16574
+ return L2 > 0 ? `[${L2}m ${j2}s]` : `[${j2}s]`;
16575
+ }, T2 = (I2 = "") => {
16576
+ p = true, g = xt({ output: s }), $ = _2(I2), m = performance.now(), s.write(`${import_picocolors2.default.gray(h)}
16056
16577
  `);
16057
- }, info: (t) => {
16058
- M2.message(t, { symbol: import_picocolors2.default.blue(q2) });
16059
- }, success: (t) => {
16060
- M2.message(t, { symbol: import_picocolors2.default.green(D) });
16061
- }, step: (t) => {
16062
- M2.message(t, { symbol: import_picocolors2.default.green(C2) });
16063
- }, warn: (t) => {
16064
- M2.message(t, { symbol: import_picocolors2.default.yellow(U2) });
16065
- }, warning: (t) => {
16066
- M2.warn(t);
16067
- }, error: (t) => {
16068
- M2.message(t, { symbol: import_picocolors2.default.red(K2) });
16069
- } };
16070
- var J2 = `${import_picocolors2.default.gray(o)} `;
16071
- var x2 = { message: async (t, { symbol: n = import_picocolors2.default.gray(o) } = {}) => {
16072
- process.stdout.write(`${import_picocolors2.default.gray(o)}
16073
- ${n} `);
16074
- let r = 3;
16075
- for await (let i of t) {
16578
+ let O2 = 0, L2 = 0;
16579
+ b(), E = setInterval(() => {
16580
+ if (d && $ === c)
16581
+ return;
16582
+ C(), c = $;
16583
+ const j2 = F(o[O2]);
16584
+ let Z2;
16585
+ if (d)
16586
+ Z2 = `${j2} ${$}...`;
16587
+ else if (e === "timer")
16588
+ Z2 = `${j2} ${$} ${D2(m)}`;
16589
+ else {
16590
+ const Ze = ".".repeat(Math.floor(L2)).slice(0, 3);
16591
+ Z2 = `${j2} ${$}${Ze}`;
16592
+ }
16593
+ const Qe = q2(Z2, f, { hard: true, trim: false });
16594
+ s.write(Qe), O2 = O2 + 1 < o.length ? O2 + 1 : 0, L2 = L2 < 4 ? L2 + 0.125 : 0;
16595
+ }, u);
16596
+ }, W2 = (I2 = "", O2 = 0, L2 = false) => {
16597
+ if (!p)
16598
+ return;
16599
+ p = false, clearInterval(E), C();
16600
+ const j2 = O2 === 0 ? import_picocolors2.default.green(k2) : O2 === 1 ? import_picocolors2.default.red(ce) : import_picocolors2.default.red(de);
16601
+ $ = I2 ?? $, L2 || (e === "timer" ? s.write(`${j2} ${$} ${D2(m)}
16602
+ `) : s.write(`${j2} ${$}
16603
+ `)), A(), g();
16604
+ };
16605
+ return { start: T2, stop: (I2 = "") => W2(I2, 0), message: (I2 = "") => {
16606
+ $ = _2(I2 ?? $);
16607
+ }, cancel: (I2 = "") => W2(I2, 1), error: (I2 = "") => W2(I2, 2), clear: () => W2("", 0, true), get isCancelled() {
16608
+ return y2;
16609
+ } };
16610
+ };
16611
+ var Ye = { light: w2("\u2500", "-"), heavy: w2("\u2501", "="), block: w2("\u2588", "#") };
16612
+ function Kt({ style: e = "heavy", max: r = 100, size: s = 40, ...i } = {}) {
16613
+ const n = Ie(i);
16614
+ let o = 0, u = "";
16615
+ const l = Math.max(1, r), a = Math.max(1, s), d = (y2) => {
16616
+ switch (y2) {
16617
+ case "initial":
16618
+ case "active":
16619
+ return import_picocolors2.default.magenta;
16620
+ case "error":
16621
+ case "cancel":
16622
+ return import_picocolors2.default.red;
16623
+ case "submit":
16624
+ return import_picocolors2.default.green;
16625
+ default:
16626
+ return import_picocolors2.default.magenta;
16627
+ }
16628
+ }, g = (y2, $) => {
16629
+ const c = Math.floor(o / l * a);
16630
+ return `${d(y2)(Ye[e].repeat(c))}${import_picocolors2.default.dim(Ye[e].repeat(a - c))} ${$}`;
16631
+ }, E = (y2 = "") => {
16632
+ u = y2, n.start(g("initial", y2));
16633
+ }, p = (y2 = 1, $) => {
16634
+ o = Math.min(l, y2 + o), n.message(g("active", $ ?? u)), u = $ ?? u;
16635
+ };
16636
+ return { start: E, stop: n.stop, cancel: n.cancel, error: n.error, clear: n.clear, advance: p, isCancelled: n.isCancelled, message: (y2) => p(0, y2) };
16637
+ }
16638
+ var oe = (e, r) => e.includes(`
16639
+ `) ? e.split(`
16640
+ `).map((s) => r(s)).join(`
16641
+ `) : r(e);
16642
+ var qt = (e) => {
16643
+ const r = (s, i) => {
16644
+ const n = s.label ?? String(s.value);
16645
+ switch (i) {
16646
+ case "disabled":
16647
+ return `${import_picocolors2.default.gray(K2)} ${oe(n, import_picocolors2.default.gray)}${s.hint ? ` ${import_picocolors2.default.dim(`(${s.hint ?? "disabled"})`)}` : ""}`;
16648
+ case "selected":
16649
+ return `${oe(n, import_picocolors2.default.dim)}`;
16650
+ case "active":
16651
+ return `${import_picocolors2.default.green(Y)} ${n}${s.hint ? ` ${import_picocolors2.default.dim(`(${s.hint})`)}` : ""}`;
16652
+ case "cancelled":
16653
+ return `${oe(n, (o) => import_picocolors2.default.strikethrough(import_picocolors2.default.dim(o)))}`;
16654
+ default:
16655
+ return `${import_picocolors2.default.dim(K2)} ${oe(n, import_picocolors2.default.dim)}`;
16656
+ }
16657
+ };
16658
+ return new Wt({ options: e.options, signal: e.signal, input: e.input, output: e.output, initialValue: e.initialValue, render() {
16659
+ const s = `${N2(this.state)} `, i = `${Ee(this.state)} `, n = Bt(e.output, e.message, i, s), o = `${import_picocolors2.default.gray(h)}
16660
+ ${n}
16661
+ `;
16662
+ switch (this.state) {
16663
+ case "submit": {
16664
+ const u = `${import_picocolors2.default.gray(h)} `, l = Bt(e.output, r(this.options[this.cursor], "selected"), u);
16665
+ return `${o}${l}`;
16666
+ }
16667
+ case "cancel": {
16668
+ const u = `${import_picocolors2.default.gray(h)} `, l = Bt(e.output, r(this.options[this.cursor], "cancelled"), u);
16669
+ return `${o}${l}
16670
+ ${import_picocolors2.default.gray(h)}`;
16671
+ }
16672
+ default: {
16673
+ const u = `${import_picocolors2.default.cyan(h)} `, l = o.split(`
16674
+ `).length;
16675
+ return `${o}${u}${J2({ output: e.output, cursor: this.cursor, options: this.options, maxItems: e.maxItems, columnPadding: u.length, rowPadding: l + 2, style: (a, d) => r(a, a.disabled ? "disabled" : d ? "active" : "inactive") }).join(`
16676
+ ${u}`)}
16677
+ ${import_picocolors2.default.cyan(x2)}
16678
+ `;
16679
+ }
16680
+ }
16681
+ } }).prompt();
16682
+ };
16683
+ var Jt = (e) => {
16684
+ const r = (s, i = "inactive") => {
16685
+ const n = s.label ?? String(s.value);
16686
+ return i === "selected" ? `${import_picocolors2.default.dim(n)}` : i === "cancelled" ? `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(n))}` : i === "active" ? `${import_picocolors2.default.bgCyan(import_picocolors2.default.gray(` ${s.value} `))} ${n}${s.hint ? ` ${import_picocolors2.default.dim(`(${s.hint})`)}` : ""}` : `${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(` ${s.value} `)))} ${n}${s.hint ? ` ${import_picocolors2.default.dim(`(${s.hint})`)}` : ""}`;
16687
+ };
16688
+ return new Tt({ options: e.options, signal: e.signal, input: e.input, output: e.output, initialValue: e.initialValue, caseSensitive: e.caseSensitive, render() {
16689
+ const s = `${import_picocolors2.default.gray(h)}
16690
+ ${N2(this.state)} ${e.message}
16691
+ `;
16692
+ switch (this.state) {
16693
+ case "submit": {
16694
+ const i = `${import_picocolors2.default.gray(h)} `, n = this.options.find((u) => u.value === this.value) ?? e.options[0], o = Bt(e.output, r(n, "selected"), i);
16695
+ return `${s}${o}`;
16696
+ }
16697
+ case "cancel": {
16698
+ const i = `${import_picocolors2.default.gray(h)} `, n = Bt(e.output, r(this.options[0], "cancelled"), i);
16699
+ return `${s}${n}
16700
+ ${import_picocolors2.default.gray(h)}`;
16701
+ }
16702
+ default: {
16703
+ const i = `${import_picocolors2.default.cyan(h)} `, n = this.options.map((o, u) => Bt(e.output, r(o, u === this.cursor ? "active" : "inactive"), i)).join(`
16704
+ `);
16705
+ return `${s}${n}
16706
+ ${import_picocolors2.default.cyan(x2)}
16707
+ `;
16708
+ }
16709
+ }
16710
+ } }).prompt();
16711
+ };
16712
+ var ze = `${import_picocolors2.default.gray(h)} `;
16713
+ var H2 = { message: async (e, { symbol: r = import_picocolors2.default.gray(h) } = {}) => {
16714
+ process.stdout.write(`${import_picocolors2.default.gray(h)}
16715
+ ${r} `);
16716
+ let s = 3;
16717
+ for await (let i of e) {
16076
16718
  i = i.replace(/\n/g, `
16077
- ${J2}`), i.includes(`
16078
- `) && (r = 3 + S2(i.slice(i.lastIndexOf(`
16719
+ ${ze}`), i.includes(`
16720
+ `) && (s = 3 + le(i.slice(i.lastIndexOf(`
16079
16721
  `))).length);
16080
- const s = S2(i).length;
16081
- r + s < process.stdout.columns ? (r += s, process.stdout.write(i)) : (process.stdout.write(`
16082
- ${J2}${i.trimStart()}`), r = 3 + S2(i.trimStart()).length);
16722
+ const n = le(i).length;
16723
+ s + n < process.stdout.columns ? (s += n, process.stdout.write(i)) : (process.stdout.write(`
16724
+ ${ze}${i.trimStart()}`), s = 3 + le(i.trimStart()).length);
16083
16725
  }
16084
16726
  process.stdout.write(`
16085
16727
  `);
16086
- }, info: (t) => x2.message(t, { symbol: import_picocolors2.default.blue(q2) }), success: (t) => x2.message(t, { symbol: import_picocolors2.default.green(D) }), step: (t) => x2.message(t, { symbol: import_picocolors2.default.green(C2) }), warn: (t) => x2.message(t, { symbol: import_picocolors2.default.yellow(U2) }), warning: (t) => x2.warn(t), error: (t) => x2.message(t, { symbol: import_picocolors2.default.red(K2) }) };
16087
- var Y2 = ({ indicator: t = "dots" } = {}) => {
16088
- const n = V2 ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"], r = V2 ? 80 : 120, i = process.env.CI === "true";
16089
- let s, c, a = false, l2 = "", $2, g2 = performance.now();
16090
- const p2 = (m2) => {
16091
- const h2 = m2 > 1 ? "Something went wrong" : "Canceled";
16092
- a && N2(h2, m2);
16093
- }, v2 = () => p2(2), f = () => p2(1), j2 = () => {
16094
- process.on("uncaughtExceptionMonitor", v2), process.on("unhandledRejection", v2), process.on("SIGINT", f), process.on("SIGTERM", f), process.on("exit", p2);
16095
- }, E = () => {
16096
- process.removeListener("uncaughtExceptionMonitor", v2), process.removeListener("unhandledRejection", v2), process.removeListener("SIGINT", f), process.removeListener("SIGTERM", f), process.removeListener("exit", p2);
16097
- }, B2 = () => {
16098
- if ($2 === undefined)
16099
- return;
16100
- i && process.stdout.write(`
16728
+ }, info: (e) => H2.message(e, { symbol: import_picocolors2.default.blue(ge) }), success: (e) => H2.message(e, { symbol: import_picocolors2.default.green(fe) }), step: (e) => H2.message(e, { symbol: import_picocolors2.default.green(k2) }), warn: (e) => H2.message(e, { symbol: import_picocolors2.default.yellow(Fe) }), warning: (e) => H2.warn(e), error: (e) => H2.message(e, { symbol: import_picocolors2.default.red(ye) }) };
16729
+ var Xt = async (e, r) => {
16730
+ for (const s of e) {
16731
+ if (s.enabled === false)
16732
+ continue;
16733
+ const i = Ie(r);
16734
+ i.start(s.title);
16735
+ const n = await s.task(i.message);
16736
+ i.stop(n || s.title);
16737
+ }
16738
+ };
16739
+ var Yt = (e) => e.replace(/\x1b\[(?:\d+;)*\d*[ABCDEFGHfJKSTsu]|\x1b\[(s|u)/g, "");
16740
+ var zt = (e) => {
16741
+ const r = e.output ?? process.stdout, s = rt(r), i = import_picocolors2.default.gray(h), n = e.spacing ?? 1, o = 3, u = e.retainLog === true, l = !ue() && Te(r);
16742
+ r.write(`${i}
16743
+ `), r.write(`${import_picocolors2.default.green(k2)} ${e.title}
16101
16744
  `);
16102
- const m2 = $2.split(`
16745
+ for (let m = 0;m < n; m++)
16746
+ r.write(`${i}
16103
16747
  `);
16104
- process.stdout.write(import_sisteransi2.cursor.move(-999, m2.length - 1)), process.stdout.write(import_sisteransi2.erase.down(m2.length));
16105
- }, R2 = (m2) => m2.replace(/\.+$/, ""), O2 = (m2) => {
16106
- const h2 = (performance.now() - m2) / 1000, w2 = Math.floor(h2 / 60), I2 = Math.floor(h2 % 60);
16107
- return w2 > 0 ? `[${w2}m ${I2}s]` : `[${I2}s]`;
16108
- }, H2 = (m2 = "") => {
16109
- a = true, s = fD(), l2 = R2(m2), g2 = performance.now(), process.stdout.write(`${import_picocolors2.default.gray(o)}
16748
+ const a = [{ value: "", full: "" }];
16749
+ let d = false;
16750
+ const g = (m) => {
16751
+ if (a.length === 0)
16752
+ return;
16753
+ let f = 0;
16754
+ m && (f += n + 2);
16755
+ for (const F of a) {
16756
+ const { value: v, result: S2 } = F;
16757
+ let B = S2?.message ?? v;
16758
+ if (B.length === 0)
16759
+ continue;
16760
+ S2 === undefined && F.header !== undefined && F.header !== "" && (B += `
16761
+ ${F.header}`);
16762
+ const b = B.split(`
16763
+ `).reduce((A, C) => C === "" ? A + 1 : A + Math.ceil((C.length + o) / s), 0);
16764
+ f += b;
16765
+ }
16766
+ f > 0 && (f += 1, r.write(import_sisteransi2.erase.lines(f)));
16767
+ }, E = (m, f, F) => {
16768
+ const v = F ? `${m.full}
16769
+ ${m.value}` : m.value;
16770
+ m.header !== undefined && m.header !== "" && R2.message(m.header.split(`
16771
+ `).map(import_picocolors2.default.bold), { output: r, secondarySymbol: i, symbol: i, spacing: 0 }), R2.message(v.split(`
16772
+ `).map(import_picocolors2.default.dim), { output: r, secondarySymbol: i, symbol: i, spacing: f ?? n });
16773
+ }, p = () => {
16774
+ for (const m of a) {
16775
+ const { header: f, value: F, full: v } = m;
16776
+ (f === undefined || f.length === 0) && F.length === 0 || E(m, undefined, u === true && v.length > 0);
16777
+ }
16778
+ }, y2 = (m, f, F) => {
16779
+ if (g(false), (F?.raw !== true || !d) && m.value !== "" && (m.value += `
16780
+ `), m.value += Yt(f), d = F?.raw === true, e.limit !== undefined) {
16781
+ const v = m.value.split(`
16782
+ `), S2 = v.length - e.limit;
16783
+ if (S2 > 0) {
16784
+ const B = v.splice(0, S2);
16785
+ u && (m.full += (m.full === "" ? "" : `
16786
+ `) + B.join(`
16787
+ `));
16788
+ }
16789
+ m.value = v.join(`
16110
16790
  `);
16111
- let h2 = 0, w2 = 0;
16112
- j2(), c = setInterval(() => {
16113
- if (i && l2 === $2)
16114
- return;
16115
- B2(), $2 = l2;
16116
- const I2 = import_picocolors2.default.magenta(n[h2]);
16117
- if (i)
16118
- process.stdout.write(`${I2} ${l2}...`);
16119
- else if (t === "timer")
16120
- process.stdout.write(`${I2} ${l2} ${O2(g2)}`);
16121
- else {
16122
- const z22 = ".".repeat(Math.floor(w2)).slice(0, 3);
16123
- process.stdout.write(`${I2} ${l2}${z22}`);
16124
- }
16125
- h2 = h2 + 1 < n.length ? h2 + 1 : 0, w2 = w2 < n.length ? w2 + 0.125 : 0;
16126
- }, r);
16127
- }, N2 = (m2 = "", h2 = 0) => {
16128
- a = false, clearInterval(c), B2();
16129
- const w2 = h2 === 0 ? import_picocolors2.default.green(C2) : h2 === 1 ? import_picocolors2.default.red(L2) : import_picocolors2.default.red(W2);
16130
- l2 = R2(m2 ?? l2), t === "timer" ? process.stdout.write(`${w2} ${l2} ${O2(g2)}
16131
- `) : process.stdout.write(`${w2} ${l2}
16132
- `), E(), s();
16133
- };
16134
- return { start: H2, stop: N2, message: (m2 = "") => {
16135
- l2 = R2(m2 ?? l2);
16791
+ }
16792
+ l && $();
16793
+ }, $ = () => {
16794
+ for (const m of a)
16795
+ m.result ? m.result.status === "error" ? R2.error(m.result.message, { output: r, secondarySymbol: i, spacing: 0 }) : R2.success(m.result.message, { output: r, secondarySymbol: i, spacing: 0 }) : m.value !== "" && E(m, 0);
16796
+ }, c = (m, f) => {
16797
+ g(false), m.result = f, l && $();
16798
+ };
16799
+ return { message(m, f) {
16800
+ y2(a[0], m, f);
16801
+ }, group(m) {
16802
+ const f = { header: m, value: "", full: "" };
16803
+ return a.push(f), { message(F, v) {
16804
+ y2(f, F, v);
16805
+ }, error(F) {
16806
+ c(f, { status: "error", message: F });
16807
+ }, success(F) {
16808
+ c(f, { status: "success", message: F });
16809
+ } };
16810
+ }, error(m, f) {
16811
+ g(true), R2.error(m, { output: r, secondarySymbol: i, spacing: 1 }), f?.showLog !== false && p(), a.splice(1, a.length - 1), a[0].value = "", a[0].full = "";
16812
+ }, success(m, f) {
16813
+ g(true), R2.success(m, { output: r, secondarySymbol: i, spacing: 1 }), f?.showLog === true && p(), a.splice(1, a.length - 1), a[0].value = "", a[0].full = "";
16136
16814
  } };
16137
16815
  };
16138
- var Ce = async (t, n) => {
16139
- const r = {}, i = Object.keys(t);
16140
- for (const s of i) {
16141
- const c = t[s], a = await c({ results: r })?.catch((l2) => {
16142
- throw l2;
16143
- });
16144
- if (typeof n?.onCancel == "function" && pD(a)) {
16145
- r[s] = "canceled", n.onCancel({ results: r });
16146
- continue;
16816
+ var Qt = (e) => new $t({ validate: e.validate, placeholder: e.placeholder, defaultValue: e.defaultValue, initialValue: e.initialValue, output: e.output, signal: e.signal, input: e.input, render() {
16817
+ const r = (e?.withGuide ?? _.withGuide) !== false, s = `${`${r ? `${import_picocolors2.default.gray(h)}
16818
+ ` : ""}${N2(this.state)} `}${e.message}
16819
+ `, i = e.placeholder ? import_picocolors2.default.inverse(e.placeholder[0]) + import_picocolors2.default.dim(e.placeholder.slice(1)) : import_picocolors2.default.inverse(import_picocolors2.default.hidden("_")), n = this.userInput ? this.userInputWithCursor : i, o = this.value ?? "";
16820
+ switch (this.state) {
16821
+ case "error": {
16822
+ const u = this.error ? ` ${import_picocolors2.default.yellow(this.error)}` : "", l = r ? `${import_picocolors2.default.yellow(h)} ` : "", a = r ? import_picocolors2.default.yellow(x2) : "";
16823
+ return `${s.trim()}
16824
+ ${l}${n}
16825
+ ${a}${u}
16826
+ `;
16827
+ }
16828
+ case "submit": {
16829
+ const u = o ? ` ${import_picocolors2.default.dim(o)}` : "", l = r ? import_picocolors2.default.gray(h) : "";
16830
+ return `${s}${l}${u}`;
16831
+ }
16832
+ case "cancel": {
16833
+ const u = o ? ` ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(o))}` : "", l = r ? import_picocolors2.default.gray(h) : "";
16834
+ return `${s}${l}${u}${o.trim() ? `
16835
+ ${l}` : ""}`;
16836
+ }
16837
+ default: {
16838
+ const u = r ? `${import_picocolors2.default.cyan(h)} ` : "", l = r ? import_picocolors2.default.cyan(x2) : "";
16839
+ return `${s}${u}${n}
16840
+ ${l}
16841
+ `;
16147
16842
  }
16148
- r[s] = a;
16149
- }
16150
- return r;
16151
- };
16152
- var Te = async (t) => {
16153
- for (const n of t) {
16154
- if (n.enabled === false)
16155
- continue;
16156
- const r = Y2();
16157
- r.start(n.title);
16158
- const i = await n.task(r.message);
16159
- r.stop(i || n.title);
16160
16843
  }
16161
- };
16844
+ } }).prompt();
16162
16845
  var CANCEL = Symbol.for("bunli:prompt_cancel");
16163
16846
  function isCancel(value2) {
16164
- return value2 === CANCEL || pD(value2);
16847
+ return value2 === CANCEL || Ct(value2);
16165
16848
  }
16166
16849
 
16167
16850
  class PromptCancelledError extends Error {
@@ -16177,7 +16860,7 @@ function assertNotCancelled(value2, message) {
16177
16860
  }
16178
16861
  function promptOrExit(value2, message) {
16179
16862
  if (isCancel(value2)) {
16180
- xe(message ?? "Cancelled");
16863
+ Pt(message ?? "Cancelled");
16181
16864
  process.exit(0);
16182
16865
  }
16183
16866
  return value2;
@@ -16190,17 +16873,17 @@ var clack = {
16190
16873
  assertNotCancelled,
16191
16874
  promptOrExit
16192
16875
  };
16193
- function toClackOption(o2) {
16194
- if (o2.hint !== undefined && o2.disabled !== undefined) {
16195
- return { value: o2.value, label: o2.label, hint: o2.hint, disabled: o2.disabled };
16876
+ function toClackOption(o) {
16877
+ if (o.hint !== undefined && o.disabled !== undefined) {
16878
+ return { value: o.value, label: o.label, hint: o.hint, disabled: o.disabled };
16196
16879
  }
16197
- if (o2.hint !== undefined) {
16198
- return { value: o2.value, label: o2.label, hint: o2.hint };
16880
+ if (o.hint !== undefined) {
16881
+ return { value: o.value, label: o.label, hint: o.hint };
16199
16882
  }
16200
- if (o2.disabled !== undefined) {
16201
- return { value: o2.value, label: o2.label, disabled: o2.disabled };
16883
+ if (o.disabled !== undefined) {
16884
+ return { value: o.value, label: o.label, disabled: o.disabled };
16202
16885
  }
16203
- return { value: o2.value, label: o2.label };
16886
+ return { value: o.value, label: o.label };
16204
16887
  }
16205
16888
  function cancelAndThrow(message) {
16206
16889
  clack.cancel(message ?? "Cancelled");
@@ -16228,8 +16911,8 @@ async function prompt(message, options = {}) {
16228
16911
  message,
16229
16912
  placeholder: options.placeholder,
16230
16913
  defaultValue: options.default,
16231
- validate: options.validate ? (v2) => {
16232
- const input2 = (v2 ?? "").trim();
16914
+ validate: options.validate ? (v) => {
16915
+ const input2 = (v ?? "").trim();
16233
16916
  const res = options.validate?.(input2);
16234
16917
  if (res === true)
16235
16918
  return;
@@ -16262,7 +16945,7 @@ async function confirm(message, options = {}) {
16262
16945
  return value2;
16263
16946
  }
16264
16947
  async function select(message, options) {
16265
- const mappedOptions = options.options.map((o2) => toClackOption({ value: o2.value, label: o2.label, hint: o2.hint, disabled: o2.disabled }));
16948
+ const mappedOptions = options.options.map((o) => toClackOption({ value: o.value, label: o.label, hint: o.hint, disabled: o.disabled }));
16266
16949
  const value2 = await clack.select({
16267
16950
  message,
16268
16951
  options: mappedOptions,
@@ -16273,7 +16956,7 @@ async function select(message, options) {
16273
16956
  return value2;
16274
16957
  }
16275
16958
  async function multiselect(message, options) {
16276
- const mappedOptions = options.options.map((o2) => toClackOption({ value: o2.value, label: o2.label, hint: o2.hint, disabled: o2.disabled }));
16959
+ const mappedOptions = options.options.map((o) => toClackOption({ value: o.value, label: o.label, hint: o.hint, disabled: o.disabled }));
16277
16960
  while (true) {
16278
16961
  const value2 = await clack.multiselect({
16279
16962
  message,
@@ -16301,8 +16984,8 @@ async function password(message, options = {}) {
16301
16984
  while (true) {
16302
16985
  const value2 = await clack.password({
16303
16986
  message,
16304
- validate: options.validate ? (v2) => {
16305
- const input2 = v2 ?? "";
16987
+ validate: options.validate ? (v) => {
16988
+ const input2 = v ?? "";
16306
16989
  const res = options.validate?.(input2);
16307
16990
  if (res === true)
16308
16991
  return;
@@ -16923,7 +17606,7 @@ class PluginManager {
16923
17606
  return this.plugins;
16924
17607
  }
16925
17608
  getPlugin(name2) {
16926
- return this.plugins.find((p2) => p2.name === name2);
17609
+ return this.plugins.find((p) => p.name === name2);
16927
17610
  }
16928
17611
  }
16929
17612
 
@@ -18202,4 +18885,4 @@ export {
18202
18885
  createMatchers
18203
18886
  };
18204
18887
 
18205
- //# debugId=00D5BDCA1029B73764756E2164756E21
18888
+ //# debugId=0E2F42936F8E710664756E2164756E21