UNPKG

context-dump

Version:

An interactive CLI tool to create AI-friendly context from selected files.

23 lines 588 kB
#!/usr/bin/env node import{createRequire as gq}from"node:module";var vq=Object.create;var{getPrototypeOf:xq,defineProperty:F3,getOwnPropertyNames:fq}=Object;var hq=Object.prototype.hasOwnProperty;var t=(D,F,$)=>{$=D!=null?vq(xq(D)):{};let Z=F||!D||!D.__esModule?F3($,"default",{value:D,enumerable:!0}):$;for(let Y of fq(D))if(!hq.call(Z,Y))F3(Z,Y,{get:()=>D[Y],enumerable:!0});return Z};var q=(D,F)=>()=>(F||D((F={exports:{}}).exports,F),F.exports);var u=gq(import.meta.url);var y8=q((_q)=>{class J4 extends Error{constructor(D,F,$){super($);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=F,this.exitCode=D,this.nestedError=void 0}}class $3 extends J4{constructor(D){super(1,"commander.invalidArgument",D);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}_q.CommanderError=J4;_q.InvalidArgumentError=$3});var G0=q((pq)=>{var{InvalidArgumentError:bq}=y8();class Z3{constructor(D,F){switch(this.description=F||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,D[0]){case"<":this.required=!0,this._name=D.slice(1,-1);break;case"[":this.required=!1,this._name=D.slice(1,-1);break;default:this.required=!0,this._name=D;break}if(this._name.length>3&&this._name.slice(-3)==="...")this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_concatValue(D,F){if(F===this.defaultValue||!Array.isArray(F))return[D];return F.concat(D)}default(D,F){return this.defaultValue=D,this.defaultValueDescription=F,this}argParser(D){return this.parseArg=D,this}choices(D){return this.argChoices=D.slice(),this.parseArg=(F,$)=>{if(!this.argChoices.includes(F))throw new bq(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._concatValue(F,$);return F},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function dq(D){let F=D.name()+(D.variadic===!0?"...":"");return D.required?"<"+F+">":"["+F+"]"}pq.Argument=Z3;pq.humanReadableArgName=dq});var Q4=q((nq)=>{var{humanReadableArgName:cq}=G0();class Y3{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(D){let F=D.commands.filter((Z)=>!Z._hidden),$=D._getHelpCommand();if($&&!$._hidden)F.push($);if(this.sortSubcommands)F.sort((Z,Y)=>{return Z.name().localeCompare(Y.name())});return F}compareOptions(D,F){let $=(Z)=>{return Z.short?Z.short.replace(/^-/,""):Z.long.replace(/^--/,"")};return $(D).localeCompare($(F))}visibleOptions(D){let F=D.options.filter((Z)=>!Z.hidden),$=D._getHelpOption();if($&&!$.hidden){let Z=$.short&&D._findOption($.short),Y=$.long&&D._findOption($.long);if(!Z&&!Y)F.push($);else if($.long&&!Y)F.push(D.createOption($.long,$.description));else if($.short&&!Z)F.push(D.createOption($.short,$.description))}if(this.sortOptions)F.sort(this.compareOptions);return F}visibleGlobalOptions(D){if(!this.showGlobalOptions)return[];let F=[];for(let $=D.parent;$;$=$.parent){let Z=$.options.filter((Y)=>!Y.hidden);F.push(...Z)}if(this.sortOptions)F.sort(this.compareOptions);return F}visibleArguments(D){if(D._argsDescription)D.registeredArguments.forEach((F)=>{F.description=F.description||D._argsDescription[F.name()]||""});if(D.registeredArguments.find((F)=>F.description))return D.registeredArguments;return[]}subcommandTerm(D){let F=D.registeredArguments.map(($)=>cq($)).join(" ");return D._name+(D._aliases[0]?"|"+D._aliases[0]:"")+(D.options.length?" [options]":"")+(F?" "+F:"")}optionTerm(D){return D.flags}argumentTerm(D){return D.name()}longestSubcommandTermLength(D,F){return F.visibleCommands(D).reduce(($,Z)=>{return Math.max($,F.subcommandTerm(Z).length)},0)}longestOptionTermLength(D,F){return F.visibleOptions(D).reduce(($,Z)=>{return Math.max($,F.optionTerm(Z).length)},0)}longestGlobalOptionTermLength(D,F){return F.visibleGlobalOptions(D).reduce(($,Z)=>{return Math.max($,F.optionTerm(Z).length)},0)}longestArgumentTermLength(D,F){return F.visibleArguments(D).reduce(($,Z)=>{return Math.max($,F.argumentTerm(Z).length)},0)}commandUsage(D){let F=D._name;if(D._aliases[0])F=F+"|"+D._aliases[0];let $="";for(let Z=D.parent;Z;Z=Z.parent)$=Z.name()+" "+$;return $+F+" "+D.usage()}commandDescription(D){return D.description()}subcommandDescription(D){return D.summary()||D.description()}optionDescription(D){let F=[];if(D.argChoices)F.push(`choices: ${D.argChoices.map(($)=>JSON.stringify($)).join(", ")}`);if(D.defaultValue!==void 0){if(D.required||D.optional||D.isBoolean()&&typeof D.defaultValue==="boolean")F.push(`default: ${D.defaultValueDescription||JSON.stringify(D.defaultValue)}`)}if(D.presetArg!==void 0&&D.optional)F.push(`preset: ${JSON.stringify(D.presetArg)}`);if(D.envVar!==void 0)F.push(`env: ${D.envVar}`);if(F.length>0)return`${D.description} (${F.join(", ")})`;return D.description}argumentDescription(D){let F=[];if(D.argChoices)F.push(`choices: ${D.argChoices.map(($)=>JSON.stringify($)).join(", ")}`);if(D.defaultValue!==void 0)F.push(`default: ${D.defaultValueDescription||JSON.stringify(D.defaultValue)}`);if(F.length>0){let $=`(${F.join(", ")})`;if(D.description)return`${D.description} ${$}`;return $}return D.description}formatHelp(D,F){let $=F.padWidth(D,F),Z=F.helpWidth||80,Y=2,X=2;function J(V,E){if(E){let T=`${V.padEnd($+2)}${E}`;return F.wrap(T,Z-2,$+2)}return V}function Q(V){return V.join(` `).replace(/^/gm," ".repeat(2))}let G=[`Usage: ${F.commandUsage(D)}`,""],H=F.commandDescription(D);if(H.length>0)G=G.concat([F.wrap(H,Z,0),""]);let W=F.visibleArguments(D).map((V)=>{return J(F.argumentTerm(V),F.argumentDescription(V))});if(W.length>0)G=G.concat(["Arguments:",Q(W),""]);let z=F.visibleOptions(D).map((V)=>{return J(F.optionTerm(V),F.optionDescription(V))});if(z.length>0)G=G.concat(["Options:",Q(z),""]);if(this.showGlobalOptions){let V=F.visibleGlobalOptions(D).map((E)=>{return J(F.optionTerm(E),F.optionDescription(E))});if(V.length>0)G=G.concat(["Global Options:",Q(V),""])}let B=F.visibleCommands(D).map((V)=>{return J(F.subcommandTerm(V),F.subcommandDescription(V))});if(B.length>0)G=G.concat(["Commands:",Q(B),""]);return G.join(` `)}padWidth(D,F){return Math.max(F.longestOptionTermLength(D,F),F.longestGlobalOptionTermLength(D,F),F.longestSubcommandTermLength(D,F),F.longestArgumentTermLength(D,F))}wrap(D,F,$,Z=40){let X=new RegExp(`[\\n][${" \\f\\t\\v   -    \uFEFF"}]+`);if(D.match(X))return D;let J=F-$;if(J<Z)return D;let Q=D.slice(0,$),G=D.slice($).replace(`\r `,` `),H=" ".repeat($),z=`\\s${"​"}`,B=new RegExp(` |.{1,${J-1}}([${z}]|$)|[^${z}]+?([${z}]|$)`,"g"),V=G.match(B)||[];return Q+V.map((E,T)=>{if(E===` `)return"";return(T>0?H:"")+E.trimEnd()}).join(` `)}}nq.Help=Y3});var G4=q((rq)=>{var{InvalidArgumentError:tq}=y8();class X3{constructor(D,F){this.flags=D,this.description=F||"",this.required=D.includes("<"),this.optional=D.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(D),this.mandatory=!1;let $=sq(D);if(this.short=$.shortFlag,this.long=$.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(D,F){return this.defaultValue=D,this.defaultValueDescription=F,this}preset(D){return this.presetArg=D,this}conflicts(D){return this.conflictsWith=this.conflictsWith.concat(D),this}implies(D){let F=D;if(typeof D==="string")F={[D]:!0};return this.implied=Object.assign(this.implied||{},F),this}env(D){return this.envVar=D,this}argParser(D){return this.parseArg=D,this}makeOptionMandatory(D=!0){return this.mandatory=!!D,this}hideHelp(D=!0){return this.hidden=!!D,this}_concatValue(D,F){if(F===this.defaultValue||!Array.isArray(F))return[D];return F.concat(D)}choices(D){return this.argChoices=D.slice(),this.parseArg=(F,$)=>{if(!this.argChoices.includes(F))throw new tq(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._concatValue(F,$);return F},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){return oq(this.name().replace(/^no-/,""))}is(D){return this.short===D||this.long===D}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class J3{constructor(D){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,D.forEach((F)=>{if(F.negate)this.negativeOptions.set(F.attributeName(),F);else this.positiveOptions.set(F.attributeName(),F)}),this.negativeOptions.forEach((F,$)=>{if(this.positiveOptions.has($))this.dualOptions.add($)})}valueFromOption(D,F){let $=F.attributeName();if(!this.dualOptions.has($))return!0;let Z=this.negativeOptions.get($).presetArg,Y=Z!==void 0?Z:!1;return F.negate===(Y===D)}}function oq(D){return D.split("-").reduce((F,$)=>{return F+$[0].toUpperCase()+$.slice(1)})}function sq(D){let F,$,Z=D.split(/[ |,]+/);if(Z.length>1&&!/^[[<]/.test(Z[1]))F=Z.shift();if($=Z.shift(),!F&&/^-[^-]$/.test($))F=$,$=void 0;return{shortFlag:F,longFlag:$}}rq.Option=X3;rq.DualOptions=J3});var Q3=q((Zz)=>{function Fz(D,F){if(Math.abs(D.length-F.length)>3)return Math.max(D.length,F.length);let $=[];for(let Z=0;Z<=D.length;Z++)$[Z]=[Z];for(let Z=0;Z<=F.length;Z++)$[0][Z]=Z;for(let Z=1;Z<=F.length;Z++)for(let Y=1;Y<=D.length;Y++){let X=1;if(D[Y-1]===F[Z-1])X=0;else X=1;if($[Y][Z]=Math.min($[Y-1][Z]+1,$[Y][Z-1]+1,$[Y-1][Z-1]+X),Y>1&&Z>1&&D[Y-1]===F[Z-2]&&D[Y-2]===F[Z-1])$[Y][Z]=Math.min($[Y][Z],$[Y-2][Z-2]+1)}return $[D.length][F.length]}function $z(D,F){if(!F||F.length===0)return"";F=Array.from(new Set(F));let $=D.startsWith("--");if($)D=D.slice(2),F=F.map((J)=>J.slice(2));let Z=[],Y=3,X=0.4;if(F.forEach((J)=>{if(J.length<=1)return;let Q=Fz(D,J),G=Math.max(D.length,J.length);if((G-Q)/G>X){if(Q<Y)Y=Q,Z=[J];else if(Q===Y)Z.push(J)}}),Z.sort((J,Q)=>J.localeCompare(Q)),$)Z=Z.map((J)=>`--${J}`);if(Z.length>1)return` (Did you mean one of ${Z.join(", ")}?)`;if(Z.length===1)return` (Did you mean ${Z[0]}?)`;return""}Zz.suggestSimilar=$z});var W3=q((Kz)=>{var Xz=u("node:events").EventEmitter,H4=u("node:child_process"),mD=u("node:path"),K4=u("node:fs"),n=u("node:process"),{Argument:Jz,humanReadableArgName:Qz}=G0(),{CommanderError:W4}=y8(),{Help:Gz}=Q4(),{Option:G3,DualOptions:Hz}=G4(),{suggestSimilar:H3}=Q3();class q4 extends Xz{constructor(D){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=D||"",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:(F)=>n.stdout.write(F),writeErr:(F)=>n.stderr.write(F),getOutHelpWidth:()=>n.stdout.isTTY?n.stdout.columns:void 0,getErrHelpWidth:()=>n.stderr.isTTY?n.stderr.columns:void 0,outputError:(F,$)=>$(F)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(D){return this._outputConfiguration=D._outputConfiguration,this._helpOption=D._helpOption,this._helpCommand=D._helpCommand,this._helpConfiguration=D._helpConfiguration,this._exitCallback=D._exitCallback,this._storeOptionsAsProperties=D._storeOptionsAsProperties,this._combineFlagAndOptionalValue=D._combineFlagAndOptionalValue,this._allowExcessArguments=D._allowExcessArguments,this._enablePositionalOptions=D._enablePositionalOptions,this._showHelpAfterError=D._showHelpAfterError,this._showSuggestionAfterError=D._showSuggestionAfterError,this}_getCommandAndAncestors(){let D=[];for(let F=this;F;F=F.parent)D.push(F);return D}command(D,F,$){let Z=F,Y=$;if(typeof Z==="object"&&Z!==null)Y=Z,Z=null;Y=Y||{};let[,X,J]=D.match(/([^ ]+) *(.*)/),Q=this.createCommand(X);if(Z)Q.description(Z),Q._executableHandler=!0;if(Y.isDefault)this._defaultCommandName=Q._name;if(Q._hidden=!!(Y.noHelp||Y.hidden),Q._executableFile=Y.executableFile||null,J)Q.arguments(J);if(this._registerCommand(Q),Q.parent=this,Q.copyInheritedSettings(this),Z)return this;return Q}createCommand(D){return new q4(D)}createHelp(){return Object.assign(new Gz,this.configureHelp())}configureHelp(D){if(D===void 0)return this._helpConfiguration;return this._helpConfiguration=D,this}configureOutput(D){if(D===void 0)return this._outputConfiguration;return Object.assign(this._outputConfiguration,D),this}showHelpAfterError(D=!0){if(typeof D!=="string")D=!!D;return this._showHelpAfterError=D,this}showSuggestionAfterError(D=!0){return this._showSuggestionAfterError=!!D,this}addCommand(D,F){if(!D._name)throw new Error(`Command passed to .addCommand() must have a name - specify the name in Command constructor or using .name()`);if(F=F||{},F.isDefault)this._defaultCommandName=D._name;if(F.noHelp||F.hidden)D._hidden=!0;return this._registerCommand(D),D.parent=this,D._checkForBrokenPassThrough(),this}createArgument(D,F){return new Jz(D,F)}argument(D,F,$,Z){let Y=this.createArgument(D,F);if(typeof $==="function")Y.default(Z).argParser($);else Y.default($);return this.addArgument(Y),this}arguments(D){return D.trim().split(/ +/).forEach((F)=>{this.argument(F)}),this}addArgument(D){let F=this.registeredArguments.slice(-1)[0];if(F&&F.variadic)throw new Error(`only the last argument can be variadic '${F.name()}'`);if(D.required&&D.defaultValue!==void 0&&D.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${D.name()}'`);return this.registeredArguments.push(D),this}helpCommand(D,F){if(typeof D==="boolean")return this._addImplicitHelpCommand=D,this;D=D??"help [command]";let[,$,Z]=D.match(/([^ ]+) *(.*)/),Y=F??"display help for command",X=this.createCommand($);if(X.helpOption(!1),Z)X.arguments(Z);if(Y)X.description(Y);return this._addImplicitHelpCommand=!0,this._helpCommand=X,this}addHelpCommand(D,F){if(typeof D!=="object")return this.helpCommand(D,F),this;return this._addImplicitHelpCommand=!0,this._helpCommand=D,this}_getHelpCommand(){if(this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))){if(this._helpCommand===void 0)this.helpCommand(void 0,void 0);return this._helpCommand}return null}hook(D,F){let $=["preSubcommand","preAction","postAction"];if(!$.includes(D))throw new Error(`Unexpected value for event passed to hook : '${D}'. Expecting one of '${$.join("', '")}'`);if(this._lifeCycleHooks[D])this._lifeCycleHooks[D].push(F);else this._lifeCycleHooks[D]=[F];return this}exitOverride(D){if(D)this._exitCallback=D;else this._exitCallback=(F)=>{if(F.code!=="commander.executeSubCommandAsync")throw F};return this}_exit(D,F,$){if(this._exitCallback)this._exitCallback(new W4(D,F,$));n.exit(D)}action(D){let F=($)=>{let Z=this.registeredArguments.length,Y=$.slice(0,Z);if(this._storeOptionsAsProperties)Y[Z]=this;else Y[Z]=this.opts();return Y.push(this),D.apply(this,Y)};return this._actionHandler=F,this}createOption(D,F){return new G3(D,F)}_callParseArg(D,F,$,Z){try{return D.parseArg(F,$)}catch(Y){if(Y.code==="commander.invalidArgument"){let X=`${Z} ${Y.message}`;this.error(X,{exitCode:Y.exitCode,code:Y.code})}throw Y}}_registerOption(D){let F=D.short&&this._findOption(D.short)||D.long&&this._findOption(D.long);if(F){let $=D.long&&this._findOption(D.long)?D.long:D.short;throw new Error(`Cannot add option '${D.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${$}' - already used by option '${F.flags}'`)}this.options.push(D)}_registerCommand(D){let F=(Z)=>{return[Z.name()].concat(Z.aliases())},$=F(D).find((Z)=>this._findCommand(Z));if($){let Z=F(this._findCommand($)).join("|"),Y=F(D).join("|");throw new Error(`cannot add command '${Y}' as already have command '${Z}'`)}this.commands.push(D)}addOption(D){this._registerOption(D);let F=D.name(),$=D.attributeName();if(D.negate){let Y=D.long.replace(/^--no-/,"--");if(!this._findOption(Y))this.setOptionValueWithSource($,D.defaultValue===void 0?!0:D.defaultValue,"default")}else if(D.defaultValue!==void 0)this.setOptionValueWithSource($,D.defaultValue,"default");let Z=(Y,X,J)=>{if(Y==null&&D.presetArg!==void 0)Y=D.presetArg;let Q=this.getOptionValue($);if(Y!==null&&D.parseArg)Y=this._callParseArg(D,Y,Q,X);else if(Y!==null&&D.variadic)Y=D._concatValue(Y,Q);if(Y==null)if(D.negate)Y=!1;else if(D.isBoolean()||D.optional)Y=!0;else Y="";this.setOptionValueWithSource($,Y,J)};if(this.on("option:"+F,(Y)=>{let X=`error: option '${D.flags}' argument '${Y}' is invalid.`;Z(Y,X,"cli")}),D.envVar)this.on("optionEnv:"+F,(Y)=>{let X=`error: option '${D.flags}' value '${Y}' from env '${D.envVar}' is invalid.`;Z(Y,X,"env")});return this}_optionEx(D,F,$,Z,Y){if(typeof F==="object"&&F instanceof G3)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let X=this.createOption(F,$);if(X.makeOptionMandatory(!!D.mandatory),typeof Z==="function")X.default(Y).argParser(Z);else if(Z instanceof RegExp){let J=Z;Z=(Q,G)=>{let H=J.exec(Q);return H?H[0]:G},X.default(Y).argParser(Z)}else X.default(Z);return this.addOption(X)}option(D,F,$,Z){return this._optionEx({},D,F,$,Z)}requiredOption(D,F,$,Z){return this._optionEx({mandatory:!0},D,F,$,Z)}combineFlagAndOptionalValue(D=!0){return this._combineFlagAndOptionalValue=!!D,this}allowUnknownOption(D=!0){return this._allowUnknownOption=!!D,this}allowExcessArguments(D=!0){return this._allowExcessArguments=!!D,this}enablePositionalOptions(D=!0){return this._enablePositionalOptions=!!D,this}passThroughOptions(D=!0){return this._passThroughOptions=!!D,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(D=!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=!!D,this}getOptionValue(D){if(this._storeOptionsAsProperties)return this[D];return this._optionValues[D]}setOptionValue(D,F){return this.setOptionValueWithSource(D,F,void 0)}setOptionValueWithSource(D,F,$){if(this._storeOptionsAsProperties)this[D]=F;else this._optionValues[D]=F;return this._optionValueSources[D]=$,this}getOptionValueSource(D){return this._optionValueSources[D]}getOptionValueSourceWithGlobals(D){let F;return this._getCommandAndAncestors().forEach(($)=>{if($.getOptionValueSource(D)!==void 0)F=$.getOptionValueSource(D)}),F}_prepareUserArgs(D,F){if(D!==void 0&&!Array.isArray(D))throw new Error("first parameter to parse must be array or undefined");if(F=F||{},D===void 0&&F.from===void 0){if(n.versions?.electron)F.from="electron";let Z=n.execArgv??[];if(Z.includes("-e")||Z.includes("--eval")||Z.includes("-p")||Z.includes("--print"))F.from="eval"}if(D===void 0)D=n.argv;this.rawArgs=D.slice();let $;switch(F.from){case void 0:case"node":this._scriptPath=D[1],$=D.slice(2);break;case"electron":if(n.defaultApp)this._scriptPath=D[1],$=D.slice(2);else $=D.slice(1);break;case"user":$=D.slice(0);break;case"eval":$=D.slice(1);break;default:throw new Error(`unexpected parse option { from: '${F.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",$}parse(D,F){let $=this._prepareUserArgs(D,F);return this._parseCommand([],$),this}async parseAsync(D,F){let $=this._prepareUserArgs(D,F);return await this._parseCommand([],$),this}_executeSubCommand(D,F){F=F.slice();let $=!1,Z=[".js",".ts",".tsx",".mjs",".cjs"];function Y(H,W){let z=mD.resolve(H,W);if(K4.existsSync(z))return z;if(Z.includes(mD.extname(W)))return;let B=Z.find((V)=>K4.existsSync(`${z}${V}`));if(B)return`${z}${B}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let X=D._executableFile||`${this._name}-${D._name}`,J=this._executableDir||"";if(this._scriptPath){let H;try{H=K4.realpathSync(this._scriptPath)}catch(W){H=this._scriptPath}J=mD.resolve(mD.dirname(H),J)}if(J){let H=Y(J,X);if(!H&&!D._executableFile&&this._scriptPath){let W=mD.basename(this._scriptPath,mD.extname(this._scriptPath));if(W!==this._name)H=Y(J,`${W}-${D._name}`)}X=H||X}$=Z.includes(mD.extname(X));let Q;if(n.platform!=="win32")if($)F.unshift(X),F=K3(n.execArgv).concat(F),Q=H4.spawn(n.argv[0],F,{stdio:"inherit"});else Q=H4.spawn(X,F,{stdio:"inherit"});else F.unshift(X),F=K3(n.execArgv).concat(F),Q=H4.spawn(n.execPath,F,{stdio:"inherit"});if(!Q.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((W)=>{n.on(W,()=>{if(Q.killed===!1&&Q.exitCode===null)Q.kill(W)})});let G=this._exitCallback;Q.on("close",(H)=>{if(H=H??1,!G)n.exit(H);else G(new W4(H,"commander.executeSubCommandAsync","(close)"))}),Q.on("error",(H)=>{if(H.code==="ENOENT"){let W=J?`searched for local subcommand relative to directory '${J}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",z=`'${X}' does not exist - if '${D._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 - ${W}`;throw new Error(z)}else if(H.code==="EACCES")throw new Error(`'${X}' not executable`);if(!G)n.exit(1);else{let W=new W4(1,"commander.executeSubCommandAsync","(error)");W.nestedError=H,G(W)}}),this.runningCommand=Q}_dispatchSubcommand(D,F,$){let Z=this._findCommand(D);if(!Z)this.help({error:!0});let Y;return Y=this._chainOrCallSubCommandHook(Y,Z,"preSubcommand"),Y=this._chainOrCall(Y,()=>{if(Z._executableHandler)this._executeSubCommand(Z,F.concat($));else return Z._parseCommand(F,$)}),Y}_dispatchHelpCommand(D){if(!D)this.help();let F=this._findCommand(D);if(F&&!F._executableHandler)F.help();return this._dispatchSubcommand(D,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach((D,F)=>{if(D.required&&this.args[F]==null)this.missingArgument(D.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)return;if(this.args.length>this.registeredArguments.length)this._excessArguments(this.args)}_processArguments(){let D=($,Z,Y)=>{let X=Z;if(Z!==null&&$.parseArg){let J=`error: command-argument value '${Z}' is invalid for argument '${$.name()}'.`;X=this._callParseArg($,Z,Y,J)}return X};this._checkNumberOfArguments();let F=[];this.registeredArguments.forEach(($,Z)=>{let Y=$.defaultValue;if($.variadic){if(Z<this.args.length){if(Y=this.args.slice(Z),$.parseArg)Y=Y.reduce((X,J)=>{return D($,J,X)},$.defaultValue)}else if(Y===void 0)Y=[]}else if(Z<this.args.length){if(Y=this.args[Z],$.parseArg)Y=D($,Y,$.defaultValue)}F[Z]=Y}),this.processedArgs=F}_chainOrCall(D,F){if(D&&D.then&&typeof D.then==="function")return D.then(()=>F());return F()}_chainOrCallHooks(D,F){let $=D,Z=[];if(this._getCommandAndAncestors().reverse().filter((Y)=>Y._lifeCycleHooks[F]!==void 0).forEach((Y)=>{Y._lifeCycleHooks[F].forEach((X)=>{Z.push({hookedCommand:Y,callback:X})})}),F==="postAction")Z.reverse();return Z.forEach((Y)=>{$=this._chainOrCall($,()=>{return Y.callback(Y.hookedCommand,this)})}),$}_chainOrCallSubCommandHook(D,F,$){let Z=D;if(this._lifeCycleHooks[$]!==void 0)this._lifeCycleHooks[$].forEach((Y)=>{Z=this._chainOrCall(Z,()=>{return Y(this,F)})});return Z}_parseCommand(D,F){let $=this.parseOptions(F);if(this._parseOptionsEnv(),this._parseOptionsImplied(),D=D.concat($.operands),F=$.unknown,this.args=D.concat(F),D&&this._findCommand(D[0]))return this._dispatchSubcommand(D[0],D.slice(1),F);if(this._getHelpCommand()&&D[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(D[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(F),this._dispatchSubcommand(this._defaultCommandName,D,F);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested($.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let Z=()=>{if($.unknown.length>0)this.unknownOption($.unknown[0])},Y=`command:${this.name()}`;if(this._actionHandler){Z(),this._processArguments();let X;if(X=this._chainOrCallHooks(X,"preAction"),X=this._chainOrCall(X,()=>this._actionHandler(this.processedArgs)),this.parent)X=this._chainOrCall(X,()=>{this.parent.emit(Y,D,F)});return X=this._chainOrCallHooks(X,"postAction"),X}if(this.parent&&this.parent.listenerCount(Y))Z(),this._processArguments(),this.parent.emit(Y,D,F);else if(D.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",D,F);if(this.listenerCount("command:*"))this.emit("command:*",D,F);else if(this.commands.length)this.unknownCommand();else Z(),this._processArguments()}else if(this.commands.length)Z(),this.help({error:!0});else Z(),this._processArguments()}_findCommand(D){if(!D)return;return this.commands.find((F)=>F._name===D||F._aliases.includes(D))}_findOption(D){return this.options.find((F)=>F.is(D))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((D)=>{D.options.forEach((F)=>{if(F.mandatory&&D.getOptionValue(F.attributeName())===void 0)D.missingMandatoryOptionValue(F)})})}_checkForConflictingLocalOptions(){let D=this.options.filter(($)=>{let Z=$.attributeName();if(this.getOptionValue(Z)===void 0)return!1;return this.getOptionValueSource(Z)!=="default"});D.filter(($)=>$.conflictsWith.length>0).forEach(($)=>{let Z=D.find((Y)=>$.conflictsWith.includes(Y.attributeName()));if(Z)this._conflictingOption($,Z)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((D)=>{D._checkForConflictingLocalOptions()})}parseOptions(D){let F=[],$=[],Z=F,Y=D.slice();function X(Q){return Q.length>1&&Q[0]==="-"}let J=null;while(Y.length){let Q=Y.shift();if(Q==="--"){if(Z===$)Z.push(Q);Z.push(...Y);break}if(J&&!X(Q)){this.emit(`option:${J.name()}`,Q);continue}if(J=null,X(Q)){let G=this._findOption(Q);if(G){if(G.required){let H=Y.shift();if(H===void 0)this.optionMissingArgument(G);this.emit(`option:${G.name()}`,H)}else if(G.optional){let H=null;if(Y.length>0&&!X(Y[0]))H=Y.shift();this.emit(`option:${G.name()}`,H)}else this.emit(`option:${G.name()}`);J=G.variadic?G:null;continue}}if(Q.length>2&&Q[0]==="-"&&Q[1]!=="-"){let G=this._findOption(`-${Q[1]}`);if(G){if(G.required||G.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${G.name()}`,Q.slice(2));else this.emit(`option:${G.name()}`),Y.unshift(`-${Q.slice(2)}`);continue}}if(/^--[^=]+=/.test(Q)){let G=Q.indexOf("="),H=this._findOption(Q.slice(0,G));if(H&&(H.required||H.optional)){this.emit(`option:${H.name()}`,Q.slice(G+1));continue}}if(X(Q))Z=$;if((this._enablePositionalOptions||this._passThroughOptions)&&F.length===0&&$.length===0){if(this._findCommand(Q)){if(F.push(Q),Y.length>0)$.push(...Y);break}else if(this._getHelpCommand()&&Q===this._getHelpCommand().name()){if(F.push(Q),Y.length>0)F.push(...Y);break}else if(this._defaultCommandName){if($.push(Q),Y.length>0)$.push(...Y);break}}if(this._passThroughOptions){if(Z.push(Q),Y.length>0)Z.push(...Y);break}Z.push(Q)}return{operands:F,unknown:$}}opts(){if(this._storeOptionsAsProperties){let D={},F=this.options.length;for(let $=0;$<F;$++){let Z=this.options[$].attributeName();D[Z]=Z===this._versionOptionName?this._version:this[Z]}return D}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((D,F)=>Object.assign(D,F.opts()),{})}error(D,F){if(this._outputConfiguration.outputError(`${D} `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==="string")this._outputConfiguration.writeErr(`${this._showHelpAfterError} `);else if(this._showHelpAfterError)this._outputConfiguration.writeErr(` `),this.outputHelp({error:!0});let $=F||{},Z=$.exitCode||1,Y=$.code||"commander.error";this._exit(Z,Y,D)}_parseOptionsEnv(){this.options.forEach((D)=>{if(D.envVar&&D.envVar in n.env){let F=D.attributeName();if(this.getOptionValue(F)===void 0||["default","config","env"].includes(this.getOptionValueSource(F)))if(D.required||D.optional)this.emit(`optionEnv:${D.name()}`,n.env[D.envVar]);else this.emit(`optionEnv:${D.name()}`)}})}_parseOptionsImplied(){let D=new Hz(this.options),F=($)=>{return this.getOptionValue($)!==void 0&&!["default","implied"].includes(this.getOptionValueSource($))};this.options.filter(($)=>$.implied!==void 0&&F($.attributeName())&&D.valueFromOption(this.getOptionValue($.attributeName()),$)).forEach(($)=>{Object.keys($.implied).filter((Z)=>!F(Z)).forEach((Z)=>{this.setOptionValueWithSource(Z,$.implied[Z],"implied")})})}missingArgument(D){let F=`error: missing required argument '${D}'`;this.error(F,{code:"commander.missingArgument"})}optionMissingArgument(D){let F=`error: option '${D.flags}' argument missing`;this.error(F,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(D){let F=`error: required option '${D.flags}' not specified`;this.error(F,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(D,F){let $=(X)=>{let J=X.attributeName(),Q=this.getOptionValue(J),G=this.options.find((W)=>W.negate&&J===W.attributeName()),H=this.options.find((W)=>!W.negate&&J===W.attributeName());if(G&&(G.presetArg===void 0&&Q===!1||G.presetArg!==void 0&&Q===G.presetArg))return G;return H||X},Z=(X)=>{let J=$(X),Q=J.attributeName();if(this.getOptionValueSource(Q)==="env")return`environment variable '${J.envVar}'`;return`option '${J.flags}'`},Y=`error: ${Z(D)} cannot be used with ${Z(F)}`;this.error(Y,{code:"commander.conflictingOption"})}unknownOption(D){if(this._allowUnknownOption)return;let F="";if(D.startsWith("--")&&this._showSuggestionAfterError){let Z=[],Y=this;do{let X=Y.createHelp().visibleOptions(Y).filter((J)=>J.long).map((J)=>J.long);Z=Z.concat(X),Y=Y.parent}while(Y&&!Y._enablePositionalOptions);F=H3(D,Z)}let $=`error: unknown option '${D}'${F}`;this.error($,{code:"commander.unknownOption"})}_excessArguments(D){if(this._allowExcessArguments)return;let F=this.registeredArguments.length,$=F===1?"":"s",Y=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${F} argument${$} but got ${D.length}.`;this.error(Y,{code:"commander.excessArguments"})}unknownCommand(){let D=this.args[0],F="";if(this._showSuggestionAfterError){let Z=[];this.createHelp().visibleCommands(this).forEach((Y)=>{if(Z.push(Y.name()),Y.alias())Z.push(Y.alias())}),F=H3(D,Z)}let $=`error: unknown command '${D}'${F}`;this.error($,{code:"commander.unknownCommand"})}version(D,F,$){if(D===void 0)return this._version;this._version=D,F=F||"-V, --version",$=$||"output the version number";let Z=this.createOption(F,$);return this._versionOptionName=Z.attributeName(),this._registerOption(Z),this.on("option:"+Z.name(),()=>{this._outputConfiguration.writeOut(`${D} `),this._exit(0,"commander.version",D)}),this}description(D,F){if(D===void 0&&F===void 0)return this._description;if(this._description=D,F)this._argsDescription=F;return this}summary(D){if(D===void 0)return this._summary;return this._summary=D,this}alias(D){if(D===void 0)return this._aliases[0];let F=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)F=this.commands[this.commands.length-1];if(D===F._name)throw new Error("Command alias can't be the same as its name");let $=this.parent?._findCommand(D);if($){let Z=[$.name()].concat($.aliases()).join("|");throw new Error(`cannot add alias '${D}' to command '${this.name()}' as already have command '${Z}'`)}return F._aliases.push(D),this}aliases(D){if(D===void 0)return this._aliases;return D.forEach((F)=>this.alias(F)),this}usage(D){if(D===void 0){if(this._usage)return this._usage;let F=this.registeredArguments.map(($)=>{return Qz($)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?F:[]).join(" ")}return this._usage=D,this}name(D){if(D===void 0)return this._name;return this._name=D,this}nameFromFilename(D){return this._name=mD.basename(D,mD.extname(D)),this}executableDir(D){if(D===void 0)return this._executableDir;return this._executableDir=D,this}helpInformation(D){let F=this.createHelp();if(F.helpWidth===void 0)F.helpWidth=D&&D.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth();return F.formatHelp(this,F)}_getHelpContext(D){D=D||{};let F={error:!!D.error},$;if(F.error)$=(Z)=>this._outputConfiguration.writeErr(Z);else $=(Z)=>this._outputConfiguration.writeOut(Z);return F.write=D.write||$,F.command=this,F}outputHelp(D){let F;if(typeof D==="function")F=D,D=void 0;let $=this._getHelpContext(D);this._getCommandAndAncestors().reverse().forEach((Y)=>Y.emit("beforeAllHelp",$)),this.emit("beforeHelp",$);let Z=this.helpInformation($);if(F){if(Z=F(Z),typeof Z!=="string"&&!Buffer.isBuffer(Z))throw new Error("outputHelp callback must return a string or a Buffer")}if($.write(Z),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",$),this._getCommandAndAncestors().forEach((Y)=>Y.emit("afterAllHelp",$))}helpOption(D,F){if(typeof D==="boolean"){if(D)this._helpOption=this._helpOption??void 0;else this._helpOption=null;return this}return D=D??"-h, --help",F=F??"display help for command",this._helpOption=this.createOption(D,F),this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(D){return this._helpOption=D,this}help(D){this.outputHelp(D);let F=n.exitCode||0;if(F===0&&D&&typeof D!=="function"&&D.error)F=1;this._exit(F,"commander.help","(outputHelp)")}addHelpText(D,F){let $=["beforeAll","before","after","afterAll"];if(!$.includes(D))throw new Error(`Unexpected value for position to addHelpText. Expecting one of '${$.join("', '")}'`);let Z=`${D}Help`;return this.on(Z,(Y)=>{let X;if(typeof F==="function")X=F({error:Y.error,command:Y.command});else X=F;if(X)Y.write(`${X} `)}),this}_outputHelpIfRequested(D){let F=this._getHelpOption();if(F&&D.find((Z)=>F.is(Z)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function K3(D){return D.map((F)=>{if(!F.startsWith("--inspect"))return F;let $,Z="127.0.0.1",Y="9229",X;if((X=F.match(/^(--inspect(-brk)?)$/))!==null)$=X[1];else if((X=F.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if($=X[1],/^\d+$/.test(X[3]))Y=X[3];else Z=X[3];else if((X=F.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)$=X[1],Z=X[3],Y=X[4];if($&&Y!=="0")return`${$}=${Z}:${parseInt(Y)+1}`;return F})}Kz.Command=q4});var V3=q((Bz)=>{var{Argument:q3}=G0(),{Command:z4}=W3(),{CommanderError:qz,InvalidArgumentError:z3}=y8(),{Help:zz}=Q4(),{Option:B3}=G4();Bz.program=new z4;Bz.createCommand=(D)=>new z4(D);Bz.createOption=(D,F)=>new B3(D,F);Bz.createArgument=(D,F)=>new q3(D,F);Bz.Command=z4;Bz.Option=B3;Bz.Argument=q3;Bz.Help=zz;Bz.CommanderError=qz;Bz.InvalidArgumentError=z3;Bz.InvalidOptionArgumentError=z3});var nD=q((Kv,L3)=>{var wz=u("node:tty"),Oz=wz?.WriteStream?.prototype?.hasColors?.()??!1,y=(D,F)=>{if(!Oz)return(Y)=>Y;let $=`\x1B[${D}m`,Z=`\x1B[${F}m`;return(Y)=>{let X=Y+"",J=X.indexOf(Z);if(J===-1)return $+X+Z;let Q=$,G=0;while(J!==-1)Q+=X.slice(G,J)+$,G=J+Z.length,J=X.indexOf(Z,G);return Q+=X.slice(G)+Z,Q}},w={};w.reset=y(0,0);w.bold=y(1,22);w.dim=y(2,22);w.italic=y(3,23);w.underline=y(4,24);w.overline=y(53,55);w.inverse=y(7,27);w.hidden=y(8,28);w.strikethrough=y(9,29);w.black=y(30,39);w.red=y(31,39);w.green=y(32,39);w.yellow=y(33,39);w.blue=y(34,39);w.magenta=y(35,39);w.cyan=y(36,39);w.white=y(37,39);w.gray=y(90,39);w.bgBlack=y(40,49);w.bgRed=y(41,49);w.bgGreen=y(42,49);w.bgYellow=y(43,49);w.bgBlue=y(44,49);w.bgMagenta=y(45,49);w.bgCyan=y(46,49);w.bgWhite=y(47,49);w.bgGray=y(100,49);w.redBright=y(91,39);w.greenBright=y(92,39);w.yellowBright=y(93,39);w.blueBright=y(94,39);w.magentaBright=y(95,39);w.cyanBright=y(96,39);w.whiteBright=y(97,39);w.bgRedBright=y(101,49);w.bgGreenBright=y(102,49);w.bgYellowBright=y(103,49);w.bgBlueBright=y(104,49);w.bgMagentaBright=y(105,49);w.bgCyanBright=y(106,49);w.bgWhiteBright=y(107,49);L3.exports=w});var w3=q((yv,j3)=>{j3.exports=_z;function gz(D){let F={defaultWidth:0,output:process.stdout,tty:u("tty")};if(!D)return F;return Object.keys(F).forEach(function($){if(!D[$])D[$]=F[$]}),D}function _z(D){let F=gz(D);if(F.output.getWindowSize)return F.output.getWindowSize()[0]||F.defaultWidth;if(F.tty.getWindowSize)return F.tty.getWindowSize()[1]||F.defaultWidth;if(F.output.columns)return F.output.columns;if(process.env.CLI_WIDTH){let $=parseInt(process.env.CLI_WIDTH,10);if(!isNaN($)&&$!==0)return $}return F.defaultWidth}});var y3=q((Sv,O3)=>{O3.exports=({onlyFirst:D=!1}={})=>{let F=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(F,D?void 0:"g")}});var W0=q((vv,S3)=>{var mz=y3();S3.exports=(D)=>typeof D==="string"?D.replace(mz(),""):D});var x3=q((xv,N4)=>{var v3=(D)=>{if(Number.isNaN(D))return!1;if(D>=4352&&(D<=4447||D===9001||D===9002||11904<=D&&D<=12871&&D!==12351||12880<=D&&D<=19903||19968<=D&&D<=42182||43360<=D&&D<=43388||44032<=D&&D<=55203||63744<=D&&D<=64255||65040<=D&&D<=65049||65072<=D&&D<=65131||65281<=D&&D<=65376||65504<=D&&D<=65510||110592<=D&&D<=110593||127488<=D&&D<=127569||131072<=D&&D<=262141))return!0;return!1};N4.exports=v3;N4.exports.default=v3});var h3=q((fv,f3)=>{f3.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var _3=q((hv,U4)=>{var uz=W0(),bz=x3(),dz=h3(),g3=(D)=>{if(typeof D!=="string"||D.length===0)return 0;if(D=uz(D),D.length===0)return 0;D=D.replace(dz()," ");let F=0;for(let $=0;$<D.length;$++){let Z=D.codePointAt($);if(Z<=31||Z>=127&&Z<=159)continue;if(Z>=768&&Z<=879)continue;if(Z>65535)$++;F+=bz(Z)?2:1}return F};U4.exports=g3;U4.exports.default=g3});var u3=q((gv,m3)=>{m3.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew