commitsmile
Version:
Make smile on your commits
29 lines • 1.9 MB
JavaScript
#!/usr/bin/env node
import {createRequire}from'node:module';import {o,h,m,k as k$1,c as c$1,n,b as b$1,j,i,f,g,d as d$1,l}from'./chunk-3D7FHY53.mjs';import'./chunk-ZVJ4T24V.mjs';import'./chunk-WDBZBRYN.mjs';import'./chunk-73SBXV64.mjs';import'./chunk-EMTUV6JK.mjs';import'./chunk-3WSMN7T6.mjs';import {c,k,a,b,e,d}from'./chunk-G5RJVSXQ.mjs';import Fc,{dirname,join,resolve}from'node:path';import xs,{exit,stdin,stdout}from'node:process';import Cy,{homedir}from'node:os';import Wc,{WriteStream}from'node:tty';import {existsSync,copyFile,readdirSync,statSync,readFileSync,promises}from'node:fs';import {rm as rm$1,readFile}from'node:fs/promises';import Jf from'node:readline';import {spawnSync}from'node:child_process';import {fileURLToPath}from'node:url';createRequire(import.meta.url);
var ei=c(_o=>{k();var Ki=class extends Error{constructor(i,l,v){super(v),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=l,this.exitCode=i,this.nestedError=void 0;}},Co=class extends Ki{constructor(i){super(1,"commander.invalidArgument",i),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name;}};_o.CommanderError=Ki;_o.InvalidArgumentError=Co;});var Gi=c(wo=>{k();var{InvalidArgumentError:ay}=ei(),xo=class{constructor(i,l){switch(this.description=l||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,i[0]){case"<":this.required=!0,this._name=i.slice(1,-1);break;case"[":this.required=!1,this._name=i.slice(1,-1);break;default:this.required=!0,this._name=i;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3));}name(){return this._name}_concatValue(i,l){return l===this.defaultValue||!Array.isArray(l)?[i]:l.concat(i)}default(i,l){return this.defaultValue=i,this.defaultValueDescription=l,this}argParser(i){return this.parseArg=i,this}choices(i){return this.argChoices=i.slice(),this.parseArg=(l,v)=>{if(!this.argChoices.includes(l))throw new ay(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(l,v):l},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function oy(y){let i=y.name()+(y.variadic===!0?"...":"");return y.required?"<"+i+">":"["+i+"]"}wo.Argument=xo;wo.humanReadableArgName=oy;});var Oo=c(vc=>{k();var{humanReadableArgName:ly}=Gi(),Io=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1;}visibleCommands(i){let l=i.commands.filter(b=>!b._hidden),v=i._getHelpCommand();return v&&!v._hidden&&l.push(v),this.sortSubcommands&&l.sort((b,e)=>b.name().localeCompare(e.name())),l}compareOptions(i,l){let v=b=>b.short?b.short.replace(/^-/,""):b.long.replace(/^--/,"");return v(i).localeCompare(v(l))}visibleOptions(i){let l=i.options.filter(b=>!b.hidden),v=i._getHelpOption();if(v&&!v.hidden){let b=v.short&&i._findOption(v.short),e=v.long&&i._findOption(v.long);!b&&!e?l.push(v):v.long&&!e?l.push(i.createOption(v.long,v.description)):v.short&&!b&&l.push(i.createOption(v.short,v.description));}return this.sortOptions&&l.sort(this.compareOptions),l}visibleGlobalOptions(i){if(!this.showGlobalOptions)return [];let l=[];for(let v=i.parent;v;v=v.parent){let b=v.options.filter(e=>!e.hidden);l.push(...b);}return this.sortOptions&&l.sort(this.compareOptions),l}visibleArguments(i){return i._argsDescription&&i.registeredArguments.forEach(l=>{l.description=l.description||i._argsDescription[l.name()]||"";}),i.registeredArguments.find(l=>l.description)?i.registeredArguments:[]}subcommandTerm(i){let l=i.registeredArguments.map(v=>ly(v)).join(" ");return i._name+(i._aliases[0]?"|"+i._aliases[0]:"")+(i.options.length?" [options]":"")+(l?" "+l:"")}optionTerm(i){return i.flags}argumentTerm(i){return i.name()}longestSubcommandTermLength(i,l){return l.visibleCommands(i).reduce((v,b)=>Math.max(v,l.subcommandTerm(b).length),0)}longestOptionTermLength(i,l){return l.visibleOptions(i).reduce((v,b)=>Math.max(v,l.optionTerm(b).length),0)}longestGlobalOptionTermLength(i,l){return l.visibleGlobalOptions(i).reduce((v,b)=>Math.max(v,l.optionTerm(b).length),0)}longestArgumentTermLength(i,l){return l.visibleArguments(i).reduce((v,b)=>Math.max(v,l.argumentTerm(b).length),0)}commandUsage(i){let l=i._name;i._aliases[0]&&(l=l+"|"+i._aliases[0]);let v="";for(let b=i.parent;b;b=b.parent)v=b.name()+" "+v;return v+l+" "+i.usage()}commandDescription(i){return i.description()}subcommandDescription(i){return i.summary()||i.description()}optionDescription(i){let l=[];return i.argChoices&&l.push(`choices: ${i.argChoices.map(v=>JSON.stringify(v)).join(", ")}`),i.defaultValue!==void 0&&(i.required||i.optional||i.isBoolean()&&typeof i.defaultValue=="boolean")&&l.push(`default: ${i.defaultValueDescription||JSON.stringify(i.defaultValue)}`),i.presetArg!==void 0&&i.optional&&l.push(`preset: ${JSON.stringify(i.presetArg)}`),i.envVar!==void 0&&l.push(`env: ${i.envVar}`),l.length>0?`${i.description} (${l.join(", ")})`:i.description}argumentDescription(i){let l=[];if(i.argChoices&&l.push(`choices: ${i.argChoices.map(v=>JSON.stringify(v)).join(", ")}`),i.defaultValue!==void 0&&l.push(`default: ${i.defaultValueDescription||JSON.stringify(i.defaultValue)}`),l.length>0){let v=`(${l.join(", ")})`;return i.description?`${i.description} ${v}`:v}return i.description}formatHelp(i,l){let v=l.padWidth(i,l),b=l.helpWidth||80,e=2,a=2;function r(_,P){if(P){let m=`${_.padEnd(v+a)}${P}`;return l.wrap(m,b-e,v+a)}return _}function p(_){return _.join(`
`).replace(/^/gm," ".repeat(e))}let c=[`Usage: ${l.commandUsage(i)}`,""],t=l.commandDescription(i);t.length>0&&(c=c.concat([l.wrap(t,b,0),""]));let n=l.visibleArguments(i).map(_=>r(l.argumentTerm(_),l.argumentDescription(_)));n.length>0&&(c=c.concat(["Arguments:",p(n),""]));let f=l.visibleOptions(i).map(_=>r(l.optionTerm(_),l.optionDescription(_)));if(f.length>0&&(c=c.concat(["Options:",p(f),""])),this.showGlobalOptions){let _=l.visibleGlobalOptions(i).map(P=>r(l.optionTerm(P),l.optionDescription(P)));_.length>0&&(c=c.concat(["Global Options:",p(_),""]));}let D=l.visibleCommands(i).map(_=>r(l.subcommandTerm(_),l.subcommandDescription(_)));return D.length>0&&(c=c.concat(["Commands:",p(D),""])),c.join(`
`)}padWidth(i,l){return Math.max(l.longestOptionTermLength(i,l),l.longestGlobalOptionTermLength(i,l),l.longestSubcommandTermLength(i,l),l.longestArgumentTermLength(i,l))}wrap(i,l,v,b=40){let e=" \\f\\t\\v\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF",a=new RegExp(`[\\n][${e}]+`);if(i.match(a))return i;let r=l-v;if(r<b)return i;let p=i.slice(0,v),c=i.slice(v).replace(`\r
`,`
`),t=" ".repeat(v),f="\\s\u200B",D=new RegExp(`
|.{1,${r-1}}([${f}]|$)|[^${f}]+?([${f}]|$)`,"g"),_=c.match(D)||[];return p+_.map((P,m)=>P===`
`?"":(m>0?t:"")+P.trimEnd()).join(`
`)}};vc.Help=Io;});var jo=c(Fo=>{k();var{InvalidArgumentError:uy}=ei(),No=class{constructor(i,l){this.flags=i,this.description=l||"",this.required=i.includes("<"),this.optional=i.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(i),this.mandatory=!1;let v=py(i);this.short=v.shortFlag,this.long=v.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0;}default(i,l){return this.defaultValue=i,this.defaultValueDescription=l,this}preset(i){return this.presetArg=i,this}conflicts(i){return this.conflictsWith=this.conflictsWith.concat(i),this}implies(i){let l=i;return typeof i=="string"&&(l={[i]:!0}),this.implied=Object.assign(this.implied||{},l),this}env(i){return this.envVar=i,this}argParser(i){return this.parseArg=i,this}makeOptionMandatory(i=!0){return this.mandatory=!!i,this}hideHelp(i=!0){return this.hidden=!!i,this}_concatValue(i,l){return l===this.defaultValue||!Array.isArray(l)?[i]:l.concat(i)}choices(i){return this.argChoices=i.slice(),this.parseArg=(l,v)=>{if(!this.argChoices.includes(l))throw new uy(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(l,v):l},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return cy(this.name().replace(/^no-/,""))}is(i){return this.short===i||this.long===i}isBoolean(){return !this.required&&!this.optional&&!this.negate}},ko=class{constructor(i){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,i.forEach(l=>{l.negate?this.negativeOptions.set(l.attributeName(),l):this.positiveOptions.set(l.attributeName(),l);}),this.negativeOptions.forEach((l,v)=>{this.positiveOptions.has(v)&&this.dualOptions.add(v);});}valueFromOption(i,l){let v=l.attributeName();if(!this.dualOptions.has(v))return !0;let b=this.negativeOptions.get(v).presetArg,e=b!==void 0?b:!1;return l.negate===(e===i)}};function cy(y){return y.split("-").reduce((i,l)=>i+l[0].toUpperCase()+l.slice(1))}function py(y){let i,l,v=y.split(/[ |,]+/);return v.length>1&&!/^[[<]/.test(v[1])&&(i=v.shift()),l=v.shift(),!i&&/^-[^-]$/.test(l)&&(i=l,l=void 0),{shortFlag:i,longFlag:l}}Fo.Option=No;Fo.DualOptions=ko;});var Tc=c(Sc=>{k();function dy(y,i){if(Math.abs(y.length-i.length)>3)return Math.max(y.length,i.length);let l=[];for(let v=0;v<=y.length;v++)l[v]=[v];for(let v=0;v<=i.length;v++)l[0][v]=v;for(let v=1;v<=i.length;v++)for(let b=1;b<=y.length;b++){let e=1;y[b-1]===i[v-1]?e=0:e=1,l[b][v]=Math.min(l[b-1][v]+1,l[b][v-1]+1,l[b-1][v-1]+e),b>1&&v>1&&y[b-1]===i[v-2]&&y[b-2]===i[v-1]&&(l[b][v]=Math.min(l[b][v],l[b-2][v-2]+1));}return l[y.length][i.length]}function hy(y,i){if(!i||i.length===0)return "";i=Array.from(new Set(i));let l=y.startsWith("--");l&&(y=y.slice(2),i=i.map(a=>a.slice(2)));let v=[],b=3,e=.4;return i.forEach(a=>{if(a.length<=1)return;let r=dy(y,a),p=Math.max(y.length,a.length);(p-r)/p>e&&(r<b?(b=r,v=[a]):r===b&&v.push(a));}),v.sort((a,r)=>a.localeCompare(r)),l&&(v=v.map(a=>`--${a}`)),v.length>1?`
(Did you mean one of ${v.join(", ")}?)`:v.length===1?`
(Did you mean ${v[0]}?)`:""}Sc.suggestSimilar=hy;});var _c=c(Cc=>{k();var fy=a("node:events").EventEmitter,Lo=a("node:child_process"),Ws=a("node:path"),Ro=a("node:fs"),_n=a("node:process"),{Argument:my,humanReadableArgName:yy}=Gi(),{CommanderError:Bo}=ei(),{Help:by}=Oo(),{Option:Dc,DualOptions:gy}=jo(),{suggestSimilar:Pc}=Tc(),Mo=class y extends fy{constructor(i){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=i||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:l=>_n.stdout.write(l),writeErr:l=>_n.stderr.write(l),getOutHelpWidth:()=>_n.stdout.isTTY?_n.stdout.columns:void 0,getErrHelpWidth:()=>_n.stderr.isTTY?_n.stderr.columns:void 0,outputError:(l,v)=>v(l)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={};}copyInheritedSettings(i){return this._outputConfiguration=i._outputConfiguration,this._helpOption=i._helpOption,this._helpCommand=i._helpCommand,this._helpConfiguration=i._helpConfiguration,this._exitCallback=i._exitCallback,this._storeOptionsAsProperties=i._storeOptionsAsProperties,this._combineFlagAndOptionalValue=i._combineFlagAndOptionalValue,this._allowExcessArguments=i._allowExcessArguments,this._enablePositionalOptions=i._enablePositionalOptions,this._showHelpAfterError=i._showHelpAfterError,this._showSuggestionAfterError=i._showSuggestionAfterError,this}_getCommandAndAncestors(){let i=[];for(let l=this;l;l=l.parent)i.push(l);return i}command(i,l,v){let b=l,e=v;typeof b=="object"&&b!==null&&(e=b,b=null),e=e||{};let[,a,r]=i.match(/([^ ]+) *(.*)/),p=this.createCommand(a);return b&&(p.description(b),p._executableHandler=!0),e.isDefault&&(this._defaultCommandName=p._name),p._hidden=!!(e.noHelp||e.hidden),p._executableFile=e.executableFile||null,r&&p.arguments(r),this._registerCommand(p),p.parent=this,p.copyInheritedSettings(this),b?this:p}createCommand(i){return new y(i)}createHelp(){return Object.assign(new by,this.configureHelp())}configureHelp(i){return i===void 0?this._helpConfiguration:(this._helpConfiguration=i,this)}configureOutput(i){return i===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,i),this)}showHelpAfterError(i=!0){return typeof i!="string"&&(i=!!i),this._showHelpAfterError=i,this}showSuggestionAfterError(i=!0){return this._showSuggestionAfterError=!!i,this}addCommand(i,l){if(!i._name)throw new Error(`Command passed to .addCommand() must have a name
- specify the name in Command constructor or using .name()`);return l=l||{},l.isDefault&&(this._defaultCommandName=i._name),(l.noHelp||l.hidden)&&(i._hidden=!0),this._registerCommand(i),i.parent=this,i._checkForBrokenPassThrough(),this}createArgument(i,l){return new my(i,l)}argument(i,l,v,b){let e=this.createArgument(i,l);return typeof v=="function"?e.default(b).argParser(v):e.default(v),this.addArgument(e),this}arguments(i){return i.trim().split(/ +/).forEach(l=>{this.argument(l);}),this}addArgument(i){let l=this.registeredArguments.slice(-1)[0];if(l&&l.variadic)throw new Error(`only the last argument can be variadic '${l.name()}'`);if(i.required&&i.defaultValue!==void 0&&i.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${i.name()}'`);return this.registeredArguments.push(i),this}helpCommand(i,l){if(typeof i=="boolean")return this._addImplicitHelpCommand=i,this;i=i??"help [command]";let[,v,b]=i.match(/([^ ]+) *(.*)/),e=l??"display help for command",a=this.createCommand(v);return a.helpOption(!1),b&&a.arguments(b),e&&a.description(e),this._addImplicitHelpCommand=!0,this._helpCommand=a,this}addHelpCommand(i,l){return typeof i!="object"?(this.helpCommand(i,l),this):(this._addImplicitHelpCommand=!0,this._helpCommand=i,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(i,l){let v=["preSubcommand","preAction","postAction"];if(!v.includes(i))throw new Error(`Unexpected value for event passed to hook : '${i}'.
Expecting one of '${v.join("', '")}'`);return this._lifeCycleHooks[i]?this._lifeCycleHooks[i].push(l):this._lifeCycleHooks[i]=[l],this}exitOverride(i){return i?this._exitCallback=i:this._exitCallback=l=>{if(l.code!=="commander.executeSubCommandAsync")throw l},this}_exit(i,l,v){this._exitCallback&&this._exitCallback(new Bo(i,l,v)),_n.exit(i);}action(i){let l=v=>{let b=this.registeredArguments.length,e=v.slice(0,b);return this._storeOptionsAsProperties?e[b]=this:e[b]=this.opts(),e.push(this),i.apply(this,e)};return this._actionHandler=l,this}createOption(i,l){return new Dc(i,l)}_callParseArg(i,l,v,b){try{return i.parseArg(l,v)}catch(e){if(e.code==="commander.invalidArgument"){let a=`${b} ${e.message}`;this.error(a,{exitCode:e.exitCode,code:e.code});}throw e}}_registerOption(i){let l=i.short&&this._findOption(i.short)||i.long&&this._findOption(i.long);if(l){let v=i.long&&this._findOption(i.long)?i.long:i.short;throw new Error(`Cannot add option '${i.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${v}'
- already used by option '${l.flags}'`)}this.options.push(i);}_registerCommand(i){let l=b=>[b.name()].concat(b.aliases()),v=l(i).find(b=>this._findCommand(b));if(v){let b=l(this._findCommand(v)).join("|"),e=l(i).join("|");throw new Error(`cannot add command '${e}' as already have command '${b}'`)}this.commands.push(i);}addOption(i){this._registerOption(i);let l=i.name(),v=i.attributeName();if(i.negate){let e=i.long.replace(/^--no-/,"--");this._findOption(e)||this.setOptionValueWithSource(v,i.defaultValue===void 0?!0:i.defaultValue,"default");}else i.defaultValue!==void 0&&this.setOptionValueWithSource(v,i.defaultValue,"default");let b=(e,a,r)=>{e==null&&i.presetArg!==void 0&&(e=i.presetArg);let p=this.getOptionValue(v);e!==null&&i.parseArg?e=this._callParseArg(i,e,p,a):e!==null&&i.variadic&&(e=i._concatValue(e,p)),e==null&&(i.negate?e=!1:i.isBoolean()||i.optional?e=!0:e=""),this.setOptionValueWithSource(v,e,r);};return this.on("option:"+l,e=>{let a=`error: option '${i.flags}' argument '${e}' is invalid.`;b(e,a,"cli");}),i.envVar&&this.on("optionEnv:"+l,e=>{let a=`error: option '${i.flags}' value '${e}' from env '${i.envVar}' is invalid.`;b(e,a,"env");}),this}_optionEx(i,l,v,b,e){if(typeof l=="object"&&l instanceof Dc)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let a=this.createOption(l,v);if(a.makeOptionMandatory(!!i.mandatory),typeof b=="function")a.default(e).argParser(b);else if(b instanceof RegExp){let r=b;b=(p,c)=>{let t=r.exec(p);return t?t[0]:c},a.default(e).argParser(b);}else a.default(b);return this.addOption(a)}option(i,l,v,b){return this._optionEx({},i,l,v,b)}requiredOption(i,l,v,b){return this._optionEx({mandatory:!0},i,l,v,b)}combineFlagAndOptionalValue(i=!0){return this._combineFlagAndOptionalValue=!!i,this}allowUnknownOption(i=!0){return this._allowUnknownOption=!!i,this}allowExcessArguments(i=!0){return this._allowExcessArguments=!!i,this}enablePositionalOptions(i=!0){return this._enablePositionalOptions=!!i,this}passThroughOptions(i=!0){return this._passThroughOptions=!!i,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(i=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!i,this}getOptionValue(i){return this._storeOptionsAsProperties?this[i]:this._optionValues[i]}setOptionValue(i,l){return this.setOptionValueWithSource(i,l,void 0)}setOptionValueWithSource(i,l,v){return this._storeOptionsAsProperties?this[i]=l:this._optionValues[i]=l,this._optionValueSources[i]=v,this}getOptionValueSource(i){return this._optionValueSources[i]}getOptionValueSourceWithGlobals(i){let l;return this._getCommandAndAncestors().forEach(v=>{v.getOptionValueSource(i)!==void 0&&(l=v.getOptionValueSource(i));}),l}_prepareUserArgs(i,l){if(i!==void 0&&!Array.isArray(i))throw new Error("first parameter to parse must be array or undefined");if(l=l||{},i===void 0&&l.from===void 0){_n.versions?.electron&&(l.from="electron");let b=_n.execArgv??[];(b.includes("-e")||b.includes("--eval")||b.includes("-p")||b.includes("--print"))&&(l.from="eval");}i===void 0&&(i=_n.argv),this.rawArgs=i.slice();let v;switch(l.from){case void 0:case"node":this._scriptPath=i[1],v=i.slice(2);break;case"electron":_n.defaultApp?(this._scriptPath=i[1],v=i.slice(2)):v=i.slice(1);break;case"user":v=i.slice(0);break;case"eval":v=i.slice(1);break;default:throw new Error(`unexpected parse option { from: '${l.from}' }`)}return !this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",v}parse(i,l){let v=this._prepareUserArgs(i,l);return this._parseCommand([],v),this}async parseAsync(i,l){let v=this._prepareUserArgs(i,l);return await this._parseCommand([],v),this}_executeSubCommand(i,l){l=l.slice();let v=!1,b=[".js",".ts",".tsx",".mjs",".cjs"];function e(t,n){let f=Ws.resolve(t,n);if(Ro.existsSync(f))return f;if(b.includes(Ws.extname(n)))return;let D=b.find(_=>Ro.existsSync(`${f}${_}`));if(D)return `${f}${D}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let a=i._executableFile||`${this._name}-${i._name}`,r=this._executableDir||"";if(this._scriptPath){let t;try{t=Ro.realpathSync(this._scriptPath);}catch{t=this._scriptPath;}r=Ws.resolve(Ws.dirname(t),r);}if(r){let t=e(r,a);if(!t&&!i._executableFile&&this._scriptPath){let n=Ws.basename(this._scriptPath,Ws.extname(this._scriptPath));n!==this._name&&(t=e(r,`${n}-${i._name}`));}a=t||a;}v=b.includes(Ws.extname(a));let p;_n.platform!=="win32"?v?(l.unshift(a),l=Ac(_n.execArgv).concat(l),p=Lo.spawn(_n.argv[0],l,{stdio:"inherit"})):p=Lo.spawn(a,l,{stdio:"inherit"}):(l.unshift(a),l=Ac(_n.execArgv).concat(l),p=Lo.spawn(_n.execPath,l,{stdio:"inherit"})),p.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(n=>{_n.on(n,()=>{p.killed===!1&&p.exitCode===null&&p.kill(n);});});let c=this._exitCallback;p.on("close",t=>{t=t??1,c?c(new Bo(t,"commander.executeSubCommandAsync","(close)")):_n.exit(t);}),p.on("error",t=>{if(t.code==="ENOENT"){let n=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",f=`'${a}' does not exist
- if '${i._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
- ${n}`;throw new Error(f)}else if(t.code==="EACCES")throw new Error(`'${a}' not executable`);if(!c)_n.exit(1);else {let n=new Bo(1,"commander.executeSubCommandAsync","(error)");n.nestedError=t,c(n);}}),this.runningCommand=p;}_dispatchSubcommand(i,l,v){let b=this._findCommand(i);b||this.help({error:!0});let e;return e=this._chainOrCallSubCommandHook(e,b,"preSubcommand"),e=this._chainOrCall(e,()=>{if(b._executableHandler)this._executeSubCommand(b,l.concat(v));else return b._parseCommand(l,v)}),e}_dispatchHelpCommand(i){i||this.help();let l=this._findCommand(i);return l&&!l._executableHandler&&l.help(),this._dispatchSubcommand(i,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((i,l)=>{i.required&&this.args[l]==null&&this.missingArgument(i.name());}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args);}_processArguments(){let i=(v,b,e)=>{let a=b;if(b!==null&&v.parseArg){let r=`error: command-argument value '${b}' is invalid for argument '${v.name()}'.`;a=this._callParseArg(v,b,e,r);}return a};this._checkNumberOfArguments();let l=[];this.registeredArguments.forEach((v,b)=>{let e=v.defaultValue;v.variadic?b<this.args.length?(e=this.args.slice(b),v.parseArg&&(e=e.reduce((a,r)=>i(v,r,a),v.defaultValue))):e===void 0&&(e=[]):b<this.args.length&&(e=this.args[b],v.parseArg&&(e=i(v,e,v.defaultValue))),l[b]=e;}),this.processedArgs=l;}_chainOrCall(i,l){return i&&i.then&&typeof i.then=="function"?i.then(()=>l()):l()}_chainOrCallHooks(i,l){let v=i,b=[];return this._getCommandAndAncestors().reverse().filter(e=>e._lifeCycleHooks[l]!==void 0).forEach(e=>{e._lifeCycleHooks[l].forEach(a=>{b.push({hookedCommand:e,callback:a});});}),l==="postAction"&&b.reverse(),b.forEach(e=>{v=this._chainOrCall(v,()=>e.callback(e.hookedCommand,this));}),v}_chainOrCallSubCommandHook(i,l,v){let b=i;return this._lifeCycleHooks[v]!==void 0&&this._lifeCycleHooks[v].forEach(e=>{b=this._chainOrCall(b,()=>e(this,l));}),b}_parseCommand(i,l){let v=this.parseOptions(l);if(this._parseOptionsEnv(),this._parseOptionsImplied(),i=i.concat(v.operands),l=v.unknown,this.args=i.concat(l),i&&this._findCommand(i[0]))return this._dispatchSubcommand(i[0],i.slice(1),l);if(this._getHelpCommand()&&i[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(i[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(l),this._dispatchSubcommand(this._defaultCommandName,i,l);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(v.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let b=()=>{v.unknown.length>0&&this.unknownOption(v.unknown[0]);},e=`command:${this.name()}`;if(this._actionHandler){b(),this._processArguments();let a;return a=this._chainOrCallHooks(a,"preAction"),a=this._chainOrCall(a,()=>this._actionHandler(this.processedArgs)),this.parent&&(a=this._chainOrCall(a,()=>{this.parent.emit(e,i,l);})),a=this._chainOrCallHooks(a,"postAction"),a}if(this.parent&&this.parent.listenerCount(e))b(),this._processArguments(),this.parent.emit(e,i,l);else if(i.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",i,l);this.listenerCount("command:*")?this.emit("command:*",i,l):this.commands.length?this.unknownCommand():(b(),this._processArguments());}else this.commands.length?(b(),this.help({error:!0})):(b(),this._processArguments());}_findCommand(i){if(i)return this.commands.find(l=>l._name===i||l._aliases.includes(i))}_findOption(i){return this.options.find(l=>l.is(i))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(i=>{i.options.forEach(l=>{l.mandatory&&i.getOptionValue(l.attributeName())===void 0&&i.missingMandatoryOptionValue(l);});});}_checkForConflictingLocalOptions(){let i=this.options.filter(v=>{let b=v.attributeName();return this.getOptionValue(b)===void 0?!1:this.getOptionValueSource(b)!=="default"});i.filter(v=>v.conflictsWith.length>0).forEach(v=>{let b=i.find(e=>v.conflictsWith.includes(e.attributeName()));b&&this._conflictingOption(v,b);});}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(i=>{i._checkForConflictingLocalOptions();});}parseOptions(i){let l=[],v=[],b=l,e=i.slice();function a(p){return p.length>1&&p[0]==="-"}let r=null;for(;e.length;){let p=e.shift();if(p==="--"){b===v&&b.push(p),b.push(...e);break}if(r&&!a(p)){this.emit(`option:${r.name()}`,p);continue}if(r=null,a(p)){let c=this._findOption(p);if(c){if(c.required){let t=e.shift();t===void 0&&this.optionMissingArgument(c),this.emit(`option:${c.name()}`,t);}else if(c.optional){let t=null;e.length>0&&!a(e[0])&&(t=e.shift()),this.emit(`option:${c.name()}`,t);}else this.emit(`option:${c.name()}`);r=c.variadic?c:null;continue}}if(p.length>2&&p[0]==="-"&&p[1]!=="-"){let c=this._findOption(`-${p[1]}`);if(c){c.required||c.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${c.name()}`,p.slice(2)):(this.emit(`option:${c.name()}`),e.unshift(`-${p.slice(2)}`));continue}}if(/^--[^=]+=/.test(p)){let c=p.indexOf("="),t=this._findOption(p.slice(0,c));if(t&&(t.required||t.optional)){this.emit(`option:${t.name()}`,p.slice(c+1));continue}}if(a(p)&&(b=v),(this._enablePositionalOptions||this._passThroughOptions)&&l.length===0&&v.length===0){if(this._findCommand(p)){l.push(p),e.length>0&&v.push(...e);break}else if(this._getHelpCommand()&&p===this._getHelpCommand().name()){l.push(p),e.length>0&&l.push(...e);break}else if(this._defaultCommandName){v.push(p),e.length>0&&v.push(...e);break}}if(this._passThroughOptions){b.push(p),e.length>0&&b.push(...e);break}b.push(p);}return {operands:l,unknown:v}}opts(){if(this._storeOptionsAsProperties){let i={},l=this.options.length;for(let v=0;v<l;v++){let b=this.options[v].attributeName();i[b]=b===this._versionOptionName?this._version:this[b];}return i}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((i,l)=>Object.assign(i,l.opts()),{})}error(i,l){this._outputConfiguration.outputError(`${i}
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
`),this.outputHelp({error:!0}));let v=l||{},b=v.exitCode||1,e=v.code||"commander.error";this._exit(b,e,i);}_parseOptionsEnv(){this.options.forEach(i=>{if(i.envVar&&i.envVar in _n.env){let l=i.attributeName();(this.getOptionValue(l)===void 0||["default","config","env"].includes(this.getOptionValueSource(l)))&&(i.required||i.optional?this.emit(`optionEnv:${i.name()}`,_n.env[i.envVar]):this.emit(`optionEnv:${i.name()}`));}});}_parseOptionsImplied(){let i=new gy(this.options),l=v=>this.getOptionValue(v)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(v));this.options.filter(v=>v.implied!==void 0&&l(v.attributeName())&&i.valueFromOption(this.getOptionValue(v.attributeName()),v)).forEach(v=>{Object.keys(v.implied).filter(b=>!l(b)).forEach(b=>{this.setOptionValueWithSource(b,v.implied[b],"implied");});});}missingArgument(i){let l=`error: missing required argument '${i}'`;this.error(l,{code:"commander.missingArgument"});}optionMissingArgument(i){let l=`error: option '${i.flags}' argument missing`;this.error(l,{code:"commander.optionMissingArgument"});}missingMandatoryOptionValue(i){let l=`error: required option '${i.flags}' not specified`;this.error(l,{code:"commander.missingMandatoryOptionValue"});}_conflictingOption(i,l){let v=a=>{let r=a.attributeName(),p=this.getOptionValue(r),c=this.options.find(n=>n.negate&&r===n.attributeName()),t=this.options.find(n=>!n.negate&&r===n.attributeName());return c&&(c.presetArg===void 0&&p===!1||c.presetArg!==void 0&&p===c.presetArg)?c:t||a},b=a=>{let r=v(a),p=r.attributeName();return this.getOptionValueSource(p)==="env"?`environment variable '${r.envVar}'`:`option '${r.flags}'`},e=`error: ${b(i)} cannot be used with ${b(l)}`;this.error(e,{code:"commander.conflictingOption"});}unknownOption(i){if(this._allowUnknownOption)return;let l="";if(i.startsWith("--")&&this._showSuggestionAfterError){let b=[],e=this;do{let a=e.createHelp().visibleOptions(e).filter(r=>r.long).map(r=>r.long);b=b.concat(a),e=e.parent;}while(e&&!e._enablePositionalOptions);l=Pc(i,b);}let v=`error: unknown option '${i}'${l}`;this.error(v,{code:"commander.unknownOption"});}_excessArguments(i){if(this._allowExcessArguments)return;let l=this.registeredArguments.length,v=l===1?"":"s",e=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${l} argument${v} but got ${i.length}.`;this.error(e,{code:"commander.excessArguments"});}unknownCommand(){let i=this.args[0],l="";if(this._showSuggestionAfterError){let b=[];this.createHelp().visibleCommands(this).forEach(e=>{b.push(e.name()),e.alias()&&b.push(e.alias());}),l=Pc(i,b);}let v=`error: unknown command '${i}'${l}`;this.error(v,{code:"commander.unknownCommand"});}version(i,l,v){if(i===void 0)return this._version;this._version=i,l=l||"-V, --version",v=v||"output the version number";let b=this.createOption(l,v);return this._versionOptionName=b.attributeName(),this._registerOption(b),this.on("option:"+b.name(),()=>{this._outputConfiguration.writeOut(`${i}
`),this._exit(0,"commander.version",i);}),this}description(i,l){return i===void 0&&l===void 0?this._description:(this._description=i,l&&(this._argsDescription=l),this)}summary(i){return i===void 0?this._summary:(this._summary=i,this)}alias(i){if(i===void 0)return this._aliases[0];let l=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(l=this.commands[this.commands.length-1]),i===l._name)throw new Error("Command alias can't be the same as its name");let v=this.parent?._findCommand(i);if(v){let b=[v.name()].concat(v.aliases()).join("|");throw new Error(`cannot add alias '${i}' to command '${this.name()}' as already have command '${b}'`)}return l._aliases.push(i),this}aliases(i){return i===void 0?this._aliases:(i.forEach(l=>this.alias(l)),this)}usage(i){if(i===void 0){if(this._usage)return this._usage;let l=this.registeredArguments.map(v=>yy(v));return [].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?l:[]).join(" ")}return this._usage=i,this}name(i){return i===void 0?this._name:(this._name=i,this)}nameFromFilename(i){return this._name=Ws.basename(i,Ws.extname(i)),this}executableDir(i){return i===void 0?this._executableDir:(this._executableDir=i,this)}helpInformation(i){let l=this.createHelp();return l.helpWidth===void 0&&(l.helpWidth=i&&i.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),l.formatHelp(this,l)}_getHelpContext(i){i=i||{};let l={error:!!i.error},v;return l.error?v=b=>this._outputConfiguration.writeErr(b):v=b=>this._outputConfiguration.writeOut(b),l.write=i.write||v,l.command=this,l}outputHelp(i){let l;typeof i=="function"&&(l=i,i=void 0);let v=this._getHelpContext(i);this._getCommandAndAncestors().reverse().forEach(e=>e.emit("beforeAllHelp",v)),this.emit("beforeHelp",v);let b=this.helpInformation(v);if(l&&(b=l(b),typeof b!="string"&&!Buffer.isBuffer(b)))throw new Error("outputHelp callback must return a string or a Buffer");v.write(b),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",v),this._getCommandAndAncestors().forEach(e=>e.emit("afterAllHelp",v));}helpOption(i,l){return typeof i=="boolean"?(i?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(i=i??"-h, --help",l=l??"display help for command",this._helpOption=this.createOption(i,l),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(i){return this._helpOption=i,this}help(i){this.outputHelp(i);let l=_n.exitCode||0;l===0&&i&&typeof i!="function"&&i.error&&(l=1),this._exit(l,"commander.help","(outputHelp)");}addHelpText(i,l){let v=["beforeAll","before","after","afterAll"];if(!v.includes(i))throw new Error(`Unexpected value for position to addHelpText.
Expecting one of '${v.join("', '")}'`);let b=`${i}Help`;return this.on(b,e=>{let a;typeof l=="function"?a=l({error:e.error,command:e.command}):a=l,a&&e.write(`${a}
`);}),this}_outputHelpIfRequested(i){let l=this._getHelpOption();l&&i.find(b=>l.is(b))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"));}};function Ac(y){return y.map(i=>{if(!i.startsWith("--inspect"))return i;let l,v="127.0.0.1",b="9229",e;return (e=i.match(/^(--inspect(-brk)?)$/))!==null?l=e[1]:(e=i.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(l=e[1],/^\d+$/.test(e[3])?b=e[3]:v=e[3]):(e=i.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(l=e[1],v=e[3],b=e[4]),l&&b!=="0"?`${l}=${v}:${parseInt(b)+1}`:i})}Cc.Command=Mo;});var Oc=c(hs=>{k();var{Argument:xc}=Gi(),{Command:$o}=_c(),{CommanderError:Ey,InvalidArgumentError:wc}=ei(),{Help:vy}=Oo(),{Option:Ic}=jo();hs.program=new $o;hs.createCommand=y=>new $o(y);hs.createOption=(y,i)=>new Ic(y,i);hs.createArgument=(y,i)=>new xc(y,i);hs.Command=$o;hs.Option=Ic;hs.Argument=xc;hs.Help=vy;hs.CommanderError=Ey;hs.InvalidArgumentError=wc;hs.InvalidOptionArgumentError=wc;});var Nc,er,pT,dT,hT,fT,mT,yT,bT,gT,Hi,ET,yr=b(()=>{k();Nc=e(Oc(),1),{program:er,createCommand:pT,createArgument:dT,createOption:hT,CommanderError:fT,InvalidArgumentError:mT,InvalidOptionArgumentError:yT,Command:bT,Argument:gT,Option:Hi,Help:ET}=Nc.default;});var qi,kc=b(()=>{k();yr();qi=new Hi("-D, --debugger","Debugger mode").default(!1);});var Sy,jc,Lc=b(()=>{k();yr();Sy=Fc.join(Fc.resolve()),jc=new Hi("-C, --config <relativePath>","path to config").default(Sy);});var Vo=b(()=>{k();kc();Lc();});var Rc,Bc=b(()=>{k();Rc=(y,i,l)=>i?l:y;});function Py(){let y=new Map;for(let[i,l]of Object.entries(vn)){for(let[v,b]of Object.entries(l))vn[v]={open:`\x1B[${b[0]}m`,close:`\x1B[${b[1]}m`},l[v]=vn[v],y.set(b[0],b[1]);Object.defineProperty(vn,i,{value:l,enumerable:!1});}return Object.defineProperty(vn,"codes",{value:y,enumerable:!1}),vn.color.close="\x1B[39m",vn.bgColor.close="\x1B[49m",vn.color.ansi=Mc(),vn.color.ansi256=$c(),vn.color.ansi16m=Vc(),vn.bgColor.ansi=Mc(10),vn.bgColor.ansi256=$c(10),vn.bgColor.ansi16m=Vc(10),Object.defineProperties(vn,{rgbToAnsi256:{value(i,l,v){return i===l&&l===v?i<8?16:i>248?231:Math.round((i-8)/247*24)+232:16+36*Math.round(i/255*5)+6*Math.round(l/255*5)+Math.round(v/255*5)},enumerable:!1},hexToRgb:{value(i){let l=/[a-f\d]{6}|[a-f\d]{3}/i.exec(i.toString(16));if(!l)return [0,0,0];let[v]=l;v.length===3&&(v=[...v].map(e=>e+e).join(""));let b=Number.parseInt(v,16);return [b>>16&255,b>>8&255,b&255]},enumerable:!1},hexToAnsi256:{value:i=>vn.rgbToAnsi256(...vn.hexToRgb(i)),enumerable:!1},ansi256ToAnsi:{value(i){if(i<8)return 30+i;if(i<16)return 90+(i-8);let l,v,b;if(i>=232)l=((i-232)*10+8)/255,v=l,b=l;else {i-=16;let r=i%36;l=Math.floor(i/36)/5,v=Math.floor(r/6)/5,b=r%6/5;}let e=Math.max(l,v,b)*2;if(e===0)return 30;let a=30+(Math.round(b)<<2|Math.round(v)<<1|Math.round(l));return e===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(i,l,v)=>vn.ansi256ToAnsi(vn.rgbToAnsi256(i,l,v)),enumerable:!1},hexToAnsi:{value:i=>vn.ansi256ToAnsi(vn.hexToAnsi256(i)),enumerable:!1}}),vn}var Mc,$c,Vc,vn,Ty,Dy,Ay,As,Uc=b(()=>{k();Mc=(y=0)=>i=>`\x1B[${i+y}m`,$c=(y=0)=>i=>`\x1B[${38+y};5;${i}m`,Vc=(y=0)=>(i,l,v)=>`\x1B[${38+y};2;${i};${l};${v}m`,vn={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(vn.modifier),Ty=Object.keys(vn.color),Dy=Object.keys(vn.bgColor),[...Ty,...Dy];Ay=Py(),As=Ay;});function fs(y,i=globalThis.Deno?globalThis.Deno.args:xs.argv){let l=y.startsWith("-")?"":y.length===1?"-":"--",v=i.indexOf(l+y),b=i.indexOf("--");return v!==-1&&(b===-1||v<b)}function _y(){if("FORCE_COLOR"in Tn)return Tn.FORCE_COLOR==="true"?1:Tn.FORCE_COLOR==="false"?0:Tn.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Tn.FORCE_COLOR,10),3)}function xy(y){return y===0?!1:{level:y,hasBasic:!0,has256:y>=2,has16m:y>=3}}function wy(y,{streamIsTTY:i,sniffFlags:l=!0}={}){let v=_y();v!==void 0&&(Yi=v);let b=l?Yi:v;if(b===0)return 0;if(l){if(fs("color=16m")||fs("color=full")||fs("color=truecolor"))return 3;if(fs("color=256"))return 2}if("TF_BUILD"in Tn&&"AGENT_NAME"in Tn)return 1;if(y&&!i&&b===void 0)return 0;let e=b||0;if(Tn.TERM==="dumb")return e;if(xs.platform==="win32"){let a=Cy.release().split(".");return Number(a[0])>=10&&Number(a[2])>=10586?Number(a[2])>=14931?3:2:1}if("CI"in Tn)return "GITHUB_ACTIONS"in Tn||"GITEA_ACTIONS"in Tn?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(a=>a in Tn)||Tn.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in Tn)return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Tn.TEAMCITY_VERSION)?1:0;if(Tn.COLORTERM==="truecolor"||Tn.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in Tn){let a=Number.parseInt((Tn.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Tn.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return /-256(color)?$/i.test(Tn.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Tn.TERM)||"COLORTERM"in Tn?1:e}function Kc(y,i={}){let l=wy(y,{streamIsTTY:y&&y.isTTY,...i});return xy(l)}var Tn,Yi,Iy,Gc,Hc=b(()=>{k();({env:Tn}=xs);fs("no-color")||fs("no-colors")||fs("color=false")||fs("color=never")?Yi=0:(fs("color")||fs("colors")||fs("color=true")||fs("color=always"))&&(Yi=1);Iy={stdout:Kc({isTTY:Wc.isatty(1)}),stderr:Kc({isTTY:Wc.isatty(2)})},Gc=Iy;});function qc(y,i,l){let v=y.indexOf(i);if(v===-1)return y;let b=i.length,e=0,a="";do a+=y.slice(e,v)+i+l,e=v+b,v=y.indexOf(i,e);while(v!==-1);return a+=y.slice(e),a}function Yc(y,i,l,v){let b=0,e="";do{let a=y[v-1]==="\r";e+=y.slice(b,a?v-1:v)+i+(a?`\r
`:`
`)+l,b=v+1,v=y.indexOf(`
`,b);}while(v!==-1);return e+=y.slice(b),e}var zc=b(()=>{k();});function ni(y){return Ny(y)}var Jc,Xc,Wo,Or,ti,Qc,Nr,Oy,Ny,Ko,ky,Fy,Go,zi,jy,Ly,Ks,Ho=b(()=>{k();Uc();Hc();zc();(({stdout:Jc,stderr:Xc}=Gc)),Wo=Symbol("GENERATOR"),Or=Symbol("STYLER"),ti=Symbol("IS_EMPTY"),Qc=["ansi","ansi","ansi256","ansi16m"],Nr=Object.create(null),Oy=(y,i={})=>{if(i.level&&!(Number.isInteger(i.level)&&i.level>=0&&i.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let l=Jc?Jc.level:0;y.level=i.level===void 0?l:i.level;},Ny=y=>{let i=(...l)=>l.join(" ");return Oy(i,y),Object.setPrototypeOf(i,ni.prototype),i};Object.setPrototypeOf(ni.prototype,Function.prototype);for(let[y,i]of Object.entries(As))Nr[y]={get(){let l=zi(this,Go(i.open,i.close,this[Or]),this[ti]);return Object.defineProperty(this,y,{value:l}),l}};Nr.visible={get(){let y=zi(this,this[Or],!0);return Object.defineProperty(this,"visible",{value:y}),y}};Ko=(y,i,l,...v)=>y==="rgb"?i==="ansi16m"?As[l].ansi16m(...v):i==="ansi256"?As[l].ansi256(As.rgbToAnsi256(...v)):As[l].ansi(As.rgbToAnsi(...v)):y==="hex"?Ko("rgb",i,l,...As.hexToRgb(...v)):As[l][y](...v),ky=["rgb","hex","ansi256"];for(let y of ky){Nr[y]={get(){let{level:l}=this;return function(...v){let b=Go(Ko(y,Qc[l],"color",...v),As.color.close,this[Or]);return zi(this,b,this[ti])}}};let i="bg"+y[0].toUpperCase()+y.slice(1);Nr[i]={get(){let{level:l}=this;return function(...v){let b=Go(Ko(y,Qc[l],"bgColor",...v),As.bgColor.close,this[Or]);return zi(this,b,this[ti])}}};}Fy=Object.defineProperties(()=>{},{...Nr,level:{enumerable:!0,get(){return this[Wo].level},set(y){this[Wo].level=y;}}}),Go=(y,i,l)=>{let v,b;return l===void 0?(v=y,b=i):(v=l.openAll+y,b=i+l.closeAll),{open:y,close:i,openAll:v,closeAll:b,parent:l}},zi=(y,i,l)=>{let v=(...b)=>jy(v,b.length===1?""+b[0]:b.join(" "));return Object.setPrototypeOf(v,Fy),v[Wo]=y,v[Or]=i,v[ti]=l,v},jy=(y,i)=>{if(y.level<=0||!i)return y[ti]?"":i;let l=y[Or];if(l===void 0)return i;let{openAll:v,closeAll:b}=l;if(i.includes("\x1B"))for(;l!==void 0;)i=qc(i,l.close,l.open),l=l.parent;let e=i.indexOf(`
`);return e!==-1&&(i=Yc(i,b,v,e)),v+i+b};Object.defineProperties(ni.prototype,Nr);Ly=ni(),ni({level:Xc?Xc.level:0}),Ks=Ly;});var bn,Zc=b(()=>{k();Ho();bn={log(...y){console.log(...y);},error(...y){console.error(Ks.bgRed(" ERROR "),...y);},debug(...y){process.env.DEBUG==="TRUE"&&console.debug(Ks.bgGray(" DEBUG "),...y);},success(...y){console.log(Ks.bgGreen(" SUCCESS "),...y);},info(...y){console.info(Ks.bgBlue(" INFO "),...y);},warn(...y){console.warn(Ks.bgYellow(" WARN "),...y);}};});var Ji,ep=b(()=>{k();Ji=(y,i)=>{if(y==null)return i;if(i==null||typeof y!="object"||typeof i!="object")return y;let l={...y};for(let v in i){if(!(v in l)){l[v]=i[v];continue}typeof i[v]=="object"&&typeof l[v]=="object"&&!Array.isArray(i[v])&&!Array.isArray(l[v])&&(l[v]=Ji(l[v],i[v]));}return l};});var br=b(()=>{k();Bc();Zc();ep();});var qo=b(()=>{k();});var nn=c(Hn=>{k();var Yo=Symbol.for("yaml.alias"),tp=Symbol.for("yaml.document"),Xi=Symbol.for("yaml.map"),np=Symbol.for("yaml.pair"),zo=Symbol.for("yaml.scalar"),Qi=Symbol.for("yaml.seq"),Gs=Symbol.for("yaml.node.type"),Ry=y=>!!y&&typeof y=="object"&&y[Gs]===Yo,By=y=>!!y&&typeof y=="object"&&y[Gs]===tp,My=y=>!!y&&typeof y=="object"&&y[Gs]===Xi,$y=y=>!!y&&typeof y=="object"&&y[Gs]===np,sp=y=>!!y&&typeof y=="object"&&y[Gs]===zo,Vy=y=>!!y&&typeof y=="object"&&y[Gs]===Qi;function rp(y){if(y&&typeof y=="object")switch(y[Gs]){case Xi:case Qi:return !0}return !1}function Uy(y){if(y&&typeof y=="object")switch(y[Gs]){case Yo:case Xi:case zo:case Qi:return !0}return !1}var Wy=y=>(sp(y)||rp(y))&&!!y.anchor;Hn.ALIAS=Yo;Hn.DOC=tp;Hn.MAP=Xi;Hn.NODE_TYPE=Gs;Hn.PAIR=np;Hn.SCALAR=zo;Hn.SEQ=Qi;Hn.hasAnchor=Wy;Hn.isAlias=Ry;Hn.isCollection=rp;Hn.isDocument=By;Hn.isMap=My;Hn.isNode=Uy;Hn.isPair=$y;Hn.isScalar=sp;Hn.isSeq=Vy;});var si=c(Jo=>{k();var Bn=nn(),ts=Symbol("break visit"),ip=Symbol("skip children"),Ls=Symbol("remove node");function Zi(y,i){let l=ap(i);Bn.isDocument(y)?kr(null,y.contents,l,Object.freeze([y]))===Ls&&(y.contents=null):kr(null,y,l,Object.freeze([]));}Zi.BREAK=ts;Zi.SKIP=ip;Zi.REMOVE=Ls;function kr(y,i,l,v){let b=op(y,i,l,v);if(Bn.isNode(b)||Bn.isPair(b))return lp(y,v,b),kr(y,b,l,v);if(typeof b!="symbol"){if(Bn.isCollection(i)){v=Object.freeze(v.concat(i));for(let e=0;e<i.items.length;++e){let a=kr(e,i.items[e],l,v);if(typeof a=="number")e=a-1;else {if(a===ts)return ts;a===Ls&&(i.items.splice(e,1),e-=1);}}}else if(Bn.isPair(i)){v=Object.freeze(v.concat(i));let e=kr("key",i.key,l,v);if(e===ts)return ts;e===Ls&&(i.key=null);let a=kr("value",i.value,l,v);if(a===ts)return ts;a===Ls&&(i.value=null);}}return b}async function ea(y,i){let l=ap(i);Bn.isDocument(y)?await Fr(null,y.contents,l,Object.freeze([y]))===Ls&&(y.contents=null):await Fr(null,y,l,Object.freeze([]));}ea.BREAK=ts;ea.SKIP=ip;ea.REMOVE=Ls;async function Fr(y,i,l,v){let b=await op(y,i,l,v);if(Bn.isNode(b)||Bn.isPair(b))return lp(y,v,b),Fr(y,b,l,v);if(typeof b!="symbol"){if(Bn.isCollection(i)){v=Object.freeze(v.concat(i));for(let e=0;e<i.items.length;++e){let a=await Fr(e,i.items[e],l,v);if(typeof a=="number")e=a-1;else {if(a===ts)return ts;a===Ls&&(i.items.splice(e,1),e-=1);}}}else if(Bn.isPair(i)){v=Object.freeze(v.concat(i));let e=await Fr("key",i.key,l,v);if(e===ts)return ts;e===Ls&&(i.key=null);let a=await Fr("value",i.value,l,v);if(a===ts)return ts;a===Ls&&(i.value=null);}}return b}function ap(y){return typeof y=="object"&&(y.Collection||y.Node||y.Value)?Object.assign({Alias:y.Node,Map:y.Node,Scalar:y.Node,Seq:y.Node},y.Value&&{Map:y.Value,Scalar:y.Value,Seq:y.Value},y.Collection&&{Map:y.Collection,Seq:y.Collection},y):y}function op(y,i,l,v){if(typeof l=="function")return l(y,i,v);if(Bn.isMap(i))return l.Map?.(y,i,v);if(Bn.isSeq(i))return l.Seq?.(y,i,v);if(Bn.isPair(i))return l.Pair?.(y,i,v);if(Bn.isScalar(i))return l.Scalar?.(y,i,v);if(Bn.isAlias(i))return l.Alias?.(y,i,v)}function lp(y,i,l){let v=i[i.length-1];if(Bn.isCollection(v))v.items[y]=l;else if(Bn.isPair(v))y==="key"?v.key=l:v.value=l;else if(Bn.isDocument(v))v.contents=l;else {let b=Bn.isAlias(v)?"alias":"scalar";throw new Error(`Cannot replace node with ${b} parent`)}}Jo.visit=Zi;Jo.visitAsync=ea;});var Xo=c(cp=>{k();var up=nn(),Ky=si(),Gy={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Hy=y=>y.replace(/[!,[\]{}]/g,i=>Gy[i]),ri=class y{constructor(i,l){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},y.defaultYaml,i),this.tags=Object.assign({},y.defaultTags,l);}clone(){let i=new y(this.yaml,this.tags);return i.docStart=this.docStart,i}atDocument(){let i=new y(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:y.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},y.defaultTags);break}return i}add(i,l){this.atNextDocument&&(this.yaml={explicit:y.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},y.defaultTags),this.atNextDocument=!1);let v=i.trim().split(/[ \t]+/),b=v.shift();switch(b){case"%TAG":{if(v.length!==2&&(l(0,"%TAG directive should contain exactly two parts"),v.length<2))return !1;let[e,a]=v;return this.tags[e]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,v.length!==1)return l(0,"%YAML directive should contain exactly one part"),!1;let[e]=v;if(e==="1.1"||e==="1.2")return this.yaml.version=e,!0;{let a=/^\d+\.\d+$/.test(e);return l(6,`Unsupported YAML version ${e}`,a),!1}}default:return l(0,`Unknown directive ${b}`,!0),!1}}tagName(i,l){if(i==="!")return "!";if(i[0]!=="!")return l(`Not a valid tag: ${i}`),null;if(i[1]==="<"){let a=i.slice(2,-1);return a==="!"||a==="!!"?(l(`Verbatim tags aren't resolved, so ${i} is invalid.`),null):(i[i.length-1]!==">"&&l("Verbatim tags must end with a >"),a)}let[,v,b]=i.match(/^(.*!)([^!]*)$/s);b||l(`The ${i} tag has no suffix`);let e=this.tags[v];if(e)try{return e+decodeURIComponent(b)}catch(a){return l(String(a)),null}return v==="!"?i:(l(`Could not resolve tag: ${i}`),null)}tagString(i){for(let[l,v]of Object.entries(this.tags))if(i.startsWith(v))return l+Hy(i.substring(v.length));return i[0]==="!"?i:`!<${i}>`}toString(i){let l=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],v=Object.entries(this.tags),b;if(i&&v.length>0&&up.isNode(i.contents)){let e={};Ky.visit(i.contents,(a,r)=>{up.isNode(r)&&r.tag&&(e[r.tag]=!0);}),b=Object.keys(e);}else b=[];for(let[e,a]of v)e==="!!"&&a==="tag:yaml.org,2002:"||(!i||b.some(r=>r.startsWith(a)))&&l.push(`%TAG ${e} ${a}`);return l.join(`
`)}};ri.defaultYaml={explicit:!1,version:"1.2"};ri.defaultTags={"!!":"tag:yaml.org,2002:"};cp.Directives=ri;});var ta=c(ii=>{k();var pp=nn(),qy=si();function Yy(y){if(/[\x00-\x19\s,[\]{}]/.test(y)){let l=`Anchor must not contain whitespace or control characters: ${JSON.stringify(y)}`;throw new Error(l)}return !0}function dp(y){let i=new Set;return qy.visit(y,{Value(l,v){v.anchor&&i.add(v.anchor);}}),i}function hp(y,i){for(let l=1;;++l){let v=`${y}${l}`;if(!i.has(v))return v}}function zy(y,i){let l=[],v=new Map,b=null;return {onAnchor:e=>{l.push(e),b||(b=dp(y));let a=hp(i,b);return b.add(a),a},setAnchors:()=>{for(let e of l){let a=v.get(e);if(typeof a=="object"&&a.anchor&&(pp.isScalar(a.node)||pp.isCollection(a.node)))a.node.anchor=a.anchor;else {let r=new Error("Failed to resolve repeated object (this should not happen)");throw r.source=e,r}}},sourceObjects:v}}ii.anchorIsValid=Yy;ii.anchorNames=dp;ii.createNodeAnchors=zy;ii.findNewAnchor=hp;});var Qo=c(fp=>{k();function ai(y,i,l,v){if(v&&typeof v=="object")if(Array.isArray(v))for(let b=0,e=v.