@ui-tars-test/cli 0.3.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.
Files changed (49) hide show
  1. package/README.md +231 -0
  2. package/bin/index.js +13 -0
  3. package/dist/337.js +1396 -0
  4. package/dist/337.js.LICENSE.txt +14 -0
  5. package/dist/337.js.map +1 -0
  6. package/dist/337.mjs +1395 -0
  7. package/dist/337.mjs.LICENSE.txt +14 -0
  8. package/dist/337.mjs.map +1 -0
  9. package/dist/597.js +19 -0
  10. package/dist/597.mjs +18 -0
  11. package/dist/663.js +98 -0
  12. package/dist/663.js.map +1 -0
  13. package/dist/663.mjs +97 -0
  14. package/dist/663.mjs.map +1 -0
  15. package/dist/760.js +2957 -0
  16. package/dist/760.js.map +1 -0
  17. package/dist/760.mjs +2956 -0
  18. package/dist/760.mjs.map +1 -0
  19. package/dist/940.js +1013 -0
  20. package/dist/940.js.map +1 -0
  21. package/dist/940.mjs +1011 -0
  22. package/dist/940.mjs.map +1 -0
  23. package/dist/955.js +317 -0
  24. package/dist/955.js.map +1 -0
  25. package/dist/955.mjs +317 -0
  26. package/dist/955.mjs.map +1 -0
  27. package/dist/bundle/index.js +299060 -0
  28. package/dist/cli/commands.js +75 -0
  29. package/dist/cli/commands.js.map +1 -0
  30. package/dist/cli/commands.mjs +41 -0
  31. package/dist/cli/commands.mjs.map +1 -0
  32. package/dist/cli/start.js +447 -0
  33. package/dist/cli/start.js.map +1 -0
  34. package/dist/cli/start.mjs +396 -0
  35. package/dist/cli/start.mjs.map +1 -0
  36. package/dist/gui-agent-macos +0 -0
  37. package/dist/index.js +14 -0
  38. package/dist/index.js.LICENSE.txt +471 -0
  39. package/dist/index.js.map +1 -0
  40. package/dist/index.mjs +8 -0
  41. package/dist/index.mjs.LICENSE.txt +471 -0
  42. package/dist/index.mjs.map +1 -0
  43. package/dist/src/cli/commands.d.ts +2 -0
  44. package/dist/src/cli/commands.d.ts.map +1 -0
  45. package/dist/src/cli/start.d.ts +11 -0
  46. package/dist/src/cli/start.d.ts.map +1 -0
  47. package/dist/src/index.d.ts +2 -0
  48. package/dist/src/index.d.ts.map +1 -0
  49. package/package.json +59 -0
