@pplancq/create-react-app 2.0.3 → 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## @pplancq/create-react-app [2.0.4](https://github.com/pplancq/dev-tools/compare/@pplancq/create-react-app@2.0.3...@pplancq/create-react-app@2.0.4) (2026-02-24)
2
+
3
+ ### Bug Fixes
4
+
5
+ * **deps:** update dependency @rslib/core to ^0.19.6 ([#1568](https://github.com/pplancq/dev-tools/issues/1568)) ([8e54a7c](https://github.com/pplancq/dev-tools/commit/8e54a7c484c25b352835813d6ffaf4df609842ec))
6
+
1
7
  ## @pplancq/create-react-app [2.0.3](https://github.com/pplancq/dev-tools/compare/@pplancq/create-react-app@2.0.2...@pplancq/create-react-app@2.0.3) (2025-12-02)
2
8
 
3
9
  ### Bug Fixes
package/dist/main.js CHANGED
@@ -1,82 +1,91 @@
1
1
  #!/usr/bin/env node
2
- 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
3
- - 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}'.
4
- 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}'
5
- - 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.
6
- - 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
7
- - if '${u}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
2
+ import*as t from"node:child_process";import*as e from"node:events";import*as i from"node:fs";import*as s from"node:path";import*as r from"node:process";import*as n from"node:readline";import*as o from"node:tty";import*as a from"node:util";import{__webpack_require__ as l}from"./rslib-runtime.js";l.add({"../../node_modules/picocolors/picocolors.js"(t){let e=process||{},i=e.argv||[],s=e.env||{},r=!(s.NO_COLOR||i.includes("--no-color"))&&(!!s.FORCE_COLOR||i.includes("--color")||"win32"===e.platform||(e.stdout||{}).isTTY&&"dumb"!==s.TERM||!!s.CI),n=(t,e,i=t)=>s=>{let r=""+s,n=r.indexOf(e,t.length);return~n?t+o(r,e,i,n)+e:t+r+e},o=(t,e,i,s)=>{let r="",n=0;do r+=t.substring(n,s)+i,n=s+e.length,s=t.indexOf(e,n);while(~s);return r+t.substring(n)},a=(t=r)=>{let e=t?n:()=>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=a(),t.exports.createColors=a},"../../node_modules/sisteransi/src/index.js"(t){let e={to:(t,e)=>e?`[${e+1};${t+1}H`:`[${t+1}G`,move(t,e){let i="";return t<0?i+=`[${-t}D`:t>0&&(i+=`[${t}C`),e<0?i+=`[${-e}A`:e>0&&(i+=`[${e}B`),i},up:(t=1)=>`[${t}A`,down:(t=1)=>`[${t}B`,forward:(t=1)=>`[${t}C`,backward:(t=1)=>`[${t}D`,nextLine:(t=1)=>"\x1b[E".repeat(t),prevLine:(t=1)=>"\x1b[F".repeat(t),left:"\x1b[G",hide:"\x1b[?25l",show:"\x1b[?25h",save:"\x1b7",restore:"\x1b8"},i={screen:"\x1b[2J",up:(t=1)=>"\x1b[1J".repeat(t),down:(t=1)=>"\x1b[J".repeat(t),line:"\x1b[2K",lineEnd:"\x1b[K",lineStart:"\x1b[1K",lines(t){let i="";for(let s=0;s<t;s++)i+=this.line+(s<t-1?e.up():"");return t&&(i+=e.left),i}};t.exports={cursor:e,scroll:{up:(t=1)=>"\x1b[S".repeat(t),down:(t=1)=>"\x1b[T".repeat(t)},erase:i,beep:"\x07"}},"./src/Error/InvalidProjectNameError.ts"(t,e,i){i.d(e,{a:()=>s});class s extends Error{constructor(t){super(t),this.name="InvalidProjectNameError"}}},"./src/Error/InvalidTemplateNameError.ts"(t,e,i){i.d(e,{f:()=>s});class s extends Error{constructor(t){super(t),this.name="InvalidTemplateNameError"}}},"./src/Error/RunCommandError.ts"(t,e,i){i.d(e,{T:()=>s});class s extends Error{constructor(t){super(t),this.name="RunCommandError"}}},"./src/helpers/checkCancel.ts"(t,e,i){i.d(e,{v:()=>n});var s=i("./src/helpers/endProcess.ts"),r=i("../../node_modules/@clack/prompts/dist/index.mjs");let n=t=>((0,r.FZ)(t)&&((0,r.ZT)("Operation cancelled."),(0,s.J)()),t)},"./src/helpers/endProcess.ts"(t,e,i){i.d(e,{J:()=>s});let s=(t=!1)=>{process.exit(+!!t)}},"./src/helpers/runCommand.ts"(t,e,i){i.d(e,{d:()=>a});var s=i("./src/Error/RunCommandError.ts"),r=i("node:child_process"),n=i("node:process");let o=(0,i("node:util").promisify)(r.execFile),a=async(t,e=[],i)=>{try{let s={shell:"win32"===n.platform,...i};await o(t,e,s)}catch{let i=[t,...e].join(" ");throw new s.T(`Failed to execute ${i}`)}}},"./src/index.ts"(t,e,i){i.a(t,async function(t,s){try{i.r(e);var r=i("./src/helpers/endProcess.ts"),n=i("./src/main.ts"),o=i("../../node_modules/@clack/prompts/dist/index.mjs");try{await (0,n.i)(),(0,o.Md)("Happy hacking!"),(0,r.J)()}catch(t){o.Rm.error(t.message),(0,o.Md)("Please check and try again."),(0,r.J)(!0)}s()}catch(t){s(t)}},1)},"./src/main.ts"(t,e,i){i.d(e,{i:()=>g});var s=i("./src/steps/createRepository.ts"),r=i("./src/steps/getInteractiveArgs.ts"),n=i("./src/steps/getPromptArgs.ts"),o=i("./src/steps/gitCommit.ts"),a=i("./src/steps/initializeGit.ts"),l=i("./src/steps/installPackage.ts"),h=i("./src/steps/installTemplate.ts"),u=i("./src/steps/postInstallTemplate.ts"),p=i("./src/steps/validatePromptArgs.ts"),m=i("../../node_modules/@clack/prompts/dist/index.mjs"),d=i("../../node_modules/picocolors/picocolors.js"),c=i.n(d);let g=async()=>{let t=(0,n._)();(0,m.Lv)(`Create ${c().blue("React")} App`),(0,p.W)(t);let{projectName:e,skipDepInstall:i,skipGitInit:d,template:g}=await (0,r.A)(t),{repoDir:f}=await (0,s.v)(e);await (0,h._)(f,g),await (0,u.s)(e,f),await (0,a.D)(f,d),await (0,l.E)(f,i),await (0,o.o)(f,d);let _=String.raw`Success \o/`;m.Rm.success(`${c().yellow(_)} Created ${c().green(e)} at ${c().green(f)}`),(0,m.N4)(`We suggest that you begin by typing:
3
+ ${c().cyan("cd")} ${e}${i?`
4
+ ${c().cyan("npm install")}`:""}
5
+ ${c().cyan("npm start")}`,"What next?")}},"./src/steps/createRepository.ts"(t,e,i){i.d(e,{v:()=>u});var s=i("./src/helpers/runCommand.ts"),r=i("../../node_modules/@clack/prompts/dist/index.mjs"),n=i("node:fs"),o=i("node:path"),a=i("node:process"),l=i("../../node_modules/picocolors/picocolors.js"),h=i.n(l);let u=async t=>{let e=(0,r.u1)(),i=(0,o.resolve)(a.default.cwd(),t);return e.start(`Creating a React App in ${h().green(i)}.`),(0,n.mkdirSync)(i),await (0,s.d)("npm",["init","-y"],{cwd:i}),e.stop(`React App created in ${h().green(i)}.`),{repoDir:i}}},"./src/steps/getInteractiveArgs.ts"(t,e,i){i.d(e,{A:()=>a});var s=i("./src/helpers/checkCancel.ts"),r=i("./src/validates/validateProjectName.ts"),n=i("./src/validates/validateTemplateName.ts"),o=i("../../node_modules/@clack/prompts/dist/index.mjs");let a=async({projectName:t,skipDepInstall:e,skipGitInit:i,template:a})=>({projectName:t||(0,s.v)(await (0,o.Qq)({message:"What is the name of your project?",placeholder:"my-project",validate:r.$})).toString(),skipDepInstall:e||!!(0,s.v)(await (0,o.lJ)({message:"Do you want to skip installing dependencies (npm install)?",initialValue:!1})),skipGitInit:i||!!(0,s.v)(await (0,o.lJ)({message:"Do you want to skip initializing a git repository?",initialValue:!1})),template:a||(0,s.v)((await (0,o.Os)({useCustomTemplate:async()=>!!await (0,o.lJ)({message:"Do you want to use a custom template?",initialValue:!1}),template:async({results:t})=>t.useCustomTemplate?(await (0,o.Qq)({message:"Enter the custom template name (e.g., @pplancq/react-template):",placeholder:"@pplancq/react-template",validate:n.m})).toString():"@pplancq/react-template"})).template)})},"./src/steps/getPromptArgs.ts"(t,e,i){i.d(e,{_:()=>l});var s=i("../../node_modules/commander/esm.mjs"),r=i("node:process"),n=i("../../node_modules/picocolors/picocolors.js"),o=i.n(n),a=i("./package.json");let l=()=>{let t={};return new s.uB(a.UU).argument("[project-name]","The name of the project to create.").option("-t, --template <template>","Specify a template for the project.").option("--skip-dep-install","Skip installing dependencies (npm install).").option("--skip-git-init","Skip initializing a git repository.").version(a.rE,"-v, --version").name(o().green("create-react-app")).usage(`[options] ${o().yellow("[project-name]")}`).addHelpText("after",`
6
+ Examples:
7
+ $ npm create @pplancq/react-app my-project
8
+ $ npx @pplancq/create-react-app my-project`).action((e,i)=>{e&&(t.projectName=e),i?.skipDepInstall&&(t.skipDepInstall=i.skipDepInstall),i?.skipGitInit&&(t.skipGitInit=i.skipGitInit),i?.template&&(t.template=i.template)}).parse(r.default.argv),t}},"./src/steps/gitCommit.ts"(t,e,i){i.d(e,{o:()=>n});var s=i("./src/helpers/runCommand.ts"),r=i("../../node_modules/@clack/prompts/dist/index.mjs");let n=async(t,e)=>{if(e)return;let i=(0,r.u1)();i.start("Creating git commit."),await (0,s.d)("git",["add","."],{cwd:t}),await (0,s.d)("git",["commit","--no-verify","--message",'"Initial commit"'],{cwd:t}),i.stop("Git commit created.")}},"./src/steps/initializeGit.ts"(t,e,i){i.d(e,{D:()=>n});var s=i("./src/helpers/runCommand.ts"),r=i("../../node_modules/@clack/prompts/dist/index.mjs");let n=async(t,e)=>{if(e)return;let i=(0,r.u1)();i.start("Initializing git repository."),await (0,s.d)("git",["init","--initial-branch=main"],{cwd:t}),i.stop("Git repository initialized.")}},"./src/steps/installPackage.ts"(t,e,i){i.d(e,{E:()=>n});var s=i("./src/helpers/runCommand.ts"),r=i("../../node_modules/@clack/prompts/dist/index.mjs");let n=async(t,e)=>{if(e)return;let i=(0,r.u1)();i.start("Installing packages. This might take a couple of minutes."),await (0,s.d)("npm",["install"],{cwd:t}),i.stop("Packages installed.")}},"./src/steps/installTemplate.ts"(t,e,i){i.d(e,{_:()=>h});var s=i("./src/helpers/runCommand.ts"),r=i("../../node_modules/@clack/prompts/dist/index.mjs"),n=i("node:fs"),o=i("node:path"),a=i("../../node_modules/picocolors/picocolors.js"),l=i.n(a);let h=async(t,e)=>{let i=(0,r.u1)(),a=(0,o.resolve)(t,`node_modules/${e}`);i.start(`Installing react template from ${l().green(e)}. This might take a couple of minutes.`),await (0,s.d)("npm",["install",e,"--install-strategy=nested"],{cwd:t}),(0,n.cpSync)(a,t,{recursive:!0,dereference:!0}),(0,n.rmSync)(`${t}/package-lock.json`),(0,n.rmSync)(`${t}/node_modules`,{recursive:!0}),i.stop("React template installed.")}},"./src/steps/postInstallTemplate.ts"(t,e,i){i.d(e,{s:()=>l});var s=i("./src/Error/RunCommandError.ts"),r=i("./src/helpers/runCommand.ts"),n=i("../../node_modules/@clack/prompts/dist/index.mjs"),o=i("node:fs"),a=i("node:path");let l=async(t,e)=>{let i=(0,n.u1)(),l=!1,h=JSON.parse((0,o.readFileSync)((0,a.resolve)(e,"package.json"),{encoding:"utf-8"}));if(h?.bin?.["template-install"]===void 0)return void n.Rm.warn("No post install template script found.");i.start("Running post install template script...");try{await (0,r.d)("npx",["template-install",t],{cwd:e})}catch(t){if(l=!0,!(t instanceof s.T))throw t;n.Rm.error("Failed to run template-install command")}finally{i.stop(l?"Failed to run post install template script.":"Post install template script finished.")}}},"./src/steps/validatePromptArgs.ts"(t,e,i){i.d(e,{W:()=>a});var s=i("./src/Error/InvalidProjectNameError.ts"),r=i("./src/Error/InvalidTemplateNameError.ts"),n=i("./src/validates/validateProjectName.ts"),o=i("./src/validates/validateTemplateName.ts");let a=({projectName:t,template:e})=>{if(t){let e=(0,n.$)(t);if(""!==e)throw new s.a(e)}if(e){let t=(0,o.m)(e);if(""!==t)throw new r.f(t)}}},"./src/validates/validateProjectName.ts"(t,e,i){i.d(e,{$:()=>l});var s=i("node:fs"),r=i("node:path"),n=i("node:process"),o=i("../../node_modules/picocolors/picocolors.js"),a=i.n(o);let l=t=>"string"==typeof t&&/^(@[a-z0-9-~][a-z0-9-._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/.test(t)?(0,s.existsSync)((0,r.resolve)(n.default.cwd(),t))?`The directory ${a().green(t)} already exists.
9
+ Either try using a new directory name, or remove the files listed above.`:"":`The project name '${t}' is not valid.
10
+
11
+ A valid npm project name must start with a lowercase letter, a number, a hyphen, or a tilde, and can include dots, hyphens, tildes, or underscores.
12
+
13
+ If the project name starts with '@', it must be followed by a valid scope name and a '/'.`},"./src/validates/validateTemplateName.ts"(t,e,i){i.d(e,{m:()=>s});let s=t=>"string"==typeof t&&/^(@[a-z0-9-~][a-z0-9-._~]*\/)?[a-z0-9-~][a-z0-9-._~]*(?:@[^\s@][^\s]*)?$/.test(t)?"":`The template name '${t}' is not valid.`},"node:child_process"(e){e.exports=t},"node:events"(t){t.exports=e},"node:fs"(t){t.exports=i},"node:path"(t){t.exports=s},"node:process"(t){t.exports=r},"node:readline"(t){t.exports=n},"node:tty"(t){t.exports=o},"node:util"(t){t.exports=a},"../../node_modules/commander/index.js"(t,e,i){let{Argument:s}=i("../../node_modules/commander/lib/argument.js"),{Command:r}=i("../../node_modules/commander/lib/command.js"),{CommanderError:n,InvalidArgumentError:o}=i("../../node_modules/commander/lib/error.js"),{Help:a}=i("../../node_modules/commander/lib/help.js"),{Option:l}=i("../../node_modules/commander/lib/option.js");e.program=new r,e.createCommand=t=>new r(t),e.createOption=(t,e)=>new l(t,e),e.createArgument=(t,e)=>new s(t,e),e.Command=r,e.Option=l,e.Argument=s,e.Help=a,e.CommanderError=n,e.InvalidArgumentError=o,e.InvalidOptionArgumentError=o},"../../node_modules/commander/lib/argument.js"(t,e,i){let{InvalidArgumentError:s}=i("../../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 s(`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"(t,e,i){let s=i("node:events").EventEmitter,r=i("node:child_process"),n=i("node:path"),o=i("node:fs"),a=i("node:process"),{Argument:l,humanReadableArgName:h}=i("../../node_modules/commander/lib/argument.js"),{CommanderError:u}=i("../../node_modules/commander/lib/error.js"),{Help:p,stripColor:m}=i("../../node_modules/commander/lib/help.js"),{Option:d,DualOptions:c}=i("../../node_modules/commander/lib/option.js"),{suggestSimilar:g}=i("../../node_modules/commander/lib/suggestSimilar.js");class f extends s{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=>a.stdout.write(t),writeErr:t=>a.stderr.write(t),outputError:(t,e)=>e(t),getOutHelpWidth:()=>a.stdout.isTTY?a.stdout.columns:void 0,getErrHelpWidth:()=>a.stderr.isTTY?a.stderr.columns:void 0,getOutHasColors:()=>b()??(a.stdout.isTTY&&a.stdout.hasColors?.()),getErrHasColors:()=>b()??(a.stderr.isTTY&&a.stderr.hasColors?.()),stripColor:t=>m(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,i){let s=e,r=i;"object"==typeof s&&null!==s&&(r=s,s=null),r=r||{};let[,n,o]=t.match(/([^ ]+) *(.*)/),a=this.createCommand(n);return(s&&(a.description(s),a._executableHandler=!0),r.isDefault&&(this._defaultCommandName=a._name),a._hidden=!!(r.noHelp||r.hidden),a._executableFile=r.executableFile||null,o&&a.arguments(o),this._registerCommand(a),a.parent=this,a.copyInheritedSettings(this),s)?this:a}createCommand(t){return new f(t)}createHelp(){return Object.assign(new p,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
14
+ - 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 l(t,e)}argument(t,e,i,s){let r=this.createArgument(t,e);return"function"==typeof i?r.default(s).argParser(i):r.default(i),this.addArgument(r),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[,i,s]=(t??"help [command]").match(/([^ ]+) *(.*)/),r=e??"display help for command",n=this.createCommand(i);return n.helpOption(!1),s&&n.arguments(s),r&&n.description(r),this._addImplicitHelpCommand=!0,this._helpCommand=n,(t||e)&&this._initCommandGroup(n),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 i=["preSubcommand","preAction","postAction"];if(!i.includes(t))throw Error(`Unexpected value for event passed to hook : '${t}'.
15
+ Expecting one of '${i.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,i){this._exitCallback&&this._exitCallback(new u(t,e,i)),a.exit(t)}action(t){let e=e=>{let i=this.registeredArguments.length,s=e.slice(0,i);return this._storeOptionsAsProperties?s[i]=this:s[i]=this.opts(),s.push(this),t.apply(this,s)};return this._actionHandler=e,this}createOption(t,e){return new d(t,e)}_callParseArg(t,e,i,s){try{return t.parseArg(e,i)}catch(t){if("commander.invalidArgument"===t.code){let e=`${s} ${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 i=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 '${i}'
16
+ - already used by option '${e.flags}'`)}this._initOptionGroup(t),this.options.push(t)}_registerCommand(t){let e=t=>[t.name()].concat(t.aliases()),i=e(t).find(t=>this._findCommand(t));if(i){let s=e(this._findCommand(i)).join("|"),r=e(t).join("|");throw Error(`cannot add command '${r}' as already have command '${s}'`)}this._initCommandGroup(t),this.commands.push(t)}addOption(t){this._registerOption(t);let e=t.name(),i=t.attributeName();if(t.negate){let e=t.long.replace(/^--no-/,"--");this._findOption(e)||this.setOptionValueWithSource(i,void 0===t.defaultValue||t.defaultValue,"default")}else void 0!==t.defaultValue&&this.setOptionValueWithSource(i,t.defaultValue,"default");let s=(e,s,r)=>{null==e&&void 0!==t.presetArg&&(e=t.presetArg);let n=this.getOptionValue(i);null!==e&&t.parseArg?e=this._callParseArg(t,e,n,s):null!==e&&t.variadic&&(e=t._collectValue(e,n)),null==e&&(e=!t.negate&&(!!t.isBoolean()||!!t.optional||"")),this.setOptionValueWithSource(i,e,r)};return this.on("option:"+e,e=>{let i=`error: option '${t.flags}' argument '${e}' is invalid.`;s(e,i,"cli")}),t.envVar&&this.on("optionEnv:"+e,e=>{let i=`error: option '${t.flags}' value '${e}' from env '${t.envVar}' is invalid.`;s(e,i,"env")}),this}_optionEx(t,e,i,s,r){if("object"==typeof e&&e instanceof d)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let n=this.createOption(e,i);if(n.makeOptionMandatory(!!t.mandatory),"function"==typeof s)n.default(r).argParser(s);else if(s instanceof RegExp){let t=s;s=(e,i)=>{let s=t.exec(e);return s?s[0]:i},n.default(r).argParser(s)}else n.default(s);return this.addOption(n)}option(t,e,i,s){return this._optionEx({},t,e,i,s)}requiredOption(t,e,i,s){return this._optionEx({mandatory:!0},t,e,i,s)}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,i){return this._storeOptionsAsProperties?this[t]=e:this._optionValues[t]=e,this._optionValueSources[t]=i,this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let e;return this._getCommandAndAncestors().forEach(i=>{void 0!==i.getOptionValueSource(t)&&(e=i.getOptionValueSource(t))}),e}_prepareUserArgs(t,e){let i;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){a.versions?.electron&&(e.from="electron");let t=a.execArgv??[];(t.includes("-e")||t.includes("--eval")||t.includes("-p")||t.includes("--print"))&&(e.from="eval")}switch(void 0===t&&(t=a.argv),this.rawArgs=t.slice(),e.from){case void 0:case"node":this._scriptPath=t[1],i=t.slice(2);break;case"electron":a.defaultApp?(this._scriptPath=t[1],i=t.slice(2)):i=t.slice(1);break;case"user":i=t.slice(0);break;case"eval":i=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",i}parse(t,e){this._prepareForParse();let i=this._prepareUserArgs(t,e);return this._parseCommand([],i),this}async parseAsync(t,e){this._prepareForParse();let i=this._prepareUserArgs(t,e);return await this._parseCommand([],i),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.
17
+ - 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,i){if(o.existsSync(t))return;let s=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
18
+ - if '${i}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
8
19
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
9
- - ${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*\.\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}
20
+ - ${s}`)}_executeSubCommand(t,e){let i;e=e.slice();let s=!1,l=[".js",".ts",".tsx",".mjs",".cjs"];function h(t,e){let i=n.resolve(t,e);if(o.existsSync(i))return i;if(l.includes(n.extname(e)))return;let s=l.find(t=>o.existsSync(`${i}${t}`));if(s)return`${i}${s}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let p=t._executableFile||`${this._name}-${t._name}`,m=this._executableDir||"";if(this._scriptPath){let t;try{t=o.realpathSync(this._scriptPath)}catch{t=this._scriptPath}m=n.resolve(n.dirname(t),m)}if(m){let e=h(m,p);if(!e&&!t._executableFile&&this._scriptPath){let i=n.basename(this._scriptPath,n.extname(this._scriptPath));i!==this._name&&(e=h(m,`${i}-${t._name}`))}p=e||p}s=l.includes(n.extname(p)),"win32"!==a.platform?s?(e.unshift(p),e=_(a.execArgv).concat(e),i=r.spawn(a.argv[0],e,{stdio:"inherit"})):i=r.spawn(p,e,{stdio:"inherit"}):(this._checkForMissingExecutable(p,m,t._name),e.unshift(p),e=_(a.execArgv).concat(e),i=r.spawn(a.execPath,e,{stdio:"inherit"})),i.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(t=>{a.on(t,()=>{!1===i.killed&&null===i.exitCode&&i.kill(t)})});let d=this._exitCallback;i.on("close",t=>{t=t??1,d?d(new u(t,"commander.executeSubCommandAsync","(close)")):a.exit(t)}),i.on("error",e=>{if("ENOENT"===e.code)this._checkForMissingExecutable(p,m,t._name);else if("EACCES"===e.code)throw Error(`'${p}' not executable`);if(d){let t=new u(1,"commander.executeSubCommandAsync","(error)");t.nestedError=e,d(t)}else a.exit(1)}),this.runningCommand=i}_dispatchSubcommand(t,e,i){let s,r=this._findCommand(t);return r||this.help({error:!0}),r._prepareForParse(),s=this._chainOrCallSubCommandHook(s,r,"preSubcommand"),s=this._chainOrCall(s,()=>{if(!r._executableHandler)return r._parseCommand(e,i);this._executeSubCommand(r,e.concat(i))})}_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,i)=>{let s=e;if(null!==e&&t.parseArg){let r=`error: command-argument value '${e}' is invalid for argument '${t.name()}'.`;s=this._callParseArg(t,e,i,r)}return s};this._checkNumberOfArguments();let e=[];this.registeredArguments.forEach((i,s)=>{let r=i.defaultValue;i.variadic?s<this.args.length?(r=this.args.slice(s),i.parseArg&&(r=r.reduce((e,s)=>t(i,s,e),i.defaultValue))):void 0===r&&(r=[]):s<this.args.length&&(r=this.args[s],i.parseArg&&(r=t(i,r,i.defaultValue))),e[s]=r}),this.processedArgs=e}_chainOrCall(t,e){return t?.then&&"function"==typeof t.then?t.then(()=>e()):e()}_chainOrCallHooks(t,e){let i=t,s=[];return this._getCommandAndAncestors().reverse().filter(t=>void 0!==t._lifeCycleHooks[e]).forEach(t=>{t._lifeCycleHooks[e].forEach(e=>{s.push({hookedCommand:t,callback:e})})}),"postAction"===e&&s.reverse(),s.forEach(t=>{i=this._chainOrCall(i,()=>t.callback(t.hookedCommand,this))}),i}_chainOrCallSubCommandHook(t,e,i){let s=t;return void 0!==this._lifeCycleHooks[i]&&this._lifeCycleHooks[i].forEach(t=>{s=this._chainOrCall(s,()=>t(this,e))}),s}_parseCommand(t,e){let i=this.parseOptions(e);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(i.operands),e=i.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(i.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=()=>{i.unknown.length>0&&this.unknownOption(i.unknown[0])},r=`command:${this.name()}`;if(this._actionHandler){let i;return s(),this._processArguments(),i=this._chainOrCallHooks(i,"preAction"),i=this._chainOrCall(i,()=>this._actionHandler(this.processedArgs)),this.parent&&(i=this._chainOrCall(i,()=>{this.parent.emit(r,t,e)})),i=this._chainOrCallHooks(i,"postAction")}if(this.parent?.listenerCount(r))s(),this._processArguments(),this.parent.emit(r,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():(s(),this._processArguments())}else this.commands.length?(s(),this.help({error:!0})):(s(),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 i=t.find(t=>e.conflictsWith.includes(t.attributeName()));i&&this._conflictingOption(e,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){let e=[],i=[],s=e;function r(t){return t.length>1&&"-"===t[0]}let n=t=>!!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(t)&&!this._getCommandAndAncestors().some(t=>t.options.map(t=>t.short).some(t=>/^-\d$/.test(t))),o=null,a=null,l=0;for(;l<t.length||a;){let h=a??t[l++];if(a=null,"--"===h){s===i&&s.push(h),s.push(...t.slice(l));break}if(o&&(!r(h)||n(h))){this.emit(`option:${o.name()}`,h);continue}if(o=null,r(h)){let e=this._findOption(h);if(e){if(e.required){let i=t[l++];void 0===i&&this.optionMissingArgument(e),this.emit(`option:${e.name()}`,i)}else if(e.optional){let i=null;l<t.length&&(!r(t[l])||n(t[l]))&&(i=t[l++]),this.emit(`option:${e.name()}`,i)}else this.emit(`option:${e.name()}`);o=e.variadic?e:null;continue}}if(h.length>2&&"-"===h[0]&&"-"!==h[1]){let t=this._findOption(`-${h[1]}`);if(t){t.required||t.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${t.name()}`,h.slice(2)):(this.emit(`option:${t.name()}`),a=`-${h.slice(2)}`);continue}}if(/^--[^=]+=/.test(h)){let t=h.indexOf("="),e=this._findOption(h.slice(0,t));if(e&&(e.required||e.optional)){this.emit(`option:${e.name()}`,h.slice(t+1));continue}}if(s===e&&r(h)&&!(0===this.commands.length&&n(h))&&(s=i),(this._enablePositionalOptions||this._passThroughOptions)&&0===e.length&&0===i.length){if(this._findCommand(h)){e.push(h),i.push(...t.slice(l));break}else if(this._getHelpCommand()&&h===this._getHelpCommand().name()){e.push(h,...t.slice(l));break}else if(this._defaultCommandName){i.push(h,...t.slice(l));break}}if(this._passThroughOptions){s.push(h,...t.slice(l));break}s.push(h)}return{operands:e,unknown:i}}opts(){if(this._storeOptionsAsProperties){let t={},e=this.options.length;for(let i=0;i<e;i++){let e=this.options[i].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}
10
21
  `,this._outputConfiguration.writeErr),"string"==typeof this._showHelpAfterError?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
11
- `):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}
12
- `),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.
13
- 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}
14
- `)}),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,`
15
- ${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}
22
+ `):this._showHelpAfterError&&(this._outputConfiguration.writeErr("\n"),this.outputHelp({error:!0}));let i=e||{},s=i.exitCode||1,r=i.code||"commander.error";this._exit(s,r,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in a.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()}`,a.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(i=>void 0!==i.implied&&e(i.attributeName())&&t.valueFromOption(this.getOptionValue(i.attributeName()),i)).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 i=t=>{let e=t.attributeName(),i=this.getOptionValue(e),s=this.options.find(t=>t.negate&&e===t.attributeName()),r=this.options.find(t=>!t.negate&&e===t.attributeName());return s&&(void 0===s.presetArg&&!1===i||void 0!==s.presetArg&&i===s.presetArg)?s:r||t},s=t=>{let e=i(t),s=e.attributeName();return"env"===this.getOptionValueSource(s)?`environment variable '${e.envVar}'`:`option '${e.flags}'`},r=`error: ${s(t)} cannot be used with ${s(e)}`;this.error(r,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let e="";if(t.startsWith("--")&&this._showSuggestionAfterError){let i=[],s=this;do{let t=s.createHelp().visibleOptions(s).filter(t=>t.long).map(t=>t.long);i=i.concat(t),s=s.parent}while(s&&!s._enablePositionalOptions);e=g(t,i)}let i=`error: unknown option '${t}'${e}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let e=this.registeredArguments.length,i=this.parent?` for '${this.name()}'`:"",s=`error: too many arguments${i}. Expected ${e} argument${1===e?"":"s"} but got ${t.length}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],e="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(t=>{i.push(t.name()),t.alias()&&i.push(t.alias())}),e=g(t,i)}let i=`error: unknown command '${t}'${e}`;this.error(i,{code:"commander.unknownCommand"})}version(t,e,i){if(void 0===t)return this._version;this._version=t,e=e||"-V, --version",i=i||"output the version number";let s=this.createOption(e,i);return this._versionOptionName=s.attributeName(),this._registerOption(s),this.on("option:"+s.name(),()=>{this._outputConfiguration.writeOut(`${t}
23
+ `),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 i=this.parent?._findCommand(t);if(i){let e=[i.name()].concat(i.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=>h(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=n.basename(t,n.extname(t)),this}executableDir(t){return void 0===t?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let e=this.createHelp(),i=this._getOutputContext(t);e.prepareContext({error:i.error,helpWidth:i.helpWidth,outputHasColors:i.hasColors});let s=e.formatHelp(this,e);return i.hasColors?s:this._outputConfiguration.stripColor(s)}_getOutputContext(t){let e,i,s,r=!!(t=t||{}).error;return r?(e=t=>this._outputConfiguration.writeErr(t),i=this._outputConfiguration.getErrHasColors(),s=this._outputConfiguration.getErrHelpWidth()):(e=t=>this._outputConfiguration.writeOut(t),i=this._outputConfiguration.getOutHasColors(),s=this._outputConfiguration.getOutHelpWidth()),{error:r,write:t=>(i||(t=this._outputConfiguration.stripColor(t)),e(t)),hasColors:i,helpWidth:s}}outputHelp(t){let e;"function"==typeof t&&(e=t,t=void 0);let i=this._getOutputContext(t),s={error:i.error,write:i.write,command:this};this._getCommandAndAncestors().reverse().forEach(t=>t.emit("beforeAllHelp",s)),this.emit("beforeHelp",s);let r=this.helpInformation({error:i.error});if(e&&"string"!=typeof(r=e(r))&&!Buffer.isBuffer(r))throw Error("outputHelp callback must return a string or a Buffer");i.write(r),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",s),this._getCommandAndAncestors().forEach(t=>t.emit("afterAllHelp",s))}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(a.exitCode??0);0===e&&t&&"function"!=typeof t&&t.error&&(e=1),this._exit(e,"commander.help","(outputHelp)")}addHelpText(t,e){let i=["beforeAll","before","after","afterAll"];if(!i.includes(t))throw Error(`Unexpected value for position to addHelpText.
24
+ Expecting one of '${i.join("', '")}'`);let s=`${t}Help`;return this.on(s,t=>{let i;(i="function"==typeof e?e({error:t.error,command:t.command}):e)&&t.write(`${i}
25
+ `)}),this}_outputHelpIfRequested(t){let e=this._getHelpOption();e&&t.find(t=>e.is(t))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}}function _(t){return t.map(t=>{let e,i;if(!t.startsWith("--inspect"))return t;let s="127.0.0.1",r="9229";return(null!==(i=t.match(/^(--inspect(-brk)?)$/))?e=i[1]:null!==(i=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))?(e=i[1],/^\d+$/.test(i[3])?r=i[3]:s=i[3]):null!==(i=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))&&(e=i[1],s=i[3],r=i[4]),e&&"0"!==r)?`${e}=${s}:${parseInt(r)+1}`:t})}function b(){return!a.env.NO_COLOR&&"0"!==a.env.FORCE_COLOR&&"false"!==a.env.FORCE_COLOR&&(!!a.env.FORCE_COLOR||void 0!==a.env.CLICOLOR_FORCE||void 0)}e.Command=f,e.useColor=b},"../../node_modules/commander/lib/error.js"(t,e){class i extends Error{constructor(t,e,i){super(i),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=e,this.exitCode=t,this.nestedError=void 0}}e.CommanderError=i,e.InvalidArgumentError=class extends i{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}},"../../node_modules/commander/lib/help.js"(t,e,i){let{humanReadableArgName:s}=i("../../node_modules/commander/lib/argument.js");function r(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),i=t._getHelpCommand();return i&&!i._hidden&&e.push(i),this.sortSubcommands&&e.sort((t,e)=>t.name().localeCompare(e.name())),e}compareOptions(t,e){let i=t=>t.short?t.short.replace(/^-/,""):t.long.replace(/^--/,"");return i(t).localeCompare(i(e))}visibleOptions(t){let e=t.options.filter(t=>!t.hidden),i=t._getHelpOption();if(i&&!i.hidden){let s=i.short&&t._findOption(i.short),r=i.long&&t._findOption(i.long);s||r?i.long&&!r?e.push(t.createOption(i.long,i.description)):i.short&&!s&&e.push(t.createOption(i.short,i.description)):e.push(i)}return this.sortOptions&&e.sort(this.compareOptions),e}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let e=[];for(let i=t.parent;i;i=i.parent){let t=i.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=>s(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,i)=>Math.max(t,this.displayWidth(e.styleSubcommandTerm(e.subcommandTerm(i)))),0)}longestOptionTermLength(t,e){return e.visibleOptions(t).reduce((t,i)=>Math.max(t,this.displayWidth(e.styleOptionTerm(e.optionTerm(i)))),0)}longestGlobalOptionTermLength(t,e){return e.visibleGlobalOptions(t).reduce((t,i)=>Math.max(t,this.displayWidth(e.styleOptionTerm(e.optionTerm(i)))),0)}longestArgumentTermLength(t,e){return e.visibleArguments(t).reduce((t,i)=>Math.max(t,this.displayWidth(e.styleArgumentTerm(e.argumentTerm(i)))),0)}commandUsage(t){let e=t._name;t._aliases[0]&&(e=e+"|"+t._aliases[0]);let i="";for(let e=t.parent;e;e=e.parent)i=e.name()+" "+i;return i+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 i=`(${e.join(", ")})`;return t.description?`${t.description} ${i}`:i}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 i=`(${e.join(", ")})`;return t.description?`${t.description} ${i}`:i}return t.description}formatItemList(t,e,i){return 0===e.length?[]:[i.styleTitle(t),...e,""]}groupItems(t,e,i){let s=new Map;return t.forEach(t=>{let e=i(t);s.has(e)||s.set(e,[])}),e.forEach(t=>{let e=i(t);s.has(e)||s.set(e,[]),s.get(e).push(t)}),s}formatHelp(t,e){let i=e.padWidth(t,e),s=e.helpWidth??80;function r(t,s){return e.formatItem(t,i,s,e)}let n=[`${e.styleTitle("Usage:")} ${e.styleUsage(e.commandUsage(t))}`,""],o=e.commandDescription(t);o.length>0&&(n=n.concat([e.boxWrap(e.styleCommandDescription(o),s),""]));let a=e.visibleArguments(t).map(t=>r(e.styleArgumentTerm(e.argumentTerm(t)),e.styleArgumentDescription(e.argumentDescription(t))));if(n=n.concat(this.formatItemList("Arguments:",a,e)),this.groupItems(t.options,e.visibleOptions(t),t=>t.helpGroupHeading??"Options:").forEach((t,i)=>{let s=t.map(t=>r(e.styleOptionTerm(e.optionTerm(t)),e.styleOptionDescription(e.optionDescription(t))));n=n.concat(this.formatItemList(i,s,e))}),e.showGlobalOptions){let i=e.visibleGlobalOptions(t).map(t=>r(e.styleOptionTerm(e.optionTerm(t)),e.styleOptionDescription(e.optionDescription(t))));n=n.concat(this.formatItemList("Global Options:",i,e))}return this.groupItems(t.commands,e.visibleCommands(t),t=>t.helpGroup()||"Commands:").forEach((t,i)=>{let s=t.map(t=>r(e.styleSubcommandTerm(e.subcommandTerm(t)),e.styleSubcommandDescription(e.subcommandDescription(t))));n=n.concat(this.formatItemList(i,s,e))}),n.join("\n")}displayWidth(t){return r(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,i,s){let r,n=" ".repeat(2);if(!i)return n+t;let o=t.padEnd(e+t.length-s.displayWidth(t)),a=(this.helpWidth??80)-e-2-2;return r=a<this.minWidthToWrap||s.preformatted(i)?i:s.boxWrap(i,a).replace(/\n/g,"\n"+" ".repeat(e+2)),n+o+" ".repeat(2)+r.replace(/\n/g,`
26
+ ${n}`)}boxWrap(t,e){if(e<this.minWidthToWrap)return t;let i=t.split(/\r\n|\n/),s=/[\s]*[^\s]+/g,r=[];return i.forEach(t=>{let i=t.match(s);if(null===i)return void r.push("");let n=[i.shift()],o=this.displayWidth(n[0]);i.forEach(t=>{let i=this.displayWidth(t);if(o+i<=e){n.push(t),o+=i;return}r.push(n.join(""));let s=t.trimStart();n=[s],o=this.displayWidth(s)}),r.push(n.join(""))}),r.join("\n")}},e.stripColor=r},"../../node_modules/commander/lib/option.js"(t,e,i){let{InvalidArgumentError:s}=i("../../node_modules/commander/lib/error.js");function r(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 i=function(t){let e,i,s=/^-[^-]$/,r=/^--[^-]/,n=t.split(/[ |,]+/).concat("guard");if(s.test(n[0])&&(e=n.shift()),r.test(n[0])&&(i=n.shift()),!e&&s.test(n[0])&&(e=n.shift()),!e&&r.test(n[0])&&(e=i,i=n.shift()),n[0].startsWith("-")){let e=n[0],i=`option creation failed due to '${e}' in option flags '${t}'`;if(/^-[^-][^-]/.test(e))throw Error(`${i}
16
27
  - a short flag is a single dash and a single character
17
28
  - either use a single dash and a single character (for a short flag)
18
- - or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(i.test(e))throw Error(`${u}
19
- - too many short flags`);if(D.test(e))throw Error(`${u}
20
- - too many long flags`);throw Error(`${u}
21
- - 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)?`
22
- (Did you mean one of ${i.join(", ")}?)`:1===i.length?`
23
- (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"}}var g=d("node:child_process"),E=d("node:process");let f=r(g.execFile),_=async(t,e=[],u)=>{try{let i={shell:"win32"===E.platform,...u};await f(t,e,i)}catch{let u=[t,...e].join(" ");throw new F(`Failed to execute ${u}`)}};var b=d("../../node_modules/sisteransi/src/index.js"),A=d("../../node_modules/picocolors/picocolors.js"),B=d.n(A);let v=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 x(t){if("string"!=typeof t)throw TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(v,"")}function w(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var y={exports:{}},O={};function $(t){return t.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}y.exports=O,O.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"},O.characterLength=function(t){var e=this.eastAsianWidth(t);return"F"==e||"W"==e||"A"==e?2:1},O.length=function(t){for(var e=$(t),u=0,i=0;i<e.length;i++)u+=this.characterLength(e[i]);return u},O.slice=function(t,e,u){textLen=O.length(t),u=u||1,(e=e||0)<0&&(e=textLen+e),u<0&&(u=textLen+u);for(var i="",D=0,r=$(t),s=0;s<r.length;s++){var n=r[s],o=O.length(n);if(D>=e-(2==o))if(D+o<=u)i+=n;else break;D+=o}return i};let k=w(y.exports),S=w(function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g});function T(t,e={}){if("string"!=typeof t||0===t.length||(e={ambiguousIsNarrow:!0,...e},0===(t=x(t)).length))return 0;t=t.replace(S()," ");let u=e.ambiguousIsNarrow?1:2,i=0;for(let e of t){let t=e.codePointAt(0);if(!(t<=31)&&(!(t>=127)||!(t<=159))&&(!(t>=768)||!(t<=879)))switch(k.eastAsianWidth(e)){case"F":case"W":i+=2;break;case"A":i+=u;break;default:i+=1}}return i}let H=(t=0)=>e=>`\x1b[${e+t}m`,V=(t=0)=>e=>`\x1b[${38+t};5;${e}m`,j=(t=0)=>(e,u,i)=>`\x1b[${38+t};2;${e};${u};${i}m`,M={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(M.modifier),[...Object.keys(M.color),...Object.keys(M.bgColor)];let G=function(){let t=new Map;for(let[e,u]of Object.entries(M)){for(let[e,i]of Object.entries(u))M[e]={open:`\x1b[${i[0]}m`,close:`\x1b[${i[1]}m`},u[e]=M[e],t.set(i[0],i[1]);Object.defineProperty(M,e,{value:u,enumerable:!1})}return Object.defineProperty(M,"codes",{value:t,enumerable:!1}),M.color.close="\x1b[39m",M.bgColor.close="\x1b[49m",M.color.ansi=H(),M.color.ansi256=V(),M.color.ansi16m=j(),M.bgColor.ansi=H(10),M.bgColor.ansi256=V(10),M.bgColor.ansi16m=j(10),Object.defineProperties(M,{rgbToAnsi256:{value:(t,e,u)=>t===e&&e===u?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(e/255*5)+Math.round(u/255*5),enumerable:!1},hexToRgb:{value:t=>{let e=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!e)return[0,0,0];let[u]=e;3===u.length&&(u=[...u].map(t=>t+t).join(""));let i=Number.parseInt(u,16);return[i>>16&255,i>>8&255,255&i]},enumerable:!1},hexToAnsi256:{value:t=>M.rgbToAnsi256(...M.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value:t=>{let e,u,i;if(t<8)return 30+t;if(t<16)return 90+(t-8);if(t>=232)u=e=((t-232)*10+8)/255,i=e;else{let D=(t-=16)%36;e=Math.floor(t/36)/5,u=Math.floor(D/6)/5,i=D%6/5}let D=2*Math.max(e,u,i);if(0===D)return 30;let r=30+(Math.round(i)<<2|Math.round(u)<<1|Math.round(e));return 2===D&&(r+=60),r},enumerable:!1},rgbToAnsi:{value:(t,e,u)=>M.ansi256ToAnsi(M.rgbToAnsi256(t,e,u)),enumerable:!1},hexToAnsi:{value:t=>M.ansi256ToAnsi(M.hexToAnsi256(t)),enumerable:!1}}),M}(),W=new Set(["\x1b","\x9b"]),P="]8;;",I=t=>`${W.values().next().value}[${t}m`,N=t=>`${W.values().next().value}${P}${t}\x07`,R=(t,e,u)=>{let i=[...e],D=!1,r=!1,s=T(x(t[t.length-1]));for(let[e,n]of i.entries()){let o=T(n);if(s+o<=u?t[t.length-1]+=n:(t.push(n),s=0),W.has(n)&&(D=!0,r=i.slice(e+1).join("").startsWith(P)),D){r?"\x07"===n&&(D=!1,r=!1):"m"===n&&(D=!1);continue}(s+=o)===u&&e<i.length-1&&(t.push(""),s=0)}!s&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())};function L(t,e,u){return String(t).normalize().replace(/\r\n/g,`
29
+ - or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(s.test(e))throw Error(`${i}
30
+ - too many short flags`);if(r.test(e))throw Error(`${i}
31
+ - too many long flags`);throw Error(`${i}
32
+ - unrecognised flag format`)}if(void 0===e&&void 0===i)throw Error(`option creation failed due to no flags found in '${t}'.`);return{shortFlag:e,longFlag:i}}(t);this.short=i.shortFlag,this.long=i.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 s(`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?r(this.name().replace(/^no-/,"")):r(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 i=e.attributeName();if(!this.dualOptions.has(i))return!0;let s=this.negativeOptions.get(i).presetArg;return e.negate===((void 0!==s&&s)===t)}}},"../../node_modules/commander/lib/suggestSimilar.js"(t,e){e.suggestSimilar=function(t,e){if(!e||0===e.length)return"";e=Array.from(new Set(e));let i=t.startsWith("--");i&&(t=t.slice(2),e=e.map(t=>t.slice(2)));let s=[],r=3;return(e.forEach(e=>{if(e.length<=1)return;let i=function(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let i=[];for(let e=0;e<=t.length;e++)i[e]=[e];for(let t=0;t<=e.length;t++)i[0][t]=t;for(let s=1;s<=e.length;s++)for(let r=1;r<=t.length;r++){let n=1;n=+(t[r-1]!==e[s-1]),i[r][s]=Math.min(i[r-1][s]+1,i[r][s-1]+1,i[r-1][s-1]+n),r>1&&s>1&&t[r-1]===e[s-2]&&t[r-2]===e[s-1]&&(i[r][s]=Math.min(i[r][s],i[r-2][s-2]+1))}return i[t.length][e.length]}(t,e),n=Math.max(t.length,e.length);(n-i)/n>.4&&(i<r?(r=i,s=[e]):i===r&&s.push(e))}),s.sort((t,e)=>t.localeCompare(e)),i&&(s=s.map(t=>`--${t}`)),s.length>1)?`
33
+ (Did you mean one of ${s.join(", ")}?)`:1===s.length?`
34
+ (Did you mean ${s[0]}?)`:""}},"../../node_modules/@clack/core/dist/index.mjs"(t,e,i){i.d(e,{C:()=>G,FZ:()=>I,GH:()=>V,W0:()=>k,jz:()=>W,om:()=>M});var s=i("../../node_modules/picocolors/picocolors.js"),r=i("node:process"),n=i("node:readline"),o=i("../../node_modules/sisteransi/src/index.js"),a=i("node:tty");let l=t=>161===t||164===t||167===t||168===t||170===t||173===t||174===t||t>=176&&t<=180||t>=182&&t<=186||t>=188&&t<=191||198===t||208===t||215===t||216===t||t>=222&&t<=225||230===t||t>=232&&t<=234||236===t||237===t||240===t||242===t||243===t||t>=247&&t<=250||252===t||254===t||257===t||273===t||275===t||283===t||294===t||295===t||299===t||t>=305&&t<=307||312===t||t>=319&&t<=322||324===t||t>=328&&t<=331||333===t||338===t||339===t||358===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===t||t>=713&&t<=715||717===t||720===t||t>=728&&t<=731||733===t||735===t||t>=768&&t<=879||t>=913&&t<=929||t>=931&&t<=937||t>=945&&t<=961||t>=963&&t<=969||1025===t||t>=1040&&t<=1103||1105===t||8208===t||t>=8211&&t<=8214||8216===t||8217===t||8220===t||8221===t||t>=8224&&t<=8226||t>=8228&&t<=8231||8240===t||8242===t||8243===t||8245===t||8251===t||8254===t||8308===t||8319===t||t>=8321&&t<=8324||8364===t||8451===t||8453===t||8457===t||8467===t||8470===t||8481===t||8482===t||8486===t||8491===t||8531===t||8532===t||t>=8539&&t<=8542||t>=8544&&t<=8555||t>=8560&&t<=8569||8585===t||t>=8592&&t<=8601||8632===t||8633===t||8658===t||8660===t||8679===t||8704===t||8706===t||8707===t||8711===t||8712===t||8715===t||8719===t||8721===t||8725===t||8730===t||t>=8733&&t<=8736||8739===t||8741===t||t>=8743&&t<=8748||8750===t||t>=8756&&t<=8759||8764===t||8765===t||8776===t||8780===t||8786===t||8800===t||8801===t||t>=8804&&t<=8807||8810===t||8811===t||8814===t||8815===t||8834===t||8835===t||8838===t||8839===t||8853===t||8857===t||8869===t||8895===t||8978===t||t>=9312&&t<=9449||t>=9451&&t<=9547||t>=9552&&t<=9587||t>=9600&&t<=9615||t>=9618&&t<=9621||9632===t||9633===t||t>=9635&&t<=9641||9650===t||9651===t||9654===t||9655===t||9660===t||9661===t||9664===t||9665===t||t>=9670&&t<=9672||9675===t||t>=9678&&t<=9681||t>=9698&&t<=9701||9711===t||9733===t||9734===t||9737===t||9742===t||9743===t||9756===t||9758===t||9792===t||9794===t||9824===t||9825===t||t>=9827&&t<=9829||t>=9831&&t<=9834||9836===t||9837===t||9839===t||9886===t||9887===t||9919===t||t>=9926&&t<=9933||t>=9935&&t<=9939||t>=9941&&t<=9953||9955===t||9960===t||9961===t||t>=9963&&t<=9969||9972===t||t>=9974&&t<=9977||9979===t||9980===t||9982===t||9983===t||10045===t||t>=10102&&t<=10111||t>=11094&&t<=11097||t>=12872&&t<=12879||t>=57344&&t<=63743||t>=65024&&t<=65039||65533===t||t>=127232&&t<=127242||t>=127248&&t<=127277||t>=127280&&t<=127337||t>=127344&&t<=127373||127375===t||127376===t||t>=127387&&t<=127404||t>=917760&&t<=917999||t>=983040&&t<=1048573||t>=1048576&&t<=1114109,h=t=>12288===t||t>=65281&&t<=65376||t>=65504&&t<=65510,u=t=>t>=4352&&t<=4447||8986===t||8987===t||9001===t||9002===t||t>=9193&&t<=9196||9200===t||9203===t||9725===t||9726===t||9748===t||9749===t||t>=9800&&t<=9811||9855===t||9875===t||9889===t||9898===t||9899===t||9917===t||9918===t||9924===t||9925===t||9934===t||9940===t||9962===t||9970===t||9971===t||9973===t||9978===t||9981===t||9989===t||9994===t||9995===t||10024===t||10060===t||10062===t||t>=10067&&t<=10069||10071===t||t>=10133&&t<=10135||10160===t||10175===t||11035===t||11036===t||11088===t||11093===t||t>=11904&&t<=11929||t>=11931&&t<=12019||t>=12032&&t<=12245||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12353&&t<=12438||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12771||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=19903||t>=19968&&t<=42124||t>=42128&&t<=42182||t>=43360&&t<=43388||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=94176&&t<=94180||94192===t||94193===t||t>=94208&&t<=100343||t>=100352&&t<=101589||t>=101632&&t<=101640||t>=110576&&t<=110579||t>=110581&&t<=110587||110589===t||110590===t||t>=110592&&t<=110882||110898===t||t>=110928&&t<=110930||110933===t||t>=110948&&t<=110951||t>=110960&&t<=111355||126980===t||127183===t||127374===t||t>=127377&&t<=127386||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||127568===t||127569===t||t>=127584&&t<=127589||t>=127744&&t<=127776||t>=127789&&t<=127797||t>=127799&&t<=127868||t>=127870&&t<=127891||t>=127904&&t<=127946||t>=127951&&t<=127955||t>=127968&&t<=127984||127988===t||t>=127992&&t<=128062||128064===t||t>=128066&&t<=128252||t>=128255&&t<=128317||t>=128331&&t<=128334||t>=128336&&t<=128359||128378===t||128405===t||128406===t||128420===t||t>=128507&&t<=128591||t>=128640&&t<=128709||128716===t||t>=128720&&t<=128722||t>=128725&&t<=128727||t>=128732&&t<=128735||128747===t||128748===t||t>=128756&&t<=128764||t>=128992&&t<=129003||129008===t||t>=129292&&t<=129338||t>=129340&&t<=129349||t>=129351&&t<=129535||t>=129648&&t<=129660||t>=129664&&t<=129672||t>=129680&&t<=129725||t>=129727&&t<=129733||t>=129742&&t<=129755||t>=129760&&t<=129768||t>=129776&&t<=129784||t>=131072&&t<=196605||t>=196608&&t<=262141,p=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,m=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,d=/\t{1,1000}/y,c=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,g=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,f=/\p{M}+/gu,_={limit:1/0,ellipsis:""},b=(t,e={},i={})=>{let s=e.limit??1/0,r=e.ellipsis??"",n=e?.ellipsisWidth??(r?b(r,_,i).width:0),o=i.ansiWidth??0,a=i.controlWidth??0,v=i.tabWidth??8,x=i.ambiguousWidth??1,w=i.emojiWidth??2,y=i.fullWidthWidth??2,O=i.regularWidth??1,C=i.wideWidth??2,$=0,A=0,E=t.length,k=0,S=!1,j=E,T=Math.max(0,s-n),I=0,H=0,M=0,V=0;t:for(;;){if(H>I||A>=E&&A>$){for(let e of(k=0,(t.slice(I,H)||t.slice($,A)).replaceAll(f,""))){let t=e.codePointAt(0)||0;if(M+(V=h(t)?y:u(t)?C:x!==O&&l(t)?x:O)>T&&(j=Math.min(j,Math.max(I,$)+k)),M+V>s){S=!0;break t}k+=e.length,M+=V}I=H=0}if(A>=E)break;if(g.lastIndex=A,g.test(t)){if(M+(V=(k=g.lastIndex-A)*O)>T&&(j=Math.min(j,A+Math.floor((T-M)/O))),M+V>s){S=!0;break}M+=V,I=$,H=A,A=$=g.lastIndex;continue}if(p.lastIndex=A,p.test(t)){if(M+o>T&&(j=Math.min(j,A)),M+o>s){S=!0;break}M+=o,I=$,H=A,A=$=p.lastIndex;continue}if(m.lastIndex=A,m.test(t)){if(M+(V=(k=m.lastIndex-A)*a)>T&&(j=Math.min(j,A+Math.floor((T-M)/a))),M+V>s){S=!0;break}M+=V,I=$,H=A,A=$=m.lastIndex;continue}if(d.lastIndex=A,d.test(t)){if(M+(V=(k=d.lastIndex-A)*v)>T&&(j=Math.min(j,A+Math.floor((T-M)/v))),M+V>s){S=!0;break}M+=V,I=$,H=A,A=$=d.lastIndex;continue}if(c.lastIndex=A,c.test(t)){if(M+w>T&&(j=Math.min(j,A)),M+w>s){S=!0;break}M+=w,I=$,H=A,A=$=c.lastIndex;continue}A+=1}return{width:S?T:M,index:S?j:E,truncated:S,ellipsed:S&&s>=n}},v={limit:1/0,ellipsis:"",ellipsisWidth:0},x=(t,e={})=>b(t,v,e).width,w="]8;;",y=RegExp(`(?:\\[(?<code>\\d+)m|\\${w}(?<uri>.*)\x07)`,"y"),O=t=>t>=30&&t<=37||t>=90&&t<=97?39:t>=40&&t<=47||t>=100&&t<=107?49:1===t||2===t?22:3===t?23:4===t?24:7===t?27:8===t?28:9===t?29:0===t?0:void 0,C=t=>`\x1b[${t}m`,$=t=>`\x1b${w}${t}\x07`,A=(t,e,i)=>{let s=e[Symbol.iterator](),r=!1,n=!1,o=t.at(-1),a=void 0===o?0:x(o),l=s.next(),h=s.next(),u=0;for(;!l.done;){let o=l.value,p=x(o);a+p<=i?t[t.length-1]+=o:(t.push(o),a=0),("\x1b"===o||"\x9b"===o)&&(r=!0,n=e.startsWith(w,u+1)),r?n?"\x07"===o&&(r=!1,n=!1):"m"===o&&(r=!1):(a+=p)!==i||h.done||(t.push(""),a=0),l=h,h=s.next(),u+=o.length}o=t.at(-1),!a&&void 0!==o&&o.length>0&&t.length>1&&(t[t.length-2]+=t.pop())};function E(t,e,i){return String(t).normalize().replaceAll(`\r
35
+ `,`
24
36
  `).split(`
25
- `).map(t=>((t,e,u={})=>{if(!1!==u.trim&&""===t.trim())return"";let i="",D,r,s=t.split(" ").map(t=>T(t)),n=[""];for(let[i,D]of t.split(" ").entries()){!1!==u.trim&&(n[n.length-1]=n[n.length-1].trimStart());let t=T(n[n.length-1]);if(0!==i&&(t>=e&&(!1===u.wordWrap||!1===u.trim)&&(n.push(""),t=0),(t>0||!1===u.trim)&&(n[n.length-1]+=" ",t++)),u.hard&&s[i]>e){let u=e-t,r=1+Math.floor((s[i]-u-1)/e);Math.floor((s[i]-1)/e)<r&&n.push(""),R(n,D,e);continue}if(t+s[i]>e&&t>0&&s[i]>0){if(!1===u.wordWrap&&t<e){R(n,D,e);continue}n.push("")}if(t+s[i]>e&&!1===u.wordWrap){R(n,D,e);continue}n[n.length-1]+=D}!1!==u.trim&&(n=n.map(t=>(t=>{let e=t.split(" "),u=e.length;for(;u>0&&!(T(e[u-1])>0);)u--;return u===e.length?t:e.slice(0,u).join(" ")+e.slice(u).join("")})(t)));let o=[...n.join(`
26
- `)];for(let[t,e]of o.entries()){if(i+=e,W.has(e)){let{groups:e}=RegExp(`(?:\\[(?<code>\\d+)m|\\${P}(?<uri>.*)\x07)`).exec(o.slice(t).join(""))||{groups:{}};if(void 0!==e.code){let t=Number.parseFloat(e.code);D=39===t?void 0:t}else void 0!==e.uri&&(r=0===e.uri.length?void 0:e.uri)}let u=G.codes.get(Number(D));o[t+1]===`
27
- `?(r&&(i+=N("")),D&&u&&(i+=I(u))):e===`
28
- `&&(D&&u&&(i+=I(D)),r&&(i+=N(r)))}return i})(t,e,u)).join(`
29
- `)}let q={actions:new Set(["up","down","left","right","space","enter","cancel"]),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]])};function U(t,e){if("string"==typeof t)return q.aliases.get(t)===e;for(let u of t)if(void 0!==u&&U(u,e))return!0;return!1}let z=globalThis.process.platform.startsWith("win"),Y=Symbol("clack:cancel");function J(t,e){t.isTTY&&t.setRawMode(e)}var K=Object.defineProperty,Z=(t,e,u)=>{let i;return(i="symbol"!=typeof e?e+"":e)in t?K(t,i,{enumerable:!0,configurable:!0,writable:!0,value:u}):t[i]=u,u};class Q{constructor(t,e=!0){Z(this,"input"),Z(this,"output"),Z(this,"_abortSignal"),Z(this,"rl"),Z(this,"opts"),Z(this,"_render"),Z(this,"_track",!1),Z(this,"_prevFrame",""),Z(this,"_subscribers",new Map),Z(this,"_cursor",0),Z(this,"state","initial"),Z(this,"error",""),Z(this,"value");let{input:u=E.stdin,output:i=E.stdout,render:D,signal:r,...s}=t;this.opts=s,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=D.bind(this),this._track=e,this._abortSignal=r,this.input=u,this.output=i}unsubscribe(){this._subscribers.clear()}setSubscriber(t,e){let u=this._subscribers.get(t)??[];u.push(e),this._subscribers.set(t,u)}on(t,e){this.setSubscriber(t,{cb:e})}once(t,e){this.setSubscriber(t,{cb:e,once:!0})}emit(t,...e){let u=this._subscribers.get(t)??[],i=[];for(let t of u)t.cb(...e),t.once&&i.push(()=>u.splice(u.indexOf(t),1));for(let t of i)t()}prompt(){return new Promise((t,e)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),t(Y);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let u=new p;u._write=(t,e,u)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),u()},this.input.pipe(u),this.rl=n.createInterface({input:this.input,output:u,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),n.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),void 0!==this.opts.initialValue&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),J(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(b.cursor.show),this.output.off("resize",this.render),J(this.input,!1),t(this.value)}),this.once("cancel",()=>{this.output.write(b.cursor.show),this.output.off("resize",this.render),J(this.input,!1),t(Y)})})}onKeypress(t,e){if("error"===this.state&&(this.state="active"),e?.name&&(!this._track&&q.aliases.has(e.name)&&this.emit("cursor",q.aliases.get(e.name)),q.actions.has(e.name)&&this.emit("cursor",e.name)),t&&("y"===t.toLowerCase()||"n"===t.toLowerCase())&&this.emit("confirm","y"===t.toLowerCase())," "===t&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),t&&this.emit("key",t.toLowerCase()),e?.name==="return"){if(this.opts.validate){let t=this.opts.validate(this.value);t&&(this.error=t instanceof Error?t.message:t,this.state="error",this.rl?.write(this.value))}"error"!==this.state&&(this.state="submit")}U([t,e?.name,e?.sequence],"cancel")&&(this.state="cancel"),("submit"===this.state||"cancel"===this.state)&&this.emit("finalize"),this.render(),("submit"===this.state||"cancel"===this.state)&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
30
- `),J(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let t=L(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
31
- `).length-1;this.output.write(b.cursor.move(-999,-1*t))}render(){let t=L(this._render(this)??"",process.stdout.columns,{hard:!0});if(t!==this._prevFrame){if("initial"===this.state)this.output.write(b.cursor.hide);else{let e=function(t,e){if(t===e)return;let u=t.split(`
32
- `),i=e.split(`
33
- `),D=[];for(let t=0;t<Math.max(u.length,i.length);t++)u[t]!==i[t]&&D.push(t);return D}(this._prevFrame,t);if(this.restoreCursor(),e&&e?.length===1){let u=e[0];this.output.write(b.cursor.move(0,u)),this.output.write(b.erase.lines(1));let i=t.split(`
34
- `);this.output.write(i[u]),this._prevFrame=t,this.output.write(b.cursor.move(0,i.length-u-1));return}if(e&&e?.length>1){let u=e[0];this.output.write(b.cursor.move(0,u)),this.output.write(b.erase.down());let i=t.split(`
35
- `).slice(u);this.output.write(i.join(`
36
- `)),this._prevFrame=t;return}this.output.write(b.erase.down())}this.output.write(t),"initial"===this.state&&(this.state="active"),this._prevFrame=t}}}class X extends Q{get cursor(){return+!this.value}get _value(){return 0===this.cursor}constructor(t){super(t,!1),this.value=!!t.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",t=>{this.output.write(b.cursor.move(0,-1)),this.value=t,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}}new WeakMap;class tt extends Q{get valueWithCursor(){if("submit"===this.state)return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;let t=this.value.slice(0,this.cursor),[e,...u]=this.value.slice(this.cursor);return`${t}${A.inverse(e)}${u.join("")}`}get cursor(){return this._cursor}constructor(t){super(t),this.on("finalize",()=>{this.value||(this.value=t.defaultValue)})}}let te="win32"!==E.default.platform?"linux"!==E.default.env.TERM:!!E.default.env.CI||!!E.default.env.WT_SESSION||!!E.default.env.TERMINUS_SUBLIME||"{cmd::Cmder}"===E.default.env.ConEmuTask||"Terminus-Sublime"===E.default.env.TERM_PROGRAM||"vscode"===E.default.env.TERM_PROGRAM||"xterm-256color"===E.default.env.TERM||"alacritty"===E.default.env.TERM||"JetBrains-JediTerm"===E.default.env.TERMINAL_EMULATOR,tu=(t,e)=>te?t:e,ti=tu("◆","*"),tD=tu("■","x"),tr=tu("▲","x"),ts=tu("◇","o"),tn=tu("┌","T"),to=tu("│","|"),ta=tu("└","—"),tl=tu("●",">"),th=tu("○"," "),tp=(tu("◻","[•]"),tu("◼","[+]"),tu("◻","[ ]"),tu("▪","•"),tu("─","-")),tm=tu("╮","+"),tc=tu("├","+"),td=tu("╯","+"),tC=tu("●","•"),tF=tu("◆","*"),tg=tu("▲","!"),tE=tu("■","x"),tf=t=>{switch(t){case"initial":case"active":return A.cyan(ti);case"cancel":return A.red(tD);case"error":return A.yellow(tr);case"submit":return A.green(ts)}},t_=t=>new tt({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){let e=`${A.gray(to)}
37
- ${tf(this.state)} ${t.message}
38
- `,u=t.placeholder?A.inverse(t.placeholder[0])+A.dim(t.placeholder.slice(1)):A.inverse(A.hidden("_")),i=this.value?this.valueWithCursor:u;switch(this.state){case"error":return`${e.trim()}
39
- ${A.yellow(to)} ${i}
40
- ${A.yellow(ta)} ${A.yellow(this.error)}
41
- `;case"submit":return`${e}${A.gray(to)} ${A.dim(this.value||t.placeholder)}`;case"cancel":return`${e}${A.gray(to)} ${A.strikethrough(A.dim(this.value??""))}${this.value?.trim()?`
42
- ${A.gray(to)}`:""}`;default:return`${e}${A.cyan(to)} ${i}
43
- ${A.cyan(ta)}
44
- `}}}).prompt(),tb=t=>{let e=t.active??"Yes",u=t.inactive??"No";return new X({active:e,inactive:u,initialValue:t.initialValue??!0,render(){let i=`${A.gray(to)}
45
- ${tf(this.state)} ${t.message}
46
- `,D=this.value?e:u;switch(this.state){case"submit":return`${i}${A.gray(to)} ${A.dim(D)}`;case"cancel":return`${i}${A.gray(to)} ${A.strikethrough(A.dim(D))}
47
- ${A.gray(to)}`;default:return`${i}${A.cyan(to)} ${this.value?`${A.green(tl)} ${e}`:`${A.dim(th)} ${A.dim(e)}`} ${A.dim("/")} ${this.value?`${A.dim(th)} ${A.dim(u)}`:`${A.green(tl)} ${u}`}
48
- ${A.cyan(ta)}
49
- `}}}).prompt()},tA=(t="")=>{process.stdout.write(`${A.gray(to)}
50
- ${A.gray(ta)} ${t}
51
-
52
- `)},tB={message:(t="",{symbol:e=A.gray(to)}={})=>{let u=[`${A.gray(to)}`];if(t){let[i,...D]=t.split(`
53
- `);u.push(`${e} ${i}`,...D.map(t=>`${A.gray(to)} ${t}`))}process.stdout.write(`${u.join(`
37
+ `).map(t=>((t,e,i={})=>{if(!1!==i.trim&&""===t.trim())return"";let s="",r,n,o=t.split(" "),a=o.map(t=>x(t)),l=[""];for(let[t,s]of o.entries()){!1!==i.trim&&(l[l.length-1]=(l.at(-1)??"").trimStart());let r=x(l.at(-1)??"");if(0!==t&&(r>=e&&(!1===i.wordWrap||!1===i.trim)&&(l.push(""),r=0),(r>0||!1===i.trim)&&(l[l.length-1]+=" ",r++)),i.hard&&a[t]>e){let i=e-r,n=1+Math.floor((a[t]-i-1)/e);Math.floor((a[t]-1)/e)<n&&l.push(""),A(l,s,e);continue}if(r+a[t]>e&&r>0&&a[t]>0){if(!1===i.wordWrap&&r<e){A(l,s,e);continue}l.push("")}if(r+a[t]>e&&!1===i.wordWrap){A(l,s,e);continue}l[l.length-1]+=s}!1!==i.trim&&(l=l.map(t=>(t=>{let e=t.split(" "),i=e.length;for(;i>0&&!(x(e[i-1])>0);)i--;return i===e.length?t:e.slice(0,i).join(" ")+e.slice(i).join("")})(t)));let h=l.join(`
38
+ `),u=h[Symbol.iterator](),p=u.next(),m=u.next(),d=0;for(;!p.done;){let t=p.value,e=m.value;if(s+=t,"\x1b"===t||"\x9b"===t){y.lastIndex=d+1;let t=y.exec(h)?.groups;if(t?.code!==void 0){let e=Number.parseFloat(t.code);r=39===e?void 0:e}else t?.uri!==void 0&&(n=0===t.uri.length?void 0:t.uri)}let i=r?O(r):void 0;e===`
39
+ `?(n&&(s+=$("")),r&&i&&(s+=C(i))):t===`
40
+ `&&(r&&i&&(s+=C(r)),n&&(s+=$(n))),d+=t.length,p=m,m=u.next()}return s})(t,e,i)).join(`
41
+ `)}let k={actions:new Set(["up","down","left","right","space","enter","cancel"]),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0};function S(t,e){if("string"==typeof t)return k.aliases.get(t)===e;for(let i of t)if(void 0!==i&&S(i,e))return!0;return!1}let j=globalThis.process.platform.startsWith("win"),T=Symbol("clack:cancel");function I(t){return t===T}function H(t,e){t.isTTY&&t.setRawMode(e)}function M({input:t=r.stdin,output:e=r.stdout,overwrite:i=!0,hideCursor:s=!0}={}){let l=n.createInterface({input:t,output:e,prompt:"",tabSize:1});n.emitKeypressEvents(t,l),t instanceof a.ReadStream&&t.isTTY&&t.setRawMode(!0);let h=(r,{name:a,sequence:l})=>{if(S([String(r),a,l],"cancel")){s&&e.write(o.cursor.show),process.exit(0);return}i&&n.moveCursor(e,"return"===a?0:-1,"return"===a?-1:0,()=>{n.clearLine(e,1,()=>{t.once("keypress",h)})})};return s&&e.write(o.cursor.hide),t.once("keypress",h),()=>{t.off("keypress",h),s&&e.write(o.cursor.show),t instanceof a.ReadStream&&t.isTTY&&!j&&t.setRawMode(!1),l.terminal=!1,l.close()}}let V=t=>"columns"in t&&"number"==typeof t.columns?t.columns:80;class F{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;state="initial";error="";value;userInput="";constructor(t,e=!0){let{input:i=r.stdin,output:s=r.stdout,render:n,signal:o,...a}=t;this.opts=a,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=n.bind(this),this._track=e,this._abortSignal=o,this.input=i,this.output=s}unsubscribe(){this._subscribers.clear()}setSubscriber(t,e){let i=this._subscribers.get(t)??[];i.push(e),this._subscribers.set(t,i)}on(t,e){this.setSubscriber(t,{cb:e})}once(t,e){this.setSubscriber(t,{cb:e,once:!0})}emit(t,...e){let i=this._subscribers.get(t)??[],s=[];for(let t of i)t.cb(...e),t.once&&s.push(()=>i.splice(i.indexOf(t),1));for(let t of s)t()}prompt(){return new Promise(t=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),t(T);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}this.rl=n.default.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),void 0!==this.opts.initialUserInput&&this._setUserInput(this.opts.initialUserInput,!0),this.input.on("keypress",this.onKeypress),H(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(o.cursor.show),this.output.off("resize",this.render),H(this.input,!1),t(this.value)}),this.once("cancel",()=>{this.output.write(o.cursor.show),this.output.off("resize",this.render),H(this.input,!1),t(T)})})}_isActionKey(t,e){return" "===t}_setValue(t){this.value=t,this.emit("value",this.value)}_setUserInput(t,e){this.userInput=t??"",this.emit("userInput",this.userInput),e&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}_clearUserInput(){this.rl?.write(null,{ctrl:!0,name:"u"}),this._setUserInput("")}onKeypress(t,e){if(this._track&&"return"!==e.name&&(e.name&&this._isActionKey(t,e)&&this.rl?.write(null,{ctrl:!0,name:"h"}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),"error"===this.state&&(this.state="active"),e?.name&&(!this._track&&k.aliases.has(e.name)&&this.emit("cursor",k.aliases.get(e.name)),k.actions.has(e.name)&&this.emit("cursor",e.name)),t&&("y"===t.toLowerCase()||"n"===t.toLowerCase())&&this.emit("confirm","y"===t.toLowerCase()),this.emit("key",t?.toLowerCase(),e),e?.name==="return"){if(this.opts.validate){let t=this.opts.validate(this.value);t&&(this.error=t instanceof Error?t.message:t,this.state="error",this.rl?.write(this.userInput))}"error"!==this.state&&(this.state="submit")}S([t,e?.name,e?.sequence],"cancel")&&(this.state="cancel"),("submit"===this.state||"cancel"===this.state)&&this.emit("finalize"),this.render(),("submit"===this.state||"cancel"===this.state)&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
42
+ `),H(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let t=E(this._prevFrame,process.stdout.columns,{hard:!0,trim:!1}).split(`
43
+ `).length-1;this.output.write(o.cursor.move(-999,-1*t))}render(){let t=E(this._render(this)??"",process.stdout.columns,{hard:!0,trim:!1});if(t!==this._prevFrame){if("initial"===this.state)this.output.write(o.cursor.hide);else{let e,i=function(t,e){if(t===e)return;let i=t.split(`
44
+ `),s=e.split(`
45
+ `),r=Math.max(i.length,s.length),n=[];for(let t=0;t<r;t++)i[t]!==s[t]&&n.push(t);return{lines:n,numLinesBefore:i.length,numLinesAfter:s.length,numLines:r}}(this._prevFrame,t),s="rows"in(e=this.output)&&"number"==typeof e.rows?e.rows:20;if(this.restoreCursor(),i){let e=Math.max(0,i.numLinesAfter-s),r=Math.max(0,i.numLinesBefore-s),n=i.lines.find(t=>t>=e);if(void 0===n){this._prevFrame=t;return}if(1===i.lines.length){this.output.write(o.cursor.move(0,n-r)),this.output.write(o.erase.lines(1));let e=t.split(`
46
+ `);this.output.write(e[n]),this._prevFrame=t,this.output.write(o.cursor.move(0,e.length-n-1));return}if(i.lines.length>1){if(e<r)n=e;else{let t=n-r;t>0&&this.output.write(o.cursor.move(0,t))}this.output.write(o.erase.down());let i=t.split(`
47
+ `).slice(n);this.output.write(i.join(`
48
+ `)),this._prevFrame=t;return}}this.output.write(o.erase.down())}this.output.write(t),"initial"===this.state&&(this.state="active"),this._prevFrame=t}}}class W extends F{get cursor(){return+!this.value}get _value(){return 0===this.cursor}constructor(t){super(t,!1),this.value=!!t.initialValue,this.on("userInput",()=>{this.value=this._value}),this.on("confirm",t=>{this.output.write(o.cursor.move(0,-1)),this.value=t,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}}class G extends F{get userInputWithCursor(){if("submit"===this.state)return this.userInput;let t=this.userInput;if(this.cursor>=t.length)return`${this.userInput}\u2588`;let e=t.slice(0,this.cursor),[i,...r]=t.slice(this.cursor);return`${e}${s.inverse(i)}${r.join("")}`}get cursor(){return this._cursor}constructor(t){super({...t,initialUserInput:t.initialUserInput??t.initialValue}),this.on("userInput",t=>{this._setValue(t)}),this.on("finalize",()=>{this.value||(this.value=t.defaultValue),void 0===this.value&&(this.value="")})}}},"../../node_modules/@clack/prompts/dist/index.mjs"(t,e,i){i.d(e,{FZ:()=>s.FZ,Lv:()=>Q,Md:()=>X,N4:()=>te,Os:()=>K,Qq:()=>tr,Rm:()=>Y,ZT:()=>Z,lJ:()=>J,u1:()=>ts});var s=i("../../node_modules/@clack/core/dist/index.mjs"),r=i("../../node_modules/picocolors/picocolors.js"),n=i("node:process");i("node:fs"),i("node:path");var o=i("../../node_modules/sisteransi/src/index.js");i("node:util");let a="win32"!==n.default.platform?"linux"!==n.default.env.TERM:!!n.default.env.CI||!!n.default.env.WT_SESSION||!!n.default.env.TERMINUS_SUBLIME||"{cmd::Cmder}"===n.default.env.ConEmuTask||"Terminus-Sublime"===n.default.env.TERM_PROGRAM||"vscode"===n.default.env.TERM_PROGRAM||"xterm-256color"===n.default.env.TERM||"alacritty"===n.default.env.TERM||"JetBrains-JediTerm"===n.default.env.TERMINAL_EMULATOR,l=(t,e)=>a?t:e,h=l("◆","*"),u=l("■","x"),p=l("▲","x"),m=l("◇","o"),d=l("┌","T"),c=l("│","|"),g=l("└","—"),f=(l("┐","T"),l("┘","—"),l("●",">")),_=l("○"," "),b=(l("◻","[•]"),l("◼","[+]"),l("◻","[ ]"),l("▪","•"),l("─","-")),v=l("╮","+"),x=l("├","+"),w=l("╯","+"),y=l("╰","+"),O=(l("╭","+"),l("●","•")),C=l("◆","*"),$=l("▲","!"),A=l("■","x"),E=t=>{switch(t){case"initial":case"active":return r.cyan(h);case"cancel":return r.red(u);case"error":return r.yellow(p);case"submit":return r.green(m)}},k=t=>161===t||164===t||167===t||168===t||170===t||173===t||174===t||t>=176&&t<=180||t>=182&&t<=186||t>=188&&t<=191||198===t||208===t||215===t||216===t||t>=222&&t<=225||230===t||t>=232&&t<=234||236===t||237===t||240===t||242===t||243===t||t>=247&&t<=250||252===t||254===t||257===t||273===t||275===t||283===t||294===t||295===t||299===t||t>=305&&t<=307||312===t||t>=319&&t<=322||324===t||t>=328&&t<=331||333===t||338===t||339===t||358===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===t||t>=713&&t<=715||717===t||720===t||t>=728&&t<=731||733===t||735===t||t>=768&&t<=879||t>=913&&t<=929||t>=931&&t<=937||t>=945&&t<=961||t>=963&&t<=969||1025===t||t>=1040&&t<=1103||1105===t||8208===t||t>=8211&&t<=8214||8216===t||8217===t||8220===t||8221===t||t>=8224&&t<=8226||t>=8228&&t<=8231||8240===t||8242===t||8243===t||8245===t||8251===t||8254===t||8308===t||8319===t||t>=8321&&t<=8324||8364===t||8451===t||8453===t||8457===t||8467===t||8470===t||8481===t||8482===t||8486===t||8491===t||8531===t||8532===t||t>=8539&&t<=8542||t>=8544&&t<=8555||t>=8560&&t<=8569||8585===t||t>=8592&&t<=8601||8632===t||8633===t||8658===t||8660===t||8679===t||8704===t||8706===t||8707===t||8711===t||8712===t||8715===t||8719===t||8721===t||8725===t||8730===t||t>=8733&&t<=8736||8739===t||8741===t||t>=8743&&t<=8748||8750===t||t>=8756&&t<=8759||8764===t||8765===t||8776===t||8780===t||8786===t||8800===t||8801===t||t>=8804&&t<=8807||8810===t||8811===t||8814===t||8815===t||8834===t||8835===t||8838===t||8839===t||8853===t||8857===t||8869===t||8895===t||8978===t||t>=9312&&t<=9449||t>=9451&&t<=9547||t>=9552&&t<=9587||t>=9600&&t<=9615||t>=9618&&t<=9621||9632===t||9633===t||t>=9635&&t<=9641||9650===t||9651===t||9654===t||9655===t||9660===t||9661===t||9664===t||9665===t||t>=9670&&t<=9672||9675===t||t>=9678&&t<=9681||t>=9698&&t<=9701||9711===t||9733===t||9734===t||9737===t||9742===t||9743===t||9756===t||9758===t||9792===t||9794===t||9824===t||9825===t||t>=9827&&t<=9829||t>=9831&&t<=9834||9836===t||9837===t||9839===t||9886===t||9887===t||9919===t||t>=9926&&t<=9933||t>=9935&&t<=9939||t>=9941&&t<=9953||9955===t||9960===t||9961===t||t>=9963&&t<=9969||9972===t||t>=9974&&t<=9977||9979===t||9980===t||9982===t||9983===t||10045===t||t>=10102&&t<=10111||t>=11094&&t<=11097||t>=12872&&t<=12879||t>=57344&&t<=63743||t>=65024&&t<=65039||65533===t||t>=127232&&t<=127242||t>=127248&&t<=127277||t>=127280&&t<=127337||t>=127344&&t<=127373||127375===t||127376===t||t>=127387&&t<=127404||t>=917760&&t<=917999||t>=983040&&t<=1048573||t>=1048576&&t<=1114109,S=t=>12288===t||t>=65281&&t<=65376||t>=65504&&t<=65510,j=t=>t>=4352&&t<=4447||8986===t||8987===t||9001===t||9002===t||t>=9193&&t<=9196||9200===t||9203===t||9725===t||9726===t||9748===t||9749===t||t>=9800&&t<=9811||9855===t||9875===t||9889===t||9898===t||9899===t||9917===t||9918===t||9924===t||9925===t||9934===t||9940===t||9962===t||9970===t||9971===t||9973===t||9978===t||9981===t||9989===t||9994===t||9995===t||10024===t||10060===t||10062===t||t>=10067&&t<=10069||10071===t||t>=10133&&t<=10135||10160===t||10175===t||11035===t||11036===t||11088===t||11093===t||t>=11904&&t<=11929||t>=11931&&t<=12019||t>=12032&&t<=12245||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12353&&t<=12438||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12771||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=19903||t>=19968&&t<=42124||t>=42128&&t<=42182||t>=43360&&t<=43388||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=94176&&t<=94180||94192===t||94193===t||t>=94208&&t<=100343||t>=100352&&t<=101589||t>=101632&&t<=101640||t>=110576&&t<=110579||t>=110581&&t<=110587||110589===t||110590===t||t>=110592&&t<=110882||110898===t||t>=110928&&t<=110930||110933===t||t>=110948&&t<=110951||t>=110960&&t<=111355||126980===t||127183===t||127374===t||t>=127377&&t<=127386||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||127568===t||127569===t||t>=127584&&t<=127589||t>=127744&&t<=127776||t>=127789&&t<=127797||t>=127799&&t<=127868||t>=127870&&t<=127891||t>=127904&&t<=127946||t>=127951&&t<=127955||t>=127968&&t<=127984||127988===t||t>=127992&&t<=128062||128064===t||t>=128066&&t<=128252||t>=128255&&t<=128317||t>=128331&&t<=128334||t>=128336&&t<=128359||128378===t||128405===t||128406===t||128420===t||t>=128507&&t<=128591||t>=128640&&t<=128709||128716===t||t>=128720&&t<=128722||t>=128725&&t<=128727||t>=128732&&t<=128735||128747===t||128748===t||t>=128756&&t<=128764||t>=128992&&t<=129003||129008===t||t>=129292&&t<=129338||t>=129340&&t<=129349||t>=129351&&t<=129535||t>=129648&&t<=129660||t>=129664&&t<=129672||t>=129680&&t<=129725||t>=129727&&t<=129733||t>=129742&&t<=129755||t>=129760&&t<=129768||t>=129776&&t<=129784||t>=131072&&t<=196605||t>=196608&&t<=262141,T=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,I=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,H=/\t{1,1000}/y,M=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,V=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,F=/\p{M}+/gu,W={limit:1/0,ellipsis:""},G=(t,e={},i={})=>{let s=e.limit??1/0,r=e.ellipsis??"",n=e?.ellipsisWidth??(r?G(r,W,i).width:0),o=i.ansiWidth??0,a=i.controlWidth??0,l=i.tabWidth??8,h=i.ambiguousWidth??1,u=i.emojiWidth??2,p=i.fullWidthWidth??2,m=i.regularWidth??1,d=i.wideWidth??2,c=0,g=0,f=t.length,_=0,b=!1,v=f,x=Math.max(0,s-n),w=0,y=0,O=0,C=0;t:for(;;){if(y>w||g>=f&&g>c){for(let e of(_=0,(t.slice(w,y)||t.slice(c,g)).replaceAll(F,""))){let t=e.codePointAt(0)||0;if(O+(C=S(t)?p:j(t)?d:h!==m&&k(t)?h:m)>x&&(v=Math.min(v,Math.max(w,c)+_)),O+C>s){b=!0;break t}_+=e.length,O+=C}w=y=0}if(g>=f)break;if(V.lastIndex=g,V.test(t)){if(O+(C=(_=V.lastIndex-g)*m)>x&&(v=Math.min(v,g+Math.floor((x-O)/m))),O+C>s){b=!0;break}O+=C,w=c,y=g,g=c=V.lastIndex;continue}if(T.lastIndex=g,T.test(t)){if(O+o>x&&(v=Math.min(v,g)),O+o>s){b=!0;break}O+=o,w=c,y=g,g=c=T.lastIndex;continue}if(I.lastIndex=g,I.test(t)){if(O+(C=(_=I.lastIndex-g)*a)>x&&(v=Math.min(v,g+Math.floor((x-O)/a))),O+C>s){b=!0;break}O+=C,w=c,y=g,g=c=I.lastIndex;continue}if(H.lastIndex=g,H.test(t)){if(O+(C=(_=H.lastIndex-g)*l)>x&&(v=Math.min(v,g+Math.floor((x-O)/l))),O+C>s){b=!0;break}O+=C,w=c,y=g,g=c=H.lastIndex;continue}if(M.lastIndex=g,M.test(t)){if(O+u>x&&(v=Math.min(v,g)),O+u>s){b=!0;break}O+=u,w=c,y=g,g=c=M.lastIndex;continue}g+=1}return{width:b?x:O,index:b?v:f,truncated:b,ellipsed:b&&s>=n}},P={limit:1/0,ellipsis:"",ellipsisWidth:0},N=(t,e={})=>G(t,P,e).width,R="]8;;",D=RegExp(`(?:\\[(?<code>\\d+)m|\\${R}(?<uri>.*)\x07)`,"y"),L=t=>t>=30&&t<=37||t>=90&&t<=97?39:t>=40&&t<=47||t>=100&&t<=107?49:1===t||2===t?22:3===t?23:4===t?24:7===t?27:8===t?28:9===t?29:0===t?0:void 0,B=t=>`\x1b[${t}m`,q=t=>`\x1b${R}${t}\x07`,U=(t,e,i)=>{let s=e[Symbol.iterator](),r=!1,n=!1,o=t.at(-1),a=void 0===o?0:N(o),l=s.next(),h=s.next(),u=0;for(;!l.done;){let o=l.value,p=N(o);a+p<=i?t[t.length-1]+=o:(t.push(o),a=0),("\x1b"===o||"\x9b"===o)&&(r=!0,n=e.startsWith(R,u+1)),r?n?"\x07"===o&&(r=!1,n=!1):"m"===o&&(r=!1):(a+=p)!==i||h.done||(t.push(""),a=0),l=h,h=s.next(),u+=o.length}o=t.at(-1),!a&&void 0!==o&&o.length>0&&t.length>1&&(t[t.length-2]+=t.pop())};function z(t,e,i){return String(t).normalize().replaceAll(`\r
49
+ `,`
50
+ `).split(`
51
+ `).map(t=>((t,e,i={})=>{if(!1!==i.trim&&""===t.trim())return"";let s="",r,n,o=t.split(" "),a=o.map(t=>N(t)),l=[""];for(let[t,s]of o.entries()){!1!==i.trim&&(l[l.length-1]=(l.at(-1)??"").trimStart());let r=N(l.at(-1)??"");if(0!==t&&(r>=e&&(!1===i.wordWrap||!1===i.trim)&&(l.push(""),r=0),(r>0||!1===i.trim)&&(l[l.length-1]+=" ",r++)),i.hard&&a[t]>e){let i=e-r,n=1+Math.floor((a[t]-i-1)/e);Math.floor((a[t]-1)/e)<n&&l.push(""),U(l,s,e);continue}if(r+a[t]>e&&r>0&&a[t]>0){if(!1===i.wordWrap&&r<e){U(l,s,e);continue}l.push("")}if(r+a[t]>e&&!1===i.wordWrap){U(l,s,e);continue}l[l.length-1]+=s}!1!==i.trim&&(l=l.map(t=>(t=>{let e=t.split(" "),i=e.length;for(;i>0&&!(N(e[i-1])>0);)i--;return i===e.length?t:e.slice(0,i).join(" ")+e.slice(i).join("")})(t)));let h=l.join(`
52
+ `),u=h[Symbol.iterator](),p=u.next(),m=u.next(),d=0;for(;!p.done;){let t=p.value,e=m.value;if(s+=t,"\x1b"===t||"\x9b"===t){D.lastIndex=d+1;let t=D.exec(h)?.groups;if(t?.code!==void 0){let e=Number.parseFloat(t.code);r=39===e?void 0:e}else t?.uri!==void 0&&(n=0===t.uri.length?void 0:t.uri)}let i=r?L(r):void 0;e===`
53
+ `?(n&&(s+=q("")),r&&i&&(s+=B(i))):t===`
54
+ `&&(r&&i&&(s+=B(r)),n&&(s+=q(n))),d+=t.length,p=m,m=u.next()}return s})(t,e,i)).join(`
55
+ `)}let J=t=>{let e=t.active??"Yes",i=t.inactive??"No";return new s.jz({active:e,inactive:i,signal:t.signal,input:t.input,output:t.output,initialValue:t.initialValue??!0,render(){let n=t.withGuide??s.W0.withGuide,o=`${n?`${r.gray(c)}
56
+ `:""}${E(this.state)} ${t.message}
57
+ `,a=this.value?e:i;switch(this.state){case"submit":{let t=n?`${r.gray(c)} `:"";return`${o}${t}${r.dim(a)}`}case"cancel":{let t=n?`${r.gray(c)} `:"";return`${o}${t}${r.strikethrough(r.dim(a))}${n?`
58
+ ${r.gray(c)}`:""}`}default:{let s=n?`${r.cyan(c)} `:"",a=n?r.cyan(g):"";return`${o}${s}${this.value?`${r.green(f)} ${e}`:`${r.dim(_)} ${r.dim(e)}`}${t.vertical?n?`
59
+ ${r.cyan(c)} `:`
60
+ `:` ${r.dim("/")} `}${this.value?`${r.dim(_)} ${r.dim(i)}`:`${r.green(f)} ${i}`}
61
+ ${a}
62
+ `}}}}).prompt()},K=async(t,e)=>{let i={};for(let r of Object.keys(t)){let n=t[r],o=await n({results:i})?.catch(t=>{throw t});if("function"==typeof e?.onCancel&&(0,s.FZ)(o)){i[r]="canceled",e.onCancel({results:i});continue}i[r]=o}return i},Y={message:(t=[],{symbol:e=r.gray(c),secondarySymbol:i=r.gray(c),output:n=process.stdout,spacing:o=1,withGuide:a}={})=>{let l=[],h=a??s.W0.withGuide,u=h?i:"",p=h?`${e} `:"",m=h?`${i} `:"";for(let t=0;t<o;t++)l.push(u);let d=Array.isArray(t)?t:t.split(`
63
+ `);if(d.length>0){let[t,...s]=d;for(let r of(t.length>0?l.push(`${p}${t}`):l.push(h?e:""),s))r.length>0?l.push(`${m}${r}`):l.push(h?i:"")}n.write(`${l.join(`
54
64
  `)}
55
- `)},info:t=>{tB.message(t,{symbol:A.blue(tC)})},success:t=>{tB.message(t,{symbol:A.green(tF)})},step:t=>{tB.message(t,{symbol:A.green(ts)})},warn:t=>{tB.message(t,{symbol:A.yellow(tg)})},warning:t=>{tB.warn(t)},error:t=>{tB.message(t,{symbol:A.red(tE)})}},tv=(A.gray(to),({indicator:t="dots"}={})=>{let e=te?["◒","◐","◓","◑"]:["•","o","O","0"],u=te?80:120,i="true"===process.env.CI,D,r,s=!1,n="",p,m=performance.now(),c=t=>{s&&f(t>1?"Something went wrong":"Canceled",t)},d=()=>c(2),C=()=>c(1),F=()=>{if(void 0===p)return;i&&process.stdout.write(`
56
- `);let t=p.split(`
57
- `);process.stdout.write(b.cursor.move(-999,t.length-1)),process.stdout.write(b.erase.down(t.length))},g=t=>{let e=(performance.now()-t)/1e3,u=Math.floor(e/60),i=Math.floor(e%60);return u>0?`[${u}m ${i}s]`:`[${i}s]`},f=(e="",u=0)=>{s=!1,clearInterval(r),F();let i=0===u?A.green(ts):1===u?A.red(tD):A.red(tr);n=(e??n).replace(/\.+$/,""),"timer"===t?process.stdout.write(`${i} ${n} ${g(m)}
58
- `):process.stdout.write(`${i} ${n}
59
- `),process.removeListener("uncaughtExceptionMonitor",d),process.removeListener("unhandledRejection",d),process.removeListener("SIGINT",C),process.removeListener("SIGTERM",C),process.removeListener("exit",c),D()};return{start:(f="")=>{s=!0,D=function({input:t=E.stdin,output:e=E.stdout,overwrite:u=!0,hideCursor:i=!0}={}){let D=a({input:t,output:e,prompt:"",tabSize:1});l(t,D),t.isTTY&&t.setRawMode(!0);let r=(D,{name:s,sequence:n})=>{if(U([String(D),s,n],"cancel")){i&&e.write(b.cursor.show),process.exit(0);return}u&&h(e,"return"===s?0:-1,"return"===s?-1:0,()=>{o(e,1,()=>{t.once("keypress",r)})})};return i&&e.write(b.cursor.hide),t.once("keypress",r),()=>{t.off("keypress",r),i&&e.write(b.cursor.show),t.isTTY&&!z&&t.setRawMode(!1),D.terminal=!1,D.close()}}(),n=f.replace(/\.+$/,""),m=performance.now(),process.stdout.write(`${A.gray(to)}
60
- `);let _=0,B=0;process.on("uncaughtExceptionMonitor",d),process.on("unhandledRejection",d),process.on("SIGINT",C),process.on("SIGTERM",C),process.on("exit",c),r=setInterval(()=>{if(i&&n===p)return;F(),p=n;let u=A.magenta(e[_]);if(i)process.stdout.write(`${u} ${n}...`);else if("timer"===t)process.stdout.write(`${u} ${n} ${g(m)}`);else{let t=".".repeat(Math.floor(B)).slice(0,3);process.stdout.write(`${u} ${n}${t}`)}_=_+1<e.length?_+1:0,B=B<e.length?B+.125:0},u)},stop:f,message:(t="")=>{n=(t??n).replace(/\.+$/,"")}}}),tx=async(t,e)=>{let u={};for(let i of Object.keys(t)){let D=t[i],r=await D({results:u})?.catch(t=>{throw t});if("function"==typeof e?.onCancel&&r===Y){u[i]="canceled",e.onCancel({results:u});continue}u[i]=r}return u};var tw=d("node:fs"),ty=d("node:path");let tO=async t=>{let e=tv(),u=(0,ty.resolve)(E.default.cwd(),t);return e.start(`Creating a React App in ${B().green(u)}.`),(0,tw.mkdirSync)(u),await _("npm",["init","-y"],{cwd:u}),e.stop(`React App created in ${B().green(u)}.`),{repoDir:u}},t$=t=>(t===Y&&(((t="")=>{process.stdout.write(`${A.gray(ta)} ${A.red(t)}
61
-
62
- `)})("Operation cancelled."),C()),t),tk=t=>"string"==typeof t&&/^(@[a-z0-9-~][a-z0-9-._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/.test(t)?(0,tw.existsSync)((0,ty.resolve)(E.default.cwd(),t))?`The directory ${B().green(t)} already exists.
63
- Either try using a new directory name, or remove the files listed above.`:"":`The project name '${t}' is not valid.
65
+ `)},info:(t,e)=>{Y.message(t,{...e,symbol:r.blue(O)})},success:(t,e)=>{Y.message(t,{...e,symbol:r.green(C)})},step:(t,e)=>{Y.message(t,{...e,symbol:r.green(m)})},warn:(t,e)=>{Y.message(t,{...e,symbol:r.yellow($)})},warning:(t,e)=>{Y.warn(t,e)},error:(t,e)=>{Y.message(t,{...e,symbol:r.red(A)})}},Z=(t="",e)=>{(e?.output??process.stdout).write(`${r.gray(g)} ${r.red(t)}
64
66
 
65
- A valid npm project name must start with a lowercase letter, a number, a hyphen, or a tilde, and can include dots, hyphens, tildes, or underscores.
67
+ `)},Q=(t="",e)=>{(e?.output??process.stdout).write(`${r.gray(d)} ${t}
68
+ `)},X=(t="",e)=>{(e?.output??process.stdout).write(`${r.gray(c)}
69
+ ${r.gray(g)} ${t}
66
70
 
67
- If the project name starts with '@', it must be followed by a valid scope name and a '/'.`,tS=t=>"string"==typeof t&&/^(@[a-z0-9-~][a-z0-9-._~]*\/)?[a-z0-9-~][a-z0-9-._~]*(?:@[^\s@][^\s]*)?$/.test(t)?"":`The template name '${t}' is not valid.`,tT=async({projectName:t,skipDepInstall:e,skipGitInit:u,template:i})=>({projectName:t||t$(await t_({message:"What is the name of your project?",placeholder:"my-project",validate:tk})).toString(),skipDepInstall:e||!!t$(await tb({message:"Do you want to skip installing dependencies (npm install)?",initialValue:!1})),skipGitInit:u||!!t$(await tb({message:"Do you want to skip initializing a git repository?",initialValue:!1})),template:i||t$((await tx({useCustomTemplate:async()=>!!await tb({message:"Do you want to use a custom template?",initialValue:!1}),template:async({results:t})=>t.useCustomTemplate?(await t_({message:"Enter the custom template name (e.g., @pplancq/react-template):",placeholder:"@pplancq/react-template",validate:tS})).toString():"@pplancq/react-template"})).template)}),{program:tH,createCommand:tV,createArgument:tj,createOption:tM,CommanderError:tG,InvalidArgumentError:tW,InvalidOptionArgumentError:tP,Command:tI,Argument:tN,Option:tR,Help:tL}=d("../../node_modules/commander/index.js");var tq=JSON.parse('{"UU":"@pplancq/create-react-app","rE":"2.0.3"}');let tU=async(t,e)=>{if(e)return;let u=tv();u.start("Creating git commit."),await _("git",["add","."],{cwd:t}),await _("git",["commit","--no-verify","--message",'"Initial commit"'],{cwd:t}),u.stop("Git commit created.")},tz=async(t,e)=>{if(e)return;let u=tv();u.start("Initializing git repository."),await _("git",["init","--initial-branch=main"],{cwd:t}),u.stop("Git repository initialized.")},tY=async(t,e)=>{if(e)return;let u=tv();u.start("Installing packages. This might take a couple of minutes."),await _("npm",["install"],{cwd:t}),u.stop("Packages installed.")},tJ=async(t,e)=>{let u=tv(),i=(0,ty.resolve)(t,`node_modules/${e}`);u.start(`Installing react template from ${B().green(e)}. This might take a couple of minutes.`),await _("npm",["install",e,"--install-strategy=nested"],{cwd:t}),(0,tw.cpSync)(i,t,{recursive:!0,dereference:!0}),(0,tw.rmSync)(`${t}/package-lock.json`),(0,tw.rmSync)(`${t}/node_modules`,{recursive:!0}),u.stop("React template installed.")},tK=async(t,e)=>{let u=tv(),i=!1,D=JSON.parse((0,tw.readFileSync)((0,ty.resolve)(e,"package.json"),{encoding:"utf-8"}));if(D?.bin?.["template-install"]===void 0)return void tB.warn("No post install template script found.");u.start("Running post install template script...");try{await _("npx",["template-install",t],{cwd:e})}catch(t){if(i=!0,!(t instanceof F))throw t;tB.error("Failed to run template-install command")}finally{u.stop(i?"Failed to run post install template script.":"Post install template script finished.")}};class tZ extends Error{constructor(t){super(t),this.name="InvalidProjectNameError"}}class tQ extends Error{constructor(t){super(t),this.name="InvalidTemplateNameError"}}(async()=>{let t,e=(t={},new tI(tq.UU).argument("[project-name]","The name of the project to create.").option("-t, --template <template>","Specify a template for the project.").option("--skip-dep-install","Skip installing dependencies (npm install).").option("--skip-git-init","Skip initializing a git repository.").version(tq.rE,"-v, --version").name(B().green("create-react-app")).usage(`[options] ${B().yellow("[project-name]")}`).addHelpText("after",`
68
- Examples:
69
- $ npm create @pplancq/react-app my-project
70
- $ npx @pplancq/create-react-app my-project`).action((e,u)=>{e&&(t.projectName=e),u?.skipDepInstall&&(t.skipDepInstall=u.skipDepInstall),u?.skipGitInit&&(t.skipGitInit=u.skipGitInit),u?.template&&(t.template=u.template)}).parse(E.default.argv),t);((t="")=>{process.stdout.write(`${A.gray(tn)} ${t}
71
- `)})(`Create ${B().blue("React")} App`),(({projectName:t,template:e})=>{if(t){let e=tk(t);if(""!==e)throw new tZ(e)}if(e){let t=tS(e);if(""!==t)throw new tQ(t)}})(e);let{projectName:u,skipDepInstall:i,skipGitInit:D,template:r}=await tT(e),{repoDir:n}=await tO(u);await tJ(n,r),await tK(u,n),await tz(n,D),await tY(n,i),await tU(n,D),tB.success(`${B().yellow("Success \\o/")} Created ${B().green(u)} at ${B().green(n)}`),((t="",e="")=>{let u=`
72
- ${t}
73
- `.split(`
74
- `),i=s(e).length,D=Math.max(u.reduce((t,e)=>{let u=s(e);return u.length>t?u.length:t},0),i)+2,r=u.map(t=>`${A.gray(to)} ${A.dim(t)}${" ".repeat(D-s(t).length)}${A.gray(to)}`).join(`
75
- `);process.stdout.write(`${A.gray(to)}
76
- ${A.green(ts)} ${A.reset(e)} ${A.gray(tp.repeat(Math.max(D-i-1,1))+tm)}
77
- ${r}
78
- ${A.gray(tc+tp.repeat(D+2)+td)}
79
- `)})(`We suggest that you begin by typing:
80
- ${B().cyan("cd")} ${u}${i?`
81
- ${B().cyan("npm install")}`:""}
82
- ${B().cyan("npm start")}`,"What next?")})().then(()=>{tA("Happy hacking!"),C()}).catch(t=>{tB.error(t.message),tA("Please check and try again."),C(!0)});
71
+ `)},tt=t=>r.dim(t),te=(t="",e="",i)=>{var o;let a,l,h,u=i?.output??n.default.stdout,p=i?.withGuide??s.W0.withGuide,d=i?.format??tt,g=["",...(o=(0,s.GH)(u)-6,h=(l=z(t,o,a={hard:!0,trim:!1}).split(`
72
+ `)).reduce((t,e)=>Math.max(N(e),t),0),z(t,o-(l.map(d).reduce((t,e)=>Math.max(N(e),t),0)-h),a)).split(`
73
+ `).map(d),""],f=N(e),_=Math.max(g.reduce((t,e)=>{let i=N(e);return i>t?i:t},0),f)+2,O=g.map(t=>`${r.gray(c)} ${t}${" ".repeat(_-N(t))}${r.gray(c)}`).join(`
74
+ `),C=p?`${r.gray(c)}
75
+ `:"";u.write(`${C}${r.green(m)} ${r.reset(e)} ${r.gray(b.repeat(Math.max(_-f-1,1))+v)}
76
+ ${O}
77
+ ${r.gray((p?x:y)+b.repeat(_+2)+w)}
78
+ `)},ti=r.magenta,ts=({indicator:t="dots",onCancel:e,output:i=process.stdout,cancelMessage:n,errorMessage:l,frames:h=a?["◒","◐","◓","◑"]:["•","o","O","0"],delay:d=a?80:120,signal:g,...f}={})=>{let _="true"===process.env.CI,b,v,x=!1,w=!1,y="",O,C=performance.now(),$=(0,s.GH)(i),A=f?.styleFrame??ti,E=t=>{let i=t>1?l??s.W0.messages.error:n??s.W0.messages.cancel;w=1===t,x&&(H(i,t),w&&"function"==typeof e&&e())},k=()=>E(2),S=()=>E(1),j=()=>{if(void 0===O)return;_&&i.write(`
79
+ `);let t=z(O,$,{hard:!0,trim:!1}).split(`
80
+ `);t.length>1&&i.write(o.cursor.up(t.length-1)),i.write(o.cursor.to(0)),i.write(o.erase.down())},T=t=>{let e=(performance.now()-t)/1e3,i=Math.floor(e/60),s=Math.floor(e%60);return i>0?`[${i}m ${s}s]`:`[${s}s]`},I=f.withGuide??s.W0.withGuide,H=(e="",s=0,n=!1)=>{if(!x)return;x=!1,clearInterval(v),j();let o=0===s?r.green(m):1===s?r.red(u):r.red(p);y=e??y,n||("timer"===t?i.write(`${o} ${y} ${T(C)}
81
+ `):i.write(`${o} ${y}
82
+ `)),process.removeListener("uncaughtExceptionMonitor",k),process.removeListener("unhandledRejection",k),process.removeListener("SIGINT",S),process.removeListener("SIGTERM",S),process.removeListener("exit",E),g&&g.removeEventListener("abort",S),b()};return{start:(e="")=>{x=!0,b=(0,s.om)({output:i}),y=e.replace(/\.+$/,""),C=performance.now(),I&&i.write(`${r.gray(c)}
83
+ `);let n=0,o=0;process.on("uncaughtExceptionMonitor",k),process.on("unhandledRejection",k),process.on("SIGINT",S),process.on("SIGTERM",S),process.on("exit",E),g&&g.addEventListener("abort",S),v=setInterval(()=>{let e;if(_&&y===O)return;j(),O=y;let s=A(h[n]);if(_)e=`${s} ${y}...`;else if("timer"===t)e=`${s} ${y} ${T(C)}`;else{let t=".".repeat(Math.floor(o)).slice(0,3);e=`${s} ${y}${t}`}let r=z(e,$,{hard:!0,trim:!1});i.write(r),n=n+1<h.length?n+1:0,o=o<4?o+.125:0},d)},stop:(t="")=>H(t,0),message:(t="")=>{y=(t??y).replace(/\.+$/,"")},cancel:(t="")=>H(t,1),error:(t="")=>H(t,2),clear:()=>H("",0,!0),get isCancelled(){return w}}};l("─","-"),l("━","="),l("█","#"),r.gray(c);let tr=t=>new s.C({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,output:t.output,signal:t.signal,input:t.input,render(){let e=t?.withGuide??s.W0.withGuide,i=`${e?`${r.gray(c)}
84
+ `:""}${E(this.state)} ${t.message}
85
+ `,n=t.placeholder?r.inverse(t.placeholder[0])+r.dim(t.placeholder.slice(1)):r.inverse(r.hidden("_")),o=this.userInput?this.userInputWithCursor:n,a=this.value??"";switch(this.state){case"error":{let t=this.error?` ${r.yellow(this.error)}`:"",s=e?`${r.yellow(c)} `:"",n=e?r.yellow(g):"";return`${i.trim()}
86
+ ${s}${o}
87
+ ${n}${t}
88
+ `}case"submit":{let t=a?` ${r.dim(a)}`:"",s=e?r.gray(c):"";return`${i}${s}${t}`}case"cancel":{let t=a?` ${r.strikethrough(r.dim(a))}`:"",s=e?r.gray(c):"";return`${i}${s}${t}${a.trim()?`
89
+ ${s}`:""}`}default:{let t=e?`${r.cyan(c)} `:"",s=e?r.cyan(g):"";return`${i}${t}${o}
90
+ ${s}
91
+ `}}}}).prompt()},"../../node_modules/commander/esm.mjs"(t,e,i){i.d(e,{uB:()=>u});let{program:s,createCommand:r,createArgument:n,createOption:o,CommanderError:a,InvalidArgumentError:l,InvalidOptionArgumentError:h,Command:u,Argument:p,Option:m,Help:d}=i("../../node_modules/commander/index.js")},"./package.json"(t){t.exports=JSON.parse('{"UU":"@pplancq/create-react-app","rE":"2.0.4"}')}}),l("./src/index.ts");
@@ -0,0 +1 @@
1
+ var r,e,o,t,a,n,p,s={},u={};function c(r){var e=u[r];if(void 0!==e)return e.exports;var o=u[r]={exports:{}};return s[r](o,o.exports,c),o.exports}c.m=s,c.add=function(r){Object.assign(c.m,r)},e=(r="function"==typeof Symbol)?Symbol("rspack queues"):"__rspack_queues",o=c.aE=r?Symbol("rspack exports"):"__webpack_exports__",t=r?Symbol("rspack error"):"__rspack_error",a=r?Symbol("rspack done"):"__rspack_done",n=c.zS=r?Symbol("rspack defer"):"__rspack_defer",p=r=>{r&&r.d<1&&(r.d=1,r.forEach(r=>r.r--),r.forEach(r=>r.r--?r.r++:r()))},c.a=(r,s,_)=>{_&&((d=[]).d=-1);var d,f,i,l,m=new Set,b=r.exports,v=new Promise((r,e)=>{l=e,i=r});v[o]=b,v[e]=r=>{d&&r(d),m.forEach(r),v.catch(()=>{})},r.exports=v,s(r=>{f=r.map(r=>{if(null!==r&&"object"==typeof r){if(!r[e]&&r[n]){var s=r[n];if(!s.some(r=>{var e=u[r];return!e||!1===e[a]}))return r;var _=r;r={then(r){Promise.all(s.map(c)).then(()=>r(_))}}}if(r[e])return r;if(r.then){var d=[];d.d=0,r.then(r=>{f[o]=r,p(d)},r=>{f[t]=r,p(d)});var f={};return f[n]=!1,f[e]=r=>r(d),f}}var i={};return i[e]=()=>{},i[o]=r,i});var s,_=()=>f.map(r=>{if(r[n])return r;if(r[t])throw r[t];return r[o]}),i=new Promise(r=>{(s=()=>r(_)).r=0;var o=r=>r!==d&&!m.has(r)&&(m.add(r),r&&!r.d&&(s.r++,r.push(s)));f.map(r=>r[n]||r[e](o))});return s.r?i:_()},r=>(r?l(v[t]=r):i(b),p(d),v[a]=!0)),d&&d.d<0&&(d.d=0)},c.n=r=>{var e=r&&r.__esModule?()=>r.default:()=>r;return c.d(e,{a:e}),e},c.d=(r,e)=>{for(var o in e)c.o(e,o)&&!c.o(r,o)&&Object.defineProperty(r,o,{enumerable:!0,get:e[o]})},c.o=(r,e)=>Object.prototype.hasOwnProperty.call(r,e),c.r=r=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})};export{c as __webpack_require__};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pplancq/create-react-app",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "license": "MIT",
5
5
  "description": "pplancq create-react-app",
