@automagik/genie 0.260202.530 → 0.260202.1833

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.
Files changed (39) hide show
  1. package/dist/claudio.js +44 -45
  2. package/dist/genie.js +58 -135
  3. package/dist/term.js +134 -67
  4. package/install.sh +43 -7
  5. package/package.json +1 -1
  6. package/src/claudio.ts +31 -21
  7. package/src/commands/launch.ts +12 -68
  8. package/src/genie-commands/doctor.ts +327 -0
  9. package/src/genie-commands/setup.ts +317 -199
  10. package/src/genie-commands/uninstall.ts +176 -0
  11. package/src/genie.ts +24 -44
  12. package/src/lib/claude-settings.ts +22 -64
  13. package/src/lib/genie-config.ts +169 -57
  14. package/src/lib/orchestrator/completion.ts +392 -0
  15. package/src/lib/orchestrator/event-monitor.ts +442 -0
  16. package/src/lib/orchestrator/index.ts +12 -0
  17. package/src/lib/orchestrator/patterns.ts +277 -0
  18. package/src/lib/orchestrator/state-detector.ts +339 -0
  19. package/src/lib/version.ts +1 -1
  20. package/src/lib/worker-registry.ts +229 -0
  21. package/src/term-commands/close.ts +221 -0
  22. package/src/term-commands/exec.ts +28 -6
  23. package/src/term-commands/kill.ts +143 -0
  24. package/src/term-commands/orchestrate.ts +844 -0
  25. package/src/term-commands/read.ts +6 -1
  26. package/src/term-commands/shortcuts.ts +14 -14
  27. package/src/term-commands/work.ts +415 -0
  28. package/src/term-commands/workers.ts +264 -0
  29. package/src/term.ts +201 -3
  30. package/src/types/genie-config.ts +49 -81
  31. package/src/genie-commands/hooks.ts +0 -317
  32. package/src/lib/hook-script.ts +0 -263
  33. package/src/lib/hooks/compose.ts +0 -72
  34. package/src/lib/hooks/index.ts +0 -163
  35. package/src/lib/hooks/presets/audited.ts +0 -191
  36. package/src/lib/hooks/presets/collaborative.ts +0 -143
  37. package/src/lib/hooks/presets/sandboxed.ts +0 -153
  38. package/src/lib/hooks/presets/supervised.ts +0 -66
  39. package/src/lib/hooks/utils/escape.ts +0 -46
