clerc 0.36.0 → 0.38.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.
package/dist/index.d.ts CHANGED
@@ -1,3 +1,11 @@
1
+ type Equals<X, Y> = (<T>() => T extends X ? 1 : 2) extends (<T>() => T extends Y ? 1 : 2) ? true : false;
2
+ type Dict<T> = Record<string, T>;
3
+ type MaybeArray$1<T> = T | T[];
4
+ type AlphabetLowercase = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z";
5
+ type Numeric = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9";
6
+ type AlphaNumeric = AlphabetLowercase | Uppercase<AlphabetLowercase> | Numeric;
7
+ type CamelCase<Word extends string> = Word extends `${infer FirstCharacter}${infer Rest}` ? (FirstCharacter extends AlphaNumeric ? `${FirstCharacter}${CamelCase<Rest>}` : Capitalize<CamelCase<Rest>>) : Word;
8
+
1
9
  /**
2
10
  Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
3
11
 
@@ -220,14 +228,6 @@ type LiteralUnion<
220
228
  BaseType extends Primitive,
221
229
  > = LiteralType | (BaseType & Record<never, never>);
222
230
 
223
- type Equals<X, Y> = (<T>() => T extends X ? 1 : 2) extends (<T>() => T extends Y ? 1 : 2) ? true : false;
224
- type Dict<T> = Record<string, T>;
225
- type MaybeArray$1<T> = T | T[];
226
- type AlphabetLowercase = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z";
227
- type Numeric = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9";
228
- type AlphaNumeric = AlphabetLowercase | Uppercase<AlphabetLowercase> | Numeric;
229
- type CamelCase<Word extends string> = (Word extends `${infer FirstCharacter}${infer Rest}` ? (FirstCharacter extends AlphaNumeric ? `${FirstCharacter}${CamelCase<Rest>}` : Capitalize<CamelCase<Rest>>) : Word);
230
-
231
231
  declare const DOUBLE_DASH = "--";
232
232
  type TypeFunction<ReturnType = any> = (value: any) => ReturnType;
233
233
  type TypeFunctionArray<ReturnType> = readonly [TypeFunction<ReturnType>];
@@ -240,19 +240,17 @@ type FlagSchemaBase<TF> = {
240
240
  ```
241
241
  type: String
242
242
  ```
243
-
244
243
  @example Wrap in an array to accept multiple values.
245
244
  ```
246
245
  type: [Boolean]
247
246
  ```
248
-
249
247
  @example Custom function type that uses moment.js to parse string as date.
250
248
  ```
251
249
  type: function CustomDate(value: string) {
252
250
  return moment(value).toDate();
253
251
  }
254
252
  ```
255
- */
253
+ */
256
254
  type: TF;
257
255
  /**
258
256
  A single-character alias for the flag.
@@ -261,7 +259,7 @@ type FlagSchemaBase<TF> = {
261
259
  ```
262
260
  alias: 's'
263
261
  ```
264
- */
262
+ */
265
263
  alias?: string;
266
264
  } & Record<PropertyKey, unknown>;