6
6
  "author": "pplancq <paul.plancq@outlook.fr>",
@@ -40,27 +40,24 @@
40
40
  "CHANGELOG.md"
41
41
  ],
42
42
  "devDependencies": {
43
- "@clack/prompts": "^0.11.0",
44
- "@rslib/core": "^0.18.2",
45
- "@vitest/coverage-v8": "^4.0.14",
46
- "commander": "^14.0.2",
47
- "eslint": "^9.39.1",
48
- "eslint-plugin-prettier": "^5.5.4",
43
+ "@clack/prompts": "^1.0.1",
44
+ "@rslib/core": "^0.19.6",
45
+ "@vitest/coverage-v8": "^4.0.18",
46
+ "commander": "^14.0.3",
47
+ "eslint": "^9.39.3",
48
+ "eslint-plugin-prettier": "^5.5.5",
49
49
  "lint-staged": "^16.2.7",
50
50
  "picocolors": "^1.1.1",
51
- "prettier": "^3.7.1",
51
+ "prettier": "^3.8.1",
52
52
  "tsc-files": "^1.1.4",
53
53
  "typescript": "^5.9.3",
54
- "vite-tsconfig-paths": "^5.1.4",
55
- "vitest": "^4.0.14",
54
+ "vite-tsconfig-paths": "^6.1.1",
55
+ "vitest": "^4.0.18",
56
56
  "vitest-sonar-reporter": "^3.0.0"
57
57
  },
58
58
  "engines": {
59
59
  "node": ">=20.12.2"
60
60
  },
61
- "volta": {
62
- "extends": "../../package.json"
63
- },
64
61
  "prettier": "@pplancq/prettier-config",
65
62
  "lint-staged": {
66
63
  "*.(js|mjs|ts)": "eslint --fix",