@hot-updater/aws 0.21.7 → 0.21.8
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/iac/index.cjs +159 -1326
- package/dist/iac/index.d.cts +1 -1
- package/dist/iac/index.d.ts +1 -1
- package/dist/iac/index.js +187 -1354
- package/package.json +6 -7
package/dist/iac/index.cjs
CHANGED
|
@@ -12,7 +12,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
12
12
|
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i$1 = 0, n$1 = keys.length, key; i$1 < n$1; i$1++) {
|
|
13
13
|
key = keys[i$1];
|
|
14
14
|
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15
|
-
get: ((k
|
|
15
|
+
get: ((k) => from[k]).bind(null, key),
|
|
16
16
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
17
|
});
|
|
18
18
|
}
|
|
@@ -26,22 +26,20 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
//#endregion
|
|
27
27
|
let __aws_sdk_credential_providers = require("@aws-sdk/credential-providers");
|
|
28
28
|
__aws_sdk_credential_providers = __toESM(__aws_sdk_credential_providers);
|
|
29
|
-
let
|
|
30
|
-
|
|
31
|
-
let node_process = require("node:process");
|
|
32
|
-
node_process = __toESM(node_process);
|
|
33
|
-
let node_readline = require("node:readline");
|
|
34
|
-
node_readline = __toESM(node_readline);
|
|
35
|
-
let node_tty = require("node:tty");
|
|
36
|
-
node_tty = __toESM(node_tty);
|
|
37
|
-
let __hot_updater_plugin_core = require("@hot-updater/plugin-core");
|
|
38
|
-
__hot_updater_plugin_core = __toESM(__hot_updater_plugin_core);
|
|
29
|
+
let __hot_updater_cli_tools = require("@hot-updater/cli-tools");
|
|
30
|
+
__hot_updater_cli_tools = __toESM(__hot_updater_cli_tools);
|
|
39
31
|
let node_url = require("node:url");
|
|
40
32
|
node_url = __toESM(node_url);
|
|
41
33
|
let node_child_process = require("node:child_process");
|
|
42
34
|
node_child_process = __toESM(node_child_process);
|
|
43
35
|
let node_string_decoder = require("node:string_decoder");
|
|
44
36
|
node_string_decoder = __toESM(node_string_decoder);
|
|
37
|
+
let node_util = require("node:util");
|
|
38
|
+
node_util = __toESM(node_util);
|
|
39
|
+
let node_process = require("node:process");
|
|
40
|
+
node_process = __toESM(node_process);
|
|
41
|
+
let node_tty = require("node:tty");
|
|
42
|
+
node_tty = __toESM(node_tty);
|
|
45
43
|
let node_path = require("node:path");
|
|
46
44
|
node_path = __toESM(node_path);
|
|
47
45
|
let path = require("path");
|
|
@@ -83,1169 +81,6 @@ __aws_sdk_lib_storage = __toESM(__aws_sdk_lib_storage);
|
|
|
83
81
|
let __aws_sdk_client_ssm = require("@aws-sdk/client-ssm");
|
|
84
82
|
__aws_sdk_client_ssm = __toESM(__aws_sdk_client_ssm);
|
|
85
83
|
|
|
86
|
-
//#region ../../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js
|
|
87
|
-
var require_src = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js": ((exports, module) => {
|
|
88
|
-
const ESC = "\x1B";
|
|
89
|
-
const CSI = `${ESC}[`;
|
|
90
|
-
const beep = "\x07";
|
|
91
|
-
const cursor = {
|
|
92
|
-
to(x$1, y$1) {
|
|
93
|
-
if (!y$1) return `${CSI}${x$1 + 1}G`;
|
|
94
|
-
return `${CSI}${y$1 + 1};${x$1 + 1}H`;
|
|
95
|
-
},
|
|
96
|
-
move(x$1, y$1) {
|
|
97
|
-
let ret = "";
|
|
98
|
-
if (x$1 < 0) ret += `${CSI}${-x$1}D`;
|
|
99
|
-
else if (x$1 > 0) ret += `${CSI}${x$1}C`;
|
|
100
|
-
if (y$1 < 0) ret += `${CSI}${-y$1}A`;
|
|
101
|
-
else if (y$1 > 0) ret += `${CSI}${y$1}B`;
|
|
102
|
-
return ret;
|
|
103
|
-
},
|
|
104
|
-
up: (count$1 = 1) => `${CSI}${count$1}A`,
|
|
105
|
-
down: (count$1 = 1) => `${CSI}${count$1}B`,
|
|
106
|
-
forward: (count$1 = 1) => `${CSI}${count$1}C`,
|
|
107
|
-
backward: (count$1 = 1) => `${CSI}${count$1}D`,
|
|
108
|
-
nextLine: (count$1 = 1) => `${CSI}E`.repeat(count$1),
|
|
109
|
-
prevLine: (count$1 = 1) => `${CSI}F`.repeat(count$1),
|
|
110
|
-
left: `${CSI}G`,
|
|
111
|
-
hide: `${CSI}?25l`,
|
|
112
|
-
show: `${CSI}?25h`,
|
|
113
|
-
save: `${ESC}7`,
|
|
114
|
-
restore: `${ESC}8`
|
|
115
|
-
};
|
|
116
|
-
const scroll = {
|
|
117
|
-
up: (count$1 = 1) => `${CSI}S`.repeat(count$1),
|
|
118
|
-
down: (count$1 = 1) => `${CSI}T`.repeat(count$1)
|
|
119
|
-
};
|
|
120
|
-
const erase = {
|
|
121
|
-
screen: `${CSI}2J`,
|
|
122
|
-
up: (count$1 = 1) => `${CSI}1J`.repeat(count$1),
|
|
123
|
-
down: (count$1 = 1) => `${CSI}J`.repeat(count$1),
|
|
124
|
-
line: `${CSI}2K`,
|
|
125
|
-
lineEnd: `${CSI}K`,
|
|
126
|
-
lineStart: `${CSI}1K`,
|
|
127
|
-
lines(count$1) {
|
|
128
|
-
let clear = "";
|
|
129
|
-
for (let i$1 = 0; i$1 < count$1; i$1++) clear += this.line + (i$1 < count$1 - 1 ? cursor.up() : "");
|
|
130
|
-
if (count$1) clear += cursor.left;
|
|
131
|
-
return clear;
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
module.exports = {
|
|
135
|
-
cursor,
|
|
136
|
-
scroll,
|
|
137
|
-
erase,
|
|
138
|
-
beep
|
|
139
|
-
};
|
|
140
|
-
}) });
|
|
141
|
-
|
|
142
|
-
//#endregion
|
|
143
|
-
//#region ../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
|
|
144
|
-
var require_picocolors = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js": ((exports, module) => {
|
|
145
|
-
let p = process || {}, argv = p.argv || [], env = p.env || {};
|
|
146
|
-
let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
|
|
147
|
-
let formatter = (open, close, replace = open) => (input) => {
|
|
148
|
-
let string = "" + input, index = string.indexOf(close, open.length);
|
|
149
|
-
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
150
|
-
};
|
|
151
|
-
let replaceClose = (string, close, replace, index) => {
|
|
152
|
-
let result = "", cursor$1 = 0;
|
|
153
|
-
do {
|
|
154
|
-
result += string.substring(cursor$1, index) + replace;
|
|
155
|
-
cursor$1 = index + close.length;
|
|
156
|
-
index = string.indexOf(close, cursor$1);
|
|
157
|
-
} while (~index);
|
|
158
|
-
return result + string.substring(cursor$1);
|
|
159
|
-
};
|
|
160
|
-
let createColors = (enabled = isColorSupported) => {
|
|
161
|
-
let f$1 = enabled ? formatter : () => String;
|
|
162
|
-
return {
|
|
163
|
-
isColorSupported: enabled,
|
|
164
|
-
reset: f$1("\x1B[0m", "\x1B[0m"),
|
|
165
|
-
bold: f$1("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
|
|
166
|
-
dim: f$1("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
|
|
167
|
-
italic: f$1("\x1B[3m", "\x1B[23m"),
|
|
168
|
-
underline: f$1("\x1B[4m", "\x1B[24m"),
|
|
169
|
-
inverse: f$1("\x1B[7m", "\x1B[27m"),
|
|
170
|
-
hidden: f$1("\x1B[8m", "\x1B[28m"),
|
|
171
|
-
strikethrough: f$1("\x1B[9m", "\x1B[29m"),
|
|
172
|
-
black: f$1("\x1B[30m", "\x1B[39m"),
|
|
173
|
-
red: f$1("\x1B[31m", "\x1B[39m"),
|
|
174
|
-
green: f$1("\x1B[32m", "\x1B[39m"),
|
|
175
|
-
yellow: f$1("\x1B[33m", "\x1B[39m"),
|
|
176
|
-
blue: f$1("\x1B[34m", "\x1B[39m"),
|
|
177
|
-
magenta: f$1("\x1B[35m", "\x1B[39m"),
|
|
178
|
-
cyan: f$1("\x1B[36m", "\x1B[39m"),
|
|
179
|
-
white: f$1("\x1B[37m", "\x1B[39m"),
|
|
180
|
-
gray: f$1("\x1B[90m", "\x1B[39m"),
|
|
181
|
-
bgBlack: f$1("\x1B[40m", "\x1B[49m"),
|
|
182
|
-
bgRed: f$1("\x1B[41m", "\x1B[49m"),
|
|
183
|
-
bgGreen: f$1("\x1B[42m", "\x1B[49m"),
|
|
184
|
-
bgYellow: f$1("\x1B[43m", "\x1B[49m"),
|
|
185
|
-
bgBlue: f$1("\x1B[44m", "\x1B[49m"),
|
|
186
|
-
bgMagenta: f$1("\x1B[45m", "\x1B[49m"),
|
|
187
|
-
bgCyan: f$1("\x1B[46m", "\x1B[49m"),
|
|
188
|
-
bgWhite: f$1("\x1B[47m", "\x1B[49m"),
|
|
189
|
-
blackBright: f$1("\x1B[90m", "\x1B[39m"),
|
|
190
|
-
redBright: f$1("\x1B[91m", "\x1B[39m"),
|
|
191
|
-
greenBright: f$1("\x1B[92m", "\x1B[39m"),
|
|
192
|
-
yellowBright: f$1("\x1B[93m", "\x1B[39m"),
|
|
193
|
-
blueBright: f$1("\x1B[94m", "\x1B[39m"),
|
|
194
|
-
magentaBright: f$1("\x1B[95m", "\x1B[39m"),
|
|
195
|
-
cyanBright: f$1("\x1B[96m", "\x1B[39m"),
|
|
196
|
-
whiteBright: f$1("\x1B[97m", "\x1B[39m"),
|
|
197
|
-
bgBlackBright: f$1("\x1B[100m", "\x1B[49m"),
|
|
198
|
-
bgRedBright: f$1("\x1B[101m", "\x1B[49m"),
|
|
199
|
-
bgGreenBright: f$1("\x1B[102m", "\x1B[49m"),
|
|
200
|
-
bgYellowBright: f$1("\x1B[103m", "\x1B[49m"),
|
|
201
|
-
bgBlueBright: f$1("\x1B[104m", "\x1B[49m"),
|
|
202
|
-
bgMagentaBright: f$1("\x1B[105m", "\x1B[49m"),
|
|
203
|
-
bgCyanBright: f$1("\x1B[106m", "\x1B[49m"),
|
|
204
|
-
bgWhiteBright: f$1("\x1B[107m", "\x1B[49m")
|
|
205
|
-
};
|
|
206
|
-
};
|
|
207
|
-
module.exports = createColors();
|
|
208
|
-
module.exports.createColors = createColors;
|
|
209
|
-
}) });
|
|
210
|
-
|
|
211
|
-
//#endregion
|
|
212
|
-
//#region ../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/@clack/core/dist/index.mjs
|
|
213
|
-
var import_src$1 = /* @__PURE__ */ __toESM(require_src(), 1);
|
|
214
|
-
var import_picocolors$3 = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
215
|
-
function J$1({ onlyFirst: t = !1 } = {}) {
|
|
216
|
-
const F$1 = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
|
|
217
|
-
return new RegExp(F$1, t ? void 0 : "g");
|
|
218
|
-
}
|
|
219
|
-
const Q = J$1();
|
|
220
|
-
function T$1(t) {
|
|
221
|
-
if (typeof t != "string") throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);
|
|
222
|
-
return t.replace(Q, "");
|
|
223
|
-
}
|
|
224
|
-
function O(t) {
|
|
225
|
-
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
226
|
-
}
|
|
227
|
-
var P$1 = { exports: {} };
|
|
228
|
-
(function(t) {
|
|
229
|
-
var u$2 = {};
|
|
230
|
-
t.exports = u$2, u$2.eastAsianWidth = function(e$1) {
|
|
231
|
-
var s = e$1.charCodeAt(0), i$1 = e$1.length == 2 ? e$1.charCodeAt(1) : 0, D$1 = s;
|
|
232
|
-
return 55296 <= s && s <= 56319 && 56320 <= i$1 && i$1 <= 57343 && (s &= 1023, i$1 &= 1023, D$1 = s << 10 | i$1, D$1 += 65536), D$1 == 12288 || 65281 <= D$1 && D$1 <= 65376 || 65504 <= D$1 && D$1 <= 65510 ? "F" : D$1 == 8361 || 65377 <= D$1 && D$1 <= 65470 || 65474 <= D$1 && D$1 <= 65479 || 65482 <= D$1 && D$1 <= 65487 || 65490 <= D$1 && D$1 <= 65495 || 65498 <= D$1 && D$1 <= 65500 || 65512 <= D$1 && D$1 <= 65518 ? "H" : 4352 <= D$1 && D$1 <= 4447 || 4515 <= D$1 && D$1 <= 4519 || 4602 <= D$1 && D$1 <= 4607 || 9001 <= D$1 && D$1 <= 9002 || 11904 <= D$1 && D$1 <= 11929 || 11931 <= D$1 && D$1 <= 12019 || 12032 <= D$1 && D$1 <= 12245 || 12272 <= D$1 && D$1 <= 12283 || 12289 <= D$1 && D$1 <= 12350 || 12353 <= D$1 && D$1 <= 12438 || 12441 <= D$1 && D$1 <= 12543 || 12549 <= D$1 && D$1 <= 12589 || 12593 <= D$1 && D$1 <= 12686 || 12688 <= D$1 && D$1 <= 12730 || 12736 <= D$1 && D$1 <= 12771 || 12784 <= D$1 && D$1 <= 12830 || 12832 <= D$1 && D$1 <= 12871 || 12880 <= D$1 && D$1 <= 13054 || 13056 <= D$1 && D$1 <= 19903 || 19968 <= D$1 && D$1 <= 42124 || 42128 <= D$1 && D$1 <= 42182 || 43360 <= D$1 && D$1 <= 43388 || 44032 <= D$1 && D$1 <= 55203 || 55216 <= D$1 && D$1 <= 55238 || 55243 <= D$1 && D$1 <= 55291 || 63744 <= D$1 && D$1 <= 64255 || 65040 <= D$1 && D$1 <= 65049 || 65072 <= D$1 && D$1 <= 65106 || 65108 <= D$1 && D$1 <= 65126 || 65128 <= D$1 && D$1 <= 65131 || 110592 <= D$1 && D$1 <= 110593 || 127488 <= D$1 && D$1 <= 127490 || 127504 <= D$1 && D$1 <= 127546 || 127552 <= D$1 && D$1 <= 127560 || 127568 <= D$1 && D$1 <= 127569 || 131072 <= D$1 && D$1 <= 194367 || 177984 <= D$1 && D$1 <= 196605 || 196608 <= D$1 && D$1 <= 262141 ? "W" : 32 <= D$1 && D$1 <= 126 || 162 <= D$1 && D$1 <= 163 || 165 <= D$1 && D$1 <= 166 || D$1 == 172 || D$1 == 175 || 10214 <= D$1 && D$1 <= 10221 || 10629 <= D$1 && D$1 <= 10630 ? "Na" : D$1 == 161 || D$1 == 164 || 167 <= D$1 && D$1 <= 168 || D$1 == 170 || 173 <= D$1 && D$1 <= 174 || 176 <= D$1 && D$1 <= 180 || 182 <= D$1 && D$1 <= 186 || 188 <= D$1 && D$1 <= 191 || D$1 == 198 || D$1 == 208 || 215 <= D$1 && D$1 <= 216 || 222 <= D$1 && D$1 <= 225 || D$1 == 230 || 232 <= D$1 && D$1 <= 234 || 236 <= D$1 && D$1 <= 237 || D$1 == 240 || 242 <= D$1 && D$1 <= 243 || 247 <= D$1 && D$1 <= 250 || D$1 == 252 || D$1 == 254 || D$1 == 257 || D$1 == 273 || D$1 == 275 || D$1 == 283 || 294 <= D$1 && D$1 <= 295 || D$1 == 299 || 305 <= D$1 && D$1 <= 307 || D$1 == 312 || 319 <= D$1 && D$1 <= 322 || D$1 == 324 || 328 <= D$1 && D$1 <= 331 || D$1 == 333 || 338 <= D$1 && D$1 <= 339 || 358 <= D$1 && D$1 <= 359 || D$1 == 363 || D$1 == 462 || D$1 == 464 || D$1 == 466 || D$1 == 468 || D$1 == 470 || D$1 == 472 || D$1 == 474 || D$1 == 476 || D$1 == 593 || D$1 == 609 || D$1 == 708 || D$1 == 711 || 713 <= D$1 && D$1 <= 715 || D$1 == 717 || D$1 == 720 || 728 <= D$1 && D$1 <= 731 || D$1 == 733 || D$1 == 735 || 768 <= D$1 && D$1 <= 879 || 913 <= D$1 && D$1 <= 929 || 931 <= D$1 && D$1 <= 937 || 945 <= D$1 && D$1 <= 961 || 963 <= D$1 && D$1 <= 969 || D$1 == 1025 || 1040 <= D$1 && D$1 <= 1103 || D$1 == 1105 || D$1 == 8208 || 8211 <= D$1 && D$1 <= 8214 || 8216 <= D$1 && D$1 <= 8217 || 8220 <= D$1 && D$1 <= 8221 || 8224 <= D$1 && D$1 <= 8226 || 8228 <= D$1 && D$1 <= 8231 || D$1 == 8240 || 8242 <= D$1 && D$1 <= 8243 || D$1 == 8245 || D$1 == 8251 || D$1 == 8254 || D$1 == 8308 || D$1 == 8319 || 8321 <= D$1 && D$1 <= 8324 || D$1 == 8364 || D$1 == 8451 || D$1 == 8453 || D$1 == 8457 || D$1 == 8467 || D$1 == 8470 || 8481 <= D$1 && D$1 <= 8482 || D$1 == 8486 || D$1 == 8491 || 8531 <= D$1 && D$1 <= 8532 || 8539 <= D$1 && D$1 <= 8542 || 8544 <= D$1 && D$1 <= 8555 || 8560 <= D$1 && D$1 <= 8569 || D$1 == 8585 || 8592 <= D$1 && D$1 <= 8601 || 8632 <= D$1 && D$1 <= 8633 || D$1 == 8658 || D$1 == 8660 || D$1 == 8679 || D$1 == 8704 || 8706 <= D$1 && D$1 <= 8707 || 8711 <= D$1 && D$1 <= 8712 || D$1 == 8715 || D$1 == 8719 || D$1 == 8721 || D$1 == 8725 || D$1 == 8730 || 8733 <= D$1 && D$1 <= 8736 || D$1 == 8739 || D$1 == 8741 || 8743 <= D$1 && D$1 <= 8748 || D$1 == 8750 || 8756 <= D$1 && D$1 <= 8759 || 8764 <= D$1 && D$1 <= 8765 || D$1 == 8776 || D$1 == 8780 || D$1 == 8786 || 8800 <= D$1 && D$1 <= 8801 || 8804 <= D$1 && D$1 <= 8807 || 8810 <= D$1 && D$1 <= 8811 || 8814 <= D$1 && D$1 <= 8815 || 8834 <= D$1 && D$1 <= 8835 || 8838 <= D$1 && D$1 <= 8839 || D$1 == 8853 || D$1 == 8857 || D$1 == 8869 || D$1 == 8895 || D$1 == 8978 || 9312 <= D$1 && D$1 <= 9449 || 9451 <= D$1 && D$1 <= 9547 || 9552 <= D$1 && D$1 <= 9587 || 9600 <= D$1 && D$1 <= 9615 || 9618 <= D$1 && D$1 <= 9621 || 9632 <= D$1 && D$1 <= 9633 || 9635 <= D$1 && D$1 <= 9641 || 9650 <= D$1 && D$1 <= 9651 || 9654 <= D$1 && D$1 <= 9655 || 9660 <= D$1 && D$1 <= 9661 || 9664 <= D$1 && D$1 <= 9665 || 9670 <= D$1 && D$1 <= 9672 || D$1 == 9675 || 9678 <= D$1 && D$1 <= 9681 || 9698 <= D$1 && D$1 <= 9701 || D$1 == 9711 || 9733 <= D$1 && D$1 <= 9734 || D$1 == 9737 || 9742 <= D$1 && D$1 <= 9743 || 9748 <= D$1 && D$1 <= 9749 || D$1 == 9756 || D$1 == 9758 || D$1 == 9792 || D$1 == 9794 || 9824 <= D$1 && D$1 <= 9825 || 9827 <= D$1 && D$1 <= 9829 || 9831 <= D$1 && D$1 <= 9834 || 9836 <= D$1 && D$1 <= 9837 || D$1 == 9839 || 9886 <= D$1 && D$1 <= 9887 || 9918 <= D$1 && D$1 <= 9919 || 9924 <= D$1 && D$1 <= 9933 || 9935 <= D$1 && D$1 <= 9953 || D$1 == 9955 || 9960 <= D$1 && D$1 <= 9983 || D$1 == 10045 || D$1 == 10071 || 10102 <= D$1 && D$1 <= 10111 || 11093 <= D$1 && D$1 <= 11097 || 12872 <= D$1 && D$1 <= 12879 || 57344 <= D$1 && D$1 <= 63743 || 65024 <= D$1 && D$1 <= 65039 || D$1 == 65533 || 127232 <= D$1 && D$1 <= 127242 || 127248 <= D$1 && D$1 <= 127277 || 127280 <= D$1 && D$1 <= 127337 || 127344 <= D$1 && D$1 <= 127386 || 917760 <= D$1 && D$1 <= 917999 || 983040 <= D$1 && D$1 <= 1048573 || 1048576 <= D$1 && D$1 <= 1114109 ? "A" : "N";
|
|
233
|
-
}, u$2.characterLength = function(e$1) {
|
|
234
|
-
var s = this.eastAsianWidth(e$1);
|
|
235
|
-
return s == "F" || s == "W" || s == "A" ? 2 : 1;
|
|
236
|
-
};
|
|
237
|
-
function F$1(e$1) {
|
|
238
|
-
return e$1.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
|
|
239
|
-
}
|
|
240
|
-
u$2.length = function(e$1) {
|
|
241
|
-
for (var s = F$1(e$1), i$1 = 0, D$1 = 0; D$1 < s.length; D$1++) i$1 = i$1 + this.characterLength(s[D$1]);
|
|
242
|
-
return i$1;
|
|
243
|
-
}, u$2.slice = function(e$1, s, i$1) {
|
|
244
|
-
textLen = u$2.length(e$1), s = s || 0, i$1 = i$1 || 1, s < 0 && (s = textLen + s), i$1 < 0 && (i$1 = textLen + i$1);
|
|
245
|
-
for (var D$1 = "", C$1 = 0, o$2 = F$1(e$1), E = 0; E < o$2.length; E++) {
|
|
246
|
-
var a$1 = o$2[E], n$1 = u$2.length(a$1);
|
|
247
|
-
if (C$1 >= s - (n$1 == 2 ? 1 : 0)) if (C$1 + n$1 <= i$1) D$1 += a$1;
|
|
248
|
-
else break;
|
|
249
|
-
C$1 += n$1;
|
|
250
|
-
}
|
|
251
|
-
return D$1;
|
|
252
|
-
};
|
|
253
|
-
})(P$1);
|
|
254
|
-
var X = P$1.exports;
|
|
255
|
-
const DD = O(X);
|
|
256
|
-
var uD = function() {
|
|
257
|
-
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;
|
|
258
|
-
};
|
|
259
|
-
const FD = O(uD);
|
|
260
|
-
function A$1(t, u$2 = {}) {
|
|
261
|
-
if (typeof t != "string" || t.length === 0 || (u$2 = {
|
|
262
|
-
ambiguousIsNarrow: !0,
|
|
263
|
-
...u$2
|
|
264
|
-
}, t = T$1(t), t.length === 0)) return 0;
|
|
265
|
-
t = t.replace(FD(), " ");
|
|
266
|
-
const F$1 = u$2.ambiguousIsNarrow ? 1 : 2;
|
|
267
|
-
let e$1 = 0;
|
|
268
|
-
for (const s of t) {
|
|
269
|
-
const i$1 = s.codePointAt(0);
|
|
270
|
-
if (i$1 <= 31 || i$1 >= 127 && i$1 <= 159 || i$1 >= 768 && i$1 <= 879) continue;
|
|
271
|
-
switch (DD.eastAsianWidth(s)) {
|
|
272
|
-
case "F":
|
|
273
|
-
case "W":
|
|
274
|
-
e$1 += 2;
|
|
275
|
-
break;
|
|
276
|
-
case "A":
|
|
277
|
-
e$1 += F$1;
|
|
278
|
-
break;
|
|
279
|
-
default: e$1 += 1;
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
return e$1;
|
|
283
|
-
}
|
|
284
|
-
const m = 10, L$1 = (t = 0) => (u$2) => `\x1B[${u$2 + t}m`, N = (t = 0) => (u$2) => `\x1B[${38 + t};5;${u$2}m`, I = (t = 0) => (u$2, F$1, e$1) => `\x1B[${38 + t};2;${u$2};${F$1};${e$1}m`, r = {
|
|
285
|
-
modifier: {
|
|
286
|
-
reset: [0, 0],
|
|
287
|
-
bold: [1, 22],
|
|
288
|
-
dim: [2, 22],
|
|
289
|
-
italic: [3, 23],
|
|
290
|
-
underline: [4, 24],
|
|
291
|
-
overline: [53, 55],
|
|
292
|
-
inverse: [7, 27],
|
|
293
|
-
hidden: [8, 28],
|
|
294
|
-
strikethrough: [9, 29]
|
|
295
|
-
},
|
|
296
|
-
color: {
|
|
297
|
-
black: [30, 39],
|
|
298
|
-
red: [31, 39],
|
|
299
|
-
green: [32, 39],
|
|
300
|
-
yellow: [33, 39],
|
|
301
|
-
blue: [34, 39],
|
|
302
|
-
magenta: [35, 39],
|
|
303
|
-
cyan: [36, 39],
|
|
304
|
-
white: [37, 39],
|
|
305
|
-
blackBright: [90, 39],
|
|
306
|
-
gray: [90, 39],
|
|
307
|
-
grey: [90, 39],
|
|
308
|
-
redBright: [91, 39],
|
|
309
|
-
greenBright: [92, 39],
|
|
310
|
-
yellowBright: [93, 39],
|
|
311
|
-
blueBright: [94, 39],
|
|
312
|
-
magentaBright: [95, 39],
|
|
313
|
-
cyanBright: [96, 39],
|
|
314
|
-
whiteBright: [97, 39]
|
|
315
|
-
},
|
|
316
|
-
bgColor: {
|
|
317
|
-
bgBlack: [40, 49],
|
|
318
|
-
bgRed: [41, 49],
|
|
319
|
-
bgGreen: [42, 49],
|
|
320
|
-
bgYellow: [43, 49],
|
|
321
|
-
bgBlue: [44, 49],
|
|
322
|
-
bgMagenta: [45, 49],
|
|
323
|
-
bgCyan: [46, 49],
|
|
324
|
-
bgWhite: [47, 49],
|
|
325
|
-
bgBlackBright: [100, 49],
|
|
326
|
-
bgGray: [100, 49],
|
|
327
|
-
bgGrey: [100, 49],
|
|
328
|
-
bgRedBright: [101, 49],
|
|
329
|
-
bgGreenBright: [102, 49],
|
|
330
|
-
bgYellowBright: [103, 49],
|
|
331
|
-
bgBlueBright: [104, 49],
|
|
332
|
-
bgMagentaBright: [105, 49],
|
|
333
|
-
bgCyanBright: [106, 49],
|
|
334
|
-
bgWhiteBright: [107, 49]
|
|
335
|
-
}
|
|
336
|
-
};
|
|
337
|
-
Object.keys(r.modifier);
|
|
338
|
-
const tD = Object.keys(r.color), eD = Object.keys(r.bgColor);
|
|
339
|
-
[...tD, ...eD];
|
|
340
|
-
function sD() {
|
|
341
|
-
const t = /* @__PURE__ */ new Map();
|
|
342
|
-
for (const [u$2, F$1] of Object.entries(r)) {
|
|
343
|
-
for (const [e$1, s] of Object.entries(F$1)) r[e$1] = {
|
|
344
|
-
open: `\x1B[${s[0]}m`,
|
|
345
|
-
close: `\x1B[${s[1]}m`
|
|
346
|
-
}, F$1[e$1] = r[e$1], t.set(s[0], s[1]);
|
|
347
|
-
Object.defineProperty(r, u$2, {
|
|
348
|
-
value: F$1,
|
|
349
|
-
enumerable: !1
|
|
350
|
-
});
|
|
351
|
-
}
|
|
352
|
-
return Object.defineProperty(r, "codes", {
|
|
353
|
-
value: t,
|
|
354
|
-
enumerable: !1
|
|
355
|
-
}), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi = L$1(), r.color.ansi256 = N(), r.color.ansi16m = I(), r.bgColor.ansi = L$1(m), r.bgColor.ansi256 = N(m), r.bgColor.ansi16m = I(m), Object.defineProperties(r, {
|
|
356
|
-
rgbToAnsi256: {
|
|
357
|
-
value: (u$2, F$1, e$1) => u$2 === F$1 && F$1 === e$1 ? u$2 < 8 ? 16 : u$2 > 248 ? 231 : Math.round((u$2 - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u$2 / 255 * 5) + 6 * Math.round(F$1 / 255 * 5) + Math.round(e$1 / 255 * 5),
|
|
358
|
-
enumerable: !1
|
|
359
|
-
},
|
|
360
|
-
hexToRgb: {
|
|
361
|
-
value: (u$2) => {
|
|
362
|
-
const F$1 = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u$2.toString(16));
|
|
363
|
-
if (!F$1) return [
|
|
364
|
-
0,
|
|
365
|
-
0,
|
|
366
|
-
0
|
|
367
|
-
];
|
|
368
|
-
let [e$1] = F$1;
|
|
369
|
-
e$1.length === 3 && (e$1 = [...e$1].map((i$1) => i$1 + i$1).join(""));
|
|
370
|
-
const s = Number.parseInt(e$1, 16);
|
|
371
|
-
return [
|
|
372
|
-
s >> 16 & 255,
|
|
373
|
-
s >> 8 & 255,
|
|
374
|
-
s & 255
|
|
375
|
-
];
|
|
376
|
-
},
|
|
377
|
-
enumerable: !1
|
|
378
|
-
},
|
|
379
|
-
hexToAnsi256: {
|
|
380
|
-
value: (u$2) => r.rgbToAnsi256(...r.hexToRgb(u$2)),
|
|
381
|
-
enumerable: !1
|
|
382
|
-
},
|
|
383
|
-
ansi256ToAnsi: {
|
|
384
|
-
value: (u$2) => {
|
|
385
|
-
if (u$2 < 8) return 30 + u$2;
|
|
386
|
-
if (u$2 < 16) return 90 + (u$2 - 8);
|
|
387
|
-
let F$1, e$1, s;
|
|
388
|
-
if (u$2 >= 232) F$1 = ((u$2 - 232) * 10 + 8) / 255, e$1 = F$1, s = F$1;
|
|
389
|
-
else {
|
|
390
|
-
u$2 -= 16;
|
|
391
|
-
const C$1 = u$2 % 36;
|
|
392
|
-
F$1 = Math.floor(u$2 / 36) / 5, e$1 = Math.floor(C$1 / 6) / 5, s = C$1 % 6 / 5;
|
|
393
|
-
}
|
|
394
|
-
const i$1 = Math.max(F$1, e$1, s) * 2;
|
|
395
|
-
if (i$1 === 0) return 30;
|
|
396
|
-
let D$1 = 30 + (Math.round(s) << 2 | Math.round(e$1) << 1 | Math.round(F$1));
|
|
397
|
-
return i$1 === 2 && (D$1 += 60), D$1;
|
|
398
|
-
},
|
|
399
|
-
enumerable: !1
|
|
400
|
-
},
|
|
401
|
-
rgbToAnsi: {
|
|
402
|
-
value: (u$2, F$1, e$1) => r.ansi256ToAnsi(r.rgbToAnsi256(u$2, F$1, e$1)),
|
|
403
|
-
enumerable: !1
|
|
404
|
-
},
|
|
405
|
-
hexToAnsi: {
|
|
406
|
-
value: (u$2) => r.ansi256ToAnsi(r.hexToAnsi256(u$2)),
|
|
407
|
-
enumerable: !1
|
|
408
|
-
}
|
|
409
|
-
}), r;
|
|
410
|
-
}
|
|
411
|
-
const iD = sD(), v = new Set(["\x1B", ""]), CD = 39, w$1 = "\x07", W$1 = "[", rD = "]", R = "m", y = `${rD}8;;`, V$1 = (t) => `${v.values().next().value}${W$1}${t}${R}`, z = (t) => `${v.values().next().value}${y}${t}${w$1}`, ED = (t) => t.split(" ").map((u$2) => A$1(u$2)), _$1 = (t, u$2, F$1) => {
|
|
412
|
-
const e$1 = [...u$2];
|
|
413
|
-
let s = !1, i$1 = !1, D$1 = A$1(T$1(t[t.length - 1]));
|
|
414
|
-
for (const [C$1, o$2] of e$1.entries()) {
|
|
415
|
-
const E = A$1(o$2);
|
|
416
|
-
if (D$1 + E <= F$1 ? t[t.length - 1] += o$2 : (t.push(o$2), D$1 = 0), v.has(o$2) && (s = !0, i$1 = e$1.slice(C$1 + 1).join("").startsWith(y)), s) {
|
|
417
|
-
i$1 ? o$2 === w$1 && (s = !1, i$1 = !1) : o$2 === R && (s = !1);
|
|
418
|
-
continue;
|
|
419
|
-
}
|
|
420
|
-
D$1 += E, D$1 === F$1 && C$1 < e$1.length - 1 && (t.push(""), D$1 = 0);
|
|
421
|
-
}
|
|
422
|
-
!D$1 && t[t.length - 1].length > 0 && t.length > 1 && (t[t.length - 2] += t.pop());
|
|
423
|
-
}, nD = (t) => {
|
|
424
|
-
const u$2 = t.split(" ");
|
|
425
|
-
let F$1 = u$2.length;
|
|
426
|
-
for (; F$1 > 0 && !(A$1(u$2[F$1 - 1]) > 0);) F$1--;
|
|
427
|
-
return F$1 === u$2.length ? t : u$2.slice(0, F$1).join(" ") + u$2.slice(F$1).join("");
|
|
428
|
-
}, oD = (t, u$2, F$1 = {}) => {
|
|
429
|
-
if (F$1.trim !== !1 && t.trim() === "") return "";
|
|
430
|
-
let e$1 = "", s, i$1;
|
|
431
|
-
const D$1 = ED(t);
|
|
432
|
-
let C$1 = [""];
|
|
433
|
-
for (const [E, a$1] of t.split(" ").entries()) {
|
|
434
|
-
F$1.trim !== !1 && (C$1[C$1.length - 1] = C$1[C$1.length - 1].trimStart());
|
|
435
|
-
let n$1 = A$1(C$1[C$1.length - 1]);
|
|
436
|
-
if (E !== 0 && (n$1 >= u$2 && (F$1.wordWrap === !1 || F$1.trim === !1) && (C$1.push(""), n$1 = 0), (n$1 > 0 || F$1.trim === !1) && (C$1[C$1.length - 1] += " ", n$1++)), F$1.hard && D$1[E] > u$2) {
|
|
437
|
-
const B$1 = u$2 - n$1, p$1 = 1 + Math.floor((D$1[E] - B$1 - 1) / u$2);
|
|
438
|
-
Math.floor((D$1[E] - 1) / u$2) < p$1 && C$1.push(""), _$1(C$1, a$1, u$2);
|
|
439
|
-
continue;
|
|
440
|
-
}
|
|
441
|
-
if (n$1 + D$1[E] > u$2 && n$1 > 0 && D$1[E] > 0) {
|
|
442
|
-
if (F$1.wordWrap === !1 && n$1 < u$2) {
|
|
443
|
-
_$1(C$1, a$1, u$2);
|
|
444
|
-
continue;
|
|
445
|
-
}
|
|
446
|
-
C$1.push("");
|
|
447
|
-
}
|
|
448
|
-
if (n$1 + D$1[E] > u$2 && F$1.wordWrap === !1) {
|
|
449
|
-
_$1(C$1, a$1, u$2);
|
|
450
|
-
continue;
|
|
451
|
-
}
|
|
452
|
-
C$1[C$1.length - 1] += a$1;
|
|
453
|
-
}
|
|
454
|
-
F$1.trim !== !1 && (C$1 = C$1.map((E) => nD(E)));
|
|
455
|
-
const o$2 = [...C$1.join(`
|
|
456
|
-
`)];
|
|
457
|
-
for (const [E, a$1] of o$2.entries()) {
|
|
458
|
-
if (e$1 += a$1, v.has(a$1)) {
|
|
459
|
-
const { groups: B$1 } = (/* @__PURE__ */ new RegExp(`(?:\\${W$1}(?<code>\\d+)m|\\${y}(?<uri>.*)${w$1})`)).exec(o$2.slice(E).join("")) || { groups: {} };
|
|
460
|
-
if (B$1.code !== void 0) {
|
|
461
|
-
const p$1 = Number.parseFloat(B$1.code);
|
|
462
|
-
s = p$1 === CD ? void 0 : p$1;
|
|
463
|
-
} else B$1.uri !== void 0 && (i$1 = B$1.uri.length === 0 ? void 0 : B$1.uri);
|
|
464
|
-
}
|
|
465
|
-
const n$1 = iD.codes.get(Number(s));
|
|
466
|
-
o$2[E + 1] === `
|
|
467
|
-
` ? (i$1 && (e$1 += z("")), s && n$1 && (e$1 += V$1(n$1))) : a$1 === `
|
|
468
|
-
` && (s && n$1 && (e$1 += V$1(s)), i$1 && (e$1 += z(i$1)));
|
|
469
|
-
}
|
|
470
|
-
return e$1;
|
|
471
|
-
};
|
|
472
|
-
function G(t, u$2, F$1) {
|
|
473
|
-
return String(t).normalize().replace(/\r\n/g, `
|
|
474
|
-
`).split(`
|
|
475
|
-
`).map((e$1) => oD(e$1, u$2, F$1)).join(`
|
|
476
|
-
`);
|
|
477
|
-
}
|
|
478
|
-
const c$1 = {
|
|
479
|
-
actions: new Set([
|
|
480
|
-
"up",
|
|
481
|
-
"down",
|
|
482
|
-
"left",
|
|
483
|
-
"right",
|
|
484
|
-
"space",
|
|
485
|
-
"enter",
|
|
486
|
-
"cancel"
|
|
487
|
-
]),
|
|
488
|
-
aliases: new Map([
|
|
489
|
-
["k", "up"],
|
|
490
|
-
["j", "down"],
|
|
491
|
-
["h", "left"],
|
|
492
|
-
["l", "right"],
|
|
493
|
-
["", "cancel"],
|
|
494
|
-
["escape", "cancel"]
|
|
495
|
-
])
|
|
496
|
-
};
|
|
497
|
-
function k$1(t, u$2) {
|
|
498
|
-
if (typeof t == "string") return c$1.aliases.get(t) === u$2;
|
|
499
|
-
for (const F$1 of t) if (F$1 !== void 0 && k$1(F$1, u$2)) return !0;
|
|
500
|
-
return !1;
|
|
501
|
-
}
|
|
502
|
-
function lD(t, u$2) {
|
|
503
|
-
if (t === u$2) return;
|
|
504
|
-
const F$1 = t.split(`
|
|
505
|
-
`), e$1 = u$2.split(`
|
|
506
|
-
`), s = [];
|
|
507
|
-
for (let i$1 = 0; i$1 < Math.max(F$1.length, e$1.length); i$1++) F$1[i$1] !== e$1[i$1] && s.push(i$1);
|
|
508
|
-
return s;
|
|
509
|
-
}
|
|
510
|
-
const xD = globalThis.process.platform.startsWith("win"), S$1 = Symbol("clack:cancel");
|
|
511
|
-
function BD(t) {
|
|
512
|
-
return t === S$1;
|
|
513
|
-
}
|
|
514
|
-
function d$1(t, u$2) {
|
|
515
|
-
const F$1 = t;
|
|
516
|
-
F$1.isTTY && F$1.setRawMode(u$2);
|
|
517
|
-
}
|
|
518
|
-
function cD({ input: t = node_process.stdin, output: u$2 = node_process.stdout, overwrite: F$1 = !0, hideCursor: e$1 = !0 } = {}) {
|
|
519
|
-
const s = node_readline.createInterface({
|
|
520
|
-
input: t,
|
|
521
|
-
output: u$2,
|
|
522
|
-
prompt: "",
|
|
523
|
-
tabSize: 1
|
|
524
|
-
});
|
|
525
|
-
node_readline.emitKeypressEvents(t, s), t.isTTY && t.setRawMode(!0);
|
|
526
|
-
const i$1 = (D$1, { name: C$1, sequence: o$2 }) => {
|
|
527
|
-
if (k$1([
|
|
528
|
-
String(D$1),
|
|
529
|
-
C$1,
|
|
530
|
-
o$2
|
|
531
|
-
], "cancel")) {
|
|
532
|
-
e$1 && u$2.write(import_src$1.cursor.show), process.exit(0);
|
|
533
|
-
return;
|
|
534
|
-
}
|
|
535
|
-
if (!F$1) return;
|
|
536
|
-
const a$1 = C$1 === "return" ? 0 : -1, n$1 = C$1 === "return" ? -1 : 0;
|
|
537
|
-
node_readline.moveCursor(u$2, a$1, n$1, () => {
|
|
538
|
-
node_readline.clearLine(u$2, 1, () => {
|
|
539
|
-
t.once("keypress", i$1);
|
|
540
|
-
});
|
|
541
|
-
});
|
|
542
|
-
};
|
|
543
|
-
return e$1 && u$2.write(import_src$1.cursor.hide), t.once("keypress", i$1), () => {
|
|
544
|
-
t.off("keypress", i$1), e$1 && u$2.write(import_src$1.cursor.show), t.isTTY && !xD && t.setRawMode(!1), s.terminal = !1, s.close();
|
|
545
|
-
};
|
|
546
|
-
}
|
|
547
|
-
var AD = Object.defineProperty, pD = (t, u$2, F$1) => u$2 in t ? AD(t, u$2, {
|
|
548
|
-
enumerable: !0,
|
|
549
|
-
configurable: !0,
|
|
550
|
-
writable: !0,
|
|
551
|
-
value: F$1
|
|
552
|
-
}) : t[u$2] = F$1, h$1 = (t, u$2, F$1) => (pD(t, typeof u$2 != "symbol" ? u$2 + "" : u$2, F$1), F$1);
|
|
553
|
-
var x = class {
|
|
554
|
-
constructor(u$2, F$1 = !0) {
|
|
555
|
-
h$1(this, "input"), h$1(this, "output"), h$1(this, "_abortSignal"), h$1(this, "rl"), h$1(this, "opts"), h$1(this, "_render"), h$1(this, "_track", !1), h$1(this, "_prevFrame", ""), h$1(this, "_subscribers", /* @__PURE__ */ new Map()), h$1(this, "_cursor", 0), h$1(this, "state", "initial"), h$1(this, "error", ""), h$1(this, "value");
|
|
556
|
-
const { input: e$1 = node_process.stdin, output: s = node_process.stdout, render: i$1, signal: D$1,...C$1 } = u$2;
|
|
557
|
-
this.opts = C$1, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = i$1.bind(this), this._track = F$1, this._abortSignal = D$1, this.input = e$1, this.output = s;
|
|
558
|
-
}
|
|
559
|
-
unsubscribe() {
|
|
560
|
-
this._subscribers.clear();
|
|
561
|
-
}
|
|
562
|
-
setSubscriber(u$2, F$1) {
|
|
563
|
-
const e$1 = this._subscribers.get(u$2) ?? [];
|
|
564
|
-
e$1.push(F$1), this._subscribers.set(u$2, e$1);
|
|
565
|
-
}
|
|
566
|
-
on(u$2, F$1) {
|
|
567
|
-
this.setSubscriber(u$2, { cb: F$1 });
|
|
568
|
-
}
|
|
569
|
-
once(u$2, F$1) {
|
|
570
|
-
this.setSubscriber(u$2, {
|
|
571
|
-
cb: F$1,
|
|
572
|
-
once: !0
|
|
573
|
-
});
|
|
574
|
-
}
|
|
575
|
-
emit(u$2, ...F$1) {
|
|
576
|
-
const e$1 = this._subscribers.get(u$2) ?? [], s = [];
|
|
577
|
-
for (const i$1 of e$1) i$1.cb(...F$1), i$1.once && s.push(() => e$1.splice(e$1.indexOf(i$1), 1));
|
|
578
|
-
for (const i$1 of s) i$1();
|
|
579
|
-
}
|
|
580
|
-
prompt() {
|
|
581
|
-
return new Promise((u$2, F$1) => {
|
|
582
|
-
if (this._abortSignal) {
|
|
583
|
-
if (this._abortSignal.aborted) return this.state = "cancel", this.close(), u$2(S$1);
|
|
584
|
-
this._abortSignal.addEventListener("abort", () => {
|
|
585
|
-
this.state = "cancel", this.close();
|
|
586
|
-
}, { once: !0 });
|
|
587
|
-
}
|
|
588
|
-
const e$1 = new node_tty.WriteStream(0);
|
|
589
|
-
e$1._write = (s, i$1, D$1) => {
|
|
590
|
-
this._track && (this.value = this.rl?.line.replace(/\t/g, ""), this._cursor = this.rl?.cursor ?? 0, this.emit("value", this.value)), D$1();
|
|
591
|
-
}, this.input.pipe(e$1), this.rl = node_readline.default.createInterface({
|
|
592
|
-
input: this.input,
|
|
593
|
-
output: e$1,
|
|
594
|
-
tabSize: 2,
|
|
595
|
-
prompt: "",
|
|
596
|
-
escapeCodeTimeout: 50
|
|
597
|
-
}), node_readline.default.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== void 0 && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), d$1(this.input, !0), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
|
|
598
|
-
this.output.write(import_src$1.cursor.show), this.output.off("resize", this.render), d$1(this.input, !1), u$2(this.value);
|
|
599
|
-
}), this.once("cancel", () => {
|
|
600
|
-
this.output.write(import_src$1.cursor.show), this.output.off("resize", this.render), d$1(this.input, !1), u$2(S$1);
|
|
601
|
-
});
|
|
602
|
-
});
|
|
603
|
-
}
|
|
604
|
-
onKeypress(u$2, F$1) {
|
|
605
|
-
if (this.state === "error" && (this.state = "active"), F$1?.name && (!this._track && c$1.aliases.has(F$1.name) && this.emit("cursor", c$1.aliases.get(F$1.name)), c$1.actions.has(F$1.name) && this.emit("cursor", F$1.name)), u$2 && (u$2.toLowerCase() === "y" || u$2.toLowerCase() === "n") && this.emit("confirm", u$2.toLowerCase() === "y"), u$2 === " " && this.opts.placeholder && (this.value || (this.rl?.write(this.opts.placeholder), this.emit("value", this.opts.placeholder))), u$2 && this.emit("key", u$2.toLowerCase()), F$1?.name === "return") {
|
|
606
|
-
if (this.opts.validate) {
|
|
607
|
-
const e$1 = this.opts.validate(this.value);
|
|
608
|
-
e$1 && (this.error = e$1 instanceof Error ? e$1.message : e$1, this.state = "error", this.rl?.write(this.value));
|
|
609
|
-
}
|
|
610
|
-
this.state !== "error" && (this.state = "submit");
|
|
611
|
-
}
|
|
612
|
-
k$1([
|
|
613
|
-
u$2,
|
|
614
|
-
F$1?.name,
|
|
615
|
-
F$1?.sequence
|
|
616
|
-
], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
|
|
617
|
-
}
|
|
618
|
-
close() {
|
|
619
|
-
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
|
|
620
|
-
`), d$1(this.input, !1), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
621
|
-
}
|
|
622
|
-
restoreCursor() {
|
|
623
|
-
const u$2 = G(this._prevFrame, process.stdout.columns, { hard: !0 }).split(`
|
|
624
|
-
`).length - 1;
|
|
625
|
-
this.output.write(import_src$1.cursor.move(-999, u$2 * -1));
|
|
626
|
-
}
|
|
627
|
-
render() {
|
|
628
|
-
const u$2 = G(this._render(this) ?? "", process.stdout.columns, { hard: !0 });
|
|
629
|
-
if (u$2 !== this._prevFrame) {
|
|
630
|
-
if (this.state === "initial") this.output.write(import_src$1.cursor.hide);
|
|
631
|
-
else {
|
|
632
|
-
const F$1 = lD(this._prevFrame, u$2);
|
|
633
|
-
if (this.restoreCursor(), F$1 && F$1?.length === 1) {
|
|
634
|
-
const e$1 = F$1[0];
|
|
635
|
-
this.output.write(import_src$1.cursor.move(0, e$1)), this.output.write(import_src$1.erase.lines(1));
|
|
636
|
-
const s = u$2.split(`
|
|
637
|
-
`);
|
|
638
|
-
this.output.write(s[e$1]), this._prevFrame = u$2, this.output.write(import_src$1.cursor.move(0, s.length - e$1 - 1));
|
|
639
|
-
return;
|
|
640
|
-
}
|
|
641
|
-
if (F$1 && F$1?.length > 1) {
|
|
642
|
-
const e$1 = F$1[0];
|
|
643
|
-
this.output.write(import_src$1.cursor.move(0, e$1)), this.output.write(import_src$1.erase.down());
|
|
644
|
-
const s = u$2.split(`
|
|
645
|
-
`).slice(e$1);
|
|
646
|
-
this.output.write(s.join(`
|
|
647
|
-
`)), this._prevFrame = u$2;
|
|
648
|
-
return;
|
|
649
|
-
}
|
|
650
|
-
this.output.write(import_src$1.erase.down());
|
|
651
|
-
}
|
|
652
|
-
this.output.write(u$2), this.state === "initial" && (this.state = "active"), this._prevFrame = u$2;
|
|
653
|
-
}
|
|
654
|
-
}
|
|
655
|
-
};
|
|
656
|
-
var fD = class extends x {
|
|
657
|
-
get cursor() {
|
|
658
|
-
return this.value ? 0 : 1;
|
|
659
|
-
}
|
|
660
|
-
get _value() {
|
|
661
|
-
return this.cursor === 0;
|
|
662
|
-
}
|
|
663
|
-
constructor(u$2) {
|
|
664
|
-
super(u$2, !1), this.value = !!u$2.initialValue, this.on("value", () => {
|
|
665
|
-
this.value = this._value;
|
|
666
|
-
}), this.on("confirm", (F$1) => {
|
|
667
|
-
this.output.write(import_src$1.cursor.move(0, -1)), this.value = F$1, this.state = "submit", this.close();
|
|
668
|
-
}), this.on("cursor", () => {
|
|
669
|
-
this.value = !this.value;
|
|
670
|
-
});
|
|
671
|
-
}
|
|
672
|
-
};
|
|
673
|
-
var gD = Object.defineProperty, vD = (t, u$2, F$1) => u$2 in t ? gD(t, u$2, {
|
|
674
|
-
enumerable: !0,
|
|
675
|
-
configurable: !0,
|
|
676
|
-
writable: !0,
|
|
677
|
-
value: F$1
|
|
678
|
-
}) : t[u$2] = F$1, K$1 = (t, u$2, F$1) => (vD(t, typeof u$2 != "symbol" ? u$2 + "" : u$2, F$1), F$1);
|
|
679
|
-
let dD = class extends x {
|
|
680
|
-
constructor(u$2) {
|
|
681
|
-
super(u$2, !1), K$1(this, "options"), K$1(this, "cursor", 0);
|
|
682
|
-
const { options: F$1 } = u$2;
|
|
683
|
-
this.options = Object.entries(F$1).flatMap(([e$1, s]) => [{
|
|
684
|
-
value: e$1,
|
|
685
|
-
group: !0,
|
|
686
|
-
label: e$1
|
|
687
|
-
}, ...s.map((i$1) => ({
|
|
688
|
-
...i$1,
|
|
689
|
-
group: e$1
|
|
690
|
-
}))]), this.value = [...u$2.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: e$1 }) => e$1 === u$2.cursorAt), 0), this.on("cursor", (e$1) => {
|
|
691
|
-
switch (e$1) {
|
|
692
|
-
case "left":
|
|
693
|
-
case "up":
|
|
694
|
-
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
695
|
-
break;
|
|
696
|
-
case "down":
|
|
697
|
-
case "right":
|
|
698
|
-
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
699
|
-
break;
|
|
700
|
-
case "space":
|
|
701
|
-
this.toggleValue();
|
|
702
|
-
break;
|
|
703
|
-
}
|
|
704
|
-
});
|
|
705
|
-
}
|
|
706
|
-
getGroupItems(u$2) {
|
|
707
|
-
return this.options.filter((F$1) => F$1.group === u$2);
|
|
708
|
-
}
|
|
709
|
-
isGroupSelected(u$2) {
|
|
710
|
-
return this.getGroupItems(u$2).every((F$1) => this.value.includes(F$1.value));
|
|
711
|
-
}
|
|
712
|
-
toggleValue() {
|
|
713
|
-
const u$2 = this.options[this.cursor];
|
|
714
|
-
if (u$2.group === !0) {
|
|
715
|
-
const F$1 = u$2.value, e$1 = this.getGroupItems(F$1);
|
|
716
|
-
this.isGroupSelected(F$1) ? this.value = this.value.filter((s) => e$1.findIndex((i$1) => i$1.value === s) === -1) : this.value = [...this.value, ...e$1.map((s) => s.value)], this.value = Array.from(new Set(this.value));
|
|
717
|
-
} else this.value = this.value.includes(u$2.value) ? this.value.filter((e$1) => e$1 !== u$2.value) : [...this.value, u$2.value];
|
|
718
|
-
}
|
|
719
|
-
};
|
|
720
|
-
var bD = Object.defineProperty, mD = (t, u$2, F$1) => u$2 in t ? bD(t, u$2, {
|
|
721
|
-
enumerable: !0,
|
|
722
|
-
configurable: !0,
|
|
723
|
-
writable: !0,
|
|
724
|
-
value: F$1
|
|
725
|
-
}) : t[u$2] = F$1, Y$1 = (t, u$2, F$1) => (mD(t, typeof u$2 != "symbol" ? u$2 + "" : u$2, F$1), F$1);
|
|
726
|
-
let wD = class extends x {
|
|
727
|
-
constructor(u$2) {
|
|
728
|
-
super(u$2, !1), Y$1(this, "options"), Y$1(this, "cursor", 0), this.options = u$2.options, this.value = [...u$2.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: F$1 }) => F$1 === u$2.cursorAt), 0), this.on("key", (F$1) => {
|
|
729
|
-
F$1 === "a" && this.toggleAll();
|
|
730
|
-
}), this.on("cursor", (F$1) => {
|
|
731
|
-
switch (F$1) {
|
|
732
|
-
case "left":
|
|
733
|
-
case "up":
|
|
734
|
-
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
735
|
-
break;
|
|
736
|
-
case "down":
|
|
737
|
-
case "right":
|
|
738
|
-
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
739
|
-
break;
|
|
740
|
-
case "space":
|
|
741
|
-
this.toggleValue();
|
|
742
|
-
break;
|
|
743
|
-
}
|
|
744
|
-
});
|
|
745
|
-
}
|
|
746
|
-
get _value() {
|
|
747
|
-
return this.options[this.cursor].value;
|
|
748
|
-
}
|
|
749
|
-
toggleAll() {
|
|
750
|
-
this.value = this.value.length === this.options.length ? [] : this.options.map((F$1) => F$1.value);
|
|
751
|
-
}
|
|
752
|
-
toggleValue() {
|
|
753
|
-
this.value = this.value.includes(this._value) ? this.value.filter((F$1) => F$1 !== this._value) : [...this.value, this._value];
|
|
754
|
-
}
|
|
755
|
-
};
|
|
756
|
-
var yD = Object.defineProperty, _D = (t, u$2, F$1) => u$2 in t ? yD(t, u$2, {
|
|
757
|
-
enumerable: !0,
|
|
758
|
-
configurable: !0,
|
|
759
|
-
writable: !0,
|
|
760
|
-
value: F$1
|
|
761
|
-
}) : t[u$2] = F$1, Z = (t, u$2, F$1) => (_D(t, typeof u$2 != "symbol" ? u$2 + "" : u$2, F$1), F$1);
|
|
762
|
-
var kD = class extends x {
|
|
763
|
-
constructor({ mask: u$2,...F$1 }) {
|
|
764
|
-
super(F$1), Z(this, "valueWithCursor", ""), Z(this, "_mask", "•"), this._mask = u$2 ?? "•", this.on("finalize", () => {
|
|
765
|
-
this.valueWithCursor = this.masked;
|
|
766
|
-
}), this.on("value", () => {
|
|
767
|
-
if (this.cursor >= this.value.length) this.valueWithCursor = `${this.masked}${import_picocolors$3.default.inverse(import_picocolors$3.default.hidden("_"))}`;
|
|
768
|
-
else {
|
|
769
|
-
const e$1 = this.masked.slice(0, this.cursor), s = this.masked.slice(this.cursor);
|
|
770
|
-
this.valueWithCursor = `${e$1}${import_picocolors$3.default.inverse(s[0])}${s.slice(1)}`;
|
|
771
|
-
}
|
|
772
|
-
});
|
|
773
|
-
}
|
|
774
|
-
get cursor() {
|
|
775
|
-
return this._cursor;
|
|
776
|
-
}
|
|
777
|
-
get masked() {
|
|
778
|
-
return this.value.replaceAll(/./g, this._mask);
|
|
779
|
-
}
|
|
780
|
-
};
|
|
781
|
-
var SD = Object.defineProperty, $D = (t, u$2, F$1) => u$2 in t ? SD(t, u$2, {
|
|
782
|
-
enumerable: !0,
|
|
783
|
-
configurable: !0,
|
|
784
|
-
writable: !0,
|
|
785
|
-
value: F$1
|
|
786
|
-
}) : t[u$2] = F$1, q$1 = (t, u$2, F$1) => ($D(t, typeof u$2 != "symbol" ? u$2 + "" : u$2, F$1), F$1);
|
|
787
|
-
var jD = class extends x {
|
|
788
|
-
constructor(u$2) {
|
|
789
|
-
super(u$2, !1), q$1(this, "options"), q$1(this, "cursor", 0), this.options = u$2.options, this.cursor = this.options.findIndex(({ value: F$1 }) => F$1 === u$2.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (F$1) => {
|
|
790
|
-
switch (F$1) {
|
|
791
|
-
case "left":
|
|
792
|
-
case "up":
|
|
793
|
-
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
794
|
-
break;
|
|
795
|
-
case "down":
|
|
796
|
-
case "right":
|
|
797
|
-
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
798
|
-
break;
|
|
799
|
-
}
|
|
800
|
-
this.changeValue();
|
|
801
|
-
});
|
|
802
|
-
}
|
|
803
|
-
get _value() {
|
|
804
|
-
return this.options[this.cursor];
|
|
805
|
-
}
|
|
806
|
-
changeValue() {
|
|
807
|
-
this.value = this._value.value;
|
|
808
|
-
}
|
|
809
|
-
};
|
|
810
|
-
var MD = Object.defineProperty, TD = (t, u$2, F$1) => u$2 in t ? MD(t, u$2, {
|
|
811
|
-
enumerable: !0,
|
|
812
|
-
configurable: !0,
|
|
813
|
-
writable: !0,
|
|
814
|
-
value: F$1
|
|
815
|
-
}) : t[u$2] = F$1, H = (t, u$2, F$1) => (TD(t, typeof u$2 != "symbol" ? u$2 + "" : u$2, F$1), F$1);
|
|
816
|
-
var OD = class extends x {
|
|
817
|
-
constructor(u$2) {
|
|
818
|
-
super(u$2, !1), H(this, "options"), H(this, "cursor", 0), this.options = u$2.options;
|
|
819
|
-
const F$1 = this.options.map(({ value: [e$1] }) => e$1?.toLowerCase());
|
|
820
|
-
this.cursor = Math.max(F$1.indexOf(u$2.initialValue), 0), this.on("key", (e$1) => {
|
|
821
|
-
if (!F$1.includes(e$1)) return;
|
|
822
|
-
const s = this.options.find(({ value: [i$1] }) => i$1?.toLowerCase() === e$1);
|
|
823
|
-
s && (this.value = s.value, this.state = "submit", this.emit("submit"));
|
|
824
|
-
});
|
|
825
|
-
}
|
|
826
|
-
};
|
|
827
|
-
var PD = class extends x {
|
|
828
|
-
get valueWithCursor() {
|
|
829
|
-
if (this.state === "submit") return this.value;
|
|
830
|
-
if (this.cursor >= this.value.length) return `${this.value}\u2588`;
|
|
831
|
-
const u$2 = this.value.slice(0, this.cursor), [F$1, ...e$1] = this.value.slice(this.cursor);
|
|
832
|
-
return `${u$2}${import_picocolors$3.default.inverse(F$1)}${e$1.join("")}`;
|
|
833
|
-
}
|
|
834
|
-
get cursor() {
|
|
835
|
-
return this._cursor;
|
|
836
|
-
}
|
|
837
|
-
constructor(u$2) {
|
|
838
|
-
super(u$2), this.on("finalize", () => {
|
|
839
|
-
this.value || (this.value = u$2.defaultValue);
|
|
840
|
-
});
|
|
841
|
-
}
|
|
842
|
-
};
|
|
843
|
-
|
|
844
|
-
//#endregion
|
|
845
|
-
//#region ../../node_modules/.pnpm/@clack+prompts@0.10.0/node_modules/@clack/prompts/dist/index.mjs
|
|
846
|
-
var import_picocolors$2 = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
847
|
-
var import_src = /* @__PURE__ */ __toESM(require_src(), 1);
|
|
848
|
-
function ce() {
|
|
849
|
-
return node_process.default.platform !== "win32" ? node_process.default.env.TERM !== "linux" : !!node_process.default.env.CI || !!node_process.default.env.WT_SESSION || !!node_process.default.env.TERMINUS_SUBLIME || node_process.default.env.ConEmuTask === "{cmd::Cmder}" || node_process.default.env.TERM_PROGRAM === "Terminus-Sublime" || node_process.default.env.TERM_PROGRAM === "vscode" || node_process.default.env.TERM === "xterm-256color" || node_process.default.env.TERM === "alacritty" || node_process.default.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
850
|
-
}
|
|
851
|
-
const V = ce(), u$1 = (t, n$1) => V ? t : n$1, le = u$1("◆", "*"), L = u$1("■", "x"), W = u$1("▲", "x"), C = u$1("◇", "o"), ue = u$1("┌", "T"), o$1 = u$1("│", "|"), d = u$1("└", "—"), k = u$1("●", ">"), P = u$1("○", " "), A = u$1("◻", "[•]"), T = u$1("◼", "[+]"), F = u$1("◻", "[ ]"), $e = u$1("▪", "•"), _ = u$1("─", "-"), me = u$1("╮", "+"), de = u$1("├", "+"), pe = u$1("╯", "+"), q = u$1("●", "•"), D = u$1("◆", "*"), U = u$1("▲", "!"), K = u$1("■", "x"), w = (t) => {
|
|
852
|
-
switch (t) {
|
|
853
|
-
case "initial":
|
|
854
|
-
case "active": return import_picocolors$2.default.cyan(le);
|
|
855
|
-
case "cancel": return import_picocolors$2.default.red(L);
|
|
856
|
-
case "error": return import_picocolors$2.default.yellow(W);
|
|
857
|
-
case "submit": return import_picocolors$2.default.green(C);
|
|
858
|
-
}
|
|
859
|
-
}, B = (t) => {
|
|
860
|
-
const { cursor: n$1, options: s, style: r$1 } = t, i$1 = t.maxItems ?? Number.POSITIVE_INFINITY, a$1 = Math.max(process.stdout.rows - 4, 0), c$2 = Math.min(a$1, Math.max(i$1, 5));
|
|
861
|
-
let l$1 = 0;
|
|
862
|
-
n$1 >= l$1 + c$2 - 3 ? l$1 = Math.max(Math.min(n$1 - c$2 + 3, s.length - c$2), 0) : n$1 < l$1 + 2 && (l$1 = Math.max(n$1 - 2, 0));
|
|
863
|
-
const $$2 = c$2 < s.length && l$1 > 0, p$1 = c$2 < s.length && l$1 + c$2 < s.length;
|
|
864
|
-
return s.slice(l$1, l$1 + c$2).map((M$1, v$1, x$1) => {
|
|
865
|
-
const j$1 = v$1 === 0 && $$2, E = v$1 === x$1.length - 1 && p$1;
|
|
866
|
-
return j$1 || E ? import_picocolors$2.default.dim("...") : r$1(M$1, v$1 + l$1 === n$1);
|
|
867
|
-
});
|
|
868
|
-
}, he = (t) => new PD({
|
|
869
|
-
validate: t.validate,
|
|
870
|
-
placeholder: t.placeholder,
|
|
871
|
-
defaultValue: t.defaultValue,
|
|
872
|
-
initialValue: t.initialValue,
|
|
873
|
-
render() {
|
|
874
|
-
const n$1 = `${import_picocolors$2.default.gray(o$1)}
|
|
875
|
-
${w(this.state)} ${t.message}
|
|
876
|
-
`, s = t.placeholder ? import_picocolors$2.default.inverse(t.placeholder[0]) + import_picocolors$2.default.dim(t.placeholder.slice(1)) : import_picocolors$2.default.inverse(import_picocolors$2.default.hidden("_")), r$1 = this.value ? this.valueWithCursor : s;
|
|
877
|
-
switch (this.state) {
|
|
878
|
-
case "error": return `${n$1.trim()}
|
|
879
|
-
${import_picocolors$2.default.yellow(o$1)} ${r$1}
|
|
880
|
-
${import_picocolors$2.default.yellow(d)} ${import_picocolors$2.default.yellow(this.error)}
|
|
881
|
-
`;
|
|
882
|
-
case "submit": return `${n$1}${import_picocolors$2.default.gray(o$1)} ${import_picocolors$2.default.dim(this.value || t.placeholder)}`;
|
|
883
|
-
case "cancel": return `${n$1}${import_picocolors$2.default.gray(o$1)} ${import_picocolors$2.default.strikethrough(import_picocolors$2.default.dim(this.value ?? ""))}${this.value?.trim() ? `
|
|
884
|
-
${import_picocolors$2.default.gray(o$1)}` : ""}`;
|
|
885
|
-
default: return `${n$1}${import_picocolors$2.default.cyan(o$1)} ${r$1}
|
|
886
|
-
${import_picocolors$2.default.cyan(d)}
|
|
887
|
-
`;
|
|
888
|
-
}
|
|
889
|
-
}
|
|
890
|
-
}).prompt(), ge = (t) => new kD({
|
|
891
|
-
validate: t.validate,
|
|
892
|
-
mask: t.mask ?? $e,
|
|
893
|
-
render() {
|
|
894
|
-
const n$1 = `${import_picocolors$2.default.gray(o$1)}
|
|
895
|
-
${w(this.state)} ${t.message}
|
|
896
|
-
`, s = this.valueWithCursor, r$1 = this.masked;
|
|
897
|
-
switch (this.state) {
|
|
898
|
-
case "error": return `${n$1.trim()}
|
|
899
|
-
${import_picocolors$2.default.yellow(o$1)} ${r$1}
|
|
900
|
-
${import_picocolors$2.default.yellow(d)} ${import_picocolors$2.default.yellow(this.error)}
|
|
901
|
-
`;
|
|
902
|
-
case "submit": return `${n$1}${import_picocolors$2.default.gray(o$1)} ${import_picocolors$2.default.dim(r$1)}`;
|
|
903
|
-
case "cancel": return `${n$1}${import_picocolors$2.default.gray(o$1)} ${import_picocolors$2.default.strikethrough(import_picocolors$2.default.dim(r$1 ?? ""))}${r$1 ? `
|
|
904
|
-
${import_picocolors$2.default.gray(o$1)}` : ""}`;
|
|
905
|
-
default: return `${n$1}${import_picocolors$2.default.cyan(o$1)} ${s}
|
|
906
|
-
${import_picocolors$2.default.cyan(d)}
|
|
907
|
-
`;
|
|
908
|
-
}
|
|
909
|
-
}
|
|
910
|
-
}).prompt(), ye = (t) => {
|
|
911
|
-
const n$1 = t.active ?? "Yes", s = t.inactive ?? "No";
|
|
912
|
-
return new fD({
|
|
913
|
-
active: n$1,
|
|
914
|
-
inactive: s,
|
|
915
|
-
initialValue: t.initialValue ?? !0,
|
|
916
|
-
render() {
|
|
917
|
-
const r$1 = `${import_picocolors$2.default.gray(o$1)}
|
|
918
|
-
${w(this.state)} ${t.message}
|
|
919
|
-
`, i$1 = this.value ? n$1 : s;
|
|
920
|
-
switch (this.state) {
|
|
921
|
-
case "submit": return `${r$1}${import_picocolors$2.default.gray(o$1)} ${import_picocolors$2.default.dim(i$1)}`;
|
|
922
|
-
case "cancel": return `${r$1}${import_picocolors$2.default.gray(o$1)} ${import_picocolors$2.default.strikethrough(import_picocolors$2.default.dim(i$1))}
|
|
923
|
-
${import_picocolors$2.default.gray(o$1)}`;
|
|
924
|
-
default: return `${r$1}${import_picocolors$2.default.cyan(o$1)} ${this.value ? `${import_picocolors$2.default.green(k)} ${n$1}` : `${import_picocolors$2.default.dim(P)} ${import_picocolors$2.default.dim(n$1)}`} ${import_picocolors$2.default.dim("/")} ${this.value ? `${import_picocolors$2.default.dim(P)} ${import_picocolors$2.default.dim(s)}` : `${import_picocolors$2.default.green(k)} ${s}`}
|
|
925
|
-
${import_picocolors$2.default.cyan(d)}
|
|
926
|
-
`;
|
|
927
|
-
}
|
|
928
|
-
}
|
|
929
|
-
}).prompt();
|
|
930
|
-
}, ve = (t) => {
|
|
931
|
-
const n$1 = (s, r$1) => {
|
|
932
|
-
const i$1 = s.label ?? String(s.value);
|
|
933
|
-
switch (r$1) {
|
|
934
|
-
case "selected": return `${import_picocolors$2.default.dim(i$1)}`;
|
|
935
|
-
case "active": return `${import_picocolors$2.default.green(k)} ${i$1} ${s.hint ? import_picocolors$2.default.dim(`(${s.hint})`) : ""}`;
|
|
936
|
-
case "cancelled": return `${import_picocolors$2.default.strikethrough(import_picocolors$2.default.dim(i$1))}`;
|
|
937
|
-
default: return `${import_picocolors$2.default.dim(P)} ${import_picocolors$2.default.dim(i$1)}`;
|
|
938
|
-
}
|
|
939
|
-
};
|
|
940
|
-
return new jD({
|
|
941
|
-
options: t.options,
|
|
942
|
-
initialValue: t.initialValue,
|
|
943
|
-
render() {
|
|
944
|
-
const s = `${import_picocolors$2.default.gray(o$1)}
|
|
945
|
-
${w(this.state)} ${t.message}
|
|
946
|
-
`;
|
|
947
|
-
switch (this.state) {
|
|
948
|
-
case "submit": return `${s}${import_picocolors$2.default.gray(o$1)} ${n$1(this.options[this.cursor], "selected")}`;
|
|
949
|
-
case "cancel": return `${s}${import_picocolors$2.default.gray(o$1)} ${n$1(this.options[this.cursor], "cancelled")}
|
|
950
|
-
${import_picocolors$2.default.gray(o$1)}`;
|
|
951
|
-
default: return `${s}${import_picocolors$2.default.cyan(o$1)} ${B({
|
|
952
|
-
cursor: this.cursor,
|
|
953
|
-
options: this.options,
|
|
954
|
-
maxItems: t.maxItems,
|
|
955
|
-
style: (r$1, i$1) => n$1(r$1, i$1 ? "active" : "inactive")
|
|
956
|
-
}).join(`
|
|
957
|
-
${import_picocolors$2.default.cyan(o$1)} `)}
|
|
958
|
-
${import_picocolors$2.default.cyan(d)}
|
|
959
|
-
`;
|
|
960
|
-
}
|
|
961
|
-
}
|
|
962
|
-
}).prompt();
|
|
963
|
-
}, we = (t) => {
|
|
964
|
-
const n$1 = (s, r$1 = "inactive") => {
|
|
965
|
-
const i$1 = s.label ?? String(s.value);
|
|
966
|
-
return r$1 === "selected" ? `${import_picocolors$2.default.dim(i$1)}` : r$1 === "cancelled" ? `${import_picocolors$2.default.strikethrough(import_picocolors$2.default.dim(i$1))}` : r$1 === "active" ? `${import_picocolors$2.default.bgCyan(import_picocolors$2.default.gray(` ${s.value} `))} ${i$1} ${s.hint ? import_picocolors$2.default.dim(`(${s.hint})`) : ""}` : `${import_picocolors$2.default.gray(import_picocolors$2.default.bgWhite(import_picocolors$2.default.inverse(` ${s.value} `)))} ${i$1} ${s.hint ? import_picocolors$2.default.dim(`(${s.hint})`) : ""}`;
|
|
967
|
-
};
|
|
968
|
-
return new OD({
|
|
969
|
-
options: t.options,
|
|
970
|
-
initialValue: t.initialValue,
|
|
971
|
-
render() {
|
|
972
|
-
const s = `${import_picocolors$2.default.gray(o$1)}
|
|
973
|
-
${w(this.state)} ${t.message}
|
|
974
|
-
`;
|
|
975
|
-
switch (this.state) {
|
|
976
|
-
case "submit": return `${s}${import_picocolors$2.default.gray(o$1)} ${n$1(this.options.find((r$1) => r$1.value === this.value) ?? t.options[0], "selected")}`;
|
|
977
|
-
case "cancel": return `${s}${import_picocolors$2.default.gray(o$1)} ${n$1(this.options[0], "cancelled")}
|
|
978
|
-
${import_picocolors$2.default.gray(o$1)}`;
|
|
979
|
-
default: return `${s}${import_picocolors$2.default.cyan(o$1)} ${this.options.map((r$1, i$1) => n$1(r$1, i$1 === this.cursor ? "active" : "inactive")).join(`
|
|
980
|
-
${import_picocolors$2.default.cyan(o$1)} `)}
|
|
981
|
-
${import_picocolors$2.default.cyan(d)}
|
|
982
|
-
`;
|
|
983
|
-
}
|
|
984
|
-
}
|
|
985
|
-
}).prompt();
|
|
986
|
-
}, fe = (t) => {
|
|
987
|
-
const n$1 = (s, r$1) => {
|
|
988
|
-
const i$1 = s.label ?? String(s.value);
|
|
989
|
-
return r$1 === "active" ? `${import_picocolors$2.default.cyan(A)} ${i$1} ${s.hint ? import_picocolors$2.default.dim(`(${s.hint})`) : ""}` : r$1 === "selected" ? `${import_picocolors$2.default.green(T)} ${import_picocolors$2.default.dim(i$1)}` : r$1 === "cancelled" ? `${import_picocolors$2.default.strikethrough(import_picocolors$2.default.dim(i$1))}` : r$1 === "active-selected" ? `${import_picocolors$2.default.green(T)} ${i$1} ${s.hint ? import_picocolors$2.default.dim(`(${s.hint})`) : ""}` : r$1 === "submitted" ? `${import_picocolors$2.default.dim(i$1)}` : `${import_picocolors$2.default.dim(F)} ${import_picocolors$2.default.dim(i$1)}`;
|
|
990
|
-
};
|
|
991
|
-
return new wD({
|
|
992
|
-
options: t.options,
|
|
993
|
-
initialValues: t.initialValues,
|
|
994
|
-
required: t.required ?? !0,
|
|
995
|
-
cursorAt: t.cursorAt,
|
|
996
|
-
validate(s) {
|
|
997
|
-
if (this.required && s.length === 0) return `Please select at least one option.
|
|
998
|
-
${import_picocolors$2.default.reset(import_picocolors$2.default.dim(`Press ${import_picocolors$2.default.gray(import_picocolors$2.default.bgWhite(import_picocolors$2.default.inverse(" space ")))} to select, ${import_picocolors$2.default.gray(import_picocolors$2.default.bgWhite(import_picocolors$2.default.inverse(" enter ")))} to submit`))}`;
|
|
999
|
-
},
|
|
1000
|
-
render() {
|
|
1001
|
-
const s = `${import_picocolors$2.default.gray(o$1)}
|
|
1002
|
-
${w(this.state)} ${t.message}
|
|
1003
|
-
`, r$1 = (i$1, a$1) => {
|
|
1004
|
-
const c$2 = this.value.includes(i$1.value);
|
|
1005
|
-
return a$1 && c$2 ? n$1(i$1, "active-selected") : c$2 ? n$1(i$1, "selected") : n$1(i$1, a$1 ? "active" : "inactive");
|
|
1006
|
-
};
|
|
1007
|
-
switch (this.state) {
|
|
1008
|
-
case "submit": return `${s}${import_picocolors$2.default.gray(o$1)} ${this.options.filter(({ value: i$1 }) => this.value.includes(i$1)).map((i$1) => n$1(i$1, "submitted")).join(import_picocolors$2.default.dim(", ")) || import_picocolors$2.default.dim("none")}`;
|
|
1009
|
-
case "cancel": {
|
|
1010
|
-
const i$1 = this.options.filter(({ value: a$1 }) => this.value.includes(a$1)).map((a$1) => n$1(a$1, "cancelled")).join(import_picocolors$2.default.dim(", "));
|
|
1011
|
-
return `${s}${import_picocolors$2.default.gray(o$1)} ${i$1.trim() ? `${i$1}
|
|
1012
|
-
${import_picocolors$2.default.gray(o$1)}` : ""}`;
|
|
1013
|
-
}
|
|
1014
|
-
case "error": {
|
|
1015
|
-
const i$1 = this.error.split(`
|
|
1016
|
-
`).map((a$1, c$2) => c$2 === 0 ? `${import_picocolors$2.default.yellow(d)} ${import_picocolors$2.default.yellow(a$1)}` : ` ${a$1}`).join(`
|
|
1017
|
-
`);
|
|
1018
|
-
return `${s + import_picocolors$2.default.yellow(o$1)} ${B({
|
|
1019
|
-
options: this.options,
|
|
1020
|
-
cursor: this.cursor,
|
|
1021
|
-
maxItems: t.maxItems,
|
|
1022
|
-
style: r$1
|
|
1023
|
-
}).join(`
|
|
1024
|
-
${import_picocolors$2.default.yellow(o$1)} `)}
|
|
1025
|
-
${i$1}
|
|
1026
|
-
`;
|
|
1027
|
-
}
|
|
1028
|
-
default: return `${s}${import_picocolors$2.default.cyan(o$1)} ${B({
|
|
1029
|
-
options: this.options,
|
|
1030
|
-
cursor: this.cursor,
|
|
1031
|
-
maxItems: t.maxItems,
|
|
1032
|
-
style: r$1
|
|
1033
|
-
}).join(`
|
|
1034
|
-
${import_picocolors$2.default.cyan(o$1)} `)}
|
|
1035
|
-
${import_picocolors$2.default.cyan(d)}
|
|
1036
|
-
`;
|
|
1037
|
-
}
|
|
1038
|
-
}
|
|
1039
|
-
}).prompt();
|
|
1040
|
-
}, be = (t) => {
|
|
1041
|
-
const n$1 = (s, r$1, i$1 = []) => {
|
|
1042
|
-
const a$1 = s.label ?? String(s.value), c$2 = typeof s.group == "string", l$1 = c$2 && (i$1[i$1.indexOf(s) + 1] ?? { group: !0 }), $$2 = c$2 && l$1.group === !0, p$1 = c$2 ? `${$$2 ? d : o$1} ` : "";
|
|
1043
|
-
return r$1 === "active" ? `${import_picocolors$2.default.dim(p$1)}${import_picocolors$2.default.cyan(A)} ${a$1} ${s.hint ? import_picocolors$2.default.dim(`(${s.hint})`) : ""}` : r$1 === "group-active" ? `${p$1}${import_picocolors$2.default.cyan(A)} ${import_picocolors$2.default.dim(a$1)}` : r$1 === "group-active-selected" ? `${p$1}${import_picocolors$2.default.green(T)} ${import_picocolors$2.default.dim(a$1)}` : r$1 === "selected" ? `${import_picocolors$2.default.dim(p$1)}${import_picocolors$2.default.green(T)} ${import_picocolors$2.default.dim(a$1)}` : r$1 === "cancelled" ? `${import_picocolors$2.default.strikethrough(import_picocolors$2.default.dim(a$1))}` : r$1 === "active-selected" ? `${import_picocolors$2.default.dim(p$1)}${import_picocolors$2.default.green(T)} ${a$1} ${s.hint ? import_picocolors$2.default.dim(`(${s.hint})`) : ""}` : r$1 === "submitted" ? `${import_picocolors$2.default.dim(a$1)}` : `${import_picocolors$2.default.dim(p$1)}${import_picocolors$2.default.dim(F)} ${import_picocolors$2.default.dim(a$1)}`;
|
|
1044
|
-
};
|
|
1045
|
-
return new dD({
|
|
1046
|
-
options: t.options,
|
|
1047
|
-
initialValues: t.initialValues,
|
|
1048
|
-
required: t.required ?? !0,
|
|
1049
|
-
cursorAt: t.cursorAt,
|
|
1050
|
-
validate(s) {
|
|
1051
|
-
if (this.required && s.length === 0) return `Please select at least one option.
|
|
1052
|
-
${import_picocolors$2.default.reset(import_picocolors$2.default.dim(`Press ${import_picocolors$2.default.gray(import_picocolors$2.default.bgWhite(import_picocolors$2.default.inverse(" space ")))} to select, ${import_picocolors$2.default.gray(import_picocolors$2.default.bgWhite(import_picocolors$2.default.inverse(" enter ")))} to submit`))}`;
|
|
1053
|
-
},
|
|
1054
|
-
render() {
|
|
1055
|
-
const s = `${import_picocolors$2.default.gray(o$1)}
|
|
1056
|
-
${w(this.state)} ${t.message}
|
|
1057
|
-
`;
|
|
1058
|
-
switch (this.state) {
|
|
1059
|
-
case "submit": return `${s}${import_picocolors$2.default.gray(o$1)} ${this.options.filter(({ value: r$1 }) => this.value.includes(r$1)).map((r$1) => n$1(r$1, "submitted")).join(import_picocolors$2.default.dim(", "))}`;
|
|
1060
|
-
case "cancel": {
|
|
1061
|
-
const r$1 = this.options.filter(({ value: i$1 }) => this.value.includes(i$1)).map((i$1) => n$1(i$1, "cancelled")).join(import_picocolors$2.default.dim(", "));
|
|
1062
|
-
return `${s}${import_picocolors$2.default.gray(o$1)} ${r$1.trim() ? `${r$1}
|
|
1063
|
-
${import_picocolors$2.default.gray(o$1)}` : ""}`;
|
|
1064
|
-
}
|
|
1065
|
-
case "error": {
|
|
1066
|
-
const r$1 = this.error.split(`
|
|
1067
|
-
`).map((i$1, a$1) => a$1 === 0 ? `${import_picocolors$2.default.yellow(d)} ${import_picocolors$2.default.yellow(i$1)}` : ` ${i$1}`).join(`
|
|
1068
|
-
`);
|
|
1069
|
-
return `${s}${import_picocolors$2.default.yellow(o$1)} ${this.options.map((i$1, a$1, c$2) => {
|
|
1070
|
-
const l$1 = this.value.includes(i$1.value) || i$1.group === !0 && this.isGroupSelected(`${i$1.value}`), $$2 = a$1 === this.cursor;
|
|
1071
|
-
return !$$2 && typeof i$1.group == "string" && this.options[this.cursor].value === i$1.group ? n$1(i$1, l$1 ? "group-active-selected" : "group-active", c$2) : $$2 && l$1 ? n$1(i$1, "active-selected", c$2) : l$1 ? n$1(i$1, "selected", c$2) : n$1(i$1, $$2 ? "active" : "inactive", c$2);
|
|
1072
|
-
}).join(`
|
|
1073
|
-
${import_picocolors$2.default.yellow(o$1)} `)}
|
|
1074
|
-
${r$1}
|
|
1075
|
-
`;
|
|
1076
|
-
}
|
|
1077
|
-
default: return `${s}${import_picocolors$2.default.cyan(o$1)} ${this.options.map((r$1, i$1, a$1) => {
|
|
1078
|
-
const c$2 = this.value.includes(r$1.value) || r$1.group === !0 && this.isGroupSelected(`${r$1.value}`), l$1 = i$1 === this.cursor;
|
|
1079
|
-
return !l$1 && typeof r$1.group == "string" && this.options[this.cursor].value === r$1.group ? n$1(r$1, c$2 ? "group-active-selected" : "group-active", a$1) : l$1 && c$2 ? n$1(r$1, "active-selected", a$1) : c$2 ? n$1(r$1, "selected", a$1) : n$1(r$1, l$1 ? "active" : "inactive", a$1);
|
|
1080
|
-
}).join(`
|
|
1081
|
-
${import_picocolors$2.default.cyan(o$1)} `)}
|
|
1082
|
-
${import_picocolors$2.default.cyan(d)}
|
|
1083
|
-
`;
|
|
1084
|
-
}
|
|
1085
|
-
}
|
|
1086
|
-
}).prompt();
|
|
1087
|
-
}, Me = (t = "", n$1 = "") => {
|
|
1088
|
-
const s = `
|
|
1089
|
-
${t}
|
|
1090
|
-
`.split(`
|
|
1091
|
-
`), r$1 = (0, node_util.stripVTControlCharacters)(n$1).length, i$1 = Math.max(s.reduce((c$2, l$1) => {
|
|
1092
|
-
const $$2 = (0, node_util.stripVTControlCharacters)(l$1);
|
|
1093
|
-
return $$2.length > c$2 ? $$2.length : c$2;
|
|
1094
|
-
}, 0), r$1) + 2, a$1 = s.map((c$2) => `${import_picocolors$2.default.gray(o$1)} ${import_picocolors$2.default.dim(c$2)}${" ".repeat(i$1 - (0, node_util.stripVTControlCharacters)(c$2).length)}${import_picocolors$2.default.gray(o$1)}`).join(`
|
|
1095
|
-
`);
|
|
1096
|
-
process.stdout.write(`${import_picocolors$2.default.gray(o$1)}
|
|
1097
|
-
${import_picocolors$2.default.green(C)} ${import_picocolors$2.default.reset(n$1)} ${import_picocolors$2.default.gray(_.repeat(Math.max(i$1 - r$1 - 1, 1)) + me)}
|
|
1098
|
-
${a$1}
|
|
1099
|
-
${import_picocolors$2.default.gray(de + _.repeat(i$1 + 2) + pe)}
|
|
1100
|
-
`);
|
|
1101
|
-
}, xe = (t = "") => {
|
|
1102
|
-
process.stdout.write(`${import_picocolors$2.default.gray(d)} ${import_picocolors$2.default.red(t)}
|
|
1103
|
-
|
|
1104
|
-
`);
|
|
1105
|
-
}, Ie = (t = "") => {
|
|
1106
|
-
process.stdout.write(`${import_picocolors$2.default.gray(ue)} ${t}
|
|
1107
|
-
`);
|
|
1108
|
-
}, Se = (t = "") => {
|
|
1109
|
-
process.stdout.write(`${import_picocolors$2.default.gray(o$1)}
|
|
1110
|
-
${import_picocolors$2.default.gray(d)} ${t}
|
|
1111
|
-
|
|
1112
|
-
`);
|
|
1113
|
-
}, f = {
|
|
1114
|
-
message: (t = "", { symbol: n$1 = import_picocolors$2.default.gray(o$1) } = {}) => {
|
|
1115
|
-
const s = [`${import_picocolors$2.default.gray(o$1)}`];
|
|
1116
|
-
if (t) {
|
|
1117
|
-
const [r$1, ...i$1] = t.split(`
|
|
1118
|
-
`);
|
|
1119
|
-
s.push(`${n$1} ${r$1}`, ...i$1.map((a$1) => `${import_picocolors$2.default.gray(o$1)} ${a$1}`));
|
|
1120
|
-
}
|
|
1121
|
-
process.stdout.write(`${s.join(`
|
|
1122
|
-
`)}
|
|
1123
|
-
`);
|
|
1124
|
-
},
|
|
1125
|
-
info: (t) => {
|
|
1126
|
-
f.message(t, { symbol: import_picocolors$2.default.blue(q) });
|
|
1127
|
-
},
|
|
1128
|
-
success: (t) => {
|
|
1129
|
-
f.message(t, { symbol: import_picocolors$2.default.green(D) });
|
|
1130
|
-
},
|
|
1131
|
-
step: (t) => {
|
|
1132
|
-
f.message(t, { symbol: import_picocolors$2.default.green(C) });
|
|
1133
|
-
},
|
|
1134
|
-
warn: (t) => {
|
|
1135
|
-
f.message(t, { symbol: import_picocolors$2.default.yellow(U) });
|
|
1136
|
-
},
|
|
1137
|
-
warning: (t) => {
|
|
1138
|
-
f.warn(t);
|
|
1139
|
-
},
|
|
1140
|
-
error: (t) => {
|
|
1141
|
-
f.message(t, { symbol: import_picocolors$2.default.red(K) });
|
|
1142
|
-
}
|
|
1143
|
-
}, J = `${import_picocolors$2.default.gray(o$1)} `, b = {
|
|
1144
|
-
message: async (t, { symbol: n$1 = import_picocolors$2.default.gray(o$1) } = {}) => {
|
|
1145
|
-
process.stdout.write(`${import_picocolors$2.default.gray(o$1)}
|
|
1146
|
-
${n$1} `);
|
|
1147
|
-
let s = 3;
|
|
1148
|
-
for await (let r$1 of t) {
|
|
1149
|
-
r$1 = r$1.replace(/\n/g, `
|
|
1150
|
-
${J}`), r$1.includes(`
|
|
1151
|
-
`) && (s = 3 + (0, node_util.stripVTControlCharacters)(r$1.slice(r$1.lastIndexOf(`
|
|
1152
|
-
`))).length);
|
|
1153
|
-
const i$1 = (0, node_util.stripVTControlCharacters)(r$1).length;
|
|
1154
|
-
s + i$1 < process.stdout.columns ? (s += i$1, process.stdout.write(r$1)) : (process.stdout.write(`
|
|
1155
|
-
${J}${r$1.trimStart()}`), s = 3 + (0, node_util.stripVTControlCharacters)(r$1.trimStart()).length);
|
|
1156
|
-
}
|
|
1157
|
-
process.stdout.write(`
|
|
1158
|
-
`);
|
|
1159
|
-
},
|
|
1160
|
-
info: (t) => b.message(t, { symbol: import_picocolors$2.default.blue(q) }),
|
|
1161
|
-
success: (t) => b.message(t, { symbol: import_picocolors$2.default.green(D) }),
|
|
1162
|
-
step: (t) => b.message(t, { symbol: import_picocolors$2.default.green(C) }),
|
|
1163
|
-
warn: (t) => b.message(t, { symbol: import_picocolors$2.default.yellow(U) }),
|
|
1164
|
-
warning: (t) => b.warn(t),
|
|
1165
|
-
error: (t) => b.message(t, { symbol: import_picocolors$2.default.red(K) })
|
|
1166
|
-
}, Y = ({ indicator: t = "dots" } = {}) => {
|
|
1167
|
-
const n$1 = V ? [
|
|
1168
|
-
"◒",
|
|
1169
|
-
"◐",
|
|
1170
|
-
"◓",
|
|
1171
|
-
"◑"
|
|
1172
|
-
] : [
|
|
1173
|
-
"•",
|
|
1174
|
-
"o",
|
|
1175
|
-
"O",
|
|
1176
|
-
"0"
|
|
1177
|
-
], s = V ? 80 : 120, r$1 = process.env.CI === "true";
|
|
1178
|
-
let i$1, a$1, c$2 = !1, l$1 = "", $$2, p$1 = performance.now();
|
|
1179
|
-
const M$1 = (m$1) => {
|
|
1180
|
-
c$2 && N$1(m$1 > 1 ? "Something went wrong" : "Canceled", m$1);
|
|
1181
|
-
}, v$1 = () => M$1(2), x$1 = () => M$1(1), j$1 = () => {
|
|
1182
|
-
process.on("uncaughtExceptionMonitor", v$1), process.on("unhandledRejection", v$1), process.on("SIGINT", x$1), process.on("SIGTERM", x$1), process.on("exit", M$1);
|
|
1183
|
-
}, E = () => {
|
|
1184
|
-
process.removeListener("uncaughtExceptionMonitor", v$1), process.removeListener("unhandledRejection", v$1), process.removeListener("SIGINT", x$1), process.removeListener("SIGTERM", x$1), process.removeListener("exit", M$1);
|
|
1185
|
-
}, O$1 = () => {
|
|
1186
|
-
if ($$2 === void 0) return;
|
|
1187
|
-
r$1 && process.stdout.write(`
|
|
1188
|
-
`);
|
|
1189
|
-
const m$1 = $$2.split(`
|
|
1190
|
-
`);
|
|
1191
|
-
process.stdout.write(import_src.cursor.move(-999, m$1.length - 1)), process.stdout.write(import_src.erase.down(m$1.length));
|
|
1192
|
-
}, R$1 = (m$1) => m$1.replace(/\.+$/, ""), G$1 = (m$1) => {
|
|
1193
|
-
const h$2 = (performance.now() - m$1) / 1e3, y$1 = Math.floor(h$2 / 60), I$1 = Math.floor(h$2 % 60);
|
|
1194
|
-
return y$1 > 0 ? `[${y$1}m ${I$1}s]` : `[${I$1}s]`;
|
|
1195
|
-
}, H$1 = (m$1 = "") => {
|
|
1196
|
-
c$2 = !0, i$1 = cD(), l$1 = R$1(m$1), p$1 = performance.now(), process.stdout.write(`${import_picocolors$2.default.gray(o$1)}
|
|
1197
|
-
`);
|
|
1198
|
-
let h$2 = 0, y$1 = 0;
|
|
1199
|
-
j$1(), a$1 = setInterval(() => {
|
|
1200
|
-
if (r$1 && l$1 === $$2) return;
|
|
1201
|
-
O$1(), $$2 = l$1;
|
|
1202
|
-
const I$1 = import_picocolors$2.default.magenta(n$1[h$2]);
|
|
1203
|
-
if (r$1) process.stdout.write(`${I$1} ${l$1}...`);
|
|
1204
|
-
else if (t === "timer") process.stdout.write(`${I$1} ${l$1} ${G$1(p$1)}`);
|
|
1205
|
-
else {
|
|
1206
|
-
const z$1 = ".".repeat(Math.floor(y$1)).slice(0, 3);
|
|
1207
|
-
process.stdout.write(`${I$1} ${l$1}${z$1}`);
|
|
1208
|
-
}
|
|
1209
|
-
h$2 = h$2 + 1 < n$1.length ? h$2 + 1 : 0, y$1 = y$1 < n$1.length ? y$1 + .125 : 0;
|
|
1210
|
-
}, s);
|
|
1211
|
-
}, N$1 = (m$1 = "", h$2 = 0) => {
|
|
1212
|
-
c$2 = !1, clearInterval(a$1), O$1();
|
|
1213
|
-
const y$1 = h$2 === 0 ? import_picocolors$2.default.green(C) : h$2 === 1 ? import_picocolors$2.default.red(L) : import_picocolors$2.default.red(W);
|
|
1214
|
-
l$1 = R$1(m$1 ?? l$1), t === "timer" ? process.stdout.write(`${y$1} ${l$1} ${G$1(p$1)}
|
|
1215
|
-
`) : process.stdout.write(`${y$1} ${l$1}
|
|
1216
|
-
`), E(), i$1();
|
|
1217
|
-
};
|
|
1218
|
-
return {
|
|
1219
|
-
start: H$1,
|
|
1220
|
-
stop: N$1,
|
|
1221
|
-
message: (m$1 = "") => {
|
|
1222
|
-
l$1 = R$1(m$1 ?? l$1);
|
|
1223
|
-
}
|
|
1224
|
-
};
|
|
1225
|
-
}, Ce = async (t, n$1) => {
|
|
1226
|
-
const s = {}, r$1 = Object.keys(t);
|
|
1227
|
-
for (const i$1 of r$1) {
|
|
1228
|
-
const a$1 = t[i$1], c$2 = await a$1({ results: s })?.catch((l$1) => {
|
|
1229
|
-
throw l$1;
|
|
1230
|
-
});
|
|
1231
|
-
if (typeof n$1?.onCancel == "function" && BD(c$2)) {
|
|
1232
|
-
s[i$1] = "canceled", n$1.onCancel({ results: s });
|
|
1233
|
-
continue;
|
|
1234
|
-
}
|
|
1235
|
-
s[i$1] = c$2;
|
|
1236
|
-
}
|
|
1237
|
-
return s;
|
|
1238
|
-
}, Te = async (t) => {
|
|
1239
|
-
for (const n$1 of t) {
|
|
1240
|
-
if (n$1.enabled === !1) continue;
|
|
1241
|
-
const s = Y();
|
|
1242
|
-
s.start(n$1.title);
|
|
1243
|
-
const r$1 = await n$1.task(s.message);
|
|
1244
|
-
s.stop(r$1 || n$1.title);
|
|
1245
|
-
}
|
|
1246
|
-
};
|
|
1247
|
-
|
|
1248
|
-
//#endregion
|
|
1249
84
|
//#region ../../node_modules/.pnpm/is-plain-obj@4.1.0/node_modules/is-plain-obj/index.js
|
|
1250
85
|
function isPlainObject$1(value) {
|
|
1251
86
|
if (typeof value !== "object" || value === null) return false;
|
|
@@ -1542,10 +377,10 @@ const NO_ESCAPE_REGEXP = /^[\w./-]+$/;
|
|
|
1542
377
|
//#endregion
|
|
1543
378
|
//#region ../../node_modules/.pnpm/is-unicode-supported@2.1.0/node_modules/is-unicode-supported/index.js
|
|
1544
379
|
function isUnicodeSupported() {
|
|
1545
|
-
const { env
|
|
1546
|
-
const { TERM, TERM_PROGRAM } = env
|
|
380
|
+
const { env } = node_process.default;
|
|
381
|
+
const { TERM, TERM_PROGRAM } = env;
|
|
1547
382
|
if (node_process.default.platform !== "win32") return TERM !== "linux";
|
|
1548
|
-
return Boolean(env
|
|
383
|
+
return Boolean(env.WT_SESSION) || Boolean(env.TERMINUS_SUBLIME) || env.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
1549
384
|
}
|
|
1550
385
|
|
|
1551
386
|
//#endregion
|
|
@@ -2043,8 +878,8 @@ var require_windows = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ise
|
|
|
2043
878
|
pathext = pathext.split(";");
|
|
2044
879
|
if (pathext.indexOf("") !== -1) return true;
|
|
2045
880
|
for (var i$1 = 0; i$1 < pathext.length; i$1++) {
|
|
2046
|
-
var p$
|
|
2047
|
-
if (p$
|
|
881
|
+
var p$6 = pathext[i$1].toLowerCase();
|
|
882
|
+
if (p$6 && path$10.substr(-p$6.length).toLowerCase() === p$6) return true;
|
|
2048
883
|
}
|
|
2049
884
|
return false;
|
|
2050
885
|
}
|
|
@@ -2085,11 +920,11 @@ var require_mode = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/isexe@
|
|
|
2085
920
|
var gid = stat.gid;
|
|
2086
921
|
var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid();
|
|
2087
922
|
var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid();
|
|
2088
|
-
var u$
|
|
2089
|
-
var g
|
|
2090
|
-
var o$
|
|
2091
|
-
var ug = u$
|
|
2092
|
-
return mod & o$
|
|
923
|
+
var u$1 = parseInt("100", 8);
|
|
924
|
+
var g = parseInt("010", 8);
|
|
925
|
+
var o$1 = parseInt("001", 8);
|
|
926
|
+
var ug = u$1 | g;
|
|
927
|
+
return mod & o$1 || mod & g && gid === myGid || mod & u$1 && uid === myUid || mod & ug && myUid === 0;
|
|
2093
928
|
}
|
|
2094
929
|
}) });
|
|
2095
930
|
|
|
@@ -2173,13 +1008,13 @@ var require_which = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/which
|
|
|
2173
1008
|
const pCmd = path$9.join(pathPart, cmd);
|
|
2174
1009
|
resolve(subStep(!pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd, i$1, 0));
|
|
2175
1010
|
});
|
|
2176
|
-
const subStep = (p$
|
|
1011
|
+
const subStep = (p$6, i$1, ii) => new Promise((resolve, reject) => {
|
|
2177
1012
|
if (ii === pathExt.length) return resolve(step(i$1 + 1));
|
|
2178
1013
|
const ext = pathExt[ii];
|
|
2179
|
-
isexe(p$
|
|
2180
|
-
if (!er && is) if (opt.all) found.push(p$
|
|
2181
|
-
else return resolve(p$
|
|
2182
|
-
return resolve(subStep(p$
|
|
1014
|
+
isexe(p$6 + ext, { pathExt: pathExtExe }, (er, is) => {
|
|
1015
|
+
if (!er && is) if (opt.all) found.push(p$6 + ext);
|
|
1016
|
+
else return resolve(p$6 + ext);
|
|
1017
|
+
return resolve(subStep(p$6, i$1, ii + 1));
|
|
2183
1018
|
});
|
|
2184
1019
|
});
|
|
2185
1020
|
return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
|
|
@@ -2192,9 +1027,9 @@ var require_which = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/which
|
|
|
2192
1027
|
const ppRaw = pathEnv[i$1];
|
|
2193
1028
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
2194
1029
|
const pCmd = path$9.join(pathPart, cmd);
|
|
2195
|
-
const p$
|
|
2196
|
-
for (let j
|
|
2197
|
-
const cur = p$
|
|
1030
|
+
const p$6 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
1031
|
+
for (let j = 0; j < pathExt.length; j++) {
|
|
1032
|
+
const cur = p$6 + pathExt[j];
|
|
2198
1033
|
try {
|
|
2199
1034
|
if (isexe.sync(cur, { pathExt: pathExtExe })) if (opt.all) found.push(cur);
|
|
2200
1035
|
else return cur;
|
|
@@ -2228,7 +1063,7 @@ var require_resolveCommand = /* @__PURE__ */ __commonJS({ "../../node_modules/.p
|
|
|
2228
1063
|
const which = require_which();
|
|
2229
1064
|
const getPathKey = require_path_key();
|
|
2230
1065
|
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
2231
|
-
const env
|
|
1066
|
+
const env = parsed.options.env || process.env;
|
|
2232
1067
|
const cwd = process.cwd();
|
|
2233
1068
|
const hasCustomCwd = parsed.options.cwd != null;
|
|
2234
1069
|
const shouldSwitchCwd = hasCustomCwd && process.chdir !== void 0 && !process.chdir.disabled;
|
|
@@ -2238,10 +1073,10 @@ var require_resolveCommand = /* @__PURE__ */ __commonJS({ "../../node_modules/.p
|
|
|
2238
1073
|
let resolved;
|
|
2239
1074
|
try {
|
|
2240
1075
|
resolved = which.sync(parsed.command, {
|
|
2241
|
-
path: env
|
|
1076
|
+
path: env[getPathKey({ env })],
|
|
2242
1077
|
pathExt: withoutPathExt ? path$8.delimiter : void 0
|
|
2243
1078
|
});
|
|
2244
|
-
} catch (e
|
|
1079
|
+
} catch (e) {} finally {
|
|
2245
1080
|
if (shouldSwitchCwd) process.chdir(cwd);
|
|
2246
1081
|
}
|
|
2247
1082
|
if (resolved) resolved = path$8.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
|
|
@@ -2307,7 +1142,7 @@ var require_readShebang = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
2307
1142
|
fd = fs$3.openSync(command, "r");
|
|
2308
1143
|
fs$3.readSync(fd, buffer, 0, size, 0);
|
|
2309
1144
|
fs$3.closeSync(fd);
|
|
2310
|
-
} catch (e
|
|
1145
|
+
} catch (e) {}
|
|
2311
1146
|
return shebangCommand(buffer.toString());
|
|
2312
1147
|
}
|
|
2313
1148
|
module.exports = readShebang$1;
|
|
@@ -2444,9 +1279,9 @@ var require_cross_spawn = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
2444
1279
|
//#region ../../node_modules/.pnpm/path-key@4.0.0/node_modules/path-key/index.js
|
|
2445
1280
|
var import_cross_spawn = /* @__PURE__ */ __toESM(require_cross_spawn(), 1);
|
|
2446
1281
|
function pathKey(options = {}) {
|
|
2447
|
-
const { env
|
|
1282
|
+
const { env = process.env, platform: platform$1 = process.platform } = options;
|
|
2448
1283
|
if (platform$1 !== "win32") return "PATH";
|
|
2449
|
-
return Object.keys(env
|
|
1284
|
+
return Object.keys(env).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
|
|
2450
1285
|
}
|
|
2451
1286
|
|
|
2452
1287
|
//#endregion
|
|
@@ -2488,12 +1323,12 @@ const applyExecPath = (result, pathParts, execPath$1, cwdPath) => {
|
|
|
2488
1323
|
const pathPart = node_path.default.resolve(cwdPath, toPath(execPath$1), "..");
|
|
2489
1324
|
if (!pathParts.includes(pathPart)) result.push(pathPart);
|
|
2490
1325
|
};
|
|
2491
|
-
const npmRunPathEnv = ({ env
|
|
2492
|
-
env
|
|
2493
|
-
const pathName = pathKey({ env
|
|
2494
|
-
options.path = env
|
|
2495
|
-
env
|
|
2496
|
-
return env
|
|
1326
|
+
const npmRunPathEnv = ({ env = node_process.default.env,...options } = {}) => {
|
|
1327
|
+
env = { ...env };
|
|
1328
|
+
const pathName = pathKey({ env });
|
|
1329
|
+
options.path = env[pathName];
|
|
1330
|
+
env[pathName] = npmRunPath(options);
|
|
1331
|
+
return env;
|
|
2497
1332
|
};
|
|
2498
1333
|
|
|
2499
1334
|
//#endregion
|
|
@@ -3684,18 +2519,18 @@ const addDefaultOptions = ({ extendEnv = true, preferLocal = false, cwd, localDi
|
|
|
3684
2519
|
serialization
|
|
3685
2520
|
});
|
|
3686
2521
|
const getEnv = ({ env: envOption, extendEnv, preferLocal, node, localDirectory, nodePath }) => {
|
|
3687
|
-
const env
|
|
2522
|
+
const env = extendEnv ? {
|
|
3688
2523
|
...node_process.default.env,
|
|
3689
2524
|
...envOption
|
|
3690
2525
|
} : envOption;
|
|
3691
2526
|
if (preferLocal || node) return npmRunPathEnv({
|
|
3692
|
-
env
|
|
2527
|
+
env,
|
|
3693
2528
|
cwd: localDirectory,
|
|
3694
2529
|
execPath: nodePath,
|
|
3695
2530
|
preferLocal,
|
|
3696
2531
|
addExecPath: node
|
|
3697
2532
|
});
|
|
3698
|
-
return env
|
|
2533
|
+
return env;
|
|
3699
2534
|
};
|
|
3700
2535
|
|
|
3701
2536
|
//#endregion
|
|
@@ -3738,15 +2573,15 @@ var c = class {
|
|
|
3738
2573
|
#n;
|
|
3739
2574
|
#r = !1;
|
|
3740
2575
|
#e = void 0;
|
|
3741
|
-
constructor(e
|
|
3742
|
-
this.#t = e
|
|
2576
|
+
constructor(e, t) {
|
|
2577
|
+
this.#t = e, this.#n = t;
|
|
3743
2578
|
}
|
|
3744
2579
|
next() {
|
|
3745
|
-
const e
|
|
3746
|
-
return this.#e = this.#e ? this.#e.then(e
|
|
2580
|
+
const e = () => this.#s();
|
|
2581
|
+
return this.#e = this.#e ? this.#e.then(e, e) : e(), this.#e;
|
|
3747
2582
|
}
|
|
3748
|
-
return(e
|
|
3749
|
-
const t = () => this.#i(e
|
|
2583
|
+
return(e) {
|
|
2584
|
+
const t = () => this.#i(e);
|
|
3750
2585
|
return this.#e ? this.#e.then(t, t) : t();
|
|
3751
2586
|
}
|
|
3752
2587
|
async #s() {
|
|
@@ -3754,29 +2589,29 @@ var c = class {
|
|
|
3754
2589
|
done: !0,
|
|
3755
2590
|
value: void 0
|
|
3756
2591
|
};
|
|
3757
|
-
let e
|
|
2592
|
+
let e;
|
|
3758
2593
|
try {
|
|
3759
|
-
e
|
|
2594
|
+
e = await this.#t.read();
|
|
3760
2595
|
} catch (t) {
|
|
3761
2596
|
throw this.#e = void 0, this.#r = !0, this.#t.releaseLock(), t;
|
|
3762
2597
|
}
|
|
3763
|
-
return e
|
|
2598
|
+
return e.done && (this.#e = void 0, this.#r = !0, this.#t.releaseLock()), e;
|
|
3764
2599
|
}
|
|
3765
|
-
async #i(e
|
|
2600
|
+
async #i(e) {
|
|
3766
2601
|
if (this.#r) return {
|
|
3767
2602
|
done: !0,
|
|
3768
|
-
value: e
|
|
2603
|
+
value: e
|
|
3769
2604
|
};
|
|
3770
2605
|
if (this.#r = !0, !this.#n) {
|
|
3771
|
-
const t = this.#t.cancel(e
|
|
2606
|
+
const t = this.#t.cancel(e);
|
|
3772
2607
|
return this.#t.releaseLock(), await t, {
|
|
3773
2608
|
done: !0,
|
|
3774
|
-
value: e
|
|
2609
|
+
value: e
|
|
3775
2610
|
};
|
|
3776
2611
|
}
|
|
3777
2612
|
return this.#t.releaseLock(), {
|
|
3778
2613
|
done: !0,
|
|
3779
|
-
value: e
|
|
2614
|
+
value: e
|
|
3780
2615
|
};
|
|
3781
2616
|
}
|
|
3782
2617
|
};
|
|
@@ -3785,8 +2620,8 @@ function i() {
|
|
|
3785
2620
|
return this[n].next();
|
|
3786
2621
|
}
|
|
3787
2622
|
Object.defineProperty(i, "name", { value: "next" });
|
|
3788
|
-
function o(r
|
|
3789
|
-
return this[n].return(r
|
|
2623
|
+
function o(r) {
|
|
2624
|
+
return this[n].return(r);
|
|
3790
2625
|
}
|
|
3791
2626
|
Object.defineProperty(o, "name", { value: "return" });
|
|
3792
2627
|
const u = Object.create(a, {
|
|
@@ -3803,8 +2638,8 @@ const u = Object.create(a, {
|
|
|
3803
2638
|
value: o
|
|
3804
2639
|
}
|
|
3805
2640
|
});
|
|
3806
|
-
function h({ preventCancel: r
|
|
3807
|
-
const t = new c(this.getReader(), r
|
|
2641
|
+
function h({ preventCancel: r = !1 } = {}) {
|
|
2642
|
+
const t = new c(this.getReader(), r), s = Object.create(u);
|
|
3808
2643
|
return s[n] = t, s;
|
|
3809
2644
|
}
|
|
3810
2645
|
|
|
@@ -4703,7 +3538,7 @@ const getStdioArray = (stdio, options) => {
|
|
|
4703
3538
|
];
|
|
4704
3539
|
if (!Array.isArray(stdio)) throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
|
|
4705
3540
|
const length = Math.max(stdio.length, STANDARD_STREAMS_ALIASES.length);
|
|
4706
|
-
return Array.from({ length }, (_
|
|
3541
|
+
return Array.from({ length }, (_, fdNumber) => stdio[fdNumber]);
|
|
4707
3542
|
};
|
|
4708
3543
|
const hasAlias = (options) => STANDARD_STREAMS_ALIASES.some((alias) => options[alias] !== void 0);
|
|
4709
3544
|
const addDefaultValue = (stdioOption, fdNumber) => {
|
|
@@ -6237,8 +5072,8 @@ var SignalExit = class extends SignalExitBase {
|
|
|
6237
5072
|
const listeners = this.#process.listeners(sig);
|
|
6238
5073
|
let { count: count$1 } = this.#emitter;
|
|
6239
5074
|
/* c8 ignore start */
|
|
6240
|
-
const p$
|
|
6241
|
-
if (typeof p$
|
|
5075
|
+
const p$6 = process$9;
|
|
5076
|
+
if (typeof p$6.__signal_exit_emitter__ === "object" && typeof p$6.__signal_exit_emitter__.count === "number") count$1 += p$6.__signal_exit_emitter__.count;
|
|
6242
5077
|
/* c8 ignore stop */
|
|
6243
5078
|
if (listeners.length === count$1) {
|
|
6244
5079
|
this.unload();
|
|
@@ -6270,7 +5105,7 @@ var SignalExit = class extends SignalExitBase {
|
|
|
6270
5105
|
for (const sig of signals) try {
|
|
6271
5106
|
const fn = this.#sigListeners[sig];
|
|
6272
5107
|
if (fn) this.#process.on(sig, fn);
|
|
6273
|
-
} catch (_
|
|
5108
|
+
} catch (_) {}
|
|
6274
5109
|
this.#process.emit = (ev, ...a$1) => {
|
|
6275
5110
|
return this.#processEmit(ev, ...a$1);
|
|
6276
5111
|
};
|
|
@@ -6288,7 +5123,7 @@ var SignalExit = class extends SignalExitBase {
|
|
|
6288
5123
|
/* c8 ignore stop */
|
|
6289
5124
|
try {
|
|
6290
5125
|
this.#process.removeListener(sig, listener);
|
|
6291
|
-
} catch (_
|
|
5126
|
+
} catch (_) {}
|
|
6292
5127
|
/* c8 ignore stop */
|
|
6293
5128
|
});
|
|
6294
5129
|
this.#process.emit = this.#originalProcessEmit;
|
|
@@ -7662,7 +6497,7 @@ var CloudFrontManager = class {
|
|
|
7662
6497
|
};
|
|
7663
6498
|
const keyGroupId = (await cloudfrontClient.createKeyGroup({ KeyGroupConfig: keyGroupConfig })).KeyGroup?.Id;
|
|
7664
6499
|
if (!keyGroupId) throw new Error("Failed to create Key Group");
|
|
7665
|
-
|
|
6500
|
+
__hot_updater_cli_tools.p.log.success(`Created new Key Group: ${keyGroupConfig.Name}`);
|
|
7666
6501
|
return {
|
|
7667
6502
|
publicKeyId,
|
|
7668
6503
|
keyGroupId
|
|
@@ -7706,14 +6541,14 @@ var CloudFrontManager = class {
|
|
|
7706
6541
|
let selectedDistribution = null;
|
|
7707
6542
|
if (matchingDistributions.length === 1) selectedDistribution = matchingDistributions[0];
|
|
7708
6543
|
else if (matchingDistributions.length > 1) {
|
|
7709
|
-
const selectedDistributionStr = await
|
|
6544
|
+
const selectedDistributionStr = await __hot_updater_cli_tools.p.select({
|
|
7710
6545
|
message: "Multiple CloudFront distributions found. Please select one to use:",
|
|
7711
6546
|
options: matchingDistributions.map((dist) => ({
|
|
7712
6547
|
value: JSON.stringify(dist),
|
|
7713
6548
|
label: `${dist.Id} (${dist.DomainName})`
|
|
7714
6549
|
}))
|
|
7715
6550
|
});
|
|
7716
|
-
if (
|
|
6551
|
+
if (__hot_updater_cli_tools.p.isCancel(selectedDistributionStr)) process.exit(0);
|
|
7717
6552
|
selectedDistribution = JSON.parse(selectedDistributionStr);
|
|
7718
6553
|
}
|
|
7719
6554
|
const newOverrides = {
|
|
@@ -7842,7 +6677,7 @@ var CloudFrontManager = class {
|
|
|
7842
6677
|
}
|
|
7843
6678
|
};
|
|
7844
6679
|
if (selectedDistribution) {
|
|
7845
|
-
|
|
6680
|
+
__hot_updater_cli_tools.p.log.success(`Existing CloudFront distribution selected. Distribution ID: ${selectedDistribution.Id}.`);
|
|
7846
6681
|
try {
|
|
7847
6682
|
const { DistributionConfig, ETag } = await cloudfrontClient.getDistributionConfig({ Id: selectedDistribution.Id });
|
|
7848
6683
|
const finalConfig = merge(DistributionConfig ?? {}, newOverrides);
|
|
@@ -7851,7 +6686,7 @@ var CloudFrontManager = class {
|
|
|
7851
6686
|
IfMatch: ETag,
|
|
7852
6687
|
DistributionConfig: finalConfig
|
|
7853
6688
|
});
|
|
7854
|
-
|
|
6689
|
+
__hot_updater_cli_tools.p.log.success("CloudFront distribution updated with new Lambda function ARN.");
|
|
7855
6690
|
await cloudfrontClient.createInvalidation({
|
|
7856
6691
|
DistributionId: selectedDistribution.Id,
|
|
7857
6692
|
InvalidationBatch: {
|
|
@@ -7862,13 +6697,13 @@ var CloudFrontManager = class {
|
|
|
7862
6697
|
}
|
|
7863
6698
|
}
|
|
7864
6699
|
});
|
|
7865
|
-
|
|
6700
|
+
__hot_updater_cli_tools.p.log.success("Cache invalidation request completed.");
|
|
7866
6701
|
return {
|
|
7867
6702
|
distributionId: selectedDistribution.Id,
|
|
7868
6703
|
distributionDomain: selectedDistribution.DomainName
|
|
7869
6704
|
};
|
|
7870
6705
|
} catch (err) {
|
|
7871
|
-
|
|
6706
|
+
__hot_updater_cli_tools.p.log.error(`Failed to update CloudFront distribution: ${err instanceof Error ? err.message : String(err)}`);
|
|
7872
6707
|
throw err;
|
|
7873
6708
|
}
|
|
7874
6709
|
}
|
|
@@ -8016,9 +6851,9 @@ var CloudFrontManager = class {
|
|
|
8016
6851
|
if (!distResp.Distribution?.Id || !distResp.Distribution?.DomainName) throw new Error("Failed to create CloudFront distribution: No ID or DomainName returned");
|
|
8017
6852
|
const distributionId = distResp.Distribution.Id;
|
|
8018
6853
|
const distributionDomain = distResp.Distribution.DomainName;
|
|
8019
|
-
|
|
6854
|
+
__hot_updater_cli_tools.p.log.success(`Created new CloudFront distribution. Distribution ID: ${distributionId}`);
|
|
8020
6855
|
let retryCount = 0;
|
|
8021
|
-
await
|
|
6856
|
+
await __hot_updater_cli_tools.p.tasks([{
|
|
8022
6857
|
title: "Waiting for CloudFront distribution to complete...",
|
|
8023
6858
|
task: async (message) => {
|
|
8024
6859
|
while (retryCount < 600) try {
|
|
@@ -8028,7 +6863,7 @@ var CloudFrontManager = class {
|
|
|
8028
6863
|
if (retryCount++ >= 5) message(`CloudFront distribution is still in progress. This may take a few minutes. (${retryCount})`);
|
|
8029
6864
|
await delay(1e3);
|
|
8030
6865
|
}
|
|
8031
|
-
|
|
6866
|
+
__hot_updater_cli_tools.p.log.error("CloudFront distribution deployment timed out.");
|
|
8032
6867
|
process.exit(1);
|
|
8033
6868
|
}
|
|
8034
6869
|
}]);
|
|
@@ -8037,7 +6872,7 @@ var CloudFrontManager = class {
|
|
|
8037
6872
|
distributionDomain
|
|
8038
6873
|
};
|
|
8039
6874
|
} catch (error) {
|
|
8040
|
-
|
|
6875
|
+
__hot_updater_cli_tools.p.log.error(`CloudFront distribution creation failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
8041
6876
|
throw error;
|
|
8042
6877
|
}
|
|
8043
6878
|
}
|
|
@@ -8088,11 +6923,11 @@ var IAMManager = class {
|
|
|
8088
6923
|
PolicyName: "HotUpdaterSSMAccess",
|
|
8089
6924
|
PolicyDocument: ssmPolicyDocument
|
|
8090
6925
|
});
|
|
8091
|
-
|
|
6926
|
+
__hot_updater_cli_tools.p.log.info("Updated SSM access policy for existing IAM role");
|
|
8092
6927
|
} catch {
|
|
8093
|
-
|
|
6928
|
+
__hot_updater_cli_tools.p.log.warn("Failed to update SSM policy, continuing anyway");
|
|
8094
6929
|
}
|
|
8095
|
-
|
|
6930
|
+
__hot_updater_cli_tools.p.log.info(`Using existing IAM role: ${roleName} (${existingRole.Arn})`);
|
|
8096
6931
|
return existingRole.Arn;
|
|
8097
6932
|
}
|
|
8098
6933
|
} catch {
|
|
@@ -8104,7 +6939,7 @@ var IAMManager = class {
|
|
|
8104
6939
|
});
|
|
8105
6940
|
if (!createRoleResp.Role?.Arn) throw new Error("Failed to create IAM role: No ARN returned");
|
|
8106
6941
|
const lambdaRoleArn = createRoleResp.Role.Arn;
|
|
8107
|
-
|
|
6942
|
+
__hot_updater_cli_tools.p.log.info(`Created IAM role: ${roleName} (${lambdaRoleArn})`);
|
|
8108
6943
|
await iamClient.attachRolePolicy({
|
|
8109
6944
|
RoleName: roleName,
|
|
8110
6945
|
PolicyArn: "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
|
|
@@ -8113,16 +6948,16 @@ var IAMManager = class {
|
|
|
8113
6948
|
RoleName: roleName,
|
|
8114
6949
|
PolicyArn: "arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess"
|
|
8115
6950
|
});
|
|
8116
|
-
|
|
6951
|
+
__hot_updater_cli_tools.p.log.info(`Attached managed policies to ${roleName}`);
|
|
8117
6952
|
await iamClient.putRolePolicy({
|
|
8118
6953
|
RoleName: roleName,
|
|
8119
6954
|
PolicyName: "HotUpdaterSSMAccess",
|
|
8120
6955
|
PolicyDocument: ssmPolicyDocument
|
|
8121
6956
|
});
|
|
8122
|
-
|
|
6957
|
+
__hot_updater_cli_tools.p.log.info(`Added SSM access inline policy to ${roleName}`);
|
|
8123
6958
|
return lambdaRoleArn;
|
|
8124
6959
|
} catch (createError) {
|
|
8125
|
-
if (createError instanceof Error)
|
|
6960
|
+
if (createError instanceof Error) __hot_updater_cli_tools.p.log.error(`Error setting up IAM role: ${createError.message}`);
|
|
8126
6961
|
process.exit(1);
|
|
8127
6962
|
}
|
|
8128
6963
|
}
|
|
@@ -8138,17 +6973,17 @@ var LambdaEdgeDeployer = class {
|
|
|
8138
6973
|
this.credentials = credentials;
|
|
8139
6974
|
}
|
|
8140
6975
|
async deploy(lambdaRoleArn, config) {
|
|
8141
|
-
const cwd = (0,
|
|
8142
|
-
const lambdaName = await
|
|
6976
|
+
const cwd = (0, __hot_updater_cli_tools.getCwd)();
|
|
6977
|
+
const lambdaName = await __hot_updater_cli_tools.p.text({
|
|
8143
6978
|
message: "Enter the name of the Lambda@Edge function",
|
|
8144
6979
|
defaultValue: "hot-updater-edge",
|
|
8145
6980
|
placeholder: "hot-updater-edge"
|
|
8146
6981
|
});
|
|
8147
|
-
if (
|
|
6982
|
+
if (__hot_updater_cli_tools.p.isCancel(lambdaName)) process.exit(1);
|
|
8148
6983
|
const lambdaPath = require.resolve("@hot-updater/aws/lambda");
|
|
8149
|
-
const { tmpDir, removeTmpDir } = await (0,
|
|
6984
|
+
const { tmpDir, removeTmpDir } = await (0, __hot_updater_cli_tools.copyDirToTmp)(path.default.dirname(lambdaPath));
|
|
8150
6985
|
const indexPath = path.default.join(tmpDir, "index.cjs");
|
|
8151
|
-
const code = (0,
|
|
6986
|
+
const code = (0, __hot_updater_cli_tools.transformEnv)(indexPath, {
|
|
8152
6987
|
CLOUDFRONT_KEY_PAIR_ID: config.publicKeyId,
|
|
8153
6988
|
SSM_PARAMETER_NAME: config.ssmParameterName,
|
|
8154
6989
|
SSM_REGION: config.ssmRegion
|
|
@@ -8163,12 +6998,12 @@ var LambdaEdgeDeployer = class {
|
|
|
8163
6998
|
version: null
|
|
8164
6999
|
};
|
|
8165
7000
|
const zipFilePath = path.default.join(cwd, `${lambdaName}.zip`);
|
|
8166
|
-
await
|
|
7001
|
+
await __hot_updater_cli_tools.p.tasks([
|
|
8167
7002
|
{
|
|
8168
7003
|
title: "Compressing Lambda code to zip",
|
|
8169
7004
|
task: async () => {
|
|
8170
7005
|
try {
|
|
8171
|
-
await (0,
|
|
7006
|
+
await (0, __hot_updater_cli_tools.createZip)({
|
|
8172
7007
|
outfile: zipFilePath,
|
|
8173
7008
|
targetDir: tmpDir
|
|
8174
7009
|
});
|
|
@@ -8221,12 +7056,12 @@ var LambdaEdgeDeployer = class {
|
|
|
8221
7056
|
Timeout: 10
|
|
8222
7057
|
});
|
|
8223
7058
|
} catch (error$1) {
|
|
8224
|
-
|
|
7059
|
+
__hot_updater_cli_tools.p.log.error(`Failed to update Lambda configuration: ${error$1 instanceof Error ? error$1.message : String(error$1)}`);
|
|
8225
7060
|
}
|
|
8226
7061
|
functionArn.arn = updateResp.FunctionArn || null;
|
|
8227
7062
|
functionArn.version = updateResp.Version || "1";
|
|
8228
7063
|
} else {
|
|
8229
|
-
if (error instanceof Error)
|
|
7064
|
+
if (error instanceof Error) __hot_updater_cli_tools.p.log.error(`Failed to create or update Lambda function: ${error.message}`);
|
|
8230
7065
|
throw error;
|
|
8231
7066
|
}
|
|
8232
7067
|
return `Updated Lambda "${lambdaName}" function`;
|
|
@@ -8244,14 +7079,14 @@ var LambdaEdgeDeployer = class {
|
|
|
8244
7079
|
const resp = await lambdaClient.getFunctionConfiguration({ FunctionName: qualifiedName });
|
|
8245
7080
|
if (resp.State === "Active") return "Lambda function is now active";
|
|
8246
7081
|
if (resp.State === "Failed") throw new Error(`Lambda function is in a Failed state. Reason: ${resp.StateReason}`);
|
|
8247
|
-
await new Promise((r
|
|
7082
|
+
await new Promise((r) => setTimeout(r, 2e3));
|
|
8248
7083
|
}
|
|
8249
7084
|
}
|
|
8250
7085
|
}
|
|
8251
7086
|
]);
|
|
8252
7087
|
if (!functionArn.arn || !functionArn.version) throw new Error("Failed to create or update Lambda function");
|
|
8253
7088
|
if (!functionArn.arn.endsWith(`:${functionArn.version}`)) functionArn.arn = `${functionArn.arn}:${functionArn.version}`;
|
|
8254
|
-
|
|
7089
|
+
__hot_updater_cli_tools.p.log.info(`Using Lambda ARN: ${functionArn.arn}`);
|
|
8255
7090
|
return {
|
|
8256
7091
|
lambdaName,
|
|
8257
7092
|
functionArn: functionArn.arn
|
|
@@ -8261,7 +7096,6 @@ var LambdaEdgeDeployer = class {
|
|
|
8261
7096
|
|
|
8262
7097
|
//#endregion
|
|
8263
7098
|
//#region iac/migrations/migrator.ts
|
|
8264
|
-
var import_picocolors$1 = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
8265
7099
|
/**
|
|
8266
7100
|
* S3Migration
|
|
8267
7101
|
* Base class that each migration script extends.
|
|
@@ -8312,7 +7146,7 @@ var S3Migration = class {
|
|
|
8312
7146
|
if (response.Body) return await response.Body.transformToString();
|
|
8313
7147
|
return null;
|
|
8314
7148
|
} catch (error) {
|
|
8315
|
-
console.error(
|
|
7149
|
+
console.error(__hot_updater_cli_tools.colors.red(`Error reading file ${key}:`), error);
|
|
8316
7150
|
return null;
|
|
8317
7151
|
}
|
|
8318
7152
|
}
|
|
@@ -8320,8 +7154,8 @@ var S3Migration = class {
|
|
|
8320
7154
|
const content = await this.readFile(key);
|
|
8321
7155
|
if (content) try {
|
|
8322
7156
|
return JSON.parse(content);
|
|
8323
|
-
} catch (e
|
|
8324
|
-
console.error(
|
|
7157
|
+
} catch (e) {
|
|
7158
|
+
console.error(__hot_updater_cli_tools.colors.red(`Error parsing JSON from ${key}:`), e);
|
|
8325
7159
|
}
|
|
8326
7160
|
return null;
|
|
8327
7161
|
}
|
|
@@ -8337,16 +7171,16 @@ var S3Migration = class {
|
|
|
8337
7171
|
async updateFile(key, content, { cacheControl } = {}) {
|
|
8338
7172
|
const normalizedKey = key.startsWith("/") ? key.substring(1) : key;
|
|
8339
7173
|
if (this.dryRun) {
|
|
8340
|
-
console.log(
|
|
7174
|
+
console.log(__hot_updater_cli_tools.colors.yellow(`[DRY RUN] Updated ${__hot_updater_cli_tools.colors.bold(normalizedKey)}`));
|
|
8341
7175
|
return;
|
|
8342
7176
|
}
|
|
8343
7177
|
if (await this.readFile(key) !== null) await this.backupFile(key);
|
|
8344
7178
|
await this.doUpdateFile(normalizedKey, content, { cacheControl });
|
|
8345
|
-
console.log(
|
|
7179
|
+
console.log(__hot_updater_cli_tools.colors.green(`Updated ${__hot_updater_cli_tools.colors.bold(normalizedKey)}`));
|
|
8346
7180
|
}
|
|
8347
7181
|
async moveFile(from, to) {
|
|
8348
7182
|
if (this.dryRun) {
|
|
8349
|
-
console.log(
|
|
7183
|
+
console.log(__hot_updater_cli_tools.colors.yellow(`[DRY RUN] ${__hot_updater_cli_tools.colors.bold(from)} -> ${__hot_updater_cli_tools.colors.bold(to)}`));
|
|
8350
7184
|
return;
|
|
8351
7185
|
}
|
|
8352
7186
|
await this.backupFile(from);
|
|
@@ -8358,7 +7192,7 @@ var S3Migration = class {
|
|
|
8358
7192
|
});
|
|
8359
7193
|
await this.s3.send(copyCommand);
|
|
8360
7194
|
} catch (error) {
|
|
8361
|
-
console.error(
|
|
7195
|
+
console.error(__hot_updater_cli_tools.colors.red(`Error copying file from ${from} to ${to}:`), error);
|
|
8362
7196
|
throw error;
|
|
8363
7197
|
}
|
|
8364
7198
|
try {
|
|
@@ -8368,13 +7202,13 @@ var S3Migration = class {
|
|
|
8368
7202
|
});
|
|
8369
7203
|
await this.s3.send(deleteCommand);
|
|
8370
7204
|
} catch (error) {
|
|
8371
|
-
if (error?.message?.includes("NoSuchKey")) console.warn(
|
|
7205
|
+
if (error?.message?.includes("NoSuchKey")) console.warn(__hot_updater_cli_tools.colors.yellow(`Key ${from} not found during deletion, ignoring.`));
|
|
8372
7206
|
else {
|
|
8373
|
-
console.error(
|
|
7207
|
+
console.error(__hot_updater_cli_tools.colors.red(`Error deleting file ${from}:`), error);
|
|
8374
7208
|
throw error;
|
|
8375
7209
|
}
|
|
8376
7210
|
}
|
|
8377
|
-
console.log(
|
|
7211
|
+
console.log(__hot_updater_cli_tools.colors.green(`${__hot_updater_cli_tools.colors.bold(from)} -> ${__hot_updater_cli_tools.colors.bold(to)}`));
|
|
8378
7212
|
}
|
|
8379
7213
|
async deleteBackupFile(backupKey) {
|
|
8380
7214
|
if (this.dryRun) return;
|
|
@@ -8385,7 +7219,7 @@ var S3Migration = class {
|
|
|
8385
7219
|
});
|
|
8386
7220
|
await this.s3.send(deleteCommand);
|
|
8387
7221
|
} catch (error) {
|
|
8388
|
-
console.error(
|
|
7222
|
+
console.error(__hot_updater_cli_tools.colors.red(`Error deleting backup file ${backupKey}:`), error);
|
|
8389
7223
|
}
|
|
8390
7224
|
}
|
|
8391
7225
|
async cleanupBackups() {
|
|
@@ -8394,15 +7228,15 @@ var S3Migration = class {
|
|
|
8394
7228
|
this.backupMapping.clear();
|
|
8395
7229
|
}
|
|
8396
7230
|
async rollback() {
|
|
8397
|
-
console.log(
|
|
7231
|
+
console.log(__hot_updater_cli_tools.colors.magenta(`Starting rollback for migration ${this.name}...`));
|
|
8398
7232
|
for (const [originalKey, backupKey] of this.backupMapping.entries()) {
|
|
8399
7233
|
const backupContent = await this.readFile(backupKey);
|
|
8400
7234
|
if (backupContent !== null) {
|
|
8401
|
-
console.log(
|
|
7235
|
+
console.log(__hot_updater_cli_tools.colors.blue(`Restoring backup for ${originalKey} from ${backupKey}`));
|
|
8402
7236
|
await this.doUpdateFile(originalKey, backupContent);
|
|
8403
|
-
} else console.error(
|
|
7237
|
+
} else console.error(__hot_updater_cli_tools.colors.red(`Failed to read backup for ${originalKey} at ${backupKey}`));
|
|
8404
7238
|
}
|
|
8405
|
-
console.log(
|
|
7239
|
+
console.log(__hot_updater_cli_tools.colors.green(`Rollback completed for migration ${this.name}.`));
|
|
8406
7240
|
}
|
|
8407
7241
|
};
|
|
8408
7242
|
/**
|
|
@@ -8432,7 +7266,7 @@ var S3Migrator = class {
|
|
|
8432
7266
|
try {
|
|
8433
7267
|
this.migrationRecords = JSON.parse(bodyContents);
|
|
8434
7268
|
} catch (jsonError) {
|
|
8435
|
-
console.error(
|
|
7269
|
+
console.error(__hot_updater_cli_tools.colors.red("Failed to parse migration records JSON:"), jsonError);
|
|
8436
7270
|
this.migrationRecords = [];
|
|
8437
7271
|
}
|
|
8438
7272
|
}
|
|
@@ -8470,7 +7304,7 @@ var S3Migrator = class {
|
|
|
8470
7304
|
await this.loadMigrationRecords();
|
|
8471
7305
|
for (const migration of this.migrations) {
|
|
8472
7306
|
if (this.migrationRecords.some((record) => record.name === migration.name)) continue;
|
|
8473
|
-
console.log(
|
|
7307
|
+
console.log(__hot_updater_cli_tools.colors.magenta(`Applying migration ${migration.name}...`));
|
|
8474
7308
|
migration.s3 = this.s3;
|
|
8475
7309
|
migration.bucketName = this.bucketName;
|
|
8476
7310
|
migration.dryRun = dryRun;
|
|
@@ -8481,17 +7315,17 @@ var S3Migrator = class {
|
|
|
8481
7315
|
name: migration.name,
|
|
8482
7316
|
appliedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
8483
7317
|
});
|
|
8484
|
-
console.log(
|
|
7318
|
+
console.log(__hot_updater_cli_tools.colors.green(`${__hot_updater_cli_tools.colors.bold(migration.name)} applied successfully.`));
|
|
8485
7319
|
await migration.cleanupBackups();
|
|
8486
|
-
} else console.log(
|
|
7320
|
+
} else console.log(__hot_updater_cli_tools.colors.yellow(`[DRY RUN] ${__hot_updater_cli_tools.colors.bold(migration.name)} applied successfully`));
|
|
8487
7321
|
} catch (error) {
|
|
8488
|
-
console.error(
|
|
7322
|
+
console.error(__hot_updater_cli_tools.colors.red(`Migration ${migration.name} failed. Initiating rollback...`), error);
|
|
8489
7323
|
await migration.rollback();
|
|
8490
7324
|
throw error;
|
|
8491
7325
|
}
|
|
8492
7326
|
}
|
|
8493
7327
|
await this.saveMigrationRecords(dryRun);
|
|
8494
|
-
if (!dryRun) console.log(
|
|
7328
|
+
if (!dryRun) console.log(__hot_updater_cli_tools.colors.blue("All migrations applied."));
|
|
8495
7329
|
}
|
|
8496
7330
|
};
|
|
8497
7331
|
|
|
@@ -8611,7 +7445,7 @@ var S3Manager = class {
|
|
|
8611
7445
|
Bucket: bucketName,
|
|
8612
7446
|
...region === "us-east-1" ? {} : { CreateBucketConfiguration: { LocationConstraint: region } }
|
|
8613
7447
|
});
|
|
8614
|
-
|
|
7448
|
+
__hot_updater_cli_tools.p.log.info(`Created S3 bucket: ${bucketName}`);
|
|
8615
7449
|
}
|
|
8616
7450
|
async runMigrations({ bucketName, region, migrations }) {
|
|
8617
7451
|
const migrator = new S3Migrator({
|
|
@@ -8625,12 +7459,12 @@ var S3Manager = class {
|
|
|
8625
7459
|
const { pending } = await migrator.list();
|
|
8626
7460
|
await migrator.migrate({ dryRun: true });
|
|
8627
7461
|
if (pending.length > 0) {
|
|
8628
|
-
|
|
8629
|
-
for (const m
|
|
7462
|
+
__hot_updater_cli_tools.p.log.step("Pending migrations:");
|
|
7463
|
+
for (const m of pending) __hot_updater_cli_tools.p.log.step(`- ${m.name}`);
|
|
8630
7464
|
}
|
|
8631
|
-
const confirm = await
|
|
8632
|
-
if (
|
|
8633
|
-
|
|
7465
|
+
const confirm = await __hot_updater_cli_tools.p.confirm({ message: "Do you want to continue?" });
|
|
7466
|
+
if (__hot_updater_cli_tools.p.isCancel(confirm) || !confirm) {
|
|
7467
|
+
__hot_updater_cli_tools.p.log.info("Migration cancelled.");
|
|
8634
7468
|
process.exit(1);
|
|
8635
7469
|
}
|
|
8636
7470
|
await migrator.migrate({ dryRun: false });
|
|
@@ -8656,7 +7490,7 @@ var S3Manager = class {
|
|
|
8656
7490
|
Bucket: bucketName,
|
|
8657
7491
|
Policy: JSON.stringify(bucketPolicy)
|
|
8658
7492
|
});
|
|
8659
|
-
|
|
7493
|
+
__hot_updater_cli_tools.p.log.success("S3 bucket policy updated to allow access from CloudFront distribution");
|
|
8660
7494
|
}
|
|
8661
7495
|
};
|
|
8662
7496
|
|
|
@@ -8700,7 +7534,7 @@ var SSMKeyPairManager = class {
|
|
|
8700
7534
|
const existing = await this.getParameter(parameterName);
|
|
8701
7535
|
if (existing) {
|
|
8702
7536
|
const keyPair$1 = JSON.parse(existing);
|
|
8703
|
-
|
|
7537
|
+
__hot_updater_cli_tools.p.log.info("Using existing CloudFront key pair from SSM Parameter Store");
|
|
8704
7538
|
return keyPair$1;
|
|
8705
7539
|
}
|
|
8706
7540
|
const { publicKey, privateKey } = crypto.default.generateKeyPairSync("rsa", {
|
|
@@ -8720,7 +7554,7 @@ var SSMKeyPairManager = class {
|
|
|
8720
7554
|
privateKey
|
|
8721
7555
|
};
|
|
8722
7556
|
await this.putParameter(parameterName, JSON.stringify(keyPair));
|
|
8723
|
-
|
|
7557
|
+
__hot_updater_cli_tools.p.log.success("Created and stored new CloudFront key pair in SSM Parameter Store");
|
|
8724
7558
|
return keyPair;
|
|
8725
7559
|
}
|
|
8726
7560
|
};
|
|
@@ -8766,7 +7600,7 @@ const commonOptions = {
|
|
|
8766
7600
|
secretAccessKey: process.env.HOT_UPDATER_S3_SECRET_ACCESS_KEY!,
|
|
8767
7601
|
},
|
|
8768
7602
|
};`.trim();
|
|
8769
|
-
return new
|
|
7603
|
+
return new __hot_updater_cli_tools.ConfigBuilder().setBuildType(build).setStorage(storageConfig).setDatabase(databaseConfig).setIntermediateCode(intermediate).getResult();
|
|
8770
7604
|
};
|
|
8771
7605
|
const SOURCE_TEMPLATE = `// Add this to your App.tsx
|
|
8772
7606
|
import { HotUpdater, getUpdateSource } from "@hot-updater/react-native";
|
|
@@ -8783,7 +7617,6 @@ export default HotUpdater.wrap({
|
|
|
8783
7617
|
|
|
8784
7618
|
//#endregion
|
|
8785
7619
|
//#region iac/index.ts
|
|
8786
|
-
var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
8787
7620
|
const checkIfAwsCliInstalled = async () => {
|
|
8788
7621
|
try {
|
|
8789
7622
|
await execa("aws", ["--version"]);
|
|
@@ -8794,11 +7627,11 @@ const checkIfAwsCliInstalled = async () => {
|
|
|
8794
7627
|
};
|
|
8795
7628
|
const runInit = async ({ build }) => {
|
|
8796
7629
|
if (!await checkIfAwsCliInstalled()) {
|
|
8797
|
-
|
|
7630
|
+
__hot_updater_cli_tools.p.log.error(`AWS CLI is not installed. Please visit ${(0, __hot_updater_cli_tools.link)("https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html")} for installation instructions`);
|
|
8798
7631
|
process.exit(1);
|
|
8799
7632
|
}
|
|
8800
7633
|
let credentials;
|
|
8801
|
-
const mode = await
|
|
7634
|
+
const mode = await __hot_updater_cli_tools.p.select({
|
|
8802
7635
|
message: "Select the mode to login to AWS",
|
|
8803
7636
|
options: [{
|
|
8804
7637
|
label: "AWS Access Key ID & Secret Access Key (Recommend)",
|
|
@@ -8808,20 +7641,20 @@ const runInit = async ({ build }) => {
|
|
|
8808
7641
|
value: "sso"
|
|
8809
7642
|
}]
|
|
8810
7643
|
});
|
|
8811
|
-
if (
|
|
8812
|
-
|
|
8813
|
-
|
|
8814
|
-
|
|
8815
|
-
|
|
8816
|
-
|
|
8817
|
-
|
|
7644
|
+
if (__hot_updater_cli_tools.p.isCancel(mode)) process.exit(1);
|
|
7645
|
+
__hot_updater_cli_tools.p.log.message(__hot_updater_cli_tools.colors.blue("The following permissions are required:"));
|
|
7646
|
+
__hot_updater_cli_tools.p.log.message(`${__hot_updater_cli_tools.colors.blue("AmazonS3FullAccess")}: Create and read S3 buckets`);
|
|
7647
|
+
__hot_updater_cli_tools.p.log.message(`${__hot_updater_cli_tools.colors.blue("AWSLambda_FullAccess")}: Create and update Lambda functions`);
|
|
7648
|
+
__hot_updater_cli_tools.p.log.message(`${__hot_updater_cli_tools.colors.blue("CloudFrontFullAccess")}: Create and update CloudFront distributions`);
|
|
7649
|
+
__hot_updater_cli_tools.p.log.message(`${__hot_updater_cli_tools.colors.blue("IAMFullAccess")}: Get or create IAM roles for Lambda@Edge`);
|
|
7650
|
+
__hot_updater_cli_tools.p.log.message(`${__hot_updater_cli_tools.colors.blue("AmazonSSMFullAccess")}: Access to SSM Parameters for storing CloudFront key pairs`);
|
|
8818
7651
|
if (mode === "sso") try {
|
|
8819
|
-
const profile = await
|
|
7652
|
+
const profile = await __hot_updater_cli_tools.p.text({
|
|
8820
7653
|
message: "Enter the SSO profile name",
|
|
8821
7654
|
defaultValue: "default",
|
|
8822
7655
|
placeholder: "default"
|
|
8823
7656
|
});
|
|
8824
|
-
if (
|
|
7657
|
+
if (__hot_updater_cli_tools.p.isCancel(profile)) process.exit(1);
|
|
8825
7658
|
await execa("aws", [
|
|
8826
7659
|
"sso",
|
|
8827
7660
|
"login",
|
|
@@ -8833,21 +7666,21 @@ const runInit = async ({ build }) => {
|
|
|
8833
7666
|
});
|
|
8834
7667
|
credentials = await (0, __aws_sdk_credential_providers.fromSSO)({ profile })();
|
|
8835
7668
|
} catch (error) {
|
|
8836
|
-
if (error instanceof ExecaError)
|
|
7669
|
+
if (error instanceof ExecaError) __hot_updater_cli_tools.p.log.error(error.stdout || error.stderr || error.message);
|
|
8837
7670
|
process.exit(1);
|
|
8838
7671
|
}
|
|
8839
7672
|
else {
|
|
8840
|
-
const creds = await
|
|
8841
|
-
accessKeyId: () =>
|
|
7673
|
+
const creds = await __hot_updater_cli_tools.p.group({
|
|
7674
|
+
accessKeyId: () => __hot_updater_cli_tools.p.text({
|
|
8842
7675
|
message: "Enter your AWS Access Key ID",
|
|
8843
7676
|
validate: (value) => value ? void 0 : "Access Key ID is required"
|
|
8844
7677
|
}),
|
|
8845
|
-
secretAccessKey: () =>
|
|
7678
|
+
secretAccessKey: () => __hot_updater_cli_tools.p.password({
|
|
8846
7679
|
message: "Enter your AWS Secret Access Key",
|
|
8847
7680
|
validate: (value) => value ? void 0 : "Secret Access Key is required"
|
|
8848
7681
|
})
|
|
8849
7682
|
});
|
|
8850
|
-
if (
|
|
7683
|
+
if (__hot_updater_cli_tools.p.isCancel(creds)) process.exit(1);
|
|
8851
7684
|
credentials = {
|
|
8852
7685
|
accessKeyId: creds.accessKeyId,
|
|
8853
7686
|
secretAccessKey: creds.secretAccessKey
|
|
@@ -8856,18 +7689,18 @@ const runInit = async ({ build }) => {
|
|
|
8856
7689
|
const s3Manager = new S3Manager(credentials);
|
|
8857
7690
|
let availableBuckets = [];
|
|
8858
7691
|
try {
|
|
8859
|
-
await
|
|
7692
|
+
await __hot_updater_cli_tools.p.tasks([{
|
|
8860
7693
|
title: "Checking S3 Buckets...",
|
|
8861
7694
|
task: async () => {
|
|
8862
7695
|
availableBuckets = await s3Manager.listBuckets();
|
|
8863
7696
|
}
|
|
8864
7697
|
}]);
|
|
8865
|
-
} catch (e
|
|
8866
|
-
if (e
|
|
8867
|
-
throw e
|
|
7698
|
+
} catch (e) {
|
|
7699
|
+
if (e instanceof Error) __hot_updater_cli_tools.p.log.error(e.message);
|
|
7700
|
+
throw e;
|
|
8868
7701
|
}
|
|
8869
7702
|
const createKey = `create/${Math.random().toString(36).substring(2, 15)}`;
|
|
8870
|
-
let bucketName = await
|
|
7703
|
+
let bucketName = await __hot_updater_cli_tools.p.select({
|
|
8871
7704
|
message: "S3 Bucket List",
|
|
8872
7705
|
options: [...availableBuckets.map((bucket) => ({
|
|
8873
7706
|
value: bucket.name,
|
|
@@ -8877,32 +7710,32 @@ const runInit = async ({ build }) => {
|
|
|
8877
7710
|
label: "Create New S3 Bucket"
|
|
8878
7711
|
}]
|
|
8879
7712
|
});
|
|
8880
|
-
if (
|
|
7713
|
+
if (__hot_updater_cli_tools.p.isCancel(bucketName)) process.exit(1);
|
|
8881
7714
|
let bucketRegion = availableBuckets.find((bucket) => bucket.name === bucketName)?.region;
|
|
8882
7715
|
if (bucketName === createKey) {
|
|
8883
|
-
const name = await
|
|
7716
|
+
const name = await __hot_updater_cli_tools.p.text({
|
|
8884
7717
|
message: "Enter the name of the new S3 Bucket",
|
|
8885
7718
|
defaultValue: "hot-updater-storage",
|
|
8886
7719
|
placeholder: "hot-updater-storage"
|
|
8887
7720
|
});
|
|
8888
|
-
if (
|
|
7721
|
+
if (__hot_updater_cli_tools.p.isCancel(name)) process.exit(1);
|
|
8889
7722
|
bucketName = name;
|
|
8890
|
-
const selectedRegion = await
|
|
7723
|
+
const selectedRegion = await __hot_updater_cli_tools.p.select({
|
|
8891
7724
|
message: "Enter AWS region for the S3 bucket",
|
|
8892
7725
|
options: Object.entries(regionLocationMap).map(([region, location]) => ({
|
|
8893
7726
|
label: `${region} (${location})`,
|
|
8894
7727
|
value: region
|
|
8895
7728
|
}))
|
|
8896
7729
|
});
|
|
8897
|
-
if (
|
|
7730
|
+
if (__hot_updater_cli_tools.p.isCancel(selectedRegion)) process.exit(1);
|
|
8898
7731
|
bucketRegion = selectedRegion;
|
|
8899
7732
|
await s3Manager.createBucket(bucketName, bucketRegion);
|
|
8900
7733
|
}
|
|
8901
7734
|
if (!bucketRegion) {
|
|
8902
|
-
|
|
7735
|
+
__hot_updater_cli_tools.p.log.error("Failed to get S3 bucket region");
|
|
8903
7736
|
process.exit(1);
|
|
8904
7737
|
}
|
|
8905
|
-
|
|
7738
|
+
__hot_updater_cli_tools.p.log.info(`Selected S3 Bucket: ${bucketName} (${bucketRegion})`);
|
|
8906
7739
|
await s3Manager.runMigrations({
|
|
8907
7740
|
bucketName,
|
|
8908
7741
|
region: bucketRegion,
|
|
@@ -8934,7 +7767,7 @@ const runInit = async ({ build }) => {
|
|
|
8934
7767
|
if (mode === "sso") await fs.default.promises.writeFile("hot-updater.config.ts", getConfigTemplate(build, { sessionToken: true }));
|
|
8935
7768
|
else await fs.default.promises.writeFile("hot-updater.config.ts", getConfigTemplate(build, { sessionToken: false }));
|
|
8936
7769
|
const comment = mode === "account" ? "The current key may have excessive permissions. Update it with an S3FullAccess and CloudFrontFullAccess key." : "This key was generated via SSO login and may expire. Update it with an S3FullAccess and CloudFrontFullAccess key.";
|
|
8937
|
-
await (0,
|
|
7770
|
+
await (0, __hot_updater_cli_tools.makeEnv)({
|
|
8938
7771
|
HOT_UPDATER_S3_BUCKET_NAME: bucketName,
|
|
8939
7772
|
HOT_UPDATER_S3_REGION: bucketRegion,
|
|
8940
7773
|
HOT_UPDATER_S3_ACCESS_KEY_ID: {
|
|
@@ -8948,12 +7781,12 @@ const runInit = async ({ build }) => {
|
|
|
8948
7781
|
...mode === "sso" && { HOT_UPDATER_S3_SESSION_TOKEN: credentials.sessionToken },
|
|
8949
7782
|
HOT_UPDATER_CLOUDFRONT_DISTRIBUTION_ID: distributionId
|
|
8950
7783
|
});
|
|
8951
|
-
|
|
8952
|
-
|
|
7784
|
+
__hot_updater_cli_tools.p.log.success("Generated '.env.hotupdater' file with AWS settings.");
|
|
7785
|
+
__hot_updater_cli_tools.p.log.success("Generated 'hot-updater.config.ts' file with AWS settings.");
|
|
8953
7786
|
const sourceUrl = `https://${distributionDomain}/api/check-update`;
|
|
8954
|
-
|
|
8955
|
-
|
|
8956
|
-
|
|
7787
|
+
__hot_updater_cli_tools.p.note((0, __hot_updater_cli_tools.transformTemplate)(SOURCE_TEMPLATE, { source: sourceUrl }));
|
|
7788
|
+
__hot_updater_cli_tools.p.log.message(`Next step: ${(0, __hot_updater_cli_tools.link)("https://hot-updater.dev/docs/managed/aws#step-4-changeenv-file-optional")}`);
|
|
7789
|
+
__hot_updater_cli_tools.p.log.success("Done! 🎉");
|
|
8957
7790
|
};
|
|
8958
7791
|
|
|
8959
7792
|
//#endregion
|