267
265
  type FlagSchemaDefault<TF, DefaultType = any> = FlagSchemaBase<TF> & {
@@ -273,18 +271,17 @@ type FlagSchemaDefault<TF, DefaultType = any> = FlagSchemaBase<TF> & {
273
271
  ```
274
272
  default: 'hello'
275
273
  ```
276
-
277
274
  @example
278
275
  ```
279
276
  default: () => [1, 2, 3]
280
277
  ```
281
- */
278
+ */
282
279
  default: DefaultType | (() => DefaultType);
283
280
  };
284
- type FlagSchema<TF = FlagType> = (FlagSchemaBase<TF> | FlagSchemaDefault<TF>);
281
+ type FlagSchema<TF = FlagType> = FlagSchemaBase<TF> | FlagSchemaDefault<TF>;
285
282
  type FlagTypeOrSchema<ExtraOptions = Record<string, unknown>> = FlagType | (FlagSchema & ExtraOptions);
286
283
  type Flags$1<ExtraOptions = Record<string, unknown>> = Record<string, FlagTypeOrSchema<ExtraOptions>>;
287
- type InferFlagType<Flag extends FlagTypeOrSchema> = (Flag extends (TypeFunctionArray<infer T> | FlagSchema<TypeFunctionArray<infer T>>) ? (Flag extends FlagSchemaDefault<TypeFunctionArray<T>, infer D> ? T[] | D : T[]) : (Flag extends TypeFunction<infer T> | FlagSchema<TypeFunction<infer T>> ? (Flag extends FlagSchemaDefault<TypeFunction<T>, infer D> ? T | D : T | undefined) : never));
284
+ type InferFlagType<Flag extends FlagTypeOrSchema> = Flag extends (TypeFunctionArray<infer T> | FlagSchema<TypeFunctionArray<infer T>>) ? (Flag extends FlagSchemaDefault<TypeFunctionArray<T>, infer D> ? T[] | D : T[]) : (Flag extends TypeFunction<infer T> | FlagSchema<TypeFunction<infer T>> ? (Flag extends FlagSchemaDefault<TypeFunction<T>, infer D> ? T | D : T | undefined) : never);
288
285
  interface ParsedFlags<Schemas = Record<string, unknown>> {
289
286
  flags: Schemas;
290
287
  unknownFlags: Record<string, (string | boolean)[]>;
@@ -296,8 +293,8 @@ type TypeFlag<Schemas extends Flags$1> = ParsedFlags<{
296
293
  [flag in keyof Schemas]: InferFlagType<Schemas[flag]>;
297
294
  }>;
298
295
 
299
- type StripBrackets<Parameter extends string> = (Parameter extends `<${infer ParameterName}>` | `[${infer ParameterName}]` ? (ParameterName extends `${infer SpreadName}...` ? SpreadName : ParameterName) : never);
300
- type ParameterType<Parameter extends string> = (Parameter extends `<${infer _ParameterName}...>` | `[${infer _ParameterName}...]` ? string[] : Parameter extends `<${infer _ParameterName}>` ? string : Parameter extends `[${infer _ParameterName}]` ? string | undefined : never);
296
+ type StripBrackets<Parameter extends string> = Parameter extends `<${infer ParameterName}>` | `[${infer ParameterName}]` ? (ParameterName extends `${infer SpreadName}...` ? SpreadName : ParameterName) : never;
297
+ type ParameterType<Parameter extends string> = Parameter extends `<${infer _ParameterName}...>` | `[${infer _ParameterName}...]` ? string[] : Parameter extends `<${infer _ParameterName}>` ? string : Parameter extends `[${infer _ParameterName}]` ? string | undefined : never;
301
298
  type NonNullableParameters<T extends string[] | undefined> = T extends undefined ? [] : NonNullable<T>;
302
299
  type TransformParameters<C extends Command> = {
303
300
  [Parameter in NonNullableParameters<C["parameters"]>[number] as CamelCase<StripBrackets<Parameter>>]: ParameterType<Parameter>;
@@ -315,10 +312,6 @@ type ParseRaw<C extends Command, GF extends GlobalFlagOptions = {}> = NonNullabl
315
312
  };
316
313
  type ParseParameters<C extends Commands = Commands, N extends keyof C = keyof C> = Equals<TransformParameters<C[N]>, {}> extends true ? N extends keyof C ? TransformParameters<C[N]> : Dict<string | string[] | undefined> : TransformParameters<C[N]>;
317
314
 
318
- interface Plugin<T extends Clerc = Clerc, U extends Clerc = Clerc> {
319
- setup: (cli: T) => U;
320
- }
321
-
322
315
  type Locales = Dict<Dict<string>>;
323
316
  type TranslateFn = (name: string, ...args: string[]) => string | undefined;
324
317
  interface I18N {
@@ -326,6 +319,10 @@ interface I18N {
326
319
  t: TranslateFn;
327
320
  }
328
321
 
322
+ interface Plugin<T extends Clerc = Clerc, U extends Clerc = Clerc> {
323
+ setup: (cli: T) => U;
324
+ }
325
+
329
326
  type CommandType = RootType | string;
330
327
  type FlagOptions = FlagSchema & {
331
328
  description: string;
@@ -381,7 +378,7 @@ type InspectorContext<C extends Commands = Commands> = HandlerContext<C> & {
381
378
  flags: FallbackType<TypeFlag<NonNullable<C[keyof C]["flags"]>>["flags"], Dict<any>>;
382
379
  };
383
380
  type Inspector<C extends Commands = Commands> = InspectorFn<C> | InspectorObject<C>;
384
- type InspectorFn<C extends Commands = Commands> = (ctx: InspectorContext<C>, next: () => void) => (() => void) | void;
381
+ type InspectorFn<C extends Commands = Commands> = (ctx: InspectorContext<C>, next: () => void) => void;
385
382
  interface InspectorObject<C extends Commands = Commands> {
386
383
  enforce?: "pre" | "post";
387
384
  fn: InspectorFn<C>;
@@ -401,6 +398,10 @@ declare class Clerc<C extends Commands = {}, GF extends GlobalFlagOptions = {}>
401
398
  get _flags(): GF;
402
399
  /**
403
400
  * Create a new cli
401
+ *
402
+ * @param name
403
+ * @param description
404
+ * @param version
404
405
  * @returns
405
406
  * @example
406
407
  * ```ts
@@ -410,6 +411,7 @@ declare class Clerc<C extends Commands = {}, GF extends GlobalFlagOptions = {}>
410
411
  static create(name?: string, description?: string, version?: string): Clerc<{}, {}>;
411
412
  /**
412
413
  * Set the name of the cli
414
+ *
413
415
  * @param name
414
416
  * @returns
415
417
  * @example
@@ -421,6 +423,7 @@ declare class Clerc<C extends Commands = {}, GF extends GlobalFlagOptions = {}>
421
423
  name(name: string): this;
422
424
  /**
423
425
  * Set the description of the cli
426
+ *
424
427
  * @param description
425
428
  * @returns
426
429
  * @example
@@ -432,6 +435,7 @@ declare class Clerc<C extends Commands = {}, GF extends GlobalFlagOptions = {}>
432
435
  description(description: string): this;
433
436
  /**
434
437
  * Set the version of the cli
438
+ *
435
439
  * @param version
436
440
  * @returns
437
441
  * @example
@@ -444,6 +448,7 @@ declare class Clerc<C extends Commands = {}, GF extends GlobalFlagOptions = {}>
444
448
  /**
445
449
  * Set the Locale
446
450
  * You must call this method once after you created the Clerc instance.
451
+ *
447
452
  * @param locale
448
453
  * @returns
449
454
  * @example
@@ -457,6 +462,7 @@ declare class Clerc<C extends Commands = {}, GF extends GlobalFlagOptions = {}>
457
462
  /**
458
463
  * Set the fallback Locale
459
464
  * You must call this method once after you created the Clerc instance.
465
+ *
460
466
  * @param fallbackLocale
461
467
  * @returns
462
468
  * @example
@@ -469,6 +475,7 @@ declare class Clerc<C extends Commands = {}, GF extends GlobalFlagOptions = {}>
469
475
  fallbackLocale(fallbackLocale: string): this;
470
476
  /**
471
477
  * Register a error handler
478
+ *
472
479
  * @param handler
473
480
  * @returns
474
481
  * @example
@@ -480,6 +487,7 @@ declare class Clerc<C extends Commands = {}, GF extends GlobalFlagOptions = {}>
480
487
  errorHandler(handler: (err: any) => void): this;
481
488
  /**
482
489
  * Register a command
490
+ *
483
491
  * @param name
484
492
  * @param description
485
493
  * @param options
@@ -514,6 +522,7 @@ declare class Clerc<C extends Commands = {}, GF extends GlobalFlagOptions = {}>
514
522
  command<N extends string | RootType, O extends CommandOptions<[...P], A, F>, P extends string[] = string[], A extends MaybeArray$1<string | RootType> = MaybeArray$1<string | RootType>, F extends Flags = Flags>(name: N, description: string, options?: O & CommandOptions<[...P], A, F>): this & Clerc<C & Record<N, Command<N, O>>, GF>;
515
523
  /**
516
524
  * Register a global flag
525
+ *
517
526
  * @param name
518
527
  * @param description
519
528
  * @param options
@@ -530,6 +539,7 @@ declare class Clerc<C extends Commands = {}, GF extends GlobalFlagOptions = {}>
530
539
  flag<N extends string, O extends GlobalFlagOption>(name: N, description: string, options: O): this & Clerc<C, GF & Record<N, O>>;
531
540
  /**
532
541
  * Register a handler
542
+ *
533
543
  * @param name
534
544
  * @param handler
535
545
  * @returns
@@ -545,6 +555,7 @@ declare class Clerc<C extends Commands = {}, GF extends GlobalFlagOptions = {}>
545
555
  on<K extends LiteralUnion<keyof CM, string | RootType>, CM extends this["_commands"] = this["_commands"]>(name: K, handler: Handler<CM, K, this["_flags"]>): this;
546
556
  /**
547
557
  * Use a plugin
558
+ *
548
559
  * @param plugin
549
560
  * @returns
550
561
  * @example
@@ -556,6 +567,7 @@ declare class Clerc<C extends Commands = {}, GF extends GlobalFlagOptions = {}>
556
567
  use<T extends Clerc, U extends Clerc>(plugin: Plugin<T, U>): this & Clerc<C & U["_commands"]> & U;
557
568
  /**
558
569
  * Register a inspector
570
+ *
559
571
  * @param inspector
560
572
  * @returns
561
573
  * @example
@@ -570,7 +582,9 @@ declare class Clerc<C extends Commands = {}, GF extends GlobalFlagOptions = {}>
570
582
  inspector(inspector: Inspector): this;
571
583
  /**
572
584
  * Parse the command line arguments
585
+ *
573
586
  * @param args
587
+ * @param optionsOrArgv
574
588
  * @returns
575
589
  * @example
576
590
  * ```ts
@@ -581,6 +595,7 @@ declare class Clerc<C extends Commands = {}, GF extends GlobalFlagOptions = {}>
581
595
  parse(optionsOrArgv?: string[] | ParseOptions): this;
582
596
  /**
583
597
  * Run matched command
598
+ *
584
599
  * @returns
585
600
  * @example
586
601
  * ```ts
@@ -592,13 +607,6 @@ declare class Clerc<C extends Commands = {}, GF extends GlobalFlagOptions = {}>
592
607
  runMatchedCommand(): this;
593
608
  }
594
609
 
595
- type MaybeArray<T> = T | T[];
596
-
597
- declare const definePlugin: <T extends Clerc<{}, {}>, U extends Clerc<{}, {}>>(p: Plugin<T, U>) => Plugin<T, U>;
598
- declare const defineHandler: <C extends Clerc<{}, {}>, K extends keyof C["_commands"]>(_cli: C, _key: K, handler: Handler<C["_commands"], K>) => Handler<C["_commands"], K>;
599
- declare const defineInspector: <C extends Clerc<{}, {}>>(_cli: C, inspector: Inspector<C["_commands"]>) => Inspector<C["_commands"]>;
600
- declare const defineCommand: <N extends string | typeof Root, O extends CommandOptions<[...P], MaybeArray<string | typeof Root>, Flags>, P extends string[]>(command: Command<N, O & CommandOptions<[...P], MaybeArray<string | typeof Root>, Flags>>, handler?: HandlerInCommand<HandlerContext<Record<N, Command<N, O>> & Record<never, never>, N, {}>> | undefined) => CommandWithHandler<N, O & CommandOptions<[...P], MaybeArray<string | typeof Root>, Flags>>;
601
-
602
610
  declare class CommandExistsError extends Error {
603
611
  commandName: string;
604
612
  constructor(commandName: string, t: TranslateFn);
@@ -632,6 +640,13 @@ declare class LocaleNotCalledFirstError extends Error {
632
640
  constructor(t: TranslateFn);
633
641
  }
634
642
 
643
+ type MaybeArray<T> = T | T[];
644
+
645
+ declare const definePlugin: <T extends Clerc<{}, {}>, U extends Clerc<{}, {}>>(p: Plugin<T, U>) => Plugin<T, U>;
646
+ declare const defineHandler: <C extends Clerc<{}, {}>, K extends keyof C["_commands"]>(_cli: C, _key: K, handler: Handler<C["_commands"], K>) => Handler<C["_commands"], K>;
647
+ declare const defineInspector: <C extends Clerc<{}, {}>>(_cli: C, inspector: Inspector<C["_commands"]>) => Inspector<C["_commands"]>;
648
+ declare const defineCommand: <N extends string | typeof Root, O extends CommandOptions<[...P], MaybeArray<string | typeof Root>, Flags>, P extends string[]>(command: Command<N, O & CommandOptions<[...P], MaybeArray<string | typeof Root>, Flags>>, handler?: HandlerInCommand<HandlerContext<Record<N, Command<N, O>> & Record<never, never>, N, {}>> | undefined) => CommandWithHandler<N, O & CommandOptions<[...P], MaybeArray<string | typeof Root>, Flags>>;
649
+
635
650
  declare function resolveFlattenCommands(commands: Commands, t: TranslateFn): Map<string[] | typeof Root, CommandAlias>;
636
651
  declare function resolveCommand(commands: Commands, argv: string[], t: TranslateFn): [Command<string | RootType> | undefined, string[] | RootType | undefined];
637
652
  declare const resolveArgv: () => string[];
@@ -647,6 +662,8 @@ interface CompletionsPluginOptions {
647
662
  }
648
663
  declare const completionsPlugin: (options?: CompletionsPluginOptions) => Plugin<Clerc<{}, {}>, Clerc<{}, {}>>;
649
664
 
665
+ declare const friendlyErrorPlugin: () => Plugin<Clerc<{}, {}>, Clerc<{}, {}>>;
666
+
650
667
  interface BlockSection {
651
668
  type?: "block";
652
669
  title: string;
@@ -679,16 +696,19 @@ declare module "@clerc/core" {
679
696
  interface HelpPluginOptions {
680
697
  /**
681
698
  * Whether to register the help command.
699
+ *
682
700
  * @default true
683
701
  */
684
702
  command?: boolean;
685
703
  /**
686
704
  * Whether to register the global help flag.
705
+ *
687
706
  * @default true
688
707
  */
689
708
  flag?: boolean;
690
709
  /**
691
710
  * Whether to show help when no command is specified.
711
+ *
692
712
  * @default true
693
713
  */
694
714
  showHelpWhenNoCommand?: boolean;
@@ -714,17 +734,17 @@ declare const strictFlagsPlugin: () => Plugin<Clerc<{}, {}>, Clerc<{}, {}>>;
714
734
  interface VersionPluginOptions {
715
735
  /**
716
736
  * Whether to register the help command.
737
+ *
717
738
  * @default true
718
739
  */
719
740
  command?: boolean;
720
741
  /**
721
- * Whether to register the global help flag.
722
- * @default true
723
- */
742
+ * Whether to register the global help flag.
743
+ *
744
+ * @default true
745
+ */
724
746
  flag?: boolean;
725
747
  }
726
748
  declare const versionPlugin: ({ command, flag, }?: VersionPluginOptions) => Plugin<Clerc<{}, {}>, Clerc<{}, {}>>;
727
749
 
728
- declare const friendlyErrorPlugin: () => Plugin<Clerc<{}, {}>, Clerc<{}, {}>>;
729
-
730
750
  export { Clerc, Command, CommandAlias, CommandCustomProperties, CommandExistsError, CommandNameConflictError, CommandOptions, CommandType, CommandWithHandler, Commands, CompletionsPluginOptions, DescriptionNotSetError, FallbackType, Flag, FlagOptions, Flags, GlobalFlagOption, GlobalFlagOptions, Handler, HandlerContext, HandlerInCommand, HelpPluginOptions, I18N, Inspector, InspectorContext, InspectorFn, InspectorObject, InvalidCommandNameError, LocaleNotCalledFirstError, Locales, MakeEventMap, NameNotSetError, NoCommandGivenError, NoSuchCommandError, ParseOptions, Plugin, Root, RootType, TranslateFn, VersionNotSetError, completionsPlugin, compose, defineCommand, defineHandler, defineInspector, definePlugin, detectLocale, formatCommandName, friendlyErrorPlugin, helpPlugin, isValidName, notFoundPlugin, resolveArgv, resolveCommand, resolveFlattenCommands, strictFlagsPlugin, stripFlags, versionPlugin, withBrackets };
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import{format as Pu}from"node:util";import du from"tty";class PD{constructor(){this.listenerMap={},this.wildcardListeners=new Set}on(e,t){return e==="*"?(this.wildcardListeners.add(t),this):(this.listenerMap[e]||(this.listenerMap[e]=new Set),this.listenerMap[e].add(t),this)}emit(e,...t){return this.listenerMap[e]&&(this.wildcardListeners.forEach(n=>n.apply(null,[e,...t])),this.listenerMap[e].forEach(n=>n(...t))),this}off(e,t){var n,r;return e===void 0?(this.listenerMap={},this.wildcardListeners.clear(),this):e==="*"?(t?this.wildcardListeners.delete(t):this.wildcardListeners.clear(),this):(t?(n=this.listenerMap[e])==null||n.delete(t):(r=this.listenerMap[e])==null||r.clear(),this)}}const HD="known-flag",UD="unknown-flag",GD="argument",{stringify:q}=JSON,zD=/\B([A-Z])/g,YD=u=>u.replace(zD,"-$1").toLowerCase(),{hasOwnProperty:qD}=Object.prototype,Z=(u,e)=>qD.call(u,e),ZD=u=>Array.isArray(u),Hu=u=>typeof u=="function"?[u,!1]:ZD(u)?[u[0],!0]:Hu(u.type),VD=(u,e)=>u===Boolean?e!=="false":e,JD=(u,e)=>typeof e=="boolean"?e:u===Number&&e===""?Number.NaN:u(e),KD=/[\s.:=]/,QD=u=>{const e=`Flag name ${q(u)}`;if(u.length===0)throw new Error(`${e} cannot be empty`);if(u.length===1)throw new Error(`${e} must be longer than a character`);const t=u.match(KD);if(t)throw new Error(`${e} cannot contain ${q(t==null?void 0:t[0])}`)},XD=u=>{const e={},t=(n,r)=>{if(Z(e,n))throw new Error(`Duplicate flags named ${q(n)}`);e[n]=r};for(const n in u){if(!Z(u,n))continue;QD(n);const r=u[n],s=[[],...Hu(r),r];t(n,s);const D=YD(n);if(n!==D&&t(D,s),"alias"in r&&typeof r.alias=="string"){const{alias:i}=r,o=`Flag alias ${q(i)} for flag ${q(n)}`;if(i.length===0)throw new Error(`${o} cannot be empty`);if(i.length>1)throw new Error(`${o} must be a single character`);t(i,s)}}return e},ue=(u,e)=>{const t={};for(const n in u){if(!Z(u,n))continue;const[r,,s,D]=e[n];if(r.length===0&&"default"in D){let{default:i}=D;typeof i=="function"&&(i=i()),t[n]=i}else t[n]=s?r:r.pop()}return t},ou="--",De=/[.:=]/,ee=/^-{1,2}\w/,te=u=>{if(!ee.test(u))return;const e=!u.startsWith(ou);let t=u.slice(e?1:2),n;const r=t.match(De);if(r){const{index:s}=r;n=t.slice(s+1),t=t.slice(0,s)}return[t,n,e]},ne=(u,{onFlag:e,onArgument:t})=>{let n;const r=(s,D)=>{if(typeof n!="function")return!0;n(s,D),n=void 0};for(let s=0;s<u.length;s+=1){const D=u[s];if(D===ou){r();const o=u.slice(s+1);t==null||t(o,[s],!0);break}const i=te(D);if(i){if(r(),!e)continue;const[o,a,F]=i;if(F)for(let l=0;l<o.length;l+=1){r();const C=l===o.length-1;n=e(o[l],C?a:void 0,[s,l+1,C])}else n=e(o,a,[s])}else r(D,[s])&&(t==null||t([D],[s]))}r()},re=(u,e)=>{for(const[t,n,r]of e.reverse()){if(n){const s=u[t];let D=s.slice(0,n);if(r||(D+=s.slice(n+1)),D!=="-"){u[t]=D;continue}}u.splice(t,1)}},Uu=(u,e=process.argv.slice(2),{ignore:t}={})=>{const n=[],r=XD(u),s={},D=[];return D[ou]=[],ne(e,{onFlag(i,o,a){const F=Z(r,i);if(!(t!=null&&t(F?HD:UD,i,o))){if(F){const[l,C]=r[i],E=VD(C,o),c=(h,p)=>{n.push(a),p&&n.push(p),l.push(JD(C,h||""))};return E===void 0?c:c(E)}Z(s,i)||(s[i]=[]),s[i].push(o===void 0?!0:o),n.push(a)}},onArgument(i,o,a){t!=null&&t(GD,e[o[0]])||(D.push(...i),a?(D[ou]=i,e.splice(o[0])):n.push(o))}}),re(e,n),{flags:ue(u,r),unknownFlags:s,_:D}};function gu(u){return u!==null&&typeof u=="object"}function fu(u,e,t=".",n){if(!gu(e))return fu(u,{},t,n);const r=Object.assign({},e);for(const s in u){if(s==="__proto__"||s==="constructor")continue;const D=u[s];D!=null&&(n&&n(r,s,D,t)||(Array.isArray(D)&&Array.isArray(r[s])?r[s]=[...D,...r[s]]:gu(D)&&gu(r[s])?r[s]=fu(D,r[s],(t?`${t}.`:"")+s.toString(),n):r[s]=D))}return r}function se(u){return(...e)=>e.reduce((t,n)=>fu(t,n,"",u),{})}const oe=se(),Gu=u=>Array.isArray(u)?u:[u],ie=u=>u.replace(/[\W_]([a-z\d])?/gi,(e,t)=>t?t.toUpperCase():""),ae=(u,e)=>e.length!==u.length?!1:u.every((t,n)=>t===e[n]),Fe=(u,e)=>e.length>u.length?!1:ae(u.slice(0,e.length),e),V=JSON.stringify;class zu extends Error{constructor(e,t){super(t("core.commandExists",V(e))),this.commandName=e}}class iu extends Error{constructor(e,t){super(t("core.noSuchCommand",V(e))),this.commandName=e}}class au extends Error{constructor(e){super(e("core.noCommandGiven"))}}class Yu extends Error{constructor(e,t,n){super(n("core.commandNameConflict",V(e),V(t))),this.n1=e,this.n2=t}}class qu extends Error{constructor(e){super(e("core.nameNotSet"))}}class Zu extends Error{constructor(e){super(e("core.descriptionNotSet"))}}class Vu extends Error{constructor(e){super(e("core.versionNotSet"))}}class Ju extends Error{constructor(e,t){super(t("core.badNameFormat",V(e))),this.commandName=e}}class Au extends Error{constructor(e){super(e("core.localeMustBeCalledFirst"))}}const Ku=typeof Deno!="undefined",Ce=typeof process!="undefined"&&!Ku,le=process.versions.electron&&!process.defaultApp;function Qu(u,e,t,n){if(t.alias){const r=Gu(t.alias);for(const s of r){if(s in e)throw new Yu(e[s].name,t.name,n);u.set(typeof s=="symbol"?s:s.split(" "),{...t,__isAlias:!0})}}}function xu(u,e){const t=new Map;u[d]&&(t.set(d,u[d]),Qu(t,u,u[d],e));for(const n of Object.values(u))Qu(t,u,n,e),t.set(n.name.split(" "),n);return t}function Xu(u,e,t){const n=xu(u,t);for(const[r,s]of n.entries()){const D=Uu((s==null?void 0:s.flags)||{},[...e]),{_:i}=D;if(r!==d&&Fe(i,r))return[s,r]}return n.has(d)?[n.get(d),d]:[void 0,void 0]}const $u=()=>Ce?process.argv.slice(le?1:2):Ku?Deno.args:[];function uD(u){const e={pre:[],normal:[],post:[]};for(const n of u){const r=typeof n=="object"?n:{fn:n},{enforce:s,fn:D}=r;s==="post"||s==="pre"?e[s].push(D):e.normal.push(D)}const t=[...e.pre,...e.normal,...e.post];return n=>{const r=[];let s=0;const D=i=>{s=i;const o=t[i],a=o(n,D.bind(null,i+1));a&&r.push(a)};if(D(0),s+1===t.length)for(const i of r)i()}}const ce=/\s\s+/,DD=u=>u===d?!0:!(u.startsWith(" ")||u.endsWith(" "))&&!ce.test(u),eD=(u,e)=>e?`[${u}]`:`<${u}>`,Ee="<Root>",U=u=>Array.isArray(u)?u.join(" "):typeof u=="string"?u:Ee,tD=()=>process.env.CLERC_LOCALE?process.env.CLERC_LOCALE:Intl.DateTimeFormat().resolvedOptions().locale,nD=u=>u.filter(e=>!e.startsWith("-")),{stringify:G}=JSON;function Su(u,e){const t=[];let n,r;for(const s of u){if(r)throw new Error(e("core.spreadParameterMustBeLast",G(r)));const D=s[0],i=s[s.length-1];let o;if(D==="<"&&i===">"&&(o=!0,n))throw new Error(e("core.requiredParameterMustBeBeforeOptional",G(s),G(n)));if(D==="["&&i==="]"&&(o=!1,n=s),o===void 0)throw new Error(e("core.parameterMustBeWrappedInBrackets",G(s)));let a=s.slice(1,-1);const F=a.slice(-3)==="...";F&&(r=s,a=a.slice(0,-3)),t.push({name:a,required:o,spread:F})}return t}function wu(u,e,t,n){for(let r=0;r<e.length;r+=1){const{name:s,required:D,spread:i}=e[r],o=ie(s);if(o in u)throw new Error(n("core.parameterIsUsedMoreThanOnce",G(s)));const a=i?t.slice(r):t[r];if(i&&(r=e.length),D&&(!a||i&&a.length===0))throw new Error(n("core.missingRequiredParameter",G(s)));u[o]=a}}const me={en:{"core.commandExists":'Command "%s" exists.',"core.noSuchCommand":"No such command: %s.","core.noCommandGiven":"No command given.","core.commandNameConflict":"Command name %s conflicts with %s. Maybe caused by alias.","core.nameNotSet":"Name not set.","core.descriptionNotSet":"Description not set.","core.versionNotSet":"Version not set.","core.badNameFormat":"Bad name format: %s.","core.localeMustBeCalledFirst":"locale() or fallbackLocale() must be called at first.","core.cliParseMustBeCalled":"cli.parse() must be called.","core.spreadParameterMustBeLast":"Invalid Parameter: Spread parameter %s must be last.","core.requiredParameterCannotComeAfterOptionalParameter":"Invalid Parameter: Required parameter %s cannot come after optional parameter %s.","core.parameterMustBeWrappedInBrackets":"Invalid Parameter: Parameter %s must be wrapped in <> (required parameter) or [] (optional parameter).","core.parameterIsUsedMoreThanOnce":"Invalid Parameter: Parameter %s is used more than once.","core.missingRequiredParameter":"Missing required parameter %s."},"zh-CN":{"core.commandExists":'\u547D\u4EE4 "%s" \u5DF2\u5B58\u5728\u3002',"core.noSuchCommand":"\u627E\u4E0D\u5230\u547D\u4EE4: %s\u3002","core.noCommandGiven":"\u6CA1\u6709\u8F93\u5165\u547D\u4EE4\u3002","core.commandNameConflict":"\u547D\u4EE4\u540D\u79F0 %s \u548C %s \u51B2\u7A81\u3002 \u53EF\u80FD\u662F\u7531\u4E8E\u522B\u540D\u5BFC\u81F4\u7684\u3002","core.nameNotSet":"\u672A\u8BBE\u7F6ECLI\u540D\u79F0\u3002","core.descriptionNotSet":"\u672A\u8BBE\u7F6ECLI\u63CF\u8FF0\u3002","core.versionNotSet":"\u672A\u8BBE\u7F6ECLI\u7248\u672C\u3002","core.badNameFormat":"\u9519\u8BEF\u7684\u547D\u4EE4\u540D\u5B57\u683C\u5F0F: %s\u3002","core.localeMustBeCalledFirst":"locale() \u6216 fallbackLocale() \u5FC5\u987B\u5728\u6700\u5F00\u59CB\u8C03\u7528\u3002","core.cliParseMustBeCalled":"cli.parse() \u5FC5\u987B\u88AB\u8C03\u7528\u3002","core.spreadParameterMustBeLast":"\u4E0D\u5408\u6CD5\u7684\u53C2\u6570: \u5C55\u5F00\u53C2\u6570 %s \u5FC5\u987B\u5728\u6700\u540E\u3002","core.requiredParameterCannotComeAfterOptionalParameter":"\u4E0D\u5408\u6CD5\u7684\u53C2\u6570: \u5FC5\u586B\u53C2\u6570 %s \u4E0D\u80FD\u5728\u53EF\u9009\u53C2\u6570 %s \u4E4B\u540E\u3002","core.parameterMustBeWrappedInBrackets":"\u4E0D\u5408\u6CD5\u7684\u53C2\u6570: \u53C2\u6570 %s \u5FC5\u987B\u88AB <> (\u5FC5\u586B\u53C2\u6570) \u6216 [] (\u53EF\u9009\u53C2\u6570) \u5305\u88F9\u3002","core.parameterIsUsedMoreThanOnce":"\u4E0D\u5408\u6CD5\u7684\u53C2\u6570: \u53C2\u6570 %s \u88AB\u4F7F\u7528\u4E86\u591A\u6B21\u3002","core.missingRequiredParameter":"\u7F3A\u5C11\u5FC5\u586B\u53C2\u6570 %s\u3002"}};var bu=(u,e,t)=>{if(!e.has(u))throw TypeError("Cannot "+t)},m=(u,e,t)=>(bu(u,e,"read from private field"),t?t.call(u):e.get(u)),x=(u,e,t)=>{if(e.has(u))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(u):e.set(u,t)},O=(u,e,t,n)=>(bu(u,e,"write to private field"),n?n.call(u,t):e.set(u,t),t),$=(u,e,t)=>(bu(u,e,"access private method"),t),I,R,j,J,K,Fu,Q,z,X,uu,Du,eu,tu,W,yu,rD,vu,sD,Ou,oD,M,N,_u,iD,Mu,aD,Tu,FD,Cu,Nu,Lu,CD;const d=Symbol.for("Clerc.Root"),lD=class{constructor(u,e,t){x(this,yu),x(this,vu),x(this,Ou),x(this,M),x(this,_u),x(this,Mu),x(this,Tu),x(this,Cu),x(this,Lu),x(this,I,""),x(this,R,""),x(this,j,""),x(this,J,[]),x(this,K,{}),x(this,Fu,new PD),x(this,Q,{}),x(this,z,new Set),x(this,X,void 0),x(this,uu,[]),x(this,Du,!1),x(this,eu,"en"),x(this,tu,"en"),x(this,W,{}),this.i18n={add:n=>{O(this,W,oe(m(this,W),n))},t:(n,...r)=>{const s=m(this,W)[m(this,tu)]||m(this,W)[m(this,eu)],D=m(this,W)[m(this,eu)];return s[n]?Pu(s[n],...r):D[n]?Pu(D[n],...r):void 0}},O(this,I,u||m(this,I)),O(this,R,e||m(this,R)),O(this,j,t||m(this,j)),O(this,tu,tD()),$(this,Ou,oD).call(this)}get _name(){return m(this,I)}get _description(){return m(this,R)}get _version(){return m(this,j)}get _inspectors(){return m(this,J)}get _commands(){return m(this,K)}get _flags(){return m(this,Q)}static create(u,e,t){return new lD(u,e,t)}name(u){return $(this,M,N).call(this),O(this,I,u),this}description(u){return $(this,M,N).call(this),O(this,R,u),this}version(u){return $(this,M,N).call(this),O(this,j,u),this}locale(u){if(m(this,Du))throw new Au(this.i18n.t);return O(this,tu,u),this}fallbackLocale(u){if(m(this,Du))throw new Au(this.i18n.t);return O(this,eu,u),this}errorHandler(u){return m(this,uu).push(u),this}command(u,e,t={}){return $(this,Cu,Nu).call(this,()=>$(this,_u,iD).call(this,u,e,t)),this}flag(u,e,t){return m(this,Q)[u]={description:e,...t},this}on(u,e){return m(this,Fu).on(u,e),this}use(u){return $(this,M,N).call(this),u.setup(this)}inspector(u){return $(this,M,N).call(this),m(this,J).push(u),this}parse(u=$u()){$(this,M,N).call(this);const{argv:e,run:t}=Array.isArray(u)?{argv:u,run:!0}:{argv:$u(),...u};return O(this,X,[...e]),$(this,Mu,aD).call(this),t&&this.runMatchedCommand(),this}runMatchedCommand(){return $(this,Cu,Nu).call(this,()=>$(this,Lu,CD).call(this)),process.title=m(this,I),this}};let he=lD;I=new WeakMap,R=new WeakMap,j=new WeakMap,J=new WeakMap,K=new WeakMap,Fu=new WeakMap,Q=new WeakMap,z=new WeakMap,X=new WeakMap,uu=new WeakMap,Du=new WeakMap,eu=new WeakMap,tu=new WeakMap,W=new WeakMap,yu=new WeakSet,rD=function(){return m(this,z).has(d)},vu=new WeakSet,sD=function(){return Object.prototype.hasOwnProperty.call(this._commands,d)},Ou=new WeakSet,oD=function(){this.i18n.add(me)},M=new WeakSet,N=function(){O(this,Du,!0)},_u=new WeakSet,iD=function(u,e,t={}){$(this,M,N).call(this);const{t:n}=this.i18n,r=(F=>!(typeof F=="string"||F===d))(u),s=r?u.name:u;if(!DD(s))throw new Ju(s,n);const{handler:D=void 0,...i}=r?u:{name:s,description:e,...t},o=[i.name],a=i.alias?Gu(i.alias):[];i.alias&&o.push(...a);for(const F of o)if(m(this,z).has(F))throw new zu(U(F),n);return m(this,K)[s]=i,m(this,z).add(i.name),a.forEach(F=>m(this,z).add(F)),r&&D&&this.on(u.name,D),this},Mu=new WeakSet,aD=function(){const{t:u}=this.i18n;if(!m(this,I))throw new qu(u);if(!m(this,R))throw new Zu(u);if(!m(this,j))throw new Vu(u)},Tu=new WeakSet,FD=function(u){const e=m(this,X),{t}=this.i18n,[n,r]=u(),s=!!n,D={...m(this,Q),...n==null?void 0:n.flags},i=Uu(D,[...e]),{_:o,flags:a,unknownFlags:F}=i;let l=!s||n.name===d?o:o.slice(n.name.split(" ").length),C=(n==null?void 0:n.parameters)||[];const E=C.indexOf("--"),c=C.slice(E+1)||[],h=Object.create(null);if(E>-1&&c.length>0){C=C.slice(0,E);const v=o["--"];l=l.slice(0,-v.length||void 0),wu(h,Su(C,t),l,t),wu(h,Su(c,t),v,t)}else wu(h,Su(C,t),l,t);const p={...a,...F};return{name:n==null?void 0:n.name,called:Array.isArray(r)?r.join(" "):r,resolved:s,hasRootOrAlias:m(this,yu,rD),hasRoot:m(this,vu,sD),raw:{...i,parameters:l,mergedFlags:p},parameters:h,flags:a,unknownFlags:F,cli:this}},Cu=new WeakSet,Nu=function(u){try{u()}catch(e){if(m(this,uu).length>0)m(this,uu).forEach(t=>t(e));else throw e}},Lu=new WeakSet,CD=function(){$(this,M,N).call(this);const{t:u}=this.i18n,e=m(this,X);if(!e)throw new Error(u("core.cliParseMustBeCalled"));const t=()=>Xu(m(this,K),e,u),n=()=>$(this,Tu,FD).call(this,t),r={enforce:"post",fn:D=>{const[i]=t(),o=nD(e).join(" ");if(!i)throw o?new iu(o,u):new au(u);m(this,Fu).emit(i.name,D)}},s=[...m(this,J),r];uD(s)(n())};const P=u=>u,Be=(u,e,t)=>t,pe=(u,e)=>e,de=(u,e)=>({...u,handler:e}),ge=u=>`
2
- ${u})
3
- cmd+="__${u}"
4
- ;;`,fe=u=>{const{cli:e}=u,{_name:t,_commands:n}=e;return`_${t}() {
1
+ import{format as ku}from"node:util";import jD from"tty";import Ru from"node:tty";const ju=D=>Array.isArray(D)?D:[D],WD=D=>D.replace(/[\W_]([a-z\d])?/gi,(e,t)=>t?t.toUpperCase():""),PD=(D,e)=>e.length!==D.length?!1:D.every((t,n)=>t===e[n]),HD=(D,e)=>e.length>D.length?!1:PD(D.slice(0,e.length),e);function pu(D){return D!==null&&typeof D=="object"}function du(D,e,t=".",n){if(!pu(e))return du(D,{},t,n);const r=Object.assign({},e);for(const s in D){if(s==="__proto__"||s==="constructor")continue;const u=D[s];u!=null&&(n&&n(r,s,u,t)||(Array.isArray(u)&&Array.isArray(r[s])?r[s]=[...u,...r[s]]:pu(u)&&pu(r[s])?r[s]=du(u,r[s],(t?`${t}.`:"")+s.toString(),n):r[s]=u))}return r}function UD(D){return(...e)=>e.reduce((t,n)=>du(t,n,"",D),{})}const zD=UD();class qD{constructor(){this.listenerMap={},this.wildcardListeners=new Set}on(e,t){return e==="*"?(this.wildcardListeners.add(t),this):(this.listenerMap[e]||(this.listenerMap[e]=new Set),this.listenerMap[e].add(t),this)}emit(e,...t){return this.listenerMap[e]&&(this.wildcardListeners.forEach(n=>n.apply(null,[e,...t])),this.listenerMap[e].forEach(n=>n(...t))),this}off(e,t){var n,r;return e===void 0?(this.listenerMap={},this.wildcardListeners.clear(),this):e==="*"?(t?this.wildcardListeners.delete(t):this.wildcardListeners.clear(),this):(t?(n=this.listenerMap[e])==null||n.delete(t):(r=this.listenerMap[e])==null||r.clear(),this)}}const GD="known-flag",YD="unknown-flag",ZD="argument",{stringify:G}=JSON,VD=/\B([A-Z])/g,JD=D=>D.replace(VD,"-$1").toLowerCase(),{hasOwnProperty:KD}=Object.prototype,Y=(D,e)=>KD.call(D,e),QD=D=>Array.isArray(D),Wu=D=>typeof D=="function"?[D,!1]:QD(D)?[D[0],!0]:Wu(D.type),XD=(D,e)=>D===Boolean?e!=="false":e,ue=(D,e)=>typeof e=="boolean"?e:D===Number&&e===""?Number.NaN:D(e),De=/[\s.:=]/,ee=D=>{const e=`Flag name ${G(D)}`;if(D.length===0)throw new Error(`${e} cannot be empty`);if(D.length===1)throw new Error(`${e} must be longer than a character`);const t=D.match(De);if(t)throw new Error(`${e} cannot contain ${G(t==null?void 0:t[0])}`)},te=D=>{const e={},t=(n,r)=>{if(Y(e,n))throw new Error(`Duplicate flags named ${G(n)}`);e[n]=r};for(const n in D){if(!Y(D,n))continue;ee(n);const r=D[n],s=[[],...Wu(r),r];t(n,s);const u=JD(n);if(n!==u&&t(u,s),"alias"in r&&typeof r.alias=="string"){const{alias:i}=r,o=`Flag alias ${G(i)} for flag ${G(n)}`;if(i.length===0)throw new Error(`${o} cannot be empty`);if(i.length>1)throw new Error(`${o} must be a single character`);t(i,s)}}return e},ne=(D,e)=>{const t={};for(const n in D){if(!Y(D,n))continue;const[r,,s,u]=e[n];if(r.length===0&&"default"in u){let{default:i}=u;typeof i=="function"&&(i=i()),t[n]=i}else t[n]=s?r:r.pop()}return t},su="--",re=/[.:=]/,se=/^-{1,2}\w/,oe=D=>{if(!se.test(D))return;const e=!D.startsWith(su);let t=D.slice(e?1:2),n;const r=t.match(re);if(r){const{index:s}=r;n=t.slice(s+1),t=t.slice(0,s)}return[t,n,e]},Fe=(D,{onFlag:e,onArgument:t})=>{let n;const r=(s,u)=>{if(typeof n!="function")return!0;n(s,u),n=void 0};for(let s=0;s<D.length;s+=1){const u=D[s];if(u===su){r();const o=D.slice(s+1);t==null||t(o,[s],!0);break}const i=oe(u);if(i){if(r(),!e)continue;const[o,a,F]=i;if(F)for(let c=0;c<o.length;c+=1){r();const C=c===o.length-1;n=e(o[c],C?a:void 0,[s,c+1,C])}else n=e(o,a,[s])}else r(u,[s])&&(t==null||t([u],[s]))}r()},ae=(D,e)=>{for(const[t,n,r]of e.reverse()){if(n){const s=D[t];let u=s.slice(0,n);if(r||(u+=s.slice(n+1)),u!=="-"){D[t]=u;continue}}D.splice(t,1)}},Pu=(D,e=process.argv.slice(2),{ignore:t}={})=>{const n=[],r=te(D),s={},u=[];return u[su]=[],Fe(e,{onFlag(i,o,a){const F=Y(r,i);if(!(t!=null&&t(F?GD:YD,i,o))){if(F){const[c,C]=r[i],l=XD(C,o),E=(m,p)=>{n.push(a),p&&n.push(p),c.push(ue(C,m||""))};return l===void 0?E:E(l)}Y(s,i)||(s[i]=[]),s[i].push(o===void 0?!0:o),n.push(a)}},onArgument(i,o,a){t!=null&&t(ZD,e[o[0]])||(u.push(...i),a?(u[su]=i,e.splice(o[0])):n.push(o))}}),ae(e,n),{flags:ne(D,r),unknownFlags:s,_:u}},Z=JSON.stringify;class Hu extends Error{constructor(e,t){super(t("core.commandExists",Z(e))),this.commandName=e}}class ou extends Error{constructor(e,t){super(t("core.noSuchCommand",Z(e))),this.commandName=e}}class Fu extends Error{constructor(e){super(e("core.noCommandGiven"))}}class Uu extends Error{constructor(e,t,n){super(n("core.commandNameConflict",Z(e),Z(t))),this.n1=e,this.n2=t}}class zu extends Error{constructor(e){super(e("core.nameNotSet"))}}class qu extends Error{constructor(e){super(e("core.descriptionNotSet"))}}class Gu extends Error{constructor(e){super(e("core.versionNotSet"))}}class Yu extends Error{constructor(e,t){super(t("core.badNameFormat",Z(e))),this.commandName=e}}class Bu extends Error{constructor(e){super(e("core.localeMustBeCalledFirst"))}}const ie={en:{"core.commandExists":'Command "%s" exists.',"core.noSuchCommand":"No such command: %s.","core.noCommandGiven":"No command given.","core.commandNameConflict":"Command name %s conflicts with %s. Maybe caused by alias.","core.nameNotSet":"Name not set.","core.descriptionNotSet":"Description not set.","core.versionNotSet":"Version not set.","core.badNameFormat":"Bad name format: %s.","core.localeMustBeCalledFirst":"locale() or fallbackLocale() must be called at first.","core.cliParseMustBeCalled":"cli.parse() must be called.","core.spreadParameterMustBeLast":"Invalid Parameter: Spread parameter %s must be last.","core.requiredParameterCannotComeAfterOptionalParameter":"Invalid Parameter: Required parameter %s cannot come after optional parameter %s.","core.parameterMustBeWrappedInBrackets":"Invalid Parameter: Parameter %s must be wrapped in <> (required parameter) or [] (optional parameter).","core.parameterIsUsedMoreThanOnce":"Invalid Parameter: Parameter %s is used more than once.","core.missingRequiredParameter":"Missing required parameter %s."},"zh-CN":{"core.commandExists":'\u547D\u4EE4 "%s" \u5DF2\u5B58\u5728\u3002',"core.noSuchCommand":"\u627E\u4E0D\u5230\u547D\u4EE4: %s\u3002","core.noCommandGiven":"\u6CA1\u6709\u8F93\u5165\u547D\u4EE4\u3002","core.commandNameConflict":"\u547D\u4EE4\u540D\u79F0 %s \u548C %s \u51B2\u7A81\u3002 \u53EF\u80FD\u662F\u7531\u4E8E\u522B\u540D\u5BFC\u81F4\u7684\u3002","core.nameNotSet":"\u672A\u8BBE\u7F6ECLI\u540D\u79F0\u3002","core.descriptionNotSet":"\u672A\u8BBE\u7F6ECLI\u63CF\u8FF0\u3002","core.versionNotSet":"\u672A\u8BBE\u7F6ECLI\u7248\u672C\u3002","core.badNameFormat":"\u9519\u8BEF\u7684\u547D\u4EE4\u540D\u5B57\u683C\u5F0F: %s\u3002","core.localeMustBeCalledFirst":"locale() \u6216 fallbackLocale() \u5FC5\u987B\u5728\u6700\u5F00\u59CB\u8C03\u7528\u3002","core.cliParseMustBeCalled":"cli.parse() \u5FC5\u987B\u88AB\u8C03\u7528\u3002","core.spreadParameterMustBeLast":"\u4E0D\u5408\u6CD5\u7684\u53C2\u6570: \u5C55\u5F00\u53C2\u6570 %s \u5FC5\u987B\u5728\u6700\u540E\u3002","core.requiredParameterCannotComeAfterOptionalParameter":"\u4E0D\u5408\u6CD5\u7684\u53C2\u6570: \u5FC5\u586B\u53C2\u6570 %s \u4E0D\u80FD\u5728\u53EF\u9009\u53C2\u6570 %s \u4E4B\u540E\u3002","core.parameterMustBeWrappedInBrackets":"\u4E0D\u5408\u6CD5\u7684\u53C2\u6570: \u53C2\u6570 %s \u5FC5\u987B\u88AB <> (\u5FC5\u586B\u53C2\u6570) \u6216 [] (\u53EF\u9009\u53C2\u6570) \u5305\u88F9\u3002","core.parameterIsUsedMoreThanOnce":"\u4E0D\u5408\u6CD5\u7684\u53C2\u6570: \u53C2\u6570 %s \u88AB\u4F7F\u7528\u4E86\u591A\u6B21\u3002","core.missingRequiredParameter":"\u7F3A\u5C11\u5FC5\u586B\u53C2\u6570 %s\u3002"}},{stringify:H}=JSON;function fu(D,e){const t=[];let n,r;for(const s of D){if(r)throw new Error(e("core.spreadParameterMustBeLast",H(r)));const u=s[0],i=s[s.length-1];let o;if(u==="<"&&i===">"&&(o=!0,n))throw new Error(e("core.requiredParameterMustBeBeforeOptional",H(s),H(n)));if(u==="["&&i==="]"&&(o=!1,n=s),o===void 0)throw new Error(e("core.parameterMustBeWrappedInBrackets",H(s)));let a=s.slice(1,-1);const F=a.slice(-3)==="...";F&&(r=s,a=a.slice(0,-3)),t.push({name:a,required:o,spread:F})}return t}function Au(D,e,t,n){for(let r=0;r<e.length;r+=1){const{name:s,required:u,spread:i}=e[r],o=WD(s);if(o in D)throw new Error(n("core.parameterIsUsedMoreThanOnce",H(s)));const a=i?t.slice(r):t[r];if(i&&(r=e.length),u&&(!a||i&&a.length===0))throw new Error(n("core.missingRequiredParameter",H(s)));D[o]=a}}const Zu=typeof Deno!="undefined",Ce=typeof process!="undefined"&&!Zu,le=process.versions.electron&&!process.defaultApp;function Vu(D,e,t,n){if(t.alias){const r=ju(t.alias);for(const s of r){if(s in e)throw new Uu(e[s].name,t.name,n);D.set(typeof s=="symbol"?s:s.split(" "),{...t,__isAlias:!0})}}}function gu(D,e){const t=new Map;D[B]&&(t.set(B,D[B]),Vu(t,D,D[B],e));for(const n of Object.values(D))Vu(t,D,n,e),t.set(n.name.split(" "),n);return t}function Ju(D,e,t){var n;const r=gu(D,t);for(const[s,u]of r.entries()){const i=Pu((n=u==null?void 0:u.flags)!=null?n:{},[...e]),{_:o}=i;if(s!==B&&HD(o,s))return[u,s]}return r.has(B)?[r.get(B),B]:[void 0,void 0]}const $u=()=>Ce?process.argv.slice(le?1:2):Zu?Deno.args:[];function Ku(D){const e={pre:[],normal:[],post:[]};for(const n of D){const r=typeof n=="object"?n:{fn:n},{enforce:s,fn:u}=r;s==="post"||s==="pre"?e[s].push(u):e.normal.push(u)}const t=[...e.pre,...e.normal,...e.post];return n=>{return r(0);function r(s){const u=t[s];return u(n,r.bind(null,s+1))}}}const Ee=/\s\s+/,Qu=D=>D===B?!0:!(D.startsWith(" ")||D.endsWith(" "))&&!Ee.test(D),Xu=(D,e)=>e?`[${D}]`:`<${D}>`,ce="<Root>",U=D=>Array.isArray(D)?D.join(" "):typeof D=="string"?D:ce,uD=()=>process.env.CLERC_LOCALE?process.env.CLERC_LOCALE:Intl.DateTimeFormat().resolvedOptions().locale,DD=D=>D.filter(e=>!e.startsWith("-"));var wu=(D,e,t)=>{if(!e.has(D))throw TypeError("Cannot "+t)},h=(D,e,t)=>(wu(D,e,"read from private field"),t?t.call(D):e.get(D)),A=(D,e,t)=>{if(e.has(D))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(D):e.set(D,t)},x=(D,e,t,n)=>(wu(D,e,"write to private field"),n?n.call(D,t):e.set(D,t),t),$=(D,e,t)=>(wu(D,e,"access private method"),t),L,I,k,V,J,au,K,z,Q,X,uu,Du,eu,R,Su,eD,yu,tD,vu,nD,_,M,xu,rD,bu,sD,_u,oD,iu,Mu,Nu,FD;const B=Symbol.for("Clerc.Root"),aD=class{constructor(D,e,t){A(this,Su),A(this,yu),A(this,vu),A(this,_),A(this,xu),A(this,bu),A(this,_u),A(this,iu),A(this,Nu),A(this,L,""),A(this,I,""),A(this,k,""),A(this,V,[]),A(this,J,{}),A(this,au,new qD),A(this,K,{}),A(this,z,new Set),A(this,Q,void 0),A(this,X,[]),A(this,uu,!1),A(this,Du,"en"),A(this,eu,"en"),A(this,R,{}),this.i18n={add:n=>{x(this,R,zD(h(this,R),n))},t:(n,...r)=>{const s=h(this,R)[h(this,eu)]||h(this,R)[h(this,Du)],u=h(this,R)[h(this,Du)];return s[n]?ku(s[n],...r):u[n]?ku(u[n],...r):void 0}},x(this,L,D!=null?D:h(this,L)),x(this,I,e!=null?e:h(this,I)),x(this,k,t!=null?t:h(this,k)),x(this,eu,uD()),$(this,vu,nD).call(this)}get _name(){return h(this,L)}get _description(){return h(this,I)}get _version(){return h(this,k)}get _inspectors(){return h(this,V)}get _commands(){return h(this,J)}get _flags(){return h(this,K)}static create(D,e,t){return new aD(D,e,t)}name(D){return $(this,_,M).call(this),x(this,L,D),this}description(D){return $(this,_,M).call(this),x(this,I,D),this}version(D){return $(this,_,M).call(this),x(this,k,D),this}locale(D){if(h(this,uu))throw new Bu(this.i18n.t);return x(this,eu,D),this}fallbackLocale(D){if(h(this,uu))throw new Bu(this.i18n.t);return x(this,Du,D),this}errorHandler(D){return h(this,X).push(D),this}command(D,e,t={}){return $(this,iu,Mu).call(this,()=>$(this,xu,rD).call(this,D,e,t)),this}flag(D,e,t){return h(this,K)[D]={description:e,...t},this}on(D,e){return h(this,au).on(D,e),this}use(D){return $(this,_,M).call(this),D.setup(this)}inspector(D){return $(this,_,M).call(this),h(this,V).push(D),this}parse(D=$u()){$(this,_,M).call(this);const{argv:e,run:t}=Array.isArray(D)?{argv:D,run:!0}:{argv:$u(),...D};return x(this,Q,[...e]),$(this,bu,sD).call(this),t&&this.runMatchedCommand(),this}runMatchedCommand(){return $(this,iu,Mu).call(this,()=>$(this,Nu,FD).call(this)),process.title=h(this,L),this}};let he=aD;L=new WeakMap,I=new WeakMap,k=new WeakMap,V=new WeakMap,J=new WeakMap,au=new WeakMap,K=new WeakMap,z=new WeakMap,Q=new WeakMap,X=new WeakMap,uu=new WeakMap,Du=new WeakMap,eu=new WeakMap,R=new WeakMap,Su=new WeakSet,eD=function(){return h(this,z).has(B)},yu=new WeakSet,tD=function(){return Object.prototype.hasOwnProperty.call(this._commands,B)},vu=new WeakSet,nD=function(){this.i18n.add(ie)},_=new WeakSet,M=function(){x(this,uu,!0)},xu=new WeakSet,rD=function(D,e,t={}){$(this,_,M).call(this);const{t:n}=this.i18n,r=(F=>!(typeof F=="string"||F===B))(D),s=r?D.name:D;if(!Qu(s))throw new Yu(s,n);const{handler:u=void 0,...i}=r?D:{name:s,description:e,...t},o=[i.name],a=i.alias?ju(i.alias):[];i.alias&&o.push(...a);for(const F of o)if(h(this,z).has(F))throw new Hu(U(F),n);return h(this,J)[s]=i,h(this,z).add(i.name),a.forEach(F=>h(this,z).add(F)),r&&u&&this.on(D.name,u),this},bu=new WeakSet,sD=function(){const{t:D}=this.i18n;if(!h(this,L))throw new zu(D);if(!h(this,I))throw new qu(D);if(!h(this,k))throw new Gu(D)},_u=new WeakSet,oD=function(D){var e;const t=h(this,Q),{t:n}=this.i18n,[r,s]=D(),u=!!r,i={...h(this,K),...r==null?void 0:r.flags},o=Pu(i,[...t]),{_:a,flags:F,unknownFlags:c}=o;let C=!u||r.name===B?a:a.slice(r.name.split(" ").length),l=(e=r==null?void 0:r.parameters)!=null?e:[];const E=l.indexOf("--"),m=l.slice(E+1)||[],p=Object.create(null);if(E>-1&&m.length>0){l=l.slice(0,E);const d=a["--"];C=C.slice(0,-d.length||void 0),Au(p,fu(l,n),C,n),Au(p,fu(m,n),d,n)}else Au(p,fu(l,n),C,n);const y={...F,...c};return{name:r==null?void 0:r.name,called:Array.isArray(s)?s.join(" "):s,resolved:u,hasRootOrAlias:h(this,Su,eD),hasRoot:h(this,yu,tD),raw:{...o,parameters:C,mergedFlags:y},parameters:p,flags:F,unknownFlags:c,cli:this}},iu=new WeakSet,Mu=function(D){try{D()}catch(e){if(h(this,X).length>0)h(this,X).forEach(t=>t(e));else throw e}},Nu=new WeakSet,FD=function(){$(this,_,M).call(this);const{t:D}=this.i18n,e=h(this,Q);if(!e)throw new Error(D("core.cliParseMustBeCalled"));const t=()=>Ju(h(this,J),e,D),n=()=>$(this,_u,oD).call(this,t),r={enforce:"post",fn:u=>{const[i]=t(),o=DD(e).join(" ");if(!i)throw o?new ou(o,D):new Fu(D);h(this,au).emit(i.name,u)}},s=[...h(this,V),r];Ku(s)(n())};const j=D=>D,me=(D,e,t)=>t,pe=(D,e)=>e,de=(D,e)=>({...D,handler:e}),Be=D=>`
2
+ ${D})
3
+ cmd+="__${D}"
4
+ ;;`,fe=D=>{const{cli:e}=D,{_name:t,_commands:n}=e;return`_${t}() {
5
5
  local i cur prev opts cmds
6
6
  COMPREPLY=()
7
7
  cur="\${COMP_WORDS[COMP_CWORD]}"
@@ -15,7 +15,7 @@ import{format as Pu}from"node:util";import du from"tty";class PD{constructor(){t
15
15
  "$1")
16
16
  cmd="${t}"
17
17
  ;;
18
- ${Object.keys(n).map(ge).join("")}
18
+ ${Object.keys(n).map(Be).join("")}
19
19
  *)
20
20
  ;;
21
21
  esac
@@ -23,9 +23,9 @@ ${Object.keys(n).map(ge).join("")}
23
23
  }
24
24
 
25
25
  complete -F _${t} -o bashdefault -o default ${t}
26
- `},cD=u=>u.replace(/([A-Z])/g,(e,t)=>`-${t.toLowerCase()}`),ED=u=>u.length<=1?`-${u}`:`--${cD(u)}`,mD="(No Description)",Ae=u=>`[CompletionResult]::new('${u.name}', '${u.name}', [CompletionResultType]::ParameterValue, '${u.description}')`,xe=u=>Object.entries(u.flags||{}).map(([e,t])=>{const n=[`[CompletionResult]::new('${ED(e)}', '${cD(e)}', [CompletionResultType]::ParameterName, '${u.flags[e].description||mD}')`];return t!=null&&t.alias&&n.push(`[CompletionResult]::new('${ED(t.alias)}', '${t.alias}', [CompletionResultType]::ParameterName, '${u.flags[e].description||mD}')`),n.join(`
26
+ `},iD=D=>D.replace(/([A-Z])/g,(e,t)=>`-${t.toLowerCase()}`),CD=D=>D.length<=1?`-${D}`:`--${iD(D)}`,lD="(No Description)",Ae=D=>`[CompletionResult]::new('${D.name}', '${D.name}', [CompletionResultType]::ParameterValue, '${D.description}')`,ge=D=>{var e;return Object.entries((e=D.flags)!=null?e:{}).map(([t,n])=>{const r=[`[CompletionResult]::new('${CD(t)}', '${iD(t)}', [CompletionResultType]::ParameterName, '${D.flags[t].description||lD}')`];return n!=null&&n.alias&&r.push(`[CompletionResult]::new('${CD(n.alias)}', '${n.alias}', [CompletionResultType]::ParameterName, '${D.flags[t].description||lD}')`),r.join(`
27
27
  `)}).join(`
28
- `),$e=u=>{const{cli:e}=u,{_name:t,_commands:n}=e;return`using namespace System.Management.Automation
28
+ `)},$e=D=>{const{cli:e}=D,{_name:t,_commands:n}=e;return`using namespace System.Management.Automation
29
29
  using namespace System.Management.Automation.Language
30
30
 
31
31
  Register-ArgumentCompleter -Native -CommandName '${t}' -ScriptBlock {
@@ -52,7 +52,7 @@ Register-ArgumentCompleter -Native -CommandName '${t}' -ScriptBlock {
52
52
  break
53
53
  }
54
54
  ${Object.entries(n).map(([r,s])=>`'${t};${r.split(" ").join(";")}' {
55
- ${xe(s)}
55
+ ${ge(s)}
56
56
  break
57
57
  }`).join(`
58
58
  `)}
@@ -60,17 +60,17 @@ Register-ArgumentCompleter -Native -CommandName '${t}' -ScriptBlock {
60
60
 
61
61
  $completions.Where{ $_.CompletionText -like "$wordToComplete*" } |
62
62
  Sort-Object -Property ListItemText
63
- }`},hD={bash:fe,pwsh:$e},Se=(u={})=>P({setup:e=>{const{command:t=!0}=u;return t&&(e=e.command("completions","Print shell completions to stdout",{flags:{shell:{description:"Shell type",type:String,default:""}},parameters:["[shell]"]}).on("completions",n=>{if(!e._name)throw new Error("CLI name is not defined!");const r=String(n.parameters.shell||n.flags.shell);if(!r)throw new Error("Missing shell name");if(r in hD)process.stdout.write(hD[r](n));else throw new Error(`No such shell: ${r}`)})),e}}),BD=u=>Array.isArray(u)?u:[u],we=u=>u.replace(/([A-Z])/g,(e,t)=>`-${t.toLowerCase()}`),lu=u=>u.length<=1?`-${u}`:`--${we(u)}`,be=(u,e)=>e.length!==u.length?!1:u.every((t,n)=>t===e[n]);function ye(u,e,t){if(e===d)return[u[d],d];const n=BD(e),r=xu(u,t);let s,D;return r.forEach((i,o)=>{o===d||D===d||be(n,o)&&(s=i,D=o)}),[s,D]}var b={exports:{}};let ve=du,Oe=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||ve.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),g=(u,e,t=u)=>n=>{let r=""+n,s=r.indexOf(e,u.length);return~s?u+pD(r,e,t,s)+e:u+r+e},pD=(u,e,t,n)=>{let r=u.substring(0,n)+t,s=u.substring(n+e.length),D=s.indexOf(e);return~D?r+pD(s,e,t,D):r+s},dD=(u=Oe)=>({isColorSupported:u,reset:u?e=>`\x1B[0m${e}\x1B[0m`:String,bold:u?g("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:u?g("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:u?g("\x1B[3m","\x1B[23m"):String,underline:u?g("\x1B[4m","\x1B[24m"):String,inverse:u?g("\x1B[7m","\x1B[27m"):String,hidden:u?g("\x1B[8m","\x1B[28m"):String,strikethrough:u?g("\x1B[9m","\x1B[29m"):String,black:u?g("\x1B[30m","\x1B[39m"):String,red:u?g("\x1B[31m","\x1B[39m"):String,green:u?g("\x1B[32m","\x1B[39m"):String,yellow:u?g("\x1B[33m","\x1B[39m"):String,blue:u?g("\x1B[34m","\x1B[39m"):String,magenta:u?g("\x1B[35m","\x1B[39m"):String,cyan:u?g("\x1B[36m","\x1B[39m"):String,white:u?g("\x1B[37m","\x1B[39m"):String,gray:u?g("\x1B[90m","\x1B[39m"):String,bgBlack:u?g("\x1B[40m","\x1B[49m"):String,bgRed:u?g("\x1B[41m","\x1B[49m"):String,bgGreen:u?g("\x1B[42m","\x1B[49m"):String,bgYellow:u?g("\x1B[43m","\x1B[49m"):String,bgBlue:u?g("\x1B[44m","\x1B[49m"):String,bgMagenta:u?g("\x1B[45m","\x1B[49m"):String,bgCyan:u?g("\x1B[46m","\x1B[49m"):String,bgWhite:u?g("\x1B[47m","\x1B[49m"):String});b.exports=dD(),b.exports.createColors=dD;var _e=function(u,e){e||(e={});var t=e.hsep===void 0?" ":e.hsep,n=e.align||[],r=e.stringLength||function(o){return String(o).length},s=fD(u,function(o,a){return AD(a,function(F,l){var C=gD(F);(!o[l]||C>o[l])&&(o[l]=C)}),o},[]),D=cu(u,function(o){return cu(o,function(a,F){var l=String(a);if(n[F]==="."){var C=gD(l),E=s[F]+(/\./.test(l)?1:2)-(r(l)-C);return l+Array(E).join(" ")}else return l})}),i=fD(D,function(o,a){return AD(a,function(F,l){var C=r(F);(!o[l]||C>o[l])&&(o[l]=C)}),o},[]);return cu(D,function(o){return cu(o,function(a,F){var l=i[F]-r(a)||0,C=Array(Math.max(l+1,1)).join(" ");return n[F]==="r"||n[F]==="."?C+a:n[F]==="c"?Array(Math.ceil(l/2+1)).join(" ")+a+Array(Math.floor(l/2+1)).join(" "):a+C}).join(t).replace(/\s+$/,"")}).join(`
64
- `)};function gD(u){var e=/\.[^.]*$/.exec(u);return e?e.index+1:u.length}function fD(u,e,t){if(u.reduce)return u.reduce(e,t);for(var n=0,r=arguments.length>=3?t:u[n++];n<u.length;n++)e(r,u[n],n);return r}function AD(u,e){if(u.forEach)return u.forEach(e);for(var t=0;t<u.length;t++)e.call(u,u[t],t)}function cu(u,e){if(u.map)return u.map(e);for(var t=[],n=0;n<u.length;n++)t.push(e.call(u,u[n],n));return t}function Me({onlyFirst:u=!1}={}){const e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,u?void 0:"g")}function Te(u){if(typeof u!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof u}\``);return u.replace(Me(),"")}var xD={exports:{}};(function(u){var e={};u.exports=e,e.eastAsianWidth=function(n){var r=n.charCodeAt(0),s=n.length==2?n.charCodeAt(1):0,D=r;return 55296<=r&&r<=56319&&56320<=s&&s<=57343&&(r&=1023,s&=1023,D=r<<10|s,D+=65536),D==12288||65281<=D&&D<=65376||65504<=D&&D<=65510?"F":D==8361||65377<=D&&D<=65470||65474<=D&&D<=65479||65482<=D&&D<=65487||65490<=D&&D<=65495||65498<=D&&D<=65500||65512<=D&&D<=65518?"H":4352<=D&&D<=4447||4515<=D&&D<=4519||4602<=D&&D<=4607||9001<=D&&D<=9002||11904<=D&&D<=11929||11931<=D&&D<=12019||12032<=D&&D<=12245||12272<=D&&D<=12283||12289<=D&&D<=12350||12353<=D&&D<=12438||12441<=D&&D<=12543||12549<=D&&D<=12589||12593<=D&&D<=12686||12688<=D&&D<=12730||12736<=D&&D<=12771||12784<=D&&D<=12830||12832<=D&&D<=12871||12880<=D&&D<=13054||13056<=D&&D<=19903||19968<=D&&D<=42124||42128<=D&&D<=42182||43360<=D&&D<=43388||44032<=D&&D<=55203||55216<=D&&D<=55238||55243<=D&&D<=55291||63744<=D&&D<=64255||65040<=D&&D<=65049||65072<=D&&D<=65106||65108<=D&&D<=65126||65128<=D&&D<=65131||110592<=D&&D<=110593||127488<=D&&D<=127490||127504<=D&&D<=127546||127552<=D&&D<=127560||127568<=D&&D<=127569||131072<=D&&D<=194367||177984<=D&&D<=196605||196608<=D&&D<=262141?"W":32<=D&&D<=126||162<=D&&D<=163||165<=D&&D<=166||D==172||D==175||10214<=D&&D<=10221||10629<=D&&D<=10630?"Na":D==161||D==164||167<=D&&D<=168||D==170||173<=D&&D<=174||176<=D&&D<=180||182<=D&&D<=186||188<=D&&D<=191||D==198||D==208||215<=D&&D<=216||222<=D&&D<=225||D==230||232<=D&&D<=234||236<=D&&D<=237||D==240||242<=D&&D<=243||247<=D&&D<=250||D==252||D==254||D==257||D==273||D==275||D==283||294<=D&&D<=295||D==299||305<=D&&D<=307||D==312||319<=D&&D<=322||D==324||328<=D&&D<=331||D==333||338<=D&&D<=339||358<=D&&D<=359||D==363||D==462||D==464||D==466||D==468||D==470||D==472||D==474||D==476||D==593||D==609||D==708||D==711||713<=D&&D<=715||D==717||D==720||728<=D&&D<=731||D==733||D==735||768<=D&&D<=879||913<=D&&D<=929||931<=D&&D<=937||945<=D&&D<=961||963<=D&&D<=969||D==1025||1040<=D&&D<=1103||D==1105||D==8208||8211<=D&&D<=8214||8216<=D&&D<=8217||8220<=D&&D<=8221||8224<=D&&D<=8226||8228<=D&&D<=8231||D==8240||8242<=D&&D<=8243||D==8245||D==8251||D==8254||D==8308||D==8319||8321<=D&&D<=8324||D==8364||D==8451||D==8453||D==8457||D==8467||D==8470||8481<=D&&D<=8482||D==8486||D==8491||8531<=D&&D<=8532||8539<=D&&D<=8542||8544<=D&&D<=8555||8560<=D&&D<=8569||D==8585||8592<=D&&D<=8601||8632<=D&&D<=8633||D==8658||D==8660||D==8679||D==8704||8706<=D&&D<=8707||8711<=D&&D<=8712||D==8715||D==8719||D==8721||D==8725||D==8730||8733<=D&&D<=8736||D==8739||D==8741||8743<=D&&D<=8748||D==8750||8756<=D&&D<=8759||8764<=D&&D<=8765||D==8776||D==8780||D==8786||8800<=D&&D<=8801||8804<=D&&D<=8807||8810<=D&&D<=8811||8814<=D&&D<=8815||8834<=D&&D<=8835||8838<=D&&D<=8839||D==8853||D==8857||D==8869||D==8895||D==8978||9312<=D&&D<=9449||9451<=D&&D<=9547||9552<=D&&D<=9587||9600<=D&&D<=9615||9618<=D&&D<=9621||9632<=D&&D<=9633||9635<=D&&D<=9641||9650<=D&&D<=9651||9654<=D&&D<=9655||9660<=D&&D<=9661||9664<=D&&D<=9665||9670<=D&&D<=9672||D==9675||9678<=D&&D<=9681||9698<=D&&D<=9701||D==9711||9733<=D&&D<=9734||D==9737||9742<=D&&D<=9743||9748<=D&&D<=9749||D==9756||D==9758||D==9792||D==9794||9824<=D&&D<=9825||9827<=D&&D<=9829||9831<=D&&D<=9834||9836<=D&&D<=9837||D==9839||9886<=D&&D<=9887||9918<=D&&D<=9919||9924<=D&&D<=9933||9935<=D&&D<=9953||D==9955||9960<=D&&D<=9983||D==10045||D==10071||10102<=D&&D<=10111||11093<=D&&D<=11097||12872<=D&&D<=12879||57344<=D&&D<=63743||65024<=D&&D<=65039||D==65533||127232<=D&&D<=127242||127248<=D&&D<=127277||127280<=D&&D<=127337||127344<=D&&D<=127386||917760<=D&&D<=917999||983040<=D&&D<=1048573||1048576<=D&&D<=1114109?"A":"N"},e.characterLength=function(n){var r=this.eastAsianWidth(n);return r=="F"||r=="W"||r=="A"?2:1};function t(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(n){for(var r=t(n),s=0,D=0;D<r.length;D++)s=s+this.characterLength(r[D]);return s},e.slice=function(n,r,s){textLen=e.length(n),r=r||0,s=s||1,r<0&&(r=textLen+r),s<0&&(s=textLen+s);for(var D="",i=0,o=t(n),a=0;a<o.length;a++){var F=o[a],l=e.length(F);if(i>=r-(l==2?1:0))if(i+l<=s)D+=F;else break;i+=l}return D}})(xD);var Ne=xD.exports,Le=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g};function ke(u,e={}){if(typeof u!="string"||u.length===0||(e={ambiguousIsNarrow:!0,...e},u=Te(u),u.length===0))return 0;u=u.replace(Le()," ");const t=e.ambiguousIsNarrow?1:2;let n=0;for(const r of u){const s=r.codePointAt(0);if(!(s<=31||s>=127&&s<=159||s>=768&&s<=879))switch(Ne.eastAsianWidth(r)){case"F":case"W":n+=2;break;case"A":n+=t;break;default:n+=1}}return n}const ku=u=>_e(u,{stringLength:ke}),nu=u=>ku(u).split(`
65
- `),$D=new Map([[Boolean,void 0],[String,"string"],[Number,"number"]]),SD=(u,e=!1)=>{const t=$D.has(u)?$D.get(u):"value";return t?e?`[${t}]`:`<${t}>`:""},Ie=(u,e)=>u===d?-1:e===d?1:u.length-e.length,Eu=b.exports.yellow("-"),wD=u=>{process.stdout.write(u)},Iu=(u,e,t)=>{const{t:n}=e.i18n,r=[{title:n("help.name"),body:b.exports.red(e._name)},{title:n("help.version"),body:b.exports.yellow(e._version)}];t&&r.push({title:n("help.subcommand"),body:b.exports.green(`${e._name} ${U(t.name)}`)}),u.push({type:"inline",items:r}),u.push({title:n("help.description"),body:[(t==null?void 0:t.description)||e._description]})},bD=(u,e,t)=>{const n=e.map(([r,s])=>[r,Eu,s]);u.push({title:t("help.examples"),body:nu(n)})},yD=u=>Object.entries(u).map(([e,t])=>{const n=[lu(e)];t.alias&&n.push(lu(t.alias));const r=[b.exports.blue(n.join(", "))];if(r.push(Eu,t.description),t.type){const s=SD(t.type);s&&r.push(b.exports.gray(`(${s})`))}return r}),H=u=>{const e=[];for(const t of u){if(t.type==="block"||!t.type){const n=" ",r=t.body.map(D=>n+D);r.unshift("");const s=r.join(`
66
- `);e.push(ku([[b.exports.bold(`${t.title}`)],[s]]).toString())}else if(t.type==="inline"){const n=t.items.map(s=>[b.exports.bold(`${s.title}`),s.body]),r=ku(n);e.push(r.toString())}e.push("")}return e.join(`
67
- `)},Re={renderFlagName:u=>u,renderSections:u=>u,renderType:(u,e)=>SD(u,e),renderDefault:u=>JSON.stringify(u)},je={en:{"help.name":"Name:","help.version":"Version:","help.subcommand":"Subcommand:","help.commands":"Commands:","help.globalFlags":"Global Flags:","help.flags":"Flags:","help.description":"Description:","help.usage":"Usage:","help.examples":"Examples:","help.notes":"Notes:","help.noDescription":"(No description)","help.notes.1":"If no command is specified, show help for the CLI.","help.notes.2":"If a command is specified, show help for the command.","help.notes.3":"-h is an alias for --help.","help.examples.1":"Show help","help.examples.2":"Show help for a specific command","help.commandDescription":"Show help","help.default":"Default: %s"},"zh-CN":{"help.name":"\u540D\u79F0:","help.version":"\u7248\u672C:","help.subcommand":"\u5B50\u547D\u4EE4:","help.commands":"\u547D\u4EE4:","help.globalFlags":"\u5168\u5C40\u6807\u5FD7:","help.flags":"\u6807\u5FD7:","help.description":"\u63CF\u8FF0:","help.usage":"\u4F7F\u7528:","help.examples":"\u793A\u4F8B:","help.notes":"\u5907\u6CE8:","help.noDescription":"(\u65E0\u63CF\u8FF0)","help.notes.1":"\u5982\u679C\u6CA1\u6709\u6307\u5B9A\u5C55\u793A\u54EA\u4E2A\u547D\u4EE4\u7684\u5E2E\u52A9\u4FE1\u606F\uFF0C\u9ED8\u8BA4\u5C55\u793ACLI\u7684\u3002","help.notes.2":"\u5982\u679C\u6307\u5B9A\u4E86\u5219\u5C55\u793A\u8BE5\u547D\u4EE4\u5E2E\u52A9\u4FE1\u606F\u3002","help.notes.3":"-h \u662F --help \u7684\u4E00\u4E2A\u522B\u540D\u3002","help.examples.1":"\u5C55\u793A CLI \u7684\u5E2E\u52A9\u4FE1\u606F","help.examples.2":"\u5C55\u793A\u6307\u5B9A\u547D\u4EE4\u7684\u5E2E\u52A9\u4FE1\u606F","help.commandDescription":"\u5C55\u793A\u5E2E\u52A9\u4FE1\u606F","help.default":"\u9ED8\u8BA4\u503C: %s"}},mu=(u,e,t,n)=>{const{cli:r}=e,{t:s}=r.i18n,D=[];Iu(D,r),D.push({title:s("help.usage"),body:[b.exports.magenta(`$ ${r._name} ${eD("command",e.hasRootOrAlias)} [flags]`)]});const i=[...e.hasRoot?[r._commands[d]]:[],...Object.values(r._commands)].map(a=>{const F=[typeof a.name=="symbol"?"":a.name,...BD(a.alias||[])].sort(Ie).map(l=>l===""||typeof l=="symbol"?`${r._name}`:`${r._name} ${l}`).join(", ");return[b.exports.cyan(F),Eu,a.description]});i.length&&D.push({title:s("help.commands"),body:nu(i)});const o=yD(r._flags);return o.length&&D.push({title:s("help.globalFlags"),body:nu(o)}),t&&D.push({title:s("help.notes"),body:t}),n&&bD(D,n,s),u(D)},Ru=(u,e,t)=>{var n,r,s,D;const{cli:i}=e,{t:o}=i.i18n,[a]=ye(i._commands,t,o);if(!a)throw new iu(U(t),o);const F=Object.assign({},Re,a.help);let l=[];t===d?Iu(l,i):Iu(l,i,{...a,name:U(t)});const C=((n=a.parameters)==null?void 0:n.join(" "))||void 0,E=t===d?"":` ${U(t)}`,c=C?` ${C}`:"",h=a.flags?" [flags]":"";l.push({title:o("help.usage"),body:[b.exports.magenta(`$ ${i._name}${E}${c}${h}`)]});const p=yD(i._flags);return p.length&&l.push({title:o("help.globalFlags"),body:nu(p)}),a.flags&&l.push({title:o("help.flags"),body:nu(Object.entries(a.flags).map(([v,B])=>{const T=B.default!==void 0;let S=[lu(v)];B.alias&&S.push(lu(B.alias)),S=S.map(F.renderFlagName);const w=[b.exports.blue(S.join(", ")),F.renderType(B.type,T)];return w.push(Eu,B.description||o("help.noDescription")),T&&w.push(`(${o("help.default",F.renderDefault(B.default))})`),w}))}),(r=a==null?void 0:a.help)!=null&&r.notes&&l.push({title:o("help.notes"),body:a.help.notes}),(s=a==null?void 0:a.help)!=null&&s.examples&&bD(l,(D=a==null?void 0:a.help)==null?void 0:D.examples,o),l=F.renderSections(l),u(l)},We=({command:u=!0,flag:e=!0,showHelpWhenNoCommand:t=!0,notes:n,examples:r,banner:s}={})=>P({setup:D=>{const{add:i,t:o}=D.i18n;i(je);const a=F=>{s&&wD(`${s}
68
- `),wD(F)};return u&&(D=D.command("help",o("help.commandDescription"),{parameters:["[command...]"],help:{notes:[o("help.notes.1"),o("help.notes.2"),o("help.notes.3")],examples:[[`$ ${D._name} help`,o("help.examples.1")],[`$ ${D._name} help <command>`,o("help.examples.2")],[`$ ${D._name} <command> --help`,o("help.examples.2")]]}}).on("help",F=>{F.parameters.command.length?a(Ru(H,F,F.parameters.command)):a(mu(H,F,n,r))})),e&&(D=D.flag("help",o("help.commandDescription"),{alias:"h",type:Boolean,default:!1})),D.inspector((F,l)=>{const C=F.flags.help;if(!F.hasRootOrAlias&&!F.raw._.length&&t&&!C){let E=`${o("core.noCommandGiven")}
63
+ }`},ED={bash:fe,pwsh:$e},we=(D={})=>j({setup:e=>{const{command:t=!0}=D;return t&&(e=e.command("completions","Print shell completions to stdout",{flags:{shell:{description:"Shell type",type:String,default:""}},parameters:["[shell]"]}).on("completions",n=>{var r;if(!e._name)throw new Error("CLI name is not defined!");const s=String((r=n.parameters.shell)!=null?r:n.flags.shell);if(!s)throw new Error("Missing shell name");if(s in ED)process.stdout.write(ED[s](n));else throw new Error(`No such shell: ${s}`)})),e}});var N={exports:{}};let Se=jD,ye=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||Se.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),f=(D,e,t=D)=>n=>{let r=""+n,s=r.indexOf(e,D.length);return~s?D+cD(r,e,t,s)+e:D+r+e},cD=(D,e,t,n)=>{let r=D.substring(0,n)+t,s=D.substring(n+e.length),u=s.indexOf(e);return~u?r+cD(s,e,t,u):r+s},hD=(D=ye)=>({isColorSupported:D,reset:D?e=>`\x1B[0m${e}\x1B[0m`:String,bold:D?f("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:D?f("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:D?f("\x1B[3m","\x1B[23m"):String,underline:D?f("\x1B[4m","\x1B[24m"):String,inverse:D?f("\x1B[7m","\x1B[27m"):String,hidden:D?f("\x1B[8m","\x1B[28m"):String,strikethrough:D?f("\x1B[9m","\x1B[29m"):String,black:D?f("\x1B[30m","\x1B[39m"):String,red:D?f("\x1B[31m","\x1B[39m"):String,green:D?f("\x1B[32m","\x1B[39m"):String,yellow:D?f("\x1B[33m","\x1B[39m"):String,blue:D?f("\x1B[34m","\x1B[39m"):String,magenta:D?f("\x1B[35m","\x1B[39m"):String,cyan:D?f("\x1B[36m","\x1B[39m"):String,white:D?f("\x1B[37m","\x1B[39m"):String,gray:D?f("\x1B[90m","\x1B[39m"):String,bgBlack:D?f("\x1B[40m","\x1B[49m"):String,bgRed:D?f("\x1B[41m","\x1B[49m"):String,bgGreen:D?f("\x1B[42m","\x1B[49m"):String,bgYellow:D?f("\x1B[43m","\x1B[49m"):String,bgBlue:D?f("\x1B[44m","\x1B[49m"):String,bgMagenta:D?f("\x1B[45m","\x1B[49m"):String,bgCyan:D?f("\x1B[46m","\x1B[49m"):String,bgWhite:D?f("\x1B[47m","\x1B[49m"):String});N.exports=hD(),N.exports.createColors=hD;function ve(D){return D.split(`
64
+ `).splice(1).map(e=>e.trim().replace("file://",""))}function xe(D){return`
65
+ ${ve(D).map(e=>` ${e.replace(/^at ([\s\S]+) \((.+)\)/,(t,n,r)=>N.exports.gray(`at ${n} (${N.exports.cyan(r)})`))}`).join(`
66
+ `)}`}const be=/\r?\n/g;function _e(D){return D.map(e=>typeof(e==null?void 0:e.stack)=="string"?[e.message,xe(e.stack)]:typeof e=="string"?e.split(be):e).flat()}function Me(D,e){const t=D.toUpperCase(),n=N.exports[e];return N.exports.bold(N.exports.inverse(n(` ${t} `)))}function tu(D,e,{target:t=console.log,textColor:n,newline:r=!0}={}){const s=N.exports[e],u=n?N.exports[n]:s;return(...i)=>{const o=_e(i),a=Me(D,e);for(const F of o)t(`${a} ${u(F)}${r?`
67
+ `:""}}`)}}tu("log","gray"),tu("info","blue",{target:console.info}),tu("warn","yellow",{target:console.warn}),tu("success","green");const Ne=tu("error","red",{target:console.error}),Te=()=>j({setup:D=>D.errorHandler(e=>{Ne(e.message),process.exit(1)})}),mD=D=>Array.isArray(D)?D:[D],Le=D=>D.replace(/([A-Z])/g,(e,t)=>`-${t.toLowerCase()}`),Cu=D=>D.length<=1?`-${D}`:`--${Le(D)}`,Oe=(D,e)=>e.length!==D.length?!1:D.every((t,n)=>t===e[n]);function Ie(D,e,t){if(e===B)return[D[B],B];const n=mD(e),r=gu(D,t);let s,u;return r.forEach((i,o)=>{o===B||u===B||Oe(n,o)&&(s=i,u=o)}),[s,u]}const ke=Ru.WriteStream.prototype.hasColors(),O=(D,e)=>ke?t=>"\x1B["+D+"m"+t+"\x1B["+e+"m":t=>t,pD=O(1,22),Re=O(31,39),je=O(32,39),dD=O(33,39),BD=O(34,39),fD=O(35,39),We=O(36,39),Pe=O(90,39),He={en:{"help.name":"Name:","help.version":"Version:","help.subcommand":"Subcommand:","help.commands":"Commands:","help.globalFlags":"Global Flags:","help.flags":"Flags:","help.description":"Description:","help.usage":"Usage:","help.examples":"Examples:","help.notes":"Notes:","help.noDescription":"(No description)","help.notes.1":"If no command is specified, show help for the CLI.","help.notes.2":"If a command is specified, show help for the command.","help.notes.3":"-h is an alias for --help.","help.examples.1":"Show help","help.examples.2":"Show help for a specific command","help.commandDescription":"Show help","help.default":"Default: %s"},"zh-CN":{"help.name":"\u540D\u79F0:","help.version":"\u7248\u672C:","help.subcommand":"\u5B50\u547D\u4EE4:","help.commands":"\u547D\u4EE4:","help.globalFlags":"\u5168\u5C40\u6807\u5FD7:","help.flags":"\u6807\u5FD7:","help.description":"\u63CF\u8FF0:","help.usage":"\u4F7F\u7528:","help.examples":"\u793A\u4F8B:","help.notes":"\u5907\u6CE8:","help.noDescription":"(\u65E0\u63CF\u8FF0)","help.notes.1":"\u5982\u679C\u6CA1\u6709\u6307\u5B9A\u5C55\u793A\u54EA\u4E2A\u547D\u4EE4\u7684\u5E2E\u52A9\u4FE1\u606F\uFF0C\u9ED8\u8BA4\u5C55\u793ACLI\u7684\u3002","help.notes.2":"\u5982\u679C\u6307\u5B9A\u4E86\u5219\u5C55\u793A\u8BE5\u547D\u4EE4\u5E2E\u52A9\u4FE1\u606F\u3002","help.notes.3":"-h \u662F --help \u7684\u4E00\u4E2A\u522B\u540D\u3002","help.examples.1":"\u5C55\u793A CLI \u7684\u5E2E\u52A9\u4FE1\u606F","help.examples.2":"\u5C55\u793A\u6307\u5B9A\u547D\u4EE4\u7684\u5E2E\u52A9\u4FE1\u606F","help.commandDescription":"\u5C55\u793A\u5E2E\u52A9\u4FE1\u606F","help.default":"\u9ED8\u8BA4\u503C: %s"}};function Ue({onlyFirst:D=!1}={}){const e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,D?void 0:"g")}function ze(D){if(typeof D!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(Ue(),"")}var AD={exports:{}};(function(D){var e={};D.exports=e,e.eastAsianWidth=function(n){var r=n.charCodeAt(0),s=n.length==2?n.charCodeAt(1):0,u=r;return 55296<=r&&r<=56319&&56320<=s&&s<=57343&&(r&=1023,s&=1023,u=r<<10|s,u+=65536),u==12288||65281<=u&&u<=65376||65504<=u&&u<=65510?"F":u==8361||65377<=u&&u<=65470||65474<=u&&u<=65479||65482<=u&&u<=65487||65490<=u&&u<=65495||65498<=u&&u<=65500||65512<=u&&u<=65518?"H":4352<=u&&u<=4447||4515<=u&&u<=4519||4602<=u&&u<=4607||9001<=u&&u<=9002||11904<=u&&u<=11929||11931<=u&&u<=12019||12032<=u&&u<=12245||12272<=u&&u<=12283||12289<=u&&u<=12350||12353<=u&&u<=12438||12441<=u&&u<=12543||12549<=u&&u<=12589||12593<=u&&u<=12686||12688<=u&&u<=12730||12736<=u&&u<=12771||12784<=u&&u<=12830||12832<=u&&u<=12871||12880<=u&&u<=13054||13056<=u&&u<=19903||19968<=u&&u<=42124||42128<=u&&u<=42182||43360<=u&&u<=43388||44032<=u&&u<=55203||55216<=u&&u<=55238||55243<=u&&u<=55291||63744<=u&&u<=64255||65040<=u&&u<=65049||65072<=u&&u<=65106||65108<=u&&u<=65126||65128<=u&&u<=65131||110592<=u&&u<=110593||127488<=u&&u<=127490||127504<=u&&u<=127546||127552<=u&&u<=127560||127568<=u&&u<=127569||131072<=u&&u<=194367||177984<=u&&u<=196605||196608<=u&&u<=262141?"W":32<=u&&u<=126||162<=u&&u<=163||165<=u&&u<=166||u==172||u==175||10214<=u&&u<=10221||10629<=u&&u<=10630?"Na":u==161||u==164||167<=u&&u<=168||u==170||173<=u&&u<=174||176<=u&&u<=180||182<=u&&u<=186||188<=u&&u<=191||u==198||u==208||215<=u&&u<=216||222<=u&&u<=225||u==230||232<=u&&u<=234||236<=u&&u<=237||u==240||242<=u&&u<=243||247<=u&&u<=250||u==252||u==254||u==257||u==273||u==275||u==283||294<=u&&u<=295||u==299||305<=u&&u<=307||u==312||319<=u&&u<=322||u==324||328<=u&&u<=331||u==333||338<=u&&u<=339||358<=u&&u<=359||u==363||u==462||u==464||u==466||u==468||u==470||u==472||u==474||u==476||u==593||u==609||u==708||u==711||713<=u&&u<=715||u==717||u==720||728<=u&&u<=731||u==733||u==735||768<=u&&u<=879||913<=u&&u<=929||931<=u&&u<=937||945<=u&&u<=961||963<=u&&u<=969||u==1025||1040<=u&&u<=1103||u==1105||u==8208||8211<=u&&u<=8214||8216<=u&&u<=8217||8220<=u&&u<=8221||8224<=u&&u<=8226||8228<=u&&u<=8231||u==8240||8242<=u&&u<=8243||u==8245||u==8251||u==8254||u==8308||u==8319||8321<=u&&u<=8324||u==8364||u==8451||u==8453||u==8457||u==8467||u==8470||8481<=u&&u<=8482||u==8486||u==8491||8531<=u&&u<=8532||8539<=u&&u<=8542||8544<=u&&u<=8555||8560<=u&&u<=8569||u==8585||8592<=u&&u<=8601||8632<=u&&u<=8633||u==8658||u==8660||u==8679||u==8704||8706<=u&&u<=8707||8711<=u&&u<=8712||u==8715||u==8719||u==8721||u==8725||u==8730||8733<=u&&u<=8736||u==8739||u==8741||8743<=u&&u<=8748||u==8750||8756<=u&&u<=8759||8764<=u&&u<=8765||u==8776||u==8780||u==8786||8800<=u&&u<=8801||8804<=u&&u<=8807||8810<=u&&u<=8811||8814<=u&&u<=8815||8834<=u&&u<=8835||8838<=u&&u<=8839||u==8853||u==8857||u==8869||u==8895||u==8978||9312<=u&&u<=9449||9451<=u&&u<=9547||9552<=u&&u<=9587||9600<=u&&u<=9615||9618<=u&&u<=9621||9632<=u&&u<=9633||9635<=u&&u<=9641||9650<=u&&u<=9651||9654<=u&&u<=9655||9660<=u&&u<=9661||9664<=u&&u<=9665||9670<=u&&u<=9672||u==9675||9678<=u&&u<=9681||9698<=u&&u<=9701||u==9711||9733<=u&&u<=9734||u==9737||9742<=u&&u<=9743||9748<=u&&u<=9749||u==9756||u==9758||u==9792||u==9794||9824<=u&&u<=9825||9827<=u&&u<=9829||9831<=u&&u<=9834||9836<=u&&u<=9837||u==9839||9886<=u&&u<=9887||9918<=u&&u<=9919||9924<=u&&u<=9933||9935<=u&&u<=9953||u==9955||9960<=u&&u<=9983||u==10045||u==10071||10102<=u&&u<=10111||11093<=u&&u<=11097||12872<=u&&u<=12879||57344<=u&&u<=63743||65024<=u&&u<=65039||u==65533||127232<=u&&u<=127242||127248<=u&&u<=127277||127280<=u&&u<=127337||127344<=u&&u<=127386||917760<=u&&u<=917999||983040<=u&&u<=1048573||1048576<=u&&u<=1114109?"A":"N"},e.characterLength=function(n){var r=this.eastAsianWidth(n);return r=="F"||r=="W"||r=="A"?2:1};function t(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(n){for(var r=t(n),s=0,u=0;u<r.length;u++)s=s+this.characterLength(r[u]);return s},e.slice=function(n,r,s){textLen=e.length(n),r=r||0,s=s||1,r<0&&(r=textLen+r),s<0&&(s=textLen+s);for(var u="",i=0,o=t(n),a=0;a<o.length;a++){var F=o[a],c=e.length(F);if(i>=r-(c==2?1:0))if(i+c<=s)u+=F;else break;i+=c}return u}})(AD);var qe=AD.exports,Ge=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g};function Ye(D,e={}){if(typeof D!="string"||D.length===0||(e={ambiguousIsNarrow:!0,...e},D=ze(D),D.length===0))return 0;D=D.replace(Ge()," ");const t=e.ambiguousIsNarrow?1:2;let n=0;for(const r of D){const s=r.codePointAt(0);if(!(s<=31||s>=127&&s<=159||s>=768&&s<=879))switch(qe.eastAsianWidth(r)){case"F":case"W":n+=2;break;case"A":n+=t;break;default:n+=1}}return n}var Ze=function(D,e){e||(e={});var t=e.hsep===void 0?" ":e.hsep,n=e.align||[],r=e.stringLength||function(o){return String(o).length},s=$D(D,function(o,a){return wD(a,function(F,c){var C=gD(F);(!o[c]||C>o[c])&&(o[c]=C)}),o},[]),u=lu(D,function(o){return lu(o,function(a,F){var c=String(a);if(n[F]==="."){var C=gD(c),l=s[F]+(/\./.test(c)?1:2)-(r(c)-C);return c+Array(l).join(" ")}else return c})}),i=$D(u,function(o,a){return wD(a,function(F,c){var C=r(F);(!o[c]||C>o[c])&&(o[c]=C)}),o},[]);return lu(u,function(o){return lu(o,function(a,F){var c=i[F]-r(a)||0,C=Array(Math.max(c+1,1)).join(" ");return n[F]==="r"||n[F]==="."?C+a:n[F]==="c"?Array(Math.ceil(c/2+1)).join(" ")+a+Array(Math.floor(c/2+1)).join(" "):a+C}).join(t).replace(/\s+$/,"")}).join(`
68
+ `)};function gD(D){var e=/\.[^.]*$/.exec(D);return e?e.index+1:D.length}function $D(D,e,t){if(D.reduce)return D.reduce(e,t);for(var n=0,r=arguments.length>=3?t:D[n++];n<D.length;n++)e(r,D[n],n);return r}function wD(D,e){if(D.forEach)return D.forEach(e);for(var t=0;t<D.length;t++)e.call(D,D[t],t)}function lu(D,e){if(D.map)return D.map(e);for(var t=[],n=0;n<D.length;n++)t.push(e.call(D,D[n],n));return t}const Tu=D=>Ze(D,{stringLength:Ye}),nu=D=>Tu(D).split(`
69
+ `),SD=new Map([[Boolean,void 0],[String,"string"],[Number,"number"]]),yD=(D,e=!1)=>{const t=SD.has(D)?SD.get(D):"value";return t?e?`[${t}]`:`<${t}>`:""},Ve=(D,e)=>D===B?-1:e===B?1:D.length-e.length,Eu=dD("-"),vD=D=>{process.stdout.write(D)},Lu=(D,e,t)=>{var n;const{t:r}=e.i18n,s=[{title:r("help.name"),body:Re(e._name)},{title:r("help.version"),body:dD(e._version)}];t&&s.push({title:r("help.subcommand"),body:je(`${e._name} ${U(t.name)}`)}),D.push({type:"inline",items:s}),D.push({title:r("help.description"),body:[(n=t==null?void 0:t.description)!=null?n:e._description]})},xD=(D,e,t)=>{const n=e.map(([r,s])=>[r,Eu,s]);D.push({title:t("help.examples"),body:nu(n)})},bD=D=>Object.entries(D).map(([e,t])=>{const n=[Cu(e)];t.alias&&n.push(Cu(t.alias));const r=[BD(n.join(", "))];if(r.push(Eu,t.description),t.type){const s=yD(t.type);s&&r.push(Pe(`(${s})`))}return r}),W=D=>{const e=[];for(const t of D){if(t.type==="block"||!t.type){const n=" ",r=t.body.map(u=>n+u);r.unshift("");const s=r.join(`
70
+ `);e.push(Tu([[pD(`${t.title}`)],[s]]).toString())}else if(t.type==="inline"){const n=t.items.map(s=>[pD(`${s.title}`),s.body]),r=Tu(n);e.push(r.toString())}e.push("")}return e.join(`
71
+ `)},Je={renderFlagName:D=>D,renderSections:D=>D,renderType:(D,e)=>yD(D,e),renderDefault:D=>JSON.stringify(D)},cu=(D,e,t,n)=>{const{cli:r}=e,{t:s}=r.i18n,u=[];Lu(u,r),u.push({title:s("help.usage"),body:[fD(`$ ${r._name} ${Xu("command",e.hasRootOrAlias)} [flags]`)]});const i=[...e.hasRoot?[r._commands[B]]:[],...Object.values(r._commands)].map(a=>{var F;const c=[typeof a.name=="symbol"?"":a.name,...mD((F=a.alias)!=null?F:[])].sort(Ve).map(C=>C===""||typeof C=="symbol"?`${r._name}`:`${r._name} ${C}`).join(", ");return[We(c),Eu,a.description]});i.length&&u.push({title:s("help.commands"),body:nu(i)});const o=bD(r._flags);return o.length&&u.push({title:s("help.globalFlags"),body:nu(o)}),t&&u.push({title:s("help.notes"),body:t}),n&&xD(u,n,s),D(u)},Ou=(D,e,t)=>{var n,r,s,u,i;const{cli:o}=e,{t:a}=o.i18n,[F]=Ie(o._commands,t,a);if(!F)throw new ou(U(t),a);const c=Object.assign({},Je,F.help);let C=[];t===B?Lu(C,o):Lu(C,o,{...F,name:U(t)});const l=(r=(n=F.parameters)==null?void 0:n.join(" "))!=null?r:void 0,E=t===B?"":` ${U(t)}`,m=l?` ${l}`:"",p=F.flags?" [flags]":"";C.push({title:a("help.usage"),body:[fD(`$ ${o._name}${E}${m}${p}`)]});const y=bD(o._flags);return y.length&&C.push({title:a("help.globalFlags"),body:nu(y)}),F.flags&&C.push({title:a("help.flags"),body:nu(Object.entries(F.flags).map(([d,w])=>{const v=w.default!==void 0;let g=[Cu(d)];w.alias&&g.push(Cu(w.alias)),g=g.map(c.renderFlagName);const P=[BD(g.join(", ")),c.renderType(w.type,v)];return P.push(Eu,w.description||a("help.noDescription")),v&&P.push(`(${a("help.default",c.renderDefault(w.default))})`),P}))}),(s=F==null?void 0:F.help)!=null&&s.notes&&C.push({title:a("help.notes"),body:F.help.notes}),(u=F==null?void 0:F.help)!=null&&u.examples&&xD(C,(i=F==null?void 0:F.help)==null?void 0:i.examples,a),C=c.renderSections(C),D(C)},Ke=({command:D=!0,flag:e=!0,showHelpWhenNoCommand:t=!0,notes:n,examples:r,banner:s}={})=>j({setup:u=>{const{add:i,t:o}=u.i18n;i(He);const a=F=>{s&&vD(`${s}
72
+ `),vD(F)};return D&&(u=u.command("help",o("help.commandDescription"),{parameters:["[command...]"],help:{notes:[o("help.notes.1"),o("help.notes.2"),o("help.notes.3")],examples:[[`$ ${u._name} help`,o("help.examples.1")],[`$ ${u._name} help <command>`,o("help.examples.2")],[`$ ${u._name} <command> --help`,o("help.examples.2")]]}}).on("help",F=>{F.parameters.command.length?a(Ou(W,F,F.parameters.command)):a(cu(W,F,n,r))})),e&&(u=u.flag("help",o("help.commandDescription"),{alias:"h",type:Boolean,default:!1})),u.inspector((F,c)=>{const C=F.flags.help;if(!F.hasRootOrAlias&&!F.raw._.length&&t&&!C){let l=`${o("core.noCommandGiven")}
69
73
 
70
- `;E+=mu(H,F,n,r),E+=`
71
- `,a(E),process.exit(1)}else C?F.raw._.length?F.called!==d&&F.name===d?a(mu(H,F,n,r)):a(Ru(H,F,F.raw._)):F.hasRootOrAlias?a(Ru(H,F,d)):a(mu(H,F,n,r)):l()}),D}}),Pe={en:{"utils.and":"%s and %s"},"zh-CN":{"utils.and":"%s \u548C %s"}},He=(u,{add:e,t})=>(e(Pe),u.length<=1?u[0]:t("utils.and",u.slice(0,-1).join(", "),u[u.length-1])),L=new Uint32Array(65536),Ue=(u,e)=>{const t=u.length,n=e.length,r=1<<t-1;let s=-1,D=0,i=t,o=t;for(;o--;)L[u.charCodeAt(o)]|=1<<o;for(o=0;o<n;o++){let a=L[e.charCodeAt(o)];const F=a|D;a|=(a&s)+s^s,D|=~(a|s),s&=a,D&r&&i++,s&r&&i--,D=D<<1|1,s=s<<1|~(F|D),D&=F}for(o=t;o--;)L[u.charCodeAt(o)]=0;return i},Ge=(u,e)=>{const t=e.length,n=u.length,r=[],s=[],D=Math.ceil(t/32),i=Math.ceil(n/32);for(let c=0;c<D;c++)s[c]=-1,r[c]=0;let o=0;for(;o<i-1;o++){let c=0,h=-1;const p=o*32,v=Math.min(32,n)+p;for(let B=p;B<v;B++)L[u.charCodeAt(B)]|=1<<B;for(let B=0;B<t;B++){const T=L[e.charCodeAt(B)],S=s[B/32|0]>>>B&1,w=r[B/32|0]>>>B&1,ju=T|c,Wu=((T|w)&h)+h^h|T|w;let Y=c|~(Wu|h),su=h&Wu;Y>>>31^S&&(s[B/32|0]^=1<<B),su>>>31^w&&(r[B/32|0]^=1<<B),Y=Y<<1|S,su=su<<1|w,h=su|~(ju|Y),c=Y&ju}for(let B=p;B<v;B++)L[u.charCodeAt(B)]=0}let a=0,F=-1;const l=o*32,C=Math.min(32,n-l)+l;for(let c=l;c<C;c++)L[u.charCodeAt(c)]|=1<<c;let E=n;for(let c=0;c<t;c++){const h=L[e.charCodeAt(c)],p=s[c/32|0]>>>c&1,v=r[c/32|0]>>>c&1,B=h|a,T=((h|v)&F)+F^F|h|v;let S=a|~(T|F),w=F&T;E+=S>>>n-1&1,E-=w>>>n-1&1,S>>>31^p&&(s[c/32|0]^=1<<c),w>>>31^v&&(r[c/32|0]^=1<<c),S=S<<1|p,w=w<<1|v,F=w|~(B|S),a=S&B}for(let c=l;c<C;c++)L[u.charCodeAt(c)]=0;return E},vD=(u,e)=>{if(u.length<e.length){const t=e;e=u,u=t}return e.length===0?u.length:u.length<=32?Ue(u,e):Ge(u,e)};var hu=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},ze=1/0,Ye="[object Symbol]",qe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ze="\\u0300-\\u036f\\ufe20-\\ufe23",Ve="\\u20d0-\\u20f0",Je="["+Ze+Ve+"]",Ke=RegExp(Je,"g"),Qe={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"ss"},Xe=typeof hu=="object"&&hu&&hu.Object===Object&&hu,ut=typeof self=="object"&&self&&self.Object===Object&&self,Dt=Xe||ut||Function("return this")();function et(u){return function(e){return u==null?void 0:u[e]}}var tt=et(Qe),nt=Object.prototype,rt=nt.toString,OD=Dt.Symbol,_D=OD?OD.prototype:void 0,MD=_D?_D.toString:void 0;function st(u){if(typeof u=="string")return u;if(it(u))return MD?MD.call(u):"";var e=u+"";return e=="0"&&1/u==-ze?"-0":e}function ot(u){return!!u&&typeof u=="object"}function it(u){return typeof u=="symbol"||ot(u)&&rt.call(u)==Ye}function at(u){return u==null?"":st(u)}function Ft(u){return u=at(u),u&&u.replace(qe,tt).replace(Ke,"")}var Ct=Ft;let y,_;(function(u){u.ALL_CLOSEST_MATCHES="all-closest-matches",u.ALL_MATCHES="all-matches",u.ALL_SORTED_MATCHES="all-sorted-matches",u.FIRST_CLOSEST_MATCH="first-closest-match",u.FIRST_MATCH="first-match"})(y||(y={})),function(u){u.EDIT_DISTANCE="edit-distance",u.SIMILARITY="similarity"}(_||(_={}));const TD=new Error("unknown returnType"),Bu=new Error("unknown thresholdType"),ND=(u,e)=>{let t=u;return e.trimSpaces&&(t=t.trim().replace(/\s+/g," ")),e.deburr&&(t=Ct(t)),e.caseSensitive||(t=t.toLowerCase()),t},LD=(u,e)=>{const{matchPath:t}=e,n=((r,s)=>{const D=s.length>0?s.reduce((i,o)=>i==null?void 0:i[o],r):r;return typeof D!="string"?"":D})(u,t);return ND(n,e)};function lt(u,e,t){const n=(C=>{const E={caseSensitive:!1,deburr:!0,matchPath:[],returnType:y.FIRST_CLOSEST_MATCH,thresholdType:_.SIMILARITY,trimSpaces:!0,...C};switch(E.thresholdType){case _.EDIT_DISTANCE:return{threshold:20,...E};case _.SIMILARITY:return{threshold:.4,...E};default:throw Bu}})(t),{returnType:r,threshold:s,thresholdType:D}=n,i=ND(u,n);let o,a;switch(D){case _.EDIT_DISTANCE:o=C=>C<=s,a=C=>vD(i,LD(C,n));break;case _.SIMILARITY:o=C=>C>=s,a=C=>((E,c)=>{if(!E||!c)return 0;if(E===c)return 1;const h=vD(E,c),p=Math.max(E.length,c.length);return(p-h)/p})(i,LD(C,n));break;default:throw Bu}const F=[],l=e.length;switch(r){case y.ALL_CLOSEST_MATCHES:case y.FIRST_CLOSEST_MATCH:{const C=[];let E;switch(D){case _.EDIT_DISTANCE:E=1/0;for(let h=0;h<l;h+=1){const p=a(e[h]);E>p&&(E=p),C.push(p)}break;case _.SIMILARITY:E=0;for(let h=0;h<l;h+=1){const p=a(e[h]);E<p&&(E=p),C.push(p)}break;default:throw Bu}const c=C.length;for(let h=0;h<c;h+=1){const p=C[h];o(p)&&p===E&&F.push(h)}break}case y.ALL_MATCHES:for(let C=0;C<l;C+=1)o(a(e[C]))&&F.push(C);break;case y.ALL_SORTED_MATCHES:{const C=[];for(let E=0;E<l;E+=1){const c=a(e[E]);o(c)&&C.push({score:c,index:E})}switch(D){case _.EDIT_DISTANCE:C.sort((E,c)=>E.score-c.score);break;case _.SIMILARITY:C.sort((E,c)=>c.score-E.score);break;default:throw Bu}for(const E of C)F.push(E.index);break}case y.FIRST_MATCH:for(let C=0;C<l;C+=1)if(o(a(e[C]))){F.push(C);break}break;default:throw TD}return((C,E,c)=>{switch(c){case y.ALL_CLOSEST_MATCHES:case y.ALL_MATCHES:case y.ALL_SORTED_MATCHES:return E.map(h=>C[h]);case y.FIRST_CLOSEST_MATCH:case y.FIRST_MATCH:return E.length?C[E[0]]:null;default:throw TD}})(e,F,r)}var pu={exports:{}};let ct=du,Et=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||ct.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),f=(u,e,t=u)=>n=>{let r=""+n,s=r.indexOf(e,u.length);return~s?u+kD(r,e,t,s)+e:u+r+e},kD=(u,e,t,n)=>{let r=u.substring(0,n)+t,s=u.substring(n+e.length),D=s.indexOf(e);return~D?r+kD(s,e,t,D):r+s},ID=(u=Et)=>({isColorSupported:u,reset:u?e=>`\x1B[0m${e}\x1B[0m`:String,bold:u?f("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:u?f("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:u?f("\x1B[3m","\x1B[23m"):String,underline:u?f("\x1B[4m","\x1B[24m"):String,inverse:u?f("\x1B[7m","\x1B[27m"):String,hidden:u?f("\x1B[8m","\x1B[28m"):String,strikethrough:u?f("\x1B[9m","\x1B[29m"):String,black:u?f("\x1B[30m","\x1B[39m"):String,red:u?f("\x1B[31m","\x1B[39m"):String,green:u?f("\x1B[32m","\x1B[39m"):String,yellow:u?f("\x1B[33m","\x1B[39m"):String,blue:u?f("\x1B[34m","\x1B[39m"):String,magenta:u?f("\x1B[35m","\x1B[39m"):String,cyan:u?f("\x1B[36m","\x1B[39m"):String,white:u?f("\x1B[37m","\x1B[39m"):String,gray:u?f("\x1B[90m","\x1B[39m"):String,bgBlack:u?f("\x1B[40m","\x1B[49m"):String,bgRed:u?f("\x1B[41m","\x1B[49m"):String,bgGreen:u?f("\x1B[42m","\x1B[49m"):String,bgYellow:u?f("\x1B[43m","\x1B[49m"):String,bgBlue:u?f("\x1B[44m","\x1B[49m"):String,bgMagenta:u?f("\x1B[45m","\x1B[49m"):String,bgCyan:u?f("\x1B[46m","\x1B[49m"):String,bgWhite:u?f("\x1B[47m","\x1B[49m"):String});pu.exports=ID(),pu.exports.createColors=ID;const mt={en:{"notFound.possibleCommands":"Possible commands: %s.","notFound.commandNotFound":'Command "%s" not found.',"notFound.didyoumean":'Did you mean "%s"?',"notFound.commandNotRegisteredNote":"NOTE: You haven't register any command yet."},"zh-CN":{"notFound.possibleCommands":"\u53EF\u80FD\u7684\u547D\u4EE4: %s\u3002","notFound.commandNotFound":'\u672A\u627E\u5230\u547D\u4EE4 "%s"\u3002',"notFound.didyoumean":'\u4F60\u662F\u4E0D\u662F\u6307 "%s"\uFF1F',"notFound.commandNotRegisteredNote":"\u63D0\u793A: \u4F60\u8FD8\u6CA1\u6709\u6CE8\u518C\u4EFB\u4F55\u547D\u4EE4\u3002"}},ht=()=>P({setup:u=>{const{t:e,add:t}=u.i18n;return t(mt),u.inspector({enforce:"pre",fn:(n,r)=>{const s=Object.keys(u._commands),D=!!s.length;try{r()}catch(i){if(!(i instanceof iu||i instanceof au))throw i;if(n.raw._.length===0||i instanceof au){console.error(e("core.noCommandGiven")),D&&console.error(e("notFound.possibleCommands",He(s,u.i18n)));return}const o=i.commandName,a=lt(o,s);console.error(e("notFound.commandNotFound",pu.exports.strikethrough(o))),D&&a?console.error(e("notFound.didyoumean",pu.exports.bold(a))):D||console.error(e("notFound.commandNotRegisteredNote")),process.stderr.write(`
72
- `),process.exit(2)}}})}}),Bt={en:{"utils.and":"%s and %s"},"zh-CN":{"utils.and":"%s \u548C %s"}},RD=(u,{add:e,t})=>(e(Bt),u.length<=1?u[0]:t("utils.and",u.slice(0,-1).join(", "),u[u.length-1])),pt={en:{"strictFlags.unexpectedSingle":"Unexpected flag: %s.","strictFlags.unexpectedMore":"Unexpected flags: %s.","strictFlags.and":"%s and %s"},"zh-CN":{"strictFlags.unexpectedSingle":"\u9884\u671F\u4E4B\u5916\u7684\u6807\u5FD7: %s\u3002","strictFlags.unexpectedMore":"\u9884\u671F\u4E4B\u5916\u7684\u6807\u5FD7: %s\u3002","strictFlags.and":"%s \u548C %s"}},dt=()=>P({setup:u=>{const{add:e,t}=u.i18n;return e(pt),u.inspector((n,r)=>{const s=Object.keys(n.unknownFlags);if(!n.resolved||s.length===0)r();else throw s.length>1?new Error(t("strictFlags.unexpectedMore",RD(s,u.i18n))):new Error(t("strictFlags.unexpectedSingle",RD(s,u.i18n)))})}}),gt=u=>u.length===0?"":u.startsWith("v")?u:`v${u}`,ft={en:{"version.description":"Show CLI version","version.notes.1":'The version string begins with a "v".'},"zh-CN":{"version.description":"\u5C55\u793A CLI \u7248\u672C","version.notes.1":'\u7248\u672C\u53F7\u5F00\u5934\u5E26\u6709 "v"\u3002'}},At=({command:u=!0,flag:e=!0}={})=>P({setup:t=>{const{add:n,t:r}=t.i18n;n(ft);const s=gt(t._version);return u&&(t=t.command("version",r("version.description"),{help:{notes:[r("version.notes.1")]}}).on("version",()=>{process.stdout.write(s)})),e&&(t=t.flag("version",r("version.description"),{alias:"V",type:Boolean,default:!1}),t.inspector({enforce:"pre",fn:(D,i)=>{D.flags.version?process.stdout.write(s):i()}})),t}});var k={exports:{}};let xt=du,$t=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||xt.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),A=(u,e,t=u)=>n=>{let r=""+n,s=r.indexOf(e,u.length);return~s?u+jD(r,e,t,s)+e:u+r+e},jD=(u,e,t,n)=>{let r=u.substring(0,n)+t,s=u.substring(n+e.length),D=s.indexOf(e);return~D?r+jD(s,e,t,D):r+s},WD=(u=$t)=>({isColorSupported:u,reset:u?e=>`\x1B[0m${e}\x1B[0m`:String,bold:u?A("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:u?A("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:u?A("\x1B[3m","\x1B[23m"):String,underline:u?A("\x1B[4m","\x1B[24m"):String,inverse:u?A("\x1B[7m","\x1B[27m"):String,hidden:u?A("\x1B[8m","\x1B[28m"):String,strikethrough:u?A("\x1B[9m","\x1B[29m"):String,black:u?A("\x1B[30m","\x1B[39m"):String,red:u?A("\x1B[31m","\x1B[39m"):String,green:u?A("\x1B[32m","\x1B[39m"):String,yellow:u?A("\x1B[33m","\x1B[39m"):String,blue:u?A("\x1B[34m","\x1B[39m"):String,magenta:u?A("\x1B[35m","\x1B[39m"):String,cyan:u?A("\x1B[36m","\x1B[39m"):String,white:u?A("\x1B[37m","\x1B[39m"):String,gray:u?A("\x1B[90m","\x1B[39m"):String,bgBlack:u?A("\x1B[40m","\x1B[49m"):String,bgRed:u?A("\x1B[41m","\x1B[49m"):String,bgGreen:u?A("\x1B[42m","\x1B[49m"):String,bgYellow:u?A("\x1B[43m","\x1B[49m"):String,bgBlue:u?A("\x1B[44m","\x1B[49m"):String,bgMagenta:u?A("\x1B[45m","\x1B[49m"):String,bgCyan:u?A("\x1B[46m","\x1B[49m"):String,bgWhite:u?A("\x1B[47m","\x1B[49m"):String});k.exports=WD(),k.exports.createColors=WD;function St(u){return u.split(`
73
- `).splice(1).map(e=>e.trim().replace("file://",""))}function wt(u){return`
74
- ${St(u).map(e=>` ${e.replace(/^at ([\s\S]+) \((.+)\)/,(t,n,r)=>k.exports.gray(`at ${n} (${k.exports.cyan(r)})`))}`).join(`
75
- `)}`}const bt=/\r?\n/g;function yt(u){return u.map(e=>typeof(e==null?void 0:e.stack)=="string"?[e.message,wt(e.stack)]:typeof e=="string"?e.split(bt):e).flat()}function vt(u,e){const t=u.toUpperCase(),n=k.exports[e];return k.exports.bold(k.exports.inverse(n(` ${t} `)))}function ru(u,e,{target:t=console.log,textColor:n,newline:r=!0}={}){const s=k.exports[e],D=n?k.exports[n]:s;return(...i)=>{const o=yt(i),a=vt(u,e);for(const F of o)t(`${a} ${D(F)}${r?`
76
- `:""}}`)}}ru("log","gray"),ru("info","blue",{target:console.info}),ru("warn","yellow",{target:console.warn}),ru("success","green");const Ot=ru("error","red",{target:console.error}),_t=()=>P({setup:u=>u.errorHandler(e=>{Ot(e.message),process.exit(1)})});export{he as Clerc,zu as CommandExistsError,Yu as CommandNameConflictError,Zu as DescriptionNotSetError,Ju as InvalidCommandNameError,Au as LocaleNotCalledFirstError,qu as NameNotSetError,au as NoCommandGivenError,iu as NoSuchCommandError,d as Root,Vu as VersionNotSetError,Se as completionsPlugin,uD as compose,de as defineCommand,Be as defineHandler,pe as defineInspector,P as definePlugin,tD as detectLocale,U as formatCommandName,_t as friendlyErrorPlugin,We as helpPlugin,DD as isValidName,ht as notFoundPlugin,$u as resolveArgv,Xu as resolveCommand,xu as resolveFlattenCommands,dt as strictFlagsPlugin,nD as stripFlags,At as versionPlugin,eD as withBrackets};
74
+ `;l+=cu(W,F,n,r),l+=`
75
+ `,a(l),process.exit(1)}else C?F.raw._.length?F.called!==B&&F.name===B?a(cu(W,F,n,r)):a(Ou(W,F,F.raw._)):F.hasRootOrAlias?a(Ou(W,F,B)):a(cu(W,F,n,r)):c()}),u}}),Qe={en:{"utils.and":"%s and %s"},"zh-CN":{"utils.and":"%s \u548C %s"}},Xe=(D,{add:e,t})=>(e(Qe),D.length<=1?D[0]:t("utils.and",D.slice(0,-1).join(", "),D[D.length-1])),T=new Uint32Array(65536),ut=(D,e)=>{const t=D.length,n=e.length,r=1<<t-1;let s=-1,u=0,i=t,o=t;for(;o--;)T[D.charCodeAt(o)]|=1<<o;for(o=0;o<n;o++){let a=T[e.charCodeAt(o)];const F=a|u;a|=(a&s)+s^s,u|=~(a|s),s&=a,u&r&&i++,s&r&&i--,u=u<<1|1,s=s<<1|~(F|u),u&=F}for(o=t;o--;)T[D.charCodeAt(o)]=0;return i},Dt=(D,e)=>{const t=e.length,n=D.length,r=[],s=[],u=Math.ceil(t/32),i=Math.ceil(n/32);for(let E=0;E<u;E++)s[E]=-1,r[E]=0;let o=0;for(;o<i-1;o++){let E=0,m=-1;const p=o*32,y=Math.min(32,n)+p;for(let d=p;d<y;d++)T[D.charCodeAt(d)]|=1<<d;for(let d=0;d<t;d++){const w=T[e.charCodeAt(d)],v=s[d/32|0]>>>d&1,g=r[d/32|0]>>>d&1,P=w|E,Iu=((w|g)&m)+m^m|w|g;let q=E|~(Iu|m),ru=m&Iu;q>>>31^v&&(s[d/32|0]^=1<<d),ru>>>31^g&&(r[d/32|0]^=1<<d),q=q<<1|v,ru=ru<<1|g,m=ru|~(P|q),E=q&P}for(let d=p;d<y;d++)T[D.charCodeAt(d)]=0}let a=0,F=-1;const c=o*32,C=Math.min(32,n-c)+c;for(let E=c;E<C;E++)T[D.charCodeAt(E)]|=1<<E;let l=n;for(let E=0;E<t;E++){const m=T[e.charCodeAt(E)],p=s[E/32|0]>>>E&1,y=r[E/32|0]>>>E&1,d=m|a,w=((m|y)&F)+F^F|m|y;let v=a|~(w|F),g=F&w;l+=v>>>n-1&1,l-=g>>>n-1&1,v>>>31^p&&(s[E/32|0]^=1<<E),g>>>31^y&&(r[E/32|0]^=1<<E),v=v<<1|p,g=g<<1|y,F=g|~(d|v),a=v&d}for(let E=c;E<C;E++)T[D.charCodeAt(E)]=0;return l},_D=(D,e)=>{if(D.length<e.length){const t=e;e=D,D=t}return e.length===0?D.length:D.length<=32?ut(D,e):Dt(D,e)};var hu=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},et=1/0,tt="[object Symbol]",nt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,rt="\\u0300-\\u036f\\ufe20-\\ufe23",st="\\u20d0-\\u20f0",ot="["+rt+st+"]",Ft=RegExp(ot,"g"),at={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"ss"},it=typeof hu=="object"&&hu&&hu.Object===Object&&hu,Ct=typeof self=="object"&&self&&self.Object===Object&&self,lt=it||Ct||Function("return this")();function Et(D){return function(e){return D==null?void 0:D[e]}}var ct=Et(at),ht=Object.prototype,mt=ht.toString,MD=lt.Symbol,ND=MD?MD.prototype:void 0,TD=ND?ND.toString:void 0;function pt(D){if(typeof D=="string")return D;if(Bt(D))return TD?TD.call(D):"";var e=D+"";return e=="0"&&1/D==-et?"-0":e}function dt(D){return!!D&&typeof D=="object"}function Bt(D){return typeof D=="symbol"||dt(D)&&mt.call(D)==tt}function ft(D){return D==null?"":pt(D)}function At(D){return D=ft(D),D&&D.replace(nt,ct).replace(Ft,"")}var gt=At;let S,b;(function(D){D.ALL_CLOSEST_MATCHES="all-closest-matches",D.ALL_MATCHES="all-matches",D.ALL_SORTED_MATCHES="all-sorted-matches",D.FIRST_CLOSEST_MATCH="first-closest-match",D.FIRST_MATCH="first-match"})(S||(S={})),function(D){D.EDIT_DISTANCE="edit-distance",D.SIMILARITY="similarity"}(b||(b={}));const LD=new Error("unknown returnType"),mu=new Error("unknown thresholdType"),OD=(D,e)=>{let t=D;return e.trimSpaces&&(t=t.trim().replace(/\s+/g," ")),e.deburr&&(t=gt(t)),e.caseSensitive||(t=t.toLowerCase()),t},ID=(D,e)=>{const{matchPath:t}=e,n=((r,s)=>{const u=s.length>0?s.reduce((i,o)=>i==null?void 0:i[o],r):r;return typeof u!="string"?"":u})(D,t);return OD(n,e)};function $t(D,e,t){const n=(C=>{const l={caseSensitive:!1,deburr:!0,matchPath:[],returnType:S.FIRST_CLOSEST_MATCH,thresholdType:b.SIMILARITY,trimSpaces:!0,...C};switch(l.thresholdType){case b.EDIT_DISTANCE:return{threshold:20,...l};case b.SIMILARITY:return{threshold:.4,...l};default:throw mu}})(t),{returnType:r,threshold:s,thresholdType:u}=n,i=OD(D,n);let o,a;switch(u){case b.EDIT_DISTANCE:o=C=>C<=s,a=C=>_D(i,ID(C,n));break;case b.SIMILARITY:o=C=>C>=s,a=C=>((l,E)=>{if(!l||!E)return 0;if(l===E)return 1;const m=_D(l,E),p=Math.max(l.length,E.length);return(p-m)/p})(i,ID(C,n));break;default:throw mu}const F=[],c=e.length;switch(r){case S.ALL_CLOSEST_MATCHES:case S.FIRST_CLOSEST_MATCH:{const C=[];let l;switch(u){case b.EDIT_DISTANCE:l=1/0;for(let m=0;m<c;m+=1){const p=a(e[m]);l>p&&(l=p),C.push(p)}break;case b.SIMILARITY:l=0;for(let m=0;m<c;m+=1){const p=a(e[m]);l<p&&(l=p),C.push(p)}break;default:throw mu}const E=C.length;for(let m=0;m<E;m+=1){const p=C[m];o(p)&&p===l&&F.push(m)}break}case S.ALL_MATCHES:for(let C=0;C<c;C+=1)o(a(e[C]))&&F.push(C);break;case S.ALL_SORTED_MATCHES:{const C=[];for(let l=0;l<c;l+=1){const E=a(e[l]);o(E)&&C.push({score:E,index:l})}switch(u){case b.EDIT_DISTANCE:C.sort((l,E)=>l.score-E.score);break;case b.SIMILARITY:C.sort((l,E)=>E.score-l.score);break;default:throw mu}for(const l of C)F.push(l.index);break}case S.FIRST_MATCH:for(let C=0;C<c;C+=1)if(o(a(e[C]))){F.push(C);break}break;default:throw LD}return((C,l,E)=>{switch(E){case S.ALL_CLOSEST_MATCHES:case S.ALL_MATCHES:case S.ALL_SORTED_MATCHES:return l.map(m=>C[m]);case S.FIRST_CLOSEST_MATCH:case S.FIRST_MATCH:return l.length?C[l[0]]:null;default:throw LD}})(e,F,r)}const wt=Ru.WriteStream.prototype.hasColors(),kD=(D,e)=>wt?t=>"\x1B["+D+"m"+t+"\x1B["+e+"m":t=>t,St=kD(1,22),yt=kD(9,29),vt={en:{"notFound.possibleCommands":"Possible commands: %s.","notFound.commandNotFound":'Command "%s" not found.',"notFound.didyoumean":'Did you mean "%s"?',"notFound.commandNotRegisteredNote":"NOTE: You haven't register any command yet."},"zh-CN":{"notFound.possibleCommands":"\u53EF\u80FD\u7684\u547D\u4EE4: %s\u3002","notFound.commandNotFound":'\u672A\u627E\u5230\u547D\u4EE4 "%s"\u3002',"notFound.didyoumean":'\u4F60\u662F\u4E0D\u662F\u6307 "%s"\uFF1F',"notFound.commandNotRegisteredNote":"\u63D0\u793A: \u4F60\u8FD8\u6CA1\u6709\u6CE8\u518C\u4EFB\u4F55\u547D\u4EE4\u3002"}},xt=()=>j({setup:D=>{const{t:e,add:t}=D.i18n;return t(vt),D.inspector({enforce:"pre",fn:(n,r)=>{const s=Object.keys(D._commands),u=!!s.length;try{r()}catch(i){if(!(i instanceof ou||i instanceof Fu))throw i;if(n.raw._.length===0||i instanceof Fu){console.error(e("core.noCommandGiven")),u&&console.error(e("notFound.possibleCommands",Xe(s,D.i18n)));return}const o=i.commandName,a=$t(o,s);console.error(e("notFound.commandNotFound",yt(o))),u&&a?console.error(e("notFound.didyoumean",St(a))):u||console.error(e("notFound.commandNotRegisteredNote")),process.stderr.write(`
76
+ `),process.exit(2)}}})}}),bt={en:{"utils.and":"%s and %s"},"zh-CN":{"utils.and":"%s \u548C %s"}},RD=(D,{add:e,t})=>(e(bt),D.length<=1?D[0]:t("utils.and",D.slice(0,-1).join(", "),D[D.length-1])),_t={en:{"strictFlags.unexpectedSingle":"Unexpected flag: %s.","strictFlags.unexpectedMore":"Unexpected flags: %s.","strictFlags.and":"%s and %s"},"zh-CN":{"strictFlags.unexpectedSingle":"\u9884\u671F\u4E4B\u5916\u7684\u6807\u5FD7: %s\u3002","strictFlags.unexpectedMore":"\u9884\u671F\u4E4B\u5916\u7684\u6807\u5FD7: %s\u3002","strictFlags.and":"%s \u548C %s"}},Mt=()=>j({setup:D=>{const{add:e,t}=D.i18n;return e(_t),D.inspector((n,r)=>{const s=Object.keys(n.unknownFlags);if(!n.resolved||s.length===0)r();else throw s.length>1?new Error(t("strictFlags.unexpectedMore",RD(s,D.i18n))):new Error(t("strictFlags.unexpectedSingle",RD(s,D.i18n)))})}}),Nt=D=>D.length===0?"":D.startsWith("v")?D:`v${D}`,Tt={en:{"version.description":"Show CLI version","version.notes.1":'The version string begins with a "v".'},"zh-CN":{"version.description":"\u5C55\u793A CLI \u7248\u672C","version.notes.1":'\u7248\u672C\u53F7\u5F00\u5934\u5E26\u6709 "v"\u3002'}},Lt=({command:D=!0,flag:e=!0}={})=>j({setup:t=>{const{add:n,t:r}=t.i18n;n(Tt);const s=Nt(t._version);return D&&(t=t.command("version",r("version.description"),{help:{notes:[r("version.notes.1")]}}).on("version",()=>{process.stdout.write(s)})),e&&(t=t.flag("version",r("version.description"),{alias:"V",type:Boolean,default:!1}),t.inspector({enforce:"pre",fn:(u,i)=>{u.flags.version?process.stdout.write(s):i()}})),t}});export{he as Clerc,Hu as CommandExistsError,Uu as CommandNameConflictError,qu as DescriptionNotSetError,Yu as InvalidCommandNameError,Bu as LocaleNotCalledFirstError,zu as NameNotSetError,Fu as NoCommandGivenError,ou as NoSuchCommandError,B as Root,Gu as VersionNotSetError,we as completionsPlugin,Ku as compose,de as defineCommand,me as defineHandler,pe as defineInspector,j as definePlugin,uD as detectLocale,U as formatCommandName,Te as friendlyErrorPlugin,Ke as helpPlugin,Qu as isValidName,xt as notFoundPlugin,$u as resolveArgv,Ju as resolveCommand,gu as resolveFlattenCommands,Mt as strictFlagsPlugin,DD as stripFlags,Lt as versionPlugin,Xu as withBrackets};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clerc",
3
- "version": "0.36.0",
3
+ "version": "0.38.0",
4
4
  "author": "Ray <i@mk1.io> (https://github.com/so1ve)",
5
5
  "description": "Clerc: The full-featured cli library.",
6
6
  "keywords": [
@@ -47,13 +47,13 @@
47
47
  "access": "public"
48
48
  },
49
49
  "devDependencies": {
50
- "@clerc/plugin-friendly-error": "0.36.0",
51
- "@clerc/core": "0.36.0",
52
- "@clerc/plugin-help": "0.36.0",
53
- "@clerc/plugin-strict-flags": "0.36.0",
54
- "@clerc/plugin-version": "0.36.0",
55
- "@clerc/plugin-not-found": "0.36.0",
56
- "@clerc/plugin-completions": "0.36.0"
50
+ "@clerc/plugin-help": "0.38.0",
51
+ "@clerc/core": "0.38.0",
52
+ "@clerc/plugin-completions": "0.38.0",
53
+ "@clerc/plugin-not-found": "0.38.0",
54
+ "@clerc/plugin-friendly-error": "0.38.0",
55
+ "@clerc/plugin-version": "0.38.0",
56
+ "@clerc/plugin-strict-flags": "0.38.0"
57
57
  },
58
58
  "scripts": {
59
59
  "build": "puild --minify",