create-rstack 1.7.21 → 1.8.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.d.ts +30 -6
- package/dist/index.js +865 -778
- package/dist/rslib-runtime.js +39 -0
- package/package.json +12 -12
- package/template-biome/package.json +1 -1
- package/template-eslint/react-js/package.json +4 -4
- package/template-eslint/react-ts/package.json +5 -5
- package/template-eslint/svelte-js/package.json +4 -4
- package/template-eslint/svelte-ts/package.json +5 -5
- package/template-eslint/vanilla-js/package.json +3 -3
- package/template-eslint/vanilla-ts/package.json +4 -4
- package/template-eslint/vue-js/package.json +4 -4
- package/template-eslint/vue-ts/package.json +5 -5
- package/template-prettier/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
/*#__PURE__*/ import.meta.url;
|
|
1
|
+
import "node:module";
|
|
3
2
|
import * as __rspack_external_child_process from "child_process";
|
|
4
3
|
import * as __rspack_external_fs from "fs";
|
|
5
4
|
import * as __rspack_external_node_fs_5ea92f0c from "node:fs";
|
|
6
5
|
import * as __rspack_external_node_fs_promises_153e37e0 from "node:fs/promises";
|
|
7
6
|
import * as __rspack_external_path from "path";
|
|
7
|
+
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
8
8
|
import node_path, { dirname } from "node:path";
|
|
9
9
|
import { fileURLToPath } from "node:url";
|
|
10
|
-
import {
|
|
10
|
+
import node_util, { styleText } from "node:util";
|
|
11
11
|
import node_process, { stdin, stdout } from "node:process";
|
|
12
12
|
import node_readline from "node:readline";
|
|
13
|
-
import { Writable } from "node:stream";
|
|
14
|
-
import node_os from "node:os";
|
|
15
13
|
import node_tty from "node:tty";
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
import node_os from "node:os";
|
|
15
|
+
__webpack_require__.add({
|
|
16
|
+
"./node_modules/.pnpm/@vercel+detect-agent@1.1.0/node_modules/@vercel/detect-agent/dist/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
18
17
|
var __defProp = Object.defineProperty;
|
|
19
18
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
20
19
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -53,6 +52,8 @@ var __webpack_modules__ = {
|
|
|
53
52
|
const REPLIT = "replit";
|
|
54
53
|
const GEMINI = "gemini";
|
|
55
54
|
const CODEX = "codex";
|
|
55
|
+
const AUGMENT_CLI = "augment-cli";
|
|
56
|
+
const OPENCODE = "opencode";
|
|
56
57
|
const KNOWN_AGENTS = {
|
|
57
58
|
CURSOR,
|
|
58
59
|
CURSOR_CLI,
|
|
@@ -60,7 +61,9 @@ var __webpack_modules__ = {
|
|
|
60
61
|
DEVIN,
|
|
61
62
|
REPLIT,
|
|
62
63
|
GEMINI,
|
|
63
|
-
CODEX
|
|
64
|
+
CODEX,
|
|
65
|
+
AUGMENT_CLI,
|
|
66
|
+
OPENCODE
|
|
64
67
|
};
|
|
65
68
|
async function determineAgent() {
|
|
66
69
|
if (process.env.AI_AGENT) {
|
|
@@ -96,6 +99,18 @@ var __webpack_modules__ = {
|
|
|
96
99
|
name: CODEX
|
|
97
100
|
}
|
|
98
101
|
};
|
|
102
|
+
if (process.env.AUGMENT_AGENT) return {
|
|
103
|
+
isAgent: true,
|
|
104
|
+
agent: {
|
|
105
|
+
name: AUGMENT_CLI
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
if (process.env.OPENCODE_CLIENT) return {
|
|
109
|
+
isAgent: true,
|
|
110
|
+
agent: {
|
|
111
|
+
name: OPENCODE
|
|
112
|
+
}
|
|
113
|
+
};
|
|
99
114
|
if (process.env.CLAUDECODE || process.env.CLAUDE_CODE) return {
|
|
100
115
|
isAgent: true,
|
|
101
116
|
agent: {
|
|
@@ -123,7 +138,7 @@ var __webpack_modules__ = {
|
|
|
123
138
|
};
|
|
124
139
|
}
|
|
125
140
|
},
|
|
126
|
-
"./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js"
|
|
141
|
+
"./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
127
142
|
const cp = __webpack_require__("child_process");
|
|
128
143
|
const parse = __webpack_require__("./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js");
|
|
129
144
|
const enoent = __webpack_require__("./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js");
|
|
@@ -145,7 +160,7 @@ var __webpack_modules__ = {
|
|
|
145
160
|
module.exports._parse = parse;
|
|
146
161
|
module.exports._enoent = enoent;
|
|
147
162
|
},
|
|
148
|
-
"./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js"
|
|
163
|
+
"./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js" (module) {
|
|
149
164
|
const isWin = 'win32' === process.platform;
|
|
150
165
|
function notFoundError(original, syscall) {
|
|
151
166
|
return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
|
|
@@ -182,7 +197,7 @@ var __webpack_modules__ = {
|
|
|
182
197
|
notFoundError
|
|
183
198
|
};
|
|
184
199
|
},
|
|
185
|
-
"./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js"
|
|
200
|
+
"./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
186
201
|
const path = __webpack_require__("path");
|
|
187
202
|
const resolveCommand = __webpack_require__("./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js");
|
|
188
203
|
const escape = __webpack_require__("./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js");
|
|
@@ -244,7 +259,7 @@ var __webpack_modules__ = {
|
|
|
244
259
|
}
|
|
245
260
|
module.exports = parse;
|
|
246
261
|
},
|
|
247
|
-
"./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js"
|
|
262
|
+
"./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js" (module) {
|
|
248
263
|
const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
|
|
249
264
|
function escapeCommand(arg) {
|
|
250
265
|
arg = arg.replace(metaCharsRegExp, '^$1');
|
|
@@ -262,7 +277,7 @@ var __webpack_modules__ = {
|
|
|
262
277
|
module.exports.command = escapeCommand;
|
|
263
278
|
module.exports.argument = escapeArgument;
|
|
264
279
|
},
|
|
265
|
-
"./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js"
|
|
280
|
+
"./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
266
281
|
const fs = __webpack_require__("fs");
|
|
267
282
|
const shebangCommand = __webpack_require__("./node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js");
|
|
268
283
|
function readShebang(command) {
|
|
@@ -278,7 +293,7 @@ var __webpack_modules__ = {
|
|
|
278
293
|
}
|
|
279
294
|
module.exports = readShebang;
|
|
280
295
|
},
|
|
281
|
-
"./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js"
|
|
296
|
+
"./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
282
297
|
const path = __webpack_require__("path");
|
|
283
298
|
const which = __webpack_require__("./node_modules/.pnpm/which@2.0.2/node_modules/which/which.js");
|
|
284
299
|
const getPathKey = __webpack_require__("./node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js");
|
|
@@ -309,7 +324,7 @@ var __webpack_modules__ = {
|
|
|
309
324
|
}
|
|
310
325
|
module.exports = resolveCommand;
|
|
311
326
|
},
|
|
312
|
-
"./node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js"
|
|
327
|
+
"./node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js" (module) {
|
|
313
328
|
var isMergeableObject = function(value) {
|
|
314
329
|
return isNonNullObject(value) && !isSpecial(value);
|
|
315
330
|
};
|
|
@@ -392,7 +407,7 @@ var __webpack_modules__ = {
|
|
|
392
407
|
var deepmerge_1 = deepmerge;
|
|
393
408
|
module.exports = deepmerge_1;
|
|
394
409
|
},
|
|
395
|
-
"./node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js"
|
|
410
|
+
"./node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
396
411
|
__webpack_require__("fs");
|
|
397
412
|
var core;
|
|
398
413
|
core = 'win32' === process.platform || global.TESTING_WINDOWS ? __webpack_require__("./node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js") : __webpack_require__("./node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js");
|
|
@@ -431,7 +446,7 @@ var __webpack_modules__ = {
|
|
|
431
446
|
}
|
|
432
447
|
}
|
|
433
448
|
},
|
|
434
|
-
"./node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js"
|
|
449
|
+
"./node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
435
450
|
module.exports = isexe;
|
|
436
451
|
isexe.sync = sync;
|
|
437
452
|
var fs = __webpack_require__("fs");
|
|
@@ -460,7 +475,7 @@ var __webpack_modules__ = {
|
|
|
460
475
|
return ret;
|
|
461
476
|
}
|
|
462
477
|
},
|
|
463
|
-
"./node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js"
|
|
478
|
+
"./node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
464
479
|
module.exports = isexe;
|
|
465
480
|
isexe.sync = sync;
|
|
466
481
|
var fs = __webpack_require__("fs");
|
|
@@ -488,7 +503,7 @@ var __webpack_modules__ = {
|
|
|
488
503
|
return checkStat(fs.statSync(path), path, options);
|
|
489
504
|
}
|
|
490
505
|
},
|
|
491
|
-
"./node_modules/.pnpm/minimist@1.2.8/node_modules/minimist/index.js"
|
|
506
|
+
"./node_modules/.pnpm/minimist@1.2.8/node_modules/minimist/index.js" (module) {
|
|
492
507
|
function hasKey(obj, keys) {
|
|
493
508
|
var o = obj;
|
|
494
509
|
keys.slice(0, -1).forEach(function(key) {
|
|
@@ -667,7 +682,7 @@ var __webpack_modules__ = {
|
|
|
667
682
|
return argv;
|
|
668
683
|
};
|
|
669
684
|
},
|
|
670
|
-
"./node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js"
|
|
685
|
+
"./node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js" (module) {
|
|
671
686
|
const pathKey = (options = {})=>{
|
|
672
687
|
const environment = options.env || process.env;
|
|
673
688
|
const platform = options.platform || process.platform;
|
|
@@ -677,7 +692,7 @@ var __webpack_modules__ = {
|
|
|
677
692
|
module.exports = pathKey;
|
|
678
693
|
module.exports["default"] = pathKey;
|
|
679
694
|
},
|
|
680
|
-
"./node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"
|
|
695
|
+
"./node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js" (module) {
|
|
681
696
|
let p = process || {}, argv = p.argv || [], env = p.env || {};
|
|
682
697
|
let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || "win32" === p.platform || (p.stdout || {}).isTTY && "dumb" !== env.TERM || !!env.CI);
|
|
683
698
|
let formatter = (open, close, replace = open)=>(input)=>{
|
|
@@ -743,7 +758,7 @@ var __webpack_modules__ = {
|
|
|
743
758
|
module.exports = createColors();
|
|
744
759
|
module.exports.createColors = createColors;
|
|
745
760
|
},
|
|
746
|
-
"./node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js"
|
|
761
|
+
"./node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
747
762
|
const shebangRegex = __webpack_require__("./node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js");
|
|
748
763
|
module.exports = (string = '')=>{
|
|
749
764
|
const match = string.match(shebangRegex);
|
|
@@ -754,10 +769,10 @@ var __webpack_modules__ = {
|
|
|
754
769
|
return argument ? `${binary} ${argument}` : binary;
|
|
755
770
|
};
|
|
756
771
|
},
|
|
757
|
-
"./node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js"
|
|
772
|
+
"./node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js" (module) {
|
|
758
773
|
module.exports = /^#!(.*)/;
|
|
759
774
|
},
|
|
760
|
-
"./node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"
|
|
775
|
+
"./node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js" (module) {
|
|
761
776
|
const ESC = '\x1B';
|
|
762
777
|
const CSI = `${ESC}[`;
|
|
763
778
|
const beep = '\u0007';
|
|
@@ -811,7 +826,7 @@ var __webpack_modules__ = {
|
|
|
811
826
|
beep
|
|
812
827
|
};
|
|
813
828
|
},
|
|
814
|
-
"./node_modules/.pnpm/which@2.0.2/node_modules/which/which.js"
|
|
829
|
+
"./node_modules/.pnpm/which@2.0.2/node_modules/which/which.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
815
830
|
const isWindows = 'win32' === process.platform || 'cygwin' === process.env.OSTYPE || 'msys' === process.env.OSTYPE;
|
|
816
831
|
const path = __webpack_require__("path");
|
|
817
832
|
const COLON = isWindows ? ';' : ':';
|
|
@@ -898,473 +913,181 @@ var __webpack_modules__ = {
|
|
|
898
913
|
module.exports = which;
|
|
899
914
|
which.sync = whichSync;
|
|
900
915
|
},
|
|
901
|
-
child_process
|
|
916
|
+
child_process (module) {
|
|
902
917
|
module.exports = __rspack_external_child_process;
|
|
903
918
|
},
|
|
904
|
-
fs
|
|
919
|
+
fs (module) {
|
|
905
920
|
module.exports = __rspack_external_fs;
|
|
906
921
|
},
|
|
907
|
-
"node:fs"
|
|
922
|
+
"node:fs" (module) {
|
|
908
923
|
module.exports = __rspack_external_node_fs_5ea92f0c;
|
|
909
924
|
},
|
|
910
|
-
"node:fs/promises"
|
|
925
|
+
"node:fs/promises" (module) {
|
|
911
926
|
module.exports = __rspack_external_node_fs_promises_153e37e0;
|
|
912
927
|
},
|
|
913
|
-
path
|
|
928
|
+
path (module) {
|
|
914
929
|
module.exports = __rspack_external_path;
|
|
915
930
|
}
|
|
916
|
-
};
|
|
917
|
-
|
|
918
|
-
function
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
exports: {}
|
|
923
|
-
};
|
|
924
|
-
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
925
|
-
return module.exports;
|
|
926
|
-
}
|
|
927
|
-
(()=>{
|
|
928
|
-
__webpack_require__.n = (module)=>{
|
|
929
|
-
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
930
|
-
__webpack_require__.d(getter, {
|
|
931
|
-
a: getter
|
|
932
|
-
});
|
|
933
|
-
return getter;
|
|
934
|
-
};
|
|
935
|
-
})();
|
|
936
|
-
(()=>{
|
|
937
|
-
__webpack_require__.d = (exports, definition)=>{
|
|
938
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) Object.defineProperty(exports, key, {
|
|
939
|
-
enumerable: true,
|
|
940
|
-
get: definition[key]
|
|
941
|
-
});
|
|
942
|
-
};
|
|
943
|
-
})();
|
|
944
|
-
(()=>{
|
|
945
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
946
|
-
})();
|
|
947
|
-
var external_node_fs_ = __webpack_require__("node:fs");
|
|
948
|
-
var src = __webpack_require__("./node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js");
|
|
949
|
-
var picocolors = __webpack_require__("./node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
950
|
-
var picocolors_default = /*#__PURE__*/ __webpack_require__.n(picocolors);
|
|
951
|
-
function DD({ onlyFirst: e = !1 } = {}) {
|
|
952
|
-
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=><~]))";
|
|
953
|
-
return new RegExp(t, e ? void 0 : "g");
|
|
954
|
-
}
|
|
955
|
-
const uD = DD();
|
|
956
|
-
function P(e) {
|
|
957
|
-
if ("string" != typeof e) throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);
|
|
958
|
-
return e.replace(uD, "");
|
|
931
|
+
});
|
|
932
|
+
const src = __webpack_require__("./node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js");
|
|
933
|
+
function x(t, e, s) {
|
|
934
|
+
if (!s.some((u)=>!u.disabled)) return t;
|
|
935
|
+
const i = t + e, r = Math.max(s.length - 1, 0), n = i < 0 ? r : i > r ? 0 : i;
|
|
936
|
+
return s[n].disabled ? x(n, e < 0 ? -1 : 1, s) : n;
|
|
959
937
|
}
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
(
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
var a = n[E], o = u.length(a);
|
|
985
|
-
if (C >= s - (2 == o ? 1 : 0)) if (C + o <= i) D += a;
|
|
986
|
-
else break;
|
|
987
|
-
C += o;
|
|
988
|
-
}
|
|
989
|
-
return D;
|
|
990
|
-
};
|
|
991
|
-
})(W);
|
|
992
|
-
var tD = W.exports;
|
|
993
|
-
const eD = L(tD);
|
|
994
|
-
var FD = function() {
|
|
995
|
-
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;
|
|
996
|
-
};
|
|
997
|
-
const sD = L(FD);
|
|
998
|
-
function dist_p(e, u = {}) {
|
|
999
|
-
if ("string" != typeof e || 0 === e.length || (u = {
|
|
1000
|
-
ambiguousIsNarrow: !0,
|
|
1001
|
-
...u
|
|
1002
|
-
}, e = P(e), 0 === e.length)) return 0;
|
|
1003
|
-
e = e.replace(sD(), " ");
|
|
1004
|
-
const t = u.ambiguousIsNarrow ? 1 : 2;
|
|
1005
|
-
let F = 0;
|
|
1006
|
-
for (const s of e){
|
|
1007
|
-
const i = s.codePointAt(0);
|
|
1008
|
-
if (!(i <= 31) && (!(i >= 127) || !(i <= 159)) && (!(i >= 768) || !(i <= 879))) switch(eD.eastAsianWidth(s)){
|
|
1009
|
-
case "F":
|
|
1010
|
-
case "W":
|
|
1011
|
-
F += 2;
|
|
938
|
+
const dist_at = (t)=>161 === t || 164 === t || 167 === t || 168 === t || 170 === t || 173 === t || 174 === t || t >= 176 && t <= 180 || t >= 182 && t <= 186 || t >= 188 && t <= 191 || 198 === t || 208 === t || 215 === t || 216 === t || t >= 222 && t <= 225 || 230 === t || t >= 232 && t <= 234 || 236 === t || 237 === t || 240 === t || 242 === t || 243 === t || t >= 247 && t <= 250 || 252 === t || 254 === t || 257 === t || 273 === t || 275 === t || 283 === t || 294 === t || 295 === t || 299 === t || t >= 305 && t <= 307 || 312 === t || t >= 319 && t <= 322 || 324 === t || t >= 328 && t <= 331 || 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 || t >= 713 && t <= 715 || 717 === t || 720 === t || t >= 728 && t <= 731 || 733 === t || 735 === t || t >= 768 && t <= 879 || t >= 913 && t <= 929 || t >= 931 && t <= 937 || t >= 945 && t <= 961 || t >= 963 && t <= 969 || 1025 === t || t >= 1040 && t <= 1103 || 1105 === t || 8208 === t || t >= 8211 && t <= 8214 || 8216 === t || 8217 === t || 8220 === t || 8221 === t || t >= 8224 && t <= 8226 || t >= 8228 && t <= 8231 || 8240 === t || 8242 === t || 8243 === t || 8245 === t || 8251 === t || 8254 === t || 8308 === t || 8319 === t || t >= 8321 && t <= 8324 || 8364 === t || 8451 === t || 8453 === t || 8457 === t || 8467 === t || 8470 === t || 8481 === t || 8482 === t || 8486 === t || 8491 === t || 8531 === t || 8532 === t || t >= 8539 && t <= 8542 || t >= 8544 && t <= 8555 || t >= 8560 && t <= 8569 || 8585 === t || t >= 8592 && t <= 8601 || 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 || t >= 8733 && t <= 8736 || 8739 === t || 8741 === t || t >= 8743 && t <= 8748 || 8750 === t || t >= 8756 && t <= 8759 || 8764 === t || 8765 === t || 8776 === t || 8780 === t || 8786 === t || 8800 === t || 8801 === t || t >= 8804 && t <= 8807 || 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 || t >= 9312 && t <= 9449 || t >= 9451 && t <= 9547 || t >= 9552 && t <= 9587 || t >= 9600 && t <= 9615 || t >= 9618 && t <= 9621 || 9632 === t || 9633 === t || t >= 9635 && t <= 9641 || 9650 === t || 9651 === t || 9654 === t || 9655 === t || 9660 === t || 9661 === t || 9664 === t || 9665 === t || t >= 9670 && t <= 9672 || 9675 === t || t >= 9678 && t <= 9681 || t >= 9698 && t <= 9701 || 9711 === t || 9733 === t || 9734 === t || 9737 === t || 9742 === t || 9743 === t || 9756 === t || 9758 === t || 9792 === t || 9794 === t || 9824 === t || 9825 === t || t >= 9827 && t <= 9829 || t >= 9831 && t <= 9834 || 9836 === t || 9837 === t || 9839 === t || 9886 === t || 9887 === t || 9919 === t || t >= 9926 && t <= 9933 || t >= 9935 && t <= 9939 || t >= 9941 && t <= 9953 || 9955 === t || 9960 === t || 9961 === t || t >= 9963 && t <= 9969 || 9972 === t || t >= 9974 && t <= 9977 || 9979 === t || 9980 === t || 9982 === t || 9983 === t || 10045 === t || t >= 10102 && t <= 10111 || t >= 11094 && t <= 11097 || t >= 12872 && t <= 12879 || t >= 57344 && t <= 63743 || t >= 65024 && t <= 65039 || 65533 === t || t >= 127232 && t <= 127242 || t >= 127248 && t <= 127277 || t >= 127280 && t <= 127337 || t >= 127344 && t <= 127373 || 127375 === t || 127376 === t || t >= 127387 && t <= 127404 || t >= 917760 && t <= 917999 || t >= 983040 && t <= 1048573 || t >= 1048576 && t <= 1114109, lt = (t)=>12288 === t || t >= 65281 && t <= 65376 || t >= 65504 && t <= 65510, dist_ht = (t)=>t >= 4352 && t <= 4447 || 8986 === t || 8987 === t || 9001 === t || 9002 === t || t >= 9193 && t <= 9196 || 9200 === t || 9203 === t || 9725 === t || 9726 === t || 9748 === t || 9749 === t || t >= 9800 && t <= 9811 || 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 || t >= 10067 && t <= 10069 || 10071 === t || t >= 10133 && t <= 10135 || 10160 === t || 10175 === t || 11035 === t || 11036 === t || 11088 === t || 11093 === t || 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 || 94192 === t || 94193 === t || t >= 94208 && t <= 100343 || t >= 100352 && t <= 101589 || t >= 101632 && t <= 101640 || t >= 110576 && t <= 110579 || t >= 110581 && t <= 110587 || 110589 === t || 110590 === t || t >= 110592 && t <= 110882 || 110898 === t || t >= 110928 && t <= 110930 || 110933 === t || t >= 110948 && t <= 110951 || t >= 110960 && t <= 111355 || 126980 === t || 127183 === t || 127374 === t || t >= 127377 && t <= 127386 || t >= 127488 && t <= 127490 || t >= 127504 && t <= 127547 || t >= 127552 && t <= 127560 || 127568 === t || 127569 === t || 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 || 127988 === t || t >= 127992 && t <= 128062 || 128064 === t || t >= 128066 && t <= 128252 || t >= 128255 && t <= 128317 || t >= 128331 && t <= 128334 || t >= 128336 && t <= 128359 || 128378 === t || 128405 === t || 128406 === t || 128420 === t || t >= 128507 && t <= 128591 || t >= 128640 && t <= 128709 || 128716 === t || t >= 128720 && t <= 128722 || t >= 128725 && t <= 128727 || t >= 128732 && t <= 128735 || 128747 === t || 128748 === t || t >= 128756 && t <= 128764 || t >= 128992 && t <= 129003 || 129008 === t || 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, dist_O = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y, dist_y = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y, dist_L = /\t{1,1000}/y, dist_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, dist_M = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y, ct = /\p{M}+/gu, ft = {
|
|
939
|
+
limit: 1 / 0,
|
|
940
|
+
ellipsis: ""
|
|
941
|
+
}, X = (t, e = {}, s = {})=>{
|
|
942
|
+
const i = e.limit ?? 1 / 0, r = e.ellipsis ?? "", n = e?.ellipsisWidth ?? (r ? X(r, ft, s).width : 0), u = s.ansiWidth ?? 0, a = s.controlWidth ?? 0, l = s.tabWidth ?? 8, E = s.ambiguousWidth ?? 1, g = s.emojiWidth ?? 2, m = s.fullWidthWidth ?? 2, A = s.regularWidth ?? 1, V = s.wideWidth ?? 2;
|
|
943
|
+
let h = 0, o = 0, p = t.length, v = 0, F = !1, d = p, b = Math.max(0, i - n), C = 0, w = 0, c = 0, f = 0;
|
|
944
|
+
t: for(;;){
|
|
945
|
+
if (w > C || o >= p && o > h) {
|
|
946
|
+
const ut = t.slice(C, w) || t.slice(h, o);
|
|
947
|
+
v = 0;
|
|
948
|
+
for (const Y of ut.replaceAll(ct, "")){
|
|
949
|
+
const $ = Y.codePointAt(0) || 0;
|
|
950
|
+
if (lt($) ? f = m : dist_ht($) ? f = V : E !== A && dist_at($) ? f = E : f = A, c + f > b && (d = Math.min(d, Math.max(C, h) + v)), c + f > i) {
|
|
951
|
+
F = !0;
|
|
952
|
+
break t;
|
|
953
|
+
}
|
|
954
|
+
v += Y.length, c += f;
|
|
955
|
+
}
|
|
956
|
+
C = w = 0;
|
|
957
|
+
}
|
|
958
|
+
if (o >= p) break;
|
|
959
|
+
if (dist_M.lastIndex = o, dist_M.test(t)) {
|
|
960
|
+
if (v = dist_M.lastIndex - o, f = v * A, c + f > b && (d = Math.min(d, o + Math.floor((b - c) / A))), c + f > i) {
|
|
961
|
+
F = !0;
|
|
1012
962
|
break;
|
|
1013
|
-
|
|
1014
|
-
|
|
963
|
+
}
|
|
964
|
+
c += f, C = h, w = o, o = h = dist_M.lastIndex;
|
|
965
|
+
continue;
|
|
966
|
+
}
|
|
967
|
+
if (dist_O.lastIndex = o, dist_O.test(t)) {
|
|
968
|
+
if (c + u > b && (d = Math.min(d, o)), c + u > i) {
|
|
969
|
+
F = !0;
|
|
1015
970
|
break;
|
|
1016
|
-
|
|
1017
|
-
|
|
971
|
+
}
|
|
972
|
+
c += u, C = h, w = o, o = h = dist_O.lastIndex;
|
|
973
|
+
continue;
|
|
1018
974
|
}
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
0
|
|
1027
|
-
],
|
|
1028
|
-
bold: [
|
|
1029
|
-
1,
|
|
1030
|
-
22
|
|
1031
|
-
],
|
|
1032
|
-
dim: [
|
|
1033
|
-
2,
|
|
1034
|
-
22
|
|
1035
|
-
],
|
|
1036
|
-
italic: [
|
|
1037
|
-
3,
|
|
1038
|
-
23
|
|
1039
|
-
],
|
|
1040
|
-
underline: [
|
|
1041
|
-
4,
|
|
1042
|
-
24
|
|
1043
|
-
],
|
|
1044
|
-
overline: [
|
|
1045
|
-
53,
|
|
1046
|
-
55
|
|
1047
|
-
],
|
|
1048
|
-
inverse: [
|
|
1049
|
-
7,
|
|
1050
|
-
27
|
|
1051
|
-
],
|
|
1052
|
-
hidden: [
|
|
1053
|
-
8,
|
|
1054
|
-
28
|
|
1055
|
-
],
|
|
1056
|
-
strikethrough: [
|
|
1057
|
-
9,
|
|
1058
|
-
29
|
|
1059
|
-
]
|
|
1060
|
-
},
|
|
1061
|
-
color: {
|
|
1062
|
-
black: [
|
|
1063
|
-
30,
|
|
1064
|
-
39
|
|
1065
|
-
],
|
|
1066
|
-
red: [
|
|
1067
|
-
31,
|
|
1068
|
-
39
|
|
1069
|
-
],
|
|
1070
|
-
green: [
|
|
1071
|
-
32,
|
|
1072
|
-
39
|
|
1073
|
-
],
|
|
1074
|
-
yellow: [
|
|
1075
|
-
33,
|
|
1076
|
-
39
|
|
1077
|
-
],
|
|
1078
|
-
blue: [
|
|
1079
|
-
34,
|
|
1080
|
-
39
|
|
1081
|
-
],
|
|
1082
|
-
magenta: [
|
|
1083
|
-
35,
|
|
1084
|
-
39
|
|
1085
|
-
],
|
|
1086
|
-
cyan: [
|
|
1087
|
-
36,
|
|
1088
|
-
39
|
|
1089
|
-
],
|
|
1090
|
-
white: [
|
|
1091
|
-
37,
|
|
1092
|
-
39
|
|
1093
|
-
],
|
|
1094
|
-
blackBright: [
|
|
1095
|
-
90,
|
|
1096
|
-
39
|
|
1097
|
-
],
|
|
1098
|
-
gray: [
|
|
1099
|
-
90,
|
|
1100
|
-
39
|
|
1101
|
-
],
|
|
1102
|
-
grey: [
|
|
1103
|
-
90,
|
|
1104
|
-
39
|
|
1105
|
-
],
|
|
1106
|
-
redBright: [
|
|
1107
|
-
91,
|
|
1108
|
-
39
|
|
1109
|
-
],
|
|
1110
|
-
greenBright: [
|
|
1111
|
-
92,
|
|
1112
|
-
39
|
|
1113
|
-
],
|
|
1114
|
-
yellowBright: [
|
|
1115
|
-
93,
|
|
1116
|
-
39
|
|
1117
|
-
],
|
|
1118
|
-
blueBright: [
|
|
1119
|
-
94,
|
|
1120
|
-
39
|
|
1121
|
-
],
|
|
1122
|
-
magentaBright: [
|
|
1123
|
-
95,
|
|
1124
|
-
39
|
|
1125
|
-
],
|
|
1126
|
-
cyanBright: [
|
|
1127
|
-
96,
|
|
1128
|
-
39
|
|
1129
|
-
],
|
|
1130
|
-
whiteBright: [
|
|
1131
|
-
97,
|
|
1132
|
-
39
|
|
1133
|
-
]
|
|
1134
|
-
},
|
|
1135
|
-
bgColor: {
|
|
1136
|
-
bgBlack: [
|
|
1137
|
-
40,
|
|
1138
|
-
49
|
|
1139
|
-
],
|
|
1140
|
-
bgRed: [
|
|
1141
|
-
41,
|
|
1142
|
-
49
|
|
1143
|
-
],
|
|
1144
|
-
bgGreen: [
|
|
1145
|
-
42,
|
|
1146
|
-
49
|
|
1147
|
-
],
|
|
1148
|
-
bgYellow: [
|
|
1149
|
-
43,
|
|
1150
|
-
49
|
|
1151
|
-
],
|
|
1152
|
-
bgBlue: [
|
|
1153
|
-
44,
|
|
1154
|
-
49
|
|
1155
|
-
],
|
|
1156
|
-
bgMagenta: [
|
|
1157
|
-
45,
|
|
1158
|
-
49
|
|
1159
|
-
],
|
|
1160
|
-
bgCyan: [
|
|
1161
|
-
46,
|
|
1162
|
-
49
|
|
1163
|
-
],
|
|
1164
|
-
bgWhite: [
|
|
1165
|
-
47,
|
|
1166
|
-
49
|
|
1167
|
-
],
|
|
1168
|
-
bgBlackBright: [
|
|
1169
|
-
100,
|
|
1170
|
-
49
|
|
1171
|
-
],
|
|
1172
|
-
bgGray: [
|
|
1173
|
-
100,
|
|
1174
|
-
49
|
|
1175
|
-
],
|
|
1176
|
-
bgGrey: [
|
|
1177
|
-
100,
|
|
1178
|
-
49
|
|
1179
|
-
],
|
|
1180
|
-
bgRedBright: [
|
|
1181
|
-
101,
|
|
1182
|
-
49
|
|
1183
|
-
],
|
|
1184
|
-
bgGreenBright: [
|
|
1185
|
-
102,
|
|
1186
|
-
49
|
|
1187
|
-
],
|
|
1188
|
-
bgYellowBright: [
|
|
1189
|
-
103,
|
|
1190
|
-
49
|
|
1191
|
-
],
|
|
1192
|
-
bgBlueBright: [
|
|
1193
|
-
104,
|
|
1194
|
-
49
|
|
1195
|
-
],
|
|
1196
|
-
bgMagentaBright: [
|
|
1197
|
-
105,
|
|
1198
|
-
49
|
|
1199
|
-
],
|
|
1200
|
-
bgCyanBright: [
|
|
1201
|
-
106,
|
|
1202
|
-
49
|
|
1203
|
-
],
|
|
1204
|
-
bgWhiteBright: [
|
|
1205
|
-
107,
|
|
1206
|
-
49
|
|
1207
|
-
]
|
|
1208
|
-
}
|
|
1209
|
-
};
|
|
1210
|
-
Object.keys(dist_r.modifier);
|
|
1211
|
-
const iD = Object.keys(dist_r.color), CD = Object.keys(dist_r.bgColor);
|
|
1212
|
-
[
|
|
1213
|
-
...iD,
|
|
1214
|
-
...CD
|
|
1215
|
-
];
|
|
1216
|
-
function rD() {
|
|
1217
|
-
const e = new Map;
|
|
1218
|
-
for (const [u, t] of Object.entries(dist_r)){
|
|
1219
|
-
for (const [F, s] of Object.entries(t))dist_r[F] = {
|
|
1220
|
-
open: `\x1B[${s[0]}m`,
|
|
1221
|
-
close: `\x1B[${s[1]}m`
|
|
1222
|
-
}, t[F] = dist_r[F], e.set(s[0], s[1]);
|
|
1223
|
-
Object.defineProperty(dist_r, u, {
|
|
1224
|
-
value: t,
|
|
1225
|
-
enumerable: !1
|
|
1226
|
-
});
|
|
1227
|
-
}
|
|
1228
|
-
return Object.defineProperty(dist_r, "codes", {
|
|
1229
|
-
value: e,
|
|
1230
|
-
enumerable: !1
|
|
1231
|
-
}), dist_r.color.close = "\x1B[39m", dist_r.bgColor.close = "\x1B[49m", dist_r.color.ansi = dist_N(), dist_r.color.ansi256 = dist_I(), dist_r.color.ansi16m = dist_R(), dist_r.bgColor.ansi = dist_N(dist_w), dist_r.bgColor.ansi256 = dist_I(dist_w), dist_r.bgColor.ansi16m = dist_R(dist_w), Object.defineProperties(dist_r, {
|
|
1232
|
-
rgbToAnsi256: {
|
|
1233
|
-
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),
|
|
1234
|
-
enumerable: !1
|
|
1235
|
-
},
|
|
1236
|
-
hexToRgb: {
|
|
1237
|
-
value: (u)=>{
|
|
1238
|
-
const t = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));
|
|
1239
|
-
if (!t) return [
|
|
1240
|
-
0,
|
|
1241
|
-
0,
|
|
1242
|
-
0
|
|
1243
|
-
];
|
|
1244
|
-
let [F] = t;
|
|
1245
|
-
3 === F.length && (F = [
|
|
1246
|
-
...F
|
|
1247
|
-
].map((i)=>i + i).join(""));
|
|
1248
|
-
const s = Number.parseInt(F, 16);
|
|
1249
|
-
return [
|
|
1250
|
-
s >> 16 & 255,
|
|
1251
|
-
s >> 8 & 255,
|
|
1252
|
-
255 & s
|
|
1253
|
-
];
|
|
1254
|
-
},
|
|
1255
|
-
enumerable: !1
|
|
1256
|
-
},
|
|
1257
|
-
hexToAnsi256: {
|
|
1258
|
-
value: (u)=>dist_r.rgbToAnsi256(...dist_r.hexToRgb(u)),
|
|
1259
|
-
enumerable: !1
|
|
1260
|
-
},
|
|
1261
|
-
ansi256ToAnsi: {
|
|
1262
|
-
value: (u)=>{
|
|
1263
|
-
if (u < 8) return 30 + u;
|
|
1264
|
-
if (u < 16) return 90 + (u - 8);
|
|
1265
|
-
let t, F, s;
|
|
1266
|
-
if (u >= 232) t = ((u - 232) * 10 + 8) / 255, F = t, s = t;
|
|
1267
|
-
else {
|
|
1268
|
-
u -= 16;
|
|
1269
|
-
const C = u % 36;
|
|
1270
|
-
t = Math.floor(u / 36) / 5, F = Math.floor(C / 6) / 5, s = C % 6 / 5;
|
|
1271
|
-
}
|
|
1272
|
-
const i = 2 * Math.max(t, F, s);
|
|
1273
|
-
if (0 === i) return 30;
|
|
1274
|
-
let D = 30 + (Math.round(s) << 2 | Math.round(F) << 1 | Math.round(t));
|
|
1275
|
-
return 2 === i && (D += 60), D;
|
|
1276
|
-
},
|
|
1277
|
-
enumerable: !1
|
|
1278
|
-
},
|
|
1279
|
-
rgbToAnsi: {
|
|
1280
|
-
value: (u, t, F)=>dist_r.ansi256ToAnsi(dist_r.rgbToAnsi256(u, t, F)),
|
|
1281
|
-
enumerable: !1
|
|
1282
|
-
},
|
|
1283
|
-
hexToAnsi: {
|
|
1284
|
-
value: (u)=>dist_r.ansi256ToAnsi(dist_r.hexToAnsi256(u)),
|
|
1285
|
-
enumerable: !1
|
|
975
|
+
if (dist_y.lastIndex = o, dist_y.test(t)) {
|
|
976
|
+
if (v = dist_y.lastIndex - o, f = v * a, c + f > b && (d = Math.min(d, o + Math.floor((b - c) / a))), c + f > i) {
|
|
977
|
+
F = !0;
|
|
978
|
+
break;
|
|
979
|
+
}
|
|
980
|
+
c += f, C = h, w = o, o = h = dist_y.lastIndex;
|
|
981
|
+
continue;
|
|
1286
982
|
}
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
983
|
+
if (dist_L.lastIndex = o, dist_L.test(t)) {
|
|
984
|
+
if (v = dist_L.lastIndex - o, f = v * l, c + f > b && (d = Math.min(d, o + Math.floor((b - c) / l))), c + f > i) {
|
|
985
|
+
F = !0;
|
|
986
|
+
break;
|
|
987
|
+
}
|
|
988
|
+
c += f, C = h, w = o, o = h = dist_L.lastIndex;
|
|
989
|
+
continue;
|
|
990
|
+
}
|
|
991
|
+
if (dist_P.lastIndex = o, dist_P.test(t)) {
|
|
992
|
+
if (c + g > b && (d = Math.min(d, o)), c + g > i) {
|
|
993
|
+
F = !0;
|
|
994
|
+
break;
|
|
995
|
+
}
|
|
996
|
+
c += g, C = h, w = o, o = h = dist_P.lastIndex;
|
|
1301
997
|
continue;
|
|
1302
998
|
}
|
|
1303
|
-
|
|
999
|
+
o += 1;
|
|
1304
1000
|
}
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
},
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1001
|
+
return {
|
|
1002
|
+
width: F ? b : c,
|
|
1003
|
+
index: F ? d : p,
|
|
1004
|
+
truncated: F,
|
|
1005
|
+
ellipsed: F && i >= n
|
|
1006
|
+
};
|
|
1007
|
+
}, pt = {
|
|
1008
|
+
limit: 1 / 0,
|
|
1009
|
+
ellipsis: "",
|
|
1010
|
+
ellipsisWidth: 0
|
|
1011
|
+
}, dist_S = (t, e = {})=>X(t, pt, e).width, dist_T = "\x1B", dist_Z = "\x9B", Ft = 39, dist_j = "\x07", Q = "[", dist_dt = "]", tt = "m", U = `${dist_dt}8;;`, dist_et = new RegExp(`(?:\\${Q}(?<code>\\d+)m|\\${U}(?<uri>.*)${dist_j})`, "y"), mt = (t)=>{
|
|
1012
|
+
if (t >= 30 && t <= 37 || t >= 90 && t <= 97) return 39;
|
|
1013
|
+
if (t >= 40 && t <= 47 || t >= 100 && t <= 107) return 49;
|
|
1014
|
+
if (1 === t || 2 === t) return 22;
|
|
1015
|
+
if (3 === t) return 23;
|
|
1016
|
+
if (4 === t) return 24;
|
|
1017
|
+
if (7 === t) return 27;
|
|
1018
|
+
if (8 === t) return 28;
|
|
1019
|
+
if (9 === t) return 29;
|
|
1020
|
+
if (0 === t) return 0;
|
|
1021
|
+
}, dist_st = (t)=>`${dist_T}${Q}${t}${tt}`, dist_it = (t)=>`${dist_T}${U}${t}${dist_j}`, gt = (t)=>t.map((e)=>dist_S(e)), dist_G = (t, e, s)=>{
|
|
1022
|
+
const i = e[Symbol.iterator]();
|
|
1023
|
+
let r = !1, n = !1, u = t.at(-1), a = void 0 === u ? 0 : dist_S(u), l = i.next(), E = i.next(), g = 0;
|
|
1024
|
+
for(; !l.done;){
|
|
1025
|
+
const m = l.value, A = dist_S(m);
|
|
1026
|
+
a + A <= s ? t[t.length - 1] += m : (t.push(m), a = 0), (m === dist_T || m === dist_Z) && (r = !0, n = e.startsWith(U, g + 1)), r ? n ? m === dist_j && (r = !1, n = !1) : m === tt && (r = !1) : (a += A, a !== s || E.done || (t.push(""), a = 0)), l = E, E = i.next(), g += m.length;
|
|
1027
|
+
}
|
|
1028
|
+
u = t.at(-1), !a && void 0 !== u && u.length > 0 && t.length > 1 && (t[t.length - 2] += t.pop());
|
|
1029
|
+
}, vt = (t)=>{
|
|
1030
|
+
const e = t.split(" ");
|
|
1031
|
+
let s = e.length;
|
|
1032
|
+
for(; s > 0 && !(dist_S(e[s - 1]) > 0);)s--;
|
|
1033
|
+
return s === e.length ? t : e.slice(0, s).join(" ") + e.slice(s).join("");
|
|
1034
|
+
}, Et = (t, e, s = {})=>{
|
|
1035
|
+
if (!1 !== s.trim && "" === t.trim()) return "";
|
|
1036
|
+
let i = "", r, n;
|
|
1037
|
+
const u = t.split(" "), a = gt(u);
|
|
1038
|
+
let l = [
|
|
1316
1039
|
""
|
|
1317
1040
|
];
|
|
1318
|
-
for (const [
|
|
1319
|
-
!1 !==
|
|
1320
|
-
let
|
|
1321
|
-
if (0 !==
|
|
1322
|
-
const
|
|
1323
|
-
Math.floor((
|
|
1041
|
+
for (const [h, o] of u.entries()){
|
|
1042
|
+
!1 !== s.trim && (l[l.length - 1] = (l.at(-1) ?? "").trimStart());
|
|
1043
|
+
let p = dist_S(l.at(-1) ?? "");
|
|
1044
|
+
if (0 !== h && (p >= e && (!1 === s.wordWrap || !1 === s.trim) && (l.push(""), p = 0), (p > 0 || !1 === s.trim) && (l[l.length - 1] += " ", p++)), s.hard && a[h] > e) {
|
|
1045
|
+
const v = e - p, F = 1 + Math.floor((a[h] - v - 1) / e);
|
|
1046
|
+
Math.floor((a[h] - 1) / e) < F && l.push(""), dist_G(l, o, e);
|
|
1324
1047
|
continue;
|
|
1325
1048
|
}
|
|
1326
|
-
if (
|
|
1327
|
-
if (!1 ===
|
|
1328
|
-
|
|
1049
|
+
if (p + a[h] > e && p > 0 && a[h] > 0) {
|
|
1050
|
+
if (!1 === s.wordWrap && p < e) {
|
|
1051
|
+
dist_G(l, o, e);
|
|
1329
1052
|
continue;
|
|
1330
1053
|
}
|
|
1331
|
-
|
|
1054
|
+
l.push("");
|
|
1332
1055
|
}
|
|
1333
|
-
if (
|
|
1334
|
-
|
|
1056
|
+
if (p + a[h] > e && !1 === s.wordWrap) {
|
|
1057
|
+
dist_G(l, o, e);
|
|
1335
1058
|
continue;
|
|
1336
1059
|
}
|
|
1337
|
-
|
|
1060
|
+
l[l.length - 1] += o;
|
|
1338
1061
|
}
|
|
1339
|
-
!1 !==
|
|
1340
|
-
const
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
if (
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
`
|
|
1357
|
-
` && (s && o && (F += dist_z(s)), i && (F += K(i)));
|
|
1062
|
+
!1 !== s.trim && (l = l.map((h)=>vt(h)));
|
|
1063
|
+
const E = l.join(`
|
|
1064
|
+
`), g = E[Symbol.iterator]();
|
|
1065
|
+
let m = g.next(), A = g.next(), V = 0;
|
|
1066
|
+
for(; !m.done;){
|
|
1067
|
+
const h = m.value, o = A.value;
|
|
1068
|
+
if (i += h, h === dist_T || h === dist_Z) {
|
|
1069
|
+
dist_et.lastIndex = V + 1;
|
|
1070
|
+
const F = dist_et.exec(E)?.groups;
|
|
1071
|
+
if (F?.code !== void 0) {
|
|
1072
|
+
const d = Number.parseFloat(F.code);
|
|
1073
|
+
r = d === Ft ? void 0 : d;
|
|
1074
|
+
} else F?.uri !== void 0 && (n = 0 === F.uri.length ? void 0 : F.uri);
|
|
1075
|
+
}
|
|
1076
|
+
const p = r ? mt(r) : void 0;
|
|
1077
|
+
o === `
|
|
1078
|
+
` ? (n && (i += dist_it("")), r && p && (i += dist_st(p))) : h === `
|
|
1079
|
+
` && (r && p && (i += dist_st(r)), n && (i += dist_it(n))), V += h.length, m = A, A = g.next();
|
|
1358
1080
|
}
|
|
1359
|
-
return
|
|
1081
|
+
return i;
|
|
1360
1082
|
};
|
|
1361
|
-
function
|
|
1362
|
-
return String(
|
|
1083
|
+
function K(t, e, s) {
|
|
1084
|
+
return String(t).normalize().replaceAll(`\r
|
|
1085
|
+
`, `
|
|
1363
1086
|
`).split(`
|
|
1364
|
-
`).map((
|
|
1087
|
+
`).map((i)=>Et(i, e, s)).join(`
|
|
1365
1088
|
`);
|
|
1366
1089
|
}
|
|
1367
|
-
const
|
|
1090
|
+
const At = [
|
|
1368
1091
|
"up",
|
|
1369
1092
|
"down",
|
|
1370
1093
|
"left",
|
|
@@ -1372,8 +1095,8 @@ const xD = [
|
|
|
1372
1095
|
"space",
|
|
1373
1096
|
"enter",
|
|
1374
1097
|
"cancel"
|
|
1375
|
-
],
|
|
1376
|
-
actions: new Set(
|
|
1098
|
+
], dist_ = {
|
|
1099
|
+
actions: new Set(At),
|
|
1377
1100
|
aliases: new Map([
|
|
1378
1101
|
[
|
|
1379
1102
|
"k",
|
|
@@ -1399,170 +1122,245 @@ const xD = [
|
|
|
1399
1122
|
"escape",
|
|
1400
1123
|
"cancel"
|
|
1401
1124
|
]
|
|
1402
|
-
])
|
|
1125
|
+
]),
|
|
1126
|
+
messages: {
|
|
1127
|
+
cancel: "Canceled",
|
|
1128
|
+
error: "Something went wrong"
|
|
1129
|
+
},
|
|
1130
|
+
withGuide: !0
|
|
1403
1131
|
};
|
|
1404
|
-
function
|
|
1405
|
-
if ("string" == typeof
|
|
1406
|
-
for (const
|
|
1132
|
+
function H(t, e) {
|
|
1133
|
+
if ("string" == typeof t) return dist_.aliases.get(t) === e;
|
|
1134
|
+
for (const s of t)if (void 0 !== s && H(s, e)) return !0;
|
|
1407
1135
|
return !1;
|
|
1408
1136
|
}
|
|
1409
|
-
function
|
|
1410
|
-
if (
|
|
1411
|
-
const
|
|
1412
|
-
`),
|
|
1413
|
-
`), s = [];
|
|
1414
|
-
for(let
|
|
1415
|
-
return
|
|
1137
|
+
function _t(t, e) {
|
|
1138
|
+
if (t === e) return;
|
|
1139
|
+
const s = t.split(`
|
|
1140
|
+
`), i = e.split(`
|
|
1141
|
+
`), r = Math.max(s.length, i.length), n = [];
|
|
1142
|
+
for(let u = 0; u < r; u++)s[u] !== i[u] && n.push(u);
|
|
1143
|
+
return {
|
|
1144
|
+
lines: n,
|
|
1145
|
+
numLinesBefore: s.length,
|
|
1146
|
+
numLinesAfter: i.length,
|
|
1147
|
+
numLines: r
|
|
1148
|
+
};
|
|
1416
1149
|
}
|
|
1417
1150
|
globalThis.process.platform.startsWith("win");
|
|
1418
|
-
const
|
|
1419
|
-
function
|
|
1420
|
-
return
|
|
1151
|
+
const z = Symbol("clack:cancel");
|
|
1152
|
+
function Ct(t) {
|
|
1153
|
+
return t === z;
|
|
1421
1154
|
}
|
|
1422
|
-
function
|
|
1423
|
-
const
|
|
1424
|
-
|
|
1155
|
+
function W(t, e) {
|
|
1156
|
+
const s = t;
|
|
1157
|
+
s.isTTY && s.setRawMode(e);
|
|
1425
1158
|
}
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1159
|
+
const dist_rt = (t)=>"columns" in t && "number" == typeof t.columns ? t.columns : 80, nt = (t)=>"rows" in t && "number" == typeof t.rows ? t.rows : 20;
|
|
1160
|
+
function Bt(t, e, s, i = s) {
|
|
1161
|
+
const r = dist_rt(t ?? stdout);
|
|
1162
|
+
return K(e, r - s.length, {
|
|
1163
|
+
hard: !0,
|
|
1164
|
+
trim: !1
|
|
1165
|
+
}).split(`
|
|
1166
|
+
`).map((n, u)=>`${0 === u ? i : s}${n}`).join(`
|
|
1167
|
+
`);
|
|
1168
|
+
}
|
|
1169
|
+
class dist_B {
|
|
1170
|
+
input;
|
|
1171
|
+
output;
|
|
1172
|
+
_abortSignal;
|
|
1173
|
+
rl;
|
|
1174
|
+
opts;
|
|
1175
|
+
_render;
|
|
1176
|
+
_track = !1;
|
|
1177
|
+
_prevFrame = "";
|
|
1178
|
+
_subscribers = new Map;
|
|
1179
|
+
_cursor = 0;
|
|
1180
|
+
state = "initial";
|
|
1181
|
+
error = "";
|
|
1182
|
+
value;
|
|
1183
|
+
userInput = "";
|
|
1184
|
+
constructor(e, s = !0){
|
|
1185
|
+
const { input: i = stdin, output: r = stdout, render: n, signal: u, ...a } = e;
|
|
1186
|
+
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;
|
|
1437
1187
|
}
|
|
1438
1188
|
unsubscribe() {
|
|
1439
1189
|
this._subscribers.clear();
|
|
1440
1190
|
}
|
|
1441
|
-
setSubscriber(
|
|
1442
|
-
const
|
|
1443
|
-
|
|
1191
|
+
setSubscriber(e, s) {
|
|
1192
|
+
const i = this._subscribers.get(e) ?? [];
|
|
1193
|
+
i.push(s), this._subscribers.set(e, i);
|
|
1444
1194
|
}
|
|
1445
|
-
on(
|
|
1446
|
-
this.setSubscriber(
|
|
1447
|
-
cb:
|
|
1195
|
+
on(e, s) {
|
|
1196
|
+
this.setSubscriber(e, {
|
|
1197
|
+
cb: s
|
|
1448
1198
|
});
|
|
1449
1199
|
}
|
|
1450
|
-
once(
|
|
1451
|
-
this.setSubscriber(
|
|
1452
|
-
cb:
|
|
1200
|
+
once(e, s) {
|
|
1201
|
+
this.setSubscriber(e, {
|
|
1202
|
+
cb: s,
|
|
1453
1203
|
once: !0
|
|
1454
1204
|
});
|
|
1455
1205
|
}
|
|
1456
|
-
emit(
|
|
1457
|
-
const
|
|
1458
|
-
for (const
|
|
1459
|
-
for (const
|
|
1206
|
+
emit(e, ...s) {
|
|
1207
|
+
const i = this._subscribers.get(e) ?? [], r = [];
|
|
1208
|
+
for (const n of i)n.cb(...s), n.once && r.push(()=>i.splice(i.indexOf(n), 1));
|
|
1209
|
+
for (const n of r)n();
|
|
1460
1210
|
}
|
|
1461
1211
|
prompt() {
|
|
1462
|
-
return new Promise((
|
|
1212
|
+
return new Promise((e)=>{
|
|
1463
1213
|
if (this._abortSignal) {
|
|
1464
|
-
if (this._abortSignal.aborted) return this.state = "cancel", this.close(),
|
|
1214
|
+
if (this._abortSignal.aborted) return this.state = "cancel", this.close(), e(z);
|
|
1465
1215
|
this._abortSignal.addEventListener("abort", ()=>{
|
|
1466
1216
|
this.state = "cancel", this.close();
|
|
1467
1217
|
}, {
|
|
1468
1218
|
once: !0
|
|
1469
1219
|
});
|
|
1470
1220
|
}
|
|
1471
|
-
|
|
1472
|
-
F._write = (s, i, D)=>{
|
|
1473
|
-
this._track && (this.value = this.rl?.line.replace(/\t/g, ""), this._cursor = this.rl?.cursor ?? 0, this.emit("value", this.value)), D();
|
|
1474
|
-
}, this.input.pipe(F), this.rl = node_readline.createInterface({
|
|
1221
|
+
this.rl = node_readline.createInterface({
|
|
1475
1222
|
input: this.input,
|
|
1476
|
-
output: F,
|
|
1477
1223
|
tabSize: 2,
|
|
1478
1224
|
prompt: "",
|
|
1479
1225
|
escapeCodeTimeout: 50,
|
|
1480
1226
|
terminal: !0
|
|
1481
|
-
}),
|
|
1482
|
-
this.output.write(src.cursor.show), this.output.off("resize", this.render),
|
|
1227
|
+
}), this.rl.prompt(), void 0 !== this.opts.initialUserInput && this._setUserInput(this.opts.initialUserInput, !0), this.input.on("keypress", this.onKeypress), W(this.input, !0), this.output.on("resize", this.render), this.render(), this.once("submit", ()=>{
|
|
1228
|
+
this.output.write(src.cursor.show), this.output.off("resize", this.render), W(this.input, !1), e(this.value);
|
|
1483
1229
|
}), this.once("cancel", ()=>{
|
|
1484
|
-
this.output.write(src.cursor.show), this.output.off("resize", this.render),
|
|
1230
|
+
this.output.write(src.cursor.show), this.output.off("resize", this.render), W(this.input, !1), e(z);
|
|
1485
1231
|
});
|
|
1486
1232
|
});
|
|
1487
1233
|
}
|
|
1488
|
-
|
|
1489
|
-
|
|
1234
|
+
_isActionKey(e, s) {
|
|
1235
|
+
return " " === e;
|
|
1236
|
+
}
|
|
1237
|
+
_setValue(e) {
|
|
1238
|
+
this.value = e, this.emit("value", this.value);
|
|
1239
|
+
}
|
|
1240
|
+
_setUserInput(e, s) {
|
|
1241
|
+
this.userInput = e ?? "", this.emit("userInput", this.userInput), s && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
|
|
1242
|
+
}
|
|
1243
|
+
_clearUserInput() {
|
|
1244
|
+
this.rl?.write(null, {
|
|
1245
|
+
ctrl: !0,
|
|
1246
|
+
name: "u"
|
|
1247
|
+
}), this._setUserInput("");
|
|
1248
|
+
}
|
|
1249
|
+
onKeypress(e, s) {
|
|
1250
|
+
if (this._track && "return" !== s.name && (s.name && this._isActionKey(e, s) && this.rl?.write(null, {
|
|
1251
|
+
ctrl: !0,
|
|
1252
|
+
name: "h"
|
|
1253
|
+
}), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), "error" === this.state && (this.state = "active"), s?.name && (!this._track && dist_.aliases.has(s.name) && this.emit("cursor", dist_.aliases.get(s.name)), dist_.actions.has(s.name) && this.emit("cursor", s.name)), e && ("y" === e.toLowerCase() || "n" === e.toLowerCase()) && this.emit("confirm", "y" === e.toLowerCase()), this.emit("key", e?.toLowerCase(), s), s?.name === "return") {
|
|
1490
1254
|
if (this.opts.validate) {
|
|
1491
|
-
const
|
|
1492
|
-
|
|
1255
|
+
const i = this.opts.validate(this.value);
|
|
1256
|
+
i && (this.error = i instanceof Error ? i.message : i, this.state = "error", this.rl?.write(this.userInput));
|
|
1493
1257
|
}
|
|
1494
1258
|
"error" !== this.state && (this.state = "submit");
|
|
1495
1259
|
}
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1260
|
+
H([
|
|
1261
|
+
e,
|
|
1262
|
+
s?.name,
|
|
1263
|
+
s?.sequence
|
|
1500
1264
|
], "cancel") && (this.state = "cancel"), ("submit" === this.state || "cancel" === this.state) && this.emit("finalize"), this.render(), ("submit" === this.state || "cancel" === this.state) && this.close();
|
|
1501
1265
|
}
|
|
1502
1266
|
close() {
|
|
1503
1267
|
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
|
|
1504
|
-
`),
|
|
1268
|
+
`), W(this.input, !1), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
1505
1269
|
}
|
|
1506
1270
|
restoreCursor() {
|
|
1507
|
-
const
|
|
1508
|
-
hard: !0
|
|
1271
|
+
const e = K(this._prevFrame, process.stdout.columns, {
|
|
1272
|
+
hard: !0,
|
|
1273
|
+
trim: !1
|
|
1509
1274
|
}).split(`
|
|
1510
1275
|
`).length - 1;
|
|
1511
|
-
this.output.write(src.cursor.move(-999, -1 *
|
|
1276
|
+
this.output.write(src.cursor.move(-999, -1 * e));
|
|
1512
1277
|
}
|
|
1513
1278
|
render() {
|
|
1514
|
-
const
|
|
1515
|
-
hard: !0
|
|
1279
|
+
const e = K(this._render(this) ?? "", process.stdout.columns, {
|
|
1280
|
+
hard: !0,
|
|
1281
|
+
trim: !1
|
|
1516
1282
|
});
|
|
1517
|
-
if (
|
|
1283
|
+
if (e !== this._prevFrame) {
|
|
1518
1284
|
if ("initial" === this.state) this.output.write(src.cursor.hide);
|
|
1519
1285
|
else {
|
|
1520
|
-
const
|
|
1521
|
-
if (this.restoreCursor(),
|
|
1522
|
-
const
|
|
1523
|
-
|
|
1524
|
-
|
|
1286
|
+
const s = _t(this._prevFrame, e), i = nt(this.output);
|
|
1287
|
+
if (this.restoreCursor(), s) {
|
|
1288
|
+
const r = Math.max(0, s.numLinesAfter - i), n = Math.max(0, s.numLinesBefore - i);
|
|
1289
|
+
let u = s.lines.find((a)=>a >= r);
|
|
1290
|
+
if (void 0 === u) {
|
|
1291
|
+
this._prevFrame = e;
|
|
1292
|
+
return;
|
|
1293
|
+
}
|
|
1294
|
+
if (1 === s.lines.length) {
|
|
1295
|
+
this.output.write(src.cursor.move(0, u - n)), this.output.write(src.erase.lines(1));
|
|
1296
|
+
const a = e.split(`
|
|
1525
1297
|
`);
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1298
|
+
this.output.write(a[u]), this._prevFrame = e, this.output.write(src.cursor.move(0, a.length - u - 1));
|
|
1299
|
+
return;
|
|
1300
|
+
}
|
|
1301
|
+
if (s.lines.length > 1) {
|
|
1302
|
+
if (r < n) u = r;
|
|
1303
|
+
else {
|
|
1304
|
+
const l = u - n;
|
|
1305
|
+
l > 0 && this.output.write(src.cursor.move(0, l));
|
|
1306
|
+
}
|
|
1307
|
+
this.output.write(src.erase.down());
|
|
1308
|
+
const a = e.split(`
|
|
1309
|
+
`).slice(u);
|
|
1310
|
+
this.output.write(a.join(`
|
|
1311
|
+
`)), this._prevFrame = e;
|
|
1312
|
+
return;
|
|
1313
|
+
}
|
|
1537
1314
|
}
|
|
1538
1315
|
this.output.write(src.erase.down());
|
|
1539
1316
|
}
|
|
1540
|
-
this.output.write(
|
|
1317
|
+
this.output.write(e), "initial" === this.state && (this.state = "active"), this._prevFrame = e;
|
|
1541
1318
|
}
|
|
1542
1319
|
}
|
|
1543
1320
|
}
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1321
|
+
let Lt = class extends dist_B {
|
|
1322
|
+
options;
|
|
1323
|
+
cursor = 0;
|
|
1324
|
+
get _value() {
|
|
1325
|
+
return this.options[this.cursor].value;
|
|
1326
|
+
}
|
|
1327
|
+
get _enabledOptions() {
|
|
1328
|
+
return this.options.filter((e)=>!0 !== e.disabled);
|
|
1329
|
+
}
|
|
1330
|
+
toggleAll() {
|
|
1331
|
+
const e = this._enabledOptions, s = void 0 !== this.value && this.value.length === e.length;
|
|
1332
|
+
this.value = s ? [] : e.map((i)=>i.value);
|
|
1333
|
+
}
|
|
1334
|
+
toggleInvert() {
|
|
1335
|
+
const e = this.value;
|
|
1336
|
+
if (!e) return;
|
|
1337
|
+
const s = this._enabledOptions.filter((i)=>!e.includes(i.value));
|
|
1338
|
+
this.value = s.map((i)=>i.value);
|
|
1339
|
+
}
|
|
1340
|
+
toggleValue() {
|
|
1341
|
+
void 0 === this.value && (this.value = []);
|
|
1342
|
+
const e = this.value.includes(this._value);
|
|
1343
|
+
this.value = e ? this.value.filter((s)=>s !== this._value) : [
|
|
1344
|
+
...this.value,
|
|
1345
|
+
this._value
|
|
1346
|
+
];
|
|
1347
|
+
}
|
|
1348
|
+
constructor(e){
|
|
1349
|
+
super(e, !1), this.options = e.options, this.value = [
|
|
1350
|
+
...e.initialValues ?? []
|
|
1351
|
+
];
|
|
1352
|
+
const s = Math.max(this.options.findIndex(({ value: i })=>i === e.cursorAt), 0);
|
|
1353
|
+
this.cursor = this.options[s].disabled ? x(s, 1, this.options) : s, this.on("key", (i)=>{
|
|
1354
|
+
"a" === i && this.toggleAll(), "i" === i && this.toggleInvert();
|
|
1355
|
+
}), this.on("cursor", (i)=>{
|
|
1356
|
+
switch(i){
|
|
1559
1357
|
case "left":
|
|
1560
1358
|
case "up":
|
|
1561
|
-
this.cursor =
|
|
1359
|
+
this.cursor = x(this.cursor, -1, this.options);
|
|
1562
1360
|
break;
|
|
1563
1361
|
case "down":
|
|
1564
1362
|
case "right":
|
|
1565
|
-
this.cursor = this.cursor
|
|
1363
|
+
this.cursor = x(this.cursor, 1, this.options);
|
|
1566
1364
|
break;
|
|
1567
1365
|
case "space":
|
|
1568
1366
|
this.toggleValue();
|
|
@@ -1570,253 +1368,542 @@ let SD = class extends x {
|
|
|
1570
1368
|
}
|
|
1571
1369
|
});
|
|
1572
1370
|
}
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
this.
|
|
1371
|
+
};
|
|
1372
|
+
class Tt extends dist_B {
|
|
1373
|
+
options;
|
|
1374
|
+
cursor = 0;
|
|
1375
|
+
get _selectedValue() {
|
|
1376
|
+
return this.options[this.cursor];
|
|
1579
1377
|
}
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
this.value = u ? this.value.filter((t)=>t !== this._value) : [
|
|
1583
|
-
...this.value,
|
|
1584
|
-
this._value
|
|
1585
|
-
];
|
|
1378
|
+
changeValue() {
|
|
1379
|
+
this.value = this._selectedValue.value;
|
|
1586
1380
|
}
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
value: t
|
|
1593
|
-
}) : e[u] = t, J = (e, u, t)=>(PD(e, "symbol" != typeof u ? u + "" : u, t), t);
|
|
1594
|
-
class LD extends x {
|
|
1595
|
-
constructor(u){
|
|
1596
|
-
super(u, !1), J(this, "options"), J(this, "cursor", 0), this.options = u.options, this.cursor = this.options.findIndex(({ value: t })=>t === u.initialValue), -1 === this.cursor && (this.cursor = 0), this.changeValue(), this.on("cursor", (t)=>{
|
|
1597
|
-
switch(t){
|
|
1381
|
+
constructor(e){
|
|
1382
|
+
super(e, !1), this.options = e.options;
|
|
1383
|
+
const s = this.options.findIndex(({ value: r })=>r === e.initialValue), i = -1 === s ? 0 : s;
|
|
1384
|
+
this.cursor = this.options[i].disabled ? x(i, 1, this.options) : i, this.changeValue(), this.on("cursor", (r)=>{
|
|
1385
|
+
switch(r){
|
|
1598
1386
|
case "left":
|
|
1599
1387
|
case "up":
|
|
1600
|
-
this.cursor =
|
|
1388
|
+
this.cursor = x(this.cursor, -1, this.options);
|
|
1601
1389
|
break;
|
|
1602
1390
|
case "down":
|
|
1603
1391
|
case "right":
|
|
1604
|
-
this.cursor = this.cursor
|
|
1392
|
+
this.cursor = x(this.cursor, 1, this.options);
|
|
1605
1393
|
break;
|
|
1606
1394
|
}
|
|
1607
1395
|
this.changeValue();
|
|
1608
1396
|
});
|
|
1609
1397
|
}
|
|
1610
|
-
get _value() {
|
|
1611
|
-
return this.options[this.cursor];
|
|
1612
|
-
}
|
|
1613
|
-
changeValue() {
|
|
1614
|
-
this.value = this._value.value;
|
|
1615
|
-
}
|
|
1616
1398
|
}
|
|
1617
|
-
class
|
|
1618
|
-
get
|
|
1619
|
-
if ("submit" === this.state) return this.
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1399
|
+
class dist_$t extends dist_B {
|
|
1400
|
+
get userInputWithCursor() {
|
|
1401
|
+
if ("submit" === this.state) return this.userInput;
|
|
1402
|
+
const e = this.userInput;
|
|
1403
|
+
if (this.cursor >= e.length) return `${this.userInput}\u2588`;
|
|
1404
|
+
const s = e.slice(0, this.cursor), [i, ...r] = e.slice(this.cursor);
|
|
1405
|
+
return `${s}${styleText("inverse", i)}${r.join("")}`;
|
|
1623
1406
|
}
|
|
1624
1407
|
get cursor() {
|
|
1625
1408
|
return this._cursor;
|
|
1626
1409
|
}
|
|
1627
|
-
constructor(
|
|
1628
|
-
super(
|
|
1629
|
-
|
|
1410
|
+
constructor(e){
|
|
1411
|
+
super({
|
|
1412
|
+
...e,
|
|
1413
|
+
initialUserInput: e.initialUserInput ?? e.initialValue
|
|
1414
|
+
}), this.on("userInput", (s)=>{
|
|
1415
|
+
this._setValue(s);
|
|
1416
|
+
}), this.on("finalize", ()=>{
|
|
1417
|
+
this.value || (this.value = e.defaultValue), void 0 === this.value && (this.value = "");
|
|
1630
1418
|
});
|
|
1631
1419
|
}
|
|
1632
1420
|
}
|
|
1633
|
-
|
|
1421
|
+
const external_node_fs_ = __webpack_require__("node:fs");
|
|
1422
|
+
function dist_pt() {
|
|
1634
1423
|
return "win32" !== node_process.platform ? "linux" !== node_process.env.TERM : !!node_process.env.CI || !!node_process.env.WT_SESSION || !!node_process.env.TERMINUS_SUBLIME || "{cmd::Cmder}" === node_process.env.ConEmuTask || "Terminus-Sublime" === node_process.env.TERM_PROGRAM || "vscode" === node_process.env.TERM_PROGRAM || "xterm-256color" === node_process.env.TERM || "alacritty" === node_process.env.TERM || "JetBrains-JediTerm" === node_process.env.TERMINAL_EMULATOR;
|
|
1635
1424
|
}
|
|
1636
|
-
const
|
|
1637
|
-
switch(
|
|
1425
|
+
const ee = dist_pt(), dist_I = (e, r)=>ee ? e : r, Re = dist_I("\u25C6", "*"), $e = dist_I("\u25A0", "x"), de = dist_I("\u25B2", "x"), dist_V = dist_I("\u25C7", "o"), dist_h = (dist_I("\u250C", "T"), dist_I("\u2502", "|")), dist_x = dist_I("\u2514", "\u2014"), dist_z = (dist_I("\u2510", "T"), dist_I("\u2518", "\u2014"), dist_I("\u25CF", ">")), dist_H = dist_I("\u25CB", " "), te = dist_I("\u25FB", "[\u2022]"), dist_U = dist_I("\u25FC", "[+]"), dist_q = dist_I("\u25FB", "[ ]"), se = (dist_I("\u25AA", "\u2022"), dist_I("\u2500", "-")), pe = dist_I("\u256E", "+"), We = dist_I("\u251C", "+"), me = dist_I("\u256F", "+"), ge = dist_I("\u2570", "+"), dist_W = (dist_I("\u256D", "+"), dist_I("\u25CF", "\u2022"), dist_I("\u25C6", "*"), dist_I("\u25B2", "!"), dist_I("\u25A0", "x"), (e)=>{
|
|
1426
|
+
switch(e){
|
|
1638
1427
|
case "initial":
|
|
1639
1428
|
case "active":
|
|
1640
|
-
return
|
|
1429
|
+
return styleText("cyan", Re);
|
|
1641
1430
|
case "cancel":
|
|
1642
|
-
return
|
|
1431
|
+
return styleText("red", $e);
|
|
1643
1432
|
case "error":
|
|
1644
|
-
return
|
|
1433
|
+
return styleText("yellow", de);
|
|
1645
1434
|
case "submit":
|
|
1646
|
-
return
|
|
1435
|
+
return styleText("green", dist_V);
|
|
1647
1436
|
}
|
|
1648
|
-
}),
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1437
|
+
}), ve = (e)=>{
|
|
1438
|
+
switch(e){
|
|
1439
|
+
case "initial":
|
|
1440
|
+
case "active":
|
|
1441
|
+
return styleText("cyan", dist_h);
|
|
1442
|
+
case "cancel":
|
|
1443
|
+
return styleText("red", dist_h);
|
|
1444
|
+
case "error":
|
|
1445
|
+
return styleText("yellow", dist_h);
|
|
1446
|
+
case "submit":
|
|
1447
|
+
return styleText("green", dist_h);
|
|
1448
|
+
}
|
|
1449
|
+
}, dist_mt = (e)=>161 === e || 164 === e || 167 === e || 168 === e || 170 === e || 173 === e || 174 === e || e >= 176 && e <= 180 || e >= 182 && e <= 186 || e >= 188 && e <= 191 || 198 === e || 208 === e || 215 === e || 216 === e || e >= 222 && e <= 225 || 230 === e || e >= 232 && e <= 234 || 236 === e || 237 === e || 240 === e || 242 === e || 243 === e || e >= 247 && e <= 250 || 252 === e || 254 === e || 257 === e || 273 === e || 275 === e || 283 === e || 294 === e || 295 === e || 299 === e || e >= 305 && e <= 307 || 312 === e || e >= 319 && e <= 322 || 324 === e || e >= 328 && e <= 331 || 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 || e >= 713 && e <= 715 || 717 === e || 720 === e || e >= 728 && e <= 731 || 733 === e || 735 === e || e >= 768 && e <= 879 || e >= 913 && e <= 929 || e >= 931 && e <= 937 || e >= 945 && e <= 961 || e >= 963 && e <= 969 || 1025 === e || e >= 1040 && e <= 1103 || 1105 === e || 8208 === e || e >= 8211 && e <= 8214 || 8216 === e || 8217 === e || 8220 === e || 8221 === e || e >= 8224 && e <= 8226 || e >= 8228 && e <= 8231 || 8240 === e || 8242 === e || 8243 === e || 8245 === e || 8251 === e || 8254 === e || 8308 === e || 8319 === e || e >= 8321 && e <= 8324 || 8364 === e || 8451 === e || 8453 === e || 8457 === e || 8467 === e || 8470 === e || 8481 === e || 8482 === e || 8486 === e || 8491 === e || 8531 === e || 8532 === e || e >= 8539 && e <= 8542 || e >= 8544 && e <= 8555 || e >= 8560 && e <= 8569 || 8585 === e || e >= 8592 && e <= 8601 || 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 || e >= 8733 && e <= 8736 || 8739 === e || 8741 === e || e >= 8743 && e <= 8748 || 8750 === e || e >= 8756 && e <= 8759 || 8764 === e || 8765 === e || 8776 === e || 8780 === e || 8786 === e || 8800 === e || 8801 === e || e >= 8804 && e <= 8807 || 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 || e >= 9312 && e <= 9449 || e >= 9451 && e <= 9547 || e >= 9552 && e <= 9587 || e >= 9600 && e <= 9615 || e >= 9618 && e <= 9621 || 9632 === e || 9633 === e || e >= 9635 && e <= 9641 || 9650 === e || 9651 === e || 9654 === e || 9655 === e || 9660 === e || 9661 === e || 9664 === e || 9665 === e || e >= 9670 && e <= 9672 || 9675 === e || e >= 9678 && e <= 9681 || e >= 9698 && e <= 9701 || 9711 === e || 9733 === e || 9734 === e || 9737 === e || 9742 === e || 9743 === e || 9756 === e || 9758 === e || 9792 === e || 9794 === e || 9824 === e || 9825 === e || e >= 9827 && e <= 9829 || e >= 9831 && e <= 9834 || 9836 === e || 9837 === e || 9839 === e || 9886 === e || 9887 === e || 9919 === e || e >= 9926 && e <= 9933 || e >= 9935 && e <= 9939 || e >= 9941 && e <= 9953 || 9955 === e || 9960 === e || 9961 === e || e >= 9963 && e <= 9969 || 9972 === e || e >= 9974 && e <= 9977 || 9979 === e || 9980 === e || 9982 === e || 9983 === e || 10045 === e || e >= 10102 && e <= 10111 || e >= 11094 && e <= 11097 || e >= 12872 && e <= 12879 || e >= 57344 && e <= 63743 || e >= 65024 && e <= 65039 || 65533 === e || e >= 127232 && e <= 127242 || e >= 127248 && e <= 127277 || e >= 127280 && e <= 127337 || e >= 127344 && e <= 127373 || 127375 === e || 127376 === e || e >= 127387 && e <= 127404 || e >= 917760 && e <= 917999 || e >= 983040 && e <= 1048573 || e >= 1048576 && e <= 1114109, dist_gt = (e)=>12288 === e || e >= 65281 && e <= 65376 || e >= 65504 && e <= 65510, dist_ft = (e)=>e >= 4352 && e <= 4447 || 8986 === e || 8987 === e || 9001 === e || 9002 === e || e >= 9193 && e <= 9196 || 9200 === e || 9203 === e || 9725 === e || 9726 === e || 9748 === e || 9749 === e || e >= 9800 && e <= 9811 || 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 || e >= 10067 && e <= 10069 || 10071 === e || e >= 10133 && e <= 10135 || 10160 === e || 10175 === e || 11035 === e || 11036 === e || 11088 === e || 11093 === e || 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 || 94192 === e || 94193 === e || e >= 94208 && e <= 100343 || e >= 100352 && e <= 101589 || e >= 101632 && e <= 101640 || e >= 110576 && e <= 110579 || e >= 110581 && e <= 110587 || 110589 === e || 110590 === e || e >= 110592 && e <= 110882 || 110898 === e || e >= 110928 && e <= 110930 || 110933 === e || e >= 110948 && e <= 110951 || e >= 110960 && e <= 111355 || 126980 === e || 127183 === e || 127374 === e || e >= 127377 && e <= 127386 || e >= 127488 && e <= 127490 || e >= 127504 && e <= 127547 || e >= 127552 && e <= 127560 || 127568 === e || 127569 === e || 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 || 127988 === e || e >= 127992 && e <= 128062 || 128064 === e || e >= 128066 && e <= 128252 || e >= 128255 && e <= 128317 || e >= 128331 && e <= 128334 || e >= 128336 && e <= 128359 || 128378 === e || 128405 === e || 128406 === e || 128420 === e || e >= 128507 && e <= 128591 || e >= 128640 && e <= 128709 || 128716 === e || e >= 128720 && e <= 128722 || e >= 128725 && e <= 128727 || e >= 128732 && e <= 128735 || 128747 === e || 128748 === e || e >= 128756 && e <= 128764 || e >= 128992 && e <= 129003 || 129008 === e || 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, we = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y, re = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y, ie = /\t{1,1000}/y, 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, ne = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y, dist_Ft = /\p{M}+/gu, dist_yt = {
|
|
1450
|
+
limit: 1 / 0,
|
|
1451
|
+
ellipsis: ""
|
|
1452
|
+
}, Le = (e, r = {}, s = {})=>{
|
|
1453
|
+
const i = r.limit ?? 1 / 0, a = r.ellipsis ?? "", o = r?.ellipsisWidth ?? (a ? Le(a, dist_yt, s).width : 0), u = s.ansiWidth ?? 0, l = s.controlWidth ?? 0, n = s.tabWidth ?? 8, c = s.ambiguousWidth ?? 1, p = s.emojiWidth ?? 2, f = s.fullWidthWidth ?? 2, g = s.regularWidth ?? 1, E = s.wideWidth ?? 2;
|
|
1454
|
+
let $ = 0, m = 0, d = e.length, F = 0, y = !1, v = d, C = Math.max(0, i - o), A = 0, b = 0, w = 0, S = 0;
|
|
1455
|
+
e: for(;;){
|
|
1456
|
+
if (b > A || m >= d && m > $) {
|
|
1457
|
+
const T = e.slice(A, b) || e.slice($, m);
|
|
1458
|
+
F = 0;
|
|
1459
|
+
for (const M of T.replaceAll(dist_Ft, "")){
|
|
1460
|
+
const O = M.codePointAt(0) || 0;
|
|
1461
|
+
if (dist_gt(O) ? S = f : dist_ft(O) ? S = E : c !== g && dist_mt(O) ? S = c : S = g, w + S > C && (v = Math.min(v, Math.max(A, $) + F)), w + S > i) {
|
|
1462
|
+
y = !0;
|
|
1463
|
+
break e;
|
|
1464
|
+
}
|
|
1465
|
+
F += M.length, w += S;
|
|
1466
|
+
}
|
|
1467
|
+
A = b = 0;
|
|
1468
|
+
}
|
|
1469
|
+
if (m >= d) break;
|
|
1470
|
+
if (ne.lastIndex = m, ne.test(e)) {
|
|
1471
|
+
if (F = ne.lastIndex - m, S = F * g, w + S > C && (v = Math.min(v, m + Math.floor((C - w) / g))), w + S > i) {
|
|
1472
|
+
y = !0;
|
|
1473
|
+
break;
|
|
1474
|
+
}
|
|
1475
|
+
w += S, A = $, b = m, m = $ = ne.lastIndex;
|
|
1476
|
+
continue;
|
|
1477
|
+
}
|
|
1478
|
+
if (we.lastIndex = m, we.test(e)) {
|
|
1479
|
+
if (w + u > C && (v = Math.min(v, m)), w + u > i) {
|
|
1480
|
+
y = !0;
|
|
1481
|
+
break;
|
|
1482
|
+
}
|
|
1483
|
+
w += u, A = $, b = m, m = $ = we.lastIndex;
|
|
1484
|
+
continue;
|
|
1485
|
+
}
|
|
1486
|
+
if (re.lastIndex = m, re.test(e)) {
|
|
1487
|
+
if (F = re.lastIndex - m, S = F * l, w + S > C && (v = Math.min(v, m + Math.floor((C - w) / l))), w + S > i) {
|
|
1488
|
+
y = !0;
|
|
1489
|
+
break;
|
|
1490
|
+
}
|
|
1491
|
+
w += S, A = $, b = m, m = $ = re.lastIndex;
|
|
1492
|
+
continue;
|
|
1493
|
+
}
|
|
1494
|
+
if (ie.lastIndex = m, ie.test(e)) {
|
|
1495
|
+
if (F = ie.lastIndex - m, S = F * n, w + S > C && (v = Math.min(v, m + Math.floor((C - w) / n))), w + S > i) {
|
|
1496
|
+
y = !0;
|
|
1497
|
+
break;
|
|
1498
|
+
}
|
|
1499
|
+
w += S, A = $, b = m, m = $ = ie.lastIndex;
|
|
1500
|
+
continue;
|
|
1501
|
+
}
|
|
1502
|
+
if (Ae.lastIndex = m, Ae.test(e)) {
|
|
1503
|
+
if (w + p > C && (v = Math.min(v, m)), w + p > i) {
|
|
1504
|
+
y = !0;
|
|
1505
|
+
break;
|
|
1506
|
+
}
|
|
1507
|
+
w += p, A = $, b = m, m = $ = Ae.lastIndex;
|
|
1508
|
+
continue;
|
|
1509
|
+
}
|
|
1510
|
+
m += 1;
|
|
1511
|
+
}
|
|
1512
|
+
return {
|
|
1513
|
+
width: y ? C : w,
|
|
1514
|
+
index: y ? v : d,
|
|
1515
|
+
truncated: y,
|
|
1516
|
+
ellipsed: y && i >= o
|
|
1517
|
+
};
|
|
1518
|
+
}, dist_Et = {
|
|
1519
|
+
limit: 1 / 0,
|
|
1520
|
+
ellipsis: "",
|
|
1521
|
+
ellipsisWidth: 0
|
|
1522
|
+
}, D = (e, r = {})=>Le(e, dist_Et, r).width, ae = "\x1B", je = "\x9B", dist_vt = 39, Ce = "\x07", ke = "[", dist_wt = "]", Ve = "m", Se = `${dist_wt}8;;`, He = new RegExp(`(?:\\${ke}(?<code>\\d+)m|\\${Se}(?<uri>.*)${Ce})`, "y"), dist_At = (e)=>{
|
|
1523
|
+
if (e >= 30 && e <= 37 || e >= 90 && e <= 97) return 39;
|
|
1524
|
+
if (e >= 40 && e <= 47 || e >= 100 && e <= 107) return 49;
|
|
1525
|
+
if (1 === e || 2 === e) return 22;
|
|
1526
|
+
if (3 === e) return 23;
|
|
1527
|
+
if (4 === e) return 24;
|
|
1528
|
+
if (7 === e) return 27;
|
|
1529
|
+
if (8 === e) return 28;
|
|
1530
|
+
if (9 === e) return 29;
|
|
1531
|
+
if (0 === e) return 0;
|
|
1532
|
+
}, Ue = (e)=>`${ae}${ke}${e}${Ve}`, Ke = (e)=>`${ae}${Se}${e}${Ce}`, dist_Ct = (e)=>e.map((r)=>D(r)), Ie = (e, r, s)=>{
|
|
1533
|
+
const i = r[Symbol.iterator]();
|
|
1534
|
+
let a = !1, o = !1, u = e.at(-1), l = void 0 === u ? 0 : D(u), n = i.next(), c = i.next(), p = 0;
|
|
1535
|
+
for(; !n.done;){
|
|
1536
|
+
const f = n.value, g = D(f);
|
|
1537
|
+
l + g <= s ? e[e.length - 1] += f : (e.push(f), l = 0), (f === ae || f === je) && (a = !0, o = r.startsWith(Se, p + 1)), a ? o ? f === Ce && (a = !1, o = !1) : f === Ve && (a = !1) : (l += g, l !== s || c.done || (e.push(""), l = 0)), n = c, c = i.next(), p += f.length;
|
|
1538
|
+
}
|
|
1539
|
+
u = e.at(-1), !l && void 0 !== u && u.length > 0 && e.length > 1 && (e[e.length - 2] += e.pop());
|
|
1540
|
+
}, dist_St = (e)=>{
|
|
1541
|
+
const r = e.split(" ");
|
|
1542
|
+
let s = r.length;
|
|
1543
|
+
for(; s > 0 && !(D(r[s - 1]) > 0);)s--;
|
|
1544
|
+
return s === r.length ? e : r.slice(0, s).join(" ") + r.slice(s).join("");
|
|
1545
|
+
}, dist_It = (e, r, s = {})=>{
|
|
1546
|
+
if (!1 !== s.trim && "" === e.trim()) return "";
|
|
1547
|
+
let i = "", a, o;
|
|
1548
|
+
const u = e.split(" "), l = dist_Ct(u);
|
|
1549
|
+
let n = [
|
|
1550
|
+
""
|
|
1551
|
+
];
|
|
1552
|
+
for (const [$, m] of u.entries()){
|
|
1553
|
+
!1 !== s.trim && (n[n.length - 1] = (n.at(-1) ?? "").trimStart());
|
|
1554
|
+
let d = D(n.at(-1) ?? "");
|
|
1555
|
+
if (0 !== $ && (d >= r && (!1 === s.wordWrap || !1 === s.trim) && (n.push(""), d = 0), (d > 0 || !1 === s.trim) && (n[n.length - 1] += " ", d++)), s.hard && l[$] > r) {
|
|
1556
|
+
const F = r - d, y = 1 + Math.floor((l[$] - F - 1) / r);
|
|
1557
|
+
Math.floor((l[$] - 1) / r) < y && n.push(""), Ie(n, m, r);
|
|
1558
|
+
continue;
|
|
1559
|
+
}
|
|
1560
|
+
if (d + l[$] > r && d > 0 && l[$] > 0) {
|
|
1561
|
+
if (!1 === s.wordWrap && d < r) {
|
|
1562
|
+
Ie(n, m, r);
|
|
1563
|
+
continue;
|
|
1564
|
+
}
|
|
1565
|
+
n.push("");
|
|
1566
|
+
}
|
|
1567
|
+
if (d + l[$] > r && !1 === s.wordWrap) {
|
|
1568
|
+
Ie(n, m, r);
|
|
1569
|
+
continue;
|
|
1570
|
+
}
|
|
1571
|
+
n[n.length - 1] += m;
|
|
1572
|
+
}
|
|
1573
|
+
!1 !== s.trim && (n = n.map(($)=>dist_St($)));
|
|
1574
|
+
const c = n.join(`
|
|
1575
|
+
`), p = c[Symbol.iterator]();
|
|
1576
|
+
let f = p.next(), g = p.next(), E = 0;
|
|
1577
|
+
for(; !f.done;){
|
|
1578
|
+
const $ = f.value, m = g.value;
|
|
1579
|
+
if (i += $, $ === ae || $ === je) {
|
|
1580
|
+
He.lastIndex = E + 1;
|
|
1581
|
+
const y = He.exec(c)?.groups;
|
|
1582
|
+
if (y?.code !== void 0) {
|
|
1583
|
+
const v = Number.parseFloat(y.code);
|
|
1584
|
+
a = v === dist_vt ? void 0 : v;
|
|
1585
|
+
} else y?.uri !== void 0 && (o = 0 === y.uri.length ? void 0 : y.uri);
|
|
1586
|
+
}
|
|
1587
|
+
const d = a ? dist_At(a) : void 0;
|
|
1588
|
+
m === `
|
|
1589
|
+
` ? (o && (i += Ke("")), a && d && (i += Ue(d))) : $ === `
|
|
1590
|
+
` && (a && d && (i += Ue(a)), o && (i += Ke(o))), E += $.length, f = g, g = p.next();
|
|
1591
|
+
}
|
|
1592
|
+
return i;
|
|
1593
|
+
};
|
|
1594
|
+
function dist_J(e, r, s) {
|
|
1595
|
+
return String(e).normalize().replaceAll(`\r
|
|
1596
|
+
`, `
|
|
1597
|
+
`).split(`
|
|
1598
|
+
`).map((i)=>dist_It(i, r, s)).join(`
|
|
1599
|
+
`);
|
|
1600
|
+
}
|
|
1601
|
+
const dist_bt = (e, r, s, i, a)=>{
|
|
1602
|
+
let o = r, u = 0;
|
|
1603
|
+
for(let l = s; l < i; l++){
|
|
1604
|
+
const n = e[l];
|
|
1605
|
+
if (o -= n.length, u++, o <= a) break;
|
|
1606
|
+
}
|
|
1607
|
+
return {
|
|
1608
|
+
lineCount: o,
|
|
1609
|
+
removals: u
|
|
1610
|
+
};
|
|
1611
|
+
}, dist_X = ({ cursor: e, options: r, style: s, output: i = process.stdout, maxItems: a = 1 / 0, columnPadding: o = 0, rowPadding: u = 4 })=>{
|
|
1612
|
+
const l = dist_rt(i) - o, n = nt(i), c = styleText("dim", "..."), p = Math.max(n - u, 0), f = Math.max(Math.min(a, p), 5);
|
|
1613
|
+
let g = 0;
|
|
1614
|
+
e >= f - 3 && (g = Math.max(Math.min(e - f + 3, r.length - f), 0));
|
|
1615
|
+
let E = f < r.length && g > 0, $ = f < r.length && g + f < r.length;
|
|
1616
|
+
const m = Math.min(g + f, r.length), d = [];
|
|
1617
|
+
let F = 0;
|
|
1618
|
+
E && F++, $ && F++;
|
|
1619
|
+
const y = g + (E ? 1 : 0), v = m - ($ ? 1 : 0);
|
|
1620
|
+
for(let A = y; A < v; A++){
|
|
1621
|
+
const b = dist_J(s(r[A], A === e), l, {
|
|
1622
|
+
hard: !0,
|
|
1623
|
+
trim: !1
|
|
1624
|
+
}).split(`
|
|
1625
|
+
`);
|
|
1626
|
+
d.push(b), F += b.length;
|
|
1627
|
+
}
|
|
1628
|
+
if (F > p) {
|
|
1629
|
+
let A = 0, b = 0, w = F;
|
|
1630
|
+
const S = e - y, T = (M, O)=>dist_bt(d, w, M, O, p);
|
|
1631
|
+
E ? ({ lineCount: w, removals: A } = T(0, S), w > p && ({ lineCount: w, removals: b } = T(S + 1, d.length))) : ({ lineCount: w, removals: b } = T(S + 1, d.length), w > p && ({ lineCount: w, removals: A } = T(0, S))), A > 0 && (E = !0, d.splice(0, A)), b > 0 && ($ = !0, d.splice(d.length - b, b));
|
|
1632
|
+
}
|
|
1633
|
+
const C = [];
|
|
1634
|
+
E && C.push(c);
|
|
1635
|
+
for (const A of d)for (const b of A)C.push(b);
|
|
1636
|
+
return $ && C.push(c), C;
|
|
1637
|
+
};
|
|
1638
|
+
const Nt = (e = "", r)=>{
|
|
1639
|
+
const s = r?.output ?? process.stdout, i = r?.withGuide ?? dist_.withGuide ? `${styleText("gray", dist_x)} ` : "";
|
|
1640
|
+
s.write(`${i}${styleText("red", e)}
|
|
1641
|
+
|
|
1642
|
+
`);
|
|
1643
|
+
}, Gt = (e = "", r)=>{
|
|
1644
|
+
const s = r?.output ?? process.stdout, i = r?.withGuide ?? dist_.withGuide ? `${styleText("gray", dist_h)}
|
|
1645
|
+
${styleText("gray", dist_x)} ` : "";
|
|
1646
|
+
s.write(`${i}${e}
|
|
1647
|
+
|
|
1648
|
+
`);
|
|
1649
|
+
}, dist_Q = (e, r)=>e.split(`
|
|
1650
|
+
`).map((s)=>r(s)).join(`
|
|
1651
|
+
`), dist_Lt = (e)=>{
|
|
1652
|
+
const r = (i, a)=>{
|
|
1653
|
+
const o = i.label ?? String(i.value);
|
|
1654
|
+
return "disabled" === a ? `${styleText("gray", dist_q)} ${dist_Q(o, (u)=>styleText([
|
|
1655
|
+
"strikethrough",
|
|
1656
|
+
"gray"
|
|
1657
|
+
], u))}${i.hint ? ` ${styleText("dim", `(${i.hint ?? "disabled"})`)}` : ""}` : "active" === a ? `${styleText("cyan", te)} ${o}${i.hint ? ` ${styleText("dim", `(${i.hint})`)}` : ""}` : "selected" === a ? `${styleText("green", dist_U)} ${dist_Q(o, (u)=>styleText("dim", u))}${i.hint ? ` ${styleText("dim", `(${i.hint})`)}` : ""}` : "cancelled" === a ? `${dist_Q(o, (u)=>styleText([
|
|
1658
|
+
"strikethrough",
|
|
1659
|
+
"dim"
|
|
1660
|
+
], u))}` : "active-selected" === a ? `${styleText("green", dist_U)} ${o}${i.hint ? ` ${styleText("dim", `(${i.hint})`)}` : ""}` : "submitted" === a ? `${dist_Q(o, (u)=>styleText("dim", u))}` : `${styleText("dim", dist_q)} ${dist_Q(o, (u)=>styleText("dim", u))}`;
|
|
1661
|
+
}, s = e.required ?? !0;
|
|
1662
|
+
return new Lt({
|
|
1663
|
+
options: e.options,
|
|
1664
|
+
signal: e.signal,
|
|
1665
|
+
input: e.input,
|
|
1666
|
+
output: e.output,
|
|
1667
|
+
initialValues: e.initialValues,
|
|
1668
|
+
required: s,
|
|
1669
|
+
cursorAt: e.cursorAt,
|
|
1670
|
+
validate (i) {
|
|
1671
|
+
if (s && (void 0 === i || 0 === i.length)) return `Please select at least one option.
|
|
1672
|
+
${styleText("reset", styleText("dim", `Press ${styleText([
|
|
1673
|
+
"gray",
|
|
1674
|
+
"bgWhite",
|
|
1675
|
+
"inverse"
|
|
1676
|
+
], " space ")} to select, ${styleText("gray", styleText("bgWhite", styleText("inverse", " enter ")))} to submit`))}`;
|
|
1677
|
+
},
|
|
1662
1678
|
render () {
|
|
1663
|
-
const
|
|
1664
|
-
${
|
|
1665
|
-
`,
|
|
1679
|
+
const i = Bt(e.output, e.message, `${ve(this.state)} `, `${dist_W(this.state)} `), a = `${styleText("gray", dist_h)}
|
|
1680
|
+
${i}
|
|
1681
|
+
`, o = this.value ?? [], u = (l, n)=>{
|
|
1682
|
+
if (l.disabled) return r(l, "disabled");
|
|
1683
|
+
const c = o.includes(l.value);
|
|
1684
|
+
return n && c ? r(l, "active-selected") : c ? r(l, "selected") : r(l, n ? "active" : "inactive");
|
|
1685
|
+
};
|
|
1666
1686
|
switch(this.state){
|
|
1667
|
-
case "error":
|
|
1668
|
-
return `${n.trim()}
|
|
1669
|
-
${picocolors.yellow(dist_o)} ${i}
|
|
1670
|
-
${picocolors.yellow(dist_d)} ${picocolors.yellow(this.error)}
|
|
1671
|
-
`;
|
|
1672
1687
|
case "submit":
|
|
1673
|
-
|
|
1688
|
+
{
|
|
1689
|
+
const l = this.options.filter(({ value: c })=>o.includes(c)).map((c)=>r(c, "submitted")).join(styleText("dim", ", ")) || styleText("dim", "none"), n = Bt(e.output, l, `${styleText("gray", dist_h)} `);
|
|
1690
|
+
return `${a}${n}`;
|
|
1691
|
+
}
|
|
1674
1692
|
case "cancel":
|
|
1675
|
-
|
|
1676
|
-
|
|
1693
|
+
{
|
|
1694
|
+
const l = this.options.filter(({ value: c })=>o.includes(c)).map((c)=>r(c, "cancelled")).join(styleText("dim", ", "));
|
|
1695
|
+
if ("" === l.trim()) return `${a}${styleText("gray", dist_h)}`;
|
|
1696
|
+
const n = Bt(e.output, l, `${styleText("gray", dist_h)} `);
|
|
1697
|
+
return `${a}${n}
|
|
1698
|
+
${styleText("gray", dist_h)}`;
|
|
1699
|
+
}
|
|
1700
|
+
case "error":
|
|
1701
|
+
{
|
|
1702
|
+
const l = `${styleText("yellow", dist_h)} `, n = this.error.split(`
|
|
1703
|
+
`).map((f, g)=>0 === g ? `${styleText("yellow", dist_x)} ${styleText("yellow", f)}` : ` ${f}`).join(`
|
|
1704
|
+
`), c = a.split(`
|
|
1705
|
+
`).length, p = n.split(`
|
|
1706
|
+
`).length + 1;
|
|
1707
|
+
return `${a}${l}${dist_X({
|
|
1708
|
+
output: e.output,
|
|
1709
|
+
options: this.options,
|
|
1710
|
+
cursor: this.cursor,
|
|
1711
|
+
maxItems: e.maxItems,
|
|
1712
|
+
columnPadding: l.length,
|
|
1713
|
+
rowPadding: c + p,
|
|
1714
|
+
style: u
|
|
1715
|
+
}).join(`
|
|
1716
|
+
${l}`)}
|
|
1717
|
+
${n}
|
|
1718
|
+
`;
|
|
1719
|
+
}
|
|
1677
1720
|
default:
|
|
1678
|
-
|
|
1679
|
-
|
|
1721
|
+
{
|
|
1722
|
+
const l = `${styleText("cyan", dist_h)} `, n = a.split(`
|
|
1723
|
+
`).length;
|
|
1724
|
+
return `${a}${l}${dist_X({
|
|
1725
|
+
output: e.output,
|
|
1726
|
+
options: this.options,
|
|
1727
|
+
cursor: this.cursor,
|
|
1728
|
+
maxItems: e.maxItems,
|
|
1729
|
+
columnPadding: l.length,
|
|
1730
|
+
rowPadding: n + 2,
|
|
1731
|
+
style: u
|
|
1732
|
+
}).join(`
|
|
1733
|
+
${l}`)}
|
|
1734
|
+
${styleText("cyan", dist_x)}
|
|
1680
1735
|
`;
|
|
1736
|
+
}
|
|
1681
1737
|
}
|
|
1682
1738
|
}
|
|
1683
|
-
}).prompt()
|
|
1684
|
-
|
|
1685
|
-
|
|
1739
|
+
}).prompt();
|
|
1740
|
+
}, jt = (e)=>styleText("dim", e), dist_kt = (e, r, s)=>{
|
|
1741
|
+
const i = {
|
|
1742
|
+
hard: !0,
|
|
1743
|
+
trim: !1
|
|
1744
|
+
}, a = dist_J(e, r, i).split(`
|
|
1745
|
+
`), o = a.reduce((n, c)=>Math.max(D(c), n), 0), u = a.map(s).reduce((n, c)=>Math.max(D(c), n), 0), l = r - (u - o);
|
|
1746
|
+
return dist_J(e, l, i);
|
|
1747
|
+
}, dist_Vt = (e = "", r = "", s)=>{
|
|
1748
|
+
const i = s?.output ?? node_process.stdout, a = s?.withGuide ?? dist_.withGuide, o = s?.format ?? jt, u = [
|
|
1749
|
+
"",
|
|
1750
|
+
...dist_kt(e, dist_rt(i) - 6, o).split(`
|
|
1751
|
+
`).map(o),
|
|
1752
|
+
""
|
|
1753
|
+
], l = D(r), n = Math.max(u.reduce((g, E)=>{
|
|
1754
|
+
const $ = D(E);
|
|
1755
|
+
return $ > g ? $ : g;
|
|
1756
|
+
}, 0), l) + 2, c = u.map((g)=>`${styleText("gray", dist_h)} ${g}${" ".repeat(n - D(g))}${styleText("gray", dist_h)}`).join(`
|
|
1757
|
+
`), p = a ? `${styleText("gray", dist_h)}
|
|
1758
|
+
` : "", f = a ? We : ge;
|
|
1759
|
+
i.write(`${p}${styleText("green", dist_V)} ${styleText("reset", r)} ${styleText("gray", se.repeat(Math.max(n - l - 1, 1)) + pe)}
|
|
1760
|
+
${c}
|
|
1761
|
+
${styleText("gray", f + se.repeat(n + 2) + me)}
|
|
1762
|
+
`);
|
|
1763
|
+
};
|
|
1764
|
+
dist_I("\u2500", "-"), dist_I("\u2501", "="), dist_I("\u2588", "#");
|
|
1765
|
+
const oe = (e, r)=>e.includes(`
|
|
1766
|
+
`) ? e.split(`
|
|
1767
|
+
`).map((s)=>r(s)).join(`
|
|
1768
|
+
`) : r(e), Jt = (e)=>{
|
|
1769
|
+
const r = (s, i)=>{
|
|
1770
|
+
const a = s.label ?? String(s.value);
|
|
1686
1771
|
switch(i){
|
|
1772
|
+
case "disabled":
|
|
1773
|
+
return `${styleText("gray", dist_H)} ${oe(a, (o)=>styleText("gray", o))}${s.hint ? ` ${styleText("dim", `(${s.hint ?? "disabled"})`)}` : ""}`;
|
|
1687
1774
|
case "selected":
|
|
1688
|
-
return `${
|
|
1775
|
+
return `${oe(a, (o)=>styleText("dim", o))}`;
|
|
1689
1776
|
case "active":
|
|
1690
|
-
return `${
|
|
1777
|
+
return `${styleText("green", dist_z)} ${a}${s.hint ? ` ${styleText("dim", `(${s.hint})`)}` : ""}`;
|
|
1691
1778
|
case "cancelled":
|
|
1692
|
-
return `${
|
|
1779
|
+
return `${oe(a, (o)=>styleText([
|
|
1780
|
+
"strikethrough",
|
|
1781
|
+
"dim"
|
|
1782
|
+
], o))}`;
|
|
1693
1783
|
default:
|
|
1694
|
-
return `${
|
|
1784
|
+
return `${styleText("dim", dist_H)} ${oe(a, (o)=>styleText("dim", o))}`;
|
|
1695
1785
|
}
|
|
1696
1786
|
};
|
|
1697
|
-
return new
|
|
1698
|
-
options:
|
|
1699
|
-
|
|
1787
|
+
return new Tt({
|
|
1788
|
+
options: e.options,
|
|
1789
|
+
signal: e.signal,
|
|
1790
|
+
input: e.input,
|
|
1791
|
+
output: e.output,
|
|
1792
|
+
initialValue: e.initialValue,
|
|
1700
1793
|
render () {
|
|
1701
|
-
const
|
|
1702
|
-
|
|
1794
|
+
const s = e.withGuide ?? dist_.withGuide, i = `${dist_W(this.state)} `, a = `${ve(this.state)} `, o = Bt(e.output, e.message, a, i), u = `${s ? `${styleText("gray", dist_h)}
|
|
1795
|
+
` : ""}${o}
|
|
1703
1796
|
`;
|
|
1704
1797
|
switch(this.state){
|
|
1705
1798
|
case "submit":
|
|
1706
|
-
|
|
1799
|
+
{
|
|
1800
|
+
const l = s ? `${styleText("gray", dist_h)} ` : "", n = Bt(e.output, r(this.options[this.cursor], "selected"), l);
|
|
1801
|
+
return `${u}${n}`;
|
|
1802
|
+
}
|
|
1707
1803
|
case "cancel":
|
|
1708
|
-
|
|
1709
|
-
|
|
1804
|
+
{
|
|
1805
|
+
const l = s ? `${styleText("gray", dist_h)} ` : "", n = Bt(e.output, r(this.options[this.cursor], "cancelled"), l);
|
|
1806
|
+
return `${u}${n}${s ? `
|
|
1807
|
+
${styleText("gray", dist_h)}` : ""}`;
|
|
1808
|
+
}
|
|
1710
1809
|
default:
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1810
|
+
{
|
|
1811
|
+
const l = s ? `${styleText("cyan", dist_h)} ` : "", n = s ? styleText("cyan", dist_x) : "", c = u.split(`
|
|
1812
|
+
`).length, p = s ? 2 : 1;
|
|
1813
|
+
return `${u}${l}${dist_X({
|
|
1814
|
+
output: e.output,
|
|
1815
|
+
cursor: this.cursor,
|
|
1816
|
+
options: this.options,
|
|
1817
|
+
maxItems: e.maxItems,
|
|
1818
|
+
columnPadding: l.length,
|
|
1819
|
+
rowPadding: c + p,
|
|
1820
|
+
style: (f, g)=>r(f, f.disabled ? "disabled" : g ? "active" : "inactive")
|
|
1821
|
+
}).join(`
|
|
1822
|
+
${l}`)}
|
|
1823
|
+
${n}
|
|
1719
1824
|
`;
|
|
1825
|
+
}
|
|
1720
1826
|
}
|
|
1721
1827
|
}
|
|
1722
1828
|
}).prompt();
|
|
1723
|
-
},
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
required: t.required ?? !0,
|
|
1732
|
-
cursorAt: t.cursorAt,
|
|
1733
|
-
validate (r) {
|
|
1734
|
-
if (this.required && 0 === r.length) return `Please select at least one option.
|
|
1735
|
-
${picocolors.reset(picocolors.dim(`Press ${picocolors.gray(picocolors.bgWhite(picocolors.inverse(" space ")))} to select, ${picocolors.gray(picocolors.bgWhite(picocolors.inverse(" enter ")))} to submit`))}`;
|
|
1736
|
-
},
|
|
1829
|
+
}, Zt = (styleText("gray", dist_h), (e)=>new dist_$t({
|
|
1830
|
+
validate: e.validate,
|
|
1831
|
+
placeholder: e.placeholder,
|
|
1832
|
+
defaultValue: e.defaultValue,
|
|
1833
|
+
initialValue: e.initialValue,
|
|
1834
|
+
output: e.output,
|
|
1835
|
+
signal: e.signal,
|
|
1836
|
+
input: e.input,
|
|
1737
1837
|
render () {
|
|
1738
|
-
const r = `${
|
|
1739
|
-
${
|
|
1740
|
-
`, i = (
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1838
|
+
const r = e?.withGuide ?? dist_.withGuide, s = `${r ? `${styleText("gray", dist_h)}
|
|
1839
|
+
` : ""}${dist_W(this.state)} ${e.message}
|
|
1840
|
+
`, i = e.placeholder ? styleText("inverse", e.placeholder[0]) + styleText("dim", e.placeholder.slice(1)) : styleText([
|
|
1841
|
+
"inverse",
|
|
1842
|
+
"hidden"
|
|
1843
|
+
], "_"), a = this.userInput ? this.userInputWithCursor : i, o = this.value ?? "";
|
|
1744
1844
|
switch(this.state){
|
|
1845
|
+
case "error":
|
|
1846
|
+
{
|
|
1847
|
+
const u = this.error ? ` ${styleText("yellow", this.error)}` : "", l = r ? `${styleText("yellow", dist_h)} ` : "", n = r ? styleText("yellow", dist_x) : "";
|
|
1848
|
+
return `${s.trim()}
|
|
1849
|
+
${l}${a}
|
|
1850
|
+
${n}${u}
|
|
1851
|
+
`;
|
|
1852
|
+
}
|
|
1745
1853
|
case "submit":
|
|
1746
|
-
return `${r}${picocolors.gray(dist_o)} ${this.options.filter(({ value: s })=>this.value.includes(s)).map((s)=>n(s, "submitted")).join(picocolors.dim(", ")) || picocolors.dim("none")}`;
|
|
1747
|
-
case "cancel":
|
|
1748
1854
|
{
|
|
1749
|
-
const
|
|
1750
|
-
return `${
|
|
1751
|
-
${picocolors.gray(dist_o)}` : ""}`;
|
|
1855
|
+
const u = o ? ` ${styleText("dim", o)}` : "", l = r ? styleText("gray", dist_h) : "";
|
|
1856
|
+
return `${s}${l}${u}`;
|
|
1752
1857
|
}
|
|
1753
|
-
case "
|
|
1858
|
+
case "cancel":
|
|
1754
1859
|
{
|
|
1755
|
-
const
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
maxItems: t.maxItems,
|
|
1762
|
-
style: i
|
|
1763
|
-
}).join(`
|
|
1764
|
-
${picocolors.yellow(dist_o)} `)}
|
|
1765
|
-
${s}
|
|
1766
|
-
`;
|
|
1860
|
+
const u = o ? ` ${styleText([
|
|
1861
|
+
"strikethrough",
|
|
1862
|
+
"dim"
|
|
1863
|
+
], o)}` : "", l = r ? styleText("gray", dist_h) : "";
|
|
1864
|
+
return `${s}${l}${u}${o.trim() ? `
|
|
1865
|
+
${l}` : ""}`;
|
|
1767
1866
|
}
|
|
1768
1867
|
default:
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
style: i
|
|
1774
|
-
}).join(`
|
|
1775
|
-
${picocolors.cyan(dist_o)} `)}
|
|
1776
|
-
${picocolors.cyan(dist_d)}
|
|
1868
|
+
{
|
|
1869
|
+
const u = r ? `${styleText("cyan", dist_h)} ` : "", l = r ? styleText("cyan", dist_x) : "";
|
|
1870
|
+
return `${s}${u}${a}
|
|
1871
|
+
${l}
|
|
1777
1872
|
`;
|
|
1873
|
+
}
|
|
1778
1874
|
}
|
|
1779
1875
|
}
|
|
1780
|
-
}).prompt();
|
|
1781
|
-
|
|
1782
|
-
const
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
`);
|
|
1876
|
+
}).prompt());
|
|
1877
|
+
function checkNodeVersion() {
|
|
1878
|
+
const { versions } = process;
|
|
1879
|
+
if ("styleText" in node_util || !versions.node || versions.bun || versions.deno) return;
|
|
1880
|
+
throw new Error(`Unsupported Node.js version: "${process.versions.node || 'unknown'}". Expected Node.js >= 20.`);
|
|
1881
|
+
}
|
|
1882
|
+
checkNodeVersion();
|
|
1883
|
+
const createStyler = (style)=>(text)=>node_util.styleText(style, String(text));
|
|
1884
|
+
const color = {
|
|
1885
|
+
dim: createStyler('dim'),
|
|
1886
|
+
red: createStyler('red'),
|
|
1887
|
+
bold: createStyler('bold'),
|
|
1888
|
+
blue: createStyler('blue'),
|
|
1889
|
+
cyan: createStyler('cyan'),
|
|
1890
|
+
gray: createStyler('gray'),
|
|
1891
|
+
black: createStyler('black'),
|
|
1892
|
+
green: createStyler('green'),
|
|
1893
|
+
white: createStyler('white'),
|
|
1894
|
+
reset: createStyler('reset'),
|
|
1895
|
+
yellow: createStyler('yellow'),
|
|
1896
|
+
magenta: createStyler('magenta'),
|
|
1897
|
+
underline: createStyler('underline'),
|
|
1898
|
+
strikethrough: createStyler('strikethrough')
|
|
1804
1899
|
};
|
|
1805
|
-
picocolors.gray(dist_o);
|
|
1806
|
-
var dist = __webpack_require__("./node_modules/.pnpm/@vercel+detect-agent@1.0.0/node_modules/@vercel/detect-agent/dist/index.js");
|
|
1807
|
-
var cross_spawn = __webpack_require__("./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js");
|
|
1808
|
-
var cross_spawn_default = /*#__PURE__*/ __webpack_require__.n(cross_spawn);
|
|
1809
|
-
var cjs = __webpack_require__("./node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js");
|
|
1810
|
-
var cjs_default = /*#__PURE__*/ __webpack_require__.n(cjs);
|
|
1811
|
-
var minimist = __webpack_require__("./node_modules/.pnpm/minimist@1.2.8/node_modules/minimist/index.js");
|
|
1812
|
-
var minimist_default = /*#__PURE__*/ __webpack_require__.n(minimist);
|
|
1813
1900
|
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : node_process.argv) {
|
|
1814
1901
|
const prefix = flag.startsWith('-') ? '' : 1 === flag.length ? '-' : '--';
|
|
1815
1902
|
const position = argv.indexOf(prefix + flag);
|
|
1816
1903
|
const terminatorPosition = argv.indexOf('--');
|
|
1817
1904
|
return -1 !== position && (-1 === terminatorPosition || position < terminatorPosition);
|
|
1818
1905
|
}
|
|
1819
|
-
const { env } = node_process;
|
|
1906
|
+
const { env: env } = node_process;
|
|
1820
1907
|
let flagForceColor;
|
|
1821
1908
|
if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false') || hasFlag('color=never')) flagForceColor = 0;
|
|
1822
1909
|
else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true') || hasFlag('color=always')) flagForceColor = 1;
|
|
@@ -1916,24 +2003,6 @@ let errorStackRegExp = /at [^\r\n]{0,200}:\d+:\d+[\s\)]*$/;
|
|
|
1916
2003
|
let anonymousErrorStackRegExp = /at [^\r\n]{0,200}\(<anonymous>\)$/;
|
|
1917
2004
|
let indexErrorStackRegExp = /at [^\r\n]{0,200}\(index\s\d+\)$/;
|
|
1918
2005
|
let isErrorStackMessage = (message)=>errorStackRegExp.test(message) || anonymousErrorStackRegExp.test(message) || indexErrorStackRegExp.test(message);
|
|
1919
|
-
let formatter = (open, close, replace = open)=>colorLevel >= 2 ? (input)=>{
|
|
1920
|
-
let string = '' + input;
|
|
1921
|
-
let index = string.indexOf(close, open.length);
|
|
1922
|
-
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
1923
|
-
} : String;
|
|
1924
|
-
let replaceClose = (string, close, replace, index)=>{
|
|
1925
|
-
let start = string.substring(0, index) + replace;
|
|
1926
|
-
let end = string.substring(index + close.length);
|
|
1927
|
-
let nextIndex = end.indexOf(close);
|
|
1928
|
-
return ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end;
|
|
1929
|
-
};
|
|
1930
|
-
const bold = formatter('\x1b[1m', '\x1b[22m', '\x1b[22m\x1b[1m');
|
|
1931
|
-
const red = formatter('\x1b[31m', '\x1b[39m');
|
|
1932
|
-
const green = formatter('\x1b[32m', '\x1b[39m');
|
|
1933
|
-
const yellow = formatter('\x1b[33m', '\x1b[39m');
|
|
1934
|
-
const magenta = formatter('\x1b[35m', '\x1b[39m');
|
|
1935
|
-
const cyan = formatter('\x1b[36m', '\x1b[39m');
|
|
1936
|
-
const gray = formatter('\x1b[90m', '\x1b[39m');
|
|
1937
2006
|
let startColor = [
|
|
1938
2007
|
189,
|
|
1939
2008
|
255,
|
|
@@ -1946,7 +2015,7 @@ let endColor = [
|
|
|
1946
2015
|
];
|
|
1947
2016
|
let isWord = (char)=>!/[\s\n]/.test(char);
|
|
1948
2017
|
let gradient = (message)=>{
|
|
1949
|
-
if (colorLevel < 3) return 2 === colorLevel ?
|
|
2018
|
+
if (colorLevel < 3) return 2 === colorLevel ? color.cyan(message) : message;
|
|
1950
2019
|
let chars = [
|
|
1951
2020
|
...message
|
|
1952
2021
|
];
|
|
@@ -1966,7 +2035,7 @@ let gradient = (message)=>{
|
|
|
1966
2035
|
}
|
|
1967
2036
|
output += `\x1b[38;2;${Math.round(r)};${Math.round(g)};${Math.round(b)}m${char}\x1b[39m`;
|
|
1968
2037
|
}
|
|
1969
|
-
return bold(output);
|
|
2038
|
+
return color.bold(output);
|
|
1970
2039
|
};
|
|
1971
2040
|
let LOG_LEVEL = {
|
|
1972
2041
|
silent: -1,
|
|
@@ -1980,32 +2049,32 @@ let LOG_TYPES = {
|
|
|
1980
2049
|
error: {
|
|
1981
2050
|
label: 'error',
|
|
1982
2051
|
level: 'error',
|
|
1983
|
-
color: red
|
|
2052
|
+
color: color.red
|
|
1984
2053
|
},
|
|
1985
2054
|
warn: {
|
|
1986
2055
|
label: 'warn',
|
|
1987
2056
|
level: 'warn',
|
|
1988
|
-
color: yellow
|
|
2057
|
+
color: color.yellow
|
|
1989
2058
|
},
|
|
1990
2059
|
info: {
|
|
1991
2060
|
label: 'info',
|
|
1992
2061
|
level: 'info',
|
|
1993
|
-
color: cyan
|
|
2062
|
+
color: color.cyan
|
|
1994
2063
|
},
|
|
1995
2064
|
start: {
|
|
1996
2065
|
label: 'start',
|
|
1997
2066
|
level: 'info',
|
|
1998
|
-
color: cyan
|
|
2067
|
+
color: color.cyan
|
|
1999
2068
|
},
|
|
2000
2069
|
ready: {
|
|
2001
2070
|
label: 'ready',
|
|
2002
2071
|
level: 'info',
|
|
2003
|
-
color: green
|
|
2072
|
+
color: color.green
|
|
2004
2073
|
},
|
|
2005
2074
|
success: {
|
|
2006
2075
|
label: 'success',
|
|
2007
2076
|
level: 'info',
|
|
2008
|
-
color: green
|
|
2077
|
+
color: color.green
|
|
2009
2078
|
},
|
|
2010
2079
|
log: {
|
|
2011
2080
|
level: 'info'
|
|
@@ -2013,14 +2082,14 @@ let LOG_TYPES = {
|
|
|
2013
2082
|
debug: {
|
|
2014
2083
|
label: 'debug',
|
|
2015
2084
|
level: 'verbose',
|
|
2016
|
-
color: magenta
|
|
2085
|
+
color: color.magenta
|
|
2017
2086
|
}
|
|
2018
2087
|
};
|
|
2019
2088
|
const normalizeErrorMessage = (err)=>{
|
|
2020
2089
|
if (err.stack) {
|
|
2021
2090
|
let [name, ...rest] = err.stack.split('\n');
|
|
2022
2091
|
if (name.startsWith('Error: ')) name = name.slice(7);
|
|
2023
|
-
return `${name}\n${gray(rest.join('\n'))}`;
|
|
2092
|
+
return `${name}\n${color.gray(rest.join('\n'))}`;
|
|
2024
2093
|
}
|
|
2025
2094
|
return err.message;
|
|
2026
2095
|
};
|
|
@@ -2035,18 +2104,18 @@ let createLogger = (options = {})=>{
|
|
|
2035
2104
|
let text = '';
|
|
2036
2105
|
if ('label' in logType) {
|
|
2037
2106
|
label = (logType.label || '').padEnd(7);
|
|
2038
|
-
label = bold(logType.color ? logType.color(label) : label);
|
|
2107
|
+
label = color.bold(logType.color ? logType.color(label) : label);
|
|
2039
2108
|
}
|
|
2040
2109
|
if (message instanceof Error) {
|
|
2041
2110
|
text += normalizeErrorMessage(message);
|
|
2042
2111
|
const { cause } = message;
|
|
2043
2112
|
if (cause) {
|
|
2044
|
-
text += yellow('\n [cause]: ');
|
|
2113
|
+
text += color.yellow('\n [cause]: ');
|
|
2045
2114
|
text += cause instanceof Error ? normalizeErrorMessage(cause) : String(cause);
|
|
2046
2115
|
}
|
|
2047
2116
|
} else if ('error' === level && 'string' == typeof message) {
|
|
2048
2117
|
let lines = message.split('\n');
|
|
2049
|
-
text = lines.map((line)=>isErrorStackMessage(line) ? gray(line) : line).join('\n');
|
|
2118
|
+
text = lines.map((line)=>isErrorStackMessage(line) ? color.gray(line) : line).join('\n');
|
|
2050
2119
|
} else text = `${message}`;
|
|
2051
2120
|
const method = 'error' === level || 'warn' === level ? level : 'log';
|
|
2052
2121
|
console[method](label.length ? `${label} ${text}` : text, ...args);
|
|
@@ -2069,14 +2138,23 @@ let createLogger = (options = {})=>{
|
|
|
2069
2138
|
return logger;
|
|
2070
2139
|
};
|
|
2071
2140
|
let src_logger = createLogger();
|
|
2141
|
+
const dist = __webpack_require__("./node_modules/.pnpm/@vercel+detect-agent@1.1.0/node_modules/@vercel/detect-agent/dist/index.js");
|
|
2142
|
+
const cross_spawn = __webpack_require__("./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js");
|
|
2143
|
+
var cross_spawn_default = /*#__PURE__*/ __webpack_require__.n(cross_spawn);
|
|
2144
|
+
const cjs = __webpack_require__("./node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js");
|
|
2145
|
+
var cjs_default = /*#__PURE__*/ __webpack_require__.n(cjs);
|
|
2146
|
+
const minimist = __webpack_require__("./node_modules/.pnpm/minimist@1.2.8/node_modules/minimist/index.js");
|
|
2147
|
+
var minimist_default = /*#__PURE__*/ __webpack_require__.n(minimist);
|
|
2148
|
+
const picocolors = __webpack_require__("./node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
2149
|
+
var picocolors_default = /*#__PURE__*/ __webpack_require__.n(picocolors);
|
|
2072
2150
|
const src_filename = fileURLToPath(import.meta.url);
|
|
2073
2151
|
const src_dirname = dirname(src_filename);
|
|
2074
2152
|
function cancelAndExit() {
|
|
2075
|
-
|
|
2153
|
+
Nt('Operation cancelled.');
|
|
2076
2154
|
process.exit(0);
|
|
2077
2155
|
}
|
|
2078
2156
|
function checkCancel(value) {
|
|
2079
|
-
if (
|
|
2157
|
+
if (Ct(value)) cancelAndExit();
|
|
2080
2158
|
return value;
|
|
2081
2159
|
}
|
|
2082
2160
|
function formatProjectName(input) {
|
|
@@ -2172,7 +2250,7 @@ async function getTools({ tools, dir, template }, extraTools, templateName) {
|
|
|
2172
2250
|
options.unshift(...filteredExtraTools.filter((tool)=>'pre' === tool.order).map(normalize));
|
|
2173
2251
|
options.push(...filteredExtraTools.filter((tool)=>'pre' !== tool.order).map(normalize));
|
|
2174
2252
|
}
|
|
2175
|
-
return checkCancel(await
|
|
2253
|
+
return checkCancel(await dist_Lt({
|
|
2176
2254
|
message: 'Select additional tools (Use <space> to select, <enter> to continue)',
|
|
2177
2255
|
options,
|
|
2178
2256
|
required: false
|
|
@@ -2229,12 +2307,12 @@ async function create({ name, root, templates, skipFiles, getTemplateName, mapES
|
|
|
2229
2307
|
packageManager
|
|
2230
2308
|
};
|
|
2231
2309
|
if (!version) version = (await readPackageJson(root)).version;
|
|
2232
|
-
const projectName = argv.dir ?? checkCancel(await
|
|
2310
|
+
const projectName = argv.dir ?? checkCancel(await Zt({
|
|
2233
2311
|
message: 'Project name or path',
|
|
2234
2312
|
placeholder: `${name.toLowerCase()}-project`,
|
|
2235
2313
|
defaultValue: `${name.toLowerCase()}-project`,
|
|
2236
2314
|
validate (value) {
|
|
2237
|
-
if (
|
|
2315
|
+
if (value?.length === 0) return 'Project name is required';
|
|
2238
2316
|
}
|
|
2239
2317
|
}));
|
|
2240
2318
|
const formatted = formatProjectName(projectName);
|
|
@@ -2242,7 +2320,7 @@ async function create({ name, root, templates, skipFiles, getTemplateName, mapES
|
|
|
2242
2320
|
const packageName = argv.packageName || formatted.packageName;
|
|
2243
2321
|
const distFolder = node_path.isAbsolute(targetDir) ? targetDir : node_path.join(cwd, targetDir);
|
|
2244
2322
|
if (!argv.override && external_node_fs_["default"].existsSync(distFolder) && !isEmptyDir(distFolder)) {
|
|
2245
|
-
const option = checkCancel(await
|
|
2323
|
+
const option = checkCancel(await Jt({
|
|
2246
2324
|
message: `"${targetDir}" is not empty, please choose:`,
|
|
2247
2325
|
options: [
|
|
2248
2326
|
{
|
|
@@ -2337,8 +2415,8 @@ async function create({ name, root, templates, skipFiles, getTemplateName, mapES
|
|
|
2337
2415
|
`3. ${picocolors_default().cyan(`${packageManager} install`)}`,
|
|
2338
2416
|
`4. ${picocolors_default().cyan(`${packageManager} run dev`)}`
|
|
2339
2417
|
];
|
|
2340
|
-
if (nextSteps.length)
|
|
2341
|
-
|
|
2418
|
+
if (nextSteps.length) dist_Vt(nextSteps.map((step)=>picocolors_default().reset(step)).join('\n'), 'Next steps');
|
|
2419
|
+
Gt('All set, happy coding!');
|
|
2342
2420
|
}
|
|
2343
2421
|
function sortObjectKeys(obj) {
|
|
2344
2422
|
const sortedKeys = Object.keys(obj).sort();
|
|
@@ -2477,8 +2555,17 @@ function mergeAgentsFiles(agentsFiles) {
|
|
|
2477
2555
|
for (const [, section] of Object.entries(allSections)){
|
|
2478
2556
|
result.push(`${'#'.repeat(section.level)} ${section.title}`);
|
|
2479
2557
|
result.push('');
|
|
2480
|
-
for
|
|
2558
|
+
for(let i = 0; i < section.contents.length; i++){
|
|
2559
|
+
const content = section.contents[i];
|
|
2560
|
+
const nextContent = section.contents[i + 1];
|
|
2481
2561
|
result.push(content);
|
|
2562
|
+
if (nextContent) {
|
|
2563
|
+
const lastNewLineIndex = content.lastIndexOf('\n');
|
|
2564
|
+
const lastLine = -1 === lastNewLineIndex ? content : content.substring(lastNewLineIndex + 1);
|
|
2565
|
+
const firstNewLineIndex = nextContent.indexOf('\n');
|
|
2566
|
+
const nextFirstLine = -1 === firstNewLineIndex ? nextContent : nextContent.substring(0, firstNewLineIndex);
|
|
2567
|
+
if (lastLine.startsWith('- ') && nextFirstLine.startsWith('- ')) continue;
|
|
2568
|
+
}
|
|
2482
2569
|
result.push('');
|
|
2483
2570
|
}
|
|
2484
2571
|
}
|
|
@@ -2492,4 +2579,4 @@ function collectAgentsFiles(agentsMdSearchDirs) {
|
|
|
2492
2579
|
}
|
|
2493
2580
|
return agentsFiles;
|
|
2494
2581
|
}
|
|
2495
|
-
export { BUILTIN_TOOLS, checkCancel, collectAgentsFiles, copyFolder, create,
|
|
2582
|
+
export { BUILTIN_TOOLS, Jt as select, Zt as text, checkCancel, collectAgentsFiles, copyFolder, create, dist_Lt as multiselect, mergeAgentsFiles, mergePackageJson };
|