clerc 0.26.0 → 0.28.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 +32 -22
- package/dist/index.js +29 -34
- package/package.json +10 -10
- package/dist/index.mjs +0 -82
package/dist/index.d.ts
CHANGED
|
@@ -234,6 +234,29 @@ type TypeFlag<Schemas extends Flags$1> = ParsedFlags<{
|
|
|
234
234
|
[flag in keyof Schemas]: InferFlagType<Schemas[flag]>;
|
|
235
235
|
}>;
|
|
236
236
|
|
|
237
|
+
type StripBrackets<Parameter extends string> = (Parameter extends `<${infer ParameterName}>` | `[${infer ParameterName}]` ? (ParameterName extends `${infer SpreadName}...` ? SpreadName : ParameterName) : never);
|
|
238
|
+
type ParameterType<Parameter extends string> = (Parameter extends `<${infer _ParameterName}...>` | `[${infer _ParameterName}...]` ? string[] : Parameter extends `<${infer _ParameterName}>` ? string : Parameter extends `[${infer _ParameterName}]` ? string | undefined : never);
|
|
239
|
+
type NonNullableParameters<T extends string[] | undefined> = T extends undefined ? [] : NonNullable<T>;
|
|
240
|
+
type TransformParameters<C extends Command> = {
|
|
241
|
+
[Parameter in NonNullableParameters<C["parameters"]>[number] as CamelCase<StripBrackets<Parameter>>]: ParameterType<Parameter>;
|
|
242
|
+
};
|
|
243
|
+
type MakeEventMap<T extends CommandRecord> = {
|
|
244
|
+
[K in keyof T]: [InspectorContext];
|
|
245
|
+
};
|
|
246
|
+
type FallbackFlags<C extends Command> = Equals<NonNullableFlag<C>["flags"], {}> extends true ? Dict<any> : NonNullableFlag<C>["flags"];
|
|
247
|
+
type NonNullableFlag<C extends Command> = TypeFlag<NonNullable<C["flags"]>>;
|
|
248
|
+
type ParseFlag<C extends CommandRecord, N extends keyof C> = N extends keyof C ? OmitIndexSignature<NonNullableFlag<C[N]>["flags"]> : FallbackFlags<C[N]>["flags"];
|
|
249
|
+
type ParseRaw<C extends Command> = NonNullableFlag<C> & {
|
|
250
|
+
flags: FallbackFlags<C>;
|
|
251
|
+
parameters: string[];
|
|
252
|
+
mergedFlags: FallbackFlags<C> & NonNullableFlag<C>["unknownFlags"];
|
|
253
|
+
};
|
|
254
|
+
type ParseParameters<C extends CommandRecord = CommandRecord, 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]>;
|
|
255
|
+
|
|
256
|
+
interface Plugin<T extends Clerc = Clerc, U extends Clerc = Clerc> {
|
|
257
|
+
setup: (cli: T) => U;
|
|
258
|
+
}
|
|
259
|
+
|
|
237
260
|
type CommandType = RootType | string;
|
|
238
261
|
type FlagOptions = FlagSchema & {
|
|
239
262
|
description?: string;
|
|
@@ -261,28 +284,14 @@ type CommandAlias<N extends string | RootType = string, O extends CommandOptions
|
|
|
261
284
|
type CommandWithHandler<N extends string | RootType = string, O extends CommandOptions = CommandOptions> = Command<N, O> & {
|
|
262
285
|
handler?: HandlerInCommand<HandlerContext<Record<N, Command<N, O>> & Record<never, never>, N>>;
|
|
263
286
|
};
|
|
264
|
-
type StripBrackets<Parameter extends string> = (Parameter extends `<${infer ParameterName}>` | `[${infer ParameterName}]` ? (ParameterName extends `${infer SpreadName}...` ? SpreadName : ParameterName) : never);
|
|
265
|
-
type ParameterType<Parameter extends string> = (Parameter extends `<${infer _ParameterName}...>` | `[${infer _ParameterName}...]` ? string[] : Parameter extends `<${infer _ParameterName}>` ? string : Parameter extends `[${infer _ParameterName}]` ? string | undefined : never);
|
|
266
287
|
type CommandRecord = Dict<Command> & {
|
|
267
288
|
[Root]?: Command;
|
|
268
289
|
};
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
290
|
+
interface ParseOptions {
|
|
291
|
+
argv?: string[];
|
|
292
|
+
run?: boolean;
|
|
293
|
+
}
|
|
272
294
|
type PossibleInputKind = string | number | boolean | Dict<any>;
|
|
273
|
-
type NonNullableParameters<T extends string[] | undefined> = T extends undefined ? [] : NonNullable<T>;
|
|
274
|
-
type TransformParameters<C extends Command> = {
|
|
275
|
-
[Parameter in NonNullableParameters<C["parameters"]>[number] as CamelCase<StripBrackets<Parameter>>]: ParameterType<Parameter>;
|
|
276
|
-
};
|
|
277
|
-
type FallbackFlags<C extends Command> = Equals<NonNullableFlag<C>["flags"], {}> extends true ? Dict<any> : NonNullableFlag<C>["flags"];
|
|
278
|
-
type NonNullableFlag<C extends Command> = TypeFlag<NonNullable<C["flags"]>>;
|
|
279
|
-
type ParseFlag<C extends CommandRecord, N extends keyof C> = N extends keyof C ? OmitIndexSignature<NonNullableFlag<C[N]>["flags"]> : FallbackFlags<C[N]>["flags"];
|
|
280
|
-
type ParseRaw<C extends Command> = NonNullableFlag<C> & {
|
|
281
|
-
flags: FallbackFlags<C>;
|
|
282
|
-
parameters: string[];
|
|
283
|
-
mergedFlags: FallbackFlags<C> & NonNullableFlag<C>["unknownFlags"];
|
|
284
|
-
};
|
|
285
|
-
type ParseParameters<C extends CommandRecord = CommandRecord, 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]>;
|
|
286
295
|
interface HandlerContext<C extends CommandRecord = CommandRecord, N extends keyof C = keyof C> {
|
|
287
296
|
name?: LiteralUnion<N, string>;
|
|
288
297
|
called?: string | RootType;
|
|
@@ -315,8 +324,8 @@ interface InspectorObject<C extends CommandRecord = CommandRecord> {
|
|
|
315
324
|
enforce?: "pre" | "post";
|
|
316
325
|
fn: InspectorFn<C>;
|
|
317
326
|
}
|
|
318
|
-
interface
|
|
319
|
-
|
|
327
|
+
interface I18N {
|
|
328
|
+
add: () => void;
|
|
320
329
|
}
|
|
321
330
|
|
|
322
331
|
declare const Root: unique symbol;
|
|
@@ -453,7 +462,8 @@ declare class Clerc<C extends CommandRecord = {}> {
|
|
|
453
462
|
* .parse(process.argv.slice(2)) // Optional
|
|
454
463
|
* ```
|
|
455
464
|
*/
|
|
456
|
-
parse(
|
|
465
|
+
parse(optionsOrArgv?: string[] | ParseOptions): this;
|
|
466
|
+
runMatchedCommand(): this;
|
|
457
467
|
}
|
|
458
468
|
|
|
459
469
|
type MaybeArray<T> = T | T[];
|
|
@@ -551,4 +561,4 @@ declare const versionPlugin: ({ alias, command, }?: VersionPluginOptions) => Plu
|
|
|
551
561
|
|
|
552
562
|
declare const friendlyErrorPlugin: () => Plugin<Clerc<{}>, Clerc<{}>>;
|
|
553
563
|
|
|
554
|
-
export { Clerc, Command, CommandAlias, CommandCustomProperties, CommandExistsError, CommandNameConflictError, CommandOptions, CommandRecord, CommandType, CommandWithHandler, CompletionsPluginOptions, DescriptionNotSetError, FallbackType, Flag, FlagOptions, Flags, Handler, HandlerContext, HandlerInCommand, HelpPluginOptions, Inspector, InspectorContext, InspectorFn, InspectorObject, InvalidCommandNameError, MakeEventMap, NameNotSetError, NoCommandGivenError, NoSuchCommandError, Plugin, PossibleInputKind, Root, RootType, VersionNotSetError, completionsPlugin, compose, defineCommand, defineHandler, defineInspector, definePlugin, formatCommandName, friendlyErrorPlugin, helpPlugin, isInvalidName, notFoundPlugin, resolveArgv, resolveCommand, resolveFlattenCommands, resolveParametersBeforeFlag, resolveRootCommands, resolveSubcommandsByParent, strictFlagsPlugin, versionPlugin, withBrackets };
|
|
564
|
+
export { Clerc, Command, CommandAlias, CommandCustomProperties, CommandExistsError, CommandNameConflictError, CommandOptions, CommandRecord, CommandType, CommandWithHandler, CompletionsPluginOptions, DescriptionNotSetError, FallbackType, Flag, FlagOptions, Flags, Handler, HandlerContext, HandlerInCommand, HelpPluginOptions, I18N, Inspector, InspectorContext, InspectorFn, InspectorObject, InvalidCommandNameError, MakeEventMap, NameNotSetError, NoCommandGivenError, NoSuchCommandError, ParseOptions, Plugin, PossibleInputKind, Root, RootType, VersionNotSetError, completionsPlugin, compose, defineCommand, defineHandler, defineInspector, definePlugin, formatCommandName, friendlyErrorPlugin, helpPlugin, isInvalidName, notFoundPlugin, resolveArgv, resolveCommand, resolveFlattenCommands, resolveParametersBeforeFlag, resolveRootCommands, resolveSubcommandsByParent, strictFlagsPlugin, versionPlugin, withBrackets };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
${
|
|
3
|
-
cmd+="__${
|
|
4
|
-
;;`,
|
|
1
|
+
import oe from"tty";class pt{constructor(){this.listenerMap={},this.wildcardListeners=new Set}on(t,n){return t==="*"?(this.wildcardListeners.add(n),this):(this.listenerMap[t]||(this.listenerMap[t]=new Set),this.listenerMap[t].add(n),this)}emit(t,...n){return this.listenerMap[t]&&(this.wildcardListeners.forEach(r=>r(t,...n)),this.listenerMap[t].forEach(r=>r(...n))),this}off(t,n){var r,o;return t==="**"?(this.listenerMap={},this.wildcardListeners.clear(),this):t==="*"?(n?this.wildcardListeners.delete(n):this.wildcardListeners.clear(),this):(n?(r=this.listenerMap[t])==null||r.delete(n):(o=this.listenerMap[t])==null||o.clear(),this)}}const gt="known-flag",dt="unknown-flag",ft="argument",{stringify:U}=JSON,xt=/\B([A-Z])/g,$t=e=>e.replace(xt,"-$1").toLowerCase(),{hasOwnProperty:Bt}=Object.prototype,Y=(e,t)=>Bt.call(e,t),St=e=>Array.isArray(e),Be=e=>typeof e=="function"?[e,!1]:St(e)?[e[0],!0]:Be(e.type),wt=(e,t)=>e===Boolean?t!=="false":t,yt=(e,t)=>typeof t=="boolean"?t:e===Number&&t===""?Number.NaN:e(t),Ct=/[\s.:=]/,bt=e=>{const t=`Flag name ${U(e)}`;if(e.length===0)throw new Error(`${t} cannot be empty`);if(e.length===1)throw new Error(`${t} must be longer than a character`);const n=e.match(Ct);if(n)throw new Error(`${t} cannot contain ${U(n==null?void 0:n[0])}`)},Et=e=>{const t={},n=(r,o)=>{if(Y(t,r))throw new Error(`Duplicate flags named ${U(r)}`);t[r]=o};for(const r in e){if(!Y(e,r))continue;bt(r);const o=e[r],s=[[],...Be(o),o];n(r,s);const i=$t(r);if(r!==i&&n(i,s),"alias"in o&&typeof o.alias=="string"){const{alias:u}=o,a=`Flag alias ${U(u)} for flag ${U(r)}`;if(u.length===0)throw new Error(`${a} cannot be empty`);if(u.length>1)throw new Error(`${a} must be a single character`);n(u,s)}}return t},vt=(e,t)=>{const n={};for(const r in e){if(!Y(e,r))continue;const[o,,s,i]=t[r];if(o.length===0&&"default"in i){let{default:u}=i;typeof u=="function"&&(u=u()),n[r]=u}else n[r]=s?o:o.pop()}return n},J="--",At=/[.:=]/,Ot=/^-{1,2}\w/,_t=e=>{if(!Ot.test(e))return;const t=!e.startsWith(J);let n=e.slice(t?1:2),r;const o=n.match(At);if(o){const{index:s}=o;r=n.slice(s+1),n=n.slice(0,s)}return[n,r,t]},Tt=(e,{onFlag:t,onArgument:n})=>{let r;const o=(s,i)=>{if(typeof r!="function")return!0;r(s,i),r=void 0};for(let s=0;s<e.length;s+=1){const i=e[s];if(i===J){o();const a=e.slice(s+1);n==null||n(a,[s],!0);break}const u=_t(i);if(u){if(o(),!t)continue;const[a,l,p]=u;if(p)for(let g=0;g<a.length;g+=1){o();const c=g===a.length-1;r=t(a[g],c?l:void 0,[s,g+1,c])}else r=t(a,l,[s])}else o(i,[s])&&(n==null||n([i],[s]))}o()},Mt=(e,t)=>{for(const[n,r,o]of t.reverse()){if(r){const s=e[n];let i=s.slice(0,r);if(o||(i+=s.slice(r+1)),i!=="-"){e[n]=i;continue}}e.splice(n,1)}},It=(e,t=process.argv.slice(2),{ignore:n}={})=>{const r=[],o=Et(e),s={},i=[];return i[J]=[],Tt(t,{onFlag(u,a,l){const p=Y(o,u);if(!(n!=null&&n(p?gt:dt,u,a))){if(p){const[g,c]=o[u],h=wt(c,a),m=(d,x)=>{r.push(l),x&&r.push(x),g.push(yt(c,d||""))};return h===void 0?m:m(h)}Y(s,u)||(s[u]=[]),s[u].push(a===void 0?!0:a),r.push(l)}},onArgument(u,a,l){n!=null&&n(ft,t[a[0]])||(i.push(...u),l?(i[J]=u,t.splice(a[0])):r.push(a))}}),Mt(t,r),{flags:vt(e,o),unknownFlags:s,_:i}},se=e=>Array.isArray(e)?e:[e],kt=e=>e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase()),Ft=(e,t)=>t.length!==e.length?!1:e.every((n,r)=>n===t[r]),Se=(e,t)=>t.length>e.length?!1:Ft(e.slice(0,t.length),t);class we extends Error{constructor(t){super(`Command "${t}" exists.`),this.commandName=t}}class z extends Error{constructor(t){super(`No such command: ${t}`),this.commandName=t}}class K extends Error{constructor(){super("No command given.")}}class ye extends Error{constructor(t,n){super(`Command name ${t} conflicts with ${n}. Maybe caused by alias.`),this.n1=t,this.n2=n}}class Ce extends Error{constructor(){super("Name not set.")}}class be extends Error{constructor(){super("Description not set.")}}class Ee extends Error{constructor(){super("Version not set.")}}class ve extends Error{constructor(t){super(`Bad name format: ${t}`),this.commandName=t}}const Ae=typeof Deno!="undefined",Lt=typeof process!="undefined"&&!Ae,Rt=process.versions.electron&&!process.defaultApp;function Oe(e,t,n){if(n.alias){const r=se(n.alias);for(const o of r){if(o in t)throw new ye(t[o].name,n.name);e.set(typeof o=="symbol"?o:o.split(" "),{...n,__isAlias:!0})}}}function _e(e){const t=new Map;e[y]&&(t.set(y,e[y]),Oe(t,e,e[y]));for(const n of Object.values(e))Oe(t,e,n),t.set(n.name.split(" "),n);return t}function ie(e,t){if(t===y)return e[y];const n=se(t),r=_e(e);let o,s;return r.forEach((i,u)=>{if(u===y){o=r.get(y),s=y;return}Se(n,u)&&(!s||s===y||u.length>s.length)&&(o=i,s=u)}),o}function Te(e,t,n=1/0){const r=t===""?[]:Array.isArray(t)?t:t.split(" ");return Object.values(e).filter(o=>{const s=o.name.split(" ");return Se(s,r)&&s.length-r.length<=n})}const Dt=e=>Te(e,"",1);function Me(e){const t=[];for(const n of e){if(n.startsWith("-"))break;t.push(n)}return t}const ae=()=>Lt?process.argv.slice(Rt?1:2):Ae?Deno.args:[];function Ie(e){const t={pre:[],normal:[],post:[]};for(const r of e){const o=typeof r=="object"?r:{fn:r},{enforce:s,fn:i}=o;s==="post"||s==="pre"?t[s].push(i):t.normal.push(i)}const n=[...t.pre,...t.normal,...t.post];return r=>{return o(0);function o(s){const i=n[s];return i(r(),o.bind(null,s+1))}}}const ke=e=>typeof e=="string"&&(e.startsWith(" ")||e.endsWith(" ")),Fe=(e,t)=>t?`[${e}]`:`<${e}>`,jt="<Root>",j=e=>Array.isArray(e)?e.join(" "):typeof e=="string"?e:jt,{stringify:N}=JSON;function le(e){const t=[];let n,r;for(const o of e){if(r)throw new Error(`Invalid parameter: Spread parameter ${N(r)} must be last`);const s=o[0],i=o[o.length-1];let u;if(s==="<"&&i===">"&&(u=!0,n))throw new Error(`Invalid parameter: Required parameter ${N(o)} cannot come after optional parameter ${N(n)}`);if(s==="["&&i==="]"&&(u=!1,n=o),u===void 0)throw new Error(`Invalid parameter: ${N(o)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);let a=o.slice(1,-1);const l=a.slice(-3)==="...";l&&(r=o,a=a.slice(0,-3)),t.push({name:a,required:u,spread:l})}return t}function ue(e,t,n){for(let r=0;r<t.length;r+=1){const{name:o,required:s,spread:i}=t[r],u=kt(o);if(u in e)return new Error(`Invalid parameter: ${N(o)} is used more than once.`);const a=i?n.slice(r):n[r];if(i&&(r=t.length),s&&(!a||i&&a.length===0))return new Error(`Error: Missing required parameter ${N(o)}`);e[u]=a}}var ce=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},$=(e,t,n)=>(ce(e,t,"read from private field"),n?n.call(e):t.get(e)),v=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},k=(e,t,n,r)=>(ce(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Nt=(e,t,n)=>(ce(e,t,"access private method"),n),F,L,R,V,G,Q,W,X,me,Le,he,Re,pe,De;const y=Symbol("Root"),je=class{constructor(e,t,n){v(this,me),v(this,he),v(this,pe),v(this,F,""),v(this,L,""),v(this,R,""),v(this,V,[]),v(this,G,{}),v(this,Q,new pt),v(this,W,new Set),v(this,X,void 0),k(this,F,e||$(this,F)),k(this,L,t||$(this,L)),k(this,R,n||$(this,R))}get _name(){return $(this,F)}get _description(){return $(this,L)}get _version(){return $(this,R)}get _inspectors(){return $(this,V)}get _commands(){return $(this,G)}static create(e,t,n){return new je(e,t,n)}name(e){return k(this,F,e),this}description(e){return k(this,L,e),this}version(e){return k(this,R,e),this}command(e,t,n={}){const r=(l=>!(typeof l=="string"||l===y))(e),o=r?e.name:e;if(ke(o))throw new ve(o);const{handler:s=void 0,...i}=r?e:{name:o,description:t,...n},u=[i.name],a=i.alias?se(i.alias):[];i.alias&&u.push(...a);for(const l of u)if($(this,W).has(l))throw new we(j(l));return $(this,G)[o]=i,$(this,W).add(i.name),a.forEach(l=>$(this,W).add(l)),r&&s&&this.on(e.name,s),this}on(e,t){return $(this,Q).on(e,t),this}use(e){return e.setup(this)}inspector(e){return $(this,V).push(e),this}parse(e=ae()){const{argv:t,run:n}=Array.isArray(e)?{argv:e,run:!0}:{argv:ae(),...e};return k(this,X,t),Nt(this,pe,De).call(this),n&&this.runMatchedCommand(),this}runMatchedCommand(){const e=$(this,X);if(!e)throw new Error("cli.parse() must be called.");const t=Me(e),n=t.join(" "),r=()=>ie($(this,G),t),o=[],s=()=>{o.length=0;const a=r(),l=!!a,p=It((a==null?void 0:a.flags)||{},[...e]),{_:g,flags:c,unknownFlags:h}=p;let m=!l||a.name===y?g:g.slice(a.name.split(" ").length),d=(a==null?void 0:a.parameters)||[];const x=d.indexOf("--"),O=d.slice(x+1)||[],f=Object.create(null);if(x>-1&&O.length>0){d=d.slice(0,x);const E=g["--"];m=m.slice(0,-E.length||void 0),o.push(ue(f,le(d),m)),o.push(ue(f,le(O),E))}else o.push(ue(f,le(d),m));const I={...c,...h};return{name:a==null?void 0:a.name,called:t.length===0&&(a==null?void 0:a.name)?y:n,resolved:l,hasRootOrAlias:$(this,me,Le),hasRoot:$(this,he,Re),raw:{...p,parameters:m,mergedFlags:I},parameters:f,flags:c,unknownFlags:h,cli:this}},i={enforce:"post",fn:()=>{const a=r(),l=s(),p=o.filter(Boolean);if(p.length>0)throw p[0];if(!a)throw n?new z(n):new K;$(this,Q).emit(a.name,l)}},u=[...$(this,V),i];return Ie(u)(s),this}};let Wt=je;F=new WeakMap,L=new WeakMap,R=new WeakMap,V=new WeakMap,G=new WeakMap,Q=new WeakMap,W=new WeakMap,X=new WeakMap,me=new WeakSet,Le=function(){return $(this,W).has(y)},he=new WeakSet,Re=function(){return Object.prototype.hasOwnProperty.call(this._commands,y)},pe=new WeakSet,De=function(){if(!$(this,F))throw new Ce;if(!$(this,L))throw new be;if(!$(this,R))throw new Ee};const D=e=>e,Pt=(e,t,n)=>n,Ht=(e,t)=>t,Ut=(e,t)=>({...e,handler:t}),Yt=e=>`
|
|
2
|
+
${e})
|
|
3
|
+
cmd+="__${e}"
|
|
4
|
+
;;`,Vt=e=>{const{cli:t}=e,{_name:n,_commands:r}=t;return`_${n}() {
|
|
5
5
|
local i cur prev opts cmds
|
|
6
6
|
COMPREPLY=()
|
|
7
7
|
cur="\${COMP_WORDS[COMP_CWORD]}"
|
|
@@ -13,27 +13,27 @@ import mu from"tty";import st from"util";import it from"os";class at{constructor
|
|
|
13
13
|
do
|
|
14
14
|
case "\${i}" in
|
|
15
15
|
"$1")
|
|
16
|
-
cmd="${
|
|
16
|
+
cmd="${n}"
|
|
17
17
|
;;
|
|
18
|
-
${Object.keys(
|
|
18
|
+
${Object.keys(r).map(Yt).join("")}
|
|
19
19
|
*)
|
|
20
20
|
;;
|
|
21
21
|
esac
|
|
22
22
|
done
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
complete -F _${
|
|
26
|
-
`},
|
|
25
|
+
complete -F _${n} -o bashdefault -o default ${n}
|
|
26
|
+
`},Ne=e=>e.replace(/([A-Z])/g,(t,n)=>`-${n.toLowerCase()}`),We=e=>e.length<=1?`-${e}`:`--${Ne(e)}`,Pe="(No Description)",Gt=e=>`[CompletionResult]::new('${e.name}', '${e.name}', [CompletionResultType]::ParameterValue, '${e.description}')`,qt=e=>Object.entries(e.flags||{}).map(([t,n])=>{const r=[`[CompletionResult]::new('${We(t)}', '${Ne(t)}', [CompletionResultType]::ParameterName, '${e.flags[t].description||Pe}')`];return n!=null&&n.alias&&r.push(`[CompletionResult]::new('${We(n.alias)}', '${n.alias}', [CompletionResultType]::ParameterName, '${e.flags[t].description||Pe}')`),r.join(`
|
|
27
27
|
`)}).join(`
|
|
28
|
-
`),
|
|
28
|
+
`),Zt=e=>{const{cli:t}=e,{_name:n,_commands:r}=t;return`using namespace System.Management.Automation
|
|
29
29
|
using namespace System.Management.Automation.Language
|
|
30
30
|
|
|
31
|
-
Register-ArgumentCompleter -Native -CommandName '${
|
|
31
|
+
Register-ArgumentCompleter -Native -CommandName '${n}' -ScriptBlock {
|
|
32
32
|
param($wordToComplete, $commandAst, $cursorPosition)
|
|
33
33
|
|
|
34
34
|
$commandElements = $commandAst.CommandElements
|
|
35
35
|
$command = @(
|
|
36
|
-
'${
|
|
36
|
+
'${n}'
|
|
37
37
|
for ($i = 1; $i -lt $commandElements.Count; $i++) {
|
|
38
38
|
$element = $commandElements[$i]
|
|
39
39
|
if ($element -isnot [StringConstantExpressionAst] -or
|
|
@@ -46,13 +46,13 @@ Register-ArgumentCompleter -Native -CommandName '${t}' -ScriptBlock {
|
|
|
46
46
|
}) -join ';'
|
|
47
47
|
|
|
48
48
|
$completions = @(switch ($command) {
|
|
49
|
-
'${
|
|
50
|
-
${Object.entries(
|
|
49
|
+
'${n}' {
|
|
50
|
+
${Object.entries(r).map(([o,s])=>Gt(s)).join(`
|
|
51
51
|
`)}
|
|
52
52
|
break
|
|
53
53
|
}
|
|
54
|
-
${Object.entries(
|
|
55
|
-
${
|
|
54
|
+
${Object.entries(r).map(([o,s])=>`'${n};${o.split(" ").join(";")}' {
|
|
55
|
+
${qt(s)}
|
|
56
56
|
break
|
|
57
57
|
}`).join(`
|
|
58
58
|
`)}
|
|
@@ -60,23 +60,18 @@ Register-ArgumentCompleter -Native -CommandName '${t}' -ScriptBlock {
|
|
|
60
60
|
|
|
61
61
|
$completions.Where{ $_.CompletionText -like "$wordToComplete*" } |
|
|
62
62
|
Sort-Object -Property ListItemText
|
|
63
|
-
}`},ne={bash:Wt,pwsh:Gt},Yt=(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",D=>{if(!e._name)throw new Error("CLI name is not defined!");const n=String(D.parameters.shell||D.flags.shell);if(!n)throw new Error("Missing shell name");if(n in ne)process.stdout.write(ne[n](D));else throw new Error(`No such shell: ${n}`)})),e}}),zt=u=>Array.isArray(u)?u:[u],Ut=u=>u.replace(/([A-Z])/g,(e,t)=>`-${t.toLowerCase()}`),re=u=>u.length<=1?`-${u}`:`--${Ut(u)}`;function Vt(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var $={exports:{}};let qt=mu,Zt=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||qt.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),B=(u,e,t=u)=>D=>{let n=""+D,r=n.indexOf(e,u.length);return~r?u+oe(n,e,t,r)+e:u+n+e},oe=(u,e,t,D)=>{let n=u.substring(0,D)+t,r=u.substring(D+e.length),o=r.indexOf(e);return~o?n+oe(r,e,t,o):n+r},se=(u=Zt)=>({isColorSupported:u,reset:u?e=>`\x1B[0m${e}\x1B[0m`:String,bold:u?B("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:u?B("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:u?B("\x1B[3m","\x1B[23m"):String,underline:u?B("\x1B[4m","\x1B[24m"):String,inverse:u?B("\x1B[7m","\x1B[27m"):String,hidden:u?B("\x1B[8m","\x1B[28m"):String,strikethrough:u?B("\x1B[9m","\x1B[29m"):String,black:u?B("\x1B[30m","\x1B[39m"):String,red:u?B("\x1B[31m","\x1B[39m"):String,green:u?B("\x1B[32m","\x1B[39m"):String,yellow:u?B("\x1B[33m","\x1B[39m"):String,blue:u?B("\x1B[34m","\x1B[39m"):String,magenta:u?B("\x1B[35m","\x1B[39m"):String,cyan:u?B("\x1B[36m","\x1B[39m"):String,white:u?B("\x1B[37m","\x1B[39m"):String,gray:u?B("\x1B[90m","\x1B[39m"):String,bgBlack:u?B("\x1B[40m","\x1B[49m"):String,bgRed:u?B("\x1B[41m","\x1B[49m"):String,bgGreen:u?B("\x1B[42m","\x1B[49m"):String,bgYellow:u?B("\x1B[43m","\x1B[49m"):String,bgBlue:u?B("\x1B[44m","\x1B[49m"):String,bgMagenta:u?B("\x1B[45m","\x1B[49m"):String,bgCyan:u?B("\x1B[46m","\x1B[49m"):String,bgWhite:u?B("\x1B[47m","\x1B[49m"):String});$.exports=se(),$.exports.createColors=se;var Jt=Function.prototype.toString,Kt=/\s*function(?:\s|\s*\/\*[^(?:*\/)]+\*\/\s*)*([^\s\(\/]+)/;function Qt(u){if(typeof u!="function")return null;var e="";if(typeof Function.prototype.name=="undefined"&&typeof u.name=="undefined"){var t=Jt.call(u).match(Kt);t&&(e=t[1])}else e=u.name;return e}var ie=Qt,ae={exports:{}};let Bu=[],le=0;const S=(u,e)=>{le>=e&&Bu.push(u)};S.WARN=1,S.INFO=2,S.DEBUG=3,S.reset=()=>{Bu=[]},S.setDebugLevel=u=>{le=u},S.warn=u=>S(u,S.WARN),S.info=u=>S(u,S.INFO),S.debug=u=>S(u,S.DEBUG),S.debugMessages=()=>Bu;var xu=S,bu={exports:{}},Xt=({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")};const uD=Xt;var eD=u=>typeof u=="string"?u.replace(uD(),""):u,Au={exports:{}};const ce=u=>Number.isNaN(u)?!1:u>=4352&&(u<=4447||u===9001||u===9002||11904<=u&&u<=12871&&u!==12351||12880<=u&&u<=19903||19968<=u&&u<=42182||43360<=u&&u<=43388||44032<=u&&u<=55203||63744<=u&&u<=64255||65040<=u&&u<=65049||65072<=u&&u<=65131||65281<=u&&u<=65376||65504<=u&&u<=65510||110592<=u&&u<=110593||127488<=u&&u<=127569||131072<=u&&u<=262141);Au.exports=ce,Au.exports.default=ce;var tD=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\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\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])|\uD83C[\uDF3E\uDF73\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])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\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])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\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\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*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\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\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\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[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g};const DD=eD,nD=Au.exports,rD=tD,he=u=>{if(typeof u!="string"||u.length===0||(u=DD(u),u.length===0))return 0;u=u.replace(rD()," ");let e=0;for(let t=0;t<u.length;t++){const D=u.codePointAt(t);D<=31||D>=127&&D<=159||D>=768&&D<=879||(D>65535&&t++,e+=nD(D)?2:1)}return e};bu.exports=he,bu.exports.default=he;const pe=bu.exports;function au(u){return u?/\u001b\[((?:\d*;){0,5}\d*)m/g:/\u001b\[(?:\d*;){0,5}\d*m/g}function R(u){let e=au();return(""+u).replace(e,"").split(`
|
|
64
|
-
`)
|
|
65
|
-
`)
|
|
66
|
-
`)
|
|
67
|
-
`)
|
|
68
|
-
`)}
|
|
69
|
-
`)[0].length}}Ge.reset=()=>M.reset();function Tu(u,e,t){let D=[];u.forEach(function(r){D.push(r.draw(e))});let n=D.join("");n.length&&t.push(n)}var jD=Ge;(function(u){u.exports=jD})(ae);var ND=Vt(ae.exports);const Ru=(...u)=>{const e=new ND({chars:{top:"","top-mid":"","top-left":"","top-right":"",bottom:"","bottom-mid":"","bottom-left":"","bottom-right":"",left:"","left-mid":"",mid:"","mid-mid":"",right:"","right-mid":"",middle:" "},style:{"padding-left":0,"padding-right":0}});return e.push(...u),e},_u=(...u)=>Ru(...u).toString().split(`
|
|
70
|
-
`),WD=u=>Array.isArray(u)?`Array<${ie(u[0])}>`:ie(u),PD=u=>{const e=[];for(const t of u){if(t.type==="block"||!t.type){const D=" ",n=t.body.map(o=>D+o);n.unshift("");const r=n.join(`
|
|
71
|
-
`);e.push(Ru([$.exports.bold(`${t.title}:`)],[r]).toString())}else if(t.type==="inline"){const D=t.items.map(r=>[$.exports.bold(`${r.title}:`),r.body]),n=Ru(...D);e.push(n.toString())}e.push("")}return e.join(`
|
|
72
|
-
`)},Mu=$.exports.yellow("-"),HD="(No description)",GD="Name",YD="Version",zD="Subcommand",UD="Commands",VD="Flags",qD="Description",Ye="Usage",ZD="Examples",ze="Notes",Ue=u=>{process.stdout.write(u)},Ve=(u,e,t)=>{const D=[{title:GD,body:$.exports.red(e._name)},{title:YD,body:$.exports.yellow(e._version)}];t&&D.push({title:zD,body:$.exports.green(`${e._name} ${H(t.name)}`)}),u.push({type:"inline",items:D}),u.push({title:qD,body:[(t==null?void 0:t.description)||e._description]})},qe=(u,e)=>{const t=e.map(([D,n])=>[D,Mu,n]);u.push({title:ZD,body:_u(...t)})},cu=(u,e,t,D)=>{const{cli:n}=e,r=[];Ve(r,n),r.push({title:Ye,body:[$.exports.magenta(`$ ${n._name} ${Ju("command",e.hasRootOrAlias)} [flags]`)]});const o=[...e.hasRoot?[n._commands[w]]:[],...Object.values(n._commands)].map(l=>{const a=[typeof l.name=="symbol"?"":l.name,...zt(l.alias||[])].sort((s,d)=>s===w?-1:d===w?1:s.length-d.length).map(s=>s===""||typeof s=="symbol"?`${n._name}`:`${n._name} ${s}`).join(", ");return[$.exports.cyan(a),Mu,l.description]});return r.push({title:UD,body:_u(...o)}),t&&r.push({title:ze,body:t}),D&&qe(r,D),u(r)},Ze=(u,e,t)=>{var D;const{cli:n}=e,r=du(n._commands,t);if(!r)throw new ou(H(t));const o=[];Ve(o,n,{...r,name:H(t)});const l=((D=r.parameters)==null?void 0:D.join(" "))||void 0,a=` ${H(t)}`,s=l?` ${l}`:"",d=r.flags?" [flags]":"";return o.push({title:Ye,body:[$.exports.magenta(`$ ${n._name}${a}${s}${d}`)]}),r.flags&&o.push({title:VD,body:_u(...Object.entries(r.flags).map(([C,m])=>{const h=[re(C)];m.alias&&h.push(re(m.alias));const i=[$.exports.blue(h.join(", "))];if(i.push(Mu,m.description||HD),m.type){const c=WD(m.type);i.push($.exports.gray(`(${c})`))}return i}))}),r.notes&&o.push({title:ze,body:r.notes}),r.examples&&qe(o,r.examples),u(o)},JD=({command:u=!0,showHelpWhenNoCommand:e=!0,notes:t,examples:D,banner:n,renderer:r="cliffy"}={})=>P({setup:o=>{const l=r==="cliffy"?PD:()=>"",a=s=>{n&&Ue(`${n}
|
|
73
|
-
`),Ue(s)};return u&&(o=o.command("help","Show help",{parameters:["[command...]"],notes:["If no command is specified, show help for the CLI.","If a command is specified, show help for the command.","-h is an alias for --help."],examples:[[`$ ${o._name} help`,"Show help"],[`$ ${o._name} help <command>`,"Show help for a specific command"],[`$ ${o._name} <command> --help`,"Show help for a specific command"]]}).on("help",s=>{s.parameters.command.length?a(Ze(l,s,s.parameters.command)):a(cu(l,s,t,D))})),o.inspector((s,d)=>{const C=s.raw.mergedFlags.h||s.raw.mergedFlags.help;if(!s.hasRootOrAlias&&!s.raw._.length&&e&&!C){let m=`No command given.
|
|
63
|
+
}`},He={bash:Vt,pwsh:Zt},Jt=(e={})=>D({setup:t=>{const{command:n=!0}=e;return n&&(t=t.command("completions","Print shell completions to stdout",{flags:{shell:{description:"Shell type",type:String,default:""}},parameters:["[shell]"]}).on("completions",r=>{if(!t._name)throw new Error("CLI name is not defined!");const o=String(r.parameters.shell||r.flags.shell);if(!o)throw new Error("Missing shell name");if(o in He)process.stdout.write(He[o](r));else throw new Error(`No such shell: ${o}`)})),t}}),zt=e=>Array.isArray(e)?e:[e],Kt=e=>e.replace(/([A-Z])/g,(t,n)=>`-${n.toLowerCase()}`),Ue=e=>e.length<=1?`-${e}`:`--${Kt(e)}`;var C={exports:{}};let Qt=oe,Xt=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||Qt.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),B=(e,t,n=e)=>r=>{let o=""+r,s=o.indexOf(t,e.length);return~s?e+Ye(o,t,n,s)+t:e+o+t},Ye=(e,t,n,r)=>{let o=e.substring(0,r)+n,s=e.substring(r+t.length),i=s.indexOf(t);return~i?o+Ye(s,t,n,i):o+s},Ve=(e=Xt)=>({isColorSupported:e,reset:e?t=>`\x1B[0m${t}\x1B[0m`:String,bold:e?B("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:e?B("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:e?B("\x1B[3m","\x1B[23m"):String,underline:e?B("\x1B[4m","\x1B[24m"):String,inverse:e?B("\x1B[7m","\x1B[27m"):String,hidden:e?B("\x1B[8m","\x1B[28m"):String,strikethrough:e?B("\x1B[9m","\x1B[29m"):String,black:e?B("\x1B[30m","\x1B[39m"):String,red:e?B("\x1B[31m","\x1B[39m"):String,green:e?B("\x1B[32m","\x1B[39m"):String,yellow:e?B("\x1B[33m","\x1B[39m"):String,blue:e?B("\x1B[34m","\x1B[39m"):String,magenta:e?B("\x1B[35m","\x1B[39m"):String,cyan:e?B("\x1B[36m","\x1B[39m"):String,white:e?B("\x1B[37m","\x1B[39m"):String,gray:e?B("\x1B[90m","\x1B[39m"):String,bgBlack:e?B("\x1B[40m","\x1B[49m"):String,bgRed:e?B("\x1B[41m","\x1B[49m"):String,bgGreen:e?B("\x1B[42m","\x1B[49m"):String,bgYellow:e?B("\x1B[43m","\x1B[49m"):String,bgBlue:e?B("\x1B[44m","\x1B[49m"):String,bgMagenta:e?B("\x1B[45m","\x1B[49m"):String,bgCyan:e?B("\x1B[46m","\x1B[49m"):String,bgWhite:e?B("\x1B[47m","\x1B[49m"):String});C.exports=Ve(),C.exports.createColors=Ve;var en=Function.prototype.toString,tn=/\s*function(?:\s|\s*\/\*[^(?:*\/)]+\*\/\s*)*([^\s\(\/]+)/;function nn(e){if(typeof e!="function")return null;var t="";if(typeof Function.prototype.name=="undefined"&&typeof e.name=="undefined"){var n=en.call(e).match(tn);n&&(t=n[1])}else t=e.name;return t}var Ge=nn,rn=function(e,t){t||(t={});var n=t.hsep===void 0?" ":t.hsep,r=t.align||[],o=t.stringLength||function(a){return String(a).length},s=Ze(e,function(a,l){return Je(l,function(p,g){var c=qe(p);(!a[g]||c>a[g])&&(a[g]=c)}),a},[]),i=ee(e,function(a){return ee(a,function(l,p){var g=String(l);if(r[p]==="."){var c=qe(g),h=s[p]+(/\./.test(g)?1:2)-(o(g)-c);return g+Array(h).join(" ")}else return g})}),u=Ze(i,function(a,l){return Je(l,function(p,g){var c=o(p);(!a[g]||c>a[g])&&(a[g]=c)}),a},[]);return ee(i,function(a){return ee(a,function(l,p){var g=u[p]-o(l)||0,c=Array(Math.max(g+1,1)).join(" ");return r[p]==="r"||r[p]==="."?c+l:r[p]==="c"?Array(Math.ceil(g/2+1)).join(" ")+l+Array(Math.floor(g/2+1)).join(" "):l+c}).join(n).replace(/\s+$/,"")}).join(`
|
|
64
|
+
`)};function qe(e){var t=/\.[^.]*$/.exec(e);return t?t.index+1:e.length}function Ze(e,t,n){if(e.reduce)return e.reduce(t,n);for(var r=0,o=arguments.length>=3?n:e[r++];r<e.length;r++)t(o,e[r],r);return o}function Je(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t.call(e,e[n],n)}function ee(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++)n.push(t.call(e,e[r],r));return n}const ge=(...e)=>rn(e),de=(...e)=>ge(...e).toString().split(`
|
|
65
|
+
`),on=e=>Array.isArray(e)?`Array<${Ge(e[0])}>`:Ge(e),sn=e=>{const t=[];for(const n of e){if(n.type==="block"||!n.type){const r=" ",o=n.body.map(i=>r+i);o.unshift("");const s=o.join(`
|
|
66
|
+
`);t.push(ge([C.exports.bold(`${n.title}:`)],[s]).toString())}else if(n.type==="inline"){const r=n.items.map(s=>[C.exports.bold(`${s.title}:`),s.body]),o=ge(...r);t.push(o.toString())}t.push("")}return t.join(`
|
|
67
|
+
`)},fe=C.exports.yellow("-"),an="(No description)",ln="Name",un="Version",cn="Subcommand",mn="Commands",hn="Flags",pn="Description",ze="Usage",gn="Examples",Ke="Notes",Qe=e=>{process.stdout.write(e)},Xe=(e,t,n)=>{const r=[{title:ln,body:C.exports.red(t._name)},{title:un,body:C.exports.yellow(t._version)}];n&&r.push({title:cn,body:C.exports.green(`${t._name} ${j(n.name)}`)}),e.push({type:"inline",items:r}),e.push({title:pn,body:[(n==null?void 0:n.description)||t._description]})},et=(e,t)=>{const n=t.map(([r,o])=>[r,fe,o]);e.push({title:gn,body:de(...n)})},te=(e,t,n,r)=>{const{cli:o}=t,s=[];Xe(s,o),s.push({title:ze,body:[C.exports.magenta(`$ ${o._name} ${Fe("command",t.hasRootOrAlias)} [flags]`)]});const i=[...t.hasRoot?[o._commands[y]]:[],...Object.values(o._commands)].map(u=>{const a=[typeof u.name=="symbol"?"":u.name,...zt(u.alias||[])].sort((l,p)=>l===y?-1:p===y?1:l.length-p.length).map(l=>l===""||typeof l=="symbol"?`${o._name}`:`${o._name} ${l}`).join(", ");return[C.exports.cyan(a),fe,u.description]});return s.push({title:mn,body:de(...i)}),n&&s.push({title:Ke,body:n}),r&&et(s,r),e(s)},tt=(e,t,n)=>{var r;const{cli:o}=t,s=ie(o._commands,n);if(!s)throw new z(j(n));const i=[];Xe(i,o,{...s,name:j(n)});const u=((r=s.parameters)==null?void 0:r.join(" "))||void 0,a=` ${j(n)}`,l=u?` ${u}`:"",p=s.flags?" [flags]":"";return i.push({title:ze,body:[C.exports.magenta(`$ ${o._name}${a}${l}${p}`)]}),s.flags&&i.push({title:hn,body:de(...Object.entries(s.flags).map(([g,c])=>{const h=[Ue(g)];c.alias&&h.push(Ue(c.alias));const m=[C.exports.blue(h.join(", "))];if(m.push(fe,c.description||an),c.type){const d=on(c.type);m.push(C.exports.gray(`(${d})`))}return m}))}),s.notes&&i.push({title:Ke,body:s.notes}),s.examples&&et(i,s.examples),e(i)},dn=({command:e=!0,showHelpWhenNoCommand:t=!0,notes:n,examples:r,banner:o,renderer:s="cliffy"}={})=>D({setup:i=>{const u=s==="cliffy"?sn:()=>"",a=l=>{o&&Qe(`${o}
|
|
68
|
+
`),Qe(l)};return e&&(i=i.command("help","Show help",{parameters:["[command...]"],notes:["If no command is specified, show help for the CLI.","If a command is specified, show help for the command.","-h is an alias for --help."],examples:[[`$ ${i._name} help`,"Show help"],[`$ ${i._name} help <command>`,"Show help for a specific command"],[`$ ${i._name} <command> --help`,"Show help for a specific command"]]}).on("help",l=>{l.parameters.command.length?a(tt(u,l,l.parameters.command)):a(te(u,l,n,r))})),i.inspector((l,p)=>{const g=l.raw.mergedFlags.h||l.raw.mergedFlags.help;if(!l.hasRootOrAlias&&!l.raw._.length&&t&&!g){let c=`No command given.
|
|
74
69
|
|
|
75
|
-
`;
|
|
76
|
-
`,a(
|
|
77
|
-
`),process.exit(2)}}})}),
|
|
78
|
-
`).splice(1).map(
|
|
79
|
-
${
|
|
80
|
-
`)}`}function
|
|
81
|
-
${
|
|
82
|
-
`)}}
|
|
70
|
+
`;c+=te(u,l,n,r),c+=`
|
|
71
|
+
`,a(c),process.exit(1)}else g?l.raw._.length?l.called!==y&&l.name===y?a(te(u,l,n,r)):a(tt(u,l,l.raw._)):a(te(u,l,n,r)):p()}),i}}),T=new Uint32Array(65536),fn=(e,t)=>{const n=e.length,r=t.length,o=1<<n-1;let s=-1,i=0,u=n,a=n;for(;a--;)T[e.charCodeAt(a)]|=1<<a;for(a=0;a<r;a++){let l=T[t.charCodeAt(a)];const p=l|i;l|=(l&s)+s^s,i|=~(l|s),s&=l,i&o&&u++,s&o&&u--,i=i<<1|1,s=s<<1|~(p|i),i&=p}for(a=n;a--;)T[e.charCodeAt(a)]=0;return u},xn=(e,t)=>{const n=t.length,r=e.length,o=[],s=[],i=Math.ceil(n/32),u=Math.ceil(r/32);for(let m=0;m<i;m++)s[m]=-1,o[m]=0;let a=0;for(;a<u-1;a++){let m=0,d=-1;const x=a*32,O=Math.min(32,r)+x;for(let f=x;f<O;f++)T[e.charCodeAt(f)]|=1<<f;for(let f=0;f<n;f++){const I=T[t.charCodeAt(f)],E=s[f/32|0]>>>f&1,_=o[f/32|0]>>>f&1,xe=I|m,$e=((I|_)&d)+d^d|I|_;let H=m|~($e|d),Z=d&$e;H>>>31^E&&(s[f/32|0]^=1<<f),Z>>>31^_&&(o[f/32|0]^=1<<f),H=H<<1|E,Z=Z<<1|_,d=Z|~(xe|H),m=H&xe}for(let f=x;f<O;f++)T[e.charCodeAt(f)]=0}let l=0,p=-1;const g=a*32,c=Math.min(32,r-g)+g;for(let m=g;m<c;m++)T[e.charCodeAt(m)]|=1<<m;let h=r;for(let m=0;m<n;m++){const d=T[t.charCodeAt(m)],x=s[m/32|0]>>>m&1,O=o[m/32|0]>>>m&1,f=d|l,I=((d|O)&p)+p^p|d|O;let E=l|~(I|p),_=p&I;h+=E>>>r-1&1,h-=_>>>r-1&1,E>>>31^x&&(s[m/32|0]^=1<<m),_>>>31^O&&(o[m/32|0]^=1<<m),E=E<<1|x,_=_<<1|O,p=_|~(f|E),l=E&f}for(let m=g;m<c;m++)T[e.charCodeAt(m)]=0;return h},nt=(e,t)=>{if(e.length<t.length){const n=t;t=e,e=n}return t.length===0?e.length:e.length<=32?fn(e,t):xn(e,t)};var ne=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},$n=1/0,Bn="[object Symbol]",Sn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,wn="\\u0300-\\u036f\\ufe20-\\ufe23",yn="\\u20d0-\\u20f0",Cn="["+wn+yn+"]",bn=RegExp(Cn,"g"),En={\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"},vn=typeof ne=="object"&&ne&&ne.Object===Object&&ne,An=typeof self=="object"&&self&&self.Object===Object&&self,On=vn||An||Function("return this")();function _n(e){return function(t){return e==null?void 0:e[t]}}var Tn=_n(En),Mn=Object.prototype,In=Mn.toString,rt=On.Symbol,ot=rt?rt.prototype:void 0,st=ot?ot.toString:void 0;function kn(e){if(typeof e=="string")return e;if(Ln(e))return st?st.call(e):"";var t=e+"";return t=="0"&&1/e==-$n?"-0":t}function Fn(e){return!!e&&typeof e=="object"}function Ln(e){return typeof e=="symbol"||Fn(e)&&In.call(e)==Bn}function Rn(e){return e==null?"":kn(e)}function Dn(e){return e=Rn(e),e&&e.replace(Sn,Tn).replace(bn,"")}var jn=Dn;let b,A;(function(e){e.ALL_CLOSEST_MATCHES="all-closest-matches",e.ALL_MATCHES="all-matches",e.ALL_SORTED_MATCHES="all-sorted-matches",e.FIRST_CLOSEST_MATCH="first-closest-match",e.FIRST_MATCH="first-match"})(b||(b={})),function(e){e.EDIT_DISTANCE="edit-distance",e.SIMILARITY="similarity"}(A||(A={}));const it=new Error("unknown returnType"),re=new Error("unknown thresholdType"),at=(e,t)=>{let n=e;return t.trimSpaces&&(n=n.trim().replace(/\s+/g," ")),t.deburr&&(n=jn(n)),t.caseSensitive||(n=n.toLowerCase()),n},lt=(e,t)=>{const{matchPath:n}=t,r=((o,s)=>{const i=s.length>0?s.reduce((u,a)=>u==null?void 0:u[a],o):o;return typeof i!="string"?"":i})(e,n);return at(r,t)};function Nn(e,t,n){const r=(c=>{const h={caseSensitive:!1,deburr:!0,matchPath:[],returnType:b.FIRST_CLOSEST_MATCH,thresholdType:A.SIMILARITY,trimSpaces:!0,...c};switch(h.thresholdType){case A.EDIT_DISTANCE:return{threshold:20,...h};case A.SIMILARITY:return{threshold:.4,...h};default:throw re}})(n),{returnType:o,threshold:s,thresholdType:i}=r,u=at(e,r);let a,l;switch(i){case A.EDIT_DISTANCE:a=c=>c<=s,l=c=>nt(u,lt(c,r));break;case A.SIMILARITY:a=c=>c>=s,l=c=>((h,m)=>{if(!h||!m)return 0;if(h===m)return 1;const d=nt(h,m),x=Math.max(h.length,m.length);return(x-d)/x})(u,lt(c,r));break;default:throw re}const p=[],g=t.length;switch(o){case b.ALL_CLOSEST_MATCHES:case b.FIRST_CLOSEST_MATCH:{const c=[];let h;switch(i){case A.EDIT_DISTANCE:h=1/0;for(let d=0;d<g;d+=1){const x=l(t[d]);h>x&&(h=x),c.push(x)}break;case A.SIMILARITY:h=0;for(let d=0;d<g;d+=1){const x=l(t[d]);h<x&&(h=x),c.push(x)}break;default:throw re}const m=c.length;for(let d=0;d<m;d+=1){const x=c[d];a(x)&&x===h&&p.push(d)}break}case b.ALL_MATCHES:for(let c=0;c<g;c+=1)a(l(t[c]))&&p.push(c);break;case b.ALL_SORTED_MATCHES:{const c=[];for(let h=0;h<g;h+=1){const m=l(t[h]);a(m)&&c.push({score:m,index:h})}switch(i){case A.EDIT_DISTANCE:c.sort((h,m)=>h.score-m.score);break;case A.SIMILARITY:c.sort((h,m)=>m.score-h.score);break;default:throw re}for(const h of c)p.push(h.index);break}case b.FIRST_MATCH:for(let c=0;c<g;c+=1)if(a(l(t[c]))){p.push(c);break}break;default:throw it}return((c,h,m)=>{switch(m){case b.ALL_CLOSEST_MATCHES:case b.ALL_MATCHES:case b.ALL_SORTED_MATCHES:return h.map(d=>c[d]);case b.FIRST_CLOSEST_MATCH:case b.FIRST_MATCH:return h.length?c[h[0]]:null;default:throw it}})(t,p,o)}var P={exports:{}};let Wn=oe,Pn=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||Wn.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),S=(e,t,n=e)=>r=>{let o=""+r,s=o.indexOf(t,e.length);return~s?e+ut(o,t,n,s)+t:e+o+t},ut=(e,t,n,r)=>{let o=e.substring(0,r)+n,s=e.substring(r+t.length),i=s.indexOf(t);return~i?o+ut(s,t,n,i):o+s},ct=(e=Pn)=>({isColorSupported:e,reset:e?t=>`\x1B[0m${t}\x1B[0m`:String,bold:e?S("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:e?S("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:e?S("\x1B[3m","\x1B[23m"):String,underline:e?S("\x1B[4m","\x1B[24m"):String,inverse:e?S("\x1B[7m","\x1B[27m"):String,hidden:e?S("\x1B[8m","\x1B[28m"):String,strikethrough:e?S("\x1B[9m","\x1B[29m"):String,black:e?S("\x1B[30m","\x1B[39m"):String,red:e?S("\x1B[31m","\x1B[39m"):String,green:e?S("\x1B[32m","\x1B[39m"):String,yellow:e?S("\x1B[33m","\x1B[39m"):String,blue:e?S("\x1B[34m","\x1B[39m"):String,magenta:e?S("\x1B[35m","\x1B[39m"):String,cyan:e?S("\x1B[36m","\x1B[39m"):String,white:e?S("\x1B[37m","\x1B[39m"):String,gray:e?S("\x1B[90m","\x1B[39m"):String,bgBlack:e?S("\x1B[40m","\x1B[49m"):String,bgRed:e?S("\x1B[41m","\x1B[49m"):String,bgGreen:e?S("\x1B[42m","\x1B[49m"):String,bgYellow:e?S("\x1B[43m","\x1B[49m"):String,bgBlue:e?S("\x1B[44m","\x1B[49m"):String,bgMagenta:e?S("\x1B[45m","\x1B[49m"):String,bgCyan:e?S("\x1B[46m","\x1B[49m"):String,bgWhite:e?S("\x1B[47m","\x1B[49m"):String});P.exports=ct(),P.exports.createColors=ct;const Hn=e=>e.length<=1?e[0]:`${e.slice(0,-1).map(P.exports.bold).join(", ")} and ${P.exports.bold(e[e.length-1])}`,Un=()=>D({setup:e=>e.inspector({enforce:"pre",fn:(t,n)=>{const r=Object.keys(e._commands),o=!!r.length;try{n()}catch(s){if(!(s instanceof z||s instanceof K))throw s;if(t.raw._.length===0||s instanceof K){console.error("No command given."),o&&console.error(`Possible commands: ${Hn(r)}.`);return}const i=s.commandName,u=Nn(i,r);console.error(`Command "${P.exports.strikethrough(i)}" not found.`),o&&u?console.error(`Did you mean "${P.exports.bold(u)}"?`):o||console.error("NOTE: You haven't register any command yet."),process.stderr.write(`
|
|
72
|
+
`),process.exit(2)}}})}),Yn=e=>e.length<=1?e[0]:`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`,Vn=()=>D({setup:e=>e.inspector((t,n)=>{const r=Object.keys(t.unknownFlags);if(!t.resolved||r.length===0)n();else throw new Error(`Unexpected flag${r.length>1?"s":""}: ${Yn(r)}`)})}),Gn=e=>e.length===0?"":e.startsWith("v")?e:`v${e}`,qn=({alias:e=["V"],command:t=!0}={})=>D({setup:n=>{const r=Gn(n._version);return t&&(n=n.command("version","Show version",{notes:['The version string begins with a "v".']}).on("version",()=>{process.stdout.write(r)})),n.inspector({enforce:"pre",fn:(o,s)=>{let i=!1;const u=["version",...e];for(const a of Object.keys(o.raw.mergedFlags))if(u.includes(a)){i=!0;break}i?process.stdout.write(r):s()}})}});var M={exports:{}};let Zn=oe,Jn=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||Zn.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),w=(e,t,n=e)=>r=>{let o=""+r,s=o.indexOf(t,e.length);return~s?e+mt(o,t,n,s)+t:e+o+t},mt=(e,t,n,r)=>{let o=e.substring(0,r)+n,s=e.substring(r+t.length),i=s.indexOf(t);return~i?o+mt(s,t,n,i):o+s},ht=(e=Jn)=>({isColorSupported:e,reset:e?t=>`\x1B[0m${t}\x1B[0m`:String,bold:e?w("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:e?w("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:e?w("\x1B[3m","\x1B[23m"):String,underline:e?w("\x1B[4m","\x1B[24m"):String,inverse:e?w("\x1B[7m","\x1B[27m"):String,hidden:e?w("\x1B[8m","\x1B[28m"):String,strikethrough:e?w("\x1B[9m","\x1B[29m"):String,black:e?w("\x1B[30m","\x1B[39m"):String,red:e?w("\x1B[31m","\x1B[39m"):String,green:e?w("\x1B[32m","\x1B[39m"):String,yellow:e?w("\x1B[33m","\x1B[39m"):String,blue:e?w("\x1B[34m","\x1B[39m"):String,magenta:e?w("\x1B[35m","\x1B[39m"):String,cyan:e?w("\x1B[36m","\x1B[39m"):String,white:e?w("\x1B[37m","\x1B[39m"):String,gray:e?w("\x1B[90m","\x1B[39m"):String,bgBlack:e?w("\x1B[40m","\x1B[49m"):String,bgRed:e?w("\x1B[41m","\x1B[49m"):String,bgGreen:e?w("\x1B[42m","\x1B[49m"):String,bgYellow:e?w("\x1B[43m","\x1B[49m"):String,bgBlue:e?w("\x1B[44m","\x1B[49m"):String,bgMagenta:e?w("\x1B[45m","\x1B[49m"):String,bgCyan:e?w("\x1B[46m","\x1B[49m"):String,bgWhite:e?w("\x1B[47m","\x1B[49m"):String});M.exports=ht(),M.exports.createColors=ht;function zn(e){return e.split(`
|
|
73
|
+
`).splice(1).map(t=>t.trim().replace("file://",""))}function Kn(e){return`
|
|
74
|
+
${zn(e).map(t=>` ${t.replace(/^at ([\s\S]+) \((.+)\)/,(n,r,o)=>M.exports.gray(`at ${r} (${M.exports.cyan(o)})`))}`).join(`
|
|
75
|
+
`)}`}function Qn(e){return e.map(t=>typeof(t==null?void 0:t.stack)=="string"?`${t.message}
|
|
76
|
+
${Kn(t.stack)}`:t)}function Xn(e,t){const n=e.toUpperCase(),r=M.exports[t];return M.exports.bold(M.exports.inverse(r(` ${n} `)))}function q(e,t,n){const r=M.exports[t],o=n!=null&&n.textColor?M.exports[n.textColor]:r,s=(n==null?void 0:n.target)||console.log;return(...i)=>{const u=Qn(i);s(`${Xn(e,t)} ${o(u.join(" "))}
|
|
77
|
+
`)}}q("log","gray"),q("info","blue",{target:console.info}),q("warn","yellow",{target:console.warn}),q("success","green");const er=q("error","red",{target:console.error}),tr=()=>D({setup:e=>e.inspector({enforce:"pre",fn:(t,n)=>{try{n()}catch(r){er(r.message),process.exit(1)}}})});export{Wt as Clerc,we as CommandExistsError,ye as CommandNameConflictError,be as DescriptionNotSetError,ve as InvalidCommandNameError,Ce as NameNotSetError,K as NoCommandGivenError,z as NoSuchCommandError,y as Root,Ee as VersionNotSetError,Jt as completionsPlugin,Ie as compose,Ut as defineCommand,Pt as defineHandler,Ht as defineInspector,D as definePlugin,j as formatCommandName,tr as friendlyErrorPlugin,dn as helpPlugin,ke as isInvalidName,Un as notFoundPlugin,ae as resolveArgv,ie as resolveCommand,_e as resolveFlattenCommands,Me as resolveParametersBeforeFlag,Dt as resolveRootCommands,Te as resolveSubcommandsByParent,Vn as strictFlagsPlugin,qn as versionPlugin,Fe as withBrackets};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clerc",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.0",
|
|
4
4
|
"author": "Ray <nn_201312@163.com> (https://github.com/so1ve)",
|
|
5
5
|
"description": "Clerc: The full-featured cli framework.",
|
|
6
6
|
"keywords": [
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"exports": {
|
|
27
27
|
".": {
|
|
28
28
|
"types": "./dist/index.d.ts",
|
|
29
|
-
"import": "./dist/index.
|
|
29
|
+
"import": "./dist/index.js"
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
"main": "dist/index.js",
|
|
33
|
-
"module": "dist/index.
|
|
33
|
+
"module": "dist/index.js",
|
|
34
34
|
"types": "dist/index.d.ts",
|
|
35
35
|
"typesVersions": {
|
|
36
36
|
"*": {
|
|
@@ -47,13 +47,13 @@
|
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@clerc/
|
|
51
|
-
"@clerc/plugin-
|
|
52
|
-
"@clerc/
|
|
53
|
-
"@clerc/plugin-
|
|
54
|
-
"@clerc/plugin-
|
|
55
|
-
"@clerc/plugin-
|
|
56
|
-
"@clerc/plugin-version": "0.
|
|
50
|
+
"@clerc/plugin-completions": "0.28.0",
|
|
51
|
+
"@clerc/plugin-friendly-error": "0.28.0",
|
|
52
|
+
"@clerc/core": "0.28.0",
|
|
53
|
+
"@clerc/plugin-not-found": "0.28.0",
|
|
54
|
+
"@clerc/plugin-strict-flags": "0.28.0",
|
|
55
|
+
"@clerc/plugin-help": "0.28.0",
|
|
56
|
+
"@clerc/plugin-version": "0.28.0"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"build": "puild --minify",
|
package/dist/index.mjs
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import mu from"tty";import st from"util";import it from"os";class at{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(D=>D(e,...t)),this.listenerMap[e].forEach(D=>D(...t))),this}off(e,t){var D,n;return e==="**"?(this.listenerMap={},this.wildcardListeners.clear(),this):e==="*"?(t?this.wildcardListeners.delete(t):this.wildcardListeners.clear(),this):(t?(D=this.listenerMap[e])==null||D.delete(t):(n=this.listenerMap[e])==null||n.clear(),this)}}const lt="known-flag",ct="unknown-flag",ht="argument",{stringify:q}=JSON,pt=/\B([A-Z])/g,mt=u=>u.replace(pt,"-$1").toLowerCase(),{hasOwnProperty:ft}=Object.prototype,Z=(u,e)=>ft.call(u,e),dt=u=>Array.isArray(u),ku=u=>typeof u=="function"?[u,!1]:dt(u)?[u[0],!0]:ku(u.type),Ft=(u,e)=>u===Boolean?e!=="false":e,Ct=(u,e)=>typeof e=="boolean"?e:u===Number&&e===""?Number.NaN:u(e),gt=/[\s.:=]/,Et=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(gt);if(t)throw new Error(`${e} cannot contain ${q(t==null?void 0:t[0])}`)},Bt=u=>{const e={},t=(D,n)=>{if(Z(e,D))throw new Error(`Duplicate flags named ${q(D)}`);e[D]=n};for(const D in u){if(!Z(u,D))continue;Et(D);const n=u[D],r=[[],...ku(n),n];t(D,r);const o=mt(D);if(D!==o&&t(o,r),"alias"in n&&typeof n.alias=="string"){const{alias:l}=n,a=`Flag alias ${q(l)} for flag ${q(D)}`;if(l.length===0)throw new Error(`${a} cannot be empty`);if(l.length>1)throw new Error(`${a} must be a single character`);t(l,r)}}return e},xt=(u,e)=>{const t={};for(const D in u){if(!Z(u,D))continue;const[n,,r,o]=e[D];if(n.length===0&&"default"in o){let{default:l}=o;typeof l=="function"&&(l=l()),t[D]=l}else t[D]=r?n:n.pop()}return t},ru="--",bt=/[.:=]/,At=/^-{1,2}\w/,yt=u=>{if(!At.test(u))return;const e=!u.startsWith(ru);let t=u.slice(e?1:2),D;const n=t.match(bt);if(n){const{index:r}=n;D=t.slice(r+1),t=t.slice(0,r)}return[t,D,e]},wt=(u,{onFlag:e,onArgument:t})=>{let D;const n=(r,o)=>{if(typeof D!="function")return!0;D(r,o),D=void 0};for(let r=0;r<u.length;r+=1){const o=u[r];if(o===ru){n();const a=u.slice(r+1);t==null||t(a,[r],!0);break}const l=yt(o);if(l){if(n(),!e)continue;const[a,s,d]=l;if(d)for(let C=0;C<a.length;C+=1){n();const m=C===a.length-1;D=e(a[C],m?s:void 0,[r,C+1,m])}else D=e(a,s,[r])}else n(o,[r])&&(t==null||t([o],[r]))}n()},St=(u,e)=>{for(const[t,D,n]of e.reverse()){if(D){const r=u[t];let o=r.slice(0,D);if(n||(o+=r.slice(D+1)),o!=="-"){u[t]=o;continue}}u.splice(t,1)}},$t=(u,e=process.argv.slice(2),{ignore:t}={})=>{const D=[],n=Bt(u),r={},o=[];return o[ru]=[],wt(e,{onFlag(l,a,s){const d=Z(n,l);if(!(t!=null&&t(d?lt:ct,l,a))){if(d){const[C,m]=n[l],h=Ft(m,a),i=(c,p)=>{D.push(s),p&&D.push(p),C.push(Ct(m,c||""))};return h===void 0?i:i(h)}Z(r,l)||(r[l]=[]),r[l].push(a===void 0?!0:a),D.push(s)}},onArgument(l,a,s){t!=null&&t(ht,e[a[0]])||(o.push(...l),s?(o[ru]=l,e.splice(a[0])):D.push(a))}}),St(e,D),{flags:xt(u,n),unknownFlags:r,_:o}},fu=u=>Array.isArray(u)?u:[u],vt=u=>u.replace(/-([a-z])/g,(e,t)=>t.toUpperCase()),Ot=(u,e)=>e.length!==u.length?!1:u.every((t,D)=>t===e[D]),Lu=(u,e)=>e.length>u.length?!1:Ot(u.slice(0,e.length),e);class Iu extends Error{constructor(e){super(`Command "${e}" exists.`),this.commandName=e}}class ou extends Error{constructor(e){super(`No such command: ${e}`),this.commandName=e}}class su extends Error{constructor(){super("No command given.")}}class ju extends Error{constructor(e,t){super(`Command name ${e} conflicts with ${t}. Maybe caused by alias.`),this.n1=e,this.n2=t}}class Nu extends Error{constructor(){super("Name not set.")}}class Wu extends Error{constructor(){super("Description not set.")}}class Pu extends Error{constructor(){super("Version not set.")}}class Hu extends Error{constructor(e){super(`Bad name format: ${e}`),this.commandName=e}}function Tt(){return typeof process!="undefined"}function Rt(){return typeof Deno!="undefined"}function Gu(u,e,t){if(t.alias){const D=fu(t.alias);for(const n of D){if(n in e)throw new ju(e[n].name,t.name);u.set(typeof n=="symbol"?n:n.split(" "),{...t,__isAlias:!0})}}}function Yu(u){const e=new Map;u[w]&&(e.set(w,u[w]),Gu(e,u,u[w]));for(const t of Object.values(u))Gu(e,u,t),e.set(t.name.split(" "),t);return e}function du(u,e){if(e===w)return u[w];const t=fu(e),D=Yu(u);let n,r;return D.forEach((o,l)=>{if(l===w){n=D.get(w),r=w;return}Lu(t,l)&&(!r||r===w||l.length>r.length)&&(n=o,r=l)}),n}function zu(u,e,t=1/0){const D=e===""?[]:Array.isArray(e)?e:e.split(" ");return Object.values(u).filter(n=>{const r=n.name.split(" ");return Lu(r,D)&&r.length-D.length<=t})}const _t=u=>zu(u,"",1);function Uu(u){const e=[];for(const t of u){if(t.startsWith("-"))break;e.push(t)}return e}const Vu=()=>Tt()?process.argv.slice(2):Rt()?Deno.args:[];function qu(u){const e={pre:[],normal:[],post:[]};for(const D of u){const n=typeof D=="object"?D:{fn:D},{enforce:r,fn:o}=n;r==="post"||r==="pre"?e[r].push(o):e.normal.push(o)}const t=[...e.pre,...e.normal,...e.post];return D=>{return n(0);function n(r){const o=t[r];return o(D(),n.bind(null,r+1))}}}const Zu=u=>typeof u=="string"&&(u.startsWith(" ")||u.endsWith(" ")),Ju=(u,e)=>e?`[${u}]`:`<${u}>`,Mt="<Root>",H=u=>Array.isArray(u)?u.join(" "):typeof u=="string"?u:Mt,{stringify:G}=JSON;function Fu(u){const e=[];let t,D;for(const n of u){if(D)throw new Error(`Invalid parameter: Spread parameter ${G(D)} must be last`);const r=n[0],o=n[n.length-1];let l;if(r==="<"&&o===">"&&(l=!0,t))throw new Error(`Invalid parameter: Required parameter ${G(n)} cannot come after optional parameter ${G(t)}`);if(r==="["&&o==="]"&&(l=!1,t=n),l===void 0)throw new Error(`Invalid parameter: ${G(n)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);let a=n.slice(1,-1);const s=a.slice(-3)==="...";s&&(D=n,a=a.slice(0,-3)),e.push({name:a,required:l,spread:s})}return e}function Cu(u,e,t){for(let D=0;D<e.length;D+=1){const{name:n,required:r,spread:o}=e[D],l=vt(n);if(l in u)return new Error(`Invalid parameter: ${G(n)} is used more than once.`);const a=o?t.slice(D):t[D];if(o&&(D=e.length),r&&(!a||o&&a.length===0))return new Error(`Error: Missing required parameter ${G(n)}`);u[l]=a}}var Ku=(u,e,t)=>{if(!e.has(u))throw TypeError("Cannot "+t)},y=(u,e,t)=>(Ku(u,e,"read from private field"),t?t.call(u):e.get(u)),_=(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)},Y=(u,e,t,D)=>(Ku(u,e,"write to private field"),D?D.call(u,t):e.set(u,t),t),j,N,W,J,K,iu,z,gu,Qu,Eu,Xu;const w=Symbol("Root"),ue=class{constructor(u,e,t){_(this,gu),_(this,Eu),_(this,j,""),_(this,N,""),_(this,W,""),_(this,J,[]),_(this,K,{}),_(this,iu,new at),_(this,z,new Set),Y(this,j,u||y(this,j)),Y(this,N,e||y(this,N)),Y(this,W,t||y(this,W))}get _name(){return y(this,j)}get _description(){return y(this,N)}get _version(){return y(this,W)}get _inspectors(){return y(this,J)}get _commands(){return y(this,K)}static create(u,e,t){return new ue(u,e,t)}name(u){return Y(this,j,u),this}description(u){return Y(this,N,u),this}version(u){return Y(this,W,u),this}command(u,e,t={}){const D=(s=>!(typeof s=="string"||s===w))(u),n=D?u.name:u;if(Zu(n))throw new Hu(n);const{handler:r=void 0,...o}=D?u:{name:n,description:e,...t},l=[o.name],a=o.alias?fu(o.alias):[];o.alias&&l.push(...a);for(const s of l)if(y(this,z).has(s))throw new Iu(H(s));return y(this,K)[n]=o,y(this,z).add(o.name),a.forEach(s=>y(this,z).add(s)),D&&r&&this.on(u.name,r),this}on(u,e){return y(this,iu).on(u,e),this}use(u){return u.setup(this)}inspector(u){return y(this,J).push(u),this}parse(u=Vu()){if(!y(this,j))throw new Nu;if(!y(this,N))throw new Wu;if(!y(this,W))throw new Pu;const e=Uu(u),t=e.join(" "),D=()=>du(y(this,K),e),n=[],r=()=>{n.length=0;const a=D(),s=!!a,d=$t((a==null?void 0:a.flags)||{},[...u]),{_:C,flags:m,unknownFlags:h}=d;let i=!s||a.name===w?C:C.slice(a.name.split(" ").length),c=(a==null?void 0:a.parameters)||[];const p=c.indexOf("--"),F=c.slice(p+1)||[],f=Object.create(null);if(p>-1&&F.length>0){c=c.slice(0,p);const g=C["--"];i=i.slice(0,-g.length||void 0),n.push(Cu(f,Fu(c),i)),n.push(Cu(f,Fu(F),g))}else n.push(Cu(f,Fu(c),i));const E={...m,...h};return{name:a==null?void 0:a.name,called:e.length===0&&(a==null?void 0:a.name)?w:t,resolved:s,hasRootOrAlias:y(this,gu,Qu),hasRoot:y(this,Eu,Xu),raw:{...d,parameters:i,mergedFlags:E},parameters:f,flags:m,unknownFlags:h,cli:this}},o={enforce:"post",fn:()=>{const a=D(),s=r(),d=n.filter(Boolean);if(d.length>0)throw d[0];if(!a)throw t?new ou(t):new su;y(this,iu).emit(a.name,s)}},l=[...y(this,J),o];return qu(l)(r),this}};let kt=ue;j=new WeakMap,N=new WeakMap,W=new WeakMap,J=new WeakMap,K=new WeakMap,iu=new WeakMap,z=new WeakMap,gu=new WeakSet,Qu=function(){return y(this,z).has(w)},Eu=new WeakSet,Xu=function(){return Object.prototype.hasOwnProperty.call(this._commands,w)};const P=u=>u,Lt=(u,e,t)=>t,It=(u,e)=>e,jt=(u,e)=>({...u,handler:e}),Nt=u=>`
|
|
2
|
-
${u})
|
|
3
|
-
cmd+="__${u}"
|
|
4
|
-
;;`,Wt=u=>{const{cli:e}=u,{_name:t,_commands:D}=e;return`_${t}() {
|
|
5
|
-
local i cur prev opts cmds
|
|
6
|
-
COMPREPLY=()
|
|
7
|
-
cur="\${COMP_WORDS[COMP_CWORD]}"
|
|
8
|
-
prev="\${COMP_WORDS[COMP_CWORD-1]}"
|
|
9
|
-
cmd=""
|
|
10
|
-
opts=""
|
|
11
|
-
|
|
12
|
-
for i in \${COMP_WORDS[@]}
|
|
13
|
-
do
|
|
14
|
-
case "\${i}" in
|
|
15
|
-
"$1")
|
|
16
|
-
cmd="${t}"
|
|
17
|
-
;;
|
|
18
|
-
${Object.keys(D).map(Nt).join("")}
|
|
19
|
-
*)
|
|
20
|
-
;;
|
|
21
|
-
esac
|
|
22
|
-
done
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
complete -F _${t} -o bashdefault -o default ${t}
|
|
26
|
-
`},ee=u=>u.replace(/([A-Z])/g,(e,t)=>`-${t.toLowerCase()}`),te=u=>u.length<=1?`-${u}`:`--${ee(u)}`,De="(No Description)",Pt=u=>`[CompletionResult]::new('${u.name}', '${u.name}', [CompletionResultType]::ParameterValue, '${u.description}')`,Ht=u=>Object.entries(u.flags||{}).map(([e,t])=>{const D=[`[CompletionResult]::new('${te(e)}', '${ee(e)}', [CompletionResultType]::ParameterName, '${u.flags[e].description||De}')`];return t!=null&&t.alias&&D.push(`[CompletionResult]::new('${te(t.alias)}', '${t.alias}', [CompletionResultType]::ParameterName, '${u.flags[e].description||De}')`),D.join(`
|
|
27
|
-
`)}).join(`
|
|
28
|
-
`),Gt=u=>{const{cli:e}=u,{_name:t,_commands:D}=e;return`using namespace System.Management.Automation
|
|
29
|
-
using namespace System.Management.Automation.Language
|
|
30
|
-
|
|
31
|
-
Register-ArgumentCompleter -Native -CommandName '${t}' -ScriptBlock {
|
|
32
|
-
param($wordToComplete, $commandAst, $cursorPosition)
|
|
33
|
-
|
|
34
|
-
$commandElements = $commandAst.CommandElements
|
|
35
|
-
$command = @(
|
|
36
|
-
'${t}'
|
|
37
|
-
for ($i = 1; $i -lt $commandElements.Count; $i++) {
|
|
38
|
-
$element = $commandElements[$i]
|
|
39
|
-
if ($element -isnot [StringConstantExpressionAst] -or
|
|
40
|
-
$element.StringConstantType -ne [StringConstantType]::BareWord -or
|
|
41
|
-
$element.Value.StartsWith('-') -or
|
|
42
|
-
$element.Value -eq $wordToComplete) {
|
|
43
|
-
break
|
|
44
|
-
}
|
|
45
|
-
$element.Value
|
|
46
|
-
}) -join ';'
|
|
47
|
-
|
|
48
|
-
$completions = @(switch ($command) {
|
|
49
|
-
'${t}' {
|
|
50
|
-
${Object.entries(D).map(([n,r])=>Pt(r)).join(`
|
|
51
|
-
`)}
|
|
52
|
-
break
|
|
53
|
-
}
|
|
54
|
-
${Object.entries(D).map(([n,r])=>`'${t};${n.split(" ").join(";")}' {
|
|
55
|
-
${Ht(r)}
|
|
56
|
-
break
|
|
57
|
-
}`).join(`
|
|
58
|
-
`)}
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
$completions.Where{ $_.CompletionText -like "$wordToComplete*" } |
|
|
62
|
-
Sort-Object -Property ListItemText
|
|
63
|
-
}`},ne={bash:Wt,pwsh:Gt},Yt=(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",D=>{if(!e._name)throw new Error("CLI name is not defined!");const n=String(D.parameters.shell||D.flags.shell);if(!n)throw new Error("Missing shell name");if(n in ne)process.stdout.write(ne[n](D));else throw new Error(`No such shell: ${n}`)})),e}}),zt=u=>Array.isArray(u)?u:[u],Ut=u=>u.replace(/([A-Z])/g,(e,t)=>`-${t.toLowerCase()}`),re=u=>u.length<=1?`-${u}`:`--${Ut(u)}`;function Vt(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var $={exports:{}};let qt=mu,Zt=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||qt.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),B=(u,e,t=u)=>D=>{let n=""+D,r=n.indexOf(e,u.length);return~r?u+oe(n,e,t,r)+e:u+n+e},oe=(u,e,t,D)=>{let n=u.substring(0,D)+t,r=u.substring(D+e.length),o=r.indexOf(e);return~o?n+oe(r,e,t,o):n+r},se=(u=Zt)=>({isColorSupported:u,reset:u?e=>`\x1B[0m${e}\x1B[0m`:String,bold:u?B("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:u?B("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:u?B("\x1B[3m","\x1B[23m"):String,underline:u?B("\x1B[4m","\x1B[24m"):String,inverse:u?B("\x1B[7m","\x1B[27m"):String,hidden:u?B("\x1B[8m","\x1B[28m"):String,strikethrough:u?B("\x1B[9m","\x1B[29m"):String,black:u?B("\x1B[30m","\x1B[39m"):String,red:u?B("\x1B[31m","\x1B[39m"):String,green:u?B("\x1B[32m","\x1B[39m"):String,yellow:u?B("\x1B[33m","\x1B[39m"):String,blue:u?B("\x1B[34m","\x1B[39m"):String,magenta:u?B("\x1B[35m","\x1B[39m"):String,cyan:u?B("\x1B[36m","\x1B[39m"):String,white:u?B("\x1B[37m","\x1B[39m"):String,gray:u?B("\x1B[90m","\x1B[39m"):String,bgBlack:u?B("\x1B[40m","\x1B[49m"):String,bgRed:u?B("\x1B[41m","\x1B[49m"):String,bgGreen:u?B("\x1B[42m","\x1B[49m"):String,bgYellow:u?B("\x1B[43m","\x1B[49m"):String,bgBlue:u?B("\x1B[44m","\x1B[49m"):String,bgMagenta:u?B("\x1B[45m","\x1B[49m"):String,bgCyan:u?B("\x1B[46m","\x1B[49m"):String,bgWhite:u?B("\x1B[47m","\x1B[49m"):String});$.exports=se(),$.exports.createColors=se;var Jt=Function.prototype.toString,Kt=/\s*function(?:\s|\s*\/\*[^(?:*\/)]+\*\/\s*)*([^\s\(\/]+)/;function Qt(u){if(typeof u!="function")return null;var e="";if(typeof Function.prototype.name=="undefined"&&typeof u.name=="undefined"){var t=Jt.call(u).match(Kt);t&&(e=t[1])}else e=u.name;return e}var ie=Qt,ae={exports:{}};let Bu=[],le=0;const S=(u,e)=>{le>=e&&Bu.push(u)};S.WARN=1,S.INFO=2,S.DEBUG=3,S.reset=()=>{Bu=[]},S.setDebugLevel=u=>{le=u},S.warn=u=>S(u,S.WARN),S.info=u=>S(u,S.INFO),S.debug=u=>S(u,S.DEBUG),S.debugMessages=()=>Bu;var xu=S,bu={exports:{}},Xt=({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")};const uD=Xt;var eD=u=>typeof u=="string"?u.replace(uD(),""):u,Au={exports:{}};const ce=u=>Number.isNaN(u)?!1:u>=4352&&(u<=4447||u===9001||u===9002||11904<=u&&u<=12871&&u!==12351||12880<=u&&u<=19903||19968<=u&&u<=42182||43360<=u&&u<=43388||44032<=u&&u<=55203||63744<=u&&u<=64255||65040<=u&&u<=65049||65072<=u&&u<=65131||65281<=u&&u<=65376||65504<=u&&u<=65510||110592<=u&&u<=110593||127488<=u&&u<=127569||131072<=u&&u<=262141);Au.exports=ce,Au.exports.default=ce;var tD=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\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\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])|\uD83C[\uDF3E\uDF73\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])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\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])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\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\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*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\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\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\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[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g};const DD=eD,nD=Au.exports,rD=tD,he=u=>{if(typeof u!="string"||u.length===0||(u=DD(u),u.length===0))return 0;u=u.replace(rD()," ");let e=0;for(let t=0;t<u.length;t++){const D=u.codePointAt(t);D<=31||D>=127&&D<=159||D>=768&&D<=879||(D>65535&&t++,e+=nD(D)?2:1)}return e};bu.exports=he,bu.exports.default=he;const pe=bu.exports;function au(u){return u?/\u001b\[((?:\d*;){0,5}\d*)m/g:/\u001b\[(?:\d*;){0,5}\d*m/g}function R(u){let e=au();return(""+u).replace(e,"").split(`
|
|
64
|
-
`).reduce(function(t,D){return pe(D)>t?pe(D):t},0)}function Q(u,e){return Array(e+1).join(u)}function oD(u,e,t,D){let n=R(u);if(e+1>=n){let r=e-n;switch(D){case"right":{u=Q(t,r)+u;break}case"center":{let o=Math.ceil(r/2),l=r-o;u=Q(t,l)+u+Q(t,o);break}default:{u=u+Q(t,r);break}}}return u}let U={};function X(u,e,t){e="\x1B["+e+"m",t="\x1B["+t+"m",U[e]={set:u,to:!0},U[t]={set:u,to:!1},U[u]={on:e,off:t}}X("bold",1,22),X("italics",3,23),X("underline",4,24),X("inverse",7,27),X("strikethrough",9,29);function me(u,e){let t=e[1]?parseInt(e[1].split(";")[0]):0;if(t>=30&&t<=39||t>=90&&t<=97){u.lastForegroundAdded=e[0];return}if(t>=40&&t<=49||t>=100&&t<=107){u.lastBackgroundAdded=e[0];return}if(t===0){for(let n in u)Object.prototype.hasOwnProperty.call(u,n)&&delete u[n];return}let D=U[e[0]];D&&(u[D.set]=D.to)}function sD(u){let e=au(!0),t=e.exec(u),D={};for(;t!==null;)me(D,t),t=e.exec(u);return D}function fe(u,e){let t=u.lastBackgroundAdded,D=u.lastForegroundAdded;return delete u.lastBackgroundAdded,delete u.lastForegroundAdded,Object.keys(u).forEach(function(n){u[n]&&(e+=U[n].off)}),t&&t!="\x1B[49m"&&(e+="\x1B[49m"),D&&D!="\x1B[39m"&&(e+="\x1B[39m"),e}function iD(u,e){let t=u.lastBackgroundAdded,D=u.lastForegroundAdded;return delete u.lastBackgroundAdded,delete u.lastForegroundAdded,Object.keys(u).forEach(function(n){u[n]&&(e=U[n].on+e)}),t&&t!="\x1B[49m"&&(e=t+e),D&&D!="\x1B[39m"&&(e=D+e),e}function aD(u,e){if(u.length===R(u))return u.substr(0,e);for(;R(u)>e;)u=u.slice(0,-1);return u}function lD(u,e){let t=au(!0),D=u.split(au()),n=0,r=0,o="",l,a={};for(;r<e;){l=t.exec(u);let s=D[n];if(n++,r+R(s)>e&&(s=aD(s,e-r)),o+=s,r+=R(s),r<e){if(!l)break;o+=l[0],me(a,l)}}return fe(a,o)}function cD(u,e,t){return t=t||"\u2026",R(u)<=e?u:(e-=R(t),lD(u,e)+t)}function hD(){return{chars:{top:"\u2500","top-mid":"\u252C","top-left":"\u250C","top-right":"\u2510",bottom:"\u2500","bottom-mid":"\u2534","bottom-left":"\u2514","bottom-right":"\u2518",left:"\u2502","left-mid":"\u251C",mid:"\u2500","mid-mid":"\u253C",right:"\u2502","right-mid":"\u2524",middle:"\u2502"},truncate:"\u2026",colWidths:[],rowHeights:[],colAligns:[],rowAligns:[],style:{"padding-left":1,"padding-right":1,head:["red"],border:["grey"],compact:!1},head:[]}}function pD(u,e){u=u||{},e=e||hD();let t=Object.assign({},e,u);return t.chars=Object.assign({},e.chars,u.chars),t.style=Object.assign({},e.style,u.style),t}function mD(u,e){let t=[],D=e.split(/(\s+)/g),n=[],r=0,o;for(let l=0;l<D.length;l+=2){let a=D[l],s=r+R(a);r>0&&o&&(s+=o.length),s>u?(r!==0&&t.push(n.join("")),n=[a],r=R(a)):(n.push(o||"",a),r=s),o=D[l+1]}return r&&t.push(n.join("")),t}function fD(u,e){let t=[],D="";function n(o,l){for(D.length&&l&&(D+=l),D+=o;D.length>u;)t.push(D.slice(0,u)),D=D.slice(u)}let r=e.split(/(\s+)/g);for(let o=0;o<r.length;o+=2)n(r[o],o&&r[o-1]);return D.length&&t.push(D),t}function dD(u,e,t=!0){let D=[];e=e.split(`
|
|
65
|
-
`);const n=t?mD:fD;for(let r=0;r<e.length;r++)D.push.apply(D,n(u,e[r]));return D}function FD(u){let e={},t=[];for(let D=0;D<u.length;D++){let n=iD(e,u[D]);e=sD(n);let r=Object.assign({},e);t.push(fe(r,n))}return t}function CD(u,e){const t="\x1B]",D="\x07",n=";";return[t,"8",n,n,u||e,D,e,t,"8",n,n,D].join("")}var de={strlen:R,repeat:Q,pad:oD,truncate:cD,mergeOptions:pD,wordWrap:dD,colorizeLines:FD,hyperlink:CD},Fe={exports:{}},lu={exports:{}},Ce={exports:{}},ge={exports:{}},Ee={exports:{}},Be;function gD(){return Be||(Be=1,function(u){var e={};u.exports=e;var t={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(t).forEach(function(D){var n=t[D],r=e[D]=[];r.open="\x1B["+n[0]+"m",r.close="\x1B["+n[1]+"m"})}(Ee)),Ee.exports}var xe,be;function ED(){return be||(be=1,xe=function(u,e){e=e||process.argv;var t=e.indexOf("--"),D=/^-{1,2}/.test(u)?"":"--",n=e.indexOf(D+u);return n!==-1&&(t===-1?!0:n<t)}),xe}var yu,Ae;function BD(){if(Ae)return yu;Ae=1;var u=it,e=ED(),t=process.env,D=void 0;e("no-color")||e("no-colors")||e("color=false")?D=!1:(e("color")||e("colors")||e("color=true")||e("color=always"))&&(D=!0),"FORCE_COLOR"in t&&(D=t.FORCE_COLOR.length===0||parseInt(t.FORCE_COLOR,10)!==0);function n(l){return l===0?!1:{level:l,hasBasic:!0,has256:l>=2,has16m:l>=3}}function r(l){if(D===!1)return 0;if(e("color=16m")||e("color=full")||e("color=truecolor"))return 3;if(e("color=256"))return 2;if(l&&!l.isTTY&&D!==!0)return 0;var a=D?1:0;if(process.platform==="win32"){var s=u.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in t)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(C){return C in t})||t.CI_NAME==="codeship"?1:a;if("TEAMCITY_VERSION"in t)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(t.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in t){var d=parseInt((t.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(t.TERM_PROGRAM){case"iTerm.app":return d>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(t.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(t.TERM)||"COLORTERM"in t?1:(t.TERM,a)}function o(l){var a=r(l);return n(a)}return yu={supportsColor:o,stdout:o(process.stdout),stderr:o(process.stderr)},yu}var ye={exports:{}},we;function xD(){return we||(we=1,function(u){u.exports=function(e,t){var D="";e=e||"Run the trap, drop the bass",e=e.split("");var n={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return e.forEach(function(r){r=r.toLowerCase();var o=n[r]||[" "],l=Math.floor(Math.random()*o.length);typeof n[r]!="undefined"?D+=n[r][l]:D+=r}),D}}(ye)),ye.exports}var Se={exports:{}},$e;function bD(){return $e||($e=1,function(u){u.exports=function(e,t){e=e||" he is here ";var D={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},n=[].concat(D.up,D.down,D.mid);function r(a){var s=Math.floor(Math.random()*a);return s}function o(a){var s=!1;return n.filter(function(d){s=d===a}),s}function l(a,s){var d="",C,m;s=s||{},s.up=typeof s.up!="undefined"?s.up:!0,s.mid=typeof s.mid!="undefined"?s.mid:!0,s.down=typeof s.down!="undefined"?s.down:!0,s.size=typeof s.size!="undefined"?s.size:"maxi",a=a.split("");for(m in a)if(!o(m)){switch(d=d+a[m],C={up:0,down:0,mid:0},s.size){case"mini":C.up=r(8),C.mid=r(2),C.down=r(8);break;case"maxi":C.up=r(16)+3,C.mid=r(4)+1,C.down=r(64)+3;break;default:C.up=r(8)+1,C.mid=r(6)/2,C.down=r(8)+1;break}var h=["up","mid","down"];for(var i in h)for(var c=h[i],p=0;p<=C[c];p++)s[c]&&(d=d+D[c][r(D[c].length)])}return d}return l(e,t)}}(Se)),Se.exports}var ve={exports:{}},Oe;function AD(){return Oe||(Oe=1,function(u){u.exports=function(e){return function(t,D,n){if(t===" ")return t;switch(D%3){case 0:return e.red(t);case 1:return e.white(t);case 2:return e.blue(t)}}}}(ve)),ve.exports}var Te={exports:{}},Re;function yD(){return Re||(Re=1,function(u){u.exports=function(e){return function(t,D,n){return D%2===0?t:e.inverse(t)}}}(Te)),Te.exports}var _e={exports:{}},Me;function wD(){return Me||(Me=1,function(u){u.exports=function(e){var t=["red","yellow","green","blue","magenta"];return function(D,n,r){return D===" "?D:e[t[n++%t.length]](D)}}}(_e)),_e.exports}var ke={exports:{}},Le;function SD(){return Le||(Le=1,function(u){u.exports=function(e){var t=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(D,n,r){return D===" "?D:e[t[Math.round(Math.random()*(t.length-2))]](D)}}}(ke)),ke.exports}var Ie;function $D(){return Ie||(Ie=1,function(u){var e={};u.exports=e,e.themes={};var t=st,D=e.styles=gD(),n=Object.defineProperties,r=new RegExp(/[\r\n]+/g);e.supportsColor=BD().supportsColor,typeof e.enabled=="undefined"&&(e.enabled=e.supportsColor()!==!1),e.enable=function(){e.enabled=!0},e.disable=function(){e.enabled=!1},e.stripColors=e.strip=function(c){return(""+c).replace(/\x1B\[\d+m/g,"")},e.stylize=function(c,p){if(!e.enabled)return c+"";var F=D[p];return!F&&p in e?e[p](c):F.open+c+F.close};var o=/[|\\{}()[\]^$+*?.]/g,l=function(c){if(typeof c!="string")throw new TypeError("Expected a string");return c.replace(o,"\\$&")};function a(c){var p=function F(){return C.apply(F,arguments)};return p._styles=c,p.__proto__=d,p}var s=function(){var c={};return D.grey=D.gray,Object.keys(D).forEach(function(p){D[p].closeRe=new RegExp(l(D[p].close),"g"),c[p]={get:function(){return a(this._styles.concat(p))}}}),c}(),d=n(function(){},s);function C(){var c=Array.prototype.slice.call(arguments),p=c.map(function(A){return A!=null&&A.constructor===String?A:t.inspect(A)}).join(" ");if(!e.enabled||!p)return p;for(var F=p.indexOf(`
|
|
66
|
-
`)!=-1,f=this._styles,E=f.length;E--;){var g=D[f[E]];p=g.open+p.replace(g.closeRe,g.open)+g.close,F&&(p=p.replace(r,function(A){return g.close+A+g.open}))}return p}e.setTheme=function(c){if(typeof c=="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var p in c)(function(F){e[F]=function(f){if(typeof c[F]=="object"){var E=f;for(var g in c[F])E=e[c[F][g]](E);return E}return e[c[F]](f)}})(p)};function m(){var c={};return Object.keys(s).forEach(function(p){c[p]={get:function(){return a([p])}}}),c}var h=function(c,p){var F=p.split("");return F=F.map(c),F.join("")};e.trap=xD(),e.zalgo=bD(),e.maps={},e.maps.america=AD()(e),e.maps.zebra=yD()(e),e.maps.rainbow=wD()(e),e.maps.random=SD()(e);for(var i in e.maps)(function(c){e[c]=function(p){return h(e.maps[c],p)}})(i);n(e,m())}(ge)),ge.exports}var je;function vD(){return je||(je=1,function(u){var e=$D();u.exports=e}(Ce)),Ce.exports}const{info:OD,debug:Ne}=xu,v=de;class eu{constructor(e){this.setOptions(e),this.x=null,this.y=null}setOptions(e){["boolean","number","string"].indexOf(typeof e)!==-1&&(e={content:""+e}),e=e||{},this.options=e;let t=e.content;if(["boolean","number","string"].indexOf(typeof t)!==-1)this.content=String(t);else if(!t)this.content=this.options.href||"";else throw new Error("Content needs to be a primitive, got: "+typeof t);this.colSpan=e.colSpan||1,this.rowSpan=e.rowSpan||1,this.options.href&&Object.defineProperty(this,"href",{get(){return this.options.href}})}mergeTableOptions(e,t){this.cells=t;let D=this.options.chars||{},n=e.chars,r=this.chars={};RD.forEach(function(a){$u(D,n,a,r)}),this.truncate=this.options.truncate||e.truncate;let o=this.options.style=this.options.style||{},l=e.style;$u(o,l,"padding-left",this),$u(o,l,"padding-right",this),this.head=o.head||l.head,this.border=o.border||l.border,this.fixedWidth=e.colWidths[this.x],this.lines=this.computeLines(e),this.desiredWidth=v.strlen(this.content)+this.paddingLeft+this.paddingRight,this.desiredHeight=this.lines.length}computeLines(e){const t=e.wordWrap||e.textWrap,{wordWrap:D=t}=this.options;if(this.fixedWidth&&D){if(this.fixedWidth-=this.paddingLeft+this.paddingRight,this.colSpan){let o=1;for(;o<this.colSpan;)this.fixedWidth+=e.colWidths[this.x+o],o++}const{wrapOnWordBoundary:n=!0}=e,{wrapOnWordBoundary:r=n}=this.options;return this.wrapLines(v.wordWrap(this.fixedWidth,this.content,r))}return this.wrapLines(this.content.split(`
|
|
67
|
-
`))}wrapLines(e){const t=v.colorizeLines(e);return this.href?t.map(D=>v.hyperlink(this.href,D)):t}init(e){let t=this.x,D=this.y;this.widths=e.colWidths.slice(t,t+this.colSpan),this.heights=e.rowHeights.slice(D,D+this.rowSpan),this.width=this.widths.reduce(Pe,-1),this.height=this.heights.reduce(Pe,-1),this.hAlign=this.options.hAlign||e.colAligns[t],this.vAlign=this.options.vAlign||e.rowAligns[D],this.drawRight=t+this.colSpan==e.colWidths.length}draw(e,t){if(e=="top")return this.drawTop(this.drawRight);if(e=="bottom")return this.drawBottom(this.drawRight);let D=v.truncate(this.content,10,this.truncate);e||OD(`${this.y}-${this.x}: ${this.rowSpan-e}x${this.colSpan} Cell ${D}`);let n=Math.max(this.height-this.lines.length,0),r;switch(this.vAlign){case"center":r=Math.ceil(n/2);break;case"bottom":r=n;break;default:r=0}if(e<r||e>=r+this.lines.length)return this.drawEmpty(this.drawRight,t);let o=this.lines.length>this.height&&e+1>=this.height;return this.drawLine(e-r,this.drawRight,o,t)}drawTop(e){let t=[];return this.cells?this.widths.forEach(function(D,n){t.push(this._topLeftChar(n)),t.push(v.repeat(this.chars[this.y==0?"top":"mid"],D))},this):(t.push(this._topLeftChar(0)),t.push(v.repeat(this.chars[this.y==0?"top":"mid"],this.width))),e&&t.push(this.chars[this.y==0?"topRight":"rightMid"]),this.wrapWithStyleColors("border",t.join(""))}_topLeftChar(e){let t=this.x+e,D;if(this.y==0)D=t==0?"topLeft":e==0?"topMid":"top";else if(t==0)D="leftMid";else if(D=e==0?"midMid":"bottomMid",this.cells&&(this.cells[this.y-1][t]instanceof eu.ColSpanCell&&(D=e==0?"topMid":"mid"),e==0)){let n=1;for(;this.cells[this.y][t-n]instanceof eu.ColSpanCell;)n++;this.cells[this.y][t-n]instanceof eu.RowSpanCell&&(D="leftMid")}return this.chars[D]}wrapWithStyleColors(e,t){if(this[e]&&this[e].length)try{let D=vD();for(let n=this[e].length-1;n>=0;n--)D=D[this[e][n]];return D(t)}catch(D){return t}else return t}drawLine(e,t,D,n){let r=this.chars[this.x==0?"left":"middle"];if(this.x&&n&&this.cells){let m=this.cells[this.y+n][this.x-1];for(;m instanceof wu;)m=this.cells[m.y][m.x-1];m instanceof Su||(r=this.chars.rightMid)}let o=v.repeat(" ",this.paddingLeft),l=t?this.chars.right:"",a=v.repeat(" ",this.paddingRight),s=this.lines[e],d=this.width-(this.paddingLeft+this.paddingRight);D&&(s+=this.truncate||"\u2026");let C=v.truncate(s,d,this.truncate);return C=v.pad(C,d," ",this.hAlign),C=o+C+a,this.stylizeLine(r,C,l)}stylizeLine(e,t,D){return e=this.wrapWithStyleColors("border",e),D=this.wrapWithStyleColors("border",D),this.y===0&&(t=this.wrapWithStyleColors("head",t)),e+t+D}drawBottom(e){let t=this.chars[this.x==0?"bottomLeft":"bottomMid"],D=v.repeat(this.chars.bottom,this.width),n=e?this.chars.bottomRight:"";return this.wrapWithStyleColors("border",t+D+n)}drawEmpty(e,t){let D=this.chars[this.x==0?"left":"middle"];if(this.x&&t&&this.cells){let o=this.cells[this.y+t][this.x-1];for(;o instanceof wu;)o=this.cells[o.y][o.x-1];o instanceof Su||(D=this.chars.rightMid)}let n=e?this.chars.right:"",r=v.repeat(" ",this.width);return this.stylizeLine(D,r,n)}}class wu{constructor(){}draw(e){return typeof e=="number"&&Ne(`${this.y}-${this.x}: 1x1 ColSpanCell`),""}init(){}mergeTableOptions(){}}class Su{constructor(e){this.originalCell=e}init(e){let t=this.y,D=this.originalCell.y;this.cellOffset=t-D,this.offset=TD(e.rowHeights,D,this.cellOffset)}draw(e){return e=="top"?this.originalCell.draw(this.offset,this.cellOffset):e=="bottom"?this.originalCell.draw("bottom"):(Ne(`${this.y}-${this.x}: 1x${this.colSpan} RowSpanCell for ${this.originalCell.content}`),this.originalCell.draw(this.offset+1+e))}mergeTableOptions(){}}function We(...u){return u.filter(e=>e!=null).shift()}function $u(u,e,t,D){let n=t.split("-");n.length>1?(n[1]=n[1].charAt(0).toUpperCase()+n[1].substr(1),n=n.join(""),D[n]=We(u[n],u[t],e[n],e[t])):D[t]=We(u[t],e[t])}function TD(u,e,t){let D=u[e];for(let n=1;n<t;n++)D+=1+u[e+n];return D}function Pe(u,e){return u+e+1}let RD=["top","top-mid","top-left","top-right","bottom","bottom-mid","bottom-left","bottom-right","left","left-mid","mid","mid-mid","right","right-mid","middle"];lu.exports=eu,lu.exports.ColSpanCell=wu,lu.exports.RowSpanCell=Su;const{warn:_D,debug:MD}=xu,vu=lu.exports,{ColSpanCell:kD,RowSpanCell:LD}=vu;(function(){function u(h,i){return h[i]>0?u(h,i+1):i}function e(h){let i={};h.forEach(function(c,p){let F=0;c.forEach(function(f){f.y=p,f.x=p?u(i,F):F;const E=f.rowSpan||1,g=f.colSpan||1;if(E>1)for(let A=0;A<g;A++)i[f.x+A]=E;F=f.x+g}),Object.keys(i).forEach(f=>{i[f]--,i[f]<1&&delete i[f]})})}function t(h){let i=0;return h.forEach(function(c){c.forEach(function(p){i=Math.max(i,p.x+(p.colSpan||1))})}),i}function D(h){return h.length}function n(h,i){let c=h.y,p=h.y-1+(h.rowSpan||1),F=i.y,f=i.y-1+(i.rowSpan||1),E=!(c>f||F>p),g=h.x,A=h.x-1+(h.colSpan||1),tu=i.x,Du=i.x-1+(i.colSpan||1),I=!(g>Du||tu>A);return E&&I}function r(h,i,c){let p=Math.min(h.length-1,c),F={x:i,y:c};for(let f=0;f<=p;f++){let E=h[f];for(let g=0;g<E.length;g++)if(n(F,E[g]))return!0}return!1}function o(h,i,c,p){for(let F=c;F<p;F++)if(r(h,F,i))return!1;return!0}function l(h){h.forEach(function(i,c){i.forEach(function(p){for(let F=1;F<p.rowSpan;F++){let f=new LD(p);f.x=p.x,f.y=p.y+F,f.colSpan=p.colSpan,s(f,h[c+F])}})})}function a(h){for(let i=h.length-1;i>=0;i--){let c=h[i];for(let p=0;p<c.length;p++){let F=c[p];for(let f=1;f<F.colSpan;f++){let E=new kD;E.x=F.x+f,E.y=F.y,c.splice(p+1,0,E)}}}}function s(h,i){let c=0;for(;c<i.length&&i[c].x<h.x;)c++;i.splice(c,0,h)}function d(h){let i=D(h),c=t(h);MD(`Max rows: ${i}; Max cols: ${c}`);for(let p=0;p<i;p++)for(let F=0;F<c;F++)if(!r(h,F,p)){let f={x:F,y:p,colSpan:1,rowSpan:1};for(F++;F<c&&!r(h,F,p);)f.colSpan++,F++;let E=p+1;for(;E<i&&o(h,E,f.x,f.x+f.colSpan);)f.rowSpan++,E++;let g=new vu(f);g.x=f.x,g.y=f.y,_D(`Missing cell at ${g.y}-${g.x}.`),s(g,h[p])}}function C(h){return h.map(function(i){if(!Array.isArray(i)){let c=Object.keys(i)[0];i=i[c],Array.isArray(i)?(i=i.slice(),i.unshift(c)):i=[c,i]}return i.map(function(c){return new vu(c)})})}function m(h){let i=C(h);return e(i),d(i),l(i),a(i),i}Fe.exports={makeTableLayout:m,layoutTable:e,addRowSpanCells:l,maxWidth:t,fillInTable:d,computeWidths:He("colSpan","desiredWidth","x",1),computeHeights:He("rowSpan","desiredHeight","y",1)}})();function He(u,e,t,D){return function(n,r){let o=[],l=[],a={};r.forEach(function(s){s.forEach(function(d){(d[u]||1)>1?l.push(d):o[d[t]]=Math.max(o[d[t]]||0,d[e]||0,D)})}),n.forEach(function(s,d){typeof s=="number"&&(o[d]=s)});for(let s=l.length-1;s>=0;s--){let d=l[s],C=d[u],m=d[t],h=o[m],i=typeof n[m]=="number"?0:1;if(typeof h=="number")for(let c=1;c<C;c++)h+=1+o[m+c],typeof n[m+c]!="number"&&i++;else h=e==="desiredWidth"?d.desiredWidth-1:1,(!a[m]||a[m]<h)&&(a[m]=h);if(d[e]>h){let c=0;for(;i>0&&d[e]>h;){if(typeof n[m+c]!="number"){let p=Math.round((d[e]-h)/i);h+=p,o[m+c]+=p,i--}c++}}}Object.assign(n,o,a);for(let s=0;s<n.length;s++)n[s]=Math.max(D,n[s]||0)}}const M=xu,ID=de,Ou=Fe.exports;class Ge extends Array{constructor(e){super();const t=ID.mergeOptions(e);if(Object.defineProperty(this,"options",{value:t,enumerable:t.debug}),t.debug){switch(typeof t.debug){case"boolean":M.setDebugLevel(M.WARN);break;case"number":M.setDebugLevel(t.debug);break;case"string":M.setDebugLevel(parseInt(t.debug,10));break;default:M.setDebugLevel(M.WARN),M.warn(`Debug option is expected to be boolean, number, or string. Received a ${typeof t.debug}`)}Object.defineProperty(this,"messages",{get(){return M.debugMessages()}})}}toString(){let e=this,t=this.options.head&&this.options.head.length;t?(e=[this.options.head],this.length&&e.push.apply(e,this)):this.options.style.head=[];let D=Ou.makeTableLayout(e);D.forEach(function(r){r.forEach(function(o){o.mergeTableOptions(this.options,D)},this)},this),Ou.computeWidths(this.options.colWidths,D),Ou.computeHeights(this.options.rowHeights,D),D.forEach(function(r){r.forEach(function(o){o.init(this.options)},this)},this);let n=[];for(let r=0;r<D.length;r++){let o=D[r],l=this.options.rowHeights[r];(r===0||!this.options.style.compact||r==1&&t)&&Tu(o,"top",n);for(let a=0;a<l;a++)Tu(o,a,n);r+1==D.length&&Tu(o,"bottom",n)}return n.join(`
|
|
68
|
-
`)}get width(){return this.toString().split(`
|
|
69
|
-
`)[0].length}}Ge.reset=()=>M.reset();function Tu(u,e,t){let D=[];u.forEach(function(r){D.push(r.draw(e))});let n=D.join("");n.length&&t.push(n)}var jD=Ge;(function(u){u.exports=jD})(ae);var ND=Vt(ae.exports);const Ru=(...u)=>{const e=new ND({chars:{top:"","top-mid":"","top-left":"","top-right":"",bottom:"","bottom-mid":"","bottom-left":"","bottom-right":"",left:"","left-mid":"",mid:"","mid-mid":"",right:"","right-mid":"",middle:" "},style:{"padding-left":0,"padding-right":0}});return e.push(...u),e},_u=(...u)=>Ru(...u).toString().split(`
|
|
70
|
-
`),WD=u=>Array.isArray(u)?`Array<${ie(u[0])}>`:ie(u),PD=u=>{const e=[];for(const t of u){if(t.type==="block"||!t.type){const D=" ",n=t.body.map(o=>D+o);n.unshift("");const r=n.join(`
|
|
71
|
-
`);e.push(Ru([$.exports.bold(`${t.title}:`)],[r]).toString())}else if(t.type==="inline"){const D=t.items.map(r=>[$.exports.bold(`${r.title}:`),r.body]),n=Ru(...D);e.push(n.toString())}e.push("")}return e.join(`
|
|
72
|
-
`)},Mu=$.exports.yellow("-"),HD="(No description)",GD="Name",YD="Version",zD="Subcommand",UD="Commands",VD="Flags",qD="Description",Ye="Usage",ZD="Examples",ze="Notes",Ue=u=>{process.stdout.write(u)},Ve=(u,e,t)=>{const D=[{title:GD,body:$.exports.red(e._name)},{title:YD,body:$.exports.yellow(e._version)}];t&&D.push({title:zD,body:$.exports.green(`${e._name} ${H(t.name)}`)}),u.push({type:"inline",items:D}),u.push({title:qD,body:[(t==null?void 0:t.description)||e._description]})},qe=(u,e)=>{const t=e.map(([D,n])=>[D,Mu,n]);u.push({title:ZD,body:_u(...t)})},cu=(u,e,t,D)=>{const{cli:n}=e,r=[];Ve(r,n),r.push({title:Ye,body:[$.exports.magenta(`$ ${n._name} ${Ju("command",e.hasRootOrAlias)} [flags]`)]});const o=[...e.hasRoot?[n._commands[w]]:[],...Object.values(n._commands)].map(l=>{const a=[typeof l.name=="symbol"?"":l.name,...zt(l.alias||[])].sort((s,d)=>s===w?-1:d===w?1:s.length-d.length).map(s=>s===""||typeof s=="symbol"?`${n._name}`:`${n._name} ${s}`).join(", ");return[$.exports.cyan(a),Mu,l.description]});return r.push({title:UD,body:_u(...o)}),t&&r.push({title:ze,body:t}),D&&qe(r,D),u(r)},Ze=(u,e,t)=>{var D;const{cli:n}=e,r=du(n._commands,t);if(!r)throw new ou(H(t));const o=[];Ve(o,n,{...r,name:H(t)});const l=((D=r.parameters)==null?void 0:D.join(" "))||void 0,a=` ${H(t)}`,s=l?` ${l}`:"",d=r.flags?" [flags]":"";return o.push({title:Ye,body:[$.exports.magenta(`$ ${n._name}${a}${s}${d}`)]}),r.flags&&o.push({title:VD,body:_u(...Object.entries(r.flags).map(([C,m])=>{const h=[re(C)];m.alias&&h.push(re(m.alias));const i=[$.exports.blue(h.join(", "))];if(i.push(Mu,m.description||HD),m.type){const c=WD(m.type);i.push($.exports.gray(`(${c})`))}return i}))}),r.notes&&o.push({title:ze,body:r.notes}),r.examples&&qe(o,r.examples),u(o)},JD=({command:u=!0,showHelpWhenNoCommand:e=!0,notes:t,examples:D,banner:n,renderer:r="cliffy"}={})=>P({setup:o=>{const l=r==="cliffy"?PD:()=>"",a=s=>{n&&Ue(`${n}
|
|
73
|
-
`),Ue(s)};return u&&(o=o.command("help","Show help",{parameters:["[command...]"],notes:["If no command is specified, show help for the CLI.","If a command is specified, show help for the command.","-h is an alias for --help."],examples:[[`$ ${o._name} help`,"Show help"],[`$ ${o._name} help <command>`,"Show help for a specific command"],[`$ ${o._name} <command> --help`,"Show help for a specific command"]]}).on("help",s=>{s.parameters.command.length?a(Ze(l,s,s.parameters.command)):a(cu(l,s,t,D))})),o.inspector((s,d)=>{const C=s.raw.mergedFlags.h||s.raw.mergedFlags.help;if(!s.hasRootOrAlias&&!s.raw._.length&&e&&!C){let m=`No command given.
|
|
74
|
-
|
|
75
|
-
`;m+=cu(l,s,t,D),m+=`
|
|
76
|
-
`,a(m),process.exit(1)}else C?s.raw._.length?s.called!==w&&s.name===w?a(cu(l,s,t,D)):a(Ze(l,s,s.raw._)):a(cu(l,s,t,D)):d()}),o}}),k=new Uint32Array(65536),KD=(u,e)=>{const t=u.length,D=e.length,n=1<<t-1;let r=-1,o=0,l=t,a=t;for(;a--;)k[u.charCodeAt(a)]|=1<<a;for(a=0;a<D;a++){let s=k[e.charCodeAt(a)];const d=s|o;s|=(s&r)+r^r,o|=~(s|r),r&=s,o&n&&l++,r&n&&l--,o=o<<1|1,r=r<<1|~(d|o),o&=d}for(a=t;a--;)k[u.charCodeAt(a)]=0;return l},QD=(u,e)=>{const t=e.length,D=u.length,n=[],r=[],o=Math.ceil(t/32),l=Math.ceil(D/32);for(let i=0;i<o;i++)r[i]=-1,n[i]=0;let a=0;for(;a<l-1;a++){let i=0,c=-1;const p=a*32,F=Math.min(32,D)+p;for(let f=p;f<F;f++)k[u.charCodeAt(f)]|=1<<f;for(let f=0;f<t;f++){const E=k[e.charCodeAt(f)],g=r[f/32|0]>>>f&1,A=n[f/32|0]>>>f&1,tu=E|i,Du=((E|A)&c)+c^c|E|A;let I=i|~(Du|c),nu=c&Du;I>>>31^g&&(r[f/32|0]^=1<<f),nu>>>31^A&&(n[f/32|0]^=1<<f),I=I<<1|g,nu=nu<<1|A,c=nu|~(tu|I),i=I&tu}for(let f=p;f<F;f++)k[u.charCodeAt(f)]=0}let s=0,d=-1;const C=a*32,m=Math.min(32,D-C)+C;for(let i=C;i<m;i++)k[u.charCodeAt(i)]|=1<<i;let h=D;for(let i=0;i<t;i++){const c=k[e.charCodeAt(i)],p=r[i/32|0]>>>i&1,F=n[i/32|0]>>>i&1,f=c|s,E=((c|F)&d)+d^d|c|F;let g=s|~(E|d),A=d&E;h+=g>>>D-1&1,h-=A>>>D-1&1,g>>>31^p&&(r[i/32|0]^=1<<i),A>>>31^F&&(n[i/32|0]^=1<<i),g=g<<1|p,A=A<<1|F,d=A|~(f|g),s=g&f}for(let i=C;i<m;i++)k[u.charCodeAt(i)]=0;return h},Je=(u,e)=>{if(u.length<e.length){const t=e;e=u,u=t}return e.length===0?u.length:u.length<=32?KD(u,e):QD(u,e)};var hu=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},XD=1/0,un="[object Symbol]",en=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,tn="\\u0300-\\u036f\\ufe20-\\ufe23",Dn="\\u20d0-\\u20f0",nn="["+tn+Dn+"]",rn=RegExp(nn,"g"),on={\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"},sn=typeof hu=="object"&&hu&&hu.Object===Object&&hu,an=typeof self=="object"&&self&&self.Object===Object&&self,ln=sn||an||Function("return this")();function cn(u){return function(e){return u==null?void 0:u[e]}}var hn=cn(on),pn=Object.prototype,mn=pn.toString,Ke=ln.Symbol,Qe=Ke?Ke.prototype:void 0,Xe=Qe?Qe.toString:void 0;function fn(u){if(typeof u=="string")return u;if(Fn(u))return Xe?Xe.call(u):"";var e=u+"";return e=="0"&&1/u==-XD?"-0":e}function dn(u){return!!u&&typeof u=="object"}function Fn(u){return typeof u=="symbol"||dn(u)&&mn.call(u)==un}function Cn(u){return u==null?"":fn(u)}function gn(u){return u=Cn(u),u&&u.replace(en,hn).replace(rn,"")}var En=gn;let O,T;(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"})(O||(O={})),function(u){u.EDIT_DISTANCE="edit-distance",u.SIMILARITY="similarity"}(T||(T={}));const ut=new Error("unknown returnType"),pu=new Error("unknown thresholdType"),et=(u,e)=>{let t=u;return e.trimSpaces&&(t=t.trim().replace(/\s+/g," ")),e.deburr&&(t=En(t)),e.caseSensitive||(t=t.toLowerCase()),t},tt=(u,e)=>{const{matchPath:t}=e,D=((n,r)=>{const o=r.length>0?r.reduce((l,a)=>l==null?void 0:l[a],n):n;return typeof o!="string"?"":o})(u,t);return et(D,e)};function Bn(u,e,t){const D=(m=>{const h={caseSensitive:!1,deburr:!0,matchPath:[],returnType:O.FIRST_CLOSEST_MATCH,thresholdType:T.SIMILARITY,trimSpaces:!0,...m};switch(h.thresholdType){case T.EDIT_DISTANCE:return{threshold:20,...h};case T.SIMILARITY:return{threshold:.4,...h};default:throw pu}})(t),{returnType:n,threshold:r,thresholdType:o}=D,l=et(u,D);let a,s;switch(o){case T.EDIT_DISTANCE:a=m=>m<=r,s=m=>Je(l,tt(m,D));break;case T.SIMILARITY:a=m=>m>=r,s=m=>((h,i)=>{if(!h||!i)return 0;if(h===i)return 1;const c=Je(h,i),p=Math.max(h.length,i.length);return(p-c)/p})(l,tt(m,D));break;default:throw pu}const d=[],C=e.length;switch(n){case O.ALL_CLOSEST_MATCHES:case O.FIRST_CLOSEST_MATCH:{const m=[];let h;switch(o){case T.EDIT_DISTANCE:h=1/0;for(let c=0;c<C;c+=1){const p=s(e[c]);h>p&&(h=p),m.push(p)}break;case T.SIMILARITY:h=0;for(let c=0;c<C;c+=1){const p=s(e[c]);h<p&&(h=p),m.push(p)}break;default:throw pu}const i=m.length;for(let c=0;c<i;c+=1){const p=m[c];a(p)&&p===h&&d.push(c)}break}case O.ALL_MATCHES:for(let m=0;m<C;m+=1)a(s(e[m]))&&d.push(m);break;case O.ALL_SORTED_MATCHES:{const m=[];for(let h=0;h<C;h+=1){const i=s(e[h]);a(i)&&m.push({score:i,index:h})}switch(o){case T.EDIT_DISTANCE:m.sort((h,i)=>h.score-i.score);break;case T.SIMILARITY:m.sort((h,i)=>i.score-h.score);break;default:throw pu}for(const h of m)d.push(h.index);break}case O.FIRST_MATCH:for(let m=0;m<C;m+=1)if(a(s(e[m]))){d.push(m);break}break;default:throw ut}return((m,h,i)=>{switch(i){case O.ALL_CLOSEST_MATCHES:case O.ALL_MATCHES:case O.ALL_SORTED_MATCHES:return h.map(c=>m[c]);case O.FIRST_CLOSEST_MATCH:case O.FIRST_MATCH:return h.length?m[h[0]]:null;default:throw ut}})(e,d,n)}var V={exports:{}};let xn=mu,bn=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||xn.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),x=(u,e,t=u)=>D=>{let n=""+D,r=n.indexOf(e,u.length);return~r?u+Dt(n,e,t,r)+e:u+n+e},Dt=(u,e,t,D)=>{let n=u.substring(0,D)+t,r=u.substring(D+e.length),o=r.indexOf(e);return~o?n+Dt(r,e,t,o):n+r},nt=(u=bn)=>({isColorSupported:u,reset:u?e=>`\x1B[0m${e}\x1B[0m`:String,bold:u?x("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:u?x("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:u?x("\x1B[3m","\x1B[23m"):String,underline:u?x("\x1B[4m","\x1B[24m"):String,inverse:u?x("\x1B[7m","\x1B[27m"):String,hidden:u?x("\x1B[8m","\x1B[28m"):String,strikethrough:u?x("\x1B[9m","\x1B[29m"):String,black:u?x("\x1B[30m","\x1B[39m"):String,red:u?x("\x1B[31m","\x1B[39m"):String,green:u?x("\x1B[32m","\x1B[39m"):String,yellow:u?x("\x1B[33m","\x1B[39m"):String,blue:u?x("\x1B[34m","\x1B[39m"):String,magenta:u?x("\x1B[35m","\x1B[39m"):String,cyan:u?x("\x1B[36m","\x1B[39m"):String,white:u?x("\x1B[37m","\x1B[39m"):String,gray:u?x("\x1B[90m","\x1B[39m"):String,bgBlack:u?x("\x1B[40m","\x1B[49m"):String,bgRed:u?x("\x1B[41m","\x1B[49m"):String,bgGreen:u?x("\x1B[42m","\x1B[49m"):String,bgYellow:u?x("\x1B[43m","\x1B[49m"):String,bgBlue:u?x("\x1B[44m","\x1B[49m"):String,bgMagenta:u?x("\x1B[45m","\x1B[49m"):String,bgCyan:u?x("\x1B[46m","\x1B[49m"):String,bgWhite:u?x("\x1B[47m","\x1B[49m"):String});V.exports=nt(),V.exports.createColors=nt;const An=u=>u.length<=1?u[0]:`${u.slice(0,-1).map(V.exports.bold).join(", ")} and ${V.exports.bold(u[u.length-1])}`,yn=()=>P({setup:u=>u.inspector({enforce:"pre",fn:(e,t)=>{const D=Object.keys(u._commands),n=!!D.length;try{t()}catch(r){if(!(r instanceof ou||r instanceof su))throw r;if(e.raw._.length===0||r instanceof su){console.error("No command given."),n&&console.error(`Possible commands: ${An(D)}.`);return}const o=r.commandName,l=Bn(o,D);console.error(`Command "${V.exports.strikethrough(o)}" not found.`),n&&l?console.error(`Did you mean "${V.exports.bold(l)}"?`):n||console.error("NOTE: You haven't register any command yet."),process.stderr.write(`
|
|
77
|
-
`),process.exit(2)}}})}),wn=u=>u.length<=1?u[0]:`${u.slice(0,-1).join(", ")} and ${u[u.length-1]}`,Sn=()=>P({setup:u=>u.inspector((e,t)=>{const D=Object.keys(e.unknownFlags);if(!e.resolved||D.length===0)t();else throw new Error(`Unexpected flag${D.length>1?"s":""}: ${wn(D)}`)})}),$n=u=>u.length===0?"":u.startsWith("v")?u:`v${u}`,vn=({alias:u=["V"],command:e=!0}={})=>P({setup:t=>{const D=$n(t._version);return e&&(t=t.command("version","Show version",{notes:['The version string begins with a "v".']}).on("version",()=>{process.stdout.write(D)})),t.inspector({enforce:"pre",fn:(n,r)=>{let o=!1;const l=["version",...u];for(const a of Object.keys(n.raw.mergedFlags))if(l.includes(a)){o=!0;break}o?process.stdout.write(D):r()}})}});var L={exports:{}};let On=mu,Tn=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||On.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),b=(u,e,t=u)=>D=>{let n=""+D,r=n.indexOf(e,u.length);return~r?u+rt(n,e,t,r)+e:u+n+e},rt=(u,e,t,D)=>{let n=u.substring(0,D)+t,r=u.substring(D+e.length),o=r.indexOf(e);return~o?n+rt(r,e,t,o):n+r},ot=(u=Tn)=>({isColorSupported:u,reset:u?e=>`\x1B[0m${e}\x1B[0m`:String,bold:u?b("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:u?b("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:u?b("\x1B[3m","\x1B[23m"):String,underline:u?b("\x1B[4m","\x1B[24m"):String,inverse:u?b("\x1B[7m","\x1B[27m"):String,hidden:u?b("\x1B[8m","\x1B[28m"):String,strikethrough:u?b("\x1B[9m","\x1B[29m"):String,black:u?b("\x1B[30m","\x1B[39m"):String,red:u?b("\x1B[31m","\x1B[39m"):String,green:u?b("\x1B[32m","\x1B[39m"):String,yellow:u?b("\x1B[33m","\x1B[39m"):String,blue:u?b("\x1B[34m","\x1B[39m"):String,magenta:u?b("\x1B[35m","\x1B[39m"):String,cyan:u?b("\x1B[36m","\x1B[39m"):String,white:u?b("\x1B[37m","\x1B[39m"):String,gray:u?b("\x1B[90m","\x1B[39m"):String,bgBlack:u?b("\x1B[40m","\x1B[49m"):String,bgRed:u?b("\x1B[41m","\x1B[49m"):String,bgGreen:u?b("\x1B[42m","\x1B[49m"):String,bgYellow:u?b("\x1B[43m","\x1B[49m"):String,bgBlue:u?b("\x1B[44m","\x1B[49m"):String,bgMagenta:u?b("\x1B[45m","\x1B[49m"):String,bgCyan:u?b("\x1B[46m","\x1B[49m"):String,bgWhite:u?b("\x1B[47m","\x1B[49m"):String});L.exports=ot(),L.exports.createColors=ot;function Rn(u){return u.split(`
|
|
78
|
-
`).splice(1).map(e=>e.trim().replace("file://",""))}function _n(u){return`
|
|
79
|
-
${Rn(u).map(e=>` ${e.replace(/^at ([\s\S]+) \((.+)\)/,(t,D,n)=>L.exports.gray(`at ${D} (${L.exports.cyan(n)})`))}`).join(`
|
|
80
|
-
`)}`}function Mn(u){return u.map(e=>typeof(e==null?void 0:e.stack)=="string"?`${e.message}
|
|
81
|
-
${_n(e.stack)}`:e)}function kn(u,e){const t=u.toUpperCase(),D=L.exports[e];return L.exports.bold(L.exports.inverse(D(` ${t} `)))}function uu(u,e,t){const D=L.exports[e],n=t!=null&&t.textColor?L.exports[t.textColor]:D,r=(t==null?void 0:t.target)||console.log;return(...o)=>{const l=Mn(o);r(`${kn(u,e)} ${n(l.join(" "))}
|
|
82
|
-
`)}}uu("log","gray"),uu("info","blue",{target:console.info}),uu("warn","yellow",{target:console.warn}),uu("success","green");const Ln=uu("error","red",{target:console.error}),In=()=>P({setup:u=>u.inspector({enforce:"pre",fn:(e,t)=>{try{t()}catch(D){Ln(D.message),process.exit(1)}}})});export{kt as Clerc,Iu as CommandExistsError,ju as CommandNameConflictError,Wu as DescriptionNotSetError,Hu as InvalidCommandNameError,Nu as NameNotSetError,su as NoCommandGivenError,ou as NoSuchCommandError,w as Root,Pu as VersionNotSetError,Yt as completionsPlugin,qu as compose,jt as defineCommand,Lt as defineHandler,It as defineInspector,P as definePlugin,H as formatCommandName,In as friendlyErrorPlugin,JD as helpPlugin,Zu as isInvalidName,yn as notFoundPlugin,Vu as resolveArgv,du as resolveCommand,Yu as resolveFlattenCommands,Uu as resolveParametersBeforeFlag,_t as resolveRootCommands,zu as resolveSubcommandsByParent,Sn as strictFlagsPlugin,vn as versionPlugin,Ju as withBrackets};
|