@jixo/cli 0.20.0 → 0.21.0

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.
@@ -0,0 +1,4723 @@
1
+ import { createRequire } from "node:module";
2
+ import { URL, fileURLToPath, pathToFileURL } from "node:url";
3
+ import path, { dirname } from "node:path";
4
+ import fs, { readFileSync, readdirSync, realpathSync } from "node:fs";
5
+ import { notStrictEqual, strictEqual } from "assert";
6
+ import { basename, dirname as dirname$1, extname, join, normalize, relative, resolve } from "path";
7
+ import { readFileSync as readFileSync$1, readdirSync as readdirSync$1, statSync, writeFile } from "fs";
8
+ import { format, inspect } from "util";
9
+ import { fileURLToPath as fileURLToPath$1 } from "url";
10
+
11
+ //#region rolldown:runtime
12
+ var __create = Object.create;
13
+ var __defProp = Object.defineProperty;
14
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
15
+ var __getOwnPropNames = Object.getOwnPropertyNames;
16
+ var __getProtoOf = Object.getPrototypeOf;
17
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
18
+ var __commonJS = (cb, mod) => function() {
19
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
20
+ };
21
+ var __copyProps = (to, from, except, desc) => {
22
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
23
+ key = keys[i];
24
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
25
+ get: ((k) => from[k]).bind(null, key),
26
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
27
+ });
28
+ }
29
+ return to;
30
+ };
31
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
32
+ value: mod,
33
+ enumerable: true
34
+ }) : target, mod));
35
+
36
+ //#endregion
37
+ //#region ../../node_modules/.pnpm/import-meta-ponyfill@3.2.2/node_modules/import-meta-ponyfill/index.mjs
38
+ const pathResolve = (specifier, parentURL) => {
39
+ let baseUrl;
40
+ if (parentURL instanceof URL) baseUrl = parentURL;
41
+ else {
42
+ const parentHref = String(parentURL);
43
+ if (parentHref.startsWith("file:")) baseUrl = parentHref;
44
+ else baseUrl = pathToFileURL(parentHref).href;
45
+ }
46
+ return new URL(specifier, baseUrl).href;
47
+ };
48
+ const import_meta_ponyfill_commonjs = Reflect.get(globalThis, Symbol.for("import-meta-ponyfill-commonjs")) ?? (() => {
49
+ const moduleImportMetaWM = /* @__PURE__ */ new WeakMap();
50
+ return (require$2, module$1) => {
51
+ let importMetaCache = moduleImportMetaWM.get(module$1);
52
+ if (importMetaCache == null) {
53
+ const importMeta = Object.assign(Object.create(null), {
54
+ url: pathToFileURL(module$1.filename).href,
55
+ main: require$2.main === module$1,
56
+ nodeResolve(specifier, parentURL = importMeta.url) {
57
+ return pathToFileURL((importMeta.url === parentURL ? require$2 : createRequire(parentURL)).resolve(specifier)).href;
58
+ },
59
+ resolve: function resolve$1(specifier, parentURL = importMeta.url) {
60
+ if (/^[./]*\/.*/.test(specifier)) return pathResolve(specifier, parentURL);
61
+ try {
62
+ return importMeta.nodeResolve(specifier, parentURL);
63
+ } catch {
64
+ return pathResolve(specifier, parentURL);
65
+ }
66
+ },
67
+ filename: module$1.filename,
68
+ dirname: module$1.path
69
+ });
70
+ moduleImportMetaWM.set(module$1, importMeta);
71
+ importMetaCache = importMeta;
72
+ }
73
+ return importMetaCache;
74
+ };
75
+ })();
76
+ let import_meta_ponyfill_esmodule = Reflect.get(globalThis, Symbol.for("import-meta-ponyfill-esmodule")) ?? ((importMeta) => {
77
+ const resolveFunStr = String(importMeta.resolve);
78
+ const importMetaWM = /* @__PURE__ */ new WeakMap();
79
+ const isMain = (filename) => {
80
+ try {
81
+ const entry = process.argv[1];
82
+ return filename === entry || realpathSync(filename) === realpathSync(entry);
83
+ } catch {
84
+ return false;
85
+ }
86
+ };
87
+ const isSupportResolve = resolveFunStr !== "undefined" && !resolveFunStr.startsWith("async");
88
+ import_meta_ponyfill_esmodule = (im) => {
89
+ let importMetaCache = importMetaWM.get(im);
90
+ if (importMetaCache == null) {
91
+ const filename = im.filename ?? fileURLToPath(im.url);
92
+ const dirname$2 = im.dirname ?? dirname(filename);
93
+ const importMeta$1 = {
94
+ url: im.url,
95
+ main: im.main ?? isMain(filename),
96
+ filename,
97
+ dirname: dirname$2,
98
+ nodeResolve: isSupportResolve ? im.resolve : (() => {
99
+ const importMetaUrlRequire = createRequire(im.url);
100
+ return (specifier, parentURL = im.url) => {
101
+ return pathToFileURL((importMeta$1.url === parentURL ? importMetaUrlRequire : createRequire(parentURL)).resolve(specifier)).href;
102
+ };
103
+ })(),
104
+ resolve: function resolve$1(specifier, parentURL = im.url) {
105
+ if (/^[./]*\/.*/.test(specifier)) return pathResolve(specifier, parentURL);
106
+ try {
107
+ return importMeta$1.nodeResolve(specifier, parentURL);
108
+ } catch {
109
+ return pathResolve(specifier, parentURL);
110
+ }
111
+ }
112
+ };
113
+ importMetaCache = importMeta$1;
114
+ importMetaWM.set(im, importMeta$1);
115
+ }
116
+ return importMetaCache;
117
+ };
118
+ return import_meta_ponyfill_esmodule(importMeta);
119
+ });
120
+
121
+ //#endregion
122
+ //#region ../../node_modules/.pnpm/cliui@9.0.1/node_modules/cliui/build/lib/index.js
123
+ const align = {
124
+ right: alignRight,
125
+ center: alignCenter
126
+ };
127
+ const top = 0;
128
+ const right = 1;
129
+ const bottom = 2;
130
+ const left = 3;
131
+ var UI = class {
132
+ constructor(opts) {
133
+ var _a$1;
134
+ this.width = opts.width;
135
+ this.wrap = (_a$1 = opts.wrap) !== null && _a$1 !== void 0 ? _a$1 : true;
136
+ this.rows = [];
137
+ }
138
+ span(...args) {
139
+ const cols = this.div(...args);
140
+ cols.span = true;
141
+ }
142
+ resetOutput() {
143
+ this.rows = [];
144
+ }
145
+ div(...args) {
146
+ if (args.length === 0) this.div("");
147
+ if (this.wrap && this.shouldApplyLayoutDSL(...args) && typeof args[0] === "string") return this.applyLayoutDSL(args[0]);
148
+ const cols = args.map((arg) => {
149
+ if (typeof arg === "string") return this.colFromString(arg);
150
+ return arg;
151
+ });
152
+ this.rows.push(cols);
153
+ return cols;
154
+ }
155
+ shouldApplyLayoutDSL(...args) {
156
+ return args.length === 1 && typeof args[0] === "string" && /[\t\n]/.test(args[0]);
157
+ }
158
+ applyLayoutDSL(str) {
159
+ const rows = str.split("\n").map((row) => row.split(" "));
160
+ let leftColumnWidth = 0;
161
+ rows.forEach((columns) => {
162
+ if (columns.length > 1 && mixin$1.stringWidth(columns[0]) > leftColumnWidth) leftColumnWidth = Math.min(Math.floor(this.width * .5), mixin$1.stringWidth(columns[0]));
163
+ });
164
+ rows.forEach((columns) => {
165
+ this.div(...columns.map((r, i) => {
166
+ return {
167
+ text: r.trim(),
168
+ padding: this.measurePadding(r),
169
+ width: i === 0 && columns.length > 1 ? leftColumnWidth : void 0
170
+ };
171
+ }));
172
+ });
173
+ return this.rows[this.rows.length - 1];
174
+ }
175
+ colFromString(text) {
176
+ return {
177
+ text,
178
+ padding: this.measurePadding(text)
179
+ };
180
+ }
181
+ measurePadding(str) {
182
+ const noAnsi = mixin$1.stripAnsi(str);
183
+ return [
184
+ 0,
185
+ noAnsi.match(/\s*$/)[0].length,
186
+ 0,
187
+ noAnsi.match(/^\s*/)[0].length
188
+ ];
189
+ }
190
+ toString() {
191
+ const lines = [];
192
+ this.rows.forEach((row) => {
193
+ this.rowToString(row, lines);
194
+ });
195
+ return lines.filter((line) => !line.hidden).map((line) => line.text).join("\n");
196
+ }
197
+ rowToString(row, lines) {
198
+ this.rasterize(row).forEach((rrow, r) => {
199
+ let str = "";
200
+ rrow.forEach((col, c) => {
201
+ const { width } = row[c];
202
+ const wrapWidth = this.negatePadding(row[c]);
203
+ let ts = col;
204
+ if (wrapWidth > mixin$1.stringWidth(col)) ts += " ".repeat(wrapWidth - mixin$1.stringWidth(col));
205
+ if (row[c].align && row[c].align !== "left" && this.wrap) {
206
+ const fn = align[row[c].align];
207
+ ts = fn(ts, wrapWidth);
208
+ if (mixin$1.stringWidth(ts) < wrapWidth) ts += " ".repeat((width || 0) - mixin$1.stringWidth(ts) - 1);
209
+ }
210
+ const padding = row[c].padding || [
211
+ 0,
212
+ 0,
213
+ 0,
214
+ 0
215
+ ];
216
+ if (padding[left]) str += " ".repeat(padding[left]);
217
+ str += addBorder(row[c], ts, "| ");
218
+ str += ts;
219
+ str += addBorder(row[c], ts, " |");
220
+ if (padding[right]) str += " ".repeat(padding[right]);
221
+ if (r === 0 && lines.length > 0) str = this.renderInline(str, lines[lines.length - 1]);
222
+ });
223
+ lines.push({
224
+ text: str.replace(/ +$/, ""),
225
+ span: row.span
226
+ });
227
+ });
228
+ return lines;
229
+ }
230
+ renderInline(source, previousLine) {
231
+ const match = source.match(/^ */);
232
+ const leadingWhitespace = match ? match[0].length : 0;
233
+ const target = previousLine.text;
234
+ const targetTextWidth = mixin$1.stringWidth(target.trimRight());
235
+ if (!previousLine.span) return source;
236
+ if (!this.wrap) {
237
+ previousLine.hidden = true;
238
+ return target + source;
239
+ }
240
+ if (leadingWhitespace < targetTextWidth) return source;
241
+ previousLine.hidden = true;
242
+ return target.trimRight() + " ".repeat(leadingWhitespace - targetTextWidth) + source.trimLeft();
243
+ }
244
+ rasterize(row) {
245
+ const rrows = [];
246
+ const widths = this.columnWidths(row);
247
+ let wrapped;
248
+ row.forEach((col, c) => {
249
+ col.width = widths[c];
250
+ if (this.wrap) wrapped = mixin$1.wrap(col.text, this.negatePadding(col), { hard: true }).split("\n");
251
+ else wrapped = col.text.split("\n");
252
+ if (col.border) {
253
+ wrapped.unshift("." + "-".repeat(this.negatePadding(col) + 2) + ".");
254
+ wrapped.push("'" + "-".repeat(this.negatePadding(col) + 2) + "'");
255
+ }
256
+ if (col.padding) {
257
+ wrapped.unshift(...new Array(col.padding[top] || 0).fill(""));
258
+ wrapped.push(...new Array(col.padding[bottom] || 0).fill(""));
259
+ }
260
+ wrapped.forEach((str, r) => {
261
+ if (!rrows[r]) rrows.push([]);
262
+ const rrow = rrows[r];
263
+ for (let i = 0; i < c; i++) if (rrow[i] === void 0) rrow.push("");
264
+ rrow.push(str);
265
+ });
266
+ });
267
+ return rrows;
268
+ }
269
+ negatePadding(col) {
270
+ let wrapWidth = col.width || 0;
271
+ if (col.padding) wrapWidth -= (col.padding[left] || 0) + (col.padding[right] || 0);
272
+ if (col.border) wrapWidth -= 4;
273
+ return wrapWidth;
274
+ }
275
+ columnWidths(row) {
276
+ if (!this.wrap) return row.map((col) => {
277
+ return col.width || mixin$1.stringWidth(col.text);
278
+ });
279
+ let unset = row.length;
280
+ let remainingWidth = this.width;
281
+ const widths = row.map((col) => {
282
+ if (col.width) {
283
+ unset--;
284
+ remainingWidth -= col.width;
285
+ return col.width;
286
+ }
287
+ return void 0;
288
+ });
289
+ const unsetWidth = unset ? Math.floor(remainingWidth / unset) : 0;
290
+ return widths.map((w, i) => {
291
+ if (w === void 0) return Math.max(unsetWidth, _minWidth(row[i]));
292
+ return w;
293
+ });
294
+ }
295
+ };
296
+ function addBorder(col, ts, style) {
297
+ if (col.border) {
298
+ if (/[.']-+[.']/.test(ts)) return "";
299
+ if (ts.trim().length !== 0) return style;
300
+ return " ";
301
+ }
302
+ return "";
303
+ }
304
+ function _minWidth(col) {
305
+ const padding = col.padding || [];
306
+ const minWidth = 1 + (padding[left] || 0) + (padding[right] || 0);
307
+ if (col.border) return minWidth + 4;
308
+ return minWidth;
309
+ }
310
+ function getWindowWidth() {
311
+ /* c8 ignore next 5: depends on terminal */
312
+ if (typeof process === "object" && process.stdout && process.stdout.columns) return process.stdout.columns;
313
+ return 80;
314
+ }
315
+ function alignRight(str, width) {
316
+ str = str.trim();
317
+ const strWidth = mixin$1.stringWidth(str);
318
+ if (strWidth < width) return " ".repeat(width - strWidth) + str;
319
+ return str;
320
+ }
321
+ function alignCenter(str, width) {
322
+ str = str.trim();
323
+ const strWidth = mixin$1.stringWidth(str);
324
+ /* c8 ignore next 3 */
325
+ if (strWidth >= width) return str;
326
+ return " ".repeat(width - strWidth >> 1) + str;
327
+ }
328
+ let mixin$1;
329
+ function cliui(opts, _mixin) {
330
+ mixin$1 = _mixin;
331
+ return new UI({
332
+ width: (opts === null || opts === void 0 ? void 0 : opts.width) || getWindowWidth(),
333
+ wrap: opts === null || opts === void 0 ? void 0 : opts.wrap
334
+ });
335
+ }
336
+
337
+ //#endregion
338
+ //#region ../../node_modules/.pnpm/ansi-regex@6.1.0/node_modules/ansi-regex/index.js
339
+ function ansiRegex({ onlyFirst = false } = {}) {
340
+ const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
341
+ const pattern = [`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?${ST})`, "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
342
+ return new RegExp(pattern, onlyFirst ? void 0 : "g");
343
+ }
344
+
345
+ //#endregion
346
+ //#region ../../node_modules/.pnpm/strip-ansi@7.1.0/node_modules/strip-ansi/index.js
347
+ const regex = ansiRegex();
348
+ function stripAnsi(string) {
349
+ if (typeof string !== "string") throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
350
+ return string.replace(regex, "");
351
+ }
352
+
353
+ //#endregion
354
+ //#region ../../node_modules/.pnpm/get-east-asian-width@1.3.0/node_modules/get-east-asian-width/lookup.js
355
+ function isAmbiguous(x) {
356
+ return x === 161 || x === 164 || x === 167 || x === 168 || x === 170 || x === 173 || x === 174 || x >= 176 && x <= 180 || x >= 182 && x <= 186 || x >= 188 && x <= 191 || x === 198 || x === 208 || x === 215 || x === 216 || x >= 222 && x <= 225 || x === 230 || x >= 232 && x <= 234 || x === 236 || x === 237 || x === 240 || x === 242 || x === 243 || x >= 247 && x <= 250 || x === 252 || x === 254 || x === 257 || x === 273 || x === 275 || x === 283 || x === 294 || x === 295 || x === 299 || x >= 305 && x <= 307 || x === 312 || x >= 319 && x <= 322 || x === 324 || x >= 328 && x <= 331 || x === 333 || x === 338 || x === 339 || x === 358 || x === 359 || x === 363 || x === 462 || x === 464 || x === 466 || x === 468 || x === 470 || x === 472 || x === 474 || x === 476 || x === 593 || x === 609 || x === 708 || x === 711 || x >= 713 && x <= 715 || x === 717 || x === 720 || x >= 728 && x <= 731 || x === 733 || x === 735 || x >= 768 && x <= 879 || x >= 913 && x <= 929 || x >= 931 && x <= 937 || x >= 945 && x <= 961 || x >= 963 && x <= 969 || x === 1025 || x >= 1040 && x <= 1103 || x === 1105 || x === 8208 || x >= 8211 && x <= 8214 || x === 8216 || x === 8217 || x === 8220 || x === 8221 || x >= 8224 && x <= 8226 || x >= 8228 && x <= 8231 || x === 8240 || x === 8242 || x === 8243 || x === 8245 || x === 8251 || x === 8254 || x === 8308 || x === 8319 || x >= 8321 && x <= 8324 || x === 8364 || x === 8451 || x === 8453 || x === 8457 || x === 8467 || x === 8470 || x === 8481 || x === 8482 || x === 8486 || x === 8491 || x === 8531 || x === 8532 || x >= 8539 && x <= 8542 || x >= 8544 && x <= 8555 || x >= 8560 && x <= 8569 || x === 8585 || x >= 8592 && x <= 8601 || x === 8632 || x === 8633 || x === 8658 || x === 8660 || x === 8679 || x === 8704 || x === 8706 || x === 8707 || x === 8711 || x === 8712 || x === 8715 || x === 8719 || x === 8721 || x === 8725 || x === 8730 || x >= 8733 && x <= 8736 || x === 8739 || x === 8741 || x >= 8743 && x <= 8748 || x === 8750 || x >= 8756 && x <= 8759 || x === 8764 || x === 8765 || x === 8776 || x === 8780 || x === 8786 || x === 8800 || x === 8801 || x >= 8804 && x <= 8807 || x === 8810 || x === 8811 || x === 8814 || x === 8815 || x === 8834 || x === 8835 || x === 8838 || x === 8839 || x === 8853 || x === 8857 || x === 8869 || x === 8895 || x === 8978 || x >= 9312 && x <= 9449 || x >= 9451 && x <= 9547 || x >= 9552 && x <= 9587 || x >= 9600 && x <= 9615 || x >= 9618 && x <= 9621 || x === 9632 || x === 9633 || x >= 9635 && x <= 9641 || x === 9650 || x === 9651 || x === 9654 || x === 9655 || x === 9660 || x === 9661 || x === 9664 || x === 9665 || x >= 9670 && x <= 9672 || x === 9675 || x >= 9678 && x <= 9681 || x >= 9698 && x <= 9701 || x === 9711 || x === 9733 || x === 9734 || x === 9737 || x === 9742 || x === 9743 || x === 9756 || x === 9758 || x === 9792 || x === 9794 || x === 9824 || x === 9825 || x >= 9827 && x <= 9829 || x >= 9831 && x <= 9834 || x === 9836 || x === 9837 || x === 9839 || x === 9886 || x === 9887 || x === 9919 || x >= 9926 && x <= 9933 || x >= 9935 && x <= 9939 || x >= 9941 && x <= 9953 || x === 9955 || x === 9960 || x === 9961 || x >= 9963 && x <= 9969 || x === 9972 || x >= 9974 && x <= 9977 || x === 9979 || x === 9980 || x === 9982 || x === 9983 || x === 10045 || x >= 10102 && x <= 10111 || x >= 11094 && x <= 11097 || x >= 12872 && x <= 12879 || x >= 57344 && x <= 63743 || x >= 65024 && x <= 65039 || x === 65533 || x >= 127232 && x <= 127242 || x >= 127248 && x <= 127277 || x >= 127280 && x <= 127337 || x >= 127344 && x <= 127373 || x === 127375 || x === 127376 || x >= 127387 && x <= 127404 || x >= 917760 && x <= 917999 || x >= 983040 && x <= 1048573 || x >= 1048576 && x <= 1114109;
357
+ }
358
+ function isFullWidth(x) {
359
+ return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
360
+ }
361
+ function isWide(x) {
362
+ return x >= 4352 && x <= 4447 || x === 8986 || x === 8987 || x === 9001 || x === 9002 || x >= 9193 && x <= 9196 || x === 9200 || x === 9203 || x === 9725 || x === 9726 || x === 9748 || x === 9749 || x >= 9776 && x <= 9783 || x >= 9800 && x <= 9811 || x === 9855 || x >= 9866 && x <= 9871 || x === 9875 || x === 9889 || x === 9898 || x === 9899 || x === 9917 || x === 9918 || x === 9924 || x === 9925 || x === 9934 || x === 9940 || x === 9962 || x === 9970 || x === 9971 || x === 9973 || x === 9978 || x === 9981 || x === 9989 || x === 9994 || x === 9995 || x === 10024 || x === 10060 || x === 10062 || x >= 10067 && x <= 10069 || x === 10071 || x >= 10133 && x <= 10135 || x === 10160 || x === 10175 || x === 11035 || x === 11036 || x === 11088 || x === 11093 || x >= 11904 && x <= 11929 || x >= 11931 && x <= 12019 || x >= 12032 && x <= 12245 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12353 && x <= 12438 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12773 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 42124 || x >= 42128 && x <= 42182 || x >= 43360 && x <= 43388 || x >= 44032 && x <= 55203 || x >= 63744 && x <= 64255 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 94176 && x <= 94180 || x === 94192 || x === 94193 || x >= 94208 && x <= 100343 || x >= 100352 && x <= 101589 || x >= 101631 && x <= 101640 || x >= 110576 && x <= 110579 || x >= 110581 && x <= 110587 || x === 110589 || x === 110590 || x >= 110592 && x <= 110882 || x === 110898 || x >= 110928 && x <= 110930 || x === 110933 || x >= 110948 && x <= 110951 || x >= 110960 && x <= 111355 || x >= 119552 && x <= 119638 || x >= 119648 && x <= 119670 || x === 126980 || x === 127183 || x === 127374 || x >= 127377 && x <= 127386 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x === 127568 || x === 127569 || x >= 127584 && x <= 127589 || x >= 127744 && x <= 127776 || x >= 127789 && x <= 127797 || x >= 127799 && x <= 127868 || x >= 127870 && x <= 127891 || x >= 127904 && x <= 127946 || x >= 127951 && x <= 127955 || x >= 127968 && x <= 127984 || x === 127988 || x >= 127992 && x <= 128062 || x === 128064 || x >= 128066 && x <= 128252 || x >= 128255 && x <= 128317 || x >= 128331 && x <= 128334 || x >= 128336 && x <= 128359 || x === 128378 || x === 128405 || x === 128406 || x === 128420 || x >= 128507 && x <= 128591 || x >= 128640 && x <= 128709 || x === 128716 || x >= 128720 && x <= 128722 || x >= 128725 && x <= 128727 || x >= 128732 && x <= 128735 || x === 128747 || x === 128748 || x >= 128756 && x <= 128764 || x >= 128992 && x <= 129003 || x === 129008 || x >= 129292 && x <= 129338 || x >= 129340 && x <= 129349 || x >= 129351 && x <= 129535 || x >= 129648 && x <= 129660 || x >= 129664 && x <= 129673 || x >= 129679 && x <= 129734 || x >= 129742 && x <= 129756 || x >= 129759 && x <= 129769 || x >= 129776 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
363
+ }
364
+
365
+ //#endregion
366
+ //#region ../../node_modules/.pnpm/get-east-asian-width@1.3.0/node_modules/get-east-asian-width/index.js
367
+ function validate(codePoint) {
368
+ if (!Number.isSafeInteger(codePoint)) throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
369
+ }
370
+ function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
371
+ validate(codePoint);
372
+ if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) return 2;
373
+ return 1;
374
+ }
375
+
376
+ //#endregion
377
+ //#region ../../node_modules/.pnpm/emoji-regex@10.4.0/node_modules/emoji-regex/index.js
378
+ var require_emoji_regex = __commonJS({ "../../node_modules/.pnpm/emoji-regex@10.4.0/node_modules/emoji-regex/index.js"(exports, module) {
379
+ module.exports = () => {
380
+ return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\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?|[\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](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\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-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
381
+ };
382
+ } });
383
+
384
+ //#endregion
385
+ //#region ../../node_modules/.pnpm/string-width@7.2.0/node_modules/string-width/index.js
386
+ var import_emoji_regex = __toESM(require_emoji_regex(), 1);
387
+ const segmenter = new Intl.Segmenter();
388
+ const defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
389
+ function stringWidth(string, options = {}) {
390
+ if (typeof string !== "string" || string.length === 0) return 0;
391
+ const { ambiguousIsNarrow = true, countAnsiEscapeCodes = false } = options;
392
+ if (!countAnsiEscapeCodes) string = stripAnsi(string);
393
+ if (string.length === 0) return 0;
394
+ let width = 0;
395
+ const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
396
+ for (const { segment: character } of segmenter.segment(string)) {
397
+ const codePoint = character.codePointAt(0);
398
+ if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) continue;
399
+ if (codePoint >= 8203 && codePoint <= 8207 || codePoint === 65279) continue;
400
+ if (codePoint >= 768 && codePoint <= 879 || codePoint >= 6832 && codePoint <= 6911 || codePoint >= 7616 && codePoint <= 7679 || codePoint >= 8400 && codePoint <= 8447 || codePoint >= 65056 && codePoint <= 65071) continue;
401
+ if (codePoint >= 55296 && codePoint <= 57343) continue;
402
+ if (codePoint >= 65024 && codePoint <= 65039) continue;
403
+ if (defaultIgnorableCodePointRegex.test(character)) continue;
404
+ if ((0, import_emoji_regex.default)().test(character)) {
405
+ width += 2;
406
+ continue;
407
+ }
408
+ width += eastAsianWidth(codePoint, eastAsianWidthOptions);
409
+ }
410
+ return width;
411
+ }
412
+
413
+ //#endregion
414
+ //#region ../../node_modules/.pnpm/ansi-styles@6.2.1/node_modules/ansi-styles/index.js
415
+ const ANSI_BACKGROUND_OFFSET = 10;
416
+ const wrapAnsi16 = (offset = 0) => (code) => `\u001B[${code + offset}m`;
417
+ const wrapAnsi256 = (offset = 0) => (code) => `\u001B[${38 + offset};5;${code}m`;
418
+ const wrapAnsi16m = (offset = 0) => (red, green, blue) => `\u001B[${38 + offset};2;${red};${green};${blue}m`;
419
+ const styles = {
420
+ modifier: {
421
+ reset: [0, 0],
422
+ bold: [1, 22],
423
+ dim: [2, 22],
424
+ italic: [3, 23],
425
+ underline: [4, 24],
426
+ overline: [53, 55],
427
+ inverse: [7, 27],
428
+ hidden: [8, 28],
429
+ strikethrough: [9, 29]
430
+ },
431
+ color: {
432
+ black: [30, 39],
433
+ red: [31, 39],
434
+ green: [32, 39],
435
+ yellow: [33, 39],
436
+ blue: [34, 39],
437
+ magenta: [35, 39],
438
+ cyan: [36, 39],
439
+ white: [37, 39],
440
+ blackBright: [90, 39],
441
+ gray: [90, 39],
442
+ grey: [90, 39],
443
+ redBright: [91, 39],
444
+ greenBright: [92, 39],
445
+ yellowBright: [93, 39],
446
+ blueBright: [94, 39],
447
+ magentaBright: [95, 39],
448
+ cyanBright: [96, 39],
449
+ whiteBright: [97, 39]
450
+ },
451
+ bgColor: {
452
+ bgBlack: [40, 49],
453
+ bgRed: [41, 49],
454
+ bgGreen: [42, 49],
455
+ bgYellow: [43, 49],
456
+ bgBlue: [44, 49],
457
+ bgMagenta: [45, 49],
458
+ bgCyan: [46, 49],
459
+ bgWhite: [47, 49],
460
+ bgBlackBright: [100, 49],
461
+ bgGray: [100, 49],
462
+ bgGrey: [100, 49],
463
+ bgRedBright: [101, 49],
464
+ bgGreenBright: [102, 49],
465
+ bgYellowBright: [103, 49],
466
+ bgBlueBright: [104, 49],
467
+ bgMagentaBright: [105, 49],
468
+ bgCyanBright: [106, 49],
469
+ bgWhiteBright: [107, 49]
470
+ }
471
+ };
472
+ const modifierNames = Object.keys(styles.modifier);
473
+ const foregroundColorNames = Object.keys(styles.color);
474
+ const backgroundColorNames = Object.keys(styles.bgColor);
475
+ const colorNames = [...foregroundColorNames, ...backgroundColorNames];
476
+ function assembleStyles() {
477
+ const codes = /* @__PURE__ */ new Map();
478
+ for (const [groupName, group] of Object.entries(styles)) {
479
+ for (const [styleName, style] of Object.entries(group)) {
480
+ styles[styleName] = {
481
+ open: `\u001B[${style[0]}m`,
482
+ close: `\u001B[${style[1]}m`
483
+ };
484
+ group[styleName] = styles[styleName];
485
+ codes.set(style[0], style[1]);
486
+ }
487
+ Object.defineProperty(styles, groupName, {
488
+ value: group,
489
+ enumerable: false
490
+ });
491
+ }
492
+ Object.defineProperty(styles, "codes", {
493
+ value: codes,
494
+ enumerable: false
495
+ });
496
+ styles.color.close = "\x1B[39m";
497
+ styles.bgColor.close = "\x1B[49m";
498
+ styles.color.ansi = wrapAnsi16();
499
+ styles.color.ansi256 = wrapAnsi256();
500
+ styles.color.ansi16m = wrapAnsi16m();
501
+ styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
502
+ styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
503
+ styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
504
+ Object.defineProperties(styles, {
505
+ rgbToAnsi256: {
506
+ value: (red, green, blue) => {
507
+ if (red === green && green === blue) {
508
+ if (red < 8) return 16;
509
+ if (red > 248) return 231;
510
+ return Math.round((red - 8) / 247 * 24) + 232;
511
+ }
512
+ return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
513
+ },
514
+ enumerable: false
515
+ },
516
+ hexToRgb: {
517
+ value: (hex) => {
518
+ const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
519
+ if (!matches) return [
520
+ 0,
521
+ 0,
522
+ 0
523
+ ];
524
+ let [colorString] = matches;
525
+ if (colorString.length === 3) colorString = [...colorString].map((character) => character + character).join("");
526
+ const integer = Number.parseInt(colorString, 16);
527
+ return [
528
+ integer >> 16 & 255,
529
+ integer >> 8 & 255,
530
+ integer & 255
531
+ ];
532
+ },
533
+ enumerable: false
534
+ },
535
+ hexToAnsi256: {
536
+ value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
537
+ enumerable: false
538
+ },
539
+ ansi256ToAnsi: {
540
+ value: (code) => {
541
+ if (code < 8) return 30 + code;
542
+ if (code < 16) return 90 + (code - 8);
543
+ let red;
544
+ let green;
545
+ let blue;
546
+ if (code >= 232) {
547
+ red = ((code - 232) * 10 + 8) / 255;
548
+ green = red;
549
+ blue = red;
550
+ } else {
551
+ code -= 16;
552
+ const remainder = code % 36;
553
+ red = Math.floor(code / 36) / 5;
554
+ green = Math.floor(remainder / 6) / 5;
555
+ blue = remainder % 6 / 5;
556
+ }
557
+ const value = Math.max(red, green, blue) * 2;
558
+ if (value === 0) return 30;
559
+ let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
560
+ if (value === 2) result += 60;
561
+ return result;
562
+ },
563
+ enumerable: false
564
+ },
565
+ rgbToAnsi: {
566
+ value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
567
+ enumerable: false
568
+ },
569
+ hexToAnsi: {
570
+ value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
571
+ enumerable: false
572
+ }
573
+ });
574
+ return styles;
575
+ }
576
+ const ansiStyles = assembleStyles();
577
+ var ansi_styles_default = ansiStyles;
578
+
579
+ //#endregion
580
+ //#region ../../node_modules/.pnpm/wrap-ansi@9.0.0/node_modules/wrap-ansi/index.js
581
+ const ESCAPES = new Set(["\x1B", "›"]);
582
+ const END_CODE = 39;
583
+ const ANSI_ESCAPE_BELL = "\x07";
584
+ const ANSI_CSI = "[";
585
+ const ANSI_OSC = "]";
586
+ const ANSI_SGR_TERMINATOR = "m";
587
+ const ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
588
+ const wrapAnsiCode = (code) => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
589
+ const wrapAnsiHyperlink = (url) => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;
590
+ const wordLengths = (string) => string.split(" ").map((character) => stringWidth(character));
591
+ const wrapWord = (rows, word, columns) => {
592
+ const characters = [...word];
593
+ let isInsideEscape = false;
594
+ let isInsideLinkEscape = false;
595
+ let visible = stringWidth(stripAnsi(rows.at(-1)));
596
+ for (const [index, character] of characters.entries()) {
597
+ const characterLength = stringWidth(character);
598
+ if (visible + characterLength <= columns) rows[rows.length - 1] += character;
599
+ else {
600
+ rows.push(character);
601
+ visible = 0;
602
+ }
603
+ if (ESCAPES.has(character)) {
604
+ isInsideEscape = true;
605
+ const ansiEscapeLinkCandidate = characters.slice(index + 1, index + 1 + ANSI_ESCAPE_LINK.length).join("");
606
+ isInsideLinkEscape = ansiEscapeLinkCandidate === ANSI_ESCAPE_LINK;
607
+ }
608
+ if (isInsideEscape) {
609
+ if (isInsideLinkEscape) {
610
+ if (character === ANSI_ESCAPE_BELL) {
611
+ isInsideEscape = false;
612
+ isInsideLinkEscape = false;
613
+ }
614
+ } else if (character === ANSI_SGR_TERMINATOR) isInsideEscape = false;
615
+ continue;
616
+ }
617
+ visible += characterLength;
618
+ if (visible === columns && index < characters.length - 1) {
619
+ rows.push("");
620
+ visible = 0;
621
+ }
622
+ }
623
+ if (!visible && rows.at(-1).length > 0 && rows.length > 1) rows[rows.length - 2] += rows.pop();
624
+ };
625
+ const stringVisibleTrimSpacesRight = (string) => {
626
+ const words = string.split(" ");
627
+ let last = words.length;
628
+ while (last > 0) {
629
+ if (stringWidth(words[last - 1]) > 0) break;
630
+ last--;
631
+ }
632
+ if (last === words.length) return string;
633
+ return words.slice(0, last).join(" ") + words.slice(last).join("");
634
+ };
635
+ const exec = (string, columns, options = {}) => {
636
+ if (options.trim !== false && string.trim() === "") return "";
637
+ let returnValue = "";
638
+ let escapeCode;
639
+ let escapeUrl;
640
+ const lengths = wordLengths(string);
641
+ let rows = [""];
642
+ for (const [index, word] of string.split(" ").entries()) {
643
+ if (options.trim !== false) rows[rows.length - 1] = rows.at(-1).trimStart();
644
+ let rowLength = stringWidth(rows.at(-1));
645
+ if (index !== 0) {
646
+ if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
647
+ rows.push("");
648
+ rowLength = 0;
649
+ }
650
+ if (rowLength > 0 || options.trim === false) {
651
+ rows[rows.length - 1] += " ";
652
+ rowLength++;
653
+ }
654
+ }
655
+ if (options.hard && lengths[index] > columns) {
656
+ const remainingColumns = columns - rowLength;
657
+ const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);
658
+ const breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns);
659
+ if (breaksStartingNextLine < breaksStartingThisLine) rows.push("");
660
+ wrapWord(rows, word, columns);
661
+ continue;
662
+ }
663
+ if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) {
664
+ if (options.wordWrap === false && rowLength < columns) {
665
+ wrapWord(rows, word, columns);
666
+ continue;
667
+ }
668
+ rows.push("");
669
+ }
670
+ if (rowLength + lengths[index] > columns && options.wordWrap === false) {
671
+ wrapWord(rows, word, columns);
672
+ continue;
673
+ }
674
+ rows[rows.length - 1] += word;
675
+ }
676
+ if (options.trim !== false) rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
677
+ const preString = rows.join("\n");
678
+ const pre = [...preString];
679
+ let preStringIndex = 0;
680
+ for (const [index, character] of pre.entries()) {
681
+ returnValue += character;
682
+ if (ESCAPES.has(character)) {
683
+ const { groups } = (/* @__PURE__ */ new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`)).exec(preString.slice(preStringIndex)) || { groups: {} };
684
+ if (groups.code !== void 0) {
685
+ const code$1 = Number.parseFloat(groups.code);
686
+ escapeCode = code$1 === END_CODE ? void 0 : code$1;
687
+ } else if (groups.uri !== void 0) escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
688
+ }
689
+ const code = ansi_styles_default.codes.get(Number(escapeCode));
690
+ if (pre[index + 1] === "\n") {
691
+ if (escapeUrl) returnValue += wrapAnsiHyperlink("");
692
+ if (escapeCode && code) returnValue += wrapAnsiCode(code);
693
+ } else if (character === "\n") {
694
+ if (escapeCode && code) returnValue += wrapAnsiCode(escapeCode);
695
+ if (escapeUrl) returnValue += wrapAnsiHyperlink(escapeUrl);
696
+ }
697
+ preStringIndex += character.length;
698
+ }
699
+ return returnValue;
700
+ };
701
+ function wrapAnsi(string, columns, options) {
702
+ return String(string).normalize().replaceAll("\r\n", "\n").split("\n").map((line) => exec(line, columns, options)).join("\n");
703
+ }
704
+
705
+ //#endregion
706
+ //#region ../../node_modules/.pnpm/cliui@9.0.1/node_modules/cliui/index.mjs
707
+ function ui(opts) {
708
+ return cliui(opts, {
709
+ stringWidth,
710
+ stripAnsi,
711
+ wrap: wrapAnsi
712
+ });
713
+ }
714
+
715
+ //#endregion
716
+ //#region ../../node_modules/.pnpm/escalade@3.2.0/node_modules/escalade/sync/index.mjs
717
+ function sync_default(start, callback) {
718
+ let dir = resolve(".", start);
719
+ let tmp, stats = statSync(dir);
720
+ if (!stats.isDirectory()) dir = dirname$1(dir);
721
+ while (true) {
722
+ tmp = callback(dir, readdirSync$1(dir));
723
+ if (tmp) return resolve(dir, tmp);
724
+ dir = dirname$1(tmp = dir);
725
+ if (tmp === dir) break;
726
+ }
727
+ }
728
+
729
+ //#endregion
730
+ //#region ../../node_modules/.pnpm/yargs-parser@22.0.0/node_modules/yargs-parser/build/lib/string-utils.js
731
+ /**
732
+ * @license
733
+ * Copyright (c) 2016, Contributors
734
+ * SPDX-License-Identifier: ISC
735
+ */
736
+ function camelCase(str) {
737
+ const isCamelCase = str !== str.toLowerCase() && str !== str.toUpperCase();
738
+ if (!isCamelCase) str = str.toLowerCase();
739
+ if (str.indexOf("-") === -1 && str.indexOf("_") === -1) return str;
740
+ else {
741
+ let camelcase = "";
742
+ let nextChrUpper = false;
743
+ const leadingHyphens = str.match(/^-+/);
744
+ for (let i = leadingHyphens ? leadingHyphens[0].length : 0; i < str.length; i++) {
745
+ let chr = str.charAt(i);
746
+ if (nextChrUpper) {
747
+ nextChrUpper = false;
748
+ chr = chr.toUpperCase();
749
+ }
750
+ if (i !== 0 && (chr === "-" || chr === "_")) nextChrUpper = true;
751
+ else if (chr !== "-" && chr !== "_") camelcase += chr;
752
+ }
753
+ return camelcase;
754
+ }
755
+ }
756
+ function decamelize(str, joinString) {
757
+ const lowercase = str.toLowerCase();
758
+ joinString = joinString || "-";
759
+ let notCamelcase = "";
760
+ for (let i = 0; i < str.length; i++) {
761
+ const chrLower = lowercase.charAt(i);
762
+ const chrString = str.charAt(i);
763
+ if (chrLower !== chrString && i > 0) notCamelcase += `${joinString}${lowercase.charAt(i)}`;
764
+ else notCamelcase += chrString;
765
+ }
766
+ return notCamelcase;
767
+ }
768
+ function looksLikeNumber(x) {
769
+ if (x === null || x === void 0) return false;
770
+ if (typeof x === "number") return true;
771
+ if (/^0x[0-9a-f]+$/i.test(x)) return true;
772
+ if (/^0[^.]/.test(x)) return false;
773
+ return /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
774
+ }
775
+
776
+ //#endregion
777
+ //#region ../../node_modules/.pnpm/yargs-parser@22.0.0/node_modules/yargs-parser/build/lib/tokenize-arg-string.js
778
+ /**
779
+ * @license
780
+ * Copyright (c) 2016, Contributors
781
+ * SPDX-License-Identifier: ISC
782
+ */
783
+ function tokenizeArgString(argString) {
784
+ if (Array.isArray(argString)) return argString.map((e) => typeof e !== "string" ? e + "" : e);
785
+ argString = argString.trim();
786
+ let i = 0;
787
+ let prevC = null;
788
+ let c = null;
789
+ let opening = null;
790
+ const args = [];
791
+ for (let ii = 0; ii < argString.length; ii++) {
792
+ prevC = c;
793
+ c = argString.charAt(ii);
794
+ if (c === " " && !opening) {
795
+ if (!(prevC === " ")) i++;
796
+ continue;
797
+ }
798
+ if (c === opening) opening = null;
799
+ else if ((c === "'" || c === "\"") && !opening) opening = c;
800
+ if (!args[i]) args[i] = "";
801
+ args[i] += c;
802
+ }
803
+ return args;
804
+ }
805
+
806
+ //#endregion
807
+ //#region ../../node_modules/.pnpm/yargs-parser@22.0.0/node_modules/yargs-parser/build/lib/yargs-parser-types.js
808
+ /**
809
+ * @license
810
+ * Copyright (c) 2016, Contributors
811
+ * SPDX-License-Identifier: ISC
812
+ */
813
+ var DefaultValuesForTypeKey;
814
+ (function(DefaultValuesForTypeKey$1) {
815
+ DefaultValuesForTypeKey$1["BOOLEAN"] = "boolean";
816
+ DefaultValuesForTypeKey$1["STRING"] = "string";
817
+ DefaultValuesForTypeKey$1["NUMBER"] = "number";
818
+ DefaultValuesForTypeKey$1["ARRAY"] = "array";
819
+ })(DefaultValuesForTypeKey || (DefaultValuesForTypeKey = {}));
820
+
821
+ //#endregion
822
+ //#region ../../node_modules/.pnpm/yargs-parser@22.0.0/node_modules/yargs-parser/build/lib/yargs-parser.js
823
+ let mixin;
824
+ var YargsParser = class {
825
+ constructor(_mixin) {
826
+ mixin = _mixin;
827
+ }
828
+ parse(argsInput, options) {
829
+ const opts = Object.assign({
830
+ alias: void 0,
831
+ array: void 0,
832
+ boolean: void 0,
833
+ config: void 0,
834
+ configObjects: void 0,
835
+ configuration: void 0,
836
+ coerce: void 0,
837
+ count: void 0,
838
+ default: void 0,
839
+ envPrefix: void 0,
840
+ narg: void 0,
841
+ normalize: void 0,
842
+ string: void 0,
843
+ number: void 0,
844
+ __: void 0,
845
+ key: void 0
846
+ }, options);
847
+ const args = tokenizeArgString(argsInput);
848
+ const inputIsString = typeof argsInput === "string";
849
+ const aliases = combineAliases(Object.assign(Object.create(null), opts.alias));
850
+ const configuration = Object.assign({
851
+ "boolean-negation": true,
852
+ "camel-case-expansion": true,
853
+ "combine-arrays": false,
854
+ "dot-notation": true,
855
+ "duplicate-arguments-array": true,
856
+ "flatten-duplicate-arrays": true,
857
+ "greedy-arrays": true,
858
+ "halt-at-non-option": false,
859
+ "nargs-eats-options": false,
860
+ "negation-prefix": "no-",
861
+ "parse-numbers": true,
862
+ "parse-positional-numbers": true,
863
+ "populate--": false,
864
+ "set-placeholder-key": false,
865
+ "short-option-groups": true,
866
+ "strip-aliased": false,
867
+ "strip-dashed": false,
868
+ "unknown-options-as-args": false
869
+ }, opts.configuration);
870
+ const defaults = Object.assign(Object.create(null), opts.default);
871
+ const configObjects = opts.configObjects || [];
872
+ const envPrefix = opts.envPrefix;
873
+ const notFlagsOption = configuration["populate--"];
874
+ const notFlagsArgv = notFlagsOption ? "--" : "_";
875
+ const newAliases = Object.create(null);
876
+ const defaulted = Object.create(null);
877
+ const __ = opts.__ || mixin.format;
878
+ const flags = {
879
+ aliases: Object.create(null),
880
+ arrays: Object.create(null),
881
+ bools: Object.create(null),
882
+ strings: Object.create(null),
883
+ numbers: Object.create(null),
884
+ counts: Object.create(null),
885
+ normalize: Object.create(null),
886
+ configs: Object.create(null),
887
+ nargs: Object.create(null),
888
+ coercions: Object.create(null),
889
+ keys: []
890
+ };
891
+ const negative = /^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/;
892
+ const negatedBoolean = /* @__PURE__ */ new RegExp("^--" + configuration["negation-prefix"] + "(.+)");
893
+ [].concat(opts.array || []).filter(Boolean).forEach(function(opt) {
894
+ const key = typeof opt === "object" ? opt.key : opt;
895
+ const assignment = Object.keys(opt).map(function(key$1) {
896
+ const arrayFlagKeys = {
897
+ boolean: "bools",
898
+ string: "strings",
899
+ number: "numbers"
900
+ };
901
+ return arrayFlagKeys[key$1];
902
+ }).filter(Boolean).pop();
903
+ if (assignment) flags[assignment][key] = true;
904
+ flags.arrays[key] = true;
905
+ flags.keys.push(key);
906
+ });
907
+ [].concat(opts.boolean || []).filter(Boolean).forEach(function(key) {
908
+ flags.bools[key] = true;
909
+ flags.keys.push(key);
910
+ });
911
+ [].concat(opts.string || []).filter(Boolean).forEach(function(key) {
912
+ flags.strings[key] = true;
913
+ flags.keys.push(key);
914
+ });
915
+ [].concat(opts.number || []).filter(Boolean).forEach(function(key) {
916
+ flags.numbers[key] = true;
917
+ flags.keys.push(key);
918
+ });
919
+ [].concat(opts.count || []).filter(Boolean).forEach(function(key) {
920
+ flags.counts[key] = true;
921
+ flags.keys.push(key);
922
+ });
923
+ [].concat(opts.normalize || []).filter(Boolean).forEach(function(key) {
924
+ flags.normalize[key] = true;
925
+ flags.keys.push(key);
926
+ });
927
+ if (typeof opts.narg === "object") Object.entries(opts.narg).forEach(([key, value]) => {
928
+ if (typeof value === "number") {
929
+ flags.nargs[key] = value;
930
+ flags.keys.push(key);
931
+ }
932
+ });
933
+ if (typeof opts.coerce === "object") Object.entries(opts.coerce).forEach(([key, value]) => {
934
+ if (typeof value === "function") {
935
+ flags.coercions[key] = value;
936
+ flags.keys.push(key);
937
+ }
938
+ });
939
+ if (typeof opts.config !== "undefined") {
940
+ if (Array.isArray(opts.config) || typeof opts.config === "string") [].concat(opts.config).filter(Boolean).forEach(function(key) {
941
+ flags.configs[key] = true;
942
+ });
943
+ else if (typeof opts.config === "object") Object.entries(opts.config).forEach(([key, value]) => {
944
+ if (typeof value === "boolean" || typeof value === "function") flags.configs[key] = value;
945
+ });
946
+ }
947
+ extendAliases(opts.key, aliases, opts.default, flags.arrays);
948
+ Object.keys(defaults).forEach(function(key) {
949
+ (flags.aliases[key] || []).forEach(function(alias) {
950
+ defaults[alias] = defaults[key];
951
+ });
952
+ });
953
+ let error = null;
954
+ checkConfiguration();
955
+ let notFlags = [];
956
+ const argv = Object.assign(Object.create(null), { _: [] });
957
+ const argvReturn = {};
958
+ for (let i = 0; i < args.length; i++) {
959
+ const arg = args[i];
960
+ const truncatedArg = arg.replace(/^-{3,}/, "---");
961
+ let broken;
962
+ let key;
963
+ let letters;
964
+ let m;
965
+ let next;
966
+ let value;
967
+ if (arg !== "--" && /^-/.test(arg) && isUnknownOptionAsArg(arg)) pushPositional(arg);
968
+ else if (truncatedArg.match(/^---+(=|$)/)) {
969
+ pushPositional(arg);
970
+ continue;
971
+ } else if (arg.match(/^--.+=/) || !configuration["short-option-groups"] && arg.match(/^-.+=/)) {
972
+ m = arg.match(/^--?([^=]+)=([\s\S]*)$/);
973
+ if (m !== null && Array.isArray(m) && m.length >= 3) if (checkAllAliases(m[1], flags.arrays)) i = eatArray(i, m[1], args, m[2]);
974
+ else if (checkAllAliases(m[1], flags.nargs) !== false) i = eatNargs(i, m[1], args, m[2]);
975
+ else setArg(m[1], m[2], true);
976
+ } else if (arg.match(negatedBoolean) && configuration["boolean-negation"]) {
977
+ m = arg.match(negatedBoolean);
978
+ if (m !== null && Array.isArray(m) && m.length >= 2) {
979
+ key = m[1];
980
+ setArg(key, checkAllAliases(key, flags.arrays) ? [false] : false);
981
+ }
982
+ } else if (arg.match(/^--.+/) || !configuration["short-option-groups"] && arg.match(/^-[^-]+/)) {
983
+ m = arg.match(/^--?(.+)/);
984
+ if (m !== null && Array.isArray(m) && m.length >= 2) {
985
+ key = m[1];
986
+ if (checkAllAliases(key, flags.arrays)) i = eatArray(i, key, args);
987
+ else if (checkAllAliases(key, flags.nargs) !== false) i = eatNargs(i, key, args);
988
+ else {
989
+ next = args[i + 1];
990
+ if (next !== void 0 && (!next.match(/^-/) || next.match(negative)) && !checkAllAliases(key, flags.bools) && !checkAllAliases(key, flags.counts)) {
991
+ setArg(key, next);
992
+ i++;
993
+ } else if (/^(true|false)$/.test(next)) {
994
+ setArg(key, next);
995
+ i++;
996
+ } else setArg(key, defaultValue(key));
997
+ }
998
+ }
999
+ } else if (arg.match(/^-.\..+=/)) {
1000
+ m = arg.match(/^-([^=]+)=([\s\S]*)$/);
1001
+ if (m !== null && Array.isArray(m) && m.length >= 3) setArg(m[1], m[2]);
1002
+ } else if (arg.match(/^-.\..+/) && !arg.match(negative)) {
1003
+ next = args[i + 1];
1004
+ m = arg.match(/^-(.\..+)/);
1005
+ if (m !== null && Array.isArray(m) && m.length >= 2) {
1006
+ key = m[1];
1007
+ if (next !== void 0 && !next.match(/^-/) && !checkAllAliases(key, flags.bools) && !checkAllAliases(key, flags.counts)) {
1008
+ setArg(key, next);
1009
+ i++;
1010
+ } else setArg(key, defaultValue(key));
1011
+ }
1012
+ } else if (arg.match(/^-[^-]+/) && !arg.match(negative)) {
1013
+ letters = arg.slice(1, -1).split("");
1014
+ broken = false;
1015
+ for (let j = 0; j < letters.length; j++) {
1016
+ next = arg.slice(j + 2);
1017
+ if (letters[j + 1] && letters[j + 1] === "=") {
1018
+ value = arg.slice(j + 3);
1019
+ key = letters[j];
1020
+ if (checkAllAliases(key, flags.arrays)) i = eatArray(i, key, args, value);
1021
+ else if (checkAllAliases(key, flags.nargs) !== false) i = eatNargs(i, key, args, value);
1022
+ else setArg(key, value);
1023
+ broken = true;
1024
+ break;
1025
+ }
1026
+ if (next === "-") {
1027
+ setArg(letters[j], next);
1028
+ continue;
1029
+ }
1030
+ if (/[A-Za-z]/.test(letters[j]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next) && checkAllAliases(next, flags.bools) === false) {
1031
+ setArg(letters[j], next);
1032
+ broken = true;
1033
+ break;
1034
+ }
1035
+ if (letters[j + 1] && letters[j + 1].match(/\W/)) {
1036
+ setArg(letters[j], next);
1037
+ broken = true;
1038
+ break;
1039
+ } else setArg(letters[j], defaultValue(letters[j]));
1040
+ }
1041
+ key = arg.slice(-1)[0];
1042
+ if (!broken && key !== "-") if (checkAllAliases(key, flags.arrays)) i = eatArray(i, key, args);
1043
+ else if (checkAllAliases(key, flags.nargs) !== false) i = eatNargs(i, key, args);
1044
+ else {
1045
+ next = args[i + 1];
1046
+ if (next !== void 0 && (!/^(-|--)[^-]/.test(next) || next.match(negative)) && !checkAllAliases(key, flags.bools) && !checkAllAliases(key, flags.counts)) {
1047
+ setArg(key, next);
1048
+ i++;
1049
+ } else if (/^(true|false)$/.test(next)) {
1050
+ setArg(key, next);
1051
+ i++;
1052
+ } else setArg(key, defaultValue(key));
1053
+ }
1054
+ } else if (arg.match(/^-[0-9]$/) && arg.match(negative) && checkAllAliases(arg.slice(1), flags.bools)) {
1055
+ key = arg.slice(1);
1056
+ setArg(key, defaultValue(key));
1057
+ } else if (arg === "--") {
1058
+ notFlags = args.slice(i + 1);
1059
+ break;
1060
+ } else if (configuration["halt-at-non-option"]) {
1061
+ notFlags = args.slice(i);
1062
+ break;
1063
+ } else pushPositional(arg);
1064
+ }
1065
+ applyEnvVars(argv, true);
1066
+ applyEnvVars(argv, false);
1067
+ setConfig(argv);
1068
+ setConfigObjects();
1069
+ applyDefaultsAndAliases(argv, flags.aliases, defaults, true);
1070
+ applyCoercions(argv);
1071
+ if (configuration["set-placeholder-key"]) setPlaceholderKeys(argv);
1072
+ Object.keys(flags.counts).forEach(function(key) {
1073
+ if (!hasKey(argv, key.split("."))) setArg(key, 0);
1074
+ });
1075
+ if (notFlagsOption && notFlags.length) argv[notFlagsArgv] = [];
1076
+ notFlags.forEach(function(key) {
1077
+ argv[notFlagsArgv].push(key);
1078
+ });
1079
+ if (configuration["camel-case-expansion"] && configuration["strip-dashed"]) Object.keys(argv).filter((key) => key !== "--" && key.includes("-")).forEach((key) => {
1080
+ delete argv[key];
1081
+ });
1082
+ if (configuration["strip-aliased"]) [].concat(...Object.keys(aliases).map((k) => aliases[k])).forEach((alias) => {
1083
+ if (configuration["camel-case-expansion"] && alias.includes("-")) delete argv[alias.split(".").map((prop) => camelCase(prop)).join(".")];
1084
+ delete argv[alias];
1085
+ });
1086
+ function pushPositional(arg) {
1087
+ const maybeCoercedNumber = maybeCoerceNumber("_", arg);
1088
+ if (typeof maybeCoercedNumber === "string" || typeof maybeCoercedNumber === "number") argv._.push(maybeCoercedNumber);
1089
+ }
1090
+ function eatNargs(i, key, args$1, argAfterEqualSign) {
1091
+ let ii;
1092
+ let toEat = checkAllAliases(key, flags.nargs);
1093
+ toEat = typeof toEat !== "number" || isNaN(toEat) ? 1 : toEat;
1094
+ if (toEat === 0) {
1095
+ if (!isUndefined(argAfterEqualSign)) error = Error(__("Argument unexpected for: %s", key));
1096
+ setArg(key, defaultValue(key));
1097
+ return i;
1098
+ }
1099
+ let available = isUndefined(argAfterEqualSign) ? 0 : 1;
1100
+ if (configuration["nargs-eats-options"]) {
1101
+ if (args$1.length - (i + 1) + available < toEat) error = Error(__("Not enough arguments following: %s", key));
1102
+ available = toEat;
1103
+ } else {
1104
+ for (ii = i + 1; ii < args$1.length; ii++) if (!args$1[ii].match(/^-[^0-9]/) || args$1[ii].match(negative) || isUnknownOptionAsArg(args$1[ii])) available++;
1105
+ else break;
1106
+ if (available < toEat) error = Error(__("Not enough arguments following: %s", key));
1107
+ }
1108
+ let consumed = Math.min(available, toEat);
1109
+ if (!isUndefined(argAfterEqualSign) && consumed > 0) {
1110
+ setArg(key, argAfterEqualSign);
1111
+ consumed--;
1112
+ }
1113
+ for (ii = i + 1; ii < consumed + i + 1; ii++) setArg(key, args$1[ii]);
1114
+ return i + consumed;
1115
+ }
1116
+ function eatArray(i, key, args$1, argAfterEqualSign) {
1117
+ let argsToSet = [];
1118
+ let next = argAfterEqualSign || args$1[i + 1];
1119
+ const nargsCount = checkAllAliases(key, flags.nargs);
1120
+ if (checkAllAliases(key, flags.bools) && !/^(true|false)$/.test(next)) argsToSet.push(true);
1121
+ else if (isUndefined(next) || isUndefined(argAfterEqualSign) && /^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next)) {
1122
+ if (defaults[key] !== void 0) {
1123
+ const defVal = defaults[key];
1124
+ argsToSet = Array.isArray(defVal) ? defVal : [defVal];
1125
+ }
1126
+ } else {
1127
+ if (!isUndefined(argAfterEqualSign)) argsToSet.push(processValue(key, argAfterEqualSign, true));
1128
+ for (let ii = i + 1; ii < args$1.length; ii++) {
1129
+ if (!configuration["greedy-arrays"] && argsToSet.length > 0 || nargsCount && typeof nargsCount === "number" && argsToSet.length >= nargsCount) break;
1130
+ next = args$1[ii];
1131
+ if (/^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next)) break;
1132
+ i = ii;
1133
+ argsToSet.push(processValue(key, next, inputIsString));
1134
+ }
1135
+ }
1136
+ if (typeof nargsCount === "number" && (nargsCount && argsToSet.length < nargsCount || isNaN(nargsCount) && argsToSet.length === 0)) error = Error(__("Not enough arguments following: %s", key));
1137
+ setArg(key, argsToSet);
1138
+ return i;
1139
+ }
1140
+ function setArg(key, val, shouldStripQuotes = inputIsString) {
1141
+ if (/-/.test(key) && configuration["camel-case-expansion"]) {
1142
+ const alias = key.split(".").map(function(prop) {
1143
+ return camelCase(prop);
1144
+ }).join(".");
1145
+ addNewAlias(key, alias);
1146
+ }
1147
+ const value = processValue(key, val, shouldStripQuotes);
1148
+ const splitKey = key.split(".");
1149
+ setKey(argv, splitKey, value);
1150
+ if (flags.aliases[key]) flags.aliases[key].forEach(function(x) {
1151
+ const keyProperties = x.split(".");
1152
+ setKey(argv, keyProperties, value);
1153
+ });
1154
+ if (splitKey.length > 1 && configuration["dot-notation"]) (flags.aliases[splitKey[0]] || []).forEach(function(x) {
1155
+ let keyProperties = x.split(".");
1156
+ const a = [].concat(splitKey);
1157
+ a.shift();
1158
+ keyProperties = keyProperties.concat(a);
1159
+ if (!(flags.aliases[key] || []).includes(keyProperties.join("."))) setKey(argv, keyProperties, value);
1160
+ });
1161
+ if (checkAllAliases(key, flags.normalize) && !checkAllAliases(key, flags.arrays)) {
1162
+ const keys = [key].concat(flags.aliases[key] || []);
1163
+ keys.forEach(function(key$1) {
1164
+ Object.defineProperty(argvReturn, key$1, {
1165
+ enumerable: true,
1166
+ get() {
1167
+ return val;
1168
+ },
1169
+ set(value$1) {
1170
+ val = typeof value$1 === "string" ? mixin.normalize(value$1) : value$1;
1171
+ }
1172
+ });
1173
+ });
1174
+ }
1175
+ }
1176
+ function addNewAlias(key, alias) {
1177
+ if (!(flags.aliases[key] && flags.aliases[key].length)) {
1178
+ flags.aliases[key] = [alias];
1179
+ newAliases[alias] = true;
1180
+ }
1181
+ if (!(flags.aliases[alias] && flags.aliases[alias].length)) addNewAlias(alias, key);
1182
+ }
1183
+ function processValue(key, val, shouldStripQuotes) {
1184
+ if (shouldStripQuotes) val = stripQuotes(val);
1185
+ if (checkAllAliases(key, flags.bools) || checkAllAliases(key, flags.counts)) {
1186
+ if (typeof val === "string") val = val === "true";
1187
+ }
1188
+ let value = Array.isArray(val) ? val.map(function(v) {
1189
+ return maybeCoerceNumber(key, v);
1190
+ }) : maybeCoerceNumber(key, val);
1191
+ if (checkAllAliases(key, flags.counts) && (isUndefined(value) || typeof value === "boolean")) value = increment();
1192
+ if (checkAllAliases(key, flags.normalize) && checkAllAliases(key, flags.arrays)) if (Array.isArray(val)) value = val.map((val$1) => {
1193
+ return mixin.normalize(val$1);
1194
+ });
1195
+ else value = mixin.normalize(val);
1196
+ return value;
1197
+ }
1198
+ function maybeCoerceNumber(key, value) {
1199
+ if (!configuration["parse-positional-numbers"] && key === "_") return value;
1200
+ if (!checkAllAliases(key, flags.strings) && !checkAllAliases(key, flags.bools) && !Array.isArray(value)) {
1201
+ const shouldCoerceNumber = looksLikeNumber(value) && configuration["parse-numbers"] && Number.isSafeInteger(Math.floor(parseFloat(`${value}`)));
1202
+ if (shouldCoerceNumber || !isUndefined(value) && checkAllAliases(key, flags.numbers)) value = Number(value);
1203
+ }
1204
+ return value;
1205
+ }
1206
+ function setConfig(argv$1) {
1207
+ const configLookup = Object.create(null);
1208
+ applyDefaultsAndAliases(configLookup, flags.aliases, defaults);
1209
+ Object.keys(flags.configs).forEach(function(configKey) {
1210
+ const configPath = argv$1[configKey] || configLookup[configKey];
1211
+ if (configPath) try {
1212
+ let config = null;
1213
+ const resolvedConfigPath = mixin.resolve(mixin.cwd(), configPath);
1214
+ const resolveConfig = flags.configs[configKey];
1215
+ if (typeof resolveConfig === "function") {
1216
+ try {
1217
+ config = resolveConfig(resolvedConfigPath);
1218
+ } catch (e) {
1219
+ config = e;
1220
+ }
1221
+ if (config instanceof Error) {
1222
+ error = config;
1223
+ return;
1224
+ }
1225
+ } else config = mixin.require(resolvedConfigPath);
1226
+ setConfigObject(config);
1227
+ } catch (ex) {
1228
+ if (ex.name === "PermissionDenied") error = ex;
1229
+ else if (argv$1[configKey]) error = Error(__("Invalid JSON config file: %s", configPath));
1230
+ }
1231
+ });
1232
+ }
1233
+ function setConfigObject(config, prev) {
1234
+ Object.keys(config).forEach(function(key) {
1235
+ const value = config[key];
1236
+ const fullKey = prev ? prev + "." + key : key;
1237
+ if (typeof value === "object" && value !== null && !Array.isArray(value) && configuration["dot-notation"]) setConfigObject(value, fullKey);
1238
+ else if (!hasKey(argv, fullKey.split(".")) || checkAllAliases(fullKey, flags.arrays) && configuration["combine-arrays"]) setArg(fullKey, value);
1239
+ });
1240
+ }
1241
+ function setConfigObjects() {
1242
+ if (typeof configObjects !== "undefined") configObjects.forEach(function(configObject) {
1243
+ setConfigObject(configObject);
1244
+ });
1245
+ }
1246
+ function applyEnvVars(argv$1, configOnly) {
1247
+ if (typeof envPrefix === "undefined") return;
1248
+ const prefix = typeof envPrefix === "string" ? envPrefix : "";
1249
+ const env$1 = mixin.env();
1250
+ Object.keys(env$1).forEach(function(envVar) {
1251
+ if (prefix === "" || envVar.lastIndexOf(prefix, 0) === 0) {
1252
+ const keys = envVar.split("__").map(function(key, i) {
1253
+ if (i === 0) key = key.substring(prefix.length);
1254
+ return camelCase(key);
1255
+ });
1256
+ if ((configOnly && flags.configs[keys.join(".")] || !configOnly) && !hasKey(argv$1, keys)) setArg(keys.join("."), env$1[envVar]);
1257
+ }
1258
+ });
1259
+ }
1260
+ function applyCoercions(argv$1) {
1261
+ let coerce;
1262
+ const applied = /* @__PURE__ */ new Set();
1263
+ Object.keys(argv$1).forEach(function(key) {
1264
+ if (!applied.has(key)) {
1265
+ coerce = checkAllAliases(key, flags.coercions);
1266
+ if (typeof coerce === "function") try {
1267
+ const value = maybeCoerceNumber(key, coerce(argv$1[key]));
1268
+ [].concat(flags.aliases[key] || [], key).forEach((ali) => {
1269
+ applied.add(ali);
1270
+ argv$1[ali] = value;
1271
+ });
1272
+ } catch (err) {
1273
+ error = err;
1274
+ }
1275
+ }
1276
+ });
1277
+ }
1278
+ function setPlaceholderKeys(argv$1) {
1279
+ flags.keys.forEach((key) => {
1280
+ if (~key.indexOf(".")) return;
1281
+ if (typeof argv$1[key] === "undefined") argv$1[key] = void 0;
1282
+ });
1283
+ return argv$1;
1284
+ }
1285
+ function applyDefaultsAndAliases(obj, aliases$1, defaults$1, canLog = false) {
1286
+ Object.keys(defaults$1).forEach(function(key) {
1287
+ if (!hasKey(obj, key.split("."))) {
1288
+ setKey(obj, key.split("."), defaults$1[key]);
1289
+ if (canLog) defaulted[key] = true;
1290
+ (aliases$1[key] || []).forEach(function(x) {
1291
+ if (hasKey(obj, x.split("."))) return;
1292
+ setKey(obj, x.split("."), defaults$1[key]);
1293
+ });
1294
+ }
1295
+ });
1296
+ }
1297
+ function hasKey(obj, keys) {
1298
+ let o = obj;
1299
+ if (!configuration["dot-notation"]) keys = [keys.join(".")];
1300
+ keys.slice(0, -1).forEach(function(key$1) {
1301
+ o = o[key$1] || {};
1302
+ });
1303
+ const key = keys[keys.length - 1];
1304
+ if (typeof o !== "object") return false;
1305
+ else return key in o;
1306
+ }
1307
+ function setKey(obj, keys, value) {
1308
+ let o = obj;
1309
+ if (!configuration["dot-notation"]) keys = [keys.join(".")];
1310
+ keys.slice(0, -1).forEach(function(key$1) {
1311
+ key$1 = sanitizeKey(key$1);
1312
+ if (typeof o === "object" && o[key$1] === void 0) o[key$1] = {};
1313
+ if (typeof o[key$1] !== "object" || Array.isArray(o[key$1])) {
1314
+ if (Array.isArray(o[key$1])) o[key$1].push({});
1315
+ else o[key$1] = [o[key$1], {}];
1316
+ o = o[key$1][o[key$1].length - 1];
1317
+ } else o = o[key$1];
1318
+ });
1319
+ const key = sanitizeKey(keys[keys.length - 1]);
1320
+ const isTypeArray = checkAllAliases(keys.join("."), flags.arrays);
1321
+ const isValueArray = Array.isArray(value);
1322
+ let duplicate = configuration["duplicate-arguments-array"];
1323
+ if (!duplicate && checkAllAliases(key, flags.nargs)) {
1324
+ duplicate = true;
1325
+ if (!isUndefined(o[key]) && flags.nargs[key] === 1 || Array.isArray(o[key]) && o[key].length === flags.nargs[key]) o[key] = void 0;
1326
+ }
1327
+ if (value === increment()) o[key] = increment(o[key]);
1328
+ else if (Array.isArray(o[key])) if (duplicate && isTypeArray && isValueArray) o[key] = configuration["flatten-duplicate-arrays"] ? o[key].concat(value) : (Array.isArray(o[key][0]) ? o[key] : [o[key]]).concat([value]);
1329
+ else if (!duplicate && Boolean(isTypeArray) === Boolean(isValueArray)) o[key] = value;
1330
+ else o[key] = o[key].concat([value]);
1331
+ else if (o[key] === void 0 && isTypeArray) o[key] = isValueArray ? value : [value];
1332
+ else if (duplicate && !(o[key] === void 0 || checkAllAliases(key, flags.counts) || checkAllAliases(key, flags.bools))) o[key] = [o[key], value];
1333
+ else o[key] = value;
1334
+ }
1335
+ function extendAliases(...args$1) {
1336
+ args$1.forEach(function(obj) {
1337
+ Object.keys(obj || {}).forEach(function(key) {
1338
+ if (flags.aliases[key]) return;
1339
+ flags.aliases[key] = [].concat(aliases[key] || []);
1340
+ flags.aliases[key].concat(key).forEach(function(x) {
1341
+ if (/-/.test(x) && configuration["camel-case-expansion"]) {
1342
+ const c = camelCase(x);
1343
+ if (c !== key && flags.aliases[key].indexOf(c) === -1) {
1344
+ flags.aliases[key].push(c);
1345
+ newAliases[c] = true;
1346
+ }
1347
+ }
1348
+ });
1349
+ flags.aliases[key].concat(key).forEach(function(x) {
1350
+ if (x.length > 1 && /[A-Z]/.test(x) && configuration["camel-case-expansion"]) {
1351
+ const c = decamelize(x, "-");
1352
+ if (c !== key && flags.aliases[key].indexOf(c) === -1) {
1353
+ flags.aliases[key].push(c);
1354
+ newAliases[c] = true;
1355
+ }
1356
+ }
1357
+ });
1358
+ flags.aliases[key].forEach(function(x) {
1359
+ flags.aliases[x] = [key].concat(flags.aliases[key].filter(function(y) {
1360
+ return x !== y;
1361
+ }));
1362
+ });
1363
+ });
1364
+ });
1365
+ }
1366
+ function checkAllAliases(key, flag) {
1367
+ const toCheck = [].concat(flags.aliases[key] || [], key);
1368
+ const keys = Object.keys(flag);
1369
+ const setAlias = toCheck.find((key$1) => keys.includes(key$1));
1370
+ return setAlias ? flag[setAlias] : false;
1371
+ }
1372
+ function hasAnyFlag(key) {
1373
+ const flagsKeys = Object.keys(flags);
1374
+ const toCheck = [].concat(flagsKeys.map((k) => flags[k]));
1375
+ return toCheck.some(function(flag) {
1376
+ return Array.isArray(flag) ? flag.includes(key) : flag[key];
1377
+ });
1378
+ }
1379
+ function hasFlagsMatching(arg, ...patterns) {
1380
+ const toCheck = [].concat(...patterns);
1381
+ return toCheck.some(function(pattern) {
1382
+ const match = arg.match(pattern);
1383
+ return match && hasAnyFlag(match[1]);
1384
+ });
1385
+ }
1386
+ function hasAllShortFlags(arg) {
1387
+ if (arg.match(negative) || !arg.match(/^-[^-]+/)) return false;
1388
+ let hasAllFlags = true;
1389
+ let next;
1390
+ const letters = arg.slice(1).split("");
1391
+ for (let j = 0; j < letters.length; j++) {
1392
+ next = arg.slice(j + 2);
1393
+ if (!hasAnyFlag(letters[j])) {
1394
+ hasAllFlags = false;
1395
+ break;
1396
+ }
1397
+ if (letters[j + 1] && letters[j + 1] === "=" || next === "-" || /[A-Za-z]/.test(letters[j]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next) || letters[j + 1] && letters[j + 1].match(/\W/)) break;
1398
+ }
1399
+ return hasAllFlags;
1400
+ }
1401
+ function isUnknownOptionAsArg(arg) {
1402
+ return configuration["unknown-options-as-args"] && isUnknownOption(arg);
1403
+ }
1404
+ function isUnknownOption(arg) {
1405
+ arg = arg.replace(/^-{3,}/, "--");
1406
+ if (arg.match(negative)) return false;
1407
+ if (hasAllShortFlags(arg)) return false;
1408
+ const flagWithEquals = /^-+([^=]+?)=[\s\S]*$/;
1409
+ const normalFlag = /^-+([^=]+?)$/;
1410
+ const flagEndingInHyphen = /^-+([^=]+?)-$/;
1411
+ const flagEndingInDigits = /^-+([^=]+?\d+)$/;
1412
+ const flagEndingInNonWordCharacters = /^-+([^=]+?)\W+.*$/;
1413
+ return !hasFlagsMatching(arg, flagWithEquals, negatedBoolean, normalFlag, flagEndingInHyphen, flagEndingInDigits, flagEndingInNonWordCharacters);
1414
+ }
1415
+ function defaultValue(key) {
1416
+ if (!checkAllAliases(key, flags.bools) && !checkAllAliases(key, flags.counts) && `${key}` in defaults) return defaults[key];
1417
+ else return defaultForType(guessType$1(key));
1418
+ }
1419
+ function defaultForType(type$1) {
1420
+ const def = {
1421
+ [DefaultValuesForTypeKey.BOOLEAN]: true,
1422
+ [DefaultValuesForTypeKey.STRING]: "",
1423
+ [DefaultValuesForTypeKey.NUMBER]: void 0,
1424
+ [DefaultValuesForTypeKey.ARRAY]: []
1425
+ };
1426
+ return def[type$1];
1427
+ }
1428
+ function guessType$1(key) {
1429
+ let type$1 = DefaultValuesForTypeKey.BOOLEAN;
1430
+ if (checkAllAliases(key, flags.strings)) type$1 = DefaultValuesForTypeKey.STRING;
1431
+ else if (checkAllAliases(key, flags.numbers)) type$1 = DefaultValuesForTypeKey.NUMBER;
1432
+ else if (checkAllAliases(key, flags.bools)) type$1 = DefaultValuesForTypeKey.BOOLEAN;
1433
+ else if (checkAllAliases(key, flags.arrays)) type$1 = DefaultValuesForTypeKey.ARRAY;
1434
+ return type$1;
1435
+ }
1436
+ function isUndefined(num) {
1437
+ return num === void 0;
1438
+ }
1439
+ function checkConfiguration() {
1440
+ Object.keys(flags.counts).find((key) => {
1441
+ if (checkAllAliases(key, flags.arrays)) {
1442
+ error = Error(__("Invalid configuration: %s, opts.count excludes opts.array.", key));
1443
+ return true;
1444
+ } else if (checkAllAliases(key, flags.nargs)) {
1445
+ error = Error(__("Invalid configuration: %s, opts.count excludes opts.narg.", key));
1446
+ return true;
1447
+ }
1448
+ return false;
1449
+ });
1450
+ }
1451
+ return {
1452
+ aliases: Object.assign({}, flags.aliases),
1453
+ argv: Object.assign(argvReturn, argv),
1454
+ configuration,
1455
+ defaulted: Object.assign({}, defaulted),
1456
+ error,
1457
+ newAliases: Object.assign({}, newAliases)
1458
+ };
1459
+ }
1460
+ };
1461
+ function combineAliases(aliases) {
1462
+ const aliasArrays = [];
1463
+ const combined = Object.create(null);
1464
+ let change = true;
1465
+ Object.keys(aliases).forEach(function(key) {
1466
+ aliasArrays.push([].concat(aliases[key], key));
1467
+ });
1468
+ while (change) {
1469
+ change = false;
1470
+ for (let i = 0; i < aliasArrays.length; i++) for (let ii = i + 1; ii < aliasArrays.length; ii++) {
1471
+ const intersect = aliasArrays[i].filter(function(v) {
1472
+ return aliasArrays[ii].indexOf(v) !== -1;
1473
+ });
1474
+ if (intersect.length) {
1475
+ aliasArrays[i] = aliasArrays[i].concat(aliasArrays[ii]);
1476
+ aliasArrays.splice(ii, 1);
1477
+ change = true;
1478
+ break;
1479
+ }
1480
+ }
1481
+ }
1482
+ aliasArrays.forEach(function(aliasArray) {
1483
+ aliasArray = aliasArray.filter(function(v, i, self) {
1484
+ return self.indexOf(v) === i;
1485
+ });
1486
+ const lastAlias = aliasArray.pop();
1487
+ if (lastAlias !== void 0 && typeof lastAlias === "string") combined[lastAlias] = aliasArray;
1488
+ });
1489
+ return combined;
1490
+ }
1491
+ function increment(orig) {
1492
+ return orig !== void 0 ? orig + 1 : 1;
1493
+ }
1494
+ function sanitizeKey(key) {
1495
+ if (key === "__proto__") return "___proto___";
1496
+ return key;
1497
+ }
1498
+ function stripQuotes(val) {
1499
+ return typeof val === "string" && (val[0] === "'" || val[0] === "\"") && val[val.length - 1] === val[0] ? val.substring(1, val.length - 1) : val;
1500
+ }
1501
+
1502
+ //#endregion
1503
+ //#region ../../node_modules/.pnpm/yargs-parser@22.0.0/node_modules/yargs-parser/build/lib/index.js
1504
+ /**
1505
+ * @fileoverview Main entrypoint for libraries using yargs-parser in Node.js
1506
+ *
1507
+ * @license
1508
+ * Copyright (c) 2016, Contributors
1509
+ * SPDX-License-Identifier: ISC
1510
+ */
1511
+ var _a, _b, _c;
1512
+ const minNodeVersion = process && process.env && process.env.YARGS_MIN_NODE_VERSION ? Number(process.env.YARGS_MIN_NODE_VERSION) : 20;
1513
+ const nodeVersion = (_b = (_a = process === null || process === void 0 ? void 0 : process.versions) === null || _a === void 0 ? void 0 : _a.node) !== null && _b !== void 0 ? _b : (_c = process === null || process === void 0 ? void 0 : process.version) === null || _c === void 0 ? void 0 : _c.slice(1);
1514
+ if (nodeVersion) {
1515
+ const major = Number(nodeVersion.match(/^([^.]+)/)[1]);
1516
+ if (major < minNodeVersion) throw Error(`yargs parser supports a minimum Node.js version of ${minNodeVersion}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);
1517
+ }
1518
+ const env = process ? process.env : {};
1519
+ const require$1 = createRequire ? createRequire(import.meta.url) : void 0;
1520
+ const parser = new YargsParser({
1521
+ cwd: process.cwd,
1522
+ env: () => {
1523
+ return env;
1524
+ },
1525
+ format,
1526
+ normalize,
1527
+ resolve,
1528
+ require: (path$1) => {
1529
+ if (typeof require$1 !== "undefined") return require$1(path$1);
1530
+ else if (path$1.match(/\.json$/)) return JSON.parse(readFileSync$1(path$1, "utf8"));
1531
+ else throw Error("only .json config files are supported in ESM");
1532
+ }
1533
+ });
1534
+ const yargsParser = function Parser(args, opts) {
1535
+ const result = parser.parse(args.slice(), opts);
1536
+ return result.argv;
1537
+ };
1538
+ yargsParser.detailed = function(args, opts) {
1539
+ return parser.parse(args.slice(), opts);
1540
+ };
1541
+ yargsParser.camelCase = camelCase;
1542
+ yargsParser.decamelize = decamelize;
1543
+ yargsParser.looksLikeNumber = looksLikeNumber;
1544
+ var lib_default = yargsParser;
1545
+
1546
+ //#endregion
1547
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/build/lib/utils/process-argv.js
1548
+ function getProcessArgvBinIndex() {
1549
+ if (isBundledElectronApp()) return 0;
1550
+ return 1;
1551
+ }
1552
+ function isBundledElectronApp() {
1553
+ return isElectronApp() && !process.defaultApp;
1554
+ }
1555
+ function isElectronApp() {
1556
+ return !!process.versions.electron;
1557
+ }
1558
+ function hideBin(argv) {
1559
+ return argv.slice(getProcessArgvBinIndex() + 1);
1560
+ }
1561
+ function getProcessArgvBin() {
1562
+ return process.argv[getProcessArgvBinIndex()];
1563
+ }
1564
+
1565
+ //#endregion
1566
+ //#region ../../node_modules/.pnpm/y18n@5.0.8/node_modules/y18n/build/lib/platform-shims/node.js
1567
+ var node_default = {
1568
+ fs: {
1569
+ readFileSync: readFileSync$1,
1570
+ writeFile
1571
+ },
1572
+ format,
1573
+ resolve,
1574
+ exists: (file) => {
1575
+ try {
1576
+ return statSync(file).isFile();
1577
+ } catch (err) {
1578
+ return false;
1579
+ }
1580
+ }
1581
+ };
1582
+
1583
+ //#endregion
1584
+ //#region ../../node_modules/.pnpm/y18n@5.0.8/node_modules/y18n/build/lib/index.js
1585
+ let shim$1;
1586
+ var Y18N = class {
1587
+ constructor(opts) {
1588
+ opts = opts || {};
1589
+ this.directory = opts.directory || "./locales";
1590
+ this.updateFiles = typeof opts.updateFiles === "boolean" ? opts.updateFiles : true;
1591
+ this.locale = opts.locale || "en";
1592
+ this.fallbackToLanguage = typeof opts.fallbackToLanguage === "boolean" ? opts.fallbackToLanguage : true;
1593
+ this.cache = Object.create(null);
1594
+ this.writeQueue = [];
1595
+ }
1596
+ __(...args) {
1597
+ if (typeof arguments[0] !== "string") return this._taggedLiteral(arguments[0], ...arguments);
1598
+ const str = args.shift();
1599
+ let cb = function() {};
1600
+ if (typeof args[args.length - 1] === "function") cb = args.pop();
1601
+ cb = cb || function() {};
1602
+ if (!this.cache[this.locale]) this._readLocaleFile();
1603
+ if (!this.cache[this.locale][str] && this.updateFiles) {
1604
+ this.cache[this.locale][str] = str;
1605
+ this._enqueueWrite({
1606
+ directory: this.directory,
1607
+ locale: this.locale,
1608
+ cb
1609
+ });
1610
+ } else cb();
1611
+ return shim$1.format.apply(shim$1.format, [this.cache[this.locale][str] || str].concat(args));
1612
+ }
1613
+ __n() {
1614
+ const args = Array.prototype.slice.call(arguments);
1615
+ const singular = args.shift();
1616
+ const plural = args.shift();
1617
+ const quantity = args.shift();
1618
+ let cb = function() {};
1619
+ if (typeof args[args.length - 1] === "function") cb = args.pop();
1620
+ if (!this.cache[this.locale]) this._readLocaleFile();
1621
+ let str = quantity === 1 ? singular : plural;
1622
+ if (this.cache[this.locale][singular]) {
1623
+ const entry = this.cache[this.locale][singular];
1624
+ str = entry[quantity === 1 ? "one" : "other"];
1625
+ }
1626
+ if (!this.cache[this.locale][singular] && this.updateFiles) {
1627
+ this.cache[this.locale][singular] = {
1628
+ one: singular,
1629
+ other: plural
1630
+ };
1631
+ this._enqueueWrite({
1632
+ directory: this.directory,
1633
+ locale: this.locale,
1634
+ cb
1635
+ });
1636
+ } else cb();
1637
+ const values = [str];
1638
+ if (~str.indexOf("%d")) values.push(quantity);
1639
+ return shim$1.format.apply(shim$1.format, values.concat(args));
1640
+ }
1641
+ setLocale(locale) {
1642
+ this.locale = locale;
1643
+ }
1644
+ getLocale() {
1645
+ return this.locale;
1646
+ }
1647
+ updateLocale(obj) {
1648
+ if (!this.cache[this.locale]) this._readLocaleFile();
1649
+ for (const key in obj) if (Object.prototype.hasOwnProperty.call(obj, key)) this.cache[this.locale][key] = obj[key];
1650
+ }
1651
+ _taggedLiteral(parts, ...args) {
1652
+ let str = "";
1653
+ parts.forEach(function(part, i) {
1654
+ const arg = args[i + 1];
1655
+ str += part;
1656
+ if (typeof arg !== "undefined") str += "%s";
1657
+ });
1658
+ return this.__.apply(this, [str].concat([].slice.call(args, 1)));
1659
+ }
1660
+ _enqueueWrite(work) {
1661
+ this.writeQueue.push(work);
1662
+ if (this.writeQueue.length === 1) this._processWriteQueue();
1663
+ }
1664
+ _processWriteQueue() {
1665
+ const _this = this;
1666
+ const work = this.writeQueue[0];
1667
+ const directory = work.directory;
1668
+ const locale = work.locale;
1669
+ const cb = work.cb;
1670
+ const languageFile = this._resolveLocaleFile(directory, locale);
1671
+ const serializedLocale = JSON.stringify(this.cache[locale], null, 2);
1672
+ shim$1.fs.writeFile(languageFile, serializedLocale, "utf-8", function(err) {
1673
+ _this.writeQueue.shift();
1674
+ if (_this.writeQueue.length > 0) _this._processWriteQueue();
1675
+ cb(err);
1676
+ });
1677
+ }
1678
+ _readLocaleFile() {
1679
+ let localeLookup = {};
1680
+ const languageFile = this._resolveLocaleFile(this.directory, this.locale);
1681
+ try {
1682
+ if (shim$1.fs.readFileSync) localeLookup = JSON.parse(shim$1.fs.readFileSync(languageFile, "utf-8"));
1683
+ } catch (err) {
1684
+ if (err instanceof SyntaxError) err.message = "syntax error in " + languageFile;
1685
+ if (err.code === "ENOENT") localeLookup = {};
1686
+ else throw err;
1687
+ }
1688
+ this.cache[this.locale] = localeLookup;
1689
+ }
1690
+ _resolveLocaleFile(directory, locale) {
1691
+ let file = shim$1.resolve(directory, "./", locale + ".json");
1692
+ if (this.fallbackToLanguage && !this._fileExistsSync(file) && ~locale.lastIndexOf("_")) {
1693
+ const languageFile = shim$1.resolve(directory, "./", locale.split("_")[0] + ".json");
1694
+ if (this._fileExistsSync(languageFile)) file = languageFile;
1695
+ }
1696
+ return file;
1697
+ }
1698
+ _fileExistsSync(file) {
1699
+ return shim$1.exists(file);
1700
+ }
1701
+ };
1702
+ function y18n(opts, _shim) {
1703
+ shim$1 = _shim;
1704
+ const y18n$2 = new Y18N(opts);
1705
+ return {
1706
+ __: y18n$2.__.bind(y18n$2),
1707
+ __n: y18n$2.__n.bind(y18n$2),
1708
+ setLocale: y18n$2.setLocale.bind(y18n$2),
1709
+ getLocale: y18n$2.getLocale.bind(y18n$2),
1710
+ updateLocale: y18n$2.updateLocale.bind(y18n$2),
1711
+ locale: y18n$2.locale
1712
+ };
1713
+ }
1714
+
1715
+ //#endregion
1716
+ //#region ../../node_modules/.pnpm/y18n@5.0.8/node_modules/y18n/index.mjs
1717
+ const y18n$1 = (opts) => {
1718
+ return y18n(opts, node_default);
1719
+ };
1720
+ var y18n_default = y18n$1;
1721
+
1722
+ //#endregion
1723
+ //#region ../../node_modules/.pnpm/get-caller-file@2.0.5/node_modules/get-caller-file/index.js
1724
+ var require_get_caller_file = __commonJS({ "../../node_modules/.pnpm/get-caller-file@2.0.5/node_modules/get-caller-file/index.js"(exports, module) {
1725
+ module.exports = function getCallerFile$1(position) {
1726
+ if (position === void 0) position = 2;
1727
+ if (position >= Error.stackTraceLimit) throw new TypeError("getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `" + position + "` and Error.stackTraceLimit was: `" + Error.stackTraceLimit + "`");
1728
+ var oldPrepareStackTrace = Error.prepareStackTrace;
1729
+ Error.prepareStackTrace = function(_, stack$1) {
1730
+ return stack$1;
1731
+ };
1732
+ var stack = (/* @__PURE__ */ new Error()).stack;
1733
+ Error.prepareStackTrace = oldPrepareStackTrace;
1734
+ if (stack !== null && typeof stack === "object") return stack[position] ? stack[position].getFileName() : void 0;
1735
+ };
1736
+ } });
1737
+
1738
+ //#endregion
1739
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/lib/platform-shims/esm.mjs
1740
+ var import_get_caller_file = __toESM(require_get_caller_file(), 1);
1741
+ const __dirname = fileURLToPath$1(import.meta.url);
1742
+ const mainFilename = __dirname.substring(0, __dirname.lastIndexOf("node_modules"));
1743
+ const require = createRequire(import.meta.url);
1744
+ var esm_default = {
1745
+ assert: {
1746
+ notStrictEqual,
1747
+ strictEqual
1748
+ },
1749
+ cliui: ui,
1750
+ findUp: sync_default,
1751
+ getEnv: (key) => {
1752
+ return process.env[key];
1753
+ },
1754
+ inspect,
1755
+ getProcessArgvBin,
1756
+ mainFilename: mainFilename || process.cwd(),
1757
+ Parser: lib_default,
1758
+ path: {
1759
+ basename,
1760
+ dirname: dirname$1,
1761
+ extname,
1762
+ relative,
1763
+ resolve,
1764
+ join
1765
+ },
1766
+ process: {
1767
+ argv: () => process.argv,
1768
+ cwd: process.cwd,
1769
+ emitWarning: (warning, type$1) => process.emitWarning(warning, type$1),
1770
+ execPath: () => process.execPath,
1771
+ exit: (code) => {
1772
+ process.exit(code);
1773
+ },
1774
+ nextTick: process.nextTick,
1775
+ stdColumns: typeof process.stdout.columns !== "undefined" ? process.stdout.columns : null
1776
+ },
1777
+ readFileSync,
1778
+ readdirSync,
1779
+ require,
1780
+ getCallerFile: () => {
1781
+ const callerFile = (0, import_get_caller_file.default)(3);
1782
+ return callerFile.match(/^file:\/\//) ? fileURLToPath$1(callerFile) : callerFile;
1783
+ },
1784
+ stringWidth,
1785
+ y18n: y18n_default({
1786
+ directory: resolve(__dirname, "../../../locales"),
1787
+ updateFiles: false
1788
+ })
1789
+ };
1790
+
1791
+ //#endregion
1792
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/build/lib/typings/common-types.js
1793
+ function assertNotStrictEqual(actual, expected, shim$2, message) {
1794
+ shim$2.assert.notStrictEqual(actual, expected, message);
1795
+ }
1796
+ function assertSingleKey(actual, shim$2) {
1797
+ shim$2.assert.strictEqual(typeof actual, "string");
1798
+ }
1799
+ function objectKeys(object) {
1800
+ return Object.keys(object);
1801
+ }
1802
+
1803
+ //#endregion
1804
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/build/lib/utils/is-promise.js
1805
+ function isPromise(maybePromise) {
1806
+ return !!maybePromise && !!maybePromise.then && typeof maybePromise.then === "function";
1807
+ }
1808
+
1809
+ //#endregion
1810
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/build/lib/yerror.js
1811
+ var YError = class YError extends Error {
1812
+ constructor(msg) {
1813
+ super(msg || "yargs error");
1814
+ this.name = "YError";
1815
+ if (Error.captureStackTrace) Error.captureStackTrace(this, YError);
1816
+ }
1817
+ };
1818
+
1819
+ //#endregion
1820
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/build/lib/parse-command.js
1821
+ function parseCommand(cmd) {
1822
+ const extraSpacesStrippedCommand = cmd.replace(/\s{2,}/g, " ");
1823
+ const splitCommand = extraSpacesStrippedCommand.split(/\s+(?![^[]*]|[^<]*>)/);
1824
+ const bregex = /\.*[\][<>]/g;
1825
+ const firstCommand = splitCommand.shift();
1826
+ if (!firstCommand) throw new Error(`No command found in: ${cmd}`);
1827
+ const parsedCommand = {
1828
+ cmd: firstCommand.replace(bregex, ""),
1829
+ demanded: [],
1830
+ optional: []
1831
+ };
1832
+ splitCommand.forEach((cmd$1, i) => {
1833
+ let variadic = false;
1834
+ cmd$1 = cmd$1.replace(/\s/g, "");
1835
+ if (/\.+[\]>]/.test(cmd$1) && i === splitCommand.length - 1) variadic = true;
1836
+ if (/^\[/.test(cmd$1)) parsedCommand.optional.push({
1837
+ cmd: cmd$1.replace(bregex, "").split("|"),
1838
+ variadic
1839
+ });
1840
+ else parsedCommand.demanded.push({
1841
+ cmd: cmd$1.replace(bregex, "").split("|"),
1842
+ variadic
1843
+ });
1844
+ });
1845
+ return parsedCommand;
1846
+ }
1847
+
1848
+ //#endregion
1849
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/build/lib/argsert.js
1850
+ const positionName = [
1851
+ "first",
1852
+ "second",
1853
+ "third",
1854
+ "fourth",
1855
+ "fifth",
1856
+ "sixth"
1857
+ ];
1858
+ function argsert(arg1, arg2, arg3) {
1859
+ function parseArgs() {
1860
+ return typeof arg1 === "object" ? [
1861
+ {
1862
+ demanded: [],
1863
+ optional: []
1864
+ },
1865
+ arg1,
1866
+ arg2
1867
+ ] : [
1868
+ parseCommand(`cmd ${arg1}`),
1869
+ arg2,
1870
+ arg3
1871
+ ];
1872
+ }
1873
+ try {
1874
+ let position = 0;
1875
+ const [parsed, callerArguments, _length] = parseArgs();
1876
+ const args = [].slice.call(callerArguments);
1877
+ while (args.length && args[args.length - 1] === void 0) args.pop();
1878
+ const length = _length || args.length;
1879
+ if (length < parsed.demanded.length) throw new YError(`Not enough arguments provided. Expected ${parsed.demanded.length} but received ${args.length}.`);
1880
+ const totalCommands = parsed.demanded.length + parsed.optional.length;
1881
+ if (length > totalCommands) throw new YError(`Too many arguments provided. Expected max ${totalCommands} but received ${length}.`);
1882
+ parsed.demanded.forEach((demanded) => {
1883
+ const arg = args.shift();
1884
+ const observedType = guessType(arg);
1885
+ const matchingTypes = demanded.cmd.filter((type$1) => type$1 === observedType || type$1 === "*");
1886
+ if (matchingTypes.length === 0) argumentTypeError(observedType, demanded.cmd, position);
1887
+ position += 1;
1888
+ });
1889
+ parsed.optional.forEach((optional) => {
1890
+ if (args.length === 0) return;
1891
+ const arg = args.shift();
1892
+ const observedType = guessType(arg);
1893
+ const matchingTypes = optional.cmd.filter((type$1) => type$1 === observedType || type$1 === "*");
1894
+ if (matchingTypes.length === 0) argumentTypeError(observedType, optional.cmd, position);
1895
+ position += 1;
1896
+ });
1897
+ } catch (err) {
1898
+ console.warn(err.stack);
1899
+ }
1900
+ }
1901
+ function guessType(arg) {
1902
+ if (Array.isArray(arg)) return "array";
1903
+ else if (arg === null) return "null";
1904
+ return typeof arg;
1905
+ }
1906
+ function argumentTypeError(observedType, allowedTypes, position) {
1907
+ throw new YError(`Invalid ${positionName[position] || "manyith"} argument. Expected ${allowedTypes.join(" or ")} but received ${observedType}.`);
1908
+ }
1909
+
1910
+ //#endregion
1911
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/build/lib/middleware.js
1912
+ var GlobalMiddleware = class {
1913
+ constructor(yargs) {
1914
+ this.globalMiddleware = [];
1915
+ this.frozens = [];
1916
+ this.yargs = yargs;
1917
+ }
1918
+ addMiddleware(callback, applyBeforeValidation, global = true, mutates = false) {
1919
+ argsert("<array|function> [boolean] [boolean] [boolean]", [
1920
+ callback,
1921
+ applyBeforeValidation,
1922
+ global
1923
+ ], arguments.length);
1924
+ if (Array.isArray(callback)) {
1925
+ for (let i = 0; i < callback.length; i++) {
1926
+ if (typeof callback[i] !== "function") throw Error("middleware must be a function");
1927
+ const m = callback[i];
1928
+ m.applyBeforeValidation = applyBeforeValidation;
1929
+ m.global = global;
1930
+ }
1931
+ Array.prototype.push.apply(this.globalMiddleware, callback);
1932
+ } else if (typeof callback === "function") {
1933
+ const m = callback;
1934
+ m.applyBeforeValidation = applyBeforeValidation;
1935
+ m.global = global;
1936
+ m.mutates = mutates;
1937
+ this.globalMiddleware.push(callback);
1938
+ }
1939
+ return this.yargs;
1940
+ }
1941
+ addCoerceMiddleware(callback, option) {
1942
+ const aliases = this.yargs.getAliases();
1943
+ this.globalMiddleware = this.globalMiddleware.filter((m) => {
1944
+ const toCheck = [...aliases[option] || [], option];
1945
+ if (!m.option) return true;
1946
+ else return !toCheck.includes(m.option);
1947
+ });
1948
+ callback.option = option;
1949
+ return this.addMiddleware(callback, true, true, true);
1950
+ }
1951
+ getMiddleware() {
1952
+ return this.globalMiddleware;
1953
+ }
1954
+ freeze() {
1955
+ this.frozens.push([...this.globalMiddleware]);
1956
+ }
1957
+ unfreeze() {
1958
+ const frozen = this.frozens.pop();
1959
+ if (frozen !== void 0) this.globalMiddleware = frozen;
1960
+ }
1961
+ reset() {
1962
+ this.globalMiddleware = this.globalMiddleware.filter((m) => m.global);
1963
+ }
1964
+ };
1965
+ function commandMiddlewareFactory(commandMiddleware) {
1966
+ if (!commandMiddleware) return [];
1967
+ return commandMiddleware.map((middleware) => {
1968
+ middleware.applyBeforeValidation = false;
1969
+ return middleware;
1970
+ });
1971
+ }
1972
+ function applyMiddleware(argv, yargs, middlewares, beforeValidation) {
1973
+ return middlewares.reduce((acc, middleware) => {
1974
+ if (middleware.applyBeforeValidation !== beforeValidation) return acc;
1975
+ if (middleware.mutates) {
1976
+ if (middleware.applied) return acc;
1977
+ middleware.applied = true;
1978
+ }
1979
+ if (isPromise(acc)) return acc.then((initialObj) => Promise.all([initialObj, middleware(initialObj, yargs)])).then(([initialObj, middlewareObj]) => Object.assign(initialObj, middlewareObj));
1980
+ else {
1981
+ const result = middleware(acc, yargs);
1982
+ return isPromise(result) ? result.then((middlewareObj) => Object.assign(acc, middlewareObj)) : Object.assign(acc, result);
1983
+ }
1984
+ }, argv);
1985
+ }
1986
+
1987
+ //#endregion
1988
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/build/lib/utils/maybe-async-result.js
1989
+ function maybeAsyncResult(getResult, resultHandler, errorHandler = (err) => {
1990
+ throw err;
1991
+ }) {
1992
+ try {
1993
+ const result = isFunction(getResult) ? getResult() : getResult;
1994
+ return isPromise(result) ? result.then((result$1) => resultHandler(result$1)) : resultHandler(result);
1995
+ } catch (err) {
1996
+ return errorHandler(err);
1997
+ }
1998
+ }
1999
+ function isFunction(arg) {
2000
+ return typeof arg === "function";
2001
+ }
2002
+
2003
+ //#endregion
2004
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/build/lib/command.js
2005
+ const DEFAULT_MARKER = /(^\*)|(^\$0)/;
2006
+ var CommandInstance = class {
2007
+ constructor(usage$1, validation$1, globalMiddleware, shim$2) {
2008
+ this.requireCache = /* @__PURE__ */ new Set();
2009
+ this.handlers = {};
2010
+ this.aliasMap = {};
2011
+ this.frozens = [];
2012
+ this.shim = shim$2;
2013
+ this.usage = usage$1;
2014
+ this.globalMiddleware = globalMiddleware;
2015
+ this.validation = validation$1;
2016
+ }
2017
+ addDirectory(dir, req, callerFile, opts) {
2018
+ opts = opts || {};
2019
+ this.requireCache.add(callerFile);
2020
+ const fullDirPath = this.shim.path.resolve(this.shim.path.dirname(callerFile), dir);
2021
+ const files$1 = this.shim.readdirSync(fullDirPath, { recursive: opts.recurse ? true : false });
2022
+ if (!Array.isArray(opts.extensions)) opts.extensions = ["js"];
2023
+ const visit = typeof opts.visit === "function" ? opts.visit : (o) => o;
2024
+ for (const fileb of files$1) {
2025
+ const file = fileb.toString();
2026
+ if (opts.exclude) {
2027
+ let exclude = false;
2028
+ if (typeof opts.exclude === "function") exclude = opts.exclude(file);
2029
+ else exclude = opts.exclude.test(file);
2030
+ if (exclude) continue;
2031
+ }
2032
+ if (opts.include) {
2033
+ let include = false;
2034
+ if (typeof opts.include === "function") include = opts.include(file);
2035
+ else include = opts.include.test(file);
2036
+ if (!include) continue;
2037
+ }
2038
+ let supportedExtension = false;
2039
+ for (const ext of opts.extensions) if (file.endsWith(ext)) supportedExtension = true;
2040
+ if (supportedExtension) {
2041
+ const joined = this.shim.path.join(fullDirPath, file);
2042
+ const module$1 = req(joined);
2043
+ const extendableModule = Object.create(null, Object.getOwnPropertyDescriptors({ ...module$1 }));
2044
+ const visited = visit(extendableModule, joined, file);
2045
+ if (visited) {
2046
+ if (this.requireCache.has(joined)) continue;
2047
+ else this.requireCache.add(joined);
2048
+ if (!extendableModule.command) extendableModule.command = this.shim.path.basename(joined, this.shim.path.extname(joined));
2049
+ this.addHandler(extendableModule);
2050
+ }
2051
+ }
2052
+ }
2053
+ }
2054
+ addHandler(cmd, description, builder, handler, commandMiddleware, deprecated) {
2055
+ let aliases = [];
2056
+ const middlewares = commandMiddlewareFactory(commandMiddleware);
2057
+ handler = handler || (() => {});
2058
+ if (Array.isArray(cmd)) if (isCommandAndAliases(cmd)) [cmd, ...aliases] = cmd;
2059
+ else for (const command$1 of cmd) this.addHandler(command$1);
2060
+ else if (isCommandHandlerDefinition(cmd)) {
2061
+ let command$1 = Array.isArray(cmd.command) || typeof cmd.command === "string" ? cmd.command : null;
2062
+ if (command$1 === null) throw new Error(`No command name given for module: ${this.shim.inspect(cmd)}`);
2063
+ if (cmd.aliases) command$1 = [].concat(command$1).concat(cmd.aliases);
2064
+ this.addHandler(command$1, this.extractDesc(cmd), cmd.builder, cmd.handler, cmd.middlewares, cmd.deprecated);
2065
+ return;
2066
+ } else if (isCommandBuilderDefinition(builder)) {
2067
+ this.addHandler([cmd].concat(aliases), description, builder.builder, builder.handler, builder.middlewares, builder.deprecated);
2068
+ return;
2069
+ }
2070
+ if (typeof cmd === "string") {
2071
+ const parsedCommand = parseCommand(cmd);
2072
+ aliases = aliases.map((alias) => parseCommand(alias).cmd);
2073
+ let isDefault = false;
2074
+ const parsedAliases = [parsedCommand.cmd].concat(aliases).filter((c) => {
2075
+ if (DEFAULT_MARKER.test(c)) {
2076
+ isDefault = true;
2077
+ return false;
2078
+ }
2079
+ return true;
2080
+ });
2081
+ if (parsedAliases.length === 0 && isDefault) parsedAliases.push("$0");
2082
+ if (isDefault) {
2083
+ parsedCommand.cmd = parsedAliases[0];
2084
+ aliases = parsedAliases.slice(1);
2085
+ cmd = cmd.replace(DEFAULT_MARKER, parsedCommand.cmd);
2086
+ }
2087
+ aliases.forEach((alias) => {
2088
+ this.aliasMap[alias] = parsedCommand.cmd;
2089
+ });
2090
+ if (description !== false) this.usage.command(cmd, description, isDefault, aliases, deprecated);
2091
+ this.handlers[parsedCommand.cmd] = {
2092
+ original: cmd,
2093
+ description,
2094
+ handler,
2095
+ builder: builder || {},
2096
+ middlewares,
2097
+ deprecated,
2098
+ demanded: parsedCommand.demanded,
2099
+ optional: parsedCommand.optional
2100
+ };
2101
+ if (isDefault) this.defaultCommand = this.handlers[parsedCommand.cmd];
2102
+ }
2103
+ }
2104
+ getCommandHandlers() {
2105
+ return this.handlers;
2106
+ }
2107
+ getCommands() {
2108
+ return Object.keys(this.handlers).concat(Object.keys(this.aliasMap));
2109
+ }
2110
+ hasDefaultCommand() {
2111
+ return !!this.defaultCommand;
2112
+ }
2113
+ runCommand(command$1, yargs, parsed, commandIndex, helpOnly, helpOrVersionSet) {
2114
+ const commandHandler = this.handlers[command$1] || this.handlers[this.aliasMap[command$1]] || this.defaultCommand;
2115
+ const currentContext = yargs.getInternalMethods().getContext();
2116
+ const parentCommands = currentContext.commands.slice();
2117
+ const isDefaultCommand = !command$1;
2118
+ if (command$1) {
2119
+ currentContext.commands.push(command$1);
2120
+ currentContext.fullCommands.push(commandHandler.original);
2121
+ }
2122
+ const builderResult = this.applyBuilderUpdateUsageAndParse(isDefaultCommand, commandHandler, yargs, parsed.aliases, parentCommands, commandIndex, helpOnly, helpOrVersionSet);
2123
+ return isPromise(builderResult) ? builderResult.then((result) => this.applyMiddlewareAndGetResult(isDefaultCommand, commandHandler, result.innerArgv, currentContext, helpOnly, result.aliases, yargs)) : this.applyMiddlewareAndGetResult(isDefaultCommand, commandHandler, builderResult.innerArgv, currentContext, helpOnly, builderResult.aliases, yargs);
2124
+ }
2125
+ applyBuilderUpdateUsageAndParse(isDefaultCommand, commandHandler, yargs, aliases, parentCommands, commandIndex, helpOnly, helpOrVersionSet) {
2126
+ const builder = commandHandler.builder;
2127
+ let innerYargs = yargs;
2128
+ if (isCommandBuilderCallback(builder)) {
2129
+ yargs.getInternalMethods().getUsageInstance().freeze();
2130
+ const builderOutput = builder(yargs.getInternalMethods().reset(aliases), helpOrVersionSet);
2131
+ if (isPromise(builderOutput)) return builderOutput.then((output) => {
2132
+ innerYargs = isYargsInstance(output) ? output : yargs;
2133
+ return this.parseAndUpdateUsage(isDefaultCommand, commandHandler, innerYargs, parentCommands, commandIndex, helpOnly);
2134
+ });
2135
+ } else if (isCommandBuilderOptionDefinitions(builder)) {
2136
+ yargs.getInternalMethods().getUsageInstance().freeze();
2137
+ innerYargs = yargs.getInternalMethods().reset(aliases);
2138
+ Object.keys(commandHandler.builder).forEach((key) => {
2139
+ innerYargs.option(key, builder[key]);
2140
+ });
2141
+ }
2142
+ return this.parseAndUpdateUsage(isDefaultCommand, commandHandler, innerYargs, parentCommands, commandIndex, helpOnly);
2143
+ }
2144
+ parseAndUpdateUsage(isDefaultCommand, commandHandler, innerYargs, parentCommands, commandIndex, helpOnly) {
2145
+ if (isDefaultCommand) innerYargs.getInternalMethods().getUsageInstance().unfreeze(true);
2146
+ if (this.shouldUpdateUsage(innerYargs)) innerYargs.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(parentCommands, commandHandler), commandHandler.description);
2147
+ const innerArgv = innerYargs.getInternalMethods().runYargsParserAndExecuteCommands(null, void 0, true, commandIndex, helpOnly);
2148
+ return isPromise(innerArgv) ? innerArgv.then((argv) => ({
2149
+ aliases: innerYargs.parsed.aliases,
2150
+ innerArgv: argv
2151
+ })) : {
2152
+ aliases: innerYargs.parsed.aliases,
2153
+ innerArgv
2154
+ };
2155
+ }
2156
+ shouldUpdateUsage(yargs) {
2157
+ return !yargs.getInternalMethods().getUsageInstance().getUsageDisabled() && yargs.getInternalMethods().getUsageInstance().getUsage().length === 0;
2158
+ }
2159
+ usageFromParentCommandsCommandHandler(parentCommands, commandHandler) {
2160
+ const c = DEFAULT_MARKER.test(commandHandler.original) ? commandHandler.original.replace(DEFAULT_MARKER, "").trim() : commandHandler.original;
2161
+ const pc = parentCommands.filter((c$1) => {
2162
+ return !DEFAULT_MARKER.test(c$1);
2163
+ });
2164
+ pc.push(c);
2165
+ return `$0 ${pc.join(" ")}`;
2166
+ }
2167
+ handleValidationAndGetResult(isDefaultCommand, commandHandler, innerArgv, currentContext, aliases, yargs, middlewares, positionalMap) {
2168
+ if (!yargs.getInternalMethods().getHasOutput()) {
2169
+ const validation$1 = yargs.getInternalMethods().runValidation(aliases, positionalMap, yargs.parsed.error, isDefaultCommand);
2170
+ innerArgv = maybeAsyncResult(innerArgv, (result) => {
2171
+ validation$1(result);
2172
+ return result;
2173
+ });
2174
+ }
2175
+ if (commandHandler.handler && !yargs.getInternalMethods().getHasOutput()) {
2176
+ yargs.getInternalMethods().setHasOutput();
2177
+ const populateDoubleDash = !!yargs.getOptions().configuration["populate--"];
2178
+ yargs.getInternalMethods().postProcess(innerArgv, populateDoubleDash, false, false);
2179
+ innerArgv = applyMiddleware(innerArgv, yargs, middlewares, false);
2180
+ innerArgv = maybeAsyncResult(innerArgv, (result) => {
2181
+ const handlerResult = commandHandler.handler(result);
2182
+ return isPromise(handlerResult) ? handlerResult.then(() => result) : result;
2183
+ });
2184
+ if (!isDefaultCommand) yargs.getInternalMethods().getUsageInstance().cacheHelpMessage();
2185
+ if (isPromise(innerArgv) && !yargs.getInternalMethods().hasParseCallback()) innerArgv.catch((error) => {
2186
+ try {
2187
+ yargs.getInternalMethods().getUsageInstance().fail(null, error);
2188
+ } catch (_err) {}
2189
+ });
2190
+ }
2191
+ if (!isDefaultCommand) {
2192
+ currentContext.commands.pop();
2193
+ currentContext.fullCommands.pop();
2194
+ }
2195
+ return innerArgv;
2196
+ }
2197
+ applyMiddlewareAndGetResult(isDefaultCommand, commandHandler, innerArgv, currentContext, helpOnly, aliases, yargs) {
2198
+ let positionalMap = {};
2199
+ if (helpOnly) return innerArgv;
2200
+ if (!yargs.getInternalMethods().getHasOutput()) positionalMap = this.populatePositionals(commandHandler, innerArgv, currentContext, yargs);
2201
+ const middlewares = this.globalMiddleware.getMiddleware().slice(0).concat(commandHandler.middlewares);
2202
+ const maybePromiseArgv = applyMiddleware(innerArgv, yargs, middlewares, true);
2203
+ return isPromise(maybePromiseArgv) ? maybePromiseArgv.then((resolvedInnerArgv) => this.handleValidationAndGetResult(isDefaultCommand, commandHandler, resolvedInnerArgv, currentContext, aliases, yargs, middlewares, positionalMap)) : this.handleValidationAndGetResult(isDefaultCommand, commandHandler, maybePromiseArgv, currentContext, aliases, yargs, middlewares, positionalMap);
2204
+ }
2205
+ populatePositionals(commandHandler, argv, context, yargs) {
2206
+ argv._ = argv._.slice(context.commands.length);
2207
+ const demanded = commandHandler.demanded.slice(0);
2208
+ const optional = commandHandler.optional.slice(0);
2209
+ const positionalMap = {};
2210
+ this.validation.positionalCount(demanded.length, argv._.length);
2211
+ while (demanded.length) {
2212
+ const demand = demanded.shift();
2213
+ this.populatePositional(demand, argv, positionalMap);
2214
+ }
2215
+ while (optional.length) {
2216
+ const maybe = optional.shift();
2217
+ this.populatePositional(maybe, argv, positionalMap);
2218
+ }
2219
+ argv._ = context.commands.concat(argv._.map((a) => "" + a));
2220
+ this.postProcessPositionals(argv, positionalMap, this.cmdToParseOptions(commandHandler.original), yargs);
2221
+ return positionalMap;
2222
+ }
2223
+ populatePositional(positional, argv, positionalMap) {
2224
+ const cmd = positional.cmd[0];
2225
+ if (positional.variadic) positionalMap[cmd] = argv._.splice(0).map(String);
2226
+ else if (argv._.length) positionalMap[cmd] = [String(argv._.shift())];
2227
+ }
2228
+ cmdToParseOptions(cmdString) {
2229
+ const parseOptions = {
2230
+ array: [],
2231
+ default: {},
2232
+ alias: {},
2233
+ demand: {}
2234
+ };
2235
+ const parsed = parseCommand(cmdString);
2236
+ parsed.demanded.forEach((d) => {
2237
+ const [cmd, ...aliases] = d.cmd;
2238
+ if (d.variadic) {
2239
+ parseOptions.array.push(cmd);
2240
+ parseOptions.default[cmd] = [];
2241
+ }
2242
+ parseOptions.alias[cmd] = aliases;
2243
+ parseOptions.demand[cmd] = true;
2244
+ });
2245
+ parsed.optional.forEach((o) => {
2246
+ const [cmd, ...aliases] = o.cmd;
2247
+ if (o.variadic) {
2248
+ parseOptions.array.push(cmd);
2249
+ parseOptions.default[cmd] = [];
2250
+ }
2251
+ parseOptions.alias[cmd] = aliases;
2252
+ });
2253
+ return parseOptions;
2254
+ }
2255
+ postProcessPositionals(argv, positionalMap, parseOptions, yargs) {
2256
+ const options = Object.assign({}, yargs.getOptions());
2257
+ options.default = Object.assign(parseOptions.default, options.default);
2258
+ for (const key of Object.keys(parseOptions.alias)) options.alias[key] = (options.alias[key] || []).concat(parseOptions.alias[key]);
2259
+ options.array = options.array.concat(parseOptions.array);
2260
+ options.config = {};
2261
+ const unparsed = [];
2262
+ Object.keys(positionalMap).forEach((key) => {
2263
+ positionalMap[key].map((value) => {
2264
+ if (options.configuration["unknown-options-as-args"]) options.key[key] = true;
2265
+ unparsed.push(`--${key}`);
2266
+ unparsed.push(value);
2267
+ });
2268
+ });
2269
+ if (!unparsed.length) return;
2270
+ const config = Object.assign({}, options.configuration, { "populate--": false });
2271
+ const parsed = this.shim.Parser.detailed(unparsed, Object.assign({}, options, { configuration: config }));
2272
+ if (parsed.error) yargs.getInternalMethods().getUsageInstance().fail(parsed.error.message, parsed.error);
2273
+ else {
2274
+ const positionalKeys = Object.keys(positionalMap);
2275
+ Object.keys(positionalMap).forEach((key) => {
2276
+ positionalKeys.push(...parsed.aliases[key]);
2277
+ });
2278
+ Object.keys(parsed.argv).forEach((key) => {
2279
+ if (positionalKeys.includes(key)) {
2280
+ if (!positionalMap[key]) positionalMap[key] = parsed.argv[key];
2281
+ if (!this.isInConfigs(yargs, key) && !this.isDefaulted(yargs, key) && Object.prototype.hasOwnProperty.call(argv, key) && Object.prototype.hasOwnProperty.call(parsed.argv, key) && (Array.isArray(argv[key]) || Array.isArray(parsed.argv[key]))) argv[key] = [].concat(argv[key], parsed.argv[key]);
2282
+ else argv[key] = parsed.argv[key];
2283
+ }
2284
+ });
2285
+ }
2286
+ }
2287
+ isDefaulted(yargs, key) {
2288
+ const { default: defaults } = yargs.getOptions();
2289
+ return Object.prototype.hasOwnProperty.call(defaults, key) || Object.prototype.hasOwnProperty.call(defaults, this.shim.Parser.camelCase(key));
2290
+ }
2291
+ isInConfigs(yargs, key) {
2292
+ const { configObjects } = yargs.getOptions();
2293
+ return configObjects.some((c) => Object.prototype.hasOwnProperty.call(c, key)) || configObjects.some((c) => Object.prototype.hasOwnProperty.call(c, this.shim.Parser.camelCase(key)));
2294
+ }
2295
+ runDefaultBuilderOn(yargs) {
2296
+ if (!this.defaultCommand) return;
2297
+ if (this.shouldUpdateUsage(yargs)) {
2298
+ const commandString = DEFAULT_MARKER.test(this.defaultCommand.original) ? this.defaultCommand.original : this.defaultCommand.original.replace(/^[^[\]<>]*/, "$0 ");
2299
+ yargs.getInternalMethods().getUsageInstance().usage(commandString, this.defaultCommand.description);
2300
+ }
2301
+ const builder = this.defaultCommand.builder;
2302
+ if (isCommandBuilderCallback(builder)) return builder(yargs, true);
2303
+ else if (!isCommandBuilderDefinition(builder)) Object.keys(builder).forEach((key) => {
2304
+ yargs.option(key, builder[key]);
2305
+ });
2306
+ return void 0;
2307
+ }
2308
+ extractDesc({ describe, description, desc }) {
2309
+ for (const test of [
2310
+ describe,
2311
+ description,
2312
+ desc
2313
+ ]) {
2314
+ if (typeof test === "string" || test === false) return test;
2315
+ assertNotStrictEqual(test, true, this.shim);
2316
+ }
2317
+ return false;
2318
+ }
2319
+ freeze() {
2320
+ this.frozens.push({
2321
+ handlers: this.handlers,
2322
+ aliasMap: this.aliasMap,
2323
+ defaultCommand: this.defaultCommand
2324
+ });
2325
+ }
2326
+ unfreeze() {
2327
+ const frozen = this.frozens.pop();
2328
+ assertNotStrictEqual(frozen, void 0, this.shim);
2329
+ ({handlers: this.handlers, aliasMap: this.aliasMap, defaultCommand: this.defaultCommand} = frozen);
2330
+ }
2331
+ reset() {
2332
+ this.handlers = {};
2333
+ this.aliasMap = {};
2334
+ this.defaultCommand = void 0;
2335
+ this.requireCache = /* @__PURE__ */ new Set();
2336
+ return this;
2337
+ }
2338
+ };
2339
+ function command(usage$1, validation$1, globalMiddleware, shim$2) {
2340
+ return new CommandInstance(usage$1, validation$1, globalMiddleware, shim$2);
2341
+ }
2342
+ function isCommandBuilderDefinition(builder) {
2343
+ return typeof builder === "object" && !!builder.builder && typeof builder.handler === "function";
2344
+ }
2345
+ function isCommandAndAliases(cmd) {
2346
+ return cmd.every((c) => typeof c === "string");
2347
+ }
2348
+ function isCommandBuilderCallback(builder) {
2349
+ return typeof builder === "function";
2350
+ }
2351
+ function isCommandBuilderOptionDefinitions(builder) {
2352
+ return typeof builder === "object";
2353
+ }
2354
+ function isCommandHandlerDefinition(cmd) {
2355
+ return typeof cmd === "object" && !Array.isArray(cmd);
2356
+ }
2357
+
2358
+ //#endregion
2359
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/build/lib/utils/obj-filter.js
2360
+ function objFilter(original = {}, filter = () => true) {
2361
+ const obj = {};
2362
+ objectKeys(original).forEach((key) => {
2363
+ if (filter(key, original[key])) obj[key] = original[key];
2364
+ });
2365
+ return obj;
2366
+ }
2367
+
2368
+ //#endregion
2369
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/build/lib/utils/set-blocking.js
2370
+ function setBlocking(blocking) {
2371
+ if (typeof process === "undefined") return;
2372
+ [process.stdout, process.stderr].forEach((_stream) => {
2373
+ const stream = _stream;
2374
+ if (stream._handle && stream.isTTY && typeof stream._handle.setBlocking === "function") stream._handle.setBlocking(blocking);
2375
+ });
2376
+ }
2377
+
2378
+ //#endregion
2379
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/build/lib/usage.js
2380
+ function isBoolean(fail) {
2381
+ return typeof fail === "boolean";
2382
+ }
2383
+ function usage(yargs, shim$2) {
2384
+ const __ = shim$2.y18n.__;
2385
+ const self = {};
2386
+ const fails = [];
2387
+ self.failFn = function failFn(f) {
2388
+ fails.push(f);
2389
+ };
2390
+ let failMessage = null;
2391
+ let globalFailMessage = null;
2392
+ let showHelpOnFail = true;
2393
+ self.showHelpOnFail = function showHelpOnFailFn(arg1 = true, arg2) {
2394
+ const [enabled, message] = typeof arg1 === "string" ? [true, arg1] : [arg1, arg2];
2395
+ if (yargs.getInternalMethods().isGlobalContext()) globalFailMessage = message;
2396
+ failMessage = message;
2397
+ showHelpOnFail = enabled;
2398
+ return self;
2399
+ };
2400
+ let failureOutput = false;
2401
+ self.fail = function fail(msg, err) {
2402
+ const logger = yargs.getInternalMethods().getLoggerInstance();
2403
+ if (fails.length) for (let i = fails.length - 1; i >= 0; --i) {
2404
+ const fail$1 = fails[i];
2405
+ if (isBoolean(fail$1)) {
2406
+ if (err) throw err;
2407
+ else if (msg) throw Error(msg);
2408
+ } else fail$1(msg, err, self);
2409
+ }
2410
+ else {
2411
+ if (yargs.getExitProcess()) setBlocking(true);
2412
+ if (!failureOutput) {
2413
+ failureOutput = true;
2414
+ if (showHelpOnFail) {
2415
+ yargs.showHelp("error");
2416
+ logger.error();
2417
+ }
2418
+ if (msg || err) logger.error(msg || err);
2419
+ const globalOrCommandFailMessage = failMessage || globalFailMessage;
2420
+ if (globalOrCommandFailMessage) {
2421
+ if (msg || err) logger.error("");
2422
+ logger.error(globalOrCommandFailMessage);
2423
+ }
2424
+ }
2425
+ err = err || new YError(msg);
2426
+ if (yargs.getExitProcess()) return yargs.exit(1);
2427
+ else if (yargs.getInternalMethods().hasParseCallback()) return yargs.exit(1, err);
2428
+ else throw err;
2429
+ }
2430
+ };
2431
+ let usages = [];
2432
+ let usageDisabled = false;
2433
+ self.usage = (msg, description) => {
2434
+ if (msg === null) {
2435
+ usageDisabled = true;
2436
+ usages = [];
2437
+ return self;
2438
+ }
2439
+ usageDisabled = false;
2440
+ usages.push([msg, description || ""]);
2441
+ return self;
2442
+ };
2443
+ self.getUsage = () => {
2444
+ return usages;
2445
+ };
2446
+ self.getUsageDisabled = () => {
2447
+ return usageDisabled;
2448
+ };
2449
+ self.getPositionalGroupName = () => {
2450
+ return __("Positionals:");
2451
+ };
2452
+ let examples = [];
2453
+ self.example = (cmd, description) => {
2454
+ examples.push([cmd, description || ""]);
2455
+ };
2456
+ let commands = [];
2457
+ self.command = function command$1(cmd, description, isDefault, aliases, deprecated = false) {
2458
+ if (isDefault) commands = commands.map((cmdArray) => {
2459
+ cmdArray[2] = false;
2460
+ return cmdArray;
2461
+ });
2462
+ commands.push([
2463
+ cmd,
2464
+ description || "",
2465
+ isDefault,
2466
+ aliases,
2467
+ deprecated
2468
+ ]);
2469
+ };
2470
+ self.getCommands = () => commands;
2471
+ let descriptions = {};
2472
+ self.describe = function describe(keyOrKeys, desc) {
2473
+ if (Array.isArray(keyOrKeys)) keyOrKeys.forEach((k) => {
2474
+ self.describe(k, desc);
2475
+ });
2476
+ else if (typeof keyOrKeys === "object") Object.keys(keyOrKeys).forEach((k) => {
2477
+ self.describe(k, keyOrKeys[k]);
2478
+ });
2479
+ else descriptions[keyOrKeys] = desc;
2480
+ };
2481
+ self.getDescriptions = () => descriptions;
2482
+ let epilogs = [];
2483
+ self.epilog = (msg) => {
2484
+ epilogs.push(msg);
2485
+ };
2486
+ let wrapSet = false;
2487
+ let wrap;
2488
+ self.wrap = (cols) => {
2489
+ wrapSet = true;
2490
+ wrap = cols;
2491
+ };
2492
+ self.getWrap = () => {
2493
+ if (shim$2.getEnv("YARGS_DISABLE_WRAP")) return null;
2494
+ if (!wrapSet) {
2495
+ wrap = windowWidth();
2496
+ wrapSet = true;
2497
+ }
2498
+ return wrap;
2499
+ };
2500
+ const deferY18nLookupPrefix = "__yargsString__:";
2501
+ self.deferY18nLookup = (str) => deferY18nLookupPrefix + str;
2502
+ self.help = function help() {
2503
+ if (cachedHelpMessage) return cachedHelpMessage;
2504
+ normalizeAliases();
2505
+ const base$0 = yargs.customScriptName ? yargs.$0 : shim$2.path.basename(yargs.$0);
2506
+ const demandedOptions = yargs.getDemandedOptions();
2507
+ const demandedCommands = yargs.getDemandedCommands();
2508
+ const deprecatedOptions = yargs.getDeprecatedOptions();
2509
+ const groups = yargs.getGroups();
2510
+ const options = yargs.getOptions();
2511
+ let keys = [];
2512
+ keys = keys.concat(Object.keys(descriptions));
2513
+ keys = keys.concat(Object.keys(demandedOptions));
2514
+ keys = keys.concat(Object.keys(demandedCommands));
2515
+ keys = keys.concat(Object.keys(options.default));
2516
+ keys = keys.filter(filterHiddenOptions);
2517
+ keys = Object.keys(keys.reduce((acc, key) => {
2518
+ if (key !== "_") acc[key] = true;
2519
+ return acc;
2520
+ }, {}));
2521
+ const theWrap = self.getWrap();
2522
+ const ui$1 = shim$2.cliui({
2523
+ width: theWrap,
2524
+ wrap: !!theWrap
2525
+ });
2526
+ if (!usageDisabled) {
2527
+ if (usages.length) {
2528
+ usages.forEach((usage$1) => {
2529
+ ui$1.div({ text: `${usage$1[0].replace(/\$0/g, base$0)}` });
2530
+ if (usage$1[1]) ui$1.div({
2531
+ text: `${usage$1[1]}`,
2532
+ padding: [
2533
+ 1,
2534
+ 0,
2535
+ 0,
2536
+ 0
2537
+ ]
2538
+ });
2539
+ });
2540
+ ui$1.div();
2541
+ } else if (commands.length) {
2542
+ let u = null;
2543
+ if (demandedCommands._) u = `${base$0} <${__("command")}>\n`;
2544
+ else u = `${base$0} [${__("command")}]\n`;
2545
+ ui$1.div(`${u}`);
2546
+ }
2547
+ }
2548
+ if (commands.length > 1 || commands.length === 1 && !commands[0][2]) {
2549
+ ui$1.div(__("Commands:"));
2550
+ const context = yargs.getInternalMethods().getContext();
2551
+ const parentCommands = context.commands.length ? `${context.commands.join(" ")} ` : "";
2552
+ if (yargs.getInternalMethods().getParserConfiguration()["sort-commands"] === true) commands = commands.sort((a, b) => a[0].localeCompare(b[0]));
2553
+ const prefix = base$0 ? `${base$0} ` : "";
2554
+ commands.forEach((command$1) => {
2555
+ const commandString = `${prefix}${parentCommands}${command$1[0].replace(/^\$0 ?/, "")}`;
2556
+ ui$1.span({
2557
+ text: commandString,
2558
+ padding: [
2559
+ 0,
2560
+ 2,
2561
+ 0,
2562
+ 2
2563
+ ],
2564
+ width: maxWidth(commands, theWrap, `${base$0}${parentCommands}`) + 4
2565
+ }, { text: command$1[1] });
2566
+ const hints = [];
2567
+ if (command$1[2]) hints.push(`[${__("default")}]`);
2568
+ if (command$1[3] && command$1[3].length) hints.push(`[${__("aliases:")} ${command$1[3].join(", ")}]`);
2569
+ if (command$1[4]) if (typeof command$1[4] === "string") hints.push(`[${__("deprecated: %s", command$1[4])}]`);
2570
+ else hints.push(`[${__("deprecated")}]`);
2571
+ if (hints.length) ui$1.div({
2572
+ text: hints.join(" "),
2573
+ padding: [
2574
+ 0,
2575
+ 0,
2576
+ 0,
2577
+ 2
2578
+ ],
2579
+ align: "right"
2580
+ });
2581
+ else ui$1.div();
2582
+ });
2583
+ ui$1.div();
2584
+ }
2585
+ const aliasKeys = (Object.keys(options.alias) || []).concat(Object.keys(yargs.parsed.newAliases) || []);
2586
+ keys = keys.filter((key) => !yargs.parsed.newAliases[key] && aliasKeys.every((alias) => (options.alias[alias] || []).indexOf(key) === -1));
2587
+ const defaultGroup = __("Options:");
2588
+ if (!groups[defaultGroup]) groups[defaultGroup] = [];
2589
+ addUngroupedKeys(keys, options.alias, groups, defaultGroup);
2590
+ const isLongSwitch = (sw) => /^--/.test(getText(sw));
2591
+ const displayedGroups = Object.keys(groups).filter((groupName) => groups[groupName].length > 0).map((groupName) => {
2592
+ const normalizedKeys = groups[groupName].filter(filterHiddenOptions).map((key) => {
2593
+ if (aliasKeys.includes(key)) return key;
2594
+ for (let i = 0, aliasKey; (aliasKey = aliasKeys[i]) !== void 0; i++) if ((options.alias[aliasKey] || []).includes(key)) return aliasKey;
2595
+ return key;
2596
+ });
2597
+ return {
2598
+ groupName,
2599
+ normalizedKeys
2600
+ };
2601
+ }).filter(({ normalizedKeys }) => normalizedKeys.length > 0).map(({ groupName, normalizedKeys }) => {
2602
+ const switches = normalizedKeys.reduce((acc, key) => {
2603
+ acc[key] = [key].concat(options.alias[key] || []).map((sw) => {
2604
+ if (groupName === self.getPositionalGroupName()) return sw;
2605
+ else return (/^[0-9]$/.test(sw) ? options.boolean.includes(key) ? "-" : "--" : sw.length > 1 ? "--" : "-") + sw;
2606
+ }).sort((sw1, sw2) => isLongSwitch(sw1) === isLongSwitch(sw2) ? 0 : isLongSwitch(sw1) ? 1 : -1).join(", ");
2607
+ return acc;
2608
+ }, {});
2609
+ return {
2610
+ groupName,
2611
+ normalizedKeys,
2612
+ switches
2613
+ };
2614
+ });
2615
+ const shortSwitchesUsed = displayedGroups.filter(({ groupName }) => groupName !== self.getPositionalGroupName()).some(({ normalizedKeys, switches }) => !normalizedKeys.every((key) => isLongSwitch(switches[key])));
2616
+ if (shortSwitchesUsed) displayedGroups.filter(({ groupName }) => groupName !== self.getPositionalGroupName()).forEach(({ normalizedKeys, switches }) => {
2617
+ normalizedKeys.forEach((key) => {
2618
+ if (isLongSwitch(switches[key])) switches[key] = addIndentation(switches[key], 4);
2619
+ });
2620
+ });
2621
+ displayedGroups.forEach(({ groupName, normalizedKeys, switches }) => {
2622
+ ui$1.div(groupName);
2623
+ normalizedKeys.forEach((key) => {
2624
+ const kswitch = switches[key];
2625
+ let desc = descriptions[key] || "";
2626
+ let type$1 = null;
2627
+ if (desc.includes(deferY18nLookupPrefix)) desc = __(desc.substring(16));
2628
+ if (options.boolean.includes(key)) type$1 = `[${__("boolean")}]`;
2629
+ if (options.count.includes(key)) type$1 = `[${__("count")}]`;
2630
+ if (options.string.includes(key)) type$1 = `[${__("string")}]`;
2631
+ if (options.normalize.includes(key)) type$1 = `[${__("string")}]`;
2632
+ if (options.array.includes(key)) type$1 = `[${__("array")}]`;
2633
+ if (options.number.includes(key)) type$1 = `[${__("number")}]`;
2634
+ const deprecatedExtra = (deprecated) => typeof deprecated === "string" ? `[${__("deprecated: %s", deprecated)}]` : `[${__("deprecated")}]`;
2635
+ const extra = [
2636
+ key in deprecatedOptions ? deprecatedExtra(deprecatedOptions[key]) : null,
2637
+ type$1,
2638
+ key in demandedOptions ? `[${__("required")}]` : null,
2639
+ options.choices && options.choices[key] ? `[${__("choices:")} ${self.stringifiedValues(options.choices[key])}]` : null,
2640
+ defaultString(options.default[key], options.defaultDescription[key])
2641
+ ].filter(Boolean).join(" ");
2642
+ ui$1.span({
2643
+ text: getText(kswitch),
2644
+ padding: [
2645
+ 0,
2646
+ 2,
2647
+ 0,
2648
+ 2 + getIndentation(kswitch)
2649
+ ],
2650
+ width: maxWidth(switches, theWrap) + 4
2651
+ }, desc);
2652
+ const shouldHideOptionExtras = yargs.getInternalMethods().getUsageConfiguration()["hide-types"] === true;
2653
+ if (extra && !shouldHideOptionExtras) ui$1.div({
2654
+ text: extra,
2655
+ padding: [
2656
+ 0,
2657
+ 0,
2658
+ 0,
2659
+ 2
2660
+ ],
2661
+ align: "right"
2662
+ });
2663
+ else ui$1.div();
2664
+ });
2665
+ ui$1.div();
2666
+ });
2667
+ if (examples.length) {
2668
+ ui$1.div(__("Examples:"));
2669
+ examples.forEach((example) => {
2670
+ example[0] = example[0].replace(/\$0/g, base$0);
2671
+ });
2672
+ examples.forEach((example) => {
2673
+ if (example[1] === "") ui$1.div({
2674
+ text: example[0],
2675
+ padding: [
2676
+ 0,
2677
+ 2,
2678
+ 0,
2679
+ 2
2680
+ ]
2681
+ });
2682
+ else ui$1.div({
2683
+ text: example[0],
2684
+ padding: [
2685
+ 0,
2686
+ 2,
2687
+ 0,
2688
+ 2
2689
+ ],
2690
+ width: maxWidth(examples, theWrap) + 4
2691
+ }, { text: example[1] });
2692
+ });
2693
+ ui$1.div();
2694
+ }
2695
+ if (epilogs.length > 0) {
2696
+ const e = epilogs.map((epilog) => epilog.replace(/\$0/g, base$0)).join("\n");
2697
+ ui$1.div(`${e}\n`);
2698
+ }
2699
+ return ui$1.toString().replace(/\s*$/, "");
2700
+ };
2701
+ function maxWidth(table, theWrap, modifier) {
2702
+ let width = 0;
2703
+ if (!Array.isArray(table)) table = Object.values(table).map((v) => [v]);
2704
+ table.forEach((v) => {
2705
+ width = Math.max(shim$2.stringWidth(modifier ? `${modifier} ${getText(v[0])}` : getText(v[0])) + getIndentation(v[0]), width);
2706
+ });
2707
+ if (theWrap) width = Math.min(width, parseInt((theWrap * .5).toString(), 10));
2708
+ return width;
2709
+ }
2710
+ function normalizeAliases() {
2711
+ const demandedOptions = yargs.getDemandedOptions();
2712
+ const options = yargs.getOptions();
2713
+ (Object.keys(options.alias) || []).forEach((key) => {
2714
+ options.alias[key].forEach((alias) => {
2715
+ if (descriptions[alias]) self.describe(key, descriptions[alias]);
2716
+ if (alias in demandedOptions) yargs.demandOption(key, demandedOptions[alias]);
2717
+ if (options.boolean.includes(alias)) yargs.boolean(key);
2718
+ if (options.count.includes(alias)) yargs.count(key);
2719
+ if (options.string.includes(alias)) yargs.string(key);
2720
+ if (options.normalize.includes(alias)) yargs.normalize(key);
2721
+ if (options.array.includes(alias)) yargs.array(key);
2722
+ if (options.number.includes(alias)) yargs.number(key);
2723
+ });
2724
+ });
2725
+ }
2726
+ let cachedHelpMessage;
2727
+ self.cacheHelpMessage = function() {
2728
+ cachedHelpMessage = this.help();
2729
+ };
2730
+ self.clearCachedHelpMessage = function() {
2731
+ cachedHelpMessage = void 0;
2732
+ };
2733
+ self.hasCachedHelpMessage = function() {
2734
+ return !!cachedHelpMessage;
2735
+ };
2736
+ function addUngroupedKeys(keys, aliases, groups, defaultGroup) {
2737
+ let groupedKeys = [];
2738
+ let toCheck = null;
2739
+ Object.keys(groups).forEach((group) => {
2740
+ groupedKeys = groupedKeys.concat(groups[group]);
2741
+ });
2742
+ keys.forEach((key) => {
2743
+ toCheck = [key].concat(aliases[key]);
2744
+ if (!toCheck.some((k) => groupedKeys.indexOf(k) !== -1)) groups[defaultGroup].push(key);
2745
+ });
2746
+ return groupedKeys;
2747
+ }
2748
+ function filterHiddenOptions(key) {
2749
+ return yargs.getOptions().hiddenOptions.indexOf(key) < 0 || yargs.parsed.argv[yargs.getOptions().showHiddenOpt];
2750
+ }
2751
+ self.showHelp = (level) => {
2752
+ const logger = yargs.getInternalMethods().getLoggerInstance();
2753
+ if (!level) level = "error";
2754
+ const emit = typeof level === "function" ? level : logger[level];
2755
+ emit(self.help());
2756
+ };
2757
+ self.functionDescription = (fn) => {
2758
+ const description = fn.name ? shim$2.Parser.decamelize(fn.name, "-") : __("generated-value");
2759
+ return [
2760
+ "(",
2761
+ description,
2762
+ ")"
2763
+ ].join("");
2764
+ };
2765
+ self.stringifiedValues = function stringifiedValues(values, separator) {
2766
+ let string = "";
2767
+ const sep = separator || ", ";
2768
+ const array = [].concat(values);
2769
+ if (!values || !array.length) return string;
2770
+ array.forEach((value) => {
2771
+ if (string.length) string += sep;
2772
+ string += JSON.stringify(value);
2773
+ });
2774
+ return string;
2775
+ };
2776
+ function defaultString(value, defaultDescription) {
2777
+ let string = `[${__("default:")} `;
2778
+ if (value === void 0 && !defaultDescription) return null;
2779
+ if (defaultDescription) string += defaultDescription;
2780
+ else switch (typeof value) {
2781
+ case "string":
2782
+ string += `"${value}"`;
2783
+ break;
2784
+ case "object":
2785
+ string += JSON.stringify(value);
2786
+ break;
2787
+ default: string += value;
2788
+ }
2789
+ return `${string}]`;
2790
+ }
2791
+ function windowWidth() {
2792
+ const maxWidth$1 = 80;
2793
+ if (shim$2.process.stdColumns) return Math.min(maxWidth$1, shim$2.process.stdColumns);
2794
+ else return maxWidth$1;
2795
+ }
2796
+ let version$1 = null;
2797
+ self.version = (ver) => {
2798
+ version$1 = ver;
2799
+ };
2800
+ self.showVersion = (level) => {
2801
+ const logger = yargs.getInternalMethods().getLoggerInstance();
2802
+ if (!level) level = "error";
2803
+ const emit = typeof level === "function" ? level : logger[level];
2804
+ emit(version$1);
2805
+ };
2806
+ self.reset = function reset(localLookup) {
2807
+ failMessage = null;
2808
+ failureOutput = false;
2809
+ usages = [];
2810
+ usageDisabled = false;
2811
+ epilogs = [];
2812
+ examples = [];
2813
+ commands = [];
2814
+ descriptions = objFilter(descriptions, (k) => !localLookup[k]);
2815
+ return self;
2816
+ };
2817
+ const frozens = [];
2818
+ self.freeze = function freeze() {
2819
+ frozens.push({
2820
+ failMessage,
2821
+ failureOutput,
2822
+ usages,
2823
+ usageDisabled,
2824
+ epilogs,
2825
+ examples,
2826
+ commands,
2827
+ descriptions
2828
+ });
2829
+ };
2830
+ self.unfreeze = function unfreeze(defaultCommand = false) {
2831
+ const frozen = frozens.pop();
2832
+ if (!frozen) return;
2833
+ if (defaultCommand) {
2834
+ descriptions = {
2835
+ ...frozen.descriptions,
2836
+ ...descriptions
2837
+ };
2838
+ commands = [...frozen.commands, ...commands];
2839
+ usages = [...frozen.usages, ...usages];
2840
+ examples = [...frozen.examples, ...examples];
2841
+ epilogs = [...frozen.epilogs, ...epilogs];
2842
+ } else ({failMessage, failureOutput, usages, usageDisabled, epilogs, examples, commands, descriptions} = frozen);
2843
+ };
2844
+ return self;
2845
+ }
2846
+ function isIndentedText(text) {
2847
+ return typeof text === "object";
2848
+ }
2849
+ function addIndentation(text, indent) {
2850
+ return isIndentedText(text) ? {
2851
+ text: text.text,
2852
+ indentation: text.indentation + indent
2853
+ } : {
2854
+ text,
2855
+ indentation: indent
2856
+ };
2857
+ }
2858
+ function getIndentation(text) {
2859
+ return isIndentedText(text) ? text.indentation : 0;
2860
+ }
2861
+ function getText(text) {
2862
+ return isIndentedText(text) ? text.text : text;
2863
+ }
2864
+
2865
+ //#endregion
2866
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/build/lib/completion-templates.js
2867
+ const completionShTemplate = `###-begin-{{app_name}}-completions-###
2868
+ #
2869
+ # yargs command completion script
2870
+ #
2871
+ # Installation: {{app_path}} {{completion_command}} >> ~/.bashrc
2872
+ # or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.
2873
+ #
2874
+ _{{app_name}}_yargs_completions()
2875
+ {
2876
+ local cur_word args type_list
2877
+
2878
+ cur_word="\${COMP_WORDS[COMP_CWORD]}"
2879
+ args=("\${COMP_WORDS[@]}")
2880
+
2881
+ # ask yargs to generate completions.
2882
+ # see https://stackoverflow.com/a/40944195/7080036 for the spaces-handling awk
2883
+ mapfile -t type_list < <({{app_path}} --get-yargs-completions "\${args[@]}")
2884
+ mapfile -t COMPREPLY < <(compgen -W "$( printf '%q ' "\${type_list[@]}" )" -- "\${cur_word}" |
2885
+ awk '/ / { print "\\""$0"\\"" } /^[^ ]+$/ { print $0 }')
2886
+
2887
+ # if no match was found, fall back to filename completion
2888
+ if [ \${#COMPREPLY[@]} -eq 0 ]; then
2889
+ COMPREPLY=()
2890
+ fi
2891
+
2892
+ return 0
2893
+ }
2894
+ complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}
2895
+ ###-end-{{app_name}}-completions-###
2896
+ `;
2897
+ const completionZshTemplate = `#compdef {{app_name}}
2898
+ ###-begin-{{app_name}}-completions-###
2899
+ #
2900
+ # yargs command completion script
2901
+ #
2902
+ # Installation: {{app_path}} {{completion_command}} >> ~/.zshrc
2903
+ # or {{app_path}} {{completion_command}} >> ~/.zprofile on OSX.
2904
+ #
2905
+ _{{app_name}}_yargs_completions()
2906
+ {
2907
+ local reply
2908
+ local si=$IFS
2909
+ IFS=$'\n' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "\${words[@]}"))
2910
+ IFS=$si
2911
+ if [[ \${#reply} -gt 0 ]]; then
2912
+ _describe 'values' reply
2913
+ else
2914
+ _default
2915
+ fi
2916
+ }
2917
+ if [[ "'\${zsh_eval_context[-1]}" == "loadautofunc" ]]; then
2918
+ _{{app_name}}_yargs_completions "$@"
2919
+ else
2920
+ compdef _{{app_name}}_yargs_completions {{app_name}}
2921
+ fi
2922
+ ###-end-{{app_name}}-completions-###
2923
+ `;
2924
+
2925
+ //#endregion
2926
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/build/lib/completion.js
2927
+ var Completion = class {
2928
+ constructor(yargs, usage$1, command$1, shim$2) {
2929
+ var _a$1, _b$1, _c$1;
2930
+ this.yargs = yargs;
2931
+ this.usage = usage$1;
2932
+ this.command = command$1;
2933
+ this.shim = shim$2;
2934
+ this.completionKey = "get-yargs-completions";
2935
+ this.aliases = null;
2936
+ this.customCompletionFunction = null;
2937
+ this.indexAfterLastReset = 0;
2938
+ this.zshShell = (_c$1 = ((_a$1 = this.shim.getEnv("SHELL")) === null || _a$1 === void 0 ? void 0 : _a$1.includes("zsh")) || ((_b$1 = this.shim.getEnv("ZSH_NAME")) === null || _b$1 === void 0 ? void 0 : _b$1.includes("zsh"))) !== null && _c$1 !== void 0 ? _c$1 : false;
2939
+ }
2940
+ defaultCompletion(args, argv, current, done) {
2941
+ const handlers = this.command.getCommandHandlers();
2942
+ for (let i = 0, ii = args.length; i < ii; ++i) if (handlers[args[i]] && handlers[args[i]].builder) {
2943
+ const builder = handlers[args[i]].builder;
2944
+ if (isCommandBuilderCallback(builder)) {
2945
+ this.indexAfterLastReset = i + 1;
2946
+ const y = this.yargs.getInternalMethods().reset();
2947
+ builder(y, true);
2948
+ return y.argv;
2949
+ }
2950
+ }
2951
+ const completions = [];
2952
+ this.commandCompletions(completions, args, current);
2953
+ this.optionCompletions(completions, args, argv, current);
2954
+ this.choicesFromOptionsCompletions(completions, args, argv, current);
2955
+ this.choicesFromPositionalsCompletions(completions, args, argv, current);
2956
+ done(null, completions);
2957
+ }
2958
+ commandCompletions(completions, args, current) {
2959
+ const parentCommands = this.yargs.getInternalMethods().getContext().commands;
2960
+ if (!current.match(/^-/) && parentCommands[parentCommands.length - 1] !== current && !this.previousArgHasChoices(args)) this.usage.getCommands().forEach((usageCommand) => {
2961
+ const commandName = parseCommand(usageCommand[0]).cmd;
2962
+ if (args.indexOf(commandName) === -1) if (!this.zshShell) completions.push(commandName);
2963
+ else {
2964
+ const desc = usageCommand[1] || "";
2965
+ completions.push(commandName.replace(/:/g, "\\:") + ":" + desc);
2966
+ }
2967
+ });
2968
+ }
2969
+ optionCompletions(completions, args, argv, current) {
2970
+ if ((current.match(/^-/) || current === "" && completions.length === 0) && !this.previousArgHasChoices(args)) {
2971
+ const options = this.yargs.getOptions();
2972
+ const positionalKeys = this.yargs.getGroups()[this.usage.getPositionalGroupName()] || [];
2973
+ Object.keys(options.key).forEach((key) => {
2974
+ const negable = !!options.configuration["boolean-negation"] && options.boolean.includes(key);
2975
+ const isPositionalKey = positionalKeys.includes(key);
2976
+ if (!isPositionalKey && !options.hiddenOptions.includes(key) && !this.argsContainKey(args, key, negable)) this.completeOptionKey(key, completions, current, negable && !!options.default[key]);
2977
+ });
2978
+ }
2979
+ }
2980
+ choicesFromOptionsCompletions(completions, args, argv, current) {
2981
+ if (this.previousArgHasChoices(args)) {
2982
+ const choices = this.getPreviousArgChoices(args);
2983
+ if (choices && choices.length > 0) completions.push(...choices.map((c) => c.replace(/:/g, "\\:")));
2984
+ }
2985
+ }
2986
+ choicesFromPositionalsCompletions(completions, args, argv, current) {
2987
+ if (current === "" && completions.length > 0 && this.previousArgHasChoices(args)) return;
2988
+ const positionalKeys = this.yargs.getGroups()[this.usage.getPositionalGroupName()] || [];
2989
+ const offset = Math.max(this.indexAfterLastReset, this.yargs.getInternalMethods().getContext().commands.length + 1);
2990
+ const positionalKey = positionalKeys[argv._.length - offset - 1];
2991
+ if (!positionalKey) return;
2992
+ const choices = this.yargs.getOptions().choices[positionalKey] || [];
2993
+ for (const choice of choices) if (choice.startsWith(current)) completions.push(choice.replace(/:/g, "\\:"));
2994
+ }
2995
+ getPreviousArgChoices(args) {
2996
+ if (args.length < 1) return;
2997
+ let previousArg = args[args.length - 1];
2998
+ let filter = "";
2999
+ if (!previousArg.startsWith("-") && args.length > 1) {
3000
+ filter = previousArg;
3001
+ previousArg = args[args.length - 2];
3002
+ }
3003
+ if (!previousArg.startsWith("-")) return;
3004
+ const previousArgKey = previousArg.replace(/^-+/, "");
3005
+ const options = this.yargs.getOptions();
3006
+ const possibleAliases = [previousArgKey, ...this.yargs.getAliases()[previousArgKey] || []];
3007
+ let choices;
3008
+ for (const possibleAlias of possibleAliases) if (Object.prototype.hasOwnProperty.call(options.key, possibleAlias) && Array.isArray(options.choices[possibleAlias])) {
3009
+ choices = options.choices[possibleAlias];
3010
+ break;
3011
+ }
3012
+ if (choices) return choices.filter((choice) => !filter || choice.startsWith(filter));
3013
+ }
3014
+ previousArgHasChoices(args) {
3015
+ const choices = this.getPreviousArgChoices(args);
3016
+ return choices !== void 0 && choices.length > 0;
3017
+ }
3018
+ argsContainKey(args, key, negable) {
3019
+ const argsContains = (s) => args.indexOf((/^[^0-9]$/.test(s) ? "-" : "--") + s) !== -1;
3020
+ if (argsContains(key)) return true;
3021
+ if (negable && argsContains(`no-${key}`)) return true;
3022
+ if (this.aliases) {
3023
+ for (const alias of this.aliases[key]) if (argsContains(alias)) return true;
3024
+ }
3025
+ return false;
3026
+ }
3027
+ completeOptionKey(key, completions, current, negable) {
3028
+ var _a$1, _b$1, _c$1, _d;
3029
+ let keyWithDesc = key;
3030
+ if (this.zshShell) {
3031
+ const descs = this.usage.getDescriptions();
3032
+ const aliasKey = (_b$1 = (_a$1 = this === null || this === void 0 ? void 0 : this.aliases) === null || _a$1 === void 0 ? void 0 : _a$1[key]) === null || _b$1 === void 0 ? void 0 : _b$1.find((alias) => {
3033
+ const desc$1 = descs[alias];
3034
+ return typeof desc$1 === "string" && desc$1.length > 0;
3035
+ });
3036
+ const descFromAlias = aliasKey ? descs[aliasKey] : void 0;
3037
+ const desc = (_d = (_c$1 = descs[key]) !== null && _c$1 !== void 0 ? _c$1 : descFromAlias) !== null && _d !== void 0 ? _d : "";
3038
+ keyWithDesc = `${key.replace(/:/g, "\\:")}:${desc.replace("__yargsString__:", "").replace(/(\r\n|\n|\r)/gm, " ")}`;
3039
+ }
3040
+ const startsByTwoDashes = (s) => /^--/.test(s);
3041
+ const isShortOption = (s) => /^[^0-9]$/.test(s);
3042
+ const dashes = !startsByTwoDashes(current) && isShortOption(key) ? "-" : "--";
3043
+ completions.push(dashes + keyWithDesc);
3044
+ if (negable) completions.push(dashes + "no-" + keyWithDesc);
3045
+ }
3046
+ customCompletion(args, argv, current, done) {
3047
+ assertNotStrictEqual(this.customCompletionFunction, null, this.shim);
3048
+ if (isSyncCompletionFunction(this.customCompletionFunction)) {
3049
+ const result = this.customCompletionFunction(current, argv);
3050
+ if (isPromise(result)) return result.then((list) => {
3051
+ this.shim.process.nextTick(() => {
3052
+ done(null, list);
3053
+ });
3054
+ }).catch((err) => {
3055
+ this.shim.process.nextTick(() => {
3056
+ done(err, void 0);
3057
+ });
3058
+ });
3059
+ return done(null, result);
3060
+ } else if (isFallbackCompletionFunction(this.customCompletionFunction)) return this.customCompletionFunction(current, argv, (onCompleted = done) => this.defaultCompletion(args, argv, current, onCompleted), (completions) => {
3061
+ done(null, completions);
3062
+ });
3063
+ else return this.customCompletionFunction(current, argv, (completions) => {
3064
+ done(null, completions);
3065
+ });
3066
+ }
3067
+ getCompletion(args, done) {
3068
+ const current = args.length ? args[args.length - 1] : "";
3069
+ const argv = this.yargs.parse(args, true);
3070
+ const completionFunction = this.customCompletionFunction ? (argv$1) => this.customCompletion(args, argv$1, current, done) : (argv$1) => this.defaultCompletion(args, argv$1, current, done);
3071
+ return isPromise(argv) ? argv.then(completionFunction) : completionFunction(argv);
3072
+ }
3073
+ generateCompletionScript($0, cmd) {
3074
+ let script = this.zshShell ? completionZshTemplate : completionShTemplate;
3075
+ const name$1 = this.shim.path.basename($0);
3076
+ if ($0.match(/\.js$/)) $0 = `./${$0}`;
3077
+ script = script.replace(/{{app_name}}/g, name$1);
3078
+ script = script.replace(/{{completion_command}}/g, cmd);
3079
+ return script.replace(/{{app_path}}/g, $0);
3080
+ }
3081
+ registerFunction(fn) {
3082
+ this.customCompletionFunction = fn;
3083
+ }
3084
+ setParsed(parsed) {
3085
+ this.aliases = parsed.aliases;
3086
+ }
3087
+ };
3088
+ function completion(yargs, usage$1, command$1, shim$2) {
3089
+ return new Completion(yargs, usage$1, command$1, shim$2);
3090
+ }
3091
+ function isSyncCompletionFunction(completionFunction) {
3092
+ return completionFunction.length < 3;
3093
+ }
3094
+ function isFallbackCompletionFunction(completionFunction) {
3095
+ return completionFunction.length > 3;
3096
+ }
3097
+
3098
+ //#endregion
3099
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/build/lib/utils/levenshtein.js
3100
+ function levenshtein(a, b) {
3101
+ if (a.length === 0) return b.length;
3102
+ if (b.length === 0) return a.length;
3103
+ const matrix = [];
3104
+ let i;
3105
+ for (i = 0; i <= b.length; i++) matrix[i] = [i];
3106
+ let j;
3107
+ for (j = 0; j <= a.length; j++) matrix[0][j] = j;
3108
+ for (i = 1; i <= b.length; i++) for (j = 1; j <= a.length; j++) if (b.charAt(i - 1) === a.charAt(j - 1)) matrix[i][j] = matrix[i - 1][j - 1];
3109
+ else if (i > 1 && j > 1 && b.charAt(i - 2) === a.charAt(j - 1) && b.charAt(i - 1) === a.charAt(j - 2)) matrix[i][j] = matrix[i - 2][j - 2] + 1;
3110
+ else matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, Math.min(matrix[i][j - 1] + 1, matrix[i - 1][j] + 1));
3111
+ return matrix[b.length][a.length];
3112
+ }
3113
+
3114
+ //#endregion
3115
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/build/lib/validation.js
3116
+ const specialKeys = [
3117
+ "$0",
3118
+ "--",
3119
+ "_"
3120
+ ];
3121
+ function validation(yargs, usage$1, shim$2) {
3122
+ const __ = shim$2.y18n.__;
3123
+ const __n = shim$2.y18n.__n;
3124
+ const self = {};
3125
+ self.nonOptionCount = function nonOptionCount(argv) {
3126
+ const demandedCommands = yargs.getDemandedCommands();
3127
+ const positionalCount = argv._.length + (argv["--"] ? argv["--"].length : 0);
3128
+ const _s = positionalCount - yargs.getInternalMethods().getContext().commands.length;
3129
+ if (demandedCommands._ && (_s < demandedCommands._.min || _s > demandedCommands._.max)) {
3130
+ if (_s < demandedCommands._.min) if (demandedCommands._.minMsg !== void 0) usage$1.fail(demandedCommands._.minMsg ? demandedCommands._.minMsg.replace(/\$0/g, _s.toString()).replace(/\$1/, demandedCommands._.min.toString()) : null);
3131
+ else usage$1.fail(__n("Not enough non-option arguments: got %s, need at least %s", "Not enough non-option arguments: got %s, need at least %s", _s, _s.toString(), demandedCommands._.min.toString()));
3132
+ else if (_s > demandedCommands._.max) if (demandedCommands._.maxMsg !== void 0) usage$1.fail(demandedCommands._.maxMsg ? demandedCommands._.maxMsg.replace(/\$0/g, _s.toString()).replace(/\$1/, demandedCommands._.max.toString()) : null);
3133
+ else usage$1.fail(__n("Too many non-option arguments: got %s, maximum of %s", "Too many non-option arguments: got %s, maximum of %s", _s, _s.toString(), demandedCommands._.max.toString()));
3134
+ }
3135
+ };
3136
+ self.positionalCount = function positionalCount(required, observed) {
3137
+ if (observed < required) usage$1.fail(__n("Not enough non-option arguments: got %s, need at least %s", "Not enough non-option arguments: got %s, need at least %s", observed, observed + "", required + ""));
3138
+ };
3139
+ self.requiredArguments = function requiredArguments(argv, demandedOptions) {
3140
+ let missing = null;
3141
+ for (const key of Object.keys(demandedOptions)) if (!Object.prototype.hasOwnProperty.call(argv, key) || typeof argv[key] === "undefined") {
3142
+ missing = missing || {};
3143
+ missing[key] = demandedOptions[key];
3144
+ }
3145
+ if (missing) {
3146
+ const customMsgs = [];
3147
+ for (const key of Object.keys(missing)) {
3148
+ const msg = missing[key];
3149
+ if (msg && customMsgs.indexOf(msg) < 0) customMsgs.push(msg);
3150
+ }
3151
+ const customMsg = customMsgs.length ? `\n${customMsgs.join("\n")}` : "";
3152
+ usage$1.fail(__n("Missing required argument: %s", "Missing required arguments: %s", Object.keys(missing).length, Object.keys(missing).join(", ") + customMsg));
3153
+ }
3154
+ };
3155
+ self.unknownArguments = function unknownArguments(argv, aliases, positionalMap, isDefaultCommand, checkPositionals = true) {
3156
+ var _a$1;
3157
+ const commandKeys = yargs.getInternalMethods().getCommandInstance().getCommands();
3158
+ const unknown = [];
3159
+ const currentContext = yargs.getInternalMethods().getContext();
3160
+ Object.keys(argv).forEach((key) => {
3161
+ if (!specialKeys.includes(key) && !Object.prototype.hasOwnProperty.call(positionalMap, key) && !Object.prototype.hasOwnProperty.call(yargs.getInternalMethods().getParseContext(), key) && !self.isValidAndSomeAliasIsNotNew(key, aliases)) unknown.push(key);
3162
+ });
3163
+ if (checkPositionals && (currentContext.commands.length > 0 || commandKeys.length > 0 || isDefaultCommand)) argv._.slice(currentContext.commands.length).forEach((key) => {
3164
+ if (!commandKeys.includes("" + key)) unknown.push("" + key);
3165
+ });
3166
+ if (checkPositionals) {
3167
+ const demandedCommands = yargs.getDemandedCommands();
3168
+ const maxNonOptDemanded = ((_a$1 = demandedCommands._) === null || _a$1 === void 0 ? void 0 : _a$1.max) || 0;
3169
+ const expected = currentContext.commands.length + maxNonOptDemanded;
3170
+ if (expected < argv._.length) argv._.slice(expected).forEach((key) => {
3171
+ key = String(key);
3172
+ if (!currentContext.commands.includes(key) && !unknown.includes(key)) unknown.push(key);
3173
+ });
3174
+ }
3175
+ if (unknown.length) usage$1.fail(__n("Unknown argument: %s", "Unknown arguments: %s", unknown.length, unknown.map((s) => s.trim() ? s : `"${s}"`).join(", ")));
3176
+ };
3177
+ self.unknownCommands = function unknownCommands(argv) {
3178
+ const commandKeys = yargs.getInternalMethods().getCommandInstance().getCommands();
3179
+ const unknown = [];
3180
+ const currentContext = yargs.getInternalMethods().getContext();
3181
+ if (currentContext.commands.length > 0 || commandKeys.length > 0) argv._.slice(currentContext.commands.length).forEach((key) => {
3182
+ if (!commandKeys.includes("" + key)) unknown.push("" + key);
3183
+ });
3184
+ if (unknown.length > 0) {
3185
+ usage$1.fail(__n("Unknown command: %s", "Unknown commands: %s", unknown.length, unknown.join(", ")));
3186
+ return true;
3187
+ } else return false;
3188
+ };
3189
+ self.isValidAndSomeAliasIsNotNew = function isValidAndSomeAliasIsNotNew(key, aliases) {
3190
+ if (!Object.prototype.hasOwnProperty.call(aliases, key)) return false;
3191
+ const newAliases = yargs.parsed.newAliases;
3192
+ return [key, ...aliases[key]].some((a) => !Object.prototype.hasOwnProperty.call(newAliases, a) || !newAliases[key]);
3193
+ };
3194
+ self.limitedChoices = function limitedChoices(argv) {
3195
+ const options = yargs.getOptions();
3196
+ const invalid = {};
3197
+ if (!Object.keys(options.choices).length) return;
3198
+ Object.keys(argv).forEach((key) => {
3199
+ if (specialKeys.indexOf(key) === -1 && Object.prototype.hasOwnProperty.call(options.choices, key)) [].concat(argv[key]).forEach((value) => {
3200
+ if (options.choices[key].indexOf(value) === -1 && value !== void 0) invalid[key] = (invalid[key] || []).concat(value);
3201
+ });
3202
+ });
3203
+ const invalidKeys = Object.keys(invalid);
3204
+ if (!invalidKeys.length) return;
3205
+ let msg = __("Invalid values:");
3206
+ invalidKeys.forEach((key) => {
3207
+ msg += `\n ${__("Argument: %s, Given: %s, Choices: %s", key, usage$1.stringifiedValues(invalid[key]), usage$1.stringifiedValues(options.choices[key]))}`;
3208
+ });
3209
+ usage$1.fail(msg);
3210
+ };
3211
+ let implied = {};
3212
+ self.implies = function implies(key, value) {
3213
+ argsert("<string|object> [array|number|string]", [key, value], arguments.length);
3214
+ if (typeof key === "object") Object.keys(key).forEach((k) => {
3215
+ self.implies(k, key[k]);
3216
+ });
3217
+ else {
3218
+ yargs.global(key);
3219
+ if (!implied[key]) implied[key] = [];
3220
+ if (Array.isArray(value)) value.forEach((i) => self.implies(key, i));
3221
+ else {
3222
+ assertNotStrictEqual(value, void 0, shim$2);
3223
+ implied[key].push(value);
3224
+ }
3225
+ }
3226
+ };
3227
+ self.getImplied = function getImplied() {
3228
+ return implied;
3229
+ };
3230
+ function keyExists(argv, val) {
3231
+ const num = Number(val);
3232
+ val = isNaN(num) ? val : num;
3233
+ if (typeof val === "number") val = argv._.length >= val;
3234
+ else if (val.match(/^--no-.+/)) {
3235
+ val = val.match(/^--no-(.+)/)[1];
3236
+ val = !Object.prototype.hasOwnProperty.call(argv, val);
3237
+ } else val = Object.prototype.hasOwnProperty.call(argv, val);
3238
+ return val;
3239
+ }
3240
+ self.implications = function implications(argv) {
3241
+ const implyFail = [];
3242
+ Object.keys(implied).forEach((key) => {
3243
+ const origKey = key;
3244
+ (implied[key] || []).forEach((value) => {
3245
+ let key$1 = origKey;
3246
+ const origValue = value;
3247
+ key$1 = keyExists(argv, key$1);
3248
+ value = keyExists(argv, value);
3249
+ if (key$1 && !value) implyFail.push(` ${origKey} -> ${origValue}`);
3250
+ });
3251
+ });
3252
+ if (implyFail.length) {
3253
+ let msg = `${__("Implications failed:")}\n`;
3254
+ implyFail.forEach((value) => {
3255
+ msg += value;
3256
+ });
3257
+ usage$1.fail(msg);
3258
+ }
3259
+ };
3260
+ let conflicting = {};
3261
+ self.conflicts = function conflicts(key, value) {
3262
+ argsert("<string|object> [array|string]", [key, value], arguments.length);
3263
+ if (typeof key === "object") Object.keys(key).forEach((k) => {
3264
+ self.conflicts(k, key[k]);
3265
+ });
3266
+ else {
3267
+ yargs.global(key);
3268
+ if (!conflicting[key]) conflicting[key] = [];
3269
+ if (Array.isArray(value)) value.forEach((i) => self.conflicts(key, i));
3270
+ else conflicting[key].push(value);
3271
+ }
3272
+ };
3273
+ self.getConflicting = () => conflicting;
3274
+ self.conflicting = function conflictingFn(argv) {
3275
+ Object.keys(argv).forEach((key) => {
3276
+ if (conflicting[key]) conflicting[key].forEach((value) => {
3277
+ if (value && argv[key] !== void 0 && argv[value] !== void 0) usage$1.fail(__("Arguments %s and %s are mutually exclusive", key, value));
3278
+ });
3279
+ });
3280
+ if (yargs.getInternalMethods().getParserConfiguration()["strip-dashed"]) Object.keys(conflicting).forEach((key) => {
3281
+ conflicting[key].forEach((value) => {
3282
+ if (value && argv[shim$2.Parser.camelCase(key)] !== void 0 && argv[shim$2.Parser.camelCase(value)] !== void 0) usage$1.fail(__("Arguments %s and %s are mutually exclusive", key, value));
3283
+ });
3284
+ });
3285
+ };
3286
+ self.recommendCommands = function recommendCommands(cmd, potentialCommands) {
3287
+ const threshold = 3;
3288
+ potentialCommands = potentialCommands.sort((a, b) => b.length - a.length);
3289
+ let recommended = null;
3290
+ let bestDistance = Infinity;
3291
+ for (let i = 0, candidate; (candidate = potentialCommands[i]) !== void 0; i++) {
3292
+ const d = levenshtein(cmd, candidate);
3293
+ if (d <= threshold && d < bestDistance) {
3294
+ bestDistance = d;
3295
+ recommended = candidate;
3296
+ }
3297
+ }
3298
+ if (recommended) usage$1.fail(__("Did you mean %s?", recommended));
3299
+ };
3300
+ self.reset = function reset(localLookup) {
3301
+ implied = objFilter(implied, (k) => !localLookup[k]);
3302
+ conflicting = objFilter(conflicting, (k) => !localLookup[k]);
3303
+ return self;
3304
+ };
3305
+ const frozens = [];
3306
+ self.freeze = function freeze() {
3307
+ frozens.push({
3308
+ implied,
3309
+ conflicting
3310
+ });
3311
+ };
3312
+ self.unfreeze = function unfreeze() {
3313
+ const frozen = frozens.pop();
3314
+ assertNotStrictEqual(frozen, void 0, shim$2);
3315
+ ({implied, conflicting} = frozen);
3316
+ };
3317
+ return self;
3318
+ }
3319
+
3320
+ //#endregion
3321
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/build/lib/utils/apply-extends.js
3322
+ let previouslyVisitedConfigs = [];
3323
+ let shim;
3324
+ function applyExtends(config, cwd, mergeExtends, _shim) {
3325
+ shim = _shim;
3326
+ let defaultConfig = {};
3327
+ if (Object.prototype.hasOwnProperty.call(config, "extends")) {
3328
+ if (typeof config.extends !== "string") return defaultConfig;
3329
+ const isPath = /\.json|\..*rc$/.test(config.extends);
3330
+ let pathToDefault = null;
3331
+ if (!isPath) try {
3332
+ pathToDefault = import.meta.resolve(config.extends);
3333
+ } catch (_err) {
3334
+ return config;
3335
+ }
3336
+ else pathToDefault = getPathToDefaultConfig(cwd, config.extends);
3337
+ checkForCircularExtends(pathToDefault);
3338
+ previouslyVisitedConfigs.push(pathToDefault);
3339
+ defaultConfig = isPath ? JSON.parse(shim.readFileSync(pathToDefault, "utf8")) : _shim.require(config.extends);
3340
+ delete config.extends;
3341
+ defaultConfig = applyExtends(defaultConfig, shim.path.dirname(pathToDefault), mergeExtends, shim);
3342
+ }
3343
+ previouslyVisitedConfigs = [];
3344
+ return mergeExtends ? mergeDeep(defaultConfig, config) : Object.assign({}, defaultConfig, config);
3345
+ }
3346
+ function checkForCircularExtends(cfgPath) {
3347
+ if (previouslyVisitedConfigs.indexOf(cfgPath) > -1) throw new YError(`Circular extended configurations: '${cfgPath}'.`);
3348
+ }
3349
+ function getPathToDefaultConfig(cwd, pathToExtend) {
3350
+ return shim.path.resolve(cwd, pathToExtend);
3351
+ }
3352
+ function mergeDeep(config1, config2) {
3353
+ const target = {};
3354
+ function isObject(obj) {
3355
+ return obj && typeof obj === "object" && !Array.isArray(obj);
3356
+ }
3357
+ Object.assign(target, config1);
3358
+ for (const key of Object.keys(config2)) if (isObject(config2[key]) && isObject(target[key])) target[key] = mergeDeep(config1[key], config2[key]);
3359
+ else target[key] = config2[key];
3360
+ return target;
3361
+ }
3362
+
3363
+ //#endregion
3364
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/build/lib/yargs-factory.js
3365
+ var __classPrivateFieldSet = void 0 && (void 0).__classPrivateFieldSet || function(receiver, state, value, kind, f) {
3366
+ if (kind === "m") throw new TypeError("Private method is not writable");
3367
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
3368
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
3369
+ return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
3370
+ };
3371
+ var __classPrivateFieldGet = void 0 && (void 0).__classPrivateFieldGet || function(receiver, state, kind, f) {
3372
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3373
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
3374
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
3375
+ };
3376
+ var _YargsInstance_command, _YargsInstance_cwd, _YargsInstance_context, _YargsInstance_completion, _YargsInstance_completionCommand, _YargsInstance_defaultShowHiddenOpt, _YargsInstance_exitError, _YargsInstance_detectLocale, _YargsInstance_emittedWarnings, _YargsInstance_exitProcess, _YargsInstance_frozens, _YargsInstance_globalMiddleware, _YargsInstance_groups, _YargsInstance_hasOutput, _YargsInstance_helpOpt, _YargsInstance_isGlobalContext, _YargsInstance_logger, _YargsInstance_output, _YargsInstance_options, _YargsInstance_parentRequire, _YargsInstance_parserConfig, _YargsInstance_parseFn, _YargsInstance_parseContext, _YargsInstance_pkgs, _YargsInstance_preservedGroups, _YargsInstance_processArgs, _YargsInstance_recommendCommands, _YargsInstance_shim, _YargsInstance_strict, _YargsInstance_strictCommands, _YargsInstance_strictOptions, _YargsInstance_usage, _YargsInstance_usageConfig, _YargsInstance_versionOpt, _YargsInstance_validation;
3377
+ function YargsFactory(_shim) {
3378
+ return (processArgs = [], cwd = _shim.process.cwd(), parentRequire) => {
3379
+ const yargs = new YargsInstance(processArgs, cwd, parentRequire, _shim);
3380
+ Object.defineProperty(yargs, "argv", {
3381
+ get: () => {
3382
+ return yargs.parse();
3383
+ },
3384
+ enumerable: true
3385
+ });
3386
+ yargs.help();
3387
+ yargs.version();
3388
+ return yargs;
3389
+ };
3390
+ }
3391
+ const kCopyDoubleDash = Symbol("copyDoubleDash");
3392
+ const kCreateLogger = Symbol("copyDoubleDash");
3393
+ const kDeleteFromParserHintObject = Symbol("deleteFromParserHintObject");
3394
+ const kEmitWarning = Symbol("emitWarning");
3395
+ const kFreeze = Symbol("freeze");
3396
+ const kGetDollarZero = Symbol("getDollarZero");
3397
+ const kGetParserConfiguration = Symbol("getParserConfiguration");
3398
+ const kGetUsageConfiguration = Symbol("getUsageConfiguration");
3399
+ const kGuessLocale = Symbol("guessLocale");
3400
+ const kGuessVersion = Symbol("guessVersion");
3401
+ const kParsePositionalNumbers = Symbol("parsePositionalNumbers");
3402
+ const kPkgUp = Symbol("pkgUp");
3403
+ const kPopulateParserHintArray = Symbol("populateParserHintArray");
3404
+ const kPopulateParserHintSingleValueDictionary = Symbol("populateParserHintSingleValueDictionary");
3405
+ const kPopulateParserHintArrayDictionary = Symbol("populateParserHintArrayDictionary");
3406
+ const kPopulateParserHintDictionary = Symbol("populateParserHintDictionary");
3407
+ const kSanitizeKey = Symbol("sanitizeKey");
3408
+ const kSetKey = Symbol("setKey");
3409
+ const kUnfreeze = Symbol("unfreeze");
3410
+ const kValidateAsync = Symbol("validateAsync");
3411
+ const kGetCommandInstance = Symbol("getCommandInstance");
3412
+ const kGetContext = Symbol("getContext");
3413
+ const kGetHasOutput = Symbol("getHasOutput");
3414
+ const kGetLoggerInstance = Symbol("getLoggerInstance");
3415
+ const kGetParseContext = Symbol("getParseContext");
3416
+ const kGetUsageInstance = Symbol("getUsageInstance");
3417
+ const kGetValidationInstance = Symbol("getValidationInstance");
3418
+ const kHasParseCallback = Symbol("hasParseCallback");
3419
+ const kIsGlobalContext = Symbol("isGlobalContext");
3420
+ const kPostProcess = Symbol("postProcess");
3421
+ const kRebase = Symbol("rebase");
3422
+ const kReset = Symbol("reset");
3423
+ const kRunYargsParserAndExecuteCommands = Symbol("runYargsParserAndExecuteCommands");
3424
+ const kRunValidation = Symbol("runValidation");
3425
+ const kSetHasOutput = Symbol("setHasOutput");
3426
+ const kTrackManuallySetKeys = Symbol("kTrackManuallySetKeys");
3427
+ const DEFAULT_LOCALE = "en_US";
3428
+ var YargsInstance = class {
3429
+ constructor(processArgs = [], cwd, parentRequire, shim$2) {
3430
+ this.customScriptName = false;
3431
+ this.parsed = false;
3432
+ _YargsInstance_command.set(this, void 0);
3433
+ _YargsInstance_cwd.set(this, void 0);
3434
+ _YargsInstance_context.set(this, {
3435
+ commands: [],
3436
+ fullCommands: []
3437
+ });
3438
+ _YargsInstance_completion.set(this, null);
3439
+ _YargsInstance_completionCommand.set(this, null);
3440
+ _YargsInstance_defaultShowHiddenOpt.set(this, "show-hidden");
3441
+ _YargsInstance_exitError.set(this, null);
3442
+ _YargsInstance_detectLocale.set(this, true);
3443
+ _YargsInstance_emittedWarnings.set(this, {});
3444
+ _YargsInstance_exitProcess.set(this, true);
3445
+ _YargsInstance_frozens.set(this, []);
3446
+ _YargsInstance_globalMiddleware.set(this, void 0);
3447
+ _YargsInstance_groups.set(this, {});
3448
+ _YargsInstance_hasOutput.set(this, false);
3449
+ _YargsInstance_helpOpt.set(this, null);
3450
+ _YargsInstance_isGlobalContext.set(this, true);
3451
+ _YargsInstance_logger.set(this, void 0);
3452
+ _YargsInstance_output.set(this, "");
3453
+ _YargsInstance_options.set(this, void 0);
3454
+ _YargsInstance_parentRequire.set(this, void 0);
3455
+ _YargsInstance_parserConfig.set(this, {});
3456
+ _YargsInstance_parseFn.set(this, null);
3457
+ _YargsInstance_parseContext.set(this, null);
3458
+ _YargsInstance_pkgs.set(this, {});
3459
+ _YargsInstance_preservedGroups.set(this, {});
3460
+ _YargsInstance_processArgs.set(this, void 0);
3461
+ _YargsInstance_recommendCommands.set(this, false);
3462
+ _YargsInstance_shim.set(this, void 0);
3463
+ _YargsInstance_strict.set(this, false);
3464
+ _YargsInstance_strictCommands.set(this, false);
3465
+ _YargsInstance_strictOptions.set(this, false);
3466
+ _YargsInstance_usage.set(this, void 0);
3467
+ _YargsInstance_usageConfig.set(this, {});
3468
+ _YargsInstance_versionOpt.set(this, null);
3469
+ _YargsInstance_validation.set(this, void 0);
3470
+ __classPrivateFieldSet(this, _YargsInstance_shim, shim$2, "f");
3471
+ __classPrivateFieldSet(this, _YargsInstance_processArgs, processArgs, "f");
3472
+ __classPrivateFieldSet(this, _YargsInstance_cwd, cwd, "f");
3473
+ __classPrivateFieldSet(this, _YargsInstance_parentRequire, parentRequire, "f");
3474
+ __classPrivateFieldSet(this, _YargsInstance_globalMiddleware, new GlobalMiddleware(this), "f");
3475
+ this.$0 = this[kGetDollarZero]();
3476
+ this[kReset]();
3477
+ __classPrivateFieldSet(this, _YargsInstance_command, __classPrivateFieldGet(this, _YargsInstance_command, "f"), "f");
3478
+ __classPrivateFieldSet(this, _YargsInstance_usage, __classPrivateFieldGet(this, _YargsInstance_usage, "f"), "f");
3479
+ __classPrivateFieldSet(this, _YargsInstance_validation, __classPrivateFieldGet(this, _YargsInstance_validation, "f"), "f");
3480
+ __classPrivateFieldSet(this, _YargsInstance_options, __classPrivateFieldGet(this, _YargsInstance_options, "f"), "f");
3481
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").showHiddenOpt = __classPrivateFieldGet(this, _YargsInstance_defaultShowHiddenOpt, "f");
3482
+ __classPrivateFieldSet(this, _YargsInstance_logger, this[kCreateLogger](), "f");
3483
+ __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.setLocale(DEFAULT_LOCALE);
3484
+ }
3485
+ addHelpOpt(opt, msg) {
3486
+ const defaultHelpOpt = "help";
3487
+ argsert("[string|boolean] [string]", [opt, msg], arguments.length);
3488
+ if (__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f")) {
3489
+ this[kDeleteFromParserHintObject](__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f"));
3490
+ __classPrivateFieldSet(this, _YargsInstance_helpOpt, null, "f");
3491
+ }
3492
+ if (opt === false && msg === void 0) return this;
3493
+ __classPrivateFieldSet(this, _YargsInstance_helpOpt, typeof opt === "string" ? opt : defaultHelpOpt, "f");
3494
+ this.boolean(__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f"));
3495
+ this.describe(__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f"), msg || __classPrivateFieldGet(this, _YargsInstance_usage, "f").deferY18nLookup("Show help"));
3496
+ return this;
3497
+ }
3498
+ help(opt, msg) {
3499
+ return this.addHelpOpt(opt, msg);
3500
+ }
3501
+ addShowHiddenOpt(opt, msg) {
3502
+ argsert("[string|boolean] [string]", [opt, msg], arguments.length);
3503
+ if (opt === false && msg === void 0) return this;
3504
+ const showHiddenOpt = typeof opt === "string" ? opt : __classPrivateFieldGet(this, _YargsInstance_defaultShowHiddenOpt, "f");
3505
+ this.boolean(showHiddenOpt);
3506
+ this.describe(showHiddenOpt, msg || __classPrivateFieldGet(this, _YargsInstance_usage, "f").deferY18nLookup("Show hidden options"));
3507
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").showHiddenOpt = showHiddenOpt;
3508
+ return this;
3509
+ }
3510
+ showHidden(opt, msg) {
3511
+ return this.addShowHiddenOpt(opt, msg);
3512
+ }
3513
+ alias(key, value) {
3514
+ argsert("<object|string|array> [string|array]", [key, value], arguments.length);
3515
+ this[kPopulateParserHintArrayDictionary](this.alias.bind(this), "alias", key, value);
3516
+ return this;
3517
+ }
3518
+ array(keys) {
3519
+ argsert("<array|string>", [keys], arguments.length);
3520
+ this[kPopulateParserHintArray]("array", keys);
3521
+ this[kTrackManuallySetKeys](keys);
3522
+ return this;
3523
+ }
3524
+ boolean(keys) {
3525
+ argsert("<array|string>", [keys], arguments.length);
3526
+ this[kPopulateParserHintArray]("boolean", keys);
3527
+ this[kTrackManuallySetKeys](keys);
3528
+ return this;
3529
+ }
3530
+ check(f, global) {
3531
+ argsert("<function> [boolean]", [f, global], arguments.length);
3532
+ this.middleware((argv, _yargs) => {
3533
+ return maybeAsyncResult(() => {
3534
+ return f(argv, _yargs.getOptions());
3535
+ }, (result) => {
3536
+ if (!result) __classPrivateFieldGet(this, _YargsInstance_usage, "f").fail(__classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.__("Argument check failed: %s", f.toString()));
3537
+ else if (typeof result === "string" || result instanceof Error) __classPrivateFieldGet(this, _YargsInstance_usage, "f").fail(result.toString(), result);
3538
+ return argv;
3539
+ }, (err) => {
3540
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").fail(err.message ? err.message : err.toString(), err);
3541
+ return argv;
3542
+ });
3543
+ }, false, global);
3544
+ return this;
3545
+ }
3546
+ choices(key, value) {
3547
+ argsert("<object|string|array> [string|array]", [key, value], arguments.length);
3548
+ this[kPopulateParserHintArrayDictionary](this.choices.bind(this), "choices", key, value);
3549
+ return this;
3550
+ }
3551
+ coerce(keys, value) {
3552
+ argsert("<object|string|array> [function]", [keys, value], arguments.length);
3553
+ if (Array.isArray(keys)) {
3554
+ if (!value) throw new YError("coerce callback must be provided");
3555
+ for (const key of keys) this.coerce(key, value);
3556
+ return this;
3557
+ } else if (typeof keys === "object") {
3558
+ for (const key of Object.keys(keys)) this.coerce(key, keys[key]);
3559
+ return this;
3560
+ }
3561
+ if (!value) throw new YError("coerce callback must be provided");
3562
+ const coerceKey = keys;
3563
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").key[coerceKey] = true;
3564
+ __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").addCoerceMiddleware((argv, yargs) => {
3565
+ var _a$1;
3566
+ const coerceKeyAliases = (_a$1 = yargs.getAliases()[coerceKey]) !== null && _a$1 !== void 0 ? _a$1 : [];
3567
+ const argvKeys = [coerceKey, ...coerceKeyAliases].filter((key) => Object.prototype.hasOwnProperty.call(argv, key));
3568
+ if (argvKeys.length === 0) return argv;
3569
+ return maybeAsyncResult(() => {
3570
+ return value(argv[argvKeys[0]]);
3571
+ }, (result) => {
3572
+ argvKeys.forEach((key) => {
3573
+ argv[key] = result;
3574
+ });
3575
+ return argv;
3576
+ }, (err) => {
3577
+ throw new YError(err.message);
3578
+ });
3579
+ }, coerceKey);
3580
+ return this;
3581
+ }
3582
+ conflicts(key1, key2) {
3583
+ argsert("<string|object> [string|array]", [key1, key2], arguments.length);
3584
+ __classPrivateFieldGet(this, _YargsInstance_validation, "f").conflicts(key1, key2);
3585
+ return this;
3586
+ }
3587
+ config(key = "config", msg, parseFn) {
3588
+ argsert("[object|string] [string|function] [function]", [
3589
+ key,
3590
+ msg,
3591
+ parseFn
3592
+ ], arguments.length);
3593
+ if (typeof key === "object" && !Array.isArray(key)) {
3594
+ key = applyExtends(key, __classPrivateFieldGet(this, _YargsInstance_cwd, "f"), this[kGetParserConfiguration]()["deep-merge-config"] || false, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
3595
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects = (__classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects || []).concat(key);
3596
+ return this;
3597
+ }
3598
+ if (typeof msg === "function") {
3599
+ parseFn = msg;
3600
+ msg = void 0;
3601
+ }
3602
+ this.describe(key, msg || __classPrivateFieldGet(this, _YargsInstance_usage, "f").deferY18nLookup("Path to JSON config file"));
3603
+ (Array.isArray(key) ? key : [key]).forEach((k) => {
3604
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").config[k] = parseFn || true;
3605
+ });
3606
+ return this;
3607
+ }
3608
+ completion(cmd, desc, fn) {
3609
+ argsert("[string] [string|boolean|function] [function]", [
3610
+ cmd,
3611
+ desc,
3612
+ fn
3613
+ ], arguments.length);
3614
+ if (typeof desc === "function") {
3615
+ fn = desc;
3616
+ desc = void 0;
3617
+ }
3618
+ __classPrivateFieldSet(this, _YargsInstance_completionCommand, cmd || __classPrivateFieldGet(this, _YargsInstance_completionCommand, "f") || "completion", "f");
3619
+ if (!desc && desc !== false) desc = "generate completion script";
3620
+ this.command(__classPrivateFieldGet(this, _YargsInstance_completionCommand, "f"), desc);
3621
+ if (fn) __classPrivateFieldGet(this, _YargsInstance_completion, "f").registerFunction(fn);
3622
+ return this;
3623
+ }
3624
+ command(cmd, description, builder, handler, middlewares, deprecated) {
3625
+ argsert("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]", [
3626
+ cmd,
3627
+ description,
3628
+ builder,
3629
+ handler,
3630
+ middlewares,
3631
+ deprecated
3632
+ ], arguments.length);
3633
+ __classPrivateFieldGet(this, _YargsInstance_command, "f").addHandler(cmd, description, builder, handler, middlewares, deprecated);
3634
+ return this;
3635
+ }
3636
+ commands(cmd, description, builder, handler, middlewares, deprecated) {
3637
+ return this.command(cmd, description, builder, handler, middlewares, deprecated);
3638
+ }
3639
+ commandDir(dir, opts) {
3640
+ argsert("<string> [object]", [dir, opts], arguments.length);
3641
+ const req = __classPrivateFieldGet(this, _YargsInstance_parentRequire, "f") || __classPrivateFieldGet(this, _YargsInstance_shim, "f").require;
3642
+ __classPrivateFieldGet(this, _YargsInstance_command, "f").addDirectory(dir, req, __classPrivateFieldGet(this, _YargsInstance_shim, "f").getCallerFile(), opts);
3643
+ return this;
3644
+ }
3645
+ count(keys) {
3646
+ argsert("<array|string>", [keys], arguments.length);
3647
+ this[kPopulateParserHintArray]("count", keys);
3648
+ this[kTrackManuallySetKeys](keys);
3649
+ return this;
3650
+ }
3651
+ default(key, value, defaultDescription) {
3652
+ argsert("<object|string|array> [*] [string]", [
3653
+ key,
3654
+ value,
3655
+ defaultDescription
3656
+ ], arguments.length);
3657
+ if (defaultDescription) {
3658
+ assertSingleKey(key, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
3659
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").defaultDescription[key] = defaultDescription;
3660
+ }
3661
+ if (typeof value === "function") {
3662
+ assertSingleKey(key, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
3663
+ if (!__classPrivateFieldGet(this, _YargsInstance_options, "f").defaultDescription[key]) __classPrivateFieldGet(this, _YargsInstance_options, "f").defaultDescription[key] = __classPrivateFieldGet(this, _YargsInstance_usage, "f").functionDescription(value);
3664
+ value = value.call();
3665
+ }
3666
+ this[kPopulateParserHintSingleValueDictionary](this.default.bind(this), "default", key, value);
3667
+ return this;
3668
+ }
3669
+ defaults(key, value, defaultDescription) {
3670
+ return this.default(key, value, defaultDescription);
3671
+ }
3672
+ demandCommand(min = 1, max, minMsg, maxMsg) {
3673
+ argsert("[number] [number|string] [string|null|undefined] [string|null|undefined]", [
3674
+ min,
3675
+ max,
3676
+ minMsg,
3677
+ maxMsg
3678
+ ], arguments.length);
3679
+ if (typeof max !== "number") {
3680
+ minMsg = max;
3681
+ max = Infinity;
3682
+ }
3683
+ this.global("_", false);
3684
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").demandedCommands._ = {
3685
+ min,
3686
+ max,
3687
+ minMsg,
3688
+ maxMsg
3689
+ };
3690
+ return this;
3691
+ }
3692
+ demand(keys, max, msg) {
3693
+ if (Array.isArray(max)) {
3694
+ max.forEach((key) => {
3695
+ assertNotStrictEqual(msg, true, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
3696
+ this.demandOption(key, msg);
3697
+ });
3698
+ max = Infinity;
3699
+ } else if (typeof max !== "number") {
3700
+ msg = max;
3701
+ max = Infinity;
3702
+ }
3703
+ if (typeof keys === "number") {
3704
+ assertNotStrictEqual(msg, true, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
3705
+ this.demandCommand(keys, max, msg, msg);
3706
+ } else if (Array.isArray(keys)) keys.forEach((key) => {
3707
+ assertNotStrictEqual(msg, true, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
3708
+ this.demandOption(key, msg);
3709
+ });
3710
+ else if (typeof msg === "string") this.demandOption(keys, msg);
3711
+ else if (msg === true || typeof msg === "undefined") this.demandOption(keys);
3712
+ return this;
3713
+ }
3714
+ demandOption(keys, msg) {
3715
+ argsert("<object|string|array> [string]", [keys, msg], arguments.length);
3716
+ this[kPopulateParserHintSingleValueDictionary](this.demandOption.bind(this), "demandedOptions", keys, msg);
3717
+ return this;
3718
+ }
3719
+ deprecateOption(option, message) {
3720
+ argsert("<string> [string|boolean]", [option, message], arguments.length);
3721
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").deprecatedOptions[option] = message;
3722
+ return this;
3723
+ }
3724
+ describe(keys, description) {
3725
+ argsert("<object|string|array> [string]", [keys, description], arguments.length);
3726
+ this[kSetKey](keys, true);
3727
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").describe(keys, description);
3728
+ return this;
3729
+ }
3730
+ detectLocale(detect) {
3731
+ argsert("<boolean>", [detect], arguments.length);
3732
+ __classPrivateFieldSet(this, _YargsInstance_detectLocale, detect, "f");
3733
+ return this;
3734
+ }
3735
+ env(prefix) {
3736
+ argsert("[string|boolean]", [prefix], arguments.length);
3737
+ if (prefix === false) delete __classPrivateFieldGet(this, _YargsInstance_options, "f").envPrefix;
3738
+ else __classPrivateFieldGet(this, _YargsInstance_options, "f").envPrefix = prefix || "";
3739
+ return this;
3740
+ }
3741
+ epilogue(msg) {
3742
+ argsert("<string>", [msg], arguments.length);
3743
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").epilog(msg);
3744
+ return this;
3745
+ }
3746
+ epilog(msg) {
3747
+ return this.epilogue(msg);
3748
+ }
3749
+ example(cmd, description) {
3750
+ argsert("<string|array> [string]", [cmd, description], arguments.length);
3751
+ if (Array.isArray(cmd)) cmd.forEach((exampleParams) => this.example(...exampleParams));
3752
+ else __classPrivateFieldGet(this, _YargsInstance_usage, "f").example(cmd, description);
3753
+ return this;
3754
+ }
3755
+ exit(code, err) {
3756
+ __classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f");
3757
+ __classPrivateFieldSet(this, _YargsInstance_exitError, err, "f");
3758
+ if (__classPrivateFieldGet(this, _YargsInstance_exitProcess, "f")) __classPrivateFieldGet(this, _YargsInstance_shim, "f").process.exit(code);
3759
+ }
3760
+ exitProcess(enabled = true) {
3761
+ argsert("[boolean]", [enabled], arguments.length);
3762
+ __classPrivateFieldSet(this, _YargsInstance_exitProcess, enabled, "f");
3763
+ return this;
3764
+ }
3765
+ fail(f) {
3766
+ argsert("<function|boolean>", [f], arguments.length);
3767
+ if (typeof f === "boolean" && f !== false) throw new YError("Invalid first argument. Expected function or boolean 'false'");
3768
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").failFn(f);
3769
+ return this;
3770
+ }
3771
+ getAliases() {
3772
+ return this.parsed ? this.parsed.aliases : {};
3773
+ }
3774
+ async getCompletion(args, done) {
3775
+ argsert("<array> [function]", [args, done], arguments.length);
3776
+ if (!done) return new Promise((resolve$1, reject) => {
3777
+ __classPrivateFieldGet(this, _YargsInstance_completion, "f").getCompletion(args, (err, completions) => {
3778
+ if (err) reject(err);
3779
+ else resolve$1(completions);
3780
+ });
3781
+ });
3782
+ else return __classPrivateFieldGet(this, _YargsInstance_completion, "f").getCompletion(args, done);
3783
+ }
3784
+ getDemandedOptions() {
3785
+ argsert([], 0);
3786
+ return __classPrivateFieldGet(this, _YargsInstance_options, "f").demandedOptions;
3787
+ }
3788
+ getDemandedCommands() {
3789
+ argsert([], 0);
3790
+ return __classPrivateFieldGet(this, _YargsInstance_options, "f").demandedCommands;
3791
+ }
3792
+ getDeprecatedOptions() {
3793
+ argsert([], 0);
3794
+ return __classPrivateFieldGet(this, _YargsInstance_options, "f").deprecatedOptions;
3795
+ }
3796
+ getDetectLocale() {
3797
+ return __classPrivateFieldGet(this, _YargsInstance_detectLocale, "f");
3798
+ }
3799
+ getExitProcess() {
3800
+ return __classPrivateFieldGet(this, _YargsInstance_exitProcess, "f");
3801
+ }
3802
+ getGroups() {
3803
+ return Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_groups, "f"), __classPrivateFieldGet(this, _YargsInstance_preservedGroups, "f"));
3804
+ }
3805
+ getHelp() {
3806
+ __classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f");
3807
+ if (!__classPrivateFieldGet(this, _YargsInstance_usage, "f").hasCachedHelpMessage()) {
3808
+ if (!this.parsed) {
3809
+ const parse = this[kRunYargsParserAndExecuteCommands](__classPrivateFieldGet(this, _YargsInstance_processArgs, "f"), void 0, void 0, 0, true);
3810
+ if (isPromise(parse)) return parse.then(() => {
3811
+ return __classPrivateFieldGet(this, _YargsInstance_usage, "f").help();
3812
+ });
3813
+ }
3814
+ const builderResponse = __classPrivateFieldGet(this, _YargsInstance_command, "f").runDefaultBuilderOn(this);
3815
+ if (isPromise(builderResponse)) return builderResponse.then(() => {
3816
+ return __classPrivateFieldGet(this, _YargsInstance_usage, "f").help();
3817
+ });
3818
+ }
3819
+ return Promise.resolve(__classPrivateFieldGet(this, _YargsInstance_usage, "f").help());
3820
+ }
3821
+ getOptions() {
3822
+ return __classPrivateFieldGet(this, _YargsInstance_options, "f");
3823
+ }
3824
+ getStrict() {
3825
+ return __classPrivateFieldGet(this, _YargsInstance_strict, "f");
3826
+ }
3827
+ getStrictCommands() {
3828
+ return __classPrivateFieldGet(this, _YargsInstance_strictCommands, "f");
3829
+ }
3830
+ getStrictOptions() {
3831
+ return __classPrivateFieldGet(this, _YargsInstance_strictOptions, "f");
3832
+ }
3833
+ global(globals, global) {
3834
+ argsert("<string|array> [boolean]", [globals, global], arguments.length);
3835
+ globals = [].concat(globals);
3836
+ if (global !== false) __classPrivateFieldGet(this, _YargsInstance_options, "f").local = __classPrivateFieldGet(this, _YargsInstance_options, "f").local.filter((l) => globals.indexOf(l) === -1);
3837
+ else globals.forEach((g) => {
3838
+ if (!__classPrivateFieldGet(this, _YargsInstance_options, "f").local.includes(g)) __classPrivateFieldGet(this, _YargsInstance_options, "f").local.push(g);
3839
+ });
3840
+ return this;
3841
+ }
3842
+ group(opts, groupName) {
3843
+ argsert("<string|array> <string>", [opts, groupName], arguments.length);
3844
+ const existing = __classPrivateFieldGet(this, _YargsInstance_preservedGroups, "f")[groupName] || __classPrivateFieldGet(this, _YargsInstance_groups, "f")[groupName];
3845
+ if (__classPrivateFieldGet(this, _YargsInstance_preservedGroups, "f")[groupName]) delete __classPrivateFieldGet(this, _YargsInstance_preservedGroups, "f")[groupName];
3846
+ const seen = {};
3847
+ __classPrivateFieldGet(this, _YargsInstance_groups, "f")[groupName] = (existing || []).concat(opts).filter((key) => {
3848
+ if (seen[key]) return false;
3849
+ return seen[key] = true;
3850
+ });
3851
+ return this;
3852
+ }
3853
+ hide(key) {
3854
+ argsert("<string>", [key], arguments.length);
3855
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").hiddenOptions.push(key);
3856
+ return this;
3857
+ }
3858
+ implies(key, value) {
3859
+ argsert("<string|object> [number|string|array]", [key, value], arguments.length);
3860
+ __classPrivateFieldGet(this, _YargsInstance_validation, "f").implies(key, value);
3861
+ return this;
3862
+ }
3863
+ locale(locale) {
3864
+ argsert("[string]", [locale], arguments.length);
3865
+ if (locale === void 0) {
3866
+ this[kGuessLocale]();
3867
+ return __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.getLocale();
3868
+ }
3869
+ __classPrivateFieldSet(this, _YargsInstance_detectLocale, false, "f");
3870
+ __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.setLocale(locale);
3871
+ return this;
3872
+ }
3873
+ middleware(callback, applyBeforeValidation, global) {
3874
+ return __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").addMiddleware(callback, !!applyBeforeValidation, global);
3875
+ }
3876
+ nargs(key, value) {
3877
+ argsert("<string|object|array> [number]", [key, value], arguments.length);
3878
+ this[kPopulateParserHintSingleValueDictionary](this.nargs.bind(this), "narg", key, value);
3879
+ return this;
3880
+ }
3881
+ normalize(keys) {
3882
+ argsert("<array|string>", [keys], arguments.length);
3883
+ this[kPopulateParserHintArray]("normalize", keys);
3884
+ return this;
3885
+ }
3886
+ number(keys) {
3887
+ argsert("<array|string>", [keys], arguments.length);
3888
+ this[kPopulateParserHintArray]("number", keys);
3889
+ this[kTrackManuallySetKeys](keys);
3890
+ return this;
3891
+ }
3892
+ option(key, opt) {
3893
+ argsert("<string|object> [object]", [key, opt], arguments.length);
3894
+ if (typeof key === "object") Object.keys(key).forEach((k) => {
3895
+ this.options(k, key[k]);
3896
+ });
3897
+ else {
3898
+ if (typeof opt !== "object") opt = {};
3899
+ this[kTrackManuallySetKeys](key);
3900
+ if (__classPrivateFieldGet(this, _YargsInstance_versionOpt, "f") && (key === "version" || (opt === null || opt === void 0 ? void 0 : opt.alias) === "version")) this[kEmitWarning]([
3901
+ "\"version\" is a reserved word.",
3902
+ "Please do one of the following:",
3903
+ "- Disable version with `yargs.version(false)` if using \"version\" as an option",
3904
+ "- Use the built-in `yargs.version` method instead (if applicable)",
3905
+ "- Use a different option key",
3906
+ "https://yargs.js.org/docs/#api-reference-version"
3907
+ ].join("\n"), void 0, "versionWarning");
3908
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").key[key] = true;
3909
+ if (opt.alias) this.alias(key, opt.alias);
3910
+ const deprecate = opt.deprecate || opt.deprecated;
3911
+ if (deprecate) this.deprecateOption(key, deprecate);
3912
+ const demand = opt.demand || opt.required || opt.require;
3913
+ if (demand) this.demand(key, demand);
3914
+ if (opt.demandOption) this.demandOption(key, typeof opt.demandOption === "string" ? opt.demandOption : void 0);
3915
+ if (opt.conflicts) this.conflicts(key, opt.conflicts);
3916
+ if ("default" in opt) this.default(key, opt.default);
3917
+ if (opt.implies !== void 0) this.implies(key, opt.implies);
3918
+ if (opt.nargs !== void 0) this.nargs(key, opt.nargs);
3919
+ if (opt.config) this.config(key, opt.configParser);
3920
+ if (opt.normalize) this.normalize(key);
3921
+ if (opt.choices) this.choices(key, opt.choices);
3922
+ if (opt.coerce) this.coerce(key, opt.coerce);
3923
+ if (opt.group) this.group(key, opt.group);
3924
+ if (opt.boolean || opt.type === "boolean") {
3925
+ this.boolean(key);
3926
+ if (opt.alias) this.boolean(opt.alias);
3927
+ }
3928
+ if (opt.array || opt.type === "array") {
3929
+ this.array(key);
3930
+ if (opt.alias) this.array(opt.alias);
3931
+ }
3932
+ if (opt.number || opt.type === "number") {
3933
+ this.number(key);
3934
+ if (opt.alias) this.number(opt.alias);
3935
+ }
3936
+ if (opt.string || opt.type === "string") {
3937
+ this.string(key);
3938
+ if (opt.alias) this.string(opt.alias);
3939
+ }
3940
+ if (opt.count || opt.type === "count") this.count(key);
3941
+ if (typeof opt.global === "boolean") this.global(key, opt.global);
3942
+ if (opt.defaultDescription) __classPrivateFieldGet(this, _YargsInstance_options, "f").defaultDescription[key] = opt.defaultDescription;
3943
+ if (opt.skipValidation) this.skipValidation(key);
3944
+ const desc = opt.describe || opt.description || opt.desc;
3945
+ const descriptions = __classPrivateFieldGet(this, _YargsInstance_usage, "f").getDescriptions();
3946
+ if (!Object.prototype.hasOwnProperty.call(descriptions, key) || typeof desc === "string") this.describe(key, desc);
3947
+ if (opt.hidden) this.hide(key);
3948
+ if (opt.requiresArg) this.requiresArg(key);
3949
+ }
3950
+ return this;
3951
+ }
3952
+ options(key, opt) {
3953
+ return this.option(key, opt);
3954
+ }
3955
+ parse(args, shortCircuit, _parseFn) {
3956
+ argsert("[string|array] [function|boolean|object] [function]", [
3957
+ args,
3958
+ shortCircuit,
3959
+ _parseFn
3960
+ ], arguments.length);
3961
+ this[kFreeze]();
3962
+ if (typeof args === "undefined") args = __classPrivateFieldGet(this, _YargsInstance_processArgs, "f");
3963
+ if (typeof shortCircuit === "object") {
3964
+ __classPrivateFieldSet(this, _YargsInstance_parseContext, shortCircuit, "f");
3965
+ shortCircuit = _parseFn;
3966
+ }
3967
+ if (typeof shortCircuit === "function") {
3968
+ __classPrivateFieldSet(this, _YargsInstance_parseFn, shortCircuit, "f");
3969
+ shortCircuit = false;
3970
+ }
3971
+ if (!shortCircuit) __classPrivateFieldSet(this, _YargsInstance_processArgs, args, "f");
3972
+ if (__classPrivateFieldGet(this, _YargsInstance_parseFn, "f")) __classPrivateFieldSet(this, _YargsInstance_exitProcess, false, "f");
3973
+ const parsed = this[kRunYargsParserAndExecuteCommands](args, !!shortCircuit);
3974
+ const tmpParsed = this.parsed;
3975
+ __classPrivateFieldGet(this, _YargsInstance_completion, "f").setParsed(this.parsed);
3976
+ if (isPromise(parsed)) return parsed.then((argv) => {
3977
+ if (__classPrivateFieldGet(this, _YargsInstance_parseFn, "f")) __classPrivateFieldGet(this, _YargsInstance_parseFn, "f").call(this, __classPrivateFieldGet(this, _YargsInstance_exitError, "f"), argv, __classPrivateFieldGet(this, _YargsInstance_output, "f"));
3978
+ return argv;
3979
+ }).catch((err) => {
3980
+ if (__classPrivateFieldGet(this, _YargsInstance_parseFn, "f")) __classPrivateFieldGet(this, _YargsInstance_parseFn, "f")(err, this.parsed.argv, __classPrivateFieldGet(this, _YargsInstance_output, "f"));
3981
+ throw err;
3982
+ }).finally(() => {
3983
+ this[kUnfreeze]();
3984
+ this.parsed = tmpParsed;
3985
+ });
3986
+ else {
3987
+ if (__classPrivateFieldGet(this, _YargsInstance_parseFn, "f")) __classPrivateFieldGet(this, _YargsInstance_parseFn, "f").call(this, __classPrivateFieldGet(this, _YargsInstance_exitError, "f"), parsed, __classPrivateFieldGet(this, _YargsInstance_output, "f"));
3988
+ this[kUnfreeze]();
3989
+ this.parsed = tmpParsed;
3990
+ }
3991
+ return parsed;
3992
+ }
3993
+ parseAsync(args, shortCircuit, _parseFn) {
3994
+ const maybePromise = this.parse(args, shortCircuit, _parseFn);
3995
+ return !isPromise(maybePromise) ? Promise.resolve(maybePromise) : maybePromise;
3996
+ }
3997
+ parseSync(args, shortCircuit, _parseFn) {
3998
+ const maybePromise = this.parse(args, shortCircuit, _parseFn);
3999
+ if (isPromise(maybePromise)) throw new YError(".parseSync() must not be used with asynchronous builders, handlers, or middleware");
4000
+ return maybePromise;
4001
+ }
4002
+ parserConfiguration(config) {
4003
+ argsert("<object>", [config], arguments.length);
4004
+ __classPrivateFieldSet(this, _YargsInstance_parserConfig, config, "f");
4005
+ return this;
4006
+ }
4007
+ pkgConf(key, rootPath) {
4008
+ argsert("<string> [string]", [key, rootPath], arguments.length);
4009
+ let conf = null;
4010
+ const obj = this[kPkgUp](rootPath || __classPrivateFieldGet(this, _YargsInstance_cwd, "f"));
4011
+ if (obj[key] && typeof obj[key] === "object") {
4012
+ conf = applyExtends(obj[key], rootPath || __classPrivateFieldGet(this, _YargsInstance_cwd, "f"), this[kGetParserConfiguration]()["deep-merge-config"] || false, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
4013
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects = (__classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects || []).concat(conf);
4014
+ }
4015
+ return this;
4016
+ }
4017
+ positional(key, opts) {
4018
+ argsert("<string> <object>", [key, opts], arguments.length);
4019
+ const supportedOpts = [
4020
+ "default",
4021
+ "defaultDescription",
4022
+ "implies",
4023
+ "normalize",
4024
+ "choices",
4025
+ "conflicts",
4026
+ "coerce",
4027
+ "type",
4028
+ "describe",
4029
+ "desc",
4030
+ "description",
4031
+ "alias"
4032
+ ];
4033
+ opts = objFilter(opts, (k, v) => {
4034
+ if (k === "type" && ![
4035
+ "string",
4036
+ "number",
4037
+ "boolean"
4038
+ ].includes(v)) return false;
4039
+ return supportedOpts.includes(k);
4040
+ });
4041
+ const fullCommand = __classPrivateFieldGet(this, _YargsInstance_context, "f").fullCommands[__classPrivateFieldGet(this, _YargsInstance_context, "f").fullCommands.length - 1];
4042
+ const parseOptions = fullCommand ? __classPrivateFieldGet(this, _YargsInstance_command, "f").cmdToParseOptions(fullCommand) : {
4043
+ array: [],
4044
+ alias: {},
4045
+ default: {},
4046
+ demand: {}
4047
+ };
4048
+ objectKeys(parseOptions).forEach((pk) => {
4049
+ const parseOption = parseOptions[pk];
4050
+ if (Array.isArray(parseOption)) {
4051
+ if (parseOption.indexOf(key) !== -1) opts[pk] = true;
4052
+ } else if (parseOption[key] && !(pk in opts)) opts[pk] = parseOption[key];
4053
+ });
4054
+ this.group(key, __classPrivateFieldGet(this, _YargsInstance_usage, "f").getPositionalGroupName());
4055
+ return this.option(key, opts);
4056
+ }
4057
+ recommendCommands(recommend = true) {
4058
+ argsert("[boolean]", [recommend], arguments.length);
4059
+ __classPrivateFieldSet(this, _YargsInstance_recommendCommands, recommend, "f");
4060
+ return this;
4061
+ }
4062
+ required(keys, max, msg) {
4063
+ return this.demand(keys, max, msg);
4064
+ }
4065
+ require(keys, max, msg) {
4066
+ return this.demand(keys, max, msg);
4067
+ }
4068
+ requiresArg(keys) {
4069
+ argsert("<array|string|object> [number]", [keys], arguments.length);
4070
+ if (typeof keys === "string" && __classPrivateFieldGet(this, _YargsInstance_options, "f").narg[keys]) return this;
4071
+ else this[kPopulateParserHintSingleValueDictionary](this.requiresArg.bind(this), "narg", keys, NaN);
4072
+ return this;
4073
+ }
4074
+ showCompletionScript($0, cmd) {
4075
+ argsert("[string] [string]", [$0, cmd], arguments.length);
4076
+ $0 = $0 || this.$0;
4077
+ __classPrivateFieldGet(this, _YargsInstance_logger, "f").log(__classPrivateFieldGet(this, _YargsInstance_completion, "f").generateCompletionScript($0, cmd || __classPrivateFieldGet(this, _YargsInstance_completionCommand, "f") || "completion"));
4078
+ return this;
4079
+ }
4080
+ showHelp(level) {
4081
+ argsert("[string|function]", [level], arguments.length);
4082
+ __classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f");
4083
+ if (!__classPrivateFieldGet(this, _YargsInstance_usage, "f").hasCachedHelpMessage()) {
4084
+ if (!this.parsed) {
4085
+ const parse = this[kRunYargsParserAndExecuteCommands](__classPrivateFieldGet(this, _YargsInstance_processArgs, "f"), void 0, void 0, 0, true);
4086
+ if (isPromise(parse)) {
4087
+ parse.then(() => {
4088
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").showHelp(level);
4089
+ });
4090
+ return this;
4091
+ }
4092
+ }
4093
+ const builderResponse = __classPrivateFieldGet(this, _YargsInstance_command, "f").runDefaultBuilderOn(this);
4094
+ if (isPromise(builderResponse)) {
4095
+ builderResponse.then(() => {
4096
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").showHelp(level);
4097
+ });
4098
+ return this;
4099
+ }
4100
+ }
4101
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").showHelp(level);
4102
+ return this;
4103
+ }
4104
+ scriptName(scriptName) {
4105
+ this.customScriptName = true;
4106
+ this.$0 = scriptName;
4107
+ return this;
4108
+ }
4109
+ showHelpOnFail(enabled, message) {
4110
+ argsert("[boolean|string] [string]", [enabled, message], arguments.length);
4111
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").showHelpOnFail(enabled, message);
4112
+ return this;
4113
+ }
4114
+ showVersion(level) {
4115
+ argsert("[string|function]", [level], arguments.length);
4116
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").showVersion(level);
4117
+ return this;
4118
+ }
4119
+ skipValidation(keys) {
4120
+ argsert("<array|string>", [keys], arguments.length);
4121
+ this[kPopulateParserHintArray]("skipValidation", keys);
4122
+ return this;
4123
+ }
4124
+ strict(enabled) {
4125
+ argsert("[boolean]", [enabled], arguments.length);
4126
+ __classPrivateFieldSet(this, _YargsInstance_strict, enabled !== false, "f");
4127
+ return this;
4128
+ }
4129
+ strictCommands(enabled) {
4130
+ argsert("[boolean]", [enabled], arguments.length);
4131
+ __classPrivateFieldSet(this, _YargsInstance_strictCommands, enabled !== false, "f");
4132
+ return this;
4133
+ }
4134
+ strictOptions(enabled) {
4135
+ argsert("[boolean]", [enabled], arguments.length);
4136
+ __classPrivateFieldSet(this, _YargsInstance_strictOptions, enabled !== false, "f");
4137
+ return this;
4138
+ }
4139
+ string(keys) {
4140
+ argsert("<array|string>", [keys], arguments.length);
4141
+ this[kPopulateParserHintArray]("string", keys);
4142
+ this[kTrackManuallySetKeys](keys);
4143
+ return this;
4144
+ }
4145
+ terminalWidth() {
4146
+ argsert([], 0);
4147
+ return __classPrivateFieldGet(this, _YargsInstance_shim, "f").process.stdColumns;
4148
+ }
4149
+ updateLocale(obj) {
4150
+ return this.updateStrings(obj);
4151
+ }
4152
+ updateStrings(obj) {
4153
+ argsert("<object>", [obj], arguments.length);
4154
+ __classPrivateFieldSet(this, _YargsInstance_detectLocale, false, "f");
4155
+ __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.updateLocale(obj);
4156
+ return this;
4157
+ }
4158
+ usage(msg, description, builder, handler) {
4159
+ argsert("<string|null|undefined> [string|boolean] [function|object] [function]", [
4160
+ msg,
4161
+ description,
4162
+ builder,
4163
+ handler
4164
+ ], arguments.length);
4165
+ if (description !== void 0) {
4166
+ assertNotStrictEqual(msg, null, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
4167
+ if ((msg || "").match(/^\$0( |$)/)) return this.command(msg, description, builder, handler);
4168
+ else throw new YError(".usage() description must start with $0 if being used as alias for .command()");
4169
+ } else {
4170
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").usage(msg);
4171
+ return this;
4172
+ }
4173
+ }
4174
+ usageConfiguration(config) {
4175
+ argsert("<object>", [config], arguments.length);
4176
+ __classPrivateFieldSet(this, _YargsInstance_usageConfig, config, "f");
4177
+ return this;
4178
+ }
4179
+ version(opt, msg, ver) {
4180
+ const defaultVersionOpt = "version";
4181
+ argsert("[boolean|string] [string] [string]", [
4182
+ opt,
4183
+ msg,
4184
+ ver
4185
+ ], arguments.length);
4186
+ if (__classPrivateFieldGet(this, _YargsInstance_versionOpt, "f")) {
4187
+ this[kDeleteFromParserHintObject](__classPrivateFieldGet(this, _YargsInstance_versionOpt, "f"));
4188
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").version(void 0);
4189
+ __classPrivateFieldSet(this, _YargsInstance_versionOpt, null, "f");
4190
+ }
4191
+ if (arguments.length === 0) {
4192
+ ver = this[kGuessVersion]();
4193
+ opt = defaultVersionOpt;
4194
+ } else if (arguments.length === 1) {
4195
+ if (opt === false) return this;
4196
+ ver = opt;
4197
+ opt = defaultVersionOpt;
4198
+ } else if (arguments.length === 2) {
4199
+ ver = msg;
4200
+ msg = void 0;
4201
+ }
4202
+ __classPrivateFieldSet(this, _YargsInstance_versionOpt, typeof opt === "string" ? opt : defaultVersionOpt, "f");
4203
+ msg = msg || __classPrivateFieldGet(this, _YargsInstance_usage, "f").deferY18nLookup("Show version number");
4204
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").version(ver || void 0);
4205
+ this.boolean(__classPrivateFieldGet(this, _YargsInstance_versionOpt, "f"));
4206
+ this.describe(__classPrivateFieldGet(this, _YargsInstance_versionOpt, "f"), msg);
4207
+ return this;
4208
+ }
4209
+ wrap(cols) {
4210
+ argsert("<number|null|undefined>", [cols], arguments.length);
4211
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").wrap(cols);
4212
+ return this;
4213
+ }
4214
+ [(_YargsInstance_command = /* @__PURE__ */ new WeakMap(), _YargsInstance_cwd = /* @__PURE__ */ new WeakMap(), _YargsInstance_context = /* @__PURE__ */ new WeakMap(), _YargsInstance_completion = /* @__PURE__ */ new WeakMap(), _YargsInstance_completionCommand = /* @__PURE__ */ new WeakMap(), _YargsInstance_defaultShowHiddenOpt = /* @__PURE__ */ new WeakMap(), _YargsInstance_exitError = /* @__PURE__ */ new WeakMap(), _YargsInstance_detectLocale = /* @__PURE__ */ new WeakMap(), _YargsInstance_emittedWarnings = /* @__PURE__ */ new WeakMap(), _YargsInstance_exitProcess = /* @__PURE__ */ new WeakMap(), _YargsInstance_frozens = /* @__PURE__ */ new WeakMap(), _YargsInstance_globalMiddleware = /* @__PURE__ */ new WeakMap(), _YargsInstance_groups = /* @__PURE__ */ new WeakMap(), _YargsInstance_hasOutput = /* @__PURE__ */ new WeakMap(), _YargsInstance_helpOpt = /* @__PURE__ */ new WeakMap(), _YargsInstance_isGlobalContext = /* @__PURE__ */ new WeakMap(), _YargsInstance_logger = /* @__PURE__ */ new WeakMap(), _YargsInstance_output = /* @__PURE__ */ new WeakMap(), _YargsInstance_options = /* @__PURE__ */ new WeakMap(), _YargsInstance_parentRequire = /* @__PURE__ */ new WeakMap(), _YargsInstance_parserConfig = /* @__PURE__ */ new WeakMap(), _YargsInstance_parseFn = /* @__PURE__ */ new WeakMap(), _YargsInstance_parseContext = /* @__PURE__ */ new WeakMap(), _YargsInstance_pkgs = /* @__PURE__ */ new WeakMap(), _YargsInstance_preservedGroups = /* @__PURE__ */ new WeakMap(), _YargsInstance_processArgs = /* @__PURE__ */ new WeakMap(), _YargsInstance_recommendCommands = /* @__PURE__ */ new WeakMap(), _YargsInstance_shim = /* @__PURE__ */ new WeakMap(), _YargsInstance_strict = /* @__PURE__ */ new WeakMap(), _YargsInstance_strictCommands = /* @__PURE__ */ new WeakMap(), _YargsInstance_strictOptions = /* @__PURE__ */ new WeakMap(), _YargsInstance_usage = /* @__PURE__ */ new WeakMap(), _YargsInstance_usageConfig = /* @__PURE__ */ new WeakMap(), _YargsInstance_versionOpt = /* @__PURE__ */ new WeakMap(), _YargsInstance_validation = /* @__PURE__ */ new WeakMap(), kCopyDoubleDash)](argv) {
4215
+ if (!argv._ || !argv["--"]) return argv;
4216
+ argv._.push.apply(argv._, argv["--"]);
4217
+ try {
4218
+ delete argv["--"];
4219
+ } catch (_err) {}
4220
+ return argv;
4221
+ }
4222
+ [kCreateLogger]() {
4223
+ return {
4224
+ log: (...args) => {
4225
+ if (!this[kHasParseCallback]()) console.log(...args);
4226
+ __classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f");
4227
+ if (__classPrivateFieldGet(this, _YargsInstance_output, "f").length) __classPrivateFieldSet(this, _YargsInstance_output, __classPrivateFieldGet(this, _YargsInstance_output, "f") + "\n", "f");
4228
+ __classPrivateFieldSet(this, _YargsInstance_output, __classPrivateFieldGet(this, _YargsInstance_output, "f") + args.join(" "), "f");
4229
+ },
4230
+ error: (...args) => {
4231
+ if (!this[kHasParseCallback]()) console.error(...args);
4232
+ __classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f");
4233
+ if (__classPrivateFieldGet(this, _YargsInstance_output, "f").length) __classPrivateFieldSet(this, _YargsInstance_output, __classPrivateFieldGet(this, _YargsInstance_output, "f") + "\n", "f");
4234
+ __classPrivateFieldSet(this, _YargsInstance_output, __classPrivateFieldGet(this, _YargsInstance_output, "f") + args.join(" "), "f");
4235
+ }
4236
+ };
4237
+ }
4238
+ [kDeleteFromParserHintObject](optionKey) {
4239
+ objectKeys(__classPrivateFieldGet(this, _YargsInstance_options, "f")).forEach((hintKey) => {
4240
+ if (((key) => key === "configObjects")(hintKey)) return;
4241
+ const hint = __classPrivateFieldGet(this, _YargsInstance_options, "f")[hintKey];
4242
+ if (Array.isArray(hint)) {
4243
+ if (hint.includes(optionKey)) hint.splice(hint.indexOf(optionKey), 1);
4244
+ } else if (typeof hint === "object") delete hint[optionKey];
4245
+ });
4246
+ delete __classPrivateFieldGet(this, _YargsInstance_usage, "f").getDescriptions()[optionKey];
4247
+ }
4248
+ [kEmitWarning](warning, type$1, deduplicationId) {
4249
+ if (!__classPrivateFieldGet(this, _YargsInstance_emittedWarnings, "f")[deduplicationId]) {
4250
+ __classPrivateFieldGet(this, _YargsInstance_shim, "f").process.emitWarning(warning, type$1);
4251
+ __classPrivateFieldGet(this, _YargsInstance_emittedWarnings, "f")[deduplicationId] = true;
4252
+ }
4253
+ }
4254
+ [kFreeze]() {
4255
+ __classPrivateFieldGet(this, _YargsInstance_frozens, "f").push({
4256
+ options: __classPrivateFieldGet(this, _YargsInstance_options, "f"),
4257
+ configObjects: __classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects.slice(0),
4258
+ exitProcess: __classPrivateFieldGet(this, _YargsInstance_exitProcess, "f"),
4259
+ groups: __classPrivateFieldGet(this, _YargsInstance_groups, "f"),
4260
+ strict: __classPrivateFieldGet(this, _YargsInstance_strict, "f"),
4261
+ strictCommands: __classPrivateFieldGet(this, _YargsInstance_strictCommands, "f"),
4262
+ strictOptions: __classPrivateFieldGet(this, _YargsInstance_strictOptions, "f"),
4263
+ completionCommand: __classPrivateFieldGet(this, _YargsInstance_completionCommand, "f"),
4264
+ output: __classPrivateFieldGet(this, _YargsInstance_output, "f"),
4265
+ exitError: __classPrivateFieldGet(this, _YargsInstance_exitError, "f"),
4266
+ hasOutput: __classPrivateFieldGet(this, _YargsInstance_hasOutput, "f"),
4267
+ parsed: this.parsed,
4268
+ parseFn: __classPrivateFieldGet(this, _YargsInstance_parseFn, "f"),
4269
+ parseContext: __classPrivateFieldGet(this, _YargsInstance_parseContext, "f")
4270
+ });
4271
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").freeze();
4272
+ __classPrivateFieldGet(this, _YargsInstance_validation, "f").freeze();
4273
+ __classPrivateFieldGet(this, _YargsInstance_command, "f").freeze();
4274
+ __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").freeze();
4275
+ }
4276
+ [kGetDollarZero]() {
4277
+ let $0 = "";
4278
+ let default$0;
4279
+ if (/\b(node|iojs|electron)(\.exe)?$/.test(__classPrivateFieldGet(this, _YargsInstance_shim, "f").process.argv()[0])) default$0 = __classPrivateFieldGet(this, _YargsInstance_shim, "f").process.argv().slice(1, 2);
4280
+ else default$0 = __classPrivateFieldGet(this, _YargsInstance_shim, "f").process.argv().slice(0, 1);
4281
+ $0 = default$0.map((x) => {
4282
+ const b = this[kRebase](__classPrivateFieldGet(this, _YargsInstance_cwd, "f"), x);
4283
+ return x.match(/^(\/|([a-zA-Z]:)?\\)/) && b.length < x.length ? b : x;
4284
+ }).join(" ").trim();
4285
+ if (__classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv("_") && __classPrivateFieldGet(this, _YargsInstance_shim, "f").getProcessArgvBin() === __classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv("_")) $0 = __classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv("_").replace(`${__classPrivateFieldGet(this, _YargsInstance_shim, "f").path.dirname(__classPrivateFieldGet(this, _YargsInstance_shim, "f").process.execPath())}/`, "");
4286
+ return $0;
4287
+ }
4288
+ [kGetParserConfiguration]() {
4289
+ return __classPrivateFieldGet(this, _YargsInstance_parserConfig, "f");
4290
+ }
4291
+ [kGetUsageConfiguration]() {
4292
+ return __classPrivateFieldGet(this, _YargsInstance_usageConfig, "f");
4293
+ }
4294
+ [kGuessLocale]() {
4295
+ if (!__classPrivateFieldGet(this, _YargsInstance_detectLocale, "f")) return;
4296
+ const locale = __classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv("LC_ALL") || __classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv("LC_MESSAGES") || __classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv("LANG") || __classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv("LANGUAGE") || "en_US";
4297
+ this.locale(locale.replace(/[.:].*/, ""));
4298
+ }
4299
+ [kGuessVersion]() {
4300
+ const obj = this[kPkgUp]();
4301
+ return obj.version || "unknown";
4302
+ }
4303
+ [kParsePositionalNumbers](argv) {
4304
+ const args = argv["--"] ? argv["--"] : argv._;
4305
+ for (let i = 0, arg; (arg = args[i]) !== void 0; i++) if (__classPrivateFieldGet(this, _YargsInstance_shim, "f").Parser.looksLikeNumber(arg) && Number.isSafeInteger(Math.floor(parseFloat(`${arg}`)))) args[i] = Number(arg);
4306
+ return argv;
4307
+ }
4308
+ [kPkgUp](rootPath) {
4309
+ const npath = rootPath || "*";
4310
+ if (__classPrivateFieldGet(this, _YargsInstance_pkgs, "f")[npath]) return __classPrivateFieldGet(this, _YargsInstance_pkgs, "f")[npath];
4311
+ let obj = {};
4312
+ try {
4313
+ let startDir = rootPath || __classPrivateFieldGet(this, _YargsInstance_shim, "f").mainFilename;
4314
+ if (__classPrivateFieldGet(this, _YargsInstance_shim, "f").path.extname(startDir)) startDir = __classPrivateFieldGet(this, _YargsInstance_shim, "f").path.dirname(startDir);
4315
+ const pkgJsonPath = __classPrivateFieldGet(this, _YargsInstance_shim, "f").findUp(startDir, (dir, names) => {
4316
+ if (names.includes("package.json")) return "package.json";
4317
+ else return void 0;
4318
+ });
4319
+ assertNotStrictEqual(pkgJsonPath, void 0, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
4320
+ obj = JSON.parse(__classPrivateFieldGet(this, _YargsInstance_shim, "f").readFileSync(pkgJsonPath, "utf8"));
4321
+ } catch (_noop) {}
4322
+ __classPrivateFieldGet(this, _YargsInstance_pkgs, "f")[npath] = obj || {};
4323
+ return __classPrivateFieldGet(this, _YargsInstance_pkgs, "f")[npath];
4324
+ }
4325
+ [kPopulateParserHintArray](type$1, keys) {
4326
+ keys = [].concat(keys);
4327
+ keys.forEach((key) => {
4328
+ key = this[kSanitizeKey](key);
4329
+ __classPrivateFieldGet(this, _YargsInstance_options, "f")[type$1].push(key);
4330
+ });
4331
+ }
4332
+ [kPopulateParserHintSingleValueDictionary](builder, type$1, key, value) {
4333
+ this[kPopulateParserHintDictionary](builder, type$1, key, value, (type$2, key$1, value$1) => {
4334
+ __classPrivateFieldGet(this, _YargsInstance_options, "f")[type$2][key$1] = value$1;
4335
+ });
4336
+ }
4337
+ [kPopulateParserHintArrayDictionary](builder, type$1, key, value) {
4338
+ this[kPopulateParserHintDictionary](builder, type$1, key, value, (type$2, key$1, value$1) => {
4339
+ __classPrivateFieldGet(this, _YargsInstance_options, "f")[type$2][key$1] = (__classPrivateFieldGet(this, _YargsInstance_options, "f")[type$2][key$1] || []).concat(value$1);
4340
+ });
4341
+ }
4342
+ [kPopulateParserHintDictionary](builder, type$1, key, value, singleKeyHandler) {
4343
+ if (Array.isArray(key)) key.forEach((k) => {
4344
+ builder(k, value);
4345
+ });
4346
+ else if (((key$1) => typeof key$1 === "object")(key)) for (const k of objectKeys(key)) builder(k, key[k]);
4347
+ else singleKeyHandler(type$1, this[kSanitizeKey](key), value);
4348
+ }
4349
+ [kSanitizeKey](key) {
4350
+ if (key === "__proto__") return "___proto___";
4351
+ return key;
4352
+ }
4353
+ [kSetKey](key, set) {
4354
+ this[kPopulateParserHintSingleValueDictionary](this[kSetKey].bind(this), "key", key, set);
4355
+ return this;
4356
+ }
4357
+ [kUnfreeze]() {
4358
+ var _a$1, _b$1, _c$1, _d, _e, _f, _g, _h, _j, _k, _l, _m;
4359
+ const frozen = __classPrivateFieldGet(this, _YargsInstance_frozens, "f").pop();
4360
+ assertNotStrictEqual(frozen, void 0, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
4361
+ let configObjects;
4362
+ _a$1 = this, _b$1 = this, _c$1 = this, _d = this, _e = this, _f = this, _g = this, _h = this, _j = this, _k = this, _l = this, _m = this, {options: { set value(_o) {
4363
+ __classPrivateFieldSet(_a$1, _YargsInstance_options, _o, "f");
4364
+ } }.value, configObjects, exitProcess: { set value(_o) {
4365
+ __classPrivateFieldSet(_b$1, _YargsInstance_exitProcess, _o, "f");
4366
+ } }.value, groups: { set value(_o) {
4367
+ __classPrivateFieldSet(_c$1, _YargsInstance_groups, _o, "f");
4368
+ } }.value, output: { set value(_o) {
4369
+ __classPrivateFieldSet(_d, _YargsInstance_output, _o, "f");
4370
+ } }.value, exitError: { set value(_o) {
4371
+ __classPrivateFieldSet(_e, _YargsInstance_exitError, _o, "f");
4372
+ } }.value, hasOutput: { set value(_o) {
4373
+ __classPrivateFieldSet(_f, _YargsInstance_hasOutput, _o, "f");
4374
+ } }.value, parsed: this.parsed, strict: { set value(_o) {
4375
+ __classPrivateFieldSet(_g, _YargsInstance_strict, _o, "f");
4376
+ } }.value, strictCommands: { set value(_o) {
4377
+ __classPrivateFieldSet(_h, _YargsInstance_strictCommands, _o, "f");
4378
+ } }.value, strictOptions: { set value(_o) {
4379
+ __classPrivateFieldSet(_j, _YargsInstance_strictOptions, _o, "f");
4380
+ } }.value, completionCommand: { set value(_o) {
4381
+ __classPrivateFieldSet(_k, _YargsInstance_completionCommand, _o, "f");
4382
+ } }.value, parseFn: { set value(_o) {
4383
+ __classPrivateFieldSet(_l, _YargsInstance_parseFn, _o, "f");
4384
+ } }.value, parseContext: { set value(_o) {
4385
+ __classPrivateFieldSet(_m, _YargsInstance_parseContext, _o, "f");
4386
+ } }.value} = frozen;
4387
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects = configObjects;
4388
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").unfreeze();
4389
+ __classPrivateFieldGet(this, _YargsInstance_validation, "f").unfreeze();
4390
+ __classPrivateFieldGet(this, _YargsInstance_command, "f").unfreeze();
4391
+ __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").unfreeze();
4392
+ }
4393
+ [kValidateAsync](validation$1, argv) {
4394
+ return maybeAsyncResult(argv, (result) => {
4395
+ validation$1(result);
4396
+ return result;
4397
+ });
4398
+ }
4399
+ getInternalMethods() {
4400
+ return {
4401
+ getCommandInstance: this[kGetCommandInstance].bind(this),
4402
+ getContext: this[kGetContext].bind(this),
4403
+ getHasOutput: this[kGetHasOutput].bind(this),
4404
+ getLoggerInstance: this[kGetLoggerInstance].bind(this),
4405
+ getParseContext: this[kGetParseContext].bind(this),
4406
+ getParserConfiguration: this[kGetParserConfiguration].bind(this),
4407
+ getUsageConfiguration: this[kGetUsageConfiguration].bind(this),
4408
+ getUsageInstance: this[kGetUsageInstance].bind(this),
4409
+ getValidationInstance: this[kGetValidationInstance].bind(this),
4410
+ hasParseCallback: this[kHasParseCallback].bind(this),
4411
+ isGlobalContext: this[kIsGlobalContext].bind(this),
4412
+ postProcess: this[kPostProcess].bind(this),
4413
+ reset: this[kReset].bind(this),
4414
+ runValidation: this[kRunValidation].bind(this),
4415
+ runYargsParserAndExecuteCommands: this[kRunYargsParserAndExecuteCommands].bind(this),
4416
+ setHasOutput: this[kSetHasOutput].bind(this)
4417
+ };
4418
+ }
4419
+ [kGetCommandInstance]() {
4420
+ return __classPrivateFieldGet(this, _YargsInstance_command, "f");
4421
+ }
4422
+ [kGetContext]() {
4423
+ return __classPrivateFieldGet(this, _YargsInstance_context, "f");
4424
+ }
4425
+ [kGetHasOutput]() {
4426
+ return __classPrivateFieldGet(this, _YargsInstance_hasOutput, "f");
4427
+ }
4428
+ [kGetLoggerInstance]() {
4429
+ return __classPrivateFieldGet(this, _YargsInstance_logger, "f");
4430
+ }
4431
+ [kGetParseContext]() {
4432
+ return __classPrivateFieldGet(this, _YargsInstance_parseContext, "f") || {};
4433
+ }
4434
+ [kGetUsageInstance]() {
4435
+ return __classPrivateFieldGet(this, _YargsInstance_usage, "f");
4436
+ }
4437
+ [kGetValidationInstance]() {
4438
+ return __classPrivateFieldGet(this, _YargsInstance_validation, "f");
4439
+ }
4440
+ [kHasParseCallback]() {
4441
+ return !!__classPrivateFieldGet(this, _YargsInstance_parseFn, "f");
4442
+ }
4443
+ [kIsGlobalContext]() {
4444
+ return __classPrivateFieldGet(this, _YargsInstance_isGlobalContext, "f");
4445
+ }
4446
+ [kPostProcess](argv, populateDoubleDash, calledFromCommand, runGlobalMiddleware) {
4447
+ if (calledFromCommand) return argv;
4448
+ if (isPromise(argv)) return argv;
4449
+ if (!populateDoubleDash) argv = this[kCopyDoubleDash](argv);
4450
+ const parsePositionalNumbers = this[kGetParserConfiguration]()["parse-positional-numbers"] || this[kGetParserConfiguration]()["parse-positional-numbers"] === void 0;
4451
+ if (parsePositionalNumbers) argv = this[kParsePositionalNumbers](argv);
4452
+ if (runGlobalMiddleware) argv = applyMiddleware(argv, this, __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").getMiddleware(), false);
4453
+ return argv;
4454
+ }
4455
+ [kReset](aliases = {}) {
4456
+ __classPrivateFieldSet(this, _YargsInstance_options, __classPrivateFieldGet(this, _YargsInstance_options, "f") || {}, "f");
4457
+ const tmpOptions = {};
4458
+ tmpOptions.local = __classPrivateFieldGet(this, _YargsInstance_options, "f").local || [];
4459
+ tmpOptions.configObjects = __classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects || [];
4460
+ const localLookup = {};
4461
+ tmpOptions.local.forEach((l) => {
4462
+ localLookup[l] = true;
4463
+ (aliases[l] || []).forEach((a) => {
4464
+ localLookup[a] = true;
4465
+ });
4466
+ });
4467
+ Object.assign(__classPrivateFieldGet(this, _YargsInstance_preservedGroups, "f"), Object.keys(__classPrivateFieldGet(this, _YargsInstance_groups, "f")).reduce((acc, groupName) => {
4468
+ const keys = __classPrivateFieldGet(this, _YargsInstance_groups, "f")[groupName].filter((key) => !(key in localLookup));
4469
+ if (keys.length > 0) acc[groupName] = keys;
4470
+ return acc;
4471
+ }, {}));
4472
+ __classPrivateFieldSet(this, _YargsInstance_groups, {}, "f");
4473
+ const arrayOptions = [
4474
+ "array",
4475
+ "boolean",
4476
+ "string",
4477
+ "skipValidation",
4478
+ "count",
4479
+ "normalize",
4480
+ "number",
4481
+ "hiddenOptions"
4482
+ ];
4483
+ const objectOptions = [
4484
+ "narg",
4485
+ "key",
4486
+ "alias",
4487
+ "default",
4488
+ "defaultDescription",
4489
+ "config",
4490
+ "choices",
4491
+ "demandedOptions",
4492
+ "demandedCommands",
4493
+ "deprecatedOptions"
4494
+ ];
4495
+ arrayOptions.forEach((k) => {
4496
+ tmpOptions[k] = (__classPrivateFieldGet(this, _YargsInstance_options, "f")[k] || []).filter((k$1) => !localLookup[k$1]);
4497
+ });
4498
+ objectOptions.forEach((k) => {
4499
+ tmpOptions[k] = objFilter(__classPrivateFieldGet(this, _YargsInstance_options, "f")[k], (k$1) => !localLookup[k$1]);
4500
+ });
4501
+ tmpOptions.envPrefix = __classPrivateFieldGet(this, _YargsInstance_options, "f").envPrefix;
4502
+ __classPrivateFieldSet(this, _YargsInstance_options, tmpOptions, "f");
4503
+ __classPrivateFieldSet(this, _YargsInstance_usage, __classPrivateFieldGet(this, _YargsInstance_usage, "f") ? __classPrivateFieldGet(this, _YargsInstance_usage, "f").reset(localLookup) : usage(this, __classPrivateFieldGet(this, _YargsInstance_shim, "f")), "f");
4504
+ __classPrivateFieldSet(this, _YargsInstance_validation, __classPrivateFieldGet(this, _YargsInstance_validation, "f") ? __classPrivateFieldGet(this, _YargsInstance_validation, "f").reset(localLookup) : validation(this, __classPrivateFieldGet(this, _YargsInstance_usage, "f"), __classPrivateFieldGet(this, _YargsInstance_shim, "f")), "f");
4505
+ __classPrivateFieldSet(this, _YargsInstance_command, __classPrivateFieldGet(this, _YargsInstance_command, "f") ? __classPrivateFieldGet(this, _YargsInstance_command, "f").reset() : command(__classPrivateFieldGet(this, _YargsInstance_usage, "f"), __classPrivateFieldGet(this, _YargsInstance_validation, "f"), __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f"), __classPrivateFieldGet(this, _YargsInstance_shim, "f")), "f");
4506
+ if (!__classPrivateFieldGet(this, _YargsInstance_completion, "f")) __classPrivateFieldSet(this, _YargsInstance_completion, completion(this, __classPrivateFieldGet(this, _YargsInstance_usage, "f"), __classPrivateFieldGet(this, _YargsInstance_command, "f"), __classPrivateFieldGet(this, _YargsInstance_shim, "f")), "f");
4507
+ __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").reset();
4508
+ __classPrivateFieldSet(this, _YargsInstance_completionCommand, null, "f");
4509
+ __classPrivateFieldSet(this, _YargsInstance_output, "", "f");
4510
+ __classPrivateFieldSet(this, _YargsInstance_exitError, null, "f");
4511
+ __classPrivateFieldSet(this, _YargsInstance_hasOutput, false, "f");
4512
+ this.parsed = false;
4513
+ return this;
4514
+ }
4515
+ [kRebase](base, dir) {
4516
+ return __classPrivateFieldGet(this, _YargsInstance_shim, "f").path.relative(base, dir);
4517
+ }
4518
+ [kRunYargsParserAndExecuteCommands](args, shortCircuit, calledFromCommand, commandIndex = 0, helpOnly = false) {
4519
+ var _a$1, _b$1, _c$1, _d;
4520
+ let skipValidation = !!calledFromCommand || helpOnly;
4521
+ args = args || __classPrivateFieldGet(this, _YargsInstance_processArgs, "f");
4522
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").__ = __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.__;
4523
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").configuration = this[kGetParserConfiguration]();
4524
+ const populateDoubleDash = !!__classPrivateFieldGet(this, _YargsInstance_options, "f").configuration["populate--"];
4525
+ const config = Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f").configuration, { "populate--": true });
4526
+ const parsed = __classPrivateFieldGet(this, _YargsInstance_shim, "f").Parser.detailed(args, Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f"), { configuration: {
4527
+ "parse-positional-numbers": false,
4528
+ ...config
4529
+ } }));
4530
+ const argv = Object.assign(parsed.argv, __classPrivateFieldGet(this, _YargsInstance_parseContext, "f"));
4531
+ let argvPromise = void 0;
4532
+ const aliases = parsed.aliases;
4533
+ let helpOptSet = false;
4534
+ let versionOptSet = false;
4535
+ Object.keys(argv).forEach((key) => {
4536
+ if (key === __classPrivateFieldGet(this, _YargsInstance_helpOpt, "f") && argv[key]) helpOptSet = true;
4537
+ else if (key === __classPrivateFieldGet(this, _YargsInstance_versionOpt, "f") && argv[key]) versionOptSet = true;
4538
+ });
4539
+ argv.$0 = this.$0;
4540
+ this.parsed = parsed;
4541
+ if (commandIndex === 0) __classPrivateFieldGet(this, _YargsInstance_usage, "f").clearCachedHelpMessage();
4542
+ try {
4543
+ this[kGuessLocale]();
4544
+ if (shortCircuit) return this[kPostProcess](argv, populateDoubleDash, !!calledFromCommand, false);
4545
+ if (__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f")) {
4546
+ const helpCmds = [__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f")].concat(aliases[__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f")] || []).filter((k) => k.length > 1);
4547
+ if (helpCmds.includes("" + argv._[argv._.length - 1])) {
4548
+ argv._.pop();
4549
+ helpOptSet = true;
4550
+ }
4551
+ }
4552
+ __classPrivateFieldSet(this, _YargsInstance_isGlobalContext, false, "f");
4553
+ const handlerKeys = __classPrivateFieldGet(this, _YargsInstance_command, "f").getCommands();
4554
+ const requestCompletions = ((_a$1 = __classPrivateFieldGet(this, _YargsInstance_completion, "f")) === null || _a$1 === void 0 ? void 0 : _a$1.completionKey) ? [(_b$1 = __classPrivateFieldGet(this, _YargsInstance_completion, "f")) === null || _b$1 === void 0 ? void 0 : _b$1.completionKey, ...(_d = this.getAliases()[(_c$1 = __classPrivateFieldGet(this, _YargsInstance_completion, "f")) === null || _c$1 === void 0 ? void 0 : _c$1.completionKey]) !== null && _d !== void 0 ? _d : []].some((key) => Object.prototype.hasOwnProperty.call(argv, key)) : false;
4555
+ const skipRecommendation = helpOptSet || requestCompletions || helpOnly;
4556
+ if (argv._.length) {
4557
+ if (handlerKeys.length) {
4558
+ let firstUnknownCommand;
4559
+ for (let i = commandIndex || 0, cmd; argv._[i] !== void 0; i++) {
4560
+ cmd = String(argv._[i]);
4561
+ if (handlerKeys.includes(cmd) && cmd !== __classPrivateFieldGet(this, _YargsInstance_completionCommand, "f")) {
4562
+ const innerArgv = __classPrivateFieldGet(this, _YargsInstance_command, "f").runCommand(cmd, this, parsed, i + 1, helpOnly, helpOptSet || versionOptSet || helpOnly);
4563
+ return this[kPostProcess](innerArgv, populateDoubleDash, !!calledFromCommand, false);
4564
+ } else if (!firstUnknownCommand && cmd !== __classPrivateFieldGet(this, _YargsInstance_completionCommand, "f")) {
4565
+ firstUnknownCommand = cmd;
4566
+ break;
4567
+ }
4568
+ }
4569
+ if (!__classPrivateFieldGet(this, _YargsInstance_command, "f").hasDefaultCommand() && __classPrivateFieldGet(this, _YargsInstance_recommendCommands, "f") && firstUnknownCommand && !skipRecommendation) __classPrivateFieldGet(this, _YargsInstance_validation, "f").recommendCommands(firstUnknownCommand, handlerKeys);
4570
+ }
4571
+ if (__classPrivateFieldGet(this, _YargsInstance_completionCommand, "f") && argv._.includes(__classPrivateFieldGet(this, _YargsInstance_completionCommand, "f")) && !requestCompletions) {
4572
+ if (__classPrivateFieldGet(this, _YargsInstance_exitProcess, "f")) setBlocking(true);
4573
+ this.showCompletionScript();
4574
+ this.exit(0);
4575
+ }
4576
+ }
4577
+ if (__classPrivateFieldGet(this, _YargsInstance_command, "f").hasDefaultCommand() && !skipRecommendation) {
4578
+ const innerArgv = __classPrivateFieldGet(this, _YargsInstance_command, "f").runCommand(null, this, parsed, 0, helpOnly, helpOptSet || versionOptSet || helpOnly);
4579
+ return this[kPostProcess](innerArgv, populateDoubleDash, !!calledFromCommand, false);
4580
+ }
4581
+ if (requestCompletions) {
4582
+ if (__classPrivateFieldGet(this, _YargsInstance_exitProcess, "f")) setBlocking(true);
4583
+ args = [].concat(args);
4584
+ const completionArgs = args.slice(args.indexOf(`--${__classPrivateFieldGet(this, _YargsInstance_completion, "f").completionKey}`) + 1);
4585
+ __classPrivateFieldGet(this, _YargsInstance_completion, "f").getCompletion(completionArgs, (err, completions) => {
4586
+ if (err) throw new YError(err.message);
4587
+ (completions || []).forEach((completion$1) => {
4588
+ __classPrivateFieldGet(this, _YargsInstance_logger, "f").log(completion$1);
4589
+ });
4590
+ this.exit(0);
4591
+ });
4592
+ return this[kPostProcess](argv, !populateDoubleDash, !!calledFromCommand, false);
4593
+ }
4594
+ if (!__classPrivateFieldGet(this, _YargsInstance_hasOutput, "f")) {
4595
+ if (helpOptSet) {
4596
+ if (__classPrivateFieldGet(this, _YargsInstance_exitProcess, "f")) setBlocking(true);
4597
+ skipValidation = true;
4598
+ this.showHelp((message) => {
4599
+ __classPrivateFieldGet(this, _YargsInstance_logger, "f").log(message);
4600
+ this.exit(0);
4601
+ });
4602
+ } else if (versionOptSet) {
4603
+ if (__classPrivateFieldGet(this, _YargsInstance_exitProcess, "f")) setBlocking(true);
4604
+ skipValidation = true;
4605
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").showVersion("log");
4606
+ this.exit(0);
4607
+ }
4608
+ }
4609
+ if (!skipValidation && __classPrivateFieldGet(this, _YargsInstance_options, "f").skipValidation.length > 0) skipValidation = Object.keys(argv).some((key) => __classPrivateFieldGet(this, _YargsInstance_options, "f").skipValidation.indexOf(key) >= 0 && argv[key] === true);
4610
+ if (!skipValidation) {
4611
+ if (parsed.error) throw new YError(parsed.error.message);
4612
+ if (!requestCompletions) {
4613
+ const validation$1 = this[kRunValidation](aliases, {}, parsed.error);
4614
+ if (!calledFromCommand) argvPromise = applyMiddleware(argv, this, __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").getMiddleware(), true);
4615
+ argvPromise = this[kValidateAsync](validation$1, argvPromise !== null && argvPromise !== void 0 ? argvPromise : argv);
4616
+ if (isPromise(argvPromise) && !calledFromCommand) argvPromise = argvPromise.then(() => {
4617
+ return applyMiddleware(argv, this, __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").getMiddleware(), false);
4618
+ });
4619
+ }
4620
+ }
4621
+ } catch (err) {
4622
+ if (err instanceof YError) __classPrivateFieldGet(this, _YargsInstance_usage, "f").fail(err.message, err);
4623
+ else throw err;
4624
+ }
4625
+ return this[kPostProcess](argvPromise !== null && argvPromise !== void 0 ? argvPromise : argv, populateDoubleDash, !!calledFromCommand, true);
4626
+ }
4627
+ [kRunValidation](aliases, positionalMap, parseErrors, isDefaultCommand) {
4628
+ const demandedOptions = { ...this.getDemandedOptions() };
4629
+ return (argv) => {
4630
+ if (parseErrors) throw new YError(parseErrors.message);
4631
+ __classPrivateFieldGet(this, _YargsInstance_validation, "f").nonOptionCount(argv);
4632
+ __classPrivateFieldGet(this, _YargsInstance_validation, "f").requiredArguments(argv, demandedOptions);
4633
+ let failedStrictCommands = false;
4634
+ if (__classPrivateFieldGet(this, _YargsInstance_strictCommands, "f")) failedStrictCommands = __classPrivateFieldGet(this, _YargsInstance_validation, "f").unknownCommands(argv);
4635
+ if (__classPrivateFieldGet(this, _YargsInstance_strict, "f") && !failedStrictCommands) __classPrivateFieldGet(this, _YargsInstance_validation, "f").unknownArguments(argv, aliases, positionalMap, !!isDefaultCommand);
4636
+ else if (__classPrivateFieldGet(this, _YargsInstance_strictOptions, "f")) __classPrivateFieldGet(this, _YargsInstance_validation, "f").unknownArguments(argv, aliases, {}, false, false);
4637
+ __classPrivateFieldGet(this, _YargsInstance_validation, "f").limitedChoices(argv);
4638
+ __classPrivateFieldGet(this, _YargsInstance_validation, "f").implications(argv);
4639
+ __classPrivateFieldGet(this, _YargsInstance_validation, "f").conflicting(argv);
4640
+ };
4641
+ }
4642
+ [kSetHasOutput]() {
4643
+ __classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f");
4644
+ }
4645
+ [kTrackManuallySetKeys](keys) {
4646
+ if (typeof keys === "string") __classPrivateFieldGet(this, _YargsInstance_options, "f").key[keys] = true;
4647
+ else for (const k of keys) __classPrivateFieldGet(this, _YargsInstance_options, "f").key[k] = true;
4648
+ }
4649
+ };
4650
+ function isYargsInstance(y) {
4651
+ return !!y && typeof y.getInternalMethods === "function";
4652
+ }
4653
+
4654
+ //#endregion
4655
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/index.mjs
4656
+ const Yargs = YargsFactory(esm_default);
4657
+ var yargs_default = Yargs;
4658
+
4659
+ //#endregion
4660
+ //#region package.json
4661
+ var name = "@jixo/cli";
4662
+ var version = "0.20.0";
4663
+ var type = "module";
4664
+ var bin = { "jixo": "./bundle/index.js" };
4665
+ var files = ["dist"];
4666
+ var scripts = {
4667
+ "build": "pnpm run '/^b\\:.*/'",
4668
+ "b:ts": "tsc --build",
4669
+ "b:bundle": "tsdown",
4670
+ "gen-prompts": "node ./scripts/gen-prompts.ts"
4671
+ };
4672
+ var exports = { ".": "./dist/index.js" };
4673
+ var dependencies = {
4674
+ "@jixo/dev": "workspace:^",
4675
+ "import-meta-ponyfill": "^3.2.2",
4676
+ "ts-pattern": "^5.7.1",
4677
+ "tslib": "^2.8.1",
4678
+ "yargs": "^18.0.0",
4679
+ "zod": "^4.0.0"
4680
+ };
4681
+ var devDependencies = {
4682
+ "@parcel/watcher": "^2.5.1",
4683
+ "@types/debug": "^4.1.12",
4684
+ "@types/json-schema": "^7.0.15",
4685
+ "@types/ms": "^2.1.0",
4686
+ "@types/node": "^24.1.0",
4687
+ "@types/semver": "^7.7.0",
4688
+ "@types/yargs": "^17.0.33"
4689
+ };
4690
+ var package_default = {
4691
+ name,
4692
+ version,
4693
+ type,
4694
+ bin,
4695
+ files,
4696
+ scripts,
4697
+ exports,
4698
+ dependencies,
4699
+ devDependencies
4700
+ };
4701
+
4702
+ //#endregion
4703
+ //#region src/cli.ts
4704
+ process.removeAllListeners("warning");
4705
+ const runCli = async (args = process.argv) => {
4706
+ let cli = yargs_default(hideBin(args)).scriptName("jixo").version(package_default.version).demandCommand(1, "You need at least one command before moving on").strict().help();
4707
+ const __dirname$1 = path.dirname(fileURLToPath(import.meta.url));
4708
+ const commandsDir = path.join(__dirname$1, "commands");
4709
+ const commandFiles = fs.readdirSync(commandsDir).filter((file) => file.endsWith(".js") || file.endsWith(".ts"));
4710
+ for (const file of commandFiles) {
4711
+ const commandModule = await import(path.join(commandsDir, file));
4712
+ for (const key in commandModule) if (typeof commandModule[key] === "object" && commandModule[key].command) cli = cli.command(commandModule[key]);
4713
+ }
4714
+ const argv = await cli.parse();
4715
+ if (argv._.length === 0) {
4716
+ cli.showHelp();
4717
+ console.log(" " + "─".repeat(Math.max(4, process.stdout.columns - 2)));
4718
+ }
4719
+ };
4720
+ if (import_meta_ponyfill_esmodule(import.meta).main) runCli();
4721
+
4722
+ //#endregion
4723
+ export { runCli };