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