@automagik/genie 0.260202.530 → 0.260202.1607

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/genie.js CHANGED
@@ -1,66 +1,65 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
- var y6=Object.create;var{getPrototypeOf:h6,defineProperty:V0,getOwnPropertyNames:g6}=Object;var m6=Object.prototype.hasOwnProperty;var ND=(D,F,B)=>{B=D!=null?y6(h6(D)):{};let E=F||!D||!D.__esModule?V0(B,"default",{value:D,enumerable:!0}):B;for(let $ of g6(D))if(!m6.call(E,$))V0(E,$,{get:()=>D[$],enumerable:!0});return E};var h=(D,F)=>()=>(F||D((F={exports:{}}).exports,F),F.exports);var l6=(D,F)=>{for(var B in F)V0(D,B,{get:F[B],enumerable:!0,configurable:!0,set:(E)=>F[B]=()=>E})};var YD=import.meta.require;var K2=h((p6)=>{class K0 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 O3 extends K0{constructor(D){super(1,"commander.invalidArgument",D);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}p6.CommanderError=K0;p6.InvalidArgumentError=O3});var n2=h((a6)=>{var{InvalidArgumentError:n6}=K2();class w3{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 n6(`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 i6(D){let F=D.name()+(D.variadic===!0?"...":"");return D.required?"<"+F+">":"["+F+"]"}a6.Argument=w3;a6.humanReadableArgName=i6});var N0=h((t6)=>{var{humanReadableArgName:s6}=n2();class S3{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)=>s6(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(A,T){if(T){let P=`${A.padEnd(B+2)}${T}`;return F.wrap(P,E-2,B+2)}return A}function Q(A){return A.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 q=F.visibleArguments(D).map((A)=>{return J(F.argumentTerm(A),F.argumentDescription(A))});if(q.length>0)Y=Y.concat(["Arguments:",Q(q),""]);let G=F.visibleOptions(D).map((A)=>{return J(F.optionTerm(A),F.optionDescription(A))});if(G.length>0)Y=Y.concat(["Options:",Q(G),""]);if(this.showGlobalOptions){let A=F.visibleGlobalOptions(D).map((T)=>{return J(F.optionTerm(T),F.optionDescription(T))});if(A.length>0)Y=Y.concat(["Global Options:",Q(A),""])}let C=F.visibleCommands(D).map((A)=>{return J(F.subcommandTerm(A),F.subcommandDescription(A))});if(C.length>0)Y=Y.concat(["Commands:",Q(C),""]);return Y.join(`
3
+ var hF=Object.create;var{getPrototypeOf:gF,defineProperty:Y0,getOwnPropertyNames:mF}=Object;var lF=Object.prototype.hasOwnProperty;var SD=(D,F,B)=>{B=D!=null?hF(gF(D)):{};let E=F||!D||!D.__esModule?Y0(B,"default",{value:D,enumerable:!0}):B;for(let $ of mF(D))if(!lF.call(E,$))Y0(E,$,{get:()=>D[$],enumerable:!0});return E};var x=(D,F)=>()=>(F||D((F={exports:{}}).exports,F),F.exports);var pF=(D,F)=>{for(var B in F)Y0(D,B,{get:F[B],enumerable:!0,configurable:!0,set:(E)=>F[B]=()=>E})};var JD=import.meta.require;var U2=x((dF)=>{class W0 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 Y3 extends W0{constructor(D){super(1,"commander.invalidArgument",D);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}dF.CommanderError=W0;dF.InvalidArgumentError=Y3});var f2=x((rF)=>{var{InvalidArgumentError:iF}=U2();class W3{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 iF(`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 aF(D){let F=D.name()+(D.variadic===!0?"...":"");return D.required?"<"+F+">":"["+F+"]"}rF.Argument=W3;rF.humanReadableArgName=aF});var H0=x((eF)=>{var{humanReadableArgName:tF}=f2();class H3{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)=>tF(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,I){if(I){let b=`${R.padEnd(B+2)}${I}`;return F.wrap(b,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 A=F.visibleOptions(D).map((R)=>{return J(F.optionTerm(R),F.optionDescription(R))});if(A.length>0)Y=Y.concat(["Options:",Q(A),""]);if(this.showGlobalOptions){let R=F.visibleGlobalOptions(D).map((I)=>{return J(F.optionTerm(I),F.optionDescription(I))});if(R.length>0)Y=Y.concat(["Global Options:",Q(R),""])}let V=F.visibleCommands(D).map((R)=>{return J(F.subcommandTerm(R),F.subcommandDescription(R))});if(V.length>0)Y=Y.concat(["Commands:",Q(V),""]);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),G=`\\s${"\u200B"}`,C=new RegExp(`
8
- |.{1,${J-1}}([${G}]|$)|[^${G}]+?([${G}]|$)`,"g"),A=Y.match(C)||[];return Q+A.map((T,P)=>{if(T===`
9
- `)return"";return(P>0?W:"")+T.trimEnd()}).join(`
10
- `)}}t6.Help=S3});var L0=h((EF)=>{var{InvalidArgumentError:DF}=K2();class u3{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=BF(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 DF(`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 FF(this.name().replace(/^no-/,""))}is(D){return this.short===D||this.long===D}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class I3{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 FF(D){return D.split("-").reduce((F,B)=>{return F+B[0].toUpperCase()+B.slice(1)})}function BF(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}}EF.Option=u3;EF.DualOptions=I3});var T3=h((YF)=>{function JF(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 QF(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=JF(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`
7
+ `),W=" ".repeat(B),A=`\\s${"\u200B"}`,V=new RegExp(`
8
+ |.{1,${J-1}}([${A}]|$)|[^${A}]+?([${A}]|$)`,"g"),R=Y.match(V)||[];return Q+R.map((I,b)=>{if(I===`
9
+ `)return"";return(b>0?W:"")+I.trimEnd()}).join(`
10
+ `)}}eF.Help=H3});var q0=x(($6)=>{var{InvalidArgumentError:F6}=U2();class q3{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=E6(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 F6(`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 B6(this.name().replace(/^no-/,""))}is(D){return this.short===D||this.long===D}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class _3{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 B6(D){return D.split("-").reduce((F,B)=>{return F+B[0].toUpperCase()+B.slice(1)})}function E6(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}}$6.Option=q3;$6.DualOptions=_3});var G3=x((W6)=>{function Q6(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 Y6(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=Q6(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""}YF.suggestSimilar=QF});var v3=h((AF)=>{var qF=YD("events").EventEmitter,O0=YD("child_process"),MD=YD("path"),w0=YD("fs"),y=YD("process"),{Argument:_F,humanReadableArgName:HF}=n2(),{CommanderError:S0}=K2(),{Help:GF}=N0(),{Option:b3,DualOptions:MF}=L0(),{suggestSimilar:P3}=T3();class u0 extends qF{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)=>y.stdout.write(F),writeErr:(F)=>y.stderr.write(F),getOutHelpWidth:()=>y.stdout.isTTY?y.stdout.columns:void 0,getErrHelpWidth:()=>y.stderr.isTTY?y.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 u0(D)}createHelp(){return Object.assign(new GF,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 _F(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 S0(D,F,B));y.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 b3(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 b3)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(y.versions?.electron)F.from="electron";let E=y.execArgv??[];if(E.includes("-e")||E.includes("--eval")||E.includes("-p")||E.includes("--print"))F.from="eval"}if(D===void 0)D=y.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(y.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,q){let G=MD.resolve(W,q);if(w0.existsSync(G))return G;if(E.includes(MD.extname(q)))return;let C=E.find((A)=>w0.existsSync(`${G}${A}`));if(C)return`${G}${C}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let X=D._executableFile||`${this._name}-${D._name}`,J=this._executableDir||"";if(this._scriptPath){let W;try{W=w0.realpathSync(this._scriptPath)}catch(q){W=this._scriptPath}J=MD.resolve(MD.dirname(W),J)}if(J){let W=$(J,X);if(!W&&!D._executableFile&&this._scriptPath){let q=MD.basename(this._scriptPath,MD.extname(this._scriptPath));if(q!==this._name)W=$(J,`${q}-${D._name}`)}X=W||X}B=E.includes(MD.extname(X));let Q;if(y.platform!=="win32")if(B)F.unshift(X),F=k3(y.execArgv).concat(F),Q=O0.spawn(y.argv[0],F,{stdio:"inherit"});else Q=O0.spawn(X,F,{stdio:"inherit"});else F.unshift(X),F=k3(y.execArgv).concat(F),Q=O0.spawn(y.execPath,F,{stdio:"inherit"});if(!Q.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((q)=>{y.on(q,()=>{if(Q.killed===!1&&Q.exitCode===null)Q.kill(q)})});let Y=this._exitCallback;Q.on("close",(W)=>{if(W=W??1,!Y)y.exit(W);else Y(new S0(W,"commander.executeSubCommandAsync","(close)"))}),Q.on("error",(W)=>{if(W.code==="ENOENT"){let q=J?`searched for local subcommand relative to directory '${J}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",G=`'${X}' does not exist
12
+ (Did you mean ${E[0]}?)`;return""}W6.suggestSimilar=Y6});var z3=x((U6)=>{var q6=JD("events").EventEmitter,_0=JD("child_process"),QD=JD("path"),G0=JD("fs"),f=JD("process"),{Argument:_6,humanReadableArgName:G6}=f2(),{CommanderError:A0}=U2(),{Help:A6}=H0(),{Option:A3,DualOptions:M6}=q0(),{suggestSimilar:M3}=G3();class M0 extends q6{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 M0(D)}createHelp(){return Object.assign(new A6,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 _6(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 A0(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 A3(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 A3)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 A=QD.resolve(W,H);if(G0.existsSync(A))return A;if(E.includes(QD.extname(H)))return;let V=E.find((R)=>G0.existsSync(`${A}${R}`));if(V)return`${A}${V}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let X=D._executableFile||`${this._name}-${D._name}`,J=this._executableDir||"";if(this._scriptPath){let W;try{W=G0.realpathSync(this._scriptPath)}catch(H){W=this._scriptPath}J=QD.resolve(QD.dirname(W),J)}if(J){let W=$(J,X);if(!W&&!D._executableFile&&this._scriptPath){let H=QD.basename(this._scriptPath,QD.extname(this._scriptPath));if(H!==this._name)W=$(J,`${H}-${D._name}`)}X=W||X}B=E.includes(QD.extname(X));let Q;if(f.platform!=="win32")if(B)F.unshift(X),F=U3(f.execArgv).concat(F),Q=_0.spawn(f.argv[0],F,{stdio:"inherit"});else Q=_0.spawn(X,F,{stdio:"inherit"});else F.unshift(X),F=U3(f.execArgv).concat(F),Q=_0.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 A0(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",A=`'${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
- - ${q}`;throw Error(G)}else if(W.code==="EACCES")throw Error(`'${X}' not executable`);if(!Y)y.exit(1);else{let q=new S0(1,"commander.executeSubCommandAsync","(error)");q.nestedError=W,Y(q)}}),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}
18
+ - ${H}`;throw Error(A)}else if(W.code==="EACCES")throw Error(`'${X}' not executable`);if(!Y)f.exit(1);else{let H=new A0(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 y.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()}`,y.env[D.envVar]);else this.emit(`optionEnv:${D.name()}`)}})}_parseOptionsImplied(){let D=new MF(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((q)=>q.negate&&J===q.attributeName()),W=this.options.find((q)=>!q.negate&&J===q.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=P3(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=P3(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 HF(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=MD.basename(D,MD.extname(D)),this}executableDir(D){if(D===void 0)return this._executableDir;return this._executableDir=D,this}helpInformation(D){let F=this.createHelp();if(F.helpWidth===void 0)F.helpWidth=D&&D.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth();return F.formatHelp(this,F)}_getHelpContext(D){D=D||{};let F={error:!!D.error},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=y.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.
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 M6(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=M3(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=M3(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 G6(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=QD.basename(D,QD.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 k3(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})}AF.Command=u0});var y3=h((jF)=>{var{Argument:Z3}=n2(),{Command:I0}=v3(),{CommanderError:UF,InvalidArgumentError:f3}=K2(),{Help:RF}=N0(),{Option:x3}=L0();jF.program=new I0;jF.createCommand=(D)=>new I0(D);jF.createOption=(D,F)=>new x3(D,F);jF.createArgument=(D,F)=>new Z3(D,F);jF.Command=I0;jF.Option=x3;jF.Argument=Z3;jF.Help=RF;jF.CommanderError=UF;jF.InvalidArgumentError=f3;jF.InvalidOptionArgumentError=f3});var L2=h((C9,c3)=>{var ZF=YD("tty"),fF=ZF?.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,q=(F===22?E:"")+B;while(J!==-1)Q+=X.slice(Y,J)+q,Y=J+E.length,J=X.indexOf(E,Y);return Q+=X.slice(Y)+E,Q}},N={};N.reset=O(0,0);N.bold=O(1,22);N.dim=O(2,22);N.italic=O(3,23);N.underline=O(4,24);N.overline=O(53,55);N.inverse=O(7,27);N.hidden=O(8,28);N.strikethrough=O(9,29);N.black=O(30,39);N.red=O(31,39);N.green=O(32,39);N.yellow=O(33,39);N.blue=O(34,39);N.magenta=O(35,39);N.cyan=O(36,39);N.white=O(37,39);N.gray=O(90,39);N.bgBlack=O(40,49);N.bgRed=O(41,49);N.bgGreen=O(42,49);N.bgYellow=O(43,49);N.bgBlue=O(44,49);N.bgMagenta=O(45,49);N.bgCyan=O(46,49);N.bgWhite=O(47,49);N.bgGray=O(100,49);N.redBright=O(91,39);N.greenBright=O(92,39);N.yellowBright=O(93,39);N.blueBright=O(94,39);N.magentaBright=O(95,39);N.cyanBright=O(96,39);N.whiteBright=O(97,39);N.bgRedBright=O(101,49);N.bgGreenBright=O(102,49);N.bgYellowBright=O(103,49);N.bgBlueBright=O(104,49);N.bgMagentaBright=O(105,49);N.bgCyanBright=O(106,49);N.bgWhiteBright=O(107,49);c3.exports=N});var t3=h((g9,s3)=>{s3.exports=dF;function pF(D){let F={defaultWidth:0,output:process.stdout,tty:YD("tty")};if(!D)return F;return Object.keys(F).forEach(function(B){if(!D[B])D[B]=F[B]}),D}function dF(D){let F=pF(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 D8=h((m9,e3)=>{e3.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 y0=h((l9,F8)=>{var cF=D8();F8.exports=(D)=>typeof D==="string"?D.replace(cF(),""):D});var E8=h((p9,h0)=>{var B8=(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};h0.exports=B8;h0.exports.default=B8});var X8=h((d9,$8)=>{$8.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 Q8=h((c9,g0)=>{var nF=y0(),iF=E8(),aF=X8(),J8=(D)=>{if(typeof D!=="string"||D.length===0)return 0;if(D=nF(D),D.length===0)return 0;D=D.replace(aF()," ");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+=iF(E)?2:1}return F};g0.exports=J8;g0.exports.default=J8});var W8=h((n9,Y8)=>{Y8.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 m0=h((i9,_8)=>{var w2=W8(),q8={};for(let D of Object.keys(w2))q8[w2[D]]=D;var z={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"]}};_8.exports=z;for(let D of Object.keys(z)){if(!("channels"in z[D]))throw Error("missing channels property: "+D);if(!("labels"in z[D]))throw Error("missing channel labels property: "+D);if(z[D].labels.length!==z[D].channels)throw Error("channel and label counts mismatch: "+D);let{channels:F,labels:B}=z[D];delete z[D].channels,delete z[D].labels,Object.defineProperty(z[D],"channels",{value:F}),Object.defineProperty(z[D],"labels",{value:B})}z.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]};z.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),q=W-Math.min(J,Q,Y),G=function(C){return(W-C)/6/q+0.5};if(q===0)$=0,X=0;else{if(X=q/W,F=G(J),B=G(Q),E=G(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]};z.rgb.hwb=function(D){let F=D[0],B=D[1],E=D[2],$=z.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]};z.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 rF(D,F){return(D[0]-F[0])**2+(D[1]-F[1])**2+(D[2]-F[2])**2}z.rgb.keyword=function(D){let F=q8[D];if(F)return F;let B=1/0,E;for(let $ of Object.keys(w2)){let X=w2[$],J=rF(D,X);if(J<B)B=J,E=$}return E};z.keyword.rgb=function(D){return w2[D]};z.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]};z.rgb.lab=function(D){let F=z.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]};z.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};z.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]};z.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]}};z.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]};z.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,q,G;switch(J){default:case 6:case 0:W=Q,q=Y,G=B;break;case 1:W=Y,q=Q,G=B;break;case 2:W=B,q=Q,G=Y;break;case 3:W=B,q=Y,G=Q;break;case 4:W=Y,q=B,G=Q;break;case 5:W=Q,q=B,G=Y;break}return[W*255,q*255,G*255]};z.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]};z.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]};z.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]};z.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]};z.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,$]};z.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]};z.rgb.ansi16=function(D,F=null){let[B,E,$]=D,X=F===null?z.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};z.hsv.ansi16=function(D){return z.rgb.ansi16(z.hsv.rgb(D),D[2])};z.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)};z.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]};z.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,$]};z.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};z.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]};z.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]};z.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]};z.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]};z.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]};z.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]};z.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]};z.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]};z.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]};z.apple.rgb=function(D){return[D[0]/65535*255,D[1]/65535*255,D[2]/65535*255]};z.rgb.apple=function(D){return[D[0]/255*65535,D[1]/255*65535,D[2]/255*65535]};z.gray.rgb=function(D){return[D[0]/100*255,D[0]/100*255,D[0]/100*255]};z.gray.hsl=function(D){return[0,0,D[0]]};z.gray.hsv=z.gray.hsl;z.gray.hwb=function(D){return[0,100,D[0]]};z.gray.cmyk=function(D){return[0,0,0,D[0]]};z.gray.lab=function(D){return[D[0],0,0]};z.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};z.rgb.gray=function(D){return[(D[0]+D[1]+D[2])/3/255*100]}});var G8=h((a9,H8)=>{var r2=m0();function oF(){let D={},F=Object.keys(r2);for(let B=F.length,E=0;E<B;E++)D[F[E]]={distance:-1,parent:null};return D}function sF(D){let F=oF(),B=[D];F[D].distance=0;while(B.length){let E=B.pop(),$=Object.keys(r2[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 tF(D,F){return function(B){return F(D(B))}}function eF(D,F){let B=[F[D].parent,D],E=r2[F[D].parent][D],$=F[D].parent;while(F[$].parent)B.unshift(F[$].parent),E=tF(r2[F[$].parent][$],E),$=F[$].parent;return E.conversion=B,E}H8.exports=function(D){let F=sF(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]=eF(J,F)}return B}});var A8=h((r9,M8)=>{var l0=m0(),D1=G8(),eD={},F1=Object.keys(l0);function B1(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 E1(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}F1.forEach((D)=>{eD[D]={},Object.defineProperty(eD[D],"channels",{value:l0[D].channels}),Object.defineProperty(eD[D],"labels",{value:l0[D].labels});let F=D1(D);Object.keys(F).forEach((E)=>{let $=F[E];eD[D][E]=E1($),eD[D][E].raw=B1($)})});M8.exports=eD});var V8=h((o9,C8)=>{var z8=(D,F)=>(...B)=>{return`\x1B[${D(...B)+F}m`},U8=(D,F)=>(...B)=>{let E=D(...B);return`\x1B[${38+F};5;${E}m`},R8=(D,F)=>(...B)=>{let E=D(...B);return`\x1B[${38+F};2;${E[0]};${E[1]};${E[2]}m`},o2=(D)=>D,j8=(D,F,B)=>[D,F,B],D2=(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})},p0,F2=(D,F,B,E)=>{if(p0===void 0)p0=A8();let $=E?10:0,X={};for(let[J,Q]of Object.entries(p0)){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 $1(){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",D2(F.color,"ansi",()=>F2(z8,"ansi16",o2,!1)),D2(F.color,"ansi256",()=>F2(U8,"ansi256",o2,!1)),D2(F.color,"ansi16m",()=>F2(R8,"rgb",j8,!1)),D2(F.bgColor,"ansi",()=>F2(z8,"ansi16",o2,!0)),D2(F.bgColor,"ansi256",()=>F2(U8,"ansi256",o2,!0)),D2(F.bgColor,"ansi16m",()=>F2(R8,"rgb",j8,!0)),F}Object.defineProperty(C8,"exports",{enumerable:!0,get:$1})});var L8=h((s9,N8)=>{var S2=Q8(),X1=y0(),J1=V8(),c0=new Set(["\x1B","\x9B"]),K8=(D)=>`${c0.values().next().value}[${D}m`,Q1=(D)=>D.split(" ").map((F)=>S2(F)),d0=(D,F,B)=>{let E=[...F],$=!1,X=S2(X1(D[D.length-1]));for(let[J,Q]of E.entries()){let Y=S2(Q);if(X+Y<=B)D[D.length-1]+=Q;else D.push(Q),X=0;if(c0.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()},Y1=(D)=>{let F=D.split(" "),B=F.length;while(B>0){if(S2(F[B-1])>0)break;B--}if(B===F.length)return D;return F.slice(0,B).join(" ")+F.slice(B).join("")},W1=(D,F,B={})=>{if(B.trim!==!1&&D.trim()==="")return"";let E="",$="",X,J=Q1(D),Q=[""];for(let[Y,W]of D.split(" ").entries()){if(B.trim!==!1)Q[Q.length-1]=Q[Q.length-1].trimLeft();let q=S2(Q[Q.length-1]);if(Y!==0){if(q>=F&&(B.wordWrap===!1||B.trim===!1))Q.push(""),q=0;if(q>0||B.trim===!1)Q[Q.length-1]+=" ",q++}if(B.hard&&J[Y]>F){let G=F-q,C=1+Math.floor((J[Y]-G-1)/F);if(Math.floor((J[Y]-1)/F)<C)Q.push("");d0(Q,W,F);continue}if(q+J[Y]>F&&q>0&&J[Y]>0){if(B.wordWrap===!1&&q<F){d0(Q,W,F);continue}Q.push("")}if(q+J[Y]>F&&B.wordWrap===!1){d0(Q,W,F);continue}Q[Q.length-1]+=W}if(B.trim!==!1)Q=Q.map(Y1);E=Q.join(`
25
- `);for(let[Y,W]of[...E].entries()){if($+=W,c0.has(W)){let G=parseFloat(/\d[^m]*/.exec(E.slice(Y,Y+4)));X=G===39?null:G}let q=J1.codes.get(Number(X));if(X&&q){if(E[Y+1]===`
26
- `)$+=K8(q);else if(W===`
27
- `)$+=K8(X)}}return $};N8.exports=(D,F,B)=>{return String(D).normalize().replace(/\r\n/g,`
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((z9,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((x9,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((y9,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((h9,y3)=>{var n6=x3();y3.exports=(D)=>typeof D==="string"?D.replace(n6(),""):D});var g3=x((g9,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((m9,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((l9,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((p9,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((d9,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((c9,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((n9,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((i9,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((a9,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,P0.has(W)){let A=parseFloat(/\d[^m]*/.exec(E.slice(Y,Y+4)));X=A===39?null:A}let H=Q1.codes.get(Number(X));if(X&&H){if(E[Y+1]===`
26
+ `)$+=X8(H);else if(W===`
27
+ `)$+=X8(X)}}return $};J8.exports=(D,F,B)=>{return String(D).normalize().replace(/\r\n/g,`
28
28
  `).split(`
29
- `).map((E)=>W1(E,F,B)).join(`
30
- `)}});var I8=h((E4,u8)=>{var _1=YD("stream");class S8 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)}}u8.exports=S8});var h3=ND(y3(),1),{program:t7,createCommand:e7,createArgument:D9,createOption:F9,CommanderError:B9,InvalidArgumentError:E9,InvalidOptionArgumentError:$9,Command:g3,Argument:X9,Option:J9,Help:Q9}=h3.default;var m3="0.260202.0530";var AD=(D,F=[])=>D.name==="up"||F.includes("vim")&&D.name==="k"||F.includes("emacs")&&D.ctrl&&D.name==="p",PD=(D,F=[])=>D.name==="down"||F.includes("vim")&&D.name==="j"||F.includes("emacs")&&D.ctrl&&D.name==="n",T0=(D)=>D.name==="space",b0=(D)=>D.name==="backspace",kD=(D)=>D.name==="tab",P0=(D)=>"1234567890".includes(D.name),o=(D)=>D.name==="enter"||D.name==="return";class k0 extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(D){super();this.cause=D?.cause}}class v0 extends Error{name="CancelPromptError";message="Prompt was canceled"}class i2 extends Error{name="ExitPromptError"}class Z0 extends Error{name="HookError"}class N2 extends Error{name="ValidationError"}import{AsyncResource as vF}from"async_hooks";import{AsyncLocalStorage as bF,AsyncResource as PF}from"async_hooks";var l3=new bF;function kF(D){return{rl:D,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function p3(D,F){let B=kF(D);return l3.run(B,()=>{function E($){B.handleChange=()=>{B.index=0,$()},B.handleChange()}return F(E)})}function vD(){let D=l3.getStore();if(!D)throw new Z0("[Inquirer] Hook functions can only be called from within a prompt");return D}function f0(){return vD().rl}function x0(D){let F=(...B)=>{let E=vD(),$=!1,X=E.handleChange;E.handleChange=()=>{$=!0};let J=D(...B);if($)X();return E.handleChange=X,J};return PF.bind(F)}function tD(D){let F=vD(),{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 d3(){vD().handleChange()}var ZD={queue(D){let F=vD(),{index:B}=F;F.hooksEffect.push(()=>{F.hooksCleanup[B]?.();let E=D(f0());if(E!=null&&typeof E!=="function")throw new N2("useEffect return value must be a cleanup function or nothing.");F.hooksCleanup[B]=E})},run(){let D=vD();x0(()=>{D.hooksEffect.forEach((F)=>{F()}),D.hooksEffect.length=0})()},clearAll(){let D=vD();D.hooksCleanup.forEach((F)=>{F?.()}),D.hooksEffect.length=0,D.hooksCleanup.length=0}};function Z(D){return tD((F)=>{let B=vF.bind(function(X){if(F.get()!==X)F.set(X),d3()});if(F.initialized)return[F.get(),B];let E=typeof D==="function"?D():D;return F.set(E),[E,B]})}function zD(D,F){tD((B)=>{let E=B.get();if(!Array.isArray(E)||F.some((X,J)=>!Object.is(X,E[J])))ZD.queue(D);B.set(F)})}var i=ND(L2(),1);import WD from"process";function xF(){if(WD.platform!=="win32")return WD.env.TERM!=="linux";return Boolean(WD.env.WT_SESSION)||Boolean(WD.env.TERMINUS_SUBLIME)||WD.env.ConEmuTask==="{cmd::Cmder}"||WD.env.TERM_PROGRAM==="Terminus-Sublime"||WD.env.TERM_PROGRAM==="vscode"||WD.env.TERM==="xterm-256color"||WD.env.TERM==="alacritty"||WD.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var n3={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"},i3={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"},yF={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"},hF={...n3,...i3},gF={...n3,...yF},mF=xF(),lF=mF?hF:gF,qD=lF,K9=Object.entries(i3);var a3={prefix:{idle:i.default.blue("?"),done:i.default.green(qD.tick)},spinner:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"].map((D)=>i.default.yellow(D))},style:{answer:i.default.cyan,message:i.default.bold,error:(D)=>i.default.red(`> ${D}`),defaultAnswer:(D)=>i.default.dim(`(${D})`),help:i.default.dim,highlight:i.default.cyan,key:(D)=>i.default.cyan(i.default.bold(`<${D}>`))}};function r3(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 o3(...D){let F={};for(let B of D)for(let[E,$]of Object.entries(B)){let X=F[E];F[E]=r3(X)&&r3($)?o3(X,$):$}return F}function n(...D){let F=[a3,...D.filter((B)=>B!=null)];return o3(...F)}function s({status:D="idle",theme:F}){let[B,E]=Z(!1),[$,X]=Z(0),{prefix:J,spinner:Q}=n(F);if(zD(()=>{if(D==="loading"){let W,q=-1,G=setTimeout(()=>{E(!0),W=setInterval(()=>{q=q+1,X(q%Q.frames.length)},Q.interval)},300);return()=>{clearTimeout(G),clearInterval(W)}}else E(!1)},[D]),B)return Q.frames[$];return typeof J==="string"?J:J[D==="loading"?"idle":D]??J.idle}function O2(D,F){return tD((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 a2(D){return Z({current:D})[0]}function t(D){let F=a2(D);F.current=D,zD((B)=>{let E=!1,$=x0((X,J)=>{if(E)return;F.current(J,B)});return B.input.on("keypress",$),()=>{E=!0,B.input.removeListener("keypress",$)}},[])}var O8=ND(t3(),1),w8=ND(L8(),1);function u2(D,F){return D.split(`
31
- `).flatMap((B)=>w8.default(B,F,{trim:!1,hard:!0}).split(`
29
+ `).map((E)=>H1(E,F,B)).join(`
30
+ `)}});var _8=x((D4,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:r7,createCommand:o7,createArgument:s7,createOption:t7,CommanderError:e7,InvalidArgumentError:D9,InvalidOptionArgumentError:F9,Command:L3,Argument:B9,Option:E9,Help:$9}=K3.default;var N3="0.260202.1607";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,C9=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)=>W8.default(B,F,{trim:!1,hard:!0}).split(`
32
32
  `).map((E)=>E.trimEnd())).join(`
33
- `)}function s2(){return O8.default({defaultWidth:80,output:f0().output})}function q1({active:D,renderedItems:F,pageSize:B,loop:E}){let $=a2({lastPointer:D,lastActive:void 0}),{lastPointer:X,lastActive:J}=$.current,Q=Math.floor(B/2),Y=F.reduce((G,C)=>G+C.length,0),W=F.slice(0,D).reduce((G,C)=>G+C.length,0),q=W;if(Y>B)if(E){if(q=X,J!=null&&J<D&&D-J<B)q=Math.min(Q,Math.abs(D-J)===1?Math.min(X+(F[J]?.length??0),Math.max(W,X)):X+D-J)}else{let G=F.slice(D).reduce((C,A)=>C+A.length,0);q=G<B-Q?B-G:Math.min(W,Q)}return $.current.lastPointer=q,$.current.lastActive=D,q}function I2({items:D,active:F,renderItem:B,pageSize:E,loop:$=!0}){let X=s2(),J=(V)=>(V%D.length+D.length)%D.length,Q=D.map((V,w)=>{if(V==null)return[];return u2(B({item:V,index:w,isActive:w===F}),X).split(`
34
- `)}),Y=Q.reduce((V,w)=>V+w.length,0),W=(V)=>Q[V]??[],q=q1({active:F,renderedItems:Q,pageSize:E,loop:$}),G=W(F).slice(0,E),C=q+G.length<=E?q:E-G.length,A=Array.from({length:E});A.splice(C,G.length,...G);let T=new Set([F]),P=C+G.length,k=J(F+1);while(P<E&&!T.has(k)&&($&&Y>E?k!==F:k>F)){let w=W(k).slice(0,E-P);A.splice(P,w.length,...w),T.add(k),P+=w.length,k=J(k+1)}P=C-1,k=J(F-1);while(P>=0&&!T.has(k)&&($&&Y>E?k!==F:k<F)){let V=W(k),w=V.slice(Math.max(0,V.length-P-1));A.splice(P-w.length+1,w.length,...w),T.add(k),P-=w.length,k=J(k-1)}return A.filter((V)=>typeof V==="string").join(`
35
- `)}var y8=ND(I8(),1);import*as x8 from"readline";import{AsyncResource as U1}from"async_hooks";var fD=[];fD.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")fD.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")fD.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var t2=(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",n0=Symbol.for("signal-exit emitter"),i0=globalThis,H1=Object.defineProperty.bind(Object);class T8{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(i0[n0])return i0[n0];H1(i0,n0,{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 r0{}var G1=(D)=>{return{onExit(F,B){return D.onExit(F,B)},load(){return D.load()},unload(){return D.unload()}}};class b8 extends r0{onExit(){return()=>{}}load(){}unload(){}}class P8 extends r0{#B=a0.platform==="win32"?"SIGINT":"SIGHUP";#F=new T8;#D;#X;#J;#$={};#E=!1;constructor(D){super();this.#D=D,this.#$={};for(let F of fD)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(!t2(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 fD)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,fD.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(!t2(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"&&t2(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 a0=globalThis.process,{onExit:k8,load:J4,unload:Q4}=G1(t2(a0)?new P8(a0):new b8);import{stripVTControlCharacters as A1}from"util";var M1="\x1B[G",e2="\x1B[?25l",Z8="\x1B[?25h",o0=(D=1)=>D>0?`\x1B[${D}A`:"",s0=(D=1)=>D>0?`\x1B[${D}B`:"",t0=(D,F)=>{if(typeof F==="number"&&!Number.isNaN(F))return`\x1B[${F+1};${D+1}H`;return`\x1B[${D+1}G`},v8="\x1B[2K",e0=(D)=>D>0?(v8+o0(1)).repeat(D-1)+v8+M1:"";var f8=(D)=>D.split(`
33
+ `)}function p2(){return Y8.default({defaultWidth:80,output:K0().output})}function q1({active:D,renderedItems:F,pageSize:B,loop:E}){let $=g2({lastPointer:D,lastActive:void 0}),{lastPointer:X,lastActive:J}=$.current,Q=Math.floor(B/2),Y=F.reduce((A,V)=>A+V.length,0),W=F.slice(0,D).reduce((A,V)=>A+V.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 A=F.slice(D).reduce((V,R)=>V+R.length,0);H=A<B-Q?B-A:Math.min(W,Q)}return $.current.lastPointer=H,$.current.lastActive=D,H}function k0({items:D,active:F,renderItem:B,pageSize:E,loop:$=!0}){let X=p2(),J=(K)=>(K%D.length+D.length)%D.length,Q=D.map((K,S)=>{if(K==null)return[];return R2(B({item:K,index:S,isActive:S===F}),X).split(`
34
+ `)}),Y=Q.reduce((K,S)=>K+S.length,0),W=(K)=>Q[K]??[],H=q1({active:F,renderedItems:Q,pageSize:E,loop:$}),A=W(F).slice(0,E),V=H+A.length<=E?H:E-A.length,R=Array.from({length:E});R.splice(V,A.length,...A);let I=new Set([F]),b=V+A.length,T=J(F+1);while(b<E&&!I.has(T)&&($&&Y>E?T!==F:T>F)){let S=W(T).slice(0,E-b);R.splice(b,S.length,...S),I.add(T),b+=S.length,T=J(T+1)}b=V-1,T=J(F-1);while(b>=0&&!I.has(T)&&($&&Y>E?T!==F:T<F)){let K=W(T),S=K.slice(Math.max(0,K.length-b-1));R.splice(b-S.length+1,S.length,...S),I.add(T),b-=S.length,T=J(T-1)}return R.filter((K)=>typeof K==="string").join(`
35
+ `)}var K8=SD(_8(),1);import*as V8 from"readline";import{AsyncResource as j1}from"async_hooks";var PD=[];PD.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")PD.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")PD.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var d2=(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",v0=Symbol.for("signal-exit emitter"),Z0=globalThis,G1=Object.defineProperty.bind(Object);class G8{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Z0[v0])return Z0[v0];G1(Z0,v0,{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 x0{}var A1=(D)=>{return{onExit(F,B){return D.onExit(F,B)},load(){return D.load()},unload(){return D.unload()}}};class A8 extends x0{onExit(){return()=>{}}load(){}unload(){}}class M8 extends x0{#B=f0.platform==="win32"?"SIGINT":"SIGHUP";#F=new G8;#D;#X;#J;#$={};#E=!1;constructor(D){super();this.#D=D,this.#$={};for(let F of PD)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(!d2(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 PD)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,PD.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(!d2(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"&&d2(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 f0=globalThis.process,{onExit:U8,load:E4,unload:$4}=A1(d2(f0)?new M8(f0):new A8);import{stripVTControlCharacters as U1}from"util";var M1="\x1B[G",j8="\x1B[?25l",C8="\x1B[?25h",y0=(D=1)=>D>0?`\x1B[${D}A`:"",h0=(D=1)=>D>0?`\x1B[${D}B`:"",g0=(D,F)=>{if(typeof F==="number"&&!Number.isNaN(F))return`\x1B[${F+1};${D+1}H`;return`\x1B[${D+1}G`},z8="\x1B[2K",m0=(D)=>D>0?(z8+y0(1)).repeat(D-1)+z8+M1:"";var R8=(D)=>D.split(`
36
36
  `).length,z1=(D)=>D.split(`
37
- `).pop()??"";class D0{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=z1(D),E=A1(B),$=E;if(this.rl.line.length>0)$=$.slice(0,-this.rl.line.length);this.rl.setPrompt($),this.cursorPos=this.rl.getCursorPos();let X=s2();if(D=u2(D,X),F=u2(F,X),E.length%X===0)D+=`
37
+ `).pop()??"";class c2{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=z1(D),E=U1(B),$=E;if(this.rl.line.length>0)$=$.slice(0,-this.rl.line.length);this.rl.setPrompt($),this.cursorPos=this.rl.getCursorPos();let X=p2();if(D=R2(D,X),F=R2(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?f8(F):0);if(Y>0)J+=o0(Y);J+=t0(this.cursorPos.cols),this.write(s0(this.extraLinesUnderPrompt)+e0(this.height)+J),this.extraLinesUnderPrompt=Y,this.height=f8(J)}checkCursorPos(){let D=this.rl.getCursorPos();if(D.cols!==this.cursorPos.cols)this.write(t0(D.cols)),this.cursorPos=D}done({clearContent:D}){this.rl.setPrompt("");let F=s0(this.extraLinesUnderPrompt);F+=D?e0(this.height):`
40
- `,F+=Z8,this.write(F),this.rl.close()}}class D3 extends Promise{static withResolver(){let D,F;return{promise:new Promise((E,$)=>{D=E,F=$}),resolve:D,reject:F}}}function R1(){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 e(D){let F=R1();return(E,$={})=>{let{input:X=process.stdin,signal:J}=$,Q=new Set,Y=new y8.default;Y.pipe($.output??process.stdout);let W=x8.createInterface({terminal:!0,input:X,output:Y}),q=new D0(W),{promise:G,resolve:C,reject:A}=D3.withResolver(),T=()=>A(new v0);if(J){let V=()=>A(new k0({cause:J.reason}));if(J.aborted)return V(),Object.assign(G,{cancel:T});J.addEventListener("abort",V),Q.add(()=>J.removeEventListener("abort",V))}Q.add(k8((V,w)=>{A(new i2(`User force closed the prompt with ${V} ${w}`))}));let P=()=>A(new i2("User force closed the prompt with SIGINT"));W.on("SIGINT",P),Q.add(()=>W.removeListener("SIGINT",P));let k=()=>q.checkCursorPos();return W.input.on("keypress",k),Q.add(()=>W.input.removeListener("keypress",k)),p3(W,(V)=>{let w=U1.bind(()=>ZD.clearAll());return W.on("close",w),Q.add(()=>W.removeListener("close",w)),V(()=>{try{let f=D(E,(KD)=>{setImmediate(()=>C(KD))});if(f===void 0){let KD=F[1]?.getFileName();throw Error(`Prompt functions must return a string.
41
- at ${KD}`)}let[c,p]=typeof f==="string"?[f]:f;q.render(c,p),ZD.run()}catch(f){A(f)}}),Object.assign(G.then((f)=>{return ZD.clearAll(),f},(f)=>{throw ZD.clearAll(),f}).finally(()=>{Q.forEach((f)=>f()),q.done({clearContent:Boolean($.clearPromptOnDone)}),Y.end()}).then(()=>G),{cancel:T})})}}var h8=ND(L2(),1);class a{separator=h8.default.dim(Array.from({length:15}).join(qD.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")}}var xD=ND(L2(),1);var j1={icon:{checked:xD.default.green(qD.circleFilled),unchecked:qD.circle,cursor:qD.pointer},style:{disabledChoice:(D)=>xD.default.dim(`- ${D}`),renderSelectedChoices:(D)=>D.map((F)=>F.short).join(", "),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",keybindings:[]};function LD(D){return!a.isSeparator(D)&&!D.disabled}function F3(D){return LD(D)&&D.checked}function B3(D){return LD(D)?{...D,checked:!D.checked}:D}function C1(D){return function(F){return LD(F)?{...F,checked:D}:F}}function V1(D){return D.map((F)=>{if(a.isSeparator(F))return F;if(typeof F==="string")return{value:F,name:F,short:F,checkedName:F,disabled:!1,checked:!1};let B=F.name??String(F.value),E={value:F.value,name:B,short:F.short??B,checkedName:F.checkedName??B,disabled:F.disabled??!1,checked:F.checked??!1};if(F.description)E.description=F.description;return E})}var E3=e((D,F)=>{let{instructions:B,pageSize:E=7,loop:$=!0,required:X,validate:J=()=>!0}=D,Q={all:"a",invert:"i",...D.shortcuts},Y=n(j1,D.theme),{keybindings:W}=Y,[q,G]=Z("idle"),C=s({status:q,theme:Y}),[A,T]=Z(V1(D.choices)),P=O2(()=>{let b=A.findIndex(LD),K=A.findLastIndex(LD);if(b===-1)throw new N2("[checkbox prompt] No selectable choices. All choices are disabled.");return{first:b,last:K}},[A]),[k,V]=Z(P.first),[w,f]=Z();t(async(b)=>{if(o(b)){let K=A.filter(F3),v=await J([...K]);if(X&&!A.some(F3))f("At least one choice must be selected");else if(v===!0)G("done"),F(K.map((g)=>g.value));else f(v||"You must select a valid value")}else if(AD(b,W)||PD(b,W)){if($||AD(b,W)&&k!==P.first||PD(b,W)&&k!==P.last){let K=AD(b,W)?-1:1,v=k;do v=(v+K+A.length)%A.length;while(!LD(A[v]));V(v)}}else if(T0(b))f(void 0),T(A.map((K,v)=>v===k?B3(K):K));else if(b.name===Q.all){let K=A.some((v)=>LD(v)&&!v.checked);T(A.map(C1(K)))}else if(b.name===Q.invert)T(A.map(B3));else if(P0(b)){let K=Number(b.name)-1,v=-1,g=A.findIndex((QD)=>{if(a.isSeparator(QD))return!1;return v++,v===K}),r=A[g];if(r&&LD(r))V(g),T(A.map((QD,V2)=>V2===g?B3(QD):QD))}});let c=Y.style.message(D.message,q),p,KD=I2({items:A,active:k,renderItem({item:b,isActive:K}){if(a.isSeparator(b))return` ${b.separator}`;if(b.disabled){let V2=typeof b.disabled==="string"?b.disabled:"(disabled)";return Y.style.disabledChoice(`${b.name} ${V2}`)}if(K)p=b.description;let v=b.checked?Y.icon.checked:Y.icon.unchecked,g=b.checked?b.checkedName:b.name,r=K?Y.style.highlight:(V2)=>V2,QD=K?Y.icon.cursor:" ";return r(`${QD}${v} ${g}`)},pageSize:E,loop:$});if(q==="done"){let b=A.filter(F3),K=Y.style.answer(Y.style.renderSelectedChoices(b,A));return[C,c,K].filter(Boolean).join(" ")}let sD;if(Y.helpMode!=="never"&&B!==!1)if(typeof B==="string")sD=B;else{let b=[["\u2191\u2193","navigate"],["space","select"]];if(Q.all)b.push([Q.all,"all"]);if(Q.invert)b.push([Q.invert,"invert"]);b.push(["\u23CE","submit"]),sD=Y.style.keysHelpTip(b)}return`${[[C,c].filter(Boolean).join(" "),KD," ",p?Y.style.description(p):"",w?Y.style.error(w):"",sD].filter(Boolean).join(`
42
- `).trimEnd()}${e2}`});function g8(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 m8(D){return D?"Yes":"No"}var yD=e((D,F)=>{let{transformer:B=m8}=D,[E,$]=Z("idle"),[X,J]=Z(""),Q=n(D.theme),Y=s({status:E,theme:Q});t((C,A)=>{if(E!=="idle")return;if(o(C)){let T=g8(X,D.default);J(B(T)),$("done"),F(T)}else if(kD(C)){let T=m8(!g8(X,D.default));A.clearLine(0),A.write(T),J(T)}else J(A.line)});let W=X,q="";if(E==="done")W=Q.style.answer(X);else q=` ${Q.style.defaultAnswer(D.default===!1?"y/N":"Y/n")}`;let G=Q.style.message(D.message,E);return`${Y} ${G}${q} ${W}`});var K1={validationFailureMode:"keep"},F0=e((D,F)=>{let{prefill:B="tab"}=D,E=n(K1,D.theme),[$,X]=Z("idle"),[J="",Q]=Z(D.default),[Y,W]=Z(),[q,G]=Z(""),C=s({status:$,theme:E});async function A(w){let{required:f,pattern:c,patternError:p="Invalid input"}=D;if(f&&!w)return"You must provide a value";if(c&&!c.test(w))return p;if(typeof D.validate==="function")return await D.validate(w)||"You must provide a valid value";return!0}t(async(w,f)=>{if($!=="idle")return;if(o(w)){let c=q||J;X("loading");let p=await A(c);if(p===!0)G(c),X("done"),F(c);else{if(E.validationFailureMode==="clear")G("");else f.write(q);W(p),X("idle")}}else if(b0(w)&&!q)Q(void 0);else if(kD(w)&&!q)Q(void 0),f.clearLine(0),f.write(J),G(J);else G(f.line),W(void 0)}),zD((w)=>{if(B==="editable"&&J)w.write(J),G(J)},[]);let T=E.style.message(D.message,$),P=q;if(typeof D.transformer==="function")P=D.transformer(q,{isFinal:$==="done"});else if($==="done")P=E.style.answer(q);let k;if(J&&$!=="done"&&!q)k=E.style.defaultAnswer(J);let V="";if(Y)V=E.style.error(Y);return[[C,T,k,P].filter((w)=>w!==void 0).join(" "),V]});var N1=e((D,F)=>{let{validate:B=()=>!0}=D,E=n(D.theme),[$,X]=Z("idle"),[J,Q]=Z(),[Y,W]=Z(""),q=s({status:$,theme:E});t(async(P,k)=>{if($!=="idle")return;if(o(P)){let V=Y;X("loading");let w=await B(V);if(w===!0)W(V),X("done"),F(V);else k.write(Y),Q(w||"You must provide a valid value"),X("idle")}else W(k.line),Q(void 0)});let G=E.style.message(D.message,$),C="",A;if(D.mask)C=(typeof D.mask==="string"?D.mask:"*").repeat(Y.length);else if($!=="done")A=`${E.style.help("[input is masked]")}${e2}`;if($==="done")C=E.style.answer(C);let T="";if(J)T=E.style.error(J);return[[q,G,D.mask?C:A].join(" "),T]});var hD=ND(L2(),1);var L1={icon:{cursor:qD.pointer},style:{disabled:(D)=>hD.default.dim(`- ${D}`),searchTerm:(D)=>hD.default.cyan(D),description:(D)=>hD.default.cyan(D),keysHelpTip:(D)=>D.map(([F,B])=>`${hD.default.bold(F)} ${hD.default.dim(B)}`).join(hD.default.dim(" \u2022 "))},helpMode:"always"};function $3(D){return!a.isSeparator(D)&&!D.disabled}function O1(D){return D.map((F)=>{if(a.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 w1=e((D,F)=>{let{pageSize:B=7,validate:E=()=>!0}=D,$=n(L1,D.theme),[X,J]=Z("loading"),[Q,Y]=Z(""),[W,q]=Z([]),[G,C]=Z(),A=s({status:X,theme:$}),T=O2(()=>{let K=W.findIndex($3),v=W.findLastIndex($3);return{first:K,last:v}},[W]),[P=T.first,k]=Z();zD(()=>{let K=new AbortController;return J("loading"),C(void 0),(async()=>{try{let g=await D.source(Q||void 0,{signal:K.signal});if(!K.signal.aborted)k(void 0),C(void 0),q(O1(g)),J("idle")}catch(g){if(!K.signal.aborted&&g instanceof Error)C(g.message)}})(),()=>{K.abort()}},[Q]);let V=W[P];t(async(K,v)=>{if(o(K))if(V){J("loading");let g=await E(V.value);if(J("idle"),g===!0)J("done"),F(V.value);else if(V.name===Q)C(g||"You must provide a valid value");else v.write(V.name),Y(V.name)}else v.write(Q);else if(kD(K)&&V)v.clearLine(0),v.write(V.name),Y(V.name);else if(X!=="loading"&&(AD(K)||PD(K))){if(v.clearLine(0),AD(K)&&P!==T.first||PD(K)&&P!==T.last){let g=AD(K)?-1:1,r=P;do r=(r+g+W.length)%W.length;while(!$3(W[r]));k(r)}}else Y(v.line)});let w=$.style.message(D.message,X),f;if($.helpMode!=="never")if(D.instructions){let{pager:K,navigation:v}=D.instructions;f=$.style.help(W.length>B?K:v)}else f=$.style.keysHelpTip([["\u2191\u2193","navigate"],["\u23CE","select"]]);let c=I2({items:W,active:P,renderItem({item:K,isActive:v}){if(a.isSeparator(K))return` ${K.separator}`;if(K.disabled){let QD=typeof K.disabled==="string"?K.disabled:"(disabled)";return $.style.disabled(`${K.name} ${QD}`)}let g=v?$.style.highlight:(QD)=>QD,r=v?$.icon.cursor:" ";return g(`${r} ${K.name}`)},pageSize:B,loop:!1}),p;if(G)p=$.style.error(G);else if(W.length===0&&Q!==""&&X==="idle")p=$.style.error("No results found");let KD;if(X==="done"&&V)return[A,w,$.style.answer(V.short)].filter(Boolean).join(" ").trimEnd();else KD=$.style.searchTerm(Q);let sD=V?.description,L3=[A,w,KD].filter(Boolean).join(" ").trimEnd(),b=[p??c," ",sD?$.style.description(sD):"",f].filter(Boolean).join(`
43
- `).trimEnd();return[L3,b]});import{spawn as R7}from"child_process";import{platform as S1,arch as u1}from"os";import{readFile as I1}from"fs/promises";var{$:B0}=globalThis.Bun;function T1(){let D=S1();if(D==="darwin")return"macos";if(D==="linux")return"linux";return"unknown"}async function b1(){try{let F=(await I1("/etc/os-release","utf-8")).split(`
44
- `),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 T2(D){try{return(await B0`which ${D}`.quiet()).exitCode===0}catch{return!1}}async function P1(){if(await T2("brew"))return"brew";if(await T2("apt"))return"apt";if(await T2("dnf"))return"dnf";if(await T2("yum"))return"yum";if(await T2("pacman"))return"pacman";return"none"}async function l8(){let D=T1(),F=u1(),B={os:D,arch:F,preferredPM:await P1()};if(D==="linux")B.linuxDistro=await b1();return B}async function gD(D){try{let B=(await B0`which ${D}`.quiet().text()).trim();if(!B)return{exists:!1};let E;try{let X=(await B0`${D} --version`.quiet().text()).split(`
45
- `)[0].trim(),J=X.match(/(\d+\.[\d.]+[a-z0-9-]*)/i);E=J?J[1]:X.slice(0,50)}catch{try{let X=(await B0`${D} -v`.quiet().text()).split(`
46
- `)[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 k1=[{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 p8(){let D=[];for(let F of k1){let B=await gD(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 d8(D){return{ubuntu:"Ubuntu",debian:"Debian",fedora:"Fedora",rhel:"RHEL/CentOS",arch:"Arch Linux",unknown:"Linux"}[D]||"Linux"}import{existsSync as W3,mkdirSync as s5,readFileSync as t5,writeFileSync as e5}from"fs";import{homedir as D7}from"os";import{join as B6}from"path";var u={};l6(u,{void:()=>U5,util:()=>I,unknown:()=>A5,union:()=>V5,undefined:()=>H5,tuple:()=>L5,transformer:()=>v5,symbol:()=>_5,string:()=>e8,strictObject:()=>C5,setErrorMap:()=>f1,set:()=>S5,record:()=>O5,quotelessJson:()=>v1,promise:()=>k5,preprocess:()=>x5,pipeline:()=>y5,ostring:()=>h5,optional:()=>Z5,onumber:()=>g5,oboolean:()=>m5,objectUtil:()=>X3,object:()=>j5,number:()=>D6,nullable:()=>f5,null:()=>G5,never:()=>z5,nativeEnum:()=>P5,nan:()=>Y5,map:()=>w5,makeIssue:()=>b2,literal:()=>T5,lazy:()=>I5,late:()=>J5,isValid:()=>OD,isDirty:()=>$0,isAsync:()=>E2,isAborted:()=>E0,intersection:()=>N5,instanceof:()=>Q5,getParsedType:()=>_D,getErrorMap:()=>B2,function:()=>u5,enum:()=>b5,effect:()=>v5,discriminatedUnion:()=>K5,defaultErrorMap:()=>UD,datetimeRegex:()=>o8,date:()=>q5,custom:()=>t8,coerce:()=>l5,boolean:()=>F6,bigint:()=>W5,array:()=>R5,any:()=>M5,addIssueToContext:()=>M,ZodVoid:()=>k2,ZodUnknown:()=>wD,ZodUnion:()=>W2,ZodUndefined:()=>Q2,ZodType:()=>S,ZodTuple:()=>GD,ZodTransformer:()=>$D,ZodSymbol:()=>P2,ZodString:()=>DD,ZodSet:()=>dD,ZodSchema:()=>S,ZodRecord:()=>v2,ZodReadonly:()=>z2,ZodPromise:()=>cD,ZodPipeline:()=>x2,ZodParsedType:()=>H,ZodOptional:()=>BD,ZodObject:()=>x,ZodNumber:()=>SD,ZodNullable:()=>jD,ZodNull:()=>Y2,ZodNever:()=>HD,ZodNativeEnum:()=>G2,ZodNaN:()=>f2,ZodMap:()=>Z2,ZodLiteral:()=>H2,ZodLazy:()=>_2,ZodIssueCode:()=>_,ZodIntersection:()=>q2,ZodFunction:()=>X2,ZodFirstPartyTypeKind:()=>j,ZodError:()=>d,ZodEnum:()=>ID,ZodEffects:()=>$D,ZodDiscriminatedUnion:()=>X0,ZodDefault:()=>M2,ZodDate:()=>lD,ZodCatch:()=>A2,ZodBranded:()=>J0,ZodBoolean:()=>J2,ZodBigInt:()=>uD,ZodArray:()=>FD,ZodAny:()=>pD,Schema:()=>S,ParseStatus:()=>m,OK:()=>l,NEVER:()=>p5,INVALID:()=>R,EMPTY_PATH:()=>x1,DIRTY:()=>mD,BRAND:()=>X5});var I;(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}})(I||(I={}));var X3;(function(D){D.mergeShapes=(F,B)=>{return{...F,...B}}})(X3||(X3={}));var H=I.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),_D=(D)=>{switch(typeof D){case"undefined":return H.undefined;case"string":return H.string;case"number":return Number.isNaN(D)?H.nan:H.number;case"boolean":return H.boolean;case"function":return H.function;case"bigint":return H.bigint;case"symbol":return H.symbol;case"object":if(Array.isArray(D))return H.array;if(D===null)return H.null;if(D.then&&typeof D.then==="function"&&D.catch&&typeof D.catch==="function")return H.promise;if(typeof Map<"u"&&D instanceof Map)return H.map;if(typeof Set<"u"&&D instanceof Set)return H.set;if(typeof Date<"u"&&D instanceof Date)return H.date;return H.object;default:return H.unknown}};var _=I.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"]),v1=(D)=>{return JSON.stringify(D,null,2).replace(/"([^"]+)":/g,"$1:")};class d 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 d))throw Error(`Not a ZodError: ${D}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,I.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()}}d.create=(D)=>{return new d(D)};var Z1=(D,F)=>{let B;switch(D.code){case _.invalid_type:if(D.received===H.undefined)B="Required";else B=`Expected ${D.expected}, received ${D.received}`;break;case _.invalid_literal:B=`Invalid literal value, expected ${JSON.stringify(D.expected,I.jsonStringifyReplacer)}`;break;case _.unrecognized_keys:B=`Unrecognized key(s) in object: ${I.joinValues(D.keys,", ")}`;break;case _.invalid_union:B="Invalid input";break;case _.invalid_union_discriminator:B=`Invalid discriminator value. Expected ${I.joinValues(D.options)}`;break;case _.invalid_enum_value:B=`Invalid enum value. Expected ${I.joinValues(D.options)}, received '${D.received}'`;break;case _.invalid_arguments:B="Invalid function arguments";break;case _.invalid_return_type:B="Invalid function return type";break;case _.invalid_date:B="Invalid date";break;case _.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 I.assertNever(D.validation);else if(D.validation!=="regex")B=`Invalid ${D.validation}`;else B="Invalid";break;case _.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 _.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 _.custom:B="Invalid input";break;case _.invalid_intersection_types:B="Intersection results could not be merged";break;case _.not_multiple_of:B=`Number must be a multiple of ${D.multipleOf}`;break;case _.not_finite:B="Number must be finite";break;default:B=F.defaultError,I.assertNever(D)}return{message:B}},UD=Z1;var c8=UD;function f1(D){c8=D}function B2(){return c8}var b2=(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}},x1=[];function M(D,F){let B=B2(),E=b2({issueData:F,data:D.data,path:D.path,errorMaps:[D.common.contextualErrorMap,D.schemaErrorMap,B,B===UD?void 0:UD].filter(($)=>!!$)});D.common.issues.push(E)}class m{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 R;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 m.mergeObjectSync(D,B)}static mergeObjectSync(D,F){let B={};for(let E of F){let{key:$,value:X}=E;if($.status==="aborted")return R;if(X.status==="aborted")return R;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 R=Object.freeze({status:"aborted"}),mD=(D)=>({status:"dirty",value:D}),l=(D)=>({status:"valid",value:D}),E0=(D)=>D.status==="aborted",$0=(D)=>D.status==="dirty",OD=(D)=>D.status==="valid",E2=(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 ED{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 n8=(D,F)=>{if(OD(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 d(D.common.issues);return this._error=B,this._error}}}};function L(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 S{get description(){return this._def.description}_getType(D){return _D(D.data)}_getOrReturnCtx(D,F){return F||{common:D.parent.common,data:D.data,parsedType:_D(D.data),schemaErrorMap:this._def.errorMap,path:D.path,parent:D.parent}}_processInputParams(D){return{status:new m,ctx:{common:D.parent.common,data:D.data,parsedType:_D(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:_D(D)},E=this._parseSync({data:D,path:B.path,parent:B});return n8(B,E)}"~validate"(D){let F={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:D,parsedType:_D(D)};if(!this["~standard"].async)try{let B=this._parseSync({data:D,path:[],parent:F});return OD(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)=>OD(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:_D(D)},E=this._parse({data:D,path:B.path,parent:B}),$=await(E2(E)?E:Promise.resolve(E));return n8(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:_.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 $D({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 BD.create(this,this._def)}nullable(){return jD.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return FD.create(this)}promise(){return cD.create(this,this._def)}or(D){return W2.create([this,D],this._def)}and(D){return q2.create(this,D,this._def)}transform(D){return new $D({...L(this._def),schema:this,typeName:j.ZodEffects,effect:{type:"transform",transform:D}})}default(D){let F=typeof D==="function"?D:()=>D;return new M2({...L(this._def),innerType:this,defaultValue:F,typeName:j.ZodDefault})}brand(){return new J0({typeName:j.ZodBranded,type:this,...L(this._def)})}catch(D){let F=typeof D==="function"?D:()=>D;return new A2({...L(this._def),innerType:this,catchValue:F,typeName:j.ZodCatch})}describe(D){return new this.constructor({...this._def,description:D})}pipe(D){return x2.create(this,D)}readonly(){return z2.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var y1=/^c[^\s-]{8,}$/i,h1=/^[0-9a-z]+$/,g1=/^[0-9A-HJKMNP-TV-Z]{26}$/i,m1=/^[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,l1=/^[a-z0-9_-]{21}$/i,p1=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,d1=/^[-+]?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)?)??$/,c1=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,n1="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",J3,i1=/^(?:(?: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])$/,a1=/^(?:(?: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])$/,r1=/^(([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]))$/,o1=/^(([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])$/,s1=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,t1=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,a8="((\\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])))",e1=new RegExp(`^${a8}$`);function r8(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 D5(D){return new RegExp(`^${r8(D)}$`)}function o8(D){let F=`${a8}T${r8(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 F5(D,F){if((F==="v4"||!F)&&i1.test(D))return!0;if((F==="v6"||!F)&&r1.test(D))return!0;return!1}function B5(D,F){if(!p1.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 E5(D,F){if((F==="v4"||!F)&&a1.test(D))return!0;if((F==="v6"||!F)&&o1.test(D))return!0;return!1}class DD extends S{_parse(D){if(this._def.coerce)D.data=String(D.data);if(this._getType(D)!==H.string){let $=this._getOrReturnCtx(D);return M($,{code:_.invalid_type,expected:H.string,received:$.parsedType}),R}let B=new m,E=void 0;for(let $ of this._def.checks)if($.kind==="min"){if(D.data.length<$.value)E=this._getOrReturnCtx(D,E),M(E,{code:_.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),M(E,{code:_.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)M(E,{code:_.too_big,maximum:$.value,type:"string",inclusive:!0,exact:!0,message:$.message});else if(J)M(E,{code:_.too_small,minimum:$.value,type:"string",inclusive:!0,exact:!0,message:$.message});B.dirty()}}else if($.kind==="email"){if(!c1.test(D.data))E=this._getOrReturnCtx(D,E),M(E,{validation:"email",code:_.invalid_string,message:$.message}),B.dirty()}else if($.kind==="emoji"){if(!J3)J3=new RegExp(n1,"u");if(!J3.test(D.data))E=this._getOrReturnCtx(D,E),M(E,{validation:"emoji",code:_.invalid_string,message:$.message}),B.dirty()}else if($.kind==="uuid"){if(!m1.test(D.data))E=this._getOrReturnCtx(D,E),M(E,{validation:"uuid",code:_.invalid_string,message:$.message}),B.dirty()}else if($.kind==="nanoid"){if(!l1.test(D.data))E=this._getOrReturnCtx(D,E),M(E,{validation:"nanoid",code:_.invalid_string,message:$.message}),B.dirty()}else if($.kind==="cuid"){if(!y1.test(D.data))E=this._getOrReturnCtx(D,E),M(E,{validation:"cuid",code:_.invalid_string,message:$.message}),B.dirty()}else if($.kind==="cuid2"){if(!h1.test(D.data))E=this._getOrReturnCtx(D,E),M(E,{validation:"cuid2",code:_.invalid_string,message:$.message}),B.dirty()}else if($.kind==="ulid"){if(!g1.test(D.data))E=this._getOrReturnCtx(D,E),M(E,{validation:"ulid",code:_.invalid_string,message:$.message}),B.dirty()}else if($.kind==="url")try{new URL(D.data)}catch{E=this._getOrReturnCtx(D,E),M(E,{validation:"url",code:_.invalid_string,message:$.message}),B.dirty()}else if($.kind==="regex"){if($.regex.lastIndex=0,!$.regex.test(D.data))E=this._getOrReturnCtx(D,E),M(E,{validation:"regex",code:_.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),M(E,{code:_.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),M(E,{code:_.invalid_string,validation:{startsWith:$.value},message:$.message}),B.dirty()}else if($.kind==="endsWith"){if(!D.data.endsWith($.value))E=this._getOrReturnCtx(D,E),M(E,{code:_.invalid_string,validation:{endsWith:$.value},message:$.message}),B.dirty()}else if($.kind==="datetime"){if(!o8($).test(D.data))E=this._getOrReturnCtx(D,E),M(E,{code:_.invalid_string,validation:"datetime",message:$.message}),B.dirty()}else if($.kind==="date"){if(!e1.test(D.data))E=this._getOrReturnCtx(D,E),M(E,{code:_.invalid_string,validation:"date",message:$.message}),B.dirty()}else if($.kind==="time"){if(!D5($).test(D.data))E=this._getOrReturnCtx(D,E),M(E,{code:_.invalid_string,validation:"time",message:$.message}),B.dirty()}else if($.kind==="duration"){if(!d1.test(D.data))E=this._getOrReturnCtx(D,E),M(E,{validation:"duration",code:_.invalid_string,message:$.message}),B.dirty()}else if($.kind==="ip"){if(!F5(D.data,$.version))E=this._getOrReturnCtx(D,E),M(E,{validation:"ip",code:_.invalid_string,message:$.message}),B.dirty()}else if($.kind==="jwt"){if(!B5(D.data,$.alg))E=this._getOrReturnCtx(D,E),M(E,{validation:"jwt",code:_.invalid_string,message:$.message}),B.dirty()}else if($.kind==="cidr"){if(!E5(D.data,$.version))E=this._getOrReturnCtx(D,E),M(E,{validation:"cidr",code:_.invalid_string,message:$.message}),B.dirty()}else if($.kind==="base64"){if(!s1.test(D.data))E=this._getOrReturnCtx(D,E),M(E,{validation:"base64",code:_.invalid_string,message:$.message}),B.dirty()}else if($.kind==="base64url"){if(!t1.test(D.data))E=this._getOrReturnCtx(D,E),M(E,{validation:"base64url",code:_.invalid_string,message:$.message}),B.dirty()}else I.assertNever($);return{status:B.value,value:D.data}}_regex(D,F,B){return this.refinement((E)=>D.test(E),{validation:F,code:_.invalid_string,...U.errToObj(B)})}_addCheck(D){return new DD({...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 DD({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new DD({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new DD({...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}}DD.create=(D)=>{return new DD({checks:[],typeName:j.ZodString,coerce:D?.coerce??!1,...L(D)})};function $5(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 SD extends S{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)!==H.number){let $=this._getOrReturnCtx(D);return M($,{code:_.invalid_type,expected:H.number,received:$.parsedType}),R}let B=void 0,E=new m;for(let $ of this._def.checks)if($.kind==="int"){if(!I.isInteger(D.data))B=this._getOrReturnCtx(D,B),M(B,{code:_.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),M(B,{code:_.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),M(B,{code:_.too_big,maximum:$.value,type:"number",inclusive:$.inclusive,exact:!1,message:$.message}),E.dirty()}else if($.kind==="multipleOf"){if($5(D.data,$.value)!==0)B=this._getOrReturnCtx(D,B),M(B,{code:_.not_multiple_of,multipleOf:$.value,message:$.message}),E.dirty()}else if($.kind==="finite"){if(!Number.isFinite(D.data))B=this._getOrReturnCtx(D,B),M(B,{code:_.not_finite,message:$.message}),E.dirty()}else I.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 SD({...this._def,checks:[...this._def.checks,{kind:D,value:F,inclusive:B,message:U.toString(E)}]})}_addCheck(D){return new SD({...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"&&I.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)}}SD.create=(D)=>{return new SD({checks:[],typeName:j.ZodNumber,coerce:D?.coerce||!1,...L(D)})};class uD extends S{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)!==H.bigint)return this._getInvalidInput(D);let B=void 0,E=new m;for(let $ of this._def.checks)if($.kind==="min"){if($.inclusive?D.data<$.value:D.data<=$.value)B=this._getOrReturnCtx(D,B),M(B,{code:_.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),M(B,{code:_.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),M(B,{code:_.not_multiple_of,multipleOf:$.value,message:$.message}),E.dirty()}else I.assertNever($);return{status:E.value,value:D.data}}_getInvalidInput(D){let F=this._getOrReturnCtx(D);return M(F,{code:_.invalid_type,expected:H.bigint,received:F.parsedType}),R}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 uD({...this._def,checks:[...this._def.checks,{kind:D,value:F,inclusive:B,message:U.toString(E)}]})}_addCheck(D){return new uD({...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}}uD.create=(D)=>{return new uD({checks:[],typeName:j.ZodBigInt,coerce:D?.coerce??!1,...L(D)})};class J2 extends S{_parse(D){if(this._def.coerce)D.data=Boolean(D.data);if(this._getType(D)!==H.boolean){let B=this._getOrReturnCtx(D);return M(B,{code:_.invalid_type,expected:H.boolean,received:B.parsedType}),R}return l(D.data)}}J2.create=(D)=>{return new J2({typeName:j.ZodBoolean,coerce:D?.coerce||!1,...L(D)})};class lD extends S{_parse(D){if(this._def.coerce)D.data=new Date(D.data);if(this._getType(D)!==H.date){let $=this._getOrReturnCtx(D);return M($,{code:_.invalid_type,expected:H.date,received:$.parsedType}),R}if(Number.isNaN(D.data.getTime())){let $=this._getOrReturnCtx(D);return M($,{code:_.invalid_date}),R}let B=new m,E=void 0;for(let $ of this._def.checks)if($.kind==="min"){if(D.data.getTime()<$.value)E=this._getOrReturnCtx(D,E),M(E,{code:_.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),M(E,{code:_.too_big,message:$.message,inclusive:!0,exact:!1,maximum:$.value,type:"date"}),B.dirty()}else I.assertNever($);return{status:B.value,value:new Date(D.data.getTime())}}_addCheck(D){return new lD({...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}}lD.create=(D)=>{return new lD({checks:[],coerce:D?.coerce||!1,typeName:j.ZodDate,...L(D)})};class P2 extends S{_parse(D){if(this._getType(D)!==H.symbol){let B=this._getOrReturnCtx(D);return M(B,{code:_.invalid_type,expected:H.symbol,received:B.parsedType}),R}return l(D.data)}}P2.create=(D)=>{return new P2({typeName:j.ZodSymbol,...L(D)})};class Q2 extends S{_parse(D){if(this._getType(D)!==H.undefined){let B=this._getOrReturnCtx(D);return M(B,{code:_.invalid_type,expected:H.undefined,received:B.parsedType}),R}return l(D.data)}}Q2.create=(D)=>{return new Q2({typeName:j.ZodUndefined,...L(D)})};class Y2 extends S{_parse(D){if(this._getType(D)!==H.null){let B=this._getOrReturnCtx(D);return M(B,{code:_.invalid_type,expected:H.null,received:B.parsedType}),R}return l(D.data)}}Y2.create=(D)=>{return new Y2({typeName:j.ZodNull,...L(D)})};class pD extends S{constructor(){super(...arguments);this._any=!0}_parse(D){return l(D.data)}}pD.create=(D)=>{return new pD({typeName:j.ZodAny,...L(D)})};class wD extends S{constructor(){super(...arguments);this._unknown=!0}_parse(D){return l(D.data)}}wD.create=(D)=>{return new wD({typeName:j.ZodUnknown,...L(D)})};class HD extends S{_parse(D){let F=this._getOrReturnCtx(D);return M(F,{code:_.invalid_type,expected:H.never,received:F.parsedType}),R}}HD.create=(D)=>{return new HD({typeName:j.ZodNever,...L(D)})};class k2 extends S{_parse(D){if(this._getType(D)!==H.undefined){let B=this._getOrReturnCtx(D);return M(B,{code:_.invalid_type,expected:H.void,received:B.parsedType}),R}return l(D.data)}}k2.create=(D)=>{return new k2({typeName:j.ZodVoid,...L(D)})};class FD extends S{_parse(D){let{ctx:F,status:B}=this._processInputParams(D),E=this._def;if(F.parsedType!==H.array)return M(F,{code:_.invalid_type,expected:H.array,received:F.parsedType}),R;if(E.exactLength!==null){let X=F.data.length>E.exactLength.value,J=F.data.length<E.exactLength.value;if(X||J)M(F,{code:X?_.too_big:_.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)M(F,{code:_.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)M(F,{code:_.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 ED(F,X,F.path,J))})).then((X)=>{return m.mergeArray(B,X)});let $=[...F.data].map((X,J)=>{return E.type._parseSync(new ED(F,X,F.path,J))});return m.mergeArray(B,$)}get element(){return this._def.type}min(D,F){return new FD({...this._def,minLength:{value:D,message:U.toString(F)}})}max(D,F){return new FD({...this._def,maxLength:{value:D,message:U.toString(F)}})}length(D,F){return new FD({...this._def,exactLength:{value:D,message:U.toString(F)}})}nonempty(D){return this.min(1,D)}}FD.create=(D,F)=>{return new FD({type:D,minLength:null,maxLength:null,exactLength:null,typeName:j.ZodArray,...L(F)})};function $2(D){if(D instanceof x){let F={};for(let B in D.shape){let E=D.shape[B];F[B]=BD.create($2(E))}return new x({...D._def,shape:()=>F})}else if(D instanceof FD)return new FD({...D._def,type:$2(D.element)});else if(D instanceof BD)return BD.create($2(D.unwrap()));else if(D instanceof jD)return jD.create($2(D.unwrap()));else if(D instanceof GD)return GD.create(D.items.map((F)=>$2(F)));else return D}class x extends S{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=I.objectKeys(D);return this._cached={shape:D,keys:F},this._cached}_parse(D){if(this._getType(D)!==H.object){let Y=this._getOrReturnCtx(D);return M(Y,{code:_.invalid_type,expected:H.object,received:Y.parsedType}),R}let{status:B,ctx:E}=this._processInputParams(D),{shape:$,keys:X}=this._getCached(),J=[];if(!(this._def.catchall instanceof HD&&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],q=E.data[Y];Q.push({key:{status:"valid",value:Y},value:W._parse(new ED(E,q,E.path,Y)),alwaysSet:Y in E.data})}if(this._def.catchall instanceof HD){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)M(E,{code:_.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 q=E.data[W];Q.push({key:{status:"valid",value:W},value:Y._parse(new ED(E,q,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 q=await W.key,G=await W.value;Y.push({key:q,value:G,alwaysSet:W.alwaysSet})}return Y}).then((Y)=>{return m.mergeObjectSync(B,Y)});else return m.mergeObjectSync(B,Q)}get shape(){return this._def.shape()}strict(D){return U.errToObj,new x({...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 x({...this._def,unknownKeys:"strip"})}passthrough(){return new x({...this._def,unknownKeys:"passthrough"})}extend(D){return new x({...this._def,shape:()=>({...this._def.shape(),...D})})}merge(D){return new x({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 x({...this._def,catchall:D})}pick(D){let F={};for(let B of I.objectKeys(D))if(D[B]&&this.shape[B])F[B]=this.shape[B];return new x({...this._def,shape:()=>F})}omit(D){let F={};for(let B of I.objectKeys(this.shape))if(!D[B])F[B]=this.shape[B];return new x({...this._def,shape:()=>F})}deepPartial(){return $2(this)}partial(D){let F={};for(let B of I.objectKeys(this.shape)){let E=this.shape[B];if(D&&!D[B])F[B]=E;else F[B]=E.optional()}return new x({...this._def,shape:()=>F})}required(D){let F={};for(let B of I.objectKeys(this.shape))if(D&&!D[B])F[B]=this.shape[B];else{let $=this.shape[B];while($ instanceof BD)$=$._def.innerType;F[B]=$}return new x({...this._def,shape:()=>F})}keyof(){return s8(I.objectKeys(this.shape))}}x.create=(D,F)=>{return new x({shape:()=>D,unknownKeys:"strip",catchall:HD.create(),typeName:j.ZodObject,...L(F)})};x.strictCreate=(D,F)=>{return new x({shape:()=>D,unknownKeys:"strict",catchall:HD.create(),typeName:j.ZodObject,...L(F)})};x.lazycreate=(D,F)=>{return new x({shape:D,unknownKeys:"strip",catchall:HD.create(),typeName:j.ZodObject,...L(F)})};class W2 extends S{_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 d(J.ctx.common.issues));return M(F,{code:_.invalid_union,unionErrors:X}),R}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 d(Q));return M(F,{code:_.invalid_union,unionErrors:J}),R}}get options(){return this._def.options}}W2.create=(D,F)=>{return new W2({options:D,typeName:j.ZodUnion,...L(F)})};var RD=(D)=>{if(D instanceof _2)return RD(D.schema);else if(D instanceof $D)return RD(D.innerType());else if(D instanceof H2)return[D.value];else if(D instanceof ID)return D.options;else if(D instanceof G2)return I.objectValues(D.enum);else if(D instanceof M2)return RD(D._def.innerType);else if(D instanceof Q2)return[void 0];else if(D instanceof Y2)return[null];else if(D instanceof BD)return[void 0,...RD(D.unwrap())];else if(D instanceof jD)return[null,...RD(D.unwrap())];else if(D instanceof J0)return RD(D.unwrap());else if(D instanceof z2)return RD(D.unwrap());else if(D instanceof A2)return RD(D._def.innerType);else return[]};class X0 extends S{_parse(D){let{ctx:F}=this._processInputParams(D);if(F.parsedType!==H.object)return M(F,{code:_.invalid_type,expected:H.object,received:F.parsedType}),R;let B=this.discriminator,E=F.data[B],$=this.optionsMap.get(E);if(!$)return M(F,{code:_.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[B]}),R;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=RD($.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 X0({typeName:j.ZodDiscriminatedUnion,discriminator:D,options:F,optionsMap:E,...L(B)})}}function Q3(D,F){let B=_D(D),E=_D(F);if(D===F)return{valid:!0,data:D};else if(B===H.object&&E===H.object){let $=I.objectKeys(F),X=I.objectKeys(D).filter((Q)=>$.indexOf(Q)!==-1),J={...D,...F};for(let Q of X){let Y=Q3(D[Q],F[Q]);if(!Y.valid)return{valid:!1};J[Q]=Y.data}return{valid:!0,data:J}}else if(B===H.array&&E===H.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=Q3(J,Q);if(!Y.valid)return{valid:!1};$.push(Y.data)}return{valid:!0,data:$}}else if(B===H.date&&E===H.date&&+D===+F)return{valid:!0,data:D};else return{valid:!1}}class q2 extends S{_parse(D){let{status:F,ctx:B}=this._processInputParams(D),E=($,X)=>{if(E0($)||E0(X))return R;let J=Q3($.value,X.value);if(!J.valid)return M(B,{code:_.invalid_intersection_types}),R;if($0($)||$0(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,...L(B)})};class GD extends S{_parse(D){let{status:F,ctx:B}=this._processInputParams(D);if(B.parsedType!==H.array)return M(B,{code:_.invalid_type,expected:H.array,received:B.parsedType}),R;if(B.data.length<this._def.items.length)return M(B,{code:_.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),R;if(!this._def.rest&&B.data.length>this._def.items.length)M(B,{code:_.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 ED(B,X,B.path,J))}).filter((X)=>!!X);if(B.common.async)return Promise.all($).then((X)=>{return m.mergeArray(F,X)});else return m.mergeArray(F,$)}get items(){return this._def.items}rest(D){return new GD({...this._def,rest:D})}}GD.create=(D,F)=>{if(!Array.isArray(D))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new GD({items:D,typeName:j.ZodTuple,rest:null,...L(F)})};class v2 extends S{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!==H.object)return M(B,{code:_.invalid_type,expected:H.object,received:B.parsedType}),R;let E=[],$=this._def.keyType,X=this._def.valueType;for(let J in B.data)E.push({key:$._parse(new ED(B,J,B.path,J)),value:X._parse(new ED(B,B.data[J],B.path,J)),alwaysSet:J in B.data});if(B.common.async)return m.mergeObjectAsync(F,E);else return m.mergeObjectSync(F,E)}get element(){return this._def.valueType}static create(D,F,B){if(F instanceof S)return new v2({keyType:D,valueType:F,typeName:j.ZodRecord,...L(B)});return new v2({keyType:DD.create(),valueType:D,typeName:j.ZodRecord,...L(F)})}}class Z2 extends S{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!==H.map)return M(B,{code:_.invalid_type,expected:H.map,received:B.parsedType}),R;let E=this._def.keyType,$=this._def.valueType,X=[...B.data.entries()].map(([J,Q],Y)=>{return{key:E._parse(new ED(B,J,B.path,[Y,"key"])),value:$._parse(new ED(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 R;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 R;if(Y.status==="dirty"||W.status==="dirty")F.dirty();J.set(Y.value,W.value)}return{status:F.value,value:J}}}}Z2.create=(D,F,B)=>{return new Z2({valueType:F,keyType:D,typeName:j.ZodMap,...L(B)})};class dD extends S{_parse(D){let{status:F,ctx:B}=this._processInputParams(D);if(B.parsedType!==H.set)return M(B,{code:_.invalid_type,expected:H.set,received:B.parsedType}),R;let E=this._def;if(E.minSize!==null){if(B.data.size<E.minSize.value)M(B,{code:_.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)M(B,{code:_.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 R;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 ED(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 dD({...this._def,minSize:{value:D,message:U.toString(F)}})}max(D,F){return new dD({...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)}}dD.create=(D,F)=>{return new dD({valueType:D,minSize:null,maxSize:null,typeName:j.ZodSet,...L(F)})};class X2 extends S{constructor(){super(...arguments);this.validate=this.implement}_parse(D){let{ctx:F}=this._processInputParams(D);if(F.parsedType!==H.function)return M(F,{code:_.invalid_type,expected:H.function,received:F.parsedType}),R;function B(J,Q){return b2({data:J,path:F.path,errorMaps:[F.common.contextualErrorMap,F.schemaErrorMap,B2(),UD].filter((Y)=>!!Y),issueData:{code:_.invalid_arguments,argumentsError:Q}})}function E(J,Q){return b2({data:J,path:F.path,errorMaps:[F.common.contextualErrorMap,F.schemaErrorMap,B2(),UD].filter((Y)=>!!Y),issueData:{code:_.invalid_return_type,returnTypeError:Q}})}let $={errorMap:F.common.contextualErrorMap},X=F.data;if(this._def.returns instanceof cD){let J=this;return l(async function(...Q){let Y=new d([]),W=await J._def.args.parseAsync(Q,$).catch((C)=>{throw Y.addIssue(B(Q,C)),Y}),q=await Reflect.apply(X,this,W);return await J._def.returns._def.type.parseAsync(q,$).catch((C)=>{throw Y.addIssue(E(q,C)),Y})})}else{let J=this;return l(function(...Q){let Y=J._def.args.safeParse(Q,$);if(!Y.success)throw new d([B(Q,Y.error)]);let W=Reflect.apply(X,this,Y.data),q=J._def.returns.safeParse(W,$);if(!q.success)throw new d([E(W,q.error)]);return q.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...D){return new X2({...this._def,args:GD.create(D).rest(wD.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:GD.create([]).rest(wD.create()),returns:F||wD.create(),typeName:j.ZodFunction,...L(B)})}}class _2 extends S{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})}}_2.create=(D,F)=>{return new _2({getter:D,typeName:j.ZodLazy,...L(F)})};class H2 extends S{_parse(D){if(D.data!==this._def.value){let F=this._getOrReturnCtx(D);return M(F,{received:F.data,code:_.invalid_literal,expected:this._def.value}),R}return{status:"valid",value:D.data}}get value(){return this._def.value}}H2.create=(D,F)=>{return new H2({value:D,typeName:j.ZodLiteral,...L(F)})};function s8(D,F){return new ID({values:D,typeName:j.ZodEnum,...L(F)})}class ID extends S{_parse(D){if(typeof D.data!=="string"){let F=this._getOrReturnCtx(D),B=this._def.values;return M(F,{expected:I.joinValues(B),received:F.parsedType,code:_.invalid_type}),R}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 M(F,{received:F.data,code:_.invalid_enum_value,options:B}),R}return l(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 ID.create(D,{...this._def,...F})}exclude(D,F=this._def){return ID.create(this.options.filter((B)=>!D.includes(B)),{...this._def,...F})}}ID.create=s8;class G2 extends S{_parse(D){let F=I.getValidEnumValues(this._def.values),B=this._getOrReturnCtx(D);if(B.parsedType!==H.string&&B.parsedType!==H.number){let E=I.objectValues(F);return M(B,{expected:I.joinValues(E),received:B.parsedType,code:_.invalid_type}),R}if(!this._cache)this._cache=new Set(I.getValidEnumValues(this._def.values));if(!this._cache.has(D.data)){let E=I.objectValues(F);return M(B,{received:B.data,code:_.invalid_enum_value,options:E}),R}return l(D.data)}get enum(){return this._def.values}}G2.create=(D,F)=>{return new G2({values:D,typeName:j.ZodNativeEnum,...L(F)})};class cD extends S{unwrap(){return this._def.type}_parse(D){let{ctx:F}=this._processInputParams(D);if(F.parsedType!==H.promise&&F.common.async===!1)return M(F,{code:_.invalid_type,expected:H.promise,received:F.parsedType}),R;let B=F.parsedType===H.promise?F.data:Promise.resolve(F.data);return l(B.then((E)=>{return this._def.type.parseAsync(E,{path:F.path,errorMap:F.common.contextualErrorMap})}))}}cD.create=(D,F)=>{return new cD({type:D,typeName:j.ZodPromise,...L(F)})};class $D extends S{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(M(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 R;let Q=await this._def.schema._parseAsync({data:J,path:B.path,parent:B});if(Q.status==="aborted")return R;if(Q.status==="dirty")return mD(Q.value);if(F.value==="dirty")return mD(Q.value);return Q});else{if(F.value==="aborted")return R;let J=this._def.schema._parseSync({data:X,path:B.path,parent:B});if(J.status==="aborted")return R;if(J.status==="dirty")return mD(J.value);if(F.value==="dirty")return mD(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 R;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 R;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(!OD(X))return R;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(!OD(X))return R;return Promise.resolve(E.transform(X.value,$)).then((J)=>({status:F.value,value:J}))});I.assertNever(E)}}$D.create=(D,F,B)=>{return new $D({schema:D,typeName:j.ZodEffects,effect:F,...L(B)})};$D.createWithPreprocess=(D,F,B)=>{return new $D({schema:F,effect:{type:"preprocess",transform:D},typeName:j.ZodEffects,...L(B)})};class BD extends S{_parse(D){if(this._getType(D)===H.undefined)return l(void 0);return this._def.innerType._parse(D)}unwrap(){return this._def.innerType}}BD.create=(D,F)=>{return new BD({innerType:D,typeName:j.ZodOptional,...L(F)})};class jD extends S{_parse(D){if(this._getType(D)===H.null)return l(null);return this._def.innerType._parse(D)}unwrap(){return this._def.innerType}}jD.create=(D,F)=>{return new jD({innerType:D,typeName:j.ZodNullable,...L(F)})};class M2 extends S{_parse(D){let{ctx:F}=this._processInputParams(D),B=F.data;if(F.parsedType===H.undefined)B=this._def.defaultValue();return this._def.innerType._parse({data:B,path:F.path,parent:F})}removeDefault(){return this._def.innerType}}M2.create=(D,F)=>{return new M2({innerType:D,typeName:j.ZodDefault,defaultValue:typeof F.default==="function"?F.default:()=>F.default,...L(F)})};class A2 extends S{_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 d(B.common.issues)},input:B.data})}});else return{status:"valid",value:E.status==="valid"?E.value:this._def.catchValue({get error(){return new d(B.common.issues)},input:B.data})}}removeCatch(){return this._def.innerType}}A2.create=(D,F)=>{return new A2({innerType:D,typeName:j.ZodCatch,catchValue:typeof F.catch==="function"?F.catch:()=>F.catch,...L(F)})};class f2 extends S{_parse(D){if(this._getType(D)!==H.nan){let B=this._getOrReturnCtx(D);return M(B,{code:_.invalid_type,expected:H.nan,received:B.parsedType}),R}return{status:"valid",value:D.data}}}f2.create=(D)=>{return new f2({typeName:j.ZodNaN,...L(D)})};var X5=Symbol("zod_brand");class J0 extends S{_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 x2 extends S{_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 R;if($.status==="dirty")return F.dirty(),mD($.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 R;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 x2({in:D,out:F,typeName:j.ZodPipeline})}}class z2 extends S{_parse(D){let F=this._def.innerType._parse(D),B=(E)=>{if(OD(E))E.value=Object.freeze(E.value);return E};return E2(F)?F.then((E)=>B(E)):B(F)}unwrap(){return this._def.innerType}}z2.create=(D,F)=>{return new z2({innerType:D,typeName:j.ZodReadonly,...L(F)})};function i8(D,F){let B=typeof D==="function"?D(F):typeof D==="string"?{message:D}:D;return typeof B==="string"?{message:B}:B}function t8(D,F={},B){if(D)return pD.create().superRefine((E,$)=>{let X=D(E);if(X instanceof Promise)return X.then((J)=>{if(!J){let Q=i8(F,E),Y=Q.fatal??B??!0;$.addIssue({code:"custom",...Q,fatal:Y})}});if(!X){let J=i8(F,E),Q=J.fatal??B??!0;$.addIssue({code:"custom",...J,fatal:Q})}return});return pD.create()}var J5={object:x.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 Q5=(D,F={message:`Input not instance of ${D.name}`})=>t8((B)=>B instanceof D,F),e8=DD.create,D6=SD.create,Y5=f2.create,W5=uD.create,F6=J2.create,q5=lD.create,_5=P2.create,H5=Q2.create,G5=Y2.create,M5=pD.create,A5=wD.create,z5=HD.create,U5=k2.create,R5=FD.create,j5=x.create,C5=x.strictCreate,V5=W2.create,K5=X0.create,N5=q2.create,L5=GD.create,O5=v2.create,w5=Z2.create,S5=dD.create,u5=X2.create,I5=_2.create,T5=H2.create,b5=ID.create,P5=G2.create,k5=cD.create,v5=$D.create,Z5=BD.create,f5=jD.create,x5=$D.createWithPreprocess,y5=x2.create,h5=()=>e8().optional(),g5=()=>D6().optional(),m5=()=>F6().optional(),l5={string:(D)=>DD.create({...D,coerce:!0}),number:(D)=>SD.create({...D,coerce:!0}),boolean:(D)=>J2.create({...D,coerce:!0}),bigint:(D)=>uD.create({...D,coerce:!0}),date:(D)=>lD.create({...D,coerce:!0})};var p5=R;var d5=u.object({allowedPaths:u.array(u.string()).default(["~/projects","/tmp"])}),c5=u.object({logPath:u.string().default("~/.genie/audit.log")}),n5=u.object({alwaysAsk:u.array(u.string()).default(["Write","Edit"])}),i5=u.object({sessionName:u.string().default("genie"),windowName:u.string().default("shell")}),a5=u.object({tmuxDebug:u.boolean().default(!1)}),r5=u.object({enabled:u.array(u.enum(["collaborative","supervised","sandboxed","audited"])).default([]),collaborative:i5.optional(),supervised:n5.optional(),sandboxed:d5.optional(),audited:c5.optional()}),o5=u.object({name:u.string().default("genie"),defaultWindow:u.string().default("shell")}),y2=u.object({hooks:r5.default({}),session:o5.default({}),logging:a5.default({}),installMethod:u.enum(["source","npm","bun"]).optional()}),Q0=[{name:"collaborative",title:"Collaborative",what:"All terminal commands run through tmux",why:"You can watch AI work in real-time",how:"Bash commands \u2192 term exec genie:shell",recommended:!0},{name:"supervised",title:"Supervised",what:"File changes require your approval",why:"Prevents accidental overwrites",how:"Write/Edit tools always ask permission"},{name:"sandboxed",title:"Sandboxed",what:"Restrict file access to specific directories",why:"Protects sensitive areas of your system",how:"Operations outside sandbox are blocked"},{name:"audited",title:"Audited",what:"Log all AI tool usage to a file",why:"Review what the AI did after a session",how:"Every tool call \u2192 ~/.genie/audit.log"}];var Y3=B6(D7(),".genie"),h2=B6(Y3,"config.json");function Y0(){return h2}function U2(){return W3(h2)}function F7(){if(!W3(Y3))s5(Y3,{recursive:!0})}async function XD(){if(!W3(h2))return y2.parse({});try{let D=t5(h2,"utf-8"),F=JSON.parse(D);return y2.parse(F)}catch(D){return console.warn(`Warning: Invalid genie config, using defaults: ${D.message}`),y2.parse({})}}async function q3(D){F7();try{let F=y2.parse(D),B=JSON.stringify(F,null,2);e5(h2,B,"utf-8")}catch(F){throw Error(`Failed to save genie config: ${F.message}`)}}function R2(D){let F=[];for(let B of D.hooks.enabled)switch(B){case"collaborative":{let E=D.hooks.collaborative||{},$=E.sessionName||"genie",X=E.windowName||"shell";F.push(`Collaborative: Bash \u2192 term exec ${$}:${X}`);break}case"supervised":{let $=(D.hooks.supervised||{}).alwaysAsk||["Write","Edit"];F.push(`Supervised: ${$.join(", ")} require approval`);break}case"sandboxed":{let $=(D.hooks.sandboxed||{}).allowedPaths||["~/projects","/tmp"];F.push(`Sandboxed: Restricted to ${$.join(", ")}`);break}case"audited":{let $=(D.hooks.audited||{}).logPath||"~/.genie/audit.log";F.push(`Audited: Logging to ${$}`);break}}return F}function E6(D){return D.hooks.enabled.length>0}function HE(D){let F=["collaborative","supervised","sandboxed","audited"];return D.split(",").map((E)=>E.trim().toLowerCase()).filter((E)=>F.includes(E))}import{homedir as $6}from"os";import{join as JD}from"path";import{existsSync as nD,readFileSync as X6,writeFileSync as $7,mkdirSync as X7,appendFileSync as _3}from"fs";import*as J6 from"readline";function Q6(){return`# Warp-like keyboard shortcuts (generated by genie-cli)
39
+ `+F:""),Y=Math.floor(E.length/X)-this.cursorPos.rows+(F?R8(F):0);if(Y>0)J+=y0(Y);J+=g0(this.cursorPos.cols),this.write(h0(this.extraLinesUnderPrompt)+m0(this.height)+J),this.extraLinesUnderPrompt=Y,this.height=R8(J)}checkCursorPos(){let D=this.rl.getCursorPos();if(D.cols!==this.cursorPos.cols)this.write(g0(D.cols)),this.cursorPos=D}done({clearContent:D}){this.rl.setPrompt("");let F=h0(this.extraLinesUnderPrompt);F+=D?m0(this.height):`
40
+ `,F+=C8,this.write(F),this.rl.close()}}class l0 extends Promise{static withResolver(){let D,F;return{promise:new Promise((E,$)=>{D=E,F=$}),resolve:D,reject:F}}}function C1(){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 _D(D){let F=C1();return(E,$={})=>{let{input:X=process.stdin,signal:J}=$,Q=new Set,Y=new K8.default;Y.pipe($.output??process.stdout);let W=V8.createInterface({terminal:!0,input:X,output:Y}),H=new c2(W),{promise:A,resolve:V,reject:R}=l0.withResolver(),I=()=>R(new C0);if(J){let K=()=>R(new j0({cause:J.reason}));if(J.aborted)return K(),Object.assign(A,{cancel:I});J.addEventListener("abort",K),Q.add(()=>J.removeEventListener("abort",K))}Q.add(U8((K,S)=>{R(new y2(`User force closed the prompt with ${K} ${S}`))}));let b=()=>R(new y2("User force closed the prompt with SIGINT"));W.on("SIGINT",b),Q.add(()=>W.removeListener("SIGINT",b));let T=()=>H.checkCursorPos();return W.input.on("keypress",T),Q.add(()=>W.input.removeListener("keypress",T)),w3(W,(K)=>{let S=j1.bind(()=>TD.clearAll());return W.on("close",S),Q.add(()=>W.removeListener("close",S)),K(()=>{try{let v=D(E,(cD)=>{setImmediate(()=>V(cD))});if(v===void 0){let cD=F[1]?.getFileName();throw Error(`Prompt functions must return a string.
41
+ at ${cD}`)}let[DD,FD]=typeof v==="string"?[v]:v;H.render(DD,FD),TD.run()}catch(v){R(v)}}),Object.assign(A.then((v)=>{return TD.clearAll(),v},(v)=>{throw TD.clearAll(),v}).finally(()=>{Q.forEach((v)=>v()),H.done({clearContent:Boolean($.clearPromptOnDone)}),Y.end()}).then(()=>A),{cancel:I})})}}var L8=SD(h2(),1);class tD{separator=L8.default.dim(Array.from({length:15}).join(aD.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 N8(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 O8(D){return D?"Yes":"No"}var p=_D((D,F)=>{let{transformer:B=O8}=D,[E,$]=k("idle"),[X,J]=k(""),Q=n(D.theme),Y=HD({status:E,theme:Q});qD((V,R)=>{if(E!=="idle")return;if(YD(V)){let I=N8(X,D.default);J(B(I)),$("done"),F(I)}else if(ID(V)){let I=O8(!N8(X,D.default));R.clearLine(0),R.write(I),J(I)}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 A=Q.style.message(D.message,E);return`${Y} ${A}${H} ${W}`});var R1={validationFailureMode:"keep"},kD=_D((D,F)=>{let{prefill:B="tab"}=D,E=n(R1,D.theme),[$,X]=k("idle"),[J="",Q]=k(D.default),[Y,W]=k(),[H,A]=k(""),V=HD({status:$,theme:E});async function R(S){let{required:v,pattern:DD,patternError:FD="Invalid input"}=D;if(v&&!S)return"You must provide a value";if(DD&&!DD.test(S))return FD;if(typeof D.validate==="function")return await D.validate(S)||"You must provide a valid value";return!0}qD(async(S,v)=>{if($!=="idle")return;if(YD(S)){let DD=H||J;X("loading");let FD=await R(DD);if(FD===!0)A(DD),X("done"),F(DD);else{if(E.validationFailureMode==="clear")A("");else v.write(H);W(FD),X("idle")}}else if(z0(S)&&!H)Q(void 0);else if(ID(S)&&!H)Q(void 0),v.clearLine(0),v.write(J),A(J);else A(v.line),W(void 0)}),WD((S)=>{if(B==="editable"&&J)S.write(J),A(J)},[]);let I=E.style.message(D.message,$),b=H;if(typeof D.transformer==="function")b=D.transformer(H,{isFinal:$==="done"});else if($==="done")b=E.style.answer(H);let T;if(J&&$!=="done"&&!H)T=E.style.defaultAnswer(J);let K="";if(Y)K=E.style.error(Y);return[[V,I,T,b].filter((S)=>S!==void 0).join(" "),K]});var V1=_D((D,F)=>{let{validate:B=()=>!0}=D,E=n(D.theme),[$,X]=k("idle"),[J,Q]=k(),[Y,W]=k(""),H=HD({status:$,theme:E});qD(async(b,T)=>{if($!=="idle")return;if(YD(b)){let K=Y;X("loading");let S=await B(K);if(S===!0)W(K),X("done"),F(K);else T.write(Y),Q(S||"You must provide a valid value"),X("idle")}else W(T.line),Q(void 0)});let A=E.style.message(D.message,$),V="",R;if(D.mask)V=(typeof D.mask==="string"?D.mask:"*").repeat(Y.length);else if($!=="done")R=`${E.style.help("[input is masked]")}${j8}`;if($==="done")V=E.style.answer(V);let I="";if(J)I=E.style.error(J);return[[H,A,D.mask?V:R].join(" "),I]});var vD=SD(h2(),1);var K1={icon:{cursor:aD.pointer},style:{disabled:(D)=>vD.default.dim(`- ${D}`),searchTerm:(D)=>vD.default.cyan(D),description:(D)=>vD.default.cyan(D),keysHelpTip:(D)=>D.map(([F,B])=>`${vD.default.bold(F)} ${vD.default.dim(B)}`).join(vD.default.dim(" \u2022 "))},helpMode:"always"};function p0(D){return!tD.isSeparator(D)&&!D.disabled}function L1(D){return D.map((F)=>{if(tD.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 N1=_D((D,F)=>{let{pageSize:B=7,validate:E=()=>!0}=D,$=n(K1,D.theme),[X,J]=k("loading"),[Q,Y]=k(""),[W,H]=k([]),[A,V]=k(),R=HD({status:X,theme:$}),I=N0(()=>{let P=W.findIndex(p0),g=W.findLastIndex(p0);return{first:P,last:g}},[W]),[b=I.first,T]=k();WD(()=>{let P=new AbortController;return J("loading"),V(void 0),(async()=>{try{let c=await D.source(Q||void 0,{signal:P.signal});if(!P.signal.aborted)T(void 0),V(void 0),H(L1(c)),J("idle")}catch(c){if(!P.signal.aborted&&c instanceof Error)V(c.message)}})(),()=>{P.abort()}},[Q]);let K=W[b];qD(async(P,g)=>{if(YD(P))if(K){J("loading");let c=await E(K.value);if(J("idle"),c===!0)J("done"),F(K.value);else if(K.name===Q)V(c||"You must provide a valid value");else g.write(K.name),Y(K.name)}else g.write(Q);else if(ID(P)&&K)g.clearLine(0),g.write(K.name),Y(K.name);else if(X!=="loading"&&(z2(P)||x2(P))){if(g.clearLine(0),z2(P)&&b!==I.first||x2(P)&&b!==I.last){let c=z2(P)?-1:1,nD=b;do nD=(nD+c+W.length)%W.length;while(!p0(W[nD]));T(nD)}}else Y(g.line)});let S=$.style.message(D.message,X),v;if($.helpMode!=="never")if(D.instructions){let{pager:P,navigation:g}=D.instructions;v=$.style.help(W.length>B?P:g)}else v=$.style.keysHelpTip([["\u2191\u2193","navigate"],["\u23CE","select"]]);let DD=k0({items:W,active:b,renderItem({item:P,isActive:g}){if(tD.isSeparator(P))return` ${P.separator}`;if(P.disabled){let Q0=typeof P.disabled==="string"?P.disabled:"(disabled)";return $.style.disabled(`${P.name} ${Q0}`)}let c=g?$.style.highlight:(Q0)=>Q0,nD=g?$.icon.cursor:" ";return c(`${nD} ${P.name}`)},pageSize:B,loop:!1}),FD;if(A)FD=$.style.error(A);else if(W.length===0&&Q!==""&&X==="idle")FD=$.style.error("No results found");let cD;if(X==="done"&&K)return[R,S,$.style.answer(K.short)].filter(Boolean).join(" ").trimEnd();else cD=$.style.searchTerm(Q);let Q3=K?.description,xF=[R,S,cD].filter(Boolean).join(" ").trimEnd(),yF=[FD??DD," ",Q3?$.style.description(Q3):"",v].filter(Boolean).join(`
42
+ `).trimEnd();return[xF,yF]});import{spawn as Y7}from"child_process";import{platform as O1,arch as w1}from"os";import{readFile as u1}from"fs/promises";var{$:n2}=globalThis.Bun;function S1(){let D=O1();if(D==="darwin")return"macos";if(D==="linux")return"linux";return"unknown"}async function I1(){try{let F=(await u1("/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 V2(D){try{return(await n2`which ${D}`.quiet()).exitCode===0}catch{return!1}}async function b1(){if(await V2("brew"))return"brew";if(await V2("apt"))return"apt";if(await V2("dnf"))return"dnf";if(await V2("yum"))return"yum";if(await V2("pacman"))return"pacman";return"none"}async function w8(){let D=S1(),F=w1(),B={os:D,arch:F,preferredPM:await b1()};if(D==="linux")B.linuxDistro=await I1();return B}async function d(D){try{let B=(await n2`which ${D}`.quiet().text()).trim();if(!B)return{exists:!1};let E;try{let X=(await n2`${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 n2`${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 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 xB(){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)
47
46
  # To use: add to ~/.tmux.conf or source this file
48
47
 
49
48
  # Ctrl+T: New window (tab) in current session
50
- bind-key -n C-t new-window
49
+ bind-key -n C-t new-window -c "#{pane_current_path}"
51
50
 
52
51
  # Ctrl+S: Vertical split (requires stty -ixon in shell rc)
53
- bind-key -n C-s split-window -v
52
+ bind-key -n C-s split-window -v -c "#{pane_current_path}"
54
53
 
55
- # Ctrl+H: Horizontal split
56
- bind-key -n C-h split-window -h
57
- `}function Y6(){return`# Warp-like extra keys (generated by genie-cli)
54
+ # Ctrl+Shift+S: Horizontal split
55
+ bind-key -n C-S split-window -h -c "#{pane_current_path}"
56
+ `}function DF(){return`# Warp-like extra keys (generated by genie-cli)
58
57
  # To use: add to ~/.termux/termux.properties
59
58
 
60
59
  # Extra keys row with F-keys for shortcuts
61
60
  # F1=New Tab, F2=VSplit, F3=HSplit
62
61
  extra-keys = [['ESC','TAB','CTRL','ALT','F1','F2','F3']]
63
- `}function J7(){return`# Warp-like shortcuts (generated by genie-cli)
62
+ `}function D7(){return`# Warp-like shortcuts (generated by genie-cli)
64
63
  # To use: add to ~/.bashrc or ~/.zshrc
65
64
 
66
65
  # Disable Ctrl+S flow control (required for Ctrl+S to work in tmux)
@@ -71,7 +70,7 @@ genie-new-tab() {
71
70
  local session
72
71
  session=$(tmux display-message -p '#S' 2>/dev/null)
73
72
  if [ -n "$session" ]; then
74
- tmux new-window
73
+ tmux new-window -c "#{pane_current_path}"
75
74
  else
76
75
  echo "Not in a tmux session"
77
76
  fi
@@ -79,7 +78,7 @@ genie-new-tab() {
79
78
 
80
79
  genie-vsplit() {
81
80
  if tmux display-message -p '#S' >/dev/null 2>&1; then
82
- tmux split-window -v
81
+ tmux split-window -v -c "#{pane_current_path}"
83
82
  else
84
83
  echo "Not in a tmux session"
85
84
  fi
@@ -87,7 +86,7 @@ genie-vsplit() {
87
86
 
88
87
  genie-hsplit() {
89
88
  if tmux display-message -p '#S' >/dev/null 2>&1; then
90
- tmux split-window -h
89
+ tmux split-window -h -c "#{pane_current_path}"
91
90
  else
92
91
  echo "Not in a tmux session"
93
92
  fi
@@ -97,16 +96,16 @@ genie-hsplit() {
97
96
  bind -x '"eOP":"genie-new-tab"' 2>/dev/null # F1
98
97
  bind -x '"eOQ":"genie-vsplit"' 2>/dev/null # F2
99
98
  bind -x '"eOR":"genie-hsplit"' 2>/dev/null # F3
100
- `}function G3(){console.log(`
99
+ `}function s0(){console.log(`
101
100
  Warp-like Terminal Shortcuts for tmux + Termux
102
101
 
103
- \u250C\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
104
- \u2502 Shortcut \u2502 Action \u2502
105
- \u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\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\u2524
106
- \u2502 Ctrl+T \u2502 New tab (window) in current session \u2502
107
- \u2502 Ctrl+S \u2502 Vertical split in current session \u2502
108
- \u2502 Ctrl+H \u2502 Horizontal split in current session \u2502
109
- \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\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\u2518
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
103
+ \u2502 Shortcut \u2502 Action \u2502
104
+ \u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\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\u2524
105
+ \u2502 Ctrl+T \u2502 New tab (window) in current session \u2502
106
+ \u2502 Ctrl+S \u2502 Vertical split in current session \u2502
107
+ \u2502 Ctrl+Shift+S \u2502 Horizontal split in current session \u2502
108
+ \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\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\u2518
110
109
 
111
110
  Termux Extra Keys (F1-F3):
112
111
  F1 \u2192 New tab F2 \u2192 Vertical split
@@ -116,93 +115,17 @@ Commands:
116
115
  term shortcuts --tmux Output tmux.conf snippet
117
116
  term shortcuts --termux Output termux.properties snippet
118
117
  term shortcuts --install Install to config files
119
- `)}async function j2(D){let F=J6.createInterface({input:process.stdin,output:process.stdout});return new Promise((B)=>{F.question(D,(E)=>{F.close(),B(E.trim().toLowerCase())})})}function iD(D,F){if(!nD(D))return!1;return X6(D,"utf-8").includes(F)}async function g2(){let D=$6(),F="generated by genie-cli";console.log(`Installing Warp-like shortcuts...
120
- `);let B=JD(D,".tmux.conf");if(iD(B,"generated by genie-cli"))console.log("\u2713 tmux.conf already has genie shortcuts");else if(await j2(`Add shortcuts to ${B}? [Y/n] `)!=="n"){let Y=`
121
- `+Q6();_3(B,Y),console.log(`\u2705 Added to ${B}`)}else console.log("\u23ED\uFE0F Skipped tmux.conf");let E=nD(JD(D,".zshrc"))?JD(D,".zshrc"):JD(D,".bashrc");if(iD(E,"generated by genie-cli"))console.log(`\u2713 ${E} already has genie shortcuts`);else if(await j2(`Add shell functions to ${E}? [Y/n] `)!=="n"){let Y=`
122
- `+J7();_3(E,Y),console.log(`\u2705 Added to ${E}`)}else console.log(`\u23ED\uFE0F Skipped ${E}`);let $=JD(D,".termux"),X=JD($,"termux.properties"),J=nD($)||process.env.TERMUX_VERSION;if(J)if(iD(X,"generated by genie-cli"))console.log("\u2713 termux.properties already has genie shortcuts");else if(await j2(`Add extra keys to ${X}? [Y/n] `)!=="n"){if(!nD($))X7($,{recursive:!0});let Y=`
123
- `+Y6();_3(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(`
118
+ `)}async function A2(D){let F=t8.createInterface({input:process.stdin,output:process.stdout});return new Promise((B)=>{F.question(D,(E)=>{F.close(),B(E.trim().toLowerCase())})})}function pD(D,F){if(!lD(D))return!1;return s8(D,"utf-8").includes(F)}async function T2(){let D=o8(),F="generated by genie-cli";console.log(`Installing Warp-like shortcuts...
119
+ `);let B=e(D,".tmux.conf");if(pD(B,"generated by genie-cli"))console.log("\u2713 tmux.conf already has genie shortcuts");else if(await A2(`Add shortcuts to ${B}? [Y/n] `)!=="n"){let Y=`
120
+ `+e8();r0(B,Y),console.log(`\u2705 Added to ${B}`)}else console.log("\u23ED\uFE0F Skipped tmux.conf");let E=lD(e(D,".zshrc"))?e(D,".zshrc"):e(D,".bashrc");if(pD(E,"generated by genie-cli"))console.log(`\u2713 ${E} already has genie shortcuts`);else if(await A2(`Add shell functions to ${E}? [Y/n] `)!=="n"){let Y=`
121
+ `+D7();r0(E,Y),console.log(`\u2705 Added to ${E}`)}else console.log(`\u23ED\uFE0F Skipped ${E}`);let $=e(D,".termux"),X=e($,"termux.properties"),J=lD($)||process.env.TERMUX_VERSION;if(J)if(pD(X,"generated by genie-cli"))console.log("\u2713 termux.properties already has genie shortcuts");else if(await A2(`Add extra keys to ${X}? [Y/n] `)!=="n"){if(!lD($))e5($,{recursive:!0});let Y=`
122
+ `+DF();r0(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(`
124
123
  \u2705 Installation complete!`),console.log(`
125
- 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 m2(D){return iD(D,"generated by genie-cli")}function H3(D,F){if(!nD(D))return!1;let B=X6(D,"utf-8");if(!B.includes(F))return!1;let E=B.split(`
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 P2(D){return pD(D,"generated by genie-cli")}function o0(D,F){if(!lD(D))return!1;let B=s8(D,"utf-8");if(!B.includes(F))return!1;let E=B.split(`
126
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(`
127
126
  `)+`
128
- `:"";return $7(D,Q),!0}async function W6(){let D=$6(),F="generated by genie-cli";console.log(`Uninstalling Warp-like shortcuts...
129
- `);let B=JD(D,".tmux.conf");if(!iD(B,"generated by genie-cli"))console.log("\u2713 tmux.conf has no genie shortcuts");else if(await j2(`Remove shortcuts from ${B}? [Y/n] `)!=="n"){if(H3(B,"generated by genie-cli"))console.log(`\u2705 Removed from ${B}`)}else console.log("\u23ED\uFE0F Skipped tmux.conf");let E=JD(D,".zshrc"),$=JD(D,".bashrc");for(let Y of[E,$]){if(!nD(Y))continue;if(!iD(Y,"generated by genie-cli"))console.log(`\u2713 ${Y} has no genie shortcuts`);else if(await j2(`Remove shell functions from ${Y}? [Y/n] `)!=="n"){if(H3(Y,"generated by genie-cli"))console.log(`\u2705 Removed from ${Y}`)}else console.log(`\u23ED\uFE0F Skipped ${Y}`)}let X=JD(D,".termux"),J=JD(X,"termux.properties"),Q=nD(X)||process.env.TERMUX_VERSION;if(Q)if(!iD(J,"generated by genie-cli"))console.log("\u2713 termux.properties has no genie shortcuts");else if(await j2(`Remove extra keys from ${J}? [Y/n] `)!=="n"){if(H3(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(`
127
+ `:"";return t5(D,Q),!0}async function FF(){let D=o8(),F="generated by genie-cli";console.log(`Uninstalling Warp-like shortcuts...
128
+ `);let B=e(D,".tmux.conf");if(!pD(B,"generated by genie-cli"))console.log("\u2713 tmux.conf has no genie shortcuts");else if(await A2(`Remove shortcuts from ${B}? [Y/n] `)!=="n"){if(o0(B,"generated by genie-cli"))console.log(`\u2705 Removed from ${B}`)}else console.log("\u23ED\uFE0F Skipped tmux.conf");let E=e(D,".zshrc"),$=e(D,".bashrc");for(let Y of[E,$]){if(!lD(Y))continue;if(!pD(Y,"generated by genie-cli"))console.log(`\u2713 ${Y} has no genie shortcuts`);else if(await A2(`Remove shell functions from ${Y}? [Y/n] `)!=="n"){if(o0(Y,"generated by genie-cli"))console.log(`\u2705 Removed from ${Y}`)}else console.log(`\u23ED\uFE0F Skipped ${Y}`)}let X=e(D,".termux"),J=e(X,"termux.properties"),Q=lD(X)||process.env.TERMUX_VERSION;if(Q)if(!pD(J,"generated by genie-cli"))console.log("\u2713 termux.properties has no genie shortcuts");else if(await A2(`Remove extra keys from ${J}? [Y/n] `)!=="n"){if(o0(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(`
130
129
  \u2705 Uninstallation complete!`),console.log(`
131
- 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 jE(D){if(D.tmux)console.log(Q6());else if(D.termux)console.log(Y6());else if(D.install)await g2();else G3()}import{homedir as Q7}from"os";import{join as Y7}from"path";function W7(){console.log(),console.log("\x1B[1m\x1B[36m"+"\u2554"+"\u2550".repeat(62)+"\u2557"+"\x1B[0m"),console.log("\x1B[1m\x1B[36m"+"\u2551 "+"\x1B[0m\x1B[1m\uD83E\uDDDE Genie Setup - Configure Your AI Assistant"+" ".repeat(16)+"\x1B[36m\u2551\x1B[0m"),console.log("\x1B[1m\x1B[36m"+"\u255A"+"\u2550".repeat(62)+"\u255D"+"\x1B[0m"),console.log()}function q7(){console.log("\x1B[1m\uD83D\uDCDA ABOUT HOOKS\x1B[0m"),console.log("\x1B[2mHooks let you control how the AI uses tools - without wasting\x1B[0m"),console.log('\x1B[2mtokens on prompts! Instead of telling the AI "please use term",\x1B[0m'),console.log("\x1B[2mhooks automatically enforce the behavior.\x1B[0m"),console.log(),console.log("\x1B[2m"+"\u2500".repeat(64)+"\x1B[0m"),console.log()}function _7(){console.log("\x1B[1m\uD83D\uDD27 AVAILABLE HOOK PRESETS\x1B[0m"),console.log();for(let D=0;D<Q0.length;D++){let F=Q0[D],B=D+1,E=F.recommended?" \x1B[32m(Recommended)\x1B[0m":"";console.log(`\x1B[1m${B}. ${F.title}\x1B[0m${E}`),console.log(` \u251C\u2500 What: ${F.what}`),console.log(` \u251C\u2500 Why: ${F.why}`),console.log(` \u2514\u2500 How: ${F.how}`),console.log()}console.log("\x1B[2m"+"\u2500".repeat(64)+"\x1B[0m"),console.log()}function H7(D,F){let B=D.recommended?" \x1B[32m(Recommended)\x1B[0m":"";return{name:`${D.title}${B} - ${D.what}`,value:D.name,checked:F}}function G7(D){console.log(),console.log(`\x1B[32m\u2713 Configuration saved to ${D}\x1B[0m`),console.log(),console.log("\x1B[1m\uD83D\uDCA1 TIP:\x1B[0m Claudio will automatically use these hooks."),console.log(" Run: \x1B[36mclaudio launch\x1B[0m"),console.log(" Watch: \x1B[36mtmux attach -t genie\x1B[0m"),console.log()}function M7(D){let F=R2(D);if(F.length===0)console.log("\x1B[33mNo hooks currently enabled.\x1B[0m");else{console.log("\x1B[1mCurrently enabled hooks:\x1B[0m");for(let B of F)console.log(` \u2022 ${B}`)}console.log()}async function A7(D){let F=D.hooks.sandboxed?.allowedPaths||["~/projects","/tmp"];console.log("\x1B[1mSandbox Configuration\x1B[0m"),console.log("\x1B[2mEnter paths where the AI can access files (comma-separated):\x1B[0m");let E=(await F0({message:"Allowed paths:",default:F.join(", ")})).split(",").map(($)=>$.trim()).filter(Boolean);D.hooks.sandboxed={allowedPaths:E}}async function z7(D){let F=D.hooks.audited?.logPath||"~/.genie/audit.log";console.log("\x1B[1mAudit Configuration\x1B[0m");let B=await F0({message:"Audit log path:",default:F});D.hooks.audited={logPath:B}}async function W0(){W7(),q7(),_7();let D=await XD(),F=new Set(D.hooks.enabled);if(U2())console.log("\x1B[1m\uD83D\uDCCB CURRENT CONFIGURATION\x1B[0m"),M7(D);let B=Q0.map(($)=>H7($,F.has($.name))),E=await E3({message:"Select hooks to enable (space to toggle, enter to confirm):",choices:B});if(D.hooks.enabled=E,E.includes("sandboxed"))console.log(),await A7(D);if(E.includes("audited")){if(console.log(),await yD({message:"Customize audit log path?",default:!1}))await z7(D)}if(await q3(D),G7(Y0()),E.length>0){console.log("\x1B[1mEnabled hooks:\x1B[0m");let $=R2(D);for(let X of $)console.log(` \x1B[32m\u2713\x1B[0m ${X}`);console.log()}await U7()}async function U7(){let D=Q7(),F=Y7(D,".tmux.conf");if(m2(F)){console.log("\x1B[2m\u2713 Tmux shortcuts already installed\x1B[0m"),console.log();return}if(console.log("\x1B[2m"+"\u2500".repeat(64)+"\x1B[0m"),console.log(),console.log("\x1B[1m\u2328\uFE0F KEYBOARD SHORTCUTS\x1B[0m"),console.log("\x1B[2mOptional: Install Warp-like tmux shortcuts for quick navigation:\x1B[0m"),console.log(" \u2022 Ctrl+T \u2192 New tab (window)"),console.log(" \u2022 Ctrl+S \u2192 Vertical split"),console.log(" \u2022 Alt+S \u2192 Horizontal split"),console.log(),await yD({message:"Install tmux keyboard shortcuts?",default:!1}))console.log(),await g2();else console.log(),console.log("\x1B[2mSkipped. Run \x1B[0m\x1B[36mgenie shortcuts install\x1B[0m\x1B[2m later to add them.\x1B[0m"),console.log()}async function q6(){console.log("\x1B[1m\uD83E\uDDDE Quick Setup - Using recommended defaults\x1B[0m"),console.log();let D=await XD();D.hooks.enabled=["collaborative","audited"],await q3(D),console.log("\x1B[32m\u2713 Enabled:\x1B[0m collaborative, audited"),console.log(),console.log("Run \x1B[36mgenie setup\x1B[0m to customize further."),console.log()}var j7={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 C7(D,F){let B=j7[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 _6(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 V7(D){return new Promise((F)=>{console.log(`\x1B[2m$ ${D}\x1B[0m
132
- `);let B=R7("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 K7(){console.log(),console.log("\x1B[1m\uD83D\uDD27 Genie Prerequisites Check\x1B[0m"),console.log()}function N7(D){let F=D.os==="macos"?"macOS":"Linux";if(D.linuxDistro&&D.linuxDistro!=="unknown")F=`Linux (${d8(D.linuxDistro)})`;console.log(`System: ${F} (${D.arch})`),console.log(`Package Manager: ${D.preferredPM==="none"?"none detected":D.preferredPM}`),console.log()}function L7(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 q0(){console.log("\x1B[2m"+"\u2500".repeat(40)+"\x1B[0m"),console.log()}async function O7(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(` ${_6(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 yD({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 V7(F)){let J=await gD(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 ${_6(D.name)}\x1B[0m`),console.log(),"failed"}async function H6(D){if(U2()){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(),q0(),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 yD({message:"Would you like to configure genie hooks now?",default:!0});if(F)console.log(),await W0();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 G6(D){K7();let F=await l8();N7(F);let B=await p8();L7(B);let E=B.filter((q)=>!q.installed),$=E.filter((q)=>q.required),X=E.filter((q)=>!q.required);if(E.length===0){console.log("\x1B[32m\u2705 All prerequisites are installed!\x1B[0m"),console.log(),await H6(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}q0();let J={installed:[],skipped:[],failed:[]};for(let q of E){let G=C7(q.name,F.preferredPM),C=await O7(q,G,D);if(C==="installed")J.installed.push(q.name);else if(C==="skipped")J.skipped.push(q.name);else J.failed.push(q.name);if(q!==E[E.length-1])q0()}q0(),console.log("\x1B[1mSummary:\x1B[0m");let Q=J.installed.filter((q)=>$.some((G)=>G.name===q)),Y=J.failed.filter((q)=>$.some((G)=>G.name===q)),W=J.skipped.filter((q)=>X.some((G)=>G.name===q));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 H6(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 z6}from"child_process";import{existsSync as U6}from"fs";import{mkdir as M6,copyFile as R6,chmod as w7}from"fs/promises";import{join as VD}from"path";import{homedir as j6}from"os";var C6=process.env.GENIE_HOME||VD(j6(),".genie"),TD=VD(C6,"src"),M3=VD(C6,"bin"),A3=VD(j6(),".local","bin");function bD(D){console.log(`\x1B[32m\u25B8\x1B[0m ${D}`)}function l2(D){console.log(`\x1B[32m\u2714\x1B[0m ${D}`)}function CD(D){console.log(`\x1B[31m\u2716\x1B[0m ${D}`)}async function C2(D,F,B){return new Promise((E)=>{let $=[],X=z6(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)=>{CD(J.message),E({success:!1,output:J.message})})})}async function A6(D){try{let F=await p2("git",["rev-parse","--abbrev-ref","HEAD"],D),B=await p2("git",["rev-parse","--short","HEAD"],D),E=await p2("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 p2(D,F,B){return new Promise((E)=>{let $=[],X=z6(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 S7(){if(U2())try{let F=await XD();if(F.installMethod)return F.installMethod}catch{}if(U6(VD(TD,".git")))return"source";let D=await p2("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===VD(A3,"genie")||F.startsWith(M3))return"source";return(await p2("which",["bun"])).success?"bun":"npm"}return"unknown"}async function u7(){if(bD("Updating via bun..."),!(await C2("bun",["install","-g","@automagik/genie@latest"])).success)CD("Failed to update via bun"),process.exit(1);console.log(),l2("Genie CLI updated!")}async function I7(){if(bD("Updating via npm..."),!(await C2("npm",["install","-g","@automagik/genie@latest"])).success)CD("Failed to update via npm"),process.exit(1);console.log(),l2("Genie CLI updated!")}async function T7(){let D=await A6(TD);if(D)console.log(`Current: \x1B[2m${D.branch}@${D.commit} (${D.commitDate})\x1B[0m`),console.log();if(bD("Fetching latest changes..."),!(await C2("git",["fetch","origin"],TD)).success)CD("Failed to fetch from origin"),process.exit(1);if(bD("Resetting to origin/main..."),!(await C2("git",["reset","--hard","origin/main"],TD)).success)CD("Failed to reset to origin/main"),process.exit(1);console.log();let E=await A6(TD);if(D&&E&&D.commit===E.commit){l2("Already up to date!"),console.log();return}if(bD("Installing dependencies..."),!(await C2("bun",["install"],TD)).success)CD("Failed to install dependencies"),process.exit(1);if(console.log(),bD("Building..."),!(await C2("bun",["run","build"],TD)).success)CD("Failed to build"),process.exit(1);console.log(),bD("Installing binaries...");try{await M6(M3,{recursive:!0}),await M6(A3,{recursive:!0});let J=["genie.js","term.js","claudio.js"],Q=["genie","term","claudio"];for(let Y=0;Y<J.length;Y++){let W=VD(TD,"dist",J[Y]),q=VD(M3,J[Y]),G=VD(A3,Q[Y]);await R6(W,q),await w7(q,493),await b7(q,G)}l2("Binaries installed")}catch(J){CD(`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"),l2("Genie CLI updated successfully!"),console.log(),E)console.log(`Version: \x1B[36m${E.branch}@${E.commit}\x1B[0m (${E.commitDate})`),console.log()}async function b7(D,F){let{symlink:B,unlink:E}=await import("fs/promises");try{if(U6(F))await E(F);await B(D,F)}catch{await R6(D,F)}}async function V6(){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 S7();if(bD(`Detected installation: ${D}`),console.log(),D==="unknown")CD("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 T7();break;case"bun":await u7();break;case"npm":await I7();break}}import{existsSync as U3,mkdirSync as N6,readFileSync as P7,writeFileSync as k7}from"fs";import{homedir as L6}from"os";import{join as M0}from"path";var H0=M0(L6(),".claude"),z3=M0(H0,"hooks"),G0=M0(H0,"settings.json"),v7=u.object({type:u.literal("command"),command:u.string(),timeout:u.number().optional()}).passthrough(),K6=u.object({matcher:u.string(),hooks:u.array(v7)}).passthrough(),Z7=u.object({PreToolUse:u.array(K6).optional(),PostToolUse:u.array(K6).optional()}).passthrough(),_0=u.object({model:u.string().optional(),enabledPlugins:u.record(u.unknown()).optional(),hooks:Z7.optional()}).passthrough(),R3="genie-bash-hook.sh",A0="Bash";function z0(){return G0}function aD(){return M0(z3,R3)}function O6(){if(!U3(H0))N6(H0,{recursive:!0})}function w6(){if(O6(),!U3(z3))N6(z3,{recursive:!0})}async function U0(){if(!U3(G0))return _0.parse({});try{let D=P7(G0,"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 j3(D){O6();try{let F=_0.parse(D),B=JSON.stringify(F,null,2);k7(G0,B,"utf-8")}catch(F){throw Error(`Failed to save Claude settings: ${F.message}`)}}function f7(D){return{matcher:A0,hooks:[{type:"command",command:D,timeout:600}]}}function d2(D){let F=D.hooks?.PreToolUse;if(!F||!Array.isArray(F))return!1;return F.some((B)=>{if(B.matcher!==A0)return!1;if(!Array.isArray(B.hooks))return!1;return B.hooks.some((E)=>E.type==="command"&&E.command?.includes(R3))})}function S6(D){let F=aD(),B=f7(F);if(!D.hooks)D.hooks={};if(!D.hooks.PreToolUse)D.hooks.PreToolUse=[];if(d2(D))return D;return D.hooks.PreToolUse=D.hooks.PreToolUse.filter((E)=>!(E.matcher===A0&&E.hooks?.some(($)=>$.command?.includes("genie")))),D.hooks.PreToolUse.push(B),D}function u6(D){if(!D.hooks?.PreToolUse)return D;if(D.hooks.PreToolUse=D.hooks.PreToolUse.filter((F)=>{if(F.matcher!==A0)return!0;if(!Array.isArray(F.hooks))return!0;return!F.hooks.some((E)=>E.type==="command"&&E.command?.includes(R3))}),D.hooks.PreToolUse.length===0)delete D.hooks.PreToolUse;if(D.hooks&&Object.keys(D.hooks).length===0)delete D.hooks;return D}function rD(D){let F=L6();if(D.startsWith(F+"/"))return"~"+D.slice(F.length);if(D===F)return"~";return D}import{existsSync as C3,unlinkSync as x7,writeFileSync as y7,chmodSync as h7}from"fs";function R0(){return C3(aD())}function j0(){return rD(aD())}async function g7(){let D=await XD(),F=D.hooks.collaborative?.sessionName||"genie",B=D.hooks.collaborative?.windowName||"shell";return`#!/bin/bash
133
- #
134
- # Genie Bash Hook for Claude Code
135
- #
136
- # This hook intercepts Bash tool calls and rewrites them to execute
137
- # through tmux via 'term exec', making all terminal operations visible
138
- # in a shared tmux session.
139
- #
140
- # Generated by: genie hooks install
141
- # Target session: ${`${F}:${B}`}
142
- #
143
-
144
- # Read the entire input from stdin
145
- INPUT=$(cat)
146
-
147
- # Extract the tool name to verify this is a Bash call
148
- TOOL_NAME=$(echo "$INPUT" | jq -r '.tool_name // empty')
149
-
150
- # If not a Bash tool call, allow it to proceed unchanged
151
- if [ "$TOOL_NAME" != "Bash" ]; then
152
- echo '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"allow"}}'
153
- exit 0
154
- fi
155
-
156
- # Extract the command from the tool input
157
- COMMAND=$(echo "$INPUT" | jq -r '.tool_input.command // empty')
158
-
159
- # If no command, allow it (shouldn't happen but be safe)
160
- if [ -z "$COMMAND" ]; then
161
- echo '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"allow"}}'
162
- exit 0
163
- fi
164
-
165
- # Don't wrap commands that are already term exec calls (avoid infinite recursion)
166
- if [[ "$COMMAND" == *"term exec "* ]] || [[ "$COMMAND" == *"/term.js exec"* ]] || [[ "$COMMAND" == *".local/bin/term "* ]] || [[ "$COMMAND" == *".genie/bin/term"* ]]; then
167
- echo '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"allow"}}'
168
- exit 0
169
- fi
170
-
171
- # Escape single quotes in the command for safe shell embedding
172
- # Replace ' with '\\'\\''
173
- ESCAPED_COMMAND=$(echo "$COMMAND" | sed "s/'/'\\\\'\\\\''/" )
174
-
175
- # Build the wrapped command that goes through term exec
176
- # Uses full path since Claude's subprocess may not have full PATH
177
- WRAPPED_COMMAND="$HOME/.local/bin/term exec ${F}:\\\${CLAUDIO_SESSION:-claude} '\${ESCAPED_COMMAND}'"
178
-
179
- # Extract other fields from the original input to preserve them
180
- TIMEOUT=$(echo "$INPUT" | jq -r '.tool_input.timeout // empty')
181
- DESCRIPTION=$(echo "$INPUT" | jq -r '.tool_input.description // empty')
182
- RUN_IN_BACKGROUND=$(echo "$INPUT" | jq -r '.tool_input.run_in_background // empty')
183
-
184
- # Build the updated input object
185
- UPDATED_INPUT=$(jq -n \\
186
- --arg cmd "$WRAPPED_COMMAND" \\
187
- --arg timeout "$TIMEOUT" \\
188
- --arg desc "$DESCRIPTION" \\
189
- --arg background "$RUN_IN_BACKGROUND" \\
190
- '{
191
- command: $cmd,
192
- timeout: (if $timeout != "" then ($timeout | tonumber) else null end),
193
- description: (if $desc != "" then ("[term] " + $desc) else null end),
194
- run_in_background: (if $background == "true" then true elif $background == "false" then false else null end)
195
- } | with_entries(select(.value != null))')
196
-
197
- # Output the hook response in the correct format
198
- jq -n \\
199
- --argjson updatedInput "$UPDATED_INPUT" \\
200
- '{
201
- "hookSpecificOutput": {
202
- "hookEventName": "PreToolUse",
203
- "permissionDecision": "allow",
204
- "updatedInput": $updatedInput,
205
- "additionalContext": "Human can observe: tmux attach -t ${F}"
206
- }
207
- }'
208
- `}async function I6(){w6();let D=aD(),F=await g7();y7(D,F,"utf-8"),h7(D,493)}function T6(){let D=aD();if(C3(D))x7(D)}async function b6(){let D=aD();if(!C3(D))return{success:!1,error:'Hook script not found. Run "genie hooks install" first.'};let F=JSON.stringify({hook_event_name:"PreToolUse",tool_name:"Bash",tool_input:{command:'echo "Hello, World!"',description:"Test command"}});try{let{$:B}=awaitPromise.resolve(globalThis.Bun),E=await B`echo ${F} | ${D}`.quiet();if(E.exitCode!==0)return{success:!1,error:`Script exited with code ${E.exitCode}`,output:E.stderr.toString()};let $=E.stdout.toString().trim();try{let X=JSON.parse($);if(!X.hookSpecificOutput)return{success:!1,error:"Output missing hookSpecificOutput field",output:$};if(X.hookSpecificOutput.hookEventName!=="PreToolUse")return{success:!1,error:"Output has wrong hookEventName",output:$};if(!["allow","deny","ask"].includes(X.hookSpecificOutput.permissionDecision))return{success:!1,error:"Output has invalid permissionDecision",output:$};if(X.hookSpecificOutput.updatedInput?.command){if(!X.hookSpecificOutput.updatedInput.command.includes("term exec"))return{success:!1,error:"Command was not wrapped with term exec",output:$}}return{success:!0,output:$}}catch(X){return{success:!1,error:`Output is not valid JSON: ${X.message}`,output:$}}}catch(B){return{success:!1,error:`Failed to run hook script: ${B.message}`}}}function P6(D){let F=Math.max(...D.map((E)=>E.length)),B=F+4;console.log(),console.log("\x1B[32m+"+"-".repeat(B)+"+\x1B[0m");for(let E of D){let $=" ".repeat(F-E.length);console.log("\x1B[32m| \x1B[0m"+E+$+"\x1B[32m |\x1B[0m")}console.log("\x1B[32m+"+"-".repeat(B)+"+\x1B[0m"),console.log()}async function m7(){let D=[],F=await gD("jq"),B=await gD("tmux"),E=await gD("term");if(!F.exists)D.push("jq is required but not installed. Install with: brew install jq (or apt install jq)");return{jq:F.exists,tmux:B.exists,term:E.exists,errors:D}}async function k6(D={}){console.log(),console.log("\x1B[1m Installing Genie Hooks\x1B[0m"),console.log(),console.log("\x1B[2mChecking dependencies...\x1B[0m");let F=await m7();if(F.jq)console.log(" \x1B[32m+\x1B[0m jq");else console.log(" \x1B[31m-\x1B[0m jq (required)");if(F.tmux)console.log(" \x1B[32m+\x1B[0m tmux");else console.log(" \x1B[33m-\x1B[0m tmux (recommended for collaborative mode)");if(F.term)console.log(" \x1B[32m+\x1B[0m term");else console.log(" \x1B[33m-\x1B[0m term (required for collaborative mode)");if(F.errors.length>0){console.log();for(let Q of F.errors)console.log("\x1B[31mError:\x1B[0m "+Q);process.exit(1)}console.log(),console.log("\x1B[2mLoading configuration...\x1B[0m");let B=await XD();if(!E6(B))console.log(),console.log("\x1B[33mNo hook presets are enabled.\x1B[0m"),console.log("Run \x1B[36mgenie setup\x1B[0m to configure hook presets first."),console.log(),process.exit(1);let E=R2(B);if(console.log(" \x1B[32m+\x1B[0m Enabled presets: "+B.hooks.enabled.join(", ")),console.log(),B.hooks.enabled.includes("collaborative")){if(!F.tmux)console.log("\x1B[33mWarning:\x1B[0m Collaborative mode enabled but tmux not found."),console.log("Install tmux for the best experience: brew install tmux (or apt install tmux)"),console.log();if(!F.term)console.log("\x1B[33mWarning:\x1B[0m Collaborative mode enabled but term not found."),console.log("The term command is required for collaborative mode to work."),console.log()}let $=await U0();if(d2($)&&!D.force){console.log("\x1B[33mGenie hooks are already installed.\x1B[0m"),console.log("Use \x1B[36m--force\x1B[0m to reinstall."),console.log();return}console.log("\x1B[2mWriting hook script...\x1B[0m"),await I6(),console.log(" \x1B[32m+\x1B[0m "+j0()),console.log(),console.log("\x1B[2mUpdating Claude Code settings...\x1B[0m");let X=S6($);await j3(X),console.log(" \x1B[32m+\x1B[0m Hook registered in "+rD(z0())),console.log();let J=B.hooks.collaborative?.sessionName||"genie";P6(["\x1B[32m+\x1B[0m Installation complete!","","Restart Claude Code for changes to take effect.","","After restart, all Bash commands will run in tmux.",`Watch with: tmux attach -t ${J}`])}async function v6(D={}){console.log(),console.log("\x1B[1m Uninstalling Genie Hooks\x1B[0m"),console.log(),console.log("\x1B[2mRemoving from Claude Code settings...\x1B[0m");let F=await U0();if(!d2(F))console.log(" \x1B[33m-\x1B[0m No genie hooks found in settings");else{let B=u6(F);await j3(B),console.log(" \x1B[32m+\x1B[0m Hook removed from "+rD(z0()))}if(console.log(),!D.keepScript){if(console.log("\x1B[2mRemoving hook script...\x1B[0m"),R0())T6(),console.log(" \x1B[32m+\x1B[0m Deleted "+j0());else console.log(" \x1B[33m-\x1B[0m Hook script not found");console.log()}else console.log("\x1B[2mKeeping hook script (--keep-script)\x1B[0m"),console.log();P6(["\x1B[32m+\x1B[0m Uninstallation complete!","","Restart Claude Code for changes to take effect."])}async function Z6(){if(console.log(),console.log("\x1B[1m Testing Genie Hooks\x1B[0m"),console.log(),!R0())console.log("\x1B[31mError:\x1B[0m Hook script not found."),console.log("Run \x1B[36mgenie hooks install\x1B[0m first."),console.log(),process.exit(1);console.log("Script location: "+j0()),console.log(),console.log("\x1B[2mTesting with sample Bash input...\x1B[0m");let D=await b6();if(D.success){console.log("\x1B[32m+\x1B[0m Hook script works correctly!"),console.log(),console.log("\x1B[2mSample output:\x1B[0m");try{let F=JSON.parse(D.output||"{}");console.log(JSON.stringify(F,null,2))}catch{console.log(D.output)}}else{if(console.log("\x1B[31m-\x1B[0m Hook script test failed!"),console.log(),console.log("\x1B[31mError:\x1B[0m "+D.error),D.output)console.log(),console.log("\x1B[2mOutput:\x1B[0m"),console.log(D.output);process.exit(1)}console.log()}async function V3(){let D=await XD(),F=R2(D);if(console.log(),console.log("\x1B[1m Current Hook Configuration\x1B[0m"),console.log(` Genie config: ${rD(Y0())}`),console.log(` Claude settings: ${rD(z0())}`),console.log(),F.length===0)console.log("\x1B[33m No hook presets enabled.\x1B[0m"),console.log(" Run \x1B[36mgenie setup\x1B[0m to configure hooks.");else{console.log("\x1B[2m Enabled presets:\x1B[0m");for(let X of F)console.log(` \x1B[32m+\x1B[0m ${X}`)}console.log();let B=await U0(),E=d2(B),$=R0();if(console.log("\x1B[2m Installation status:\x1B[0m"),E&&$)console.log(" \x1B[32m+\x1B[0m Hooks installed in Claude Code"),console.log(" \x1B[32m+\x1B[0m Hook script exists");else if(E&&!$)console.log(" \x1B[33m!\x1B[0m Hook registered but script missing"),console.log(" Run \x1B[36mgenie hooks install --force\x1B[0m to fix");else if(!E&&$)console.log(" \x1B[33m!\x1B[0m Script exists but hook not registered"),console.log(" Run \x1B[36mgenie hooks install\x1B[0m to register");else console.log(" \x1B[33m-\x1B[0m Hooks not installed"),console.log(" Run \x1B[36mgenie hooks install\x1B[0m to install");console.log()}import{homedir as l7}from"os";import{join as K3}from"path";import{existsSync as p7}from"fs";async function N3(){G3();let D=l7(),F=K3(D,".tmux.conf"),B=K3(D,".zshrc"),E=K3(D,".bashrc");if(console.log("Installation status:"),m2(F))console.log(" \x1B[32m\u2713\x1B[0m tmux.conf");else console.log(" \x1B[33m-\x1B[0m tmux.conf");let $=p7(B)?B:E;if(m2($))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 f6(){await g2()}async function x6(){await W6()}var oD=new g3;oD.name("genie").description("Genie CLI - Setup and utilities for AI-assisted development").version(m3);oD.command("install").description("Verify and install prerequisites").option("--check","Only check prerequisites, do not install").option("--yes","Auto-approve all installations").action(G6);oD.command("setup").description("Configure hooks and settings (interactive wizard)").option("--quick","Use recommended defaults without prompts").action(async(D)=>{if(D.quick)await q6();else await W0()});oD.command("update").description("Update Genie CLI to the latest version").action(V6);var c2=oD.command("hooks").description("Manage Claude Code hooks");c2.action(V3);c2.command("show").description("Show current hook configuration").action(V3);c2.command("install").description("Install hooks into Claude Code").option("--force","Overwrite existing hooks").action(k6);c2.command("uninstall").description("Remove hooks from Claude Code").option("--keep-script","Keep the hook script file").action(v6);c2.command("test").description("Test the hook script").action(Z6);var C0=oD.command("shortcuts").description("Manage tmux keyboard shortcuts");C0.action(N3);C0.command("show").description("Show available shortcuts and installation status").action(N3);C0.command("install").description("Install shortcuts to config files (~/.tmux.conf, shell rc)").action(f6);C0.command("uninstall").description("Remove shortcuts from config files").action(x6);oD.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 lB(D){if(D.tmux)console.log(e8());else if(D.termux)console.log(DF());else if(D.install)await T2();else s0()}import{homedir as F7}from"os";import{join as B7}from"path";function k2(){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 dD(D,F){if(console.log(),console.log("\x1B[1m"+D+"\x1B[0m"),F)console.log("\x1B[2m"+F+"\x1B[0m");console.log()}async function E7(){dD("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 d(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 BF(D,F){if(dD("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 kD({message:"Session name:",default:D.session.name}),E=await kD({message:"Default window name:",default:D.session.defaultWindow}),$=await p({message:"Auto-create session on connect?",default:D.session.autoCreate});return D.session={name:B,defaultWindow:E,autoCreate:$},D}async function EF(D,F){if(dD("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 kD({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 kD({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 kD({message:"Worktree base directory:",default:D.terminal.worktreeBase});return D.terminal={execTimeout:parseInt(B,10),readLines:parseInt(E,10),worktreeBase:$},D}async function $F(D,F){dD("4. Keyboard Shortcuts","Warp-like tmux shortcuts for quick navigation");let B=F7(),E=B7(B,".tmux.conf");if(P2(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 p({message:"Install tmux keyboard shortcuts?",default:!1}))console.log(),await T2(),D.shortcuts.tmuxInstalled=!0,await r8({tmuxInstalled:!0});else console.log(" Skipped. Run \x1B[36mgenie shortcuts install\x1B[0m later.");return D}async function XF(D,F){if(dD("5. Claudio Integration","LLM router profile management"),!(await d("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 p({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 $7(D,F){if(dD("6. Debug Options","Logging and debugging settings"),F)return console.log(" Using defaults: tmuxDebug=false, verbose=false"),D;let B=await p({message:"Enable tmux debug logging?",default:D.logging.tmuxDebug}),E=await p({message:"Enable verbose mode?",default:D.logging.verbose});return D.logging={tmuxDebug:B,verbose:E},D}async function X7(D){dD("Summary","Configuration will be saved to "+b2(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 ND(D),console.log("\x1B[32m\u2713 Configuration saved!\x1B[0m")}async function J7(){let D=await UD();console.log(),console.log("\x1B[1mCurrent Genie Configuration\x1B[0m"),console.log("\x1B[2m"+b2(I2())+"\x1B[0m"),console.log(),console.log(JSON.stringify(D,null,2)),console.log()}function Q7(){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 e2(D={}){if(D.show){await J7();return}if(D.reset){await a8(),console.log("\x1B[32m\u2713 Configuration reset to defaults.\x1B[0m"),console.log();return}let F=await UD();if(D.shortcuts){k2(),await $F(F,!1),await a0();return}if(D.terminal){k2(),F=await EF(F,!1),await ND(F),console.log("\x1B[32m\u2713 Terminal configuration saved.\x1B[0m");return}if(D.session){k2(),F=await BF(F,!1),await ND(F),console.log("\x1B[32m\u2713 Session configuration saved.\x1B[0m");return}if(D.claudio){k2(),await XF(F,!1),await a0();return}let B=D.quick??!1;if(k2(),B)console.log("\x1B[2mQuick mode: accepting all defaults\x1B[0m");await E7(),F=await BF(F,B),F=await EF(F,B),F=await $F(F,B),F=await XF(F,B),F=await $7(F,B),await X7(F),Q7()}var W7={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 H7(D,F){let B=W7[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 JF(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 q7(D){return new Promise((F)=>{console.log(`\x1B[2m$ ${D}\x1B[0m
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();