package/dist/claudio.js CHANGED
@@ -1,66 +1,65 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
- var m8=Object.create;var{getPrototypeOf:l8,defineProperty:c2,getOwnPropertyNames:p8}=Object;var d8=Object.prototype.hasOwnProperty;var UD=(D,F,E)=>{E=D!=null?m8(l8(D)):{};let B=F||!D||!D.__esModule?c2(E,"default",{value:D,enumerable:!0}):E;for(let $ of p8(D))if(!d8.call(B,$))c2(B,$,{get:()=>D[$],enumerable:!0});return B};var h=(D,F)=>()=>(F||D((F={exports:{}}).exports,F),F.exports);var c8=(D,F)=>{for(var E in F)c2(D,E,{get:F[E],enumerable:!0,configurable:!0,set:(B)=>F[E]=()=>B})};var VD=import.meta.require;var Q2=h((n8)=>{class n2 extends Error{constructor(D,F,E){super(E);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=F,this.exitCode=D,this.nestedError=void 0}}class i0 extends n2{constructor(D){super(1,"commander.invalidArgument",D);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}n8.CommanderError=n2;n8.InvalidArgumentError=i0});var S2=h((s8)=>{var{InvalidArgumentError:a8}=Q2();class r0{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,E)=>{if(!this.argChoices.includes(F))throw new a8(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._concatValue(F,E);return F},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function o8(D){let F=D.name()+(D.variadic===!0?"...":"");return D.required?"<"+F+">":"["+F+"]"}s8.Argument=r0;s8.humanReadableArgName=o8});var i2=h((F6)=>{var{humanReadableArgName:D6}=S2();class a0{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(D){let F=D.commands.filter((B)=>!B._hidden),E=D._getHelpCommand();if(E&&!E._hidden)F.push(E);if(this.sortSubcommands)F.sort((B,$)=>{return B.name().localeCompare($.name())});return F}compareOptions(D,F){let E=(B)=>{return B.short?B.short.replace(/^-/,""):B.long.replace(/^--/,"")};return E(D).localeCompare(E(F))}visibleOptions(D){let F=D.options.filter((B)=>!B.hidden),E=D._getHelpOption();if(E&&!E.hidden){let B=E.short&&D._findOption(E.short),$=E.long&&D._findOption(E.long);if(!B&&!$)F.push(E);else if(E.long&&!$)F.push(D.createOption(E.long,E.description));else if(E.short&&!B)F.push(D.createOption(E.short,E.description))}if(this.sortOptions)F.sort(this.compareOptions);return F}visibleGlobalOptions(D){if(!this.showGlobalOptions)return[];let F=[];for(let E=D.parent;E;E=E.parent){let B=E.options.filter(($)=>!$.hidden);F.push(...B)}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((E)=>D6(E)).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((E,B)=>{return Math.max(E,F.subcommandTerm(B).length)},0)}longestOptionTermLength(D,F){return F.visibleOptions(D).reduce((E,B)=>{return Math.max(E,F.optionTerm(B).length)},0)}longestGlobalOptionTermLength(D,F){return F.visibleGlobalOptions(D).reduce((E,B)=>{return Math.max(E,F.optionTerm(B).length)},0)}longestArgumentTermLength(D,F){return F.visibleArguments(D).reduce((E,B)=>{return Math.max(E,F.argumentTerm(B).length)},0)}commandUsage(D){let F=D._name;if(D._aliases[0])F=F+"|"+D._aliases[0];let E="";for(let B=D.parent;B;B=B.parent)E=B.name()+" "+E;return E+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((E)=>JSON.stringify(E)).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((E)=>JSON.stringify(E)).join(", ")}`);if(D.defaultValue!==void 0)F.push(`default: ${D.defaultValueDescription||JSON.stringify(D.defaultValue)}`);if(F.length>0){let E=`(${F.join(", ")})`;if(D.description)return`${D.description} ${E}`;return E}return D.description}formatHelp(D,F){let E=F.padWidth(D,F),B=F.helpWidth||80,$=2,q=2;function X(M,I){if(I){let b=`${M.padEnd(E+2)}${I}`;return F.wrap(b,B-2,E+2)}return M}function J(M){return M.join(`
4
- `).replace(/^/gm," ".repeat(2))}let Q=[`Usage: ${F.commandUsage(D)}`,""],Y=F.commandDescription(D);if(Y.length>0)Q=Q.concat([F.wrap(Y,B,0),""]);let W=F.visibleArguments(D).map((M)=>{return X(F.argumentTerm(M),F.argumentDescription(M))});if(W.length>0)Q=Q.concat(["Arguments:",J(W),""]);let C=F.visibleOptions(D).map((M)=>{return X(F.optionTerm(M),F.optionDescription(M))});if(C.length>0)Q=Q.concat(["Options:",J(C),""]);if(this.showGlobalOptions){let M=F.visibleGlobalOptions(D).map((I)=>{return X(F.optionTerm(I),F.optionDescription(I))});if(M.length>0)Q=Q.concat(["Global Options:",J(M),""])}let U=F.visibleCommands(D).map((M)=>{return X(F.subcommandTerm(M),F.subcommandDescription(M))});if(U.length>0)Q=Q.concat(["Commands:",J(U),""]);return Q.join(`
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,E,B=40){let q=new RegExp(`[\\n][${" \\f\\t\\v\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF"}]+`);if(D.match(q))return D;let X=F-E;if(X<B)return D;let J=D.slice(0,E),Q=D.slice(E).replace(`\r
3
+ var K8=Object.create;var{getPrototypeOf:O8,defineProperty:f2,getOwnPropertyNames:S8}=Object;var w8=Object.prototype.hasOwnProperty;var zD=(D,F,E)=>{E=D!=null?K8(O8(D)):{};let B=F||!D||!D.__esModule?f2(E,"default",{value:D,enumerable:!0}):E;for(let $ of S8(D))if(!w8.call(B,$))f2(B,$,{get:()=>D[$],enumerable:!0});return B};var Z=(D,F)=>()=>(F||D((F={exports:{}}).exports,F),F.exports);var I8=(D,F)=>{for(var E in F)f2(D,E,{get:F[E],enumerable:!0,configurable:!0,set:(B)=>F[E]=()=>B})};var b1=(D,F)=>()=>(D&&(F=D(D=0)),F);var GD=import.meta.require;var eD=Z((b8)=>{class v2 extends Error{constructor(D,F,E){super(E);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=F,this.exitCode=D,this.nestedError=void 0}}class b0 extends v2{constructor(D){super(1,"commander.invalidArgument",D);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}b8.CommanderError=v2;b8.InvalidArgumentError=b0});var G2=Z((v8)=>{var{InvalidArgumentError:T8}=eD();class k0{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,E)=>{if(!this.argChoices.includes(F))throw new T8(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._concatValue(F,E);return F},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function f8(D){let F=D.name()+(D.variadic===!0?"...":"");return D.required?"<"+F+">":"["+F+"]"}v8.Argument=k0;v8.humanReadableArgName=f8});var Z2=Z((h8)=>{var{humanReadableArgName:y8}=G2();class P0{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(D){let F=D.commands.filter((B)=>!B._hidden),E=D._getHelpCommand();if(E&&!E._hidden)F.push(E);if(this.sortSubcommands)F.sort((B,$)=>{return B.name().localeCompare($.name())});return F}compareOptions(D,F){let E=(B)=>{return B.short?B.short.replace(/^-/,""):B.long.replace(/^--/,"")};return E(D).localeCompare(E(F))}visibleOptions(D){let F=D.options.filter((B)=>!B.hidden),E=D._getHelpOption();if(E&&!E.hidden){let B=E.short&&D._findOption(E.short),$=E.long&&D._findOption(E.long);if(!B&&!$)F.push(E);else if(E.long&&!$)F.push(D.createOption(E.long,E.description));else if(E.short&&!B)F.push(D.createOption(E.short,E.description))}if(this.sortOptions)F.sort(this.compareOptions);return F}visibleGlobalOptions(D){if(!this.showGlobalOptions)return[];let F=[];for(let E=D.parent;E;E=E.parent){let B=E.options.filter(($)=>!$.hidden);F.push(...B)}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((E)=>y8(E)).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((E,B)=>{return Math.max(E,F.subcommandTerm(B).length)},0)}longestOptionTermLength(D,F){return F.visibleOptions(D).reduce((E,B)=>{return Math.max(E,F.optionTerm(B).length)},0)}longestGlobalOptionTermLength(D,F){return F.visibleGlobalOptions(D).reduce((E,B)=>{return Math.max(E,F.optionTerm(B).length)},0)}longestArgumentTermLength(D,F){return F.visibleArguments(D).reduce((E,B)=>{return Math.max(E,F.argumentTerm(B).length)},0)}commandUsage(D){let F=D._name;if(D._aliases[0])F=F+"|"+D._aliases[0];let E="";for(let B=D.parent;B;B=B.parent)E=B.name()+" "+E;return E+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((E)=>JSON.stringify(E)).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((E)=>JSON.stringify(E)).join(", ")}`);if(D.defaultValue!==void 0)F.push(`default: ${D.defaultValueDescription||JSON.stringify(D.defaultValue)}`);if(F.length>0){let E=`(${F.join(", ")})`;if(D.description)return`${D.description} ${E}`;return E}return D.description}formatHelp(D,F){let E=F.padWidth(D,F),B=F.helpWidth||80,$=2,q=2;function C(z,w){if(w){let I=`${z.padEnd(E+2)}${w}`;return F.wrap(I,B-2,E+2)}return z}function X(z){return z.join(`
4
+ `).replace(/^/gm," ".repeat(2))}let Q=[`Usage: ${F.commandUsage(D)}`,""],J=F.commandDescription(D);if(J.length>0)Q=Q.concat([F.wrap(J,B,0),""]);let _=F.visibleArguments(D).map((z)=>{return C(F.argumentTerm(z),F.argumentDescription(z))});if(_.length>0)Q=Q.concat(["Arguments:",X(_),""]);let H=F.visibleOptions(D).map((z)=>{return C(F.optionTerm(z),F.optionDescription(z))});if(H.length>0)Q=Q.concat(["Options:",X(H),""]);if(this.showGlobalOptions){let z=F.visibleGlobalOptions(D).map((w)=>{return C(F.optionTerm(w),F.optionDescription(w))});if(z.length>0)Q=Q.concat(["Global Options:",X(z),""])}let j=F.visibleCommands(D).map((z)=>{return C(F.subcommandTerm(z),F.subcommandDescription(z))});if(j.length>0)Q=Q.concat(["Commands:",X(j),""]);return Q.join(`
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,E,B=40){let q=new RegExp(`[\\n][${" \\f\\t\\v\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF"}]+`);if(D.match(q))return D;let C=F-E;if(C<B)return D;let X=D.slice(0,E),Q=D.slice(E).replace(`\r
6
6
  `,`
7
- `),Y=" ".repeat(E),C=`\\s${"\u200B"}`,U=new RegExp(`
8
- |.{1,${X-1}}([${C}]|$)|[^${C}]+?([${C}]|$)`,"g"),M=Q.match(U)||[];return J+M.map((I,b)=>{if(I===`
9
- `)return"";return(b>0?Y:"")+I.trimEnd()}).join(`
10
- `)}}F6.Help=a0});var r2=h((X6)=>{var{InvalidArgumentError:B6}=Q2();class o0{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 E=q6(D);if(this.short=E.shortFlag,this.long=E.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,E)=>{if(!this.argChoices.includes(F))throw new B6(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._concatValue(F,E);return F},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){return $6(this.name().replace(/^no-/,""))}is(D){return this.short===D||this.long===D}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class s0{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,E)=>{if(this.positiveOptions.has(E))this.dualOptions.add(E)})}valueFromOption(D,F){let E=F.attributeName();if(!this.dualOptions.has(E))return!0;let B=this.negativeOptions.get(E).presetArg,$=B!==void 0?B:!1;return F.negate===($===D)}}function $6(D){return D.split("-").reduce((F,E)=>{return F+E[0].toUpperCase()+E.slice(1)})}function q6(D){let F,E,B=D.split(/[ |,]+/);if(B.length>1&&!/^[[<]/.test(B[1]))F=B.shift();if(E=B.shift(),!F&&/^-[^-]$/.test(E))F=E,E=void 0;return{shortFlag:F,longFlag:E}}X6.Option=o0;X6.DualOptions=s0});var t0=h((H6)=>{function Y6(D,F){if(Math.abs(D.length-F.length)>3)return Math.max(D.length,F.length);let E=[];for(let B=0;B<=D.length;B++)E[B]=[B];for(let B=0;B<=F.length;B++)E[0][B]=B;for(let B=1;B<=F.length;B++)for(let $=1;$<=D.length;$++){let q=1;if(D[$-1]===F[B-1])q=0;else q=1;if(E[$][B]=Math.min(E[$-1][B]+1,E[$][B-1]+1,E[$-1][B-1]+q),$>1&&B>1&&D[$-1]===F[B-2]&&D[$-2]===F[B-1])E[$][B]=Math.min(E[$][B],E[$-2][B-2]+1)}return E[D.length][F.length]}function W6(D,F){if(!F||F.length===0)return"";F=Array.from(new Set(F));let E=D.startsWith("--");if(E)D=D.slice(2),F=F.map((X)=>X.slice(2));let B=[],$=3,q=0.4;if(F.forEach((X)=>{if(X.length<=1)return;let J=Y6(D,X),Q=Math.max(D.length,X.length);if((Q-J)/Q>q){if(J<$)$=J,B=[X];else if(J===$)B.push(X)}}),B.sort((X,J)=>X.localeCompare(J)),E)B=B.map((X)=>`--${X}`);if(B.length>1)return`
7
+ `),J=" ".repeat(E),H=`\\s${"\u200B"}`,j=new RegExp(`
8
+ |.{1,${C-1}}([${H}]|$)|[^${H}]+?([${H}]|$)`,"g"),z=Q.match(j)||[];return X+z.map((w,I)=>{if(w===`
9
+ `)return"";return(I>0?J:"")+w.trimEnd()}).join(`
10
+ `)}}h8.Help=P0});var x2=Z((c8)=>{var{InvalidArgumentError:m8}=eD();class T0{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 E=p8(D);if(this.short=E.shortFlag,this.long=E.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,E)=>{if(!this.argChoices.includes(F))throw new m8(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._concatValue(F,E);return F},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){return l8(this.name().replace(/^no-/,""))}is(D){return this.short===D||this.long===D}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class f0{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,E)=>{if(this.positiveOptions.has(E))this.dualOptions.add(E)})}valueFromOption(D,F){let E=F.attributeName();if(!this.dualOptions.has(E))return!0;let B=this.negativeOptions.get(E).presetArg,$=B!==void 0?B:!1;return F.negate===($===D)}}function l8(D){return D.split("-").reduce((F,E)=>{return F+E[0].toUpperCase()+E.slice(1)})}function p8(D){let F,E,B=D.split(/[ |,]+/);if(B.length>1&&!/^[[<]/.test(B[1]))F=B.shift();if(E=B.shift(),!F&&/^-[^-]$/.test(E))F=E,E=void 0;return{shortFlag:F,longFlag:E}}c8.Option=T0;c8.DualOptions=f0});var v0=Z((a8)=>{function i8(D,F){if(Math.abs(D.length-F.length)>3)return Math.max(D.length,F.length);let E=[];for(let B=0;B<=D.length;B++)E[B]=[B];for(let B=0;B<=F.length;B++)E[0][B]=B;for(let B=1;B<=F.length;B++)for(let $=1;$<=D.length;$++){let q=1;if(D[$-1]===F[B-1])q=0;else q=1;if(E[$][B]=Math.min(E[$-1][B]+1,E[$][B-1]+1,E[$-1][B-1]+q),$>1&&B>1&&D[$-1]===F[B-2]&&D[$-2]===F[B-1])E[$][B]=Math.min(E[$][B],E[$-2][B-2]+1)}return E[D.length][F.length]}function r8(D,F){if(!F||F.length===0)return"";F=Array.from(new Set(F));let E=D.startsWith("--");if(E)D=D.slice(2),F=F.map((C)=>C.slice(2));let B=[],$=3,q=0.4;if(F.forEach((C)=>{if(C.length<=1)return;let X=i8(D,C),Q=Math.max(D.length,C.length);if((Q-X)/Q>q){if(X<$)$=X,B=[C];else if(X===$)B.push(C)}}),B.sort((C,X)=>C.localeCompare(X)),E)B=B.map((C)=>`--${C}`);if(B.length>1)return`
11
11
  (Did you mean one of ${B.join(", ")}?)`;if(B.length===1)return`
12
- (Did you mean ${B[0]}?)`;return""}H6.suggestSimilar=W6});var E3=h((j6)=>{var G6=VD("events").EventEmitter,a2=VD("child_process"),GD=VD("path"),o2=VD("fs"),y=VD("process"),{Argument:C6,humanReadableArgName:M6}=S2(),{CommanderError:s2}=Q2(),{Help:R6}=i2(),{Option:e0,DualOptions:A6}=r2(),{suggestSimilar:D3}=t0();class t2 extends G6{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,E)=>E(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,E){let B=F,$=E;if(typeof B==="object"&&B!==null)$=B,B=null;$=$||{};let[,q,X]=D.match(/([^ ]+) *(.*)/),J=this.createCommand(q);if(B)J.description(B),J._executableHandler=!0;if($.isDefault)this._defaultCommandName=J._name;if(J._hidden=!!($.noHelp||$.hidden),J._executableFile=$.executableFile||null,X)J.arguments(X);if(this._registerCommand(J),J.parent=this,J.copyInheritedSettings(this),B)return this;return J}createCommand(D){return new t2(D)}createHelp(){return Object.assign(new R6,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 C6(D,F)}argument(D,F,E,B){let $=this.createArgument(D,F);if(typeof E==="function")$.default(B).argParser(E);else $.default(E);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[,E,B]=D.match(/([^ ]+) *(.*)/),$=F??"display help for command",q=this.createCommand(E);if(q.helpOption(!1),B)q.arguments(B);if($)q.description($);return this._addImplicitHelpCommand=!0,this._helpCommand=q,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 E=["preSubcommand","preAction","postAction"];if(!E.includes(D))throw Error(`Unexpected value for event passed to hook : '${D}'.
14
- Expecting one of '${E.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,E){if(this._exitCallback)this._exitCallback(new s2(D,F,E));y.exit(D)}action(D){let F=(E)=>{let B=this.registeredArguments.length,$=E.slice(0,B);if(this._storeOptionsAsProperties)$[B]=this;else $[B]=this.opts();return $.push(this),D.apply(this,$)};return this._actionHandler=F,this}createOption(D,F){return new e0(D,F)}_callParseArg(D,F,E,B){try{return D.parseArg(F,E)}catch($){if($.code==="commander.invalidArgument"){let q=`${B} ${$.message}`;this.error(q,{exitCode:$.exitCode,code:$.code})}throw $}}_registerOption(D){let F=D.short&&this._findOption(D.short)||D.long&&this._findOption(D.long);if(F){let E=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 '${E}'
15
- - already used by option '${F.flags}'`)}this.options.push(D)}_registerCommand(D){let F=(B)=>{return[B.name()].concat(B.aliases())},E=F(D).find((B)=>this._findCommand(B));if(E){let B=F(this._findCommand(E)).join("|"),$=F(D).join("|");throw Error(`cannot add command '${$}' as already have command '${B}'`)}this.commands.push(D)}addOption(D){this._registerOption(D);let F=D.name(),E=D.attributeName();if(D.negate){let $=D.long.replace(/^--no-/,"--");if(!this._findOption($))this.setOptionValueWithSource(E,D.defaultValue===void 0?!0:D.defaultValue,"default")}else if(D.defaultValue!==void 0)this.setOptionValueWithSource(E,D.defaultValue,"default");let B=($,q,X)=>{if($==null&&D.presetArg!==void 0)$=D.presetArg;let J=this.getOptionValue(E);if($!==null&&D.parseArg)$=this._callParseArg(D,$,J,q);else if($!==null&&D.variadic)$=D._concatValue($,J);if($==null)if(D.negate)$=!1;else if(D.isBoolean()||D.optional)$=!0;else $="";this.setOptionValueWithSource(E,$,X)};if(this.on("option:"+F,($)=>{let q=`error: option '${D.flags}' argument '${$}' is invalid.`;B($,q,"cli")}),D.envVar)this.on("optionEnv:"+F,($)=>{let q=`error: option '${D.flags}' value '${$}' from env '${D.envVar}' is invalid.`;B($,q,"env")});return this}_optionEx(D,F,E,B,$){if(typeof F==="object"&&F instanceof e0)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let q=this.createOption(F,E);if(q.makeOptionMandatory(!!D.mandatory),typeof B==="function")q.default($).argParser(B);else if(B instanceof RegExp){let X=B;B=(J,Q)=>{let Y=X.exec(J);return Y?Y[0]:Q},q.default($).argParser(B)}else q.default(B);return this.addOption(q)}option(D,F,E,B){return this._optionEx({},D,F,E,B)}requiredOption(D,F,E,B){return this._optionEx({mandatory:!0},D,F,E,B)}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,E){if(this._storeOptionsAsProperties)this[D]=F;else this._optionValues[D]=F;return this._optionValueSources[D]=E,this}getOptionValueSource(D){return this._optionValueSources[D]}getOptionValueSourceWithGlobals(D){let F;return this._getCommandAndAncestors().forEach((E)=>{if(E.getOptionValueSource(D)!==void 0)F=E.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 B=y.execArgv??[];if(B.includes("-e")||B.includes("--eval")||B.includes("-p")||B.includes("--print"))F.from="eval"}if(D===void 0)D=y.argv;this.rawArgs=D.slice();let E;switch(F.from){case void 0:case"node":this._scriptPath=D[1],E=D.slice(2);break;case"electron":if(y.defaultApp)this._scriptPath=D[1],E=D.slice(2);else E=D.slice(1);break;case"user":E=D.slice(0);break;case"eval":E=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",E}parse(D,F){let E=this._prepareUserArgs(D,F);return this._parseCommand([],E),this}async parseAsync(D,F){let E=this._prepareUserArgs(D,F);return await this._parseCommand([],E),this}_executeSubCommand(D,F){F=F.slice();let E=!1,B=[".js",".ts",".tsx",".mjs",".cjs"];function $(Y,W){let C=GD.resolve(Y,W);if(o2.existsSync(C))return C;if(B.includes(GD.extname(W)))return;let U=B.find((M)=>o2.existsSync(`${C}${M}`));if(U)return`${C}${U}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let q=D._executableFile||`${this._name}-${D._name}`,X=this._executableDir||"";if(this._scriptPath){let Y;try{Y=o2.realpathSync(this._scriptPath)}catch(W){Y=this._scriptPath}X=GD.resolve(GD.dirname(Y),X)}if(X){let Y=$(X,q);if(!Y&&!D._executableFile&&this._scriptPath){let W=GD.basename(this._scriptPath,GD.extname(this._scriptPath));if(W!==this._name)Y=$(X,`${W}-${D._name}`)}q=Y||q}E=B.includes(GD.extname(q));let J;if(y.platform!=="win32")if(E)F.unshift(q),F=F3(y.execArgv).concat(F),J=a2.spawn(y.argv[0],F,{stdio:"inherit"});else J=a2.spawn(q,F,{stdio:"inherit"});else F.unshift(q),F=F3(y.execArgv).concat(F),J=a2.spawn(y.execPath,F,{stdio:"inherit"});if(!J.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((W)=>{y.on(W,()=>{if(J.killed===!1&&J.exitCode===null)J.kill(W)})});let Q=this._exitCallback;J.on("close",(Y)=>{if(Y=Y??1,!Q)y.exit(Y);else Q(new s2(Y,"commander.executeSubCommandAsync","(close)"))}),J.on("error",(Y)=>{if(Y.code==="ENOENT"){let W=X?`searched for local subcommand relative to directory '${X}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",C=`'${q}' does not exist
12
+ (Did you mean ${B[0]}?)`;return""}a8.suggestSimilar=r8});var h0=Z((EF)=>{var s8=GD("events").EventEmitter,y2=GD("child_process"),$D=GD("path"),h2=GD("fs"),v=GD("process"),{Argument:t8,humanReadableArgName:e8}=G2(),{CommanderError:g2}=eD(),{Help:DF}=Z2(),{Option:Z0,DualOptions:FF}=x2(),{suggestSimilar:x0}=v0();class m2 extends s8{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)=>v.stdout.write(F),writeErr:(F)=>v.stderr.write(F),getOutHelpWidth:()=>v.stdout.isTTY?v.stdout.columns:void 0,getErrHelpWidth:()=>v.stderr.isTTY?v.stderr.columns:void 0,outputError:(F,E)=>E(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,E){let B=F,$=E;if(typeof B==="object"&&B!==null)$=B,B=null;$=$||{};let[,q,C]=D.match(/([^ ]+) *(.*)/),X=this.createCommand(q);if(B)X.description(B),X._executableHandler=!0;if($.isDefault)this._defaultCommandName=X._name;if(X._hidden=!!($.noHelp||$.hidden),X._executableFile=$.executableFile||null,C)X.arguments(C);if(this._registerCommand(X),X.parent=this,X.copyInheritedSettings(this),B)return this;return X}createCommand(D){return new m2(D)}createHelp(){return Object.assign(new DF,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 t8(D,F)}argument(D,F,E,B){let $=this.createArgument(D,F);if(typeof E==="function")$.default(B).argParser(E);else $.default(E);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[,E,B]=D.match(/([^ ]+) *(.*)/),$=F??"display help for command",q=this.createCommand(E);if(q.helpOption(!1),B)q.arguments(B);if($)q.description($);return this._addImplicitHelpCommand=!0,this._helpCommand=q,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 E=["preSubcommand","preAction","postAction"];if(!E.includes(D))throw Error(`Unexpected value for event passed to hook : '${D}'.
14
+ Expecting one of '${E.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,E){if(this._exitCallback)this._exitCallback(new g2(D,F,E));v.exit(D)}action(D){let F=(E)=>{let B=this.registeredArguments.length,$=E.slice(0,B);if(this._storeOptionsAsProperties)$[B]=this;else $[B]=this.opts();return $.push(this),D.apply(this,$)};return this._actionHandler=F,this}createOption(D,F){return new Z0(D,F)}_callParseArg(D,F,E,B){try{return D.parseArg(F,E)}catch($){if($.code==="commander.invalidArgument"){let q=`${B} ${$.message}`;this.error(q,{exitCode:$.exitCode,code:$.code})}throw $}}_registerOption(D){let F=D.short&&this._findOption(D.short)||D.long&&this._findOption(D.long);if(F){let E=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 '${E}'
15
+ - already used by option '${F.flags}'`)}this.options.push(D)}_registerCommand(D){let F=(B)=>{return[B.name()].concat(B.aliases())},E=F(D).find((B)=>this._findCommand(B));if(E){let B=F(this._findCommand(E)).join("|"),$=F(D).join("|");throw Error(`cannot add command '${$}' as already have command '${B}'`)}this.commands.push(D)}addOption(D){this._registerOption(D);let F=D.name(),E=D.attributeName();if(D.negate){let $=D.long.replace(/^--no-/,"--");if(!this._findOption($))this.setOptionValueWithSource(E,D.defaultValue===void 0?!0:D.defaultValue,"default")}else if(D.defaultValue!==void 0)this.setOptionValueWithSource(E,D.defaultValue,"default");let B=($,q,C)=>{if($==null&&D.presetArg!==void 0)$=D.presetArg;let X=this.getOptionValue(E);if($!==null&&D.parseArg)$=this._callParseArg(D,$,X,q);else if($!==null&&D.variadic)$=D._concatValue($,X);if($==null)if(D.negate)$=!1;else if(D.isBoolean()||D.optional)$=!0;else $="";this.setOptionValueWithSource(E,$,C)};if(this.on("option:"+F,($)=>{let q=`error: option '${D.flags}' argument '${$}' is invalid.`;B($,q,"cli")}),D.envVar)this.on("optionEnv:"+F,($)=>{let q=`error: option '${D.flags}' value '${$}' from env '${D.envVar}' is invalid.`;B($,q,"env")});return this}_optionEx(D,F,E,B,$){if(typeof F==="object"&&F instanceof Z0)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let q=this.createOption(F,E);if(q.makeOptionMandatory(!!D.mandatory),typeof B==="function")q.default($).argParser(B);else if(B instanceof RegExp){let C=B;B=(X,Q)=>{let J=C.exec(X);return J?J[0]:Q},q.default($).argParser(B)}else q.default(B);return this.addOption(q)}option(D,F,E,B){return this._optionEx({},D,F,E,B)}requiredOption(D,F,E,B){return this._optionEx({mandatory:!0},D,F,E,B)}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,E){if(this._storeOptionsAsProperties)this[D]=F;else this._optionValues[D]=F;return this._optionValueSources[D]=E,this}getOptionValueSource(D){return this._optionValueSources[D]}getOptionValueSourceWithGlobals(D){let F;return this._getCommandAndAncestors().forEach((E)=>{if(E.getOptionValueSource(D)!==void 0)F=E.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(v.versions?.electron)F.from="electron";let B=v.execArgv??[];if(B.includes("-e")||B.includes("--eval")||B.includes("-p")||B.includes("--print"))F.from="eval"}if(D===void 0)D=v.argv;this.rawArgs=D.slice();let E;switch(F.from){case void 0:case"node":this._scriptPath=D[1],E=D.slice(2);break;case"electron":if(v.defaultApp)this._scriptPath=D[1],E=D.slice(2);else E=D.slice(1);break;case"user":E=D.slice(0);break;case"eval":E=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",E}parse(D,F){let E=this._prepareUserArgs(D,F);return this._parseCommand([],E),this}async parseAsync(D,F){let E=this._prepareUserArgs(D,F);return await this._parseCommand([],E),this}_executeSubCommand(D,F){F=F.slice();let E=!1,B=[".js",".ts",".tsx",".mjs",".cjs"];function $(J,_){let H=$D.resolve(J,_);if(h2.existsSync(H))return H;if(B.includes($D.extname(_)))return;let j=B.find((z)=>h2.existsSync(`${H}${z}`));if(j)return`${H}${j}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let q=D._executableFile||`${this._name}-${D._name}`,C=this._executableDir||"";if(this._scriptPath){let J;try{J=h2.realpathSync(this._scriptPath)}catch(_){J=this._scriptPath}C=$D.resolve($D.dirname(J),C)}if(C){let J=$(C,q);if(!J&&!D._executableFile&&this._scriptPath){let _=$D.basename(this._scriptPath,$D.extname(this._scriptPath));if(_!==this._name)J=$(C,`${_}-${D._name}`)}q=J||q}E=B.includes($D.extname(q));let X;if(v.platform!=="win32")if(E)F.unshift(q),F=y0(v.execArgv).concat(F),X=y2.spawn(v.argv[0],F,{stdio:"inherit"});else X=y2.spawn(q,F,{stdio:"inherit"});else F.unshift(q),F=y0(v.execArgv).concat(F),X=y2.spawn(v.execPath,F,{stdio:"inherit"});if(!X.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((_)=>{v.on(_,()=>{if(X.killed===!1&&X.exitCode===null)X.kill(_)})});let Q=this._exitCallback;X.on("close",(J)=>{if(J=J??1,!Q)v.exit(J);else Q(new g2(J,"commander.executeSubCommandAsync","(close)"))}),X.on("error",(J)=>{if(J.code==="ENOENT"){let _=C?`searched for local subcommand relative to directory '${C}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",H=`'${q}' 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
- - ${W}`;throw Error(C)}else if(Y.code==="EACCES")throw Error(`'${q}' not executable`);if(!Q)y.exit(1);else{let W=new s2(1,"commander.executeSubCommandAsync","(error)");W.nestedError=Y,Q(W)}}),this.runningCommand=J}_dispatchSubcommand(D,F,E){let B=this._findCommand(D);if(!B)this.help({error:!0});let $;return $=this._chainOrCallSubCommandHook($,B,"preSubcommand"),$=this._chainOrCall($,()=>{if(B._executableHandler)this._executeSubCommand(B,F.concat(E));else return B._parseCommand(F,E)}),$}_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=(E,B,$)=>{let q=B;if(B!==null&&E.parseArg){let X=`error: command-argument value '${B}' is invalid for argument '${E.name()}'.`;q=this._callParseArg(E,B,$,X)}return q};this._checkNumberOfArguments();let F=[];this.registeredArguments.forEach((E,B)=>{let $=E.defaultValue;if(E.variadic){if(B<this.args.length){if($=this.args.slice(B),E.parseArg)$=$.reduce((q,X)=>{return D(E,X,q)},E.defaultValue)}else if($===void 0)$=[]}else if(B<this.args.length){if($=this.args[B],E.parseArg)$=D(E,$,E.defaultValue)}F[B]=$}),this.processedArgs=F}_chainOrCall(D,F){if(D&&D.then&&typeof D.then==="function")return D.then(()=>F());return F()}_chainOrCallHooks(D,F){let E=D,B=[];if(this._getCommandAndAncestors().reverse().filter(($)=>$._lifeCycleHooks[F]!==void 0).forEach(($)=>{$._lifeCycleHooks[F].forEach((q)=>{B.push({hookedCommand:$,callback:q})})}),F==="postAction")B.reverse();return B.forEach(($)=>{E=this._chainOrCall(E,()=>{return $.callback($.hookedCommand,this)})}),E}_chainOrCallSubCommandHook(D,F,E){let B=D;if(this._lifeCycleHooks[E]!==void 0)this._lifeCycleHooks[E].forEach(($)=>{B=this._chainOrCall(B,()=>{return $(this,F)})});return B}_parseCommand(D,F){let E=this.parseOptions(F);if(this._parseOptionsEnv(),this._parseOptionsImplied(),D=D.concat(E.operands),F=E.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(E.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let B=()=>{if(E.unknown.length>0)this.unknownOption(E.unknown[0])},$=`command:${this.name()}`;if(this._actionHandler){B(),this._processArguments();let q;if(q=this._chainOrCallHooks(q,"preAction"),q=this._chainOrCall(q,()=>this._actionHandler(this.processedArgs)),this.parent)q=this._chainOrCall(q,()=>{this.parent.emit($,D,F)});return q=this._chainOrCallHooks(q,"postAction"),q}if(this.parent&&this.parent.listenerCount($))B(),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 B(),this._processArguments()}else if(this.commands.length)B(),this.help({error:!0});else B(),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((E)=>{let B=E.attributeName();if(this.getOptionValue(B)===void 0)return!1;return this.getOptionValueSource(B)!=="default"});D.filter((E)=>E.conflictsWith.length>0).forEach((E)=>{let B=D.find(($)=>E.conflictsWith.includes($.attributeName()));if(B)this._conflictingOption(E,B)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((D)=>{D._checkForConflictingLocalOptions()})}parseOptions(D){let F=[],E=[],B=F,$=D.slice();function q(J){return J.length>1&&J[0]==="-"}let X=null;while($.length){let J=$.shift();if(J==="--"){if(B===E)B.push(J);B.push(...$);break}if(X&&!q(J)){this.emit(`option:${X.name()}`,J);continue}if(X=null,q(J)){let Q=this._findOption(J);if(Q){if(Q.required){let Y=$.shift();if(Y===void 0)this.optionMissingArgument(Q);this.emit(`option:${Q.name()}`,Y)}else if(Q.optional){let Y=null;if($.length>0&&!q($[0]))Y=$.shift();this.emit(`option:${Q.name()}`,Y)}else this.emit(`option:${Q.name()}`);X=Q.variadic?Q:null;continue}}if(J.length>2&&J[0]==="-"&&J[1]!=="-"){let Q=this._findOption(`-${J[1]}`);if(Q){if(Q.required||Q.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${Q.name()}`,J.slice(2));else this.emit(`option:${Q.name()}`),$.unshift(`-${J.slice(2)}`);continue}}if(/^--[^=]+=/.test(J)){let Q=J.indexOf("="),Y=this._findOption(J.slice(0,Q));if(Y&&(Y.required||Y.optional)){this.emit(`option:${Y.name()}`,J.slice(Q+1));continue}}if(q(J))B=E;if((this._enablePositionalOptions||this._passThroughOptions)&&F.length===0&&E.length===0){if(this._findCommand(J)){if(F.push(J),$.length>0)E.push(...$);break}else if(this._getHelpCommand()&&J===this._getHelpCommand().name()){if(F.push(J),$.length>0)F.push(...$);break}else if(this._defaultCommandName){if(E.push(J),$.length>0)E.push(...$);break}}if(this._passThroughOptions){if(B.push(J),$.length>0)B.push(...$);break}B.push(J)}return{operands:F,unknown:E}}opts(){if(this._storeOptionsAsProperties){let D={},F=this.options.length;for(let E=0;E<F;E++){let B=this.options[E].attributeName();D[B]=B===this._versionOptionName?this._version:this[B]}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
+ - ${_}`;throw Error(H)}else if(J.code==="EACCES")throw Error(`'${q}' not executable`);if(!Q)v.exit(1);else{let _=new g2(1,"commander.executeSubCommandAsync","(error)");_.nestedError=J,Q(_)}}),this.runningCommand=X}_dispatchSubcommand(D,F,E){let B=this._findCommand(D);if(!B)this.help({error:!0});let $;return $=this._chainOrCallSubCommandHook($,B,"preSubcommand"),$=this._chainOrCall($,()=>{if(B._executableHandler)this._executeSubCommand(B,F.concat(E));else return B._parseCommand(F,E)}),$}_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=(E,B,$)=>{let q=B;if(B!==null&&E.parseArg){let C=`error: command-argument value '${B}' is invalid for argument '${E.name()}'.`;q=this._callParseArg(E,B,$,C)}return q};this._checkNumberOfArguments();let F=[];this.registeredArguments.forEach((E,B)=>{let $=E.defaultValue;if(E.variadic){if(B<this.args.length){if($=this.args.slice(B),E.parseArg)$=$.reduce((q,C)=>{return D(E,C,q)},E.defaultValue)}else if($===void 0)$=[]}else if(B<this.args.length){if($=this.args[B],E.parseArg)$=D(E,$,E.defaultValue)}F[B]=$}),this.processedArgs=F}_chainOrCall(D,F){if(D&&D.then&&typeof D.then==="function")return D.then(()=>F());return F()}_chainOrCallHooks(D,F){let E=D,B=[];if(this._getCommandAndAncestors().reverse().filter(($)=>$._lifeCycleHooks[F]!==void 0).forEach(($)=>{$._lifeCycleHooks[F].forEach((q)=>{B.push({hookedCommand:$,callback:q})})}),F==="postAction")B.reverse();return B.forEach(($)=>{E=this._chainOrCall(E,()=>{return $.callback($.hookedCommand,this)})}),E}_chainOrCallSubCommandHook(D,F,E){let B=D;if(this._lifeCycleHooks[E]!==void 0)this._lifeCycleHooks[E].forEach(($)=>{B=this._chainOrCall(B,()=>{return $(this,F)})});return B}_parseCommand(D,F){let E=this.parseOptions(F);if(this._parseOptionsEnv(),this._parseOptionsImplied(),D=D.concat(E.operands),F=E.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(E.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let B=()=>{if(E.unknown.length>0)this.unknownOption(E.unknown[0])},$=`command:${this.name()}`;if(this._actionHandler){B(),this._processArguments();let q;if(q=this._chainOrCallHooks(q,"preAction"),q=this._chainOrCall(q,()=>this._actionHandler(this.processedArgs)),this.parent)q=this._chainOrCall(q,()=>{this.parent.emit($,D,F)});return q=this._chainOrCallHooks(q,"postAction"),q}if(this.parent&&this.parent.listenerCount($))B(),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 B(),this._processArguments()}else if(this.commands.length)B(),this.help({error:!0});else B(),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((E)=>{let B=E.attributeName();if(this.getOptionValue(B)===void 0)return!1;return this.getOptionValueSource(B)!=="default"});D.filter((E)=>E.conflictsWith.length>0).forEach((E)=>{let B=D.find(($)=>E.conflictsWith.includes($.attributeName()));if(B)this._conflictingOption(E,B)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((D)=>{D._checkForConflictingLocalOptions()})}parseOptions(D){let F=[],E=[],B=F,$=D.slice();function q(X){return X.length>1&&X[0]==="-"}let C=null;while($.length){let X=$.shift();if(X==="--"){if(B===E)B.push(X);B.push(...$);break}if(C&&!q(X)){this.emit(`option:${C.name()}`,X);continue}if(C=null,q(X)){let Q=this._findOption(X);if(Q){if(Q.required){let J=$.shift();if(J===void 0)this.optionMissingArgument(Q);this.emit(`option:${Q.name()}`,J)}else if(Q.optional){let J=null;if($.length>0&&!q($[0]))J=$.shift();this.emit(`option:${Q.name()}`,J)}else this.emit(`option:${Q.name()}`);C=Q.variadic?Q:null;continue}}if(X.length>2&&X[0]==="-"&&X[1]!=="-"){let Q=this._findOption(`-${X[1]}`);if(Q){if(Q.required||Q.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${Q.name()}`,X.slice(2));else this.emit(`option:${Q.name()}`),$.unshift(`-${X.slice(2)}`);continue}}if(/^--[^=]+=/.test(X)){let Q=X.indexOf("="),J=this._findOption(X.slice(0,Q));if(J&&(J.required||J.optional)){this.emit(`option:${J.name()}`,X.slice(Q+1));continue}}if(q(X))B=E;if((this._enablePositionalOptions||this._passThroughOptions)&&F.length===0&&E.length===0){if(this._findCommand(X)){if(F.push(X),$.length>0)E.push(...$);break}else if(this._getHelpCommand()&&X===this._getHelpCommand().name()){if(F.push(X),$.length>0)F.push(...$);break}else if(this._defaultCommandName){if(E.push(X),$.length>0)E.push(...$);break}}if(this._passThroughOptions){if(B.push(X),$.length>0)B.push(...$);break}B.push(X)}return{operands:F,unknown:E}}opts(){if(this._storeOptionsAsProperties){let D={},F=this.options.length;for(let E=0;E<F;E++){let B=this.options[E].attributeName();D[B]=B===this._versionOptionName?this._version:this[B]}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 E=F||{},B=E.exitCode||1,$=E.code||"commander.error";this._exit(B,$,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 A6(this.options),F=(E)=>{return this.getOptionValue(E)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(E))};this.options.filter((E)=>E.implied!==void 0&&F(E.attributeName())&&D.valueFromOption(this.getOptionValue(E.attributeName()),E)).forEach((E)=>{Object.keys(E.implied).filter((B)=>!F(B)).forEach((B)=>{this.setOptionValueWithSource(B,E.implied[B],"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 E=(q)=>{let X=q.attributeName(),J=this.getOptionValue(X),Q=this.options.find((W)=>W.negate&&X===W.attributeName()),Y=this.options.find((W)=>!W.negate&&X===W.attributeName());if(Q&&(Q.presetArg===void 0&&J===!1||Q.presetArg!==void 0&&J===Q.presetArg))return Q;return Y||q},B=(q)=>{let X=E(q),J=X.attributeName();if(this.getOptionValueSource(J)==="env")return`environment variable '${X.envVar}'`;return`option '${X.flags}'`},$=`error: ${B(D)} cannot be used with ${B(F)}`;this.error($,{code:"commander.conflictingOption"})}unknownOption(D){if(this._allowUnknownOption)return;let F="";if(D.startsWith("--")&&this._showSuggestionAfterError){let B=[],$=this;do{let q=$.createHelp().visibleOptions($).filter((X)=>X.long).map((X)=>X.long);B=B.concat(q),$=$.parent}while($&&!$._enablePositionalOptions);F=D3(D,B)}let E=`error: unknown option '${D}'${F}`;this.error(E,{code:"commander.unknownOption"})}_excessArguments(D){if(this._allowExcessArguments)return;let F=this.registeredArguments.length,E=F===1?"":"s",$=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${F} argument${E} but got ${D.length}.`;this.error($,{code:"commander.excessArguments"})}unknownCommand(){let D=this.args[0],F="";if(this._showSuggestionAfterError){let B=[];this.createHelp().visibleCommands(this).forEach(($)=>{if(B.push($.name()),$.alias())B.push($.alias())}),F=D3(D,B)}let E=`error: unknown command '${D}'${F}`;this.error(E,{code:"commander.unknownCommand"})}version(D,F,E){if(D===void 0)return this._version;this._version=D,F=F||"-V, --version",E=E||"output the version number";let B=this.createOption(F,E);return this._versionOptionName=B.attributeName(),this._registerOption(B),this.on("option:"+B.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 E=this.parent?._findCommand(D);if(E){let B=[E.name()].concat(E.aliases()).join("|");throw Error(`cannot add alias '${D}' to command '${this.name()}' as already have command '${B}'`)}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((E)=>{return M6(E)});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=GD.basename(D,GD.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},E;if(F.error)E=(B)=>this._outputConfiguration.writeErr(B);else E=(B)=>this._outputConfiguration.writeOut(B);return F.write=D.write||E,F.command=this,F}outputHelp(D){let F;if(typeof D==="function")F=D,D=void 0;let E=this._getHelpContext(D);this._getCommandAndAncestors().reverse().forEach(($)=>$.emit("beforeAllHelp",E)),this.emit("beforeHelp",E);let B=this.helpInformation(E);if(F){if(B=F(B),typeof B!=="string"&&!Buffer.isBuffer(B))throw Error("outputHelp callback must return a string or a Buffer")}if(E.write(B),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",E),this._getCommandAndAncestors().forEach(($)=>$.emit("afterAllHelp",E))}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 E=["beforeAll","before","after","afterAll"];if(!E.includes(D))throw Error(`Unexpected value for position to addHelpText.
21
+ `),this.outputHelp({error:!0});let E=F||{},B=E.exitCode||1,$=E.code||"commander.error";this._exit(B,$,D)}_parseOptionsEnv(){this.options.forEach((D)=>{if(D.envVar&&D.envVar in v.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()}`,v.env[D.envVar]);else this.emit(`optionEnv:${D.name()}`)}})}_parseOptionsImplied(){let D=new FF(this.options),F=(E)=>{return this.getOptionValue(E)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(E))};this.options.filter((E)=>E.implied!==void 0&&F(E.attributeName())&&D.valueFromOption(this.getOptionValue(E.attributeName()),E)).forEach((E)=>{Object.keys(E.implied).filter((B)=>!F(B)).forEach((B)=>{this.setOptionValueWithSource(B,E.implied[B],"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 E=(q)=>{let C=q.attributeName(),X=this.getOptionValue(C),Q=this.options.find((_)=>_.negate&&C===_.attributeName()),J=this.options.find((_)=>!_.negate&&C===_.attributeName());if(Q&&(Q.presetArg===void 0&&X===!1||Q.presetArg!==void 0&&X===Q.presetArg))return Q;return J||q},B=(q)=>{let C=E(q),X=C.attributeName();if(this.getOptionValueSource(X)==="env")return`environment variable '${C.envVar}'`;return`option '${C.flags}'`},$=`error: ${B(D)} cannot be used with ${B(F)}`;this.error($,{code:"commander.conflictingOption"})}unknownOption(D){if(this._allowUnknownOption)return;let F="";if(D.startsWith("--")&&this._showSuggestionAfterError){let B=[],$=this;do{let q=$.createHelp().visibleOptions($).filter((C)=>C.long).map((C)=>C.long);B=B.concat(q),$=$.parent}while($&&!$._enablePositionalOptions);F=x0(D,B)}let E=`error: unknown option '${D}'${F}`;this.error(E,{code:"commander.unknownOption"})}_excessArguments(D){if(this._allowExcessArguments)return;let F=this.registeredArguments.length,E=F===1?"":"s",$=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${F} argument${E} but got ${D.length}.`;this.error($,{code:"commander.excessArguments"})}unknownCommand(){let D=this.args[0],F="";if(this._showSuggestionAfterError){let B=[];this.createHelp().visibleCommands(this).forEach(($)=>{if(B.push($.name()),$.alias())B.push($.alias())}),F=x0(D,B)}let E=`error: unknown command '${D}'${F}`;this.error(E,{code:"commander.unknownCommand"})}version(D,F,E){if(D===void 0)return this._version;this._version=D,F=F||"-V, --version",E=E||"output the version number";let B=this.createOption(F,E);return this._versionOptionName=B.attributeName(),this._registerOption(B),this.on("option:"+B.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 E=this.parent?._findCommand(D);if(E){let B=[E.name()].concat(E.aliases()).join("|");throw Error(`cannot add alias '${D}' to command '${this.name()}' as already have command '${B}'`)}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((E)=>{return e8(E)});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=$D.basename(D,$D.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},E;if(F.error)E=(B)=>this._outputConfiguration.writeErr(B);else E=(B)=>this._outputConfiguration.writeOut(B);return F.write=D.write||E,F.command=this,F}outputHelp(D){let F;if(typeof D==="function")F=D,D=void 0;let E=this._getHelpContext(D);this._getCommandAndAncestors().reverse().forEach(($)=>$.emit("beforeAllHelp",E)),this.emit("beforeHelp",E);let B=this.helpInformation(E);if(F){if(B=F(B),typeof B!=="string"&&!Buffer.isBuffer(B))throw Error("outputHelp callback must return a string or a Buffer")}if(E.write(B),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",E),this._getCommandAndAncestors().forEach(($)=>$.emit("afterAllHelp",E))}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=v.exitCode||0;if(F===0&&D&&typeof D!=="function"&&D.error)F=1;this._exit(F,"commander.help","(outputHelp)")}addHelpText(D,F){let E=["beforeAll","before","after","afterAll"];if(!E.includes(D))throw Error(`Unexpected value for position to addHelpText.
23
23
  Expecting one of '${E.join("', '")}'`);let B=`${D}Help`;return this.on(B,($)=>{let q;if(typeof F==="function")q=F({error:$.error,command:$.command});else q=F;if(q)$.write(`${q}
24
- `)}),this}_outputHelpIfRequested(D){let F=this._getHelpOption();if(F&&D.find((B)=>F.is(B)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function F3(D){return D.map((F)=>{if(!F.startsWith("--inspect"))return F;let E,B="127.0.0.1",$="9229",q;if((q=F.match(/^(--inspect(-brk)?)$/))!==null)E=q[1];else if((q=F.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(E=q[1],/^\d+$/.test(q[3]))$=q[3];else B=q[3];else if((q=F.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)E=q[1],B=q[3],$=q[4];if(E&&$!=="0")return`${E}=${B}:${parseInt($)+1}`;return F})}j6.Command=t2});var X3=h((u6)=>{var{Argument:B3}=S2(),{Command:e2}=E3(),{CommanderError:U6,InvalidArgumentError:$3}=Q2(),{Help:V6}=i2(),{Option:q3}=r2();u6.program=new e2;u6.createCommand=(D)=>new e2(D);u6.createOption=(D,F)=>new q3(D,F);u6.createArgument=(D,F)=>new B3(D,F);u6.Command=e2;u6.Option=q3;u6.Argument=B3;u6.Help=V6;u6.CommanderError=U6;u6.InvalidArgumentError=$3;u6.InvalidOptionArgumentError=$3});var W2=h((l5,G3)=>{var y6=VD("tty"),h6=y6?.WriteStream?.prototype?.hasColors?.()??!1,N=(D,F)=>{if(!h6)return($)=>$;let E=`\x1B[${D}m`,B=`\x1B[${F}m`;return($)=>{let q=$+"",X=q.indexOf(B);if(X===-1)return E+q+B;let J=E,Q=0,W=(F===22?B:"")+E;while(X!==-1)J+=q.slice(Q,X)+W,Q=X+B.length,X=q.indexOf(B,Q);return J+=q.slice(Q)+B,J}},K={};K.reset=N(0,0);K.bold=N(1,22);K.dim=N(2,22);K.italic=N(3,23);K.underline=N(4,24);K.overline=N(53,55);K.inverse=N(7,27);K.hidden=N(8,28);K.strikethrough=N(9,29);K.black=N(30,39);K.red=N(31,39);K.green=N(32,39);K.yellow=N(33,39);K.blue=N(34,39);K.magenta=N(35,39);K.cyan=N(36,39);K.white=N(37,39);K.gray=N(90,39);K.bgBlack=N(40,49);K.bgRed=N(41,49);K.bgGreen=N(42,49);K.bgYellow=N(43,49);K.bgBlue=N(44,49);K.bgMagenta=N(45,49);K.bgCyan=N(46,49);K.bgWhite=N(47,49);K.bgGray=N(100,49);K.redBright=N(91,39);K.greenBright=N(92,39);K.yellowBright=N(93,39);K.blueBright=N(94,39);K.magentaBright=N(95,39);K.cyanBright=N(96,39);K.whiteBright=N(97,39);K.bgRedBright=N(101,49);K.bgGreenBright=N(102,49);K.bgYellowBright=N(103,49);K.bgBlueBright=N(104,49);K.bgMagentaBright=N(105,49);K.bgCyanBright=N(106,49);K.bgWhiteBright=N(107,49);G3.exports=K});var U3=h((Q7,z3)=>{z3.exports=i6;function n6(D){let F={defaultWidth:0,output:process.stdout,tty:VD("tty")};if(!D)return F;return Object.keys(F).forEach(function(E){if(!D[E])D[E]=F[E]}),D}function i6(D){let F=n6(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 E=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(E)&&E!==0)return E}return F.defaultWidth}});var u3=h((Y7,V3)=>{V3.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 Q0=h((W7,K3)=>{var r6=u3();K3.exports=(D)=>typeof D==="string"?D.replace(r6(),""):D});var N3=h((H7,Y0)=>{var L3=(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};Y0.exports=L3;Y0.exports.default=L3});var w3=h((_7,O3)=>{O3.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 I3=h((G7,W0)=>{var a6=Q0(),o6=N3(),s6=w3(),S3=(D)=>{if(typeof D!=="string"||D.length===0)return 0;if(D=a6(D),D.length===0)return 0;D=D.replace(s6()," ");let F=0;for(let E=0;E<D.length;E++){let B=D.codePointAt(E);if(B<=31||B>=127&&B<=159)continue;if(B>=768&&B<=879)continue;if(B>65535)E++;F+=o6(B)?2:1}return F};W0.exports=S3;W0.exports.default=S3});var T3=h((C7,P3)=>{P3.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 H0=h((M7,k3)=>{var _2=T3(),b3={};for(let D of Object.keys(_2))b3[_2[D]]=D;var R={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"]}};k3.exports=R;for(let D of Object.keys(R)){if(!("channels"in R[D]))throw Error("missing channels property: "+D);if(!("labels"in R[D]))throw Error("missing channel labels property: "+D);if(R[D].labels.length!==R[D].channels)throw Error("channel and label counts mismatch: "+D);let{channels:F,labels:E}=R[D];delete R[D].channels,delete R[D].labels,Object.defineProperty(R[D],"channels",{value:F}),Object.defineProperty(R[D],"labels",{value:E})}R.rgb.hsl=function(D){let F=D[0]/255,E=D[1]/255,B=D[2]/255,$=Math.min(F,E,B),q=Math.max(F,E,B),X=q-$,J,Q;if(q===$)J=0;else if(F===q)J=(E-B)/X;else if(E===q)J=2+(B-F)/X;else if(B===q)J=4+(F-E)/X;if(J=Math.min(J*60,360),J<0)J+=360;let Y=($+q)/2;if(q===$)Q=0;else if(Y<=0.5)Q=X/(q+$);else Q=X/(2-q-$);return[J,Q*100,Y*100]};R.rgb.hsv=function(D){let F,E,B,$,q,X=D[0]/255,J=D[1]/255,Q=D[2]/255,Y=Math.max(X,J,Q),W=Y-Math.min(X,J,Q),C=function(U){return(Y-U)/6/W+0.5};if(W===0)$=0,q=0;else{if(q=W/Y,F=C(X),E=C(J),B=C(Q),X===Y)$=B-E;else if(J===Y)$=0.3333333333333333+F-B;else if(Q===Y)$=0.6666666666666666+E-F;if($<0)$+=1;else if($>1)$-=1}return[$*360,q*100,Y*100]};R.rgb.hwb=function(D){let F=D[0],E=D[1],B=D[2],$=R.rgb.hsl(D)[0],q=0.00392156862745098*Math.min(F,Math.min(E,B));return B=1-0.00392156862745098*Math.max(F,Math.max(E,B)),[$,q*100,B*100]};R.rgb.cmyk=function(D){let F=D[0]/255,E=D[1]/255,B=D[2]/255,$=Math.min(1-F,1-E,1-B),q=(1-F-$)/(1-$)||0,X=(1-E-$)/(1-$)||0,J=(1-B-$)/(1-$)||0;return[q*100,X*100,J*100,$*100]};function t6(D,F){return(D[0]-F[0])**2+(D[1]-F[1])**2+(D[2]-F[2])**2}R.rgb.keyword=function(D){let F=b3[D];if(F)return F;let E=1/0,B;for(let $ of Object.keys(_2)){let q=_2[$],X=t6(D,q);if(X<E)E=X,B=$}return B};R.keyword.rgb=function(D){return _2[D]};R.rgb.xyz=function(D){let F=D[0]/255,E=D[1]/255,B=D[2]/255;F=F>0.04045?((F+0.055)/1.055)**2.4:F/12.92,E=E>0.04045?((E+0.055)/1.055)**2.4:E/12.92,B=B>0.04045?((B+0.055)/1.055)**2.4:B/12.92;let $=F*0.4124+E*0.3576+B*0.1805,q=F*0.2126+E*0.7152+B*0.0722,X=F*0.0193+E*0.1192+B*0.9505;return[$*100,q*100,X*100]};R.rgb.lab=function(D){let F=R.rgb.xyz(D),E=F[0],B=F[1],$=F[2];E/=95.047,B/=100,$/=108.883,E=E>0.008856?E**0.3333333333333333:7.787*E+0.13793103448275862,B=B>0.008856?B**0.3333333333333333:7.787*B+0.13793103448275862,$=$>0.008856?$**0.3333333333333333:7.787*$+0.13793103448275862;let q=116*B-16,X=500*(E-B),J=200*(B-$);return[q,X,J]};R.hsl.rgb=function(D){let F=D[0]/360,E=D[1]/100,B=D[2]/100,$,q,X;if(E===0)return X=B*255,[X,X,X];if(B<0.5)$=B*(1+E);else $=B+E-B*E;let J=2*B-$,Q=[0,0,0];for(let Y=0;Y<3;Y++){if(q=F+0.3333333333333333*-(Y-1),q<0)q++;if(q>1)q--;if(6*q<1)X=J+($-J)*6*q;else if(2*q<1)X=$;else if(3*q<2)X=J+($-J)*(0.6666666666666666-q)*6;else X=J;Q[Y]=X*255}return Q};R.hsl.hsv=function(D){let F=D[0],E=D[1]/100,B=D[2]/100,$=E,q=Math.max(B,0.01);B*=2,E*=B<=1?B:2-B,$*=q<=1?q:2-q;let X=(B+E)/2,J=B===0?2*$/(q+$):2*E/(B+E);return[F,J*100,X*100]};R.hsv.rgb=function(D){let F=D[0]/60,E=D[1]/100,B=D[2]/100,$=Math.floor(F)%6,q=F-Math.floor(F),X=255*B*(1-E),J=255*B*(1-E*q),Q=255*B*(1-E*(1-q));switch(B*=255,$){case 0:return[B,Q,X];case 1:return[J,B,X];case 2:return[X,B,Q];case 3:return[X,J,B];case 4:return[Q,X,B];case 5:return[B,X,J]}};R.hsv.hsl=function(D){let F=D[0],E=D[1]/100,B=D[2]/100,$=Math.max(B,0.01),q,X;X=(2-E)*B;let J=(2-E)*$;return q=E*$,q/=J<=1?J:2-J,q=q||0,X/=2,[F,q*100,X*100]};R.hwb.rgb=function(D){let F=D[0]/360,E=D[1]/100,B=D[2]/100,$=E+B,q;if($>1)E/=$,B/=$;let X=Math.floor(6*F),J=1-B;if(q=6*F-X,(X&1)!==0)q=1-q;let Q=E+q*(J-E),Y,W,C;switch(X){default:case 6:case 0:Y=J,W=Q,C=E;break;case 1:Y=Q,W=J,C=E;break;case 2:Y=E,W=J,C=Q;break;case 3:Y=E,W=Q,C=J;break;case 4:Y=Q,W=E,C=J;break;case 5:Y=J,W=E,C=Q;break}return[Y*255,W*255,C*255]};R.cmyk.rgb=function(D){let F=D[0]/100,E=D[1]/100,B=D[2]/100,$=D[3]/100,q=1-Math.min(1,F*(1-$)+$),X=1-Math.min(1,E*(1-$)+$),J=1-Math.min(1,B*(1-$)+$);return[q*255,X*255,J*255]};R.xyz.rgb=function(D){let F=D[0]/100,E=D[1]/100,B=D[2]/100,$,q,X;return $=F*3.2406+E*-1.5372+B*-0.4986,q=F*-0.9689+E*1.8758+B*0.0415,X=F*0.0557+E*-0.204+B*1.057,$=$>0.0031308?1.055*$**0.4166666666666667-0.055:$*12.92,q=q>0.0031308?1.055*q**0.4166666666666667-0.055:q*12.92,X=X>0.0031308?1.055*X**0.4166666666666667-0.055:X*12.92,$=Math.min(Math.max(0,$),1),q=Math.min(Math.max(0,q),1),X=Math.min(Math.max(0,X),1),[$*255,q*255,X*255]};R.xyz.lab=function(D){let F=D[0],E=D[1],B=D[2];F/=95.047,E/=100,B/=108.883,F=F>0.008856?F**0.3333333333333333:7.787*F+0.13793103448275862,E=E>0.008856?E**0.3333333333333333:7.787*E+0.13793103448275862,B=B>0.008856?B**0.3333333333333333:7.787*B+0.13793103448275862;let $=116*E-16,q=500*(F-E),X=200*(E-B);return[$,q,X]};R.lab.xyz=function(D){let F=D[0],E=D[1],B=D[2],$,q,X;q=(F+16)/116,$=E/500+q,X=q-B/200;let J=q**3,Q=$**3,Y=X**3;return q=J>0.008856?J:(q-0.13793103448275862)/7.787,$=Q>0.008856?Q:($-0.13793103448275862)/7.787,X=Y>0.008856?Y:(X-0.13793103448275862)/7.787,$*=95.047,q*=100,X*=108.883,[$,q,X]};R.lab.lch=function(D){let F=D[0],E=D[1],B=D[2],$;if($=Math.atan2(B,E)*360/2/Math.PI,$<0)$+=360;let X=Math.sqrt(E*E+B*B);return[F,X,$]};R.lch.lab=function(D){let F=D[0],E=D[1],$=D[2]/360*2*Math.PI,q=E*Math.cos($),X=E*Math.sin($);return[F,q,X]};R.rgb.ansi16=function(D,F=null){let[E,B,$]=D,q=F===null?R.rgb.hsv(D)[2]:F;if(q=Math.round(q/50),q===0)return 30;let X=30+(Math.round($/255)<<2|Math.round(B/255)<<1|Math.round(E/255));if(q===2)X+=60;return X};R.hsv.ansi16=function(D){return R.rgb.ansi16(R.hsv.rgb(D),D[2])};R.rgb.ansi256=function(D){let F=D[0],E=D[1],B=D[2];if(F===E&&E===B){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(E/255*5)+Math.round(B/255*5)};R.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 E=(~~(D>50)+1)*0.5,B=(F&1)*E*255,$=(F>>1&1)*E*255,q=(F>>2&1)*E*255;return[B,$,q]};R.ansi256.rgb=function(D){if(D>=232){let q=(D-232)*10+8;return[q,q,q]}D-=16;let F,E=Math.floor(D/36)/5*255,B=Math.floor((F=D%36)/6)/5*255,$=F%6/5*255;return[E,B,$]};R.rgb.hex=function(D){let E=(((Math.round(D[0])&255)<<16)+((Math.round(D[1])&255)<<8)+(Math.round(D[2])&255)).toString(16).toUpperCase();return"000000".substring(E.length)+E};R.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 E=F[0];if(F[0].length===3)E=E.split("").map((J)=>{return J+J}).join("");let B=parseInt(E,16),$=B>>16&255,q=B>>8&255,X=B&255;return[$,q,X]};R.rgb.hcg=function(D){let F=D[0]/255,E=D[1]/255,B=D[2]/255,$=Math.max(Math.max(F,E),B),q=Math.min(Math.min(F,E),B),X=$-q,J,Q;if(X<1)J=q/(1-X);else J=0;if(X<=0)Q=0;else if($===F)Q=(E-B)/X%6;else if($===E)Q=2+(B-F)/X;else Q=4+(F-E)/X;return Q/=6,Q%=1,[Q*360,X*100,J*100]};R.hsl.hcg=function(D){let F=D[1]/100,E=D[2]/100,B=E<0.5?2*F*E:2*F*(1-E),$=0;if(B<1)$=(E-0.5*B)/(1-B);return[D[0],B*100,$*100]};R.hsv.hcg=function(D){let F=D[1]/100,E=D[2]/100,B=F*E,$=0;if(B<1)$=(E-B)/(1-B);return[D[0],B*100,$*100]};R.hcg.rgb=function(D){let F=D[0]/360,E=D[1]/100,B=D[2]/100;if(E===0)return[B*255,B*255,B*255];let $=[0,0,0],q=F%1*6,X=q%1,J=1-X,Q=0;switch(Math.floor(q)){case 0:$[0]=1,$[1]=X,$[2]=0;break;case 1:$[0]=J,$[1]=1,$[2]=0;break;case 2:$[0]=0,$[1]=1,$[2]=X;break;case 3:$[0]=0,$[1]=J,$[2]=1;break;case 4:$[0]=X,$[1]=0,$[2]=1;break;default:$[0]=1,$[1]=0,$[2]=J}return Q=(1-E)*B,[(E*$[0]+Q)*255,(E*$[1]+Q)*255,(E*$[2]+Q)*255]};R.hcg.hsv=function(D){let F=D[1]/100,E=D[2]/100,B=F+E*(1-F),$=0;if(B>0)$=F/B;return[D[0],$*100,B*100]};R.hcg.hsl=function(D){let F=D[1]/100,B=D[2]/100*(1-F)+0.5*F,$=0;if(B>0&&B<0.5)$=F/(2*B);else if(B>=0.5&&B<1)$=F/(2*(1-B));return[D[0],$*100,B*100]};R.hcg.hwb=function(D){let F=D[1]/100,E=D[2]/100,B=F+E*(1-F);return[D[0],(B-F)*100,(1-B)*100]};R.hwb.hcg=function(D){let F=D[1]/100,B=1-D[2]/100,$=B-F,q=0;if($<1)q=(B-$)/(1-$);return[D[0],$*100,q*100]};R.apple.rgb=function(D){return[D[0]/65535*255,D[1]/65535*255,D[2]/65535*255]};R.rgb.apple=function(D){return[D[0]/255*65535,D[1]/255*65535,D[2]/255*65535]};R.gray.rgb=function(D){return[D[0]/100*255,D[0]/100*255,D[0]/100*255]};R.gray.hsl=function(D){return[0,0,D[0]]};R.gray.hsv=R.gray.hsl;R.gray.hwb=function(D){return[0,100,D[0]]};R.gray.cmyk=function(D){return[0,0,0,D[0]]};R.gray.lab=function(D){return[D[0],0,0]};R.gray.hex=function(D){let F=Math.round(D[0]/100*255)&255,B=((F<<16)+(F<<8)+F).toString(16).toUpperCase();return"000000".substring(B.length)+B};R.rgb.gray=function(D){return[(D[0]+D[1]+D[2])/3/255*100]}});var v3=h((R7,f3)=>{var T2=H0();function e6(){let D={},F=Object.keys(T2);for(let E=F.length,B=0;B<E;B++)D[F[B]]={distance:-1,parent:null};return D}function D1(D){let F=e6(),E=[D];F[D].distance=0;while(E.length){let B=E.pop(),$=Object.keys(T2[B]);for(let q=$.length,X=0;X<q;X++){let J=$[X],Q=F[J];if(Q.distance===-1)Q.distance=F[B].distance+1,Q.parent=B,E.unshift(J)}}return F}function F1(D,F){return function(E){return F(D(E))}}function E1(D,F){let E=[F[D].parent,D],B=T2[F[D].parent][D],$=F[D].parent;while(F[$].parent)E.unshift(F[$].parent),B=F1(T2[F[$].parent][$],B),$=F[$].parent;return B.conversion=E,B}f3.exports=function(D){let F=D1(D),E={},B=Object.keys(F);for(let $=B.length,q=0;q<$;q++){let X=B[q];if(F[X].parent===null)continue;E[X]=E1(X,F)}return E}});var x3=h((A7,Z3)=>{var _0=H0(),B1=v3(),pD={},$1=Object.keys(_0);function q1(D){let F=function(...E){let B=E[0];if(B===void 0||B===null)return B;if(B.length>1)E=B;return D(E)};if("conversion"in D)F.conversion=D.conversion;return F}function X1(D){let F=function(...E){let B=E[0];if(B===void 0||B===null)return B;if(B.length>1)E=B;let $=D(E);if(typeof $==="object")for(let q=$.length,X=0;X<q;X++)$[X]=Math.round($[X]);return $};if("conversion"in D)F.conversion=D.conversion;return F}$1.forEach((D)=>{pD[D]={},Object.defineProperty(pD[D],"channels",{value:_0[D].channels}),Object.defineProperty(pD[D],"labels",{value:_0[D].labels});let F=B1(D);Object.keys(F).forEach((B)=>{let $=F[B];pD[D][B]=X1($),pD[D][B].raw=q1($)})});Z3.exports=pD});var p3=h((j7,l3)=>{var y3=(D,F)=>(...E)=>{return`\x1B[${D(...E)+F}m`},h3=(D,F)=>(...E)=>{let B=D(...E);return`\x1B[${38+F};5;${B}m`},g3=(D,F)=>(...E)=>{let B=D(...E);return`\x1B[${38+F};2;${B[0]};${B[1]};${B[2]}m`},b2=(D)=>D,m3=(D,F,E)=>[D,F,E],dD=(D,F,E)=>{Object.defineProperty(D,F,{get:()=>{let B=E();return Object.defineProperty(D,F,{value:B,enumerable:!0,configurable:!0}),B},enumerable:!0,configurable:!0})},G0,cD=(D,F,E,B)=>{if(G0===void 0)G0=x3();let $=B?10:0,q={};for(let[X,J]of Object.entries(G0)){let Q=X==="ansi16"?"ansi":X;if(X===F)q[Q]=D(E,$);else if(typeof J==="object")q[Q]=D(J[F],$)}return q};function J1(){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[E,B]of Object.entries(F)){for(let[$,q]of Object.entries(B))F[$]={open:`\x1B[${q[0]}m`,close:`\x1B[${q[1]}m`},B[$]=F[$],D.set(q[0],q[1]);Object.defineProperty(F,E,{value:B,enumerable:!1})}return Object.defineProperty(F,"codes",{value:D,enumerable:!1}),F.color.close="\x1B[39m",F.bgColor.close="\x1B[49m",dD(F.color,"ansi",()=>cD(y3,"ansi16",b2,!1)),dD(F.color,"ansi256",()=>cD(h3,"ansi256",b2,!1)),dD(F.color,"ansi16m",()=>cD(g3,"rgb",m3,!1)),dD(F.bgColor,"ansi",()=>cD(y3,"ansi16",b2,!0)),dD(F.bgColor,"ansi256",()=>cD(h3,"ansi256",b2,!0)),dD(F.bgColor,"ansi16m",()=>cD(g3,"rgb",m3,!0)),F}Object.defineProperty(l3,"exports",{enumerable:!0,get:J1})});var n3=h((z7,c3)=>{var G2=I3(),Q1=Q0(),Y1=p3(),M0=new Set(["\x1B","\x9B"]),d3=(D)=>`${M0.values().next().value}[${D}m`,W1=(D)=>D.split(" ").map((F)=>G2(F)),C0=(D,F,E)=>{let B=[...F],$=!1,q=G2(Q1(D[D.length-1]));for(let[X,J]of B.entries()){let Q=G2(J);if(q+Q<=E)D[D.length-1]+=J;else D.push(J),q=0;if(M0.has(J))$=!0;else if($&&J==="m"){$=!1;continue}if($)continue;if(q+=Q,q===E&&X<B.length-1)D.push(""),q=0}if(!q&&D[D.length-1].length>0&&D.length>1)D[D.length-2]+=D.pop()},H1=(D)=>{let F=D.split(" "),E=F.length;while(E>0){if(G2(F[E-1])>0)break;E--}if(E===F.length)return D;return F.slice(0,E).join(" ")+F.slice(E).join("")},_1=(D,F,E={})=>{if(E.trim!==!1&&D.trim()==="")return"";let B="",$="",q,X=W1(D),J=[""];for(let[Q,Y]of D.split(" ").entries()){if(E.trim!==!1)J[J.length-1]=J[J.length-1].trimLeft();let W=G2(J[J.length-1]);if(Q!==0){if(W>=F&&(E.wordWrap===!1||E.trim===!1))J.push(""),W=0;if(W>0||E.trim===!1)J[J.length-1]+=" ",W++}if(E.hard&&X[Q]>F){let C=F-W,U=1+Math.floor((X[Q]-C-1)/F);if(Math.floor((X[Q]-1)/F)<U)J.push("");C0(J,Y,F);continue}if(W+X[Q]>F&&W>0&&X[Q]>0){if(E.wordWrap===!1&&W<F){C0(J,Y,F);continue}J.push("")}if(W+X[Q]>F&&E.wordWrap===!1){C0(J,Y,F);continue}J[J.length-1]+=Y}if(E.trim!==!1)J=J.map(H1);B=J.join(`
25
- `);for(let[Q,Y]of[...B].entries()){if($+=Y,M0.has(Y)){let C=parseFloat(/\d[^m]*/.exec(B.slice(Q,Q+4)));q=C===39?null:C}let W=Y1.codes.get(Number(q));if(q&&W){if(B[Q+1]===`
26
- `)$+=d3(W);else if(Y===`
27
- `)$+=d3(q)}}return $};c3.exports=(D,F,E)=>{return String(D).normalize().replace(/\r\n/g,`
24
+ `)}),this}_outputHelpIfRequested(D){let F=this._getHelpOption();if(F&&D.find((B)=>F.is(B)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function y0(D){return D.map((F)=>{if(!F.startsWith("--inspect"))return F;let E,B="127.0.0.1",$="9229",q;if((q=F.match(/^(--inspect(-brk)?)$/))!==null)E=q[1];else if((q=F.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(E=q[1],/^\d+$/.test(q[3]))$=q[3];else B=q[3];else if((q=F.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)E=q[1],B=q[3],$=q[4];if(E&&$!=="0")return`${E}=${B}:${parseInt($)+1}`;return F})}EF.Command=m2});var p0=Z((CF)=>{var{Argument:g0}=G2(),{Command:l2}=h0(),{CommanderError:$F,InvalidArgumentError:m0}=eD(),{Help:qF}=Z2(),{Option:l0}=x2();CF.program=new l2;CF.createCommand=(D)=>new l2(D);CF.createOption=(D,F)=>new l0(D,F);CF.createArgument=(D,F)=>new g0(D,F);CF.Command=l2;CF.Option=l0;CF.Argument=g0;CF.Help=qF;CF.CommanderError=$F;CF.InvalidArgumentError=m0;CF.InvalidOptionArgumentError=m0});var A2=Z((X5,o0)=>{var LF=GD("tty"),VF=LF?.WriteStream?.prototype?.hasColors?.()??!1,N=(D,F)=>{if(!VF)return($)=>$;let E=`\x1B[${D}m`,B=`\x1B[${F}m`;return($)=>{let q=$+"",C=q.indexOf(B);if(C===-1)return E+q+B;let X=E,Q=0,_=(F===22?B:"")+E;while(C!==-1)X+=q.slice(Q,C)+_,Q=C+B.length,C=q.indexOf(B,Q);return X+=q.slice(Q)+B,X}},L={};L.reset=N(0,0);L.bold=N(1,22);L.dim=N(2,22);L.italic=N(3,23);L.underline=N(4,24);L.overline=N(53,55);L.inverse=N(7,27);L.hidden=N(8,28);L.strikethrough=N(9,29);L.black=N(30,39);L.red=N(31,39);L.green=N(32,39);L.yellow=N(33,39);L.blue=N(34,39);L.magenta=N(35,39);L.cyan=N(36,39);L.white=N(37,39);L.gray=N(90,39);L.bgBlack=N(40,49);L.bgRed=N(41,49);L.bgGreen=N(42,49);L.bgYellow=N(43,49);L.bgBlue=N(44,49);L.bgMagenta=N(45,49);L.bgCyan=N(46,49);L.bgWhite=N(47,49);L.bgGray=N(100,49);L.redBright=N(91,39);L.greenBright=N(92,39);L.yellowBright=N(93,39);L.blueBright=N(94,39);L.magentaBright=N(95,39);L.cyanBright=N(96,39);L.whiteBright=N(97,39);L.bgRedBright=N(101,49);L.bgGreenBright=N(102,49);L.bgYellowBright=N(103,49);L.bgBlueBright=N(104,49);L.bgMagentaBright=N(105,49);L.bgCyanBright=N(106,49);L.bgWhiteBright=N(107,49);o0.exports=L});var B3=Z((S5,E3)=>{E3.exports=kF;function bF(D){let F={defaultWidth:0,output:process.stdout,tty:GD("tty")};if(!D)return F;return Object.keys(F).forEach(function(E){if(!D[E])D[E]=F[E]}),D}function kF(D){let F=bF(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 E=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(E)&&E!==0)return E}return F.defaultWidth}});var q3=Z((w5,$3)=>{$3.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 s2=Z((I5,C3)=>{var PF=q3();C3.exports=(D)=>typeof D==="string"?D.replace(PF(),""):D});var Q3=Z((b5,t2)=>{var X3=(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};t2.exports=X3;t2.exports.default=X3});var _3=Z((k5,J3)=>{J3.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 W3=Z((P5,e2)=>{var TF=s2(),fF=Q3(),vF=_3(),Y3=(D)=>{if(typeof D!=="string"||D.length===0)return 0;if(D=TF(D),D.length===0)return 0;D=D.replace(vF()," ");let F=0;for(let E=0;E<D.length;E++){let B=D.codePointAt(E);if(B<=31||B>=127&&B<=159)continue;if(B>=768&&B<=879)continue;if(B>65535)E++;F+=fF(B)?2:1}return F};e2.exports=Y3;e2.exports.default=Y3});var H3=Z((T5,G3)=>{G3.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 D0=Z((f5,A3)=>{var F2=H3(),u3={};for(let D of Object.keys(F2))u3[F2[D]]=D;var u={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};A3.exports=u;for(let D of Object.keys(u)){if(!("channels"in u[D]))throw Error("missing channels property: "+D);if(!("labels"in u[D]))throw Error("missing channel labels property: "+D);if(u[D].labels.length!==u[D].channels)throw Error("channel and label counts mismatch: "+D);let{channels:F,labels:E}=u[D];delete u[D].channels,delete u[D].labels,Object.defineProperty(u[D],"channels",{value:F}),Object.defineProperty(u[D],"labels",{value:E})}u.rgb.hsl=function(D){let F=D[0]/255,E=D[1]/255,B=D[2]/255,$=Math.min(F,E,B),q=Math.max(F,E,B),C=q-$,X,Q;if(q===$)X=0;else if(F===q)X=(E-B)/C;else if(E===q)X=2+(B-F)/C;else if(B===q)X=4+(F-E)/C;if(X=Math.min(X*60,360),X<0)X+=360;let J=($+q)/2;if(q===$)Q=0;else if(J<=0.5)Q=C/(q+$);else Q=C/(2-q-$);return[X,Q*100,J*100]};u.rgb.hsv=function(D){let F,E,B,$,q,C=D[0]/255,X=D[1]/255,Q=D[2]/255,J=Math.max(C,X,Q),_=J-Math.min(C,X,Q),H=function(j){return(J-j)/6/_+0.5};if(_===0)$=0,q=0;else{if(q=_/J,F=H(C),E=H(X),B=H(Q),C===J)$=B-E;else if(X===J)$=0.3333333333333333+F-B;else if(Q===J)$=0.6666666666666666+E-F;if($<0)$+=1;else if($>1)$-=1}return[$*360,q*100,J*100]};u.rgb.hwb=function(D){let F=D[0],E=D[1],B=D[2],$=u.rgb.hsl(D)[0],q=0.00392156862745098*Math.min(F,Math.min(E,B));return B=1-0.00392156862745098*Math.max(F,Math.max(E,B)),[$,q*100,B*100]};u.rgb.cmyk=function(D){let F=D[0]/255,E=D[1]/255,B=D[2]/255,$=Math.min(1-F,1-E,1-B),q=(1-F-$)/(1-$)||0,C=(1-E-$)/(1-$)||0,X=(1-B-$)/(1-$)||0;return[q*100,C*100,X*100,$*100]};function ZF(D,F){return(D[0]-F[0])**2+(D[1]-F[1])**2+(D[2]-F[2])**2}u.rgb.keyword=function(D){let F=u3[D];if(F)return F;let E=1/0,B;for(let $ of Object.keys(F2)){let q=F2[$],C=ZF(D,q);if(C<E)E=C,B=$}return B};u.keyword.rgb=function(D){return F2[D]};u.rgb.xyz=function(D){let F=D[0]/255,E=D[1]/255,B=D[2]/255;F=F>0.04045?((F+0.055)/1.055)**2.4:F/12.92,E=E>0.04045?((E+0.055)/1.055)**2.4:E/12.92,B=B>0.04045?((B+0.055)/1.055)**2.4:B/12.92;let $=F*0.4124+E*0.3576+B*0.1805,q=F*0.2126+E*0.7152+B*0.0722,C=F*0.0193+E*0.1192+B*0.9505;return[$*100,q*100,C*100]};u.rgb.lab=function(D){let F=u.rgb.xyz(D),E=F[0],B=F[1],$=F[2];E/=95.047,B/=100,$/=108.883,E=E>0.008856?E**0.3333333333333333:7.787*E+0.13793103448275862,B=B>0.008856?B**0.3333333333333333:7.787*B+0.13793103448275862,$=$>0.008856?$**0.3333333333333333:7.787*$+0.13793103448275862;let q=116*B-16,C=500*(E-B),X=200*(B-$);return[q,C,X]};u.hsl.rgb=function(D){let F=D[0]/360,E=D[1]/100,B=D[2]/100,$,q,C;if(E===0)return C=B*255,[C,C,C];if(B<0.5)$=B*(1+E);else $=B+E-B*E;let X=2*B-$,Q=[0,0,0];for(let J=0;J<3;J++){if(q=F+0.3333333333333333*-(J-1),q<0)q++;if(q>1)q--;if(6*q<1)C=X+($-X)*6*q;else if(2*q<1)C=$;else if(3*q<2)C=X+($-X)*(0.6666666666666666-q)*6;else C=X;Q[J]=C*255}return Q};u.hsl.hsv=function(D){let F=D[0],E=D[1]/100,B=D[2]/100,$=E,q=Math.max(B,0.01);B*=2,E*=B<=1?B:2-B,$*=q<=1?q:2-q;let C=(B+E)/2,X=B===0?2*$/(q+$):2*E/(B+E);return[F,X*100,C*100]};u.hsv.rgb=function(D){let F=D[0]/60,E=D[1]/100,B=D[2]/100,$=Math.floor(F)%6,q=F-Math.floor(F),C=255*B*(1-E),X=255*B*(1-E*q),Q=255*B*(1-E*(1-q));switch(B*=255,$){case 0:return[B,Q,C];case 1:return[X,B,C];case 2:return[C,B,Q];case 3:return[C,X,B];case 4:return[Q,C,B];case 5:return[B,C,X]}};u.hsv.hsl=function(D){let F=D[0],E=D[1]/100,B=D[2]/100,$=Math.max(B,0.01),q,C;C=(2-E)*B;let X=(2-E)*$;return q=E*$,q/=X<=1?X:2-X,q=q||0,C/=2,[F,q*100,C*100]};u.hwb.rgb=function(D){let F=D[0]/360,E=D[1]/100,B=D[2]/100,$=E+B,q;if($>1)E/=$,B/=$;let C=Math.floor(6*F),X=1-B;if(q=6*F-C,(C&1)!==0)q=1-q;let Q=E+q*(X-E),J,_,H;switch(C){default:case 6:case 0:J=X,_=Q,H=E;break;case 1:J=Q,_=X,H=E;break;case 2:J=E,_=X,H=Q;break;case 3:J=E,_=Q,H=X;break;case 4:J=Q,_=E,H=X;break;case 5:J=X,_=E,H=Q;break}return[J*255,_*255,H*255]};u.cmyk.rgb=function(D){let F=D[0]/100,E=D[1]/100,B=D[2]/100,$=D[3]/100,q=1-Math.min(1,F*(1-$)+$),C=1-Math.min(1,E*(1-$)+$),X=1-Math.min(1,B*(1-$)+$);return[q*255,C*255,X*255]};u.xyz.rgb=function(D){let F=D[0]/100,E=D[1]/100,B=D[2]/100,$,q,C;return $=F*3.2406+E*-1.5372+B*-0.4986,q=F*-0.9689+E*1.8758+B*0.0415,C=F*0.0557+E*-0.204+B*1.057,$=$>0.0031308?1.055*$**0.4166666666666667-0.055:$*12.92,q=q>0.0031308?1.055*q**0.4166666666666667-0.055:q*12.92,C=C>0.0031308?1.055*C**0.4166666666666667-0.055:C*12.92,$=Math.min(Math.max(0,$),1),q=Math.min(Math.max(0,q),1),C=Math.min(Math.max(0,C),1),[$*255,q*255,C*255]};u.xyz.lab=function(D){let F=D[0],E=D[1],B=D[2];F/=95.047,E/=100,B/=108.883,F=F>0.008856?F**0.3333333333333333:7.787*F+0.13793103448275862,E=E>0.008856?E**0.3333333333333333:7.787*E+0.13793103448275862,B=B>0.008856?B**0.3333333333333333:7.787*B+0.13793103448275862;let $=116*E-16,q=500*(F-E),C=200*(E-B);return[$,q,C]};u.lab.xyz=function(D){let F=D[0],E=D[1],B=D[2],$,q,C;q=(F+16)/116,$=E/500+q,C=q-B/200;let X=q**3,Q=$**3,J=C**3;return q=X>0.008856?X:(q-0.13793103448275862)/7.787,$=Q>0.008856?Q:($-0.13793103448275862)/7.787,C=J>0.008856?J:(C-0.13793103448275862)/7.787,$*=95.047,q*=100,C*=108.883,[$,q,C]};u.lab.lch=function(D){let F=D[0],E=D[1],B=D[2],$;if($=Math.atan2(B,E)*360/2/Math.PI,$<0)$+=360;let C=Math.sqrt(E*E+B*B);return[F,C,$]};u.lch.lab=function(D){let F=D[0],E=D[1],$=D[2]/360*2*Math.PI,q=E*Math.cos($),C=E*Math.sin($);return[F,q,C]};u.rgb.ansi16=function(D,F=null){let[E,B,$]=D,q=F===null?u.rgb.hsv(D)[2]:F;if(q=Math.round(q/50),q===0)return 30;let C=30+(Math.round($/255)<<2|Math.round(B/255)<<1|Math.round(E/255));if(q===2)C+=60;return C};u.hsv.ansi16=function(D){return u.rgb.ansi16(u.hsv.rgb(D),D[2])};u.rgb.ansi256=function(D){let F=D[0],E=D[1],B=D[2];if(F===E&&E===B){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(E/255*5)+Math.round(B/255*5)};u.ansi16.rgb=function(D){let F=D%10;if(F===0||F===7){if(D>50)F+=3.5;return F=F/10.5*255,[F,F,F]}let E=(~~(D>50)+1)*0.5,B=(F&1)*E*255,$=(F>>1&1)*E*255,q=(F>>2&1)*E*255;return[B,$,q]};u.ansi256.rgb=function(D){if(D>=232){let q=(D-232)*10+8;return[q,q,q]}D-=16;let F,E=Math.floor(D/36)/5*255,B=Math.floor((F=D%36)/6)/5*255,$=F%6/5*255;return[E,B,$]};u.rgb.hex=function(D){let E=(((Math.round(D[0])&255)<<16)+((Math.round(D[1])&255)<<8)+(Math.round(D[2])&255)).toString(16).toUpperCase();return"000000".substring(E.length)+E};u.hex.rgb=function(D){let F=D.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!F)return[0,0,0];let E=F[0];if(F[0].length===3)E=E.split("").map((X)=>{return X+X}).join("");let B=parseInt(E,16),$=B>>16&255,q=B>>8&255,C=B&255;return[$,q,C]};u.rgb.hcg=function(D){let F=D[0]/255,E=D[1]/255,B=D[2]/255,$=Math.max(Math.max(F,E),B),q=Math.min(Math.min(F,E),B),C=$-q,X,Q;if(C<1)X=q/(1-C);else X=0;if(C<=0)Q=0;else if($===F)Q=(E-B)/C%6;else if($===E)Q=2+(B-F)/C;else Q=4+(F-E)/C;return Q/=6,Q%=1,[Q*360,C*100,X*100]};u.hsl.hcg=function(D){let F=D[1]/100,E=D[2]/100,B=E<0.5?2*F*E:2*F*(1-E),$=0;if(B<1)$=(E-0.5*B)/(1-B);return[D[0],B*100,$*100]};u.hsv.hcg=function(D){let F=D[1]/100,E=D[2]/100,B=F*E,$=0;if(B<1)$=(E-B)/(1-B);return[D[0],B*100,$*100]};u.hcg.rgb=function(D){let F=D[0]/360,E=D[1]/100,B=D[2]/100;if(E===0)return[B*255,B*255,B*255];let $=[0,0,0],q=F%1*6,C=q%1,X=1-C,Q=0;switch(Math.floor(q)){case 0:$[0]=1,$[1]=C,$[2]=0;break;case 1:$[0]=X,$[1]=1,$[2]=0;break;case 2:$[0]=0,$[1]=1,$[2]=C;break;case 3:$[0]=0,$[1]=X,$[2]=1;break;case 4:$[0]=C,$[1]=0,$[2]=1;break;default:$[0]=1,$[1]=0,$[2]=X}return Q=(1-E)*B,[(E*$[0]+Q)*255,(E*$[1]+Q)*255,(E*$[2]+Q)*255]};u.hcg.hsv=function(D){let F=D[1]/100,E=D[2]/100,B=F+E*(1-F),$=0;if(B>0)$=F/B;return[D[0],$*100,B*100]};u.hcg.hsl=function(D){let F=D[1]/100,B=D[2]/100*(1-F)+0.5*F,$=0;if(B>0&&B<0.5)$=F/(2*B);else if(B>=0.5&&B<1)$=F/(2*(1-B));return[D[0],$*100,B*100]};u.hcg.hwb=function(D){let F=D[1]/100,E=D[2]/100,B=F+E*(1-F);return[D[0],(B-F)*100,(1-B)*100]};u.hwb.hcg=function(D){let F=D[1]/100,B=1-D[2]/100,$=B-F,q=0;if($<1)q=(B-$)/(1-$);return[D[0],$*100,q*100]};u.apple.rgb=function(D){return[D[0]/65535*255,D[1]/65535*255,D[2]/65535*255]};u.rgb.apple=function(D){return[D[0]/255*65535,D[1]/255*65535,D[2]/255*65535]};u.gray.rgb=function(D){return[D[0]/100*255,D[0]/100*255,D[0]/100*255]};u.gray.hsl=function(D){return[0,0,D[0]]};u.gray.hsv=u.gray.hsl;u.gray.hwb=function(D){return[0,100,D[0]]};u.gray.cmyk=function(D){return[0,0,0,D[0]]};u.gray.lab=function(D){return[D[0],0,0]};u.gray.hex=function(D){let F=Math.round(D[0]/100*255)&255,B=((F<<16)+(F<<8)+F).toString(16).toUpperCase();return"000000".substring(B.length)+B};u.rgb.gray=function(D){return[(D[0]+D[1]+D[2])/3/255*100]}});var R3=Z((v5,M3)=>{var R2=D0();function xF(){let D={},F=Object.keys(R2);for(let E=F.length,B=0;B<E;B++)D[F[B]]={distance:-1,parent:null};return D}function yF(D){let F=xF(),E=[D];F[D].distance=0;while(E.length){let B=E.pop(),$=Object.keys(R2[B]);for(let q=$.length,C=0;C<q;C++){let X=$[C],Q=F[X];if(Q.distance===-1)Q.distance=F[B].distance+1,Q.parent=B,E.unshift(X)}}return F}function hF(D,F){return function(E){return F(D(E))}}function gF(D,F){let E=[F[D].parent,D],B=R2[F[D].parent][D],$=F[D].parent;while(F[$].parent)E.unshift(F[$].parent),B=hF(R2[F[$].parent][$],B),$=F[$].parent;return B.conversion=E,B}M3.exports=function(D){let F=yF(D),E={},B=Object.keys(F);for(let $=B.length,q=0;q<$;q++){let C=B[q];if(F[C].parent===null)continue;E[C]=gF(C,F)}return E}});var j3=Z((Z5,z3)=>{var F0=D0(),mF=R3(),fD={},lF=Object.keys(F0);function pF(D){let F=function(...E){let B=E[0];if(B===void 0||B===null)return B;if(B.length>1)E=B;return D(E)};if("conversion"in D)F.conversion=D.conversion;return F}function cF(D){let F=function(...E){let B=E[0];if(B===void 0||B===null)return B;if(B.length>1)E=B;let $=D(E);if(typeof $==="object")for(let q=$.length,C=0;C<q;C++)$[C]=Math.round($[C]);return $};if("conversion"in D)F.conversion=D.conversion;return F}lF.forEach((D)=>{fD[D]={},Object.defineProperty(fD[D],"channels",{value:F0[D].channels}),Object.defineProperty(fD[D],"labels",{value:F0[D].labels});let F=mF(D);Object.keys(F).forEach((B)=>{let $=F[B];fD[D][B]=cF($),fD[D][B].raw=pF($)})});z3.exports=fD});var O3=Z((x5,K3)=>{var U3=(D,F)=>(...E)=>{return`\x1B[${D(...E)+F}m`},L3=(D,F)=>(...E)=>{let B=D(...E);return`\x1B[${38+F};5;${B}m`},V3=(D,F)=>(...E)=>{let B=D(...E);return`\x1B[${38+F};2;${B[0]};${B[1]};${B[2]}m`},z2=(D)=>D,N3=(D,F,E)=>[D,F,E],vD=(D,F,E)=>{Object.defineProperty(D,F,{get:()=>{let B=E();return Object.defineProperty(D,F,{value:B,enumerable:!0,configurable:!0}),B},enumerable:!0,configurable:!0})},E0,ZD=(D,F,E,B)=>{if(E0===void 0)E0=j3();let $=B?10:0,q={};for(let[C,X]of Object.entries(E0)){let Q=C==="ansi16"?"ansi":C;if(C===F)q[Q]=D(E,$);else if(typeof X==="object")q[Q]=D(X[F],$)}return q};function dF(){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[E,B]of Object.entries(F)){for(let[$,q]of Object.entries(B))F[$]={open:`\x1B[${q[0]}m`,close:`\x1B[${q[1]}m`},B[$]=F[$],D.set(q[0],q[1]);Object.defineProperty(F,E,{value:B,enumerable:!1})}return Object.defineProperty(F,"codes",{value:D,enumerable:!1}),F.color.close="\x1B[39m",F.bgColor.close="\x1B[49m",vD(F.color,"ansi",()=>ZD(U3,"ansi16",z2,!1)),vD(F.color,"ansi256",()=>ZD(L3,"ansi256",z2,!1)),vD(F.color,"ansi16m",()=>ZD(V3,"rgb",N3,!1)),vD(F.bgColor,"ansi",()=>ZD(U3,"ansi16",z2,!0)),vD(F.bgColor,"ansi256",()=>ZD(L3,"ansi256",z2,!0)),vD(F.bgColor,"ansi16m",()=>ZD(V3,"rgb",N3,!0)),F}Object.defineProperty(K3,"exports",{enumerable:!0,get:dF})});var I3=Z((y5,w3)=>{var E2=W3(),nF=s2(),iF=O3(),$0=new Set(["\x1B","\x9B"]),S3=(D)=>`${$0.values().next().value}[${D}m`,rF=(D)=>D.split(" ").map((F)=>E2(F)),B0=(D,F,E)=>{let B=[...F],$=!1,q=E2(nF(D[D.length-1]));for(let[C,X]of B.entries()){let Q=E2(X);if(q+Q<=E)D[D.length-1]+=X;else D.push(X),q=0;if($0.has(X))$=!0;else if($&&X==="m"){$=!1;continue}if($)continue;if(q+=Q,q===E&&C<B.length-1)D.push(""),q=0}if(!q&&D[D.length-1].length>0&&D.length>1)D[D.length-2]+=D.pop()},aF=(D)=>{let F=D.split(" "),E=F.length;while(E>0){if(E2(F[E-1])>0)break;E--}if(E===F.length)return D;return F.slice(0,E).join(" ")+F.slice(E).join("")},oF=(D,F,E={})=>{if(E.trim!==!1&&D.trim()==="")return"";let B="",$="",q,C=rF(D),X=[""];for(let[Q,J]of D.split(" ").entries()){if(E.trim!==!1)X[X.length-1]=X[X.length-1].trimLeft();let _=E2(X[X.length-1]);if(Q!==0){if(_>=F&&(E.wordWrap===!1||E.trim===!1))X.push(""),_=0;if(_>0||E.trim===!1)X[X.length-1]+=" ",_++}if(E.hard&&C[Q]>F){let H=F-_,j=1+Math.floor((C[Q]-H-1)/F);if(Math.floor((C[Q]-1)/F)<j)X.push("");B0(X,J,F);continue}if(_+C[Q]>F&&_>0&&C[Q]>0){if(E.wordWrap===!1&&_<F){B0(X,J,F);continue}X.push("")}if(_+C[Q]>F&&E.wordWrap===!1){B0(X,J,F);continue}X[X.length-1]+=J}if(E.trim!==!1)X=X.map(aF);B=X.join(`
25
+ `);for(let[Q,J]of[...B].entries()){if($+=J,$0.has(J)){let H=parseFloat(/\d[^m]*/.exec(B.slice(Q,Q+4)));q=H===39?null:H}let _=iF.codes.get(Number(q));if(q&&_){if(B[Q+1]===`
26
+ `)$+=S3(_);else if(J===`
27
+ `)$+=S3(q)}}return $};w3.exports=(D,F,E)=>{return String(D).normalize().replace(/\r\n/g,`
28
28
  `).split(`
29
- `).map((B)=>_1(B,F,E)).join(`
30
- `)}});var s3=h((N7,o3)=>{var C1=VD("stream");class a3 extends C1{#E=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.#E!==null)return this.#E;return this.#F("isTTY",!1)}set isTTY(D){this.#E=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)}}o3.exports=a3});var J3=UD(X3(),1),{program:U5,createCommand:V5,createArgument:u5,createOption:K5,CommanderError:L5,InvalidArgumentError:N5,InvalidOptionArgumentError:O5,Command:Q3,Argument:w5,Option:S5,Help:I5}=J3.default;var Y3="0.260202.0530";var CD=(D,F=[])=>D.name==="up"||F.includes("vim")&&D.name==="k"||F.includes("emacs")&&D.ctrl&&D.name==="p",ID=(D,F=[])=>D.name==="down"||F.includes("vim")&&D.name==="j"||F.includes("emacs")&&D.ctrl&&D.name==="n",D0=(D)=>D.name==="space",F0=(D)=>D.name==="backspace",PD=(D)=>D.name==="tab",E0=(D)=>"1234567890".includes(D.name),t=(D)=>D.name==="enter"||D.name==="return";class B0 extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(D){super();this.cause=D?.cause}}class $0 extends Error{name="CancelPromptError";message="Prompt was canceled"}class I2 extends Error{name="ExitPromptError"}class q0 extends Error{name="HookError"}class Y2 extends Error{name="ValidationError"}import{AsyncResource as x6}from"async_hooks";import{AsyncLocalStorage as f6,AsyncResource as v6}from"async_hooks";var W3=new f6;function Z6(D){return{rl:D,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function H3(D,F){let E=Z6(D);return W3.run(E,()=>{function B($){E.handleChange=()=>{E.index=0,$()},E.handleChange()}return F(B)})}function TD(){let D=W3.getStore();if(!D)throw new q0("[Inquirer] Hook functions can only be called from within a prompt");return D}function X0(){return TD().rl}function J0(D){let F=(...E)=>{let B=TD(),$=!1,q=B.handleChange;B.handleChange=()=>{$=!0};let X=D(...E);if($)q();return B.handleChange=q,X};return v6.bind(F)}function lD(D){let F=TD(),{index:E}=F,B={get(){return F.hooks[E]},set(q){F.hooks[E]=q},initialized:E in F.hooks},$=D(B);return F.index++,$}function _3(){TD().handleChange()}var bD={queue(D){let F=TD(),{index:E}=F;F.hooksEffect.push(()=>{F.hooksCleanup[E]?.();let B=D(X0());if(B!=null&&typeof B!=="function")throw new Y2("useEffect return value must be a cleanup function or nothing.");F.hooksCleanup[E]=B})},run(){let D=TD();J0(()=>{D.hooksEffect.forEach((F)=>{F()}),D.hooksEffect.length=0})()},clearAll(){let D=TD();D.hooksCleanup.forEach((F)=>{F?.()}),D.hooksEffect.length=0,D.hooksCleanup.length=0}};function v(D){return lD((F)=>{let E=x6.bind(function(q){if(F.get()!==q)F.set(q),_3()});if(F.initialized)return[F.get(),E];let B=typeof D==="function"?D():D;return F.set(B),[B,E]})}function MD(D,F){lD((E)=>{let B=E.get();if(!Array.isArray(B)||F.some((q,X)=>!Object.is(q,B[X])))bD.queue(D);E.set(F)})}var i=UD(W2(),1);import QD from"process";function g6(){if(QD.platform!=="win32")return QD.env.TERM!=="linux";return Boolean(QD.env.WT_SESSION)||Boolean(QD.env.TERMINUS_SUBLIME)||QD.env.ConEmuTask==="{cmd::Cmder}"||QD.env.TERM_PROGRAM==="Terminus-Sublime"||QD.env.TERM_PROGRAM==="vscode"||QD.env.TERM==="xterm-256color"||QD.env.TERM==="alacritty"||QD.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var C3={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"},M3={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"},m6={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"},l6={...C3,...M3},p6={...C3,...m6},d6=g6(),c6=d6?l6:p6,YD=c6,d5=Object.entries(M3);var R3={prefix:{idle:i.default.blue("?"),done:i.default.green(YD.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 A3(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 j3(...D){let F={};for(let E of D)for(let[B,$]of Object.entries(E)){let q=F[B];F[B]=A3(q)&&A3($)?j3(q,$):$}return F}function n(...D){let F=[R3,...D.filter((E)=>E!=null)];return j3(...F)}function e({status:D="idle",theme:F}){let[E,B]=v(!1),[$,q]=v(0),{prefix:X,spinner:J}=n(F);if(MD(()=>{if(D==="loading"){let Y,W=-1,C=setTimeout(()=>{B(!0),Y=setInterval(()=>{W=W+1,q(W%J.frames.length)},J.interval)},300);return()=>{clearTimeout(C),clearInterval(Y)}}else B(!1)},[D]),E)return J.frames[$];return typeof X==="string"?X:X[D==="loading"?"idle":D]??X.idle}function H2(D,F){return lD((E)=>{let B=E.get();if(!B||B.dependencies.length!==F.length||B.dependencies.some(($,q)=>$!==F[q])){let $=D();return E.set({value:$,dependencies:F}),$}return B.value})}function P2(D){return v({current:D})[0]}function DD(D){let F=P2(D);F.current=D,MD((E)=>{let B=!1,$=J0((q,X)=>{if(B)return;F.current(X,E)});return E.input.on("keypress",$),()=>{B=!0,E.input.removeListener("keypress",$)}},[])}var i3=UD(U3(),1),r3=UD(n3(),1);function C2(D,F){return D.split(`
31
- `).flatMap((E)=>r3.default(E,F,{trim:!1,hard:!0}).split(`
29
+ `).map((B)=>oF(B,F,E)).join(`
30
+ `)}});var f3=Z((c5,T3)=>{var tF=GD("stream");class P3 extends tF{#E=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.#E!==null)return this.#E;return this.#F("isTTY",!1)}set isTTY(D){this.#E=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)}}T3.exports=P3});var c0=zD(p0(),1),{program:h1,createCommand:g1,createArgument:m1,createOption:l1,CommanderError:p1,InvalidArgumentError:c1,InvalidOptionArgumentError:d1,Command:d0,Argument:n1,Option:i1,Help:r1}=c0.default;var n0="0.260202.1833";var D2=(D,F=[])=>D.name==="up"||F.includes("vim")&&D.name==="k"||F.includes("emacs")&&D.ctrl&&D.name==="p",H2=(D,F=[])=>D.name==="down"||F.includes("vim")&&D.name==="j"||F.includes("emacs")&&D.ctrl&&D.name==="n";var p2=(D)=>D.name==="backspace",jD=(D)=>D.name==="tab";var qD=(D)=>D.name==="enter"||D.name==="return";class c2 extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(D){super();this.cause=D?.cause}}class d2 extends Error{name="CancelPromptError";message="Prompt was canceled"}class u2 extends Error{name="ExitPromptError"}class n2 extends Error{name="HookError"}class i2 extends Error{name="ValidationError"}import{AsyncResource as UF}from"async_hooks";import{AsyncLocalStorage as RF,AsyncResource as zF}from"async_hooks";var i0=new RF;function jF(D){return{rl:D,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function r0(D,F){let E=jF(D);return i0.run(E,()=>{function B($){E.handleChange=()=>{E.index=0,$()},E.handleChange()}return F(B)})}function UD(){let D=i0.getStore();if(!D)throw new n2("[Inquirer] Hook functions can only be called from within a prompt");return D}function r2(){return UD().rl}function a2(D){let F=(...E)=>{let B=UD(),$=!1,q=B.handleChange;B.handleChange=()=>{$=!0};let C=D(...E);if($)q();return B.handleChange=q,C};return zF.bind(F)}function PD(D){let F=UD(),{index:E}=F,B={get(){return F.hooks[E]},set(q){F.hooks[E]=q},initialized:E in F.hooks},$=D(B);return F.index++,$}function a0(){UD().handleChange()}var LD={queue(D){let F=UD(),{index:E}=F;F.hooksEffect.push(()=>{F.hooksCleanup[E]?.();let B=D(r2());if(B!=null&&typeof B!=="function")throw new i2("useEffect return value must be a cleanup function or nothing.");F.hooksCleanup[E]=B})},run(){let D=UD();a2(()=>{D.hooksEffect.forEach((F)=>{F()}),D.hooksEffect.length=0})()},clearAll(){let D=UD();D.hooksCleanup.forEach((F)=>{F?.()}),D.hooksEffect.length=0,D.hooksCleanup.length=0}};function P(D){return PD((F)=>{let E=UF.bind(function(q){if(F.get()!==q)F.set(q),a0()});if(F.initialized)return[F.get(),E];let B=typeof D==="function"?D():D;return F.set(B),[B,E]})}function CD(D,F){PD((E)=>{let B=E.get();if(!Array.isArray(B)||F.some((q,C)=>!Object.is(q,B[C])))LD.queue(D);E.set(F)})}var m=zD(A2(),1);import DD from"process";function NF(){if(DD.platform!=="win32")return DD.env.TERM!=="linux";return Boolean(DD.env.WT_SESSION)||Boolean(DD.env.TERMINUS_SUBLIME)||DD.env.ConEmuTask==="{cmd::Cmder}"||DD.env.TERM_PROGRAM==="Terminus-Sublime"||DD.env.TERM_PROGRAM==="vscode"||DD.env.TERM==="xterm-256color"||DD.env.TERM==="alacritty"||DD.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var s0={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"},t0={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"},KF={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"},OF={...s0,...t0},SF={...s0,...KF},wF=NF(),IF=wF?OF:SF,TD=IF,J5=Object.entries(t0);var e0={prefix:{idle:m.default.blue("?"),done:m.default.green(TD.tick)},spinner:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"].map((D)=>m.default.yellow(D))},style:{answer:m.default.cyan,message:m.default.bold,error:(D)=>m.default.red(`> ${D}`),defaultAnswer:(D)=>m.default.dim(`(${D})`),help:m.default.dim,highlight:m.default.cyan,key:(D)=>m.default.cyan(m.default.bold(`<${D}>`))}};function D3(D){if(typeof D!=="object"||D===null)return!1;let F=D;while(Object.getPrototypeOf(F)!==null)F=Object.getPrototypeOf(F);return Object.getPrototypeOf(D)===F}function F3(...D){let F={};for(let E of D)for(let[B,$]of Object.entries(E)){let q=F[B];F[B]=D3(q)&&D3($)?F3(q,$):$}return F}function n(...D){let F=[e0,...D.filter((E)=>E!=null)];return F3(...F)}function XD({status:D="idle",theme:F}){let[E,B]=P(!1),[$,q]=P(0),{prefix:C,spinner:X}=n(F);if(CD(()=>{if(D==="loading"){let J,_=-1,H=setTimeout(()=>{B(!0),J=setInterval(()=>{_=_+1,q(_%X.frames.length)},X.interval)},300);return()=>{clearTimeout(H),clearInterval(J)}}else B(!1)},[D]),E)return X.frames[$];return typeof C==="string"?C:C[D==="loading"?"idle":D]??C.idle}function o2(D,F){return PD((E)=>{let B=E.get();if(!B||B.dependencies.length!==F.length||B.dependencies.some(($,q)=>$!==F[q])){let $=D();return E.set({value:$,dependencies:F}),$}return B.value})}function M2(D){return P({current:D})[0]}function QD(D){let F=M2(D);F.current=D,CD((E)=>{let B=!1,$=a2((q,C)=>{if(B)return;F.current(C,E)});return E.input.on("keypress",$),()=>{B=!0,E.input.removeListener("keypress",$)}},[])}var b3=zD(B3(),1),k3=zD(I3(),1);function B2(D,F){return D.split(`
31
+ `).flatMap((E)=>k3.default(E,F,{trim:!1,hard:!0}).split(`
32
32
  `).map((B)=>B.trimEnd())).join(`
33
- `)}function k2(){return i3.default({defaultWidth:80,output:X0().output})}function G1({active:D,renderedItems:F,pageSize:E,loop:B}){let $=P2({lastPointer:D,lastActive:void 0}),{lastPointer:q,lastActive:X}=$.current,J=Math.floor(E/2),Q=F.reduce((C,U)=>C+U.length,0),Y=F.slice(0,D).reduce((C,U)=>C+U.length,0),W=Y;if(Q>E)if(B){if(W=q,X!=null&&X<D&&D-X<E)W=Math.min(J,Math.abs(D-X)===1?Math.min(q+(F[X]?.length??0),Math.max(Y,q)):q+D-X)}else{let C=F.slice(D).reduce((U,M)=>U+M.length,0);W=C<E-J?E-C:Math.min(Y,J)}return $.current.lastPointer=W,$.current.lastActive=D,W}function M2({items:D,active:F,renderItem:E,pageSize:B,loop:$=!0}){let q=k2(),X=(V)=>(V%D.length+D.length)%D.length,J=D.map((V,O)=>{if(V==null)return[];return C2(E({item:V,index:O,isActive:O===F}),q).split(`
34
- `)}),Q=J.reduce((V,O)=>V+O.length,0),Y=(V)=>J[V]??[],W=G1({active:F,renderedItems:J,pageSize:B,loop:$}),C=Y(F).slice(0,B),U=W+C.length<=B?W:B-C.length,M=Array.from({length:B});M.splice(U,C.length,...C);let I=new Set([F]),b=U+C.length,k=X(F+1);while(b<B&&!I.has(k)&&($&&Q>B?k!==F:k>F)){let O=Y(k).slice(0,B-b);M.splice(b,O.length,...O),I.add(k),b+=O.length,k=X(k+1)}b=U-1,k=X(F-1);while(b>=0&&!I.has(k)&&($&&Q>B?k!==F:k<F)){let V=Y(k),O=V.slice(Math.max(0,V.length-b-1));M.splice(b-O.length+1,O.length,...O),I.add(k),b-=O.length,k=X(k-1)}return M.filter((V)=>typeof V==="string").join(`
35
- `)}var X8=UD(s3(),1);import*as q8 from"readline";import{AsyncResource as U1}from"async_hooks";var kD=[];kD.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")kD.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")kD.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var f2=(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",R0=Symbol.for("signal-exit emitter"),A0=globalThis,M1=Object.defineProperty.bind(Object);class t3{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(A0[R0])return A0[R0];M1(A0,R0,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(D,F){this.listeners[D].push(F)}removeListener(D,F){let E=this.listeners[D],B=E.indexOf(F);if(B===-1)return;if(B===0&&E.length===1)E.length=0;else E.splice(B,1)}emit(D,F,E){if(this.emitted[D])return!1;this.emitted[D]=!0;let B=!1;for(let $ of this.listeners[D])B=$(F,E)===!0||B;if(D==="exit")B=this.emit("afterExit",F,E)||B;return B}}class z0{}var R1=(D)=>{return{onExit(F,E){return D.onExit(F,E)},load(){return D.load()},unload(){return D.unload()}}};class e3 extends z0{onExit(){return()=>{}}load(){}unload(){}}class D8 extends z0{#E=j0.platform==="win32"?"SIGINT":"SIGHUP";#F=new t3;#D;#q;#X;#$={};#B=!1;constructor(D){super();this.#D=D,this.#$={};for(let F of kD)this.#$[F]=()=>{let E=this.#D.listeners(F),{count:B}=this.#F,$=D;if(typeof $.__signal_exit_emitter__==="object"&&typeof $.__signal_exit_emitter__.count==="number")B+=$.__signal_exit_emitter__.count;if(E.length===B){this.unload();let q=this.#F.emit("exit",null,F),X=F==="SIGHUP"?this.#E:F;if(!q)D.kill(D.pid,X)}};this.#X=D.reallyExit,this.#q=D.emit}onExit(D,F){if(!f2(this.#D))return()=>{};if(this.#B===!1)this.load();let E=F?.alwaysLast?"afterExit":"exit";return this.#F.on(E,D),()=>{if(this.#F.removeListener(E,D),this.#F.listeners.exit.length===0&&this.#F.listeners.afterExit.length===0)this.unload()}}load(){if(this.#B)return;this.#B=!0,this.#F.count+=1;for(let D of kD)try{let F=this.#$[D];if(F)this.#D.on(D,F)}catch(F){}this.#D.emit=(D,...F)=>{return this.#Q(D,...F)},this.#D.reallyExit=(D)=>{return this.#J(D)}}unload(){if(!this.#B)return;this.#B=!1,kD.forEach((D)=>{let F=this.#$[D];if(!F)throw Error("Listener not defined for signal: "+D);try{this.#D.removeListener(D,F)}catch(E){}}),this.#D.emit=this.#q,this.#D.reallyExit=this.#X,this.#F.count-=1}#J(D){if(!f2(this.#D))return 0;return this.#D.exitCode=D||0,this.#F.emit("exit",this.#D.exitCode,null),this.#X.call(this.#D,this.#D.exitCode)}#Q(D,...F){let E=this.#q;if(D==="exit"&&f2(this.#D)){if(typeof F[0]==="number")this.#D.exitCode=F[0];let B=E.call(this.#D,D,...F);return this.#F.emit("exit",this.#D.exitCode,null),B}else return E.call(this.#D,D,...F)}}var j0=globalThis.process,{onExit:F8,load:S7,unload:I7}=R1(f2(j0)?new D8(j0):new e3);import{stripVTControlCharacters as j1}from"util";var A1="\x1B[G",v2="\x1B[?25l",B8="\x1B[?25h",U0=(D=1)=>D>0?`\x1B[${D}A`:"",V0=(D=1)=>D>0?`\x1B[${D}B`:"",u0=(D,F)=>{if(typeof F==="number"&&!Number.isNaN(F))return`\x1B[${F+1};${D+1}H`;return`\x1B[${D+1}G`},E8="\x1B[2K",K0=(D)=>D>0?(E8+U0(1)).repeat(D-1)+E8+A1:"";var $8=(D)=>D.split(`
36
- `).length,z1=(D)=>D.split(`
37
- `).pop()??"";class Z2{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 E=z1(D),B=j1(E),$=B;if(this.rl.line.length>0)$=$.slice(0,-this.rl.line.length);this.rl.setPrompt($),this.cursorPos=this.rl.getCursorPos();let q=k2();if(D=C2(D,q),F=C2(F,q),B.length%q===0)D+=`
38
- `;let X=D+(F?`
39
- `+F:""),Q=Math.floor(B.length/q)-this.cursorPos.rows+(F?$8(F):0);if(Q>0)X+=U0(Q);X+=u0(this.cursorPos.cols),this.write(V0(this.extraLinesUnderPrompt)+K0(this.height)+X),this.extraLinesUnderPrompt=Q,this.height=$8(X)}checkCursorPos(){let D=this.rl.getCursorPos();if(D.cols!==this.cursorPos.cols)this.write(u0(D.cols)),this.cursorPos=D}done({clearContent:D}){this.rl.setPrompt("");let F=V0(this.extraLinesUnderPrompt);F+=D?K0(this.height):`
40
- `,F+=B8,this.write(F),this.rl.close()}}class L0 extends Promise{static withResolver(){let D,F;return{promise:new Promise((B,$)=>{D=B,F=$}),resolve:D,reject:F}}}function V1(){let D=Error.prepareStackTrace,F=[];try{Error.prepareStackTrace=(E,B)=>{let $=B.slice(1);return F=$,$},Error().stack}catch{return F}return Error.prepareStackTrace=D,F}function FD(D){let F=V1();return(B,$={})=>{let{input:q=process.stdin,signal:X}=$,J=new Set,Q=new X8.default;Q.pipe($.output??process.stdout);let Y=q8.createInterface({terminal:!0,input:q,output:Q}),W=new Z2(Y),{promise:C,resolve:U,reject:M}=L0.withResolver(),I=()=>M(new $0);if(X){let V=()=>M(new B0({cause:X.reason}));if(X.aborted)return V(),Object.assign(C,{cancel:I});X.addEventListener("abort",V),J.add(()=>X.removeEventListener("abort",V))}J.add(F8((V,O)=>{M(new I2(`User force closed the prompt with ${V} ${O}`))}));let b=()=>M(new I2("User force closed the prompt with SIGINT"));Y.on("SIGINT",b),J.add(()=>Y.removeListener("SIGINT",b));let k=()=>W.checkCursorPos();return Y.input.on("keypress",k),J.add(()=>Y.input.removeListener("keypress",k)),H3(Y,(V)=>{let O=U1.bind(()=>bD.clearAll());return Y.on("close",O),J.add(()=>Y.removeListener("close",O)),V(()=>{try{let Z=D(B,(zD)=>{setImmediate(()=>U(zD))});if(Z===void 0){let zD=F[1]?.getFileName();throw Error(`Prompt functions must return a string.
41
- at ${zD}`)}let[c,p]=typeof Z==="string"?[Z]:Z;W.render(c,p),bD.run()}catch(Z){M(Z)}}),Object.assign(C.then((Z)=>{return bD.clearAll(),Z},(Z)=>{throw bD.clearAll(),Z}).finally(()=>{J.forEach((Z)=>Z()),W.done({clearContent:Boolean($.clearPromptOnDone)}),Q.end()}).then(()=>C),{cancel:I})})}}var J8=UD(W2(),1);class r{separator=J8.default.dim(Array.from({length:15}).join(YD.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 fD=UD(W2(),1);var u1={icon:{checked:fD.default.green(YD.circleFilled),unchecked:YD.circle,cursor:YD.pointer},style:{disabledChoice:(D)=>fD.default.dim(`- ${D}`),renderSelectedChoices:(D)=>D.map((F)=>F.short).join(", "),description:(D)=>fD.default.cyan(D),keysHelpTip:(D)=>D.map(([F,E])=>`${fD.default.bold(F)} ${fD.default.dim(E)}`).join(fD.default.dim(" \u2022 "))},helpMode:"always",keybindings:[]};function uD(D){return!r.isSeparator(D)&&!D.disabled}function N0(D){return uD(D)&&D.checked}function O0(D){return uD(D)?{...D,checked:!D.checked}:D}function K1(D){return function(F){return uD(F)?{...F,checked:D}:F}}function L1(D){return D.map((F)=>{if(r.isSeparator(F))return F;if(typeof F==="string")return{value:F,name:F,short:F,checkedName:F,disabled:!1,checked:!1};let E=F.name??String(F.value),B={value:F.value,name:E,short:F.short??E,checkedName:F.checkedName??E,disabled:F.disabled??!1,checked:F.checked??!1};if(F.description)B.description=F.description;return B})}var N1=FD((D,F)=>{let{instructions:E,pageSize:B=7,loop:$=!0,required:q,validate:X=()=>!0}=D,J={all:"a",invert:"i",...D.shortcuts},Q=n(u1,D.theme),{keybindings:Y}=Q,[W,C]=v("idle"),U=e({status:W,theme:Q}),[M,I]=v(L1(D.choices)),b=H2(()=>{let P=M.findIndex(uD),u=M.findLastIndex(uD);if(P===-1)throw new Y2("[checkbox prompt] No selectable choices. All choices are disabled.");return{first:P,last:u}},[M]),[k,V]=v(b.first),[O,Z]=v();DD(async(P)=>{if(t(P)){let u=M.filter(N0),f=await X([...u]);if(q&&!M.some(N0))Z("At least one choice must be selected");else if(f===!0)C("done"),F(u.map((g)=>g.value));else Z(f||"You must select a valid value")}else if(CD(P,Y)||ID(P,Y)){if($||CD(P,Y)&&k!==b.first||ID(P,Y)&&k!==b.last){let u=CD(P,Y)?-1:1,f=k;do f=(f+u+M.length)%M.length;while(!uD(M[f]));V(f)}}else if(D0(P))Z(void 0),I(M.map((u,f)=>f===k?O0(u):u));else if(P.name===J.all){let u=M.some((f)=>uD(f)&&!f.checked);I(M.map(K1(u)))}else if(P.name===J.invert)I(M.map(O0));else if(E0(P)){let u=Number(P.name)-1,f=-1,g=M.findIndex((JD)=>{if(r.isSeparator(JD))return!1;return f++,f===u}),s=M[g];if(s&&uD(s))V(g),I(M.map((JD,J2)=>J2===g?O0(JD):JD))}});let c=Q.style.message(D.message,W),p,zD=M2({items:M,active:k,renderItem({item:P,isActive:u}){if(r.isSeparator(P))return` ${P.separator}`;if(P.disabled){let J2=typeof P.disabled==="string"?P.disabled:"(disabled)";return Q.style.disabledChoice(`${P.name} ${J2}`)}if(u)p=P.description;let f=P.checked?Q.icon.checked:Q.icon.unchecked,g=P.checked?P.checkedName:P.name,s=u?Q.style.highlight:(J2)=>J2,JD=u?Q.icon.cursor:" ";return s(`${JD}${f} ${g}`)},pageSize:B,loop:$});if(W==="done"){let P=M.filter(N0),u=Q.style.answer(Q.style.renderSelectedChoices(P,M));return[U,c,u].filter(Boolean).join(" ")}let mD;if(Q.helpMode!=="never"&&E!==!1)if(typeof E==="string")mD=E;else{let P=[["\u2191\u2193","navigate"],["space","select"]];if(J.all)P.push([J.all,"all"]);if(J.invert)P.push([J.invert,"invert"]);P.push(["\u23CE","submit"]),mD=Q.style.keysHelpTip(P)}return`${[[U,c].filter(Boolean).join(" "),zD," ",p?Q.style.description(p):"",O?Q.style.error(O):"",mD].filter(Boolean).join(`
42
- `).trimEnd()}${v2}`});function Q8(D,F){let E=F!==!1;if(/^(y|yes)/i.test(D))E=!0;else if(/^(n|no)/i.test(D))E=!1;return E}function Y8(D){return D?"Yes":"No"}var w0=FD((D,F)=>{let{transformer:E=Y8}=D,[B,$]=v("idle"),[q,X]=v(""),J=n(D.theme),Q=e({status:B,theme:J});DD((U,M)=>{if(B!=="idle")return;if(t(U)){let I=Q8(q,D.default);X(E(I)),$("done"),F(I)}else if(PD(U)){let I=Y8(!Q8(q,D.default));M.clearLine(0),M.write(I),X(I)}else X(M.line)});let Y=q,W="";if(B==="done")Y=J.style.answer(q);else W=` ${J.style.defaultAnswer(D.default===!1?"y/N":"Y/n")}`;let C=J.style.message(D.message,B);return`${Q} ${C}${W} ${Y}`});var O1={validationFailureMode:"keep"},S0=FD((D,F)=>{let{prefill:E="tab"}=D,B=n(O1,D.theme),[$,q]=v("idle"),[X="",J]=v(D.default),[Q,Y]=v(),[W,C]=v(""),U=e({status:$,theme:B});async function M(O){let{required:Z,pattern:c,patternError:p="Invalid input"}=D;if(Z&&!O)return"You must provide a value";if(c&&!c.test(O))return p;if(typeof D.validate==="function")return await D.validate(O)||"You must provide a valid value";return!0}DD(async(O,Z)=>{if($!=="idle")return;if(t(O)){let c=W||X;q("loading");let p=await M(c);if(p===!0)C(c),q("done"),F(c);else{if(B.validationFailureMode==="clear")C("");else Z.write(W);Y(p),q("idle")}}else if(F0(O)&&!W)J(void 0);else if(PD(O)&&!W)J(void 0),Z.clearLine(0),Z.write(X),C(X);else C(Z.line),Y(void 0)}),MD((O)=>{if(E==="editable"&&X)O.write(X),C(X)},[]);let I=B.style.message(D.message,$),b=W;if(typeof D.transformer==="function")b=D.transformer(W,{isFinal:$==="done"});else if($==="done")b=B.style.answer(W);let k;if(X&&$!=="done"&&!W)k=B.style.defaultAnswer(X);let V="";if(Q)V=B.style.error(Q);return[[U,I,k,b].filter((O)=>O!==void 0).join(" "),V]});var I0=FD((D,F)=>{let{validate:E=()=>!0}=D,B=n(D.theme),[$,q]=v("idle"),[X,J]=v(),[Q,Y]=v(""),W=e({status:$,theme:B});DD(async(b,k)=>{if($!=="idle")return;if(t(b)){let V=Q;q("loading");let O=await E(V);if(O===!0)Y(V),q("done"),F(V);else k.write(Q),J(O||"You must provide a valid value"),q("idle")}else Y(k.line),J(void 0)});let C=B.style.message(D.message,$),U="",M;if(D.mask)U=(typeof D.mask==="string"?D.mask:"*").repeat(Q.length);else if($!=="done")M=`${B.style.help("[input is masked]")}${v2}`;if($==="done")U=B.style.answer(U);let I="";if(X)I=B.style.error(X);return[[W,C,D.mask?U:M].join(" "),I]});var vD=UD(W2(),1);var w1={icon:{cursor:YD.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,E])=>`${vD.default.bold(F)} ${vD.default.dim(E)}`).join(vD.default.dim(" \u2022 "))},helpMode:"always"};function P0(D){return!r.isSeparator(D)&&!D.disabled}function S1(D){return D.map((F)=>{if(r.isSeparator(F))return F;if(typeof F==="string")return{value:F,name:F,short:F,disabled:!1};let E=F.name??String(F.value),B={value:F.value,name:E,short:F.short??E,disabled:F.disabled??!1};if(F.description)B.description=F.description;return B})}var T0=FD((D,F)=>{let{pageSize:E=7,validate:B=()=>!0}=D,$=n(w1,D.theme),[q,X]=v("loading"),[J,Q]=v(""),[Y,W]=v([]),[C,U]=v(),M=e({status:q,theme:$}),I=H2(()=>{let u=Y.findIndex(P0),f=Y.findLastIndex(P0);return{first:u,last:f}},[Y]),[b=I.first,k]=v();MD(()=>{let u=new AbortController;return X("loading"),U(void 0),(async()=>{try{let g=await D.source(J||void 0,{signal:u.signal});if(!u.signal.aborted)k(void 0),U(void 0),W(S1(g)),X("idle")}catch(g){if(!u.signal.aborted&&g instanceof Error)U(g.message)}})(),()=>{u.abort()}},[J]);let V=Y[b];DD(async(u,f)=>{if(t(u))if(V){X("loading");let g=await B(V.value);if(X("idle"),g===!0)X("done"),F(V.value);else if(V.name===J)U(g||"You must provide a valid value");else f.write(V.name),Q(V.name)}else f.write(J);else if(PD(u)&&V)f.clearLine(0),f.write(V.name),Q(V.name);else if(q!=="loading"&&(CD(u)||ID(u))){if(f.clearLine(0),CD(u)&&b!==I.first||ID(u)&&b!==I.last){let g=CD(u)?-1:1,s=b;do s=(s+g+Y.length)%Y.length;while(!P0(Y[s]));k(s)}}else Q(f.line)});let O=$.style.message(D.message,q),Z;if($.helpMode!=="never")if(D.instructions){let{pager:u,navigation:f}=D.instructions;Z=$.style.help(Y.length>E?u:f)}else Z=$.style.keysHelpTip([["\u2191\u2193","navigate"],["\u23CE","select"]]);let c=M2({items:Y,active:b,renderItem({item:u,isActive:f}){if(r.isSeparator(u))return` ${u.separator}`;if(u.disabled){let JD=typeof u.disabled==="string"?u.disabled:"(disabled)";return $.style.disabled(`${u.name} ${JD}`)}let g=f?$.style.highlight:(JD)=>JD,s=f?$.icon.cursor:" ";return g(`${s} ${u.name}`)},pageSize:E,loop:!1}),p;if(C)p=$.style.error(C);else if(Y.length===0&&J!==""&&q==="idle")p=$.style.error("No results found");let zD;if(q==="done"&&V)return[M,O,$.style.answer(V.short)].filter(Boolean).join(" ").trimEnd();else zD=$.style.searchTerm(J);let mD=V?.description,n0=[M,O,zD].filter(Boolean).join(" ").trimEnd(),P=[p??c," ",mD?$.style.description(mD):"",Z].filter(Boolean).join(`
43
- `).trimEnd();return[n0,P]});async function R2(D,F){try{try{new URL(D)}catch{return{success:!1,error:"invalid_url",message:`Invalid URL format: ${D}`}}let E=await fetch(`${D}/v1/models`,{method:"GET",headers:{Authorization:`Bearer ${F}`,"Content-Type":"application/json"}});if(E.status===401||E.status===403)return{success:!1,error:"auth_failure",message:"Authentication failed. Check your API key."};if(!E.ok)return{success:!1,error:"unknown",message:`Server returned ${E.status}: ${E.statusText}`};let $=(await E.json()).data||[];return{success:!0,modelCount:$.length,models:$}}catch(E){if(E.cause?.code==="ECONNREFUSED"||E.message?.includes("ECONNREFUSED"))return{success:!1,error:"network_error",message:`Connection refused. Is the server running at ${D}?`};if(E.cause?.code==="ENOTFOUND"||E.message?.includes("ENOTFOUND"))return{success:!1,error:"network_error",message:`Could not resolve hostname. Check the URL: ${D}`};if(E.name==="AbortError"||E.message?.includes("timeout"))return{success:!1,error:"network_error",message:"Connection timed out. Check your network and the server URL."};return{success:!1,error:"network_error",message:`Network error: ${E.message||"Unknown error"}`}}}import{existsSync as x0,mkdirSync as gF,readFileSync as mF,writeFileSync as lF,unlinkSync as D4}from"fs";import{homedir as pF}from"os";import{join as V8}from"path";var T={};c8(T,{void:()=>_F,util:()=>S,unknown:()=>WF,union:()=>RF,undefined:()=>JF,tuple:()=>zF,transformer:()=>IF,symbol:()=>XF,string:()=>j8,strictObject:()=>MF,setErrorMap:()=>T1,set:()=>uF,record:()=>UF,quotelessJson:()=>I1,promise:()=>SF,preprocess:()=>bF,pipeline:()=>kF,ostring:()=>fF,optional:()=>PF,onumber:()=>vF,oboolean:()=>ZF,objectUtil:()=>b0,object:()=>CF,number:()=>z8,nullable:()=>TF,null:()=>QF,never:()=>HF,nativeEnum:()=>wF,nan:()=>BF,map:()=>VF,makeIssue:()=>A2,literal:()=>NF,lazy:()=>LF,late:()=>FF,isValid:()=>KD,isDirty:()=>y2,isAsync:()=>iD,isAborted:()=>x2,intersection:()=>jF,instanceof:()=>EF,getParsedType:()=>WD,getErrorMap:()=>nD,function:()=>KF,enum:()=>OF,effect:()=>IF,discriminatedUnion:()=>AF,defaultErrorMap:()=>RD,datetimeRegex:()=>M8,date:()=>qF,custom:()=>A8,coerce:()=>xF,boolean:()=>U8,bigint:()=>$F,array:()=>GF,any:()=>YF,addIssueToContext:()=>G,ZodVoid:()=>z2,ZodUnknown:()=>LD,ZodUnion:()=>eD,ZodUndefined:()=>sD,ZodType:()=>w,ZodTuple:()=>_D,ZodTransformer:()=>XD,ZodSymbol:()=>j2,ZodString:()=>ED,ZodSet:()=>hD,ZodSchema:()=>w,ZodRecord:()=>U2,ZodReadonly:()=>X2,ZodPromise:()=>gD,ZodPipeline:()=>K2,ZodParsedType:()=>_,ZodOptional:()=>$D,ZodObject:()=>x,ZodNumber:()=>ND,ZodNullable:()=>jD,ZodNull:()=>tD,ZodNever:()=>HD,ZodNativeEnum:()=>B2,ZodNaN:()=>u2,ZodMap:()=>V2,ZodLiteral:()=>E2,ZodLazy:()=>F2,ZodIssueCode:()=>H,ZodIntersection:()=>D2,ZodFunction:()=>aD,ZodFirstPartyTypeKind:()=>z,ZodError:()=>d,ZodEnum:()=>wD,ZodEffects:()=>XD,ZodDiscriminatedUnion:()=>h2,ZodDefault:()=>$2,ZodDate:()=>xD,ZodCatch:()=>q2,ZodBranded:()=>g2,ZodBoolean:()=>oD,ZodBigInt:()=>OD,ZodArray:()=>BD,ZodAny:()=>yD,Schema:()=>w,ParseStatus:()=>m,OK:()=>l,NEVER:()=>yF,INVALID:()=>j,EMPTY_PATH:()=>b1,DIRTY:()=>ZD,BRAND:()=>DF});var S;(function(D){D.assertEqual=($)=>{};function F($){}D.assertIs=F;function E($){throw Error()}D.assertNever=E,D.arrayToEnum=($)=>{let q={};for(let X of $)q[X]=X;return q},D.getValidEnumValues=($)=>{let q=D.objectKeys($).filter((J)=>typeof $[$[J]]!=="number"),X={};for(let J of q)X[J]=$[J];return D.objectValues(X)},D.objectValues=($)=>{return D.objectKeys($).map(function(q){return $[q]})},D.objectKeys=typeof Object.keys==="function"?($)=>Object.keys($):($)=>{let q=[];for(let X in $)if(Object.prototype.hasOwnProperty.call($,X))q.push(X);return q},D.find=($,q)=>{for(let X of $)if(q(X))return X;return},D.isInteger=typeof Number.isInteger==="function"?($)=>Number.isInteger($):($)=>typeof $==="number"&&Number.isFinite($)&&Math.floor($)===$;function B($,q=" | "){return $.map((X)=>typeof X==="string"?`'${X}'`:X).join(q)}D.joinValues=B,D.jsonStringifyReplacer=($,q)=>{if(typeof q==="bigint")return q.toString();return q}})(S||(S={}));var b0;(function(D){D.mergeShapes=(F,E)=>{return{...F,...E}}})(b0||(b0={}));var _=S.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),WD=(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 H=S.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),I1=(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=(E)=>{this.issues=[...this.issues,E]},this.addIssues=(E=[])=>{this.issues=[...this.issues,...E]};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},E={_errors:[]},B=($)=>{for(let q of $.issues)if(q.code==="invalid_union")q.unionErrors.map(B);else if(q.code==="invalid_return_type")B(q.returnTypeError);else if(q.code==="invalid_arguments")B(q.argumentsError);else if(q.path.length===0)E._errors.push(F(q));else{let X=E,J=0;while(J<q.path.length){let Q=q.path[J];if(J!==q.path.length-1)X[Q]=X[Q]||{_errors:[]};else X[Q]=X[Q]||{_errors:[]},X[Q]._errors.push(F(q));X=X[Q],J++}}};return B(this),E}static assert(D){if(!(D instanceof d))throw Error(`Not a ZodError: ${D}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,S.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(D=(F)=>F.message){let F={},E=[];for(let B of this.issues)if(B.path.length>0){let $=B.path[0];F[$]=F[$]||[],F[$].push(D(B))}else E.push(D(B));return{formErrors:E,fieldErrors:F}}get formErrors(){return this.flatten()}}d.create=(D)=>{return new d(D)};var P1=(D,F)=>{let E;switch(D.code){case H.invalid_type:if(D.received===_.undefined)E="Required";else E=`Expected ${D.expected}, received ${D.received}`;break;case H.invalid_literal:E=`Invalid literal value, expected ${JSON.stringify(D.expected,S.jsonStringifyReplacer)}`;break;case H.unrecognized_keys:E=`Unrecognized key(s) in object: ${S.joinValues(D.keys,", ")}`;break;case H.invalid_union:E="Invalid input";break;case H.invalid_union_discriminator:E=`Invalid discriminator value. Expected ${S.joinValues(D.options)}`;break;case H.invalid_enum_value:E=`Invalid enum value. Expected ${S.joinValues(D.options)}, received '${D.received}'`;break;case H.invalid_arguments:E="Invalid function arguments";break;case H.invalid_return_type:E="Invalid function return type";break;case H.invalid_date:E="Invalid date";break;case H.invalid_string:if(typeof D.validation==="object")if("includes"in D.validation){if(E=`Invalid input: must include "${D.validation.includes}"`,typeof D.validation.position==="number")E=`${E} at one or more positions greater than or equal to ${D.validation.position}`}else if("startsWith"in D.validation)E=`Invalid input: must start with "${D.validation.startsWith}"`;else if("endsWith"in D.validation)E=`Invalid input: must end with "${D.validation.endsWith}"`;else S.assertNever(D.validation);else if(D.validation!=="regex")E=`Invalid ${D.validation}`;else E="Invalid";break;case H.too_small:if(D.type==="array")E=`Array must contain ${D.exact?"exactly":D.inclusive?"at least":"more than"} ${D.minimum} element(s)`;else if(D.type==="string")E=`String must contain ${D.exact?"exactly":D.inclusive?"at least":"over"} ${D.minimum} character(s)`;else if(D.type==="number")E=`Number must be ${D.exact?"exactly equal to ":D.inclusive?"greater than or equal to ":"greater than "}${D.minimum}`;else if(D.type==="bigint")E=`Number must be ${D.exact?"exactly equal to ":D.inclusive?"greater than or equal to ":"greater than "}${D.minimum}`;else if(D.type==="date")E=`Date must be ${D.exact?"exactly equal to ":D.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(D.minimum))}`;else E="Invalid input";break;case H.too_big:if(D.type==="array")E=`Array must contain ${D.exact?"exactly":D.inclusive?"at most":"less than"} ${D.maximum} element(s)`;else if(D.type==="string")E=`String must contain ${D.exact?"exactly":D.inclusive?"at most":"under"} ${D.maximum} character(s)`;else if(D.type==="number")E=`Number must be ${D.exact?"exactly":D.inclusive?"less than or equal to":"less than"} ${D.maximum}`;else if(D.type==="bigint")E=`BigInt must be ${D.exact?"exactly":D.inclusive?"less than or equal to":"less than"} ${D.maximum}`;else if(D.type==="date")E=`Date must be ${D.exact?"exactly":D.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(D.maximum))}`;else E="Invalid input";break;case H.custom:E="Invalid input";break;case H.invalid_intersection_types:E="Intersection results could not be merged";break;case H.not_multiple_of:E=`Number must be a multiple of ${D.multipleOf}`;break;case H.not_finite:E="Number must be finite";break;default:E=F.defaultError,S.assertNever(D)}return{message:E}},RD=P1;var W8=RD;function T1(D){W8=D}function nD(){return W8}var A2=(D)=>{let{data:F,path:E,errorMaps:B,issueData:$}=D,q=[...E,...$.path||[]],X={...$,path:q};if($.message!==void 0)return{...$,path:q,message:$.message};let J="",Q=B.filter((Y)=>!!Y).slice().reverse();for(let Y of Q)J=Y(X,{data:F,defaultError:J}).message;return{...$,path:q,message:J}},b1=[];function G(D,F){let E=nD(),B=A2({issueData:F,data:D.data,path:D.path,errorMaps:[D.common.contextualErrorMap,D.schemaErrorMap,E,E===RD?void 0:RD].filter(($)=>!!$)});D.common.issues.push(B)}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 E=[];for(let B of F){if(B.status==="aborted")return j;if(B.status==="dirty")D.dirty();E.push(B.value)}return{status:D.value,value:E}}static async mergeObjectAsync(D,F){let E=[];for(let B of F){let $=await B.key,q=await B.value;E.push({key:$,value:q})}return m.mergeObjectSync(D,E)}static mergeObjectSync(D,F){let E={};for(let B of F){let{key:$,value:q}=B;if($.status==="aborted")return j;if(q.status==="aborted")return j;if($.status==="dirty")D.dirty();if(q.status==="dirty")D.dirty();if($.value!=="__proto__"&&(typeof q.value<"u"||B.alwaysSet))E[$.value]=q.value}return{status:D.value,value:E}}}var j=Object.freeze({status:"aborted"}),ZD=(D)=>({status:"dirty",value:D}),l=(D)=>({status:"valid",value:D}),x2=(D)=>D.status==="aborted",y2=(D)=>D.status==="dirty",KD=(D)=>D.status==="valid",iD=(D)=>typeof Promise<"u"&&D instanceof Promise;var A;(function(D){D.errToObj=(F)=>typeof F==="string"?{message:F}:F||{},D.toString=(F)=>typeof F==="string"?F:F?.message})(A||(A={}));class qD{constructor(D,F,E,B){this._cachedPath=[],this.parent=D,this.data=F,this._path=E,this._key=B}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 H8=(D,F)=>{if(KD(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 E=new d(D.common.issues);return this._error=E,this._error}}}};function L(D){if(!D)return{};let{errorMap:F,invalid_type_error:E,required_error:B,description:$}=D;if(F&&(E||B))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:(X,J)=>{let{message:Q}=D;if(X.code==="invalid_enum_value")return{message:Q??J.defaultError};if(typeof J.data>"u")return{message:Q??B??J.defaultError};if(X.code!=="invalid_type")return{message:J.defaultError};return{message:Q??E??J.defaultError}},description:$}}class w{get description(){return this._def.description}_getType(D){return WD(D.data)}_getOrReturnCtx(D,F){return F||{common:D.parent.common,data:D.data,parsedType:WD(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:WD(D.data),schemaErrorMap:this._def.errorMap,path:D.path,parent:D.parent}}}_parseSync(D){let F=this._parse(D);if(iD(F))throw Error("Synchronous parse encountered promise.");return F}_parseAsync(D){let F=this._parse(D);return Promise.resolve(F)}parse(D,F){let E=this.safeParse(D,F);if(E.success)return E.data;throw E.error}safeParse(D,F){let E={common:{issues:[],async:F?.async??!1,contextualErrorMap:F?.errorMap},path:F?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:D,parsedType:WD(D)},B=this._parseSync({data:D,path:E.path,parent:E});return H8(E,B)}"~validate"(D){let F={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:D,parsedType:WD(D)};if(!this["~standard"].async)try{let E=this._parseSync({data:D,path:[],parent:F});return KD(E)?{value:E.value}:{issues:F.common.issues}}catch(E){if(E?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;F.common={issues:[],async:!0}}return this._parseAsync({data:D,path:[],parent:F}).then((E)=>KD(E)?{value:E.value}:{issues:F.common.issues})}async parseAsync(D,F){let E=await this.safeParseAsync(D,F);if(E.success)return E.data;throw E.error}async safeParseAsync(D,F){let E={common:{issues:[],contextualErrorMap:F?.errorMap,async:!0},path:F?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:D,parsedType:WD(D)},B=this._parse({data:D,path:E.path,parent:E}),$=await(iD(B)?B:Promise.resolve(B));return H8(E,$)}refine(D,F){let E=(B)=>{if(typeof F==="string"||typeof F>"u")return{message:F};else if(typeof F==="function")return F(B);else return F};return this._refinement((B,$)=>{let q=D(B),X=()=>$.addIssue({code:H.custom,...E(B)});if(typeof Promise<"u"&&q instanceof Promise)return q.then((J)=>{if(!J)return X(),!1;else return!0});if(!q)return X(),!1;else return!0})}refinement(D,F){return this._refinement((E,B)=>{if(!D(E))return B.addIssue(typeof F==="function"?F(E,B):F),!1;else return!0})}_refinement(D){return new XD({schema:this,typeName:z.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 $D.create(this,this._def)}nullable(){return jD.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return BD.create(this)}promise(){return gD.create(this,this._def)}or(D){return eD.create([this,D],this._def)}and(D){return D2.create(this,D,this._def)}transform(D){return new XD({...L(this._def),schema:this,typeName:z.ZodEffects,effect:{type:"transform",transform:D}})}default(D){let F=typeof D==="function"?D:()=>D;return new $2({...L(this._def),innerType:this,defaultValue:F,typeName:z.ZodDefault})}brand(){return new g2({typeName:z.ZodBranded,type:this,...L(this._def)})}catch(D){let F=typeof D==="function"?D:()=>D;return new q2({...L(this._def),innerType:this,catchValue:F,typeName:z.ZodCatch})}describe(D){return new this.constructor({...this._def,description:D})}pipe(D){return K2.create(this,D)}readonly(){return X2.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var k1=/^c[^\s-]{8,}$/i,f1=/^[0-9a-z]+$/,v1=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Z1=/^[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,x1=/^[a-z0-9_-]{21}$/i,y1=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,h1=/^[-+]?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)?)??$/,g1=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,m1="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",k0,l1=/^(?:(?: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])$/,p1=/^(?:(?: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])$/,d1=/^(([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]))$/,c1=/^(([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])$/,n1=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,i1=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,G8="((\\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])))",r1=new RegExp(`^${G8}$`);function C8(D){let F="[0-5]\\d";if(D.precision)F=`${F}\\.\\d{${D.precision}}`;else if(D.precision==null)F=`${F}(\\.\\d+)?`;let E=D.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${F})${E}`}function a1(D){return new RegExp(`^${C8(D)}$`)}function M8(D){let F=`${G8}T${C8(D)}`,E=[];if(E.push(D.local?"Z?":"Z"),D.offset)E.push("([+-]\\d{2}:?\\d{2})");return F=`${F}(${E.join("|")})`,new RegExp(`^${F}$`)}function o1(D,F){if((F==="v4"||!F)&&l1.test(D))return!0;if((F==="v6"||!F)&&d1.test(D))return!0;return!1}function s1(D,F){if(!y1.test(D))return!1;try{let[E]=D.split(".");if(!E)return!1;let B=E.replace(/-/g,"+").replace(/_/g,"/").padEnd(E.length+(4-E.length%4)%4,"="),$=JSON.parse(atob(B));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 t1(D,F){if((F==="v4"||!F)&&p1.test(D))return!0;if((F==="v6"||!F)&&c1.test(D))return!0;return!1}class ED 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:H.invalid_type,expected:_.string,received:$.parsedType}),j}let E=new m,B=void 0;for(let $ of this._def.checks)if($.kind==="min"){if(D.data.length<$.value)B=this._getOrReturnCtx(D,B),G(B,{code:H.too_small,minimum:$.value,type:"string",inclusive:!0,exact:!1,message:$.message}),E.dirty()}else if($.kind==="max"){if(D.data.length>$.value)B=this._getOrReturnCtx(D,B),G(B,{code:H.too_big,maximum:$.value,type:"string",inclusive:!0,exact:!1,message:$.message}),E.dirty()}else if($.kind==="length"){let q=D.data.length>$.value,X=D.data.length<$.value;if(q||X){if(B=this._getOrReturnCtx(D,B),q)G(B,{code:H.too_big,maximum:$.value,type:"string",inclusive:!0,exact:!0,message:$.message});else if(X)G(B,{code:H.too_small,minimum:$.value,type:"string",inclusive:!0,exact:!0,message:$.message});E.dirty()}}else if($.kind==="email"){if(!g1.test(D.data))B=this._getOrReturnCtx(D,B),G(B,{validation:"email",code:H.invalid_string,message:$.message}),E.dirty()}else if($.kind==="emoji"){if(!k0)k0=new RegExp(m1,"u");if(!k0.test(D.data))B=this._getOrReturnCtx(D,B),G(B,{validation:"emoji",code:H.invalid_string,message:$.message}),E.dirty()}else if($.kind==="uuid"){if(!Z1.test(D.data))B=this._getOrReturnCtx(D,B),G(B,{validation:"uuid",code:H.invalid_string,message:$.message}),E.dirty()}else if($.kind==="nanoid"){if(!x1.test(D.data))B=this._getOrReturnCtx(D,B),G(B,{validation:"nanoid",code:H.invalid_string,message:$.message}),E.dirty()}else if($.kind==="cuid"){if(!k1.test(D.data))B=this._getOrReturnCtx(D,B),G(B,{validation:"cuid",code:H.invalid_string,message:$.message}),E.dirty()}else if($.kind==="cuid2"){if(!f1.test(D.data))B=this._getOrReturnCtx(D,B),G(B,{validation:"cuid2",code:H.invalid_string,message:$.message}),E.dirty()}else if($.kind==="ulid"){if(!v1.test(D.data))B=this._getOrReturnCtx(D,B),G(B,{validation:"ulid",code:H.invalid_string,message:$.message}),E.dirty()}else if($.kind==="url")try{new URL(D.data)}catch{B=this._getOrReturnCtx(D,B),G(B,{validation:"url",code:H.invalid_string,message:$.message}),E.dirty()}else if($.kind==="regex"){if($.regex.lastIndex=0,!$.regex.test(D.data))B=this._getOrReturnCtx(D,B),G(B,{validation:"regex",code:H.invalid_string,message:$.message}),E.dirty()}else if($.kind==="trim")D.data=D.data.trim();else if($.kind==="includes"){if(!D.data.includes($.value,$.position))B=this._getOrReturnCtx(D,B),G(B,{code:H.invalid_string,validation:{includes:$.value,position:$.position},message:$.message}),E.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))B=this._getOrReturnCtx(D,B),G(B,{code:H.invalid_string,validation:{startsWith:$.value},message:$.message}),E.dirty()}else if($.kind==="endsWith"){if(!D.data.endsWith($.value))B=this._getOrReturnCtx(D,B),G(B,{code:H.invalid_string,validation:{endsWith:$.value},message:$.message}),E.dirty()}else if($.kind==="datetime"){if(!M8($).test(D.data))B=this._getOrReturnCtx(D,B),G(B,{code:H.invalid_string,validation:"datetime",message:$.message}),E.dirty()}else if($.kind==="date"){if(!r1.test(D.data))B=this._getOrReturnCtx(D,B),G(B,{code:H.invalid_string,validation:"date",message:$.message}),E.dirty()}else if($.kind==="time"){if(!a1($).test(D.data))B=this._getOrReturnCtx(D,B),G(B,{code:H.invalid_string,validation:"time",message:$.message}),E.dirty()}else if($.kind==="duration"){if(!h1.test(D.data))B=this._getOrReturnCtx(D,B),G(B,{validation:"duration",code:H.invalid_string,message:$.message}),E.dirty()}else if($.kind==="ip"){if(!o1(D.data,$.version))B=this._getOrReturnCtx(D,B),G(B,{validation:"ip",code:H.invalid_string,message:$.message}),E.dirty()}else if($.kind==="jwt"){if(!s1(D.data,$.alg))B=this._getOrReturnCtx(D,B),G(B,{validation:"jwt",code:H.invalid_string,message:$.message}),E.dirty()}else if($.kind==="cidr"){if(!t1(D.data,$.version))B=this._getOrReturnCtx(D,B),G(B,{validation:"cidr",code:H.invalid_string,message:$.message}),E.dirty()}else if($.kind==="base64"){if(!n1.test(D.data))B=this._getOrReturnCtx(D,B),G(B,{validation:"base64",code:H.invalid_string,message:$.message}),E.dirty()}else if($.kind==="base64url"){if(!i1.test(D.data))B=this._getOrReturnCtx(D,B),G(B,{validation:"base64url",code:H.invalid_string,message:$.message}),E.dirty()}else S.assertNever($);return{status:E.value,value:D.data}}_regex(D,F,E){return this.refinement((B)=>D.test(B),{validation:F,code:H.invalid_string,...A.errToObj(E)})}_addCheck(D){return new ED({...this._def,checks:[...this._def.checks,D]})}email(D){return this._addCheck({kind:"email",...A.errToObj(D)})}url(D){return this._addCheck({kind:"url",...A.errToObj(D)})}emoji(D){return this._addCheck({kind:"emoji",...A.errToObj(D)})}uuid(D){return this._addCheck({kind:"uuid",...A.errToObj(D)})}nanoid(D){return this._addCheck({kind:"nanoid",...A.errToObj(D)})}cuid(D){return this._addCheck({kind:"cuid",...A.errToObj(D)})}cuid2(D){return this._addCheck({kind:"cuid2",...A.errToObj(D)})}ulid(D){return this._addCheck({kind:"ulid",...A.errToObj(D)})}base64(D){return this._addCheck({kind:"base64",...A.errToObj(D)})}base64url(D){return this._addCheck({kind:"base64url",...A.errToObj(D)})}jwt(D){return this._addCheck({kind:"jwt",...A.errToObj(D)})}ip(D){return this._addCheck({kind:"ip",...A.errToObj(D)})}cidr(D){return this._addCheck({kind:"cidr",...A.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,...A.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,...A.errToObj(D?.message)})}duration(D){return this._addCheck({kind:"duration",...A.errToObj(D)})}regex(D,F){return this._addCheck({kind:"regex",regex:D,...A.errToObj(F)})}includes(D,F){return this._addCheck({kind:"includes",value:D,position:F?.position,...A.errToObj(F?.message)})}startsWith(D,F){return this._addCheck({kind:"startsWith",value:D,...A.errToObj(F)})}endsWith(D,F){return this._addCheck({kind:"endsWith",value:D,...A.errToObj(F)})}min(D,F){return this._addCheck({kind:"min",value:D,...A.errToObj(F)})}max(D,F){return this._addCheck({kind:"max",value:D,...A.errToObj(F)})}length(D,F){return this._addCheck({kind:"length",value:D,...A.errToObj(F)})}nonempty(D){return this.min(1,A.errToObj(D))}trim(){return new ED({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ED({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ED({...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}}ED.create=(D)=>{return new ED({checks:[],typeName:z.ZodString,coerce:D?.coerce??!1,...L(D)})};function e1(D,F){let E=(D.toString().split(".")[1]||"").length,B=(F.toString().split(".")[1]||"").length,$=E>B?E:B,q=Number.parseInt(D.toFixed($).replace(".","")),X=Number.parseInt(F.toFixed($).replace(".",""));return q%X/10**$}class ND 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:H.invalid_type,expected:_.number,received:$.parsedType}),j}let E=void 0,B=new m;for(let $ of this._def.checks)if($.kind==="int"){if(!S.isInteger(D.data))E=this._getOrReturnCtx(D,E),G(E,{code:H.invalid_type,expected:"integer",received:"float",message:$.message}),B.dirty()}else if($.kind==="min"){if($.inclusive?D.data<$.value:D.data<=$.value)E=this._getOrReturnCtx(D,E),G(E,{code:H.too_small,minimum:$.value,type:"number",inclusive:$.inclusive,exact:!1,message:$.message}),B.dirty()}else if($.kind==="max"){if($.inclusive?D.data>$.value:D.data>=$.value)E=this._getOrReturnCtx(D,E),G(E,{code:H.too_big,maximum:$.value,type:"number",inclusive:$.inclusive,exact:!1,message:$.message}),B.dirty()}else if($.kind==="multipleOf"){if(e1(D.data,$.value)!==0)E=this._getOrReturnCtx(D,E),G(E,{code:H.not_multiple_of,multipleOf:$.value,message:$.message}),B.dirty()}else if($.kind==="finite"){if(!Number.isFinite(D.data))E=this._getOrReturnCtx(D,E),G(E,{code:H.not_finite,message:$.message}),B.dirty()}else S.assertNever($);return{status:B.value,value:D.data}}gte(D,F){return this.setLimit("min",D,!0,A.toString(F))}gt(D,F){return this.setLimit("min",D,!1,A.toString(F))}lte(D,F){return this.setLimit("max",D,!0,A.toString(F))}lt(D,F){return this.setLimit("max",D,!1,A.toString(F))}setLimit(D,F,E,B){return new ND({...this._def,checks:[...this._def.checks,{kind:D,value:F,inclusive:E,message:A.toString(B)}]})}_addCheck(D){return new ND({...this._def,checks:[...this._def.checks,D]})}int(D){return this._addCheck({kind:"int",message:A.toString(D)})}positive(D){return this._addCheck({kind:"min",value:0,inclusive:!1,message:A.toString(D)})}negative(D){return this._addCheck({kind:"max",value:0,inclusive:!1,message:A.toString(D)})}nonpositive(D){return this._addCheck({kind:"max",value:0,inclusive:!0,message:A.toString(D)})}nonnegative(D){return this._addCheck({kind:"min",value:0,inclusive:!0,message:A.toString(D)})}multipleOf(D,F){return this._addCheck({kind:"multipleOf",value:D,message:A.toString(F)})}finite(D){return this._addCheck({kind:"finite",message:A.toString(D)})}safe(D){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:A.toString(D)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:A.toString(D)})}get minValue(){let D=null;for(let F of this._def.checks)if(F.kind==="min"){if(D===null||F.value>D)D=F.value}return D}get maxValue(){let D=null;for(let F of this._def.checks)if(F.kind==="max"){if(D===null||F.value<D)D=F.value}return D}get isInt(){return!!this._def.checks.find((D)=>D.kind==="int"||D.kind==="multipleOf"&&S.isInteger(D.value))}get isFinite(){let D=null,F=null;for(let E of this._def.checks)if(E.kind==="finite"||E.kind==="int"||E.kind==="multipleOf")return!0;else if(E.kind==="min"){if(F===null||E.value>F)F=E.value}else if(E.kind==="max"){if(D===null||E.value<D)D=E.value}return Number.isFinite(F)&&Number.isFinite(D)}}ND.create=(D)=>{return new ND({checks:[],typeName:z.ZodNumber,coerce:D?.coerce||!1,...L(D)})};class OD 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 E=void 0,B=new m;for(let $ of this._def.checks)if($.kind==="min"){if($.inclusive?D.data<$.value:D.data<=$.value)E=this._getOrReturnCtx(D,E),G(E,{code:H.too_small,type:"bigint",minimum:$.value,inclusive:$.inclusive,message:$.message}),B.dirty()}else if($.kind==="max"){if($.inclusive?D.data>$.value:D.data>=$.value)E=this._getOrReturnCtx(D,E),G(E,{code:H.too_big,type:"bigint",maximum:$.value,inclusive:$.inclusive,message:$.message}),B.dirty()}else if($.kind==="multipleOf"){if(D.data%$.value!==BigInt(0))E=this._getOrReturnCtx(D,E),G(E,{code:H.not_multiple_of,multipleOf:$.value,message:$.message}),B.dirty()}else S.assertNever($);return{status:B.value,value:D.data}}_getInvalidInput(D){let F=this._getOrReturnCtx(D);return G(F,{code:H.invalid_type,expected:_.bigint,received:F.parsedType}),j}gte(D,F){return this.setLimit("min",D,!0,A.toString(F))}gt(D,F){return this.setLimit("min",D,!1,A.toString(F))}lte(D,F){return this.setLimit("max",D,!0,A.toString(F))}lt(D,F){return this.setLimit("max",D,!1,A.toString(F))}setLimit(D,F,E,B){return new OD({...this._def,checks:[...this._def.checks,{kind:D,value:F,inclusive:E,message:A.toString(B)}]})}_addCheck(D){return new OD({...this._def,checks:[...this._def.checks,D]})}positive(D){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:A.toString(D)})}negative(D){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:A.toString(D)})}nonpositive(D){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:A.toString(D)})}nonnegative(D){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:A.toString(D)})}multipleOf(D,F){return this._addCheck({kind:"multipleOf",value:D,message:A.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}}OD.create=(D)=>{return new OD({checks:[],typeName:z.ZodBigInt,coerce:D?.coerce??!1,...L(D)})};class oD extends w{_parse(D){if(this._def.coerce)D.data=Boolean(D.data);if(this._getType(D)!==_.boolean){let E=this._getOrReturnCtx(D);return G(E,{code:H.invalid_type,expected:_.boolean,received:E.parsedType}),j}return l(D.data)}}oD.create=(D)=>{return new oD({typeName:z.ZodBoolean,coerce:D?.coerce||!1,...L(D)})};class xD 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:H.invalid_type,expected:_.date,received:$.parsedType}),j}if(Number.isNaN(D.data.getTime())){let $=this._getOrReturnCtx(D);return G($,{code:H.invalid_date}),j}let E=new m,B=void 0;for(let $ of this._def.checks)if($.kind==="min"){if(D.data.getTime()<$.value)B=this._getOrReturnCtx(D,B),G(B,{code:H.too_small,message:$.message,inclusive:!0,exact:!1,minimum:$.value,type:"date"}),E.dirty()}else if($.kind==="max"){if(D.data.getTime()>$.value)B=this._getOrReturnCtx(D,B),G(B,{code:H.too_big,message:$.message,inclusive:!0,exact:!1,maximum:$.value,type:"date"}),E.dirty()}else S.assertNever($);return{status:E.value,value:new Date(D.data.getTime())}}_addCheck(D){return new xD({...this._def,checks:[...this._def.checks,D]})}min(D,F){return this._addCheck({kind:"min",value:D.getTime(),message:A.toString(F)})}max(D,F){return this._addCheck({kind:"max",value:D.getTime(),message:A.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}}xD.create=(D)=>{return new xD({checks:[],coerce:D?.coerce||!1,typeName:z.ZodDate,...L(D)})};class j2 extends w{_parse(D){if(this._getType(D)!==_.symbol){let E=this._getOrReturnCtx(D);return G(E,{code:H.invalid_type,expected:_.symbol,received:E.parsedType}),j}return l(D.data)}}j2.create=(D)=>{return new j2({typeName:z.ZodSymbol,...L(D)})};class sD extends w{_parse(D){if(this._getType(D)!==_.undefined){let E=this._getOrReturnCtx(D);return G(E,{code:H.invalid_type,expected:_.undefined,received:E.parsedType}),j}return l(D.data)}}sD.create=(D)=>{return new sD({typeName:z.ZodUndefined,...L(D)})};class tD extends w{_parse(D){if(this._getType(D)!==_.null){let E=this._getOrReturnCtx(D);return G(E,{code:H.invalid_type,expected:_.null,received:E.parsedType}),j}return l(D.data)}}tD.create=(D)=>{return new tD({typeName:z.ZodNull,...L(D)})};class yD extends w{constructor(){super(...arguments);this._any=!0}_parse(D){return l(D.data)}}yD.create=(D)=>{return new yD({typeName:z.ZodAny,...L(D)})};class LD extends w{constructor(){super(...arguments);this._unknown=!0}_parse(D){return l(D.data)}}LD.create=(D)=>{return new LD({typeName:z.ZodUnknown,...L(D)})};class HD extends w{_parse(D){let F=this._getOrReturnCtx(D);return G(F,{code:H.invalid_type,expected:_.never,received:F.parsedType}),j}}HD.create=(D)=>{return new HD({typeName:z.ZodNever,...L(D)})};class z2 extends w{_parse(D){if(this._getType(D)!==_.undefined){let E=this._getOrReturnCtx(D);return G(E,{code:H.invalid_type,expected:_.void,received:E.parsedType}),j}return l(D.data)}}z2.create=(D)=>{return new z2({typeName:z.ZodVoid,...L(D)})};class BD extends w{_parse(D){let{ctx:F,status:E}=this._processInputParams(D),B=this._def;if(F.parsedType!==_.array)return G(F,{code:H.invalid_type,expected:_.array,received:F.parsedType}),j;if(B.exactLength!==null){let q=F.data.length>B.exactLength.value,X=F.data.length<B.exactLength.value;if(q||X)G(F,{code:q?H.too_big:H.too_small,minimum:X?B.exactLength.value:void 0,maximum:q?B.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:B.exactLength.message}),E.dirty()}if(B.minLength!==null){if(F.data.length<B.minLength.value)G(F,{code:H.too_small,minimum:B.minLength.value,type:"array",inclusive:!0,exact:!1,message:B.minLength.message}),E.dirty()}if(B.maxLength!==null){if(F.data.length>B.maxLength.value)G(F,{code:H.too_big,maximum:B.maxLength.value,type:"array",inclusive:!0,exact:!1,message:B.maxLength.message}),E.dirty()}if(F.common.async)return Promise.all([...F.data].map((q,X)=>{return B.type._parseAsync(new qD(F,q,F.path,X))})).then((q)=>{return m.mergeArray(E,q)});let $=[...F.data].map((q,X)=>{return B.type._parseSync(new qD(F,q,F.path,X))});return m.mergeArray(E,$)}get element(){return this._def.type}min(D,F){return new BD({...this._def,minLength:{value:D,message:A.toString(F)}})}max(D,F){return new BD({...this._def,maxLength:{value:D,message:A.toString(F)}})}length(D,F){return new BD({...this._def,exactLength:{value:D,message:A.toString(F)}})}nonempty(D){return this.min(1,D)}}BD.create=(D,F)=>{return new BD({type:D,minLength:null,maxLength:null,exactLength:null,typeName:z.ZodArray,...L(F)})};function rD(D){if(D instanceof x){let F={};for(let E in D.shape){let B=D.shape[E];F[E]=$D.create(rD(B))}return new x({...D._def,shape:()=>F})}else if(D instanceof BD)return new BD({...D._def,type:rD(D.element)});else if(D instanceof $D)return $D.create(rD(D.unwrap()));else if(D instanceof jD)return jD.create(rD(D.unwrap()));else if(D instanceof _D)return _D.create(D.items.map((F)=>rD(F)));else return D}class x extends w{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let D=this._def.shape(),F=S.objectKeys(D);return this._cached={shape:D,keys:F},this._cached}_parse(D){if(this._getType(D)!==_.object){let Q=this._getOrReturnCtx(D);return G(Q,{code:H.invalid_type,expected:_.object,received:Q.parsedType}),j}let{status:E,ctx:B}=this._processInputParams(D),{shape:$,keys:q}=this._getCached(),X=[];if(!(this._def.catchall instanceof HD&&this._def.unknownKeys==="strip")){for(let Q in B.data)if(!q.includes(Q))X.push(Q)}let J=[];for(let Q of q){let Y=$[Q],W=B.data[Q];J.push({key:{status:"valid",value:Q},value:Y._parse(new qD(B,W,B.path,Q)),alwaysSet:Q in B.data})}if(this._def.catchall instanceof HD){let Q=this._def.unknownKeys;if(Q==="passthrough")for(let Y of X)J.push({key:{status:"valid",value:Y},value:{status:"valid",value:B.data[Y]}});else if(Q==="strict"){if(X.length>0)G(B,{code:H.unrecognized_keys,keys:X}),E.dirty()}else if(Q==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let Q=this._def.catchall;for(let Y of X){let W=B.data[Y];J.push({key:{status:"valid",value:Y},value:Q._parse(new qD(B,W,B.path,Y)),alwaysSet:Y in B.data})}}if(B.common.async)return Promise.resolve().then(async()=>{let Q=[];for(let Y of J){let W=await Y.key,C=await Y.value;Q.push({key:W,value:C,alwaysSet:Y.alwaysSet})}return Q}).then((Q)=>{return m.mergeObjectSync(E,Q)});else return m.mergeObjectSync(E,J)}get shape(){return this._def.shape()}strict(D){return A.errToObj,new x({...this._def,unknownKeys:"strict",...D!==void 0?{errorMap:(F,E)=>{let B=this._def.errorMap?.(F,E).message??E.defaultError;if(F.code==="unrecognized_keys")return{message:A.errToObj(D).message??B};return{message:B}}}:{}})}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:z.ZodObject})}setKey(D,F){return this.augment({[D]:F})}catchall(D){return new x({...this._def,catchall:D})}pick(D){let F={};for(let E of S.objectKeys(D))if(D[E]&&this.shape[E])F[E]=this.shape[E];return new x({...this._def,shape:()=>F})}omit(D){let F={};for(let E of S.objectKeys(this.shape))if(!D[E])F[E]=this.shape[E];return new x({...this._def,shape:()=>F})}deepPartial(){return rD(this)}partial(D){let F={};for(let E of S.objectKeys(this.shape)){let B=this.shape[E];if(D&&!D[E])F[E]=B;else F[E]=B.optional()}return new x({...this._def,shape:()=>F})}required(D){let F={};for(let E of S.objectKeys(this.shape))if(D&&!D[E])F[E]=this.shape[E];else{let $=this.shape[E];while($ instanceof $D)$=$._def.innerType;F[E]=$}return new x({...this._def,shape:()=>F})}keyof(){return R8(S.objectKeys(this.shape))}}x.create=(D,F)=>{return new x({shape:()=>D,unknownKeys:"strip",catchall:HD.create(),typeName:z.ZodObject,...L(F)})};x.strictCreate=(D,F)=>{return new x({shape:()=>D,unknownKeys:"strict",catchall:HD.create(),typeName:z.ZodObject,...L(F)})};x.lazycreate=(D,F)=>{return new x({shape:D,unknownKeys:"strip",catchall:HD.create(),typeName:z.ZodObject,...L(F)})};class eD extends w{_parse(D){let{ctx:F}=this._processInputParams(D),E=this._def.options;function B($){for(let X of $)if(X.result.status==="valid")return X.result;for(let X of $)if(X.result.status==="dirty")return F.common.issues.push(...X.ctx.common.issues),X.result;let q=$.map((X)=>new d(X.ctx.common.issues));return G(F,{code:H.invalid_union,unionErrors:q}),j}if(F.common.async)return Promise.all(E.map(async($)=>{let q={...F,common:{...F.common,issues:[]},parent:null};return{result:await $._parseAsync({data:F.data,path:F.path,parent:q}),ctx:q}})).then(B);else{let $=void 0,q=[];for(let J of E){let Q={...F,common:{...F.common,issues:[]},parent:null},Y=J._parseSync({data:F.data,path:F.path,parent:Q});if(Y.status==="valid")return Y;else if(Y.status==="dirty"&&!$)$={result:Y,ctx:Q};if(Q.common.issues.length)q.push(Q.common.issues)}if($)return F.common.issues.push(...$.ctx.common.issues),$.result;let X=q.map((J)=>new d(J));return G(F,{code:H.invalid_union,unionErrors:X}),j}}get options(){return this._def.options}}eD.create=(D,F)=>{return new eD({options:D,typeName:z.ZodUnion,...L(F)})};var AD=(D)=>{if(D instanceof F2)return AD(D.schema);else if(D instanceof XD)return AD(D.innerType());else if(D instanceof E2)return[D.value];else if(D instanceof wD)return D.options;else if(D instanceof B2)return S.objectValues(D.enum);else if(D instanceof $2)return AD(D._def.innerType);else if(D instanceof sD)return[void 0];else if(D instanceof tD)return[null];else if(D instanceof $D)return[void 0,...AD(D.unwrap())];else if(D instanceof jD)return[null,...AD(D.unwrap())];else if(D instanceof g2)return AD(D.unwrap());else if(D instanceof X2)return AD(D.unwrap());else if(D instanceof q2)return AD(D._def.innerType);else return[]};class h2 extends w{_parse(D){let{ctx:F}=this._processInputParams(D);if(F.parsedType!==_.object)return G(F,{code:H.invalid_type,expected:_.object,received:F.parsedType}),j;let E=this.discriminator,B=F.data[E],$=this.optionsMap.get(B);if(!$)return G(F,{code:H.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[E]}),j;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,E){let B=new Map;for(let $ of F){let q=AD($.shape[D]);if(!q.length)throw Error(`A discriminator value for key \`${D}\` could not be extracted from all schema options`);for(let X of q){if(B.has(X))throw Error(`Discriminator property ${String(D)} has duplicate value ${String(X)}`);B.set(X,$)}}return new h2({typeName:z.ZodDiscriminatedUnion,discriminator:D,options:F,optionsMap:B,...L(E)})}}function f0(D,F){let E=WD(D),B=WD(F);if(D===F)return{valid:!0,data:D};else if(E===_.object&&B===_.object){let $=S.objectKeys(F),q=S.objectKeys(D).filter((J)=>$.indexOf(J)!==-1),X={...D,...F};for(let J of q){let Q=f0(D[J],F[J]);if(!Q.valid)return{valid:!1};X[J]=Q.data}return{valid:!0,data:X}}else if(E===_.array&&B===_.array){if(D.length!==F.length)return{valid:!1};let $=[];for(let q=0;q<D.length;q++){let X=D[q],J=F[q],Q=f0(X,J);if(!Q.valid)return{valid:!1};$.push(Q.data)}return{valid:!0,data:$}}else if(E===_.date&&B===_.date&&+D===+F)return{valid:!0,data:D};else return{valid:!1}}class D2 extends w{_parse(D){let{status:F,ctx:E}=this._processInputParams(D),B=($,q)=>{if(x2($)||x2(q))return j;let X=f0($.value,q.value);if(!X.valid)return G(E,{code:H.invalid_intersection_types}),j;if(y2($)||y2(q))F.dirty();return{status:F.value,value:X.data}};if(E.common.async)return Promise.all([this._def.left._parseAsync({data:E.data,path:E.path,parent:E}),this._def.right._parseAsync({data:E.data,path:E.path,parent:E})]).then(([$,q])=>B($,q));else return B(this._def.left._parseSync({data:E.data,path:E.path,parent:E}),this._def.right._parseSync({data:E.data,path:E.path,parent:E}))}}D2.create=(D,F,E)=>{return new D2({left:D,right:F,typeName:z.ZodIntersection,...L(E)})};class _D extends w{_parse(D){let{status:F,ctx:E}=this._processInputParams(D);if(E.parsedType!==_.array)return G(E,{code:H.invalid_type,expected:_.array,received:E.parsedType}),j;if(E.data.length<this._def.items.length)return G(E,{code:H.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),j;if(!this._def.rest&&E.data.length>this._def.items.length)G(E,{code:H.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),F.dirty();let $=[...E.data].map((q,X)=>{let J=this._def.items[X]||this._def.rest;if(!J)return null;return J._parse(new qD(E,q,E.path,X))}).filter((q)=>!!q);if(E.common.async)return Promise.all($).then((q)=>{return m.mergeArray(F,q)});else return m.mergeArray(F,$)}get items(){return this._def.items}rest(D){return new _D({...this._def,rest:D})}}_D.create=(D,F)=>{if(!Array.isArray(D))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new _D({items:D,typeName:z.ZodTuple,rest:null,...L(F)})};class U2 extends w{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(D){let{status:F,ctx:E}=this._processInputParams(D);if(E.parsedType!==_.object)return G(E,{code:H.invalid_type,expected:_.object,received:E.parsedType}),j;let B=[],$=this._def.keyType,q=this._def.valueType;for(let X in E.data)B.push({key:$._parse(new qD(E,X,E.path,X)),value:q._parse(new qD(E,E.data[X],E.path,X)),alwaysSet:X in E.data});if(E.common.async)return m.mergeObjectAsync(F,B);else return m.mergeObjectSync(F,B)}get element(){return this._def.valueType}static create(D,F,E){if(F instanceof w)return new U2({keyType:D,valueType:F,typeName:z.ZodRecord,...L(E)});return new U2({keyType:ED.create(),valueType:D,typeName:z.ZodRecord,...L(F)})}}class V2 extends w{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(D){let{status:F,ctx:E}=this._processInputParams(D);if(E.parsedType!==_.map)return G(E,{code:H.invalid_type,expected:_.map,received:E.parsedType}),j;let B=this._def.keyType,$=this._def.valueType,q=[...E.data.entries()].map(([X,J],Q)=>{return{key:B._parse(new qD(E,X,E.path,[Q,"key"])),value:$._parse(new qD(E,J,E.path,[Q,"value"]))}});if(E.common.async){let X=new Map;return Promise.resolve().then(async()=>{for(let J of q){let Q=await J.key,Y=await J.value;if(Q.status==="aborted"||Y.status==="aborted")return j;if(Q.status==="dirty"||Y.status==="dirty")F.dirty();X.set(Q.value,Y.value)}return{status:F.value,value:X}})}else{let X=new Map;for(let J of q){let{key:Q,value:Y}=J;if(Q.status==="aborted"||Y.status==="aborted")return j;if(Q.status==="dirty"||Y.status==="dirty")F.dirty();X.set(Q.value,Y.value)}return{status:F.value,value:X}}}}V2.create=(D,F,E)=>{return new V2({valueType:F,keyType:D,typeName:z.ZodMap,...L(E)})};class hD extends w{_parse(D){let{status:F,ctx:E}=this._processInputParams(D);if(E.parsedType!==_.set)return G(E,{code:H.invalid_type,expected:_.set,received:E.parsedType}),j;let B=this._def;if(B.minSize!==null){if(E.data.size<B.minSize.value)G(E,{code:H.too_small,minimum:B.minSize.value,type:"set",inclusive:!0,exact:!1,message:B.minSize.message}),F.dirty()}if(B.maxSize!==null){if(E.data.size>B.maxSize.value)G(E,{code:H.too_big,maximum:B.maxSize.value,type:"set",inclusive:!0,exact:!1,message:B.maxSize.message}),F.dirty()}let $=this._def.valueType;function q(J){let Q=new Set;for(let Y of J){if(Y.status==="aborted")return j;if(Y.status==="dirty")F.dirty();Q.add(Y.value)}return{status:F.value,value:Q}}let X=[...E.data.values()].map((J,Q)=>$._parse(new qD(E,J,E.path,Q)));if(E.common.async)return Promise.all(X).then((J)=>q(J));else return q(X)}min(D,F){return new hD({...this._def,minSize:{value:D,message:A.toString(F)}})}max(D,F){return new hD({...this._def,maxSize:{value:D,message:A.toString(F)}})}size(D,F){return this.min(D,F).max(D,F)}nonempty(D){return this.min(1,D)}}hD.create=(D,F)=>{return new hD({valueType:D,minSize:null,maxSize:null,typeName:z.ZodSet,...L(F)})};class aD 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:H.invalid_type,expected:_.function,received:F.parsedType}),j;function E(X,J){return A2({data:X,path:F.path,errorMaps:[F.common.contextualErrorMap,F.schemaErrorMap,nD(),RD].filter((Q)=>!!Q),issueData:{code:H.invalid_arguments,argumentsError:J}})}function B(X,J){return A2({data:X,path:F.path,errorMaps:[F.common.contextualErrorMap,F.schemaErrorMap,nD(),RD].filter((Q)=>!!Q),issueData:{code:H.invalid_return_type,returnTypeError:J}})}let $={errorMap:F.common.contextualErrorMap},q=F.data;if(this._def.returns instanceof gD){let X=this;return l(async function(...J){let Q=new d([]),Y=await X._def.args.parseAsync(J,$).catch((U)=>{throw Q.addIssue(E(J,U)),Q}),W=await Reflect.apply(q,this,Y);return await X._def.returns._def.type.parseAsync(W,$).catch((U)=>{throw Q.addIssue(B(W,U)),Q})})}else{let X=this;return l(function(...J){let Q=X._def.args.safeParse(J,$);if(!Q.success)throw new d([E(J,Q.error)]);let Y=Reflect.apply(q,this,Q.data),W=X._def.returns.safeParse(Y,$);if(!W.success)throw new d([B(Y,W.error)]);return W.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...D){return new aD({...this._def,args:_D.create(D).rest(LD.create())})}returns(D){return new aD({...this._def,returns:D})}implement(D){return this.parse(D)}strictImplement(D){return this.parse(D)}static create(D,F,E){return new aD({args:D?D:_D.create([]).rest(LD.create()),returns:F||LD.create(),typeName:z.ZodFunction,...L(E)})}}class F2 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})}}F2.create=(D,F)=>{return new F2({getter:D,typeName:z.ZodLazy,...L(F)})};class E2 extends w{_parse(D){if(D.data!==this._def.value){let F=this._getOrReturnCtx(D);return G(F,{received:F.data,code:H.invalid_literal,expected:this._def.value}),j}return{status:"valid",value:D.data}}get value(){return this._def.value}}E2.create=(D,F)=>{return new E2({value:D,typeName:z.ZodLiteral,...L(F)})};function R8(D,F){return new wD({values:D,typeName:z.ZodEnum,...L(F)})}class wD extends w{_parse(D){if(typeof D.data!=="string"){let F=this._getOrReturnCtx(D),E=this._def.values;return G(F,{expected:S.joinValues(E),received:F.parsedType,code:H.invalid_type}),j}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(D.data)){let F=this._getOrReturnCtx(D),E=this._def.values;return G(F,{received:F.data,code:H.invalid_enum_value,options:E}),j}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 wD.create(D,{...this._def,...F})}exclude(D,F=this._def){return wD.create(this.options.filter((E)=>!D.includes(E)),{...this._def,...F})}}wD.create=R8;class B2 extends w{_parse(D){let F=S.getValidEnumValues(this._def.values),E=this._getOrReturnCtx(D);if(E.parsedType!==_.string&&E.parsedType!==_.number){let B=S.objectValues(F);return G(E,{expected:S.joinValues(B),received:E.parsedType,code:H.invalid_type}),j}if(!this._cache)this._cache=new Set(S.getValidEnumValues(this._def.values));if(!this._cache.has(D.data)){let B=S.objectValues(F);return G(E,{received:E.data,code:H.invalid_enum_value,options:B}),j}return l(D.data)}get enum(){return this._def.values}}B2.create=(D,F)=>{return new B2({values:D,typeName:z.ZodNativeEnum,...L(F)})};class gD 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:H.invalid_type,expected:_.promise,received:F.parsedType}),j;let E=F.parsedType===_.promise?F.data:Promise.resolve(F.data);return l(E.then((B)=>{return this._def.type.parseAsync(B,{path:F.path,errorMap:F.common.contextualErrorMap})}))}}gD.create=(D,F)=>{return new gD({type:D,typeName:z.ZodPromise,...L(F)})};class XD extends w{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===z.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(D){let{status:F,ctx:E}=this._processInputParams(D),B=this._def.effect||null,$={addIssue:(q)=>{if(G(E,q),q.fatal)F.abort();else F.dirty()},get path(){return E.path}};if($.addIssue=$.addIssue.bind($),B.type==="preprocess"){let q=B.transform(E.data,$);if(E.common.async)return Promise.resolve(q).then(async(X)=>{if(F.value==="aborted")return j;let J=await this._def.schema._parseAsync({data:X,path:E.path,parent:E});if(J.status==="aborted")return j;if(J.status==="dirty")return ZD(J.value);if(F.value==="dirty")return ZD(J.value);return J});else{if(F.value==="aborted")return j;let X=this._def.schema._parseSync({data:q,path:E.path,parent:E});if(X.status==="aborted")return j;if(X.status==="dirty")return ZD(X.value);if(F.value==="dirty")return ZD(X.value);return X}}if(B.type==="refinement"){let q=(X)=>{let J=B.refinement(X,$);if(E.common.async)return Promise.resolve(J);if(J instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return X};if(E.common.async===!1){let X=this._def.schema._parseSync({data:E.data,path:E.path,parent:E});if(X.status==="aborted")return j;if(X.status==="dirty")F.dirty();return q(X.value),{status:F.value,value:X.value}}else return this._def.schema._parseAsync({data:E.data,path:E.path,parent:E}).then((X)=>{if(X.status==="aborted")return j;if(X.status==="dirty")F.dirty();return q(X.value).then(()=>{return{status:F.value,value:X.value}})})}if(B.type==="transform")if(E.common.async===!1){let q=this._def.schema._parseSync({data:E.data,path:E.path,parent:E});if(!KD(q))return j;let X=B.transform(q.value,$);if(X instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:F.value,value:X}}else return this._def.schema._parseAsync({data:E.data,path:E.path,parent:E}).then((q)=>{if(!KD(q))return j;return Promise.resolve(B.transform(q.value,$)).then((X)=>({status:F.value,value:X}))});S.assertNever(B)}}XD.create=(D,F,E)=>{return new XD({schema:D,typeName:z.ZodEffects,effect:F,...L(E)})};XD.createWithPreprocess=(D,F,E)=>{return new XD({schema:F,effect:{type:"preprocess",transform:D},typeName:z.ZodEffects,...L(E)})};class $D extends w{_parse(D){if(this._getType(D)===_.undefined)return l(void 0);return this._def.innerType._parse(D)}unwrap(){return this._def.innerType}}$D.create=(D,F)=>{return new $D({innerType:D,typeName:z.ZodOptional,...L(F)})};class jD extends w{_parse(D){if(this._getType(D)===_.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:z.ZodNullable,...L(F)})};class $2 extends w{_parse(D){let{ctx:F}=this._processInputParams(D),E=F.data;if(F.parsedType===_.undefined)E=this._def.defaultValue();return this._def.innerType._parse({data:E,path:F.path,parent:F})}removeDefault(){return this._def.innerType}}$2.create=(D,F)=>{return new $2({innerType:D,typeName:z.ZodDefault,defaultValue:typeof F.default==="function"?F.default:()=>F.default,...L(F)})};class q2 extends w{_parse(D){let{ctx:F}=this._processInputParams(D),E={...F,common:{...F.common,issues:[]}},B=this._def.innerType._parse({data:E.data,path:E.path,parent:{...E}});if(iD(B))return B.then(($)=>{return{status:"valid",value:$.status==="valid"?$.value:this._def.catchValue({get error(){return new d(E.common.issues)},input:E.data})}});else return{status:"valid",value:B.status==="valid"?B.value:this._def.catchValue({get error(){return new d(E.common.issues)},input:E.data})}}removeCatch(){return this._def.innerType}}q2.create=(D,F)=>{return new q2({innerType:D,typeName:z.ZodCatch,catchValue:typeof F.catch==="function"?F.catch:()=>F.catch,...L(F)})};class u2 extends w{_parse(D){if(this._getType(D)!==_.nan){let E=this._getOrReturnCtx(D);return G(E,{code:H.invalid_type,expected:_.nan,received:E.parsedType}),j}return{status:"valid",value:D.data}}}u2.create=(D)=>{return new u2({typeName:z.ZodNaN,...L(D)})};var DF=Symbol("zod_brand");class g2 extends w{_parse(D){let{ctx:F}=this._processInputParams(D),E=F.data;return this._def.type._parse({data:E,path:F.path,parent:F})}unwrap(){return this._def.type}}class K2 extends w{_parse(D){let{status:F,ctx:E}=this._processInputParams(D);if(E.common.async)return(async()=>{let $=await this._def.in._parseAsync({data:E.data,path:E.path,parent:E});if($.status==="aborted")return j;if($.status==="dirty")return F.dirty(),ZD($.value);else return this._def.out._parseAsync({data:$.value,path:E.path,parent:E})})();else{let B=this._def.in._parseSync({data:E.data,path:E.path,parent:E});if(B.status==="aborted")return j;if(B.status==="dirty")return F.dirty(),{status:"dirty",value:B.value};else return this._def.out._parseSync({data:B.value,path:E.path,parent:E})}}static create(D,F){return new K2({in:D,out:F,typeName:z.ZodPipeline})}}class X2 extends w{_parse(D){let F=this._def.innerType._parse(D),E=(B)=>{if(KD(B))B.value=Object.freeze(B.value);return B};return iD(F)?F.then((B)=>E(B)):E(F)}unwrap(){return this._def.innerType}}X2.create=(D,F)=>{return new X2({innerType:D,typeName:z.ZodReadonly,...L(F)})};function _8(D,F){let E=typeof D==="function"?D(F):typeof D==="string"?{message:D}:D;return typeof E==="string"?{message:E}:E}function A8(D,F={},E){if(D)return yD.create().superRefine((B,$)=>{let q=D(B);if(q instanceof Promise)return q.then((X)=>{if(!X){let J=_8(F,B),Q=J.fatal??E??!0;$.addIssue({code:"custom",...J,fatal:Q})}});if(!q){let X=_8(F,B),J=X.fatal??E??!0;$.addIssue({code:"custom",...X,fatal:J})}return});return yD.create()}var FF={object:x.lazycreate},z;(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"})(z||(z={}));var EF=(D,F={message:`Input not instance of ${D.name}`})=>A8((E)=>E instanceof D,F),j8=ED.create,z8=ND.create,BF=u2.create,$F=OD.create,U8=oD.create,qF=xD.create,XF=j2.create,JF=sD.create,QF=tD.create,YF=yD.create,WF=LD.create,HF=HD.create,_F=z2.create,GF=BD.create,CF=x.create,MF=x.strictCreate,RF=eD.create,AF=h2.create,jF=D2.create,zF=_D.create,UF=U2.create,VF=V2.create,uF=hD.create,KF=aD.create,LF=F2.create,NF=E2.create,OF=wD.create,wF=B2.create,SF=gD.create,IF=XD.create,PF=$D.create,TF=jD.create,bF=XD.createWithPreprocess,kF=K2.create,fF=()=>j8().optional(),vF=()=>z8().optional(),ZF=()=>U8().optional(),xF={string:(D)=>ED.create({...D,coerce:!0}),number:(D)=>ND.create({...D,coerce:!0}),boolean:(D)=>oD.create({...D,coerce:!0}),bigint:(D)=>OD.create({...D,coerce:!0}),date:(D)=>xD.create({...D,coerce:!0})};var yF=j;var hF=T.object({opus:T.string(),sonnet:T.string(),haiku:T.string()}),v0=T.object({apiUrl:T.string().url(),apiKey:T.string().min(1),defaultProfile:T.string().optional(),profiles:T.record(hF)});var Z0=V8(pF(),".claudio"),m2=V8(Z0,"config.json");function a(){return x0(m2)}async function o(){if(!x0(m2))throw Error('Config file not found. Run "claudio setup" first.');try{let D=mF(m2,"utf-8"),F=JSON.parse(D);return v0.parse(F)}catch(D){throw Error(`Failed to load config: ${D.message}`)}}async function L2(D){if(!x0(Z0))gF(Z0,{recursive:!0});try{let F=v0.parse(D),E=JSON.stringify(F,null,2);lF(m2,E,"utf-8")}catch(F){throw Error(`Failed to save config: ${F.message}`)}}function u8(){return"http://10.114.1.119:8317"}async function K8(){return(await o()).defaultProfile}async function L8(D){let F=await o();if(!F.profiles[D])throw Error(`Profile "${D}" not found`);F.defaultProfile=D,await L2(F)}async function N8(D){let F=await o();if(!F.profiles[D])throw Error(`Profile "${D}" not found`);if(delete F.profiles[D],F.defaultProfile===D)F.defaultProfile=void 0;await L2(F)}async function O8(){let D=await o();return Object.entries(D.profiles).map(([F,E])=>({name:F,profile:E,isDefault:D.defaultProfile===F}))}async function y0(D){return(await o()).profiles[D]}async function h0(D){let{message:F,models:E}=D,B=E.map((q)=>q.id);return await T0({message:F,source:async(q)=>{let X=(q||"").toLowerCase();return B.filter((Q)=>Q.toLowerCase().includes(X)).map((Q)=>({name:Q,value:Q}))}})}async function g0(D){let F=await h0({message:"Select OPUS model:",models:D}),E=await h0({message:"Select SONNET model:",models:D}),B=await h0({message:"Select HAIKU model:",models:D});return{opus:F,sonnet:E,haiku:B}}async function l2(D,F){return S0({message:D,default:F})}async function w8(D,F=!1){return w0({message:D,default:F})}async function S8(){console.log(`
33
+ `)}function j2(){return b3.default({defaultWidth:80,output:r2().output})}function sF({active:D,renderedItems:F,pageSize:E,loop:B}){let $=M2({lastPointer:D,lastActive:void 0}),{lastPointer:q,lastActive:C}=$.current,X=Math.floor(E/2),Q=F.reduce((H,j)=>H+j.length,0),J=F.slice(0,D).reduce((H,j)=>H+j.length,0),_=J;if(Q>E)if(B){if(_=q,C!=null&&C<D&&D-C<E)_=Math.min(X,Math.abs(D-C)===1?Math.min(q+(F[C]?.length??0),Math.max(J,q)):q+D-C)}else{let H=F.slice(D).reduce((j,z)=>j+z.length,0);_=H<E-X?E-H:Math.min(J,X)}return $.current.lastPointer=_,$.current.lastActive=D,_}function q0({items:D,active:F,renderItem:E,pageSize:B,loop:$=!0}){let q=j2(),C=(U)=>(U%D.length+D.length)%D.length,X=D.map((U,S)=>{if(U==null)return[];return B2(E({item:U,index:S,isActive:S===F}),q).split(`
34
+ `)}),Q=X.reduce((U,S)=>U+S.length,0),J=(U)=>X[U]??[],_=sF({active:F,renderedItems:X,pageSize:B,loop:$}),H=J(F).slice(0,B),j=_+H.length<=B?_:B-H.length,z=Array.from({length:B});z.splice(j,H.length,...H);let w=new Set([F]),I=j+H.length,b=C(F+1);while(I<B&&!w.has(b)&&($&&Q>B?b!==F:b>F)){let S=J(b).slice(0,B-I);z.splice(I,S.length,...S),w.add(b),I+=S.length,b=C(b+1)}I=j-1,b=C(F-1);while(I>=0&&!w.has(b)&&($&&Q>B?b!==F:b<F)){let U=J(b),S=U.slice(Math.max(0,U.length-I-1));z.splice(I-S.length+1,S.length,...S),w.add(b),I-=S.length,b=C(b-1)}return z.filter((U)=>typeof U==="string").join(`
35
+ `)}var c3=zD(f3(),1);import*as p3 from"readline";import{AsyncResource as $6}from"async_hooks";var VD=[];VD.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")VD.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")VD.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var U2=(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",C0=Symbol.for("signal-exit emitter"),X0=globalThis,eF=Object.defineProperty.bind(Object);class v3{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(X0[C0])return X0[C0];eF(X0,C0,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(D,F){this.listeners[D].push(F)}removeListener(D,F){let E=this.listeners[D],B=E.indexOf(F);if(B===-1)return;if(B===0&&E.length===1)E.length=0;else E.splice(B,1)}emit(D,F,E){if(this.emitted[D])return!1;this.emitted[D]=!0;let B=!1;for(let $ of this.listeners[D])B=$(F,E)===!0||B;if(D==="exit")B=this.emit("afterExit",F,E)||B;return B}}class J0{}var D6=(D)=>{return{onExit(F,E){return D.onExit(F,E)},load(){return D.load()},unload(){return D.unload()}}};class Z3 extends J0{onExit(){return()=>{}}load(){}unload(){}}class x3 extends J0{#E=Q0.platform==="win32"?"SIGINT":"SIGHUP";#F=new v3;#D;#q;#C;#$={};#B=!1;constructor(D){super();this.#D=D,this.#$={};for(let F of VD)this.#$[F]=()=>{let E=this.#D.listeners(F),{count:B}=this.#F,$=D;if(typeof $.__signal_exit_emitter__==="object"&&typeof $.__signal_exit_emitter__.count==="number")B+=$.__signal_exit_emitter__.count;if(E.length===B){this.unload();let q=this.#F.emit("exit",null,F),C=F==="SIGHUP"?this.#E:F;if(!q)D.kill(D.pid,C)}};this.#C=D.reallyExit,this.#q=D.emit}onExit(D,F){if(!U2(this.#D))return()=>{};if(this.#B===!1)this.load();let E=F?.alwaysLast?"afterExit":"exit";return this.#F.on(E,D),()=>{if(this.#F.removeListener(E,D),this.#F.listeners.exit.length===0&&this.#F.listeners.afterExit.length===0)this.unload()}}load(){if(this.#B)return;this.#B=!0,this.#F.count+=1;for(let D of VD)try{let F=this.#$[D];if(F)this.#D.on(D,F)}catch(F){}this.#D.emit=(D,...F)=>{return this.#Q(D,...F)},this.#D.reallyExit=(D)=>{return this.#X(D)}}unload(){if(!this.#B)return;this.#B=!1,VD.forEach((D)=>{let F=this.#$[D];if(!F)throw Error("Listener not defined for signal: "+D);try{this.#D.removeListener(D,F)}catch(E){}}),this.#D.emit=this.#q,this.#D.reallyExit=this.#C,this.#F.count-=1}#X(D){if(!U2(this.#D))return 0;return this.#D.exitCode=D||0,this.#F.emit("exit",this.#D.exitCode,null),this.#C.call(this.#D,this.#D.exitCode)}#Q(D,...F){let E=this.#q;if(D==="exit"&&U2(this.#D)){if(typeof F[0]==="number")this.#D.exitCode=F[0];let B=E.call(this.#D,D,...F);return this.#F.emit("exit",this.#D.exitCode,null),B}else return E.call(this.#D,D,...F)}}var Q0=globalThis.process,{onExit:y3,load:i5,unload:r5}=D6(U2(Q0)?new x3(Q0):new Z3);import{stripVTControlCharacters as E6}from"util";var F6="\x1B[G",g3="\x1B[?25l",m3="\x1B[?25h",_0=(D=1)=>D>0?`\x1B[${D}A`:"",Y0=(D=1)=>D>0?`\x1B[${D}B`:"",W0=(D,F)=>{if(typeof F==="number"&&!Number.isNaN(F))return`\x1B[${F+1};${D+1}H`;return`\x1B[${D+1}G`},h3="\x1B[2K",G0=(D)=>D>0?(h3+_0(1)).repeat(D-1)+h3+F6:"";var l3=(D)=>D.split(`
36
+ `).length,B6=(D)=>D.split(`
37
+ `).pop()??"";class L2{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 E=B6(D),B=E6(E),$=B;if(this.rl.line.length>0)$=$.slice(0,-this.rl.line.length);this.rl.setPrompt($),this.cursorPos=this.rl.getCursorPos();let q=j2();if(D=B2(D,q),F=B2(F,q),B.length%q===0)D+=`
38
+ `;let C=D+(F?`
39
+ `+F:""),Q=Math.floor(B.length/q)-this.cursorPos.rows+(F?l3(F):0);if(Q>0)C+=_0(Q);C+=W0(this.cursorPos.cols),this.write(Y0(this.extraLinesUnderPrompt)+G0(this.height)+C),this.extraLinesUnderPrompt=Q,this.height=l3(C)}checkCursorPos(){let D=this.rl.getCursorPos();if(D.cols!==this.cursorPos.cols)this.write(W0(D.cols)),this.cursorPos=D}done({clearContent:D}){this.rl.setPrompt("");let F=Y0(this.extraLinesUnderPrompt);F+=D?G0(this.height):`
40
+ `,F+=m3,this.write(F),this.rl.close()}}class H0 extends Promise{static withResolver(){let D,F;return{promise:new Promise((B,$)=>{D=B,F=$}),resolve:D,reject:F}}}function q6(){let D=Error.prepareStackTrace,F=[];try{Error.prepareStackTrace=(E,B)=>{let $=B.slice(1);return F=$,$},Error().stack}catch{return F}return Error.prepareStackTrace=D,F}function JD(D){let F=q6();return(B,$={})=>{let{input:q=process.stdin,signal:C}=$,X=new Set,Q=new c3.default;Q.pipe($.output??process.stdout);let J=p3.createInterface({terminal:!0,input:q,output:Q}),_=new L2(J),{promise:H,resolve:j,reject:z}=H0.withResolver(),w=()=>z(new d2);if(C){let U=()=>z(new c2({cause:C.reason}));if(C.aborted)return U(),Object.assign(H,{cancel:w});C.addEventListener("abort",U),X.add(()=>C.removeEventListener("abort",U))}X.add(y3((U,S)=>{z(new u2(`User force closed the prompt with ${U} ${S}`))}));let I=()=>z(new u2("User force closed the prompt with SIGINT"));J.on("SIGINT",I),X.add(()=>J.removeListener("SIGINT",I));let b=()=>_.checkCursorPos();return J.input.on("keypress",b),X.add(()=>J.input.removeListener("keypress",b)),r0(J,(U)=>{let S=$6.bind(()=>LD.clearAll());return J.on("close",S),X.add(()=>J.removeListener("close",S)),U(()=>{try{let T=D(B,(bD)=>{setImmediate(()=>j(bD))});if(T===void 0){let bD=F[1]?.getFileName();throw Error(`Prompt functions must return a string.
41
+ at ${bD}`)}let[t,e]=typeof T==="string"?[T]:T;_.render(t,e),LD.run()}catch(T){z(T)}}),Object.assign(H.then((T)=>{return LD.clearAll(),T},(T)=>{throw LD.clearAll(),T}).finally(()=>{X.forEach((T)=>T()),_.done({clearContent:Boolean($.clearPromptOnDone)}),Q.end()}).then(()=>H),{cancel:w})})}}var d3=zD(A2(),1);class xD{separator=d3.default.dim(Array.from({length:15}).join(TD.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 n3(D,F){let E=F!==!1;if(/^(y|yes)/i.test(D))E=!0;else if(/^(n|no)/i.test(D))E=!1;return E}function i3(D){return D?"Yes":"No"}var u0=JD((D,F)=>{let{transformer:E=i3}=D,[B,$]=P("idle"),[q,C]=P(""),X=n(D.theme),Q=XD({status:B,theme:X});QD((j,z)=>{if(B!=="idle")return;if(qD(j)){let w=n3(q,D.default);C(E(w)),$("done"),F(w)}else if(jD(j)){let w=i3(!n3(q,D.default));z.clearLine(0),z.write(w),C(w)}else C(z.line)});let J=q,_="";if(B==="done")J=X.style.answer(q);else _=` ${X.style.defaultAnswer(D.default===!1?"y/N":"Y/n")}`;let H=X.style.message(D.message,B);return`${Q} ${H}${_} ${J}`});var C6={validationFailureMode:"keep"},A0=JD((D,F)=>{let{prefill:E="tab"}=D,B=n(C6,D.theme),[$,q]=P("idle"),[C="",X]=P(D.default),[Q,J]=P(),[_,H]=P(""),j=XD({status:$,theme:B});async function z(S){let{required:T,pattern:t,patternError:e="Invalid input"}=D;if(T&&!S)return"You must provide a value";if(t&&!t.test(S))return e;if(typeof D.validate==="function")return await D.validate(S)||"You must provide a valid value";return!0}QD(async(S,T)=>{if($!=="idle")return;if(qD(S)){let t=_||C;q("loading");let e=await z(t);if(e===!0)H(t),q("done"),F(t);else{if(B.validationFailureMode==="clear")H("");else T.write(_);J(e),q("idle")}}else if(p2(S)&&!_)X(void 0);else if(jD(S)&&!_)X(void 0),T.clearLine(0),T.write(C),H(C);else H(T.line),J(void 0)}),CD((S)=>{if(E==="editable"&&C)S.write(C),H(C)},[]);let w=B.style.message(D.message,$),I=_;if(typeof D.transformer==="function")I=D.transformer(_,{isFinal:$==="done"});else if($==="done")I=B.style.answer(_);let b;if(C&&$!=="done"&&!_)b=B.style.defaultAnswer(C);let U="";if(Q)U=B.style.error(Q);return[[j,w,b,I].filter((S)=>S!==void 0).join(" "),U]});var M0=JD((D,F)=>{let{validate:E=()=>!0}=D,B=n(D.theme),[$,q]=P("idle"),[C,X]=P(),[Q,J]=P(""),_=XD({status:$,theme:B});QD(async(I,b)=>{if($!=="idle")return;if(qD(I)){let U=Q;q("loading");let S=await E(U);if(S===!0)J(U),q("done"),F(U);else b.write(Q),X(S||"You must provide a valid value"),q("idle")}else J(b.line),X(void 0)});let H=B.style.message(D.message,$),j="",z;if(D.mask)j=(typeof D.mask==="string"?D.mask:"*").repeat(Q.length);else if($!=="done")z=`${B.style.help("[input is masked]")}${g3}`;if($==="done")j=B.style.answer(j);let w="";if(C)w=B.style.error(C);return[[_,H,D.mask?j:z].join(" "),w]});var ND=zD(A2(),1);var X6={icon:{cursor:TD.pointer},style:{disabled:(D)=>ND.default.dim(`- ${D}`),searchTerm:(D)=>ND.default.cyan(D),description:(D)=>ND.default.cyan(D),keysHelpTip:(D)=>D.map(([F,E])=>`${ND.default.bold(F)} ${ND.default.dim(E)}`).join(ND.default.dim(" \u2022 "))},helpMode:"always"};function R0(D){return!xD.isSeparator(D)&&!D.disabled}function Q6(D){return D.map((F)=>{if(xD.isSeparator(F))return F;if(typeof F==="string")return{value:F,name:F,short:F,disabled:!1};let E=F.name??String(F.value),B={value:F.value,name:E,short:F.short??E,disabled:F.disabled??!1};if(F.description)B.description=F.description;return B})}var z0=JD((D,F)=>{let{pageSize:E=7,validate:B=()=>!0}=D,$=n(X6,D.theme),[q,C]=P("loading"),[X,Q]=P(""),[J,_]=P([]),[H,j]=P(),z=XD({status:q,theme:$}),w=o2(()=>{let k=J.findIndex(R0),h=J.findLastIndex(R0);return{first:k,last:h}},[J]),[I=w.first,b]=P();CD(()=>{let k=new AbortController;return C("loading"),j(void 0),(async()=>{try{let d=await D.source(X||void 0,{signal:k.signal});if(!k.signal.aborted)b(void 0),j(void 0),_(Q6(d)),C("idle")}catch(d){if(!k.signal.aborted&&d instanceof Error)j(d.message)}})(),()=>{k.abort()}},[X]);let U=J[I];QD(async(k,h)=>{if(qD(k))if(U){C("loading");let d=await B(U.value);if(C("idle"),d===!0)C("done"),F(U.value);else if(U.name===X)j(d||"You must provide a valid value");else h.write(U.name),Q(U.name)}else h.write(X);else if(jD(k)&&U)h.clearLine(0),h.write(U.name),Q(U.name);else if(q!=="loading"&&(D2(k)||H2(k))){if(h.clearLine(0),D2(k)&&I!==w.first||H2(k)&&I!==w.last){let d=D2(k)?-1:1,kD=I;do kD=(kD+d+J.length)%J.length;while(!R0(J[kD]));b(kD)}}else Q(h.line)});let S=$.style.message(D.message,q),T;if($.helpMode!=="never")if(D.instructions){let{pager:k,navigation:h}=D.instructions;T=$.style.help(J.length>E?k:h)}else T=$.style.keysHelpTip([["\u2191\u2193","navigate"],["\u23CE","select"]]);let t=q0({items:J,active:I,renderItem({item:k,isActive:h}){if(xD.isSeparator(k))return` ${k.separator}`;if(k.disabled){let T2=typeof k.disabled==="string"?k.disabled:"(disabled)";return $.style.disabled(`${k.name} ${T2}`)}let d=h?$.style.highlight:(T2)=>T2,kD=h?$.icon.cursor:" ";return d(`${kD} ${k.name}`)},pageSize:E,loop:!1}),e;if(H)e=$.style.error(H);else if(J.length===0&&X!==""&&q==="idle")e=$.style.error("No results found");let bD;if(q==="done"&&U)return[z,S,$.style.answer(U.short)].filter(Boolean).join(" ").trimEnd();else bD=$.style.searchTerm(X);let I0=U?.description,V8=[z,S,bD].filter(Boolean).join(" ").trimEnd(),N8=[e??t," ",I0?$.style.description(I0):"",T].filter(Boolean).join(`
42
+ `).trimEnd();return[V8,N8]});async function $2(D,F){try{try{new URL(D)}catch{return{success:!1,error:"invalid_url",message:`Invalid URL format: ${D}`}}let E=await fetch(`${D}/v1/models`,{method:"GET",headers:{Authorization:`Bearer ${F}`,"Content-Type":"application/json"}});if(E.status===401||E.status===403)return{success:!1,error:"auth_failure",message:"Authentication failed. Check your API key."};if(!E.ok)return{success:!1,error:"unknown",message:`Server returned ${E.status}: ${E.statusText}`};let $=(await E.json()).data||[];return{success:!0,modelCount:$.length,models:$}}catch(E){if(E.cause?.code==="ECONNREFUSED"||E.message?.includes("ECONNREFUSED"))return{success:!1,error:"network_error",message:`Connection refused. Is the server running at ${D}?`};if(E.cause?.code==="ENOTFOUND"||E.message?.includes("ENOTFOUND"))return{success:!1,error:"network_error",message:`Could not resolve hostname. Check the URL: ${D}`};if(E.name==="AbortError"||E.message?.includes("timeout"))return{success:!1,error:"network_error",message:"Connection timed out. Check your network and the server URL."};return{success:!1,error:"network_error",message:`Network error: ${E.message||"Unknown error"}`}}}import{existsSync as K0,mkdirSync as j1,readFileSync as U1,writeFileSync as L1,unlinkSync as AE}from"fs";import{homedir as V1}from"os";import{join as q8}from"path";var l={};I8(l,{void:()=>n6,util:()=>O,unknown:()=>c6,union:()=>o6,undefined:()=>m6,tuple:()=>e6,transformer:()=>J1,symbol:()=>g6,string:()=>E8,strictObject:()=>a6,setErrorMap:()=>Y6,set:()=>E1,record:()=>D1,quotelessJson:()=>J6,promise:()=>Q1,preprocess:()=>W1,pipeline:()=>G1,ostring:()=>H1,optional:()=>_1,onumber:()=>u1,oboolean:()=>A1,objectUtil:()=>j0,object:()=>r6,number:()=>B8,nullable:()=>Y1,null:()=>l6,never:()=>d6,nativeEnum:()=>X1,nan:()=>x6,map:()=>F1,makeIssue:()=>q2,literal:()=>q1,lazy:()=>$1,late:()=>v6,isValid:()=>HD,isDirty:()=>N2,isAsync:()=>hD,isAborted:()=>V2,intersection:()=>t6,instanceof:()=>Z6,getParsedType:()=>FD,getErrorMap:()=>yD,function:()=>B1,enum:()=>C1,effect:()=>J1,discriminatedUnion:()=>s6,defaultErrorMap:()=>_D,datetimeRegex:()=>e3,date:()=>h6,custom:()=>F8,coerce:()=>M1,boolean:()=>$8,bigint:()=>y6,array:()=>i6,any:()=>p6,addIssueToContext:()=>G,ZodVoid:()=>X2,ZodUnknown:()=>uD,ZodUnion:()=>dD,ZodUndefined:()=>pD,ZodType:()=>K,ZodTuple:()=>BD,ZodTransformer:()=>s,ZodSymbol:()=>C2,ZodString:()=>i,ZodSet:()=>wD,ZodSchema:()=>K,ZodRecord:()=>Q2,ZodReadonly:()=>tD,ZodPromise:()=>ID,ZodPipeline:()=>Y2,ZodParsedType:()=>W,ZodOptional:()=>a,ZodObject:()=>f,ZodNumber:()=>AD,ZodNullable:()=>WD,ZodNull:()=>cD,ZodNever:()=>ED,ZodNativeEnum:()=>aD,ZodNaN:()=>_2,ZodMap:()=>J2,ZodLiteral:()=>rD,ZodLazy:()=>iD,ZodIssueCode:()=>Y,ZodIntersection:()=>nD,ZodFunction:()=>mD,ZodFirstPartyTypeKind:()=>R,ZodError:()=>g,ZodEnum:()=>RD,ZodEffects:()=>s,ZodDiscriminatedUnion:()=>K2,ZodDefault:()=>oD,ZodDate:()=>OD,ZodCatch:()=>sD,ZodBranded:()=>O2,ZodBoolean:()=>lD,ZodBigInt:()=>MD,ZodArray:()=>r,ZodAny:()=>SD,Schema:()=>K,ParseStatus:()=>x,OK:()=>y,NEVER:()=>R1,INVALID:()=>M,EMPTY_PATH:()=>W6,DIRTY:()=>KD,BRAND:()=>f6});var O;(function(D){D.assertEqual=($)=>{};function F($){}D.assertIs=F;function E($){throw Error()}D.assertNever=E,D.arrayToEnum=($)=>{let q={};for(let C of $)q[C]=C;return q},D.getValidEnumValues=($)=>{let q=D.objectKeys($).filter((X)=>typeof $[$[X]]!=="number"),C={};for(let X of q)C[X]=$[X];return D.objectValues(C)},D.objectValues=($)=>{return D.objectKeys($).map(function(q){return $[q]})},D.objectKeys=typeof Object.keys==="function"?($)=>Object.keys($):($)=>{let q=[];for(let C in $)if(Object.prototype.hasOwnProperty.call($,C))q.push(C);return q},D.find=($,q)=>{for(let C of $)if(q(C))return C;return},D.isInteger=typeof Number.isInteger==="function"?($)=>Number.isInteger($):($)=>typeof $==="number"&&Number.isFinite($)&&Math.floor($)===$;function B($,q=" | "){return $.map((C)=>typeof C==="string"?`'${C}'`:C).join(q)}D.joinValues=B,D.jsonStringifyReplacer=($,q)=>{if(typeof q==="bigint")return q.toString();return q}})(O||(O={}));var j0;(function(D){D.mergeShapes=(F,E)=>{return{...F,...E}}})(j0||(j0={}));var W=O.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),FD=(D)=>{switch(typeof D){case"undefined":return W.undefined;case"string":return W.string;case"number":return Number.isNaN(D)?W.nan:W.number;case"boolean":return W.boolean;case"function":return W.function;case"bigint":return W.bigint;case"symbol":return W.symbol;case"object":if(Array.isArray(D))return W.array;if(D===null)return W.null;if(D.then&&typeof D.then==="function"&&D.catch&&typeof D.catch==="function")return W.promise;if(typeof Map<"u"&&D instanceof Map)return W.map;if(typeof Set<"u"&&D instanceof Set)return W.set;if(typeof Date<"u"&&D instanceof Date)return W.date;return W.object;default:return W.unknown}};var Y=O.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"]),J6=(D)=>{return JSON.stringify(D,null,2).replace(/"([^"]+)":/g,"$1:")};class g extends Error{get errors(){return this.issues}constructor(D){super();this.issues=[],this.addIssue=(E)=>{this.issues=[...this.issues,E]},this.addIssues=(E=[])=>{this.issues=[...this.issues,...E]};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},E={_errors:[]},B=($)=>{for(let q of $.issues)if(q.code==="invalid_union")q.unionErrors.map(B);else if(q.code==="invalid_return_type")B(q.returnTypeError);else if(q.code==="invalid_arguments")B(q.argumentsError);else if(q.path.length===0)E._errors.push(F(q));else{let C=E,X=0;while(X<q.path.length){let Q=q.path[X];if(X!==q.path.length-1)C[Q]=C[Q]||{_errors:[]};else C[Q]=C[Q]||{_errors:[]},C[Q]._errors.push(F(q));C=C[Q],X++}}};return B(this),E}static assert(D){if(!(D instanceof g))throw Error(`Not a ZodError: ${D}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,O.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(D=(F)=>F.message){let F={},E=[];for(let B of this.issues)if(B.path.length>0){let $=B.path[0];F[$]=F[$]||[],F[$].push(D(B))}else E.push(D(B));return{formErrors:E,fieldErrors:F}}get formErrors(){return this.flatten()}}g.create=(D)=>{return new g(D)};var _6=(D,F)=>{let E;switch(D.code){case Y.invalid_type:if(D.received===W.undefined)E="Required";else E=`Expected ${D.expected}, received ${D.received}`;break;case Y.invalid_literal:E=`Invalid literal value, expected ${JSON.stringify(D.expected,O.jsonStringifyReplacer)}`;break;case Y.unrecognized_keys:E=`Unrecognized key(s) in object: ${O.joinValues(D.keys,", ")}`;break;case Y.invalid_union:E="Invalid input";break;case Y.invalid_union_discriminator:E=`Invalid discriminator value. Expected ${O.joinValues(D.options)}`;break;case Y.invalid_enum_value:E=`Invalid enum value. Expected ${O.joinValues(D.options)}, received '${D.received}'`;break;case Y.invalid_arguments:E="Invalid function arguments";break;case Y.invalid_return_type:E="Invalid function return type";break;case Y.invalid_date:E="Invalid date";break;case Y.invalid_string:if(typeof D.validation==="object")if("includes"in D.validation){if(E=`Invalid input: must include "${D.validation.includes}"`,typeof D.validation.position==="number")E=`${E} at one or more positions greater than or equal to ${D.validation.position}`}else if("startsWith"in D.validation)E=`Invalid input: must start with "${D.validation.startsWith}"`;else if("endsWith"in D.validation)E=`Invalid input: must end with "${D.validation.endsWith}"`;else O.assertNever(D.validation);else if(D.validation!=="regex")E=`Invalid ${D.validation}`;else E="Invalid";break;case Y.too_small:if(D.type==="array")E=`Array must contain ${D.exact?"exactly":D.inclusive?"at least":"more than"} ${D.minimum} element(s)`;else if(D.type==="string")E=`String must contain ${D.exact?"exactly":D.inclusive?"at least":"over"} ${D.minimum} character(s)`;else if(D.type==="number")E=`Number must be ${D.exact?"exactly equal to ":D.inclusive?"greater than or equal to ":"greater than "}${D.minimum}`;else if(D.type==="bigint")E=`Number must be ${D.exact?"exactly equal to ":D.inclusive?"greater than or equal to ":"greater than "}${D.minimum}`;else if(D.type==="date")E=`Date must be ${D.exact?"exactly equal to ":D.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(D.minimum))}`;else E="Invalid input";break;case Y.too_big:if(D.type==="array")E=`Array must contain ${D.exact?"exactly":D.inclusive?"at most":"less than"} ${D.maximum} element(s)`;else if(D.type==="string")E=`String must contain ${D.exact?"exactly":D.inclusive?"at most":"under"} ${D.maximum} character(s)`;else if(D.type==="number")E=`Number must be ${D.exact?"exactly":D.inclusive?"less than or equal to":"less than"} ${D.maximum}`;else if(D.type==="bigint")E=`BigInt must be ${D.exact?"exactly":D.inclusive?"less than or equal to":"less than"} ${D.maximum}`;else if(D.type==="date")E=`Date must be ${D.exact?"exactly":D.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(D.maximum))}`;else E="Invalid input";break;case Y.custom:E="Invalid input";break;case Y.invalid_intersection_types:E="Intersection results could not be merged";break;case Y.not_multiple_of:E=`Number must be a multiple of ${D.multipleOf}`;break;case Y.not_finite:E="Number must be finite";break;default:E=F.defaultError,O.assertNever(D)}return{message:E}},_D=_6;var r3=_D;function Y6(D){r3=D}function yD(){return r3}var q2=(D)=>{let{data:F,path:E,errorMaps:B,issueData:$}=D,q=[...E,...$.path||[]],C={...$,path:q};if($.message!==void 0)return{...$,path:q,message:$.message};let X="",Q=B.filter((J)=>!!J).slice().reverse();for(let J of Q)X=J(C,{data:F,defaultError:X}).message;return{...$,path:q,message:X}},W6=[];function G(D,F){let E=yD(),B=q2({issueData:F,data:D.data,path:D.path,errorMaps:[D.common.contextualErrorMap,D.schemaErrorMap,E,E===_D?void 0:_D].filter(($)=>!!$)});D.common.issues.push(B)}class x{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 E=[];for(let B of F){if(B.status==="aborted")return M;if(B.status==="dirty")D.dirty();E.push(B.value)}return{status:D.value,value:E}}static async mergeObjectAsync(D,F){let E=[];for(let B of F){let $=await B.key,q=await B.value;E.push({key:$,value:q})}return x.mergeObjectSync(D,E)}static mergeObjectSync(D,F){let E={};for(let B of F){let{key:$,value:q}=B;if($.status==="aborted")return M;if(q.status==="aborted")return M;if($.status==="dirty")D.dirty();if(q.status==="dirty")D.dirty();if($.value!=="__proto__"&&(typeof q.value<"u"||B.alwaysSet))E[$.value]=q.value}return{status:D.value,value:E}}}var M=Object.freeze({status:"aborted"}),KD=(D)=>({status:"dirty",value:D}),y=(D)=>({status:"valid",value:D}),V2=(D)=>D.status==="aborted",N2=(D)=>D.status==="dirty",HD=(D)=>D.status==="valid",hD=(D)=>typeof Promise<"u"&&D instanceof Promise;var A;(function(D){D.errToObj=(F)=>typeof F==="string"?{message:F}:F||{},D.toString=(F)=>typeof F==="string"?F:F?.message})(A||(A={}));class o{constructor(D,F,E,B){this._cachedPath=[],this.parent=D,this.data=F,this._path=E,this._key=B}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 a3=(D,F)=>{if(HD(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 E=new g(D.common.issues);return this._error=E,this._error}}}};function V(D){if(!D)return{};let{errorMap:F,invalid_type_error:E,required_error:B,description:$}=D;if(F&&(E||B))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:(C,X)=>{let{message:Q}=D;if(C.code==="invalid_enum_value")return{message:Q??X.defaultError};if(typeof X.data>"u")return{message:Q??B??X.defaultError};if(C.code!=="invalid_type")return{message:X.defaultError};return{message:Q??E??X.defaultError}},description:$}}class K{get description(){return this._def.description}_getType(D){return FD(D.data)}_getOrReturnCtx(D,F){return F||{common:D.parent.common,data:D.data,parsedType:FD(D.data),schemaErrorMap:this._def.errorMap,path:D.path,parent:D.parent}}_processInputParams(D){return{status:new x,ctx:{common:D.parent.common,data:D.data,parsedType:FD(D.data),schemaErrorMap:this._def.errorMap,path:D.path,parent:D.parent}}}_parseSync(D){let F=this._parse(D);if(hD(F))throw Error("Synchronous parse encountered promise.");return F}_parseAsync(D){let F=this._parse(D);return Promise.resolve(F)}parse(D,F){let E=this.safeParse(D,F);if(E.success)return E.data;throw E.error}safeParse(D,F){let E={common:{issues:[],async:F?.async??!1,contextualErrorMap:F?.errorMap},path:F?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:D,parsedType:FD(D)},B=this._parseSync({data:D,path:E.path,parent:E});return a3(E,B)}"~validate"(D){let F={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:D,parsedType:FD(D)};if(!this["~standard"].async)try{let E=this._parseSync({data:D,path:[],parent:F});return HD(E)?{value:E.value}:{issues:F.common.issues}}catch(E){if(E?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;F.common={issues:[],async:!0}}return this._parseAsync({data:D,path:[],parent:F}).then((E)=>HD(E)?{value:E.value}:{issues:F.common.issues})}async parseAsync(D,F){let E=await this.safeParseAsync(D,F);if(E.success)return E.data;throw E.error}async safeParseAsync(D,F){let E={common:{issues:[],contextualErrorMap:F?.errorMap,async:!0},path:F?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:D,parsedType:FD(D)},B=this._parse({data:D,path:E.path,parent:E}),$=await(hD(B)?B:Promise.resolve(B));return a3(E,$)}refine(D,F){let E=(B)=>{if(typeof F==="string"||typeof F>"u")return{message:F};else if(typeof F==="function")return F(B);else return F};return this._refinement((B,$)=>{let q=D(B),C=()=>$.addIssue({code:Y.custom,...E(B)});if(typeof Promise<"u"&&q instanceof Promise)return q.then((X)=>{if(!X)return C(),!1;else return!0});if(!q)return C(),!1;else return!0})}refinement(D,F){return this._refinement((E,B)=>{if(!D(E))return B.addIssue(typeof F==="function"?F(E,B):F),!1;else return!0})}_refinement(D){return new s({schema:this,typeName:R.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 a.create(this,this._def)}nullable(){return WD.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return r.create(this)}promise(){return ID.create(this,this._def)}or(D){return dD.create([this,D],this._def)}and(D){return nD.create(this,D,this._def)}transform(D){return new s({...V(this._def),schema:this,typeName:R.ZodEffects,effect:{type:"transform",transform:D}})}default(D){let F=typeof D==="function"?D:()=>D;return new oD({...V(this._def),innerType:this,defaultValue:F,typeName:R.ZodDefault})}brand(){return new O2({typeName:R.ZodBranded,type:this,...V(this._def)})}catch(D){let F=typeof D==="function"?D:()=>D;return new sD({...V(this._def),innerType:this,catchValue:F,typeName:R.ZodCatch})}describe(D){return new this.constructor({...this._def,description:D})}pipe(D){return Y2.create(this,D)}readonly(){return tD.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var G6=/^c[^\s-]{8,}$/i,H6=/^[0-9a-z]+$/,u6=/^[0-9A-HJKMNP-TV-Z]{26}$/i,A6=/^[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,M6=/^[a-z0-9_-]{21}$/i,R6=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,z6=/^[-+]?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)?)??$/,j6=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,U6="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",U0,L6=/^(?:(?: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])$/,V6=/^(?:(?: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])$/,N6=/^(([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]))$/,K6=/^(([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])$/,O6=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,S6=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,s3="((\\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])))",w6=new RegExp(`^${s3}$`);function t3(D){let F="[0-5]\\d";if(D.precision)F=`${F}\\.\\d{${D.precision}}`;else if(D.precision==null)F=`${F}(\\.\\d+)?`;let E=D.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${F})${E}`}function I6(D){return new RegExp(`^${t3(D)}$`)}function e3(D){let F=`${s3}T${t3(D)}`,E=[];if(E.push(D.local?"Z?":"Z"),D.offset)E.push("([+-]\\d{2}:?\\d{2})");return F=`${F}(${E.join("|")})`,new RegExp(`^${F}$`)}function b6(D,F){if((F==="v4"||!F)&&L6.test(D))return!0;if((F==="v6"||!F)&&N6.test(D))return!0;return!1}function k6(D,F){if(!R6.test(D))return!1;try{let[E]=D.split(".");if(!E)return!1;let B=E.replace(/-/g,"+").replace(/_/g,"/").padEnd(E.length+(4-E.length%4)%4,"="),$=JSON.parse(atob(B));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 P6(D,F){if((F==="v4"||!F)&&V6.test(D))return!0;if((F==="v6"||!F)&&K6.test(D))return!0;return!1}class i extends K{_parse(D){if(this._def.coerce)D.data=String(D.data);if(this._getType(D)!==W.string){let $=this._getOrReturnCtx(D);return G($,{code:Y.invalid_type,expected:W.string,received:$.parsedType}),M}let E=new x,B=void 0;for(let $ of this._def.checks)if($.kind==="min"){if(D.data.length<$.value)B=this._getOrReturnCtx(D,B),G(B,{code:Y.too_small,minimum:$.value,type:"string",inclusive:!0,exact:!1,message:$.message}),E.dirty()}else if($.kind==="max"){if(D.data.length>$.value)B=this._getOrReturnCtx(D,B),G(B,{code:Y.too_big,maximum:$.value,type:"string",inclusive:!0,exact:!1,message:$.message}),E.dirty()}else if($.kind==="length"){let q=D.data.length>$.value,C=D.data.length<$.value;if(q||C){if(B=this._getOrReturnCtx(D,B),q)G(B,{code:Y.too_big,maximum:$.value,type:"string",inclusive:!0,exact:!0,message:$.message});else if(C)G(B,{code:Y.too_small,minimum:$.value,type:"string",inclusive:!0,exact:!0,message:$.message});E.dirty()}}else if($.kind==="email"){if(!j6.test(D.data))B=this._getOrReturnCtx(D,B),G(B,{validation:"email",code:Y.invalid_string,message:$.message}),E.dirty()}else if($.kind==="emoji"){if(!U0)U0=new RegExp(U6,"u");if(!U0.test(D.data))B=this._getOrReturnCtx(D,B),G(B,{validation:"emoji",code:Y.invalid_string,message:$.message}),E.dirty()}else if($.kind==="uuid"){if(!A6.test(D.data))B=this._getOrReturnCtx(D,B),G(B,{validation:"uuid",code:Y.invalid_string,message:$.message}),E.dirty()}else if($.kind==="nanoid"){if(!M6.test(D.data))B=this._getOrReturnCtx(D,B),G(B,{validation:"nanoid",code:Y.invalid_string,message:$.message}),E.dirty()}else if($.kind==="cuid"){if(!G6.test(D.data))B=this._getOrReturnCtx(D,B),G(B,{validation:"cuid",code:Y.invalid_string,message:$.message}),E.dirty()}else if($.kind==="cuid2"){if(!H6.test(D.data))B=this._getOrReturnCtx(D,B),G(B,{validation:"cuid2",code:Y.invalid_string,message:$.message}),E.dirty()}else if($.kind==="ulid"){if(!u6.test(D.data))B=this._getOrReturnCtx(D,B),G(B,{validation:"ulid",code:Y.invalid_string,message:$.message}),E.dirty()}else if($.kind==="url")try{new URL(D.data)}catch{B=this._getOrReturnCtx(D,B),G(B,{validation:"url",code:Y.invalid_string,message:$.message}),E.dirty()}else if($.kind==="regex"){if($.regex.lastIndex=0,!$.regex.test(D.data))B=this._getOrReturnCtx(D,B),G(B,{validation:"regex",code:Y.invalid_string,message:$.message}),E.dirty()}else if($.kind==="trim")D.data=D.data.trim();else if($.kind==="includes"){if(!D.data.includes($.value,$.position))B=this._getOrReturnCtx(D,B),G(B,{code:Y.invalid_string,validation:{includes:$.value,position:$.position},message:$.message}),E.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))B=this._getOrReturnCtx(D,B),G(B,{code:Y.invalid_string,validation:{startsWith:$.value},message:$.message}),E.dirty()}else if($.kind==="endsWith"){if(!D.data.endsWith($.value))B=this._getOrReturnCtx(D,B),G(B,{code:Y.invalid_string,validation:{endsWith:$.value},message:$.message}),E.dirty()}else if($.kind==="datetime"){if(!e3($).test(D.data))B=this._getOrReturnCtx(D,B),G(B,{code:Y.invalid_string,validation:"datetime",message:$.message}),E.dirty()}else if($.kind==="date"){if(!w6.test(D.data))B=this._getOrReturnCtx(D,B),G(B,{code:Y.invalid_string,validation:"date",message:$.message}),E.dirty()}else if($.kind==="time"){if(!I6($).test(D.data))B=this._getOrReturnCtx(D,B),G(B,{code:Y.invalid_string,validation:"time",message:$.message}),E.dirty()}else if($.kind==="duration"){if(!z6.test(D.data))B=this._getOrReturnCtx(D,B),G(B,{validation:"duration",code:Y.invalid_string,message:$.message}),E.dirty()}else if($.kind==="ip"){if(!b6(D.data,$.version))B=this._getOrReturnCtx(D,B),G(B,{validation:"ip",code:Y.invalid_string,message:$.message}),E.dirty()}else if($.kind==="jwt"){if(!k6(D.data,$.alg))B=this._getOrReturnCtx(D,B),G(B,{validation:"jwt",code:Y.invalid_string,message:$.message}),E.dirty()}else if($.kind==="cidr"){if(!P6(D.data,$.version))B=this._getOrReturnCtx(D,B),G(B,{validation:"cidr",code:Y.invalid_string,message:$.message}),E.dirty()}else if($.kind==="base64"){if(!O6.test(D.data))B=this._getOrReturnCtx(D,B),G(B,{validation:"base64",code:Y.invalid_string,message:$.message}),E.dirty()}else if($.kind==="base64url"){if(!S6.test(D.data))B=this._getOrReturnCtx(D,B),G(B,{validation:"base64url",code:Y.invalid_string,message:$.message}),E.dirty()}else O.assertNever($);return{status:E.value,value:D.data}}_regex(D,F,E){return this.refinement((B)=>D.test(B),{validation:F,code:Y.invalid_string,...A.errToObj(E)})}_addCheck(D){return new i({...this._def,checks:[...this._def.checks,D]})}email(D){return this._addCheck({kind:"email",...A.errToObj(D)})}url(D){return this._addCheck({kind:"url",...A.errToObj(D)})}emoji(D){return this._addCheck({kind:"emoji",...A.errToObj(D)})}uuid(D){return this._addCheck({kind:"uuid",...A.errToObj(D)})}nanoid(D){return this._addCheck({kind:"nanoid",...A.errToObj(D)})}cuid(D){return this._addCheck({kind:"cuid",...A.errToObj(D)})}cuid2(D){return this._addCheck({kind:"cuid2",...A.errToObj(D)})}ulid(D){return this._addCheck({kind:"ulid",...A.errToObj(D)})}base64(D){return this._addCheck({kind:"base64",...A.errToObj(D)})}base64url(D){return this._addCheck({kind:"base64url",...A.errToObj(D)})}jwt(D){return this._addCheck({kind:"jwt",...A.errToObj(D)})}ip(D){return this._addCheck({kind:"ip",...A.errToObj(D)})}cidr(D){return this._addCheck({kind:"cidr",...A.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,...A.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,...A.errToObj(D?.message)})}duration(D){return this._addCheck({kind:"duration",...A.errToObj(D)})}regex(D,F){return this._addCheck({kind:"regex",regex:D,...A.errToObj(F)})}includes(D,F){return this._addCheck({kind:"includes",value:D,position:F?.position,...A.errToObj(F?.message)})}startsWith(D,F){return this._addCheck({kind:"startsWith",value:D,...A.errToObj(F)})}endsWith(D,F){return this._addCheck({kind:"endsWith",value:D,...A.errToObj(F)})}min(D,F){return this._addCheck({kind:"min",value:D,...A.errToObj(F)})}max(D,F){return this._addCheck({kind:"max",value:D,...A.errToObj(F)})}length(D,F){return this._addCheck({kind:"length",value:D,...A.errToObj(F)})}nonempty(D){return this.min(1,A.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:R.ZodString,coerce:D?.coerce??!1,...V(D)})};function T6(D,F){let E=(D.toString().split(".")[1]||"").length,B=(F.toString().split(".")[1]||"").length,$=E>B?E:B,q=Number.parseInt(D.toFixed($).replace(".","")),C=Number.parseInt(F.toFixed($).replace(".",""));return q%C/10**$}class AD extends K{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)!==W.number){let $=this._getOrReturnCtx(D);return G($,{code:Y.invalid_type,expected:W.number,received:$.parsedType}),M}let E=void 0,B=new x;for(let $ of this._def.checks)if($.kind==="int"){if(!O.isInteger(D.data))E=this._getOrReturnCtx(D,E),G(E,{code:Y.invalid_type,expected:"integer",received:"float",message:$.message}),B.dirty()}else if($.kind==="min"){if($.inclusive?D.data<$.value:D.data<=$.value)E=this._getOrReturnCtx(D,E),G(E,{code:Y.too_small,minimum:$.value,type:"number",inclusive:$.inclusive,exact:!1,message:$.message}),B.dirty()}else if($.kind==="max"){if($.inclusive?D.data>$.value:D.data>=$.value)E=this._getOrReturnCtx(D,E),G(E,{code:Y.too_big,maximum:$.value,type:"number",inclusive:$.inclusive,exact:!1,message:$.message}),B.dirty()}else if($.kind==="multipleOf"){if(T6(D.data,$.value)!==0)E=this._getOrReturnCtx(D,E),G(E,{code:Y.not_multiple_of,multipleOf:$.value,message:$.message}),B.dirty()}else if($.kind==="finite"){if(!Number.isFinite(D.data))E=this._getOrReturnCtx(D,E),G(E,{code:Y.not_finite,message:$.message}),B.dirty()}else O.assertNever($);return{status:B.value,value:D.data}}gte(D,F){return this.setLimit("min",D,!0,A.toString(F))}gt(D,F){return this.setLimit("min",D,!1,A.toString(F))}lte(D,F){return this.setLimit("max",D,!0,A.toString(F))}lt(D,F){return this.setLimit("max",D,!1,A.toString(F))}setLimit(D,F,E,B){return new AD({...this._def,checks:[...this._def.checks,{kind:D,value:F,inclusive:E,message:A.toString(B)}]})}_addCheck(D){return new AD({...this._def,checks:[...this._def.checks,D]})}int(D){return this._addCheck({kind:"int",message:A.toString(D)})}positive(D){return this._addCheck({kind:"min",value:0,inclusive:!1,message:A.toString(D)})}negative(D){return this._addCheck({kind:"max",value:0,inclusive:!1,message:A.toString(D)})}nonpositive(D){return this._addCheck({kind:"max",value:0,inclusive:!0,message:A.toString(D)})}nonnegative(D){return this._addCheck({kind:"min",value:0,inclusive:!0,message:A.toString(D)})}multipleOf(D,F){return this._addCheck({kind:"multipleOf",value:D,message:A.toString(F)})}finite(D){return this._addCheck({kind:"finite",message:A.toString(D)})}safe(D){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:A.toString(D)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:A.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"&&O.isInteger(D.value))}get isFinite(){let D=null,F=null;for(let E of this._def.checks)if(E.kind==="finite"||E.kind==="int"||E.kind==="multipleOf")return!0;else if(E.kind==="min"){if(F===null||E.value>F)F=E.value}else if(E.kind==="max"){if(D===null||E.value<D)D=E.value}return Number.isFinite(F)&&Number.isFinite(D)}}AD.create=(D)=>{return new AD({checks:[],typeName:R.ZodNumber,coerce:D?.coerce||!1,...V(D)})};class MD extends K{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)!==W.bigint)return this._getInvalidInput(D);let E=void 0,B=new x;for(let $ of this._def.checks)if($.kind==="min"){if($.inclusive?D.data<$.value:D.data<=$.value)E=this._getOrReturnCtx(D,E),G(E,{code:Y.too_small,type:"bigint",minimum:$.value,inclusive:$.inclusive,message:$.message}),B.dirty()}else if($.kind==="max"){if($.inclusive?D.data>$.value:D.data>=$.value)E=this._getOrReturnCtx(D,E),G(E,{code:Y.too_big,type:"bigint",maximum:$.value,inclusive:$.inclusive,message:$.message}),B.dirty()}else if($.kind==="multipleOf"){if(D.data%$.value!==BigInt(0))E=this._getOrReturnCtx(D,E),G(E,{code:Y.not_multiple_of,multipleOf:$.value,message:$.message}),B.dirty()}else O.assertNever($);return{status:B.value,value:D.data}}_getInvalidInput(D){let F=this._getOrReturnCtx(D);return G(F,{code:Y.invalid_type,expected:W.bigint,received:F.parsedType}),M}gte(D,F){return this.setLimit("min",D,!0,A.toString(F))}gt(D,F){return this.setLimit("min",D,!1,A.toString(F))}lte(D,F){return this.setLimit("max",D,!0,A.toString(F))}lt(D,F){return this.setLimit("max",D,!1,A.toString(F))}setLimit(D,F,E,B){return new MD({...this._def,checks:[...this._def.checks,{kind:D,value:F,inclusive:E,message:A.toString(B)}]})}_addCheck(D){return new MD({...this._def,checks:[...this._def.checks,D]})}positive(D){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:A.toString(D)})}negative(D){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:A.toString(D)})}nonpositive(D){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:A.toString(D)})}nonnegative(D){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:A.toString(D)})}multipleOf(D,F){return this._addCheck({kind:"multipleOf",value:D,message:A.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}}MD.create=(D)=>{return new MD({checks:[],typeName:R.ZodBigInt,coerce:D?.coerce??!1,...V(D)})};class lD extends K{_parse(D){if(this._def.coerce)D.data=Boolean(D.data);if(this._getType(D)!==W.boolean){let E=this._getOrReturnCtx(D);return G(E,{code:Y.invalid_type,expected:W.boolean,received:E.parsedType}),M}return y(D.data)}}lD.create=(D)=>{return new lD({typeName:R.ZodBoolean,coerce:D?.coerce||!1,...V(D)})};class OD extends K{_parse(D){if(this._def.coerce)D.data=new Date(D.data);if(this._getType(D)!==W.date){let $=this._getOrReturnCtx(D);return G($,{code:Y.invalid_type,expected:W.date,received:$.parsedType}),M}if(Number.isNaN(D.data.getTime())){let $=this._getOrReturnCtx(D);return G($,{code:Y.invalid_date}),M}let E=new x,B=void 0;for(let $ of this._def.checks)if($.kind==="min"){if(D.data.getTime()<$.value)B=this._getOrReturnCtx(D,B),G(B,{code:Y.too_small,message:$.message,inclusive:!0,exact:!1,minimum:$.value,type:"date"}),E.dirty()}else if($.kind==="max"){if(D.data.getTime()>$.value)B=this._getOrReturnCtx(D,B),G(B,{code:Y.too_big,message:$.message,inclusive:!0,exact:!1,maximum:$.value,type:"date"}),E.dirty()}else O.assertNever($);return{status:E.value,value:new Date(D.data.getTime())}}_addCheck(D){return new OD({...this._def,checks:[...this._def.checks,D]})}min(D,F){return this._addCheck({kind:"min",value:D.getTime(),message:A.toString(F)})}max(D,F){return this._addCheck({kind:"max",value:D.getTime(),message:A.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}}OD.create=(D)=>{return new OD({checks:[],coerce:D?.coerce||!1,typeName:R.ZodDate,...V(D)})};class C2 extends K{_parse(D){if(this._getType(D)!==W.symbol){let E=this._getOrReturnCtx(D);return G(E,{code:Y.invalid_type,expected:W.symbol,received:E.parsedType}),M}return y(D.data)}}C2.create=(D)=>{return new C2({typeName:R.ZodSymbol,...V(D)})};class pD extends K{_parse(D){if(this._getType(D)!==W.undefined){let E=this._getOrReturnCtx(D);return G(E,{code:Y.invalid_type,expected:W.undefined,received:E.parsedType}),M}return y(D.data)}}pD.create=(D)=>{return new pD({typeName:R.ZodUndefined,...V(D)})};class cD extends K{_parse(D){if(this._getType(D)!==W.null){let E=this._getOrReturnCtx(D);return G(E,{code:Y.invalid_type,expected:W.null,received:E.parsedType}),M}return y(D.data)}}cD.create=(D)=>{return new cD({typeName:R.ZodNull,...V(D)})};class SD extends K{constructor(){super(...arguments);this._any=!0}_parse(D){return y(D.data)}}SD.create=(D)=>{return new SD({typeName:R.ZodAny,...V(D)})};class uD extends K{constructor(){super(...arguments);this._unknown=!0}_parse(D){return y(D.data)}}uD.create=(D)=>{return new uD({typeName:R.ZodUnknown,...V(D)})};class ED extends K{_parse(D){let F=this._getOrReturnCtx(D);return G(F,{code:Y.invalid_type,expected:W.never,received:F.parsedType}),M}}ED.create=(D)=>{return new ED({typeName:R.ZodNever,...V(D)})};class X2 extends K{_parse(D){if(this._getType(D)!==W.undefined){let E=this._getOrReturnCtx(D);return G(E,{code:Y.invalid_type,expected:W.void,received:E.parsedType}),M}return y(D.data)}}X2.create=(D)=>{return new X2({typeName:R.ZodVoid,...V(D)})};class r extends K{_parse(D){let{ctx:F,status:E}=this._processInputParams(D),B=this._def;if(F.parsedType!==W.array)return G(F,{code:Y.invalid_type,expected:W.array,received:F.parsedType}),M;if(B.exactLength!==null){let q=F.data.length>B.exactLength.value,C=F.data.length<B.exactLength.value;if(q||C)G(F,{code:q?Y.too_big:Y.too_small,minimum:C?B.exactLength.value:void 0,maximum:q?B.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:B.exactLength.message}),E.dirty()}if(B.minLength!==null){if(F.data.length<B.minLength.value)G(F,{code:Y.too_small,minimum:B.minLength.value,type:"array",inclusive:!0,exact:!1,message:B.minLength.message}),E.dirty()}if(B.maxLength!==null){if(F.data.length>B.maxLength.value)G(F,{code:Y.too_big,maximum:B.maxLength.value,type:"array",inclusive:!0,exact:!1,message:B.maxLength.message}),E.dirty()}if(F.common.async)return Promise.all([...F.data].map((q,C)=>{return B.type._parseAsync(new o(F,q,F.path,C))})).then((q)=>{return x.mergeArray(E,q)});let $=[...F.data].map((q,C)=>{return B.type._parseSync(new o(F,q,F.path,C))});return x.mergeArray(E,$)}get element(){return this._def.type}min(D,F){return new r({...this._def,minLength:{value:D,message:A.toString(F)}})}max(D,F){return new r({...this._def,maxLength:{value:D,message:A.toString(F)}})}length(D,F){return new r({...this._def,exactLength:{value:D,message:A.toString(F)}})}nonempty(D){return this.min(1,D)}}r.create=(D,F)=>{return new r({type:D,minLength:null,maxLength:null,exactLength:null,typeName:R.ZodArray,...V(F)})};function gD(D){if(D instanceof f){let F={};for(let E in D.shape){let B=D.shape[E];F[E]=a.create(gD(B))}return new f({...D._def,shape:()=>F})}else if(D instanceof r)return new r({...D._def,type:gD(D.element)});else if(D instanceof a)return a.create(gD(D.unwrap()));else if(D instanceof WD)return WD.create(gD(D.unwrap()));else if(D instanceof BD)return BD.create(D.items.map((F)=>gD(F)));else return D}class f extends K{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=O.objectKeys(D);return this._cached={shape:D,keys:F},this._cached}_parse(D){if(this._getType(D)!==W.object){let Q=this._getOrReturnCtx(D);return G(Q,{code:Y.invalid_type,expected:W.object,received:Q.parsedType}),M}let{status:E,ctx:B}=this._processInputParams(D),{shape:$,keys:q}=this._getCached(),C=[];if(!(this._def.catchall instanceof ED&&this._def.unknownKeys==="strip")){for(let Q in B.data)if(!q.includes(Q))C.push(Q)}let X=[];for(let Q of q){let J=$[Q],_=B.data[Q];X.push({key:{status:"valid",value:Q},value:J._parse(new o(B,_,B.path,Q)),alwaysSet:Q in B.data})}if(this._def.catchall instanceof ED){let Q=this._def.unknownKeys;if(Q==="passthrough")for(let J of C)X.push({key:{status:"valid",value:J},value:{status:"valid",value:B.data[J]}});else if(Q==="strict"){if(C.length>0)G(B,{code:Y.unrecognized_keys,keys:C}),E.dirty()}else if(Q==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let Q=this._def.catchall;for(let J of C){let _=B.data[J];X.push({key:{status:"valid",value:J},value:Q._parse(new o(B,_,B.path,J)),alwaysSet:J in B.data})}}if(B.common.async)return Promise.resolve().then(async()=>{let Q=[];for(let J of X){let _=await J.key,H=await J.value;Q.push({key:_,value:H,alwaysSet:J.alwaysSet})}return Q}).then((Q)=>{return x.mergeObjectSync(E,Q)});else return x.mergeObjectSync(E,X)}get shape(){return this._def.shape()}strict(D){return A.errToObj,new f({...this._def,unknownKeys:"strict",...D!==void 0?{errorMap:(F,E)=>{let B=this._def.errorMap?.(F,E).message??E.defaultError;if(F.code==="unrecognized_keys")return{message:A.errToObj(D).message??B};return{message:B}}}:{}})}strip(){return new f({...this._def,unknownKeys:"strip"})}passthrough(){return new f({...this._def,unknownKeys:"passthrough"})}extend(D){return new f({...this._def,shape:()=>({...this._def.shape(),...D})})}merge(D){return new f({unknownKeys:D._def.unknownKeys,catchall:D._def.catchall,shape:()=>({...this._def.shape(),...D._def.shape()}),typeName:R.ZodObject})}setKey(D,F){return this.augment({[D]:F})}catchall(D){return new f({...this._def,catchall:D})}pick(D){let F={};for(let E of O.objectKeys(D))if(D[E]&&this.shape[E])F[E]=this.shape[E];return new f({...this._def,shape:()=>F})}omit(D){let F={};for(let E of O.objectKeys(this.shape))if(!D[E])F[E]=this.shape[E];return new f({...this._def,shape:()=>F})}deepPartial(){return gD(this)}partial(D){let F={};for(let E of O.objectKeys(this.shape)){let B=this.shape[E];if(D&&!D[E])F[E]=B;else F[E]=B.optional()}return new f({...this._def,shape:()=>F})}required(D){let F={};for(let E of O.objectKeys(this.shape))if(D&&!D[E])F[E]=this.shape[E];else{let $=this.shape[E];while($ instanceof a)$=$._def.innerType;F[E]=$}return new f({...this._def,shape:()=>F})}keyof(){return D8(O.objectKeys(this.shape))}}f.create=(D,F)=>{return new f({shape:()=>D,unknownKeys:"strip",catchall:ED.create(),typeName:R.ZodObject,...V(F)})};f.strictCreate=(D,F)=>{return new f({shape:()=>D,unknownKeys:"strict",catchall:ED.create(),typeName:R.ZodObject,...V(F)})};f.lazycreate=(D,F)=>{return new f({shape:D,unknownKeys:"strip",catchall:ED.create(),typeName:R.ZodObject,...V(F)})};class dD extends K{_parse(D){let{ctx:F}=this._processInputParams(D),E=this._def.options;function B($){for(let C of $)if(C.result.status==="valid")return C.result;for(let C of $)if(C.result.status==="dirty")return F.common.issues.push(...C.ctx.common.issues),C.result;let q=$.map((C)=>new g(C.ctx.common.issues));return G(F,{code:Y.invalid_union,unionErrors:q}),M}if(F.common.async)return Promise.all(E.map(async($)=>{let q={...F,common:{...F.common,issues:[]},parent:null};return{result:await $._parseAsync({data:F.data,path:F.path,parent:q}),ctx:q}})).then(B);else{let $=void 0,q=[];for(let X of E){let Q={...F,common:{...F.common,issues:[]},parent:null},J=X._parseSync({data:F.data,path:F.path,parent:Q});if(J.status==="valid")return J;else if(J.status==="dirty"&&!$)$={result:J,ctx:Q};if(Q.common.issues.length)q.push(Q.common.issues)}if($)return F.common.issues.push(...$.ctx.common.issues),$.result;let C=q.map((X)=>new g(X));return G(F,{code:Y.invalid_union,unionErrors:C}),M}}get options(){return this._def.options}}dD.create=(D,F)=>{return new dD({options:D,typeName:R.ZodUnion,...V(F)})};var YD=(D)=>{if(D instanceof iD)return YD(D.schema);else if(D instanceof s)return YD(D.innerType());else if(D instanceof rD)return[D.value];else if(D instanceof RD)return D.options;else if(D instanceof aD)return O.objectValues(D.enum);else if(D instanceof oD)return YD(D._def.innerType);else if(D instanceof pD)return[void 0];else if(D instanceof cD)return[null];else if(D instanceof a)return[void 0,...YD(D.unwrap())];else if(D instanceof WD)return[null,...YD(D.unwrap())];else if(D instanceof O2)return YD(D.unwrap());else if(D instanceof tD)return YD(D.unwrap());else if(D instanceof sD)return YD(D._def.innerType);else return[]};class K2 extends K{_parse(D){let{ctx:F}=this._processInputParams(D);if(F.parsedType!==W.object)return G(F,{code:Y.invalid_type,expected:W.object,received:F.parsedType}),M;let E=this.discriminator,B=F.data[E],$=this.optionsMap.get(B);if(!$)return G(F,{code:Y.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[E]}),M;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,E){let B=new Map;for(let $ of F){let q=YD($.shape[D]);if(!q.length)throw Error(`A discriminator value for key \`${D}\` could not be extracted from all schema options`);for(let C of q){if(B.has(C))throw Error(`Discriminator property ${String(D)} has duplicate value ${String(C)}`);B.set(C,$)}}return new K2({typeName:R.ZodDiscriminatedUnion,discriminator:D,options:F,optionsMap:B,...V(E)})}}function L0(D,F){let E=FD(D),B=FD(F);if(D===F)return{valid:!0,data:D};else if(E===W.object&&B===W.object){let $=O.objectKeys(F),q=O.objectKeys(D).filter((X)=>$.indexOf(X)!==-1),C={...D,...F};for(let X of q){let Q=L0(D[X],F[X]);if(!Q.valid)return{valid:!1};C[X]=Q.data}return{valid:!0,data:C}}else if(E===W.array&&B===W.array){if(D.length!==F.length)return{valid:!1};let $=[];for(let q=0;q<D.length;q++){let C=D[q],X=F[q],Q=L0(C,X);if(!Q.valid)return{valid:!1};$.push(Q.data)}return{valid:!0,data:$}}else if(E===W.date&&B===W.date&&+D===+F)return{valid:!0,data:D};else return{valid:!1}}class nD extends K{_parse(D){let{status:F,ctx:E}=this._processInputParams(D),B=($,q)=>{if(V2($)||V2(q))return M;let C=L0($.value,q.value);if(!C.valid)return G(E,{code:Y.invalid_intersection_types}),M;if(N2($)||N2(q))F.dirty();return{status:F.value,value:C.data}};if(E.common.async)return Promise.all([this._def.left._parseAsync({data:E.data,path:E.path,parent:E}),this._def.right._parseAsync({data:E.data,path:E.path,parent:E})]).then(([$,q])=>B($,q));else return B(this._def.left._parseSync({data:E.data,path:E.path,parent:E}),this._def.right._parseSync({data:E.data,path:E.path,parent:E}))}}nD.create=(D,F,E)=>{return new nD({left:D,right:F,typeName:R.ZodIntersection,...V(E)})};class BD extends K{_parse(D){let{status:F,ctx:E}=this._processInputParams(D);if(E.parsedType!==W.array)return G(E,{code:Y.invalid_type,expected:W.array,received:E.parsedType}),M;if(E.data.length<this._def.items.length)return G(E,{code:Y.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),M;if(!this._def.rest&&E.data.length>this._def.items.length)G(E,{code:Y.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),F.dirty();let $=[...E.data].map((q,C)=>{let X=this._def.items[C]||this._def.rest;if(!X)return null;return X._parse(new o(E,q,E.path,C))}).filter((q)=>!!q);if(E.common.async)return Promise.all($).then((q)=>{return x.mergeArray(F,q)});else return x.mergeArray(F,$)}get items(){return this._def.items}rest(D){return new BD({...this._def,rest:D})}}BD.create=(D,F)=>{if(!Array.isArray(D))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new BD({items:D,typeName:R.ZodTuple,rest:null,...V(F)})};class Q2 extends K{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(D){let{status:F,ctx:E}=this._processInputParams(D);if(E.parsedType!==W.object)return G(E,{code:Y.invalid_type,expected:W.object,received:E.parsedType}),M;let B=[],$=this._def.keyType,q=this._def.valueType;for(let C in E.data)B.push({key:$._parse(new o(E,C,E.path,C)),value:q._parse(new o(E,E.data[C],E.path,C)),alwaysSet:C in E.data});if(E.common.async)return x.mergeObjectAsync(F,B);else return x.mergeObjectSync(F,B)}get element(){return this._def.valueType}static create(D,F,E){if(F instanceof K)return new Q2({keyType:D,valueType:F,typeName:R.ZodRecord,...V(E)});return new Q2({keyType:i.create(),valueType:D,typeName:R.ZodRecord,...V(F)})}}class J2 extends K{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(D){let{status:F,ctx:E}=this._processInputParams(D);if(E.parsedType!==W.map)return G(E,{code:Y.invalid_type,expected:W.map,received:E.parsedType}),M;let B=this._def.keyType,$=this._def.valueType,q=[...E.data.entries()].map(([C,X],Q)=>{return{key:B._parse(new o(E,C,E.path,[Q,"key"])),value:$._parse(new o(E,X,E.path,[Q,"value"]))}});if(E.common.async){let C=new Map;return Promise.resolve().then(async()=>{for(let X of q){let Q=await X.key,J=await X.value;if(Q.status==="aborted"||J.status==="aborted")return M;if(Q.status==="dirty"||J.status==="dirty")F.dirty();C.set(Q.value,J.value)}return{status:F.value,value:C}})}else{let C=new Map;for(let X of q){let{key:Q,value:J}=X;if(Q.status==="aborted"||J.status==="aborted")return M;if(Q.status==="dirty"||J.status==="dirty")F.dirty();C.set(Q.value,J.value)}return{status:F.value,value:C}}}}J2.create=(D,F,E)=>{return new J2({valueType:F,keyType:D,typeName:R.ZodMap,...V(E)})};class wD extends K{_parse(D){let{status:F,ctx:E}=this._processInputParams(D);if(E.parsedType!==W.set)return G(E,{code:Y.invalid_type,expected:W.set,received:E.parsedType}),M;let B=this._def;if(B.minSize!==null){if(E.data.size<B.minSize.value)G(E,{code:Y.too_small,minimum:B.minSize.value,type:"set",inclusive:!0,exact:!1,message:B.minSize.message}),F.dirty()}if(B.maxSize!==null){if(E.data.size>B.maxSize.value)G(E,{code:Y.too_big,maximum:B.maxSize.value,type:"set",inclusive:!0,exact:!1,message:B.maxSize.message}),F.dirty()}let $=this._def.valueType;function q(X){let Q=new Set;for(let J of X){if(J.status==="aborted")return M;if(J.status==="dirty")F.dirty();Q.add(J.value)}return{status:F.value,value:Q}}let C=[...E.data.values()].map((X,Q)=>$._parse(new o(E,X,E.path,Q)));if(E.common.async)return Promise.all(C).then((X)=>q(X));else return q(C)}min(D,F){return new wD({...this._def,minSize:{value:D,message:A.toString(F)}})}max(D,F){return new wD({...this._def,maxSize:{value:D,message:A.toString(F)}})}size(D,F){return this.min(D,F).max(D,F)}nonempty(D){return this.min(1,D)}}wD.create=(D,F)=>{return new wD({valueType:D,minSize:null,maxSize:null,typeName:R.ZodSet,...V(F)})};class mD extends K{constructor(){super(...arguments);this.validate=this.implement}_parse(D){let{ctx:F}=this._processInputParams(D);if(F.parsedType!==W.function)return G(F,{code:Y.invalid_type,expected:W.function,received:F.parsedType}),M;function E(C,X){return q2({data:C,path:F.path,errorMaps:[F.common.contextualErrorMap,F.schemaErrorMap,yD(),_D].filter((Q)=>!!Q),issueData:{code:Y.invalid_arguments,argumentsError:X}})}function B(C,X){return q2({data:C,path:F.path,errorMaps:[F.common.contextualErrorMap,F.schemaErrorMap,yD(),_D].filter((Q)=>!!Q),issueData:{code:Y.invalid_return_type,returnTypeError:X}})}let $={errorMap:F.common.contextualErrorMap},q=F.data;if(this._def.returns instanceof ID){let C=this;return y(async function(...X){let Q=new g([]),J=await C._def.args.parseAsync(X,$).catch((j)=>{throw Q.addIssue(E(X,j)),Q}),_=await Reflect.apply(q,this,J);return await C._def.returns._def.type.parseAsync(_,$).catch((j)=>{throw Q.addIssue(B(_,j)),Q})})}else{let C=this;return y(function(...X){let Q=C._def.args.safeParse(X,$);if(!Q.success)throw new g([E(X,Q.error)]);let J=Reflect.apply(q,this,Q.data),_=C._def.returns.safeParse(J,$);if(!_.success)throw new g([B(J,_.error)]);return _.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...D){return new mD({...this._def,args:BD.create(D).rest(uD.create())})}returns(D){return new mD({...this._def,returns:D})}implement(D){return this.parse(D)}strictImplement(D){return this.parse(D)}static create(D,F,E){return new mD({args:D?D:BD.create([]).rest(uD.create()),returns:F||uD.create(),typeName:R.ZodFunction,...V(E)})}}class iD extends K{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})}}iD.create=(D,F)=>{return new iD({getter:D,typeName:R.ZodLazy,...V(F)})};class rD extends K{_parse(D){if(D.data!==this._def.value){let F=this._getOrReturnCtx(D);return G(F,{received:F.data,code:Y.invalid_literal,expected:this._def.value}),M}return{status:"valid",value:D.data}}get value(){return this._def.value}}rD.create=(D,F)=>{return new rD({value:D,typeName:R.ZodLiteral,...V(F)})};function D8(D,F){return new RD({values:D,typeName:R.ZodEnum,...V(F)})}class RD extends K{_parse(D){if(typeof D.data!=="string"){let F=this._getOrReturnCtx(D),E=this._def.values;return G(F,{expected:O.joinValues(E),received:F.parsedType,code:Y.invalid_type}),M}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(D.data)){let F=this._getOrReturnCtx(D),E=this._def.values;return G(F,{received:F.data,code:Y.invalid_enum_value,options:E}),M}return y(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 RD.create(D,{...this._def,...F})}exclude(D,F=this._def){return RD.create(this.options.filter((E)=>!D.includes(E)),{...this._def,...F})}}RD.create=D8;class aD extends K{_parse(D){let F=O.getValidEnumValues(this._def.values),E=this._getOrReturnCtx(D);if(E.parsedType!==W.string&&E.parsedType!==W.number){let B=O.objectValues(F);return G(E,{expected:O.joinValues(B),received:E.parsedType,code:Y.invalid_type}),M}if(!this._cache)this._cache=new Set(O.getValidEnumValues(this._def.values));if(!this._cache.has(D.data)){let B=O.objectValues(F);return G(E,{received:E.data,code:Y.invalid_enum_value,options:B}),M}return y(D.data)}get enum(){return this._def.values}}aD.create=(D,F)=>{return new aD({values:D,typeName:R.ZodNativeEnum,...V(F)})};class ID extends K{unwrap(){return this._def.type}_parse(D){let{ctx:F}=this._processInputParams(D);if(F.parsedType!==W.promise&&F.common.async===!1)return G(F,{code:Y.invalid_type,expected:W.promise,received:F.parsedType}),M;let E=F.parsedType===W.promise?F.data:Promise.resolve(F.data);return y(E.then((B)=>{return this._def.type.parseAsync(B,{path:F.path,errorMap:F.common.contextualErrorMap})}))}}ID.create=(D,F)=>{return new ID({type:D,typeName:R.ZodPromise,...V(F)})};class s extends K{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===R.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(D){let{status:F,ctx:E}=this._processInputParams(D),B=this._def.effect||null,$={addIssue:(q)=>{if(G(E,q),q.fatal)F.abort();else F.dirty()},get path(){return E.path}};if($.addIssue=$.addIssue.bind($),B.type==="preprocess"){let q=B.transform(E.data,$);if(E.common.async)return Promise.resolve(q).then(async(C)=>{if(F.value==="aborted")return M;let X=await this._def.schema._parseAsync({data:C,path:E.path,parent:E});if(X.status==="aborted")return M;if(X.status==="dirty")return KD(X.value);if(F.value==="dirty")return KD(X.value);return X});else{if(F.value==="aborted")return M;let C=this._def.schema._parseSync({data:q,path:E.path,parent:E});if(C.status==="aborted")return M;if(C.status==="dirty")return KD(C.value);if(F.value==="dirty")return KD(C.value);return C}}if(B.type==="refinement"){let q=(C)=>{let X=B.refinement(C,$);if(E.common.async)return Promise.resolve(X);if(X instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return C};if(E.common.async===!1){let C=this._def.schema._parseSync({data:E.data,path:E.path,parent:E});if(C.status==="aborted")return M;if(C.status==="dirty")F.dirty();return q(C.value),{status:F.value,value:C.value}}else return this._def.schema._parseAsync({data:E.data,path:E.path,parent:E}).then((C)=>{if(C.status==="aborted")return M;if(C.status==="dirty")F.dirty();return q(C.value).then(()=>{return{status:F.value,value:C.value}})})}if(B.type==="transform")if(E.common.async===!1){let q=this._def.schema._parseSync({data:E.data,path:E.path,parent:E});if(!HD(q))return M;let C=B.transform(q.value,$);if(C instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:F.value,value:C}}else return this._def.schema._parseAsync({data:E.data,path:E.path,parent:E}).then((q)=>{if(!HD(q))return M;return Promise.resolve(B.transform(q.value,$)).then((C)=>({status:F.value,value:C}))});O.assertNever(B)}}s.create=(D,F,E)=>{return new s({schema:D,typeName:R.ZodEffects,effect:F,...V(E)})};s.createWithPreprocess=(D,F,E)=>{return new s({schema:F,effect:{type:"preprocess",transform:D},typeName:R.ZodEffects,...V(E)})};class a extends K{_parse(D){if(this._getType(D)===W.undefined)return y(void 0);return this._def.innerType._parse(D)}unwrap(){return this._def.innerType}}a.create=(D,F)=>{return new a({innerType:D,typeName:R.ZodOptional,...V(F)})};class WD extends K{_parse(D){if(this._getType(D)===W.null)return y(null);return this._def.innerType._parse(D)}unwrap(){return this._def.innerType}}WD.create=(D,F)=>{return new WD({innerType:D,typeName:R.ZodNullable,...V(F)})};class oD extends K{_parse(D){let{ctx:F}=this._processInputParams(D),E=F.data;if(F.parsedType===W.undefined)E=this._def.defaultValue();return this._def.innerType._parse({data:E,path:F.path,parent:F})}removeDefault(){return this._def.innerType}}oD.create=(D,F)=>{return new oD({innerType:D,typeName:R.ZodDefault,defaultValue:typeof F.default==="function"?F.default:()=>F.default,...V(F)})};class sD extends K{_parse(D){let{ctx:F}=this._processInputParams(D),E={...F,common:{...F.common,issues:[]}},B=this._def.innerType._parse({data:E.data,path:E.path,parent:{...E}});if(hD(B))return B.then(($)=>{return{status:"valid",value:$.status==="valid"?$.value:this._def.catchValue({get error(){return new g(E.common.issues)},input:E.data})}});else return{status:"valid",value:B.status==="valid"?B.value:this._def.catchValue({get error(){return new g(E.common.issues)},input:E.data})}}removeCatch(){return this._def.innerType}}sD.create=(D,F)=>{return new sD({innerType:D,typeName:R.ZodCatch,catchValue:typeof F.catch==="function"?F.catch:()=>F.catch,...V(F)})};class _2 extends K{_parse(D){if(this._getType(D)!==W.nan){let E=this._getOrReturnCtx(D);return G(E,{code:Y.invalid_type,expected:W.nan,received:E.parsedType}),M}return{status:"valid",value:D.data}}}_2.create=(D)=>{return new _2({typeName:R.ZodNaN,...V(D)})};var f6=Symbol("zod_brand");class O2 extends K{_parse(D){let{ctx:F}=this._processInputParams(D),E=F.data;return this._def.type._parse({data:E,path:F.path,parent:F})}unwrap(){return this._def.type}}class Y2 extends K{_parse(D){let{status:F,ctx:E}=this._processInputParams(D);if(E.common.async)return(async()=>{let $=await this._def.in._parseAsync({data:E.data,path:E.path,parent:E});if($.status==="aborted")return M;if($.status==="dirty")return F.dirty(),KD($.value);else return this._def.out._parseAsync({data:$.value,path:E.path,parent:E})})();else{let B=this._def.in._parseSync({data:E.data,path:E.path,parent:E});if(B.status==="aborted")return M;if(B.status==="dirty")return F.dirty(),{status:"dirty",value:B.value};else return this._def.out._parseSync({data:B.value,path:E.path,parent:E})}}static create(D,F){return new Y2({in:D,out:F,typeName:R.ZodPipeline})}}class tD extends K{_parse(D){let F=this._def.innerType._parse(D),E=(B)=>{if(HD(B))B.value=Object.freeze(B.value);return B};return hD(F)?F.then((B)=>E(B)):E(F)}unwrap(){return this._def.innerType}}tD.create=(D,F)=>{return new tD({innerType:D,typeName:R.ZodReadonly,...V(F)})};function o3(D,F){let E=typeof D==="function"?D(F):typeof D==="string"?{message:D}:D;return typeof E==="string"?{message:E}:E}function F8(D,F={},E){if(D)return SD.create().superRefine((B,$)=>{let q=D(B);if(q instanceof Promise)return q.then((C)=>{if(!C){let X=o3(F,B),Q=X.fatal??E??!0;$.addIssue({code:"custom",...X,fatal:Q})}});if(!q){let C=o3(F,B),X=C.fatal??E??!0;$.addIssue({code:"custom",...C,fatal:X})}return});return SD.create()}var v6={object:f.lazycreate},R;(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"})(R||(R={}));var Z6=(D,F={message:`Input not instance of ${D.name}`})=>F8((E)=>E instanceof D,F),E8=i.create,B8=AD.create,x6=_2.create,y6=MD.create,$8=lD.create,h6=OD.create,g6=C2.create,m6=pD.create,l6=cD.create,p6=SD.create,c6=uD.create,d6=ED.create,n6=X2.create,i6=r.create,r6=f.create,a6=f.strictCreate,o6=dD.create,s6=K2.create,t6=nD.create,e6=BD.create,D1=Q2.create,F1=J2.create,E1=wD.create,B1=mD.create,$1=iD.create,q1=rD.create,C1=RD.create,X1=aD.create,Q1=ID.create,J1=s.create,_1=a.create,Y1=WD.create,W1=s.createWithPreprocess,G1=Y2.create,H1=()=>E8().optional(),u1=()=>B8().optional(),A1=()=>$8().optional(),M1={string:(D)=>i.create({...D,coerce:!0}),number:(D)=>AD.create({...D,coerce:!0}),boolean:(D)=>lD.create({...D,coerce:!0}),bigint:(D)=>MD.create({...D,coerce:!0}),date:(D)=>OD.create({...D,coerce:!0})};var R1=M;var z1=l.object({opus:l.string(),sonnet:l.string(),haiku:l.string()}),V0=l.object({apiUrl:l.string().url(),apiKey:l.string().min(1),defaultProfile:l.string().optional(),profiles:l.record(z1)});var N0=q8(V1(),".claudio"),S2=q8(N0,"config.json");function p(){return K0(S2)}async function c(){if(!K0(S2))throw Error('Config file not found. Run "claudio setup" first.');try{let D=U1(S2,"utf-8"),F=JSON.parse(D);return V0.parse(F)}catch(D){throw Error(`Failed to load config: ${D.message}`)}}async function W2(D){if(!K0(N0))j1(N0,{recursive:!0});try{let F=V0.parse(D),E=JSON.stringify(F,null,2);L1(S2,E,"utf-8")}catch(F){throw Error(`Failed to save config: ${F.message}`)}}function C8(){return"http://10.114.1.119:8317"}async function X8(){return(await c()).defaultProfile}async function Q8(D){let F=await c();if(!F.profiles[D])throw Error(`Profile "${D}" not found`);F.defaultProfile=D,await W2(F)}async function J8(D){let F=await c();if(!F.profiles[D])throw Error(`Profile "${D}" not found`);if(delete F.profiles[D],F.defaultProfile===D)F.defaultProfile=void 0;await W2(F)}async function _8(){let D=await c();return Object.entries(D.profiles).map(([F,E])=>({name:F,profile:E,isDefault:D.defaultProfile===F}))}async function O0(D){return(await c()).profiles[D]}async function S0(D){let{message:F,models:E}=D,B=E.map((q)=>q.id);return await z0({message:F,source:async(q)=>{let C=(q||"").toLowerCase();return B.filter((Q)=>Q.toLowerCase().includes(C)).map((Q)=>({name:Q,value:Q}))}})}async function w0(D){let F=await S0({message:"Select OPUS model:",models:D}),E=await S0({message:"Select SONNET model:",models:D}),B=await S0({message:"Select HAIKU model:",models:D});return{opus:F,sonnet:E,haiku:B}}async function w2(D,F){return A0({message:D,default:F})}async function Y8(D,F=!1){return u0({message:D,default:F})}async function W8(){console.log(`
44
43
  \uD83D\uDD27 Claudio Setup
45
- `);let D=u8(),F=await l2("API URL",D),E=await I0({message:"API Key:",mask:"*"});if(!E)console.error(`
44
+ `);let D=C8(),F=await w2("API URL",D),E=await M0({message:"API Key:",mask:"*"});if(!E)console.error(`
46
45
  \u274C API key is required`),process.exit(1);process.stdout.write(`
47
- Testing connection... `);let B=await R2(F,E);if(!B.success)console.log("\u274C"),console.error(`
46
+ Testing connection... `);let B=await $2(F,E);if(!B.success)console.log("\u274C"),console.error(`
48
47
  \u274C ${B.message}`),process.exit(1);console.log(`\u2713 Connected (${B.modelCount} models available)`),console.log(`
49
48
  Create your first profile:
50
- `);let $=await l2("Profile name","main");if(!$)console.error(`
51
- \u274C Profile name is required`),process.exit(1);let q=B.models,{opus:X,sonnet:J,haiku:Q}=await g0(q),Y={opus:X,sonnet:J,haiku:Q},W={[$]:Y};await L2({apiUrl:F,apiKey:E,defaultProfile:$,profiles:W}),console.log(`
52
- \u2713 Profile "${$}" created and set as default`),console.log("\nRun `claudio` to launch, or `claudio profiles add` to create more.")}async function I8(){if(!a())console.error("\u274C No config found. Run `claudio setup` first."),process.exit(1);let D=await o();process.stdout.write("Fetching models... ");let F=await R2(D.apiUrl,D.apiKey);if(!F.success)console.log("\u274C"),console.error(`
53
- \u274C ${F.message}`),process.exit(1);console.log(`\u2713 (${F.modelCount} models)`),console.log("");let E=await l2("Profile name");if(!E)console.error(`
49
+ `);let $=await w2("Profile name","main");if(!$)console.error(`
50
+ \u274C Profile name is required`),process.exit(1);let q=B.models,{opus:C,sonnet:X,haiku:Q}=await w0(q),J={opus:C,sonnet:X,haiku:Q},_={[$]:J};await W2({apiUrl:F,apiKey:E,defaultProfile:$,profiles:_}),console.log(`
51
+ \u2713 Profile "${$}" created and set as default`),console.log("\nRun `claudio` to launch, or `claudio profiles add` to create more.")}async function G8(){if(!p())console.error("\u274C No config found. Run `claudio setup` first."),process.exit(1);let D=await c();process.stdout.write("Fetching models... ");let F=await $2(D.apiUrl,D.apiKey);if(!F.success)console.log("\u274C"),console.error(`
52
+ \u274C ${F.message}`),process.exit(1);console.log(`\u2713 (${F.modelCount} models)`),console.log("");let E=await w2("Profile name");if(!E)console.error(`
54
53
  \u274C Profile name is required`),process.exit(1);if(D.profiles[E])console.error(`
55
- \u274C Profile "${E}" already exists`),process.exit(1);let{opus:B,sonnet:$,haiku:q}=await g0(F.models);D.profiles[E]={opus:B,sonnet:$,haiku:q},await L2(D),console.log(`
56
- \u2713 Profile "${E}" created`)}async function P8(){await S8()}import{spawn as $5}from"child_process";import{existsSync as q5,readFileSync as X5}from"fs";import{join as J5}from"path";import{existsSync as l0,mkdirSync as sF,readFileSync as tF,writeFileSync as eF}from"fs";import{homedir as D5}from"os";import{join as T8}from"path";var dF=T.object({allowedPaths:T.array(T.string()).default(["~/projects","/tmp"])}),cF=T.object({logPath:T.string().default("~/.genie/audit.log")}),nF=T.object({alwaysAsk:T.array(T.string()).default(["Write","Edit"])}),iF=T.object({sessionName:T.string().default("genie"),windowName:T.string().default("shell")}),rF=T.object({tmuxDebug:T.boolean().default(!1)}),aF=T.object({enabled:T.array(T.enum(["collaborative","supervised","sandboxed","audited"])).default([]),collaborative:iF.optional(),supervised:nF.optional(),sandboxed:dF.optional(),audited:cF.optional()}),oF=T.object({name:T.string().default("genie"),defaultWindow:T.string().default("shell")}),N2=T.object({hooks:aF.default({}),session:oF.default({}),logging:rF.default({}),installMethod:T.enum(["source","npm","bun"]).optional()}),j4=[{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 m0=T8(D5(),".genie"),O2=T8(m0,"config.json");function S4(){return O2}function p0(){return l0(O2)}function F5(){if(!l0(m0))sF(m0,{recursive:!0})}async function p2(){if(!l0(O2))return N2.parse({});try{let D=tF(O2,"utf-8"),F=JSON.parse(D);return N2.parse(F)}catch(D){return console.warn(`Warning: Invalid genie config, using defaults: ${D.message}`),N2.parse({})}}async function I4(D){F5();try{let F=N2.parse(D),E=JSON.stringify(F,null,2);eF(O2,E,"utf-8")}catch(F){throw Error(`Failed to save genie config: ${F.message}`)}}function b8(D){let F=[];for(let E of D.hooks.enabled)switch(E){case"collaborative":{let B=D.hooks.collaborative||{},$=B.sessionName||"genie",q=B.windowName||"shell";F.push(`Collaborative: Bash \u2192 term exec ${$}:${q}`);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 d0(D){return D.hooks.enabled.length>0}function k8(D){let F=["collaborative","supervised","sandboxed","audited"];return D.split(",").map((B)=>B.trim().toLowerCase()).filter((B)=>F.includes(B))}function Q5(){let D=J5(process.cwd(),"AGENTS.md");if(q5(D))return X5(D,"utf-8");return null}function Y5(){let D=Q5();if(D)return["--system-prompt",D];return[]}async function W5(D){if(D.noHooks){console.log("\x1B[33m\u26A0\uFE0F Hooks disabled via --no-hooks\x1B[0m");return}if(D.hooks){let F=k8(D.hooks);if(F.length>0)console.log(`\x1B[36m\uD83E\uDE9D Using hooks: ${F.join(", ")}\x1B[0m`);return}if(p0()){let F=await p2();if(d0(F)){let E=b8(F);console.log("\x1B[36m\uD83E\uDE9D Active hooks:\x1B[0m");for(let B of E)console.log(` ${B}`)}}}async function H5(){if(!p0())return;let D=await p2();if(!d0(D))return;process.env.GENIE_HOOKS_ENABLED=D.hooks.enabled.join(",")}async function d2(D,F={}){let E=await o(),B=E.profiles[D];if(!B)console.error(`\u274C Profile "${D}" not found`),console.log(`
57
- Available profiles: ${Object.keys(E.profiles).join(", ")}`),process.exit(1);await W5(F),await H5(),console.log(`\uD83D\uDE80 Launching "${D}"...`),process.env.LC_ALL="C.UTF-8",process.env.LANG="C.UTF-8",process.env.ANTHROPIC_BASE_URL=E.apiUrl,process.env.ANTHROPIC_AUTH_TOKEN=E.apiKey,process.env.ANTHROPIC_DEFAULT_OPUS_MODEL=B.opus,process.env.ANTHROPIC_DEFAULT_SONNET_MODEL=B.sonnet,process.env.ANTHROPIC_DEFAULT_HAIKU_MODEL=B.haiku;let $=$5("claude",Y5(),{stdio:"inherit",env:process.env});$.on("error",(q)=>{console.error(`\u274C Failed to launch: ${q.message}`),process.exit(1)}),$.on("exit",(q)=>{process.exit(q||0)})}async function c0(D={}){if(!a())console.error("\u274C No config found. Run `claudio setup` first."),process.exit(1);let F=await K8();if(!F)console.error("\u274C No default profile set."),console.log("\nRun `claudio setup` to configure, or use `claudio <profile>` to launch a specific profile."),process.exit(1);await d2(F,D)}async function f8(){if(!a())console.error("\u274C No config found. Run `claudio setup` first."),process.exit(1);let D=await O8();if(D.length===0){console.log("No profiles configured."),console.log("Run `claudio profiles add` to create one.");return}console.log(`
54
+ \u274C Profile "${E}" already exists`),process.exit(1);let{opus:B,sonnet:$,haiku:q}=await w0(F.models);D.profiles[E]={opus:B,sonnet:$,haiku:q},await W2(D),console.log(`
55
+ \u2713 Profile "${E}" created`)}async function H8(){await W8()}import{spawn as N1}from"child_process";import{existsSync as K1,readFileSync as O1}from"fs";import{join as S1}from"path";function w1(){let D=S1(process.cwd(),"AGENTS.md");if(K1(D))return O1(D,"utf-8");return null}function I1(D=[]){let F=[],E=w1();if(E)F.push("--system-prompt",E);return F.push(...D),F}async function I2(D,F={}){let E=await c(),B=E.profiles[D];if(!B)console.error(`Profile "${D}" not found`),console.log(`
56
+ Available profiles: ${Object.keys(E.profiles).join(", ")}`),process.exit(1);console.log(`Launching "${D}"...`),process.env.LC_ALL="C.UTF-8",process.env.LANG="C.UTF-8",process.env.ANTHROPIC_BASE_URL=E.apiUrl,process.env.ANTHROPIC_AUTH_TOKEN=E.apiKey,process.env.ANTHROPIC_DEFAULT_OPUS_MODEL=B.opus,process.env.ANTHROPIC_DEFAULT_SONNET_MODEL=B.sonnet,process.env.ANTHROPIC_DEFAULT_HAIKU_MODEL=B.haiku;let $=N1("claude",I1(F.claudeArgs||[]),{stdio:"inherit",env:process.env});$.on("error",(q)=>{console.error(`Failed to launch: ${q.message}`),process.exit(1)}),$.on("exit",(q)=>{process.exit(q||0)})}async function b2(D={}){if(!p())console.error("No config found. Run `claudio setup` first."),process.exit(1);let F=await X8();if(!F)console.error("No default profile set."),console.log("\nRun `claudio setup` to configure, or use `claudio <profile>` to launch a specific profile."),process.exit(1);await I2(F,D)}async function u8(){if(!p())console.error("\u274C No config found. Run `claudio setup` first."),process.exit(1);let D=await _8();if(D.length===0){console.log("No profiles configured."),console.log("Run `claudio profiles add` to create one.");return}console.log(`
58
57
  Profiles:
59
- `);for(let{name:F,profile:E,isDefault:B}of D)console.log(` ${F}${B?" *":""}`),console.log(` opus: ${E.opus}`),console.log(` sonnet: ${E.sonnet}`),console.log(` haiku: ${E.haiku}`),console.log("");console.log("(* = default)")}async function v8(){await I8()}async function Z8(D){if(!a())console.error("\u274C No config found. Run `claudio setup` first."),process.exit(1);if(!await y0(D))console.error(`\u274C Profile "${D}" not found`),process.exit(1);if(!await w8(`Delete profile "${D}"?`)){console.log("Cancelled.");return}await N8(D),console.log(`\u2713 Profile "${D}" deleted`)}async function x8(D){if(!a())console.error("\u274C No config found. Run `claudio setup` first."),process.exit(1);try{await L8(D),console.log(`\u2713 Default profile set to "${D}"`)}catch(F){console.error(`\u274C ${F.message}`),process.exit(1)}}async function y8(D){if(!a())console.error("\u274C No config found. Run `claudio setup` first."),process.exit(1);let F=await y0(D);if(!F)console.error(`\u274C Profile "${D}" not found`),process.exit(1);console.log(`
58
+ `);for(let{name:F,profile:E,isDefault:B}of D)console.log(` ${F}${B?" *":""}`),console.log(` opus: ${E.opus}`),console.log(` sonnet: ${E.sonnet}`),console.log(` haiku: ${E.haiku}`),console.log("");console.log("(* = default)")}async function A8(){await G8()}async function M8(D){if(!p())console.error("\u274C No config found. Run `claudio setup` first."),process.exit(1);if(!await O0(D))console.error(`\u274C Profile "${D}" not found`),process.exit(1);if(!await Y8(`Delete profile "${D}"?`)){console.log("Cancelled.");return}await J8(D),console.log(`\u2713 Profile "${D}" deleted`)}async function R8(D){if(!p())console.error("\u274C No config found. Run `claudio setup` first."),process.exit(1);try{await Q8(D),console.log(`\u2713 Default profile set to "${D}"`)}catch(F){console.error(`\u274C ${F.message}`),process.exit(1)}}async function z8(D){if(!p())console.error("\u274C No config found. Run `claudio setup` first."),process.exit(1);let F=await O0(D);if(!F)console.error(`\u274C Profile "${D}" not found`),process.exit(1);console.log(`
60
59
  Profile: ${D}
61
- `),console.log(` opus: ${F.opus}`),console.log(` sonnet: ${F.sonnet}`),console.log(` haiku: ${F.haiku}`)}async function h8(){if(!a())console.error("\u274C No config found. Run `claudio setup` first."),process.exit(1);let D=await o();process.stdout.write("Fetching models... ");let F=await R2(D.apiUrl,D.apiKey);if(!F.success)console.log("\u274C"),console.error(`
60
+ `),console.log(` opus: ${F.opus}`),console.log(` sonnet: ${F.sonnet}`),console.log(` haiku: ${F.haiku}`)}async function j8(){if(!p())console.error("\u274C No config found. Run `claudio setup` first."),process.exit(1);let D=await c();process.stdout.write("Fetching models... ");let F=await $2(D.apiUrl,D.apiKey);if(!F.success)console.log("\u274C"),console.error(`
62
61
  \u274C ${F.message}`),process.exit(1);console.log(`\u2713
63
62
  `),console.log(`Available models (${F.modelCount}):
64
- `);for(let E of F.models)console.log(` ${E.id}`)}async function g8(){if(!a())console.error("\u274C No config found. Run `claudio setup` first."),process.exit(1);let D=await o(),F=Object.keys(D.profiles).length;console.log(`
63
+ `);for(let E of F.models)console.log(` ${E.id}`)}async function U8(){if(!p())console.error("\u274C No config found. Run `claudio setup` first."),process.exit(1);let D=await c(),F=Object.keys(D.profiles).length;console.log(`
65
64
  Claudio Config
66
- `),console.log(` API URL: ${D.apiUrl}`),console.log(` API Key: ${D.apiKey.slice(0,8)}...${D.apiKey.slice(-4)}`),console.log(` Default Profile: ${D.defaultProfile||"(none)"}`),console.log(` Profiles: ${F}`)}var SD=new Q3;SD.name("claudio").description("Launch Claude Code with custom LLM router profiles").version(Y3).option("--hooks <presets>","Override hooks (comma-separated: collaborative,supervised,sandboxed,audited)").option("--no-hooks","Disable all hooks");SD.command("setup").description("First-time setup wizard").action(async()=>{await P8()});SD.command("launch [profile]").description("Launch Claude Code with optional profile").option("--hooks <presets>","Override hooks (comma-separated)").option("--no-hooks","Disable all hooks").action(async(D,F)=>{let E={hooks:F.hooks,noHooks:F.noHooks};if(D)await d2(D,E);else await c0(E)});var w2=SD.command("profiles").description("Manage profiles");w2.command("list",{isDefault:!0}).description("List all profiles (* = default)").action(async()=>{await f8()});w2.command("add").description("Add new profile (interactive picker)").action(async()=>{await v8()});w2.command("rm <name>").description("Delete profile").action(async(D)=>{await Z8(D)});w2.command("default <name>").description("Set default profile").action(async(D)=>{await x8(D)});w2.command("show <name>").description("Show profile details").action(async(D)=>{await y8(D)});SD.command("models").description("List available models from router").action(async()=>{await h8()});SD.command("config").description("Show current config (URL, default profile)").action(async()=>{await g8()});SD.action(async(D,F)=>{let E=F.args,B={hooks:D.hooks,noHooks:D.hooks===!1};if(E.length===0){await c0(B);return}let $=E[0];await d2($,B)});SD.parse();
65
+ `),console.log(` API URL: ${D.apiUrl}`),console.log(` API Key: ${D.apiKey.slice(0,8)}...${D.apiKey.slice(-4)}`),console.log(` Default Profile: ${D.defaultProfile||"(none)"}`),console.log(` Profiles: ${F}`)}var P2=process.argv.indexOf("--"),k2=P2!==-1?process.argv.slice(P2+1):[],L8=P2!==-1?process.argv.slice(0,P2):process.argv;if(k2.length>0&&L8.length===2)await b2({claudeArgs:k2});else{let D=new d0;D.name("claudio").description("Launch Claude Code with custom LLM router profiles").version(n0),D.command("setup").description("First-time setup wizard").action(async()=>{await H8()}),D.command("launch [profile]").description("Launch Claude Code with optional profile (use -- to pass args to Claude)").action(async(E)=>{let B={claudeArgs:k2};if(E)await I2(E,B);else await b2(B)});let F=D.command("profiles").description("Manage profiles");F.command("list",{isDefault:!0}).description("List all profiles (* = default)").action(async()=>{await u8()}),F.command("add").description("Add new profile (interactive picker)").action(async()=>{await A8()}),F.command("rm <name>").description("Delete profile").action(async(E)=>{await M8(E)}),F.command("default <name>").description("Set default profile").action(async(E)=>{await R8(E)}),F.command("show <name>").description("Show profile details").action(async(E)=>{await z8(E)}),D.command("models").description("List available models from router").action(async()=>{await j8()}),D.command("config").description("Show current config (URL, default profile)").action(async()=>{await U8()}),D.action(async(E,B)=>{let q=B.args[0],C={claudeArgs:k2};if(q)await I2(q,C);else await b2(C)}),D.parse(L8)}