react-grab 0.0.98 → 0.1.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.cjs CHANGED
@@ -1,1138 +1,2 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';var zD=require('assert'),child_process=require('child_process'),xf=require('fs'),kt=require('path'),Ve=require('process'),wf=require('readline'),my=require('events'),module$1=require('module'),stream=require('stream'),Fy=require('os'),Vf=require('tty'),Ff=require('fs/promises'),http=require('http');var _documentCurrentScript=typeof document!=='undefined'?document.currentScript:null;function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var zD__default=/*#__PURE__*/_interopDefault(zD);var xf__default=/*#__PURE__*/_interopDefault(xf);var kt__default=/*#__PURE__*/_interopDefault(kt);var Ve__default=/*#__PURE__*/_interopDefault(Ve);var wf__default=/*#__PURE__*/_interopDefault(wf);var my__default=/*#__PURE__*/_interopDefault(my);var Fy__default=/*#__PURE__*/_interopDefault(Fy);var Vf__default=/*#__PURE__*/_interopDefault(Vf);var Ff__default=/*#__PURE__*/_interopDefault(Ff);var OD=Object.create;var Pu=Object.defineProperty;var SD=Object.getOwnPropertyDescriptor;var RD=Object.getOwnPropertyNames;var TD=Object.getPrototypeOf,PD=Object.prototype.hasOwnProperty;var H=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var y=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var kD=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of RD(e))!PD.call(t,s)&&s!==r&&Pu(t,s,{get:()=>e[s],enumerable:!(i=SD(e,s))||i.enumerable});return t};var ve=(t,e,r)=>(r=t!=null?OD(TD(t)):{},kD(Pu(r,"default",{value:t,enumerable:true}),t));var Cr=y(Os=>{var ni=class extends Error{constructor(e,r,i){super(i),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0;}},$s=class extends ni{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name;}};Os.CommanderError=ni;Os.InvalidArgumentError=$s;});var oi=y(Rs=>{var{InvalidArgumentError:ID}=Cr(),Ss=class{constructor(e,r){switch(this.description=r||"",this.variadic=false,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case "<":this.required=true,this._name=e.slice(1,-1);break;case "[":this.required=false,this._name=e.slice(1,-1);break;default:this.required=true,this._name=e;break}this._name.endsWith("...")&&(this.variadic=true,this._name=this._name.slice(0,-3));}name(){return this._name}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,i)=>{if(!this.argChoices.includes(r))throw new ID(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,i):r},this}argRequired(){return this.required=true,this}argOptional(){return this.required=false,this}};function MD(t){let e=t.name()+(t.variadic===true?"...":"");return t.required?"<"+e+">":"["+e+"]"}Rs.Argument=Ss;Rs.humanReadableArgName=MD;});var ks=y(Ps=>{var{humanReadableArgName:BD}=oi(),Ts=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=false,this.sortOptions=false,this.showGlobalOptions=false;}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80;}visibleCommands(e){let r=e.commands.filter(s=>!s._hidden),i=e._getHelpCommand();return i&&!i._hidden&&r.push(i),this.sortSubcommands&&r.sort((s,n)=>s.name().localeCompare(n.name())),r}compareOptions(e,r){let i=s=>s.short?s.short.replace(/^-/,""):s.long.replace(/^--/,"");return i(e).localeCompare(i(r))}visibleOptions(e){let r=e.options.filter(s=>!s.hidden),i=e._getHelpOption();if(i&&!i.hidden){let s=i.short&&e._findOption(i.short),n=i.long&&e._findOption(i.long);!s&&!n?r.push(i):i.long&&!n?r.push(e.createOption(i.long,i.description)):i.short&&!s&&r.push(e.createOption(i.short,i.description));}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return [];let r=[];for(let i=e.parent;i;i=i.parent){let s=i.options.filter(n=>!n.hidden);r.push(...s);}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||"";}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(i=>BD(i)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((i,s)=>Math.max(i,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(s)))),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((i,s)=>Math.max(i,this.displayWidth(r.styleOptionTerm(r.optionTerm(s)))),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((i,s)=>Math.max(i,this.displayWidth(r.styleOptionTerm(r.optionTerm(s)))),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((i,s)=>Math.max(i,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(s)))),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let i="";for(let s=e.parent;s;s=s.parent)i=s.name()+" "+i;return i+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0){let i=`(${r.join(", ")})`;return e.description?`${e.description} ${i}`:i}return e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let i=`(${r.join(", ")})`;return e.description?`${e.description} ${i}`:i}return e.description}formatItemList(e,r,i){return r.length===0?[]:[i.styleTitle(e),...r,""]}groupItems(e,r,i){let s=new Map;return e.forEach(n=>{let o=i(n);s.has(o)||s.set(o,[]);}),r.forEach(n=>{let o=i(n);s.has(o)||s.set(o,[]),s.get(o).push(n);}),s}formatHelp(e,r){let i=r.padWidth(e,r),s=r.helpWidth??80;function n(c,d){return r.formatItem(c,i,d,r)}let o=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(e))}`,""],a=r.commandDescription(e);a.length>0&&(o=o.concat([r.boxWrap(r.styleCommandDescription(a),s),""]));let u=r.visibleArguments(e).map(c=>n(r.styleArgumentTerm(r.argumentTerm(c)),r.styleArgumentDescription(r.argumentDescription(c))));if(o=o.concat(this.formatItemList("Arguments:",u,r)),this.groupItems(e.options,r.visibleOptions(e),c=>c.helpGroupHeading??"Options:").forEach((c,d)=>{let f=c.map(m=>n(r.styleOptionTerm(r.optionTerm(m)),r.styleOptionDescription(r.optionDescription(m))));o=o.concat(this.formatItemList(d,f,r));}),r.showGlobalOptions){let c=r.visibleGlobalOptions(e).map(d=>n(r.styleOptionTerm(r.optionTerm(d)),r.styleOptionDescription(r.optionDescription(d))));o=o.concat(this.formatItemList("Global Options:",c,r));}return this.groupItems(e.commands,r.visibleCommands(e),c=>c.helpGroup()||"Commands:").forEach((c,d)=>{let f=c.map(m=>n(r.styleSubcommandTerm(r.subcommandTerm(m)),r.styleSubcommandDescription(r.subcommandDescription(m))));o=o.concat(this.formatItemList(d,f,r));}),o.join(`
3
- `)}displayWidth(e){return ku(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,r){return Math.max(r.longestOptionTermLength(e,r),r.longestGlobalOptionTermLength(e,r),r.longestSubcommandTermLength(e,r),r.longestArgumentTermLength(e,r))}preformatted(e){return /\n[^\S\r\n]/.test(e)}formatItem(e,r,i,s){let o=" ".repeat(2);if(!i)return o+e;let a=e.padEnd(r+e.length-s.displayWidth(e)),u=2,l=(this.helpWidth??80)-r-u-2,c;return l<this.minWidthToWrap||s.preformatted(i)?c=i:c=s.boxWrap(i,l).replace(/\n/g,`
4
- `+" ".repeat(r+u)),o+a+" ".repeat(u)+c.replace(/\n/g,`
5
- ${o}`)}boxWrap(e,r){if(r<this.minWidthToWrap)return e;let i=e.split(/\r\n|\n/),s=/[\s]*[^\s]+/g,n=[];return i.forEach(o=>{let a=o.match(s);if(a===null){n.push("");return}let u=[a.shift()],h=this.displayWidth(u[0]);a.forEach(l=>{let c=this.displayWidth(l);if(h+c<=r){u.push(l),h+=c;return}n.push(u.join(""));let d=l.trimStart();u=[d],h=this.displayWidth(d);}),n.push(u.join(""));}),n.join(`
6
- `)}};function ku(t){let e=/\x1b\[\d*(;\d*)*m/g;return t.replace(e,"")}Ps.Help=Ts;Ps.stripColor=ku;});var Ns=y(Bs=>{var{InvalidArgumentError:ND}=Cr(),Is=class{constructor(e,r){this.flags=e,this.description=r||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=false;let i=HD(e);this.short=i.shortFlag,this.long=i.longFlag,this.negate=false,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=false,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0;}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let r=e;return typeof e=="string"&&(r={[e]:true}),this.implied=Object.assign(this.implied||{},r),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=true){return this.mandatory=!!e,this}hideHelp(e=true){return this.hidden=!!e,this}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,i)=>{if(!this.argChoices.includes(r))throw new ND(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,i):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Iu(this.name().replace(/^no-/,"")):Iu(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return !this.required&&!this.optional&&!this.negate}},Ms=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r);}),this.negativeOptions.forEach((r,i)=>{this.positiveOptions.has(i)&&this.dualOptions.add(i);});}valueFromOption(e,r){let i=r.attributeName();if(!this.dualOptions.has(i))return true;let s=this.negativeOptions.get(i).presetArg,n=s!==void 0?s:false;return r.negate===(n===e)}};function Iu(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function HD(t){let e,r,i=/^-[^-]$/,s=/^--[^-]/,n=t.split(/[ |,]+/).concat("guard");if(i.test(n[0])&&(e=n.shift()),s.test(n[0])&&(r=n.shift()),!e&&i.test(n[0])&&(e=n.shift()),!e&&s.test(n[0])&&(e=r,r=n.shift()),n[0].startsWith("-")){let o=n[0],a=`option creation failed due to '${o}' in option flags '${t}'`;throw /^-[^-][^-]/.test(o)?new Error(`${a}
7
- - a short flag is a single dash and a single character
8
- - either use a single dash and a single character (for a short flag)
9
- - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):i.test(o)?new Error(`${a}
10
- - too many short flags`):s.test(o)?new Error(`${a}
11
- - too many long flags`):new Error(`${a}
12
- - unrecognised flag format`)}if(e===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${t}'.`);return {shortFlag:e,longFlag:r}}Bs.Option=Is;Bs.DualOptions=Ms;});var Bu=y(Mu=>{function qD(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let r=[];for(let i=0;i<=t.length;i++)r[i]=[i];for(let i=0;i<=e.length;i++)r[0][i]=i;for(let i=1;i<=e.length;i++)for(let s=1;s<=t.length;s++){let n=1;t[s-1]===e[i-1]?n=0:n=1,r[s][i]=Math.min(r[s-1][i]+1,r[s][i-1]+1,r[s-1][i-1]+n),s>1&&i>1&&t[s-1]===e[i-2]&&t[s-2]===e[i-1]&&(r[s][i]=Math.min(r[s][i],r[s-2][i-2]+1));}return r[t.length][e.length]}function LD(t,e){if(!e||e.length===0)return "";e=Array.from(new Set(e));let r=t.startsWith("--");r&&(t=t.slice(2),e=e.map(o=>o.slice(2)));let i=[],s=3,n=.4;return e.forEach(o=>{if(o.length<=1)return;let a=qD(t,o),u=Math.max(t.length,o.length);(u-a)/u>n&&(a<s?(s=a,i=[o]):a===s&&i.push(o));}),i.sort((o,a)=>o.localeCompare(a)),r&&(i=i.map(o=>`--${o}`)),i.length>1?`
13
- (Did you mean one of ${i.join(", ")}?)`:i.length===1?`
14
- (Did you mean ${i[0]}?)`:""}Mu.suggestSimilar=LD;});var Lu=y(Gs=>{var jD=H("events").EventEmitter,Hs=H("child_process"),ot=H("path"),ai=H("fs"),W=H("process"),{Argument:GD,humanReadableArgName:VD}=oi(),{CommanderError:qs}=Cr(),{Help:WD,stripColor:UD}=ks(),{Option:Nu,DualOptions:KD}=Ns(),{suggestSimilar:Hu}=Bu(),Ls=class t extends jD{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=false,this._allowExcessArguments=false,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=false,this._actionHandler=null,this._executableHandler=false,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=true,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=false,this._passThroughOptions=false,this._lifeCycleHooks={},this._showHelpAfterError=false,this._showSuggestionAfterError=true,this._savedState=null,this._outputConfiguration={writeOut:r=>W.stdout.write(r),writeErr:r=>W.stderr.write(r),outputError:(r,i)=>i(r),getOutHelpWidth:()=>W.stdout.isTTY?W.stdout.columns:void 0,getErrHelpWidth:()=>W.stderr.isTTY?W.stderr.columns:void 0,getOutHasColors:()=>js()??(W.stdout.isTTY&&W.stdout.hasColors?.()),getErrHasColors:()=>js()??(W.stderr.isTTY&&W.stderr.hasColors?.()),stripColor:r=>UD(r)},this._hidden=false,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(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let r=this;r;r=r.parent)e.push(r);return e}command(e,r,i){let s=r,n=i;typeof s=="object"&&s!==null&&(n=s,s=null),n=n||{};let[,o,a]=e.match(/([^ ]+) *(.*)/),u=this.createCommand(o);return s&&(u.description(s),u._executableHandler=true),n.isDefault&&(this._defaultCommandName=u._name),u._hidden=!!(n.noHelp||n.hidden),u._executableFile=n.executableFile||null,a&&u.arguments(a),this._registerCommand(u),u.parent=this,u.copyInheritedSettings(this),s?this:u}createCommand(e){return new t(e)}createHelp(){return Object.assign(new WD,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=true){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=true){return this._showSuggestionAfterError=!!e,this}addCommand(e,r){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
15
- - specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=true),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new GD(e,r)}argument(e,r,i,s){let n=this.createArgument(e,r);return typeof i=="function"?n.default(s).argParser(i):n.default(i),this.addArgument(n),this}arguments(e){return e.trim().split(/ +/).forEach(r=>{this.argument(r);}),this}addArgument(e){let r=this.registeredArguments.slice(-1)[0];if(r?.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,r){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let i=e??"help [command]",[,s,n]=i.match(/([^ ]+) *(.*)/),o=r??"display help for command",a=this.createCommand(s);return a.helpOption(false),n&&a.arguments(n),o&&a.description(o),this._addImplicitHelpCommand=true,this._helpCommand=a,(e||r)&&this._initCommandGroup(a),this}addHelpCommand(e,r){return typeof e!="object"?(this.helpCommand(e,r),this):(this._addImplicitHelpCommand=true,this._helpCommand=e,this._initCommandGroup(e),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,r){let i=["preSubcommand","preAction","postAction"];if(!i.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
16
- Expecting one of '${i.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(r):this._lifeCycleHooks[e]=[r],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(e,r,i){this._exitCallback&&this._exitCallback(new qs(e,r,i)),W.exit(e);}action(e){let r=i=>{let s=this.registeredArguments.length,n=i.slice(0,s);return this._storeOptionsAsProperties?n[s]=this:n[s]=this.opts(),n.push(this),e.apply(this,n)};return this._actionHandler=r,this}createOption(e,r){return new Nu(e,r)}_callParseArg(e,r,i,s){try{return e.parseArg(r,i)}catch(n){if(n.code==="commander.invalidArgument"){let o=`${s} ${n.message}`;this.error(o,{exitCode:n.exitCode,code:n.code});}throw n}}_registerOption(e){let r=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(r){let i=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${i}'
17
- - already used by option '${r.flags}'`)}this._initOptionGroup(e),this.options.push(e);}_registerCommand(e){let r=s=>[s.name()].concat(s.aliases()),i=r(e).find(s=>this._findCommand(s));if(i){let s=r(this._findCommand(i)).join("|"),n=r(e).join("|");throw new Error(`cannot add command '${n}' as already have command '${s}'`)}this._initCommandGroup(e),this.commands.push(e);}addOption(e){this._registerOption(e);let r=e.name(),i=e.attributeName();if(e.negate){let n=e.long.replace(/^--no-/,"--");this._findOption(n)||this.setOptionValueWithSource(i,e.defaultValue===void 0?true:e.defaultValue,"default");}else e.defaultValue!==void 0&&this.setOptionValueWithSource(i,e.defaultValue,"default");let s=(n,o,a)=>{n==null&&e.presetArg!==void 0&&(n=e.presetArg);let u=this.getOptionValue(i);n!==null&&e.parseArg?n=this._callParseArg(e,n,u,o):n!==null&&e.variadic&&(n=e._collectValue(n,u)),n==null&&(e.negate?n=false:e.isBoolean()||e.optional?n=true:n=""),this.setOptionValueWithSource(i,n,a);};return this.on("option:"+r,n=>{let o=`error: option '${e.flags}' argument '${n}' is invalid.`;s(n,o,"cli");}),e.envVar&&this.on("optionEnv:"+r,n=>{let o=`error: option '${e.flags}' value '${n}' from env '${e.envVar}' is invalid.`;s(n,o,"env");}),this}_optionEx(e,r,i,s,n){if(typeof r=="object"&&r instanceof Nu)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let o=this.createOption(r,i);if(o.makeOptionMandatory(!!e.mandatory),typeof s=="function")o.default(n).argParser(s);else if(s instanceof RegExp){let a=s;s=(u,h)=>{let l=a.exec(u);return l?l[0]:h},o.default(n).argParser(s);}else o.default(s);return this.addOption(o)}option(e,r,i,s){return this._optionEx({},e,r,i,s)}requiredOption(e,r,i,s){return this._optionEx({mandatory:true},e,r,i,s)}combineFlagAndOptionalValue(e=true){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=true){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=true){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=true){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=true){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=true){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,r){return this.setOptionValueWithSource(e,r,void 0)}setOptionValueWithSource(e,r,i){return this._storeOptionsAsProperties?this[e]=r:this._optionValues[e]=r,this._optionValueSources[e]=i,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let r;return this._getCommandAndAncestors().forEach(i=>{i.getOptionValueSource(e)!==void 0&&(r=i.getOptionValueSource(e));}),r}_prepareUserArgs(e,r){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},e===void 0&&r.from===void 0){W.versions?.electron&&(r.from="electron");let s=W.execArgv??[];(s.includes("-e")||s.includes("--eval")||s.includes("-p")||s.includes("--print"))&&(r.from="eval");}e===void 0&&(e=W.argv),this.rawArgs=e.slice();let i;switch(r.from){case void 0:case "node":this._scriptPath=e[1],i=e.slice(2);break;case "electron":W.defaultApp?(this._scriptPath=e[1],i=e.slice(2)):i=e.slice(1);break;case "user":i=e.slice(0);break;case "eval":i=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return !this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",i}parse(e,r){this._prepareForParse();let i=this._prepareUserArgs(e,r);return this._parseCommand([],i),this}async parseAsync(e,r){this._prepareForParse();let i=this._prepareUserArgs(e,r);return await this._parseCommand([],i),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse();}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}};}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
18
- - 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(e,r,i){if(ai.existsSync(e))return;let s=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",n=`'${e}' does not exist
19
- - if '${i}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
20
- - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
21
- - ${s}`;throw new Error(n)}_executeSubCommand(e,r){r=r.slice();let i=false,s=[".js",".ts",".tsx",".mjs",".cjs"];function n(l,c){let d=ot.resolve(l,c);if(ai.existsSync(d))return d;if(s.includes(ot.extname(c)))return;let f=s.find(m=>ai.existsSync(`${d}${m}`));if(f)return `${d}${f}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||"";if(this._scriptPath){let l;try{l=ai.realpathSync(this._scriptPath);}catch{l=this._scriptPath;}a=ot.resolve(ot.dirname(l),a);}if(a){let l=n(a,o);if(!l&&!e._executableFile&&this._scriptPath){let c=ot.basename(this._scriptPath,ot.extname(this._scriptPath));c!==this._name&&(l=n(a,`${c}-${e._name}`));}o=l||o;}i=s.includes(ot.extname(o));let u;W.platform!=="win32"?i?(r.unshift(o),r=qu(W.execArgv).concat(r),u=Hs.spawn(W.argv[0],r,{stdio:"inherit"})):u=Hs.spawn(o,r,{stdio:"inherit"}):(this._checkForMissingExecutable(o,a,e._name),r.unshift(o),r=qu(W.execArgv).concat(r),u=Hs.spawn(W.execPath,r,{stdio:"inherit"})),u.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(c=>{W.on(c,()=>{u.killed===false&&u.exitCode===null&&u.kill(c);});});let h=this._exitCallback;u.on("close",l=>{l=l??1,h?h(new qs(l,"commander.executeSubCommandAsync","(close)")):W.exit(l);}),u.on("error",l=>{if(l.code==="ENOENT")this._checkForMissingExecutable(o,a,e._name);else if(l.code==="EACCES")throw new Error(`'${o}' not executable`);if(!h)W.exit(1);else {let c=new qs(1,"commander.executeSubCommandAsync","(error)");c.nestedError=l,h(c);}}),this.runningCommand=u;}_dispatchSubcommand(e,r,i){let s=this._findCommand(e);s||this.help({error:true}),s._prepareForParse();let n;return n=this._chainOrCallSubCommandHook(n,s,"preSubcommand"),n=this._chainOrCall(n,()=>{if(s._executableHandler)this._executeSubCommand(s,r.concat(i));else return s._parseCommand(r,i)}),n}_dispatchHelpCommand(e){e||this.help();let r=this._findCommand(e);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,r)=>{e.required&&this.args[r]==null&&this.missingArgument(e.name());}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args);}_processArguments(){let e=(i,s,n)=>{let o=s;if(s!==null&&i.parseArg){let a=`error: command-argument value '${s}' is invalid for argument '${i.name()}'.`;o=this._callParseArg(i,s,n,a);}return o};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((i,s)=>{let n=i.defaultValue;i.variadic?s<this.args.length?(n=this.args.slice(s),i.parseArg&&(n=n.reduce((o,a)=>e(i,a,o),i.defaultValue))):n===void 0&&(n=[]):s<this.args.length&&(n=this.args[s],i.parseArg&&(n=e(i,n,i.defaultValue))),r[s]=n;}),this.processedArgs=r;}_chainOrCall(e,r){return e?.then&&typeof e.then=="function"?e.then(()=>r()):r()}_chainOrCallHooks(e,r){let i=e,s=[];return this._getCommandAndAncestors().reverse().filter(n=>n._lifeCycleHooks[r]!==void 0).forEach(n=>{n._lifeCycleHooks[r].forEach(o=>{s.push({hookedCommand:n,callback:o});});}),r==="postAction"&&s.reverse(),s.forEach(n=>{i=this._chainOrCall(i,()=>n.callback(n.hookedCommand,this));}),i}_chainOrCallSubCommandHook(e,r,i){let s=e;return this._lifeCycleHooks[i]!==void 0&&this._lifeCycleHooks[i].forEach(n=>{s=this._chainOrCall(s,()=>n(this,r));}),s}_parseCommand(e,r){let i=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(i.operands),r=i.unknown,this.args=e.concat(r),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),r);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,e,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:true}),this._outputHelpIfRequested(i.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=()=>{i.unknown.length>0&&this.unknownOption(i.unknown[0]);},n=`command:${this.name()}`;if(this._actionHandler){s(),this._processArguments();let o;return o=this._chainOrCallHooks(o,"preAction"),o=this._chainOrCall(o,()=>this._actionHandler(this.processedArgs)),this.parent&&(o=this._chainOrCall(o,()=>{this.parent.emit(n,e,r);})),o=this._chainOrCallHooks(o,"postAction"),o}if(this.parent?.listenerCount(n))s(),this._processArguments(),this.parent.emit(n,e,r);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,r);this.listenerCount("command:*")?this.emit("command:*",e,r):this.commands.length?this.unknownCommand():(s(),this._processArguments());}else this.commands.length?(s(),this.help({error:true})):(s(),this._processArguments());}_findCommand(e){if(e)return this.commands.find(r=>r._name===e||r._aliases.includes(e))}_findOption(e){return this.options.find(r=>r.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(r=>{r.mandatory&&e.getOptionValue(r.attributeName())===void 0&&e.missingMandatoryOptionValue(r);});});}_checkForConflictingLocalOptions(){let e=this.options.filter(i=>{let s=i.attributeName();return this.getOptionValue(s)===void 0?false:this.getOptionValueSource(s)!=="default"});e.filter(i=>i.conflictsWith.length>0).forEach(i=>{let s=e.find(n=>i.conflictsWith.includes(n.attributeName()));s&&this._conflictingOption(i,s);});}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions();});}parseOptions(e){let r=[],i=[],s=r;function n(l){return l.length>1&&l[0]==="-"}let o=l=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(l)?!this._getCommandAndAncestors().some(c=>c.options.map(d=>d.short).some(d=>/^-\d$/.test(d))):false,a=null,u=null,h=0;for(;h<e.length||u;){let l=u??e[h++];if(u=null,l==="--"){s===i&&s.push(l),s.push(...e.slice(h));break}if(a&&(!n(l)||o(l))){this.emit(`option:${a.name()}`,l);continue}if(a=null,n(l)){let c=this._findOption(l);if(c){if(c.required){let d=e[h++];d===void 0&&this.optionMissingArgument(c),this.emit(`option:${c.name()}`,d);}else if(c.optional){let d=null;h<e.length&&(!n(e[h])||o(e[h]))&&(d=e[h++]),this.emit(`option:${c.name()}`,d);}else this.emit(`option:${c.name()}`);a=c.variadic?c:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let c=this._findOption(`-${l[1]}`);if(c){c.required||c.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${c.name()}`,l.slice(2)):(this.emit(`option:${c.name()}`),u=`-${l.slice(2)}`);continue}}if(/^--[^=]+=/.test(l)){let c=l.indexOf("="),d=this._findOption(l.slice(0,c));if(d&&(d.required||d.optional)){this.emit(`option:${d.name()}`,l.slice(c+1));continue}}if(s===r&&n(l)&&!(this.commands.length===0&&o(l))&&(s=i),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&i.length===0){if(this._findCommand(l)){r.push(l),i.push(...e.slice(h));break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){r.push(l,...e.slice(h));break}else if(this._defaultCommandName){i.push(l,...e.slice(h));break}}if(this._passThroughOptions){s.push(l,...e.slice(h));break}s.push(l);}return {operands:r,unknown:i}}opts(){if(this._storeOptionsAsProperties){let e={},r=this.options.length;for(let i=0;i<r;i++){let s=this.options[i].attributeName();e[s]=s===this._versionOptionName?this._version:this[s];}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,r)=>Object.assign(e,r.opts()),{})}error(e,r){this._outputConfiguration.outputError(`${e}
22
- `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
23
- `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
24
- `),this.outputHelp({error:true}));let i=r||{},s=i.exitCode||1,n=i.code||"commander.error";this._exit(s,n,e);}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in W.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,W.env[e.envVar]):this.emit(`optionEnv:${e.name()}`));}});}_parseOptionsImplied(){let e=new KD(this.options),r=i=>this.getOptionValue(i)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(i));this.options.filter(i=>i.implied!==void 0&&r(i.attributeName())&&e.valueFromOption(this.getOptionValue(i.attributeName()),i)).forEach(i=>{Object.keys(i.implied).filter(s=>!r(s)).forEach(s=>{this.setOptionValueWithSource(s,i.implied[s],"implied");});});}missingArgument(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"});}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"});}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"});}_conflictingOption(e,r){let i=o=>{let a=o.attributeName(),u=this.getOptionValue(a),h=this.options.find(c=>c.negate&&a===c.attributeName()),l=this.options.find(c=>!c.negate&&a===c.attributeName());return h&&(h.presetArg===void 0&&u===false||h.presetArg!==void 0&&u===h.presetArg)?h:l||o},s=o=>{let a=i(o),u=a.attributeName();return this.getOptionValueSource(u)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},n=`error: ${s(e)} cannot be used with ${s(r)}`;this.error(n,{code:"commander.conflictingOption"});}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let s=[],n=this;do{let o=n.createHelp().visibleOptions(n).filter(a=>a.long).map(a=>a.long);s=s.concat(o),n=n.parent;}while(n&&!n._enablePositionalOptions);r=Hu(e,s);}let i=`error: unknown option '${e}'${r}`;this.error(i,{code:"commander.unknownOption"});}_excessArguments(e){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,i=r===1?"":"s",n=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${i} but got ${e.length}.`;this.error(n,{code:"commander.excessArguments"});}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let s=[];this.createHelp().visibleCommands(this).forEach(n=>{s.push(n.name()),n.alias()&&s.push(n.alias());}),r=Hu(e,s);}let i=`error: unknown command '${e}'${r}`;this.error(i,{code:"commander.unknownCommand"});}version(e,r,i){if(e===void 0)return this._version;this._version=e,r=r||"-V, --version",i=i||"output the version number";let s=this.createOption(r,i);return this._versionOptionName=s.attributeName(),this._registerOption(s),this.on("option:"+s.name(),()=>{this._outputConfiguration.writeOut(`${e}
25
- `),this._exit(0,"commander.version",e);}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");let i=this.parent?._findCommand(e);if(i){let s=[i.name()].concat(i.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${s}'`)}return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(i=>VD(i));return [].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup);}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup);}nameFromFilename(e){return this._name=ot.basename(e,ot.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp(),i=this._getOutputContext(e);r.prepareContext({error:i.error,helpWidth:i.helpWidth,outputHasColors:i.hasColors});let s=r.formatHelp(this,r);return i.hasColors?s:this._outputConfiguration.stripColor(s)}_getOutputContext(e){e=e||{};let r=!!e.error,i,s,n;return r?(i=a=>this._outputConfiguration.writeErr(a),s=this._outputConfiguration.getErrHasColors(),n=this._outputConfiguration.getErrHelpWidth()):(i=a=>this._outputConfiguration.writeOut(a),s=this._outputConfiguration.getOutHasColors(),n=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(s||(a=this._outputConfiguration.stripColor(a)),i(a)),hasColors:s,helpWidth:n}}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let i=this._getOutputContext(e),s={error:i.error,write:i.write,command:this};this._getCommandAndAncestors().reverse().forEach(o=>o.emit("beforeAllHelp",s)),this.emit("beforeHelp",s);let n=this.helpInformation({error:i.error});if(r&&(n=r(n),typeof n!="string"&&!Buffer.isBuffer(n)))throw new Error("outputHelp callback must return a string or a Buffer");i.write(n),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",s),this._getCommandAndAncestors().forEach(o=>o.emit("afterAllHelp",s));}helpOption(e,r){return typeof e=="boolean"?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??"-h, --help",r??"display help for command"),(e||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let r=Number(W.exitCode??0);r===0&&e&&typeof e!="function"&&e.error&&(r=1),this._exit(r,"commander.help","(outputHelp)");}addHelpText(e,r){let i=["beforeAll","before","after","afterAll"];if(!i.includes(e))throw new Error(`Unexpected value for position to addHelpText.
26
- Expecting one of '${i.join("', '")}'`);let s=`${e}Help`;return this.on(s,n=>{let o;typeof r=="function"?o=r({error:n.error,command:n.command}):o=r,o&&n.write(`${o}
27
- `);}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(s=>r.is(s))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"));}};function qu(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,i="127.0.0.1",s="9229",n;return (n=e.match(/^(--inspect(-brk)?)$/))!==null?r=n[1]:(n=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=n[1],/^\d+$/.test(n[3])?s=n[3]:i=n[3]):(n=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=n[1],i=n[3],s=n[4]),r&&s!=="0"?`${r}=${i}:${parseInt(s)+1}`:e})}function js(){if(W.env.NO_COLOR||W.env.FORCE_COLOR==="0"||W.env.FORCE_COLOR==="false")return false;if(W.env.FORCE_COLOR||W.env.CLICOLOR_FORCE!==void 0)return true}Gs.Command=Ls;Gs.useColor=js;});var Wu=y(Se=>{var{Argument:ju}=oi(),{Command:Vs}=Lu(),{CommanderError:YD,InvalidArgumentError:Gu}=Cr(),{Help:JD}=ks(),{Option:Vu}=Ns();Se.program=new Vs;Se.createCommand=t=>new Vs(t);Se.createOption=(t,e)=>new Vu(t,e);Se.createArgument=(t,e)=>new ju(t,e);Se.Command=Vs;Se.Option=Vu;Se.Argument=ju;Se.Help=JD;Se.CommanderError=YD;Se.InvalidArgumentError=Gu;Se.InvalidOptionArgumentError=Gu;});var Ot=y((tA,Xs)=>{var ci=process||{},zu=ci.argv||[],li=ci.env||{},a0=!(li.NO_COLOR||zu.includes("--no-color"))&&(!!li.FORCE_COLOR||zu.includes("--color")||ci.platform==="win32"||(ci.stdout||{}).isTTY&&li.TERM!=="dumb"||!!li.CI),u0=(t,e,r=t)=>i=>{let s=""+i,n=s.indexOf(e,t.length);return ~n?t+l0(s,e,r,n)+e:t+s+e},l0=(t,e,r,i)=>{let s="",n=0;do s+=t.substring(n,i)+r,n=i+e.length,i=t.indexOf(e,n);while(~i);return s+t.substring(n)},Xu=(t=a0)=>{let e=t?u0:()=>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")}};Xs.exports=Xu();Xs.exports.createColors=Xu;});var se=y((rA,Qu)=>{var{FORCE_COLOR:c0,NODE_DISABLE_COLORS:h0,TERM:d0}=process.env,K={enabled:!h0&&d0!=="dumb"&&c0!=="0",reset:z(0,0),bold:z(1,22),dim:z(2,22),italic:z(3,23),underline:z(4,24),inverse:z(7,27),hidden:z(8,28),strikethrough:z(9,29),black:z(30,39),red:z(31,39),green:z(32,39),yellow:z(33,39),blue:z(34,39),magenta:z(35,39),cyan:z(36,39),white:z(37,39),gray:z(90,39),grey:z(90,39),bgBlack:z(40,49),bgRed:z(41,49),bgGreen:z(42,49),bgYellow:z(43,49),bgBlue:z(44,49),bgMagenta:z(45,49),bgCyan:z(46,49),bgWhite:z(47,49)};function Zu(t,e){let r=0,i,s="",n="";for(;r<t.length;r++)i=t[r],s+=i.open,n+=i.close,e.includes(i.close)&&(e=e.replace(i.rgx,i.close+i.open));return s+e+n}function f0(t,e){let r={has:t,keys:e};return r.reset=K.reset.bind(r),r.bold=K.bold.bind(r),r.dim=K.dim.bind(r),r.italic=K.italic.bind(r),r.underline=K.underline.bind(r),r.inverse=K.inverse.bind(r),r.hidden=K.hidden.bind(r),r.strikethrough=K.strikethrough.bind(r),r.black=K.black.bind(r),r.red=K.red.bind(r),r.green=K.green.bind(r),r.yellow=K.yellow.bind(r),r.blue=K.blue.bind(r),r.magenta=K.magenta.bind(r),r.cyan=K.cyan.bind(r),r.white=K.white.bind(r),r.gray=K.gray.bind(r),r.grey=K.grey.bind(r),r.bgBlack=K.bgBlack.bind(r),r.bgRed=K.bgRed.bind(r),r.bgGreen=K.bgGreen.bind(r),r.bgYellow=K.bgYellow.bind(r),r.bgBlue=K.bgBlue.bind(r),r.bgMagenta=K.bgMagenta.bind(r),r.bgCyan=K.bgCyan.bind(r),r.bgWhite=K.bgWhite.bind(r),r}function z(t,e){let r={open:`\x1B[${t}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(i){return this!==void 0&&this.has!==void 0?(this.has.includes(t)||(this.has.push(t),this.keys.push(r)),i===void 0?this:K.enabled?Zu(this.keys,i+""):i+""):i===void 0?f0([t],[r]):K.enabled?Zu([r],i+""):i+""}}Qu.exports=K;});var tl=y((iA,el)=>{el.exports=(t,e)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return "first";if(t.name==="c"||t.name==="d")return "abort";if(t.name==="e")return "last";if(t.name==="g")return "reset"}if(e){if(t.name==="j")return "down";if(t.name==="k")return "up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":false}};});var hi=y((sA,rl)=>{rl.exports=t=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),r=new RegExp(e,"g");return typeof t=="string"?t.replace(r,""):t};});var oe=y((nA,il)=>{var Zs="\x1B",ne=`${Zs}[`,p0="\x07",Qs={to(t,e){return e?`${ne}${e+1};${t+1}H`:`${ne}${t+1}G`},move(t,e){let r="";return t<0?r+=`${ne}${-t}D`:t>0&&(r+=`${ne}${t}C`),e<0?r+=`${ne}${-e}A`:e>0&&(r+=`${ne}${e}B`),r},up:(t=1)=>`${ne}${t}A`,down:(t=1)=>`${ne}${t}B`,forward:(t=1)=>`${ne}${t}C`,backward:(t=1)=>`${ne}${t}D`,nextLine:(t=1)=>`${ne}E`.repeat(t),prevLine:(t=1)=>`${ne}F`.repeat(t),left:`${ne}G`,hide:`${ne}?25l`,show:`${ne}?25h`,save:`${Zs}7`,restore:`${Zs}8`},m0={up:(t=1)=>`${ne}S`.repeat(t),down:(t=1)=>`${ne}T`.repeat(t)},g0={screen:`${ne}2J`,up:(t=1)=>`${ne}1J`.repeat(t),down:(t=1)=>`${ne}J`.repeat(t),line:`${ne}2K`,lineEnd:`${ne}K`,lineStart:`${ne}1K`,lines(t){let e="";for(let r=0;r<t;r++)e+=this.line+(r<t-1?Qs.up():"");return t&&(e+=Qs.left),e}};il.exports={cursor:Qs,scroll:m0,erase:g0,beep:p0};});var ul=y((oA,al)=>{function D0(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=b0(t))||e){r&&(t=r);var i=0,s=function(){};return {s,n:function(){return i>=t.length?{done:true}:{done:false,value:t[i++]}},e:function(h){throw h},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
28
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var n=true,o=false,a;return {s:function(){r=r.call(t);},n:function(){var h=r.next();return n=h.done,h},e:function(h){o=true,a=h;},f:function(){try{!n&&r.return!=null&&r.return();}finally{if(o)throw a}}}}function b0(t,e){if(t){if(typeof t=="string")return sl(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return sl(t,e)}}function sl(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}var v0=hi(),ol=oe(),nl=ol.erase,y0=ol.cursor,C0=t=>[...v0(t)].length;al.exports=function(t,e){if(!e)return nl.line+y0.to(0);let r=0,i=t.split(/\r?\n/);var s=D0(i),n;try{for(s.s();!(n=s.n()).done;){let o=n.value;r+=1+Math.floor(Math.max(C0(o)-1,0)/e);}}catch(o){s.e(o);}finally{s.f();}return nl.lines(r)};});var en=y((aA,ll)=>{var _r={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},_0={arrowUp:_r.arrowUp,arrowDown:_r.arrowDown,arrowLeft:_r.arrowLeft,arrowRight:_r.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},w0=process.platform==="win32"?_0:_r;ll.exports=w0;});var hl=y((uA,cl)=>{var Qt=se(),St=en(),tn=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"\u{1F603}".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}}),x0=t=>tn[t]||tn.default,wr=Object.freeze({aborted:Qt.red(St.cross),done:Qt.green(St.tick),exited:Qt.yellow(St.cross),default:Qt.cyan("?")}),F0=(t,e,r)=>e?wr.aborted:r?wr.exited:t?wr.done:wr.default,E0=t=>Qt.gray(t?St.ellipsis:St.pointerSmall),A0=(t,e)=>Qt.gray(t?e?St.pointerSmall:"+":St.line);cl.exports={styles:tn,render:x0,symbols:wr,symbol:F0,delimiter:E0,item:A0};});var fl=y((lA,dl)=>{var $0=hi();dl.exports=function(t,e){let r=String($0(t)||"").split(/\r?\n/);return e?r.map(i=>Math.ceil(i.length/e)).reduce((i,s)=>i+s):r.length};});var ml=y((cA,pl)=>{pl.exports=(t,e={})=>{let r=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",i=e.width;return (t||"").split(/\r?\n/g).map(s=>s.split(/\s+/g).reduce((n,o)=>(o.length+r.length>=i||n[n.length-1].length+o.length+1<i?n[n.length-1]+=` ${o}`:n.push(`${r}${o}`),n),[r]).join(`
29
- `)).join(`
30
- `)};});var Dl=y((hA,gl)=>{gl.exports=(t,e,r)=>{r=r||e;let i=Math.min(e-r,t-Math.floor(r/2));i<0&&(i=0);let s=Math.min(i+r,e);return {startIndex:i,endIndex:s}};});var Me=y((dA,bl)=>{bl.exports={action:tl(),clear:ul(),style:hl(),strip:hi(),figures:en(),lines:fl(),wrap:ml(),entriesToDisplay:Dl()};});var at=y((fA,Cl)=>{var vl=H("readline"),O0=Me(),S0=O0.action,R0=H("events"),yl=oe(),T0=yl.beep,P0=yl.cursor,k0=se(),rn=class extends R0{constructor(e={}){super(),this.firstRender=true,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let r=vl.createInterface({input:this.in,escapeCodeTimeout:50});vl.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(true);let i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,s=(n,o)=>{let a=S0(o,i);a===false?this._&&this._(n,o):typeof this[a]=="function"?this[a](o):this.bell();};this.close=()=>{this.out.write(P0.show),this.in.removeListener("keypress",s),this.in.isTTY&&this.in.setRawMode(false),r.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=true;},this.in.on("keypress",s);}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited});}bell(){this.out.write(T0);}render(){this.onRender(k0),this.firstRender&&(this.firstRender=false);}};Cl.exports=rn;});var El=y((pA,Fl)=>{function _l(t,e,r,i,s,n,o){try{var a=t[n](o),u=a.value;}catch(h){r(h);return}a.done?e(u):Promise.resolve(u).then(i,s);}function wl(t){return function(){var e=this,r=arguments;return new Promise(function(i,s){var n=t.apply(e,r);function o(u){_l(n,i,s,o,a,"next",u);}function a(u){_l(n,i,s,o,a,"throw",u);}o(void 0);})}}var di=se(),I0=at(),xl=oe(),M0=xl.erase,xr=xl.cursor,fi=Me(),sn=fi.style,nn=fi.clear,B0=fi.lines,N0=fi.figures,on=class extends I0{constructor(e={}){super(e),this.transform=sn.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>true),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=nn("",this.out.columns),this.render();}set value(e){!e&&this.initial?(this.placeholder=true,this.rendered=di.gray(this.transform.render(this.initial))):(this.placeholder=false,this.rendered=this.transform.render(e)),this._value=e,this.fire();}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render();}exit(){this.abort();}abort(){this.value=this.value||this.initial,this.done=this.aborted=true,this.error=false,this.red=false,this.fire(),this.render(),this.out.write(`
31
- `),this.close();}validate(){var e=this;return wl(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=false),e.error=!r;})()}submit(){var e=this;return wl(function*(){if(e.value=e.value||e.initial,e.cursorOffset=0,e.cursor=e.rendered.length,yield e.validate(),e.error){e.red=true,e.fire(),e.render();return}e.done=true,e.aborted=false,e.fire(),e.render(),e.out.write(`
32
- `),e.close();})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render();}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e);}_(e,r){let i=this.value.slice(0,this.cursor),s=this.value.slice(this.cursor);this.value=`${i}${e}${s}`,this.red=false,this.cursor=this.placeholder?0:i.length+1,this.render();}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),r=this.value.slice(this.cursor);this.value=`${e}${r}`,this.red=false,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render();}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor+1);this.value=`${e}${r}`,this.red=false,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render();}first(){this.cursor=0,this.render();}last(){this.cursor=this.value.length,this.render();}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render();}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render();}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(xr.down(B0(this.outputError,this.out.columns)-1)+nn(this.outputError,this.out.columns)),this.out.write(nn(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[sn.symbol(this.done,this.aborted),di.bold(this.msg),sn.delimiter(this.done),this.red?di.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
33
- `).reduce((e,r,i)=>e+`
34
- ${i?" ":N0.pointerSmall} ${di.red().italic(r)}`,"")),this.out.write(M0.line+xr.to(0)+this.outputText+xr.save+this.outputError+xr.restore+xr.move(this.cursorOffset,0)));}};Fl.exports=on;});var Sl=y((mA,Ol)=>{var ut=se(),H0=at(),Fr=Me(),Al=Fr.style,$l=Fr.clear,pi=Fr.figures,q0=Fr.wrap,L0=Fr.entriesToDisplay,j0=oe(),G0=j0.cursor,an=class extends H0{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((r,i)=>(typeof r=="string"&&(r={title:r,value:i}),{title:r&&(r.title||r.value||r),value:r&&(r.value===void 0?i:r.value),description:r&&r.description,selected:r&&r.selected,disabled:r&&r.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=$l("",this.out.columns),this.render();}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire();}reset(){this.moveCursor(0),this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
35
- `),this.close();}submit(){this.selection.disabled?this.bell():(this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
36
- `),this.close());}first(){this.moveCursor(0),this.render();}last(){this.moveCursor(this.choices.length-1),this.render();}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render();}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render();}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render();}_(e,r){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(G0.hide):this.out.write($l(this.outputText,this.out.columns)),super.render();let e=L0(this.cursor,this.choices.length,this.optionsPerPage),r=e.startIndex,i=e.endIndex;if(this.outputText=[Al.symbol(this.done,this.aborted),ut.bold(this.msg),Al.delimiter(false),this.done?this.selection.title:this.selection.disabled?ut.yellow(this.warn):ut.gray(this.hint)].join(" "),!this.done){this.outputText+=`
37
- `;for(let s=r;s<i;s++){let n,o,a="",u=this.choices[s];s===r&&r>0?o=pi.arrowUp:s===i-1&&i<this.choices.length?o=pi.arrowDown:o=" ",u.disabled?(n=this.cursor===s?ut.gray().underline(u.title):ut.strikethrough().gray(u.title),o=(this.cursor===s?ut.bold().gray(pi.pointer)+" ":" ")+o):(n=this.cursor===s?ut.cyan().underline(u.title):u.title,o=(this.cursor===s?ut.cyan(pi.pointer)+" ":" ")+o,u.description&&this.cursor===s&&(a=` - ${u.description}`,(o.length+n.length+a.length>=this.out.columns||u.description.split(/\r?\n/).length>1)&&(a=`
38
- `+q0(u.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${n}${ut.gray(a)}
39
- `;}}this.out.write(this.outputText);}};Ol.exports=an;});var Ml=y((gA,Il)=>{var mi=se(),V0=at(),Pl=Me(),Rl=Pl.style,W0=Pl.clear,kl=oe(),Tl=kl.cursor,U0=kl.erase,un=class extends V0{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render();}reset(){this.value=this.initialValue,this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
40
- `),this.close();}submit(){this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
41
- `),this.close();}deactivate(){if(this.value===false)return this.bell();this.value=false,this.render();}activate(){if(this.value===true)return this.bell();this.value=true,this.render();}delete(){this.deactivate();}left(){this.deactivate();}right(){this.activate();}down(){this.deactivate();}up(){this.activate();}next(){this.value=!this.value,this.fire(),this.render();}_(e,r){if(e===" ")this.value=!this.value;else if(e==="1")this.value=true;else if(e==="0")this.value=false;else return this.bell();this.render();}render(){this.closed||(this.firstRender?this.out.write(Tl.hide):this.out.write(W0(this.outputText,this.out.columns)),super.render(),this.outputText=[Rl.symbol(this.done,this.aborted),mi.bold(this.msg),Rl.delimiter(this.done),this.value?this.inactive:mi.cyan().underline(this.inactive),mi.gray("/"),this.value?mi.cyan().underline(this.active):this.active].join(" "),this.out.write(U0.line+Tl.to(0)+this.outputText));}};Il.exports=un;});var Ke=y((DA,Bl)=>{var ln=class t{constructor({token:e,date:r,parts:i,locales:s}){this.token=e,this.date=r||new Date,this.parts=i||[this],this.locales=s||{};}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((r,i)=>i>e&&r instanceof t)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),r=e.indexOf(this);return e.find((i,s)=>s>r&&i instanceof t)}toString(){return String(this.date)}};Bl.exports=ln;});var Hl=y((bA,Nl)=>{var K0=Ke(),cn=class extends K0{constructor(e={}){super(e);}up(){this.date.setHours((this.date.getHours()+12)%24);}down(){this.up();}toString(){let e=this.date.getHours()>12?"pm":"am";return /\A/.test(this.token)?e.toUpperCase():e}};Nl.exports=cn;});var Ll=y((vA,ql)=>{var Y0=Ke(),J0=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th"),hn=class extends Y0{constructor(e={}){super(e);}up(){this.date.setDate(this.date.getDate()+1);}down(){this.date.setDate(this.date.getDate()-1);}setTo(e){this.date.setDate(parseInt(e.substr(-2)));}toString(){let e=this.date.getDate(),r=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+J0(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};ql.exports=hn;});var Gl=y((yA,jl)=>{var z0=Ke(),dn=class extends z0{constructor(e={}){super(e);}up(){this.date.setHours(this.date.getHours()+1);}down(){this.date.setHours(this.date.getHours()-1);}setTo(e){this.date.setHours(parseInt(e.substr(-2)));}toString(){let e=this.date.getHours();return /h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};jl.exports=dn;});var Wl=y((CA,Vl)=>{var X0=Ke(),fn=class extends X0{constructor(e={}){super(e);}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1);}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1);}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)));}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};Vl.exports=fn;});var Kl=y((_A,Ul)=>{var Z0=Ke(),pn=class extends Z0{constructor(e={}){super(e);}up(){this.date.setMinutes(this.date.getMinutes()+1);}down(){this.date.setMinutes(this.date.getMinutes()-1);}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)));}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};Ul.exports=pn;});var Jl=y((wA,Yl)=>{var Q0=Ke(),mn=class extends Q0{constructor(e={}){super(e);}up(){this.date.setMonth(this.date.getMonth()+1);}down(){this.date.setMonth(this.date.getMonth()-1);}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e);}toString(){let e=this.date.getMonth(),r=this.token.length;return r===2?String(e+1).padStart(2,"0"):r===3?this.locales.monthsShort[e]:r===4?this.locales.months[e]:String(e+1)}};Yl.exports=mn;});var Xl=y((xA,zl)=>{var eb=Ke(),gn=class extends eb{constructor(e={}){super(e);}up(){this.date.setSeconds(this.date.getSeconds()+1);}down(){this.date.setSeconds(this.date.getSeconds()-1);}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)));}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};zl.exports=gn;});var Ql=y((FA,Zl)=>{var tb=Ke(),Dn=class extends tb{constructor(e={}){super(e);}up(){this.date.setFullYear(this.date.getFullYear()+1);}down(){this.date.setFullYear(this.date.getFullYear()-1);}setTo(e){this.date.setFullYear(e.substr(-4));}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};Zl.exports=Dn;});var tc=y((EA,ec)=>{ec.exports={DatePart:Ke(),Meridiem:Hl(),Day:Ll(),Hours:Gl(),Milliseconds:Wl(),Minutes:Kl(),Month:Jl(),Seconds:Xl(),Year:Ql()};});var hc=y((AA,cc)=>{function rc(t,e,r,i,s,n,o){try{var a=t[n](o),u=a.value;}catch(h){r(h);return}a.done?e(u):Promise.resolve(u).then(i,s);}function ic(t){return function(){var e=this,r=arguments;return new Promise(function(i,s){var n=t.apply(e,r);function o(u){rc(n,i,s,o,a,"next",u);}function a(u){rc(n,i,s,o,a,"throw",u);}o(void 0);})}}var bn=se(),rb=at(),yn=Me(),sc=yn.style,nc=yn.clear,ib=yn.figures,lc=oe(),sb=lc.erase,oc=lc.cursor,lt=tc(),ac=lt.DatePart,nb=lt.Meridiem,ob=lt.Day,ab=lt.Hours,ub=lt.Milliseconds,lb=lt.Minutes,cb=lt.Month,hb=lt.Seconds,db=lt.Year,fb=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,uc={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new ob(t),3:t=>new cb(t),4:t=>new db(t),5:t=>new nb(t),6:t=>new ab(t),7:t=>new lb(t),8:t=>new hb(t),9:t=>new ub(t)},pb={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")},vn=class extends rb{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(pb,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>true),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=nc("",this.out.columns),this.render();}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime());}set mask(e){let r;for(this.parts=[];r=fb.exec(e);){let s=r.shift(),n=r.findIndex(o=>o!=null);this.parts.push(n in uc?uc[n]({token:r[n]||s,date:this.date,parts:this.parts,locales:this.locales}):r[n]||s);}let i=this.parts.reduce((s,n)=>(typeof n=="string"&&typeof s[s.length-1]=="string"?s[s.length-1]+=n:s.push(n),s),[]);this.parts.splice(0),this.parts.push(...i),this.reset();}moveCursor(e){this.typed="",this.cursor=e,this.fire();}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof ac)),this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.error=false,this.fire(),this.render(),this.out.write(`
42
- `),this.close();}validate(){var e=this;return ic(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=false),e.error=!r;})()}submit(){var e=this;return ic(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}e.done=true,e.aborted=false,e.fire(),e.render(),e.out.write(`
43
- `),e.close();})()}up(){this.typed="",this.parts[this.cursor].up(),this.render();}down(){this.typed="",this.parts[this.cursor].down(),this.render();}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render();}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render();}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(r=>r instanceof ac)),this.render();}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render());}render(){this.closed||(this.firstRender?this.out.write(oc.hide):this.out.write(nc(this.outputText,this.out.columns)),super.render(),this.outputText=[sc.symbol(this.done,this.aborted),bn.bold(this.msg),sc.delimiter(false),this.parts.reduce((e,r,i)=>e.concat(i===this.cursor&&!this.done?bn.cyan().underline(r.toString()):r),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
44
- `).reduce((e,r,i)=>e+`
45
- ${i?" ":ib.pointerSmall} ${bn.red().italic(r)}`,"")),this.out.write(sb.line+oc.to(0)+this.outputText));}};cc.exports=vn;});var bc=y(($A,Dc)=>{function dc(t,e,r,i,s,n,o){try{var a=t[n](o),u=a.value;}catch(h){r(h);return}a.done?e(u):Promise.resolve(u).then(i,s);}function fc(t){return function(){var e=this,r=arguments;return new Promise(function(i,s){var n=t.apply(e,r);function o(u){dc(n,i,s,o,a,"next",u);}function a(u){dc(n,i,s,o,a,"throw",u);}o(void 0);})}}var gi=se(),mb=at(),gc=oe(),Di=gc.cursor,gb=gc.erase,bi=Me(),Cn=bi.style,Db=bi.figures,pc=bi.clear,bb=bi.lines,vb=/[0-9]/,_n=t=>t!==void 0,mc=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},wn=class extends mb{constructor(e={}){super(e),this.transform=Cn.render(e.style),this.msg=e.message,this.initial=_n(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=_n(e.min)?e.min:-1/0,this.max=_n(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>true),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render();}set value(e){!e&&e!==0?(this.placeholder=true,this.rendered=gi.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=false,this.rendered=this.transform.render(`${mc(e,this.round)}`),this._value=mc(e,this.round)),this.fire();}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||vb.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render();}exit(){this.abort();}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=true,this.error=false,this.fire(),this.render(),this.out.write(`
46
- `),this.close();}validate(){var e=this;return fc(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=false),e.error=!r;})()}submit(){var e=this;return fc(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}let r=e.value;e.value=r!==""?r:e.initial,e.done=true,e.aborted=false,e.error=false,e.fire(),e.render(),e.out.write(`
47
- `),e.close();})()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render();}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render();}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render();}next(){this.value=this.initial,this.fire(),this.render();}_(e,r){if(!this.valid(e))return this.bell();let i=Date.now();if(i-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=i,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render();}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(Di.down(bb(this.outputError,this.out.columns)-1)+pc(this.outputError,this.out.columns)),this.out.write(pc(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Cn.symbol(this.done,this.aborted),gi.bold(this.msg),Cn.delimiter(this.done),!this.done||!this.done&&!this.placeholder?gi[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
48
- `).reduce((e,r,i)=>e+`
49
- ${i?" ":Db.pointerSmall} ${gi.red().italic(r)}`,"")),this.out.write(gb.line+Di.to(0)+this.outputText+Di.save+this.outputError+Di.restore));}};Dc.exports=wn;});var Fn=y((OA,Cc)=>{var Ye=se(),yb=oe(),Cb=yb.cursor,_b=at(),Er=Me(),vc=Er.clear,Ct=Er.figures,yc=Er.style,wb=Er.wrap,xb=Er.entriesToDisplay,xn=class extends _b{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=false,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((r,i)=>(typeof r=="string"&&(r={title:r,value:i}),{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===void 0?i:r.value),selected:r&&r.selected,disabled:r&&r.disabled})),this.clear=vc("",this.out.columns),e.overrideRender||this.render();}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render();}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
50
- `),this.close();}submit(){let e=this.value.filter(r=>r.selected);this.minSelected&&e.length<this.minSelected?(this.showMinError=true,this.render()):(this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
51
- `),this.close());}first(){this.cursor=0,this.render();}last(){this.cursor=this.value.length-1,this.render();}next(){this.cursor=(this.cursor+1)%this.value.length,this.render();}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render();}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render();}left(){this.value[this.cursor].selected=false,this.render();}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=true,this.render();}handleSpaceToggle(){let e=this.value[this.cursor];if(e.selected)e.selected=false,this.render();else {if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=true,this.render();}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let e=!this.value[this.cursor].selected;this.value.filter(r=>!r.disabled).forEach(r=>r.selected=e),this.render();}_(e,r){if(e===" ")this.handleSpaceToggle();else if(e==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
52
- Instructions:
53
- ${Ct.arrowUp}/${Ct.arrowDown}: Highlight option
54
- ${Ct.arrowLeft}/${Ct.arrowRight}/[space]: Toggle selection
55
- `+(this.maxChoices===void 0?` a: Toggle all
56
- `:"")+" enter/return: Complete answer":""}renderOption(e,r,i,s){let n=(r.selected?Ye.green(Ct.radioOn):Ct.radioOff)+" "+s+" ",o,a;return r.disabled?o=e===i?Ye.gray().underline(r.title):Ye.strikethrough().gray(r.title):(o=e===i?Ye.cyan().underline(r.title):r.title,e===i&&r.description&&(a=` - ${r.description}`,(n.length+o.length+a.length>=this.out.columns||r.description.split(/\r?\n/).length>1)&&(a=`
57
- `+wb(r.description,{margin:n.length,width:this.out.columns})))),n+o+Ye.gray(a||"")}paginateOptions(e){if(e.length===0)return Ye.red("No matches for this query.");let r=xb(this.cursor,e.length,this.optionsPerPage),i=r.startIndex,s=r.endIndex,n,o=[];for(let a=i;a<s;a++)a===i&&i>0?n=Ct.arrowUp:a===s-1&&s<e.length?n=Ct.arrowDown:n=" ",o.push(this.renderOption(this.cursor,e[a],a,n));return `
58
- `+o.join(`
59
- `)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[Ye.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(Ye.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Cb.hide),super.render();let e=[yc.symbol(this.done,this.aborted),Ye.bold(this.msg),yc.delimiter(false),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Ye.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=false),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=vc(e,this.out.columns);}};Cc.exports=xn;});var $c=y((SA,Ac)=>{function _c(t,e,r,i,s,n,o){try{var a=t[n](o),u=a.value;}catch(h){r(h);return}a.done?e(u):Promise.resolve(u).then(i,s);}function Fb(t){return function(){var e=this,r=arguments;return new Promise(function(i,s){var n=t.apply(e,r);function o(u){_c(n,i,s,o,a,"next",u);}function a(u){_c(n,i,s,o,a,"throw",u);}o(void 0);})}}var Ar=se(),Eb=at(),Ec=oe(),Ab=Ec.erase,wc=Ec.cursor,$r=Me(),En=$r.style,xc=$r.clear,An=$r.figures,$b=$r.wrap,Ob=$r.entriesToDisplay,Fc=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),Sb=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]),Rb=(t,e)=>{let r=t.findIndex(i=>i.value===e||i.title===e);return r>-1?r:void 0},$n=class extends Eb{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:Rb(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||false,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=En.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=xc("",this.out.columns),this.complete(this.render),this.render();}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e;}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=Fc(this.suggestions,e):this.value=this.fallback.value,this.fire();}complete(e){var r=this;return Fb(function*(){let i=r.completing=r.suggest(r.input,r.choices),s=yield i;if(r.completing!==i)return;r.suggestions=s.map((o,a,u)=>({title:Sb(u,a),value:Fc(u,a),description:o.description})),r.completing=false;let n=Math.max(s.length-1,0);r.moveSelect(Math.min(n,r.select)),e&&e();})()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render();}),this.render();}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
60
- `),this.close());}abort(){this.done=this.aborted=true,this.exited=false,this.fire(),this.render(),this.out.write(`
61
- `),this.close();}submit(){this.done=true,this.aborted=this.exited=false,this.fire(),this.render(),this.out.write(`
62
- `),this.close();}_(e,r){let i=this.input.slice(0,this.cursor),s=this.input.slice(this.cursor);this.input=`${i}${e}${s}`,this.cursor=i.length+1,this.complete(this.render),this.render();}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),r=this.input.slice(this.cursor);this.input=`${e}${r}`,this.complete(this.render),this.cursor=this.cursor-1,this.render();}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor+1);this.input=`${e}${r}`,this.complete(this.render),this.render();}first(){this.moveSelect(0),this.render();}last(){this.moveSelect(this.suggestions.length-1),this.render();}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render();}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render();}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render();}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render();}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render();}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render();}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render();}renderOption(e,r,i,s){let n,o=i?An.arrowUp:s?An.arrowDown:" ",a=r?Ar.cyan().underline(e.title):e.title;return o=(r?Ar.cyan(An.pointer)+" ":" ")+o,e.description&&(n=` - ${e.description}`,(o.length+a.length+n.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(n=`
63
- `+$b(e.description,{margin:3,width:this.out.columns}))),o+" "+a+Ar.gray(n||"")}render(){if(this.closed)return;this.firstRender?this.out.write(wc.hide):this.out.write(xc(this.outputText,this.out.columns)),super.render();let e=Ob(this.select,this.choices.length,this.limit),r=e.startIndex,i=e.endIndex;if(this.outputText=[En.symbol(this.done,this.aborted,this.exited),Ar.bold(this.msg),En.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let s=this.suggestions.slice(r,i).map((n,o)=>this.renderOption(n,this.select===o+r,o===0&&r>0,o+r===i-1&&i<this.choices.length)).join(`
64
- `);this.outputText+=`
65
- `+(s||Ar.gray(this.fallback.title));}this.out.write(Ab.line+wc.to(0)+this.outputText);}};Ac.exports=$n;});var Tc=y((RA,Rc)=>{var ct=se(),Tb=oe(),Pb=Tb.cursor,kb=Fn(),Sn=Me(),Oc=Sn.clear,Sc=Sn.style,er=Sn.figures,On=class extends kb{constructor(e={}){e.overrideRender=true,super(e),this.inputValue="",this.clear=Oc("",this.out.columns),this.filteredOptions=this.value,this.render();}last(){this.cursor=this.filteredOptions.length-1,this.render();}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render();}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render();}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render();}left(){this.filteredOptions[this.cursor].selected=false,this.render();}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=true,this.render();}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions());}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(i=>this.inputValue?!!(typeof i.title=="string"&&i.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof i.value=="string"&&i.value.toLowerCase().includes(this.inputValue.toLowerCase())):true);let r=this.filteredOptions.findIndex(i=>i===e);this.cursor=r<0?0:r,this.render();}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=false,this.render();else {if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=true,this.render();}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions();}_(e,r){e===" "?this.handleSpaceToggle():this.handleInputChange(e);}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
66
- Instructions:
67
- ${er.arrowUp}/${er.arrowDown}: Highlight option
68
- ${er.arrowLeft}/${er.arrowRight}/[space]: Toggle selection
69
- [a,b,c]/delete: Filter choices
70
- enter/return: Complete answer
71
- `:""}renderCurrentInput(){return `
72
- Filtered results for: ${this.inputValue?this.inputValue:ct.gray("Enter something to filter")}
73
- `}renderOption(e,r,i){let s;return r.disabled?s=e===i?ct.gray().underline(r.title):ct.strikethrough().gray(r.title):s=e===i?ct.cyan().underline(r.title):r.title,(r.selected?ct.green(er.radioOn):er.radioOff)+" "+s}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[ct.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(ct.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Pb.hide),super.render();let e=[Sc.symbol(this.done,this.aborted),ct.bold(this.msg),Sc.delimiter(false),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=ct.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=false),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=Oc(e,this.out.columns);}};Rc.exports=On;});var Hc=y((TA,Nc)=>{var Pc=se(),Ib=at(),Mc=Me(),kc=Mc.style,Mb=Mc.clear,Bc=oe(),Bb=Bc.erase,Ic=Bc.cursor,Rn=class extends Ib{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render();}reset(){this.value=this.initialValue,this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
74
- `),this.close();}submit(){this.value=this.value||false,this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
75
- `),this.close();}_(e,r){return e.toLowerCase()==="y"?(this.value=true,this.submit()):e.toLowerCase()==="n"?(this.value=false,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(Ic.hide):this.out.write(Mb(this.outputText,this.out.columns)),super.render(),this.outputText=[kc.symbol(this.done,this.aborted),Pc.bold(this.msg),kc.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:Pc.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(Bb.line+Ic.to(0)+this.outputText));}};Nc.exports=Rn;});var Lc=y((PA,qc)=>{qc.exports={TextPrompt:El(),SelectPrompt:Sl(),TogglePrompt:Ml(),DatePrompt:hc(),NumberPrompt:bc(),MultiselectPrompt:Fn(),AutocompletePrompt:$c(),AutocompleteMultiselectPrompt:Tc(),ConfirmPrompt:Hc()};});var Gc=y(jc=>{var Ce=jc,Nb=Lc(),vi=t=>t;function Je(t,e,r={}){return new Promise((i,s)=>{let n=new Nb[t](e),o=r.onAbort||vi,a=r.onSubmit||vi,u=r.onExit||vi;n.on("state",e.onState||vi),n.on("submit",h=>i(a(h))),n.on("exit",h=>i(u(h))),n.on("abort",h=>s(o(h)));})}Ce.text=t=>Je("TextPrompt",t);Ce.password=t=>(t.style="password",Ce.text(t));Ce.invisible=t=>(t.style="invisible",Ce.text(t));Ce.number=t=>Je("NumberPrompt",t);Ce.date=t=>Je("DatePrompt",t);Ce.confirm=t=>Je("ConfirmPrompt",t);Ce.list=t=>{let e=t.separator||",";return Je("TextPrompt",t,{onSubmit:r=>r.split(e).map(i=>i.trim())})};Ce.toggle=t=>Je("TogglePrompt",t);Ce.select=t=>Je("SelectPrompt",t);Ce.multiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(i=>i.selected).map(i=>i.value);return Je("MultiselectPrompt",t,{onAbort:e,onSubmit:e})};Ce.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(i=>i.selected).map(i=>i.value);return Je("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};var Hb=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));Ce.autocomplete=t=>(t.suggest=t.suggest||Hb,t.choices=[].concat(t.choices||[]),Je("AutocompletePrompt",t));});var Xc=y((IA,zc)=>{function Vc(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,i);}return r}function Wc(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Vc(Object(r),true).forEach(function(i){qb(t,i,r[i]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Vc(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i));});}return t}function qb(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:true,configurable:true,writable:true}):t[e]=r,t}function Lb(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=jb(t))||e){r&&(t=r);var i=0,s=function(){};return {s,n:function(){return i>=t.length?{done:true}:{done:false,value:t[i++]}},e:function(h){throw h},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
76
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var n=true,o=false,a;return {s:function(){r=r.call(t);},n:function(){var h=r.next();return n=h.done,h},e:function(h){o=true,a=h;},f:function(){try{!n&&r.return!=null&&r.return();}finally{if(o)throw a}}}}function jb(t,e){if(t){if(typeof t=="string")return Uc(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Uc(t,e)}}function Uc(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function Kc(t,e,r,i,s,n,o){try{var a=t[n](o),u=a.value;}catch(h){r(h);return}a.done?e(u):Promise.resolve(u).then(i,s);}function Yc(t){return function(){var e=this,r=arguments;return new Promise(function(i,s){var n=t.apply(e,r);function o(u){Kc(n,i,s,o,a,"next",u);}function a(u){Kc(n,i,s,o,a,"throw",u);}o(void 0);})}}var Tn=Gc(),Gb=["suggest","format","onState","validate","onRender","type"],Jc=()=>{};function _t(){return Pn.apply(this,arguments)}function Pn(){return Pn=Yc(function*(t=[],{onSubmit:e=Jc,onCancel:r=Jc}={}){let i={},s=_t._override||{};t=[].concat(t);let n,o,a,u,h,l,c=function(){var D=Yc(function*(x,b,v=false){if(!(!v&&x.validate&&x.validate(b)!==true))return x.format?yield x.format(b,i):b});return function(b,v){return D.apply(this,arguments)}}();var d=Lb(t),f;try{for(d.s();!(f=d.n()).done;){o=f.value;var m=o;if(u=m.name,h=m.type,typeof h=="function"&&(h=yield h(n,Wc({},i),o),o.type=h),!!h){for(let D in o){if(Gb.includes(D))continue;let x=o[D];o[D]=typeof x=="function"?yield x(n,Wc({},i),l):x;}if(l=o,typeof o.message!="string")throw new Error("prompt message is required");var g=o;if(u=g.name,h=g.type,Tn[h]===void 0)throw new Error(`prompt type (${h}) is not defined`);if(s[o.name]!==void 0&&(n=yield c(o,s[o.name]),n!==void 0)){i[u]=n;continue}try{n=_t._injected?Vb(_t._injected,o.initial):yield Tn[h](o),i[u]=n=yield c(o,n,!0),a=yield e(o,n,i);}catch{a=!(yield r(o,i));}if(a)return i}}}catch(D){d.e(D);}finally{d.f();}return i}),Pn.apply(this,arguments)}function Vb(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function Wb(t){_t._injected=(_t._injected||[]).concat(t);}function Ub(t){_t._override=Object.assign({},t);}zc.exports=Object.assign(_t,{prompt:_t,prompts:Tn,inject:Wb,override:Ub});});var Qc=y((MA,Zc)=>{Zc.exports=(t,e)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return "first";if(t.name==="c"||t.name==="d")return "abort";if(t.name==="e")return "last";if(t.name==="g")return "reset"}if(e){if(t.name==="j")return "down";if(t.name==="k")return "up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":false}};});var yi=y((BA,eh)=>{eh.exports=t=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),r=new RegExp(e,"g");return typeof t=="string"?t.replace(r,""):t};});var ih=y((NA,rh)=>{var Kb=yi(),{erase:th,cursor:Yb}=oe(),Jb=t=>[...Kb(t)].length;rh.exports=function(t,e){if(!e)return th.line+Yb.to(0);let r=0,i=t.split(/\r?\n/);for(let s of i)r+=1+Math.floor(Math.max(Jb(s)-1,0)/e);return th.lines(r)};});var kn=y((HA,sh)=>{var Or={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},zb={arrowUp:Or.arrowUp,arrowDown:Or.arrowDown,arrowLeft:Or.arrowLeft,arrowRight:Or.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},Xb=process.platform==="win32"?zb:Or;sh.exports=Xb;});var oh=y((qA,nh)=>{var tr=se(),Rt=kn(),In=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"\u{1F603}".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}}),Zb=t=>In[t]||In.default,Sr=Object.freeze({aborted:tr.red(Rt.cross),done:tr.green(Rt.tick),exited:tr.yellow(Rt.cross),default:tr.cyan("?")}),Qb=(t,e,r)=>e?Sr.aborted:r?Sr.exited:t?Sr.done:Sr.default,ev=t=>tr.gray(t?Rt.ellipsis:Rt.pointerSmall),tv=(t,e)=>tr.gray(t?e?Rt.pointerSmall:"+":Rt.line);nh.exports={styles:In,render:Zb,symbols:Sr,symbol:Qb,delimiter:ev,item:tv};});var uh=y((LA,ah)=>{var rv=yi();ah.exports=function(t,e){let r=String(rv(t)||"").split(/\r?\n/);return e?r.map(i=>Math.ceil(i.length/e)).reduce((i,s)=>i+s):r.length};});var ch=y((jA,lh)=>{lh.exports=(t,e={})=>{let r=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",i=e.width;return (t||"").split(/\r?\n/g).map(s=>s.split(/\s+/g).reduce((n,o)=>(o.length+r.length>=i||n[n.length-1].length+o.length+1<i?n[n.length-1]+=` ${o}`:n.push(`${r}${o}`),n),[r]).join(`
77
- `)).join(`
78
- `)};});var dh=y((GA,hh)=>{hh.exports=(t,e,r)=>{r=r||e;let i=Math.min(e-r,t-Math.floor(r/2));i<0&&(i=0);let s=Math.min(i+r,e);return {startIndex:i,endIndex:s}};});var Be=y((VA,fh)=>{fh.exports={action:Qc(),clear:ih(),style:oh(),strip:yi(),figures:kn(),lines:uh(),wrap:ch(),entriesToDisplay:dh()};});var ht=y((WA,mh)=>{var ph=H("readline"),{action:iv}=Be(),sv=H("events"),{beep:nv,cursor:ov}=oe(),av=se(),Mn=class extends sv{constructor(e={}){super(),this.firstRender=true,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let r=ph.createInterface({input:this.in,escapeCodeTimeout:50});ph.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(true);let i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,s=(n,o)=>{let a=iv(o,i);a===false?this._&&this._(n,o):typeof this[a]=="function"?this[a](o):this.bell();};this.close=()=>{this.out.write(ov.show),this.in.removeListener("keypress",s),this.in.isTTY&&this.in.setRawMode(false),r.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=true;},this.in.on("keypress",s);}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited});}bell(){this.out.write(nv);}render(){this.onRender(av),this.firstRender&&(this.firstRender=false);}};mh.exports=Mn;});var Dh=y((UA,gh)=>{var Ci=se(),uv=ht(),{erase:lv,cursor:Rr}=oe(),{style:Bn,clear:Nn,lines:cv,figures:hv}=Be(),Hn=class extends uv{constructor(e={}){super(e),this.transform=Bn.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>true),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=Nn("",this.out.columns),this.render();}set value(e){!e&&this.initial?(this.placeholder=true,this.rendered=Ci.gray(this.transform.render(this.initial))):(this.placeholder=false,this.rendered=this.transform.render(e)),this._value=e,this.fire();}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render();}exit(){this.abort();}abort(){this.value=this.value||this.initial,this.done=this.aborted=true,this.error=false,this.red=false,this.fire(),this.render(),this.out.write(`
79
- `),this.close();}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=false),this.error=!e;}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=true,this.fire(),this.render();return}this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
80
- `),this.close();}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render();}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e);}_(e,r){let i=this.value.slice(0,this.cursor),s=this.value.slice(this.cursor);this.value=`${i}${e}${s}`,this.red=false,this.cursor=this.placeholder?0:i.length+1,this.render();}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),r=this.value.slice(this.cursor);this.value=`${e}${r}`,this.red=false,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render();}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor+1);this.value=`${e}${r}`,this.red=false,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render();}first(){this.cursor=0,this.render();}last(){this.cursor=this.value.length,this.render();}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render();}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render();}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(Rr.down(cv(this.outputError,this.out.columns)-1)+Nn(this.outputError,this.out.columns)),this.out.write(Nn(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Bn.symbol(this.done,this.aborted),Ci.bold(this.msg),Bn.delimiter(this.done),this.red?Ci.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
81
- `).reduce((e,r,i)=>e+`
82
- ${i?" ":hv.pointerSmall} ${Ci.red().italic(r)}`,"")),this.out.write(lv.line+Rr.to(0)+this.outputText+Rr.save+this.outputError+Rr.restore+Rr.move(this.cursorOffset,0)));}};gh.exports=Hn;});var Ch=y((KA,yh)=>{var dt=se(),dv=ht(),{style:bh,clear:vh,figures:_i,wrap:fv,entriesToDisplay:pv}=Be(),{cursor:mv}=oe(),qn=class extends dv{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((r,i)=>(typeof r=="string"&&(r={title:r,value:i}),{title:r&&(r.title||r.value||r),value:r&&(r.value===void 0?i:r.value),description:r&&r.description,selected:r&&r.selected,disabled:r&&r.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=vh("",this.out.columns),this.render();}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire();}reset(){this.moveCursor(0),this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
83
- `),this.close();}submit(){this.selection.disabled?this.bell():(this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
84
- `),this.close());}first(){this.moveCursor(0),this.render();}last(){this.moveCursor(this.choices.length-1),this.render();}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render();}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render();}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render();}_(e,r){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(mv.hide):this.out.write(vh(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:r}=pv(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[bh.symbol(this.done,this.aborted),dt.bold(this.msg),bh.delimiter(false),this.done?this.selection.title:this.selection.disabled?dt.yellow(this.warn):dt.gray(this.hint)].join(" "),!this.done){this.outputText+=`
85
- `;for(let i=e;i<r;i++){let s,n,o="",a=this.choices[i];i===e&&e>0?n=_i.arrowUp:i===r-1&&r<this.choices.length?n=_i.arrowDown:n=" ",a.disabled?(s=this.cursor===i?dt.gray().underline(a.title):dt.strikethrough().gray(a.title),n=(this.cursor===i?dt.bold().gray(_i.pointer)+" ":" ")+n):(s=this.cursor===i?dt.cyan().underline(a.title):a.title,n=(this.cursor===i?dt.cyan(_i.pointer)+" ":" ")+n,a.description&&this.cursor===i&&(o=` - ${a.description}`,(n.length+s.length+o.length>=this.out.columns||a.description.split(/\r?\n/).length>1)&&(o=`
86
- `+fv(a.description,{margin:3,width:this.out.columns})))),this.outputText+=`${n} ${s}${dt.gray(o)}
87
- `;}}this.out.write(this.outputText);}};yh.exports=qn;});var Fh=y((YA,xh)=>{var wi=se(),gv=ht(),{style:_h,clear:Dv}=Be(),{cursor:wh,erase:bv}=oe(),Ln=class extends gv{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render();}reset(){this.value=this.initialValue,this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
88
- `),this.close();}submit(){this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
89
- `),this.close();}deactivate(){if(this.value===false)return this.bell();this.value=false,this.render();}activate(){if(this.value===true)return this.bell();this.value=true,this.render();}delete(){this.deactivate();}left(){this.deactivate();}right(){this.activate();}down(){this.deactivate();}up(){this.activate();}next(){this.value=!this.value,this.fire(),this.render();}_(e,r){if(e===" ")this.value=!this.value;else if(e==="1")this.value=true;else if(e==="0")this.value=false;else return this.bell();this.render();}render(){this.closed||(this.firstRender?this.out.write(wh.hide):this.out.write(Dv(this.outputText,this.out.columns)),super.render(),this.outputText=[_h.symbol(this.done,this.aborted),wi.bold(this.msg),_h.delimiter(this.done),this.value?this.inactive:wi.cyan().underline(this.inactive),wi.gray("/"),this.value?wi.cyan().underline(this.active):this.active].join(" "),this.out.write(bv.line+wh.to(0)+this.outputText));}};xh.exports=Ln;});var ze=y((JA,Eh)=>{var jn=class t{constructor({token:e,date:r,parts:i,locales:s}){this.token=e,this.date=r||new Date,this.parts=i||[this],this.locales=s||{};}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((r,i)=>i>e&&r instanceof t)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),r=e.indexOf(this);return e.find((i,s)=>s>r&&i instanceof t)}toString(){return String(this.date)}};Eh.exports=jn;});var $h=y((zA,Ah)=>{var vv=ze(),Gn=class extends vv{constructor(e={}){super(e);}up(){this.date.setHours((this.date.getHours()+12)%24);}down(){this.up();}toString(){let e=this.date.getHours()>12?"pm":"am";return /\A/.test(this.token)?e.toUpperCase():e}};Ah.exports=Gn;});var Sh=y((XA,Oh)=>{var yv=ze(),Cv=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th"),Vn=class extends yv{constructor(e={}){super(e);}up(){this.date.setDate(this.date.getDate()+1);}down(){this.date.setDate(this.date.getDate()-1);}setTo(e){this.date.setDate(parseInt(e.substr(-2)));}toString(){let e=this.date.getDate(),r=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+Cv(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};Oh.exports=Vn;});var Th=y((ZA,Rh)=>{var _v=ze(),Wn=class extends _v{constructor(e={}){super(e);}up(){this.date.setHours(this.date.getHours()+1);}down(){this.date.setHours(this.date.getHours()-1);}setTo(e){this.date.setHours(parseInt(e.substr(-2)));}toString(){let e=this.date.getHours();return /h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};Rh.exports=Wn;});var kh=y((QA,Ph)=>{var wv=ze(),Un=class extends wv{constructor(e={}){super(e);}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1);}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1);}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)));}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};Ph.exports=Un;});var Mh=y((e$,Ih)=>{var xv=ze(),Kn=class extends xv{constructor(e={}){super(e);}up(){this.date.setMinutes(this.date.getMinutes()+1);}down(){this.date.setMinutes(this.date.getMinutes()-1);}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)));}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};Ih.exports=Kn;});var Nh=y((t$,Bh)=>{var Fv=ze(),Yn=class extends Fv{constructor(e={}){super(e);}up(){this.date.setMonth(this.date.getMonth()+1);}down(){this.date.setMonth(this.date.getMonth()-1);}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e);}toString(){let e=this.date.getMonth(),r=this.token.length;return r===2?String(e+1).padStart(2,"0"):r===3?this.locales.monthsShort[e]:r===4?this.locales.months[e]:String(e+1)}};Bh.exports=Yn;});var qh=y((r$,Hh)=>{var Ev=ze(),Jn=class extends Ev{constructor(e={}){super(e);}up(){this.date.setSeconds(this.date.getSeconds()+1);}down(){this.date.setSeconds(this.date.getSeconds()-1);}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)));}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};Hh.exports=Jn;});var jh=y((i$,Lh)=>{var Av=ze(),zn=class extends Av{constructor(e={}){super(e);}up(){this.date.setFullYear(this.date.getFullYear()+1);}down(){this.date.setFullYear(this.date.getFullYear()-1);}setTo(e){this.date.setFullYear(e.substr(-4));}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};Lh.exports=zn;});var Vh=y((s$,Gh)=>{Gh.exports={DatePart:ze(),Meridiem:$h(),Day:Sh(),Hours:Th(),Milliseconds:kh(),Minutes:Mh(),Month:Nh(),Seconds:qh(),Year:jh()};});var Xh=y((n$,zh)=>{var Xn=se(),$v=ht(),{style:Wh,clear:Uh,figures:Ov}=Be(),{erase:Sv,cursor:Kh}=oe(),{DatePart:Yh,Meridiem:Rv,Day:Tv,Hours:Pv,Milliseconds:kv,Minutes:Iv,Month:Mv,Seconds:Bv,Year:Nv}=Vh(),Hv=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,Jh={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new Tv(t),3:t=>new Mv(t),4:t=>new Nv(t),5:t=>new Rv(t),6:t=>new Pv(t),7:t=>new Iv(t),8:t=>new Bv(t),9:t=>new kv(t)},qv={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")},Zn=class extends $v{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(qv,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>true),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=Uh("",this.out.columns),this.render();}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime());}set mask(e){let r;for(this.parts=[];r=Hv.exec(e);){let s=r.shift(),n=r.findIndex(o=>o!=null);this.parts.push(n in Jh?Jh[n]({token:r[n]||s,date:this.date,parts:this.parts,locales:this.locales}):r[n]||s);}let i=this.parts.reduce((s,n)=>(typeof n=="string"&&typeof s[s.length-1]=="string"?s[s.length-1]+=n:s.push(n),s),[]);this.parts.splice(0),this.parts.push(...i),this.reset();}moveCursor(e){this.typed="",this.cursor=e,this.fire();}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof Yh)),this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.error=false,this.fire(),this.render(),this.out.write(`
90
- `),this.close();}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=false),this.error=!e;}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
91
- `),this.close();}up(){this.typed="",this.parts[this.cursor].up(),this.render();}down(){this.typed="",this.parts[this.cursor].down(),this.render();}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render();}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render();}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(r=>r instanceof Yh)),this.render();}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render());}render(){this.closed||(this.firstRender?this.out.write(Kh.hide):this.out.write(Uh(this.outputText,this.out.columns)),super.render(),this.outputText=[Wh.symbol(this.done,this.aborted),Xn.bold(this.msg),Wh.delimiter(false),this.parts.reduce((e,r,i)=>e.concat(i===this.cursor&&!this.done?Xn.cyan().underline(r.toString()):r),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
92
- `).reduce((e,r,i)=>e+`
93
- ${i?" ":Ov.pointerSmall} ${Xn.red().italic(r)}`,"")),this.out.write(Sv.line+Kh.to(0)+this.outputText));}};zh.exports=Zn;});var td=y((o$,ed)=>{var xi=se(),Lv=ht(),{cursor:Fi,erase:jv}=oe(),{style:Qn,figures:Gv,clear:Zh,lines:Vv}=Be(),Wv=/[0-9]/,eo=t=>t!==void 0,Qh=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},to=class extends Lv{constructor(e={}){super(e),this.transform=Qn.render(e.style),this.msg=e.message,this.initial=eo(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=eo(e.min)?e.min:-1/0,this.max=eo(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>true),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render();}set value(e){!e&&e!==0?(this.placeholder=true,this.rendered=xi.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=false,this.rendered=this.transform.render(`${Qh(e,this.round)}`),this._value=Qh(e,this.round)),this.fire();}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||Wv.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render();}exit(){this.abort();}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=true,this.error=false,this.fire(),this.render(),this.out.write(`
94
- `),this.close();}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=false),this.error=!e;}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let e=this.value;this.value=e!==""?e:this.initial,this.done=true,this.aborted=false,this.error=false,this.fire(),this.render(),this.out.write(`
95
- `),this.close();}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render();}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render();}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render();}next(){this.value=this.initial,this.fire(),this.render();}_(e,r){if(!this.valid(e))return this.bell();let i=Date.now();if(i-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=i,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render();}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(Fi.down(Vv(this.outputError,this.out.columns)-1)+Zh(this.outputError,this.out.columns)),this.out.write(Zh(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Qn.symbol(this.done,this.aborted),xi.bold(this.msg),Qn.delimiter(this.done),!this.done||!this.done&&!this.placeholder?xi[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
96
- `).reduce((e,r,i)=>e+`
97
- ${i?" ":Gv.pointerSmall} ${xi.red().italic(r)}`,"")),this.out.write(jv.line+Fi.to(0)+this.outputText+Fi.save+this.outputError+Fi.restore));}};ed.exports=to;});var io=y((a$,sd)=>{var Xe=se(),{cursor:Uv}=oe(),Kv=ht(),{clear:rd,figures:wt,style:id,wrap:Yv,entriesToDisplay:Jv}=Be(),ro=class extends Kv{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=false,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((r,i)=>(typeof r=="string"&&(r={title:r,value:i}),{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===void 0?i:r.value),selected:r&&r.selected,disabled:r&&r.disabled})),this.clear=rd("",this.out.columns),e.overrideRender||this.render();}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render();}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
98
- `),this.close();}submit(){let e=this.value.filter(r=>r.selected);this.minSelected&&e.length<this.minSelected?(this.showMinError=true,this.render()):(this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
99
- `),this.close());}first(){this.cursor=0,this.render();}last(){this.cursor=this.value.length-1,this.render();}next(){this.cursor=(this.cursor+1)%this.value.length,this.render();}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render();}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render();}left(){this.value[this.cursor].selected=false,this.render();}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=true,this.render();}handleSpaceToggle(){let e=this.value[this.cursor];if(e.selected)e.selected=false,this.render();else {if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=true,this.render();}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let e=!this.value[this.cursor].selected;this.value.filter(r=>!r.disabled).forEach(r=>r.selected=e),this.render();}_(e,r){if(e===" ")this.handleSpaceToggle();else if(e==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
100
- Instructions:
101
- ${wt.arrowUp}/${wt.arrowDown}: Highlight option
102
- ${wt.arrowLeft}/${wt.arrowRight}/[space]: Toggle selection
103
- `+(this.maxChoices===void 0?` a: Toggle all
104
- `:"")+" enter/return: Complete answer":""}renderOption(e,r,i,s){let n=(r.selected?Xe.green(wt.radioOn):wt.radioOff)+" "+s+" ",o,a;return r.disabled?o=e===i?Xe.gray().underline(r.title):Xe.strikethrough().gray(r.title):(o=e===i?Xe.cyan().underline(r.title):r.title,e===i&&r.description&&(a=` - ${r.description}`,(n.length+o.length+a.length>=this.out.columns||r.description.split(/\r?\n/).length>1)&&(a=`
105
- `+Yv(r.description,{margin:n.length,width:this.out.columns})))),n+o+Xe.gray(a||"")}paginateOptions(e){if(e.length===0)return Xe.red("No matches for this query.");let{startIndex:r,endIndex:i}=Jv(this.cursor,e.length,this.optionsPerPage),s,n=[];for(let o=r;o<i;o++)o===r&&r>0?s=wt.arrowUp:o===i-1&&i<e.length?s=wt.arrowDown:s=" ",n.push(this.renderOption(this.cursor,e[o],o,s));return `
106
- `+n.join(`
107
- `)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[Xe.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(Xe.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Uv.hide),super.render();let e=[id.symbol(this.done,this.aborted),Xe.bold(this.msg),id.delimiter(false),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Xe.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=false),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=rd(e,this.out.columns);}};sd.exports=ro;});var ld=y((u$,ud)=>{var Tr=se(),zv=ht(),{erase:Xv,cursor:nd}=oe(),{style:so,clear:od,figures:no,wrap:Zv,entriesToDisplay:Qv}=Be(),ad=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),ey=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]),ty=(t,e)=>{let r=t.findIndex(i=>i.value===e||i.title===e);return r>-1?r:void 0},oo=class extends zv{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:ty(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||false,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=so.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=od("",this.out.columns),this.complete(this.render),this.render();}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e;}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=ad(this.suggestions,e):this.value=this.fallback.value,this.fire();}async complete(e){let r=this.completing=this.suggest(this.input,this.choices),i=await r;if(this.completing!==r)return;this.suggestions=i.map((n,o,a)=>({title:ey(a,o),value:ad(a,o),description:n.description})),this.completing=false;let s=Math.max(i.length-1,0);this.moveSelect(Math.min(s,this.select)),e&&e();}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render();}),this.render();}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
108
- `),this.close());}abort(){this.done=this.aborted=true,this.exited=false,this.fire(),this.render(),this.out.write(`
109
- `),this.close();}submit(){this.done=true,this.aborted=this.exited=false,this.fire(),this.render(),this.out.write(`
110
- `),this.close();}_(e,r){let i=this.input.slice(0,this.cursor),s=this.input.slice(this.cursor);this.input=`${i}${e}${s}`,this.cursor=i.length+1,this.complete(this.render),this.render();}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),r=this.input.slice(this.cursor);this.input=`${e}${r}`,this.complete(this.render),this.cursor=this.cursor-1,this.render();}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor+1);this.input=`${e}${r}`,this.complete(this.render),this.render();}first(){this.moveSelect(0),this.render();}last(){this.moveSelect(this.suggestions.length-1),this.render();}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render();}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render();}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render();}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render();}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render();}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render();}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render();}renderOption(e,r,i,s){let n,o=i?no.arrowUp:s?no.arrowDown:" ",a=r?Tr.cyan().underline(e.title):e.title;return o=(r?Tr.cyan(no.pointer)+" ":" ")+o,e.description&&(n=` - ${e.description}`,(o.length+a.length+n.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(n=`
111
- `+Zv(e.description,{margin:3,width:this.out.columns}))),o+" "+a+Tr.gray(n||"")}render(){if(this.closed)return;this.firstRender?this.out.write(nd.hide):this.out.write(od(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:r}=Qv(this.select,this.choices.length,this.limit);if(this.outputText=[so.symbol(this.done,this.aborted,this.exited),Tr.bold(this.msg),so.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let i=this.suggestions.slice(e,r).map((s,n)=>this.renderOption(s,this.select===n+e,n===0&&e>0,n+e===r-1&&r<this.choices.length)).join(`
112
- `);this.outputText+=`
113
- `+(i||Tr.gray(this.fallback.title));}this.out.write(Xv.line+nd.to(0)+this.outputText);}};ud.exports=oo;});var fd=y((l$,dd)=>{var ft=se(),{cursor:ry}=oe(),iy=io(),{clear:cd,style:hd,figures:rr}=Be(),ao=class extends iy{constructor(e={}){e.overrideRender=true,super(e),this.inputValue="",this.clear=cd("",this.out.columns),this.filteredOptions=this.value,this.render();}last(){this.cursor=this.filteredOptions.length-1,this.render();}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render();}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render();}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render();}left(){this.filteredOptions[this.cursor].selected=false,this.render();}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=true,this.render();}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions());}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(i=>this.inputValue?!!(typeof i.title=="string"&&i.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof i.value=="string"&&i.value.toLowerCase().includes(this.inputValue.toLowerCase())):true);let r=this.filteredOptions.findIndex(i=>i===e);this.cursor=r<0?0:r,this.render();}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=false,this.render();else {if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=true,this.render();}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions();}_(e,r){e===" "?this.handleSpaceToggle():this.handleInputChange(e);}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
114
- Instructions:
115
- ${rr.arrowUp}/${rr.arrowDown}: Highlight option
116
- ${rr.arrowLeft}/${rr.arrowRight}/[space]: Toggle selection
117
- [a,b,c]/delete: Filter choices
118
- enter/return: Complete answer
119
- `:""}renderCurrentInput(){return `
120
- Filtered results for: ${this.inputValue?this.inputValue:ft.gray("Enter something to filter")}
121
- `}renderOption(e,r,i){let s;return r.disabled?s=e===i?ft.gray().underline(r.title):ft.strikethrough().gray(r.title):s=e===i?ft.cyan().underline(r.title):r.title,(r.selected?ft.green(rr.radioOn):rr.radioOff)+" "+s}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[ft.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(ft.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(ry.hide),super.render();let e=[hd.symbol(this.done,this.aborted),ft.bold(this.msg),hd.delimiter(false),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=ft.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=false),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=cd(e,this.out.columns);}};dd.exports=ao;});var bd=y((c$,Dd)=>{var pd=se(),sy=ht(),{style:md,clear:ny}=Be(),{erase:oy,cursor:gd}=oe(),uo=class extends sy{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render();}reset(){this.value=this.initialValue,this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
122
- `),this.close();}submit(){this.value=this.value||false,this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
123
- `),this.close();}_(e,r){return e.toLowerCase()==="y"?(this.value=true,this.submit()):e.toLowerCase()==="n"?(this.value=false,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(gd.hide):this.out.write(ny(this.outputText,this.out.columns)),super.render(),this.outputText=[md.symbol(this.done,this.aborted),pd.bold(this.msg),md.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:pd.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(oy.line+gd.to(0)+this.outputText));}};Dd.exports=uo;});var yd=y((h$,vd)=>{vd.exports={TextPrompt:Dh(),SelectPrompt:Ch(),TogglePrompt:Fh(),DatePrompt:Xh(),NumberPrompt:td(),MultiselectPrompt:io(),AutocompletePrompt:ld(),AutocompleteMultiselectPrompt:fd(),ConfirmPrompt:bd()};});var _d=y(Cd=>{var _e=Cd,ay=yd(),Ei=t=>t;function Ze(t,e,r={}){return new Promise((i,s)=>{let n=new ay[t](e),o=r.onAbort||Ei,a=r.onSubmit||Ei,u=r.onExit||Ei;n.on("state",e.onState||Ei),n.on("submit",h=>i(a(h))),n.on("exit",h=>i(u(h))),n.on("abort",h=>s(o(h)));})}_e.text=t=>Ze("TextPrompt",t);_e.password=t=>(t.style="password",_e.text(t));_e.invisible=t=>(t.style="invisible",_e.text(t));_e.number=t=>Ze("NumberPrompt",t);_e.date=t=>Ze("DatePrompt",t);_e.confirm=t=>Ze("ConfirmPrompt",t);_e.list=t=>{let e=t.separator||",";return Ze("TextPrompt",t,{onSubmit:r=>r.split(e).map(i=>i.trim())})};_e.toggle=t=>Ze("TogglePrompt",t);_e.select=t=>Ze("SelectPrompt",t);_e.multiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(i=>i.selected).map(i=>i.value);return Ze("MultiselectPrompt",t,{onAbort:e,onSubmit:e})};_e.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(i=>i.selected).map(i=>i.value);return Ze("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};var uy=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));_e.autocomplete=t=>(t.suggest=t.suggest||uy,t.choices=[].concat(t.choices||[]),Ze("AutocompletePrompt",t));});var Fd=y((f$,xd)=>{var lo=_d(),ly=["suggest","format","onState","validate","onRender","type"],wd=()=>{};async function xt(t=[],{onSubmit:e=wd,onCancel:r=wd}={}){let i={},s=xt._override||{};t=[].concat(t);let n,o,a,u,h,l,c=async(d,f,m=false)=>{if(!(!m&&d.validate&&d.validate(f)!==true))return d.format?await d.format(f,i):f};for(o of t)if({name:u,type:h}=o,typeof h=="function"&&(h=await h(n,{...i},o),o.type=h),!!h){for(let d in o){if(ly.includes(d))continue;let f=o[d];o[d]=typeof f=="function"?await f(n,{...i},l):f;}if(l=o,typeof o.message!="string")throw new Error("prompt message is required");if({name:u,type:h}=o,lo[h]===void 0)throw new Error(`prompt type (${h}) is not defined`);if(s[o.name]!==void 0&&(n=await c(o,s[o.name]),n!==void 0)){i[u]=n;continue}try{n=xt._injected?cy(xt._injected,o.initial):await lo[h](o),i[u]=n=await c(o,n,!0),a=await e(o,n,i);}catch{a=!await r(o,i);}if(a)return i}return i}function cy(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function hy(t){xt._injected=(xt._injected||[]).concat(t);}function dy(t){xt._override=Object.assign({},t);}xd.exports=Object.assign(xt,{prompt:xt,prompts:lo,inject:hy,override:dy});});var ir=y((p$,Ed)=>{function fy(t){t=(Array.isArray(t)?t:t.split(".")).map(Number);let e=0,r=process.versions.node.split(".").map(Number);for(;e<t.length;e++){if(r[e]>t[e])return false;if(t[e]>r[e])return true}return false}Ed.exports=fy("8.6.0")?Xc():Fd();});var sp=y((nO,J_)=>{J_.exports={dots:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]},dots2:{interval:80,frames:["\u28FE","\u28FD","\u28FB","\u28BF","\u287F","\u28DF","\u28EF","\u28F7"]},dots3:{interval:80,frames:["\u280B","\u2819","\u281A","\u281E","\u2816","\u2826","\u2834","\u2832","\u2833","\u2813"]},dots4:{interval:80,frames:["\u2804","\u2806","\u2807","\u280B","\u2819","\u2838","\u2830","\u2820","\u2830","\u2838","\u2819","\u280B","\u2807","\u2806"]},dots5:{interval:80,frames:["\u280B","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B"]},dots6:{interval:80,frames:["\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2834","\u2832","\u2812","\u2802","\u2802","\u2812","\u281A","\u2819","\u2809","\u2801"]},dots7:{interval:80,frames:["\u2808","\u2809","\u280B","\u2813","\u2812","\u2810","\u2810","\u2812","\u2816","\u2826","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808"]},dots8:{interval:80,frames:["\u2801","\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808","\u2808"]},dots9:{interval:80,frames:["\u28B9","\u28BA","\u28BC","\u28F8","\u28C7","\u2867","\u2857","\u284F"]},dots10:{interval:80,frames:["\u2884","\u2882","\u2881","\u2841","\u2848","\u2850","\u2860"]},dots11:{interval:100,frames:["\u2801","\u2802","\u2804","\u2840","\u2880","\u2820","\u2810","\u2808"]},dots12:{interval:80,frames:["\u2880\u2800","\u2840\u2800","\u2804\u2800","\u2882\u2800","\u2842\u2800","\u2805\u2800","\u2883\u2800","\u2843\u2800","\u280D\u2800","\u288B\u2800","\u284B\u2800","\u280D\u2801","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2888\u2829","\u2840\u2899","\u2804\u2859","\u2882\u2829","\u2842\u2898","\u2805\u2858","\u2883\u2828","\u2843\u2890","\u280D\u2850","\u288B\u2820","\u284B\u2880","\u280D\u2841","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2808\u2829","\u2800\u2899","\u2800\u2859","\u2800\u2829","\u2800\u2898","\u2800\u2858","\u2800\u2828","\u2800\u2890","\u2800\u2850","\u2800\u2820","\u2800\u2880","\u2800\u2840"]},dots13:{interval:80,frames:["\u28FC","\u28F9","\u28BB","\u283F","\u285F","\u28CF","\u28E7","\u28F6"]},dots8Bit:{interval:80,frames:["\u2800","\u2801","\u2802","\u2803","\u2804","\u2805","\u2806","\u2807","\u2840","\u2841","\u2842","\u2843","\u2844","\u2845","\u2846","\u2847","\u2808","\u2809","\u280A","\u280B","\u280C","\u280D","\u280E","\u280F","\u2848","\u2849","\u284A","\u284B","\u284C","\u284D","\u284E","\u284F","\u2810","\u2811","\u2812","\u2813","\u2814","\u2815","\u2816","\u2817","\u2850","\u2851","\u2852","\u2853","\u2854","\u2855","\u2856","\u2857","\u2818","\u2819","\u281A","\u281B","\u281C","\u281D","\u281E","\u281F","\u2858","\u2859","\u285A","\u285B","\u285C","\u285D","\u285E","\u285F","\u2820","\u2821","\u2822","\u2823","\u2824","\u2825","\u2826","\u2827","\u2860","\u2861","\u2862","\u2863","\u2864","\u2865","\u2866","\u2867","\u2828","\u2829","\u282A","\u282B","\u282C","\u282D","\u282E","\u282F","\u2868","\u2869","\u286A","\u286B","\u286C","\u286D","\u286E","\u286F","\u2830","\u2831","\u2832","\u2833","\u2834","\u2835","\u2836","\u2837","\u2870","\u2871","\u2872","\u2873","\u2874","\u2875","\u2876","\u2877","\u2838","\u2839","\u283A","\u283B","\u283C","\u283D","\u283E","\u283F","\u2878","\u2879","\u287A","\u287B","\u287C","\u287D","\u287E","\u287F","\u2880","\u2881","\u2882","\u2883","\u2884","\u2885","\u2886","\u2887","\u28C0","\u28C1","\u28C2","\u28C3","\u28C4","\u28C5","\u28C6","\u28C7","\u2888","\u2889","\u288A","\u288B","\u288C","\u288D","\u288E","\u288F","\u28C8","\u28C9","\u28CA","\u28CB","\u28CC","\u28CD","\u28CE","\u28CF","\u2890","\u2891","\u2892","\u2893","\u2894","\u2895","\u2896","\u2897","\u28D0","\u28D1","\u28D2","\u28D3","\u28D4","\u28D5","\u28D6","\u28D7","\u2898","\u2899","\u289A","\u289B","\u289C","\u289D","\u289E","\u289F","\u28D8","\u28D9","\u28DA","\u28DB","\u28DC","\u28DD","\u28DE","\u28DF","\u28A0","\u28A1","\u28A2","\u28A3","\u28A4","\u28A5","\u28A6","\u28A7","\u28E0","\u28E1","\u28E2","\u28E3","\u28E4","\u28E5","\u28E6","\u28E7","\u28A8","\u28A9","\u28AA","\u28AB","\u28AC","\u28AD","\u28AE","\u28AF","\u28E8","\u28E9","\u28EA","\u28EB","\u28EC","\u28ED","\u28EE","\u28EF","\u28B0","\u28B1","\u28B2","\u28B3","\u28B4","\u28B5","\u28B6","\u28B7","\u28F0","\u28F1","\u28F2","\u28F3","\u28F4","\u28F5","\u28F6","\u28F7","\u28B8","\u28B9","\u28BA","\u28BB","\u28BC","\u28BD","\u28BE","\u28BF","\u28F8","\u28F9","\u28FA","\u28FB","\u28FC","\u28FD","\u28FE","\u28FF"]},sand:{interval:80,frames:["\u2801","\u2802","\u2804","\u2840","\u2848","\u2850","\u2860","\u28C0","\u28C1","\u28C2","\u28C4","\u28CC","\u28D4","\u28E4","\u28E5","\u28E6","\u28EE","\u28F6","\u28F7","\u28FF","\u287F","\u283F","\u289F","\u281F","\u285B","\u281B","\u282B","\u288B","\u280B","\u280D","\u2849","\u2809","\u2811","\u2821","\u2881"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["\u2802","-","\u2013","\u2014","\u2013","-"]},pipe:{interval:100,frames:["\u2524","\u2518","\u2534","\u2514","\u251C","\u250C","\u252C","\u2510"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["\u2736","\u2738","\u2739","\u273A","\u2739","\u2737"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","\xB4","-","_","_","_"]},hamburger:{interval:100,frames:["\u2631","\u2632","\u2634"]},growVertical:{interval:120,frames:["\u2581","\u2583","\u2584","\u2585","\u2586","\u2587","\u2586","\u2585","\u2584","\u2583"]},growHorizontal:{interval:120,frames:["\u258F","\u258E","\u258D","\u258C","\u258B","\u258A","\u2589","\u258A","\u258B","\u258C","\u258D","\u258E"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","\xB0","O","o","."]},noise:{interval:100,frames:["\u2593","\u2592","\u2591"]},bounce:{interval:120,frames:["\u2801","\u2802","\u2804","\u2802"]},boxBounce:{interval:120,frames:["\u2596","\u2598","\u259D","\u2597"]},boxBounce2:{interval:100,frames:["\u258C","\u2580","\u2590","\u2584"]},triangle:{interval:50,frames:["\u25E2","\u25E3","\u25E4","\u25E5"]},binary:{interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},arc:{interval:100,frames:["\u25DC","\u25E0","\u25DD","\u25DE","\u25E1","\u25DF"]},circle:{interval:120,frames:["\u25E1","\u2299","\u25E0"]},squareCorners:{interval:180,frames:["\u25F0","\u25F3","\u25F2","\u25F1"]},circleQuarters:{interval:120,frames:["\u25F4","\u25F7","\u25F6","\u25F5"]},circleHalves:{interval:50,frames:["\u25D0","\u25D3","\u25D1","\u25D2"]},squish:{interval:100,frames:["\u256B","\u256A"]},toggle:{interval:250,frames:["\u22B6","\u22B7"]},toggle2:{interval:80,frames:["\u25AB","\u25AA"]},toggle3:{interval:120,frames:["\u25A1","\u25A0"]},toggle4:{interval:100,frames:["\u25A0","\u25A1","\u25AA","\u25AB"]},toggle5:{interval:100,frames:["\u25AE","\u25AF"]},toggle6:{interval:300,frames:["\u101D","\u1040"]},toggle7:{interval:80,frames:["\u29BE","\u29BF"]},toggle8:{interval:100,frames:["\u25CD","\u25CC"]},toggle9:{interval:100,frames:["\u25C9","\u25CE"]},toggle10:{interval:100,frames:["\u3282","\u3280","\u3281"]},toggle11:{interval:50,frames:["\u29C7","\u29C6"]},toggle12:{interval:120,frames:["\u2617","\u2616"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["\u2190","\u2196","\u2191","\u2197","\u2192","\u2198","\u2193","\u2199"]},arrow2:{interval:80,frames:["\u2B06\uFE0F ","\u2197\uFE0F ","\u27A1\uFE0F ","\u2198\uFE0F ","\u2B07\uFE0F ","\u2199\uFE0F ","\u2B05\uFE0F ","\u2196\uFE0F "]},arrow3:{interval:120,frames:["\u25B9\u25B9\u25B9\u25B9\u25B9","\u25B8\u25B9\u25B9\u25B9\u25B9","\u25B9\u25B8\u25B9\u25B9\u25B9","\u25B9\u25B9\u25B8\u25B9\u25B9","\u25B9\u25B9\u25B9\u25B8\u25B9","\u25B9\u25B9\u25B9\u25B9\u25B8"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF)","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","(\u25CF )"]},smiley:{interval:200,frames:["\u{1F604} ","\u{1F61D} "]},monkey:{interval:300,frames:["\u{1F648} ","\u{1F648} ","\u{1F649} ","\u{1F64A} "]},hearts:{interval:100,frames:["\u{1F49B} ","\u{1F499} ","\u{1F49C} ","\u{1F49A} ","\u2764\uFE0F "]},clock:{interval:100,frames:["\u{1F55B} ","\u{1F550} ","\u{1F551} ","\u{1F552} ","\u{1F553} ","\u{1F554} ","\u{1F555} ","\u{1F556} ","\u{1F557} ","\u{1F558} ","\u{1F559} ","\u{1F55A} "]},earth:{interval:180,frames:["\u{1F30D} ","\u{1F30E} ","\u{1F30F} "]},material:{interval:17,frames:["\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581"]},moon:{interval:80,frames:["\u{1F311} ","\u{1F312} ","\u{1F313} ","\u{1F314} ","\u{1F315} ","\u{1F316} ","\u{1F317} ","\u{1F318} "]},runner:{interval:140,frames:["\u{1F6B6} ","\u{1F3C3} "]},pong:{interval:80,frames:["\u2590\u2802 \u258C","\u2590\u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802\u258C","\u2590 \u2820\u258C","\u2590 \u2840\u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590\u2820 \u258C"]},shark:{interval:120,frames:["\u2590|\\____________\u258C","\u2590_|\\___________\u258C","\u2590__|\\__________\u258C","\u2590___|\\_________\u258C","\u2590____|\\________\u258C","\u2590_____|\\_______\u258C","\u2590______|\\______\u258C","\u2590_______|\\_____\u258C","\u2590________|\\____\u258C","\u2590_________|\\___\u258C","\u2590__________|\\__\u258C","\u2590___________|\\_\u258C","\u2590____________|\\\u258C","\u2590____________/|\u258C","\u2590___________/|_\u258C","\u2590__________/|__\u258C","\u2590_________/|___\u258C","\u2590________/|____\u258C","\u2590_______/|_____\u258C","\u2590______/|______\u258C","\u2590_____/|_______\u258C","\u2590____/|________\u258C","\u2590___/|_________\u258C","\u2590__/|__________\u258C","\u2590_/|___________\u258C","\u2590/|____________\u258C"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["\u2600\uFE0F ","\u2600\uFE0F ","\u2600\uFE0F ","\u{1F324} ","\u26C5\uFE0F ","\u{1F325} ","\u2601\uFE0F ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u26C8 ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u2601\uFE0F ","\u{1F325} ","\u26C5\uFE0F ","\u{1F324} ","\u2600\uFE0F ","\u2600\uFE0F "]},christmas:{interval:400,frames:["\u{1F332}","\u{1F384}"]},grenade:{interval:80,frames:["\u060C ","\u2032 "," \xB4 "," \u203E "," \u2E0C"," \u2E0A"," |"," \u204E"," \u2055"," \u0DF4 "," \u2053"," "," "," "]},point:{interval:125,frames:["\u2219\u2219\u2219","\u25CF\u2219\u2219","\u2219\u25CF\u2219","\u2219\u2219\u25CF","\u2219\u2219\u2219"]},layer:{interval:150,frames:["-","=","\u2261"]},betaWave:{interval:80,frames:["\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1"]},fingerDance:{interval:160,frames:["\u{1F918} ","\u{1F91F} ","\u{1F596} ","\u270B ","\u{1F91A} ","\u{1F446} "]},fistBump:{interval:80,frames:["\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u3000\u{1F91C}\u3000\u3000\u{1F91B}\u3000 ","\u3000\u3000\u{1F91C}\u{1F91B}\u3000\u3000 ","\u3000\u{1F91C}\u2728\u{1F91B}\u3000\u3000 ","\u{1F91C}\u3000\u2728\u3000\u{1F91B}\u3000 "]},soccerHeader:{interval:80,frames:[" \u{1F9D1}\u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F\u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} "]},mindblown:{interval:160,frames:["\u{1F610} ","\u{1F610} ","\u{1F62E} ","\u{1F62E} ","\u{1F626} ","\u{1F626} ","\u{1F627} ","\u{1F627} ","\u{1F92F} ","\u{1F4A5} ","\u2728 ","\u3000 ","\u3000 ","\u3000 "]},speaker:{interval:160,frames:["\u{1F508} ","\u{1F509} ","\u{1F50A} ","\u{1F509} "]},orangePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} "]},bluePulse:{interval:100,frames:["\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},orangeBluePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} ","\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},timeTravel:{interval:100,frames:["\u{1F55B} ","\u{1F55A} ","\u{1F559} ","\u{1F558} ","\u{1F557} ","\u{1F556} ","\u{1F555} ","\u{1F554} ","\u{1F553} ","\u{1F552} ","\u{1F551} ","\u{1F550} "]},aesthetic:{interval:80,frames:["\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0","\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1"]},dwarfFortress:{interval:80,frames:[" \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A \u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A \xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A \xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\u2593\xA3 "," \u263A\u2593\xA3 "," \u263A\u2592\xA3 "," \u263A\u2592\xA3 "," \u263A\u2591\xA3 "," \u263A\u2591\xA3 "," \u263A \xA3 "," \u263A\xA3 "," \u263A\xA3 "," \u263A\u2593 "," \u263A\u2593 "," \u263A\u2592 "," \u263A\u2592 "," \u263A\u2591 "," \u263A\u2591 "," \u263A "," \u263A &"," \u263A \u263C&"," \u263A \u263C &"," \u263A\u263C &"," \u263A\u263C & "," \u203C & "," \u263A & "," \u203C & "," \u263A & "," \u203C & "," \u263A & ","\u203C & "," & "," & "," & \u2591 "," & \u2592 "," & \u2593 "," & \xA3 "," & \u2591\xA3 "," & \u2592\xA3 "," & \u2593\xA3 "," & \xA3\xA3 "," & \u2591\xA3\xA3 "," & \u2592\xA3\xA3 ","& \u2593\xA3\xA3 ","& \xA3\xA3\xA3 "," \u2591\xA3\xA3\xA3 "," \u2592\xA3\xA3\xA3 "," \u2593\xA3\xA3\xA3 "," \u2588\xA3\xA3\xA3 "," \u2591\u2588\xA3\xA3\xA3 "," \u2592\u2588\xA3\xA3\xA3 "," \u2593\u2588\xA3\xA3\xA3 "," \u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "]}};});var ma=y((oO,op)=>{var Mi=Object.assign({},sp()),np=Object.keys(Mi);Object.defineProperty(Mi,"random",{get(){let t=Math.floor(Math.random()*np.length),e=np[t];return Mi[e]}});op.exports=Mi;});var Ip=y((kS,$a)=>{var Mw=Object.prototype.hasOwnProperty,ye="~";function Gr(){}Object.create&&(Gr.prototype=Object.create(null),new Gr().__proto__||(ye=false));function Bw(t,e,r){this.fn=t,this.context=e,this.once=r||false;}function kp(t,e,r,i,s){if(typeof r!="function")throw new TypeError("The listener must be a function");var n=new Bw(r,i||t,s),o=ye?ye+e:e;return t._events[o]?t._events[o].fn?t._events[o]=[t._events[o],n]:t._events[o].push(n):(t._events[o]=n,t._eventsCount++),t}function Ji(t,e){--t._eventsCount===0?t._events=new Gr:delete t._events[e];}function De(){this._events=new Gr,this._eventsCount=0;}De.prototype.eventNames=function(){var e=[],r,i;if(this._eventsCount===0)return e;for(i in r=this._events)Mw.call(r,i)&&e.push(ye?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(r)):e};De.prototype.listeners=function(e){var r=ye?ye+e:e,i=this._events[r];if(!i)return [];if(i.fn)return [i.fn];for(var s=0,n=i.length,o=new Array(n);s<n;s++)o[s]=i[s].fn;return o};De.prototype.listenerCount=function(e){var r=ye?ye+e:e,i=this._events[r];return i?i.fn?1:i.length:0};De.prototype.emit=function(e,r,i,s,n,o){var a=ye?ye+e:e;if(!this._events[a])return false;var u=this._events[a],h=arguments.length,l,c;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,true),h){case 1:return u.fn.call(u.context),true;case 2:return u.fn.call(u.context,r),true;case 3:return u.fn.call(u.context,r,i),true;case 4:return u.fn.call(u.context,r,i,s),true;case 5:return u.fn.call(u.context,r,i,s,n),true;case 6:return u.fn.call(u.context,r,i,s,n,o),true}for(c=1,l=new Array(h-1);c<h;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l);}else {var d=u.length,f;for(c=0;c<d;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,true),h){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,r);break;case 3:u[c].fn.call(u[c].context,r,i);break;case 4:u[c].fn.call(u[c].context,r,i,s);break;default:if(!l)for(f=1,l=new Array(h-1);f<h;f++)l[f-1]=arguments[f];u[c].fn.apply(u[c].context,l);}}return true};De.prototype.on=function(e,r,i){return kp(this,e,r,i,false)};De.prototype.once=function(e,r,i){return kp(this,e,r,i,true)};De.prototype.removeListener=function(e,r,i,s){var n=ye?ye+e:e;if(!this._events[n])return this;if(!r)return Ji(this,n),this;var o=this._events[n];if(o.fn)o.fn===r&&(!s||o.once)&&(!i||o.context===i)&&Ji(this,n);else {for(var a=0,u=[],h=o.length;a<h;a++)(o[a].fn!==r||s&&!o[a].once||i&&o[a].context!==i)&&u.push(o[a]);u.length?this._events[n]=u.length===1?u[0]:u:Ji(this,n);}return this};De.prototype.removeAllListeners=function(e){var r;return e?(r=ye?ye+e:e,this._events[r]&&Ji(this,r)):(this._events=new Gr,this._eventsCount=0),this};De.prototype.off=De.prototype.removeListener;De.prototype.addListener=De.prototype.on;De.prefixed=ye;De.EventEmitter=De;typeof $a<"u"&&($a.exports=De);});var Bp=y((IS,Mp)=>{Mp.exports=function(e,r){if(r=r.split(":")[0],e=+e,!e)return false;switch(r){case "http":case "ws":return e!==80;case "https":case "wss":return e!==443;case "ftp":return e!==21;case "gopher":return e!==70;case "file":return false}return e!==0};});var zi=y(Hp=>{var bt=Hp,Nw=H("url"),Np=H("util")._extend,Hw=Bp(),qw=/(^|,)\s*upgrade\s*($|,)/i,Oa=/^https|wss/;bt.isSSL=Oa;bt.setupOutgoing=function(t,e,r,i){t.port=e[i||"target"].port||(Oa.test(e[i||"target"].protocol)?443:80),["host","hostname","socketPath","pfx","key","passphrase","cert","ca","ciphers","secureProtocol"].forEach(function(a){t[a]=e[i||"target"][a];}),t.method=e.method||r.method,t.headers=Np({},r.headers),e.headers&&Np(t.headers,e.headers),e.auth&&(t.auth=e.auth),e.ca&&(t.ca=e.ca),Oa.test(e[i||"target"].protocol)&&(t.rejectUnauthorized=typeof e.secure>"u"?true:e.secure),t.agent=e.agent||false,t.localAddress=e.localAddress,t.agent||(t.headers=t.headers||{},(typeof t.headers.connection!="string"||!qw.test(t.headers.connection))&&(t.headers.connection="close"));var s=e[i||"target"],n=s&&e.prependPath!==false&&s.path||"",o=e.toProxy?r.url:Nw.parse(r.url).path||"";return o=e.ignorePath?"":o,t.path=bt.urlJoin(n,o),e.changeOrigin&&(t.headers.host=Hw(t.port,e[i||"target"].protocol)&&!Lw(t.host)?t.host+":"+t.port:t.host),t};bt.setupSocket=function(t){return t.setTimeout(0),t.setNoDelay(true),t.setKeepAlive(true,0),t};bt.getPort=function(t){var e=t.headers.host?t.headers.host.match(/:(\d+)/):"";return e?e[1]:bt.hasEncryptedConnection(t)?"443":"80"};bt.hasEncryptedConnection=function(t){return !!(t.connection.encrypted||t.connection.pair)};bt.urlJoin=function(){var t=Array.prototype.slice.call(arguments),e=t.length-1,r=t[e],i=r.split("?"),s;return t[e]=i.shift(),s=[t.filter(Boolean).join("/").replace(/\/+/g,"/").replace("http:/","http://").replace("https:/","https://")],s.push.apply(s,i),s.join("?")};bt.rewriteCookieProperty=function t(e,r,i){return Array.isArray(e)?e.map(function(s){return t(s,r,i)}):e.replace(new RegExp("(;\\s*"+i+"=)([^;]+)","i"),function(s,n,o){var a;if(o in r)a=r[o];else if("*"in r)a=r["*"];else return s;return a?n+a:""})};function Lw(t){return !!~t.indexOf(":")}});var Gp=y((BS,jp)=>{var qp=H("url"),Lp=zi(),jw=/^201|30(1|2|7|8)$/;jp.exports={removeChunked:function(e,r,i){e.httpVersion==="1.0"&&delete i.headers["transfer-encoding"];},setConnection:function(e,r,i){e.httpVersion==="1.0"?i.headers.connection=e.headers.connection||"close":e.httpVersion!=="2.0"&&!i.headers.connection&&(i.headers.connection=e.headers.connection||"keep-alive");},setRedirectHostRewrite:function(e,r,i,s){if((s.hostRewrite||s.autoRewrite||s.protocolRewrite)&&i.headers.location&&jw.test(i.statusCode)){var n=qp.parse(s.target),o=qp.parse(i.headers.location);if(n.host!=o.host)return;s.hostRewrite?o.host=s.hostRewrite:s.autoRewrite&&(o.host=e.headers.host),s.protocolRewrite&&(o.protocol=s.protocolRewrite),i.headers.location=o.format();}},writeHeaders:function(e,r,i,s){var n=s.cookieDomainRewrite,o=s.cookiePathRewrite,a=s.preserveHeaderKeyCase,u,h=function(d,f){f!=null&&(n&&d.toLowerCase()==="set-cookie"&&(f=Lp.rewriteCookieProperty(f,n,"domain")),o&&d.toLowerCase()==="set-cookie"&&(f=Lp.rewriteCookieProperty(f,o,"path")),r.setHeader(String(d).trim(),f));};if(typeof n=="string"&&(n={"*":n}),typeof o=="string"&&(o={"*":o}),a&&i.rawHeaders!=null){u={};for(var l=0;l<i.rawHeaders.length;l+=2){var c=i.rawHeaders[l];u[c.toLowerCase()]=c;}}Object.keys(i.headers).forEach(function(d){var f=i.headers[d];a&&u&&(d=u[d]||d),h(d,f);});},writeStatusCode:function(e,r,i){i.statusMessage?(r.statusCode=i.statusCode,r.statusMessage=i.statusMessage):r.statusCode=i.statusCode;}};});var Wp=y((NS,Vp)=>{var fr=1e3,pr=fr*60,mr=pr*60,jt=mr*24,Gw=jt*7,Vw=jt*365.25;Vp.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return Ww(t);if(r==="number"&&isFinite(t))return e.long?Kw(t):Uw(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function Ww(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),i=(e[2]||"ms").toLowerCase();switch(i){case "years":case "year":case "yrs":case "yr":case "y":return r*Vw;case "weeks":case "week":case "w":return r*Gw;case "days":case "day":case "d":return r*jt;case "hours":case "hour":case "hrs":case "hr":case "h":return r*mr;case "minutes":case "minute":case "mins":case "min":case "m":return r*pr;case "seconds":case "second":case "secs":case "sec":case "s":return r*fr;case "milliseconds":case "millisecond":case "msecs":case "msec":case "ms":return r;default:return}}}}function Uw(t){var e=Math.abs(t);return e>=jt?Math.round(t/jt)+"d":e>=mr?Math.round(t/mr)+"h":e>=pr?Math.round(t/pr)+"m":e>=fr?Math.round(t/fr)+"s":t+"ms"}function Kw(t){var e=Math.abs(t);return e>=jt?Xi(t,e,jt,"day"):e>=mr?Xi(t,e,mr,"hour"):e>=pr?Xi(t,e,pr,"minute"):e>=fr?Xi(t,e,fr,"second"):t+" ms"}function Xi(t,e,r,i){var s=e>=r*1.5;return Math.round(t/r)+" "+i+(s?"s":"")}});var Sa=y((HS,Up)=>{function Yw(t){r.debug=r,r.default=r,r.coerce=u,r.disable=o,r.enable=s,r.enabled=a,r.humanize=Wp(),r.destroy=h,Object.keys(t).forEach(l=>{r[l]=t[l];}),r.names=[],r.skips=[],r.formatters={};function e(l){let c=0;for(let d=0;d<l.length;d++)c=(c<<5)-c+l.charCodeAt(d),c|=0;return r.colors[Math.abs(c)%r.colors.length]}r.selectColor=e;function r(l){let c,d=null,f,m;function g(...D){if(!g.enabled)return;let x=g,b=Number(new Date),v=b-(c||b);x.diff=v,x.prev=c,x.curr=b,c=b,D[0]=r.coerce(D[0]),typeof D[0]!="string"&&D.unshift("%O");let C=0;D[0]=D[0].replace(/%([a-zA-Z%])/g,(O,P)=>{if(O==="%%")return "%";C++;let A=r.formatters[P];if(typeof A=="function"){let R=D[C];O=A.call(x,R),D.splice(C,1),C--;}return O}),r.formatArgs.call(x,D),(x.log||r.log).apply(x,D);}return g.namespace=l,g.useColors=r.useColors(),g.color=r.selectColor(l),g.extend=i,g.destroy=r.destroy,Object.defineProperty(g,"enabled",{enumerable:true,configurable:false,get:()=>d!==null?d:(f!==r.namespaces&&(f=r.namespaces,m=r.enabled(l)),m),set:D=>{d=D;}}),typeof r.init=="function"&&r.init(g),g}function i(l,c){let d=r(this.namespace+(typeof c>"u"?":":c)+l);return d.log=this.log,d}function s(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let c=(typeof l=="string"?l:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let d of c)d[0]==="-"?r.skips.push(d.slice(1)):r.names.push(d);}function n(l,c){let d=0,f=0,m=-1,g=0;for(;d<l.length;)if(f<c.length&&(c[f]===l[d]||c[f]==="*"))c[f]==="*"?(m=f,g=d,f++):(d++,f++);else if(m!==-1)f=m+1,g++,d=g;else return false;for(;f<c.length&&c[f]==="*";)f++;return f===c.length}function o(){let l=[...r.names,...r.skips.map(c=>"-"+c)].join(",");return r.enable(""),l}function a(l){for(let c of r.skips)if(n(l,c))return false;for(let c of r.names)if(n(l,c))return true;return false}function u(l){return l instanceof Error?l.stack||l.message:l}function h(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");}return r.enable(r.load()),r}Up.exports=Yw;});var Kp=y((xe,Zi)=>{xe.formatArgs=zw;xe.save=Xw;xe.load=Zw;xe.useColors=Jw;xe.storage=Qw();xe.destroy=(()=>{let t=false;return ()=>{t||(t=true,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."));}})();xe.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Jw(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return true;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return false;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function zw(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Zi.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,s=>{s!=="%%"&&(r++,s==="%c"&&(i=r));}),t.splice(i,0,e);}xe.log=console.debug||console.log||(()=>{});function Xw(t){try{t?xe.storage.setItem("debug",t):xe.storage.removeItem("debug");}catch{}}function Zw(){let t;try{t=xe.storage.getItem("debug")||xe.storage.getItem("DEBUG");}catch{}return !t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function Qw(){try{return localStorage}catch{}}Zi.exports=Sa()(xe);var{formatters:ex}=Zi.exports;ex.j=function(t){try{return JSON.stringify(t)}catch(e){return "[UnexpectedJSONParseError]: "+e.message}};});var Jp=y((qS,Yp)=>{Yp.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",i=e.indexOf(r+t),s=e.indexOf("--");return i!==-1&&(s===-1||i<s)};});var Zp=y((LS,Xp)=>{var tx=H("os"),zp=H("tty"),ke=Jp(),{env:pe}=process,Qi;ke("no-color")||ke("no-colors")||ke("color=false")||ke("color=never")?Qi=0:(ke("color")||ke("colors")||ke("color=true")||ke("color=always"))&&(Qi=1);function rx(){if("FORCE_COLOR"in pe)return pe.FORCE_COLOR==="true"?1:pe.FORCE_COLOR==="false"?0:pe.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(pe.FORCE_COLOR,10),3)}function ix(t){return t===0?false:{level:t,hasBasic:true,has256:t>=2,has16m:t>=3}}function sx(t,{streamIsTTY:e,sniffFlags:r=true}={}){let i=rx();i!==void 0&&(Qi=i);let s=r?Qi:i;if(s===0)return 0;if(r){if(ke("color=16m")||ke("color=full")||ke("color=truecolor"))return 3;if(ke("color=256"))return 2}if(t&&!e&&s===void 0)return 0;let n=s||0;if(pe.TERM==="dumb")return n;if(process.platform==="win32"){let o=tx.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in pe)return ["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(o=>o in pe)||pe.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in pe)return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(pe.TEAMCITY_VERSION)?1:0;if(pe.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in pe){let o=Number.parseInt((pe.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(pe.TERM_PROGRAM){case "iTerm.app":return o>=3?3:2;case "Apple_Terminal":return 2}}return /-256(color)?$/i.test(pe.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(pe.TERM)||"COLORTERM"in pe?1:n}function Ra(t,e={}){let r=sx(t,{streamIsTTY:t&&t.isTTY,...e});return ix(r)}Xp.exports={supportsColor:Ra,stdout:Ra({isTTY:zp.isatty(1)}),stderr:Ra({isTTY:zp.isatty(2)})};});var em=y((me,ts)=>{var nx=H("tty"),es=H("util");me.init=dx;me.log=lx;me.formatArgs=ax;me.save=cx;me.load=hx;me.useColors=ox;me.destroy=es.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");me.colors=[6,2,3,4,5,1];try{let t=Zp();t&&(t.stderr||t).level>=2&&(me.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]);}catch{}me.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(s,n)=>n.toUpperCase()),i=process.env[e];return /^(yes|on|true|enabled)$/i.test(i)?i=true:/^(no|off|false|disabled)$/i.test(i)?i=false:i==="null"?i=null:i=Number(i),t[r]=i,t},{});function ox(){return "colors"in me.inspectOpts?!!me.inspectOpts.colors:nx.isatty(process.stderr.fd)}function ax(t){let{namespace:e,useColors:r}=this;if(r){let i=this.color,s="\x1B[3"+(i<8?i:"8;5;"+i),n=` ${s};1m${e} \x1B[0m`;t[0]=n+t[0].split(`
124
- `).join(`
125
- `+n),t.push(s+"m+"+ts.exports.humanize(this.diff)+"\x1B[0m");}else t[0]=ux()+e+" "+t[0];}function ux(){return me.inspectOpts.hideDate?"":new Date().toISOString()+" "}function lx(...t){return process.stderr.write(es.formatWithOptions(me.inspectOpts,...t)+`
126
- `)}function cx(t){t?process.env.DEBUG=t:delete process.env.DEBUG;}function hx(){return process.env.DEBUG}function dx(t){t.inspectOpts={};let e=Object.keys(me.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=me.inspectOpts[e[r]];}ts.exports=Sa()(me);var{formatters:Qp}=ts.exports;Qp.o=function(t){return this.inspectOpts.colors=this.useColors,es.inspect(t,this.inspectOpts).split(`
127
- `).map(e=>e.trim()).join(" ")};Qp.O=function(t){return this.inspectOpts.colors=this.useColors,es.inspect(t,this.inspectOpts)};});var Pa=y((jS,Ta)=>{typeof process>"u"||process.type==="renderer"||process.browser===true||process.__nwjs?Ta.exports=Kp():Ta.exports=em();});var rm=y((GS,tm)=>{var Vr;tm.exports=function(){if(!Vr){try{Vr=Pa()("follow-redirects");}catch{}typeof Vr!="function"&&(Vr=function(){});}Vr.apply(null,arguments);};});var am=y((VS,Wa)=>{var Ur=H("url"),Wr=Ur.URL,fx=H("http"),px=H("https"),Na=H("stream").Writable,Ha=H("assert"),im=rm();(function(){var e=typeof process<"u",r=typeof window<"u"&&typeof document<"u",i=Vt(Error.captureStackTrace);!e&&(r||!i)&&console.warn("The follow-redirects package should be excluded from browser builds.");})();var qa=false;try{Ha(new Wr(""));}catch(t){qa=t.code==="ERR_INVALID_URL";}var mx=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],La=["abort","aborted","connect","error","socket","timeout"],ja=Object.create(null);La.forEach(function(t){ja[t]=function(e,r,i){this._redirectable.emit(t,e,r,i);};});var Ia=Kr("ERR_INVALID_URL","Invalid URL",TypeError),Ma=Kr("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),gx=Kr("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",Ma),Dx=Kr("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),bx=Kr("ERR_STREAM_WRITE_AFTER_END","write after end"),vx=Na.prototype.destroy||nm;function Fe(t,e){Na.call(this),this._sanitizeOptions(t),this._options=t,this._ended=false,this._ending=false,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],e&&this.on("response",e);var r=this;this._onNativeResponse=function(i){try{r._processResponse(i);}catch(s){r.emit("error",s instanceof Ma?s:new Ma({cause:s}));}},this._performRequest();}Fe.prototype=Object.create(Na.prototype);Fe.prototype.abort=function(){Va(this._currentRequest),this._currentRequest.abort(),this.emit("abort");};Fe.prototype.destroy=function(t){return Va(this._currentRequest,t),vx.call(this,t),this};Fe.prototype.write=function(t,e,r){if(this._ending)throw new bx;if(!Gt(t)&&!_x(t))throw new TypeError("data should be a string, Buffer or Uint8Array");if(Vt(e)&&(r=e,e=null),t.length===0){r&&r();return}this._requestBodyLength+t.length<=this._options.maxBodyLength?(this._requestBodyLength+=t.length,this._requestBodyBuffers.push({data:t,encoding:e}),this._currentRequest.write(t,e,r)):(this.emit("error",new Dx),this.abort());};Fe.prototype.end=function(t,e,r){if(Vt(t)?(r=t,t=e=null):Vt(e)&&(r=e,e=null),!t)this._ended=this._ending=true,this._currentRequest.end(null,null,r);else {var i=this,s=this._currentRequest;this.write(t,e,function(){i._ended=true,s.end(null,null,r);}),this._ending=true;}};Fe.prototype.setHeader=function(t,e){this._options.headers[t]=e,this._currentRequest.setHeader(t,e);};Fe.prototype.removeHeader=function(t){delete this._options.headers[t],this._currentRequest.removeHeader(t);};Fe.prototype.setTimeout=function(t,e){var r=this;function i(o){o.setTimeout(t),o.removeListener("timeout",o.destroy),o.addListener("timeout",o.destroy);}function s(o){r._timeout&&clearTimeout(r._timeout),r._timeout=setTimeout(function(){r.emit("timeout"),n();},t),i(o);}function n(){r._timeout&&(clearTimeout(r._timeout),r._timeout=null),r.removeListener("abort",n),r.removeListener("error",n),r.removeListener("response",n),r.removeListener("close",n),e&&r.removeListener("timeout",e),r.socket||r._currentRequest.removeListener("socket",s);}return e&&this.on("timeout",e),this.socket?s(this.socket):this._currentRequest.once("socket",s),this.on("socket",i),this.on("abort",n),this.on("error",n),this.on("response",n),this.on("close",n),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(t){Fe.prototype[t]=function(e,r){return this._currentRequest[t](e,r)};});["aborted","connection","socket"].forEach(function(t){Object.defineProperty(Fe.prototype,t,{get:function(){return this._currentRequest[t]}});});Fe.prototype._sanitizeOptions=function(t){if(t.headers||(t.headers={}),t.host&&(t.hostname||(t.hostname=t.host),delete t.host),!t.pathname&&t.path){var e=t.path.indexOf("?");e<0?t.pathname=t.path:(t.pathname=t.path.substring(0,e),t.search=t.path.substring(e));}};Fe.prototype._performRequest=function(){var t=this._options.protocol,e=this._options.nativeProtocols[t];if(!e)throw new TypeError("Unsupported protocol "+t);if(this._options.agents){var r=t.slice(0,-1);this._options.agent=this._options.agents[r];}var i=this._currentRequest=e.request(this._options,this._onNativeResponse);i._redirectable=this;for(var s of La)i.on(s,ja[s]);if(this._currentUrl=/^\//.test(this._options.path)?Ur.format(this._options):this._options.path,this._isRedirect){var n=0,o=this,a=this._requestBodyBuffers;(function u(h){if(i===o._currentRequest)if(h)o.emit("error",h);else if(n<a.length){var l=a[n++];i.finished||i.write(l.data,l.encoding,u);}else o._ended&&i.end();})();}};Fe.prototype._processResponse=function(t){var e=t.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:t.headers,statusCode:e});var r=t.headers.location;if(!r||this._options.followRedirects===false||e<300||e>=400){t.responseUrl=this._currentUrl,t.redirects=this._redirects,this.emit("response",t),this._requestBodyBuffers=[];return}if(Va(this._currentRequest),t.destroy(),++this._redirectCount>this._options.maxRedirects)throw new gx;var i,s=this._options.beforeRedirect;s&&(i=Object.assign({Host:t.req.getHeader("host")},this._options.headers));var n=this._options.method;((e===301||e===302)&&this._options.method==="POST"||e===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],ka(/^content-/i,this._options.headers));var o=ka(/^host$/i,this._options.headers),a=Ga(this._currentUrl),u=o||a.host,h=/^\w+:/.test(r)?this._currentUrl:Ur.format(Object.assign(a,{host:u})),l=yx(r,h);if(im("redirecting to",l.href),this._isRedirect=true,Ba(l,this._options),(l.protocol!==a.protocol&&l.protocol!=="https:"||l.host!==u&&!Cx(l.host,u))&&ka(/^(?:(?:proxy-)?authorization|cookie)$/i,this._options.headers),Vt(s)){var c={headers:t.headers,statusCode:e},d={url:h,method:n,headers:i};s(this._options,c,d),this._sanitizeOptions(this._options);}this._performRequest();};function sm(t){var e={maxRedirects:21,maxBodyLength:10485760},r={};return Object.keys(t).forEach(function(i){var s=i+":",n=r[s]=t[i],o=e[i]=Object.create(n);function a(h,l,c){return wx(h)?h=Ba(h):Gt(h)?h=Ba(Ga(h)):(c=l,l=om(h),h={protocol:s}),Vt(l)&&(c=l,l=null),l=Object.assign({maxRedirects:e.maxRedirects,maxBodyLength:e.maxBodyLength},h,l),l.nativeProtocols=r,!Gt(l.host)&&!Gt(l.hostname)&&(l.hostname="::1"),Ha.equal(l.protocol,s,"protocol mismatch"),im("options",l),new Fe(l,c)}function u(h,l,c){var d=o.request(h,l,c);return d.end(),d}Object.defineProperties(o,{request:{value:a,configurable:true,enumerable:true,writable:true},get:{value:u,configurable:true,enumerable:true,writable:true}});}),e}function nm(){}function Ga(t){var e;if(qa)e=new Wr(t);else if(e=om(Ur.parse(t)),!Gt(e.protocol))throw new Ia({input:t});return e}function yx(t,e){return qa?new Wr(t,e):Ga(Ur.resolve(e,t))}function om(t){if(/^\[/.test(t.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(t.hostname))throw new Ia({input:t.href||t});if(/^\[/.test(t.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(t.host))throw new Ia({input:t.href||t});return t}function Ba(t,e){var r=e||{};for(var i of mx)r[i]=t[i];return r.hostname.startsWith("[")&&(r.hostname=r.hostname.slice(1,-1)),r.port!==""&&(r.port=Number(r.port)),r.path=r.search?r.pathname+r.search:r.pathname,r}function ka(t,e){var r;for(var i in e)t.test(i)&&(r=e[i],delete e[i]);return r===null||typeof r>"u"?void 0:String(r).trim()}function Kr(t,e,r){function i(s){Vt(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,s||{}),this.code=t,this.message=this.cause?e+": "+this.cause.message:e;}return i.prototype=new(r||Error),Object.defineProperties(i.prototype,{constructor:{value:i,enumerable:false},name:{value:"Error ["+t+"]",enumerable:false}}),i}function Va(t,e){for(var r of La)t.removeListener(r,ja[r]);t.on("error",nm),t.destroy(e);}function Cx(t,e){Ha(Gt(t)&&Gt(e));var r=t.length-e.length-1;return r>0&&t[r]==="."&&t.endsWith(e)}function Gt(t){return typeof t=="string"||t instanceof String}function Vt(t){return typeof t=="function"}function _x(t){return typeof t=="object"&&"length"in t}function wx(t){return Wr&&t instanceof Wr}Wa.exports=sm({http:fx,https:px});Wa.exports.wrap=sm;});var lm=y((WS,um)=>{var xx=H("http"),Fx=H("https"),Yr=Gp(),rs=zi(),Ex=am();Yr=Object.keys(Yr).map(function(t){return Yr[t]});var Ax={http:xx,https:Fx};um.exports={deleteLength:function(e,r,i){(e.method==="DELETE"||e.method==="OPTIONS")&&!e.headers["content-length"]&&(e.headers["content-length"]="0",delete e.headers["transfer-encoding"]);},timeout:function(e,r,i){i.timeout&&e.socket.setTimeout(i.timeout);},XHeaders:function(e,r,i){if(i.xfwd){var s=e.isSpdy||rs.hasEncryptedConnection(e),n={for:e.connection.remoteAddress||e.socket.remoteAddress,port:rs.getPort(e),proto:s?"https":"http"};["for","port","proto"].forEach(function(o){e.headers["x-forwarded-"+o]=(e.headers["x-forwarded-"+o]||"")+(e.headers["x-forwarded-"+o]?",":"")+n[o];}),e.headers["x-forwarded-host"]=e.headers["x-forwarded-host"]||e.headers.host||"";}},stream:function(e,r,i,s,n,o){n.emit("start",e,r,i.target||i.forward);var a=i.followRedirects?Ex:Ax,u=a.http,h=a.https;if(i.forward){var l=(i.forward.protocol==="https:"?h:u).request(rs.setupOutgoing(i.ssl||{},i,e,"forward")),c=m(l,i.forward);if(e.on("error",c),l.on("error",c),(i.buffer||e).pipe(l),!i.target)return r.end()}var d=(i.target.protocol==="https:"?h:u).request(rs.setupOutgoing(i.ssl||{},i,e));d.on("socket",function(g){n&&!d.getHeader("expect")&&n.emit("proxyReq",d,e,r,i);}),i.proxyTimeout&&d.setTimeout(i.proxyTimeout,function(){d.abort();}),e.on("aborted",function(){d.abort();});var f=m(d,i.target);e.on("error",f),d.on("error",f);function m(g,D){return function(b){if(e.socket.destroyed&&b.code==="ECONNRESET")return n.emit("econnreset",b,e,r,D),g.abort();o?o(b,e,r,D):n.emit("error",b,e,r,D);}}(i.buffer||e).pipe(d),d.on("response",function(g){if(n&&n.emit("proxyRes",g,e,r),!r.headersSent&&!i.selfHandleResponse)for(var D=0;D<Yr.length&&!Yr[D](e,r,g,i);D++);r.finished?n&&n.emit("end",e,r,g):(g.on("end",function(){n&&n.emit("end",e,r,g);}),i.selfHandleResponse||g.pipe(r));});}};});var hm=y((US,cm)=>{var $x=H("http"),Ox=H("https"),gr=zi();cm.exports={checkMethodAndHeader:function(e,r){if(e.method!=="GET"||!e.headers.upgrade||e.headers.upgrade.toLowerCase()!=="websocket")return r.destroy(),true},XHeaders:function(e,r,i){if(i.xfwd){var s={for:e.connection.remoteAddress||e.socket.remoteAddress,port:gr.getPort(e),proto:gr.hasEncryptedConnection(e)?"wss":"ws"};["for","port","proto"].forEach(function(n){e.headers["x-forwarded-"+n]=(e.headers["x-forwarded-"+n]||"")+(e.headers["x-forwarded-"+n]?",":"")+s[n];});}},stream:function(e,r,i,s,n,o){var a=function(l,c){return Object.keys(c).reduce(function(d,f){var m=c[f];if(!Array.isArray(m))return d.push(f+": "+m),d;for(var g=0;g<m.length;g++)d.push(f+": "+m[g]);return d},[l]).join(`\r
128
- `)+`\r
129
- \r
130
- `};gr.setupSocket(r),s&&s.length&&r.unshift(s);var u=(gr.isSSL.test(i.target.protocol)?Ox:$x).request(gr.setupOutgoing(i.ssl||{},i,e));return n&&n.emit("proxyReqWs",u,e,r,i,s),u.on("error",h),u.on("response",function(l){l.upgrade||(r.write(a("HTTP/"+l.httpVersion+" "+l.statusCode+" "+l.statusMessage,l.headers)),l.pipe(r));}),u.on("upgrade",function(l,c,d){c.on("error",h),c.on("end",function(){n.emit("close",l,c,d);}),r.on("error",function(){c.end();}),gr.setupSocket(c),d&&d.length&&c.unshift(d),r.write(a("HTTP/1.1 101 Switching Protocols",l.headers)),c.pipe(r).pipe(c),n.emit("open",c),n.emit("proxySocket",c);}),u.end();function h(l){o?o(l,e,r):n.emit("error",l,e,r),r.end();}}};});var bm=y((KS,Dm)=>{var mm=Dm.exports,dm=H("util")._extend,Sx=H("url").parse,gm=Ip(),Rx=H("http"),Tx=H("https"),fm=lm(),pm=hm();mm.Server=Wt;function Ua(t){return function(e){return function(r,i){var s=t==="ws"?this.wsPasses:this.webPasses,n=[].slice.call(arguments),o=n.length-1,a,u;typeof n[o]=="function"&&(u=n[o],o--);var h=e;if(!(n[o]instanceof Buffer)&&n[o]!==i&&(h=dm({},e),dm(h,n[o]),o--),n[o]instanceof Buffer&&(a=n[o]),["target","forward"].forEach(function(c){typeof h[c]=="string"&&(h[c]=Sx(h[c]));}),!h.target&&!h.forward)return this.emit("error",new Error("Must provide a proper URL as target"));for(var l=0;l<s.length&&!s[l](r,i,h,a,this,u);l++);}}}mm.createRightProxy=Ua;function Wt(t){gm.call(this),t=t||{},t.prependPath=t.prependPath!==false,this.web=this.proxyRequest=Ua("web")(t),this.ws=this.proxyWebsocketRequest=Ua("ws")(t),this.options=t,this.webPasses=Object.keys(fm).map(function(e){return fm[e]}),this.wsPasses=Object.keys(pm).map(function(e){return pm[e]}),this.on("error",this.onError,this);}H("util").inherits(Wt,gm);Wt.prototype.onError=function(t){if(this.listeners("error").length===1)throw t};Wt.prototype.listen=function(t,e){var r=this,i=function(s,n){r.web(s,n);};return this._server=this.options.ssl?Tx.createServer(this.options.ssl,i):Rx.createServer(i),this.options.ws&&this._server.on("upgrade",function(s,n,o){r.ws(s,n,o);}),this._server.listen(t,e),this};Wt.prototype.close=function(t){var e=this;this._server&&this._server.close(r);function r(){e._server=null,t&&t.apply(null,arguments);}};Wt.prototype.before=function(t,e,r){if(t!=="ws"&&t!=="web")throw new Error("type must be `web` or `ws`");var i=t==="ws"?this.wsPasses:this.webPasses,s=false;if(i.forEach(function(n,o){n.name===e&&(s=o);}),s===false)throw new Error("No such pass");i.splice(s,0,r);};Wt.prototype.after=function(t,e,r){if(t!=="ws"&&t!=="web")throw new Error("type must be `web` or `ws`");var i=t==="ws"?this.wsPasses:this.webPasses,s=false;if(i.forEach(function(n,o){n.name===e&&(s=o);}),s===false)throw new Error("No such pass");i.splice(s++,0,r);};});var ym=y((YS,vm)=>{var Jr=bm().Server;function Ka(t){return new Jr(t)}Jr.createProxyServer=Ka;Jr.createServer=Ka;Jr.createProxy=Ka;vm.exports=Jr;});var _m=y((JS,Cm)=>{Cm.exports=ym();});var ss=y(is=>{Object.defineProperty(is,"__esModule",{value:true});is.ERRORS=void 0;var wm;(function(t){t.ERR_CONFIG_FACTORY_TARGET_MISSING='[HPM] Missing "target" option. Example: {target: "http://www.example.org"}',t.ERR_CONTEXT_MATCHER_GENERIC='[HPM] Invalid pathFilter. Expecting something like: "/api" or ["/api", "/ajax"]',t.ERR_CONTEXT_MATCHER_INVALID_ARRAY='[HPM] Invalid pathFilter. Plain paths (e.g. "/api") can not be mixed with globs (e.g. "/api/**"). Expecting something like: ["/api", "/ajax"] or ["/api/**", "!**.html"].',t.ERR_PATH_REWRITER_CONFIG="[HPM] Invalid pathRewrite config. Expecting object with pathRewrite config or a rewrite function";})(wm||(is.ERRORS=wm={}));});var xm=y(Ya=>{Object.defineProperty(Ya,"__esModule",{value:true});Ya.verifyConfig=kx;var Px=ss();function kx(t){if(!t.target&&!t.router)throw new Error(Px.ERRORS.ERR_CONFIG_FACTORY_TARGET_MISSING)}});var vt=y(ns=>{Object.defineProperty(ns,"__esModule",{value:true});ns.Debug=void 0;var Ix=Pa();ns.Debug=Ix("http-proxy-middleware");});var Fm=y(os=>{Object.defineProperty(os,"__esModule",{value:true});os.debugProxyErrorsPlugin=void 0;var Mx=vt(),Ut=Mx.Debug.extend("debug-proxy-errors-plugin"),Bx=t=>{t.on("error",(e,r,i,s)=>{Ut(`http-proxy error event:
131
- %O`,e);}),t.on("proxyReq",(e,r,i)=>{i.on("error",s=>{Ut(`Socket error in proxyReq event:
132
- %O`,s);});}),t.on("proxyRes",(e,r,i)=>{i.on("close",()=>{i.writableEnded||(Ut("Destroying proxyRes in proxyRes close event"),e.destroy());});}),t.on("proxyReqWs",(e,r,i)=>{i.on("error",s=>{Ut(`Socket error in proxyReqWs event:
133
- %O`,s);});}),t.on("open",e=>{e.on("error",r=>{Ut(`Socket error in open event:
134
- %O`,r);});}),t.on("close",(e,r,i)=>{r.on("error",s=>{Ut(`Socket error in close event:
135
- %O`,s);});}),t.on("econnreset",(e,r,i,s)=>{Ut(`http-proxy econnreset event:
136
- %O`,e);});};os.debugProxyErrorsPlugin=Bx;});var Em=y(Ja=>{Object.defineProperty(Ja,"__esModule",{value:true});Ja.getStatusCode=Nx;function Nx(t){let e;if(/HPE_INVALID/.test(t))e=502;else switch(t){case "ECONNRESET":case "ENOTFOUND":case "ECONNREFUSED":case "ETIMEDOUT":e=504;break;default:e=500;break}return e}});var Am=y(as=>{Object.defineProperty(as,"__esModule",{value:true});as.errorResponsePlugin=void 0;var Hx=Em();function qx(t){return t&&typeof t.writeHead=="function"}function Lx(t){return t&&typeof t.write=="function"&&!("writeHead"in t)}var jx=(t,e)=>{t.on("error",(r,i,s,n)=>{if(!i&&!s)throw r;if(qx(s)){if(!s.headersSent){let a=(0, Hx.getStatusCode)(r.code);s.writeHead(a);}let o=i.headers&&i.headers.host;s.end(`Error occurred while trying to proxy: ${o}${i.url}`);}else Lx(s)&&s.destroy();});};as.errorResponsePlugin=jx;});var us=y(za=>{Object.defineProperty(za,"__esModule",{value:true});za.getLogger=Vx;var Gx={info:()=>{},warn:()=>{},error:()=>{}};function Vx(t){return t.logger||Gx}});var $m=y(Xa=>{Object.defineProperty(Xa,"__esModule",{value:true});Xa.getPort=Wx;function Wx(t){return Object.keys(t||{})?.[0]?.split(":")[1]}});var Sm=y(ls=>{Object.defineProperty(ls,"__esModule",{value:true});ls.loggerPlugin=void 0;var Om=H("url"),Ux=us(),Kx=$m(),Yx=(t,e)=>{let r=(0, Ux.getLogger)(e);t.on("error",(i,s,n,o)=>{let u=`${s?.headers?.host}${s?.url}`,h=`${o?.href}`;r.error("[HPM] Error occurred while proxying request %s to %s [%s] (%s)",u,h,i.code||i,"https://nodejs.org/api/errors.html#errors_common_system_errors");}),t.on("proxyRes",(i,s,n)=>{let o=s.originalUrl??`${s.baseUrl||""}${s.url}`,a;try{let l=(0,Kx.getPort)(i.req?.agent?.sockets),c={protocol:i.req.protocol,host:i.req.host,pathname:i.req.path};a=new Om.URL(`${c.protocol}//${c.host}${c.pathname}`),l&&(a.port=l);}catch{a=new Om.URL(e.target),a.pathname=i.req.path;}let u=a.toString(),h=`[HPM] ${s.method} ${o} -> ${u} [${i.statusCode}]`;r.info(h);}),t.on("open",i=>{r.info("[HPM] Client connected: %o",i.address());}),t.on("close",(i,s,n)=>{r.info("[HPM] Client disconnected: %o",s.address());});};ls.loggerPlugin=Yx;});var cs=y(Za=>{Object.defineProperty(Za,"__esModule",{value:true});Za.getFunctionName=Jx;function Jx(t){return t.name||"[anonymous Function]"}});var Rm=y(hs=>{Object.defineProperty(hs,"__esModule",{value:true});hs.proxyEventsPlugin=void 0;var zx=vt(),Xx=cs(),Zx=zx.Debug.extend("proxy-events-plugin"),Qx=(t,e)=>{Object.entries(e.on||{}).forEach(([r,i])=>{Zx(`register event handler: "${r}" -> "${(0, Xx.getFunctionName)(i)}"`),t.on(r,i);});};hs.proxyEventsPlugin=Qx;});var Qa=y(tt=>{var eF=tt&&tt.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r);var s=Object.getOwnPropertyDescriptor(e,r);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:true,get:function(){return e[r]}}),Object.defineProperty(t,i,s);}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r];}),ds=tt&&tt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&eF(e,t,r);};Object.defineProperty(tt,"__esModule",{value:true});ds(Fm(),tt);ds(Am(),tt);ds(Sm(),tt);ds(Rm(),tt);});var Tm=y(eu=>{Object.defineProperty(eu,"__esModule",{value:true});eu.getPlugins=tF;var fs=Qa();function tF(t){let e=t.on?.error?[]:[fs.errorResponsePlugin],r=t.ejectPlugins?[]:[fs.debugProxyErrorsPlugin,fs.proxyEventsPlugin,fs.loggerPlugin,...e],i=t.plugins??[];return [...r,...i]}});var km=y((lR,Pm)=>{Pm.exports=function(e){if(typeof e!="string"||e==="")return false;for(var r;r=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(r[2])return true;e=e.slice(r.index+r[0].length);}return false};});var Bm=y((cR,Mm)=>{var rF=km(),Im={"{":"}","(":")","[":"]"},iF=function(t){if(t[0]==="!")return true;for(var e=0,r=-2,i=-2,s=-2,n=-2,o=-2;e<t.length;){if(t[e]==="*"||t[e+1]==="?"&&/[\].+)]/.test(t[e])||i!==-1&&t[e]==="["&&t[e+1]!=="]"&&(i<e&&(i=t.indexOf("]",e)),i>e&&(o===-1||o>i||(o=t.indexOf("\\",e),o===-1||o>i)))||s!==-1&&t[e]==="{"&&t[e+1]!=="}"&&(s=t.indexOf("}",e),s>e&&(o=t.indexOf("\\",e),o===-1||o>s))||n!==-1&&t[e]==="("&&t[e+1]==="?"&&/[:!=]/.test(t[e+2])&&t[e+3]!==")"&&(n=t.indexOf(")",e),n>e&&(o=t.indexOf("\\",e),o===-1||o>n))||r!==-1&&t[e]==="("&&t[e+1]!=="|"&&(r<e&&(r=t.indexOf("|",e)),r!==-1&&t[r+1]!==")"&&(n=t.indexOf(")",r),n>r&&(o=t.indexOf("\\",r),o===-1||o>n))))return true;if(t[e]==="\\"){var a=t[e+1];e+=2;var u=Im[a];if(u){var h=t.indexOf(u,e);h!==-1&&(e=h+1);}if(t[e]==="!")return true}else e++;}return false},sF=function(t){if(t[0]==="!")return true;for(var e=0;e<t.length;){if(/[*?{}()[\]]/.test(t[e]))return true;if(t[e]==="\\"){var r=t[e+1];e+=2;var i=Im[r];if(i){var s=t.indexOf(i,e);s!==-1&&(e=s+1);}if(t[e]==="!")return true}else e++;}return false};Mm.exports=function(e,r){if(typeof e!="string"||e==="")return false;if(rF(e))return true;var i=iF;return r&&r.strict===false&&(i=sF),i(e)};});var ps=y(Ie=>{Ie.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):false;Ie.find=(t,e)=>t.nodes.find(r=>r.type===e);Ie.exceedsLimit=(t,e,r=1,i)=>i===false||!Ie.isInteger(t)||!Ie.isInteger(e)?false:(Number(e)-Number(t))/Number(r)>=i;Ie.escapeNode=(t,e=0,r)=>{let i=t.nodes[e];i&&(r&&i.type===r||i.type==="open"||i.type==="close")&&i.escaped!==true&&(i.value="\\"+i.value,i.escaped=true);};Ie.encloseBrace=t=>t.type!=="brace"||t.commas>>0+t.ranges>>0?false:(t.invalid=true,true);Ie.isInvalidBrace=t=>t.type!=="brace"?false:t.invalid===true||t.dollar?true:!(t.commas>>0+t.ranges>>0)||t.open!==true||t.close!==true?(t.invalid=true,true):false;Ie.isOpenOrClose=t=>t.type==="open"||t.type==="close"?true:t.open===true||t.close===true;Ie.reduce=t=>t.reduce((e,r)=>(r.type==="text"&&e.push(r.value),r.type==="range"&&(r.type="text"),e),[]);Ie.flatten=(...t)=>{let e=[],r=i=>{for(let s=0;s<i.length;s++){let n=i[s];if(Array.isArray(n)){r(n);continue}n!==void 0&&e.push(n);}return e};return r(t),e};});var ms=y((dR,Hm)=>{var Nm=ps();Hm.exports=(t,e={})=>{let r=(i,s={})=>{let n=e.escapeInvalid&&Nm.isInvalidBrace(s),o=i.invalid===true&&e.escapeInvalid===true,a="";if(i.value)return (n||o)&&Nm.isOpenOrClose(i)?"\\"+i.value:i.value;if(i.value)return i.value;if(i.nodes)for(let u of i.nodes)a+=r(u);return a};return r(t)};});var Lm=y((fR,qm)=>{qm.exports=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):false};});var zm=y((pR,Jm)=>{var jm=Lm(),Kt=(t,e,r)=>{if(jm(t)===false)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(jm(e)===false)throw new TypeError("toRegexRange: expected the second argument to be a number.");let i={relaxZeros:true,...r};typeof i.strictZeros=="boolean"&&(i.relaxZeros=i.strictZeros===false);let s=String(i.relaxZeros),n=String(i.shorthand),o=String(i.capture),a=String(i.wrap),u=t+":"+e+"="+s+n+o+a;if(Kt.cache.hasOwnProperty(u))return Kt.cache[u].result;let h=Math.min(t,e),l=Math.max(t,e);if(Math.abs(h-l)===1){let g=t+"|"+e;return i.capture?`(${g})`:i.wrap===false?g:`(?:${g})`}let c=Ym(t)||Ym(e),d={min:t,max:e,a:h,b:l},f=[],m=[];if(c&&(d.isPadded=c,d.maxLen=String(d.max).length),h<0){let g=l<0?Math.abs(l):1;m=Gm(g,Math.abs(h),d,i),h=d.a=0;}return l>=0&&(f=Gm(h,l,d,i)),d.negatives=m,d.positives=f,d.result=nF(m,f),i.capture===true?d.result=`(${d.result})`:i.wrap!==false&&f.length+m.length>1&&(d.result=`(?:${d.result})`),Kt.cache[u]=d,d.result};function nF(t,e,r){let i=tu(t,e,"-",false)||[],s=tu(e,t,"",false)||[],n=tu(t,e,"-?",true)||[];return i.concat(n).concat(s).join("|")}function oF(t,e){let r=1,i=1,s=Wm(t,r),n=new Set([e]);for(;t<=s&&s<=e;)n.add(s),r+=1,s=Wm(t,r);for(s=Um(e+1,i)-1;t<s&&s<=e;)n.add(s),i+=1,s=Um(e+1,i)-1;return n=[...n],n.sort(lF),n}function aF(t,e,r){if(t===e)return {pattern:t,count:[],digits:0};let i=uF(t,e),s=i.length,n="",o=0;for(let a=0;a<s;a++){let[u,h]=i[a];u===h?n+=u:u!=="0"||h!=="9"?n+=cF(u,h):o++;}return o&&(n+=r.shorthand===true?"\\d":"[0-9]"),{pattern:n,count:[o],digits:s}}function Gm(t,e,r,i){let s=oF(t,e),n=[],o=t,a;for(let u=0;u<s.length;u++){let h=s[u],l=aF(String(o),String(h),i),c="";if(!r.isPadded&&a&&a.pattern===l.pattern){a.count.length>1&&a.count.pop(),a.count.push(l.count[0]),a.string=a.pattern+Km(a.count),o=h+1;continue}r.isPadded&&(c=hF(h,r,i)),l.string=c+l.pattern+Km(l.count),n.push(l),o=h+1,a=l;}return n}function tu(t,e,r,i,s){let n=[];for(let o of t){let{string:a}=o;!i&&!Vm(e,"string",a)&&n.push(r+a),i&&Vm(e,"string",a)&&n.push(r+a);}return n}function uF(t,e){let r=[];for(let i=0;i<t.length;i++)r.push([t[i],e[i]]);return r}function lF(t,e){return t>e?1:e>t?-1:0}function Vm(t,e,r){return t.some(i=>i[e]===r)}function Wm(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function Um(t,e){return t-t%Math.pow(10,e)}function Km(t){let[e=0,r=""]=t;return r||e>1?`{${e+(r?","+r:"")}}`:""}function cF(t,e,r){return `[${t}${e-t===1?"":"-"}${e}]`}function Ym(t){return /^-?(0+)\d/.test(t)}function hF(t,e,r){if(!e.isPadded)return t;let i=Math.abs(e.maxLen-String(t).length),s=r.relaxZeros!==false;switch(i){case 0:return "";case 1:return s?"0?":"0";case 2:return s?"0{0,2}":"00";default:return s?`0{0,${i}}`:`0{${i}}`}}Kt.cache={};Kt.clearCache=()=>Kt.cache={};Jm.exports=Kt;});var su=y((mR,ig)=>{var dF=H("util"),Zm=zm(),Xm=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),fF=t=>e=>t===true?Number(e):String(e),ru=t=>typeof t=="number"||typeof t=="string"&&t!=="",zr=t=>Number.isInteger(+t),iu=t=>{let e=`${t}`,r=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return false;for(;e[++r]==="0";);return r>0},pF=(t,e,r)=>typeof t=="string"||typeof e=="string"?true:r.stringify===true,mF=(t,e,r)=>{if(e>0){let i=t[0]==="-"?"-":"";i&&(t=t.slice(1)),t=i+t.padStart(i?e-1:e,"0");}return r===false?String(t):t},Ds=(t,e)=>{let r=t[0]==="-"?"-":"";for(r&&(t=t.slice(1),e--);t.length<e;)t="0"+t;return r?"-"+t:t},gF=(t,e,r)=>{t.negatives.sort((a,u)=>a<u?-1:a>u?1:0),t.positives.sort((a,u)=>a<u?-1:a>u?1:0);let i=e.capture?"":"?:",s="",n="",o;return t.positives.length&&(s=t.positives.map(a=>Ds(String(a),r)).join("|")),t.negatives.length&&(n=`-(${i}${t.negatives.map(a=>Ds(String(a),r)).join("|")})`),s&&n?o=`${s}|${n}`:o=s||n,e.wrap?`(${i}${o})`:o},Qm=(t,e,r,i)=>{if(r)return Zm(t,e,{wrap:false,...i});let s=String.fromCharCode(t);if(t===e)return s;let n=String.fromCharCode(e);return `[${s}-${n}]`},eg=(t,e,r)=>{if(Array.isArray(t)){let i=r.wrap===true,s=r.capture?"":"?:";return i?`(${s}${t.join("|")})`:t.join("|")}return Zm(t,e,r)},tg=(...t)=>new RangeError("Invalid range arguments: "+dF.inspect(...t)),rg=(t,e,r)=>{if(r.strictRanges===true)throw tg([t,e]);return []},DF=(t,e)=>{if(e.strictRanges===true)throw new TypeError(`Expected step "${t}" to be a number`);return []},bF=(t,e,r=1,i={})=>{let s=Number(t),n=Number(e);if(!Number.isInteger(s)||!Number.isInteger(n)){if(i.strictRanges===true)throw tg([t,e]);return []}s===0&&(s=0),n===0&&(n=0);let o=s>n,a=String(t),u=String(e),h=String(r);r=Math.max(Math.abs(r),1);let l=iu(a)||iu(u)||iu(h),c=l?Math.max(a.length,u.length,h.length):0,d=l===false&&pF(t,e,i)===false,f=i.transform||fF(d);if(i.toRegex&&r===1)return Qm(Ds(t,c),Ds(e,c),true,i);let m={negatives:[],positives:[]},g=b=>m[b<0?"negatives":"positives"].push(Math.abs(b)),D=[],x=0;for(;o?s>=n:s<=n;)i.toRegex===true&&r>1?g(s):D.push(mF(f(s,x),c,d)),s=o?s-r:s+r,x++;return i.toRegex===true?r>1?gF(m,i,c):eg(D,null,{wrap:false,...i}):D},vF=(t,e,r=1,i={})=>{if(!zr(t)&&t.length>1||!zr(e)&&e.length>1)return rg(t,e,i);let s=i.transform||(d=>String.fromCharCode(d)),n=`${t}`.charCodeAt(0),o=`${e}`.charCodeAt(0),a=n>o,u=Math.min(n,o),h=Math.max(n,o);if(i.toRegex&&r===1)return Qm(u,h,false,i);let l=[],c=0;for(;a?n>=o:n<=o;)l.push(s(n,c)),n=a?n-r:n+r,c++;return i.toRegex===true?eg(l,null,{wrap:false,options:i}):l},gs=(t,e,r,i={})=>{if(e==null&&ru(t))return [t];if(!ru(t)||!ru(e))return rg(t,e,i);if(typeof r=="function")return gs(t,e,1,{transform:r});if(Xm(r))return gs(t,e,0,r);let s={...i};return s.capture===true&&(s.wrap=true),r=r||s.step||1,zr(r)?zr(t)&&zr(e)?bF(t,e,r,s):vF(t,e,Math.max(Math.abs(r),1),s):r!=null&&!Xm(r)?DF(r,s):gs(t,e,1,r)};ig.exports=gs;});var og=y((gR,ng)=>{var yF=su(),sg=ps(),CF=(t,e={})=>{let r=(i,s={})=>{let n=sg.isInvalidBrace(s),o=i.invalid===true&&e.escapeInvalid===true,a=n===true||o===true,u=e.escapeInvalid===true?"\\":"",h="";if(i.isOpen===true)return u+i.value;if(i.isClose===true)return console.log("node.isClose",u,i.value),u+i.value;if(i.type==="open")return a?u+i.value:"(";if(i.type==="close")return a?u+i.value:")";if(i.type==="comma")return i.prev.type==="comma"?"":a?i.value:"|";if(i.value)return i.value;if(i.nodes&&i.ranges>0){let l=sg.reduce(i.nodes),c=yF(...l,{...e,wrap:false,toRegex:true,strictZeros:true});if(c.length!==0)return l.length>1&&c.length>1?`(${c})`:c}if(i.nodes)for(let l of i.nodes)h+=r(l,i);return h};return r(t)};ng.exports=CF;});var lg=y((DR,ug)=>{var _F=su(),ag=ms(),Dr=ps(),Yt=(t="",e="",r=false)=>{let i=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return r?Dr.flatten(e).map(s=>`{${s}}`):e;for(let s of t)if(Array.isArray(s))for(let n of s)i.push(Yt(n,e,r));else for(let n of e)r===true&&typeof n=="string"&&(n=`{${n}}`),i.push(Array.isArray(n)?Yt(s,n,r):s+n);return Dr.flatten(i)},wF=(t,e={})=>{let r=e.rangeLimit===void 0?1e3:e.rangeLimit,i=(s,n={})=>{s.queue=[];let o=n,a=n.queue;for(;o.type!=="brace"&&o.type!=="root"&&o.parent;)o=o.parent,a=o.queue;if(s.invalid||s.dollar){a.push(Yt(a.pop(),ag(s,e)));return}if(s.type==="brace"&&s.invalid!==true&&s.nodes.length===2){a.push(Yt(a.pop(),["{}"]));return}if(s.nodes&&s.ranges>0){let c=Dr.reduce(s.nodes);if(Dr.exceedsLimit(...c,e.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let d=_F(...c,e);d.length===0&&(d=ag(s,e)),a.push(Yt(a.pop(),d)),s.nodes=[];return}let u=Dr.encloseBrace(s),h=s.queue,l=s;for(;l.type!=="brace"&&l.type!=="root"&&l.parent;)l=l.parent,h=l.queue;for(let c=0;c<s.nodes.length;c++){let d=s.nodes[c];if(d.type==="comma"&&s.type==="brace"){c===1&&h.push(""),h.push("");continue}if(d.type==="close"){a.push(Yt(a.pop(),h,u));continue}if(d.value&&d.type!=="open"){h.push(Yt(h.pop(),d.value));continue}d.nodes&&i(d,s);}return h};return Dr.flatten(i(t))};ug.exports=wF;});var hg=y((bR,cg)=>{cg.exports={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
137
- `,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"};});var gg=y((vR,mg)=>{var xF=ms(),{MAX_LENGTH:dg,CHAR_BACKSLASH:nu,CHAR_BACKTICK:FF,CHAR_COMMA:EF,CHAR_DOT:AF,CHAR_LEFT_PARENTHESES:$F,CHAR_RIGHT_PARENTHESES:OF,CHAR_LEFT_CURLY_BRACE:SF,CHAR_RIGHT_CURLY_BRACE:RF,CHAR_LEFT_SQUARE_BRACKET:fg,CHAR_RIGHT_SQUARE_BRACKET:pg,CHAR_DOUBLE_QUOTE:TF,CHAR_SINGLE_QUOTE:PF,CHAR_NO_BREAK_SPACE:kF,CHAR_ZERO_WIDTH_NOBREAK_SPACE:IF}=hg(),MF=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},i=typeof r.maxLength=="number"?Math.min(dg,r.maxLength):dg;if(t.length>i)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${i})`);let s={type:"root",input:t,nodes:[]},n=[s],o=s,a=s,u=0,h=t.length,l=0,c=0,d,f=()=>t[l++],m=g=>{if(g.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&g.type==="text"){a.value+=g.value;return}return o.nodes.push(g),g.parent=o,g.prev=a,a=g,g};for(m({type:"bos"});l<h;)if(o=n[n.length-1],d=f(),!(d===IF||d===kF)){if(d===nu){m({type:"text",value:(e.keepEscaping?d:"")+f()});continue}if(d===pg){m({type:"text",value:"\\"+d});continue}if(d===fg){u++;let g;for(;l<h&&(g=f());){if(d+=g,g===fg){u++;continue}if(g===nu){d+=f();continue}if(g===pg&&(u--,u===0))break}m({type:"text",value:d});continue}if(d===$F){o=m({type:"paren",nodes:[]}),n.push(o),m({type:"text",value:d});continue}if(d===OF){if(o.type!=="paren"){m({type:"text",value:d});continue}o=n.pop(),m({type:"text",value:d}),o=n[n.length-1];continue}if(d===TF||d===PF||d===FF){let g=d,D;for(e.keepQuotes!==true&&(d="");l<h&&(D=f());){if(D===nu){d+=D+f();continue}if(D===g){e.keepQuotes===true&&(d+=D);break}d+=D;}m({type:"text",value:d});continue}if(d===SF){c++;let D={type:"brace",open:true,close:false,dollar:a.value&&a.value.slice(-1)==="$"||o.dollar===true,depth:c,commas:0,ranges:0,nodes:[]};o=m(D),n.push(o),m({type:"open",value:d});continue}if(d===RF){if(o.type!=="brace"){m({type:"text",value:d});continue}let g="close";o=n.pop(),o.close=true,m({type:g,value:d}),c--,o=n[n.length-1];continue}if(d===EF&&c>0){if(o.ranges>0){o.ranges=0;let g=o.nodes.shift();o.nodes=[g,{type:"text",value:xF(o)}];}m({type:"comma",value:d}),o.commas++;continue}if(d===AF&&c>0&&o.commas===0){let g=o.nodes;if(c===0||g.length===0){m({type:"text",value:d});continue}if(a.type==="dot"){if(o.range=[],a.value+=d,a.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=true,o.ranges=0,a.type="text";continue}o.ranges++,o.args=[];continue}if(a.type==="range"){g.pop();let D=g[g.length-1];D.value+=a.value+d,a=D,o.ranges--;continue}m({type:"dot",value:d});continue}m({type:"text",value:d});}do if(o=n.pop(),o.type!=="root"){o.nodes.forEach(x=>{x.nodes||(x.type==="open"&&(x.isOpen=true),x.type==="close"&&(x.isClose=true),x.nodes||(x.type="text"),x.invalid=true);});let g=n[n.length-1],D=g.nodes.indexOf(o);g.nodes.splice(D,1,...o.nodes);}while(n.length>0);return m({type:"eos"}),s};mg.exports=MF;});var vg=y((yR,bg)=>{var Dg=ms(),BF=og(),NF=lg(),HF=gg(),$e=(t,e={})=>{let r=[];if(Array.isArray(t))for(let i of t){let s=$e.create(i,e);Array.isArray(s)?r.push(...s):r.push(s);}else r=[].concat($e.create(t,e));return e&&e.expand===true&&e.nodupes===true&&(r=[...new Set(r)]),r};$e.parse=(t,e={})=>HF(t,e);$e.stringify=(t,e={})=>Dg(typeof t=="string"?$e.parse(t,e):t,e);$e.compile=(t,e={})=>(typeof t=="string"&&(t=$e.parse(t,e)),BF(t,e));$e.expand=(t,e={})=>{typeof t=="string"&&(t=$e.parse(t,e));let r=NF(t,e);return e.noempty===true&&(r=r.filter(Boolean)),e.nodupes===true&&(r=[...new Set(r)]),r};$e.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==true?$e.compile(t,e):$e.expand(t,e);bg.exports=$e;});var Xr=y((CR,xg)=>{var qF=H("path"),rt="\\\\/",yg=`[^${rt}]`,yt="\\.",LF="\\+",jF="\\?",bs="\\/",GF="(?=.)",Cg="[^/]",ou=`(?:${bs}|$)`,_g=`(?:^|${bs})`,au=`${yt}{1,2}${ou}`,VF=`(?!${yt})`,WF=`(?!${_g}${au})`,UF=`(?!${yt}{0,1}${ou})`,KF=`(?!${au})`,YF=`[^.${bs}]`,JF=`${Cg}*?`,wg={DOT_LITERAL:yt,PLUS_LITERAL:LF,QMARK_LITERAL:jF,SLASH_LITERAL:bs,ONE_CHAR:GF,QMARK:Cg,END_ANCHOR:ou,DOTS_SLASH:au,NO_DOT:VF,NO_DOTS:WF,NO_DOT_SLASH:UF,NO_DOTS_SLASH:KF,QMARK_NO_DOT:YF,STAR:JF,START_ANCHOR:_g},zF={...wg,SLASH_LITERAL:`[${rt}]`,QMARK:yg,STAR:`${yg}*?`,DOTS_SLASH:`${yt}{1,2}(?:[${rt}]|$)`,NO_DOT:`(?!${yt})`,NO_DOTS:`(?!(?:^|[${rt}])${yt}{1,2}(?:[${rt}]|$))`,NO_DOT_SLASH:`(?!${yt}{0,1}(?:[${rt}]|$))`,NO_DOTS_SLASH:`(?!${yt}{1,2}(?:[${rt}]|$))`,QMARK_NO_DOT:`[^.${rt}]`,START_ANCHOR:`(?:^|[${rt}])`,END_ANCHOR:`(?:[${rt}]|$)`},XF={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};xg.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:XF,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:qF.sep,extglobChars(t){return {"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===true?zF:wg}};});var Zr=y(Ee=>{var ZF=H("path"),QF=process.platform==="win32",{REGEX_BACKSLASH:eE,REGEX_REMOVE_BACKSLASH:tE,REGEX_SPECIAL_CHARS:rE,REGEX_SPECIAL_CHARS_GLOBAL:iE}=Xr();Ee.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Ee.hasRegexChars=t=>rE.test(t);Ee.isRegexChar=t=>t.length===1&&Ee.hasRegexChars(t);Ee.escapeRegex=t=>t.replace(iE,"\\$1");Ee.toPosixSlashes=t=>t.replace(eE,"/");Ee.removeBackslashes=t=>t.replace(tE,e=>e==="\\"?"":e);Ee.supportsLookbehinds=()=>{let t=process.version.slice(1).split(".").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};Ee.isWindows=t=>t&&typeof t.windows=="boolean"?t.windows:QF===true||ZF.sep==="\\";Ee.escapeLast=(t,e,r)=>{let i=t.lastIndexOf(e,r);return i===-1?t:t[i-1]==="\\"?Ee.escapeLast(t,e,i-1):`${t.slice(0,i)}\\${t.slice(i)}`};Ee.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};Ee.wrapOutput=(t,e={},r={})=>{let i=r.contains?"":"^",s=r.contains?"":"$",n=`${i}(?:${t})${s}`;return e.negated===true&&(n=`(?:^(?!${n}).*$)`),n};});var Tg=y((wR,Rg)=>{var Fg=Zr(),{CHAR_ASTERISK:uu,CHAR_AT:sE,CHAR_BACKWARD_SLASH:Qr,CHAR_COMMA:nE,CHAR_DOT:lu,CHAR_EXCLAMATION_MARK:cu,CHAR_FORWARD_SLASH:Sg,CHAR_LEFT_CURLY_BRACE:hu,CHAR_LEFT_PARENTHESES:du,CHAR_LEFT_SQUARE_BRACKET:oE,CHAR_PLUS:aE,CHAR_QUESTION_MARK:Eg,CHAR_RIGHT_CURLY_BRACE:uE,CHAR_RIGHT_PARENTHESES:Ag,CHAR_RIGHT_SQUARE_BRACKET:lE}=Xr(),$g=t=>t===Sg||t===Qr,Og=t=>{t.isPrefix!==true&&(t.depth=t.isGlobstar?1/0:1);},cE=(t,e)=>{let r=e||{},i=t.length-1,s=r.parts===true||r.scanToEnd===true,n=[],o=[],a=[],u=t,h=-1,l=0,c=0,d=false,f=false,m=false,g=false,D=false,x=false,b=false,v=false,C=false,E=false,O=0,P,A,R={value:"",depth:0,isGlob:false},U=()=>h>=i,F=()=>u.charCodeAt(h+1),B=()=>(P=A,u.charCodeAt(++h));for(;h<i;){A=B();let V;if(A===Qr){b=R.backslashes=true,A=B(),A===hu&&(x=true);continue}if(x===true||A===hu){for(O++;U()!==true&&(A=B());){if(A===Qr){b=R.backslashes=true,B();continue}if(A===hu){O++;continue}if(x!==true&&A===lu&&(A=B())===lu){if(d=R.isBrace=true,m=R.isGlob=true,E=true,s===true)continue;break}if(x!==true&&A===nE){if(d=R.isBrace=true,m=R.isGlob=true,E=true,s===true)continue;break}if(A===uE&&(O--,O===0)){x=false,d=R.isBrace=true,E=true;break}}if(s===true)continue;break}if(A===Sg){if(n.push(h),o.push(R),R={value:"",depth:0,isGlob:false},E===true)continue;if(P===lu&&h===l+1){l+=2;continue}c=h+1;continue}if(r.noext!==true&&(A===aE||A===sE||A===uu||A===Eg||A===cu)===true&&F()===du){if(m=R.isGlob=true,g=R.isExtglob=true,E=true,A===cu&&h===l&&(C=true),s===true){for(;U()!==true&&(A=B());){if(A===Qr){b=R.backslashes=true,A=B();continue}if(A===Ag){m=R.isGlob=true,E=true;break}}continue}break}if(A===uu){if(P===uu&&(D=R.isGlobstar=true),m=R.isGlob=true,E=true,s===true)continue;break}if(A===Eg){if(m=R.isGlob=true,E=true,s===true)continue;break}if(A===oE){for(;U()!==true&&(V=B());){if(V===Qr){b=R.backslashes=true,B();continue}if(V===lE){f=R.isBracket=true,m=R.isGlob=true,E=true;break}}if(s===true)continue;break}if(r.nonegate!==true&&A===cu&&h===l){v=R.negated=true,l++;continue}if(r.noparen!==true&&A===du){if(m=R.isGlob=true,s===true){for(;U()!==true&&(A=B());){if(A===du){b=R.backslashes=true,A=B();continue}if(A===Ag){E=true;break}}continue}break}if(m===true){if(E=true,s===true)continue;break}}r.noext===true&&(g=false,m=false);let I=u,re="",w="";l>0&&(re=u.slice(0,l),u=u.slice(l),c-=l),I&&m===true&&c>0?(I=u.slice(0,c),w=u.slice(c)):m===true?(I="",w=u):I=u,I&&I!==""&&I!=="/"&&I!==u&&$g(I.charCodeAt(I.length-1))&&(I=I.slice(0,-1)),r.unescape===true&&(w&&(w=Fg.removeBackslashes(w)),I&&b===true&&(I=Fg.removeBackslashes(I)));let _={prefix:re,input:t,start:l,base:I,glob:w,isBrace:d,isBracket:f,isGlob:m,isExtglob:g,isGlobstar:D,negated:v,negatedExtglob:C};if(r.tokens===true&&(_.maxDepth=0,$g(A)||o.push(R),_.tokens=o),r.parts===true||r.tokens===true){let V;for(let T=0;T<n.length;T++){let ae=V?V+1:l,ce=n[T],ue=t.slice(ae,ce);r.tokens&&(T===0&&l!==0?(o[T].isPrefix=true,o[T].value=re):o[T].value=ue,Og(o[T]),_.maxDepth+=o[T].depth),(T!==0||ue!=="")&&a.push(ue),V=ce;}if(V&&V+1<t.length){let T=t.slice(V+1);a.push(T),r.tokens&&(o[o.length-1].value=T,Og(o[o.length-1]),_.maxDepth+=o[o.length-1].depth);}_.slashes=n,_.parts=a;}return _};Rg.exports=cE;});var Ig=y((xR,kg)=>{var vs=Xr(),Oe=Zr(),{MAX_LENGTH:ys,POSIX_REGEX_SOURCE:hE,REGEX_NON_SPECIAL_CHARS:dE,REGEX_SPECIAL_CHARS_BACKREF:fE,REPLACEMENTS:Pg}=vs,pE=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r);}catch{return t.map(s=>Oe.escapeRegex(s)).join("..")}return r},br=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,fu=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=Pg[t]||t;let r={...e},i=typeof r.maxLength=="number"?Math.min(ys,r.maxLength):ys,s=t.length;if(s>i)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${i}`);let n={type:"bos",value:"",output:r.prepend||""},o=[n],a=r.capture?"":"?:",u=Oe.isWindows(e),h=vs.globChars(u),l=vs.extglobChars(h),{DOT_LITERAL:c,PLUS_LITERAL:d,SLASH_LITERAL:f,ONE_CHAR:m,DOTS_SLASH:g,NO_DOT:D,NO_DOT_SLASH:x,NO_DOTS_SLASH:b,QMARK:v,QMARK_NO_DOT:C,STAR:E,START_ANCHOR:O}=h,P=S=>`(${a}(?:(?!${O}${S.dot?g:c}).)*?)`,A=r.dot?"":D,R=r.dot?v:C,U=r.bash===true?P(r):E;r.capture&&(U=`(${U})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let F={input:t,index:-1,start:0,dot:r.dot===true,consumed:"",output:"",prefix:"",backtrack:false,negated:false,brackets:0,braces:0,parens:0,quotes:0,globstar:false,tokens:o};t=Oe.removePrefix(t,F),s=t.length;let B=[],I=[],re=[],w=n,_,V=()=>F.index===s-1,T=F.peek=(S=1)=>t[F.index+S],ae=F.advance=()=>t[++F.index]||"",ce=()=>t.slice(F.index+1),ue=(S="",X=0)=>{F.consumed+=S,F.index+=X;},ti=S=>{F.output+=S.output!=null?S.output:S.value,ue(S.value);},AD=()=>{let S=1;for(;T()==="!"&&(T(2)!=="("||T(3)==="?");)ae(),F.start++,S++;return S%2===0?false:(F.negated=true,F.start++,true)},ri=S=>{F[S]++,re.push(S);},$t=S=>{F[S]--,re.pop();},L=S=>{if(w.type==="globstar"){let X=F.braces>0&&(S.type==="comma"||S.type==="brace"),$=S.extglob===true||B.length&&(S.type==="pipe"||S.type==="paren");S.type!=="slash"&&S.type!=="paren"&&!X&&!$&&(F.output=F.output.slice(0,-w.output.length),w.type="star",w.value="*",w.output=U,F.output+=w.output);}if(B.length&&S.type!=="paren"&&(B[B.length-1].inner+=S.value),(S.value||S.output)&&ti(S),w&&w.type==="text"&&S.type==="text"){w.value+=S.value,w.output=(w.output||"")+S.value;return}S.prev=w,o.push(S),w=S;},ii=(S,X)=>{let $={...l[X],conditions:1,inner:""};$.prev=w,$.parens=F.parens,$.output=F.output;let q=(r.capture?"(":"")+$.open;ri("parens"),L({type:S,value:X,output:F.output?"":m}),L({type:"paren",extglob:true,value:ae(),output:q}),B.push($);},$D=S=>{let X=S.close+(r.capture?")":""),$;if(S.type==="negate"){let q=U;if(S.inner&&S.inner.length>1&&S.inner.includes("/")&&(q=P(r)),(q!==U||V()||/^\)+$/.test(ce()))&&(X=S.close=`)$))${q}`),S.inner.includes("*")&&($=ce())&&/^\.[^\\/.]+$/.test($)){let ie=fu($,{...e,fastpaths:false}).output;X=S.close=`)${ie})${q})`;}S.prev.type==="bos"&&(F.negatedExtglob=true);}L({type:"paren",extglob:true,value:_,output:X}),$t("parens");};if(r.fastpaths!==false&&!/(^[*!]|[/()[\]{}"])/.test(t)){let S=false,X=t.replace(fE,($,q,ie,be,he,As)=>be==="\\"?(S=true,$):be==="?"?q?q+be+(he?v.repeat(he.length):""):As===0?R+(he?v.repeat(he.length):""):v.repeat(ie.length):be==="."?c.repeat(ie.length):be==="*"?q?q+be+(he?U:""):U:q?$:`\\${$}`);return S===true&&(r.unescape===true?X=X.replace(/\\/g,""):X=X.replace(/\\+/g,$=>$.length%2===0?"\\\\":$?"\\":"")),X===t&&r.contains===true?(F.output=t,F):(F.output=Oe.wrapOutput(X,F,e),F)}for(;!V();){if(_=ae(),_==="\0")continue;if(_==="\\"){let $=T();if($==="/"&&r.bash!==true||$==="."||$===";")continue;if(!$){_+="\\",L({type:"text",value:_});continue}let q=/^\\+/.exec(ce()),ie=0;if(q&&q[0].length>2&&(ie=q[0].length,F.index+=ie,ie%2!==0&&(_+="\\")),r.unescape===true?_=ae():_+=ae(),F.brackets===0){L({type:"text",value:_});continue}}if(F.brackets>0&&(_!=="]"||w.value==="["||w.value==="[^")){if(r.posix!==false&&_===":"){let $=w.value.slice(1);if($.includes("[")&&(w.posix=true,$.includes(":"))){let q=w.value.lastIndexOf("["),ie=w.value.slice(0,q),be=w.value.slice(q+2),he=hE[be];if(he){w.value=ie+he,F.backtrack=true,ae(),!n.output&&o.indexOf(w)===1&&(n.output=m);continue}}}(_==="["&&T()!==":"||_==="-"&&T()==="]")&&(_=`\\${_}`),_==="]"&&(w.value==="["||w.value==="[^")&&(_=`\\${_}`),r.posix===true&&_==="!"&&w.value==="["&&(_="^"),w.value+=_,ti({value:_});continue}if(F.quotes===1&&_!=='"'){_=Oe.escapeRegex(_),w.value+=_,ti({value:_});continue}if(_==='"'){F.quotes=F.quotes===1?0:1,r.keepQuotes===true&&L({type:"text",value:_});continue}if(_==="("){ri("parens"),L({type:"paren",value:_});continue}if(_===")"){if(F.parens===0&&r.strictBrackets===true)throw new SyntaxError(br("opening","("));let $=B[B.length-1];if($&&F.parens===$.parens+1){$D(B.pop());continue}L({type:"paren",value:_,output:F.parens?")":"\\)"}),$t("parens");continue}if(_==="["){if(r.nobracket===true||!ce().includes("]")){if(r.nobracket!==true&&r.strictBrackets===true)throw new SyntaxError(br("closing","]"));_=`\\${_}`;}else ri("brackets");L({type:"bracket",value:_});continue}if(_==="]"){if(r.nobracket===true||w&&w.type==="bracket"&&w.value.length===1){L({type:"text",value:_,output:`\\${_}`});continue}if(F.brackets===0){if(r.strictBrackets===true)throw new SyntaxError(br("opening","["));L({type:"text",value:_,output:`\\${_}`});continue}$t("brackets");let $=w.value.slice(1);if(w.posix!==true&&$[0]==="^"&&!$.includes("/")&&(_=`/${_}`),w.value+=_,ti({value:_}),r.literalBrackets===false||Oe.hasRegexChars($))continue;let q=Oe.escapeRegex(w.value);if(F.output=F.output.slice(0,-w.value.length),r.literalBrackets===true){F.output+=q,w.value=q;continue}w.value=`(${a}${q}|${w.value})`,F.output+=w.value;continue}if(_==="{"&&r.nobrace!==true){ri("braces");let $={type:"brace",value:_,output:"(",outputIndex:F.output.length,tokensIndex:F.tokens.length};I.push($),L($);continue}if(_==="}"){let $=I[I.length-1];if(r.nobrace===true||!$){L({type:"text",value:_,output:_});continue}let q=")";if($.dots===true){let ie=o.slice(),be=[];for(let he=ie.length-1;he>=0&&(o.pop(),ie[he].type!=="brace");he--)ie[he].type!=="dots"&&be.unshift(ie[he].value);q=pE(be,r),F.backtrack=true;}if($.comma!==true&&$.dots!==true){let ie=F.output.slice(0,$.outputIndex),be=F.tokens.slice($.tokensIndex);$.value=$.output="\\{",_=q="\\}",F.output=ie;for(let he of be)F.output+=he.output||he.value;}L({type:"brace",value:_,output:q}),$t("braces"),I.pop();continue}if(_==="|"){B.length>0&&B[B.length-1].conditions++,L({type:"text",value:_});continue}if(_===","){let $=_,q=I[I.length-1];q&&re[re.length-1]==="braces"&&(q.comma=true,$="|"),L({type:"comma",value:_,output:$});continue}if(_==="/"){if(w.type==="dot"&&F.index===F.start+1){F.start=F.index+1,F.consumed="",F.output="",o.pop(),w=n;continue}L({type:"slash",value:_,output:f});continue}if(_==="."){if(F.braces>0&&w.type==="dot"){w.value==="."&&(w.output=c);let $=I[I.length-1];w.type="dots",w.output+=_,w.value+=_,$.dots=true;continue}if(F.braces+F.parens===0&&w.type!=="bos"&&w.type!=="slash"){L({type:"text",value:_,output:c});continue}L({type:"dot",value:_,output:c});continue}if(_==="?"){if(!(w&&w.value==="(")&&r.noextglob!==true&&T()==="("&&T(2)!=="?"){ii("qmark",_);continue}if(w&&w.type==="paren"){let q=T(),ie=_;if(q==="<"&&!Oe.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(w.value==="("&&!/[!=<:]/.test(q)||q==="<"&&!/<([!=]|\w+>)/.test(ce()))&&(ie=`\\${_}`),L({type:"text",value:_,output:ie});continue}if(r.dot!==true&&(w.type==="slash"||w.type==="bos")){L({type:"qmark",value:_,output:C});continue}L({type:"qmark",value:_,output:v});continue}if(_==="!"){if(r.noextglob!==true&&T()==="("&&(T(2)!=="?"||!/[!=<:]/.test(T(3)))){ii("negate",_);continue}if(r.nonegate!==true&&F.index===0){AD();continue}}if(_==="+"){if(r.noextglob!==true&&T()==="("&&T(2)!=="?"){ii("plus",_);continue}if(w&&w.value==="("||r.regex===false){L({type:"plus",value:_,output:d});continue}if(w&&(w.type==="bracket"||w.type==="paren"||w.type==="brace")||F.parens>0){L({type:"plus",value:_});continue}L({type:"plus",value:d});continue}if(_==="@"){if(r.noextglob!==true&&T()==="("&&T(2)!=="?"){L({type:"at",extglob:true,value:_,output:""});continue}L({type:"text",value:_});continue}if(_!=="*"){(_==="$"||_==="^")&&(_=`\\${_}`);let $=dE.exec(ce());$&&(_+=$[0],F.index+=$[0].length),L({type:"text",value:_});continue}if(w&&(w.type==="globstar"||w.star===true)){w.type="star",w.star=true,w.value+=_,w.output=U,F.backtrack=true,F.globstar=true,ue(_);continue}let S=ce();if(r.noextglob!==true&&/^\([^?]/.test(S)){ii("star",_);continue}if(w.type==="star"){if(r.noglobstar===true){ue(_);continue}let $=w.prev,q=$.prev,ie=$.type==="slash"||$.type==="bos",be=q&&(q.type==="star"||q.type==="globstar");if(r.bash===true&&(!ie||S[0]&&S[0]!=="/")){L({type:"star",value:_,output:""});continue}let he=F.braces>0&&($.type==="comma"||$.type==="brace"),As=B.length&&($.type==="pipe"||$.type==="paren");if(!ie&&$.type!=="paren"&&!he&&!As){L({type:"star",value:_,output:""});continue}for(;S.slice(0,3)==="/**";){let si=t[F.index+4];if(si&&si!=="/")break;S=S.slice(3),ue("/**",3);}if($.type==="bos"&&V()){w.type="globstar",w.value+=_,w.output=P(r),F.output=w.output,F.globstar=true,ue(_);continue}if($.type==="slash"&&$.prev.type!=="bos"&&!be&&V()){F.output=F.output.slice(0,-($.output+w.output).length),$.output=`(?:${$.output}`,w.type="globstar",w.output=P(r)+(r.strictSlashes?")":"|$)"),w.value+=_,F.globstar=true,F.output+=$.output+w.output,ue(_);continue}if($.type==="slash"&&$.prev.type!=="bos"&&S[0]==="/"){let si=S[1]!==void 0?"|$":"";F.output=F.output.slice(0,-($.output+w.output).length),$.output=`(?:${$.output}`,w.type="globstar",w.output=`${P(r)}${f}|${f}${si})`,w.value+=_,F.output+=$.output+w.output,F.globstar=true,ue(_+ae()),L({type:"slash",value:"/",output:""});continue}if($.type==="bos"&&S[0]==="/"){w.type="globstar",w.value+=_,w.output=`(?:^|${f}|${P(r)}${f})`,F.output=w.output,F.globstar=true,ue(_+ae()),L({type:"slash",value:"/",output:""});continue}F.output=F.output.slice(0,-w.output.length),w.type="globstar",w.output=P(r),w.value+=_,F.output+=w.output,F.globstar=true,ue(_);continue}let X={type:"star",value:_,output:U};if(r.bash===true){X.output=".*?",(w.type==="bos"||w.type==="slash")&&(X.output=A+X.output),L(X);continue}if(w&&(w.type==="bracket"||w.type==="paren")&&r.regex===true){X.output=_,L(X);continue}(F.index===F.start||w.type==="slash"||w.type==="dot")&&(w.type==="dot"?(F.output+=x,w.output+=x):r.dot===true?(F.output+=b,w.output+=b):(F.output+=A,w.output+=A),T()!=="*"&&(F.output+=m,w.output+=m)),L(X);}for(;F.brackets>0;){if(r.strictBrackets===true)throw new SyntaxError(br("closing","]"));F.output=Oe.escapeLast(F.output,"["),$t("brackets");}for(;F.parens>0;){if(r.strictBrackets===true)throw new SyntaxError(br("closing",")"));F.output=Oe.escapeLast(F.output,"("),$t("parens");}for(;F.braces>0;){if(r.strictBrackets===true)throw new SyntaxError(br("closing","}"));F.output=Oe.escapeLast(F.output,"{"),$t("braces");}if(r.strictSlashes!==true&&(w.type==="star"||w.type==="bracket")&&L({type:"maybe_slash",value:"",output:`${f}?`}),F.backtrack===true){F.output="";for(let S of F.tokens)F.output+=S.output!=null?S.output:S.value,S.suffix&&(F.output+=S.suffix);}return F};fu.fastpaths=(t,e)=>{let r={...e},i=typeof r.maxLength=="number"?Math.min(ys,r.maxLength):ys,s=t.length;if(s>i)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${i}`);t=Pg[t]||t;let n=Oe.isWindows(e),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:u,DOTS_SLASH:h,NO_DOT:l,NO_DOTS:c,NO_DOTS_SLASH:d,STAR:f,START_ANCHOR:m}=vs.globChars(n),g=r.dot?c:l,D=r.dot?d:l,x=r.capture?"":"?:",b={negated:false,prefix:""},v=r.bash===true?".*?":f;r.capture&&(v=`(${v})`);let C=A=>A.noglobstar===true?v:`(${x}(?:(?!${m}${A.dot?h:o}).)*?)`,E=A=>{switch(A){case "*":return `${g}${u}${v}`;case ".*":return `${o}${u}${v}`;case "*.*":return `${g}${v}${o}${u}${v}`;case "*/*":return `${g}${v}${a}${u}${D}${v}`;case "**":return g+C(r);case "**/*":return `(?:${g}${C(r)}${a})?${D}${u}${v}`;case "**/*.*":return `(?:${g}${C(r)}${a})?${D}${v}${o}${u}${v}`;case "**/.*":return `(?:${g}${C(r)}${a})?${o}${u}${v}`;default:{let R=/^(.*?)\.(\w+)$/.exec(A);if(!R)return;let U=E(R[1]);return U?U+o+R[2]:void 0}}},O=Oe.removePrefix(t,b),P=E(O);return P&&r.strictSlashes!==true&&(P+=`${a}?`),P};kg.exports=fu;});var Bg=y((FR,Mg)=>{var mE=H("path"),gE=Tg(),pu=Ig(),mu=Zr(),DE=Xr(),bE=t=>t&&typeof t=="object"&&!Array.isArray(t),le=(t,e,r=false)=>{if(Array.isArray(t)){let l=t.map(d=>le(d,e,r));return d=>{for(let f of l){let m=f(d);if(m)return m}return false}}let i=bE(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!i)throw new TypeError("Expected pattern to be a non-empty string");let s=e||{},n=mu.isWindows(e),o=i?le.compileRe(t,e):le.makeRe(t,e,false,true),a=o.state;delete o.state;let u=()=>false;if(s.ignore){let l={...e,ignore:null,onMatch:null,onResult:null};u=le(s.ignore,l,r);}let h=(l,c=false)=>{let{isMatch:d,match:f,output:m}=le.test(l,o,e,{glob:t,posix:n}),g={glob:t,state:a,regex:o,posix:n,input:l,output:m,match:f,isMatch:d};return typeof s.onResult=="function"&&s.onResult(g),d===false?(g.isMatch=false,c?g:false):u(l)?(typeof s.onIgnore=="function"&&s.onIgnore(g),g.isMatch=false,c?g:false):(typeof s.onMatch=="function"&&s.onMatch(g),c?g:true)};return r&&(h.state=a),h};le.test=(t,e,r,{glob:i,posix:s}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return {isMatch:false,output:""};let n=r||{},o=n.format||(s?mu.toPosixSlashes:null),a=t===i,u=a&&o?o(t):t;return a===false&&(u=o?o(t):t,a=u===i),(a===false||n.capture===true)&&(n.matchBase===true||n.basename===true?a=le.matchBase(t,e,r,s):a=e.exec(u)),{isMatch:!!a,match:a,output:u}};le.matchBase=(t,e,r,i=mu.isWindows(r))=>(e instanceof RegExp?e:le.makeRe(e,r)).test(mE.basename(t));le.isMatch=(t,e,r)=>le(e,r)(t);le.parse=(t,e)=>Array.isArray(t)?t.map(r=>le.parse(r,e)):pu(t,{...e,fastpaths:false});le.scan=(t,e)=>gE(t,e);le.compileRe=(t,e,r=false,i=false)=>{if(r===true)return t.output;let s=e||{},n=s.contains?"":"^",o=s.contains?"":"$",a=`${n}(?:${t.output})${o}`;t&&t.negated===true&&(a=`^(?!${a}).*$`);let u=le.toRegex(a,e);return i===true&&(u.state=t),u};le.makeRe=(t,e={},r=false,i=false)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let s={negated:false,fastpaths:true};return e.fastpaths!==false&&(t[0]==="."||t[0]==="*")&&(s.output=pu.fastpaths(t,e)),s.output||(s=pu(t,e)),le.compileRe(s,e,r,i)};le.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===true)throw r;return /$^/}};le.constants=DE;Mg.exports=le;});var Hg=y((ER,Ng)=>{Ng.exports=Bg();});var Wg=y((AR,Vg)=>{var Lg=H("util"),jg=vg(),it=Hg(),gu=Zr(),qg=t=>t===""||t==="./",Gg=t=>{let e=t.indexOf("{");return e>-1&&t.indexOf("}",e)>-1},Z=(t,e,r)=>{e=[].concat(e),t=[].concat(t);let i=new Set,s=new Set,n=new Set,o=0,a=l=>{n.add(l.output),r&&r.onResult&&r.onResult(l);};for(let l=0;l<e.length;l++){let c=it(String(e[l]),{...r,onResult:a},true),d=c.state.negated||c.state.negatedExtglob;d&&o++;for(let f of t){let m=c(f,true);(d?!m.isMatch:m.isMatch)&&(d?i.add(m.output):(i.delete(m.output),s.add(m.output)));}}let h=(o===e.length?[...n]:[...s]).filter(l=>!i.has(l));if(r&&h.length===0){if(r.failglob===true)throw new Error(`No matches found for "${e.join(", ")}"`);if(r.nonull===true||r.nullglob===true)return r.unescape?e.map(l=>l.replace(/\\/g,"")):e}return h};Z.match=Z;Z.matcher=(t,e)=>it(t,e);Z.isMatch=(t,e,r)=>it(e,r)(t);Z.any=Z.isMatch;Z.not=(t,e,r={})=>{e=[].concat(e).map(String);let i=new Set,s=[],n=a=>{r.onResult&&r.onResult(a),s.push(a.output);},o=new Set(Z(t,e,{...r,onResult:n}));for(let a of s)o.has(a)||i.add(a);return [...i]};Z.contains=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${Lg.inspect(t)}"`);if(Array.isArray(e))return e.some(i=>Z.contains(t,i,r));if(typeof e=="string"){if(qg(t)||qg(e))return false;if(t.includes(e)||t.startsWith("./")&&t.slice(2).includes(e))return true}return Z.isMatch(t,e,{...r,contains:true})};Z.matchKeys=(t,e,r)=>{if(!gu.isObject(t))throw new TypeError("Expected the first argument to be an object");let i=Z(Object.keys(t),e,r),s={};for(let n of i)s[n]=t[n];return s};Z.some=(t,e,r)=>{let i=[].concat(t);for(let s of [].concat(e)){let n=it(String(s),r);if(i.some(o=>n(o)))return true}return false};Z.every=(t,e,r)=>{let i=[].concat(t);for(let s of [].concat(e)){let n=it(String(s),r);if(!i.every(o=>n(o)))return false}return true};Z.all=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${Lg.inspect(t)}"`);return [].concat(e).every(i=>it(i,r)(t))};Z.capture=(t,e,r)=>{let i=gu.isWindows(r),n=it.makeRe(String(t),{...r,capture:true}).exec(i?gu.toPosixSlashes(e):e);if(n)return n.slice(1).map(o=>o===void 0?"":o)};Z.makeRe=(...t)=>it.makeRe(...t);Z.scan=(...t)=>it.scan(...t);Z.parse=(t,e)=>{let r=[];for(let i of [].concat(t||[]))for(let s of jg(String(i),e))r.push(it.parse(s,e));return r};Z.braces=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return e&&e.nobrace===true||!Gg(t)?[t]:jg(t,e)};Z.braceExpand=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return Z.braces(t,{...e,expand:true})};Z.hasBraces=Gg;Vg.exports=Z;});var Zg=y(bu=>{Object.defineProperty(bu,"__esModule",{value:true});bu.matchPathFilter=CE;var Jg=Bm(),vE=Wg(),yE=H("url"),Ug=ss();function CE(t="/",e,r){if(Kg(t))return zg(t,e);if(Yg(t))return Xg(t,e);if(Array.isArray(t)){if(t.every(Kg))return wE(t,e);if(t.every(Yg))return _E(t,e);throw new Error(Ug.ERRORS.ERR_CONTEXT_MATCHER_INVALID_ARRAY)}if(typeof t=="function"){let i=Du(e);return t(i,r)}throw new Error(Ug.ERRORS.ERR_CONTEXT_MATCHER_GENERIC)}function zg(t,e){return Du(e)?.indexOf(t)===0}function Xg(t,e){let r=Du(e),i=vE([r],t);return i&&i.length>0}function _E(t,e){return Xg(t,e)}function wE(t,e){let r=false;for(let i of t)if(zg(i,e)){r=true;break}return r}function Du(t){return t&&yE.parse(t).pathname}function Kg(t){return typeof t=="string"&&!Jg(t)}function Yg(t){return Jg(t)}});var yu=y(vu=>{Object.defineProperty(vu,"__esModule",{value:true});function Qg(t){return Object.prototype.toString.call(t)==="[object Object]"}function xE(t){var e,r;return Qg(t)===false?false:(e=t.constructor,e===void 0?true:(r=e.prototype,!(Qg(r)===false||r.hasOwnProperty("isPrototypeOf")===false)))}vu.isPlainObject=xE;});var rD=y(Cu=>{Object.defineProperty(Cu,"__esModule",{value:true});Cu.createPathRewriter=AE;var eD=yu(),FE=ss(),EE=vt(),tD=EE.Debug.extend("path-rewriter");function AE(t){let e;if(!$E(t))return;if(typeof t=="function")return t;return e=OE(t),r;function r(i){let s=i;for(let n of e)if(n.regex.test(i)){s=s.replace(n.regex,n.value),tD('rewriting path from "%s" to "%s"',i,s);break}return s}}function $E(t){if(typeof t=="function")return true;if((0, eD.isPlainObject)(t))return Object.keys(t).length!==0;if(t==null)return false;throw new Error(FE.ERRORS.ERR_PATH_REWRITER_CONFIG)}function OE(t){let e=[];if((0, eD.isPlainObject)(t))for(let[r,i]of Object.entries(t))e.push({regex:new RegExp(r),value:i}),tD('rewrite rule created: "%s" ~> "%s"',r,i);return e}});var sD=y(_u=>{Object.defineProperty(_u,"__esModule",{value:true});_u.getTarget=TE;var SE=yu(),RE=vt(),iD=RE.Debug.extend("router");async function TE(t,e){let r,i=e.router;return (0, SE.isPlainObject)(i)?r=PE(t,i):typeof i=="function"&&(r=await i(t)),r}function PE(t,e){let r,i=t.headers.host,s=t.url,n=i+s;for(let[o,a]of Object.entries(e))if(kE(o)){if(n.indexOf(o)>-1){r=a,iD('match: "%s" -> "%s"',o,r);break}}else if(o===i){r=a,iD('match: "%s" -> "%s"',i,r);break}return r}function kE(t){return t.indexOf("/")>-1}});var nD=y(Cs=>{Object.defineProperty(Cs,"__esModule",{value:true});Cs.HttpProxyMiddleware=void 0;var IE=_m(),ME=xm(),BE=Tm(),NE=Zg(),HE=rD(),qE=sD(),st=vt(),LE=cs(),jE=us(),wu=class{constructor(e){this.wsInternalSubscribed=false,this.serverOnCloseSubscribed=false,this.middleware=async(r,i,s)=>{if(this.shouldProxy(this.proxyOptions.pathFilter,r))try{let o=await this.prepareProxyRequest(r);(0,st.Debug)("proxy request to target: %O",o.target),this.proxy.web(r,i,o);}catch(o){s?.(o);}else s?.();let n=(r.socket??r.connection)?.server;n&&!this.serverOnCloseSubscribed&&(n.on("close",()=>{(0, st.Debug)("server close signal received: closing proxy server"),this.proxy.close();}),this.serverOnCloseSubscribed=true),this.proxyOptions.ws===true&&this.catchUpgradeRequest(n);},this.catchUpgradeRequest=r=>{this.wsInternalSubscribed||((0, st.Debug)("subscribing to server upgrade event"),r.on("upgrade",this.handleUpgrade),this.wsInternalSubscribed=true);},this.handleUpgrade=async(r,i,s)=>{try{if(this.shouldProxy(this.proxyOptions.pathFilter,r)){let n=await this.prepareProxyRequest(r);this.proxy.ws(r,i,s,n),(0,st.Debug)("server upgrade event received. Proxying WebSocket");}}catch(n){this.proxy.emit("error",n,r,i);}},this.shouldProxy=(r,i)=>{try{return (0,NE.matchPathFilter)(r,i.url,i)}catch(s){return (0, st.Debug)("Error: matchPathFilter() called with request url: ",`"${i.url}"`),this.logger.error(s),false}},this.prepareProxyRequest=async r=>{this.middleware.__LEGACY_HTTP_PROXY_MIDDLEWARE__&&(r.url=r.originalUrl||r.url);let i=Object.assign({},this.proxyOptions);return await this.applyRouter(r,i),await this.applyPathRewrite(r,this.pathRewriter),i},this.applyRouter=async(r,i)=>{let s;i.router&&(s=await qE.getTarget(r,i),s&&((0, st.Debug)('router new target: "%s"',s),i.target=s));},this.applyPathRewrite=async(r,i)=>{if(i){let s=await i(r.url,r);typeof s=="string"?((0, st.Debug)("pathRewrite new path: %s",r.url),r.url=s):(0, st.Debug)("pathRewrite: no rewritten path found: %s",r.url);}},(0, ME.verifyConfig)(e),this.proxyOptions=e,this.logger=(0, jE.getLogger)(e),(0, st.Debug)("create proxy server"),this.proxy=IE.createProxyServer({}),this.registerPlugins(this.proxy,this.proxyOptions),this.pathRewriter=HE.createPathRewriter(this.proxyOptions.pathRewrite),this.middleware.upgrade=(r,i,s)=>{this.wsInternalSubscribed||this.handleUpgrade(r,i,s);};}registerPlugins(e,r){(0, BE.getPlugins)(r).forEach(s=>{(0, st.Debug)(`register plugin: "${(0, LE.getFunctionName)(s)}"`),s(e,r);});}};Cs.HttpProxyMiddleware=wu;});var Fu=y(xu=>{Object.defineProperty(xu,"__esModule",{value:true});xu.createProxyMiddleware=VE;var GE=nD();function VE(t){let{middleware:e}=new GE.HttpProxyMiddleware(t);return e}});var oD=y(Au=>{Object.defineProperty(Au,"__esModule",{value:true});Au.responseInterceptor=KE;var Eu=H("zlib"),WE=vt(),UE=cs(),vr=WE.Debug.extend("response-interceptor");function KE(t){return async function(r,i,s){vr("intercept proxy response");let n=r,o=Buffer.from("","utf8"),a=YE(r,r.headers["content-encoding"]);a.on("data",u=>o=Buffer.concat([o,u])),a.on("end",async()=>{JE(r,s),vr("call interceptor function: %s",(0, UE.getFunctionName)(t));let u=Buffer.from(await t(o,n,i,s));vr("set content-length: %s",Buffer.byteLength(u,"utf8")),s.setHeader("content-length",Buffer.byteLength(u,"utf8")),vr("write intercepted response"),s.write(u),s.end();}),a.on("error",u=>{s.end(`Error fetching proxied request: ${u.message}`);});}}function YE(t,e){let r=t,i;switch(e){case "gzip":i=Eu.createGunzip();break;case "br":i=Eu.createBrotliDecompress();break;case "deflate":i=Eu.createInflate();break;}return i&&(vr("decompress proxy response with 'content-encoding': %s",e),r.pipe(i),r=i),r}function JE(t,e){if(vr("copy original response headers"),e.statusCode=t.statusCode,e.statusMessage=t.statusMessage,e.setHeader){let r=Object.keys(t.headers);r=r.filter(i=>!["content-encoding","transfer-encoding"].includes(i)),r.forEach(i=>{let s=t.headers[i];i==="set-cookie"&&(s=Array.isArray(s)?s:[s],s=s.map(n=>n.replace(/Domain=[^;]+?/i,""))),e.setHeader(i,s);});}else e.headers=t.headers;}});var aD=y($u=>{Object.defineProperty($u,"__esModule",{value:true});$u.fixRequestBody=XE;var zE=H("querystring");function XE(t,e){if(e.readableLength!==0)return;let r=e.body;if(!r)return;let i=t.getHeader("Content-Type");if(!i)return;let s=n=>{t.setHeader("Content-Length",Buffer.byteLength(n)),t.write(n);};i.includes("application/json")||i.includes("+json")?s(JSON.stringify(r)):i.includes("application/x-www-form-urlencoded")?s(zE.stringify(r)):i.includes("multipart/form-data")&&s(ZE(i,r));}function ZE(t,e){let r=t.replace(/^.*boundary=(.*)$/,"$1"),i="";for(let[s,n]of Object.entries(e))i+=`--${r}\r
138
- Content-Disposition: form-data; name="${s}"\r
139
- \r
140
- ${n}\r
141
- `;return i}});var uD=y(yr=>{Object.defineProperty(yr,"__esModule",{value:true});yr.fixRequestBody=yr.responseInterceptor=void 0;var QE=oD();Object.defineProperty(yr,"responseInterceptor",{enumerable:true,get:function(){return QE.responseInterceptor}});var e1=aD();Object.defineProperty(yr,"fixRequestBody",{enumerable:true,get:function(){return e1.fixRequestBody}});});var lD=y(Jt=>{var t1=Jt&&Jt.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r);var s=Object.getOwnPropertyDescriptor(e,r);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:true,get:function(){return e[r]}}),Object.defineProperty(t,i,s);}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r];}),r1=Jt&&Jt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&t1(e,t,r);};Object.defineProperty(Jt,"__esModule",{value:true});r1(uD(),Jt);});var cD=y(Su=>{Object.defineProperty(Su,"__esModule",{value:true});Su.legacyOptionsAdapter=a1;var i1=H("url"),s1=vt(),n1=us(),ei=s1.Debug.extend("legacy-options-adapter"),o1={onError:"error",onProxyReq:"proxyReq",onProxyRes:"proxyRes",onProxyReqWs:"proxyReqWs",onOpen:"open",onClose:"close"};function a1(t,e){let r={},i;if(typeof t=="string"&&i1.parse(t).host)throw new Error(`Shorthand syntax is removed from legacyCreateProxyMiddleware().
142
- Please use "legacyCreateProxyMiddleware({ target: 'http://www.example.org' })" instead.
143
-
144
- More details: https://github.com/chimurai/http-proxy-middleware/blob/master/MIGRATION.md#removed-shorthand-usage
145
- `);t&&e?(ei("map legacy context/filter to options.pathFilter"),r={...e,pathFilter:t},i=Ou(r),i.warn(`[http-proxy-middleware] Legacy "context" argument is deprecated. Migrate your "context" to "options.pathFilter":
146
-
147
- const options = {
148
- pathFilter: '${t}',
149
- }
150
-
151
- More details: https://github.com/chimurai/http-proxy-middleware/blob/master/MIGRATION.md#removed-context-argument
152
- `)):t&&!e?(r={...t},i=Ou(r)):i=Ou({}),Object.entries(o1).forEach(([o,a])=>{r[o]&&(r.on={...r.on},r.on[a]=r[o],ei('map legacy event "%s" to "on.%s"',o,a),i.warn(`[http-proxy-middleware] Legacy "${o}" is deprecated. Migrate to "options.on.${a}":
153
-
154
- const options = {
155
- on: {
156
- ${a}: () => {},
157
- },
158
- }
159
-
160
- More details: https://github.com/chimurai/http-proxy-middleware/blob/master/MIGRATION.md#refactored-proxy-events
161
- `));});let s=r.logProvider&&r.logProvider(),n=r.logLevel;return ei("legacy logLevel",n),ei("legacy logProvider: %O",s),typeof n=="string"&&n!=="silent"&&(ei('map "logProvider" to "logger"'),i.warn(`[http-proxy-middleware] Legacy "logLevel" and "logProvider" are deprecated. Migrate to "options.logger":
162
-
163
- const options = {
164
- logger: console,
165
- }
166
-
167
- More details: https://github.com/chimurai/http-proxy-middleware/blob/master/MIGRATION.md#removed-logprovider-and-loglevel-options
168
- `)),r}function Ou(t){let e=t.logProvider&&t.logProvider();return e&&(t.logger=e),(0, n1.getLogger)(t)}});var dD=y(Ru=>{Object.defineProperty(Ru,"__esModule",{value:true});Ru.legacyCreateProxyMiddleware=h1;var u1=Fu(),l1=vt(),c1=cD(),hD=l1.Debug.extend("legacy-create-proxy-middleware");function h1(t,e){hD("init");let r=(0, c1.legacyOptionsAdapter)(t,e),i=(0, u1.createProxyMiddleware)(r);return hD("add marker for patching req.url (old behavior)"),i.__LEGACY_HTTP_PROXY_MIDDLEWARE__=true,i}});var fD=y(_s=>{Object.defineProperty(_s,"__esModule",{value:true});_s.legacyCreateProxyMiddleware=void 0;var d1=dD();Object.defineProperty(_s,"legacyCreateProxyMiddleware",{enumerable:true,get:function(){return d1.legacyCreateProxyMiddleware}});});var pD=y(zt=>{var f1=zt&&zt.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r);var s=Object.getOwnPropertyDescriptor(e,r);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:true,get:function(){return e[r]}}),Object.defineProperty(t,i,s);}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r];}),p1=zt&&zt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&f1(e,t,r);};Object.defineProperty(zt,"__esModule",{value:true});p1(fD(),zt);});var mD=y(nt=>{var m1=nt&&nt.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r);var s=Object.getOwnPropertyDescriptor(e,r);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:true,get:function(){return e[r]}}),Object.defineProperty(t,i,s);}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r];}),ws=nt&&nt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&m1(e,t,r);};Object.defineProperty(nt,"__esModule",{value:true});ws(Fu(),nt);ws(lD(),nt);ws(Qa(),nt);ws(pD(),nt);});var Uu=ve(Wu()),{program:k1,createCommand:I1,createArgument:M1,createOption:B1,CommanderError:N1,InvalidArgumentError:H1,InvalidOptionArgumentError:q1,Command:Re,Argument:L1,Option:j1,Help:G1}=Uu.default;function Ws(t,e){return `#compdef ${t}
169
- compdef _${t} ${t}
170
-
171
- # zsh completion for ${t} -*- shell-script -*-
172
-
173
- __${t}_debug() {
174
- local file="$BASH_COMP_DEBUG_FILE"
175
- if [[ -n \${file} ]]; then
176
- echo "$*" >> "\${file}"
177
- fi
178
- }
179
-
180
- _${t}() {
181
- local shellCompDirectiveError=${J.ShellCompDirectiveError}
182
- local shellCompDirectiveNoSpace=${J.ShellCompDirectiveNoSpace}
183
- local shellCompDirectiveNoFileComp=${J.ShellCompDirectiveNoFileComp}
184
- local shellCompDirectiveFilterFileExt=${J.ShellCompDirectiveFilterFileExt}
185
- local shellCompDirectiveFilterDirs=${J.ShellCompDirectiveFilterDirs}
186
- local shellCompDirectiveKeepOrder=${J.ShellCompDirectiveKeepOrder}
187
-
188
- local lastParam lastChar flagPrefix requestComp out directive comp lastComp noSpace keepOrder
189
- local -a completions
190
-
191
- __${t}_debug "\\n========= starting completion logic =========="
192
- __${t}_debug "CURRENT: \${CURRENT}, words[*]: \${words[*]}"
193
-
194
- # The user could have moved the cursor backwards on the command-line.
195
- # We need to trigger completion from the $CURRENT location, so we need
196
- # to truncate the command-line ($words) up to the $CURRENT location.
197
- # (We cannot use $CURSOR as its value does not work when a command is an alias.)
198
- words=( "\${=words[1,CURRENT]}" )
199
- __${t}_debug "Truncated words[*]: \${words[*]},"
200
-
201
- lastParam=\${words[-1]}
202
- lastChar=\${lastParam[-1]}
203
- __${t}_debug "lastParam: \${lastParam}, lastChar: \${lastChar}"
204
-
205
- # For zsh, when completing a flag with an = (e.g., ${t} -n=<TAB>)
206
- # completions must be prefixed with the flag
207
- setopt local_options BASH_REMATCH
208
- if [[ "\${lastParam}" =~ '-.*=' ]]; then
209
- # We are dealing with a flag with an =
210
- flagPrefix="-P \${BASH_REMATCH}"
211
- fi
212
-
213
- # Prepare the command to obtain completions, ensuring arguments are quoted for eval
214
- local -a args_to_quote=("\${(@)words[2,-1]}")
215
- if [ "\${lastChar}" = "" ]; then
216
- # If the last parameter is complete (there is a space following it)
217
- # We add an extra empty parameter so we can indicate this to the go completion code.
218
- __${t}_debug "Adding extra empty parameter"
219
- args_to_quote+=("")
220
- fi
221
-
222
- # Use Zsh's (q) flag to quote each argument safely for eval
223
- local quoted_args=("\${(@q)args_to_quote}")
224
-
225
- # Join the main command and the quoted arguments into a single string for eval
226
- requestComp="${e} complete -- \${quoted_args[*]}"
227
-
228
- __${t}_debug "About to call: eval \${requestComp}"
229
-
230
- # Use eval to handle any environment variables and such
231
- out=$(eval \${requestComp} 2>/dev/null)
232
- __${t}_debug "completion output: \${out}"
233
-
234
- # Extract the directive integer following a : from the last line
235
- local lastLine
236
- while IFS='
237
- ' read -r line; do
238
- lastLine=\${line}
239
- done < <(printf "%s
240
- " "\${out[@]}")
241
- __${t}_debug "last line: \${lastLine}"
242
-
243
- if [ "\${lastLine[1]}" = : ]; then
244
- directive=\${lastLine[2,-1]}
245
- # Remove the directive including the : and the newline
246
- local suffix
247
- (( suffix=\${#lastLine}+2))
248
- out=\${out[1,-$suffix]}
249
- else
250
- # There is no directive specified. Leave $out as is.
251
- __${t}_debug "No directive found. Setting to default"
252
- directive=0
253
- fi
254
-
255
- __${t}_debug "directive: \${directive}"
256
- __${t}_debug "completions: \${out}"
257
- __${t}_debug "flagPrefix: \${flagPrefix}"
258
-
259
- if [ $((directive & shellCompDirectiveError)) -ne 0 ]; then
260
- __${t}_debug "Completion received error. Ignoring completions."
261
- return
262
- fi
263
-
264
- local activeHelpMarker="%"
265
- local endIndex=\${#activeHelpMarker}
266
- local startIndex=$((\${#activeHelpMarker}+1))
267
- local hasActiveHelp=0
268
- while IFS='
269
- ' read -r comp; do
270
- # Check if this is an activeHelp statement (i.e., prefixed with $activeHelpMarker)
271
- if [ "\${comp[1,$endIndex]}" = "$activeHelpMarker" ];then
272
- __${t}_debug "ActiveHelp found: $comp"
273
- comp="\${comp[$startIndex,-1]}"
274
- if [ -n "$comp" ]; then
275
- compadd -x "\${comp}"
276
- __${t}_debug "ActiveHelp will need delimiter"
277
- hasActiveHelp=1
278
- fi
279
- continue
280
- fi
281
-
282
- if [ -n "$comp" ]; then
283
- # If requested, completions are returned with a description.
284
- # The description is preceded by a TAB character.
285
- # For zsh's _describe, we need to use a : instead of a TAB.
286
- # We first need to escape any : as part of the completion itself.
287
- comp=\${comp//:/\\:}
288
-
289
- local tab="$(printf '\\t')"
290
- comp=\${comp//$tab/:}
291
-
292
- __${t}_debug "Adding completion: \${comp}"
293
- completions+=\${comp}
294
- lastComp=$comp
295
- fi
296
- done < <(printf "%s
297
- " "\${out[@]}")
298
-
299
- # Add a delimiter after the activeHelp statements, but only if:
300
- # - there are completions following the activeHelp statements, or
301
- # - file completion will be performed (so there will be choices after the activeHelp)
302
- if [ $hasActiveHelp -eq 1 ]; then
303
- if [ \${#completions} -ne 0 ] || [ $((directive & shellCompDirectiveNoFileComp)) -eq 0 ]; then
304
- __${t}_debug "Adding activeHelp delimiter"
305
- compadd -x "--"
306
- hasActiveHelp=0
307
- fi
308
- fi
309
-
310
- if [ $((directive & shellCompDirectiveNoSpace)) -ne 0 ]; then
311
- __${t}_debug "Activating nospace."
312
- noSpace="-S ''"
313
- fi
314
-
315
- if [ $((directive & shellCompDirectiveKeepOrder)) -ne 0 ]; then
316
- __${t}_debug "Activating keep order."
317
- keepOrder="-V"
318
- fi
319
-
320
- if [ $((directive & shellCompDirectiveFilterFileExt)) -ne 0 ]; then
321
- # File extension filtering
322
- local filteringCmd
323
- filteringCmd='_files'
324
- for filter in \${completions[@]}; do
325
- if [ \${filter[1]} != '*' ]; then
326
- # zsh requires a glob pattern to do file filtering
327
- filter="\\*.$filter"
328
- fi
329
- filteringCmd+=" -g $filter"
330
- done
331
- filteringCmd+=" \${flagPrefix}"
332
-
333
- __${t}_debug "File filtering command: $filteringCmd"
334
- _arguments '*:filename:'"$filteringCmd"
335
- elif [ $((directive & shellCompDirectiveFilterDirs)) -ne 0 ]; then
336
- # File completion for directories only
337
- local subdir
338
- subdir="\${completions[1]}"
339
- if [ -n "$subdir" ]; then
340
- __${t}_debug "Listing directories in $subdir"
341
- pushd "\${subdir}" >/dev/null 2>&1
342
- else
343
- __${t}_debug "Listing directories in ."
344
- fi
345
-
346
- local result
347
- _arguments '*:dirname:_files -/'" \${flagPrefix}"
348
- result=$?
349
- if [ -n "$subdir" ]; then
350
- popd >/dev/null 2>&1
351
- fi
352
- return $result
353
- else
354
- __${t}_debug "Calling _describe"
355
- if eval _describe $keepOrder "completions" completions -Q \${flagPrefix} \${noSpace}; then
356
- __${t}_debug "_describe found some completions"
357
-
358
- # Return the success of having called _describe
359
- return 0
360
- else
361
- __${t}_debug "_describe did not find completions."
362
- __${t}_debug "Checking if we should do file completion."
363
- if [ $((directive & shellCompDirectiveNoFileComp)) -ne 0 ]; then
364
- __${t}_debug "deactivating file completion"
365
-
366
- # Return 0 to indicate completion is finished and prevent zsh from
367
- # trying other completion algorithms (which could cause hanging).
368
- # We use NoFileComp directive to explicitly disable file completion.
369
- return 0
370
- else
371
- # Perform file completion
372
- __${t}_debug "Activating file completion"
373
-
374
- # We must return the result of this command, so it must be the
375
- # last command, or else we must store its result to return it.
376
- _arguments '*:filename:_files'" \${flagPrefix}"
377
- fi
378
- fi
379
- fi
380
- }
381
-
382
- # don't run the completion function when being sourced or eval-ed
383
- if [ "\${funcstack[1]}" = "_${t}" ]; then
384
- _${t}
385
- fi
386
- `}function Us(t,e){let r=t.replace(/[-:]/g,"_");return `# bash completion for ${t}
387
-
388
- # Define shell completion directives
389
- readonly ShellCompDirectiveError=${J.ShellCompDirectiveError}
390
- readonly ShellCompDirectiveNoSpace=${J.ShellCompDirectiveNoSpace}
391
- readonly ShellCompDirectiveNoFileComp=${J.ShellCompDirectiveNoFileComp}
392
- readonly ShellCompDirectiveFilterFileExt=${J.ShellCompDirectiveFilterFileExt}
393
- readonly ShellCompDirectiveFilterDirs=${J.ShellCompDirectiveFilterDirs}
394
- readonly ShellCompDirectiveKeepOrder=${J.ShellCompDirectiveKeepOrder}
395
-
396
- # Function to debug completion
397
- __${r}_debug() {
398
- if [[ -n \${BASH_COMP_DEBUG_FILE:-} ]]; then
399
- echo "$*" >> "\${BASH_COMP_DEBUG_FILE}"
400
- fi
401
- }
402
-
403
- # Function to handle completions
404
- __${r}_complete() {
405
- local cur prev words cword
406
- _get_comp_words_by_ref -n "=:" cur prev words cword
407
-
408
- local requestComp out directive
409
-
410
- # Build the command to get completions
411
- requestComp="${e} complete -- \${words[@]:1}"
412
-
413
- # Add an empty parameter if the last parameter is complete
414
- if [[ -z "$cur" ]]; then
415
- requestComp="$requestComp ''"
416
- fi
417
-
418
- # Get completions from the program
419
- out=$(eval "$requestComp" 2>/dev/null)
420
-
421
- # Extract directive if present
422
- directive=0
423
- if [[ "$out" == *:* ]]; then
424
- directive=\${out##*:}
425
- out=\${out%:*}
426
- fi
427
-
428
- # Process completions based on directive
429
- if [[ $((directive & $ShellCompDirectiveError)) -ne 0 ]]; then
430
- # Error, no completion
431
- return
432
- fi
433
-
434
- # Apply directives
435
- if [[ $((directive & $ShellCompDirectiveNoSpace)) -ne 0 ]]; then
436
- compopt -o nospace
437
- fi
438
- if [[ $((directive & $ShellCompDirectiveKeepOrder)) -ne 0 ]]; then
439
- compopt -o nosort
440
- fi
441
- if [[ $((directive & $ShellCompDirectiveNoFileComp)) -ne 0 ]]; then
442
- compopt +o default
443
- fi
444
-
445
- # Handle file extension filtering
446
- if [[ $((directive & $ShellCompDirectiveFilterFileExt)) -ne 0 ]]; then
447
- local filter=""
448
- for ext in $out; do
449
- filter="$filter|$ext"
450
- done
451
- filter="\\.($filter)"
452
- compopt -o filenames
453
- COMPREPLY=( $(compgen -f -X "!$filter" -- "$cur") )
454
- return
455
- fi
456
-
457
- # Handle directory filtering
458
- if [[ $((directive & $ShellCompDirectiveFilterDirs)) -ne 0 ]]; then
459
- compopt -o dirnames
460
- COMPREPLY=( $(compgen -d -- "$cur") )
461
- return
462
- fi
463
-
464
- # Process completions
465
- local IFS=$'\\n'
466
- local tab=$(printf '\\t')
467
-
468
- # Parse completions with descriptions
469
- local completions=()
470
- while read -r comp; do
471
- if [[ "$comp" == *$tab* ]]; then
472
- # Split completion and description
473
- local value=\${comp%%$tab*}
474
- local desc=\${comp#*$tab}
475
- completions+=("$value")
476
- else
477
- completions+=("$comp")
478
- fi
479
- done <<< "$out"
480
-
481
- # Return completions
482
- COMPREPLY=( $(compgen -W "\${completions[*]}" -- "$cur") )
483
- }
484
-
485
- # Register completion function
486
- complete -F __${r}_complete ${t}
487
- `}function Ks(t,e){let r=t.replace(/[-:]/g,"_");return `# fish completion for ${t} -*- shell-script -*-
488
-
489
- # Define shell completion directives
490
- set -l ShellCompDirectiveError ${J.ShellCompDirectiveError}
491
- set -l ShellCompDirectiveNoSpace ${J.ShellCompDirectiveNoSpace}
492
- set -l ShellCompDirectiveNoFileComp ${J.ShellCompDirectiveNoFileComp}
493
- set -l ShellCompDirectiveFilterFileExt ${J.ShellCompDirectiveFilterFileExt}
494
- set -l ShellCompDirectiveFilterDirs ${J.ShellCompDirectiveFilterDirs}
495
- set -l ShellCompDirectiveKeepOrder ${J.ShellCompDirectiveKeepOrder}
496
-
497
- function __${r}_debug
498
- set -l file "$BASH_COMP_DEBUG_FILE"
499
- if test -n "$file"
500
- echo "$argv" >> $file
501
- end
502
- end
503
-
504
- function __${r}_perform_completion
505
- __${r}_debug "Starting __${r}_perform_completion"
506
-
507
- # Extract all args except the completion flag
508
- set -l args (string match -v -- "--completion=" (commandline -opc))
509
-
510
- # Extract the current token being completed
511
- set -l current_token (commandline -ct)
512
-
513
- # Check if current token starts with a dash
514
- set -l flag_prefix ""
515
- if string match -q -- "-*" $current_token
516
- set flag_prefix "--flag="
517
- end
518
-
519
- __${r}_debug "Current token: $current_token"
520
- __${r}_debug "All args: $args"
521
-
522
- # Call the completion program and get the results
523
- set -l requestComp "${e} complete -- $args"
524
- __${r}_debug "Calling $requestComp"
525
- set -l results (eval $requestComp 2> /dev/null)
526
-
527
- # Some programs may output extra empty lines after the directive.
528
- # Let's ignore them or else it will break completion.
529
- # Ref: https://github.com/spf13/cobra/issues/1279
530
- for line in $results[-1..1]
531
- if test (string sub -s 1 -l 1 -- $line) = ":"
532
- # The directive
533
- set -l directive (string sub -s 2 -- $line)
534
- set -l directive_num (math $directive)
535
- break
536
- end
537
- end
538
-
539
- # No directive specified, use default
540
- if not set -q directive_num
541
- set directive_num 0
542
- end
543
-
544
- __${r}_debug "Directive: $directive_num"
545
-
546
- # Process completions based on directive
547
- if test $directive_num -eq $ShellCompDirectiveError
548
- # Error code. No completion.
549
- __${r}_debug "Received error directive: aborting."
550
- return 1
551
- end
552
-
553
- # Filter out the directive (last line)
554
- if test (count $results) -gt 0 -a (string sub -s 1 -l 1 -- $results[-1]) = ":"
555
- set results $results[1..-2]
556
- end
557
-
558
- # No completions, let fish handle file completions unless forbidden
559
- if test (count $results) -eq 0
560
- if test $directive_num -ne $ShellCompDirectiveNoFileComp
561
- __${r}_debug "No completions, performing file completion"
562
- return 1
563
- end
564
- __${r}_debug "No completions, but file completion forbidden"
565
- return 0
566
- end
567
-
568
- # Filter file extensions
569
- if test $directive_num -eq $ShellCompDirectiveFilterFileExt
570
- __${r}_debug "File extension filtering"
571
- set -l file_extensions
572
- for item in $results
573
- if test -n "$item" -a (string sub -s 1 -l 1 -- $item) != "-"
574
- set -a file_extensions "*$item"
575
- end
576
- end
577
- __${r}_debug "File extensions: $file_extensions"
578
-
579
- # Use the file extensions as completions
580
- set -l completions
581
- for ext in $file_extensions
582
- # Get all files matching the extension
583
- set -a completions (string replace -r '^.*/' '' -- $ext)
584
- end
585
-
586
- for item in $completions
587
- echo -e "$item "
588
- end
589
- return 0
590
- end
591
-
592
- # Filter directories
593
- if test $directive_num -eq $ShellCompDirectiveFilterDirs
594
- __${r}_debug "Directory filtering"
595
- set -l dirs
596
- for item in $results
597
- if test -d "$item"
598
- set -a dirs "$item/"
599
- end
600
- end
601
-
602
- for item in $dirs
603
- echo -e "$item "
604
- end
605
- return 0
606
- end
607
-
608
- # Process remaining completions
609
- for item in $results
610
- if test -n "$item"
611
- # Check if the item has a description
612
- if string match -q "* *" -- "$item"
613
- set -l completion_parts (string split -- "$item")
614
- set -l comp $completion_parts[1]
615
- set -l desc $completion_parts[2]
616
-
617
- # Add the completion and description
618
- echo -e "$comp $desc"
619
- else
620
- # Add just the completion
621
- echo -e "$item "
622
- end
623
- end
624
- end
625
-
626
- # If directive contains NoSpace, tell fish not to add a space after completion
627
- if test (math "$directive_num & $ShellCompDirectiveNoSpace") -ne 0
628
- return 2
629
- end
630
-
631
- return 0
632
- end
633
-
634
- # Set up the completion for the ${t} command
635
- complete -c ${t} -f -a "(eval __${r}_perform_completion)"
636
- `}function Ys(t,e){let r=t.replace(/[-:]/g,"_");return `# powershell completion for ${t} -*- shell-script -*-
637
-
638
- [Console]::OutputEncoding = [System.Text.Encoding]::UTF8
639
- function __${t}_debug {
640
- if ($env:BASH_COMP_DEBUG_FILE) {
641
- "$args" | Out-File -Append -FilePath "$env:BASH_COMP_DEBUG_FILE"
642
- }
643
- }
644
-
645
- filter __${t}_escapeStringWithSpecialChars {
646
- $_ -replace '\\s|#|@|\\$|;|,|''|\\{|\\}|\\(|\\)|"|\\||<|>|&','\`$&'
647
- }
648
-
649
- [scriptblock]$__${r}CompleterBlock = {
650
- param(
651
- $WordToComplete,
652
- $CommandAst,
653
- $CursorPosition
654
- )
655
-
656
- # Get the current command line and convert into a string
657
- $Command = $CommandAst.CommandElements
658
- $Command = "$Command"
659
-
660
- __${t}_debug ""
661
- __${t}_debug "========= starting completion logic =========="
662
- __${t}_debug "WordToComplete: $WordToComplete Command: $Command CursorPosition: $CursorPosition"
663
-
664
- # The user could have moved the cursor backwards on the command-line.
665
- # We need to trigger completion from the $CursorPosition location, so we need
666
- # to truncate the command-line ($Command) up to the $CursorPosition location.
667
- # Make sure the $Command is longer then the $CursorPosition before we truncate.
668
- # This happens because the $Command does not include the last space.
669
- if ($Command.Length -gt $CursorPosition) {
670
- $Command = $Command.Substring(0, $CursorPosition)
671
- }
672
- __${t}_debug "Truncated command: $Command"
673
-
674
- $ShellCompDirectiveError=${J.ShellCompDirectiveError}
675
- $ShellCompDirectiveNoSpace=${J.ShellCompDirectiveNoSpace}
676
- $ShellCompDirectiveNoFileComp=${J.ShellCompDirectiveNoFileComp}
677
- $ShellCompDirectiveFilterFileExt=${J.ShellCompDirectiveFilterFileExt}
678
- $ShellCompDirectiveFilterDirs=${J.ShellCompDirectiveFilterDirs}
679
- $ShellCompDirectiveKeepOrder=${J.ShellCompDirectiveKeepOrder}
680
-
681
- # Prepare the command to request completions for the program.
682
- # Split the command at the first space to separate the program and arguments.
683
- $Program, $Arguments = $Command.Split(" ", 2)
684
-
685
- $QuotedArgs = ($Arguments -split ' ' | ForEach-Object { "'" + ($_ -replace "'", "''") + "'" }) -join ' '
686
- __${t}_debug "QuotedArgs: $QuotedArgs"
687
-
688
- $RequestComp = "& ${e} complete '--' $QuotedArgs"
689
- __${t}_debug "RequestComp: $RequestComp"
690
-
691
- # we cannot use $WordToComplete because it
692
- # has the wrong values if the cursor was moved
693
- # so use the last argument
694
- if ($WordToComplete -ne "" ) {
695
- $WordToComplete = $Arguments.Split(" ")[-1]
696
- }
697
- __${t}_debug "New WordToComplete: $WordToComplete"
698
-
699
-
700
- # Check for flag with equal sign
701
- $IsEqualFlag = ($WordToComplete -Like "--*=*" )
702
- if ( $IsEqualFlag ) {
703
- __${t}_debug "Completing equal sign flag"
704
- # Remove the flag part
705
- $Flag, $WordToComplete = $WordToComplete.Split("=", 2)
706
- }
707
-
708
- if ( $WordToComplete -eq "" -And ( -Not $IsEqualFlag )) {
709
- # If the last parameter is complete (there is a space following it)
710
- # We add an extra empty parameter so we can indicate this to the go method.
711
- __${t}_debug "Adding extra empty parameter"
712
- # PowerShell 7.2+ changed the way how the arguments are passed to executables,
713
- # so for pre-7.2 or when Legacy argument passing is enabled we need to use
714
- if ($PSVersionTable.PsVersion -lt [version]'7.2.0' -or
715
- ($PSVersionTable.PsVersion -lt [version]'7.3.0' -and -not [ExperimentalFeature]::IsEnabled("PSNativeCommandArgumentPassing")) -or
716
- (($PSVersionTable.PsVersion -ge [version]'7.3.0' -or [ExperimentalFeature]::IsEnabled("PSNativeCommandArgumentPassing")) -and
717
- $PSNativeCommandArgumentPassing -eq 'Legacy')) {
718
- $RequestComp="$RequestComp" + ' \`"\`"'
719
- } else {
720
- $RequestComp = "$RequestComp" + ' ""'
721
- }
722
- }
723
-
724
- __${t}_debug "Calling $RequestComp"
725
- # First disable ActiveHelp which is not supported for Powershell
726
- $env:ActiveHelp = 0
727
-
728
- # call the command store the output in $out and redirect stderr and stdout to null
729
- # $Out is an array contains each line per element
730
- Invoke-Expression -OutVariable out "$RequestComp" 2>&1 | Out-Null
731
-
732
- # get directive from last line
733
- [int]$Directive = $Out[-1].TrimStart(':')
734
- if ($Directive -eq "") {
735
- # There is no directive specified
736
- $Directive = 0
737
- }
738
- __${t}_debug "The completion directive is: $Directive"
739
-
740
- # remove directive (last element) from out
741
- $Out = $Out | Where-Object { $_ -ne $Out[-1] }
742
- __${t}_debug "The completions are: $Out"
743
-
744
- if (($Directive -band $ShellCompDirectiveError) -ne 0 ) {
745
- # Error code. No completion.
746
- __${t}_debug "Received error from custom completion go code"
747
- return
748
- }
749
-
750
- $Longest = 0
751
- [Array]$Values = $Out | ForEach-Object {
752
- # Split the output in name and description
753
- $Name, $Description = $_.Split("\`t", 2)
754
- __${t}_debug "Name: $Name Description: $Description"
755
-
756
- # Look for the longest completion so that we can format things nicely
757
- if ($Longest -lt $Name.Length) {
758
- $Longest = $Name.Length
759
- }
760
-
761
- # Set the description to a one space string if there is none set.
762
- # This is needed because the CompletionResult does not accept an empty string as argument
763
- if (-Not $Description) {
764
- $Description = " "
765
- }
766
- @{ Name = "$Name"; Description = "$Description" }
767
- }
768
-
769
-
770
- $Space = " "
771
- if (($Directive -band $ShellCompDirectiveNoSpace) -ne 0 ) {
772
- # remove the space here
773
- __${t}_debug "ShellCompDirectiveNoSpace is called"
774
- $Space = ""
775
- }
776
-
777
- if ((($Directive -band $ShellCompDirectiveFilterFileExt) -ne 0 ) -or
778
- (($Directive -band $ShellCompDirectiveFilterDirs) -ne 0 )) {
779
- __${t}_debug "ShellCompDirectiveFilterFileExt ShellCompDirectiveFilterDirs are not supported"
780
-
781
- # return here to prevent the completion of the extensions
782
- return
783
- }
784
-
785
- $Values = $Values | Where-Object {
786
- # filter the result
787
- $_.Name -like "$WordToComplete*"
788
-
789
- # Join the flag back if we have an equal sign flag
790
- if ( $IsEqualFlag ) {
791
- __${t}_debug "Join the equal sign flag back to the completion value"
792
- $_.Name = $Flag + "=" + $_.Name
793
- }
794
- }
795
-
796
- # we sort the values in ascending order by name if keep order isn't passed
797
- if (($Directive -band $ShellCompDirectiveKeepOrder) -eq 0 ) {
798
- $Values = $Values | Sort-Object -Property Name
799
- }
800
-
801
- if (($Directive -band $ShellCompDirectiveNoFileComp) -ne 0 ) {
802
- __${t}_debug "ShellCompDirectiveNoFileComp is called"
803
-
804
- if ($Values.Length -eq 0) {
805
- # Just print an empty string here so the
806
- # shell does not start to complete paths.
807
- # We cannot use CompletionResult here because
808
- # it does not accept an empty string as argument.
809
- ""
810
- return
811
- }
812
- }
813
-
814
- # Get the current mode
815
- $Mode = (Get-PSReadLineKeyHandler | Where-Object { $_.Key -eq "Tab" }).Function
816
- __${t}_debug "Mode: $Mode"
817
-
818
- $Values | ForEach-Object {
819
-
820
- # store temporary because switch will overwrite $_
821
- $comp = $_
822
-
823
- # PowerShell supports three different completion modes
824
- # - TabCompleteNext (default windows style - on each key press the next option is displayed)
825
- # - Complete (works like bash)
826
- # - MenuComplete (works like zsh)
827
- # You set the mode with Set-PSReadLineKeyHandler -Key Tab -Function <mode>
828
-
829
- # CompletionResult Arguments:
830
- # 1) CompletionText text to be used as the auto completion result
831
- # 2) ListItemText text to be displayed in the suggestion list
832
- # 3) ResultType type of completion result
833
- # 4) ToolTip text for the tooltip with details about the object
834
-
835
- switch ($Mode) {
836
-
837
- # bash like
838
- "Complete" {
839
-
840
- if ($Values.Length -eq 1) {
841
- __${t}_debug "Only one completion left"
842
-
843
- # insert space after value
844
- [System.Management.Automation.CompletionResult]::new($($comp.Name | __${t}_escapeStringWithSpecialChars) + $Space, "$($comp.Name)", 'ParameterValue', "$($comp.Description)")
845
-
846
- } else {
847
- # Add the proper number of spaces to align the descriptions
848
- while($comp.Name.Length -lt $Longest) {
849
- $comp.Name = $comp.Name + " "
850
- }
851
-
852
- # Check for empty description and only add parentheses if needed
853
- if ($($comp.Description) -eq " " ) {
854
- $Description = ""
855
- } else {
856
- $Description = " ($($comp.Description))"
857
- }
858
-
859
- [System.Management.Automation.CompletionResult]::new("$($comp.Name)$Description", "$($comp.Name)$Description", 'ParameterValue', "$($comp.Description)")
860
- }
861
- }
862
-
863
- # zsh like
864
- "MenuComplete" {
865
- # insert space after value
866
- # MenuComplete will automatically show the ToolTip of
867
- # the highlighted value at the bottom of the suggestions.
868
- [System.Management.Automation.CompletionResult]::new($($comp.Name | __${t}_escapeStringWithSpecialChars) + $Space, "$($comp.Name)", 'ParameterValue', "$($comp.Description)")
869
- }
870
-
871
- # TabCompleteNext and in case we get something unknown
872
- Default {
873
- # Like MenuComplete but we don't want to add a space here because
874
- # the user need to press space anyway to get the completion.
875
- # Description will not be shown because that's not possible with TabCompleteNext
876
- [System.Management.Automation.CompletionResult]::new($($comp.Name | __${t}_escapeStringWithSpecialChars), "$($comp.Name)", 'ParameterValue', "$($comp.Description)")
877
- }
878
- }
879
-
880
- }
881
- }
882
-
883
- Register-ArgumentCompleter -CommandName '${t}' -ScriptBlock $__${r}CompleterBlock
884
- `}var J={ShellCompDirectiveError:1,ShellCompDirectiveNoSpace:2,ShellCompDirectiveNoFileComp:4,ShellCompDirectiveFilterFileExt:8,ShellCompDirectiveFilterDirs:16,ShellCompDirectiveKeepOrder:32,ShellCompDirectiveDefault:0},XD=class{name;variadic;command;handler;constructor(t,e,r,i=false){this.command=t,this.name=e,this.handler=r,this.variadic=i;}},ZD=class{value;description;command;handler;alias;isBoolean;constructor(t,e,r,i,s,n){this.command=t,this.value=e,this.description=r,this.handler=i,this.alias=s,this.isBoolean=n;}},Ku=class{value;description;options=new Map;arguments=new Map;parent;constructor(t,e){this.value=t,this.description=e;}option(t,e,r,i){let s,n,o;typeof r=="function"?(s=r,n=i,o=false):typeof r=="string"?(s=void 0,n=r,o=true):(s=void 0,n=void 0,o=true);let a=new ZD(this,t,e,s,n,o);return this.options.set(t,a),this}argument(t,e,r=false){let i=new XD(this,t,e,r);return this.arguments.set(t,i),this}},QD=class extends Ku{commands=new Map;completions=[];directive=J.ShellCompDirectiveDefault;constructor(){super("","");}command(t,e){let r=new Ku(t,e);return this.commands.set(t,r),r}stripOptions(t){let e=[],r=0;for(;r<t.length;){let i=t[r];if(i.startsWith("-")){r++;let s=false,n=this.findOption(this,i);if(n)s=n.isBoolean??false;else for(let[,o]of this.commands){let a=this.findOption(o,i);if(a){s=a.isBoolean??false;break}}!s&&r<t.length&&!t[r].startsWith("-")&&r++;}else e.push(i),r++;}return e}matchCommand(t){t=this.stripOptions(t);let e=[],r=[],i=null;for(let s=0;s<t.length;s++){let n=t[s];e.push(n);let o=this.commands.get(e.join(" "));if(o)i=o;else {r=t.slice(s,t.length);break}}return [i||this,r]}shouldCompleteFlags(t,e){if(e.startsWith("-"))return true;if(t?.startsWith("-")){let r=this.findOption(this,t);if(!r){for(let[,i]of this.commands)if(r=this.findOption(i,t),r)break}return !(r&&r.isBoolean)}return false}shouldCompleteCommands(t){return !t.startsWith("-")}handleFlagCompletion(t,e,r,i){let s;if(r.includes("=")){let[n]=r.split("=");s=n;}else if(i?.startsWith("-")){let n=this.findOption(t,i);n&&!n.isBoolean&&(s=i);}if(s){let n=this.findOption(t,s);if(n?.handler){let o=[];n.handler.call(n,(a,u)=>o.push({value:a,description:u}),t.options),this.completions=o;}return}if(r.startsWith("-")){let n=r.startsWith("-")&&!r.startsWith("--"),o=r.replace(/^-+/,"");for(let[a,u]of t.options)n&&u.alias&&`-${u.alias}`.startsWith(r)?this.completions.push({value:`-${u.alias}`,description:u.description}):!n&&a.startsWith(o)&&this.completions.push({value:`--${a}`,description:u.description});}}findOption(t,e){let r=t.options.get(e);if(r||(r=t.options.get(e.replace(/^-+/,"")),r))return r;for(let[i,s]of t.options)if(s.alias&&`-${s.alias}`===e)return s}handleCommandCompletion(t,e){let r=this.stripOptions(t);for(let[i,s]of this.commands){if(i==="")continue;let n=i.split(" ");n.slice(0,r.length).every((o,a)=>o===r[a])&&n[r.length]?.startsWith(e)&&this.completions.push({value:n[r.length],description:s.description});}}handlePositionalCompletion(t,e){let r=t.value.split(" ").length,i=Math.max(0,e.length-r),s=Array.from(t.arguments.entries());if(s.length>0){let n;if(i<s.length){let[o,a]=s[i];n=a;}else {let o=s[s.length-1][1];o.variadic&&(n=o);}if(n&&n.handler&&typeof n.handler=="function"){let o=[];n.handler.call(n,(a,u)=>o.push({value:a,description:u}),t.options),this.completions.push(...o);}}}complete(t){this.directive=J.ShellCompDirectiveNoFileComp;let e=new Set;this.completions.filter(r=>e.has(r.value)?false:(e.add(r.value),true)).filter(r=>{if(t.includes("=")){let[,i]=t.split("=");return r.value.startsWith(i)}return r.value.startsWith(t)}).forEach(r=>console.log(`${r.value} ${r.description??""}`)),console.log(`:${this.directive}`);}parse(t){this.completions=[];let e=t[t.length-1]==="";e&&t.pop();let r=t[t.length-1]||"",i=t.slice(0,-1);e&&(r!==""&&i.push(r),r="");let[s]=this.matchCommand(i),n=i[i.length-1];if(this.shouldCompleteFlags(n,r))this.handleFlagCompletion(s,i,r,n);else {if(n?.startsWith("-")&&r===""&&e){let o=this.findOption(this,n);if(!o){for(let[,a]of this.commands)if(o=this.findOption(a,n),o)break}if(o&&o.isBoolean){this.complete(r);return}}this.shouldCompleteCommands(r)&&this.handleCommandCompletion(i,r),s&&s.arguments.size>0&&this.handlePositionalCompletion(s,i);}this.complete(r);}setup(t,e,r){switch(zD__default.default(r==="zsh"||r==="bash"||r==="fish"||r==="powershell","Unsupported shell"),r){case "zsh":{let i=Ws(t,e);console.log(i);break}case "bash":{let i=Us(t,e);console.log(i);break}case "fish":{let i=Ks(t,e);console.log(i);break}case "powershell":{let i=Ys(t,e);console.log(i);break}}}},e0=new QD;var Zt=e0;function Yu(t="cli"){if(process.argv.indexOf("--")===-1){let e=`Error: You need to use -- to separate completion arguments.
885
- Example: ${t} complete -- <args>`;console.error(e),process.exit(1);}}var t0=process.execPath,r0=process.argv.slice(1),i0=Js(t0),s0=r0.map(Js),ui=`${i0} ${process.execArgv.map(Js).join(" ")} ${s0[0]}`;function Js(t){return t.includes(" ")?`'${t}'`:t}function Ju(t){let e=t.name();n0(t),o0(t),t.command("complete [shell]").description("Generate shell completion scripts").action(async i=>{switch(i){case "zsh":{let s=Ws(e,ui);console.log(s);break}case "bash":{let s=Us(e,ui);console.log(s);break}case "fish":{let s=Ks(e,ui);console.log(s);break}case "powershell":{let s=Ys(e,ui);console.log(s);break}case "debug":{let s=new Map;zs(t,"",s),console.log("Collected commands:");for(let[n,o]of s.entries())console.log(`- ${n||"<root>"}: ${o.description()||"No description"}`);break}default:console.error(`Unknown shell: ${i}`),console.error("Supported shells: zsh, bash, fish, powershell"),process.exit(1);}});let r=t.parse.bind(t);return t.parse=function(i,s){let n=i||process.argv,o=n.findIndex(u=>u==="complete"),a=n.findIndex(u=>u==="--");if(o!==-1&&a!==-1&&a>o){let u=n.slice(a+1);return Yu(e),Zt.parse(u),t}return r(i,s)},Zt}function n0(t){for(let e of t.options){let r=e.flags,i=r.match(/^-([a-zA-Z]), --/)?.[1],s=r.match(/--([a-zA-Z0-9-]+)/)?.[1];s&&(i?Zt.option(s,e.description||"",i):Zt.option(s,e.description||""));}}function o0(t){let e=new Map;zs(t,"",e);for(let[r,i]of e.entries()){if(r==="")continue;let s=Zt.command(r,i.description()||"");for(let n of i.options){let o=n.flags,a=o.match(/^-([a-zA-Z]), --/)?.[1],u=o.match(/--([a-zA-Z0-9-]+)/)?.[1];u&&(a?s.option(u,n.description||"",a):s.option(u,n.description||""));}}}function zs(t,e,r){r.set(e,t);for(let i of t.commands)i.name()!=="complete"&&zs(i,e?`${e} ${i.name()}`:i.name(),r);}var ji=ve(Ot()),jr=ve(ir());function Qo(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ho={},fo,Od;function He(){if(Od)return fo;Od=1;let t,e,r,i,s=true;typeof process<"u"&&({FORCE_COLOR:t,NODE_DISABLE_COLORS:e,NO_COLOR:r,TERM:i}=process.env||{},s=process.stdout&&process.stdout.isTTY);let n={enabled:!e&&r==null&&i!=="dumb"&&(t!=null&&t!=="0"||s),reset:u(0,0),bold:u(1,22),dim:u(2,22),italic:u(3,23),underline:u(4,24),inverse:u(7,27),hidden:u(8,28),strikethrough:u(9,29),black:u(30,39),red:u(31,39),green:u(32,39),yellow:u(33,39),blue:u(34,39),magenta:u(35,39),cyan:u(36,39),white:u(37,39),gray:u(90,39),grey:u(90,39),bgBlack:u(40,49),bgRed:u(41,49),bgGreen:u(42,49),bgYellow:u(43,49),bgBlue:u(44,49),bgMagenta:u(45,49),bgCyan:u(46,49),bgWhite:u(47,49)};function o(h,l){let c=0,d,f="",m="";for(;c<h.length;c++)d=h[c],f+=d.open,m+=d.close,~l.indexOf(d.close)&&(l=l.replace(d.rgx,d.close+d.open));return f+l+m}function a(h,l){let c={has:h,keys:l};return c.reset=n.reset.bind(c),c.bold=n.bold.bind(c),c.dim=n.dim.bind(c),c.italic=n.italic.bind(c),c.underline=n.underline.bind(c),c.inverse=n.inverse.bind(c),c.hidden=n.hidden.bind(c),c.strikethrough=n.strikethrough.bind(c),c.black=n.black.bind(c),c.red=n.red.bind(c),c.green=n.green.bind(c),c.yellow=n.yellow.bind(c),c.blue=n.blue.bind(c),c.magenta=n.magenta.bind(c),c.cyan=n.cyan.bind(c),c.white=n.white.bind(c),c.gray=n.gray.bind(c),c.grey=n.grey.bind(c),c.bgBlack=n.bgBlack.bind(c),c.bgRed=n.bgRed.bind(c),c.bgGreen=n.bgGreen.bind(c),c.bgYellow=n.bgYellow.bind(c),c.bgBlue=n.bgBlue.bind(c),c.bgMagenta=n.bgMagenta.bind(c),c.bgCyan=n.bgCyan.bind(c),c.bgWhite=n.bgWhite.bind(c),c}function u(h,l){let c={open:`\x1B[${h}m`,close:`\x1B[${l}m`,rgx:new RegExp(`\\x1b\\[${l}m`,"g")};return function(d){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(h)||(this.has.push(h),this.keys.push(c)),d===void 0?this:n.enabled?o(this.keys,d+""):d+""):d===void 0?a([h],[c]):n.enabled?o([c],d+""):d+""}}return fo=n,fo}var po,Sd;function Sy(){return Sd||(Sd=1,po=(t,e)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl)return t.name==="a"?"first":t.name==="c"||t.name==="d"?"abort":t.name==="e"?"last":t.name==="g"?"reset":t.name==="n"?"down":t.name==="p"?"up":void 0;if(e){if(t.name==="j")return "down";if(t.name==="k")return "up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":false}}),po}var mo,Rd;function ea(){return Rd||(Rd=1,mo=t=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),r=new RegExp(e,"g");return typeof t=="string"?t.replace(r,""):t}),mo}var go,Td;function qe(){if(Td)return go;Td=1;let t="\x1B",e=`${t}[`,r="\x07",i={to(o,a){return a?`${e}${a+1};${o+1}H`:`${e}${o+1}G`},move(o,a){let u="";return o<0?u+=`${e}${-o}D`:o>0&&(u+=`${e}${o}C`),a<0?u+=`${e}${-a}A`:a>0&&(u+=`${e}${a}B`),u},up:(o=1)=>`${e}${o}A`,down:(o=1)=>`${e}${o}B`,forward:(o=1)=>`${e}${o}C`,backward:(o=1)=>`${e}${o}D`,nextLine:(o=1)=>`${e}E`.repeat(o),prevLine:(o=1)=>`${e}F`.repeat(o),left:`${e}G`,hide:`${e}?25l`,show:`${e}?25h`,save:`${t}7`,restore:`${t}8`},s={up:(o=1)=>`${e}S`.repeat(o),down:(o=1)=>`${e}T`.repeat(o)},n={screen:`${e}2J`,up:(o=1)=>`${e}1J`.repeat(o),down:(o=1)=>`${e}J`.repeat(o),line:`${e}2K`,lineEnd:`${e}K`,lineStart:`${e}1K`,lines(o){let a="";for(let u=0;u<o;u++)a+=this.line+(u<o-1?i.up():"");return o&&(a+=i.left),a}};return go={cursor:i,scroll:s,erase:n,beep:r},go}var Do,Pd;function Ry(){if(Pd)return Do;Pd=1;let t=ea(),{erase:e,cursor:r}=qe(),i=s=>[...t(s)].length;return Do=function(s,n){if(!n)return e.line+r.to(0);let o=0,a=s.split(/\r?\n/);for(let u of a)o+=1+Math.floor(Math.max(i(u)-1,0)/n);return e.lines(o)},Do}var bo,kd;function Ef(){if(kd)return bo;kd=1;let t={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},e={arrowUp:t.arrowUp,arrowDown:t.arrowDown,arrowLeft:t.arrowLeft,arrowRight:t.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"};return bo=process.platform==="win32"?e:t,bo}var vo,Id;function Ty(){if(Id)return vo;Id=1;let t=He(),e=Ef(),r=Object.freeze({password:{scale:1,render:u=>"*".repeat(u.length)},emoji:{scale:2,render:u=>"\u{1F603}".repeat(u.length)},invisible:{scale:0,render:u=>""},default:{scale:1,render:u=>`${u}`}}),i=u=>r[u]||r.default,s=Object.freeze({aborted:t.red(e.cross),done:t.green(e.tick),exited:t.yellow(e.cross),default:t.cyan("?")});return vo={styles:r,render:i,symbols:s,symbol:(u,h,l)=>h?s.aborted:l?s.exited:u?s.done:s.default,delimiter:u=>t.gray(u?e.ellipsis:e.pointerSmall),item:(u,h)=>t.gray(u?h?e.pointerSmall:"+":e.line)},vo}var yo,Md;function Py(){if(Md)return yo;Md=1;let t=ea();return yo=function(e,r){let i=String(t(e)||"").split(/\r?\n/);return r?i.map(s=>Math.ceil(s.length/r)).reduce((s,n)=>s+n):i.length},yo}var Co,Bd;function ky(){return Bd||(Bd=1,Co=(t,e={})=>{let r=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",i=e.width;return (t||"").split(/\r?\n/g).map(s=>s.split(/\s+/g).reduce((n,o)=>(o.length+r.length>=i||n[n.length-1].length+o.length+1<i?n[n.length-1]+=` ${o}`:n.push(`${r}${o}`),n),[r]).join(`
886
- `)).join(`
887
- `)}),Co}var _o,Nd;function Iy(){return Nd||(Nd=1,_o=(t,e,r)=>{r=r||e;let i=Math.min(e-r,t-Math.floor(r/2));i<0&&(i=0);let s=Math.min(i+r,e);return {startIndex:i,endIndex:s}}),_o}var wo,Hd;function Qe(){return Hd||(Hd=1,wo={action:Sy(),clear:Ry(),style:Ty(),strip:ea(),figures:Ef(),lines:Py(),wrap:ky(),entriesToDisplay:Iy()}),wo}var xo,qd;function Et(){if(qd)return xo;qd=1;let t=wf__default.default,{action:e}=Qe(),r=my__default.default,{beep:i,cursor:s}=qe(),n=He();class o extends r{constructor(u={}){super(),this.firstRender=true,this.in=u.stdin||process.stdin,this.out=u.stdout||process.stdout,this.onRender=(u.onRender||(()=>{})).bind(this);let h=t.createInterface({input:this.in,escapeCodeTimeout:50});t.emitKeypressEvents(this.in,h),this.in.isTTY&&this.in.setRawMode(true);let l=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,c=(d,f)=>{let m=e(f,l);m===false?this._&&this._(d,f):typeof this[m]=="function"?this[m](f):this.bell();};this.close=()=>{this.out.write(s.show),this.in.removeListener("keypress",c),this.in.isTTY&&this.in.setRawMode(false),h.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=true;},this.in.on("keypress",c);}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited});}bell(){this.out.write(i);}render(){this.onRender(n),this.firstRender&&(this.firstRender=false);}}return xo=o,xo}var Fo,Ld;function My(){if(Ld)return Fo;Ld=1;let t=He(),e=Et(),{erase:r,cursor:i}=qe(),{style:s,clear:n,lines:o,figures:a}=Qe();class u extends e{constructor(l={}){super(l),this.transform=s.render(l.style),this.scale=this.transform.scale,this.msg=l.message,this.initial=l.initial||"",this.validator=l.validate||(()=>true),this.value="",this.errorMsg=l.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=n("",this.out.columns),this.render();}set value(l){!l&&this.initial?(this.placeholder=true,this.rendered=t.gray(this.transform.render(this.initial))):(this.placeholder=false,this.rendered=this.transform.render(l)),this._value=l,this.fire();}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render();}exit(){this.abort();}abort(){this.value=this.value||this.initial,this.done=this.aborted=true,this.error=false,this.red=false,this.fire(),this.render(),this.out.write(`
888
- `),this.close();}async validate(){let l=await this.validator(this.value);typeof l=="string"&&(this.errorMsg=l,l=false),this.error=!l;}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=true,this.fire(),this.render();return}this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
889
- `),this.close();}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render();}moveCursor(l){this.placeholder||(this.cursor=this.cursor+l,this.cursorOffset+=l);}_(l,c){let d=this.value.slice(0,this.cursor),f=this.value.slice(this.cursor);this.value=`${d}${l}${f}`,this.red=false,this.cursor=this.placeholder?0:d.length+1,this.render();}delete(){if(this.isCursorAtStart())return this.bell();let l=this.value.slice(0,this.cursor-1),c=this.value.slice(this.cursor);this.value=`${l}${c}`,this.red=false,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render();}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let l=this.value.slice(0,this.cursor),c=this.value.slice(this.cursor+1);this.value=`${l}${c}`,this.red=false,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render();}first(){this.cursor=0,this.render();}last(){this.cursor=this.value.length,this.render();}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render();}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render();}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(i.down(o(this.outputError,this.out.columns)-1)+n(this.outputError,this.out.columns)),this.out.write(n(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[s.symbol(this.done,this.aborted),t.bold(this.msg),s.delimiter(this.done),this.red?t.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
890
- `).reduce((l,c,d)=>l+`
891
- ${d?" ":a.pointerSmall} ${t.red().italic(c)}`,"")),this.out.write(r.line+i.to(0)+this.outputText+i.save+this.outputError+i.restore+i.move(this.cursorOffset,0)));}}return Fo=u,Fo}var Eo,jd;function By(){if(jd)return Eo;jd=1;let t=He(),e=Et(),{style:r,clear:i,figures:s,wrap:n,entriesToDisplay:o}=Qe(),{cursor:a}=qe();class u extends e{constructor(l={}){super(l),this.msg=l.message,this.hint=l.hint||"- Use arrow-keys. Return to submit.",this.warn=l.warn||"- This option is disabled",this.cursor=l.initial||0,this.choices=l.choices.map((c,d)=>(typeof c=="string"&&(c={title:c,value:d}),{title:c&&(c.title||c.value||c),value:c&&(c.value===void 0?d:c.value),description:c&&c.description,selected:c&&c.selected,disabled:c&&c.disabled})),this.optionsPerPage=l.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=i("",this.out.columns),this.render();}moveCursor(l){this.cursor=l,this.value=this.choices[l].value,this.fire();}reset(){this.moveCursor(0),this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
892
- `),this.close();}submit(){this.selection.disabled?this.bell():(this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
893
- `),this.close());}first(){this.moveCursor(0),this.render();}last(){this.moveCursor(this.choices.length-1),this.render();}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render();}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render();}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render();}_(l,c){if(l===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(a.hide):this.out.write(i(this.outputText,this.out.columns)),super.render();let{startIndex:l,endIndex:c}=o(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[r.symbol(this.done,this.aborted),t.bold(this.msg),r.delimiter(false),this.done?this.selection.title:this.selection.disabled?t.yellow(this.warn):t.gray(this.hint)].join(" "),!this.done){this.outputText+=`
894
- `;for(let d=l;d<c;d++){let f,m,g="",D=this.choices[d];d===l&&l>0?m=s.arrowUp:d===c-1&&c<this.choices.length?m=s.arrowDown:m=" ",D.disabled?(f=this.cursor===d?t.gray().underline(D.title):t.strikethrough().gray(D.title),m=(this.cursor===d?t.bold().gray(s.pointer)+" ":" ")+m):(f=this.cursor===d?t.cyan().underline(D.title):D.title,m=(this.cursor===d?t.cyan(s.pointer)+" ":" ")+m,D.description&&this.cursor===d&&(g=` - ${D.description}`,(m.length+f.length+g.length>=this.out.columns||D.description.split(/\r?\n/).length>1)&&(g=`
895
- `+n(D.description,{margin:3,width:this.out.columns})))),this.outputText+=`${m} ${f}${t.gray(g)}
896
- `;}}this.out.write(this.outputText);}}return Eo=u,Eo}var Ao,Gd;function Ny(){if(Gd)return Ao;Gd=1;let t=He(),e=Et(),{style:r,clear:i}=Qe(),{cursor:s,erase:n}=qe();class o extends e{constructor(u={}){super(u),this.msg=u.message,this.value=!!u.initial,this.active=u.active||"on",this.inactive=u.inactive||"off",this.initialValue=this.value,this.render();}reset(){this.value=this.initialValue,this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
897
- `),this.close();}submit(){this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
898
- `),this.close();}deactivate(){if(this.value===false)return this.bell();this.value=false,this.render();}activate(){if(this.value===true)return this.bell();this.value=true,this.render();}delete(){this.deactivate();}left(){this.deactivate();}right(){this.activate();}down(){this.deactivate();}up(){this.activate();}next(){this.value=!this.value,this.fire(),this.render();}_(u,h){if(u===" ")this.value=!this.value;else if(u==="1")this.value=true;else if(u==="0")this.value=false;else return this.bell();this.render();}render(){this.closed||(this.firstRender?this.out.write(s.hide):this.out.write(i(this.outputText,this.out.columns)),super.render(),this.outputText=[r.symbol(this.done,this.aborted),t.bold(this.msg),r.delimiter(this.done),this.value?this.inactive:t.cyan().underline(this.inactive),t.gray("/"),this.value?t.cyan().underline(this.active):this.active].join(" "),this.out.write(n.line+s.to(0)+this.outputText));}}return Ao=o,Ao}var $o,Vd;function pt(){if(Vd)return $o;Vd=1;class t{constructor({token:r,date:i,parts:s,locales:n}){this.token=r,this.date=i||new Date,this.parts=s||[this],this.locales=n||{};}up(){}down(){}next(){let r=this.parts.indexOf(this);return this.parts.find((i,s)=>s>r&&i instanceof t)}setTo(r){}prev(){let r=[].concat(this.parts).reverse(),i=r.indexOf(this);return r.find((s,n)=>n>i&&s instanceof t)}toString(){return String(this.date)}}return $o=t,$o}var Oo,Wd;function Hy(){if(Wd)return Oo;Wd=1;let t=pt();class e extends t{constructor(i={}){super(i);}up(){this.date.setHours((this.date.getHours()+12)%24);}down(){this.up();}toString(){let i=this.date.getHours()>12?"pm":"am";return /\A/.test(this.token)?i.toUpperCase():i}}return Oo=e,Oo}var So,Ud;function qy(){if(Ud)return So;Ud=1;let t=pt(),e=i=>(i=i%10,i===1?"st":i===2?"nd":i===3?"rd":"th");class r extends t{constructor(s={}){super(s);}up(){this.date.setDate(this.date.getDate()+1);}down(){this.date.setDate(this.date.getDate()-1);}setTo(s){this.date.setDate(parseInt(s.substr(-2)));}toString(){let s=this.date.getDate(),n=this.date.getDay();return this.token==="DD"?String(s).padStart(2,"0"):this.token==="Do"?s+e(s):this.token==="d"?n+1:this.token==="ddd"?this.locales.weekdaysShort[n]:this.token==="dddd"?this.locales.weekdays[n]:s}}return So=r,So}var Ro,Kd;function Ly(){if(Kd)return Ro;Kd=1;let t=pt();class e extends t{constructor(i={}){super(i);}up(){this.date.setHours(this.date.getHours()+1);}down(){this.date.setHours(this.date.getHours()-1);}setTo(i){this.date.setHours(parseInt(i.substr(-2)));}toString(){let i=this.date.getHours();return /h/.test(this.token)&&(i=i%12||12),this.token.length>1?String(i).padStart(2,"0"):i}}return Ro=e,Ro}var To,Yd;function jy(){if(Yd)return To;Yd=1;let t=pt();class e extends t{constructor(i={}){super(i);}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1);}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1);}setTo(i){this.date.setMilliseconds(parseInt(i.substr(-this.token.length)));}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}return To=e,To}var Po,Jd;function Gy(){if(Jd)return Po;Jd=1;let t=pt();class e extends t{constructor(i={}){super(i);}up(){this.date.setMinutes(this.date.getMinutes()+1);}down(){this.date.setMinutes(this.date.getMinutes()-1);}setTo(i){this.date.setMinutes(parseInt(i.substr(-2)));}toString(){let i=this.date.getMinutes();return this.token.length>1?String(i).padStart(2,"0"):i}}return Po=e,Po}var ko,zd;function Vy(){if(zd)return ko;zd=1;let t=pt();class e extends t{constructor(i={}){super(i);}up(){this.date.setMonth(this.date.getMonth()+1);}down(){this.date.setMonth(this.date.getMonth()-1);}setTo(i){i=parseInt(i.substr(-2))-1,this.date.setMonth(i<0?0:i);}toString(){let i=this.date.getMonth(),s=this.token.length;return s===2?String(i+1).padStart(2,"0"):s===3?this.locales.monthsShort[i]:s===4?this.locales.months[i]:String(i+1)}}return ko=e,ko}var Io,Xd;function Wy(){if(Xd)return Io;Xd=1;let t=pt();class e extends t{constructor(i={}){super(i);}up(){this.date.setSeconds(this.date.getSeconds()+1);}down(){this.date.setSeconds(this.date.getSeconds()-1);}setTo(i){this.date.setSeconds(parseInt(i.substr(-2)));}toString(){let i=this.date.getSeconds();return this.token.length>1?String(i).padStart(2,"0"):i}}return Io=e,Io}var Mo,Zd;function Uy(){if(Zd)return Mo;Zd=1;let t=pt();class e extends t{constructor(i={}){super(i);}up(){this.date.setFullYear(this.date.getFullYear()+1);}down(){this.date.setFullYear(this.date.getFullYear()-1);}setTo(i){this.date.setFullYear(i.substr(-4));}toString(){let i=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?i.substr(-2):i}}return Mo=e,Mo}var Bo,Qd;function Ky(){return Qd||(Qd=1,Bo={DatePart:pt(),Meridiem:Hy(),Day:qy(),Hours:Ly(),Milliseconds:jy(),Minutes:Gy(),Month:Vy(),Seconds:Wy(),Year:Uy()}),Bo}var No,ef;function Yy(){if(ef)return No;ef=1;let t=He(),e=Et(),{style:r,clear:i,figures:s}=Qe(),{erase:n,cursor:o}=qe(),{DatePart:a,Meridiem:u,Day:h,Hours:l,Milliseconds:c,Minutes:d,Month:f,Seconds:m,Year:g}=Ky(),D=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,x={1:({token:C})=>C.replace(/\\(.)/g,"$1"),2:C=>new h(C),3:C=>new f(C),4:C=>new g(C),5:C=>new u(C),6:C=>new l(C),7:C=>new d(C),8:C=>new m(C),9:C=>new c(C)},b={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class v extends e{constructor(E={}){super(E),this.msg=E.message,this.cursor=0,this.typed="",this.locales=Object.assign(b,E.locales),this._date=E.initial||new Date,this.errorMsg=E.error||"Please Enter A Valid Value",this.validator=E.validate||(()=>true),this.mask=E.mask||"YYYY-MM-DD HH:mm:ss",this.clear=i("",this.out.columns),this.render();}get value(){return this.date}get date(){return this._date}set date(E){E&&this._date.setTime(E.getTime());}set mask(E){let O;for(this.parts=[];O=D.exec(E);){let A=O.shift(),R=O.findIndex(U=>U!=null);this.parts.push(R in x?x[R]({token:O[R]||A,date:this.date,parts:this.parts,locales:this.locales}):O[R]||A);}let P=this.parts.reduce((A,R)=>(typeof R=="string"&&typeof A[A.length-1]=="string"?A[A.length-1]+=R:A.push(R),A),[]);this.parts.splice(0),this.parts.push(...P),this.reset();}moveCursor(E){this.typed="",this.cursor=E,this.fire();}reset(){this.moveCursor(this.parts.findIndex(E=>E instanceof a)),this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.error=false,this.fire(),this.render(),this.out.write(`
899
- `),this.close();}async validate(){let E=await this.validator(this.value);typeof E=="string"&&(this.errorMsg=E,E=false),this.error=!E;}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
900
- `),this.close();}up(){this.typed="",this.parts[this.cursor].up(),this.render();}down(){this.typed="",this.parts[this.cursor].down(),this.render();}left(){let E=this.parts[this.cursor].prev();if(E==null)return this.bell();this.moveCursor(this.parts.indexOf(E)),this.render();}right(){let E=this.parts[this.cursor].next();if(E==null)return this.bell();this.moveCursor(this.parts.indexOf(E)),this.render();}next(){let E=this.parts[this.cursor].next();this.moveCursor(E?this.parts.indexOf(E):this.parts.findIndex(O=>O instanceof a)),this.render();}_(E){/\d/.test(E)&&(this.typed+=E,this.parts[this.cursor].setTo(this.typed),this.render());}render(){this.closed||(this.firstRender?this.out.write(o.hide):this.out.write(i(this.outputText,this.out.columns)),super.render(),this.outputText=[r.symbol(this.done,this.aborted),t.bold(this.msg),r.delimiter(false),this.parts.reduce((E,O,P)=>E.concat(P===this.cursor&&!this.done?t.cyan().underline(O.toString()):O),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
901
- `).reduce((E,O,P)=>E+`
902
- ${P?" ":s.pointerSmall} ${t.red().italic(O)}`,"")),this.out.write(n.line+o.to(0)+this.outputText));}}return No=v,No}var Ho,tf;function Jy(){if(tf)return Ho;tf=1;let t=He(),e=Et(),{cursor:r,erase:i}=qe(),{style:s,figures:n,clear:o,lines:a}=Qe(),u=/[0-9]/,h=d=>d!==void 0,l=(d,f)=>{let m=Math.pow(10,f);return Math.round(d*m)/m};class c extends e{constructor(f={}){super(f),this.transform=s.render(f.style),this.msg=f.message,this.initial=h(f.initial)?f.initial:"",this.float=!!f.float,this.round=f.round||2,this.inc=f.increment||1,this.min=h(f.min)?f.min:-1/0,this.max=h(f.max)?f.max:1/0,this.errorMsg=f.error||"Please Enter A Valid Value",this.validator=f.validate||(()=>true),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render();}set value(f){!f&&f!==0?(this.placeholder=true,this.rendered=t.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=false,this.rendered=this.transform.render(`${l(f,this.round)}`),this._value=l(f,this.round)),this.fire();}get value(){return this._value}parse(f){return this.float?parseFloat(f):parseInt(f)}valid(f){return f==="-"||f==="."&&this.float||u.test(f)}reset(){this.typed="",this.value="",this.fire(),this.render();}exit(){this.abort();}abort(){let f=this.value;this.value=f!==""?f:this.initial,this.done=this.aborted=true,this.error=false,this.fire(),this.render(),this.out.write(`
903
- `),this.close();}async validate(){let f=await this.validator(this.value);typeof f=="string"&&(this.errorMsg=f,f=false),this.error=!f;}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let f=this.value;this.value=f!==""?f:this.initial,this.done=true,this.aborted=false,this.error=false,this.fire(),this.render(),this.out.write(`
904
- `),this.close();}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render();}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render();}delete(){let f=this.value.toString();if(f.length===0)return this.bell();this.value=this.parse(f=f.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render();}next(){this.value=this.initial,this.fire(),this.render();}_(f,m){if(!this.valid(f))return this.bell();let g=Date.now();if(g-this.lastHit>1e3&&(this.typed=""),this.typed+=f,this.lastHit=g,this.color="cyan",f===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render();}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(r.down(a(this.outputError,this.out.columns)-1)+o(this.outputError,this.out.columns)),this.out.write(o(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[s.symbol(this.done,this.aborted),t.bold(this.msg),s.delimiter(this.done),!this.done||!this.done&&!this.placeholder?t[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
905
- `).reduce((f,m,g)=>f+`
906
- ${g?" ":n.pointerSmall} ${t.red().italic(m)}`,"")),this.out.write(i.line+r.to(0)+this.outputText+r.save+this.outputError+r.restore));}}return Ho=c,Ho}var qo,rf;function Af(){if(rf)return qo;rf=1;let t=He(),{cursor:e}=qe(),r=Et(),{clear:i,figures:s,style:n,wrap:o,entriesToDisplay:a}=Qe();class u extends r{constructor(l={}){super(l),this.msg=l.message,this.cursor=l.cursor||0,this.scrollIndex=l.cursor||0,this.hint=l.hint||"",this.warn=l.warn||"- This option is disabled -",this.minSelected=l.min,this.showMinError=false,this.maxChoices=l.max,this.instructions=l.instructions,this.optionsPerPage=l.optionsPerPage||10,this.value=l.choices.map((c,d)=>(typeof c=="string"&&(c={title:c,value:d}),{title:c&&(c.title||c.value||c),description:c&&c.description,value:c&&(c.value===void 0?d:c.value),selected:c&&c.selected,disabled:c&&c.disabled})),this.clear=i("",this.out.columns),l.overrideRender||this.render();}reset(){this.value.map(l=>!l.selected),this.cursor=0,this.fire(),this.render();}selected(){return this.value.filter(l=>l.selected)}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
907
- `),this.close();}submit(){let l=this.value.filter(c=>c.selected);this.minSelected&&l.length<this.minSelected?(this.showMinError=true,this.render()):(this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
908
- `),this.close());}first(){this.cursor=0,this.render();}last(){this.cursor=this.value.length-1,this.render();}next(){this.cursor=(this.cursor+1)%this.value.length,this.render();}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render();}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render();}left(){this.value[this.cursor].selected=false,this.render();}right(){if(this.value.filter(l=>l.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=true,this.render();}handleSpaceToggle(){let l=this.value[this.cursor];if(l.selected)l.selected=false,this.render();else {if(l.disabled||this.value.filter(c=>c.selected).length>=this.maxChoices)return this.bell();l.selected=true,this.render();}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let l=!this.value[this.cursor].selected;this.value.filter(c=>!c.disabled).forEach(c=>c.selected=l),this.render();}_(l,c){if(l===" ")this.handleSpaceToggle();else if(l==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
909
- Instructions:
910
- ${s.arrowUp}/${s.arrowDown}: Highlight option
911
- ${s.arrowLeft}/${s.arrowRight}/[space]: Toggle selection
912
- `+(this.maxChoices===void 0?` a: Toggle all
913
- `:"")+" enter/return: Complete answer":""}renderOption(l,c,d,f){let m=(c.selected?t.green(s.radioOn):s.radioOff)+" "+f+" ",g,D;return c.disabled?g=l===d?t.gray().underline(c.title):t.strikethrough().gray(c.title):(g=l===d?t.cyan().underline(c.title):c.title,l===d&&c.description&&(D=` - ${c.description}`,(m.length+g.length+D.length>=this.out.columns||c.description.split(/\r?\n/).length>1)&&(D=`
914
- `+o(c.description,{margin:m.length,width:this.out.columns})))),m+g+t.gray(D||"")}paginateOptions(l){if(l.length===0)return t.red("No matches for this query.");let{startIndex:c,endIndex:d}=a(this.cursor,l.length,this.optionsPerPage),f,m=[];for(let g=c;g<d;g++)g===c&&c>0?f=s.arrowUp:g===d-1&&d<l.length?f=s.arrowDown:f=" ",m.push(this.renderOption(this.cursor,l[g],g,f));return `
915
- `+m.join(`
916
- `)}renderOptions(l){return this.done?"":this.paginateOptions(l)}renderDoneOrInstructions(){if(this.done)return this.value.filter(c=>c.selected).map(c=>c.title).join(", ");let l=[t.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&l.push(t.yellow(this.warn)),l.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(e.hide),super.render();let l=[n.symbol(this.done,this.aborted),t.bold(this.msg),n.delimiter(false),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(l+=t.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=false),l+=this.renderOptions(this.value),this.out.write(this.clear+l),this.clear=i(l,this.out.columns);}}return qo=u,qo}var Lo,sf;function zy(){if(sf)return Lo;sf=1;let t=He(),e=Et(),{erase:r,cursor:i}=qe(),{style:s,clear:n,figures:o,wrap:a,entriesToDisplay:u}=Qe(),h=(f,m)=>f[m]&&(f[m].value||f[m].title||f[m]),l=(f,m)=>f[m]&&(f[m].title||f[m].value||f[m]),c=(f,m)=>{let g=f.findIndex(D=>D.value===m||D.title===m);return g>-1?g:void 0};class d extends e{constructor(m={}){super(m),this.msg=m.message,this.suggest=m.suggest,this.choices=m.choices,this.initial=typeof m.initial=="number"?m.initial:c(m.choices,m.initial),this.select=this.initial||m.cursor||0,this.i18n={noMatches:m.noMatches||"no matches found"},this.fallback=m.fallback||this.initial,this.clearFirst=m.clearFirst||false,this.suggestions=[],this.input="",this.limit=m.limit||10,this.cursor=0,this.transform=s.render(m.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=n("",this.out.columns),this.complete(this.render),this.render();}set fallback(m){this._fb=Number.isSafeInteger(parseInt(m))?parseInt(m):m;}get fallback(){let m;return typeof this._fb=="number"?m=this.choices[this._fb]:typeof this._fb=="string"&&(m={title:this._fb}),m||this._fb||{title:this.i18n.noMatches}}moveSelect(m){this.select=m,this.suggestions.length>0?this.value=h(this.suggestions,m):this.value=this.fallback.value,this.fire();}async complete(m){let g=this.completing=this.suggest(this.input,this.choices),D=await g;if(this.completing!==g)return;this.suggestions=D.map((b,v,C)=>({title:l(C,v),value:h(C,v),description:b.description})),this.completing=false;let x=Math.max(D.length-1,0);this.moveSelect(Math.min(x,this.select)),m&&m();}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render();}),this.render();}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
917
- `),this.close());}abort(){this.done=this.aborted=true,this.exited=false,this.fire(),this.render(),this.out.write(`
918
- `),this.close();}submit(){this.done=true,this.aborted=this.exited=false,this.fire(),this.render(),this.out.write(`
919
- `),this.close();}_(m,g){let D=this.input.slice(0,this.cursor),x=this.input.slice(this.cursor);this.input=`${D}${m}${x}`,this.cursor=D.length+1,this.complete(this.render),this.render();}delete(){if(this.cursor===0)return this.bell();let m=this.input.slice(0,this.cursor-1),g=this.input.slice(this.cursor);this.input=`${m}${g}`,this.complete(this.render),this.cursor=this.cursor-1,this.render();}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let m=this.input.slice(0,this.cursor),g=this.input.slice(this.cursor+1);this.input=`${m}${g}`,this.complete(this.render),this.render();}first(){this.moveSelect(0),this.render();}last(){this.moveSelect(this.suggestions.length-1),this.render();}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render();}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render();}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render();}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render();}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render();}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render();}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render();}renderOption(m,g,D,x){let b,v=D?o.arrowUp:x?o.arrowDown:" ",C=g?t.cyan().underline(m.title):m.title;return v=(g?t.cyan(o.pointer)+" ":" ")+v,m.description&&(b=` - ${m.description}`,(v.length+C.length+b.length>=this.out.columns||m.description.split(/\r?\n/).length>1)&&(b=`
920
- `+a(m.description,{margin:3,width:this.out.columns}))),v+" "+C+t.gray(b||"")}render(){if(this.closed)return;this.firstRender?this.out.write(i.hide):this.out.write(n(this.outputText,this.out.columns)),super.render();let{startIndex:m,endIndex:g}=u(this.select,this.choices.length,this.limit);if(this.outputText=[s.symbol(this.done,this.aborted,this.exited),t.bold(this.msg),s.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let D=this.suggestions.slice(m,g).map((x,b)=>this.renderOption(x,this.select===b+m,b===0&&m>0,b+m===g-1&&g<this.choices.length)).join(`
921
- `);this.outputText+=`
922
- `+(D||t.gray(this.fallback.title));}this.out.write(r.line+i.to(0)+this.outputText);}}return Lo=d,Lo}var jo,nf;function Xy(){if(nf)return jo;nf=1;let t=He(),{cursor:e}=qe(),r=Af(),{clear:i,style:s,figures:n}=Qe();class o extends r{constructor(u={}){u.overrideRender=true,super(u),this.inputValue="",this.clear=i("",this.out.columns),this.filteredOptions=this.value,this.render();}last(){this.cursor=this.filteredOptions.length-1,this.render();}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render();}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render();}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render();}left(){this.filteredOptions[this.cursor].selected=false,this.render();}right(){if(this.value.filter(u=>u.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=true,this.render();}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions());}updateFilteredOptions(){let u=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(l=>this.inputValue?!!(typeof l.title=="string"&&l.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof l.value=="string"&&l.value.toLowerCase().includes(this.inputValue.toLowerCase())):true);let h=this.filteredOptions.findIndex(l=>l===u);this.cursor=h<0?0:h,this.render();}handleSpaceToggle(){let u=this.filteredOptions[this.cursor];if(u.selected)u.selected=false,this.render();else {if(u.disabled||this.value.filter(h=>h.selected).length>=this.maxChoices)return this.bell();u.selected=true,this.render();}}handleInputChange(u){this.inputValue=this.inputValue+u,this.updateFilteredOptions();}_(u,h){u===" "?this.handleSpaceToggle():this.handleInputChange(u);}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
923
- Instructions:
924
- ${n.arrowUp}/${n.arrowDown}: Highlight option
925
- ${n.arrowLeft}/${n.arrowRight}/[space]: Toggle selection
926
- [a,b,c]/delete: Filter choices
927
- enter/return: Complete answer
928
- `:""}renderCurrentInput(){return `
929
- Filtered results for: ${this.inputValue?this.inputValue:t.gray("Enter something to filter")}
930
- `}renderOption(u,h,l,c){let d=(h.selected?t.green(n.radioOn):n.radioOff)+" "+c+" ",f;return h.disabled?f=u===l?t.gray().underline(h.title):t.strikethrough().gray(h.title):f=u===l?t.cyan().underline(h.title):h.title,d+f}renderDoneOrInstructions(){if(this.done)return this.value.filter(h=>h.selected).map(h=>h.title).join(", ");let u=[t.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&u.push(t.yellow(this.warn)),u.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(e.hide),super.render();let u=[s.symbol(this.done,this.aborted),t.bold(this.msg),s.delimiter(false),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(u+=t.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=false),u+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+u),this.clear=i(u,this.out.columns);}}return jo=o,jo}var Go,of;function Zy(){if(of)return Go;of=1;let t=He(),e=Et(),{style:r,clear:i}=Qe(),{erase:s,cursor:n}=qe();class o extends e{constructor(u={}){super(u),this.msg=u.message,this.value=u.initial,this.initialValue=!!u.initial,this.yesMsg=u.yes||"yes",this.yesOption=u.yesOption||"(Y/n)",this.noMsg=u.no||"no",this.noOption=u.noOption||"(y/N)",this.render();}reset(){this.value=this.initialValue,this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
931
- `),this.close();}submit(){this.value=this.value||false,this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
932
- `),this.close();}_(u,h){return u.toLowerCase()==="y"?(this.value=true,this.submit()):u.toLowerCase()==="n"?(this.value=false,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(n.hide):this.out.write(i(this.outputText,this.out.columns)),super.render(),this.outputText=[r.symbol(this.done,this.aborted),t.bold(this.msg),r.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:t.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(s.line+n.to(0)+this.outputText));}}return Go=o,Go}var Vo,af;function Qy(){return af||(af=1,Vo={TextPrompt:My(),SelectPrompt:By(),TogglePrompt:Ny(),DatePrompt:Yy(),NumberPrompt:Jy(),MultiselectPrompt:Af(),AutocompletePrompt:zy(),AutocompleteMultiselectPrompt:Xy(),ConfirmPrompt:Zy()}),Vo}var uf;function eC(){return uf||(uf=1,function(t){let e=t,r=Qy(),i=o=>o;function s(o,a,u={}){return new Promise((h,l)=>{let c=new r[o](a),d=u.onAbort||i,f=u.onSubmit||i,m=u.onExit||i;c.on("state",a.onState||i),c.on("submit",g=>h(f(g))),c.on("exit",g=>h(m(g))),c.on("abort",g=>l(d(g)));})}e.text=o=>s("TextPrompt",o),e.password=o=>(o.style="password",e.text(o)),e.invisible=o=>(o.style="invisible",e.text(o)),e.number=o=>s("NumberPrompt",o),e.date=o=>s("DatePrompt",o),e.confirm=o=>s("ConfirmPrompt",o),e.list=o=>{let a=o.separator||",";return s("TextPrompt",o,{onSubmit:u=>u.split(a).map(h=>h.trim())})},e.toggle=o=>s("TogglePrompt",o),e.select=o=>s("SelectPrompt",o),e.multiselect=o=>{o.choices=[].concat(o.choices||[]);let a=u=>u.filter(h=>h.selected).map(h=>h.value);return s("MultiselectPrompt",o,{onAbort:a,onSubmit:a})},e.autocompleteMultiselect=o=>{o.choices=[].concat(o.choices||[]);let a=u=>u.filter(h=>h.selected).map(h=>h.value);return s("AutocompleteMultiselectPrompt",o,{onAbort:a,onSubmit:a})};let n=(o,a)=>Promise.resolve(a.filter(u=>u.title.slice(0,o.length).toLowerCase()===o.toLowerCase()));e.autocomplete=o=>(o.suggest=o.suggest||n,o.choices=[].concat(o.choices||[]),s("AutocompletePrompt",o));}(ho)),ho}var Wo,lf;function tC(){if(lf)return Wo;lf=1;let t=eC(),e=["suggest","format","onState","validate","onRender","type"],r=()=>{};async function i(a=[],{onSubmit:u=r,onCancel:h=r}={}){let l={},c=i._override||{};a=[].concat(a);let d,f,m,g,D,x,b=async(v,C,E=false)=>{if(!(!E&&v.validate&&v.validate(C)!==true))return v.format?await v.format(C,l):C};for(f of a)if({name:g,type:D}=f,typeof D=="function"&&(D=await D(d,{...l},f),f.type=D),!!D){for(let v in f){if(e.includes(v))continue;let C=f[v];f[v]=typeof C=="function"?await C(d,{...l},x):C;}if(x=f,typeof f.message!="string")throw new Error("prompt message is required");if({name:g,type:D}=f,t[D]===void 0)throw new Error(`prompt type (${D}) is not defined`);if(c[f.name]!==void 0&&(d=await b(f,c[f.name]),d!==void 0)){l[g]=d;continue}try{d=i._injected?s(i._injected,f.initial):await t[D](f),l[g]=d=await b(f,d,!0),m=await u(f,d,l);}catch{m=!await h(f,l);}if(m)return l}return l}function s(a,u){let h=a.shift();if(h instanceof Error)throw h;return h===void 0?u:h}function n(a){i._injected=(i._injected||[]).concat(a);}function o(a){i._override=Object.assign({},a);}return Wo=Object.assign(i,{prompt:i,prompts:t,inject:n,override:o}),Wo}var Uo,cf;function rC(){return cf||(cf=1,Uo=tC()),Uo}var iC=rC(),sC=Qo(iC);var Sf=["npm","yarn","yarn@berry","pnpm","pnpm@6","bun","deno"],Zo={"bun.lock":"bun","bun.lockb":"bun","deno.lock":"deno","pnpm-lock.yaml":"pnpm","yarn.lock":"yarn","package-lock.json":"npm","npm-shrinkwrap.json":"npm"},Rf={bun:"https://bun.sh",deno:"https://deno.com",pnpm:"https://pnpm.io/installation","pnpm@6":"https://pnpm.io/6.x/installation",yarn:"https://classic.yarnpkg.com/en/docs/install","yarn@berry":"https://yarnpkg.com/getting-started/install",npm:"https://docs.npmjs.com/cli/v8/configuring-npm/install"};async function hC(t={}){let{cwd:e,onUnknown:r}=t;for(let i of dC(e)){for(let n of Object.keys(Zo))if(await Tf(kt__default.default.join(i,n))){let o=Zo[n],a=await df(kt__default.default.join(i,"package.json"),r);return a||{name:o,agent:o}}let s=await df(kt__default.default.join(i,"package.json"),r);if(s)return s}return null}function*dC(t=Ve__default.default.cwd()){let e=kt__default.default.resolve(t),{root:r}=kt__default.default.parse(e);for(;e&&e!==r;)yield e,e=kt__default.default.dirname(e);}async function df(t,e){return !t||!await Tf(t)?null:fC(t,e)}function fC(t,e){try{let r=JSON.parse(xf__default.default.readFileSync(t,"utf8")),i;if(typeof r.packageManager=="string"){let[s,n]=r.packageManager.replace(/^\^/,"").split("@"),o=n;return s==="yarn"&&Number.parseInt(n)>1?(i="yarn@berry",o="berry",{name:s,agent:i,version:o}):s==="pnpm"&&Number.parseInt(n)<7?(i="pnpm@6",{name:s,agent:i,version:o}):Sf.includes(s)?(i=s,{name:s,agent:i,version:o}):e?.(r.packageManager)??null}}catch{}return null}async function Tf(t){try{if((await Ff__default.default.stat(t)).isFile())return !0}catch{}return false}var Y="\x1B[",Pr="\x1B]",nr="\x07",Ai=";",Pf=process.env.TERM_PROGRAM==="Apple_Terminal",j={};j.cursorTo=(t,e)=>{if(typeof t!="number")throw new TypeError("The `x` argument is required");return typeof e!="number"?Y+(t+1)+"G":Y+(e+1)+";"+(t+1)+"H"};j.cursorMove=(t,e)=>{if(typeof t!="number")throw new TypeError("The `x` argument is required");let r="";return t<0?r+=Y+-t+"D":t>0&&(r+=Y+t+"C"),e<0?r+=Y+-e+"A":e>0&&(r+=Y+e+"B"),r};j.cursorUp=(t=1)=>Y+t+"A";j.cursorDown=(t=1)=>Y+t+"B";j.cursorForward=(t=1)=>Y+t+"C";j.cursorBackward=(t=1)=>Y+t+"D";j.cursorLeft=Y+"G";j.cursorSavePosition=Pf?"\x1B7":Y+"s";j.cursorRestorePosition=Pf?"\x1B8":Y+"u";j.cursorGetPosition=Y+"6n";j.cursorNextLine=Y+"E";j.cursorPrevLine=Y+"F";j.cursorHide=Y+"?25l";j.cursorShow=Y+"?25h";j.eraseLines=t=>{let e="";for(let r=0;r<t;r++)e+=j.eraseLine+(r<t-1?j.cursorUp():"");return t&&(e+=j.cursorLeft),e};j.eraseEndLine=Y+"K";j.eraseStartLine=Y+"1K";j.eraseLine=Y+"2K";j.eraseDown=Y+"J";j.eraseUp=Y+"1J";j.eraseScreen=Y+"2J";j.scrollUp=Y+"S";j.scrollDown=Y+"T";j.clearScreen="\x1Bc";j.clearTerminal=process.platform==="win32"?`${j.eraseScreen}${Y}0f`:`${j.eraseScreen}${Y}3J${Y}H`;j.beep=nr;j.link=(t,e)=>[Pr,"8",Ai,Ai,e,nr,t,Pr,"8",Ai,Ai,nr].join("");j.image=(t,e={})=>{let r=`${Pr}1337;File=inline=1`;return e.width&&(r+=`;width=${e.width}`),e.height&&(r+=`;height=${e.height}`),e.preserveAspectRatio===false&&(r+=";preserveAspectRatio=0"),r+":"+t.toString("base64")+nr};j.iTerm={setCwd:(t=process.cwd())=>`${Pr}50;CurrentDir=${t}${nr}`,annotation:(t,e={})=>{let r=`${Pr}1337;`,i=typeof e.x<"u",s=typeof e.y<"u";if((i||s)&&!(i&&s&&typeof e.length<"u"))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return t=t.replace(/\|/g,""),r+=e.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",e.length>0?r+=(i?[t,e.length,e.x,e.y]:[e.length,t]).join("|"):r+=t,r+nr}};var Ko,ff;function kf(){return ff||(ff=1,Ko=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",i=e.indexOf(r+t),s=e.indexOf("--");return i!==-1&&(s===-1||i<s)}),Ko}var Yo,pf;function pC(){if(pf)return Yo;pf=1;let t=Fy__default.default,e=Vf__default.default,r=kf(),{env:i}=process,s;r("no-color")||r("no-colors")||r("color=false")||r("color=never")?s=0:(r("color")||r("colors")||r("color=true")||r("color=always"))&&(s=1),"FORCE_COLOR"in i&&(i.FORCE_COLOR==="true"?s=1:i.FORCE_COLOR==="false"?s=0:s=i.FORCE_COLOR.length===0?1:Math.min(parseInt(i.FORCE_COLOR,10),3));function n(u){return u===0?false:{level:u,hasBasic:true,has256:u>=2,has16m:u>=3}}function o(u,h){if(s===0)return 0;if(r("color=16m")||r("color=full")||r("color=truecolor"))return 3;if(r("color=256"))return 2;if(u&&!h&&s===void 0)return 0;let l=s||0;if(i.TERM==="dumb")return l;if(process.platform==="win32"){let c=t.release().split(".");return Number(c[0])>=10&&Number(c[2])>=10586?Number(c[2])>=14931?3:2:1}if("CI"in i)return ["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(c=>c in i)||i.CI_NAME==="codeship"?1:l;if("TEAMCITY_VERSION"in i)return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(i.TEAMCITY_VERSION)?1:0;if(i.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in i){let c=parseInt((i.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(i.TERM_PROGRAM){case "iTerm.app":return c>=3?3:2;case "Apple_Terminal":return 2}}return /-256(color)?$/i.test(i.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(i.TERM)||"COLORTERM"in i?1:l}function a(u){let h=o(u,u&&u.isTTY);return n(h)}return Yo={supportsColor:a,stdout:n(o(true,e.isatty(1))),stderr:n(o(true,e.isatty(2)))},Yo}var Jo,mf;function mC(){if(mf)return Jo;mf=1;let t=pC(),e=kf();function r(s){if(/^\d{3,4}$/.test(s)){let o=/(\d{1,2})(\d{2})/.exec(s);return {major:0,minor:parseInt(o[1],10),patch:parseInt(o[2],10)}}let n=(s||"").split(".").map(o=>parseInt(o,10));return {major:n[0],minor:n[1],patch:n[2]}}function i(s){let{env:n}=process;if("FORCE_HYPERLINK"in n)return !(n.FORCE_HYPERLINK.length>0&&parseInt(n.FORCE_HYPERLINK,10)===0);if(e("no-hyperlink")||e("no-hyperlinks")||e("hyperlink=false")||e("hyperlink=never"))return false;if(e("hyperlink=true")||e("hyperlink=always"))return true;if(!t.supportsColor(s)||s&&!s.isTTY||process.platform==="win32")return false;if("NETLIFY"in n)return true;if("CI"in n||"TEAMCITY_VERSION"in n)return false;if("TERM_PROGRAM"in n){let o=r(n.TERM_PROGRAM_VERSION);switch(n.TERM_PROGRAM){case "iTerm.app":return o.major===3?o.minor>=1:o.major>3}}if("VTE_VERSION"in n){if(n.VTE_VERSION==="0.50.0")return false;let o=r(n.VTE_VERSION);return o.major>0||o.minor>=50}return false}return Jo={supportsHyperlink:i,stdout:i(process.stdout),stderr:i(process.stderr)},Jo}var gC=mC(),ta=Qo(gC);function kr(t,e,{target:r="stdout",...i}={}){return ta[r]?j.link(t,e):i.fallback===false?t:typeof i.fallback=="function"?i.fallback(t,e):`${t} (\u200B${e}\u200B)`}kr.isSupported=ta.stdout;kr.stderr=(t,e,r={})=>kr(t,e,{target:"stderr",...r});kr.stderr.isSupported=ta.stderr;var sr=module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.cjs', document.baseURI).href))),DC=Object.create,If=Object.defineProperty,bC=Object.getOwnPropertyDescriptor,vC=Object.getOwnPropertyNames,yC=Object.getPrototypeOf,CC=Object.prototype.hasOwnProperty,At=(t=>typeof sr<"u"?sr:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof sr<"u"?sr:e)[r]}):t)(function(t){if(typeof sr<"u")return sr.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')}),Ae=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),_C=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of vC(e))!CC.call(t,s)&&s!==r&&If(t,s,{get:()=>e[s],enumerable:!(i=bC(e,s))||i.enumerable});return t},wC=(t,e,r)=>(r=t!=null?DC(yC(t)):{},_C(If(r,"default",{value:t,enumerable:true}),t)),xC=Ae((t,e)=>{e.exports=n,n.sync=o;var r=At("fs");function i(a,u){var h=u.pathExt!==void 0?u.pathExt:process.env.PATHEXT;if(!h||(h=h.split(";"),h.indexOf("")!==-1))return true;for(var l=0;l<h.length;l++){var c=h[l].toLowerCase();if(c&&a.substr(-c.length).toLowerCase()===c)return true}return false}function s(a,u,h){return !a.isSymbolicLink()&&!a.isFile()?false:i(u,h)}function n(a,u,h){r.stat(a,function(l,c){h(l,l?false:s(c,a,u));});}function o(a,u){return s(r.statSync(a),a,u)}}),FC=Ae((t,e)=>{e.exports=i,i.sync=s;var r=At("fs");function i(a,u,h){r.stat(a,function(l,c){h(l,l?false:n(c,u));});}function s(a,u){return n(r.statSync(a),u)}function n(a,u){return a.isFile()&&o(a,u)}function o(a,u){var h=a.mode,l=a.uid,c=a.gid,d=u.uid!==void 0?u.uid:process.getuid&&process.getuid(),f=u.gid!==void 0?u.gid:process.getgid&&process.getgid(),m=parseInt("100",8),g=parseInt("010",8),D=parseInt("001",8),x=m|g,b=h&D||h&g&&c===f||h&m&&l===d||h&x&&d===0;return b}}),EC=Ae((t,e)=>{At("fs");var r;process.platform==="win32"||global.TESTING_WINDOWS?r=xC():r=FC(),e.exports=i,i.sync=s;function i(n,o,a){if(typeof o=="function"&&(a=o,o={}),!a){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(u,h){i(n,o||{},function(l,c){l?h(l):u(c);});})}r(n,o||{},function(u,h){u&&(u.code==="EACCES"||o&&o.ignoreErrors)&&(u=null,h=false),a(u,h);});}function s(n,o){try{return r.sync(n,o||{})}catch(a){if(o&&o.ignoreErrors||a.code==="EACCES")return false;throw a}}}),AC=Ae((t,e)=>{var r=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",i=At("path"),s=r?";":":",n=EC(),o=l=>Object.assign(new Error(`not found: ${l}`),{code:"ENOENT"}),a=(l,c)=>{let d=c.colon||s,f=l.match(/\//)||r&&l.match(/\\/)?[""]:[...r?[process.cwd()]:[],...(c.path||process.env.PATH||"").split(d)],m=r?c.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",g=r?m.split(d):[""];return r&&l.indexOf(".")!==-1&&g[0]!==""&&g.unshift(""),{pathEnv:f,pathExt:g,pathExtExe:m}},u=(l,c,d)=>{typeof c=="function"&&(d=c,c={}),c||(c={});let{pathEnv:f,pathExt:m,pathExtExe:g}=a(l,c),D=[],x=v=>new Promise((C,E)=>{if(v===f.length)return c.all&&D.length?C(D):E(o(l));let O=f[v],P=/^".*"$/.test(O)?O.slice(1,-1):O,A=i.join(P,l),R=!P&&/^\.[\\\/]/.test(l)?l.slice(0,2)+A:A;C(b(R,v,0));}),b=(v,C,E)=>new Promise((O,P)=>{if(E===m.length)return O(x(C+1));let A=m[E];n(v+A,{pathExt:g},(R,U)=>{if(!R&&U)if(c.all)D.push(v+A);else return O(v+A);return O(b(v,C,E+1))});});return d?x(0).then(v=>d(null,v),d):x(0)},h=(l,c)=>{c=c||{};let{pathEnv:d,pathExt:f,pathExtExe:m}=a(l,c),g=[];for(let D=0;D<d.length;D++){let x=d[D],b=/^".*"$/.test(x)?x.slice(1,-1):x,v=i.join(b,l),C=!b&&/^\.[\\\/]/.test(l)?l.slice(0,2)+v:v;for(let E=0;E<f.length;E++){let O=C+f[E];try{if(n.sync(O,{pathExt:m}))if(c.all)g.push(O);else return O}catch{}}}if(c.all&&g.length)return g;if(c.nothrow)return null;throw o(l)};e.exports=u,u.sync=h;}),$C=Ae((t,e)=>{var r=(i={})=>{let s=i.env||process.env;return (i.platform||process.platform)!=="win32"?"PATH":Object.keys(s).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};e.exports=r,e.exports.default=r;}),OC=Ae((t,e)=>{var r=At("path"),i=AC(),s=$C();function n(a,u){let h=a.options.env||process.env,l=process.cwd(),c=a.options.cwd!=null,d=c&&process.chdir!==void 0&&!process.chdir.disabled;if(d)try{process.chdir(a.options.cwd);}catch{}let f;try{f=i.sync(a.command,{path:h[s({env:h})],pathExt:u?r.delimiter:void 0});}catch{}finally{d&&process.chdir(l);}return f&&(f=r.resolve(c?a.options.cwd:"",f)),f}function o(a){return n(a)||n(a,true)}e.exports=o;}),SC=Ae((t,e)=>{var r=/([()\][%!^"`<>&|;, *?])/g;function i(n){return n=n.replace(r,"^$1"),n}function s(n,o){return n=`${n}`,n=n.replace(/(\\*)"/g,'$1$1\\"'),n=n.replace(/(\\*)$/,"$1$1"),n=`"${n}"`,n=n.replace(r,"^$1"),o&&(n=n.replace(r,"^$1")),n}e.exports.command=i,e.exports.argument=s;}),RC=Ae((t,e)=>{e.exports=/^#!(.*)/;}),TC=Ae((t,e)=>{var r=RC();e.exports=(i="")=>{let s=i.match(r);if(!s)return null;let[n,o]=s[0].replace(/#! ?/,"").split(" "),a=n.split("/").pop();return a==="env"?o:o?`${a} ${o}`:a};}),PC=Ae((t,e)=>{var r=At("fs"),i=TC();function s(n){let o=Buffer.alloc(150),a;try{a=r.openSync(n,"r"),r.readSync(a,o,0,150,0),r.closeSync(a);}catch{}return i(o.toString())}e.exports=s;}),kC=Ae((t,e)=>{var r=At("path"),i=OC(),s=SC(),n=PC(),o=process.platform==="win32",a=/\.(?:com|exe)$/i,u=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function h(d){d.file=i(d);let f=d.file&&n(d.file);return f?(d.args.unshift(d.file),d.command=f,i(d)):d.file}function l(d){if(!o)return d;let f=h(d),m=!a.test(f);if(d.options.forceShell||m){let g=u.test(f);d.command=r.normalize(d.command),d.command=s.command(d.command),d.args=d.args.map(x=>s.argument(x,g));let D=[d.command].concat(d.args).join(" ");d.args=["/d","/s","/c",`"${D}"`],d.command=process.env.comspec||"cmd.exe",d.options.windowsVerbatimArguments=true;}return d}function c(d,f,m){f&&!Array.isArray(f)&&(m=f,f=null),f=f?f.slice(0):[],m=Object.assign({},m);let g={command:d,args:f,options:m,file:void 0,original:{command:d,args:f}};return m.shell?g:l(g)}e.exports=c;}),IC=Ae((t,e)=>{var r=process.platform==="win32";function i(a,u){return Object.assign(new Error(`${u} ${a.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${u} ${a.command}`,path:a.command,spawnargs:a.args})}function s(a,u){if(!r)return;let h=a.emit;a.emit=function(l,c){if(l==="exit"){let d=n(c,u);if(d)return h.call(a,"error",d)}return h.apply(a,arguments)};}function n(a,u){return r&&a===1&&!u.file?i(u.original,"spawn"):null}function o(a,u){return r&&a===1&&!u.file?i(u.original,"spawnSync"):null}e.exports={hookChildProcess:s,verifyENOENT:n,verifyENOENTSync:o,notFoundError:i};}),MC=Ae((t,e)=>{var r=At("child_process"),i=kC(),s=IC();function n(a,u,h){let l=i(a,u,h),c=r.spawn(l.command,l.args,l.options);return s.hookChildProcess(c,l),c}function o(a,u,h){let l=i(a,u,h),c=r.spawnSync(l.command,l.args,l.options);return c.error=c.error||s.verifyENOENTSync(c.status,l),c}e.exports=n,e.exports.spawn=n,e.exports.sync=o,e.exports._parse=i,e.exports._enoent=s;}),BC=/^path$/i,gf={key:"PATH",value:""};function NC(t){for(let e in t){if(!Object.prototype.hasOwnProperty.call(t,e)||!BC.test(e))continue;let r=t[e];return r?{key:e,value:r}:gf}return gf}function HC(t,e){let r=e.value.split(kt.delimiter),i=t,s;do r.push(kt.resolve(i,"node_modules",".bin")),s=i,i=kt.dirname(i);while(i!==s);return {key:e.key,value:r.join(kt.delimiter)}}function qC(t,e){let r={...process.env,...e},i=HC(t,NC(r));return r[i.key]=i.value,r}var LC=t=>{let e=t.length,r=new stream.PassThrough,i=()=>{--e===0&&r.emit("end");};for(let s of t)s.pipe(r,{end:false}),s.on("end",i);return r},jC=wC(MC()),Df=class extends Error{result;output;get exitCode(){if(this.result.exitCode!==null)return this.result.exitCode}constructor(t,e){super(`Process exited with non-zero status (${t.exitCode})`),this.result=t,this.output=e;}},GC={timeout:void 0,persist:false},VC={windowsHide:true};function WC(t,e){return {command:kt.normalize(t),args:e??[]}}function UC(t){let e=new AbortController;for(let r of t){if(r.aborted)return e.abort(),r;let i=()=>{e.abort(r.reason);};r.addEventListener("abort",i,{signal:e.signal});}return e.signal}var KC=class{_process;_aborted=false;_options;_command;_args;_resolveClose;_processClosed;_thrownError;get process(){return this._process}get pid(){return this._process?.pid}get exitCode(){if(this._process&&this._process.exitCode!==null)return this._process.exitCode}constructor(t,e,r){this._options={...GC,...r},this._command=t,this._args=e??[],this._processClosed=new Promise(i=>{this._resolveClose=i;});}kill(t){return this._process?.kill(t)===true}get aborted(){return this._aborted}get killed(){return this._process?.killed===true}pipe(t,e,r){return YC(t,e,{...r,stdin:this})}async*[Symbol.asyncIterator](){let t=this._process;if(!t)return;let e=[];this._streamErr&&e.push(this._streamErr),this._streamOut&&e.push(this._streamOut);let r=LC(e),i=wf__default.default.createInterface({input:r});for await(let s of i)yield s.toString();if(await this._processClosed,t.removeAllListeners(),this._thrownError)throw this._thrownError;if(this._options?.throwOnError&&this.exitCode!==0&&this.exitCode!==void 0)throw new Df(this)}async _waitForOutput(){let t=this._process;if(!t)throw new Error("No process was started");let e="",r="";if(this._streamErr)for await(let s of this._streamErr)e+=s.toString();if(this._streamOut)for await(let s of this._streamOut)r+=s.toString();if(await this._processClosed,this._options?.stdin&&await this._options.stdin,t.removeAllListeners(),this._thrownError)throw this._thrownError;let i={stderr:e,stdout:r,exitCode:this.exitCode};if(this._options.throwOnError&&this.exitCode!==0&&this.exitCode!==void 0)throw new Df(this,i);return i}then(t,e){return this._waitForOutput().then(t,e)}_streamOut;_streamErr;spawn(){let t=Ve.cwd(),e=this._options,r={...VC,...e.nodeOptions},i=[];this._resetState(),e.timeout!==void 0&&i.push(AbortSignal.timeout(e.timeout)),e.signal!==void 0&&i.push(e.signal),e.persist===true&&(r.detached=true),i.length>0&&(r.signal=UC(i)),r.env=qC(t,r.env);let{command:s,args:n}=WC(this._command,this._args),o=(0, jC._parse)(s,n,r),a=child_process.spawn(o.command,o.args,o.options);if(a.stderr&&(this._streamErr=a.stderr),a.stdout&&(this._streamOut=a.stdout),this._process=a,a.once("error",this._onError),a.once("close",this._onClose),e.stdin!==void 0&&a.stdin&&e.stdin.process){let{stdout:u}=e.stdin.process;u&&u.pipe(a.stdin);}}_resetState(){this._aborted=false,this._processClosed=new Promise(t=>{this._resolveClose=t;}),this._thrownError=void 0;}_onError=t=>{if(t.name==="AbortError"&&(!(t.cause instanceof Error)||t.cause.name!=="TimeoutError")){this._aborted=true;return}this._thrownError=t;};_onClose=()=>{this._resolveClose&&this._resolveClose();}},Mf=(t,e,r)=>{let i=new KC(t,e,r);return i.spawn(),i},YC=Mf;var Ne={},Tt={},bf;function JC(){if(bf)return Tt;bf=1,Object.defineProperty(Tt,"__esModule",{value:true}),Tt.sync=Tt.isexe=void 0;let t=xf__default.default,e=Ff__default.default,r=async(o,a={})=>{let{ignoreErrors:u=false}=a;try{return s(await(0,e.stat)(o),a)}catch(h){let l=h;if(u||l.code==="EACCES")return false;throw l}};Tt.isexe=r;let i=(o,a={})=>{let{ignoreErrors:u=false}=a;try{return s((0,t.statSync)(o),a)}catch(h){let l=h;if(u||l.code==="EACCES")return false;throw l}};Tt.sync=i;let s=(o,a)=>o.isFile()&&n(o,a),n=(o,a)=>{let u=a.uid??process.getuid?.(),h=a.groups??process.getgroups?.()??[],l=a.gid??process.getgid?.()??h[0];if(u===void 0||l===void 0)throw new Error("cannot get uid or gid");let c=new Set([l,...h]),d=o.mode,f=o.uid,m=o.gid,g=parseInt("100",8),D=parseInt("010",8),x=parseInt("001",8),b=g|D;return !!(d&x||d&D&&c.has(m)||d&g&&f===u||d&b&&u===0)};return Tt}var Pt={},vf;function zC(){if(vf)return Pt;vf=1,Object.defineProperty(Pt,"__esModule",{value:true}),Pt.sync=Pt.isexe=void 0;let t=xf__default.default,e=Ff__default.default,r=async(o,a={})=>{let{ignoreErrors:u=false}=a;try{return n(await(0,e.stat)(o),o,a)}catch(h){let l=h;if(u||l.code==="EACCES")return false;throw l}};Pt.isexe=r;let i=(o,a={})=>{let{ignoreErrors:u=false}=a;try{return n((0,t.statSync)(o),o,a)}catch(h){let l=h;if(u||l.code==="EACCES")return false;throw l}};Pt.sync=i;let s=(o,a)=>{let{pathExt:u=process.env.PATHEXT||""}=a,h=u.split(";");if(h.indexOf("")!==-1)return true;for(let l=0;l<h.length;l++){let c=h[l].toLowerCase(),d=o.substring(o.length-c.length).toLowerCase();if(c&&d===c)return true}return false},n=(o,a,u)=>o.isFile()&&s(a,u);return Pt}var zo={},yf;function XC(){return yf||(yf=1,Object.defineProperty(zo,"__esModule",{value:true})),zo}var Cf;function ZC(){return Cf||(Cf=1,function(t){var e=Ne&&Ne.__createBinding||(Object.create?function(h,l,c,d){d===void 0&&(d=c);var f=Object.getOwnPropertyDescriptor(l,c);(!f||("get"in f?!l.__esModule:f.writable||f.configurable))&&(f={enumerable:true,get:function(){return l[c]}}),Object.defineProperty(h,d,f);}:function(h,l,c,d){d===void 0&&(d=c),h[d]=l[c];}),r=Ne&&Ne.__setModuleDefault||(Object.create?function(h,l){Object.defineProperty(h,"default",{enumerable:true,value:l});}:function(h,l){h.default=l;}),i=Ne&&Ne.__importStar||function(h){if(h&&h.__esModule)return h;var l={};if(h!=null)for(var c in h)c!=="default"&&Object.prototype.hasOwnProperty.call(h,c)&&e(l,h,c);return r(l,h),l},s=Ne&&Ne.__exportStar||function(h,l){for(var c in h)c!=="default"&&!Object.prototype.hasOwnProperty.call(l,c)&&e(l,h,c);};Object.defineProperty(t,"__esModule",{value:true}),t.sync=t.isexe=t.posix=t.win32=void 0;let n=i(JC());t.posix=n;let o=i(zC());t.win32=o,s(XC(),t);let u=(process.env._ISEXE_TEST_PLATFORM_||process.platform)==="win32"?o:n;t.isexe=u.isexe,t.sync=u.sync;}(Ne)),Ne}var Xo,_f;function QC(){if(_f)return Xo;_f=1;let{isexe:t,sync:e}=ZC(),{join:r,delimiter:i,sep:s,posix:n}=kt__default.default,o=process.platform==="win32",a=new RegExp(`[${n.sep}${s===n.sep?"":s}]`.replace(/(\\)/g,"\\$1")),u=new RegExp(`^\\.${a.source}`),h=m=>Object.assign(new Error(`not found: ${m}`),{code:"ENOENT"}),l=(m,{path:g=process.env.PATH,pathExt:D=process.env.PATHEXT,delimiter:x=i})=>{let b=m.match(a)?[""]:[...o?[process.cwd()]:[],...(g||"").split(x)];if(o){let v=D||[".EXE",".CMD",".BAT",".COM"].join(x),C=v.split(x).flatMap(E=>[E,E.toLowerCase()]);return m.includes(".")&&C[0]!==""&&C.unshift(""),{pathEnv:b,pathExt:C,pathExtExe:v}}return {pathEnv:b,pathExt:[""]}},c=(m,g)=>{let D=/^".*"$/.test(m)?m.slice(1,-1):m;return (!D&&u.test(g)?g.slice(0,2):"")+r(D,g)},d=async(m,g={})=>{let{pathEnv:D,pathExt:x,pathExtExe:b}=l(m,g),v=[];for(let C of D){let E=c(C,m);for(let O of x){let P=E+O;if(await t(P,{pathExt:b,ignoreErrors:true})){if(!g.all)return P;v.push(P);}}}if(g.all&&v.length)return v;if(g.nothrow)return null;throw h(m)},f=(m,g={})=>{let{pathEnv:D,pathExt:x,pathExtExe:b}=l(m,g),v=[];for(let C of D){let E=c(C,m);for(let O of x){let P=E+O;if(e(P,{pathExt:b,ignoreErrors:true})){if(!g.all)return P;v.push(P);}}}if(g.all&&v.length)return v;if(g.nothrow)return null;throw h(m)};return Xo=d,d.sync=f,Xo}var e_=QC(),t_=Qo(e_);kt.join(Fy__default.default.tmpdir(),"antfu-ni");function Bf(t){return t_.sync(t,{nothrow:true})!==null}async function ra({autoInstall:t,programmatic:e,cwd:r}={}){let{name:i,agent:s,version:n}=await hC({cwd:r,onUnknown:o=>{e||console.warn("[ni] Unknown packageManager:",o);}})||{};if(i&&!Bf(i)&&!e){if(!t){console.warn(`[ni] Detected ${i} but it doesn't seem to be installed.
933
- `),Ve__default.default.env.CI&&Ve__default.default.exit(1);let o=kr(i,Rf[i]),{tryInstall:a}=await sC({name:"tryInstall",type:"confirm",message:`Would you like to globally install ${o}?`});a||Ve__default.default.exit(1);}await Mf("npm",["i","-g",`${i}${n?`@${n}`:""}`],{nodeOptions:{stdio:"inherit",cwd:r},throwOnError:true});}return s}Ve__default.default.env.NI_CONFIG_FILE;var i_=Ve__default.default.platform==="win32"?Ve__default.default.env.USERPROFILE:Ve__default.default.env.HOME;kt__default.default.join(i_||"~/",".nirc");var o_=async t=>{let e=await ra({cwd:t});return e&&["npm","yarn","pnpm","bun"].includes(e)?e:"npm"},Nf=t=>{let e=kt.join(t,"package.json");if(!xf.existsSync(e))return "unknown";try{let r=JSON.parse(xf.readFileSync(e,"utf-8")),i={...r.dependencies,...r.devDependencies};return i.next?"next":i.vite?"vite":i.webpack?"webpack":"unknown"}catch{return "unknown"}},a_=t=>{let e=xf.existsSync(kt.join(t,"app")),r=xf.existsSync(kt.join(t,"src","app")),i=xf.existsSync(kt.join(t,"pages")),s=xf.existsSync(kt.join(t,"src","pages"));return e||r?"app":i||s?"pages":"unknown"},u_=t=>{if(xf.existsSync(kt.join(t,"pnpm-workspace.yaml"))||xf.existsSync(kt.join(t,"lerna.json")))return true;let e=kt.join(t,"package.json");if(xf.existsSync(e))try{if(JSON.parse(xf.readFileSync(e,"utf-8")).workspaces)return !0}catch{return false}return false},l_=t=>{let e=[],r=kt.join(t,"pnpm-workspace.yaml");if(xf.existsSync(r)){let o=xf.readFileSync(r,"utf-8").split(`
934
- `),a=false;for(let u of o){if(u.match(/^packages:\s*$/)){a=true;continue}if(a){if(u.match(/^[a-zA-Z]/)||u.trim()===""){u.match(/^[a-zA-Z]/)&&(a=false);continue}let h=u.match(/^\s*-\s*['"]?([^'"#\n]+?)['"]?\s*$/);h&&e.push(h[1].trim());}}}let i=kt.join(t,"lerna.json");if(xf.existsSync(i))try{let n=JSON.parse(xf.readFileSync(i,"utf-8"));Array.isArray(n.packages)&&e.push(...n.packages);}catch{}let s=kt.join(t,"package.json");if(xf.existsSync(s))try{let n=JSON.parse(xf.readFileSync(s,"utf-8"));Array.isArray(n.workspaces)?e.push(...n.workspaces):n.workspaces?.packages&&e.push(...n.workspaces.packages);}catch{}return [...new Set(e)]},c_=(t,e)=>{let r=[],i=e.replace(/\/\*$/,""),s=kt.join(t,i);if(!xf.existsSync(s))return r;try{let n=xf.readdirSync(s,{withFileTypes:!0});for(let o of n)if(o.isDirectory()){let a=kt.join(s,o.name,"package.json");xf.existsSync(a)&&r.push(kt.join(s,o.name));}}catch{return r}return r},h_=t=>{let e=kt.join(t,"package.json");if(!xf.existsSync(e))return false;try{let r=JSON.parse(xf.readFileSync(e,"utf-8")),i={...r.dependencies,...r.devDependencies};return !!(i.react||i["react-dom"])}catch{return false}},Hf=t=>{let e=l_(t),r=[];for(let i of e){let s=c_(t,i);for(let n of s){let o=Nf(n),a=h_(n);if(a||o!=="unknown"){let u=kt.join(n,"package.json"),h=kt.basename(n);try{h=JSON.parse(xf.readFileSync(u,"utf-8")).name||h;}catch{}r.push({name:h,path:n,framework:o,hasReact:a});}}}return r},d_=t=>{if(!xf.existsSync(t))return false;try{let e=xf.readFileSync(t,"utf-8");return [/["'`][^"'`]*react-grab/,/react-grab[^"'`]*["'`]/,/<[^>]*react-grab/i,/import[^;]*react-grab/i,/require[^)]*react-grab/i,/from\s+[^;]*react-grab/i,/src[^>]*react-grab/i].some(i=>i.test(e))}catch{return false}},f_=t=>{let e=kt.join(t,"package.json");if(xf.existsSync(e))try{let i=JSON.parse(xf.readFileSync(e,"utf-8"));if({...i.dependencies,...i.devDependencies}["react-grab"])return !0}catch{}return [kt.join(t,"app","layout.tsx"),kt.join(t,"app","layout.jsx"),kt.join(t,"src","app","layout.tsx"),kt.join(t,"src","app","layout.jsx"),kt.join(t,"pages","_document.tsx"),kt.join(t,"pages","_document.jsx"),kt.join(t,"instrumentation-client.ts"),kt.join(t,"instrumentation-client.js"),kt.join(t,"src","instrumentation-client.ts"),kt.join(t,"src","instrumentation-client.js"),kt.join(t,"index.html"),kt.join(t,"public","index.html"),kt.join(t,"src","index.tsx"),kt.join(t,"src","index.ts"),kt.join(t,"src","main.tsx"),kt.join(t,"src","main.ts")].some(d_)},p_=["@react-grab/claude-code","@react-grab/cursor","@react-grab/opencode","@react-grab/codex","@react-grab/gemini","@react-grab/amp","@react-grab/ami","@react-grab/visual-edit"],m_=t=>{let e=kt.join(t,"package.json");if(!xf.existsSync(e))return null;try{let r=JSON.parse(xf.readFileSync(e,"utf-8")),i={...r.dependencies,...r.devDependencies};return i["@remix-run/react"]||i.remix?"remix":i.astro?"astro":i["@sveltejs/kit"]?"sveltekit":i.gatsby?"gatsby":null}catch{return null}},g_=t=>{let e=kt.join(t,"package.json");if(!xf.existsSync(e))return [];try{let r=JSON.parse(xf.readFileSync(e,"utf-8")),i={...r.dependencies,...r.devDependencies};return p_.filter(s=>!!i[s]).map(s=>s.replace("@react-grab/",""))}catch{return []}};var mt=async(t=process.cwd())=>{let e=Nf(t);return {packageManager:await o_(t),framework:e,nextRouterType:e==="next"?a_(t):"unknown",isMonorepo:u_(t),projectRoot:t,hasReactGrab:f_(t),installedAgents:g_(t),unsupportedFramework:m_(t)}};var D_="\x1B[31m",b_="\x1B[32m",$i="\x1B[90m",It="\x1B[0m",v_="\x1B[1m",y_=(t,e)=>{let r=t.split(`
935
- `),i=e.split(`
936
- `),s=[];Math.max(r.length,i.length);let o=0,a=0;for(;o<r.length||a<i.length;){let u=r[o],h=i[a];if(u===h)s.push({type:"unchanged",content:u,lineNumber:a+1}),o++,a++;else if(u===void 0)s.push({type:"added",content:h,lineNumber:a+1}),a++;else if(h===void 0)s.push({type:"removed",content:u}),o++;else {let l=i.indexOf(u,a),c=r.indexOf(h,o);if(l!==-1&&(c===-1||l-a<c-o))for(;a<l;)s.push({type:"added",content:i[a],lineNumber:a+1}),a++;else if(c!==-1)for(;o<c;)s.push({type:"removed",content:r[o]}),o++;else s.push({type:"removed",content:u}),s.push({type:"added",content:h,lineNumber:a+1}),o++,a++;}}return s},C_=(t,e=3)=>{let r=[],i=-1,s=false,n=t.map((o,a)=>o.type!=="unchanged"?a:-1).filter(o=>o!==-1);if(n.length===0)return `${$i}No changes${It}`;for(let o of n){let a=Math.max(0,o-e),u=Math.min(t.length-1,o+e);a>i+1&&i!==-1&&r.push(`${$i} ...${It}`);for(let h=Math.max(a,i+1);h<=u;h++){let l=t[h];l.type==="added"?(r.push(`${b_}+ ${l.content}${It}`),s=true):l.type==="removed"?(r.push(`${D_}- ${l.content}${It}`),s=true):r.push(`${$i} ${l.content}${It}`),i=h;}}return s?r.join(`
937
- `):`${$i}No changes${It}`},we=(t,e,r)=>{console.log(`
938
- ${v_}File: ${t}${It}`),console.log("\u2500".repeat(60));let i=y_(e,r);console.log(C_(i)),console.log("\u2500".repeat(60));};var or=ve(Ot()),k={error:or.default.red,warn:or.default.yellow,info:or.default.cyan,success:or.default.green,dim:or.default.dim};var p={error(...t){console.log(k.error(t.join(" ")));},warn(...t){console.log(k.warn(t.join(" ")));},info(...t){console.log(k.info(t.join(" ")));},success(...t){console.log(k.success(t.join(" ")));},log(...t){console.log(t.join(" "));},break(){console.log("");}};var ge=t=>{p.break(),p.error("Something went wrong. Please check the error below for more details."),p.error("If the problem persists, please open an issue on GitHub."),p.error(""),t instanceof Error&&p.error(t.message),p.break(),process.exit(1);};var __={npm:"npm install",yarn:"yarn add",pnpm:"pnpm add",bun:"bun add"},w_={npm:"npm uninstall",yarn:"yarn remove",pnpm:"pnpm remove",bun:"bun remove"},ar=(t,e,r,i=true)=>{if(t.length===0)return;let o=`${__[e]}${i?" -D":""} ${t.join(" ")}`;console.log(`Running: ${o}
939
- `),child_process.execSync(o,{cwd:r,stdio:"inherit"});},ur=(t,e=true)=>{let r=[];return e&&r.push("react-grab"),t!=="none"&&r.push(`@react-grab/${t}`),r},Mt=(t,e,r)=>{if(t.length===0)return;let s=`${w_[e]} ${t.join(" ")}`;console.log(`Running: ${s}
940
- `),child_process.execSync(s,{cwd:r,stdio:"inherit"});},Bt=t=>[`@react-grab/${t}`];var Lf=(t=0)=>e=>`\x1B[${e+t}m`,jf=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,Gf=(t=0)=>(e,r,i)=>`\x1B[${38+t};2;${e};${r};${i}m`,Q={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(Q.modifier);var x_=Object.keys(Q.color),F_=Object.keys(Q.bgColor);[...x_,...F_];function E_(){let t=new Map;for(let[e,r]of Object.entries(Q)){for(let[i,s]of Object.entries(r))Q[i]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},r[i]=Q[i],t.set(s[0],s[1]);Object.defineProperty(Q,e,{value:r,enumerable:false});}return Object.defineProperty(Q,"codes",{value:t,enumerable:false}),Q.color.close="\x1B[39m",Q.bgColor.close="\x1B[49m",Q.color.ansi=Lf(),Q.color.ansi256=jf(),Q.color.ansi16m=Gf(),Q.bgColor.ansi=Lf(10),Q.bgColor.ansi256=jf(10),Q.bgColor.ansi16m=Gf(10),Object.defineProperties(Q,{rgbToAnsi256:{value(e,r,i){return e===r&&r===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(i/255*5)},enumerable:false},hexToRgb:{value(e){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return [0,0,0];let[i]=r;i.length===3&&(i=[...i].map(n=>n+n).join(""));let s=Number.parseInt(i,16);return [s>>16&255,s>>8&255,s&255]},enumerable:false},hexToAnsi256:{value:e=>Q.rgbToAnsi256(...Q.hexToRgb(e)),enumerable:false},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,i,s;if(e>=232)r=((e-232)*10+8)/255,i=r,s=r;else {e-=16;let a=e%36;r=Math.floor(e/36)/5,i=Math.floor(a/6)/5,s=a%6/5;}let n=Math.max(r,i,s)*2;if(n===0)return 30;let o=30+(Math.round(s)<<2|Math.round(i)<<1|Math.round(r));return n===2&&(o+=60),o},enumerable:false},rgbToAnsi:{value:(e,r,i)=>Q.ansi256ToAnsi(Q.rgbToAnsi256(e,r,i)),enumerable:false},hexToAnsi:{value:e=>Q.ansi256ToAnsi(Q.hexToAnsi256(e)),enumerable:false}}),Q}var A_=E_(),je=A_;function Te(t,e=globalThis.Deno?globalThis.Deno.args:Ve__default.default.argv){let r=t.startsWith("-")?"":t.length===1?"-":"--",i=e.indexOf(r+t),s=e.indexOf("--");return i!==-1&&(s===-1||i<s)}var{env:ee}=Ve__default.default,Oi;Te("no-color")||Te("no-colors")||Te("color=false")||Te("color=never")?Oi=0:(Te("color")||Te("colors")||Te("color=true")||Te("color=always"))&&(Oi=1);function O_(){if("FORCE_COLOR"in ee)return ee.FORCE_COLOR==="true"?1:ee.FORCE_COLOR==="false"?0:ee.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(ee.FORCE_COLOR,10),3)}function S_(t){return t===0?false:{level:t,hasBasic:true,has256:t>=2,has16m:t>=3}}function R_(t,{streamIsTTY:e,sniffFlags:r=true}={}){let i=O_();i!==void 0&&(Oi=i);let s=r?Oi:i;if(s===0)return 0;if(r){if(Te("color=16m")||Te("color=full")||Te("color=truecolor"))return 3;if(Te("color=256"))return 2}if("TF_BUILD"in ee&&"AGENT_NAME"in ee)return 1;if(t&&!e&&s===void 0)return 0;let n=s||0;if(ee.TERM==="dumb")return n;if(Ve__default.default.platform==="win32"){let o=Fy__default.default.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in ee)return ["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(o=>o in ee)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>o in ee)||ee.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in ee)return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(ee.TEAMCITY_VERSION)?1:0;if(ee.COLORTERM==="truecolor"||ee.TERM==="xterm-kitty"||ee.TERM==="xterm-ghostty"||ee.TERM==="wezterm")return 3;if("TERM_PROGRAM"in ee){let o=Number.parseInt((ee.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(ee.TERM_PROGRAM){case "iTerm.app":return o>=3?3:2;case "Apple_Terminal":return 2}}return /-256(color)?$/i.test(ee.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(ee.TERM)||"COLORTERM"in ee?1:n}function Wf(t,e={}){let r=R_(t,{streamIsTTY:t&&t.isTTY,...e});return S_(r)}var T_={stdout:Wf({isTTY:Vf__default.default.isatty(1)}),stderr:Wf({isTTY:Vf__default.default.isatty(2)})},Uf=T_;function Kf(t,e,r){let i=t.indexOf(e);if(i===-1)return t;let s=e.length,n=0,o="";do o+=t.slice(n,i)+e+r,n=i+s,i=t.indexOf(e,n);while(i!==-1);return o+=t.slice(n),o}function Yf(t,e,r,i){let s=0,n="";do{let o=t[i-1]==="\r";n+=t.slice(s,o?i-1:i)+e+(o?`\r
941
- `:`
942
- `)+r,s=i+1,i=t.indexOf(`
943
- `,s);}while(i!==-1);return n+=t.slice(s),n}var{stdout:Jf,stderr:zf}=Uf,sa=Symbol("GENERATOR"),lr=Symbol("STYLER"),Ir=Symbol("IS_EMPTY"),Xf=["ansi","ansi","ansi256","ansi16m"],cr=Object.create(null),P_=(t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=Jf?Jf.level:0;t.level=e.level===void 0?r:e.level;};var k_=t=>{let e=(...r)=>r.join(" ");return P_(e,t),Object.setPrototypeOf(e,Mr.prototype),e};function Mr(t){return k_(t)}Object.setPrototypeOf(Mr.prototype,Function.prototype);for(let[t,e]of Object.entries(je))cr[t]={get(){let r=Si(this,oa(e.open,e.close,this[lr]),this[Ir]);return Object.defineProperty(this,t,{value:r}),r}};cr.visible={get(){let t=Si(this,this[lr],true);return Object.defineProperty(this,"visible",{value:t}),t}};var na=(t,e,r,...i)=>t==="rgb"?e==="ansi16m"?je[r].ansi16m(...i):e==="ansi256"?je[r].ansi256(je.rgbToAnsi256(...i)):je[r].ansi(je.rgbToAnsi(...i)):t==="hex"?na("rgb",e,r,...je.hexToRgb(...i)):je[r][t](...i),I_=["rgb","hex","ansi256"];for(let t of I_){cr[t]={get(){let{level:r}=this;return function(...i){let s=oa(na(t,Xf[r],"color",...i),je.color.close,this[lr]);return Si(this,s,this[Ir])}}};let e="bg"+t[0].toUpperCase()+t.slice(1);cr[e]={get(){let{level:r}=this;return function(...i){let s=oa(na(t,Xf[r],"bgColor",...i),je.bgColor.close,this[lr]);return Si(this,s,this[Ir])}}};}var M_=Object.defineProperties(()=>{},{...cr,level:{enumerable:true,get(){return this[sa].level},set(t){this[sa].level=t;}}}),oa=(t,e,r)=>{let i,s;return r===void 0?(i=t,s=e):(i=r.openAll+t,s=e+r.closeAll),{open:t,close:e,openAll:i,closeAll:s,parent:r}},Si=(t,e,r)=>{let i=(...s)=>B_(i,s.length===1?""+s[0]:s.join(" "));return Object.setPrototypeOf(i,M_),i[sa]=t,i[lr]=e,i[Ir]=r,i},B_=(t,e)=>{if(t.level<=0||!e)return t[Ir]?"":e;let r=t[lr];if(r===void 0)return e;let{openAll:i,closeAll:s}=r;if(e.includes("\x1B"))for(;r!==void 0;)e=Kf(e,r.close,r.open),r=r.parent;let n=e.indexOf(`
944
- `);return n!==-1&&(e=Yf(e,s,i,n)),i+e+s};Object.defineProperties(Mr.prototype,cr);var N_=Mr();Mr({level:zf?zf.level:0});var Ge=N_;var H_=(t,e,r,i)=>{if(r==="length"||r==="prototype"||r==="arguments"||r==="caller")return;let s=Object.getOwnPropertyDescriptor(t,r),n=Object.getOwnPropertyDescriptor(e,r);!q_(s,n)&&i||Object.defineProperty(t,r,n);},q_=function(t,e){return t===void 0||t.configurable||t.writable===e.writable&&t.enumerable===e.enumerable&&t.configurable===e.configurable&&(t.writable||t.value===e.value)},L_=(t,e)=>{let r=Object.getPrototypeOf(e);r!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,r);},j_=(t,e)=>`/* Wrapped ${t}*/
945
- ${e}`,G_=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),V_=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),W_=(t,e,r)=>{let i=r===""?"":`with ${r.trim()}() `,s=j_.bind(null,i,e.toString());Object.defineProperty(s,"name",V_);let{writable:n,enumerable:o,configurable:a}=G_;Object.defineProperty(t,"toString",{value:s,writable:n,enumerable:o,configurable:a});};function aa(t,e,{ignoreNonConfigurable:r=false}={}){let{name:i}=t;for(let s of Reflect.ownKeys(e))H_(t,e,s,r);return L_(t,e),W_(t,e,i),t}var Ri=new WeakMap,Zf=(t,e={})=>{if(typeof t!="function")throw new TypeError("Expected a function");let r,i=0,s=t.displayName||t.name||"<anonymous>",n=function(...o){if(Ri.set(n,++i),i===1)r=t.apply(this,o),t=void 0;else if(e.throw===true)throw new Error(`Function \`${s}\` can only be called once`);return r};return aa(n,t),Ri.set(n,i),n};Zf.callCount=t=>{if(!Ri.has(t))throw new Error(`The given function \`${t.name}\` is not wrapped by the \`onetime\` package`);return Ri.get(t)};var Qf=Zf;var Nt=[];Nt.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&Nt.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Nt.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var Ti=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",ua=Symbol.for("signal-exit emitter"),la=globalThis,U_=Object.defineProperty.bind(Object),ca=class{emitted={afterExit:false,exit:false};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(la[ua])return la[ua];U_(la,ua,{value:this,writable:false,enumerable:false,configurable:false});}on(e,r){this.listeners[e].push(r);}removeListener(e,r){let i=this.listeners[e],s=i.indexOf(r);s!==-1&&(s===0&&i.length===1?i.length=0:i.splice(s,1));}emit(e,r,i){if(this.emitted[e])return false;this.emitted[e]=true;let s=false;for(let n of this.listeners[e])s=n(r,i)===true||s;return e==="exit"&&(s=this.emit("afterExit",r,i)||s),s}},Pi=class{},K_=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),ha=class extends Pi{onExit(){return ()=>{}}load(){}unload(){}},da=class extends Pi{#o=fa.platform==="win32"?"SIGINT":"SIGHUP";#r=new ca;#e;#s;#d;#t={};#n=false;constructor(e){super(),this.#e=e,this.#t={};for(let r of Nt)this.#t[r]=()=>{let i=this.#e.listeners(r),{count:s}=this.#r,n=e;if(typeof n.__signal_exit_emitter__=="object"&&typeof n.__signal_exit_emitter__.count=="number"&&(s+=n.__signal_exit_emitter__.count),i.length===s){this.unload();let o=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#o:r;o||e.kill(e.pid,a);}};this.#d=e.reallyExit,this.#s=e.emit;}onExit(e,r){if(!Ti(this.#e))return ()=>{};this.#n===false&&this.load();let i=r?.alwaysLast?"afterExit":"exit";return this.#r.on(i,e),()=>{this.#r.removeListener(i,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload();}}load(){if(!this.#n){this.#n=true,this.#r.count+=1;for(let e of Nt)try{let r=this.#t[e];r&&this.#e.on(e,r);}catch{}this.#e.emit=(e,...r)=>this.#f(e,...r),this.#e.reallyExit=e=>this.#i(e);}}unload(){this.#n&&(this.#n=false,Nt.forEach(e=>{let r=this.#t[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r);}catch{}}),this.#e.emit=this.#s,this.#e.reallyExit=this.#d,this.#r.count-=1);}#i(e){return Ti(this.#e)?(this.#e.exitCode=e||0,this.#r.emit("exit",this.#e.exitCode,null),this.#d.call(this.#e,this.#e.exitCode)):0}#f(e,...r){let i=this.#s;if(e==="exit"&&Ti(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let s=i.call(this.#e,e,...r);return this.#r.emit("exit",this.#e.exitCode,null),s}else return i.call(this.#e,e,...r)}},fa=globalThis.process,{onExit:ep}=K_(Ti(fa)?new da(fa):new ha);var tp=Ve__default.default.stderr.isTTY?Ve__default.default.stderr:Ve__default.default.stdout.isTTY?Ve__default.default.stdout:void 0,Y_=tp?Qf(()=>{ep(()=>{tp.write("\x1B[?25h");},{alwaysLast:true});}):()=>{},rp=Y_;var Ii=false,hr={};hr.show=(t=Ve__default.default.stderr)=>{t.isTTY&&(Ii=false,t.write("\x1B[?25h"));};hr.hide=(t=Ve__default.default.stderr)=>{t.isTTY&&(rp(),Ii=true,t.write("\x1B[?25l"));};hr.toggle=(t,e)=>{t!==void 0&&(Ii=t),Ii?hr.show(e):hr.hide(e);};var pa=hr;var Hr=ve(ma());function ga(){return Ve__default.default.platform!=="win32"?Ve__default.default.env.TERM!=="linux":!!Ve__default.default.env.CI||!!Ve__default.default.env.WT_SESSION||!!Ve__default.default.env.TERMINUS_SUBLIME||Ve__default.default.env.ConEmuTask==="{cmd::Cmder}"||Ve__default.default.env.TERM_PROGRAM==="Terminus-Sublime"||Ve__default.default.env.TERM_PROGRAM==="vscode"||Ve__default.default.env.TERM==="xterm-256color"||Ve__default.default.env.TERM==="alacritty"||Ve__default.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var z_={info:Ge.blue("\u2139"),success:Ge.green("\u2714"),warning:Ge.yellow("\u26A0"),error:Ge.red("\u2716")},X_={info:Ge.blue("i"),success:Ge.green("\u221A"),warning:Ge.yellow("\u203C"),error:Ge.red("\xD7")},Z_=ga()?z_:X_,Br=Z_;function Da({onlyFirst:t=false}={}){let r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(r,t?void 0:"g")}var Q_=Da();function Nr(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(Q_,"")}function ap(t){return t===161||t===164||t===167||t===168||t===170||t===173||t===174||t>=176&&t<=180||t>=182&&t<=186||t>=188&&t<=191||t===198||t===208||t===215||t===216||t>=222&&t<=225||t===230||t>=232&&t<=234||t===236||t===237||t===240||t===242||t===243||t>=247&&t<=250||t===252||t===254||t===257||t===273||t===275||t===283||t===294||t===295||t===299||t>=305&&t<=307||t===312||t>=319&&t<=322||t===324||t>=328&&t<=331||t===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>=713&&t<=715||t===717||t===720||t>=728&&t<=731||t===733||t===735||t>=768&&t<=879||t>=913&&t<=929||t>=931&&t<=937||t>=945&&t<=961||t>=963&&t<=969||t===1025||t>=1040&&t<=1103||t===1105||t===8208||t>=8211&&t<=8214||t===8216||t===8217||t===8220||t===8221||t>=8224&&t<=8226||t>=8228&&t<=8231||t===8240||t===8242||t===8243||t===8245||t===8251||t===8254||t===8308||t===8319||t>=8321&&t<=8324||t===8364||t===8451||t===8453||t===8457||t===8467||t===8470||t===8481||t===8482||t===8486||t===8491||t===8531||t===8532||t>=8539&&t<=8542||t>=8544&&t<=8555||t>=8560&&t<=8569||t===8585||t>=8592&&t<=8601||t===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>=8733&&t<=8736||t===8739||t===8741||t>=8743&&t<=8748||t===8750||t>=8756&&t<=8759||t===8764||t===8765||t===8776||t===8780||t===8786||t===8800||t===8801||t>=8804&&t<=8807||t===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>=9312&&t<=9449||t>=9451&&t<=9547||t>=9552&&t<=9587||t>=9600&&t<=9615||t>=9618&&t<=9621||t===9632||t===9633||t>=9635&&t<=9641||t===9650||t===9651||t===9654||t===9655||t===9660||t===9661||t===9664||t===9665||t>=9670&&t<=9672||t===9675||t>=9678&&t<=9681||t>=9698&&t<=9701||t===9711||t===9733||t===9734||t===9737||t===9742||t===9743||t===9756||t===9758||t===9792||t===9794||t===9824||t===9825||t>=9827&&t<=9829||t>=9831&&t<=9834||t===9836||t===9837||t===9839||t===9886||t===9887||t===9919||t>=9926&&t<=9933||t>=9935&&t<=9939||t>=9941&&t<=9953||t===9955||t===9960||t===9961||t>=9963&&t<=9969||t===9972||t>=9974&&t<=9977||t===9979||t===9980||t===9982||t===9983||t===10045||t>=10102&&t<=10111||t>=11094&&t<=11097||t>=12872&&t<=12879||t>=57344&&t<=63743||t>=65024&&t<=65039||t===65533||t>=127232&&t<=127242||t>=127248&&t<=127277||t>=127280&&t<=127337||t>=127344&&t<=127373||t===127375||t===127376||t>=127387&&t<=127404||t>=917760&&t<=917999||t>=983040&&t<=1048573||t>=1048576&&t<=1114109}function up(t){return t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510}function lp(t){return t>=4352&&t<=4447||t===8986||t===8987||t===9001||t===9002||t>=9193&&t<=9196||t===9200||t===9203||t===9725||t===9726||t===9748||t===9749||t>=9776&&t<=9783||t>=9800&&t<=9811||t===9855||t>=9866&&t<=9871||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>=10067&&t<=10069||t===10071||t>=10133&&t<=10135||t===10160||t===10175||t===11035||t===11036||t===11088||t===11093||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<=12773||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&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||t>=94192&&t<=94198||t>=94208&&t<=101589||t>=101631&&t<=101662||t>=101760&&t<=101874||t>=110576&&t<=110579||t>=110581&&t<=110587||t===110589||t===110590||t>=110592&&t<=110882||t===110898||t>=110928&&t<=110930||t===110933||t>=110948&&t<=110951||t>=110960&&t<=111355||t>=119552&&t<=119638||t>=119648&&t<=119670||t===126980||t===127183||t===127374||t>=127377&&t<=127386||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||t===127568||t===127569||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||t===127988||t>=127992&&t<=128062||t===128064||t>=128066&&t<=128252||t>=128255&&t<=128317||t>=128331&&t<=128334||t>=128336&&t<=128359||t===128378||t===128405||t===128406||t===128420||t>=128507&&t<=128591||t>=128640&&t<=128709||t===128716||t>=128720&&t<=128722||t>=128725&&t<=128728||t>=128732&&t<=128735||t===128747||t===128748||t>=128756&&t<=128764||t>=128992&&t<=129003||t===129008||t>=129292&&t<=129338||t>=129340&&t<=129349||t>=129351&&t<=129535||t>=129648&&t<=129660||t>=129664&&t<=129674||t>=129678&&t<=129734||t===129736||t>=129741&&t<=129756||t>=129759&&t<=129770||t>=129775&&t<=129784||t>=131072&&t<=196605||t>=196608&&t<=262141}function ew(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function cp(t,{ambiguousAsWide:e=false}={}){return ew(t),up(t)||lp(t)||e&&ap(t)?2:1}var hp=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\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?|[\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](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\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-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;var tw=new Intl.Segmenter,rw=/^\p{Default_Ignorable_Code_Point}$/u;function ba(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=true,countAnsiEscapeCodes:i=false}=e;if(i||(t=Nr(t)),t.length===0)return 0;let s=0,n={ambiguousAsWide:!r};for(let{segment:o}of tw.segment(t)){let a=o.codePointAt(0);if(!(a<=31||a>=127&&a<=159)&&!(a>=8203&&a<=8207||a===65279)&&!(a>=768&&a<=879||a>=6832&&a<=6911||a>=7616&&a<=7679||a>=8400&&a<=8447||a>=65056&&a<=65071)&&!(a>=55296&&a<=57343)&&!(a>=65024&&a<=65039)&&!rw.test(o)){if(hp().test(o)){s+=2;continue}s+=cp(a,n);}}return s}function va({stream:t=process.stdout}={}){return !!(t&&t.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}function ya(){let{env:t}=Ve__default.default,{TERM:e,TERM_PROGRAM:r}=t;return Ve__default.default.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var iw=3,Ca=class{#o=0;start(){this.#o++,this.#o===1&&this.#r();}stop(){if(this.#o<=0)throw new Error("`stop` called more times than `start`");this.#o--,this.#o===0&&this.#e();}#r(){Ve__default.default.platform==="win32"||!Ve__default.default.stdin.isTTY||(Ve__default.default.stdin.setRawMode(true),Ve__default.default.stdin.on("data",this.#s),Ve__default.default.stdin.resume());}#e(){Ve__default.default.stdin.isTTY&&(Ve__default.default.stdin.off("data",this.#s),Ve__default.default.stdin.pause(),Ve__default.default.stdin.setRawMode(false));}#s(e){e[0]===iw&&Ve__default.default.emit("SIGINT");}},sw=new Ca,_a=sw;ve(ma());var wa=class{#o=0;#r=false;#e=0;#s=-1;#d=0;#t;#n;#i;#f;#m;#l;#c;#h;#g;#a;#u;color;constructor(e){typeof e=="string"&&(e={text:e}),this.#t={color:"cyan",stream:Ve__default.default.stderr,discardStdin:true,hideCursor:true,...e},this.color=this.#t.color,this.spinner=this.#t.spinner,this.#m=this.#t.interval,this.#i=this.#t.stream,this.#l=typeof this.#t.isEnabled=="boolean"?this.#t.isEnabled:va({stream:this.#i}),this.#c=typeof this.#t.isSilent=="boolean"?this.#t.isSilent:false,this.text=this.#t.text,this.prefixText=this.#t.prefixText,this.suffixText=this.#t.suffixText,this.indent=this.#t.indent,Ve__default.default.env.NODE_ENV==="test"&&(this._stream=this.#i,this._isEnabled=this.#l,Object.defineProperty(this,"_linesToClear",{get(){return this.#o},set(r){this.#o=r;}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#s}}),Object.defineProperty(this,"_lineCount",{get(){return this.#e}}));}get indent(){return this.#h}set indent(e=0){if(!(e>=0&&Number.isInteger(e)))throw new Error("The `indent` option must be an integer from 0 and up");this.#h=e,this.#p();}get interval(){return this.#m??this.#n.interval??100}get spinner(){return this.#n}set spinner(e){if(this.#s=-1,this.#m=void 0,typeof e=="object"){if(e.frames===void 0)throw new Error("The given spinner must have a `frames` property");this.#n=e;}else if(!ya())this.#n=Hr.default.line;else if(e===void 0)this.#n=Hr.default.dots;else if(e!=="default"&&Hr.default[e])this.#n=Hr.default[e];else throw new Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#g}set text(e=""){this.#g=e,this.#p();}get prefixText(){return this.#a}set prefixText(e=""){this.#a=e,this.#p();}get suffixText(){return this.#u}set suffixText(e=""){this.#u=e,this.#p();}get isSpinning(){return this.#f!==void 0}#D(e=this.#a,r=" "){return typeof e=="string"&&e!==""?e+r:typeof e=="function"?e()+r:""}#b(e=this.#u,r=" "){return typeof e=="string"&&e!==""?r+e:typeof e=="function"?r+e():""}#p(){let e=this.#i.columns??80,r=this.#D(this.#a,"-"),i=this.#b(this.#u,"-"),s=" ".repeat(this.#h)+r+"--"+this.#g+"--"+i;this.#e=0;for(let n of Nr(s).split(`
946
- `))this.#e+=Math.max(1,Math.ceil(ba(n,{countAnsiEscapeCodes:true})/e));}get isEnabled(){return this.#l&&!this.#c}set isEnabled(e){if(typeof e!="boolean")throw new TypeError("The `isEnabled` option must be a boolean");this.#l=e;}get isSilent(){return this.#c}set isSilent(e){if(typeof e!="boolean")throw new TypeError("The `isSilent` option must be a boolean");this.#c=e;}frame(){let e=Date.now();(this.#s===-1||e-this.#d>=this.interval)&&(this.#s=++this.#s%this.#n.frames.length,this.#d=e);let{frames:r}=this.#n,i=r[this.#s];this.color&&(i=Ge[this.color](i));let s=typeof this.#a=="string"&&this.#a!==""?this.#a+" ":"",n=typeof this.text=="string"?" "+this.text:"",o=typeof this.#u=="string"&&this.#u!==""?" "+this.#u:"";return s+i+n+o}clear(){if(!this.#l||!this.#i.isTTY)return this;this.#i.cursorTo(0);for(let e=0;e<this.#o;e++)e>0&&this.#i.moveCursor(0,-1),this.#i.clearLine(1);return (this.#h||this.lastIndent!==this.#h)&&this.#i.cursorTo(this.#h),this.lastIndent=this.#h,this.#o=0,this}render(){return this.#c?this:(this.clear(),this.#i.write(this.frame()),this.#o=this.#e,this)}start(e){return e&&(this.text=e),this.#c?this:this.#l?this.isSpinning?this:(this.#t.hideCursor&&pa.hide(this.#i),this.#t.discardStdin&&Ve__default.default.stdin.isTTY&&(this.#r=true,_a.start()),this.render(),this.#f=setInterval(this.render.bind(this),this.interval),this):(this.text&&this.#i.write(`- ${this.text}
947
- `),this)}stop(){return this.#l?(clearInterval(this.#f),this.#f=void 0,this.#s=0,this.clear(),this.#t.hideCursor&&pa.show(this.#i),this.#t.discardStdin&&Ve__default.default.stdin.isTTY&&this.#r&&(_a.stop(),this.#r=false),this):this}succeed(e){return this.stopAndPersist({symbol:Br.success,text:e})}fail(e){return this.stopAndPersist({symbol:Br.error,text:e})}warn(e){return this.stopAndPersist({symbol:Br.warning,text:e})}info(e){return this.stopAndPersist({symbol:Br.info,text:e})}stopAndPersist(e={}){if(this.#c)return this;let r=e.prefixText??this.#a,i=this.#D(r," "),s=e.symbol??" ",n=e.text??this.text,a=typeof n=="string"?(s?" ":"")+n:"",u=e.suffixText??this.#u,h=this.#b(u," "),l=i+s+a+h+`
948
- `;return this.stop(),this.#i.write(l),this}};function xa(t){return new wa(t)}var M=(t,e)=>xa({text:t,isSilent:e?.silent});var We=["claude-code","cursor","opencode","codex","gemini","amp","ami","visual-edit"],N={"claude-code":"Claude Code",cursor:"Cursor",opencode:"OpenCode",codex:"Codex",gemini:"Gemini",amp:"Amp",ami:"Ami","visual-edit":"Visual Edit"},Ni=We.filter(t=>t!=="ami").map(t=>`@react-grab/${t}`),ow=`{process.env.NODE_ENV === "development" && (
949
- <Script
950
- src="//unpkg.com/react-grab/dist/index.global.js"
951
- crossOrigin="anonymous"
952
- strategy="beforeInteractive"
953
- />
954
- )}`,fp=t=>t==="none"?ow:`{process.env.NODE_ENV === "development" && (
955
- <Script
956
- src="//unpkg.com/react-grab/dist/index.global.js"
957
- crossOrigin="anonymous"
958
- strategy="beforeInteractive"
959
- />
960
- )}
961
- {process.env.NODE_ENV === "development" && (
962
- <Script
963
- src="//unpkg.com/@react-grab/${t}/dist/client.global.js"
964
- strategy="lazyOnload"
965
- />
966
- )}`,aw=`{process.env.NODE_ENV === "development" && (
967
- <Script
968
- src="//unpkg.com/react-grab/dist/index.global.js"
969
- crossOrigin="anonymous"
970
- strategy="beforeInteractive"
971
- />
972
- )}`,pp=t=>t==="none"?aw:`{process.env.NODE_ENV === "development" && (
973
- <Script
974
- src="//unpkg.com/react-grab/dist/index.global.js"
975
- crossOrigin="anonymous"
976
- strategy="beforeInteractive"
977
- />
978
- )}
979
- {process.env.NODE_ENV === "development" && (
980
- <Script
981
- src="//unpkg.com/@react-grab/${t}/dist/client.global.js"
982
- strategy="lazyOnload"
983
- />
984
- )}`,uw=`<script type="module">
985
- if (import.meta.env.DEV) {
986
- import("react-grab");
987
- }
988
- </script>`,mp=t=>t==="none"?uw:`<script type="module">
989
- if (import.meta.env.DEV) {
990
- import("react-grab");
991
- import("@react-grab/${t}/client");
992
- }
993
- </script>`,lw=`if (process.env.NODE_ENV === "development") {
994
- import("react-grab");
995
- }`,gp=t=>t==="none"?lw:`if (process.env.NODE_ENV === "development") {
996
- import("react-grab");
997
- import("@react-grab/${t}/client");
998
- }`,Hi='import Script from "next/script";';var dr=t=>[/["'`][^"'`]*react-grab/,/react-grab[^"'`]*["'`]/,/<[^>]*react-grab/i,/import[^;]*react-grab/i,/require[^)]*react-grab/i,/from\s+[^;]*react-grab/i,/src[^>]*react-grab/i,/href[^>]*react-grab/i].some(r=>r.test(t)),bp=t=>{let e=[kt.join(t,"app","layout.tsx"),kt.join(t,"app","layout.jsx"),kt.join(t,"src","app","layout.tsx"),kt.join(t,"src","app","layout.jsx")];for(let r of e)if(xf.existsSync(r))return r;return null},dw=t=>{let e=[kt.join(t,"instrumentation-client.ts"),kt.join(t,"instrumentation-client.js"),kt.join(t,"src","instrumentation-client.ts"),kt.join(t,"src","instrumentation-client.js")];for(let r of e)if(xf.existsSync(r))return r;return null},vp=t=>{let e=dw(t);if(!e)return false;let r=xf.readFileSync(e,"utf-8");return dr(r)},yp=t=>{let e=[kt.join(t,"pages","_document.tsx"),kt.join(t,"pages","_document.jsx"),kt.join(t,"src","pages","_document.tsx"),kt.join(t,"src","pages","_document.jsx")];for(let r of e)if(xf.existsSync(r))return r;return null},Cp=t=>{let e=[kt.join(t,"index.html"),kt.join(t,"public","index.html")];for(let r of e)if(xf.existsSync(r))return r;return null},_p=t=>{let e=[kt.join(t,"src","index.tsx"),kt.join(t,"src","index.jsx"),kt.join(t,"src","index.ts"),kt.join(t,"src","index.js"),kt.join(t,"src","main.tsx"),kt.join(t,"src","main.jsx"),kt.join(t,"src","main.ts"),kt.join(t,"src","main.js")];for(let r of e)if(xf.existsSync(r))return r;return null},wp=(t,e,r)=>{if(e==="none")return {success:true,filePath:r,message:"React Grab is already configured",noChanges:true};let i=`@react-grab/${e}`;if(t.includes(i))return {success:true,filePath:r,message:`Agent ${e} is already configured`,noChanges:true};let s=`{process.env.NODE_ENV === "development" && (
999
- <Script
1000
- src="//unpkg.com/${i}/dist/client.global.js"
1001
- strategy="lazyOnload"
1002
- />
1003
- )}`,n=t.match(/\{process\.env\.NODE_ENV\s*===\s*["']development["']\s*&&\s*\(\s*<Script[^>]*react-grab[^>]*\/>\s*\)\}/is);if(n){let a=t.replace(n[0],`${n[0]}
1004
- ${s}`);return {success:true,filePath:r,message:`Add ${e} agent`,originalContent:t,newContent:a}}let o=t.match(/<Script[^>]*react-grab[^>]*\/>/i);if(o){let a=t.replace(o[0],`${o[0]}
1005
- <Script src="//unpkg.com/${i}/dist/client.global.js" strategy="lazyOnload" />`);return {success:true,filePath:r,message:`Add ${e} agent`,originalContent:t,newContent:a}}return {success:false,filePath:r,message:"Could not find React Grab script to add agent after"}},fw=(t,e,r)=>{if(e==="none")return {success:true,filePath:r,message:"React Grab is already configured",noChanges:true};let i=`@react-grab/${e}`;if(t.includes(i))return {success:true,filePath:r,message:`Agent ${e} is already configured`,noChanges:true};let s=`import("${i}/client");`,n=t.match(/import\s*\(\s*["']react-grab["']\s*\);?/);if(n){let o=n[0],a=o.endsWith(";"),u=t.replace(o,`${a?o.slice(0,-1):o};
1006
- ${s}`);return {success:true,filePath:r,message:`Add ${e} agent`,originalContent:t,newContent:u}}return {success:false,filePath:r,message:"Could not find React Grab import to add agent after"}},pw=(t,e,r)=>{if(e==="none")return {success:true,filePath:r,message:"React Grab is already configured",noChanges:true};let i=`@react-grab/${e}`;if(t.includes(i))return {success:true,filePath:r,message:`Agent ${e} is already configured`,noChanges:true};let s=`import("${i}/client");`,n=t.match(/import\s*\(\s*["']react-grab["']\s*\);?/);if(n){let o=n[0],a=o.endsWith(";"),u=t.replace(o,`${a?o.slice(0,-1):o};
1007
- ${s}`);return {success:true,filePath:r,message:`Add ${e} agent`,originalContent:t,newContent:u}}return {success:false,filePath:r,message:"Could not find React Grab import to add agent after"}},mw=(t,e,r)=>{let i=bp(t);if(!i)return {success:false,filePath:"",message:"Could not find app/layout.tsx or app/layout.jsx"};let s=xf.readFileSync(i,"utf-8"),n=s,o=dr(s),a=vp(t);if(o&&r)return wp(s,e,i);if(o||a)return {success:true,filePath:i,message:"React Grab is already installed"+(a?" in instrumentation-client":" in this file"),noChanges:true};if(!n.includes('import Script from "next/script"')){let l=n.match(/^import .+ from ['"].+['"];?\s*$/m);l?n=n.replace(l[0],`${l[0]}
1008
- ${Hi}`):n=`${Hi}
1009
-
1010
- ${n}`;}let u=fp(e),h=n.match(/<head[^>]*>/);if(h)n=n.replace(h[0],`${h[0]}
1011
- ${u}`);else {let l=n.match(/<html[^>]*>/);l&&(n=n.replace(l[0],`${l[0]}
1012
- <head>
1013
- ${u}
1014
- </head>`));}return {success:true,filePath:i,message:"Add React Grab"+(e!=="none"?` with ${e} agent`:""),originalContent:s,newContent:n}},gw=(t,e,r)=>{let i=yp(t);if(!i)return {success:false,filePath:"",message:`Could not find pages/_document.tsx or pages/_document.jsx.
1015
-
1016
- To set up React Grab with Pages Router, create pages/_document.tsx with:
1017
-
1018
- import { Html, Head, Main, NextScript } from "next/document";
1019
- import Script from "next/script";
1020
-
1021
- export default function Document() {
1022
- return (
1023
- <Html>
1024
- <Head>
1025
- {process.env.NODE_ENV === "development" && (
1026
- <Script src="//unpkg.com/react-grab/dist/index.global.js" strategy="beforeInteractive" />
1027
- )}
1028
- </Head>
1029
- <body>
1030
- <Main />
1031
- <NextScript />
1032
- </body>
1033
- </Html>
1034
- );
1035
- }`};let s=xf.readFileSync(i,"utf-8"),n=s,o=dr(s),a=vp(t);if(o&&r)return wp(s,e,i);if(o||a)return {success:true,filePath:i,message:"React Grab is already installed"+(a?" in instrumentation-client":" in this file"),noChanges:true};if(!n.includes('import Script from "next/script"')){let l=n.match(/^import .+ from ['"].+['"];?\s*$/m);l&&(n=n.replace(l[0],`${l[0]}
1036
- ${Hi}`));}let u=pp(e),h=n.match(/<Head[^>]*>/);return h&&(n=n.replace(h[0],`${h[0]}
1037
- ${u}`)),{success:true,filePath:i,message:"Add React Grab"+(e!=="none"?` with ${e} agent`:""),originalContent:s,newContent:n}},Dw=(t,e,r)=>{let i=Cp(t);if(!i)return {success:false,filePath:"",message:"Could not find index.html"};let s=xf.readFileSync(i,"utf-8"),n=s,o=dr(s);if(o&&r)return fw(s,e,i);if(o)return {success:true,filePath:i,message:"React Grab is already installed in this file",noChanges:true};let a=mp(e),u=n.match(/<head[^>]*>/i);return u&&(n=n.replace(u[0],`${u[0]}
1038
- ${a}`)),{success:true,filePath:i,message:"Add React Grab"+(e!=="none"?` with ${e} agent`:""),originalContent:s,newContent:n}},bw=(t,e,r)=>{let i=_p(t);if(!i)return {success:false,filePath:"",message:"Could not find entry file (src/index.tsx, src/main.tsx, etc.)"};let s=xf.readFileSync(i,"utf-8"),n=dr(s);if(n&&r)return pw(s,e,i);if(n)return {success:true,filePath:i,message:"React Grab is already installed in this file",noChanges:true};let a=`${gp(e)}
1039
-
1040
- ${s}`;return {success:true,filePath:i,message:"Add React Grab"+(e!=="none"?` with ${e} agent`:""),originalContent:s,newContent:a}},qr=(t,e,r,i,s=false)=>{switch(e){case "next":return r==="app"?mw(t,i,s):gw(t,i,s);case "vite":return Dw(t,i,s);case "webpack":return bw(t,i,s);default:return {success:false,filePath:"",message:`Unknown framework: ${e}. Please add React Grab manually.`}}},xp=t=>{try{return xf.accessSync(t,xf.constants.W_OK),!0}catch{return false}},Pe=t=>{if(t.success&&t.newContent&&t.filePath){if(!xp(t.filePath))return {success:false,error:`Cannot write to ${t.filePath}. Check file permissions.`};try{return xf.writeFileSync(t.filePath,t.newContent),{success:!0}}catch(e){return {success:false,error:`Failed to write to ${t.filePath}: ${e instanceof Error?e.message:"Unknown error"}`}}}return {success:true}};var vw=t=>{switch(t){case "bun":return "bunx";case "pnpm":return "pnpm dlx";case "yarn":return "npx";case "npm":default:return "npx"}},Fp={"claude-code":"@react-grab/claude-code@latest",cursor:"@react-grab/cursor@latest",opencode:"@react-grab/opencode@latest",codex:"@react-grab/codex@latest",gemini:"@react-grab/gemini@latest",amp:"@react-grab/amp@latest"},yw=(t,e)=>{let r=Fp[t];return r?`${vw(e)} ${r} &&`:null},Fa=t=>{let e=Fp[t];return e?[`npx ${e} &&`,`bunx ${e} &&`,`pnpm dlx ${e} &&`,`yarn dlx ${e} &&`]:[]},Lr=(t,e,r,i="npm")=>{if(e==="none"||e==="visual-edit")return {success:true,filePath:"",message:e==="visual-edit"?"Visual Edit does not require package.json modification":"No agent selected, skipping package.json modification",noChanges:true};let s=kt.join(t,"package.json");if(!xf.existsSync(s))return {success:false,filePath:"",message:"Could not find package.json"};let n=xf.readFileSync(s,"utf-8"),o=yw(e,i);if(!o)return {success:false,filePath:s,message:`Unknown agent: ${e}`};if(Fa(e).some(h=>n.includes(h)))return {success:true,filePath:s,message:`Agent ${e} dev script is already configured`,noChanges:true};try{let h=JSON.parse(n),l="dev";if(!h.scripts?.dev){let f=Object.keys(h.scripts||{}).filter(m=>m.startsWith("dev"));if(f.length>0)l=f[0];else return {success:!0,filePath:s,message:"No dev script found in package.json",noChanges:!0,warning:`Could not inject agent into package.json (no dev script found).
1041
- Run this command manually before starting your dev server:
1042
- ${o} <your dev command>`}}let c=h.scripts[l];for(let f of r)if(Fa(f).some(D=>c.includes(D)))return {success:!0,filePath:s,message:`Agent ${f} is already in ${l} script`,noChanges:!0};h.scripts[l]=`${o} ${c}`;let d=JSON.stringify(h,null,2)+`
1043
- `;return {success:!0,filePath:s,message:`Add ${e} server to ${l} script`,originalContent:n,newContent:d}}catch{return {success:false,filePath:s,message:"Failed to parse package.json"}}},Ue=t=>{if(t.success&&t.newContent&&t.filePath){if(!xp(t.filePath))return {success:false,error:`Cannot write to ${t.filePath}. Check file permissions.`};try{return xf.writeFileSync(t.filePath,t.newContent),{success:!0}}catch(e){return {success:false,error:`Failed to write to ${t.filePath}: ${e instanceof Error?e.message:"Unknown error"}`}}}return {success:true}},Cw=t=>{let e=[];if(t.activationKey){let r=[];t.activationKey.key&&r.push(`key: "${t.activationKey.key}"`),t.activationKey.metaKey&&r.push("metaKey: true"),t.activationKey.ctrlKey&&r.push("ctrlKey: true"),t.activationKey.shiftKey&&r.push("shiftKey: true"),t.activationKey.altKey&&r.push("altKey: true"),r.length>0&&e.push(`activationKey: { ${r.join(", ")} }`);}return t.activationMode&&e.push(`activationMode: "${t.activationMode}"`),t.keyHoldDuration!==void 0&&e.push(`keyHoldDuration: ${t.keyHoldDuration}`),t.allowActivationInsideInput!==void 0&&e.push(`allowActivationInsideInput: ${t.allowActivationInsideInput}`),t.maxContextLines!==void 0&&e.push(`maxContextLines: ${t.maxContextLines}`),`{ ${e.join(", ")} }`},Ep=t=>{let e={};if(t.activationKey){let r={};t.activationKey.key&&(r.key=t.activationKey.key),t.activationKey.metaKey&&(r.metaKey=true),t.activationKey.ctrlKey&&(r.ctrlKey=true),t.activationKey.shiftKey&&(r.shiftKey=true),t.activationKey.altKey&&(r.altKey=true),Object.keys(r).length>0&&(e.activationKey=r);}return t.activationMode&&(e.activationMode=t.activationMode),t.keyHoldDuration!==void 0&&(e.keyHoldDuration=t.keyHoldDuration),t.allowActivationInsideInput!==void 0&&(e.allowActivationInsideInput=t.allowActivationInsideInput),t.maxContextLines!==void 0&&(e.maxContextLines=t.maxContextLines),JSON.stringify(e)},Ap=(t,e,r)=>{switch(e){case "next":return r==="app"?bp(t):yp(t);case "vite":return Cp(t);case "webpack":return _p(t);default:return null}},_w=(t,e,r)=>{let i=t.match(/(<Script[^>]*react-grab[^>]*)(\/?>)/is);if(!i)return {success:false,filePath:r,message:"Could not find React Grab Script tag"};let s=i[0],n=i[1],o=i[2],a=s.match(/data-options=\{JSON\.stringify\([^)]+\)\}/),u=`data-options={JSON.stringify(
1044
- ${Cw(e)}
1045
- )}`,h;a?h=s.replace(a[0],u):h=`${n}
1046
- ${u}
1047
- ${o}`;let l=t.replace(s,h);return {success:true,filePath:r,message:"Update React Grab options",originalContent:t,newContent:l}},ww=(t,e,r)=>{let i=t.match(/import\s*\(\s*["']react-grab["']\s*\)/);if(!i)return {success:false,filePath:r,message:"Could not find React Grab import"};let n=`import("react-grab").then((m) => m.init(${Ep(e)}))`,o=t.replace(i[0],n);return {success:true,filePath:r,message:"Update React Grab options",originalContent:t,newContent:o}},xw=(t,e,r)=>{let i=t.match(/import\s*\(\s*["']react-grab["']\s*\)/);if(!i)return {success:false,filePath:r,message:"Could not find React Grab import"};let n=`import("react-grab").then((m) => m.init(${Ep(e)}))`,o=t.replace(i[0],n);return {success:true,filePath:r,message:"Update React Grab options",originalContent:t,newContent:o}},qi=(t,e,r,i)=>{let s=Ap(t,e,r);if(!s)return {success:false,filePath:"",message:"Could not find file containing React Grab configuration"};let n=xf.readFileSync(s,"utf-8");if(!dr(n))return {success:false,filePath:s,message:"Could not find React Grab code in the file"};switch(e){case "next":return _w(n,i,s);case "vite":return ww(n,i,s);case "webpack":return xw(n,i,s);default:return {success:false,filePath:s,message:`Unknown framework: ${e}`}}},Li=t=>Pe(t),Fw=(t,e,r)=>{let i=`@react-grab/${e}`;if(!t.includes(i))return {success:true,filePath:r,message:`Agent ${e} is not configured in this file`,noChanges:true};let s=new RegExp(`\\s*\\{process\\.env\\.NODE_ENV === "development" && \\(\\s*<Script[^>]*${i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}[^>]*\\/>\\s*\\)\\}`,"gs"),n=new RegExp(`\\s*<Script[^>]*${i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}[^>]*\\/>`,"gi"),o=t.replace(s,"");return o===t&&(o=t.replace(n,"")),o===t?{success:false,filePath:r,message:`Could not find agent ${e} script to remove`}:{success:true,filePath:r,message:`Remove ${e} agent`,originalContent:t,newContent:o}},Ew=(t,e,r)=>{let i=`@react-grab/${e}`;if(!t.includes(i))return {success:true,filePath:r,message:`Agent ${e} is not configured in this file`,noChanges:true};let s=new RegExp(`\\s*import\\s*\\(\\s*["']${i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}/client["']\\s*\\);?`,"g"),n=t.replace(s,"");return n===t?{success:false,filePath:r,message:`Could not find agent ${e} import to remove`}:{success:true,filePath:r,message:`Remove ${e} agent`,originalContent:t,newContent:n}},Aw=(t,e,r)=>{let i=`@react-grab/${e}`;if(!t.includes(i))return {success:true,filePath:r,message:`Agent ${e} is not configured in this file`,noChanges:true};let s=new RegExp(`\\s*import\\s*\\(\\s*["']${i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}/client["']\\s*\\);?`,"g"),n=t.replace(s,"");return n===t?{success:false,filePath:r,message:`Could not find agent ${e} import to remove`}:{success:true,filePath:r,message:`Remove ${e} agent`,originalContent:t,newContent:n}},qt=(t,e,r,i)=>{let s=Ap(t,e,r);if(!s)return {success:true,filePath:"",message:"Could not find file containing React Grab configuration",noChanges:true};let n=xf.readFileSync(s,"utf-8");switch(e){case "next":return Fw(n,i,s);case "vite":return Ew(n,i,s);case "webpack":return Aw(n,i,s);default:return {success:false,filePath:s,message:`Unknown framework: ${e}`}}},Lt=(t,e)=>{let r=kt.join(t,"package.json");if(!xf.existsSync(r))return {success:true,filePath:"",message:"Could not find package.json",noChanges:true};let i=xf.readFileSync(r,"utf-8"),s=Fa(e);if(s.length===0)return {success:true,filePath:r,message:`Unknown agent: ${e}`,noChanges:true};if(!s.some(o=>i.includes(o)))return {success:true,filePath:r,message:`Agent ${e} dev script is not configured`,noChanges:true};try{let o=JSON.parse(i);for(let u of Object.keys(o.scripts||{})){let h=o.scripts[u];if(typeof h=="string"){for(let l of s)h.includes(l)&&(h=h.replace(l+" ","").replace(l,""));o.scripts[u]=h;}}let a=JSON.stringify(o,null,2)+`
1048
- `;return {success:!0,filePath:r,message:`Remove ${e} server from dev script`,originalContent:i,newContent:a}}catch{return {success:false,filePath:r,message:"Failed to parse package.json"}}};var $w="0.0.98",$p=new Re().name("add").description("add an agent integration").argument("[agent]","agent to add (claude-code, cursor, opencode, codex, gemini, amp, visual-edit)").option("-y, --yes","skip confirmation prompts",false).option("-c, --cwd <cwd>","working directory (defaults to current directory)",process.cwd()).action(async(t,e)=>{console.log(`${ji.default.magenta("\u273F")} ${ji.default.bold("React Grab")} ${ji.default.gray($w)}`),console.log();try{let r=e.cwd,i=e.yes,s=M("Preflight checks.").start(),n=await mt(r);n.hasReactGrab||(s.fail("React Grab is not installed."),p.break(),p.error(`Run ${k.info("react-grab init")} first to install React Grab.`),p.break(),process.exit(1)),s.succeed();let o=We.filter(g=>!n.installedAgents.includes(g));o.length===0&&(p.break(),p.success("All agent integrations are already installed."),p.break(),process.exit(0));let a,u=[];if(t){if(We.includes(t)||(p.break(),p.error(`Invalid agent: ${t}`),p.error("Available agents: claude-code, cursor, opencode, codex, gemini, amp, visual-edit"),p.break(),process.exit(1)),n.installedAgents.includes(t)&&(p.break(),p.warn(`${N[t]} is already installed.`),p.break(),process.exit(0)),a=t,n.installedAgents.length>0&&!i){let g=n.installedAgents.map(x=>N[x]||x).join(", ");p.break(),p.warn(`${g} is already installed.`);let{action:D}=await(0,jr.default)({type:"select",name:"action",message:"How would you like to proceed?",choices:[{title:`Replace with ${N[a]}`,value:"replace"},{title:`Add ${N[a]} alongside existing`,value:"add"},{title:"Cancel",value:"cancel"}]});(!D||D==="cancel")&&(p.break(),p.log("Changes cancelled."),p.break(),process.exit(0)),D==="replace"&&(u=[...n.installedAgents]);}}else if(i)p.break(),p.error("Please specify an agent to add."),p.error("Available agents: "+o.join(", ")),p.break(),process.exit(1);else {if(p.break(),n.installedAgents.length>0){let D=n.installedAgents.map(x=>N[x]||x).join(", ");p.warn(`Currently installed: ${D}`),p.break();}let{agent:g}=await(0,jr.default)({type:"select",name:"agent",message:`Which ${k.info("agent integration")} would you like to add?`,choices:o.map(D=>({title:N[D],value:D}))});if(g||(p.break(),process.exit(1)),a=g,n.installedAgents.length>0){let D=n.installedAgents.map(b=>N[b]||b).join(", "),{action:x}=await(0,jr.default)({type:"select",name:"action",message:"How would you like to proceed?",choices:[{title:`Replace ${D} with ${N[a]}`,value:"replace"},{title:`Add ${N[a]} alongside existing`,value:"add"},{title:"Cancel",value:"cancel"}]});(!x||x==="cancel")&&(p.break(),p.log("Changes cancelled."),p.break(),process.exit(0)),x==="replace"&&(u=[...n.installedAgents]);}}if(u.length>0){for(let g of u){let D=qt(n.projectRoot,n.framework,n.nextRouterType,g),x=Lt(n.projectRoot,g),b=Bt(g);if(b.length>0){let v=M(`Removing ${b.join(", ")}.`).start();try{Mt(b,n.packageManager,n.projectRoot),v.succeed();}catch(C){v.fail(),ge(C);}}if(D.success&&!D.noChanges&&D.newContent){let v=M(`Removing ${N[g]||g} from ${D.filePath}.`).start(),C=Pe(D);C.success||(v.fail(),p.break(),p.error(C.error||"Failed to write file."),p.break(),process.exit(1)),v.succeed();}if(x.success&&!x.noChanges&&x.newContent){let v=M(`Removing ${N[g]||g} from ${x.filePath}.`).start(),C=Ue(x);C.success||(v.fail(),p.break(),p.error(C.error||"Failed to write file."),p.break(),process.exit(1)),v.succeed();}}n.installedAgents=n.installedAgents.filter(g=>!u.includes(g));}M(`Adding ${N[a]}.`).start().succeed();let l=qr(n.projectRoot,n.framework,n.nextRouterType,a,!0),c=Lr(n.projectRoot,a,n.installedAgents,n.packageManager);l.success||(p.break(),p.error(l.message),p.break(),process.exit(1));let d=!l.noChanges&&l.originalContent&&l.newContent,f=c.success&&!c.noChanges&&c.originalContent&&c.newContent;if((d||f)&&(p.break(),d&&we(l.filePath,l.originalContent,l.newContent),f&&(d&&p.break(),we(c.filePath,c.originalContent,c.newContent)),!i&&u.length===0)){p.break();let{proceed:g}=await(0,jr.default)({type:"confirm",name:"proceed",message:"Apply these changes?",initial:!0});g||(p.break(),p.log("Changes cancelled."),p.break(),process.exit(0));}let m=ur(a,!1);if(m.length>0){let g=M(`Installing ${m.join(", ")}.`).start();try{ar(m,n.packageManager,n.projectRoot),g.succeed();}catch(D){g.fail(),ge(D);}}if(d){let g=M(`Applying changes to ${l.filePath}.`).start(),D=Pe(l);D.success||(g.fail(),p.break(),p.error(D.error||"Failed to write file."),p.break(),process.exit(1)),g.succeed();}if(f){let g=M(`Applying changes to ${c.filePath}.`).start(),D=Ue(c);D.success||(g.fail(),p.break(),p.error(D.error||"Failed to write file."),p.break(),process.exit(1)),g.succeed();}p.break(),p.log(`${k.success("Success!")} ${N[a]} has been added.`),c.warning?p.warn(c.warning):p.log("Make sure to start the agent server before using it."),p.break();}catch(r){ge(r);}});var Vi=ve(Ot()),Dt=ve(ir());var Ow="0.0.98",Gi={metaKey:process.platform==="darwin"?"\u2318 Command":"\u229E Windows",ctrlKey:"Ctrl",shiftKey:"Shift",altKey:process.platform==="darwin"?"\u2325 Option":"Alt"},Sw=t=>{if(!t)return "Default (Option/Alt)";let e=[];return t.metaKey&&e.push(process.platform==="darwin"?"\u2318":"Win"),t.ctrlKey&&e.push("Ctrl"),t.shiftKey&&e.push("Shift"),t.altKey&&e.push(process.platform==="darwin"?"\u2325":"Alt"),t.key&&e.push(t.key.toUpperCase()),e.length>0?e.join(" + "):"Default (Option/Alt)"},Op=new Re().name("configure").alias("config").description("configure React Grab options").option("-y, --yes","skip confirmation prompts",false).option("-c, --cwd <cwd>","working directory (defaults to current directory)",process.cwd()).action(async t=>{console.log(`${Vi.default.magenta("\u273F")} ${Vi.default.bold("React Grab")} ${Vi.default.gray(Ow)}`),console.log();try{let e=t.cwd,r=t.yes,i=M("Preflight checks.").start(),s=await mt(e);s.hasReactGrab||(i.fail("React Grab is not installed."),p.break(),p.error(`Run ${k.info("react-grab init")} first to install React Grab.`),p.break(),process.exit(1)),i.succeed(),r&&(p.break(),p.error("Configure command requires interactive mode."),p.error("Remove the --yes flag to use interactive prompts."),p.break(),process.exit(1)),p.break(),p.log(`Configure ${k.info("React Grab")} options:`),p.break();let n={},{wantActivationKey:o}=await(0,Dt.default)({type:"confirm",name:"wantActivationKey",message:`Configure ${k.info("activation key")}?`,initial:!1});if(o===void 0&&(p.break(),process.exit(1)),o){let{key:d}=await(0,Dt.default)({type:"text",name:"key",message:"Enter the activation key (e.g., g, k, space):",initial:""});d===void 0&&(p.break(),process.exit(1));let{modifiers:f}=await(0,Dt.default)({type:"multiselect",name:"modifiers",message:"Select modifier keys (space to select, enter to confirm):",choices:[{title:Gi.metaKey,value:"metaKey"},{title:Gi.ctrlKey,value:"ctrlKey"},{title:Gi.shiftKey,value:"shiftKey"},{title:Gi.altKey,value:"altKey",selected:!0}],hint:"- Space to select, Enter to confirm"});f===void 0&&(p.break(),process.exit(1)),n.activationKey={...d&&{key:d.toLowerCase()},...f.includes("metaKey")&&{metaKey:!0},...f.includes("ctrlKey")&&{ctrlKey:!0},...f.includes("shiftKey")&&{shiftKey:!0},...f.includes("altKey")&&{altKey:!0}},p.log(` Activation key: ${k.info(Sw(n.activationKey))}`);}let{activationMode:a}=await(0,Dt.default)({type:"select",name:"activationMode",message:`Select ${k.info("activation mode")}:`,choices:[{title:"Toggle (press to activate/deactivate)",value:"toggle"},{title:"Hold (hold key to keep active)",value:"hold"}],initial:0});if(a===void 0&&(p.break(),process.exit(1)),n.activationMode=a,a==="hold"){let{keyHoldDuration:d}=await(0,Dt.default)({type:"number",name:"keyHoldDuration",message:`Enter ${k.info("key hold duration")} in milliseconds:`,initial:150,min:0,max:2e3});d===void 0&&(p.break(),process.exit(1)),n.keyHoldDuration=d;}let{allowActivationInsideInput:u}=await(0,Dt.default)({type:"confirm",name:"allowActivationInsideInput",message:`Allow activation ${k.info("inside input fields")}?`,initial:!0});u===void 0&&(p.break(),process.exit(1)),n.allowActivationInsideInput=u;let{maxContextLines:h}=await(0,Dt.default)({type:"number",name:"maxContextLines",message:`Enter ${k.info("max context lines")} to include:`,initial:3,min:0,max:50});h===void 0&&(p.break(),process.exit(1)),n.maxContextLines=h;let l=qi(s.projectRoot,s.framework,s.nextRouterType,n);if(l.success||(p.break(),p.error(l.message),p.break(),process.exit(1)),!l.noChanges&&l.originalContent&&l.newContent){p.break(),we(l.filePath,l.originalContent,l.newContent),p.break();let{proceed:d}=await(0,Dt.default)({type:"confirm",name:"proceed",message:"Apply these changes?",initial:!0});d||(p.break(),p.log("Changes cancelled."),p.break(),process.exit(0));let f=M(`Applying changes to ${l.filePath}.`).start(),m=Li(l);m.success||(f.fail(),p.break(),p.error(m.error||"Failed to write file."),p.break(),process.exit(1)),f.succeed();}else p.break(),p.log("No changes needed.");p.break(),p.log(`${k.success("Success!")} React Grab options have been configured.`),p.break();}catch(e){ge(e);}});var Ki=ve(Ot()),de=ve(ir());var Rp="0.0.98",Rw="https://react-grab.com/api/report-cli",Wi="https://github.com/aidenybai/react-grab",Sp=async(t,e,r)=>{try{await fetch(Rw,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:t,version:Rp,config:e,error:r?{message:r.message,stack:r.stack}:void 0,timestamp:new Date().toISOString()})}).catch(()=>{});}catch{}},Ea={next:"Next.js",vite:"Vite",webpack:"Webpack",unknown:"Unknown"},Tw={npm:"npm",yarn:"Yarn",pnpm:"pnpm",bun:"Bun"},Pw={remix:"Remix",astro:"Astro",sveltekit:"SvelteKit",gatsby:"Gatsby"},Ui={metaKey:process.platform==="darwin"?"\u2318 Command":"\u229E Windows",ctrlKey:"Ctrl",shiftKey:"Shift",altKey:process.platform==="darwin"?"\u2325 Option":"Alt"},kw=t=>{if(!t)return "Default (Option/Alt)";let e=[];return t.metaKey&&e.push(process.platform==="darwin"?"\u2318":"Win"),t.ctrlKey&&e.push("Ctrl"),t.shiftKey&&e.push("Shift"),t.altKey&&e.push(process.platform==="darwin"?"\u2325":"Alt"),t.key&&e.push(t.key.toUpperCase()),e.length>0?e.join(" + "):"Default (Option/Alt)"},Tp=new Re().name("init").description("initialize React Grab in your project").option("-y, --yes","skip confirmation prompts",false).option("-f, --force","force overwrite existing config",false).option("-a, --agent <agent>","agent integration (claude-code, cursor, opencode, codex, gemini, amp, visual-edit)").option("--skip-install","skip package installation",false).option("-c, --cwd <cwd>","working directory (defaults to current directory)",process.cwd()).action(async t=>{console.log(`${Ki.default.magenta("\u273F")} ${Ki.default.bold("React Grab")} ${Ki.default.gray(Rp)}`),console.log();try{let e=t.cwd,r=t.yes,i=M("Preflight checks.").start(),s=await mt(e);if(s.hasReactGrab&&!t.force){i.succeed(),r&&(p.break(),p.warn("React Grab is already installed."),p.log(`Use ${k.info("--force")} to reconfigure, or remove ${k.info("--yes")} for interactive mode.`),p.break(),process.exit(0)),p.break(),p.success("React Grab is already installed."),p.break();let v=We.filter(O=>!s.installedAgents.includes(O));if(s.installedAgents.length>0){let O=s.installedAgents.map(P=>N[P]||P).join(", ");p.log(`Currently installed agents: ${k.info(O)}`),p.break();}let C=!1;if(v.length>0){let{wantAddAgent:O}=await(0,de.default)({type:"confirm",name:"wantAddAgent",message:`Would you like to add an ${k.info("agent integration")}?`,initial:!1});if(O===void 0&&(p.break(),process.exit(1)),O){let{agent:P}=await(0,de.default)({type:"select",name:"agent",message:`Which ${k.info("agent integration")} would you like to add?`,choices:v.map(U=>({title:N[U],value:U}))});P===void 0&&(p.break(),process.exit(1));let A=P,R=[];if(s.installedAgents.length>0){let U=s.installedAgents.map(B=>N[B]||B).join(", "),{action:F}=await(0,de.default)({type:"select",name:"action",message:"How would you like to proceed?",choices:[{title:`Replace ${U} with ${N[A]}`,value:"replace"},{title:`Add ${N[A]} alongside existing`,value:"add"},{title:"Cancel",value:"cancel"}]});if(!F||F==="cancel")p.break(),p.log("Agent addition cancelled.");else {if(F==="replace"&&(R=[...s.installedAgents]),R.length>0){for(let _ of R){let V=qt(s.projectRoot,s.framework,s.nextRouterType,_),T=Lt(s.projectRoot,_),ae=Bt(_);if(ae.length>0){let ce=M(`Removing ${ae.join(", ")}.`).start();try{Mt(ae,s.packageManager,s.projectRoot),ce.succeed();}catch(ue){ce.fail(),ge(ue);}}if(V.success&&!V.noChanges&&V.newContent){let ce=M(`Removing ${N[_]||_} from ${V.filePath}.`).start(),ue=Pe(V);ue.success||(ce.fail(),p.break(),p.error(ue.error||"Failed to write file."),p.break(),process.exit(1)),ce.succeed();}if(T.success&&!T.noChanges&&T.newContent){let ce=M(`Removing ${N[_]||_} from ${T.filePath}.`).start(),ue=Ue(T);ue.success||(ce.fail(),p.break(),p.error(ue.error||"Failed to write file."),p.break(),process.exit(1)),ce.succeed();}}s.installedAgents=s.installedAgents.filter(_=>!R.includes(_));}let B=qr(s.projectRoot,s.framework,s.nextRouterType,A,!0),I=Lr(s.projectRoot,A,s.installedAgents,s.packageManager);B.success||(p.break(),p.error(B.message),p.break(),process.exit(1));let re=!B.noChanges&&B.originalContent&&B.newContent,w=I.success&&!I.noChanges&&I.originalContent&&I.newContent;if(re||w)if(p.break(),re&&we(B.filePath,B.originalContent,B.newContent),w&&(re&&p.break(),we(I.filePath,I.originalContent,I.newContent)),R.length===0){p.break();let{proceed:_}=await(0,de.default)({type:"confirm",name:"proceed",message:"Apply these changes?",initial:!0});if(!_)p.break(),p.log("Agent addition cancelled.");else {let V=ur(A,!1);if(V.length>0){let T=M(`Installing ${V.join(", ")}.`).start();try{ar(V,s.packageManager,s.projectRoot),T.succeed();}catch(ae){T.fail(),ge(ae);}}if(re){let T=M(`Applying changes to ${B.filePath}.`).start(),ae=Pe(B);ae.success||(T.fail(),p.break(),p.error(ae.error||"Failed to write file."),p.break(),process.exit(1)),T.succeed();}if(w){let T=M(`Applying changes to ${I.filePath}.`).start(),ae=Ue(I);ae.success||(T.fail(),p.break(),p.error(ae.error||"Failed to write file."),p.break(),process.exit(1)),T.succeed();}C=!0,p.break(),p.success(`${N[A]} has been added.`);}}else {let _=ur(A,!1);if(_.length>0){let V=M(`Installing ${_.join(", ")}.`).start();try{ar(_,s.packageManager,s.projectRoot),V.succeed();}catch(T){V.fail(),ge(T);}}if(re){let V=M(`Applying changes to ${B.filePath}.`).start(),T=Pe(B);T.success||(V.fail(),p.break(),p.error(T.error||"Failed to write file."),p.break(),process.exit(1)),V.succeed();}if(w){let V=M(`Applying changes to ${I.filePath}.`).start(),T=Ue(I);T.success||(V.fail(),p.break(),p.error(T.error||"Failed to write file."),p.break(),process.exit(1)),V.succeed();}C=!0,p.break(),p.success(`${N[A]} has been added.`);}}}}}else p.log("All agent integrations are already installed.");p.break();let{wantCustomizeOptions:E}=await(0,de.default)({type:"confirm",name:"wantCustomizeOptions",message:`Would you like to customize ${k.info("options")}?`,initial:!1});if(E===void 0&&(p.break(),process.exit(1)),E){p.break(),p.log(`Configure ${k.info("React Grab")} options:`),p.break();let O={},{wantActivationKey:P}=await(0,de.default)({type:"confirm",name:"wantActivationKey",message:`Configure ${k.info("activation key")}?`,initial:!1});if(P===void 0&&(p.break(),process.exit(1)),P){let{key:I}=await(0,de.default)({type:"text",name:"key",message:"Enter the activation key (e.g., g, k, space):",initial:""});I===void 0&&(p.break(),process.exit(1));let{modifiers:re}=await(0,de.default)({type:"multiselect",name:"modifiers",message:"Select modifier keys (space to select, enter to confirm):",choices:[{title:Ui.metaKey,value:"metaKey"},{title:Ui.ctrlKey,value:"ctrlKey"},{title:Ui.shiftKey,value:"shiftKey"},{title:Ui.altKey,value:"altKey",selected:!0}],hint:"- Space to select, Enter to confirm"});re===void 0&&(p.break(),process.exit(1)),O.activationKey={...I&&{key:I.toLowerCase()},...re.includes("metaKey")&&{metaKey:!0},...re.includes("ctrlKey")&&{ctrlKey:!0},...re.includes("shiftKey")&&{shiftKey:!0},...re.includes("altKey")&&{altKey:!0}},p.log(` Activation key: ${k.info(kw(O.activationKey))}`);}let{activationMode:A}=await(0,de.default)({type:"select",name:"activationMode",message:`Select ${k.info("activation mode")}:`,choices:[{title:"Toggle (press to activate/deactivate)",value:"toggle"},{title:"Hold (hold key to keep active)",value:"hold"}],initial:0});if(A===void 0&&(p.break(),process.exit(1)),O.activationMode=A,A==="hold"){let{keyHoldDuration:I}=await(0,de.default)({type:"number",name:"keyHoldDuration",message:`Enter ${k.info("key hold duration")} in milliseconds:`,initial:150,min:0,max:2e3});I===void 0&&(p.break(),process.exit(1)),O.keyHoldDuration=I;}let{allowActivationInsideInput:R}=await(0,de.default)({type:"confirm",name:"allowActivationInsideInput",message:`Allow activation ${k.info("inside input fields")}?`,initial:!0});R===void 0&&(p.break(),process.exit(1)),O.allowActivationInsideInput=R;let{maxContextLines:U}=await(0,de.default)({type:"number",name:"maxContextLines",message:`Enter ${k.info("max context lines")} to include:`,initial:3,min:0,max:50});U===void 0&&(p.break(),process.exit(1)),O.maxContextLines=U;let F=qi(s.projectRoot,s.framework,s.nextRouterType,O);if(F.success||(p.break(),p.error(F.message),p.break(),process.exit(1)),!F.noChanges&&F.originalContent&&F.newContent){p.break(),we(F.filePath,F.originalContent,F.newContent),p.break();let{proceed:I}=await(0,de.default)({type:"confirm",name:"proceed",message:"Apply these changes?",initial:!0});if(!I)p.break(),p.log("Options configuration cancelled.");else {let re=M(`Applying changes to ${F.filePath}.`).start(),w=Li(F);w.success||(re.fail(),p.break(),p.error(w.error||"Failed to write file."),p.break(),process.exit(1)),re.succeed(),p.break(),p.success("React Grab options have been configured.");}}else p.break(),p.log("No option changes needed.");}!C&&!E&&(p.break(),p.log("No changes made.")),p.break(),process.exit(0);}i.succeed();let n=M("Verifying framework.").start();if(s.unsupportedFramework){let b=Pw[s.unsupportedFramework];n.fail(`Found ${k.info(b)}.`),p.break(),p.log(`${b} is not yet supported by automatic setup.`),p.log(`Visit ${k.info(Wi)} for manual setup.`),p.break(),process.exit(1);}if(s.framework==="unknown")if(s.isMonorepo&&!r){n.info("Verifying framework. Found monorepo.");let v=Hf(s.projectRoot).filter(C=>C.hasReact||C.framework!=="unknown");if(v.length>0){p.break();let C=[...v].sort((A,R)=>A.framework==="unknown"&&R.framework!=="unknown"?1:A.framework!=="unknown"&&R.framework==="unknown"?-1:0),{selectedProject:E}=await(0,de.default)({type:"select",name:"selectedProject",message:"Select a project to install React Grab:",choices:C.map(A=>{let R=A.framework!=="unknown"?` ${k.dim(`(${Ea[A.framework]})`)}`:"";return {title:`${A.name}${R}`,value:A.path}})});E||(p.break(),process.exit(1)),process.chdir(E);let O=await mt(E);Object.assign(s,O),M("Verifying framework.").start().succeed(`Verifying framework. Found ${k.info(Ea[O.framework])}.`);}else n.fail("Could not detect a supported framework."),p.break(),p.log(`Visit ${k.info(Wi)} for manual setup.`),p.break(),process.exit(1);}else n.fail("Could not detect a supported framework."),p.break(),p.log("React Grab supports Next.js, Vite, and Webpack projects."),p.log(`Visit ${k.info(Wi)} for manual setup.`),p.break(),process.exit(1);else n.succeed(`Verifying framework. Found ${k.info(Ea[s.framework])}.`);s.framework==="next"&&M("Detecting router type.").start().succeed(`Detecting router type. Found ${k.info(s.nextRouterType==="app"?"App Router":"Pages Router")}.`),M("Detecting package manager.").start().succeed(`Detecting package manager. Found ${k.info(Tw[s.packageManager])}.`);let a=s.framework,u=s.packageManager,h=s.nextRouterType,l=t.agent||"none",c=[];if(!r&&!t.agent){if(p.break(),t.force&&s.installedAgents.length>0){let v=s.installedAgents.map(C=>N[C]||C).join(", ");p.warn(`Currently installed: ${v}`),p.break();}let{agent:b}=await(0,de.default)({type:"select",name:"agent",message:`Would you like to add an ${k.info("agent integration")}?`,choices:[{title:"None",value:"none"},...We.map(v=>({title:N[v],value:v}))]});if(b===void 0&&(p.break(),process.exit(1)),l=b,t.force&&s.installedAgents.length>0&&l!=="none"&&!s.installedAgents.includes(l)){let v=s.installedAgents.map(E=>N[E]||E).join(", "),{action:C}=await(0,de.default)({type:"select",name:"action",message:"How would you like to proceed?",choices:[{title:`Replace ${v} with ${N[l]}`,value:"replace"},{title:`Add ${N[l]} alongside existing`,value:"add"},{title:"Cancel",value:"cancel"}]});(!C||C==="cancel")&&(p.break(),p.log("Changes cancelled."),p.break(),process.exit(0)),C==="replace"&&(c=[...s.installedAgents]);}}else if(t.agent&&t.force&&s.installedAgents.length>0&&!s.installedAgents.includes(t.agent)&&!r){let b=s.installedAgents.map(C=>N[C]||C).join(", ");p.break(),p.warn(`Currently installed: ${b}`);let{action:v}=await(0,de.default)({type:"select",name:"action",message:"How would you like to proceed?",choices:[{title:`Replace ${b} with ${N[l]}`,value:"replace"},{title:`Add ${N[l]} alongside existing`,value:"add"},{title:"Cancel",value:"cancel"}]});(!v||v==="cancel")&&(p.break(),p.log("Changes cancelled."),p.break(),process.exit(0)),v==="replace"&&(c=[...s.installedAgents]);}let d=qr(s.projectRoot,a,h,l,!1),f=Lr(s.projectRoot,l,s.installedAgents,u);d.success||(p.break(),p.error(d.message),p.error(`Visit ${k.info(Wi)} for manual setup.`),p.break(),process.exit(1));let m=!d.noChanges&&d.originalContent&&d.newContent,g=f.success&&!f.noChanges&&f.originalContent&&f.newContent;if((m||g)&&(p.break(),m&&we(d.filePath,d.originalContent,d.newContent),g&&(m&&p.break(),we(f.filePath,f.originalContent,f.newContent)),p.break(),p.warn("Auto-detection may not be 100% accurate."),p.warn("Please verify the changes before committing."),!r)){p.break();let{proceed:b}=await(0,de.default)({type:"confirm",name:"proceed",message:"Apply these changes?",initial:!0});b||(p.break(),p.log("Changes cancelled."),p.break(),process.exit(0));}if(c.length>0){for(let b of c){let v=qt(s.projectRoot,s.framework,s.nextRouterType,b),C=Lt(s.projectRoot,b),E=Bt(b);if(E.length>0&&!t.skipInstall){let O=M(`Removing ${E.join(", ")}.`).start();try{Mt(E,u,s.projectRoot),O.succeed();}catch(P){O.fail(),ge(P);}}if(v.success&&!v.noChanges&&v.newContent){let O=M(`Removing ${N[b]||b} from ${v.filePath}.`).start(),P=Pe(v);P.success||(O.fail(),p.break(),p.error(P.error||"Failed to write file."),p.break(),process.exit(1)),O.succeed();}if(C.success&&!C.noChanges&&C.newContent){let O=M(`Removing ${N[b]||b} from ${C.filePath}.`).start(),P=Ue(C);P.success||(O.fail(),p.break(),p.error(P.error||"Failed to write file."),p.break(),process.exit(1)),O.succeed();}}s.installedAgents=s.installedAgents.filter(b=>!c.includes(b));}let D=!s.hasReactGrab,x=l!=="none"&&!s.installedAgents.includes(l);if(!t.skipInstall&&(D||x)){let b=ur(l,D);if(b.length>0){let v=M(`Installing ${b.join(", ")}.`).start();try{ar(b,u,s.projectRoot),v.succeed();}catch(C){v.fail(),ge(C);}}}if(m){let b=M(`Applying changes to ${d.filePath}.`).start(),v=Pe(d);v.success||(b.fail(),p.break(),p.error(v.error||"Failed to write file."),p.break(),process.exit(1)),b.succeed();}if(g){let b=M(`Applying changes to ${f.filePath}.`).start(),v=Ue(f);v.success||(b.fail(),p.break(),p.error(v.error||"Failed to write file."),p.break(),process.exit(1)),b.succeed();}p.break(),p.log(`${k.success("Success!")} React Grab has been installed.`),f.warning?(p.break(),p.warn(f.warning),p.break()):p.log("You may now start your development server."),p.break(),await Sp("completed",{framework:a,packageManager:u,router:h,agent:l!=="none"?l:void 0,isMonorepo:s.isMonorepo});}catch(e){ge(e),await Sp("error",void 0,e);}});var Yi=ve(Ot()),Aa=ve(ir());var Iw="0.0.98",Pp=new Re().name("remove").description("remove an agent integration").argument("[agent]","agent to remove (claude-code, cursor, opencode, codex, gemini, amp, ami, visual-edit)").option("-y, --yes","skip confirmation prompts",false).option("-c, --cwd <cwd>","working directory (defaults to current directory)",process.cwd()).action(async(t,e)=>{console.log(`${Yi.default.magenta("\u273F")} ${Yi.default.bold("React Grab")} ${Yi.default.gray(Iw)}`),console.log();try{let r=e.cwd,i=e.yes,s=M("Preflight checks.").start(),n=await mt(r);n.hasReactGrab||(s.fail("React Grab is not installed."),p.break(),p.error(`Run ${k.info("react-grab init")} first to install React Grab.`),p.break(),process.exit(1)),n.installedAgents.length===0&&(s.succeed(),p.break(),p.warn("No agent integrations are installed."),p.break(),process.exit(0)),s.succeed();let o;if(t)n.installedAgents.includes(t)||(p.break(),p.error(`Agent ${k.info(t)} is not installed.`),p.log(`Installed agents: ${n.installedAgents.map(f=>N[f]||f).join(", ")}`),p.break(),process.exit(1)),o=t;else if(i)p.break(),p.error("Please specify an agent to remove."),p.error("Installed agents: "+n.installedAgents.join(", ")),p.break(),process.exit(1);else {p.break();let{agent:f}=await(0,Aa.default)({type:"select",name:"agent",message:`Which ${k.info("agent integration")} would you like to remove?`,choices:n.installedAgents.map(m=>({title:N[m]||m,value:m}))});f||(p.break(),process.exit(1)),o=f;}M(`Preparing to remove ${N[o]||o}.`).start().succeed();let u=qt(n.projectRoot,n.framework,n.nextRouterType,o),h=Lt(n.projectRoot,o),l=u.success&&!u.noChanges&&u.originalContent&&u.newContent,c=h.success&&!h.noChanges&&h.originalContent&&h.newContent;if((l||c)&&(p.break(),l&&we(u.filePath,u.originalContent,u.newContent),c&&(l&&p.break(),we(h.filePath,h.originalContent,h.newContent)),!i)){p.break();let{proceed:f}=await(0,Aa.default)({type:"confirm",name:"proceed",message:"Apply these changes?",initial:!0});f||(p.break(),p.log("Changes cancelled."),p.break(),process.exit(0));}let d=Bt(o);if(d.length>0){let f=M(`Removing ${d.join(", ")}.`).start();try{Mt(d,n.packageManager,n.projectRoot),f.succeed();}catch(m){f.fail(),ge(m);}}if(l){let f=M(`Applying changes to ${u.filePath}.`).start(),m=Pe(u);m.success||(f.fail(),p.break(),p.error(m.error||"Failed to write file."),p.break(),process.exit(1)),f.succeed();}if(c){let f=M(`Applying changes to ${h.filePath}.`).start(),m=Ue(h);m.success||(f.fail(),p.break(),p.error(m.error||"Failed to write file."),p.break(),process.exit(1)),f.succeed();}p.break(),p.log(`${k.success("Success!")} ${N[o]||o} has been removed.`),p.break();}catch(r){ge(r);}});var xs=ve(Ot()),Fs=ve(mD()),Tu=ve(ir());var D1="0.0.98",gD=2e3,DD='<script src="https://unpkg.com/react-grab/dist/index.global.js"></script>',b1=t=>`<script src="https://unpkg.com/${t}/dist/client.global.js"></script>`,vD=async(t,e)=>new Promise(r=>{let i=http.createServer();i.listen(t,e,()=>{i.close(()=>r(t));}),i.on("error",()=>{r(vD(t+1,e));});}),v1=t=>t.startsWith("http://")||t.startsWith("https://")?t:`http://${t}`,y1=async t=>{try{return (await fetch(t,{method:"HEAD",redirect:"follow"})).url}catch{return t}},yD=new Re().name("start").alias("proxy").description("start a proxy server for a given URL").argument("[url]","target URL to proxy (e.g., localhost:3000)").option("-p, --port <port>","starting port for the proxy server",String(gD)).option("--host <hostname>","hostname to bind the proxy server to","localhost").option("--provider <package>","provider package to run via npx (e.g., @react-grab/cursor)").action(async(t,e)=>{console.log(`${xs.default.magenta("\u273F")} ${xs.default.bold("React Grab")} ${xs.default.gray(D1)}`),console.log();let r=t,i=e.provider;if(!r){let{targetUrl:b}=await(0, Tu.default)({type:"text",name:"targetUrl",message:"Enter the target URL to proxy:",initial:"localhost:3000"});if(b||(p.break(),process.exit(1)),r=b,!i){let{selectedProvider:v}=await(0, Tu.default)({type:"select",name:"selectedProvider",message:`Select a ${k.info("provider")} to use:`,choices:[{title:"None",value:""},...Ni.map(C=>{let E=C.replace("@react-grab/","");return {title:N[E],value:C}})]});v===void 0&&(p.break(),process.exit(1)),i=v||void 0;}p.break();}let s=v1(r),n=await y1(s),o=parseInt(e.port,10),a=e.host||"localhost";(isNaN(o)||o<1||o>65535)&&(p.break(),p.error("Invalid port number. Please provide a port between 1 and 65535."),p.break(),process.exit(1));let u=await vD(o,a),h=i?DD+b1(i):DD,l=b=>{let v=b.indexOf("</head>");if(v!==-1)return b.slice(0,v)+h+b.slice(v);let C=b.indexOf("</body>");return C!==-1?b.slice(0,C)+h+b.slice(C):b+h},c=(0, Fs.createProxyMiddleware)({target:n,changeOrigin:true,followRedirects:false,ws:true,selfHandleResponse:true,cookieDomainRewrite:{"*":""},autoRewrite:true,preserveHeaderKeyCase:true,xfwd:true,on:{error:(b,v,C)=>{"writeHead"in C&&!C.headersSent&&(C.writeHead(503,{"Content-Type":"text/plain"}),C.end(`Proxy error: Unable to connect to ${n}`));},proxyReq:b=>{b.removeHeader("accept-encoding");},proxyRes:(0, Fs.responseInterceptor)(async(b,v,C,E)=>{if(E.removeHeader("content-security-policy"),E.removeHeader("content-security-policy-report-only"),!(v.headers["content-type"]||"").includes("text/html"))return b;let A=b.toString("utf-8");return l(A)})}}),d=http.createServer((b,v)=>{c(b,v,C=>{C&&(p.error(`Request error: ${C}`),v.writeHead(500),v.end("Internal Server Error"));});});d.on("upgrade",c.upgrade);let f=M("Starting.").start(),m=()=>{f.succeed(`Open in your browser: http://${a}:${u}`);let b=["npx react-grab@latest start",r];e.port!==String(gD)&&b.push(`--port=${e.port}`),a!=="localhost"&&b.push(`--host=${a}`),i&&b.push(`--provider=${i}`),p.break(),p.log(k.dim(`$ ${b.join(" ")}`));},g=false,D=!i,x=()=>{g&&D&&m();};if(d.listen(u,a,()=>{g=true,x();}),i){let b=child_process.spawn("npx",[`${i}@latest`],{stdio:"ignore",shell:true,detached:false}),v=()=>{b.killed||b.kill();};process.on("exit",v),process.on("SIGINT",()=>{v(),process.exit(0);}),process.on("SIGTERM",()=>{v(),process.exit(0);}),b.on("error",C=>{f.fail(`Failed to start provider: ${C.message}`);}),b.on("spawn",()=>{D=true,x();}),b.on("close",C=>{C!==0&&C!==null&&p.error(`Provider exited with code ${C}`);});}d.on("error",b=>{p.break(),p.error(`Server error: ${b.message}`),p.break(),process.exit(1);});});process.noDeprecation=true;var C1="0.0.98",_1="https://www.react-grab.com/api/version";process.on("SIGINT",()=>process.exit(0));process.on("SIGTERM",()=>process.exit(0));try{fetch(`${_1}?source=cli&t=${Date.now()}`).catch(()=>{});}catch{}var Xt=new Re().name("react-grab").description("add React Grab to your project").version(C1,"-v, --version","display the version number");Xt.addCommand(Tp);Xt.addCommand($p);Xt.addCommand(Pp);Xt.addCommand(Op);Xt.addCommand(yD);var Es=Ju(Xt),w1=Es.commands.get("init"),CD=w1?.options.get("agent");CD&&(CD.handler=t=>{for(let e of We)t(e,"");});var x1=Es.commands.get("add"),_D=x1?.arguments.get("agent");_D&&(_D.handler=t=>{for(let e of We)t(e,"");});var F1=Es.commands.get("remove"),wD=F1?.arguments.get("agent");wD&&(wD.handler=t=>{for(let e of We)t(e,"");});var ED=Es.commands.get("start"),xD=ED?.options.get("provider");xD&&(xD.handler=t=>{for(let e of Ni)t(e,"");});var FD=ED?.options.get("port");FD&&(FD.handler=t=>{t("2000","Default port"),t("3000","Common dev port"),t("8080","Alternative port");});Xt.parse();
1049
- /*! Bundled license information:
1050
-
1051
- http-proxy/lib/http-proxy/passes/web-outgoing.js:
1052
- (*!
1053
- * Array of passes.
1054
- *
1055
- * A `pass` is just a function that is executed on `req, res, options`
1056
- * so that you can easily add new checks while still keeping the base
1057
- * flexible.
1058
- *)
1059
-
1060
- http-proxy/lib/http-proxy/passes/web-incoming.js:
1061
- (*!
1062
- * Array of passes.
1063
- *
1064
- * A `pass` is just a function that is executed on `req, res, options`
1065
- * so that you can easily add new checks while still keeping the base
1066
- * flexible.
1067
- *)
1068
-
1069
- http-proxy/lib/http-proxy/passes/ws-incoming.js:
1070
- (*!
1071
- * Array of passes.
1072
- *
1073
- * A `pass` is just a function that is executed on `req, socket, options`
1074
- * so that you can easily add new checks while still keeping the base
1075
- * flexible.
1076
- *)
1077
-
1078
- http-proxy/index.js:
1079
- (*!
1080
- * Caron dimonio, con occhi di bragia
1081
- * loro accennando, tutte le raccoglie;
1082
- * batte col remo qualunque s’adagia
1083
- *
1084
- * Charon the demon, with the eyes of glede,
1085
- * Beckoning to them, collects them all together,
1086
- * Beats with his oar whoever lags behind
1087
- *
1088
- * Dante - The Divine Comedy (Canto III)
1089
- *)
1090
-
1091
- is-extglob/index.js:
1092
- (*!
1093
- * is-extglob <https://github.com/jonschlinkert/is-extglob>
1094
- *
1095
- * Copyright (c) 2014-2016, Jon Schlinkert.
1096
- * Licensed under the MIT License.
1097
- *)
1098
-
1099
- is-glob/index.js:
1100
- (*!
1101
- * is-glob <https://github.com/jonschlinkert/is-glob>
1102
- *
1103
- * Copyright (c) 2014-2017, Jon Schlinkert.
1104
- * Released under the MIT License.
1105
- *)
1106
-
1107
- is-number/index.js:
1108
- (*!
1109
- * is-number <https://github.com/jonschlinkert/is-number>
1110
- *
1111
- * Copyright (c) 2014-present, Jon Schlinkert.
1112
- * Released under the MIT License.
1113
- *)
1114
-
1115
- to-regex-range/index.js:
1116
- (*!
1117
- * to-regex-range <https://github.com/micromatch/to-regex-range>
1118
- *
1119
- * Copyright (c) 2015-present, Jon Schlinkert.
1120
- * Released under the MIT License.
1121
- *)
1122
-
1123
- fill-range/index.js:
1124
- (*!
1125
- * fill-range <https://github.com/jonschlinkert/fill-range>
1126
- *
1127
- * Copyright (c) 2014-present, Jon Schlinkert.
1128
- * Licensed under the MIT License.
1129
- *)
1130
-
1131
- is-plain-object/dist/is-plain-object.js:
1132
- (*!
1133
- * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
1134
- *
1135
- * Copyright (c) 2014-2017, Jon Schlinkert.
1136
- * Released under the MIT License.
1137
- *)
1138
- */
2
+ 'use strict';var child_process=require('child_process');var i=child_process.spawn("npx",["-y","@react-grab/cli",...process.argv.slice(2)],{stdio:"inherit"});i.on("close",s=>{process.exit(s??0);});