package/dist/337.js ADDED
@@ -0,0 +1,1396 @@
1
+ /**
2
+ * Copyright (c) 2025 Bytedance, Inc. and its affiliates.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ /*! For license information please see 337.js.LICENSE.txt */
6
+ "use strict";
7
+ exports.ids = [
8
+ "337"
9
+ ];
10
+ exports.modules = {
11
+ "../../node_modules/.pnpm/yargs-parser@21.1.1/node_modules/yargs-parser/build/lib/index.js": function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
12
+ __webpack_require__.d(__webpack_exports__, {
13
+ Z: ()=>lib
14
+ });
15
+ var external_util_ = __webpack_require__("util");
16
+ var external_path_ = __webpack_require__("path");
17
+ /**
18
+ * @license
19
+ * Copyright (c) 2016, Contributors
20
+ * SPDX-License-Identifier: ISC
21
+ */ function camelCase(str) {
22
+ const isCamelCase = str !== str.toLowerCase() && str !== str.toUpperCase();
23
+ if (!isCamelCase) str = str.toLowerCase();
24
+ if (-1 === str.indexOf('-') && -1 === str.indexOf('_')) return str;
25
+ {
26
+ let camelcase = '';
27
+ let nextChrUpper = false;
28
+ const leadingHyphens = str.match(/^-+/);
29
+ for(let i = leadingHyphens ? leadingHyphens[0].length : 0; i < str.length; i++){
30
+ let chr = str.charAt(i);
31
+ if (nextChrUpper) {
32
+ nextChrUpper = false;
33
+ chr = chr.toUpperCase();
34
+ }
35
+ if (0 !== i && ('-' === chr || '_' === chr)) nextChrUpper = true;
36
+ else if ('-' !== chr && '_' !== chr) camelcase += chr;
37
+ }
38
+ return camelcase;
39
+ }
40
+ }
41
+ function decamelize(str, joinString) {
42
+ const lowercase = str.toLowerCase();
43
+ joinString = joinString || '-';
44
+ let notCamelcase = '';
45
+ for(let i = 0; i < str.length; i++){
46
+ const chrLower = lowercase.charAt(i);
47
+ const chrString = str.charAt(i);
48
+ if (chrLower !== chrString && i > 0) notCamelcase += `${joinString}${lowercase.charAt(i)}`;
49
+ else notCamelcase += chrString;
50
+ }
51
+ return notCamelcase;
52
+ }
53
+ function looksLikeNumber(x) {
54
+ if (null == x) return false;
55
+ if ('number' == typeof x) return true;
56
+ if (/^0x[0-9a-f]+$/i.test(x)) return true;
57
+ if (/^0[^.]/.test(x)) return false;
58
+ return /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
59
+ }
60
+ /**
61
+ * @license
62
+ * Copyright (c) 2016, Contributors
63
+ * SPDX-License-Identifier: ISC
64
+ */ function tokenizeArgString(argString) {
65
+ if (Array.isArray(argString)) return argString.map((e)=>'string' != typeof e ? e + '' : e);
66
+ argString = argString.trim();
67
+ let i = 0;
68
+ let prevC = null;
69
+ let c = null;
70
+ let opening = null;
71
+ const args = [];
72
+ for(let ii = 0; ii < argString.length; ii++){
73
+ prevC = c;
74
+ c = argString.charAt(ii);
75
+ if (' ' === c && !opening) {
76
+ if (' ' !== prevC) i++;
77
+ continue;
78
+ }
79
+ if (c === opening) opening = null;
80
+ else if (("'" === c || '"' === c) && !opening) opening = c;
81
+ if (!args[i]) args[i] = '';
82
+ args[i] += c;
83
+ }
84
+ return args;
85
+ }
86
+ /**
87
+ * @license
88
+ * Copyright (c) 2016, Contributors
89
+ * SPDX-License-Identifier: ISC
90
+ */ var yargs_parser_types_DefaultValuesForTypeKey;
91
+ (function(DefaultValuesForTypeKey) {
92
+ DefaultValuesForTypeKey["BOOLEAN"] = "boolean";
93
+ DefaultValuesForTypeKey["STRING"] = "string";
94
+ DefaultValuesForTypeKey["NUMBER"] = "number";
95
+ DefaultValuesForTypeKey["ARRAY"] = "array";
96
+ })(yargs_parser_types_DefaultValuesForTypeKey || (yargs_parser_types_DefaultValuesForTypeKey = {}));
97
+ /**
98
+ * @license
99
+ * Copyright (c) 2016, Contributors
100
+ * SPDX-License-Identifier: ISC
101
+ */ let mixin;
102
+ class YargsParser {
103
+ constructor(_mixin){
104
+ mixin = _mixin;
105
+ }
106
+ parse(argsInput, options) {
107
+ const opts = Object.assign({
108
+ alias: void 0,
109
+ array: void 0,
110
+ boolean: void 0,
111
+ config: void 0,
112
+ configObjects: void 0,
113
+ configuration: void 0,
114
+ coerce: void 0,
115
+ count: void 0,
116
+ default: void 0,
117
+ envPrefix: void 0,
118
+ narg: void 0,
119
+ normalize: void 0,
120
+ string: void 0,
121
+ number: void 0,
122
+ __: void 0,
123
+ key: void 0
124
+ }, options);
125
+ const args = tokenizeArgString(argsInput);
126
+ const inputIsString = 'string' == typeof argsInput;
127
+ const aliases = combineAliases(Object.assign(Object.create(null), opts.alias));
128
+ const configuration = Object.assign({
129
+ 'boolean-negation': true,
130
+ 'camel-case-expansion': true,
131
+ 'combine-arrays': false,
132
+ 'dot-notation': true,
133
+ 'duplicate-arguments-array': true,
134
+ 'flatten-duplicate-arrays': true,
135
+ 'greedy-arrays': true,
136
+ 'halt-at-non-option': false,
137
+ 'nargs-eats-options': false,
138
+ 'negation-prefix': 'no-',
139
+ 'parse-numbers': true,
140
+ 'parse-positional-numbers': true,
141
+ 'populate--': false,
142
+ 'set-placeholder-key': false,
143
+ 'short-option-groups': true,
144
+ 'strip-aliased': false,
145
+ 'strip-dashed': false,
146
+ 'unknown-options-as-args': false
147
+ }, opts.configuration);
148
+ const defaults = Object.assign(Object.create(null), opts.default);
149
+ const configObjects = opts.configObjects || [];
150
+ const envPrefix = opts.envPrefix;
151
+ const notFlagsOption = configuration['populate--'];
152
+ const notFlagsArgv = notFlagsOption ? '--' : '_';
153
+ const newAliases = Object.create(null);
154
+ const defaulted = Object.create(null);
155
+ const __ = opts.__ || mixin.format;
156
+ const flags = {
157
+ aliases: Object.create(null),
158
+ arrays: Object.create(null),
159
+ bools: Object.create(null),
160
+ strings: Object.create(null),
161
+ numbers: Object.create(null),
162
+ counts: Object.create(null),
163
+ normalize: Object.create(null),
164
+ configs: Object.create(null),
165
+ nargs: Object.create(null),
166
+ coercions: Object.create(null),
167
+ keys: []
168
+ };
169
+ const negative = /^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/;
170
+ const negatedBoolean = new RegExp('^--' + configuration['negation-prefix'] + '(.+)');
171
+ [].concat(opts.array || []).filter(Boolean).forEach(function(opt) {
172
+ const key = 'object' == typeof opt ? opt.key : opt;
173
+ const assignment = Object.keys(opt).map(function(key) {
174
+ const arrayFlagKeys = {
175
+ boolean: 'bools',
176
+ string: 'strings',
177
+ number: 'numbers'
178
+ };
179
+ return arrayFlagKeys[key];
180
+ }).filter(Boolean).pop();
181
+ if (assignment) flags[assignment][key] = true;
182
+ flags.arrays[key] = true;
183
+ flags.keys.push(key);
184
+ });
185
+ [].concat(opts.boolean || []).filter(Boolean).forEach(function(key) {
186
+ flags.bools[key] = true;
187
+ flags.keys.push(key);
188
+ });
189
+ [].concat(opts.string || []).filter(Boolean).forEach(function(key) {
190
+ flags.strings[key] = true;
191
+ flags.keys.push(key);
192
+ });
193
+ [].concat(opts.number || []).filter(Boolean).forEach(function(key) {
194
+ flags.numbers[key] = true;
195
+ flags.keys.push(key);
196
+ });
197
+ [].concat(opts.count || []).filter(Boolean).forEach(function(key) {
198
+ flags.counts[key] = true;
199
+ flags.keys.push(key);
200
+ });
201
+ [].concat(opts.normalize || []).filter(Boolean).forEach(function(key) {
202
+ flags.normalize[key] = true;
203
+ flags.keys.push(key);
204
+ });
205
+ if ('object' == typeof opts.narg) Object.entries(opts.narg).forEach(([key, value])=>{
206
+ if ('number' == typeof value) {
207
+ flags.nargs[key] = value;
208
+ flags.keys.push(key);
209
+ }
210
+ });
211
+ if ('object' == typeof opts.coerce) Object.entries(opts.coerce).forEach(([key, value])=>{
212
+ if ('function' == typeof value) {
213
+ flags.coercions[key] = value;
214
+ flags.keys.push(key);
215
+ }
216
+ });
217
+ if (void 0 !== opts.config) {
218
+ if (Array.isArray(opts.config) || 'string' == typeof opts.config) [].concat(opts.config).filter(Boolean).forEach(function(key) {
219
+ flags.configs[key] = true;
220
+ });
221
+ else if ('object' == typeof opts.config) Object.entries(opts.config).forEach(([key, value])=>{
222
+ if ('boolean' == typeof value || 'function' == typeof value) flags.configs[key] = value;
223
+ });
224
+ }
225
+ extendAliases(opts.key, aliases, opts.default, flags.arrays);
226
+ Object.keys(defaults).forEach(function(key) {
227
+ (flags.aliases[key] || []).forEach(function(alias) {
228
+ defaults[alias] = defaults[key];
229
+ });
230
+ });
231
+ let error = null;
232
+ checkConfiguration();
233
+ let notFlags = [];
234
+ const argv = Object.assign(Object.create(null), {
235
+ _: []
236
+ });
237
+ const argvReturn = {};
238
+ for(let i = 0; i < args.length; i++){
239
+ const arg = args[i];
240
+ const truncatedArg = arg.replace(/^-{3,}/, '---');
241
+ let broken;
242
+ let key;
243
+ let letters;
244
+ let m;
245
+ let next;
246
+ let value;
247
+ if ('--' !== arg && /^-/.test(arg) && isUnknownOptionAsArg(arg)) pushPositional(arg);
248
+ else if (truncatedArg.match(/^---+(=|$)/)) {
249
+ pushPositional(arg);
250
+ continue;
251
+ } else if (arg.match(/^--.+=/) || !configuration['short-option-groups'] && arg.match(/^-.+=/)) {
252
+ m = arg.match(/^--?([^=]+)=([\s\S]*)$/);
253
+ if (null !== m && Array.isArray(m) && m.length >= 3) if (checkAllAliases(m[1], flags.arrays)) i = eatArray(i, m[1], args, m[2]);
254
+ else if (false !== checkAllAliases(m[1], flags.nargs)) i = eatNargs(i, m[1], args, m[2]);
255
+ else setArg(m[1], m[2], true);
256
+ } else if (arg.match(negatedBoolean) && configuration['boolean-negation']) {
257
+ m = arg.match(negatedBoolean);
258
+ if (null !== m && Array.isArray(m) && m.length >= 2) {
259
+ key = m[1];
260
+ setArg(key, checkAllAliases(key, flags.arrays) ? [
261
+ false
262
+ ] : false);
263
+ }
264
+ } else if (arg.match(/^--.+/) || !configuration['short-option-groups'] && arg.match(/^-[^-]+/)) {
265
+ m = arg.match(/^--?(.+)/);
266
+ if (null !== m && Array.isArray(m) && m.length >= 2) {
267
+ key = m[1];
268
+ if (checkAllAliases(key, flags.arrays)) i = eatArray(i, key, args);
269
+ else if (false !== checkAllAliases(key, flags.nargs)) i = eatNargs(i, key, args);
270
+ else {
271
+ next = args[i + 1];
272
+ if (void 0 !== next && (!next.match(/^-/) || next.match(negative)) && !checkAllAliases(key, flags.bools) && !checkAllAliases(key, flags.counts)) {
273
+ setArg(key, next);
274
+ i++;
275
+ } else if (/^(true|false)$/.test(next)) {
276
+ setArg(key, next);
277
+ i++;
278
+ } else setArg(key, defaultValue(key));
279
+ }
280
+ }
281
+ } else if (arg.match(/^-.\..+=/)) {
282
+ m = arg.match(/^-([^=]+)=([\s\S]*)$/);
283
+ if (null !== m && Array.isArray(m) && m.length >= 3) setArg(m[1], m[2]);
284
+ } else if (arg.match(/^-.\..+/) && !arg.match(negative)) {
285
+ next = args[i + 1];
286
+ m = arg.match(/^-(.\..+)/);
287
+ if (null !== m && Array.isArray(m) && m.length >= 2) {
288
+ key = m[1];
289
+ if (void 0 === next || next.match(/^-/) || checkAllAliases(key, flags.bools) || checkAllAliases(key, flags.counts)) setArg(key, defaultValue(key));
290
+ else {
291
+ setArg(key, next);
292
+ i++;
293
+ }
294
+ }
295
+ } else if (arg.match(/^-[^-]+/) && !arg.match(negative)) {
296
+ letters = arg.slice(1, -1).split('');
297
+ broken = false;
298
+ for(let j = 0; j < letters.length; j++){
299
+ next = arg.slice(j + 2);
300
+ if (letters[j + 1] && '=' === letters[j + 1]) {
301
+ value = arg.slice(j + 3);
302
+ key = letters[j];
303
+ if (checkAllAliases(key, flags.arrays)) i = eatArray(i, key, args, value);
304
+ else if (false !== checkAllAliases(key, flags.nargs)) i = eatNargs(i, key, args, value);
305
+ else setArg(key, value);
306
+ broken = true;
307
+ break;
308
+ }
309
+ if ('-' === next) {
310
+ setArg(letters[j], next);
311
+ continue;
312
+ }
313
+ if (/[A-Za-z]/.test(letters[j]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next) && false === checkAllAliases(next, flags.bools)) {
314
+ setArg(letters[j], next);
315
+ broken = true;
316
+ break;
317
+ }
318
+ if (letters[j + 1] && letters[j + 1].match(/\W/)) {
319
+ setArg(letters[j], next);
320
+ broken = true;
321
+ break;
322
+ }
323
+ setArg(letters[j], defaultValue(letters[j]));
324
+ }
325
+ key = arg.slice(-1)[0];
326
+ if (!broken && '-' !== key) if (checkAllAliases(key, flags.arrays)) i = eatArray(i, key, args);
327
+ else if (false !== checkAllAliases(key, flags.nargs)) i = eatNargs(i, key, args);
328
+ else {
329
+ next = args[i + 1];
330
+ if (void 0 !== next && (!/^(-|--)[^-]/.test(next) || next.match(negative)) && !checkAllAliases(key, flags.bools) && !checkAllAliases(key, flags.counts)) {
331
+ setArg(key, next);
332
+ i++;
333
+ } else if (/^(true|false)$/.test(next)) {
334
+ setArg(key, next);
335
+ i++;
336
+ } else setArg(key, defaultValue(key));
337
+ }
338
+ } else if (arg.match(/^-[0-9]$/) && arg.match(negative) && checkAllAliases(arg.slice(1), flags.bools)) {
339
+ key = arg.slice(1);
340
+ setArg(key, defaultValue(key));
341
+ } else if ('--' === arg) {
342
+ notFlags = args.slice(i + 1);
343
+ break;
344
+ } else if (configuration['halt-at-non-option']) {
345
+ notFlags = args.slice(i);
346
+ break;
347
+ } else pushPositional(arg);
348
+ }
349
+ applyEnvVars(argv, true);
350
+ applyEnvVars(argv, false);
351
+ setConfig(argv);
352
+ setConfigObjects();
353
+ applyDefaultsAndAliases(argv, flags.aliases, defaults, true);
354
+ applyCoercions(argv);
355
+ if (configuration['set-placeholder-key']) setPlaceholderKeys(argv);
356
+ Object.keys(flags.counts).forEach(function(key) {
357
+ if (!hasKey(argv, key.split('.'))) setArg(key, 0);
358
+ });
359
+ if (notFlagsOption && notFlags.length) argv[notFlagsArgv] = [];
360
+ notFlags.forEach(function(key) {
361
+ argv[notFlagsArgv].push(key);
362
+ });
363
+ if (configuration['camel-case-expansion'] && configuration['strip-dashed']) Object.keys(argv).filter((key)=>'--' !== key && key.includes('-')).forEach((key)=>{
364
+ delete argv[key];
365
+ });
366
+ if (configuration['strip-aliased']) [].concat(...Object.keys(aliases).map((k)=>aliases[k])).forEach((alias)=>{
367
+ if (configuration['camel-case-expansion'] && alias.includes('-')) delete argv[alias.split('.').map((prop)=>camelCase(prop)).join('.')];
368
+ delete argv[alias];
369
+ });
370
+ function pushPositional(arg) {
371
+ const maybeCoercedNumber = maybeCoerceNumber('_', arg);
372
+ if ('string' == typeof maybeCoercedNumber || 'number' == typeof maybeCoercedNumber) argv._.push(maybeCoercedNumber);
373
+ }
374
+ function eatNargs(i, key, args, argAfterEqualSign) {
375
+ let ii;
376
+ let toEat = checkAllAliases(key, flags.nargs);
377
+ toEat = 'number' != typeof toEat || isNaN(toEat) ? 1 : toEat;
378
+ if (0 === toEat) {
379
+ if (!isUndefined(argAfterEqualSign)) error = Error(__('Argument unexpected for: %s', key));
380
+ setArg(key, defaultValue(key));
381
+ return i;
382
+ }
383
+ let available = isUndefined(argAfterEqualSign) ? 0 : 1;
384
+ if (configuration['nargs-eats-options']) {
385
+ if (args.length - (i + 1) + available < toEat) error = Error(__('Not enough arguments following: %s', key));
386
+ available = toEat;
387
+ } else {
388
+ for(ii = i + 1; ii < args.length; ii++)if (!args[ii].match(/^-[^0-9]/) || args[ii].match(negative) || isUnknownOptionAsArg(args[ii])) available++;
389
+ else break;
390
+ if (available < toEat) error = Error(__('Not enough arguments following: %s', key));
391
+ }
392
+ let consumed = Math.min(available, toEat);
393
+ if (!isUndefined(argAfterEqualSign) && consumed > 0) {
394
+ setArg(key, argAfterEqualSign);
395
+ consumed--;
396
+ }
397
+ for(ii = i + 1; ii < consumed + i + 1; ii++)setArg(key, args[ii]);
398
+ return i + consumed;
399
+ }
400
+ function eatArray(i, key, args, argAfterEqualSign) {
401
+ let argsToSet = [];
402
+ let next = argAfterEqualSign || args[i + 1];
403
+ const nargsCount = checkAllAliases(key, flags.nargs);
404
+ if (checkAllAliases(key, flags.bools) && !/^(true|false)$/.test(next)) argsToSet.push(true);
405
+ else if (isUndefined(next) || isUndefined(argAfterEqualSign) && /^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next)) {
406
+ if (void 0 !== defaults[key]) {
407
+ const defVal = defaults[key];
408
+ argsToSet = Array.isArray(defVal) ? defVal : [
409
+ defVal
410
+ ];
411
+ }
412
+ } else {
413
+ if (!isUndefined(argAfterEqualSign)) argsToSet.push(processValue(key, argAfterEqualSign, true));
414
+ for(let ii = i + 1; ii < args.length; ii++){
415
+ if (!configuration['greedy-arrays'] && argsToSet.length > 0 || nargsCount && 'number' == typeof nargsCount && argsToSet.length >= nargsCount) break;
416
+ next = args[ii];
417
+ if (/^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next)) break;
418
+ i = ii;
419
+ argsToSet.push(processValue(key, next, inputIsString));
420
+ }
421
+ }
422
+ if ('number' == typeof nargsCount && (nargsCount && argsToSet.length < nargsCount || isNaN(nargsCount) && 0 === argsToSet.length)) error = Error(__('Not enough arguments following: %s', key));
423
+ setArg(key, argsToSet);
424
+ return i;
425
+ }
426
+ function setArg(key, val, shouldStripQuotes = inputIsString) {
427
+ if (/-/.test(key) && configuration['camel-case-expansion']) {
428
+ const alias = key.split('.').map(function(prop) {
429
+ return camelCase(prop);
430
+ }).join('.');
431
+ addNewAlias(key, alias);
432
+ }
433
+ const value = processValue(key, val, shouldStripQuotes);
434
+ const splitKey = key.split('.');
435
+ setKey(argv, splitKey, value);
436
+ if (flags.aliases[key]) flags.aliases[key].forEach(function(x) {
437
+ const keyProperties = x.split('.');
438
+ setKey(argv, keyProperties, value);
439
+ });
440
+ if (splitKey.length > 1 && configuration['dot-notation']) (flags.aliases[splitKey[0]] || []).forEach(function(x) {
441
+ let keyProperties = x.split('.');
442
+ const a = [].concat(splitKey);
443
+ a.shift();
444
+ keyProperties = keyProperties.concat(a);
445
+ if (!(flags.aliases[key] || []).includes(keyProperties.join('.'))) setKey(argv, keyProperties, value);
446
+ });
447
+ if (checkAllAliases(key, flags.normalize) && !checkAllAliases(key, flags.arrays)) {
448
+ const keys = [
449
+ key
450
+ ].concat(flags.aliases[key] || []);
451
+ keys.forEach(function(key) {
452
+ Object.defineProperty(argvReturn, key, {
453
+ enumerable: true,
454
+ get () {
455
+ return val;
456
+ },
457
+ set (value) {
458
+ val = 'string' == typeof value ? mixin.normalize(value) : value;
459
+ }
460
+ });
461
+ });
462
+ }
463
+ }
464
+ function addNewAlias(key, alias) {
465
+ if (!(flags.aliases[key] && flags.aliases[key].length)) {
466
+ flags.aliases[key] = [
467
+ alias
468
+ ];
469
+ newAliases[alias] = true;
470
+ }
471
+ if (!(flags.aliases[alias] && flags.aliases[alias].length)) addNewAlias(alias, key);
472
+ }
473
+ function processValue(key, val, shouldStripQuotes) {
474
+ if (shouldStripQuotes) val = stripQuotes(val);
475
+ if (checkAllAliases(key, flags.bools) || checkAllAliases(key, flags.counts)) {
476
+ if ('string' == typeof val) val = 'true' === val;
477
+ }
478
+ let value = Array.isArray(val) ? val.map(function(v) {
479
+ return maybeCoerceNumber(key, v);
480
+ }) : maybeCoerceNumber(key, val);
481
+ if (checkAllAliases(key, flags.counts) && (isUndefined(value) || 'boolean' == typeof value)) value = increment();
482
+ if (checkAllAliases(key, flags.normalize) && checkAllAliases(key, flags.arrays)) value = Array.isArray(val) ? val.map((val)=>mixin.normalize(val)) : mixin.normalize(val);
483
+ return value;
484
+ }
485
+ function maybeCoerceNumber(key, value) {
486
+ if (!configuration['parse-positional-numbers'] && '_' === key) return value;
487
+ if (!checkAllAliases(key, flags.strings) && !checkAllAliases(key, flags.bools) && !Array.isArray(value)) {
488
+ const shouldCoerceNumber = looksLikeNumber(value) && configuration['parse-numbers'] && Number.isSafeInteger(Math.floor(parseFloat(`${value}`)));
489
+ if (shouldCoerceNumber || !isUndefined(value) && checkAllAliases(key, flags.numbers)) value = Number(value);
490
+ }
491
+ return value;
492
+ }
493
+ function setConfig(argv) {
494
+ const configLookup = Object.create(null);
495
+ applyDefaultsAndAliases(configLookup, flags.aliases, defaults);
496
+ Object.keys(flags.configs).forEach(function(configKey) {
497
+ const configPath = argv[configKey] || configLookup[configKey];
498
+ if (configPath) try {
499
+ let config = null;
500
+ const resolvedConfigPath = mixin.resolve(mixin.cwd(), configPath);
501
+ const resolveConfig = flags.configs[configKey];
502
+ if ('function' == typeof resolveConfig) {
503
+ try {
504
+ config = resolveConfig(resolvedConfigPath);
505
+ } catch (e) {
506
+ config = e;
507
+ }
508
+ if (config instanceof Error) {
509
+ error = config;
510
+ return;
511
+ }
512
+ } else config = mixin.require(resolvedConfigPath);
513
+ setConfigObject(config);
514
+ } catch (ex) {
515
+ if ('PermissionDenied' === ex.name) error = ex;
516
+ else if (argv[configKey]) error = Error(__('Invalid JSON config file: %s', configPath));
517
+ }
518
+ });
519
+ }
520
+ function setConfigObject(config, prev) {
521
+ Object.keys(config).forEach(function(key) {
522
+ const value = config[key];
523
+ const fullKey = prev ? prev + '.' + key : key;
524
+ if ('object' == typeof value && null !== value && !Array.isArray(value) && configuration['dot-notation']) setConfigObject(value, fullKey);
525
+ else if (!hasKey(argv, fullKey.split('.')) || checkAllAliases(fullKey, flags.arrays) && configuration['combine-arrays']) setArg(fullKey, value);
526
+ });
527
+ }
528
+ function setConfigObjects() {
529
+ if (void 0 !== configObjects) configObjects.forEach(function(configObject) {
530
+ setConfigObject(configObject);
531
+ });
532
+ }
533
+ function applyEnvVars(argv, configOnly) {
534
+ if (void 0 === envPrefix) return;
535
+ const prefix = 'string' == typeof envPrefix ? envPrefix : '';
536
+ const env = mixin.env();
537
+ Object.keys(env).forEach(function(envVar) {
538
+ if ('' === prefix || 0 === envVar.lastIndexOf(prefix, 0)) {
539
+ const keys = envVar.split('__').map(function(key, i) {
540
+ if (0 === i) key = key.substring(prefix.length);
541
+ return camelCase(key);
542
+ });
543
+ if ((configOnly && flags.configs[keys.join('.')] || !configOnly) && !hasKey(argv, keys)) setArg(keys.join('.'), env[envVar]);
544
+ }
545
+ });
546
+ }
547
+ function applyCoercions(argv) {
548
+ let coerce;
549
+ const applied = new Set();
550
+ Object.keys(argv).forEach(function(key) {
551
+ if (!applied.has(key)) {
552
+ coerce = checkAllAliases(key, flags.coercions);
553
+ if ('function' == typeof coerce) try {
554
+ const value = maybeCoerceNumber(key, coerce(argv[key]));
555
+ [].concat(flags.aliases[key] || [], key).forEach((ali)=>{
556
+ applied.add(ali);
557
+ argv[ali] = value;
558
+ });
559
+ } catch (err) {
560
+ error = err;
561
+ }
562
+ }
563
+ });
564
+ }
565
+ function setPlaceholderKeys(argv) {
566
+ flags.keys.forEach((key)=>{
567
+ if (~key.indexOf('.')) return;
568
+ if (void 0 === argv[key]) argv[key] = void 0;
569
+ });
570
+ return argv;
571
+ }
572
+ function applyDefaultsAndAliases(obj, aliases, defaults, canLog = false) {
573
+ Object.keys(defaults).forEach(function(key) {
574
+ if (!hasKey(obj, key.split('.'))) {
575
+ setKey(obj, key.split('.'), defaults[key]);
576
+ if (canLog) defaulted[key] = true;
577
+ (aliases[key] || []).forEach(function(x) {
578
+ if (hasKey(obj, x.split('.'))) return;
579
+ setKey(obj, x.split('.'), defaults[key]);
580
+ });
581
+ }
582
+ });
583
+ }
584
+ function hasKey(obj, keys) {
585
+ let o = obj;
586
+ if (!configuration['dot-notation']) keys = [
587
+ keys.join('.')
588
+ ];
589
+ keys.slice(0, -1).forEach(function(key) {
590
+ o = o[key] || {};
591
+ });
592
+ const key = keys[keys.length - 1];
593
+ if ('object' != typeof o) return false;
594
+ return key in o;
595
+ }
596
+ function setKey(obj, keys, value) {
597
+ let o = obj;
598
+ if (!configuration['dot-notation']) keys = [
599
+ keys.join('.')
600
+ ];
601
+ keys.slice(0, -1).forEach(function(key) {
602
+ key = sanitizeKey(key);
603
+ if ('object' == typeof o && void 0 === o[key]) o[key] = {};
604
+ if ('object' != typeof o[key] || Array.isArray(o[key])) {
605
+ if (Array.isArray(o[key])) o[key].push({});
606
+ else o[key] = [
607
+ o[key],
608
+ {}
609
+ ];
610
+ o = o[key][o[key].length - 1];
611
+ } else o = o[key];
612
+ });
613
+ const key = sanitizeKey(keys[keys.length - 1]);
614
+ const isTypeArray = checkAllAliases(keys.join('.'), flags.arrays);
615
+ const isValueArray = Array.isArray(value);
616
+ let duplicate = configuration['duplicate-arguments-array'];
617
+ if (!duplicate && checkAllAliases(key, flags.nargs)) {
618
+ duplicate = true;
619
+ if (!isUndefined(o[key]) && 1 === flags.nargs[key] || Array.isArray(o[key]) && o[key].length === flags.nargs[key]) o[key] = void 0;
620
+ }
621
+ if (value === increment()) o[key] = increment(o[key]);
622
+ 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] : [
623
+ o[key]
624
+ ]).concat([
625
+ value
626
+ ]);
627
+ else if (duplicate || Boolean(isTypeArray) !== Boolean(isValueArray)) o[key] = o[key].concat([
628
+ value
629
+ ]);
630
+ else o[key] = value;
631
+ else if (void 0 === o[key] && isTypeArray) o[key] = isValueArray ? value : [
632
+ value
633
+ ];
634
+ else if (duplicate && !(void 0 === o[key] || checkAllAliases(key, flags.counts) || checkAllAliases(key, flags.bools))) o[key] = [
635
+ o[key],
636
+ value
637
+ ];
638
+ else o[key] = value;
639
+ }
640
+ function extendAliases(...args) {
641
+ args.forEach(function(obj) {
642
+ Object.keys(obj || {}).forEach(function(key) {
643
+ if (flags.aliases[key]) return;
644
+ flags.aliases[key] = [].concat(aliases[key] || []);
645
+ flags.aliases[key].concat(key).forEach(function(x) {
646
+ if (/-/.test(x) && configuration['camel-case-expansion']) {
647
+ const c = camelCase(x);
648
+ if (c !== key && -1 === flags.aliases[key].indexOf(c)) {
649
+ flags.aliases[key].push(c);
650
+ newAliases[c] = true;
651
+ }
652
+ }
653
+ });
654
+ flags.aliases[key].concat(key).forEach(function(x) {
655
+ if (x.length > 1 && /[A-Z]/.test(x) && configuration['camel-case-expansion']) {
656
+ const c = decamelize(x, '-');
657
+ if (c !== key && -1 === flags.aliases[key].indexOf(c)) {
658
+ flags.aliases[key].push(c);
659
+ newAliases[c] = true;
660
+ }
661
+ }
662
+ });
663
+ flags.aliases[key].forEach(function(x) {
664
+ flags.aliases[x] = [
665
+ key
666
+ ].concat(flags.aliases[key].filter(function(y) {
667
+ return x !== y;
668
+ }));
669
+ });
670
+ });
671
+ });
672
+ }
673
+ function checkAllAliases(key, flag) {
674
+ const toCheck = [].concat(flags.aliases[key] || [], key);
675
+ const keys = Object.keys(flag);
676
+ const setAlias = toCheck.find((key)=>keys.includes(key));
677
+ return setAlias ? flag[setAlias] : false;
678
+ }
679
+ function hasAnyFlag(key) {
680
+ const flagsKeys = Object.keys(flags);
681
+ const toCheck = [].concat(flagsKeys.map((k)=>flags[k]));
682
+ return toCheck.some(function(flag) {
683
+ return Array.isArray(flag) ? flag.includes(key) : flag[key];
684
+ });
685
+ }
686
+ function hasFlagsMatching(arg, ...patterns) {
687
+ const toCheck = [].concat(...patterns);
688
+ return toCheck.some(function(pattern) {
689
+ const match = arg.match(pattern);
690
+ return match && hasAnyFlag(match[1]);
691
+ });
692
+ }
693
+ function hasAllShortFlags(arg) {
694
+ if (arg.match(negative) || !arg.match(/^-[^-]+/)) return false;
695
+ let hasAllFlags = true;
696
+ let next;
697
+ const letters = arg.slice(1).split('');
698
+ for(let j = 0; j < letters.length; j++){
699
+ next = arg.slice(j + 2);
700
+ if (!hasAnyFlag(letters[j])) {
701
+ hasAllFlags = false;
702
+ break;
703
+ }
704
+ 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;
705
+ }
706
+ return hasAllFlags;
707
+ }
708
+ function isUnknownOptionAsArg(arg) {
709
+ return configuration['unknown-options-as-args'] && isUnknownOption(arg);
710
+ }
711
+ function isUnknownOption(arg) {
712
+ arg = arg.replace(/^-{3,}/, '--');
713
+ if (arg.match(negative)) return false;
714
+ if (hasAllShortFlags(arg)) return false;
715
+ const flagWithEquals = /^-+([^=]+?)=[\s\S]*$/;
716
+ const normalFlag = /^-+([^=]+?)$/;
717
+ const flagEndingInHyphen = /^-+([^=]+?)-$/;
718
+ const flagEndingInDigits = /^-+([^=]+?\d+)$/;
719
+ const flagEndingInNonWordCharacters = /^-+([^=]+?)\W+.*$/;
720
+ return !hasFlagsMatching(arg, flagWithEquals, negatedBoolean, normalFlag, flagEndingInHyphen, flagEndingInDigits, flagEndingInNonWordCharacters);
721
+ }
722
+ function defaultValue(key) {
723
+ if (!checkAllAliases(key, flags.bools) && !checkAllAliases(key, flags.counts) && `${key}` in defaults) return defaults[key];
724
+ return defaultForType(guessType(key));
725
+ }
726
+ function defaultForType(type) {
727
+ const def = {
728
+ [yargs_parser_types_DefaultValuesForTypeKey.BOOLEAN]: true,
729
+ [yargs_parser_types_DefaultValuesForTypeKey.STRING]: '',
730
+ [yargs_parser_types_DefaultValuesForTypeKey.NUMBER]: void 0,
731
+ [yargs_parser_types_DefaultValuesForTypeKey.ARRAY]: []
732
+ };
733
+ return def[type];
734
+ }
735
+ function guessType(key) {
736
+ let type = yargs_parser_types_DefaultValuesForTypeKey.BOOLEAN;
737
+ if (checkAllAliases(key, flags.strings)) type = yargs_parser_types_DefaultValuesForTypeKey.STRING;
738
+ else if (checkAllAliases(key, flags.numbers)) type = yargs_parser_types_DefaultValuesForTypeKey.NUMBER;
739
+ else if (checkAllAliases(key, flags.bools)) type = yargs_parser_types_DefaultValuesForTypeKey.BOOLEAN;
740
+ else if (checkAllAliases(key, flags.arrays)) type = yargs_parser_types_DefaultValuesForTypeKey.ARRAY;
741
+ return type;
742
+ }
743
+ function isUndefined(num) {
744
+ return void 0 === num;
745
+ }
746
+ function checkConfiguration() {
747
+ Object.keys(flags.counts).find((key)=>{
748
+ if (checkAllAliases(key, flags.arrays)) {
749
+ error = Error(__('Invalid configuration: %s, opts.count excludes opts.array.', key));
750
+ return true;
751
+ }
752
+ if (checkAllAliases(key, flags.nargs)) {
753
+ error = Error(__('Invalid configuration: %s, opts.count excludes opts.narg.', key));
754
+ return true;
755
+ }
756
+ return false;
757
+ });
758
+ }
759
+ return {
760
+ aliases: Object.assign({}, flags.aliases),
761
+ argv: Object.assign(argvReturn, argv),
762
+ configuration: configuration,
763
+ defaulted: Object.assign({}, defaulted),
764
+ error: error,
765
+ newAliases: Object.assign({}, newAliases)
766
+ };
767
+ }
768
+ }
769
+ function combineAliases(aliases) {
770
+ const aliasArrays = [];
771
+ const combined = Object.create(null);
772
+ let change = true;
773
+ Object.keys(aliases).forEach(function(key) {
774
+ aliasArrays.push([].concat(aliases[key], key));
775
+ });
776
+ while(change){
777
+ change = false;
778
+ for(let i = 0; i < aliasArrays.length; i++)for(let ii = i + 1; ii < aliasArrays.length; ii++){
779
+ const intersect = aliasArrays[i].filter(function(v) {
780
+ return -1 !== aliasArrays[ii].indexOf(v);
781
+ });
782
+ if (intersect.length) {
783
+ aliasArrays[i] = aliasArrays[i].concat(aliasArrays[ii]);
784
+ aliasArrays.splice(ii, 1);
785
+ change = true;
786
+ break;
787
+ }
788
+ }
789
+ }
790
+ aliasArrays.forEach(function(aliasArray) {
791
+ aliasArray = aliasArray.filter(function(v, i, self) {
792
+ return self.indexOf(v) === i;
793
+ });
794
+ const lastAlias = aliasArray.pop();
795
+ if (void 0 !== lastAlias && 'string' == typeof lastAlias) combined[lastAlias] = aliasArray;
796
+ });
797
+ return combined;
798
+ }
799
+ function increment(orig) {
800
+ return void 0 !== orig ? orig + 1 : 1;
801
+ }
802
+ function sanitizeKey(key) {
803
+ if ('__proto__' === key) return '___proto___';
804
+ return key;
805
+ }
806
+ function stripQuotes(val) {
807
+ return 'string' == typeof val && ("'" === val[0] || '"' === val[0]) && val[val.length - 1] === val[0] ? val.substring(1, val.length - 1) : val;
808
+ }
809
+ var external_fs_ = __webpack_require__("fs?fa32");
810
+ /**
811
+ * @fileoverview Main entrypoint for libraries using yargs-parser in Node.js
812
+ * CJS and ESM environments.
813
+ *
814
+ * @license
815
+ * Copyright (c) 2016, Contributors
816
+ * SPDX-License-Identifier: ISC
817
+ */ var _a, _b, _c;
818
+ const minNodeVersion = process && process.env && process.env.YARGS_MIN_NODE_VERSION ? Number(process.env.YARGS_MIN_NODE_VERSION) : 12;
819
+ const nodeVersion = null != (_b = null == (_a = null == process ? void 0 : process.versions) ? void 0 : _a.node) ? _b : null == (_c = null == process ? void 0 : process.version) ? void 0 : _c.slice(1);
820
+ if (nodeVersion) {
821
+ const major = Number(nodeVersion.match(/^([^.]+)/)[1]);
822
+ 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`);
823
+ }
824
+ const lib_env = process ? process.env : {};
825
+ const parser = new YargsParser({
826
+ cwd: process.cwd,
827
+ env: ()=>lib_env,
828
+ format: external_util_.format,
829
+ normalize: external_path_.normalize,
830
+ resolve: external_path_.resolve,
831
+ require: (path)=>{
832
+ if ('undefined' != typeof require) return require(path);
833
+ if (path.match(/\.json$/)) return JSON.parse((0, external_fs_.readFileSync)(path, 'utf8'));
834
+ throw Error('only .json config files are supported in ESM');
835
+ }
836
+ });
837
+ const yargsParser = function(args, opts) {
838
+ const result = parser.parse(args.slice(), opts);
839
+ return result.argv;
840
+ };
841
+ yargsParser.detailed = function(args, opts) {
842
+ return parser.parse(args.slice(), opts);
843
+ };
844
+ yargsParser.camelCase = camelCase;
845
+ yargsParser.decamelize = decamelize;
846
+ yargsParser.looksLikeNumber = looksLikeNumber;
847
+ const lib = yargsParser;
848
+ },
849
+ "../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/utils/apply-extends.js": function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
850
+ __webpack_require__.d(__webpack_exports__, {
851
+ J: ()=>applyExtends
852
+ });
853
+ var _yerror_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/yerror.js");
854
+ let previouslyVisitedConfigs = [];
855
+ let shim;
856
+ function applyExtends(config, cwd, mergeExtends, _shim) {
857
+ shim = _shim;
858
+ let defaultConfig = {};
859
+ if (Object.prototype.hasOwnProperty.call(config, 'extends')) {
860
+ if ('string' != typeof config.extends) return defaultConfig;
861
+ const isPath = /\.json|\..*rc$/.test(config.extends);
862
+ let pathToDefault = null;
863
+ if (isPath) pathToDefault = getPathToDefaultConfig(cwd, config.extends);
864
+ else try {
865
+ pathToDefault = require.resolve(config.extends);
866
+ } catch (_err) {
867
+ return config;
868
+ }
869
+ checkForCircularExtends(pathToDefault);
870
+ previouslyVisitedConfigs.push(pathToDefault);
871
+ defaultConfig = isPath ? JSON.parse(shim.readFileSync(pathToDefault, 'utf8')) : require(config.extends);
872
+ delete config.extends;
873
+ defaultConfig = applyExtends(defaultConfig, shim.path.dirname(pathToDefault), mergeExtends, shim);
874
+ }
875
+ previouslyVisitedConfigs = [];
876
+ return mergeExtends ? mergeDeep(defaultConfig, config) : Object.assign({}, defaultConfig, config);
877
+ }
878
+ function checkForCircularExtends(cfgPath) {
879
+ if (previouslyVisitedConfigs.indexOf(cfgPath) > -1) throw new _yerror_js__WEBPACK_IMPORTED_MODULE_0__.s(`Circular extended configurations: '${cfgPath}'.`);
880
+ }
881
+ function getPathToDefaultConfig(cwd, pathToExtend) {
882
+ return shim.path.resolve(cwd, pathToExtend);
883
+ }
884
+ function mergeDeep(config1, config2) {
885
+ const target = {};
886
+ function isObject(obj) {
887
+ return obj && 'object' == typeof obj && !Array.isArray(obj);
888
+ }
889
+ Object.assign(target, config1);
890
+ for (const key of Object.keys(config2))if (isObject(config2[key]) && isObject(target[key])) target[key] = mergeDeep(config1[key], config2[key]);
891
+ else target[key] = config2[key];
892
+ return target;
893
+ }
894
+ },
895
+ "../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/utils/process-argv.js": function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
896
+ __webpack_require__.d(__webpack_exports__, {
897
+ E: ()=>getProcessArgvBin,
898
+ b: ()=>hideBin
899
+ });
900
+ function getProcessArgvBinIndex() {
901
+ if (isBundledElectronApp()) return 0;
902
+ return 1;
903
+ }
904
+ function isBundledElectronApp() {
905
+ return isElectronApp() && !process.defaultApp;
906
+ }
907
+ function isElectronApp() {
908
+ return !!process.versions.electron;
909
+ }
910
+ function hideBin(argv) {
911
+ return argv.slice(getProcessArgvBinIndex() + 1);
912
+ }
913
+ function getProcessArgvBin() {
914
+ return process.argv[getProcessArgvBinIndex()];
915
+ }
916
+ },
917
+ "../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/yerror.js": function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
918
+ __webpack_require__.d(__webpack_exports__, {
919
+ s: ()=>YError
920
+ });
921
+ class YError extends Error {
922
+ constructor(msg){
923
+ super(msg || 'yargs error');
924
+ this.name = 'YError';
925
+ if (Error.captureStackTrace) Error.captureStackTrace(this, YError);
926
+ }
927
+ }
928
+ },
929
+ "../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/lib/platform-shims/esm.mjs": function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
930
+ __webpack_require__.d(__webpack_exports__, {
931
+ Z: ()=>esm
932
+ });
933
+ var external_assert_ = __webpack_require__("assert");
934
+ const align = {
935
+ right: alignRight,
936
+ center: alignCenter
937
+ };
938
+ const lib_top = 0;
939
+ const right = 1;
940
+ const bottom = 2;
941
+ const left = 3;
942
+ class UI {
943
+ constructor(opts){
944
+ var _a;
945
+ this.width = opts.width;
946
+ this.wrap = null != (_a = opts.wrap) ? _a : true;
947
+ this.rows = [];
948
+ }
949
+ span(...args) {
950
+ const cols = this.div(...args);
951
+ cols.span = true;
952
+ }
953
+ resetOutput() {
954
+ this.rows = [];
955
+ }
956
+ div(...args) {
957
+ if (0 === args.length) this.div('');
958
+ if (this.wrap && this.shouldApplyLayoutDSL(...args) && 'string' == typeof args[0]) return this.applyLayoutDSL(args[0]);
959
+ const cols = args.map((arg)=>{
960
+ if ('string' == typeof arg) return this.colFromString(arg);
961
+ return arg;
962
+ });
963
+ this.rows.push(cols);
964
+ return cols;
965
+ }
966
+ shouldApplyLayoutDSL(...args) {
967
+ return 1 === args.length && 'string' == typeof args[0] && /[\t\n]/.test(args[0]);
968
+ }
969
+ applyLayoutDSL(str) {
970
+ const rows = str.split('\n').map((row)=>row.split('\t'));
971
+ let leftColumnWidth = 0;
972
+ rows.forEach((columns)=>{
973
+ if (columns.length > 1 && mixin.stringWidth(columns[0]) > leftColumnWidth) leftColumnWidth = Math.min(Math.floor(0.5 * this.width), mixin.stringWidth(columns[0]));
974
+ });
975
+ rows.forEach((columns)=>{
976
+ this.div(...columns.map((r, i)=>({
977
+ text: r.trim(),
978
+ padding: this.measurePadding(r),
979
+ width: 0 === i && columns.length > 1 ? leftColumnWidth : void 0
980
+ })));
981
+ });
982
+ return this.rows[this.rows.length - 1];
983
+ }
984
+ colFromString(text) {
985
+ return {
986
+ text,
987
+ padding: this.measurePadding(text)
988
+ };
989
+ }
990
+ measurePadding(str) {
991
+ const noAnsi = mixin.stripAnsi(str);
992
+ return [
993
+ 0,
994
+ noAnsi.match(/\s*$/)[0].length,
995
+ 0,
996
+ noAnsi.match(/^\s*/)[0].length
997
+ ];
998
+ }
999
+ toString() {
1000
+ const lines = [];
1001
+ this.rows.forEach((row)=>{
1002
+ this.rowToString(row, lines);
1003
+ });
1004
+ return lines.filter((line)=>!line.hidden).map((line)=>line.text).join('\n');
1005
+ }
1006
+ rowToString(row, lines) {
1007
+ this.rasterize(row).forEach((rrow, r)=>{
1008
+ let str = '';
1009
+ rrow.forEach((col, c)=>{
1010
+ const { width } = row[c];
1011
+ const wrapWidth = this.negatePadding(row[c]);
1012
+ let ts = col;
1013
+ if (wrapWidth > mixin.stringWidth(col)) ts += ' '.repeat(wrapWidth - mixin.stringWidth(col));
1014
+ if (row[c].align && 'left' !== row[c].align && this.wrap) {
1015
+ const fn = align[row[c].align];
1016
+ ts = fn(ts, wrapWidth);
1017
+ if (mixin.stringWidth(ts) < wrapWidth) ts += ' '.repeat((width || 0) - mixin.stringWidth(ts) - 1);
1018
+ }
1019
+ const padding = row[c].padding || [
1020
+ 0,
1021
+ 0,
1022
+ 0,
1023
+ 0
1024
+ ];
1025
+ if (padding[left]) str += ' '.repeat(padding[left]);
1026
+ str += addBorder(row[c], ts, '| ');
1027
+ str += ts;
1028
+ str += addBorder(row[c], ts, ' |');
1029
+ if (padding[right]) str += ' '.repeat(padding[right]);
1030
+ if (0 === r && lines.length > 0) str = this.renderInline(str, lines[lines.length - 1]);
1031
+ });
1032
+ lines.push({
1033
+ text: str.replace(/ +$/, ''),
1034
+ span: row.span
1035
+ });
1036
+ });
1037
+ return lines;
1038
+ }
1039
+ renderInline(source, previousLine) {
1040
+ const match = source.match(/^ */);
1041
+ const leadingWhitespace = match ? match[0].length : 0;
1042
+ const target = previousLine.text;
1043
+ const targetTextWidth = mixin.stringWidth(target.trimRight());
1044
+ if (!previousLine.span) return source;
1045
+ if (!this.wrap) {
1046
+ previousLine.hidden = true;
1047
+ return target + source;
1048
+ }
1049
+ if (leadingWhitespace < targetTextWidth) return source;
1050
+ previousLine.hidden = true;
1051
+ return target.trimRight() + ' '.repeat(leadingWhitespace - targetTextWidth) + source.trimLeft();
1052
+ }
1053
+ rasterize(row) {
1054
+ const rrows = [];
1055
+ const widths = this.columnWidths(row);
1056
+ let wrapped;
1057
+ row.forEach((col, c)=>{
1058
+ col.width = widths[c];
1059
+ wrapped = this.wrap ? mixin.wrap(col.text, this.negatePadding(col), {
1060
+ hard: true
1061
+ }).split('\n') : col.text.split('\n');
1062
+ if (col.border) {
1063
+ wrapped.unshift('.' + '-'.repeat(this.negatePadding(col) + 2) + '.');
1064
+ wrapped.push("'" + '-'.repeat(this.negatePadding(col) + 2) + "'");
1065
+ }
1066
+ if (col.padding) {
1067
+ wrapped.unshift(...new Array(col.padding[lib_top] || 0).fill(''));
1068
+ wrapped.push(...new Array(col.padding[bottom] || 0).fill(''));
1069
+ }
1070
+ wrapped.forEach((str, r)=>{
1071
+ if (!rrows[r]) rrows.push([]);
1072
+ const rrow = rrows[r];
1073
+ for(let i = 0; i < c; i++)if (void 0 === rrow[i]) rrow.push('');
1074
+ rrow.push(str);
1075
+ });
1076
+ });
1077
+ return rrows;
1078
+ }
1079
+ negatePadding(col) {
1080
+ let wrapWidth = col.width || 0;
1081
+ if (col.padding) wrapWidth -= (col.padding[left] || 0) + (col.padding[right] || 0);
1082
+ if (col.border) wrapWidth -= 4;
1083
+ return wrapWidth;
1084
+ }
1085
+ columnWidths(row) {
1086
+ if (!this.wrap) return row.map((col)=>col.width || mixin.stringWidth(col.text));
1087
+ let unset = row.length;
1088
+ let remainingWidth = this.width;
1089
+ const widths = row.map((col)=>{
1090
+ if (col.width) {
1091
+ unset--;
1092
+ remainingWidth -= col.width;
1093
+ return col.width;
1094
+ }
1095
+ });
1096
+ const unsetWidth = unset ? Math.floor(remainingWidth / unset) : 0;
1097
+ return widths.map((w, i)=>{
1098
+ if (void 0 === w) return Math.max(unsetWidth, _minWidth(row[i]));
1099
+ return w;
1100
+ });
1101
+ }
1102
+ }
1103
+ function addBorder(col, ts, style) {
1104
+ if (col.border) {
1105
+ if (/[.']-+[.']/.test(ts)) return '';
1106
+ if (0 !== ts.trim().length) return style;
1107
+ return ' ';
1108
+ }
1109
+ return '';
1110
+ }
1111
+ function _minWidth(col) {
1112
+ const padding = col.padding || [];
1113
+ const minWidth = 1 + (padding[left] || 0) + (padding[right] || 0);
1114
+ if (col.border) return minWidth + 4;
1115
+ return minWidth;
1116
+ }
1117
+ function getWindowWidth() {
1118
+ if ('object' == typeof process && process.stdout && process.stdout.columns) return process.stdout.columns;
1119
+ return 80;
1120
+ }
1121
+ function alignRight(str, width) {
1122
+ str = str.trim();
1123
+ const strWidth = mixin.stringWidth(str);
1124
+ if (strWidth < width) return ' '.repeat(width - strWidth) + str;
1125
+ return str;
1126
+ }
1127
+ function alignCenter(str, width) {
1128
+ str = str.trim();
1129
+ const strWidth = mixin.stringWidth(str);
1130
+ if (strWidth >= width) return str;
1131
+ return ' '.repeat(width - strWidth >> 1) + str;
1132
+ }
1133
+ let mixin;
1134
+ function cliui(opts, _mixin) {
1135
+ mixin = _mixin;
1136
+ return new UI({
1137
+ width: (null == opts ? void 0 : opts.width) || getWindowWidth(),
1138
+ wrap: null == opts ? void 0 : opts.wrap
1139
+ });
1140
+ }
1141
+ const ansi = new RegExp("\x1b(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)", 'g');
1142
+ function stripAnsi(str) {
1143
+ return str.replace(ansi, '');
1144
+ }
1145
+ function wrap(str, width) {
1146
+ const [start, end] = str.match(ansi) || [
1147
+ '',
1148
+ ''
1149
+ ];
1150
+ str = stripAnsi(str);
1151
+ let wrapped = '';
1152
+ for(let i = 0; i < str.length; i++){
1153
+ if (0 !== i && i % width === 0) wrapped += '\n';
1154
+ wrapped += str.charAt(i);
1155
+ }
1156
+ if (start && end) wrapped = `${start}${wrapped}${end}`;
1157
+ return wrapped;
1158
+ }
1159
+ function ui(opts) {
1160
+ return cliui(opts, {
1161
+ stringWidth: (str)=>[
1162
+ ...str
1163
+ ].length,
1164
+ stripAnsi: stripAnsi,
1165
+ wrap: wrap
1166
+ });
1167
+ }
1168
+ var external_path_ = __webpack_require__("path");
1169
+ var external_fs_ = __webpack_require__("fs?fa32");
1170
+ function sync(start, callback) {
1171
+ let dir = (0, external_path_.resolve)('.', start);
1172
+ let tmp, stats = (0, external_fs_.statSync)(dir);
1173
+ if (!stats.isDirectory()) dir = (0, external_path_.dirname)(dir);
1174
+ while(true){
1175
+ tmp = callback(dir, (0, external_fs_.readdirSync)(dir));
1176
+ if (tmp) return (0, external_path_.resolve)(dir, tmp);
1177
+ dir = (0, external_path_.dirname)(tmp = dir);
1178
+ if (tmp === dir) break;
1179
+ }
1180
+ }
1181
+ var external_util_ = __webpack_require__("util");
1182
+ var external_url_ = __webpack_require__("url");
1183
+ var lib = __webpack_require__("../../node_modules/.pnpm/yargs-parser@21.1.1/node_modules/yargs-parser/build/lib/index.js");
1184
+ var process_argv = __webpack_require__("../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/utils/process-argv.js");
1185
+ var yerror = __webpack_require__("../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/yerror.js");
1186
+ const node = {
1187
+ fs: {
1188
+ readFileSync: external_fs_.readFileSync,
1189
+ writeFile: external_fs_.writeFile
1190
+ },
1191
+ format: external_util_.format,
1192
+ resolve: external_path_.resolve,
1193
+ exists: (file)=>{
1194
+ try {
1195
+ return (0, external_fs_.statSync)(file).isFile();
1196
+ } catch (err) {
1197
+ return false;
1198
+ }
1199
+ }
1200
+ };
1201
+ let shim;
1202
+ class Y18N {
1203
+ constructor(opts){
1204
+ opts = opts || {};
1205
+ this.directory = opts.directory || './locales';
1206
+ this.updateFiles = 'boolean' == typeof opts.updateFiles ? opts.updateFiles : true;
1207
+ this.locale = opts.locale || 'en';
1208
+ this.fallbackToLanguage = 'boolean' == typeof opts.fallbackToLanguage ? opts.fallbackToLanguage : true;
1209
+ this.cache = Object.create(null);
1210
+ this.writeQueue = [];
1211
+ }
1212
+ __(...args) {
1213
+ if ('string' != typeof arguments[0]) return this._taggedLiteral(arguments[0], ...arguments);
1214
+ const str = args.shift();
1215
+ let cb = function() {};
1216
+ if ('function' == typeof args[args.length - 1]) cb = args.pop();
1217
+ cb = cb || function() {};
1218
+ if (!this.cache[this.locale]) this._readLocaleFile();
1219
+ if (!this.cache[this.locale][str] && this.updateFiles) {
1220
+ this.cache[this.locale][str] = str;
1221
+ this._enqueueWrite({
1222
+ directory: this.directory,
1223
+ locale: this.locale,
1224
+ cb
1225
+ });
1226
+ } else cb();
1227
+ return shim.format.apply(shim.format, [
1228
+ this.cache[this.locale][str] || str
1229
+ ].concat(args));
1230
+ }
1231
+ __n() {
1232
+ const args = Array.prototype.slice.call(arguments);
1233
+ const singular = args.shift();
1234
+ const plural = args.shift();
1235
+ const quantity = args.shift();
1236
+ let cb = function() {};
1237
+ if ('function' == typeof args[args.length - 1]) cb = args.pop();
1238
+ if (!this.cache[this.locale]) this._readLocaleFile();
1239
+ let str = 1 === quantity ? singular : plural;
1240
+ if (this.cache[this.locale][singular]) {
1241
+ const entry = this.cache[this.locale][singular];
1242
+ str = entry[1 === quantity ? 'one' : 'other'];
1243
+ }
1244
+ if (!this.cache[this.locale][singular] && this.updateFiles) {
1245
+ this.cache[this.locale][singular] = {
1246
+ one: singular,
1247
+ other: plural
1248
+ };
1249
+ this._enqueueWrite({
1250
+ directory: this.directory,
1251
+ locale: this.locale,
1252
+ cb
1253
+ });
1254
+ } else cb();
1255
+ const values = [
1256
+ str
1257
+ ];
1258
+ if (~str.indexOf('%d')) values.push(quantity);
1259
+ return shim.format.apply(shim.format, values.concat(args));
1260
+ }
1261
+ setLocale(locale) {
1262
+ this.locale = locale;
1263
+ }
1264
+ getLocale() {
1265
+ return this.locale;
1266
+ }
1267
+ updateLocale(obj) {
1268
+ if (!this.cache[this.locale]) this._readLocaleFile();
1269
+ for(const key in obj)if (Object.prototype.hasOwnProperty.call(obj, key)) this.cache[this.locale][key] = obj[key];
1270
+ }
1271
+ _taggedLiteral(parts, ...args) {
1272
+ let str = '';
1273
+ parts.forEach(function(part, i) {
1274
+ const arg = args[i + 1];
1275
+ str += part;
1276
+ if (void 0 !== arg) str += '%s';
1277
+ });
1278
+ return this.__.apply(this, [
1279
+ str
1280
+ ].concat([].slice.call(args, 1)));
1281
+ }
1282
+ _enqueueWrite(work) {
1283
+ this.writeQueue.push(work);
1284
+ if (1 === this.writeQueue.length) this._processWriteQueue();
1285
+ }
1286
+ _processWriteQueue() {
1287
+ const _this = this;
1288
+ const work = this.writeQueue[0];
1289
+ const directory = work.directory;
1290
+ const locale = work.locale;
1291
+ const cb = work.cb;
1292
+ const languageFile = this._resolveLocaleFile(directory, locale);
1293
+ const serializedLocale = JSON.stringify(this.cache[locale], null, 2);
1294
+ shim.fs.writeFile(languageFile, serializedLocale, 'utf-8', function(err) {
1295
+ _this.writeQueue.shift();
1296
+ if (_this.writeQueue.length > 0) _this._processWriteQueue();
1297
+ cb(err);
1298
+ });
1299
+ }
1300
+ _readLocaleFile() {
1301
+ let localeLookup = {};
1302
+ const languageFile = this._resolveLocaleFile(this.directory, this.locale);
1303
+ try {
1304
+ if (shim.fs.readFileSync) localeLookup = JSON.parse(shim.fs.readFileSync(languageFile, 'utf-8'));
1305
+ } catch (err) {
1306
+ if (err instanceof SyntaxError) err.message = 'syntax error in ' + languageFile;
1307
+ if ('ENOENT' === err.code) localeLookup = {};
1308
+ else throw err;
1309
+ }
1310
+ this.cache[this.locale] = localeLookup;
1311
+ }
1312
+ _resolveLocaleFile(directory, locale) {
1313
+ let file = shim.resolve(directory, './', locale + '.json');
1314
+ if (this.fallbackToLanguage && !this._fileExistsSync(file) && ~locale.lastIndexOf('_')) {
1315
+ const languageFile = shim.resolve(directory, './', locale.split('_')[0] + '.json');
1316
+ if (this._fileExistsSync(languageFile)) file = languageFile;
1317
+ }
1318
+ return file;
1319
+ }
1320
+ _fileExistsSync(file) {
1321
+ return shim.exists(file);
1322
+ }
1323
+ }
1324
+ function lib_y18n(opts, _shim) {
1325
+ shim = _shim;
1326
+ const y18n = new Y18N(opts);
1327
+ return {
1328
+ __: y18n.__.bind(y18n),
1329
+ __n: y18n.__n.bind(y18n),
1330
+ setLocale: y18n.setLocale.bind(y18n),
1331
+ getLocale: y18n.getLocale.bind(y18n),
1332
+ updateLocale: y18n.updateLocale.bind(y18n),
1333
+ locale: y18n.locale
1334
+ };
1335
+ }
1336
+ const y18n_y18n = (opts)=>lib_y18n(opts, node);
1337
+ const node_modules_y18n = y18n_y18n;
1338
+ const REQUIRE_ERROR = 'require is not supported by ESM';
1339
+ const REQUIRE_DIRECTORY_ERROR = 'loading a directory of commands is not supported yet for ESM';
1340
+ let esm_dirname;
1341
+ try {
1342
+ esm_dirname = (0, external_url_.fileURLToPath)(__rslib_import_meta_url__);
1343
+ } catch (e) {
1344
+ esm_dirname = process.cwd();
1345
+ }
1346
+ const mainFilename = esm_dirname.substring(0, esm_dirname.lastIndexOf('node_modules'));
1347
+ const esm = {
1348
+ assert: {
1349
+ notStrictEqual: external_assert_.notStrictEqual,
1350
+ strictEqual: external_assert_.strictEqual
1351
+ },
1352
+ cliui: ui,
1353
+ findUp: sync,
1354
+ getEnv: (key)=>process.env[key],
1355
+ inspect: external_util_.inspect,
1356
+ getCallerFile: ()=>{
1357
+ throw new yerror.s(REQUIRE_DIRECTORY_ERROR);
1358
+ },
1359
+ getProcessArgvBin: process_argv.E,
1360
+ mainFilename: mainFilename || process.cwd(),
1361
+ Parser: lib.Z,
1362
+ path: {
1363
+ basename: external_path_.basename,
1364
+ dirname: external_path_.dirname,
1365
+ extname: external_path_.extname,
1366
+ relative: external_path_.relative,
1367
+ resolve: external_path_.resolve
1368
+ },
1369
+ process: {
1370
+ argv: ()=>process.argv,
1371
+ cwd: process.cwd,
1372
+ emitWarning: (warning, type)=>process.emitWarning(warning, type),
1373
+ execPath: ()=>process.execPath,
1374
+ exit: process.exit,
1375
+ nextTick: process.nextTick,
1376
+ stdColumns: void 0 !== process.stdout.columns ? process.stdout.columns : null
1377
+ },
1378
+ readFileSync: external_fs_.readFileSync,
1379
+ require: ()=>{
1380
+ throw new yerror.s(REQUIRE_ERROR);
1381
+ },
1382
+ requireDirectory: ()=>{
1383
+ throw new yerror.s(REQUIRE_DIRECTORY_ERROR);
1384
+ },
1385
+ stringWidth: (str)=>[
1386
+ ...str
1387
+ ].length,
1388
+ y18n: node_modules_y18n({
1389
+ directory: (0, external_path_.resolve)(esm_dirname, '../../../locales'),
1390
+ updateFiles: false
1391
+ })
1392
+ };
1393
+ }
1394
+ };
1395
+
1396
+ //# sourceMappingURL=337.js.map