@automagik/genie 0.260203.503 → 0.260203.629
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +11 -2
- package/dist/claudio.js +1 -1
- package/dist/genie.js +50 -45
- package/dist/term.js +1 -1
- package/install.sh +11 -0
- package/package.json +1 -1
- package/src/genie-commands/tui.ts +63 -0
- package/src/genie.ts +10 -0
- package/src/lib/version.ts +1 -1
package/dist/genie.js
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
var
|
|
4
|
-
`).replace(/^/gm," ".repeat(2))}let Y=[`Usage: ${F.commandUsage(D)}`,""],W=F.commandDescription(D);if(W.length>0)Y=Y.concat([F.wrap(W,E,0),""]);let H=F.visibleArguments(D).map((R)=>{return J(F.argumentTerm(R),F.argumentDescription(R))});if(H.length>0)Y=Y.concat(["Arguments:",Q(H),""]);let
|
|
3
|
+
var E1=Object.create;var{getPrototypeOf:$1,defineProperty:M0,getOwnPropertyNames:X1}=Object;var J1=Object.prototype.hasOwnProperty;var PD=(D,F,B)=>{B=D!=null?E1($1(D)):{};let E=F||!D||!D.__esModule?M0(B,"default",{value:D,enumerable:!0}):B;for(let $ of X1(D))if(!J1.call(E,$))M0(E,$,{get:()=>D[$],enumerable:!0});return E};var x=(D,F)=>()=>(F||D((F={exports:{}}).exports,F),F.exports);var Q1=(D,F)=>{for(var B in F)M0(D,B,{get:F[B],enumerable:!0,configurable:!0,set:(E)=>F[B]=()=>E})};var b9=(D,F)=>()=>(D&&(F=D(D=0)),F);var XD=import.meta.require;var V2=x((Y1)=>{class z0 extends Error{constructor(D,F,B){super(B);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=F,this.exitCode=D,this.nestedError=void 0}}class R3 extends z0{constructor(D){super(1,"commander.invalidArgument",D);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}Y1.CommanderError=z0;Y1.InvalidArgumentError=R3});var h2=x((G1)=>{var{InvalidArgumentError:q1}=V2();class K3{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,B)=>{if(!this.argChoices.includes(F))throw new q1(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._concatValue(F,B);return F},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function _1(D){let F=D.name()+(D.variadic===!0?"...":"");return D.required?"<"+F+">":"["+F+"]"}G1.Argument=K3;G1.humanReadableArgName=_1});var j0=x((z1)=>{var{humanReadableArgName:M1}=h2();class C3{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(D){let F=D.commands.filter((E)=>!E._hidden),B=D._getHelpCommand();if(B&&!B._hidden)F.push(B);if(this.sortSubcommands)F.sort((E,$)=>{return E.name().localeCompare($.name())});return F}compareOptions(D,F){let B=(E)=>{return E.short?E.short.replace(/^-/,""):E.long.replace(/^--/,"")};return B(D).localeCompare(B(F))}visibleOptions(D){let F=D.options.filter((E)=>!E.hidden),B=D._getHelpOption();if(B&&!B.hidden){let E=B.short&&D._findOption(B.short),$=B.long&&D._findOption(B.long);if(!E&&!$)F.push(B);else if(B.long&&!$)F.push(D.createOption(B.long,B.description));else if(B.short&&!E)F.push(D.createOption(B.short,B.description))}if(this.sortOptions)F.sort(this.compareOptions);return F}visibleGlobalOptions(D){if(!this.showGlobalOptions)return[];let F=[];for(let B=D.parent;B;B=B.parent){let E=B.options.filter(($)=>!$.hidden);F.push(...E)}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((B)=>M1(B)).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((B,E)=>{return Math.max(B,F.subcommandTerm(E).length)},0)}longestOptionTermLength(D,F){return F.visibleOptions(D).reduce((B,E)=>{return Math.max(B,F.optionTerm(E).length)},0)}longestGlobalOptionTermLength(D,F){return F.visibleGlobalOptions(D).reduce((B,E)=>{return Math.max(B,F.optionTerm(E).length)},0)}longestArgumentTermLength(D,F){return F.visibleArguments(D).reduce((B,E)=>{return Math.max(B,F.argumentTerm(E).length)},0)}commandUsage(D){let F=D._name;if(D._aliases[0])F=F+"|"+D._aliases[0];let B="";for(let E=D.parent;E;E=E.parent)B=E.name()+" "+B;return B+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((B)=>JSON.stringify(B)).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((B)=>JSON.stringify(B)).join(", ")}`);if(D.defaultValue!==void 0)F.push(`default: ${D.defaultValueDescription||JSON.stringify(D.defaultValue)}`);if(F.length>0){let B=`(${F.join(", ")})`;if(D.description)return`${D.description} ${B}`;return B}return D.description}formatHelp(D,F){let B=F.padWidth(D,F),E=F.helpWidth||80,$=2,X=2;function J(R,u){if(u){let T=`${R.padEnd(B+2)}${u}`;return F.wrap(T,E-2,B+2)}return R}function Q(R){return R.join(`
|
|
4
|
+
`).replace(/^/gm," ".repeat(2))}let Y=[`Usage: ${F.commandUsage(D)}`,""],W=F.commandDescription(D);if(W.length>0)Y=Y.concat([F.wrap(W,E,0),""]);let H=F.visibleArguments(D).map((R)=>{return J(F.argumentTerm(R),F.argumentDescription(R))});if(H.length>0)Y=Y.concat(["Arguments:",Q(H),""]);let _=F.visibleOptions(D).map((R)=>{return J(F.optionTerm(R),F.optionDescription(R))});if(_.length>0)Y=Y.concat(["Options:",Q(_),""]);if(this.showGlobalOptions){let R=F.visibleGlobalOptions(D).map((u)=>{return J(F.optionTerm(u),F.optionDescription(u))});if(R.length>0)Y=Y.concat(["Global Options:",Q(R),""])}let j=F.visibleCommands(D).map((R)=>{return J(F.subcommandTerm(R),F.subcommandDescription(R))});if(j.length>0)Y=Y.concat(["Commands:",Q(j),""]);return Y.join(`
|
|
5
5
|
`)}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,B,E=40){let X=new RegExp(`[\\n][${" \\f\\t\\v\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF"}]+`);if(D.match(X))return D;let J=F-B;if(J<E)return D;let Q=D.slice(0,B),Y=D.slice(B).replace(`\r
|
|
6
6
|
`,`
|
|
7
|
-
`),W=" ".repeat(B),
|
|
8
|
-
|.{1,${J-1}}([${
|
|
9
|
-
`)return"";return(
|
|
10
|
-
`)}}
|
|
7
|
+
`),W=" ".repeat(B),_=`\\s${"\u200B"}`,j=new RegExp(`
|
|
8
|
+
|.{1,${J-1}}([${_}]|$)|[^${_}]+?([${_}]|$)`,"g"),R=Y.match(j)||[];return Q+R.map((u,T)=>{if(u===`
|
|
9
|
+
`)return"";return(T>0?W:"")+u.trimEnd()}).join(`
|
|
10
|
+
`)}}z1.Help=C3});var V0=x((C1)=>{var{InvalidArgumentError:V1}=V2();class L3{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 B=K1(D);if(this.short=B.shortFlag,this.long=B.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,B)=>{if(!this.argChoices.includes(F))throw new V1(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._concatValue(F,B);return F},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){return R1(this.name().replace(/^no-/,""))}is(D){return this.short===D||this.long===D}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class N3{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,B)=>{if(this.positiveOptions.has(B))this.dualOptions.add(B)})}valueFromOption(D,F){let B=F.attributeName();if(!this.dualOptions.has(B))return!0;let E=this.negativeOptions.get(B).presetArg,$=E!==void 0?E:!1;return F.negate===($===D)}}function R1(D){return D.split("-").reduce((F,B)=>{return F+B[0].toUpperCase()+B.slice(1)})}function K1(D){let F,B,E=D.split(/[ |,]+/);if(E.length>1&&!/^[[<]/.test(E[1]))F=E.shift();if(B=E.shift(),!F&&/^-[^-]$/.test(B))F=B,B=void 0;return{shortFlag:F,longFlag:B}}C1.Option=L3;C1.DualOptions=N3});var O3=x((S1)=>{function O1(D,F){if(Math.abs(D.length-F.length)>3)return Math.max(D.length,F.length);let B=[];for(let E=0;E<=D.length;E++)B[E]=[E];for(let E=0;E<=F.length;E++)B[0][E]=E;for(let E=1;E<=F.length;E++)for(let $=1;$<=D.length;$++){let X=1;if(D[$-1]===F[E-1])X=0;else X=1;if(B[$][E]=Math.min(B[$-1][E]+1,B[$][E-1]+1,B[$-1][E-1]+X),$>1&&E>1&&D[$-1]===F[E-2]&&D[$-2]===F[E-1])B[$][E]=Math.min(B[$][E],B[$-2][E-2]+1)}return B[D.length][F.length]}function w1(D,F){if(!F||F.length===0)return"";F=Array.from(new Set(F));let B=D.startsWith("--");if(B)D=D.slice(2),F=F.map((J)=>J.slice(2));let E=[],$=3,X=0.4;if(F.forEach((J)=>{if(J.length<=1)return;let Q=O1(D,J),Y=Math.max(D.length,J.length);if((Y-Q)/Y>X){if(Q<$)$=Q,E=[J];else if(Q===$)E.push(J)}}),E.sort((J,Q)=>J.localeCompare(Q)),B)E=E.map((J)=>`--${J}`);if(E.length>1)return`
|
|
11
11
|
(Did you mean one of ${E.join(", ")}?)`;if(E.length===1)return`
|
|
12
|
-
(Did you mean ${E[0]}?)`;return""}
|
|
13
|
-
- 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
|
|
14
|
-
Expecting one of '${B.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,B){if(this._exitCallback)this._exitCallback(new
|
|
15
|
-
- already used by option '${F.flags}'`)}this.options.push(D)}_registerCommand(D){let F=(E)=>{return[E.name()].concat(E.aliases())},B=F(D).find((E)=>this._findCommand(E));if(B){let E=F(this._findCommand(B)).join("|"),$=F(D).join("|");throw Error(`cannot add command '${$}' as already have command '${E}'`)}this.commands.push(D)}addOption(D){this._registerOption(D);let F=D.name(),B=D.attributeName();if(D.negate){let $=D.long.replace(/^--no-/,"--");if(!this._findOption($))this.setOptionValueWithSource(B,D.defaultValue===void 0?!0:D.defaultValue,"default")}else if(D.defaultValue!==void 0)this.setOptionValueWithSource(B,D.defaultValue,"default");let E=($,X,J)=>{if($==null&&D.presetArg!==void 0)$=D.presetArg;let Q=this.getOptionValue(B);if($!==null&&D.parseArg)$=this._callParseArg(D,$,Q,X);else if($!==null&&D.variadic)$=D._concatValue($,Q);if($==null)if(D.negate)$=!1;else if(D.isBoolean()||D.optional)$=!0;else $="";this.setOptionValueWithSource(B,$,J)};if(this.on("option:"+F,($)=>{let X=`error: option '${D.flags}' argument '${$}' is invalid.`;E($,X,"cli")}),D.envVar)this.on("optionEnv:"+F,($)=>{let X=`error: option '${D.flags}' value '${$}' from env '${D.envVar}' is invalid.`;E($,X,"env")});return this}_optionEx(D,F,B,E,$){if(typeof F==="object"&&F instanceof
|
|
12
|
+
(Did you mean ${E[0]}?)`;return""}S1.suggestSimilar=w1});var u3=x((v1)=>{var u1=XD("events").EventEmitter,R0=XD("child_process"),HD=XD("path"),K0=XD("fs"),f=XD("process"),{Argument:T1,humanReadableArgName:P1}=h2(),{CommanderError:C0}=V2(),{Help:I1}=j0(),{Option:w3,DualOptions:k1}=V0(),{suggestSimilar:S3}=O3();class L0 extends u1{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)=>f.stdout.write(F),writeErr:(F)=>f.stderr.write(F),getOutHelpWidth:()=>f.stdout.isTTY?f.stdout.columns:void 0,getErrHelpWidth:()=>f.stderr.isTTY?f.stderr.columns:void 0,outputError:(F,B)=>B(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,B){let E=F,$=B;if(typeof E==="object"&&E!==null)$=E,E=null;$=$||{};let[,X,J]=D.match(/([^ ]+) *(.*)/),Q=this.createCommand(X);if(E)Q.description(E),Q._executableHandler=!0;if($.isDefault)this._defaultCommandName=Q._name;if(Q._hidden=!!($.noHelp||$.hidden),Q._executableFile=$.executableFile||null,J)Q.arguments(J);if(this._registerCommand(Q),Q.parent=this,Q.copyInheritedSettings(this),E)return this;return Q}createCommand(D){return new L0(D)}createHelp(){return Object.assign(new I1,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 Error(`Command passed to .addCommand() must have a name
|
|
13
|
+
- 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 T1(D,F)}argument(D,F,B,E){let $=this.createArgument(D,F);if(typeof B==="function")$.default(E).argParser(B);else $.default(B);return this.addArgument($),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 Error(`only the last argument can be variadic '${F.name()}'`);if(D.required&&D.defaultValue!==void 0&&D.parseArg===void 0)throw 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[,B,E]=D.match(/([^ ]+) *(.*)/),$=F??"display help for command",X=this.createCommand(B);if(X.helpOption(!1),E)X.arguments(E);if($)X.description($);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 B=["preSubcommand","preAction","postAction"];if(!B.includes(D))throw Error(`Unexpected value for event passed to hook : '${D}'.
|
|
14
|
+
Expecting one of '${B.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,B){if(this._exitCallback)this._exitCallback(new C0(D,F,B));f.exit(D)}action(D){let F=(B)=>{let E=this.registeredArguments.length,$=B.slice(0,E);if(this._storeOptionsAsProperties)$[E]=this;else $[E]=this.opts();return $.push(this),D.apply(this,$)};return this._actionHandler=F,this}createOption(D,F){return new w3(D,F)}_callParseArg(D,F,B,E){try{return D.parseArg(F,B)}catch($){if($.code==="commander.invalidArgument"){let X=`${E} ${$.message}`;this.error(X,{exitCode:$.exitCode,code:$.code})}throw $}}_registerOption(D){let F=D.short&&this._findOption(D.short)||D.long&&this._findOption(D.long);if(F){let B=D.long&&this._findOption(D.long)?D.long:D.short;throw Error(`Cannot add option '${D.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${B}'
|
|
15
|
+
- already used by option '${F.flags}'`)}this.options.push(D)}_registerCommand(D){let F=(E)=>{return[E.name()].concat(E.aliases())},B=F(D).find((E)=>this._findCommand(E));if(B){let E=F(this._findCommand(B)).join("|"),$=F(D).join("|");throw Error(`cannot add command '${$}' as already have command '${E}'`)}this.commands.push(D)}addOption(D){this._registerOption(D);let F=D.name(),B=D.attributeName();if(D.negate){let $=D.long.replace(/^--no-/,"--");if(!this._findOption($))this.setOptionValueWithSource(B,D.defaultValue===void 0?!0:D.defaultValue,"default")}else if(D.defaultValue!==void 0)this.setOptionValueWithSource(B,D.defaultValue,"default");let E=($,X,J)=>{if($==null&&D.presetArg!==void 0)$=D.presetArg;let Q=this.getOptionValue(B);if($!==null&&D.parseArg)$=this._callParseArg(D,$,Q,X);else if($!==null&&D.variadic)$=D._concatValue($,Q);if($==null)if(D.negate)$=!1;else if(D.isBoolean()||D.optional)$=!0;else $="";this.setOptionValueWithSource(B,$,J)};if(this.on("option:"+F,($)=>{let X=`error: option '${D.flags}' argument '${$}' is invalid.`;E($,X,"cli")}),D.envVar)this.on("optionEnv:"+F,($)=>{let X=`error: option '${D.flags}' value '${$}' from env '${D.envVar}' is invalid.`;E($,X,"env")});return this}_optionEx(D,F,B,E,$){if(typeof F==="object"&&F instanceof w3)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let X=this.createOption(F,B);if(X.makeOptionMandatory(!!D.mandatory),typeof E==="function")X.default($).argParser(E);else if(E instanceof RegExp){let J=E;E=(Q,Y)=>{let W=J.exec(Q);return W?W[0]:Y},X.default($).argParser(E)}else X.default(E);return this.addOption(X)}option(D,F,B,E){return this._optionEx({},D,F,B,E)}requiredOption(D,F,B,E){return this._optionEx({mandatory:!0},D,F,B,E)}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 Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(D=!0){if(this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!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,B){if(this._storeOptionsAsProperties)this[D]=F;else this._optionValues[D]=F;return this._optionValueSources[D]=B,this}getOptionValueSource(D){return this._optionValueSources[D]}getOptionValueSourceWithGlobals(D){let F;return this._getCommandAndAncestors().forEach((B)=>{if(B.getOptionValueSource(D)!==void 0)F=B.getOptionValueSource(D)}),F}_prepareUserArgs(D,F){if(D!==void 0&&!Array.isArray(D))throw Error("first parameter to parse must be array or undefined");if(F=F||{},D===void 0&&F.from===void 0){if(f.versions?.electron)F.from="electron";let E=f.execArgv??[];if(E.includes("-e")||E.includes("--eval")||E.includes("-p")||E.includes("--print"))F.from="eval"}if(D===void 0)D=f.argv;this.rawArgs=D.slice();let B;switch(F.from){case void 0:case"node":this._scriptPath=D[1],B=D.slice(2);break;case"electron":if(f.defaultApp)this._scriptPath=D[1],B=D.slice(2);else B=D.slice(1);break;case"user":B=D.slice(0);break;case"eval":B=D.slice(1);break;default:throw Error(`unexpected parse option { from: '${F.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",B}parse(D,F){let B=this._prepareUserArgs(D,F);return this._parseCommand([],B),this}async parseAsync(D,F){let B=this._prepareUserArgs(D,F);return await this._parseCommand([],B),this}_executeSubCommand(D,F){F=F.slice();let B=!1,E=[".js",".ts",".tsx",".mjs",".cjs"];function $(W,H){let _=HD.resolve(W,H);if(K0.existsSync(_))return _;if(E.includes(HD.extname(H)))return;let j=E.find((R)=>K0.existsSync(`${_}${R}`));if(j)return`${_}${j}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let X=D._executableFile||`${this._name}-${D._name}`,J=this._executableDir||"";if(this._scriptPath){let W;try{W=K0.realpathSync(this._scriptPath)}catch(H){W=this._scriptPath}J=HD.resolve(HD.dirname(W),J)}if(J){let W=$(J,X);if(!W&&!D._executableFile&&this._scriptPath){let H=HD.basename(this._scriptPath,HD.extname(this._scriptPath));if(H!==this._name)W=$(J,`${H}-${D._name}`)}X=W||X}B=E.includes(HD.extname(X));let Q;if(f.platform!=="win32")if(B)F.unshift(X),F=b3(f.execArgv).concat(F),Q=R0.spawn(f.argv[0],F,{stdio:"inherit"});else Q=R0.spawn(X,F,{stdio:"inherit"});else F.unshift(X),F=b3(f.execArgv).concat(F),Q=R0.spawn(f.execPath,F,{stdio:"inherit"});if(!Q.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((H)=>{f.on(H,()=>{if(Q.killed===!1&&Q.exitCode===null)Q.kill(H)})});let Y=this._exitCallback;Q.on("close",(W)=>{if(W=W??1,!Y)f.exit(W);else Y(new C0(W,"commander.executeSubCommandAsync","(close)"))}),Q.on("error",(W)=>{if(W.code==="ENOENT"){let H=J?`searched for local subcommand relative to directory '${J}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",_=`'${X}' does not exist
|
|
16
16
|
- if '${D._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
17
17
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
18
|
-
- ${H}`;throw Error(
|
|
18
|
+
- ${H}`;throw Error(_)}else if(W.code==="EACCES")throw Error(`'${X}' not executable`);if(!Y)f.exit(1);else{let H=new C0(1,"commander.executeSubCommandAsync","(error)");H.nestedError=W,Y(H)}}),this.runningCommand=Q}_dispatchSubcommand(D,F,B){let E=this._findCommand(D);if(!E)this.help({error:!0});let $;return $=this._chainOrCallSubCommandHook($,E,"preSubcommand"),$=this._chainOrCall($,()=>{if(E._executableHandler)this._executeSubCommand(E,F.concat(B));else return E._parseCommand(F,B)}),$}_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=(B,E,$)=>{let X=E;if(E!==null&&B.parseArg){let J=`error: command-argument value '${E}' is invalid for argument '${B.name()}'.`;X=this._callParseArg(B,E,$,J)}return X};this._checkNumberOfArguments();let F=[];this.registeredArguments.forEach((B,E)=>{let $=B.defaultValue;if(B.variadic){if(E<this.args.length){if($=this.args.slice(E),B.parseArg)$=$.reduce((X,J)=>{return D(B,J,X)},B.defaultValue)}else if($===void 0)$=[]}else if(E<this.args.length){if($=this.args[E],B.parseArg)$=D(B,$,B.defaultValue)}F[E]=$}),this.processedArgs=F}_chainOrCall(D,F){if(D&&D.then&&typeof D.then==="function")return D.then(()=>F());return F()}_chainOrCallHooks(D,F){let B=D,E=[];if(this._getCommandAndAncestors().reverse().filter(($)=>$._lifeCycleHooks[F]!==void 0).forEach(($)=>{$._lifeCycleHooks[F].forEach((X)=>{E.push({hookedCommand:$,callback:X})})}),F==="postAction")E.reverse();return E.forEach(($)=>{B=this._chainOrCall(B,()=>{return $.callback($.hookedCommand,this)})}),B}_chainOrCallSubCommandHook(D,F,B){let E=D;if(this._lifeCycleHooks[B]!==void 0)this._lifeCycleHooks[B].forEach(($)=>{E=this._chainOrCall(E,()=>{return $(this,F)})});return E}_parseCommand(D,F){let B=this.parseOptions(F);if(this._parseOptionsEnv(),this._parseOptionsImplied(),D=D.concat(B.operands),F=B.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(B.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let E=()=>{if(B.unknown.length>0)this.unknownOption(B.unknown[0])},$=`command:${this.name()}`;if(this._actionHandler){E(),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($,D,F)});return X=this._chainOrCallHooks(X,"postAction"),X}if(this.parent&&this.parent.listenerCount($))E(),this._processArguments(),this.parent.emit($,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 E(),this._processArguments()}else if(this.commands.length)E(),this.help({error:!0});else E(),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((B)=>{let E=B.attributeName();if(this.getOptionValue(E)===void 0)return!1;return this.getOptionValueSource(E)!=="default"});D.filter((B)=>B.conflictsWith.length>0).forEach((B)=>{let E=D.find(($)=>B.conflictsWith.includes($.attributeName()));if(E)this._conflictingOption(B,E)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((D)=>{D._checkForConflictingLocalOptions()})}parseOptions(D){let F=[],B=[],E=F,$=D.slice();function X(Q){return Q.length>1&&Q[0]==="-"}let J=null;while($.length){let Q=$.shift();if(Q==="--"){if(E===B)E.push(Q);E.push(...$);break}if(J&&!X(Q)){this.emit(`option:${J.name()}`,Q);continue}if(J=null,X(Q)){let Y=this._findOption(Q);if(Y){if(Y.required){let W=$.shift();if(W===void 0)this.optionMissingArgument(Y);this.emit(`option:${Y.name()}`,W)}else if(Y.optional){let W=null;if($.length>0&&!X($[0]))W=$.shift();this.emit(`option:${Y.name()}`,W)}else this.emit(`option:${Y.name()}`);J=Y.variadic?Y:null;continue}}if(Q.length>2&&Q[0]==="-"&&Q[1]!=="-"){let Y=this._findOption(`-${Q[1]}`);if(Y){if(Y.required||Y.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${Y.name()}`,Q.slice(2));else this.emit(`option:${Y.name()}`),$.unshift(`-${Q.slice(2)}`);continue}}if(/^--[^=]+=/.test(Q)){let Y=Q.indexOf("="),W=this._findOption(Q.slice(0,Y));if(W&&(W.required||W.optional)){this.emit(`option:${W.name()}`,Q.slice(Y+1));continue}}if(X(Q))E=B;if((this._enablePositionalOptions||this._passThroughOptions)&&F.length===0&&B.length===0){if(this._findCommand(Q)){if(F.push(Q),$.length>0)B.push(...$);break}else if(this._getHelpCommand()&&Q===this._getHelpCommand().name()){if(F.push(Q),$.length>0)F.push(...$);break}else if(this._defaultCommandName){if(B.push(Q),$.length>0)B.push(...$);break}}if(this._passThroughOptions){if(E.push(Q),$.length>0)E.push(...$);break}E.push(Q)}return{operands:F,unknown:B}}opts(){if(this._storeOptionsAsProperties){let D={},F=this.options.length;for(let B=0;B<F;B++){let E=this.options[B].attributeName();D[E]=E===this._versionOptionName?this._version:this[E]}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}
|
|
19
19
|
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==="string")this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
20
20
|
`);else if(this._showHelpAfterError)this._outputConfiguration.writeErr(`
|
|
21
|
-
`),this.outputHelp({error:!0});let B=F||{},E=B.exitCode||1,$=B.code||"commander.error";this._exit(E,$,D)}_parseOptionsEnv(){this.options.forEach((D)=>{if(D.envVar&&D.envVar in f.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()}`,f.env[D.envVar]);else this.emit(`optionEnv:${D.name()}`)}})}_parseOptionsImplied(){let D=new
|
|
22
|
-
`),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 Error("Command alias can't be the same as its name");let B=this.parent?._findCommand(D);if(B){let E=[B.name()].concat(B.aliases()).join("|");throw Error(`cannot add alias '${D}' to command '${this.name()}' as already have command '${E}'`)}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((B)=>{return
|
|
21
|
+
`),this.outputHelp({error:!0});let B=F||{},E=B.exitCode||1,$=B.code||"commander.error";this._exit(E,$,D)}_parseOptionsEnv(){this.options.forEach((D)=>{if(D.envVar&&D.envVar in f.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()}`,f.env[D.envVar]);else this.emit(`optionEnv:${D.name()}`)}})}_parseOptionsImplied(){let D=new k1(this.options),F=(B)=>{return this.getOptionValue(B)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(B))};this.options.filter((B)=>B.implied!==void 0&&F(B.attributeName())&&D.valueFromOption(this.getOptionValue(B.attributeName()),B)).forEach((B)=>{Object.keys(B.implied).filter((E)=>!F(E)).forEach((E)=>{this.setOptionValueWithSource(E,B.implied[E],"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 B=(X)=>{let J=X.attributeName(),Q=this.getOptionValue(J),Y=this.options.find((H)=>H.negate&&J===H.attributeName()),W=this.options.find((H)=>!H.negate&&J===H.attributeName());if(Y&&(Y.presetArg===void 0&&Q===!1||Y.presetArg!==void 0&&Q===Y.presetArg))return Y;return W||X},E=(X)=>{let J=B(X),Q=J.attributeName();if(this.getOptionValueSource(Q)==="env")return`environment variable '${J.envVar}'`;return`option '${J.flags}'`},$=`error: ${E(D)} cannot be used with ${E(F)}`;this.error($,{code:"commander.conflictingOption"})}unknownOption(D){if(this._allowUnknownOption)return;let F="";if(D.startsWith("--")&&this._showSuggestionAfterError){let E=[],$=this;do{let X=$.createHelp().visibleOptions($).filter((J)=>J.long).map((J)=>J.long);E=E.concat(X),$=$.parent}while($&&!$._enablePositionalOptions);F=S3(D,E)}let B=`error: unknown option '${D}'${F}`;this.error(B,{code:"commander.unknownOption"})}_excessArguments(D){if(this._allowExcessArguments)return;let F=this.registeredArguments.length,B=F===1?"":"s",$=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${F} argument${B} but got ${D.length}.`;this.error($,{code:"commander.excessArguments"})}unknownCommand(){let D=this.args[0],F="";if(this._showSuggestionAfterError){let E=[];this.createHelp().visibleCommands(this).forEach(($)=>{if(E.push($.name()),$.alias())E.push($.alias())}),F=S3(D,E)}let B=`error: unknown command '${D}'${F}`;this.error(B,{code:"commander.unknownCommand"})}version(D,F,B){if(D===void 0)return this._version;this._version=D,F=F||"-V, --version",B=B||"output the version number";let E=this.createOption(F,B);return this._versionOptionName=E.attributeName(),this._registerOption(E),this.on("option:"+E.name(),()=>{this._outputConfiguration.writeOut(`${D}
|
|
22
|
+
`),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 Error("Command alias can't be the same as its name");let B=this.parent?._findCommand(D);if(B){let E=[B.name()].concat(B.aliases()).join("|");throw Error(`cannot add alias '${D}' to command '${this.name()}' as already have command '${E}'`)}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((B)=>{return P1(B)});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=HD.basename(D,HD.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},B;if(F.error)B=(E)=>this._outputConfiguration.writeErr(E);else B=(E)=>this._outputConfiguration.writeOut(E);return F.write=D.write||B,F.command=this,F}outputHelp(D){let F;if(typeof D==="function")F=D,D=void 0;let B=this._getHelpContext(D);this._getCommandAndAncestors().reverse().forEach(($)=>$.emit("beforeAllHelp",B)),this.emit("beforeHelp",B);let E=this.helpInformation(B);if(F){if(E=F(E),typeof E!=="string"&&!Buffer.isBuffer(E))throw Error("outputHelp callback must return a string or a Buffer")}if(B.write(E),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",B),this._getCommandAndAncestors().forEach(($)=>$.emit("afterAllHelp",B))}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=f.exitCode||0;if(F===0&&D&&typeof D!=="function"&&D.error)F=1;this._exit(F,"commander.help","(outputHelp)")}addHelpText(D,F){let B=["beforeAll","before","after","afterAll"];if(!B.includes(D))throw Error(`Unexpected value for position to addHelpText.
|
|
23
23
|
Expecting one of '${B.join("', '")}'`);let E=`${D}Help`;return this.on(E,($)=>{let X;if(typeof F==="function")X=F({error:$.error,command:$.command});else X=F;if(X)$.write(`${X}
|
|
24
|
-
`)}),this}_outputHelpIfRequested(D){let F=this._getHelpOption();if(F&&D.find((E)=>F.is(E)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function U3(D){return D.map((F)=>{if(!F.startsWith("--inspect"))return F;let B,E="127.0.0.1",$="9229",X;if((X=F.match(/^(--inspect(-brk)?)$/))!==null)B=X[1];else if((X=F.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(B=X[1],/^\d+$/.test(X[3]))$=X[3];else E=X[3];else if((X=F.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)B=X[1],E=X[3],$=X[4];if(B&&$!=="0")return`${B}=${E}:${parseInt($)+1}`;return F})}U6.Command=M0});var V3=x((R6)=>{var{Argument:j3}=f2(),{Command:U0}=z3(),{CommanderError:j6,InvalidArgumentError:C3}=U2(),{Help:C6}=H0(),{Option:R3}=q0();R6.program=new U0;R6.createCommand=(D)=>new U0(D);R6.createOption=(D,F)=>new R3(D,F);R6.createArgument=(D,F)=>new j3(D,F);R6.Command=U0;R6.Option=R3;R6.Argument=j3;R6.Help=C6;R6.CommanderError=j6;R6.InvalidArgumentError=C3;R6.InvalidOptionArgumentError=C3});var h2=x((j9,S3)=>{var f6=JD("tty"),x6=f6?.WriteStream?.prototype?.hasColors?.()??!1,O=(D,F)=>{if(!x6)return($)=>$;let B=`\x1B[${D}m`,E=`\x1B[${F}m`;return($)=>{let X=$+"",J=X.indexOf(E);if(J===-1)return B+X+E;let Q=B,Y=0,H=(F===22?E:"")+B;while(J!==-1)Q+=X.slice(Y,J)+H,Y=J+E.length,J=X.indexOf(E,Y);return Q+=X.slice(Y)+E,Q}},L={};L.reset=O(0,0);L.bold=O(1,22);L.dim=O(2,22);L.italic=O(3,23);L.underline=O(4,24);L.overline=O(53,55);L.inverse=O(7,27);L.hidden=O(8,28);L.strikethrough=O(9,29);L.black=O(30,39);L.red=O(31,39);L.green=O(32,39);L.yellow=O(33,39);L.blue=O(34,39);L.magenta=O(35,39);L.cyan=O(36,39);L.white=O(37,39);L.gray=O(90,39);L.bgBlack=O(40,49);L.bgRed=O(41,49);L.bgGreen=O(42,49);L.bgYellow=O(43,49);L.bgBlue=O(44,49);L.bgMagenta=O(45,49);L.bgCyan=O(46,49);L.bgWhite=O(47,49);L.bgGray=O(100,49);L.redBright=O(91,39);L.greenBright=O(92,39);L.yellowBright=O(93,39);L.blueBright=O(94,39);L.magentaBright=O(95,39);L.cyanBright=O(96,39);L.whiteBright=O(97,39);L.bgRedBright=O(101,49);L.bgGreenBright=O(102,49);L.bgYellowBright=O(103,49);L.bgBlueBright=O(104,49);L.bgMagentaBright=O(105,49);L.bgCyanBright=O(106,49);L.bgWhiteBright=O(107,49);S3.exports=L});var Z3=x((y9,v3)=>{v3.exports=c6;function d6(D){let F={defaultWidth:0,output:process.stdout,tty:JD("tty")};if(!D)return F;return Object.keys(F).forEach(function(B){if(!D[B])D[B]=F[B]}),D}function c6(D){let F=d6(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 B=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(B)&&B!==0)return B}return F.defaultWidth}});var x3=x((h9,f3)=>{f3.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 O0=x((g9,y3)=>{var n6=x3();y3.exports=(D)=>typeof D==="string"?D.replace(n6(),""):D});var g3=x((m9,w0)=>{var h3=(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};w0.exports=h3;w0.exports.default=h3});var l3=x((l9,m3)=>{m3.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 d3=x((p9,u0)=>{var i6=O0(),a6=g3(),r6=l3(),p3=(D)=>{if(typeof D!=="string"||D.length===0)return 0;if(D=i6(D),D.length===0)return 0;D=D.replace(r6()," ");let F=0;for(let B=0;B<D.length;B++){let E=D.codePointAt(B);if(E<=31||E>=127&&E<=159)continue;if(E>=768&&E<=879)continue;if(E>65535)B++;F+=a6(E)?2:1}return F};u0.exports=p3;u0.exports.default=p3});var n3=x((d9,c3)=>{c3.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:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var S0=x((c9,a3)=>{var j2=n3(),i3={};for(let D of Object.keys(j2))i3[j2[D]]=D;var M={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};a3.exports=M;for(let D of Object.keys(M)){if(!("channels"in M[D]))throw Error("missing channels property: "+D);if(!("labels"in M[D]))throw Error("missing channel labels property: "+D);if(M[D].labels.length!==M[D].channels)throw Error("channel and label counts mismatch: "+D);let{channels:F,labels:B}=M[D];delete M[D].channels,delete M[D].labels,Object.defineProperty(M[D],"channels",{value:F}),Object.defineProperty(M[D],"labels",{value:B})}M.rgb.hsl=function(D){let F=D[0]/255,B=D[1]/255,E=D[2]/255,$=Math.min(F,B,E),X=Math.max(F,B,E),J=X-$,Q,Y;if(X===$)Q=0;else if(F===X)Q=(B-E)/J;else if(B===X)Q=2+(E-F)/J;else if(E===X)Q=4+(F-B)/J;if(Q=Math.min(Q*60,360),Q<0)Q+=360;let W=($+X)/2;if(X===$)Y=0;else if(W<=0.5)Y=J/(X+$);else Y=J/(2-X-$);return[Q,Y*100,W*100]};M.rgb.hsv=function(D){let F,B,E,$,X,J=D[0]/255,Q=D[1]/255,Y=D[2]/255,W=Math.max(J,Q,Y),H=W-Math.min(J,Q,Y),A=function(V){return(W-V)/6/H+0.5};if(H===0)$=0,X=0;else{if(X=H/W,F=A(J),B=A(Q),E=A(Y),J===W)$=E-B;else if(Q===W)$=0.3333333333333333+F-E;else if(Y===W)$=0.6666666666666666+B-F;if($<0)$+=1;else if($>1)$-=1}return[$*360,X*100,W*100]};M.rgb.hwb=function(D){let F=D[0],B=D[1],E=D[2],$=M.rgb.hsl(D)[0],X=0.00392156862745098*Math.min(F,Math.min(B,E));return E=1-0.00392156862745098*Math.max(F,Math.max(B,E)),[$,X*100,E*100]};M.rgb.cmyk=function(D){let F=D[0]/255,B=D[1]/255,E=D[2]/255,$=Math.min(1-F,1-B,1-E),X=(1-F-$)/(1-$)||0,J=(1-B-$)/(1-$)||0,Q=(1-E-$)/(1-$)||0;return[X*100,J*100,Q*100,$*100]};function o6(D,F){return(D[0]-F[0])**2+(D[1]-F[1])**2+(D[2]-F[2])**2}M.rgb.keyword=function(D){let F=i3[D];if(F)return F;let B=1/0,E;for(let $ of Object.keys(j2)){let X=j2[$],J=o6(D,X);if(J<B)B=J,E=$}return E};M.keyword.rgb=function(D){return j2[D]};M.rgb.xyz=function(D){let F=D[0]/255,B=D[1]/255,E=D[2]/255;F=F>0.04045?((F+0.055)/1.055)**2.4:F/12.92,B=B>0.04045?((B+0.055)/1.055)**2.4:B/12.92,E=E>0.04045?((E+0.055)/1.055)**2.4:E/12.92;let $=F*0.4124+B*0.3576+E*0.1805,X=F*0.2126+B*0.7152+E*0.0722,J=F*0.0193+B*0.1192+E*0.9505;return[$*100,X*100,J*100]};M.rgb.lab=function(D){let F=M.rgb.xyz(D),B=F[0],E=F[1],$=F[2];B/=95.047,E/=100,$/=108.883,B=B>0.008856?B**0.3333333333333333:7.787*B+0.13793103448275862,E=E>0.008856?E**0.3333333333333333:7.787*E+0.13793103448275862,$=$>0.008856?$**0.3333333333333333:7.787*$+0.13793103448275862;let X=116*E-16,J=500*(B-E),Q=200*(E-$);return[X,J,Q]};M.hsl.rgb=function(D){let F=D[0]/360,B=D[1]/100,E=D[2]/100,$,X,J;if(B===0)return J=E*255,[J,J,J];if(E<0.5)$=E*(1+B);else $=E+B-E*B;let Q=2*E-$,Y=[0,0,0];for(let W=0;W<3;W++){if(X=F+0.3333333333333333*-(W-1),X<0)X++;if(X>1)X--;if(6*X<1)J=Q+($-Q)*6*X;else if(2*X<1)J=$;else if(3*X<2)J=Q+($-Q)*(0.6666666666666666-X)*6;else J=Q;Y[W]=J*255}return Y};M.hsl.hsv=function(D){let F=D[0],B=D[1]/100,E=D[2]/100,$=B,X=Math.max(E,0.01);E*=2,B*=E<=1?E:2-E,$*=X<=1?X:2-X;let J=(E+B)/2,Q=E===0?2*$/(X+$):2*B/(E+B);return[F,Q*100,J*100]};M.hsv.rgb=function(D){let F=D[0]/60,B=D[1]/100,E=D[2]/100,$=Math.floor(F)%6,X=F-Math.floor(F),J=255*E*(1-B),Q=255*E*(1-B*X),Y=255*E*(1-B*(1-X));switch(E*=255,$){case 0:return[E,Y,J];case 1:return[Q,E,J];case 2:return[J,E,Y];case 3:return[J,Q,E];case 4:return[Y,J,E];case 5:return[E,J,Q]}};M.hsv.hsl=function(D){let F=D[0],B=D[1]/100,E=D[2]/100,$=Math.max(E,0.01),X,J;J=(2-B)*E;let Q=(2-B)*$;return X=B*$,X/=Q<=1?Q:2-Q,X=X||0,J/=2,[F,X*100,J*100]};M.hwb.rgb=function(D){let F=D[0]/360,B=D[1]/100,E=D[2]/100,$=B+E,X;if($>1)B/=$,E/=$;let J=Math.floor(6*F),Q=1-E;if(X=6*F-J,(J&1)!==0)X=1-X;let Y=B+X*(Q-B),W,H,A;switch(J){default:case 6:case 0:W=Q,H=Y,A=B;break;case 1:W=Y,H=Q,A=B;break;case 2:W=B,H=Q,A=Y;break;case 3:W=B,H=Y,A=Q;break;case 4:W=Y,H=B,A=Q;break;case 5:W=Q,H=B,A=Y;break}return[W*255,H*255,A*255]};M.cmyk.rgb=function(D){let F=D[0]/100,B=D[1]/100,E=D[2]/100,$=D[3]/100,X=1-Math.min(1,F*(1-$)+$),J=1-Math.min(1,B*(1-$)+$),Q=1-Math.min(1,E*(1-$)+$);return[X*255,J*255,Q*255]};M.xyz.rgb=function(D){let F=D[0]/100,B=D[1]/100,E=D[2]/100,$,X,J;return $=F*3.2406+B*-1.5372+E*-0.4986,X=F*-0.9689+B*1.8758+E*0.0415,J=F*0.0557+B*-0.204+E*1.057,$=$>0.0031308?1.055*$**0.4166666666666667-0.055:$*12.92,X=X>0.0031308?1.055*X**0.4166666666666667-0.055:X*12.92,J=J>0.0031308?1.055*J**0.4166666666666667-0.055:J*12.92,$=Math.min(Math.max(0,$),1),X=Math.min(Math.max(0,X),1),J=Math.min(Math.max(0,J),1),[$*255,X*255,J*255]};M.xyz.lab=function(D){let F=D[0],B=D[1],E=D[2];F/=95.047,B/=100,E/=108.883,F=F>0.008856?F**0.3333333333333333:7.787*F+0.13793103448275862,B=B>0.008856?B**0.3333333333333333:7.787*B+0.13793103448275862,E=E>0.008856?E**0.3333333333333333:7.787*E+0.13793103448275862;let $=116*B-16,X=500*(F-B),J=200*(B-E);return[$,X,J]};M.lab.xyz=function(D){let F=D[0],B=D[1],E=D[2],$,X,J;X=(F+16)/116,$=B/500+X,J=X-E/200;let Q=X**3,Y=$**3,W=J**3;return X=Q>0.008856?Q:(X-0.13793103448275862)/7.787,$=Y>0.008856?Y:($-0.13793103448275862)/7.787,J=W>0.008856?W:(J-0.13793103448275862)/7.787,$*=95.047,X*=100,J*=108.883,[$,X,J]};M.lab.lch=function(D){let F=D[0],B=D[1],E=D[2],$;if($=Math.atan2(E,B)*360/2/Math.PI,$<0)$+=360;let J=Math.sqrt(B*B+E*E);return[F,J,$]};M.lch.lab=function(D){let F=D[0],B=D[1],$=D[2]/360*2*Math.PI,X=B*Math.cos($),J=B*Math.sin($);return[F,X,J]};M.rgb.ansi16=function(D,F=null){let[B,E,$]=D,X=F===null?M.rgb.hsv(D)[2]:F;if(X=Math.round(X/50),X===0)return 30;let J=30+(Math.round($/255)<<2|Math.round(E/255)<<1|Math.round(B/255));if(X===2)J+=60;return J};M.hsv.ansi16=function(D){return M.rgb.ansi16(M.hsv.rgb(D),D[2])};M.rgb.ansi256=function(D){let F=D[0],B=D[1],E=D[2];if(F===B&&B===E){if(F<8)return 16;if(F>248)return 231;return Math.round((F-8)/247*24)+232}return 16+36*Math.round(F/255*5)+6*Math.round(B/255*5)+Math.round(E/255*5)};M.ansi16.rgb=function(D){let F=D%10;if(F===0||F===7){if(D>50)F+=3.5;return F=F/10.5*255,[F,F,F]}let B=(~~(D>50)+1)*0.5,E=(F&1)*B*255,$=(F>>1&1)*B*255,X=(F>>2&1)*B*255;return[E,$,X]};M.ansi256.rgb=function(D){if(D>=232){let X=(D-232)*10+8;return[X,X,X]}D-=16;let F,B=Math.floor(D/36)/5*255,E=Math.floor((F=D%36)/6)/5*255,$=F%6/5*255;return[B,E,$]};M.rgb.hex=function(D){let B=(((Math.round(D[0])&255)<<16)+((Math.round(D[1])&255)<<8)+(Math.round(D[2])&255)).toString(16).toUpperCase();return"000000".substring(B.length)+B};M.hex.rgb=function(D){let F=D.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!F)return[0,0,0];let B=F[0];if(F[0].length===3)B=B.split("").map((Q)=>{return Q+Q}).join("");let E=parseInt(B,16),$=E>>16&255,X=E>>8&255,J=E&255;return[$,X,J]};M.rgb.hcg=function(D){let F=D[0]/255,B=D[1]/255,E=D[2]/255,$=Math.max(Math.max(F,B),E),X=Math.min(Math.min(F,B),E),J=$-X,Q,Y;if(J<1)Q=X/(1-J);else Q=0;if(J<=0)Y=0;else if($===F)Y=(B-E)/J%6;else if($===B)Y=2+(E-F)/J;else Y=4+(F-B)/J;return Y/=6,Y%=1,[Y*360,J*100,Q*100]};M.hsl.hcg=function(D){let F=D[1]/100,B=D[2]/100,E=B<0.5?2*F*B:2*F*(1-B),$=0;if(E<1)$=(B-0.5*E)/(1-E);return[D[0],E*100,$*100]};M.hsv.hcg=function(D){let F=D[1]/100,B=D[2]/100,E=F*B,$=0;if(E<1)$=(B-E)/(1-E);return[D[0],E*100,$*100]};M.hcg.rgb=function(D){let F=D[0]/360,B=D[1]/100,E=D[2]/100;if(B===0)return[E*255,E*255,E*255];let $=[0,0,0],X=F%1*6,J=X%1,Q=1-J,Y=0;switch(Math.floor(X)){case 0:$[0]=1,$[1]=J,$[2]=0;break;case 1:$[0]=Q,$[1]=1,$[2]=0;break;case 2:$[0]=0,$[1]=1,$[2]=J;break;case 3:$[0]=0,$[1]=Q,$[2]=1;break;case 4:$[0]=J,$[1]=0,$[2]=1;break;default:$[0]=1,$[1]=0,$[2]=Q}return Y=(1-B)*E,[(B*$[0]+Y)*255,(B*$[1]+Y)*255,(B*$[2]+Y)*255]};M.hcg.hsv=function(D){let F=D[1]/100,B=D[2]/100,E=F+B*(1-F),$=0;if(E>0)$=F/E;return[D[0],$*100,E*100]};M.hcg.hsl=function(D){let F=D[1]/100,E=D[2]/100*(1-F)+0.5*F,$=0;if(E>0&&E<0.5)$=F/(2*E);else if(E>=0.5&&E<1)$=F/(2*(1-E));return[D[0],$*100,E*100]};M.hcg.hwb=function(D){let F=D[1]/100,B=D[2]/100,E=F+B*(1-F);return[D[0],(E-F)*100,(1-E)*100]};M.hwb.hcg=function(D){let F=D[1]/100,E=1-D[2]/100,$=E-F,X=0;if($<1)X=(E-$)/(1-$);return[D[0],$*100,X*100]};M.apple.rgb=function(D){return[D[0]/65535*255,D[1]/65535*255,D[2]/65535*255]};M.rgb.apple=function(D){return[D[0]/255*65535,D[1]/255*65535,D[2]/255*65535]};M.gray.rgb=function(D){return[D[0]/100*255,D[0]/100*255,D[0]/100*255]};M.gray.hsl=function(D){return[0,0,D[0]]};M.gray.hsv=M.gray.hsl;M.gray.hwb=function(D){return[0,100,D[0]]};M.gray.cmyk=function(D){return[0,0,0,D[0]]};M.gray.lab=function(D){return[D[0],0,0]};M.gray.hex=function(D){let F=Math.round(D[0]/100*255)&255,E=((F<<16)+(F<<8)+F).toString(16).toUpperCase();return"000000".substring(E.length)+E};M.rgb.gray=function(D){return[(D[0]+D[1]+D[2])/3/255*100]}});var o3=x((n9,r3)=>{var m2=S0();function s6(){let D={},F=Object.keys(m2);for(let B=F.length,E=0;E<B;E++)D[F[E]]={distance:-1,parent:null};return D}function t6(D){let F=s6(),B=[D];F[D].distance=0;while(B.length){let E=B.pop(),$=Object.keys(m2[E]);for(let X=$.length,J=0;J<X;J++){let Q=$[J],Y=F[Q];if(Y.distance===-1)Y.distance=F[E].distance+1,Y.parent=E,B.unshift(Q)}}return F}function e6(D,F){return function(B){return F(D(B))}}function D1(D,F){let B=[F[D].parent,D],E=m2[F[D].parent][D],$=F[D].parent;while(F[$].parent)B.unshift(F[$].parent),E=e6(m2[F[$].parent][$],E),$=F[$].parent;return E.conversion=B,E}r3.exports=function(D){let F=t6(D),B={},E=Object.keys(F);for(let $=E.length,X=0;X<$;X++){let J=E[X];if(F[J].parent===null)continue;B[J]=D1(J,F)}return B}});var t3=x((i9,s3)=>{var I0=S0(),F1=o3(),rD={},B1=Object.keys(I0);function E1(D){let F=function(...B){let E=B[0];if(E===void 0||E===null)return E;if(E.length>1)B=E;return D(B)};if("conversion"in D)F.conversion=D.conversion;return F}function $1(D){let F=function(...B){let E=B[0];if(E===void 0||E===null)return E;if(E.length>1)B=E;let $=D(B);if(typeof $==="object")for(let X=$.length,J=0;J<X;J++)$[J]=Math.round($[J]);return $};if("conversion"in D)F.conversion=D.conversion;return F}B1.forEach((D)=>{rD[D]={},Object.defineProperty(rD[D],"channels",{value:I0[D].channels}),Object.defineProperty(rD[D],"labels",{value:I0[D].labels});let F=F1(D);Object.keys(F).forEach((E)=>{let $=F[E];rD[D][E]=$1($),rD[D][E].raw=E1($)})});s3.exports=rD});var $8=x((a9,E8)=>{var e3=(D,F)=>(...B)=>{return`\x1B[${D(...B)+F}m`},D8=(D,F)=>(...B)=>{let E=D(...B);return`\x1B[${38+F};5;${E}m`},F8=(D,F)=>(...B)=>{let E=D(...B);return`\x1B[${38+F};2;${E[0]};${E[1]};${E[2]}m`},l2=(D)=>D,B8=(D,F,B)=>[D,F,B],oD=(D,F,B)=>{Object.defineProperty(D,F,{get:()=>{let E=B();return Object.defineProperty(D,F,{value:E,enumerable:!0,configurable:!0}),E},enumerable:!0,configurable:!0})},b0,sD=(D,F,B,E)=>{if(b0===void 0)b0=t3();let $=E?10:0,X={};for(let[J,Q]of Object.entries(b0)){let Y=J==="ansi16"?"ansi":J;if(J===F)X[Y]=D(B,$);else if(typeof Q==="object")X[Y]=D(Q[F],$)}return X};function X1(){let D=new Map,F={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],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],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],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};F.color.gray=F.color.blackBright,F.bgColor.bgGray=F.bgColor.bgBlackBright,F.color.grey=F.color.blackBright,F.bgColor.bgGrey=F.bgColor.bgBlackBright;for(let[B,E]of Object.entries(F)){for(let[$,X]of Object.entries(E))F[$]={open:`\x1B[${X[0]}m`,close:`\x1B[${X[1]}m`},E[$]=F[$],D.set(X[0],X[1]);Object.defineProperty(F,B,{value:E,enumerable:!1})}return Object.defineProperty(F,"codes",{value:D,enumerable:!1}),F.color.close="\x1B[39m",F.bgColor.close="\x1B[49m",oD(F.color,"ansi",()=>sD(e3,"ansi16",l2,!1)),oD(F.color,"ansi256",()=>sD(D8,"ansi256",l2,!1)),oD(F.color,"ansi16m",()=>sD(F8,"rgb",B8,!1)),oD(F.bgColor,"ansi",()=>sD(e3,"ansi16",l2,!0)),oD(F.bgColor,"ansi256",()=>sD(D8,"ansi256",l2,!0)),oD(F.bgColor,"ansi16m",()=>sD(F8,"rgb",B8,!0)),F}Object.defineProperty(E8,"exports",{enumerable:!0,get:X1})});var Q8=x((r9,J8)=>{var C2=d3(),J1=O0(),Q1=$8(),P0=new Set(["\x1B","\x9B"]),X8=(D)=>`${P0.values().next().value}[${D}m`,Y1=(D)=>D.split(" ").map((F)=>C2(F)),T0=(D,F,B)=>{let E=[...F],$=!1,X=C2(J1(D[D.length-1]));for(let[J,Q]of E.entries()){let Y=C2(Q);if(X+Y<=B)D[D.length-1]+=Q;else D.push(Q),X=0;if(P0.has(Q))$=!0;else if($&&Q==="m"){$=!1;continue}if($)continue;if(X+=Y,X===B&&J<E.length-1)D.push(""),X=0}if(!X&&D[D.length-1].length>0&&D.length>1)D[D.length-2]+=D.pop()},W1=(D)=>{let F=D.split(" "),B=F.length;while(B>0){if(C2(F[B-1])>0)break;B--}if(B===F.length)return D;return F.slice(0,B).join(" ")+F.slice(B).join("")},H1=(D,F,B={})=>{if(B.trim!==!1&&D.trim()==="")return"";let E="",$="",X,J=Y1(D),Q=[""];for(let[Y,W]of D.split(" ").entries()){if(B.trim!==!1)Q[Q.length-1]=Q[Q.length-1].trimLeft();let H=C2(Q[Q.length-1]);if(Y!==0){if(H>=F&&(B.wordWrap===!1||B.trim===!1))Q.push(""),H=0;if(H>0||B.trim===!1)Q[Q.length-1]+=" ",H++}if(B.hard&&J[Y]>F){let A=F-H,V=1+Math.floor((J[Y]-A-1)/F);if(Math.floor((J[Y]-1)/F)<V)Q.push("");T0(Q,W,F);continue}if(H+J[Y]>F&&H>0&&J[Y]>0){if(B.wordWrap===!1&&H<F){T0(Q,W,F);continue}Q.push("")}if(H+J[Y]>F&&B.wordWrap===!1){T0(Q,W,F);continue}Q[Q.length-1]+=W}if(B.trim!==!1)Q=Q.map(W1);E=Q.join(`
|
|
25
|
-
`);for(let[Y,W]of[...E].entries()){if($+=W,
|
|
26
|
-
`)$+=
|
|
27
|
-
`)$+=
|
|
24
|
+
`)}),this}_outputHelpIfRequested(D){let F=this._getHelpOption();if(F&&D.find((E)=>F.is(E)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function b3(D){return D.map((F)=>{if(!F.startsWith("--inspect"))return F;let B,E="127.0.0.1",$="9229",X;if((X=F.match(/^(--inspect(-brk)?)$/))!==null)B=X[1];else if((X=F.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(B=X[1],/^\d+$/.test(X[3]))$=X[3];else E=X[3];else if((X=F.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)B=X[1],E=X[3],$=X[4];if(B&&$!=="0")return`${B}=${E}:${parseInt($)+1}`;return F})}v1.Command=L0});var k3=x((y1)=>{var{Argument:T3}=h2(),{Command:N0}=u3(),{CommanderError:f1,InvalidArgumentError:P3}=V2(),{Help:x1}=j0(),{Option:I3}=V0();y1.program=new N0;y1.createCommand=(D)=>new N0(D);y1.createOption=(D,F)=>new I3(D,F);y1.createArgument=(D,F)=>new T3(D,F);y1.Command=N0;y1.Option=I3;y1.Argument=T3;y1.Help=x1;y1.CommanderError=f1;y1.InvalidArgumentError=P3;y1.InvalidOptionArgumentError=P3});var l2=x((X4,g3)=>{var DF=XD("tty"),FF=DF?.WriteStream?.prototype?.hasColors?.()??!1,O=(D,F)=>{if(!FF)return($)=>$;let B=`\x1B[${D}m`,E=`\x1B[${F}m`;return($)=>{let X=$+"",J=X.indexOf(E);if(J===-1)return B+X+E;let Q=B,Y=0,H=(F===22?E:"")+B;while(J!==-1)Q+=X.slice(Y,J)+H,Y=J+E.length,J=X.indexOf(E,Y);return Q+=X.slice(Y)+E,Q}},L={};L.reset=O(0,0);L.bold=O(1,22);L.dim=O(2,22);L.italic=O(3,23);L.underline=O(4,24);L.overline=O(53,55);L.inverse=O(7,27);L.hidden=O(8,28);L.strikethrough=O(9,29);L.black=O(30,39);L.red=O(31,39);L.green=O(32,39);L.yellow=O(33,39);L.blue=O(34,39);L.magenta=O(35,39);L.cyan=O(36,39);L.white=O(37,39);L.gray=O(90,39);L.bgBlack=O(40,49);L.bgRed=O(41,49);L.bgGreen=O(42,49);L.bgYellow=O(43,49);L.bgBlue=O(44,49);L.bgMagenta=O(45,49);L.bgCyan=O(46,49);L.bgWhite=O(47,49);L.bgGray=O(100,49);L.redBright=O(91,39);L.greenBright=O(92,39);L.yellowBright=O(93,39);L.blueBright=O(94,39);L.magentaBright=O(95,39);L.cyanBright=O(96,39);L.whiteBright=O(97,39);L.bgRedBright=O(101,49);L.bgGreenBright=O(102,49);L.bgYellowBright=O(103,49);L.bgBlueBright=O(104,49);L.bgMagentaBright=O(105,49);L.bgCyanBright=O(106,49);L.bgWhiteBright=O(107,49);g3.exports=L});var i3=x((O4,n3)=>{n3.exports=WF;function YF(D){let F={defaultWidth:0,output:process.stdout,tty:XD("tty")};if(!D)return F;return Object.keys(F).forEach(function(B){if(!D[B])D[B]=F[B]}),D}function WF(D){let F=YF(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 B=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(B)&&B!==0)return B}return F.defaultWidth}});var r3=x((w4,a3)=>{a3.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 k0=x((S4,o3)=>{var HF=r3();o3.exports=(D)=>typeof D==="string"?D.replace(HF(),""):D});var t3=x((b4,v0)=>{var s3=(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};v0.exports=s3;v0.exports.default=s3});var D8=x((u4,e3)=>{e3.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 B8=x((T4,Z0)=>{var qF=k0(),_F=t3(),GF=D8(),F8=(D)=>{if(typeof D!=="string"||D.length===0)return 0;if(D=qF(D),D.length===0)return 0;D=D.replace(GF()," ");let F=0;for(let B=0;B<D.length;B++){let E=D.codePointAt(B);if(E<=31||E>=127&&E<=159)continue;if(E>=768&&E<=879)continue;if(E>65535)B++;F+=_F(E)?2:1}return F};Z0.exports=F8;Z0.exports.default=F8});var $8=x((P4,E8)=>{E8.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:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var f0=x((I4,J8)=>{var K2=$8(),X8={};for(let D of Object.keys(K2))X8[K2[D]]=D;var U={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};J8.exports=U;for(let D of Object.keys(U)){if(!("channels"in U[D]))throw Error("missing channels property: "+D);if(!("labels"in U[D]))throw Error("missing channel labels property: "+D);if(U[D].labels.length!==U[D].channels)throw Error("channel and label counts mismatch: "+D);let{channels:F,labels:B}=U[D];delete U[D].channels,delete U[D].labels,Object.defineProperty(U[D],"channels",{value:F}),Object.defineProperty(U[D],"labels",{value:B})}U.rgb.hsl=function(D){let F=D[0]/255,B=D[1]/255,E=D[2]/255,$=Math.min(F,B,E),X=Math.max(F,B,E),J=X-$,Q,Y;if(X===$)Q=0;else if(F===X)Q=(B-E)/J;else if(B===X)Q=2+(E-F)/J;else if(E===X)Q=4+(F-B)/J;if(Q=Math.min(Q*60,360),Q<0)Q+=360;let W=($+X)/2;if(X===$)Y=0;else if(W<=0.5)Y=J/(X+$);else Y=J/(2-X-$);return[Q,Y*100,W*100]};U.rgb.hsv=function(D){let F,B,E,$,X,J=D[0]/255,Q=D[1]/255,Y=D[2]/255,W=Math.max(J,Q,Y),H=W-Math.min(J,Q,Y),_=function(j){return(W-j)/6/H+0.5};if(H===0)$=0,X=0;else{if(X=H/W,F=_(J),B=_(Q),E=_(Y),J===W)$=E-B;else if(Q===W)$=0.3333333333333333+F-E;else if(Y===W)$=0.6666666666666666+B-F;if($<0)$+=1;else if($>1)$-=1}return[$*360,X*100,W*100]};U.rgb.hwb=function(D){let F=D[0],B=D[1],E=D[2],$=U.rgb.hsl(D)[0],X=0.00392156862745098*Math.min(F,Math.min(B,E));return E=1-0.00392156862745098*Math.max(F,Math.max(B,E)),[$,X*100,E*100]};U.rgb.cmyk=function(D){let F=D[0]/255,B=D[1]/255,E=D[2]/255,$=Math.min(1-F,1-B,1-E),X=(1-F-$)/(1-$)||0,J=(1-B-$)/(1-$)||0,Q=(1-E-$)/(1-$)||0;return[X*100,J*100,Q*100,$*100]};function AF(D,F){return(D[0]-F[0])**2+(D[1]-F[1])**2+(D[2]-F[2])**2}U.rgb.keyword=function(D){let F=X8[D];if(F)return F;let B=1/0,E;for(let $ of Object.keys(K2)){let X=K2[$],J=AF(D,X);if(J<B)B=J,E=$}return E};U.keyword.rgb=function(D){return K2[D]};U.rgb.xyz=function(D){let F=D[0]/255,B=D[1]/255,E=D[2]/255;F=F>0.04045?((F+0.055)/1.055)**2.4:F/12.92,B=B>0.04045?((B+0.055)/1.055)**2.4:B/12.92,E=E>0.04045?((E+0.055)/1.055)**2.4:E/12.92;let $=F*0.4124+B*0.3576+E*0.1805,X=F*0.2126+B*0.7152+E*0.0722,J=F*0.0193+B*0.1192+E*0.9505;return[$*100,X*100,J*100]};U.rgb.lab=function(D){let F=U.rgb.xyz(D),B=F[0],E=F[1],$=F[2];B/=95.047,E/=100,$/=108.883,B=B>0.008856?B**0.3333333333333333:7.787*B+0.13793103448275862,E=E>0.008856?E**0.3333333333333333:7.787*E+0.13793103448275862,$=$>0.008856?$**0.3333333333333333:7.787*$+0.13793103448275862;let X=116*E-16,J=500*(B-E),Q=200*(E-$);return[X,J,Q]};U.hsl.rgb=function(D){let F=D[0]/360,B=D[1]/100,E=D[2]/100,$,X,J;if(B===0)return J=E*255,[J,J,J];if(E<0.5)$=E*(1+B);else $=E+B-E*B;let Q=2*E-$,Y=[0,0,0];for(let W=0;W<3;W++){if(X=F+0.3333333333333333*-(W-1),X<0)X++;if(X>1)X--;if(6*X<1)J=Q+($-Q)*6*X;else if(2*X<1)J=$;else if(3*X<2)J=Q+($-Q)*(0.6666666666666666-X)*6;else J=Q;Y[W]=J*255}return Y};U.hsl.hsv=function(D){let F=D[0],B=D[1]/100,E=D[2]/100,$=B,X=Math.max(E,0.01);E*=2,B*=E<=1?E:2-E,$*=X<=1?X:2-X;let J=(E+B)/2,Q=E===0?2*$/(X+$):2*B/(E+B);return[F,Q*100,J*100]};U.hsv.rgb=function(D){let F=D[0]/60,B=D[1]/100,E=D[2]/100,$=Math.floor(F)%6,X=F-Math.floor(F),J=255*E*(1-B),Q=255*E*(1-B*X),Y=255*E*(1-B*(1-X));switch(E*=255,$){case 0:return[E,Y,J];case 1:return[Q,E,J];case 2:return[J,E,Y];case 3:return[J,Q,E];case 4:return[Y,J,E];case 5:return[E,J,Q]}};U.hsv.hsl=function(D){let F=D[0],B=D[1]/100,E=D[2]/100,$=Math.max(E,0.01),X,J;J=(2-B)*E;let Q=(2-B)*$;return X=B*$,X/=Q<=1?Q:2-Q,X=X||0,J/=2,[F,X*100,J*100]};U.hwb.rgb=function(D){let F=D[0]/360,B=D[1]/100,E=D[2]/100,$=B+E,X;if($>1)B/=$,E/=$;let J=Math.floor(6*F),Q=1-E;if(X=6*F-J,(J&1)!==0)X=1-X;let Y=B+X*(Q-B),W,H,_;switch(J){default:case 6:case 0:W=Q,H=Y,_=B;break;case 1:W=Y,H=Q,_=B;break;case 2:W=B,H=Q,_=Y;break;case 3:W=B,H=Y,_=Q;break;case 4:W=Y,H=B,_=Q;break;case 5:W=Q,H=B,_=Y;break}return[W*255,H*255,_*255]};U.cmyk.rgb=function(D){let F=D[0]/100,B=D[1]/100,E=D[2]/100,$=D[3]/100,X=1-Math.min(1,F*(1-$)+$),J=1-Math.min(1,B*(1-$)+$),Q=1-Math.min(1,E*(1-$)+$);return[X*255,J*255,Q*255]};U.xyz.rgb=function(D){let F=D[0]/100,B=D[1]/100,E=D[2]/100,$,X,J;return $=F*3.2406+B*-1.5372+E*-0.4986,X=F*-0.9689+B*1.8758+E*0.0415,J=F*0.0557+B*-0.204+E*1.057,$=$>0.0031308?1.055*$**0.4166666666666667-0.055:$*12.92,X=X>0.0031308?1.055*X**0.4166666666666667-0.055:X*12.92,J=J>0.0031308?1.055*J**0.4166666666666667-0.055:J*12.92,$=Math.min(Math.max(0,$),1),X=Math.min(Math.max(0,X),1),J=Math.min(Math.max(0,J),1),[$*255,X*255,J*255]};U.xyz.lab=function(D){let F=D[0],B=D[1],E=D[2];F/=95.047,B/=100,E/=108.883,F=F>0.008856?F**0.3333333333333333:7.787*F+0.13793103448275862,B=B>0.008856?B**0.3333333333333333:7.787*B+0.13793103448275862,E=E>0.008856?E**0.3333333333333333:7.787*E+0.13793103448275862;let $=116*B-16,X=500*(F-B),J=200*(B-E);return[$,X,J]};U.lab.xyz=function(D){let F=D[0],B=D[1],E=D[2],$,X,J;X=(F+16)/116,$=B/500+X,J=X-E/200;let Q=X**3,Y=$**3,W=J**3;return X=Q>0.008856?Q:(X-0.13793103448275862)/7.787,$=Y>0.008856?Y:($-0.13793103448275862)/7.787,J=W>0.008856?W:(J-0.13793103448275862)/7.787,$*=95.047,X*=100,J*=108.883,[$,X,J]};U.lab.lch=function(D){let F=D[0],B=D[1],E=D[2],$;if($=Math.atan2(E,B)*360/2/Math.PI,$<0)$+=360;let J=Math.sqrt(B*B+E*E);return[F,J,$]};U.lch.lab=function(D){let F=D[0],B=D[1],$=D[2]/360*2*Math.PI,X=B*Math.cos($),J=B*Math.sin($);return[F,X,J]};U.rgb.ansi16=function(D,F=null){let[B,E,$]=D,X=F===null?U.rgb.hsv(D)[2]:F;if(X=Math.round(X/50),X===0)return 30;let J=30+(Math.round($/255)<<2|Math.round(E/255)<<1|Math.round(B/255));if(X===2)J+=60;return J};U.hsv.ansi16=function(D){return U.rgb.ansi16(U.hsv.rgb(D),D[2])};U.rgb.ansi256=function(D){let F=D[0],B=D[1],E=D[2];if(F===B&&B===E){if(F<8)return 16;if(F>248)return 231;return Math.round((F-8)/247*24)+232}return 16+36*Math.round(F/255*5)+6*Math.round(B/255*5)+Math.round(E/255*5)};U.ansi16.rgb=function(D){let F=D%10;if(F===0||F===7){if(D>50)F+=3.5;return F=F/10.5*255,[F,F,F]}let B=(~~(D>50)+1)*0.5,E=(F&1)*B*255,$=(F>>1&1)*B*255,X=(F>>2&1)*B*255;return[E,$,X]};U.ansi256.rgb=function(D){if(D>=232){let X=(D-232)*10+8;return[X,X,X]}D-=16;let F,B=Math.floor(D/36)/5*255,E=Math.floor((F=D%36)/6)/5*255,$=F%6/5*255;return[B,E,$]};U.rgb.hex=function(D){let B=(((Math.round(D[0])&255)<<16)+((Math.round(D[1])&255)<<8)+(Math.round(D[2])&255)).toString(16).toUpperCase();return"000000".substring(B.length)+B};U.hex.rgb=function(D){let F=D.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!F)return[0,0,0];let B=F[0];if(F[0].length===3)B=B.split("").map((Q)=>{return Q+Q}).join("");let E=parseInt(B,16),$=E>>16&255,X=E>>8&255,J=E&255;return[$,X,J]};U.rgb.hcg=function(D){let F=D[0]/255,B=D[1]/255,E=D[2]/255,$=Math.max(Math.max(F,B),E),X=Math.min(Math.min(F,B),E),J=$-X,Q,Y;if(J<1)Q=X/(1-J);else Q=0;if(J<=0)Y=0;else if($===F)Y=(B-E)/J%6;else if($===B)Y=2+(E-F)/J;else Y=4+(F-B)/J;return Y/=6,Y%=1,[Y*360,J*100,Q*100]};U.hsl.hcg=function(D){let F=D[1]/100,B=D[2]/100,E=B<0.5?2*F*B:2*F*(1-B),$=0;if(E<1)$=(B-0.5*E)/(1-E);return[D[0],E*100,$*100]};U.hsv.hcg=function(D){let F=D[1]/100,B=D[2]/100,E=F*B,$=0;if(E<1)$=(B-E)/(1-E);return[D[0],E*100,$*100]};U.hcg.rgb=function(D){let F=D[0]/360,B=D[1]/100,E=D[2]/100;if(B===0)return[E*255,E*255,E*255];let $=[0,0,0],X=F%1*6,J=X%1,Q=1-J,Y=0;switch(Math.floor(X)){case 0:$[0]=1,$[1]=J,$[2]=0;break;case 1:$[0]=Q,$[1]=1,$[2]=0;break;case 2:$[0]=0,$[1]=1,$[2]=J;break;case 3:$[0]=0,$[1]=Q,$[2]=1;break;case 4:$[0]=J,$[1]=0,$[2]=1;break;default:$[0]=1,$[1]=0,$[2]=Q}return Y=(1-B)*E,[(B*$[0]+Y)*255,(B*$[1]+Y)*255,(B*$[2]+Y)*255]};U.hcg.hsv=function(D){let F=D[1]/100,B=D[2]/100,E=F+B*(1-F),$=0;if(E>0)$=F/E;return[D[0],$*100,E*100]};U.hcg.hsl=function(D){let F=D[1]/100,E=D[2]/100*(1-F)+0.5*F,$=0;if(E>0&&E<0.5)$=F/(2*E);else if(E>=0.5&&E<1)$=F/(2*(1-E));return[D[0],$*100,E*100]};U.hcg.hwb=function(D){let F=D[1]/100,B=D[2]/100,E=F+B*(1-F);return[D[0],(E-F)*100,(1-E)*100]};U.hwb.hcg=function(D){let F=D[1]/100,E=1-D[2]/100,$=E-F,X=0;if($<1)X=(E-$)/(1-$);return[D[0],$*100,X*100]};U.apple.rgb=function(D){return[D[0]/65535*255,D[1]/65535*255,D[2]/65535*255]};U.rgb.apple=function(D){return[D[0]/255*65535,D[1]/255*65535,D[2]/255*65535]};U.gray.rgb=function(D){return[D[0]/100*255,D[0]/100*255,D[0]/100*255]};U.gray.hsl=function(D){return[0,0,D[0]]};U.gray.hsv=U.gray.hsl;U.gray.hwb=function(D){return[0,100,D[0]]};U.gray.cmyk=function(D){return[0,0,0,D[0]]};U.gray.lab=function(D){return[D[0],0,0]};U.gray.hex=function(D){let F=Math.round(D[0]/100*255)&255,E=((F<<16)+(F<<8)+F).toString(16).toUpperCase();return"000000".substring(E.length)+E};U.rgb.gray=function(D){return[(D[0]+D[1]+D[2])/3/255*100]}});var Y8=x((k4,Q8)=>{var d2=f0();function UF(){let D={},F=Object.keys(d2);for(let B=F.length,E=0;E<B;E++)D[F[E]]={distance:-1,parent:null};return D}function MF(D){let F=UF(),B=[D];F[D].distance=0;while(B.length){let E=B.pop(),$=Object.keys(d2[E]);for(let X=$.length,J=0;J<X;J++){let Q=$[J],Y=F[Q];if(Y.distance===-1)Y.distance=F[E].distance+1,Y.parent=E,B.unshift(Q)}}return F}function zF(D,F){return function(B){return F(D(B))}}function jF(D,F){let B=[F[D].parent,D],E=d2[F[D].parent][D],$=F[D].parent;while(F[$].parent)B.unshift(F[$].parent),E=zF(d2[F[$].parent][$],E),$=F[$].parent;return E.conversion=B,E}Q8.exports=function(D){let F=MF(D),B={},E=Object.keys(F);for(let $=E.length,X=0;X<$;X++){let J=E[X];if(F[J].parent===null)continue;B[J]=jF(J,F)}return B}});var H8=x((v4,W8)=>{var x0=f0(),VF=Y8(),tD={},RF=Object.keys(x0);function KF(D){let F=function(...B){let E=B[0];if(E===void 0||E===null)return E;if(E.length>1)B=E;return D(B)};if("conversion"in D)F.conversion=D.conversion;return F}function CF(D){let F=function(...B){let E=B[0];if(E===void 0||E===null)return E;if(E.length>1)B=E;let $=D(B);if(typeof $==="object")for(let X=$.length,J=0;J<X;J++)$[J]=Math.round($[J]);return $};if("conversion"in D)F.conversion=D.conversion;return F}RF.forEach((D)=>{tD[D]={},Object.defineProperty(tD[D],"channels",{value:x0[D].channels}),Object.defineProperty(tD[D],"labels",{value:x0[D].labels});let F=VF(D);Object.keys(F).forEach((E)=>{let $=F[E];tD[D][E]=CF($),tD[D][E].raw=KF($)})});W8.exports=tD});var M8=x((Z4,U8)=>{var q8=(D,F)=>(...B)=>{return`\x1B[${D(...B)+F}m`},_8=(D,F)=>(...B)=>{let E=D(...B);return`\x1B[${38+F};5;${E}m`},G8=(D,F)=>(...B)=>{let E=D(...B);return`\x1B[${38+F};2;${E[0]};${E[1]};${E[2]}m`},c2=(D)=>D,A8=(D,F,B)=>[D,F,B],eD=(D,F,B)=>{Object.defineProperty(D,F,{get:()=>{let E=B();return Object.defineProperty(D,F,{value:E,enumerable:!0,configurable:!0}),E},enumerable:!0,configurable:!0})},y0,D2=(D,F,B,E)=>{if(y0===void 0)y0=H8();let $=E?10:0,X={};for(let[J,Q]of Object.entries(y0)){let Y=J==="ansi16"?"ansi":J;if(J===F)X[Y]=D(B,$);else if(typeof Q==="object")X[Y]=D(Q[F],$)}return X};function LF(){let D=new Map,F={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],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],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],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};F.color.gray=F.color.blackBright,F.bgColor.bgGray=F.bgColor.bgBlackBright,F.color.grey=F.color.blackBright,F.bgColor.bgGrey=F.bgColor.bgBlackBright;for(let[B,E]of Object.entries(F)){for(let[$,X]of Object.entries(E))F[$]={open:`\x1B[${X[0]}m`,close:`\x1B[${X[1]}m`},E[$]=F[$],D.set(X[0],X[1]);Object.defineProperty(F,B,{value:E,enumerable:!1})}return Object.defineProperty(F,"codes",{value:D,enumerable:!1}),F.color.close="\x1B[39m",F.bgColor.close="\x1B[49m",eD(F.color,"ansi",()=>D2(q8,"ansi16",c2,!1)),eD(F.color,"ansi256",()=>D2(_8,"ansi256",c2,!1)),eD(F.color,"ansi16m",()=>D2(G8,"rgb",A8,!1)),eD(F.bgColor,"ansi",()=>D2(q8,"ansi16",c2,!0)),eD(F.bgColor,"ansi256",()=>D2(_8,"ansi256",c2,!0)),eD(F.bgColor,"ansi16m",()=>D2(G8,"rgb",A8,!0)),F}Object.defineProperty(U8,"exports",{enumerable:!0,get:LF})});var V8=x((f4,j8)=>{var C2=B8(),NF=k0(),OF=M8(),g0=new Set(["\x1B","\x9B"]),z8=(D)=>`${g0.values().next().value}[${D}m`,wF=(D)=>D.split(" ").map((F)=>C2(F)),h0=(D,F,B)=>{let E=[...F],$=!1,X=C2(NF(D[D.length-1]));for(let[J,Q]of E.entries()){let Y=C2(Q);if(X+Y<=B)D[D.length-1]+=Q;else D.push(Q),X=0;if(g0.has(Q))$=!0;else if($&&Q==="m"){$=!1;continue}if($)continue;if(X+=Y,X===B&&J<E.length-1)D.push(""),X=0}if(!X&&D[D.length-1].length>0&&D.length>1)D[D.length-2]+=D.pop()},SF=(D)=>{let F=D.split(" "),B=F.length;while(B>0){if(C2(F[B-1])>0)break;B--}if(B===F.length)return D;return F.slice(0,B).join(" ")+F.slice(B).join("")},bF=(D,F,B={})=>{if(B.trim!==!1&&D.trim()==="")return"";let E="",$="",X,J=wF(D),Q=[""];for(let[Y,W]of D.split(" ").entries()){if(B.trim!==!1)Q[Q.length-1]=Q[Q.length-1].trimLeft();let H=C2(Q[Q.length-1]);if(Y!==0){if(H>=F&&(B.wordWrap===!1||B.trim===!1))Q.push(""),H=0;if(H>0||B.trim===!1)Q[Q.length-1]+=" ",H++}if(B.hard&&J[Y]>F){let _=F-H,j=1+Math.floor((J[Y]-_-1)/F);if(Math.floor((J[Y]-1)/F)<j)Q.push("");h0(Q,W,F);continue}if(H+J[Y]>F&&H>0&&J[Y]>0){if(B.wordWrap===!1&&H<F){h0(Q,W,F);continue}Q.push("")}if(H+J[Y]>F&&B.wordWrap===!1){h0(Q,W,F);continue}Q[Q.length-1]+=W}if(B.trim!==!1)Q=Q.map(SF);E=Q.join(`
|
|
25
|
+
`);for(let[Y,W]of[...E].entries()){if($+=W,g0.has(W)){let _=parseFloat(/\d[^m]*/.exec(E.slice(Y,Y+4)));X=_===39?null:_}let H=OF.codes.get(Number(X));if(X&&H){if(E[Y+1]===`
|
|
26
|
+
`)$+=z8(H);else if(W===`
|
|
27
|
+
`)$+=z8(X)}}return $};j8.exports=(D,F,B)=>{return String(D).normalize().replace(/\r\n/g,`
|
|
28
28
|
`).split(`
|
|
29
|
-
`).map((E)=>
|
|
30
|
-
`)}});var _8=x((F4,q8)=>{var _1=JD("stream");class H8 extends _1{#B=null;constructor(D={}){super(D);this.writable=this.readable=!0,this.muted=!1,this.on("pipe",this._onpipe),this.replace=D.replace,this._prompt=D.prompt||null,this._hadControl=!1}#F(D,F){if(this._dest)return this._dest[D];if(this._src)return this._src[D];return F}#D(D,...F){if(typeof this._dest?.[D]==="function")this._dest[D](...F);if(typeof this._src?.[D]==="function")this._src[D](...F)}get isTTY(){if(this.#B!==null)return this.#B;return this.#F("isTTY",!1)}set isTTY(D){this.#B=D}get rows(){return this.#F("rows")}get columns(){return this.#F("columns")}mute(){this.muted=!0}unmute(){this.muted=!1}_onpipe(D){this._src=D}pipe(D,F){return this._dest=D,super.pipe(D,F)}pause(){if(this._src)return this._src.pause()}resume(){if(this._src)return this._src.resume()}write(D){if(this.muted){if(!this.replace)return!0;if(D.match(/^\u001b/)){if(D.indexOf(this._prompt)===0)D=D.slice(this._prompt.length),D=D.replace(/./g,this.replace),D=this._prompt+D;return this._hadControl=!0,this.emit("data",D)}else{if(this._prompt&&this._hadControl&&D.indexOf(this._prompt)===0)this._hadControl=!1,this.emit("data",this._prompt),D=D.slice(this._prompt.length);D=D.toString().replace(/./g,this.replace)}}this.emit("data",D)}end(D){if(this.muted)if(D&&this.replace)D=D.toString().replace(/./g,this.replace);else D=null;if(D)this.emit("data",D);this.emit("end")}destroy(...D){return this.#D("destroy",...D)}destroySoon(...D){return this.#D("destroySoon",...D)}close(...D){return this.#D("close",...D)}}q8.exports=H8});var K3=SD(V3(),1),{program:o7,createCommand:s7,createArgument:t7,createOption:e7,CommanderError:D9,InvalidArgumentError:F9,InvalidOptionArgumentError:B9,Command:L3,Argument:E9,Option:$9,Help:X9}=K3.default;var N3="0.260203.0503";var z2=(D,F=[])=>D.name==="up"||F.includes("vim")&&D.name==="k"||F.includes("emacs")&&D.ctrl&&D.name==="p",x2=(D,F=[])=>D.name==="down"||F.includes("vim")&&D.name==="j"||F.includes("emacs")&&D.ctrl&&D.name==="n";var z0=(D)=>D.name==="backspace",ID=(D)=>D.name==="tab";var YD=(D)=>D.name==="enter"||D.name==="return";class j0 extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(D){super();this.cause=D?.cause}}class C0 extends Error{name="CancelPromptError";message="Prompt was canceled"}class y2 extends Error{name="ExitPromptError"}class R0 extends Error{name="HookError"}class V0 extends Error{name="ValidationError"}import{AsyncResource as Z6}from"async_hooks";import{AsyncLocalStorage as P6,AsyncResource as k6}from"async_hooks";var O3=new P6;function v6(D){return{rl:D,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function w3(D,F){let B=v6(D);return O3.run(B,()=>{function E($){B.handleChange=()=>{B.index=0,$()},B.handleChange()}return F(E)})}function bD(){let D=O3.getStore();if(!D)throw new R0("[Inquirer] Hook functions can only be called from within a prompt");return D}function K0(){return bD().rl}function L0(D){let F=(...B)=>{let E=bD(),$=!1,X=E.handleChange;E.handleChange=()=>{$=!0};let J=D(...B);if($)X();return E.handleChange=X,J};return k6.bind(F)}function iD(D){let F=bD(),{index:B}=F,E={get(){return F.hooks[B]},set(X){F.hooks[B]=X},initialized:B in F.hooks},$=D(E);return F.index++,$}function u3(){bD().handleChange()}var TD={queue(D){let F=bD(),{index:B}=F;F.hooksEffect.push(()=>{F.hooksCleanup[B]?.();let E=D(K0());if(E!=null&&typeof E!=="function")throw new V0("useEffect return value must be a cleanup function or nothing.");F.hooksCleanup[B]=E})},run(){let D=bD();L0(()=>{D.hooksEffect.forEach((F)=>{F()}),D.hooksEffect.length=0})()},clearAll(){let D=bD();D.hooksCleanup.forEach((F)=>{F?.()}),D.hooksEffect.length=0,D.hooksCleanup.length=0}};function k(D){return iD((F)=>{let B=Z6.bind(function(X){if(F.get()!==X)F.set(X),u3()});if(F.initialized)return[F.get(),B];let E=typeof D==="function"?D():D;return F.set(E),[E,B]})}function WD(D,F){iD((B)=>{let E=B.get();if(!Array.isArray(E)||F.some((X,J)=>!Object.is(X,E[J])))TD.queue(D);B.set(F)})}var l=SD(h2(),1);import BD from"process";function y6(){if(BD.platform!=="win32")return BD.env.TERM!=="linux";return Boolean(BD.env.WT_SESSION)||Boolean(BD.env.TERMINUS_SUBLIME)||BD.env.ConEmuTask==="{cmd::Cmder}"||BD.env.TERM_PROGRAM==="Terminus-Sublime"||BD.env.TERM_PROGRAM==="vscode"||BD.env.TERM==="xterm-256color"||BD.env.TERM==="alacritty"||BD.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var I3={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},b3={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},h6={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},g6={...I3,...b3},m6={...I3,...h6},l6=y6(),p6=l6?g6:m6,aD=p6,R9=Object.entries(b3);var T3={prefix:{idle:l.default.blue("?"),done:l.default.green(aD.tick)},spinner:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"].map((D)=>l.default.yellow(D))},style:{answer:l.default.cyan,message:l.default.bold,error:(D)=>l.default.red(`> ${D}`),defaultAnswer:(D)=>l.default.dim(`(${D})`),help:l.default.dim,highlight:l.default.cyan,key:(D)=>l.default.cyan(l.default.bold(`<${D}>`))}};function P3(D){if(typeof D!=="object"||D===null)return!1;let F=D;while(Object.getPrototypeOf(F)!==null)F=Object.getPrototypeOf(F);return Object.getPrototypeOf(D)===F}function k3(...D){let F={};for(let B of D)for(let[E,$]of Object.entries(B)){let X=F[E];F[E]=P3(X)&&P3($)?k3(X,$):$}return F}function n(...D){let F=[T3,...D.filter((B)=>B!=null)];return k3(...F)}function HD({status:D="idle",theme:F}){let[B,E]=k(!1),[$,X]=k(0),{prefix:J,spinner:Q}=n(F);if(WD(()=>{if(D==="loading"){let W,H=-1,A=setTimeout(()=>{E(!0),W=setInterval(()=>{H=H+1,X(H%Q.frames.length)},Q.interval)},300);return()=>{clearTimeout(A),clearInterval(W)}}else E(!1)},[D]),B)return Q.frames[$];return typeof J==="string"?J:J[D==="loading"?"idle":D]??J.idle}function N0(D,F){return iD((B)=>{let E=B.get();if(!E||E.dependencies.length!==F.length||E.dependencies.some(($,X)=>$!==F[X])){let $=D();return B.set({value:$,dependencies:F}),$}return E.value})}function g2(D){return k({current:D})[0]}function qD(D){let F=g2(D);F.current=D,WD((B)=>{let E=!1,$=L0((X,J)=>{if(E)return;F.current(J,B)});return B.input.on("keypress",$),()=>{E=!0,B.input.removeListener("keypress",$)}},[])}var Y8=SD(Z3(),1),W8=SD(Q8(),1);function R2(D,F){return D.split(`
|
|
31
|
-
`).flatMap((B)=>
|
|
29
|
+
`).map((E)=>bF(E,F,B)).join(`
|
|
30
|
+
`)}});var N8=x((l4,L8)=>{var TF=XD("stream");class C8 extends TF{#B=null;constructor(D={}){super(D);this.writable=this.readable=!0,this.muted=!1,this.on("pipe",this._onpipe),this.replace=D.replace,this._prompt=D.prompt||null,this._hadControl=!1}#F(D,F){if(this._dest)return this._dest[D];if(this._src)return this._src[D];return F}#D(D,...F){if(typeof this._dest?.[D]==="function")this._dest[D](...F);if(typeof this._src?.[D]==="function")this._src[D](...F)}get isTTY(){if(this.#B!==null)return this.#B;return this.#F("isTTY",!1)}set isTTY(D){this.#B=D}get rows(){return this.#F("rows")}get columns(){return this.#F("columns")}mute(){this.muted=!0}unmute(){this.muted=!1}_onpipe(D){this._src=D}pipe(D,F){return this._dest=D,super.pipe(D,F)}pause(){if(this._src)return this._src.pause()}resume(){if(this._src)return this._src.resume()}write(D){if(this.muted){if(!this.replace)return!0;if(D.match(/^\u001b/)){if(D.indexOf(this._prompt)===0)D=D.slice(this._prompt.length),D=D.replace(/./g,this.replace),D=this._prompt+D;return this._hadControl=!0,this.emit("data",D)}else{if(this._prompt&&this._hadControl&&D.indexOf(this._prompt)===0)this._hadControl=!1,this.emit("data",this._prompt),D=D.slice(this._prompt.length);D=D.toString().replace(/./g,this.replace)}}this.emit("data",D)}end(D){if(this.muted)if(D&&this.replace)D=D.toString().replace(/./g,this.replace);else D=null;if(D)this.emit("data",D);this.emit("end")}destroy(...D){return this.#D("destroy",...D)}destroySoon(...D){return this.#D("destroySoon",...D)}close(...D){return this.#D("close",...D)}}L8.exports=C8});var v3=PD(k3(),1),{program:x9,createCommand:y9,createArgument:h9,createOption:g9,CommanderError:m9,InvalidArgumentError:l9,InvalidOptionArgumentError:p9,Command:Z3,Argument:d9,Option:c9,Help:n9}=v3.default;var f3="0.260203.0629";var R2=(D,F=[])=>D.name==="up"||F.includes("vim")&&D.name==="k"||F.includes("emacs")&&D.ctrl&&D.name==="p",g2=(D,F=[])=>D.name==="down"||F.includes("vim")&&D.name==="j"||F.includes("emacs")&&D.ctrl&&D.name==="n";var O0=(D)=>D.name==="backspace",ID=(D)=>D.name==="tab";var qD=(D)=>D.name==="enter"||D.name==="return";class w0 extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(D){super();this.cause=D?.cause}}class S0 extends Error{name="CancelPromptError";message="Prompt was canceled"}class m2 extends Error{name="ExitPromptError"}class b0 extends Error{name="HookError"}class u0 extends Error{name="ValidationError"}import{AsyncResource as e1}from"async_hooks";import{AsyncLocalStorage as o1,AsyncResource as s1}from"async_hooks";var x3=new o1;function t1(D){return{rl:D,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function y3(D,F){let B=t1(D);return x3.run(B,()=>{function E($){B.handleChange=()=>{B.index=0,$()},B.handleChange()}return F(E)})}function kD(){let D=x3.getStore();if(!D)throw new b0("[Inquirer] Hook functions can only be called from within a prompt");return D}function T0(){return kD().rl}function P0(D){let F=(...B)=>{let E=kD(),$=!1,X=E.handleChange;E.handleChange=()=>{$=!0};let J=D(...B);if($)X();return E.handleChange=X,J};return s1.bind(F)}function oD(D){let F=kD(),{index:B}=F,E={get(){return F.hooks[B]},set(X){F.hooks[B]=X},initialized:B in F.hooks},$=D(E);return F.index++,$}function h3(){kD().handleChange()}var vD={queue(D){let F=kD(),{index:B}=F;F.hooksEffect.push(()=>{F.hooksCleanup[B]?.();let E=D(T0());if(E!=null&&typeof E!=="function")throw new u0("useEffect return value must be a cleanup function or nothing.");F.hooksCleanup[B]=E})},run(){let D=kD();P0(()=>{D.hooksEffect.forEach((F)=>{F()}),D.hooksEffect.length=0})()},clearAll(){let D=kD();D.hooksCleanup.forEach((F)=>{F?.()}),D.hooksEffect.length=0,D.hooksCleanup.length=0}};function k(D){return oD((F)=>{let B=e1.bind(function(X){if(F.get()!==X)F.set(X),h3()});if(F.initialized)return[F.get(),B];let E=typeof D==="function"?D():D;return F.set(E),[E,B]})}function _D(D,F){oD((B)=>{let E=B.get();if(!Array.isArray(E)||F.some((X,J)=>!Object.is(X,E[J])))vD.queue(D);B.set(F)})}var d=PD(l2(),1);import JD from"process";function BF(){if(JD.platform!=="win32")return JD.env.TERM!=="linux";return Boolean(JD.env.WT_SESSION)||Boolean(JD.env.TERMINUS_SUBLIME)||JD.env.ConEmuTask==="{cmd::Cmder}"||JD.env.TERM_PROGRAM==="Terminus-Sublime"||JD.env.TERM_PROGRAM==="vscode"||JD.env.TERM==="xterm-256color"||JD.env.TERM==="alacritty"||JD.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var m3={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},l3={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},EF={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},$F={...m3,...l3},XF={...m3,...EF},JF=BF(),QF=JF?$F:XF,sD=QF,Q4=Object.entries(l3);var p3={prefix:{idle:d.default.blue("?"),done:d.default.green(sD.tick)},spinner:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"].map((D)=>d.default.yellow(D))},style:{answer:d.default.cyan,message:d.default.bold,error:(D)=>d.default.red(`> ${D}`),defaultAnswer:(D)=>d.default.dim(`(${D})`),help:d.default.dim,highlight:d.default.cyan,key:(D)=>d.default.cyan(d.default.bold(`<${D}>`))}};function d3(D){if(typeof D!=="object"||D===null)return!1;let F=D;while(Object.getPrototypeOf(F)!==null)F=Object.getPrototypeOf(F);return Object.getPrototypeOf(D)===F}function c3(...D){let F={};for(let B of D)for(let[E,$]of Object.entries(B)){let X=F[E];F[E]=d3(X)&&d3($)?c3(X,$):$}return F}function a(...D){let F=[p3,...D.filter((B)=>B!=null)];return c3(...F)}function GD({status:D="idle",theme:F}){let[B,E]=k(!1),[$,X]=k(0),{prefix:J,spinner:Q}=a(F);if(_D(()=>{if(D==="loading"){let W,H=-1,_=setTimeout(()=>{E(!0),W=setInterval(()=>{H=H+1,X(H%Q.frames.length)},Q.interval)},300);return()=>{clearTimeout(_),clearInterval(W)}}else E(!1)},[D]),B)return Q.frames[$];return typeof J==="string"?J:J[D==="loading"?"idle":D]??J.idle}function I0(D,F){return oD((B)=>{let E=B.get();if(!E||E.dependencies.length!==F.length||E.dependencies.some(($,X)=>$!==F[X])){let $=D();return B.set({value:$,dependencies:F}),$}return E.value})}function p2(D){return k({current:D})[0]}function AD(D){let F=p2(D);F.current=D,_D((B)=>{let E=!1,$=P0((X,J)=>{if(E)return;F.current(J,B)});return B.input.on("keypress",$),()=>{E=!0,B.input.removeListener("keypress",$)}},[])}var R8=PD(i3(),1),K8=PD(V8(),1);function L2(D,F){return D.split(`
|
|
31
|
+
`).flatMap((B)=>K8.default(B,F,{trim:!1,hard:!0}).split(`
|
|
32
32
|
`).map((E)=>E.trimEnd())).join(`
|
|
33
|
-
`)}function
|
|
34
|
-
`)}),Y=Q.reduce((
|
|
35
|
-
`)}var
|
|
36
|
-
`).length,
|
|
37
|
-
`).pop()??"";class
|
|
33
|
+
`)}function n2(){return R8.default({defaultWidth:80,output:T0().output})}function uF({active:D,renderedItems:F,pageSize:B,loop:E}){let $=p2({lastPointer:D,lastActive:void 0}),{lastPointer:X,lastActive:J}=$.current,Q=Math.floor(B/2),Y=F.reduce((_,j)=>_+j.length,0),W=F.slice(0,D).reduce((_,j)=>_+j.length,0),H=W;if(Y>B)if(E){if(H=X,J!=null&&J<D&&D-J<B)H=Math.min(Q,Math.abs(D-J)===1?Math.min(X+(F[J]?.length??0),Math.max(W,X)):X+D-J)}else{let _=F.slice(D).reduce((j,R)=>j+R.length,0);H=_<B-Q?B-_:Math.min(W,Q)}return $.current.lastPointer=H,$.current.lastActive=D,H}function m0({items:D,active:F,renderItem:B,pageSize:E,loop:$=!0}){let X=n2(),J=(C)=>(C%D.length+D.length)%D.length,Q=D.map((C,b)=>{if(C==null)return[];return L2(B({item:C,index:b,isActive:b===F}),X).split(`
|
|
34
|
+
`)}),Y=Q.reduce((C,b)=>C+b.length,0),W=(C)=>Q[C]??[],H=uF({active:F,renderedItems:Q,pageSize:E,loop:$}),_=W(F).slice(0,E),j=H+_.length<=E?H:E-_.length,R=Array.from({length:E});R.splice(j,_.length,..._);let u=new Set([F]),T=j+_.length,P=J(F+1);while(T<E&&!u.has(P)&&($&&Y>E?P!==F:P>F)){let b=W(P).slice(0,E-T);R.splice(T,b.length,...b),u.add(P),T+=b.length,P=J(P+1)}T=j-1,P=J(F-1);while(T>=0&&!u.has(P)&&($&&Y>E?P!==F:P<F)){let C=W(P),b=C.slice(Math.max(0,C.length-T-1));R.splice(T-b.length+1,b.length,...b),u.add(P),T-=b.length,P=J(P-1)}return R.filter((C)=>typeof C==="string").join(`
|
|
35
|
+
`)}var v8=PD(N8(),1);import*as k8 from"readline";import{AsyncResource as fF}from"async_hooks";var ZD=[];ZD.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")ZD.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")ZD.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var i2=(D)=>!!D&&typeof D==="object"&&typeof D.removeListener==="function"&&typeof D.emit==="function"&&typeof D.reallyExit==="function"&&typeof D.listeners==="function"&&typeof D.kill==="function"&&typeof D.pid==="number"&&typeof D.on==="function",l0=Symbol.for("signal-exit emitter"),p0=globalThis,PF=Object.defineProperty.bind(Object);class O8{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(p0[l0])return p0[l0];PF(p0,l0,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(D,F){this.listeners[D].push(F)}removeListener(D,F){let B=this.listeners[D],E=B.indexOf(F);if(E===-1)return;if(E===0&&B.length===1)B.length=0;else B.splice(E,1)}emit(D,F,B){if(this.emitted[D])return!1;this.emitted[D]=!0;let E=!1;for(let $ of this.listeners[D])E=$(F,B)===!0||E;if(D==="exit")E=this.emit("afterExit",F,B)||E;return E}}class c0{}var IF=(D)=>{return{onExit(F,B){return D.onExit(F,B)},load(){return D.load()},unload(){return D.unload()}}};class w8 extends c0{onExit(){return()=>{}}load(){}unload(){}}class S8 extends c0{#B=d0.platform==="win32"?"SIGINT":"SIGHUP";#F=new O8;#D;#X;#J;#$={};#E=!1;constructor(D){super();this.#D=D,this.#$={};for(let F of ZD)this.#$[F]=()=>{let B=this.#D.listeners(F),{count:E}=this.#F,$=D;if(typeof $.__signal_exit_emitter__==="object"&&typeof $.__signal_exit_emitter__.count==="number")E+=$.__signal_exit_emitter__.count;if(B.length===E){this.unload();let X=this.#F.emit("exit",null,F),J=F==="SIGHUP"?this.#B:F;if(!X)D.kill(D.pid,J)}};this.#J=D.reallyExit,this.#X=D.emit}onExit(D,F){if(!i2(this.#D))return()=>{};if(this.#E===!1)this.load();let B=F?.alwaysLast?"afterExit":"exit";return this.#F.on(B,D),()=>{if(this.#F.removeListener(B,D),this.#F.listeners.exit.length===0&&this.#F.listeners.afterExit.length===0)this.unload()}}load(){if(this.#E)return;this.#E=!0,this.#F.count+=1;for(let D of ZD)try{let F=this.#$[D];if(F)this.#D.on(D,F)}catch(F){}this.#D.emit=(D,...F)=>{return this.#Y(D,...F)},this.#D.reallyExit=(D)=>{return this.#Q(D)}}unload(){if(!this.#E)return;this.#E=!1,ZD.forEach((D)=>{let F=this.#$[D];if(!F)throw Error("Listener not defined for signal: "+D);try{this.#D.removeListener(D,F)}catch(B){}}),this.#D.emit=this.#X,this.#D.reallyExit=this.#J,this.#F.count-=1}#Q(D){if(!i2(this.#D))return 0;return this.#D.exitCode=D||0,this.#F.emit("exit",this.#D.exitCode,null),this.#J.call(this.#D,this.#D.exitCode)}#Y(D,...F){let B=this.#X;if(D==="exit"&&i2(this.#D)){if(typeof F[0]==="number")this.#D.exitCode=F[0];let E=B.call(this.#D,D,...F);return this.#F.emit("exit",this.#D.exitCode,null),E}else return B.call(this.#D,D,...F)}}var d0=globalThis.process,{onExit:b8,load:c4,unload:n4}=IF(i2(d0)?new S8(d0):new w8);import{stripVTControlCharacters as vF}from"util";var kF="\x1B[G",T8="\x1B[?25l",P8="\x1B[?25h",n0=(D=1)=>D>0?`\x1B[${D}A`:"",i0=(D=1)=>D>0?`\x1B[${D}B`:"",a0=(D,F)=>{if(typeof F==="number"&&!Number.isNaN(F))return`\x1B[${F+1};${D+1}H`;return`\x1B[${D+1}G`},u8="\x1B[2K",r0=(D)=>D>0?(u8+n0(1)).repeat(D-1)+u8+kF:"";var I8=(D)=>D.split(`
|
|
36
|
+
`).length,ZF=(D)=>D.split(`
|
|
37
|
+
`).pop()??"";class a2{height=0;extraLinesUnderPrompt=0;cursorPos;rl;constructor(D){this.rl=D,this.cursorPos=D.getCursorPos()}write(D){this.rl.output.unmute(),this.rl.output.write(D),this.rl.output.mute()}render(D,F=""){let B=ZF(D),E=vF(B),$=E;if(this.rl.line.length>0)$=$.slice(0,-this.rl.line.length);this.rl.setPrompt($),this.cursorPos=this.rl.getCursorPos();let X=n2();if(D=L2(D,X),F=L2(F,X),E.length%X===0)D+=`
|
|
38
38
|
`;let J=D+(F?`
|
|
39
|
-
`+F:""),Y=Math.floor(E.length/X)-this.cursorPos.rows+(F?
|
|
40
|
-
`,F+=
|
|
41
|
-
at ${
|
|
42
|
-
`).trimEnd();return[
|
|
43
|
-
`),B={};for(let X of F){let[J,...Q]=X.split("=");if(J&&Q.length>0)B[J]=Q.join("=").replace(/^"|"$/g,"")}let E=(B.ID||"").toLowerCase(),$=(B.ID_LIKE||"").toLowerCase();if(E==="ubuntu"||$.includes("ubuntu"))return"ubuntu";if(E==="debian"||$.includes("debian"))return"debian";if(E==="fedora"||$.includes("fedora"))return"fedora";if(E==="rhel"||E==="centos"||E==="rocky"||E==="almalinux"||$.includes("rhel"))return"rhel";if(E==="arch"||$.includes("arch"))return"arch";return"unknown"}catch{return"unknown"}}async function
|
|
44
|
-
`)[0].trim(),J=X.match(/(\d+\.[\d.]+[a-z0-9-]*)/i);E=J?J[1]:X.slice(0,50)}catch{try{let X=(await
|
|
45
|
-
`)[0].trim(),J=X.match(/(\d+\.[\d.]+[a-z0-9-]*)/i);E=J?J[1]:X.slice(0,50)}catch{}}return{exists:!0,version:E,path:B}}catch{return{exists:!1}}}var T1=[{name:"tmux",required:!0,description:"Terminal multiplexer for shared sessions"},{name:"bun",required:!0,description:"Fast JavaScript runtime and package manager"},{name:"claude",required:!1,description:"Claude Code CLI (optional, recommended)"}];async function u8(){let D=[];for(let F of T1){let B=await d(F.name);D.push({name:F.name,installed:B.exists,version:B.version,path:B.path,required:F.required,description:F.description})}return D}function S8(D){return{ubuntu:"Ubuntu",debian:"Debian",fedora:"Fedora",rhel:"RHEL/CentOS",arch:"Arch Linux",unknown:"Linux"}[D]||"Linux"}import{existsSync as t2,mkdirSync as a5,readFileSync as m8,writeFileSync as r5}from"fs";import{homedir as l8}from"os";import{join as p8}from"path";var C={};pF(C,{void:()=>M5,util:()=>u,unknown:()=>G5,union:()=>C5,undefined:()=>H5,tuple:()=>K5,transformer:()=>P5,symbol:()=>W5,string:()=>x8,strictObject:()=>j5,setErrorMap:()=>v1,set:()=>O5,record:()=>L5,quotelessJson:()=>P1,promise:()=>T5,preprocess:()=>Z5,pipeline:()=>f5,ostring:()=>x5,optional:()=>k5,onumber:()=>y5,oboolean:()=>h5,objectUtil:()=>d0,object:()=>z5,number:()=>y8,nullable:()=>v5,null:()=>q5,never:()=>A5,nativeEnum:()=>b5,nan:()=>J5,map:()=>N5,makeIssue:()=>K2,literal:()=>S5,lazy:()=>u5,late:()=>$5,isValid:()=>CD,isDirty:()=>a2,isAsync:()=>D2,isAborted:()=>i2,intersection:()=>V5,instanceof:()=>X5,getParsedType:()=>ED,getErrorMap:()=>eD,function:()=>w5,enum:()=>I5,effect:()=>P5,discriminatedUnion:()=>R5,defaultErrorMap:()=>GD,datetimeRegex:()=>v8,date:()=>Y5,custom:()=>f8,coerce:()=>g5,boolean:()=>h8,bigint:()=>Q5,array:()=>U5,any:()=>_5,addIssueToContext:()=>G,ZodVoid:()=>N2,ZodUnknown:()=>RD,ZodUnion:()=>J2,ZodUndefined:()=>$2,ZodType:()=>w,ZodTuple:()=>XD,ZodTransformer:()=>s,ZodSymbol:()=>L2,ZodString:()=>i,ZodSet:()=>yD,ZodSchema:()=>w,ZodRecord:()=>O2,ZodReadonly:()=>G2,ZodPromise:()=>hD,ZodPipeline:()=>S2,ZodParsedType:()=>_,ZodOptional:()=>r,ZodObject:()=>Z,ZodNumber:()=>VD,ZodNullable:()=>MD,ZodNull:()=>X2,ZodNever:()=>$D,ZodNativeEnum:()=>H2,ZodNaN:()=>u2,ZodMap:()=>w2,ZodLiteral:()=>W2,ZodLazy:()=>Y2,ZodIssueCode:()=>q,ZodIntersection:()=>Q2,ZodFunction:()=>B2,ZodFirstPartyTypeKind:()=>j,ZodError:()=>m,ZodEnum:()=>LD,ZodEffects:()=>s,ZodDiscriminatedUnion:()=>r2,ZodDefault:()=>q2,ZodDate:()=>fD,ZodCatch:()=>_2,ZodBranded:()=>o2,ZodBoolean:()=>E2,ZodBigInt:()=>KD,ZodArray:()=>a,ZodAny:()=>xD,Schema:()=>w,ParseStatus:()=>y,OK:()=>h,NEVER:()=>m5,INVALID:()=>z,EMPTY_PATH:()=>Z1,DIRTY:()=>ZD,BRAND:()=>E5});var u;(function(D){D.assertEqual=($)=>{};function F($){}D.assertIs=F;function B($){throw Error()}D.assertNever=B,D.arrayToEnum=($)=>{let X={};for(let J of $)X[J]=J;return X},D.getValidEnumValues=($)=>{let X=D.objectKeys($).filter((Q)=>typeof $[$[Q]]!=="number"),J={};for(let Q of X)J[Q]=$[Q];return D.objectValues(J)},D.objectValues=($)=>{return D.objectKeys($).map(function(X){return $[X]})},D.objectKeys=typeof Object.keys==="function"?($)=>Object.keys($):($)=>{let X=[];for(let J in $)if(Object.prototype.hasOwnProperty.call($,J))X.push(J);return X},D.find=($,X)=>{for(let J of $)if(X(J))return J;return},D.isInteger=typeof Number.isInteger==="function"?($)=>Number.isInteger($):($)=>typeof $==="number"&&Number.isFinite($)&&Math.floor($)===$;function E($,X=" | "){return $.map((J)=>typeof J==="string"?`'${J}'`:J).join(X)}D.joinValues=E,D.jsonStringifyReplacer=($,X)=>{if(typeof X==="bigint")return X.toString();return X}})(u||(u={}));var d0;(function(D){D.mergeShapes=(F,B)=>{return{...F,...B}}})(d0||(d0={}));var _=u.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ED=(D)=>{switch(typeof D){case"undefined":return _.undefined;case"string":return _.string;case"number":return Number.isNaN(D)?_.nan:_.number;case"boolean":return _.boolean;case"function":return _.function;case"bigint":return _.bigint;case"symbol":return _.symbol;case"object":if(Array.isArray(D))return _.array;if(D===null)return _.null;if(D.then&&typeof D.then==="function"&&D.catch&&typeof D.catch==="function")return _.promise;if(typeof Map<"u"&&D instanceof Map)return _.map;if(typeof Set<"u"&&D instanceof Set)return _.set;if(typeof Date<"u"&&D instanceof Date)return _.date;return _.object;default:return _.unknown}};var q=u.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),P1=(D)=>{return JSON.stringify(D,null,2).replace(/"([^"]+)":/g,"$1:")};class m extends Error{get errors(){return this.issues}constructor(D){super();this.issues=[],this.addIssue=(B)=>{this.issues=[...this.issues,B]},this.addIssues=(B=[])=>{this.issues=[...this.issues,...B]};let F=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,F);else this.__proto__=F;this.name="ZodError",this.issues=D}format(D){let F=D||function($){return $.message},B={_errors:[]},E=($)=>{for(let X of $.issues)if(X.code==="invalid_union")X.unionErrors.map(E);else if(X.code==="invalid_return_type")E(X.returnTypeError);else if(X.code==="invalid_arguments")E(X.argumentsError);else if(X.path.length===0)B._errors.push(F(X));else{let J=B,Q=0;while(Q<X.path.length){let Y=X.path[Q];if(Q!==X.path.length-1)J[Y]=J[Y]||{_errors:[]};else J[Y]=J[Y]||{_errors:[]},J[Y]._errors.push(F(X));J=J[Y],Q++}}};return E(this),B}static assert(D){if(!(D instanceof m))throw Error(`Not a ZodError: ${D}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,u.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(D=(F)=>F.message){let F={},B=[];for(let E of this.issues)if(E.path.length>0){let $=E.path[0];F[$]=F[$]||[],F[$].push(D(E))}else B.push(D(E));return{formErrors:B,fieldErrors:F}}get formErrors(){return this.flatten()}}m.create=(D)=>{return new m(D)};var k1=(D,F)=>{let B;switch(D.code){case q.invalid_type:if(D.received===_.undefined)B="Required";else B=`Expected ${D.expected}, received ${D.received}`;break;case q.invalid_literal:B=`Invalid literal value, expected ${JSON.stringify(D.expected,u.jsonStringifyReplacer)}`;break;case q.unrecognized_keys:B=`Unrecognized key(s) in object: ${u.joinValues(D.keys,", ")}`;break;case q.invalid_union:B="Invalid input";break;case q.invalid_union_discriminator:B=`Invalid discriminator value. Expected ${u.joinValues(D.options)}`;break;case q.invalid_enum_value:B=`Invalid enum value. Expected ${u.joinValues(D.options)}, received '${D.received}'`;break;case q.invalid_arguments:B="Invalid function arguments";break;case q.invalid_return_type:B="Invalid function return type";break;case q.invalid_date:B="Invalid date";break;case q.invalid_string:if(typeof D.validation==="object")if("includes"in D.validation){if(B=`Invalid input: must include "${D.validation.includes}"`,typeof D.validation.position==="number")B=`${B} at one or more positions greater than or equal to ${D.validation.position}`}else if("startsWith"in D.validation)B=`Invalid input: must start with "${D.validation.startsWith}"`;else if("endsWith"in D.validation)B=`Invalid input: must end with "${D.validation.endsWith}"`;else u.assertNever(D.validation);else if(D.validation!=="regex")B=`Invalid ${D.validation}`;else B="Invalid";break;case q.too_small:if(D.type==="array")B=`Array must contain ${D.exact?"exactly":D.inclusive?"at least":"more than"} ${D.minimum} element(s)`;else if(D.type==="string")B=`String must contain ${D.exact?"exactly":D.inclusive?"at least":"over"} ${D.minimum} character(s)`;else if(D.type==="number")B=`Number must be ${D.exact?"exactly equal to ":D.inclusive?"greater than or equal to ":"greater than "}${D.minimum}`;else if(D.type==="bigint")B=`Number must be ${D.exact?"exactly equal to ":D.inclusive?"greater than or equal to ":"greater than "}${D.minimum}`;else if(D.type==="date")B=`Date must be ${D.exact?"exactly equal to ":D.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(D.minimum))}`;else B="Invalid input";break;case q.too_big:if(D.type==="array")B=`Array must contain ${D.exact?"exactly":D.inclusive?"at most":"less than"} ${D.maximum} element(s)`;else if(D.type==="string")B=`String must contain ${D.exact?"exactly":D.inclusive?"at most":"under"} ${D.maximum} character(s)`;else if(D.type==="number")B=`Number must be ${D.exact?"exactly":D.inclusive?"less than or equal to":"less than"} ${D.maximum}`;else if(D.type==="bigint")B=`BigInt must be ${D.exact?"exactly":D.inclusive?"less than or equal to":"less than"} ${D.maximum}`;else if(D.type==="date")B=`Date must be ${D.exact?"exactly":D.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(D.maximum))}`;else B="Invalid input";break;case q.custom:B="Invalid input";break;case q.invalid_intersection_types:B="Intersection results could not be merged";break;case q.not_multiple_of:B=`Number must be a multiple of ${D.multipleOf}`;break;case q.not_finite:B="Number must be finite";break;default:B=F.defaultError,u.assertNever(D)}return{message:B}},GD=k1;var I8=GD;function v1(D){I8=D}function eD(){return I8}var K2=(D)=>{let{data:F,path:B,errorMaps:E,issueData:$}=D,X=[...B,...$.path||[]],J={...$,path:X};if($.message!==void 0)return{...$,path:X,message:$.message};let Q="",Y=E.filter((W)=>!!W).slice().reverse();for(let W of Y)Q=W(J,{data:F,defaultError:Q}).message;return{...$,path:X,message:Q}},Z1=[];function G(D,F){let B=eD(),E=K2({issueData:F,data:D.data,path:D.path,errorMaps:[D.common.contextualErrorMap,D.schemaErrorMap,B,B===GD?void 0:GD].filter(($)=>!!$)});D.common.issues.push(E)}class y{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(D,F){let B=[];for(let E of F){if(E.status==="aborted")return z;if(E.status==="dirty")D.dirty();B.push(E.value)}return{status:D.value,value:B}}static async mergeObjectAsync(D,F){let B=[];for(let E of F){let $=await E.key,X=await E.value;B.push({key:$,value:X})}return y.mergeObjectSync(D,B)}static mergeObjectSync(D,F){let B={};for(let E of F){let{key:$,value:X}=E;if($.status==="aborted")return z;if(X.status==="aborted")return z;if($.status==="dirty")D.dirty();if(X.status==="dirty")D.dirty();if($.value!=="__proto__"&&(typeof X.value<"u"||E.alwaysSet))B[$.value]=X.value}return{status:D.value,value:B}}}var z=Object.freeze({status:"aborted"}),ZD=(D)=>({status:"dirty",value:D}),h=(D)=>({status:"valid",value:D}),i2=(D)=>D.status==="aborted",a2=(D)=>D.status==="dirty",CD=(D)=>D.status==="valid",D2=(D)=>typeof Promise<"u"&&D instanceof Promise;var U;(function(D){D.errToObj=(F)=>typeof F==="string"?{message:F}:F||{},D.toString=(F)=>typeof F==="string"?F:F?.message})(U||(U={}));class o{constructor(D,F,B,E){this._cachedPath=[],this.parent=D,this.data=F,this._path=B,this._key=E}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var b8=(D,F)=>{if(CD(F))return{success:!0,data:F.value};else{if(!D.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let B=new m(D.common.issues);return this._error=B,this._error}}}};function N(D){if(!D)return{};let{errorMap:F,invalid_type_error:B,required_error:E,description:$}=D;if(F&&(B||E))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(F)return{errorMap:F,description:$};return{errorMap:(J,Q)=>{let{message:Y}=D;if(J.code==="invalid_enum_value")return{message:Y??Q.defaultError};if(typeof Q.data>"u")return{message:Y??E??Q.defaultError};if(J.code!=="invalid_type")return{message:Q.defaultError};return{message:Y??B??Q.defaultError}},description:$}}class w{get description(){return this._def.description}_getType(D){return ED(D.data)}_getOrReturnCtx(D,F){return F||{common:D.parent.common,data:D.data,parsedType:ED(D.data),schemaErrorMap:this._def.errorMap,path:D.path,parent:D.parent}}_processInputParams(D){return{status:new y,ctx:{common:D.parent.common,data:D.data,parsedType:ED(D.data),schemaErrorMap:this._def.errorMap,path:D.path,parent:D.parent}}}_parseSync(D){let F=this._parse(D);if(D2(F))throw Error("Synchronous parse encountered promise.");return F}_parseAsync(D){let F=this._parse(D);return Promise.resolve(F)}parse(D,F){let B=this.safeParse(D,F);if(B.success)return B.data;throw B.error}safeParse(D,F){let B={common:{issues:[],async:F?.async??!1,contextualErrorMap:F?.errorMap},path:F?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:D,parsedType:ED(D)},E=this._parseSync({data:D,path:B.path,parent:B});return b8(B,E)}"~validate"(D){let F={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:D,parsedType:ED(D)};if(!this["~standard"].async)try{let B=this._parseSync({data:D,path:[],parent:F});return CD(B)?{value:B.value}:{issues:F.common.issues}}catch(B){if(B?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;F.common={issues:[],async:!0}}return this._parseAsync({data:D,path:[],parent:F}).then((B)=>CD(B)?{value:B.value}:{issues:F.common.issues})}async parseAsync(D,F){let B=await this.safeParseAsync(D,F);if(B.success)return B.data;throw B.error}async safeParseAsync(D,F){let B={common:{issues:[],contextualErrorMap:F?.errorMap,async:!0},path:F?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:D,parsedType:ED(D)},E=this._parse({data:D,path:B.path,parent:B}),$=await(D2(E)?E:Promise.resolve(E));return b8(B,$)}refine(D,F){let B=(E)=>{if(typeof F==="string"||typeof F>"u")return{message:F};else if(typeof F==="function")return F(E);else return F};return this._refinement((E,$)=>{let X=D(E),J=()=>$.addIssue({code:q.custom,...B(E)});if(typeof Promise<"u"&&X instanceof Promise)return X.then((Q)=>{if(!Q)return J(),!1;else return!0});if(!X)return J(),!1;else return!0})}refinement(D,F){return this._refinement((B,E)=>{if(!D(B))return E.addIssue(typeof F==="function"?F(B,E):F),!1;else return!0})}_refinement(D){return new s({schema:this,typeName:j.ZodEffects,effect:{type:"refinement",refinement:D}})}superRefine(D){return this._refinement(D)}constructor(D){this.spa=this.safeParseAsync,this._def=D,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(F)=>this["~validate"](F)}}optional(){return r.create(this,this._def)}nullable(){return MD.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return a.create(this)}promise(){return hD.create(this,this._def)}or(D){return J2.create([this,D],this._def)}and(D){return Q2.create(this,D,this._def)}transform(D){return new s({...N(this._def),schema:this,typeName:j.ZodEffects,effect:{type:"transform",transform:D}})}default(D){let F=typeof D==="function"?D:()=>D;return new q2({...N(this._def),innerType:this,defaultValue:F,typeName:j.ZodDefault})}brand(){return new o2({typeName:j.ZodBranded,type:this,...N(this._def)})}catch(D){let F=typeof D==="function"?D:()=>D;return new _2({...N(this._def),innerType:this,catchValue:F,typeName:j.ZodCatch})}describe(D){return new this.constructor({...this._def,description:D})}pipe(D){return S2.create(this,D)}readonly(){return G2.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var f1=/^c[^\s-]{8,}$/i,x1=/^[0-9a-z]+$/,y1=/^[0-9A-HJKMNP-TV-Z]{26}$/i,h1=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,g1=/^[a-z0-9_-]{21}$/i,m1=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,l1=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,p1=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,d1="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",c0,c1=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,n1=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,i1=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,a1=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,r1=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,o1=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,P8="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",s1=new RegExp(`^${P8}$`);function k8(D){let F="[0-5]\\d";if(D.precision)F=`${F}\\.\\d{${D.precision}}`;else if(D.precision==null)F=`${F}(\\.\\d+)?`;let B=D.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${F})${B}`}function t1(D){return new RegExp(`^${k8(D)}$`)}function v8(D){let F=`${P8}T${k8(D)}`,B=[];if(B.push(D.local?"Z?":"Z"),D.offset)B.push("([+-]\\d{2}:?\\d{2})");return F=`${F}(${B.join("|")})`,new RegExp(`^${F}$`)}function e1(D,F){if((F==="v4"||!F)&&c1.test(D))return!0;if((F==="v6"||!F)&&i1.test(D))return!0;return!1}function D5(D,F){if(!m1.test(D))return!1;try{let[B]=D.split(".");if(!B)return!1;let E=B.replace(/-/g,"+").replace(/_/g,"/").padEnd(B.length+(4-B.length%4)%4,"="),$=JSON.parse(atob(E));if(typeof $!=="object"||$===null)return!1;if("typ"in $&&$?.typ!=="JWT")return!1;if(!$.alg)return!1;if(F&&$.alg!==F)return!1;return!0}catch{return!1}}function F5(D,F){if((F==="v4"||!F)&&n1.test(D))return!0;if((F==="v6"||!F)&&a1.test(D))return!0;return!1}class i extends w{_parse(D){if(this._def.coerce)D.data=String(D.data);if(this._getType(D)!==_.string){let $=this._getOrReturnCtx(D);return G($,{code:q.invalid_type,expected:_.string,received:$.parsedType}),z}let B=new y,E=void 0;for(let $ of this._def.checks)if($.kind==="min"){if(D.data.length<$.value)E=this._getOrReturnCtx(D,E),G(E,{code:q.too_small,minimum:$.value,type:"string",inclusive:!0,exact:!1,message:$.message}),B.dirty()}else if($.kind==="max"){if(D.data.length>$.value)E=this._getOrReturnCtx(D,E),G(E,{code:q.too_big,maximum:$.value,type:"string",inclusive:!0,exact:!1,message:$.message}),B.dirty()}else if($.kind==="length"){let X=D.data.length>$.value,J=D.data.length<$.value;if(X||J){if(E=this._getOrReturnCtx(D,E),X)G(E,{code:q.too_big,maximum:$.value,type:"string",inclusive:!0,exact:!0,message:$.message});else if(J)G(E,{code:q.too_small,minimum:$.value,type:"string",inclusive:!0,exact:!0,message:$.message});B.dirty()}}else if($.kind==="email"){if(!p1.test(D.data))E=this._getOrReturnCtx(D,E),G(E,{validation:"email",code:q.invalid_string,message:$.message}),B.dirty()}else if($.kind==="emoji"){if(!c0)c0=new RegExp(d1,"u");if(!c0.test(D.data))E=this._getOrReturnCtx(D,E),G(E,{validation:"emoji",code:q.invalid_string,message:$.message}),B.dirty()}else if($.kind==="uuid"){if(!h1.test(D.data))E=this._getOrReturnCtx(D,E),G(E,{validation:"uuid",code:q.invalid_string,message:$.message}),B.dirty()}else if($.kind==="nanoid"){if(!g1.test(D.data))E=this._getOrReturnCtx(D,E),G(E,{validation:"nanoid",code:q.invalid_string,message:$.message}),B.dirty()}else if($.kind==="cuid"){if(!f1.test(D.data))E=this._getOrReturnCtx(D,E),G(E,{validation:"cuid",code:q.invalid_string,message:$.message}),B.dirty()}else if($.kind==="cuid2"){if(!x1.test(D.data))E=this._getOrReturnCtx(D,E),G(E,{validation:"cuid2",code:q.invalid_string,message:$.message}),B.dirty()}else if($.kind==="ulid"){if(!y1.test(D.data))E=this._getOrReturnCtx(D,E),G(E,{validation:"ulid",code:q.invalid_string,message:$.message}),B.dirty()}else if($.kind==="url")try{new URL(D.data)}catch{E=this._getOrReturnCtx(D,E),G(E,{validation:"url",code:q.invalid_string,message:$.message}),B.dirty()}else if($.kind==="regex"){if($.regex.lastIndex=0,!$.regex.test(D.data))E=this._getOrReturnCtx(D,E),G(E,{validation:"regex",code:q.invalid_string,message:$.message}),B.dirty()}else if($.kind==="trim")D.data=D.data.trim();else if($.kind==="includes"){if(!D.data.includes($.value,$.position))E=this._getOrReturnCtx(D,E),G(E,{code:q.invalid_string,validation:{includes:$.value,position:$.position},message:$.message}),B.dirty()}else if($.kind==="toLowerCase")D.data=D.data.toLowerCase();else if($.kind==="toUpperCase")D.data=D.data.toUpperCase();else if($.kind==="startsWith"){if(!D.data.startsWith($.value))E=this._getOrReturnCtx(D,E),G(E,{code:q.invalid_string,validation:{startsWith:$.value},message:$.message}),B.dirty()}else if($.kind==="endsWith"){if(!D.data.endsWith($.value))E=this._getOrReturnCtx(D,E),G(E,{code:q.invalid_string,validation:{endsWith:$.value},message:$.message}),B.dirty()}else if($.kind==="datetime"){if(!v8($).test(D.data))E=this._getOrReturnCtx(D,E),G(E,{code:q.invalid_string,validation:"datetime",message:$.message}),B.dirty()}else if($.kind==="date"){if(!s1.test(D.data))E=this._getOrReturnCtx(D,E),G(E,{code:q.invalid_string,validation:"date",message:$.message}),B.dirty()}else if($.kind==="time"){if(!t1($).test(D.data))E=this._getOrReturnCtx(D,E),G(E,{code:q.invalid_string,validation:"time",message:$.message}),B.dirty()}else if($.kind==="duration"){if(!l1.test(D.data))E=this._getOrReturnCtx(D,E),G(E,{validation:"duration",code:q.invalid_string,message:$.message}),B.dirty()}else if($.kind==="ip"){if(!e1(D.data,$.version))E=this._getOrReturnCtx(D,E),G(E,{validation:"ip",code:q.invalid_string,message:$.message}),B.dirty()}else if($.kind==="jwt"){if(!D5(D.data,$.alg))E=this._getOrReturnCtx(D,E),G(E,{validation:"jwt",code:q.invalid_string,message:$.message}),B.dirty()}else if($.kind==="cidr"){if(!F5(D.data,$.version))E=this._getOrReturnCtx(D,E),G(E,{validation:"cidr",code:q.invalid_string,message:$.message}),B.dirty()}else if($.kind==="base64"){if(!r1.test(D.data))E=this._getOrReturnCtx(D,E),G(E,{validation:"base64",code:q.invalid_string,message:$.message}),B.dirty()}else if($.kind==="base64url"){if(!o1.test(D.data))E=this._getOrReturnCtx(D,E),G(E,{validation:"base64url",code:q.invalid_string,message:$.message}),B.dirty()}else u.assertNever($);return{status:B.value,value:D.data}}_regex(D,F,B){return this.refinement((E)=>D.test(E),{validation:F,code:q.invalid_string,...U.errToObj(B)})}_addCheck(D){return new i({...this._def,checks:[...this._def.checks,D]})}email(D){return this._addCheck({kind:"email",...U.errToObj(D)})}url(D){return this._addCheck({kind:"url",...U.errToObj(D)})}emoji(D){return this._addCheck({kind:"emoji",...U.errToObj(D)})}uuid(D){return this._addCheck({kind:"uuid",...U.errToObj(D)})}nanoid(D){return this._addCheck({kind:"nanoid",...U.errToObj(D)})}cuid(D){return this._addCheck({kind:"cuid",...U.errToObj(D)})}cuid2(D){return this._addCheck({kind:"cuid2",...U.errToObj(D)})}ulid(D){return this._addCheck({kind:"ulid",...U.errToObj(D)})}base64(D){return this._addCheck({kind:"base64",...U.errToObj(D)})}base64url(D){return this._addCheck({kind:"base64url",...U.errToObj(D)})}jwt(D){return this._addCheck({kind:"jwt",...U.errToObj(D)})}ip(D){return this._addCheck({kind:"ip",...U.errToObj(D)})}cidr(D){return this._addCheck({kind:"cidr",...U.errToObj(D)})}datetime(D){if(typeof D==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:D});return this._addCheck({kind:"datetime",precision:typeof D?.precision>"u"?null:D?.precision,offset:D?.offset??!1,local:D?.local??!1,...U.errToObj(D?.message)})}date(D){return this._addCheck({kind:"date",message:D})}time(D){if(typeof D==="string")return this._addCheck({kind:"time",precision:null,message:D});return this._addCheck({kind:"time",precision:typeof D?.precision>"u"?null:D?.precision,...U.errToObj(D?.message)})}duration(D){return this._addCheck({kind:"duration",...U.errToObj(D)})}regex(D,F){return this._addCheck({kind:"regex",regex:D,...U.errToObj(F)})}includes(D,F){return this._addCheck({kind:"includes",value:D,position:F?.position,...U.errToObj(F?.message)})}startsWith(D,F){return this._addCheck({kind:"startsWith",value:D,...U.errToObj(F)})}endsWith(D,F){return this._addCheck({kind:"endsWith",value:D,...U.errToObj(F)})}min(D,F){return this._addCheck({kind:"min",value:D,...U.errToObj(F)})}max(D,F){return this._addCheck({kind:"max",value:D,...U.errToObj(F)})}length(D,F){return this._addCheck({kind:"length",value:D,...U.errToObj(F)})}nonempty(D){return this.min(1,U.errToObj(D))}trim(){return new i({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new i({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new i({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((D)=>D.kind==="datetime")}get isDate(){return!!this._def.checks.find((D)=>D.kind==="date")}get isTime(){return!!this._def.checks.find((D)=>D.kind==="time")}get isDuration(){return!!this._def.checks.find((D)=>D.kind==="duration")}get isEmail(){return!!this._def.checks.find((D)=>D.kind==="email")}get isURL(){return!!this._def.checks.find((D)=>D.kind==="url")}get isEmoji(){return!!this._def.checks.find((D)=>D.kind==="emoji")}get isUUID(){return!!this._def.checks.find((D)=>D.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((D)=>D.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((D)=>D.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((D)=>D.kind==="cuid2")}get isULID(){return!!this._def.checks.find((D)=>D.kind==="ulid")}get isIP(){return!!this._def.checks.find((D)=>D.kind==="ip")}get isCIDR(){return!!this._def.checks.find((D)=>D.kind==="cidr")}get isBase64(){return!!this._def.checks.find((D)=>D.kind==="base64")}get isBase64url(){return!!this._def.checks.find((D)=>D.kind==="base64url")}get minLength(){let D=null;for(let F of this._def.checks)if(F.kind==="min"){if(D===null||F.value>D)D=F.value}return D}get maxLength(){let D=null;for(let F of this._def.checks)if(F.kind==="max"){if(D===null||F.value<D)D=F.value}return D}}i.create=(D)=>{return new i({checks:[],typeName:j.ZodString,coerce:D?.coerce??!1,...N(D)})};function B5(D,F){let B=(D.toString().split(".")[1]||"").length,E=(F.toString().split(".")[1]||"").length,$=B>E?B:E,X=Number.parseInt(D.toFixed($).replace(".","")),J=Number.parseInt(F.toFixed($).replace(".",""));return X%J/10**$}class VD extends w{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(D){if(this._def.coerce)D.data=Number(D.data);if(this._getType(D)!==_.number){let $=this._getOrReturnCtx(D);return G($,{code:q.invalid_type,expected:_.number,received:$.parsedType}),z}let B=void 0,E=new y;for(let $ of this._def.checks)if($.kind==="int"){if(!u.isInteger(D.data))B=this._getOrReturnCtx(D,B),G(B,{code:q.invalid_type,expected:"integer",received:"float",message:$.message}),E.dirty()}else if($.kind==="min"){if($.inclusive?D.data<$.value:D.data<=$.value)B=this._getOrReturnCtx(D,B),G(B,{code:q.too_small,minimum:$.value,type:"number",inclusive:$.inclusive,exact:!1,message:$.message}),E.dirty()}else if($.kind==="max"){if($.inclusive?D.data>$.value:D.data>=$.value)B=this._getOrReturnCtx(D,B),G(B,{code:q.too_big,maximum:$.value,type:"number",inclusive:$.inclusive,exact:!1,message:$.message}),E.dirty()}else if($.kind==="multipleOf"){if(B5(D.data,$.value)!==0)B=this._getOrReturnCtx(D,B),G(B,{code:q.not_multiple_of,multipleOf:$.value,message:$.message}),E.dirty()}else if($.kind==="finite"){if(!Number.isFinite(D.data))B=this._getOrReturnCtx(D,B),G(B,{code:q.not_finite,message:$.message}),E.dirty()}else u.assertNever($);return{status:E.value,value:D.data}}gte(D,F){return this.setLimit("min",D,!0,U.toString(F))}gt(D,F){return this.setLimit("min",D,!1,U.toString(F))}lte(D,F){return this.setLimit("max",D,!0,U.toString(F))}lt(D,F){return this.setLimit("max",D,!1,U.toString(F))}setLimit(D,F,B,E){return new VD({...this._def,checks:[...this._def.checks,{kind:D,value:F,inclusive:B,message:U.toString(E)}]})}_addCheck(D){return new VD({...this._def,checks:[...this._def.checks,D]})}int(D){return this._addCheck({kind:"int",message:U.toString(D)})}positive(D){return this._addCheck({kind:"min",value:0,inclusive:!1,message:U.toString(D)})}negative(D){return this._addCheck({kind:"max",value:0,inclusive:!1,message:U.toString(D)})}nonpositive(D){return this._addCheck({kind:"max",value:0,inclusive:!0,message:U.toString(D)})}nonnegative(D){return this._addCheck({kind:"min",value:0,inclusive:!0,message:U.toString(D)})}multipleOf(D,F){return this._addCheck({kind:"multipleOf",value:D,message:U.toString(F)})}finite(D){return this._addCheck({kind:"finite",message:U.toString(D)})}safe(D){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:U.toString(D)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:U.toString(D)})}get minValue(){let D=null;for(let F of this._def.checks)if(F.kind==="min"){if(D===null||F.value>D)D=F.value}return D}get maxValue(){let D=null;for(let F of this._def.checks)if(F.kind==="max"){if(D===null||F.value<D)D=F.value}return D}get isInt(){return!!this._def.checks.find((D)=>D.kind==="int"||D.kind==="multipleOf"&&u.isInteger(D.value))}get isFinite(){let D=null,F=null;for(let B of this._def.checks)if(B.kind==="finite"||B.kind==="int"||B.kind==="multipleOf")return!0;else if(B.kind==="min"){if(F===null||B.value>F)F=B.value}else if(B.kind==="max"){if(D===null||B.value<D)D=B.value}return Number.isFinite(F)&&Number.isFinite(D)}}VD.create=(D)=>{return new VD({checks:[],typeName:j.ZodNumber,coerce:D?.coerce||!1,...N(D)})};class KD extends w{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(D){if(this._def.coerce)try{D.data=BigInt(D.data)}catch{return this._getInvalidInput(D)}if(this._getType(D)!==_.bigint)return this._getInvalidInput(D);let B=void 0,E=new y;for(let $ of this._def.checks)if($.kind==="min"){if($.inclusive?D.data<$.value:D.data<=$.value)B=this._getOrReturnCtx(D,B),G(B,{code:q.too_small,type:"bigint",minimum:$.value,inclusive:$.inclusive,message:$.message}),E.dirty()}else if($.kind==="max"){if($.inclusive?D.data>$.value:D.data>=$.value)B=this._getOrReturnCtx(D,B),G(B,{code:q.too_big,type:"bigint",maximum:$.value,inclusive:$.inclusive,message:$.message}),E.dirty()}else if($.kind==="multipleOf"){if(D.data%$.value!==BigInt(0))B=this._getOrReturnCtx(D,B),G(B,{code:q.not_multiple_of,multipleOf:$.value,message:$.message}),E.dirty()}else u.assertNever($);return{status:E.value,value:D.data}}_getInvalidInput(D){let F=this._getOrReturnCtx(D);return G(F,{code:q.invalid_type,expected:_.bigint,received:F.parsedType}),z}gte(D,F){return this.setLimit("min",D,!0,U.toString(F))}gt(D,F){return this.setLimit("min",D,!1,U.toString(F))}lte(D,F){return this.setLimit("max",D,!0,U.toString(F))}lt(D,F){return this.setLimit("max",D,!1,U.toString(F))}setLimit(D,F,B,E){return new KD({...this._def,checks:[...this._def.checks,{kind:D,value:F,inclusive:B,message:U.toString(E)}]})}_addCheck(D){return new KD({...this._def,checks:[...this._def.checks,D]})}positive(D){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:U.toString(D)})}negative(D){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:U.toString(D)})}nonpositive(D){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:U.toString(D)})}nonnegative(D){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:U.toString(D)})}multipleOf(D,F){return this._addCheck({kind:"multipleOf",value:D,message:U.toString(F)})}get minValue(){let D=null;for(let F of this._def.checks)if(F.kind==="min"){if(D===null||F.value>D)D=F.value}return D}get maxValue(){let D=null;for(let F of this._def.checks)if(F.kind==="max"){if(D===null||F.value<D)D=F.value}return D}}KD.create=(D)=>{return new KD({checks:[],typeName:j.ZodBigInt,coerce:D?.coerce??!1,...N(D)})};class E2 extends w{_parse(D){if(this._def.coerce)D.data=Boolean(D.data);if(this._getType(D)!==_.boolean){let B=this._getOrReturnCtx(D);return G(B,{code:q.invalid_type,expected:_.boolean,received:B.parsedType}),z}return h(D.data)}}E2.create=(D)=>{return new E2({typeName:j.ZodBoolean,coerce:D?.coerce||!1,...N(D)})};class fD extends w{_parse(D){if(this._def.coerce)D.data=new Date(D.data);if(this._getType(D)!==_.date){let $=this._getOrReturnCtx(D);return G($,{code:q.invalid_type,expected:_.date,received:$.parsedType}),z}if(Number.isNaN(D.data.getTime())){let $=this._getOrReturnCtx(D);return G($,{code:q.invalid_date}),z}let B=new y,E=void 0;for(let $ of this._def.checks)if($.kind==="min"){if(D.data.getTime()<$.value)E=this._getOrReturnCtx(D,E),G(E,{code:q.too_small,message:$.message,inclusive:!0,exact:!1,minimum:$.value,type:"date"}),B.dirty()}else if($.kind==="max"){if(D.data.getTime()>$.value)E=this._getOrReturnCtx(D,E),G(E,{code:q.too_big,message:$.message,inclusive:!0,exact:!1,maximum:$.value,type:"date"}),B.dirty()}else u.assertNever($);return{status:B.value,value:new Date(D.data.getTime())}}_addCheck(D){return new fD({...this._def,checks:[...this._def.checks,D]})}min(D,F){return this._addCheck({kind:"min",value:D.getTime(),message:U.toString(F)})}max(D,F){return this._addCheck({kind:"max",value:D.getTime(),message:U.toString(F)})}get minDate(){let D=null;for(let F of this._def.checks)if(F.kind==="min"){if(D===null||F.value>D)D=F.value}return D!=null?new Date(D):null}get maxDate(){let D=null;for(let F of this._def.checks)if(F.kind==="max"){if(D===null||F.value<D)D=F.value}return D!=null?new Date(D):null}}fD.create=(D)=>{return new fD({checks:[],coerce:D?.coerce||!1,typeName:j.ZodDate,...N(D)})};class L2 extends w{_parse(D){if(this._getType(D)!==_.symbol){let B=this._getOrReturnCtx(D);return G(B,{code:q.invalid_type,expected:_.symbol,received:B.parsedType}),z}return h(D.data)}}L2.create=(D)=>{return new L2({typeName:j.ZodSymbol,...N(D)})};class $2 extends w{_parse(D){if(this._getType(D)!==_.undefined){let B=this._getOrReturnCtx(D);return G(B,{code:q.invalid_type,expected:_.undefined,received:B.parsedType}),z}return h(D.data)}}$2.create=(D)=>{return new $2({typeName:j.ZodUndefined,...N(D)})};class X2 extends w{_parse(D){if(this._getType(D)!==_.null){let B=this._getOrReturnCtx(D);return G(B,{code:q.invalid_type,expected:_.null,received:B.parsedType}),z}return h(D.data)}}X2.create=(D)=>{return new X2({typeName:j.ZodNull,...N(D)})};class xD extends w{constructor(){super(...arguments);this._any=!0}_parse(D){return h(D.data)}}xD.create=(D)=>{return new xD({typeName:j.ZodAny,...N(D)})};class RD extends w{constructor(){super(...arguments);this._unknown=!0}_parse(D){return h(D.data)}}RD.create=(D)=>{return new RD({typeName:j.ZodUnknown,...N(D)})};class $D extends w{_parse(D){let F=this._getOrReturnCtx(D);return G(F,{code:q.invalid_type,expected:_.never,received:F.parsedType}),z}}$D.create=(D)=>{return new $D({typeName:j.ZodNever,...N(D)})};class N2 extends w{_parse(D){if(this._getType(D)!==_.undefined){let B=this._getOrReturnCtx(D);return G(B,{code:q.invalid_type,expected:_.void,received:B.parsedType}),z}return h(D.data)}}N2.create=(D)=>{return new N2({typeName:j.ZodVoid,...N(D)})};class a extends w{_parse(D){let{ctx:F,status:B}=this._processInputParams(D),E=this._def;if(F.parsedType!==_.array)return G(F,{code:q.invalid_type,expected:_.array,received:F.parsedType}),z;if(E.exactLength!==null){let X=F.data.length>E.exactLength.value,J=F.data.length<E.exactLength.value;if(X||J)G(F,{code:X?q.too_big:q.too_small,minimum:J?E.exactLength.value:void 0,maximum:X?E.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:E.exactLength.message}),B.dirty()}if(E.minLength!==null){if(F.data.length<E.minLength.value)G(F,{code:q.too_small,minimum:E.minLength.value,type:"array",inclusive:!0,exact:!1,message:E.minLength.message}),B.dirty()}if(E.maxLength!==null){if(F.data.length>E.maxLength.value)G(F,{code:q.too_big,maximum:E.maxLength.value,type:"array",inclusive:!0,exact:!1,message:E.maxLength.message}),B.dirty()}if(F.common.async)return Promise.all([...F.data].map((X,J)=>{return E.type._parseAsync(new o(F,X,F.path,J))})).then((X)=>{return y.mergeArray(B,X)});let $=[...F.data].map((X,J)=>{return E.type._parseSync(new o(F,X,F.path,J))});return y.mergeArray(B,$)}get element(){return this._def.type}min(D,F){return new a({...this._def,minLength:{value:D,message:U.toString(F)}})}max(D,F){return new a({...this._def,maxLength:{value:D,message:U.toString(F)}})}length(D,F){return new a({...this._def,exactLength:{value:D,message:U.toString(F)}})}nonempty(D){return this.min(1,D)}}a.create=(D,F)=>{return new a({type:D,minLength:null,maxLength:null,exactLength:null,typeName:j.ZodArray,...N(F)})};function F2(D){if(D instanceof Z){let F={};for(let B in D.shape){let E=D.shape[B];F[B]=r.create(F2(E))}return new Z({...D._def,shape:()=>F})}else if(D instanceof a)return new a({...D._def,type:F2(D.element)});else if(D instanceof r)return r.create(F2(D.unwrap()));else if(D instanceof MD)return MD.create(F2(D.unwrap()));else if(D instanceof XD)return XD.create(D.items.map((F)=>F2(F)));else return D}class Z extends w{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let D=this._def.shape(),F=u.objectKeys(D);return this._cached={shape:D,keys:F},this._cached}_parse(D){if(this._getType(D)!==_.object){let Y=this._getOrReturnCtx(D);return G(Y,{code:q.invalid_type,expected:_.object,received:Y.parsedType}),z}let{status:B,ctx:E}=this._processInputParams(D),{shape:$,keys:X}=this._getCached(),J=[];if(!(this._def.catchall instanceof $D&&this._def.unknownKeys==="strip")){for(let Y in E.data)if(!X.includes(Y))J.push(Y)}let Q=[];for(let Y of X){let W=$[Y],H=E.data[Y];Q.push({key:{status:"valid",value:Y},value:W._parse(new o(E,H,E.path,Y)),alwaysSet:Y in E.data})}if(this._def.catchall instanceof $D){let Y=this._def.unknownKeys;if(Y==="passthrough")for(let W of J)Q.push({key:{status:"valid",value:W},value:{status:"valid",value:E.data[W]}});else if(Y==="strict"){if(J.length>0)G(E,{code:q.unrecognized_keys,keys:J}),B.dirty()}else if(Y==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let Y=this._def.catchall;for(let W of J){let H=E.data[W];Q.push({key:{status:"valid",value:W},value:Y._parse(new o(E,H,E.path,W)),alwaysSet:W in E.data})}}if(E.common.async)return Promise.resolve().then(async()=>{let Y=[];for(let W of Q){let H=await W.key,A=await W.value;Y.push({key:H,value:A,alwaysSet:W.alwaysSet})}return Y}).then((Y)=>{return y.mergeObjectSync(B,Y)});else return y.mergeObjectSync(B,Q)}get shape(){return this._def.shape()}strict(D){return U.errToObj,new Z({...this._def,unknownKeys:"strict",...D!==void 0?{errorMap:(F,B)=>{let E=this._def.errorMap?.(F,B).message??B.defaultError;if(F.code==="unrecognized_keys")return{message:U.errToObj(D).message??E};return{message:E}}}:{}})}strip(){return new Z({...this._def,unknownKeys:"strip"})}passthrough(){return new Z({...this._def,unknownKeys:"passthrough"})}extend(D){return new Z({...this._def,shape:()=>({...this._def.shape(),...D})})}merge(D){return new Z({unknownKeys:D._def.unknownKeys,catchall:D._def.catchall,shape:()=>({...this._def.shape(),...D._def.shape()}),typeName:j.ZodObject})}setKey(D,F){return this.augment({[D]:F})}catchall(D){return new Z({...this._def,catchall:D})}pick(D){let F={};for(let B of u.objectKeys(D))if(D[B]&&this.shape[B])F[B]=this.shape[B];return new Z({...this._def,shape:()=>F})}omit(D){let F={};for(let B of u.objectKeys(this.shape))if(!D[B])F[B]=this.shape[B];return new Z({...this._def,shape:()=>F})}deepPartial(){return F2(this)}partial(D){let F={};for(let B of u.objectKeys(this.shape)){let E=this.shape[B];if(D&&!D[B])F[B]=E;else F[B]=E.optional()}return new Z({...this._def,shape:()=>F})}required(D){let F={};for(let B of u.objectKeys(this.shape))if(D&&!D[B])F[B]=this.shape[B];else{let $=this.shape[B];while($ instanceof r)$=$._def.innerType;F[B]=$}return new Z({...this._def,shape:()=>F})}keyof(){return Z8(u.objectKeys(this.shape))}}Z.create=(D,F)=>{return new Z({shape:()=>D,unknownKeys:"strip",catchall:$D.create(),typeName:j.ZodObject,...N(F)})};Z.strictCreate=(D,F)=>{return new Z({shape:()=>D,unknownKeys:"strict",catchall:$D.create(),typeName:j.ZodObject,...N(F)})};Z.lazycreate=(D,F)=>{return new Z({shape:D,unknownKeys:"strip",catchall:$D.create(),typeName:j.ZodObject,...N(F)})};class J2 extends w{_parse(D){let{ctx:F}=this._processInputParams(D),B=this._def.options;function E($){for(let J of $)if(J.result.status==="valid")return J.result;for(let J of $)if(J.result.status==="dirty")return F.common.issues.push(...J.ctx.common.issues),J.result;let X=$.map((J)=>new m(J.ctx.common.issues));return G(F,{code:q.invalid_union,unionErrors:X}),z}if(F.common.async)return Promise.all(B.map(async($)=>{let X={...F,common:{...F.common,issues:[]},parent:null};return{result:await $._parseAsync({data:F.data,path:F.path,parent:X}),ctx:X}})).then(E);else{let $=void 0,X=[];for(let Q of B){let Y={...F,common:{...F.common,issues:[]},parent:null},W=Q._parseSync({data:F.data,path:F.path,parent:Y});if(W.status==="valid")return W;else if(W.status==="dirty"&&!$)$={result:W,ctx:Y};if(Y.common.issues.length)X.push(Y.common.issues)}if($)return F.common.issues.push(...$.ctx.common.issues),$.result;let J=X.map((Q)=>new m(Q));return G(F,{code:q.invalid_union,unionErrors:J}),z}}get options(){return this._def.options}}J2.create=(D,F)=>{return new J2({options:D,typeName:j.ZodUnion,...N(F)})};var AD=(D)=>{if(D instanceof Y2)return AD(D.schema);else if(D instanceof s)return AD(D.innerType());else if(D instanceof W2)return[D.value];else if(D instanceof LD)return D.options;else if(D instanceof H2)return u.objectValues(D.enum);else if(D instanceof q2)return AD(D._def.innerType);else if(D instanceof $2)return[void 0];else if(D instanceof X2)return[null];else if(D instanceof r)return[void 0,...AD(D.unwrap())];else if(D instanceof MD)return[null,...AD(D.unwrap())];else if(D instanceof o2)return AD(D.unwrap());else if(D instanceof G2)return AD(D.unwrap());else if(D instanceof _2)return AD(D._def.innerType);else return[]};class r2 extends w{_parse(D){let{ctx:F}=this._processInputParams(D);if(F.parsedType!==_.object)return G(F,{code:q.invalid_type,expected:_.object,received:F.parsedType}),z;let B=this.discriminator,E=F.data[B],$=this.optionsMap.get(E);if(!$)return G(F,{code:q.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[B]}),z;if(F.common.async)return $._parseAsync({data:F.data,path:F.path,parent:F});else return $._parseSync({data:F.data,path:F.path,parent:F})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(D,F,B){let E=new Map;for(let $ of F){let X=AD($.shape[D]);if(!X.length)throw Error(`A discriminator value for key \`${D}\` could not be extracted from all schema options`);for(let J of X){if(E.has(J))throw Error(`Discriminator property ${String(D)} has duplicate value ${String(J)}`);E.set(J,$)}}return new r2({typeName:j.ZodDiscriminatedUnion,discriminator:D,options:F,optionsMap:E,...N(B)})}}function n0(D,F){let B=ED(D),E=ED(F);if(D===F)return{valid:!0,data:D};else if(B===_.object&&E===_.object){let $=u.objectKeys(F),X=u.objectKeys(D).filter((Q)=>$.indexOf(Q)!==-1),J={...D,...F};for(let Q of X){let Y=n0(D[Q],F[Q]);if(!Y.valid)return{valid:!1};J[Q]=Y.data}return{valid:!0,data:J}}else if(B===_.array&&E===_.array){if(D.length!==F.length)return{valid:!1};let $=[];for(let X=0;X<D.length;X++){let J=D[X],Q=F[X],Y=n0(J,Q);if(!Y.valid)return{valid:!1};$.push(Y.data)}return{valid:!0,data:$}}else if(B===_.date&&E===_.date&&+D===+F)return{valid:!0,data:D};else return{valid:!1}}class Q2 extends w{_parse(D){let{status:F,ctx:B}=this._processInputParams(D),E=($,X)=>{if(i2($)||i2(X))return z;let J=n0($.value,X.value);if(!J.valid)return G(B,{code:q.invalid_intersection_types}),z;if(a2($)||a2(X))F.dirty();return{status:F.value,value:J.data}};if(B.common.async)return Promise.all([this._def.left._parseAsync({data:B.data,path:B.path,parent:B}),this._def.right._parseAsync({data:B.data,path:B.path,parent:B})]).then(([$,X])=>E($,X));else return E(this._def.left._parseSync({data:B.data,path:B.path,parent:B}),this._def.right._parseSync({data:B.data,path:B.path,parent:B}))}}Q2.create=(D,F,B)=>{return new Q2({left:D,right:F,typeName:j.ZodIntersection,...N(B)})};class XD extends w{_parse(D){let{status:F,ctx:B}=this._processInputParams(D);if(B.parsedType!==_.array)return G(B,{code:q.invalid_type,expected:_.array,received:B.parsedType}),z;if(B.data.length<this._def.items.length)return G(B,{code:q.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),z;if(!this._def.rest&&B.data.length>this._def.items.length)G(B,{code:q.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),F.dirty();let $=[...B.data].map((X,J)=>{let Q=this._def.items[J]||this._def.rest;if(!Q)return null;return Q._parse(new o(B,X,B.path,J))}).filter((X)=>!!X);if(B.common.async)return Promise.all($).then((X)=>{return y.mergeArray(F,X)});else return y.mergeArray(F,$)}get items(){return this._def.items}rest(D){return new XD({...this._def,rest:D})}}XD.create=(D,F)=>{if(!Array.isArray(D))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new XD({items:D,typeName:j.ZodTuple,rest:null,...N(F)})};class O2 extends w{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(D){let{status:F,ctx:B}=this._processInputParams(D);if(B.parsedType!==_.object)return G(B,{code:q.invalid_type,expected:_.object,received:B.parsedType}),z;let E=[],$=this._def.keyType,X=this._def.valueType;for(let J in B.data)E.push({key:$._parse(new o(B,J,B.path,J)),value:X._parse(new o(B,B.data[J],B.path,J)),alwaysSet:J in B.data});if(B.common.async)return y.mergeObjectAsync(F,E);else return y.mergeObjectSync(F,E)}get element(){return this._def.valueType}static create(D,F,B){if(F instanceof w)return new O2({keyType:D,valueType:F,typeName:j.ZodRecord,...N(B)});return new O2({keyType:i.create(),valueType:D,typeName:j.ZodRecord,...N(F)})}}class w2 extends w{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(D){let{status:F,ctx:B}=this._processInputParams(D);if(B.parsedType!==_.map)return G(B,{code:q.invalid_type,expected:_.map,received:B.parsedType}),z;let E=this._def.keyType,$=this._def.valueType,X=[...B.data.entries()].map(([J,Q],Y)=>{return{key:E._parse(new o(B,J,B.path,[Y,"key"])),value:$._parse(new o(B,Q,B.path,[Y,"value"]))}});if(B.common.async){let J=new Map;return Promise.resolve().then(async()=>{for(let Q of X){let Y=await Q.key,W=await Q.value;if(Y.status==="aborted"||W.status==="aborted")return z;if(Y.status==="dirty"||W.status==="dirty")F.dirty();J.set(Y.value,W.value)}return{status:F.value,value:J}})}else{let J=new Map;for(let Q of X){let{key:Y,value:W}=Q;if(Y.status==="aborted"||W.status==="aborted")return z;if(Y.status==="dirty"||W.status==="dirty")F.dirty();J.set(Y.value,W.value)}return{status:F.value,value:J}}}}w2.create=(D,F,B)=>{return new w2({valueType:F,keyType:D,typeName:j.ZodMap,...N(B)})};class yD extends w{_parse(D){let{status:F,ctx:B}=this._processInputParams(D);if(B.parsedType!==_.set)return G(B,{code:q.invalid_type,expected:_.set,received:B.parsedType}),z;let E=this._def;if(E.minSize!==null){if(B.data.size<E.minSize.value)G(B,{code:q.too_small,minimum:E.minSize.value,type:"set",inclusive:!0,exact:!1,message:E.minSize.message}),F.dirty()}if(E.maxSize!==null){if(B.data.size>E.maxSize.value)G(B,{code:q.too_big,maximum:E.maxSize.value,type:"set",inclusive:!0,exact:!1,message:E.maxSize.message}),F.dirty()}let $=this._def.valueType;function X(Q){let Y=new Set;for(let W of Q){if(W.status==="aborted")return z;if(W.status==="dirty")F.dirty();Y.add(W.value)}return{status:F.value,value:Y}}let J=[...B.data.values()].map((Q,Y)=>$._parse(new o(B,Q,B.path,Y)));if(B.common.async)return Promise.all(J).then((Q)=>X(Q));else return X(J)}min(D,F){return new yD({...this._def,minSize:{value:D,message:U.toString(F)}})}max(D,F){return new yD({...this._def,maxSize:{value:D,message:U.toString(F)}})}size(D,F){return this.min(D,F).max(D,F)}nonempty(D){return this.min(1,D)}}yD.create=(D,F)=>{return new yD({valueType:D,minSize:null,maxSize:null,typeName:j.ZodSet,...N(F)})};class B2 extends w{constructor(){super(...arguments);this.validate=this.implement}_parse(D){let{ctx:F}=this._processInputParams(D);if(F.parsedType!==_.function)return G(F,{code:q.invalid_type,expected:_.function,received:F.parsedType}),z;function B(J,Q){return K2({data:J,path:F.path,errorMaps:[F.common.contextualErrorMap,F.schemaErrorMap,eD(),GD].filter((Y)=>!!Y),issueData:{code:q.invalid_arguments,argumentsError:Q}})}function E(J,Q){return K2({data:J,path:F.path,errorMaps:[F.common.contextualErrorMap,F.schemaErrorMap,eD(),GD].filter((Y)=>!!Y),issueData:{code:q.invalid_return_type,returnTypeError:Q}})}let $={errorMap:F.common.contextualErrorMap},X=F.data;if(this._def.returns instanceof hD){let J=this;return h(async function(...Q){let Y=new m([]),W=await J._def.args.parseAsync(Q,$).catch((V)=>{throw Y.addIssue(B(Q,V)),Y}),H=await Reflect.apply(X,this,W);return await J._def.returns._def.type.parseAsync(H,$).catch((V)=>{throw Y.addIssue(E(H,V)),Y})})}else{let J=this;return h(function(...Q){let Y=J._def.args.safeParse(Q,$);if(!Y.success)throw new m([B(Q,Y.error)]);let W=Reflect.apply(X,this,Y.data),H=J._def.returns.safeParse(W,$);if(!H.success)throw new m([E(W,H.error)]);return H.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...D){return new B2({...this._def,args:XD.create(D).rest(RD.create())})}returns(D){return new B2({...this._def,returns:D})}implement(D){return this.parse(D)}strictImplement(D){return this.parse(D)}static create(D,F,B){return new B2({args:D?D:XD.create([]).rest(RD.create()),returns:F||RD.create(),typeName:j.ZodFunction,...N(B)})}}class Y2 extends w{get schema(){return this._def.getter()}_parse(D){let{ctx:F}=this._processInputParams(D);return this._def.getter()._parse({data:F.data,path:F.path,parent:F})}}Y2.create=(D,F)=>{return new Y2({getter:D,typeName:j.ZodLazy,...N(F)})};class W2 extends w{_parse(D){if(D.data!==this._def.value){let F=this._getOrReturnCtx(D);return G(F,{received:F.data,code:q.invalid_literal,expected:this._def.value}),z}return{status:"valid",value:D.data}}get value(){return this._def.value}}W2.create=(D,F)=>{return new W2({value:D,typeName:j.ZodLiteral,...N(F)})};function Z8(D,F){return new LD({values:D,typeName:j.ZodEnum,...N(F)})}class LD extends w{_parse(D){if(typeof D.data!=="string"){let F=this._getOrReturnCtx(D),B=this._def.values;return G(F,{expected:u.joinValues(B),received:F.parsedType,code:q.invalid_type}),z}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(D.data)){let F=this._getOrReturnCtx(D),B=this._def.values;return G(F,{received:F.data,code:q.invalid_enum_value,options:B}),z}return h(D.data)}get options(){return this._def.values}get enum(){let D={};for(let F of this._def.values)D[F]=F;return D}get Values(){let D={};for(let F of this._def.values)D[F]=F;return D}get Enum(){let D={};for(let F of this._def.values)D[F]=F;return D}extract(D,F=this._def){return LD.create(D,{...this._def,...F})}exclude(D,F=this._def){return LD.create(this.options.filter((B)=>!D.includes(B)),{...this._def,...F})}}LD.create=Z8;class H2 extends w{_parse(D){let F=u.getValidEnumValues(this._def.values),B=this._getOrReturnCtx(D);if(B.parsedType!==_.string&&B.parsedType!==_.number){let E=u.objectValues(F);return G(B,{expected:u.joinValues(E),received:B.parsedType,code:q.invalid_type}),z}if(!this._cache)this._cache=new Set(u.getValidEnumValues(this._def.values));if(!this._cache.has(D.data)){let E=u.objectValues(F);return G(B,{received:B.data,code:q.invalid_enum_value,options:E}),z}return h(D.data)}get enum(){return this._def.values}}H2.create=(D,F)=>{return new H2({values:D,typeName:j.ZodNativeEnum,...N(F)})};class hD extends w{unwrap(){return this._def.type}_parse(D){let{ctx:F}=this._processInputParams(D);if(F.parsedType!==_.promise&&F.common.async===!1)return G(F,{code:q.invalid_type,expected:_.promise,received:F.parsedType}),z;let B=F.parsedType===_.promise?F.data:Promise.resolve(F.data);return h(B.then((E)=>{return this._def.type.parseAsync(E,{path:F.path,errorMap:F.common.contextualErrorMap})}))}}hD.create=(D,F)=>{return new hD({type:D,typeName:j.ZodPromise,...N(F)})};class s extends w{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===j.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(D){let{status:F,ctx:B}=this._processInputParams(D),E=this._def.effect||null,$={addIssue:(X)=>{if(G(B,X),X.fatal)F.abort();else F.dirty()},get path(){return B.path}};if($.addIssue=$.addIssue.bind($),E.type==="preprocess"){let X=E.transform(B.data,$);if(B.common.async)return Promise.resolve(X).then(async(J)=>{if(F.value==="aborted")return z;let Q=await this._def.schema._parseAsync({data:J,path:B.path,parent:B});if(Q.status==="aborted")return z;if(Q.status==="dirty")return ZD(Q.value);if(F.value==="dirty")return ZD(Q.value);return Q});else{if(F.value==="aborted")return z;let J=this._def.schema._parseSync({data:X,path:B.path,parent:B});if(J.status==="aborted")return z;if(J.status==="dirty")return ZD(J.value);if(F.value==="dirty")return ZD(J.value);return J}}if(E.type==="refinement"){let X=(J)=>{let Q=E.refinement(J,$);if(B.common.async)return Promise.resolve(Q);if(Q instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return J};if(B.common.async===!1){let J=this._def.schema._parseSync({data:B.data,path:B.path,parent:B});if(J.status==="aborted")return z;if(J.status==="dirty")F.dirty();return X(J.value),{status:F.value,value:J.value}}else return this._def.schema._parseAsync({data:B.data,path:B.path,parent:B}).then((J)=>{if(J.status==="aborted")return z;if(J.status==="dirty")F.dirty();return X(J.value).then(()=>{return{status:F.value,value:J.value}})})}if(E.type==="transform")if(B.common.async===!1){let X=this._def.schema._parseSync({data:B.data,path:B.path,parent:B});if(!CD(X))return z;let J=E.transform(X.value,$);if(J instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:F.value,value:J}}else return this._def.schema._parseAsync({data:B.data,path:B.path,parent:B}).then((X)=>{if(!CD(X))return z;return Promise.resolve(E.transform(X.value,$)).then((J)=>({status:F.value,value:J}))});u.assertNever(E)}}s.create=(D,F,B)=>{return new s({schema:D,typeName:j.ZodEffects,effect:F,...N(B)})};s.createWithPreprocess=(D,F,B)=>{return new s({schema:F,effect:{type:"preprocess",transform:D},typeName:j.ZodEffects,...N(B)})};class r extends w{_parse(D){if(this._getType(D)===_.undefined)return h(void 0);return this._def.innerType._parse(D)}unwrap(){return this._def.innerType}}r.create=(D,F)=>{return new r({innerType:D,typeName:j.ZodOptional,...N(F)})};class MD extends w{_parse(D){if(this._getType(D)===_.null)return h(null);return this._def.innerType._parse(D)}unwrap(){return this._def.innerType}}MD.create=(D,F)=>{return new MD({innerType:D,typeName:j.ZodNullable,...N(F)})};class q2 extends w{_parse(D){let{ctx:F}=this._processInputParams(D),B=F.data;if(F.parsedType===_.undefined)B=this._def.defaultValue();return this._def.innerType._parse({data:B,path:F.path,parent:F})}removeDefault(){return this._def.innerType}}q2.create=(D,F)=>{return new q2({innerType:D,typeName:j.ZodDefault,defaultValue:typeof F.default==="function"?F.default:()=>F.default,...N(F)})};class _2 extends w{_parse(D){let{ctx:F}=this._processInputParams(D),B={...F,common:{...F.common,issues:[]}},E=this._def.innerType._parse({data:B.data,path:B.path,parent:{...B}});if(D2(E))return E.then(($)=>{return{status:"valid",value:$.status==="valid"?$.value:this._def.catchValue({get error(){return new m(B.common.issues)},input:B.data})}});else return{status:"valid",value:E.status==="valid"?E.value:this._def.catchValue({get error(){return new m(B.common.issues)},input:B.data})}}removeCatch(){return this._def.innerType}}_2.create=(D,F)=>{return new _2({innerType:D,typeName:j.ZodCatch,catchValue:typeof F.catch==="function"?F.catch:()=>F.catch,...N(F)})};class u2 extends w{_parse(D){if(this._getType(D)!==_.nan){let B=this._getOrReturnCtx(D);return G(B,{code:q.invalid_type,expected:_.nan,received:B.parsedType}),z}return{status:"valid",value:D.data}}}u2.create=(D)=>{return new u2({typeName:j.ZodNaN,...N(D)})};var E5=Symbol("zod_brand");class o2 extends w{_parse(D){let{ctx:F}=this._processInputParams(D),B=F.data;return this._def.type._parse({data:B,path:F.path,parent:F})}unwrap(){return this._def.type}}class S2 extends w{_parse(D){let{status:F,ctx:B}=this._processInputParams(D);if(B.common.async)return(async()=>{let $=await this._def.in._parseAsync({data:B.data,path:B.path,parent:B});if($.status==="aborted")return z;if($.status==="dirty")return F.dirty(),ZD($.value);else return this._def.out._parseAsync({data:$.value,path:B.path,parent:B})})();else{let E=this._def.in._parseSync({data:B.data,path:B.path,parent:B});if(E.status==="aborted")return z;if(E.status==="dirty")return F.dirty(),{status:"dirty",value:E.value};else return this._def.out._parseSync({data:E.value,path:B.path,parent:B})}}static create(D,F){return new S2({in:D,out:F,typeName:j.ZodPipeline})}}class G2 extends w{_parse(D){let F=this._def.innerType._parse(D),B=(E)=>{if(CD(E))E.value=Object.freeze(E.value);return E};return D2(F)?F.then((E)=>B(E)):B(F)}unwrap(){return this._def.innerType}}G2.create=(D,F)=>{return new G2({innerType:D,typeName:j.ZodReadonly,...N(F)})};function T8(D,F){let B=typeof D==="function"?D(F):typeof D==="string"?{message:D}:D;return typeof B==="string"?{message:B}:B}function f8(D,F={},B){if(D)return xD.create().superRefine((E,$)=>{let X=D(E);if(X instanceof Promise)return X.then((J)=>{if(!J){let Q=T8(F,E),Y=Q.fatal??B??!0;$.addIssue({code:"custom",...Q,fatal:Y})}});if(!X){let J=T8(F,E),Q=J.fatal??B??!0;$.addIssue({code:"custom",...J,fatal:Q})}return});return xD.create()}var $5={object:Z.lazycreate},j;(function(D){D.ZodString="ZodString",D.ZodNumber="ZodNumber",D.ZodNaN="ZodNaN",D.ZodBigInt="ZodBigInt",D.ZodBoolean="ZodBoolean",D.ZodDate="ZodDate",D.ZodSymbol="ZodSymbol",D.ZodUndefined="ZodUndefined",D.ZodNull="ZodNull",D.ZodAny="ZodAny",D.ZodUnknown="ZodUnknown",D.ZodNever="ZodNever",D.ZodVoid="ZodVoid",D.ZodArray="ZodArray",D.ZodObject="ZodObject",D.ZodUnion="ZodUnion",D.ZodDiscriminatedUnion="ZodDiscriminatedUnion",D.ZodIntersection="ZodIntersection",D.ZodTuple="ZodTuple",D.ZodRecord="ZodRecord",D.ZodMap="ZodMap",D.ZodSet="ZodSet",D.ZodFunction="ZodFunction",D.ZodLazy="ZodLazy",D.ZodLiteral="ZodLiteral",D.ZodEnum="ZodEnum",D.ZodEffects="ZodEffects",D.ZodNativeEnum="ZodNativeEnum",D.ZodOptional="ZodOptional",D.ZodNullable="ZodNullable",D.ZodDefault="ZodDefault",D.ZodCatch="ZodCatch",D.ZodPromise="ZodPromise",D.ZodBranded="ZodBranded",D.ZodPipeline="ZodPipeline",D.ZodReadonly="ZodReadonly"})(j||(j={}));var X5=(D,F={message:`Input not instance of ${D.name}`})=>f8((B)=>B instanceof D,F),x8=i.create,y8=VD.create,J5=u2.create,Q5=KD.create,h8=E2.create,Y5=fD.create,W5=L2.create,H5=$2.create,q5=X2.create,_5=xD.create,G5=RD.create,A5=$D.create,M5=N2.create,U5=a.create,z5=Z.create,j5=Z.strictCreate,C5=J2.create,R5=r2.create,V5=Q2.create,K5=XD.create,L5=O2.create,N5=w2.create,O5=yD.create,w5=B2.create,u5=Y2.create,S5=W2.create,I5=LD.create,b5=H2.create,T5=hD.create,P5=s.create,k5=r.create,v5=MD.create,Z5=s.createWithPreprocess,f5=S2.create,x5=()=>x8().optional(),y5=()=>y8().optional(),h5=()=>h8().optional(),g5={string:(D)=>i.create({...D,coerce:!0}),number:(D)=>VD.create({...D,coerce:!0}),boolean:(D)=>E2.create({...D,coerce:!0}),bigint:(D)=>KD.create({...D,coerce:!0}),date:(D)=>fD.create({...D,coerce:!0})};var m5=z;var l5=C.object({name:C.string().default("genie"),defaultWindow:C.string().default("shell"),autoCreate:C.boolean().default(!0)}),p5=C.object({execTimeout:C.number().default(120000),readLines:C.number().default(100),worktreeBase:C.string().default(".worktrees")}),d5=C.object({tmuxDebug:C.boolean().default(!1),verbose:C.boolean().default(!1)}),c5=C.object({preference:C.enum(["auto","zsh","bash","fish"]).default("auto")}),n5=C.object({tmuxInstalled:C.boolean().default(!1),shellInstalled:C.boolean().default(!1)}),i5=C.object({enabled:C.boolean().default(!1)}),t=C.object({version:C.number().default(2),session:l5.default({}),terminal:p5.default({}),logging:d5.default({}),shell:c5.default({}),shortcuts:n5.default({}),claudio:i5.optional(),installMethod:C.enum(["source","npm","bun"]).optional(),setupComplete:C.boolean().default(!1),lastSetupAt:C.string().optional()}),g8=C.object({session:C.object({name:C.string().default("genie"),defaultWindow:C.string().default("shell")}).default({}),logging:C.object({tmuxDebug:C.boolean().default(!1)}).default({}),installMethod:C.enum(["source","npm","bun"]).optional()});var s2=p8(l8(),".genie"),gD=p8(s2,"config.json"),i0=2;function d8(){return s2}function I2(){return gD}function mD(){return t2(gD)}function o5(){if(!t2(s2))a5(s2,{recursive:!0})}function c8(D){let F=g8.safeParse(D);if(F.success){let B=F.data;return t.parse({version:i0,session:{name:B.session.name,defaultWindow:B.session.defaultWindow,autoCreate:!0},terminal:{execTimeout:120000,readLines:100,worktreeBase:".worktrees"},logging:{tmuxDebug:B.logging.tmuxDebug,verbose:!1},shell:{preference:"auto"},shortcuts:{tmuxInstalled:!1,shellInstalled:!1},installMethod:B.installMethod,setupComplete:!1})}return t.parse({})}async function UD(){if(!t2(gD))return t.parse({});try{let D=m8(gD,"utf-8"),F=JSON.parse(D);if(!F.version||F.version<i0){let B=c8(F);return await ND(B),B}return t.parse(F)}catch(D){return console.warn(`Warning: Invalid genie config, using defaults: ${D.message}`),t.parse({})}}async function ND(D){o5();try{let F=t.parse(D),B=JSON.stringify(F,null,2);r5(gD,B,"utf-8")}catch(F){throw Error(`Failed to save genie config: ${F.message}`)}}function s5(){return t.parse({})}function n8(){if(!t2(gD))return t.parse({});try{let D=m8(gD,"utf-8"),F=JSON.parse(D);if(!F.version||F.version<i0)return c8(F);return t.parse(F)}catch{return t.parse({})}}function b2(D){let F=l8();if(D.startsWith(F+"/"))return"~"+D.slice(F.length);if(D===F)return"~";return D}function yB(){return n8().terminal}function i8(){if(!mD())return!1;return n8().setupComplete??!1}async function a0(){let D=await UD();D.setupComplete=!0,D.lastSetupAt=new Date().toISOString(),await ND(D)}async function a8(){let D=s5();await ND(D)}async function r8(D){let F=await UD();F.shortcuts={...F.shortcuts,...D},await ND(F)}import{homedir as o8}from"os";import{join as e}from"path";import{existsSync as lD,readFileSync as s8,writeFileSync as t5,mkdirSync as e5,appendFileSync as r0}from"fs";import*as t8 from"readline";function e8(){return`# Warp-like keyboard shortcuts (generated by genie-cli)
|
|
39
|
+
`+F:""),Y=Math.floor(E.length/X)-this.cursorPos.rows+(F?I8(F):0);if(Y>0)J+=n0(Y);J+=a0(this.cursorPos.cols),this.write(i0(this.extraLinesUnderPrompt)+r0(this.height)+J),this.extraLinesUnderPrompt=Y,this.height=I8(J)}checkCursorPos(){let D=this.rl.getCursorPos();if(D.cols!==this.cursorPos.cols)this.write(a0(D.cols)),this.cursorPos=D}done({clearContent:D}){this.rl.setPrompt("");let F=i0(this.extraLinesUnderPrompt);F+=D?r0(this.height):`
|
|
40
|
+
`,F+=P8,this.write(F),this.rl.close()}}class o0 extends Promise{static withResolver(){let D,F;return{promise:new Promise((E,$)=>{D=E,F=$}),resolve:D,reject:F}}}function xF(){let D=Error.prepareStackTrace,F=[];try{Error.prepareStackTrace=(B,E)=>{let $=E.slice(1);return F=$,$},Error().stack}catch{return F}return Error.prepareStackTrace=D,F}function UD(D){let F=xF();return(E,$={})=>{let{input:X=process.stdin,signal:J}=$,Q=new Set,Y=new v8.default;Y.pipe($.output??process.stdout);let W=k8.createInterface({terminal:!0,input:X,output:Y}),H=new a2(W),{promise:_,resolve:j,reject:R}=o0.withResolver(),u=()=>R(new S0);if(J){let C=()=>R(new w0({cause:J.reason}));if(J.aborted)return C(),Object.assign(_,{cancel:u});J.addEventListener("abort",C),Q.add(()=>J.removeEventListener("abort",C))}Q.add(b8((C,b)=>{R(new m2(`User force closed the prompt with ${C} ${b}`))}));let T=()=>R(new m2("User force closed the prompt with SIGINT"));W.on("SIGINT",T),Q.add(()=>W.removeListener("SIGINT",T));let P=()=>H.checkCursorPos();return W.input.on("keypress",P),Q.add(()=>W.input.removeListener("keypress",P)),y3(W,(C)=>{let b=fF.bind(()=>vD.clearAll());return W.on("close",b),Q.add(()=>W.removeListener("close",b)),C(()=>{try{let v=D(E,(aD)=>{setImmediate(()=>j(aD))});if(v===void 0){let aD=F[1]?.getFileName();throw Error(`Prompt functions must return a string.
|
|
41
|
+
at ${aD}`)}let[ED,$D]=typeof v==="string"?[v]:v;H.render(ED,$D),vD.run()}catch(v){R(v)}}),Object.assign(_.then((v)=>{return vD.clearAll(),v},(v)=>{throw vD.clearAll(),v}).finally(()=>{Q.forEach((v)=>v()),H.done({clearContent:Boolean($.clearPromptOnDone)}),Y.end()}).then(()=>_),{cancel:u})})}}var Z8=PD(l2(),1);class F2{separator=Z8.default.dim(Array.from({length:15}).join(sD.line));type="separator";constructor(D){if(D)this.separator=D}static isSeparator(D){return Boolean(D&&typeof D==="object"&&"type"in D&&D.type==="separator")}}function f8(D,F){let B=F!==!1;if(/^(y|yes)/i.test(D))B=!0;else if(/^(n|no)/i.test(D))B=!1;return B}function x8(D){return D?"Yes":"No"}var c=UD((D,F)=>{let{transformer:B=x8}=D,[E,$]=k("idle"),[X,J]=k(""),Q=a(D.theme),Y=GD({status:E,theme:Q});AD((j,R)=>{if(E!=="idle")return;if(qD(j)){let u=f8(X,D.default);J(B(u)),$("done"),F(u)}else if(ID(j)){let u=x8(!f8(X,D.default));R.clearLine(0),R.write(u),J(u)}else J(R.line)});let W=X,H="";if(E==="done")W=Q.style.answer(X);else H=` ${Q.style.defaultAnswer(D.default===!1?"y/N":"Y/n")}`;let _=Q.style.message(D.message,E);return`${Y} ${_}${H} ${W}`});var yF={validationFailureMode:"keep"},fD=UD((D,F)=>{let{prefill:B="tab"}=D,E=a(yF,D.theme),[$,X]=k("idle"),[J="",Q]=k(D.default),[Y,W]=k(),[H,_]=k(""),j=GD({status:$,theme:E});async function R(b){let{required:v,pattern:ED,patternError:$D="Invalid input"}=D;if(v&&!b)return"You must provide a value";if(ED&&!ED.test(b))return $D;if(typeof D.validate==="function")return await D.validate(b)||"You must provide a valid value";return!0}AD(async(b,v)=>{if($!=="idle")return;if(qD(b)){let ED=H||J;X("loading");let $D=await R(ED);if($D===!0)_(ED),X("done"),F(ED);else{if(E.validationFailureMode==="clear")_("");else v.write(H);W($D),X("idle")}}else if(O0(b)&&!H)Q(void 0);else if(ID(b)&&!H)Q(void 0),v.clearLine(0),v.write(J),_(J);else _(v.line),W(void 0)}),_D((b)=>{if(B==="editable"&&J)b.write(J),_(J)},[]);let u=E.style.message(D.message,$),T=H;if(typeof D.transformer==="function")T=D.transformer(H,{isFinal:$==="done"});else if($==="done")T=E.style.answer(H);let P;if(J&&$!=="done"&&!H)P=E.style.defaultAnswer(J);let C="";if(Y)C=E.style.error(Y);return[[j,u,P,T].filter((b)=>b!==void 0).join(" "),C]});var hF=UD((D,F)=>{let{validate:B=()=>!0}=D,E=a(D.theme),[$,X]=k("idle"),[J,Q]=k(),[Y,W]=k(""),H=GD({status:$,theme:E});AD(async(T,P)=>{if($!=="idle")return;if(qD(T)){let C=Y;X("loading");let b=await B(C);if(b===!0)W(C),X("done"),F(C);else P.write(Y),Q(b||"You must provide a valid value"),X("idle")}else W(P.line),Q(void 0)});let _=E.style.message(D.message,$),j="",R;if(D.mask)j=(typeof D.mask==="string"?D.mask:"*").repeat(Y.length);else if($!=="done")R=`${E.style.help("[input is masked]")}${T8}`;if($==="done")j=E.style.answer(j);let u="";if(J)u=E.style.error(J);return[[H,_,D.mask?j:R].join(" "),u]});var xD=PD(l2(),1);var gF={icon:{cursor:sD.pointer},style:{disabled:(D)=>xD.default.dim(`- ${D}`),searchTerm:(D)=>xD.default.cyan(D),description:(D)=>xD.default.cyan(D),keysHelpTip:(D)=>D.map(([F,B])=>`${xD.default.bold(F)} ${xD.default.dim(B)}`).join(xD.default.dim(" \u2022 "))},helpMode:"always"};function s0(D){return!F2.isSeparator(D)&&!D.disabled}function mF(D){return D.map((F)=>{if(F2.isSeparator(F))return F;if(typeof F==="string")return{value:F,name:F,short:F,disabled:!1};let B=F.name??String(F.value),E={value:F.value,name:B,short:F.short??B,disabled:F.disabled??!1};if(F.description)E.description=F.description;return E})}var lF=UD((D,F)=>{let{pageSize:B=7,validate:E=()=>!0}=D,$=a(gF,D.theme),[X,J]=k("loading"),[Q,Y]=k(""),[W,H]=k([]),[_,j]=k(),R=GD({status:X,theme:$}),u=I0(()=>{let I=W.findIndex(s0),l=W.findLastIndex(s0);return{first:I,last:l}},[W]),[T=u.first,P]=k();_D(()=>{let I=new AbortController;return J("loading"),j(void 0),(async()=>{try{let i=await D.source(Q||void 0,{signal:I.signal});if(!I.signal.aborted)P(void 0),j(void 0),H(mF(i)),J("idle")}catch(i){if(!I.signal.aborted&&i instanceof Error)j(i.message)}})(),()=>{I.abort()}},[Q]);let C=W[T];AD(async(I,l)=>{if(qD(I))if(C){J("loading");let i=await E(C.value);if(J("idle"),i===!0)J("done"),F(C.value);else if(C.name===Q)j(i||"You must provide a valid value");else l.write(C.name),Y(C.name)}else l.write(Q);else if(ID(I)&&C)l.clearLine(0),l.write(C.name),Y(C.name);else if(X!=="loading"&&(R2(I)||g2(I))){if(l.clearLine(0),R2(I)&&T!==u.first||g2(I)&&T!==u.last){let i=R2(I)?-1:1,rD=T;do rD=(rD+i+W.length)%W.length;while(!s0(W[rD]));P(rD)}}else Y(l.line)});let b=$.style.message(D.message,X),v;if($.helpMode!=="never")if(D.instructions){let{pager:I,navigation:l}=D.instructions;v=$.style.help(W.length>B?I:l)}else v=$.style.keysHelpTip([["\u2191\u2193","navigate"],["\u23CE","select"]]);let ED=m0({items:W,active:T,renderItem({item:I,isActive:l}){if(F2.isSeparator(I))return` ${I.separator}`;if(I.disabled){let U0=typeof I.disabled==="string"?I.disabled:"(disabled)";return $.style.disabled(`${I.name} ${U0}`)}let i=l?$.style.highlight:(U0)=>U0,rD=l?$.icon.cursor:" ";return i(`${rD} ${I.name}`)},pageSize:B,loop:!1}),$D;if(_)$D=$.style.error(_);else if(W.length===0&&Q!==""&&X==="idle")$D=$.style.error("No results found");let aD;if(X==="done"&&C)return[R,b,$.style.answer(C.short)].filter(Boolean).join(" ").trimEnd();else aD=$.style.searchTerm(Q);let V3=C?.description,F1=[R,b,aD].filter(Boolean).join(" ").trimEnd(),B1=[$D??ED," ",V3?$.style.description(V3):"",v].filter(Boolean).join(`
|
|
42
|
+
`).trimEnd();return[F1,B1]});import{spawn as w7}from"child_process";import{platform as pF,arch as dF}from"os";import{readFile as cF}from"fs/promises";var{$:r2}=globalThis.Bun;function nF(){let D=pF();if(D==="darwin")return"macos";if(D==="linux")return"linux";return"unknown"}async function iF(){try{let F=(await cF("/etc/os-release","utf-8")).split(`
|
|
43
|
+
`),B={};for(let X of F){let[J,...Q]=X.split("=");if(J&&Q.length>0)B[J]=Q.join("=").replace(/^"|"$/g,"")}let E=(B.ID||"").toLowerCase(),$=(B.ID_LIKE||"").toLowerCase();if(E==="ubuntu"||$.includes("ubuntu"))return"ubuntu";if(E==="debian"||$.includes("debian"))return"debian";if(E==="fedora"||$.includes("fedora"))return"fedora";if(E==="rhel"||E==="centos"||E==="rocky"||E==="almalinux"||$.includes("rhel"))return"rhel";if(E==="arch"||$.includes("arch"))return"arch";return"unknown"}catch{return"unknown"}}async function N2(D){try{return(await r2`which ${D}`.quiet()).exitCode===0}catch{return!1}}async function aF(){if(await N2("brew"))return"brew";if(await N2("apt"))return"apt";if(await N2("dnf"))return"dnf";if(await N2("yum"))return"yum";if(await N2("pacman"))return"pacman";return"none"}async function y8(){let D=nF(),F=dF(),B={os:D,arch:F,preferredPM:await aF()};if(D==="linux")B.linuxDistro=await iF();return B}async function n(D){try{let B=(await r2`which ${D}`.quiet().text()).trim();if(!B)return{exists:!1};let E;try{let X=(await r2`${D} --version`.quiet().text()).split(`
|
|
44
|
+
`)[0].trim(),J=X.match(/(\d+\.[\d.]+[a-z0-9-]*)/i);E=J?J[1]:X.slice(0,50)}catch{try{let X=(await r2`${D} -v`.quiet().text()).split(`
|
|
45
|
+
`)[0].trim(),J=X.match(/(\d+\.[\d.]+[a-z0-9-]*)/i);E=J?J[1]:X.slice(0,50)}catch{}}return{exists:!0,version:E,path:B}}catch{return{exists:!1}}}var rF=[{name:"tmux",required:!0,description:"Terminal multiplexer for shared sessions"},{name:"bun",required:!0,description:"Fast JavaScript runtime and package manager"},{name:"claude",required:!1,description:"Claude Code CLI (optional, recommended)"}];async function h8(){let D=[];for(let F of rF){let B=await n(F.name);D.push({name:F.name,installed:B.exists,version:B.version,path:B.path,required:F.required,description:F.description})}return D}function g8(D){return{ubuntu:"Ubuntu",debian:"Debian",fedora:"Fedora",rhel:"RHEL/CentOS",arch:"Arch Linux",unknown:"Linux"}[D]||"Linux"}import{existsSync as F0,mkdirSync as _7,readFileSync as e8,writeFileSync as G7}from"fs";import{homedir as D6}from"os";import{join as F6}from"path";var K={};Q1(K,{void:()=>k5,util:()=>S,unknown:()=>P5,union:()=>x5,undefined:()=>b5,tuple:()=>g5,transformer:()=>o5,symbol:()=>S5,string:()=>r8,strictObject:()=>f5,setErrorMap:()=>tF,set:()=>p5,record:()=>m5,quotelessJson:()=>oF,promise:()=>r5,preprocess:()=>e5,pipeline:()=>D7,ostring:()=>F7,optional:()=>s5,onumber:()=>B7,oboolean:()=>E7,objectUtil:()=>t0,object:()=>Z5,number:()=>o8,nullable:()=>t5,null:()=>u5,never:()=>I5,nativeEnum:()=>a5,nan:()=>N5,map:()=>l5,makeIssue:()=>O2,literal:()=>n5,lazy:()=>c5,late:()=>C5,isValid:()=>LD,isDirty:()=>s2,isAsync:()=>E2,isAborted:()=>o2,intersection:()=>h5,instanceof:()=>L5,getParsedType:()=>QD,getErrorMap:()=>B2,function:()=>d5,enum:()=>i5,effect:()=>o5,discriminatedUnion:()=>y5,defaultErrorMap:()=>MD,datetimeRegex:()=>n8,date:()=>w5,custom:()=>a8,coerce:()=>$7,boolean:()=>s8,bigint:()=>O5,array:()=>v5,any:()=>T5,addIssueToContext:()=>A,ZodVoid:()=>S2,ZodUnknown:()=>ND,ZodUnion:()=>W2,ZodUndefined:()=>Q2,ZodType:()=>w,ZodTuple:()=>WD,ZodTransformer:()=>e,ZodSymbol:()=>w2,ZodString:()=>r,ZodSet:()=>mD,ZodSchema:()=>w,ZodRecord:()=>b2,ZodReadonly:()=>M2,ZodPromise:()=>lD,ZodPipeline:()=>P2,ZodParsedType:()=>G,ZodOptional:()=>s,ZodObject:()=>Z,ZodNumber:()=>OD,ZodNullable:()=>jD,ZodNull:()=>Y2,ZodNever:()=>YD,ZodNativeEnum:()=>G2,ZodNaN:()=>T2,ZodMap:()=>u2,ZodLiteral:()=>_2,ZodLazy:()=>q2,ZodIssueCode:()=>q,ZodIntersection:()=>H2,ZodFunction:()=>X2,ZodFirstPartyTypeKind:()=>V,ZodError:()=>p,ZodEnum:()=>SD,ZodEffects:()=>e,ZodDiscriminatedUnion:()=>t2,ZodDefault:()=>A2,ZodDate:()=>hD,ZodCatch:()=>U2,ZodBranded:()=>e2,ZodBoolean:()=>J2,ZodBigInt:()=>wD,ZodArray:()=>o,ZodAny:()=>gD,Schema:()=>w,ParseStatus:()=>h,OK:()=>m,NEVER:()=>X7,INVALID:()=>z,EMPTY_PATH:()=>eF,DIRTY:()=>yD,BRAND:()=>K5});var S;(function(D){D.assertEqual=($)=>{};function F($){}D.assertIs=F;function B($){throw Error()}D.assertNever=B,D.arrayToEnum=($)=>{let X={};for(let J of $)X[J]=J;return X},D.getValidEnumValues=($)=>{let X=D.objectKeys($).filter((Q)=>typeof $[$[Q]]!=="number"),J={};for(let Q of X)J[Q]=$[Q];return D.objectValues(J)},D.objectValues=($)=>{return D.objectKeys($).map(function(X){return $[X]})},D.objectKeys=typeof Object.keys==="function"?($)=>Object.keys($):($)=>{let X=[];for(let J in $)if(Object.prototype.hasOwnProperty.call($,J))X.push(J);return X},D.find=($,X)=>{for(let J of $)if(X(J))return J;return},D.isInteger=typeof Number.isInteger==="function"?($)=>Number.isInteger($):($)=>typeof $==="number"&&Number.isFinite($)&&Math.floor($)===$;function E($,X=" | "){return $.map((J)=>typeof J==="string"?`'${J}'`:J).join(X)}D.joinValues=E,D.jsonStringifyReplacer=($,X)=>{if(typeof X==="bigint")return X.toString();return X}})(S||(S={}));var t0;(function(D){D.mergeShapes=(F,B)=>{return{...F,...B}}})(t0||(t0={}));var G=S.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),QD=(D)=>{switch(typeof D){case"undefined":return G.undefined;case"string":return G.string;case"number":return Number.isNaN(D)?G.nan:G.number;case"boolean":return G.boolean;case"function":return G.function;case"bigint":return G.bigint;case"symbol":return G.symbol;case"object":if(Array.isArray(D))return G.array;if(D===null)return G.null;if(D.then&&typeof D.then==="function"&&D.catch&&typeof D.catch==="function")return G.promise;if(typeof Map<"u"&&D instanceof Map)return G.map;if(typeof Set<"u"&&D instanceof Set)return G.set;if(typeof Date<"u"&&D instanceof Date)return G.date;return G.object;default:return G.unknown}};var q=S.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),oF=(D)=>{return JSON.stringify(D,null,2).replace(/"([^"]+)":/g,"$1:")};class p extends Error{get errors(){return this.issues}constructor(D){super();this.issues=[],this.addIssue=(B)=>{this.issues=[...this.issues,B]},this.addIssues=(B=[])=>{this.issues=[...this.issues,...B]};let F=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,F);else this.__proto__=F;this.name="ZodError",this.issues=D}format(D){let F=D||function($){return $.message},B={_errors:[]},E=($)=>{for(let X of $.issues)if(X.code==="invalid_union")X.unionErrors.map(E);else if(X.code==="invalid_return_type")E(X.returnTypeError);else if(X.code==="invalid_arguments")E(X.argumentsError);else if(X.path.length===0)B._errors.push(F(X));else{let J=B,Q=0;while(Q<X.path.length){let Y=X.path[Q];if(Q!==X.path.length-1)J[Y]=J[Y]||{_errors:[]};else J[Y]=J[Y]||{_errors:[]},J[Y]._errors.push(F(X));J=J[Y],Q++}}};return E(this),B}static assert(D){if(!(D instanceof p))throw Error(`Not a ZodError: ${D}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,S.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(D=(F)=>F.message){let F={},B=[];for(let E of this.issues)if(E.path.length>0){let $=E.path[0];F[$]=F[$]||[],F[$].push(D(E))}else B.push(D(E));return{formErrors:B,fieldErrors:F}}get formErrors(){return this.flatten()}}p.create=(D)=>{return new p(D)};var sF=(D,F)=>{let B;switch(D.code){case q.invalid_type:if(D.received===G.undefined)B="Required";else B=`Expected ${D.expected}, received ${D.received}`;break;case q.invalid_literal:B=`Invalid literal value, expected ${JSON.stringify(D.expected,S.jsonStringifyReplacer)}`;break;case q.unrecognized_keys:B=`Unrecognized key(s) in object: ${S.joinValues(D.keys,", ")}`;break;case q.invalid_union:B="Invalid input";break;case q.invalid_union_discriminator:B=`Invalid discriminator value. Expected ${S.joinValues(D.options)}`;break;case q.invalid_enum_value:B=`Invalid enum value. Expected ${S.joinValues(D.options)}, received '${D.received}'`;break;case q.invalid_arguments:B="Invalid function arguments";break;case q.invalid_return_type:B="Invalid function return type";break;case q.invalid_date:B="Invalid date";break;case q.invalid_string:if(typeof D.validation==="object")if("includes"in D.validation){if(B=`Invalid input: must include "${D.validation.includes}"`,typeof D.validation.position==="number")B=`${B} at one or more positions greater than or equal to ${D.validation.position}`}else if("startsWith"in D.validation)B=`Invalid input: must start with "${D.validation.startsWith}"`;else if("endsWith"in D.validation)B=`Invalid input: must end with "${D.validation.endsWith}"`;else S.assertNever(D.validation);else if(D.validation!=="regex")B=`Invalid ${D.validation}`;else B="Invalid";break;case q.too_small:if(D.type==="array")B=`Array must contain ${D.exact?"exactly":D.inclusive?"at least":"more than"} ${D.minimum} element(s)`;else if(D.type==="string")B=`String must contain ${D.exact?"exactly":D.inclusive?"at least":"over"} ${D.minimum} character(s)`;else if(D.type==="number")B=`Number must be ${D.exact?"exactly equal to ":D.inclusive?"greater than or equal to ":"greater than "}${D.minimum}`;else if(D.type==="bigint")B=`Number must be ${D.exact?"exactly equal to ":D.inclusive?"greater than or equal to ":"greater than "}${D.minimum}`;else if(D.type==="date")B=`Date must be ${D.exact?"exactly equal to ":D.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(D.minimum))}`;else B="Invalid input";break;case q.too_big:if(D.type==="array")B=`Array must contain ${D.exact?"exactly":D.inclusive?"at most":"less than"} ${D.maximum} element(s)`;else if(D.type==="string")B=`String must contain ${D.exact?"exactly":D.inclusive?"at most":"under"} ${D.maximum} character(s)`;else if(D.type==="number")B=`Number must be ${D.exact?"exactly":D.inclusive?"less than or equal to":"less than"} ${D.maximum}`;else if(D.type==="bigint")B=`BigInt must be ${D.exact?"exactly":D.inclusive?"less than or equal to":"less than"} ${D.maximum}`;else if(D.type==="date")B=`Date must be ${D.exact?"exactly":D.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(D.maximum))}`;else B="Invalid input";break;case q.custom:B="Invalid input";break;case q.invalid_intersection_types:B="Intersection results could not be merged";break;case q.not_multiple_of:B=`Number must be a multiple of ${D.multipleOf}`;break;case q.not_finite:B="Number must be finite";break;default:B=F.defaultError,S.assertNever(D)}return{message:B}},MD=sF;var m8=MD;function tF(D){m8=D}function B2(){return m8}var O2=(D)=>{let{data:F,path:B,errorMaps:E,issueData:$}=D,X=[...B,...$.path||[]],J={...$,path:X};if($.message!==void 0)return{...$,path:X,message:$.message};let Q="",Y=E.filter((W)=>!!W).slice().reverse();for(let W of Y)Q=W(J,{data:F,defaultError:Q}).message;return{...$,path:X,message:Q}},eF=[];function A(D,F){let B=B2(),E=O2({issueData:F,data:D.data,path:D.path,errorMaps:[D.common.contextualErrorMap,D.schemaErrorMap,B,B===MD?void 0:MD].filter(($)=>!!$)});D.common.issues.push(E)}class h{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(D,F){let B=[];for(let E of F){if(E.status==="aborted")return z;if(E.status==="dirty")D.dirty();B.push(E.value)}return{status:D.value,value:B}}static async mergeObjectAsync(D,F){let B=[];for(let E of F){let $=await E.key,X=await E.value;B.push({key:$,value:X})}return h.mergeObjectSync(D,B)}static mergeObjectSync(D,F){let B={};for(let E of F){let{key:$,value:X}=E;if($.status==="aborted")return z;if(X.status==="aborted")return z;if($.status==="dirty")D.dirty();if(X.status==="dirty")D.dirty();if($.value!=="__proto__"&&(typeof X.value<"u"||E.alwaysSet))B[$.value]=X.value}return{status:D.value,value:B}}}var z=Object.freeze({status:"aborted"}),yD=(D)=>({status:"dirty",value:D}),m=(D)=>({status:"valid",value:D}),o2=(D)=>D.status==="aborted",s2=(D)=>D.status==="dirty",LD=(D)=>D.status==="valid",E2=(D)=>typeof Promise<"u"&&D instanceof Promise;var M;(function(D){D.errToObj=(F)=>typeof F==="string"?{message:F}:F||{},D.toString=(F)=>typeof F==="string"?F:F?.message})(M||(M={}));class t{constructor(D,F,B,E){this._cachedPath=[],this.parent=D,this.data=F,this._path=B,this._key=E}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var l8=(D,F)=>{if(LD(F))return{success:!0,data:F.value};else{if(!D.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let B=new p(D.common.issues);return this._error=B,this._error}}}};function N(D){if(!D)return{};let{errorMap:F,invalid_type_error:B,required_error:E,description:$}=D;if(F&&(B||E))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(F)return{errorMap:F,description:$};return{errorMap:(J,Q)=>{let{message:Y}=D;if(J.code==="invalid_enum_value")return{message:Y??Q.defaultError};if(typeof Q.data>"u")return{message:Y??E??Q.defaultError};if(J.code!=="invalid_type")return{message:Q.defaultError};return{message:Y??B??Q.defaultError}},description:$}}class w{get description(){return this._def.description}_getType(D){return QD(D.data)}_getOrReturnCtx(D,F){return F||{common:D.parent.common,data:D.data,parsedType:QD(D.data),schemaErrorMap:this._def.errorMap,path:D.path,parent:D.parent}}_processInputParams(D){return{status:new h,ctx:{common:D.parent.common,data:D.data,parsedType:QD(D.data),schemaErrorMap:this._def.errorMap,path:D.path,parent:D.parent}}}_parseSync(D){let F=this._parse(D);if(E2(F))throw Error("Synchronous parse encountered promise.");return F}_parseAsync(D){let F=this._parse(D);return Promise.resolve(F)}parse(D,F){let B=this.safeParse(D,F);if(B.success)return B.data;throw B.error}safeParse(D,F){let B={common:{issues:[],async:F?.async??!1,contextualErrorMap:F?.errorMap},path:F?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:D,parsedType:QD(D)},E=this._parseSync({data:D,path:B.path,parent:B});return l8(B,E)}"~validate"(D){let F={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:D,parsedType:QD(D)};if(!this["~standard"].async)try{let B=this._parseSync({data:D,path:[],parent:F});return LD(B)?{value:B.value}:{issues:F.common.issues}}catch(B){if(B?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;F.common={issues:[],async:!0}}return this._parseAsync({data:D,path:[],parent:F}).then((B)=>LD(B)?{value:B.value}:{issues:F.common.issues})}async parseAsync(D,F){let B=await this.safeParseAsync(D,F);if(B.success)return B.data;throw B.error}async safeParseAsync(D,F){let B={common:{issues:[],contextualErrorMap:F?.errorMap,async:!0},path:F?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:D,parsedType:QD(D)},E=this._parse({data:D,path:B.path,parent:B}),$=await(E2(E)?E:Promise.resolve(E));return l8(B,$)}refine(D,F){let B=(E)=>{if(typeof F==="string"||typeof F>"u")return{message:F};else if(typeof F==="function")return F(E);else return F};return this._refinement((E,$)=>{let X=D(E),J=()=>$.addIssue({code:q.custom,...B(E)});if(typeof Promise<"u"&&X instanceof Promise)return X.then((Q)=>{if(!Q)return J(),!1;else return!0});if(!X)return J(),!1;else return!0})}refinement(D,F){return this._refinement((B,E)=>{if(!D(B))return E.addIssue(typeof F==="function"?F(B,E):F),!1;else return!0})}_refinement(D){return new e({schema:this,typeName:V.ZodEffects,effect:{type:"refinement",refinement:D}})}superRefine(D){return this._refinement(D)}constructor(D){this.spa=this.safeParseAsync,this._def=D,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(F)=>this["~validate"](F)}}optional(){return s.create(this,this._def)}nullable(){return jD.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return o.create(this)}promise(){return lD.create(this,this._def)}or(D){return W2.create([this,D],this._def)}and(D){return H2.create(this,D,this._def)}transform(D){return new e({...N(this._def),schema:this,typeName:V.ZodEffects,effect:{type:"transform",transform:D}})}default(D){let F=typeof D==="function"?D:()=>D;return new A2({...N(this._def),innerType:this,defaultValue:F,typeName:V.ZodDefault})}brand(){return new e2({typeName:V.ZodBranded,type:this,...N(this._def)})}catch(D){let F=typeof D==="function"?D:()=>D;return new U2({...N(this._def),innerType:this,catchValue:F,typeName:V.ZodCatch})}describe(D){return new this.constructor({...this._def,description:D})}pipe(D){return P2.create(this,D)}readonly(){return M2.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var D5=/^c[^\s-]{8,}$/i,F5=/^[0-9a-z]+$/,B5=/^[0-9A-HJKMNP-TV-Z]{26}$/i,E5=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,$5=/^[a-z0-9_-]{21}$/i,X5=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,J5=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Q5=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Y5="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",e0,W5=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,H5=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,q5=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,_5=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,G5=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,A5=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,d8="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",U5=new RegExp(`^${d8}$`);function c8(D){let F="[0-5]\\d";if(D.precision)F=`${F}\\.\\d{${D.precision}}`;else if(D.precision==null)F=`${F}(\\.\\d+)?`;let B=D.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${F})${B}`}function M5(D){return new RegExp(`^${c8(D)}$`)}function n8(D){let F=`${d8}T${c8(D)}`,B=[];if(B.push(D.local?"Z?":"Z"),D.offset)B.push("([+-]\\d{2}:?\\d{2})");return F=`${F}(${B.join("|")})`,new RegExp(`^${F}$`)}function z5(D,F){if((F==="v4"||!F)&&W5.test(D))return!0;if((F==="v6"||!F)&&q5.test(D))return!0;return!1}function j5(D,F){if(!X5.test(D))return!1;try{let[B]=D.split(".");if(!B)return!1;let E=B.replace(/-/g,"+").replace(/_/g,"/").padEnd(B.length+(4-B.length%4)%4,"="),$=JSON.parse(atob(E));if(typeof $!=="object"||$===null)return!1;if("typ"in $&&$?.typ!=="JWT")return!1;if(!$.alg)return!1;if(F&&$.alg!==F)return!1;return!0}catch{return!1}}function V5(D,F){if((F==="v4"||!F)&&H5.test(D))return!0;if((F==="v6"||!F)&&_5.test(D))return!0;return!1}class r extends w{_parse(D){if(this._def.coerce)D.data=String(D.data);if(this._getType(D)!==G.string){let $=this._getOrReturnCtx(D);return A($,{code:q.invalid_type,expected:G.string,received:$.parsedType}),z}let B=new h,E=void 0;for(let $ of this._def.checks)if($.kind==="min"){if(D.data.length<$.value)E=this._getOrReturnCtx(D,E),A(E,{code:q.too_small,minimum:$.value,type:"string",inclusive:!0,exact:!1,message:$.message}),B.dirty()}else if($.kind==="max"){if(D.data.length>$.value)E=this._getOrReturnCtx(D,E),A(E,{code:q.too_big,maximum:$.value,type:"string",inclusive:!0,exact:!1,message:$.message}),B.dirty()}else if($.kind==="length"){let X=D.data.length>$.value,J=D.data.length<$.value;if(X||J){if(E=this._getOrReturnCtx(D,E),X)A(E,{code:q.too_big,maximum:$.value,type:"string",inclusive:!0,exact:!0,message:$.message});else if(J)A(E,{code:q.too_small,minimum:$.value,type:"string",inclusive:!0,exact:!0,message:$.message});B.dirty()}}else if($.kind==="email"){if(!Q5.test(D.data))E=this._getOrReturnCtx(D,E),A(E,{validation:"email",code:q.invalid_string,message:$.message}),B.dirty()}else if($.kind==="emoji"){if(!e0)e0=new RegExp(Y5,"u");if(!e0.test(D.data))E=this._getOrReturnCtx(D,E),A(E,{validation:"emoji",code:q.invalid_string,message:$.message}),B.dirty()}else if($.kind==="uuid"){if(!E5.test(D.data))E=this._getOrReturnCtx(D,E),A(E,{validation:"uuid",code:q.invalid_string,message:$.message}),B.dirty()}else if($.kind==="nanoid"){if(!$5.test(D.data))E=this._getOrReturnCtx(D,E),A(E,{validation:"nanoid",code:q.invalid_string,message:$.message}),B.dirty()}else if($.kind==="cuid"){if(!D5.test(D.data))E=this._getOrReturnCtx(D,E),A(E,{validation:"cuid",code:q.invalid_string,message:$.message}),B.dirty()}else if($.kind==="cuid2"){if(!F5.test(D.data))E=this._getOrReturnCtx(D,E),A(E,{validation:"cuid2",code:q.invalid_string,message:$.message}),B.dirty()}else if($.kind==="ulid"){if(!B5.test(D.data))E=this._getOrReturnCtx(D,E),A(E,{validation:"ulid",code:q.invalid_string,message:$.message}),B.dirty()}else if($.kind==="url")try{new URL(D.data)}catch{E=this._getOrReturnCtx(D,E),A(E,{validation:"url",code:q.invalid_string,message:$.message}),B.dirty()}else if($.kind==="regex"){if($.regex.lastIndex=0,!$.regex.test(D.data))E=this._getOrReturnCtx(D,E),A(E,{validation:"regex",code:q.invalid_string,message:$.message}),B.dirty()}else if($.kind==="trim")D.data=D.data.trim();else if($.kind==="includes"){if(!D.data.includes($.value,$.position))E=this._getOrReturnCtx(D,E),A(E,{code:q.invalid_string,validation:{includes:$.value,position:$.position},message:$.message}),B.dirty()}else if($.kind==="toLowerCase")D.data=D.data.toLowerCase();else if($.kind==="toUpperCase")D.data=D.data.toUpperCase();else if($.kind==="startsWith"){if(!D.data.startsWith($.value))E=this._getOrReturnCtx(D,E),A(E,{code:q.invalid_string,validation:{startsWith:$.value},message:$.message}),B.dirty()}else if($.kind==="endsWith"){if(!D.data.endsWith($.value))E=this._getOrReturnCtx(D,E),A(E,{code:q.invalid_string,validation:{endsWith:$.value},message:$.message}),B.dirty()}else if($.kind==="datetime"){if(!n8($).test(D.data))E=this._getOrReturnCtx(D,E),A(E,{code:q.invalid_string,validation:"datetime",message:$.message}),B.dirty()}else if($.kind==="date"){if(!U5.test(D.data))E=this._getOrReturnCtx(D,E),A(E,{code:q.invalid_string,validation:"date",message:$.message}),B.dirty()}else if($.kind==="time"){if(!M5($).test(D.data))E=this._getOrReturnCtx(D,E),A(E,{code:q.invalid_string,validation:"time",message:$.message}),B.dirty()}else if($.kind==="duration"){if(!J5.test(D.data))E=this._getOrReturnCtx(D,E),A(E,{validation:"duration",code:q.invalid_string,message:$.message}),B.dirty()}else if($.kind==="ip"){if(!z5(D.data,$.version))E=this._getOrReturnCtx(D,E),A(E,{validation:"ip",code:q.invalid_string,message:$.message}),B.dirty()}else if($.kind==="jwt"){if(!j5(D.data,$.alg))E=this._getOrReturnCtx(D,E),A(E,{validation:"jwt",code:q.invalid_string,message:$.message}),B.dirty()}else if($.kind==="cidr"){if(!V5(D.data,$.version))E=this._getOrReturnCtx(D,E),A(E,{validation:"cidr",code:q.invalid_string,message:$.message}),B.dirty()}else if($.kind==="base64"){if(!G5.test(D.data))E=this._getOrReturnCtx(D,E),A(E,{validation:"base64",code:q.invalid_string,message:$.message}),B.dirty()}else if($.kind==="base64url"){if(!A5.test(D.data))E=this._getOrReturnCtx(D,E),A(E,{validation:"base64url",code:q.invalid_string,message:$.message}),B.dirty()}else S.assertNever($);return{status:B.value,value:D.data}}_regex(D,F,B){return this.refinement((E)=>D.test(E),{validation:F,code:q.invalid_string,...M.errToObj(B)})}_addCheck(D){return new r({...this._def,checks:[...this._def.checks,D]})}email(D){return this._addCheck({kind:"email",...M.errToObj(D)})}url(D){return this._addCheck({kind:"url",...M.errToObj(D)})}emoji(D){return this._addCheck({kind:"emoji",...M.errToObj(D)})}uuid(D){return this._addCheck({kind:"uuid",...M.errToObj(D)})}nanoid(D){return this._addCheck({kind:"nanoid",...M.errToObj(D)})}cuid(D){return this._addCheck({kind:"cuid",...M.errToObj(D)})}cuid2(D){return this._addCheck({kind:"cuid2",...M.errToObj(D)})}ulid(D){return this._addCheck({kind:"ulid",...M.errToObj(D)})}base64(D){return this._addCheck({kind:"base64",...M.errToObj(D)})}base64url(D){return this._addCheck({kind:"base64url",...M.errToObj(D)})}jwt(D){return this._addCheck({kind:"jwt",...M.errToObj(D)})}ip(D){return this._addCheck({kind:"ip",...M.errToObj(D)})}cidr(D){return this._addCheck({kind:"cidr",...M.errToObj(D)})}datetime(D){if(typeof D==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:D});return this._addCheck({kind:"datetime",precision:typeof D?.precision>"u"?null:D?.precision,offset:D?.offset??!1,local:D?.local??!1,...M.errToObj(D?.message)})}date(D){return this._addCheck({kind:"date",message:D})}time(D){if(typeof D==="string")return this._addCheck({kind:"time",precision:null,message:D});return this._addCheck({kind:"time",precision:typeof D?.precision>"u"?null:D?.precision,...M.errToObj(D?.message)})}duration(D){return this._addCheck({kind:"duration",...M.errToObj(D)})}regex(D,F){return this._addCheck({kind:"regex",regex:D,...M.errToObj(F)})}includes(D,F){return this._addCheck({kind:"includes",value:D,position:F?.position,...M.errToObj(F?.message)})}startsWith(D,F){return this._addCheck({kind:"startsWith",value:D,...M.errToObj(F)})}endsWith(D,F){return this._addCheck({kind:"endsWith",value:D,...M.errToObj(F)})}min(D,F){return this._addCheck({kind:"min",value:D,...M.errToObj(F)})}max(D,F){return this._addCheck({kind:"max",value:D,...M.errToObj(F)})}length(D,F){return this._addCheck({kind:"length",value:D,...M.errToObj(F)})}nonempty(D){return this.min(1,M.errToObj(D))}trim(){return new r({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new r({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new r({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((D)=>D.kind==="datetime")}get isDate(){return!!this._def.checks.find((D)=>D.kind==="date")}get isTime(){return!!this._def.checks.find((D)=>D.kind==="time")}get isDuration(){return!!this._def.checks.find((D)=>D.kind==="duration")}get isEmail(){return!!this._def.checks.find((D)=>D.kind==="email")}get isURL(){return!!this._def.checks.find((D)=>D.kind==="url")}get isEmoji(){return!!this._def.checks.find((D)=>D.kind==="emoji")}get isUUID(){return!!this._def.checks.find((D)=>D.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((D)=>D.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((D)=>D.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((D)=>D.kind==="cuid2")}get isULID(){return!!this._def.checks.find((D)=>D.kind==="ulid")}get isIP(){return!!this._def.checks.find((D)=>D.kind==="ip")}get isCIDR(){return!!this._def.checks.find((D)=>D.kind==="cidr")}get isBase64(){return!!this._def.checks.find((D)=>D.kind==="base64")}get isBase64url(){return!!this._def.checks.find((D)=>D.kind==="base64url")}get minLength(){let D=null;for(let F of this._def.checks)if(F.kind==="min"){if(D===null||F.value>D)D=F.value}return D}get maxLength(){let D=null;for(let F of this._def.checks)if(F.kind==="max"){if(D===null||F.value<D)D=F.value}return D}}r.create=(D)=>{return new r({checks:[],typeName:V.ZodString,coerce:D?.coerce??!1,...N(D)})};function R5(D,F){let B=(D.toString().split(".")[1]||"").length,E=(F.toString().split(".")[1]||"").length,$=B>E?B:E,X=Number.parseInt(D.toFixed($).replace(".","")),J=Number.parseInt(F.toFixed($).replace(".",""));return X%J/10**$}class OD extends w{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(D){if(this._def.coerce)D.data=Number(D.data);if(this._getType(D)!==G.number){let $=this._getOrReturnCtx(D);return A($,{code:q.invalid_type,expected:G.number,received:$.parsedType}),z}let B=void 0,E=new h;for(let $ of this._def.checks)if($.kind==="int"){if(!S.isInteger(D.data))B=this._getOrReturnCtx(D,B),A(B,{code:q.invalid_type,expected:"integer",received:"float",message:$.message}),E.dirty()}else if($.kind==="min"){if($.inclusive?D.data<$.value:D.data<=$.value)B=this._getOrReturnCtx(D,B),A(B,{code:q.too_small,minimum:$.value,type:"number",inclusive:$.inclusive,exact:!1,message:$.message}),E.dirty()}else if($.kind==="max"){if($.inclusive?D.data>$.value:D.data>=$.value)B=this._getOrReturnCtx(D,B),A(B,{code:q.too_big,maximum:$.value,type:"number",inclusive:$.inclusive,exact:!1,message:$.message}),E.dirty()}else if($.kind==="multipleOf"){if(R5(D.data,$.value)!==0)B=this._getOrReturnCtx(D,B),A(B,{code:q.not_multiple_of,multipleOf:$.value,message:$.message}),E.dirty()}else if($.kind==="finite"){if(!Number.isFinite(D.data))B=this._getOrReturnCtx(D,B),A(B,{code:q.not_finite,message:$.message}),E.dirty()}else S.assertNever($);return{status:E.value,value:D.data}}gte(D,F){return this.setLimit("min",D,!0,M.toString(F))}gt(D,F){return this.setLimit("min",D,!1,M.toString(F))}lte(D,F){return this.setLimit("max",D,!0,M.toString(F))}lt(D,F){return this.setLimit("max",D,!1,M.toString(F))}setLimit(D,F,B,E){return new OD({...this._def,checks:[...this._def.checks,{kind:D,value:F,inclusive:B,message:M.toString(E)}]})}_addCheck(D){return new OD({...this._def,checks:[...this._def.checks,D]})}int(D){return this._addCheck({kind:"int",message:M.toString(D)})}positive(D){return this._addCheck({kind:"min",value:0,inclusive:!1,message:M.toString(D)})}negative(D){return this._addCheck({kind:"max",value:0,inclusive:!1,message:M.toString(D)})}nonpositive(D){return this._addCheck({kind:"max",value:0,inclusive:!0,message:M.toString(D)})}nonnegative(D){return this._addCheck({kind:"min",value:0,inclusive:!0,message:M.toString(D)})}multipleOf(D,F){return this._addCheck({kind:"multipleOf",value:D,message:M.toString(F)})}finite(D){return this._addCheck({kind:"finite",message:M.toString(D)})}safe(D){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:M.toString(D)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:M.toString(D)})}get minValue(){let D=null;for(let F of this._def.checks)if(F.kind==="min"){if(D===null||F.value>D)D=F.value}return D}get maxValue(){let D=null;for(let F of this._def.checks)if(F.kind==="max"){if(D===null||F.value<D)D=F.value}return D}get isInt(){return!!this._def.checks.find((D)=>D.kind==="int"||D.kind==="multipleOf"&&S.isInteger(D.value))}get isFinite(){let D=null,F=null;for(let B of this._def.checks)if(B.kind==="finite"||B.kind==="int"||B.kind==="multipleOf")return!0;else if(B.kind==="min"){if(F===null||B.value>F)F=B.value}else if(B.kind==="max"){if(D===null||B.value<D)D=B.value}return Number.isFinite(F)&&Number.isFinite(D)}}OD.create=(D)=>{return new OD({checks:[],typeName:V.ZodNumber,coerce:D?.coerce||!1,...N(D)})};class wD extends w{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(D){if(this._def.coerce)try{D.data=BigInt(D.data)}catch{return this._getInvalidInput(D)}if(this._getType(D)!==G.bigint)return this._getInvalidInput(D);let B=void 0,E=new h;for(let $ of this._def.checks)if($.kind==="min"){if($.inclusive?D.data<$.value:D.data<=$.value)B=this._getOrReturnCtx(D,B),A(B,{code:q.too_small,type:"bigint",minimum:$.value,inclusive:$.inclusive,message:$.message}),E.dirty()}else if($.kind==="max"){if($.inclusive?D.data>$.value:D.data>=$.value)B=this._getOrReturnCtx(D,B),A(B,{code:q.too_big,type:"bigint",maximum:$.value,inclusive:$.inclusive,message:$.message}),E.dirty()}else if($.kind==="multipleOf"){if(D.data%$.value!==BigInt(0))B=this._getOrReturnCtx(D,B),A(B,{code:q.not_multiple_of,multipleOf:$.value,message:$.message}),E.dirty()}else S.assertNever($);return{status:E.value,value:D.data}}_getInvalidInput(D){let F=this._getOrReturnCtx(D);return A(F,{code:q.invalid_type,expected:G.bigint,received:F.parsedType}),z}gte(D,F){return this.setLimit("min",D,!0,M.toString(F))}gt(D,F){return this.setLimit("min",D,!1,M.toString(F))}lte(D,F){return this.setLimit("max",D,!0,M.toString(F))}lt(D,F){return this.setLimit("max",D,!1,M.toString(F))}setLimit(D,F,B,E){return new wD({...this._def,checks:[...this._def.checks,{kind:D,value:F,inclusive:B,message:M.toString(E)}]})}_addCheck(D){return new wD({...this._def,checks:[...this._def.checks,D]})}positive(D){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:M.toString(D)})}negative(D){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:M.toString(D)})}nonpositive(D){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:M.toString(D)})}nonnegative(D){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:M.toString(D)})}multipleOf(D,F){return this._addCheck({kind:"multipleOf",value:D,message:M.toString(F)})}get minValue(){let D=null;for(let F of this._def.checks)if(F.kind==="min"){if(D===null||F.value>D)D=F.value}return D}get maxValue(){let D=null;for(let F of this._def.checks)if(F.kind==="max"){if(D===null||F.value<D)D=F.value}return D}}wD.create=(D)=>{return new wD({checks:[],typeName:V.ZodBigInt,coerce:D?.coerce??!1,...N(D)})};class J2 extends w{_parse(D){if(this._def.coerce)D.data=Boolean(D.data);if(this._getType(D)!==G.boolean){let B=this._getOrReturnCtx(D);return A(B,{code:q.invalid_type,expected:G.boolean,received:B.parsedType}),z}return m(D.data)}}J2.create=(D)=>{return new J2({typeName:V.ZodBoolean,coerce:D?.coerce||!1,...N(D)})};class hD extends w{_parse(D){if(this._def.coerce)D.data=new Date(D.data);if(this._getType(D)!==G.date){let $=this._getOrReturnCtx(D);return A($,{code:q.invalid_type,expected:G.date,received:$.parsedType}),z}if(Number.isNaN(D.data.getTime())){let $=this._getOrReturnCtx(D);return A($,{code:q.invalid_date}),z}let B=new h,E=void 0;for(let $ of this._def.checks)if($.kind==="min"){if(D.data.getTime()<$.value)E=this._getOrReturnCtx(D,E),A(E,{code:q.too_small,message:$.message,inclusive:!0,exact:!1,minimum:$.value,type:"date"}),B.dirty()}else if($.kind==="max"){if(D.data.getTime()>$.value)E=this._getOrReturnCtx(D,E),A(E,{code:q.too_big,message:$.message,inclusive:!0,exact:!1,maximum:$.value,type:"date"}),B.dirty()}else S.assertNever($);return{status:B.value,value:new Date(D.data.getTime())}}_addCheck(D){return new hD({...this._def,checks:[...this._def.checks,D]})}min(D,F){return this._addCheck({kind:"min",value:D.getTime(),message:M.toString(F)})}max(D,F){return this._addCheck({kind:"max",value:D.getTime(),message:M.toString(F)})}get minDate(){let D=null;for(let F of this._def.checks)if(F.kind==="min"){if(D===null||F.value>D)D=F.value}return D!=null?new Date(D):null}get maxDate(){let D=null;for(let F of this._def.checks)if(F.kind==="max"){if(D===null||F.value<D)D=F.value}return D!=null?new Date(D):null}}hD.create=(D)=>{return new hD({checks:[],coerce:D?.coerce||!1,typeName:V.ZodDate,...N(D)})};class w2 extends w{_parse(D){if(this._getType(D)!==G.symbol){let B=this._getOrReturnCtx(D);return A(B,{code:q.invalid_type,expected:G.symbol,received:B.parsedType}),z}return m(D.data)}}w2.create=(D)=>{return new w2({typeName:V.ZodSymbol,...N(D)})};class Q2 extends w{_parse(D){if(this._getType(D)!==G.undefined){let B=this._getOrReturnCtx(D);return A(B,{code:q.invalid_type,expected:G.undefined,received:B.parsedType}),z}return m(D.data)}}Q2.create=(D)=>{return new Q2({typeName:V.ZodUndefined,...N(D)})};class Y2 extends w{_parse(D){if(this._getType(D)!==G.null){let B=this._getOrReturnCtx(D);return A(B,{code:q.invalid_type,expected:G.null,received:B.parsedType}),z}return m(D.data)}}Y2.create=(D)=>{return new Y2({typeName:V.ZodNull,...N(D)})};class gD extends w{constructor(){super(...arguments);this._any=!0}_parse(D){return m(D.data)}}gD.create=(D)=>{return new gD({typeName:V.ZodAny,...N(D)})};class ND extends w{constructor(){super(...arguments);this._unknown=!0}_parse(D){return m(D.data)}}ND.create=(D)=>{return new ND({typeName:V.ZodUnknown,...N(D)})};class YD extends w{_parse(D){let F=this._getOrReturnCtx(D);return A(F,{code:q.invalid_type,expected:G.never,received:F.parsedType}),z}}YD.create=(D)=>{return new YD({typeName:V.ZodNever,...N(D)})};class S2 extends w{_parse(D){if(this._getType(D)!==G.undefined){let B=this._getOrReturnCtx(D);return A(B,{code:q.invalid_type,expected:G.void,received:B.parsedType}),z}return m(D.data)}}S2.create=(D)=>{return new S2({typeName:V.ZodVoid,...N(D)})};class o extends w{_parse(D){let{ctx:F,status:B}=this._processInputParams(D),E=this._def;if(F.parsedType!==G.array)return A(F,{code:q.invalid_type,expected:G.array,received:F.parsedType}),z;if(E.exactLength!==null){let X=F.data.length>E.exactLength.value,J=F.data.length<E.exactLength.value;if(X||J)A(F,{code:X?q.too_big:q.too_small,minimum:J?E.exactLength.value:void 0,maximum:X?E.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:E.exactLength.message}),B.dirty()}if(E.minLength!==null){if(F.data.length<E.minLength.value)A(F,{code:q.too_small,minimum:E.minLength.value,type:"array",inclusive:!0,exact:!1,message:E.minLength.message}),B.dirty()}if(E.maxLength!==null){if(F.data.length>E.maxLength.value)A(F,{code:q.too_big,maximum:E.maxLength.value,type:"array",inclusive:!0,exact:!1,message:E.maxLength.message}),B.dirty()}if(F.common.async)return Promise.all([...F.data].map((X,J)=>{return E.type._parseAsync(new t(F,X,F.path,J))})).then((X)=>{return h.mergeArray(B,X)});let $=[...F.data].map((X,J)=>{return E.type._parseSync(new t(F,X,F.path,J))});return h.mergeArray(B,$)}get element(){return this._def.type}min(D,F){return new o({...this._def,minLength:{value:D,message:M.toString(F)}})}max(D,F){return new o({...this._def,maxLength:{value:D,message:M.toString(F)}})}length(D,F){return new o({...this._def,exactLength:{value:D,message:M.toString(F)}})}nonempty(D){return this.min(1,D)}}o.create=(D,F)=>{return new o({type:D,minLength:null,maxLength:null,exactLength:null,typeName:V.ZodArray,...N(F)})};function $2(D){if(D instanceof Z){let F={};for(let B in D.shape){let E=D.shape[B];F[B]=s.create($2(E))}return new Z({...D._def,shape:()=>F})}else if(D instanceof o)return new o({...D._def,type:$2(D.element)});else if(D instanceof s)return s.create($2(D.unwrap()));else if(D instanceof jD)return jD.create($2(D.unwrap()));else if(D instanceof WD)return WD.create(D.items.map((F)=>$2(F)));else return D}class Z extends w{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let D=this._def.shape(),F=S.objectKeys(D);return this._cached={shape:D,keys:F},this._cached}_parse(D){if(this._getType(D)!==G.object){let Y=this._getOrReturnCtx(D);return A(Y,{code:q.invalid_type,expected:G.object,received:Y.parsedType}),z}let{status:B,ctx:E}=this._processInputParams(D),{shape:$,keys:X}=this._getCached(),J=[];if(!(this._def.catchall instanceof YD&&this._def.unknownKeys==="strip")){for(let Y in E.data)if(!X.includes(Y))J.push(Y)}let Q=[];for(let Y of X){let W=$[Y],H=E.data[Y];Q.push({key:{status:"valid",value:Y},value:W._parse(new t(E,H,E.path,Y)),alwaysSet:Y in E.data})}if(this._def.catchall instanceof YD){let Y=this._def.unknownKeys;if(Y==="passthrough")for(let W of J)Q.push({key:{status:"valid",value:W},value:{status:"valid",value:E.data[W]}});else if(Y==="strict"){if(J.length>0)A(E,{code:q.unrecognized_keys,keys:J}),B.dirty()}else if(Y==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let Y=this._def.catchall;for(let W of J){let H=E.data[W];Q.push({key:{status:"valid",value:W},value:Y._parse(new t(E,H,E.path,W)),alwaysSet:W in E.data})}}if(E.common.async)return Promise.resolve().then(async()=>{let Y=[];for(let W of Q){let H=await W.key,_=await W.value;Y.push({key:H,value:_,alwaysSet:W.alwaysSet})}return Y}).then((Y)=>{return h.mergeObjectSync(B,Y)});else return h.mergeObjectSync(B,Q)}get shape(){return this._def.shape()}strict(D){return M.errToObj,new Z({...this._def,unknownKeys:"strict",...D!==void 0?{errorMap:(F,B)=>{let E=this._def.errorMap?.(F,B).message??B.defaultError;if(F.code==="unrecognized_keys")return{message:M.errToObj(D).message??E};return{message:E}}}:{}})}strip(){return new Z({...this._def,unknownKeys:"strip"})}passthrough(){return new Z({...this._def,unknownKeys:"passthrough"})}extend(D){return new Z({...this._def,shape:()=>({...this._def.shape(),...D})})}merge(D){return new Z({unknownKeys:D._def.unknownKeys,catchall:D._def.catchall,shape:()=>({...this._def.shape(),...D._def.shape()}),typeName:V.ZodObject})}setKey(D,F){return this.augment({[D]:F})}catchall(D){return new Z({...this._def,catchall:D})}pick(D){let F={};for(let B of S.objectKeys(D))if(D[B]&&this.shape[B])F[B]=this.shape[B];return new Z({...this._def,shape:()=>F})}omit(D){let F={};for(let B of S.objectKeys(this.shape))if(!D[B])F[B]=this.shape[B];return new Z({...this._def,shape:()=>F})}deepPartial(){return $2(this)}partial(D){let F={};for(let B of S.objectKeys(this.shape)){let E=this.shape[B];if(D&&!D[B])F[B]=E;else F[B]=E.optional()}return new Z({...this._def,shape:()=>F})}required(D){let F={};for(let B of S.objectKeys(this.shape))if(D&&!D[B])F[B]=this.shape[B];else{let $=this.shape[B];while($ instanceof s)$=$._def.innerType;F[B]=$}return new Z({...this._def,shape:()=>F})}keyof(){return i8(S.objectKeys(this.shape))}}Z.create=(D,F)=>{return new Z({shape:()=>D,unknownKeys:"strip",catchall:YD.create(),typeName:V.ZodObject,...N(F)})};Z.strictCreate=(D,F)=>{return new Z({shape:()=>D,unknownKeys:"strict",catchall:YD.create(),typeName:V.ZodObject,...N(F)})};Z.lazycreate=(D,F)=>{return new Z({shape:D,unknownKeys:"strip",catchall:YD.create(),typeName:V.ZodObject,...N(F)})};class W2 extends w{_parse(D){let{ctx:F}=this._processInputParams(D),B=this._def.options;function E($){for(let J of $)if(J.result.status==="valid")return J.result;for(let J of $)if(J.result.status==="dirty")return F.common.issues.push(...J.ctx.common.issues),J.result;let X=$.map((J)=>new p(J.ctx.common.issues));return A(F,{code:q.invalid_union,unionErrors:X}),z}if(F.common.async)return Promise.all(B.map(async($)=>{let X={...F,common:{...F.common,issues:[]},parent:null};return{result:await $._parseAsync({data:F.data,path:F.path,parent:X}),ctx:X}})).then(E);else{let $=void 0,X=[];for(let Q of B){let Y={...F,common:{...F.common,issues:[]},parent:null},W=Q._parseSync({data:F.data,path:F.path,parent:Y});if(W.status==="valid")return W;else if(W.status==="dirty"&&!$)$={result:W,ctx:Y};if(Y.common.issues.length)X.push(Y.common.issues)}if($)return F.common.issues.push(...$.ctx.common.issues),$.result;let J=X.map((Q)=>new p(Q));return A(F,{code:q.invalid_union,unionErrors:J}),z}}get options(){return this._def.options}}W2.create=(D,F)=>{return new W2({options:D,typeName:V.ZodUnion,...N(F)})};var zD=(D)=>{if(D instanceof q2)return zD(D.schema);else if(D instanceof e)return zD(D.innerType());else if(D instanceof _2)return[D.value];else if(D instanceof SD)return D.options;else if(D instanceof G2)return S.objectValues(D.enum);else if(D instanceof A2)return zD(D._def.innerType);else if(D instanceof Q2)return[void 0];else if(D instanceof Y2)return[null];else if(D instanceof s)return[void 0,...zD(D.unwrap())];else if(D instanceof jD)return[null,...zD(D.unwrap())];else if(D instanceof e2)return zD(D.unwrap());else if(D instanceof M2)return zD(D.unwrap());else if(D instanceof U2)return zD(D._def.innerType);else return[]};class t2 extends w{_parse(D){let{ctx:F}=this._processInputParams(D);if(F.parsedType!==G.object)return A(F,{code:q.invalid_type,expected:G.object,received:F.parsedType}),z;let B=this.discriminator,E=F.data[B],$=this.optionsMap.get(E);if(!$)return A(F,{code:q.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[B]}),z;if(F.common.async)return $._parseAsync({data:F.data,path:F.path,parent:F});else return $._parseSync({data:F.data,path:F.path,parent:F})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(D,F,B){let E=new Map;for(let $ of F){let X=zD($.shape[D]);if(!X.length)throw Error(`A discriminator value for key \`${D}\` could not be extracted from all schema options`);for(let J of X){if(E.has(J))throw Error(`Discriminator property ${String(D)} has duplicate value ${String(J)}`);E.set(J,$)}}return new t2({typeName:V.ZodDiscriminatedUnion,discriminator:D,options:F,optionsMap:E,...N(B)})}}function D3(D,F){let B=QD(D),E=QD(F);if(D===F)return{valid:!0,data:D};else if(B===G.object&&E===G.object){let $=S.objectKeys(F),X=S.objectKeys(D).filter((Q)=>$.indexOf(Q)!==-1),J={...D,...F};for(let Q of X){let Y=D3(D[Q],F[Q]);if(!Y.valid)return{valid:!1};J[Q]=Y.data}return{valid:!0,data:J}}else if(B===G.array&&E===G.array){if(D.length!==F.length)return{valid:!1};let $=[];for(let X=0;X<D.length;X++){let J=D[X],Q=F[X],Y=D3(J,Q);if(!Y.valid)return{valid:!1};$.push(Y.data)}return{valid:!0,data:$}}else if(B===G.date&&E===G.date&&+D===+F)return{valid:!0,data:D};else return{valid:!1}}class H2 extends w{_parse(D){let{status:F,ctx:B}=this._processInputParams(D),E=($,X)=>{if(o2($)||o2(X))return z;let J=D3($.value,X.value);if(!J.valid)return A(B,{code:q.invalid_intersection_types}),z;if(s2($)||s2(X))F.dirty();return{status:F.value,value:J.data}};if(B.common.async)return Promise.all([this._def.left._parseAsync({data:B.data,path:B.path,parent:B}),this._def.right._parseAsync({data:B.data,path:B.path,parent:B})]).then(([$,X])=>E($,X));else return E(this._def.left._parseSync({data:B.data,path:B.path,parent:B}),this._def.right._parseSync({data:B.data,path:B.path,parent:B}))}}H2.create=(D,F,B)=>{return new H2({left:D,right:F,typeName:V.ZodIntersection,...N(B)})};class WD extends w{_parse(D){let{status:F,ctx:B}=this._processInputParams(D);if(B.parsedType!==G.array)return A(B,{code:q.invalid_type,expected:G.array,received:B.parsedType}),z;if(B.data.length<this._def.items.length)return A(B,{code:q.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),z;if(!this._def.rest&&B.data.length>this._def.items.length)A(B,{code:q.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),F.dirty();let $=[...B.data].map((X,J)=>{let Q=this._def.items[J]||this._def.rest;if(!Q)return null;return Q._parse(new t(B,X,B.path,J))}).filter((X)=>!!X);if(B.common.async)return Promise.all($).then((X)=>{return h.mergeArray(F,X)});else return h.mergeArray(F,$)}get items(){return this._def.items}rest(D){return new WD({...this._def,rest:D})}}WD.create=(D,F)=>{if(!Array.isArray(D))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new WD({items:D,typeName:V.ZodTuple,rest:null,...N(F)})};class b2 extends w{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(D){let{status:F,ctx:B}=this._processInputParams(D);if(B.parsedType!==G.object)return A(B,{code:q.invalid_type,expected:G.object,received:B.parsedType}),z;let E=[],$=this._def.keyType,X=this._def.valueType;for(let J in B.data)E.push({key:$._parse(new t(B,J,B.path,J)),value:X._parse(new t(B,B.data[J],B.path,J)),alwaysSet:J in B.data});if(B.common.async)return h.mergeObjectAsync(F,E);else return h.mergeObjectSync(F,E)}get element(){return this._def.valueType}static create(D,F,B){if(F instanceof w)return new b2({keyType:D,valueType:F,typeName:V.ZodRecord,...N(B)});return new b2({keyType:r.create(),valueType:D,typeName:V.ZodRecord,...N(F)})}}class u2 extends w{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(D){let{status:F,ctx:B}=this._processInputParams(D);if(B.parsedType!==G.map)return A(B,{code:q.invalid_type,expected:G.map,received:B.parsedType}),z;let E=this._def.keyType,$=this._def.valueType,X=[...B.data.entries()].map(([J,Q],Y)=>{return{key:E._parse(new t(B,J,B.path,[Y,"key"])),value:$._parse(new t(B,Q,B.path,[Y,"value"]))}});if(B.common.async){let J=new Map;return Promise.resolve().then(async()=>{for(let Q of X){let Y=await Q.key,W=await Q.value;if(Y.status==="aborted"||W.status==="aborted")return z;if(Y.status==="dirty"||W.status==="dirty")F.dirty();J.set(Y.value,W.value)}return{status:F.value,value:J}})}else{let J=new Map;for(let Q of X){let{key:Y,value:W}=Q;if(Y.status==="aborted"||W.status==="aborted")return z;if(Y.status==="dirty"||W.status==="dirty")F.dirty();J.set(Y.value,W.value)}return{status:F.value,value:J}}}}u2.create=(D,F,B)=>{return new u2({valueType:F,keyType:D,typeName:V.ZodMap,...N(B)})};class mD extends w{_parse(D){let{status:F,ctx:B}=this._processInputParams(D);if(B.parsedType!==G.set)return A(B,{code:q.invalid_type,expected:G.set,received:B.parsedType}),z;let E=this._def;if(E.minSize!==null){if(B.data.size<E.minSize.value)A(B,{code:q.too_small,minimum:E.minSize.value,type:"set",inclusive:!0,exact:!1,message:E.minSize.message}),F.dirty()}if(E.maxSize!==null){if(B.data.size>E.maxSize.value)A(B,{code:q.too_big,maximum:E.maxSize.value,type:"set",inclusive:!0,exact:!1,message:E.maxSize.message}),F.dirty()}let $=this._def.valueType;function X(Q){let Y=new Set;for(let W of Q){if(W.status==="aborted")return z;if(W.status==="dirty")F.dirty();Y.add(W.value)}return{status:F.value,value:Y}}let J=[...B.data.values()].map((Q,Y)=>$._parse(new t(B,Q,B.path,Y)));if(B.common.async)return Promise.all(J).then((Q)=>X(Q));else return X(J)}min(D,F){return new mD({...this._def,minSize:{value:D,message:M.toString(F)}})}max(D,F){return new mD({...this._def,maxSize:{value:D,message:M.toString(F)}})}size(D,F){return this.min(D,F).max(D,F)}nonempty(D){return this.min(1,D)}}mD.create=(D,F)=>{return new mD({valueType:D,minSize:null,maxSize:null,typeName:V.ZodSet,...N(F)})};class X2 extends w{constructor(){super(...arguments);this.validate=this.implement}_parse(D){let{ctx:F}=this._processInputParams(D);if(F.parsedType!==G.function)return A(F,{code:q.invalid_type,expected:G.function,received:F.parsedType}),z;function B(J,Q){return O2({data:J,path:F.path,errorMaps:[F.common.contextualErrorMap,F.schemaErrorMap,B2(),MD].filter((Y)=>!!Y),issueData:{code:q.invalid_arguments,argumentsError:Q}})}function E(J,Q){return O2({data:J,path:F.path,errorMaps:[F.common.contextualErrorMap,F.schemaErrorMap,B2(),MD].filter((Y)=>!!Y),issueData:{code:q.invalid_return_type,returnTypeError:Q}})}let $={errorMap:F.common.contextualErrorMap},X=F.data;if(this._def.returns instanceof lD){let J=this;return m(async function(...Q){let Y=new p([]),W=await J._def.args.parseAsync(Q,$).catch((j)=>{throw Y.addIssue(B(Q,j)),Y}),H=await Reflect.apply(X,this,W);return await J._def.returns._def.type.parseAsync(H,$).catch((j)=>{throw Y.addIssue(E(H,j)),Y})})}else{let J=this;return m(function(...Q){let Y=J._def.args.safeParse(Q,$);if(!Y.success)throw new p([B(Q,Y.error)]);let W=Reflect.apply(X,this,Y.data),H=J._def.returns.safeParse(W,$);if(!H.success)throw new p([E(W,H.error)]);return H.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...D){return new X2({...this._def,args:WD.create(D).rest(ND.create())})}returns(D){return new X2({...this._def,returns:D})}implement(D){return this.parse(D)}strictImplement(D){return this.parse(D)}static create(D,F,B){return new X2({args:D?D:WD.create([]).rest(ND.create()),returns:F||ND.create(),typeName:V.ZodFunction,...N(B)})}}class q2 extends w{get schema(){return this._def.getter()}_parse(D){let{ctx:F}=this._processInputParams(D);return this._def.getter()._parse({data:F.data,path:F.path,parent:F})}}q2.create=(D,F)=>{return new q2({getter:D,typeName:V.ZodLazy,...N(F)})};class _2 extends w{_parse(D){if(D.data!==this._def.value){let F=this._getOrReturnCtx(D);return A(F,{received:F.data,code:q.invalid_literal,expected:this._def.value}),z}return{status:"valid",value:D.data}}get value(){return this._def.value}}_2.create=(D,F)=>{return new _2({value:D,typeName:V.ZodLiteral,...N(F)})};function i8(D,F){return new SD({values:D,typeName:V.ZodEnum,...N(F)})}class SD extends w{_parse(D){if(typeof D.data!=="string"){let F=this._getOrReturnCtx(D),B=this._def.values;return A(F,{expected:S.joinValues(B),received:F.parsedType,code:q.invalid_type}),z}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(D.data)){let F=this._getOrReturnCtx(D),B=this._def.values;return A(F,{received:F.data,code:q.invalid_enum_value,options:B}),z}return m(D.data)}get options(){return this._def.values}get enum(){let D={};for(let F of this._def.values)D[F]=F;return D}get Values(){let D={};for(let F of this._def.values)D[F]=F;return D}get Enum(){let D={};for(let F of this._def.values)D[F]=F;return D}extract(D,F=this._def){return SD.create(D,{...this._def,...F})}exclude(D,F=this._def){return SD.create(this.options.filter((B)=>!D.includes(B)),{...this._def,...F})}}SD.create=i8;class G2 extends w{_parse(D){let F=S.getValidEnumValues(this._def.values),B=this._getOrReturnCtx(D);if(B.parsedType!==G.string&&B.parsedType!==G.number){let E=S.objectValues(F);return A(B,{expected:S.joinValues(E),received:B.parsedType,code:q.invalid_type}),z}if(!this._cache)this._cache=new Set(S.getValidEnumValues(this._def.values));if(!this._cache.has(D.data)){let E=S.objectValues(F);return A(B,{received:B.data,code:q.invalid_enum_value,options:E}),z}return m(D.data)}get enum(){return this._def.values}}G2.create=(D,F)=>{return new G2({values:D,typeName:V.ZodNativeEnum,...N(F)})};class lD extends w{unwrap(){return this._def.type}_parse(D){let{ctx:F}=this._processInputParams(D);if(F.parsedType!==G.promise&&F.common.async===!1)return A(F,{code:q.invalid_type,expected:G.promise,received:F.parsedType}),z;let B=F.parsedType===G.promise?F.data:Promise.resolve(F.data);return m(B.then((E)=>{return this._def.type.parseAsync(E,{path:F.path,errorMap:F.common.contextualErrorMap})}))}}lD.create=(D,F)=>{return new lD({type:D,typeName:V.ZodPromise,...N(F)})};class e extends w{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===V.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(D){let{status:F,ctx:B}=this._processInputParams(D),E=this._def.effect||null,$={addIssue:(X)=>{if(A(B,X),X.fatal)F.abort();else F.dirty()},get path(){return B.path}};if($.addIssue=$.addIssue.bind($),E.type==="preprocess"){let X=E.transform(B.data,$);if(B.common.async)return Promise.resolve(X).then(async(J)=>{if(F.value==="aborted")return z;let Q=await this._def.schema._parseAsync({data:J,path:B.path,parent:B});if(Q.status==="aborted")return z;if(Q.status==="dirty")return yD(Q.value);if(F.value==="dirty")return yD(Q.value);return Q});else{if(F.value==="aborted")return z;let J=this._def.schema._parseSync({data:X,path:B.path,parent:B});if(J.status==="aborted")return z;if(J.status==="dirty")return yD(J.value);if(F.value==="dirty")return yD(J.value);return J}}if(E.type==="refinement"){let X=(J)=>{let Q=E.refinement(J,$);if(B.common.async)return Promise.resolve(Q);if(Q instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return J};if(B.common.async===!1){let J=this._def.schema._parseSync({data:B.data,path:B.path,parent:B});if(J.status==="aborted")return z;if(J.status==="dirty")F.dirty();return X(J.value),{status:F.value,value:J.value}}else return this._def.schema._parseAsync({data:B.data,path:B.path,parent:B}).then((J)=>{if(J.status==="aborted")return z;if(J.status==="dirty")F.dirty();return X(J.value).then(()=>{return{status:F.value,value:J.value}})})}if(E.type==="transform")if(B.common.async===!1){let X=this._def.schema._parseSync({data:B.data,path:B.path,parent:B});if(!LD(X))return z;let J=E.transform(X.value,$);if(J instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:F.value,value:J}}else return this._def.schema._parseAsync({data:B.data,path:B.path,parent:B}).then((X)=>{if(!LD(X))return z;return Promise.resolve(E.transform(X.value,$)).then((J)=>({status:F.value,value:J}))});S.assertNever(E)}}e.create=(D,F,B)=>{return new e({schema:D,typeName:V.ZodEffects,effect:F,...N(B)})};e.createWithPreprocess=(D,F,B)=>{return new e({schema:F,effect:{type:"preprocess",transform:D},typeName:V.ZodEffects,...N(B)})};class s extends w{_parse(D){if(this._getType(D)===G.undefined)return m(void 0);return this._def.innerType._parse(D)}unwrap(){return this._def.innerType}}s.create=(D,F)=>{return new s({innerType:D,typeName:V.ZodOptional,...N(F)})};class jD extends w{_parse(D){if(this._getType(D)===G.null)return m(null);return this._def.innerType._parse(D)}unwrap(){return this._def.innerType}}jD.create=(D,F)=>{return new jD({innerType:D,typeName:V.ZodNullable,...N(F)})};class A2 extends w{_parse(D){let{ctx:F}=this._processInputParams(D),B=F.data;if(F.parsedType===G.undefined)B=this._def.defaultValue();return this._def.innerType._parse({data:B,path:F.path,parent:F})}removeDefault(){return this._def.innerType}}A2.create=(D,F)=>{return new A2({innerType:D,typeName:V.ZodDefault,defaultValue:typeof F.default==="function"?F.default:()=>F.default,...N(F)})};class U2 extends w{_parse(D){let{ctx:F}=this._processInputParams(D),B={...F,common:{...F.common,issues:[]}},E=this._def.innerType._parse({data:B.data,path:B.path,parent:{...B}});if(E2(E))return E.then(($)=>{return{status:"valid",value:$.status==="valid"?$.value:this._def.catchValue({get error(){return new p(B.common.issues)},input:B.data})}});else return{status:"valid",value:E.status==="valid"?E.value:this._def.catchValue({get error(){return new p(B.common.issues)},input:B.data})}}removeCatch(){return this._def.innerType}}U2.create=(D,F)=>{return new U2({innerType:D,typeName:V.ZodCatch,catchValue:typeof F.catch==="function"?F.catch:()=>F.catch,...N(F)})};class T2 extends w{_parse(D){if(this._getType(D)!==G.nan){let B=this._getOrReturnCtx(D);return A(B,{code:q.invalid_type,expected:G.nan,received:B.parsedType}),z}return{status:"valid",value:D.data}}}T2.create=(D)=>{return new T2({typeName:V.ZodNaN,...N(D)})};var K5=Symbol("zod_brand");class e2 extends w{_parse(D){let{ctx:F}=this._processInputParams(D),B=F.data;return this._def.type._parse({data:B,path:F.path,parent:F})}unwrap(){return this._def.type}}class P2 extends w{_parse(D){let{status:F,ctx:B}=this._processInputParams(D);if(B.common.async)return(async()=>{let $=await this._def.in._parseAsync({data:B.data,path:B.path,parent:B});if($.status==="aborted")return z;if($.status==="dirty")return F.dirty(),yD($.value);else return this._def.out._parseAsync({data:$.value,path:B.path,parent:B})})();else{let E=this._def.in._parseSync({data:B.data,path:B.path,parent:B});if(E.status==="aborted")return z;if(E.status==="dirty")return F.dirty(),{status:"dirty",value:E.value};else return this._def.out._parseSync({data:E.value,path:B.path,parent:B})}}static create(D,F){return new P2({in:D,out:F,typeName:V.ZodPipeline})}}class M2 extends w{_parse(D){let F=this._def.innerType._parse(D),B=(E)=>{if(LD(E))E.value=Object.freeze(E.value);return E};return E2(F)?F.then((E)=>B(E)):B(F)}unwrap(){return this._def.innerType}}M2.create=(D,F)=>{return new M2({innerType:D,typeName:V.ZodReadonly,...N(F)})};function p8(D,F){let B=typeof D==="function"?D(F):typeof D==="string"?{message:D}:D;return typeof B==="string"?{message:B}:B}function a8(D,F={},B){if(D)return gD.create().superRefine((E,$)=>{let X=D(E);if(X instanceof Promise)return X.then((J)=>{if(!J){let Q=p8(F,E),Y=Q.fatal??B??!0;$.addIssue({code:"custom",...Q,fatal:Y})}});if(!X){let J=p8(F,E),Q=J.fatal??B??!0;$.addIssue({code:"custom",...J,fatal:Q})}return});return gD.create()}var C5={object:Z.lazycreate},V;(function(D){D.ZodString="ZodString",D.ZodNumber="ZodNumber",D.ZodNaN="ZodNaN",D.ZodBigInt="ZodBigInt",D.ZodBoolean="ZodBoolean",D.ZodDate="ZodDate",D.ZodSymbol="ZodSymbol",D.ZodUndefined="ZodUndefined",D.ZodNull="ZodNull",D.ZodAny="ZodAny",D.ZodUnknown="ZodUnknown",D.ZodNever="ZodNever",D.ZodVoid="ZodVoid",D.ZodArray="ZodArray",D.ZodObject="ZodObject",D.ZodUnion="ZodUnion",D.ZodDiscriminatedUnion="ZodDiscriminatedUnion",D.ZodIntersection="ZodIntersection",D.ZodTuple="ZodTuple",D.ZodRecord="ZodRecord",D.ZodMap="ZodMap",D.ZodSet="ZodSet",D.ZodFunction="ZodFunction",D.ZodLazy="ZodLazy",D.ZodLiteral="ZodLiteral",D.ZodEnum="ZodEnum",D.ZodEffects="ZodEffects",D.ZodNativeEnum="ZodNativeEnum",D.ZodOptional="ZodOptional",D.ZodNullable="ZodNullable",D.ZodDefault="ZodDefault",D.ZodCatch="ZodCatch",D.ZodPromise="ZodPromise",D.ZodBranded="ZodBranded",D.ZodPipeline="ZodPipeline",D.ZodReadonly="ZodReadonly"})(V||(V={}));var L5=(D,F={message:`Input not instance of ${D.name}`})=>a8((B)=>B instanceof D,F),r8=r.create,o8=OD.create,N5=T2.create,O5=wD.create,s8=J2.create,w5=hD.create,S5=w2.create,b5=Q2.create,u5=Y2.create,T5=gD.create,P5=ND.create,I5=YD.create,k5=S2.create,v5=o.create,Z5=Z.create,f5=Z.strictCreate,x5=W2.create,y5=t2.create,h5=H2.create,g5=WD.create,m5=b2.create,l5=u2.create,p5=mD.create,d5=X2.create,c5=q2.create,n5=_2.create,i5=SD.create,a5=G2.create,r5=lD.create,o5=e.create,s5=s.create,t5=jD.create,e5=e.createWithPreprocess,D7=P2.create,F7=()=>r8().optional(),B7=()=>o8().optional(),E7=()=>s8().optional(),$7={string:(D)=>r.create({...D,coerce:!0}),number:(D)=>OD.create({...D,coerce:!0}),boolean:(D)=>J2.create({...D,coerce:!0}),bigint:(D)=>wD.create({...D,coerce:!0}),date:(D)=>hD.create({...D,coerce:!0})};var X7=z;var J7=K.object({name:K.string().default("genie"),defaultWindow:K.string().default("shell"),autoCreate:K.boolean().default(!0)}),Q7=K.object({execTimeout:K.number().default(120000),readLines:K.number().default(100),worktreeBase:K.string().default(".worktrees")}),Y7=K.object({tmuxDebug:K.boolean().default(!1),verbose:K.boolean().default(!1)}),W7=K.object({preference:K.enum(["auto","zsh","bash","fish"]).default("auto")}),H7=K.object({tmuxInstalled:K.boolean().default(!1),shellInstalled:K.boolean().default(!1)}),q7=K.object({enabled:K.boolean().default(!1)}),DD=K.object({version:K.number().default(2),session:J7.default({}),terminal:Q7.default({}),logging:Y7.default({}),shell:W7.default({}),shortcuts:H7.default({}),claudio:q7.optional(),installMethod:K.enum(["source","npm","bun"]).optional(),setupComplete:K.boolean().default(!1),lastSetupAt:K.string().optional()}),t8=K.object({session:K.object({name:K.string().default("genie"),defaultWindow:K.string().default("shell")}).default({}),logging:K.object({tmuxDebug:K.boolean().default(!1)}).default({}),installMethod:K.enum(["source","npm","bun"]).optional()});var D0=F6(D6(),".genie"),pD=F6(D0,"config.json"),F3=2;function B6(){return D0}function I2(){return pD}function dD(){return F0(pD)}function A7(){if(!F0(D0))_7(D0,{recursive:!0})}function E6(D){let F=t8.safeParse(D);if(F.success){let B=F.data;return DD.parse({version:F3,session:{name:B.session.name,defaultWindow:B.session.defaultWindow,autoCreate:!0},terminal:{execTimeout:120000,readLines:100,worktreeBase:".worktrees"},logging:{tmuxDebug:B.logging.tmuxDebug,verbose:!1},shell:{preference:"auto"},shortcuts:{tmuxInstalled:!1,shellInstalled:!1},installMethod:B.installMethod,setupComplete:!1})}return DD.parse({})}async function VD(){if(!F0(pD))return DD.parse({});try{let D=e8(pD,"utf-8"),F=JSON.parse(D);if(!F.version||F.version<F3){let B=E6(F);return await bD(B),B}return DD.parse(F)}catch(D){return console.warn(`Warning: Invalid genie config, using defaults: ${D.message}`),DD.parse({})}}async function bD(D){A7();try{let F=DD.parse(D),B=JSON.stringify(F,null,2);G7(pD,B,"utf-8")}catch(F){throw Error(`Failed to save genie config: ${F.message}`)}}function U7(){return DD.parse({})}function $6(){if(!F0(pD))return DD.parse({});try{let D=e8(pD,"utf-8"),F=JSON.parse(D);if(!F.version||F.version<F3)return E6(F);return DD.parse(F)}catch{return DD.parse({})}}function k2(D){let F=D6();if(D.startsWith(F+"/"))return"~"+D.slice(F.length);if(D===F)return"~";return D}function OE(){return $6().terminal}function X6(){if(!dD())return!1;return $6().setupComplete??!1}async function B3(){let D=await VD();D.setupComplete=!0,D.lastSetupAt=new Date().toISOString(),await bD(D)}async function J6(){let D=U7();await bD(D)}async function Q6(D){let F=await VD();F.shortcuts={...F.shortcuts,...D},await bD(F)}import{homedir as Y6}from"os";import{join as FD}from"path";import{existsSync as cD,readFileSync as W6,writeFileSync as M7,mkdirSync as z7,appendFileSync as E3}from"fs";import*as H6 from"readline";function q6(){return`# Warp-like keyboard shortcuts (generated by genie-cli)
|
|
46
46
|
# To use: add to ~/.tmux.conf or source this file
|
|
47
47
|
|
|
48
48
|
# Ctrl+T: New window (tab) in current session
|
|
@@ -53,13 +53,13 @@ bind-key -n C-s split-window -v -c "#{pane_current_path}"
|
|
|
53
53
|
|
|
54
54
|
# Ctrl+Shift+S: Horizontal split
|
|
55
55
|
bind-key -n C-S split-window -h -c "#{pane_current_path}"
|
|
56
|
-
`}function
|
|
56
|
+
`}function _6(){return`# Warp-like extra keys (generated by genie-cli)
|
|
57
57
|
# To use: add to ~/.termux/termux.properties
|
|
58
58
|
|
|
59
59
|
# Extra keys row with F-keys for shortcuts
|
|
60
60
|
# F1=New Tab, F2=VSplit, F3=HSplit
|
|
61
61
|
extra-keys = [['ESC','TAB','CTRL','ALT','F1','F2','F3']]
|
|
62
|
-
`}function
|
|
62
|
+
`}function j7(){return`# Warp-like shortcuts (generated by genie-cli)
|
|
63
63
|
# To use: add to ~/.bashrc or ~/.zshrc
|
|
64
64
|
|
|
65
65
|
# Disable Ctrl+S flow control (required for Ctrl+S to work in tmux)
|
|
@@ -96,7 +96,7 @@ genie-hsplit() {
|
|
|
96
96
|
bind -x '"eOP":"genie-new-tab"' 2>/dev/null # F1
|
|
97
97
|
bind -x '"eOQ":"genie-vsplit"' 2>/dev/null # F2
|
|
98
98
|
bind -x '"eOR":"genie-hsplit"' 2>/dev/null # F3
|
|
99
|
-
`}function
|
|
99
|
+
`}function X3(){console.log(`
|
|
100
100
|
Warp-like Terminal Shortcuts for tmux + Termux
|
|
101
101
|
|
|
102
102
|
\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510
|
|
@@ -115,17 +115,22 @@ Commands:
|
|
|
115
115
|
term shortcuts --tmux Output tmux.conf snippet
|
|
116
116
|
term shortcuts --termux Output termux.properties snippet
|
|
117
117
|
term shortcuts --install Install to config files
|
|
118
|
-
`)}async function
|
|
119
|
-
`);let B=
|
|
120
|
-
`+
|
|
121
|
-
`+
|
|
122
|
-
`+
|
|
118
|
+
`)}async function z2(D){let F=H6.createInterface({input:process.stdin,output:process.stdout});return new Promise((B)=>{F.question(D,(E)=>{F.close(),B(E.trim().toLowerCase())})})}function nD(D,F){if(!cD(D))return!1;return W6(D,"utf-8").includes(F)}async function v2(){let D=Y6(),F="generated by genie-cli";console.log(`Installing Warp-like shortcuts...
|
|
119
|
+
`);let B=FD(D,".tmux.conf");if(nD(B,"generated by genie-cli"))console.log("\u2713 tmux.conf already has genie shortcuts");else if(await z2(`Add shortcuts to ${B}? [Y/n] `)!=="n"){let Y=`
|
|
120
|
+
`+q6();E3(B,Y),console.log(`\u2705 Added to ${B}`)}else console.log("\u23ED\uFE0F Skipped tmux.conf");let E=cD(FD(D,".zshrc"))?FD(D,".zshrc"):FD(D,".bashrc");if(nD(E,"generated by genie-cli"))console.log(`\u2713 ${E} already has genie shortcuts`);else if(await z2(`Add shell functions to ${E}? [Y/n] `)!=="n"){let Y=`
|
|
121
|
+
`+j7();E3(E,Y),console.log(`\u2705 Added to ${E}`)}else console.log(`\u23ED\uFE0F Skipped ${E}`);let $=FD(D,".termux"),X=FD($,"termux.properties"),J=cD($)||process.env.TERMUX_VERSION;if(J)if(nD(X,"generated by genie-cli"))console.log("\u2713 termux.properties already has genie shortcuts");else if(await z2(`Add extra keys to ${X}? [Y/n] `)!=="n"){if(!cD($))z7($,{recursive:!0});let Y=`
|
|
122
|
+
`+_6();E3(X,Y),console.log(`\u2705 Added to ${X}`),console.log(" Run: termux-reload-settings")}else console.log("\u23ED\uFE0F Skipped termux.properties");if(console.log(`
|
|
123
123
|
\u2705 Installation complete!`),console.log(`
|
|
124
|
-
Next steps:`),console.log(" 1. Reload tmux: tmux source ~/.tmux.conf"),console.log(" 2. Restart your shell or run: source ~/.bashrc"),J)console.log(" 3. Reload Termux: termux-reload-settings")}function
|
|
124
|
+
Next steps:`),console.log(" 1. Reload tmux: tmux source ~/.tmux.conf"),console.log(" 2. Restart your shell or run: source ~/.bashrc"),J)console.log(" 3. Reload Termux: termux-reload-settings")}function Z2(D){return nD(D,"generated by genie-cli")}function $3(D,F){if(!cD(D))return!1;let B=W6(D,"utf-8");if(!B.includes(F))return!1;let E=B.split(`
|
|
125
125
|
`),$=[],X=!1,J=-1;for(let Y=0;Y<E.length;Y++){let W=E[Y];if(W.includes(F)&&!X){if(X=!0,J===-1&&$.length>0&&$[$.length-1].trim()==="")$.pop();continue}if(X){if(W.trim()===""&&Y+1<E.length&&!E[Y+1].includes("genie")){X=!1;continue}if(!(W.includes("genie")||W.includes("Ctrl+")||W.includes("split-window")||W.includes("new-window")||W.includes("stty -ixon")||W.includes("Warp-like")||W.includes("bind-key -n")||W.includes("extra-keys")||W.includes("F1=")||W.includes("bind -x")||W.startsWith("#")&&E[Y-1]?.includes("genie"))&&W.trim()!=="")X=!1,$.push(W);continue}$.push(W)}while($.length>0&&$[$.length-1].trim()==="")$.pop();let Q=$.length>0?$.join(`
|
|
126
126
|
`)+`
|
|
127
|
-
`:"";return
|
|
128
|
-
`);let B=
|
|
127
|
+
`:"";return M7(D,Q),!0}async function G6(){let D=Y6(),F="generated by genie-cli";console.log(`Uninstalling Warp-like shortcuts...
|
|
128
|
+
`);let B=FD(D,".tmux.conf");if(!nD(B,"generated by genie-cli"))console.log("\u2713 tmux.conf has no genie shortcuts");else if(await z2(`Remove shortcuts from ${B}? [Y/n] `)!=="n"){if($3(B,"generated by genie-cli"))console.log(`\u2705 Removed from ${B}`)}else console.log("\u23ED\uFE0F Skipped tmux.conf");let E=FD(D,".zshrc"),$=FD(D,".bashrc");for(let Y of[E,$]){if(!cD(Y))continue;if(!nD(Y,"generated by genie-cli"))console.log(`\u2713 ${Y} has no genie shortcuts`);else if(await z2(`Remove shell functions from ${Y}? [Y/n] `)!=="n"){if($3(Y,"generated by genie-cli"))console.log(`\u2705 Removed from ${Y}`)}else console.log(`\u23ED\uFE0F Skipped ${Y}`)}let X=FD(D,".termux"),J=FD(X,"termux.properties"),Q=cD(X)||process.env.TERMUX_VERSION;if(Q)if(!nD(J,"generated by genie-cli"))console.log("\u2713 termux.properties has no genie shortcuts");else if(await z2(`Remove extra keys from ${J}? [Y/n] `)!=="n"){if($3(J,"generated by genie-cli"))console.log(`\u2705 Removed from ${J}`),console.log(" Run: termux-reload-settings")}else console.log("\u23ED\uFE0F Skipped termux.properties");if(console.log(`
|
|
129
129
|
\u2705 Uninstallation complete!`),console.log(`
|
|
130
|
-
Next steps:`),console.log(" 1. Reload tmux: tmux source ~/.tmux.conf"),console.log(" 2. Restart your shell or run: source ~/.bashrc"),Q)console.log(" 3. Reload Termux: termux-reload-settings")}async function
|
|
131
|
-
`);let B=Y7("bash",["-c",D],{stdio:"inherit",env:{...process.env,FORCE_COLOR:"1"}});B.on("close",(E)=>{F(E===0)}),B.on("error",(E)=>{console.error(`\x1B[31mError: ${E.message}\x1B[0m`),F(!1)})})}function _7(){console.log(),console.log("\x1B[1m\uD83D\uDD27 Genie Prerequisites Check\x1B[0m"),console.log()}function G7(D){let F=D.os==="macos"?"macOS":"Linux";if(D.linuxDistro&&D.linuxDistro!=="unknown")F=`Linux (${S8(D.linuxDistro)})`;console.log(`System: ${F} (${D.arch})`),console.log(`Package Manager: ${D.preferredPM==="none"?"none detected":D.preferredPM}`),console.log()}function A7(D){console.log("Checking prerequisites..."),console.log();for(let F of D)if(F.installed){let B=F.version?` ${F.version}`:"",E=F.path?`\x1B[2m (${F.path})\x1B[0m`:"";console.log(` \x1B[32m\u2705\x1B[0m ${F.name}${B}${E}`)}else if(F.required)console.log(` \x1B[31m\u274C\x1B[0m ${F.name} \x1B[31mnot found\x1B[0m`);else console.log(` \x1B[33m\u26A0\uFE0F\x1B[0m ${F.name} \x1B[33mnot found\x1B[0m \x1B[2m(optional)\x1B[0m`);console.log()}function D0(){console.log("\x1B[2m"+"\u2500".repeat(40)+"\x1B[0m"),console.log()}async function M7(D,F,B){let E=D.required?"\x1B[31mrequired\x1B[0m":"\x1B[2moptional, recommended\x1B[0m";if(!F)return console.log(`\x1B[33mManual installation required for\x1B[0m ${D.name} (${E})`),console.log(` ${JF(D.name)}`),console.log(),"skipped";console.log(`Install \x1B[1m${D.name}\x1B[0m? (${E})`),console.log(` Command: \x1B[36m${F}\x1B[0m`);let $;if(B.yes)$=!0,console.log("\x1B[2mAuto-approved with --yes\x1B[0m");else $=await p({message:"Proceed",default:D.required});if(!$)return console.log(`\x1B[33mSkipped: ${D.name}\x1B[0m`),console.log(),"skipped";if(console.log(),console.log(`Installing ${D.name}...`),console.log(),await q7(F)){let J=await d(D.name);if(J.exists){let Q=J.version?` ${J.version}`:"";return console.log(),console.log(`\x1B[32m\u2705 ${D.name}${Q} installed\x1B[0m`),console.log(),"installed"}else return console.log(),console.log(`\x1B[33m\u26A0\uFE0F ${D.name} installed but not found in PATH\x1B[0m`),console.log("\x1B[2m You may need to restart your shell or source your profile\x1B[0m"),console.log(),"installed"}else return console.log(),console.log(`\x1B[31m\u274C Failed to install ${D.name}\x1B[0m`),console.log(`\x1B[2m ${JF(D.name)}\x1B[0m`),console.log(),"failed"}async function QF(D){if(mD()){console.log("\x1B[2m\u2713 Genie hooks already configured (~/.genie/config.json)\x1B[0m"),console.log(" Run \x1B[36mgenie setup\x1B[0m to reconfigure."),console.log();return}console.log(),D0(),console.log("\x1B[1m\uD83E\uDDDE Configure Genie Hooks?\x1B[0m"),console.log(),console.log("\x1B[2mHooks let you control how AI tools execute - without wasting tokens!\x1B[0m"),console.log('\x1B[2mFor example, the "collaborative" hook routes all bash commands through\x1B[0m'),console.log("\x1B[2mtmux so you can watch the AI work in real-time.\x1B[0m"),console.log();let F;if(D.yes)F=!0,console.log("\x1B[2mAuto-approved with --yes\x1B[0m");else F=await p({message:"Would you like to configure genie hooks now?",default:!0});if(F)console.log(),await e2();else console.log(),console.log("\x1B[2mSkipped. Run \x1B[0m\x1B[36mgenie setup\x1B[0m\x1B[2m anytime to configure hooks.\x1B[0m"),console.log()}async function YF(D){_7();let F=await w8();G7(F);let B=await u8();A7(B);let E=B.filter((H)=>!H.installed),$=E.filter((H)=>H.required),X=E.filter((H)=>!H.required);if(E.length===0){console.log("\x1B[32m\u2705 All prerequisites are installed!\x1B[0m"),console.log(),await QF(D),console.log("Run \x1B[36mterm --help\x1B[0m or \x1B[36mclaudio --help\x1B[0m to get started."),console.log();return}if(console.log(`Missing: ${$.length} required, ${X.length} optional`),console.log(),D.check){if($.length>0)console.log("\x1B[31m\u274C Missing required prerequisites\x1B[0m"),console.log("Run \x1B[36mgenie install\x1B[0m to install them."),process.exit(1);return}D0();let J={installed:[],skipped:[],failed:[]};for(let H of E){let A=H7(H.name,F.preferredPM),V=await M7(H,A,D);if(V==="installed")J.installed.push(H.name);else if(V==="skipped")J.skipped.push(H.name);else J.failed.push(H.name);if(H!==E[E.length-1])D0()}D0(),console.log("\x1B[1mSummary:\x1B[0m");let Q=J.installed.filter((H)=>$.some((A)=>A.name===H)),Y=J.failed.filter((H)=>$.some((A)=>A.name===H)),W=J.skipped.filter((H)=>X.some((A)=>A.name===H));if(Y.length>0)console.log(`\x1B[31m \u274C ${Y.length} required failed: ${Y.join(", ")}\x1B[0m`);else if(Q.length>0||$.length===0)console.log("\x1B[32m \u2705 All required prerequisites installed\x1B[0m");if(J.installed.length>0)console.log(`\x1B[32m \u2705 Installed: ${J.installed.join(", ")}\x1B[0m`);if(W.length>0)console.log(`\x1B[33m \u26A0\uFE0F ${W.length} optional skipped: ${W.join(", ")}\x1B[0m`);if(console.log(),Y.length===0)await QF(D),console.log("Run \x1B[36mterm --help\x1B[0m or \x1B[36mclaudio --help\x1B[0m to get started.");else console.log("\x1B[31mSome required prerequisites could not be installed.\x1B[0m"),console.log("Please install them manually and run this command again."),process.exit(1);console.log()}import{spawn as qF}from"child_process";import{existsSync as _F}from"fs";import{mkdir as WF,copyFile as GF,chmod as U7}from"fs/promises";import{join as jD}from"path";import{homedir as AF}from"os";var MF=process.env.GENIE_HOME||jD(AF(),".genie"),OD=jD(MF,"src"),t0=jD(MF,"bin"),e0=jD(AF(),".local","bin");function wD(D){console.log(`\x1B[32m\u25B8\x1B[0m ${D}`)}function v2(D){console.log(`\x1B[32m\u2714\x1B[0m ${D}`)}function zD(D){console.log(`\x1B[31m\u2716\x1B[0m ${D}`)}async function M2(D,F,B){return new Promise((E)=>{let $=[],X=qF(D,F,{cwd:B,stdio:["inherit","pipe","pipe"],env:{...process.env,FORCE_COLOR:"1"}});X.stdout?.on("data",(J)=>{let Q=J.toString();$.push(Q),process.stdout.write(Q)}),X.stderr?.on("data",(J)=>{let Q=J.toString();$.push(Q),process.stderr.write(Q)}),X.on("close",(J)=>{E({success:J===0,output:$.join("")})}),X.on("error",(J)=>{zD(J.message),E({success:!1,output:J.message})})})}async function HF(D){try{let F=await Z2("git",["rev-parse","--abbrev-ref","HEAD"],D),B=await Z2("git",["rev-parse","--short","HEAD"],D),E=await Z2("git",["log","-1","--format=%ci"],D);if(F.success&&B.success&&E.success)return{branch:F.output.trim(),commit:B.output.trim(),commitDate:E.output.trim().split(" ")[0]}}catch{}return null}async function Z2(D,F,B){return new Promise((E)=>{let $=[],X=qF(D,F,{cwd:B,stdio:["inherit","pipe","pipe"]});X.stdout?.on("data",(J)=>{$.push(J.toString())}),X.stderr?.on("data",(J)=>{$.push(J.toString())}),X.on("close",(J)=>{E({success:J===0,output:$.join("")})}),X.on("error",(J)=>{E({success:!1,output:J.message})})})}async function z7(){if(mD())try{let F=await UD();if(F.installMethod)return F.installMethod}catch{}if(_F(jD(OD,".git")))return"source";let D=await Z2("which",["genie"]);if(D.success){let F=D.output.trim();if(F.includes(".bun"))return"bun";if(F.includes("node_modules"))return"npm";if(F===jD(e0,"genie")||F.startsWith(t0))return"source";return(await Z2("which",["bun"])).success?"bun":"npm"}return"unknown"}async function j7(){if(wD("Updating via bun..."),!(await M2("bun",["install","-g","@automagik/genie@latest"])).success)zD("Failed to update via bun"),process.exit(1);console.log(),v2("Genie CLI updated!")}async function C7(){if(wD("Updating via npm..."),!(await M2("npm",["install","-g","@automagik/genie@latest"])).success)zD("Failed to update via npm"),process.exit(1);console.log(),v2("Genie CLI updated!")}async function R7(){let D=await HF(OD);if(D)console.log(`Current: \x1B[2m${D.branch}@${D.commit} (${D.commitDate})\x1B[0m`),console.log();if(wD("Fetching latest changes..."),!(await M2("git",["fetch","origin"],OD)).success)zD("Failed to fetch from origin"),process.exit(1);if(wD("Resetting to origin/main..."),!(await M2("git",["reset","--hard","origin/main"],OD)).success)zD("Failed to reset to origin/main"),process.exit(1);console.log();let E=await HF(OD);if(D&&E&&D.commit===E.commit){v2("Already up to date!"),console.log();return}if(wD("Installing dependencies..."),!(await M2("bun",["install"],OD)).success)zD("Failed to install dependencies"),process.exit(1);if(console.log(),wD("Building..."),!(await M2("bun",["run","build"],OD)).success)zD("Failed to build"),process.exit(1);console.log(),wD("Installing binaries...");try{await WF(t0,{recursive:!0}),await WF(e0,{recursive:!0});let J=["genie.js","term.js","claudio.js"],Q=["genie","term","claudio"];for(let Y=0;Y<J.length;Y++){let W=jD(OD,"dist",J[Y]),H=jD(t0,J[Y]),A=jD(e0,Q[Y]);await GF(W,H),await U7(H,493),await V7(H,A)}v2("Binaries installed")}catch(J){zD(`Failed to install binaries: ${J}`),process.exit(1)}if(console.log(),console.log("\x1B[2m\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\x1B[0m"),v2("Genie CLI updated successfully!"),console.log(),E)console.log(`Version: \x1B[36m${E.branch}@${E.commit}\x1B[0m (${E.commitDate})`),console.log()}async function V7(D,F){let{symlink:B,unlink:E}=await import("fs/promises");try{if(_F(F))await E(F);await B(D,F)}catch{await GF(D,F)}}async function UF(){console.log(),console.log("\x1B[1m\uD83E\uDDDE Genie CLI Update\x1B[0m"),console.log("\x1B[2m\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\x1B[0m"),console.log();let D=await z7();if(wD(`Detected installation: ${D}`),console.log(),D==="unknown")zD("No Genie CLI installation found"),console.log(),console.log("Install method not configured. Please reinstall genie:"),console.log("\x1B[36m curl -fsSL https://raw.githubusercontent.com/namastexlabs/genie-cli/main/install.sh | bash\x1B[0m"),console.log(),process.exit(1);switch(D){case"source":await R7();break;case"bun":await j7();break;case"npm":await C7();break}}import{existsSync as SF,rmSync as b7,unlinkSync as T7,lstatSync as P7}from"fs";import{homedir as k7}from"os";import{join as B3}from"path";import{existsSync as $0,mkdirSync as K7,readFileSync as L7,writeFileSync as N7,unlinkSync as O7}from"fs";import{homedir as jF}from"os";import{join as X0}from"path";var B0=X0(jF(),".claude"),w7=X0(B0,"hooks"),E0=X0(B0,"settings.json"),u7=C.object({type:C.literal("command"),command:C.string(),timeout:C.number().optional()}).passthrough(),zF=C.object({matcher:C.string(),hooks:C.array(u7)}).passthrough(),S7=C.object({PreToolUse:C.array(zF).optional(),PostToolUse:C.array(zF).optional()}).passthrough(),F0=C.object({model:C.string().optional(),enabledPlugins:C.record(C.unknown()).optional(),hooks:S7.optional()}).passthrough(),D3="genie-bash-hook.sh",CF="Bash";function RF(){return E0}function VF(){return X0(w7,D3)}function I7(){if(!$0(B0))K7(B0,{recursive:!0})}async function KF(){if(!$0(E0))return F0.parse({});try{let D=L7(E0,"utf-8"),F=JSON.parse(D);return F0.parse(F)}catch(D){return console.warn(`Warning: Invalid Claude settings, using defaults: ${D.message}`),F0.parse({})}}async function LF(D){I7();try{let F=F0.parse(D),B=JSON.stringify(F,null,2);N7(E0,B,"utf-8")}catch(F){throw Error(`Failed to save Claude settings: ${F.message}`)}}function NF(D){let F=D.hooks?.PreToolUse;if(!F||!Array.isArray(F))return!1;return F.some((B)=>{if(B.matcher!==CF)return!1;if(!Array.isArray(B.hooks))return!1;return B.hooks.some((E)=>E.type==="command"&&E.command?.includes(D3))})}function OF(D){if(!D.hooks?.PreToolUse)return D;if(D.hooks.PreToolUse=D.hooks.PreToolUse.filter((F)=>{if(F.matcher!==CF)return!0;if(!Array.isArray(F.hooks))return!0;return!F.hooks.some((E)=>E.type==="command"&&E.command?.includes(D3))}),D.hooks.PreToolUse.length===0)delete D.hooks.PreToolUse;if(D.hooks&&Object.keys(D.hooks).length===0)delete D.hooks;return D}function wF(){return $0(VF())}function uF(){let D=VF();if($0(D))O7(D)}function F3(D){let F=jF();if(D.startsWith(F+"/"))return"~"+D.slice(F.length);if(D===F)return"~";return D}var IF=B3(k7(),".local","bin"),bF=["genie","term","claudio"];function TF(D){try{if(!SF(D))return!1;if(!P7(D).isSymbolicLink())return!1;return!0}catch{return!1}}function v7(){let D=[];for(let F of bF){let B=B3(IF,F);if(TF(B))try{T7(B),D.push(F)}catch{}}return D}async function PF(){console.log(),console.log("\x1B[1m\x1B[33m Uninstall Genie CLI\x1B[0m"),console.log();let D=d8(),F=SF(D),B=wF(),E=await KF(),$=NF(E),X=bF.filter((Q)=>TF(B3(IF,Q)));if(console.log("\x1B[2mThis will remove:\x1B[0m"),$)console.log(" \x1B[31m-\x1B[0m Hook registration from Claude Code");if(B)console.log(" \x1B[31m-\x1B[0m Hook script (~/.claude/hooks/genie-bash-hook.sh)");if(F)console.log(" \x1B[31m-\x1B[0m Genie directory ("+b2(D)+")");if(X.length>0)console.log(" \x1B[31m-\x1B[0m Symlinks from ~/.local/bin: "+X.join(", "));if(console.log(),!F&&!B&&!$&&X.length===0){console.log("\x1B[33mNothing to uninstall.\x1B[0m"),console.log();return}if(!await p({message:"Are you sure you want to uninstall Genie CLI?",default:!1})){console.log(),console.log("\x1B[2mUninstall cancelled.\x1B[0m"),console.log();return}if(console.log(),$){console.log("\x1B[2mRemoving hook from Claude Code...\x1B[0m");try{let Q=OF(E);await LF(Q),console.log(" \x1B[32m+\x1B[0m Hook unregistered")}catch(Q){console.log(" \x1B[33m!\x1B[0m Could not unregister hook: "+Q.message)}}if(B){console.log("\x1B[2mRemoving hook script...\x1B[0m");try{uF(),console.log(" \x1B[32m+\x1B[0m Hook script removed")}catch(Q){console.log(" \x1B[33m!\x1B[0m Could not remove hook script: "+Q.message)}}if(X.length>0){console.log("\x1B[2mRemoving symlinks...\x1B[0m");let Q=v7();if(Q.length>0)console.log(" \x1B[32m+\x1B[0m Removed: "+Q.join(", "))}if(F){console.log("\x1B[2mRemoving genie directory...\x1B[0m");try{b7(D,{recursive:!0,force:!0}),console.log(" \x1B[32m+\x1B[0m Directory removed")}catch(Q){console.log(" \x1B[33m!\x1B[0m Could not remove directory: "+Q.message)}}console.log(),console.log("\x1B[32m+\x1B[0m Genie CLI uninstalled."),console.log(),console.log("\x1B[2mNote: If you installed via npm/bun, also run:\x1B[0m"),console.log(" \x1B[36mbun remove -g @automagik/genie\x1B[0m"),console.log(" \x1B[2mor\x1B[0m"),console.log(" \x1B[36mnpm uninstall -g @automagik/genie\x1B[0m"),console.log()}var{$:kF}=globalThis.Bun;import{existsSync as Z7}from"fs";function E3(D){console.log(),console.log(`\x1B[1m${D}:\x1B[0m`)}function $3(D){let B={pass:"\x1B[32m\u2713\x1B[0m",fail:"\x1B[31m\u2717\x1B[0m",warn:"\x1B[33m!\x1B[0m"}[D.status],E=D.message?` ${D.message}`:"";if(console.log(` ${B} ${D.name}${E}`),D.suggestion)console.log(` \x1B[2m${D.suggestion}\x1B[0m`)}async function f7(){let D=[],F=await d("tmux");if(F.exists)D.push({name:"tmux",status:"pass",message:F.version||""});else D.push({name:"tmux",status:"fail",suggestion:"Install with: brew install tmux (or apt install tmux)"});let B=await d("jq");if(B.exists)D.push({name:"jq",status:"pass",message:B.version||""});else D.push({name:"jq",status:"fail",suggestion:"Install with: brew install jq (or apt install jq)"});let E=await d("bun");if(E.exists)D.push({name:"bun",status:"pass",message:E.version||""});else D.push({name:"bun",status:"fail",suggestion:"Install with: curl -fsSL https://bun.sh/install | bash"});let $=await d("claude");if($.exists)D.push({name:"Claude Code",status:"pass",message:$.version||""});else D.push({name:"Claude Code",status:"warn",suggestion:"Install with: npm install -g @anthropic-ai/claude-code"});return D}async function x7(){let D=[];if(mD())D.push({name:"Genie config exists",status:"pass",message:F3(I2())});else D.push({name:"Genie config exists",status:"warn",message:"not found",suggestion:"Run: genie setup"});if(i8())D.push({name:"Setup complete",status:"pass"});else D.push({name:"Setup complete",status:"warn",message:"not completed",suggestion:"Run: genie setup"});let F=RF();if(Z7(F))D.push({name:"Claude settings exists",status:"pass",message:F3(F)});else D.push({name:"Claude settings exists",status:"warn",message:"not found",suggestion:"Claude Code creates this on first run"});return D}async function y7(){let D=[];try{if((await kF`tmux list-sessions 2>/dev/null`.quiet()).exitCode===0)D.push({name:"Server running",status:"pass"});else return D.push({name:"Server running",status:"warn",message:"no sessions",suggestion:"Start with: tmux new-session -d -s genie"}),D}catch{return D.push({name:"Server running",status:"warn",message:"could not check"}),D}let B=(await UD()).session.name;try{if((await kF`tmux has-session -t ${B} 2>/dev/null`.quiet()).exitCode===0)D.push({name:`Session '${B}' exists`,status:"pass"});else D.push({name:`Session '${B}' exists`,status:"warn",suggestion:`Start with: tmux new-session -d -s ${B}`})}catch{D.push({name:`Session '${B}' exists`,status:"warn",message:"could not check"})}try{if((await d("term")).exists)D.push({name:"term command available",status:"pass"});else D.push({name:"term command available",status:"fail",suggestion:"Ensure genie-cli is properly installed"})}catch{D.push({name:"term command available",status:"warn",message:"could not check"})}return D}async function vF(){console.log(),console.log("\x1B[1mGenie Doctor\x1B[0m"),console.log("\x1B[2m"+"\u2500".repeat(40)+"\x1B[0m");let D=!1,F=!1;E3("Prerequisites");let B=await f7();for(let X of B){if($3(X),X.status==="fail")D=!0;if(X.status==="warn")F=!0}E3("Configuration");let E=await x7();for(let X of E){if($3(X),X.status==="fail")D=!0;if(X.status==="warn")F=!0}E3("Tmux");let $=await y7();for(let X of $){if($3(X),X.status==="fail")D=!0;if(X.status==="warn")F=!0}if(console.log(),console.log("\x1B[2m"+"\u2500".repeat(40)+"\x1B[0m"),D)console.log("\x1B[31mSome checks failed.\x1B[0m Run \x1B[36mgenie setup\x1B[0m to fix.");else if(F)console.log("\x1B[33mSome warnings detected.\x1B[0m Everything should still work.");else console.log("\x1B[32mAll checks passed!\x1B[0m");if(console.log(),D)process.exit(1)}import{homedir as h7}from"os";import{join as X3}from"path";import{existsSync as g7}from"fs";async function J3(){s0();let D=h7(),F=X3(D,".tmux.conf"),B=X3(D,".zshrc"),E=X3(D,".bashrc");if(console.log("Installation status:"),P2(F))console.log(" \x1B[32m\u2713\x1B[0m tmux.conf");else console.log(" \x1B[33m-\x1B[0m tmux.conf");let $=g7(B)?B:E;if(P2($))console.log(` \x1B[32m\u2713\x1B[0m ${$.replace(D,"~")}`);else console.log(` \x1B[33m-\x1B[0m ${$.replace(D,"~")}`);console.log(),console.log("Run \x1B[36mgenie shortcuts install\x1B[0m to install shortcuts."),console.log("Run \x1B[36mgenie shortcuts uninstall\x1B[0m to remove shortcuts."),console.log()}async function ZF(){await T2()}async function fF(){await FF()}var uD=new L3;uD.name("genie").description("Genie CLI - Setup and utilities for AI-assisted development").version(N3);uD.command("install").description("Verify and install prerequisites").option("--check","Only check prerequisites, do not install").option("--yes","Auto-approve all installations").action(YF);uD.command("setup").description("Configure genie settings").option("--quick","Accept all defaults").option("--shortcuts","Only configure keyboard shortcuts").option("--claudio","Only configure Claudio integration").option("--terminal","Only configure terminal defaults").option("--session","Only configure session settings").option("--reset","Reset configuration to defaults").option("--show","Show current configuration").action(async(D)=>{await e2(D)});uD.command("doctor").description("Run diagnostic checks on genie installation").action(vF);uD.command("update").description("Update Genie CLI to the latest version").action(UF);uD.command("uninstall").description("Remove Genie CLI and clean up hooks").action(PF);var J0=uD.command("shortcuts").description("Manage tmux keyboard shortcuts");J0.action(J3);J0.command("show").description("Show available shortcuts and installation status").action(J3);J0.command("install").description("Install shortcuts to config files (~/.tmux.conf, shell rc)").action(ZF);J0.command("uninstall").description("Remove shortcuts from config files").action(fF);uD.parse();
|
|
130
|
+
Next steps:`),console.log(" 1. Reload tmux: tmux source ~/.tmux.conf"),console.log(" 2. Restart your shell or run: source ~/.bashrc"),Q)console.log(" 3. Reload Termux: termux-reload-settings")}async function TE(D){if(D.tmux)console.log(q6());else if(D.termux)console.log(_6());else if(D.install)await v2();else X3()}import{homedir as V7}from"os";import{join as R7}from"path";function f2(){console.log(),console.log("\x1B[1m\x1B[36m"+"=".repeat(64)+"\x1B[0m"),console.log("\x1B[1m\x1B[36m Genie Setup Wizard\x1B[0m"),console.log("\x1B[1m\x1B[36m"+"=".repeat(64)+"\x1B[0m"),console.log()}function iD(D,F){if(console.log(),console.log("\x1B[1m"+D+"\x1B[0m"),F)console.log("\x1B[2m"+F+"\x1B[0m");console.log()}async function K7(){iD("1. Prerequisites Check","Checking required tools...");let D=[{name:"tmux",required:!0},{name:"bun",required:!0},{name:"claude",required:!1,displayName:"Claude Code CLI"},{name:"jq",required:!1}];for(let F of D){let B=await n(F.name),E=F.displayName||F.name;if(B.exists)console.log(` \x1B[32m\u2713\x1B[0m ${E} ${B.version?`(${B.version})`:""}`);else if(F.required)console.log(` \x1B[31m\u2717\x1B[0m ${E} \x1B[2m(required)\x1B[0m`);else console.log(` \x1B[33m!\x1B[0m ${E} \x1B[2m(optional)\x1B[0m`)}}async function A6(D,F){if(iD("2. Session Configuration","Configure tmux session settings"),F)return console.log(` Using defaults: session="${D.session.name}", window="${D.session.defaultWindow}"`),D;let B=await fD({message:"Session name:",default:D.session.name}),E=await fD({message:"Default window name:",default:D.session.defaultWindow}),$=await c({message:"Auto-create session on connect?",default:D.session.autoCreate});return D.session={name:B,defaultWindow:E,autoCreate:$},D}async function U6(D,F){if(iD("3. Terminal Defaults","Configure default values for term commands"),F)return console.log(` Using defaults: timeout=${D.terminal.execTimeout}ms, lines=${D.terminal.readLines}`),D;let B=await fD({message:"Exec timeout (milliseconds):",default:String(D.terminal.execTimeout),validate:(X)=>{let J=parseInt(X,10);return!isNaN(J)&&J>0?!0:"Must be a positive number"}}),E=await fD({message:"Read lines (default for term read):",default:String(D.terminal.readLines),validate:(X)=>{let J=parseInt(X,10);return!isNaN(J)&&J>0?!0:"Must be a positive number"}}),$=await fD({message:"Worktree base directory:",default:D.terminal.worktreeBase});return D.terminal={execTimeout:parseInt(B,10),readLines:parseInt(E,10),worktreeBase:$},D}async function M6(D,F){iD("4. Keyboard Shortcuts","Warp-like tmux shortcuts for quick navigation");let B=V7(),E=R7(B,".tmux.conf");if(Z2(E))return console.log(" \x1B[32m\u2713\x1B[0m Tmux shortcuts already installed"),D.shortcuts.tmuxInstalled=!0,D;if(console.log(" Available shortcuts:"),console.log(" \x1B[36mCtrl+T\x1B[0m \u2192 New tab (window)"),console.log(" \x1B[36mCtrl+S\x1B[0m \u2192 Vertical split"),console.log(" \x1B[36mCtrl+H\x1B[0m \u2192 Horizontal split"),console.log(),F)return console.log(" Skipped in quick mode. Run \x1B[36mgenie setup --shortcuts\x1B[0m to install."),D;if(await c({message:"Install tmux keyboard shortcuts?",default:!1}))console.log(),await v2(),D.shortcuts.tmuxInstalled=!0,await Q6({tmuxInstalled:!0});else console.log(" Skipped. Run \x1B[36mgenie shortcuts install\x1B[0m later.");return D}async function z6(D,F){if(iD("5. Claudio Integration","LLM router profile management"),!(await n("claude")).exists)return console.log(" \x1B[33m!\x1B[0m Claude Code CLI not found. Skipping claudio integration."),D;if(F)return console.log(" Skipped in quick mode. Run \x1B[36mclaudio setup\x1B[0m to configure."),D;if(await c({message:"Configure Claudio API profiles?",default:!1}))D.claudio={enabled:!0},console.log(),console.log(" Run \x1B[36mclaudio setup\x1B[0m to configure API profiles.");else console.log(" Skipped. Run \x1B[36mclaudio setup\x1B[0m later.");return D}async function C7(D,F){if(iD("6. Debug Options","Logging and debugging settings"),F)return console.log(" Using defaults: tmuxDebug=false, verbose=false"),D;let B=await c({message:"Enable tmux debug logging?",default:D.logging.tmuxDebug}),E=await c({message:"Enable verbose mode?",default:D.logging.verbose});return D.logging={tmuxDebug:B,verbose:E},D}async function L7(D){iD("Summary","Configuration will be saved to "+k2(I2())),console.log(` Session: \x1B[36m${D.session.name}\x1B[0m (window: ${D.session.defaultWindow})`),console.log(` Terminal: timeout=${D.terminal.execTimeout}ms, lines=${D.terminal.readLines}`),console.log(` Shortcuts: ${D.shortcuts.tmuxInstalled?"\x1B[32minstalled\x1B[0m":"\x1B[2mnot installed\x1B[0m"}`),console.log(` Claudio: ${D.claudio?.enabled?"\x1B[32menabled\x1B[0m":"\x1B[2mnot configured\x1B[0m"}`),console.log(` Debug: tmux=${D.logging.tmuxDebug}, verbose=${D.logging.verbose}`),console.log(),D.setupComplete=!0,D.lastSetupAt=new Date().toISOString(),await bD(D),console.log("\x1B[32m\u2713 Configuration saved!\x1B[0m")}async function N7(){let D=await VD();console.log(),console.log("\x1B[1mCurrent Genie Configuration\x1B[0m"),console.log("\x1B[2m"+k2(I2())+"\x1B[0m"),console.log(),console.log(JSON.stringify(D,null,2)),console.log()}function O7(){console.log(),console.log("\x1B[1mNext Steps:\x1B[0m"),console.log(),console.log(" Start a session: \x1B[36mclaudio launch\x1B[0m"),console.log(" Watch AI work: \x1B[36mtmux attach -t genie\x1B[0m"),console.log(" Check health: \x1B[36mgenie doctor\x1B[0m"),console.log()}async function B0(D={}){if(D.show){await N7();return}if(D.reset){await J6(),console.log("\x1B[32m\u2713 Configuration reset to defaults.\x1B[0m"),console.log();return}let F=await VD();if(D.shortcuts){f2(),await M6(F,!1),await B3();return}if(D.terminal){f2(),F=await U6(F,!1),await bD(F),console.log("\x1B[32m\u2713 Terminal configuration saved.\x1B[0m");return}if(D.session){f2(),F=await A6(F,!1),await bD(F),console.log("\x1B[32m\u2713 Session configuration saved.\x1B[0m");return}if(D.claudio){f2(),await z6(F,!1),await B3();return}let B=D.quick??!1;if(f2(),B)console.log("\x1B[2mQuick mode: accepting all defaults\x1B[0m");await K7(),F=await A6(F,B),F=await U6(F,B),F=await M6(F,B),F=await z6(F,B),F=await C7(F,B),await L7(F),O7()}var S7={tmux:{brew:"brew install tmux",apt:"sudo apt update && sudo apt install -y tmux",dnf:"sudo dnf install -y tmux",yum:"sudo yum install -y tmux",pacman:"sudo pacman -S --noconfirm tmux",none:null},bun:{all:"curl -fsSL https://bun.sh/install | bash"},claude:{all:"npm install -g @anthropic-ai/claude-code"}};function b7(D,F){let B=S7[D];if(!B)return null;if(B.all)return B.all;if(F!=="none"&&B[F])return B[F];if(B.none!==void 0)return B.none;return null}function j6(D){switch(D){case"tmux":return"Visit https://github.com/tmux/tmux/wiki/Installing for installation instructions";case"bun":return"Visit https://bun.sh for installation instructions";case"claude":return"Run: npm install -g @anthropic-ai/claude-code (requires Node.js/npm)";default:return`Search for "${D} install" for installation instructions`}}async function u7(D){return new Promise((F)=>{console.log(`\x1B[2m$ ${D}\x1B[0m
|
|
131
|
+
`);let B=w7("bash",["-c",D],{stdio:"inherit",env:{...process.env,FORCE_COLOR:"1"}});B.on("close",(E)=>{F(E===0)}),B.on("error",(E)=>{console.error(`\x1B[31mError: ${E.message}\x1B[0m`),F(!1)})})}function T7(){console.log(),console.log("\x1B[1m\uD83D\uDD27 Genie Prerequisites Check\x1B[0m"),console.log()}function P7(D){let F=D.os==="macos"?"macOS":"Linux";if(D.linuxDistro&&D.linuxDistro!=="unknown")F=`Linux (${g8(D.linuxDistro)})`;console.log(`System: ${F} (${D.arch})`),console.log(`Package Manager: ${D.preferredPM==="none"?"none detected":D.preferredPM}`),console.log()}function I7(D){console.log("Checking prerequisites..."),console.log();for(let F of D)if(F.installed){let B=F.version?` ${F.version}`:"",E=F.path?`\x1B[2m (${F.path})\x1B[0m`:"";console.log(` \x1B[32m\u2705\x1B[0m ${F.name}${B}${E}`)}else if(F.required)console.log(` \x1B[31m\u274C\x1B[0m ${F.name} \x1B[31mnot found\x1B[0m`);else console.log(` \x1B[33m\u26A0\uFE0F\x1B[0m ${F.name} \x1B[33mnot found\x1B[0m \x1B[2m(optional)\x1B[0m`);console.log()}function E0(){console.log("\x1B[2m"+"\u2500".repeat(40)+"\x1B[0m"),console.log()}async function k7(D,F,B){let E=D.required?"\x1B[31mrequired\x1B[0m":"\x1B[2moptional, recommended\x1B[0m";if(!F)return console.log(`\x1B[33mManual installation required for\x1B[0m ${D.name} (${E})`),console.log(` ${j6(D.name)}`),console.log(),"skipped";console.log(`Install \x1B[1m${D.name}\x1B[0m? (${E})`),console.log(` Command: \x1B[36m${F}\x1B[0m`);let $;if(B.yes)$=!0,console.log("\x1B[2mAuto-approved with --yes\x1B[0m");else $=await c({message:"Proceed",default:D.required});if(!$)return console.log(`\x1B[33mSkipped: ${D.name}\x1B[0m`),console.log(),"skipped";if(console.log(),console.log(`Installing ${D.name}...`),console.log(),await u7(F)){let J=await n(D.name);if(J.exists){let Q=J.version?` ${J.version}`:"";return console.log(),console.log(`\x1B[32m\u2705 ${D.name}${Q} installed\x1B[0m`),console.log(),"installed"}else return console.log(),console.log(`\x1B[33m\u26A0\uFE0F ${D.name} installed but not found in PATH\x1B[0m`),console.log("\x1B[2m You may need to restart your shell or source your profile\x1B[0m"),console.log(),"installed"}else return console.log(),console.log(`\x1B[31m\u274C Failed to install ${D.name}\x1B[0m`),console.log(`\x1B[2m ${j6(D.name)}\x1B[0m`),console.log(),"failed"}async function V6(D){if(dD()){console.log("\x1B[2m\u2713 Genie hooks already configured (~/.genie/config.json)\x1B[0m"),console.log(" Run \x1B[36mgenie setup\x1B[0m to reconfigure."),console.log();return}console.log(),E0(),console.log("\x1B[1m\uD83E\uDDDE Configure Genie Hooks?\x1B[0m"),console.log(),console.log("\x1B[2mHooks let you control how AI tools execute - without wasting tokens!\x1B[0m"),console.log('\x1B[2mFor example, the "collaborative" hook routes all bash commands through\x1B[0m'),console.log("\x1B[2mtmux so you can watch the AI work in real-time.\x1B[0m"),console.log();let F;if(D.yes)F=!0,console.log("\x1B[2mAuto-approved with --yes\x1B[0m");else F=await c({message:"Would you like to configure genie hooks now?",default:!0});if(F)console.log(),await B0();else console.log(),console.log("\x1B[2mSkipped. Run \x1B[0m\x1B[36mgenie setup\x1B[0m\x1B[2m anytime to configure hooks.\x1B[0m"),console.log()}async function R6(D){T7();let F=await y8();P7(F);let B=await h8();I7(B);let E=B.filter((H)=>!H.installed),$=E.filter((H)=>H.required),X=E.filter((H)=>!H.required);if(E.length===0){console.log("\x1B[32m\u2705 All prerequisites are installed!\x1B[0m"),console.log(),await V6(D),console.log("Run \x1B[36mterm --help\x1B[0m or \x1B[36mclaudio --help\x1B[0m to get started."),console.log();return}if(console.log(`Missing: ${$.length} required, ${X.length} optional`),console.log(),D.check){if($.length>0)console.log("\x1B[31m\u274C Missing required prerequisites\x1B[0m"),console.log("Run \x1B[36mgenie install\x1B[0m to install them."),process.exit(1);return}E0();let J={installed:[],skipped:[],failed:[]};for(let H of E){let _=b7(H.name,F.preferredPM),j=await k7(H,_,D);if(j==="installed")J.installed.push(H.name);else if(j==="skipped")J.skipped.push(H.name);else J.failed.push(H.name);if(H!==E[E.length-1])E0()}E0(),console.log("\x1B[1mSummary:\x1B[0m");let Q=J.installed.filter((H)=>$.some((_)=>_.name===H)),Y=J.failed.filter((H)=>$.some((_)=>_.name===H)),W=J.skipped.filter((H)=>X.some((_)=>_.name===H));if(Y.length>0)console.log(`\x1B[31m \u274C ${Y.length} required failed: ${Y.join(", ")}\x1B[0m`);else if(Q.length>0||$.length===0)console.log("\x1B[32m \u2705 All required prerequisites installed\x1B[0m");if(J.installed.length>0)console.log(`\x1B[32m \u2705 Installed: ${J.installed.join(", ")}\x1B[0m`);if(W.length>0)console.log(`\x1B[33m \u26A0\uFE0F ${W.length} optional skipped: ${W.join(", ")}\x1B[0m`);if(console.log(),Y.length===0)await V6(D),console.log("Run \x1B[36mterm --help\x1B[0m or \x1B[36mclaudio --help\x1B[0m to get started.");else console.log("\x1B[31mSome required prerequisites could not be installed.\x1B[0m"),console.log("Please install them manually and run this command again."),process.exit(1);console.log()}import{spawn as L6}from"child_process";import{existsSync as N6}from"fs";import{mkdir as K6,copyFile as O6,chmod as v7}from"fs/promises";import{join as KD}from"path";import{homedir as w6}from"os";var S6=process.env.GENIE_HOME||KD(w6(),".genie"),uD=KD(S6,"src"),J3=KD(S6,"bin"),Q3=KD(w6(),".local","bin");function TD(D){console.log(`\x1B[32m\u25B8\x1B[0m ${D}`)}function x2(D){console.log(`\x1B[32m\u2714\x1B[0m ${D}`)}function RD(D){console.log(`\x1B[31m\u2716\x1B[0m ${D}`)}async function j2(D,F,B){return new Promise((E)=>{let $=[],X=L6(D,F,{cwd:B,stdio:["inherit","pipe","pipe"],env:{...process.env,FORCE_COLOR:"1"}});X.stdout?.on("data",(J)=>{let Q=J.toString();$.push(Q),process.stdout.write(Q)}),X.stderr?.on("data",(J)=>{let Q=J.toString();$.push(Q),process.stderr.write(Q)}),X.on("close",(J)=>{E({success:J===0,output:$.join("")})}),X.on("error",(J)=>{RD(J.message),E({success:!1,output:J.message})})})}async function C6(D){try{let F=await y2("git",["rev-parse","--abbrev-ref","HEAD"],D),B=await y2("git",["rev-parse","--short","HEAD"],D),E=await y2("git",["log","-1","--format=%ci"],D);if(F.success&&B.success&&E.success)return{branch:F.output.trim(),commit:B.output.trim(),commitDate:E.output.trim().split(" ")[0]}}catch{}return null}async function y2(D,F,B){return new Promise((E)=>{let $=[],X=L6(D,F,{cwd:B,stdio:["inherit","pipe","pipe"]});X.stdout?.on("data",(J)=>{$.push(J.toString())}),X.stderr?.on("data",(J)=>{$.push(J.toString())}),X.on("close",(J)=>{E({success:J===0,output:$.join("")})}),X.on("error",(J)=>{E({success:!1,output:J.message})})})}async function Z7(){if(dD())try{let F=await VD();if(F.installMethod)return F.installMethod}catch{}if(N6(KD(uD,".git")))return"source";let D=await y2("which",["genie"]);if(D.success){let F=D.output.trim();if(F.includes(".bun"))return"bun";if(F.includes("node_modules"))return"npm";if(F===KD(Q3,"genie")||F.startsWith(J3))return"source";return(await y2("which",["bun"])).success?"bun":"npm"}return"unknown"}async function f7(){if(TD("Updating via bun..."),!(await j2("bun",["install","-g","@automagik/genie@latest"])).success)RD("Failed to update via bun"),process.exit(1);console.log(),x2("Genie CLI updated!")}async function x7(){if(TD("Updating via npm..."),!(await j2("npm",["install","-g","@automagik/genie@latest"])).success)RD("Failed to update via npm"),process.exit(1);console.log(),x2("Genie CLI updated!")}async function y7(){let D=await C6(uD);if(D)console.log(`Current: \x1B[2m${D.branch}@${D.commit} (${D.commitDate})\x1B[0m`),console.log();if(TD("Fetching latest changes..."),!(await j2("git",["fetch","origin"],uD)).success)RD("Failed to fetch from origin"),process.exit(1);if(TD("Resetting to origin/main..."),!(await j2("git",["reset","--hard","origin/main"],uD)).success)RD("Failed to reset to origin/main"),process.exit(1);console.log();let E=await C6(uD);if(D&&E&&D.commit===E.commit){x2("Already up to date!"),console.log();return}if(TD("Installing dependencies..."),!(await j2("bun",["install"],uD)).success)RD("Failed to install dependencies"),process.exit(1);if(console.log(),TD("Building..."),!(await j2("bun",["run","build"],uD)).success)RD("Failed to build"),process.exit(1);console.log(),TD("Installing binaries...");try{await K6(J3,{recursive:!0}),await K6(Q3,{recursive:!0});let J=["genie.js","term.js","claudio.js"],Q=["genie","term","claudio"];for(let Y=0;Y<J.length;Y++){let W=KD(uD,"dist",J[Y]),H=KD(J3,J[Y]),_=KD(Q3,Q[Y]);await O6(W,H),await v7(H,493),await h7(H,_)}x2("Binaries installed")}catch(J){RD(`Failed to install binaries: ${J}`),process.exit(1)}if(console.log(),console.log("\x1B[2m\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\x1B[0m"),x2("Genie CLI updated successfully!"),console.log(),E)console.log(`Version: \x1B[36m${E.branch}@${E.commit}\x1B[0m (${E.commitDate})`),console.log()}async function h7(D,F){let{symlink:B,unlink:E}=await import("fs/promises");try{if(N6(F))await E(F);await B(D,F)}catch{await O6(D,F)}}async function b6(){console.log(),console.log("\x1B[1m\uD83E\uDDDE Genie CLI Update\x1B[0m"),console.log("\x1B[2m\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\x1B[0m"),console.log();let D=await Z7();if(TD(`Detected installation: ${D}`),console.log(),D==="unknown")RD("No Genie CLI installation found"),console.log(),console.log("Install method not configured. Please reinstall genie:"),console.log("\x1B[36m curl -fsSL https://raw.githubusercontent.com/namastexlabs/genie-cli/main/install.sh | bash\x1B[0m"),console.log(),process.exit(1);switch(D){case"source":await y7();break;case"bun":await f7();break;case"npm":await x7();break}}import{existsSync as g6,rmSync as a7,unlinkSync as r7,lstatSync as o7}from"fs";import{homedir as s7}from"os";import{join as H3}from"path";import{existsSync as Q0,mkdirSync as g7,readFileSync as m7,writeFileSync as l7,unlinkSync as p7}from"fs";import{homedir as T6}from"os";import{join as Y0}from"path";var X0=Y0(T6(),".claude"),d7=Y0(X0,"hooks"),J0=Y0(X0,"settings.json"),c7=K.object({type:K.literal("command"),command:K.string(),timeout:K.number().optional()}).passthrough(),u6=K.object({matcher:K.string(),hooks:K.array(c7)}).passthrough(),n7=K.object({PreToolUse:K.array(u6).optional(),PostToolUse:K.array(u6).optional()}).passthrough(),$0=K.object({model:K.string().optional(),enabledPlugins:K.record(K.unknown()).optional(),hooks:n7.optional()}).passthrough(),Y3="genie-bash-hook.sh",P6="Bash";function I6(){return J0}function k6(){return Y0(d7,Y3)}function i7(){if(!Q0(X0))g7(X0,{recursive:!0})}async function v6(){if(!Q0(J0))return $0.parse({});try{let D=m7(J0,"utf-8"),F=JSON.parse(D);return $0.parse(F)}catch(D){return console.warn(`Warning: Invalid Claude settings, using defaults: ${D.message}`),$0.parse({})}}async function Z6(D){i7();try{let F=$0.parse(D),B=JSON.stringify(F,null,2);l7(J0,B,"utf-8")}catch(F){throw Error(`Failed to save Claude settings: ${F.message}`)}}function f6(D){let F=D.hooks?.PreToolUse;if(!F||!Array.isArray(F))return!1;return F.some((B)=>{if(B.matcher!==P6)return!1;if(!Array.isArray(B.hooks))return!1;return B.hooks.some((E)=>E.type==="command"&&E.command?.includes(Y3))})}function x6(D){if(!D.hooks?.PreToolUse)return D;if(D.hooks.PreToolUse=D.hooks.PreToolUse.filter((F)=>{if(F.matcher!==P6)return!0;if(!Array.isArray(F.hooks))return!0;return!F.hooks.some((E)=>E.type==="command"&&E.command?.includes(Y3))}),D.hooks.PreToolUse.length===0)delete D.hooks.PreToolUse;if(D.hooks&&Object.keys(D.hooks).length===0)delete D.hooks;return D}function y6(){return Q0(k6())}function h6(){let D=k6();if(Q0(D))p7(D)}function W3(D){let F=T6();if(D.startsWith(F+"/"))return"~"+D.slice(F.length);if(D===F)return"~";return D}var m6=H3(s7(),".local","bin"),l6=["genie","term","claudio"];function p6(D){try{if(!g6(D))return!1;if(!o7(D).isSymbolicLink())return!1;return!0}catch{return!1}}function t7(){let D=[];for(let F of l6){let B=H3(m6,F);if(p6(B))try{r7(B),D.push(F)}catch{}}return D}async function d6(){console.log(),console.log("\x1B[1m\x1B[33m Uninstall Genie CLI\x1B[0m"),console.log();let D=B6(),F=g6(D),B=y6(),E=await v6(),$=f6(E),X=l6.filter((Q)=>p6(H3(m6,Q)));if(console.log("\x1B[2mThis will remove:\x1B[0m"),$)console.log(" \x1B[31m-\x1B[0m Hook registration from Claude Code");if(B)console.log(" \x1B[31m-\x1B[0m Hook script (~/.claude/hooks/genie-bash-hook.sh)");if(F)console.log(" \x1B[31m-\x1B[0m Genie directory ("+k2(D)+")");if(X.length>0)console.log(" \x1B[31m-\x1B[0m Symlinks from ~/.local/bin: "+X.join(", "));if(console.log(),!F&&!B&&!$&&X.length===0){console.log("\x1B[33mNothing to uninstall.\x1B[0m"),console.log();return}if(!await c({message:"Are you sure you want to uninstall Genie CLI?",default:!1})){console.log(),console.log("\x1B[2mUninstall cancelled.\x1B[0m"),console.log();return}if(console.log(),$){console.log("\x1B[2mRemoving hook from Claude Code...\x1B[0m");try{let Q=x6(E);await Z6(Q),console.log(" \x1B[32m+\x1B[0m Hook unregistered")}catch(Q){console.log(" \x1B[33m!\x1B[0m Could not unregister hook: "+Q.message)}}if(B){console.log("\x1B[2mRemoving hook script...\x1B[0m");try{h6(),console.log(" \x1B[32m+\x1B[0m Hook script removed")}catch(Q){console.log(" \x1B[33m!\x1B[0m Could not remove hook script: "+Q.message)}}if(X.length>0){console.log("\x1B[2mRemoving symlinks...\x1B[0m");let Q=t7();if(Q.length>0)console.log(" \x1B[32m+\x1B[0m Removed: "+Q.join(", "))}if(F){console.log("\x1B[2mRemoving genie directory...\x1B[0m");try{a7(D,{recursive:!0,force:!0}),console.log(" \x1B[32m+\x1B[0m Directory removed")}catch(Q){console.log(" \x1B[33m!\x1B[0m Could not remove directory: "+Q.message)}}console.log(),console.log("\x1B[32m+\x1B[0m Genie CLI uninstalled."),console.log(),console.log("\x1B[2mNote: If you installed via npm/bun, also run:\x1B[0m"),console.log(" \x1B[36mbun remove -g @automagik/genie\x1B[0m"),console.log(" \x1B[2mor\x1B[0m"),console.log(" \x1B[36mnpm uninstall -g @automagik/genie\x1B[0m"),console.log()}var{$:c6}=globalThis.Bun;import{existsSync as e7}from"fs";function q3(D){console.log(),console.log(`\x1B[1m${D}:\x1B[0m`)}function _3(D){let B={pass:"\x1B[32m\u2713\x1B[0m",fail:"\x1B[31m\u2717\x1B[0m",warn:"\x1B[33m!\x1B[0m"}[D.status],E=D.message?` ${D.message}`:"";if(console.log(` ${B} ${D.name}${E}`),D.suggestion)console.log(` \x1B[2m${D.suggestion}\x1B[0m`)}async function D9(){let D=[],F=await n("tmux");if(F.exists)D.push({name:"tmux",status:"pass",message:F.version||""});else D.push({name:"tmux",status:"fail",suggestion:"Install with: brew install tmux (or apt install tmux)"});let B=await n("jq");if(B.exists)D.push({name:"jq",status:"pass",message:B.version||""});else D.push({name:"jq",status:"fail",suggestion:"Install with: brew install jq (or apt install jq)"});let E=await n("bun");if(E.exists)D.push({name:"bun",status:"pass",message:E.version||""});else D.push({name:"bun",status:"fail",suggestion:"Install with: curl -fsSL https://bun.sh/install | bash"});let $=await n("claude");if($.exists)D.push({name:"Claude Code",status:"pass",message:$.version||""});else D.push({name:"Claude Code",status:"warn",suggestion:"Install with: npm install -g @anthropic-ai/claude-code"});return D}async function F9(){let D=[];if(dD())D.push({name:"Genie config exists",status:"pass",message:W3(I2())});else D.push({name:"Genie config exists",status:"warn",message:"not found",suggestion:"Run: genie setup"});if(X6())D.push({name:"Setup complete",status:"pass"});else D.push({name:"Setup complete",status:"warn",message:"not completed",suggestion:"Run: genie setup"});let F=I6();if(e7(F))D.push({name:"Claude settings exists",status:"pass",message:W3(F)});else D.push({name:"Claude settings exists",status:"warn",message:"not found",suggestion:"Claude Code creates this on first run"});return D}async function B9(){let D=[];try{if((await c6`tmux list-sessions 2>/dev/null`.quiet()).exitCode===0)D.push({name:"Server running",status:"pass"});else return D.push({name:"Server running",status:"warn",message:"no sessions",suggestion:"Start with: tmux new-session -d -s genie"}),D}catch{return D.push({name:"Server running",status:"warn",message:"could not check"}),D}let B=(await VD()).session.name;try{if((await c6`tmux has-session -t ${B} 2>/dev/null`.quiet()).exitCode===0)D.push({name:`Session '${B}' exists`,status:"pass"});else D.push({name:`Session '${B}' exists`,status:"warn",suggestion:`Start with: tmux new-session -d -s ${B}`})}catch{D.push({name:`Session '${B}' exists`,status:"warn",message:"could not check"})}try{if((await n("term")).exists)D.push({name:"term command available",status:"pass"});else D.push({name:"term command available",status:"fail",suggestion:"Ensure genie-cli is properly installed"})}catch{D.push({name:"term command available",status:"warn",message:"could not check"})}return D}async function n6(){console.log(),console.log("\x1B[1mGenie Doctor\x1B[0m"),console.log("\x1B[2m"+"\u2500".repeat(40)+"\x1B[0m");let D=!1,F=!1;q3("Prerequisites");let B=await D9();for(let X of B){if(_3(X),X.status==="fail")D=!0;if(X.status==="warn")F=!0}q3("Configuration");let E=await F9();for(let X of E){if(_3(X),X.status==="fail")D=!0;if(X.status==="warn")F=!0}q3("Tmux");let $=await B9();for(let X of $){if(_3(X),X.status==="fail")D=!0;if(X.status==="warn")F=!0}if(console.log(),console.log("\x1B[2m"+"\u2500".repeat(40)+"\x1B[0m"),D)console.log("\x1B[31mSome checks failed.\x1B[0m Run \x1B[36mgenie setup\x1B[0m to fix.");else if(F)console.log("\x1B[33mSome warnings detected.\x1B[0m Everything should still work.");else console.log("\x1B[32mAll checks passed!\x1B[0m");if(console.log(),D)process.exit(1)}import{spawnSync as L9}from"child_process";import{homedir as N9}from"os";import{join as O9}from"path";var g=[];for(let D=0;D<256;++D)g.push((D+256).toString(16).slice(1));function i6(D,F=0){return(g[D[F+0]]+g[D[F+1]]+g[D[F+2]]+g[D[F+3]]+"-"+g[D[F+4]]+g[D[F+5]]+"-"+g[D[F+6]]+g[D[F+7]]+"-"+g[D[F+8]]+g[D[F+9]]+"-"+g[D[F+10]]+g[D[F+11]]+g[D[F+12]]+g[D[F+13]]+g[D[F+14]]+g[D[F+15]]).toLowerCase()}import{randomFillSync as E9}from"crypto";var H0=new Uint8Array(256),W0=H0.length;function G3(){if(W0>H0.length-16)E9(H0),W0=0;return H0.slice(W0,W0+=16)}import{randomUUID as $9}from"crypto";var A3={randomUUID:$9};function X9(D,F,B){if(A3.randomUUID&&!F&&!D)return A3.randomUUID();D=D||{};let E=D.random??D.rng?.()??G3();if(E.length<16)throw Error("Random bytes length must be >= 16");if(E[6]=E[6]&15|64,E[8]=E[8]&63|128,F){if(B=B||0,B<0||B+16>F.length)throw RangeError(`UUID byte range ${B}:${B+15} is out of buffer bounds`);for(let $=0;$<16;++$)F[B+$]=E[$];return F}return i6(E)}var q0=X9;import{exec as J9}from"child_process";import{promisify as Q9}from"util";import{join as Y9}from"path";import{mkdirSync as W9,existsSync as H9}from"fs";import{homedir as q9}from"os";var _9=Q9(J9);function G9(){let D=Y9(q9(),".genie","logs","tmux");if(!H9(D))W9(D,{recursive:!0});return D}function A9(D){return D.filter((F)=>!/^-v+$/.test(F))}function U9(){return process.env.GENIE_TMUX_DEBUG==="1"}async function a6(D){let F=typeof D==="string"?D.split(/\s+/).filter(Boolean):D,B=A9(F),E=U9(),$={};if(E)B=["-v",...B],$.cwd=G9();let X=`tmux ${B.join(" ")}`,{stdout:J}=await _9(X,$);return J.trim()}var M9={type:"bash"};async function y(D){try{return await a6(D)}catch(F){throw Error(`Failed to execute tmux command: ${F.message}`)}}async function z9(){try{let F=await y("list-sessions -F '#{session_id}:#{session_name}:#{?session_attached,1,0}:#{session_windows}'");if(!F)return[];return F.split(`
|
|
132
|
+
`).map((B)=>{let[E,$,X,J]=B.split(":");return{id:E,name:$,attached:X==="1",windows:parseInt(J,10)}})}catch(D){if(D.message.includes("no server running"))return[];throw D}}async function G0(D){try{return(await z9()).find((B)=>B.name===D)||null}catch(F){return null}}async function j9(D){try{let B=await y(`list-windows -t '${D}' -F '#{window_id}:#{window_name}:#{?window_active,1,0}'`);if(!B)return[];return B.split(`
|
|
133
|
+
`).map((E)=>{let[$,X,J]=E.split(":");return{id:$,name:X,active:J==="1",sessionId:D}})}catch(F){if(F.message.includes("no server running")||F.message.includes("session not found"))return[];throw F}}async function f$(D){try{let B=await y(`list-panes -t '${D}' -F '#{pane_id}:#{pane_title}:#{?pane_active,1,0}'`);if(!B)return[];return B.split(`
|
|
134
|
+
`).map((E)=>{let[$,X,J]=E.split(":");return{id:$,windowId:D,title:X,active:J==="1"}})}catch(F){if(F.message.includes("no server running")||F.message.includes("window not found"))return[];throw F}}async function V9(D,F=200,B=!1){try{return await y(`capture-pane -p ${B?"-e":""} -t '${D}' -S -${F} -E -`)}catch(E){if(E.message.includes("no server running")||E.message.includes("pane not found"))return"";throw E}}async function r6(D){return await y(`new-session -d -s "${D}" -e LC_ALL=C.UTF-8 -e LANG=C.UTF-8`),G0(D)}async function x$(D,F){let B=await y(`new-window -t '${D}' -n '${F}'`);return(await j9(D)).find(($)=>$.name===F)||null}async function o6(D){await y(`kill-session -t '${D}'`)}async function y$(D){await y(`kill-window -t '${D}'`)}async function h$(D){await y(`kill-pane -t '${D}'`)}function R9(D){return D.replace(/'/g,"'\\''")}async function g$(D,F="vertical",B,E){let $="split-window";if(F==="horizontal")$+=" -h";else $+=" -v";if(E)$+=` -c '${R9(E)}'`;if(B!==void 0&&B>0&&B<100)$+=` -p ${B}`;$+=` -t '${D}'`,$+=" -P -F '#{pane_id}'";let X=(await y($)).trim(),J=await y(`display-message -p -t '${X}' '#{window_id}'`);return{id:X,windowId:J.trim(),active:!1,title:""}}var U3=new Map,M3="TMUX_MCP_START",_0="TMUX_MCP_DONE_";async function m$(D,F,B,E){let $=q0(),X;if(B||E)X=F;else{let J=K9();X=`echo "${M3}"; ${F}; echo "${J}"`}if(U3.set($,{id:$,paneId:D,command:F,status:"pending",startTime:new Date,rawMode:B||E}),E)if(["Up","Down","Left","Right","Escape","Tab","Enter","Space","BSpace","Delete","Home","End","PageUp","PageDown","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12"].includes(X))await y(`send-keys -t '${D}' ${X}`);else for(let Q of X)await y(`send-keys -t '${D}' '${Q.replace(/'/g,"'\\''")}'`);else await y(`send-keys -t '${D}' '${X.replace(/'/g,"'\\''")}' Enter`);return $}async function l$(D){let F=U3.get(D);if(!F)return null;if(F.status!=="pending")return F;let B=await V9(F.paneId,1000);if(F.rawMode)return F.result="Status tracking unavailable for rawMode commands. Use capture-pane to monitor interactive apps instead.",F;let E=B.lastIndexOf(M3),$=B.lastIndexOf(_0);if(E===-1||$===-1||$<=E)return F.result="Command output could not be captured properly",F;let X=B.substring($).split(`
|
|
135
|
+
`)[0],J=new RegExp(`${_0}(\\d+)`),Q=X.match(J);if(Q){let Y=parseInt(Q[1],10);F.status=Y===0?"completed":"error",F.exitCode=Y;let W=E+M3.length,H=B.substring(W,$).trim();F.result=H.substring(H.indexOf(`
|
|
136
|
+
`)+1).trim(),U3.set(D,F)}return F}function K9(){return M9.type==="fish"?`${_0}$status`:`${_0}$?`}async function p$(D,F,B=120000){let E=q0().substring(0,8),$=`/tmp/genie-${E}.out`,X=`/tmp/genie-${E}.exit`,J=`genie-${E}`,Y=`{ ${F.replace(/'/g,"'\\''")}; } 2>&1 | tee ${$}; echo \${PIPESTATUS[0]} > ${X}; tmux wait-for -S ${J}`;await y(`send-keys -t '${D}' '${Y.replace(/'/g,"'\\''")}' Enter`);try{await Promise.race([y(`wait-for ${J}`),new Promise((_,j)=>setTimeout(()=>j(Error("Command timed out")),B))])}catch(_){if(_.message==="Command timed out"){try{await y(`wait-for -S ${J}`)}catch{}return{output:"",exitCode:124}}throw _}let W="",H=0;try{let{readFile:_,unlink:j}=await import("fs/promises");W=await _($,"utf-8"),W=W.trim();let R=await _(X,"utf-8");H=parseInt(R.trim(),10)||0,await j($).catch(()=>{}),await j(X).catch(()=>{})}catch(_){console.error("Failed to read command output:",_)}return{output:W,exitCode:H}}var BD="genie",s6=O9(N9(),"workspace");async function t6(D={}){try{if(D.reset){if(await G0(BD))console.log(`\uD83D\uDDD1\uFE0F Resetting session "${BD}"...`),await o6(BD)}let F=await G0(BD);if(!F){if(console.log(`\u2728 Creating session "${BD}"...`),F=await r6(BD),!F)console.error(`\u274C Failed to create session "${BD}"`),process.exit(1);await y(`send-keys -t '${BD}' 'cd ${s6}' Enter`),await y(`send-keys -t '${BD}' 'claude' Enter`),console.log(`\u2705 Started Claude Code in ${s6}`)}else console.log(`\uD83D\uDCCE Session "${BD}" already exists`);console.log("\uD83D\uDCCE Attaching..."),L9("tmux",["attach","-t",BD],{stdio:"inherit"})}catch(F){console.error(`\u274C Error: ${F.message}`),process.exit(1)}}import{homedir as w9}from"os";import{join as z3}from"path";import{existsSync as S9}from"fs";async function j3(){X3();let D=w9(),F=z3(D,".tmux.conf"),B=z3(D,".zshrc"),E=z3(D,".bashrc");if(console.log("Installation status:"),Z2(F))console.log(" \x1B[32m\u2713\x1B[0m tmux.conf");else console.log(" \x1B[33m-\x1B[0m tmux.conf");let $=S9(B)?B:E;if(Z2($))console.log(` \x1B[32m\u2713\x1B[0m ${$.replace(D,"~")}`);else console.log(` \x1B[33m-\x1B[0m ${$.replace(D,"~")}`);console.log(),console.log("Run \x1B[36mgenie shortcuts install\x1B[0m to install shortcuts."),console.log("Run \x1B[36mgenie shortcuts uninstall\x1B[0m to remove shortcuts."),console.log()}async function e6(){await v2()}async function D1(){await G6()}var CD=new Z3;CD.name("genie").description("Genie CLI - Setup and utilities for AI-assisted development").version(f3);CD.command("install").description("Verify and install prerequisites").option("--check","Only check prerequisites, do not install").option("--yes","Auto-approve all installations").action(R6);CD.command("setup").description("Configure genie settings").option("--quick","Accept all defaults").option("--shortcuts","Only configure keyboard shortcuts").option("--claudio","Only configure Claudio integration").option("--terminal","Only configure terminal defaults").option("--session","Only configure session settings").option("--reset","Reset configuration to defaults").option("--show","Show current configuration").action(async(D)=>{await B0(D)});CD.command("doctor").description("Run diagnostic checks on genie installation").action(n6);CD.command("update").description("Update Genie CLI to the latest version").action(b6);CD.command("uninstall").description("Remove Genie CLI and clean up hooks").action(d6);CD.command("tui").description("Attach to master genie session in ~/workspace").option("-r, --reset","Kill existing session and start fresh").action(async(D)=>{await t6(D)});var A0=CD.command("shortcuts").description("Manage tmux keyboard shortcuts");A0.action(j3);A0.command("show").description("Show available shortcuts and installation status").action(j3);A0.command("install").description("Install shortcuts to config files (~/.tmux.conf, shell rc)").action(e6);A0.command("uninstall").description("Remove shortcuts from config files").action(D1);CD.parse();
|