UNPKG

create-vfk

Version:

versiwfekit 前端工具集 cli 工具,一键配置

27 lines 97.4 kB
#!/usr/bin/env node "use strict";const require$$0=require("node:events"),require$$1=require("node:child_process"),w$2=require("node:path"),a=require("node:fs"),g=require("node:process");require("node:util");const f$1=require("node:readline"),node_tty=require("node:tty"),require$$0$3=require("child_process"),require$$0$2=require("path"),require$$0$1=require("fs");function _interopDefaultCompat(p){return p&&typeof p=="object"&&"default"in p?p.default:p}function _interopNamespaceCompat(p){if(p&&typeof p=="object"&&"default"in p)return p;const l=Object.create(null);if(p)for(const b in p)l[b]=p[b];return l.default=p,l}const require$$0__default=_interopDefaultCompat(require$$0),require$$1__default=_interopDefaultCompat(require$$1),w__default=_interopDefaultCompat(w$2),a__default=_interopDefaultCompat(a),g__default=_interopDefaultCompat(g),f__default=_interopDefaultCompat(f$1),f__namespace=_interopNamespaceCompat(f$1),require$$0__default$3=_interopDefaultCompat(require$$0$3),require$$0__default$2=_interopDefaultCompat(require$$0$2),require$$0__default$1=_interopDefaultCompat(require$$0$1);var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(p){return p&&p.__esModule&&Object.prototype.hasOwnProperty.call(p,"default")?p.default:p}var commander$1={},argument={},error={},hasRequiredError;function requireError(){if(hasRequiredError)return error;hasRequiredError=1;class p extends Error{constructor($,s,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=s,this.exitCode=$,this.nestedError=void 0}}class l extends p{constructor($){super(1,"commander.invalidArgument",$),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}return error.CommanderError=p,error.InvalidArgumentError=l,error}var hasRequiredArgument;function requireArgument(){if(hasRequiredArgument)return argument;hasRequiredArgument=1;const{InvalidArgumentError:p}=requireError();class l{constructor(s,n){switch(this.description=n||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,s[0]){case"<":this.required=!0,this._name=s.slice(1,-1);break;case"[":this.required=!1,this._name=s.slice(1,-1);break;default:this.required=!0,this._name=s;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(s,n){return n===this.defaultValue||!Array.isArray(n)?[s]:n.concat(s)}default(s,n){return this.defaultValue=s,this.defaultValueDescription=n,this}argParser(s){return this.parseArg=s,this}choices(s){return this.argChoices=s.slice(),this.parseArg=(n,t)=>{if(!this.argChoices.includes(n))throw new p(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(n,t):n},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function b($){const s=$.name()+($.variadic===!0?"...":"");return $.required?"<"+s+">":"["+s+"]"}return argument.Argument=l,argument.humanReadableArgName=b,argument}var command={},help={},hasRequiredHelp;function requireHelp(){if(hasRequiredHelp)return help;hasRequiredHelp=1;const{humanReadableArgName:p}=requireArgument();class l{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(s){this.helpWidth=this.helpWidth??s.helpWidth??80}visibleCommands(s){const n=s.commands.filter(E=>!E._hidden),t=s._getHelpCommand();return t&&!t._hidden&&n.push(t),this.sortSubcommands&&n.sort((E,H)=>E.name().localeCompare(H.name())),n}compareOptions(s,n){const t=E=>E.short?E.short.replace(/^-/,""):E.long.replace(/^--/,"");return t(s).localeCompare(t(n))}visibleOptions(s){const n=s.options.filter(E=>!E.hidden),t=s._getHelpOption();if(t&&!t.hidden){const E=t.short&&s._findOption(t.short),H=t.long&&s._findOption(t.long);!E&&!H?n.push(t):t.long&&!H?n.push(s.createOption(t.long,t.description)):t.short&&!E&&n.push(s.createOption(t.short,t.description))}return this.sortOptions&&n.sort(this.compareOptions),n}visibleGlobalOptions(s){if(!this.showGlobalOptions)return[];const n=[];for(let t=s.parent;t;t=t.parent){const E=t.options.filter(H=>!H.hidden);n.push(...E)}return this.sortOptions&&n.sort(this.compareOptions),n}visibleArguments(s){return s._argsDescription&&s.registeredArguments.forEach(n=>{n.description=n.description||s._argsDescription[n.name()]||""}),s.registeredArguments.find(n=>n.description)?s.registeredArguments:[]}subcommandTerm(s){const n=s.registeredArguments.map(t=>p(t)).join(" ");return s._name+(s._aliases[0]?"|"+s._aliases[0]:"")+(s.options.length?" [options]":"")+(n?" "+n:"")}optionTerm(s){return s.flags}argumentTerm(s){return s.name()}longestSubcommandTermLength(s,n){return n.visibleCommands(s).reduce((t,E)=>Math.max(t,this.displayWidth(n.styleSubcommandTerm(n.subcommandTerm(E)))),0)}longestOptionTermLength(s,n){return n.visibleOptions(s).reduce((t,E)=>Math.max(t,this.displayWidth(n.styleOptionTerm(n.optionTerm(E)))),0)}longestGlobalOptionTermLength(s,n){return n.visibleGlobalOptions(s).reduce((t,E)=>Math.max(t,this.displayWidth(n.styleOptionTerm(n.optionTerm(E)))),0)}longestArgumentTermLength(s,n){return n.visibleArguments(s).reduce((t,E)=>Math.max(t,this.displayWidth(n.styleArgumentTerm(n.argumentTerm(E)))),0)}commandUsage(s){let n=s._name;s._aliases[0]&&(n=n+"|"+s._aliases[0]);let t="";for(let E=s.parent;E;E=E.parent)t=E.name()+" "+t;return t+n+" "+s.usage()}commandDescription(s){return s.description()}subcommandDescription(s){return s.summary()||s.description()}optionDescription(s){const n=[];return s.argChoices&&n.push(`choices: ${s.argChoices.map(t=>JSON.stringify(t)).join(", ")}`),s.defaultValue!==void 0&&(s.required||s.optional||s.isBoolean()&&typeof s.defaultValue=="boolean")&&n.push(`default: ${s.defaultValueDescription||JSON.stringify(s.defaultValue)}`),s.presetArg!==void 0&&s.optional&&n.push(`preset: ${JSON.stringify(s.presetArg)}`),s.envVar!==void 0&&n.push(`env: ${s.envVar}`),n.length>0?`${s.description} (${n.join(", ")})`:s.description}argumentDescription(s){const n=[];if(s.argChoices&&n.push(`choices: ${s.argChoices.map(t=>JSON.stringify(t)).join(", ")}`),s.defaultValue!==void 0&&n.push(`default: ${s.defaultValueDescription||JSON.stringify(s.defaultValue)}`),n.length>0){const t=`(${n.join(", ")})`;return s.description?`${s.description} ${t}`:t}return s.description}formatHelp(s,n){const t=n.padWidth(s,n),E=n.helpWidth??80;function H(ae,pe){return n.formatItem(ae,t,pe,n)}let ee=[`${n.styleTitle("Usage:")} ${n.styleUsage(n.commandUsage(s))}`,""];const te=n.commandDescription(s);te.length>0&&(ee=ee.concat([n.boxWrap(n.styleCommandDescription(te),E),""]));const re=n.visibleArguments(s).map(ae=>H(n.styleArgumentTerm(n.argumentTerm(ae)),n.styleArgumentDescription(n.argumentDescription(ae))));re.length>0&&(ee=ee.concat([n.styleTitle("Arguments:"),...re,""]));const ne=n.visibleOptions(s).map(ae=>H(n.styleOptionTerm(n.optionTerm(ae)),n.styleOptionDescription(n.optionDescription(ae))));if(ne.length>0&&(ee=ee.concat([n.styleTitle("Options:"),...ne,""])),n.showGlobalOptions){const ae=n.visibleGlobalOptions(s).map(pe=>H(n.styleOptionTerm(n.optionTerm(pe)),n.styleOptionDescription(n.optionDescription(pe))));ae.length>0&&(ee=ee.concat([n.styleTitle("Global Options:"),...ae,""]))}const oe=n.visibleCommands(s).map(ae=>H(n.styleSubcommandTerm(n.subcommandTerm(ae)),n.styleSubcommandDescription(n.subcommandDescription(ae))));return oe.length>0&&(ee=ee.concat([n.styleTitle("Commands:"),...oe,""])),ee.join(` `)}displayWidth(s){return b(s).length}styleTitle(s){return s}styleUsage(s){return s.split(" ").map(n=>n==="[options]"?this.styleOptionText(n):n==="[command]"?this.styleSubcommandText(n):n[0]==="["||n[0]==="<"?this.styleArgumentText(n):this.styleCommandText(n)).join(" ")}styleCommandDescription(s){return this.styleDescriptionText(s)}styleOptionDescription(s){return this.styleDescriptionText(s)}styleSubcommandDescription(s){return this.styleDescriptionText(s)}styleArgumentDescription(s){return this.styleDescriptionText(s)}styleDescriptionText(s){return s}styleOptionTerm(s){return this.styleOptionText(s)}styleSubcommandTerm(s){return s.split(" ").map(n=>n==="[options]"?this.styleOptionText(n):n[0]==="["||n[0]==="<"?this.styleArgumentText(n):this.styleSubcommandText(n)).join(" ")}styleArgumentTerm(s){return this.styleArgumentText(s)}styleOptionText(s){return s}styleArgumentText(s){return s}styleSubcommandText(s){return s}styleCommandText(s){return s}padWidth(s,n){return Math.max(n.longestOptionTermLength(s,n),n.longestGlobalOptionTermLength(s,n),n.longestSubcommandTermLength(s,n),n.longestArgumentTermLength(s,n))}preformatted(s){return/\n[^\S\r\n]/.test(s)}formatItem(s,n,t,E){const ee=" ".repeat(2);if(!t)return ee+s;const te=s.padEnd(n+s.length-E.displayWidth(s)),re=2,oe=(this.helpWidth??80)-n-re-2;let ae;return oe<this.minWidthToWrap||E.preformatted(t)?ae=t:ae=E.boxWrap(t,oe).replace(/\n/g,` `+" ".repeat(n+re)),ee+te+" ".repeat(re)+ae.replace(/\n/g,` ${ee}`)}boxWrap(s,n){if(n<this.minWidthToWrap)return s;const t=s.split(/\r\n|\n/),E=/[\s]*[^\s]+/g,H=[];return t.forEach(ee=>{const te=ee.match(E);if(te===null){H.push("");return}let re=[te.shift()],ne=this.displayWidth(re[0]);te.forEach(oe=>{const ae=this.displayWidth(oe);if(ne+ae<=n){re.push(oe),ne+=ae;return}H.push(re.join(""));const pe=oe.trimStart();re=[pe],ne=this.displayWidth(pe)}),H.push(re.join(""))}),H.join(` `)}}function b($){const s=/\x1b\[\d*(;\d*)*m/g;return $.replace(s,"")}return help.Help=l,help.stripColor=b,help}var option={},hasRequiredOption;function requireOption(){if(hasRequiredOption)return option;hasRequiredOption=1;const{InvalidArgumentError:p}=requireError();class l{constructor(t,E){this.flags=t,this.description=E||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;const H=s(t);this.short=H.shortFlag,this.long=H.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(t,E){return this.defaultValue=t,this.defaultValueDescription=E,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){let E=t;return typeof t=="string"&&(E={[t]:!0}),this.implied=Object.assign(this.implied||{},E),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_concatValue(t,E){return E===this.defaultValue||!Array.isArray(E)?[t]:E.concat(t)}choices(t){return this.argChoices=t.slice(),this.parseArg=(E,H)=>{if(!this.argChoices.includes(E))throw new p(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(E,H):E},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?$(this.name().replace(/^no-/,"")):$(this.name())}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class b{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach(E=>{E.negate?this.negativeOptions.set(E.attributeName(),E):this.positiveOptions.set(E.attributeName(),E)}),this.negativeOptions.forEach((E,H)=>{this.positiveOptions.has(H)&&this.dualOptions.add(H)})}valueFromOption(t,E){const H=E.attributeName();if(!this.dualOptions.has(H))return!0;const ee=this.negativeOptions.get(H).presetArg,te=ee!==void 0?ee:!1;return E.negate===(te===t)}}function $(n){return n.split("-").reduce((t,E)=>t+E[0].toUpperCase()+E.slice(1))}function s(n){let t,E;const H=/^-[^-]$/,ee=/^--[^-]/,te=n.split(/[ |,]+/).concat("guard");if(H.test(te[0])&&(t=te.shift()),ee.test(te[0])&&(E=te.shift()),!t&&H.test(te[0])&&(t=te.shift()),!t&&ee.test(te[0])&&(t=E,E=te.shift()),te[0].startsWith("-")){const re=te[0],ne=`option creation failed due to '${re}' in option flags '${n}'`;throw/^-[^-][^-]/.test(re)?new Error(`${ne} - a short flag is a single dash and a single character - either use a single dash and a single character (for a short flag) - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):H.test(re)?new Error(`${ne} - too many short flags`):ee.test(re)?new Error(`${ne} - too many long flags`):new Error(`${ne} - unrecognised flag format`)}if(t===void 0&&E===void 0)throw new Error(`option creation failed due to no flags found in '${n}'.`);return{shortFlag:t,longFlag:E}}return option.Option=l,option.DualOptions=b,option}var suggestSimilar={},hasRequiredSuggestSimilar;function requireSuggestSimilar(){if(hasRequiredSuggestSimilar)return suggestSimilar;hasRequiredSuggestSimilar=1;const p=3;function l($,s){if(Math.abs($.length-s.length)>p)return Math.max($.length,s.length);const n=[];for(let t=0;t<=$.length;t++)n[t]=[t];for(let t=0;t<=s.length;t++)n[0][t]=t;for(let t=1;t<=s.length;t++)for(let E=1;E<=$.length;E++){let H=1;$[E-1]===s[t-1]?H=0:H=1,n[E][t]=Math.min(n[E-1][t]+1,n[E][t-1]+1,n[E-1][t-1]+H),E>1&&t>1&&$[E-1]===s[t-2]&&$[E-2]===s[t-1]&&(n[E][t]=Math.min(n[E][t],n[E-2][t-2]+1))}return n[$.length][s.length]}function b($,s){if(!s||s.length===0)return"";s=Array.from(new Set(s));const n=$.startsWith("--");n&&($=$.slice(2),s=s.map(ee=>ee.slice(2)));let t=[],E=p;const H=.4;return s.forEach(ee=>{if(ee.length<=1)return;const te=l($,ee),re=Math.max($.length,ee.length);(re-te)/re>H&&(te<E?(E=te,t=[ee]):te===E&&t.push(ee))}),t.sort((ee,te)=>ee.localeCompare(te)),n&&(t=t.map(ee=>`--${ee}`)),t.length>1?` (Did you mean one of ${t.join(", ")}?)`:t.length===1?` (Did you mean ${t[0]}?)`:""}return suggestSimilar.suggestSimilar=b,suggestSimilar}var hasRequiredCommand;function requireCommand(){if(hasRequiredCommand)return command;hasRequiredCommand=1;const p=require$$0__default.EventEmitter,l=require$$1__default,b=w__default,$=a__default,s=g__default,{Argument:n,humanReadableArgName:t}=requireArgument(),{CommanderError:E}=requireError(),{Help:H,stripColor:ee}=requireHelp(),{Option:te,DualOptions:re}=requireOption(),{suggestSimilar:ne}=requireSuggestSimilar();class oe extends p{constructor(i){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=i||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:F=>s.stdout.write(F),writeErr:F=>s.stderr.write(F),outputError:(F,j)=>j(F),getOutHelpWidth:()=>s.stdout.isTTY?s.stdout.columns:void 0,getErrHelpWidth:()=>s.stderr.isTTY?s.stderr.columns:void 0,getOutHasColors:()=>pe()??(s.stdout.isTTY&&s.stdout.hasColors?.()),getErrHasColors:()=>pe()??(s.stderr.isTTY&&s.stderr.hasColors?.()),stripColor:F=>ee(F)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(i){return this._outputConfiguration=i._outputConfiguration,this._helpOption=i._helpOption,this._helpCommand=i._helpCommand,this._helpConfiguration=i._helpConfiguration,this._exitCallback=i._exitCallback,this._storeOptionsAsProperties=i._storeOptionsAsProperties,this._combineFlagAndOptionalValue=i._combineFlagAndOptionalValue,this._allowExcessArguments=i._allowExcessArguments,this._enablePositionalOptions=i._enablePositionalOptions,this._showHelpAfterError=i._showHelpAfterError,this._showSuggestionAfterError=i._showSuggestionAfterError,this}_getCommandAndAncestors(){const i=[];for(let F=this;F;F=F.parent)i.push(F);return i}command(i,F,j){let M=F,Z=j;typeof M=="object"&&M!==null&&(Z=M,M=null),Z=Z||{};const[,ie,De]=i.match(/([^ ]+) *(.*)/),se=this.createCommand(ie);return M&&(se.description(M),se._executableHandler=!0),Z.isDefault&&(this._defaultCommandName=se._name),se._hidden=!!(Z.noHelp||Z.hidden),se._executableFile=Z.executableFile||null,De&&se.arguments(De),this._registerCommand(se),se.parent=this,se.copyInheritedSettings(this),M?this:se}createCommand(i){return new oe(i)}createHelp(){return Object.assign(new H,this.configureHelp())}configureHelp(i){return i===void 0?this._helpConfiguration:(this._helpConfiguration=i,this)}configureOutput(i){return i===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,i),this)}showHelpAfterError(i=!0){return typeof i!="string"&&(i=!!i),this._showHelpAfterError=i,this}showSuggestionAfterError(i=!0){return this._showSuggestionAfterError=!!i,this}addCommand(i,F){if(!i._name)throw new Error(`Command passed to .addCommand() must have a name - specify the name in Command constructor or using .name()`);return F=F||{},F.isDefault&&(this._defaultCommandName=i._name),(F.noHelp||F.hidden)&&(i._hidden=!0),this._registerCommand(i),i.parent=this,i._checkForBrokenPassThrough(),this}createArgument(i,F){return new n(i,F)}argument(i,F,j,M){const Z=this.createArgument(i,F);return typeof j=="function"?Z.default(M).argParser(j):Z.default(j),this.addArgument(Z),this}arguments(i){return i.trim().split(/ +/).forEach(F=>{this.argument(F)}),this}addArgument(i){const F=this.registeredArguments.slice(-1)[0];if(F&&F.variadic)throw new Error(`only the last argument can be variadic '${F.name()}'`);if(i.required&&i.defaultValue!==void 0&&i.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${i.name()}'`);return this.registeredArguments.push(i),this}helpCommand(i,F){if(typeof i=="boolean")return this._addImplicitHelpCommand=i,this;i=i??"help [command]";const[,j,M]=i.match(/([^ ]+) *(.*)/),Z=F??"display help for command",ie=this.createCommand(j);return ie.helpOption(!1),M&&ie.arguments(M),Z&&ie.description(Z),this._addImplicitHelpCommand=!0,this._helpCommand=ie,this}addHelpCommand(i,F){return typeof i!="object"?(this.helpCommand(i,F),this):(this._addImplicitHelpCommand=!0,this._helpCommand=i,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(i,F){const j=["preSubcommand","preAction","postAction"];if(!j.includes(i))throw new Error(`Unexpected value for event passed to hook : '${i}'. Expecting one of '${j.join("', '")}'`);return this._lifeCycleHooks[i]?this._lifeCycleHooks[i].push(F):this._lifeCycleHooks[i]=[F],this}exitOverride(i){return i?this._exitCallback=i:this._exitCallback=F=>{if(F.code!=="commander.executeSubCommandAsync")throw F},this}_exit(i,F,j){this._exitCallback&&this._exitCallback(new E(i,F,j)),s.exit(i)}action(i){const F=j=>{const M=this.registeredArguments.length,Z=j.slice(0,M);return this._storeOptionsAsProperties?Z[M]=this:Z[M]=this.opts(),Z.push(this),i.apply(this,Z)};return this._actionHandler=F,this}createOption(i,F){return new te(i,F)}_callParseArg(i,F,j,M){try{return i.parseArg(F,j)}catch(Z){if(Z.code==="commander.invalidArgument"){const ie=`${M} ${Z.message}`;this.error(ie,{exitCode:Z.exitCode,code:Z.code})}throw Z}}_registerOption(i){const F=i.short&&this._findOption(i.short)||i.long&&this._findOption(i.long);if(F){const j=i.long&&this._findOption(i.long)?i.long:i.short;throw new Error(`Cannot add option '${i.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${j}' - already used by option '${F.flags}'`)}this.options.push(i)}_registerCommand(i){const F=M=>[M.name()].concat(M.aliases()),j=F(i).find(M=>this._findCommand(M));if(j){const M=F(this._findCommand(j)).join("|"),Z=F(i).join("|");throw new Error(`cannot add command '${Z}' as already have command '${M}'`)}this.commands.push(i)}addOption(i){this._registerOption(i);const F=i.name(),j=i.attributeName();if(i.negate){const Z=i.long.replace(/^--no-/,"--");this._findOption(Z)||this.setOptionValueWithSource(j,i.defaultValue===void 0?!0:i.defaultValue,"default")}else i.defaultValue!==void 0&&this.setOptionValueWithSource(j,i.defaultValue,"default");const M=(Z,ie,De)=>{Z==null&&i.presetArg!==void 0&&(Z=i.presetArg);const se=this.getOptionValue(j);Z!==null&&i.parseArg?Z=this._callParseArg(i,Z,se,ie):Z!==null&&i.variadic&&(Z=i._concatValue(Z,se)),Z==null&&(i.negate?Z=!1:i.isBoolean()||i.optional?Z=!0:Z=""),this.setOptionValueWithSource(j,Z,De)};return this.on("option:"+F,Z=>{const ie=`error: option '${i.flags}' argument '${Z}' is invalid.`;M(Z,ie,"cli")}),i.envVar&&this.on("optionEnv:"+F,Z=>{const ie=`error: option '${i.flags}' value '${Z}' from env '${i.envVar}' is invalid.`;M(Z,ie,"env")}),this}_optionEx(i,F,j,M,Z){if(typeof F=="object"&&F instanceof te)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");const ie=this.createOption(F,j);if(ie.makeOptionMandatory(!!i.mandatory),typeof M=="function")ie.default(Z).argParser(M);else if(M instanceof RegExp){const De=M;M=(se,me)=>{const he=De.exec(se);return he?he[0]:me},ie.default(Z).argParser(M)}else ie.default(M);return this.addOption(ie)}option(i,F,j,M){return this._optionEx({},i,F,j,M)}requiredOption(i,F,j,M){return this._optionEx({mandatory:!0},i,F,j,M)}combineFlagAndOptionalValue(i=!0){return this._combineFlagAndOptionalValue=!!i,this}allowUnknownOption(i=!0){return this._allowUnknownOption=!!i,this}allowExcessArguments(i=!0){return this._allowExcessArguments=!!i,this}enablePositionalOptions(i=!0){return this._enablePositionalOptions=!!i,this}passThroughOptions(i=!0){return this._passThroughOptions=!!i,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(i=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!i,this}getOptionValue(i){return this._storeOptionsAsProperties?this[i]:this._optionValues[i]}setOptionValue(i,F){return this.setOptionValueWithSource(i,F,void 0)}setOptionValueWithSource(i,F,j){return this._storeOptionsAsProperties?this[i]=F:this._optionValues[i]=F,this._optionValueSources[i]=j,this}getOptionValueSource(i){return this._optionValueSources[i]}getOptionValueSourceWithGlobals(i){let F;return this._getCommandAndAncestors().forEach(j=>{j.getOptionValueSource(i)!==void 0&&(F=j.getOptionValueSource(i))}),F}_prepareUserArgs(i,F){if(i!==void 0&&!Array.isArray(i))throw new Error("first parameter to parse must be array or undefined");if(F=F||{},i===void 0&&F.from===void 0){s.versions?.electron&&(F.from="electron");const M=s.execArgv??[];(M.includes("-e")||M.includes("--eval")||M.includes("-p")||M.includes("--print"))&&(F.from="eval")}i===void 0&&(i=s.argv),this.rawArgs=i.slice();let j;switch(F.from){case void 0:case"node":this._scriptPath=i[1],j=i.slice(2);break;case"electron":s.defaultApp?(this._scriptPath=i[1],j=i.slice(2)):j=i.slice(1);break;case"user":j=i.slice(0);break;case"eval":j=i.slice(1);break;default:throw new Error(`unexpected parse option { from: '${F.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",j}parse(i,F){this._prepareForParse();const j=this._prepareUserArgs(i,F);return this._parseCommand([],j),this}async parseAsync(i,F){this._prepareForParse();const j=this._prepareUserArgs(i,F);return await this._parseCommand([],j),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true. - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(i,F,j){if($.existsSync(i))return;const M=F?`searched for local subcommand relative to directory '${F}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",Z=`'${i}' does not exist - if '${j}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead - if the default executable name is not suitable, use the executableFile option to supply a custom name or path - ${M}`;throw new Error(Z)}_executeSubCommand(i,F){F=F.slice();let j=!1;const M=[".js",".ts",".tsx",".mjs",".cjs"];function Z(he,fe){const de=b.resolve(he,fe);if($.existsSync(de))return de;if(M.includes(b.extname(fe)))return;const Ee=M.find(ge=>$.existsSync(`${de}${ge}`));if(Ee)return`${de}${Ee}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let ie=i._executableFile||`${this._name}-${i._name}`,De=this._executableDir||"";if(this._scriptPath){let he;try{he=$.realpathSync(this._scriptPath)}catch{he=this._scriptPath}De=b.resolve(b.dirname(he),De)}if(De){let he=Z(De,ie);if(!he&&!i._executableFile&&this._scriptPath){const fe=b.basename(this._scriptPath,b.extname(this._scriptPath));fe!==this._name&&(he=Z(De,`${fe}-${i._name}`))}ie=he||ie}j=M.includes(b.extname(ie));let se;s.platform!=="win32"?j?(F.unshift(ie),F=ae(s.execArgv).concat(F),se=l.spawn(s.argv[0],F,{stdio:"inherit"})):se=l.spawn(ie,F,{stdio:"inherit"}):(this._checkForMissingExecutable(ie,De,i._name),F.unshift(ie),F=ae(s.execArgv).concat(F),se=l.spawn(s.execPath,F,{stdio:"inherit"})),se.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(fe=>{s.on(fe,()=>{se.killed===!1&&se.exitCode===null&&se.kill(fe)})});const me=this._exitCallback;se.on("close",he=>{he=he??1,me?me(new E(he,"commander.executeSubCommandAsync","(close)")):s.exit(he)}),se.on("error",he=>{if(he.code==="ENOENT")this._checkForMissingExecutable(ie,De,i._name);else if(he.code==="EACCES")throw new Error(`'${ie}' not executable`);if(!me)s.exit(1);else{const fe=new E(1,"commander.executeSubCommandAsync","(error)");fe.nestedError=he,me(fe)}}),this.runningCommand=se}_dispatchSubcommand(i,F,j){const M=this._findCommand(i);M||this.help({error:!0}),M._prepareForParse();let Z;return Z=this._chainOrCallSubCommandHook(Z,M,"preSubcommand"),Z=this._chainOrCall(Z,()=>{if(M._executableHandler)this._executeSubCommand(M,F.concat(j));else return M._parseCommand(F,j)}),Z}_dispatchHelpCommand(i){i||this.help();const F=this._findCommand(i);return F&&!F._executableHandler&&F.help(),this._dispatchSubcommand(i,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((i,F)=>{i.required&&this.args[F]==null&&this.missingArgument(i.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){const i=(j,M,Z)=>{let ie=M;if(M!==null&&j.parseArg){const De=`error: command-argument value '${M}' is invalid for argument '${j.name()}'.`;ie=this._callParseArg(j,M,Z,De)}return ie};this._checkNumberOfArguments();const F=[];this.registeredArguments.forEach((j,M)=>{let Z=j.defaultValue;j.variadic?M<this.args.length?(Z=this.args.slice(M),j.parseArg&&(Z=Z.reduce((ie,De)=>i(j,De,ie),j.defaultValue))):Z===void 0&&(Z=[]):M<this.args.length&&(Z=this.args[M],j.parseArg&&(Z=i(j,Z,j.defaultValue))),F[M]=Z}),this.processedArgs=F}_chainOrCall(i,F){return i&&i.then&&typeof i.then=="function"?i.then(()=>F()):F()}_chainOrCallHooks(i,F){let j=i;const M=[];return this._getCommandAndAncestors().reverse().filter(Z=>Z._lifeCycleHooks[F]!==void 0).forEach(Z=>{Z._lifeCycleHooks[F].forEach(ie=>{M.push({hookedCommand:Z,callback:ie})})}),F==="postAction"&&M.reverse(),M.forEach(Z=>{j=this._chainOrCall(j,()=>Z.callback(Z.hookedCommand,this))}),j}_chainOrCallSubCommandHook(i,F,j){let M=i;return this._lifeCycleHooks[j]!==void 0&&this._lifeCycleHooks[j].forEach(Z=>{M=this._chainOrCall(M,()=>Z(this,F))}),M}_parseCommand(i,F){const j=this.parseOptions(F);if(this._parseOptionsEnv(),this._parseOptionsImplied(),i=i.concat(j.operands),F=j.unknown,this.args=i.concat(F),i&&this._findCommand(i[0]))return this._dispatchSubcommand(i[0],i.slice(1),F);if(this._getHelpCommand()&&i[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(i[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(F),this._dispatchSubcommand(this._defaultCommandName,i,F);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(j.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();const M=()=>{j.unknown.length>0&&this.unknownOption(j.unknown[0])},Z=`command:${this.name()}`;if(this._actionHandler){M(),this._processArguments();let ie;return ie=this._chainOrCallHooks(ie,"preAction"),ie=this._chainOrCall(ie,()=>this._actionHandler(this.processedArgs)),this.parent&&(ie=this._chainOrCall(ie,()=>{this.parent.emit(Z,i,F)})),ie=this._chainOrCallHooks(ie,"postAction"),ie}if(this.parent&&this.parent.listenerCount(Z))M(),this._processArguments(),this.parent.emit(Z,i,F);else if(i.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",i,F);this.listenerCount("command:*")?this.emit("command:*",i,F):this.commands.length?this.unknownCommand():(M(),this._processArguments())}else this.commands.length?(M(),this.help({error:!0})):(M(),this._processArguments())}_findCommand(i){if(i)return this.commands.find(F=>F._name===i||F._aliases.includes(i))}_findOption(i){return this.options.find(F=>F.is(i))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(i=>{i.options.forEach(F=>{F.mandatory&&i.getOptionValue(F.attributeName())===void 0&&i.missingMandatoryOptionValue(F)})})}_checkForConflictingLocalOptions(){const i=this.options.filter(j=>{const M=j.attributeName();return this.getOptionValue(M)===void 0?!1:this.getOptionValueSource(M)!=="default"});i.filter(j=>j.conflictsWith.length>0).forEach(j=>{const M=i.find(Z=>j.conflictsWith.includes(Z.attributeName()));M&&this._conflictingOption(j,M)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(i=>{i._checkForConflictingLocalOptions()})}parseOptions(i){const F=[],j=[];let M=F;const Z=i.slice();function ie(se){return se.length>1&&se[0]==="-"}let De=null;for(;Z.length;){const se=Z.shift();if(se==="--"){M===j&&M.push(se),M.push(...Z);break}if(De&&!ie(se)){this.emit(`option:${De.name()}`,se);continue}if(De=null,ie(se)){const me=this._findOption(se);if(me){if(me.required){const he=Z.shift();he===void 0&&this.optionMissingArgument(me),this.emit(`option:${me.name()}`,he)}else if(me.optional){let he=null;Z.length>0&&!ie(Z[0])&&(he=Z.shift()),this.emit(`option:${me.name()}`,he)}else this.emit(`option:${me.name()}`);De=me.variadic?me:null;continue}}if(se.length>2&&se[0]==="-"&&se[1]!=="-"){const me=this._findOption(`-${se[1]}`);if(me){me.required||me.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${me.name()}`,se.slice(2)):(this.emit(`option:${me.name()}`),Z.unshift(`-${se.slice(2)}`));continue}}if(/^--[^=]+=/.test(se)){const me=se.indexOf("="),he=this._findOption(se.slice(0,me));if(he&&(he.required||he.optional)){this.emit(`option:${he.name()}`,se.slice(me+1));continue}}if(ie(se)&&(M=j),(this._enablePositionalOptions||this._passThroughOptions)&&F.length===0&&j.length===0){if(this._findCommand(se)){F.push(se),Z.length>0&&j.push(...Z);break}else if(this._getHelpCommand()&&se===this._getHelpCommand().name()){F.push(se),Z.length>0&&F.push(...Z);break}else if(this._defaultCommandName){j.push(se),Z.length>0&&j.push(...Z);break}}if(this._passThroughOptions){M.push(se),Z.length>0&&M.push(...Z);break}M.push(se)}return{operands:F,unknown:j}}opts(){if(this._storeOptionsAsProperties){const i={},F=this.options.length;for(let j=0;j<F;j++){const M=this.options[j].attributeName();i[M]=M===this._versionOptionName?this._version:this[M]}return i}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((i,F)=>Object.assign(i,F.opts()),{})}error(i,F){this._outputConfiguration.outputError(`${i} `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError} `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(` `),this.outputHelp({error:!0}));const j=F||{},M=j.exitCode||1,Z=j.code||"commander.error";this._exit(M,Z,i)}_parseOptionsEnv(){this.options.forEach(i=>{if(i.envVar&&i.envVar in s.env){const F=i.attributeName();(this.getOptionValue(F)===void 0||["default","config","env"].includes(this.getOptionValueSource(F)))&&(i.required||i.optional?this.emit(`optionEnv:${i.name()}`,s.env[i.envVar]):this.emit(`optionEnv:${i.name()}`))}})}_parseOptionsImplied(){const i=new re(this.options),F=j=>this.getOptionValue(j)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(j));this.options.filter(j=>j.implied!==void 0&&F(j.attributeName())&&i.valueFromOption(this.getOptionValue(j.attributeName()),j)).forEach(j=>{Object.keys(j.implied).filter(M=>!F(M)).forEach(M=>{this.setOptionValueWithSource(M,j.implied[M],"implied")})})}missingArgument(i){const F=`error: missing required argument '${i}'`;this.error(F,{code:"commander.missingArgument"})}optionMissingArgument(i){const F=`error: option '${i.flags}' argument missing`;this.error(F,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(i){const F=`error: required option '${i.flags}' not specified`;this.error(F,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(i,F){const j=ie=>{const De=ie.attributeName(),se=this.getOptionValue(De),me=this.options.find(fe=>fe.negate&&De===fe.attributeName()),he=this.options.find(fe=>!fe.negate&&De===fe.attributeName());return me&&(me.presetArg===void 0&&se===!1||me.presetArg!==void 0&&se===me.presetArg)?me:he||ie},M=ie=>{const De=j(ie),se=De.attributeName();return this.getOptionValueSource(se)==="env"?`environment variable '${De.envVar}'`:`option '${De.flags}'`},Z=`error: ${M(i)} cannot be used with ${M(F)}`;this.error(Z,{code:"commander.conflictingOption"})}unknownOption(i){if(this._allowUnknownOption)return;let F="";if(i.startsWith("--")&&this._showSuggestionAfterError){let M=[],Z=this;do{const ie=Z.createHelp().visibleOptions(Z).filter(De=>De.long).map(De=>De.long);M=M.concat(ie),Z=Z.parent}while(Z&&!Z._enablePositionalOptions);F=ne(i,M)}const j=`error: unknown option '${i}'${F}`;this.error(j,{code:"commander.unknownOption"})}_excessArguments(i){if(this._allowExcessArguments)return;const F=this.registeredArguments.length,j=F===1?"":"s",Z=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${F} argument${j} but got ${i.length}.`;this.error(Z,{code:"commander.excessArguments"})}unknownCommand(){const i=this.args[0];let F="";if(this._showSuggestionAfterError){const M=[];this.createHelp().visibleCommands(this).forEach(Z=>{M.push(Z.name()),Z.alias()&&M.push(Z.alias())}),F=ne(i,M)}const j=`error: unknown command '${i}'${F}`;this.error(j,{code:"commander.unknownCommand"})}version(i,F,j){if(i===void 0)return this._version;this._version=i,F=F||"-V, --version",j=j||"output the version number";const M=this.createOption(F,j);return this._versionOptionName=M.attributeName(),this._registerOption(M),this.on("option:"+M.name(),()=>{this._outputConfiguration.writeOut(`${i} `),this._exit(0,"commander.version",i)}),this}description(i,F){return i===void 0&&F===void 0?this._description:(this._description=i,F&&(this._argsDescription=F),this)}summary(i){return i===void 0?this._summary:(this._summary=i,this)}alias(i){if(i===void 0)return this._aliases[0];let F=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(F=this.commands[this.commands.length-1]),i===F._name)throw new Error("Command alias can't be the same as its name");const j=this.parent?._findCommand(i);if(j){const M=[j.name()].concat(j.aliases()).join("|");throw new Error(`cannot add alias '${i}' to command '${this.name()}' as already have command '${M}'`)}return F._aliases.push(i),this}aliases(i){return i===void 0?this._aliases:(i.forEach(F=>this.alias(F)),this)}usage(i){if(i===void 0){if(this._usage)return this._usage;const F=this.registeredArguments.map(j=>t(j));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?F:[]).join(" ")}return this._usage=i,this}name(i){return i===void 0?this._name:(this._name=i,this)}nameFromFilename(i){return this._name=b.basename(i,b.extname(i)),this}executableDir(i){return i===void 0?this._executableDir:(this._executableDir=i,this)}helpInformation(i){const F=this.createHelp(),j=this._getOutputContext(i);F.prepareContext({error:j.error,helpWidth:j.helpWidth,outputHasColors:j.hasColors});const M=F.formatHelp(this,F);return j.hasColors?M:this._outputConfiguration.stripColor(M)}_getOutputContext(i){i=i||{};const F=!!i.error;let j,M,Z;return F?(j=De=>this._outputConfiguration.writeErr(De),M=this._outputConfiguration.getErrHasColors(),Z=this._outputConfiguration.getErrHelpWidth()):(j=De=>this._outputConfiguration.writeOut(De),M=this._outputConfiguration.getOutHasColors(),Z=this._outputConfiguration.getOutHelpWidth()),{error:F,write:De=>(M||(De=this._outputConfiguration.stripColor(De)),j(De)),hasColors:M,helpWidth:Z}}outputHelp(i){let F;typeof i=="function"&&(F=i,i=void 0);const j=this._getOutputContext(i),M={error:j.error,write:j.write,command:this};this._getCommandAndAncestors().reverse().forEach(ie=>ie.emit("beforeAllHelp",M)),this.emit("beforeHelp",M);let Z=this.helpInformation({error:j.error});if(F&&(Z=F(Z),typeof Z!="string"&&!Buffer.isBuffer(Z)))throw new Error("outputHelp callback must return a string or a Buffer");j.write(Z),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",M),this._getCommandAndAncestors().forEach(ie=>ie.emit("afterAllHelp",M))}helpOption(i,F){return typeof i=="boolean"?(i?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(i=i??"-h, --help",F=F??"display help for command",this._helpOption=this.createOption(i,F),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(i){return this._helpOption=i,this}help(i){this.outputHelp(i);let F=Number(s.exitCode??0);F===0&&i&&typeof i!="function"&&i.error&&(F=1),this._exit(F,"commander.help","(outputHelp)")}addHelpText(i,F){const j=["beforeAll","before","after","afterAll"];if(!j.includes(i))throw new Error(`Unexpected value for position to addHelpText. Expecting one of '${j.join("', '")}'`);const M=`${i}Help`;return this.on(M,Z=>{let ie;typeof F=="function"?ie=F({error:Z.error,command:Z.command}):ie=F,ie&&Z.write(`${ie} `)}),this}_outputHelpIfRequested(i){const F=this._getHelpOption();F&&i.find(M=>F.is(M))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}}function ae(Fe){return Fe.map(i=>{if(!i.startsWith("--inspect"))return i;let F,j="127.0.0.1",M="9229",Z;return(Z=i.match(/^(--inspect(-brk)?)$/))!==null?F=Z[1]:(Z=i.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(F=Z[1],/^\d+$/.test(Z[3])?M=Z[3]:j=Z[3]):(Z=i.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(F=Z[1],j=Z[3],M=Z[4]),F&&M!=="0"?`${F}=${j}:${parseInt(M)+1}`:i})}function pe(){if(s.env.NO_COLOR||s.env.FORCE_COLOR==="0"||s.env.FORCE_COLOR==="false")return!1;if(s.env.FORCE_COLOR||s.env.CLICOLOR_FORCE!==void 0)return!0}return command.Command=oe,command.useColor=pe,command}var hasRequiredCommander;function requireCommander(){if(hasRequiredCommander)return commander$1;hasRequiredCommander=1;const{Argument:p}=requireArgument(),{Command:l}=requireCommand(),{CommanderError:b,InvalidArgumentError:$}=requireError(),{Help:s}=requireHelp(),{Option:n}=requireOption();return commander$1.program=new l,commander$1.createCommand=t=>new l(t),commander$1.createOption=(t,E)=>new n(t,E),commander$1.createArgument=(t,E)=>new p(t,E),commander$1.Command=l,commander$1.Option=n,commander$1.Argument=p,commander$1.Help=s,commander$1.CommanderError=b,commander$1.InvalidArgumentError=$,commander$1.InvalidOptionArgumentError=$,commander$1}var commanderExports=requireCommander();const commander=getDefaultExportFromCjs(commanderExports),{program,createCommand,createArgument,createOption,CommanderError,InvalidArgumentError,InvalidOptionArgumentError,Command,Argument,Option,Help}=commander;var src,hasRequiredSrc;function requireSrc(){if(hasRequiredSrc)return src;hasRequiredSrc=1;const p="\x1B",l=`${p}[`,b="\x07",$={to(t,E){return E?`${l}${E+1};${t+1}H`:`${l}${t+1}G`},move(t,E){let H="";return t<0?H+=`${l}${-t}D`:t>0&&(H+=`${l}${t}C`),E<0?H+=`${l}${-E}A`:E>0&&(H+=`${l}${E}B`),H},up:(t=1)=>`${l}${t}A`,down:(t=1)=>`${l}${t}B`,forward:(t=1)=>`${l}${t}C`,backward:(t=1)=>`${l}${t}D`,nextLine:(t=1)=>`${l}E`.repeat(t),prevLine:(t=1)=>`${l}F`.repeat(t),left:`${l}G`,hide:`${l}?25l`,show:`${l}?25h`,save:`${p}7`,restore:`${p}8`},s={up:(t=1)=>`${l}S`.repeat(t),down:(t=1)=>`${l}T`.repeat(t)},n={screen:`${l}2J`,up:(t=1)=>`${l}1J`.repeat(t),down:(t=1)=>`${l}J`.repeat(t),line:`${l}2K`,lineEnd:`${l}K`,lineStart:`${l}1K`,lines(t){let E="";for(let H=0;H<t;H++)E+=this.line+(H<t-1?$.up():"");return t&&(E+=$.left),E}};return src={cursor:$,scroll:s,erase:n,beep:b},src}var srcExports=requireSrc(),picocolors={exports:{}},hasRequiredPicocolors;function requirePicocolors(){if(hasRequiredPicocolors)return picocolors.exports;hasRequiredPicocolors=1;let p=process||{},l=p.argv||[],b=p.env||{},$=!(b.NO_COLOR||l.includes("--no-color"))&&(!!b.FORCE_COLOR||l.includes("--color")||p.platform==="win32"||(p.stdout||{}).isTTY&&b.TERM!=="dumb"||!!b.CI),s=(E,H,ee=E)=>te=>{let re=""+te,ne=re.indexOf(H,E.length);return~ne?E+n(re,H,ee,ne)+H:E+re+H},n=(E,H,ee,te)=>{let re="",ne=0;do re+=E.substring(ne,te)+ee,ne=te+H.length,te=E.indexOf(H,ne);while(~te);return re+E.substring(ne)},t=(E=$)=>{let H=E?s:()=>String;return{isColorSupported:E,reset:H("\x1B[0m","\x1B[0m"),bold:H("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:H("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:H("\x1B[3m","\x1B[23m"),underline:H("\x1B[4m","\x1B[24m"),inverse:H("\x1B[7m","\x1B[27m"),hidden:H("\x1B[8m","\x1B[28m"),strikethrough:H("\x1B[9m","\x1B[29m"),black:H("\x1B[30m","\x1B[39m"),red:H("\x1B[31m","\x1B[39m"),green:H("\x1B[32m","\x1B[39m"),yellow:H("\x1B[33m","\x1B[39m"),blue:H("\x1B[34m","\x1B[39m"),magenta:H("\x1B[35m","\x1B[39m"),cyan:H("\x1B[36m","\x1B[39m"),white:H("\x1B[37m","\x1B[39m"),gray:H("\x1B[90m","\x1B[39m"),bgBlack:H("\x1B[40m","\x1B[49m"),bgRed:H("\x1B[41m","\x1B[49m"),bgGreen:H("\x1B[42m","\x1B[49m"),bgYellow:H("\x1B[43m","\x1B[49m"),bgBlue:H("\x1B[44m","\x1B[49m"),bgMagenta:H("\x1B[45m","\x1B[49m"),bgCyan:H("\x1B[46m","\x1B[49m"),bgWhite:H("\x1B[47m","\x1B[49m"),blackBright:H("\x1B[90m","\x1B[39m"),redBright:H("\x1B[91m","\x1B[39m"),greenBright:H("\x1B[92m","\x1B[39m"),yellowBright:H("\x1B[93m","\x1B[39m"),blueBright:H("\x1B[94m","\x1B[39m"),magentaBright:H("\x1B[95m","\x1B[39m"),cyanBright:H("\x1B[96m","\x1B[39m"),whiteBright:H("\x1B[97m","\x1B[39m"),bgBlackBright:H("\x1B[100m","\x1B[49m"),bgRedBright:H("\x1B[101m","\x1B[49m"),bgGreenBright:H("\x1B[102m","\x1B[49m"),bgYellowBright:H("\x1B[103m","\x1B[49m"),bgBlueBright:H("\x1B[104m","\x1B[49m"),bgMagentaBright:H("\x1B[105m","\x1B[49m"),bgCyanBright:H("\x1B[106m","\x1B[49m"),bgWhiteBright:H("\x1B[107m","\x1B[49m")}};return picocolors.exports=t(),picocolors.exports.createColors=t,picocolors.exports}var picocolorsExports=requirePicocolors();const e=getDefaultExportFromCjs(picocolorsExports);function J({onlyFirst:p=!1}={}){const l=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(l,p?void 0:"g")}const Q=J();function T(p){if(typeof p!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof p}\``);return p.replace(Q,"")}function O(p){return p&&p.__esModule&&Object.prototype.hasOwnProperty.call(p,"default")?p.default:p}var P$1={exports:{}};(function(p){var l={};p.exports=l,l.eastAsianWidth=function($){var s=$.charCodeAt(0),n=$.length==2?$.charCodeAt(1):0,t=s;return 55296<=s&&s<=56319&&56320<=n&&n<=57343&&(s&=1023,n&=1023,t=s<<10|n,t+=65536),t==12288||65281<=t&&t<=65376||65504<=t&&t<=65510?"F":t==8361||65377<=t&&t<=65470||65474<=t&&t<=65479||65482<=t&&t<=65487||65490<=t&&t<=65495||65498<=t&&t<=65500||65512<=t&&t<=65518?"H":4352<=t&&t<=4447||4515<=t&&t<=4519||4602<=t&&t<=4607||9001<=t&&t<=9002||11904<=t&&t<=11929||11931<=t&&t<=12019||12032<=t&&t<=12245||12272<=t&&t<=12283||12289<=t&&t<=12350||12353<=t&&t<=12438||12441<=t&&t<=12543||12549<=t&&t<=12589||12593<=t&&t<=12686||12688<=t&&t<=12730||12736<=t&&t<=12771||12784<=t&&t<=12830||12832<=t&&t<=12871||12880<=t&&t<=13054||13056<=t&&t<=19903||19968<=t&&t<=42124||42128<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||55216<=t&&t<=55238||55243<=t&&t<=55291||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65106||65108<=t&&t<=65126||65128<=t&&t<=65131||110592<=t&&t<=110593||127488<=t&&t<=127490||127504<=t&&t<=127546||127552<=t&&t<=127560||127568<=t&&t<=127569||131072<=t&&t<=194367||177984<=t&&t<=196605||196608<=t&&t<=262141?"W":32<=t&&t<=126||162<=t&&t<=163||165<=t&&t<=166||t==172||t==175||10214<=t&&t<=10221||10629<=t&&t<=10630?"Na":t==161||t==164||167<=t&&t<=168||t==170||173<=t&&t<=174||176<=t&&t<=180||182<=t&&t<=186||188<=t&&t<=191||t==198||t==208||215<=t&&t<=216||222<=t&&t<=225||t==230||232<=t&&t<=234||236<=t&&t<=237||t==240||242<=t&&t<=243||247<=t&&t<=250||t==252||t==254||t==257||t==273||t==275||t==283||294<=t&&t<=295||t==299||305<=t&&t<=307||t==312||319<=t&&t<=322||t==324||328<=t&&t<=331||t==333||338<=t&&t<=339||358<=t&&t<=359||t==363||t==462||t==464||t==466||t==468||t==470||t==472||t==474||t==476||t==593||t==609||t==708||t==711||713<=t&&t<=715||t==717||t==720||728<=t&&t<=731||t==733||t==735||768<=t&&t<=879||913<=t&&t<=929||931<=t&&t<=937||945<=t&&t<=961||963<=t&&t<=969||t==1025||1040<=t&&t<=1103||t==1105||t==8208||8211<=t&&t<=8214||8216<=t&&t<=8217||8220<=t&&t<=8221||8224<=t&&t<=8226||8228<=t&&t<=8231||t==8240||8242<=t&&t<=8243||t==8245||t==8251||t==8254||t==8308||t==8319||8321<=t&&t<=8324||t==8364||t==8451||t==8453||t==8457||t==8467||t==8470||8481<=t&&t<=8482||t==8486||t==8491||8531<=t&&t<=8532||8539<=t&&t<=8542||8544<=t&&t<=8555||8560<=t&&t<=8569||t==8585||8592<=t&&t<=8601||8632<=t&&t<=8633||t==8658||t==8660||t==8679||t==8704||8706<=t&&t<=8707||8711<=t&&t<=8712||t==8715||t==8719||t==8721||t==8725||t==8730||8733<=t&&t<=8736||t==8739||t==8741||8743<=t&&t<=8748||t==8750||8756<=t&&t<=8759||8764<=t&&t<=8765||t==8776||t==8780||t==8786||8800<=t&&t<=8801||8804<=t&&t<=8807||8810<=t&&t<=8811||8814<=t&&t<=8815||8834<=t&&t<=8835||8838<=t&&t<=8839||t==8853||t==8857||t==8869||t==8895||t==8978||9312<=t&&t<=9449||9451<=t&&t<=9547||9552<=t&&t<=9587||9600<=t&&t<=9615||9618<=t&&t<=9621||9632<=t&&t<=9633||9635<=t&&t<=9641||9650<=t&&t<=9651||9654<=t&&t<=9655||9660<=t&&t<=9661||9664<=t&&t<=9665||9670<=t&&t<=9672||t==9675||9678<=t&&t<=9681||9698<=t&&t<=9701||t==9711||9733<=t&&t<=9734||t==9737||9742<=t&&t<=9743||9748<=t&&t<=9749||t==9756||t==9758||t==9792||t==9794||9824<=t&&t<=9825||9827<=t&&t<=9829||9831<=t&&t<=9834||9836<=t&&t<=9837||t==9839||9886<=t&&t<=9887||9918<=t&&t<=9919||9924<=t&&t<=9933||9935<=t&&t<=9953||t==9955||9960<=t&&t<=9983||t==10045||t==10071||10102<=t&&t<=10111||11093<=t&&t<=11097||12872<=t&&t<=12879||57344<=t&&t<=63743||65024<=t&&t<=65039||t==65533||127232<=t&&t<=127242||127248<=t&&t<=127277||127280<=t&&t<=127337||127344<=t&&t<=127386||917760<=t&&t<=917999||983040<=t&&t<=1048573||1048576<=t&&t<=1114109?"A":"N"},l.characterLength=function($){var s=this.eastAsianWidth($);return s=="F"||s=="W"||s=="A"?2:1};function b($){return $.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}l.length=function($){for(var s=b($),n=0,t=0;t<s.length;t++)n=n+this.characterLength(s[t]);return n},l.slice=function($,s,n){textLen=l.length($),s=s||0,n=n||1,s<0&&(s=textLen+s),n<0&&(n=textLen+n);for(var t="",E=0,H=b($),ee=0;ee<H.length;ee++){var te=H[ee],re=l.length(te);if(E>=s-(re==2?1:0))if(E+re<=n)t+=te;else break;E+=re}return t}})(P$1);var X=P$1.exports;const DD=O(X);var uD=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\