oh-my-agent 4.23.4 → 4.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.js +312 -306
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -1,387 +1,393 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createRequire as
|
|
3
|
-
`)}displayWidth($){return
|
|
4
|
-
`+" ".repeat(I+J));return z+g+" ".repeat(J)+
|
|
5
|
-
${z}`)}boxWrap($,I){if(I<this.minWidthToWrap)return $;let _=$.split(/\r\n|\n/),u=/[\s]*[^\s]+/g,U=[];return _.forEach((z)=>{let g=z.match(u);if(g===null){U.push("");return}let J=[g.shift()],G=this.displayWidth(J[0]);g.forEach((
|
|
6
|
-
`)}}function
|
|
2
|
+
import{createRequire as qB}from"node:module";var $B=Object.create;var{getPrototypeOf:IB,defineProperty:m2,getOwnPropertyNames:UB}=Object;var _B=Object.prototype.hasOwnProperty;function uB($){return this[$]}var zB,gB,v$=($,I,_)=>{var u=$!=null&&typeof $==="object";if(u){var U=I?zB??=new WeakMap:gB??=new WeakMap,z=U.get($);if(z)return z}_=$!=null?$B(IB($)):{};let g=I||!$||!$.__esModule?m2(_,"default",{value:$,enumerable:!0}):_;for(let J of UB($))if(!_B.call(g,J))m2(g,J,{get:uB.bind($,J),enumerable:!0});if(u)U.set($,g);return g};var w=($,I)=>()=>(I||$((I={exports:{}}).exports,I),I.exports);var JB=($)=>$;function GB($,I){this[$]=JB.bind(null,I)}var S4=($,I)=>{for(var _ in I)m2($,_,{get:I[_],enumerable:!0,configurable:!0,set:GB.bind(I,_)})};var b0=($,I)=>()=>($&&(I=$($=0)),I);var z$=qB(import.meta.url);var A0=w((XB)=>{class r2 extends Error{constructor($,I,_){super(_);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=I,this.exitCode=$,this.nestedError=void 0}}class I5 extends r2{constructor($){super(1,"commander.invalidArgument",$);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}XB.CommanderError=r2;XB.InvalidArgumentError=I5});var qU=w((YB)=>{var{InvalidArgumentError:vB}=A0();class U5{constructor($,I){switch(this.description=I||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,$[0]){case"<":this.required=!0,this._name=$.slice(1,-1);break;case"[":this.required=!1,this._name=$.slice(1,-1);break;default:this.required=!0,this._name=$;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue($,I){if(I===this.defaultValue||!Array.isArray(I))return[$];return I.push($),I}default($,I){return this.defaultValue=$,this.defaultValueDescription=I,this}argParser($){return this.parseArg=$,this}choices($){return this.argChoices=$.slice(),this.parseArg=(I,_)=>{if(!this.argChoices.includes(I))throw new vB(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(I,_);return I},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function HB($){let I=$.name()+($.variadic===!0?"...":"");return $.required?"<"+I+">":"["+I+"]"}YB.Argument=U5;YB.humanReadableArgName=HB});var n2=w((DB)=>{var{humanReadableArgName:BB}=qU();class _5{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext($){this.helpWidth=this.helpWidth??$.helpWidth??80}visibleCommands($){let I=$.commands.filter((u)=>!u._hidden),_=$._getHelpCommand();if(_&&!_._hidden)I.push(_);if(this.sortSubcommands)I.sort((u,U)=>{return u.name().localeCompare(U.name())});return I}compareOptions($,I){let _=(u)=>{return u.short?u.short.replace(/^-/,""):u.long.replace(/^--/,"")};return _($).localeCompare(_(I))}visibleOptions($){let I=$.options.filter((u)=>!u.hidden),_=$._getHelpOption();if(_&&!_.hidden){let u=_.short&&$._findOption(_.short),U=_.long&&$._findOption(_.long);if(!u&&!U)I.push(_);else if(_.long&&!U)I.push($.createOption(_.long,_.description));else if(_.short&&!u)I.push($.createOption(_.short,_.description))}if(this.sortOptions)I.sort(this.compareOptions);return I}visibleGlobalOptions($){if(!this.showGlobalOptions)return[];let I=[];for(let _=$.parent;_;_=_.parent){let u=_.options.filter((U)=>!U.hidden);I.push(...u)}if(this.sortOptions)I.sort(this.compareOptions);return I}visibleArguments($){if($._argsDescription)$.registeredArguments.forEach((I)=>{I.description=I.description||$._argsDescription[I.name()]||""});if($.registeredArguments.find((I)=>I.description))return $.registeredArguments;return[]}subcommandTerm($){let I=$.registeredArguments.map((_)=>BB(_)).join(" ");return $._name+($._aliases[0]?"|"+$._aliases[0]:"")+($.options.length?" [options]":"")+(I?" "+I:"")}optionTerm($){return $.flags}argumentTerm($){return $.name()}longestSubcommandTermLength($,I){return I.visibleCommands($).reduce((_,u)=>{return Math.max(_,this.displayWidth(I.styleSubcommandTerm(I.subcommandTerm(u))))},0)}longestOptionTermLength($,I){return I.visibleOptions($).reduce((_,u)=>{return Math.max(_,this.displayWidth(I.styleOptionTerm(I.optionTerm(u))))},0)}longestGlobalOptionTermLength($,I){return I.visibleGlobalOptions($).reduce((_,u)=>{return Math.max(_,this.displayWidth(I.styleOptionTerm(I.optionTerm(u))))},0)}longestArgumentTermLength($,I){return I.visibleArguments($).reduce((_,u)=>{return Math.max(_,this.displayWidth(I.styleArgumentTerm(I.argumentTerm(u))))},0)}commandUsage($){let I=$._name;if($._aliases[0])I=I+"|"+$._aliases[0];let _="";for(let u=$.parent;u;u=u.parent)_=u.name()+" "+_;return _+I+" "+$.usage()}commandDescription($){return $.description()}subcommandDescription($){return $.summary()||$.description()}optionDescription($){let I=[];if($.argChoices)I.push(`choices: ${$.argChoices.map((_)=>JSON.stringify(_)).join(", ")}`);if($.defaultValue!==void 0){if($.required||$.optional||$.isBoolean()&&typeof $.defaultValue==="boolean")I.push(`default: ${$.defaultValueDescription||JSON.stringify($.defaultValue)}`)}if($.presetArg!==void 0&&$.optional)I.push(`preset: ${JSON.stringify($.presetArg)}`);if($.envVar!==void 0)I.push(`env: ${$.envVar}`);if(I.length>0){let _=`(${I.join(", ")})`;if($.description)return`${$.description} ${_}`;return _}return $.description}argumentDescription($){let I=[];if($.argChoices)I.push(`choices: ${$.argChoices.map((_)=>JSON.stringify(_)).join(", ")}`);if($.defaultValue!==void 0)I.push(`default: ${$.defaultValueDescription||JSON.stringify($.defaultValue)}`);if(I.length>0){let _=`(${I.join(", ")})`;if($.description)return`${$.description} ${_}`;return _}return $.description}formatItemList($,I,_){if(I.length===0)return[];return[_.styleTitle($),...I,""]}groupItems($,I,_){let u=new Map;return $.forEach((U)=>{let z=_(U);if(!u.has(z))u.set(z,[])}),I.forEach((U)=>{let z=_(U);if(!u.has(z))u.set(z,[]);u.get(z).push(U)}),u}formatHelp($,I){let _=I.padWidth($,I),u=I.helpWidth??80;function U(N,X){return I.formatItem(N,_,X,I)}let z=[`${I.styleTitle("Usage:")} ${I.styleUsage(I.commandUsage($))}`,""],g=I.commandDescription($);if(g.length>0)z=z.concat([I.boxWrap(I.styleCommandDescription(g),u),""]);let J=I.visibleArguments($).map((N)=>{return U(I.styleArgumentTerm(I.argumentTerm(N)),I.styleArgumentDescription(I.argumentDescription(N)))});if(z=z.concat(this.formatItemList("Arguments:",J,I)),this.groupItems($.options,I.visibleOptions($),(N)=>N.helpGroupHeading??"Options:").forEach((N,X)=>{let Q=N.map((H)=>{return U(I.styleOptionTerm(I.optionTerm(H)),I.styleOptionDescription(I.optionDescription(H)))});z=z.concat(this.formatItemList(X,Q,I))}),I.showGlobalOptions){let N=I.visibleGlobalOptions($).map((X)=>{return U(I.styleOptionTerm(I.optionTerm(X)),I.styleOptionDescription(I.optionDescription(X)))});z=z.concat(this.formatItemList("Global Options:",N,I))}return this.groupItems($.commands,I.visibleCommands($),(N)=>N.helpGroup()||"Commands:").forEach((N,X)=>{let Q=N.map((H)=>{return U(I.styleSubcommandTerm(I.subcommandTerm(H)),I.styleSubcommandDescription(I.subcommandDescription(H)))});z=z.concat(this.formatItemList(X,Q,I))}),z.join(`
|
|
3
|
+
`)}displayWidth($){return u5($).length}styleTitle($){return $}styleUsage($){return $.split(" ").map((I)=>{if(I==="[options]")return this.styleOptionText(I);if(I==="[command]")return this.styleSubcommandText(I);if(I[0]==="["||I[0]==="<")return this.styleArgumentText(I);return this.styleCommandText(I)}).join(" ")}styleCommandDescription($){return this.styleDescriptionText($)}styleOptionDescription($){return this.styleDescriptionText($)}styleSubcommandDescription($){return this.styleDescriptionText($)}styleArgumentDescription($){return this.styleDescriptionText($)}styleDescriptionText($){return $}styleOptionTerm($){return this.styleOptionText($)}styleSubcommandTerm($){return $.split(" ").map((I)=>{if(I==="[options]")return this.styleOptionText(I);if(I[0]==="["||I[0]==="<")return this.styleArgumentText(I);return this.styleSubcommandText(I)}).join(" ")}styleArgumentTerm($){return this.styleArgumentText($)}styleOptionText($){return $}styleArgumentText($){return $}styleSubcommandText($){return $}styleCommandText($){return $}padWidth($,I){return Math.max(I.longestOptionTermLength($,I),I.longestGlobalOptionTermLength($,I),I.longestSubcommandTermLength($,I),I.longestArgumentTermLength($,I))}preformatted($){return/\n[^\S\r\n]/.test($)}formatItem($,I,_,u){let z=" ".repeat(2);if(!_)return z+$;let g=$.padEnd(I+$.length-u.displayWidth($)),J=2,q=(this.helpWidth??80)-I-J-2,N;if(q<this.minWidthToWrap||u.preformatted(_))N=_;else N=u.boxWrap(_,q).replace(/\n/g,`
|
|
4
|
+
`+" ".repeat(I+J));return z+g+" ".repeat(J)+N.replace(/\n/g,`
|
|
5
|
+
${z}`)}boxWrap($,I){if(I<this.minWidthToWrap)return $;let _=$.split(/\r\n|\n/),u=/[\s]*[^\s]+/g,U=[];return _.forEach((z)=>{let g=z.match(u);if(g===null){U.push("");return}let J=[g.shift()],G=this.displayWidth(J[0]);g.forEach((q)=>{let N=this.displayWidth(q);if(G+N<=I){J.push(q),G+=N;return}U.push(J.join(""));let X=q.trimStart();J=[X],G=this.displayWidth(X)}),U.push(J.join(""))}),U.join(`
|
|
6
|
+
`)}}function u5($){let I=/\x1b\[\d*(;\d*)*m/g;return $.replace(I,"")}DB.Help=_5;DB.stripColor=u5});var h2=w((LB)=>{var{InvalidArgumentError:VB}=A0();class g5{constructor($,I){this.flags=$,this.description=I||"",this.required=$.includes("<"),this.optional=$.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test($),this.mandatory=!1;let _=RB($);if(this.short=_.shortFlag,this.long=_.longFlag,this.negate=!1,this.long)this.negate=this.long.startsWith("--no-");this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default($,I){return this.defaultValue=$,this.defaultValueDescription=I,this}preset($){return this.presetArg=$,this}conflicts($){return this.conflictsWith=this.conflictsWith.concat($),this}implies($){let I=$;if(typeof $==="string")I={[$]:!0};return this.implied=Object.assign(this.implied||{},I),this}env($){return this.envVar=$,this}argParser($){return this.parseArg=$,this}makeOptionMandatory($=!0){return this.mandatory=!!$,this}hideHelp($=!0){return this.hidden=!!$,this}_collectValue($,I){if(I===this.defaultValue||!Array.isArray(I))return[$];return I.push($),I}choices($){return this.argChoices=$.slice(),this.parseArg=(I,_)=>{if(!this.argChoices.includes(I))throw new VB(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(I,_);return I},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return z5(this.name().replace(/^no-/,""));return z5(this.name())}helpGroup($){return this.helpGroupHeading=$,this}is($){return this.short===$||this.long===$}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class J5{constructor($){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,$.forEach((I)=>{if(I.negate)this.negativeOptions.set(I.attributeName(),I);else this.positiveOptions.set(I.attributeName(),I)}),this.negativeOptions.forEach((I,_)=>{if(this.positiveOptions.has(_))this.dualOptions.add(_)})}valueFromOption($,I){let _=I.attributeName();if(!this.dualOptions.has(_))return!0;let u=this.negativeOptions.get(_).presetArg,U=u!==void 0?u:!1;return I.negate===(U===$)}}function z5($){return $.split("-").reduce((I,_)=>{return I+_[0].toUpperCase()+_.slice(1)})}function RB($){let I,_,u=/^-[^-]$/,U=/^--[^-]/,z=$.split(/[ |,]+/).concat("guard");if(u.test(z[0]))I=z.shift();if(U.test(z[0]))_=z.shift();if(!I&&u.test(z[0]))I=z.shift();if(!I&&U.test(z[0]))I=_,_=z.shift();if(z[0].startsWith("-")){let g=z[0],J=`option creation failed due to '${g}' in option flags '${$}'`;if(/^-[^-][^-]/.test(g))throw Error(`${J}
|
|
7
7
|
- a short flag is a single dash and a single character
|
|
8
8
|
- either use a single dash and a single character (for a short flag)
|
|
9
9
|
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(u.test(g))throw Error(`${J}
|
|
10
10
|
- too many short flags`);if(U.test(g))throw Error(`${J}
|
|
11
11
|
- too many long flags`);throw Error(`${J}
|
|
12
|
-
- unrecognised flag format`)}if(I===void 0&&_===void 0)throw Error(`option creation failed due to no flags found in '${$}'.`);return{shortFlag:I,longFlag:_}}LB.Option=
|
|
12
|
+
- unrecognised flag format`)}if(I===void 0&&_===void 0)throw Error(`option creation failed due to no flags found in '${$}'.`);return{shortFlag:I,longFlag:_}}LB.Option=g5;LB.DualOptions=J5});var G5=w((AB)=>{function PB($,I){if(Math.abs($.length-I.length)>3)return Math.max($.length,I.length);let _=[];for(let u=0;u<=$.length;u++)_[u]=[u];for(let u=0;u<=I.length;u++)_[0][u]=u;for(let u=1;u<=I.length;u++)for(let U=1;U<=$.length;U++){let z=1;if($[U-1]===I[u-1])z=0;else z=1;if(_[U][u]=Math.min(_[U-1][u]+1,_[U][u-1]+1,_[U-1][u-1]+z),U>1&&u>1&&$[U-1]===I[u-2]&&$[U-2]===I[u-1])_[U][u]=Math.min(_[U][u],_[U-2][u-2]+1)}return _[$.length][I.length]}function bB($,I){if(!I||I.length===0)return"";I=Array.from(new Set(I));let _=$.startsWith("--");if(_)$=$.slice(2),I=I.map((g)=>g.slice(2));let u=[],U=3,z=0.4;if(I.forEach((g)=>{if(g.length<=1)return;let J=PB($,g),G=Math.max($.length,g.length);if((G-J)/G>z){if(J<U)U=J,u=[g];else if(J===U)u.push(g)}}),u.sort((g,J)=>g.localeCompare(J)),_)u=u.map((g)=>`--${g}`);if(u.length>1)return`
|
|
13
13
|
(Did you mean one of ${u.join(", ")}?)`;if(u.length===1)return`
|
|
14
|
-
(Did you mean ${u[0]}?)`;return""}
|
|
15
|
-
- specify the name in Command constructor or using .name()`);if(I=I||{},I.isDefault)this._defaultCommandName=$._name;if(I.noHelp||I.hidden)$._hidden=!0;return this._registerCommand($),$.parent=this,$._checkForBrokenPassThrough(),this}createArgument($,I){return new
|
|
16
|
-
Expecting one of '${_.join("', '")}'`);if(this._lifeCycleHooks[$])this._lifeCycleHooks[$].push(I);else this._lifeCycleHooks[$]=[I];return this}exitOverride($){if($)this._exitCallback=$;else this._exitCallback=(I)=>{if(I.code!=="commander.executeSubCommandAsync")throw I};return this}_exit($,I,_){if(this._exitCallback)this._exitCallback(new
|
|
17
|
-
- already used by option '${I.flags}'`)}this._initOptionGroup($),this.options.push($)}_registerCommand($){let I=(u)=>{return[u.name()].concat(u.aliases())},_=I($).find((u)=>this._findCommand(u));if(_){let u=I(this._findCommand(_)).join("|"),U=I($).join("|");throw Error(`cannot add command '${U}' as already have command '${u}'`)}this._initCommandGroup($),this.commands.push($)}addOption($){this._registerOption($);let I=$.name(),_=$.attributeName();if($.negate){let U=$.long.replace(/^--no-/,"--");if(!this._findOption(U))this.setOptionValueWithSource(_,$.defaultValue===void 0?!0:$.defaultValue,"default")}else if($.defaultValue!==void 0)this.setOptionValueWithSource(_,$.defaultValue,"default");let u=(U,z,g)=>{if(U==null&&$.presetArg!==void 0)U=$.presetArg;let J=this.getOptionValue(_);if(U!==null&&$.parseArg)U=this._callParseArg($,U,J,z);else if(U!==null&&$.variadic)U=$._collectValue(U,J);if(U==null)if($.negate)U=!1;else if($.isBoolean()||$.optional)U=!0;else U="";this.setOptionValueWithSource(_,U,g)};if(this.on("option:"+I,(U)=>{let z=`error: option '${$.flags}' argument '${U}' is invalid.`;u(U,z,"cli")}),$.envVar)this.on("optionEnv:"+I,(U)=>{let z=`error: option '${$.flags}' value '${U}' from env '${$.envVar}' is invalid.`;u(U,z,"env")});return this}_optionEx($,I,_,u,U){if(typeof I==="object"&&I instanceof
|
|
18
|
-
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable($,I,_){if(
|
|
14
|
+
(Did you mean ${u[0]}?)`;return""}AB.suggestSimilar=bB});var Q5=w((xB)=>{var FB=z$("node:events").EventEmitter,d2=z$("node:child_process"),d4=z$("node:path"),XU=z$("node:fs"),U$=z$("node:process"),{Argument:SB,humanReadableArgName:wB}=qU(),{CommanderError:c2}=A0(),{Help:EB,stripColor:CB}=n2(),{Option:q5,DualOptions:fB}=h2(),{suggestSimilar:X5}=G5();class o2 extends FB{constructor($){super();this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=$||"",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._savedState=null,this._outputConfiguration={writeOut:(I)=>U$.stdout.write(I),writeErr:(I)=>U$.stderr.write(I),outputError:(I,_)=>_(I),getOutHelpWidth:()=>U$.stdout.isTTY?U$.stdout.columns:void 0,getErrHelpWidth:()=>U$.stderr.isTTY?U$.stderr.columns:void 0,getOutHasColors:()=>p2()??(U$.stdout.isTTY&&U$.stdout.hasColors?.()),getErrHasColors:()=>p2()??(U$.stderr.isTTY&&U$.stderr.hasColors?.()),stripColor:(I)=>CB(I)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings($){return this._outputConfiguration=$._outputConfiguration,this._helpOption=$._helpOption,this._helpCommand=$._helpCommand,this._helpConfiguration=$._helpConfiguration,this._exitCallback=$._exitCallback,this._storeOptionsAsProperties=$._storeOptionsAsProperties,this._combineFlagAndOptionalValue=$._combineFlagAndOptionalValue,this._allowExcessArguments=$._allowExcessArguments,this._enablePositionalOptions=$._enablePositionalOptions,this._showHelpAfterError=$._showHelpAfterError,this._showSuggestionAfterError=$._showSuggestionAfterError,this}_getCommandAndAncestors(){let $=[];for(let I=this;I;I=I.parent)$.push(I);return $}command($,I,_){let u=I,U=_;if(typeof u==="object"&&u!==null)U=u,u=null;U=U||{};let[,z,g]=$.match(/([^ ]+) *(.*)/),J=this.createCommand(z);if(u)J.description(u),J._executableHandler=!0;if(U.isDefault)this._defaultCommandName=J._name;if(J._hidden=!!(U.noHelp||U.hidden),J._executableFile=U.executableFile||null,g)J.arguments(g);if(this._registerCommand(J),J.parent=this,J.copyInheritedSettings(this),u)return this;return J}createCommand($){return new o2($)}createHelp(){return Object.assign(new EB,this.configureHelp())}configureHelp($){if($===void 0)return this._helpConfiguration;return this._helpConfiguration=$,this}configureOutput($){if($===void 0)return this._outputConfiguration;return this._outputConfiguration={...this._outputConfiguration,...$},this}showHelpAfterError($=!0){if(typeof $!=="string")$=!!$;return this._showHelpAfterError=$,this}showSuggestionAfterError($=!0){return this._showSuggestionAfterError=!!$,this}addCommand($,I){if(!$._name)throw Error(`Command passed to .addCommand() must have a name
|
|
15
|
+
- specify the name in Command constructor or using .name()`);if(I=I||{},I.isDefault)this._defaultCommandName=$._name;if(I.noHelp||I.hidden)$._hidden=!0;return this._registerCommand($),$.parent=this,$._checkForBrokenPassThrough(),this}createArgument($,I){return new SB($,I)}argument($,I,_,u){let U=this.createArgument($,I);if(typeof _==="function")U.default(u).argParser(_);else U.default(_);return this.addArgument(U),this}arguments($){return $.trim().split(/ +/).forEach((I)=>{this.argument(I)}),this}addArgument($){let I=this.registeredArguments.slice(-1)[0];if(I?.variadic)throw Error(`only the last argument can be variadic '${I.name()}'`);if($.required&&$.defaultValue!==void 0&&$.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${$.name()}'`);return this.registeredArguments.push($),this}helpCommand($,I){if(typeof $==="boolean"){if(this._addImplicitHelpCommand=$,$&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let _=$??"help [command]",[,u,U]=_.match(/([^ ]+) *(.*)/),z=I??"display help for command",g=this.createCommand(u);if(g.helpOption(!1),U)g.arguments(U);if(z)g.description(z);if(this._addImplicitHelpCommand=!0,this._helpCommand=g,$||I)this._initCommandGroup(g);return this}addHelpCommand($,I){if(typeof $!=="object")return this.helpCommand($,I),this;return this._addImplicitHelpCommand=!0,this._helpCommand=$,this._initCommandGroup($),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($,I){let _=["preSubcommand","preAction","postAction"];if(!_.includes($))throw Error(`Unexpected value for event passed to hook : '${$}'.
|
|
16
|
+
Expecting one of '${_.join("', '")}'`);if(this._lifeCycleHooks[$])this._lifeCycleHooks[$].push(I);else this._lifeCycleHooks[$]=[I];return this}exitOverride($){if($)this._exitCallback=$;else this._exitCallback=(I)=>{if(I.code!=="commander.executeSubCommandAsync")throw I};return this}_exit($,I,_){if(this._exitCallback)this._exitCallback(new c2($,I,_));U$.exit($)}action($){let I=(_)=>{let u=this.registeredArguments.length,U=_.slice(0,u);if(this._storeOptionsAsProperties)U[u]=this;else U[u]=this.opts();return U.push(this),$.apply(this,U)};return this._actionHandler=I,this}createOption($,I){return new q5($,I)}_callParseArg($,I,_,u){try{return $.parseArg(I,_)}catch(U){if(U.code==="commander.invalidArgument"){let z=`${u} ${U.message}`;this.error(z,{exitCode:U.exitCode,code:U.code})}throw U}}_registerOption($){let I=$.short&&this._findOption($.short)||$.long&&this._findOption($.long);if(I){let _=$.long&&this._findOption($.long)?$.long:$.short;throw Error(`Cannot add option '${$.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${_}'
|
|
17
|
+
- already used by option '${I.flags}'`)}this._initOptionGroup($),this.options.push($)}_registerCommand($){let I=(u)=>{return[u.name()].concat(u.aliases())},_=I($).find((u)=>this._findCommand(u));if(_){let u=I(this._findCommand(_)).join("|"),U=I($).join("|");throw Error(`cannot add command '${U}' as already have command '${u}'`)}this._initCommandGroup($),this.commands.push($)}addOption($){this._registerOption($);let I=$.name(),_=$.attributeName();if($.negate){let U=$.long.replace(/^--no-/,"--");if(!this._findOption(U))this.setOptionValueWithSource(_,$.defaultValue===void 0?!0:$.defaultValue,"default")}else if($.defaultValue!==void 0)this.setOptionValueWithSource(_,$.defaultValue,"default");let u=(U,z,g)=>{if(U==null&&$.presetArg!==void 0)U=$.presetArg;let J=this.getOptionValue(_);if(U!==null&&$.parseArg)U=this._callParseArg($,U,J,z);else if(U!==null&&$.variadic)U=$._collectValue(U,J);if(U==null)if($.negate)U=!1;else if($.isBoolean()||$.optional)U=!0;else U="";this.setOptionValueWithSource(_,U,g)};if(this.on("option:"+I,(U)=>{let z=`error: option '${$.flags}' argument '${U}' is invalid.`;u(U,z,"cli")}),$.envVar)this.on("optionEnv:"+I,(U)=>{let z=`error: option '${$.flags}' value '${U}' from env '${$.envVar}' is invalid.`;u(U,z,"env")});return this}_optionEx($,I,_,u,U){if(typeof I==="object"&&I instanceof q5)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let z=this.createOption(I,_);if(z.makeOptionMandatory(!!$.mandatory),typeof u==="function")z.default(U).argParser(u);else if(u instanceof RegExp){let g=u;u=(J,G)=>{let q=g.exec(J);return q?q[0]:G},z.default(U).argParser(u)}else z.default(u);return this.addOption(z)}option($,I,_,u){return this._optionEx({},$,I,_,u)}requiredOption($,I,_,u){return this._optionEx({mandatory:!0},$,I,_,u)}combineFlagAndOptionalValue($=!0){return this._combineFlagAndOptionalValue=!!$,this}allowUnknownOption($=!0){return this._allowUnknownOption=!!$,this}allowExcessArguments($=!0){return this._allowExcessArguments=!!$,this}enablePositionalOptions($=!0){return this._enablePositionalOptions=!!$,this}passThroughOptions($=!0){return this._passThroughOptions=!!$,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($=!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=!!$,this}getOptionValue($){if(this._storeOptionsAsProperties)return this[$];return this._optionValues[$]}setOptionValue($,I){return this.setOptionValueWithSource($,I,void 0)}setOptionValueWithSource($,I,_){if(this._storeOptionsAsProperties)this[$]=I;else this._optionValues[$]=I;return this._optionValueSources[$]=_,this}getOptionValueSource($){return this._optionValueSources[$]}getOptionValueSourceWithGlobals($){let I;return this._getCommandAndAncestors().forEach((_)=>{if(_.getOptionValueSource($)!==void 0)I=_.getOptionValueSource($)}),I}_prepareUserArgs($,I){if($!==void 0&&!Array.isArray($))throw Error("first parameter to parse must be array or undefined");if(I=I||{},$===void 0&&I.from===void 0){if(U$.versions?.electron)I.from="electron";let u=U$.execArgv??[];if(u.includes("-e")||u.includes("--eval")||u.includes("-p")||u.includes("--print"))I.from="eval"}if($===void 0)$=U$.argv;this.rawArgs=$.slice();let _;switch(I.from){case void 0:case"node":this._scriptPath=$[1],_=$.slice(2);break;case"electron":if(U$.defaultApp)this._scriptPath=$[1],_=$.slice(2);else _=$.slice(1);break;case"user":_=$.slice(0);break;case"eval":_=$.slice(1);break;default:throw Error(`unexpected parse option { from: '${I.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",_}parse($,I){this._prepareForParse();let _=this._prepareUserArgs($,I);return this._parseCommand([],_),this}async parseAsync($,I){this._prepareForParse();let _=this._prepareUserArgs($,I);return await this._parseCommand([],_),this}_prepareForParse(){if(this._savedState===null)this.saveStateBeforeParse();else this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
|
|
18
|
+
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable($,I,_){if(XU.existsSync($))return;let u=I?`searched for local subcommand relative to directory '${I}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",U=`'${$}' does not exist
|
|
19
19
|
- if '${_}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
20
20
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
21
|
-
- ${u}`;throw Error(U)}_executeSubCommand($,I){I=I.slice();let _=!1,u=[".js",".ts",".tsx",".mjs",".cjs"];function U(
|
|
21
|
+
- ${u}`;throw Error(U)}_executeSubCommand($,I){I=I.slice();let _=!1,u=[".js",".ts",".tsx",".mjs",".cjs"];function U(q,N){let X=d4.resolve(q,N);if(XU.existsSync(X))return X;if(u.includes(d4.extname(N)))return;let Q=u.find((H)=>XU.existsSync(`${X}${H}`));if(Q)return`${X}${Q}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let z=$._executableFile||`${this._name}-${$._name}`,g=this._executableDir||"";if(this._scriptPath){let q;try{q=XU.realpathSync(this._scriptPath)}catch{q=this._scriptPath}g=d4.resolve(d4.dirname(q),g)}if(g){let q=U(g,z);if(!q&&!$._executableFile&&this._scriptPath){let N=d4.basename(this._scriptPath,d4.extname(this._scriptPath));if(N!==this._name)q=U(g,`${N}-${$._name}`)}z=q||z}_=u.includes(d4.extname(z));let J;if(U$.platform!=="win32")if(_)I.unshift(z),I=N5(U$.execArgv).concat(I),J=d2.spawn(U$.argv[0],I,{stdio:"inherit"});else J=d2.spawn(z,I,{stdio:"inherit"});else this._checkForMissingExecutable(z,g,$._name),I.unshift(z),I=N5(U$.execArgv).concat(I),J=d2.spawn(U$.execPath,I,{stdio:"inherit"});if(!J.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((N)=>{U$.on(N,()=>{if(J.killed===!1&&J.exitCode===null)J.kill(N)})});let G=this._exitCallback;J.on("close",(q)=>{if(q=q??1,!G)U$.exit(q);else G(new c2(q,"commander.executeSubCommandAsync","(close)"))}),J.on("error",(q)=>{if(q.code==="ENOENT")this._checkForMissingExecutable(z,g,$._name);else if(q.code==="EACCES")throw Error(`'${z}' not executable`);if(!G)U$.exit(1);else{let N=new c2(1,"commander.executeSubCommandAsync","(error)");N.nestedError=q,G(N)}}),this.runningCommand=J}_dispatchSubcommand($,I,_){let u=this._findCommand($);if(!u)this.help({error:!0});u._prepareForParse();let U;return U=this._chainOrCallSubCommandHook(U,u,"preSubcommand"),U=this._chainOrCall(U,()=>{if(u._executableHandler)this._executeSubCommand(u,I.concat(_));else return u._parseCommand(I,_)}),U}_dispatchHelpCommand($){if(!$)this.help();let I=this._findCommand($);if(I&&!I._executableHandler)I.help();return this._dispatchSubcommand($,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach(($,I)=>{if($.required&&this.args[I]==null)this.missingArgument($.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 $=(_,u,U)=>{let z=u;if(u!==null&&_.parseArg){let g=`error: command-argument value '${u}' is invalid for argument '${_.name()}'.`;z=this._callParseArg(_,u,U,g)}return z};this._checkNumberOfArguments();let I=[];this.registeredArguments.forEach((_,u)=>{let U=_.defaultValue;if(_.variadic){if(u<this.args.length){if(U=this.args.slice(u),_.parseArg)U=U.reduce((z,g)=>{return $(_,g,z)},_.defaultValue)}else if(U===void 0)U=[]}else if(u<this.args.length){if(U=this.args[u],_.parseArg)U=$(_,U,_.defaultValue)}I[u]=U}),this.processedArgs=I}_chainOrCall($,I){if($?.then&&typeof $.then==="function")return $.then(()=>I());return I()}_chainOrCallHooks($,I){let _=$,u=[];if(this._getCommandAndAncestors().reverse().filter((U)=>U._lifeCycleHooks[I]!==void 0).forEach((U)=>{U._lifeCycleHooks[I].forEach((z)=>{u.push({hookedCommand:U,callback:z})})}),I==="postAction")u.reverse();return u.forEach((U)=>{_=this._chainOrCall(_,()=>{return U.callback(U.hookedCommand,this)})}),_}_chainOrCallSubCommandHook($,I,_){let u=$;if(this._lifeCycleHooks[_]!==void 0)this._lifeCycleHooks[_].forEach((U)=>{u=this._chainOrCall(u,()=>{return U(this,I)})});return u}_parseCommand($,I){let _=this.parseOptions(I);if(this._parseOptionsEnv(),this._parseOptionsImplied(),$=$.concat(_.operands),I=_.unknown,this.args=$.concat(I),$&&this._findCommand($[0]))return this._dispatchSubcommand($[0],$.slice(1),I);if(this._getHelpCommand()&&$[0]===this._getHelpCommand().name())return this._dispatchHelpCommand($[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(I),this._dispatchSubcommand(this._defaultCommandName,$,I);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(_.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let u=()=>{if(_.unknown.length>0)this.unknownOption(_.unknown[0])},U=`command:${this.name()}`;if(this._actionHandler){u(),this._processArguments();let z;if(z=this._chainOrCallHooks(z,"preAction"),z=this._chainOrCall(z,()=>this._actionHandler(this.processedArgs)),this.parent)z=this._chainOrCall(z,()=>{this.parent.emit(U,$,I)});return z=this._chainOrCallHooks(z,"postAction"),z}if(this.parent?.listenerCount(U))u(),this._processArguments(),this.parent.emit(U,$,I);else if($.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",$,I);if(this.listenerCount("command:*"))this.emit("command:*",$,I);else if(this.commands.length)this.unknownCommand();else u(),this._processArguments()}else if(this.commands.length)u(),this.help({error:!0});else u(),this._processArguments()}_findCommand($){if(!$)return;return this.commands.find((I)=>I._name===$||I._aliases.includes($))}_findOption($){return this.options.find((I)=>I.is($))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(($)=>{$.options.forEach((I)=>{if(I.mandatory&&$.getOptionValue(I.attributeName())===void 0)$.missingMandatoryOptionValue(I)})})}_checkForConflictingLocalOptions(){let $=this.options.filter((_)=>{let u=_.attributeName();if(this.getOptionValue(u)===void 0)return!1;return this.getOptionValueSource(u)!=="default"});$.filter((_)=>_.conflictsWith.length>0).forEach((_)=>{let u=$.find((U)=>_.conflictsWith.includes(U.attributeName()));if(u)this._conflictingOption(_,u)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(($)=>{$._checkForConflictingLocalOptions()})}parseOptions($){let I=[],_=[],u=I;function U(q){return q.length>1&&q[0]==="-"}let z=(q)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(q))return!1;return!this._getCommandAndAncestors().some((N)=>N.options.map((X)=>X.short).some((X)=>/^-\d$/.test(X)))},g=null,J=null,G=0;while(G<$.length||J){let q=J??$[G++];if(J=null,q==="--"){if(u===_)u.push(q);u.push(...$.slice(G));break}if(g&&(!U(q)||z(q))){this.emit(`option:${g.name()}`,q);continue}if(g=null,U(q)){let N=this._findOption(q);if(N){if(N.required){let X=$[G++];if(X===void 0)this.optionMissingArgument(N);this.emit(`option:${N.name()}`,X)}else if(N.optional){let X=null;if(G<$.length&&(!U($[G])||z($[G])))X=$[G++];this.emit(`option:${N.name()}`,X)}else this.emit(`option:${N.name()}`);g=N.variadic?N:null;continue}}if(q.length>2&&q[0]==="-"&&q[1]!=="-"){let N=this._findOption(`-${q[1]}`);if(N){if(N.required||N.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${N.name()}`,q.slice(2));else this.emit(`option:${N.name()}`),J=`-${q.slice(2)}`;continue}}if(/^--[^=]+=/.test(q)){let N=q.indexOf("="),X=this._findOption(q.slice(0,N));if(X&&(X.required||X.optional)){this.emit(`option:${X.name()}`,q.slice(N+1));continue}}if(u===I&&U(q)&&!(this.commands.length===0&&z(q)))u=_;if((this._enablePositionalOptions||this._passThroughOptions)&&I.length===0&&_.length===0){if(this._findCommand(q)){I.push(q),_.push(...$.slice(G));break}else if(this._getHelpCommand()&&q===this._getHelpCommand().name()){I.push(q,...$.slice(G));break}else if(this._defaultCommandName){_.push(q,...$.slice(G));break}}if(this._passThroughOptions){u.push(q,...$.slice(G));break}u.push(q)}return{operands:I,unknown:_}}opts(){if(this._storeOptionsAsProperties){let $={},I=this.options.length;for(let _=0;_<I;_++){let u=this.options[_].attributeName();$[u]=u===this._versionOptionName?this._version:this[u]}return $}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce(($,I)=>Object.assign($,I.opts()),{})}error($,I){if(this._outputConfiguration.outputError(`${$}
|
|
22
22
|
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==="string")this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
23
23
|
`);else if(this._showHelpAfterError)this._outputConfiguration.writeErr(`
|
|
24
|
-
`),this.outputHelp({error:!0});let _=I||{},u=_.exitCode||1,U=_.code||"commander.error";this._exit(u,U,$)}_parseOptionsEnv(){this.options.forEach(($)=>{if($.envVar&&$.envVar in
|
|
25
|
-
`),this._exit(0,"commander.version",$)}),this}description($,I){if($===void 0&&I===void 0)return this._description;if(this._description=$,I)this._argsDescription=I;return this}summary($){if($===void 0)return this._summary;return this._summary=$,this}alias($){if($===void 0)return this._aliases[0];let I=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)I=this.commands[this.commands.length-1];if($===I._name)throw Error("Command alias can't be the same as its name");let _=this.parent?._findCommand($);if(_){let u=[_.name()].concat(_.aliases()).join("|");throw Error(`cannot add alias '${$}' to command '${this.name()}' as already have command '${u}'`)}return I._aliases.push($),this}aliases($){if($===void 0)return this._aliases;return $.forEach((I)=>this.alias(I)),this}usage($){if($===void 0){if(this._usage)return this._usage;let I=this.registeredArguments.map((_)=>{return
|
|
24
|
+
`),this.outputHelp({error:!0});let _=I||{},u=_.exitCode||1,U=_.code||"commander.error";this._exit(u,U,$)}_parseOptionsEnv(){this.options.forEach(($)=>{if($.envVar&&$.envVar in U$.env){let I=$.attributeName();if(this.getOptionValue(I)===void 0||["default","config","env"].includes(this.getOptionValueSource(I)))if($.required||$.optional)this.emit(`optionEnv:${$.name()}`,U$.env[$.envVar]);else this.emit(`optionEnv:${$.name()}`)}})}_parseOptionsImplied(){let $=new fB(this.options),I=(_)=>{return this.getOptionValue(_)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(_))};this.options.filter((_)=>_.implied!==void 0&&I(_.attributeName())&&$.valueFromOption(this.getOptionValue(_.attributeName()),_)).forEach((_)=>{Object.keys(_.implied).filter((u)=>!I(u)).forEach((u)=>{this.setOptionValueWithSource(u,_.implied[u],"implied")})})}missingArgument($){let I=`error: missing required argument '${$}'`;this.error(I,{code:"commander.missingArgument"})}optionMissingArgument($){let I=`error: option '${$.flags}' argument missing`;this.error(I,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue($){let I=`error: required option '${$.flags}' not specified`;this.error(I,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption($,I){let _=(z)=>{let g=z.attributeName(),J=this.getOptionValue(g),G=this.options.find((N)=>N.negate&&g===N.attributeName()),q=this.options.find((N)=>!N.negate&&g===N.attributeName());if(G&&(G.presetArg===void 0&&J===!1||G.presetArg!==void 0&&J===G.presetArg))return G;return q||z},u=(z)=>{let g=_(z),J=g.attributeName();if(this.getOptionValueSource(J)==="env")return`environment variable '${g.envVar}'`;return`option '${g.flags}'`},U=`error: ${u($)} cannot be used with ${u(I)}`;this.error(U,{code:"commander.conflictingOption"})}unknownOption($){if(this._allowUnknownOption)return;let I="";if($.startsWith("--")&&this._showSuggestionAfterError){let u=[],U=this;do{let z=U.createHelp().visibleOptions(U).filter((g)=>g.long).map((g)=>g.long);u=u.concat(z),U=U.parent}while(U&&!U._enablePositionalOptions);I=X5($,u)}let _=`error: unknown option '${$}'${I}`;this.error(_,{code:"commander.unknownOption"})}_excessArguments($){if(this._allowExcessArguments)return;let I=this.registeredArguments.length,_=I===1?"":"s",U=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${I} argument${_} but got ${$.length}.`;this.error(U,{code:"commander.excessArguments"})}unknownCommand(){let $=this.args[0],I="";if(this._showSuggestionAfterError){let u=[];this.createHelp().visibleCommands(this).forEach((U)=>{if(u.push(U.name()),U.alias())u.push(U.alias())}),I=X5($,u)}let _=`error: unknown command '${$}'${I}`;this.error(_,{code:"commander.unknownCommand"})}version($,I,_){if($===void 0)return this._version;this._version=$,I=I||"-V, --version",_=_||"output the version number";let u=this.createOption(I,_);return this._versionOptionName=u.attributeName(),this._registerOption(u),this.on("option:"+u.name(),()=>{this._outputConfiguration.writeOut(`${$}
|
|
25
|
+
`),this._exit(0,"commander.version",$)}),this}description($,I){if($===void 0&&I===void 0)return this._description;if(this._description=$,I)this._argsDescription=I;return this}summary($){if($===void 0)return this._summary;return this._summary=$,this}alias($){if($===void 0)return this._aliases[0];let I=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)I=this.commands[this.commands.length-1];if($===I._name)throw Error("Command alias can't be the same as its name");let _=this.parent?._findCommand($);if(_){let u=[_.name()].concat(_.aliases()).join("|");throw Error(`cannot add alias '${$}' to command '${this.name()}' as already have command '${u}'`)}return I._aliases.push($),this}aliases($){if($===void 0)return this._aliases;return $.forEach((I)=>this.alias(I)),this}usage($){if($===void 0){if(this._usage)return this._usage;let I=this.registeredArguments.map((_)=>{return wB(_)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?I:[]).join(" ")}return this._usage=$,this}name($){if($===void 0)return this._name;return this._name=$,this}helpGroup($){if($===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=$,this}commandsGroup($){if($===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=$,this}optionsGroup($){if($===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=$,this}_initOptionGroup($){if(this._defaultOptionGroup&&!$.helpGroupHeading)$.helpGroup(this._defaultOptionGroup)}_initCommandGroup($){if(this._defaultCommandGroup&&!$.helpGroup())$.helpGroup(this._defaultCommandGroup)}nameFromFilename($){return this._name=d4.basename($,d4.extname($)),this}executableDir($){if($===void 0)return this._executableDir;return this._executableDir=$,this}helpInformation($){let I=this.createHelp(),_=this._getOutputContext($);I.prepareContext({error:_.error,helpWidth:_.helpWidth,outputHasColors:_.hasColors});let u=I.formatHelp(this,I);if(_.hasColors)return u;return this._outputConfiguration.stripColor(u)}_getOutputContext($){$=$||{};let I=!!$.error,_,u,U;if(I)_=(g)=>this._outputConfiguration.writeErr(g),u=this._outputConfiguration.getErrHasColors(),U=this._outputConfiguration.getErrHelpWidth();else _=(g)=>this._outputConfiguration.writeOut(g),u=this._outputConfiguration.getOutHasColors(),U=this._outputConfiguration.getOutHelpWidth();return{error:I,write:(g)=>{if(!u)g=this._outputConfiguration.stripColor(g);return _(g)},hasColors:u,helpWidth:U}}outputHelp($){let I;if(typeof $==="function")I=$,$=void 0;let _=this._getOutputContext($),u={error:_.error,write:_.write,command:this};this._getCommandAndAncestors().reverse().forEach((z)=>z.emit("beforeAllHelp",u)),this.emit("beforeHelp",u);let U=this.helpInformation({error:_.error});if(I){if(U=I(U),typeof U!=="string"&&!Buffer.isBuffer(U))throw Error("outputHelp callback must return a string or a Buffer")}if(_.write(U),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",u),this._getCommandAndAncestors().forEach((z)=>z.emit("afterAllHelp",u))}helpOption($,I){if(typeof $==="boolean"){if($){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption($??"-h, --help",I??"display help for command"),$||I)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption($){return this._helpOption=$,this._initOptionGroup($),this}help($){this.outputHelp($);let I=Number(U$.exitCode??0);if(I===0&&$&&typeof $!=="function"&&$.error)I=1;this._exit(I,"commander.help","(outputHelp)")}addHelpText($,I){let _=["beforeAll","before","after","afterAll"];if(!_.includes($))throw Error(`Unexpected value for position to addHelpText.
|
|
26
26
|
Expecting one of '${_.join("', '")}'`);let u=`${$}Help`;return this.on(u,(U)=>{let z;if(typeof I==="function")z=I({error:U.error,command:U.command});else z=I;if(z)U.write(`${z}
|
|
27
|
-
`)}),this}_outputHelpIfRequested($){let I=this._getHelpOption();if(I&&$.find((u)=>I.is(u)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function
|
|
28
|
-
`)}}
|
|
29
|
-
`)?
|
|
27
|
+
`)}),this}_outputHelpIfRequested($){let I=this._getHelpOption();if(I&&$.find((u)=>I.is(u)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function N5($){return $.map((I)=>{if(!I.startsWith("--inspect"))return I;let _,u="127.0.0.1",U="9229",z;if((z=I.match(/^(--inspect(-brk)?)$/))!==null)_=z[1];else if((z=I.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(_=z[1],/^\d+$/.test(z[3]))U=z[3];else u=z[3];else if((z=I.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)_=z[1],u=z[3],U=z[4];if(_&&U!=="0")return`${_}=${u}:${parseInt(U)+1}`;return I})}function p2(){if(U$.env.NO_COLOR||U$.env.FORCE_COLOR==="0"||U$.env.FORCE_COLOR==="false")return!1;if(U$.env.FORCE_COLOR||U$.env.CLICOLOR_FORCE!==void 0)return!0;return}xB.Command=o2;xB.useColor=p2});var O5=w((mB)=>{var{Argument:v5}=qU(),{Command:t2}=Q5(),{CommanderError:iB,InvalidArgumentError:H5}=A0(),{Help:lB}=n2(),{Option:Y5}=h2();mB.program=new t2;mB.createCommand=($)=>new t2($);mB.createOption=($,I)=>new Y5($,I);mB.createArgument=($,I)=>new v5($,I);mB.Command=t2;mB.Option=Y5;mB.Argument=v5;mB.Help=lB;mB.CommanderError=iB;mB.InvalidArgumentError=H5;mB.InvalidOptionArgumentError=H5});var P$=w((tx,e2)=>{var QU=process||{},B5=QU.argv||[],NU=QU.env||{},$D=!(!!NU.NO_COLOR||B5.includes("--no-color"))&&(!!NU.FORCE_COLOR||B5.includes("--color")||QU.platform==="win32"||(QU.stdout||{}).isTTY&&NU.TERM!=="dumb"||!!NU.CI),ID=($,I,_=$)=>(u)=>{let U=""+u,z=U.indexOf(I,$.length);return~z?$+UD(U,I,_,z)+I:$+U+I},UD=($,I,_,u)=>{let U="",z=0;do U+=$.substring(z,u)+_,z=u+I.length,u=$.indexOf(I,z);while(~u);return U+$.substring(z)},D5=($=$D)=>{let I=$?ID:()=>String;return{isColorSupported:$,reset:I("\x1B[0m","\x1B[0m"),bold:I("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:I("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:I("\x1B[3m","\x1B[23m"),underline:I("\x1B[4m","\x1B[24m"),inverse:I("\x1B[7m","\x1B[27m"),hidden:I("\x1B[8m","\x1B[28m"),strikethrough:I("\x1B[9m","\x1B[29m"),black:I("\x1B[30m","\x1B[39m"),red:I("\x1B[31m","\x1B[39m"),green:I("\x1B[32m","\x1B[39m"),yellow:I("\x1B[33m","\x1B[39m"),blue:I("\x1B[34m","\x1B[39m"),magenta:I("\x1B[35m","\x1B[39m"),cyan:I("\x1B[36m","\x1B[39m"),white:I("\x1B[37m","\x1B[39m"),gray:I("\x1B[90m","\x1B[39m"),bgBlack:I("\x1B[40m","\x1B[49m"),bgRed:I("\x1B[41m","\x1B[49m"),bgGreen:I("\x1B[42m","\x1B[49m"),bgYellow:I("\x1B[43m","\x1B[49m"),bgBlue:I("\x1B[44m","\x1B[49m"),bgMagenta:I("\x1B[45m","\x1B[49m"),bgCyan:I("\x1B[46m","\x1B[49m"),bgWhite:I("\x1B[47m","\x1B[49m"),blackBright:I("\x1B[90m","\x1B[39m"),redBright:I("\x1B[91m","\x1B[39m"),greenBright:I("\x1B[92m","\x1B[39m"),yellowBright:I("\x1B[93m","\x1B[39m"),blueBright:I("\x1B[94m","\x1B[39m"),magentaBright:I("\x1B[95m","\x1B[39m"),cyanBright:I("\x1B[96m","\x1B[39m"),whiteBright:I("\x1B[97m","\x1B[39m"),bgBlackBright:I("\x1B[100m","\x1B[49m"),bgRedBright:I("\x1B[101m","\x1B[49m"),bgGreenBright:I("\x1B[102m","\x1B[49m"),bgYellowBright:I("\x1B[103m","\x1B[49m"),bgBlueBright:I("\x1B[104m","\x1B[49m"),bgMagentaBright:I("\x1B[105m","\x1B[49m"),bgCyanBright:I("\x1B[106m","\x1B[49m"),bgWhiteBright:I("\x1B[107m","\x1B[49m")}};e2.exports=D5();e2.exports.createColors=D5});var I$=w((XD)=>{var s2=Symbol.for("yaml.alias"),M5=Symbol.for("yaml.document"),vU=Symbol.for("yaml.map"),K5=Symbol.for("yaml.pair"),$z=Symbol.for("yaml.scalar"),HU=Symbol.for("yaml.seq"),c4=Symbol.for("yaml.node.type"),_D=($)=>!!$&&typeof $==="object"&&$[c4]===s2,uD=($)=>!!$&&typeof $==="object"&&$[c4]===M5,zD=($)=>!!$&&typeof $==="object"&&$[c4]===vU,gD=($)=>!!$&&typeof $==="object"&&$[c4]===K5,V5=($)=>!!$&&typeof $==="object"&&$[c4]===$z,JD=($)=>!!$&&typeof $==="object"&&$[c4]===HU;function R5($){if($&&typeof $==="object")switch($[c4]){case vU:case HU:return!0}return!1}function GD($){if($&&typeof $==="object")switch($[c4]){case s2:case vU:case $z:case HU:return!0}return!1}var qD=($)=>(V5($)||R5($))&&!!$.anchor;XD.ALIAS=s2;XD.DOC=M5;XD.MAP=vU;XD.NODE_TYPE=c4;XD.PAIR=K5;XD.SCALAR=$z;XD.SEQ=HU;XD.hasAnchor=qD;XD.isAlias=_D;XD.isCollection=R5;XD.isDocument=uD;XD.isMap=zD;XD.isNode=GD;XD.isPair=gD;XD.isScalar=V5;XD.isSeq=JD});var j0=w((PD)=>{var W$=I$(),t$=Symbol("break visit"),L5=Symbol("skip children"),w4=Symbol("remove node");function YU($,I){let _=Z5(I);if(W$.isDocument($)){if(L1(null,$.contents,_,Object.freeze([$]))===w4)$.contents=null}else L1(null,$,_,Object.freeze([]))}YU.BREAK=t$;YU.SKIP=L5;YU.REMOVE=w4;function L1($,I,_,u){let U=W5($,I,_,u);if(W$.isNode(U)||W$.isPair(U))return P5($,u,U),L1($,U,_,u);if(typeof U!=="symbol"){if(W$.isCollection(I)){u=Object.freeze(u.concat(I));for(let z=0;z<I.items.length;++z){let g=L1(z,I.items[z],_,u);if(typeof g==="number")z=g-1;else if(g===t$)return t$;else if(g===w4)I.items.splice(z,1),z-=1}}else if(W$.isPair(I)){u=Object.freeze(u.concat(I));let z=L1("key",I.key,_,u);if(z===t$)return t$;else if(z===w4)I.key=null;let g=L1("value",I.value,_,u);if(g===t$)return t$;else if(g===w4)I.value=null}}return U}async function OU($,I){let _=Z5(I);if(W$.isDocument($)){if(await Z1(null,$.contents,_,Object.freeze([$]))===w4)$.contents=null}else await Z1(null,$,_,Object.freeze([]))}OU.BREAK=t$;OU.SKIP=L5;OU.REMOVE=w4;async function Z1($,I,_,u){let U=await W5($,I,_,u);if(W$.isNode(U)||W$.isPair(U))return P5($,u,U),Z1($,U,_,u);if(typeof U!=="symbol"){if(W$.isCollection(I)){u=Object.freeze(u.concat(I));for(let z=0;z<I.items.length;++z){let g=await Z1(z,I.items[z],_,u);if(typeof g==="number")z=g-1;else if(g===t$)return t$;else if(g===w4)I.items.splice(z,1),z-=1}}else if(W$.isPair(I)){u=Object.freeze(u.concat(I));let z=await Z1("key",I.key,_,u);if(z===t$)return t$;else if(z===w4)I.key=null;let g=await Z1("value",I.value,_,u);if(g===t$)return t$;else if(g===w4)I.value=null}}return U}function Z5($){if(typeof $==="object"&&($.Collection||$.Node||$.Value))return Object.assign({Alias:$.Node,Map:$.Node,Scalar:$.Node,Seq:$.Node},$.Value&&{Map:$.Value,Scalar:$.Value,Seq:$.Value},$.Collection&&{Map:$.Collection,Seq:$.Collection},$);return $}function W5($,I,_,u){if(typeof _==="function")return _($,I,u);if(W$.isMap(I))return _.Map?.($,I,u);if(W$.isSeq(I))return _.Seq?.($,I,u);if(W$.isPair(I))return _.Pair?.($,I,u);if(W$.isScalar(I))return _.Scalar?.($,I,u);if(W$.isAlias(I))return _.Alias?.($,I,u);return}function P5($,I,_){let u=I[I.length-1];if(W$.isCollection(u))u.items[$]=_;else if(W$.isPair(u))if($==="key")u.key=_;else u.value=_;else if(W$.isDocument(u))u.contents=_;else{let U=W$.isAlias(u)?"alias":"scalar";throw Error(`Cannot replace node with ${U} parent`)}}PD.visit=YU;PD.visitAsync=OU});var Iz=w((wD)=>{var b5=I$(),jD=j0(),FD={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},SD=($)=>$.replace(/[!,[\]{}]/g,(I)=>FD[I]);class X4{constructor($,I){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},X4.defaultYaml,$),this.tags=Object.assign({},X4.defaultTags,I)}clone(){let $=new X4(this.yaml,this.tags);return $.docStart=this.docStart,$}atDocument(){let $=new X4(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:X4.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},X4.defaultTags);break}return $}add($,I){if(this.atNextDocument)this.yaml={explicit:X4.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},X4.defaultTags),this.atNextDocument=!1;let _=$.trim().split(/[ \t]+/),u=_.shift();switch(u){case"%TAG":{if(_.length!==2){if(I(0,"%TAG directive should contain exactly two parts"),_.length<2)return!1}let[U,z]=_;return this.tags[U]=z,!0}case"%YAML":{if(this.yaml.explicit=!0,_.length!==1)return I(0,"%YAML directive should contain exactly one part"),!1;let[U]=_;if(U==="1.1"||U==="1.2")return this.yaml.version=U,!0;else{let z=/^\d+\.\d+$/.test(U);return I(6,`Unsupported YAML version ${U}`,z),!1}}default:return I(0,`Unknown directive ${u}`,!0),!1}}tagName($,I){if($==="!")return"!";if($[0]!=="!")return I(`Not a valid tag: ${$}`),null;if($[1]==="<"){let z=$.slice(2,-1);if(z==="!"||z==="!!")return I(`Verbatim tags aren't resolved, so ${$} is invalid.`),null;if($[$.length-1]!==">")I("Verbatim tags must end with a >");return z}let[,_,u]=$.match(/^(.*!)([^!]*)$/s);if(!u)I(`The ${$} tag has no suffix`);let U=this.tags[_];if(U)try{return U+decodeURIComponent(u)}catch(z){return I(String(z)),null}if(_==="!")return $;return I(`Could not resolve tag: ${$}`),null}tagString($){for(let[I,_]of Object.entries(this.tags))if($.startsWith(_))return I+SD($.substring(_.length));return $[0]==="!"?$:`!<${$}>`}toString($){let I=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],_=Object.entries(this.tags),u;if($&&_.length>0&&b5.isNode($.contents)){let U={};jD.visit($.contents,(z,g)=>{if(b5.isNode(g)&&g.tag)U[g.tag]=!0}),u=Object.keys(U)}else u=[];for(let[U,z]of _){if(U==="!!"&&z==="tag:yaml.org,2002:")continue;if(!$||u.some((g)=>g.startsWith(z)))I.push(`%TAG ${U} ${z}`)}return I.join(`
|
|
28
|
+
`)}}X4.defaultYaml={explicit:!1,version:"1.2"};X4.defaultTags={"!!":"tag:yaml.org,2002:"};wD.Directives=X4});var TU=w((kD)=>{var A5=I$(),CD=j0();function fD($){if(/[\x00-\x19\s,[\]{}]/.test($)){let _=`Anchor must not contain whitespace or control characters: ${JSON.stringify($)}`;throw Error(_)}return!0}function j5($){let I=new Set;return CD.visit($,{Value(_,u){if(u.anchor)I.add(u.anchor)}}),I}function F5($,I){for(let _=1;;++_){let u=`${$}${_}`;if(!I.has(u))return u}}function xD($,I){let _=[],u=new Map,U=null;return{onAnchor:(z)=>{_.push(z),U??(U=j5($));let g=F5(I,U);return U.add(g),g},setAnchors:()=>{for(let z of _){let g=u.get(z);if(typeof g==="object"&&g.anchor&&(A5.isScalar(g.node)||A5.isCollection(g.node)))g.node.anchor=g.anchor;else{let J=Error("Failed to resolve repeated object (this should not happen)");throw J.source=z,J}}},sourceObjects:u}}kD.anchorIsValid=fD;kD.anchorNames=j5;kD.createNodeAnchors=xD;kD.findNewAnchor=F5});var Uz=w((rD)=>{function F0($,I,_,u){if(u&&typeof u==="object")if(Array.isArray(u))for(let U=0,z=u.length;U<z;++U){let g=u[U],J=F0($,u,String(U),g);if(J===void 0)delete u[U];else if(J!==g)u[U]=J}else if(u instanceof Map)for(let U of Array.from(u.keys())){let z=u.get(U),g=F0($,u,U,z);if(g===void 0)u.delete(U);else if(g!==z)u.set(U,g)}else if(u instanceof Set)for(let U of Array.from(u)){let z=F0($,u,U,U);if(z===void 0)u.delete(U);else if(z!==U)u.delete(U),u.add(z)}else for(let[U,z]of Object.entries(u)){let g=F0($,u,U,z);if(g===void 0)delete u[U];else if(g!==z)u[U]=g}return $.call(I,_,u)}rD.applyReviver=F0});var N6=w((dD)=>{var hD=I$();function S5($,I,_){if(Array.isArray($))return $.map((u,U)=>S5(u,String(U),_));if($&&typeof $.toJSON==="function"){if(!_||!hD.hasAnchor($))return $.toJSON(I,_);let u={aliasCount:0,count:1,res:void 0};_.anchors.set($,u),_.onCreate=(z)=>{u.res=z,delete _.onCreate};let U=$.toJSON(I,_);if(_.onCreate)_.onCreate(U);return U}if(typeof $==="bigint"&&!_?.keep)return Number($);return $}dD.toJS=S5});var BU=w((tD)=>{var pD=Uz(),w5=I$(),oD=N6();class E5{constructor($){Object.defineProperty(this,w5.NODE_TYPE,{value:$})}clone(){let $=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)$.range=this.range.slice();return $}toJS($,{mapAsMap:I,maxAliasCount:_,onAnchor:u,reviver:U}={}){if(!w5.isDocument($))throw TypeError("A document argument is required");let z={anchors:new Map,doc:$,keep:!0,mapAsMap:I===!0,mapKeyWarned:!1,maxAliasCount:typeof _==="number"?_:100},g=oD.toJS(this,"",z);if(typeof u==="function")for(let{count:J,res:G}of z.anchors.values())u(G,J);return typeof U==="function"?pD.applyReviver(U,{"":g},"",g):g}}tD.NodeBase=E5});var S0=w((UM)=>{var eD=TU(),sD=j0(),W1=I$(),$M=BU(),IM=N6();class C5 extends $M.NodeBase{constructor($){super(W1.ALIAS);this.source=$,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve($,I){let _;if(I?.aliasResolveCache)_=I.aliasResolveCache;else if(_=[],sD.visit($,{Node:(U,z)=>{if(W1.isAlias(z)||W1.hasAnchor(z))_.push(z)}}),I)I.aliasResolveCache=_;let u=void 0;for(let U of _){if(U===this)break;if(U.anchor===this.source)u=U}return u}toJSON($,I){if(!I)return{source:this.source};let{anchors:_,doc:u,maxAliasCount:U}=I,z=this.resolve(u,I);if(!z){let J=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(J)}let g=_.get(z);if(!g)IM.toJS(z,null,I),g=_.get(z);if(g?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(U>=0){if(g.count+=1,g.aliasCount===0)g.aliasCount=DU(u,z,_);if(g.count*g.aliasCount>U)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return g.res}toString($,I,_){let u=`*${this.source}`;if($){if(eD.anchorIsValid(this.source),$.options.verifyAliasOrder&&!$.anchors.has(this.source)){let U=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(U)}if($.implicitKey)return`${u} `}return u}}function DU($,I,_){if(W1.isAlias(I)){let u=I.resolve($),U=_&&u&&_.get(u);return U?U.count*U.aliasCount:0}else if(W1.isCollection(I)){let u=0;for(let U of I.items){let z=DU($,U,_);if(z>u)u=z}return u}else if(W1.isPair(I)){let u=DU($,I.key,_),U=DU($,I.value,_);return Math.max(u,U)}return 1}UM.Alias=C5});var L$=w((GM)=>{var uM=I$(),zM=BU(),gM=N6(),JM=($)=>!$||typeof $!=="function"&&typeof $!=="object";class m6 extends zM.NodeBase{constructor($){super(uM.SCALAR);this.value=$}toJSON($,I){return I?.keep?this.value:gM.toJS(this.value,$,I)}toString(){return String(this.value)}}m6.BLOCK_FOLDED="BLOCK_FOLDED";m6.BLOCK_LITERAL="BLOCK_LITERAL";m6.PLAIN="PLAIN";m6.QUOTE_DOUBLE="QUOTE_DOUBLE";m6.QUOTE_SINGLE="QUOTE_SINGLE";GM.Scalar=m6;GM.isScalarValue=JM});var w0=w((YM)=>{var NM=S0(),r6=I$(),f5=L$(),QM="tag:yaml.org,2002:";function vM($,I,_){if(I){let u=_.filter((z)=>z.tag===I),U=u.find((z)=>!z.format)??u[0];if(!U)throw Error(`Tag ${I} not found`);return U}return _.find((u)=>u.identify?.($)&&!u.format)}function HM($,I,_){if(r6.isDocument($))$=$.contents;if(r6.isNode($))return $;if(r6.isPair($)){let X=_.schema[r6.MAP].createNode?.(_.schema,null,_);return X.items.push($),X}if($ instanceof String||$ instanceof Number||$ instanceof Boolean||typeof BigInt<"u"&&$ instanceof BigInt)$=$.valueOf();let{aliasDuplicateObjects:u,onAnchor:U,onTagObj:z,schema:g,sourceObjects:J}=_,G=void 0;if(u&&$&&typeof $==="object")if(G=J.get($),G)return G.anchor??(G.anchor=U($)),new NM.Alias(G.anchor);else G={anchor:null,node:null},J.set($,G);if(I?.startsWith("!!"))I=QM+I.slice(2);let q=vM($,I,g.tags);if(!q){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let X=new f5.Scalar($);if(G)G.node=X;return X}q=$ instanceof Map?g[r6.MAP]:(Symbol.iterator in Object($))?g[r6.SEQ]:g[r6.MAP]}if(z)z(q),delete _.onTagObj;let N=q?.createNode?q.createNode(_.schema,$,_):typeof q?.nodeClass?.from==="function"?q.nodeClass.from(_.schema,$,_):new f5.Scalar($);if(I)N.tag=I;else if(!q.default)N.tag=q.tag;if(G)G.node=N;return N}YM.createNode=HM});var MU=w((DM)=>{var TM=w0(),E4=I$(),BM=BU();function _z($,I,_){let u=_;for(let U=I.length-1;U>=0;--U){let z=I[U];if(typeof z==="number"&&Number.isInteger(z)&&z>=0){let g=[];g[z]=u,u=g}else u=new Map([[z,u]])}return TM.createNode(u,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:$,sourceObjects:new Map})}var x5=($)=>$==null||typeof $==="object"&&!!$[Symbol.iterator]().next().done;class k5 extends BM.NodeBase{constructor($,I){super($);Object.defineProperty(this,"schema",{value:I,configurable:!0,enumerable:!1,writable:!0})}clone($){let I=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if($)I.schema=$;if(I.items=I.items.map((_)=>E4.isNode(_)||E4.isPair(_)?_.clone($):_),this.range)I.range=this.range.slice();return I}addIn($,I){if(x5($))this.add(I);else{let[_,...u]=$,U=this.get(_,!0);if(E4.isCollection(U))U.addIn(u,I);else if(U===void 0&&this.schema)this.set(_,_z(this.schema,u,I));else throw Error(`Expected YAML collection at ${_}. Remaining path: ${u}`)}}deleteIn($){let[I,..._]=$;if(_.length===0)return this.delete(I);let u=this.get(I,!0);if(E4.isCollection(u))return u.deleteIn(_);else throw Error(`Expected YAML collection at ${I}. Remaining path: ${_}`)}getIn($,I){let[_,...u]=$,U=this.get(_,!0);if(u.length===0)return!I&&E4.isScalar(U)?U.value:U;else return E4.isCollection(U)?U.getIn(u,I):void 0}hasAllNullValues($){return this.items.every((I)=>{if(!E4.isPair(I))return!1;let _=I.value;return _==null||$&&E4.isScalar(_)&&_.value==null&&!_.commentBefore&&!_.comment&&!_.tag})}hasIn($){let[I,..._]=$;if(_.length===0)return this.has(I);let u=this.get(I,!0);return E4.isCollection(u)?u.hasIn(_):!1}setIn($,I){let[_,...u]=$;if(u.length===0)this.set(_,I);else{let U=this.get(_,!0);if(E4.isCollection(U))U.setIn(u,I);else if(U===void 0&&this.schema)this.set(_,_z(this.schema,u,I));else throw Error(`Expected YAML collection at ${_}. Remaining path: ${u}`)}}}DM.Collection=k5;DM.collectionFromPath=_z;DM.isEmptyPath=x5});var E0=w((ZM)=>{var RM=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function uz($,I){if(/^\n+$/.test($))return $.substring(1);return I?$.replace(/^(?! *$)/gm,I):$}var LM=($,I,_)=>$.endsWith(`
|
|
29
|
+
`)?uz(_,I):_.includes(`
|
|
30
30
|
`)?`
|
|
31
|
-
`+
|
|
32
|
-
`){if(_==="block")
|
|
33
|
-
`&&
|
|
34
|
-
`&&
|
|
35
|
-
${I}${$.slice(0,
|
|
36
|
-
${I}${$.slice(
|
|
37
|
-
`);u=I,U=I+1,z=$[U]}return u}
|
|
38
|
-
`){if(z-g>u)return!0;if(g=z+1,U-g<=u)return!1}return!0}function
|
|
31
|
+
`+uz(_,I):($.endsWith(" ")?"":" ")+_;ZM.indentComment=uz;ZM.lineComment=LM;ZM.stringifyComment=RM});var i5=w((jM)=>{function AM($,I,_="flow",{indentAtStart:u,lineWidth:U=80,minContentWidth:z=20,onFold:g,onOverflow:J}={}){if(!U||U<0)return $;if(U<z)z=0;let G=Math.max(1+z,1+U-I.length);if($.length<=G)return $;let q=[],N={},X=U-I.length;if(typeof u==="number")if(u>U-Math.max(2,z))q.push(0);else X=U-u;let Q=void 0,H=void 0,Y=!1,v=-1,O=-1,T=-1;if(_==="block"){if(v=y5($,v,I.length),v!==-1)X=v+G}for(let V;V=$[v+=1];){if(_==="quoted"&&V==="\\"){switch(O=v,$[v+1]){case"x":v+=3;break;case"u":v+=5;break;case"U":v+=9;break;default:v+=1}T=v}if(V===`
|
|
32
|
+
`){if(_==="block")v=y5($,v,I.length);X=v+I.length+G,Q=void 0}else{if(V===" "&&H&&H!==" "&&H!==`
|
|
33
|
+
`&&H!=="\t"){let R=$[v+1];if(R&&R!==" "&&R!==`
|
|
34
|
+
`&&R!=="\t")Q=v}if(v>=X)if(Q)q.push(Q),X=Q+G,Q=void 0;else if(_==="quoted"){while(H===" "||H==="\t")H=V,V=$[v+=1],Y=!0;let R=v>T+1?v-2:O-1;if(N[R])return $;q.push(R),N[R]=!0,X=R+G,Q=void 0}else Y=!0}H=V}if(Y&&J)J();if(q.length===0)return $;if(g)g();let L=$.slice(0,q[0]);for(let V=0;V<q.length;++V){let R=q[V],M=q[V+1]||$.length;if(R===0)L=`
|
|
35
|
+
${I}${$.slice(0,M)}`;else{if(_==="quoted"&&N[R])L+=`${$[R]}\\`;L+=`
|
|
36
|
+
${I}${$.slice(R+1,M)}`}}return L}function y5($,I,_){let u=I,U=I+1,z=$[U];while(z===" "||z==="\t")if(I<U+_)z=$[++I];else{do z=$[++I];while(z&&z!==`
|
|
37
|
+
`);u=I,U=I+1,z=$[U]}return u}jM.FOLD_BLOCK="block";jM.FOLD_FLOW="flow";jM.FOLD_QUOTED="quoted";jM.foldFlowLines=AM});var f0=w((kM)=>{var D4=L$(),Q6=i5(),VU=($,I)=>({indentAtStart:I?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),RU=($)=>/^(%|---|\.\.\.)/m.test($);function CM($,I,_){if(!I||I<0)return!1;let u=I-_,U=$.length;if(U<=u)return!1;for(let z=0,g=0;z<U;++z)if($[z]===`
|
|
38
|
+
`){if(z-g>u)return!0;if(g=z+1,U-g<=u)return!1}return!0}function C0($,I){let _=JSON.stringify($);if(I.options.doubleQuotedAsJSON)return _;let{implicitKey:u}=I,U=I.options.doubleQuotedMinMultiLineLength,z=I.indent||(RU($)?" ":""),g="",J=0;for(let G=0,q=_[G];q;q=_[++G]){if(q===" "&&_[G+1]==="\\"&&_[G+2]==="n")g+=_.slice(J,G)+"\\ ",G+=1,J=G,q="\\";if(q==="\\")switch(_[G+1]){case"u":{g+=_.slice(J,G);let N=_.substr(G+2,4);switch(N){case"0000":g+="\\0";break;case"0007":g+="\\a";break;case"000b":g+="\\v";break;case"001b":g+="\\e";break;case"0085":g+="\\N";break;case"00a0":g+="\\_";break;case"2028":g+="\\L";break;case"2029":g+="\\P";break;default:if(N.substr(0,2)==="00")g+="\\x"+N.substr(2);else g+=_.substr(G,6)}G+=5,J=G+1}break;case"n":if(u||_[G+2]==='"'||_.length<U)G+=1;else{g+=_.slice(J,G)+`
|
|
39
39
|
|
|
40
40
|
`;while(_[G+2]==="\\"&&_[G+3]==="n"&&_[G+4]!=='"')g+=`
|
|
41
|
-
`,G+=2;if(g+=z,_[G+2]===" ")g+="\\";G+=1,J=G+1}break;default:G+=1}}return g=J?g+_.slice(J):_,u?g:
|
|
42
|
-
`)||/[ \t]\n|\n[ \t]/.test($))return
|
|
43
|
-
${_}`)+"'";return I.implicitKey?u:
|
|
41
|
+
`,G+=2;if(g+=z,_[G+2]===" ")g+="\\";G+=1,J=G+1}break;default:G+=1}}return g=J?g+_.slice(J):_,u?g:Q6.foldFlowLines(g,z,Q6.FOLD_QUOTED,VU(I,!1))}function zz($,I){if(I.options.singleQuote===!1||I.implicitKey&&$.includes(`
|
|
42
|
+
`)||/[ \t]\n|\n[ \t]/.test($))return C0($,I);let _=I.indent||(RU($)?" ":""),u="'"+$.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
43
|
+
${_}`)+"'";return I.implicitKey?u:Q6.foldFlowLines(u,_,Q6.FOLD_FLOW,VU(I,!1))}function P1($,I){let{singleQuote:_}=I.options,u;if(_===!1)u=C0;else{let U=$.includes('"'),z=$.includes("'");if(U&&!z)u=zz;else if(z&&!U)u=C0;else u=_?zz:C0}return u($,I)}var gz;try{gz=new RegExp(`(^|(?<!
|
|
44
44
|
))
|
|
45
45
|
+(?!
|
|
46
|
-
|$)`,"g")}catch{
|
|
46
|
+
|$)`,"g")}catch{gz=/\n+(?!\n|$)/g}function KU({comment:$,type:I,value:_},u,U,z){let{blockQuote:g,commentString:J,lineWidth:G}=u.options;if(!g||/\n[\t ]+$/.test(_))return P1(_,u);let q=u.indent||(u.forceBlockIndent||RU(_)?" ":""),N=g==="literal"?!0:g==="folded"||I===D4.Scalar.BLOCK_FOLDED?!1:I===D4.Scalar.BLOCK_LITERAL?!0:!CM(_,G,q.length);if(!_)return N?`|
|
|
47
47
|
`:`>
|
|
48
|
-
`;let
|
|
49
|
-
`&&
|
|
50
|
-
`);if(
|
|
51
|
-
`)
|
|
52
|
-
`)
|
|
53
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${
|
|
54
|
-
${
|
|
55
|
-
${
|
|
56
|
-
`)||
|
|
57
|
-
`)?
|
|
58
|
-
`))return KU($,I,_,u);if(
|
|
59
|
-
${G}`);if(g){let
|
|
60
|
-
${I.indent}${J}`}
|
|
61
|
-
${J}:`}else if(O=`${O}:`,
|
|
62
|
-
`:"",
|
|
63
|
-
${
|
|
64
|
-
`&&
|
|
48
|
+
`;let X,Q;for(Q=_.length;Q>0;--Q){let M=_[Q-1];if(M!==`
|
|
49
|
+
`&&M!=="\t"&&M!==" ")break}let H=_.substring(Q),Y=H.indexOf(`
|
|
50
|
+
`);if(Y===-1)X="-";else if(_===H||Y!==H.length-1){if(X="+",z)z()}else X="";if(H){if(_=_.slice(0,-H.length),H[H.length-1]===`
|
|
51
|
+
`)H=H.slice(0,-1);H=H.replace(gz,`$&${q}`)}let v=!1,O,T=-1;for(O=0;O<_.length;++O){let M=_[O];if(M===" ")v=!0;else if(M===`
|
|
52
|
+
`)T=O;else break}let L=_.substring(0,T<O?T+1:O);if(L)_=_.substring(L.length),L=L.replace(/\n+/g,`$&${q}`);let R=(v?q?"2":"1":"")+X;if($){if(R+=" "+J($.replace(/ ?[\r\n]+/g," ")),U)U()}if(!N){let M=_.replace(/\n+/g,`
|
|
53
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${q}`),Z=!1,K=VU(u,!0);if(g!=="folded"&&I!==D4.Scalar.BLOCK_FOLDED)K.onOverflow=()=>{Z=!0};let D=Q6.foldFlowLines(`${L}${M}${H}`,q,Q6.FOLD_BLOCK,K);if(!Z)return`>${R}
|
|
54
|
+
${q}${D}`}return _=_.replace(/\n+/g,`$&${q}`),`|${R}
|
|
55
|
+
${q}${L}${_}${H}`}function fM($,I,_,u){let{type:U,value:z}=$,{actualString:g,implicitKey:J,indent:G,indentStep:q,inFlow:N}=I;if(J&&z.includes(`
|
|
56
|
+
`)||N&&/[[\]{},]/.test(z))return P1(z,I);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(z))return J||N||!z.includes(`
|
|
57
|
+
`)?P1(z,I):KU($,I,_,u);if(!J&&!N&&U!==D4.Scalar.PLAIN&&z.includes(`
|
|
58
|
+
`))return KU($,I,_,u);if(RU(z)){if(G==="")return I.forceBlockIndent=!0,KU($,I,_,u);else if(J&&G===q)return P1(z,I)}let X=z.replace(/\n+/g,`$&
|
|
59
|
+
${G}`);if(g){let Q=(v)=>v.default&&v.tag!=="tag:yaml.org,2002:str"&&v.test?.test(X),{compat:H,tags:Y}=I.doc.schema;if(Y.some(Q)||H?.some(Q))return P1(z,I)}return J?X:Q6.foldFlowLines(X,G,Q6.FOLD_FLOW,VU(I,!1))}function xM($,I,_,u){let{implicitKey:U,inFlow:z}=I,g=typeof $.value==="string"?$:Object.assign({},$,{value:String($.value)}),{type:J}=$;if(J!==D4.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(g.value))J=D4.Scalar.QUOTE_DOUBLE}let G=(N)=>{switch(N){case D4.Scalar.BLOCK_FOLDED:case D4.Scalar.BLOCK_LITERAL:return U||z?P1(g.value,I):KU(g,I,_,u);case D4.Scalar.QUOTE_DOUBLE:return C0(g.value,I);case D4.Scalar.QUOTE_SINGLE:return zz(g.value,I);case D4.Scalar.PLAIN:return fM(g,I,_,u);default:return null}},q=G(J);if(q===null){let{defaultKeyType:N,defaultStringType:X}=I.options,Q=U&&N||X;if(q=G(Q),q===null)throw Error(`Unsupported default string type ${Q}`)}return q}kM.stringifyString=xM});var x0=w((cM)=>{var iM=TU(),v6=I$(),lM=E0(),mM=f0();function rM($,I){let _=Object.assign({blockQuote:!0,commentString:lM.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},$.schema.toStringOptions,I),u;switch(_.collectionStyle){case"block":u=!1;break;case"flow":u=!0;break;default:u=null}return{anchors:new Set,doc:$,flowCollectionPadding:_.flowCollectionPadding?" ":"",indent:"",indentStep:typeof _.indent==="number"?" ".repeat(_.indent):" ",inFlow:u,options:_}}function nM($,I){if(I.tag){let U=$.filter((z)=>z.tag===I.tag);if(U.length>0)return U.find((z)=>z.format===I.format)??U[0]}let _=void 0,u;if(v6.isScalar(I)){u=I.value;let U=$.filter((z)=>z.identify?.(u));if(U.length>1){let z=U.filter((g)=>g.test);if(z.length>0)U=z}_=U.find((z)=>z.format===I.format)??U.find((z)=>!z.format)}else u=I,_=$.find((U)=>U.nodeClass&&u instanceof U.nodeClass);if(!_){let U=u?.constructor?.name??(u===null?"null":typeof u);throw Error(`Tag not resolved for ${U} value`)}return _}function hM($,I,{anchors:_,doc:u}){if(!u.directives)return"";let U=[],z=(v6.isScalar($)||v6.isCollection($))&&$.anchor;if(z&&iM.anchorIsValid(z))_.add(z),U.push(`&${z}`);let g=$.tag??(I.default?null:I.tag);if(g)U.push(u.directives.tagString(g));return U.join(" ")}function dM($,I,_,u){if(v6.isPair($))return $.toString(I,_,u);if(v6.isAlias($)){if(I.doc.directives)return $.toString(I);if(I.resolvedAliases?.has($))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(I.resolvedAliases)I.resolvedAliases.add($);else I.resolvedAliases=new Set([$]);$=$.resolve(I.doc)}}let U=void 0,z=v6.isNode($)?$:I.doc.createNode($,{onTagObj:(G)=>U=G});U??(U=nM(I.doc.schema.tags,z));let g=hM(z,U,I);if(g.length>0)I.indentAtStart=(I.indentAtStart??0)+g.length+1;let J=typeof U.stringify==="function"?U.stringify(z,I,_,u):v6.isScalar(z)?mM.stringifyString(z,I,_,u):z.toString(I,_,u);if(!g)return J;return v6.isScalar(z)||J[0]==="{"||J[0]==="["?`${g} ${J}`:`${g}
|
|
60
|
+
${I.indent}${J}`}cM.createStringifyContext=rM;cM.stringify=dM});var r5=w((aM)=>{var p4=I$(),l5=L$(),m5=x0(),k0=E0();function tM({key:$,value:I},_,u,U){let{allNullValues:z,doc:g,indent:J,indentStep:G,options:{commentString:q,indentSeq:N,simpleKeys:X}}=_,Q=p4.isNode($)&&$.comment||null;if(X){if(Q)throw Error("With simple keys, key nodes cannot have comments");if(p4.isCollection($)||!p4.isNode($)&&typeof $==="object")throw Error("With simple keys, collection cannot be used as a key value")}let H=!X&&(!$||Q&&I==null&&!_.inFlow||p4.isCollection($)||(p4.isScalar($)?$.type===l5.Scalar.BLOCK_FOLDED||$.type===l5.Scalar.BLOCK_LITERAL:typeof $==="object"));_=Object.assign({},_,{allNullValues:!1,implicitKey:!H&&(X||!z),indent:J+G});let Y=!1,v=!1,O=m5.stringify($,_,()=>Y=!0,()=>v=!0);if(!H&&!_.inFlow&&O.length>1024){if(X)throw Error("With simple keys, single line scalar must not span more than 1024 characters");H=!0}if(_.inFlow){if(z||I==null){if(Y&&u)u();return O===""?"?":H?`? ${O}`:O}}else if(z&&!X||I==null&&H){if(O=`? ${O}`,Q&&!Y)O+=k0.lineComment(O,_.indent,q(Q));else if(v&&U)U();return O}if(Y)Q=null;if(H){if(Q)O+=k0.lineComment(O,_.indent,q(Q));O=`? ${O}
|
|
61
|
+
${J}:`}else if(O=`${O}:`,Q)O+=k0.lineComment(O,_.indent,q(Q));let T,L,V;if(p4.isNode(I))T=!!I.spaceBefore,L=I.commentBefore,V=I.comment;else if(T=!1,L=null,V=null,I&&typeof I==="object")I=g.createNode(I);if(_.implicitKey=!1,!H&&!Q&&p4.isScalar(I))_.indentAtStart=O.length+1;if(v=!1,!N&&G.length>=2&&!_.inFlow&&!H&&p4.isSeq(I)&&!I.flow&&!I.tag&&!I.anchor)_.indent=_.indent.substring(2);let R=!1,M=m5.stringify(I,_,()=>R=!0,()=>v=!0),Z=" ";if(Q||T||L){if(Z=T?`
|
|
62
|
+
`:"",L){let K=q(L);Z+=`
|
|
63
|
+
${k0.indentComment(K,_.indent)}`}if(M===""&&!_.inFlow){if(Z===`
|
|
64
|
+
`&&V)Z=`
|
|
65
65
|
|
|
66
66
|
`}else Z+=`
|
|
67
|
-
${_.indent}`}else if(!
|
|
68
|
-
`),
|
|
69
|
-
${_.indent}`}}else if(
|
|
70
|
-
`)Z="";if(O+=Z+
|
|
71
|
-
${G}${
|
|
72
|
-
`}}if($){if(
|
|
73
|
-
`+AU.indentComment(
|
|
74
|
-
`)))
|
|
75
|
-
${z}${U}${
|
|
76
|
-
`;return`${
|
|
77
|
-
${U}${
|
|
78
|
-
`:" ")}return
|
|
67
|
+
${_.indent}`}else if(!H&&p4.isCollection(I)){let K=M[0],D=M.indexOf(`
|
|
68
|
+
`),S=D!==-1,C=_.inFlow??I.flow??I.items.length===0;if(S||!C){let x=!1;if(S&&(K==="&"||K==="!")){let P=M.indexOf(" ");if(K==="&"&&P!==-1&&P<D&&M[P+1]==="!")P=M.indexOf(" ",P+1);if(P===-1||D<P)x=!0}if(!x)Z=`
|
|
69
|
+
${_.indent}`}}else if(M===""||M[0]===`
|
|
70
|
+
`)Z="";if(O+=Z+M,_.inFlow){if(R&&u)u()}else if(V&&!R)O+=k0.lineComment(O,_.indent,q(V));else if(v&&U)U();return O}aM.stringifyPair=tM});var Jz=w((IK)=>{var n5=z$("process");function sM($,...I){if($==="debug")console.log(...I)}function $K($,I){if($==="debug"||$==="warn")if(typeof n5.emitWarning==="function")n5.emitWarning(I);else console.warn(I)}IK.debug=sM;IK.warn=$K});var WU=w((zK)=>{var y0=I$(),h5=L$(),LU="<<",ZU={identify:($)=>$===LU||typeof $==="symbol"&&$.description===LU,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new h5.Scalar(Symbol(LU)),{addToJSMap:d5}),stringify:()=>LU},uK=($,I)=>(ZU.identify(I)||y0.isScalar(I)&&(!I.type||I.type===h5.Scalar.PLAIN)&&ZU.identify(I.value))&&$?.doc.schema.tags.some((_)=>_.tag===ZU.tag&&_.default);function d5($,I,_){if(_=$&&y0.isAlias(_)?_.resolve($.doc):_,y0.isSeq(_))for(let u of _.items)Gz($,I,u);else if(Array.isArray(_))for(let u of _)Gz($,I,u);else Gz($,I,_)}function Gz($,I,_){let u=$&&y0.isAlias(_)?_.resolve($.doc):_;if(!y0.isMap(u))throw Error("Merge sources must be maps or map aliases");let U=u.toJSON(null,$,Map);for(let[z,g]of U)if(I instanceof Map){if(!I.has(z))I.set(z,g)}else if(I instanceof Set)I.add(z);else if(!Object.prototype.hasOwnProperty.call(I,z))Object.defineProperty(I,z,{value:g,writable:!0,enumerable:!0,configurable:!0});return I}zK.addMergeToJSMap=d5;zK.isMergeKey=uK;zK.merge=ZU});var Xz=w((vK)=>{var qK=Jz(),c5=WU(),XK=x0(),p5=I$(),qz=N6();function NK($,I,{key:_,value:u}){if(p5.isNode(_)&&_.addToJSMap)_.addToJSMap($,I,u);else if(c5.isMergeKey($,_))c5.addMergeToJSMap($,I,u);else{let U=qz.toJS(_,"",$);if(I instanceof Map)I.set(U,qz.toJS(u,U,$));else if(I instanceof Set)I.add(U);else{let z=QK(_,U,$),g=qz.toJS(u,z,$);if(z in I)Object.defineProperty(I,z,{value:g,writable:!0,enumerable:!0,configurable:!0});else I[z]=g}}return I}function QK($,I,_){if(I===null)return"";if(typeof I!=="object")return String(I);if(p5.isNode($)&&_?.doc){let u=XK.createStringifyContext(_.doc,{});u.anchors=new Set;for(let z of _.anchors.keys())u.anchors.add(z.anchor);u.inFlow=!0,u.inStringifyKey=!0;let U=$.toString(u);if(!_.mapKeyWarned){let z=JSON.stringify(U);if(z.length>40)z=z.substring(0,36)+'..."';qK.warn(_.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${z}. Set mapAsMap: true to use object keys.`),_.mapKeyWarned=!0}return U}return JSON.stringify(I)}vK.addPairToJSMap=NK});var H6=w((BK)=>{var o5=w0(),YK=r5(),OK=Xz(),PU=I$();function TK($,I,_){let u=o5.createNode($,void 0,_),U=o5.createNode(I,void 0,_);return new bU(u,U)}class bU{constructor($,I=null){Object.defineProperty(this,PU.NODE_TYPE,{value:PU.PAIR}),this.key=$,this.value=I}clone($){let{key:I,value:_}=this;if(PU.isNode(I))I=I.clone($);if(PU.isNode(_))_=_.clone($);return new bU(I,_)}toJSON($,I){let _=I?.mapAsMap?new Map:{};return OK.addPairToJSMap(I,_,this)}toString($,I,_){return $?.doc?YK.stringifyPair(this,$,I,_):JSON.stringify(this)}}BK.Pair=bU;BK.createPair=TK});var Nz=w((LK)=>{var n6=I$(),t5=x0(),AU=E0();function KK($,I,_){return(I.inFlow??$.flow?RK:VK)($,I,_)}function VK({comment:$,items:I},_,{blockItemPrefix:u,flowChars:U,itemIndent:z,onChompKeep:g,onComment:J}){let{indent:G,options:{commentString:q}}=_,N=Object.assign({},_,{indent:z,type:null}),X=!1,Q=[];for(let Y=0;Y<I.length;++Y){let v=I[Y],O=null;if(n6.isNode(v)){if(!X&&v.spaceBefore)Q.push("");if(jU(_,Q,v.commentBefore,X),v.comment)O=v.comment}else if(n6.isPair(v)){let L=n6.isNode(v.key)?v.key:null;if(L){if(!X&&L.spaceBefore)Q.push("");jU(_,Q,L.commentBefore,X)}}X=!1;let T=t5.stringify(v,N,()=>O=null,()=>X=!0);if(O)T+=AU.lineComment(T,z,q(O));if(X&&O)X=!1;Q.push(u+T)}let H;if(Q.length===0)H=U.start+U.end;else{H=Q[0];for(let Y=1;Y<Q.length;++Y){let v=Q[Y];H+=v?`
|
|
71
|
+
${G}${v}`:`
|
|
72
|
+
`}}if($){if(H+=`
|
|
73
|
+
`+AU.indentComment(q($),G),J)J()}else if(X&&g)g();return H}function RK({items:$},I,{flowChars:_,itemIndent:u}){let{indent:U,indentStep:z,flowCollectionPadding:g,options:{commentString:J}}=I;u+=z;let G=Object.assign({},I,{indent:u,inFlow:!0,type:null}),q=!1,N=0,X=[];for(let Y=0;Y<$.length;++Y){let v=$[Y],O=null;if(n6.isNode(v)){if(v.spaceBefore)X.push("");if(jU(I,X,v.commentBefore,!1),v.comment)O=v.comment}else if(n6.isPair(v)){let L=n6.isNode(v.key)?v.key:null;if(L){if(L.spaceBefore)X.push("");if(jU(I,X,L.commentBefore,!1),L.comment)q=!0}let V=n6.isNode(v.value)?v.value:null;if(V){if(V.comment)O=V.comment;if(V.commentBefore)q=!0}else if(v.value==null&&L?.comment)O=L.comment}if(O)q=!0;let T=t5.stringify(v,G,()=>O=null);if(Y<$.length-1)T+=",";if(O)T+=AU.lineComment(T,u,J(O));if(!q&&(X.length>N||T.includes(`
|
|
74
|
+
`)))q=!0;X.push(T),N=X.length}let{start:Q,end:H}=_;if(X.length===0)return Q+H;else{if(!q){let Y=X.reduce((v,O)=>v+O.length+2,2);q=I.options.lineWidth>0&&Y>I.options.lineWidth}if(q){let Y=Q;for(let v of X)Y+=v?`
|
|
75
|
+
${z}${U}${v}`:`
|
|
76
|
+
`;return`${Y}
|
|
77
|
+
${U}${H}`}else return`${Q}${g}${X.join(" ")}${g}${H}`}}function jU({indent:$,options:{commentString:I}},_,u,U){if(u&&U)u=u.replace(/^\n+/,"");if(u){let z=AU.indentComment(I(u),$);_.push(z.trimStart())}}LK.stringifyCollection=KK});var O6=w((jK)=>{var WK=Nz(),PK=Xz(),bK=MU(),Y6=I$(),FU=H6(),AK=L$();function i0($,I){let _=Y6.isScalar(I)?I.value:I;for(let u of $)if(Y6.isPair(u)){if(u.key===I||u.key===_)return u;if(Y6.isScalar(u.key)&&u.key.value===_)return u}return}class a5 extends bK.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor($){super(Y6.MAP,$);this.items=[]}static from($,I,_){let{keepUndefined:u,replacer:U}=_,z=new this($),g=(J,G)=>{if(typeof U==="function")G=U.call(I,J,G);else if(Array.isArray(U)&&!U.includes(J))return;if(G!==void 0||u)z.items.push(FU.createPair(J,G,_))};if(I instanceof Map)for(let[J,G]of I)g(J,G);else if(I&&typeof I==="object")for(let J of Object.keys(I))g(J,I[J]);if(typeof $.sortMapEntries==="function")z.items.sort($.sortMapEntries);return z}add($,I){let _;if(Y6.isPair($))_=$;else if(!$||typeof $!=="object"||!("key"in $))_=new FU.Pair($,$?.value);else _=new FU.Pair($.key,$.value);let u=i0(this.items,_.key),U=this.schema?.sortMapEntries;if(u){if(!I)throw Error(`Key ${_.key} already set`);if(Y6.isScalar(u.value)&&AK.isScalarValue(_.value))u.value.value=_.value;else u.value=_.value}else if(U){let z=this.items.findIndex((g)=>U(_,g)<0);if(z===-1)this.items.push(_);else this.items.splice(z,0,_)}else this.items.push(_)}delete($){let I=i0(this.items,$);if(!I)return!1;return this.items.splice(this.items.indexOf(I),1).length>0}get($,I){let u=i0(this.items,$)?.value;return(!I&&Y6.isScalar(u)?u.value:u)??void 0}has($){return!!i0(this.items,$)}set($,I){this.add(new FU.Pair($,I),!0)}toJSON($,I,_){let u=_?new _:I?.mapAsMap?new Map:{};if(I?.onCreate)I.onCreate(u);for(let U of this.items)PK.addPairToJSMap(I,u,U);return u}toString($,I,_){if(!$)return JSON.stringify(this);for(let u of this.items)if(!Y6.isPair(u))throw Error(`Map items must all be pairs; found ${JSON.stringify(u)} instead`);if(!$.allNullValues&&this.hasAllNullValues(!1))$=Object.assign({},$,{allNullValues:!0});return WK.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:_,onComment:I})}}jK.YAMLMap=a5;jK.findPair=i0});var b1=w((CK)=>{var wK=I$(),e5=O6(),EK={collection:"map",default:!0,nodeClass:e5.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,I){if(!wK.isMap($))I("Expected a mapping for this tag");return $},createNode:($,I,_)=>e5.YAMLMap.from($,I,_)};CK.map=EK});var T6=w((mK)=>{var xK=w0(),kK=Nz(),yK=MU(),wU=I$(),iK=L$(),lK=N6();class s5 extends yK.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(wU.SEQ,$);this.items=[]}add($){this.items.push($)}delete($){let I=SU($);if(typeof I!=="number")return!1;return this.items.splice(I,1).length>0}get($,I){let _=SU($);if(typeof _!=="number")return;let u=this.items[_];return!I&&wU.isScalar(u)?u.value:u}has($){let I=SU($);return typeof I==="number"&&I<this.items.length}set($,I){let _=SU($);if(typeof _!=="number")throw Error(`Expected a valid index, not ${$}.`);let u=this.items[_];if(wU.isScalar(u)&&iK.isScalarValue(I))u.value=I;else this.items[_]=I}toJSON($,I){let _=[];if(I?.onCreate)I.onCreate(_);let u=0;for(let U of this.items)_.push(lK.toJS(U,String(u++),I));return _}toString($,I,_){if(!$)return JSON.stringify(this);return kK.stringifyCollection(this,$,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:($.indent||"")+" ",onChompKeep:_,onComment:I})}static from($,I,_){let{replacer:u}=_,U=new this($);if(I&&Symbol.iterator in Object(I)){let z=0;for(let g of I){if(typeof u==="function"){let J=I instanceof Set?g:String(z++);g=u.call(I,J,g)}U.items.push(xK.createNode(g,void 0,_))}}return U}}function SU($){let I=wU.isScalar($)?$.value:$;if(I&&typeof I==="string")I=Number(I);return typeof I==="number"&&Number.isInteger(I)&&I>=0?I:null}mK.YAMLSeq=s5});var A1=w((dK)=>{var nK=I$(),$N=T6(),hK={collection:"seq",default:!0,nodeClass:$N.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,I){if(!nK.isSeq($))I("Expected a sequence for this tag");return $},createNode:($,I,_)=>$N.YAMLSeq.from($,I,_)};dK.seq=hK});var l0=w((tK)=>{var pK=f0(),oK={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,I,_,u){return I=Object.assign({actualString:!0},I),pK.stringifyString($,I,_,u)}};tK.string=oK});var EU=w((eK)=>{var IN=L$(),UN={identify:($)=>$==null,createNode:()=>new IN.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new IN.Scalar(null),stringify:({source:$},I)=>typeof $==="string"&&UN.test.test($)?$:I.options.nullStr};eK.nullTag=UN});var Qz=w((IV)=>{var $V=L$(),_N={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new $V.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:I},_){if($&&_N.test.test($)){let u=$[0]==="t"||$[0]==="T";if(I===u)return $}return I?_.options.trueStr:_.options.falseStr}};IV.boolTag=_N});var j1=w((uV)=>{function _V({format:$,minFractionDigits:I,tag:_,value:u}){if(typeof u==="bigint")return String(u);let U=typeof u==="number"?u:Number(u);if(!isFinite(U))return isNaN(U)?".nan":U<0?"-.inf":".inf";let z=Object.is(u,-0)?"-0":JSON.stringify(u);if(!$&&I&&(!_||_==="tag:yaml.org,2002:float")&&/^\d/.test(z)){let g=z.indexOf(".");if(g<0)g=z.length,z+=".";let J=I-(z.length-g-1);while(J-- >0)z+="0"}return z}uV.stringifyNumber=_V});var Hz=w((XV)=>{var gV=L$(),vz=j1(),JV={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:($)=>$.slice(-3).toLowerCase()==="nan"?NaN:$[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:vz.stringifyNumber},GV={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:($)=>parseFloat($),stringify($){let I=Number($.value);return isFinite(I)?I.toExponential():vz.stringifyNumber($)}},qV={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let I=new gV.Scalar(parseFloat($)),_=$.indexOf(".");if(_!==-1&&$[$.length-1]==="0")I.minFractionDigits=$.length-_-1;return I},stringify:vz.stringifyNumber};XV.float=qV;XV.floatExp=GV;XV.floatNaN=JV});var Oz=w((TV)=>{var uN=j1(),CU=($)=>typeof $==="bigint"||Number.isInteger($),Yz=($,I,_,{intAsBigInt:u})=>u?BigInt($):parseInt($.substring(I),_);function zN($,I,_){let{value:u}=$;if(CU(u)&&u>=0)return _+u.toString(I);return uN.stringifyNumber($)}var HV={identify:($)=>CU($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,I,_)=>Yz($,2,8,_),stringify:($)=>zN($,8,"0o")},YV={identify:CU,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,I,_)=>Yz($,0,10,_),stringify:uN.stringifyNumber},OV={identify:($)=>CU($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,I,_)=>Yz($,2,16,_),stringify:($)=>zN($,16,"0x")};TV.int=YV;TV.intHex=OV;TV.intOct=HV});var gN=w((PV)=>{var KV=b1(),VV=EU(),RV=A1(),LV=l0(),ZV=Qz(),Tz=Hz(),Bz=Oz(),WV=[KV.map,RV.seq,LV.string,VV.nullTag,ZV.boolTag,Bz.intOct,Bz.int,Bz.intHex,Tz.floatNaN,Tz.floatExp,Tz.float];PV.schema=WV});var GN=w((CV)=>{var AV=L$(),jV=b1(),FV=A1();function JN($){return typeof $==="bigint"||Number.isInteger($)}var fU=({value:$})=>JSON.stringify($),SV=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:fU},{identify:($)=>$==null,createNode:()=>new AV.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:fU},{identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:($)=>$==="true",stringify:fU},{identify:JN,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:($,I,{intAsBigInt:_})=>_?BigInt($):parseInt($,10),stringify:({value:$})=>JN($)?$.toString():JSON.stringify($)},{identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:($)=>parseFloat($),stringify:fU}],wV={default:!0,tag:"",test:/^/,resolve($,I){return I(`Unresolved plain scalar ${JSON.stringify($)}`),$}},EV=[jV.map,FV.seq].concat(SV,wV);CV.schema=EV});var Mz=w((yV)=>{var m0=z$("buffer"),Dz=L$(),xV=f0(),kV={identify:($)=>$ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve($,I){if(typeof m0.Buffer==="function")return m0.Buffer.from($,"base64");else if(typeof atob==="function"){let _=atob($.replace(/[\n\r]/g,"")),u=new Uint8Array(_.length);for(let U=0;U<_.length;++U)u[U]=_.charCodeAt(U);return u}else return I("This environment does not support reading binary tags; either Buffer or atob is required"),$},stringify({comment:$,type:I,value:_},u,U,z){if(!_)return"";let g=_,J;if(typeof m0.Buffer==="function")J=g instanceof m0.Buffer?g.toString("base64"):m0.Buffer.from(g.buffer).toString("base64");else if(typeof btoa==="function"){let G="";for(let q=0;q<g.length;++q)G+=String.fromCharCode(g[q]);J=btoa(G)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(I??(I=Dz.Scalar.BLOCK_LITERAL),I!==Dz.Scalar.QUOTE_DOUBLE){let G=Math.max(u.options.lineWidth-u.indent.length,u.options.minContentWidth),q=Math.ceil(J.length/G),N=Array(q);for(let X=0,Q=0;X<q;++X,Q+=G)N[X]=J.substr(Q,G);J=N.join(I===Dz.Scalar.BLOCK_LITERAL?`
|
|
78
|
+
`:" ")}return xV.stringifyString({comment:$,type:I,value:J},u,U,z)}};yV.binary=kV});var kU=w((nV)=>{var xU=I$(),Kz=H6(),lV=L$(),mV=T6();function qN($,I){if(xU.isSeq($))for(let _=0;_<$.items.length;++_){let u=$.items[_];if(xU.isPair(u))continue;else if(xU.isMap(u)){if(u.items.length>1)I("Each pair must have its own sequence indicator");let U=u.items[0]||new Kz.Pair(new lV.Scalar(null));if(u.commentBefore)U.key.commentBefore=U.key.commentBefore?`${u.commentBefore}
|
|
79
79
|
${U.key.commentBefore}`:u.commentBefore;if(u.comment){let z=U.value??U.key;z.comment=z.comment?`${u.comment}
|
|
80
|
-
${z.comment}`:u.comment}u=U}$.items[_]=xU.isPair(u)?u:new Rz.Pair(u)}else I("Expected a sequence for this tag");return $}function N5($,I,_){let{replacer:u}=_,U=new lV.YAMLSeq($);U.tag="tag:yaml.org,2002:pairs";let z=0;if(I&&Symbol.iterator in Object(I))for(let g of I){if(typeof u==="function")g=u.call(I,String(z++),g);let J,G;if(Array.isArray(g))if(g.length===2)J=g[0],G=g[1];else throw TypeError(`Expected [key, value] tuple: ${g}`);else if(g&&g instanceof Object){let v=Object.keys(g);if(v.length===1)J=v[0],G=g[J];else throw TypeError(`Expected tuple with one key, not ${v.length} keys`)}else J=g;U.items.push(Rz.createPair(J,G,_))}return U}var rV={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:X5,createNode:N5};mV.createPairs=N5;mV.pairs=rV;mV.resolvePairs=X5});var Wz=E((oV)=>{var Q5=U$(),Zz=v6(),n0=Y6(),cV=H6(),Y5=kU();class n6 extends cV.YAMLSeq{constructor(){super();this.add=n0.YAMLMap.prototype.add.bind(this),this.delete=n0.YAMLMap.prototype.delete.bind(this),this.get=n0.YAMLMap.prototype.get.bind(this),this.has=n0.YAMLMap.prototype.has.bind(this),this.set=n0.YAMLMap.prototype.set.bind(this),this.tag=n6.tag}toJSON($,I){if(!I)return super.toJSON($);let _=new Map;if(I?.onCreate)I.onCreate(_);for(let u of this.items){let U,z;if(Q5.isPair(u))U=Zz.toJS(u.key,"",I),z=Zz.toJS(u.value,U,I);else U=Zz.toJS(u,"",I);if(_.has(U))throw Error("Ordered maps must not include duplicate keys");_.set(U,z)}return _}static from($,I,_){let u=Y5.createPairs($,I,_),U=new this;return U.items=u.items,U}}n6.tag="tag:yaml.org,2002:omap";var pV={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:n6,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,I){let _=Y5.resolvePairs($,I),u=[];for(let{key:U}of _.items)if(Q5.isScalar(U))if(u.includes(U.value))I(`Ordered maps must not include duplicate keys: ${U.value}`);else u.push(U.value);return Object.assign(new n6,_)},createNode:($,I,_)=>n6.from($,I,_)};oV.YAMLOMap=n6;oV.omap=pV});var D5=E((eV)=>{var H5=Z$();function O5({value:$,source:I},_){if(I&&($?T5:B5).test.test(I))return I;return $?_.options.trueStr:_.options.falseStr}var T5={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new H5.Scalar(!0),stringify:O5},B5={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new H5.Scalar(!1),stringify:O5};eV.falseTag=B5;eV.trueTag=T5});var M5=E((zL)=>{var IL=Z$(),Pz=F1(),UL={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:($)=>$.slice(-3).toLowerCase()==="nan"?NaN:$[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Pz.stringifyNumber},_L={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:($)=>parseFloat($.replace(/_/g,"")),stringify($){let I=Number($.value);return isFinite(I)?I.toExponential():Pz.stringifyNumber($)}},uL={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let I=new IL.Scalar(parseFloat($.replace(/_/g,""))),_=$.indexOf(".");if(_!==-1){let u=$.substring(_+1).replace(/_/g,"");if(u[u.length-1]==="0")I.minFractionDigits=u.length}return I},stringify:Pz.stringifyNumber};zL.float=uL;zL.floatExp=_L;zL.floatNaN=UL});var V5=E((QL)=>{var K5=F1(),h0=($)=>typeof $==="bigint"||Number.isInteger($);function yU($,I,_,{intAsBigInt:u}){let U=$[0];if(U==="-"||U==="+")I+=1;if($=$.substring(I).replace(/_/g,""),u){switch(_){case 2:$=`0b${$}`;break;case 8:$=`0o${$}`;break;case 16:$=`0x${$}`;break}let g=BigInt($);return U==="-"?BigInt(-1)*g:g}let z=parseInt($,_);return U==="-"?-1*z:z}function bz($,I,_){let{value:u}=$;if(h0(u)){let U=u.toString(I);return u<0?"-"+_+U.substr(1):_+U}return K5.stringifyNumber($)}var vL={identify:h0,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,I,_)=>yU($,2,2,_),stringify:($)=>bz($,2,"0b")},qL={identify:h0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,I,_)=>yU($,1,8,_),stringify:($)=>bz($,8,"0")},XL={identify:h0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,I,_)=>yU($,0,10,_),stringify:K5.stringifyNumber},NL={identify:h0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,I,_)=>yU($,2,16,_),stringify:($)=>bz($,16,"0x")};QL.int=XL;QL.intBin=vL;QL.intHex=NL;QL.intOct=qL});var Az=E((DL)=>{var rU=U$(),iU=N6(),lU=Y6();class h6 extends lU.YAMLMap{constructor($){super($);this.tag=h6.tag}add($){let I;if(rU.isPair($))I=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)I=new iU.Pair($.key,null);else I=new iU.Pair($,null);if(!lU.findPair(this.items,I.key))this.items.push(I)}get($,I){let _=lU.findPair(this.items,$);return!I&&rU.isPair(_)?rU.isScalar(_.key)?_.key.value:_.key:_}set($,I){if(typeof I!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof I}`);let _=lU.findPair(this.items,$);if(_&&!I)this.items.splice(this.items.indexOf(_),1);else if(!_&&I)this.items.push(new iU.Pair($))}toJSON($,I){return super.toJSON($,I,Set)}toString($,I,_){if(!$)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},$,{allNullValues:!0}),I,_);else throw Error("Set items must all have null values")}static from($,I,_){let{replacer:u}=_,U=new this($);if(I&&Symbol.iterator in Object(I))for(let z of I){if(typeof u==="function")z=u.call(I,z,z);U.items.push(iU.createPair(z,null,_))}return U}}h6.tag="tag:yaml.org,2002:set";var BL={collection:"map",identify:($)=>$ instanceof Set,nodeClass:h6,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,I,_)=>h6.from($,I,_),resolve($,I){if(rU.isMap($))if($.hasAllNullValues(!0))return Object.assign(new h6,$);else I("Set items must all have null values");else I("Expected a mapping for this tag");return $}};DL.YAMLSet=h6;DL.set=BL});var Fz=E((ZL)=>{var VL=F1();function jz($,I){let _=$[0],u=_==="-"||_==="+"?$.substring(1):$,U=(g)=>I?BigInt(g):Number(g),z=u.replace(/_/g,"").split(":").reduce((g,J)=>g*U(60)+U(J),U(0));return _==="-"?U(-1)*z:z}function L5($){let{value:I}=$,_=(g)=>g;if(typeof I==="bigint")_=(g)=>BigInt(g);else if(isNaN(I)||!isFinite(I))return VL.stringifyNumber($);let u="";if(I<0)u="-",I*=_(-1);let U=_(60),z=[I%U];if(I<60)z.unshift(0);else if(I=(I-z[0])/U,z.unshift(I%U),I>=60)I=(I-z[0])/U,z.unshift(I);return u+z.map((g)=>String(g).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var LL={identify:($)=>typeof $==="bigint"||Number.isInteger($),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:($,I,{intAsBigInt:_})=>jz($,_),stringify:L5},RL={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:($)=>jz($,!1),stringify:L5},R5={identify:($)=>$ instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve($){let I=$.match(R5.test);if(!I)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,_,u,U,z,g,J]=I.map(Number),G=I[7]?Number((I[7]+"00").substr(1,3)):0,v=Date.UTC(_,u-1,U,z||0,g||0,J||0,G),X=I[8];if(X&&X!=="Z"){let q=jz(X,!1);if(Math.abs(q)<30)q*=60;v-=60000*q}return new Date(v)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};ZL.floatTime=RL;ZL.intTime=LL;ZL.timestamp=R5});var W5=E((yL)=>{var AL=A1(),jL=EU(),FL=j1(),SL=r0(),wL=Lz(),Z5=D5(),Sz=M5(),mU=V5(),EL=WU(),CL=Wz(),fL=kU(),xL=Az(),wz=Fz(),kL=[AL.map,FL.seq,SL.string,jL.nullTag,Z5.trueTag,Z5.falseTag,mU.intBin,mU.intOct,mU.int,mU.intHex,Sz.floatNaN,Sz.floatExp,Sz.float,wL.binary,EL.merge,CL.omap,fL.pairs,xL.set,wz.intTime,wz.floatTime,wz.timestamp];yL.schema=kL});var f5=E((pL)=>{var j5=A1(),lL=EU(),F5=j1(),rL=r0(),mL=Hz(),Ez=Tz(),Cz=Dz(),nL=G5(),hL=q5(),S5=Lz(),d0=WU(),w5=Wz(),E5=kU(),P5=W5(),C5=Az(),nU=Fz(),b5=new Map([["core",nL.schema],["failsafe",[j5.map,F5.seq,rL.string]],["json",hL.schema],["yaml11",P5.schema],["yaml-1.1",P5.schema]]),A5={binary:S5.binary,bool:mL.boolTag,float:Ez.float,floatExp:Ez.floatExp,floatNaN:Ez.floatNaN,floatTime:nU.floatTime,int:Cz.int,intHex:Cz.intHex,intOct:Cz.intOct,intTime:nU.intTime,map:j5.map,merge:d0.merge,null:lL.nullTag,omap:w5.omap,pairs:E5.pairs,seq:F5.seq,set:C5.set,timestamp:nU.timestamp},dL={"tag:yaml.org,2002:binary":S5.binary,"tag:yaml.org,2002:merge":d0.merge,"tag:yaml.org,2002:omap":w5.omap,"tag:yaml.org,2002:pairs":E5.pairs,"tag:yaml.org,2002:set":C5.set,"tag:yaml.org,2002:timestamp":nU.timestamp};function cL($,I,_){let u=b5.get(I);if(u&&!$)return _&&!u.includes(d0.merge)?u.concat(d0.merge):u.slice();let U=u;if(!U)if(Array.isArray($))U=[];else{let z=Array.from(b5.keys()).filter((g)=>g!=="yaml11").map((g)=>JSON.stringify(g)).join(", ");throw Error(`Unknown schema "${I}"; use one of ${z} or define customTags array`)}if(Array.isArray($))for(let z of $)U=U.concat(z);else if(typeof $==="function")U=$(U.slice());if(_)U=U.concat(d0.merge);return U.reduce((z,g)=>{let J=typeof g==="string"?A5[g]:g;if(!J){let G=JSON.stringify(g),v=Object.keys(A5).map((X)=>JSON.stringify(X)).join(", ");throw Error(`Unknown custom tag ${G}; use one of ${v}`)}if(!z.includes(J))z.push(J);return z},[])}pL.coreKnownTags=dL;pL.getTags=cL});var kz=E((IR)=>{var fz=U$(),aL=A1(),eL=j1(),sL=r0(),hU=f5(),$R=($,I)=>$.key<I.key?-1:$.key>I.key?1:0;class xz{constructor({compat:$,customTags:I,merge:_,resolveKnownTags:u,schema:U,sortMapEntries:z,toStringDefaults:g}){this.compat=Array.isArray($)?hU.getTags($,"compat"):$?hU.getTags(null,$):null,this.name=typeof U==="string"&&U||"core",this.knownTags=u?hU.coreKnownTags:{},this.tags=hU.getTags(I,this.name,_),this.toStringOptions=g??null,Object.defineProperty(this,fz.MAP,{value:aL.map}),Object.defineProperty(this,fz.SCALAR,{value:sL.string}),Object.defineProperty(this,fz.SEQ,{value:eL.seq}),this.sortMapEntries=typeof z==="function"?z:z===!0?$R:null}clone(){let $=Object.create(xz.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}IR.Schema=xz});var x5=E((zR)=>{var _R=U$(),yz=k0(),c0=C0();function uR($,I){let _=[],u=I.directives===!0;if(I.directives!==!1&&$.directives){let G=$.directives.toString($);if(G)_.push(G),u=!0;else if($.directives.docStart)u=!0}if(u)_.push("---");let U=yz.createStringifyContext($,I),{commentString:z}=U.options;if($.commentBefore){if(_.length!==1)_.unshift("");let G=z($.commentBefore);_.unshift(c0.indentComment(G,""))}let g=!1,J=null;if($.contents){if(_R.isNode($.contents)){if($.contents.spaceBefore&&u)_.push("");if($.contents.commentBefore){let X=z($.contents.commentBefore);_.push(c0.indentComment(X,""))}U.forceBlockIndent=!!$.comment,J=$.contents.comment}let G=J?void 0:()=>g=!0,v=yz.stringify($.contents,U,()=>J=null,G);if(J)v+=c0.lineComment(v,"",z(J));if((v[0]==="|"||v[0]===">")&&_[_.length-1]==="---")_[_.length-1]=`--- ${v}`;else _.push(v)}else _.push(yz.stringify($.contents,U));if($.directives?.docEnd)if($.comment){let G=z($.comment);if(G.includes(`
|
|
81
|
-
`))_.push("..."),_.push(
|
|
80
|
+
${z.comment}`:u.comment}u=U}$.items[_]=xU.isPair(u)?u:new Kz.Pair(u)}else I("Expected a sequence for this tag");return $}function XN($,I,_){let{replacer:u}=_,U=new mV.YAMLSeq($);U.tag="tag:yaml.org,2002:pairs";let z=0;if(I&&Symbol.iterator in Object(I))for(let g of I){if(typeof u==="function")g=u.call(I,String(z++),g);let J,G;if(Array.isArray(g))if(g.length===2)J=g[0],G=g[1];else throw TypeError(`Expected [key, value] tuple: ${g}`);else if(g&&g instanceof Object){let q=Object.keys(g);if(q.length===1)J=q[0],G=g[J];else throw TypeError(`Expected tuple with one key, not ${q.length} keys`)}else J=g;U.items.push(Kz.createPair(J,G,_))}return U}var rV={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:qN,createNode:XN};nV.createPairs=XN;nV.pairs=rV;nV.resolvePairs=qN});var Rz=w((tV)=>{var NN=I$(),Vz=N6(),r0=O6(),pV=T6(),QN=kU();class h6 extends pV.YAMLSeq{constructor(){super();this.add=r0.YAMLMap.prototype.add.bind(this),this.delete=r0.YAMLMap.prototype.delete.bind(this),this.get=r0.YAMLMap.prototype.get.bind(this),this.has=r0.YAMLMap.prototype.has.bind(this),this.set=r0.YAMLMap.prototype.set.bind(this),this.tag=h6.tag}toJSON($,I){if(!I)return super.toJSON($);let _=new Map;if(I?.onCreate)I.onCreate(_);for(let u of this.items){let U,z;if(NN.isPair(u))U=Vz.toJS(u.key,"",I),z=Vz.toJS(u.value,U,I);else U=Vz.toJS(u,"",I);if(_.has(U))throw Error("Ordered maps must not include duplicate keys");_.set(U,z)}return _}static from($,I,_){let u=QN.createPairs($,I,_),U=new this;return U.items=u.items,U}}h6.tag="tag:yaml.org,2002:omap";var oV={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:h6,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,I){let _=QN.resolvePairs($,I),u=[];for(let{key:U}of _.items)if(NN.isScalar(U))if(u.includes(U.value))I(`Ordered maps must not include duplicate keys: ${U.value}`);else u.push(U.value);return Object.assign(new h6,_)},createNode:($,I,_)=>h6.from($,I,_)};tV.YAMLOMap=h6;tV.omap=oV});var TN=w((sV)=>{var vN=L$();function HN({value:$,source:I},_){if(I&&($?YN:ON).test.test(I))return I;return $?_.options.trueStr:_.options.falseStr}var YN={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new vN.Scalar(!0),stringify:HN},ON={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new vN.Scalar(!1),stringify:HN};sV.falseTag=ON;sV.trueTag=YN});var BN=w((gR)=>{var UR=L$(),Lz=j1(),_R={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:($)=>$.slice(-3).toLowerCase()==="nan"?NaN:$[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Lz.stringifyNumber},uR={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:($)=>parseFloat($.replace(/_/g,"")),stringify($){let I=Number($.value);return isFinite(I)?I.toExponential():Lz.stringifyNumber($)}},zR={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let I=new UR.Scalar(parseFloat($.replace(/_/g,""))),_=$.indexOf(".");if(_!==-1){let u=$.substring(_+1).replace(/_/g,"");if(u[u.length-1]==="0")I.minFractionDigits=u.length}return I},stringify:Lz.stringifyNumber};gR.float=zR;gR.floatExp=uR;gR.floatNaN=_R});var MN=w((HR)=>{var DN=j1(),n0=($)=>typeof $==="bigint"||Number.isInteger($);function yU($,I,_,{intAsBigInt:u}){let U=$[0];if(U==="-"||U==="+")I+=1;if($=$.substring(I).replace(/_/g,""),u){switch(_){case 2:$=`0b${$}`;break;case 8:$=`0o${$}`;break;case 16:$=`0x${$}`;break}let g=BigInt($);return U==="-"?BigInt(-1)*g:g}let z=parseInt($,_);return U==="-"?-1*z:z}function Zz($,I,_){let{value:u}=$;if(n0(u)){let U=u.toString(I);return u<0?"-"+_+U.substr(1):_+U}return DN.stringifyNumber($)}var XR={identify:n0,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,I,_)=>yU($,2,2,_),stringify:($)=>Zz($,2,"0b")},NR={identify:n0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,I,_)=>yU($,1,8,_),stringify:($)=>Zz($,8,"0")},QR={identify:n0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,I,_)=>yU($,0,10,_),stringify:DN.stringifyNumber},vR={identify:n0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,I,_)=>yU($,2,16,_),stringify:($)=>Zz($,16,"0x")};HR.int=QR;HR.intBin=XR;HR.intHex=vR;HR.intOct=NR});var Wz=w((MR)=>{var mU=I$(),iU=H6(),lU=O6();class d6 extends lU.YAMLMap{constructor($){super($);this.tag=d6.tag}add($){let I;if(mU.isPair($))I=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)I=new iU.Pair($.key,null);else I=new iU.Pair($,null);if(!lU.findPair(this.items,I.key))this.items.push(I)}get($,I){let _=lU.findPair(this.items,$);return!I&&mU.isPair(_)?mU.isScalar(_.key)?_.key.value:_.key:_}set($,I){if(typeof I!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof I}`);let _=lU.findPair(this.items,$);if(_&&!I)this.items.splice(this.items.indexOf(_),1);else if(!_&&I)this.items.push(new iU.Pair($))}toJSON($,I){return super.toJSON($,I,Set)}toString($,I,_){if(!$)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},$,{allNullValues:!0}),I,_);else throw Error("Set items must all have null values")}static from($,I,_){let{replacer:u}=_,U=new this($);if(I&&Symbol.iterator in Object(I))for(let z of I){if(typeof u==="function")z=u.call(I,z,z);U.items.push(iU.createPair(z,null,_))}return U}}d6.tag="tag:yaml.org,2002:set";var DR={collection:"map",identify:($)=>$ instanceof Set,nodeClass:d6,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,I,_)=>d6.from($,I,_),resolve($,I){if(mU.isMap($))if($.hasAllNullValues(!0))return Object.assign(new d6,$);else I("Set items must all have null values");else I("Expected a mapping for this tag");return $}};MR.YAMLSet=d6;MR.set=DR});var bz=w((WR)=>{var RR=j1();function Pz($,I){let _=$[0],u=_==="-"||_==="+"?$.substring(1):$,U=(g)=>I?BigInt(g):Number(g),z=u.replace(/_/g,"").split(":").reduce((g,J)=>g*U(60)+U(J),U(0));return _==="-"?U(-1)*z:z}function KN($){let{value:I}=$,_=(g)=>g;if(typeof I==="bigint")_=(g)=>BigInt(g);else if(isNaN(I)||!isFinite(I))return RR.stringifyNumber($);let u="";if(I<0)u="-",I*=_(-1);let U=_(60),z=[I%U];if(I<60)z.unshift(0);else if(I=(I-z[0])/U,z.unshift(I%U),I>=60)I=(I-z[0])/U,z.unshift(I);return u+z.map((g)=>String(g).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var LR={identify:($)=>typeof $==="bigint"||Number.isInteger($),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:($,I,{intAsBigInt:_})=>Pz($,_),stringify:KN},ZR={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:($)=>Pz($,!1),stringify:KN},VN={identify:($)=>$ instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve($){let I=$.match(VN.test);if(!I)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,_,u,U,z,g,J]=I.map(Number),G=I[7]?Number((I[7]+"00").substr(1,3)):0,q=Date.UTC(_,u-1,U,z||0,g||0,J||0,G),N=I[8];if(N&&N!=="Z"){let X=Pz(N,!1);if(Math.abs(X)<30)X*=60;q-=60000*X}return new Date(q)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};WR.floatTime=ZR;WR.intTime=LR;WR.timestamp=VN});var LN=w((iR)=>{var jR=b1(),FR=EU(),SR=A1(),wR=l0(),ER=Mz(),RN=TN(),Az=BN(),rU=MN(),CR=WU(),fR=Rz(),xR=kU(),kR=Wz(),jz=bz(),yR=[jR.map,SR.seq,wR.string,FR.nullTag,RN.trueTag,RN.falseTag,rU.intBin,rU.intOct,rU.int,rU.intHex,Az.floatNaN,Az.floatExp,Az.float,ER.binary,CR.merge,fR.omap,xR.pairs,kR.set,jz.intTime,jz.floatTime,jz.timestamp];iR.schema=yR});var EN=w((oR)=>{var bN=b1(),mR=EU(),AN=A1(),rR=l0(),nR=Qz(),Fz=Hz(),Sz=Oz(),hR=gN(),dR=GN(),jN=Mz(),h0=WU(),FN=Rz(),SN=kU(),ZN=LN(),wN=Wz(),nU=bz(),WN=new Map([["core",hR.schema],["failsafe",[bN.map,AN.seq,rR.string]],["json",dR.schema],["yaml11",ZN.schema],["yaml-1.1",ZN.schema]]),PN={binary:jN.binary,bool:nR.boolTag,float:Fz.float,floatExp:Fz.floatExp,floatNaN:Fz.floatNaN,floatTime:nU.floatTime,int:Sz.int,intHex:Sz.intHex,intOct:Sz.intOct,intTime:nU.intTime,map:bN.map,merge:h0.merge,null:mR.nullTag,omap:FN.omap,pairs:SN.pairs,seq:AN.seq,set:wN.set,timestamp:nU.timestamp},cR={"tag:yaml.org,2002:binary":jN.binary,"tag:yaml.org,2002:merge":h0.merge,"tag:yaml.org,2002:omap":FN.omap,"tag:yaml.org,2002:pairs":SN.pairs,"tag:yaml.org,2002:set":wN.set,"tag:yaml.org,2002:timestamp":nU.timestamp};function pR($,I,_){let u=WN.get(I);if(u&&!$)return _&&!u.includes(h0.merge)?u.concat(h0.merge):u.slice();let U=u;if(!U)if(Array.isArray($))U=[];else{let z=Array.from(WN.keys()).filter((g)=>g!=="yaml11").map((g)=>JSON.stringify(g)).join(", ");throw Error(`Unknown schema "${I}"; use one of ${z} or define customTags array`)}if(Array.isArray($))for(let z of $)U=U.concat(z);else if(typeof $==="function")U=$(U.slice());if(_)U=U.concat(h0.merge);return U.reduce((z,g)=>{let J=typeof g==="string"?PN[g]:g;if(!J){let G=JSON.stringify(g),q=Object.keys(PN).map((N)=>JSON.stringify(N)).join(", ");throw Error(`Unknown custom tag ${G}; use one of ${q}`)}if(!z.includes(J))z.push(J);return z},[])}oR.coreKnownTags=cR;oR.getTags=pR});var Cz=w((UL)=>{var wz=I$(),eR=b1(),sR=A1(),$L=l0(),hU=EN(),IL=($,I)=>$.key<I.key?-1:$.key>I.key?1:0;class Ez{constructor({compat:$,customTags:I,merge:_,resolveKnownTags:u,schema:U,sortMapEntries:z,toStringDefaults:g}){this.compat=Array.isArray($)?hU.getTags($,"compat"):$?hU.getTags(null,$):null,this.name=typeof U==="string"&&U||"core",this.knownTags=u?hU.coreKnownTags:{},this.tags=hU.getTags(I,this.name,_),this.toStringOptions=g??null,Object.defineProperty(this,wz.MAP,{value:eR.map}),Object.defineProperty(this,wz.SCALAR,{value:$L.string}),Object.defineProperty(this,wz.SEQ,{value:sR.seq}),this.sortMapEntries=typeof z==="function"?z:z===!0?IL:null}clone(){let $=Object.create(Ez.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}UL.Schema=Ez});var CN=w((gL)=>{var uL=I$(),fz=x0(),d0=E0();function zL($,I){let _=[],u=I.directives===!0;if(I.directives!==!1&&$.directives){let G=$.directives.toString($);if(G)_.push(G),u=!0;else if($.directives.docStart)u=!0}if(u)_.push("---");let U=fz.createStringifyContext($,I),{commentString:z}=U.options;if($.commentBefore){if(_.length!==1)_.unshift("");let G=z($.commentBefore);_.unshift(d0.indentComment(G,""))}let g=!1,J=null;if($.contents){if(uL.isNode($.contents)){if($.contents.spaceBefore&&u)_.push("");if($.contents.commentBefore){let N=z($.contents.commentBefore);_.push(d0.indentComment(N,""))}U.forceBlockIndent=!!$.comment,J=$.contents.comment}let G=J?void 0:()=>g=!0,q=fz.stringify($.contents,U,()=>J=null,G);if(J)q+=d0.lineComment(q,"",z(J));if((q[0]==="|"||q[0]===">")&&_[_.length-1]==="---")_[_.length-1]=`--- ${q}`;else _.push(q)}else _.push(fz.stringify($.contents,U));if($.directives?.docEnd)if($.comment){let G=z($.comment);if(G.includes(`
|
|
81
|
+
`))_.push("..."),_.push(d0.indentComment(G,""));else _.push(`... ${G}`)}else _.push("...");else{let G=$.comment;if(G&&g)G=G.replace(/^\n+/,"");if(G){if((!g||J)&&_[_.length-1]!=="")_.push("");_.push(d0.indentComment(z(G),""))}}return _.join(`
|
|
82
82
|
`)+`
|
|
83
|
-
`}
|
|
84
|
-
`;g=J+g}if(/[^ ]/.test(g)){let J=1,G=_.linePos[1];if(G?.line===u&&G.col>U)J=Math.max(1,Math.min(G.col-U,80-z));let
|
|
83
|
+
`}gL.stringifyDocument=zL});var c0=w((YL)=>{var GL=S0(),F1=MU(),N4=I$(),qL=H6(),XL=N6(),NL=Cz(),QL=CN(),xz=TU(),vL=Uz(),HL=w0(),kz=Iz();class yz{constructor($,I,_){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,N4.NODE_TYPE,{value:N4.DOC});let u=null;if(typeof I==="function"||Array.isArray(I))u=I;else if(_===void 0&&I)_=I,I=void 0;let U=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},_);this.options=U;let{version:z}=U;if(_?._directives){if(this.directives=_._directives.atDocument(),this.directives.yaml.explicit)z=this.directives.yaml.version}else this.directives=new kz.Directives({version:z});this.setSchema(z,_),this.contents=$===void 0?null:this.createNode($,u,_)}clone(){let $=Object.create(yz.prototype,{[N4.NODE_TYPE]:{value:N4.DOC}});if($.commentBefore=this.commentBefore,$.comment=this.comment,$.errors=this.errors.slice(),$.warnings=this.warnings.slice(),$.options=Object.assign({},this.options),this.directives)$.directives=this.directives.clone();if($.schema=this.schema.clone(),$.contents=N4.isNode(this.contents)?this.contents.clone($.schema):this.contents,this.range)$.range=this.range.slice();return $}add($){if(S1(this.contents))this.contents.add($)}addIn($,I){if(S1(this.contents))this.contents.addIn($,I)}createAlias($,I){if(!$.anchor){let _=xz.anchorNames(this);$.anchor=!I||_.has(I)?xz.findNewAnchor(I||"a",_):I}return new GL.Alias($.anchor)}createNode($,I,_){let u=void 0;if(typeof I==="function")$=I.call({"":$},"",$),u=I;else if(Array.isArray(I)){let v=(T)=>typeof T==="number"||T instanceof String||T instanceof Number,O=I.filter(v).map(String);if(O.length>0)I=I.concat(O);u=I}else if(_===void 0&&I)_=I,I=void 0;let{aliasDuplicateObjects:U,anchorPrefix:z,flow:g,keepUndefined:J,onTagObj:G,tag:q}=_??{},{onAnchor:N,setAnchors:X,sourceObjects:Q}=xz.createNodeAnchors(this,z||"a"),H={aliasDuplicateObjects:U??!0,keepUndefined:J??!1,onAnchor:N,onTagObj:G,replacer:u,schema:this.schema,sourceObjects:Q},Y=HL.createNode($,q,H);if(g&&N4.isCollection(Y))Y.flow=!0;return X(),Y}createPair($,I,_={}){let u=this.createNode($,null,_),U=this.createNode(I,null,_);return new qL.Pair(u,U)}delete($){return S1(this.contents)?this.contents.delete($):!1}deleteIn($){if(F1.isEmptyPath($)){if(this.contents==null)return!1;return this.contents=null,!0}return S1(this.contents)?this.contents.deleteIn($):!1}get($,I){return N4.isCollection(this.contents)?this.contents.get($,I):void 0}getIn($,I){if(F1.isEmptyPath($))return!I&&N4.isScalar(this.contents)?this.contents.value:this.contents;return N4.isCollection(this.contents)?this.contents.getIn($,I):void 0}has($){return N4.isCollection(this.contents)?this.contents.has($):!1}hasIn($){if(F1.isEmptyPath($))return this.contents!==void 0;return N4.isCollection(this.contents)?this.contents.hasIn($):!1}set($,I){if(this.contents==null)this.contents=F1.collectionFromPath(this.schema,[$],I);else if(S1(this.contents))this.contents.set($,I)}setIn($,I){if(F1.isEmptyPath($))this.contents=I;else if(this.contents==null)this.contents=F1.collectionFromPath(this.schema,Array.from($),I);else if(S1(this.contents))this.contents.setIn($,I)}setSchema($,I={}){if(typeof $==="number")$=String($);let _;switch($){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new kz.Directives({version:"1.1"});_={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=$;else this.directives=new kz.Directives({version:$});_={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;_=null;break;default:{let u=JSON.stringify($);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${u}`)}}if(I.schema instanceof Object)this.schema=I.schema;else if(_)this.schema=new NL.Schema(Object.assign(_,I));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:$,jsonArg:I,mapAsMap:_,maxAliasCount:u,onAnchor:U,reviver:z}={}){let g={anchors:new Map,doc:this,keep:!$,mapAsMap:_===!0,mapKeyWarned:!1,maxAliasCount:typeof u==="number"?u:100},J=XL.toJS(this.contents,I??"",g);if(typeof U==="function")for(let{count:G,res:q}of g.anchors.values())U(q,G);return typeof z==="function"?vL.applyReviver(z,{"":J},"",J):J}toJSON($,I){return this.toJS({json:!0,jsonArg:$,mapAsMap:!1,onAnchor:I})}toString($={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in $&&(!Number.isInteger($.indent)||Number($.indent)<=0)){let I=JSON.stringify($.indent);throw Error(`"indent" option must be a positive integer, not ${I}`)}return QL.stringifyDocument(this,$)}}function S1($){if(N4.isCollection($))return!0;throw Error("Expected a YAML collection as document contents")}YL.Document=yz});var p0=w((BL)=>{class dU extends Error{constructor($,I,_,u){super();this.name=$,this.code=_,this.message=u,this.pos=I}}class fN extends dU{constructor($,I,_){super("YAMLParseError",$,I,_)}}class xN extends dU{constructor($,I,_){super("YAMLWarning",$,I,_)}}var TL=($,I)=>(_)=>{if(_.pos[0]===-1)return;_.linePos=_.pos.map((J)=>I.linePos(J));let{line:u,col:U}=_.linePos[0];_.message+=` at line ${u}, column ${U}`;let z=U-1,g=$.substring(I.lineStarts[u-1],I.lineStarts[u]).replace(/[\n\r]+$/,"");if(z>=60&&g.length>80){let J=Math.min(z-39,g.length-79);g="…"+g.substring(J),z-=J-1}if(g.length>80)g=g.substring(0,79)+"…";if(u>1&&/^ *$/.test(g.substring(0,z))){let J=$.substring(I.lineStarts[u-2],I.lineStarts[u-1]);if(J.length>80)J=J.substring(0,79)+`…
|
|
84
|
+
`;g=J+g}if(/[^ ]/.test(g)){let J=1,G=_.linePos[1];if(G?.line===u&&G.col>U)J=Math.max(1,Math.min(G.col-U,80-z));let q=" ".repeat(z)+"^".repeat(J);_.message+=`:
|
|
85
85
|
|
|
86
86
|
${g}
|
|
87
|
-
${
|
|
88
|
-
`}};
|
|
89
|
-
`))return!0;if($.end){for(let I of $.end)if(I.type==="newline")return!0}return!1;case"flow-collection":for(let I of $.items){for(let _ of I.start)if(_.type==="newline")return!0;if(I.sep){for(let _ of I.sep)if(_.type==="newline")return!0}if(
|
|
90
|
-
`+
|
|
91
|
-
`+
|
|
92
|
-
`+Z.comment;else
|
|
93
|
-
`+
|
|
94
|
-
`+
|
|
95
|
-
`+O.comment;else
|
|
96
|
-
`.repeat(Math.max(1,g.length-1)):"",O=u+U.length;if(I.source)O+=I.source.length;return{value:
|
|
97
|
-
`;for(let
|
|
98
|
-
`;else if(O.length>G||
|
|
99
|
-
`;else if(!
|
|
100
|
-
`)
|
|
87
|
+
${q}
|
|
88
|
+
`}};BL.YAMLError=dU;BL.YAMLParseError=fN;BL.YAMLWarning=xN;BL.prettifyError=TL});var o0=w((LL)=>{function RL($,{flow:I,indicator:_,next:u,offset:U,onError:z,parentIndent:g,startOnNewline:J}){let G=!1,q=J,N=J,X="",Q="",H=!1,Y=!1,v=null,O=null,T=null,L=null,V=null,R=null,M=null;for(let D of $){if(Y){if(D.type!=="space"&&D.type!=="newline"&&D.type!=="comma")z(D.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");Y=!1}if(v){if(q&&D.type!=="comment"&&D.type!=="newline")z(v,"TAB_AS_INDENT","Tabs are not allowed as indentation");v=null}switch(D.type){case"space":if(!I&&(_!=="doc-start"||u?.type!=="flow-collection")&&D.source.includes("\t"))v=D;N=!0;break;case"comment":{if(!N)z(D,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let S=D.source.substring(1)||" ";if(!X)X=S;else X+=Q+S;Q="",q=!1;break}case"newline":if(q){if(X)X+=D.source;else if(!R||_!=="seq-item-ind")G=!0}else Q+=D.source;if(q=!0,H=!0,O||T)L=D;N=!0;break;case"anchor":if(O)z(D,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(D.source.endsWith(":"))z(D.offset+D.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);O=D,M??(M=D.offset),q=!1,N=!1,Y=!0;break;case"tag":{if(T)z(D,"MULTIPLE_TAGS","A node can have at most one tag");T=D,M??(M=D.offset),q=!1,N=!1,Y=!0;break}case _:if(O||T)z(D,"BAD_PROP_ORDER",`Anchors and tags must be after the ${D.source} indicator`);if(R)z(D,"UNEXPECTED_TOKEN",`Unexpected ${D.source} in ${I??"collection"}`);R=D,q=_==="seq-item-ind"||_==="explicit-key-ind",N=!1;break;case"comma":if(I){if(V)z(D,"UNEXPECTED_TOKEN",`Unexpected , in ${I}`);V=D,q=!1,N=!1;break}default:z(D,"UNEXPECTED_TOKEN",`Unexpected ${D.type} token`),q=!1,N=!1}}let Z=$[$.length-1],K=Z?Z.offset+Z.source.length:U;if(Y&&u&&u.type!=="space"&&u.type!=="newline"&&u.type!=="comma"&&(u.type!=="scalar"||u.source!==""))z(u.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(v&&(q&&v.indent<=g||u?.type==="block-map"||u?.type==="block-seq"))z(v,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:V,found:R,spaceBefore:G,comment:X,hasNewline:H,anchor:O,tag:T,newlineAfterProp:L,end:K,start:M??K}}LL.resolveProps=RL});var cU=w((WL)=>{function iz($){if(!$)return null;switch($.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if($.source.includes(`
|
|
89
|
+
`))return!0;if($.end){for(let I of $.end)if(I.type==="newline")return!0}return!1;case"flow-collection":for(let I of $.items){for(let _ of I.start)if(_.type==="newline")return!0;if(I.sep){for(let _ of I.sep)if(_.type==="newline")return!0}if(iz(I.key)||iz(I.value))return!0}return!1;default:return!0}}WL.containsNewline=iz});var lz=w((jL)=>{var bL=cU();function AL($,I,_){if(I?.type==="flow-collection"){let u=I.end[0];if(u.indent===$&&(u.source==="]"||u.source==="}")&&bL.containsNewline(I))_(u,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}jL.flowIndentCheck=AL});var mz=w((wL)=>{var kN=I$();function SL($,I,_){let{uniqueKeys:u}=$.options;if(u===!1)return!1;let U=typeof u==="function"?u:(z,g)=>z===g||kN.isScalar(z)&&kN.isScalar(g)&&z.value===g.value;return I.some((z)=>U(z.key,_))}wL.mapIncludes=SL});var rN=w((yL)=>{var yN=H6(),CL=O6(),iN=o0(),fL=cU(),lN=lz(),xL=mz(),mN="All mapping items must start at the same column";function kL({composeNode:$,composeEmptyNode:I},_,u,U,z){let J=new(z?.nodeClass??CL.YAMLMap)(_.schema);if(_.atRoot)_.atRoot=!1;let G=u.offset,q=null;for(let N of u.items){let{start:X,key:Q,sep:H,value:Y}=N,v=iN.resolveProps(X,{indicator:"explicit-key-ind",next:Q??H?.[0],offset:G,onError:U,parentIndent:u.indent,startOnNewline:!0}),O=!v.found;if(O){if(Q){if(Q.type==="block-seq")U(G,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in Q&&Q.indent!==u.indent)U(G,"BAD_INDENT",mN)}if(!v.anchor&&!v.tag&&!H){if(q=v.end,v.comment)if(J.comment)J.comment+=`
|
|
90
|
+
`+v.comment;else J.comment=v.comment;continue}if(v.newlineAfterProp||fL.containsNewline(Q))U(Q??X[X.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(v.found?.indent!==u.indent)U(G,"BAD_INDENT",mN);_.atKey=!0;let T=v.end,L=Q?$(_,Q,v,U):I(_,T,X,null,v,U);if(_.schema.compat)lN.flowIndentCheck(u.indent,Q,U);if(_.atKey=!1,xL.mapIncludes(_,J.items,L))U(T,"DUPLICATE_KEY","Map keys must be unique");let V=iN.resolveProps(H??[],{indicator:"map-value-ind",next:Y,offset:L.range[2],onError:U,parentIndent:u.indent,startOnNewline:!Q||Q.type==="block-scalar"});if(G=V.end,V.found){if(O){if(Y?.type==="block-map"&&!V.hasNewline)U(G,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(_.options.strict&&v.start<V.found.offset-1024)U(L.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let R=Y?$(_,Y,V,U):I(_,G,H,null,V,U);if(_.schema.compat)lN.flowIndentCheck(u.indent,Y,U);G=R.range[2];let M=new yN.Pair(L,R);if(_.options.keepSourceTokens)M.srcToken=N;J.items.push(M)}else{if(O)U(L.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(V.comment)if(L.comment)L.comment+=`
|
|
91
|
+
`+V.comment;else L.comment=V.comment;let R=new yN.Pair(L);if(_.options.keepSourceTokens)R.srcToken=N;J.items.push(R)}}if(q&&q<G)U(q,"IMPOSSIBLE","Map comment with trailing content");return J.range=[u.offset,G,q??G],J}yL.resolveBlockMap=kL});var nN=w((hL)=>{var lL=T6(),mL=o0(),rL=lz();function nL({composeNode:$,composeEmptyNode:I},_,u,U,z){let J=new(z?.nodeClass??lL.YAMLSeq)(_.schema);if(_.atRoot)_.atRoot=!1;if(_.atKey)_.atKey=!1;let G=u.offset,q=null;for(let{start:N,value:X}of u.items){let Q=mL.resolveProps(N,{indicator:"seq-item-ind",next:X,offset:G,onError:U,parentIndent:u.indent,startOnNewline:!0});if(!Q.found)if(Q.anchor||Q.tag||X)if(X?.type==="block-seq")U(Q.end,"BAD_INDENT","All sequence items must start at the same column");else U(G,"MISSING_CHAR","Sequence item without - indicator");else{if(q=Q.end,Q.comment)J.comment=Q.comment;continue}let H=X?$(_,X,Q,U):I(_,Q.end,N,null,Q,U);if(_.schema.compat)rL.flowIndentCheck(u.indent,X,U);G=H.range[2],J.items.push(H)}return J.range=[u.offset,G,q??G],J}hL.resolveBlockSeq=nL});var w1=w((pL)=>{function cL($,I,_,u){let U="";if($){let z=!1,g="";for(let J of $){let{source:G,type:q}=J;switch(q){case"space":z=!0;break;case"comment":{if(_&&!z)u(J,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let N=G.substring(1)||" ";if(!U)U=N;else U+=g+N;g="";break}case"newline":if(U)g+=G;z=!0;break;default:u(J,"UNEXPECTED_TOKEN",`Unexpected ${q} at node end`)}I+=G.length}}return{comment:U,offset:I}}pL.resolveEnd=cL});var cN=w((_Z)=>{var tL=I$(),aL=H6(),hN=O6(),eL=T6(),sL=w1(),dN=o0(),$Z=cU(),IZ=mz(),rz="Block collections are not allowed within flow collections",nz=($)=>$&&($.type==="block-map"||$.type==="block-seq");function UZ({composeNode:$,composeEmptyNode:I},_,u,U,z){let g=u.start.source==="{",J=g?"flow map":"flow sequence",q=new(z?.nodeClass??(g?hN.YAMLMap:eL.YAMLSeq))(_.schema);q.flow=!0;let N=_.atRoot;if(N)_.atRoot=!1;if(_.atKey)_.atKey=!1;let X=u.offset+u.start.source.length;for(let O=0;O<u.items.length;++O){let T=u.items[O],{start:L,key:V,sep:R,value:M}=T,Z=dN.resolveProps(L,{flow:J,indicator:"explicit-key-ind",next:V??R?.[0],offset:X,onError:U,parentIndent:u.indent,startOnNewline:!1});if(!Z.found){if(!Z.anchor&&!Z.tag&&!R&&!M){if(O===0&&Z.comma)U(Z.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${J}`);else if(O<u.items.length-1)U(Z.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${J}`);if(Z.comment)if(q.comment)q.comment+=`
|
|
92
|
+
`+Z.comment;else q.comment=Z.comment;X=Z.end;continue}if(!g&&_.options.strict&&$Z.containsNewline(V))U(V,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(O===0){if(Z.comma)U(Z.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${J}`)}else{if(!Z.comma)U(Z.start,"MISSING_CHAR",`Missing , between ${J} items`);if(Z.comment){let K="";$:for(let D of L)switch(D.type){case"comma":case"space":break;case"comment":K=D.source.substring(1);break $;default:break $}if(K){let D=q.items[q.items.length-1];if(tL.isPair(D))D=D.value??D.key;if(D.comment)D.comment+=`
|
|
93
|
+
`+K;else D.comment=K;Z.comment=Z.comment.substring(K.length+1)}}}if(!g&&!R&&!Z.found){let K=M?$(_,M,Z,U):I(_,Z.end,R,null,Z,U);if(q.items.push(K),X=K.range[2],nz(M))U(K.range,"BLOCK_IN_FLOW",rz)}else{_.atKey=!0;let K=Z.end,D=V?$(_,V,Z,U):I(_,K,L,null,Z,U);if(nz(V))U(D.range,"BLOCK_IN_FLOW",rz);_.atKey=!1;let S=dN.resolveProps(R??[],{flow:J,indicator:"map-value-ind",next:M,offset:D.range[2],onError:U,parentIndent:u.indent,startOnNewline:!1});if(S.found){if(!g&&!Z.found&&_.options.strict){if(R)for(let P of R){if(P===S.found)break;if(P.type==="newline"){U(P,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(Z.start<S.found.offset-1024)U(S.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(M)if("source"in M&&M.source?.[0]===":")U(M,"MISSING_CHAR",`Missing space after : in ${J}`);else U(S.start,"MISSING_CHAR",`Missing , or : between ${J} items`);let C=M?$(_,M,S,U):S.found?I(_,S.end,R,null,S,U):null;if(C){if(nz(M))U(C.range,"BLOCK_IN_FLOW",rz)}else if(S.comment)if(D.comment)D.comment+=`
|
|
94
|
+
`+S.comment;else D.comment=S.comment;let x=new aL.Pair(D,C);if(_.options.keepSourceTokens)x.srcToken=T;if(g){let P=q;if(IZ.mapIncludes(_,P.items,D))U(K,"DUPLICATE_KEY","Map keys must be unique");P.items.push(x)}else{let P=new hN.YAMLMap(_.schema);P.flow=!0,P.items.push(x);let e=(C??D).range;P.range=[D.range[0],e[1],e[2]],q.items.push(P)}X=C?C.range[2]:S.end}}let Q=g?"}":"]",[H,...Y]=u.end,v=X;if(H?.source===Q)v=H.offset+H.source.length;else{let O=J[0].toUpperCase()+J.substring(1),T=N?`${O} must end with a ${Q}`:`${O} in block collection must be sufficiently indented and end with a ${Q}`;if(U(X,N?"MISSING_CHAR":"BAD_INDENT",T),H&&H.source.length!==1)Y.unshift(H)}if(Y.length>0){let O=sL.resolveEnd(Y,v,_.options.strict,U);if(O.comment)if(q.comment)q.comment+=`
|
|
95
|
+
`+O.comment;else q.comment=O.comment;q.range=[u.offset,v,O.offset]}else q.range=[u.offset,v,v];return q}_Z.resolveFlowCollection=UZ});var pN=w((vZ)=>{var zZ=I$(),gZ=L$(),JZ=O6(),GZ=T6(),qZ=rN(),XZ=nN(),NZ=cN();function hz($,I,_,u,U,z){let g=_.type==="block-map"?qZ.resolveBlockMap($,I,_,u,z):_.type==="block-seq"?XZ.resolveBlockSeq($,I,_,u,z):NZ.resolveFlowCollection($,I,_,u,z),J=g.constructor;if(U==="!"||U===J.tagName)return g.tag=J.tagName,g;if(U)g.tag=U;return g}function QZ($,I,_,u,U){let z=u.tag,g=!z?null:I.directives.tagName(z.source,(Q)=>U(z,"TAG_RESOLVE_FAILED",Q));if(_.type==="block-seq"){let{anchor:Q,newlineAfterProp:H}=u,Y=Q&&z?Q.offset>z.offset?Q:z:Q??z;if(Y&&(!H||H.offset<Y.offset))U(Y,"MISSING_CHAR","Missing newline after block sequence props")}let J=_.type==="block-map"?"map":_.type==="block-seq"?"seq":_.start.source==="{"?"map":"seq";if(!z||!g||g==="!"||g===JZ.YAMLMap.tagName&&J==="map"||g===GZ.YAMLSeq.tagName&&J==="seq")return hz($,I,_,U,g);let G=I.schema.tags.find((Q)=>Q.tag===g&&Q.collection===J);if(!G){let Q=I.schema.knownTags[g];if(Q?.collection===J)I.schema.tags.push(Object.assign({},Q,{default:!1})),G=Q;else{if(Q)U(z,"BAD_COLLECTION_TYPE",`${Q.tag} used for ${J} collection, but expects ${Q.collection??"scalar"}`,!0);else U(z,"TAG_RESOLVE_FAILED",`Unresolved tag: ${g}`,!0);return hz($,I,_,U,g)}}let q=hz($,I,_,U,g,G),N=G.resolve?.(q,(Q)=>U(z,"TAG_RESOLVE_FAILED",Q),I.options)??q,X=zZ.isNode(N)?N:new gZ.Scalar(N);if(X.range=q.range,X.tag=g,G?.format)X.format=G.format;return X}vZ.composeCollection=QZ});var cz=w((BZ)=>{var dz=L$();function YZ($,I,_){let u=I.offset,U=OZ(I,$.options.strict,_);if(!U)return{value:"",type:null,comment:"",range:[u,u,u]};let z=U.mode===">"?dz.Scalar.BLOCK_FOLDED:dz.Scalar.BLOCK_LITERAL,g=I.source?TZ(I.source):[],J=g.length;for(let v=g.length-1;v>=0;--v){let O=g[v][1];if(O===""||O==="\r")J=v;else break}if(J===0){let v=U.chomp==="+"&&g.length>0?`
|
|
96
|
+
`.repeat(Math.max(1,g.length-1)):"",O=u+U.length;if(I.source)O+=I.source.length;return{value:v,type:z,comment:U.comment,range:[u,O,O]}}let G=I.indent+U.indent,q=I.offset+U.length,N=0;for(let v=0;v<J;++v){let[O,T]=g[v];if(T===""||T==="\r"){if(U.indent===0&&O.length>G)G=O.length}else{if(O.length<G)_(q+O.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(U.indent===0)G=O.length;if(N=v,G===0&&!$.atRoot)_(q,"BAD_INDENT","Block scalar values in collections must be indented");break}q+=O.length+T.length+1}for(let v=g.length-1;v>=J;--v)if(g[v][0].length>G)J=v+1;let X="",Q="",H=!1;for(let v=0;v<N;++v)X+=g[v][0].slice(G)+`
|
|
97
|
+
`;for(let v=N;v<J;++v){let[O,T]=g[v];q+=O.length+T.length+1;let L=T[T.length-1]==="\r";if(L)T=T.slice(0,-1);if(T&&O.length<G){let R=`Block scalar lines must not be less indented than their ${U.indent?"explicit indentation indicator":"first line"}`;_(q-T.length-(L?2:1),"BAD_INDENT",R),O=""}if(z===dz.Scalar.BLOCK_LITERAL)X+=Q+O.slice(G)+T,Q=`
|
|
98
|
+
`;else if(O.length>G||T[0]==="\t"){if(Q===" ")Q=`
|
|
99
|
+
`;else if(!H&&Q===`
|
|
100
|
+
`)Q=`
|
|
101
101
|
|
|
102
|
-
`;
|
|
103
|
-
`,
|
|
104
|
-
`)
|
|
105
|
-
`;else
|
|
106
|
-
`;else
|
|
107
|
-
`+g[
|
|
108
|
-
`)
|
|
109
|
-
`;break;default:
|
|
110
|
-
`}let
|
|
102
|
+
`;X+=Q+O.slice(G)+T,Q=`
|
|
103
|
+
`,H=!0}else if(T==="")if(Q===`
|
|
104
|
+
`)X+=`
|
|
105
|
+
`;else Q=`
|
|
106
|
+
`;else X+=Q+T,Q=" ",H=!1}switch(U.chomp){case"-":break;case"+":for(let v=J;v<g.length;++v)X+=`
|
|
107
|
+
`+g[v][0].slice(G);if(X[X.length-1]!==`
|
|
108
|
+
`)X+=`
|
|
109
|
+
`;break;default:X+=`
|
|
110
|
+
`}let Y=u+U.length+I.source.length;return{value:X,type:z,comment:U.comment,range:[u,Y,Y]}}function OZ({offset:$,props:I},_,u){if(I[0].type!=="block-scalar-header")return u(I[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:U}=I[0],z=U[0],g=0,J="",G=-1;for(let Q=1;Q<U.length;++Q){let H=U[Q];if(!J&&(H==="-"||H==="+"))J=H;else{let Y=Number(H);if(!g&&Y)g=Y;else if(G===-1)G=$+Q}}if(G!==-1)u(G,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${U}`);let q=!1,N="",X=U.length;for(let Q=1;Q<I.length;++Q){let H=I[Q];switch(H.type){case"space":q=!0;case"newline":X+=H.source.length;break;case"comment":if(_&&!q)u(H,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");X+=H.source.length,N=H.source.substring(1);break;case"error":u(H,"UNEXPECTED_TOKEN",H.message),X+=H.source.length;break;default:{let Y=`Unexpected token in block scalar header: ${H.type}`;u(H,"UNEXPECTED_TOKEN",Y);let v=H.source;if(v&&typeof v==="string")X+=v.length}}}return{mode:z,indent:g,chomp:J,comment:N,length:X}}function TZ($){let I=$.split(/\n( *)/),_=I[0],u=_.match(/^( *)/),z=[u?.[1]?[u[1],_.slice(u[1].length)]:["",_]];for(let g=1;g<I.length;g+=2)z.push([I[g],I[g+1]]);return z}BZ.resolveBlockScalar=YZ});var oz=w((bZ)=>{var pz=L$(),MZ=w1();function KZ($,I,_){let{offset:u,type:U,source:z,end:g}=$,J,G,q=(Q,H,Y)=>_(u+Q,H,Y);switch(U){case"scalar":J=pz.Scalar.PLAIN,G=VZ(z,q);break;case"single-quoted-scalar":J=pz.Scalar.QUOTE_SINGLE,G=RZ(z,q);break;case"double-quoted-scalar":J=pz.Scalar.QUOTE_DOUBLE,G=LZ(z,q);break;default:return _($,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${U}`),{value:"",type:null,comment:"",range:[u,u+z.length,u+z.length]}}let N=u+z.length,X=MZ.resolveEnd(g,N,I,_);return{value:G,type:J,comment:X.comment,range:[u,N,X.offset]}}function VZ($,I){let _="";switch($[0]){case"\t":_="a tab character";break;case",":_="flow indicator character ,";break;case"%":_="directive indicator character %";break;case"|":case">":{_=`block scalar indicator ${$[0]}`;break}case"@":case"`":{_=`reserved character ${$[0]}`;break}}if(_)I(0,"BAD_SCALAR_START",`Plain value cannot start with ${_}`);return oN($)}function RZ($,I){if($[$.length-1]!=="'"||$.length===1)I($.length,"MISSING_CHAR","Missing closing 'quote");return oN($.slice(1,-1)).replace(/''/g,"'")}function oN($){let I,_;try{I=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
111
111
|
`,"sy"),_=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
112
112
|
`,"sy")}catch{I=/(.*?)[ \t]*\r?\n/sy,_=/[ \t]*(.*?)[ \t]*\r?\n/sy}let u=I.exec($);if(!u)return $;let U=u[1],z=" ",g=I.lastIndex;_.lastIndex=g;while(u=_.exec($)){if(u[1]==="")if(z===`
|
|
113
113
|
`)U+=z;else z=`
|
|
114
114
|
`;else U+=z+u[1],z=" ";g=_.lastIndex}let J=/[ \t]*(.*)/sy;return J.lastIndex=g,u=J.exec($),U+z+(u?.[1]??"")}function LZ($,I){let _="";for(let u=1;u<$.length-1;++u){let U=$[u];if(U==="\r"&&$[u+1]===`
|
|
115
115
|
`)continue;if(U===`
|
|
116
|
-
`){let{fold:z,offset:g}=
|
|
116
|
+
`){let{fold:z,offset:g}=ZZ($,u);_+=z,u=g}else if(U==="\\"){let z=$[++u],g=WZ[z];if(g)_+=g;else if(z===`
|
|
117
117
|
`){z=$[u+1];while(z===" "||z==="\t")z=$[++u+1]}else if(z==="\r"&&$[u+1]===`
|
|
118
|
-
`){z=$[++u+1];while(z===" "||z==="\t")z=$[++u+1]}else if(z==="x"||z==="u"||z==="U"){let J={x:2,u:4,U:8}[z];_+=
|
|
118
|
+
`){z=$[++u+1];while(z===" "||z==="\t")z=$[++u+1]}else if(z==="x"||z==="u"||z==="U"){let J={x:2,u:4,U:8}[z];_+=PZ($,u+1,J,I),u+=J}else{let J=$.substr(u-1,2);I(u-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${J}`),_+=J}}else if(U===" "||U==="\t"){let z=u,g=$[u+1];while(g===" "||g==="\t")g=$[++u+1];if(g!==`
|
|
119
119
|
`&&!(g==="\r"&&$[u+2]===`
|
|
120
|
-
`))_+=u>z?$.slice(z,u+1):U}else _+=U}if($[$.length-1]!=='"'||$.length===1)I($.length,"MISSING_CHAR",'Missing closing "quote');return _}function
|
|
120
|
+
`))_+=u>z?$.slice(z,u+1):U}else _+=U}if($[$.length-1]!=='"'||$.length===1)I($.length,"MISSING_CHAR",'Missing closing "quote');return _}function ZZ($,I){let _="",u=$[I+1];while(u===" "||u==="\t"||u===`
|
|
121
121
|
`||u==="\r"){if(u==="\r"&&$[I+2]!==`
|
|
122
122
|
`)break;if(u===`
|
|
123
123
|
`)_+=`
|
|
124
|
-
`;I+=1,u=$[I+1]}if(!_)_=" ";return{fold:_,offset:I}}var
|
|
125
|
-
`,r:"\r",t:"\t",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function
|
|
124
|
+
`;I+=1,u=$[I+1]}if(!_)_=" ";return{fold:_,offset:I}}var WZ={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
125
|
+
`,r:"\r",t:"\t",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function PZ($,I,_,u){let U=$.substr(I,_),g=U.length===_&&/^[0-9a-fA-F]+$/.test(U)?parseInt(U,16):NaN;if(isNaN(g)){let J=$.substr(I-2,_+2);return u(I-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${J}`),J}return String.fromCodePoint(g)}bZ.resolveFlowScalar=KZ});var aN=w((CZ)=>{var c6=I$(),tN=L$(),jZ=cz(),FZ=oz();function SZ($,I,_,u){let{value:U,type:z,comment:g,range:J}=I.type==="block-scalar"?jZ.resolveBlockScalar($,I,u):FZ.resolveFlowScalar(I,$.options.strict,u),G=_?$.directives.tagName(_.source,(X)=>u(_,"TAG_RESOLVE_FAILED",X)):null,q;if($.options.stringKeys&&$.atKey)q=$.schema[c6.SCALAR];else if(G)q=wZ($.schema,U,G,_,u);else if(I.type==="scalar")q=EZ($,U,I,u);else q=$.schema[c6.SCALAR];let N;try{let X=q.resolve(U,(Q)=>u(_??I,"TAG_RESOLVE_FAILED",Q),$.options);N=c6.isScalar(X)?X:new tN.Scalar(X)}catch(X){let Q=X instanceof Error?X.message:String(X);u(_??I,"TAG_RESOLVE_FAILED",Q),N=new tN.Scalar(U)}if(N.range=J,N.source=U,z)N.type=z;if(G)N.tag=G;if(q.format)N.format=q.format;if(g)N.comment=g;return N}function wZ($,I,_,u,U){if(_==="!")return $[c6.SCALAR];let z=[];for(let J of $.tags)if(!J.collection&&J.tag===_)if(J.default&&J.test)z.push(J);else return J;for(let J of z)if(J.test?.test(I))return J;let g=$.knownTags[_];if(g&&!g.collection)return $.tags.push(Object.assign({},g,{default:!1,test:void 0})),g;return U(u,"TAG_RESOLVE_FAILED",`Unresolved tag: ${_}`,_!=="tag:yaml.org,2002:str"),$[c6.SCALAR]}function EZ({atKey:$,directives:I,schema:_},u,U,z){let g=_.tags.find((J)=>(J.default===!0||$&&J.default==="key")&&J.test?.test(u))||_[c6.SCALAR];if(_.compat){let J=_.compat.find((G)=>G.default&&G.test?.test(u))??_[c6.SCALAR];if(g.tag!==J.tag){let G=I.tagString(g.tag),q=I.tagString(J.tag),N=`Value may be parsed as either ${G} or ${q}`;z(U,"TAG_RESOLVE_FAILED",N,!0)}}return g}CZ.composeScalar=SZ});var eN=w((kZ)=>{function xZ($,I,_){if(I){_??(_=I.length);for(let u=_-1;u>=0;--u){let U=I[u];switch(U.type){case"space":case"comment":case"newline":$-=U.source.length;continue}U=I[++u];while(U?.type==="space")$+=U.source.length,U=I[++u];break}}return $}kZ.emptyScalarPosition=xZ});var IQ=w((cZ)=>{var iZ=S0(),lZ=I$(),mZ=pN(),sN=aN(),rZ=w1(),nZ=eN(),hZ={composeNode:$Q,composeEmptyNode:tz};function $Q($,I,_,u){let U=$.atKey,{spaceBefore:z,comment:g,anchor:J,tag:G}=_,q,N=!0;switch(I.type){case"alias":if(q=dZ($,I,u),J||G)u(I,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(q=sN.composeScalar($,I,G,u),J)q.anchor=J.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(q=mZ.composeCollection(hZ,$,I,_,u),J)q.anchor=J.source.substring(1);break;default:{let X=I.type==="error"?I.message:`Unsupported token (type: ${I.type})`;u(I,"UNEXPECTED_TOKEN",X),q=tz($,I.offset,void 0,null,_,u),N=!1}}if(J&&q.anchor==="")u(J,"BAD_ALIAS","Anchor cannot be an empty string");if(U&&$.options.stringKeys&&(!lZ.isScalar(q)||typeof q.value!=="string"||q.tag&&q.tag!=="tag:yaml.org,2002:str"))u(G??I,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(z)q.spaceBefore=!0;if(g)if(I.type==="scalar"&&I.source==="")q.comment=g;else q.commentBefore=g;if($.options.keepSourceTokens&&N)q.srcToken=I;return q}function tz($,I,_,u,{spaceBefore:U,comment:z,anchor:g,tag:J,end:G},q){let N={type:"scalar",offset:nZ.emptyScalarPosition(I,_,u),indent:-1,source:""},X=sN.composeScalar($,N,J,q);if(g){if(X.anchor=g.source.substring(1),X.anchor==="")q(g,"BAD_ALIAS","Anchor cannot be an empty string")}if(U)X.spaceBefore=!0;if(z)X.comment=z,X.range[2]=G;return X}function dZ({options:$},{offset:I,source:_,end:u},U){let z=new iZ.Alias(_.substring(1));if(z.source==="")U(I,"BAD_ALIAS","Alias cannot be an empty string");if(z.source.endsWith(":"))U(I+_.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let g=I+_.length,J=rZ.resolveEnd(u,g,$.strict,U);if(z.range=[I,g,J.offset],J.comment)z.comment=J.comment;return z}cZ.composeEmptyNode=tz;cZ.composeNode=$Q});var _Q=w(($W)=>{var tZ=c0(),UQ=IQ(),aZ=w1(),eZ=o0();function sZ($,I,{offset:_,start:u,value:U,end:z},g){let J=Object.assign({_directives:I},$),G=new tZ.Document(void 0,J),q={atKey:!1,atRoot:!0,directives:G.directives,options:G.options,schema:G.schema},N=eZ.resolveProps(u,{indicator:"doc-start",next:U??z?.[0],offset:_,onError:g,parentIndent:0,startOnNewline:!0});if(N.found){if(G.directives.docStart=!0,U&&(U.type==="block-map"||U.type==="block-seq")&&!N.hasNewline)g(N.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}G.contents=U?UQ.composeNode(q,U,N,g):UQ.composeEmptyNode(q,N.end,u,null,N,g);let X=G.contents.range[2],Q=aZ.resolveEnd(z,X,!1,g);if(Q.comment)G.comment=Q.comment;return G.range=[_,X,Q.offset],G}$W.composeDoc=sZ});var az=w((JW)=>{var UW=z$("process"),_W=Iz(),uW=c0(),t0=p0(),uQ=I$(),zW=_Q(),gW=w1();function a0($){if(typeof $==="number")return[$,$+1];if(Array.isArray($))return $.length===2?$:[$[0],$[1]];let{offset:I,source:_}=$;return[I,I+(typeof _==="string"?_.length:1)]}function zQ($){let I="",_=!1,u=!1;for(let U=0;U<$.length;++U){let z=$[U];switch(z[0]){case"#":I+=(I===""?"":u?`
|
|
126
126
|
|
|
127
127
|
`:`
|
|
128
|
-
`)+(z.substring(1)||" "),_=!0,u=!1;break;case"%":if($[U+1]?.[0]!=="#")U+=1;_=!1;break;default:if(!_)u=!0;_=!1}}return{comment:I,afterEmptyLine:u}}class
|
|
129
|
-
${_}`:_;else if(u||$.directives.docStart||!U)$.commentBefore=_;else if(
|
|
128
|
+
`)+(z.substring(1)||" "),_=!0,u=!1;break;case"%":if($[U+1]?.[0]!=="#")U+=1;_=!1;break;default:if(!_)u=!0;_=!1}}return{comment:I,afterEmptyLine:u}}class gQ{constructor($={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(I,_,u,U)=>{let z=a0(I);if(U)this.warnings.push(new t0.YAMLWarning(z,_,u));else this.errors.push(new t0.YAMLParseError(z,_,u))},this.directives=new _W.Directives({version:$.version||"1.2"}),this.options=$}decorate($,I){let{comment:_,afterEmptyLine:u}=zQ(this.prelude);if(_){let U=$.contents;if(I)$.comment=$.comment?`${$.comment}
|
|
129
|
+
${_}`:_;else if(u||$.directives.docStart||!U)$.commentBefore=_;else if(uQ.isCollection(U)&&!U.flow&&U.items.length>0){let z=U.items[0];if(uQ.isPair(z))z=z.key;let g=z.commentBefore;z.commentBefore=g?`${_}
|
|
130
130
|
${g}`:_}else{let z=U.commentBefore;U.commentBefore=z?`${_}
|
|
131
|
-
${z}`:_}}if(I)Array.prototype.push.apply($.errors,this.errors),Array.prototype.push.apply($.warnings,this.warnings);else $.errors=this.errors,$.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:
|
|
132
|
-
${I.comment}`:I.comment}this.doc.range[2]=I.offset;break}default:this.errors.push(new
|
|
133
|
-
`}];switch(J[0]){case"|":case">":{let
|
|
134
|
-
`),
|
|
135
|
-
`,
|
|
136
|
-
`});return{type:"block-scalar",offset:z,indent:u,props:
|
|
131
|
+
${z}`:_}}if(I)Array.prototype.push.apply($.errors,this.errors),Array.prototype.push.apply($.warnings,this.warnings);else $.errors=this.errors,$.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:zQ(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose($,I=!1,_=-1){for(let u of $)yield*this.next(u);yield*this.end(I,_)}*next($){if(UW.env.LOG_STREAM)console.dir($,{depth:null});switch($.type){case"directive":this.directives.add($.source,(I,_,u)=>{let U=a0($);U[0]+=I,this.onError(U,"BAD_DIRECTIVE",_,u)}),this.prelude.push($.source),this.atDirectives=!0;break;case"document":{let I=zW.composeDoc(this.options,this.directives,$,this.onError);if(this.atDirectives&&!I.directives.docStart)this.onError($,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate(I,!1),this.doc)yield this.doc;this.doc=I,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push($.source);break;case"error":{let I=$.source?`${$.message}: ${JSON.stringify($.source)}`:$.message,_=new t0.YAMLParseError(a0($),"UNEXPECTED_TOKEN",I);if(this.atDirectives||!this.doc)this.errors.push(_);else this.doc.errors.push(_);break}case"doc-end":{if(!this.doc){this.errors.push(new t0.YAMLParseError(a0($),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let I=gW.resolveEnd($.end,$.offset+$.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),I.comment){let _=this.doc.comment;this.doc.comment=_?`${_}
|
|
132
|
+
${I.comment}`:I.comment}this.doc.range[2]=I.offset;break}default:this.errors.push(new t0.YAMLParseError(a0($),"UNEXPECTED_TOKEN",`Unsupported token ${$.type}`))}}*end($=!1,I=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if($){let _=Object.assign({_directives:this.directives},this.options),u=new uW.Document(void 0,_);if(this.atDirectives)this.onError(I,"MISSING_CHAR","Missing directives-end indicator line");u.range=[0,I,I],this.decorate(u,!1),yield u}}}JW.Composer=gQ});var qQ=w((OW)=>{var qW=cz(),XW=oz(),NW=p0(),JQ=f0();function QW($,I=!0,_){if($){let u=(U,z,g)=>{let J=typeof U==="number"?U:Array.isArray(U)?U[0]:U.offset;if(_)_(J,z,g);else throw new NW.YAMLParseError([J,J+1],z,g)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return XW.resolveFlowScalar($,I,u);case"block-scalar":return qW.resolveBlockScalar({options:{strict:I}},$,u)}}return null}function vW($,I){let{implicitKey:_=!1,indent:u,inFlow:U=!1,offset:z=-1,type:g="PLAIN"}=I,J=JQ.stringifyString({type:g,value:$},{implicitKey:_,indent:u>0?" ".repeat(u):"",inFlow:U,options:{blockQuote:!0,lineWidth:-1}}),G=I.end??[{type:"newline",offset:-1,indent:u,source:`
|
|
133
|
+
`}];switch(J[0]){case"|":case">":{let q=J.indexOf(`
|
|
134
|
+
`),N=J.substring(0,q),X=J.substring(q+1)+`
|
|
135
|
+
`,Q=[{type:"block-scalar-header",offset:z,indent:u,source:N}];if(!GQ(Q,G))Q.push({type:"newline",offset:-1,indent:u,source:`
|
|
136
|
+
`});return{type:"block-scalar",offset:z,indent:u,props:Q,source:X}}case'"':return{type:"double-quoted-scalar",offset:z,indent:u,source:J,end:G};case"'":return{type:"single-quoted-scalar",offset:z,indent:u,source:J,end:G};default:return{type:"scalar",offset:z,indent:u,source:J,end:G}}}function HW($,I,_={}){let{afterKey:u=!1,implicitKey:U=!1,inFlow:z=!1,type:g}=_,J="indent"in $?$.indent:null;if(u&&typeof J==="number")J+=2;if(!g)switch($.type){case"single-quoted-scalar":g="QUOTE_SINGLE";break;case"double-quoted-scalar":g="QUOTE_DOUBLE";break;case"block-scalar":{let q=$.props[0];if(q.type!=="block-scalar-header")throw Error("Invalid block scalar header");g=q.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:g="PLAIN"}let G=JQ.stringifyString({type:g,value:I},{implicitKey:U||J===null,indent:J!==null&&J>0?" ".repeat(J):"",inFlow:z,options:{blockQuote:!0,lineWidth:-1}});switch(G[0]){case"|":case">":YW($,G);break;case'"':ez($,G,"double-quoted-scalar");break;case"'":ez($,G,"single-quoted-scalar");break;default:ez($,G,"scalar")}}function YW($,I){let _=I.indexOf(`
|
|
137
137
|
`),u=I.substring(0,_),U=I.substring(_+1)+`
|
|
138
|
-
`;if($.type==="block-scalar"){let z=$.props[0];if(z.type!=="block-scalar-header")throw Error("Invalid block scalar header");z.source=u,$.source=U}else{let{offset:z}=$,g="indent"in $?$.indent:-1,J=[{type:"block-scalar-header",offset:z,indent:g,source:u}];if(!
|
|
139
|
-
`});for(let G of Object.keys($))if(G!=="type"&&G!=="offset")delete $[G];Object.assign($,{type:"block-scalar",indent:g,props:J,source:U})}}function
|
|
140
|
-
`};delete $.items,Object.assign($,{type:_,source:I,end:[U]});break}default:{let u="indent"in $?$.indent:-1,U="end"in $&&Array.isArray($.end)?$.end.filter((z)=>z.type==="space"||z.type==="comment"||z.type==="newline"):[];for(let z of Object.keys($))if(z!=="type"&&z!=="offset")delete $[z];Object.assign($,{type:_,indent:u,source:I,end:U})}}}
|
|
138
|
+
`;if($.type==="block-scalar"){let z=$.props[0];if(z.type!=="block-scalar-header")throw Error("Invalid block scalar header");z.source=u,$.source=U}else{let{offset:z}=$,g="indent"in $?$.indent:-1,J=[{type:"block-scalar-header",offset:z,indent:g,source:u}];if(!GQ(J,"end"in $?$.end:void 0))J.push({type:"newline",offset:-1,indent:g,source:`
|
|
139
|
+
`});for(let G of Object.keys($))if(G!=="type"&&G!=="offset")delete $[G];Object.assign($,{type:"block-scalar",indent:g,props:J,source:U})}}function GQ($,I){if(I)for(let _ of I)switch(_.type){case"space":case"comment":$.push(_);break;case"newline":return $.push(_),!0}return!1}function ez($,I,_){switch($.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":$.type=_,$.source=I;break;case"block-scalar":{let u=$.props.slice(1),U=I.length;if($.props[0].type==="block-scalar-header")U-=$.props[0].source.length;for(let z of u)z.offset+=U;delete $.props,Object.assign($,{type:_,source:I,end:u});break}case"block-map":case"block-seq":{let U={type:"newline",offset:$.offset+I.length,indent:$.indent,source:`
|
|
140
|
+
`};delete $.items,Object.assign($,{type:_,source:I,end:[U]});break}default:{let u="indent"in $?$.indent:-1,U="end"in $&&Array.isArray($.end)?$.end.filter((z)=>z.type==="space"||z.type==="comment"||z.type==="newline"):[];for(let z of Object.keys($))if(z!=="type"&&z!=="offset")delete $[z];Object.assign($,{type:_,indent:u,source:I,end:U})}}}OW.createScalarToken=vW;OW.resolveAsScalar=QW;OW.setScalarValue=HW});var XQ=w((KW)=>{var MW=($)=>("type"in $)?oU($):pU($);function oU($){switch($.type){case"block-scalar":{let I="";for(let _ of $.props)I+=oU(_);return I+$.source}case"block-map":case"block-seq":{let I="";for(let _ of $.items)I+=pU(_);return I}case"flow-collection":{let I=$.start.source;for(let _ of $.items)I+=pU(_);for(let _ of $.end)I+=_.source;return I}case"document":{let I=pU($);if($.end)for(let _ of $.end)I+=_.source;return I}default:{let I=$.source;if("end"in $&&$.end)for(let _ of $.end)I+=_.source;return I}}}function pU({start:$,key:I,sep:_,value:u}){let U="";for(let z of $)U+=z.source;if(I)U+=oU(I);if(_)for(let z of _)U+=z.source;if(u)U+=oU(u);return U}KW.stringify=MW});var vQ=w((LW)=>{var sz=Symbol("break visit"),RW=Symbol("skip children"),NQ=Symbol("remove item");function p6($,I){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};QQ(Object.freeze([]),$,I)}p6.BREAK=sz;p6.SKIP=RW;p6.REMOVE=NQ;p6.itemAtPath=($,I)=>{let _=$;for(let[u,U]of I){let z=_?.[u];if(z&&"items"in z)_=z.items[U];else return}return _};p6.parentCollection=($,I)=>{let _=p6.itemAtPath($,I.slice(0,-1)),u=I[I.length-1][0],U=_?.[u];if(U&&"items"in U)return U;throw Error("Parent collection not found")};function QQ($,I,_){let u=_(I,$);if(typeof u==="symbol")return u;for(let U of["key","value"]){let z=I[U];if(z&&"items"in z){for(let g=0;g<z.items.length;++g){let J=QQ(Object.freeze($.concat([[U,g]])),z.items[g],_);if(typeof J==="number")g=J-1;else if(J===sz)return sz;else if(J===NQ)z.items.splice(g,1),g-=1}if(typeof u==="function"&&U==="key")u=u(I,$)}}return typeof u==="function"?u(I,$):u}LW.visit=p6});var tU=w((SW)=>{var $g=qQ(),WW=XQ(),PW=vQ(),Ig="\uFEFF",Ug="\x02",_g="\x18",ug="\x1F",bW=($)=>!!$&&("items"in $),AW=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function jW($){switch($){case Ig:return"<BOM>";case Ug:return"<DOC>";case _g:return"<FLOW_END>";case ug:return"<SCALAR>";default:return JSON.stringify($)}}function FW($){switch($){case Ig:return"byte-order-mark";case Ug:return"doc-mode";case _g:return"flow-error-end";case ug:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
141
141
|
`:case`\r
|
|
142
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch($[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}
|
|
143
|
-
`:case"\r":case"\t":return!0;default:return!1}}var
|
|
144
|
-
\r `),
|
|
142
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch($[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}SW.createScalarToken=$g.createScalarToken;SW.resolveAsScalar=$g.resolveAsScalar;SW.setScalarValue=$g.setScalarValue;SW.stringify=WW.stringify;SW.visit=PW.visit;SW.BOM=Ig;SW.DOCUMENT=Ug;SW.FLOW_END=_g;SW.SCALAR=ug;SW.isCollection=bW;SW.isScalar=AW;SW.prettyToken=jW;SW.tokenType=FW});var gg=w((pW)=>{var e0=tU();function M4($){switch($){case void 0:case" ":case`
|
|
143
|
+
`:case"\r":case"\t":return!0;default:return!1}}var HQ=new Set("0123456789ABCDEFabcdef"),dW=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),aU=new Set(",[]{}"),cW=new Set(` ,[]{}
|
|
144
|
+
\r `),zg=($)=>!$||cW.has($);class YQ{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex($,I=!1){if($){if(typeof $!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+$:$,this.lineEndPos=null}this.atEnd=!I;let _=this.next??"stream";while(_&&(I||this.hasChars(1)))_=yield*this.parseNext(_)}atLineEnd(){let $=this.pos,I=this.buffer[$];while(I===" "||I==="\t")I=this.buffer[++$];if(!I||I==="#"||I===`
|
|
145
145
|
`)return!0;if(I==="\r")return this.buffer[$+1]===`
|
|
146
146
|
`;return!1}charAt($){return this.buffer[this.pos+$]}continueScalar($){let I=this.buffer[$];if(this.indentNext>0){let _=0;while(I===" ")I=this.buffer[++_+$];if(I==="\r"){let u=this.buffer[_+$+1];if(u===`
|
|
147
147
|
`||!u&&!this.atEnd)return $+_+1}return I===`
|
|
148
148
|
`||_>=this.indentNext||!I&&!this.atEnd?$+_:-1}if(I==="-"||I==="."){let _=this.buffer.substr($,3);if((_==="---"||_==="...")&&M4(this.buffer[$+3]))return-1}return $}getLine(){let $=this.lineEndPos;if(typeof $!=="number"||$!==-1&&$<this.pos)$=this.buffer.indexOf(`
|
|
149
|
-
`,this.pos),this.lineEndPos=$;if($===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[$-1]==="\r")$-=1;return this.buffer.substring(this.pos,$)}hasChars($){return this.pos+$<=this.buffer.length}setNext($){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=$,null}peek($){return this.buffer.substr(this.pos,$)}*parseNext($){switch($){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let $=this.getLine();if($===null)return this.setNext("stream");if($[0]===
|
|
149
|
+
`,this.pos),this.lineEndPos=$;if($===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[$-1]==="\r")$-=1;return this.buffer.substring(this.pos,$)}hasChars($){return this.pos+$<=this.buffer.length}setNext($){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=$,null}peek($){return this.buffer.substr(this.pos,$)}*parseNext($){switch($){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let $=this.getLine();if($===null)return this.setNext("stream");if($[0]===e0.BOM)yield*this.pushCount(1),$=$.substring(1);if($[0]==="%"){let I=$.length,_=$.indexOf("#");while(_!==-1){let U=$[_-1];if(U===" "||U==="\t"){I=_-1;break}else _=$.indexOf("#",_+1)}while(!0){let U=$[I-1];if(U===" "||U==="\t")I-=1;else break}let u=(yield*this.pushCount(I))+(yield*this.pushSpaces(!0));return yield*this.pushCount($.length-u),this.pushNewline(),"stream"}if(this.atLineEnd()){let I=yield*this.pushSpaces(!0);return yield*this.pushCount($.length-I),yield*this.pushNewline(),"stream"}return yield e0.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let $=this.charAt(0);if(!$&&!this.atEnd)return this.setNext("line-start");if($==="-"||$==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let I=this.peek(3);if((I==="---"||I==="...")&&M4(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,I==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!M4(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[$,I]=this.peek(2);if(!I&&!this.atEnd)return this.setNext("block-start");if(($==="-"||$==="?"||$===":")&&M4(I)){let _=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=_,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let $=this.getLine();if($===null)return this.setNext("doc");let I=yield*this.pushIndicators();switch($[I]){case"#":yield*this.pushCount($.length-I);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(zg),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return I+=yield*this.parseBlockScalarHeader(),I+=yield*this.pushSpaces(!0),yield*this.pushCount($.length-I),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let $,I,_=-1;do{if($=yield*this.pushNewline(),$>0)I=yield*this.pushSpaces(!1),this.indentValue=_=I;else I=0;I+=yield*this.pushSpaces(!0)}while($+I>0);let u=this.getLine();if(u===null)return this.setNext("flow");if(_!==-1&&_<this.indentNext&&u[0]!=="#"||_===0&&(u.startsWith("---")||u.startsWith("..."))&&M4(u[3])){if(!(_===this.indentNext-1&&this.flowLevel===1&&(u[0]==="]"||u[0]==="}")))return this.flowLevel=0,yield e0.FLOW_END,yield*this.parseLineStart()}let U=0;while(u[U]===",")U+=yield*this.pushCount(1),U+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(U+=yield*this.pushIndicators(),u[U]){case void 0:return"flow";case"#":return yield*this.pushCount(u.length-U),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(zg),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let z=this.charAt(1);if(this.flowKey||M4(z)||z===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let $=this.charAt(0),I=this.buffer.indexOf($,this.pos+1);if($==="'")while(I!==-1&&this.buffer[I+1]==="'")I=this.buffer.indexOf("'",I+2);else while(I!==-1){let U=0;while(this.buffer[I-1-U]==="\\")U+=1;if(U%2===0)break;I=this.buffer.indexOf('"',I+1)}let _=this.buffer.substring(0,I),u=_.indexOf(`
|
|
150
150
|
`,this.pos);if(u!==-1){while(u!==-1){let U=this.continueScalar(u+1);if(U===-1)break;u=_.indexOf(`
|
|
151
151
|
`,U)}if(u!==-1)I=u-(_[u-1]==="\r"?2:1)}if(I===-1){if(!this.atEnd)return this.setNext("quoted-scalar");I=this.buffer.length}return yield*this.pushToIndex(I+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let $=this.pos;while(!0){let I=this.buffer[++$];if(I==="+")this.blockScalarKeep=!0;else if(I>"0"&&I<="9")this.blockScalarIndent=Number(I)-1;else if(I!=="-")break}return yield*this.pushUntil((I)=>M4(I)||I==="#")}*parseBlockScalar(){let $=this.pos-1,I=0,_;$:for(let U=this.pos;_=this.buffer[U];++U)switch(_){case" ":I+=1;break;case`
|
|
152
152
|
`:$=U,I=0;break;case"\r":{let z=this.buffer[U+1];if(!z&&!this.atEnd)return this.setNext("block-scalar");if(z===`
|
|
153
153
|
`)break}default:break $}if(!_&&!this.atEnd)return this.setNext("block-scalar");if(I>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=I;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let U=this.continueScalar($+1);if(U===-1)break;$=this.buffer.indexOf(`
|
|
154
154
|
`,U)}while($!==-1);if($===-1){if(!this.atEnd)return this.setNext("block-scalar");$=this.buffer.length}}let u=$+1;_=this.buffer[u];while(_===" ")_=this.buffer[++u];if(_==="\t"){while(_==="\t"||_===" "||_==="\r"||_===`
|
|
155
155
|
`)_=this.buffer[++u];$=u-1}else if(!this.blockScalarKeep)do{let U=$-1,z=this.buffer[U];if(z==="\r")z=this.buffer[--U];let g=U;while(z===" ")z=this.buffer[--U];if(z===`
|
|
156
|
-
`&&U>=this.pos&&U+1+I>g)$=U;else break}while(!0);return yield
|
|
156
|
+
`&&U>=this.pos&&U+1+I>g)$=U;else break}while(!0);return yield e0.SCALAR,yield*this.pushToIndex($+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let $=this.flowLevel>0,I=this.pos-1,_=this.pos-1,u;while(u=this.buffer[++_])if(u===":"){let U=this.buffer[_+1];if(M4(U)||$&&aU.has(U))break;I=_}else if(M4(u)){let U=this.buffer[_+1];if(u==="\r")if(U===`
|
|
157
157
|
`)_+=1,u=`
|
|
158
158
|
`,U=this.buffer[_+1];else I=_;if(U==="#"||$&&aU.has(U))break;if(u===`
|
|
159
|
-
`){let z=this.continueScalar(_+1);if(z===-1)break;_=Math.max(_,z-2)}}else{if($&&aU.has(u))break;I=_}if(!u&&!this.atEnd)return this.setNext("plain-scalar");return yield
|
|
159
|
+
`){let z=this.continueScalar(_+1);if(z===-1)break;_=Math.max(_,z-2)}}else{if($&&aU.has(u))break;I=_}if(!u&&!this.atEnd)return this.setNext("plain-scalar");return yield e0.SCALAR,yield*this.pushToIndex(I+1,!0),$?"flow":"doc"}*pushCount($){if($>0)return yield this.buffer.substr(this.pos,$),this.pos+=$,$;return 0}*pushToIndex($,I){let _=this.buffer.slice(this.pos,$);if(_)return yield _,this.pos+=_.length,_.length;else if(I)yield"";return 0}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(zg))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let $=this.flowLevel>0,I=this.charAt(1);if(M4(I)||$&&aU.has(I)){if(!$)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;return(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}}return 0}*pushTag(){if(this.charAt(1)==="<"){let $=this.pos+2,I=this.buffer[$];while(!M4(I)&&I!==">")I=this.buffer[++$];return yield*this.pushToIndex(I===">"?$+1:$,!1)}else{let $=this.pos+1,I=this.buffer[$];while(I)if(dW.has(I))I=this.buffer[++$];else if(I==="%"&&HQ.has(this.buffer[$+1])&&HQ.has(this.buffer[$+2]))I=this.buffer[$+=3];else break;return yield*this.pushToIndex($,!1)}}*pushNewline(){let $=this.buffer[this.pos];if($===`
|
|
160
160
|
`)return yield*this.pushCount(1);else if($==="\r"&&this.charAt(1)===`
|
|
161
|
-
`)return yield*this.pushCount(2);else return 0}*pushSpaces($){let I=this.pos-1,_;do _=this.buffer[++I];while(_===" "||$&&_==="\t");let u=I-this.pos;if(u>0)yield this.buffer.substr(this.pos,u),this.pos=I;return u}*pushUntil($){let I=this.pos,_=this.buffer[I];while(!$(_))_=this.buffer[++I];return yield*this.pushToIndex(I,!1)}}
|
|
161
|
+
`)return yield*this.pushCount(2);else return 0}*pushSpaces($){let I=this.pos-1,_;do _=this.buffer[++I];while(_===" "||$&&_==="\t");let u=I-this.pos;if(u>0)yield this.buffer.substr(this.pos,u),this.pos=I;return u}*pushUntil($){let I=this.pos,_=this.buffer[I];while(!$(_))_=this.buffer[++I];return yield*this.pushToIndex(I,!1)}}pW.Lexer=YQ});var Jg=w((tW)=>{class OQ{constructor(){this.lineStarts=[],this.addNewLine=($)=>this.lineStarts.push($),this.linePos=($)=>{let I=0,_=this.lineStarts.length;while(I<_){let U=I+_>>1;if(this.lineStarts[U]<$)I=U+1;else _=U}if(this.lineStarts[I]===$)return{line:I+1,col:1};if(I===0)return{line:0,col:$};let u=this.lineStarts[I-1];return{line:I,col:$-u+1}}}}tW.LineCounter=OQ});var Gg=w(($P)=>{var eW=z$("process"),TQ=tU(),sW=gg();function B6($,I){for(let _=0;_<$.length;++_)if($[_].type===I)return!0;return!1}function BQ($){for(let I=0;I<$.length;++I)switch($[I].type){case"space":case"comment":case"newline":break;default:return I}return-1}function MQ($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function eU($){switch($.type){case"document":return $.start;case"block-map":{let I=$.items[$.items.length-1];return I.sep??I.start}case"block-seq":return $.items[$.items.length-1].start;default:return[]}}function E1($){if($.length===0)return[];let I=$.length;$:while(--I>=0)switch($[I].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break $}while($[++I]?.type==="space");return $.splice(I,$.length)}function DQ($){if($.start.type==="flow-seq-start"){for(let I of $.items)if(I.sep&&!I.value&&!B6(I.start,"explicit-key-ind")&&!B6(I.sep,"map-value-ind")){if(I.key)I.value=I.key;if(delete I.key,MQ(I.value))if(I.value.end)Array.prototype.push.apply(I.value.end,I.sep);else I.value.end=I.sep;else Array.prototype.push.apply(I.start,I.sep);delete I.sep}}}class KQ{constructor($){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new sW.Lexer,this.onNewLine=$}*parse($,I=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let _ of this.lexer.lex($,I))yield*this.next(_);if(!I)yield*this.end()}*next($){if(this.source=$,eW.env.LOG_TOKENS)console.log("|",TQ.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let I=TQ.tokenType($);if(!I){let _=`Not a YAML token: ${$}`;yield*this.pop({type:"error",offset:this.offset,message:_,source:$}),this.offset+=$.length}else if(I==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=I,yield*this.step(),I){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+$.length);break;case"space":if(this.atNewLine&&$[0]===" ")this.indent+=$.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=$.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=$.length}}*end(){while(this.stack.length>0)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let $=this.peek(1);if(this.type==="doc-end"&&$?.type!=="doc-end"){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!$)return yield*this.stream();switch($.type){case"document":return yield*this.document($);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar($);case"block-scalar":return yield*this.blockScalar($);case"block-map":return yield*this.blockMap($);case"block-seq":return yield*this.blockSequence($);case"flow-collection":return yield*this.flowCollection($);case"doc-end":return yield*this.documentEnd($)}yield*this.pop()}peek($){return this.stack[this.stack.length-$]}*pop($){let I=$??this.stack.pop();if(!I)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield I;else{let _=this.peek(1);if(I.type==="block-scalar")I.indent="indent"in _?_.indent:0;else if(I.type==="flow-collection"&&_.type==="document")I.indent=0;if(I.type==="flow-collection")DQ(I);switch(_.type){case"document":_.value=I;break;case"block-scalar":_.props.push(I);break;case"block-map":{let u=_.items[_.items.length-1];if(u.value){_.items.push({start:[],key:I,sep:[]}),this.onKeyLine=!0;return}else if(u.sep)u.value=I;else{Object.assign(u,{key:I,sep:[]}),this.onKeyLine=!u.explicitKey;return}break}case"block-seq":{let u=_.items[_.items.length-1];if(u.value)_.items.push({start:[],value:I});else u.value=I;break}case"flow-collection":{let u=_.items[_.items.length-1];if(!u||u.value)_.items.push({start:[],key:I,sep:[]});else if(u.sep)u.value=I;else Object.assign(u,{key:I,sep:[]});return}default:yield*this.pop(),yield*this.pop(I)}if((_.type==="document"||_.type==="block-map"||_.type==="block-seq")&&(I.type==="block-map"||I.type==="block-seq")){let u=I.items[I.items.length-1];if(u&&!u.sep&&!u.value&&u.start.length>0&&BQ(u.start)===-1&&(I.indent===0||u.start.every((U)=>U.type!=="comment"||U.indent<I.indent))){if(_.type==="document")_.end=u.start;else _.items.push({start:u.start});I.items.splice(-1,1)}}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let $={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")$.start.push(this.sourceToken);this.stack.push($);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document($){if($.value)return yield*this.lineEnd($);switch(this.type){case"doc-start":{if(BQ($.start)!==-1)yield*this.pop(),yield*this.step();else $.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":$.start.push(this.sourceToken);return}let I=this.startBlockValue($);if(I)this.stack.push(I);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar($){if(this.type==="map-value-ind"){let I=eU(this.peek(2)),_=E1(I),u;if($.end)u=$.end,u.push(this.sourceToken),delete $.end;else u=[this.sourceToken];let U={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:_,key:$,sep:u}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=U}else yield*this.lineEnd($)}*blockScalar($){switch(this.type){case"space":case"comment":case"newline":$.props.push(this.sourceToken);return;case"scalar":if($.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let I=this.source.indexOf(`
|
|
162
162
|
`)+1;while(I!==0)this.onNewLine(this.offset+I),I=this.source.indexOf(`
|
|
163
|
-
`,I)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap($){let I=$.items[$.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,I.value){let _="end"in I.value?I.value.end:void 0;if((Array.isArray(_)?_[_.length-1]:void 0)?.type==="comment")_?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else if(I.sep)I.sep.push(this.sourceToken);else I.start.push(this.sourceToken);return;case"space":case"comment":if(I.value)$.items.push({start:[this.sourceToken]});else if(I.sep)I.sep.push(this.sourceToken);else{if(this.atIndentedComment(I.start,$.indent)){let u=$.items[$.items.length-2]?.value?.end;if(Array.isArray(u)){Array.prototype.push.apply(u,I.start),u.push(this.sourceToken),$.items.pop();return}}I.start.push(this.sourceToken)}return}if(this.indent>=$.indent){let _=!this.onKeyLine&&this.indent===$.indent,u=_&&(I.sep||I.explicitKey)&&this.type!=="seq-item-ind",U=[];if(u&&I.sep&&!I.value){let z=[];for(let g=0;g<I.sep.length;++g){let J=I.sep[g];switch(J.type){case"newline":z.push(g);break;case"space":break;case"comment":if(J.indent>$.indent)z.length=0;break;default:z.length=0}}if(z.length>=2)U=I.sep.splice(z[1])}switch(this.type){case"anchor":case"tag":if(u||I.value)U.push(this.sourceToken),$.items.push({start:U}),this.onKeyLine=!0;else if(I.sep)I.sep.push(this.sourceToken);else I.start.push(this.sourceToken);return;case"explicit-key-ind":if(!I.sep&&!I.explicitKey)I.start.push(this.sourceToken),I.explicitKey=!0;else if(u||I.value)U.push(this.sourceToken),$.items.push({start:U,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if(I.explicitKey)if(!I.sep)if(
|
|
163
|
+
`,I)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap($){let I=$.items[$.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,I.value){let _="end"in I.value?I.value.end:void 0;if((Array.isArray(_)?_[_.length-1]:void 0)?.type==="comment")_?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else if(I.sep)I.sep.push(this.sourceToken);else I.start.push(this.sourceToken);return;case"space":case"comment":if(I.value)$.items.push({start:[this.sourceToken]});else if(I.sep)I.sep.push(this.sourceToken);else{if(this.atIndentedComment(I.start,$.indent)){let u=$.items[$.items.length-2]?.value?.end;if(Array.isArray(u)){Array.prototype.push.apply(u,I.start),u.push(this.sourceToken),$.items.pop();return}}I.start.push(this.sourceToken)}return}if(this.indent>=$.indent){let _=!this.onKeyLine&&this.indent===$.indent,u=_&&(I.sep||I.explicitKey)&&this.type!=="seq-item-ind",U=[];if(u&&I.sep&&!I.value){let z=[];for(let g=0;g<I.sep.length;++g){let J=I.sep[g];switch(J.type){case"newline":z.push(g);break;case"space":break;case"comment":if(J.indent>$.indent)z.length=0;break;default:z.length=0}}if(z.length>=2)U=I.sep.splice(z[1])}switch(this.type){case"anchor":case"tag":if(u||I.value)U.push(this.sourceToken),$.items.push({start:U}),this.onKeyLine=!0;else if(I.sep)I.sep.push(this.sourceToken);else I.start.push(this.sourceToken);return;case"explicit-key-ind":if(!I.sep&&!I.explicitKey)I.start.push(this.sourceToken),I.explicitKey=!0;else if(u||I.value)U.push(this.sourceToken),$.items.push({start:U,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if(I.explicitKey)if(!I.sep)if(B6(I.start,"newline"))Object.assign(I,{key:null,sep:[this.sourceToken]});else{let z=E1(I.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:z,key:null,sep:[this.sourceToken]}]})}else if(I.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(B6(I.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:U,key:null,sep:[this.sourceToken]}]});else if(MQ(I.key)&&!B6(I.sep,"newline")){let z=E1(I.start),g=I.key,J=I.sep;J.push(this.sourceToken),delete I.key,delete I.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:z,key:g,sep:J}]})}else if(U.length>0)I.sep=I.sep.concat(U,this.sourceToken);else I.sep.push(this.sourceToken);else if(!I.sep)Object.assign(I,{key:null,sep:[this.sourceToken]});else if(I.value||u)$.items.push({start:U,key:null,sep:[this.sourceToken]});else if(B6(I.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else I.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let z=this.flowScalar(this.type);if(u||I.value)$.items.push({start:U,key:z,sep:[]}),this.onKeyLine=!0;else if(I.sep)this.stack.push(z);else Object.assign(I,{key:z,sep:[]}),this.onKeyLine=!0;return}default:{let z=this.startBlockValue($);if(z){if(z.type==="block-seq"){if(!I.explicitKey&&I.sep&&!B6(I.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(_)$.items.push({start:U});this.stack.push(z);return}}}}yield*this.pop(),yield*this.step()}*blockSequence($){let I=$.items[$.items.length-1];switch(this.type){case"newline":if(I.value){let _="end"in I.value?I.value.end:void 0;if((Array.isArray(_)?_[_.length-1]:void 0)?.type==="comment")_?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else I.start.push(this.sourceToken);return;case"space":case"comment":if(I.value)$.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(I.start,$.indent)){let u=$.items[$.items.length-2]?.value?.end;if(Array.isArray(u)){Array.prototype.push.apply(u,I.start),u.push(this.sourceToken),$.items.pop();return}}I.start.push(this.sourceToken)}return;case"anchor":case"tag":if(I.value||this.indent<=$.indent)break;I.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==$.indent)break;if(I.value||B6(I.start,"seq-item-ind"))$.items.push({start:[this.sourceToken]});else I.start.push(this.sourceToken);return}if(this.indent>$.indent){let _=this.startBlockValue($);if(_){this.stack.push(_);return}}yield*this.pop(),yield*this.step()}*flowCollection($){let I=$.items[$.items.length-1];if(this.type==="flow-error-end"){let _;do yield*this.pop(),_=this.peek(1);while(_?.type==="flow-collection")}else if($.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!I||I.sep)$.items.push({start:[this.sourceToken]});else I.start.push(this.sourceToken);return;case"map-value-ind":if(!I||I.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(I.sep)I.sep.push(this.sourceToken);else Object.assign(I,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!I||I.value)$.items.push({start:[this.sourceToken]});else if(I.sep)I.sep.push(this.sourceToken);else I.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let u=this.flowScalar(this.type);if(!I||I.value)$.items.push({start:[],key:u,sep:[]});else if(I.sep)this.stack.push(u);else Object.assign(I,{key:u,sep:[]});return}case"flow-map-end":case"flow-seq-end":$.end.push(this.sourceToken);return}let _=this.startBlockValue($);if(_)this.stack.push(_);else yield*this.pop(),yield*this.step()}else{let _=this.peek(2);if(_.type==="block-map"&&(this.type==="map-value-ind"&&_.indent===$.indent||this.type==="newline"&&!_.items[_.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&_.type!=="flow-collection"){let u=eU(_),U=E1(u);DQ($);let z=$.end.splice(1,$.end.length);z.push(this.sourceToken);let g={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:U,key:$,sep:z}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=g}else yield*this.lineEnd($)}}flowScalar($){if(this.onNewLine){let I=this.source.indexOf(`
|
|
164
164
|
`)+1;while(I!==0)this.onNewLine(this.offset+I),I=this.source.indexOf(`
|
|
165
|
-
`,I)+1}return{type:$,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue($){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let I=eU($),_=
|
|
166
|
-
`)}function
|
|
167
|
-
`)}function
|
|
168
|
-
`).map((
|
|
169
|
-
`).map((J)=>J.trim()).filter((J)=>/status/i.test(J)).reduce((J,G)=>{if(G.match(/status[^:]*:\s*([a-z_]+)/i)?.[1]?.toLowerCase()==="completed")return J+1;return J},0);_=Math.max(_,g)}let z=
|
|
165
|
+
`,I)+1}return{type:$,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue($){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let I=eU($),_=E1(I);return _.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:_,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let I=eU($),_=E1(I);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:_,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment($,I){if(this.type!=="comment")return!1;if(this.indent<=I)return!1;return $.every((_)=>_.type==="newline"||_.type==="space")}*documentEnd($){if(this.type!=="doc-mode"){if($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd($){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}$P.Parser=KQ});var WQ=w((qP)=>{var VQ=az(),UP=c0(),s0=p0(),_P=Jz(),uP=I$(),zP=Jg(),RQ=Gg();function LQ($){let I=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||I&&new zP.LineCounter||null,prettyErrors:I}}function gP($,I={}){let{lineCounter:_,prettyErrors:u}=LQ(I),U=new RQ.Parser(_?.addNewLine),z=new VQ.Composer(I),g=Array.from(z.compose(U.parse($)));if(u&&_)for(let J of g)J.errors.forEach(s0.prettifyError($,_)),J.warnings.forEach(s0.prettifyError($,_));if(g.length>0)return g;return Object.assign([],{empty:!0},z.streamInfo())}function ZQ($,I={}){let{lineCounter:_,prettyErrors:u}=LQ(I),U=new RQ.Parser(_?.addNewLine),z=new VQ.Composer(I),g=null;for(let J of z.compose(U.parse($),!0,$.length))if(!g)g=J;else if(g.options.logLevel!=="silent"){g.errors.push(new s0.YAMLParseError(J.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(u&&_)g.errors.forEach(s0.prettifyError($,_)),g.warnings.forEach(s0.prettifyError($,_));return g}function JP($,I,_){let u=void 0;if(typeof I==="function")u=I;else if(_===void 0&&I&&typeof I==="object")_=I;let U=ZQ($,_);if(!U)return null;if(U.warnings.forEach((z)=>_P.warn(U.options.logLevel,z)),U.errors.length>0)if(U.options.logLevel!=="silent")throw U.errors[0];else U.errors=[];return U.toJS(Object.assign({reviver:u},_))}function GP($,I,_){let u=null;if(typeof I==="function"||Array.isArray(I))u=I;else if(_===void 0&&I)_=I;if(typeof _==="string")_=_.length;if(typeof _==="number"){let U=Math.round(_);_=U<1?void 0:U>8?{indent:8}:{indent:U}}if($===void 0){let{keepUndefined:U}=_??I??{};if(!U)return}if(uP.isDocument($)&&!u)return $.toString(_);return new UP.Document($,u,_).toString(_)}qP.parse=JP;qP.parseAllDocuments=gP;qP.parseDocument=ZQ;qP.stringify=GP});import{existsSync as g1,mkdirSync as kj,readdirSync as yj,readFileSync as Eu,writeFileSync as Wv}from"node:fs";import{join as V4}from"node:path";function N0($){return V4($,".serena","memories")}function z1($){try{return Eu($,"utf-8")}catch{return""}}function Uq($){return($.match(/##\s*ID:\s*(.+)/i)||[])[1]||($.match(/session-id:\s*(.+)/i)||[])[1]||$.match(/(session-\d{8}-\d{6})/)?.[1]}function ij($){let I=$.trim();return I===""||I==="---"}function _q($){let I=(G)=>String(G).padStart(2,"0"),_=$.getFullYear(),u=I($.getMonth()+1),U=I($.getDate()),z=I($.getHours()),g=I($.getMinutes()),J=I($.getSeconds());return`session-${_}${u}${U}-${z}${g}${J}`}function lj($,I){return["# Orchestrator Session",`## ID: ${$}`,`## Started: ${I}`,"## Status: idle","","## Agents","| Agent ID | CLI | PID | Status | Task |","|----------|-----|-----|--------|------|","","## Summary (filled on completion)","- Total Tasks: 0","- Completed: 0","- Failed: 0","- Files Created: []","- Issues: []",""].join(`
|
|
166
|
+
`)}function mj($){return["# Task Board",`## Session: ${$}`,"","| Agent | Status | Task |","|-------|--------|------|",""].join(`
|
|
167
|
+
`)}function uq($){let I=N0($);if(!g1(I))return[];try{return yj(I).filter((_)=>_.endsWith(".md")&&_!==".gitkeep")}catch{return[]}}function Pv($,I){let _=$.match(/^progress-(\w+)(?:-[\w-]+)?\.md$/),u=$.match(/^result-(\w+)(?:-[\w-]+)?\.md$/);if(_?.[1])return{agent:_[1],type:"progress",content:I.slice(0,500)};if(u?.[1])return{agent:u[1],type:"result",content:I.slice(0,500)};return null}function bv($){let I=N0($),_={agents:[],activities:[],completedTasks:[],inProgressTasks:[]};if(!g1(I))return _;let u=uq($);for(let U of u){if(U==="orchestrator-session.md"){try{let g=Eu(V4(I,U),"utf-8").match(/session[:\s]+(\S+)/i);if(g)_.sessionId=g[1]}catch{}continue}try{let z=Eu(V4(I,U),"utf-8"),g=Pv(U,z);if(g){if(_.activities.push(g),!_.agents.includes(g.agent))_.agents.push(g.agent);if(g.type==="result"){let J=z.match(/task[:\s]+(.+)/i)||z.match(/##\s*(.+)/);if(J?.[1])_.completedTasks.push(J[1].trim())}else if(g.type==="progress"){let J=z.match(/current[:\s]+(.+)/i)||z.match(/working on[:\s]+(.+)/i);if(J?.[1]&&!_.completedTasks.includes(J[1].trim()))_.inProgressTasks.push(J[1].trim())}}}catch{}}return _}function Cu($){let I=N0($),_=V4(I,"orchestrator-session.md");if(!g1(_))return{};let u=z1(_);if(!u)return{};let U=Uq(u)?.trim(),z=(u.match(/##\s*Status:\s*(.+)/i)||[])[1]||(u.match(/status:\s*(running|completed|failed|aborted)/i)||[])[1],g=(u.match(/##\s*Started:\s*(.+)/i)||[])[1]||(u.match(/started:\s*(.+)/i)||[])[1];return{id:U,status:z?.trim().toLowerCase(),startedAt:g?.trim()}}function Av($){let I=N0($);if(!g1(I))return 0;let _=0,u=uq($);for(let g of u){if(!g.startsWith("result-"))continue;let J=z1(V4(I,g));if(!J)continue;let G=J.split(`
|
|
168
|
+
`).map((q)=>q.trim()).find((q)=>/^##\s*Status:/i.test(q)||/^Status:/i.test(q));if(G){if(G.match(/status[^:]*:\s*([a-z_]+)/i)?.[1]?.toLowerCase()==="completed")_+=1}}let U=z1(V4(I,"task-board.md"));if(U){let g=U.split(`
|
|
169
|
+
`).map((J)=>J.trim()).filter((J)=>/status/i.test(J)).reduce((J,G)=>{if(G.match(/status[^:]*:\s*([a-z_]+)/i)?.[1]?.toLowerCase()==="completed")return J+1;return J},0);_=Math.max(_,g)}let z=z1(V4(I,"orchestrator-session.md"));if(z){let g=z.match(/Completed:\s*(\d+)/i);if(g?.[1]){let J=parseInt(g[1],10);if(!Number.isNaN(J))_=Math.max(_,J)}}return _}function jv($,I){let _=[],u=N0($);if(!g1(u))return _;let U=I?new Date(I).getTime():0,z=uq($);for(let g of z){if(g==="orchestrator-session.md")continue;try{let J=V4(u,g),G=Eu(J,"utf-8"),q=Pv(g,G);if(q)_.push(q)}catch{}}return _}function Fv($){let I=[];for(let _ of $){let u=_.content.toLowerCase();if(u.includes("error")||u.includes("fail"))I.push(`${_.agent}: Error handling improved`);if(u.includes("refactor"))I.push(`${_.agent}: Code structure refactored`);if(u.includes("test"))I.push(`${_.agent}: Test coverage added`);if(u.includes("performance")||u.includes("optimize"))I.push(`${_.agent}: Performance optimized`)}return[...new Set(I)].slice(0,5)}function Sv($,I={}){let _=N0($);if(!g1(_))kj(_,{recursive:!0});let u=z1(V4(_,"orchestrator-session.md")),U=z1(V4(_,"task-board.md")),z=Uq(u)||Uq(U)||_q(new Date),g=new Date().toISOString(),J=lj(z,g),G=mj(z),q=[],N=[],X=[],Q=(H,Y)=>{let v=V4(_,H);if(!g1(v)){Wv(v,Y,"utf-8"),q.push(H);return}let O=z1(v);if(I.force||ij(O)){Wv(v,Y,"utf-8"),N.push(H);return}X.push(H)};return Q("orchestrator-session.md",J),Q("task-board.md",G),Q(".gitkeep",""),{memoriesDir:_,sessionId:z,created:q,updated:N,skipped:X}}var CI=()=>{};var qq=w((Ym,hv)=>{var Gq={to($,I){if(!I)return`\x1B[${$+1}G`;return`\x1B[${I+1};${$+1}H`},move($,I){let _="";if($<0)_+=`\x1B[${-$}D`;else if($>0)_+=`\x1B[${$}C`;if(I<0)_+=`\x1B[${-I}A`;else if(I>0)_+=`\x1B[${I}B`;return _},up:($=1)=>`\x1B[${$}A`,down:($=1)=>`\x1B[${$}B`,forward:($=1)=>`\x1B[${$}C`,backward:($=1)=>`\x1B[${$}D`,nextLine:($=1)=>"\x1B[E".repeat($),prevLine:($=1)=>"\x1B[F".repeat($),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},OF={up:($=1)=>"\x1B[S".repeat($),down:($=1)=>"\x1B[T".repeat($)},TF={screen:"\x1B[2J",up:($=1)=>"\x1B[1J".repeat($),down:($=1)=>"\x1B[J".repeat($),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines($){let I="";for(let _=0;_<$;_++)I+=this.line+(_<$-1?Gq.up():"");if($)I+=Gq.left;return I}};hv.exports={cursor:Gq,scroll:OF,erase:TF,beep:"\x07"}});import{styleText as vq}from"node:util";import{stdout as Oq,stdin as tv}from"node:process";import*as A6 from"node:readline";import BF from"node:readline";import{ReadStream as dv}from"node:tty";function e4($,I,_){if(!_.some((g)=>!g.disabled))return $;let u=$+I,U=Math.max(_.length-1,0),z=u<0?U:u>U?0:u;return _[z].disabled?e4(z,I<0?-1:1,_):z}function Hq($,I,_){return String($).normalize().replaceAll(`\r
|
|
170
170
|
`,`
|
|
171
171
|
`).split(`
|
|
172
|
-
`).map((u)=>
|
|
173
|
-
`)}function
|
|
172
|
+
`).map((u)=>jF(u,I,_)).join(`
|
|
173
|
+
`)}function Dq($,I){if(typeof $=="string")return w$.aliases.get($)===I;for(let _ of $)if(_!==void 0&&Dq(_,I))return!0;return!1}function SF($,I){if($===I)return;let _=$.split(`
|
|
174
174
|
`),u=I.split(`
|
|
175
|
-
`),U=Math.max(_.length,u.length),z=[];for(let g=0;g<U;g++)_[g]!==u[g]&&z.push(g);return{lines:z,numLinesBefore:_.length,numLinesAfter:u.length,numLines:U}}function
|
|
175
|
+
`),U=Math.max(_.length,u.length),z=[];for(let g=0;g<U;g++)_[g]!==u[g]&&z.push(g);return{lines:z,numLinesBefore:_.length,numLinesAfter:u.length,numLines:U}}function _$($){return $===Yq}function iu($,I){let _=$;_.isTTY&&_.setRawMode(I)}function IH({input:$=tv,output:I=Oq,overwrite:_=!0,hideCursor:u=!0}={}){let U=A6.createInterface({input:$,output:I,prompt:"",tabSize:1});A6.emitKeypressEvents($,U),$ instanceof dv&&$.isTTY&&$.setRawMode(!0);let z=(g,{name:J,sequence:G})=>{let q=String(g);if(Dq([q,J,G],"cancel")){u&&I.write(C$.cursor.show),process.exit(0);return}if(!_)return;A6.moveCursor(I,J==="return"?0:-1,J==="return"?-1:0,()=>{A6.clearLine(I,1,()=>{$.once("keypress",z)})})};return u&&I.write(C$.cursor.hide),$.once("keypress",z),()=>{$.off("keypress",z),u&&I.write(C$.cursor.show),$ instanceof dv&&$.isTTY&&!wF&&$.setRawMode(!1),U.terminal=!1,U.close()}}function J1($,I,_,u=_){let U=kI($??Oq);return Hq(I,U-_.length,{hard:!0,trim:!1}).split(`
|
|
176
176
|
`).map((z,g)=>`${g===0?u:_}${z}`).join(`
|
|
177
|
-
`)}class
|
|
178
|
-
`),
|
|
179
|
-
`).length-1;this.output.write(C$.cursor.move(-999,$*-1))}render(){let $=
|
|
177
|
+
`)}class G1{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;state="initial";error="";value;userInput="";constructor($,I=!0){let{input:_=tv,output:u=Oq,render:U,signal:z,...g}=$;this.opts=g,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=U.bind(this),this._track=I,this._abortSignal=z,this.input=_,this.output=u}unsubscribe(){this._subscribers.clear()}setSubscriber($,I){let _=this._subscribers.get($)??[];_.push(I),this._subscribers.set($,_)}on($,I){this.setSubscriber($,{cb:I})}once($,I){this.setSubscriber($,{cb:I,once:!0})}emit($,...I){let _=this._subscribers.get($)??[],u=[];for(let U of _)U.cb(...I),U.once&&u.push(()=>_.splice(_.indexOf(U),1));for(let U of u)U()}prompt(){return new Promise(($)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),$(Yq);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}this.rl=BF.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0&&this._setUserInput(this.opts.initialUserInput,!0),this.input.on("keypress",this.onKeypress),iu(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(C$.cursor.show),this.output.off("resize",this.render),iu(this.input,!1),$(this.value)}),this.once("cancel",()=>{this.output.write(C$.cursor.show),this.output.off("resize",this.render),iu(this.input,!1),$(Yq)})})}_isActionKey($,I){return $==="\t"}_setValue($){this.value=$,this.emit("value",this.value)}_setUserInput($,I){this.userInput=$??"",this.emit("userInput",this.userInput),I&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}_clearUserInput(){this.rl?.write(null,{ctrl:!0,name:"u"}),this._setUserInput("")}onKeypress($,I){if(this._track&&I.name!=="return"&&(I.name&&this._isActionKey($,I)&&this.rl?.write(null,{ctrl:!0,name:"h"}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),this.state==="error"&&(this.state="active"),I?.name&&(!this._track&&w$.aliases.has(I.name)&&this.emit("cursor",w$.aliases.get(I.name)),w$.actions.has(I.name)&&this.emit("cursor",I.name)),$&&($.toLowerCase()==="y"||$.toLowerCase()==="n")&&this.emit("confirm",$.toLowerCase()==="y"),this.emit("key",$?.toLowerCase(),I),I?.name==="return"){if(this.opts.validate){let _=this.opts.validate(this.value);_&&(this.error=_ instanceof Error?_.message:_,this.state="error",this.rl?.write(this.userInput))}this.state!=="error"&&(this.state="submit")}Dq([$,I?.name,I?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
|
|
178
|
+
`),iu(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let $=Hq(this._prevFrame,process.stdout.columns,{hard:!0,trim:!1}).split(`
|
|
179
|
+
`).length-1;this.output.write(C$.cursor.move(-999,$*-1))}render(){let $=Hq(this._render(this)??"",process.stdout.columns,{hard:!0,trim:!1});if($!==this._prevFrame){if(this.state==="initial")this.output.write(C$.cursor.hide);else{let I=SF(this._prevFrame,$),_=Mq(this.output);if(this.restoreCursor(),I){let u=Math.max(0,I.numLinesAfter-_),U=Math.max(0,I.numLinesBefore-_),z=I.lines.find((g)=>g>=u);if(z===void 0){this._prevFrame=$;return}if(I.lines.length===1){this.output.write(C$.cursor.move(0,z-U)),this.output.write(C$.erase.lines(1));let g=$.split(`
|
|
180
180
|
`);this.output.write(g[z]),this._prevFrame=$,this.output.write(C$.cursor.move(0,g.length-z-1));return}else if(I.lines.length>1){if(u<U)z=u;else{let J=z-U;J>0&&this.output.write(C$.cursor.move(0,J))}this.output.write(C$.erase.down());let g=$.split(`
|
|
181
181
|
`).slice(z);this.output.write(g.join(`
|
|
182
|
-
`)),this._prevFrame=$;return}}this.output.write(C$.erase.down())}this.output.write($),this.state==="initial"&&(this.state="active"),this._prevFrame=$}}}function
|
|
183
|
-
`),
|
|
184
|
-
`?(z&&(u+=
|
|
185
|
-
`&&(U&&O&&(u+=
|
|
182
|
+
`)),this._prevFrame=$;return}}this.output.write(C$.erase.down())}this.output.write($),this.state==="initial"&&(this.state="active"),this._prevFrame=$}}}function EF($,I){if($===void 0||I.length===0)return 0;let _=I.findIndex((u)=>u.value===$);return _!==-1?_:0}function CF($,I){return(I.label??String(I.value)).toLowerCase().includes($.toLowerCase())}function fF($,I){if(I)return $?I:I[0]}var C$,DF=($)=>$===161||$===164||$===167||$===168||$===170||$===173||$===174||$>=176&&$<=180||$>=182&&$<=186||$>=188&&$<=191||$===198||$===208||$===215||$===216||$>=222&&$<=225||$===230||$>=232&&$<=234||$===236||$===237||$===240||$===242||$===243||$>=247&&$<=250||$===252||$===254||$===257||$===273||$===275||$===283||$===294||$===295||$===299||$>=305&&$<=307||$===312||$>=319&&$<=322||$===324||$>=328&&$<=331||$===333||$===338||$===339||$===358||$===359||$===363||$===462||$===464||$===466||$===468||$===470||$===472||$===474||$===476||$===593||$===609||$===708||$===711||$>=713&&$<=715||$===717||$===720||$>=728&&$<=731||$===733||$===735||$>=768&&$<=879||$>=913&&$<=929||$>=931&&$<=937||$>=945&&$<=961||$>=963&&$<=969||$===1025||$>=1040&&$<=1103||$===1105||$===8208||$>=8211&&$<=8214||$===8216||$===8217||$===8220||$===8221||$>=8224&&$<=8226||$>=8228&&$<=8231||$===8240||$===8242||$===8243||$===8245||$===8251||$===8254||$===8308||$===8319||$>=8321&&$<=8324||$===8364||$===8451||$===8453||$===8457||$===8467||$===8470||$===8481||$===8482||$===8486||$===8491||$===8531||$===8532||$>=8539&&$<=8542||$>=8544&&$<=8555||$>=8560&&$<=8569||$===8585||$>=8592&&$<=8601||$===8632||$===8633||$===8658||$===8660||$===8679||$===8704||$===8706||$===8707||$===8711||$===8712||$===8715||$===8719||$===8721||$===8725||$===8730||$>=8733&&$<=8736||$===8739||$===8741||$>=8743&&$<=8748||$===8750||$>=8756&&$<=8759||$===8764||$===8765||$===8776||$===8780||$===8786||$===8800||$===8801||$>=8804&&$<=8807||$===8810||$===8811||$===8814||$===8815||$===8834||$===8835||$===8838||$===8839||$===8853||$===8857||$===8869||$===8895||$===8978||$>=9312&&$<=9449||$>=9451&&$<=9547||$>=9552&&$<=9587||$>=9600&&$<=9615||$>=9618&&$<=9621||$===9632||$===9633||$>=9635&&$<=9641||$===9650||$===9651||$===9654||$===9655||$===9660||$===9661||$===9664||$===9665||$>=9670&&$<=9672||$===9675||$>=9678&&$<=9681||$>=9698&&$<=9701||$===9711||$===9733||$===9734||$===9737||$===9742||$===9743||$===9756||$===9758||$===9792||$===9794||$===9824||$===9825||$>=9827&&$<=9829||$>=9831&&$<=9834||$===9836||$===9837||$===9839||$===9886||$===9887||$===9919||$>=9926&&$<=9933||$>=9935&&$<=9939||$>=9941&&$<=9953||$===9955||$===9960||$===9961||$>=9963&&$<=9969||$===9972||$>=9974&&$<=9977||$===9979||$===9980||$===9982||$===9983||$===10045||$>=10102&&$<=10111||$>=11094&&$<=11097||$>=12872&&$<=12879||$>=57344&&$<=63743||$>=65024&&$<=65039||$===65533||$>=127232&&$<=127242||$>=127248&&$<=127277||$>=127280&&$<=127337||$>=127344&&$<=127373||$===127375||$===127376||$>=127387&&$<=127404||$>=917760&&$<=917999||$>=983040&&$<=1048573||$>=1048576&&$<=1114109,MF=($)=>$===12288||$>=65281&&$<=65376||$>=65504&&$<=65510,KF=($)=>$>=4352&&$<=4447||$===8986||$===8987||$===9001||$===9002||$>=9193&&$<=9196||$===9200||$===9203||$===9725||$===9726||$===9748||$===9749||$>=9800&&$<=9811||$===9855||$===9875||$===9889||$===9898||$===9899||$===9917||$===9918||$===9924||$===9925||$===9934||$===9940||$===9962||$===9970||$===9971||$===9973||$===9978||$===9981||$===9989||$===9994||$===9995||$===10024||$===10060||$===10062||$>=10067&&$<=10069||$===10071||$>=10133&&$<=10135||$===10160||$===10175||$===11035||$===11036||$===11088||$===11093||$>=11904&&$<=11929||$>=11931&&$<=12019||$>=12032&&$<=12245||$>=12272&&$<=12287||$>=12289&&$<=12350||$>=12353&&$<=12438||$>=12441&&$<=12543||$>=12549&&$<=12591||$>=12593&&$<=12686||$>=12688&&$<=12771||$>=12783&&$<=12830||$>=12832&&$<=12871||$>=12880&&$<=19903||$>=19968&&$<=42124||$>=42128&&$<=42182||$>=43360&&$<=43388||$>=44032&&$<=55203||$>=63744&&$<=64255||$>=65040&&$<=65049||$>=65072&&$<=65106||$>=65108&&$<=65126||$>=65128&&$<=65131||$>=94176&&$<=94180||$===94192||$===94193||$>=94208&&$<=100343||$>=100352&&$<=101589||$>=101632&&$<=101640||$>=110576&&$<=110579||$>=110581&&$<=110587||$===110589||$===110590||$>=110592&&$<=110882||$===110898||$>=110928&&$<=110930||$===110933||$>=110948&&$<=110951||$>=110960&&$<=111355||$===126980||$===127183||$===127374||$>=127377&&$<=127386||$>=127488&&$<=127490||$>=127504&&$<=127547||$>=127552&&$<=127560||$===127568||$===127569||$>=127584&&$<=127589||$>=127744&&$<=127776||$>=127789&&$<=127797||$>=127799&&$<=127868||$>=127870&&$<=127891||$>=127904&&$<=127946||$>=127951&&$<=127955||$>=127968&&$<=127984||$===127988||$>=127992&&$<=128062||$===128064||$>=128066&&$<=128252||$>=128255&&$<=128317||$>=128331&&$<=128334||$>=128336&&$<=128359||$===128378||$===128405||$===128406||$===128420||$>=128507&&$<=128591||$>=128640&&$<=128709||$===128716||$>=128720&&$<=128722||$>=128725&&$<=128727||$>=128732&&$<=128735||$===128747||$===128748||$>=128756&&$<=128764||$>=128992&&$<=129003||$===129008||$>=129292&&$<=129338||$>=129340&&$<=129349||$>=129351&&$<=129535||$>=129648&&$<=129660||$>=129664&&$<=129672||$>=129680&&$<=129725||$>=129727&&$<=129733||$>=129742&&$<=129755||$>=129760&&$<=129768||$>=129776&&$<=129784||$>=131072&&$<=196605||$>=196608&&$<=262141,Xq,xu,ku,Nq,yu,VF,RF,av=($,I={},_={})=>{let u=I.limit??1/0,U=I.ellipsis??"",z=I?.ellipsisWidth??(U?av(U,RF,_).width:0),g=_.ansiWidth??0,J=_.controlWidth??0,G=_.tabWidth??8,q=_.ambiguousWidth??1,N=_.emojiWidth??2,X=_.fullWidthWidth??2,Q=_.regularWidth??1,H=_.wideWidth??2,Y=0,v=0,O=$.length,T=0,L=!1,V=O,R=Math.max(0,u-z),M=0,Z=0,K=0,D=0;$:for(;;){if(Z>M||v>=O&&v>Y){let S=$.slice(M,Z)||$.slice(Y,v);T=0;for(let C of S.replaceAll(VF,"")){let x=C.codePointAt(0)||0;if(MF(x)?D=X:KF(x)?D=H:q!==Q&&DF(x)?D=q:D=Q,K+D>R&&(V=Math.min(V,Math.max(M,Y)+T)),K+D>u){L=!0;break $}T+=C.length,K+=D}M=Z=0}if(v>=O)break;if(yu.lastIndex=v,yu.test($)){if(T=yu.lastIndex-v,D=T*Q,K+D>R&&(V=Math.min(V,v+Math.floor((R-K)/Q))),K+D>u){L=!0;break}K+=D,M=Y,Z=v,v=Y=yu.lastIndex;continue}if(Xq.lastIndex=v,Xq.test($)){if(K+g>R&&(V=Math.min(V,v)),K+g>u){L=!0;break}K+=g,M=Y,Z=v,v=Y=Xq.lastIndex;continue}if(xu.lastIndex=v,xu.test($)){if(T=xu.lastIndex-v,D=T*J,K+D>R&&(V=Math.min(V,v+Math.floor((R-K)/J))),K+D>u){L=!0;break}K+=D,M=Y,Z=v,v=Y=xu.lastIndex;continue}if(ku.lastIndex=v,ku.test($)){if(T=ku.lastIndex-v,D=T*G,K+D>R&&(V=Math.min(V,v+Math.floor((R-K)/G))),K+D>u){L=!0;break}K+=D,M=Y,Z=v,v=Y=ku.lastIndex;continue}if(Nq.lastIndex=v,Nq.test($)){if(K+N>R&&(V=Math.min(V,v)),K+N>u){L=!0;break}K+=N,M=Y,Z=v,v=Y=Nq.lastIndex;continue}v+=1}return{width:L?R:K,index:L?V:O,truncated:L,ellipsed:L&&u>=z}},LF,xI=($,I={})=>av($,LF,I).width,lu="\x1B",ev="",ZF=39,Tq="\x07",sv="[",WF="]",$H="m",Bq,cv,PF=($)=>{if($>=30&&$<=37||$>=90&&$<=97)return 39;if($>=40&&$<=47||$>=100&&$<=107)return 49;if($===1||$===2)return 22;if($===3)return 23;if($===4)return 24;if($===7)return 27;if($===8)return 28;if($===9)return 29;if($===0)return 0},pv=($)=>`${lu}${sv}${$}${$H}`,ov=($)=>`${lu}${Bq}${$}${Tq}`,bF=($)=>$.map((I)=>xI(I)),Qq=($,I,_)=>{let u=I[Symbol.iterator](),U=!1,z=!1,g=$.at(-1),J=g===void 0?0:xI(g),G=u.next(),q=u.next(),N=0;for(;!G.done;){let X=G.value,Q=xI(X);J+Q<=_?$[$.length-1]+=X:($.push(X),J=0),(X===lu||X===ev)&&(U=!0,z=I.startsWith(Bq,N+1)),U?z?X===Tq&&(U=!1,z=!1):X===$H&&(U=!1):(J+=Q,J===_&&!q.done&&($.push(""),J=0)),G=q,q=u.next(),N+=X.length}g=$.at(-1),!J&&g!==void 0&&g.length>0&&$.length>1&&($[$.length-2]+=$.pop())},AF=($)=>{let I=$.split(" "),_=I.length;for(;_>0&&!(xI(I[_-1])>0);)_--;return _===I.length?$:I.slice(0,_).join(" ")+I.slice(_).join("")},jF=($,I,_={})=>{if(_.trim!==!1&&$.trim()==="")return"";let u="",U,z,g=$.split(" "),J=bF(g),G=[""];for(let[Y,v]of g.entries()){_.trim!==!1&&(G[G.length-1]=(G.at(-1)??"").trimStart());let O=xI(G.at(-1)??"");if(Y!==0&&(O>=I&&(_.wordWrap===!1||_.trim===!1)&&(G.push(""),O=0),(O>0||_.trim===!1)&&(G[G.length-1]+=" ",O++)),_.hard&&J[Y]>I){let T=I-O,L=1+Math.floor((J[Y]-T-1)/I);Math.floor((J[Y]-1)/I)<L&&G.push(""),Qq(G,v,I);continue}if(O+J[Y]>I&&O>0&&J[Y]>0){if(_.wordWrap===!1&&O<I){Qq(G,v,I);continue}G.push("")}if(O+J[Y]>I&&_.wordWrap===!1){Qq(G,v,I);continue}G[G.length-1]+=v}_.trim!==!1&&(G=G.map((Y)=>AF(Y)));let q=G.join(`
|
|
183
|
+
`),N=q[Symbol.iterator](),X=N.next(),Q=N.next(),H=0;for(;!X.done;){let Y=X.value,v=Q.value;if(u+=Y,Y===lu||Y===ev){cv.lastIndex=H+1;let T=cv.exec(q)?.groups;if(T?.code!==void 0){let L=Number.parseFloat(T.code);U=L===ZF?void 0:L}else T?.uri!==void 0&&(z=T.uri.length===0?void 0:T.uri)}let O=U?PF(U):void 0;v===`
|
|
184
|
+
`?(z&&(u+=ov("")),U&&O&&(u+=pv(O))):Y===`
|
|
185
|
+
`&&(U&&O&&(u+=pv(U)),z&&(u+=ov(z))),H+=Y.length,X=Q,Q=N.next()}return u},FF,w$,wF,Yq,kI=($)=>("columns"in $)&&typeof $.columns=="number"?$.columns:80,Mq=($)=>("rows"in $)&&typeof $.rows=="number"?$.rows:20,UH,Kq,_H,uH,Vq,Rq;var Lq=b0(()=>{C$=v$(qq(),1);Xq=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,xu=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,ku=/\t{1,1000}/y,Nq=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,yu=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,VF=/\p{M}+/gu,RF={limit:1/0,ellipsis:""},LF={limit:1/0,ellipsis:"",ellipsisWidth:0},Bq=`${WF}8;;`,cv=new RegExp(`(?:\\${sv}(?<code>\\d+)m|\\${Bq}(?<uri>.*)${Tq})`,"y");FF=["up","down","left","right","space","enter","cancel"],w$={actions:new Set(FF),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0};wF=globalThis.process.platform.startsWith("win"),Yq=Symbol("clack:cancel");UH=class UH extends G1{filteredOptions;multiple;isNavigating=!1;selectedValues=[];focusedValue;#$=0;#U="";#_;#I;get cursor(){return this.#$}get userInputWithCursor(){if(!this.userInput)return vq(["inverse","hidden"],"_");if(this._cursor>=this.userInput.length)return`${this.userInput}█`;let $=this.userInput.slice(0,this._cursor),[I,..._]=this.userInput.slice(this._cursor);return`${$}${vq("inverse",I)}${_.join("")}`}get options(){return typeof this.#I=="function"?this.#I():this.#I}constructor($){super($),this.#I=$.options;let I=this.options;this.filteredOptions=[...I],this.multiple=$.multiple===!0,this.#_=$.filter??CF;let _;if($.initialValue&&Array.isArray($.initialValue)?this.multiple?_=$.initialValue:_=$.initialValue.slice(0,1):!this.multiple&&this.options.length>0&&(_=[this.options[0].value]),_)for(let u of _){let U=I.findIndex((z)=>z.value===u);U!==-1&&(this.toggleSelected(u),this.#$=U)}this.focusedValue=this.options[this.#$]?.value,this.on("key",(u,U)=>this.#u(u,U)),this.on("userInput",(u)=>this.#z(u))}_isActionKey($,I){return $==="\t"||this.multiple&&this.isNavigating&&I.name==="space"&&$!==void 0&&$!==""}#u($,I){let _=I.name==="up",u=I.name==="down",U=I.name==="return";_||u?(this.#$=e4(this.#$,_?-1:1,this.filteredOptions),this.focusedValue=this.filteredOptions[this.#$]?.value,this.multiple||(this.selectedValues=[this.focusedValue]),this.isNavigating=!0):U?this.value=fF(this.multiple,this.selectedValues):this.multiple?this.focusedValue!==void 0&&(I.name==="tab"||this.isNavigating&&I.name==="space")?this.toggleSelected(this.focusedValue):this.isNavigating=!1:(this.focusedValue&&(this.selectedValues=[this.focusedValue]),this.isNavigating=!1)}deselectAll(){this.selectedValues=[]}toggleSelected($){this.filteredOptions.length!==0&&(this.multiple?this.selectedValues.includes($)?this.selectedValues=this.selectedValues.filter((I)=>I!==$):this.selectedValues=[...this.selectedValues,$]:this.selectedValues=[$])}#z($){if($!==this.#U){this.#U=$;let I=this.options;$?this.filteredOptions=I.filter((U)=>this.#_($,U)):this.filteredOptions=[...I];let _=EF(this.focusedValue,this.filteredOptions);this.#$=e4(_,0,this.filteredOptions);let u=this.filteredOptions[this.#$];u&&!u.disabled?this.focusedValue=u.value:this.focusedValue=void 0,this.multiple||(this.focusedValue!==void 0?this.toggleSelected(this.focusedValue):this.deselectAll())}}};Kq=class Kq extends G1{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor($){super($,!1),this.value=!!$.initialValue,this.on("userInput",()=>{this.value=this._value}),this.on("confirm",(I)=>{this.output.write(C$.cursor.move(0,-1)),this.value=I,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};_H=class _H extends G1{options;cursor=0;#$;getGroupItems($){return this.options.filter((I)=>I.group===$)}isGroupSelected($){let I=this.getGroupItems($),_=this.value;return _===void 0?!1:I.every((u)=>_.includes(u.value))}toggleValue(){let $=this.options[this.cursor];if(this.value===void 0&&(this.value=[]),$.group===!0){let I=$.value,_=this.getGroupItems(I);this.isGroupSelected(I)?this.value=this.value.filter((u)=>_.findIndex((U)=>U.value===u)===-1):this.value=[...this.value,..._.map((u)=>u.value)],this.value=Array.from(new Set(this.value))}else{let I=this.value.includes($.value);this.value=I?this.value.filter((_)=>_!==$.value):[...this.value,$.value]}}constructor($){super($,!1);let{options:I}=$;this.#$=$.selectableGroups!==!1,this.options=Object.entries(I).flatMap(([_,u])=>[{value:_,group:!0,label:_},...u.map((U)=>({...U,group:_}))]),this.value=[...$.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:_})=>_===$.cursorAt),this.#$?0:1),this.on("cursor",(_)=>{switch(_){case"left":case"up":{this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;let u=this.options[this.cursor]?.group===!0;!this.#$&&u&&(this.cursor=this.cursor===0?this.options.length-1:this.cursor-1);break}case"down":case"right":{this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;let u=this.options[this.cursor]?.group===!0;!this.#$&&u&&(this.cursor=this.cursor===this.options.length-1?0:this.cursor+1);break}case"space":this.toggleValue();break}})}};uH=class extends G1{options;cursor=0;get _value(){return this.options[this.cursor].value}get _enabledOptions(){return this.options.filter(($)=>$.disabled!==!0)}toggleAll(){let $=this._enabledOptions,I=this.value!==void 0&&this.value.length===$.length;this.value=I?[]:$.map((_)=>_.value)}toggleInvert(){let $=this.value;if(!$)return;let I=this._enabledOptions.filter((_)=>!$.includes(_.value));this.value=I.map((_)=>_.value)}toggleValue(){this.value===void 0&&(this.value=[]);let $=this.value.includes(this._value);this.value=$?this.value.filter((I)=>I!==this._value):[...this.value,this._value]}constructor($){super($,!1),this.options=$.options,this.value=[...$.initialValues??[]];let I=Math.max(this.options.findIndex(({value:_})=>_===$.cursorAt),0);this.cursor=this.options[I].disabled?e4(I,1,this.options):I,this.on("key",(_)=>{_==="a"&&this.toggleAll(),_==="i"&&this.toggleInvert()}),this.on("cursor",(_)=>{switch(_){case"left":case"up":this.cursor=e4(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=e4(this.cursor,1,this.options);break;case"space":this.toggleValue();break}})}};Vq=class Vq extends G1{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){this.value=this._selectedValue.value}constructor($){super($,!1),this.options=$.options;let I=this.options.findIndex(({value:u})=>u===$.initialValue),_=I===-1?0:I;this.cursor=this.options[_].disabled?e4(_,1,this.options):_,this.changeValue(),this.on("cursor",(u)=>{switch(u){case"left":case"up":this.cursor=e4(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=e4(this.cursor,1,this.options);break}this.changeValue()})}};Rq=class Rq extends G1{get userInputWithCursor(){if(this.state==="submit")return this.userInput;let $=this.userInput;if(this.cursor>=$.length)return`${this.userInput}█`;let I=$.slice(0,this.cursor),[_,...u]=$.slice(this.cursor);return`${I}${vq("inverse",_)}${u.join("")}`}get cursor(){return this._cursor}constructor($){super({...$,initialUserInput:$.initialUserInput??$.initialValue}),this.on("userInput",(I)=>{this._setValue(I)}),this.on("finalize",()=>{this.value||(this.value=$.defaultValue),this.value===void 0&&(this.value="")})}}});import{styleText as b,stripVTControlCharacters as Pm}from"node:util";import H4 from"node:process";function xF(){return H4.platform!=="win32"?H4.env.TERM!=="linux":!!H4.env.CI||!!H4.env.WT_SESSION||!!H4.env.TERMINUS_SUBLIME||H4.env.ConEmuTask==="{cmd::Cmder}"||H4.env.TERM_PROGRAM==="Terminus-Sublime"||H4.env.TERM_PROGRAM==="vscode"||H4.env.TERM==="xterm-256color"||H4.env.TERM==="alacritty"||H4.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}function lI($,I,_){return String($).normalize().replaceAll(`\r
|
|
186
186
|
`,`
|
|
187
187
|
`).split(`
|
|
188
|
-
`).map((u)=>
|
|
189
|
-
`)}var
|
|
190
|
-
`),
|
|
191
|
-
`?(z&&(u+=
|
|
192
|
-
`&&(U&&O&&(u+=
|
|
193
|
-
`);O.push(Z),
|
|
194
|
-
`:""}${
|
|
195
|
-
`,z=this.value?I:_;switch(this.state){case"submit":{let g=u?`${b("gray"
|
|
196
|
-
${b("gray"
|
|
197
|
-
${b("cyan"
|
|
198
|
-
`:` ${b("dim","/")} `}${this.value?`${b("dim",
|
|
188
|
+
`).map((u)=>JS(u,I,_)).join(`
|
|
189
|
+
`)}var iI,bq,kF=()=>process.env.CI==="true",q$=($,I)=>bq?$:I,yF,NH,QH,cu,iF,$$,j6,Am,jm,Aq,du,lF,zH,gH,Fm,JH,mF,rF,nF,hF,Sm,dF,cF,pF,oF,pu=($)=>{switch($){case"initial":case"active":return b("cyan",yF);case"cancel":return b("red",NH);case"error":return b("yellow",QH);case"submit":return b("green",cu)}},vH=($)=>{switch($){case"initial":case"active":return b("cyan",$$);case"cancel":return b("red",$$);case"error":return b("yellow",$$);case"submit":return b("green",$$)}},tF=($)=>$===161||$===164||$===167||$===168||$===170||$===173||$===174||$>=176&&$<=180||$>=182&&$<=186||$>=188&&$<=191||$===198||$===208||$===215||$===216||$>=222&&$<=225||$===230||$>=232&&$<=234||$===236||$===237||$===240||$===242||$===243||$>=247&&$<=250||$===252||$===254||$===257||$===273||$===275||$===283||$===294||$===295||$===299||$>=305&&$<=307||$===312||$>=319&&$<=322||$===324||$>=328&&$<=331||$===333||$===338||$===339||$===358||$===359||$===363||$===462||$===464||$===466||$===468||$===470||$===472||$===474||$===476||$===593||$===609||$===708||$===711||$>=713&&$<=715||$===717||$===720||$>=728&&$<=731||$===733||$===735||$>=768&&$<=879||$>=913&&$<=929||$>=931&&$<=937||$>=945&&$<=961||$>=963&&$<=969||$===1025||$>=1040&&$<=1103||$===1105||$===8208||$>=8211&&$<=8214||$===8216||$===8217||$===8220||$===8221||$>=8224&&$<=8226||$>=8228&&$<=8231||$===8240||$===8242||$===8243||$===8245||$===8251||$===8254||$===8308||$===8319||$>=8321&&$<=8324||$===8364||$===8451||$===8453||$===8457||$===8467||$===8470||$===8481||$===8482||$===8486||$===8491||$===8531||$===8532||$>=8539&&$<=8542||$>=8544&&$<=8555||$>=8560&&$<=8569||$===8585||$>=8592&&$<=8601||$===8632||$===8633||$===8658||$===8660||$===8679||$===8704||$===8706||$===8707||$===8711||$===8712||$===8715||$===8719||$===8721||$===8725||$===8730||$>=8733&&$<=8736||$===8739||$===8741||$>=8743&&$<=8748||$===8750||$>=8756&&$<=8759||$===8764||$===8765||$===8776||$===8780||$===8786||$===8800||$===8801||$>=8804&&$<=8807||$===8810||$===8811||$===8814||$===8815||$===8834||$===8835||$===8838||$===8839||$===8853||$===8857||$===8869||$===8895||$===8978||$>=9312&&$<=9449||$>=9451&&$<=9547||$>=9552&&$<=9587||$>=9600&&$<=9615||$>=9618&&$<=9621||$===9632||$===9633||$>=9635&&$<=9641||$===9650||$===9651||$===9654||$===9655||$===9660||$===9661||$===9664||$===9665||$>=9670&&$<=9672||$===9675||$>=9678&&$<=9681||$>=9698&&$<=9701||$===9711||$===9733||$===9734||$===9737||$===9742||$===9743||$===9756||$===9758||$===9792||$===9794||$===9824||$===9825||$>=9827&&$<=9829||$>=9831&&$<=9834||$===9836||$===9837||$===9839||$===9886||$===9887||$===9919||$>=9926&&$<=9933||$>=9935&&$<=9939||$>=9941&&$<=9953||$===9955||$===9960||$===9961||$>=9963&&$<=9969||$===9972||$>=9974&&$<=9977||$===9979||$===9980||$===9982||$===9983||$===10045||$>=10102&&$<=10111||$>=11094&&$<=11097||$>=12872&&$<=12879||$>=57344&&$<=63743||$>=65024&&$<=65039||$===65533||$>=127232&&$<=127242||$>=127248&&$<=127277||$>=127280&&$<=127337||$>=127344&&$<=127373||$===127375||$===127376||$>=127387&&$<=127404||$>=917760&&$<=917999||$>=983040&&$<=1048573||$>=1048576&&$<=1114109,aF=($)=>$===12288||$>=65281&&$<=65376||$>=65504&&$<=65510,eF=($)=>$>=4352&&$<=4447||$===8986||$===8987||$===9001||$===9002||$>=9193&&$<=9196||$===9200||$===9203||$===9725||$===9726||$===9748||$===9749||$>=9800&&$<=9811||$===9855||$===9875||$===9889||$===9898||$===9899||$===9917||$===9918||$===9924||$===9925||$===9934||$===9940||$===9962||$===9970||$===9971||$===9973||$===9978||$===9981||$===9989||$===9994||$===9995||$===10024||$===10060||$===10062||$>=10067&&$<=10069||$===10071||$>=10133&&$<=10135||$===10160||$===10175||$===11035||$===11036||$===11088||$===11093||$>=11904&&$<=11929||$>=11931&&$<=12019||$>=12032&&$<=12245||$>=12272&&$<=12287||$>=12289&&$<=12350||$>=12353&&$<=12438||$>=12441&&$<=12543||$>=12549&&$<=12591||$>=12593&&$<=12686||$>=12688&&$<=12771||$>=12783&&$<=12830||$>=12832&&$<=12871||$>=12880&&$<=19903||$>=19968&&$<=42124||$>=42128&&$<=42182||$>=43360&&$<=43388||$>=44032&&$<=55203||$>=63744&&$<=64255||$>=65040&&$<=65049||$>=65072&&$<=65106||$>=65108&&$<=65126||$>=65128&&$<=65131||$>=94176&&$<=94180||$===94192||$===94193||$>=94208&&$<=100343||$>=100352&&$<=101589||$>=101632&&$<=101640||$>=110576&&$<=110579||$>=110581&&$<=110587||$===110589||$===110590||$>=110592&&$<=110882||$===110898||$>=110928&&$<=110930||$===110933||$>=110948&&$<=110951||$>=110960&&$<=111355||$===126980||$===127183||$===127374||$>=127377&&$<=127386||$>=127488&&$<=127490||$>=127504&&$<=127547||$>=127552&&$<=127560||$===127568||$===127569||$>=127584&&$<=127589||$>=127744&&$<=127776||$>=127789&&$<=127797||$>=127799&&$<=127868||$>=127870&&$<=127891||$>=127904&&$<=127946||$>=127951&&$<=127955||$>=127968&&$<=127984||$===127988||$>=127992&&$<=128062||$===128064||$>=128066&&$<=128252||$>=128255&&$<=128317||$>=128331&&$<=128334||$>=128336&&$<=128359||$===128378||$===128405||$===128406||$===128420||$>=128507&&$<=128591||$>=128640&&$<=128709||$===128716||$>=128720&&$<=128722||$>=128725&&$<=128727||$>=128732&&$<=128735||$===128747||$===128748||$>=128756&&$<=128764||$>=128992&&$<=129003||$===129008||$>=129292&&$<=129338||$>=129340&&$<=129349||$>=129351&&$<=129535||$>=129648&&$<=129660||$>=129664&&$<=129672||$>=129680&&$<=129725||$>=129727&&$<=129733||$>=129742&&$<=129755||$>=129760&&$<=129768||$>=129776&&$<=129784||$>=131072&&$<=196605||$>=196608&&$<=262141,Zq,mu,ru,Wq,nu,sF,$S,HH=($,I={},_={})=>{let u=I.limit??1/0,U=I.ellipsis??"",z=I?.ellipsisWidth??(U?HH(U,$S,_).width:0),g=_.ansiWidth??0,J=_.controlWidth??0,G=_.tabWidth??8,q=_.ambiguousWidth??1,N=_.emojiWidth??2,X=_.fullWidthWidth??2,Q=_.regularWidth??1,H=_.wideWidth??2,Y=0,v=0,O=$.length,T=0,L=!1,V=O,R=Math.max(0,u-z),M=0,Z=0,K=0,D=0;$:for(;;){if(Z>M||v>=O&&v>Y){let S=$.slice(M,Z)||$.slice(Y,v);T=0;for(let C of S.replaceAll(sF,"")){let x=C.codePointAt(0)||0;if(aF(x)?D=X:eF(x)?D=H:q!==Q&&tF(x)?D=q:D=Q,K+D>R&&(V=Math.min(V,Math.max(M,Y)+T)),K+D>u){L=!0;break $}T+=C.length,K+=D}M=Z=0}if(v>=O)break;if(nu.lastIndex=v,nu.test($)){if(T=nu.lastIndex-v,D=T*Q,K+D>R&&(V=Math.min(V,v+Math.floor((R-K)/Q))),K+D>u){L=!0;break}K+=D,M=Y,Z=v,v=Y=nu.lastIndex;continue}if(Zq.lastIndex=v,Zq.test($)){if(K+g>R&&(V=Math.min(V,v)),K+g>u){L=!0;break}K+=g,M=Y,Z=v,v=Y=Zq.lastIndex;continue}if(mu.lastIndex=v,mu.test($)){if(T=mu.lastIndex-v,D=T*J,K+D>R&&(V=Math.min(V,v+Math.floor((R-K)/J))),K+D>u){L=!0;break}K+=D,M=Y,Z=v,v=Y=mu.lastIndex;continue}if(ru.lastIndex=v,ru.test($)){if(T=ru.lastIndex-v,D=T*G,K+D>R&&(V=Math.min(V,v+Math.floor((R-K)/G))),K+D>u){L=!0;break}K+=D,M=Y,Z=v,v=Y=ru.lastIndex;continue}if(Wq.lastIndex=v,Wq.test($)){if(K+N>R&&(V=Math.min(V,v)),K+N>u){L=!0;break}K+=N,M=Y,Z=v,v=Y=Wq.lastIndex;continue}v+=1}return{width:L?R:K,index:L?V:O,truncated:L,ellipsed:L&&u>=z}},IS,i4=($,I={})=>HH($,IS,I).width,ou="\x1B",YH="",US=39,Fq="\x07",OH="[",_S="]",TH="m",Sq,GH,uS=($)=>{if($>=30&&$<=37||$>=90&&$<=97)return 39;if($>=40&&$<=47||$>=100&&$<=107)return 49;if($===1||$===2)return 22;if($===3)return 23;if($===4)return 24;if($===7)return 27;if($===8)return 28;if($===9)return 29;if($===0)return 0},qH=($)=>`${ou}${OH}${$}${TH}`,XH=($)=>`${ou}${Sq}${$}${Fq}`,zS=($)=>$.map((I)=>i4(I)),Pq=($,I,_)=>{let u=I[Symbol.iterator](),U=!1,z=!1,g=$.at(-1),J=g===void 0?0:i4(g),G=u.next(),q=u.next(),N=0;for(;!G.done;){let X=G.value,Q=i4(X);J+Q<=_?$[$.length-1]+=X:($.push(X),J=0),(X===ou||X===YH)&&(U=!0,z=I.startsWith(Sq,N+1)),U?z?X===Fq&&(U=!1,z=!1):X===TH&&(U=!1):(J+=Q,J===_&&!q.done&&($.push(""),J=0)),G=q,q=u.next(),N+=X.length}g=$.at(-1),!J&&g!==void 0&&g.length>0&&$.length>1&&($[$.length-2]+=$.pop())},gS=($)=>{let I=$.split(" "),_=I.length;for(;_>0&&!(i4(I[_-1])>0);)_--;return _===I.length?$:I.slice(0,_).join(" ")+I.slice(_).join("")},JS=($,I,_={})=>{if(_.trim!==!1&&$.trim()==="")return"";let u="",U,z,g=$.split(" "),J=zS(g),G=[""];for(let[Y,v]of g.entries()){_.trim!==!1&&(G[G.length-1]=(G.at(-1)??"").trimStart());let O=i4(G.at(-1)??"");if(Y!==0&&(O>=I&&(_.wordWrap===!1||_.trim===!1)&&(G.push(""),O=0),(O>0||_.trim===!1)&&(G[G.length-1]+=" ",O++)),_.hard&&J[Y]>I){let T=I-O,L=1+Math.floor((J[Y]-T-1)/I);Math.floor((J[Y]-1)/I)<L&&G.push(""),Pq(G,v,I);continue}if(O+J[Y]>I&&O>0&&J[Y]>0){if(_.wordWrap===!1&&O<I){Pq(G,v,I);continue}G.push("")}if(O+J[Y]>I&&_.wordWrap===!1){Pq(G,v,I);continue}G[G.length-1]+=v}_.trim!==!1&&(G=G.map((Y)=>gS(Y)));let q=G.join(`
|
|
190
|
+
`),N=q[Symbol.iterator](),X=N.next(),Q=N.next(),H=0;for(;!X.done;){let Y=X.value,v=Q.value;if(u+=Y,Y===ou||Y===YH){GH.lastIndex=H+1;let T=GH.exec(q)?.groups;if(T?.code!==void 0){let L=Number.parseFloat(T.code);U=L===US?void 0:L}else T?.uri!==void 0&&(z=T.uri.length===0?void 0:T.uri)}let O=U?uS(U):void 0;v===`
|
|
191
|
+
`?(z&&(u+=XH("")),U&&O&&(u+=qH(O))):Y===`
|
|
192
|
+
`&&(U&&O&&(u+=qH(U)),z&&(u+=XH(z))),H+=Y.length,X=Q,Q=N.next()}return u},GS=($,I,_,u,U)=>{let z=I,g=0;for(let J=_;J<u;J++){let G=$[J];if(z=z-G.length,g++,z<=U)break}return{lineCount:z,removals:g}},jq=({cursor:$,options:I,style:_,output:u=process.stdout,maxItems:U=Number.POSITIVE_INFINITY,columnPadding:z=0,rowPadding:g=4})=>{let J=kI(u)-z,G=Mq(u),q=b("dim","..."),N=Math.max(G-g,0),X=Math.max(Math.min(U,N),5),Q=0;$>=X-3&&(Q=Math.max(Math.min($-X+3,I.length-X),0));let H=X<I.length&&Q>0,Y=X<I.length&&Q+X<I.length,v=Math.min(Q+X,I.length),O=[],T=0;H&&T++,Y&&T++;let L=Q+(H?1:0),V=v-(Y?1:0);for(let M=L;M<V;M++){let Z=lI(_(I[M],M===$),J,{hard:!0,trim:!1}).split(`
|
|
193
|
+
`);O.push(Z),T+=Z.length}if(T>N){let M=0,Z=0,K=T,D=$-L,S=(C,x)=>GS(O,K,C,x,N);H?({lineCount:K,removals:M}=S(0,D),K>N&&({lineCount:K,removals:Z}=S(D+1,O.length))):({lineCount:K,removals:Z}=S(D+1,O.length),K>N&&({lineCount:K,removals:M}=S(0,D))),M>0&&(H=!0,O.splice(0,M)),Z>0&&(Y=!0,O.splice(O.length-Z,Z))}let R=[];H&&R.push(q);for(let M of O)for(let Z of M)R.push(Z);return Y&&R.push(q),R},b$=($)=>{let I=$.active??"Yes",_=$.inactive??"No";return new Kq({active:I,inactive:_,signal:$.signal,input:$.input,output:$.output,initialValue:$.initialValue??!0,render(){let u=$.withGuide??w$.withGuide,U=`${u?`${b("gray",$$)}
|
|
194
|
+
`:""}${pu(this.state)} ${$.message}
|
|
195
|
+
`,z=this.value?I:_;switch(this.state){case"submit":{let g=u?`${b("gray",$$)} `:"";return`${U}${g}${b("dim",z)}`}case"cancel":{let g=u?`${b("gray",$$)} `:"";return`${U}${g}${b(["strikethrough","dim"],z)}${u?`
|
|
196
|
+
${b("gray",$$)}`:""}`}default:{let g=u?`${b("cyan",$$)} `:"",J=u?b("cyan",j6):"";return`${U}${g}${this.value?`${b("green",Aq)} ${I}`:`${b("dim",du)} ${b("dim",I)}`}${$.vertical?u?`
|
|
197
|
+
${b("cyan",$$)} `:`
|
|
198
|
+
`:` ${b("dim","/")} `}${this.value?`${b("dim",du)} ${b("dim",_)}`:`${b("green",Aq)} ${_}`}
|
|
199
199
|
${J}
|
|
200
|
-
`}}}}).prompt()},
|
|
200
|
+
`}}}}).prompt()},t,r$=($="",I)=>{let _=I?.output??process.stdout,u=I?.withGuide??w$.withGuide?`${b("gray",j6)} `:"";_.write(`${u}${b("red",$)}
|
|
201
201
|
|
|
202
|
-
`)},
|
|
203
|
-
`)},
|
|
204
|
-
${b("gray",
|
|
202
|
+
`)},B$=($="",I)=>{let _=I?.output??process.stdout,u=I?.withGuide??w$.withGuide?`${b("gray",iF)} `:"";_.write(`${u}${$}
|
|
203
|
+
`)},p=($="",I)=>{let _=I?.output??process.stdout,u=I?.withGuide??w$.withGuide?`${b("gray",$$)}
|
|
204
|
+
${b("gray",j6)} `:"";_.write(`${u}${$}
|
|
205
205
|
|
|
206
|
-
`)},
|
|
206
|
+
`)},yI=($,I)=>$.split(`
|
|
207
207
|
`).map((_)=>I(_)).join(`
|
|
208
|
-
`),
|
|
209
|
-
${b("reset",b("dim",`Press ${b(["gray","bgWhite","inverse"]," space ")} to select, ${b("gray",b("bgWhite",b("inverse"," enter ")))} to submit`))}`},render(){let u=
|
|
208
|
+
`),mI=($)=>{let I=(u,U)=>{let z=u.label??String(u.value);return U==="disabled"?`${b("gray",gH)} ${yI(z,(g)=>b(["strikethrough","gray"],g))}${u.hint?` ${b("dim",`(${u.hint??"disabled"})`)}`:""}`:U==="active"?`${b("cyan",lF)} ${z}${u.hint?` ${b("dim",`(${u.hint})`)}`:""}`:U==="selected"?`${b("green",zH)} ${yI(z,(g)=>b("dim",g))}${u.hint?` ${b("dim",`(${u.hint})`)}`:""}`:U==="cancelled"?`${yI(z,(g)=>b(["strikethrough","dim"],g))}`:U==="active-selected"?`${b("green",zH)} ${z}${u.hint?` ${b("dim",`(${u.hint})`)}`:""}`:U==="submitted"?`${yI(z,(g)=>b("dim",g))}`:`${b("dim",gH)} ${yI(z,(g)=>b("dim",g))}`},_=$.required??!0;return new uH({options:$.options,signal:$.signal,input:$.input,output:$.output,initialValues:$.initialValues,required:_,cursorAt:$.cursorAt,validate(u){if(_&&(u===void 0||u.length===0))return`Please select at least one option.
|
|
209
|
+
${b("reset",b("dim",`Press ${b(["gray","bgWhite","inverse"]," space ")} to select, ${b("gray",b("bgWhite",b("inverse"," enter ")))} to submit`))}`},render(){let u=J1($.output,$.message,`${vH(this.state)} `,`${pu(this.state)} `),U=`${b("gray",$$)}
|
|
210
210
|
${u}
|
|
211
|
-
`,z=this.value??[],g=(J,G)=>{if(J.disabled)return I(J,"disabled");let
|
|
212
|
-
${b("gray"
|
|
213
|
-
`).map((
|
|
214
|
-
`),
|
|
215
|
-
`).length,
|
|
216
|
-
`).length+1;return`${U}${J}${
|
|
211
|
+
`,z=this.value??[],g=(J,G)=>{if(J.disabled)return I(J,"disabled");let q=z.includes(J.value);return G&&q?I(J,"active-selected"):q?I(J,"selected"):I(J,G?"active":"inactive")};switch(this.state){case"submit":{let J=this.options.filter(({value:q})=>z.includes(q)).map((q)=>I(q,"submitted")).join(b("dim",", "))||b("dim","none"),G=J1($.output,J,`${b("gray",$$)} `);return`${U}${G}`}case"cancel":{let J=this.options.filter(({value:q})=>z.includes(q)).map((q)=>I(q,"cancelled")).join(b("dim",", "));if(J.trim()==="")return`${U}${b("gray",$$)}`;let G=J1($.output,J,`${b("gray",$$)} `);return`${U}${G}
|
|
212
|
+
${b("gray",$$)}`}case"error":{let J=`${b("yellow",$$)} `,G=this.error.split(`
|
|
213
|
+
`).map((X,Q)=>Q===0?`${b("yellow",j6)} ${b("yellow",X)}`:` ${X}`).join(`
|
|
214
|
+
`),q=U.split(`
|
|
215
|
+
`).length,N=G.split(`
|
|
216
|
+
`).length+1;return`${U}${J}${jq({output:$.output,options:this.options,cursor:this.cursor,maxItems:$.maxItems,columnPadding:J.length,rowPadding:q+N,style:g}).join(`
|
|
217
217
|
${J}`)}
|
|
218
218
|
${G}
|
|
219
|
-
`}default:{let J=`${b("cyan"
|
|
220
|
-
`).length;return`${U}${J}${
|
|
219
|
+
`}default:{let J=`${b("cyan",$$)} `,G=U.split(`
|
|
220
|
+
`).length;return`${U}${J}${jq({output:$.output,options:this.options,cursor:this.cursor,maxItems:$.maxItems,columnPadding:J.length,rowPadding:G+2,style:g}).join(`
|
|
221
221
|
${J}`)}
|
|
222
|
-
${b("cyan",
|
|
223
|
-
`}}}}).prompt()},
|
|
224
|
-
`),z=U.reduce((G,
|
|
225
|
-
`).map(z),""],J=
|
|
226
|
-
`),
|
|
227
|
-
`:"",
|
|
228
|
-
${
|
|
229
|
-
${b("gray",
|
|
230
|
-
`)},
|
|
231
|
-
`);let
|
|
232
|
-
`);
|
|
233
|
-
`);let T$=0,
|
|
234
|
-
`):_.write(`${
|
|
235
|
-
`)),
|
|
222
|
+
${b("cyan",j6)}
|
|
223
|
+
`}}}}).prompt()},qS=($)=>b("dim",$),XS=($,I,_)=>{let u={hard:!0,trim:!1},U=lI($,I,u).split(`
|
|
224
|
+
`),z=U.reduce((G,q)=>Math.max(i4(q),G),0),g=U.map(_).reduce((G,q)=>Math.max(i4(q),G),0),J=I-(g-z);return lI($,J,u)},y=($="",I="",_)=>{let u=_?.output??H4.stdout,U=_?.withGuide??w$.withGuide,z=_?.format??qS,g=["",...XS($,kI(u)-6,z).split(`
|
|
225
|
+
`).map(z),""],J=i4(I),G=Math.max(g.reduce((Q,H)=>{let Y=i4(H);return Y>Q?Y:Q},0),J)+2,q=g.map((Q)=>`${b("gray",$$)} ${Q}${" ".repeat(G-i4(Q))}${b("gray",$$)}`).join(`
|
|
226
|
+
`),N=U?`${b("gray",$$)}
|
|
227
|
+
`:"",X=U?rF:hF;u.write(`${N}${b("green",cu)} ${b("reset",I)} ${b("gray",JH.repeat(Math.max(G-J-1,1))+mF)}
|
|
228
|
+
${q}
|
|
229
|
+
${b("gray",X+JH.repeat(G+2)+nF)}
|
|
230
|
+
`)},NS=($)=>b("magenta",$),$4=({indicator:$="dots",onCancel:I,output:_=process.stdout,cancelMessage:u,errorMessage:U,frames:z=bq?["◒","◐","◓","◑"]:["•","o","O","0"],delay:g=bq?80:120,signal:J,...G}={})=>{let q=kF(),N,X,Q=!1,H=!1,Y="",v,O=performance.now(),T=kI(_),L=G?.styleFrame??NS,V=(c)=>{let T$=c>1?U??w$.messages.error:u??w$.messages.cancel;H=c===1,Q&&(e(T$,c),H&&typeof I=="function"&&I())},R=()=>V(2),M=()=>V(1),Z=()=>{process.on("uncaughtExceptionMonitor",R),process.on("unhandledRejection",R),process.on("SIGINT",M),process.on("SIGTERM",M),process.on("exit",V),J&&J.addEventListener("abort",M)},K=()=>{process.removeListener("uncaughtExceptionMonitor",R),process.removeListener("unhandledRejection",R),process.removeListener("SIGINT",M),process.removeListener("SIGTERM",M),process.removeListener("exit",V),J&&J.removeEventListener("abort",M)},D=()=>{if(v===void 0)return;q&&_.write(`
|
|
231
|
+
`);let c=lI(v,T,{hard:!0,trim:!1}).split(`
|
|
232
|
+
`);c.length>1&&_.write(iI.cursor.up(c.length-1)),_.write(iI.cursor.to(0)),_.write(iI.erase.down())},S=(c)=>c.replace(/\.+$/,""),C=(c)=>{let T$=(performance.now()-c)/1000,p$=Math.floor(T$/60),o$=Math.floor(T$%60);return p$>0?`[${p$}m ${o$}s]`:`[${o$}s]`},x=G.withGuide??w$.withGuide,P=(c="")=>{Q=!0,N=IH({output:_}),Y=S(c),O=performance.now(),x&&_.write(`${b("gray",$$)}
|
|
233
|
+
`);let T$=0,p$=0;Z(),X=setInterval(()=>{if(q&&Y===v)return;D(),v=Y;let o$=L(z[T$]),F4;if(q)F4=`${o$} ${Y}...`;else if($==="timer")F4=`${o$} ${Y} ${C(O)}`;else{let X6=".".repeat(Math.floor(p$)).slice(0,3);F4=`${o$} ${Y}${X6}`}let l2=lI(F4,T,{hard:!0,trim:!1});_.write(l2),T$=T$+1<z.length?T$+1:0,p$=p$<4?p$+0.125:0},g)},e=(c="",T$=0,p$=!1)=>{if(!Q)return;Q=!1,clearInterval(X),D();let o$=T$===0?b("green",cu):T$===1?b("red",NH):b("red",QH);Y=c??Y,p$||($==="timer"?_.write(`${o$} ${Y} ${C(O)}
|
|
234
|
+
`):_.write(`${o$} ${Y}
|
|
235
|
+
`)),K(),N()};return{start:P,stop:(c="")=>e(c,0),message:(c="")=>{Y=S(c??Y)},cancel:(c="")=>e(c,1),error:(c="")=>e(c,2),clear:()=>e("",0,!0),get isCancelled(){return H}}},wm,hu=($,I)=>$.includes(`
|
|
236
236
|
`)?$.split(`
|
|
237
237
|
`).map((_)=>I(_)).join(`
|
|
238
|
-
`):I($),
|
|
238
|
+
`):I($),F6=($)=>{let I=(_,u)=>{let U=_.label??String(_.value);switch(u){case"disabled":return`${b("gray",du)} ${hu(U,(z)=>b("gray",z))}${_.hint?` ${b("dim",`(${_.hint??"disabled"})`)}`:""}`;case"selected":return`${hu(U,(z)=>b("dim",z))}`;case"active":return`${b("green",Aq)} ${U}${_.hint?` ${b("dim",`(${_.hint})`)}`:""}`;case"cancelled":return`${hu(U,(z)=>b(["strikethrough","dim"],z))}`;default:return`${b("dim",du)} ${hu(U,(z)=>b("dim",z))}`}};return new Vq({options:$.options,signal:$.signal,input:$.input,output:$.output,initialValue:$.initialValue,render(){let _=$.withGuide??w$.withGuide,u=`${pu(this.state)} `,U=`${vH(this.state)} `,z=J1($.output,$.message,U,u),g=`${_?`${b("gray",$$)}
|
|
239
239
|
`:""}${z}
|
|
240
|
-
`;switch(this.state){case"submit":{let J=_?`${b("gray"
|
|
241
|
-
${b("gray"
|
|
242
|
-
`).length,
|
|
240
|
+
`;switch(this.state){case"submit":{let J=_?`${b("gray",$$)} `:"",G=J1($.output,I(this.options[this.cursor],"selected"),J);return`${g}${G}`}case"cancel":{let J=_?`${b("gray",$$)} `:"",G=J1($.output,I(this.options[this.cursor],"cancelled"),J);return`${g}${G}${_?`
|
|
241
|
+
${b("gray",$$)}`:""}`}default:{let J=_?`${b("cyan",$$)} `:"",G=_?b("cyan",j6):"",q=g.split(`
|
|
242
|
+
`).length,N=_?2:1;return`${g}${J}${jq({output:$.output,cursor:this.cursor,options:this.options,maxItems:$.maxItems,columnPadding:J.length,rowPadding:q+N,style:(X,Q)=>I(X,X.disabled?"disabled":Q?"active":"inactive")}).join(`
|
|
243
243
|
${J}`)}
|
|
244
244
|
${G}
|
|
245
|
-
`}}}}).prompt()},
|
|
246
|
-
`:""}${
|
|
247
|
-
`,u=$.placeholder?b("inverse",$.placeholder[0])+b("dim",$.placeholder.slice(1)):b(["inverse","hidden"],"_"),U=this.userInput?this.userInputWithCursor:u,z=this.value??"";switch(this.state){case"error":{let g=this.error?` ${b("yellow",this.error)}`:"",J=I?`${b("yellow"
|
|
245
|
+
`}}}}).prompt()},Em,tu=($)=>new Rq({validate:$.validate,placeholder:$.placeholder,defaultValue:$.defaultValue,initialValue:$.initialValue,output:$.output,signal:$.signal,input:$.input,render(){let I=$?.withGuide??w$.withGuide,_=`${`${I?`${b("gray",$$)}
|
|
246
|
+
`:""}${pu(this.state)} `}${$.message}
|
|
247
|
+
`,u=$.placeholder?b("inverse",$.placeholder[0])+b("dim",$.placeholder.slice(1)):b(["inverse","hidden"],"_"),U=this.userInput?this.userInputWithCursor:u,z=this.value??"";switch(this.state){case"error":{let g=this.error?` ${b("yellow",this.error)}`:"",J=I?`${b("yellow",$$)} `:"",G=I?b("yellow",j6):"";return`${_.trim()}
|
|
248
248
|
${J}${U}
|
|
249
249
|
${G}${g}
|
|
250
|
-
`}case"submit":{let g=z?` ${b("dim",z)}`:"",J=I?b("gray"
|
|
251
|
-
${J}`:""}`}default:{let g=I?`${b("cyan"
|
|
250
|
+
`}case"submit":{let g=z?` ${b("dim",z)}`:"",J=I?b("gray",$$):"";return`${_}${J}${g}`}case"cancel":{let g=z?` ${b(["strikethrough","dim"],z)}`:"",J=I?b("gray",$$):"";return`${_}${J}${g}${z.trim()?`
|
|
251
|
+
${J}`:""}`}default:{let g=I?`${b("cyan",$$)} `:"",J=I?b("cyan",j6):"";return`${_}${g}${U}
|
|
252
252
|
${J}
|
|
253
|
-
`}}}}).prompt();var I4=
|
|
254
|
-
`);if(
|
|
253
|
+
`}}}}).prompt();var I4=b0(()=>{Lq();Lq();iI=v$(qq(),1);bq=xF(),yF=q$("◆","*"),NH=q$("■","x"),QH=q$("▲","x"),cu=q$("◇","o"),iF=q$("┌","T"),$$=q$("│","|"),j6=q$("└","—"),Am=q$("┐","T"),jm=q$("┘","—"),Aq=q$("●",">"),du=q$("○"," "),lF=q$("◻","[•]"),zH=q$("◼","[+]"),gH=q$("◻","[ ]"),Fm=q$("▪","•"),JH=q$("─","-"),mF=q$("╮","+"),rF=q$("├","+"),nF=q$("╯","+"),hF=q$("╰","+"),Sm=q$("╭","+"),dF=q$("●","•"),cF=q$("◆","*"),pF=q$("▲","!"),oF=q$("■","x"),Zq=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,mu=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,ru=/\t{1,1000}/y,Wq=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,nu=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,sF=/\p{M}+/gu,$S={limit:1/0,ellipsis:""},IS={limit:1/0,ellipsis:"",ellipsisWidth:0},Sq=`${_S}8;;`,GH=new RegExp(`(?:\\${OH}(?<code>\\d+)m|\\${Sq}(?<uri>.*)${Fq})`,"y");t={message:($=[],{symbol:I=b("gray",$$),secondarySymbol:_=b("gray",$$),output:u=process.stdout,spacing:U=1,withGuide:z}={})=>{let g=[],J=z??w$.withGuide,G=J?_:"",q=J?`${I} `:"",N=J?`${_} `:"";for(let Q=0;Q<U;Q++)g.push(G);let X=Array.isArray($)?$:$.split(`
|
|
254
|
+
`);if(X.length>0){let[Q,...H]=X;Q.length>0?g.push(`${q}${Q}`):g.push(J?I:"");for(let Y of H)Y.length>0?g.push(`${N}${Y}`):g.push(J?_:"")}u.write(`${g.join(`
|
|
255
255
|
`)}
|
|
256
|
-
`)},info:($,I)=>{
|
|
257
|
-
`),u=_[_.length-1]||"",U=u.match(/(\d+) files? changed/),z=u.match(/(\d+) insertions?\(\+\)/),g=u.match(/(\d+) deletions?\(-\)/);return{filesChanged:U?.[1]?parseInt(U[1],10):0,linesAdded:z?.[1]?parseInt(z[1],10):0,linesRemoved:g?.[1]?parseInt(g[1],10):0}}catch{return{filesChanged:0,linesAdded:0,linesRemoved:0}}}function
|
|
258
|
-
`).filter(Boolean)}catch{return[]}}function
|
|
259
|
-
`).filter(Boolean).slice(0,10)}catch{return[]}}function
|
|
260
|
-
`).filter(Boolean)}catch{return[]}}function
|
|
261
|
-
`).filter(Boolean)}catch{return
|
|
262
|
-
`),"Previous Session");let U=await
|
|
263
|
-
`);y(
|
|
264
|
-
`),"Preview");let
|
|
256
|
+
`)},info:($,I)=>{t.message($,{...I,symbol:b("blue",dF)})},success:($,I)=>{t.message($,{...I,symbol:b("green",cF)})},step:($,I)=>{t.message($,{...I,symbol:b("green",cu)})},warn:($,I)=>{t.message($,{...I,symbol:b("yellow",pF)})},warning:($,I)=>{t.warn($,I)},error:($,I)=>{t.message($,{...I,symbol:b("red",oF)})}},wm={light:q$("─","-"),heavy:q$("━","="),block:q$("█","#")},Em=`${b("gray",$$)} `});import{execSync as O1}from"node:child_process";function O2($){try{let _=O1("git diff --stat HEAD~10 2>/dev/null || git diff --stat",{cwd:$,encoding:"utf-8",stdio:["pipe","pipe","ignore"]}).trim().split(`
|
|
257
|
+
`),u=_[_.length-1]||"",U=u.match(/(\d+) files? changed/),z=u.match(/(\d+) insertions?\(\+\)/),g=u.match(/(\d+) deletions?\(-\)/);return{filesChanged:U?.[1]?parseInt(U[1],10):0,linesAdded:z?.[1]?parseInt(z[1],10):0,linesRemoved:g?.[1]?parseInt(g[1],10):0}}catch{return{filesChanged:0,linesAdded:0,linesRemoved:0}}}function xY($,I=5){try{return O1(`git log --oneline -${I} 2>/dev/null`,{cwd:$,encoding:"utf-8",stdio:["pipe","pipe","ignore"]}).trim().split(`
|
|
258
|
+
`).filter(Boolean)}catch{return[]}}function NX($){try{return O1("git diff --name-only HEAD~5 2>/dev/null || git diff --name-only",{cwd:$,encoding:"utf-8",stdio:["pipe","pipe","ignore"]}).trim().split(`
|
|
259
|
+
`).filter(Boolean).slice(0,10)}catch{return[]}}function fY($,I=10){try{return O1(`git log --format="%s" -${I} 2>/dev/null`,{cwd:$,encoding:"utf-8",stdio:["pipe","pipe","ignore"]}).trim().split(`
|
|
260
|
+
`).filter(Boolean)}catch{return[]}}function kY($){let I={},_=/^(feat|fix|docs|style|refactor|test|chore|build|ci|perf)(\(.+\))?:/;for(let u of $){let U=u.match(_);if(U){let z=U[1];if(z)I[z]=(I[z]||0)+1}}return I}function yY($){try{let I=`${$}/.serena/retrospectives`,_=O1(`ls -t "${I}"/*.json 2>/dev/null | head -1`,{encoding:"utf-8",stdio:["pipe","pipe","ignore"]}).trim();if(!_)return null;let u=O1(`cat "${_}"`,{encoding:"utf-8",stdio:["pipe","pipe","ignore"]});return JSON.parse(u).date||null}catch{return null}}function iY($,I){if(!I)return fY($,10);try{let u=new Date(I).toISOString().split("T")[0];return O1(`git log --format="%s" --since="${u}" 2>/dev/null`,{cwd:$,encoding:"utf-8",stdio:["pipe","pipe","ignore"]}).trim().split(`
|
|
261
|
+
`).filter(Boolean)}catch{return fY($,10)}}var QX=()=>{};var rY={};S4(rY,{retro:()=>hw});import{existsSync as mY,mkdirSync as yw,readdirSync as iw,readFileSync as lw,writeFileSync as mw}from"node:fs";import{join as vX}from"node:path";function HX($){return vX($,".serena","retrospectives")}function rw($){let I=HX($);if(!mY(I))return[];try{return iw(I).filter((u)=>u.endsWith(".json")).sort().reverse().slice(0,10).map((u)=>JSON.parse(lw(vX(I,u),"utf-8")))}catch{return[]}}function lY($,I){let _=HX($);if(!mY(_))yw(_,{recursive:!0});let u=`${I.date.replace(/[:.]/g,"-")}_${I.id}.json`;mw(vX(_,u),JSON.stringify(I,null,2),"utf-8")}function nw($){let I=yY($),_=iY($,I),u=kY(_),U=O2($),z=bv($),g=jv($,I||void 0),J=Object.entries(u).sort(([,X],[,Q])=>Q-X)[0],G="Development session";if(J){let[X]=J;G={feat:"Feature development",fix:"Bug fixes and improvements",refactor:"Code refactoring",docs:"Documentation updates",test:"Testing improvements",chore:"Maintenance tasks",build:"Build system updates",perf:"Performance improvements"}[X]||"Development session"}if(U.filesChanged>0)G+=` (${U.filesChanged} files, +${U.linesAdded}/-${U.linesRemoved})`;if(z.agents.length>0)G+=` with ${z.agents.join(", ")}`;let q=Fv(g);if(_.length>0&&q.length===0){if(u.refactor||u.perf)q.push("Code quality and performance improvements");if(u.test)q.push("Enhanced test coverage");if(u.fix)q.push("Issue resolution and stability improvements")}let N=[];if(z.inProgressTasks.length>0)N.push(...z.inProgressTasks.slice(0,3));if(_.length>0){let X=_[0]?.toLowerCase()||"";if(X.includes("wip")||X.includes("todo"))N.push("Complete work-in-progress items")}if(N.length===0)N.push("Continue development","Review and test changes");return{summary:G,learnings:q.slice(0,5),nextSteps:N.slice(0,5)}}async function hw(){let $=process.cwd(),I=HX($),_=rw($);console.clear(),B$(A$.default.bgMagenta(A$.default.white(" retro (interactive) ")));let u=_[0];if(u)y([A$.default.bold("Last Retrospective"),`Date: ${u.date}`,"",A$.default.bold("Summary:"),u.summary,"",A$.default.bold("Key Learnings:"),...u.keyLearnings.map((X)=>` - ${X}`),"",A$.default.bold("Next Steps:"),...u.nextSteps.map((X)=>` > ${X}`)].join(`
|
|
262
|
+
`),"Previous Session");let U=await F6({message:"What would you like to do?",options:[{value:"auto",label:"Auto-generate from git history",hint:"Analyze commits and agent activity"},{value:"manual",label:"Create manually",hint:"Write your own retrospective"},{value:"list",label:"View past retrospectives"},{value:"exit",label:"Exit"}]});if(_$(U)||U==="exit"){p(A$.default.dim("Goodbye!"));return}if(U==="list"){if(_.length===0)y(A$.default.yellow("No retrospectives found."),"History");else{let X=_.map((Q,H)=>`${H+1}. [${Q.date.split("T")[0]}] ${Q.summary.slice(0,50)}...`).join(`
|
|
263
|
+
`);y(X,`Past Retrospectives (${_.length})`)}p(A$.default.dim(`Stored in: ${I}`));return}if(U==="auto"){let{summary:X,learnings:Q,nextSteps:H}=nw($),Y=NX($);y([A$.default.bold("Auto-generated Content"),"",A$.default.bold("Summary:"),X,"",A$.default.bold("Key Learnings:"),...Q.map((T)=>` - ${T}`),"",A$.default.bold("Next Steps:"),...H.map((T)=>` > ${T}`)].join(`
|
|
264
|
+
`),"Preview");let v=await b$({message:"Save this retrospective?",initialValue:!0});if(_$(v)||!v){r$("Cancelled.");return}let O={id:Math.random().toString(36).slice(2,8),date:new Date().toISOString(),summary:X,keyLearnings:Q,filesChanged:Y,nextSteps:H};lY($,O),y(A$.default.green("Retrospective saved!"),"Done"),p(A$.default.dim(`Stored in: ${I}`));return}let z=xY($),g=NX($);if(z.length>0)y(z.join(`
|
|
265
265
|
`),"Recent Commits");if(g.length>0)y(g.join(`
|
|
266
|
-
`),"Changed Files");let J=await a2({message:"What did you accomplish in this session?",placeholder:"e.g., Implemented user authentication flow"});if(s(J)){s$("Cancelled.");return}let G=await a2({message:"Key learnings? (comma-separated)",placeholder:"e.g., JWT needs refresh token, bcrypt is slow"});if(s(G)){s$("Cancelled.");return}let v=await a2({message:"Next steps? (comma-separated)",placeholder:"e.g., Add password reset, Write tests"});if(s(v)){s$("Cancelled.");return}let X={id:Math.random().toString(36).slice(2,8),date:new Date().toISOString(),summary:J,keyLearnings:G.split(",").map((q)=>q.trim()).filter(Boolean),filesChanged:g,nextSteps:v.split(",").map((q)=>q.trim()).filter(Boolean)};iH($,X),y(A$.default.green("Retrospective saved!"),"Done"),o(A$.default.dim(`Stored in: ${I}`))}var A$;var mH=A0(()=>{I4();Yq();fI();A$=N$(b$(),1)});var u6=E((Kh,yO)=>{var xO=["nodebuffer","arraybuffer","fragments"],kO=typeof Blob<"u";if(kO)xO.push("blob");yO.exports={BINARY_TYPES:xO,CLOSE_TIMEOUT:30000,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:kO,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var oI=E((Vh,Su)=>{var{EMPTY_BUFFER:MC}=u6(),wq=Buffer[Symbol.species];function KC($,I){if($.length===0)return MC;if($.length===1)return $[0];let _=Buffer.allocUnsafe(I),u=0;for(let U=0;U<$.length;U++){let z=$[U];_.set(z,u),u+=z.length}if(u<I)return new wq(_.buffer,_.byteOffset,u);return _}function iO($,I,_,u,U){for(let z=0;z<U;z++)_[u+z]=$[z]^I[z&3]}function lO($,I){for(let _=0;_<$.length;_++)$[_]^=I[_&3]}function VC($){if($.length===$.buffer.byteLength)return $.buffer;return $.buffer.slice($.byteOffset,$.byteOffset+$.length)}function Eq($){if(Eq.readOnly=!0,Buffer.isBuffer($))return $;let I;if($ instanceof ArrayBuffer)I=new wq($);else if(ArrayBuffer.isView($))I=new wq($.buffer,$.byteOffset,$.byteLength);else I=Buffer.from($),Eq.readOnly=!1;return I}Su.exports={concat:KC,mask:iO,toArrayBuffer:VC,toBuffer:Eq,unmask:lO};if(!process.env.WS_NO_BUFFER_UTIL)try{let $=(()=>{throw new Error("Cannot require module "+"bufferutil");})();Su.exports.mask=function(I,_,u,U,z){if(z<48)iO(I,_,u,U,z);else $.mask(I,_,u,U,z)},Su.exports.unmask=function(I,_){if(I.length<32)lO(I,_);else $.unmask(I,_)}}catch($){}});var hO=E((Lh,nO)=>{var rO=Symbol("kDone"),Cq=Symbol("kRun");class mO{constructor($){this[rO]=()=>{this.pending--,this[Cq]()},this.concurrency=$||1/0,this.jobs=[],this.pending=0}add($){this.jobs.push($),this[Cq]()}[Cq](){if(this.pending===this.concurrency)return;if(this.jobs.length){let $=this.jobs.shift();this.pending++,$(this[rO])}}}nO.exports=mO});var aI=E((Rh,tO)=>{var tI=z$("zlib"),dO=oI(),LC=hO(),{kStatusCode:cO}=u6(),RC=Buffer[Symbol.species],ZC=Buffer.from([0,0,255,255]),Eu=Symbol("permessage-deflate"),z6=Symbol("total-length"),K0=Symbol("callback"),f6=Symbol("buffers"),V0=Symbol("error"),wu;class pO{constructor($,I,_){if(this._maxPayload=_|0,this._options=$||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!I,this._deflate=null,this._inflate=null,this.params=null,!wu){let u=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;wu=new LC(u)}}static get extensionName(){return"permessage-deflate"}offer(){let $={};if(this._options.serverNoContextTakeover)$.server_no_context_takeover=!0;if(this._options.clientNoContextTakeover)$.client_no_context_takeover=!0;if(this._options.serverMaxWindowBits)$.server_max_window_bits=this._options.serverMaxWindowBits;if(this._options.clientMaxWindowBits)$.client_max_window_bits=this._options.clientMaxWindowBits;else if(this._options.clientMaxWindowBits==null)$.client_max_window_bits=!0;return $}accept($){return $=this.normalizeParams($),this.params=this._isServer?this.acceptAsServer($):this.acceptAsClient($),this.params}cleanup(){if(this._inflate)this._inflate.close(),this._inflate=null;if(this._deflate){let $=this._deflate[K0];if(this._deflate.close(),this._deflate=null,$)$(Error("The deflate stream was closed while data was being processed"))}}acceptAsServer($){let I=this._options,_=$.find((u)=>{if(I.serverNoContextTakeover===!1&&u.server_no_context_takeover||u.server_max_window_bits&&(I.serverMaxWindowBits===!1||typeof I.serverMaxWindowBits==="number"&&I.serverMaxWindowBits>u.server_max_window_bits)||typeof I.clientMaxWindowBits==="number"&&!u.client_max_window_bits)return!1;return!0});if(!_)throw Error("None of the extension offers can be accepted");if(I.serverNoContextTakeover)_.server_no_context_takeover=!0;if(I.clientNoContextTakeover)_.client_no_context_takeover=!0;if(typeof I.serverMaxWindowBits==="number")_.server_max_window_bits=I.serverMaxWindowBits;if(typeof I.clientMaxWindowBits==="number")_.client_max_window_bits=I.clientMaxWindowBits;else if(_.client_max_window_bits===!0||I.clientMaxWindowBits===!1)delete _.client_max_window_bits;return _}acceptAsClient($){let I=$[0];if(this._options.clientNoContextTakeover===!1&&I.client_no_context_takeover)throw Error('Unexpected parameter "client_no_context_takeover"');if(!I.client_max_window_bits){if(typeof this._options.clientMaxWindowBits==="number")I.client_max_window_bits=this._options.clientMaxWindowBits}else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits==="number"&&I.client_max_window_bits>this._options.clientMaxWindowBits)throw Error('Unexpected or invalid parameter "client_max_window_bits"');return I}normalizeParams($){return $.forEach((I)=>{Object.keys(I).forEach((_)=>{let u=I[_];if(u.length>1)throw Error(`Parameter "${_}" must have only a single value`);if(u=u[0],_==="client_max_window_bits"){if(u!==!0){let U=+u;if(!Number.isInteger(U)||U<8||U>15)throw TypeError(`Invalid value for parameter "${_}": ${u}`);u=U}else if(!this._isServer)throw TypeError(`Invalid value for parameter "${_}": ${u}`)}else if(_==="server_max_window_bits"){let U=+u;if(!Number.isInteger(U)||U<8||U>15)throw TypeError(`Invalid value for parameter "${_}": ${u}`);u=U}else if(_==="client_no_context_takeover"||_==="server_no_context_takeover"){if(u!==!0)throw TypeError(`Invalid value for parameter "${_}": ${u}`)}else throw Error(`Unknown parameter "${_}"`);I[_]=u})}),$}decompress($,I,_){wu.add((u)=>{this._decompress($,I,(U,z)=>{u(),_(U,z)})})}compress($,I,_){wu.add((u)=>{this._compress($,I,(U,z)=>{u(),_(U,z)})})}_decompress($,I,_){let u=this._isServer?"client":"server";if(!this._inflate){let U=`${u}_max_window_bits`,z=typeof this.params[U]!=="number"?tI.Z_DEFAULT_WINDOWBITS:this.params[U];this._inflate=tI.createInflateRaw({...this._options.zlibInflateOptions,windowBits:z}),this._inflate[Eu]=this,this._inflate[z6]=0,this._inflate[f6]=[],this._inflate.on("error",PC),this._inflate.on("data",oO)}if(this._inflate[K0]=_,this._inflate.write($),I)this._inflate.write(ZC);this._inflate.flush(()=>{let U=this._inflate[V0];if(U){this._inflate.close(),this._inflate=null,_(U);return}let z=dO.concat(this._inflate[f6],this._inflate[z6]);if(this._inflate._readableState.endEmitted)this._inflate.close(),this._inflate=null;else if(this._inflate[z6]=0,this._inflate[f6]=[],I&&this.params[`${u}_no_context_takeover`])this._inflate.reset();_(null,z)})}_compress($,I,_){let u=this._isServer?"server":"client";if(!this._deflate){let U=`${u}_max_window_bits`,z=typeof this.params[U]!=="number"?tI.Z_DEFAULT_WINDOWBITS:this.params[U];this._deflate=tI.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:z}),this._deflate[z6]=0,this._deflate[f6]=[],this._deflate.on("data",WC)}this._deflate[K0]=_,this._deflate.write($),this._deflate.flush(tI.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let U=dO.concat(this._deflate[f6],this._deflate[z6]);if(I)U=new RC(U.buffer,U.byteOffset,U.length-4);if(this._deflate[K0]=null,this._deflate[z6]=0,this._deflate[f6]=[],I&&this.params[`${u}_no_context_takeover`])this._deflate.reset();_(null,U)})}}tO.exports=pO;function WC($){this[f6].push($),this[z6]+=$.length}function oO($){if(this[z6]+=$.length,this[Eu]._maxPayload<1||this[z6]<=this[Eu]._maxPayload){this[f6].push($);return}this[V0]=RangeError("Max payload size exceeded"),this[V0].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[V0][cO]=1009,this.removeListener("data",oO),this.reset()}function PC($){if(this[Eu]._inflate=null,this[V0]){this[K0](this[V0]);return}$[cO]=1007,this[K0]($)}});var L0=E((Zh,Cu)=>{var{isUtf8:aO}=z$("buffer"),{hasBlob:bC}=u6(),AC=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function jC($){return $>=1000&&$<=1014&&$!==1004&&$!==1005&&$!==1006||$>=3000&&$<=4999}function fq($){let I=$.length,_=0;while(_<I)if(($[_]&128)===0)_++;else if(($[_]&224)===192){if(_+1===I||($[_+1]&192)!==128||($[_]&254)===192)return!1;_+=2}else if(($[_]&240)===224){if(_+2>=I||($[_+1]&192)!==128||($[_+2]&192)!==128||$[_]===224&&($[_+1]&224)===128||$[_]===237&&($[_+1]&224)===160)return!1;_+=3}else if(($[_]&248)===240){if(_+3>=I||($[_+1]&192)!==128||($[_+2]&192)!==128||($[_+3]&192)!==128||$[_]===240&&($[_+1]&240)===128||$[_]===244&&$[_+1]>143||$[_]>244)return!1;_+=4}else return!1;return!0}function FC($){return bC&&typeof $==="object"&&typeof $.arrayBuffer==="function"&&typeof $.type==="string"&&typeof $.stream==="function"&&($[Symbol.toStringTag]==="Blob"||$[Symbol.toStringTag]==="File")}Cu.exports={isBlob:FC,isValidStatusCode:jC,isValidUTF8:fq,tokenChars:AC};if(aO)Cu.exports.isValidUTF8=function($){return $.length<24?fq($):aO($)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let $=(()=>{throw new Error("Cannot require module "+"utf-8-validate");})();Cu.exports.isValidUTF8=function(I){return I.length<32?fq(I):$(I)}}catch($){}});var kq=E((Wh,UT)=>{var{Writable:SC}=z$("stream"),eO=aI(),{BINARY_TYPES:wC,EMPTY_BUFFER:sO,kStatusCode:EC,kWebSocket:CC}=u6(),{concat:xq,toArrayBuffer:fC,unmask:xC}=oI(),{isValidStatusCode:kC,isValidUTF8:$T}=L0(),fu=Buffer[Symbol.species];class IT extends SC{constructor($={}){super();this._allowSynchronousEvents=$.allowSynchronousEvents!==void 0?$.allowSynchronousEvents:!0,this._binaryType=$.binaryType||wC[0],this._extensions=$.extensions||{},this._isServer=!!$.isServer,this._maxPayload=$.maxPayload|0,this._skipUTF8Validation=!!$.skipUTF8Validation,this[CC]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=0}_write($,I,_){if(this._opcode===8&&this._state==0)return _();this._bufferedBytes+=$.length,this._buffers.push($),this.startLoop(_)}consume($){if(this._bufferedBytes-=$,$===this._buffers[0].length)return this._buffers.shift();if($<this._buffers[0].length){let _=this._buffers[0];return this._buffers[0]=new fu(_.buffer,_.byteOffset+$,_.length-$),new fu(_.buffer,_.byteOffset,$)}let I=Buffer.allocUnsafe($);do{let _=this._buffers[0],u=I.length-$;if($>=_.length)I.set(this._buffers.shift(),u);else I.set(new Uint8Array(_.buffer,_.byteOffset,$),u),this._buffers[0]=new fu(_.buffer,_.byteOffset+$,_.length-$);$-=_.length}while($>0);return I}startLoop($){this._loop=!0;do switch(this._state){case 0:this.getInfo($);break;case 1:this.getPayloadLength16($);break;case 2:this.getPayloadLength64($);break;case 3:this.getMask();break;case 4:this.getData($);break;case 5:case 6:this._loop=!1;return}while(this._loop);if(!this._errored)$()}getInfo($){if(this._bufferedBytes<2){this._loop=!1;return}let I=this.consume(2);if((I[0]&48)!==0){let u=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");$(u);return}let _=(I[0]&64)===64;if(_&&!this._extensions[eO.extensionName]){let u=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");$(u);return}if(this._fin=(I[0]&128)===128,this._opcode=I[0]&15,this._payloadLength=I[1]&127,this._opcode===0){if(_){let u=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");$(u);return}if(!this._fragmented){let u=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");$(u);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let u=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");$(u);return}this._compressed=_}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let u=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");$(u);return}if(_){let u=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");$(u);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let u=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");$(u);return}}else{let u=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");$(u);return}if(!this._fin&&!this._fragmented)this._fragmented=this._opcode;if(this._masked=(I[1]&128)===128,this._isServer){if(!this._masked){let u=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");$(u);return}}else if(this._masked){let u=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");$(u);return}if(this._payloadLength===126)this._state=1;else if(this._payloadLength===127)this._state=2;else this.haveLength($)}getPayloadLength16($){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength($)}getPayloadLength64($){if(this._bufferedBytes<8){this._loop=!1;return}let I=this.consume(8),_=I.readUInt32BE(0);if(_>Math.pow(2,21)-1){let u=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");$(u);return}this._payloadLength=_*Math.pow(2,32)+I.readUInt32BE(4),this.haveLength($)}haveLength($){if(this._payloadLength&&this._opcode<8){if(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0){let I=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");$(I);return}}if(this._masked)this._state=3;else this._state=4}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=4}getData($){let I=sO;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}if(I=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0)xC(I,this._mask)}if(this._opcode>7){this.controlMessage(I,$);return}if(this._compressed){this._state=5,this.decompress(I,$);return}if(I.length)this._messageLength=this._totalPayloadLength,this._fragments.push(I);this.dataMessage($)}decompress($,I){this._extensions[eO.extensionName].decompress($,this._fin,(u,U)=>{if(u)return I(u);if(U.length){if(this._messageLength+=U.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let z=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");I(z);return}this._fragments.push(U)}if(this.dataMessage(I),this._state===0)this.startLoop(I)})}dataMessage($){if(!this._fin){this._state=0;return}let I=this._messageLength,_=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let u;if(this._binaryType==="nodebuffer")u=xq(_,I);else if(this._binaryType==="arraybuffer")u=fC(xq(_,I));else if(this._binaryType==="blob")u=new Blob(_);else u=_;if(this._allowSynchronousEvents)this.emit("message",u,!0),this._state=0;else this._state=6,setImmediate(()=>{this.emit("message",u,!0),this._state=0,this.startLoop($)})}else{let u=xq(_,I);if(!this._skipUTF8Validation&&!$T(u)){let U=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");$(U);return}if(this._state===5||this._allowSynchronousEvents)this.emit("message",u,!1),this._state=0;else this._state=6,setImmediate(()=>{this.emit("message",u,!1),this._state=0,this.startLoop($)})}}controlMessage($,I){if(this._opcode===8){if($.length===0)this._loop=!1,this.emit("conclude",1005,sO),this.end();else{let _=$.readUInt16BE(0);if(!kC(_)){let U=this.createError(RangeError,`invalid status code ${_}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");I(U);return}let u=new fu($.buffer,$.byteOffset+2,$.length-2);if(!this._skipUTF8Validation&&!$T(u)){let U=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");I(U);return}this._loop=!1,this.emit("conclude",_,u),this.end()}this._state=0;return}if(this._allowSynchronousEvents)this.emit(this._opcode===9?"ping":"pong",$),this._state=0;else this._state=6,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",$),this._state=0,this.startLoop(I)})}createError($,I,_,u,U){this._loop=!1,this._errored=!0;let z=new $(_?`Invalid WebSocket frame: ${I}`:I);return Error.captureStackTrace(z,this.createError),z.code=U,z[EC]=u,z}}UT.exports=IT});var iq=E((bh,zT)=>{var{Duplex:Ph}=z$("stream"),{randomFillSync:yC}=z$("crypto"),_T=aI(),{EMPTY_BUFFER:iC,kWebSocket:lC,NOOP:rC}=u6(),{isBlob:R0,isValidStatusCode:mC}=L0(),{mask:uT,toBuffer:M1}=oI(),B4=Symbol("kByteLength"),nC=Buffer.alloc(4),K1,Z0=8192,P4=0,hC=1,dC=2;class x6{constructor($,I,_){if(this._extensions=I||{},_)this._generateMask=_,this._maskBuffer=Buffer.alloc(4);this._socket=$,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=P4,this.onerror=rC,this[lC]=void 0}static frame($,I){let _,u=!1,U=2,z=!1;if(I.mask){if(_=I.maskBuffer||nC,I.generateMask)I.generateMask(_);else{if(Z0===8192){if(K1===void 0)K1=Buffer.alloc(8192);yC(K1,0,8192),Z0=0}_[0]=K1[Z0++],_[1]=K1[Z0++],_[2]=K1[Z0++],_[3]=K1[Z0++]}z=(_[0]|_[1]|_[2]|_[3])===0,U=6}let g;if(typeof $==="string")if((!I.mask||z)&&I[B4]!==void 0)g=I[B4];else $=Buffer.from($),g=$.length;else g=$.length,u=I.mask&&I.readOnly&&!z;let J=g;if(g>=65536)U+=8,J=127;else if(g>125)U+=2,J=126;let G=Buffer.allocUnsafe(u?g+U:U);if(G[0]=I.fin?I.opcode|128:I.opcode,I.rsv1)G[0]|=64;if(G[1]=J,J===126)G.writeUInt16BE(g,2);else if(J===127)G[2]=G[3]=0,G.writeUIntBE(g,4,6);if(!I.mask)return[G,$];if(G[1]|=128,G[U-4]=_[0],G[U-3]=_[1],G[U-2]=_[2],G[U-1]=_[3],z)return[G,$];if(u)return uT($,_,G,U,g),[G];return uT($,_,$,0,g),[G,$]}close($,I,_,u){let U;if($===void 0)U=iC;else if(typeof $!=="number"||!mC($))throw TypeError("First argument must be a valid error code number");else if(I===void 0||!I.length)U=Buffer.allocUnsafe(2),U.writeUInt16BE($,0);else{let g=Buffer.byteLength(I);if(g>123)throw RangeError("The message must not be greater than 123 bytes");if(U=Buffer.allocUnsafe(2+g),U.writeUInt16BE($,0),typeof I==="string")U.write(I,2);else U.set(I,2)}let z={[B4]:U.length,fin:!0,generateMask:this._generateMask,mask:_,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};if(this._state!==P4)this.enqueue([this.dispatch,U,!1,z,u]);else this.sendFrame(x6.frame(U,z),u)}ping($,I,_){let u,U;if(typeof $==="string")u=Buffer.byteLength($),U=!1;else if(R0($))u=$.size,U=!1;else $=M1($),u=$.length,U=M1.readOnly;if(u>125)throw RangeError("The data size must not be greater than 125 bytes");let z={[B4]:u,fin:!0,generateMask:this._generateMask,mask:I,maskBuffer:this._maskBuffer,opcode:9,readOnly:U,rsv1:!1};if(R0($))if(this._state!==P4)this.enqueue([this.getBlobData,$,!1,z,_]);else this.getBlobData($,!1,z,_);else if(this._state!==P4)this.enqueue([this.dispatch,$,!1,z,_]);else this.sendFrame(x6.frame($,z),_)}pong($,I,_){let u,U;if(typeof $==="string")u=Buffer.byteLength($),U=!1;else if(R0($))u=$.size,U=!1;else $=M1($),u=$.length,U=M1.readOnly;if(u>125)throw RangeError("The data size must not be greater than 125 bytes");let z={[B4]:u,fin:!0,generateMask:this._generateMask,mask:I,maskBuffer:this._maskBuffer,opcode:10,readOnly:U,rsv1:!1};if(R0($))if(this._state!==P4)this.enqueue([this.getBlobData,$,!1,z,_]);else this.getBlobData($,!1,z,_);else if(this._state!==P4)this.enqueue([this.dispatch,$,!1,z,_]);else this.sendFrame(x6.frame($,z),_)}send($,I,_){let u=this._extensions[_T.extensionName],U=I.binary?2:1,z=I.compress,g,J;if(typeof $==="string")g=Buffer.byteLength($),J=!1;else if(R0($))g=$.size,J=!1;else $=M1($),g=$.length,J=M1.readOnly;if(this._firstFragment){if(this._firstFragment=!1,z&&u&&u.params[u._isServer?"server_no_context_takeover":"client_no_context_takeover"])z=g>=u._threshold;this._compress=z}else z=!1,U=0;if(I.fin)this._firstFragment=!0;let G={[B4]:g,fin:I.fin,generateMask:this._generateMask,mask:I.mask,maskBuffer:this._maskBuffer,opcode:U,readOnly:J,rsv1:z};if(R0($))if(this._state!==P4)this.enqueue([this.getBlobData,$,this._compress,G,_]);else this.getBlobData($,this._compress,G,_);else if(this._state!==P4)this.enqueue([this.dispatch,$,this._compress,G,_]);else this.dispatch($,this._compress,G,_)}getBlobData($,I,_,u){this._bufferedBytes+=_[B4],this._state=dC,$.arrayBuffer().then((U)=>{if(this._socket.destroyed){let g=Error("The socket was closed while the blob was being read");process.nextTick(yq,this,g,u);return}this._bufferedBytes-=_[B4];let z=M1(U);if(!I)this._state=P4,this.sendFrame(x6.frame(z,_),u),this.dequeue();else this.dispatch(z,I,_,u)}).catch((U)=>{process.nextTick(cC,this,U,u)})}dispatch($,I,_,u){if(!I){this.sendFrame(x6.frame($,_),u);return}let U=this._extensions[_T.extensionName];this._bufferedBytes+=_[B4],this._state=hC,U.compress($,_.fin,(z,g)=>{if(this._socket.destroyed){let J=Error("The socket was closed while data was being compressed");yq(this,J,u);return}this._bufferedBytes-=_[B4],this._state=P4,_.readOnly=!1,this.sendFrame(x6.frame(g,_),u),this.dequeue()})}dequeue(){while(this._state===P4&&this._queue.length){let $=this._queue.shift();this._bufferedBytes-=$[3][B4],Reflect.apply($[0],this,$.slice(1))}}enqueue($){this._bufferedBytes+=$[3][B4],this._queue.push($)}sendFrame($,I){if($.length===2)this._socket.cork(),this._socket.write($[0]),this._socket.write($[1],I),this._socket.uncork();else this._socket.write($[0],I)}}zT.exports=x6;function yq($,I,_){if(typeof _==="function")_(I);for(let u=0;u<$._queue.length;u++){let U=$._queue[u],z=U[U.length-1];if(typeof z==="function")z(I)}}function cC($,I,_){yq($,I,_),$.onerror(I)}});var YT=E((Ah,QT)=>{var{kForOnEventAttribute:eI,kListener:lq}=u6(),gT=Symbol("kCode"),JT=Symbol("kData"),GT=Symbol("kError"),vT=Symbol("kMessage"),qT=Symbol("kReason"),W0=Symbol("kTarget"),XT=Symbol("kType"),NT=Symbol("kWasClean");class k6{constructor($){this[W0]=null,this[XT]=$}get target(){return this[W0]}get type(){return this[XT]}}Object.defineProperty(k6.prototype,"target",{enumerable:!0});Object.defineProperty(k6.prototype,"type",{enumerable:!0});class P0 extends k6{constructor($,I={}){super($);this[gT]=I.code===void 0?0:I.code,this[qT]=I.reason===void 0?"":I.reason,this[NT]=I.wasClean===void 0?!1:I.wasClean}get code(){return this[gT]}get reason(){return this[qT]}get wasClean(){return this[NT]}}Object.defineProperty(P0.prototype,"code",{enumerable:!0});Object.defineProperty(P0.prototype,"reason",{enumerable:!0});Object.defineProperty(P0.prototype,"wasClean",{enumerable:!0});class sI extends k6{constructor($,I={}){super($);this[GT]=I.error===void 0?null:I.error,this[vT]=I.message===void 0?"":I.message}get error(){return this[GT]}get message(){return this[vT]}}Object.defineProperty(sI.prototype,"error",{enumerable:!0});Object.defineProperty(sI.prototype,"message",{enumerable:!0});class ku extends k6{constructor($,I={}){super($);this[JT]=I.data===void 0?null:I.data}get data(){return this[JT]}}Object.defineProperty(ku.prototype,"data",{enumerable:!0});var pC={addEventListener($,I,_={}){for(let U of this.listeners($))if(!_[eI]&&U[lq]===I&&!U[eI])return;let u;if($==="message")u=function(z,g){let J=new ku("message",{data:g?z:z.toString()});J[W0]=this,xu(I,this,J)};else if($==="close")u=function(z,g){let J=new P0("close",{code:z,reason:g.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});J[W0]=this,xu(I,this,J)};else if($==="error")u=function(z){let g=new sI("error",{error:z,message:z.message});g[W0]=this,xu(I,this,g)};else if($==="open")u=function(){let z=new k6("open");z[W0]=this,xu(I,this,z)};else return;if(u[eI]=!!_[eI],u[lq]=I,_.once)this.once($,u);else this.on($,u)},removeEventListener($,I){for(let _ of this.listeners($))if(_[lq]===I&&!_[eI]){this.removeListener($,_);break}}};QT.exports={CloseEvent:P0,ErrorEvent:sI,Event:k6,EventTarget:pC,MessageEvent:ku};function xu($,I,_){if(typeof $==="object"&&$.handleEvent)$.handleEvent.call($,_);else $.call(I,_)}});var rq=E((jh,HT)=>{var{tokenChars:$U}=L0();function n4($,I,_){if($[I]===void 0)$[I]=[_];else $[I].push(_)}function oC($){let I=Object.create(null),_=Object.create(null),u=!1,U=!1,z=!1,g,J,G=-1,v=-1,X=-1,q=0;for(;q<$.length;q++)if(v=$.charCodeAt(q),g===void 0)if(X===-1&&$U[v]===1){if(G===-1)G=q}else if(q!==0&&(v===32||v===9)){if(X===-1&&G!==-1)X=q}else if(v===59||v===44){if(G===-1)throw SyntaxError(`Unexpected character at index ${q}`);if(X===-1)X=q;let Y=$.slice(G,X);if(v===44)n4(I,Y,_),_=Object.create(null);else g=Y;G=X=-1}else throw SyntaxError(`Unexpected character at index ${q}`);else if(J===void 0)if(X===-1&&$U[v]===1){if(G===-1)G=q}else if(v===32||v===9){if(X===-1&&G!==-1)X=q}else if(v===59||v===44){if(G===-1)throw SyntaxError(`Unexpected character at index ${q}`);if(X===-1)X=q;if(n4(_,$.slice(G,X),!0),v===44)n4(I,g,_),_=Object.create(null),g=void 0;G=X=-1}else if(v===61&&G!==-1&&X===-1)J=$.slice(G,q),G=X=-1;else throw SyntaxError(`Unexpected character at index ${q}`);else if(U){if($U[v]!==1)throw SyntaxError(`Unexpected character at index ${q}`);if(G===-1)G=q;else if(!u)u=!0;U=!1}else if(z)if($U[v]===1){if(G===-1)G=q}else if(v===34&&G!==-1)z=!1,X=q;else if(v===92)U=!0;else throw SyntaxError(`Unexpected character at index ${q}`);else if(v===34&&$.charCodeAt(q-1)===61)z=!0;else if(X===-1&&$U[v]===1){if(G===-1)G=q}else if(G!==-1&&(v===32||v===9)){if(X===-1)X=q}else if(v===59||v===44){if(G===-1)throw SyntaxError(`Unexpected character at index ${q}`);if(X===-1)X=q;let Y=$.slice(G,X);if(u)Y=Y.replace(/\\/g,""),u=!1;if(n4(_,J,Y),v===44)n4(I,g,_),_=Object.create(null),g=void 0;J=void 0,G=X=-1}else throw SyntaxError(`Unexpected character at index ${q}`);if(G===-1||z||v===32||v===9)throw SyntaxError("Unexpected end of input");if(X===-1)X=q;let N=$.slice(G,X);if(g===void 0)n4(I,N,_);else{if(J===void 0)n4(_,N,!0);else if(u)n4(_,J,N.replace(/\\/g,""));else n4(_,J,N);n4(I,g,_)}return I}function tC($){return Object.keys($).map((I)=>{let _=$[I];if(!Array.isArray(_))_=[_];return _.map((u)=>{return[I].concat(Object.keys(u).map((U)=>{let z=u[U];if(!Array.isArray(z))z=[z];return z.map((g)=>g===!0?U:`${U}=${g}`).join("; ")})).join("; ")}).join(", ")}).join(", ")}HT.exports={format:tC,parse:oC}});var ru=E((wh,PT)=>{var aC=z$("events"),eC=z$("https"),sC=z$("http"),BT=z$("net"),$f=z$("tls"),{randomBytes:If,createHash:Uf}=z$("crypto"),{Duplex:Fh,Readable:Sh}=z$("stream"),{URL:mq}=z$("url"),y6=aI(),_f=kq(),uf=iq(),{isBlob:zf}=L0(),{BINARY_TYPES:OT,CLOSE_TIMEOUT:gf,EMPTY_BUFFER:yu,GUID:Jf,kForOnEventAttribute:nq,kListener:Gf,kStatusCode:vf,kWebSocket:F$,NOOP:DT}=u6(),{EventTarget:{addEventListener:qf,removeEventListener:Xf}}=YT(),{format:Nf,parse:Qf}=rq(),{toBuffer:Yf}=oI(),MT=Symbol("kAborted"),hq=[8,13],g6=["CONNECTING","OPEN","CLOSING","CLOSED"],Hf=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;class d extends aC{constructor($,I,_){super();if(this._binaryType=OT[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=yu,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=d.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,$!==null){if(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,I===void 0)I=[];else if(!Array.isArray(I))if(typeof I==="object"&&I!==null)_=I,I=[];else I=[I];KT(this,$,I,_)}else this._autoPong=_.autoPong,this._closeTimeout=_.closeTimeout,this._isServer=!0}get binaryType(){return this._binaryType}set binaryType($){if(!OT.includes($))return;if(this._binaryType=$,this._receiver)this._receiver._binaryType=$}get bufferedAmount(){if(!this._socket)return this._bufferedAmount;return this._socket._writableState.length+this._sender._bufferedBytes}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket($,I,_){let u=new _f({allowSynchronousEvents:_.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:_.maxPayload,skipUTF8Validation:_.skipUTF8Validation}),U=new uf($,this._extensions,_.generateMask);if(this._receiver=u,this._sender=U,this._socket=$,u[F$]=this,U[F$]=this,$[F$]=this,u.on("conclude",Bf),u.on("drain",Df),u.on("error",Mf),u.on("message",Kf),u.on("ping",Vf),u.on("pong",Lf),U.onerror=Rf,$.setTimeout)$.setTimeout(0);if($.setNoDelay)$.setNoDelay();if(I.length>0)$.unshift(I);$.on("close",RT),$.on("data",lu),$.on("end",ZT),$.on("error",WT),this._readyState=d.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=d.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}if(this._extensions[y6.extensionName])this._extensions[y6.extensionName].cleanup();this._receiver.removeAllListeners(),this._readyState=d.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close($,I){if(this.readyState===d.CLOSED)return;if(this.readyState===d.CONNECTING){v4(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===d.CLOSING){if(this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted))this._socket.end();return}this._readyState=d.CLOSING,this._sender.close($,I,!this._isServer,(_)=>{if(_)return;if(this._closeFrameSent=!0,this._closeFrameReceived||this._receiver._writableState.errorEmitted)this._socket.end()}),LT(this)}pause(){if(this.readyState===d.CONNECTING||this.readyState===d.CLOSED)return;this._paused=!0,this._socket.pause()}ping($,I,_){if(this.readyState===d.CONNECTING)throw Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof $==="function")_=$,$=I=void 0;else if(typeof I==="function")_=I,I=void 0;if(typeof $==="number")$=$.toString();if(this.readyState!==d.OPEN){dq(this,$,_);return}if(I===void 0)I=!this._isServer;this._sender.ping($||yu,I,_)}pong($,I,_){if(this.readyState===d.CONNECTING)throw Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof $==="function")_=$,$=I=void 0;else if(typeof I==="function")_=I,I=void 0;if(typeof $==="number")$=$.toString();if(this.readyState!==d.OPEN){dq(this,$,_);return}if(I===void 0)I=!this._isServer;this._sender.pong($||yu,I,_)}resume(){if(this.readyState===d.CONNECTING||this.readyState===d.CLOSED)return;if(this._paused=!1,!this._receiver._writableState.needDrain)this._socket.resume()}send($,I,_){if(this.readyState===d.CONNECTING)throw Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof I==="function")_=I,I={};if(typeof $==="number")$=$.toString();if(this.readyState!==d.OPEN){dq(this,$,_);return}let u={binary:typeof $!=="string",mask:!this._isServer,compress:!0,fin:!0,...I};if(!this._extensions[y6.extensionName])u.compress=!1;this._sender.send($||yu,u,_)}terminate(){if(this.readyState===d.CLOSED)return;if(this.readyState===d.CONNECTING){v4(this,this._req,"WebSocket was closed before the connection was established");return}if(this._socket)this._readyState=d.CLOSING,this._socket.destroy()}}Object.defineProperty(d,"CONNECTING",{enumerable:!0,value:g6.indexOf("CONNECTING")});Object.defineProperty(d.prototype,"CONNECTING",{enumerable:!0,value:g6.indexOf("CONNECTING")});Object.defineProperty(d,"OPEN",{enumerable:!0,value:g6.indexOf("OPEN")});Object.defineProperty(d.prototype,"OPEN",{enumerable:!0,value:g6.indexOf("OPEN")});Object.defineProperty(d,"CLOSING",{enumerable:!0,value:g6.indexOf("CLOSING")});Object.defineProperty(d.prototype,"CLOSING",{enumerable:!0,value:g6.indexOf("CLOSING")});Object.defineProperty(d,"CLOSED",{enumerable:!0,value:g6.indexOf("CLOSED")});Object.defineProperty(d.prototype,"CLOSED",{enumerable:!0,value:g6.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(($)=>{Object.defineProperty(d.prototype,$,{enumerable:!0})});["open","error","close","message"].forEach(($)=>{Object.defineProperty(d.prototype,`on${$}`,{enumerable:!0,get(){for(let I of this.listeners($))if(I[nq])return I[Gf];return null},set(I){for(let _ of this.listeners($))if(_[nq]){this.removeListener($,_);break}if(typeof I!=="function")return;this.addEventListener($,I,{[nq]:!0})}})});d.prototype.addEventListener=qf;d.prototype.removeEventListener=Xf;PT.exports=d;function KT($,I,_,u){let U={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:gf,protocolVersion:hq[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...u,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if($._autoPong=U.autoPong,$._closeTimeout=U.closeTimeout,!hq.includes(U.protocolVersion))throw RangeError(`Unsupported protocol version: ${U.protocolVersion} (supported versions: ${hq.join(", ")})`);let z;if(I instanceof mq)z=I;else try{z=new mq(I)}catch(Q){throw SyntaxError(`Invalid URL: ${I}`)}if(z.protocol==="http:")z.protocol="ws:";else if(z.protocol==="https:")z.protocol="wss:";$._url=z.href;let g=z.protocol==="wss:",J=z.protocol==="ws+unix:",G;if(z.protocol!=="ws:"&&!g&&!J)G=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`;else if(J&&!z.pathname)G="The URL's pathname is empty";else if(z.hash)G="The URL contains a fragment identifier";if(G){let Q=SyntaxError(G);if($._redirects===0)throw Q;else{iu($,Q);return}}let v=g?443:80,X=If(16).toString("base64"),q=g?eC.request:sC.request,N=new Set,Y;if(U.createConnection=U.createConnection||(g?Tf:Of),U.defaultPort=U.defaultPort||v,U.port=z.port||v,U.host=z.hostname.startsWith("[")?z.hostname.slice(1,-1):z.hostname,U.headers={...U.headers,"Sec-WebSocket-Version":U.protocolVersion,"Sec-WebSocket-Key":X,Connection:"Upgrade",Upgrade:"websocket"},U.path=z.pathname+z.search,U.timeout=U.handshakeTimeout,U.perMessageDeflate)Y=new y6(U.perMessageDeflate!==!0?U.perMessageDeflate:{},!1,U.maxPayload),U.headers["Sec-WebSocket-Extensions"]=Nf({[y6.extensionName]:Y.offer()});if(_.length){for(let Q of _){if(typeof Q!=="string"||!Hf.test(Q)||N.has(Q))throw SyntaxError("An invalid or duplicated subprotocol was specified");N.add(Q)}U.headers["Sec-WebSocket-Protocol"]=_.join(",")}if(U.origin)if(U.protocolVersion<13)U.headers["Sec-WebSocket-Origin"]=U.origin;else U.headers.Origin=U.origin;if(z.username||z.password)U.auth=`${z.username}:${z.password}`;if(J){let Q=U.path.split(":");U.socketPath=Q[0],U.path=Q[1]}let H;if(U.followRedirects){if($._redirects===0){$._originalIpc=J,$._originalSecure=g,$._originalHostOrSocketPath=J?U.socketPath:z.host;let Q=u&&u.headers;if(u={...u,headers:{}},Q)for(let[O,D]of Object.entries(Q))u.headers[O.toLowerCase()]=D}else if($.listenerCount("redirect")===0){let Q=J?$._originalIpc?U.socketPath===$._originalHostOrSocketPath:!1:$._originalIpc?!1:z.host===$._originalHostOrSocketPath;if(!Q||$._originalSecure&&!g){if(delete U.headers.authorization,delete U.headers.cookie,!Q)delete U.headers.host;U.auth=void 0}}if(U.auth&&!u.headers.authorization)u.headers.authorization="Basic "+Buffer.from(U.auth).toString("base64");if(H=$._req=q(U),$._redirects)$.emit("redirect",$.url,H)}else H=$._req=q(U);if(U.timeout)H.on("timeout",()=>{v4($,H,"Opening handshake has timed out")});if(H.on("error",(Q)=>{if(H===null||H[MT])return;H=$._req=null,iu($,Q)}),H.on("response",(Q)=>{let O=Q.headers.location,D=Q.statusCode;if(O&&U.followRedirects&&D>=300&&D<400){if(++$._redirects>U.maxRedirects){v4($,H,"Maximum redirects exceeded");return}H.abort();let V;try{V=new mq(O,I)}catch(W){let L=SyntaxError(`Invalid URL: ${O}`);iu($,L);return}KT($,V,_,u)}else if(!$.emit("unexpected-response",H,Q))v4($,H,`Unexpected server response: ${Q.statusCode}`)}),H.on("upgrade",(Q,O,D)=>{if($.emit("upgrade",Q),$.readyState!==d.CONNECTING)return;H=$._req=null;let V=Q.headers.upgrade;if(V===void 0||V.toLowerCase()!=="websocket"){v4($,O,"Invalid Upgrade header");return}let W=Uf("sha1").update(X+Jf).digest("base64");if(Q.headers["sec-websocket-accept"]!==W){v4($,O,"Invalid Sec-WebSocket-Accept header");return}let L=Q.headers["sec-websocket-protocol"],K;if(L!==void 0){if(!N.size)K="Server sent a subprotocol but none was requested";else if(!N.has(L))K="Server sent an invalid subprotocol"}else if(N.size)K="Server sent no subprotocol";if(K){v4($,O,K);return}if(L)$._protocol=L;let Z=Q.headers["sec-websocket-extensions"];if(Z!==void 0){if(!Y){v4($,O,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let M;try{M=Qf(Z)}catch(A){v4($,O,"Invalid Sec-WebSocket-Extensions header");return}let T=Object.keys(M);if(T.length!==1||T[0]!==y6.extensionName){v4($,O,"Server indicated an extension that was not requested");return}try{Y.accept(M[y6.extensionName])}catch(A){v4($,O,"Invalid Sec-WebSocket-Extensions header");return}$._extensions[y6.extensionName]=Y}$.setSocket(O,D,{allowSynchronousEvents:U.allowSynchronousEvents,generateMask:U.generateMask,maxPayload:U.maxPayload,skipUTF8Validation:U.skipUTF8Validation})}),U.finishRequest)U.finishRequest(H,$);else H.end()}function iu($,I){$._readyState=d.CLOSING,$._errorEmitted=!0,$.emit("error",I),$.emitClose()}function Of($){return $.path=$.socketPath,BT.connect($)}function Tf($){if($.path=void 0,!$.servername&&$.servername!=="")$.servername=BT.isIP($.host)?"":$.host;return $f.connect($)}function v4($,I,_){$._readyState=d.CLOSING;let u=Error(_);if(Error.captureStackTrace(u,v4),I.setHeader){if(I[MT]=!0,I.abort(),I.socket&&!I.socket.destroyed)I.socket.destroy();process.nextTick(iu,$,u)}else I.destroy(u),I.once("error",$.emit.bind($,"error")),I.once("close",$.emitClose.bind($))}function dq($,I,_){if(I){let u=zf(I)?I.size:Yf(I).length;if($._socket)$._sender._bufferedBytes+=u;else $._bufferedAmount+=u}if(_){let u=Error(`WebSocket is not open: readyState ${$.readyState} (${g6[$.readyState]})`);process.nextTick(_,u)}}function Bf($,I){let _=this[F$];if(_._closeFrameReceived=!0,_._closeMessage=I,_._closeCode=$,_._socket[F$]===void 0)return;if(_._socket.removeListener("data",lu),process.nextTick(VT,_._socket),$===1005)_.close();else _.close($,I)}function Df(){let $=this[F$];if(!$.isPaused)$._socket.resume()}function Mf($){let I=this[F$];if(I._socket[F$]!==void 0)I._socket.removeListener("data",lu),process.nextTick(VT,I._socket),I.close($[vf]);if(!I._errorEmitted)I._errorEmitted=!0,I.emit("error",$)}function TT(){this[F$].emitClose()}function Kf($,I){this[F$].emit("message",$,I)}function Vf($){let I=this[F$];if(I._autoPong)I.pong($,!this._isServer,DT);I.emit("ping",$)}function Lf($){this[F$].emit("pong",$)}function VT($){$.resume()}function Rf($){let I=this[F$];if(I.readyState===d.CLOSED)return;if(I.readyState===d.OPEN)I._readyState=d.CLOSING,LT(I);if(this._socket.end(),!I._errorEmitted)I._errorEmitted=!0,I.emit("error",$)}function LT($){$._closeTimer=setTimeout($._socket.destroy.bind($._socket),$._closeTimeout)}function RT(){let $=this[F$];if(this.removeListener("close",RT),this.removeListener("data",lu),this.removeListener("end",ZT),$._readyState=d.CLOSING,!this._readableState.endEmitted&&!$._closeFrameReceived&&!$._receiver._writableState.errorEmitted&&this._readableState.length!==0){let I=this.read(this._readableState.length);$._receiver.write(I)}if($._receiver.end(),this[F$]=void 0,clearTimeout($._closeTimer),$._receiver._writableState.finished||$._receiver._writableState.errorEmitted)$.emitClose();else $._receiver.on("error",TT),$._receiver.on("finish",TT)}function lu($){if(!this[F$]._receiver.write($))this.pause()}function ZT(){let $=this[F$];$._readyState=d.CLOSING,$._receiver.end(),this.end()}function WT(){let $=this[F$];if(this.removeListener("error",WT),this.on("error",DT),$)$._readyState=d.CLOSING,this.destroy()}});var FT=E((Ch,jT)=>{var Eh=ru(),{Duplex:Zf}=z$("stream");function bT($){$.emit("close")}function Wf(){if(!this.destroyed&&this._writableState.finished)this.destroy()}function AT($){if(this.removeListener("error",AT),this.destroy(),this.listenerCount("error")===0)this.emit("error",$)}function Pf($,I){let _=!0,u=new Zf({...I,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return $.on("message",function(z,g){let J=!g&&u._readableState.objectMode?z.toString():z;if(!u.push(J))$.pause()}),$.once("error",function(z){if(u.destroyed)return;_=!1,u.destroy(z)}),$.once("close",function(){if(u.destroyed)return;u.push(null)}),u._destroy=function(U,z){if($.readyState===$.CLOSED){z(U),process.nextTick(bT,u);return}let g=!1;if($.once("error",function(G){g=!0,z(G)}),$.once("close",function(){if(!g)z(U);process.nextTick(bT,u)}),_)$.terminate()},u._final=function(U){if($.readyState===$.CONNECTING){$.once("open",function(){u._final(U)});return}if($._socket===null)return;if($._socket._writableState.finished){if(U(),u._readableState.endEmitted)u.destroy()}else $._socket.once("finish",function(){U()}),$.close()},u._read=function(){if($.isPaused)$.resume()},u._write=function(U,z,g){if($.readyState===$.CONNECTING){$.once("open",function(){u._write(U,z,g)});return}$.send(U,g)},u.on("end",Wf),u.on("error",AT),u}jT.exports=Pf});var wT=E((fh,ST)=>{var{tokenChars:bf}=L0();function Af($){let I=new Set,_=-1,u=-1,U=0;for(U;U<$.length;U++){let g=$.charCodeAt(U);if(u===-1&&bf[g]===1){if(_===-1)_=U}else if(U!==0&&(g===32||g===9)){if(u===-1&&_!==-1)u=U}else if(g===44){if(_===-1)throw SyntaxError(`Unexpected character at index ${U}`);if(u===-1)u=U;let J=$.slice(_,u);if(I.has(J))throw SyntaxError(`The "${J}" subprotocol is duplicated`);I.add(J),_=u=-1}else throw SyntaxError(`Unexpected character at index ${U}`)}if(_===-1||u!==-1)throw SyntaxError("Unexpected end of input");let z=$.slice(_,U);if(I.has(z))throw SyntaxError(`The "${z}" subprotocol is duplicated`);return I.add(z),I}ST.exports={parse:Af}});var kT=E((kh,xT)=>{var jf=z$("events"),mu=z$("http"),{Duplex:xh}=z$("stream"),{createHash:Ff}=z$("crypto"),ET=rq(),V1=aI(),Sf=wT(),wf=ru(),{CLOSE_TIMEOUT:Ef,GUID:Cf,kWebSocket:ff}=u6(),xf=/^[+/0-9A-Za-z]{22}==$/;class fT extends jf{constructor($,I){super();if($={allowSynchronousEvents:!0,autoPong:!0,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:Ef,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:wf,...$},$.port==null&&!$.server&&!$.noServer||$.port!=null&&($.server||$.noServer)||$.server&&$.noServer)throw TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if($.port!=null)this._server=mu.createServer((_,u)=>{let U=mu.STATUS_CODES[426];u.writeHead(426,{"Content-Length":U.length,"Content-Type":"text/plain"}),u.end(U)}),this._server.listen($.port,$.host,$.backlog,I);else if($.server)this._server=$.server;if(this._server){let _=this.emit.bind(this,"connection");this._removeListeners=kf(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(u,U,z)=>{this.handleUpgrade(u,U,z,_)}})}if($.perMessageDeflate===!0)$.perMessageDeflate={};if($.clientTracking)this.clients=new Set,this._shouldEmitClose=!1;this.options=$,this._state=0}address(){if(this.options.noServer)throw Error('The server is operating in "noServer" mode');if(!this._server)return null;return this._server.address()}close($){if(this._state===2){if($)this.once("close",()=>{$(Error("The server is not running"))});process.nextTick(IU,this);return}if($)this.once("close",$);if(this._state===1)return;if(this._state=1,this.options.noServer||this.options.server){if(this._server)this._removeListeners(),this._removeListeners=this._server=null;if(this.clients)if(!this.clients.size)process.nextTick(IU,this);else this._shouldEmitClose=!0;else process.nextTick(IU,this)}else{let I=this._server;this._removeListeners(),this._removeListeners=this._server=null,I.close(()=>{IU(this)})}}shouldHandle($){if(this.options.path){let I=$.url.indexOf("?");if((I!==-1?$.url.slice(0,I):$.url)!==this.options.path)return!1}return!0}handleUpgrade($,I,_,u){I.on("error",CT);let U=$.headers["sec-websocket-key"],z=$.headers.upgrade,g=+$.headers["sec-websocket-version"];if($.method!=="GET"){L1(this,$,I,405,"Invalid HTTP method");return}if(z===void 0||z.toLowerCase()!=="websocket"){L1(this,$,I,400,"Invalid Upgrade header");return}if(U===void 0||!xf.test(U)){L1(this,$,I,400,"Missing or invalid Sec-WebSocket-Key header");return}if(g!==13&&g!==8){L1(this,$,I,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle($)){UU(I,400);return}let J=$.headers["sec-websocket-protocol"],G=new Set;if(J!==void 0)try{G=Sf.parse(J)}catch(q){L1(this,$,I,400,"Invalid Sec-WebSocket-Protocol header");return}let v=$.headers["sec-websocket-extensions"],X={};if(this.options.perMessageDeflate&&v!==void 0){let q=new V1(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let N=ET.parse(v);if(N[V1.extensionName])q.accept(N[V1.extensionName]),X[V1.extensionName]=q}catch(N){L1(this,$,I,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let q={origin:$.headers[`${g===8?"sec-websocket-origin":"origin"}`],secure:!!($.socket.authorized||$.socket.encrypted),req:$};if(this.options.verifyClient.length===2){this.options.verifyClient(q,(N,Y,H,Q)=>{if(!N)return UU(I,Y||401,H,Q);this.completeUpgrade(X,U,G,$,I,_,u)});return}if(!this.options.verifyClient(q))return UU(I,401)}this.completeUpgrade(X,U,G,$,I,_,u)}completeUpgrade($,I,_,u,U,z,g){if(!U.readable||!U.writable)return U.destroy();if(U[ff])throw Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>0)return UU(U,503);let G=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${Ff("sha1").update(I+Cf).digest("base64")}`],v=new this.options.WebSocket(null,void 0,this.options);if(_.size){let X=this.options.handleProtocols?this.options.handleProtocols(_,u):_.values().next().value;if(X)G.push(`Sec-WebSocket-Protocol: ${X}`),v._protocol=X}if($[V1.extensionName]){let X=$[V1.extensionName].params,q=ET.format({[V1.extensionName]:[X]});G.push(`Sec-WebSocket-Extensions: ${q}`),v._extensions=$}if(this.emit("headers",G,u),U.write(G.concat(`\r
|
|
266
|
+
`),"Changed Files");let J=await tu({message:"What did you accomplish in this session?",placeholder:"e.g., Implemented user authentication flow"});if(_$(J)){r$("Cancelled.");return}let G=await tu({message:"Key learnings? (comma-separated)",placeholder:"e.g., JWT needs refresh token, bcrypt is slow"});if(_$(G)){r$("Cancelled.");return}let q=await tu({message:"Next steps? (comma-separated)",placeholder:"e.g., Add password reset, Write tests"});if(_$(q)){r$("Cancelled.");return}let N={id:Math.random().toString(36).slice(2,8),date:new Date().toISOString(),summary:J,keyLearnings:G.split(",").map((X)=>X.trim()).filter(Boolean),filesChanged:g,nextSteps:q.split(",").map((X)=>X.trim()).filter(Boolean)};lY($,N),y(A$.default.green("Retrospective saved!"),"Done"),p(A$.default.dim(`Stored in: ${I}`))}var A$;var nY=b0(()=>{I4();QX();CI();A$=v$(P$(),1)});var g6=w((Kh,iO)=>{var kO=["nodebuffer","arraybuffer","fragments"],yO=typeof Blob<"u";if(yO)kO.push("blob");iO.exports={BINARY_TYPES:kO,CLOSE_TIMEOUT:30000,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:yO,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var oI=w((Vh,A2)=>{var{EMPTY_BUFFER:MC}=g6(),FX=Buffer[Symbol.species];function KC($,I){if($.length===0)return MC;if($.length===1)return $[0];let _=Buffer.allocUnsafe(I),u=0;for(let U=0;U<$.length;U++){let z=$[U];_.set(z,u),u+=z.length}if(u<I)return new FX(_.buffer,_.byteOffset,u);return _}function lO($,I,_,u,U){for(let z=0;z<U;z++)_[u+z]=$[z]^I[z&3]}function mO($,I){for(let _=0;_<$.length;_++)$[_]^=I[_&3]}function VC($){if($.length===$.buffer.byteLength)return $.buffer;return $.buffer.slice($.byteOffset,$.byteOffset+$.length)}function SX($){if(SX.readOnly=!0,Buffer.isBuffer($))return $;let I;if($ instanceof ArrayBuffer)I=new FX($);else if(ArrayBuffer.isView($))I=new FX($.buffer,$.byteOffset,$.byteLength);else I=Buffer.from($),SX.readOnly=!1;return I}A2.exports={concat:KC,mask:lO,toArrayBuffer:VC,toBuffer:SX,unmask:mO};if(!process.env.WS_NO_BUFFER_UTIL)try{let $=(()=>{throw new Error("Cannot require module "+"bufferutil");})();A2.exports.mask=function(I,_,u,U,z){if(z<48)lO(I,_,u,U,z);else $.mask(I,_,u,U,z)},A2.exports.unmask=function(I,_){if(I.length<32)mO(I,_);else $.unmask(I,_)}}catch($){}});var dO=w((Rh,hO)=>{var rO=Symbol("kDone"),wX=Symbol("kRun");class nO{constructor($){this[rO]=()=>{this.pending--,this[wX]()},this.concurrency=$||1/0,this.jobs=[],this.pending=0}add($){this.jobs.push($),this[wX]()}[wX](){if(this.pending===this.concurrency)return;if(this.jobs.length){let $=this.jobs.shift();this.pending++,$(this[rO])}}}hO.exports=nO});var aI=w((Lh,aO)=>{var tI=z$("zlib"),cO=oI(),RC=dO(),{kStatusCode:pO}=g6(),LC=Buffer[Symbol.species],ZC=Buffer.from([0,0,255,255]),F2=Symbol("permessage-deflate"),J6=Symbol("total-length"),M0=Symbol("callback"),x6=Symbol("buffers"),K0=Symbol("error"),j2;class oO{constructor($,I,_){if(this._maxPayload=_|0,this._options=$||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!I,this._deflate=null,this._inflate=null,this.params=null,!j2){let u=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;j2=new RC(u)}}static get extensionName(){return"permessage-deflate"}offer(){let $={};if(this._options.serverNoContextTakeover)$.server_no_context_takeover=!0;if(this._options.clientNoContextTakeover)$.client_no_context_takeover=!0;if(this._options.serverMaxWindowBits)$.server_max_window_bits=this._options.serverMaxWindowBits;if(this._options.clientMaxWindowBits)$.client_max_window_bits=this._options.clientMaxWindowBits;else if(this._options.clientMaxWindowBits==null)$.client_max_window_bits=!0;return $}accept($){return $=this.normalizeParams($),this.params=this._isServer?this.acceptAsServer($):this.acceptAsClient($),this.params}cleanup(){if(this._inflate)this._inflate.close(),this._inflate=null;if(this._deflate){let $=this._deflate[M0];if(this._deflate.close(),this._deflate=null,$)$(Error("The deflate stream was closed while data was being processed"))}}acceptAsServer($){let I=this._options,_=$.find((u)=>{if(I.serverNoContextTakeover===!1&&u.server_no_context_takeover||u.server_max_window_bits&&(I.serverMaxWindowBits===!1||typeof I.serverMaxWindowBits==="number"&&I.serverMaxWindowBits>u.server_max_window_bits)||typeof I.clientMaxWindowBits==="number"&&!u.client_max_window_bits)return!1;return!0});if(!_)throw Error("None of the extension offers can be accepted");if(I.serverNoContextTakeover)_.server_no_context_takeover=!0;if(I.clientNoContextTakeover)_.client_no_context_takeover=!0;if(typeof I.serverMaxWindowBits==="number")_.server_max_window_bits=I.serverMaxWindowBits;if(typeof I.clientMaxWindowBits==="number")_.client_max_window_bits=I.clientMaxWindowBits;else if(_.client_max_window_bits===!0||I.clientMaxWindowBits===!1)delete _.client_max_window_bits;return _}acceptAsClient($){let I=$[0];if(this._options.clientNoContextTakeover===!1&&I.client_no_context_takeover)throw Error('Unexpected parameter "client_no_context_takeover"');if(!I.client_max_window_bits){if(typeof this._options.clientMaxWindowBits==="number")I.client_max_window_bits=this._options.clientMaxWindowBits}else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits==="number"&&I.client_max_window_bits>this._options.clientMaxWindowBits)throw Error('Unexpected or invalid parameter "client_max_window_bits"');return I}normalizeParams($){return $.forEach((I)=>{Object.keys(I).forEach((_)=>{let u=I[_];if(u.length>1)throw Error(`Parameter "${_}" must have only a single value`);if(u=u[0],_==="client_max_window_bits"){if(u!==!0){let U=+u;if(!Number.isInteger(U)||U<8||U>15)throw TypeError(`Invalid value for parameter "${_}": ${u}`);u=U}else if(!this._isServer)throw TypeError(`Invalid value for parameter "${_}": ${u}`)}else if(_==="server_max_window_bits"){let U=+u;if(!Number.isInteger(U)||U<8||U>15)throw TypeError(`Invalid value for parameter "${_}": ${u}`);u=U}else if(_==="client_no_context_takeover"||_==="server_no_context_takeover"){if(u!==!0)throw TypeError(`Invalid value for parameter "${_}": ${u}`)}else throw Error(`Unknown parameter "${_}"`);I[_]=u})}),$}decompress($,I,_){j2.add((u)=>{this._decompress($,I,(U,z)=>{u(),_(U,z)})})}compress($,I,_){j2.add((u)=>{this._compress($,I,(U,z)=>{u(),_(U,z)})})}_decompress($,I,_){let u=this._isServer?"client":"server";if(!this._inflate){let U=`${u}_max_window_bits`,z=typeof this.params[U]!=="number"?tI.Z_DEFAULT_WINDOWBITS:this.params[U];this._inflate=tI.createInflateRaw({...this._options.zlibInflateOptions,windowBits:z}),this._inflate[F2]=this,this._inflate[J6]=0,this._inflate[x6]=[],this._inflate.on("error",PC),this._inflate.on("data",tO)}if(this._inflate[M0]=_,this._inflate.write($),I)this._inflate.write(ZC);this._inflate.flush(()=>{let U=this._inflate[K0];if(U){this._inflate.close(),this._inflate=null,_(U);return}let z=cO.concat(this._inflate[x6],this._inflate[J6]);if(this._inflate._readableState.endEmitted)this._inflate.close(),this._inflate=null;else if(this._inflate[J6]=0,this._inflate[x6]=[],I&&this.params[`${u}_no_context_takeover`])this._inflate.reset();_(null,z)})}_compress($,I,_){let u=this._isServer?"server":"client";if(!this._deflate){let U=`${u}_max_window_bits`,z=typeof this.params[U]!=="number"?tI.Z_DEFAULT_WINDOWBITS:this.params[U];this._deflate=tI.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:z}),this._deflate[J6]=0,this._deflate[x6]=[],this._deflate.on("data",WC)}this._deflate[M0]=_,this._deflate.write($),this._deflate.flush(tI.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let U=cO.concat(this._deflate[x6],this._deflate[J6]);if(I)U=new LC(U.buffer,U.byteOffset,U.length-4);if(this._deflate[M0]=null,this._deflate[J6]=0,this._deflate[x6]=[],I&&this.params[`${u}_no_context_takeover`])this._deflate.reset();_(null,U)})}}aO.exports=oO;function WC($){this[x6].push($),this[J6]+=$.length}function tO($){if(this[J6]+=$.length,this[F2]._maxPayload<1||this[J6]<=this[F2]._maxPayload){this[x6].push($);return}this[K0]=RangeError("Max payload size exceeded"),this[K0].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[K0][pO]=1009,this.removeListener("data",tO),this.reset()}function PC($){if(this[F2]._inflate=null,this[K0]){this[M0](this[K0]);return}$[pO]=1007,this[M0]($)}});var V0=w((Zh,S2)=>{var{isUtf8:eO}=z$("buffer"),{hasBlob:bC}=g6(),AC=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function jC($){return $>=1000&&$<=1014&&$!==1004&&$!==1005&&$!==1006||$>=3000&&$<=4999}function EX($){let I=$.length,_=0;while(_<I)if(($[_]&128)===0)_++;else if(($[_]&224)===192){if(_+1===I||($[_+1]&192)!==128||($[_]&254)===192)return!1;_+=2}else if(($[_]&240)===224){if(_+2>=I||($[_+1]&192)!==128||($[_+2]&192)!==128||$[_]===224&&($[_+1]&224)===128||$[_]===237&&($[_+1]&224)===160)return!1;_+=3}else if(($[_]&248)===240){if(_+3>=I||($[_+1]&192)!==128||($[_+2]&192)!==128||($[_+3]&192)!==128||$[_]===240&&($[_+1]&240)===128||$[_]===244&&$[_+1]>143||$[_]>244)return!1;_+=4}else return!1;return!0}function FC($){return bC&&typeof $==="object"&&typeof $.arrayBuffer==="function"&&typeof $.type==="string"&&typeof $.stream==="function"&&($[Symbol.toStringTag]==="Blob"||$[Symbol.toStringTag]==="File")}S2.exports={isBlob:FC,isValidStatusCode:jC,isValidUTF8:EX,tokenChars:AC};if(eO)S2.exports.isValidUTF8=function($){return $.length<24?EX($):eO($)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let $=(()=>{throw new Error("Cannot require module "+"utf-8-validate");})();S2.exports.isValidUTF8=function(I){return I.length<32?EX(I):$(I)}}catch($){}});var fX=w((Wh,_T)=>{var{Writable:SC}=z$("stream"),sO=aI(),{BINARY_TYPES:wC,EMPTY_BUFFER:$T,kStatusCode:EC,kWebSocket:CC}=g6(),{concat:CX,toArrayBuffer:fC,unmask:xC}=oI(),{isValidStatusCode:kC,isValidUTF8:IT}=V0(),w2=Buffer[Symbol.species];class UT extends SC{constructor($={}){super();this._allowSynchronousEvents=$.allowSynchronousEvents!==void 0?$.allowSynchronousEvents:!0,this._binaryType=$.binaryType||wC[0],this._extensions=$.extensions||{},this._isServer=!!$.isServer,this._maxPayload=$.maxPayload|0,this._skipUTF8Validation=!!$.skipUTF8Validation,this[CC]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=0}_write($,I,_){if(this._opcode===8&&this._state==0)return _();this._bufferedBytes+=$.length,this._buffers.push($),this.startLoop(_)}consume($){if(this._bufferedBytes-=$,$===this._buffers[0].length)return this._buffers.shift();if($<this._buffers[0].length){let _=this._buffers[0];return this._buffers[0]=new w2(_.buffer,_.byteOffset+$,_.length-$),new w2(_.buffer,_.byteOffset,$)}let I=Buffer.allocUnsafe($);do{let _=this._buffers[0],u=I.length-$;if($>=_.length)I.set(this._buffers.shift(),u);else I.set(new Uint8Array(_.buffer,_.byteOffset,$),u),this._buffers[0]=new w2(_.buffer,_.byteOffset+$,_.length-$);$-=_.length}while($>0);return I}startLoop($){this._loop=!0;do switch(this._state){case 0:this.getInfo($);break;case 1:this.getPayloadLength16($);break;case 2:this.getPayloadLength64($);break;case 3:this.getMask();break;case 4:this.getData($);break;case 5:case 6:this._loop=!1;return}while(this._loop);if(!this._errored)$()}getInfo($){if(this._bufferedBytes<2){this._loop=!1;return}let I=this.consume(2);if((I[0]&48)!==0){let u=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");$(u);return}let _=(I[0]&64)===64;if(_&&!this._extensions[sO.extensionName]){let u=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");$(u);return}if(this._fin=(I[0]&128)===128,this._opcode=I[0]&15,this._payloadLength=I[1]&127,this._opcode===0){if(_){let u=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");$(u);return}if(!this._fragmented){let u=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");$(u);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let u=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");$(u);return}this._compressed=_}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let u=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");$(u);return}if(_){let u=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");$(u);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let u=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");$(u);return}}else{let u=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");$(u);return}if(!this._fin&&!this._fragmented)this._fragmented=this._opcode;if(this._masked=(I[1]&128)===128,this._isServer){if(!this._masked){let u=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");$(u);return}}else if(this._masked){let u=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");$(u);return}if(this._payloadLength===126)this._state=1;else if(this._payloadLength===127)this._state=2;else this.haveLength($)}getPayloadLength16($){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength($)}getPayloadLength64($){if(this._bufferedBytes<8){this._loop=!1;return}let I=this.consume(8),_=I.readUInt32BE(0);if(_>Math.pow(2,21)-1){let u=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");$(u);return}this._payloadLength=_*Math.pow(2,32)+I.readUInt32BE(4),this.haveLength($)}haveLength($){if(this._payloadLength&&this._opcode<8){if(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0){let I=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");$(I);return}}if(this._masked)this._state=3;else this._state=4}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=4}getData($){let I=$T;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}if(I=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0)xC(I,this._mask)}if(this._opcode>7){this.controlMessage(I,$);return}if(this._compressed){this._state=5,this.decompress(I,$);return}if(I.length)this._messageLength=this._totalPayloadLength,this._fragments.push(I);this.dataMessage($)}decompress($,I){this._extensions[sO.extensionName].decompress($,this._fin,(u,U)=>{if(u)return I(u);if(U.length){if(this._messageLength+=U.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let z=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");I(z);return}this._fragments.push(U)}if(this.dataMessage(I),this._state===0)this.startLoop(I)})}dataMessage($){if(!this._fin){this._state=0;return}let I=this._messageLength,_=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let u;if(this._binaryType==="nodebuffer")u=CX(_,I);else if(this._binaryType==="arraybuffer")u=fC(CX(_,I));else if(this._binaryType==="blob")u=new Blob(_);else u=_;if(this._allowSynchronousEvents)this.emit("message",u,!0),this._state=0;else this._state=6,setImmediate(()=>{this.emit("message",u,!0),this._state=0,this.startLoop($)})}else{let u=CX(_,I);if(!this._skipUTF8Validation&&!IT(u)){let U=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");$(U);return}if(this._state===5||this._allowSynchronousEvents)this.emit("message",u,!1),this._state=0;else this._state=6,setImmediate(()=>{this.emit("message",u,!1),this._state=0,this.startLoop($)})}}controlMessage($,I){if(this._opcode===8){if($.length===0)this._loop=!1,this.emit("conclude",1005,$T),this.end();else{let _=$.readUInt16BE(0);if(!kC(_)){let U=this.createError(RangeError,`invalid status code ${_}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");I(U);return}let u=new w2($.buffer,$.byteOffset+2,$.length-2);if(!this._skipUTF8Validation&&!IT(u)){let U=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");I(U);return}this._loop=!1,this.emit("conclude",_,u),this.end()}this._state=0;return}if(this._allowSynchronousEvents)this.emit(this._opcode===9?"ping":"pong",$),this._state=0;else this._state=6,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",$),this._state=0,this.startLoop(I)})}createError($,I,_,u,U){this._loop=!1,this._errored=!0;let z=new $(_?`Invalid WebSocket frame: ${I}`:I);return Error.captureStackTrace(z,this.createError),z.code=U,z[EC]=u,z}}_T.exports=UT});var kX=w((bh,gT)=>{var{Duplex:Ph}=z$("stream"),{randomFillSync:yC}=z$("crypto"),uT=aI(),{EMPTY_BUFFER:iC,kWebSocket:lC,NOOP:mC}=g6(),{isBlob:R0,isValidStatusCode:rC}=V0(),{mask:zT,toBuffer:D1}=oI(),B4=Symbol("kByteLength"),nC=Buffer.alloc(4),M1,L0=8192,b4=0,hC=1,dC=2;class k6{constructor($,I,_){if(this._extensions=I||{},_)this._generateMask=_,this._maskBuffer=Buffer.alloc(4);this._socket=$,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=b4,this.onerror=mC,this[lC]=void 0}static frame($,I){let _,u=!1,U=2,z=!1;if(I.mask){if(_=I.maskBuffer||nC,I.generateMask)I.generateMask(_);else{if(L0===8192){if(M1===void 0)M1=Buffer.alloc(8192);yC(M1,0,8192),L0=0}_[0]=M1[L0++],_[1]=M1[L0++],_[2]=M1[L0++],_[3]=M1[L0++]}z=(_[0]|_[1]|_[2]|_[3])===0,U=6}let g;if(typeof $==="string")if((!I.mask||z)&&I[B4]!==void 0)g=I[B4];else $=Buffer.from($),g=$.length;else g=$.length,u=I.mask&&I.readOnly&&!z;let J=g;if(g>=65536)U+=8,J=127;else if(g>125)U+=2,J=126;let G=Buffer.allocUnsafe(u?g+U:U);if(G[0]=I.fin?I.opcode|128:I.opcode,I.rsv1)G[0]|=64;if(G[1]=J,J===126)G.writeUInt16BE(g,2);else if(J===127)G[2]=G[3]=0,G.writeUIntBE(g,4,6);if(!I.mask)return[G,$];if(G[1]|=128,G[U-4]=_[0],G[U-3]=_[1],G[U-2]=_[2],G[U-1]=_[3],z)return[G,$];if(u)return zT($,_,G,U,g),[G];return zT($,_,$,0,g),[G,$]}close($,I,_,u){let U;if($===void 0)U=iC;else if(typeof $!=="number"||!rC($))throw TypeError("First argument must be a valid error code number");else if(I===void 0||!I.length)U=Buffer.allocUnsafe(2),U.writeUInt16BE($,0);else{let g=Buffer.byteLength(I);if(g>123)throw RangeError("The message must not be greater than 123 bytes");if(U=Buffer.allocUnsafe(2+g),U.writeUInt16BE($,0),typeof I==="string")U.write(I,2);else U.set(I,2)}let z={[B4]:U.length,fin:!0,generateMask:this._generateMask,mask:_,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};if(this._state!==b4)this.enqueue([this.dispatch,U,!1,z,u]);else this.sendFrame(k6.frame(U,z),u)}ping($,I,_){let u,U;if(typeof $==="string")u=Buffer.byteLength($),U=!1;else if(R0($))u=$.size,U=!1;else $=D1($),u=$.length,U=D1.readOnly;if(u>125)throw RangeError("The data size must not be greater than 125 bytes");let z={[B4]:u,fin:!0,generateMask:this._generateMask,mask:I,maskBuffer:this._maskBuffer,opcode:9,readOnly:U,rsv1:!1};if(R0($))if(this._state!==b4)this.enqueue([this.getBlobData,$,!1,z,_]);else this.getBlobData($,!1,z,_);else if(this._state!==b4)this.enqueue([this.dispatch,$,!1,z,_]);else this.sendFrame(k6.frame($,z),_)}pong($,I,_){let u,U;if(typeof $==="string")u=Buffer.byteLength($),U=!1;else if(R0($))u=$.size,U=!1;else $=D1($),u=$.length,U=D1.readOnly;if(u>125)throw RangeError("The data size must not be greater than 125 bytes");let z={[B4]:u,fin:!0,generateMask:this._generateMask,mask:I,maskBuffer:this._maskBuffer,opcode:10,readOnly:U,rsv1:!1};if(R0($))if(this._state!==b4)this.enqueue([this.getBlobData,$,!1,z,_]);else this.getBlobData($,!1,z,_);else if(this._state!==b4)this.enqueue([this.dispatch,$,!1,z,_]);else this.sendFrame(k6.frame($,z),_)}send($,I,_){let u=this._extensions[uT.extensionName],U=I.binary?2:1,z=I.compress,g,J;if(typeof $==="string")g=Buffer.byteLength($),J=!1;else if(R0($))g=$.size,J=!1;else $=D1($),g=$.length,J=D1.readOnly;if(this._firstFragment){if(this._firstFragment=!1,z&&u&&u.params[u._isServer?"server_no_context_takeover":"client_no_context_takeover"])z=g>=u._threshold;this._compress=z}else z=!1,U=0;if(I.fin)this._firstFragment=!0;let G={[B4]:g,fin:I.fin,generateMask:this._generateMask,mask:I.mask,maskBuffer:this._maskBuffer,opcode:U,readOnly:J,rsv1:z};if(R0($))if(this._state!==b4)this.enqueue([this.getBlobData,$,this._compress,G,_]);else this.getBlobData($,this._compress,G,_);else if(this._state!==b4)this.enqueue([this.dispatch,$,this._compress,G,_]);else this.dispatch($,this._compress,G,_)}getBlobData($,I,_,u){this._bufferedBytes+=_[B4],this._state=dC,$.arrayBuffer().then((U)=>{if(this._socket.destroyed){let g=Error("The socket was closed while the blob was being read");process.nextTick(xX,this,g,u);return}this._bufferedBytes-=_[B4];let z=D1(U);if(!I)this._state=b4,this.sendFrame(k6.frame(z,_),u),this.dequeue();else this.dispatch(z,I,_,u)}).catch((U)=>{process.nextTick(cC,this,U,u)})}dispatch($,I,_,u){if(!I){this.sendFrame(k6.frame($,_),u);return}let U=this._extensions[uT.extensionName];this._bufferedBytes+=_[B4],this._state=hC,U.compress($,_.fin,(z,g)=>{if(this._socket.destroyed){let J=Error("The socket was closed while data was being compressed");xX(this,J,u);return}this._bufferedBytes-=_[B4],this._state=b4,_.readOnly=!1,this.sendFrame(k6.frame(g,_),u),this.dequeue()})}dequeue(){while(this._state===b4&&this._queue.length){let $=this._queue.shift();this._bufferedBytes-=$[3][B4],Reflect.apply($[0],this,$.slice(1))}}enqueue($){this._bufferedBytes+=$[3][B4],this._queue.push($)}sendFrame($,I){if($.length===2)this._socket.cork(),this._socket.write($[0]),this._socket.write($[1],I),this._socket.uncork();else this._socket.write($[0],I)}}gT.exports=k6;function xX($,I,_){if(typeof _==="function")_(I);for(let u=0;u<$._queue.length;u++){let U=$._queue[u],z=U[U.length-1];if(typeof z==="function")z(I)}}function cC($,I,_){xX($,I,_),$.onerror(I)}});var YT=w((Ah,HT)=>{var{kForOnEventAttribute:eI,kListener:yX}=g6(),JT=Symbol("kCode"),GT=Symbol("kData"),qT=Symbol("kError"),XT=Symbol("kMessage"),NT=Symbol("kReason"),Z0=Symbol("kTarget"),QT=Symbol("kType"),vT=Symbol("kWasClean");class y6{constructor($){this[Z0]=null,this[QT]=$}get target(){return this[Z0]}get type(){return this[QT]}}Object.defineProperty(y6.prototype,"target",{enumerable:!0});Object.defineProperty(y6.prototype,"type",{enumerable:!0});class W0 extends y6{constructor($,I={}){super($);this[JT]=I.code===void 0?0:I.code,this[NT]=I.reason===void 0?"":I.reason,this[vT]=I.wasClean===void 0?!1:I.wasClean}get code(){return this[JT]}get reason(){return this[NT]}get wasClean(){return this[vT]}}Object.defineProperty(W0.prototype,"code",{enumerable:!0});Object.defineProperty(W0.prototype,"reason",{enumerable:!0});Object.defineProperty(W0.prototype,"wasClean",{enumerable:!0});class sI extends y6{constructor($,I={}){super($);this[qT]=I.error===void 0?null:I.error,this[XT]=I.message===void 0?"":I.message}get error(){return this[qT]}get message(){return this[XT]}}Object.defineProperty(sI.prototype,"error",{enumerable:!0});Object.defineProperty(sI.prototype,"message",{enumerable:!0});class C2 extends y6{constructor($,I={}){super($);this[GT]=I.data===void 0?null:I.data}get data(){return this[GT]}}Object.defineProperty(C2.prototype,"data",{enumerable:!0});var pC={addEventListener($,I,_={}){for(let U of this.listeners($))if(!_[eI]&&U[yX]===I&&!U[eI])return;let u;if($==="message")u=function(z,g){let J=new C2("message",{data:g?z:z.toString()});J[Z0]=this,E2(I,this,J)};else if($==="close")u=function(z,g){let J=new W0("close",{code:z,reason:g.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});J[Z0]=this,E2(I,this,J)};else if($==="error")u=function(z){let g=new sI("error",{error:z,message:z.message});g[Z0]=this,E2(I,this,g)};else if($==="open")u=function(){let z=new y6("open");z[Z0]=this,E2(I,this,z)};else return;if(u[eI]=!!_[eI],u[yX]=I,_.once)this.once($,u);else this.on($,u)},removeEventListener($,I){for(let _ of this.listeners($))if(_[yX]===I&&!_[eI]){this.removeListener($,_);break}}};HT.exports={CloseEvent:W0,ErrorEvent:sI,Event:y6,EventTarget:pC,MessageEvent:C2};function E2($,I,_){if(typeof $==="object"&&$.handleEvent)$.handleEvent.call($,_);else $.call(I,_)}});var iX=w((jh,OT)=>{var{tokenChars:$U}=V0();function n4($,I,_){if($[I]===void 0)$[I]=[_];else $[I].push(_)}function oC($){let I=Object.create(null),_=Object.create(null),u=!1,U=!1,z=!1,g,J,G=-1,q=-1,N=-1,X=0;for(;X<$.length;X++)if(q=$.charCodeAt(X),g===void 0)if(N===-1&&$U[q]===1){if(G===-1)G=X}else if(X!==0&&(q===32||q===9)){if(N===-1&&G!==-1)N=X}else if(q===59||q===44){if(G===-1)throw SyntaxError(`Unexpected character at index ${X}`);if(N===-1)N=X;let H=$.slice(G,N);if(q===44)n4(I,H,_),_=Object.create(null);else g=H;G=N=-1}else throw SyntaxError(`Unexpected character at index ${X}`);else if(J===void 0)if(N===-1&&$U[q]===1){if(G===-1)G=X}else if(q===32||q===9){if(N===-1&&G!==-1)N=X}else if(q===59||q===44){if(G===-1)throw SyntaxError(`Unexpected character at index ${X}`);if(N===-1)N=X;if(n4(_,$.slice(G,N),!0),q===44)n4(I,g,_),_=Object.create(null),g=void 0;G=N=-1}else if(q===61&&G!==-1&&N===-1)J=$.slice(G,X),G=N=-1;else throw SyntaxError(`Unexpected character at index ${X}`);else if(U){if($U[q]!==1)throw SyntaxError(`Unexpected character at index ${X}`);if(G===-1)G=X;else if(!u)u=!0;U=!1}else if(z)if($U[q]===1){if(G===-1)G=X}else if(q===34&&G!==-1)z=!1,N=X;else if(q===92)U=!0;else throw SyntaxError(`Unexpected character at index ${X}`);else if(q===34&&$.charCodeAt(X-1)===61)z=!0;else if(N===-1&&$U[q]===1){if(G===-1)G=X}else if(G!==-1&&(q===32||q===9)){if(N===-1)N=X}else if(q===59||q===44){if(G===-1)throw SyntaxError(`Unexpected character at index ${X}`);if(N===-1)N=X;let H=$.slice(G,N);if(u)H=H.replace(/\\/g,""),u=!1;if(n4(_,J,H),q===44)n4(I,g,_),_=Object.create(null),g=void 0;J=void 0,G=N=-1}else throw SyntaxError(`Unexpected character at index ${X}`);if(G===-1||z||q===32||q===9)throw SyntaxError("Unexpected end of input");if(N===-1)N=X;let Q=$.slice(G,N);if(g===void 0)n4(I,Q,_);else{if(J===void 0)n4(_,Q,!0);else if(u)n4(_,J,Q.replace(/\\/g,""));else n4(_,J,Q);n4(I,g,_)}return I}function tC($){return Object.keys($).map((I)=>{let _=$[I];if(!Array.isArray(_))_=[_];return _.map((u)=>{return[I].concat(Object.keys(u).map((U)=>{let z=u[U];if(!Array.isArray(z))z=[z];return z.map((g)=>g===!0?U:`${U}=${g}`).join("; ")})).join("; ")}).join(", ")}).join(", ")}OT.exports={format:tC,parse:oC}});var y2=w((wh,bT)=>{var aC=z$("events"),eC=z$("https"),sC=z$("http"),DT=z$("net"),$f=z$("tls"),{randomBytes:If,createHash:Uf}=z$("crypto"),{Duplex:Fh,Readable:Sh}=z$("stream"),{URL:lX}=z$("url"),i6=aI(),_f=fX(),uf=kX(),{isBlob:zf}=V0(),{BINARY_TYPES:TT,CLOSE_TIMEOUT:gf,EMPTY_BUFFER:f2,GUID:Jf,kForOnEventAttribute:mX,kListener:Gf,kStatusCode:qf,kWebSocket:F$,NOOP:MT}=g6(),{EventTarget:{addEventListener:Xf,removeEventListener:Nf}}=YT(),{format:Qf,parse:vf}=iX(),{toBuffer:Hf}=oI(),KT=Symbol("kAborted"),rX=[8,13],G6=["CONNECTING","OPEN","CLOSING","CLOSED"],Yf=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;class h extends aC{constructor($,I,_){super();if(this._binaryType=TT[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=f2,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=h.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,$!==null){if(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,I===void 0)I=[];else if(!Array.isArray(I))if(typeof I==="object"&&I!==null)_=I,I=[];else I=[I];VT(this,$,I,_)}else this._autoPong=_.autoPong,this._closeTimeout=_.closeTimeout,this._isServer=!0}get binaryType(){return this._binaryType}set binaryType($){if(!TT.includes($))return;if(this._binaryType=$,this._receiver)this._receiver._binaryType=$}get bufferedAmount(){if(!this._socket)return this._bufferedAmount;return this._socket._writableState.length+this._sender._bufferedBytes}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket($,I,_){let u=new _f({allowSynchronousEvents:_.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:_.maxPayload,skipUTF8Validation:_.skipUTF8Validation}),U=new uf($,this._extensions,_.generateMask);if(this._receiver=u,this._sender=U,this._socket=$,u[F$]=this,U[F$]=this,$[F$]=this,u.on("conclude",Bf),u.on("drain",Df),u.on("error",Mf),u.on("message",Kf),u.on("ping",Vf),u.on("pong",Rf),U.onerror=Lf,$.setTimeout)$.setTimeout(0);if($.setNoDelay)$.setNoDelay();if(I.length>0)$.unshift(I);$.on("close",ZT),$.on("data",k2),$.on("end",WT),$.on("error",PT),this._readyState=h.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=h.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}if(this._extensions[i6.extensionName])this._extensions[i6.extensionName].cleanup();this._receiver.removeAllListeners(),this._readyState=h.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close($,I){if(this.readyState===h.CLOSED)return;if(this.readyState===h.CONNECTING){q4(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===h.CLOSING){if(this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted))this._socket.end();return}this._readyState=h.CLOSING,this._sender.close($,I,!this._isServer,(_)=>{if(_)return;if(this._closeFrameSent=!0,this._closeFrameReceived||this._receiver._writableState.errorEmitted)this._socket.end()}),LT(this)}pause(){if(this.readyState===h.CONNECTING||this.readyState===h.CLOSED)return;this._paused=!0,this._socket.pause()}ping($,I,_){if(this.readyState===h.CONNECTING)throw Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof $==="function")_=$,$=I=void 0;else if(typeof I==="function")_=I,I=void 0;if(typeof $==="number")$=$.toString();if(this.readyState!==h.OPEN){nX(this,$,_);return}if(I===void 0)I=!this._isServer;this._sender.ping($||f2,I,_)}pong($,I,_){if(this.readyState===h.CONNECTING)throw Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof $==="function")_=$,$=I=void 0;else if(typeof I==="function")_=I,I=void 0;if(typeof $==="number")$=$.toString();if(this.readyState!==h.OPEN){nX(this,$,_);return}if(I===void 0)I=!this._isServer;this._sender.pong($||f2,I,_)}resume(){if(this.readyState===h.CONNECTING||this.readyState===h.CLOSED)return;if(this._paused=!1,!this._receiver._writableState.needDrain)this._socket.resume()}send($,I,_){if(this.readyState===h.CONNECTING)throw Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof I==="function")_=I,I={};if(typeof $==="number")$=$.toString();if(this.readyState!==h.OPEN){nX(this,$,_);return}let u={binary:typeof $!=="string",mask:!this._isServer,compress:!0,fin:!0,...I};if(!this._extensions[i6.extensionName])u.compress=!1;this._sender.send($||f2,u,_)}terminate(){if(this.readyState===h.CLOSED)return;if(this.readyState===h.CONNECTING){q4(this,this._req,"WebSocket was closed before the connection was established");return}if(this._socket)this._readyState=h.CLOSING,this._socket.destroy()}}Object.defineProperty(h,"CONNECTING",{enumerable:!0,value:G6.indexOf("CONNECTING")});Object.defineProperty(h.prototype,"CONNECTING",{enumerable:!0,value:G6.indexOf("CONNECTING")});Object.defineProperty(h,"OPEN",{enumerable:!0,value:G6.indexOf("OPEN")});Object.defineProperty(h.prototype,"OPEN",{enumerable:!0,value:G6.indexOf("OPEN")});Object.defineProperty(h,"CLOSING",{enumerable:!0,value:G6.indexOf("CLOSING")});Object.defineProperty(h.prototype,"CLOSING",{enumerable:!0,value:G6.indexOf("CLOSING")});Object.defineProperty(h,"CLOSED",{enumerable:!0,value:G6.indexOf("CLOSED")});Object.defineProperty(h.prototype,"CLOSED",{enumerable:!0,value:G6.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(($)=>{Object.defineProperty(h.prototype,$,{enumerable:!0})});["open","error","close","message"].forEach(($)=>{Object.defineProperty(h.prototype,`on${$}`,{enumerable:!0,get(){for(let I of this.listeners($))if(I[mX])return I[Gf];return null},set(I){for(let _ of this.listeners($))if(_[mX]){this.removeListener($,_);break}if(typeof I!=="function")return;this.addEventListener($,I,{[mX]:!0})}})});h.prototype.addEventListener=Xf;h.prototype.removeEventListener=Nf;bT.exports=h;function VT($,I,_,u){let U={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:gf,protocolVersion:rX[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...u,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if($._autoPong=U.autoPong,$._closeTimeout=U.closeTimeout,!rX.includes(U.protocolVersion))throw RangeError(`Unsupported protocol version: ${U.protocolVersion} (supported versions: ${rX.join(", ")})`);let z;if(I instanceof lX)z=I;else try{z=new lX(I)}catch(v){throw SyntaxError(`Invalid URL: ${I}`)}if(z.protocol==="http:")z.protocol="ws:";else if(z.protocol==="https:")z.protocol="wss:";$._url=z.href;let g=z.protocol==="wss:",J=z.protocol==="ws+unix:",G;if(z.protocol!=="ws:"&&!g&&!J)G=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`;else if(J&&!z.pathname)G="The URL's pathname is empty";else if(z.hash)G="The URL contains a fragment identifier";if(G){let v=SyntaxError(G);if($._redirects===0)throw v;else{x2($,v);return}}let q=g?443:80,N=If(16).toString("base64"),X=g?eC.request:sC.request,Q=new Set,H;if(U.createConnection=U.createConnection||(g?Tf:Of),U.defaultPort=U.defaultPort||q,U.port=z.port||q,U.host=z.hostname.startsWith("[")?z.hostname.slice(1,-1):z.hostname,U.headers={...U.headers,"Sec-WebSocket-Version":U.protocolVersion,"Sec-WebSocket-Key":N,Connection:"Upgrade",Upgrade:"websocket"},U.path=z.pathname+z.search,U.timeout=U.handshakeTimeout,U.perMessageDeflate)H=new i6(U.perMessageDeflate!==!0?U.perMessageDeflate:{},!1,U.maxPayload),U.headers["Sec-WebSocket-Extensions"]=Qf({[i6.extensionName]:H.offer()});if(_.length){for(let v of _){if(typeof v!=="string"||!Yf.test(v)||Q.has(v))throw SyntaxError("An invalid or duplicated subprotocol was specified");Q.add(v)}U.headers["Sec-WebSocket-Protocol"]=_.join(",")}if(U.origin)if(U.protocolVersion<13)U.headers["Sec-WebSocket-Origin"]=U.origin;else U.headers.Origin=U.origin;if(z.username||z.password)U.auth=`${z.username}:${z.password}`;if(J){let v=U.path.split(":");U.socketPath=v[0],U.path=v[1]}let Y;if(U.followRedirects){if($._redirects===0){$._originalIpc=J,$._originalSecure=g,$._originalHostOrSocketPath=J?U.socketPath:z.host;let v=u&&u.headers;if(u={...u,headers:{}},v)for(let[O,T]of Object.entries(v))u.headers[O.toLowerCase()]=T}else if($.listenerCount("redirect")===0){let v=J?$._originalIpc?U.socketPath===$._originalHostOrSocketPath:!1:$._originalIpc?!1:z.host===$._originalHostOrSocketPath;if(!v||$._originalSecure&&!g){if(delete U.headers.authorization,delete U.headers.cookie,!v)delete U.headers.host;U.auth=void 0}}if(U.auth&&!u.headers.authorization)u.headers.authorization="Basic "+Buffer.from(U.auth).toString("base64");if(Y=$._req=X(U),$._redirects)$.emit("redirect",$.url,Y)}else Y=$._req=X(U);if(U.timeout)Y.on("timeout",()=>{q4($,Y,"Opening handshake has timed out")});if(Y.on("error",(v)=>{if(Y===null||Y[KT])return;Y=$._req=null,x2($,v)}),Y.on("response",(v)=>{let O=v.headers.location,T=v.statusCode;if(O&&U.followRedirects&&T>=300&&T<400){if(++$._redirects>U.maxRedirects){q4($,Y,"Maximum redirects exceeded");return}Y.abort();let L;try{L=new lX(O,I)}catch(V){let R=SyntaxError(`Invalid URL: ${O}`);x2($,R);return}VT($,L,_,u)}else if(!$.emit("unexpected-response",Y,v))q4($,Y,`Unexpected server response: ${v.statusCode}`)}),Y.on("upgrade",(v,O,T)=>{if($.emit("upgrade",v),$.readyState!==h.CONNECTING)return;Y=$._req=null;let L=v.headers.upgrade;if(L===void 0||L.toLowerCase()!=="websocket"){q4($,O,"Invalid Upgrade header");return}let V=Uf("sha1").update(N+Jf).digest("base64");if(v.headers["sec-websocket-accept"]!==V){q4($,O,"Invalid Sec-WebSocket-Accept header");return}let R=v.headers["sec-websocket-protocol"],M;if(R!==void 0){if(!Q.size)M="Server sent a subprotocol but none was requested";else if(!Q.has(R))M="Server sent an invalid subprotocol"}else if(Q.size)M="Server sent no subprotocol";if(M){q4($,O,M);return}if(R)$._protocol=R;let Z=v.headers["sec-websocket-extensions"];if(Z!==void 0){if(!H){q4($,O,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let K;try{K=vf(Z)}catch(S){q4($,O,"Invalid Sec-WebSocket-Extensions header");return}let D=Object.keys(K);if(D.length!==1||D[0]!==i6.extensionName){q4($,O,"Server indicated an extension that was not requested");return}try{H.accept(K[i6.extensionName])}catch(S){q4($,O,"Invalid Sec-WebSocket-Extensions header");return}$._extensions[i6.extensionName]=H}$.setSocket(O,T,{allowSynchronousEvents:U.allowSynchronousEvents,generateMask:U.generateMask,maxPayload:U.maxPayload,skipUTF8Validation:U.skipUTF8Validation})}),U.finishRequest)U.finishRequest(Y,$);else Y.end()}function x2($,I){$._readyState=h.CLOSING,$._errorEmitted=!0,$.emit("error",I),$.emitClose()}function Of($){return $.path=$.socketPath,DT.connect($)}function Tf($){if($.path=void 0,!$.servername&&$.servername!=="")$.servername=DT.isIP($.host)?"":$.host;return $f.connect($)}function q4($,I,_){$._readyState=h.CLOSING;let u=Error(_);if(Error.captureStackTrace(u,q4),I.setHeader){if(I[KT]=!0,I.abort(),I.socket&&!I.socket.destroyed)I.socket.destroy();process.nextTick(x2,$,u)}else I.destroy(u),I.once("error",$.emit.bind($,"error")),I.once("close",$.emitClose.bind($))}function nX($,I,_){if(I){let u=zf(I)?I.size:Hf(I).length;if($._socket)$._sender._bufferedBytes+=u;else $._bufferedAmount+=u}if(_){let u=Error(`WebSocket is not open: readyState ${$.readyState} (${G6[$.readyState]})`);process.nextTick(_,u)}}function Bf($,I){let _=this[F$];if(_._closeFrameReceived=!0,_._closeMessage=I,_._closeCode=$,_._socket[F$]===void 0)return;if(_._socket.removeListener("data",k2),process.nextTick(RT,_._socket),$===1005)_.close();else _.close($,I)}function Df(){let $=this[F$];if(!$.isPaused)$._socket.resume()}function Mf($){let I=this[F$];if(I._socket[F$]!==void 0)I._socket.removeListener("data",k2),process.nextTick(RT,I._socket),I.close($[qf]);if(!I._errorEmitted)I._errorEmitted=!0,I.emit("error",$)}function BT(){this[F$].emitClose()}function Kf($,I){this[F$].emit("message",$,I)}function Vf($){let I=this[F$];if(I._autoPong)I.pong($,!this._isServer,MT);I.emit("ping",$)}function Rf($){this[F$].emit("pong",$)}function RT($){$.resume()}function Lf($){let I=this[F$];if(I.readyState===h.CLOSED)return;if(I.readyState===h.OPEN)I._readyState=h.CLOSING,LT(I);if(this._socket.end(),!I._errorEmitted)I._errorEmitted=!0,I.emit("error",$)}function LT($){$._closeTimer=setTimeout($._socket.destroy.bind($._socket),$._closeTimeout)}function ZT(){let $=this[F$];if(this.removeListener("close",ZT),this.removeListener("data",k2),this.removeListener("end",WT),$._readyState=h.CLOSING,!this._readableState.endEmitted&&!$._closeFrameReceived&&!$._receiver._writableState.errorEmitted&&this._readableState.length!==0){let I=this.read(this._readableState.length);$._receiver.write(I)}if($._receiver.end(),this[F$]=void 0,clearTimeout($._closeTimer),$._receiver._writableState.finished||$._receiver._writableState.errorEmitted)$.emitClose();else $._receiver.on("error",BT),$._receiver.on("finish",BT)}function k2($){if(!this[F$]._receiver.write($))this.pause()}function WT(){let $=this[F$];$._readyState=h.CLOSING,$._receiver.end(),this.end()}function PT(){let $=this[F$];if(this.removeListener("error",PT),this.on("error",MT),$)$._readyState=h.CLOSING,this.destroy()}});var ST=w((Ch,FT)=>{var Eh=y2(),{Duplex:Zf}=z$("stream");function AT($){$.emit("close")}function Wf(){if(!this.destroyed&&this._writableState.finished)this.destroy()}function jT($){if(this.removeListener("error",jT),this.destroy(),this.listenerCount("error")===0)this.emit("error",$)}function Pf($,I){let _=!0,u=new Zf({...I,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return $.on("message",function(z,g){let J=!g&&u._readableState.objectMode?z.toString():z;if(!u.push(J))$.pause()}),$.once("error",function(z){if(u.destroyed)return;_=!1,u.destroy(z)}),$.once("close",function(){if(u.destroyed)return;u.push(null)}),u._destroy=function(U,z){if($.readyState===$.CLOSED){z(U),process.nextTick(AT,u);return}let g=!1;if($.once("error",function(G){g=!0,z(G)}),$.once("close",function(){if(!g)z(U);process.nextTick(AT,u)}),_)$.terminate()},u._final=function(U){if($.readyState===$.CONNECTING){$.once("open",function(){u._final(U)});return}if($._socket===null)return;if($._socket._writableState.finished){if(U(),u._readableState.endEmitted)u.destroy()}else $._socket.once("finish",function(){U()}),$.close()},u._read=function(){if($.isPaused)$.resume()},u._write=function(U,z,g){if($.readyState===$.CONNECTING){$.once("open",function(){u._write(U,z,g)});return}$.send(U,g)},u.on("end",Wf),u.on("error",jT),u}FT.exports=Pf});var ET=w((fh,wT)=>{var{tokenChars:bf}=V0();function Af($){let I=new Set,_=-1,u=-1,U=0;for(U;U<$.length;U++){let g=$.charCodeAt(U);if(u===-1&&bf[g]===1){if(_===-1)_=U}else if(U!==0&&(g===32||g===9)){if(u===-1&&_!==-1)u=U}else if(g===44){if(_===-1)throw SyntaxError(`Unexpected character at index ${U}`);if(u===-1)u=U;let J=$.slice(_,u);if(I.has(J))throw SyntaxError(`The "${J}" subprotocol is duplicated`);I.add(J),_=u=-1}else throw SyntaxError(`Unexpected character at index ${U}`)}if(_===-1||u!==-1)throw SyntaxError("Unexpected end of input");let z=$.slice(_,U);if(I.has(z))throw SyntaxError(`The "${z}" subprotocol is duplicated`);return I.add(z),I}wT.exports={parse:Af}});var yT=w((kh,kT)=>{var jf=z$("events"),i2=z$("http"),{Duplex:xh}=z$("stream"),{createHash:Ff}=z$("crypto"),CT=iX(),K1=aI(),Sf=ET(),wf=y2(),{CLOSE_TIMEOUT:Ef,GUID:Cf,kWebSocket:ff}=g6(),xf=/^[+/0-9A-Za-z]{22}==$/;class xT extends jf{constructor($,I){super();if($={allowSynchronousEvents:!0,autoPong:!0,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:Ef,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:wf,...$},$.port==null&&!$.server&&!$.noServer||$.port!=null&&($.server||$.noServer)||$.server&&$.noServer)throw TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if($.port!=null)this._server=i2.createServer((_,u)=>{let U=i2.STATUS_CODES[426];u.writeHead(426,{"Content-Length":U.length,"Content-Type":"text/plain"}),u.end(U)}),this._server.listen($.port,$.host,$.backlog,I);else if($.server)this._server=$.server;if(this._server){let _=this.emit.bind(this,"connection");this._removeListeners=kf(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(u,U,z)=>{this.handleUpgrade(u,U,z,_)}})}if($.perMessageDeflate===!0)$.perMessageDeflate={};if($.clientTracking)this.clients=new Set,this._shouldEmitClose=!1;this.options=$,this._state=0}address(){if(this.options.noServer)throw Error('The server is operating in "noServer" mode');if(!this._server)return null;return this._server.address()}close($){if(this._state===2){if($)this.once("close",()=>{$(Error("The server is not running"))});process.nextTick(IU,this);return}if($)this.once("close",$);if(this._state===1)return;if(this._state=1,this.options.noServer||this.options.server){if(this._server)this._removeListeners(),this._removeListeners=this._server=null;if(this.clients)if(!this.clients.size)process.nextTick(IU,this);else this._shouldEmitClose=!0;else process.nextTick(IU,this)}else{let I=this._server;this._removeListeners(),this._removeListeners=this._server=null,I.close(()=>{IU(this)})}}shouldHandle($){if(this.options.path){let I=$.url.indexOf("?");if((I!==-1?$.url.slice(0,I):$.url)!==this.options.path)return!1}return!0}handleUpgrade($,I,_,u){I.on("error",fT);let U=$.headers["sec-websocket-key"],z=$.headers.upgrade,g=+$.headers["sec-websocket-version"];if($.method!=="GET"){V1(this,$,I,405,"Invalid HTTP method");return}if(z===void 0||z.toLowerCase()!=="websocket"){V1(this,$,I,400,"Invalid Upgrade header");return}if(U===void 0||!xf.test(U)){V1(this,$,I,400,"Missing or invalid Sec-WebSocket-Key header");return}if(g!==13&&g!==8){V1(this,$,I,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle($)){UU(I,400);return}let J=$.headers["sec-websocket-protocol"],G=new Set;if(J!==void 0)try{G=Sf.parse(J)}catch(X){V1(this,$,I,400,"Invalid Sec-WebSocket-Protocol header");return}let q=$.headers["sec-websocket-extensions"],N={};if(this.options.perMessageDeflate&&q!==void 0){let X=new K1(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let Q=CT.parse(q);if(Q[K1.extensionName])X.accept(Q[K1.extensionName]),N[K1.extensionName]=X}catch(Q){V1(this,$,I,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let X={origin:$.headers[`${g===8?"sec-websocket-origin":"origin"}`],secure:!!($.socket.authorized||$.socket.encrypted),req:$};if(this.options.verifyClient.length===2){this.options.verifyClient(X,(Q,H,Y,v)=>{if(!Q)return UU(I,H||401,Y,v);this.completeUpgrade(N,U,G,$,I,_,u)});return}if(!this.options.verifyClient(X))return UU(I,401)}this.completeUpgrade(N,U,G,$,I,_,u)}completeUpgrade($,I,_,u,U,z,g){if(!U.readable||!U.writable)return U.destroy();if(U[ff])throw Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>0)return UU(U,503);let G=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${Ff("sha1").update(I+Cf).digest("base64")}`],q=new this.options.WebSocket(null,void 0,this.options);if(_.size){let N=this.options.handleProtocols?this.options.handleProtocols(_,u):_.values().next().value;if(N)G.push(`Sec-WebSocket-Protocol: ${N}`),q._protocol=N}if($[K1.extensionName]){let N=$[K1.extensionName].params,X=CT.format({[K1.extensionName]:[N]});G.push(`Sec-WebSocket-Extensions: ${X}`),q._extensions=$}if(this.emit("headers",G,u),U.write(G.concat(`\r
|
|
267
267
|
`).join(`\r
|
|
268
|
-
`)),U.removeListener("error",
|
|
268
|
+
`)),U.removeListener("error",fT),q.setSocket(U,z,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients)this.clients.add(q),q.on("close",()=>{if(this.clients.delete(q),this._shouldEmitClose&&!this.clients.size)process.nextTick(IU,this)});g(q,u)}}kT.exports=xT;function kf($,I){for(let _ of Object.keys(I))$.on(_,I[_]);return function(){for(let u of Object.keys(I))$.removeListener(u,I[u])}}function IU($){$._state=2,$.emit("close")}function fT(){this.destroy()}function UU($,I,_,u){_=_||i2.STATUS_CODES[I],u={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(_),...u},$.once("finish",$.destroy),$.end(`HTTP/1.1 ${I} ${i2.STATUS_CODES[I]}\r
|
|
269
269
|
`+Object.keys(u).map((U)=>`${U}: ${u[U]}`).join(`\r
|
|
270
270
|
`)+`\r
|
|
271
271
|
\r
|
|
272
|
-
`+_)}function L1($,I,_,u,U,z){if($.listenerCount("wsClientError")){let g=Error(U);Error.captureStackTrace(g,L1),$.emit("wsClientError",g,_,I)}else UU(_,u,U,z)}});var DX=N$(BX(),1),{program:yx,createCommand:ix,createArgument:lx,createOption:rx,CommanderError:mx,InvalidArgumentError:nx,InvalidOptionArgumentError:hx,Command:$z,Argument:dx,Option:cx,Help:px}=DX.default;var r=N$(b$(),1);import{execSync as rj,spawn as Gv}from"node:child_process";import k from"node:fs";import{tmpdir as f2}from"node:os";import $$ from"node:path";var QP=$g(),YP=p0(),HP=kz(),Ng=o0(),OP=w0(),T6=U$(),TP=N6(),BP=Z$(),DP=Y6(),MP=H6(),Yy=tU(),KP=vg(),VP=qg(),LP=Xg(),sU=bN(),AN=F0();var RP=QP.Composer,ZP=YP.Document,WP=HP.Schema,PP=Ng.YAMLError,bP=Ng.YAMLParseError,AP=Ng.YAMLWarning,jP=OP.Alias,FP=T6.isAlias,SP=T6.isCollection,wP=T6.isDocument,EP=T6.isMap,CP=T6.isNode,fP=T6.isPair,xP=T6.isScalar,kP=T6.isSeq,yP=TP.Pair,iP=BP.Scalar,lP=DP.YAMLMap,rP=MP.YAMLSeq;var mP=KP.Lexer,nP=VP.LineCounter,hP=LP.Parser,p6=sU.parse,dP=sU.parseAllDocuments,cP=sU.parseDocument,pP=sU.stringify,oP=AN.visit,tP=AN.visitAsync;var g$={};F4(g$,{xor:()=>U7,xid:()=>ZQ,void:()=>tQ,uuidv7:()=>TQ,uuidv6:()=>OQ,uuidv4:()=>HQ,uuid:()=>YQ,util:()=>S,url:()=>BQ,uppercase:()=>c1,unknown:()=>U1,union:()=>P2,undefined:()=>pQ,ulid:()=>RQ,uint64:()=>dQ,uint32:()=>mQ,tuple:()=>AG,trim:()=>s1,treeifyError:()=>Rg,transform:()=>A2,toUpperCase:()=>I0,toLowerCase:()=>$0,toJSONSchema:()=>$2,templateLiteral:()=>H7,symbol:()=>cQ,superRefine:()=>Uv,success:()=>N7,stringbool:()=>L7,stringFormat:()=>fQ,string:()=>g2,strictObject:()=>$7,startsWith:()=>o1,slugify:()=>U0,size:()=>s6,setErrorMap:()=>Pj,set:()=>J7,safeParseAsync:()=>_G,safeParse:()=>UG,safeEncodeAsync:()=>qG,safeEncode:()=>GG,safeDecodeAsync:()=>XG,safeDecode:()=>vG,registry:()=>Z_,regexes:()=>Q4,regex:()=>h1,refine:()=>Iv,record:()=>jG,readonly:()=>oG,property:()=>t_,promise:()=>O7,prettifyError:()=>Zg,preprocess:()=>Z7,prefault:()=>rG,positive:()=>d_,pipe:()=>bI,partialRecord:()=>u7,parseAsync:()=>IG,parse:()=>$G,overwrite:()=>K4,optional:()=>WI,object:()=>sQ,number:()=>QG,nullish:()=>X7,nullable:()=>PI,null:()=>BG,normalize:()=>e1,nonpositive:()=>p_,nonoptional:()=>mG,nonnegative:()=>o_,never:()=>W2,negative:()=>c_,nativeEnum:()=>G7,nanoid:()=>KQ,nan:()=>Q7,multipleOf:()=>V6,minSize:()=>x4,minLength:()=>t4,mime:()=>a1,meta:()=>K7,maxSize:()=>L6,maxLength:()=>$1,map:()=>g7,mac:()=>bQ,lte:()=>u4,lt:()=>C4,lowercase:()=>d1,looseRecord:()=>z7,looseObject:()=>I7,locales:()=>KI,literal:()=>v7,length:()=>I1,lazy:()=>eG,ksuid:()=>WQ,keyof:()=>eQ,jwt:()=>CQ,json:()=>R7,iso:()=>z0,ipv6:()=>AQ,ipv4:()=>PQ,intersection:()=>PG,int64:()=>hQ,int32:()=>rQ,int:()=>J2,instanceof:()=>V7,includes:()=>p1,httpUrl:()=>DQ,hostname:()=>xQ,hex:()=>kQ,hash:()=>yQ,guid:()=>QQ,gte:()=>l$,gt:()=>f4,globalRegistry:()=>S$,getErrorMap:()=>bj,function:()=>T7,fromJSONSchema:()=>P7,formatError:()=>qI,float64:()=>lQ,float32:()=>iQ,flattenError:()=>vI,file:()=>q7,exactOptional:()=>xG,enum:()=>b2,endsWith:()=>t1,encodeAsync:()=>gG,encode:()=>uG,emoji:()=>MQ,email:()=>NQ,e164:()=>EQ,discriminatedUnion:()=>_7,describe:()=>M7,decodeAsync:()=>JG,decode:()=>zG,date:()=>aQ,custom:()=>D7,cuid2:()=>LQ,cuid:()=>VQ,core:()=>a4,config:()=>L$,coerce:()=>uv,codec:()=>Y7,clone:()=>i$,cidrv6:()=>FQ,cidrv4:()=>jQ,check:()=>B7,catch:()=>dG,boolean:()=>YG,bigint:()=>nQ,base64url:()=>wQ,base64:()=>SQ,array:()=>FI,any:()=>oQ,_function:()=>T7,_default:()=>iG,_ZodString:()=>G2,ZodXor:()=>RG,ZodXID:()=>H2,ZodVoid:()=>VG,ZodUnknown:()=>MG,ZodUnion:()=>wI,ZodUndefined:()=>OG,ZodUUID:()=>k4,ZodURL:()=>AI,ZodULID:()=>Y2,ZodType:()=>p,ZodTuple:()=>bG,ZodTransform:()=>CG,ZodTemplateLiteral:()=>tG,ZodSymbol:()=>HG,ZodSuccess:()=>nG,ZodStringFormat:()=>G$,ZodString:()=>J0,ZodSet:()=>SG,ZodRecord:()=>EI,ZodRealError:()=>e$,ZodReadonly:()=>pG,ZodPromise:()=>sG,ZodPrefault:()=>lG,ZodPipe:()=>S2,ZodOptional:()=>j2,ZodObject:()=>SI,ZodNumberFormat:()=>_1,ZodNumber:()=>v0,ZodNullable:()=>kG,ZodNull:()=>TG,ZodNonOptional:()=>F2,ZodNever:()=>KG,ZodNanoID:()=>X2,ZodNaN:()=>cG,ZodMap:()=>FG,ZodMAC:()=>NG,ZodLiteral:()=>wG,ZodLazy:()=>aG,ZodKSUID:()=>O2,ZodJWT:()=>R2,ZodIssueCode:()=>Wj,ZodIntersection:()=>WG,ZodISOTime:()=>u2,ZodISODuration:()=>z2,ZodISODateTime:()=>U2,ZodISODate:()=>_2,ZodIPv6:()=>B2,ZodIPv4:()=>T2,ZodGUID:()=>ZI,ZodFunction:()=>$v,ZodFirstPartyTypeKind:()=>_v,ZodFile:()=>EG,ZodExactOptional:()=>fG,ZodError:()=>Rj,ZodEnum:()=>g0,ZodEmoji:()=>q2,ZodEmail:()=>v2,ZodE164:()=>L2,ZodDiscriminatedUnion:()=>ZG,ZodDefault:()=>yG,ZodDate:()=>jI,ZodCustomStringFormat:()=>G0,ZodCustom:()=>CI,ZodCodec:()=>w2,ZodCatch:()=>hG,ZodCUID2:()=>Q2,ZodCUID:()=>N2,ZodCIDRv6:()=>M2,ZodCIDRv4:()=>D2,ZodBoolean:()=>q0,ZodBigIntFormat:()=>Z2,ZodBigInt:()=>X0,ZodBase64URL:()=>V2,ZodBase64:()=>K2,ZodArray:()=>LG,ZodAny:()=>DG,TimePrecision:()=>A3,NEVER:()=>Qg,$output:()=>L3,$input:()=>R3,$brand:()=>Yg});var a4={};F4(a4,{version:()=>MJ,util:()=>S,treeifyError:()=>Rg,toJSONSchema:()=>$2,toDotPath:()=>CN,safeParseAsync:()=>Pg,safeParse:()=>Wg,safeEncodeAsync:()=>Ab,safeEncode:()=>Pb,safeDecodeAsync:()=>jb,safeDecode:()=>bb,registry:()=>Z_,regexes:()=>Q4,process:()=>u$,prettifyError:()=>Zg,parseAsync:()=>__,parse:()=>U_,meta:()=>v9,locales:()=>KI,isValidJWT:()=>$Q,isValidBase64URL:()=>sN,isValidBase64:()=>rJ,initializeContext:()=>R6,globalRegistry:()=>S$,globalConfig:()=>II,formatError:()=>qI,flattenError:()=>vI,finalize:()=>W6,extractDefs:()=>Z6,encodeAsync:()=>Zb,encode:()=>Lb,describe:()=>G9,decodeAsync:()=>Wb,decode:()=>Rb,createToJSONSchemaMethod:()=>X9,createStandardJSONSchemaMethod:()=>u0,config:()=>L$,clone:()=>i$,_xor:()=>$j,_xid:()=>f_,_void:()=>s3,_uuidv7:()=>j_,_uuidv6:()=>A_,_uuidv4:()=>b_,_uuid:()=>P_,_url:()=>LI,_uppercase:()=>c1,_unknown:()=>a3,_union:()=>sA,_undefined:()=>p3,_ulid:()=>C_,_uint64:()=>d3,_uint32:()=>i3,_tuple:()=>_j,_trim:()=>s1,_transform:()=>qj,_toUpperCase:()=>I0,_toLowerCase:()=>$0,_templateLiteral:()=>Dj,_symbol:()=>c3,_superRefine:()=>J9,_success:()=>Hj,_stringbool:()=>q9,_stringFormat:()=>_0,_string:()=>W3,_startsWith:()=>o1,_slugify:()=>U0,_size:()=>s6,_set:()=>gj,_safeParseAsync:()=>r1,_safeParse:()=>l1,_safeEncodeAsync:()=>q_,_safeEncode:()=>G_,_safeDecodeAsync:()=>X_,_safeDecode:()=>v_,_regex:()=>h1,_refine:()=>g9,_record:()=>uj,_readonly:()=>Bj,_property:()=>t_,_promise:()=>Kj,_positive:()=>d_,_pipe:()=>Tj,_parseAsync:()=>i1,_parse:()=>y1,_overwrite:()=>K4,_optional:()=>Xj,_number:()=>E3,_nullable:()=>Nj,_null:()=>o3,_normalize:()=>e1,_nonpositive:()=>p_,_nonoptional:()=>Yj,_nonnegative:()=>o_,_never:()=>e3,_negative:()=>c_,_nativeEnum:()=>Gj,_nanoid:()=>S_,_nan:()=>U9,_multipleOf:()=>V6,_minSize:()=>x4,_minLength:()=>t4,_min:()=>l$,_mime:()=>a1,_maxSize:()=>L6,_maxLength:()=>$1,_max:()=>u4,_map:()=>zj,_mac:()=>b3,_lte:()=>u4,_lt:()=>C4,_lowercase:()=>d1,_literal:()=>vj,_length:()=>I1,_lazy:()=>Mj,_ksuid:()=>x_,_jwt:()=>h_,_isoTime:()=>S3,_isoDuration:()=>w3,_isoDateTime:()=>j3,_isoDate:()=>F3,_ipv6:()=>y_,_ipv4:()=>k_,_intersection:()=>Uj,_int64:()=>h3,_int32:()=>y3,_int:()=>f3,_includes:()=>p1,_guid:()=>VI,_gte:()=>l$,_gt:()=>f4,_float64:()=>k3,_float32:()=>x3,_file:()=>u9,_enum:()=>Jj,_endsWith:()=>t1,_encodeAsync:()=>g_,_encode:()=>u_,_emoji:()=>F_,_email:()=>W_,_e164:()=>n_,_discriminatedUnion:()=>Ij,_default:()=>Qj,_decodeAsync:()=>J_,_decode:()=>z_,_date:()=>$9,_custom:()=>z9,_cuid2:()=>E_,_cuid:()=>w_,_coercedString:()=>P3,_coercedNumber:()=>C3,_coercedDate:()=>I9,_coercedBoolean:()=>r3,_coercedBigint:()=>n3,_cidrv6:()=>l_,_cidrv4:()=>i_,_check:()=>vQ,_catch:()=>Oj,_boolean:()=>l3,_bigint:()=>m3,_base64url:()=>m_,_base64:()=>r_,_array:()=>_9,_any:()=>t3,TimePrecision:()=>A3,NEVER:()=>Qg,JSONSchemaGenerator:()=>o9,JSONSchema:()=>qQ,Doc:()=>H_,$output:()=>L3,$input:()=>R3,$constructor:()=>B,$brand:()=>Yg,$ZodXor:()=>g8,$ZodXID:()=>FJ,$ZodVoid:()=>U8,$ZodUnknown:()=>$8,$ZodUnion:()=>HI,$ZodUndefined:()=>aJ,$ZodUUID:()=>LJ,$ZodURL:()=>ZJ,$ZodULID:()=>jJ,$ZodType:()=>n,$ZodTuple:()=>L_,$ZodTransform:()=>H8,$ZodTemplateLiteral:()=>W8,$ZodSymbol:()=>tJ,$ZodSuccess:()=>K8,$ZodStringFormat:()=>J$,$ZodString:()=>e6,$ZodSet:()=>X8,$ZodRegistry:()=>Z3,$ZodRecord:()=>v8,$ZodRealError:()=>a$,$ZodReadonly:()=>Z8,$ZodPromise:()=>b8,$ZodPrefault:()=>D8,$ZodPipe:()=>R8,$ZodOptional:()=>R_,$ZodObjectJIT:()=>z8,$ZodObject:()=>_Q,$ZodNumberFormat:()=>pJ,$ZodNumber:()=>K_,$ZodNullable:()=>T8,$ZodNull:()=>eJ,$ZodNonOptional:()=>M8,$ZodNever:()=>I8,$ZodNanoID:()=>PJ,$ZodNaN:()=>L8,$ZodMap:()=>q8,$ZodMAC:()=>yJ,$ZodLiteral:()=>Q8,$ZodLazy:()=>A8,$ZodKSUID:()=>SJ,$ZodJWT:()=>dJ,$ZodIntersection:()=>G8,$ZodISOTime:()=>CJ,$ZodISODuration:()=>fJ,$ZodISODateTime:()=>wJ,$ZodISODate:()=>EJ,$ZodIPv6:()=>kJ,$ZodIPv4:()=>xJ,$ZodGUID:()=>VJ,$ZodFunction:()=>P8,$ZodFile:()=>Y8,$ZodExactOptional:()=>O8,$ZodError:()=>GI,$ZodEnum:()=>N8,$ZodEncodeError:()=>o6,$ZodEmoji:()=>WJ,$ZodEmail:()=>RJ,$ZodE164:()=>hJ,$ZodDiscriminatedUnion:()=>J8,$ZodDefault:()=>B8,$ZodDate:()=>_8,$ZodCustomStringFormat:()=>cJ,$ZodCustom:()=>j8,$ZodCodec:()=>OI,$ZodCheckUpperCase:()=>QJ,$ZodCheckStringFormat:()=>m1,$ZodCheckStartsWith:()=>HJ,$ZodCheckSizeEquals:()=>JJ,$ZodCheckRegex:()=>XJ,$ZodCheckProperty:()=>TJ,$ZodCheckOverwrite:()=>DJ,$ZodCheckNumberFormat:()=>_J,$ZodCheckMultipleOf:()=>UJ,$ZodCheckMinSize:()=>gJ,$ZodCheckMinLength:()=>vJ,$ZodCheckMimeType:()=>BJ,$ZodCheckMaxSize:()=>zJ,$ZodCheckMaxLength:()=>GJ,$ZodCheckLowerCase:()=>NJ,$ZodCheckLessThan:()=>Q_,$ZodCheckLengthEquals:()=>qJ,$ZodCheckIncludes:()=>YJ,$ZodCheckGreaterThan:()=>Y_,$ZodCheckEndsWith:()=>OJ,$ZodCheckBigIntFormat:()=>uJ,$ZodCheck:()=>q$,$ZodCatch:()=>V8,$ZodCUID2:()=>AJ,$ZodCUID:()=>bJ,$ZodCIDRv6:()=>lJ,$ZodCIDRv4:()=>iJ,$ZodBoolean:()=>YI,$ZodBigIntFormat:()=>oJ,$ZodBigInt:()=>V_,$ZodBase64URL:()=>nJ,$ZodBase64:()=>mJ,$ZodAsyncError:()=>E4,$ZodArray:()=>u8,$ZodAny:()=>sJ});var Qg=Object.freeze({status:"aborted"});function B($,I,_){function u(J,G){if(!J._zod)Object.defineProperty(J,"_zod",{value:{def:G,constr:g,traits:new Set},enumerable:!1});if(J._zod.traits.has($))return;J._zod.traits.add($),I(J,G);let v=g.prototype,X=Object.keys(v);for(let q=0;q<X.length;q++){let N=X[q];if(!(N in J))J[N]=v[N].bind(J)}}let U=_?.Parent??Object;class z extends U{}Object.defineProperty(z,"name",{value:$});function g(J){var G;let v=_?.Parent?new z:this;u(v,J),(G=v._zod).deferred??(G.deferred=[]);for(let X of v._zod.deferred)X();return v}return Object.defineProperty(g,"init",{value:u}),Object.defineProperty(g,Symbol.hasInstance,{value:(J)=>{if(_?.Parent&&J instanceof _.Parent)return!0;return J?._zod?.traits?.has($)}}),Object.defineProperty(g,"name",{value:$}),g}var Yg=Symbol("zod_brand");class E4 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class o6 extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}var II={};function L$($){if($)Object.assign(II,$);return II}var S={};F4(S,{unwrapMessage:()=>UI,uint8ArrayToHex:()=>Kb,uint8ArrayToBase64url:()=>Db,uint8ArrayToBase64:()=>SN,stringifyPrimitive:()=>j,slugify:()=>Tg,shallowClone:()=>Dg,safeExtend:()=>Qb,required:()=>Ob,randomString:()=>gb,propertyKeyTypes:()=>zI,promiseAllObject:()=>zb,primitiveTypes:()=>Mg,prefixIssues:()=>_4,pick:()=>qb,partial:()=>Hb,parsedType:()=>F,optionalKeys:()=>Kg,omit:()=>Xb,objectClone:()=>Ub,numKeys:()=>Jb,nullish:()=>B6,normalizeParams:()=>C,mergeDefs:()=>o4,merge:()=>Yb,jsonStringifyReplacer:()=>f1,joinValues:()=>R,issue:()=>k1,isPlainObject:()=>M6,isObject:()=>t6,hexToUint8Array:()=>Mb,getSizableOrigin:()=>gI,getParsedType:()=>Gb,getLengthableOrigin:()=>JI,getEnumValues:()=>_I,getElementAtPath:()=>ub,floatSafeRemainder:()=>Og,finalizeIssue:()=>t$,extend:()=>Nb,escapeRegex:()=>N4,esc:()=>$_,defineLazy:()=>t,createTransparentProxy:()=>vb,cloneDef:()=>_b,clone:()=>i$,cleanRegex:()=>uI,cleanEnum:()=>Tb,captureStackTrace:()=>I_,cached:()=>x1,base64urlToUint8Array:()=>Bb,base64ToUint8Array:()=>FN,assignProp:()=>D6,assertNotEqual:()=>eP,assertNever:()=>$b,assertIs:()=>sP,assertEqual:()=>aP,assert:()=>Ib,allowsEval:()=>Bg,aborted:()=>K6,NUMBER_FORMAT_RANGES:()=>Vg,Class:()=>wN,BIGINT_FORMAT_RANGES:()=>Lg});function aP($){return $}function eP($){return $}function sP($){}function $b($){throw Error("Unexpected value in exhaustive check")}function Ib($){}function _I($){let I=Object.values($).filter((u)=>typeof u==="number");return Object.entries($).filter(([u,U])=>I.indexOf(+u)===-1).map(([u,U])=>U)}function R($,I="|"){return $.map((_)=>j(_)).join(I)}function f1($,I){if(typeof I==="bigint")return I.toString();return I}function x1($){return{get value(){{let _=$();return Object.defineProperty(this,"value",{value:_}),_}throw Error("cached value already set")}}}function B6($){return $===null||$===void 0}function uI($){let I=$.startsWith("^")?1:0,_=$.endsWith("$")?$.length-1:$.length;return $.slice(I,_)}function Og($,I){let _=($.toString().split(".")[1]||"").length,u=I.toString(),U=(u.split(".")[1]||"").length;if(U===0&&/\d?e-\d?/.test(u)){let G=u.match(/\d?e-(\d?)/);if(G?.[1])U=Number.parseInt(G[1])}let z=_>U?_:U,g=Number.parseInt($.toFixed(z).replace(".","")),J=Number.parseInt(I.toFixed(z).replace(".",""));return g%J/10**z}var jN=Symbol("evaluating");function t($,I,_){let u=void 0;Object.defineProperty($,I,{get(){if(u===jN)return;if(u===void 0)u=jN,u=_();return u},set(U){Object.defineProperty($,I,{value:U})},configurable:!0})}function Ub($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function D6($,I,_){Object.defineProperty($,I,{value:_,writable:!0,enumerable:!0,configurable:!0})}function o4(...$){let I={};for(let _ of $){let u=Object.getOwnPropertyDescriptors(_);Object.assign(I,u)}return Object.defineProperties({},I)}function _b($){return o4($._zod.def)}function ub($,I){if(!I)return $;return I.reduce((_,u)=>_?.[u],$)}function zb($){let I=Object.keys($),_=I.map((u)=>$[u]);return Promise.all(_).then((u)=>{let U={};for(let z=0;z<I.length;z++)U[I[z]]=u[z];return U})}function gb($=10){let _="";for(let u=0;u<$;u++)_+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return _}function $_($){return JSON.stringify($)}function Tg($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var I_="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function t6($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var Bg=x1(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function M6($){if(t6($)===!1)return!1;let I=$.constructor;if(I===void 0)return!0;if(typeof I!=="function")return!0;let _=I.prototype;if(t6(_)===!1)return!1;if(Object.prototype.hasOwnProperty.call(_,"isPrototypeOf")===!1)return!1;return!0}function Dg($){if(M6($))return{...$};if(Array.isArray($))return[...$];return $}function Jb($){let I=0;for(let _ in $)if(Object.prototype.hasOwnProperty.call($,_))I++;return I}var Gb=($)=>{let I=typeof $;switch(I){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN($)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray($))return"array";if($===null)return"null";if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return"promise";if(typeof Map<"u"&&$ instanceof Map)return"map";if(typeof Set<"u"&&$ instanceof Set)return"set";if(typeof Date<"u"&&$ instanceof Date)return"date";if(typeof File<"u"&&$ instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${I}`)}},zI=new Set(["string","number","symbol"]),Mg=new Set(["string","number","bigint","boolean","symbol","undefined"]);function N4($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function i$($,I,_){let u=new $._zod.constr(I??$._zod.def);if(!I||_?.parent)u._zod.parent=$;return u}function C($){let I=$;if(!I)return{};if(typeof I==="string")return{error:()=>I};if(I?.message!==void 0){if(I?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");I.error=I.message}if(delete I.message,typeof I.error==="string")return{...I,error:()=>I.error};return I}function vb($){let I;return new Proxy({},{get(_,u,U){return I??(I=$()),Reflect.get(I,u,U)},set(_,u,U,z){return I??(I=$()),Reflect.set(I,u,U,z)},has(_,u){return I??(I=$()),Reflect.has(I,u)},deleteProperty(_,u){return I??(I=$()),Reflect.deleteProperty(I,u)},ownKeys(_){return I??(I=$()),Reflect.ownKeys(I)},getOwnPropertyDescriptor(_,u){return I??(I=$()),Reflect.getOwnPropertyDescriptor(I,u)},defineProperty(_,u,U){return I??(I=$()),Reflect.defineProperty(I,u,U)}})}function j($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function Kg($){return Object.keys($).filter((I)=>{return $[I]._zod.optin==="optional"&&$[I]._zod.optout==="optional"})}var Vg={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Lg={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function qb($,I){let _=$._zod.def,u=_.checks;if(u&&u.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let z=o4($._zod.def,{get shape(){let g={};for(let J in I){if(!(J in _.shape))throw Error(`Unrecognized key: "${J}"`);if(!I[J])continue;g[J]=_.shape[J]}return D6(this,"shape",g),g},checks:[]});return i$($,z)}function Xb($,I){let _=$._zod.def,u=_.checks;if(u&&u.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let z=o4($._zod.def,{get shape(){let g={...$._zod.def.shape};for(let J in I){if(!(J in _.shape))throw Error(`Unrecognized key: "${J}"`);if(!I[J])continue;delete g[J]}return D6(this,"shape",g),g},checks:[]});return i$($,z)}function Nb($,I){if(!M6(I))throw Error("Invalid input to extend: expected a plain object");let _=$._zod.def.checks;if(_&&_.length>0){let z=$._zod.def.shape;for(let g in I)if(Object.getOwnPropertyDescriptor(z,g)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let U=o4($._zod.def,{get shape(){let z={...$._zod.def.shape,...I};return D6(this,"shape",z),z}});return i$($,U)}function Qb($,I){if(!M6(I))throw Error("Invalid input to safeExtend: expected a plain object");let _=o4($._zod.def,{get shape(){let u={...$._zod.def.shape,...I};return D6(this,"shape",u),u}});return i$($,_)}function Yb($,I){let _=o4($._zod.def,{get shape(){let u={...$._zod.def.shape,...I._zod.def.shape};return D6(this,"shape",u),u},get catchall(){return I._zod.def.catchall},checks:[]});return i$($,_)}function Hb($,I,_){let U=I._zod.def.checks;if(U&&U.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let g=o4(I._zod.def,{get shape(){let J=I._zod.def.shape,G={...J};if(_)for(let v in _){if(!(v in J))throw Error(`Unrecognized key: "${v}"`);if(!_[v])continue;G[v]=$?new $({type:"optional",innerType:J[v]}):J[v]}else for(let v in J)G[v]=$?new $({type:"optional",innerType:J[v]}):J[v];return D6(this,"shape",G),G},checks:[]});return i$(I,g)}function Ob($,I,_){let u=o4(I._zod.def,{get shape(){let U=I._zod.def.shape,z={...U};if(_)for(let g in _){if(!(g in z))throw Error(`Unrecognized key: "${g}"`);if(!_[g])continue;z[g]=new $({type:"nonoptional",innerType:U[g]})}else for(let g in U)z[g]=new $({type:"nonoptional",innerType:U[g]});return D6(this,"shape",z),z}});return i$(I,u)}function K6($,I=0){if($.aborted===!0)return!0;for(let _=I;_<$.issues.length;_++)if($.issues[_]?.continue!==!0)return!0;return!1}function _4($,I){return I.map((_)=>{var u;return(u=_).path??(u.path=[]),_.path.unshift($),_})}function UI($){return typeof $==="string"?$:$?.message}function t$($,I,_){let u={...$,path:$.path??[]};if(!$.message){let U=UI($.inst?._zod.def?.error?.($))??UI(I?.error?.($))??UI(_.customError?.($))??UI(_.localeError?.($))??"Invalid input";u.message=U}if(delete u.inst,delete u.continue,!I?.reportInput)delete u.input;return u}function gI($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function JI($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function F($){let I=typeof $;switch(I){case"number":return Number.isNaN($)?"nan":"number";case"object":{if($===null)return"null";if(Array.isArray($))return"array";let _=$;if(_&&Object.getPrototypeOf(_)!==Object.prototype&&"constructor"in _&&_.constructor)return _.constructor.name}}return I}function k1(...$){let[I,_,u]=$;if(typeof I==="string")return{message:I,code:"custom",input:_,inst:u};return{...I}}function Tb($){return Object.entries($).filter(([I,_])=>{return Number.isNaN(Number.parseInt(I,10))}).map((I)=>I[1])}function FN($){let I=atob($),_=new Uint8Array(I.length);for(let u=0;u<I.length;u++)_[u]=I.charCodeAt(u);return _}function SN($){let I="";for(let _=0;_<$.length;_++)I+=String.fromCharCode($[_]);return btoa(I)}function Bb($){let I=$.replace(/-/g,"+").replace(/_/g,"/"),_="=".repeat((4-I.length%4)%4);return FN(I+_)}function Db($){return SN($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Mb($){let I=$.replace(/^0x/,"");if(I.length%2!==0)throw Error("Invalid hex string length");let _=new Uint8Array(I.length/2);for(let u=0;u<I.length;u+=2)_[u/2]=Number.parseInt(I.slice(u,u+2),16);return _}function Kb($){return Array.from($).map((I)=>I.toString(16).padStart(2,"0")).join("")}class wN{constructor(...$){}}var EN=($,I)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:I,enumerable:!1}),$.message=JSON.stringify(I,f1,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},GI=B("$ZodError",EN),a$=B("$ZodError",EN,{Parent:Error});function vI($,I=(_)=>_.message){let _={},u=[];for(let U of $.issues)if(U.path.length>0)_[U.path[0]]=_[U.path[0]]||[],_[U.path[0]].push(I(U));else u.push(I(U));return{formErrors:u,fieldErrors:_}}function qI($,I=(_)=>_.message){let _={_errors:[]},u=(U)=>{for(let z of U.issues)if(z.code==="invalid_union"&&z.errors.length)z.errors.map((g)=>u({issues:g}));else if(z.code==="invalid_key")u({issues:z.issues});else if(z.code==="invalid_element")u({issues:z.issues});else if(z.path.length===0)_._errors.push(I(z));else{let g=_,J=0;while(J<z.path.length){let G=z.path[J];if(J!==z.path.length-1)g[G]=g[G]||{_errors:[]};else g[G]=g[G]||{_errors:[]},g[G]._errors.push(I(z));g=g[G],J++}}};return u($),_}function Rg($,I=(_)=>_.message){let _={errors:[]},u=(U,z=[])=>{var g,J;for(let G of U.issues)if(G.code==="invalid_union"&&G.errors.length)G.errors.map((v)=>u({issues:v},G.path));else if(G.code==="invalid_key")u({issues:G.issues},G.path);else if(G.code==="invalid_element")u({issues:G.issues},G.path);else{let v=[...z,...G.path];if(v.length===0){_.errors.push(I(G));continue}let X=_,q=0;while(q<v.length){let N=v[q],Y=q===v.length-1;if(typeof N==="string")X.properties??(X.properties={}),(g=X.properties)[N]??(g[N]={errors:[]}),X=X.properties[N];else X.items??(X.items=[]),(J=X.items)[N]??(J[N]={errors:[]}),X=X.items[N];if(Y)X.errors.push(I(G));q++}}};return u($),_}function CN($){let I=[],_=$.map((u)=>typeof u==="object"?u.key:u);for(let u of _)if(typeof u==="number")I.push(`[${u}]`);else if(typeof u==="symbol")I.push(`[${JSON.stringify(String(u))}]`);else if(/[^\w$]/.test(u))I.push(`[${JSON.stringify(u)}]`);else{if(I.length)I.push(".");I.push(u)}return I.join("")}function Zg($){let I=[],_=[...$.issues].sort((u,U)=>(u.path??[]).length-(U.path??[]).length);for(let u of _)if(I.push(`✖ ${u.message}`),u.path?.length)I.push(` → at ${CN(u.path)}`);return I.join(`
|
|
273
|
-
`)}var y1=($)=>(I,_,u,U)=>{let z=u?Object.assign(u,{async:!1}):{async:!1},g=I._zod.run({value:_,issues:[]},z);if(g instanceof Promise)throw new E4;if(g.issues.length){let J=new(U?.Err??$)(g.issues.map((G)=>t$(G,z,L$())));throw I_(J,U?.callee),J}return g.value},U_=y1(a$),i1=($)=>async(I,_,u,U)=>{let z=u?Object.assign(u,{async:!0}):{async:!0},g=I._zod.run({value:_,issues:[]},z);if(g instanceof Promise)g=await g;if(g.issues.length){let J=new(U?.Err??$)(g.issues.map((G)=>t$(G,z,L$())));throw I_(J,U?.callee),J}return g.value},__=i1(a$),l1=($)=>(I,_,u)=>{let U=u?{...u,async:!1}:{async:!1},z=I._zod.run({value:_,issues:[]},U);if(z instanceof Promise)throw new E4;return z.issues.length?{success:!1,error:new($??GI)(z.issues.map((g)=>t$(g,U,L$())))}:{success:!0,data:z.value}},Wg=l1(a$),r1=($)=>async(I,_,u)=>{let U=u?Object.assign(u,{async:!0}):{async:!0},z=I._zod.run({value:_,issues:[]},U);if(z instanceof Promise)z=await z;return z.issues.length?{success:!1,error:new $(z.issues.map((g)=>t$(g,U,L$())))}:{success:!0,data:z.value}},Pg=r1(a$),u_=($)=>(I,_,u)=>{let U=u?Object.assign(u,{direction:"backward"}):{direction:"backward"};return y1($)(I,_,U)},Lb=u_(a$),z_=($)=>(I,_,u)=>{return y1($)(I,_,u)},Rb=z_(a$),g_=($)=>async(I,_,u)=>{let U=u?Object.assign(u,{direction:"backward"}):{direction:"backward"};return i1($)(I,_,U)},Zb=g_(a$),J_=($)=>async(I,_,u)=>{return i1($)(I,_,u)},Wb=J_(a$),G_=($)=>(I,_,u)=>{let U=u?Object.assign(u,{direction:"backward"}):{direction:"backward"};return l1($)(I,_,U)},Pb=G_(a$),v_=($)=>(I,_,u)=>{return l1($)(I,_,u)},bb=v_(a$),q_=($)=>async(I,_,u)=>{let U=u?Object.assign(u,{direction:"backward"}):{direction:"backward"};return r1($)(I,_,U)},Ab=q_(a$),X_=($)=>async(I,_,u)=>{return r1($)(I,_,u)},jb=X_(a$);var Q4={};F4(Q4,{xid:()=>Fg,uuid7:()=>Eb,uuid6:()=>wb,uuid4:()=>Sb,uuid:()=>a6,uppercase:()=>IJ,unicodeEmail:()=>fN,undefined:()=>sg,ulid:()=>jg,time:()=>dg,string:()=>pg,sha512_hex:()=>IA,sha512_base64url:()=>_A,sha512_base64:()=>UA,sha384_hex:()=>eb,sha384_base64url:()=>$A,sha384_base64:()=>sb,sha256_hex:()=>ob,sha256_base64url:()=>ab,sha256_base64:()=>tb,sha1_hex:()=>db,sha1_base64url:()=>pb,sha1_base64:()=>cb,rfc5322Email:()=>fb,number:()=>XI,null:()=>eg,nanoid:()=>wg,md5_hex:()=>mb,md5_base64url:()=>hb,md5_base64:()=>nb,mac:()=>ig,lowercase:()=>$J,ksuid:()=>Sg,ipv6:()=>yg,ipv4:()=>kg,integer:()=>tg,idnEmail:()=>xb,html5Email:()=>Cb,hostname:()=>ib,hex:()=>rb,guid:()=>Cg,extendedDuration:()=>Fb,emoji:()=>xg,email:()=>fg,e164:()=>ng,duration:()=>Eg,domain:()=>lb,datetime:()=>cg,date:()=>hg,cuid2:()=>Ag,cuid:()=>bg,cidrv6:()=>rg,cidrv4:()=>lg,browserEmail:()=>kb,boolean:()=>ag,bigint:()=>og,base64url:()=>N_,base64:()=>mg});var bg=/^[cC][^\s-]{8,}$/,Ag=/^[0-9a-z]+$/,jg=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Fg=/^[0-9a-vA-V]{20}$/,Sg=/^[A-Za-z0-9]{27}$/,wg=/^[a-zA-Z0-9_-]{21}$/,Eg=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Fb=/^[-+]?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)?)??$/,Cg=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,a6=($)=>{if(!$)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},Sb=a6(4),wb=a6(6),Eb=a6(7),fg=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Cb=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,fb=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,fN=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,xb=fN,kb=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,yb="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function xg(){return new RegExp(yb,"u")}var kg=/^(?:(?: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])$/,yg=/^(([0-9a-fA-F]{1,4}:){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}|:))$/,ig=($)=>{let I=N4($??":");return new RegExp(`^(?:[0-9A-F]{2}${I}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${I}){5}[0-9a-f]{2}$`)},lg=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,rg=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,mg=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,N_=/^[A-Za-z0-9_-]*$/,ib=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,lb=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,ng=/^\+[1-9]\d{6,14}$/,xN="(?:(?:\\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])))",hg=new RegExp(`^${xN}$`);function kN($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function dg($){return new RegExp(`^${kN($)}$`)}function cg($){let I=kN({precision:$.precision}),_=["Z"];if($.local)_.push("");if($.offset)_.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let u=`${I}(?:${_.join("|")})`;return new RegExp(`^${xN}T(?:${u})$`)}var pg=($)=>{let I=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${I}$`)},og=/^-?\d+n?$/,tg=/^-?\d+$/,XI=/^-?\d+(?:\.\d+)?$/,ag=/^(?:true|false)$/i,eg=/^null$/i;var sg=/^undefined$/i;var $J=/^[^A-Z]*$/,IJ=/^[^a-z]*$/,rb=/^[0-9a-fA-F]*$/;function NI($,I){return new RegExp(`^[A-Za-z0-9+/]{${$}}${I}$`)}function QI($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var mb=/^[0-9a-fA-F]{32}$/,nb=NI(22,"=="),hb=QI(22),db=/^[0-9a-fA-F]{40}$/,cb=NI(27,"="),pb=QI(27),ob=/^[0-9a-fA-F]{64}$/,tb=NI(43,"="),ab=QI(43),eb=/^[0-9a-fA-F]{96}$/,sb=NI(64,""),$A=QI(64),IA=/^[0-9a-fA-F]{128}$/,UA=NI(86,"=="),_A=QI(86);var q$=B("$ZodCheck",($,I)=>{var _;$._zod??($._zod={}),$._zod.def=I,(_=$._zod).onattach??(_.onattach=[])}),iN={number:"number",bigint:"bigint",object:"date"},Q_=B("$ZodCheckLessThan",($,I)=>{q$.init($,I);let _=iN[typeof I.value];$._zod.onattach.push((u)=>{let U=u._zod.bag,z=(I.inclusive?U.maximum:U.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(I.value<z)if(I.inclusive)U.maximum=I.value;else U.exclusiveMaximum=I.value}),$._zod.check=(u)=>{if(I.inclusive?u.value<=I.value:u.value<I.value)return;u.issues.push({origin:_,code:"too_big",maximum:typeof I.value==="object"?I.value.getTime():I.value,input:u.value,inclusive:I.inclusive,inst:$,continue:!I.abort})}}),Y_=B("$ZodCheckGreaterThan",($,I)=>{q$.init($,I);let _=iN[typeof I.value];$._zod.onattach.push((u)=>{let U=u._zod.bag,z=(I.inclusive?U.minimum:U.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(I.value>z)if(I.inclusive)U.minimum=I.value;else U.exclusiveMinimum=I.value}),$._zod.check=(u)=>{if(I.inclusive?u.value>=I.value:u.value>I.value)return;u.issues.push({origin:_,code:"too_small",minimum:typeof I.value==="object"?I.value.getTime():I.value,input:u.value,inclusive:I.inclusive,inst:$,continue:!I.abort})}}),UJ=B("$ZodCheckMultipleOf",($,I)=>{q$.init($,I),$._zod.onattach.push((_)=>{var u;(u=_._zod.bag).multipleOf??(u.multipleOf=I.value)}),$._zod.check=(_)=>{if(typeof _.value!==typeof I.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof _.value==="bigint"?_.value%I.value===BigInt(0):Og(_.value,I.value)===0)return;_.issues.push({origin:typeof _.value,code:"not_multiple_of",divisor:I.value,input:_.value,inst:$,continue:!I.abort})}}),_J=B("$ZodCheckNumberFormat",($,I)=>{q$.init($,I),I.format=I.format||"float64";let _=I.format?.includes("int"),u=_?"int":"number",[U,z]=Vg[I.format];$._zod.onattach.push((g)=>{let J=g._zod.bag;if(J.format=I.format,J.minimum=U,J.maximum=z,_)J.pattern=tg}),$._zod.check=(g)=>{let J=g.value;if(_){if(!Number.isInteger(J)){g.issues.push({expected:u,format:I.format,code:"invalid_type",continue:!1,input:J,inst:$});return}if(!Number.isSafeInteger(J)){if(J>0)g.issues.push({input:J,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:u,inclusive:!0,continue:!I.abort});else g.issues.push({input:J,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:u,inclusive:!0,continue:!I.abort});return}}if(J<U)g.issues.push({origin:"number",input:J,code:"too_small",minimum:U,inclusive:!0,inst:$,continue:!I.abort});if(J>z)g.issues.push({origin:"number",input:J,code:"too_big",maximum:z,inclusive:!0,inst:$,continue:!I.abort})}}),uJ=B("$ZodCheckBigIntFormat",($,I)=>{q$.init($,I);let[_,u]=Lg[I.format];$._zod.onattach.push((U)=>{let z=U._zod.bag;z.format=I.format,z.minimum=_,z.maximum=u}),$._zod.check=(U)=>{let z=U.value;if(z<_)U.issues.push({origin:"bigint",input:z,code:"too_small",minimum:_,inclusive:!0,inst:$,continue:!I.abort});if(z>u)U.issues.push({origin:"bigint",input:z,code:"too_big",maximum:u,inclusive:!0,inst:$,continue:!I.abort})}}),zJ=B("$ZodCheckMaxSize",($,I)=>{var _;q$.init($,I),(_=$._zod.def).when??(_.when=(u)=>{let U=u.value;return!B6(U)&&U.size!==void 0}),$._zod.onattach.push((u)=>{let U=u._zod.bag.maximum??Number.POSITIVE_INFINITY;if(I.maximum<U)u._zod.bag.maximum=I.maximum}),$._zod.check=(u)=>{let U=u.value;if(U.size<=I.maximum)return;u.issues.push({origin:gI(U),code:"too_big",maximum:I.maximum,inclusive:!0,input:U,inst:$,continue:!I.abort})}}),gJ=B("$ZodCheckMinSize",($,I)=>{var _;q$.init($,I),(_=$._zod.def).when??(_.when=(u)=>{let U=u.value;return!B6(U)&&U.size!==void 0}),$._zod.onattach.push((u)=>{let U=u._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(I.minimum>U)u._zod.bag.minimum=I.minimum}),$._zod.check=(u)=>{let U=u.value;if(U.size>=I.minimum)return;u.issues.push({origin:gI(U),code:"too_small",minimum:I.minimum,inclusive:!0,input:U,inst:$,continue:!I.abort})}}),JJ=B("$ZodCheckSizeEquals",($,I)=>{var _;q$.init($,I),(_=$._zod.def).when??(_.when=(u)=>{let U=u.value;return!B6(U)&&U.size!==void 0}),$._zod.onattach.push((u)=>{let U=u._zod.bag;U.minimum=I.size,U.maximum=I.size,U.size=I.size}),$._zod.check=(u)=>{let U=u.value,z=U.size;if(z===I.size)return;let g=z>I.size;u.issues.push({origin:gI(U),...g?{code:"too_big",maximum:I.size}:{code:"too_small",minimum:I.size},inclusive:!0,exact:!0,input:u.value,inst:$,continue:!I.abort})}}),GJ=B("$ZodCheckMaxLength",($,I)=>{var _;q$.init($,I),(_=$._zod.def).when??(_.when=(u)=>{let U=u.value;return!B6(U)&&U.length!==void 0}),$._zod.onattach.push((u)=>{let U=u._zod.bag.maximum??Number.POSITIVE_INFINITY;if(I.maximum<U)u._zod.bag.maximum=I.maximum}),$._zod.check=(u)=>{let U=u.value;if(U.length<=I.maximum)return;let g=JI(U);u.issues.push({origin:g,code:"too_big",maximum:I.maximum,inclusive:!0,input:U,inst:$,continue:!I.abort})}}),vJ=B("$ZodCheckMinLength",($,I)=>{var _;q$.init($,I),(_=$._zod.def).when??(_.when=(u)=>{let U=u.value;return!B6(U)&&U.length!==void 0}),$._zod.onattach.push((u)=>{let U=u._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(I.minimum>U)u._zod.bag.minimum=I.minimum}),$._zod.check=(u)=>{let U=u.value;if(U.length>=I.minimum)return;let g=JI(U);u.issues.push({origin:g,code:"too_small",minimum:I.minimum,inclusive:!0,input:U,inst:$,continue:!I.abort})}}),qJ=B("$ZodCheckLengthEquals",($,I)=>{var _;q$.init($,I),(_=$._zod.def).when??(_.when=(u)=>{let U=u.value;return!B6(U)&&U.length!==void 0}),$._zod.onattach.push((u)=>{let U=u._zod.bag;U.minimum=I.length,U.maximum=I.length,U.length=I.length}),$._zod.check=(u)=>{let U=u.value,z=U.length;if(z===I.length)return;let g=JI(U),J=z>I.length;u.issues.push({origin:g,...J?{code:"too_big",maximum:I.length}:{code:"too_small",minimum:I.length},inclusive:!0,exact:!0,input:u.value,inst:$,continue:!I.abort})}}),m1=B("$ZodCheckStringFormat",($,I)=>{var _,u;if(q$.init($,I),$._zod.onattach.push((U)=>{let z=U._zod.bag;if(z.format=I.format,I.pattern)z.patterns??(z.patterns=new Set),z.patterns.add(I.pattern)}),I.pattern)(_=$._zod).check??(_.check=(U)=>{if(I.pattern.lastIndex=0,I.pattern.test(U.value))return;U.issues.push({origin:"string",code:"invalid_format",format:I.format,input:U.value,...I.pattern?{pattern:I.pattern.toString()}:{},inst:$,continue:!I.abort})});else(u=$._zod).check??(u.check=()=>{})}),XJ=B("$ZodCheckRegex",($,I)=>{m1.init($,I),$._zod.check=(_)=>{if(I.pattern.lastIndex=0,I.pattern.test(_.value))return;_.issues.push({origin:"string",code:"invalid_format",format:"regex",input:_.value,pattern:I.pattern.toString(),inst:$,continue:!I.abort})}}),NJ=B("$ZodCheckLowerCase",($,I)=>{I.pattern??(I.pattern=$J),m1.init($,I)}),QJ=B("$ZodCheckUpperCase",($,I)=>{I.pattern??(I.pattern=IJ),m1.init($,I)}),YJ=B("$ZodCheckIncludes",($,I)=>{q$.init($,I);let _=N4(I.includes),u=new RegExp(typeof I.position==="number"?`^.{${I.position}}${_}`:_);I.pattern=u,$._zod.onattach.push((U)=>{let z=U._zod.bag;z.patterns??(z.patterns=new Set),z.patterns.add(u)}),$._zod.check=(U)=>{if(U.value.includes(I.includes,I.position))return;U.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:I.includes,input:U.value,inst:$,continue:!I.abort})}}),HJ=B("$ZodCheckStartsWith",($,I)=>{q$.init($,I);let _=new RegExp(`^${N4(I.prefix)}.*`);I.pattern??(I.pattern=_),$._zod.onattach.push((u)=>{let U=u._zod.bag;U.patterns??(U.patterns=new Set),U.patterns.add(_)}),$._zod.check=(u)=>{if(u.value.startsWith(I.prefix))return;u.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:I.prefix,input:u.value,inst:$,continue:!I.abort})}}),OJ=B("$ZodCheckEndsWith",($,I)=>{q$.init($,I);let _=new RegExp(`.*${N4(I.suffix)}$`);I.pattern??(I.pattern=_),$._zod.onattach.push((u)=>{let U=u._zod.bag;U.patterns??(U.patterns=new Set),U.patterns.add(_)}),$._zod.check=(u)=>{if(u.value.endsWith(I.suffix))return;u.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:I.suffix,input:u.value,inst:$,continue:!I.abort})}});function yN($,I,_){if($.issues.length)I.issues.push(..._4(_,$.issues))}var TJ=B("$ZodCheckProperty",($,I)=>{q$.init($,I),$._zod.check=(_)=>{let u=I.schema._zod.run({value:_.value[I.property],issues:[]},{});if(u instanceof Promise)return u.then((U)=>yN(U,_,I.property));yN(u,_,I.property);return}}),BJ=B("$ZodCheckMimeType",($,I)=>{q$.init($,I);let _=new Set(I.mime);$._zod.onattach.push((u)=>{u._zod.bag.mime=I.mime}),$._zod.check=(u)=>{if(_.has(u.value.type))return;u.issues.push({code:"invalid_value",values:I.mime,input:u.value.type,inst:$,continue:!I.abort})}}),DJ=B("$ZodCheckOverwrite",($,I)=>{q$.init($,I),$._zod.check=(_)=>{_.value=I.tx(_.value)}});class H_{constructor($=[]){if(this.content=[],this.indent=0,this)this.args=$}indented($){this.indent+=1,$(this),this.indent-=1}write($){if(typeof $==="function"){$(this,{execution:"sync"}),$(this,{execution:"async"});return}let _=$.split(`
|
|
272
|
+
`+_)}function V1($,I,_,u,U,z){if($.listenerCount("wsClientError")){let g=Error(U);Error.captureStackTrace(g,V1),$.emit("wsClientError",g,_,I)}else UU(_,u,U,z)}});var T5=v$(O5(),1),{program:yx,createCommand:ix,createArgument:lx,createOption:mx,CommanderError:rx,InvalidArgumentError:nx,InvalidOptionArgumentError:hx,Command:a2,Argument:dx,Option:cx,Help:px}=T5.default;var l=v$(P$(),1);import{execSync as rj,spawn as zq}from"node:child_process";import k from"node:fs";import{tmpdir as fu}from"node:os";import s from"node:path";var HP=az(),YP=c0(),OP=Cz(),qg=p0(),TP=S0(),D6=I$(),BP=H6(),DP=L$(),MP=O6(),KP=T6(),Hy=tU(),VP=gg(),RP=Jg(),LP=Gg(),sU=WQ(),PQ=j0();var ZP=HP.Composer,WP=YP.Document,PP=OP.Schema,bP=qg.YAMLError,AP=qg.YAMLParseError,jP=qg.YAMLWarning,FP=TP.Alias,SP=D6.isAlias,wP=D6.isCollection,EP=D6.isDocument,CP=D6.isMap,fP=D6.isNode,xP=D6.isPair,kP=D6.isScalar,yP=D6.isSeq,iP=BP.Pair,lP=DP.Scalar,mP=MP.YAMLMap,rP=KP.YAMLSeq;var nP=VP.Lexer,hP=RP.LineCounter,dP=LP.Parser,o6=sU.parse,cP=sU.parseAllDocuments,pP=sU.parseDocument,oP=sU.stringify,tP=PQ.visit,aP=PQ.visitAsync;var g$={};S4(g$,{xor:()=>$v,xid:()=>R7,void:()=>p7,uuidv7:()=>Y7,uuidv6:()=>H7,uuidv4:()=>v7,uuid:()=>Q7,util:()=>F,url:()=>O7,uppercase:()=>d1,unknown:()=>_1,union:()=>Pu,undefined:()=>d7,ulid:()=>V7,uint64:()=>n7,uint32:()=>l7,tuple:()=>WG,trim:()=>e1,treeifyError:()=>Kg,transform:()=>Au,toUpperCase:()=>$0,toLowerCase:()=>s1,toJSONSchema:()=>$u,templateLiteral:()=>vv,symbol:()=>h7,superRefine:()=>sG,success:()=>Xv,stringbool:()=>Kv,stringFormat:()=>E7,string:()=>gu,strictObject:()=>e7,startsWith:()=>p1,slugify:()=>I0,size:()=>$1,setErrorMap:()=>bj,set:()=>zv,safeParseAsync:()=>$G,safeParse:()=>s9,safeEncodeAsync:()=>JG,safeEncode:()=>zG,safeDecodeAsync:()=>GG,safeDecode:()=>gG,registry:()=>Z_,regexes:()=>v4,regex:()=>n1,refine:()=>eG,record:()=>PG,readonly:()=>dG,property:()=>t_,promise:()=>Hv,prettifyError:()=>Vg,preprocess:()=>Rv,prefault:()=>yG,positive:()=>d_,pipe:()=>PI,partialRecord:()=>Uv,parseAsync:()=>e9,parse:()=>a9,overwrite:()=>K4,optional:()=>ZI,object:()=>a7,number:()=>XG,nullish:()=>qv,nullable:()=>WI,null:()=>YG,normalize:()=>a1,nonpositive:()=>p_,nonoptional:()=>iG,nonnegative:()=>o_,never:()=>Wu,negative:()=>c_,nativeEnum:()=>gv,nanoid:()=>D7,nan:()=>Nv,multipleOf:()=>L6,minSize:()=>k4,minLength:()=>t4,mime:()=>t1,meta:()=>Dv,maxSize:()=>Z6,maxLength:()=>I1,map:()=>uv,mac:()=>W7,lte:()=>u4,lt:()=>f4,lowercase:()=>h1,looseRecord:()=>_v,looseObject:()=>s7,locales:()=>MI,literal:()=>Jv,length:()=>U1,lazy:()=>oG,ksuid:()=>L7,keyof:()=>t7,jwt:()=>w7,json:()=>Vv,iso:()=>u0,ipv6:()=>P7,ipv4:()=>Z7,intersection:()=>LG,int64:()=>r7,int32:()=>i7,int:()=>Ju,instanceof:()=>Mv,includes:()=>c1,httpUrl:()=>T7,hostname:()=>C7,hex:()=>f7,hash:()=>x7,guid:()=>N7,gte:()=>l$,gt:()=>x4,globalRegistry:()=>S$,getErrorMap:()=>Aj,function:()=>Yv,fromJSONSchema:()=>Zv,formatError:()=>qI,float64:()=>y7,float32:()=>k7,flattenError:()=>GI,file:()=>Gv,exactOptional:()=>EG,enum:()=>bu,endsWith:()=>o1,encodeAsync:()=>_G,encode:()=>IG,emoji:()=>B7,email:()=>X7,e164:()=>S7,discriminatedUnion:()=>Iv,describe:()=>Bv,decodeAsync:()=>uG,decode:()=>UG,date:()=>o7,custom:()=>Tv,cuid2:()=>K7,cuid:()=>M7,core:()=>a4,config:()=>V$,coerce:()=>Iq,codec:()=>Qv,clone:()=>i$,cidrv6:()=>A7,cidrv4:()=>b7,check:()=>Ov,catch:()=>rG,boolean:()=>NG,bigint:()=>m7,base64url:()=>F7,base64:()=>j7,array:()=>jI,any:()=>c7,_function:()=>Yv,_default:()=>xG,_ZodString:()=>Gu,ZodXor:()=>KG,ZodXID:()=>Yu,ZodVoid:()=>DG,ZodUnknown:()=>TG,ZodUnion:()=>SI,ZodUndefined:()=>vG,ZodUUID:()=>y4,ZodURL:()=>bI,ZodULID:()=>Hu,ZodType:()=>d,ZodTuple:()=>ZG,ZodTransform:()=>SG,ZodTemplateLiteral:()=>cG,ZodSymbol:()=>QG,ZodSuccess:()=>lG,ZodStringFormat:()=>G$,ZodString:()=>g0,ZodSet:()=>AG,ZodRecord:()=>wI,ZodRealError:()=>s$,ZodReadonly:()=>hG,ZodPromise:()=>tG,ZodPrefault:()=>kG,ZodPipe:()=>Su,ZodOptional:()=>ju,ZodObject:()=>FI,ZodNumberFormat:()=>u1,ZodNumber:()=>G0,ZodNullable:()=>CG,ZodNull:()=>HG,ZodNonOptional:()=>Fu,ZodNever:()=>BG,ZodNanoID:()=>Nu,ZodNaN:()=>nG,ZodMap:()=>bG,ZodMAC:()=>qG,ZodLiteral:()=>jG,ZodLazy:()=>pG,ZodKSUID:()=>Ou,ZodJWT:()=>Lu,ZodIssueCode:()=>Pj,ZodIntersection:()=>RG,ZodISOTime:()=>uu,ZodISODuration:()=>zu,ZodISODateTime:()=>Uu,ZodISODate:()=>_u,ZodIPv6:()=>Bu,ZodIPv4:()=>Tu,ZodGUID:()=>LI,ZodFunction:()=>aG,ZodFirstPartyTypeKind:()=>$q,ZodFile:()=>FG,ZodExactOptional:()=>wG,ZodError:()=>Zj,ZodEnum:()=>z0,ZodEmoji:()=>Xu,ZodEmail:()=>qu,ZodE164:()=>Ru,ZodDiscriminatedUnion:()=>VG,ZodDefault:()=>fG,ZodDate:()=>AI,ZodCustomStringFormat:()=>J0,ZodCustom:()=>EI,ZodCodec:()=>wu,ZodCatch:()=>mG,ZodCUID2:()=>vu,ZodCUID:()=>Qu,ZodCIDRv6:()=>Mu,ZodCIDRv4:()=>Du,ZodBoolean:()=>q0,ZodBigIntFormat:()=>Zu,ZodBigInt:()=>X0,ZodBase64URL:()=>Vu,ZodBase64:()=>Ku,ZodArray:()=>MG,ZodAny:()=>OG,TimePrecision:()=>W3,NEVER:()=>Xg,$output:()=>M3,$input:()=>K3,$brand:()=>Ng});var a4={};S4(a4,{version:()=>TJ,util:()=>F,treeifyError:()=>Kg,toJSONSchema:()=>$u,toDotPath:()=>wQ,safeParseAsync:()=>Lg,safeParse:()=>Rg,safeEncodeAsync:()=>jb,safeEncode:()=>bb,safeDecodeAsync:()=>Fb,safeDecode:()=>Ab,registry:()=>Z_,regexes:()=>v4,process:()=>u$,prettifyError:()=>Vg,parseAsync:()=>__,parse:()=>U_,meta:()=>g9,locales:()=>MI,isValidJWT:()=>eQ,isValidBase64URL:()=>aQ,isValidBase64:()=>yJ,initializeContext:()=>W6,globalRegistry:()=>S$,globalConfig:()=>$I,formatError:()=>qI,flattenError:()=>GI,finalize:()=>b6,extractDefs:()=>P6,encodeAsync:()=>Wb,encode:()=>Lb,describe:()=>z9,decodeAsync:()=>Pb,decode:()=>Zb,createToJSONSchemaMethod:()=>G9,createStandardJSONSchemaMethod:()=>_0,config:()=>V$,clone:()=>i$,_xor:()=>Ij,_xid:()=>f_,_void:()=>t3,_uuidv7:()=>j_,_uuidv6:()=>A_,_uuidv4:()=>b_,_uuid:()=>P_,_url:()=>VI,_uppercase:()=>d1,_unknown:()=>p3,_union:()=>$j,_undefined:()=>h3,_ulid:()=>C_,_uint64:()=>r3,_uint32:()=>x3,_tuple:()=>uj,_trim:()=>e1,_transform:()=>Nj,_toUpperCase:()=>$0,_toLowerCase:()=>s1,_templateLiteral:()=>Mj,_symbol:()=>n3,_superRefine:()=>u9,_success:()=>Oj,_stringbool:()=>J9,_stringFormat:()=>U0,_string:()=>R3,_startsWith:()=>p1,_slugify:()=>I0,_size:()=>$1,_set:()=>Jj,_safeParseAsync:()=>l1,_safeParse:()=>i1,_safeEncodeAsync:()=>X_,_safeEncode:()=>G_,_safeDecodeAsync:()=>N_,_safeDecode:()=>q_,_regex:()=>n1,_refine:()=>_9,_record:()=>zj,_readonly:()=>Dj,_property:()=>t_,_promise:()=>Vj,_positive:()=>d_,_pipe:()=>Bj,_parseAsync:()=>y1,_parse:()=>k1,_overwrite:()=>K4,_optional:()=>Qj,_number:()=>F3,_nullable:()=>vj,_null:()=>d3,_normalize:()=>a1,_nonpositive:()=>p_,_nonoptional:()=>Yj,_nonnegative:()=>o_,_never:()=>o3,_negative:()=>c_,_nativeEnum:()=>qj,_nanoid:()=>S_,_nan:()=>s3,_multipleOf:()=>L6,_minSize:()=>k4,_minLength:()=>t4,_min:()=>l$,_mime:()=>t1,_maxSize:()=>Z6,_maxLength:()=>I1,_max:()=>u4,_map:()=>gj,_mac:()=>Z3,_lte:()=>u4,_lt:()=>f4,_lowercase:()=>h1,_literal:()=>Xj,_length:()=>U1,_lazy:()=>Kj,_ksuid:()=>x_,_jwt:()=>h_,_isoTime:()=>A3,_isoDuration:()=>j3,_isoDateTime:()=>P3,_isoDate:()=>b3,_ipv6:()=>y_,_ipv4:()=>k_,_intersection:()=>_j,_int64:()=>m3,_int32:()=>f3,_int:()=>w3,_includes:()=>c1,_guid:()=>KI,_gte:()=>l$,_gt:()=>x4,_float64:()=>C3,_float32:()=>E3,_file:()=>I9,_enum:()=>Gj,_endsWith:()=>o1,_encodeAsync:()=>g_,_encode:()=>u_,_emoji:()=>F_,_email:()=>W_,_e164:()=>n_,_discriminatedUnion:()=>Uj,_default:()=>Hj,_decodeAsync:()=>J_,_decode:()=>z_,_date:()=>a3,_custom:()=>U9,_cuid2:()=>E_,_cuid:()=>w_,_coercedString:()=>L3,_coercedNumber:()=>S3,_coercedDate:()=>e3,_coercedBoolean:()=>y3,_coercedBigint:()=>l3,_cidrv6:()=>l_,_cidrv4:()=>i_,_check:()=>J7,_catch:()=>Tj,_boolean:()=>k3,_bigint:()=>i3,_base64url:()=>r_,_base64:()=>m_,_array:()=>$9,_any:()=>c3,TimePrecision:()=>W3,NEVER:()=>Xg,JSONSchemaGenerator:()=>d9,JSONSchema:()=>G7,Doc:()=>Y_,$output:()=>M3,$input:()=>K3,$constructor:()=>B,$brand:()=>Ng,$ZodXor:()=>_8,$ZodXID:()=>bJ,$ZodVoid:()=>sJ,$ZodUnknown:()=>aJ,$ZodUnion:()=>HI,$ZodUndefined:()=>pJ,$ZodUUID:()=>MJ,$ZodURL:()=>VJ,$ZodULID:()=>PJ,$ZodType:()=>n,$ZodTuple:()=>R_,$ZodTransform:()=>Q8,$ZodTemplateLiteral:()=>R8,$ZodSymbol:()=>cJ,$ZodSuccess:()=>B8,$ZodStringFormat:()=>J$,$ZodString:()=>s6,$ZodSet:()=>G8,$ZodRegistry:()=>V3,$ZodRecord:()=>g8,$ZodRealError:()=>e$,$ZodReadonly:()=>V8,$ZodPromise:()=>Z8,$ZodPrefault:()=>O8,$ZodPipe:()=>K8,$ZodOptional:()=>L_,$ZodObjectJIT:()=>U8,$ZodObject:()=>I7,$ZodNumberFormat:()=>hJ,$ZodNumber:()=>K_,$ZodNullable:()=>H8,$ZodNull:()=>oJ,$ZodNonOptional:()=>T8,$ZodNever:()=>eJ,$ZodNanoID:()=>LJ,$ZodNaN:()=>M8,$ZodMap:()=>J8,$ZodMAC:()=>fJ,$ZodLiteral:()=>X8,$ZodLazy:()=>W8,$ZodKSUID:()=>AJ,$ZodJWT:()=>rJ,$ZodIntersection:()=>z8,$ZodISOTime:()=>SJ,$ZodISODuration:()=>wJ,$ZodISODateTime:()=>jJ,$ZodISODate:()=>FJ,$ZodIPv6:()=>CJ,$ZodIPv4:()=>EJ,$ZodGUID:()=>DJ,$ZodFunction:()=>L8,$ZodFile:()=>N8,$ZodExactOptional:()=>v8,$ZodError:()=>JI,$ZodEnum:()=>q8,$ZodEncodeError:()=>t6,$ZodEmoji:()=>RJ,$ZodEmail:()=>KJ,$ZodE164:()=>mJ,$ZodDiscriminatedUnion:()=>u8,$ZodDefault:()=>Y8,$ZodDate:()=>$8,$ZodCustomStringFormat:()=>nJ,$ZodCustom:()=>P8,$ZodCodec:()=>YI,$ZodCheckUpperCase:()=>XJ,$ZodCheckStringFormat:()=>m1,$ZodCheckStartsWith:()=>QJ,$ZodCheckSizeEquals:()=>uJ,$ZodCheckRegex:()=>GJ,$ZodCheckProperty:()=>HJ,$ZodCheckOverwrite:()=>OJ,$ZodCheckNumberFormat:()=>$J,$ZodCheckMultipleOf:()=>sg,$ZodCheckMinSize:()=>_J,$ZodCheckMinLength:()=>gJ,$ZodCheckMimeType:()=>YJ,$ZodCheckMaxSize:()=>UJ,$ZodCheckMaxLength:()=>zJ,$ZodCheckLowerCase:()=>qJ,$ZodCheckLessThan:()=>v_,$ZodCheckLengthEquals:()=>JJ,$ZodCheckIncludes:()=>NJ,$ZodCheckGreaterThan:()=>H_,$ZodCheckEndsWith:()=>vJ,$ZodCheckBigIntFormat:()=>IJ,$ZodCheck:()=>X$,$ZodCatch:()=>D8,$ZodCUID2:()=>WJ,$ZodCUID:()=>ZJ,$ZodCIDRv6:()=>kJ,$ZodCIDRv4:()=>xJ,$ZodBoolean:()=>vI,$ZodBigIntFormat:()=>dJ,$ZodBigInt:()=>V_,$ZodBase64URL:()=>lJ,$ZodBase64:()=>iJ,$ZodAsyncError:()=>C4,$ZodArray:()=>I8,$ZodAny:()=>tJ});var Xg=Object.freeze({status:"aborted"});function B($,I,_){function u(J,G){if(!J._zod)Object.defineProperty(J,"_zod",{value:{def:G,constr:g,traits:new Set},enumerable:!1});if(J._zod.traits.has($))return;J._zod.traits.add($),I(J,G);let q=g.prototype,N=Object.keys(q);for(let X=0;X<N.length;X++){let Q=N[X];if(!(Q in J))J[Q]=q[Q].bind(J)}}let U=_?.Parent??Object;class z extends U{}Object.defineProperty(z,"name",{value:$});function g(J){var G;let q=_?.Parent?new z:this;u(q,J),(G=q._zod).deferred??(G.deferred=[]);for(let N of q._zod.deferred)N();return q}return Object.defineProperty(g,"init",{value:u}),Object.defineProperty(g,Symbol.hasInstance,{value:(J)=>{if(_?.Parent&&J instanceof _.Parent)return!0;return J?._zod?.traits?.has($)}}),Object.defineProperty(g,"name",{value:$}),g}var Ng=Symbol("zod_brand");class C4 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class t6 extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}var $I={};function V$($){if($)Object.assign($I,$);return $I}var F={};S4(F,{unwrapMessage:()=>II,uint8ArrayToHex:()=>Vb,uint8ArrayToBase64url:()=>Mb,uint8ArrayToBase64:()=>jQ,stringifyPrimitive:()=>A,slugify:()=>Hg,shallowClone:()=>Og,safeExtend:()=>Hb,required:()=>Tb,randomString:()=>Jb,propertyKeyTypes:()=>uI,promiseAllObject:()=>gb,primitiveTypes:()=>Tg,prefixIssues:()=>_4,pick:()=>Nb,partial:()=>Ob,parsedType:()=>j,optionalKeys:()=>Bg,omit:()=>Qb,objectClone:()=>_b,numKeys:()=>Gb,nullish:()=>M6,normalizeParams:()=>E,mergeDefs:()=>o4,merge:()=>Yb,jsonStringifyReplacer:()=>C1,joinValues:()=>W,issue:()=>x1,isPlainObject:()=>V6,isObject:()=>a6,hexToUint8Array:()=>Kb,getSizableOrigin:()=>zI,getParsedType:()=>qb,getLengthableOrigin:()=>gI,getEnumValues:()=>UI,getElementAtPath:()=>zb,floatSafeRemainder:()=>vg,finalizeIssue:()=>a$,extend:()=>vb,escapeRegex:()=>Q4,esc:()=>$_,defineLazy:()=>o,createTransparentProxy:()=>Xb,cloneDef:()=>ub,clone:()=>i$,cleanRegex:()=>_I,cleanEnum:()=>Bb,captureStackTrace:()=>I_,cached:()=>f1,base64urlToUint8Array:()=>Db,base64ToUint8Array:()=>AQ,assignProp:()=>K6,assertNotEqual:()=>sP,assertNever:()=>Ib,assertIs:()=>$b,assertEqual:()=>eP,assert:()=>Ub,allowsEval:()=>Yg,aborted:()=>R6,NUMBER_FORMAT_RANGES:()=>Dg,Class:()=>FQ,BIGINT_FORMAT_RANGES:()=>Mg});function eP($){return $}function sP($){return $}function $b($){}function Ib($){throw Error("Unexpected value in exhaustive check")}function Ub($){}function UI($){let I=Object.values($).filter((u)=>typeof u==="number");return Object.entries($).filter(([u,U])=>I.indexOf(+u)===-1).map(([u,U])=>U)}function W($,I="|"){return $.map((_)=>A(_)).join(I)}function C1($,I){if(typeof I==="bigint")return I.toString();return I}function f1($){return{get value(){{let _=$();return Object.defineProperty(this,"value",{value:_}),_}throw Error("cached value already set")}}}function M6($){return $===null||$===void 0}function _I($){let I=$.startsWith("^")?1:0,_=$.endsWith("$")?$.length-1:$.length;return $.slice(I,_)}function vg($,I){let _=($.toString().split(".")[1]||"").length,u=I.toString(),U=(u.split(".")[1]||"").length;if(U===0&&/\d?e-\d?/.test(u)){let G=u.match(/\d?e-(\d?)/);if(G?.[1])U=Number.parseInt(G[1])}let z=_>U?_:U,g=Number.parseInt($.toFixed(z).replace(".","")),J=Number.parseInt(I.toFixed(z).replace(".",""));return g%J/10**z}var bQ=Symbol("evaluating");function o($,I,_){let u=void 0;Object.defineProperty($,I,{get(){if(u===bQ)return;if(u===void 0)u=bQ,u=_();return u},set(U){Object.defineProperty($,I,{value:U})},configurable:!0})}function _b($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function K6($,I,_){Object.defineProperty($,I,{value:_,writable:!0,enumerable:!0,configurable:!0})}function o4(...$){let I={};for(let _ of $){let u=Object.getOwnPropertyDescriptors(_);Object.assign(I,u)}return Object.defineProperties({},I)}function ub($){return o4($._zod.def)}function zb($,I){if(!I)return $;return I.reduce((_,u)=>_?.[u],$)}function gb($){let I=Object.keys($),_=I.map((u)=>$[u]);return Promise.all(_).then((u)=>{let U={};for(let z=0;z<I.length;z++)U[I[z]]=u[z];return U})}function Jb($=10){let _="";for(let u=0;u<$;u++)_+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return _}function $_($){return JSON.stringify($)}function Hg($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var I_="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function a6($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var Yg=f1(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function V6($){if(a6($)===!1)return!1;let I=$.constructor;if(I===void 0)return!0;if(typeof I!=="function")return!0;let _=I.prototype;if(a6(_)===!1)return!1;if(Object.prototype.hasOwnProperty.call(_,"isPrototypeOf")===!1)return!1;return!0}function Og($){if(V6($))return{...$};if(Array.isArray($))return[...$];return $}function Gb($){let I=0;for(let _ in $)if(Object.prototype.hasOwnProperty.call($,_))I++;return I}var qb=($)=>{let I=typeof $;switch(I){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN($)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray($))return"array";if($===null)return"null";if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return"promise";if(typeof Map<"u"&&$ instanceof Map)return"map";if(typeof Set<"u"&&$ instanceof Set)return"set";if(typeof Date<"u"&&$ instanceof Date)return"date";if(typeof File<"u"&&$ instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${I}`)}},uI=new Set(["string","number","symbol"]),Tg=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Q4($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function i$($,I,_){let u=new $._zod.constr(I??$._zod.def);if(!I||_?.parent)u._zod.parent=$;return u}function E($){let I=$;if(!I)return{};if(typeof I==="string")return{error:()=>I};if(I?.message!==void 0){if(I?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");I.error=I.message}if(delete I.message,typeof I.error==="string")return{...I,error:()=>I.error};return I}function Xb($){let I;return new Proxy({},{get(_,u,U){return I??(I=$()),Reflect.get(I,u,U)},set(_,u,U,z){return I??(I=$()),Reflect.set(I,u,U,z)},has(_,u){return I??(I=$()),Reflect.has(I,u)},deleteProperty(_,u){return I??(I=$()),Reflect.deleteProperty(I,u)},ownKeys(_){return I??(I=$()),Reflect.ownKeys(I)},getOwnPropertyDescriptor(_,u){return I??(I=$()),Reflect.getOwnPropertyDescriptor(I,u)},defineProperty(_,u,U){return I??(I=$()),Reflect.defineProperty(I,u,U)}})}function A($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function Bg($){return Object.keys($).filter((I)=>{return $[I]._zod.optin==="optional"&&$[I]._zod.optout==="optional"})}var Dg={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Mg={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Nb($,I){let _=$._zod.def,u=_.checks;if(u&&u.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let z=o4($._zod.def,{get shape(){let g={};for(let J in I){if(!(J in _.shape))throw Error(`Unrecognized key: "${J}"`);if(!I[J])continue;g[J]=_.shape[J]}return K6(this,"shape",g),g},checks:[]});return i$($,z)}function Qb($,I){let _=$._zod.def,u=_.checks;if(u&&u.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let z=o4($._zod.def,{get shape(){let g={...$._zod.def.shape};for(let J in I){if(!(J in _.shape))throw Error(`Unrecognized key: "${J}"`);if(!I[J])continue;delete g[J]}return K6(this,"shape",g),g},checks:[]});return i$($,z)}function vb($,I){if(!V6(I))throw Error("Invalid input to extend: expected a plain object");let _=$._zod.def.checks;if(_&&_.length>0){let z=$._zod.def.shape;for(let g in I)if(Object.getOwnPropertyDescriptor(z,g)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let U=o4($._zod.def,{get shape(){let z={...$._zod.def.shape,...I};return K6(this,"shape",z),z}});return i$($,U)}function Hb($,I){if(!V6(I))throw Error("Invalid input to safeExtend: expected a plain object");let _=o4($._zod.def,{get shape(){let u={...$._zod.def.shape,...I};return K6(this,"shape",u),u}});return i$($,_)}function Yb($,I){let _=o4($._zod.def,{get shape(){let u={...$._zod.def.shape,...I._zod.def.shape};return K6(this,"shape",u),u},get catchall(){return I._zod.def.catchall},checks:[]});return i$($,_)}function Ob($,I,_){let U=I._zod.def.checks;if(U&&U.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let g=o4(I._zod.def,{get shape(){let J=I._zod.def.shape,G={...J};if(_)for(let q in _){if(!(q in J))throw Error(`Unrecognized key: "${q}"`);if(!_[q])continue;G[q]=$?new $({type:"optional",innerType:J[q]}):J[q]}else for(let q in J)G[q]=$?new $({type:"optional",innerType:J[q]}):J[q];return K6(this,"shape",G),G},checks:[]});return i$(I,g)}function Tb($,I,_){let u=o4(I._zod.def,{get shape(){let U=I._zod.def.shape,z={...U};if(_)for(let g in _){if(!(g in z))throw Error(`Unrecognized key: "${g}"`);if(!_[g])continue;z[g]=new $({type:"nonoptional",innerType:U[g]})}else for(let g in U)z[g]=new $({type:"nonoptional",innerType:U[g]});return K6(this,"shape",z),z}});return i$(I,u)}function R6($,I=0){if($.aborted===!0)return!0;for(let _=I;_<$.issues.length;_++)if($.issues[_]?.continue!==!0)return!0;return!1}function _4($,I){return I.map((_)=>{var u;return(u=_).path??(u.path=[]),_.path.unshift($),_})}function II($){return typeof $==="string"?$:$?.message}function a$($,I,_){let u={...$,path:$.path??[]};if(!$.message){let U=II($.inst?._zod.def?.error?.($))??II(I?.error?.($))??II(_.customError?.($))??II(_.localeError?.($))??"Invalid input";u.message=U}if(delete u.inst,delete u.continue,!I?.reportInput)delete u.input;return u}function zI($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function gI($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function j($){let I=typeof $;switch(I){case"number":return Number.isNaN($)?"nan":"number";case"object":{if($===null)return"null";if(Array.isArray($))return"array";let _=$;if(_&&Object.getPrototypeOf(_)!==Object.prototype&&"constructor"in _&&_.constructor)return _.constructor.name}}return I}function x1(...$){let[I,_,u]=$;if(typeof I==="string")return{message:I,code:"custom",input:_,inst:u};return{...I}}function Bb($){return Object.entries($).filter(([I,_])=>{return Number.isNaN(Number.parseInt(I,10))}).map((I)=>I[1])}function AQ($){let I=atob($),_=new Uint8Array(I.length);for(let u=0;u<I.length;u++)_[u]=I.charCodeAt(u);return _}function jQ($){let I="";for(let _=0;_<$.length;_++)I+=String.fromCharCode($[_]);return btoa(I)}function Db($){let I=$.replace(/-/g,"+").replace(/_/g,"/"),_="=".repeat((4-I.length%4)%4);return AQ(I+_)}function Mb($){return jQ($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Kb($){let I=$.replace(/^0x/,"");if(I.length%2!==0)throw Error("Invalid hex string length");let _=new Uint8Array(I.length/2);for(let u=0;u<I.length;u+=2)_[u/2]=Number.parseInt(I.slice(u,u+2),16);return _}function Vb($){return Array.from($).map((I)=>I.toString(16).padStart(2,"0")).join("")}class FQ{constructor(...$){}}var SQ=($,I)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:I,enumerable:!1}),$.message=JSON.stringify(I,C1,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},JI=B("$ZodError",SQ),e$=B("$ZodError",SQ,{Parent:Error});function GI($,I=(_)=>_.message){let _={},u=[];for(let U of $.issues)if(U.path.length>0)_[U.path[0]]=_[U.path[0]]||[],_[U.path[0]].push(I(U));else u.push(I(U));return{formErrors:u,fieldErrors:_}}function qI($,I=(_)=>_.message){let _={_errors:[]},u=(U)=>{for(let z of U.issues)if(z.code==="invalid_union"&&z.errors.length)z.errors.map((g)=>u({issues:g}));else if(z.code==="invalid_key")u({issues:z.issues});else if(z.code==="invalid_element")u({issues:z.issues});else if(z.path.length===0)_._errors.push(I(z));else{let g=_,J=0;while(J<z.path.length){let G=z.path[J];if(J!==z.path.length-1)g[G]=g[G]||{_errors:[]};else g[G]=g[G]||{_errors:[]},g[G]._errors.push(I(z));g=g[G],J++}}};return u($),_}function Kg($,I=(_)=>_.message){let _={errors:[]},u=(U,z=[])=>{var g,J;for(let G of U.issues)if(G.code==="invalid_union"&&G.errors.length)G.errors.map((q)=>u({issues:q},G.path));else if(G.code==="invalid_key")u({issues:G.issues},G.path);else if(G.code==="invalid_element")u({issues:G.issues},G.path);else{let q=[...z,...G.path];if(q.length===0){_.errors.push(I(G));continue}let N=_,X=0;while(X<q.length){let Q=q[X],H=X===q.length-1;if(typeof Q==="string")N.properties??(N.properties={}),(g=N.properties)[Q]??(g[Q]={errors:[]}),N=N.properties[Q];else N.items??(N.items=[]),(J=N.items)[Q]??(J[Q]={errors:[]}),N=N.items[Q];if(H)N.errors.push(I(G));X++}}};return u($),_}function wQ($){let I=[],_=$.map((u)=>typeof u==="object"?u.key:u);for(let u of _)if(typeof u==="number")I.push(`[${u}]`);else if(typeof u==="symbol")I.push(`[${JSON.stringify(String(u))}]`);else if(/[^\w$]/.test(u))I.push(`[${JSON.stringify(u)}]`);else{if(I.length)I.push(".");I.push(u)}return I.join("")}function Vg($){let I=[],_=[...$.issues].sort((u,U)=>(u.path??[]).length-(U.path??[]).length);for(let u of _)if(I.push(`✖ ${u.message}`),u.path?.length)I.push(` → at ${wQ(u.path)}`);return I.join(`
|
|
273
|
+
`)}var k1=($)=>(I,_,u,U)=>{let z=u?Object.assign(u,{async:!1}):{async:!1},g=I._zod.run({value:_,issues:[]},z);if(g instanceof Promise)throw new C4;if(g.issues.length){let J=new(U?.Err??$)(g.issues.map((G)=>a$(G,z,V$())));throw I_(J,U?.callee),J}return g.value},U_=k1(e$),y1=($)=>async(I,_,u,U)=>{let z=u?Object.assign(u,{async:!0}):{async:!0},g=I._zod.run({value:_,issues:[]},z);if(g instanceof Promise)g=await g;if(g.issues.length){let J=new(U?.Err??$)(g.issues.map((G)=>a$(G,z,V$())));throw I_(J,U?.callee),J}return g.value},__=y1(e$),i1=($)=>(I,_,u)=>{let U=u?{...u,async:!1}:{async:!1},z=I._zod.run({value:_,issues:[]},U);if(z instanceof Promise)throw new C4;return z.issues.length?{success:!1,error:new($??JI)(z.issues.map((g)=>a$(g,U,V$())))}:{success:!0,data:z.value}},Rg=i1(e$),l1=($)=>async(I,_,u)=>{let U=u?Object.assign(u,{async:!0}):{async:!0},z=I._zod.run({value:_,issues:[]},U);if(z instanceof Promise)z=await z;return z.issues.length?{success:!1,error:new $(z.issues.map((g)=>a$(g,U,V$())))}:{success:!0,data:z.value}},Lg=l1(e$),u_=($)=>(I,_,u)=>{let U=u?Object.assign(u,{direction:"backward"}):{direction:"backward"};return k1($)(I,_,U)},Lb=u_(e$),z_=($)=>(I,_,u)=>{return k1($)(I,_,u)},Zb=z_(e$),g_=($)=>async(I,_,u)=>{let U=u?Object.assign(u,{direction:"backward"}):{direction:"backward"};return y1($)(I,_,U)},Wb=g_(e$),J_=($)=>async(I,_,u)=>{return y1($)(I,_,u)},Pb=J_(e$),G_=($)=>(I,_,u)=>{let U=u?Object.assign(u,{direction:"backward"}):{direction:"backward"};return i1($)(I,_,U)},bb=G_(e$),q_=($)=>(I,_,u)=>{return i1($)(I,_,u)},Ab=q_(e$),X_=($)=>async(I,_,u)=>{let U=u?Object.assign(u,{direction:"backward"}):{direction:"backward"};return l1($)(I,_,U)},jb=X_(e$),N_=($)=>async(I,_,u)=>{return l1($)(I,_,u)},Fb=N_(e$);var v4={};S4(v4,{xid:()=>bg,uuid7:()=>Cb,uuid6:()=>Eb,uuid4:()=>wb,uuid:()=>e6,uppercase:()=>eg,unicodeEmail:()=>EQ,undefined:()=>tg,ulid:()=>Pg,time:()=>rg,string:()=>hg,sha512_hex:()=>UA,sha512_base64url:()=>uA,sha512_base64:()=>_A,sha384_hex:()=>sb,sha384_base64url:()=>IA,sha384_base64:()=>$A,sha256_hex:()=>tb,sha256_base64url:()=>eb,sha256_base64:()=>ab,sha1_hex:()=>cb,sha1_base64url:()=>ob,sha1_base64:()=>pb,rfc5322Email:()=>xb,number:()=>XI,null:()=>og,nanoid:()=>jg,md5_hex:()=>nb,md5_base64url:()=>db,md5_base64:()=>hb,mac:()=>xg,lowercase:()=>ag,ksuid:()=>Ag,ipv6:()=>fg,ipv4:()=>Cg,integer:()=>cg,idnEmail:()=>kb,html5Email:()=>fb,hostname:()=>lb,hex:()=>rb,guid:()=>Sg,extendedDuration:()=>Sb,emoji:()=>Eg,email:()=>wg,e164:()=>lg,duration:()=>Fg,domain:()=>mb,datetime:()=>ng,date:()=>mg,cuid2:()=>Wg,cuid:()=>Zg,cidrv6:()=>yg,cidrv4:()=>kg,browserEmail:()=>yb,boolean:()=>pg,bigint:()=>dg,base64url:()=>Q_,base64:()=>ig});var Zg=/^[cC][^\s-]{8,}$/,Wg=/^[0-9a-z]+$/,Pg=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,bg=/^[0-9a-vA-V]{20}$/,Ag=/^[A-Za-z0-9]{27}$/,jg=/^[a-zA-Z0-9_-]{21}$/,Fg=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Sb=/^[-+]?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)?)??$/,Sg=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,e6=($)=>{if(!$)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},wb=e6(4),Eb=e6(6),Cb=e6(7),wg=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,fb=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,xb=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,EQ=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,kb=EQ,yb=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,ib="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Eg(){return new RegExp(ib,"u")}var Cg=/^(?:(?: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])$/,fg=/^(([0-9a-fA-F]{1,4}:){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}|:))$/,xg=($)=>{let I=Q4($??":");return new RegExp(`^(?:[0-9A-F]{2}${I}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${I}){5}[0-9a-f]{2}$`)},kg=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,yg=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ig=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Q_=/^[A-Za-z0-9_-]*$/,lb=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,mb=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,lg=/^\+[1-9]\d{6,14}$/,CQ="(?:(?:\\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])))",mg=new RegExp(`^${CQ}$`);function fQ($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function rg($){return new RegExp(`^${fQ($)}$`)}function ng($){let I=fQ({precision:$.precision}),_=["Z"];if($.local)_.push("");if($.offset)_.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let u=`${I}(?:${_.join("|")})`;return new RegExp(`^${CQ}T(?:${u})$`)}var hg=($)=>{let I=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${I}$`)},dg=/^-?\d+n?$/,cg=/^-?\d+$/,XI=/^-?\d+(?:\.\d+)?$/,pg=/^(?:true|false)$/i,og=/^null$/i;var tg=/^undefined$/i;var ag=/^[^A-Z]*$/,eg=/^[^a-z]*$/,rb=/^[0-9a-fA-F]*$/;function NI($,I){return new RegExp(`^[A-Za-z0-9+/]{${$}}${I}$`)}function QI($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var nb=/^[0-9a-fA-F]{32}$/,hb=NI(22,"=="),db=QI(22),cb=/^[0-9a-fA-F]{40}$/,pb=NI(27,"="),ob=QI(27),tb=/^[0-9a-fA-F]{64}$/,ab=NI(43,"="),eb=QI(43),sb=/^[0-9a-fA-F]{96}$/,$A=NI(64,""),IA=QI(64),UA=/^[0-9a-fA-F]{128}$/,_A=NI(86,"=="),uA=QI(86);var X$=B("$ZodCheck",($,I)=>{var _;$._zod??($._zod={}),$._zod.def=I,(_=$._zod).onattach??(_.onattach=[])}),kQ={number:"number",bigint:"bigint",object:"date"},v_=B("$ZodCheckLessThan",($,I)=>{X$.init($,I);let _=kQ[typeof I.value];$._zod.onattach.push((u)=>{let U=u._zod.bag,z=(I.inclusive?U.maximum:U.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(I.value<z)if(I.inclusive)U.maximum=I.value;else U.exclusiveMaximum=I.value}),$._zod.check=(u)=>{if(I.inclusive?u.value<=I.value:u.value<I.value)return;u.issues.push({origin:_,code:"too_big",maximum:typeof I.value==="object"?I.value.getTime():I.value,input:u.value,inclusive:I.inclusive,inst:$,continue:!I.abort})}}),H_=B("$ZodCheckGreaterThan",($,I)=>{X$.init($,I);let _=kQ[typeof I.value];$._zod.onattach.push((u)=>{let U=u._zod.bag,z=(I.inclusive?U.minimum:U.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(I.value>z)if(I.inclusive)U.minimum=I.value;else U.exclusiveMinimum=I.value}),$._zod.check=(u)=>{if(I.inclusive?u.value>=I.value:u.value>I.value)return;u.issues.push({origin:_,code:"too_small",minimum:typeof I.value==="object"?I.value.getTime():I.value,input:u.value,inclusive:I.inclusive,inst:$,continue:!I.abort})}}),sg=B("$ZodCheckMultipleOf",($,I)=>{X$.init($,I),$._zod.onattach.push((_)=>{var u;(u=_._zod.bag).multipleOf??(u.multipleOf=I.value)}),$._zod.check=(_)=>{if(typeof _.value!==typeof I.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof _.value==="bigint"?_.value%I.value===BigInt(0):vg(_.value,I.value)===0)return;_.issues.push({origin:typeof _.value,code:"not_multiple_of",divisor:I.value,input:_.value,inst:$,continue:!I.abort})}}),$J=B("$ZodCheckNumberFormat",($,I)=>{X$.init($,I),I.format=I.format||"float64";let _=I.format?.includes("int"),u=_?"int":"number",[U,z]=Dg[I.format];$._zod.onattach.push((g)=>{let J=g._zod.bag;if(J.format=I.format,J.minimum=U,J.maximum=z,_)J.pattern=cg}),$._zod.check=(g)=>{let J=g.value;if(_){if(!Number.isInteger(J)){g.issues.push({expected:u,format:I.format,code:"invalid_type",continue:!1,input:J,inst:$});return}if(!Number.isSafeInteger(J)){if(J>0)g.issues.push({input:J,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:u,inclusive:!0,continue:!I.abort});else g.issues.push({input:J,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:u,inclusive:!0,continue:!I.abort});return}}if(J<U)g.issues.push({origin:"number",input:J,code:"too_small",minimum:U,inclusive:!0,inst:$,continue:!I.abort});if(J>z)g.issues.push({origin:"number",input:J,code:"too_big",maximum:z,inclusive:!0,inst:$,continue:!I.abort})}}),IJ=B("$ZodCheckBigIntFormat",($,I)=>{X$.init($,I);let[_,u]=Mg[I.format];$._zod.onattach.push((U)=>{let z=U._zod.bag;z.format=I.format,z.minimum=_,z.maximum=u}),$._zod.check=(U)=>{let z=U.value;if(z<_)U.issues.push({origin:"bigint",input:z,code:"too_small",minimum:_,inclusive:!0,inst:$,continue:!I.abort});if(z>u)U.issues.push({origin:"bigint",input:z,code:"too_big",maximum:u,inclusive:!0,inst:$,continue:!I.abort})}}),UJ=B("$ZodCheckMaxSize",($,I)=>{var _;X$.init($,I),(_=$._zod.def).when??(_.when=(u)=>{let U=u.value;return!M6(U)&&U.size!==void 0}),$._zod.onattach.push((u)=>{let U=u._zod.bag.maximum??Number.POSITIVE_INFINITY;if(I.maximum<U)u._zod.bag.maximum=I.maximum}),$._zod.check=(u)=>{let U=u.value;if(U.size<=I.maximum)return;u.issues.push({origin:zI(U),code:"too_big",maximum:I.maximum,inclusive:!0,input:U,inst:$,continue:!I.abort})}}),_J=B("$ZodCheckMinSize",($,I)=>{var _;X$.init($,I),(_=$._zod.def).when??(_.when=(u)=>{let U=u.value;return!M6(U)&&U.size!==void 0}),$._zod.onattach.push((u)=>{let U=u._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(I.minimum>U)u._zod.bag.minimum=I.minimum}),$._zod.check=(u)=>{let U=u.value;if(U.size>=I.minimum)return;u.issues.push({origin:zI(U),code:"too_small",minimum:I.minimum,inclusive:!0,input:U,inst:$,continue:!I.abort})}}),uJ=B("$ZodCheckSizeEquals",($,I)=>{var _;X$.init($,I),(_=$._zod.def).when??(_.when=(u)=>{let U=u.value;return!M6(U)&&U.size!==void 0}),$._zod.onattach.push((u)=>{let U=u._zod.bag;U.minimum=I.size,U.maximum=I.size,U.size=I.size}),$._zod.check=(u)=>{let U=u.value,z=U.size;if(z===I.size)return;let g=z>I.size;u.issues.push({origin:zI(U),...g?{code:"too_big",maximum:I.size}:{code:"too_small",minimum:I.size},inclusive:!0,exact:!0,input:u.value,inst:$,continue:!I.abort})}}),zJ=B("$ZodCheckMaxLength",($,I)=>{var _;X$.init($,I),(_=$._zod.def).when??(_.when=(u)=>{let U=u.value;return!M6(U)&&U.length!==void 0}),$._zod.onattach.push((u)=>{let U=u._zod.bag.maximum??Number.POSITIVE_INFINITY;if(I.maximum<U)u._zod.bag.maximum=I.maximum}),$._zod.check=(u)=>{let U=u.value;if(U.length<=I.maximum)return;let g=gI(U);u.issues.push({origin:g,code:"too_big",maximum:I.maximum,inclusive:!0,input:U,inst:$,continue:!I.abort})}}),gJ=B("$ZodCheckMinLength",($,I)=>{var _;X$.init($,I),(_=$._zod.def).when??(_.when=(u)=>{let U=u.value;return!M6(U)&&U.length!==void 0}),$._zod.onattach.push((u)=>{let U=u._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(I.minimum>U)u._zod.bag.minimum=I.minimum}),$._zod.check=(u)=>{let U=u.value;if(U.length>=I.minimum)return;let g=gI(U);u.issues.push({origin:g,code:"too_small",minimum:I.minimum,inclusive:!0,input:U,inst:$,continue:!I.abort})}}),JJ=B("$ZodCheckLengthEquals",($,I)=>{var _;X$.init($,I),(_=$._zod.def).when??(_.when=(u)=>{let U=u.value;return!M6(U)&&U.length!==void 0}),$._zod.onattach.push((u)=>{let U=u._zod.bag;U.minimum=I.length,U.maximum=I.length,U.length=I.length}),$._zod.check=(u)=>{let U=u.value,z=U.length;if(z===I.length)return;let g=gI(U),J=z>I.length;u.issues.push({origin:g,...J?{code:"too_big",maximum:I.length}:{code:"too_small",minimum:I.length},inclusive:!0,exact:!0,input:u.value,inst:$,continue:!I.abort})}}),m1=B("$ZodCheckStringFormat",($,I)=>{var _,u;if(X$.init($,I),$._zod.onattach.push((U)=>{let z=U._zod.bag;if(z.format=I.format,I.pattern)z.patterns??(z.patterns=new Set),z.patterns.add(I.pattern)}),I.pattern)(_=$._zod).check??(_.check=(U)=>{if(I.pattern.lastIndex=0,I.pattern.test(U.value))return;U.issues.push({origin:"string",code:"invalid_format",format:I.format,input:U.value,...I.pattern?{pattern:I.pattern.toString()}:{},inst:$,continue:!I.abort})});else(u=$._zod).check??(u.check=()=>{})}),GJ=B("$ZodCheckRegex",($,I)=>{m1.init($,I),$._zod.check=(_)=>{if(I.pattern.lastIndex=0,I.pattern.test(_.value))return;_.issues.push({origin:"string",code:"invalid_format",format:"regex",input:_.value,pattern:I.pattern.toString(),inst:$,continue:!I.abort})}}),qJ=B("$ZodCheckLowerCase",($,I)=>{I.pattern??(I.pattern=ag),m1.init($,I)}),XJ=B("$ZodCheckUpperCase",($,I)=>{I.pattern??(I.pattern=eg),m1.init($,I)}),NJ=B("$ZodCheckIncludes",($,I)=>{X$.init($,I);let _=Q4(I.includes),u=new RegExp(typeof I.position==="number"?`^.{${I.position}}${_}`:_);I.pattern=u,$._zod.onattach.push((U)=>{let z=U._zod.bag;z.patterns??(z.patterns=new Set),z.patterns.add(u)}),$._zod.check=(U)=>{if(U.value.includes(I.includes,I.position))return;U.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:I.includes,input:U.value,inst:$,continue:!I.abort})}}),QJ=B("$ZodCheckStartsWith",($,I)=>{X$.init($,I);let _=new RegExp(`^${Q4(I.prefix)}.*`);I.pattern??(I.pattern=_),$._zod.onattach.push((u)=>{let U=u._zod.bag;U.patterns??(U.patterns=new Set),U.patterns.add(_)}),$._zod.check=(u)=>{if(u.value.startsWith(I.prefix))return;u.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:I.prefix,input:u.value,inst:$,continue:!I.abort})}}),vJ=B("$ZodCheckEndsWith",($,I)=>{X$.init($,I);let _=new RegExp(`.*${Q4(I.suffix)}$`);I.pattern??(I.pattern=_),$._zod.onattach.push((u)=>{let U=u._zod.bag;U.patterns??(U.patterns=new Set),U.patterns.add(_)}),$._zod.check=(u)=>{if(u.value.endsWith(I.suffix))return;u.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:I.suffix,input:u.value,inst:$,continue:!I.abort})}});function xQ($,I,_){if($.issues.length)I.issues.push(..._4(_,$.issues))}var HJ=B("$ZodCheckProperty",($,I)=>{X$.init($,I),$._zod.check=(_)=>{let u=I.schema._zod.run({value:_.value[I.property],issues:[]},{});if(u instanceof Promise)return u.then((U)=>xQ(U,_,I.property));xQ(u,_,I.property);return}}),YJ=B("$ZodCheckMimeType",($,I)=>{X$.init($,I);let _=new Set(I.mime);$._zod.onattach.push((u)=>{u._zod.bag.mime=I.mime}),$._zod.check=(u)=>{if(_.has(u.value.type))return;u.issues.push({code:"invalid_value",values:I.mime,input:u.value.type,inst:$,continue:!I.abort})}}),OJ=B("$ZodCheckOverwrite",($,I)=>{X$.init($,I),$._zod.check=(_)=>{_.value=I.tx(_.value)}});class Y_{constructor($=[]){if(this.content=[],this.indent=0,this)this.args=$}indented($){this.indent+=1,$(this),this.indent-=1}write($){if(typeof $==="function"){$(this,{execution:"sync"}),$(this,{execution:"async"});return}let _=$.split(`
|
|
274
274
|
`).filter((z)=>z),u=Math.min(..._.map((z)=>z.length-z.trimStart().length)),U=_.map((z)=>z.slice(u)).map((z)=>" ".repeat(this.indent*2)+z);for(let z of U)this.content.push(z)}compile(){let $=Function,I=this?.args,u=[...(this?.content??[""]).map((U)=>` ${U}`)];return new $(...I,u.join(`
|
|
275
|
-
`))}}var MJ={major:4,minor:3,patch:6};var n=B("$ZodType",($,I)=>{var _;$??($={}),$._zod.def=I,$._zod.bag=$._zod.bag||{},$._zod.version=MJ;let u=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))u.unshift($);for(let U of u)for(let z of U._zod.onattach)z($);if(u.length===0)(_=$._zod).deferred??(_.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let U=(g,J,G)=>{let v=K6(g),X;for(let q of J){if(q._zod.def.when){if(!q._zod.def.when(g))continue}else if(v)continue;let N=g.issues.length,Y=q._zod.check(g);if(Y instanceof Promise&&G?.async===!1)throw new E4;if(X||Y instanceof Promise)X=(X??Promise.resolve()).then(async()=>{if(await Y,g.issues.length===N)return;if(!v)v=K6(g,N)});else{if(g.issues.length===N)continue;if(!v)v=K6(g,N)}}if(X)return X.then(()=>{return g});return g},z=(g,J,G)=>{if(K6(g))return g.aborted=!0,g;let v=U(J,u,G);if(v instanceof Promise){if(G.async===!1)throw new E4;return v.then((X)=>$._zod.parse(X,G))}return $._zod.parse(v,G)};$._zod.run=(g,J)=>{if(J.skipChecks)return $._zod.parse(g,J);if(J.direction==="backward"){let v=$._zod.parse({value:g.value,issues:[]},{...J,skipChecks:!0});if(v instanceof Promise)return v.then((X)=>{return z(X,g,J)});return z(v,g,J)}let G=$._zod.parse(g,J);if(G instanceof Promise){if(J.async===!1)throw new E4;return G.then((v)=>U(v,u,J))}return U(G,u,J)}}t($,"~standard",()=>({validate:(U)=>{try{let z=Wg($,U);return z.success?{value:z.data}:{issues:z.error?.issues}}catch(z){return Pg($,U).then((g)=>g.success?{value:g.data}:{issues:g.error?.issues})}},vendor:"zod",version:1}))}),e6=B("$ZodString",($,I)=>{n.init($,I),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??pg($._zod.bag),$._zod.parse=(_,u)=>{if(I.coerce)try{_.value=String(_.value)}catch(U){}if(typeof _.value==="string")return _;return _.issues.push({expected:"string",code:"invalid_type",input:_.value,inst:$}),_}}),J$=B("$ZodStringFormat",($,I)=>{m1.init($,I),e6.init($,I)}),VJ=B("$ZodGUID",($,I)=>{I.pattern??(I.pattern=Cg),J$.init($,I)}),LJ=B("$ZodUUID",($,I)=>{if(I.version){let u={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[I.version];if(u===void 0)throw Error(`Invalid UUID version: "${I.version}"`);I.pattern??(I.pattern=a6(u))}else I.pattern??(I.pattern=a6());J$.init($,I)}),RJ=B("$ZodEmail",($,I)=>{I.pattern??(I.pattern=fg),J$.init($,I)}),ZJ=B("$ZodURL",($,I)=>{J$.init($,I),$._zod.check=(_)=>{try{let u=_.value.trim(),U=new URL(u);if(I.hostname){if(I.hostname.lastIndex=0,!I.hostname.test(U.hostname))_.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:I.hostname.source,input:_.value,inst:$,continue:!I.abort})}if(I.protocol){if(I.protocol.lastIndex=0,!I.protocol.test(U.protocol.endsWith(":")?U.protocol.slice(0,-1):U.protocol))_.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:I.protocol.source,input:_.value,inst:$,continue:!I.abort})}if(I.normalize)_.value=U.href;else _.value=u;return}catch(u){_.issues.push({code:"invalid_format",format:"url",input:_.value,inst:$,continue:!I.abort})}}}),WJ=B("$ZodEmoji",($,I)=>{I.pattern??(I.pattern=xg()),J$.init($,I)}),PJ=B("$ZodNanoID",($,I)=>{I.pattern??(I.pattern=wg),J$.init($,I)}),bJ=B("$ZodCUID",($,I)=>{I.pattern??(I.pattern=bg),J$.init($,I)}),AJ=B("$ZodCUID2",($,I)=>{I.pattern??(I.pattern=Ag),J$.init($,I)}),jJ=B("$ZodULID",($,I)=>{I.pattern??(I.pattern=jg),J$.init($,I)}),FJ=B("$ZodXID",($,I)=>{I.pattern??(I.pattern=Fg),J$.init($,I)}),SJ=B("$ZodKSUID",($,I)=>{I.pattern??(I.pattern=Sg),J$.init($,I)}),wJ=B("$ZodISODateTime",($,I)=>{I.pattern??(I.pattern=cg(I)),J$.init($,I)}),EJ=B("$ZodISODate",($,I)=>{I.pattern??(I.pattern=hg),J$.init($,I)}),CJ=B("$ZodISOTime",($,I)=>{I.pattern??(I.pattern=dg(I)),J$.init($,I)}),fJ=B("$ZodISODuration",($,I)=>{I.pattern??(I.pattern=Eg),J$.init($,I)}),xJ=B("$ZodIPv4",($,I)=>{I.pattern??(I.pattern=kg),J$.init($,I),$._zod.bag.format="ipv4"}),kJ=B("$ZodIPv6",($,I)=>{I.pattern??(I.pattern=yg),J$.init($,I),$._zod.bag.format="ipv6",$._zod.check=(_)=>{try{new URL(`http://[${_.value}]`)}catch{_.issues.push({code:"invalid_format",format:"ipv6",input:_.value,inst:$,continue:!I.abort})}}}),yJ=B("$ZodMAC",($,I)=>{I.pattern??(I.pattern=ig(I.delimiter)),J$.init($,I),$._zod.bag.format="mac"}),iJ=B("$ZodCIDRv4",($,I)=>{I.pattern??(I.pattern=lg),J$.init($,I)}),lJ=B("$ZodCIDRv6",($,I)=>{I.pattern??(I.pattern=rg),J$.init($,I),$._zod.check=(_)=>{let u=_.value.split("/");try{if(u.length!==2)throw Error();let[U,z]=u;if(!z)throw Error();let g=Number(z);if(`${g}`!==z)throw Error();if(g<0||g>128)throw Error();new URL(`http://[${U}]`)}catch{_.issues.push({code:"invalid_format",format:"cidrv6",input:_.value,inst:$,continue:!I.abort})}}});function rJ($){if($==="")return!0;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var mJ=B("$ZodBase64",($,I)=>{I.pattern??(I.pattern=mg),J$.init($,I),$._zod.bag.contentEncoding="base64",$._zod.check=(_)=>{if(rJ(_.value))return;_.issues.push({code:"invalid_format",format:"base64",input:_.value,inst:$,continue:!I.abort})}});function sN($){if(!N_.test($))return!1;let I=$.replace(/[-_]/g,(u)=>u==="-"?"+":"/"),_=I.padEnd(Math.ceil(I.length/4)*4,"=");return rJ(_)}var nJ=B("$ZodBase64URL",($,I)=>{I.pattern??(I.pattern=N_),J$.init($,I),$._zod.bag.contentEncoding="base64url",$._zod.check=(_)=>{if(sN(_.value))return;_.issues.push({code:"invalid_format",format:"base64url",input:_.value,inst:$,continue:!I.abort})}}),hJ=B("$ZodE164",($,I)=>{I.pattern??(I.pattern=ng),J$.init($,I)});function $Q($,I=null){try{let _=$.split(".");if(_.length!==3)return!1;let[u]=_;if(!u)return!1;let U=JSON.parse(atob(u));if("typ"in U&&U?.typ!=="JWT")return!1;if(!U.alg)return!1;if(I&&(!("alg"in U)||U.alg!==I))return!1;return!0}catch{return!1}}var dJ=B("$ZodJWT",($,I)=>{J$.init($,I),$._zod.check=(_)=>{if($Q(_.value,I.alg))return;_.issues.push({code:"invalid_format",format:"jwt",input:_.value,inst:$,continue:!I.abort})}}),cJ=B("$ZodCustomStringFormat",($,I)=>{J$.init($,I),$._zod.check=(_)=>{if(I.fn(_.value))return;_.issues.push({code:"invalid_format",format:I.format,input:_.value,inst:$,continue:!I.abort})}}),K_=B("$ZodNumber",($,I)=>{n.init($,I),$._zod.pattern=$._zod.bag.pattern??XI,$._zod.parse=(_,u)=>{if(I.coerce)try{_.value=Number(_.value)}catch(g){}let U=_.value;if(typeof U==="number"&&!Number.isNaN(U)&&Number.isFinite(U))return _;let z=typeof U==="number"?Number.isNaN(U)?"NaN":!Number.isFinite(U)?"Infinity":void 0:void 0;return _.issues.push({expected:"number",code:"invalid_type",input:U,inst:$,...z?{received:z}:{}}),_}}),pJ=B("$ZodNumberFormat",($,I)=>{_J.init($,I),K_.init($,I)}),YI=B("$ZodBoolean",($,I)=>{n.init($,I),$._zod.pattern=ag,$._zod.parse=(_,u)=>{if(I.coerce)try{_.value=Boolean(_.value)}catch(z){}let U=_.value;if(typeof U==="boolean")return _;return _.issues.push({expected:"boolean",code:"invalid_type",input:U,inst:$}),_}}),V_=B("$ZodBigInt",($,I)=>{n.init($,I),$._zod.pattern=og,$._zod.parse=(_,u)=>{if(I.coerce)try{_.value=BigInt(_.value)}catch(U){}if(typeof _.value==="bigint")return _;return _.issues.push({expected:"bigint",code:"invalid_type",input:_.value,inst:$}),_}}),oJ=B("$ZodBigIntFormat",($,I)=>{uJ.init($,I),V_.init($,I)}),tJ=B("$ZodSymbol",($,I)=>{n.init($,I),$._zod.parse=(_,u)=>{let U=_.value;if(typeof U==="symbol")return _;return _.issues.push({expected:"symbol",code:"invalid_type",input:U,inst:$}),_}}),aJ=B("$ZodUndefined",($,I)=>{n.init($,I),$._zod.pattern=sg,$._zod.values=new Set([void 0]),$._zod.optin="optional",$._zod.optout="optional",$._zod.parse=(_,u)=>{let U=_.value;if(typeof U>"u")return _;return _.issues.push({expected:"undefined",code:"invalid_type",input:U,inst:$}),_}}),eJ=B("$ZodNull",($,I)=>{n.init($,I),$._zod.pattern=eg,$._zod.values=new Set([null]),$._zod.parse=(_,u)=>{let U=_.value;if(U===null)return _;return _.issues.push({expected:"null",code:"invalid_type",input:U,inst:$}),_}}),sJ=B("$ZodAny",($,I)=>{n.init($,I),$._zod.parse=(_)=>_}),$8=B("$ZodUnknown",($,I)=>{n.init($,I),$._zod.parse=(_)=>_}),I8=B("$ZodNever",($,I)=>{n.init($,I),$._zod.parse=(_,u)=>{return _.issues.push({expected:"never",code:"invalid_type",input:_.value,inst:$}),_}}),U8=B("$ZodVoid",($,I)=>{n.init($,I),$._zod.parse=(_,u)=>{let U=_.value;if(typeof U>"u")return _;return _.issues.push({expected:"void",code:"invalid_type",input:U,inst:$}),_}}),_8=B("$ZodDate",($,I)=>{n.init($,I),$._zod.parse=(_,u)=>{if(I.coerce)try{_.value=new Date(_.value)}catch(J){}let U=_.value,z=U instanceof Date;if(z&&!Number.isNaN(U.getTime()))return _;return _.issues.push({expected:"date",code:"invalid_type",input:U,...z?{received:"Invalid Date"}:{},inst:$}),_}});function rN($,I,_){if($.issues.length)I.issues.push(..._4(_,$.issues));I.value[_]=$.value}var u8=B("$ZodArray",($,I)=>{n.init($,I),$._zod.parse=(_,u)=>{let U=_.value;if(!Array.isArray(U))return _.issues.push({expected:"array",code:"invalid_type",input:U,inst:$}),_;_.value=Array(U.length);let z=[];for(let g=0;g<U.length;g++){let J=U[g],G=I.element._zod.run({value:J,issues:[]},u);if(G instanceof Promise)z.push(G.then((v)=>rN(v,_,g)));else rN(G,_,g)}if(z.length)return Promise.all(z).then(()=>_);return _}});function M_($,I,_,u,U){if($.issues.length){if(U&&!(_ in u))return;I.issues.push(..._4(_,$.issues))}if($.value===void 0){if(_ in u)I.value[_]=void 0}else I.value[_]=$.value}function IQ($){let I=Object.keys($.shape);for(let u of I)if(!$.shape?.[u]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${u}": expected a Zod schema`);let _=Kg($.shape);return{...$,keys:I,keySet:new Set(I),numKeys:I.length,optionalKeys:new Set(_)}}function UQ($,I,_,u,U,z){let g=[],J=U.keySet,G=U.catchall._zod,v=G.def.type,X=G.optout==="optional";for(let q in I){if(J.has(q))continue;if(v==="never"){g.push(q);continue}let N=G.run({value:I[q],issues:[]},u);if(N instanceof Promise)$.push(N.then((Y)=>M_(Y,_,q,I,X)));else M_(N,_,q,I,X)}if(g.length)_.issues.push({code:"unrecognized_keys",keys:g,input:I,inst:z});if(!$.length)return _;return Promise.all($).then(()=>{return _})}var _Q=B("$ZodObject",($,I)=>{if(n.init($,I),!Object.getOwnPropertyDescriptor(I,"shape")?.get){let J=I.shape;Object.defineProperty(I,"shape",{get:()=>{let G={...J};return Object.defineProperty(I,"shape",{value:G}),G}})}let u=x1(()=>IQ(I));t($._zod,"propValues",()=>{let J=I.shape,G={};for(let v in J){let X=J[v]._zod;if(X.values){G[v]??(G[v]=new Set);for(let q of X.values)G[v].add(q)}}return G});let U=t6,z=I.catchall,g;$._zod.parse=(J,G)=>{g??(g=u.value);let v=J.value;if(!U(v))return J.issues.push({expected:"object",code:"invalid_type",input:v,inst:$}),J;J.value={};let X=[],q=g.shape;for(let N of g.keys){let Y=q[N],H=Y._zod.optout==="optional",Q=Y._zod.run({value:v[N],issues:[]},G);if(Q instanceof Promise)X.push(Q.then((O)=>M_(O,J,N,v,H)));else M_(Q,J,N,v,H)}if(!z)return X.length?Promise.all(X).then(()=>J):J;return UQ(X,v,J,G,u.value,$)}}),z8=B("$ZodObjectJIT",($,I)=>{_Q.init($,I);let _=$._zod.parse,u=x1(()=>IQ(I)),U=(N)=>{let Y=new H_(["shape","payload","ctx"]),H=u.value,Q=(W)=>{let L=$_(W);return`shape[${L}]._zod.run({ value: input[${L}], issues: [] }, ctx)`};Y.write("const input = payload.value;");let O=Object.create(null),D=0;for(let W of H.keys)O[W]=`key_${D++}`;Y.write("const newResult = {};");for(let W of H.keys){let L=O[W],K=$_(W),M=N[W]?._zod?.optout==="optional";if(Y.write(`const ${L} = ${Q(W)};`),M)Y.write(`
|
|
276
|
-
if (${
|
|
277
|
-
if (${
|
|
278
|
-
payload.issues = payload.issues.concat(${
|
|
275
|
+
`))}}var TJ={major:4,minor:3,patch:6};var n=B("$ZodType",($,I)=>{var _;$??($={}),$._zod.def=I,$._zod.bag=$._zod.bag||{},$._zod.version=TJ;let u=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))u.unshift($);for(let U of u)for(let z of U._zod.onattach)z($);if(u.length===0)(_=$._zod).deferred??(_.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let U=(g,J,G)=>{let q=R6(g),N;for(let X of J){if(X._zod.def.when){if(!X._zod.def.when(g))continue}else if(q)continue;let Q=g.issues.length,H=X._zod.check(g);if(H instanceof Promise&&G?.async===!1)throw new C4;if(N||H instanceof Promise)N=(N??Promise.resolve()).then(async()=>{if(await H,g.issues.length===Q)return;if(!q)q=R6(g,Q)});else{if(g.issues.length===Q)continue;if(!q)q=R6(g,Q)}}if(N)return N.then(()=>{return g});return g},z=(g,J,G)=>{if(R6(g))return g.aborted=!0,g;let q=U(J,u,G);if(q instanceof Promise){if(G.async===!1)throw new C4;return q.then((N)=>$._zod.parse(N,G))}return $._zod.parse(q,G)};$._zod.run=(g,J)=>{if(J.skipChecks)return $._zod.parse(g,J);if(J.direction==="backward"){let q=$._zod.parse({value:g.value,issues:[]},{...J,skipChecks:!0});if(q instanceof Promise)return q.then((N)=>{return z(N,g,J)});return z(q,g,J)}let G=$._zod.parse(g,J);if(G instanceof Promise){if(J.async===!1)throw new C4;return G.then((q)=>U(q,u,J))}return U(G,u,J)}}o($,"~standard",()=>({validate:(U)=>{try{let z=Rg($,U);return z.success?{value:z.data}:{issues:z.error?.issues}}catch(z){return Lg($,U).then((g)=>g.success?{value:g.data}:{issues:g.error?.issues})}},vendor:"zod",version:1}))}),s6=B("$ZodString",($,I)=>{n.init($,I),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??hg($._zod.bag),$._zod.parse=(_,u)=>{if(I.coerce)try{_.value=String(_.value)}catch(U){}if(typeof _.value==="string")return _;return _.issues.push({expected:"string",code:"invalid_type",input:_.value,inst:$}),_}}),J$=B("$ZodStringFormat",($,I)=>{m1.init($,I),s6.init($,I)}),DJ=B("$ZodGUID",($,I)=>{I.pattern??(I.pattern=Sg),J$.init($,I)}),MJ=B("$ZodUUID",($,I)=>{if(I.version){let u={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[I.version];if(u===void 0)throw Error(`Invalid UUID version: "${I.version}"`);I.pattern??(I.pattern=e6(u))}else I.pattern??(I.pattern=e6());J$.init($,I)}),KJ=B("$ZodEmail",($,I)=>{I.pattern??(I.pattern=wg),J$.init($,I)}),VJ=B("$ZodURL",($,I)=>{J$.init($,I),$._zod.check=(_)=>{try{let u=_.value.trim(),U=new URL(u);if(I.hostname){if(I.hostname.lastIndex=0,!I.hostname.test(U.hostname))_.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:I.hostname.source,input:_.value,inst:$,continue:!I.abort})}if(I.protocol){if(I.protocol.lastIndex=0,!I.protocol.test(U.protocol.endsWith(":")?U.protocol.slice(0,-1):U.protocol))_.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:I.protocol.source,input:_.value,inst:$,continue:!I.abort})}if(I.normalize)_.value=U.href;else _.value=u;return}catch(u){_.issues.push({code:"invalid_format",format:"url",input:_.value,inst:$,continue:!I.abort})}}}),RJ=B("$ZodEmoji",($,I)=>{I.pattern??(I.pattern=Eg()),J$.init($,I)}),LJ=B("$ZodNanoID",($,I)=>{I.pattern??(I.pattern=jg),J$.init($,I)}),ZJ=B("$ZodCUID",($,I)=>{I.pattern??(I.pattern=Zg),J$.init($,I)}),WJ=B("$ZodCUID2",($,I)=>{I.pattern??(I.pattern=Wg),J$.init($,I)}),PJ=B("$ZodULID",($,I)=>{I.pattern??(I.pattern=Pg),J$.init($,I)}),bJ=B("$ZodXID",($,I)=>{I.pattern??(I.pattern=bg),J$.init($,I)}),AJ=B("$ZodKSUID",($,I)=>{I.pattern??(I.pattern=Ag),J$.init($,I)}),jJ=B("$ZodISODateTime",($,I)=>{I.pattern??(I.pattern=ng(I)),J$.init($,I)}),FJ=B("$ZodISODate",($,I)=>{I.pattern??(I.pattern=mg),J$.init($,I)}),SJ=B("$ZodISOTime",($,I)=>{I.pattern??(I.pattern=rg(I)),J$.init($,I)}),wJ=B("$ZodISODuration",($,I)=>{I.pattern??(I.pattern=Fg),J$.init($,I)}),EJ=B("$ZodIPv4",($,I)=>{I.pattern??(I.pattern=Cg),J$.init($,I),$._zod.bag.format="ipv4"}),CJ=B("$ZodIPv6",($,I)=>{I.pattern??(I.pattern=fg),J$.init($,I),$._zod.bag.format="ipv6",$._zod.check=(_)=>{try{new URL(`http://[${_.value}]`)}catch{_.issues.push({code:"invalid_format",format:"ipv6",input:_.value,inst:$,continue:!I.abort})}}}),fJ=B("$ZodMAC",($,I)=>{I.pattern??(I.pattern=xg(I.delimiter)),J$.init($,I),$._zod.bag.format="mac"}),xJ=B("$ZodCIDRv4",($,I)=>{I.pattern??(I.pattern=kg),J$.init($,I)}),kJ=B("$ZodCIDRv6",($,I)=>{I.pattern??(I.pattern=yg),J$.init($,I),$._zod.check=(_)=>{let u=_.value.split("/");try{if(u.length!==2)throw Error();let[U,z]=u;if(!z)throw Error();let g=Number(z);if(`${g}`!==z)throw Error();if(g<0||g>128)throw Error();new URL(`http://[${U}]`)}catch{_.issues.push({code:"invalid_format",format:"cidrv6",input:_.value,inst:$,continue:!I.abort})}}});function yJ($){if($==="")return!0;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var iJ=B("$ZodBase64",($,I)=>{I.pattern??(I.pattern=ig),J$.init($,I),$._zod.bag.contentEncoding="base64",$._zod.check=(_)=>{if(yJ(_.value))return;_.issues.push({code:"invalid_format",format:"base64",input:_.value,inst:$,continue:!I.abort})}});function aQ($){if(!Q_.test($))return!1;let I=$.replace(/[-_]/g,(u)=>u==="-"?"+":"/"),_=I.padEnd(Math.ceil(I.length/4)*4,"=");return yJ(_)}var lJ=B("$ZodBase64URL",($,I)=>{I.pattern??(I.pattern=Q_),J$.init($,I),$._zod.bag.contentEncoding="base64url",$._zod.check=(_)=>{if(aQ(_.value))return;_.issues.push({code:"invalid_format",format:"base64url",input:_.value,inst:$,continue:!I.abort})}}),mJ=B("$ZodE164",($,I)=>{I.pattern??(I.pattern=lg),J$.init($,I)});function eQ($,I=null){try{let _=$.split(".");if(_.length!==3)return!1;let[u]=_;if(!u)return!1;let U=JSON.parse(atob(u));if("typ"in U&&U?.typ!=="JWT")return!1;if(!U.alg)return!1;if(I&&(!("alg"in U)||U.alg!==I))return!1;return!0}catch{return!1}}var rJ=B("$ZodJWT",($,I)=>{J$.init($,I),$._zod.check=(_)=>{if(eQ(_.value,I.alg))return;_.issues.push({code:"invalid_format",format:"jwt",input:_.value,inst:$,continue:!I.abort})}}),nJ=B("$ZodCustomStringFormat",($,I)=>{J$.init($,I),$._zod.check=(_)=>{if(I.fn(_.value))return;_.issues.push({code:"invalid_format",format:I.format,input:_.value,inst:$,continue:!I.abort})}}),K_=B("$ZodNumber",($,I)=>{n.init($,I),$._zod.pattern=$._zod.bag.pattern??XI,$._zod.parse=(_,u)=>{if(I.coerce)try{_.value=Number(_.value)}catch(g){}let U=_.value;if(typeof U==="number"&&!Number.isNaN(U)&&Number.isFinite(U))return _;let z=typeof U==="number"?Number.isNaN(U)?"NaN":!Number.isFinite(U)?"Infinity":void 0:void 0;return _.issues.push({expected:"number",code:"invalid_type",input:U,inst:$,...z?{received:z}:{}}),_}}),hJ=B("$ZodNumberFormat",($,I)=>{$J.init($,I),K_.init($,I)}),vI=B("$ZodBoolean",($,I)=>{n.init($,I),$._zod.pattern=pg,$._zod.parse=(_,u)=>{if(I.coerce)try{_.value=Boolean(_.value)}catch(z){}let U=_.value;if(typeof U==="boolean")return _;return _.issues.push({expected:"boolean",code:"invalid_type",input:U,inst:$}),_}}),V_=B("$ZodBigInt",($,I)=>{n.init($,I),$._zod.pattern=dg,$._zod.parse=(_,u)=>{if(I.coerce)try{_.value=BigInt(_.value)}catch(U){}if(typeof _.value==="bigint")return _;return _.issues.push({expected:"bigint",code:"invalid_type",input:_.value,inst:$}),_}}),dJ=B("$ZodBigIntFormat",($,I)=>{IJ.init($,I),V_.init($,I)}),cJ=B("$ZodSymbol",($,I)=>{n.init($,I),$._zod.parse=(_,u)=>{let U=_.value;if(typeof U==="symbol")return _;return _.issues.push({expected:"symbol",code:"invalid_type",input:U,inst:$}),_}}),pJ=B("$ZodUndefined",($,I)=>{n.init($,I),$._zod.pattern=tg,$._zod.values=new Set([void 0]),$._zod.optin="optional",$._zod.optout="optional",$._zod.parse=(_,u)=>{let U=_.value;if(typeof U>"u")return _;return _.issues.push({expected:"undefined",code:"invalid_type",input:U,inst:$}),_}}),oJ=B("$ZodNull",($,I)=>{n.init($,I),$._zod.pattern=og,$._zod.values=new Set([null]),$._zod.parse=(_,u)=>{let U=_.value;if(U===null)return _;return _.issues.push({expected:"null",code:"invalid_type",input:U,inst:$}),_}}),tJ=B("$ZodAny",($,I)=>{n.init($,I),$._zod.parse=(_)=>_}),aJ=B("$ZodUnknown",($,I)=>{n.init($,I),$._zod.parse=(_)=>_}),eJ=B("$ZodNever",($,I)=>{n.init($,I),$._zod.parse=(_,u)=>{return _.issues.push({expected:"never",code:"invalid_type",input:_.value,inst:$}),_}}),sJ=B("$ZodVoid",($,I)=>{n.init($,I),$._zod.parse=(_,u)=>{let U=_.value;if(typeof U>"u")return _;return _.issues.push({expected:"void",code:"invalid_type",input:U,inst:$}),_}}),$8=B("$ZodDate",($,I)=>{n.init($,I),$._zod.parse=(_,u)=>{if(I.coerce)try{_.value=new Date(_.value)}catch(J){}let U=_.value,z=U instanceof Date;if(z&&!Number.isNaN(U.getTime()))return _;return _.issues.push({expected:"date",code:"invalid_type",input:U,...z?{received:"Invalid Date"}:{},inst:$}),_}});function iQ($,I,_){if($.issues.length)I.issues.push(..._4(_,$.issues));I.value[_]=$.value}var I8=B("$ZodArray",($,I)=>{n.init($,I),$._zod.parse=(_,u)=>{let U=_.value;if(!Array.isArray(U))return _.issues.push({expected:"array",code:"invalid_type",input:U,inst:$}),_;_.value=Array(U.length);let z=[];for(let g=0;g<U.length;g++){let J=U[g],G=I.element._zod.run({value:J,issues:[]},u);if(G instanceof Promise)z.push(G.then((q)=>iQ(q,_,g)));else iQ(G,_,g)}if(z.length)return Promise.all(z).then(()=>_);return _}});function M_($,I,_,u,U){if($.issues.length){if(U&&!(_ in u))return;I.issues.push(..._4(_,$.issues))}if($.value===void 0){if(_ in u)I.value[_]=void 0}else I.value[_]=$.value}function sQ($){let I=Object.keys($.shape);for(let u of I)if(!$.shape?.[u]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${u}": expected a Zod schema`);let _=Bg($.shape);return{...$,keys:I,keySet:new Set(I),numKeys:I.length,optionalKeys:new Set(_)}}function $7($,I,_,u,U,z){let g=[],J=U.keySet,G=U.catchall._zod,q=G.def.type,N=G.optout==="optional";for(let X in I){if(J.has(X))continue;if(q==="never"){g.push(X);continue}let Q=G.run({value:I[X],issues:[]},u);if(Q instanceof Promise)$.push(Q.then((H)=>M_(H,_,X,I,N)));else M_(Q,_,X,I,N)}if(g.length)_.issues.push({code:"unrecognized_keys",keys:g,input:I,inst:z});if(!$.length)return _;return Promise.all($).then(()=>{return _})}var I7=B("$ZodObject",($,I)=>{if(n.init($,I),!Object.getOwnPropertyDescriptor(I,"shape")?.get){let J=I.shape;Object.defineProperty(I,"shape",{get:()=>{let G={...J};return Object.defineProperty(I,"shape",{value:G}),G}})}let u=f1(()=>sQ(I));o($._zod,"propValues",()=>{let J=I.shape,G={};for(let q in J){let N=J[q]._zod;if(N.values){G[q]??(G[q]=new Set);for(let X of N.values)G[q].add(X)}}return G});let U=a6,z=I.catchall,g;$._zod.parse=(J,G)=>{g??(g=u.value);let q=J.value;if(!U(q))return J.issues.push({expected:"object",code:"invalid_type",input:q,inst:$}),J;J.value={};let N=[],X=g.shape;for(let Q of g.keys){let H=X[Q],Y=H._zod.optout==="optional",v=H._zod.run({value:q[Q],issues:[]},G);if(v instanceof Promise)N.push(v.then((O)=>M_(O,J,Q,q,Y)));else M_(v,J,Q,q,Y)}if(!z)return N.length?Promise.all(N).then(()=>J):J;return $7(N,q,J,G,u.value,$)}}),U8=B("$ZodObjectJIT",($,I)=>{I7.init($,I);let _=$._zod.parse,u=f1(()=>sQ(I)),U=(Q)=>{let H=new Y_(["shape","payload","ctx"]),Y=u.value,v=(V)=>{let R=$_(V);return`shape[${R}]._zod.run({ value: input[${R}], issues: [] }, ctx)`};H.write("const input = payload.value;");let O=Object.create(null),T=0;for(let V of Y.keys)O[V]=`key_${T++}`;H.write("const newResult = {};");for(let V of Y.keys){let R=O[V],M=$_(V),K=Q[V]?._zod?.optout==="optional";if(H.write(`const ${R} = ${v(V)};`),K)H.write(`
|
|
276
|
+
if (${R}.issues.length) {
|
|
277
|
+
if (${M} in input) {
|
|
278
|
+
payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
|
|
279
279
|
...iss,
|
|
280
|
-
path: iss.path ? [${
|
|
280
|
+
path: iss.path ? [${M}, ...iss.path] : [${M}]
|
|
281
281
|
})));
|
|
282
282
|
}
|
|
283
283
|
}
|
|
284
284
|
|
|
285
|
-
if (${
|
|
286
|
-
if (${
|
|
287
|
-
newResult[${
|
|
285
|
+
if (${R}.value === undefined) {
|
|
286
|
+
if (${M} in input) {
|
|
287
|
+
newResult[${M}] = undefined;
|
|
288
288
|
}
|
|
289
289
|
} else {
|
|
290
|
-
newResult[${
|
|
290
|
+
newResult[${M}] = ${R}.value;
|
|
291
291
|
}
|
|
292
292
|
|
|
293
|
-
`);else
|
|
294
|
-
if (${
|
|
295
|
-
payload.issues = payload.issues.concat(${
|
|
293
|
+
`);else H.write(`
|
|
294
|
+
if (${R}.issues.length) {
|
|
295
|
+
payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
|
|
296
296
|
...iss,
|
|
297
|
-
path: iss.path ? [${
|
|
297
|
+
path: iss.path ? [${M}, ...iss.path] : [${M}]
|
|
298
298
|
})));
|
|
299
299
|
}
|
|
300
300
|
|
|
301
|
-
if (${
|
|
302
|
-
if (${
|
|
303
|
-
newResult[${
|
|
301
|
+
if (${R}.value === undefined) {
|
|
302
|
+
if (${M} in input) {
|
|
303
|
+
newResult[${M}] = undefined;
|
|
304
304
|
}
|
|
305
305
|
} else {
|
|
306
|
-
newResult[${
|
|
306
|
+
newResult[${M}] = ${R}.value;
|
|
307
307
|
}
|
|
308
308
|
|
|
309
|
-
`)}Y.write("payload.value = newResult;"),Y.write("return payload;");let V=Y.compile();return(W,L)=>V(N,W,L)},z,g=t6,J=!II.jitless,v=J&&Bg.value,X=I.catchall,q;$._zod.parse=(N,Y)=>{q??(q=u.value);let H=N.value;if(!g(H))return N.issues.push({expected:"object",code:"invalid_type",input:H,inst:$}),N;if(J&&v&&Y?.async===!1&&Y.jitless!==!0){if(!z)z=U(I.shape);if(N=z(N,Y),!X)return N;return UQ([],H,N,Y,q,$)}return _(N,Y)}});function mN($,I,_,u){for(let z of $)if(z.issues.length===0)return I.value=z.value,I;let U=$.filter((z)=>!K6(z));if(U.length===1)return I.value=U[0].value,U[0];return I.issues.push({code:"invalid_union",input:I.value,inst:_,errors:$.map((z)=>z.issues.map((g)=>t$(g,u,L$())))}),I}var HI=B("$ZodUnion",($,I)=>{n.init($,I),t($._zod,"optin",()=>I.options.some((U)=>U._zod.optin==="optional")?"optional":void 0),t($._zod,"optout",()=>I.options.some((U)=>U._zod.optout==="optional")?"optional":void 0),t($._zod,"values",()=>{if(I.options.every((U)=>U._zod.values))return new Set(I.options.flatMap((U)=>Array.from(U._zod.values)));return}),t($._zod,"pattern",()=>{if(I.options.every((U)=>U._zod.pattern)){let U=I.options.map((z)=>z._zod.pattern);return new RegExp(`^(${U.map((z)=>uI(z.source)).join("|")})$`)}return});let _=I.options.length===1,u=I.options[0]._zod.run;$._zod.parse=(U,z)=>{if(_)return u(U,z);let g=!1,J=[];for(let G of I.options){let v=G._zod.run({value:U.value,issues:[]},z);if(v instanceof Promise)J.push(v),g=!0;else{if(v.issues.length===0)return v;J.push(v)}}if(!g)return mN(J,U,$,z);return Promise.all(J).then((G)=>{return mN(G,U,$,z)})}});function nN($,I,_,u){let U=$.filter((z)=>z.issues.length===0);if(U.length===1)return I.value=U[0].value,I;if(U.length===0)I.issues.push({code:"invalid_union",input:I.value,inst:_,errors:$.map((z)=>z.issues.map((g)=>t$(g,u,L$())))});else I.issues.push({code:"invalid_union",input:I.value,inst:_,errors:[],inclusive:!1});return I}var g8=B("$ZodXor",($,I)=>{HI.init($,I),I.inclusive=!1;let _=I.options.length===1,u=I.options[0]._zod.run;$._zod.parse=(U,z)=>{if(_)return u(U,z);let g=!1,J=[];for(let G of I.options){let v=G._zod.run({value:U.value,issues:[]},z);if(v instanceof Promise)J.push(v),g=!0;else J.push(v)}if(!g)return nN(J,U,$,z);return Promise.all(J).then((G)=>{return nN(G,U,$,z)})}}),J8=B("$ZodDiscriminatedUnion",($,I)=>{I.inclusive=!1,HI.init($,I);let _=$._zod.parse;t($._zod,"propValues",()=>{let U={};for(let z of I.options){let g=z._zod.propValues;if(!g||Object.keys(g).length===0)throw Error(`Invalid discriminated union option at index "${I.options.indexOf(z)}"`);for(let[J,G]of Object.entries(g)){if(!U[J])U[J]=new Set;for(let v of G)U[J].add(v)}}return U});let u=x1(()=>{let U=I.options,z=new Map;for(let g of U){let J=g._zod.propValues?.[I.discriminator];if(!J||J.size===0)throw Error(`Invalid discriminated union option at index "${I.options.indexOf(g)}"`);for(let G of J){if(z.has(G))throw Error(`Duplicate discriminator value "${String(G)}"`);z.set(G,g)}}return z});$._zod.parse=(U,z)=>{let g=U.value;if(!t6(g))return U.issues.push({code:"invalid_type",expected:"object",input:g,inst:$}),U;let J=u.value.get(g?.[I.discriminator]);if(J)return J._zod.run(U,z);if(I.unionFallback)return _(U,z);return U.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:I.discriminator,input:g,path:[I.discriminator],inst:$}),U}}),G8=B("$ZodIntersection",($,I)=>{n.init($,I),$._zod.parse=(_,u)=>{let U=_.value,z=I.left._zod.run({value:U,issues:[]},u),g=I.right._zod.run({value:U,issues:[]},u);if(z instanceof Promise||g instanceof Promise)return Promise.all([z,g]).then(([G,v])=>{return hN(_,G,v)});return hN(_,z,g)}});function KJ($,I){if($===I)return{valid:!0,data:$};if($ instanceof Date&&I instanceof Date&&+$===+I)return{valid:!0,data:$};if(M6($)&&M6(I)){let _=Object.keys(I),u=Object.keys($).filter((z)=>_.indexOf(z)!==-1),U={...$,...I};for(let z of u){let g=KJ($[z],I[z]);if(!g.valid)return{valid:!1,mergeErrorPath:[z,...g.mergeErrorPath]};U[z]=g.data}return{valid:!0,data:U}}if(Array.isArray($)&&Array.isArray(I)){if($.length!==I.length)return{valid:!1,mergeErrorPath:[]};let _=[];for(let u=0;u<$.length;u++){let U=$[u],z=I[u],g=KJ(U,z);if(!g.valid)return{valid:!1,mergeErrorPath:[u,...g.mergeErrorPath]};_.push(g.data)}return{valid:!0,data:_}}return{valid:!1,mergeErrorPath:[]}}function hN($,I,_){let u=new Map,U;for(let J of I.issues)if(J.code==="unrecognized_keys"){U??(U=J);for(let G of J.keys){if(!u.has(G))u.set(G,{});u.get(G).l=!0}}else $.issues.push(J);for(let J of _.issues)if(J.code==="unrecognized_keys")for(let G of J.keys){if(!u.has(G))u.set(G,{});u.get(G).r=!0}else $.issues.push(J);let z=[...u].filter(([,J])=>J.l&&J.r).map(([J])=>J);if(z.length&&U)$.issues.push({...U,keys:z});if(K6($))return $;let g=KJ(I.value,_.value);if(!g.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(g.mergeErrorPath)}`);return $.value=g.data,$}var L_=B("$ZodTuple",($,I)=>{n.init($,I);let _=I.items;$._zod.parse=(u,U)=>{let z=u.value;if(!Array.isArray(z))return u.issues.push({input:z,inst:$,expected:"tuple",code:"invalid_type"}),u;u.value=[];let g=[],J=[..._].reverse().findIndex((X)=>X._zod.optin!=="optional"),G=J===-1?0:_.length-J;if(!I.rest){let X=z.length>_.length,q=z.length<G-1;if(X||q)return u.issues.push({...X?{code:"too_big",maximum:_.length,inclusive:!0}:{code:"too_small",minimum:_.length},input:z,inst:$,origin:"array"}),u}let v=-1;for(let X of _){if(v++,v>=z.length){if(v>=G)continue}let q=X._zod.run({value:z[v],issues:[]},U);if(q instanceof Promise)g.push(q.then((N)=>O_(N,u,v)));else O_(q,u,v)}if(I.rest){let X=z.slice(_.length);for(let q of X){v++;let N=I.rest._zod.run({value:q,issues:[]},U);if(N instanceof Promise)g.push(N.then((Y)=>O_(Y,u,v)));else O_(N,u,v)}}if(g.length)return Promise.all(g).then(()=>u);return u}});function O_($,I,_){if($.issues.length)I.issues.push(..._4(_,$.issues));I.value[_]=$.value}var v8=B("$ZodRecord",($,I)=>{n.init($,I),$._zod.parse=(_,u)=>{let U=_.value;if(!M6(U))return _.issues.push({expected:"record",code:"invalid_type",input:U,inst:$}),_;let z=[],g=I.keyType._zod.values;if(g){_.value={};let J=new Set;for(let v of g)if(typeof v==="string"||typeof v==="number"||typeof v==="symbol"){J.add(typeof v==="number"?v.toString():v);let X=I.valueType._zod.run({value:U[v],issues:[]},u);if(X instanceof Promise)z.push(X.then((q)=>{if(q.issues.length)_.issues.push(..._4(v,q.issues));_.value[v]=q.value}));else{if(X.issues.length)_.issues.push(..._4(v,X.issues));_.value[v]=X.value}}let G;for(let v in U)if(!J.has(v))G=G??[],G.push(v);if(G&&G.length>0)_.issues.push({code:"unrecognized_keys",input:U,inst:$,keys:G})}else{_.value={};for(let J of Reflect.ownKeys(U)){if(J==="__proto__")continue;let G=I.keyType._zod.run({value:J,issues:[]},u);if(G instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof J==="string"&&XI.test(J)&&G.issues.length){let q=I.keyType._zod.run({value:Number(J),issues:[]},u);if(q instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(q.issues.length===0)G=q}if(G.issues.length){if(I.mode==="loose")_.value[J]=U[J];else _.issues.push({code:"invalid_key",origin:"record",issues:G.issues.map((q)=>t$(q,u,L$())),input:J,path:[J],inst:$});continue}let X=I.valueType._zod.run({value:U[J],issues:[]},u);if(X instanceof Promise)z.push(X.then((q)=>{if(q.issues.length)_.issues.push(..._4(J,q.issues));_.value[G.value]=q.value}));else{if(X.issues.length)_.issues.push(..._4(J,X.issues));_.value[G.value]=X.value}}}if(z.length)return Promise.all(z).then(()=>_);return _}}),q8=B("$ZodMap",($,I)=>{n.init($,I),$._zod.parse=(_,u)=>{let U=_.value;if(!(U instanceof Map))return _.issues.push({expected:"map",code:"invalid_type",input:U,inst:$}),_;let z=[];_.value=new Map;for(let[g,J]of U){let G=I.keyType._zod.run({value:g,issues:[]},u),v=I.valueType._zod.run({value:J,issues:[]},u);if(G instanceof Promise||v instanceof Promise)z.push(Promise.all([G,v]).then(([X,q])=>{dN(X,q,_,g,U,$,u)}));else dN(G,v,_,g,U,$,u)}if(z.length)return Promise.all(z).then(()=>_);return _}});function dN($,I,_,u,U,z,g){if($.issues.length)if(zI.has(typeof u))_.issues.push(..._4(u,$.issues));else _.issues.push({code:"invalid_key",origin:"map",input:U,inst:z,issues:$.issues.map((J)=>t$(J,g,L$()))});if(I.issues.length)if(zI.has(typeof u))_.issues.push(..._4(u,I.issues));else _.issues.push({origin:"map",code:"invalid_element",input:U,inst:z,key:u,issues:I.issues.map((J)=>t$(J,g,L$()))});_.value.set($.value,I.value)}var X8=B("$ZodSet",($,I)=>{n.init($,I),$._zod.parse=(_,u)=>{let U=_.value;if(!(U instanceof Set))return _.issues.push({input:U,inst:$,expected:"set",code:"invalid_type"}),_;let z=[];_.value=new Set;for(let g of U){let J=I.valueType._zod.run({value:g,issues:[]},u);if(J instanceof Promise)z.push(J.then((G)=>cN(G,_)));else cN(J,_)}if(z.length)return Promise.all(z).then(()=>_);return _}});function cN($,I){if($.issues.length)I.issues.push(...$.issues);I.value.add($.value)}var N8=B("$ZodEnum",($,I)=>{n.init($,I);let _=_I(I.entries),u=new Set(_);$._zod.values=u,$._zod.pattern=new RegExp(`^(${_.filter((U)=>zI.has(typeof U)).map((U)=>typeof U==="string"?N4(U):U.toString()).join("|")})$`),$._zod.parse=(U,z)=>{let g=U.value;if(u.has(g))return U;return U.issues.push({code:"invalid_value",values:_,input:g,inst:$}),U}}),Q8=B("$ZodLiteral",($,I)=>{if(n.init($,I),I.values.length===0)throw Error("Cannot create literal schema with no valid values");let _=new Set(I.values);$._zod.values=_,$._zod.pattern=new RegExp(`^(${I.values.map((u)=>typeof u==="string"?N4(u):u?N4(u.toString()):String(u)).join("|")})$`),$._zod.parse=(u,U)=>{let z=u.value;if(_.has(z))return u;return u.issues.push({code:"invalid_value",values:I.values,input:z,inst:$}),u}}),Y8=B("$ZodFile",($,I)=>{n.init($,I),$._zod.parse=(_,u)=>{let U=_.value;if(U instanceof File)return _;return _.issues.push({expected:"file",code:"invalid_type",input:U,inst:$}),_}}),H8=B("$ZodTransform",($,I)=>{n.init($,I),$._zod.parse=(_,u)=>{if(u.direction==="backward")throw new o6($.constructor.name);let U=I.transform(_.value,_);if(u.async)return(U instanceof Promise?U:Promise.resolve(U)).then((g)=>{return _.value=g,_});if(U instanceof Promise)throw new E4;return _.value=U,_}});function pN($,I){if($.issues.length&&I===void 0)return{issues:[],value:void 0};return $}var R_=B("$ZodOptional",($,I)=>{n.init($,I),$._zod.optin="optional",$._zod.optout="optional",t($._zod,"values",()=>{return I.innerType._zod.values?new Set([...I.innerType._zod.values,void 0]):void 0}),t($._zod,"pattern",()=>{let _=I.innerType._zod.pattern;return _?new RegExp(`^(${uI(_.source)})?$`):void 0}),$._zod.parse=(_,u)=>{if(I.innerType._zod.optin==="optional"){let U=I.innerType._zod.run(_,u);if(U instanceof Promise)return U.then((z)=>pN(z,_.value));return pN(U,_.value)}if(_.value===void 0)return _;return I.innerType._zod.run(_,u)}}),O8=B("$ZodExactOptional",($,I)=>{R_.init($,I),t($._zod,"values",()=>I.innerType._zod.values),t($._zod,"pattern",()=>I.innerType._zod.pattern),$._zod.parse=(_,u)=>{return I.innerType._zod.run(_,u)}}),T8=B("$ZodNullable",($,I)=>{n.init($,I),t($._zod,"optin",()=>I.innerType._zod.optin),t($._zod,"optout",()=>I.innerType._zod.optout),t($._zod,"pattern",()=>{let _=I.innerType._zod.pattern;return _?new RegExp(`^(${uI(_.source)}|null)$`):void 0}),t($._zod,"values",()=>{return I.innerType._zod.values?new Set([...I.innerType._zod.values,null]):void 0}),$._zod.parse=(_,u)=>{if(_.value===null)return _;return I.innerType._zod.run(_,u)}}),B8=B("$ZodDefault",($,I)=>{n.init($,I),$._zod.optin="optional",t($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(_,u)=>{if(u.direction==="backward")return I.innerType._zod.run(_,u);if(_.value===void 0)return _.value=I.defaultValue,_;let U=I.innerType._zod.run(_,u);if(U instanceof Promise)return U.then((z)=>oN(z,I));return oN(U,I)}});function oN($,I){if($.value===void 0)$.value=I.defaultValue;return $}var D8=B("$ZodPrefault",($,I)=>{n.init($,I),$._zod.optin="optional",t($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(_,u)=>{if(u.direction==="backward")return I.innerType._zod.run(_,u);if(_.value===void 0)_.value=I.defaultValue;return I.innerType._zod.run(_,u)}}),M8=B("$ZodNonOptional",($,I)=>{n.init($,I),t($._zod,"values",()=>{let _=I.innerType._zod.values;return _?new Set([..._].filter((u)=>u!==void 0)):void 0}),$._zod.parse=(_,u)=>{let U=I.innerType._zod.run(_,u);if(U instanceof Promise)return U.then((z)=>tN(z,$));return tN(U,$)}});function tN($,I){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:I});return $}var K8=B("$ZodSuccess",($,I)=>{n.init($,I),$._zod.parse=(_,u)=>{if(u.direction==="backward")throw new o6("ZodSuccess");let U=I.innerType._zod.run(_,u);if(U instanceof Promise)return U.then((z)=>{return _.value=z.issues.length===0,_});return _.value=U.issues.length===0,_}}),V8=B("$ZodCatch",($,I)=>{n.init($,I),t($._zod,"optin",()=>I.innerType._zod.optin),t($._zod,"optout",()=>I.innerType._zod.optout),t($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(_,u)=>{if(u.direction==="backward")return I.innerType._zod.run(_,u);let U=I.innerType._zod.run(_,u);if(U instanceof Promise)return U.then((z)=>{if(_.value=z.value,z.issues.length)_.value=I.catchValue({..._,error:{issues:z.issues.map((g)=>t$(g,u,L$()))},input:_.value}),_.issues=[];return _});if(_.value=U.value,U.issues.length)_.value=I.catchValue({..._,error:{issues:U.issues.map((z)=>t$(z,u,L$()))},input:_.value}),_.issues=[];return _}}),L8=B("$ZodNaN",($,I)=>{n.init($,I),$._zod.parse=(_,u)=>{if(typeof _.value!=="number"||!Number.isNaN(_.value))return _.issues.push({input:_.value,inst:$,expected:"nan",code:"invalid_type"}),_;return _}}),R8=B("$ZodPipe",($,I)=>{n.init($,I),t($._zod,"values",()=>I.in._zod.values),t($._zod,"optin",()=>I.in._zod.optin),t($._zod,"optout",()=>I.out._zod.optout),t($._zod,"propValues",()=>I.in._zod.propValues),$._zod.parse=(_,u)=>{if(u.direction==="backward"){let z=I.out._zod.run(_,u);if(z instanceof Promise)return z.then((g)=>T_(g,I.in,u));return T_(z,I.in,u)}let U=I.in._zod.run(_,u);if(U instanceof Promise)return U.then((z)=>T_(z,I.out,u));return T_(U,I.out,u)}});function T_($,I,_){if($.issues.length)return $.aborted=!0,$;return I._zod.run({value:$.value,issues:$.issues},_)}var OI=B("$ZodCodec",($,I)=>{n.init($,I),t($._zod,"values",()=>I.in._zod.values),t($._zod,"optin",()=>I.in._zod.optin),t($._zod,"optout",()=>I.out._zod.optout),t($._zod,"propValues",()=>I.in._zod.propValues),$._zod.parse=(_,u)=>{if((u.direction||"forward")==="forward"){let z=I.in._zod.run(_,u);if(z instanceof Promise)return z.then((g)=>B_(g,I,u));return B_(z,I,u)}else{let z=I.out._zod.run(_,u);if(z instanceof Promise)return z.then((g)=>B_(g,I,u));return B_(z,I,u)}}});function B_($,I,_){if($.issues.length)return $.aborted=!0,$;if((_.direction||"forward")==="forward"){let U=I.transform($.value,$);if(U instanceof Promise)return U.then((z)=>D_($,z,I.out,_));return D_($,U,I.out,_)}else{let U=I.reverseTransform($.value,$);if(U instanceof Promise)return U.then((z)=>D_($,z,I.in,_));return D_($,U,I.in,_)}}function D_($,I,_,u){if($.issues.length)return $.aborted=!0,$;return _._zod.run({value:I,issues:$.issues},u)}var Z8=B("$ZodReadonly",($,I)=>{n.init($,I),t($._zod,"propValues",()=>I.innerType._zod.propValues),t($._zod,"values",()=>I.innerType._zod.values),t($._zod,"optin",()=>I.innerType?._zod?.optin),t($._zod,"optout",()=>I.innerType?._zod?.optout),$._zod.parse=(_,u)=>{if(u.direction==="backward")return I.innerType._zod.run(_,u);let U=I.innerType._zod.run(_,u);if(U instanceof Promise)return U.then(aN);return aN(U)}});function aN($){return $.value=Object.freeze($.value),$}var W8=B("$ZodTemplateLiteral",($,I)=>{n.init($,I);let _=[];for(let u of I.parts)if(typeof u==="object"&&u!==null){if(!u._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...u._zod.traits].shift()}`);let U=u._zod.pattern instanceof RegExp?u._zod.pattern.source:u._zod.pattern;if(!U)throw Error(`Invalid template literal part: ${u._zod.traits}`);let z=U.startsWith("^")?1:0,g=U.endsWith("$")?U.length-1:U.length;_.push(U.slice(z,g))}else if(u===null||Mg.has(typeof u))_.push(N4(`${u}`));else throw Error(`Invalid template literal part: ${u}`);$._zod.pattern=new RegExp(`^${_.join("")}$`),$._zod.parse=(u,U)=>{if(typeof u.value!=="string")return u.issues.push({input:u.value,inst:$,expected:"string",code:"invalid_type"}),u;if($._zod.pattern.lastIndex=0,!$._zod.pattern.test(u.value))return u.issues.push({input:u.value,inst:$,code:"invalid_format",format:I.format??"template_literal",pattern:$._zod.pattern.source}),u;return u}}),P8=B("$ZodFunction",($,I)=>{return n.init($,I),$._def=I,$._zod.def=I,$.implement=(_)=>{if(typeof _!=="function")throw Error("implement() must be called with a function");return function(...u){let U=$._def.input?U_($._def.input,u):u,z=Reflect.apply(_,this,U);if($._def.output)return U_($._def.output,z);return z}},$.implementAsync=(_)=>{if(typeof _!=="function")throw Error("implementAsync() must be called with a function");return async function(...u){let U=$._def.input?await __($._def.input,u):u,z=await Reflect.apply(_,this,U);if($._def.output)return await __($._def.output,z);return z}},$._zod.parse=(_,u)=>{if(typeof _.value!=="function")return _.issues.push({code:"invalid_type",expected:"function",input:_.value,inst:$}),_;if($._def.output&&$._def.output._zod.def.type==="promise")_.value=$.implementAsync(_.value);else _.value=$.implement(_.value);return _},$.input=(..._)=>{let u=$.constructor;if(Array.isArray(_[0]))return new u({type:"function",input:new L_({type:"tuple",items:_[0],rest:_[1]}),output:$._def.output});return new u({type:"function",input:_[0],output:$._def.output})},$.output=(_)=>{return new $.constructor({type:"function",input:$._def.input,output:_})},$}),b8=B("$ZodPromise",($,I)=>{n.init($,I),$._zod.parse=(_,u)=>{return Promise.resolve(_.value).then((U)=>I.innerType._zod.run({value:U,issues:[]},u))}}),A8=B("$ZodLazy",($,I)=>{n.init($,I),t($._zod,"innerType",()=>I.getter()),t($._zod,"pattern",()=>$._zod.innerType?._zod?.pattern),t($._zod,"propValues",()=>$._zod.innerType?._zod?.propValues),t($._zod,"optin",()=>$._zod.innerType?._zod?.optin??void 0),t($._zod,"optout",()=>$._zod.innerType?._zod?.optout??void 0),$._zod.parse=(_,u)=>{return $._zod.innerType._zod.run(_,u)}}),j8=B("$ZodCustom",($,I)=>{q$.init($,I),n.init($,I),$._zod.parse=(_,u)=>{return _},$._zod.check=(_)=>{let u=_.value,U=I.fn(u);if(U instanceof Promise)return U.then((z)=>eN(z,_,u,$));eN(U,_,u,$);return}});function eN($,I,_,u){if(!$){let U={code:"custom",input:_,inst:u,path:[...u._zod.def.path??[]],continue:!u._zod.def.abort};if(u._zod.def.params)U.params=u._zod.def.params;I.issues.push(k1(U))}}var KI={};F4(KI,{zhTW:()=>K3,zhCN:()=>M3,yo:()=>V3,vi:()=>D3,uz:()=>B3,ur:()=>T3,uk:()=>MI,ua:()=>O3,tr:()=>H3,th:()=>Y3,ta:()=>Q3,sv:()=>N3,sl:()=>X3,ru:()=>q3,pt:()=>v3,ps:()=>J3,pl:()=>G3,ota:()=>g3,no:()=>z3,nl:()=>u3,ms:()=>_3,mk:()=>U3,lt:()=>I3,ko:()=>$3,km:()=>BI,kh:()=>s8,ka:()=>e8,ja:()=>a8,it:()=>t8,is:()=>o8,id:()=>p8,hy:()=>c8,hu:()=>d8,he:()=>h8,frCA:()=>n8,fr:()=>m8,fi:()=>r8,fa:()=>l8,es:()=>i8,eo:()=>y8,en:()=>TI,de:()=>k8,da:()=>x8,cs:()=>f8,ca:()=>C8,bg:()=>E8,be:()=>w8,az:()=>S8,ar:()=>F8});var zA=()=>{let $={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function I(U){return $[U]??null}let _={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`مدخلات غير مقبولة: يفترض إدخال instanceof ${U.expected}، ولكن تم إدخال ${J}`;return`مدخلات غير مقبولة: يفترض إدخال ${z}، ولكن تم إدخال ${J}`}case"invalid_value":if(U.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${j(U.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${R(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return` أكبر من اللازم: يفترض أن تكون ${U.origin??"القيمة"} ${z} ${U.maximum.toString()} ${g.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${U.origin??"القيمة"} ${z} ${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`أصغر من اللازم: يفترض لـ ${U.origin} أن يكون ${z} ${U.minimum.toString()} ${g.unit}`;return`أصغر من اللازم: يفترض لـ ${U.origin} أن يكون ${z} ${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${U.prefix}"`;if(z.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${z.suffix}"`;if(z.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${z.includes}"`;if(z.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${z.pattern}`;return`${_[z.format]??U.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${U.divisor}`;case"unrecognized_keys":return`معرف${U.keys.length>1?"ات":""} غريب${U.keys.length>1?"ة":""}: ${R(U.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${U.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${U.origin}`;default:return"مدخل غير مقبول"}}};function F8(){return{localeError:zA()}}var gA=()=>{let $={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function I(U){return $[U]??null}let _={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Yanlış dəyər: gözlənilən instanceof ${U.expected}, daxil olan ${J}`;return`Yanlış dəyər: gözlənilən ${z}, daxil olan ${J}`}case"invalid_value":if(U.values.length===1)return`Yanlış dəyər: gözlənilən ${j(U.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${R(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Çox böyük: gözlənilən ${U.origin??"dəyər"} ${z}${U.maximum.toString()} ${g.unit??"element"}`;return`Çox böyük: gözlənilən ${U.origin??"dəyər"} ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Çox kiçik: gözlənilən ${U.origin} ${z}${U.minimum.toString()} ${g.unit}`;return`Çox kiçik: gözlənilən ${U.origin} ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Yanlış mətn: "${z.prefix}" ilə başlamalıdır`;if(z.format==="ends_with")return`Yanlış mətn: "${z.suffix}" ilə bitməlidir`;if(z.format==="includes")return`Yanlış mətn: "${z.includes}" daxil olmalıdır`;if(z.format==="regex")return`Yanlış mətn: ${z.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${_[z.format]??U.format}`}case"not_multiple_of":return`Yanlış ədəd: ${U.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${U.keys.length>1?"lar":""}: ${R(U.keys,", ")}`;case"invalid_key":return`${U.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${U.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function S8(){return{localeError:gA()}}function uQ($,I,_,u){let U=Math.abs($),z=U%10,g=U%100;if(g>=11&&g<=19)return u;if(z===1)return I;if(z>=2&&z<=4)return _;return u}var JA=()=>{let $={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function I(U){return $[U]??null}let _={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"},u={nan:"NaN",number:"лік",array:"масіў"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Няправільны ўвод: чакаўся instanceof ${U.expected}, атрымана ${J}`;return`Няправільны ўвод: чакаўся ${z}, атрымана ${J}`}case"invalid_value":if(U.values.length===1)return`Няправільны ўвод: чакалася ${j(U.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${R(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g){let J=Number(U.maximum),G=uQ(J,g.unit.one,g.unit.few,g.unit.many);return`Занадта вялікі: чакалася, што ${U.origin??"значэнне"} павінна ${g.verb} ${z}${U.maximum.toString()} ${G}`}return`Занадта вялікі: чакалася, што ${U.origin??"значэнне"} павінна быць ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g){let J=Number(U.minimum),G=uQ(J,g.unit.one,g.unit.few,g.unit.many);return`Занадта малы: чакалася, што ${U.origin} павінна ${g.verb} ${z}${U.minimum.toString()} ${G}`}return`Занадта малы: чакалася, што ${U.origin} павінна быць ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${z.prefix}"`;if(z.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${z.suffix}"`;if(z.format==="includes")return`Няправільны радок: павінен змяшчаць "${z.includes}"`;if(z.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${z.pattern}`;return`Няправільны ${_[z.format]??U.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${U.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${U.keys.length>1?"ключы":"ключ"}: ${R(U.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${U.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${U.origin}`;default:return"Няправільны ўвод"}}};function w8(){return{localeError:JA()}}var GA=()=>{let $={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function I(U){return $[U]??null}let _={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",jwt:"JWT",template_literal:"вход"},u={nan:"NaN",number:"число",array:"масив"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Невалиден вход: очакван instanceof ${U.expected}, получен ${J}`;return`Невалиден вход: очакван ${z}, получен ${J}`}case"invalid_value":if(U.values.length===1)return`Невалиден вход: очакван ${j(U.values[0])}`;return`Невалидна опция: очаквано едно от ${R(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Твърде голямо: очаква се ${U.origin??"стойност"} да съдържа ${z}${U.maximum.toString()} ${g.unit??"елемента"}`;return`Твърде голямо: очаква се ${U.origin??"стойност"} да бъде ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Твърде малко: очаква се ${U.origin} да съдържа ${z}${U.minimum.toString()} ${g.unit}`;return`Твърде малко: очаква се ${U.origin} да бъде ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Невалиден низ: трябва да започва с "${z.prefix}"`;if(z.format==="ends_with")return`Невалиден низ: трябва да завършва с "${z.suffix}"`;if(z.format==="includes")return`Невалиден низ: трябва да включва "${z.includes}"`;if(z.format==="regex")return`Невалиден низ: трябва да съвпада с ${z.pattern}`;let g="Невалиден";if(z.format==="emoji")g="Невалидно";if(z.format==="datetime")g="Невалидно";if(z.format==="date")g="Невалидна";if(z.format==="time")g="Невалидно";if(z.format==="duration")g="Невалидна";return`${g} ${_[z.format]??U.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${U.divisor}`;case"unrecognized_keys":return`Неразпознат${U.keys.length>1?"и":""} ключ${U.keys.length>1?"ове":""}: ${R(U.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${U.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${U.origin}`;default:return"Невалиден вход"}}};function E8(){return{localeError:GA()}}var vA=()=>{let $={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function I(U){return $[U]??null}let _={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Tipus invàlid: s'esperava instanceof ${U.expected}, s'ha rebut ${J}`;return`Tipus invàlid: s'esperava ${z}, s'ha rebut ${J}`}case"invalid_value":if(U.values.length===1)return`Valor invàlid: s'esperava ${j(U.values[0])}`;return`Opció invàlida: s'esperava una de ${R(U.values," o ")}`;case"too_big":{let z=U.inclusive?"com a màxim":"menys de",g=I(U.origin);if(g)return`Massa gran: s'esperava que ${U.origin??"el valor"} contingués ${z} ${U.maximum.toString()} ${g.unit??"elements"}`;return`Massa gran: s'esperava que ${U.origin??"el valor"} fos ${z} ${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?"com a mínim":"més de",g=I(U.origin);if(g)return`Massa petit: s'esperava que ${U.origin} contingués ${z} ${U.minimum.toString()} ${g.unit}`;return`Massa petit: s'esperava que ${U.origin} fos ${z} ${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Format invàlid: ha de començar amb "${z.prefix}"`;if(z.format==="ends_with")return`Format invàlid: ha d'acabar amb "${z.suffix}"`;if(z.format==="includes")return`Format invàlid: ha d'incloure "${z.includes}"`;if(z.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${z.pattern}`;return`Format invàlid per a ${_[z.format]??U.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${U.divisor}`;case"unrecognized_keys":return`Clau${U.keys.length>1?"s":""} no reconeguda${U.keys.length>1?"s":""}: ${R(U.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${U.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${U.origin}`;default:return"Entrada invàlida"}}};function C8(){return{localeError:vA()}}var qA=()=>{let $={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function I(U){return $[U]??null}let _={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"},u={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Neplatný vstup: očekáváno instanceof ${U.expected}, obdrženo ${J}`;return`Neplatný vstup: očekáváno ${z}, obdrženo ${J}`}case"invalid_value":if(U.values.length===1)return`Neplatný vstup: očekáváno ${j(U.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${R(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Hodnota je příliš velká: ${U.origin??"hodnota"} musí mít ${z}${U.maximum.toString()} ${g.unit??"prvků"}`;return`Hodnota je příliš velká: ${U.origin??"hodnota"} musí být ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Hodnota je příliš malá: ${U.origin??"hodnota"} musí mít ${z}${U.minimum.toString()} ${g.unit??"prvků"}`;return`Hodnota je příliš malá: ${U.origin??"hodnota"} musí být ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Neplatný řetězec: musí začínat na "${z.prefix}"`;if(z.format==="ends_with")return`Neplatný řetězec: musí končit na "${z.suffix}"`;if(z.format==="includes")return`Neplatný řetězec: musí obsahovat "${z.includes}"`;if(z.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${z.pattern}`;return`Neplatný formát ${_[z.format]??U.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${U.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${R(U.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${U.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${U.origin}`;default:return"Neplatný vstup"}}};function f8(){return{localeError:qA()}}var XA=()=>{let $={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function I(U){return $[U]??null}let _={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},u={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Ugyldigt input: forventede instanceof ${U.expected}, fik ${J}`;return`Ugyldigt input: forventede ${z}, fik ${J}`}case"invalid_value":if(U.values.length===1)return`Ugyldig værdi: forventede ${j(U.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${R(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin),J=u[U.origin]??U.origin;if(g)return`For stor: forventede ${J??"value"} ${g.verb} ${z} ${U.maximum.toString()} ${g.unit??"elementer"}`;return`For stor: forventede ${J??"value"} havde ${z} ${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin),J=u[U.origin]??U.origin;if(g)return`For lille: forventede ${J} ${g.verb} ${z} ${U.minimum.toString()} ${g.unit}`;return`For lille: forventede ${J} havde ${z} ${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Ugyldig streng: skal starte med "${z.prefix}"`;if(z.format==="ends_with")return`Ugyldig streng: skal ende med "${z.suffix}"`;if(z.format==="includes")return`Ugyldig streng: skal indeholde "${z.includes}"`;if(z.format==="regex")return`Ugyldig streng: skal matche mønsteret ${z.pattern}`;return`Ugyldig ${_[z.format]??U.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${U.divisor}`;case"unrecognized_keys":return`${U.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${R(U.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${U.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${U.origin}`;default:return"Ugyldigt input"}}};function x8(){return{localeError:XA()}}var NA=()=>{let $={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function I(U){return $[U]??null}let _={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},u={nan:"NaN",number:"Zahl",array:"Array"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Ungültige Eingabe: erwartet instanceof ${U.expected}, erhalten ${J}`;return`Ungültige Eingabe: erwartet ${z}, erhalten ${J}`}case"invalid_value":if(U.values.length===1)return`Ungültige Eingabe: erwartet ${j(U.values[0])}`;return`Ungültige Option: erwartet eine von ${R(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Zu groß: erwartet, dass ${U.origin??"Wert"} ${z}${U.maximum.toString()} ${g.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${U.origin??"Wert"} ${z}${U.maximum.toString()} ist`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Zu klein: erwartet, dass ${U.origin} ${z}${U.minimum.toString()} ${g.unit} hat`;return`Zu klein: erwartet, dass ${U.origin} ${z}${U.minimum.toString()} ist`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Ungültiger String: muss mit "${z.prefix}" beginnen`;if(z.format==="ends_with")return`Ungültiger String: muss mit "${z.suffix}" enden`;if(z.format==="includes")return`Ungültiger String: muss "${z.includes}" enthalten`;if(z.format==="regex")return`Ungültiger String: muss dem Muster ${z.pattern} entsprechen`;return`Ungültig: ${_[z.format]??U.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${U.divisor} sein`;case"unrecognized_keys":return`${U.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${R(U.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${U.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${U.origin}`;default:return"Ungültige Eingabe"}}};function k8(){return{localeError:NA()}}var QA=()=>{let $={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function I(U){return $[U]??null}let _={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;return`Invalid input: expected ${z}, received ${J}`}case"invalid_value":if(U.values.length===1)return`Invalid input: expected ${j(U.values[0])}`;return`Invalid option: expected one of ${R(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Too big: expected ${U.origin??"value"} to have ${z}${U.maximum.toString()} ${g.unit??"elements"}`;return`Too big: expected ${U.origin??"value"} to be ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Too small: expected ${U.origin} to have ${z}${U.minimum.toString()} ${g.unit}`;return`Too small: expected ${U.origin} to be ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Invalid string: must start with "${z.prefix}"`;if(z.format==="ends_with")return`Invalid string: must end with "${z.suffix}"`;if(z.format==="includes")return`Invalid string: must include "${z.includes}"`;if(z.format==="regex")return`Invalid string: must match pattern ${z.pattern}`;return`Invalid ${_[z.format]??U.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${U.divisor}`;case"unrecognized_keys":return`Unrecognized key${U.keys.length>1?"s":""}: ${R(U.keys,", ")}`;case"invalid_key":return`Invalid key in ${U.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${U.origin}`;default:return"Invalid input"}}};function TI(){return{localeError:QA()}}var YA=()=>{let $={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function I(U){return $[U]??null}let _={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},u={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Nevalida enigo: atendiĝis instanceof ${U.expected}, riceviĝis ${J}`;return`Nevalida enigo: atendiĝis ${z}, riceviĝis ${J}`}case"invalid_value":if(U.values.length===1)return`Nevalida enigo: atendiĝis ${j(U.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${R(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Tro granda: atendiĝis ke ${U.origin??"valoro"} havu ${z}${U.maximum.toString()} ${g.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${U.origin??"valoro"} havu ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Tro malgranda: atendiĝis ke ${U.origin} havu ${z}${U.minimum.toString()} ${g.unit}`;return`Tro malgranda: atendiĝis ke ${U.origin} estu ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${z.prefix}"`;if(z.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${z.suffix}"`;if(z.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${z.includes}"`;if(z.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${z.pattern}`;return`Nevalida ${_[z.format]??U.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${U.divisor}`;case"unrecognized_keys":return`Nekonata${U.keys.length>1?"j":""} ŝlosilo${U.keys.length>1?"j":""}: ${R(U.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${U.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${U.origin}`;default:return"Nevalida enigo"}}};function y8(){return{localeError:YA()}}var HA=()=>{let $={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function I(U){return $[U]??null}let _={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},u={nan:"NaN",string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Entrada inválida: se esperaba instanceof ${U.expected}, recibido ${J}`;return`Entrada inválida: se esperaba ${z}, recibido ${J}`}case"invalid_value":if(U.values.length===1)return`Entrada inválida: se esperaba ${j(U.values[0])}`;return`Opción inválida: se esperaba una de ${R(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin),J=u[U.origin]??U.origin;if(g)return`Demasiado grande: se esperaba que ${J??"valor"} tuviera ${z}${U.maximum.toString()} ${g.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${J??"valor"} fuera ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin),J=u[U.origin]??U.origin;if(g)return`Demasiado pequeño: se esperaba que ${J} tuviera ${z}${U.minimum.toString()} ${g.unit}`;return`Demasiado pequeño: se esperaba que ${J} fuera ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Cadena inválida: debe comenzar con "${z.prefix}"`;if(z.format==="ends_with")return`Cadena inválida: debe terminar en "${z.suffix}"`;if(z.format==="includes")return`Cadena inválida: debe incluir "${z.includes}"`;if(z.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${z.pattern}`;return`Inválido ${_[z.format]??U.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${U.divisor}`;case"unrecognized_keys":return`Llave${U.keys.length>1?"s":""} desconocida${U.keys.length>1?"s":""}: ${R(U.keys,", ")}`;case"invalid_key":return`Llave inválida en ${u[U.origin]??U.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${u[U.origin]??U.origin}`;default:return"Entrada inválida"}}};function i8(){return{localeError:HA()}}var OA=()=>{let $={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function I(U){return $[U]??null}let _={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"},u={nan:"NaN",number:"عدد",array:"آرایه"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`ورودی نامعتبر: میبایست instanceof ${U.expected} میبود، ${J} دریافت شد`;return`ورودی نامعتبر: میبایست ${z} میبود، ${J} دریافت شد`}case"invalid_value":if(U.values.length===1)return`ورودی نامعتبر: میبایست ${j(U.values[0])} میبود`;return`گزینه نامعتبر: میبایست یکی از ${R(U.values,"|")} میبود`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`خیلی بزرگ: ${U.origin??"مقدار"} باید ${z}${U.maximum.toString()} ${g.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${U.origin??"مقدار"} باید ${z}${U.maximum.toString()} باشد`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`خیلی کوچک: ${U.origin} باید ${z}${U.minimum.toString()} ${g.unit} باشد`;return`خیلی کوچک: ${U.origin} باید ${z}${U.minimum.toString()} باشد`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`رشته نامعتبر: باید با "${z.prefix}" شروع شود`;if(z.format==="ends_with")return`رشته نامعتبر: باید با "${z.suffix}" تمام شود`;if(z.format==="includes")return`رشته نامعتبر: باید شامل "${z.includes}" باشد`;if(z.format==="regex")return`رشته نامعتبر: باید با الگوی ${z.pattern} مطابقت داشته باشد`;return`${_[z.format]??U.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${U.divisor} باشد`;case"unrecognized_keys":return`کلید${U.keys.length>1?"های":""} ناشناس: ${R(U.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${U.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${U.origin}`;default:return"ورودی نامعتبر"}}};function l8(){return{localeError:OA()}}var TA=()=>{let $={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function I(U){return $[U]??null}let _={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Virheellinen tyyppi: odotettiin instanceof ${U.expected}, oli ${J}`;return`Virheellinen tyyppi: odotettiin ${z}, oli ${J}`}case"invalid_value":if(U.values.length===1)return`Virheellinen syöte: täytyy olla ${j(U.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${R(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Liian suuri: ${g.subject} täytyy olla ${z}${U.maximum.toString()} ${g.unit}`.trim();return`Liian suuri: arvon täytyy olla ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Liian pieni: ${g.subject} täytyy olla ${z}${U.minimum.toString()} ${g.unit}`.trim();return`Liian pieni: arvon täytyy olla ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${z.prefix}"`;if(z.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${z.suffix}"`;if(z.format==="includes")return`Virheellinen syöte: täytyy sisältää "${z.includes}"`;if(z.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${z.pattern}`;return`Virheellinen ${_[z.format]??U.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${U.divisor} monikerta`;case"unrecognized_keys":return`${U.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${R(U.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function r8(){return{localeError:TA()}}var BA=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function I(U){return $[U]??null}let _={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},u={nan:"NaN",number:"nombre",array:"tableau"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Entrée invalide : instanceof ${U.expected} attendu, ${J} reçu`;return`Entrée invalide : ${z} attendu, ${J} reçu`}case"invalid_value":if(U.values.length===1)return`Entrée invalide : ${j(U.values[0])} attendu`;return`Option invalide : une valeur parmi ${R(U.values,"|")} attendue`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Trop grand : ${U.origin??"valeur"} doit ${g.verb} ${z}${U.maximum.toString()} ${g.unit??"élément(s)"}`;return`Trop grand : ${U.origin??"valeur"} doit être ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Trop petit : ${U.origin} doit ${g.verb} ${z}${U.minimum.toString()} ${g.unit}`;return`Trop petit : ${U.origin} doit être ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Chaîne invalide : doit commencer par "${z.prefix}"`;if(z.format==="ends_with")return`Chaîne invalide : doit se terminer par "${z.suffix}"`;if(z.format==="includes")return`Chaîne invalide : doit inclure "${z.includes}"`;if(z.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${z.pattern}`;return`${_[z.format]??U.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${U.divisor}`;case"unrecognized_keys":return`Clé${U.keys.length>1?"s":""} non reconnue${U.keys.length>1?"s":""} : ${R(U.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${U.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${U.origin}`;default:return"Entrée invalide"}}};function m8(){return{localeError:BA()}}var DA=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function I(U){return $[U]??null}let _={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Entrée invalide : attendu instanceof ${U.expected}, reçu ${J}`;return`Entrée invalide : attendu ${z}, reçu ${J}`}case"invalid_value":if(U.values.length===1)return`Entrée invalide : attendu ${j(U.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${R(U.values,"|")}`;case"too_big":{let z=U.inclusive?"≤":"<",g=I(U.origin);if(g)return`Trop grand : attendu que ${U.origin??"la valeur"} ait ${z}${U.maximum.toString()} ${g.unit}`;return`Trop grand : attendu que ${U.origin??"la valeur"} soit ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?"≥":">",g=I(U.origin);if(g)return`Trop petit : attendu que ${U.origin} ait ${z}${U.minimum.toString()} ${g.unit}`;return`Trop petit : attendu que ${U.origin} soit ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Chaîne invalide : doit commencer par "${z.prefix}"`;if(z.format==="ends_with")return`Chaîne invalide : doit se terminer par "${z.suffix}"`;if(z.format==="includes")return`Chaîne invalide : doit inclure "${z.includes}"`;if(z.format==="regex")return`Chaîne invalide : doit correspondre au motif ${z.pattern}`;return`${_[z.format]??U.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${U.divisor}`;case"unrecognized_keys":return`Clé${U.keys.length>1?"s":""} non reconnue${U.keys.length>1?"s":""} : ${R(U.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${U.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${U.origin}`;default:return"Entrée invalide"}}};function n8(){return{localeError:DA()}}var MA=()=>{let $={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},I={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},_=(v)=>v?$[v]:void 0,u=(v)=>{let X=_(v);if(X)return X.label;return v??$.unknown.label},U=(v)=>`ה${u(v)}`,z=(v)=>{return(_(v)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות"},g=(v)=>{if(!v)return null;return I[v]??null},J={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}},G={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let X=v.expected,q=G[X??""]??u(X),N=F(v.input),Y=G[N]??$[N]?.label??N;if(/^[A-Z]/.test(v.expected))return`קלט לא תקין: צריך להיות instanceof ${v.expected}, התקבל ${Y}`;return`קלט לא תקין: צריך להיות ${q}, התקבל ${Y}`}case"invalid_value":{if(v.values.length===1)return`ערך לא תקין: הערך חייב להיות ${j(v.values[0])}`;let X=v.values.map((Y)=>j(Y));if(v.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${X[0]} או ${X[1]}`;let q=X[X.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${X.slice(0,-1).join(", ")} או ${q}`}case"too_big":{let X=g(v.origin),q=U(v.origin??"value");if(v.origin==="string")return`${X?.longLabel??"ארוך"} מדי: ${q} צריכה להכיל ${v.maximum.toString()} ${X?.unit??""} ${v.inclusive?"או פחות":"לכל היותר"}`.trim();if(v.origin==="number"){let H=v.inclusive?`קטן או שווה ל-${v.maximum}`:`קטן מ-${v.maximum}`;return`גדול מדי: ${q} צריך להיות ${H}`}if(v.origin==="array"||v.origin==="set"){let H=v.origin==="set"?"צריכה":"צריך",Q=v.inclusive?`${v.maximum} ${X?.unit??""} או פחות`:`פחות מ-${v.maximum} ${X?.unit??""}`;return`גדול מדי: ${q} ${H} להכיל ${Q}`.trim()}let N=v.inclusive?"<=":"<",Y=z(v.origin??"value");if(X?.unit)return`${X.longLabel} מדי: ${q} ${Y} ${N}${v.maximum.toString()} ${X.unit}`;return`${X?.longLabel??"גדול"} מדי: ${q} ${Y} ${N}${v.maximum.toString()}`}case"too_small":{let X=g(v.origin),q=U(v.origin??"value");if(v.origin==="string")return`${X?.shortLabel??"קצר"} מדי: ${q} צריכה להכיל ${v.minimum.toString()} ${X?.unit??""} ${v.inclusive?"או יותר":"לפחות"}`.trim();if(v.origin==="number"){let H=v.inclusive?`גדול או שווה ל-${v.minimum}`:`גדול מ-${v.minimum}`;return`קטן מדי: ${q} צריך להיות ${H}`}if(v.origin==="array"||v.origin==="set"){let H=v.origin==="set"?"צריכה":"צריך";if(v.minimum===1&&v.inclusive){let O=v.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${q} ${H} להכיל ${O}`}let Q=v.inclusive?`${v.minimum} ${X?.unit??""} או יותר`:`יותר מ-${v.minimum} ${X?.unit??""}`;return`קטן מדי: ${q} ${H} להכיל ${Q}`.trim()}let N=v.inclusive?">=":">",Y=z(v.origin??"value");if(X?.unit)return`${X.shortLabel} מדי: ${q} ${Y} ${N}${v.minimum.toString()} ${X.unit}`;return`${X?.shortLabel??"קטן"} מדי: ${q} ${Y} ${N}${v.minimum.toString()}`}case"invalid_format":{let X=v;if(X.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${X.prefix}"`;if(X.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${X.suffix}"`;if(X.format==="includes")return`המחרוזת חייבת לכלול "${X.includes}"`;if(X.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${X.pattern}`;let q=J[X.format],N=q?.label??X.format,H=(q?.gender??"m")==="f"?"תקינה":"תקין";return`${N} לא ${H}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${v.divisor}`;case"unrecognized_keys":return`מפתח${v.keys.length>1?"ות":""} לא מזוה${v.keys.length>1?"ים":"ה"}: ${R(v.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${U(v.origin??"array")}`;default:return"קלט לא תקין"}}};function h8(){return{localeError:MA()}}var KA=()=>{let $={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function I(U){return $[U]??null}let _={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"},u={nan:"NaN",number:"szám",array:"tömb"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Érvénytelen bemenet: a várt érték instanceof ${U.expected}, a kapott érték ${J}`;return`Érvénytelen bemenet: a várt érték ${z}, a kapott érték ${J}`}case"invalid_value":if(U.values.length===1)return`Érvénytelen bemenet: a várt érték ${j(U.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${R(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Túl nagy: ${U.origin??"érték"} mérete túl nagy ${z}${U.maximum.toString()} ${g.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${U.origin??"érték"} túl nagy: ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Túl kicsi: a bemeneti érték ${U.origin} mérete túl kicsi ${z}${U.minimum.toString()} ${g.unit}`;return`Túl kicsi: a bemeneti érték ${U.origin} túl kicsi ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Érvénytelen string: "${z.prefix}" értékkel kell kezdődnie`;if(z.format==="ends_with")return`Érvénytelen string: "${z.suffix}" értékkel kell végződnie`;if(z.format==="includes")return`Érvénytelen string: "${z.includes}" értéket kell tartalmaznia`;if(z.format==="regex")return`Érvénytelen string: ${z.pattern} mintának kell megfelelnie`;return`Érvénytelen ${_[z.format]??U.format}`}case"not_multiple_of":return`Érvénytelen szám: ${U.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${U.keys.length>1?"s":""}: ${R(U.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${U.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${U.origin}`;default:return"Érvénytelen bemenet"}}};function d8(){return{localeError:KA()}}function zQ($,I,_){return Math.abs($)===1?I:_}function n1($){if(!$)return"";let I=["ա","ե","ը","ի","ո","ու","օ"],_=$[$.length-1];return $+(I.includes(_)?"ն":"ը")}var VA=()=>{let $={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function I(U){return $[U]??null}let _={regex:"մուտք",email:"էլ. հասցե",url:"URL",emoji:"էմոջի",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ամսաթիվ և ժամ",date:"ISO ամսաթիվ",time:"ISO ժամ",duration:"ISO տևողություն",ipv4:"IPv4 հասցե",ipv6:"IPv6 հասցե",cidrv4:"IPv4 միջակայք",cidrv6:"IPv6 միջակայք",base64:"base64 ձևաչափով տող",base64url:"base64url ձևաչափով տող",json_string:"JSON տող",e164:"E.164 համար",jwt:"JWT",template_literal:"մուտք"},u={nan:"NaN",number:"թիվ",array:"զանգված"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Սխալ մուտքագրում․ սպասվում էր instanceof ${U.expected}, ստացվել է ${J}`;return`Սխալ մուտքագրում․ սպասվում էր ${z}, ստացվել է ${J}`}case"invalid_value":if(U.values.length===1)return`Սխալ մուտքագրում․ սպասվում էր ${j(U.values[1])}`;return`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${R(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g){let J=Number(U.maximum),G=zQ(J,g.unit.one,g.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${n1(U.origin??"արժեք")} կունենա ${z}${U.maximum.toString()} ${G}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${n1(U.origin??"արժեք")} լինի ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g){let J=Number(U.minimum),G=zQ(J,g.unit.one,g.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${n1(U.origin)} կունենա ${z}${U.minimum.toString()} ${G}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${n1(U.origin)} լինի ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Սխալ տող․ պետք է սկսվի "${z.prefix}"-ով`;if(z.format==="ends_with")return`Սխալ տող․ պետք է ավարտվի "${z.suffix}"-ով`;if(z.format==="includes")return`Սխալ տող․ պետք է պարունակի "${z.includes}"`;if(z.format==="regex")return`Սխալ տող․ պետք է համապատասխանի ${z.pattern} ձևաչափին`;return`Սխալ ${_[z.format]??U.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${U.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${U.keys.length>1?"ներ":""}. ${R(U.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${n1(U.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${n1(U.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};function c8(){return{localeError:VA()}}var LA=()=>{let $={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function I(U){return $[U]??null}let _={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Input tidak valid: diharapkan instanceof ${U.expected}, diterima ${J}`;return`Input tidak valid: diharapkan ${z}, diterima ${J}`}case"invalid_value":if(U.values.length===1)return`Input tidak valid: diharapkan ${j(U.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${R(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Terlalu besar: diharapkan ${U.origin??"value"} memiliki ${z}${U.maximum.toString()} ${g.unit??"elemen"}`;return`Terlalu besar: diharapkan ${U.origin??"value"} menjadi ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Terlalu kecil: diharapkan ${U.origin} memiliki ${z}${U.minimum.toString()} ${g.unit}`;return`Terlalu kecil: diharapkan ${U.origin} menjadi ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`String tidak valid: harus dimulai dengan "${z.prefix}"`;if(z.format==="ends_with")return`String tidak valid: harus berakhir dengan "${z.suffix}"`;if(z.format==="includes")return`String tidak valid: harus menyertakan "${z.includes}"`;if(z.format==="regex")return`String tidak valid: harus sesuai pola ${z.pattern}`;return`${_[z.format]??U.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${U.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${U.keys.length>1?"s":""}: ${R(U.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${U.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${U.origin}`;default:return"Input tidak valid"}}};function p8(){return{localeError:LA()}}var RA=()=>{let $={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function I(U){return $[U]??null}let _={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"},u={nan:"NaN",number:"númer",array:"fylki"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Rangt gildi: Þú slóst inn ${J} þar sem á að vera instanceof ${U.expected}`;return`Rangt gildi: Þú slóst inn ${J} þar sem á að vera ${z}`}case"invalid_value":if(U.values.length===1)return`Rangt gildi: gert ráð fyrir ${j(U.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${R(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Of stórt: gert er ráð fyrir að ${U.origin??"gildi"} hafi ${z}${U.maximum.toString()} ${g.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${U.origin??"gildi"} sé ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Of lítið: gert er ráð fyrir að ${U.origin} hafi ${z}${U.minimum.toString()} ${g.unit}`;return`Of lítið: gert er ráð fyrir að ${U.origin} sé ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Ógildur strengur: verður að byrja á "${z.prefix}"`;if(z.format==="ends_with")return`Ógildur strengur: verður að enda á "${z.suffix}"`;if(z.format==="includes")return`Ógildur strengur: verður að innihalda "${z.includes}"`;if(z.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${z.pattern}`;return`Rangt ${_[z.format]??U.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${U.divisor}`;case"unrecognized_keys":return`Óþekkt ${U.keys.length>1?"ir lyklar":"ur lykill"}: ${R(U.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${U.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${U.origin}`;default:return"Rangt gildi"}}};function o8(){return{localeError:RA()}}var ZA=()=>{let $={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function I(U){return $[U]??null}let _={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},u={nan:"NaN",number:"numero",array:"vettore"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Input non valido: atteso instanceof ${U.expected}, ricevuto ${J}`;return`Input non valido: atteso ${z}, ricevuto ${J}`}case"invalid_value":if(U.values.length===1)return`Input non valido: atteso ${j(U.values[0])}`;return`Opzione non valida: atteso uno tra ${R(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Troppo grande: ${U.origin??"valore"} deve avere ${z}${U.maximum.toString()} ${g.unit??"elementi"}`;return`Troppo grande: ${U.origin??"valore"} deve essere ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Troppo piccolo: ${U.origin} deve avere ${z}${U.minimum.toString()} ${g.unit}`;return`Troppo piccolo: ${U.origin} deve essere ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Stringa non valida: deve iniziare con "${z.prefix}"`;if(z.format==="ends_with")return`Stringa non valida: deve terminare con "${z.suffix}"`;if(z.format==="includes")return`Stringa non valida: deve includere "${z.includes}"`;if(z.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${z.pattern}`;return`Invalid ${_[z.format]??U.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${U.divisor}`;case"unrecognized_keys":return`Chiav${U.keys.length>1?"i":"e"} non riconosciut${U.keys.length>1?"e":"a"}: ${R(U.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${U.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${U.origin}`;default:return"Input non valido"}}};function t8(){return{localeError:ZA()}}var WA=()=>{let $={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function I(U){return $[U]??null}let _={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"},u={nan:"NaN",number:"数値",array:"配列"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`無効な入力: instanceof ${U.expected}が期待されましたが、${J}が入力されました`;return`無効な入力: ${z}が期待されましたが、${J}が入力されました`}case"invalid_value":if(U.values.length===1)return`無効な入力: ${j(U.values[0])}が期待されました`;return`無効な選択: ${R(U.values,"、")}のいずれかである必要があります`;case"too_big":{let z=U.inclusive?"以下である":"より小さい",g=I(U.origin);if(g)return`大きすぎる値: ${U.origin??"値"}は${U.maximum.toString()}${g.unit??"要素"}${z}必要があります`;return`大きすぎる値: ${U.origin??"値"}は${U.maximum.toString()}${z}必要があります`}case"too_small":{let z=U.inclusive?"以上である":"より大きい",g=I(U.origin);if(g)return`小さすぎる値: ${U.origin}は${U.minimum.toString()}${g.unit}${z}必要があります`;return`小さすぎる値: ${U.origin}は${U.minimum.toString()}${z}必要があります`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`無効な文字列: "${z.prefix}"で始まる必要があります`;if(z.format==="ends_with")return`無効な文字列: "${z.suffix}"で終わる必要があります`;if(z.format==="includes")return`無効な文字列: "${z.includes}"を含む必要があります`;if(z.format==="regex")return`無効な文字列: パターン${z.pattern}に一致する必要があります`;return`無効な${_[z.format]??U.format}`}case"not_multiple_of":return`無効な数値: ${U.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${U.keys.length>1?"群":""}: ${R(U.keys,"、")}`;case"invalid_key":return`${U.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${U.origin}内の無効な値`;default:return"無効な入力"}}};function a8(){return{localeError:WA()}}var PA=()=>{let $={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function I(U){return $[U]??null}let _={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"},u={nan:"NaN",number:"რიცხვი",string:"სტრინგი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`არასწორი შეყვანა: მოსალოდნელი instanceof ${U.expected}, მიღებული ${J}`;return`არასწორი შეყვანა: მოსალოდნელი ${z}, მიღებული ${J}`}case"invalid_value":if(U.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${j(U.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${R(U.values,"|")}-დან`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`ზედმეტად დიდი: მოსალოდნელი ${U.origin??"მნიშვნელობა"} ${g.verb} ${z}${U.maximum.toString()} ${g.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${U.origin??"მნიშვნელობა"} იყოს ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`ზედმეტად პატარა: მოსალოდნელი ${U.origin} ${g.verb} ${z}${U.minimum.toString()} ${g.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${U.origin} იყოს ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`არასწორი სტრინგი: უნდა იწყებოდეს "${z.prefix}"-ით`;if(z.format==="ends_with")return`არასწორი სტრინგი: უნდა მთავრდებოდეს "${z.suffix}"-ით`;if(z.format==="includes")return`არასწორი სტრინგი: უნდა შეიცავდეს "${z.includes}"-ს`;if(z.format==="regex")return`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${z.pattern}`;return`არასწორი ${_[z.format]??U.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${U.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${U.keys.length>1?"ები":"ი"}: ${R(U.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${U.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${U.origin}-ში`;default:return"არასწორი შეყვანა"}}};function e8(){return{localeError:PA()}}var bA=()=>{let $={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function I(U){return $[U]??null}let _={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"},u={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${U.expected} ប៉ុន្តែទទួលបាន ${J}`;return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${z} ប៉ុន្តែទទួលបាន ${J}`}case"invalid_value":if(U.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${j(U.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${R(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`ធំពេក៖ ត្រូវការ ${U.origin??"តម្លៃ"} ${z} ${U.maximum.toString()} ${g.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${U.origin??"តម្លៃ"} ${z} ${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`តូចពេក៖ ត្រូវការ ${U.origin} ${z} ${U.minimum.toString()} ${g.unit}`;return`តូចពេក៖ ត្រូវការ ${U.origin} ${z} ${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${z.prefix}"`;if(z.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${z.suffix}"`;if(z.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${z.includes}"`;if(z.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${z.pattern}`;return`មិនត្រឹមត្រូវ៖ ${_[z.format]??U.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${U.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${R(U.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${U.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${U.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function BI(){return{localeError:bA()}}function s8(){return BI()}var AA=()=>{let $={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function I(U){return $[U]??null}let _={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`잘못된 입력: 예상 타입은 instanceof ${U.expected}, 받은 타입은 ${J}입니다`;return`잘못된 입력: 예상 타입은 ${z}, 받은 타입은 ${J}입니다`}case"invalid_value":if(U.values.length===1)return`잘못된 입력: 값은 ${j(U.values[0])} 이어야 합니다`;return`잘못된 옵션: ${R(U.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let z=U.inclusive?"이하":"미만",g=z==="미만"?"이어야 합니다":"여야 합니다",J=I(U.origin),G=J?.unit??"요소";if(J)return`${U.origin??"값"}이 너무 큽니다: ${U.maximum.toString()}${G} ${z}${g}`;return`${U.origin??"값"}이 너무 큽니다: ${U.maximum.toString()} ${z}${g}`}case"too_small":{let z=U.inclusive?"이상":"초과",g=z==="이상"?"이어야 합니다":"여야 합니다",J=I(U.origin),G=J?.unit??"요소";if(J)return`${U.origin??"값"}이 너무 작습니다: ${U.minimum.toString()}${G} ${z}${g}`;return`${U.origin??"값"}이 너무 작습니다: ${U.minimum.toString()} ${z}${g}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`잘못된 문자열: "${z.prefix}"(으)로 시작해야 합니다`;if(z.format==="ends_with")return`잘못된 문자열: "${z.suffix}"(으)로 끝나야 합니다`;if(z.format==="includes")return`잘못된 문자열: "${z.includes}"을(를) 포함해야 합니다`;if(z.format==="regex")return`잘못된 문자열: 정규식 ${z.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${_[z.format]??U.format}`}case"not_multiple_of":return`잘못된 숫자: ${U.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${R(U.keys,", ")}`;case"invalid_key":return`잘못된 키: ${U.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${U.origin}`;default:return"잘못된 입력"}}};function $3(){return{localeError:AA()}}var DI=($)=>{return $.charAt(0).toUpperCase()+$.slice(1)};function gQ($){let I=Math.abs($),_=I%10,u=I%100;if(u>=11&&u<=19||_===0)return"many";if(_===1)return"one";return"few"}var jA=()=>{let $={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function I(U,z,g,J){let G=$[U]??null;if(G===null)return G;return{unit:G.unit[z],verb:G.verb[J][g?"inclusive":"notInclusive"]}}let _={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"},u={nan:"NaN",number:"skaičius",bigint:"sveikasis skaičius",string:"eilutė",boolean:"loginė reikšmė",undefined:"neapibrėžta reikšmė",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulinė reikšmė"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Gautas tipas ${J}, o tikėtasi - instanceof ${U.expected}`;return`Gautas tipas ${J}, o tikėtasi - ${z}`}case"invalid_value":if(U.values.length===1)return`Privalo būti ${j(U.values[0])}`;return`Privalo būti vienas iš ${R(U.values,"|")} pasirinkimų`;case"too_big":{let z=u[U.origin]??U.origin,g=I(U.origin,gQ(Number(U.maximum)),U.inclusive??!1,"smaller");if(g?.verb)return`${DI(z??U.origin??"reikšmė")} ${g.verb} ${U.maximum.toString()} ${g.unit??"elementų"}`;let J=U.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${DI(z??U.origin??"reikšmė")} turi būti ${J} ${U.maximum.toString()} ${g?.unit}`}case"too_small":{let z=u[U.origin]??U.origin,g=I(U.origin,gQ(Number(U.minimum)),U.inclusive??!1,"bigger");if(g?.verb)return`${DI(z??U.origin??"reikšmė")} ${g.verb} ${U.minimum.toString()} ${g.unit??"elementų"}`;let J=U.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${DI(z??U.origin??"reikšmė")} turi būti ${J} ${U.minimum.toString()} ${g?.unit}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Eilutė privalo prasidėti "${z.prefix}"`;if(z.format==="ends_with")return`Eilutė privalo pasibaigti "${z.suffix}"`;if(z.format==="includes")return`Eilutė privalo įtraukti "${z.includes}"`;if(z.format==="regex")return`Eilutė privalo atitikti ${z.pattern}`;return`Neteisingas ${_[z.format]??U.format}`}case"not_multiple_of":return`Skaičius privalo būti ${U.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${U.keys.length>1?"i":"as"} rakt${U.keys.length>1?"ai":"as"}: ${R(U.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let z=u[U.origin]??U.origin;return`${DI(z??U.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function I3(){return{localeError:jA()}}var FA=()=>{let $={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function I(U){return $[U]??null}let _={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"},u={nan:"NaN",number:"број",array:"низа"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Грешен внес: се очекува instanceof ${U.expected}, примено ${J}`;return`Грешен внес: се очекува ${z}, примено ${J}`}case"invalid_value":if(U.values.length===1)return`Invalid input: expected ${j(U.values[0])}`;return`Грешана опција: се очекува една ${R(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Премногу голем: се очекува ${U.origin??"вредноста"} да има ${z}${U.maximum.toString()} ${g.unit??"елементи"}`;return`Премногу голем: се очекува ${U.origin??"вредноста"} да биде ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Премногу мал: се очекува ${U.origin} да има ${z}${U.minimum.toString()} ${g.unit}`;return`Премногу мал: се очекува ${U.origin} да биде ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Неважечка низа: мора да започнува со "${z.prefix}"`;if(z.format==="ends_with")return`Неважечка низа: мора да завршува со "${z.suffix}"`;if(z.format==="includes")return`Неважечка низа: мора да вклучува "${z.includes}"`;if(z.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${z.pattern}`;return`Invalid ${_[z.format]??U.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${U.divisor}`;case"unrecognized_keys":return`${U.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${R(U.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${U.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${U.origin}`;default:return"Грешен внес"}}};function U3(){return{localeError:FA()}}var SA=()=>{let $={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function I(U){return $[U]??null}let _={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},u={nan:"NaN",number:"nombor"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Input tidak sah: dijangka instanceof ${U.expected}, diterima ${J}`;return`Input tidak sah: dijangka ${z}, diterima ${J}`}case"invalid_value":if(U.values.length===1)return`Input tidak sah: dijangka ${j(U.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${R(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Terlalu besar: dijangka ${U.origin??"nilai"} ${g.verb} ${z}${U.maximum.toString()} ${g.unit??"elemen"}`;return`Terlalu besar: dijangka ${U.origin??"nilai"} adalah ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Terlalu kecil: dijangka ${U.origin} ${g.verb} ${z}${U.minimum.toString()} ${g.unit}`;return`Terlalu kecil: dijangka ${U.origin} adalah ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`String tidak sah: mesti bermula dengan "${z.prefix}"`;if(z.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${z.suffix}"`;if(z.format==="includes")return`String tidak sah: mesti mengandungi "${z.includes}"`;if(z.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${z.pattern}`;return`${_[z.format]??U.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${U.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${R(U.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${U.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${U.origin}`;default:return"Input tidak sah"}}};function _3(){return{localeError:SA()}}var wA=()=>{let $={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function I(U){return $[U]??null}let _={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},u={nan:"NaN",number:"getal"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Ongeldige invoer: verwacht instanceof ${U.expected}, ontving ${J}`;return`Ongeldige invoer: verwacht ${z}, ontving ${J}`}case"invalid_value":if(U.values.length===1)return`Ongeldige invoer: verwacht ${j(U.values[0])}`;return`Ongeldige optie: verwacht één van ${R(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin),J=U.origin==="date"?"laat":U.origin==="string"?"lang":"groot";if(g)return`Te ${J}: verwacht dat ${U.origin??"waarde"} ${z}${U.maximum.toString()} ${g.unit??"elementen"} ${g.verb}`;return`Te ${J}: verwacht dat ${U.origin??"waarde"} ${z}${U.maximum.toString()} is`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin),J=U.origin==="date"?"vroeg":U.origin==="string"?"kort":"klein";if(g)return`Te ${J}: verwacht dat ${U.origin} ${z}${U.minimum.toString()} ${g.unit} ${g.verb}`;return`Te ${J}: verwacht dat ${U.origin} ${z}${U.minimum.toString()} is`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Ongeldige tekst: moet met "${z.prefix}" beginnen`;if(z.format==="ends_with")return`Ongeldige tekst: moet op "${z.suffix}" eindigen`;if(z.format==="includes")return`Ongeldige tekst: moet "${z.includes}" bevatten`;if(z.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${z.pattern}`;return`Ongeldig: ${_[z.format]??U.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${U.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${U.keys.length>1?"s":""}: ${R(U.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${U.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${U.origin}`;default:return"Ongeldige invoer"}}};function u3(){return{localeError:wA()}}var EA=()=>{let $={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function I(U){return $[U]??null}let _={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},u={nan:"NaN",number:"tall",array:"liste"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Ugyldig input: forventet instanceof ${U.expected}, fikk ${J}`;return`Ugyldig input: forventet ${z}, fikk ${J}`}case"invalid_value":if(U.values.length===1)return`Ugyldig verdi: forventet ${j(U.values[0])}`;return`Ugyldig valg: forventet en av ${R(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`For stor(t): forventet ${U.origin??"value"} til å ha ${z}${U.maximum.toString()} ${g.unit??"elementer"}`;return`For stor(t): forventet ${U.origin??"value"} til å ha ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`For lite(n): forventet ${U.origin} til å ha ${z}${U.minimum.toString()} ${g.unit}`;return`For lite(n): forventet ${U.origin} til å ha ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Ugyldig streng: må starte med "${z.prefix}"`;if(z.format==="ends_with")return`Ugyldig streng: må ende med "${z.suffix}"`;if(z.format==="includes")return`Ugyldig streng: må inneholde "${z.includes}"`;if(z.format==="regex")return`Ugyldig streng: må matche mønsteret ${z.pattern}`;return`Ugyldig ${_[z.format]??U.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${U.divisor}`;case"unrecognized_keys":return`${U.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${R(U.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${U.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${U.origin}`;default:return"Ugyldig input"}}};function z3(){return{localeError:EA()}}var CA=()=>{let $={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function I(U){return $[U]??null}let _={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"},u={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Fâsit giren: umulan instanceof ${U.expected}, alınan ${J}`;return`Fâsit giren: umulan ${z}, alınan ${J}`}case"invalid_value":if(U.values.length===1)return`Fâsit giren: umulan ${j(U.values[0])}`;return`Fâsit tercih: mûteberler ${R(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Fazla büyük: ${U.origin??"value"}, ${z}${U.maximum.toString()} ${g.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${U.origin??"value"}, ${z}${U.maximum.toString()} olmalıydı.`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Fazla küçük: ${U.origin}, ${z}${U.minimum.toString()} ${g.unit} sahip olmalıydı.`;return`Fazla küçük: ${U.origin}, ${z}${U.minimum.toString()} olmalıydı.`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Fâsit metin: "${z.prefix}" ile başlamalı.`;if(z.format==="ends_with")return`Fâsit metin: "${z.suffix}" ile bitmeli.`;if(z.format==="includes")return`Fâsit metin: "${z.includes}" ihtivâ etmeli.`;if(z.format==="regex")return`Fâsit metin: ${z.pattern} nakşına uymalı.`;return`Fâsit ${_[z.format]??U.format}`}case"not_multiple_of":return`Fâsit sayı: ${U.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${U.keys.length>1?"s":""}: ${R(U.keys,", ")}`;case"invalid_key":return`${U.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${U.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function g3(){return{localeError:CA()}}var fA=()=>{let $={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function I(U){return $[U]??null}let _={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"},u={nan:"NaN",number:"عدد",array:"ارې"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`ناسم ورودي: باید instanceof ${U.expected} وای, مګر ${J} ترلاسه شو`;return`ناسم ورودي: باید ${z} وای, مګر ${J} ترلاسه شو`}case"invalid_value":if(U.values.length===1)return`ناسم ورودي: باید ${j(U.values[0])} وای`;return`ناسم انتخاب: باید یو له ${R(U.values,"|")} څخه وای`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`ډیر لوی: ${U.origin??"ارزښت"} باید ${z}${U.maximum.toString()} ${g.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${U.origin??"ارزښت"} باید ${z}${U.maximum.toString()} وي`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`ډیر کوچنی: ${U.origin} باید ${z}${U.minimum.toString()} ${g.unit} ولري`;return`ډیر کوچنی: ${U.origin} باید ${z}${U.minimum.toString()} وي`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`ناسم متن: باید د "${z.prefix}" سره پیل شي`;if(z.format==="ends_with")return`ناسم متن: باید د "${z.suffix}" سره پای ته ورسيږي`;if(z.format==="includes")return`ناسم متن: باید "${z.includes}" ولري`;if(z.format==="regex")return`ناسم متن: باید د ${z.pattern} سره مطابقت ولري`;return`${_[z.format]??U.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${U.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${U.keys.length>1?"کلیډونه":"کلیډ"}: ${R(U.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${U.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${U.origin} کې`;default:return"ناسمه ورودي"}}};function J3(){return{localeError:fA()}}var xA=()=>{let $={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function I(U){return $[U]??null}let _={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"},u={nan:"NaN",number:"liczba",array:"tablica"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${U.expected}, otrzymano ${J}`;return`Nieprawidłowe dane wejściowe: oczekiwano ${z}, otrzymano ${J}`}case"invalid_value":if(U.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${j(U.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${R(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Za duża wartość: oczekiwano, że ${U.origin??"wartość"} będzie mieć ${z}${U.maximum.toString()} ${g.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${U.origin??"wartość"} będzie wynosić ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Za mała wartość: oczekiwano, że ${U.origin??"wartość"} będzie mieć ${z}${U.minimum.toString()} ${g.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${U.origin??"wartość"} będzie wynosić ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${z.prefix}"`;if(z.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${z.suffix}"`;if(z.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${z.includes}"`;if(z.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${z.pattern}`;return`Nieprawidłow(y/a/e) ${_[z.format]??U.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${U.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${U.keys.length>1?"s":""}: ${R(U.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${U.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${U.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function G3(){return{localeError:xA()}}var kA=()=>{let $={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function I(U){return $[U]??null}let _={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},u={nan:"NaN",number:"número",null:"nulo"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Tipo inválido: esperado instanceof ${U.expected}, recebido ${J}`;return`Tipo inválido: esperado ${z}, recebido ${J}`}case"invalid_value":if(U.values.length===1)return`Entrada inválida: esperado ${j(U.values[0])}`;return`Opção inválida: esperada uma das ${R(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Muito grande: esperado que ${U.origin??"valor"} tivesse ${z}${U.maximum.toString()} ${g.unit??"elementos"}`;return`Muito grande: esperado que ${U.origin??"valor"} fosse ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Muito pequeno: esperado que ${U.origin} tivesse ${z}${U.minimum.toString()} ${g.unit}`;return`Muito pequeno: esperado que ${U.origin} fosse ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Texto inválido: deve começar com "${z.prefix}"`;if(z.format==="ends_with")return`Texto inválido: deve terminar com "${z.suffix}"`;if(z.format==="includes")return`Texto inválido: deve incluir "${z.includes}"`;if(z.format==="regex")return`Texto inválido: deve corresponder ao padrão ${z.pattern}`;return`${_[z.format]??U.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${U.divisor}`;case"unrecognized_keys":return`Chave${U.keys.length>1?"s":""} desconhecida${U.keys.length>1?"s":""}: ${R(U.keys,", ")}`;case"invalid_key":return`Chave inválida em ${U.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${U.origin}`;default:return"Campo inválido"}}};function v3(){return{localeError:kA()}}function JQ($,I,_,u){let U=Math.abs($),z=U%10,g=U%100;if(g>=11&&g<=19)return u;if(z===1)return I;if(z>=2&&z<=4)return _;return u}var yA=()=>{let $={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function I(U){return $[U]??null}let _={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"},u={nan:"NaN",number:"число",array:"массив"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Неверный ввод: ожидалось instanceof ${U.expected}, получено ${J}`;return`Неверный ввод: ожидалось ${z}, получено ${J}`}case"invalid_value":if(U.values.length===1)return`Неверный ввод: ожидалось ${j(U.values[0])}`;return`Неверный вариант: ожидалось одно из ${R(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g){let J=Number(U.maximum),G=JQ(J,g.unit.one,g.unit.few,g.unit.many);return`Слишком большое значение: ожидалось, что ${U.origin??"значение"} будет иметь ${z}${U.maximum.toString()} ${G}`}return`Слишком большое значение: ожидалось, что ${U.origin??"значение"} будет ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g){let J=Number(U.minimum),G=JQ(J,g.unit.one,g.unit.few,g.unit.many);return`Слишком маленькое значение: ожидалось, что ${U.origin} будет иметь ${z}${U.minimum.toString()} ${G}`}return`Слишком маленькое значение: ожидалось, что ${U.origin} будет ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Неверная строка: должна начинаться с "${z.prefix}"`;if(z.format==="ends_with")return`Неверная строка: должна заканчиваться на "${z.suffix}"`;if(z.format==="includes")return`Неверная строка: должна содержать "${z.includes}"`;if(z.format==="regex")return`Неверная строка: должна соответствовать шаблону ${z.pattern}`;return`Неверный ${_[z.format]??U.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${U.divisor}`;case"unrecognized_keys":return`Нераспознанн${U.keys.length>1?"ые":"ый"} ключ${U.keys.length>1?"и":""}: ${R(U.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${U.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${U.origin}`;default:return"Неверные входные данные"}}};function q3(){return{localeError:yA()}}var iA=()=>{let $={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function I(U){return $[U]??null}let _={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"},u={nan:"NaN",number:"število",array:"tabela"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Neveljaven vnos: pričakovano instanceof ${U.expected}, prejeto ${J}`;return`Neveljaven vnos: pričakovano ${z}, prejeto ${J}`}case"invalid_value":if(U.values.length===1)return`Neveljaven vnos: pričakovano ${j(U.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${R(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Preveliko: pričakovano, da bo ${U.origin??"vrednost"} imelo ${z}${U.maximum.toString()} ${g.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${U.origin??"vrednost"} ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Premajhno: pričakovano, da bo ${U.origin} imelo ${z}${U.minimum.toString()} ${g.unit}`;return`Premajhno: pričakovano, da bo ${U.origin} ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Neveljaven niz: mora se začeti z "${z.prefix}"`;if(z.format==="ends_with")return`Neveljaven niz: mora se končati z "${z.suffix}"`;if(z.format==="includes")return`Neveljaven niz: mora vsebovati "${z.includes}"`;if(z.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${z.pattern}`;return`Neveljaven ${_[z.format]??U.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${U.divisor}`;case"unrecognized_keys":return`Neprepoznan${U.keys.length>1?"i ključi":" ključ"}: ${R(U.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${U.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${U.origin}`;default:return"Neveljaven vnos"}}};function X3(){return{localeError:iA()}}var lA=()=>{let $={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function I(U){return $[U]??null}let _={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},u={nan:"NaN",number:"antal",array:"lista"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Ogiltig inmatning: förväntat instanceof ${U.expected}, fick ${J}`;return`Ogiltig inmatning: förväntat ${z}, fick ${J}`}case"invalid_value":if(U.values.length===1)return`Ogiltig inmatning: förväntat ${j(U.values[0])}`;return`Ogiltigt val: förväntade en av ${R(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`För stor(t): förväntade ${U.origin??"värdet"} att ha ${z}${U.maximum.toString()} ${g.unit??"element"}`;return`För stor(t): förväntat ${U.origin??"värdet"} att ha ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`För lite(t): förväntade ${U.origin??"värdet"} att ha ${z}${U.minimum.toString()} ${g.unit}`;return`För lite(t): förväntade ${U.origin??"värdet"} att ha ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Ogiltig sträng: måste börja med "${z.prefix}"`;if(z.format==="ends_with")return`Ogiltig sträng: måste sluta med "${z.suffix}"`;if(z.format==="includes")return`Ogiltig sträng: måste innehålla "${z.includes}"`;if(z.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${z.pattern}"`;return`Ogiltig(t) ${_[z.format]??U.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${U.divisor}`;case"unrecognized_keys":return`${U.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${R(U.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${U.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${U.origin??"värdet"}`;default:return"Ogiltig input"}}};function N3(){return{localeError:lA()}}var rA=()=>{let $={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function I(U){return $[U]??null}let _={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"},u={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${U.expected}, பெறப்பட்டது ${J}`;return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${z}, பெறப்பட்டது ${J}`}case"invalid_value":if(U.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${j(U.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${R(U.values,"|")} இல் ஒன்று`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${U.origin??"மதிப்பு"} ${z}${U.maximum.toString()} ${g.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${U.origin??"மதிப்பு"} ${z}${U.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${U.origin} ${z}${U.minimum.toString()} ${g.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${U.origin} ${z}${U.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`தவறான சரம்: "${z.prefix}" இல் தொடங்க வேண்டும்`;if(z.format==="ends_with")return`தவறான சரம்: "${z.suffix}" இல் முடிவடைய வேண்டும்`;if(z.format==="includes")return`தவறான சரம்: "${z.includes}" ஐ உள்ளடக்க வேண்டும்`;if(z.format==="regex")return`தவறான சரம்: ${z.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${_[z.format]??U.format}`}case"not_multiple_of":return`தவறான எண்: ${U.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${U.keys.length>1?"கள்":""}: ${R(U.keys,", ")}`;case"invalid_key":return`${U.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${U.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function Q3(){return{localeError:rA()}}var mA=()=>{let $={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function I(U){return $[U]??null}let _={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"},u={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${U.expected} แต่ได้รับ ${J}`;return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${z} แต่ได้รับ ${J}`}case"invalid_value":if(U.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${j(U.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${R(U.values,"|")}`;case"too_big":{let z=U.inclusive?"ไม่เกิน":"น้อยกว่า",g=I(U.origin);if(g)return`เกินกำหนด: ${U.origin??"ค่า"} ควรมี${z} ${U.maximum.toString()} ${g.unit??"รายการ"}`;return`เกินกำหนด: ${U.origin??"ค่า"} ควรมี${z} ${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?"อย่างน้อย":"มากกว่า",g=I(U.origin);if(g)return`น้อยกว่ากำหนด: ${U.origin} ควรมี${z} ${U.minimum.toString()} ${g.unit}`;return`น้อยกว่ากำหนด: ${U.origin} ควรมี${z} ${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${z.prefix}"`;if(z.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${z.suffix}"`;if(z.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${z.includes}" อยู่ในข้อความ`;if(z.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${z.pattern}`;return`รูปแบบไม่ถูกต้อง: ${_[z.format]??U.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${U.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${R(U.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${U.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${U.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function Y3(){return{localeError:mA()}}var nA=()=>{let $={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function I(U){return $[U]??null}let _={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Geçersiz değer: beklenen instanceof ${U.expected}, alınan ${J}`;return`Geçersiz değer: beklenen ${z}, alınan ${J}`}case"invalid_value":if(U.values.length===1)return`Geçersiz değer: beklenen ${j(U.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${R(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Çok büyük: beklenen ${U.origin??"değer"} ${z}${U.maximum.toString()} ${g.unit??"öğe"}`;return`Çok büyük: beklenen ${U.origin??"değer"} ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Çok küçük: beklenen ${U.origin} ${z}${U.minimum.toString()} ${g.unit}`;return`Çok küçük: beklenen ${U.origin} ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Geçersiz metin: "${z.prefix}" ile başlamalı`;if(z.format==="ends_with")return`Geçersiz metin: "${z.suffix}" ile bitmeli`;if(z.format==="includes")return`Geçersiz metin: "${z.includes}" içermeli`;if(z.format==="regex")return`Geçersiz metin: ${z.pattern} desenine uymalı`;return`Geçersiz ${_[z.format]??U.format}`}case"not_multiple_of":return`Geçersiz sayı: ${U.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${U.keys.length>1?"lar":""}: ${R(U.keys,", ")}`;case"invalid_key":return`${U.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${U.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function H3(){return{localeError:nA()}}var hA=()=>{let $={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function I(U){return $[U]??null}let _={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"},u={nan:"NaN",number:"число",array:"масив"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Неправильні вхідні дані: очікується instanceof ${U.expected}, отримано ${J}`;return`Неправильні вхідні дані: очікується ${z}, отримано ${J}`}case"invalid_value":if(U.values.length===1)return`Неправильні вхідні дані: очікується ${j(U.values[0])}`;return`Неправильна опція: очікується одне з ${R(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Занадто велике: очікується, що ${U.origin??"значення"} ${g.verb} ${z}${U.maximum.toString()} ${g.unit??"елементів"}`;return`Занадто велике: очікується, що ${U.origin??"значення"} буде ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Занадто мале: очікується, що ${U.origin} ${g.verb} ${z}${U.minimum.toString()} ${g.unit}`;return`Занадто мале: очікується, що ${U.origin} буде ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Неправильний рядок: повинен починатися з "${z.prefix}"`;if(z.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${z.suffix}"`;if(z.format==="includes")return`Неправильний рядок: повинен містити "${z.includes}"`;if(z.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${z.pattern}`;return`Неправильний ${_[z.format]??U.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${U.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${U.keys.length>1?"і":""}: ${R(U.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${U.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${U.origin}`;default:return"Неправильні вхідні дані"}}};function MI(){return{localeError:hA()}}function O3(){return MI()}var dA=()=>{let $={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function I(U){return $[U]??null}let _={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"},u={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`غلط ان پٹ: instanceof ${U.expected} متوقع تھا، ${J} موصول ہوا`;return`غلط ان پٹ: ${z} متوقع تھا، ${J} موصول ہوا`}case"invalid_value":if(U.values.length===1)return`غلط ان پٹ: ${j(U.values[0])} متوقع تھا`;return`غلط آپشن: ${R(U.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`بہت بڑا: ${U.origin??"ویلیو"} کے ${z}${U.maximum.toString()} ${g.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${U.origin??"ویلیو"} کا ${z}${U.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`بہت چھوٹا: ${U.origin} کے ${z}${U.minimum.toString()} ${g.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${U.origin} کا ${z}${U.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`غلط سٹرنگ: "${z.prefix}" سے شروع ہونا چاہیے`;if(z.format==="ends_with")return`غلط سٹرنگ: "${z.suffix}" پر ختم ہونا چاہیے`;if(z.format==="includes")return`غلط سٹرنگ: "${z.includes}" شامل ہونا چاہیے`;if(z.format==="regex")return`غلط سٹرنگ: پیٹرن ${z.pattern} سے میچ ہونا چاہیے`;return`غلط ${_[z.format]??U.format}`}case"not_multiple_of":return`غلط نمبر: ${U.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${U.keys.length>1?"ز":""}: ${R(U.keys,"، ")}`;case"invalid_key":return`${U.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${U.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function T3(){return{localeError:dA()}}var cA=()=>{let $={string:{unit:"belgi",verb:"bo‘lishi kerak"},file:{unit:"bayt",verb:"bo‘lishi kerak"},array:{unit:"element",verb:"bo‘lishi kerak"},set:{unit:"element",verb:"bo‘lishi kerak"}};function I(U){return $[U]??null}let _={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},u={nan:"NaN",number:"raqam",array:"massiv"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Noto‘g‘ri kirish: kutilgan instanceof ${U.expected}, qabul qilingan ${J}`;return`Noto‘g‘ri kirish: kutilgan ${z}, qabul qilingan ${J}`}case"invalid_value":if(U.values.length===1)return`Noto‘g‘ri kirish: kutilgan ${j(U.values[0])}`;return`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${R(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Juda katta: kutilgan ${U.origin??"qiymat"} ${z}${U.maximum.toString()} ${g.unit} ${g.verb}`;return`Juda katta: kutilgan ${U.origin??"qiymat"} ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Juda kichik: kutilgan ${U.origin} ${z}${U.minimum.toString()} ${g.unit} ${g.verb}`;return`Juda kichik: kutilgan ${U.origin} ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Noto‘g‘ri satr: "${z.prefix}" bilan boshlanishi kerak`;if(z.format==="ends_with")return`Noto‘g‘ri satr: "${z.suffix}" bilan tugashi kerak`;if(z.format==="includes")return`Noto‘g‘ri satr: "${z.includes}" ni o‘z ichiga olishi kerak`;if(z.format==="regex")return`Noto‘g‘ri satr: ${z.pattern} shabloniga mos kelishi kerak`;return`Noto‘g‘ri ${_[z.format]??U.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${U.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${U.keys.length>1?"lar":""}: ${R(U.keys,", ")}`;case"invalid_key":return`${U.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${U.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};function B3(){return{localeError:cA()}}var pA=()=>{let $={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function I(U){return $[U]??null}let _={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"},u={nan:"NaN",number:"số",array:"mảng"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Đầu vào không hợp lệ: mong đợi instanceof ${U.expected}, nhận được ${J}`;return`Đầu vào không hợp lệ: mong đợi ${z}, nhận được ${J}`}case"invalid_value":if(U.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${j(U.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${R(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Quá lớn: mong đợi ${U.origin??"giá trị"} ${g.verb} ${z}${U.maximum.toString()} ${g.unit??"phần tử"}`;return`Quá lớn: mong đợi ${U.origin??"giá trị"} ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Quá nhỏ: mong đợi ${U.origin} ${g.verb} ${z}${U.minimum.toString()} ${g.unit}`;return`Quá nhỏ: mong đợi ${U.origin} ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${z.prefix}"`;if(z.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${z.suffix}"`;if(z.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${z.includes}"`;if(z.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${z.pattern}`;return`${_[z.format]??U.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${U.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${R(U.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${U.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${U.origin}`;default:return"Đầu vào không hợp lệ"}}};function D3(){return{localeError:pA()}}var oA=()=>{let $={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function I(U){return $[U]??null}let _={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"},u={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`无效输入:期望 instanceof ${U.expected},实际接收 ${J}`;return`无效输入:期望 ${z},实际接收 ${J}`}case"invalid_value":if(U.values.length===1)return`无效输入:期望 ${j(U.values[0])}`;return`无效选项:期望以下之一 ${R(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`数值过大:期望 ${U.origin??"值"} ${z}${U.maximum.toString()} ${g.unit??"个元素"}`;return`数值过大:期望 ${U.origin??"值"} ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`数值过小:期望 ${U.origin} ${z}${U.minimum.toString()} ${g.unit}`;return`数值过小:期望 ${U.origin} ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`无效字符串:必须以 "${z.prefix}" 开头`;if(z.format==="ends_with")return`无效字符串:必须以 "${z.suffix}" 结尾`;if(z.format==="includes")return`无效字符串:必须包含 "${z.includes}"`;if(z.format==="regex")return`无效字符串:必须满足正则表达式 ${z.pattern}`;return`无效${_[z.format]??U.format}`}case"not_multiple_of":return`无效数字:必须是 ${U.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${R(U.keys,", ")}`;case"invalid_key":return`${U.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${U.origin} 中包含无效值(value)`;default:return"无效输入"}}};function M3(){return{localeError:oA()}}var tA=()=>{let $={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function I(U){return $[U]??null}let _={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`無效的輸入值:預期為 instanceof ${U.expected},但收到 ${J}`;return`無效的輸入值:預期為 ${z},但收到 ${J}`}case"invalid_value":if(U.values.length===1)return`無效的輸入值:預期為 ${j(U.values[0])}`;return`無效的選項:預期為以下其中之一 ${R(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`數值過大:預期 ${U.origin??"值"} 應為 ${z}${U.maximum.toString()} ${g.unit??"個元素"}`;return`數值過大:預期 ${U.origin??"值"} 應為 ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`數值過小:預期 ${U.origin} 應為 ${z}${U.minimum.toString()} ${g.unit}`;return`數值過小:預期 ${U.origin} 應為 ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`無效的字串:必須以 "${z.prefix}" 開頭`;if(z.format==="ends_with")return`無效的字串:必須以 "${z.suffix}" 結尾`;if(z.format==="includes")return`無效的字串:必須包含 "${z.includes}"`;if(z.format==="regex")return`無效的字串:必須符合格式 ${z.pattern}`;return`無效的 ${_[z.format]??U.format}`}case"not_multiple_of":return`無效的數字:必須為 ${U.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${U.keys.length>1?"們":""}:${R(U.keys,"、")}`;case"invalid_key":return`${U.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${U.origin} 中有無效的值`;default:return"無效的輸入值"}}};function K3(){return{localeError:tA()}}var aA=()=>{let $={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function I(U){return $[U]??null}let _={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"},u={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=F(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${U.expected}, àmọ̀ a rí ${J}`;return`Ìbáwọlé aṣìṣe: a ní láti fi ${z}, àmọ̀ a rí ${J}`}case"invalid_value":if(U.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${j(U.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${R(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${U.origin??"iye"} ${g.verb} ${z}${U.maximum} ${g.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${z}${U.maximum}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Kéré ju: a ní láti jẹ́ pé ${U.origin} ${g.verb} ${z}${U.minimum} ${g.unit}`;return`Kéré ju: a ní láti jẹ́ ${z}${U.minimum}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${z.prefix}"`;if(z.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${z.suffix}"`;if(z.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${z.includes}"`;if(z.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${z.pattern}`;return`Aṣìṣe: ${_[z.format]??U.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${U.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${R(U.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${U.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${U.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function V3(){return{localeError:aA()}}var GQ,L3=Symbol("ZodOutput"),R3=Symbol("ZodInput");class Z3{constructor(){this._map=new WeakMap,this._idmap=new Map}add($,...I){let _=I[0];if(this._map.set($,_),_&&typeof _==="object"&&"id"in _)this._idmap.set(_.id,$);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove($){let I=this._map.get($);if(I&&typeof I==="object"&&"id"in I)this._idmap.delete(I.id);return this._map.delete($),this}get($){let I=$._zod.parent;if(I){let _={...this.get(I)??{}};delete _.id;let u={..._,...this._map.get($)};return Object.keys(u).length?u:void 0}return this._map.get($)}has($){return this._map.has($)}}function Z_(){return new Z3}(GQ=globalThis).__zod_globalRegistry??(GQ.__zod_globalRegistry=Z_());var S$=globalThis.__zod_globalRegistry;function W3($,I){return new $({type:"string",...C(I)})}function P3($,I){return new $({type:"string",coerce:!0,...C(I)})}function W_($,I){return new $({type:"string",format:"email",check:"string_format",abort:!1,...C(I)})}function VI($,I){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...C(I)})}function P_($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...C(I)})}function b_($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...C(I)})}function A_($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...C(I)})}function j_($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...C(I)})}function LI($,I){return new $({type:"string",format:"url",check:"string_format",abort:!1,...C(I)})}function F_($,I){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...C(I)})}function S_($,I){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...C(I)})}function w_($,I){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...C(I)})}function E_($,I){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...C(I)})}function C_($,I){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...C(I)})}function f_($,I){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...C(I)})}function x_($,I){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...C(I)})}function k_($,I){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...C(I)})}function y_($,I){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...C(I)})}function b3($,I){return new $({type:"string",format:"mac",check:"string_format",abort:!1,...C(I)})}function i_($,I){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...C(I)})}function l_($,I){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...C(I)})}function r_($,I){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...C(I)})}function m_($,I){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...C(I)})}function n_($,I){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...C(I)})}function h_($,I){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...C(I)})}var A3={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function j3($,I){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...C(I)})}function F3($,I){return new $({type:"string",format:"date",check:"string_format",...C(I)})}function S3($,I){return new $({type:"string",format:"time",check:"string_format",precision:null,...C(I)})}function w3($,I){return new $({type:"string",format:"duration",check:"string_format",...C(I)})}function E3($,I){return new $({type:"number",checks:[],...C(I)})}function C3($,I){return new $({type:"number",coerce:!0,checks:[],...C(I)})}function f3($,I){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...C(I)})}function x3($,I){return new $({type:"number",check:"number_format",abort:!1,format:"float32",...C(I)})}function k3($,I){return new $({type:"number",check:"number_format",abort:!1,format:"float64",...C(I)})}function y3($,I){return new $({type:"number",check:"number_format",abort:!1,format:"int32",...C(I)})}function i3($,I){return new $({type:"number",check:"number_format",abort:!1,format:"uint32",...C(I)})}function l3($,I){return new $({type:"boolean",...C(I)})}function r3($,I){return new $({type:"boolean",coerce:!0,...C(I)})}function m3($,I){return new $({type:"bigint",...C(I)})}function n3($,I){return new $({type:"bigint",coerce:!0,...C(I)})}function h3($,I){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...C(I)})}function d3($,I){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...C(I)})}function c3($,I){return new $({type:"symbol",...C(I)})}function p3($,I){return new $({type:"undefined",...C(I)})}function o3($,I){return new $({type:"null",...C(I)})}function t3($){return new $({type:"any"})}function a3($){return new $({type:"unknown"})}function e3($,I){return new $({type:"never",...C(I)})}function s3($,I){return new $({type:"void",...C(I)})}function $9($,I){return new $({type:"date",...C(I)})}function I9($,I){return new $({type:"date",coerce:!0,...C(I)})}function U9($,I){return new $({type:"nan",...C(I)})}function C4($,I){return new Q_({check:"less_than",...C(I),value:$,inclusive:!1})}function u4($,I){return new Q_({check:"less_than",...C(I),value:$,inclusive:!0})}function f4($,I){return new Y_({check:"greater_than",...C(I),value:$,inclusive:!1})}function l$($,I){return new Y_({check:"greater_than",...C(I),value:$,inclusive:!0})}function d_($){return f4(0,$)}function c_($){return C4(0,$)}function p_($){return u4(0,$)}function o_($){return l$(0,$)}function V6($,I){return new UJ({check:"multiple_of",...C(I),value:$})}function L6($,I){return new zJ({check:"max_size",...C(I),maximum:$})}function x4($,I){return new gJ({check:"min_size",...C(I),minimum:$})}function s6($,I){return new JJ({check:"size_equals",...C(I),size:$})}function $1($,I){return new GJ({check:"max_length",...C(I),maximum:$})}function t4($,I){return new vJ({check:"min_length",...C(I),minimum:$})}function I1($,I){return new qJ({check:"length_equals",...C(I),length:$})}function h1($,I){return new XJ({check:"string_format",format:"regex",...C(I),pattern:$})}function d1($){return new NJ({check:"string_format",format:"lowercase",...C($)})}function c1($){return new QJ({check:"string_format",format:"uppercase",...C($)})}function p1($,I){return new YJ({check:"string_format",format:"includes",...C(I),includes:$})}function o1($,I){return new HJ({check:"string_format",format:"starts_with",...C(I),prefix:$})}function t1($,I){return new OJ({check:"string_format",format:"ends_with",...C(I),suffix:$})}function t_($,I,_){return new TJ({check:"property",property:$,schema:I,...C(_)})}function a1($,I){return new BJ({check:"mime_type",mime:$,...C(I)})}function K4($){return new DJ({check:"overwrite",tx:$})}function e1($){return K4((I)=>I.normalize($))}function s1(){return K4(($)=>$.trim())}function $0(){return K4(($)=>$.toLowerCase())}function I0(){return K4(($)=>$.toUpperCase())}function U0(){return K4(($)=>Tg($))}function _9($,I,_){return new $({type:"array",element:I,...C(_)})}function sA($,I,_){return new $({type:"union",options:I,...C(_)})}function $j($,I,_){return new $({type:"union",options:I,inclusive:!1,...C(_)})}function Ij($,I,_,u){return new $({type:"union",options:_,discriminator:I,...C(u)})}function Uj($,I,_){return new $({type:"intersection",left:I,right:_})}function _j($,I,_,u){let U=_ instanceof n;return new $({type:"tuple",items:I,rest:U?_:null,...C(U?u:_)})}function uj($,I,_,u){return new $({type:"record",keyType:I,valueType:_,...C(u)})}function zj($,I,_,u){return new $({type:"map",keyType:I,valueType:_,...C(u)})}function gj($,I,_){return new $({type:"set",valueType:I,...C(_)})}function Jj($,I,_){let u=Array.isArray(I)?Object.fromEntries(I.map((U)=>[U,U])):I;return new $({type:"enum",entries:u,...C(_)})}function Gj($,I,_){return new $({type:"enum",entries:I,...C(_)})}function vj($,I,_){return new $({type:"literal",values:Array.isArray(I)?I:[I],...C(_)})}function u9($,I){return new $({type:"file",...C(I)})}function qj($,I){return new $({type:"transform",transform:I})}function Xj($,I){return new $({type:"optional",innerType:I})}function Nj($,I){return new $({type:"nullable",innerType:I})}function Qj($,I,_){return new $({type:"default",innerType:I,get defaultValue(){return typeof _==="function"?_():Dg(_)}})}function Yj($,I,_){return new $({type:"nonoptional",innerType:I,...C(_)})}function Hj($,I){return new $({type:"success",innerType:I})}function Oj($,I,_){return new $({type:"catch",innerType:I,catchValue:typeof _==="function"?_:()=>_})}function Tj($,I,_){return new $({type:"pipe",in:I,out:_})}function Bj($,I){return new $({type:"readonly",innerType:I})}function Dj($,I,_){return new $({type:"template_literal",parts:I,...C(_)})}function Mj($,I){return new $({type:"lazy",getter:I})}function Kj($,I){return new $({type:"promise",innerType:I})}function z9($,I,_){let u=C(_);return u.abort??(u.abort=!0),new $({type:"custom",check:"custom",fn:I,...u})}function g9($,I,_){return new $({type:"custom",check:"custom",fn:I,...C(_)})}function J9($){let I=vQ((_)=>{return _.addIssue=(u)=>{if(typeof u==="string")_.issues.push(k1(u,_.value,I._zod.def));else{let U=u;if(U.fatal)U.continue=!1;U.code??(U.code="custom"),U.input??(U.input=_.value),U.inst??(U.inst=I),U.continue??(U.continue=!I._zod.def.abort),_.issues.push(k1(U))}},$(_.value,_)});return I}function vQ($,I){let _=new q$({check:"custom",...C(I)});return _._zod.check=$,_}function G9($){let I=new q$({check:"describe"});return I._zod.onattach=[(_)=>{let u=S$.get(_)??{};S$.add(_,{...u,description:$})}],I._zod.check=()=>{},I}function v9($){let I=new q$({check:"meta"});return I._zod.onattach=[(_)=>{let u=S$.get(_)??{};S$.add(_,{...u,...$})}],I._zod.check=()=>{},I}function q9($,I){let _=C(I),u=_.truthy??["true","1","yes","on","y","enabled"],U=_.falsy??["false","0","no","off","n","disabled"];if(_.case!=="sensitive")u=u.map((Y)=>typeof Y==="string"?Y.toLowerCase():Y),U=U.map((Y)=>typeof Y==="string"?Y.toLowerCase():Y);let z=new Set(u),g=new Set(U),J=$.Codec??OI,G=$.Boolean??YI,X=new($.String??e6)({type:"string",error:_.error}),q=new G({type:"boolean",error:_.error}),N=new J({type:"pipe",in:X,out:q,transform:(Y,H)=>{let Q=Y;if(_.case!=="sensitive")Q=Q.toLowerCase();if(z.has(Q))return!0;else if(g.has(Q))return!1;else return H.issues.push({code:"invalid_value",expected:"stringbool",values:[...z,...g],input:H.value,inst:N,continue:!1}),{}},reverseTransform:(Y,H)=>{if(Y===!0)return u[0]||"true";else return U[0]||"false"},error:_.error});return N}function _0($,I,_,u={}){let U=C(u),z={...C(u),check:"string_format",type:"string",format:I,fn:typeof _==="function"?_:(J)=>_.test(J),...U};if(_ instanceof RegExp)z.pattern=_;return new $(z)}function R6($){let I=$?.target??"draft-2020-12";if(I==="draft-4")I="draft-04";if(I==="draft-7")I="draft-07";return{processors:$.processors??{},metadataRegistry:$?.metadata??S$,target:I,unrepresentable:$?.unrepresentable??"throw",override:$?.override??(()=>{}),io:$?.io??"output",counter:0,seen:new Map,cycles:$?.cycles??"ref",reused:$?.reused??"inline",external:$?.external??void 0}}function u$($,I,_={path:[],schemaPath:[]}){var u;let U=$._zod.def,z=I.seen.get($);if(z){if(z.count++,_.schemaPath.includes($))z.cycle=_.path;return z.schema}let g={schema:{},count:1,cycle:void 0,path:_.path};I.seen.set($,g);let J=$._zod.toJSONSchema?.();if(J)g.schema=J;else{let X={..._,schemaPath:[..._.schemaPath,$],path:_.path};if($._zod.processJSONSchema)$._zod.processJSONSchema(I,g.schema,X);else{let N=g.schema,Y=I.processors[U.type];if(!Y)throw Error(`[toJSONSchema]: Non-representable type encountered: ${U.type}`);Y($,I,N,X)}let q=$._zod.parent;if(q){if(!g.ref)g.ref=q;u$(q,I,X),I.seen.get(q).isParent=!0}}let G=I.metadataRegistry.get($);if(G)Object.assign(g.schema,G);if(I.io==="input"&&r$($))delete g.schema.examples,delete g.schema.default;if(I.io==="input"&&g.schema._prefault)(u=g.schema).default??(u.default=g.schema._prefault);return delete g.schema._prefault,I.seen.get($).schema}function Z6($,I){let _=$.seen.get(I);if(!_)throw Error("Unprocessed schema. This is a bug in Zod.");let u=new Map;for(let g of $.seen.entries()){let J=$.metadataRegistry.get(g[0])?.id;if(J){let G=u.get(J);if(G&&G!==g[0])throw Error(`Duplicate schema id "${J}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);u.set(J,g[0])}}let U=(g)=>{let J=$.target==="draft-2020-12"?"$defs":"definitions";if($.external){let q=$.external.registry.get(g[0])?.id,N=$.external.uri??((H)=>H);if(q)return{ref:N(q)};let Y=g[1].defId??g[1].schema.id??`schema${$.counter++}`;return g[1].defId=Y,{defId:Y,ref:`${N("__shared")}#/${J}/${Y}`}}if(g[1]===_)return{ref:"#"};let v=`${"#"}/${J}/`,X=g[1].schema.id??`__schema${$.counter++}`;return{defId:X,ref:v+X}},z=(g)=>{if(g[1].schema.$ref)return;let J=g[1],{ref:G,defId:v}=U(g);if(J.def={...J.schema},v)J.defId=v;let X=J.schema;for(let q in X)delete X[q];X.$ref=G};if($.cycles==="throw")for(let g of $.seen.entries()){let J=g[1];if(J.cycle)throw Error(`Cycle detected: #/${J.cycle?.join("/")}/<root>
|
|
309
|
+
`)}H.write("payload.value = newResult;"),H.write("return payload;");let L=H.compile();return(V,R)=>L(Q,V,R)},z,g=a6,J=!$I.jitless,q=J&&Yg.value,N=I.catchall,X;$._zod.parse=(Q,H)=>{X??(X=u.value);let Y=Q.value;if(!g(Y))return Q.issues.push({expected:"object",code:"invalid_type",input:Y,inst:$}),Q;if(J&&q&&H?.async===!1&&H.jitless!==!0){if(!z)z=U(I.shape);if(Q=z(Q,H),!N)return Q;return $7([],Y,Q,H,X,$)}return _(Q,H)}});function lQ($,I,_,u){for(let z of $)if(z.issues.length===0)return I.value=z.value,I;let U=$.filter((z)=>!R6(z));if(U.length===1)return I.value=U[0].value,U[0];return I.issues.push({code:"invalid_union",input:I.value,inst:_,errors:$.map((z)=>z.issues.map((g)=>a$(g,u,V$())))}),I}var HI=B("$ZodUnion",($,I)=>{n.init($,I),o($._zod,"optin",()=>I.options.some((U)=>U._zod.optin==="optional")?"optional":void 0),o($._zod,"optout",()=>I.options.some((U)=>U._zod.optout==="optional")?"optional":void 0),o($._zod,"values",()=>{if(I.options.every((U)=>U._zod.values))return new Set(I.options.flatMap((U)=>Array.from(U._zod.values)));return}),o($._zod,"pattern",()=>{if(I.options.every((U)=>U._zod.pattern)){let U=I.options.map((z)=>z._zod.pattern);return new RegExp(`^(${U.map((z)=>_I(z.source)).join("|")})$`)}return});let _=I.options.length===1,u=I.options[0]._zod.run;$._zod.parse=(U,z)=>{if(_)return u(U,z);let g=!1,J=[];for(let G of I.options){let q=G._zod.run({value:U.value,issues:[]},z);if(q instanceof Promise)J.push(q),g=!0;else{if(q.issues.length===0)return q;J.push(q)}}if(!g)return lQ(J,U,$,z);return Promise.all(J).then((G)=>{return lQ(G,U,$,z)})}});function mQ($,I,_,u){let U=$.filter((z)=>z.issues.length===0);if(U.length===1)return I.value=U[0].value,I;if(U.length===0)I.issues.push({code:"invalid_union",input:I.value,inst:_,errors:$.map((z)=>z.issues.map((g)=>a$(g,u,V$())))});else I.issues.push({code:"invalid_union",input:I.value,inst:_,errors:[],inclusive:!1});return I}var _8=B("$ZodXor",($,I)=>{HI.init($,I),I.inclusive=!1;let _=I.options.length===1,u=I.options[0]._zod.run;$._zod.parse=(U,z)=>{if(_)return u(U,z);let g=!1,J=[];for(let G of I.options){let q=G._zod.run({value:U.value,issues:[]},z);if(q instanceof Promise)J.push(q),g=!0;else J.push(q)}if(!g)return mQ(J,U,$,z);return Promise.all(J).then((G)=>{return mQ(G,U,$,z)})}}),u8=B("$ZodDiscriminatedUnion",($,I)=>{I.inclusive=!1,HI.init($,I);let _=$._zod.parse;o($._zod,"propValues",()=>{let U={};for(let z of I.options){let g=z._zod.propValues;if(!g||Object.keys(g).length===0)throw Error(`Invalid discriminated union option at index "${I.options.indexOf(z)}"`);for(let[J,G]of Object.entries(g)){if(!U[J])U[J]=new Set;for(let q of G)U[J].add(q)}}return U});let u=f1(()=>{let U=I.options,z=new Map;for(let g of U){let J=g._zod.propValues?.[I.discriminator];if(!J||J.size===0)throw Error(`Invalid discriminated union option at index "${I.options.indexOf(g)}"`);for(let G of J){if(z.has(G))throw Error(`Duplicate discriminator value "${String(G)}"`);z.set(G,g)}}return z});$._zod.parse=(U,z)=>{let g=U.value;if(!a6(g))return U.issues.push({code:"invalid_type",expected:"object",input:g,inst:$}),U;let J=u.value.get(g?.[I.discriminator]);if(J)return J._zod.run(U,z);if(I.unionFallback)return _(U,z);return U.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:I.discriminator,input:g,path:[I.discriminator],inst:$}),U}}),z8=B("$ZodIntersection",($,I)=>{n.init($,I),$._zod.parse=(_,u)=>{let U=_.value,z=I.left._zod.run({value:U,issues:[]},u),g=I.right._zod.run({value:U,issues:[]},u);if(z instanceof Promise||g instanceof Promise)return Promise.all([z,g]).then(([G,q])=>{return rQ(_,G,q)});return rQ(_,z,g)}});function BJ($,I){if($===I)return{valid:!0,data:$};if($ instanceof Date&&I instanceof Date&&+$===+I)return{valid:!0,data:$};if(V6($)&&V6(I)){let _=Object.keys(I),u=Object.keys($).filter((z)=>_.indexOf(z)!==-1),U={...$,...I};for(let z of u){let g=BJ($[z],I[z]);if(!g.valid)return{valid:!1,mergeErrorPath:[z,...g.mergeErrorPath]};U[z]=g.data}return{valid:!0,data:U}}if(Array.isArray($)&&Array.isArray(I)){if($.length!==I.length)return{valid:!1,mergeErrorPath:[]};let _=[];for(let u=0;u<$.length;u++){let U=$[u],z=I[u],g=BJ(U,z);if(!g.valid)return{valid:!1,mergeErrorPath:[u,...g.mergeErrorPath]};_.push(g.data)}return{valid:!0,data:_}}return{valid:!1,mergeErrorPath:[]}}function rQ($,I,_){let u=new Map,U;for(let J of I.issues)if(J.code==="unrecognized_keys"){U??(U=J);for(let G of J.keys){if(!u.has(G))u.set(G,{});u.get(G).l=!0}}else $.issues.push(J);for(let J of _.issues)if(J.code==="unrecognized_keys")for(let G of J.keys){if(!u.has(G))u.set(G,{});u.get(G).r=!0}else $.issues.push(J);let z=[...u].filter(([,J])=>J.l&&J.r).map(([J])=>J);if(z.length&&U)$.issues.push({...U,keys:z});if(R6($))return $;let g=BJ(I.value,_.value);if(!g.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(g.mergeErrorPath)}`);return $.value=g.data,$}var R_=B("$ZodTuple",($,I)=>{n.init($,I);let _=I.items;$._zod.parse=(u,U)=>{let z=u.value;if(!Array.isArray(z))return u.issues.push({input:z,inst:$,expected:"tuple",code:"invalid_type"}),u;u.value=[];let g=[],J=[..._].reverse().findIndex((N)=>N._zod.optin!=="optional"),G=J===-1?0:_.length-J;if(!I.rest){let N=z.length>_.length,X=z.length<G-1;if(N||X)return u.issues.push({...N?{code:"too_big",maximum:_.length,inclusive:!0}:{code:"too_small",minimum:_.length},input:z,inst:$,origin:"array"}),u}let q=-1;for(let N of _){if(q++,q>=z.length){if(q>=G)continue}let X=N._zod.run({value:z[q],issues:[]},U);if(X instanceof Promise)g.push(X.then((Q)=>O_(Q,u,q)));else O_(X,u,q)}if(I.rest){let N=z.slice(_.length);for(let X of N){q++;let Q=I.rest._zod.run({value:X,issues:[]},U);if(Q instanceof Promise)g.push(Q.then((H)=>O_(H,u,q)));else O_(Q,u,q)}}if(g.length)return Promise.all(g).then(()=>u);return u}});function O_($,I,_){if($.issues.length)I.issues.push(..._4(_,$.issues));I.value[_]=$.value}var g8=B("$ZodRecord",($,I)=>{n.init($,I),$._zod.parse=(_,u)=>{let U=_.value;if(!V6(U))return _.issues.push({expected:"record",code:"invalid_type",input:U,inst:$}),_;let z=[],g=I.keyType._zod.values;if(g){_.value={};let J=new Set;for(let q of g)if(typeof q==="string"||typeof q==="number"||typeof q==="symbol"){J.add(typeof q==="number"?q.toString():q);let N=I.valueType._zod.run({value:U[q],issues:[]},u);if(N instanceof Promise)z.push(N.then((X)=>{if(X.issues.length)_.issues.push(..._4(q,X.issues));_.value[q]=X.value}));else{if(N.issues.length)_.issues.push(..._4(q,N.issues));_.value[q]=N.value}}let G;for(let q in U)if(!J.has(q))G=G??[],G.push(q);if(G&&G.length>0)_.issues.push({code:"unrecognized_keys",input:U,inst:$,keys:G})}else{_.value={};for(let J of Reflect.ownKeys(U)){if(J==="__proto__")continue;let G=I.keyType._zod.run({value:J,issues:[]},u);if(G instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof J==="string"&&XI.test(J)&&G.issues.length){let X=I.keyType._zod.run({value:Number(J),issues:[]},u);if(X instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(X.issues.length===0)G=X}if(G.issues.length){if(I.mode==="loose")_.value[J]=U[J];else _.issues.push({code:"invalid_key",origin:"record",issues:G.issues.map((X)=>a$(X,u,V$())),input:J,path:[J],inst:$});continue}let N=I.valueType._zod.run({value:U[J],issues:[]},u);if(N instanceof Promise)z.push(N.then((X)=>{if(X.issues.length)_.issues.push(..._4(J,X.issues));_.value[G.value]=X.value}));else{if(N.issues.length)_.issues.push(..._4(J,N.issues));_.value[G.value]=N.value}}}if(z.length)return Promise.all(z).then(()=>_);return _}}),J8=B("$ZodMap",($,I)=>{n.init($,I),$._zod.parse=(_,u)=>{let U=_.value;if(!(U instanceof Map))return _.issues.push({expected:"map",code:"invalid_type",input:U,inst:$}),_;let z=[];_.value=new Map;for(let[g,J]of U){let G=I.keyType._zod.run({value:g,issues:[]},u),q=I.valueType._zod.run({value:J,issues:[]},u);if(G instanceof Promise||q instanceof Promise)z.push(Promise.all([G,q]).then(([N,X])=>{nQ(N,X,_,g,U,$,u)}));else nQ(G,q,_,g,U,$,u)}if(z.length)return Promise.all(z).then(()=>_);return _}});function nQ($,I,_,u,U,z,g){if($.issues.length)if(uI.has(typeof u))_.issues.push(..._4(u,$.issues));else _.issues.push({code:"invalid_key",origin:"map",input:U,inst:z,issues:$.issues.map((J)=>a$(J,g,V$()))});if(I.issues.length)if(uI.has(typeof u))_.issues.push(..._4(u,I.issues));else _.issues.push({origin:"map",code:"invalid_element",input:U,inst:z,key:u,issues:I.issues.map((J)=>a$(J,g,V$()))});_.value.set($.value,I.value)}var G8=B("$ZodSet",($,I)=>{n.init($,I),$._zod.parse=(_,u)=>{let U=_.value;if(!(U instanceof Set))return _.issues.push({input:U,inst:$,expected:"set",code:"invalid_type"}),_;let z=[];_.value=new Set;for(let g of U){let J=I.valueType._zod.run({value:g,issues:[]},u);if(J instanceof Promise)z.push(J.then((G)=>hQ(G,_)));else hQ(J,_)}if(z.length)return Promise.all(z).then(()=>_);return _}});function hQ($,I){if($.issues.length)I.issues.push(...$.issues);I.value.add($.value)}var q8=B("$ZodEnum",($,I)=>{n.init($,I);let _=UI(I.entries),u=new Set(_);$._zod.values=u,$._zod.pattern=new RegExp(`^(${_.filter((U)=>uI.has(typeof U)).map((U)=>typeof U==="string"?Q4(U):U.toString()).join("|")})$`),$._zod.parse=(U,z)=>{let g=U.value;if(u.has(g))return U;return U.issues.push({code:"invalid_value",values:_,input:g,inst:$}),U}}),X8=B("$ZodLiteral",($,I)=>{if(n.init($,I),I.values.length===0)throw Error("Cannot create literal schema with no valid values");let _=new Set(I.values);$._zod.values=_,$._zod.pattern=new RegExp(`^(${I.values.map((u)=>typeof u==="string"?Q4(u):u?Q4(u.toString()):String(u)).join("|")})$`),$._zod.parse=(u,U)=>{let z=u.value;if(_.has(z))return u;return u.issues.push({code:"invalid_value",values:I.values,input:z,inst:$}),u}}),N8=B("$ZodFile",($,I)=>{n.init($,I),$._zod.parse=(_,u)=>{let U=_.value;if(U instanceof File)return _;return _.issues.push({expected:"file",code:"invalid_type",input:U,inst:$}),_}}),Q8=B("$ZodTransform",($,I)=>{n.init($,I),$._zod.parse=(_,u)=>{if(u.direction==="backward")throw new t6($.constructor.name);let U=I.transform(_.value,_);if(u.async)return(U instanceof Promise?U:Promise.resolve(U)).then((g)=>{return _.value=g,_});if(U instanceof Promise)throw new C4;return _.value=U,_}});function dQ($,I){if($.issues.length&&I===void 0)return{issues:[],value:void 0};return $}var L_=B("$ZodOptional",($,I)=>{n.init($,I),$._zod.optin="optional",$._zod.optout="optional",o($._zod,"values",()=>{return I.innerType._zod.values?new Set([...I.innerType._zod.values,void 0]):void 0}),o($._zod,"pattern",()=>{let _=I.innerType._zod.pattern;return _?new RegExp(`^(${_I(_.source)})?$`):void 0}),$._zod.parse=(_,u)=>{if(I.innerType._zod.optin==="optional"){let U=I.innerType._zod.run(_,u);if(U instanceof Promise)return U.then((z)=>dQ(z,_.value));return dQ(U,_.value)}if(_.value===void 0)return _;return I.innerType._zod.run(_,u)}}),v8=B("$ZodExactOptional",($,I)=>{L_.init($,I),o($._zod,"values",()=>I.innerType._zod.values),o($._zod,"pattern",()=>I.innerType._zod.pattern),$._zod.parse=(_,u)=>{return I.innerType._zod.run(_,u)}}),H8=B("$ZodNullable",($,I)=>{n.init($,I),o($._zod,"optin",()=>I.innerType._zod.optin),o($._zod,"optout",()=>I.innerType._zod.optout),o($._zod,"pattern",()=>{let _=I.innerType._zod.pattern;return _?new RegExp(`^(${_I(_.source)}|null)$`):void 0}),o($._zod,"values",()=>{return I.innerType._zod.values?new Set([...I.innerType._zod.values,null]):void 0}),$._zod.parse=(_,u)=>{if(_.value===null)return _;return I.innerType._zod.run(_,u)}}),Y8=B("$ZodDefault",($,I)=>{n.init($,I),$._zod.optin="optional",o($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(_,u)=>{if(u.direction==="backward")return I.innerType._zod.run(_,u);if(_.value===void 0)return _.value=I.defaultValue,_;let U=I.innerType._zod.run(_,u);if(U instanceof Promise)return U.then((z)=>cQ(z,I));return cQ(U,I)}});function cQ($,I){if($.value===void 0)$.value=I.defaultValue;return $}var O8=B("$ZodPrefault",($,I)=>{n.init($,I),$._zod.optin="optional",o($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(_,u)=>{if(u.direction==="backward")return I.innerType._zod.run(_,u);if(_.value===void 0)_.value=I.defaultValue;return I.innerType._zod.run(_,u)}}),T8=B("$ZodNonOptional",($,I)=>{n.init($,I),o($._zod,"values",()=>{let _=I.innerType._zod.values;return _?new Set([..._].filter((u)=>u!==void 0)):void 0}),$._zod.parse=(_,u)=>{let U=I.innerType._zod.run(_,u);if(U instanceof Promise)return U.then((z)=>pQ(z,$));return pQ(U,$)}});function pQ($,I){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:I});return $}var B8=B("$ZodSuccess",($,I)=>{n.init($,I),$._zod.parse=(_,u)=>{if(u.direction==="backward")throw new t6("ZodSuccess");let U=I.innerType._zod.run(_,u);if(U instanceof Promise)return U.then((z)=>{return _.value=z.issues.length===0,_});return _.value=U.issues.length===0,_}}),D8=B("$ZodCatch",($,I)=>{n.init($,I),o($._zod,"optin",()=>I.innerType._zod.optin),o($._zod,"optout",()=>I.innerType._zod.optout),o($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(_,u)=>{if(u.direction==="backward")return I.innerType._zod.run(_,u);let U=I.innerType._zod.run(_,u);if(U instanceof Promise)return U.then((z)=>{if(_.value=z.value,z.issues.length)_.value=I.catchValue({..._,error:{issues:z.issues.map((g)=>a$(g,u,V$()))},input:_.value}),_.issues=[];return _});if(_.value=U.value,U.issues.length)_.value=I.catchValue({..._,error:{issues:U.issues.map((z)=>a$(z,u,V$()))},input:_.value}),_.issues=[];return _}}),M8=B("$ZodNaN",($,I)=>{n.init($,I),$._zod.parse=(_,u)=>{if(typeof _.value!=="number"||!Number.isNaN(_.value))return _.issues.push({input:_.value,inst:$,expected:"nan",code:"invalid_type"}),_;return _}}),K8=B("$ZodPipe",($,I)=>{n.init($,I),o($._zod,"values",()=>I.in._zod.values),o($._zod,"optin",()=>I.in._zod.optin),o($._zod,"optout",()=>I.out._zod.optout),o($._zod,"propValues",()=>I.in._zod.propValues),$._zod.parse=(_,u)=>{if(u.direction==="backward"){let z=I.out._zod.run(_,u);if(z instanceof Promise)return z.then((g)=>T_(g,I.in,u));return T_(z,I.in,u)}let U=I.in._zod.run(_,u);if(U instanceof Promise)return U.then((z)=>T_(z,I.out,u));return T_(U,I.out,u)}});function T_($,I,_){if($.issues.length)return $.aborted=!0,$;return I._zod.run({value:$.value,issues:$.issues},_)}var YI=B("$ZodCodec",($,I)=>{n.init($,I),o($._zod,"values",()=>I.in._zod.values),o($._zod,"optin",()=>I.in._zod.optin),o($._zod,"optout",()=>I.out._zod.optout),o($._zod,"propValues",()=>I.in._zod.propValues),$._zod.parse=(_,u)=>{if((u.direction||"forward")==="forward"){let z=I.in._zod.run(_,u);if(z instanceof Promise)return z.then((g)=>B_(g,I,u));return B_(z,I,u)}else{let z=I.out._zod.run(_,u);if(z instanceof Promise)return z.then((g)=>B_(g,I,u));return B_(z,I,u)}}});function B_($,I,_){if($.issues.length)return $.aborted=!0,$;if((_.direction||"forward")==="forward"){let U=I.transform($.value,$);if(U instanceof Promise)return U.then((z)=>D_($,z,I.out,_));return D_($,U,I.out,_)}else{let U=I.reverseTransform($.value,$);if(U instanceof Promise)return U.then((z)=>D_($,z,I.in,_));return D_($,U,I.in,_)}}function D_($,I,_,u){if($.issues.length)return $.aborted=!0,$;return _._zod.run({value:I,issues:$.issues},u)}var V8=B("$ZodReadonly",($,I)=>{n.init($,I),o($._zod,"propValues",()=>I.innerType._zod.propValues),o($._zod,"values",()=>I.innerType._zod.values),o($._zod,"optin",()=>I.innerType?._zod?.optin),o($._zod,"optout",()=>I.innerType?._zod?.optout),$._zod.parse=(_,u)=>{if(u.direction==="backward")return I.innerType._zod.run(_,u);let U=I.innerType._zod.run(_,u);if(U instanceof Promise)return U.then(oQ);return oQ(U)}});function oQ($){return $.value=Object.freeze($.value),$}var R8=B("$ZodTemplateLiteral",($,I)=>{n.init($,I);let _=[];for(let u of I.parts)if(typeof u==="object"&&u!==null){if(!u._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...u._zod.traits].shift()}`);let U=u._zod.pattern instanceof RegExp?u._zod.pattern.source:u._zod.pattern;if(!U)throw Error(`Invalid template literal part: ${u._zod.traits}`);let z=U.startsWith("^")?1:0,g=U.endsWith("$")?U.length-1:U.length;_.push(U.slice(z,g))}else if(u===null||Tg.has(typeof u))_.push(Q4(`${u}`));else throw Error(`Invalid template literal part: ${u}`);$._zod.pattern=new RegExp(`^${_.join("")}$`),$._zod.parse=(u,U)=>{if(typeof u.value!=="string")return u.issues.push({input:u.value,inst:$,expected:"string",code:"invalid_type"}),u;if($._zod.pattern.lastIndex=0,!$._zod.pattern.test(u.value))return u.issues.push({input:u.value,inst:$,code:"invalid_format",format:I.format??"template_literal",pattern:$._zod.pattern.source}),u;return u}}),L8=B("$ZodFunction",($,I)=>{return n.init($,I),$._def=I,$._zod.def=I,$.implement=(_)=>{if(typeof _!=="function")throw Error("implement() must be called with a function");return function(...u){let U=$._def.input?U_($._def.input,u):u,z=Reflect.apply(_,this,U);if($._def.output)return U_($._def.output,z);return z}},$.implementAsync=(_)=>{if(typeof _!=="function")throw Error("implementAsync() must be called with a function");return async function(...u){let U=$._def.input?await __($._def.input,u):u,z=await Reflect.apply(_,this,U);if($._def.output)return await __($._def.output,z);return z}},$._zod.parse=(_,u)=>{if(typeof _.value!=="function")return _.issues.push({code:"invalid_type",expected:"function",input:_.value,inst:$}),_;if($._def.output&&$._def.output._zod.def.type==="promise")_.value=$.implementAsync(_.value);else _.value=$.implement(_.value);return _},$.input=(..._)=>{let u=$.constructor;if(Array.isArray(_[0]))return new u({type:"function",input:new R_({type:"tuple",items:_[0],rest:_[1]}),output:$._def.output});return new u({type:"function",input:_[0],output:$._def.output})},$.output=(_)=>{return new $.constructor({type:"function",input:$._def.input,output:_})},$}),Z8=B("$ZodPromise",($,I)=>{n.init($,I),$._zod.parse=(_,u)=>{return Promise.resolve(_.value).then((U)=>I.innerType._zod.run({value:U,issues:[]},u))}}),W8=B("$ZodLazy",($,I)=>{n.init($,I),o($._zod,"innerType",()=>I.getter()),o($._zod,"pattern",()=>$._zod.innerType?._zod?.pattern),o($._zod,"propValues",()=>$._zod.innerType?._zod?.propValues),o($._zod,"optin",()=>$._zod.innerType?._zod?.optin??void 0),o($._zod,"optout",()=>$._zod.innerType?._zod?.optout??void 0),$._zod.parse=(_,u)=>{return $._zod.innerType._zod.run(_,u)}}),P8=B("$ZodCustom",($,I)=>{X$.init($,I),n.init($,I),$._zod.parse=(_,u)=>{return _},$._zod.check=(_)=>{let u=_.value,U=I.fn(u);if(U instanceof Promise)return U.then((z)=>tQ(z,_,u,$));tQ(U,_,u,$);return}});function tQ($,I,_,u){if(!$){let U={code:"custom",input:_,inst:u,path:[...u._zod.def.path??[]],continue:!u._zod.def.abort};if(u._zod.def.params)U.params=u._zod.def.params;I.issues.push(x1(U))}}var MI={};S4(MI,{zhTW:()=>B3,zhCN:()=>T3,yo:()=>D3,vi:()=>O3,uz:()=>Y3,ur:()=>H3,uk:()=>DI,ua:()=>v3,tr:()=>Q3,th:()=>N3,ta:()=>X3,sv:()=>q3,sl:()=>G3,ru:()=>J3,pt:()=>g3,ps:()=>u3,pl:()=>z3,ota:()=>_3,no:()=>U3,nl:()=>I3,ms:()=>$3,mk:()=>s8,lt:()=>e8,ko:()=>a8,km:()=>TI,kh:()=>t8,ka:()=>o8,ja:()=>p8,it:()=>c8,is:()=>d8,id:()=>h8,hy:()=>n8,hu:()=>r8,he:()=>m8,frCA:()=>l8,fr:()=>i8,fi:()=>y8,fa:()=>k8,es:()=>x8,eo:()=>f8,en:()=>OI,de:()=>C8,da:()=>E8,cs:()=>w8,ca:()=>S8,bg:()=>F8,be:()=>j8,az:()=>A8,ar:()=>b8});var gA=()=>{let $={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function I(U){return $[U]??null}let _={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`مدخلات غير مقبولة: يفترض إدخال instanceof ${U.expected}، ولكن تم إدخال ${J}`;return`مدخلات غير مقبولة: يفترض إدخال ${z}، ولكن تم إدخال ${J}`}case"invalid_value":if(U.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${A(U.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${W(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return` أكبر من اللازم: يفترض أن تكون ${U.origin??"القيمة"} ${z} ${U.maximum.toString()} ${g.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${U.origin??"القيمة"} ${z} ${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`أصغر من اللازم: يفترض لـ ${U.origin} أن يكون ${z} ${U.minimum.toString()} ${g.unit}`;return`أصغر من اللازم: يفترض لـ ${U.origin} أن يكون ${z} ${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${U.prefix}"`;if(z.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${z.suffix}"`;if(z.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${z.includes}"`;if(z.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${z.pattern}`;return`${_[z.format]??U.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${U.divisor}`;case"unrecognized_keys":return`معرف${U.keys.length>1?"ات":""} غريب${U.keys.length>1?"ة":""}: ${W(U.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${U.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${U.origin}`;default:return"مدخل غير مقبول"}}};function b8(){return{localeError:gA()}}var JA=()=>{let $={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function I(U){return $[U]??null}let _={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Yanlış dəyər: gözlənilən instanceof ${U.expected}, daxil olan ${J}`;return`Yanlış dəyər: gözlənilən ${z}, daxil olan ${J}`}case"invalid_value":if(U.values.length===1)return`Yanlış dəyər: gözlənilən ${A(U.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${W(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Çox böyük: gözlənilən ${U.origin??"dəyər"} ${z}${U.maximum.toString()} ${g.unit??"element"}`;return`Çox böyük: gözlənilən ${U.origin??"dəyər"} ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Çox kiçik: gözlənilən ${U.origin} ${z}${U.minimum.toString()} ${g.unit}`;return`Çox kiçik: gözlənilən ${U.origin} ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Yanlış mətn: "${z.prefix}" ilə başlamalıdır`;if(z.format==="ends_with")return`Yanlış mətn: "${z.suffix}" ilə bitməlidir`;if(z.format==="includes")return`Yanlış mətn: "${z.includes}" daxil olmalıdır`;if(z.format==="regex")return`Yanlış mətn: ${z.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${_[z.format]??U.format}`}case"not_multiple_of":return`Yanlış ədəd: ${U.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${U.keys.length>1?"lar":""}: ${W(U.keys,", ")}`;case"invalid_key":return`${U.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${U.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function A8(){return{localeError:JA()}}function U7($,I,_,u){let U=Math.abs($),z=U%10,g=U%100;if(g>=11&&g<=19)return u;if(z===1)return I;if(z>=2&&z<=4)return _;return u}var GA=()=>{let $={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function I(U){return $[U]??null}let _={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"},u={nan:"NaN",number:"лік",array:"масіў"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Няправільны ўвод: чакаўся instanceof ${U.expected}, атрымана ${J}`;return`Няправільны ўвод: чакаўся ${z}, атрымана ${J}`}case"invalid_value":if(U.values.length===1)return`Няправільны ўвод: чакалася ${A(U.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${W(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g){let J=Number(U.maximum),G=U7(J,g.unit.one,g.unit.few,g.unit.many);return`Занадта вялікі: чакалася, што ${U.origin??"значэнне"} павінна ${g.verb} ${z}${U.maximum.toString()} ${G}`}return`Занадта вялікі: чакалася, што ${U.origin??"значэнне"} павінна быць ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g){let J=Number(U.minimum),G=U7(J,g.unit.one,g.unit.few,g.unit.many);return`Занадта малы: чакалася, што ${U.origin} павінна ${g.verb} ${z}${U.minimum.toString()} ${G}`}return`Занадта малы: чакалася, што ${U.origin} павінна быць ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${z.prefix}"`;if(z.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${z.suffix}"`;if(z.format==="includes")return`Няправільны радок: павінен змяшчаць "${z.includes}"`;if(z.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${z.pattern}`;return`Няправільны ${_[z.format]??U.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${U.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${U.keys.length>1?"ключы":"ключ"}: ${W(U.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${U.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${U.origin}`;default:return"Няправільны ўвод"}}};function j8(){return{localeError:GA()}}var qA=()=>{let $={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function I(U){return $[U]??null}let _={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",jwt:"JWT",template_literal:"вход"},u={nan:"NaN",number:"число",array:"масив"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Невалиден вход: очакван instanceof ${U.expected}, получен ${J}`;return`Невалиден вход: очакван ${z}, получен ${J}`}case"invalid_value":if(U.values.length===1)return`Невалиден вход: очакван ${A(U.values[0])}`;return`Невалидна опция: очаквано едно от ${W(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Твърде голямо: очаква се ${U.origin??"стойност"} да съдържа ${z}${U.maximum.toString()} ${g.unit??"елемента"}`;return`Твърде голямо: очаква се ${U.origin??"стойност"} да бъде ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Твърде малко: очаква се ${U.origin} да съдържа ${z}${U.minimum.toString()} ${g.unit}`;return`Твърде малко: очаква се ${U.origin} да бъде ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Невалиден низ: трябва да започва с "${z.prefix}"`;if(z.format==="ends_with")return`Невалиден низ: трябва да завършва с "${z.suffix}"`;if(z.format==="includes")return`Невалиден низ: трябва да включва "${z.includes}"`;if(z.format==="regex")return`Невалиден низ: трябва да съвпада с ${z.pattern}`;let g="Невалиден";if(z.format==="emoji")g="Невалидно";if(z.format==="datetime")g="Невалидно";if(z.format==="date")g="Невалидна";if(z.format==="time")g="Невалидно";if(z.format==="duration")g="Невалидна";return`${g} ${_[z.format]??U.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${U.divisor}`;case"unrecognized_keys":return`Неразпознат${U.keys.length>1?"и":""} ключ${U.keys.length>1?"ове":""}: ${W(U.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${U.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${U.origin}`;default:return"Невалиден вход"}}};function F8(){return{localeError:qA()}}var XA=()=>{let $={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function I(U){return $[U]??null}let _={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Tipus invàlid: s'esperava instanceof ${U.expected}, s'ha rebut ${J}`;return`Tipus invàlid: s'esperava ${z}, s'ha rebut ${J}`}case"invalid_value":if(U.values.length===1)return`Valor invàlid: s'esperava ${A(U.values[0])}`;return`Opció invàlida: s'esperava una de ${W(U.values," o ")}`;case"too_big":{let z=U.inclusive?"com a màxim":"menys de",g=I(U.origin);if(g)return`Massa gran: s'esperava que ${U.origin??"el valor"} contingués ${z} ${U.maximum.toString()} ${g.unit??"elements"}`;return`Massa gran: s'esperava que ${U.origin??"el valor"} fos ${z} ${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?"com a mínim":"més de",g=I(U.origin);if(g)return`Massa petit: s'esperava que ${U.origin} contingués ${z} ${U.minimum.toString()} ${g.unit}`;return`Massa petit: s'esperava que ${U.origin} fos ${z} ${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Format invàlid: ha de començar amb "${z.prefix}"`;if(z.format==="ends_with")return`Format invàlid: ha d'acabar amb "${z.suffix}"`;if(z.format==="includes")return`Format invàlid: ha d'incloure "${z.includes}"`;if(z.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${z.pattern}`;return`Format invàlid per a ${_[z.format]??U.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${U.divisor}`;case"unrecognized_keys":return`Clau${U.keys.length>1?"s":""} no reconeguda${U.keys.length>1?"s":""}: ${W(U.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${U.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${U.origin}`;default:return"Entrada invàlida"}}};function S8(){return{localeError:XA()}}var NA=()=>{let $={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function I(U){return $[U]??null}let _={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"},u={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Neplatný vstup: očekáváno instanceof ${U.expected}, obdrženo ${J}`;return`Neplatný vstup: očekáváno ${z}, obdrženo ${J}`}case"invalid_value":if(U.values.length===1)return`Neplatný vstup: očekáváno ${A(U.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${W(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Hodnota je příliš velká: ${U.origin??"hodnota"} musí mít ${z}${U.maximum.toString()} ${g.unit??"prvků"}`;return`Hodnota je příliš velká: ${U.origin??"hodnota"} musí být ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Hodnota je příliš malá: ${U.origin??"hodnota"} musí mít ${z}${U.minimum.toString()} ${g.unit??"prvků"}`;return`Hodnota je příliš malá: ${U.origin??"hodnota"} musí být ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Neplatný řetězec: musí začínat na "${z.prefix}"`;if(z.format==="ends_with")return`Neplatný řetězec: musí končit na "${z.suffix}"`;if(z.format==="includes")return`Neplatný řetězec: musí obsahovat "${z.includes}"`;if(z.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${z.pattern}`;return`Neplatný formát ${_[z.format]??U.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${U.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${W(U.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${U.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${U.origin}`;default:return"Neplatný vstup"}}};function w8(){return{localeError:NA()}}var QA=()=>{let $={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function I(U){return $[U]??null}let _={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},u={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Ugyldigt input: forventede instanceof ${U.expected}, fik ${J}`;return`Ugyldigt input: forventede ${z}, fik ${J}`}case"invalid_value":if(U.values.length===1)return`Ugyldig værdi: forventede ${A(U.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${W(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin),J=u[U.origin]??U.origin;if(g)return`For stor: forventede ${J??"value"} ${g.verb} ${z} ${U.maximum.toString()} ${g.unit??"elementer"}`;return`For stor: forventede ${J??"value"} havde ${z} ${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin),J=u[U.origin]??U.origin;if(g)return`For lille: forventede ${J} ${g.verb} ${z} ${U.minimum.toString()} ${g.unit}`;return`For lille: forventede ${J} havde ${z} ${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Ugyldig streng: skal starte med "${z.prefix}"`;if(z.format==="ends_with")return`Ugyldig streng: skal ende med "${z.suffix}"`;if(z.format==="includes")return`Ugyldig streng: skal indeholde "${z.includes}"`;if(z.format==="regex")return`Ugyldig streng: skal matche mønsteret ${z.pattern}`;return`Ugyldig ${_[z.format]??U.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${U.divisor}`;case"unrecognized_keys":return`${U.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${W(U.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${U.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${U.origin}`;default:return"Ugyldigt input"}}};function E8(){return{localeError:QA()}}var vA=()=>{let $={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function I(U){return $[U]??null}let _={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},u={nan:"NaN",number:"Zahl",array:"Array"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Ungültige Eingabe: erwartet instanceof ${U.expected}, erhalten ${J}`;return`Ungültige Eingabe: erwartet ${z}, erhalten ${J}`}case"invalid_value":if(U.values.length===1)return`Ungültige Eingabe: erwartet ${A(U.values[0])}`;return`Ungültige Option: erwartet eine von ${W(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Zu groß: erwartet, dass ${U.origin??"Wert"} ${z}${U.maximum.toString()} ${g.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${U.origin??"Wert"} ${z}${U.maximum.toString()} ist`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Zu klein: erwartet, dass ${U.origin} ${z}${U.minimum.toString()} ${g.unit} hat`;return`Zu klein: erwartet, dass ${U.origin} ${z}${U.minimum.toString()} ist`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Ungültiger String: muss mit "${z.prefix}" beginnen`;if(z.format==="ends_with")return`Ungültiger String: muss mit "${z.suffix}" enden`;if(z.format==="includes")return`Ungültiger String: muss "${z.includes}" enthalten`;if(z.format==="regex")return`Ungültiger String: muss dem Muster ${z.pattern} entsprechen`;return`Ungültig: ${_[z.format]??U.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${U.divisor} sein`;case"unrecognized_keys":return`${U.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${W(U.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${U.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${U.origin}`;default:return"Ungültige Eingabe"}}};function C8(){return{localeError:vA()}}var HA=()=>{let $={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function I(U){return $[U]??null}let _={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;return`Invalid input: expected ${z}, received ${J}`}case"invalid_value":if(U.values.length===1)return`Invalid input: expected ${A(U.values[0])}`;return`Invalid option: expected one of ${W(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Too big: expected ${U.origin??"value"} to have ${z}${U.maximum.toString()} ${g.unit??"elements"}`;return`Too big: expected ${U.origin??"value"} to be ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Too small: expected ${U.origin} to have ${z}${U.minimum.toString()} ${g.unit}`;return`Too small: expected ${U.origin} to be ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Invalid string: must start with "${z.prefix}"`;if(z.format==="ends_with")return`Invalid string: must end with "${z.suffix}"`;if(z.format==="includes")return`Invalid string: must include "${z.includes}"`;if(z.format==="regex")return`Invalid string: must match pattern ${z.pattern}`;return`Invalid ${_[z.format]??U.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${U.divisor}`;case"unrecognized_keys":return`Unrecognized key${U.keys.length>1?"s":""}: ${W(U.keys,", ")}`;case"invalid_key":return`Invalid key in ${U.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${U.origin}`;default:return"Invalid input"}}};function OI(){return{localeError:HA()}}var YA=()=>{let $={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function I(U){return $[U]??null}let _={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},u={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Nevalida enigo: atendiĝis instanceof ${U.expected}, riceviĝis ${J}`;return`Nevalida enigo: atendiĝis ${z}, riceviĝis ${J}`}case"invalid_value":if(U.values.length===1)return`Nevalida enigo: atendiĝis ${A(U.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${W(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Tro granda: atendiĝis ke ${U.origin??"valoro"} havu ${z}${U.maximum.toString()} ${g.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${U.origin??"valoro"} havu ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Tro malgranda: atendiĝis ke ${U.origin} havu ${z}${U.minimum.toString()} ${g.unit}`;return`Tro malgranda: atendiĝis ke ${U.origin} estu ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${z.prefix}"`;if(z.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${z.suffix}"`;if(z.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${z.includes}"`;if(z.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${z.pattern}`;return`Nevalida ${_[z.format]??U.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${U.divisor}`;case"unrecognized_keys":return`Nekonata${U.keys.length>1?"j":""} ŝlosilo${U.keys.length>1?"j":""}: ${W(U.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${U.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${U.origin}`;default:return"Nevalida enigo"}}};function f8(){return{localeError:YA()}}var OA=()=>{let $={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function I(U){return $[U]??null}let _={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},u={nan:"NaN",string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Entrada inválida: se esperaba instanceof ${U.expected}, recibido ${J}`;return`Entrada inválida: se esperaba ${z}, recibido ${J}`}case"invalid_value":if(U.values.length===1)return`Entrada inválida: se esperaba ${A(U.values[0])}`;return`Opción inválida: se esperaba una de ${W(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin),J=u[U.origin]??U.origin;if(g)return`Demasiado grande: se esperaba que ${J??"valor"} tuviera ${z}${U.maximum.toString()} ${g.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${J??"valor"} fuera ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin),J=u[U.origin]??U.origin;if(g)return`Demasiado pequeño: se esperaba que ${J} tuviera ${z}${U.minimum.toString()} ${g.unit}`;return`Demasiado pequeño: se esperaba que ${J} fuera ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Cadena inválida: debe comenzar con "${z.prefix}"`;if(z.format==="ends_with")return`Cadena inválida: debe terminar en "${z.suffix}"`;if(z.format==="includes")return`Cadena inválida: debe incluir "${z.includes}"`;if(z.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${z.pattern}`;return`Inválido ${_[z.format]??U.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${U.divisor}`;case"unrecognized_keys":return`Llave${U.keys.length>1?"s":""} desconocida${U.keys.length>1?"s":""}: ${W(U.keys,", ")}`;case"invalid_key":return`Llave inválida en ${u[U.origin]??U.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${u[U.origin]??U.origin}`;default:return"Entrada inválida"}}};function x8(){return{localeError:OA()}}var TA=()=>{let $={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function I(U){return $[U]??null}let _={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"},u={nan:"NaN",number:"عدد",array:"آرایه"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`ورودی نامعتبر: میبایست instanceof ${U.expected} میبود، ${J} دریافت شد`;return`ورودی نامعتبر: میبایست ${z} میبود، ${J} دریافت شد`}case"invalid_value":if(U.values.length===1)return`ورودی نامعتبر: میبایست ${A(U.values[0])} میبود`;return`گزینه نامعتبر: میبایست یکی از ${W(U.values,"|")} میبود`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`خیلی بزرگ: ${U.origin??"مقدار"} باید ${z}${U.maximum.toString()} ${g.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${U.origin??"مقدار"} باید ${z}${U.maximum.toString()} باشد`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`خیلی کوچک: ${U.origin} باید ${z}${U.minimum.toString()} ${g.unit} باشد`;return`خیلی کوچک: ${U.origin} باید ${z}${U.minimum.toString()} باشد`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`رشته نامعتبر: باید با "${z.prefix}" شروع شود`;if(z.format==="ends_with")return`رشته نامعتبر: باید با "${z.suffix}" تمام شود`;if(z.format==="includes")return`رشته نامعتبر: باید شامل "${z.includes}" باشد`;if(z.format==="regex")return`رشته نامعتبر: باید با الگوی ${z.pattern} مطابقت داشته باشد`;return`${_[z.format]??U.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${U.divisor} باشد`;case"unrecognized_keys":return`کلید${U.keys.length>1?"های":""} ناشناس: ${W(U.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${U.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${U.origin}`;default:return"ورودی نامعتبر"}}};function k8(){return{localeError:TA()}}var BA=()=>{let $={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function I(U){return $[U]??null}let _={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Virheellinen tyyppi: odotettiin instanceof ${U.expected}, oli ${J}`;return`Virheellinen tyyppi: odotettiin ${z}, oli ${J}`}case"invalid_value":if(U.values.length===1)return`Virheellinen syöte: täytyy olla ${A(U.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${W(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Liian suuri: ${g.subject} täytyy olla ${z}${U.maximum.toString()} ${g.unit}`.trim();return`Liian suuri: arvon täytyy olla ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Liian pieni: ${g.subject} täytyy olla ${z}${U.minimum.toString()} ${g.unit}`.trim();return`Liian pieni: arvon täytyy olla ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${z.prefix}"`;if(z.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${z.suffix}"`;if(z.format==="includes")return`Virheellinen syöte: täytyy sisältää "${z.includes}"`;if(z.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${z.pattern}`;return`Virheellinen ${_[z.format]??U.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${U.divisor} monikerta`;case"unrecognized_keys":return`${U.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${W(U.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function y8(){return{localeError:BA()}}var DA=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function I(U){return $[U]??null}let _={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},u={nan:"NaN",number:"nombre",array:"tableau"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Entrée invalide : instanceof ${U.expected} attendu, ${J} reçu`;return`Entrée invalide : ${z} attendu, ${J} reçu`}case"invalid_value":if(U.values.length===1)return`Entrée invalide : ${A(U.values[0])} attendu`;return`Option invalide : une valeur parmi ${W(U.values,"|")} attendue`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Trop grand : ${U.origin??"valeur"} doit ${g.verb} ${z}${U.maximum.toString()} ${g.unit??"élément(s)"}`;return`Trop grand : ${U.origin??"valeur"} doit être ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Trop petit : ${U.origin} doit ${g.verb} ${z}${U.minimum.toString()} ${g.unit}`;return`Trop petit : ${U.origin} doit être ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Chaîne invalide : doit commencer par "${z.prefix}"`;if(z.format==="ends_with")return`Chaîne invalide : doit se terminer par "${z.suffix}"`;if(z.format==="includes")return`Chaîne invalide : doit inclure "${z.includes}"`;if(z.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${z.pattern}`;return`${_[z.format]??U.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${U.divisor}`;case"unrecognized_keys":return`Clé${U.keys.length>1?"s":""} non reconnue${U.keys.length>1?"s":""} : ${W(U.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${U.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${U.origin}`;default:return"Entrée invalide"}}};function i8(){return{localeError:DA()}}var MA=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function I(U){return $[U]??null}let _={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Entrée invalide : attendu instanceof ${U.expected}, reçu ${J}`;return`Entrée invalide : attendu ${z}, reçu ${J}`}case"invalid_value":if(U.values.length===1)return`Entrée invalide : attendu ${A(U.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${W(U.values,"|")}`;case"too_big":{let z=U.inclusive?"≤":"<",g=I(U.origin);if(g)return`Trop grand : attendu que ${U.origin??"la valeur"} ait ${z}${U.maximum.toString()} ${g.unit}`;return`Trop grand : attendu que ${U.origin??"la valeur"} soit ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?"≥":">",g=I(U.origin);if(g)return`Trop petit : attendu que ${U.origin} ait ${z}${U.minimum.toString()} ${g.unit}`;return`Trop petit : attendu que ${U.origin} soit ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Chaîne invalide : doit commencer par "${z.prefix}"`;if(z.format==="ends_with")return`Chaîne invalide : doit se terminer par "${z.suffix}"`;if(z.format==="includes")return`Chaîne invalide : doit inclure "${z.includes}"`;if(z.format==="regex")return`Chaîne invalide : doit correspondre au motif ${z.pattern}`;return`${_[z.format]??U.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${U.divisor}`;case"unrecognized_keys":return`Clé${U.keys.length>1?"s":""} non reconnue${U.keys.length>1?"s":""} : ${W(U.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${U.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${U.origin}`;default:return"Entrée invalide"}}};function l8(){return{localeError:MA()}}var KA=()=>{let $={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},I={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},_=(q)=>q?$[q]:void 0,u=(q)=>{let N=_(q);if(N)return N.label;return q??$.unknown.label},U=(q)=>`ה${u(q)}`,z=(q)=>{return(_(q)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות"},g=(q)=>{if(!q)return null;return I[q]??null},J={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}},G={nan:"NaN"};return(q)=>{switch(q.code){case"invalid_type":{let N=q.expected,X=G[N??""]??u(N),Q=j(q.input),H=G[Q]??$[Q]?.label??Q;if(/^[A-Z]/.test(q.expected))return`קלט לא תקין: צריך להיות instanceof ${q.expected}, התקבל ${H}`;return`קלט לא תקין: צריך להיות ${X}, התקבל ${H}`}case"invalid_value":{if(q.values.length===1)return`ערך לא תקין: הערך חייב להיות ${A(q.values[0])}`;let N=q.values.map((H)=>A(H));if(q.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${N[0]} או ${N[1]}`;let X=N[N.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${N.slice(0,-1).join(", ")} או ${X}`}case"too_big":{let N=g(q.origin),X=U(q.origin??"value");if(q.origin==="string")return`${N?.longLabel??"ארוך"} מדי: ${X} צריכה להכיל ${q.maximum.toString()} ${N?.unit??""} ${q.inclusive?"או פחות":"לכל היותר"}`.trim();if(q.origin==="number"){let Y=q.inclusive?`קטן או שווה ל-${q.maximum}`:`קטן מ-${q.maximum}`;return`גדול מדי: ${X} צריך להיות ${Y}`}if(q.origin==="array"||q.origin==="set"){let Y=q.origin==="set"?"צריכה":"צריך",v=q.inclusive?`${q.maximum} ${N?.unit??""} או פחות`:`פחות מ-${q.maximum} ${N?.unit??""}`;return`גדול מדי: ${X} ${Y} להכיל ${v}`.trim()}let Q=q.inclusive?"<=":"<",H=z(q.origin??"value");if(N?.unit)return`${N.longLabel} מדי: ${X} ${H} ${Q}${q.maximum.toString()} ${N.unit}`;return`${N?.longLabel??"גדול"} מדי: ${X} ${H} ${Q}${q.maximum.toString()}`}case"too_small":{let N=g(q.origin),X=U(q.origin??"value");if(q.origin==="string")return`${N?.shortLabel??"קצר"} מדי: ${X} צריכה להכיל ${q.minimum.toString()} ${N?.unit??""} ${q.inclusive?"או יותר":"לפחות"}`.trim();if(q.origin==="number"){let Y=q.inclusive?`גדול או שווה ל-${q.minimum}`:`גדול מ-${q.minimum}`;return`קטן מדי: ${X} צריך להיות ${Y}`}if(q.origin==="array"||q.origin==="set"){let Y=q.origin==="set"?"צריכה":"צריך";if(q.minimum===1&&q.inclusive){let O=q.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${X} ${Y} להכיל ${O}`}let v=q.inclusive?`${q.minimum} ${N?.unit??""} או יותר`:`יותר מ-${q.minimum} ${N?.unit??""}`;return`קטן מדי: ${X} ${Y} להכיל ${v}`.trim()}let Q=q.inclusive?">=":">",H=z(q.origin??"value");if(N?.unit)return`${N.shortLabel} מדי: ${X} ${H} ${Q}${q.minimum.toString()} ${N.unit}`;return`${N?.shortLabel??"קטן"} מדי: ${X} ${H} ${Q}${q.minimum.toString()}`}case"invalid_format":{let N=q;if(N.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${N.prefix}"`;if(N.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${N.suffix}"`;if(N.format==="includes")return`המחרוזת חייבת לכלול "${N.includes}"`;if(N.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${N.pattern}`;let X=J[N.format],Q=X?.label??N.format,Y=(X?.gender??"m")==="f"?"תקינה":"תקין";return`${Q} לא ${Y}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${q.divisor}`;case"unrecognized_keys":return`מפתח${q.keys.length>1?"ות":""} לא מזוה${q.keys.length>1?"ים":"ה"}: ${W(q.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${U(q.origin??"array")}`;default:return"קלט לא תקין"}}};function m8(){return{localeError:KA()}}var VA=()=>{let $={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function I(U){return $[U]??null}let _={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"},u={nan:"NaN",number:"szám",array:"tömb"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Érvénytelen bemenet: a várt érték instanceof ${U.expected}, a kapott érték ${J}`;return`Érvénytelen bemenet: a várt érték ${z}, a kapott érték ${J}`}case"invalid_value":if(U.values.length===1)return`Érvénytelen bemenet: a várt érték ${A(U.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${W(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Túl nagy: ${U.origin??"érték"} mérete túl nagy ${z}${U.maximum.toString()} ${g.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${U.origin??"érték"} túl nagy: ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Túl kicsi: a bemeneti érték ${U.origin} mérete túl kicsi ${z}${U.minimum.toString()} ${g.unit}`;return`Túl kicsi: a bemeneti érték ${U.origin} túl kicsi ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Érvénytelen string: "${z.prefix}" értékkel kell kezdődnie`;if(z.format==="ends_with")return`Érvénytelen string: "${z.suffix}" értékkel kell végződnie`;if(z.format==="includes")return`Érvénytelen string: "${z.includes}" értéket kell tartalmaznia`;if(z.format==="regex")return`Érvénytelen string: ${z.pattern} mintának kell megfelelnie`;return`Érvénytelen ${_[z.format]??U.format}`}case"not_multiple_of":return`Érvénytelen szám: ${U.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${U.keys.length>1?"s":""}: ${W(U.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${U.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${U.origin}`;default:return"Érvénytelen bemenet"}}};function r8(){return{localeError:VA()}}function _7($,I,_){return Math.abs($)===1?I:_}function r1($){if(!$)return"";let I=["ա","ե","ը","ի","ո","ու","օ"],_=$[$.length-1];return $+(I.includes(_)?"ն":"ը")}var RA=()=>{let $={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function I(U){return $[U]??null}let _={regex:"մուտք",email:"էլ. հասցե",url:"URL",emoji:"էմոջի",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ամսաթիվ և ժամ",date:"ISO ամսաթիվ",time:"ISO ժամ",duration:"ISO տևողություն",ipv4:"IPv4 հասցե",ipv6:"IPv6 հասցե",cidrv4:"IPv4 միջակայք",cidrv6:"IPv6 միջակայք",base64:"base64 ձևաչափով տող",base64url:"base64url ձևաչափով տող",json_string:"JSON տող",e164:"E.164 համար",jwt:"JWT",template_literal:"մուտք"},u={nan:"NaN",number:"թիվ",array:"զանգված"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Սխալ մուտքագրում․ սպասվում էր instanceof ${U.expected}, ստացվել է ${J}`;return`Սխալ մուտքագրում․ սպասվում էր ${z}, ստացվել է ${J}`}case"invalid_value":if(U.values.length===1)return`Սխալ մուտքագրում․ սպասվում էր ${A(U.values[1])}`;return`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${W(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g){let J=Number(U.maximum),G=_7(J,g.unit.one,g.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${r1(U.origin??"արժեք")} կունենա ${z}${U.maximum.toString()} ${G}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${r1(U.origin??"արժեք")} լինի ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g){let J=Number(U.minimum),G=_7(J,g.unit.one,g.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${r1(U.origin)} կունենա ${z}${U.minimum.toString()} ${G}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${r1(U.origin)} լինի ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Սխալ տող․ պետք է սկսվի "${z.prefix}"-ով`;if(z.format==="ends_with")return`Սխալ տող․ պետք է ավարտվի "${z.suffix}"-ով`;if(z.format==="includes")return`Սխալ տող․ պետք է պարունակի "${z.includes}"`;if(z.format==="regex")return`Սխալ տող․ պետք է համապատասխանի ${z.pattern} ձևաչափին`;return`Սխալ ${_[z.format]??U.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${U.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${U.keys.length>1?"ներ":""}. ${W(U.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${r1(U.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${r1(U.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};function n8(){return{localeError:RA()}}var LA=()=>{let $={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function I(U){return $[U]??null}let _={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Input tidak valid: diharapkan instanceof ${U.expected}, diterima ${J}`;return`Input tidak valid: diharapkan ${z}, diterima ${J}`}case"invalid_value":if(U.values.length===1)return`Input tidak valid: diharapkan ${A(U.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${W(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Terlalu besar: diharapkan ${U.origin??"value"} memiliki ${z}${U.maximum.toString()} ${g.unit??"elemen"}`;return`Terlalu besar: diharapkan ${U.origin??"value"} menjadi ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Terlalu kecil: diharapkan ${U.origin} memiliki ${z}${U.minimum.toString()} ${g.unit}`;return`Terlalu kecil: diharapkan ${U.origin} menjadi ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`String tidak valid: harus dimulai dengan "${z.prefix}"`;if(z.format==="ends_with")return`String tidak valid: harus berakhir dengan "${z.suffix}"`;if(z.format==="includes")return`String tidak valid: harus menyertakan "${z.includes}"`;if(z.format==="regex")return`String tidak valid: harus sesuai pola ${z.pattern}`;return`${_[z.format]??U.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${U.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${U.keys.length>1?"s":""}: ${W(U.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${U.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${U.origin}`;default:return"Input tidak valid"}}};function h8(){return{localeError:LA()}}var ZA=()=>{let $={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function I(U){return $[U]??null}let _={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"},u={nan:"NaN",number:"númer",array:"fylki"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Rangt gildi: Þú slóst inn ${J} þar sem á að vera instanceof ${U.expected}`;return`Rangt gildi: Þú slóst inn ${J} þar sem á að vera ${z}`}case"invalid_value":if(U.values.length===1)return`Rangt gildi: gert ráð fyrir ${A(U.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${W(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Of stórt: gert er ráð fyrir að ${U.origin??"gildi"} hafi ${z}${U.maximum.toString()} ${g.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${U.origin??"gildi"} sé ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Of lítið: gert er ráð fyrir að ${U.origin} hafi ${z}${U.minimum.toString()} ${g.unit}`;return`Of lítið: gert er ráð fyrir að ${U.origin} sé ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Ógildur strengur: verður að byrja á "${z.prefix}"`;if(z.format==="ends_with")return`Ógildur strengur: verður að enda á "${z.suffix}"`;if(z.format==="includes")return`Ógildur strengur: verður að innihalda "${z.includes}"`;if(z.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${z.pattern}`;return`Rangt ${_[z.format]??U.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${U.divisor}`;case"unrecognized_keys":return`Óþekkt ${U.keys.length>1?"ir lyklar":"ur lykill"}: ${W(U.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${U.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${U.origin}`;default:return"Rangt gildi"}}};function d8(){return{localeError:ZA()}}var WA=()=>{let $={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function I(U){return $[U]??null}let _={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},u={nan:"NaN",number:"numero",array:"vettore"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Input non valido: atteso instanceof ${U.expected}, ricevuto ${J}`;return`Input non valido: atteso ${z}, ricevuto ${J}`}case"invalid_value":if(U.values.length===1)return`Input non valido: atteso ${A(U.values[0])}`;return`Opzione non valida: atteso uno tra ${W(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Troppo grande: ${U.origin??"valore"} deve avere ${z}${U.maximum.toString()} ${g.unit??"elementi"}`;return`Troppo grande: ${U.origin??"valore"} deve essere ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Troppo piccolo: ${U.origin} deve avere ${z}${U.minimum.toString()} ${g.unit}`;return`Troppo piccolo: ${U.origin} deve essere ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Stringa non valida: deve iniziare con "${z.prefix}"`;if(z.format==="ends_with")return`Stringa non valida: deve terminare con "${z.suffix}"`;if(z.format==="includes")return`Stringa non valida: deve includere "${z.includes}"`;if(z.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${z.pattern}`;return`Invalid ${_[z.format]??U.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${U.divisor}`;case"unrecognized_keys":return`Chiav${U.keys.length>1?"i":"e"} non riconosciut${U.keys.length>1?"e":"a"}: ${W(U.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${U.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${U.origin}`;default:return"Input non valido"}}};function c8(){return{localeError:WA()}}var PA=()=>{let $={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function I(U){return $[U]??null}let _={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"},u={nan:"NaN",number:"数値",array:"配列"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`無効な入力: instanceof ${U.expected}が期待されましたが、${J}が入力されました`;return`無効な入力: ${z}が期待されましたが、${J}が入力されました`}case"invalid_value":if(U.values.length===1)return`無効な入力: ${A(U.values[0])}が期待されました`;return`無効な選択: ${W(U.values,"、")}のいずれかである必要があります`;case"too_big":{let z=U.inclusive?"以下である":"より小さい",g=I(U.origin);if(g)return`大きすぎる値: ${U.origin??"値"}は${U.maximum.toString()}${g.unit??"要素"}${z}必要があります`;return`大きすぎる値: ${U.origin??"値"}は${U.maximum.toString()}${z}必要があります`}case"too_small":{let z=U.inclusive?"以上である":"より大きい",g=I(U.origin);if(g)return`小さすぎる値: ${U.origin}は${U.minimum.toString()}${g.unit}${z}必要があります`;return`小さすぎる値: ${U.origin}は${U.minimum.toString()}${z}必要があります`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`無効な文字列: "${z.prefix}"で始まる必要があります`;if(z.format==="ends_with")return`無効な文字列: "${z.suffix}"で終わる必要があります`;if(z.format==="includes")return`無効な文字列: "${z.includes}"を含む必要があります`;if(z.format==="regex")return`無効な文字列: パターン${z.pattern}に一致する必要があります`;return`無効な${_[z.format]??U.format}`}case"not_multiple_of":return`無効な数値: ${U.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${U.keys.length>1?"群":""}: ${W(U.keys,"、")}`;case"invalid_key":return`${U.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${U.origin}内の無効な値`;default:return"無効な入力"}}};function p8(){return{localeError:PA()}}var bA=()=>{let $={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function I(U){return $[U]??null}let _={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"},u={nan:"NaN",number:"რიცხვი",string:"სტრინგი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`არასწორი შეყვანა: მოსალოდნელი instanceof ${U.expected}, მიღებული ${J}`;return`არასწორი შეყვანა: მოსალოდნელი ${z}, მიღებული ${J}`}case"invalid_value":if(U.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${A(U.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${W(U.values,"|")}-დან`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`ზედმეტად დიდი: მოსალოდნელი ${U.origin??"მნიშვნელობა"} ${g.verb} ${z}${U.maximum.toString()} ${g.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${U.origin??"მნიშვნელობა"} იყოს ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`ზედმეტად პატარა: მოსალოდნელი ${U.origin} ${g.verb} ${z}${U.minimum.toString()} ${g.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${U.origin} იყოს ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`არასწორი სტრინგი: უნდა იწყებოდეს "${z.prefix}"-ით`;if(z.format==="ends_with")return`არასწორი სტრინგი: უნდა მთავრდებოდეს "${z.suffix}"-ით`;if(z.format==="includes")return`არასწორი სტრინგი: უნდა შეიცავდეს "${z.includes}"-ს`;if(z.format==="regex")return`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${z.pattern}`;return`არასწორი ${_[z.format]??U.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${U.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${U.keys.length>1?"ები":"ი"}: ${W(U.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${U.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${U.origin}-ში`;default:return"არასწორი შეყვანა"}}};function o8(){return{localeError:bA()}}var AA=()=>{let $={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function I(U){return $[U]??null}let _={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"},u={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${U.expected} ប៉ុន្តែទទួលបាន ${J}`;return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${z} ប៉ុន្តែទទួលបាន ${J}`}case"invalid_value":if(U.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${A(U.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${W(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`ធំពេក៖ ត្រូវការ ${U.origin??"តម្លៃ"} ${z} ${U.maximum.toString()} ${g.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${U.origin??"តម្លៃ"} ${z} ${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`តូចពេក៖ ត្រូវការ ${U.origin} ${z} ${U.minimum.toString()} ${g.unit}`;return`តូចពេក៖ ត្រូវការ ${U.origin} ${z} ${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${z.prefix}"`;if(z.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${z.suffix}"`;if(z.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${z.includes}"`;if(z.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${z.pattern}`;return`មិនត្រឹមត្រូវ៖ ${_[z.format]??U.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${U.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${W(U.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${U.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${U.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function TI(){return{localeError:AA()}}function t8(){return TI()}var jA=()=>{let $={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function I(U){return $[U]??null}let _={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`잘못된 입력: 예상 타입은 instanceof ${U.expected}, 받은 타입은 ${J}입니다`;return`잘못된 입력: 예상 타입은 ${z}, 받은 타입은 ${J}입니다`}case"invalid_value":if(U.values.length===1)return`잘못된 입력: 값은 ${A(U.values[0])} 이어야 합니다`;return`잘못된 옵션: ${W(U.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let z=U.inclusive?"이하":"미만",g=z==="미만"?"이어야 합니다":"여야 합니다",J=I(U.origin),G=J?.unit??"요소";if(J)return`${U.origin??"값"}이 너무 큽니다: ${U.maximum.toString()}${G} ${z}${g}`;return`${U.origin??"값"}이 너무 큽니다: ${U.maximum.toString()} ${z}${g}`}case"too_small":{let z=U.inclusive?"이상":"초과",g=z==="이상"?"이어야 합니다":"여야 합니다",J=I(U.origin),G=J?.unit??"요소";if(J)return`${U.origin??"값"}이 너무 작습니다: ${U.minimum.toString()}${G} ${z}${g}`;return`${U.origin??"값"}이 너무 작습니다: ${U.minimum.toString()} ${z}${g}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`잘못된 문자열: "${z.prefix}"(으)로 시작해야 합니다`;if(z.format==="ends_with")return`잘못된 문자열: "${z.suffix}"(으)로 끝나야 합니다`;if(z.format==="includes")return`잘못된 문자열: "${z.includes}"을(를) 포함해야 합니다`;if(z.format==="regex")return`잘못된 문자열: 정규식 ${z.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${_[z.format]??U.format}`}case"not_multiple_of":return`잘못된 숫자: ${U.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${W(U.keys,", ")}`;case"invalid_key":return`잘못된 키: ${U.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${U.origin}`;default:return"잘못된 입력"}}};function a8(){return{localeError:jA()}}var BI=($)=>{return $.charAt(0).toUpperCase()+$.slice(1)};function u7($){let I=Math.abs($),_=I%10,u=I%100;if(u>=11&&u<=19||_===0)return"many";if(_===1)return"one";return"few"}var FA=()=>{let $={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function I(U,z,g,J){let G=$[U]??null;if(G===null)return G;return{unit:G.unit[z],verb:G.verb[J][g?"inclusive":"notInclusive"]}}let _={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"},u={nan:"NaN",number:"skaičius",bigint:"sveikasis skaičius",string:"eilutė",boolean:"loginė reikšmė",undefined:"neapibrėžta reikšmė",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulinė reikšmė"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Gautas tipas ${J}, o tikėtasi - instanceof ${U.expected}`;return`Gautas tipas ${J}, o tikėtasi - ${z}`}case"invalid_value":if(U.values.length===1)return`Privalo būti ${A(U.values[0])}`;return`Privalo būti vienas iš ${W(U.values,"|")} pasirinkimų`;case"too_big":{let z=u[U.origin]??U.origin,g=I(U.origin,u7(Number(U.maximum)),U.inclusive??!1,"smaller");if(g?.verb)return`${BI(z??U.origin??"reikšmė")} ${g.verb} ${U.maximum.toString()} ${g.unit??"elementų"}`;let J=U.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${BI(z??U.origin??"reikšmė")} turi būti ${J} ${U.maximum.toString()} ${g?.unit}`}case"too_small":{let z=u[U.origin]??U.origin,g=I(U.origin,u7(Number(U.minimum)),U.inclusive??!1,"bigger");if(g?.verb)return`${BI(z??U.origin??"reikšmė")} ${g.verb} ${U.minimum.toString()} ${g.unit??"elementų"}`;let J=U.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${BI(z??U.origin??"reikšmė")} turi būti ${J} ${U.minimum.toString()} ${g?.unit}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Eilutė privalo prasidėti "${z.prefix}"`;if(z.format==="ends_with")return`Eilutė privalo pasibaigti "${z.suffix}"`;if(z.format==="includes")return`Eilutė privalo įtraukti "${z.includes}"`;if(z.format==="regex")return`Eilutė privalo atitikti ${z.pattern}`;return`Neteisingas ${_[z.format]??U.format}`}case"not_multiple_of":return`Skaičius privalo būti ${U.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${U.keys.length>1?"i":"as"} rakt${U.keys.length>1?"ai":"as"}: ${W(U.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let z=u[U.origin]??U.origin;return`${BI(z??U.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function e8(){return{localeError:FA()}}var SA=()=>{let $={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function I(U){return $[U]??null}let _={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"},u={nan:"NaN",number:"број",array:"низа"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Грешен внес: се очекува instanceof ${U.expected}, примено ${J}`;return`Грешен внес: се очекува ${z}, примено ${J}`}case"invalid_value":if(U.values.length===1)return`Invalid input: expected ${A(U.values[0])}`;return`Грешана опција: се очекува една ${W(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Премногу голем: се очекува ${U.origin??"вредноста"} да има ${z}${U.maximum.toString()} ${g.unit??"елементи"}`;return`Премногу голем: се очекува ${U.origin??"вредноста"} да биде ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Премногу мал: се очекува ${U.origin} да има ${z}${U.minimum.toString()} ${g.unit}`;return`Премногу мал: се очекува ${U.origin} да биде ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Неважечка низа: мора да започнува со "${z.prefix}"`;if(z.format==="ends_with")return`Неважечка низа: мора да завршува со "${z.suffix}"`;if(z.format==="includes")return`Неважечка низа: мора да вклучува "${z.includes}"`;if(z.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${z.pattern}`;return`Invalid ${_[z.format]??U.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${U.divisor}`;case"unrecognized_keys":return`${U.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${W(U.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${U.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${U.origin}`;default:return"Грешен внес"}}};function s8(){return{localeError:SA()}}var wA=()=>{let $={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function I(U){return $[U]??null}let _={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},u={nan:"NaN",number:"nombor"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Input tidak sah: dijangka instanceof ${U.expected}, diterima ${J}`;return`Input tidak sah: dijangka ${z}, diterima ${J}`}case"invalid_value":if(U.values.length===1)return`Input tidak sah: dijangka ${A(U.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${W(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Terlalu besar: dijangka ${U.origin??"nilai"} ${g.verb} ${z}${U.maximum.toString()} ${g.unit??"elemen"}`;return`Terlalu besar: dijangka ${U.origin??"nilai"} adalah ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Terlalu kecil: dijangka ${U.origin} ${g.verb} ${z}${U.minimum.toString()} ${g.unit}`;return`Terlalu kecil: dijangka ${U.origin} adalah ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`String tidak sah: mesti bermula dengan "${z.prefix}"`;if(z.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${z.suffix}"`;if(z.format==="includes")return`String tidak sah: mesti mengandungi "${z.includes}"`;if(z.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${z.pattern}`;return`${_[z.format]??U.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${U.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${W(U.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${U.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${U.origin}`;default:return"Input tidak sah"}}};function $3(){return{localeError:wA()}}var EA=()=>{let $={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function I(U){return $[U]??null}let _={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},u={nan:"NaN",number:"getal"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Ongeldige invoer: verwacht instanceof ${U.expected}, ontving ${J}`;return`Ongeldige invoer: verwacht ${z}, ontving ${J}`}case"invalid_value":if(U.values.length===1)return`Ongeldige invoer: verwacht ${A(U.values[0])}`;return`Ongeldige optie: verwacht één van ${W(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin),J=U.origin==="date"?"laat":U.origin==="string"?"lang":"groot";if(g)return`Te ${J}: verwacht dat ${U.origin??"waarde"} ${z}${U.maximum.toString()} ${g.unit??"elementen"} ${g.verb}`;return`Te ${J}: verwacht dat ${U.origin??"waarde"} ${z}${U.maximum.toString()} is`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin),J=U.origin==="date"?"vroeg":U.origin==="string"?"kort":"klein";if(g)return`Te ${J}: verwacht dat ${U.origin} ${z}${U.minimum.toString()} ${g.unit} ${g.verb}`;return`Te ${J}: verwacht dat ${U.origin} ${z}${U.minimum.toString()} is`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Ongeldige tekst: moet met "${z.prefix}" beginnen`;if(z.format==="ends_with")return`Ongeldige tekst: moet op "${z.suffix}" eindigen`;if(z.format==="includes")return`Ongeldige tekst: moet "${z.includes}" bevatten`;if(z.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${z.pattern}`;return`Ongeldig: ${_[z.format]??U.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${U.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${U.keys.length>1?"s":""}: ${W(U.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${U.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${U.origin}`;default:return"Ongeldige invoer"}}};function I3(){return{localeError:EA()}}var CA=()=>{let $={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function I(U){return $[U]??null}let _={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},u={nan:"NaN",number:"tall",array:"liste"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Ugyldig input: forventet instanceof ${U.expected}, fikk ${J}`;return`Ugyldig input: forventet ${z}, fikk ${J}`}case"invalid_value":if(U.values.length===1)return`Ugyldig verdi: forventet ${A(U.values[0])}`;return`Ugyldig valg: forventet en av ${W(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`For stor(t): forventet ${U.origin??"value"} til å ha ${z}${U.maximum.toString()} ${g.unit??"elementer"}`;return`For stor(t): forventet ${U.origin??"value"} til å ha ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`For lite(n): forventet ${U.origin} til å ha ${z}${U.minimum.toString()} ${g.unit}`;return`For lite(n): forventet ${U.origin} til å ha ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Ugyldig streng: må starte med "${z.prefix}"`;if(z.format==="ends_with")return`Ugyldig streng: må ende med "${z.suffix}"`;if(z.format==="includes")return`Ugyldig streng: må inneholde "${z.includes}"`;if(z.format==="regex")return`Ugyldig streng: må matche mønsteret ${z.pattern}`;return`Ugyldig ${_[z.format]??U.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${U.divisor}`;case"unrecognized_keys":return`${U.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${W(U.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${U.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${U.origin}`;default:return"Ugyldig input"}}};function U3(){return{localeError:CA()}}var fA=()=>{let $={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function I(U){return $[U]??null}let _={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"},u={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Fâsit giren: umulan instanceof ${U.expected}, alınan ${J}`;return`Fâsit giren: umulan ${z}, alınan ${J}`}case"invalid_value":if(U.values.length===1)return`Fâsit giren: umulan ${A(U.values[0])}`;return`Fâsit tercih: mûteberler ${W(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Fazla büyük: ${U.origin??"value"}, ${z}${U.maximum.toString()} ${g.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${U.origin??"value"}, ${z}${U.maximum.toString()} olmalıydı.`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Fazla küçük: ${U.origin}, ${z}${U.minimum.toString()} ${g.unit} sahip olmalıydı.`;return`Fazla küçük: ${U.origin}, ${z}${U.minimum.toString()} olmalıydı.`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Fâsit metin: "${z.prefix}" ile başlamalı.`;if(z.format==="ends_with")return`Fâsit metin: "${z.suffix}" ile bitmeli.`;if(z.format==="includes")return`Fâsit metin: "${z.includes}" ihtivâ etmeli.`;if(z.format==="regex")return`Fâsit metin: ${z.pattern} nakşına uymalı.`;return`Fâsit ${_[z.format]??U.format}`}case"not_multiple_of":return`Fâsit sayı: ${U.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${U.keys.length>1?"s":""}: ${W(U.keys,", ")}`;case"invalid_key":return`${U.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${U.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function _3(){return{localeError:fA()}}var xA=()=>{let $={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function I(U){return $[U]??null}let _={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"},u={nan:"NaN",number:"عدد",array:"ارې"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`ناسم ورودي: باید instanceof ${U.expected} وای, مګر ${J} ترلاسه شو`;return`ناسم ورودي: باید ${z} وای, مګر ${J} ترلاسه شو`}case"invalid_value":if(U.values.length===1)return`ناسم ورودي: باید ${A(U.values[0])} وای`;return`ناسم انتخاب: باید یو له ${W(U.values,"|")} څخه وای`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`ډیر لوی: ${U.origin??"ارزښت"} باید ${z}${U.maximum.toString()} ${g.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${U.origin??"ارزښت"} باید ${z}${U.maximum.toString()} وي`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`ډیر کوچنی: ${U.origin} باید ${z}${U.minimum.toString()} ${g.unit} ولري`;return`ډیر کوچنی: ${U.origin} باید ${z}${U.minimum.toString()} وي`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`ناسم متن: باید د "${z.prefix}" سره پیل شي`;if(z.format==="ends_with")return`ناسم متن: باید د "${z.suffix}" سره پای ته ورسيږي`;if(z.format==="includes")return`ناسم متن: باید "${z.includes}" ولري`;if(z.format==="regex")return`ناسم متن: باید د ${z.pattern} سره مطابقت ولري`;return`${_[z.format]??U.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${U.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${U.keys.length>1?"کلیډونه":"کلیډ"}: ${W(U.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${U.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${U.origin} کې`;default:return"ناسمه ورودي"}}};function u3(){return{localeError:xA()}}var kA=()=>{let $={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function I(U){return $[U]??null}let _={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"},u={nan:"NaN",number:"liczba",array:"tablica"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${U.expected}, otrzymano ${J}`;return`Nieprawidłowe dane wejściowe: oczekiwano ${z}, otrzymano ${J}`}case"invalid_value":if(U.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${A(U.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${W(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Za duża wartość: oczekiwano, że ${U.origin??"wartość"} będzie mieć ${z}${U.maximum.toString()} ${g.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${U.origin??"wartość"} będzie wynosić ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Za mała wartość: oczekiwano, że ${U.origin??"wartość"} będzie mieć ${z}${U.minimum.toString()} ${g.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${U.origin??"wartość"} będzie wynosić ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${z.prefix}"`;if(z.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${z.suffix}"`;if(z.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${z.includes}"`;if(z.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${z.pattern}`;return`Nieprawidłow(y/a/e) ${_[z.format]??U.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${U.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${U.keys.length>1?"s":""}: ${W(U.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${U.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${U.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function z3(){return{localeError:kA()}}var yA=()=>{let $={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function I(U){return $[U]??null}let _={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},u={nan:"NaN",number:"número",null:"nulo"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Tipo inválido: esperado instanceof ${U.expected}, recebido ${J}`;return`Tipo inválido: esperado ${z}, recebido ${J}`}case"invalid_value":if(U.values.length===1)return`Entrada inválida: esperado ${A(U.values[0])}`;return`Opção inválida: esperada uma das ${W(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Muito grande: esperado que ${U.origin??"valor"} tivesse ${z}${U.maximum.toString()} ${g.unit??"elementos"}`;return`Muito grande: esperado que ${U.origin??"valor"} fosse ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Muito pequeno: esperado que ${U.origin} tivesse ${z}${U.minimum.toString()} ${g.unit}`;return`Muito pequeno: esperado que ${U.origin} fosse ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Texto inválido: deve começar com "${z.prefix}"`;if(z.format==="ends_with")return`Texto inválido: deve terminar com "${z.suffix}"`;if(z.format==="includes")return`Texto inválido: deve incluir "${z.includes}"`;if(z.format==="regex")return`Texto inválido: deve corresponder ao padrão ${z.pattern}`;return`${_[z.format]??U.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${U.divisor}`;case"unrecognized_keys":return`Chave${U.keys.length>1?"s":""} desconhecida${U.keys.length>1?"s":""}: ${W(U.keys,", ")}`;case"invalid_key":return`Chave inválida em ${U.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${U.origin}`;default:return"Campo inválido"}}};function g3(){return{localeError:yA()}}function z7($,I,_,u){let U=Math.abs($),z=U%10,g=U%100;if(g>=11&&g<=19)return u;if(z===1)return I;if(z>=2&&z<=4)return _;return u}var iA=()=>{let $={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function I(U){return $[U]??null}let _={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"},u={nan:"NaN",number:"число",array:"массив"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Неверный ввод: ожидалось instanceof ${U.expected}, получено ${J}`;return`Неверный ввод: ожидалось ${z}, получено ${J}`}case"invalid_value":if(U.values.length===1)return`Неверный ввод: ожидалось ${A(U.values[0])}`;return`Неверный вариант: ожидалось одно из ${W(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g){let J=Number(U.maximum),G=z7(J,g.unit.one,g.unit.few,g.unit.many);return`Слишком большое значение: ожидалось, что ${U.origin??"значение"} будет иметь ${z}${U.maximum.toString()} ${G}`}return`Слишком большое значение: ожидалось, что ${U.origin??"значение"} будет ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g){let J=Number(U.minimum),G=z7(J,g.unit.one,g.unit.few,g.unit.many);return`Слишком маленькое значение: ожидалось, что ${U.origin} будет иметь ${z}${U.minimum.toString()} ${G}`}return`Слишком маленькое значение: ожидалось, что ${U.origin} будет ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Неверная строка: должна начинаться с "${z.prefix}"`;if(z.format==="ends_with")return`Неверная строка: должна заканчиваться на "${z.suffix}"`;if(z.format==="includes")return`Неверная строка: должна содержать "${z.includes}"`;if(z.format==="regex")return`Неверная строка: должна соответствовать шаблону ${z.pattern}`;return`Неверный ${_[z.format]??U.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${U.divisor}`;case"unrecognized_keys":return`Нераспознанн${U.keys.length>1?"ые":"ый"} ключ${U.keys.length>1?"и":""}: ${W(U.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${U.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${U.origin}`;default:return"Неверные входные данные"}}};function J3(){return{localeError:iA()}}var lA=()=>{let $={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function I(U){return $[U]??null}let _={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"},u={nan:"NaN",number:"število",array:"tabela"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Neveljaven vnos: pričakovano instanceof ${U.expected}, prejeto ${J}`;return`Neveljaven vnos: pričakovano ${z}, prejeto ${J}`}case"invalid_value":if(U.values.length===1)return`Neveljaven vnos: pričakovano ${A(U.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${W(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Preveliko: pričakovano, da bo ${U.origin??"vrednost"} imelo ${z}${U.maximum.toString()} ${g.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${U.origin??"vrednost"} ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Premajhno: pričakovano, da bo ${U.origin} imelo ${z}${U.minimum.toString()} ${g.unit}`;return`Premajhno: pričakovano, da bo ${U.origin} ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Neveljaven niz: mora se začeti z "${z.prefix}"`;if(z.format==="ends_with")return`Neveljaven niz: mora se končati z "${z.suffix}"`;if(z.format==="includes")return`Neveljaven niz: mora vsebovati "${z.includes}"`;if(z.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${z.pattern}`;return`Neveljaven ${_[z.format]??U.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${U.divisor}`;case"unrecognized_keys":return`Neprepoznan${U.keys.length>1?"i ključi":" ključ"}: ${W(U.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${U.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${U.origin}`;default:return"Neveljaven vnos"}}};function G3(){return{localeError:lA()}}var mA=()=>{let $={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function I(U){return $[U]??null}let _={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},u={nan:"NaN",number:"antal",array:"lista"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Ogiltig inmatning: förväntat instanceof ${U.expected}, fick ${J}`;return`Ogiltig inmatning: förväntat ${z}, fick ${J}`}case"invalid_value":if(U.values.length===1)return`Ogiltig inmatning: förväntat ${A(U.values[0])}`;return`Ogiltigt val: förväntade en av ${W(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`För stor(t): förväntade ${U.origin??"värdet"} att ha ${z}${U.maximum.toString()} ${g.unit??"element"}`;return`För stor(t): förväntat ${U.origin??"värdet"} att ha ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`För lite(t): förväntade ${U.origin??"värdet"} att ha ${z}${U.minimum.toString()} ${g.unit}`;return`För lite(t): förväntade ${U.origin??"värdet"} att ha ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Ogiltig sträng: måste börja med "${z.prefix}"`;if(z.format==="ends_with")return`Ogiltig sträng: måste sluta med "${z.suffix}"`;if(z.format==="includes")return`Ogiltig sträng: måste innehålla "${z.includes}"`;if(z.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${z.pattern}"`;return`Ogiltig(t) ${_[z.format]??U.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${U.divisor}`;case"unrecognized_keys":return`${U.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${W(U.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${U.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${U.origin??"värdet"}`;default:return"Ogiltig input"}}};function q3(){return{localeError:mA()}}var rA=()=>{let $={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function I(U){return $[U]??null}let _={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"},u={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${U.expected}, பெறப்பட்டது ${J}`;return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${z}, பெறப்பட்டது ${J}`}case"invalid_value":if(U.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${A(U.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${W(U.values,"|")} இல் ஒன்று`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${U.origin??"மதிப்பு"} ${z}${U.maximum.toString()} ${g.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${U.origin??"மதிப்பு"} ${z}${U.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${U.origin} ${z}${U.minimum.toString()} ${g.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${U.origin} ${z}${U.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`தவறான சரம்: "${z.prefix}" இல் தொடங்க வேண்டும்`;if(z.format==="ends_with")return`தவறான சரம்: "${z.suffix}" இல் முடிவடைய வேண்டும்`;if(z.format==="includes")return`தவறான சரம்: "${z.includes}" ஐ உள்ளடக்க வேண்டும்`;if(z.format==="regex")return`தவறான சரம்: ${z.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${_[z.format]??U.format}`}case"not_multiple_of":return`தவறான எண்: ${U.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${U.keys.length>1?"கள்":""}: ${W(U.keys,", ")}`;case"invalid_key":return`${U.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${U.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function X3(){return{localeError:rA()}}var nA=()=>{let $={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function I(U){return $[U]??null}let _={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"},u={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${U.expected} แต่ได้รับ ${J}`;return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${z} แต่ได้รับ ${J}`}case"invalid_value":if(U.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${A(U.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${W(U.values,"|")}`;case"too_big":{let z=U.inclusive?"ไม่เกิน":"น้อยกว่า",g=I(U.origin);if(g)return`เกินกำหนด: ${U.origin??"ค่า"} ควรมี${z} ${U.maximum.toString()} ${g.unit??"รายการ"}`;return`เกินกำหนด: ${U.origin??"ค่า"} ควรมี${z} ${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?"อย่างน้อย":"มากกว่า",g=I(U.origin);if(g)return`น้อยกว่ากำหนด: ${U.origin} ควรมี${z} ${U.minimum.toString()} ${g.unit}`;return`น้อยกว่ากำหนด: ${U.origin} ควรมี${z} ${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${z.prefix}"`;if(z.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${z.suffix}"`;if(z.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${z.includes}" อยู่ในข้อความ`;if(z.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${z.pattern}`;return`รูปแบบไม่ถูกต้อง: ${_[z.format]??U.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${U.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${W(U.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${U.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${U.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function N3(){return{localeError:nA()}}var hA=()=>{let $={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function I(U){return $[U]??null}let _={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Geçersiz değer: beklenen instanceof ${U.expected}, alınan ${J}`;return`Geçersiz değer: beklenen ${z}, alınan ${J}`}case"invalid_value":if(U.values.length===1)return`Geçersiz değer: beklenen ${A(U.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${W(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Çok büyük: beklenen ${U.origin??"değer"} ${z}${U.maximum.toString()} ${g.unit??"öğe"}`;return`Çok büyük: beklenen ${U.origin??"değer"} ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Çok küçük: beklenen ${U.origin} ${z}${U.minimum.toString()} ${g.unit}`;return`Çok küçük: beklenen ${U.origin} ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Geçersiz metin: "${z.prefix}" ile başlamalı`;if(z.format==="ends_with")return`Geçersiz metin: "${z.suffix}" ile bitmeli`;if(z.format==="includes")return`Geçersiz metin: "${z.includes}" içermeli`;if(z.format==="regex")return`Geçersiz metin: ${z.pattern} desenine uymalı`;return`Geçersiz ${_[z.format]??U.format}`}case"not_multiple_of":return`Geçersiz sayı: ${U.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${U.keys.length>1?"lar":""}: ${W(U.keys,", ")}`;case"invalid_key":return`${U.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${U.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function Q3(){return{localeError:hA()}}var dA=()=>{let $={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function I(U){return $[U]??null}let _={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"},u={nan:"NaN",number:"число",array:"масив"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Неправильні вхідні дані: очікується instanceof ${U.expected}, отримано ${J}`;return`Неправильні вхідні дані: очікується ${z}, отримано ${J}`}case"invalid_value":if(U.values.length===1)return`Неправильні вхідні дані: очікується ${A(U.values[0])}`;return`Неправильна опція: очікується одне з ${W(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Занадто велике: очікується, що ${U.origin??"значення"} ${g.verb} ${z}${U.maximum.toString()} ${g.unit??"елементів"}`;return`Занадто велике: очікується, що ${U.origin??"значення"} буде ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Занадто мале: очікується, що ${U.origin} ${g.verb} ${z}${U.minimum.toString()} ${g.unit}`;return`Занадто мале: очікується, що ${U.origin} буде ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Неправильний рядок: повинен починатися з "${z.prefix}"`;if(z.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${z.suffix}"`;if(z.format==="includes")return`Неправильний рядок: повинен містити "${z.includes}"`;if(z.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${z.pattern}`;return`Неправильний ${_[z.format]??U.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${U.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${U.keys.length>1?"і":""}: ${W(U.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${U.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${U.origin}`;default:return"Неправильні вхідні дані"}}};function DI(){return{localeError:dA()}}function v3(){return DI()}var cA=()=>{let $={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function I(U){return $[U]??null}let _={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"},u={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`غلط ان پٹ: instanceof ${U.expected} متوقع تھا، ${J} موصول ہوا`;return`غلط ان پٹ: ${z} متوقع تھا، ${J} موصول ہوا`}case"invalid_value":if(U.values.length===1)return`غلط ان پٹ: ${A(U.values[0])} متوقع تھا`;return`غلط آپشن: ${W(U.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`بہت بڑا: ${U.origin??"ویلیو"} کے ${z}${U.maximum.toString()} ${g.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${U.origin??"ویلیو"} کا ${z}${U.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`بہت چھوٹا: ${U.origin} کے ${z}${U.minimum.toString()} ${g.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${U.origin} کا ${z}${U.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`غلط سٹرنگ: "${z.prefix}" سے شروع ہونا چاہیے`;if(z.format==="ends_with")return`غلط سٹرنگ: "${z.suffix}" پر ختم ہونا چاہیے`;if(z.format==="includes")return`غلط سٹرنگ: "${z.includes}" شامل ہونا چاہیے`;if(z.format==="regex")return`غلط سٹرنگ: پیٹرن ${z.pattern} سے میچ ہونا چاہیے`;return`غلط ${_[z.format]??U.format}`}case"not_multiple_of":return`غلط نمبر: ${U.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${U.keys.length>1?"ز":""}: ${W(U.keys,"، ")}`;case"invalid_key":return`${U.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${U.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function H3(){return{localeError:cA()}}var pA=()=>{let $={string:{unit:"belgi",verb:"bo‘lishi kerak"},file:{unit:"bayt",verb:"bo‘lishi kerak"},array:{unit:"element",verb:"bo‘lishi kerak"},set:{unit:"element",verb:"bo‘lishi kerak"}};function I(U){return $[U]??null}let _={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},u={nan:"NaN",number:"raqam",array:"massiv"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Noto‘g‘ri kirish: kutilgan instanceof ${U.expected}, qabul qilingan ${J}`;return`Noto‘g‘ri kirish: kutilgan ${z}, qabul qilingan ${J}`}case"invalid_value":if(U.values.length===1)return`Noto‘g‘ri kirish: kutilgan ${A(U.values[0])}`;return`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${W(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Juda katta: kutilgan ${U.origin??"qiymat"} ${z}${U.maximum.toString()} ${g.unit} ${g.verb}`;return`Juda katta: kutilgan ${U.origin??"qiymat"} ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Juda kichik: kutilgan ${U.origin} ${z}${U.minimum.toString()} ${g.unit} ${g.verb}`;return`Juda kichik: kutilgan ${U.origin} ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Noto‘g‘ri satr: "${z.prefix}" bilan boshlanishi kerak`;if(z.format==="ends_with")return`Noto‘g‘ri satr: "${z.suffix}" bilan tugashi kerak`;if(z.format==="includes")return`Noto‘g‘ri satr: "${z.includes}" ni o‘z ichiga olishi kerak`;if(z.format==="regex")return`Noto‘g‘ri satr: ${z.pattern} shabloniga mos kelishi kerak`;return`Noto‘g‘ri ${_[z.format]??U.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${U.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${U.keys.length>1?"lar":""}: ${W(U.keys,", ")}`;case"invalid_key":return`${U.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${U.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};function Y3(){return{localeError:pA()}}var oA=()=>{let $={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function I(U){return $[U]??null}let _={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"},u={nan:"NaN",number:"số",array:"mảng"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Đầu vào không hợp lệ: mong đợi instanceof ${U.expected}, nhận được ${J}`;return`Đầu vào không hợp lệ: mong đợi ${z}, nhận được ${J}`}case"invalid_value":if(U.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${A(U.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${W(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Quá lớn: mong đợi ${U.origin??"giá trị"} ${g.verb} ${z}${U.maximum.toString()} ${g.unit??"phần tử"}`;return`Quá lớn: mong đợi ${U.origin??"giá trị"} ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Quá nhỏ: mong đợi ${U.origin} ${g.verb} ${z}${U.minimum.toString()} ${g.unit}`;return`Quá nhỏ: mong đợi ${U.origin} ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${z.prefix}"`;if(z.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${z.suffix}"`;if(z.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${z.includes}"`;if(z.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${z.pattern}`;return`${_[z.format]??U.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${U.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${W(U.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${U.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${U.origin}`;default:return"Đầu vào không hợp lệ"}}};function O3(){return{localeError:oA()}}var tA=()=>{let $={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function I(U){return $[U]??null}let _={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"},u={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`无效输入:期望 instanceof ${U.expected},实际接收 ${J}`;return`无效输入:期望 ${z},实际接收 ${J}`}case"invalid_value":if(U.values.length===1)return`无效输入:期望 ${A(U.values[0])}`;return`无效选项:期望以下之一 ${W(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`数值过大:期望 ${U.origin??"值"} ${z}${U.maximum.toString()} ${g.unit??"个元素"}`;return`数值过大:期望 ${U.origin??"值"} ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`数值过小:期望 ${U.origin} ${z}${U.minimum.toString()} ${g.unit}`;return`数值过小:期望 ${U.origin} ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`无效字符串:必须以 "${z.prefix}" 开头`;if(z.format==="ends_with")return`无效字符串:必须以 "${z.suffix}" 结尾`;if(z.format==="includes")return`无效字符串:必须包含 "${z.includes}"`;if(z.format==="regex")return`无效字符串:必须满足正则表达式 ${z.pattern}`;return`无效${_[z.format]??U.format}`}case"not_multiple_of":return`无效数字:必须是 ${U.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${W(U.keys,", ")}`;case"invalid_key":return`${U.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${U.origin} 中包含无效值(value)`;default:return"无效输入"}}};function T3(){return{localeError:tA()}}var aA=()=>{let $={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function I(U){return $[U]??null}let _={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`無效的輸入值:預期為 instanceof ${U.expected},但收到 ${J}`;return`無效的輸入值:預期為 ${z},但收到 ${J}`}case"invalid_value":if(U.values.length===1)return`無效的輸入值:預期為 ${A(U.values[0])}`;return`無效的選項:預期為以下其中之一 ${W(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`數值過大:預期 ${U.origin??"值"} 應為 ${z}${U.maximum.toString()} ${g.unit??"個元素"}`;return`數值過大:預期 ${U.origin??"值"} 應為 ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`數值過小:預期 ${U.origin} 應為 ${z}${U.minimum.toString()} ${g.unit}`;return`數值過小:預期 ${U.origin} 應為 ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`無效的字串:必須以 "${z.prefix}" 開頭`;if(z.format==="ends_with")return`無效的字串:必須以 "${z.suffix}" 結尾`;if(z.format==="includes")return`無效的字串:必須包含 "${z.includes}"`;if(z.format==="regex")return`無效的字串:必須符合格式 ${z.pattern}`;return`無效的 ${_[z.format]??U.format}`}case"not_multiple_of":return`無效的數字:必須為 ${U.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${U.keys.length>1?"們":""}:${W(U.keys,"、")}`;case"invalid_key":return`${U.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${U.origin} 中有無效的值`;default:return"無效的輸入值"}}};function B3(){return{localeError:aA()}}var eA=()=>{let $={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function I(U){return $[U]??null}let _={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"},u={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return(U)=>{switch(U.code){case"invalid_type":{let z=u[U.expected]??U.expected,g=j(U.input),J=u[g]??g;if(/^[A-Z]/.test(U.expected))return`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${U.expected}, àmọ̀ a rí ${J}`;return`Ìbáwọlé aṣìṣe: a ní láti fi ${z}, àmọ̀ a rí ${J}`}case"invalid_value":if(U.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${A(U.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${W(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",g=I(U.origin);if(g)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${U.origin??"iye"} ${g.verb} ${z}${U.maximum} ${g.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${z}${U.maximum}`}case"too_small":{let z=U.inclusive?">=":">",g=I(U.origin);if(g)return`Kéré ju: a ní láti jẹ́ pé ${U.origin} ${g.verb} ${z}${U.minimum} ${g.unit}`;return`Kéré ju: a ní láti jẹ́ ${z}${U.minimum}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${z.prefix}"`;if(z.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${z.suffix}"`;if(z.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${z.includes}"`;if(z.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${z.pattern}`;return`Aṣìṣe: ${_[z.format]??U.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${U.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${W(U.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${U.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${U.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function D3(){return{localeError:eA()}}var g7,M3=Symbol("ZodOutput"),K3=Symbol("ZodInput");class V3{constructor(){this._map=new WeakMap,this._idmap=new Map}add($,...I){let _=I[0];if(this._map.set($,_),_&&typeof _==="object"&&"id"in _)this._idmap.set(_.id,$);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove($){let I=this._map.get($);if(I&&typeof I==="object"&&"id"in I)this._idmap.delete(I.id);return this._map.delete($),this}get($){let I=$._zod.parent;if(I){let _={...this.get(I)??{}};delete _.id;let u={..._,...this._map.get($)};return Object.keys(u).length?u:void 0}return this._map.get($)}has($){return this._map.has($)}}function Z_(){return new V3}(g7=globalThis).__zod_globalRegistry??(g7.__zod_globalRegistry=Z_());var S$=globalThis.__zod_globalRegistry;function R3($,I){return new $({type:"string",...E(I)})}function L3($,I){return new $({type:"string",coerce:!0,...E(I)})}function W_($,I){return new $({type:"string",format:"email",check:"string_format",abort:!1,...E(I)})}function KI($,I){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...E(I)})}function P_($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...E(I)})}function b_($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...E(I)})}function A_($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...E(I)})}function j_($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...E(I)})}function VI($,I){return new $({type:"string",format:"url",check:"string_format",abort:!1,...E(I)})}function F_($,I){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...E(I)})}function S_($,I){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...E(I)})}function w_($,I){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...E(I)})}function E_($,I){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...E(I)})}function C_($,I){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...E(I)})}function f_($,I){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...E(I)})}function x_($,I){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...E(I)})}function k_($,I){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...E(I)})}function y_($,I){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...E(I)})}function Z3($,I){return new $({type:"string",format:"mac",check:"string_format",abort:!1,...E(I)})}function i_($,I){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...E(I)})}function l_($,I){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...E(I)})}function m_($,I){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...E(I)})}function r_($,I){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...E(I)})}function n_($,I){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...E(I)})}function h_($,I){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...E(I)})}var W3={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function P3($,I){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...E(I)})}function b3($,I){return new $({type:"string",format:"date",check:"string_format",...E(I)})}function A3($,I){return new $({type:"string",format:"time",check:"string_format",precision:null,...E(I)})}function j3($,I){return new $({type:"string",format:"duration",check:"string_format",...E(I)})}function F3($,I){return new $({type:"number",checks:[],...E(I)})}function S3($,I){return new $({type:"number",coerce:!0,checks:[],...E(I)})}function w3($,I){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...E(I)})}function E3($,I){return new $({type:"number",check:"number_format",abort:!1,format:"float32",...E(I)})}function C3($,I){return new $({type:"number",check:"number_format",abort:!1,format:"float64",...E(I)})}function f3($,I){return new $({type:"number",check:"number_format",abort:!1,format:"int32",...E(I)})}function x3($,I){return new $({type:"number",check:"number_format",abort:!1,format:"uint32",...E(I)})}function k3($,I){return new $({type:"boolean",...E(I)})}function y3($,I){return new $({type:"boolean",coerce:!0,...E(I)})}function i3($,I){return new $({type:"bigint",...E(I)})}function l3($,I){return new $({type:"bigint",coerce:!0,...E(I)})}function m3($,I){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...E(I)})}function r3($,I){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...E(I)})}function n3($,I){return new $({type:"symbol",...E(I)})}function h3($,I){return new $({type:"undefined",...E(I)})}function d3($,I){return new $({type:"null",...E(I)})}function c3($){return new $({type:"any"})}function p3($){return new $({type:"unknown"})}function o3($,I){return new $({type:"never",...E(I)})}function t3($,I){return new $({type:"void",...E(I)})}function a3($,I){return new $({type:"date",...E(I)})}function e3($,I){return new $({type:"date",coerce:!0,...E(I)})}function s3($,I){return new $({type:"nan",...E(I)})}function f4($,I){return new v_({check:"less_than",...E(I),value:$,inclusive:!1})}function u4($,I){return new v_({check:"less_than",...E(I),value:$,inclusive:!0})}function x4($,I){return new H_({check:"greater_than",...E(I),value:$,inclusive:!1})}function l$($,I){return new H_({check:"greater_than",...E(I),value:$,inclusive:!0})}function d_($){return x4(0,$)}function c_($){return f4(0,$)}function p_($){return u4(0,$)}function o_($){return l$(0,$)}function L6($,I){return new sg({check:"multiple_of",...E(I),value:$})}function Z6($,I){return new UJ({check:"max_size",...E(I),maximum:$})}function k4($,I){return new _J({check:"min_size",...E(I),minimum:$})}function $1($,I){return new uJ({check:"size_equals",...E(I),size:$})}function I1($,I){return new zJ({check:"max_length",...E(I),maximum:$})}function t4($,I){return new gJ({check:"min_length",...E(I),minimum:$})}function U1($,I){return new JJ({check:"length_equals",...E(I),length:$})}function n1($,I){return new GJ({check:"string_format",format:"regex",...E(I),pattern:$})}function h1($){return new qJ({check:"string_format",format:"lowercase",...E($)})}function d1($){return new XJ({check:"string_format",format:"uppercase",...E($)})}function c1($,I){return new NJ({check:"string_format",format:"includes",...E(I),includes:$})}function p1($,I){return new QJ({check:"string_format",format:"starts_with",...E(I),prefix:$})}function o1($,I){return new vJ({check:"string_format",format:"ends_with",...E(I),suffix:$})}function t_($,I,_){return new HJ({check:"property",property:$,schema:I,...E(_)})}function t1($,I){return new YJ({check:"mime_type",mime:$,...E(I)})}function K4($){return new OJ({check:"overwrite",tx:$})}function a1($){return K4((I)=>I.normalize($))}function e1(){return K4(($)=>$.trim())}function s1(){return K4(($)=>$.toLowerCase())}function $0(){return K4(($)=>$.toUpperCase())}function I0(){return K4(($)=>Hg($))}function $9($,I,_){return new $({type:"array",element:I,...E(_)})}function $j($,I,_){return new $({type:"union",options:I,...E(_)})}function Ij($,I,_){return new $({type:"union",options:I,inclusive:!1,...E(_)})}function Uj($,I,_,u){return new $({type:"union",options:_,discriminator:I,...E(u)})}function _j($,I,_){return new $({type:"intersection",left:I,right:_})}function uj($,I,_,u){let U=_ instanceof n;return new $({type:"tuple",items:I,rest:U?_:null,...E(U?u:_)})}function zj($,I,_,u){return new $({type:"record",keyType:I,valueType:_,...E(u)})}function gj($,I,_,u){return new $({type:"map",keyType:I,valueType:_,...E(u)})}function Jj($,I,_){return new $({type:"set",valueType:I,...E(_)})}function Gj($,I,_){let u=Array.isArray(I)?Object.fromEntries(I.map((U)=>[U,U])):I;return new $({type:"enum",entries:u,...E(_)})}function qj($,I,_){return new $({type:"enum",entries:I,...E(_)})}function Xj($,I,_){return new $({type:"literal",values:Array.isArray(I)?I:[I],...E(_)})}function I9($,I){return new $({type:"file",...E(I)})}function Nj($,I){return new $({type:"transform",transform:I})}function Qj($,I){return new $({type:"optional",innerType:I})}function vj($,I){return new $({type:"nullable",innerType:I})}function Hj($,I,_){return new $({type:"default",innerType:I,get defaultValue(){return typeof _==="function"?_():Og(_)}})}function Yj($,I,_){return new $({type:"nonoptional",innerType:I,...E(_)})}function Oj($,I){return new $({type:"success",innerType:I})}function Tj($,I,_){return new $({type:"catch",innerType:I,catchValue:typeof _==="function"?_:()=>_})}function Bj($,I,_){return new $({type:"pipe",in:I,out:_})}function Dj($,I){return new $({type:"readonly",innerType:I})}function Mj($,I,_){return new $({type:"template_literal",parts:I,...E(_)})}function Kj($,I){return new $({type:"lazy",getter:I})}function Vj($,I){return new $({type:"promise",innerType:I})}function U9($,I,_){let u=E(_);return u.abort??(u.abort=!0),new $({type:"custom",check:"custom",fn:I,...u})}function _9($,I,_){return new $({type:"custom",check:"custom",fn:I,...E(_)})}function u9($){let I=J7((_)=>{return _.addIssue=(u)=>{if(typeof u==="string")_.issues.push(x1(u,_.value,I._zod.def));else{let U=u;if(U.fatal)U.continue=!1;U.code??(U.code="custom"),U.input??(U.input=_.value),U.inst??(U.inst=I),U.continue??(U.continue=!I._zod.def.abort),_.issues.push(x1(U))}},$(_.value,_)});return I}function J7($,I){let _=new X$({check:"custom",...E(I)});return _._zod.check=$,_}function z9($){let I=new X$({check:"describe"});return I._zod.onattach=[(_)=>{let u=S$.get(_)??{};S$.add(_,{...u,description:$})}],I._zod.check=()=>{},I}function g9($){let I=new X$({check:"meta"});return I._zod.onattach=[(_)=>{let u=S$.get(_)??{};S$.add(_,{...u,...$})}],I._zod.check=()=>{},I}function J9($,I){let _=E(I),u=_.truthy??["true","1","yes","on","y","enabled"],U=_.falsy??["false","0","no","off","n","disabled"];if(_.case!=="sensitive")u=u.map((H)=>typeof H==="string"?H.toLowerCase():H),U=U.map((H)=>typeof H==="string"?H.toLowerCase():H);let z=new Set(u),g=new Set(U),J=$.Codec??YI,G=$.Boolean??vI,N=new($.String??s6)({type:"string",error:_.error}),X=new G({type:"boolean",error:_.error}),Q=new J({type:"pipe",in:N,out:X,transform:(H,Y)=>{let v=H;if(_.case!=="sensitive")v=v.toLowerCase();if(z.has(v))return!0;else if(g.has(v))return!1;else return Y.issues.push({code:"invalid_value",expected:"stringbool",values:[...z,...g],input:Y.value,inst:Q,continue:!1}),{}},reverseTransform:(H,Y)=>{if(H===!0)return u[0]||"true";else return U[0]||"false"},error:_.error});return Q}function U0($,I,_,u={}){let U=E(u),z={...E(u),check:"string_format",type:"string",format:I,fn:typeof _==="function"?_:(J)=>_.test(J),...U};if(_ instanceof RegExp)z.pattern=_;return new $(z)}function W6($){let I=$?.target??"draft-2020-12";if(I==="draft-4")I="draft-04";if(I==="draft-7")I="draft-07";return{processors:$.processors??{},metadataRegistry:$?.metadata??S$,target:I,unrepresentable:$?.unrepresentable??"throw",override:$?.override??(()=>{}),io:$?.io??"output",counter:0,seen:new Map,cycles:$?.cycles??"ref",reused:$?.reused??"inline",external:$?.external??void 0}}function u$($,I,_={path:[],schemaPath:[]}){var u;let U=$._zod.def,z=I.seen.get($);if(z){if(z.count++,_.schemaPath.includes($))z.cycle=_.path;return z.schema}let g={schema:{},count:1,cycle:void 0,path:_.path};I.seen.set($,g);let J=$._zod.toJSONSchema?.();if(J)g.schema=J;else{let N={..._,schemaPath:[..._.schemaPath,$],path:_.path};if($._zod.processJSONSchema)$._zod.processJSONSchema(I,g.schema,N);else{let Q=g.schema,H=I.processors[U.type];if(!H)throw Error(`[toJSONSchema]: Non-representable type encountered: ${U.type}`);H($,I,Q,N)}let X=$._zod.parent;if(X){if(!g.ref)g.ref=X;u$(X,I,N),I.seen.get(X).isParent=!0}}let G=I.metadataRegistry.get($);if(G)Object.assign(g.schema,G);if(I.io==="input"&&m$($))delete g.schema.examples,delete g.schema.default;if(I.io==="input"&&g.schema._prefault)(u=g.schema).default??(u.default=g.schema._prefault);return delete g.schema._prefault,I.seen.get($).schema}function P6($,I){let _=$.seen.get(I);if(!_)throw Error("Unprocessed schema. This is a bug in Zod.");let u=new Map;for(let g of $.seen.entries()){let J=$.metadataRegistry.get(g[0])?.id;if(J){let G=u.get(J);if(G&&G!==g[0])throw Error(`Duplicate schema id "${J}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);u.set(J,g[0])}}let U=(g)=>{let J=$.target==="draft-2020-12"?"$defs":"definitions";if($.external){let X=$.external.registry.get(g[0])?.id,Q=$.external.uri??((Y)=>Y);if(X)return{ref:Q(X)};let H=g[1].defId??g[1].schema.id??`schema${$.counter++}`;return g[1].defId=H,{defId:H,ref:`${Q("__shared")}#/${J}/${H}`}}if(g[1]===_)return{ref:"#"};let q=`${"#"}/${J}/`,N=g[1].schema.id??`__schema${$.counter++}`;return{defId:N,ref:q+N}},z=(g)=>{if(g[1].schema.$ref)return;let J=g[1],{ref:G,defId:q}=U(g);if(J.def={...J.schema},q)J.defId=q;let N=J.schema;for(let X in N)delete N[X];N.$ref=G};if($.cycles==="throw")for(let g of $.seen.entries()){let J=g[1];if(J.cycle)throw Error(`Cycle detected: #/${J.cycle?.join("/")}/<root>
|
|
310
310
|
|
|
311
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let g of $.seen.entries()){let J=g[1];if(I===g[0]){z(g);continue}if($.external){let v=$.external.registry.get(g[0])?.id;if(I!==g[0]&&v){z(g);continue}}if($.metadataRegistry.get(g[0])?.id){z(g);continue}if(J.cycle){z(g);continue}if(J.count>1){if($.reused==="ref"){z(g);continue}}}}function W6($,I){let _=$.seen.get(I);if(!_)throw Error("Unprocessed schema. This is a bug in Zod.");let u=(g)=>{let J=$.seen.get(g);if(J.ref===null)return;let G=J.def??J.schema,v={...G},X=J.ref;if(J.ref=null,X){u(X);let N=$.seen.get(X),Y=N.schema;if(Y.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))G.allOf=G.allOf??[],G.allOf.push(Y);else Object.assign(G,Y);if(Object.assign(G,v),g._zod.parent===X)for(let Q in G){if(Q==="$ref"||Q==="allOf")continue;if(!(Q in v))delete G[Q]}if(Y.$ref&&N.def)for(let Q in G){if(Q==="$ref"||Q==="allOf")continue;if(Q in N.def&&JSON.stringify(G[Q])===JSON.stringify(N.def[Q]))delete G[Q]}}let q=g._zod.parent;if(q&&q!==X){u(q);let N=$.seen.get(q);if(N?.schema.$ref){if(G.$ref=N.schema.$ref,N.def)for(let Y in G){if(Y==="$ref"||Y==="allOf")continue;if(Y in N.def&&JSON.stringify(G[Y])===JSON.stringify(N.def[Y]))delete G[Y]}}}$.override({zodSchema:g,jsonSchema:G,path:J.path??[]})};for(let g of[...$.seen.entries()].reverse())u(g[0]);let U={};if($.target==="draft-2020-12")U.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")U.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")U.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let g=$.external.registry.get(I)?.id;if(!g)throw Error("Schema is missing an `id` property");U.$id=$.external.uri(g)}Object.assign(U,_.def??_.schema);let z=$.external?.defs??{};for(let g of $.seen.entries()){let J=g[1];if(J.def&&J.defId)z[J.defId]=J.def}if($.external);else if(Object.keys(z).length>0)if($.target==="draft-2020-12")U.$defs=z;else U.definitions=z;try{let g=JSON.parse(JSON.stringify(U));return Object.defineProperty(g,"~standard",{value:{...I["~standard"],jsonSchema:{input:u0(I,"input",$.processors),output:u0(I,"output",$.processors)}},enumerable:!1,writable:!1}),g}catch(g){throw Error("Error converting schema to JSON.")}}function r$($,I){let _=I??{seen:new Set};if(_.seen.has($))return!1;_.seen.add($);let u=$._zod.def;if(u.type==="transform")return!0;if(u.type==="array")return r$(u.element,_);if(u.type==="set")return r$(u.valueType,_);if(u.type==="lazy")return r$(u.getter(),_);if(u.type==="promise"||u.type==="optional"||u.type==="nonoptional"||u.type==="nullable"||u.type==="readonly"||u.type==="default"||u.type==="prefault")return r$(u.innerType,_);if(u.type==="intersection")return r$(u.left,_)||r$(u.right,_);if(u.type==="record"||u.type==="map")return r$(u.keyType,_)||r$(u.valueType,_);if(u.type==="pipe")return r$(u.in,_)||r$(u.out,_);if(u.type==="object"){for(let U in u.shape)if(r$(u.shape[U],_))return!0;return!1}if(u.type==="union"){for(let U of u.options)if(r$(U,_))return!0;return!1}if(u.type==="tuple"){for(let U of u.items)if(r$(U,_))return!0;if(u.rest&&r$(u.rest,_))return!0;return!1}return!1}var X9=($,I={})=>(_)=>{let u=R6({..._,processors:I});return u$($,u),Z6(u,$),W6(u,$)},u0=($,I,_={})=>(u)=>{let{libraryOptions:U,target:z}=u??{},g=R6({...U??{},target:z,io:I,processors:_});return u$($,g),Z6(g,$),W6(g,$)};var Vj={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},N9=($,I,_,u)=>{let U=_;U.type="string";let{minimum:z,maximum:g,format:J,patterns:G,contentEncoding:v}=$._zod.bag;if(typeof z==="number")U.minLength=z;if(typeof g==="number")U.maxLength=g;if(J){if(U.format=Vj[J]??J,U.format==="")delete U.format;if(J==="time")delete U.format}if(v)U.contentEncoding=v;if(G&&G.size>0){let X=[...G];if(X.length===1)U.pattern=X[0].source;else if(X.length>1)U.allOf=[...X.map((q)=>({...I.target==="draft-07"||I.target==="draft-04"||I.target==="openapi-3.0"?{type:"string"}:{},pattern:q.source}))]}},Q9=($,I,_,u)=>{let U=_,{minimum:z,maximum:g,format:J,multipleOf:G,exclusiveMaximum:v,exclusiveMinimum:X}=$._zod.bag;if(typeof J==="string"&&J.includes("int"))U.type="integer";else U.type="number";if(typeof X==="number")if(I.target==="draft-04"||I.target==="openapi-3.0")U.minimum=X,U.exclusiveMinimum=!0;else U.exclusiveMinimum=X;if(typeof z==="number"){if(U.minimum=z,typeof X==="number"&&I.target!=="draft-04")if(X>=z)delete U.minimum;else delete U.exclusiveMinimum}if(typeof v==="number")if(I.target==="draft-04"||I.target==="openapi-3.0")U.maximum=v,U.exclusiveMaximum=!0;else U.exclusiveMaximum=v;if(typeof g==="number"){if(U.maximum=g,typeof v==="number"&&I.target!=="draft-04")if(v<=g)delete U.maximum;else delete U.exclusiveMaximum}if(typeof G==="number")U.multipleOf=G},Y9=($,I,_,u)=>{_.type="boolean"},H9=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},O9=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},T9=($,I,_,u)=>{if(I.target==="openapi-3.0")_.type="string",_.nullable=!0,_.enum=[null];else _.type="null"},B9=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},D9=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},M9=($,I,_,u)=>{_.not={}},K9=($,I,_,u)=>{},V9=($,I,_,u)=>{},L9=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},R9=($,I,_,u)=>{let U=$._zod.def,z=_I(U.entries);if(z.every((g)=>typeof g==="number"))_.type="number";if(z.every((g)=>typeof g==="string"))_.type="string";_.enum=z},Z9=($,I,_,u)=>{let U=$._zod.def,z=[];for(let g of U.values)if(g===void 0){if(I.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof g==="bigint")if(I.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else z.push(Number(g));else z.push(g);if(z.length===0);else if(z.length===1){let g=z[0];if(_.type=g===null?"null":typeof g,I.target==="draft-04"||I.target==="openapi-3.0")_.enum=[g];else _.const=g}else{if(z.every((g)=>typeof g==="number"))_.type="number";if(z.every((g)=>typeof g==="string"))_.type="string";if(z.every((g)=>typeof g==="boolean"))_.type="boolean";if(z.every((g)=>g===null))_.type="null";_.enum=z}},W9=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},P9=($,I,_,u)=>{let U=_,z=$._zod.pattern;if(!z)throw Error("Pattern not found in template literal");U.type="string",U.pattern=z.source},b9=($,I,_,u)=>{let U=_,z={type:"string",format:"binary",contentEncoding:"binary"},{minimum:g,maximum:J,mime:G}=$._zod.bag;if(g!==void 0)z.minLength=g;if(J!==void 0)z.maxLength=J;if(G)if(G.length===1)z.contentMediaType=G[0],Object.assign(U,z);else Object.assign(U,z),U.anyOf=G.map((v)=>({contentMediaType:v}));else Object.assign(U,z)},A9=($,I,_,u)=>{_.type="boolean"},j9=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},F9=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},S9=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},w9=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},E9=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},C9=($,I,_,u)=>{let U=_,z=$._zod.def,{minimum:g,maximum:J}=$._zod.bag;if(typeof g==="number")U.minItems=g;if(typeof J==="number")U.maxItems=J;U.type="array",U.items=u$(z.element,I,{...u,path:[...u.path,"items"]})},f9=($,I,_,u)=>{let U=_,z=$._zod.def;U.type="object",U.properties={};let g=z.shape;for(let v in g)U.properties[v]=u$(g[v],I,{...u,path:[...u.path,"properties",v]});let J=new Set(Object.keys(g)),G=new Set([...J].filter((v)=>{let X=z.shape[v]._zod;if(I.io==="input")return X.optin===void 0;else return X.optout===void 0}));if(G.size>0)U.required=Array.from(G);if(z.catchall?._zod.def.type==="never")U.additionalProperties=!1;else if(!z.catchall){if(I.io==="output")U.additionalProperties=!1}else if(z.catchall)U.additionalProperties=u$(z.catchall,I,{...u,path:[...u.path,"additionalProperties"]})},e_=($,I,_,u)=>{let U=$._zod.def,z=U.inclusive===!1,g=U.options.map((J,G)=>u$(J,I,{...u,path:[...u.path,z?"oneOf":"anyOf",G]}));if(z)_.oneOf=g;else _.anyOf=g},x9=($,I,_,u)=>{let U=$._zod.def,z=u$(U.left,I,{...u,path:[...u.path,"allOf",0]}),g=u$(U.right,I,{...u,path:[...u.path,"allOf",1]}),J=(v)=>("allOf"in v)&&Object.keys(v).length===1,G=[...J(z)?z.allOf:[z],...J(g)?g.allOf:[g]];_.allOf=G},k9=($,I,_,u)=>{let U=_,z=$._zod.def;U.type="array";let g=I.target==="draft-2020-12"?"prefixItems":"items",J=I.target==="draft-2020-12"?"items":I.target==="openapi-3.0"?"items":"additionalItems",G=z.items.map((N,Y)=>u$(N,I,{...u,path:[...u.path,g,Y]})),v=z.rest?u$(z.rest,I,{...u,path:[...u.path,J,...I.target==="openapi-3.0"?[z.items.length]:[]]}):null;if(I.target==="draft-2020-12"){if(U.prefixItems=G,v)U.items=v}else if(I.target==="openapi-3.0"){if(U.items={anyOf:G},v)U.items.anyOf.push(v);if(U.minItems=G.length,!v)U.maxItems=G.length}else if(U.items=G,v)U.additionalItems=v;let{minimum:X,maximum:q}=$._zod.bag;if(typeof X==="number")U.minItems=X;if(typeof q==="number")U.maxItems=q},y9=($,I,_,u)=>{let U=_,z=$._zod.def;U.type="object";let g=z.keyType,G=g._zod.bag?.patterns;if(z.mode==="loose"&&G&&G.size>0){let X=u$(z.valueType,I,{...u,path:[...u.path,"patternProperties","*"]});U.patternProperties={};for(let q of G)U.patternProperties[q.source]=X}else{if(I.target==="draft-07"||I.target==="draft-2020-12")U.propertyNames=u$(z.keyType,I,{...u,path:[...u.path,"propertyNames"]});U.additionalProperties=u$(z.valueType,I,{...u,path:[...u.path,"additionalProperties"]})}let v=g._zod.values;if(v){let X=[...v].filter((q)=>typeof q==="string"||typeof q==="number");if(X.length>0)U.required=X}},i9=($,I,_,u)=>{let U=$._zod.def,z=u$(U.innerType,I,u),g=I.seen.get($);if(I.target==="openapi-3.0")g.ref=U.innerType,_.nullable=!0;else _.anyOf=[z,{type:"null"}]},l9=($,I,_,u)=>{let U=$._zod.def;u$(U.innerType,I,u);let z=I.seen.get($);z.ref=U.innerType},r9=($,I,_,u)=>{let U=$._zod.def;u$(U.innerType,I,u);let z=I.seen.get($);z.ref=U.innerType,_.default=JSON.parse(JSON.stringify(U.defaultValue))},m9=($,I,_,u)=>{let U=$._zod.def;u$(U.innerType,I,u);let z=I.seen.get($);if(z.ref=U.innerType,I.io==="input")_._prefault=JSON.parse(JSON.stringify(U.defaultValue))},n9=($,I,_,u)=>{let U=$._zod.def;u$(U.innerType,I,u);let z=I.seen.get($);z.ref=U.innerType;let g;try{g=U.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}_.default=g},h9=($,I,_,u)=>{let U=$._zod.def,z=I.io==="input"?U.in._zod.def.type==="transform"?U.out:U.in:U.out;u$(z,I,u);let g=I.seen.get($);g.ref=z},d9=($,I,_,u)=>{let U=$._zod.def;u$(U.innerType,I,u);let z=I.seen.get($);z.ref=U.innerType,_.readOnly=!0},c9=($,I,_,u)=>{let U=$._zod.def;u$(U.innerType,I,u);let z=I.seen.get($);z.ref=U.innerType},s_=($,I,_,u)=>{let U=$._zod.def;u$(U.innerType,I,u);let z=I.seen.get($);z.ref=U.innerType},p9=($,I,_,u)=>{let U=$._zod.innerType;u$(U,I,u);let z=I.seen.get($);z.ref=U},a_={string:N9,number:Q9,boolean:Y9,bigint:H9,symbol:O9,null:T9,undefined:B9,void:D9,never:M9,any:K9,unknown:V9,date:L9,enum:R9,literal:Z9,nan:W9,template_literal:P9,file:b9,success:A9,custom:j9,function:F9,transform:S9,map:w9,set:E9,array:C9,object:f9,union:e_,intersection:x9,tuple:k9,record:y9,nullable:i9,nonoptional:l9,default:r9,prefault:m9,catch:n9,pipe:h9,readonly:d9,promise:c9,optional:s_,lazy:p9};function $2($,I){if("_idmap"in $){let u=$,U=R6({...I,processors:a_}),z={};for(let G of u._idmap.entries()){let[v,X]=G;u$(X,U)}let g={},J={registry:u,uri:I?.uri,defs:z};U.external=J;for(let G of u._idmap.entries()){let[v,X]=G;Z6(U,X),g[v]=W6(U,X)}if(Object.keys(z).length>0){let G=U.target==="draft-2020-12"?"$defs":"definitions";g.__shared={[G]:z}}return{schemas:g}}let _=R6({...I,processors:a_});return u$($,_),Z6(_,$),W6(_,$)}class o9{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter($){this.ctx.counter=$}get seen(){return this.ctx.seen}constructor($){let I=$?.target??"draft-2020-12";if(I==="draft-4")I="draft-04";if(I==="draft-7")I="draft-07";this.ctx=R6({processors:a_,target:I,...$?.metadata&&{metadata:$.metadata},...$?.unrepresentable&&{unrepresentable:$.unrepresentable},...$?.override&&{override:$.override},...$?.io&&{io:$.io}})}process($,I={path:[],schemaPath:[]}){return u$($,this.ctx,I)}emit($,I){if(I){if(I.cycles)this.ctx.cycles=I.cycles;if(I.reused)this.ctx.reused=I.reused;if(I.external)this.ctx.external=I.external}Z6(this.ctx,$);let _=W6(this.ctx,$),{"~standard":u,...U}=_;return U}}var qQ={};var RI={};F4(RI,{xor:()=>U7,xid:()=>ZQ,void:()=>tQ,uuidv7:()=>TQ,uuidv6:()=>OQ,uuidv4:()=>HQ,uuid:()=>YQ,url:()=>BQ,unknown:()=>U1,union:()=>P2,undefined:()=>pQ,ulid:()=>RQ,uint64:()=>dQ,uint32:()=>mQ,tuple:()=>AG,transform:()=>A2,templateLiteral:()=>H7,symbol:()=>cQ,superRefine:()=>Uv,success:()=>N7,stringbool:()=>L7,stringFormat:()=>fQ,string:()=>g2,strictObject:()=>$7,set:()=>J7,refine:()=>Iv,record:()=>jG,readonly:()=>oG,promise:()=>O7,preprocess:()=>Z7,prefault:()=>rG,pipe:()=>bI,partialRecord:()=>u7,optional:()=>WI,object:()=>sQ,number:()=>QG,nullish:()=>X7,nullable:()=>PI,null:()=>BG,nonoptional:()=>mG,never:()=>W2,nativeEnum:()=>G7,nanoid:()=>KQ,nan:()=>Q7,meta:()=>K7,map:()=>g7,mac:()=>bQ,looseRecord:()=>z7,looseObject:()=>I7,literal:()=>v7,lazy:()=>eG,ksuid:()=>WQ,keyof:()=>eQ,jwt:()=>CQ,json:()=>R7,ipv6:()=>AQ,ipv4:()=>PQ,intersection:()=>PG,int64:()=>hQ,int32:()=>rQ,int:()=>J2,instanceof:()=>V7,httpUrl:()=>DQ,hostname:()=>xQ,hex:()=>kQ,hash:()=>yQ,guid:()=>QQ,function:()=>T7,float64:()=>lQ,float32:()=>iQ,file:()=>q7,exactOptional:()=>xG,enum:()=>b2,emoji:()=>MQ,email:()=>NQ,e164:()=>EQ,discriminatedUnion:()=>_7,describe:()=>M7,date:()=>aQ,custom:()=>D7,cuid2:()=>LQ,cuid:()=>VQ,codec:()=>Y7,cidrv6:()=>FQ,cidrv4:()=>jQ,check:()=>B7,catch:()=>dG,boolean:()=>YG,bigint:()=>nQ,base64url:()=>wQ,base64:()=>SQ,array:()=>FI,any:()=>oQ,_function:()=>T7,_default:()=>iG,_ZodString:()=>G2,ZodXor:()=>RG,ZodXID:()=>H2,ZodVoid:()=>VG,ZodUnknown:()=>MG,ZodUnion:()=>wI,ZodUndefined:()=>OG,ZodUUID:()=>k4,ZodURL:()=>AI,ZodULID:()=>Y2,ZodType:()=>p,ZodTuple:()=>bG,ZodTransform:()=>CG,ZodTemplateLiteral:()=>tG,ZodSymbol:()=>HG,ZodSuccess:()=>nG,ZodStringFormat:()=>G$,ZodString:()=>J0,ZodSet:()=>SG,ZodRecord:()=>EI,ZodReadonly:()=>pG,ZodPromise:()=>sG,ZodPrefault:()=>lG,ZodPipe:()=>S2,ZodOptional:()=>j2,ZodObject:()=>SI,ZodNumberFormat:()=>_1,ZodNumber:()=>v0,ZodNullable:()=>kG,ZodNull:()=>TG,ZodNonOptional:()=>F2,ZodNever:()=>KG,ZodNanoID:()=>X2,ZodNaN:()=>cG,ZodMap:()=>FG,ZodMAC:()=>NG,ZodLiteral:()=>wG,ZodLazy:()=>aG,ZodKSUID:()=>O2,ZodJWT:()=>R2,ZodIntersection:()=>WG,ZodIPv6:()=>B2,ZodIPv4:()=>T2,ZodGUID:()=>ZI,ZodFunction:()=>$v,ZodFile:()=>EG,ZodExactOptional:()=>fG,ZodEnum:()=>g0,ZodEmoji:()=>q2,ZodEmail:()=>v2,ZodE164:()=>L2,ZodDiscriminatedUnion:()=>ZG,ZodDefault:()=>yG,ZodDate:()=>jI,ZodCustomStringFormat:()=>G0,ZodCustom:()=>CI,ZodCodec:()=>w2,ZodCatch:()=>hG,ZodCUID2:()=>Q2,ZodCUID:()=>N2,ZodCIDRv6:()=>M2,ZodCIDRv4:()=>D2,ZodBoolean:()=>q0,ZodBigIntFormat:()=>Z2,ZodBigInt:()=>X0,ZodBase64URL:()=>V2,ZodBase64:()=>K2,ZodArray:()=>LG,ZodAny:()=>DG});var I2={};F4(I2,{uppercase:()=>c1,trim:()=>s1,toUpperCase:()=>I0,toLowerCase:()=>$0,startsWith:()=>o1,slugify:()=>U0,size:()=>s6,regex:()=>h1,property:()=>t_,positive:()=>d_,overwrite:()=>K4,normalize:()=>e1,nonpositive:()=>p_,nonnegative:()=>o_,negative:()=>c_,multipleOf:()=>V6,minSize:()=>x4,minLength:()=>t4,mime:()=>a1,maxSize:()=>L6,maxLength:()=>$1,lte:()=>u4,lt:()=>C4,lowercase:()=>d1,length:()=>I1,includes:()=>p1,gte:()=>l$,gt:()=>f4,endsWith:()=>t1});var z0={};F4(z0,{time:()=>e9,duration:()=>s9,datetime:()=>t9,date:()=>a9,ZodISOTime:()=>u2,ZodISODuration:()=>z2,ZodISODateTime:()=>U2,ZodISODate:()=>_2});var U2=B("ZodISODateTime",($,I)=>{wJ.init($,I),G$.init($,I)});function t9($){return j3(U2,$)}var _2=B("ZodISODate",($,I)=>{EJ.init($,I),G$.init($,I)});function a9($){return F3(_2,$)}var u2=B("ZodISOTime",($,I)=>{CJ.init($,I),G$.init($,I)});function e9($){return S3(u2,$)}var z2=B("ZodISODuration",($,I)=>{fJ.init($,I),G$.init($,I)});function s9($){return w3(z2,$)}var XQ=($,I)=>{GI.init($,I),$.name="ZodError",Object.defineProperties($,{format:{value:(_)=>qI($,_)},flatten:{value:(_)=>vI($,_)},addIssue:{value:(_)=>{$.issues.push(_),$.message=JSON.stringify($.issues,f1,2)}},addIssues:{value:(_)=>{$.issues.push(..._),$.message=JSON.stringify($.issues,f1,2)}},isEmpty:{get(){return $.issues.length===0}}})},Rj=B("ZodError",XQ),e$=B("ZodError",XQ,{Parent:Error});var $G=y1(e$),IG=i1(e$),UG=l1(e$),_G=r1(e$),uG=u_(e$),zG=z_(e$),gG=g_(e$),JG=J_(e$),GG=G_(e$),vG=v_(e$),qG=q_(e$),XG=X_(e$);var p=B("ZodType",($,I)=>{return n.init($,I),Object.assign($["~standard"],{jsonSchema:{input:u0($,"input"),output:u0($,"output")}}),$.toJSONSchema=X9($,{}),$.def=I,$.type=I.type,Object.defineProperty($,"_def",{value:I}),$.check=(..._)=>{return $.clone(S.mergeDefs(I,{checks:[...I.checks??[],..._.map((u)=>typeof u==="function"?{_zod:{check:u,def:{check:"custom"},onattach:[]}}:u)]}),{parent:!0})},$.with=$.check,$.clone=(_,u)=>i$($,_,u),$.brand=()=>$,$.register=(_,u)=>{return _.add($,u),$},$.parse=(_,u)=>$G($,_,u,{callee:$.parse}),$.safeParse=(_,u)=>UG($,_,u),$.parseAsync=async(_,u)=>IG($,_,u,{callee:$.parseAsync}),$.safeParseAsync=async(_,u)=>_G($,_,u),$.spa=$.safeParseAsync,$.encode=(_,u)=>uG($,_,u),$.decode=(_,u)=>zG($,_,u),$.encodeAsync=async(_,u)=>gG($,_,u),$.decodeAsync=async(_,u)=>JG($,_,u),$.safeEncode=(_,u)=>GG($,_,u),$.safeDecode=(_,u)=>vG($,_,u),$.safeEncodeAsync=async(_,u)=>qG($,_,u),$.safeDecodeAsync=async(_,u)=>XG($,_,u),$.refine=(_,u)=>$.check(Iv(_,u)),$.superRefine=(_)=>$.check(Uv(_)),$.overwrite=(_)=>$.check(K4(_)),$.optional=()=>WI($),$.exactOptional=()=>xG($),$.nullable=()=>PI($),$.nullish=()=>WI(PI($)),$.nonoptional=(_)=>mG($,_),$.array=()=>FI($),$.or=(_)=>P2([$,_]),$.and=(_)=>PG($,_),$.transform=(_)=>bI($,A2(_)),$.default=(_)=>iG($,_),$.prefault=(_)=>rG($,_),$.catch=(_)=>dG($,_),$.pipe=(_)=>bI($,_),$.readonly=()=>oG($),$.describe=(_)=>{let u=$.clone();return S$.add(u,{description:_}),u},Object.defineProperty($,"description",{get(){return S$.get($)?.description},configurable:!0}),$.meta=(..._)=>{if(_.length===0)return S$.get($);let u=$.clone();return S$.add(u,_[0]),u},$.isOptional=()=>$.safeParse(void 0).success,$.isNullable=()=>$.safeParse(null).success,$.apply=(_)=>_($),$}),G2=B("_ZodString",($,I)=>{e6.init($,I),p.init($,I),$._zod.processJSONSchema=(u,U,z)=>N9($,u,U,z);let _=$._zod.bag;$.format=_.format??null,$.minLength=_.minimum??null,$.maxLength=_.maximum??null,$.regex=(...u)=>$.check(h1(...u)),$.includes=(...u)=>$.check(p1(...u)),$.startsWith=(...u)=>$.check(o1(...u)),$.endsWith=(...u)=>$.check(t1(...u)),$.min=(...u)=>$.check(t4(...u)),$.max=(...u)=>$.check($1(...u)),$.length=(...u)=>$.check(I1(...u)),$.nonempty=(...u)=>$.check(t4(1,...u)),$.lowercase=(u)=>$.check(d1(u)),$.uppercase=(u)=>$.check(c1(u)),$.trim=()=>$.check(s1()),$.normalize=(...u)=>$.check(e1(...u)),$.toLowerCase=()=>$.check($0()),$.toUpperCase=()=>$.check(I0()),$.slugify=()=>$.check(U0())}),J0=B("ZodString",($,I)=>{e6.init($,I),G2.init($,I),$.email=(_)=>$.check(W_(v2,_)),$.url=(_)=>$.check(LI(AI,_)),$.jwt=(_)=>$.check(h_(R2,_)),$.emoji=(_)=>$.check(F_(q2,_)),$.guid=(_)=>$.check(VI(ZI,_)),$.uuid=(_)=>$.check(P_(k4,_)),$.uuidv4=(_)=>$.check(b_(k4,_)),$.uuidv6=(_)=>$.check(A_(k4,_)),$.uuidv7=(_)=>$.check(j_(k4,_)),$.nanoid=(_)=>$.check(S_(X2,_)),$.guid=(_)=>$.check(VI(ZI,_)),$.cuid=(_)=>$.check(w_(N2,_)),$.cuid2=(_)=>$.check(E_(Q2,_)),$.ulid=(_)=>$.check(C_(Y2,_)),$.base64=(_)=>$.check(r_(K2,_)),$.base64url=(_)=>$.check(m_(V2,_)),$.xid=(_)=>$.check(f_(H2,_)),$.ksuid=(_)=>$.check(x_(O2,_)),$.ipv4=(_)=>$.check(k_(T2,_)),$.ipv6=(_)=>$.check(y_(B2,_)),$.cidrv4=(_)=>$.check(i_(D2,_)),$.cidrv6=(_)=>$.check(l_(M2,_)),$.e164=(_)=>$.check(n_(L2,_)),$.datetime=(_)=>$.check(t9(_)),$.date=(_)=>$.check(a9(_)),$.time=(_)=>$.check(e9(_)),$.duration=(_)=>$.check(s9(_))});function g2($){return W3(J0,$)}var G$=B("ZodStringFormat",($,I)=>{J$.init($,I),G2.init($,I)}),v2=B("ZodEmail",($,I)=>{RJ.init($,I),G$.init($,I)});function NQ($){return W_(v2,$)}var ZI=B("ZodGUID",($,I)=>{VJ.init($,I),G$.init($,I)});function QQ($){return VI(ZI,$)}var k4=B("ZodUUID",($,I)=>{LJ.init($,I),G$.init($,I)});function YQ($){return P_(k4,$)}function HQ($){return b_(k4,$)}function OQ($){return A_(k4,$)}function TQ($){return j_(k4,$)}var AI=B("ZodURL",($,I)=>{ZJ.init($,I),G$.init($,I)});function BQ($){return LI(AI,$)}function DQ($){return LI(AI,{protocol:/^https?$/,hostname:Q4.domain,...S.normalizeParams($)})}var q2=B("ZodEmoji",($,I)=>{WJ.init($,I),G$.init($,I)});function MQ($){return F_(q2,$)}var X2=B("ZodNanoID",($,I)=>{PJ.init($,I),G$.init($,I)});function KQ($){return S_(X2,$)}var N2=B("ZodCUID",($,I)=>{bJ.init($,I),G$.init($,I)});function VQ($){return w_(N2,$)}var Q2=B("ZodCUID2",($,I)=>{AJ.init($,I),G$.init($,I)});function LQ($){return E_(Q2,$)}var Y2=B("ZodULID",($,I)=>{jJ.init($,I),G$.init($,I)});function RQ($){return C_(Y2,$)}var H2=B("ZodXID",($,I)=>{FJ.init($,I),G$.init($,I)});function ZQ($){return f_(H2,$)}var O2=B("ZodKSUID",($,I)=>{SJ.init($,I),G$.init($,I)});function WQ($){return x_(O2,$)}var T2=B("ZodIPv4",($,I)=>{xJ.init($,I),G$.init($,I)});function PQ($){return k_(T2,$)}var NG=B("ZodMAC",($,I)=>{yJ.init($,I),G$.init($,I)});function bQ($){return b3(NG,$)}var B2=B("ZodIPv6",($,I)=>{kJ.init($,I),G$.init($,I)});function AQ($){return y_(B2,$)}var D2=B("ZodCIDRv4",($,I)=>{iJ.init($,I),G$.init($,I)});function jQ($){return i_(D2,$)}var M2=B("ZodCIDRv6",($,I)=>{lJ.init($,I),G$.init($,I)});function FQ($){return l_(M2,$)}var K2=B("ZodBase64",($,I)=>{mJ.init($,I),G$.init($,I)});function SQ($){return r_(K2,$)}var V2=B("ZodBase64URL",($,I)=>{nJ.init($,I),G$.init($,I)});function wQ($){return m_(V2,$)}var L2=B("ZodE164",($,I)=>{hJ.init($,I),G$.init($,I)});function EQ($){return n_(L2,$)}var R2=B("ZodJWT",($,I)=>{dJ.init($,I),G$.init($,I)});function CQ($){return h_(R2,$)}var G0=B("ZodCustomStringFormat",($,I)=>{cJ.init($,I),G$.init($,I)});function fQ($,I,_={}){return _0(G0,$,I,_)}function xQ($){return _0(G0,"hostname",Q4.hostname,$)}function kQ($){return _0(G0,"hex",Q4.hex,$)}function yQ($,I){let _=I?.enc??"hex",u=`${$}_${_}`,U=Q4[u];if(!U)throw Error(`Unrecognized hash format: ${u}`);return _0(G0,u,U,I)}var v0=B("ZodNumber",($,I)=>{K_.init($,I),p.init($,I),$._zod.processJSONSchema=(u,U,z)=>Q9($,u,U,z),$.gt=(u,U)=>$.check(f4(u,U)),$.gte=(u,U)=>$.check(l$(u,U)),$.min=(u,U)=>$.check(l$(u,U)),$.lt=(u,U)=>$.check(C4(u,U)),$.lte=(u,U)=>$.check(u4(u,U)),$.max=(u,U)=>$.check(u4(u,U)),$.int=(u)=>$.check(J2(u)),$.safe=(u)=>$.check(J2(u)),$.positive=(u)=>$.check(f4(0,u)),$.nonnegative=(u)=>$.check(l$(0,u)),$.negative=(u)=>$.check(C4(0,u)),$.nonpositive=(u)=>$.check(u4(0,u)),$.multipleOf=(u,U)=>$.check(V6(u,U)),$.step=(u,U)=>$.check(V6(u,U)),$.finite=()=>$;let _=$._zod.bag;$.minValue=Math.max(_.minimum??Number.NEGATIVE_INFINITY,_.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,$.maxValue=Math.min(_.maximum??Number.POSITIVE_INFINITY,_.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,$.isInt=(_.format??"").includes("int")||Number.isSafeInteger(_.multipleOf??0.5),$.isFinite=!0,$.format=_.format??null});function QG($){return E3(v0,$)}var _1=B("ZodNumberFormat",($,I)=>{pJ.init($,I),v0.init($,I)});function J2($){return f3(_1,$)}function iQ($){return x3(_1,$)}function lQ($){return k3(_1,$)}function rQ($){return y3(_1,$)}function mQ($){return i3(_1,$)}var q0=B("ZodBoolean",($,I)=>{YI.init($,I),p.init($,I),$._zod.processJSONSchema=(_,u,U)=>Y9($,_,u,U)});function YG($){return l3(q0,$)}var X0=B("ZodBigInt",($,I)=>{V_.init($,I),p.init($,I),$._zod.processJSONSchema=(u,U,z)=>H9($,u,U,z),$.gte=(u,U)=>$.check(l$(u,U)),$.min=(u,U)=>$.check(l$(u,U)),$.gt=(u,U)=>$.check(f4(u,U)),$.gte=(u,U)=>$.check(l$(u,U)),$.min=(u,U)=>$.check(l$(u,U)),$.lt=(u,U)=>$.check(C4(u,U)),$.lte=(u,U)=>$.check(u4(u,U)),$.max=(u,U)=>$.check(u4(u,U)),$.positive=(u)=>$.check(f4(BigInt(0),u)),$.negative=(u)=>$.check(C4(BigInt(0),u)),$.nonpositive=(u)=>$.check(u4(BigInt(0),u)),$.nonnegative=(u)=>$.check(l$(BigInt(0),u)),$.multipleOf=(u,U)=>$.check(V6(u,U));let _=$._zod.bag;$.minValue=_.minimum??null,$.maxValue=_.maximum??null,$.format=_.format??null});function nQ($){return m3(X0,$)}var Z2=B("ZodBigIntFormat",($,I)=>{oJ.init($,I),X0.init($,I)});function hQ($){return h3(Z2,$)}function dQ($){return d3(Z2,$)}var HG=B("ZodSymbol",($,I)=>{tJ.init($,I),p.init($,I),$._zod.processJSONSchema=(_,u,U)=>O9($,_,u,U)});function cQ($){return c3(HG,$)}var OG=B("ZodUndefined",($,I)=>{aJ.init($,I),p.init($,I),$._zod.processJSONSchema=(_,u,U)=>B9($,_,u,U)});function pQ($){return p3(OG,$)}var TG=B("ZodNull",($,I)=>{eJ.init($,I),p.init($,I),$._zod.processJSONSchema=(_,u,U)=>T9($,_,u,U)});function BG($){return o3(TG,$)}var DG=B("ZodAny",($,I)=>{sJ.init($,I),p.init($,I),$._zod.processJSONSchema=(_,u,U)=>K9($,_,u,U)});function oQ(){return t3(DG)}var MG=B("ZodUnknown",($,I)=>{$8.init($,I),p.init($,I),$._zod.processJSONSchema=(_,u,U)=>V9($,_,u,U)});function U1(){return a3(MG)}var KG=B("ZodNever",($,I)=>{I8.init($,I),p.init($,I),$._zod.processJSONSchema=(_,u,U)=>M9($,_,u,U)});function W2($){return e3(KG,$)}var VG=B("ZodVoid",($,I)=>{U8.init($,I),p.init($,I),$._zod.processJSONSchema=(_,u,U)=>D9($,_,u,U)});function tQ($){return s3(VG,$)}var jI=B("ZodDate",($,I)=>{_8.init($,I),p.init($,I),$._zod.processJSONSchema=(u,U,z)=>L9($,u,U,z),$.min=(u,U)=>$.check(l$(u,U)),$.max=(u,U)=>$.check(u4(u,U));let _=$._zod.bag;$.minDate=_.minimum?new Date(_.minimum):null,$.maxDate=_.maximum?new Date(_.maximum):null});function aQ($){return $9(jI,$)}var LG=B("ZodArray",($,I)=>{u8.init($,I),p.init($,I),$._zod.processJSONSchema=(_,u,U)=>C9($,_,u,U),$.element=I.element,$.min=(_,u)=>$.check(t4(_,u)),$.nonempty=(_)=>$.check(t4(1,_)),$.max=(_,u)=>$.check($1(_,u)),$.length=(_,u)=>$.check(I1(_,u)),$.unwrap=()=>$.element});function FI($,I){return _9(LG,$,I)}function eQ($){let I=$._zod.def.shape;return b2(Object.keys(I))}var SI=B("ZodObject",($,I)=>{z8.init($,I),p.init($,I),$._zod.processJSONSchema=(_,u,U)=>f9($,_,u,U),S.defineLazy($,"shape",()=>{return I.shape}),$.keyof=()=>b2(Object.keys($._zod.def.shape)),$.catchall=(_)=>$.clone({...$._zod.def,catchall:_}),$.passthrough=()=>$.clone({...$._zod.def,catchall:U1()}),$.loose=()=>$.clone({...$._zod.def,catchall:U1()}),$.strict=()=>$.clone({...$._zod.def,catchall:W2()}),$.strip=()=>$.clone({...$._zod.def,catchall:void 0}),$.extend=(_)=>{return S.extend($,_)},$.safeExtend=(_)=>{return S.safeExtend($,_)},$.merge=(_)=>S.merge($,_),$.pick=(_)=>S.pick($,_),$.omit=(_)=>S.omit($,_),$.partial=(..._)=>S.partial(j2,$,_[0]),$.required=(..._)=>S.required(F2,$,_[0])});function sQ($,I){let _={type:"object",shape:$??{},...S.normalizeParams(I)};return new SI(_)}function $7($,I){return new SI({type:"object",shape:$,catchall:W2(),...S.normalizeParams(I)})}function I7($,I){return new SI({type:"object",shape:$,catchall:U1(),...S.normalizeParams(I)})}var wI=B("ZodUnion",($,I)=>{HI.init($,I),p.init($,I),$._zod.processJSONSchema=(_,u,U)=>e_($,_,u,U),$.options=I.options});function P2($,I){return new wI({type:"union",options:$,...S.normalizeParams(I)})}var RG=B("ZodXor",($,I)=>{wI.init($,I),g8.init($,I),$._zod.processJSONSchema=(_,u,U)=>e_($,_,u,U),$.options=I.options});function U7($,I){return new RG({type:"union",options:$,inclusive:!1,...S.normalizeParams(I)})}var ZG=B("ZodDiscriminatedUnion",($,I)=>{wI.init($,I),J8.init($,I)});function _7($,I,_){return new ZG({type:"union",options:I,discriminator:$,...S.normalizeParams(_)})}var WG=B("ZodIntersection",($,I)=>{G8.init($,I),p.init($,I),$._zod.processJSONSchema=(_,u,U)=>x9($,_,u,U)});function PG($,I){return new WG({type:"intersection",left:$,right:I})}var bG=B("ZodTuple",($,I)=>{L_.init($,I),p.init($,I),$._zod.processJSONSchema=(_,u,U)=>k9($,_,u,U),$.rest=(_)=>$.clone({...$._zod.def,rest:_})});function AG($,I,_){let u=I instanceof n,U=u?_:I;return new bG({type:"tuple",items:$,rest:u?I:null,...S.normalizeParams(U)})}var EI=B("ZodRecord",($,I)=>{v8.init($,I),p.init($,I),$._zod.processJSONSchema=(_,u,U)=>y9($,_,u,U),$.keyType=I.keyType,$.valueType=I.valueType});function jG($,I,_){return new EI({type:"record",keyType:$,valueType:I,...S.normalizeParams(_)})}function u7($,I,_){let u=i$($);return u._zod.values=void 0,new EI({type:"record",keyType:u,valueType:I,...S.normalizeParams(_)})}function z7($,I,_){return new EI({type:"record",keyType:$,valueType:I,mode:"loose",...S.normalizeParams(_)})}var FG=B("ZodMap",($,I)=>{q8.init($,I),p.init($,I),$._zod.processJSONSchema=(_,u,U)=>w9($,_,u,U),$.keyType=I.keyType,$.valueType=I.valueType,$.min=(..._)=>$.check(x4(..._)),$.nonempty=(_)=>$.check(x4(1,_)),$.max=(..._)=>$.check(L6(..._)),$.size=(..._)=>$.check(s6(..._))});function g7($,I,_){return new FG({type:"map",keyType:$,valueType:I,...S.normalizeParams(_)})}var SG=B("ZodSet",($,I)=>{X8.init($,I),p.init($,I),$._zod.processJSONSchema=(_,u,U)=>E9($,_,u,U),$.min=(..._)=>$.check(x4(..._)),$.nonempty=(_)=>$.check(x4(1,_)),$.max=(..._)=>$.check(L6(..._)),$.size=(..._)=>$.check(s6(..._))});function J7($,I){return new SG({type:"set",valueType:$,...S.normalizeParams(I)})}var g0=B("ZodEnum",($,I)=>{N8.init($,I),p.init($,I),$._zod.processJSONSchema=(u,U,z)=>R9($,u,U,z),$.enum=I.entries,$.options=Object.values(I.entries);let _=new Set(Object.keys(I.entries));$.extract=(u,U)=>{let z={};for(let g of u)if(_.has(g))z[g]=I.entries[g];else throw Error(`Key ${g} not found in enum`);return new g0({...I,checks:[],...S.normalizeParams(U),entries:z})},$.exclude=(u,U)=>{let z={...I.entries};for(let g of u)if(_.has(g))delete z[g];else throw Error(`Key ${g} not found in enum`);return new g0({...I,checks:[],...S.normalizeParams(U),entries:z})}});function b2($,I){let _=Array.isArray($)?Object.fromEntries($.map((u)=>[u,u])):$;return new g0({type:"enum",entries:_,...S.normalizeParams(I)})}function G7($,I){return new g0({type:"enum",entries:$,...S.normalizeParams(I)})}var wG=B("ZodLiteral",($,I)=>{Q8.init($,I),p.init($,I),$._zod.processJSONSchema=(_,u,U)=>Z9($,_,u,U),$.values=new Set(I.values),Object.defineProperty($,"value",{get(){if(I.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return I.values[0]}})});function v7($,I){return new wG({type:"literal",values:Array.isArray($)?$:[$],...S.normalizeParams(I)})}var EG=B("ZodFile",($,I)=>{Y8.init($,I),p.init($,I),$._zod.processJSONSchema=(_,u,U)=>b9($,_,u,U),$.min=(_,u)=>$.check(x4(_,u)),$.max=(_,u)=>$.check(L6(_,u)),$.mime=(_,u)=>$.check(a1(Array.isArray(_)?_:[_],u))});function q7($){return u9(EG,$)}var CG=B("ZodTransform",($,I)=>{H8.init($,I),p.init($,I),$._zod.processJSONSchema=(_,u,U)=>S9($,_,u,U),$._zod.parse=(_,u)=>{if(u.direction==="backward")throw new o6($.constructor.name);_.addIssue=(z)=>{if(typeof z==="string")_.issues.push(S.issue(z,_.value,I));else{let g=z;if(g.fatal)g.continue=!1;g.code??(g.code="custom"),g.input??(g.input=_.value),g.inst??(g.inst=$),_.issues.push(S.issue(g))}};let U=I.transform(_.value,_);if(U instanceof Promise)return U.then((z)=>{return _.value=z,_});return _.value=U,_}});function A2($){return new CG({type:"transform",transform:$})}var j2=B("ZodOptional",($,I)=>{R_.init($,I),p.init($,I),$._zod.processJSONSchema=(_,u,U)=>s_($,_,u,U),$.unwrap=()=>$._zod.def.innerType});function WI($){return new j2({type:"optional",innerType:$})}var fG=B("ZodExactOptional",($,I)=>{O8.init($,I),p.init($,I),$._zod.processJSONSchema=(_,u,U)=>s_($,_,u,U),$.unwrap=()=>$._zod.def.innerType});function xG($){return new fG({type:"optional",innerType:$})}var kG=B("ZodNullable",($,I)=>{T8.init($,I),p.init($,I),$._zod.processJSONSchema=(_,u,U)=>i9($,_,u,U),$.unwrap=()=>$._zod.def.innerType});function PI($){return new kG({type:"nullable",innerType:$})}function X7($){return WI(PI($))}var yG=B("ZodDefault",($,I)=>{B8.init($,I),p.init($,I),$._zod.processJSONSchema=(_,u,U)=>r9($,_,u,U),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function iG($,I){return new yG({type:"default",innerType:$,get defaultValue(){return typeof I==="function"?I():S.shallowClone(I)}})}var lG=B("ZodPrefault",($,I)=>{D8.init($,I),p.init($,I),$._zod.processJSONSchema=(_,u,U)=>m9($,_,u,U),$.unwrap=()=>$._zod.def.innerType});function rG($,I){return new lG({type:"prefault",innerType:$,get defaultValue(){return typeof I==="function"?I():S.shallowClone(I)}})}var F2=B("ZodNonOptional",($,I)=>{M8.init($,I),p.init($,I),$._zod.processJSONSchema=(_,u,U)=>l9($,_,u,U),$.unwrap=()=>$._zod.def.innerType});function mG($,I){return new F2({type:"nonoptional",innerType:$,...S.normalizeParams(I)})}var nG=B("ZodSuccess",($,I)=>{K8.init($,I),p.init($,I),$._zod.processJSONSchema=(_,u,U)=>A9($,_,u,U),$.unwrap=()=>$._zod.def.innerType});function N7($){return new nG({type:"success",innerType:$})}var hG=B("ZodCatch",($,I)=>{V8.init($,I),p.init($,I),$._zod.processJSONSchema=(_,u,U)=>n9($,_,u,U),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function dG($,I){return new hG({type:"catch",innerType:$,catchValue:typeof I==="function"?I:()=>I})}var cG=B("ZodNaN",($,I)=>{L8.init($,I),p.init($,I),$._zod.processJSONSchema=(_,u,U)=>W9($,_,u,U)});function Q7($){return U9(cG,$)}var S2=B("ZodPipe",($,I)=>{R8.init($,I),p.init($,I),$._zod.processJSONSchema=(_,u,U)=>h9($,_,u,U),$.in=I.in,$.out=I.out});function bI($,I){return new S2({type:"pipe",in:$,out:I})}var w2=B("ZodCodec",($,I)=>{S2.init($,I),OI.init($,I)});function Y7($,I,_){return new w2({type:"pipe",in:$,out:I,transform:_.decode,reverseTransform:_.encode})}var pG=B("ZodReadonly",($,I)=>{Z8.init($,I),p.init($,I),$._zod.processJSONSchema=(_,u,U)=>d9($,_,u,U),$.unwrap=()=>$._zod.def.innerType});function oG($){return new pG({type:"readonly",innerType:$})}var tG=B("ZodTemplateLiteral",($,I)=>{W8.init($,I),p.init($,I),$._zod.processJSONSchema=(_,u,U)=>P9($,_,u,U)});function H7($,I){return new tG({type:"template_literal",parts:$,...S.normalizeParams(I)})}var aG=B("ZodLazy",($,I)=>{A8.init($,I),p.init($,I),$._zod.processJSONSchema=(_,u,U)=>p9($,_,u,U),$.unwrap=()=>$._zod.def.getter()});function eG($){return new aG({type:"lazy",getter:$})}var sG=B("ZodPromise",($,I)=>{b8.init($,I),p.init($,I),$._zod.processJSONSchema=(_,u,U)=>c9($,_,u,U),$.unwrap=()=>$._zod.def.innerType});function O7($){return new sG({type:"promise",innerType:$})}var $v=B("ZodFunction",($,I)=>{P8.init($,I),p.init($,I),$._zod.processJSONSchema=(_,u,U)=>F9($,_,u,U)});function T7($){return new $v({type:"function",input:Array.isArray($?.input)?AG($?.input):$?.input??FI(U1()),output:$?.output??U1()})}var CI=B("ZodCustom",($,I)=>{j8.init($,I),p.init($,I),$._zod.processJSONSchema=(_,u,U)=>j9($,_,u,U)});function B7($){let I=new q$({check:"custom"});return I._zod.check=$,I}function D7($,I){return z9(CI,$??(()=>!0),I)}function Iv($,I={}){return g9(CI,$,I)}function Uv($){return J9($)}var M7=G9,K7=v9;function V7($,I={}){let _=new CI({type:"custom",check:"custom",fn:(u)=>u instanceof $,abort:!0,...S.normalizeParams(I)});return _._zod.bag.Class=$,_._zod.check=(u)=>{if(!(u.value instanceof $))u.issues.push({code:"invalid_type",expected:$.name,input:u.value,inst:_,path:[..._._zod.def.path??[]]})},_}var L7=(...$)=>q9({Codec:w2,Boolean:q0,String:J0},...$);function R7($){let I=eG(()=>{return P2([g2($),QG(),YG(),BG(),FI(I),jG(g2(),I)])});return I}function Z7($,I){return bI(A2($),I)}var Wj={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function Pj($){L$({customError:$})}function bj(){return L$().customError}var _v;(function($){})(_v||(_v={}));var x={...RI,...I2,iso:z0},Aj=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function jj($,I){let _=$.$schema;if(_==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(_==="http://json-schema.org/draft-07/schema#")return"draft-7";if(_==="http://json-schema.org/draft-04/schema#")return"draft-4";return I??"draft-2020-12"}function Fj($,I){if(!$.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let _=$.slice(1).split("/").filter(Boolean);if(_.length===0)return I.rootSchema;let u=I.version==="draft-2020-12"?"$defs":"definitions";if(_[0]===u){let U=_[1];if(!U||!I.defs[U])throw Error(`Reference not found: ${$}`);return I.defs[U]}throw Error(`Reference not found: ${$}`)}function W7($,I){if($.not!==void 0){if(typeof $.not==="object"&&Object.keys($.not).length===0)return x.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if($.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if($.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if($.if!==void 0||$.then!==void 0||$.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if($.dependentSchemas!==void 0||$.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if($.$ref){let U=$.$ref;if(I.refs.has(U))return I.refs.get(U);if(I.processing.has(U))return x.lazy(()=>{if(!I.refs.has(U))throw Error(`Circular reference not resolved: ${U}`);return I.refs.get(U)});I.processing.add(U);let z=Fj(U,I),g=E$(z,I);return I.refs.set(U,g),I.processing.delete(U),g}if($.enum!==void 0){let U=$.enum;if(I.version==="openapi-3.0"&&$.nullable===!0&&U.length===1&&U[0]===null)return x.null();if(U.length===0)return x.never();if(U.length===1)return x.literal(U[0]);if(U.every((g)=>typeof g==="string"))return x.enum(U);let z=U.map((g)=>x.literal(g));if(z.length<2)return z[0];return x.union([z[0],z[1],...z.slice(2)])}if($.const!==void 0)return x.literal($.const);let _=$.type;if(Array.isArray(_)){let U=_.map((z)=>{let g={...$,type:z};return W7(g,I)});if(U.length===0)return x.never();if(U.length===1)return U[0];return x.union(U)}if(!_)return x.any();let u;switch(_){case"string":{let U=x.string();if($.format){let z=$.format;if(z==="email")U=U.check(x.email());else if(z==="uri"||z==="uri-reference")U=U.check(x.url());else if(z==="uuid"||z==="guid")U=U.check(x.uuid());else if(z==="date-time")U=U.check(x.iso.datetime());else if(z==="date")U=U.check(x.iso.date());else if(z==="time")U=U.check(x.iso.time());else if(z==="duration")U=U.check(x.iso.duration());else if(z==="ipv4")U=U.check(x.ipv4());else if(z==="ipv6")U=U.check(x.ipv6());else if(z==="mac")U=U.check(x.mac());else if(z==="cidr")U=U.check(x.cidrv4());else if(z==="cidr-v6")U=U.check(x.cidrv6());else if(z==="base64")U=U.check(x.base64());else if(z==="base64url")U=U.check(x.base64url());else if(z==="e164")U=U.check(x.e164());else if(z==="jwt")U=U.check(x.jwt());else if(z==="emoji")U=U.check(x.emoji());else if(z==="nanoid")U=U.check(x.nanoid());else if(z==="cuid")U=U.check(x.cuid());else if(z==="cuid2")U=U.check(x.cuid2());else if(z==="ulid")U=U.check(x.ulid());else if(z==="xid")U=U.check(x.xid());else if(z==="ksuid")U=U.check(x.ksuid())}if(typeof $.minLength==="number")U=U.min($.minLength);if(typeof $.maxLength==="number")U=U.max($.maxLength);if($.pattern)U=U.regex(new RegExp($.pattern));u=U;break}case"number":case"integer":{let U=_==="integer"?x.number().int():x.number();if(typeof $.minimum==="number")U=U.min($.minimum);if(typeof $.maximum==="number")U=U.max($.maximum);if(typeof $.exclusiveMinimum==="number")U=U.gt($.exclusiveMinimum);else if($.exclusiveMinimum===!0&&typeof $.minimum==="number")U=U.gt($.minimum);if(typeof $.exclusiveMaximum==="number")U=U.lt($.exclusiveMaximum);else if($.exclusiveMaximum===!0&&typeof $.maximum==="number")U=U.lt($.maximum);if(typeof $.multipleOf==="number")U=U.multipleOf($.multipleOf);u=U;break}case"boolean":{u=x.boolean();break}case"null":{u=x.null();break}case"object":{let U={},z=$.properties||{},g=new Set($.required||[]);for(let[G,v]of Object.entries(z)){let X=E$(v,I);U[G]=g.has(G)?X:X.optional()}if($.propertyNames){let G=E$($.propertyNames,I),v=$.additionalProperties&&typeof $.additionalProperties==="object"?E$($.additionalProperties,I):x.any();if(Object.keys(U).length===0){u=x.record(G,v);break}let X=x.object(U).passthrough(),q=x.looseRecord(G,v);u=x.intersection(X,q);break}if($.patternProperties){let G=$.patternProperties,v=Object.keys(G),X=[];for(let N of v){let Y=E$(G[N],I),H=x.string().regex(new RegExp(N));X.push(x.looseRecord(H,Y))}let q=[];if(Object.keys(U).length>0)q.push(x.object(U).passthrough());if(q.push(...X),q.length===0)u=x.object({}).passthrough();else if(q.length===1)u=q[0];else{let N=x.intersection(q[0],q[1]);for(let Y=2;Y<q.length;Y++)N=x.intersection(N,q[Y]);u=N}break}let J=x.object(U);if($.additionalProperties===!1)u=J.strict();else if(typeof $.additionalProperties==="object")u=J.catchall(E$($.additionalProperties,I));else u=J.passthrough();break}case"array":{let{prefixItems:U,items:z}=$;if(U&&Array.isArray(U)){let g=U.map((G)=>E$(G,I)),J=z&&typeof z==="object"&&!Array.isArray(z)?E$(z,I):void 0;if(J)u=x.tuple(g).rest(J);else u=x.tuple(g);if(typeof $.minItems==="number")u=u.check(x.minLength($.minItems));if(typeof $.maxItems==="number")u=u.check(x.maxLength($.maxItems))}else if(Array.isArray(z)){let g=z.map((G)=>E$(G,I)),J=$.additionalItems&&typeof $.additionalItems==="object"?E$($.additionalItems,I):void 0;if(J)u=x.tuple(g).rest(J);else u=x.tuple(g);if(typeof $.minItems==="number")u=u.check(x.minLength($.minItems));if(typeof $.maxItems==="number")u=u.check(x.maxLength($.maxItems))}else if(z!==void 0){let g=E$(z,I),J=x.array(g);if(typeof $.minItems==="number")J=J.min($.minItems);if(typeof $.maxItems==="number")J=J.max($.maxItems);u=J}else u=x.array(x.any());break}default:throw Error(`Unsupported type: ${_}`)}if($.description)u=u.describe($.description);if($.default!==void 0)u=u.default($.default);return u}function E$($,I){if(typeof $==="boolean")return $?x.any():x.never();let _=W7($,I),u=$.type||$.enum!==void 0||$.const!==void 0;if($.anyOf&&Array.isArray($.anyOf)){let J=$.anyOf.map((v)=>E$(v,I)),G=x.union(J);_=u?x.intersection(_,G):G}if($.oneOf&&Array.isArray($.oneOf)){let J=$.oneOf.map((v)=>E$(v,I)),G=x.xor(J);_=u?x.intersection(_,G):G}if($.allOf&&Array.isArray($.allOf))if($.allOf.length===0)_=u?_:x.any();else{let J=u?_:E$($.allOf[0],I),G=u?0:1;for(let v=G;v<$.allOf.length;v++)J=x.intersection(J,E$($.allOf[v],I));_=J}if($.nullable===!0&&I.version==="openapi-3.0")_=x.nullable(_);if($.readOnly===!0)_=x.readonly(_);let U={},z=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let J of z)if(J in $)U[J]=$[J];let g=["contentEncoding","contentMediaType","contentSchema"];for(let J of g)if(J in $)U[J]=$[J];for(let J of Object.keys($))if(!Aj.has(J))U[J]=$[J];if(Object.keys(U).length>0)I.registry.add(_,U);return _}function P7($,I){if(typeof $==="boolean")return $?x.any():x.never();let _=jj($,I?.defaultTarget),u=$.$defs||$.definitions||{},U={version:_,defs:u,refs:new Map,processing:new Set,rootSchema:$,registry:I?.registry??S$};return E$($,U)}var uv={};F4(uv,{string:()=>Sj,number:()=>wj,date:()=>fj,boolean:()=>Ej,bigint:()=>Cj});function Sj($){return P3(J0,$)}function wj($){return C3(v0,$)}function Ej($){return r3(q0,$)}function Cj($){return n3(X0,$)}function fj($){return I9(jI,$)}L$(TI());fI();function mj($,I,_){let u=$$.join($,".serena","memories"),U=$$.join(u,`result-${I}-${_}.md`);if(k.existsSync(U))return U;let z=$$.join(u,`result-${I}.md`);if(k.existsSync(z))return z;return null}function xI($){try{return process.kill($,0),!0}catch(I){return!1}}function C7($){let I=[],_=/[^\s"']+|"([^"]*)"|'([^']*)'/g,u=_.exec($);while(u!==null){if(u[1]!==void 0)I.push(u[1]);else if(u[2]!==void 0)I.push(u[2]);else if(u[0])I.push(u[0]);u=_.exec($)}return I}var nj=g$.object({default_cli:g$.string().optional(),agent_cli_mapping:g$.record(g$.string(),g$.string()).optional()}).passthrough().transform(($)=>({default_cli:$.default_cli,agent_cli_mapping:$.agent_cli_mapping??{}})),hj=g$.object({command:g$.string().optional(),subcommand:g$.string().optional(),prompt_flag:g$.string().optional().transform(($)=>{if($===void 0)return;let I=$.trim().toLowerCase();if(I===""||I==="none"||I==="null")return null;return $}),auto_approve_flag:g$.string().optional(),output_format_flag:g$.string().optional(),output_format:g$.string().optional(),model_flag:g$.string().optional(),default_model:g$.string().optional(),isolation_env:g$.string().optional(),isolation_flags:g$.string().optional()}).passthrough().transform(($)=>({...$,prompt_flag:$.prompt_flag??void 0})),dj=g$.object({active_vendor:g$.string().optional(),vendors:g$.record(g$.string(),hj).optional()}).passthrough().transform(($)=>({active_vendor:$.active_vendor,vendors:$.vendors??{}}));function f7($){try{return p6($)}catch{return null}}function cj($){let I=f7($),_=nj.safeParse(I);if(!_.success)return{};return _.data}function pj($){let I=f7($),_=dj.safeParse(I);if(!_.success)return{vendors:{}};return{active_vendor:_.data.active_vendor,vendors:_.data.vendors}}function vv($,I){let _=$$.resolve($),u=$$.parse(_).root;while(_!==u){let U=$$.join(_,I);if(k.existsSync(U))return U;_=$$.dirname(_)}return null}function oj($){let I=vv($,$$.join(".agents","oma-config.yaml"));if(!I)return null;try{let _=k.readFileSync(I,"utf-8");return cj(_)}catch{return null}}function tj($){let I=vv($,$$.join(".agents","skills","oma-orchestrator","config","cli-config.yaml"));if(!I)return null;try{let _=k.readFileSync(I,"utf-8");return pj(_)}catch{return null}}function qv($,I){let _=process.cwd(),u=oj(_),U=tj(_),z=$.replace(/-agent$/i,""),g=u?.agent_cli_mapping?.[$]||u?.agent_cli_mapping?.[z],J=I||g||u?.default_cli||U?.active_vendor||"gemini";if(!I&&!g&&!u?.default_cli&&!U?.active_vendor)console.error(r.default.yellow(`[oma] No vendor configured for agent "${$}". Falling back to "gemini".
|
|
312
|
-
Set default_cli in .agents/oma-config.yaml or use --vendor flag.`));return{vendor:J.toLowerCase(),config:U}}function
|
|
311
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let g of $.seen.entries()){let J=g[1];if(I===g[0]){z(g);continue}if($.external){let q=$.external.registry.get(g[0])?.id;if(I!==g[0]&&q){z(g);continue}}if($.metadataRegistry.get(g[0])?.id){z(g);continue}if(J.cycle){z(g);continue}if(J.count>1){if($.reused==="ref"){z(g);continue}}}}function b6($,I){let _=$.seen.get(I);if(!_)throw Error("Unprocessed schema. This is a bug in Zod.");let u=(g)=>{let J=$.seen.get(g);if(J.ref===null)return;let G=J.def??J.schema,q={...G},N=J.ref;if(J.ref=null,N){u(N);let Q=$.seen.get(N),H=Q.schema;if(H.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))G.allOf=G.allOf??[],G.allOf.push(H);else Object.assign(G,H);if(Object.assign(G,q),g._zod.parent===N)for(let v in G){if(v==="$ref"||v==="allOf")continue;if(!(v in q))delete G[v]}if(H.$ref&&Q.def)for(let v in G){if(v==="$ref"||v==="allOf")continue;if(v in Q.def&&JSON.stringify(G[v])===JSON.stringify(Q.def[v]))delete G[v]}}let X=g._zod.parent;if(X&&X!==N){u(X);let Q=$.seen.get(X);if(Q?.schema.$ref){if(G.$ref=Q.schema.$ref,Q.def)for(let H in G){if(H==="$ref"||H==="allOf")continue;if(H in Q.def&&JSON.stringify(G[H])===JSON.stringify(Q.def[H]))delete G[H]}}}$.override({zodSchema:g,jsonSchema:G,path:J.path??[]})};for(let g of[...$.seen.entries()].reverse())u(g[0]);let U={};if($.target==="draft-2020-12")U.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")U.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")U.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let g=$.external.registry.get(I)?.id;if(!g)throw Error("Schema is missing an `id` property");U.$id=$.external.uri(g)}Object.assign(U,_.def??_.schema);let z=$.external?.defs??{};for(let g of $.seen.entries()){let J=g[1];if(J.def&&J.defId)z[J.defId]=J.def}if($.external);else if(Object.keys(z).length>0)if($.target==="draft-2020-12")U.$defs=z;else U.definitions=z;try{let g=JSON.parse(JSON.stringify(U));return Object.defineProperty(g,"~standard",{value:{...I["~standard"],jsonSchema:{input:_0(I,"input",$.processors),output:_0(I,"output",$.processors)}},enumerable:!1,writable:!1}),g}catch(g){throw Error("Error converting schema to JSON.")}}function m$($,I){let _=I??{seen:new Set};if(_.seen.has($))return!1;_.seen.add($);let u=$._zod.def;if(u.type==="transform")return!0;if(u.type==="array")return m$(u.element,_);if(u.type==="set")return m$(u.valueType,_);if(u.type==="lazy")return m$(u.getter(),_);if(u.type==="promise"||u.type==="optional"||u.type==="nonoptional"||u.type==="nullable"||u.type==="readonly"||u.type==="default"||u.type==="prefault")return m$(u.innerType,_);if(u.type==="intersection")return m$(u.left,_)||m$(u.right,_);if(u.type==="record"||u.type==="map")return m$(u.keyType,_)||m$(u.valueType,_);if(u.type==="pipe")return m$(u.in,_)||m$(u.out,_);if(u.type==="object"){for(let U in u.shape)if(m$(u.shape[U],_))return!0;return!1}if(u.type==="union"){for(let U of u.options)if(m$(U,_))return!0;return!1}if(u.type==="tuple"){for(let U of u.items)if(m$(U,_))return!0;if(u.rest&&m$(u.rest,_))return!0;return!1}return!1}var G9=($,I={})=>(_)=>{let u=W6({..._,processors:I});return u$($,u),P6(u,$),b6(u,$)},_0=($,I,_={})=>(u)=>{let{libraryOptions:U,target:z}=u??{},g=W6({...U??{},target:z,io:I,processors:_});return u$($,g),P6(g,$),b6(g,$)};var Rj={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},q9=($,I,_,u)=>{let U=_;U.type="string";let{minimum:z,maximum:g,format:J,patterns:G,contentEncoding:q}=$._zod.bag;if(typeof z==="number")U.minLength=z;if(typeof g==="number")U.maxLength=g;if(J){if(U.format=Rj[J]??J,U.format==="")delete U.format;if(J==="time")delete U.format}if(q)U.contentEncoding=q;if(G&&G.size>0){let N=[...G];if(N.length===1)U.pattern=N[0].source;else if(N.length>1)U.allOf=[...N.map((X)=>({...I.target==="draft-07"||I.target==="draft-04"||I.target==="openapi-3.0"?{type:"string"}:{},pattern:X.source}))]}},X9=($,I,_,u)=>{let U=_,{minimum:z,maximum:g,format:J,multipleOf:G,exclusiveMaximum:q,exclusiveMinimum:N}=$._zod.bag;if(typeof J==="string"&&J.includes("int"))U.type="integer";else U.type="number";if(typeof N==="number")if(I.target==="draft-04"||I.target==="openapi-3.0")U.minimum=N,U.exclusiveMinimum=!0;else U.exclusiveMinimum=N;if(typeof z==="number"){if(U.minimum=z,typeof N==="number"&&I.target!=="draft-04")if(N>=z)delete U.minimum;else delete U.exclusiveMinimum}if(typeof q==="number")if(I.target==="draft-04"||I.target==="openapi-3.0")U.maximum=q,U.exclusiveMaximum=!0;else U.exclusiveMaximum=q;if(typeof g==="number"){if(U.maximum=g,typeof q==="number"&&I.target!=="draft-04")if(q<=g)delete U.maximum;else delete U.exclusiveMaximum}if(typeof G==="number")U.multipleOf=G},N9=($,I,_,u)=>{_.type="boolean"},Q9=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},v9=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},H9=($,I,_,u)=>{if(I.target==="openapi-3.0")_.type="string",_.nullable=!0,_.enum=[null];else _.type="null"},Y9=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},O9=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},T9=($,I,_,u)=>{_.not={}},B9=($,I,_,u)=>{},D9=($,I,_,u)=>{},M9=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},K9=($,I,_,u)=>{let U=$._zod.def,z=UI(U.entries);if(z.every((g)=>typeof g==="number"))_.type="number";if(z.every((g)=>typeof g==="string"))_.type="string";_.enum=z},V9=($,I,_,u)=>{let U=$._zod.def,z=[];for(let g of U.values)if(g===void 0){if(I.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof g==="bigint")if(I.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else z.push(Number(g));else z.push(g);if(z.length===0);else if(z.length===1){let g=z[0];if(_.type=g===null?"null":typeof g,I.target==="draft-04"||I.target==="openapi-3.0")_.enum=[g];else _.const=g}else{if(z.every((g)=>typeof g==="number"))_.type="number";if(z.every((g)=>typeof g==="string"))_.type="string";if(z.every((g)=>typeof g==="boolean"))_.type="boolean";if(z.every((g)=>g===null))_.type="null";_.enum=z}},R9=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},L9=($,I,_,u)=>{let U=_,z=$._zod.pattern;if(!z)throw Error("Pattern not found in template literal");U.type="string",U.pattern=z.source},Z9=($,I,_,u)=>{let U=_,z={type:"string",format:"binary",contentEncoding:"binary"},{minimum:g,maximum:J,mime:G}=$._zod.bag;if(g!==void 0)z.minLength=g;if(J!==void 0)z.maxLength=J;if(G)if(G.length===1)z.contentMediaType=G[0],Object.assign(U,z);else Object.assign(U,z),U.anyOf=G.map((q)=>({contentMediaType:q}));else Object.assign(U,z)},W9=($,I,_,u)=>{_.type="boolean"},P9=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},b9=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},A9=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},j9=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},F9=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},S9=($,I,_,u)=>{let U=_,z=$._zod.def,{minimum:g,maximum:J}=$._zod.bag;if(typeof g==="number")U.minItems=g;if(typeof J==="number")U.maxItems=J;U.type="array",U.items=u$(z.element,I,{...u,path:[...u.path,"items"]})},w9=($,I,_,u)=>{let U=_,z=$._zod.def;U.type="object",U.properties={};let g=z.shape;for(let q in g)U.properties[q]=u$(g[q],I,{...u,path:[...u.path,"properties",q]});let J=new Set(Object.keys(g)),G=new Set([...J].filter((q)=>{let N=z.shape[q]._zod;if(I.io==="input")return N.optin===void 0;else return N.optout===void 0}));if(G.size>0)U.required=Array.from(G);if(z.catchall?._zod.def.type==="never")U.additionalProperties=!1;else if(!z.catchall){if(I.io==="output")U.additionalProperties=!1}else if(z.catchall)U.additionalProperties=u$(z.catchall,I,{...u,path:[...u.path,"additionalProperties"]})},e_=($,I,_,u)=>{let U=$._zod.def,z=U.inclusive===!1,g=U.options.map((J,G)=>u$(J,I,{...u,path:[...u.path,z?"oneOf":"anyOf",G]}));if(z)_.oneOf=g;else _.anyOf=g},E9=($,I,_,u)=>{let U=$._zod.def,z=u$(U.left,I,{...u,path:[...u.path,"allOf",0]}),g=u$(U.right,I,{...u,path:[...u.path,"allOf",1]}),J=(q)=>("allOf"in q)&&Object.keys(q).length===1,G=[...J(z)?z.allOf:[z],...J(g)?g.allOf:[g]];_.allOf=G},C9=($,I,_,u)=>{let U=_,z=$._zod.def;U.type="array";let g=I.target==="draft-2020-12"?"prefixItems":"items",J=I.target==="draft-2020-12"?"items":I.target==="openapi-3.0"?"items":"additionalItems",G=z.items.map((Q,H)=>u$(Q,I,{...u,path:[...u.path,g,H]})),q=z.rest?u$(z.rest,I,{...u,path:[...u.path,J,...I.target==="openapi-3.0"?[z.items.length]:[]]}):null;if(I.target==="draft-2020-12"){if(U.prefixItems=G,q)U.items=q}else if(I.target==="openapi-3.0"){if(U.items={anyOf:G},q)U.items.anyOf.push(q);if(U.minItems=G.length,!q)U.maxItems=G.length}else if(U.items=G,q)U.additionalItems=q;let{minimum:N,maximum:X}=$._zod.bag;if(typeof N==="number")U.minItems=N;if(typeof X==="number")U.maxItems=X},f9=($,I,_,u)=>{let U=_,z=$._zod.def;U.type="object";let g=z.keyType,G=g._zod.bag?.patterns;if(z.mode==="loose"&&G&&G.size>0){let N=u$(z.valueType,I,{...u,path:[...u.path,"patternProperties","*"]});U.patternProperties={};for(let X of G)U.patternProperties[X.source]=N}else{if(I.target==="draft-07"||I.target==="draft-2020-12")U.propertyNames=u$(z.keyType,I,{...u,path:[...u.path,"propertyNames"]});U.additionalProperties=u$(z.valueType,I,{...u,path:[...u.path,"additionalProperties"]})}let q=g._zod.values;if(q){let N=[...q].filter((X)=>typeof X==="string"||typeof X==="number");if(N.length>0)U.required=N}},x9=($,I,_,u)=>{let U=$._zod.def,z=u$(U.innerType,I,u),g=I.seen.get($);if(I.target==="openapi-3.0")g.ref=U.innerType,_.nullable=!0;else _.anyOf=[z,{type:"null"}]},k9=($,I,_,u)=>{let U=$._zod.def;u$(U.innerType,I,u);let z=I.seen.get($);z.ref=U.innerType},y9=($,I,_,u)=>{let U=$._zod.def;u$(U.innerType,I,u);let z=I.seen.get($);z.ref=U.innerType,_.default=JSON.parse(JSON.stringify(U.defaultValue))},i9=($,I,_,u)=>{let U=$._zod.def;u$(U.innerType,I,u);let z=I.seen.get($);if(z.ref=U.innerType,I.io==="input")_._prefault=JSON.parse(JSON.stringify(U.defaultValue))},l9=($,I,_,u)=>{let U=$._zod.def;u$(U.innerType,I,u);let z=I.seen.get($);z.ref=U.innerType;let g;try{g=U.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}_.default=g},m9=($,I,_,u)=>{let U=$._zod.def,z=I.io==="input"?U.in._zod.def.type==="transform"?U.out:U.in:U.out;u$(z,I,u);let g=I.seen.get($);g.ref=z},r9=($,I,_,u)=>{let U=$._zod.def;u$(U.innerType,I,u);let z=I.seen.get($);z.ref=U.innerType,_.readOnly=!0},n9=($,I,_,u)=>{let U=$._zod.def;u$(U.innerType,I,u);let z=I.seen.get($);z.ref=U.innerType},s_=($,I,_,u)=>{let U=$._zod.def;u$(U.innerType,I,u);let z=I.seen.get($);z.ref=U.innerType},h9=($,I,_,u)=>{let U=$._zod.innerType;u$(U,I,u);let z=I.seen.get($);z.ref=U},a_={string:q9,number:X9,boolean:N9,bigint:Q9,symbol:v9,null:H9,undefined:Y9,void:O9,never:T9,any:B9,unknown:D9,date:M9,enum:K9,literal:V9,nan:R9,template_literal:L9,file:Z9,success:W9,custom:P9,function:b9,transform:A9,map:j9,set:F9,array:S9,object:w9,union:e_,intersection:E9,tuple:C9,record:f9,nullable:x9,nonoptional:k9,default:y9,prefault:i9,catch:l9,pipe:m9,readonly:r9,promise:n9,optional:s_,lazy:h9};function $u($,I){if("_idmap"in $){let u=$,U=W6({...I,processors:a_}),z={};for(let G of u._idmap.entries()){let[q,N]=G;u$(N,U)}let g={},J={registry:u,uri:I?.uri,defs:z};U.external=J;for(let G of u._idmap.entries()){let[q,N]=G;P6(U,N),g[q]=b6(U,N)}if(Object.keys(z).length>0){let G=U.target==="draft-2020-12"?"$defs":"definitions";g.__shared={[G]:z}}return{schemas:g}}let _=W6({...I,processors:a_});return u$($,_),P6(_,$),b6(_,$)}class d9{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter($){this.ctx.counter=$}get seen(){return this.ctx.seen}constructor($){let I=$?.target??"draft-2020-12";if(I==="draft-4")I="draft-04";if(I==="draft-7")I="draft-07";this.ctx=W6({processors:a_,target:I,...$?.metadata&&{metadata:$.metadata},...$?.unrepresentable&&{unrepresentable:$.unrepresentable},...$?.override&&{override:$.override},...$?.io&&{io:$.io}})}process($,I={path:[],schemaPath:[]}){return u$($,this.ctx,I)}emit($,I){if(I){if(I.cycles)this.ctx.cycles=I.cycles;if(I.reused)this.ctx.reused=I.reused;if(I.external)this.ctx.external=I.external}P6(this.ctx,$);let _=b6(this.ctx,$),{"~standard":u,...U}=_;return U}}var G7={};var RI={};S4(RI,{xor:()=>$v,xid:()=>R7,void:()=>p7,uuidv7:()=>Y7,uuidv6:()=>H7,uuidv4:()=>v7,uuid:()=>Q7,url:()=>O7,unknown:()=>_1,union:()=>Pu,undefined:()=>d7,ulid:()=>V7,uint64:()=>n7,uint32:()=>l7,tuple:()=>WG,transform:()=>Au,templateLiteral:()=>vv,symbol:()=>h7,superRefine:()=>sG,success:()=>Xv,stringbool:()=>Kv,stringFormat:()=>E7,string:()=>gu,strictObject:()=>e7,set:()=>zv,refine:()=>eG,record:()=>PG,readonly:()=>dG,promise:()=>Hv,preprocess:()=>Rv,prefault:()=>yG,pipe:()=>PI,partialRecord:()=>Uv,optional:()=>ZI,object:()=>a7,number:()=>XG,nullish:()=>qv,nullable:()=>WI,null:()=>YG,nonoptional:()=>iG,never:()=>Wu,nativeEnum:()=>gv,nanoid:()=>D7,nan:()=>Nv,meta:()=>Dv,map:()=>uv,mac:()=>W7,looseRecord:()=>_v,looseObject:()=>s7,literal:()=>Jv,lazy:()=>oG,ksuid:()=>L7,keyof:()=>t7,jwt:()=>w7,json:()=>Vv,ipv6:()=>P7,ipv4:()=>Z7,intersection:()=>LG,int64:()=>r7,int32:()=>i7,int:()=>Ju,instanceof:()=>Mv,httpUrl:()=>T7,hostname:()=>C7,hex:()=>f7,hash:()=>x7,guid:()=>N7,function:()=>Yv,float64:()=>y7,float32:()=>k7,file:()=>Gv,exactOptional:()=>EG,enum:()=>bu,emoji:()=>B7,email:()=>X7,e164:()=>S7,discriminatedUnion:()=>Iv,describe:()=>Bv,date:()=>o7,custom:()=>Tv,cuid2:()=>K7,cuid:()=>M7,codec:()=>Qv,cidrv6:()=>A7,cidrv4:()=>b7,check:()=>Ov,catch:()=>rG,boolean:()=>NG,bigint:()=>m7,base64url:()=>F7,base64:()=>j7,array:()=>jI,any:()=>c7,_function:()=>Yv,_default:()=>xG,_ZodString:()=>Gu,ZodXor:()=>KG,ZodXID:()=>Yu,ZodVoid:()=>DG,ZodUnknown:()=>TG,ZodUnion:()=>SI,ZodUndefined:()=>vG,ZodUUID:()=>y4,ZodURL:()=>bI,ZodULID:()=>Hu,ZodType:()=>d,ZodTuple:()=>ZG,ZodTransform:()=>SG,ZodTemplateLiteral:()=>cG,ZodSymbol:()=>QG,ZodSuccess:()=>lG,ZodStringFormat:()=>G$,ZodString:()=>g0,ZodSet:()=>AG,ZodRecord:()=>wI,ZodReadonly:()=>hG,ZodPromise:()=>tG,ZodPrefault:()=>kG,ZodPipe:()=>Su,ZodOptional:()=>ju,ZodObject:()=>FI,ZodNumberFormat:()=>u1,ZodNumber:()=>G0,ZodNullable:()=>CG,ZodNull:()=>HG,ZodNonOptional:()=>Fu,ZodNever:()=>BG,ZodNanoID:()=>Nu,ZodNaN:()=>nG,ZodMap:()=>bG,ZodMAC:()=>qG,ZodLiteral:()=>jG,ZodLazy:()=>pG,ZodKSUID:()=>Ou,ZodJWT:()=>Lu,ZodIntersection:()=>RG,ZodIPv6:()=>Bu,ZodIPv4:()=>Tu,ZodGUID:()=>LI,ZodFunction:()=>aG,ZodFile:()=>FG,ZodExactOptional:()=>wG,ZodEnum:()=>z0,ZodEmoji:()=>Xu,ZodEmail:()=>qu,ZodE164:()=>Ru,ZodDiscriminatedUnion:()=>VG,ZodDefault:()=>fG,ZodDate:()=>AI,ZodCustomStringFormat:()=>J0,ZodCustom:()=>EI,ZodCodec:()=>wu,ZodCatch:()=>mG,ZodCUID2:()=>vu,ZodCUID:()=>Qu,ZodCIDRv6:()=>Mu,ZodCIDRv4:()=>Du,ZodBoolean:()=>q0,ZodBigIntFormat:()=>Zu,ZodBigInt:()=>X0,ZodBase64URL:()=>Vu,ZodBase64:()=>Ku,ZodArray:()=>MG,ZodAny:()=>OG});var Iu={};S4(Iu,{uppercase:()=>d1,trim:()=>e1,toUpperCase:()=>$0,toLowerCase:()=>s1,startsWith:()=>p1,slugify:()=>I0,size:()=>$1,regex:()=>n1,property:()=>t_,positive:()=>d_,overwrite:()=>K4,normalize:()=>a1,nonpositive:()=>p_,nonnegative:()=>o_,negative:()=>c_,multipleOf:()=>L6,minSize:()=>k4,minLength:()=>t4,mime:()=>t1,maxSize:()=>Z6,maxLength:()=>I1,lte:()=>u4,lt:()=>f4,lowercase:()=>h1,length:()=>U1,includes:()=>c1,gte:()=>l$,gt:()=>x4,endsWith:()=>o1});var u0={};S4(u0,{time:()=>o9,duration:()=>t9,datetime:()=>c9,date:()=>p9,ZodISOTime:()=>uu,ZodISODuration:()=>zu,ZodISODateTime:()=>Uu,ZodISODate:()=>_u});var Uu=B("ZodISODateTime",($,I)=>{jJ.init($,I),G$.init($,I)});function c9($){return P3(Uu,$)}var _u=B("ZodISODate",($,I)=>{FJ.init($,I),G$.init($,I)});function p9($){return b3(_u,$)}var uu=B("ZodISOTime",($,I)=>{SJ.init($,I),G$.init($,I)});function o9($){return A3(uu,$)}var zu=B("ZodISODuration",($,I)=>{wJ.init($,I),G$.init($,I)});function t9($){return j3(zu,$)}var q7=($,I)=>{JI.init($,I),$.name="ZodError",Object.defineProperties($,{format:{value:(_)=>qI($,_)},flatten:{value:(_)=>GI($,_)},addIssue:{value:(_)=>{$.issues.push(_),$.message=JSON.stringify($.issues,C1,2)}},addIssues:{value:(_)=>{$.issues.push(..._),$.message=JSON.stringify($.issues,C1,2)}},isEmpty:{get(){return $.issues.length===0}}})},Zj=B("ZodError",q7),s$=B("ZodError",q7,{Parent:Error});var a9=k1(s$),e9=y1(s$),s9=i1(s$),$G=l1(s$),IG=u_(s$),UG=z_(s$),_G=g_(s$),uG=J_(s$),zG=G_(s$),gG=q_(s$),JG=X_(s$),GG=N_(s$);var d=B("ZodType",($,I)=>{return n.init($,I),Object.assign($["~standard"],{jsonSchema:{input:_0($,"input"),output:_0($,"output")}}),$.toJSONSchema=G9($,{}),$.def=I,$.type=I.type,Object.defineProperty($,"_def",{value:I}),$.check=(..._)=>{return $.clone(F.mergeDefs(I,{checks:[...I.checks??[],..._.map((u)=>typeof u==="function"?{_zod:{check:u,def:{check:"custom"},onattach:[]}}:u)]}),{parent:!0})},$.with=$.check,$.clone=(_,u)=>i$($,_,u),$.brand=()=>$,$.register=(_,u)=>{return _.add($,u),$},$.parse=(_,u)=>a9($,_,u,{callee:$.parse}),$.safeParse=(_,u)=>s9($,_,u),$.parseAsync=async(_,u)=>e9($,_,u,{callee:$.parseAsync}),$.safeParseAsync=async(_,u)=>$G($,_,u),$.spa=$.safeParseAsync,$.encode=(_,u)=>IG($,_,u),$.decode=(_,u)=>UG($,_,u),$.encodeAsync=async(_,u)=>_G($,_,u),$.decodeAsync=async(_,u)=>uG($,_,u),$.safeEncode=(_,u)=>zG($,_,u),$.safeDecode=(_,u)=>gG($,_,u),$.safeEncodeAsync=async(_,u)=>JG($,_,u),$.safeDecodeAsync=async(_,u)=>GG($,_,u),$.refine=(_,u)=>$.check(eG(_,u)),$.superRefine=(_)=>$.check(sG(_)),$.overwrite=(_)=>$.check(K4(_)),$.optional=()=>ZI($),$.exactOptional=()=>EG($),$.nullable=()=>WI($),$.nullish=()=>ZI(WI($)),$.nonoptional=(_)=>iG($,_),$.array=()=>jI($),$.or=(_)=>Pu([$,_]),$.and=(_)=>LG($,_),$.transform=(_)=>PI($,Au(_)),$.default=(_)=>xG($,_),$.prefault=(_)=>yG($,_),$.catch=(_)=>rG($,_),$.pipe=(_)=>PI($,_),$.readonly=()=>dG($),$.describe=(_)=>{let u=$.clone();return S$.add(u,{description:_}),u},Object.defineProperty($,"description",{get(){return S$.get($)?.description},configurable:!0}),$.meta=(..._)=>{if(_.length===0)return S$.get($);let u=$.clone();return S$.add(u,_[0]),u},$.isOptional=()=>$.safeParse(void 0).success,$.isNullable=()=>$.safeParse(null).success,$.apply=(_)=>_($),$}),Gu=B("_ZodString",($,I)=>{s6.init($,I),d.init($,I),$._zod.processJSONSchema=(u,U,z)=>q9($,u,U,z);let _=$._zod.bag;$.format=_.format??null,$.minLength=_.minimum??null,$.maxLength=_.maximum??null,$.regex=(...u)=>$.check(n1(...u)),$.includes=(...u)=>$.check(c1(...u)),$.startsWith=(...u)=>$.check(p1(...u)),$.endsWith=(...u)=>$.check(o1(...u)),$.min=(...u)=>$.check(t4(...u)),$.max=(...u)=>$.check(I1(...u)),$.length=(...u)=>$.check(U1(...u)),$.nonempty=(...u)=>$.check(t4(1,...u)),$.lowercase=(u)=>$.check(h1(u)),$.uppercase=(u)=>$.check(d1(u)),$.trim=()=>$.check(e1()),$.normalize=(...u)=>$.check(a1(...u)),$.toLowerCase=()=>$.check(s1()),$.toUpperCase=()=>$.check($0()),$.slugify=()=>$.check(I0())}),g0=B("ZodString",($,I)=>{s6.init($,I),Gu.init($,I),$.email=(_)=>$.check(W_(qu,_)),$.url=(_)=>$.check(VI(bI,_)),$.jwt=(_)=>$.check(h_(Lu,_)),$.emoji=(_)=>$.check(F_(Xu,_)),$.guid=(_)=>$.check(KI(LI,_)),$.uuid=(_)=>$.check(P_(y4,_)),$.uuidv4=(_)=>$.check(b_(y4,_)),$.uuidv6=(_)=>$.check(A_(y4,_)),$.uuidv7=(_)=>$.check(j_(y4,_)),$.nanoid=(_)=>$.check(S_(Nu,_)),$.guid=(_)=>$.check(KI(LI,_)),$.cuid=(_)=>$.check(w_(Qu,_)),$.cuid2=(_)=>$.check(E_(vu,_)),$.ulid=(_)=>$.check(C_(Hu,_)),$.base64=(_)=>$.check(m_(Ku,_)),$.base64url=(_)=>$.check(r_(Vu,_)),$.xid=(_)=>$.check(f_(Yu,_)),$.ksuid=(_)=>$.check(x_(Ou,_)),$.ipv4=(_)=>$.check(k_(Tu,_)),$.ipv6=(_)=>$.check(y_(Bu,_)),$.cidrv4=(_)=>$.check(i_(Du,_)),$.cidrv6=(_)=>$.check(l_(Mu,_)),$.e164=(_)=>$.check(n_(Ru,_)),$.datetime=(_)=>$.check(c9(_)),$.date=(_)=>$.check(p9(_)),$.time=(_)=>$.check(o9(_)),$.duration=(_)=>$.check(t9(_))});function gu($){return R3(g0,$)}var G$=B("ZodStringFormat",($,I)=>{J$.init($,I),Gu.init($,I)}),qu=B("ZodEmail",($,I)=>{KJ.init($,I),G$.init($,I)});function X7($){return W_(qu,$)}var LI=B("ZodGUID",($,I)=>{DJ.init($,I),G$.init($,I)});function N7($){return KI(LI,$)}var y4=B("ZodUUID",($,I)=>{MJ.init($,I),G$.init($,I)});function Q7($){return P_(y4,$)}function v7($){return b_(y4,$)}function H7($){return A_(y4,$)}function Y7($){return j_(y4,$)}var bI=B("ZodURL",($,I)=>{VJ.init($,I),G$.init($,I)});function O7($){return VI(bI,$)}function T7($){return VI(bI,{protocol:/^https?$/,hostname:v4.domain,...F.normalizeParams($)})}var Xu=B("ZodEmoji",($,I)=>{RJ.init($,I),G$.init($,I)});function B7($){return F_(Xu,$)}var Nu=B("ZodNanoID",($,I)=>{LJ.init($,I),G$.init($,I)});function D7($){return S_(Nu,$)}var Qu=B("ZodCUID",($,I)=>{ZJ.init($,I),G$.init($,I)});function M7($){return w_(Qu,$)}var vu=B("ZodCUID2",($,I)=>{WJ.init($,I),G$.init($,I)});function K7($){return E_(vu,$)}var Hu=B("ZodULID",($,I)=>{PJ.init($,I),G$.init($,I)});function V7($){return C_(Hu,$)}var Yu=B("ZodXID",($,I)=>{bJ.init($,I),G$.init($,I)});function R7($){return f_(Yu,$)}var Ou=B("ZodKSUID",($,I)=>{AJ.init($,I),G$.init($,I)});function L7($){return x_(Ou,$)}var Tu=B("ZodIPv4",($,I)=>{EJ.init($,I),G$.init($,I)});function Z7($){return k_(Tu,$)}var qG=B("ZodMAC",($,I)=>{fJ.init($,I),G$.init($,I)});function W7($){return Z3(qG,$)}var Bu=B("ZodIPv6",($,I)=>{CJ.init($,I),G$.init($,I)});function P7($){return y_(Bu,$)}var Du=B("ZodCIDRv4",($,I)=>{xJ.init($,I),G$.init($,I)});function b7($){return i_(Du,$)}var Mu=B("ZodCIDRv6",($,I)=>{kJ.init($,I),G$.init($,I)});function A7($){return l_(Mu,$)}var Ku=B("ZodBase64",($,I)=>{iJ.init($,I),G$.init($,I)});function j7($){return m_(Ku,$)}var Vu=B("ZodBase64URL",($,I)=>{lJ.init($,I),G$.init($,I)});function F7($){return r_(Vu,$)}var Ru=B("ZodE164",($,I)=>{mJ.init($,I),G$.init($,I)});function S7($){return n_(Ru,$)}var Lu=B("ZodJWT",($,I)=>{rJ.init($,I),G$.init($,I)});function w7($){return h_(Lu,$)}var J0=B("ZodCustomStringFormat",($,I)=>{nJ.init($,I),G$.init($,I)});function E7($,I,_={}){return U0(J0,$,I,_)}function C7($){return U0(J0,"hostname",v4.hostname,$)}function f7($){return U0(J0,"hex",v4.hex,$)}function x7($,I){let _=I?.enc??"hex",u=`${$}_${_}`,U=v4[u];if(!U)throw Error(`Unrecognized hash format: ${u}`);return U0(J0,u,U,I)}var G0=B("ZodNumber",($,I)=>{K_.init($,I),d.init($,I),$._zod.processJSONSchema=(u,U,z)=>X9($,u,U,z),$.gt=(u,U)=>$.check(x4(u,U)),$.gte=(u,U)=>$.check(l$(u,U)),$.min=(u,U)=>$.check(l$(u,U)),$.lt=(u,U)=>$.check(f4(u,U)),$.lte=(u,U)=>$.check(u4(u,U)),$.max=(u,U)=>$.check(u4(u,U)),$.int=(u)=>$.check(Ju(u)),$.safe=(u)=>$.check(Ju(u)),$.positive=(u)=>$.check(x4(0,u)),$.nonnegative=(u)=>$.check(l$(0,u)),$.negative=(u)=>$.check(f4(0,u)),$.nonpositive=(u)=>$.check(u4(0,u)),$.multipleOf=(u,U)=>$.check(L6(u,U)),$.step=(u,U)=>$.check(L6(u,U)),$.finite=()=>$;let _=$._zod.bag;$.minValue=Math.max(_.minimum??Number.NEGATIVE_INFINITY,_.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,$.maxValue=Math.min(_.maximum??Number.POSITIVE_INFINITY,_.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,$.isInt=(_.format??"").includes("int")||Number.isSafeInteger(_.multipleOf??0.5),$.isFinite=!0,$.format=_.format??null});function XG($){return F3(G0,$)}var u1=B("ZodNumberFormat",($,I)=>{hJ.init($,I),G0.init($,I)});function Ju($){return w3(u1,$)}function k7($){return E3(u1,$)}function y7($){return C3(u1,$)}function i7($){return f3(u1,$)}function l7($){return x3(u1,$)}var q0=B("ZodBoolean",($,I)=>{vI.init($,I),d.init($,I),$._zod.processJSONSchema=(_,u,U)=>N9($,_,u,U)});function NG($){return k3(q0,$)}var X0=B("ZodBigInt",($,I)=>{V_.init($,I),d.init($,I),$._zod.processJSONSchema=(u,U,z)=>Q9($,u,U,z),$.gte=(u,U)=>$.check(l$(u,U)),$.min=(u,U)=>$.check(l$(u,U)),$.gt=(u,U)=>$.check(x4(u,U)),$.gte=(u,U)=>$.check(l$(u,U)),$.min=(u,U)=>$.check(l$(u,U)),$.lt=(u,U)=>$.check(f4(u,U)),$.lte=(u,U)=>$.check(u4(u,U)),$.max=(u,U)=>$.check(u4(u,U)),$.positive=(u)=>$.check(x4(BigInt(0),u)),$.negative=(u)=>$.check(f4(BigInt(0),u)),$.nonpositive=(u)=>$.check(u4(BigInt(0),u)),$.nonnegative=(u)=>$.check(l$(BigInt(0),u)),$.multipleOf=(u,U)=>$.check(L6(u,U));let _=$._zod.bag;$.minValue=_.minimum??null,$.maxValue=_.maximum??null,$.format=_.format??null});function m7($){return i3(X0,$)}var Zu=B("ZodBigIntFormat",($,I)=>{dJ.init($,I),X0.init($,I)});function r7($){return m3(Zu,$)}function n7($){return r3(Zu,$)}var QG=B("ZodSymbol",($,I)=>{cJ.init($,I),d.init($,I),$._zod.processJSONSchema=(_,u,U)=>v9($,_,u,U)});function h7($){return n3(QG,$)}var vG=B("ZodUndefined",($,I)=>{pJ.init($,I),d.init($,I),$._zod.processJSONSchema=(_,u,U)=>Y9($,_,u,U)});function d7($){return h3(vG,$)}var HG=B("ZodNull",($,I)=>{oJ.init($,I),d.init($,I),$._zod.processJSONSchema=(_,u,U)=>H9($,_,u,U)});function YG($){return d3(HG,$)}var OG=B("ZodAny",($,I)=>{tJ.init($,I),d.init($,I),$._zod.processJSONSchema=(_,u,U)=>B9($,_,u,U)});function c7(){return c3(OG)}var TG=B("ZodUnknown",($,I)=>{aJ.init($,I),d.init($,I),$._zod.processJSONSchema=(_,u,U)=>D9($,_,u,U)});function _1(){return p3(TG)}var BG=B("ZodNever",($,I)=>{eJ.init($,I),d.init($,I),$._zod.processJSONSchema=(_,u,U)=>T9($,_,u,U)});function Wu($){return o3(BG,$)}var DG=B("ZodVoid",($,I)=>{sJ.init($,I),d.init($,I),$._zod.processJSONSchema=(_,u,U)=>O9($,_,u,U)});function p7($){return t3(DG,$)}var AI=B("ZodDate",($,I)=>{$8.init($,I),d.init($,I),$._zod.processJSONSchema=(u,U,z)=>M9($,u,U,z),$.min=(u,U)=>$.check(l$(u,U)),$.max=(u,U)=>$.check(u4(u,U));let _=$._zod.bag;$.minDate=_.minimum?new Date(_.minimum):null,$.maxDate=_.maximum?new Date(_.maximum):null});function o7($){return a3(AI,$)}var MG=B("ZodArray",($,I)=>{I8.init($,I),d.init($,I),$._zod.processJSONSchema=(_,u,U)=>S9($,_,u,U),$.element=I.element,$.min=(_,u)=>$.check(t4(_,u)),$.nonempty=(_)=>$.check(t4(1,_)),$.max=(_,u)=>$.check(I1(_,u)),$.length=(_,u)=>$.check(U1(_,u)),$.unwrap=()=>$.element});function jI($,I){return $9(MG,$,I)}function t7($){let I=$._zod.def.shape;return bu(Object.keys(I))}var FI=B("ZodObject",($,I)=>{U8.init($,I),d.init($,I),$._zod.processJSONSchema=(_,u,U)=>w9($,_,u,U),F.defineLazy($,"shape",()=>{return I.shape}),$.keyof=()=>bu(Object.keys($._zod.def.shape)),$.catchall=(_)=>$.clone({...$._zod.def,catchall:_}),$.passthrough=()=>$.clone({...$._zod.def,catchall:_1()}),$.loose=()=>$.clone({...$._zod.def,catchall:_1()}),$.strict=()=>$.clone({...$._zod.def,catchall:Wu()}),$.strip=()=>$.clone({...$._zod.def,catchall:void 0}),$.extend=(_)=>{return F.extend($,_)},$.safeExtend=(_)=>{return F.safeExtend($,_)},$.merge=(_)=>F.merge($,_),$.pick=(_)=>F.pick($,_),$.omit=(_)=>F.omit($,_),$.partial=(..._)=>F.partial(ju,$,_[0]),$.required=(..._)=>F.required(Fu,$,_[0])});function a7($,I){let _={type:"object",shape:$??{},...F.normalizeParams(I)};return new FI(_)}function e7($,I){return new FI({type:"object",shape:$,catchall:Wu(),...F.normalizeParams(I)})}function s7($,I){return new FI({type:"object",shape:$,catchall:_1(),...F.normalizeParams(I)})}var SI=B("ZodUnion",($,I)=>{HI.init($,I),d.init($,I),$._zod.processJSONSchema=(_,u,U)=>e_($,_,u,U),$.options=I.options});function Pu($,I){return new SI({type:"union",options:$,...F.normalizeParams(I)})}var KG=B("ZodXor",($,I)=>{SI.init($,I),_8.init($,I),$._zod.processJSONSchema=(_,u,U)=>e_($,_,u,U),$.options=I.options});function $v($,I){return new KG({type:"union",options:$,inclusive:!1,...F.normalizeParams(I)})}var VG=B("ZodDiscriminatedUnion",($,I)=>{SI.init($,I),u8.init($,I)});function Iv($,I,_){return new VG({type:"union",options:I,discriminator:$,...F.normalizeParams(_)})}var RG=B("ZodIntersection",($,I)=>{z8.init($,I),d.init($,I),$._zod.processJSONSchema=(_,u,U)=>E9($,_,u,U)});function LG($,I){return new RG({type:"intersection",left:$,right:I})}var ZG=B("ZodTuple",($,I)=>{R_.init($,I),d.init($,I),$._zod.processJSONSchema=(_,u,U)=>C9($,_,u,U),$.rest=(_)=>$.clone({...$._zod.def,rest:_})});function WG($,I,_){let u=I instanceof n,U=u?_:I;return new ZG({type:"tuple",items:$,rest:u?I:null,...F.normalizeParams(U)})}var wI=B("ZodRecord",($,I)=>{g8.init($,I),d.init($,I),$._zod.processJSONSchema=(_,u,U)=>f9($,_,u,U),$.keyType=I.keyType,$.valueType=I.valueType});function PG($,I,_){return new wI({type:"record",keyType:$,valueType:I,...F.normalizeParams(_)})}function Uv($,I,_){let u=i$($);return u._zod.values=void 0,new wI({type:"record",keyType:u,valueType:I,...F.normalizeParams(_)})}function _v($,I,_){return new wI({type:"record",keyType:$,valueType:I,mode:"loose",...F.normalizeParams(_)})}var bG=B("ZodMap",($,I)=>{J8.init($,I),d.init($,I),$._zod.processJSONSchema=(_,u,U)=>j9($,_,u,U),$.keyType=I.keyType,$.valueType=I.valueType,$.min=(..._)=>$.check(k4(..._)),$.nonempty=(_)=>$.check(k4(1,_)),$.max=(..._)=>$.check(Z6(..._)),$.size=(..._)=>$.check($1(..._))});function uv($,I,_){return new bG({type:"map",keyType:$,valueType:I,...F.normalizeParams(_)})}var AG=B("ZodSet",($,I)=>{G8.init($,I),d.init($,I),$._zod.processJSONSchema=(_,u,U)=>F9($,_,u,U),$.min=(..._)=>$.check(k4(..._)),$.nonempty=(_)=>$.check(k4(1,_)),$.max=(..._)=>$.check(Z6(..._)),$.size=(..._)=>$.check($1(..._))});function zv($,I){return new AG({type:"set",valueType:$,...F.normalizeParams(I)})}var z0=B("ZodEnum",($,I)=>{q8.init($,I),d.init($,I),$._zod.processJSONSchema=(u,U,z)=>K9($,u,U,z),$.enum=I.entries,$.options=Object.values(I.entries);let _=new Set(Object.keys(I.entries));$.extract=(u,U)=>{let z={};for(let g of u)if(_.has(g))z[g]=I.entries[g];else throw Error(`Key ${g} not found in enum`);return new z0({...I,checks:[],...F.normalizeParams(U),entries:z})},$.exclude=(u,U)=>{let z={...I.entries};for(let g of u)if(_.has(g))delete z[g];else throw Error(`Key ${g} not found in enum`);return new z0({...I,checks:[],...F.normalizeParams(U),entries:z})}});function bu($,I){let _=Array.isArray($)?Object.fromEntries($.map((u)=>[u,u])):$;return new z0({type:"enum",entries:_,...F.normalizeParams(I)})}function gv($,I){return new z0({type:"enum",entries:$,...F.normalizeParams(I)})}var jG=B("ZodLiteral",($,I)=>{X8.init($,I),d.init($,I),$._zod.processJSONSchema=(_,u,U)=>V9($,_,u,U),$.values=new Set(I.values),Object.defineProperty($,"value",{get(){if(I.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return I.values[0]}})});function Jv($,I){return new jG({type:"literal",values:Array.isArray($)?$:[$],...F.normalizeParams(I)})}var FG=B("ZodFile",($,I)=>{N8.init($,I),d.init($,I),$._zod.processJSONSchema=(_,u,U)=>Z9($,_,u,U),$.min=(_,u)=>$.check(k4(_,u)),$.max=(_,u)=>$.check(Z6(_,u)),$.mime=(_,u)=>$.check(t1(Array.isArray(_)?_:[_],u))});function Gv($){return I9(FG,$)}var SG=B("ZodTransform",($,I)=>{Q8.init($,I),d.init($,I),$._zod.processJSONSchema=(_,u,U)=>A9($,_,u,U),$._zod.parse=(_,u)=>{if(u.direction==="backward")throw new t6($.constructor.name);_.addIssue=(z)=>{if(typeof z==="string")_.issues.push(F.issue(z,_.value,I));else{let g=z;if(g.fatal)g.continue=!1;g.code??(g.code="custom"),g.input??(g.input=_.value),g.inst??(g.inst=$),_.issues.push(F.issue(g))}};let U=I.transform(_.value,_);if(U instanceof Promise)return U.then((z)=>{return _.value=z,_});return _.value=U,_}});function Au($){return new SG({type:"transform",transform:$})}var ju=B("ZodOptional",($,I)=>{L_.init($,I),d.init($,I),$._zod.processJSONSchema=(_,u,U)=>s_($,_,u,U),$.unwrap=()=>$._zod.def.innerType});function ZI($){return new ju({type:"optional",innerType:$})}var wG=B("ZodExactOptional",($,I)=>{v8.init($,I),d.init($,I),$._zod.processJSONSchema=(_,u,U)=>s_($,_,u,U),$.unwrap=()=>$._zod.def.innerType});function EG($){return new wG({type:"optional",innerType:$})}var CG=B("ZodNullable",($,I)=>{H8.init($,I),d.init($,I),$._zod.processJSONSchema=(_,u,U)=>x9($,_,u,U),$.unwrap=()=>$._zod.def.innerType});function WI($){return new CG({type:"nullable",innerType:$})}function qv($){return ZI(WI($))}var fG=B("ZodDefault",($,I)=>{Y8.init($,I),d.init($,I),$._zod.processJSONSchema=(_,u,U)=>y9($,_,u,U),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function xG($,I){return new fG({type:"default",innerType:$,get defaultValue(){return typeof I==="function"?I():F.shallowClone(I)}})}var kG=B("ZodPrefault",($,I)=>{O8.init($,I),d.init($,I),$._zod.processJSONSchema=(_,u,U)=>i9($,_,u,U),$.unwrap=()=>$._zod.def.innerType});function yG($,I){return new kG({type:"prefault",innerType:$,get defaultValue(){return typeof I==="function"?I():F.shallowClone(I)}})}var Fu=B("ZodNonOptional",($,I)=>{T8.init($,I),d.init($,I),$._zod.processJSONSchema=(_,u,U)=>k9($,_,u,U),$.unwrap=()=>$._zod.def.innerType});function iG($,I){return new Fu({type:"nonoptional",innerType:$,...F.normalizeParams(I)})}var lG=B("ZodSuccess",($,I)=>{B8.init($,I),d.init($,I),$._zod.processJSONSchema=(_,u,U)=>W9($,_,u,U),$.unwrap=()=>$._zod.def.innerType});function Xv($){return new lG({type:"success",innerType:$})}var mG=B("ZodCatch",($,I)=>{D8.init($,I),d.init($,I),$._zod.processJSONSchema=(_,u,U)=>l9($,_,u,U),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function rG($,I){return new mG({type:"catch",innerType:$,catchValue:typeof I==="function"?I:()=>I})}var nG=B("ZodNaN",($,I)=>{M8.init($,I),d.init($,I),$._zod.processJSONSchema=(_,u,U)=>R9($,_,u,U)});function Nv($){return s3(nG,$)}var Su=B("ZodPipe",($,I)=>{K8.init($,I),d.init($,I),$._zod.processJSONSchema=(_,u,U)=>m9($,_,u,U),$.in=I.in,$.out=I.out});function PI($,I){return new Su({type:"pipe",in:$,out:I})}var wu=B("ZodCodec",($,I)=>{Su.init($,I),YI.init($,I)});function Qv($,I,_){return new wu({type:"pipe",in:$,out:I,transform:_.decode,reverseTransform:_.encode})}var hG=B("ZodReadonly",($,I)=>{V8.init($,I),d.init($,I),$._zod.processJSONSchema=(_,u,U)=>r9($,_,u,U),$.unwrap=()=>$._zod.def.innerType});function dG($){return new hG({type:"readonly",innerType:$})}var cG=B("ZodTemplateLiteral",($,I)=>{R8.init($,I),d.init($,I),$._zod.processJSONSchema=(_,u,U)=>L9($,_,u,U)});function vv($,I){return new cG({type:"template_literal",parts:$,...F.normalizeParams(I)})}var pG=B("ZodLazy",($,I)=>{W8.init($,I),d.init($,I),$._zod.processJSONSchema=(_,u,U)=>h9($,_,u,U),$.unwrap=()=>$._zod.def.getter()});function oG($){return new pG({type:"lazy",getter:$})}var tG=B("ZodPromise",($,I)=>{Z8.init($,I),d.init($,I),$._zod.processJSONSchema=(_,u,U)=>n9($,_,u,U),$.unwrap=()=>$._zod.def.innerType});function Hv($){return new tG({type:"promise",innerType:$})}var aG=B("ZodFunction",($,I)=>{L8.init($,I),d.init($,I),$._zod.processJSONSchema=(_,u,U)=>b9($,_,u,U)});function Yv($){return new aG({type:"function",input:Array.isArray($?.input)?WG($?.input):$?.input??jI(_1()),output:$?.output??_1()})}var EI=B("ZodCustom",($,I)=>{P8.init($,I),d.init($,I),$._zod.processJSONSchema=(_,u,U)=>P9($,_,u,U)});function Ov($){let I=new X$({check:"custom"});return I._zod.check=$,I}function Tv($,I){return U9(EI,$??(()=>!0),I)}function eG($,I={}){return _9(EI,$,I)}function sG($){return u9($)}var Bv=z9,Dv=g9;function Mv($,I={}){let _=new EI({type:"custom",check:"custom",fn:(u)=>u instanceof $,abort:!0,...F.normalizeParams(I)});return _._zod.bag.Class=$,_._zod.check=(u)=>{if(!(u.value instanceof $))u.issues.push({code:"invalid_type",expected:$.name,input:u.value,inst:_,path:[..._._zod.def.path??[]]})},_}var Kv=(...$)=>J9({Codec:wu,Boolean:q0,String:g0},...$);function Vv($){let I=oG(()=>{return Pu([gu($),XG(),NG(),YG(),jI(I),PG(gu(),I)])});return I}function Rv($,I){return PI(Au($),I)}var Pj={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function bj($){V$({customError:$})}function Aj(){return V$().customError}var $q;(function($){})($q||($q={}));var f={...RI,...Iu,iso:u0},jj=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function Fj($,I){let _=$.$schema;if(_==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(_==="http://json-schema.org/draft-07/schema#")return"draft-7";if(_==="http://json-schema.org/draft-04/schema#")return"draft-4";return I??"draft-2020-12"}function Sj($,I){if(!$.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let _=$.slice(1).split("/").filter(Boolean);if(_.length===0)return I.rootSchema;let u=I.version==="draft-2020-12"?"$defs":"definitions";if(_[0]===u){let U=_[1];if(!U||!I.defs[U])throw Error(`Reference not found: ${$}`);return I.defs[U]}throw Error(`Reference not found: ${$}`)}function Lv($,I){if($.not!==void 0){if(typeof $.not==="object"&&Object.keys($.not).length===0)return f.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if($.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if($.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if($.if!==void 0||$.then!==void 0||$.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if($.dependentSchemas!==void 0||$.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if($.$ref){let U=$.$ref;if(I.refs.has(U))return I.refs.get(U);if(I.processing.has(U))return f.lazy(()=>{if(!I.refs.has(U))throw Error(`Circular reference not resolved: ${U}`);return I.refs.get(U)});I.processing.add(U);let z=Sj(U,I),g=E$(z,I);return I.refs.set(U,g),I.processing.delete(U),g}if($.enum!==void 0){let U=$.enum;if(I.version==="openapi-3.0"&&$.nullable===!0&&U.length===1&&U[0]===null)return f.null();if(U.length===0)return f.never();if(U.length===1)return f.literal(U[0]);if(U.every((g)=>typeof g==="string"))return f.enum(U);let z=U.map((g)=>f.literal(g));if(z.length<2)return z[0];return f.union([z[0],z[1],...z.slice(2)])}if($.const!==void 0)return f.literal($.const);let _=$.type;if(Array.isArray(_)){let U=_.map((z)=>{let g={...$,type:z};return Lv(g,I)});if(U.length===0)return f.never();if(U.length===1)return U[0];return f.union(U)}if(!_)return f.any();let u;switch(_){case"string":{let U=f.string();if($.format){let z=$.format;if(z==="email")U=U.check(f.email());else if(z==="uri"||z==="uri-reference")U=U.check(f.url());else if(z==="uuid"||z==="guid")U=U.check(f.uuid());else if(z==="date-time")U=U.check(f.iso.datetime());else if(z==="date")U=U.check(f.iso.date());else if(z==="time")U=U.check(f.iso.time());else if(z==="duration")U=U.check(f.iso.duration());else if(z==="ipv4")U=U.check(f.ipv4());else if(z==="ipv6")U=U.check(f.ipv6());else if(z==="mac")U=U.check(f.mac());else if(z==="cidr")U=U.check(f.cidrv4());else if(z==="cidr-v6")U=U.check(f.cidrv6());else if(z==="base64")U=U.check(f.base64());else if(z==="base64url")U=U.check(f.base64url());else if(z==="e164")U=U.check(f.e164());else if(z==="jwt")U=U.check(f.jwt());else if(z==="emoji")U=U.check(f.emoji());else if(z==="nanoid")U=U.check(f.nanoid());else if(z==="cuid")U=U.check(f.cuid());else if(z==="cuid2")U=U.check(f.cuid2());else if(z==="ulid")U=U.check(f.ulid());else if(z==="xid")U=U.check(f.xid());else if(z==="ksuid")U=U.check(f.ksuid())}if(typeof $.minLength==="number")U=U.min($.minLength);if(typeof $.maxLength==="number")U=U.max($.maxLength);if($.pattern)U=U.regex(new RegExp($.pattern));u=U;break}case"number":case"integer":{let U=_==="integer"?f.number().int():f.number();if(typeof $.minimum==="number")U=U.min($.minimum);if(typeof $.maximum==="number")U=U.max($.maximum);if(typeof $.exclusiveMinimum==="number")U=U.gt($.exclusiveMinimum);else if($.exclusiveMinimum===!0&&typeof $.minimum==="number")U=U.gt($.minimum);if(typeof $.exclusiveMaximum==="number")U=U.lt($.exclusiveMaximum);else if($.exclusiveMaximum===!0&&typeof $.maximum==="number")U=U.lt($.maximum);if(typeof $.multipleOf==="number")U=U.multipleOf($.multipleOf);u=U;break}case"boolean":{u=f.boolean();break}case"null":{u=f.null();break}case"object":{let U={},z=$.properties||{},g=new Set($.required||[]);for(let[G,q]of Object.entries(z)){let N=E$(q,I);U[G]=g.has(G)?N:N.optional()}if($.propertyNames){let G=E$($.propertyNames,I),q=$.additionalProperties&&typeof $.additionalProperties==="object"?E$($.additionalProperties,I):f.any();if(Object.keys(U).length===0){u=f.record(G,q);break}let N=f.object(U).passthrough(),X=f.looseRecord(G,q);u=f.intersection(N,X);break}if($.patternProperties){let G=$.patternProperties,q=Object.keys(G),N=[];for(let Q of q){let H=E$(G[Q],I),Y=f.string().regex(new RegExp(Q));N.push(f.looseRecord(Y,H))}let X=[];if(Object.keys(U).length>0)X.push(f.object(U).passthrough());if(X.push(...N),X.length===0)u=f.object({}).passthrough();else if(X.length===1)u=X[0];else{let Q=f.intersection(X[0],X[1]);for(let H=2;H<X.length;H++)Q=f.intersection(Q,X[H]);u=Q}break}let J=f.object(U);if($.additionalProperties===!1)u=J.strict();else if(typeof $.additionalProperties==="object")u=J.catchall(E$($.additionalProperties,I));else u=J.passthrough();break}case"array":{let{prefixItems:U,items:z}=$;if(U&&Array.isArray(U)){let g=U.map((G)=>E$(G,I)),J=z&&typeof z==="object"&&!Array.isArray(z)?E$(z,I):void 0;if(J)u=f.tuple(g).rest(J);else u=f.tuple(g);if(typeof $.minItems==="number")u=u.check(f.minLength($.minItems));if(typeof $.maxItems==="number")u=u.check(f.maxLength($.maxItems))}else if(Array.isArray(z)){let g=z.map((G)=>E$(G,I)),J=$.additionalItems&&typeof $.additionalItems==="object"?E$($.additionalItems,I):void 0;if(J)u=f.tuple(g).rest(J);else u=f.tuple(g);if(typeof $.minItems==="number")u=u.check(f.minLength($.minItems));if(typeof $.maxItems==="number")u=u.check(f.maxLength($.maxItems))}else if(z!==void 0){let g=E$(z,I),J=f.array(g);if(typeof $.minItems==="number")J=J.min($.minItems);if(typeof $.maxItems==="number")J=J.max($.maxItems);u=J}else u=f.array(f.any());break}default:throw Error(`Unsupported type: ${_}`)}if($.description)u=u.describe($.description);if($.default!==void 0)u=u.default($.default);return u}function E$($,I){if(typeof $==="boolean")return $?f.any():f.never();let _=Lv($,I),u=$.type||$.enum!==void 0||$.const!==void 0;if($.anyOf&&Array.isArray($.anyOf)){let J=$.anyOf.map((q)=>E$(q,I)),G=f.union(J);_=u?f.intersection(_,G):G}if($.oneOf&&Array.isArray($.oneOf)){let J=$.oneOf.map((q)=>E$(q,I)),G=f.xor(J);_=u?f.intersection(_,G):G}if($.allOf&&Array.isArray($.allOf))if($.allOf.length===0)_=u?_:f.any();else{let J=u?_:E$($.allOf[0],I),G=u?0:1;for(let q=G;q<$.allOf.length;q++)J=f.intersection(J,E$($.allOf[q],I));_=J}if($.nullable===!0&&I.version==="openapi-3.0")_=f.nullable(_);if($.readOnly===!0)_=f.readonly(_);let U={},z=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let J of z)if(J in $)U[J]=$[J];let g=["contentEncoding","contentMediaType","contentSchema"];for(let J of g)if(J in $)U[J]=$[J];for(let J of Object.keys($))if(!jj.has(J))U[J]=$[J];if(Object.keys(U).length>0)I.registry.add(_,U);return _}function Zv($,I){if(typeof $==="boolean")return $?f.any():f.never();let _=Fj($,I?.defaultTarget),u=$.$defs||$.definitions||{},U={version:_,defs:u,refs:new Map,processing:new Set,rootSchema:$,registry:I?.registry??S$};return E$($,U)}var Iq={};S4(Iq,{string:()=>wj,number:()=>Ej,date:()=>xj,boolean:()=>Cj,bigint:()=>fj});function wj($){return L3(g0,$)}function Ej($){return S3(G0,$)}function Cj($){return y3(q0,$)}function fj($){return l3(X0,$)}function xj($){return e3(AI,$)}V$(OI());CI();function nj($,I,_){let u=s.join($,".serena","memories"),U=s.join(u,`result-${I}-${_}.md`);if(k.existsSync(U))return U;let z=s.join(u,`result-${I}.md`);if(k.existsSync(z))return z;return null}function fI($){try{return process.kill($,0),!0}catch(I){return!1}}function wv($){let I=[],_=/[^\s"']+|"([^"]*)"|'([^']*)'/g,u=_.exec($);while(u!==null){if(u[1]!==void 0)I.push(u[1]);else if(u[2]!==void 0)I.push(u[2]);else if(u[0])I.push(u[0]);u=_.exec($)}return I}var hj=g$.object({default_cli:g$.string().optional(),agent_cli_mapping:g$.record(g$.string(),g$.string()).optional()}).passthrough().transform(($)=>({default_cli:$.default_cli,agent_cli_mapping:$.agent_cli_mapping??{}})),dj=g$.object({command:g$.string().optional(),subcommand:g$.string().optional(),prompt_flag:g$.string().optional().transform(($)=>{if($===void 0)return;let I=$.trim().toLowerCase();if(I===""||I==="none"||I==="null")return null;return $}),auto_approve_flag:g$.string().optional(),output_format_flag:g$.string().optional(),output_format:g$.string().optional(),model_flag:g$.string().optional(),default_model:g$.string().optional(),isolation_env:g$.string().optional(),isolation_flags:g$.string().optional()}).passthrough().transform(($)=>({...$,prompt_flag:$.prompt_flag??void 0})),cj=g$.object({active_vendor:g$.string().optional(),vendors:g$.record(g$.string(),dj).optional()}).passthrough().transform(($)=>({active_vendor:$.active_vendor,vendors:$.vendors??{}}));function Ev($){try{return o6($)}catch{return null}}function pj($){let I=Ev($),_=hj.safeParse(I);if(!_.success)return{};return _.data}function oj($){let I=Ev($),_=cj.safeParse(I);if(!_.success)return{vendors:{}};return{active_vendor:_.data.active_vendor,vendors:_.data.vendors}}function gq($,I){let _=s.resolve($),u=s.parse(_).root;while(_!==u){let U=s.join(_,I);if(k.existsSync(U))return U;_=s.dirname(_)}return null}function tj($){let I=gq($,s.join(".agents","oma-config.yaml"));if(!I)return null;try{let _=k.readFileSync(I,"utf-8");return pj(_)}catch{return null}}function aj($){let I=gq($,s.join(".agents","skills","oma-orchestrator","config","cli-config.yaml"));if(!I)return null;try{let _=k.readFileSync(I,"utf-8");return oj(_)}catch{return null}}function Jq($,I){let _=process.cwd(),u=tj(_),U=aj(_),z=$.replace(/-agent$/i,""),g=u?.agent_cli_mapping?.[$]||u?.agent_cli_mapping?.[z],J=I||g||u?.default_cli||U?.active_vendor||"gemini";if(!I&&!g&&!u?.default_cli&&!U?.active_vendor)console.error(l.default.yellow(`[oma] No vendor configured for agent "${$}". Falling back to "gemini".
|
|
312
|
+
Set default_cli in .agents/oma-config.yaml or use --vendor flag.`));return{vendor:J.toLowerCase(),config:U}}function Cv($,I){if(I!==void 0)return I;return{gemini:"-p",claude:"-p",qwen:"-p",codex:null}[$]??"-p"}var ej={frontend:["web","frontend","client","ui","app","dashboard","admin","portal"],backend:["api","backend","server","service","gateway","core"],mobile:["mobile","ios","android","native","rn","expo"]},sj={frontend:["apps/web","apps/frontend","apps/client","packages/web","packages/frontend","frontend","web","client"],backend:["apps/api","apps/backend","apps/server","packages/api","packages/backend","backend","api","server"],mobile:["apps/mobile","apps/app","packages/mobile","mobile","app"]};function fv($,I){if($.startsWith("!"))return[];let _=$.replace(/\/\*\*?$/,"").replace(/\/$/,"");if(!$.includes("*")){let U=s.join(I,_);if(k.existsSync(U)&&k.statSync(U).isDirectory())return[_];return[]}let u=s.join(I,_);if(!k.existsSync(u)||!k.statSync(u).isDirectory())return[];try{return k.readdirSync(u,{withFileTypes:!0}).filter((z)=>z.isDirectory()&&!z.name.startsWith(".")).map((z)=>s.join(_,z.name))}catch{return[]}}function $F($){let I=s.join($,"pnpm-workspace.yaml");if(!k.existsSync(I))return[];try{let _=k.readFileSync(I,"utf-8");return o6(_)?.packages??[]}catch{return[]}}function xv($){let I=s.join($,"package.json");if(!k.existsSync(I))return[];try{let _=k.readFileSync(I,"utf-8"),u=JSON.parse(_);if(Array.isArray(u?.workspaces))return u.workspaces;if(u?.workspaces&&typeof u.workspaces==="object")return u.workspaces.packages??[];return[]}catch{return[]}}function IF($){let I=s.join($,"lerna.json");if(!k.existsSync(I))return[];try{let _=k.readFileSync(I,"utf-8");return JSON.parse(_)?.packages??[]}catch{return[]}}function UF($){let I=s.join($,"nx.json");if(!k.existsSync(I))return[];return["apps/*","libs/*","packages/*"].flatMap((u)=>fv(u,$))}function _F($){let I=s.join($,"turbo.json");if(!k.existsSync(I))return[];return xv($)}function uF($){let I=s.join($,"mise.toml");if(!k.existsSync(I))return[];try{let _=k.readFileSync(I,"utf-8"),u=[],U=_.match(/workspaces\s*=\s*\[([^\]]+)\]/);if(U?.[1]){let z=U[1].match(/"([^"]+)"|'([^']+)'/g);if(z)u.push(...z.map((g)=>g.replace(/["']/g,"")))}return u}catch{return[]}}function zF($){let I=new Set,_=[$F($),xv($),IF($),UF($),_F($),uF($)];for(let U of _)for(let z of U)I.add(z);let u=new Set;for(let U of I)for(let z of fv(U,$))u.add(z);return[...u]}function gF($,I){let _=ej[I];if(!_)return 0;let u=s.basename($).toLowerCase(),U=$.toLowerCase();for(let z=0;z<_.length;z++){let g=_[z];if(!g)continue;if(u===g)return 100-z;if(u.includes(g))return 50-z;if(U.includes(g))return 25-z}return 0}function kv($){let I=process.cwd(),_=zF(I);if(_.length>0){let U=_.map((z)=>({workspace:z,score:gF(z,$)})).filter((z)=>z.score>0).sort((z,g)=>g.score-z.score);if(U.length>0&&U[0])return U[0].workspace}let u=sj[$];if(u)for(let U of u){let z=s.resolve(U);if(k.existsSync(z)&&k.statSync(z).isDirectory())return U}return"."}function yv($){let I=s.resolve($);if(k.existsSync(I)&&k.statSync(I).isFile())return k.readFileSync(I,"utf-8");return $}function iv($,I){let _=gq(I,s.join(".agents","skills","_shared","runtime","execution-protocols",`${$}.md`));if(!_)return"";try{return k.readFileSync(_,"utf-8")}catch{return""}}async function lv($,I,_,u,U){let z=u==="."?kv($):u,g=s.resolve(z);if(!k.existsSync(g))k.mkdirSync(g,{recursive:!0}),console.log(l.default.dim(`[${$}] Created workspace: ${g}`));else if(z!==u)console.log(l.default.blue(`[${$}] Auto-detected workspace: ${z}`));let J=fu(),G=s.join(J,`subagent-${_}-${$}.log`),q=s.join(J,`subagent-${_}-${$}.pid`),N=yv(I),{vendor:X,config:Q}=Jq($,U),H=iv(X,process.cwd()),Y=H?`${N}
|
|
313
313
|
|
|
314
|
-
${
|
|
314
|
+
${H}`:N,v=Q?.vendors?.[X]||{},O=v.command||X,T=v.subcommand,L=k.openSync(G,"w");console.log(l.default.blue(`[${$}] Spawning subagent...`)),console.log(l.default.dim(` Vendor: ${X}`)),console.log(l.default.dim(` Workspace: ${g}`)),console.log(l.default.dim(` Log: ${G}`));let V=[],R=Cv(X,v.prompt_flag);if(v.output_format_flag&&v.output_format)V.push(v.output_format_flag,v.output_format);else if(v.output_format_flag)V.push(v.output_format_flag);if(v.model_flag&&v.default_model)V.push(v.model_flag,v.default_model);if(v.isolation_flags)V.push(...wv(v.isolation_flags));if(v.auto_approve_flag)V.push(v.auto_approve_flag);else{let x={gemini:"--approval-mode=yolo",codex:"--full-auto",qwen:"--yolo"}[X];if(x)V.push(x)}if(R)V.push(R,Y);let M=[];if(T)M.push(T);if(M.push(...V),!R)M.push(Y);let Z={...process.env};if(v.isolation_env){let[C,...x]=v.isolation_env.split("="),P=x.join("=");if(C&&P){let e=P.replace("$$",String(process.pid));if(Z[C]=e,e.startsWith("/")&&!k.existsSync(e))k.mkdirSync(e,{recursive:!0})}}let K=zq(O,M,{cwd:g,stdio:["ignore",L,L],detached:!1,env:Z});if(!K.pid)console.error(l.default.red(`[${$}] Failed to spawn process`)),process.exit(1);k.writeFileSync(q,K.pid.toString()),console.log(l.default.green(`[${$}] Started with PID ${K.pid}`));let D=()=>{try{if(k.existsSync(q))k.unlinkSync(q);if(k.existsSync(G))k.unlinkSync(G)}catch(C){}},S=()=>{if(K.pid&&fI(K.pid))process.kill(K.pid);D(),process.exit()};process.on("SIGINT",S),process.on("SIGTERM",S),K.on("exit",(C)=>{if(console.log(l.default.blue(`[${$}] Exited with code ${C}`)),C!==0&&k.existsSync(G)){let x=k.readFileSync(G,"utf-8").trim();if(x)console.log(l.default.red(`[${$}] Log output:`)),console.log(x)}D(),process.exit(C??0)})}async function mv($,I,_=process.cwd()){let u={};for(let U of I){let z=nj(_,U,$),g=s.join(fu(),`subagent-${$}-${U}.pid`);if(z&&k.existsSync(z)){let G=k.readFileSync(z,"utf-8").match(/^## Status:\s*(\S+)/m);if(G?.[1])u[U]=G[1];else{let q=k.existsSync(g)?k.readFileSync(g,"utf-8").trim():"",N=parseInt(q,10);if(!Number.isNaN(N)&&fI(N))u[U]="running";else u[U]="completed"}}else if(k.existsSync(g)){let J=k.readFileSync(g,"utf-8").trim(),G=parseInt(J,10);if(!Number.isNaN(G)&&fI(G))u[U]="running";else u[U]="crashed"}else u[U]="crashed"}for(let[U,z]of Object.entries(u))console.log(`${U}:${z}`)}var JF=g$.object({agent:g$.string(),task:g$.string(),workspace:g$.string().optional()}),GF=g$.object({tasks:g$.array(JF)});function qF($){if(!k.existsSync($))throw Error(`Tasks file not found: ${$}`);let I=k.readFileSync($,"utf-8"),_=o6(I),u=GF.safeParse(_);if(!u.success)throw Error(`Invalid tasks file format: ${u.error.message}`);return u.data.tasks}function XF($){return $.map((I)=>{let _=I.split(":");if(_.length<2||!_[0])throw Error(`Invalid task format: "${I}". Expected "agent:task" or "agent:task:workspace"`);let u=_[0],U=_.slice(1),z,g;if(U.length>=2){let J=U[U.length-1]??"";if(J.startsWith("./")||J.startsWith("/")||J===".")g=J,z=U.slice(0,-1).join(":");else z=U.join(":")}else z=U.join(":");return{agent:u,task:z,workspace:g}})}async function rv($,I={}){let _=process.cwd(),u=s.join(_,".agents","results"),U=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),z=s.join(u,`parallel-${U}`);k.mkdirSync(z,{recursive:!0});let g=s.join(z,"pids.txt"),J;try{if(I.inline){if($.length===0)console.error(l.default.red("Error: No tasks specified")),console.log('Usage: oh-my-agent agent:parallel --inline "agent:task" "agent:task" ...'),process.exit(1);J=XF($)}else{if($.length===0)console.error(l.default.red("Error: No tasks file specified")),console.log("Usage: oh-my-agent agent:parallel <tasks-file.yaml>"),process.exit(1);let H=$[0];if(!H)console.error(l.default.red("Error: No tasks file specified")),process.exit(1);J=qF(H)}}catch(H){console.error(l.default.red(`Error: ${H.message}`)),process.exit(1)}console.log(l.default.cyan("======================================")),console.log(l.default.cyan(" Parallel SubAgent Execution")),console.log(l.default.cyan("======================================")),console.log(""),console.log(l.default.blue("Starting parallel execution...")),console.log("");let G=[];for(let H=0;H<J.length;H++){let Y=J[H];if(!Y)continue;let{agent:v,task:O,workspace:T="."}=Y,L=T==="."?kv(v):T,V=s.resolve(L),R=s.join(z,`${v}-${H}.log`);if(console.log(`${l.default.blue(`[${H}]`)} Spawning ${l.default.yellow(v)} agent...`),console.log(` Task: ${O.slice(0,60)}${O.length>60?"...":""}`),console.log(` Workspace: ${L}`),!k.existsSync(V))k.mkdirSync(V,{recursive:!0});let{vendor:M,config:Z}=Jq(v,I.vendor),K=Z?.vendors?.[M]||{},D=K.command||M,S=K.subcommand,C=[],x=Cv(M,K.prompt_flag),P=yv(O),e=iv(M,_),c=e?`${P}
|
|
315
315
|
|
|
316
|
-
${
|
|
317
|
-
`);let
|
|
316
|
+
${e}`:P;if(K.output_format_flag&&K.output_format)C.push(K.output_format_flag,K.output_format);else if(K.output_format_flag)C.push(K.output_format_flag);if(K.model_flag&&K.default_model)C.push(K.model_flag,K.default_model);if(K.isolation_flags)C.push(...wv(K.isolation_flags));if(K.auto_approve_flag)C.push(K.auto_approve_flag);else{let R1={gemini:"--approval-mode=yolo",codex:"--full-auto",qwen:"--yolo"}[M];if(R1)C.push(R1)}if(x)C.push(x,c);let T$=[];if(S)T$.push(S);if(T$.push(...C),!x)T$.push(c);let p$={...process.env};if(K.isolation_env){let[X6,...R1]=K.isolation_env.split("="),$5=R1.join("=");if(X6&&$5){let GU=$5.replace("$$",String(process.pid));if(p$[X6]=GU,GU.startsWith("/")&&!k.existsSync(GU))k.mkdirSync(GU,{recursive:!0})}}let o$=k.openSync(R,"w"),F4=zq(D,T$,{cwd:V,stdio:["ignore",o$,o$],detached:!0,env:p$});if(!F4.pid){console.error(l.default.red(`[${H}] Failed to spawn ${v} process`));continue}k.appendFileSync(g,`${F4.pid}:${v}
|
|
317
|
+
`);let l2=new Promise((X6)=>{F4.on("exit",(R1)=>{k.closeSync(o$),X6(R1)}),F4.on("error",()=>{k.closeSync(o$),X6(null)})});G.push({pid:F4.pid,agent:v,idx:H,promise:l2})}if(console.log(""),console.log(l.default.blue("[Parallel]")+` Started ${l.default.yellow(String(G.length))} agents`),I.noWait){console.log(`${l.default.blue("[Parallel]")} Running in background mode`),console.log(`${l.default.blue("[Parallel]")} Results will be in: ${z}`),console.log(`${l.default.blue("[Parallel]")} PID list: ${g}`);return}console.log(`${l.default.blue("[Parallel]")} Waiting for completion...`),console.log("");let q=()=>{console.log(""),console.log(`${l.default.yellow("[Parallel]")} Cleaning up child processes...`);for(let{pid:H,agent:Y}of G)if(fI(H)){try{process.kill(-H,"SIGTERM")}catch{try{process.kill(H,"SIGTERM")}catch{}}console.log(`${l.default.yellow("[Parallel]")} Killed PID ${H} (${Y})`)}try{if(k.existsSync(g))k.unlinkSync(g)}catch{}};process.on("SIGINT",()=>{q(),process.exit(130)}),process.on("SIGTERM",()=>{q(),process.exit(143)});let N=0,X=0;for(let{agent:H,idx:Y,promise:v}of G){let O=await v;if(O===0)console.log(`${l.default.green("[DONE]")} ${H} agent (${Y}) completed`),N++;else console.log(l.default.red("[FAIL]")+` ${H} agent (${Y}) failed (exit code: ${O})`),X++}try{if(k.existsSync(g))k.unlinkSync(g)}catch{}console.log(""),console.log(l.default.cyan("======================================")),console.log(l.default.cyan(" Execution Summary")),console.log(l.default.cyan("======================================")),console.log(`Total: ${G.length}`),console.log(`Completed: ${l.default.green(String(N))}`),console.log(`Failed: ${l.default.red(String(X))}`),console.log(`Results: ${z}`),console.log(l.default.cyan("======================================")),console.log(""),console.log(l.default.blue("Result files:"));let Q=k.readdirSync(z).filter((H)=>H.endsWith(".log"));for(let H of Q)console.log(` - ${s.join(z,H)}`);if(X>0)process.exit(1)}function NF(){let $=Cu(process.cwd());if($.id&&$.status!=="completed"&&$.status!=="failed")return $.id;return _q(new Date)}var QF="codex",vF=["codex","claude","gemini","qwen"];function HF($,I,_){if(I)return`Review the uncommitted changes (git diff) in this repository. ${$}`;try{let u=rj("git diff HEAD~1",{cwd:_,encoding:"utf-8"}).trim();if(!u)return`No committed changes found. ${$}`;return`Review the following committed diff:
|
|
318
318
|
|
|
319
319
|
\`\`\`diff
|
|
320
320
|
${u}
|
|
321
321
|
\`\`\`
|
|
322
322
|
|
|
323
|
-
${$}`}catch{return`Review the latest committed changes. ${$}`}}function YF($,I,_,u,U){let z=I.command||$;if($==="codex")return u?[z,"review","--uncommitted"]:[z,"review"];let g=
|
|
324
|
-
`))if(I.includes("antigravity")||I.includes("language_server")){let _=I.trim().split(" ")[0];if(!_)continue;let u=Number.parseInt(_,10);if(!Number.isNaN(u))return u}}catch{}return null}function
|
|
325
|
-
`).slice(1)){let U=u.match(/:(\d+)\s+\(LISTEN\)/);if(U?.[1])_.push(Number.parseInt(U[1],10))}return _}catch{}return[]}function
|
|
326
|
-
---`,3);if(_===-1)return{frontmatter:{},body:$};let u=I.slice(3,_).trim(),U=I.slice(_+4);try{let z=
|
|
323
|
+
${$}`}catch{return`Review the latest committed changes. ${$}`}}function YF($,I,_,u,U){let z=I.command||$;if($==="codex")return u?[z,"review","--uncommitted"]:[z,"review"];let g=HF(_,u,U),J=I.prompt_flag||"-p",G=[z,J,g];if(I.model_flag&&I.default_model)G.push(I.model_flag,I.default_model);if(I.auto_approve_flag)G.push(I.auto_approve_flag);else{let N={gemini:"--approval-mode=yolo",qwen:"--yolo"}[$];if(N)G.push(N)}if($==="claude")G.push("--output-format","text");return G}async function nv($){let I=NF(),_=$.prompt||"Review for bugs, security vulnerabilities, performance issues, and code quality. Report findings with severity levels.",u="review",U=$.workspace||".",z=s.resolve(U),{vendor:g,config:J}=Jq("review",$.model),G=vF.includes(g)?g:QF;if(G!==g)console.log(l.default.yellow(`[review] "${g}" has no review mode, falling back to ${G}`));let q=J?.vendors?.[G]||{},N=$.uncommitted??!0,X=YF(G,q,_,N,z),[Q,...H]=X,Y=s.join(fu(),`review-${I}.log`),v=s.join(fu(),`review-${I}.pid`);console.log(l.default.dim(` Session: ${I}`)),console.log(l.default.blue("[review] Starting review...")),console.log(l.default.dim(` Vendor: ${G}`)),console.log(l.default.dim(` Command: ${Q} ${H.slice(0,2).join(" ")}...`));let O=k.openSync(Y,"w"),T=zq(Q,H,{cwd:z,stdio:["ignore",O,O],detached:!1});if(!T.pid)console.error(l.default.red("[review] Failed to spawn process")),process.exit(1);k.writeFileSync(v,T.pid.toString()),console.log(l.default.green(`[review] Started with PID ${T.pid}`));let L=()=>{try{if(k.existsSync(v))k.unlinkSync(v);if(k.existsSync(Y))k.unlinkSync(Y)}catch(R){}},V=()=>{if(T.pid&&fI(T.pid))process.kill(T.pid);L(),process.exit()};process.on("SIGINT",V),process.on("SIGTERM",V),T.on("exit",(R)=>{if(k.existsSync(Y)){let M=k.readFileSync(Y,"utf-8").trim();if(M)console.log(""),console.log(M)}console.log(R===0?l.default.green("[review] Done"):l.default.red(`[review] Exited with code ${R}`)),L(),process.exit(R??0)})}I4();var N1=v$(P$(),1);import{execSync as wS}from"node:child_process";import{existsSync as iq,readFileSync as lq}from"node:fs";import{homedir as mq}from"node:os";import{join as rq}from"node:path";import{execSync as wq}from"node:child_process";import DH from"node:https";function QS(){try{let $=wq("pgrep -fl language_server",{encoding:"utf-8",stdio:["pipe","pipe","ignore"]});for(let I of $.split(`
|
|
324
|
+
`))if(I.includes("antigravity")||I.includes("language_server")){let _=I.trim().split(" ")[0];if(!_)continue;let u=Number.parseInt(_,10);if(!Number.isNaN(u))return u}}catch{}return null}function vS($){try{return wq(`ps -p ${$} -ww -o args`,{encoding:"utf-8",stdio:["pipe","pipe","ignore"]}).match(/--csrf_token\s+([a-zA-Z0-9-]+)/)?.[1]??null}catch{}return null}function HS($){try{let I=wq(`lsof -nP -a -iTCP -sTCP:LISTEN -p ${$}`,{encoding:"utf-8",stdio:["pipe","pipe","ignore"]}),_=[];for(let u of I.split(`
|
|
325
|
+
`).slice(1)){let U=u.match(/:(\d+)\s+\(LISTEN\)/);if(U?.[1])_.push(Number.parseInt(U[1],10))}return _}catch{}return[]}function MH($,I,_,u){return new Promise((U,z)=>{let g=JSON.stringify(u),J=DH.request({hostname:"127.0.0.1",port:$,path:I,method:"POST",headers:{"Content-Type":"application/json","Content-Length":Buffer.byteLength(g),"Connect-Protocol-Version":"1","X-Codeium-Csrf-Token":_},rejectUnauthorized:!1,timeout:5000},(G)=>{let q="";G.on("data",(N)=>{q+=N}),G.on("end",()=>{if(G.statusCode&&G.statusCode>=200&&G.statusCode<300)try{U(JSON.parse(q))}catch{z(Error("Invalid JSON response"))}else z(Error(`Request failed: ${G.statusCode}`))})});J.on("error",z),J.on("timeout",()=>{J.destroy(),z(Error("Request timeout"))}),J.write(g),J.end()})}function YS($,I){return new Promise((_)=>{let u=DH.request({hostname:"127.0.0.1",port:$,path:"/exa.language_server_pb.LanguageServerService/GetUnleashData",method:"POST",headers:{"Content-Type":"application/json","X-Codeium-Csrf-Token":I,"Connect-Protocol-Version":"1"},rejectUnauthorized:!1,timeout:5000},(U)=>{let z="";U.on("data",(g)=>{z+=g}),U.on("end",()=>{if(U.statusCode===200)try{JSON.parse(z),_(!0)}catch{_(!1)}else _(!1)})});u.on("error",()=>_(!1)),u.on("timeout",()=>{u.destroy(),_(!1)}),u.write(JSON.stringify({wrapper_data:{}})),u.end()})}function OS($){if($<=0)return"Ready";let I=Math.ceil($/60000);if(I<60)return`${I}m`;return`${Math.floor(I/60)}h ${I%60}m`}function BH($,I){if(!$||I===void 0)return;let _=Number($),u=Number(I);if(_<=0)return;return{available:u,monthly:_,usedPercent:(_-u)/_*100,remainingPercent:u/_*100}}function TS($){let I=$.userStatus??{},_=I.planStatus?.planInfo??{},u=BH(_.monthlyPromptCredits,I.planStatus?.availablePromptCredits),U=BH(_.monthlyFlowCredits,I.planStatus?.availableFlowCredits),g=(I.cascadeModelConfigData?.clientModelConfigs??[]).filter((G)=>G.quotaInfo!==void 0).map((G)=>{let q=G.quotaInfo.resetTime?new Date(G.quotaInfo.resetTime):null,N=q?q.getTime()-Date.now():0,X=G.quotaInfo.remainingFraction,Q=0;if(X!==void 0&&X!==null)Q=X*100;else if(G.quotaInfo.allowed)Q=100;return{label:G.label||"Unknown",modelId:G.modelOrAlias?.model||"unknown",remainingPercent:Q,isExhausted:G.quotaInfo.remainingFraction===0,resetTime:q,timeUntilReset:OS(N),supportsImages:G.supportsImages??!1}}),J=I.cascadeModelConfigData?.defaultOverrideModelConfig?.modelOrAlias?.model??null;return{userName:I.name||"Unknown",email:I.email||"",planName:_.planName||"Free",tierName:I.userTier?.name||"",promptCredits:u,flowCredits:U,models:g,defaultModel:J,timestamp:new Date}}async function KH(){let $=QS();if(!$)return null;let I=vS($);if(!I)return null;let _=HS($);for(let u of _)if(await YS(u,I))return{pid:$,csrfToken:I,port:u};return null}async function BS($){try{let I=await MH($.port,"/exa.language_server_pb.LanguageServerService/GetUserStatus",$.csrfToken,{metadata:{ideName:"antigravity",extensionName:"antigravity",locale:"en"}});return TS(I)}catch{return null}}async function VH(){let $=await KH();if(!$)return null;try{return await MH($.port,"/exa.language_server_pb.LanguageServerService/GetUserStatus",$.csrfToken,{metadata:{ideName:"antigravity",extensionName:"antigravity",locale:"en"}})}catch{return null}}async function rI(){let $=await KH();if(!$)return null;return BS($)}import{execSync as yq}from"node:child_process";import{cpSync as R4,existsSync as N$,lstatSync as ZH,mkdirSync as n$,readdirSync as au,readFileSync as s4,readlinkSync as DS,rmSync as MS,symlinkSync as KS,unlinkSync as WH,writeFileSync as L4}from"node:fs";import{dirname as kq,join as m,relative as VS,resolve as fq}from"node:path";function Eq($){let I=$.trimStart();if(!I.startsWith("---"))return{frontmatter:{},body:$};let _=I.indexOf(`
|
|
326
|
+
---`,3);if(_===-1)return{frontmatter:{},body:$};let u=I.slice(3,_).trim(),U=I.slice(_+4);try{let z=o6(u);return{frontmatter:z&&typeof z==="object"?z:{},body:U}}catch{return{frontmatter:{},body:U}}}function Cq($,I){let _=["---"];for(let[u,U]of Object.entries($)){if(U===void 0||U===null)continue;if(Array.isArray(U)){_.push(`${u}:`);for(let z of U)_.push(` - ${z}`)}else{let z=String(U),g=/[:#[\]{}|>&*!,'"%@`]/.test(z)||z.includes(`
|
|
327
327
|
`);_.push(`${u}: ${g?JSON.stringify(z):z}`)}}return _.push("---"),_.push(""),_.join(`
|
|
328
|
-
`)+I}var R$="first-fluke/oh-my-agent",O4=".agents/skills",
|
|
328
|
+
`)+I}var R$="first-fluke/oh-my-agent",O4=".agents/skills",xq=["claude","codex","copilot","gemini","qwen"];function PH($){let I=m($,".agents","oma-config.yaml");if(!N$(I))return[...xq];let u=s4(I,"utf-8").match(/^vendors:\s*\n((?:\s+-\s+\S+\n?)*)/m);if(!u)return[...xq];let U=[...u[1].matchAll(/-\s+(\S+)/g)].map((z)=>z[1]);return U.length>0?U:[...xq]}function bH($,I){let _=m($,".agents","oma-config.yaml");if(!N$(_))return;let u=s4(_,"utf-8"),U=`vendors:
|
|
329
|
+
${I.map((z)=>` - ${z}`).join(`
|
|
330
|
+
`)}`;if(/^vendors:/m.test(u))u=u.replace(/^vendors:\s*\n(?:\s+-\s+\S+\n?)*/m,`${U}
|
|
331
|
+
`);else u=`${u.trimEnd()}
|
|
332
|
+
${U}
|
|
333
|
+
`;L4(_,u)}var Y4={domain:[{name:"oma-frontend",desc:"React/Next.js UI specialist"},{name:"oma-backend",desc:"Backend API specialist (multi-language)"},{name:"oma-db",desc:"SQL/NoSQL data modeling, normalization, integrity, and capacity specialist"},{name:"oma-mobile",desc:"Flutter/Dart mobile specialist"}],design:[{name:"oma-design",desc:"Design system, DESIGN.md, accessibility, anti-pattern enforcement"}],coordination:[{name:"oma-brainstorm",desc:"Design-first ideation before planning"},{name:"oma-pm",desc:"Product manager - task decomposition"},{name:"oma-qa",desc:"QA - OWASP, Lighthouse, WCAG"},{name:"oma-coordination",desc:"Manual multi-agent orchestration"},{name:"oma-orchestrator",desc:"Automated parallel CLI execution"}],utility:[{name:"oma-debug",desc:"Bug fixing specialist"},{name:"oma-commit",desc:"Conventional Commits helper"},{name:"oma-translator",desc:"Context-aware multilingual translation"},{name:"oma-pdf",desc:"PDF to Markdown conversion via opendataloader-pdf"}],infrastructure:[{name:"oma-tf-infra",desc:"Multi-cloud infrastructure with Terraform - AWS, GCP, Azure, OCI support"},{name:"oma-dev-workflow",desc:"Monorepo developer workflows - mise tasks, git hooks, CI/CD, release automation"}]},AH={fullstack:["oma-brainstorm","oma-design","oma-frontend","oma-backend","oma-db","oma-pm","oma-qa","oma-debug","oma-commit","oma-tf-infra","oma-dev-workflow"],frontend:["oma-brainstorm","oma-design","oma-frontend","oma-pm","oma-qa","oma-debug","oma-commit"],backend:["oma-brainstorm","oma-backend","oma-db","oma-pm","oma-qa","oma-debug","oma-commit","oma-dev-workflow"],mobile:["oma-brainstorm","oma-mobile","oma-pm","oma-qa","oma-debug","oma-commit"],devops:["oma-brainstorm","oma-tf-infra","oma-dev-workflow","oma-pm","oma-qa","oma-debug","oma-commit"],all:[...Y4.domain,...Y4.design,...Y4.coordination,...Y4.utility,...Y4.infrastructure].map(($)=>$.name)};function nI($){try{if(!ZH($).isDirectory())WH($)}catch{}}function eu($,I,_,u){let U=m($,".agents","skills",I);if(!N$(U))return!1;let z=m(_,O4,I);nI(z),n$(z,{recursive:!0}),R4(U,z,{recursive:!0,force:!0});let g=m(U,"variants"),J=m(z,"stack");if(u&&N$(m(g,u)))n$(J,{recursive:!0}),R4(m(g,u),J,{recursive:!0,force:!0}),L4(m(J,"stack.yaml"),`language: ${u}
|
|
329
334
|
source: preset
|
|
330
|
-
`);let G=
|
|
331
|
-
${
|
|
335
|
+
`);let G=m(z,"variants");if(N$(G))MS(G,{recursive:!0,force:!0});return!0}function su($,I){let _=m($,".agents","skills","_shared");if(!N$(_))return;let u=m(I,O4,"_shared");nI(u),n$(u,{recursive:!0}),R4(_,u,{recursive:!0,force:!0})}function jH($,I){let _=m($,".agents","workflows");if(!N$(_))return;let u=m(I,".agents","workflows");nI(u),n$(u,{recursive:!0}),R4(_,u,{recursive:!0,force:!0})}function FH($,I){let _=m($,".agents","rules");if(!N$(_))return;let u=m(I,".agents","rules");nI(u),n$(u,{recursive:!0}),R4(_,u,{recursive:!0,force:!0})}function SH($,I,_=!1){let u=m($,".agents","config");if(N$(u)){let z=m(I,".agents","config");if(n$(z,{recursive:!0}),_)R4(u,z,{recursive:!0,force:!0});else for(let g of au(u,{withFileTypes:!0})){let J=m(z,g.name);if(!N$(J))R4(m(u,g.name),J,g.isDirectory()?{recursive:!0}:{})}}let U=m($,".agents","mcp.json");if(N$(U)){let z=m(I,".agents");n$(z,{recursive:!0});let g=m(z,"mcp.json");if(_||!N$(g))R4(U,g)}}function wH($){let I=process.env.HOME||process.env.USERPROFILE||"",_=m(I,".gemini","antigravity","global_workflows"),u=m($,".agents","workflows");if(!N$(u))return;n$(_,{recursive:!0}),R4(u,_,{recursive:!0,force:!0})}var RS={"backend-engineer":{tools:"Read, Write, Edit, Bash, Grep, Glob",model:"sonnet",maxTurns:20},"frontend-engineer":{tools:"Read, Write, Edit, Bash, Grep, Glob",model:"sonnet",maxTurns:20},"db-engineer":{tools:"Read, Write, Edit, Bash, Grep, Glob",model:"sonnet",maxTurns:15},"debug-investigator":{tools:"Read, Write, Edit, Bash, Grep, Glob",model:"sonnet",maxTurns:15},"mobile-engineer":{tools:"Read, Write, Edit, Bash, Grep, Glob",model:"sonnet",maxTurns:20},"pm-planner":{tools:"Read, Write, Grep, Glob, Bash",model:"sonnet",maxTurns:10},"qa-reviewer":{tools:"Read, Grep, Glob, Bash",model:"sonnet",maxTurns:15,effort:"low"}};function LS($,I){let _=m($,".claude","rules");if(!N$(_))return;let u=m(I,".claude","rules");n$(u,{recursive:!0}),R4(_,u,{recursive:!0,force:!0})}function ZS($,I){if(!N$($))return;let _=m(I,".claude","agents");n$(_,{recursive:!0});for(let u of au($,{withFileTypes:!0})){if(!u.isFile()||!u.name.endsWith(".md"))continue;let U=u.name,z=s4(m($,U),"utf-8"),{frontmatter:g,body:J}=Eq(z),G=g.name||U.replace(".md",""),q=RS[G]||{tools:"Read, Write, Edit, Bash, Grep, Glob",model:"sonnet",maxTurns:20},N={name:G,description:g.description,tools:q.tools,model:q.model,maxTurns:q.maxTurns};if(q.effort)N.effort=q.effort;if(g.skills)N.skills=g.skills;let X=J.replace("Follow the vendor-specific execution protocol:","Follow `.agents/skills/_shared/runtime/execution-protocols/claude.md`:"),Q=`<!-- Generated by oh-my-agent CLI. Source: .agents/agents/${U} -->
|
|
336
|
+
${X}`;L4(m(_,U),Cq(N,Q))}}function WS($,I){if(!N$($))return;for(let _ of au($,{withFileTypes:!0})){if(!_.isFile()||!_.name.endsWith(".md")||_.name.startsWith("_"))continue;let u=_.name,U=s4(m($,u),"utf-8"),{frontmatter:z}=Eq(U),g=u.replace(".md",""),J=z.description||g,G=m(I,".claude","skills",g);nI(G);let q=Cq({name:g,description:J,"disable-model-invocation":!0},`# /${g}
|
|
332
337
|
|
|
333
338
|
Read and follow \`.agents/workflows/${u}\` step by step.
|
|
334
|
-
`);
|
|
335
|
-
`)}function
|
|
336
|
-
`),
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
339
|
+
`);n$(G,{recursive:!0}),L4(m(G,"SKILL.md"),q)}}function PS($,I){let _=m($,".agents","hooks","core");if(!N$(_))return;n$(I,{recursive:!0}),R4(_,I,{recursive:!0,force:!0})}function bS($,I,_){let u={};if(N$($))try{u=JSON.parse(s4($,"utf-8"))}catch{}if(u.hooks={...u.hooks||{},...I},_)Object.assign(u,_);L4($,`${JSON.stringify(u,null,2)}
|
|
340
|
+
`)}function RH($,I){if($.projectDirEnv)return`${$.runtime} "$${$.projectDirEnv}/${$.hookDir}/${I}"`;return`${$.runtime} ${$.hookDir}/${I}`}function AS($,I,_){PS($,m(I,_.hookDir));let u={};for(let[z,g]of Object.entries(_.events)){let J={hooks:[{type:"command",command:RH(_,g.hook),timeout:g.timeout}]};if(g.matcher)J.matcher=g.matcher;u[z]=[J]}let U={};if(_.statusLine)U.statusLine={type:"command",command:RH(_,_.statusLine.hook)};if(_.extra)Object.assign(U,_.extra);if(bS(m(I,_.settingsFile),u,Object.keys(U).length>0?U:void 0),_.featureFlags)jS(m(I,_.featureFlags.file),_.featureFlags.section,_.featureFlags.flags)}function jS($,I,_){n$(kq($),{recursive:!0});let u="";if(N$($))u=s4($,"utf-8");for(let[U,z]of Object.entries(_)){if(new RegExp(`${U}\\s*=\\s*${z}`,"i").test(u))continue;let J=new RegExp(`${U}\\s*=\\s*${!z}`,"i");if(J.test(u)){u=u.replace(J,`${U} = ${z}`),L4($,u);continue}if(new RegExp(`\\[${I}\\]`,"i").test(u))u=u.replace(new RegExp(`(\\[${I}\\][^[]*)`,"i"),`$1${U} = ${z}
|
|
341
|
+
`),L4($,u);else u=`${u.trimEnd()}
|
|
342
|
+
|
|
343
|
+
[${I}]
|
|
344
|
+
${U} = ${z}
|
|
345
|
+
`,L4($,u)}}var FS="<!-- OMA:START",LH="<!-- OMA:END -->";function SS($){let I=m($,".claude","CLAUDE.md.template");if(!N$(I))return;let _=process.env.HOME||process.env.USERPROFILE||"",u=s4(I,"utf-8").trim(),U=m(_,".claude","CLAUDE.md");if(n$(kq(U),{recursive:!0}),N$(U)){let z=s4(U,"utf-8"),g=z.indexOf(FS),J=z.indexOf(LH);if(g!==-1&&J!==-1){let G=z.slice(0,g),q=z.slice(J+LH.length);L4(U,`${G}${u}${q}`)}else L4(U,`${z.trimEnd()}
|
|
340
346
|
|
|
341
347
|
${u}
|
|
342
|
-
`)}else
|
|
343
|
-
`)}function
|
|
344
|
-
`),"Authentication Status"),
|
|
348
|
+
`)}else L4(U,`${u}
|
|
349
|
+
`)}function $2($,I,_){let u=m($,".agents","agents"),U=m($,".agents","workflows"),z=m($,".agents","hooks","variants");for(let g of _){let J=m(z,`${g}.json`);if(N$(J)){let G=JSON.parse(s4(J,"utf-8"));AS($,I,G)}if(g==="claude")ZS(u,I),WS(U,I),LS($,I),SS($)}}function Q0(){return[...Y4.domain,...Y4.design,...Y4.coordination,...Y4.utility,...Y4.infrastructure]}var EH={claude:".claude/skills",copilot:".github/skills"};function I2($,I,_){let u=[],U=[],z=fq($,O4);for(let g of I){let J=EH[g],G=m($,J);if(!N$(G))n$(G,{recursive:!0});for(let q of _){let N=m(z,q),X=m(G,q);if(!N$(N)){U.push(`${J}/${q} (source missing)`);continue}try{if(ZH(X).isSymbolicLink()){if(fq(kq(X),DS(X))===fq(N)){U.push(`${J}/${q} (already linked)`);continue}WH(X)}else{U.push(`${J}/${q} (real dir exists)`);continue}}catch(H){}let Q=VS(G,N);KS(Q,X,"dir"),u.push(`${J}/${q}`)}}return{created:u,skipped:U}}function CH($){let I=m($,O4);if(!N$(I))return[];return au(I,{withFileTypes:!0}).filter((_)=>_.isDirectory()&&!_.name.startsWith("_")).map((_)=>_.name)}function fH($){let I=[];for(let[_,u]of Object.entries(EH))if(N$(m($,u)))I.push(_);return I}function q1(){try{return yq("gh --version",{stdio:"ignore"}),!0}catch{return!1}}function l4(){try{return yq("gh auth status",{stdio:"ignore"}),!0}catch{return!1}}function X1(){try{return yq(`gh api user/starred/${R$}`,{stdio:"ignore"}),!0}catch{return!1}}function xH(){return q1()&&l4()&&X1()}function nq(){try{let $=wS("claude auth status",{stdio:["pipe","pipe","ignore"],encoding:"utf-8"});return JSON.parse($).loggedIn===!0}catch{return!1}}function hq(){let $=rq(mq(),".gemini","oauth_creds.json");if(!iq($))return!1;try{let I=JSON.parse(lq($,"utf-8"));return!!(I.access_token&&I.refresh_token)}catch{return!1}}function dq(){let $=rq(mq(),".codex","auth.json");if(!iq($))return!1;try{return!!JSON.parse(lq($,"utf-8")).tokens?.access_token}catch{return!1}}function cq(){let $=rq(mq(),".qwen","settings.json");if(!iq($))return!1;try{return!!JSON.parse(lq($,"utf-8")).security?.auth?.selectedType}catch{return!1}}async function kH($=!1){let[I,_]=await Promise.all([l4(),rI().then((X)=>!!X)]),u=hq(),U=nq(),z=dq(),g=cq(),J={github:I,gemini:u,claude:U,codex:z,qwen:g,antigravity:_};if($){console.log(JSON.stringify(J,null,2));return}B$(N1.default.bgMagenta(N1.default.white(" \uD83D\uDD10 oh-my-agent auth status ")));let G=(X)=>X?"✅":"❌",q=(X)=>X?N1.default.green("Authenticated"):N1.default.red("Not Authenticated");y([["GitHub",I],["Gemini CLI",u],["Claude CLI",U],["Codex CLI",z],["Qwen CLI",g],["Antigravity",_]].map(([X,Q])=>`${G(Q)} ${X.padEnd(12)} ${q(Q)}`).join(`
|
|
350
|
+
`),"Authentication Status"),p(`Use ${N1.default.cyan("gemini auth")}, ${N1.default.cyan("claude auth")}, etc. to login.`)}import{spawn as ES}from"node:child_process";import{existsSync as yH,readFileSync as iH,writeFileSync as CS}from"node:fs";import fS from"node:http";import xS from"node:https";import{homedir as kS}from"node:os";import{join as lH}from"node:path";var yS="http://localhost:12341/mcp",mH=1000,iS=Number.parseInt(process.env.OH_MY_AG_BRIDGE_PROBE_TIMEOUT_MS??"2000",10),lS=Number.parseInt(process.env.OH_MY_AG_BRIDGE_STARTUP_TIMEOUT_MS??"120000",10),S6={};function rH(){if(S6.stdinData)process.stdin.off("data",S6.stdinData);if(S6.sigint)process.off("SIGINT",S6.sigint);if(S6.sigterm)process.off("SIGTERM",S6.sigterm);S6={}}function mS(){let $=lH(kS(),".serena","serena_config.yml");if(!yH($))return;try{let _=iH($,"utf8").match(/^projects:\s*\n((?:\s*-\s*.+\n?)*)/m);if(!_)return;let U=((_[1]??"").match(/^\s*-\s*(.+)$/gm)||[]).map((z)=>z.replace(/^\s*-\s*/,"").trim());for(let z of U){let g=lH(z,".serena","project.yml");if(!yH(g))continue;let J=iH(g,"utf8");if(!/^languages:/m.test(J)){console.error(`[Bridge] Missing 'languages' key in ${g}, adding default...`);let G=J.search(/\n(?=\w)/);if(G!==-1){let q=`${J.slice(0,G)}
|
|
345
351
|
|
|
346
352
|
languages:
|
|
347
353
|
- python
|
|
348
354
|
- typescript
|
|
349
355
|
- dart
|
|
350
|
-
- terraform${J.slice(G)}`;CS(g,
|
|
351
|
-
`);let
|
|
356
|
+
- terraform${J.slice(G)}`;CS(g,q),console.error(`[Bridge] Fixed ${g}`)}}}}catch(I){console.error(`[Bridge] Warning: Failed to validate Serena configs: ${I instanceof Error?I.message:I}`)}}async function nH($){rH();let I=$||yS,_=new URL(I),U=_.protocol==="https:"?xS:fS,z=null,g=!1,J=null,G=!1;async function q(){let K=_.hostname==="localhost"?[I,I.replace("localhost","127.0.0.1")]:[I];for(let D of K)if(await new Promise((C)=>{let x=U.get(D,(P)=>{C(!0),x.destroy()});x.setTimeout(iS,()=>{x.destroy(),C(!1)}),x.on("error",()=>{C(!1)}),x.end()}))return!0;return!1}async function N(){let K=_.port||"12341",D=_.hostname||"0.0.0.0";console.error(`Starting Serena server on ${D}:${K}...`),z=ES("uvx",["--from","git+https://github.com/oraios/serena","serena-mcp-server","--transport","streamable-http","--host",D,"--port",K,"--context","ide","--open-web-dashboard","false"],{stdio:"pipe",detached:!1});let C=z;if(z.stderr)z.stderr.on("data",(P)=>{process.stderr.write(`[Serena] ${P}`)});if(z.stdout)z.stdout.on("data",()=>{});C.on("error",(P)=>{console.error("Failed to start Serena server:",P),process.exit(1)}),C.on("exit",(P,e)=>{if(console.error(`Serena server exited with code ${String(P)} signal ${String(e)}`),!g)process.exit(typeof P==="number"?P:1)}),console.error("Waiting for Serena to be ready...");let x=Math.max(1,Math.ceil(lS/mH));for(let P=0;P<x;P++){if(await q()){console.error("Serena server is ready!");return}await new Promise((e)=>setTimeout(e,mH))}console.error("Timed out waiting for Serena server to start."),process.exit(1)}function X(K,D){let S=new URL(I),C={"Content-Type":"application/json",Accept:"application/json, text/event-stream","Content-Length":String(Buffer.byteLength(K))};if(J)C["Mcp-Session-Id"]=J;let x={hostname:S.hostname,port:S.port,path:S.pathname,method:"POST",headers:C},P=U.request(x,D);P.on("error",(e)=>{console.error("POST error:",e.message)}),P.write(K),P.end()}function Q(K,D){let S="";K.on("data",(C)=>{S+=C.toString(),S=S.replace(/\r\n/g,`
|
|
357
|
+
`);let x=S.split(`
|
|
352
358
|
|
|
353
|
-
`);
|
|
354
|
-
`),
|
|
355
|
-
`)}),
|
|
356
|
-
`);
|
|
357
|
-
`)}),
|
|
358
|
-
`);if(
|
|
359
|
-
`),
|
|
360
|
-
${
|
|
361
|
-
`).filter((
|
|
362
|
-
`);y(
|
|
363
|
-
`);if(y(
|
|
359
|
+
`);S=x.pop()||"";for(let P of x){let e=P.split(`
|
|
360
|
+
`),c="";for(let T$ of e)if(T$.startsWith("data:"))c+=T$.slice(5).trim();if(c)D(c)}})}function H(){if(!J||G)return;G=!0;let K=new URL(I),D={hostname:K.hostname,port:K.port,path:K.pathname,method:"GET",headers:{Accept:"application/json, text/event-stream","Cache-Control":"no-cache","Mcp-Session-Id":J}},S=U.request(D,(C)=>{if(C.statusCode===405){C.resume(),G=!1;return}if(C.statusCode===409){console.error("GET stream already open for this session (409)"),C.resume();return}if(C.statusCode!==200){if(console.error(`Server stream connection failed: ${C.statusCode}`),C.resume(),G=!1,!g)setTimeout(H,1000);return}Q(C,(x)=>{process.stdout.write(`${x}
|
|
361
|
+
`)}),C.on("end",()=>{if(G=!1,!g)console.error("Server stream closed, reconnecting..."),setTimeout(H,1000)}),C.on("error",(x)=>{if(G=!1,console.error("Server stream error:",x.message),!g)setTimeout(H,1000)})});S.on("error",(C)=>{if(G=!1,console.error("Server stream connection error:",C.message),!g)setTimeout(H,1000)}),S.end()}if(mS(),!await q())await N();else console.error(`Connected to existing Serena server at ${I}`);let v="",O=!1,T=[];process.stdin.setEncoding("utf8");let L=(K)=>{v+=K.toString();let D=v.split(`
|
|
362
|
+
`);v=D.pop()||"";for(let S of D)if(S.trim())V(S.trim())};process.stdin.on("data",L);function V(K){if(O){T.push(K);return}M(K)}function R(){while(T.length>0){let K=T.shift();if(K)M(K)}}function M(K){try{let D=JSON.parse(K),S=D.method==="initialize";if(S)O=!0;let C=JSON.stringify(D);X(C,(x)=>{let P=x.headers["mcp-session-id"];if(P)J=P;if(x.statusCode===202){if(x.resume(),S)O=!1,R();return}if((x.headers["content-type"]||"").includes("text/event-stream"))Q(x,(c)=>{process.stdout.write(`${c}
|
|
363
|
+
`)}),x.on("end",()=>{if(S){if(O=!1,J)H();R()}});else{let c="";x.on("data",(T$)=>{c+=T$.toString()}),x.on("end",()=>{if(c.trim())process.stdout.write(`${c}
|
|
364
|
+
`);if(S){if(O=!1,J)H();R()}})}})}catch(D){let S=D instanceof Error?D.message:String(D);console.error("Failed to parse IDE message:",S)}}process.stdin.resume();let Z=()=>{if(g=!0,rH(),z)console.error("Stopping Serena server..."),z.kill("SIGTERM");process.exit(0)};S6={stdinData:L,sigint:Z,sigterm:Z},process.on("SIGINT",Z),process.on("SIGTERM",Z)}I4();var g4=v$(P$(),1);import{existsSync as $6,readdirSync as v0,readFileSync as pq,rmSync as hH}from"node:fs";import{tmpdir as rS}from"node:os";import{join as f$}from"node:path";async function nS($,I,_){let u=f$($,".gemini","antigravity"),U=f$(u,"brain"),z=f$(u,"implicit"),g=f$(u,"knowledge"),J=$6(U),G=$6(z),q=$6(g);if(!J&&!G&&!q)return{shouldCleanupBrain:!1,shouldCleanupImplicit:!1,shouldCleanupKnowledge:!1};if(I)return{shouldCleanupBrain:J,shouldCleanupImplicit:G,shouldCleanupKnowledge:q};let N=[J&&" - brain",G&&" - implicit",q&&" - knowledge"].filter(Boolean).join(`
|
|
365
|
+
`),X=_?!0:await b$({message:`Clean up IDE garbage?
|
|
366
|
+
${N}`,initialValue:!0});if(_$(X)||!X)return{shouldCleanupBrain:!1,shouldCleanupImplicit:!1,shouldCleanupKnowledge:!1};return{shouldCleanupBrain:J,shouldCleanupImplicit:G,shouldCleanupKnowledge:q}}async function dH($=!1,I=!1,_=!1){let u=process.cwd(),U=f$(u,".agents","results"),z=rS(),g={cleaned:0,skipped:0,details:[]},J=await nS(u,I,_),G=(Y)=>{g.details.push($?`[DRY-RUN] ${Y}`:`[CLEAN] ${Y}`),g.cleaned++},q=(Y)=>{g.details.push(`[SKIP] ${Y}`),g.skipped++},N=(Y)=>{if($)return;try{hH(Y,{force:!0})}catch{}},X=(Y)=>{try{return process.kill(Y,0),!0}catch{return!1}},Q=async(Y)=>{if($)return;try{process.kill(Y)}catch{}await new Promise((v)=>setTimeout(v,1000));try{if(X(Y))process.kill(Y,"SIGKILL")}catch{}};try{let Y=v0(z).filter((v)=>v.startsWith("subagent-")&&v.endsWith(".pid"));for(let v of Y){let O=f$(z,v),T=pq(O,"utf-8").trim();if(!T){G(`Removing empty PID file: ${O}`),N(O);continue}let L=parseInt(T,10);if(Number.isNaN(L)){G(`Removing invalid PID file: ${O}`),N(O);continue}if(X(L))G(`Killing orphaned process PID=${L} (from ${O})`),await Q(L),N(O);else G(`Removing stale PID file (process gone): ${O}`),N(O)}}catch{}try{let Y=v0(z).filter((v)=>v.startsWith("subagent-")&&v.endsWith(".log"));for(let v of Y){let O=f$(z,v),T=v.replace(".log",".pid"),L=f$(z,T);if($6(L))try{let V=pq(L,"utf-8").trim(),R=parseInt(V,10);if(!Number.isNaN(R)){if(X(R)){q(`Log file has active process: ${O}`);continue}}}catch{}G(`Removing stale log file: ${O}`),N(O)}}catch{}if($6(U))try{let Y=v0(U).filter((v)=>v.startsWith("parallel-"));for(let v of Y){let O=f$(U,v,"pids.txt");if(!$6(O))continue;let L=pq(O,"utf-8").split(`
|
|
367
|
+
`).filter((R)=>R.trim()),V=!1;for(let R of L){let[M,Z]=R.split(":"),K=parseInt(M?.trim()||"",10);if(Number.isNaN(K))continue;if(X(K))V=!0,G(`Killing orphaned parallel agent PID=${K} (${Z?.trim()||"unknown"})`),await Q(K),N(O)}if(!V)G(`Removing stale PID list: ${O}`),N(O);else if(!$){await new Promise((R)=>setTimeout(R,1000));try{hH(O,{force:!0})}catch{}}}}catch{}else q(`No results directory found: ${U}`);if(J.shouldCleanupBrain||J.shouldCleanupImplicit||J.shouldCleanupKnowledge){let Y=f$(u,".gemini","antigravity");if(J.shouldCleanupBrain){let v=f$(Y,"brain");try{if($6(v)){let O=v0(v);for(let T of O){let L=f$(v,T);G(`Removing brain file: ${L}`),N(L)}}}catch{}}if(J.shouldCleanupImplicit){let v=f$(Y,"implicit");try{if($6(v)){let O=v0(v);for(let T of O){let L=f$(v,T);G(`Removing implicit file: ${L}`),N(L)}}}catch{}}if(J.shouldCleanupKnowledge){let v=f$(Y,"knowledge");try{if($6(v)){let O=v0(v);for(let T of O){let L=f$(v,T);G(`Removing knowledge file: ${L}`),N(L)}}}catch{}}}if(I){console.log(JSON.stringify(g,null,2));return}if(console.clear(),B$(g4.default.bgMagenta(g4.default.white(" \uD83E\uDDF9 oh-my-agent cleanup "))),$)y(g4.default.yellow("Dry-run mode — no changes will be made"),"Mode");if(g.details.length>0){let Y=[g4.default.bold("Cleanup Details"),...g.details.map((v)=>{if(v.startsWith("[DRY-RUN]"))return g4.default.yellow(v);if(v.startsWith("[CLEAN]"))return g4.default.green(v);return g4.default.cyan(v)})].join(`
|
|
368
|
+
`);y(Y,"Details")}let H=[g4.default.bold("Summary"),"┌─────────┬────────┐",`│ ${g4.default.bold("Action")} │ ${g4.default.bold("Count")} │`,"├─────────┼────────┤",`│ Cleaned │ ${String(g.cleaned).padEnd(6)} │`,`│ Skipped │ ${String(g.skipped).padEnd(6)} │`,"└─────────┴────────┘"].join(`
|
|
369
|
+
`);if(y(H,"Results"),$)p(g4.default.yellow("Run without --dry-run to apply changes"));else p(g4.default.green("Cleanup complete!"))}I4();var i=v$(P$(),1);import{execSync as oq}from"node:child_process";import{existsSync as I6,readdirSync as pH,readFileSync as _2,writeFileSync as dS}from"node:fs";import{join as Q1}from"node:path";var cH={cleanupPeriodDays:180,CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS:1e5,CLAUDE_AUTOCOMPACT_PCT_OVERRIDE:80,DISABLE_TELEMETRY:"1",DISABLE_ERROR_REPORTING:"1",CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY:"1",CLAUDE_CODE_DISABLE_AUTO_MEMORY:"1",DISABLE_PROMPT_CACHING:"1"},hS={commit:`Generated with oh-my-agent
|
|
364
370
|
|
|
365
|
-
Co-Authored-By: First Fluke <our.first.fluke@gmail.com>`,pr:"Generated with [oh-my-agent](https://github.com/first-fluke/oh-my-agent)"};function
|
|
366
|
-
`),"CLI Status"),
|
|
367
|
-
`),"Install missing CLIs");if(z.length>0){let
|
|
368
|
-
`);y(
|
|
369
|
-
`);y(
|
|
370
|
-
`),"Installed Skills")}catch(P){
|
|
371
|
+
Co-Authored-By: First Fluke <our.first.fluke@gmail.com>`,pr:"Generated with [oh-my-agent](https://github.com/first-fluke/oh-my-agent)"};function H0($){let I=$?.env;if(!I)return!0;for(let[_,u]of Object.entries(cH)){let U=I[_];if(typeof u==="number"){if((U??0)<u)return!0}else if(U!==u)return!0}if(!$.attribution?.commit||!$.attribution?.pr)return!0;return!1}function Y0($){return $.env={...$.env||{},...cH},$.attribution={...hS},$}async function U2($,I,_){try{let u=oq(`${I} --version`,{encoding:"utf-8",stdio:["pipe","pipe","ignore"]}).trim();return{name:$,installed:!0,version:u,installCmd:_}}catch{return{name:$,installed:!1,installCmd:_}}}async function cS($){let I=process.env.HOME||process.env.USERPROFILE||"",u={gemini:{path:`${I}/.gemini/settings.json`,type:"json"},claude:{path:`${I}/.claude.json`,type:"json"},codex:{path:`${I}/.codex/config.toml`,type:"toml"}}[$];if(!u)return{configured:!1};if(I6(u.path))try{let U=_2(u.path,"utf-8");if(u.type==="json"){let z=JSON.parse(U);return{configured:!!(z.mcpServers||z.mcp),path:u.path}}return{configured:!0,path:u.path}}catch{return{configured:!1}}return{configured:!1}}async function pS(){let $=Q1(process.cwd(),O4);if(!I6($))return[];let I=Q0(),_=[];for(let u of I){let U=Q1($,u.name),z=Q1(U,"SKILL.md");_.push({name:u.name,installed:I6(U),hasSkillMd:I6(z)})}return _}async function oS(){let $=process.env.HOME||process.env.USERPROFILE||"",I=Q1($,".gemini","antigravity","global_workflows");if(!I6(I))return{installed:!1,count:0};try{return{installed:!0,count:pH(I).filter((u)=>u.endsWith(".md")).length}}catch{return{installed:!1,count:0}}}async function oH($=!1){let I=process.cwd(),_=process.env.HOME||process.env.USERPROFILE||"",u=await Promise.all([U2("gemini","gemini","bun install --global @google/gemini-cli"),U2("claude","claude","bun install --global @anthropic-ai/claude-code"),U2("codex","codex","bun install --global @openai/codex"),U2("qwen","qwen","bun install --global @qwen-code/qwen-code")]),U={gemini:hq,claude:nq,codex:dq,qwen:cq},z=await Promise.all(u.filter((M)=>M.installed).map(async(M)=>{let Z=await cS(M.name);return{...M,mcp:Z}})),g=await pS(),J=await oS(),G=!1;try{G=oq("git config --get rerere.enabled",{encoding:"utf-8",stdio:["pipe","pipe","ignore"]}).trim()==="true"}catch{}let q=u.some((M)=>M.name==="claude"&&M.installed),N=!1,X=!1,Q=Q1(_,".claude","settings.json"),H=Q1(_,".claude","CLAUDE.md");if(q)try{if(I6(Q)){let M=JSON.parse(_2(Q,"utf-8"));N=!H0(M)}}catch{}try{if(I6(H))X=_2(H,"utf-8").includes("<!-- OMA:START")}catch{}let Y=Q1(I,".serena","memories"),v=I6(Y),O=0;if(v)try{O=pH(Y).length}catch{}let T=u.filter((M)=>!M.installed),L=g.length>0?g.filter((M)=>!M.installed||!M.hasSkillMd):Q0().map((M)=>({name:M.name,installed:!1,hasSkillMd:!1})),V=T.length+L.length+(J.installed?0:1)+(G?0:1)+(q&&!N?1:0)+(q&&!X?1:0);if($){let M={ok:V===0,issues:V,clis:u.map((Z)=>({name:Z.name,installed:Z.installed,version:Z.version||null,authenticated:Z.installed?U[Z.name]?.()??!1:!1})),mcp:z.map((Z)=>({name:Z.name,configured:Z.mcp.configured,path:Z.mcp.path||null})),skills:g.length>0?g.map((Z)=>({name:Z.name,installed:Z.installed,complete:Z.hasSkillMd})):[],missingSkills:L.map((Z)=>Z.name),globalWorkflows:{installed:J.installed,count:J.count},serena:{exists:v,fileCount:O},gitRerere:{enabled:G},recommendedSettings:{configured:N},claudeMd:{hasOmaBlock:X}};console.log(JSON.stringify(M,null,2)),process.exit(V===0?0:1)}console.clear(),B$(i.default.bgMagenta(i.default.white(" \uD83E\uDE7A oh-my-agent doctor ")));let R=$4();try{let M=u.map((D)=>{let S=D.installed?i.default.green("✅"):i.default.red("❌"),C=D.version||"-",x=D.installed?U[D.name]?.()?i.default.green("✅"):i.default.red("❌"):i.default.dim("-");return`${S} ${D.name.padEnd(8)} ${C.padEnd(12)} ${x}`});if(y([`${"CLI".padEnd(11)} ${"Version".padEnd(12)} Auth`,...M].join(`
|
|
372
|
+
`),"CLI Status"),T.length>0)y(T.map((D)=>`${i.default.yellow("→")} ${D.name}: ${i.default.dim(D.installCmd)}`).join(`
|
|
373
|
+
`),"Install missing CLIs");if(z.length>0){let D=[i.default.bold("\uD83D\uDD17 MCP Connection Status"),"┌─────────┬──────────┬─────────────────────┐",`│ ${i.default.bold("CLI")} │ ${i.default.bold("MCP Config")} │ ${i.default.bold("Path")} │`,"├─────────┼──────────┼─────────────────────┤",...z.map((S)=>{let C=S.mcp.configured?i.default.green("✅ Configured"):i.default.yellow("⚠️ Not configured"),x=S.mcp.path?S.mcp.path.split("/").pop()||"":"-";return`│ ${S.name.padEnd(7)} │ ${C.padEnd(8)} │ ${x.padEnd(19)} │`}),"└─────────┴──────────┴─────────────────────┘"].join(`
|
|
374
|
+
`);y(D,"MCP Status")}let Z=g.filter((D)=>D.installed).length,K=g.filter((D)=>D.hasSkillMd).length;if(g.length>0){let D=[i.default.bold(`\uD83D\uDCE6 Skills (${Z}/${g.length} installed, ${K} complete)`),"┌────────────────────┬──────────┬─────────────┐",`│ ${i.default.bold("Skill")} │ ${i.default.bold("Installed")} │ ${i.default.bold("SKILL.md")} │`,"├────────────────────┼──────────┼─────────────┤",...g.map((S)=>{let C=S.installed?i.default.green("✅"):i.default.red("❌"),x=S.hasSkillMd?i.default.green("✅"):i.default.red("❌");return`│ ${S.name.padEnd(18)} │ ${C.padEnd(8)} │ ${x.padEnd(11)} │`}),"└────────────────────┴──────────┴─────────────┘"].join(`
|
|
375
|
+
`);y(D,"Skills Status")}else y(i.default.yellow("No skills installed."),"Skills Status");if(L.length>0){let D=await b$({message:`Found ${L.length} missing/incomplete skill(s). Install them?`,initialValue:!0});if(_$(D))r$("Cancelled."),process.exit(0);if(D){let S=L.map((P)=>P.name),C=await F6({message:"Which skills to install?",options:[{value:"all",label:`✨ All (${S.length} skills)`,hint:"Recommended"},{value:"select",label:"\uD83D\uDD27 Select individually"}]});if(_$(C))r$("Cancelled."),process.exit(0);let x;if(C==="select"){let P=Q0(),e=await mI({message:"Select skills to install:",options:L.map((c)=>{let T$=P.find((p$)=>p$.name===c.name);return{value:c.name,label:c.name,hint:T$?.desc||""}}),required:!0});if(_$(e))r$("Cancelled."),process.exit(0);x=e}else x=S;R.start("Installing skills...");try{su(I,I);for(let P of x)R.message(`Installing ${i.default.cyan(P)}...`),eu(I,P,I);R.stop(`Installed ${x.length} skill(s)!`),y(x.map((P)=>`${i.default.green("✓")} ${P}`).join(`
|
|
376
|
+
`),"Installed Skills")}catch(P){R.stop("Installation failed"),t.error(P instanceof Error?P.message:String(P))}}}if(v)y(`${i.default.green("✅")} Serena memory directory exists
|
|
371
377
|
${i.default.dim(`${O} memory files found`)}`,"Serena Memory");else y(`${i.default.yellow("⚠️")} Serena memory directory not found
|
|
372
378
|
${i.default.dim("Dashboard will show 'No agents detected'")}`,"Serena Memory");if(J.installed)y(`${i.default.green("✅")} Global workflows installed
|
|
373
379
|
${i.default.dim(`${J.count} workflow files found`)}`,"Global Workflows");else y(`${i.default.red("❌")} Global workflows missing
|
|
374
|
-
${i.default.dim("Run 'oma' to install or reinstall global workflows")}`,"Global Workflows");if(G)y(`${i.default.green("✅")} git rerere is enabled`,"Git Config");else{let
|
|
375
|
-
${i.default.dim("Run: git config --global rerere.enabled true")}`,"Git Config")}if(
|
|
376
|
-
`),
|
|
377
|
-
${i.default.dim("Conversations are deleted after 30 days by default")}`,"Claude Config")}if(
|
|
378
|
-
${i.default.dim("Run 'oh-my-agent' to install or reinstall")}`,"CLAUDE.md")}if(
|
|
380
|
+
${i.default.dim("Run 'oma' to install or reinstall global workflows")}`,"Global Workflows");if(G)y(`${i.default.green("✅")} git rerere is enabled`,"Git Config");else{let D=await b$({message:"Enable git rerere? (Recommended for multi-agent merge conflict reuse)",initialValue:!0});if(!_$(D)&&D)try{oq("git config --global rerere.enabled true"),t.success(i.default.green("git rerere enabled globally!"))}catch(S){t.error(`Failed to enable git rerere: ${S}`)}else y(`${i.default.yellow("⚠️")} git rerere is not enabled
|
|
381
|
+
${i.default.dim("Run: git config --global rerere.enabled true")}`,"Git Config")}if(q){if(N)y(`${i.default.green("✅")} Claude Code recommended settings applied`,"Claude Config");else{let D=await b$({message:"Apply recommended Claude Code settings?",initialValue:!0});if(!_$(D)&&D)try{let S={};if(I6(Q))S=JSON.parse(_2(Q,"utf-8"));Y0(S),dS(Q,`${JSON.stringify(S,null,2)}
|
|
382
|
+
`),t.success(i.default.green("Claude Code recommended settings applied!"))}catch(S){t.error(`Failed to apply Claude Code settings: ${S}`)}else y(`${i.default.yellow("⚠️")} Claude Code recommended settings not applied
|
|
383
|
+
${i.default.dim("Conversations are deleted after 30 days by default")}`,"Claude Config")}if(X)y(`${i.default.green("✅")} OMA block found in ~/.claude/CLAUDE.md`,"CLAUDE.md");else y(`${i.default.yellow("⚠️")} OMA block missing in ~/.claude/CLAUDE.md
|
|
384
|
+
${i.default.dim("Run 'oh-my-agent' to install or reinstall")}`,"CLAUDE.md")}if(V===0)p(i.default.green("✅ All checks passed! Ready to use."));else p(i.default.yellow(`⚠️ Found ${V} issue(s). See details above.`));if(xH())y(`${i.default.green("⭐")} Thank you for starring oh-my-agent!
|
|
379
385
|
${i.default.dim("https://github.com/sponsors/first-fluke")}`,"Support");else y(`${i.default.yellow("❤️")} Enjoying oh-my-agent? Give it a star or sponsor!
|
|
380
386
|
${i.default.dim("gh api --method PUT /user/starred/first-fluke/oh-my-agent")}
|
|
381
|
-
${i.default.dim("https://github.com/sponsors/first-fluke")}`,"Support")}catch(
|
|
382
|
-
`)}}catch{}let
|
|
383
|
-
`)),U}import{existsSync as
|
|
384
|
-
`,G=_.slice(0,g)+J+_.slice(g);return
|
|
387
|
+
${i.default.dim("https://github.com/sponsors/first-fluke")}`,"Support")}catch(M){if(R)R.stop("Check failed");t.error(M instanceof Error?M.message:String(M)),process.exit(1)}}I4();var D$=v$(P$(),1);import{execSync as U6}from"node:child_process";import{existsSync as B0,readdirSync as Vw,readFileSync as dI,writeFileSync as H2}from"node:fs";import{join as Y1}from"node:path";I4();var u2=v$(P$(),1);import{execSync as tH}from"node:child_process";import{existsSync as h$,readFileSync as O0,rmSync as w6,writeFileSync as tq}from"node:fs";import{join as d$}from"node:path";function tS($){for(let I of[".omc",".omx"]){let _=d$($,I);if(h$(_))w6(_,{recursive:!0,force:!0})}}function aS($){let I=process.env.HOME||process.env.USERPROFILE||"",_=[],u=d$(I,".claude","CLAUDE.md"),U=!1;if(h$(u))try{U=O0(u,"utf-8").includes("OMC:START")}catch{}if(U)_.push({name:"omc",displayName:"oh-my-claudecode",uninstall:()=>{let J=d$(I,".claude");for(let X of["architect","document-specialist","explore","designer","writer","vision","critic","analyst","executor","planner"]){let Q=d$(J,"agents",`${X}.md`);if(h$(Q))w6(Q,{force:!0})}for(let X of["coordinator","omc","ultrawork","deepsearch","analyze","plan","review","planner","orchestrator","update"]){let Q=d$(J,"commands",`${X}.md`);if(h$(Q))w6(Q,{force:!0})}for(let X of["ultrawork","git-master","frontend-ui-ux"]){let Q=d$(J,"skills",X);if(!h$(Q))continue;let H=d$(Q,"SKILL.md");if(h$(H))try{if(O0(H,"utf-8").includes(".agents/workflows/"))continue}catch{continue}w6(Q,{recursive:!0,force:!0})}for(let X of["keyword-detector.sh","silent-auto-update.sh","stop-continuation.sh"]){let Q=d$(J,"hooks",X);if(h$(Q))w6(Q,{force:!0})}for(let X of[".omc-version.json",".omc-silent-update.json",".omc-update.log",".omc-config.json"]){let Q=d$(J,X);if(h$(Q))w6(Q,{force:!0})}let G=d$($,".omc");if(h$(G))w6(G,{recursive:!0,force:!0});let q=d$(J,"settings.json");if(h$(q))try{let X=JSON.parse(O0(q,"utf-8"));if(X.hooks){for(let Q of Object.keys(X.hooks)){if(!Array.isArray(X.hooks[Q]))continue;if(X.hooks[Q]=X.hooks[Q].map((H)=>{if(Array.isArray(H.hooks))H.hooks=H.hooks.filter((Y)=>!Y.command||!(Y.command.includes("keyword-detector.sh")||Y.command.includes("silent-auto-update.sh")||Y.command.includes("stop-continuation.sh")));return H}).filter((H)=>!H.hooks||H.hooks.length>0),X.hooks[Q].length===0)delete X.hooks[Q]}if(Object.keys(X.hooks).length===0)delete X.hooks;tq(q,`${JSON.stringify(X,null,2)}
|
|
388
|
+
`)}}catch{}let N=d$(J,"CLAUDE.md");if(h$(N))try{let X=O0(N,"utf-8");if(X.includes("OMC:START")){let Q=X.replace(/<!-- OMC:START[\s\S]*?OMC:END -->\n?/g,"");tq(N,Q)}}catch{}}});for(let J of["opencode.json","opencode.jsonc"]){let G=d$(I,".config","opencode",J);if(!h$(G))continue;try{let N=O0(G,"utf-8").replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"").replace(/,\s*([\]}])/g,"$1"),X=JSON.parse(N);if(Array.isArray(X.plugin)&&X.plugin.includes("oh-my-opencode")){_.push({name:"omo",displayName:"oh-my-opencode",uninstall:()=>{let H=O0(G,"utf-8").replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"").replace(/,\s*([\]}])/g,"$1"),Y=JSON.parse(H);Y.plugin=Y.plugin.filter((v)=>v!=="oh-my-opencode"),tq(G,JSON.stringify(Y,null,2))}});break}}catch{}}let z=d$(I,".agents","skills","superpowers"),g=d$(I,".codex","superpowers");if(h$(z)||h$(g))_.push({name:"superpowers",displayName:"superpowers",uninstall:()=>{for(let J of[z,g])if(h$(J))w6(J,{recursive:!0,force:!0})}});try{tH("npm ls -g oh-my-codex",{stdio:"pipe",timeout:1e4}),_.push({name:"omx",displayName:"oh-my-codex",uninstall:()=>{tH("npx -y oh-my-codex@latest uninstall --yes",{stdio:"pipe",timeout:60000})}})}catch{}return _}async function z2($){tS($);let I=aS($);if(I.length===0)return[];let _=I.map((g)=>g.name),u=await b$({message:`${u2.default.yellow(_.join(", "))} detected. Remove all?`,initialValue:!0});if(_$(u)||!u)return[];let U=[],z=$4();z.start("Removing competing tools...");for(let g of I)try{g.uninstall(),U.push(`${g.displayName} removed`)}catch(J){let G=J instanceof Error?J.message:String(J);U.push(`${g.displayName} removal failed: ${G}`)}return z.stop(U.map((g)=>g.includes("failed")?`${u2.default.red("✗")} ${g}`:`${u2.default.green("✓")} ${g}`).join(`
|
|
389
|
+
`)),U}import{existsSync as g2,mkdirSync as eS,readFileSync as sS,writeFileSync as $w}from"node:fs";import{dirname as Iw,join as T0}from"node:path";async function J2($){let I=T0($,O4,"_version.json");if(!g2(I))return null;try{let _=sS(I,"utf-8");return JSON.parse(_).version||null}catch{return null}}function aH($){let I=T0($,O4);if(!g2(I))return!1;return[T0($,".agents","oma-config.yaml"),T0($,".agents","mcp.json"),T0($,".agents","workflows")].some((u)=>g2(u))}async function G2($,I){let _=T0($,O4,"_version.json"),u=Iw(_);if(!g2(u))eS(u,{recursive:!0});$w(_,JSON.stringify({version:I},null,2),"utf-8")}async function eH(){let $=`https://raw.githubusercontent.com/${R$}/main/prompt-manifest.json`,I=await fetch($);if(!I.ok)throw Error("Failed to fetch remote manifest");return await I.json()}import{existsSync as v1,mkdirSync as sH,readFileSync as IY,writeFileSync as q2}from"node:fs";import{homedir as Uw}from"node:os";import{join as m4,resolve as $Y}from"node:path";var aq=m4(Uw(),".serena","serena_config.yml"),UY={"oma-frontend":["typescript"],"oma-mobile":["dart"],"oma-tf-infra":["terraform"]},eq={python:"python",node:"typescript",rust:"rust"};function _Y($,I){let _=new Set;for(let u of $){let U=UY[u];if(U)for(let z of U)_.add(z)}if($.includes("oma-backend")&&I&&eq[I])_.add(eq[I]);if(_.size===0)_.add("typescript");return[..._]}function uY($){let I=new Set,_=m4($,".agents","skills");for(let[U,z]of Object.entries(UY))if(v1(m4(_,U)))for(let g of z)I.add(g);let u=m4(_,"oma-backend","stack","stack.yaml");if(v1(u))try{let z=IY(u,"utf-8").match(/^language:\s*(.+)$/m);if(z){let g=z[1].trim(),J=eq[g];if(J)I.add(J)}}catch{}else if(v1(m4(_,"oma-backend")))I.add("typescript");if(I.size===0)I.add("typescript");return[...I]}function _w($){let I=$Y($);if(!v1(aq))return!1;try{let _=IY(aq,"utf-8"),u=_.match(/^(projects:\s*\n)((?:\s*-\s*.+\n?)*)/m);if(!u)return!1;if(((u[2]??"").match(/^\s*-\s*(.+)$/gm)||[]).map((q)=>$Y(q.replace(/^\s*-\s*/,"").trim())).includes(I))return!1;let g=(u.index??0)+u[0].length,J=`- ${I}
|
|
390
|
+
`,G=_.slice(0,g)+J+_.slice(g);return q2(aq,G),!0}catch{return!1}}var uw=($,I)=>`languages:
|
|
385
391
|
${$.map((_)=>`- ${_}`).join(`
|
|
386
392
|
`)}
|
|
387
393
|
|
|
@@ -402,55 +408,55 @@ read_only_memory_patterns: []
|
|
|
402
408
|
line_ending:
|
|
403
409
|
ignored_memory_patterns: []
|
|
404
410
|
ls_specific_settings: {}
|
|
405
|
-
`;function zw($,I){let _=
|
|
406
|
-
`);let g=
|
|
407
|
-
`),"Migration");await
|
|
408
|
-
`),"Migration")}finally{u()}let
|
|
409
|
-
`),"Installed");{let
|
|
410
|
-
`),
|
|
411
|
-
`):" (none)","",
|
|
412
|
-
`):" (none)","",
|
|
411
|
+
`;function zw($,I){let _=m4($,".serena"),u=m4(_,"project.yml");if(v1(u))return!1;let U=$.split("/").pop()||$.split("\\").pop()||"project";sH(_,{recursive:!0}),q2(u,uw(I,U));let z=m4(_,".gitignore");if(!v1(z))q2(z,`/cache
|
|
412
|
+
`);let g=m4(_,"memories");sH(g,{recursive:!0});let J=m4(g,".gitkeep");if(!v1(J))q2(J,"");return!0}function X2($,I){let _=zw($,I),u=_w($);return{configured:_,registered:u}}import{execSync as gw}from"node:child_process";import{mkdtempSync as Jw,rmSync as sq,writeFileSync as Gw}from"node:fs";import{tmpdir as qw}from"node:os";import{join as zY}from"node:path";async function N2(){let $=Jw(zY(qw(),"oh-my-agent-"));try{let I=`https://api.github.com/repos/${R$}/tarball/main`,_=await fetch(I,{headers:{"User-Agent":"oh-my-agent-cli"}});if(!_.ok)throw Error(`HTTP ${_.status}`);let u=zY($,"repo.tar.gz");Gw(u,Buffer.from(await _.arrayBuffer())),gw(`tar -xzf "${u}" -C "${$}" --strip-components=1`,{stdio:"pipe",timeout:30000}),sq(u)}catch(I){throw sq($,{recursive:!0,force:!0}),Error(`Failed to download repository archive: ${I instanceof Error?I.message:I}`)}return{dir:$,cleanup:()=>sq($,{recursive:!0,force:!0})}}import{existsSync as x$,lstatSync as gY,readdirSync as $X,renameSync as Q2,rmSync as v2,unlinkSync as JY}from"node:fs";import{join as T4}from"node:path";var Xw={"backend-agent":"oma-backend","db-agent":"oma-db","debug-agent":"oma-debug","frontend-agent":"oma-frontend","mobile-agent":"oma-mobile","pm-agent":"oma-pm","qa-agent":"oma-qa","tf-infra-agent":"oma-tf-infra",brainstorm:"oma-brainstorm",commit:"oma-commit",orchestrator:"oma-orchestrator","dev-workflow":"oma-dev-workflow",translator:"oma-translator","workflow-guide":"oma-coordination"},Nw={"backend-impl.md":"backend-engineer.md","db-impl.md":"db-engineer.md","frontend-impl.md":"frontend-engineer.md","mobile-impl.md":"mobile-engineer.md"},GY={name:"001-agents-dir",up($){let I=[],_=T4($,".agent"),u=T4($,".agents");if(x$(_)&&!x$(u))Q2(_,u),I.push(".agent/ → .agents/ (renamed)");else if(x$(_)&&x$(u))try{let g=$X(_);for(let J of g){let G=T4(_,J),q=T4(u,J);if(!x$(q))Q2(G,q),I.push(`.agent/${J} → .agents/${J} (merged)`)}v2(_,{recursive:!0,force:!0}),I.push(".agent/ (removed after merge)")}catch{}for(let g of[".cursor/skills"]){let J=T4($,g);if(!x$(J))continue;try{if(gY(J).isSymbolicLink())JY(J),I.push(`${g} (removed symlink)`);else{let q=$X(J),N=0;for(let Q of q){let H=T4(J,Q);if(gY(H).isSymbolicLink())JY(H),N++}if($X(J).length===0)v2(J,{recursive:!0}),I.push(`${g} (removed ${N} symlinks, cleaned dir)`);else if(N>0)I.push(`${g} (removed ${N} symlinks)`)}}catch{}}let U=T4($,".agents","skills");if(x$(U))for(let[g,J]of Object.entries(Xw)){let G=T4(U,g),q=T4(U,J);if(x$(G)&&!x$(q))Q2(G,q),I.push(`skills/${g} → skills/${J}`);else if(x$(G)&&x$(q))v2(G,{recursive:!0}),I.push(`skills/${g} (removed, replaced by ${J})`)}let z=T4($,".claude","agents");if(x$(z))for(let[g,J]of Object.entries(Nw)){let G=T4(z,g),q=T4(z,J);if(x$(G)&&!x$(q))Q2(G,q),I.push(`agents/${g} → agents/${J}`);else if(x$(G)&&x$(q))v2(G),I.push(`agents/${g} (removed, replaced by ${J})`)}return I}};import{existsSync as IX,mkdirSync as qY,readdirSync as Qw,readFileSync as XY,renameSync as vw,rmSync as NY,writeFileSync as Hw}from"node:fs";import{dirname as QY,join as hI}from"node:path";var Yw=[{from:".agents/skills/_shared/api-contracts/README.md",to:".agents/skills/_shared/core/api-contracts/README.md"},{from:".agents/skills/_shared/api-contracts/template.md",to:".agents/skills/_shared/core/api-contracts/template.md"},{from:".agents/skills/_shared/clarification-protocol.md",to:".agents/skills/_shared/core/clarification-protocol.md"},{from:".agents/skills/_shared/common-checklist.md",to:".agents/skills/_shared/core/common-checklist.md"},{from:".agents/skills/_shared/context-budget.md",to:".agents/skills/_shared/core/context-budget.md"},{from:".agents/skills/_shared/context-loading.md",to:".agents/skills/_shared/core/context-loading.md"},{from:".agents/skills/_shared/difficulty-guide.md",to:".agents/skills/_shared/core/difficulty-guide.md"},{from:".agents/skills/_shared/lessons-learned.md",to:".agents/skills/_shared/core/lessons-learned.md"},{from:".agents/skills/_shared/prompt-structure.md",to:".agents/skills/_shared/core/prompt-structure.md"},{from:".agents/skills/_shared/quality-principles.md",to:".agents/skills/_shared/core/quality-principles.md"},{from:".agents/skills/_shared/reasoning-templates.md",to:".agents/skills/_shared/core/reasoning-templates.md"},{from:".agents/skills/_shared/session-metrics.md",to:".agents/skills/_shared/core/session-metrics.md"},{from:".agents/skills/_shared/skill-routing.md",to:".agents/skills/_shared/core/skill-routing.md"},{from:".agents/skills/_shared/experiment-ledger.md",to:".agents/skills/_shared/conditional/experiment-ledger.md"},{from:".agents/skills/_shared/exploration-loop.md",to:".agents/skills/_shared/conditional/exploration-loop.md"},{from:".agents/skills/_shared/quality-score.md",to:".agents/skills/_shared/conditional/quality-score.md"},{from:".agents/skills/_shared/memory-protocol.md",to:".agents/skills/_shared/runtime/memory-protocol.md"},{from:".agents/skills/_shared/execution-protocols/claude.md",to:".agents/skills/_shared/runtime/execution-protocols/claude.md"},{from:".agents/skills/_shared/execution-protocols/codex.md",to:".agents/skills/_shared/runtime/execution-protocols/codex.md"},{from:".agents/skills/_shared/execution-protocols/gemini.md",to:".agents/skills/_shared/runtime/execution-protocols/gemini.md"},{from:".agents/skills/_shared/execution-protocols/qwen.md",to:".agents/skills/_shared/runtime/execution-protocols/qwen.md"},{from:".agents/skills/_shared/multi-review-protocol.md",to:".agents/workflows/ultrawork/resources/multi-review-protocol.md"},{from:".agents/skills/_shared/phase-gates.md",to:".agents/workflows/ultrawork/resources/phase-gates.md"}],Ow=[".agents/skills/_shared/api-contracts",".agents/skills/_shared/execution-protocols"];function Tw($,I){let _=I.replace(/^\.agents\//,"");return hI($,".agents",".migration-backup","shared-layout-v2",_)}function Bw($){return hI(".agents",".migration-backup","shared-layout-v2",$.replace(/^\.agents\//,""))}var vY={name:"002-shared-layout",up($){let I=[];for(let _ of Yw){let u=hI($,_.from),U=hI($,_.to);if(!IX(u))continue;if(!IX(U)){qY(QY(U),{recursive:!0}),vw(u,U),I.push(`${_.from} → ${_.to}`);continue}let z=XY(u,"utf-8"),g=XY(U,"utf-8");if(z!==g){let J=Tw($,_.from),G=Bw(_.from);qY(QY(J),{recursive:!0}),Hw(J,z,"utf-8"),I.push(`${_.from} → ${G} (backup)`)}NY(u,{force:!0}),I.push(`${_.from} (removed legacy path)`)}for(let _ of Ow){let u=hI($,_);if(!IX(u))continue;try{if(Qw(u).length===0)NY(u,{recursive:!0,force:!0}),I.push(`${_} (removed empty dir)`)}catch{}}return I}};import{cpSync as Dw,existsSync as UX,readdirSync as Mw,rmSync as HY}from"node:fs";import{join as _X}from"node:path";var YY={name:"003-oma-config",up($){let I=[],_=_X($,".agents","config","user-preferences.yaml"),u=_X($,".agents","oma-config.yaml");if(!UX(u)&&UX(_)){Dw(_,u),HY(_),I.push(".agents/config/user-preferences.yaml → .agents/oma-config.yaml");let U=_X($,".agents","config");if(UX(U)&&Mw(U).length===0)HY(U,{recursive:!0}),I.push(".agents/config/ (removed empty dir)")}return I}};var Kw=[GY,vY,YY];function H1($){let I=[];for(let _ of Kw)I.push(..._.up($));return I}var Rw={en:"English",ko:"한국어",ja:"日本語",zh:"中文",vi:"Tiếng Việt",de:"Deutsch",es:"Español",fr:"Français",nl:"Nederlands",pl:"Polski",pt:"Português",ru:"Русский"};function Lw($){let I=Y1($,"docs"),_=["en"];if(B0(I))for(let u of Vw(I)){let U=u.match(/^README\.(.+)\.md$/);if(U?.[1])_.push(U[1])}return _.map((u)=>({value:u,label:Rw[u]??u}))}function Zw($){let I=Y1($,".agents","oma-config.yaml");if(!B0(I))return null;try{return dI(I,"utf-8").match(/^language:\s*([A-Za-z-]+)/m)?.[1]??null}catch{return null}}async function uX(){console.clear(),B$(D$.default.bgMagenta(D$.default.white(" \uD83D\uDEF8 oh-my-agent ")));let $=H1(process.cwd());if($.length>0)y($.map((T)=>`${D$.default.green("✓")} ${T}`).join(`
|
|
413
|
+
`),"Migration");await z2(process.cwd());let I=$4();I.start("Downloading...");let _,u;try{let T=await N2();_=T.dir,u=T.cleanup}catch(T){I.stop("Download failed"),t.error(T instanceof Error?T.message:String(T)),process.exit(1)}I.stop("Downloaded!");let U=Lw(_),z=Zw(process.cwd()),g=U.some((T)=>T.value===z)?z:"en",J=await F6({message:"Response language?",options:U,initialValue:g});if(_$(J))u(),r$("Cancelled."),process.exit(0);let G=await F6({message:"What type of project?",options:[{value:"all",label:"✨ All",hint:"Install everything"},{value:"fullstack",label:"\uD83C\uDF10 Fullstack",hint:"Frontend + Backend + PM + QA"},{value:"frontend",label:"\uD83C\uDFA8 Frontend",hint:"React/Next.js"},{value:"backend",label:"⚙️ Backend",hint:"Python, Node.js, Rust, ..."},{value:"mobile",label:"\uD83D\uDCF1 Mobile",hint:"Flutter/Dart"},{value:"devops",label:"\uD83D\uDE80 DevOps",hint:"Terraform + CI/CD + Workflows"},{value:"custom",label:"\uD83D\uDD27 Custom",hint:"Choose skills"}]});if(_$(G))r$("Cancelled."),process.exit(0);let q;if(G==="custom"){let T=Q0(),L=await mI({message:"Select skills:",options:T.map((V)=>({value:V.name,label:V.name,hint:V.desc})),required:!0});if(_$(L))r$("Cancelled."),process.exit(0);q=L}else q=AH[G]??[];let N=process.cwd(),X={};if(q.includes("oma-backend")){let T=await F6({message:"Backend language?",options:[{value:"python",label:"\uD83D\uDC0D Python",hint:"FastAPI/SQLAlchemy (default)"},{value:"node",label:"\uD83D\uDFE2 Node.js",hint:"NestJS/Hono + Prisma/Drizzle"},{value:"rust",label:"\uD83E\uDD80 Rust",hint:"Axum/Actix-web"},{value:"other",label:"\uD83D\uDD27 Other / Auto-detect",hint:"Configure later with /stack-set"}],initialValue:"python"});if(_$(T))r$("Cancelled."),process.exit(0);if(T!=="other")X["oma-backend"]=T}let Q=[{value:"claude",label:"Claude Code",hint:"hooks + settings + CLAUDE.md"},{value:"codex",label:"Codex CLI",hint:"hooks + plugin"},{value:"copilot",label:"GitHub Copilot",hint:"skill symlinks"},{value:"gemini",label:"Gemini CLI",hint:"hooks + Serena MCP"},{value:"qwen",label:"Qwen Code",hint:"hooks + settings"}],H=await mI({message:"CLI tools to configure:",options:Q,initialValues:Q.map((T)=>T.value),required:!0});if(_$(H))r$("Cancelled."),process.exit(0);let Y=H,v=Y.filter((T)=>T!=="copilot"),O=[];if(Y.includes("claude"))O.push("claude");if(Y.includes("copilot"))O.push("copilot");I.start("Installing skills...");try{try{su(_,N),jH(_,N),FH(_,N),SH(_,N),wH(_);for(let Z of q)I.message(`Installing ${D$.default.cyan(Z)}...`),eu(_,Z,N,X[Z]);I.stop("Skills installed!"),I.start("Installing vendor adaptations..."),$2(_,N,v),I.stop("Vendor adaptations installed!");let V=Y1(N,".agents","oma-config.yaml");if(B0(V)){let Z=dI(V,"utf-8");H2(V,Z.replace(/^language:\s*.+$/m,`language: ${J}`)),bH(N,Y)}let R=await J2(_);if(R)await G2(N,R);let M=H1(N);if(M.length>0)y(M.map((Z)=>`${D$.default.green("✓")} ${Z}`).join(`
|
|
414
|
+
`),"Migration")}finally{u()}let T=I2(N,O,q);y([...q.map((V)=>`${D$.default.green("✓")} ${V}`),"",D$.default.dim(`Location: ${Y1(N,O4)}`),...T.created.length>0?["",D$.default.cyan("Symlinks:"),...T.created.map((V)=>`${D$.default.green("→")} ${V}`)]:[],...T.skipped.length>0?["",D$.default.dim("Skipped:"),...T.skipped.map((V)=>D$.default.dim(` ${V}`))]:[]].join(`
|
|
415
|
+
`),"Installed");{let V=_Y(q,X["oma-backend"]),{configured:R,registered:M}=X2(N,V);if(R)t.success(D$.default.green(`Serena project configured (${V.join(", ")})`));if(M)t.success(D$.default.green("Project registered in Serena"))}try{U6("git config --get rerere.enabled",{stdio:["pipe","pipe","ignore"]})}catch{try{U6("git config --global rerere.enabled true"),t.success(D$.default.green("git rerere enabled globally!"))}catch{}}let L=process.env.HOME||process.env.USERPROFILE||"";if(Y.includes("claude"))try{U6("claude --version",{stdio:"ignore"});let V=Y1(L,".claude","settings.json"),R={};if(B0(V))R=JSON.parse(dI(V,"utf-8"));if(H0(R))Y0(R),H2(V,`${JSON.stringify(R,null,2)}
|
|
416
|
+
`),t.success(D$.default.green("Claude Code recommended settings applied!"))}catch{}if(Y.includes("codex"))try{if(U6("claude --version",{stdio:"ignore"}),U6("codex --version",{stdio:"ignore"}),!U6("claude plugin list",{encoding:"utf-8",stdio:["pipe","pipe","ignore"]}).includes("codex@openai-codex"))U6("claude plugin marketplace add openai/codex-plugin-cc",{stdio:"ignore"}),U6("claude plugin install codex@openai-codex",{stdio:"ignore"}),t.success(D$.default.green("Codex plugin installed for Claude Code!"))}catch{}if(Y.includes("gemini")){let V=Y1(L,".gemini","antigravity","mcp_config.json");try{if(B0(V)){let M=JSON.parse(dI(V,"utf-8"));if(M?.mcpServers){let Z=M.mcpServers.serena,K="oh-my-agent@latest";if(!(Z?.command==="npx"&&Array.isArray(Z?.args)&&Z.args.includes("oh-my-agent@latest")))M.mcpServers.serena={command:"npx",args:["-y","oh-my-agent@latest","bridge","http://localhost:12341/mcp"],disabled:!1},H2(V,JSON.stringify(M,null,2)),t.success(D$.default.green("Serena MCP bridge configured!"))}}}catch{}let R=Y1(L,".gemini","settings.json");try{if(B0(R)){let M=JSON.parse(dI(R,"utf-8"));if(M?.mcpServers&&M.mcpServers.serena?.url!=="http://localhost:12341/mcp")M.mcpServers.serena={url:"http://localhost:12341/mcp"},H2(R,JSON.stringify(M,null,2)),t.success(D$.default.green("Gemini CLI Serena configured!"))}}catch{}}if(p(D$.default.green("Done! Open your project in your IDE to use the skills.")),q1()&&l4()&&!X1()){let V=await b$({message:`${D$.default.yellow("⭐")} Star ${D$.default.cyan(R$)} on GitHub? It helps a lot!`});if(!_$(V)&&V)try{U6(`gh api -X PUT /user/starred/${R$}`,{stdio:"ignore"}),t.success(`Starred ${D$.default.cyan(R$)}! Thank you! \uD83C\uDF1F`)}catch{t.warn(`Could not star automatically. Try: ${D$.default.dim(`gh api --method PUT /user/starred/${R$}`)}`)}}}catch(T){I.stop("Installation failed"),t.error(T instanceof Error?T.message:String(T)),process.exit(1)}}I4();CI();var _6=v$(P$(),1);async function OY($=!1,I=!1){let _=process.cwd(),u=Sv(_,{force:I});if($){console.log(JSON.stringify(u,null,2));return}console.clear(),B$(_6.default.bgMagenta(_6.default.white(" \uD83E\uDDE0 oh-my-agent memory:init ")));let U=[`Memories dir: ${_6.default.cyan(u.memoriesDir)}`,`Session ID: ${_6.default.cyan(u.sessionId)}`,"",_6.default.bold("Created:"),u.created.length>0?u.created.map((z)=>` + ${z}`).join(`
|
|
417
|
+
`):" (none)","",_6.default.bold("Updated:"),u.updated.length>0?u.updated.map((z)=>` ~ ${z}`).join(`
|
|
418
|
+
`):" (none)","",_6.default.bold("Skipped:"),u.skipped.length>0?u.skipped.map((z)=>` - ${z}`).join(`
|
|
413
419
|
`):" (none)"].join(`
|
|
414
|
-
`);y(U,"Memory Schema"),
|
|
415
|
-
`))if(J.startsWith("COMMIT:")){if(g?.hash)z.push({hash:g.hash,author:g.author||"",email:g.email||"",timestamp:g.timestamp||0,subject:g.subject||"",insertions:g.insertions||0,deletions:g.deletions||0});let G=J.slice(7).split("|");g={hash:G[0],author:G[1],email:G[2],timestamp:parseInt(G[3]||"0",10),subject:G.slice(4).join("|"),insertions:0,deletions:0}}else if(g&&J.trim()){let G=J.match(/(\d+) insertions?\(\+\)/),
|
|
416
|
-
`))if(J.startsWith("COMMIT:"))g=J.slice(7).split("|")[1]||"";else if(J.trim()&&g){let G=J.split("\t");if(G.length>=3){let
|
|
420
|
+
`);y(U,"Memory Schema"),p(_6.default.green("Memory schema ready!"))}I4();var Z$=v$(P$(),1);import{execSync as Ww}from"node:child_process";import{existsSync as TY,mkdirSync as Pw,readdirSync as BY,readFileSync as bw,writeFileSync as Aw}from"node:fs";import{join as zX}from"node:path";function gX($){if(!$)return{since:"7 days ago",label:"7d",days:7};let I=$.match(/^(\d+)(h|d|w)$/);if(!I)throw Error(`Invalid window: ${$}. Use: 24h, 7d, 14d, 30d, 2w`);let _=parseInt(I[1]||"0",10),u=I[2]||"";switch(u){case"h":return{since:`${_} hours ago`,label:`${_}h`,days:_/24};case"d":return{since:`${_} days ago`,label:`${_}d`,days:_};case"w":return{since:`${_*7} days ago`,label:`${_}w`,days:_*7};default:throw Error(`Invalid unit: ${u}`)}}function DY($){let I=gX($);return{current:I,previous:{since:`${I.days*2} days ago`,until:`${I.days} days ago`,label:I.label,days:I.days}}}function E6($,I){try{return Ww(I,{cwd:$,encoding:"utf-8",stdio:["pipe","pipe","ignore"],maxBuffer:10485760}).trim()}catch{return""}}function MY($){E6($,"git fetch origin --quiet 2>/dev/null || true")}function KY($){return E6($,"git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's|refs/remotes/origin/||'")||"main"}function VY($){return E6($,"git config user.name")||"Unknown"}function RY($,I,_){let u=I.until?` --until="${I.until}"`:"",U=E6($,`git log ${_} --since="${I.since}"${u} --format="COMMIT:%H|%aN|%ae|%at|%s" --shortstat`);if(!U)return[];let z=[],g=null;for(let J of U.split(`
|
|
421
|
+
`))if(J.startsWith("COMMIT:")){if(g?.hash)z.push({hash:g.hash,author:g.author||"",email:g.email||"",timestamp:g.timestamp||0,subject:g.subject||"",insertions:g.insertions||0,deletions:g.deletions||0});let G=J.slice(7).split("|");g={hash:G[0],author:G[1],email:G[2],timestamp:parseInt(G[3]||"0",10),subject:G.slice(4).join("|"),insertions:0,deletions:0}}else if(g&&J.trim()){let G=J.match(/(\d+) insertions?\(\+\)/),q=J.match(/(\d+) deletions?\(-\)/);if(G)g.insertions=parseInt(G[1]||"0",10);if(q)g.deletions=parseInt(q[1]||"0",10)}if(g?.hash)z.push({hash:g.hash,author:g.author||"",email:g.email||"",timestamp:g.timestamp||0,subject:g.subject||"",insertions:g.insertions||0,deletions:g.deletions||0});return z}function jw($,I,_){let u=I.until?` --until="${I.until}"`:"",U=E6($,`git log ${_} --since="${I.since}"${u} --format="COMMIT:%H|%aN" --numstat`);if(!U)return[];let z=[],g="";for(let J of U.split(`
|
|
422
|
+
`))if(J.startsWith("COMMIT:"))g=J.slice(7).split("|")[1]||"";else if(J.trim()&&g){let G=J.split("\t");if(G.length>=3){let q=parseInt(G[0]||"0",10),N=parseInt(G[1]||"0",10);if(!Number.isNaN(q)&&!Number.isNaN(N)&&G[2])z.push({file:G[2],insertions:q,deletions:N,author:g})}}return z}function Fw($,I,_,u=10){let U=I.until?` --until="${I.until}"`:"",z=E6($,`git log ${_} --since="${I.since}"${U} --format="" --name-only | grep -v '^$' | sort | uniq -c | sort -rn | head -${u}`);if(!z)return[];return z.split(`
|
|
417
423
|
`).filter(Boolean).map((g)=>{let J=g.trim().match(/^\s*(\d+)\s+(.+)$/);if(!J)return null;return{count:parseInt(J[1]||"0",10),file:J[2]||""}}).filter((g)=>g!==null)}function Sw($,I,_){let u=_?` --author="${_}"`:"",U=E6($,`git log ${I}${u} --format="%ad" --date=format:"%Y-%m-%d" | sort -u`);if(!U)return 0;let z=U.split(`
|
|
418
|
-
`).filter(Boolean).sort().reverse(),g=new Date;g.setHours(0,0,0,0);let J=0,G=new Date(g);for(let
|
|
419
|
-
`):" (no commits)"}function
|
|
420
|
-
`)}function
|
|
421
|
-
`)}function
|
|
422
|
-
`)}function
|
|
423
|
-
`)}function
|
|
424
|
-
`)}function
|
|
425
|
-
`)}function
|
|
424
|
+
`).filter(Boolean).sort().reverse(),g=new Date;g.setHours(0,0,0,0);let J=0,G=new Date(g);for(let q of z){let[N=0,X=0,Q=0]=q.split("-").map(Number),H=new Date(N,X-1,Q);H.setHours(0,0,0,0);let Y=Math.round((G.getTime()-H.getTime())/86400000);if(Y===0)J++,G.setDate(G.getDate()-1);else if(Y===1&&J===0)J++,G.setTime(H.getTime()),G.setDate(G.getDate()-1);else break}return J}function ww($,I,_){let u=I.until?` --until="${I.until}"`:"",U=E6($,`git log ${_} --since="${I.since}"${u} --format="%b" | grep -ci "co-authored-by.*noreply@anthropic\\.com\\|co-authored-by.*copilot\\|co-authored-by.*openai" 2>/dev/null || echo 0`);return parseInt(U||"0",10)}var Ew=/(?:test|spec|__tests__|\.test\.|\.spec\.)/i;function JX($){return Ew.test($)}function LY($,I=45){if($.length===0)return[];let _=[...$].sort((G,q)=>G.timestamp-q.timestamp),u=[],U=_[0]?.timestamp??0,z=_[0]?.timestamp??0,g=1,J=()=>{let G=Math.max(Math.round((z-U)/60),1),q=G>=50?"deep":G>=20?"medium":"micro";u.push({startTime:U,endTime:z,commits:g,type:q,durationMinutes:G})};for(let G=1;G<_.length;G++){let q=_[G]?.timestamp??0;if((q-z)/60>I)J(),U=q,z=q,g=1;else z=q,g++}return J(),u}function ZY($){let I=Array(24).fill(0);for(let _ of $){let u=new Date(_.timestamp*1000).getHours();I[u]=(I[u]||0)+1}return I}function Cw($){let I={},_=/^(feat|fix|docs|style|refactor|test|chore|build|ci|perf)(\(.+\))?!?:/;for(let u of $){let U=u.subject.match(_),z=U?U[1]||"other":"other";I[z]=(I[z]||0)+1}return I}function fw($){let I={};for(let z of $){let g=z.file.split("/")[0]||z.file;I[g]=(I[g]||0)+1}let _=$.length;if(_===0)return{score:0,area:"-"};let U=Object.entries(I).sort(([,z],[,g])=>g-z)[0];if(!U)return{score:0,area:"-"};return{score:Math.round(U[1]/_*100),area:U[0]}}function xw($,I){let _={};for(let z of $){if(!_[z.author])_[z.author]={commits:0,insertions:0,deletions:0,testInsertions:0,topAreas:[],commitTypes:{},peakHour:0};let g=_[z.author];if(!g)continue;g.commits++,g.insertions+=z.insertions,g.deletions+=z.deletions;let J=z.subject.match(/^(feat|fix|docs|style|refactor|test|chore|build|ci|perf)(\(.+\))?!?:/),G=J?J[1]||"other":"other";g.commitTypes[G]=(g.commitTypes[G]||0)+1}let u={},U={};for(let z of I){if(!u[z.author])u[z.author]={};let g=z.file.split("/")[0]||z.file,J=u[z.author];if(J)J[g]=(J[g]||0)+1;let G=_[z.author];if(G&&JX(z.file))G.testInsertions+=z.insertions}for(let z of $){if(!U[z.author])U[z.author]=Array(24).fill(0);let g=new Date(z.timestamp*1000).getHours(),J=U[z.author];if(J)J[g]=(J[g]||0)+1}for(let[z,g]of Object.entries(_)){let J=u[z]||{};g.topAreas=Object.entries(J).sort(([,N],[,X])=>X-N).slice(0,3).map(([N])=>N);let G=U[z]||[],q=Math.max(...G,0);g.peakHour=q>0?G.indexOf(q):0}return _}function WY($){return zX($,".serena","retrospectives")}function GX($,I){let _=WY($);if(!TY(_))Pw(_,{recursive:!0});let u=I.date.split("T")[0]||I.date,U=BY(_).filter((J)=>J.startsWith(u)).length,z=`${u}-${U+1}.json`,g=zX(_,z);return Aw(g,JSON.stringify(I,null,2),"utf-8"),g}function PY($){let I=WY($);if(!TY(I))return null;try{let _=BY(I).filter((z)=>z.endsWith(".json")).sort().reverse();if(_.length===0)return null;let u=bw(zX(I,_[0]||""),"utf-8"),U=JSON.parse(u);if(U.metrics)return U;return null}catch{return null}}function bY($,I,_=30){if(I===0)return"";let u=Math.round($/I*_);return"█".repeat(u)}function kw($,I,_,u=25){let U=_>0?Math.round(I/_*100):0,z=bY(I,_,u);return` ${$.padEnd(12)} ${String(I).padStart(4)} (${String(U).padStart(2)}%) ${z}`}function AY($){let I=Math.max(...$,1),_=[];for(let u=0;u<24;u++){let U=$[u]||0;if(U===0)continue;_.push(` ${String(u).padStart(2)}:00 ${String(U).padStart(3)} ${bY(U,I,20)}`)}return _.length>0?_.join(`
|
|
425
|
+
`):" (no commits)"}function jY($){return[["Commits",String($.commits)],["Contributors",String($.contributors)],["Insertions",`+${$.insertions}`],["Deletions",`-${$.deletions}`],["Net LOC",String($.netLoc)],["Test LOC (ins)",String($.testLoc)],["Test ratio",`${$.testRatio}%`],["Active days",String($.activeDays)],["Sessions",String($.sessions)],["Deep sessions",String($.deepSessions)],["Avg session",`${$.avgSessionMinutes} min`],["LOC/session-hour",String($.locPerSessionHour)],["Peak hour",`${$.peakHour}:00`],["Focus score",`${$.focusScore}% (${$.focusArea})`],["Streak",`${$.streakDays} days`],["AI-assisted",String($.aiAssistedCommits)]].map(([_,u])=>` ${_?.padEnd(20)} ${u}`).join(`
|
|
426
|
+
`)}function FY($,I){let _=Object.entries($).sort(([,J],[,G])=>G.commits-J.commits),u=_.findIndex(([J])=>J===I);if(u>0){let[J]=_.splice(u,1);if(J)_.unshift(J)}let U=` ${"Contributor".padEnd(24)} ${"Commits".padStart(7)} ${"+/-".padStart(14)} Top area`,z=` ${"-".repeat(24)} ${"-".repeat(7)} ${"-".repeat(14)} ${"-".repeat(15)}`,g=_.map(([J,G])=>{let q=J===I?`You (${J})`:J,N=`+${G.insertions}/-${G.deletions}`;return` ${q.padEnd(24)} ${String(G.commits).padStart(7)} ${N.padStart(14)} ${G.topArea}`});return[U,z,...g].join(`
|
|
427
|
+
`)}function qX($,I){let _=$.metrics,u=I.metrics;function U(g,J,G=""){let q=g-J,N=q>0?"↑":q<0?"↓":"→",X=q>0?"+":"";return`${J}${G} → ${g}${G} ${N}${X}${q}${G}`}return[` ${"Metric".padEnd(20)} Change`,` ${"-".repeat(20)} ${"-".repeat(35)}`,` ${"Commits".padEnd(20)} ${U(_.commits,u.commits)}`,` ${"Test ratio".padEnd(20)} ${U(_.testRatio,u.testRatio,"%")}`,` ${"Sessions".padEnd(20)} ${U(_.sessions,u.sessions)}`,` ${"Deep sessions".padEnd(20)} ${U(_.deepSessions,u.deepSessions)}`,` ${"LOC/session-hour".padEnd(20)} ${U(_.locPerSessionHour,u.locPerSessionHour)}`,` ${"Focus score".padEnd(20)} ${U(_.focusScore,u.focusScore,"%")}`,` ${"Streak".padEnd(20)} ${U(_.streakDays,u.streakDays,"d")}`].join(`
|
|
428
|
+
`)}function SY($){let I=$.filter((g)=>g.type==="deep").length,_=$.filter((g)=>g.type==="medium").length,u=$.filter((g)=>g.type==="micro").length,U=$.reduce((g,J)=>g+J.durationMinutes,0),z=$.length>0?Math.round(U/$.length):0;return[` Total sessions: ${$.length}`,` Deep (50+ min): ${I}`,` Medium (20-50): ${_}`,` Micro (<20 min): ${u}`,` Total active time: ${Math.floor(U/60)}h ${U%60}m`,` Avg session: ${z} min`].join(`
|
|
429
|
+
`)}function wY($){if($.length===0)return" (no file changes)";return $.map((I,_)=>{let u=I.count>=5?" [churn]":"",U=JX(I.file)?" [test]":"";return` ${String(_+1).padStart(2)}. ${I.file} (${I.count}x)${U}${u}`}).join(`
|
|
430
|
+
`)}function EY($,I){if(I===0)return" (no commits)";return Object.entries($).sort(([,_],[,u])=>u-_).map(([_,u])=>kw(_,u,I)).join(`
|
|
431
|
+
`)}function CY($){let I=$.metrics;return`${$.date.split("T")[0]||""} (${$.window}): ${I.commits} commits (${I.contributors} contrib), ${I.netLoc>0?"+":""}${I.netLoc} LOC, ${I.testRatio}% tests, peak: ${I.peakHour}:00 | Streak: ${I.streakDays}d`}function Y2($,I){let _=`origin/${KY($)}`,u=RY($,I,_),U=jw($,I,_),z=Fw($,I,_),g=xw(u,U),J=LY(u),G=ZY(u),q=Cw(u),N=fw(U),X=Sw($,_),Q=ww($,I,_),H=0;for(let Z of U)if(JX(Z.file))H+=Z.insertions;let Y=u.reduce((Z,K)=>Z+K.insertions,0),v=u.reduce((Z,K)=>Z+K.deletions,0),O=new Set(u.map((Z)=>new Date(Z.timestamp*1000).toISOString().split("T")[0])).size,T=J.reduce((Z,K)=>Z+K.durationMinutes,0),L=T/60,V=L>0?Math.round((Y+v)/L/50)*50:0,R=G.indexOf(Math.max(...G)),M={};for(let[Z,K]of Object.entries(g)){let D=K.insertions>0?Math.round(K.testInsertions/K.insertions*100):0;M[Z]={commits:K.commits,insertions:K.insertions,deletions:K.deletions,testRatio:D,topArea:K.topAreas[0]||"-"}}return{date:new Date().toISOString(),window:I.label,metrics:{commits:u.length,contributors:Object.keys(g).length,insertions:Y,deletions:v,netLoc:Y-v,testLoc:H,testRatio:Y>0?Math.round(H/Y*100):0,activeDays:O,sessions:J.length,deepSessions:J.filter((Z)=>Z.type==="deep").length,avgSessionMinutes:J.length>0?Math.round(T/J.length):0,locPerSessionHour:V,peakHour:R,focusScore:N.score,focusArea:N.area,streakDays:X,aiAssistedCommits:Q},authors:M,commitTypes:q,hotspots:z}}function XX($,I){let _=`origin/${KY($)}`,u=RY($,I,_);return{sessions:LY(u),hourly:ZY(u)}}function hY($,I,_,u,U){if(console.log(Z$.default.bold(Z$.default.cyan(CY($)))),console.log(),y(jY($.metrics),"Summary"),U)y(qX($,U),"Trends vs Last Retro");if($.metrics.contributors>0)y(FY($.authors,u),"Contributors");if(y(AY(_),"Commit Time Distribution"),I.length>0)y(SY(I),"Work Sessions");if(y(EY($.commitTypes,$.metrics.commits),"Commit Types"),$.hotspots.length>0){let G=$.metrics.commits>0?Math.round(($.commitTypes.fix||0)/$.metrics.commits*100):0,q=wY($.hotspots);if(G>50)q+=`
|
|
426
432
|
|
|
427
|
-
${
|
|
428
|
-
Comparing: ${
|
|
429
|
-
`)),y(
|
|
433
|
+
${Z$.default.yellow(`Fix ratio ${G}% — ship-fast-fix-fast pattern detected`)}`;y(q,"File Hotspots (Top 10)")}let{focusScore:z,focusArea:g}=$.metrics,J=z>=60?Z$.default.green:z>=40?Z$.default.yellow:Z$.default.red;if(y(` ${J(`${z}%`)} — primary area: ${Z$.default.bold(g)}`,"Focus Score"),y(` ${Z$.default.bold(String($.metrics.streakDays))} consecutive days with commits`,"Shipping Streak"),$.metrics.aiAssistedCommits>0){let G=$.metrics.commits>0?Math.round($.metrics.aiAssistedCommits/$.metrics.commits*100):0;y(` ${$.metrics.aiAssistedCommits} commits (${G}%) AI-assisted`,"AI Collaboration")}}async function dY($,I={}){let _=process.cwd();if(I.interactive){let{retro:N}=await Promise.resolve().then(() => (nY(),rY));await N();return}console.clear(),B$(Z$.default.bgMagenta(Z$.default.white(" retro ")));let u=$4();u.start("Fetching origin..."),MY(_),u.stop("Origin fetched");let U=VY(_);if(I.compare){let{current:N,previous:X}=DY($);u.start(`Analyzing current window (${N.label})...`);let Q=Y2(_,N),H=XX(_,N);u.stop("Current window analyzed"),u.start(`Analyzing previous window (${X.label})...`);let Y=Y2(_,X);if(u.stop("Previous window analyzed"),Q.metrics.commits===0&&Y.metrics.commits===0){y(Z$.default.yellow("No commits found in either window."),"Empty"),p(Z$.default.dim("Try a wider window: oma retro compare 30d"));return}if(I.json){console.log(JSON.stringify({current:Q,previous:Y},null,2));return}console.log(Z$.default.bold(`
|
|
434
|
+
Comparing: ${N.label} (current) vs ${X.label} (prior)
|
|
435
|
+
`)),y(qX(Q,Y),"Period Comparison"),console.log(Z$.default.bold(`
|
|
430
436
|
--- Current Period ---
|
|
431
|
-
`)),
|
|
432
|
-
`),"Usage"),
|
|
433
|
-
`);y(
|
|
434
|
-
`);y(
|
|
435
|
-
`),"Migration");if(!I)await
|
|
437
|
+
`)),hY(Q,H.sessions,H.hourly,U,null);let v=GX(_,Q);p(Z$.default.dim(`Snapshot saved: ${v}`));return}let z;try{z=gX($)}catch(N){y(["Usage: oma retro [window]",""," oma retro last 7 days (default)"," oma retro 24h last 24 hours"," oma retro 14d last 14 days"," oma retro 30d last 30 days"," oma retro 2w last 2 weeks"," oma retro --compare compare current vs prior period"," oma retro --compare 14d"].join(`
|
|
438
|
+
`),"Usage"),p(Z$.default.dim(N.message));return}u.start(`Analyzing ${z.label} window...`);let g=Y2(_,z),J=XX(_,z);if(u.stop(`Analysis complete (${g.metrics.commits} commits)`),g.metrics.commits===0){y(Z$.default.yellow("No commits found in this window."),"Empty"),p(Z$.default.dim("Try a wider window: oma retro 30d"));return}if(I.json){console.log(JSON.stringify(g,null,2));return}let G=PY(_);hY(g,J.sessions,J.hourly,U,G);let q=GX(_,g);p(Z$.default.dim(`Snapshot saved: ${q}`))}I4();var C6=v$(P$(),1);import{execSync as dw,spawnSync as cY}from"node:child_process";import{platform as cw}from"node:os";function pw(){let $=cw();if($==="darwin")return"brew install gh";if($==="win32")return"winget install GitHub.cli";return"sudo apt install gh"}async function pY(){if(console.clear(),B$(C6.default.bgMagenta(C6.default.white(" ⭐ oh-my-agent star "))),!q1()){let I=pw(),_=await b$({message:`GitHub CLI (gh) is not installed. Install with ${C6.default.cyan(I)}?`});if(_$(_)||!_){p("Install gh manually and try again.");return}let u=$4();u.start("Installing GitHub CLI...");let U=cY(I,{shell:!0,stdio:"pipe"});if(U.status!==0){u.stop("Installation failed"),t.error(U.stderr?.toString()||"Unknown error"),p("Please install gh manually.");return}u.stop("GitHub CLI installed!")}if(!l4()){t.warn("GitHub CLI is not authenticated.");let I=await b$({message:`Run ${C6.default.cyan("gh auth login")} now?`});if(_$(I)||!I){p("Authenticate and try again.");return}if(cY("gh",["auth","login"],{stdio:"inherit"}),!l4()){p("Authentication was not completed. Try again.");return}t.success("Authenticated!")}if(X1()){p(`Already starred ${C6.default.cyan(R$)}! Thank you! \uD83D\uDE4F`);return}let $=await b$({message:`Star ${C6.default.cyan(R$)} on GitHub?`});if(_$($)||!$){p("Maybe next time!");return}try{dw(`gh api -X PUT /user/starred/${R$}`,{stdio:"ignore"}),p(`Starred ${C6.default.cyan(R$)}! Thank you! \uD83C\uDF1F`)}catch{t.error("Failed to star the repository."),p("Please try again later.")}}I4();QX();CI();var Z4=v$(P$(),1);import{existsSync as T2,mkdirSync as ow,readdirSync as tw,readFileSync as aw,writeFileSync as oY}from"node:fs";import{dirname as ew,join as tY}from"node:path";function OX($){return tY($,".serena","metrics.json")}function YX(){return{sessions:0,skillsUsed:{},tasksCompleted:0,totalSessionTime:0,filesChanged:0,linesAdded:0,linesRemoved:0,lastUpdated:new Date().toISOString(),startDate:new Date().toISOString()}}function sw($){let I=OX($);if(T2(I))try{return JSON.parse(aw(I,"utf-8"))}catch{return YX()}return YX()}function $E($,I){let _=OX($),u=ew(_);if(!T2(u))ow(u,{recursive:!0});I.lastUpdated=new Date().toISOString(),oY(_,JSON.stringify(I,null,2),"utf-8")}function IE($){let I=tY($,".serena","memories"),_={};if(!T2(I))return _;try{let u=tw(I);for(let U of u){let z=U.match(/(?:progress|result)-(\w+)/);if(z?.[1]){let g=z[1];_[g]=(_[g]||0)+1}}}catch{}return _}async function aY($=!1,I=!1){let _=process.cwd(),u=OX(_);if(I){if(T2(u))oY(u,JSON.stringify(YX(),null,2),"utf-8");if($)console.log(JSON.stringify({reset:!0}));else console.log(Z4.default.green("✅ Metrics reset successfully."));return}let U=sw(_),z=O2(_),g=IE(_),J=Av(_),G=Cu(_),q=G.startedAt?new Date(G.startedAt):null,N=q&&!Number.isNaN(q.getTime())?Math.max(0,Math.floor((Date.now()-q.getTime())/1000)):0;for(let[v,O]of Object.entries(g))U.skillsUsed[v]=(U.skillsUsed[v]||0)+O;if(J>U.tasksCompleted)U.tasksCompleted=J;if(G.id){if(["completed","failed","aborted"].includes(G.status||"")&&(U.lastSessionId!==G.id||U.lastSessionStatus!==G.status)&&N>0)U.totalSessionTime+=N;U.lastSessionId=G.id,U.lastSessionStatus=G.status,U.lastSessionStarted=G.startedAt,U.lastSessionDuration=N}U.filesChanged+=z.filesChanged,U.linesAdded+=z.linesAdded,U.linesRemoved+=z.linesRemoved,U.sessions+=1,$E(_,U);let X=Math.max(1,Math.ceil((Date.now()-new Date(U.startDate).getTime())/86400000)),Q=U.sessions>0?Math.round(U.totalSessionTime/U.sessions):0;if($){console.log(JSON.stringify({...U,gitStats:z,daysSinceStart:X,avgSessionTime:Q},null,2));return}console.clear(),B$(Z4.default.bgMagenta(Z4.default.white(" \uD83D\uDCCA oh-my-agent stats ")));let H=[Z4.default.bold(`\uD83D\uDCC8 Productivity Metrics (${X} days)`),"┌─────────────────────┬──────────────┐",`│ ${Z4.default.bold("Metric")} │ ${Z4.default.bold("Value")} │`,"├─────────────────────┼──────────────┤",`│ Sessions │ ${String(U.sessions).padEnd(12)} │`,`│ Tasks Completed │ ${String(U.tasksCompleted).padEnd(12)} │`,`│ Files Changed │ ${String(U.filesChanged).padEnd(12)} │`,`│ Lines Added │ ${Z4.default.green(`+${U.linesAdded}`).padEnd(12)} │`,`│ Lines Removed │ ${Z4.default.red(`-${U.linesRemoved}`).padEnd(12)} │`,"└─────────────────────┴──────────────┘"].join(`
|
|
439
|
+
`);y(H,"Overview");let Y=Object.entries(U.skillsUsed).sort(([,v],[,O])=>O-v).slice(0,5);if(Y.length>0){let v=[Z4.default.bold("\uD83C\uDFC6 Top Skills Used"),...Y.map(([O,T],L)=>` ${L+1}. ${O} (${T})`)].join(`
|
|
440
|
+
`);y(v,"Skills")}p(Z4.default.dim(`Data stored in: ${u}`))}I4();var U4=v$(P$(),1);import{execSync as f6}from"node:child_process";import{cpSync as B2,existsSync as T1,mkdirSync as D2,readFileSync as TX,rmSync as eY,writeFileSync as M2}from"node:fs";import{tmpdir as UE}from"node:os";import{join as c$}from"node:path";function _E($){if(!$)return{intro:(_)=>B$(_),outro:(_)=>p(_),note:(_,u)=>y(_,u),logError:(_)=>t.error(_),spinnerStart:(_)=>{let u=$4();return u.start(_),u}};let I={start(_){},stop(_){if(_)console.log(_)},message(_){console.log(_)}};return{intro:(_)=>console.log(_),outro:(_)=>console.log(_),note:(_,u)=>console.log(_),logError:(_)=>console.error(_),spinnerStart:(_)=>{return console.log(_),I}}}function uE($,I){if($!==null)return"ready";return I?"legacy":"missing"}async function sY($=!1,I=!1){if(!I&&process.stdout.isTTY)console.clear();let _=_E(I);_.intro(U4.default.bgMagenta(U4.default.white(" \uD83D\uDEF8 oh-my-agent update ")));let u=process.cwd(),U=H1(u);if(U.length>0)_.note(U.map((q)=>`${U4.default.green("✓")} ${q}`).join(`
|
|
441
|
+
`),"Migration");if(!I)await z2(u);let z=await J2(u),g=aH(u),J=uE(z,g);if(J==="missing"){if(_.logError("oh-my-agent is not installed in this project. Run `oma install` first."),I)throw Error("oh-my-agent is not installed in this project. Run `oma install` first.");process.exit(1)}if(J==="legacy")_.note("Existing .agents installation detected without _version.json. Updating in place and restoring version metadata.","Legacy install");let G;try{G=_.spinnerStart("Checking for updates...");let q=await eH();if(z===q.version){G.stop(U4.default.green("Already up to date!")),_.outro(`Current version: ${U4.default.cyan(z)}`);return}G.message(`Downloading ${U4.default.cyan(q.version)}...`);let{dir:N,cleanup:X}=await N2();try{G.message("Copying files..."),H1(u);let Q=c$(u,".agents","oma-config.yaml"),H=c$(u,".agents","mcp.json"),Y=!$&&T1(Q)?TX(Q):null,v=!$&&T1(H)?TX(H):null,O=c$(UE(),`oma-stack-backup-${Date.now()}`),T=c$(u,".agents","skills","oma-backend","stack"),L=!$&&T1(T);if(L)D2(O,{recursive:!0}),B2(T,c$(O,"oma-backend"),{recursive:!0});let V=["snippets.md","tech-stack.md","api-template.py"],R=c$(u,".agents","skills","oma-backend","resources"),M=!$&&!L&&V.some((P)=>T1(c$(R,P)));if(B2(c$(N,".agents"),c$(u,".agents"),{recursive:!0,force:!0}),Y)M2(Q,Y);if(v)M2(H,v);if(L)try{D2(T,{recursive:!0}),B2(c$(O,"oma-backend"),T,{recursive:!0,force:!0})}finally{eY(O,{recursive:!0,force:!0})}if(M){let P=c$(N,".agents","skills","oma-backend","variants","python");if(T1(P))D2(T,{recursive:!0}),B2(P,T,{recursive:!0,force:!0}),M2(c$(T,"stack.yaml"),`language: python
|
|
436
442
|
framework: fastapi
|
|
437
443
|
orm: sqlalchemy
|
|
438
444
|
source: migrated
|
|
439
|
-
`)}let Z=
|
|
440
|
-
`),"Migration");await
|
|
441
|
-
`)}
|
|
442
|
-
`),"Symlinks updated")}}if(_.outro(`${
|
|
443
|
-
`)}function zE($){console.clear(),
|
|
444
|
-
`),"Account"),$.promptCredits||$.flowCredits){let _=[];if($.promptCredits)_.push(
|
|
445
|
-
`),"Credits")}if($.models.length===0)y(
|
|
446
|
-
`),`Models (${$.models.length})`)}
|
|
447
|
-
`),"Connection Failed"),process.exit(1);zE(U);return}let _=await
|
|
448
|
-
`).filter(Boolean),G=[];for(let
|
|
449
|
-
`);console.log(
|
|
450
|
-
`);for(let
|
|
451
|
-
`)}async function QO($){let I=XO(process.cwd());if($.json){console.log(JSON.stringify(I,null,2));return}console.log(NO(I))}import{existsSync as mf,mkdirSync as nf,readdirSync as _U,readFileSync as hf,statSync as aq}from"node:fs";import{createServer as df}from"node:http";import{basename as iT,join as b4}from"node:path";import{EventEmitter as _C}from"node:events";import{stat as uC,Stats as Oh}from"node:fs";import{readdir as zC,stat as gC}from"node:fs/promises";import*as e from"node:path";import{lstat as YO,readdir as bE,realpath as AE,stat as jE}from"node:fs/promises";import{join as FE,relative as SE,resolve as HO,sep as wE}from"node:path";import{Readable as EE}from"node:stream";var G4={FILE_TYPE:"files",DIR_TYPE:"directories",FILE_DIR_TYPE:"files_directories",EVERYTHING_TYPE:"all"},Lq={root:".",fileFilter:($)=>!0,directoryFilter:($)=>!0,type:G4.FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:4096};Object.freeze(Lq);var DO="READDIRP_RECURSIVE_ERROR",CE=new Set(["ENOENT","EPERM","EACCES","ELOOP",DO]),OO=[G4.DIR_TYPE,G4.EVERYTHING_TYPE,G4.FILE_DIR_TYPE,G4.FILE_TYPE],fE=new Set([G4.DIR_TYPE,G4.EVERYTHING_TYPE,G4.FILE_DIR_TYPE]),xE=new Set([G4.EVERYTHING_TYPE,G4.FILE_DIR_TYPE,G4.FILE_TYPE]),kE=($)=>CE.has($.code),yE=process.platform==="win32",TO=($)=>!0,BO=($)=>{if($===void 0)return TO;if(typeof $==="function")return $;if(typeof $==="string"){let I=$.trim();return(_)=>_.basename===I}if(Array.isArray($)){let I=$.map((_)=>_.trim());return(_)=>I.some((u)=>_.basename===u)}return TO};class Rq extends EE{parents;reading;parent;_stat;_maxDepth;_wantsDir;_wantsFile;_wantsEverything;_root;_isDirent;_statsProp;_rdOptions;_fileFilter;_directoryFilter;constructor($={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:$.highWaterMark});let I={...Lq,...$},{root:_,type:u}=I;this._fileFilter=BO(I.fileFilter),this._directoryFilter=BO(I.directoryFilter);let U=I.lstat?YO:jE;if(yE)this._stat=(z)=>U(z,{bigint:!0});else this._stat=U;this._maxDepth=I.depth!=null&&Number.isSafeInteger(I.depth)?I.depth:Lq.depth,this._wantsDir=u?fE.has(u):!1,this._wantsFile=u?xE.has(u):!1,this._wantsEverything=u===G4.EVERYTHING_TYPE,this._root=HO(_),this._isDirent=!I.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(_,1)],this.reading=!1,this.parent=void 0}async _read($){if(this.reading)return;this.reading=!0;try{while(!this.destroyed&&$>0){let I=this.parent,_=I&&I.files;if(_&&_.length>0){let{path:u,depth:U}=I,z=_.splice(0,$).map((J)=>this._formatEntry(J,u)),g=await Promise.all(z);for(let J of g){if(!J)continue;if(this.destroyed)return;let G=await this._getEntryType(J);if(G==="directory"&&this._directoryFilter(J)){if(U<=this._maxDepth)this.parents.push(this._exploreDir(J.fullPath,U+1));if(this._wantsDir)this.push(J),$--}else if((G==="file"||this._includeAsFile(J))&&this._fileFilter(J)){if(this._wantsFile)this.push(J),$--}}}else{let u=this.parents.pop();if(!u){this.push(null);break}if(this.parent=await u,this.destroyed)return}}}catch(I){this.destroy(I)}finally{this.reading=!1}}async _exploreDir($,I){let _;try{_=await bE($,this._rdOptions)}catch(u){this._onError(u)}return{files:_,depth:I,path:$}}async _formatEntry($,I){let _,u=this._isDirent?$.name:$;try{let U=HO(FE(I,u));_={path:SE(this._root,U),fullPath:U,basename:u},_[this._statsProp]=this._isDirent?$:await this._stat(U)}catch(U){this._onError(U);return}return _}_onError($){if(kE($)&&!this.destroyed)this.emit("warn",$);else this.destroy($)}async _getEntryType($){if(!$&&this._statsProp in $)return"";let I=$[this._statsProp];if(I.isFile())return"file";if(I.isDirectory())return"directory";if(I&&I.isSymbolicLink()){let _=$.fullPath;try{let u=await AE(_),U=await YO(u);if(U.isFile())return"file";if(U.isDirectory()){let z=u.length;if(_.startsWith(u)&&_.substr(z,1)===wE){let g=Error(`Circular symlink detected: "${_}" points to "${u}"`);return g.code=DO,this._onError(g)}return"directory"}}catch(u){return this._onError(u),""}}}_includeAsFile($){let I=$&&$[this._statsProp];return I&&this._wantsEverything&&!I.isDirectory()}}function MO($,I={}){let _=I.entryType||I.type;if(_==="both")_=G4.FILE_DIR_TYPE;if(_)I.type=_;if(!$)throw Error("readdirp: root argument is required. Usage: readdirp(root, options)");else if(typeof $!=="string")throw TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");else if(_&&!OO.includes(_))throw Error(`readdirp: Invalid type passed. Use one of ${OO.join(", ")}`);return I.root=$,new Rq(I)}import{watch as iE,unwatchFile as KO,watchFile as lE}from"node:fs";import{realpath as Zq,lstat as rE,open as mE,stat as LO}from"node:fs/promises";import{type as nE}from"node:os";import*as M$ from"node:path";var hE="data",bq="end",RO="close",bu=()=>{};var Au=process.platform,Aq=Au==="win32",dE=Au==="darwin",cE=Au==="linux",pE=Au==="freebsd",ZO=nE()==="OS400",O$={ALL:"all",READY:"ready",ADD:"add",CHANGE:"change",ADD_DIR:"addDir",UNLINK:"unlink",UNLINK_DIR:"unlinkDir",RAW:"raw",ERROR:"error"},W4=O$,oE="watch",tE={lstat:rE,stat:LO},D1="listeners",Zu="errHandlers",M0="rawEmitters",aE=[D1,Zu,M0],eE=new Set(["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),sE=($)=>eE.has(M$.extname($).slice(1).toLowerCase()),Pq=($,I)=>{if($ instanceof Set)$.forEach(I);else I($)},cI=($,I,_)=>{let u=$[I];if(!(u instanceof Set))$[I]=u=new Set([u]);u.add(_)},$C=($)=>(I)=>{let _=$[I];if(_ instanceof Set)_.clear();else delete $[I]},pI=($,I,_)=>{let u=$[I];if(u instanceof Set)u.delete(_);else if(u===_)delete $[I]},WO=($)=>$ instanceof Set?$.size===0:!$,Wu=new Map;function VO($,I,_,u,U){let z=(g,J)=>{if(_($),U(g,J,{watchedPath:$}),J&&$!==J)Pu(M$.resolve($,J),D1,M$.join($,J))};try{return iE($,{persistent:I.persistent},z)}catch(g){u(g);return}}var Pu=($,I,_,u,U)=>{let z=Wu.get($);if(!z)return;Pq(z[I],(g)=>{g(_,u,U)})},IC=($,I,_,u)=>{let{listener:U,errHandler:z,rawEmitter:g}=u,J=Wu.get(I),G;if(!_.persistent){if(G=VO($,_,U,z,g),!G)return;return G.close.bind(G)}if(J)cI(J,D1,U),cI(J,Zu,z),cI(J,M0,g);else{if(G=VO($,_,Pu.bind(null,I,D1),z,Pu.bind(null,I,M0)),!G)return;G.on(W4.ERROR,async(v)=>{let X=Pu.bind(null,I,Zu);if(J)J.watcherUnusable=!0;if(Aq&&v.code==="EPERM")try{await(await mE($,"r")).close(),X(v)}catch(q){}else X(v)}),J={listeners:U,errHandlers:z,rawEmitters:g,watcher:G},Wu.set(I,J)}return()=>{if(pI(J,D1,U),pI(J,Zu,z),pI(J,M0,g),WO(J.listeners))J.watcher.close(),Wu.delete(I),aE.forEach($C(J)),J.watcher=void 0,Object.freeze(J)}},Wq=new Map,UC=($,I,_,u)=>{let{listener:U,rawEmitter:z}=u,g=Wq.get(I),J=g&&g.options;if(J&&(J.persistent<_.persistent||J.interval>_.interval))KO(I),g=void 0;if(g)cI(g,D1,U),cI(g,M0,z);else g={listeners:U,rawEmitters:z,options:_,watcher:lE(I,_,(G,v)=>{Pq(g.rawEmitters,(q)=>{q(W4.CHANGE,I,{curr:G,prev:v})});let X=G.mtimeMs;if(G.size!==v.size||X>v.mtimeMs||X===0)Pq(g.listeners,(q)=>q($,G))})},Wq.set(I,g);return()=>{if(pI(g,D1,U),pI(g,M0,z),WO(g.listeners))Wq.delete(I),KO(I),g.options=g.watcher=void 0,Object.freeze(g)}};class jq{fsw;_boundHandleError;constructor($){this.fsw=$,this._boundHandleError=(I)=>$._handleError(I)}_watchWithNodeFs($,I){let _=this.fsw.options,u=M$.dirname($),U=M$.basename($);this.fsw._getWatchedDir(u).add(U);let g=M$.resolve($),J={persistent:_.persistent};if(!I)I=bu;let G;if(_.usePolling){let v=_.interval!==_.binaryInterval;J.interval=v&&sE(U)?_.binaryInterval:_.interval,G=UC($,g,J,{listener:I,rawEmitter:this.fsw._emitRaw})}else G=IC($,g,J,{listener:I,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw});return G}_handleFile($,I,_){if(this.fsw.closed)return;let u=M$.dirname($),U=M$.basename($),z=this.fsw._getWatchedDir(u),g=I;if(z.has(U))return;let J=async(v,X)=>{if(!this.fsw._throttle(oE,$,5))return;if(!X||X.mtimeMs===0)try{let q=await LO($);if(this.fsw.closed)return;let{atimeMs:N,mtimeMs:Y}=q;if(!N||N<=Y||Y!==g.mtimeMs)this.fsw._emit(W4.CHANGE,$,q);if((dE||cE||pE)&&g.ino!==q.ino){this.fsw._closeFile(v),g=q;let H=this._watchWithNodeFs($,J);if(H)this.fsw._addPathCloser(v,H)}else g=q}catch(q){this.fsw._remove(u,U)}else if(z.has(U)){let{atimeMs:q,mtimeMs:N}=X;if(!q||q<=N||N!==g.mtimeMs)this.fsw._emit(W4.CHANGE,$,X);g=X}},G=this._watchWithNodeFs($,J);if(!(_&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored($)){if(!this.fsw._throttle(W4.ADD,$,0))return;this.fsw._emit(W4.ADD,$,I)}return G}async _handleSymlink($,I,_,u){if(this.fsw.closed)return;let U=$.fullPath,z=this.fsw._getWatchedDir(I);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let g;try{g=await Zq(_)}catch(J){return this.fsw._emitReady(),!0}if(this.fsw.closed)return;if(z.has(u)){if(this.fsw._symlinkPaths.get(U)!==g)this.fsw._symlinkPaths.set(U,g),this.fsw._emit(W4.CHANGE,_,$.stats)}else z.add(u),this.fsw._symlinkPaths.set(U,g),this.fsw._emit(W4.ADD,_,$.stats);return this.fsw._emitReady(),!0}if(this.fsw._symlinkPaths.has(U))return!0;this.fsw._symlinkPaths.set(U,!0)}_handleRead($,I,_,u,U,z,g){$=M$.join($,"");let J=u?`${$}:${u}`:$;if(g=this.fsw._throttle("readdir",J,1000),!g)return;let G=this.fsw._getWatchedDir(_.path),v=new Set,X=this.fsw._readdirp($,{fileFilter:(q)=>_.filterPath(q),directoryFilter:(q)=>_.filterDir(q)});if(!X)return;return X.on(hE,async(q)=>{if(this.fsw.closed){X=void 0;return}let N=q.path,Y=M$.join($,N);if(v.add(N),q.stats.isSymbolicLink()&&await this._handleSymlink(q,$,Y,N))return;if(this.fsw.closed){X=void 0;return}if(N===u||!u&&!G.has(N))this.fsw._incrReadyCount(),Y=M$.join(U,M$.relative(U,Y)),this._addToNodeFs(Y,I,_,z+1)}).on(W4.ERROR,this._boundHandleError),new Promise((q,N)=>{if(!X)return N();X.once(bq,()=>{if(this.fsw.closed){X=void 0;return}let Y=g?g.clear():!1;if(q(void 0),G.getChildren().filter((H)=>{return H!==$&&!v.has(H)}).forEach((H)=>{this.fsw._remove($,H)}),X=void 0,Y)this._handleRead($,!1,_,u,U,z,g)})})}async _handleDir($,I,_,u,U,z,g){let J=this.fsw._getWatchedDir(M$.dirname($)),G=J.has(M$.basename($));if(!(_&&this.fsw.options.ignoreInitial)&&!U&&!G)this.fsw._emit(W4.ADD_DIR,$,I);J.add(M$.basename($)),this.fsw._getWatchedDir($);let v,X,q=this.fsw.options.depth;if((q==null||u<=q)&&!this.fsw._symlinkPaths.has(g)){if(!U){if(await this._handleRead($,_,z,U,$,u,v),this.fsw.closed)return}X=this._watchWithNodeFs($,(N,Y)=>{if(Y&&Y.mtimeMs===0)return;this._handleRead(N,!1,z,U,$,u,v)})}return X}async _addToNodeFs($,I,_,u,U){let z=this.fsw._emitReady;if(this.fsw._isIgnored($)||this.fsw.closed)return z(),!1;let g=this.fsw._getWatchHelpers($);if(_)g.filterPath=(J)=>_.filterPath(J),g.filterDir=(J)=>_.filterDir(J);try{let J=await tE[g.statMethod](g.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(g.watchPath,J))return z(),!1;let G=this.fsw.options.followSymlinks,v;if(J.isDirectory()){let X=M$.resolve($),q=G?await Zq($):$;if(this.fsw.closed)return;if(v=await this._handleDir(g.watchPath,J,I,u,U,g,q),this.fsw.closed)return;if(X!==q&&q!==void 0)this.fsw._symlinkPaths.set(X,q)}else if(J.isSymbolicLink()){let X=G?await Zq($):$;if(this.fsw.closed)return;let q=M$.dirname(g.watchPath);if(this.fsw._getWatchedDir(q).add(g.watchPath),this.fsw._emit(W4.ADD,g.watchPath,J),v=await this._handleDir(q,J,I,u,$,g,X),this.fsw.closed)return;if(X!==void 0)this.fsw._symlinkPaths.set(M$.resolve($),X)}else v=this._handleFile(g.watchPath,J,I);if(z(),v)this.fsw._addPathCloser($,v);return!1}catch(J){if(this.fsw._handleError(J))return z(),$}}}/*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */var Fq="/",JC="//",FO=".",GC="..",vC="string",qC=/\\/g,SO=/\/\//g,XC=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,NC=/^\.[/\\]/;function ju($){return Array.isArray($)?$:[$]}var Sq=($)=>typeof $==="object"&&$!==null&&!($ instanceof RegExp);function QC($){if(typeof $==="function")return $;if(typeof $==="string")return(I)=>$===I;if($ instanceof RegExp)return(I)=>$.test(I);if(typeof $==="object"&&$!==null)return(I)=>{if($.path===I)return!0;if($.recursive){let _=e.relative($.path,I);if(!_)return!1;return!_.startsWith("..")&&!e.isAbsolute(_)}return!1};return()=>!1}function YC($){if(typeof $!=="string")throw Error("string expected");$=e.normalize($),$=$.replace(/\\/g,"/");let I=!1;if($.startsWith("//"))I=!0;if($=$.replace(SO,"/"),I)$="/"+$;return $}function PO($,I,_){let u=YC(I);for(let U=0;U<$.length;U++){let z=$[U];if(z(u,_))return!0}return!1}function HC($,I){if($==null)throw TypeError("anymatch: specify first argument");let u=ju($).map((U)=>QC(U));if(I==null)return(U,z)=>{return PO(u,U,z)};return PO(u,I)}var bO=($)=>{let I=ju($).flat();if(!I.every((_)=>typeof _===vC))throw TypeError(`Non-string provided as watch path: ${I}`);return I.map(wO)},AO=($)=>{let I=$.replace(qC,Fq),_=!1;if(I.startsWith(JC))_=!0;if(I=I.replace(SO,Fq),_)I=Fq+I;return I},wO=($)=>AO(e.normalize(AO($))),jO=($="")=>(I)=>{if(typeof I==="string")return wO(e.isAbsolute(I)?I:e.join($,I));else return I},OC=($,I)=>{if(e.isAbsolute($))return $;return e.join(I,$)},TC=Object.freeze(new Set);class EO{path;_removeWatcher;items;constructor($,I){this.path=$,this._removeWatcher=I,this.items=new Set}add($){let{items:I}=this;if(!I)return;if($!==FO&&$!==GC)I.add($)}async remove($){let{items:I}=this;if(!I)return;if(I.delete($),I.size>0)return;let _=this.path;try{await zC(_)}catch(u){if(this._removeWatcher)this._removeWatcher(e.dirname(_),e.basename(_))}}has($){let{items:I}=this;if(!I)return;return I.has($)}getChildren(){let{items:$}=this;if(!$)return[];return[...$.values()]}dispose(){this.items.clear(),this.path="",this._removeWatcher=bu,this.items=TC,Object.freeze(this)}}var BC="stat",DC="lstat";class CO{fsw;path;watchPath;fullWatchPath;dirParts;followSymlinks;statMethod;constructor($,I,_){this.fsw=_;let u=$;this.path=$=$.replace(NC,""),this.watchPath=u,this.fullWatchPath=e.resolve(u),this.dirParts=[],this.dirParts.forEach((U)=>{if(U.length>1)U.pop()}),this.followSymlinks=I,this.statMethod=I?BC:DC}entryPath($){return e.join(this.watchPath,e.relative(this.watchPath,$.fullPath))}filterPath($){let{stats:I}=$;if(I&&I.isSymbolicLink())return this.filterDir($);let _=this.entryPath($);return this.fsw._isntIgnored(_,I)&&this.fsw._hasReadPermissions(I)}filterDir($){return this.fsw._isntIgnored(this.entryPath($),$.stats)}}class fO extends _C{closed;options;_closers;_ignoredPaths;_throttled;_streams;_symlinkPaths;_watched;_pendingWrites;_pendingUnlinks;_readyCount;_emitReady;_closePromise;_userIgnored;_readyEmitted;_emitRaw;_boundRemove;_nodeFsHandler;constructor($={}){super();this.closed=!1,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._streams=new Set,this._symlinkPaths=new Map,this._watched=new Map,this._pendingWrites=new Map,this._pendingUnlinks=new Map,this._readyCount=0,this._readyEmitted=!1;let I=$.awaitWriteFinish,_={stabilityThreshold:2000,pollInterval:100},u={persistent:!0,ignoreInitial:!1,ignorePermissionErrors:!1,interval:100,binaryInterval:300,followSymlinks:!0,usePolling:!1,atomic:!0,...$,ignored:$.ignored?ju($.ignored):ju([]),awaitWriteFinish:I===!0?_:typeof I==="object"?{..._,...I}:!1};if(ZO)u.usePolling=!0;if(u.atomic===void 0)u.atomic=!u.usePolling;let U=process.env.CHOKIDAR_USEPOLLING;if(U!==void 0){let J=U.toLowerCase();if(J==="false"||J==="0")u.usePolling=!1;else if(J==="true"||J==="1")u.usePolling=!0;else u.usePolling=!!J}let z=process.env.CHOKIDAR_INTERVAL;if(z)u.interval=Number.parseInt(z,10);let g=0;this._emitReady=()=>{if(g++,g>=this._readyCount)this._emitReady=bu,this._readyEmitted=!0,process.nextTick(()=>this.emit(O$.READY))},this._emitRaw=(...J)=>this.emit(O$.RAW,...J),this._boundRemove=this._remove.bind(this),this.options=u,this._nodeFsHandler=new jq(this),Object.freeze(u)}_addIgnoredPath($){if(Sq($)){for(let I of this._ignoredPaths)if(Sq(I)&&I.path===$.path&&I.recursive===$.recursive)return}this._ignoredPaths.add($)}_removeIgnoredPath($){if(this._ignoredPaths.delete($),typeof $==="string"){for(let I of this._ignoredPaths)if(Sq(I)&&I.path===$)this._ignoredPaths.delete(I)}}add($,I,_){let{cwd:u}=this.options;this.closed=!1,this._closePromise=void 0;let U=bO($);if(u)U=U.map((z)=>{return OC(z,u)});if(U.forEach((z)=>{this._removeIgnoredPath(z)}),this._userIgnored=void 0,!this._readyCount)this._readyCount=0;return this._readyCount+=U.length,Promise.all(U.map(async(z)=>{let g=await this._nodeFsHandler._addToNodeFs(z,!_,void 0,0,I);if(g)this._emitReady();return g})).then((z)=>{if(this.closed)return;z.forEach((g)=>{if(g)this.add(e.dirname(g),e.basename(I||g))})}),this}unwatch($){if(this.closed)return this;let I=bO($),{cwd:_}=this.options;return I.forEach((u)=>{if(!e.isAbsolute(u)&&!this._closers.has(u)){if(_)u=e.join(_,u);u=e.resolve(u)}if(this._closePath(u),this._addIgnoredPath(u),this._watched.has(u))this._addIgnoredPath({path:u,recursive:!0});this._userIgnored=void 0}),this}close(){if(this._closePromise)return this._closePromise;this.closed=!0,this.removeAllListeners();let $=[];return this._closers.forEach((I)=>I.forEach((_)=>{let u=_();if(u instanceof Promise)$.push(u)})),this._streams.forEach((I)=>I.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach((I)=>I.dispose()),this._closers.clear(),this._watched.clear(),this._streams.clear(),this._symlinkPaths.clear(),this._throttled.clear(),this._closePromise=$.length?Promise.all($).then(()=>{return}):Promise.resolve(),this._closePromise}getWatched(){let $={};return this._watched.forEach((I,_)=>{let U=(this.options.cwd?e.relative(this.options.cwd,_):_)||FO;$[U]=I.getChildren().sort()}),$}emitWithAll($,I){if(this.emit($,...I),$!==O$.ERROR)this.emit(O$.ALL,$,...I)}async _emit($,I,_){if(this.closed)return;let u=this.options;if(Aq)I=e.normalize(I);if(u.cwd)I=e.relative(u.cwd,I);let U=[I];if(_!=null)U.push(_);let z=u.awaitWriteFinish,g;if(z&&(g=this._pendingWrites.get(I)))return g.lastChange=new Date,this;if(u.atomic){if($===O$.UNLINK)return this._pendingUnlinks.set(I,[$,...U]),setTimeout(()=>{this._pendingUnlinks.forEach((J,G)=>{this.emit(...J),this.emit(O$.ALL,...J),this._pendingUnlinks.delete(G)})},typeof u.atomic==="number"?u.atomic:100),this;if($===O$.ADD&&this._pendingUnlinks.has(I))$=O$.CHANGE,this._pendingUnlinks.delete(I)}if(z&&($===O$.ADD||$===O$.CHANGE)&&this._readyEmitted){let J=(G,v)=>{if(G)$=O$.ERROR,U[0]=G,this.emitWithAll($,U);else if(v){if(U.length>1)U[1]=v;else U.push(v);this.emitWithAll($,U)}};return this._awaitWriteFinish(I,z.stabilityThreshold,$,J),this}if($===O$.CHANGE){if(!this._throttle(O$.CHANGE,I,50))return this}if(u.alwaysStat&&_===void 0&&($===O$.ADD||$===O$.ADD_DIR||$===O$.CHANGE)){let J=u.cwd?e.join(u.cwd,I):I,G;try{G=await gC(J)}catch(v){}if(!G||this.closed)return;U.push(G)}return this.emitWithAll($,U),this}_handleError($){let I=$&&$.code;if($&&I!=="ENOENT"&&I!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||I!=="EPERM"&&I!=="EACCES"))this.emit(O$.ERROR,$);return $||this.closed}_throttle($,I,_){if(!this._throttled.has($))this._throttled.set($,new Map);let u=this._throttled.get($);if(!u)throw Error("invalid throttle");let U=u.get(I);if(U)return U.count++,!1;let z,g=()=>{let G=u.get(I),v=G?G.count:0;if(u.delete(I),clearTimeout(z),G)clearTimeout(G.timeoutObject);return v};z=setTimeout(g,_);let J={timeoutObject:z,clear:g,count:0};return u.set(I,J),J}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish($,I,_,u){let U=this.options.awaitWriteFinish;if(typeof U!=="object")return;let z=U.pollInterval,g,J=$;if(this.options.cwd&&!e.isAbsolute($))J=e.join(this.options.cwd,$);let G=new Date,v=this._pendingWrites;function X(q){uC(J,(N,Y)=>{if(N||!v.has($)){if(N&&N.code!=="ENOENT")u(N);return}let H=Number(new Date);if(q&&Y.size!==q.size)v.get($).lastChange=H;let Q=v.get($);if(H-Q.lastChange>=I)v.delete($),u(void 0,Y);else g=setTimeout(X,z,Y)})}if(!v.has($))v.set($,{lastChange:G,cancelWait:()=>{return v.delete($),clearTimeout(g),_}}),g=setTimeout(X,z)}_isIgnored($,I){if(this.options.atomic&&XC.test($))return!0;if(!this._userIgnored){let{cwd:_}=this.options,U=(this.options.ignored||[]).map(jO(_)),g=[...[...this._ignoredPaths].map(jO(_)),...U];this._userIgnored=HC(g,void 0)}return this._userIgnored($,I)}_isntIgnored($,I){return!this._isIgnored($,I)}_getWatchHelpers($){return new CO($,this.options.followSymlinks,this)}_getWatchedDir($){let I=e.resolve($);if(!this._watched.has(I))this._watched.set(I,new EO(I,this._boundRemove));return this._watched.get(I)}_hasReadPermissions($){if(this.options.ignorePermissionErrors)return!0;return Boolean(Number($.mode)&256)}_remove($,I,_){let u=e.join($,I),U=e.resolve(u);if(_=_!=null?_:this._watched.has(u)||this._watched.has(U),!this._throttle("remove",u,100))return;if(!_&&this._watched.size===1)this.add($,I,!0);this._getWatchedDir(u).getChildren().forEach((q)=>this._remove(u,q));let J=this._getWatchedDir($),G=J.has(I);if(J.remove(I),this._symlinkPaths.has(U))this._symlinkPaths.delete(U);let v=u;if(this.options.cwd)v=e.relative(this.options.cwd,u);if(this.options.awaitWriteFinish&&this._pendingWrites.has(v)){if(this._pendingWrites.get(v).cancelWait()===O$.ADD)return}this._watched.delete(u),this._watched.delete(U);let X=_?O$.UNLINK_DIR:O$.UNLINK;if(G&&!this._isIgnored(u))this._emit(X,u);this._closePath(u)}_closePath($){this._closeFile($);let I=e.dirname($);this._getWatchedDir(I).remove(e.basename($))}_closeFile($){let I=this._closers.get($);if(!I)return;I.forEach((_)=>_()),this._closers.delete($)}_addPathCloser($,I){if(!I)return;let _=this._closers.get($);if(!_)_=[],this._closers.set($,_);_.push(I)}_readdirp($,I){if(this.closed)return;let _={type:O$.ALL,alwaysStat:!0,lstat:!0,...I,depth:0},u=MO($,_);return this._streams.add(u),u.once(RO,()=>{u=void 0}),u.once(bq,()=>{if(u)this._streams.delete(u),u=void 0}),u}}function Fu($,I={}){let _=new fO(I);return _.add($),_}var b0=N$(b$(),1);var yf=N$(FT(),1),lf=N$(kq(),1),rf=N$(iq(),1),cq=N$(ru(),1),pq=N$(kT(),1);var yT=process.env.DASHBOARD_PORT?parseInt(process.env.DASHBOARD_PORT||"9847",10):9847;function cf(){if(process.env.MEMORIES_DIR)return process.env.MEMORIES_DIR;let $=process.argv[3];if($)return b4($,".serena","memories");return b4(process.cwd(),".serena","memories")}function uU($){try{return hf($,"utf-8")}catch{return""}}function pf($){try{let I=_U($);if(I.includes("orchestrator-session.md"))return b4($,"orchestrator-session.md");let _=I.filter((u)=>/^session-.*\.md$/.test(u)).map((u)=>({name:u,mtime:aq(b4($,u)).mtimeMs})).sort((u,U)=>U.mtime-u.mtime);if(_.length>0&&_[0])return b4($,_[0].name)}catch{}return null}function of($){let I=pf($);if(!I)return{id:"N/A",status:"UNKNOWN"};let _=uU(I);if(!_)return{id:"N/A",status:"UNKNOWN"};let u=(_.match(/session-id:\s*(.+)/i)||[])[1]||(_.match(/# Session:\s*(.+)/i)||[])[1]||_.match(/(session-\d{8}-\d{6})/)?.[1]||iT(I,".md")||"N/A",U="UNKNOWN";if(/IN PROGRESS|RUNNING|## Active|\[IN PROGRESS\]/i.test(_))U="RUNNING";else if(/COMPLETED|DONE|## Completed|\[COMPLETED\]/i.test(_))U="COMPLETED";else if(/FAILED|ERROR|## Failed|\[FAILED\]/i.test(_))U="FAILED";else if(/Step \d+:.*\[/i.test(_))U="RUNNING";return{id:u.trim(),status:U}}function tf($){let I=uU(b4($,"task-board.md"));if(!I)return[];let _=[],u=I.split(`
|
|
452
|
-
`);for(let U of u){if(!U.startsWith("|")||/^\|\s*-+/.test(U))continue;let z=U.split("|").map((J)=>J.trim()).filter(Boolean),g=z[0];if(z.length<2||!g||/^agent$/i.test(g))continue;_.push({agent:z[0]||"",status:z[1]||"pending",task:z[2]||""})}return _}function
|
|
453
|
-
`).map((J)=>J.trim()).filter((J)=>J&&!J.startsWith("---")&&J.length>3),g="";for(let J=z.length-1;J>=0;J--){let G=z[J];if(!G)continue;if(/^\*\*|^#+|^-|^\d+\.|Status|Result|Action|Step/i.test(G)){if(g=G.replace(/^[#*\-\d.]+\s*/,"").replace(/\*\*/g,"").trim(),g.length>5)break}}if(g.length>80)g=`${g.substring(0,77)}...`;return{agent:u,message:g,file:_.name}}).filter((_)=>_.message)}catch{return[]}}function ef($){let I=[],_=new Set;try{let u=_U($).filter((U)=>U.endsWith(".md")&&U!==".gitkeep").map((U)=>({name:U,mtime:
|
|
445
|
+
`)}let Z=c$(u,".agents","skills","oma-backend","variants");if(T1(Z))eY(Z,{recursive:!0,force:!0});let K=H1(u);if(K.length>0)_.note(K.map((P)=>`${U4.default.green("✓")} ${P}`).join(`
|
|
446
|
+
`),"Migration");await G2(u,q.version);let D=PH(u),S=D.filter((P)=>P!=="copilot");$2(N,u,S);{let P=uY(u);X2(u,P)}let C=process.env.HOME||process.env.USERPROFILE||"";if(D.includes("claude"))try{f6("claude --version",{stdio:"ignore"});let P=c$(C,".claude","settings.json"),e={};if(T1(P))e=JSON.parse(TX(P,"utf-8"));if(H0(e))D2(c$(C,".claude"),{recursive:!0}),Y0(e),M2(P,`${JSON.stringify(e,null,2)}
|
|
447
|
+
`)}catch{}if(D.includes("codex"))try{if(f6("claude --version",{stdio:"ignore"}),f6("codex --version",{stdio:"ignore"}),f6("claude plugin list",{encoding:"utf-8",stdio:["pipe","pipe","ignore"]}).includes("codex@openai-codex"))f6("claude plugin update codex@openai-codex",{stdio:"ignore"});else f6("claude plugin marketplace add openai/codex-plugin-cc",{stdio:"ignore"}),f6("claude plugin install codex@openai-codex",{stdio:"ignore"})}catch{}let x=fH(u);if(G.stop(`Updated to version ${U4.default.cyan(q.version)}!`),x.length>0){let P=CH(u);if(P.length>0){let{created:e}=I2(u,x,P);if(e.length>0)_.note(e.map((c)=>`${U4.default.green("→")} ${c}`).join(`
|
|
448
|
+
`),"Symlinks updated")}}if(_.outro(`${q.metadata?.totalFiles??0} files updated successfully`),!I&&q1()&&l4()&&!X1()){let P=await b$({message:`${U4.default.yellow("⭐")} Star ${U4.default.cyan(R$)} on GitHub? It helps a lot!`});if(!_$(P)&&P)try{f6(`gh api -X PUT /user/starred/${R$}`,{stdio:"ignore"}),t.success(`Starred ${U4.default.cyan(R$)}! Thank you! \uD83C\uDF1F`)}catch{t.warn(`Could not star automatically. Try: ${U4.default.dim(`gh api --method PUT /user/starred/${R$}`)}`)}}}finally{X()}}catch(q){if(G?.stop("Update failed"),_.logError(q instanceof Error?q.message:String(q)),I)throw q;process.exit(1)}}I4();var H$=v$(P$(),1);var $O=30;function _O($){let I=Math.round($/100*$O),_=$O-I,u;if($>60)u=H$.default.green;else if($>30)u=H$.default.yellow;else u=H$.default.red;let U=u("█".repeat(I)),z=H$.default.dim("░".repeat(_));return`${U}${z}`}function IO($){let I=$.remainingPercent.toFixed(0).padStart(4),_=_O($.remainingPercent),u=$.supportsImages?H$.default.dim(" img"):"",U=$.label.padEnd(26),z=$.isExhausted?H$.default.red(`resets ${$.timeUntilReset}`):$.timeUntilReset!=="Ready"?H$.default.dim(`resets ${$.timeUntilReset}`):"";return` ${U} ${_} ${I}%${u} ${z}`}function UO($,I){let _=_O(I.remainingPercent),u=I.remainingPercent.toFixed(0).padStart(4),U=`${I.available.toLocaleString()} / ${I.monthly.toLocaleString()}`;return[` ${_} ${u}%`,` ${H$.default.dim(U)}`].join(`
|
|
449
|
+
`)}function zE($){console.clear(),B$(H$.default.bgCyan(H$.default.black(" oh-my-agent usage ")));let I=[`${H$.default.bold("User")} ${$.userName}${$.email?` (${H$.default.dim($.email)})`:""}`,`${H$.default.bold("Plan")} ${$.planName}${$.tierName?` ${H$.default.dim(`(${$.tierName})`)}`:""}`];if($.defaultModel){let _=$.models.find((u)=>u.modelId===$.defaultModel)?.label;if(_)I.push(`${H$.default.bold("Default")} ${_}`)}if(y(I.join(`
|
|
450
|
+
`),"Account"),$.promptCredits||$.flowCredits){let _=[];if($.promptCredits)_.push(H$.default.bold(" Prompt"),UO("Prompt",$.promptCredits));if($.flowCredits){if(_.length>0)_.push("");_.push(H$.default.bold(" Flow"),UO("Flow",$.flowCredits))}y(_.join(`
|
|
451
|
+
`),"Credits")}if($.models.length===0)y(H$.default.dim(" No model quota data available"),"Models");else{let _=[...$.models].sort((g,J)=>g.label.localeCompare(J.label)),u=_.filter((g)=>g.isExhausted),U=_.filter((g)=>!g.isExhausted),z=[];if(U.length>0)for(let g of U)z.push(IO(g));if(u.length>0){if(z.length>0)z.push("");z.push(H$.default.red(" ── Exhausted ──"));for(let g of u)z.push(IO(g))}y(z.join(`
|
|
452
|
+
`),`Models (${$.models.length})`)}p(H$.default.dim(`Updated ${$.timestamp.toLocaleTimeString()}`))}async function uO($=!1,I=!1){if(I){let u=await VH();if(!u)console.error("Failed to connect to Antigravity"),process.exit(1);console.log(JSON.stringify(u,null,2));return}if(!$){let u=$4();u.start("Connecting to Antigravity...");let U=await rI();if(u.stop(U?"Connected":H$.default.red("Failed to connect to Antigravity")),!U)y([`${H$.default.yellow("Antigravity IDE must be running locally.")}`,"",H$.default.dim("Make sure the language_server process is active."),H$.default.dim("Try opening a project in Antigravity first.")].join(`
|
|
453
|
+
`),"Connection Failed"),process.exit(1);zE(U);return}let _=await rI();if(!_)console.log(JSON.stringify({error:"Failed to connect"})),process.exit(1);console.log(JSON.stringify({userName:_.userName,email:_.email,planName:_.planName,tierName:_.tierName||null,promptCredits:_.promptCredits??null,flowCredits:_.flowCredits??null,defaultModel:_.defaultModel,models:[..._.models].sort((u,U)=>u.label.localeCompare(U.label)).map((u)=>({label:u.label,modelId:u.modelId,remainingPercent:u.remainingPercent,isExhausted:u.isExhausted,supportsImages:u.supportsImages,resetTime:u.resetTime?.toISOString()??null,timeUntilReset:u.timeUntilReset})),timestamp:_.timestamp.toISOString()},null,2))}I4();var k$=v$(P$(),1);import{execSync as gE}from"node:child_process";import{existsSync as u6,readdirSync as JE,readFileSync as BX}from"node:fs";import{join as z6}from"node:path";var zO=["backend","frontend","mobile","qa","debug","pm"];function GE($,I){let _=z6($,".serena","memories");if(!u6(_))return null;let u=new RegExp(`^result-${I}(?:-[\\w-]+)?\\.md$`),U=JE(_).filter((z)=>u.test(z)).sort().reverse();if(U.length===0)return null;return z6(_,U[0])}function r($,I,_){return{name:$,status:I,message:_}}function j$($,I){try{return gE($,{encoding:"utf-8",cwd:I,stdio:["pipe","pipe","pipe"]}).trim()}catch{return null}}function qE($,I){let _=z6($,".agents","plan.json");if(!u6(_))return r("Scope Check","skip","No plan.json found");let u;try{u=JSON.parse(BX(_,"utf-8"))}catch{return r("Scope Check","skip","Invalid plan.json")}let U=u.tasks?.filter((q)=>q.agent?.toLowerCase()===I);if(!U||U.length===0)return r("Scope Check","skip","No tasks for this agent");let z=U.flatMap((q)=>q.scope??[]);if(z.length===0)return r("Scope Check","skip","No scope defined in plan");let g=j$("git diff --name-only HEAD 2>/dev/null || git diff --name-only --cached 2>/dev/null",$);if(!g)return r("Scope Check","pass","No files changed");let J=g.split(`
|
|
454
|
+
`).filter(Boolean),G=[];for(let q of J)if(!z.some((X)=>q.startsWith(X)))G.push(q);if(G.length>0)return r("Scope Check","fail",`${G.length} out-of-scope: ${G[0]}${G.length>1?` +${G.length-1}`:""}`);return r("Scope Check","pass",`All ${J.length} files in scope`)}function XE($,I){let _=GE($,I);if(!_)return r("Charter Preflight","skip","Result file not found");let u=BX(_,"utf-8");if(!u.includes("CHARTER_CHECK:"))return r("Charter Preflight","warn","Block missing from result");if(/\{[^}]+\}/.test(u.split("CHARTER_CHECK:")[1]?.split("```")[0]||""))return r("Charter Preflight","warn","Contains unfilled placeholders");return r("Charter Preflight","pass","Properly filled")}function NE($){let I=["*.py","*.ts","*.tsx","*.js","*.dart"],_=`(password|secret|api_key|token)\\s*=\\s*['"][^'"]{8,}`;for(let u of I){let U=j$(`grep -rn --include="${u}" -E "(password|secret|api_key|token)\\s*=\\s*['"][^'"]{8,}" . 2>/dev/null | grep -v test | grep -v example | grep -v node_modules | head -1`,$);if(U)return r("Hardcoded Secrets","fail",`Found in: ${U.split(":")[0]}`)}return r("Hardcoded Secrets","pass","None detected")}function QE($){let I=j$('grep -rn --include="*.py" --include="*.ts" --include="*.tsx" --include="*.js" --include="*.dart" -E "TODO|FIXME|HACK|XXX" . 2>/dev/null | grep -v node_modules | grep -v ".agents/" | wc -l',$),_=Number.parseInt(I||"0",10);if(_>0)return r("TODO/FIXME Comments","warn",`${_} found`);return r("TODO/FIXME Comments","pass","None found")}function vE($){if(!j$("which uv",$))return r("Python Syntax","skip","uv not available");let _=j$('find . -name "*.py" -not -path "*/node_modules/*" -not -path "*/.venv/*" -exec uv run python -m py_compile {} \\; 2>&1 | head -5',$);if(_&&_.length>0)return r("Python Syntax","fail","Syntax errors found");return r("Python Syntax","pass","Valid")}function HE($){if(j$(`grep -rn --include="*.py" -E "f['"].*SELECT|f['"].*INSERT|f['"].*UPDATE|f['"].*DELETE" . 2>/dev/null | grep -v test | grep -v node_modules | head -1`,$))return r("SQL Injection","fail","f-string with SQL keywords detected");return r("SQL Injection","pass","None detected")}function gO($){let I=j$("which uv",$),_=u6(z6($,"pyproject.toml"));if(!I||!_)return r("Python Tests","skip",!I?"uv not available":"pyproject.toml not found");let u=j$("uv run pytest -q --tb=no 2>&1",$);if(u?.includes("passed")||u?.includes("no tests ran"))return r("Python Tests","pass","Tests pass");return r("Python Tests","fail","Tests failing")}function YE($){if(!u6(z6($,"tsconfig.json")))return r("TypeScript","skip","Not configured");let I=j$("npx tsc --noEmit 2>&1",$);if(I===null||I==="")return r("TypeScript","pass","Compilation clean");if(I.includes("error"))return r("TypeScript","fail","Type errors found");return r("TypeScript","pass","Compilation clean")}function OE($){let I=j$(`grep -rn --include="*.tsx" --include="*.jsx" 'style={{' . 2>/dev/null | grep -v node_modules | wc -l`,$),_=Number.parseInt(I||"0",10);if(_>0)return r("Inline Styles","warn",`${_} found (prefer Tailwind)`);return r("Inline Styles","pass","None found")}function TE($){let I=j$(`grep -rn --include="*.ts" --include="*.tsx" ': any' . 2>/dev/null | grep -v node_modules | grep -v ".d.ts" | wc -l`,$),_=Number.parseInt(I||"0",10);if(_>3)return r("Any Types","fail",`${_} found (limit: 3)`);if(_>0)return r("Any Types","warn",`${_} found`);return r("Any Types","pass","None found")}function JO($){if(!u6(z6($,"package.json")))return r("Frontend Tests","skip","No package.json");let I=j$("npx vitest run --reporter=verbose 2>&1",$);if(I?.includes("passed")||I?.includes("✓"))return r("Frontend Tests","pass","Tests pass");return r("Frontend Tests","warn","Tests failed or vitest not configured")}function BE($){if(!j$("which flutter",$)){if(!j$("which dart",$))return r("Flutter/Dart Analysis","skip","Not available");if(j$("dart analyze 2>&1",$)?.includes("No issues found"))return r("Dart Analysis","pass","Clean");return r("Dart Analysis","fail","Issues found")}if(j$("flutter analyze 2>&1",$)?.includes("No issues found"))return r("Flutter Analysis","pass","Clean");return r("Flutter Analysis","fail","Issues found")}function DE($){if(!j$("which flutter",$))return r("Flutter Tests","skip","Flutter not available");if(j$("flutter test 2>&1",$)?.includes("All tests passed"))return r("Flutter Tests","pass","All tests pass");return r("Flutter Tests","fail","Tests failed")}function ME($){let I=z6($,".agents","plan.json");if(!u6(I))return r("PM Plan","warn","plan.json not found");try{return JSON.parse(BX(I,"utf-8")),r("PM Plan","pass","Valid JSON")}catch{return r("PM Plan","fail","Invalid JSON")}}function KE($,I){let _=[];switch($){case"backend":_.push(vE(I)),_.push(HE(I)),_.push(gO(I));break;case"frontend":_.push(YE(I)),_.push(OE(I)),_.push(TE(I)),_.push(JO(I));break;case"mobile":_.push(BE(I)),_.push(DE(I));break;case"qa":_.push(r("QA Report","pass","Verified by self-check.md"));break;case"debug":if(u6(z6(I,"pyproject.toml")))_.push(gO(I));else if(u6(z6(I,"package.json")))_.push(JO(I));else _.push(r("Debug Tests","skip","No test runner detected"));break;case"pm":_.push(ME(I));break}return _}async function GO($,I,_=!1){let u=$.toLowerCase();if(!zO.includes(u)){let Q=`Invalid agent type: ${$}. Valid types: ${zO.join(", ")}`;if(_)console.log(JSON.stringify({ok:!1,error:Q}));else t.error(Q);process.exit(2)}let U=I||process.cwd();if(!u6(U)){let Q=`Workspace not found: ${U}`;if(_)console.log(JSON.stringify({ok:!1,error:Q}));else t.error(Q);process.exit(2)}let z=[];z.push(qE(U,u)),z.push(XE(U,u)),z.push(NE(U)),z.push(QE(U)),z.push(...KE(u,U));let g=z.filter((Q)=>Q.status==="pass").length,J=z.filter((Q)=>Q.status==="fail").length,G=z.filter((Q)=>Q.status==="warn").length,q={ok:J===0,agent:u,workspace:U,checks:z,summary:{passed:g,failed:J,warned:G}};if(_)console.log(JSON.stringify(q,null,2)),process.exit(J>0?1:0);console.clear(),B$(k$.default.bgCyan(k$.default.white(` \uD83D\uDD0D Verify: ${u} agent `))),y(k$.default.dim(U),"Workspace");let N=["┌────────────────────────────┬────────┬─────────────────────────────┐",`│ ${k$.default.bold("Check")} │ ${k$.default.bold("Status")} │ ${k$.default.bold("Details")} │`,"├────────────────────────────┼────────┼─────────────────────────────┤",...z.map((Q)=>{let H;switch(Q.status){case"pass":H=k$.default.green("PASS");break;case"fail":H=k$.default.red("FAIL");break;case"warn":H=k$.default.yellow("WARN");break;default:H=k$.default.dim("SKIP")}let Y=Q.name.padEnd(26),v=H.padEnd(6),O=(Q.message||"-").slice(0,27).padEnd(27);return`│ ${Y} │ ${v} │ ${O} │`}),"└────────────────────────────┴────────┴─────────────────────────────┘"].join(`
|
|
455
|
+
`);console.log(N),console.log();let X=`${k$.default.green(`${g} passed`)}, ${k$.default.red(`${J} failed`)}, ${k$.default.yellow(`${G} warnings`)}`;if(J>0)p(k$.default.red(`❌ Verification failed: ${X}`)),process.exit(1);p(k$.default.green(`✅ Verification passed: ${X}`)),process.exit(0)}var Y$=v$(P$(),1);import{existsSync as VE,readdirSync as qO,readFileSync as RE}from"node:fs";import{join as W4}from"node:path";var XO=Object.fromEntries(Object.entries(Y4).map(([$,I])=>[$,I.map((_)=>_.name)])),LE={"backend-engineer":"oma-backend","frontend-engineer":"oma-frontend","db-engineer":"oma-db","mobile-engineer":"oma-mobile","pm-planner":"oma-pm","qa-reviewer":"oma-qa","debug-investigator":"oma-debug"};function DX($){let I=new Set;for(let _ of $.matchAll(/_shared\/((?:[a-z][a-z0-9_-]*\/)*[a-z][a-z0-9_-]*)(?:\.md)?(?=[`)\s/}]|$)/gi))if(_[1])I.add(_[1]);return[...I]}function K2($){try{return RE($,"utf-8")}catch{return""}}function MX($){try{return qO($).filter((I)=>!I.startsWith("."))}catch{return[]}}function ZE($){try{return qO($,{withFileTypes:!0}).filter((I)=>!I.name.startsWith("."))}catch{return[]}}function NO($,I=""){let _=[];for(let u of ZE($)){let U=I?`${I}/${u.name}`:u.name;if(u.isDirectory()){_.push({path:U,isDirectory:!0}),_.push(...NO(W4($,u.name),U));continue}if(!u.name.endsWith(".md"))continue;_.push({path:U.replace(/\.md$/,""),isDirectory:!1})}return _}function QO($){let I=[{id:"root",label:"oh-my-agent",category:"root"}],_=new Set,u=[];function U(X,Q,H){let Y=`${X}|${Q}`;if(_.has(Y))return;_.add(Y),u.push({from:X,to:Q,type:H})}let z=W4($,".agents","skills");for(let[X,Q]of Object.entries(XO))for(let H of Q){let Y=W4(z,H);if(!VE(Y))continue;let v=`skill:${H}`;I.push({id:v,label:H,category:"skill",group:"Skills",subgroup:X});let O=[K2(W4(Y,"SKILL.md")),K2(W4(Y,"resources","execution-protocol.md"))].join(`
|
|
456
|
+
`);for(let T of DX(O))U(v,`shared:${T}`,"references")}let g=W4($,".agents","workflows");for(let X of MX(g).filter((Q)=>Q.endsWith(".md"))){let Q=X.replace(".md",""),H=`workflow:${Q}`;I.push({id:H,label:Q,category:"workflow",group:"Workflows"});for(let Y of DX(K2(W4(g,X))))U(H,`shared:${Y}`,"references")}let J=W4(z,"_shared");for(let X of NO(J)){let Q=`shared:${X.path}`;if(I.push({id:Q,label:X.path,category:"shared",group:"Shared"}),!X.isDirectory){for(let H of DX(K2(W4(J,`${X.path}.md`))))if(H!==X.path)U(Q,`shared:${H}`,"references")}}let G=W4($,".claude","agents");for(let X of MX(G).filter((Q)=>Q.endsWith(".md"))){let Q=X.replace(".md",""),H=`agent:${Q}`;I.push({id:H,label:Q,category:"agent",group:"Claude Agents"});let Y=LE[Q];if(Y)U(H,`skill:${Y}`,"implements")}let q=W4($,".serena","memories");for(let X of MX(q).filter((Q)=>Q.endsWith(".md")))I.push({id:`memory:${X.replace(".md","")}`,label:X.replace(".md",""),category:"memory",group:"Serena Memories"});let N=new Set(I.map((X)=>X.id));return{nodes:I,edges:u.filter((X)=>N.has(X.from)&&N.has(X.to))}}var WE={root:($)=>Y$.default.bold(Y$.default.white($)),skill:Y$.default.green,workflow:Y$.default.blue,shared:Y$.default.yellow,agent:Y$.default.magenta,memory:Y$.default.cyan};function J4($,I){return(WE[I]??Y$.default.white)($)}function r4(...$){let I=$.sort((U,z)=>U[0]-z[0]),_="",u=0;for(let[U,z,g]of I){if(U>u)_+=" ".repeat(U-u);_+=z,u=U+g}return _}function PE($){let I=[],_=$.nodes.filter((P)=>P.category==="skill").length,u=$.nodes.filter((P)=>P.category==="workflow").length,U=$.nodes.filter((P)=>P.category==="shared").length,z=$.nodes.filter((P)=>P.category==="agent").length,g=$.nodes.filter((P)=>P.category==="memory").length,J=$.edges.filter((P)=>P.from.startsWith("skill:")&&P.to.startsWith("shared:")).length,G=$.edges.filter((P)=>P.from.startsWith("workflow:")&&P.to.startsWith("shared:")).length,q=$.edges.filter((P)=>P.type==="implements").length,N=$.edges.filter((P)=>P.from.startsWith("shared:")&&P.to.startsWith("shared:")).length,X=`Skills (${_})`,Q=`Workflows (${u})`,H=`Shared (${U})`,Y=`Agents (${z})`,v=`Memories (${g})`,O=10,T=29,L=48,V=19;I.push(r4([24,J4("oh-my-agent","root"),11])),I.push(r4([29,"│",1]));let R=Array(49).fill(" ");R[10]="┌",R[29]="┼",R[48]="┐";for(let P=11;P<48;P++)if(P!==29)R[P]="─";I.push(R.join("")),I.push(r4([10,"▼",1],[29,"▼",1],[48,"▼",1])),I.push(r4([10-(X.length>>1),J4(X,"skill"),X.length],[29-(Q.length>>1),J4(Q,"workflow"),Q.length],[48-(v.length>>1),J4(v,"memory"),v.length])),I.push(r4([10,"│",1],[29,"│",1]));let M=`${J} refs`,Z=`${G} refs`;I.push(r4([10-(M.length>>1),Y$.default.dim(M),M.length],[29-(Z.length>>1),Y$.default.dim(Z),Z.length])),I.push(r4([10,"│",1],[29,"│",1]));let K=Array(30).fill(" ");K[10]="└",K[19]="┬",K[29]="┘";for(let P=11;P<29;P++)if(P!==19)K[P]="─";I.push(K.join("")),I.push(r4([19,"▼",1]));let D=19-(H.length>>1),S=r4([D,J4(H,"shared"),H.length]);if(N>0)S+=` ${Y$.default.dim(`◂── ${N} internal`)}`;I.push(S),I.push("");let C=10-(Y.length>>1),x=`──[${q} implements]──▸`;return I.push(r4([C,J4(Y,"agent"),Y.length])+` ${Y$.default.dim(x)} ${J4("Skills","skill")}`),I}function vO($){let I=[];I.push(...PE($)),I.push(""),I.push(Y$.default.dim("─".repeat(56))),I.push("");let _=new Map,u=new Map;for(let X of $.edges){if(!_.has(X.from))_.set(X.from,[]);if(_.get(X.from)?.push(X),X.to.startsWith("shared:"))u.set(X.to,(u.get(X.to)??0)+1)}function U(X){let Q=_.get(X);if(!Q?.length)return"";let H=Q.map((v)=>$.nodes.find((O)=>O.id===v.to)?.label.replace(/\.md$/,"")??v.to.split(":")[1]),Y=H.length>4?`${H.slice(0,3).join(", ")} +${H.length-3}`:H.join(", ");return` ${Y$.default.dim("──▸")} ${Y$.default.dim(Y)}`}let z=$.nodes.filter((X)=>X.category==="skill"),g=Object.keys(XO);I.push(Y$.default.bold(`Skills (${z.length})`));for(let X=0;X<g.length;X++){let Q=g[X],H=z.filter((O)=>O.subgroup===Q);if(!H.length)continue;let Y=X===g.length-1;I.push(`${Y?"└─":"├─"} ${Y$.default.dim(Q)}`);let v=Y?" ":"│ ";for(let O of H){let T=O===H.at(-1)?"└─":"├─";I.push(`${v}${T} ${J4(O.label,"skill")}${U(O.id)}`)}}I.push("");let J=$.nodes.filter((X)=>X.category==="workflow");I.push(Y$.default.bold(`Workflows (${J.length})`));for(let X of J){let Q=X===J.at(-1)?"└─":"├─";I.push(`${Q} ${J4(X.label,"workflow")}${U(X.id)}`)}I.push("");let G=[...$.nodes.filter((X)=>X.category==="shared")].sort((X,Q)=>(u.get(Q.id)??0)-(u.get(X.id)??0));I.push(Y$.default.bold(`Shared (${G.length})`));for(let X of G){let Q=X===G.at(-1)?"└─":"├─",H=u.get(X.id)??0,Y=H>0?Y$.default.dim(` (${H} refs)`):"";I.push(`${Q} ${J4(X.label,"shared")}${Y}${U(X.id)}`)}I.push("");let q=$.nodes.filter((X)=>X.category==="agent");I.push(Y$.default.bold(`Claude Agents (${q.length})`));for(let X of q){let Q=X===q.at(-1)?"└─":"├─",H=$.edges.find((v)=>v.from===X.id&&v.type==="implements"),Y=H?` ${Y$.default.dim("──▸")} ${J4(H.to.split(":")[1]??"","skill")}`:"";I.push(`${Q} ${J4(X.label,"agent")}${Y}`)}I.push("");let N=$.nodes.filter((X)=>X.category==="memory");if(I.push(Y$.default.bold(`Serena Memories (${N.length})`)),!N.length)I.push(`└─ ${Y$.default.dim("(none)")}`);else for(let X of N){let Q=X===N.at(-1)?"└─":"├─";I.push(`${Q} ${J4(X.label,"memory")}`)}return I.join(`
|
|
457
|
+
`)}async function HO($){let I=QO(process.cwd());if($.json){console.log(JSON.stringify(I,null,2));return}console.log(vO(I))}import{existsSync as rf,mkdirSync as nf,readdirSync as _U,readFileSync as hf,statSync as oX}from"node:fs";import{createServer as df}from"node:http";import{basename as lT,join as A4}from"node:path";import{EventEmitter as _C}from"node:events";import{stat as uC,Stats as Oh}from"node:fs";import{readdir as zC,stat as gC}from"node:fs/promises";import*as a from"node:path";import{lstat as YO,readdir as bE,realpath as AE,stat as jE}from"node:fs/promises";import{join as FE,relative as SE,resolve as OO,sep as wE}from"node:path";import{Readable as EE}from"node:stream";var G4={FILE_TYPE:"files",DIR_TYPE:"directories",FILE_DIR_TYPE:"files_directories",EVERYTHING_TYPE:"all"},KX={root:".",fileFilter:($)=>!0,directoryFilter:($)=>!0,type:G4.FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:4096};Object.freeze(KX);var MO="READDIRP_RECURSIVE_ERROR",CE=new Set(["ENOENT","EPERM","EACCES","ELOOP",MO]),TO=[G4.DIR_TYPE,G4.EVERYTHING_TYPE,G4.FILE_DIR_TYPE,G4.FILE_TYPE],fE=new Set([G4.DIR_TYPE,G4.EVERYTHING_TYPE,G4.FILE_DIR_TYPE]),xE=new Set([G4.EVERYTHING_TYPE,G4.FILE_DIR_TYPE,G4.FILE_TYPE]),kE=($)=>CE.has($.code),yE=process.platform==="win32",BO=($)=>!0,DO=($)=>{if($===void 0)return BO;if(typeof $==="function")return $;if(typeof $==="string"){let I=$.trim();return(_)=>_.basename===I}if(Array.isArray($)){let I=$.map((_)=>_.trim());return(_)=>I.some((u)=>_.basename===u)}return BO};class VX extends EE{parents;reading;parent;_stat;_maxDepth;_wantsDir;_wantsFile;_wantsEverything;_root;_isDirent;_statsProp;_rdOptions;_fileFilter;_directoryFilter;constructor($={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:$.highWaterMark});let I={...KX,...$},{root:_,type:u}=I;this._fileFilter=DO(I.fileFilter),this._directoryFilter=DO(I.directoryFilter);let U=I.lstat?YO:jE;if(yE)this._stat=(z)=>U(z,{bigint:!0});else this._stat=U;this._maxDepth=I.depth!=null&&Number.isSafeInteger(I.depth)?I.depth:KX.depth,this._wantsDir=u?fE.has(u):!1,this._wantsFile=u?xE.has(u):!1,this._wantsEverything=u===G4.EVERYTHING_TYPE,this._root=OO(_),this._isDirent=!I.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(_,1)],this.reading=!1,this.parent=void 0}async _read($){if(this.reading)return;this.reading=!0;try{while(!this.destroyed&&$>0){let I=this.parent,_=I&&I.files;if(_&&_.length>0){let{path:u,depth:U}=I,z=_.splice(0,$).map((J)=>this._formatEntry(J,u)),g=await Promise.all(z);for(let J of g){if(!J)continue;if(this.destroyed)return;let G=await this._getEntryType(J);if(G==="directory"&&this._directoryFilter(J)){if(U<=this._maxDepth)this.parents.push(this._exploreDir(J.fullPath,U+1));if(this._wantsDir)this.push(J),$--}else if((G==="file"||this._includeAsFile(J))&&this._fileFilter(J)){if(this._wantsFile)this.push(J),$--}}}else{let u=this.parents.pop();if(!u){this.push(null);break}if(this.parent=await u,this.destroyed)return}}}catch(I){this.destroy(I)}finally{this.reading=!1}}async _exploreDir($,I){let _;try{_=await bE($,this._rdOptions)}catch(u){this._onError(u)}return{files:_,depth:I,path:$}}async _formatEntry($,I){let _,u=this._isDirent?$.name:$;try{let U=OO(FE(I,u));_={path:SE(this._root,U),fullPath:U,basename:u},_[this._statsProp]=this._isDirent?$:await this._stat(U)}catch(U){this._onError(U);return}return _}_onError($){if(kE($)&&!this.destroyed)this.emit("warn",$);else this.destroy($)}async _getEntryType($){if(!$&&this._statsProp in $)return"";let I=$[this._statsProp];if(I.isFile())return"file";if(I.isDirectory())return"directory";if(I&&I.isSymbolicLink()){let _=$.fullPath;try{let u=await AE(_),U=await YO(u);if(U.isFile())return"file";if(U.isDirectory()){let z=u.length;if(_.startsWith(u)&&_.substr(z,1)===wE){let g=Error(`Circular symlink detected: "${_}" points to "${u}"`);return g.code=MO,this._onError(g)}return"directory"}}catch(u){return this._onError(u),""}}}_includeAsFile($){let I=$&&$[this._statsProp];return I&&this._wantsEverything&&!I.isDirectory()}}function KO($,I={}){let _=I.entryType||I.type;if(_==="both")_=G4.FILE_DIR_TYPE;if(_)I.type=_;if(!$)throw Error("readdirp: root argument is required. Usage: readdirp(root, options)");else if(typeof $!=="string")throw TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");else if(_&&!TO.includes(_))throw Error(`readdirp: Invalid type passed. Use one of ${TO.join(", ")}`);return I.root=$,new VX(I)}import{watch as iE,unwatchFile as VO,watchFile as lE}from"node:fs";import{realpath as RX,lstat as mE,open as rE,stat as LO}from"node:fs/promises";import{type as nE}from"node:os";import*as M$ from"node:path";var hE="data",WX="end",ZO="close",Z2=()=>{};var W2=process.platform,PX=W2==="win32",dE=W2==="darwin",cE=W2==="linux",pE=W2==="freebsd",WO=nE()==="OS400",O$={ALL:"all",READY:"ready",ADD:"add",CHANGE:"change",ADD_DIR:"addDir",UNLINK:"unlink",UNLINK_DIR:"unlinkDir",RAW:"raw",ERROR:"error"},P4=O$,oE="watch",tE={lstat:mE,stat:LO},B1="listeners",V2="errHandlers",D0="rawEmitters",aE=[B1,V2,D0],eE=new Set(["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),sE=($)=>eE.has(M$.extname($).slice(1).toLowerCase()),ZX=($,I)=>{if($ instanceof Set)$.forEach(I);else I($)},cI=($,I,_)=>{let u=$[I];if(!(u instanceof Set))$[I]=u=new Set([u]);u.add(_)},$C=($)=>(I)=>{let _=$[I];if(_ instanceof Set)_.clear();else delete $[I]},pI=($,I,_)=>{let u=$[I];if(u instanceof Set)u.delete(_);else if(u===_)delete $[I]},PO=($)=>$ instanceof Set?$.size===0:!$,R2=new Map;function RO($,I,_,u,U){let z=(g,J)=>{if(_($),U(g,J,{watchedPath:$}),J&&$!==J)L2(M$.resolve($,J),B1,M$.join($,J))};try{return iE($,{persistent:I.persistent},z)}catch(g){u(g);return}}var L2=($,I,_,u,U)=>{let z=R2.get($);if(!z)return;ZX(z[I],(g)=>{g(_,u,U)})},IC=($,I,_,u)=>{let{listener:U,errHandler:z,rawEmitter:g}=u,J=R2.get(I),G;if(!_.persistent){if(G=RO($,_,U,z,g),!G)return;return G.close.bind(G)}if(J)cI(J,B1,U),cI(J,V2,z),cI(J,D0,g);else{if(G=RO($,_,L2.bind(null,I,B1),z,L2.bind(null,I,D0)),!G)return;G.on(P4.ERROR,async(q)=>{let N=L2.bind(null,I,V2);if(J)J.watcherUnusable=!0;if(PX&&q.code==="EPERM")try{await(await rE($,"r")).close(),N(q)}catch(X){}else N(q)}),J={listeners:U,errHandlers:z,rawEmitters:g,watcher:G},R2.set(I,J)}return()=>{if(pI(J,B1,U),pI(J,V2,z),pI(J,D0,g),PO(J.listeners))J.watcher.close(),R2.delete(I),aE.forEach($C(J)),J.watcher=void 0,Object.freeze(J)}},LX=new Map,UC=($,I,_,u)=>{let{listener:U,rawEmitter:z}=u,g=LX.get(I),J=g&&g.options;if(J&&(J.persistent<_.persistent||J.interval>_.interval))VO(I),g=void 0;if(g)cI(g,B1,U),cI(g,D0,z);else g={listeners:U,rawEmitters:z,options:_,watcher:lE(I,_,(G,q)=>{ZX(g.rawEmitters,(X)=>{X(P4.CHANGE,I,{curr:G,prev:q})});let N=G.mtimeMs;if(G.size!==q.size||N>q.mtimeMs||N===0)ZX(g.listeners,(X)=>X($,G))})},LX.set(I,g);return()=>{if(pI(g,B1,U),pI(g,D0,z),PO(g.listeners))LX.delete(I),VO(I),g.options=g.watcher=void 0,Object.freeze(g)}};class bX{fsw;_boundHandleError;constructor($){this.fsw=$,this._boundHandleError=(I)=>$._handleError(I)}_watchWithNodeFs($,I){let _=this.fsw.options,u=M$.dirname($),U=M$.basename($);this.fsw._getWatchedDir(u).add(U);let g=M$.resolve($),J={persistent:_.persistent};if(!I)I=Z2;let G;if(_.usePolling){let q=_.interval!==_.binaryInterval;J.interval=q&&sE(U)?_.binaryInterval:_.interval,G=UC($,g,J,{listener:I,rawEmitter:this.fsw._emitRaw})}else G=IC($,g,J,{listener:I,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw});return G}_handleFile($,I,_){if(this.fsw.closed)return;let u=M$.dirname($),U=M$.basename($),z=this.fsw._getWatchedDir(u),g=I;if(z.has(U))return;let J=async(q,N)=>{if(!this.fsw._throttle(oE,$,5))return;if(!N||N.mtimeMs===0)try{let X=await LO($);if(this.fsw.closed)return;let{atimeMs:Q,mtimeMs:H}=X;if(!Q||Q<=H||H!==g.mtimeMs)this.fsw._emit(P4.CHANGE,$,X);if((dE||cE||pE)&&g.ino!==X.ino){this.fsw._closeFile(q),g=X;let Y=this._watchWithNodeFs($,J);if(Y)this.fsw._addPathCloser(q,Y)}else g=X}catch(X){this.fsw._remove(u,U)}else if(z.has(U)){let{atimeMs:X,mtimeMs:Q}=N;if(!X||X<=Q||Q!==g.mtimeMs)this.fsw._emit(P4.CHANGE,$,N);g=N}},G=this._watchWithNodeFs($,J);if(!(_&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored($)){if(!this.fsw._throttle(P4.ADD,$,0))return;this.fsw._emit(P4.ADD,$,I)}return G}async _handleSymlink($,I,_,u){if(this.fsw.closed)return;let U=$.fullPath,z=this.fsw._getWatchedDir(I);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let g;try{g=await RX(_)}catch(J){return this.fsw._emitReady(),!0}if(this.fsw.closed)return;if(z.has(u)){if(this.fsw._symlinkPaths.get(U)!==g)this.fsw._symlinkPaths.set(U,g),this.fsw._emit(P4.CHANGE,_,$.stats)}else z.add(u),this.fsw._symlinkPaths.set(U,g),this.fsw._emit(P4.ADD,_,$.stats);return this.fsw._emitReady(),!0}if(this.fsw._symlinkPaths.has(U))return!0;this.fsw._symlinkPaths.set(U,!0)}_handleRead($,I,_,u,U,z,g){$=M$.join($,"");let J=u?`${$}:${u}`:$;if(g=this.fsw._throttle("readdir",J,1000),!g)return;let G=this.fsw._getWatchedDir(_.path),q=new Set,N=this.fsw._readdirp($,{fileFilter:(X)=>_.filterPath(X),directoryFilter:(X)=>_.filterDir(X)});if(!N)return;return N.on(hE,async(X)=>{if(this.fsw.closed){N=void 0;return}let Q=X.path,H=M$.join($,Q);if(q.add(Q),X.stats.isSymbolicLink()&&await this._handleSymlink(X,$,H,Q))return;if(this.fsw.closed){N=void 0;return}if(Q===u||!u&&!G.has(Q))this.fsw._incrReadyCount(),H=M$.join(U,M$.relative(U,H)),this._addToNodeFs(H,I,_,z+1)}).on(P4.ERROR,this._boundHandleError),new Promise((X,Q)=>{if(!N)return Q();N.once(WX,()=>{if(this.fsw.closed){N=void 0;return}let H=g?g.clear():!1;if(X(void 0),G.getChildren().filter((Y)=>{return Y!==$&&!q.has(Y)}).forEach((Y)=>{this.fsw._remove($,Y)}),N=void 0,H)this._handleRead($,!1,_,u,U,z,g)})})}async _handleDir($,I,_,u,U,z,g){let J=this.fsw._getWatchedDir(M$.dirname($)),G=J.has(M$.basename($));if(!(_&&this.fsw.options.ignoreInitial)&&!U&&!G)this.fsw._emit(P4.ADD_DIR,$,I);J.add(M$.basename($)),this.fsw._getWatchedDir($);let q,N,X=this.fsw.options.depth;if((X==null||u<=X)&&!this.fsw._symlinkPaths.has(g)){if(!U){if(await this._handleRead($,_,z,U,$,u,q),this.fsw.closed)return}N=this._watchWithNodeFs($,(Q,H)=>{if(H&&H.mtimeMs===0)return;this._handleRead(Q,!1,z,U,$,u,q)})}return N}async _addToNodeFs($,I,_,u,U){let z=this.fsw._emitReady;if(this.fsw._isIgnored($)||this.fsw.closed)return z(),!1;let g=this.fsw._getWatchHelpers($);if(_)g.filterPath=(J)=>_.filterPath(J),g.filterDir=(J)=>_.filterDir(J);try{let J=await tE[g.statMethod](g.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(g.watchPath,J))return z(),!1;let G=this.fsw.options.followSymlinks,q;if(J.isDirectory()){let N=M$.resolve($),X=G?await RX($):$;if(this.fsw.closed)return;if(q=await this._handleDir(g.watchPath,J,I,u,U,g,X),this.fsw.closed)return;if(N!==X&&X!==void 0)this.fsw._symlinkPaths.set(N,X)}else if(J.isSymbolicLink()){let N=G?await RX($):$;if(this.fsw.closed)return;let X=M$.dirname(g.watchPath);if(this.fsw._getWatchedDir(X).add(g.watchPath),this.fsw._emit(P4.ADD,g.watchPath,J),q=await this._handleDir(X,J,I,u,$,g,N),this.fsw.closed)return;if(N!==void 0)this.fsw._symlinkPaths.set(M$.resolve($),N)}else q=this._handleFile(g.watchPath,J,I);if(z(),q)this.fsw._addPathCloser($,q);return!1}catch(J){if(this.fsw._handleError(J))return z(),$}}}/*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */var AX="/",JC="//",SO=".",GC="..",qC="string",XC=/\\/g,wO=/\/\//g,NC=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,QC=/^\.[/\\]/;function P2($){return Array.isArray($)?$:[$]}var jX=($)=>typeof $==="object"&&$!==null&&!($ instanceof RegExp);function vC($){if(typeof $==="function")return $;if(typeof $==="string")return(I)=>$===I;if($ instanceof RegExp)return(I)=>$.test(I);if(typeof $==="object"&&$!==null)return(I)=>{if($.path===I)return!0;if($.recursive){let _=a.relative($.path,I);if(!_)return!1;return!_.startsWith("..")&&!a.isAbsolute(_)}return!1};return()=>!1}function HC($){if(typeof $!=="string")throw Error("string expected");$=a.normalize($),$=$.replace(/\\/g,"/");let I=!1;if($.startsWith("//"))I=!0;if($=$.replace(wO,"/"),I)$="/"+$;return $}function bO($,I,_){let u=HC(I);for(let U=0;U<$.length;U++){let z=$[U];if(z(u,_))return!0}return!1}function YC($,I){if($==null)throw TypeError("anymatch: specify first argument");let u=P2($).map((U)=>vC(U));if(I==null)return(U,z)=>{return bO(u,U,z)};return bO(u,I)}var AO=($)=>{let I=P2($).flat();if(!I.every((_)=>typeof _===qC))throw TypeError(`Non-string provided as watch path: ${I}`);return I.map(EO)},jO=($)=>{let I=$.replace(XC,AX),_=!1;if(I.startsWith(JC))_=!0;if(I=I.replace(wO,AX),_)I=AX+I;return I},EO=($)=>jO(a.normalize(jO($))),FO=($="")=>(I)=>{if(typeof I==="string")return EO(a.isAbsolute(I)?I:a.join($,I));else return I},OC=($,I)=>{if(a.isAbsolute($))return $;return a.join(I,$)},TC=Object.freeze(new Set);class CO{path;_removeWatcher;items;constructor($,I){this.path=$,this._removeWatcher=I,this.items=new Set}add($){let{items:I}=this;if(!I)return;if($!==SO&&$!==GC)I.add($)}async remove($){let{items:I}=this;if(!I)return;if(I.delete($),I.size>0)return;let _=this.path;try{await zC(_)}catch(u){if(this._removeWatcher)this._removeWatcher(a.dirname(_),a.basename(_))}}has($){let{items:I}=this;if(!I)return;return I.has($)}getChildren(){let{items:$}=this;if(!$)return[];return[...$.values()]}dispose(){this.items.clear(),this.path="",this._removeWatcher=Z2,this.items=TC,Object.freeze(this)}}var BC="stat",DC="lstat";class fO{fsw;path;watchPath;fullWatchPath;dirParts;followSymlinks;statMethod;constructor($,I,_){this.fsw=_;let u=$;this.path=$=$.replace(QC,""),this.watchPath=u,this.fullWatchPath=a.resolve(u),this.dirParts=[],this.dirParts.forEach((U)=>{if(U.length>1)U.pop()}),this.followSymlinks=I,this.statMethod=I?BC:DC}entryPath($){return a.join(this.watchPath,a.relative(this.watchPath,$.fullPath))}filterPath($){let{stats:I}=$;if(I&&I.isSymbolicLink())return this.filterDir($);let _=this.entryPath($);return this.fsw._isntIgnored(_,I)&&this.fsw._hasReadPermissions(I)}filterDir($){return this.fsw._isntIgnored(this.entryPath($),$.stats)}}class xO extends _C{closed;options;_closers;_ignoredPaths;_throttled;_streams;_symlinkPaths;_watched;_pendingWrites;_pendingUnlinks;_readyCount;_emitReady;_closePromise;_userIgnored;_readyEmitted;_emitRaw;_boundRemove;_nodeFsHandler;constructor($={}){super();this.closed=!1,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._streams=new Set,this._symlinkPaths=new Map,this._watched=new Map,this._pendingWrites=new Map,this._pendingUnlinks=new Map,this._readyCount=0,this._readyEmitted=!1;let I=$.awaitWriteFinish,_={stabilityThreshold:2000,pollInterval:100},u={persistent:!0,ignoreInitial:!1,ignorePermissionErrors:!1,interval:100,binaryInterval:300,followSymlinks:!0,usePolling:!1,atomic:!0,...$,ignored:$.ignored?P2($.ignored):P2([]),awaitWriteFinish:I===!0?_:typeof I==="object"?{..._,...I}:!1};if(WO)u.usePolling=!0;if(u.atomic===void 0)u.atomic=!u.usePolling;let U=process.env.CHOKIDAR_USEPOLLING;if(U!==void 0){let J=U.toLowerCase();if(J==="false"||J==="0")u.usePolling=!1;else if(J==="true"||J==="1")u.usePolling=!0;else u.usePolling=!!J}let z=process.env.CHOKIDAR_INTERVAL;if(z)u.interval=Number.parseInt(z,10);let g=0;this._emitReady=()=>{if(g++,g>=this._readyCount)this._emitReady=Z2,this._readyEmitted=!0,process.nextTick(()=>this.emit(O$.READY))},this._emitRaw=(...J)=>this.emit(O$.RAW,...J),this._boundRemove=this._remove.bind(this),this.options=u,this._nodeFsHandler=new bX(this),Object.freeze(u)}_addIgnoredPath($){if(jX($)){for(let I of this._ignoredPaths)if(jX(I)&&I.path===$.path&&I.recursive===$.recursive)return}this._ignoredPaths.add($)}_removeIgnoredPath($){if(this._ignoredPaths.delete($),typeof $==="string"){for(let I of this._ignoredPaths)if(jX(I)&&I.path===$)this._ignoredPaths.delete(I)}}add($,I,_){let{cwd:u}=this.options;this.closed=!1,this._closePromise=void 0;let U=AO($);if(u)U=U.map((z)=>{return OC(z,u)});if(U.forEach((z)=>{this._removeIgnoredPath(z)}),this._userIgnored=void 0,!this._readyCount)this._readyCount=0;return this._readyCount+=U.length,Promise.all(U.map(async(z)=>{let g=await this._nodeFsHandler._addToNodeFs(z,!_,void 0,0,I);if(g)this._emitReady();return g})).then((z)=>{if(this.closed)return;z.forEach((g)=>{if(g)this.add(a.dirname(g),a.basename(I||g))})}),this}unwatch($){if(this.closed)return this;let I=AO($),{cwd:_}=this.options;return I.forEach((u)=>{if(!a.isAbsolute(u)&&!this._closers.has(u)){if(_)u=a.join(_,u);u=a.resolve(u)}if(this._closePath(u),this._addIgnoredPath(u),this._watched.has(u))this._addIgnoredPath({path:u,recursive:!0});this._userIgnored=void 0}),this}close(){if(this._closePromise)return this._closePromise;this.closed=!0,this.removeAllListeners();let $=[];return this._closers.forEach((I)=>I.forEach((_)=>{let u=_();if(u instanceof Promise)$.push(u)})),this._streams.forEach((I)=>I.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach((I)=>I.dispose()),this._closers.clear(),this._watched.clear(),this._streams.clear(),this._symlinkPaths.clear(),this._throttled.clear(),this._closePromise=$.length?Promise.all($).then(()=>{return}):Promise.resolve(),this._closePromise}getWatched(){let $={};return this._watched.forEach((I,_)=>{let U=(this.options.cwd?a.relative(this.options.cwd,_):_)||SO;$[U]=I.getChildren().sort()}),$}emitWithAll($,I){if(this.emit($,...I),$!==O$.ERROR)this.emit(O$.ALL,$,...I)}async _emit($,I,_){if(this.closed)return;let u=this.options;if(PX)I=a.normalize(I);if(u.cwd)I=a.relative(u.cwd,I);let U=[I];if(_!=null)U.push(_);let z=u.awaitWriteFinish,g;if(z&&(g=this._pendingWrites.get(I)))return g.lastChange=new Date,this;if(u.atomic){if($===O$.UNLINK)return this._pendingUnlinks.set(I,[$,...U]),setTimeout(()=>{this._pendingUnlinks.forEach((J,G)=>{this.emit(...J),this.emit(O$.ALL,...J),this._pendingUnlinks.delete(G)})},typeof u.atomic==="number"?u.atomic:100),this;if($===O$.ADD&&this._pendingUnlinks.has(I))$=O$.CHANGE,this._pendingUnlinks.delete(I)}if(z&&($===O$.ADD||$===O$.CHANGE)&&this._readyEmitted){let J=(G,q)=>{if(G)$=O$.ERROR,U[0]=G,this.emitWithAll($,U);else if(q){if(U.length>1)U[1]=q;else U.push(q);this.emitWithAll($,U)}};return this._awaitWriteFinish(I,z.stabilityThreshold,$,J),this}if($===O$.CHANGE){if(!this._throttle(O$.CHANGE,I,50))return this}if(u.alwaysStat&&_===void 0&&($===O$.ADD||$===O$.ADD_DIR||$===O$.CHANGE)){let J=u.cwd?a.join(u.cwd,I):I,G;try{G=await gC(J)}catch(q){}if(!G||this.closed)return;U.push(G)}return this.emitWithAll($,U),this}_handleError($){let I=$&&$.code;if($&&I!=="ENOENT"&&I!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||I!=="EPERM"&&I!=="EACCES"))this.emit(O$.ERROR,$);return $||this.closed}_throttle($,I,_){if(!this._throttled.has($))this._throttled.set($,new Map);let u=this._throttled.get($);if(!u)throw Error("invalid throttle");let U=u.get(I);if(U)return U.count++,!1;let z,g=()=>{let G=u.get(I),q=G?G.count:0;if(u.delete(I),clearTimeout(z),G)clearTimeout(G.timeoutObject);return q};z=setTimeout(g,_);let J={timeoutObject:z,clear:g,count:0};return u.set(I,J),J}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish($,I,_,u){let U=this.options.awaitWriteFinish;if(typeof U!=="object")return;let z=U.pollInterval,g,J=$;if(this.options.cwd&&!a.isAbsolute($))J=a.join(this.options.cwd,$);let G=new Date,q=this._pendingWrites;function N(X){uC(J,(Q,H)=>{if(Q||!q.has($)){if(Q&&Q.code!=="ENOENT")u(Q);return}let Y=Number(new Date);if(X&&H.size!==X.size)q.get($).lastChange=Y;let v=q.get($);if(Y-v.lastChange>=I)q.delete($),u(void 0,H);else g=setTimeout(N,z,H)})}if(!q.has($))q.set($,{lastChange:G,cancelWait:()=>{return q.delete($),clearTimeout(g),_}}),g=setTimeout(N,z)}_isIgnored($,I){if(this.options.atomic&&NC.test($))return!0;if(!this._userIgnored){let{cwd:_}=this.options,U=(this.options.ignored||[]).map(FO(_)),g=[...[...this._ignoredPaths].map(FO(_)),...U];this._userIgnored=YC(g,void 0)}return this._userIgnored($,I)}_isntIgnored($,I){return!this._isIgnored($,I)}_getWatchHelpers($){return new fO($,this.options.followSymlinks,this)}_getWatchedDir($){let I=a.resolve($);if(!this._watched.has(I))this._watched.set(I,new CO(I,this._boundRemove));return this._watched.get(I)}_hasReadPermissions($){if(this.options.ignorePermissionErrors)return!0;return Boolean(Number($.mode)&256)}_remove($,I,_){let u=a.join($,I),U=a.resolve(u);if(_=_!=null?_:this._watched.has(u)||this._watched.has(U),!this._throttle("remove",u,100))return;if(!_&&this._watched.size===1)this.add($,I,!0);this._getWatchedDir(u).getChildren().forEach((X)=>this._remove(u,X));let J=this._getWatchedDir($),G=J.has(I);if(J.remove(I),this._symlinkPaths.has(U))this._symlinkPaths.delete(U);let q=u;if(this.options.cwd)q=a.relative(this.options.cwd,u);if(this.options.awaitWriteFinish&&this._pendingWrites.has(q)){if(this._pendingWrites.get(q).cancelWait()===O$.ADD)return}this._watched.delete(u),this._watched.delete(U);let N=_?O$.UNLINK_DIR:O$.UNLINK;if(G&&!this._isIgnored(u))this._emit(N,u);this._closePath(u)}_closePath($){this._closeFile($);let I=a.dirname($);this._getWatchedDir(I).remove(a.basename($))}_closeFile($){let I=this._closers.get($);if(!I)return;I.forEach((_)=>_()),this._closers.delete($)}_addPathCloser($,I){if(!I)return;let _=this._closers.get($);if(!_)_=[],this._closers.set($,_);_.push(I)}_readdirp($,I){if(this.closed)return;let _={type:O$.ALL,alwaysStat:!0,lstat:!0,...I,depth:0},u=KO($,_);return this._streams.add(u),u.once(ZO,()=>{u=void 0}),u.once(WX,()=>{if(u)this._streams.delete(u),u=void 0}),u}}function b2($,I={}){let _=new xO(I);return _.add($),_}var P0=v$(P$(),1);var yf=v$(ST(),1),lf=v$(fX(),1),mf=v$(kX(),1),hX=v$(y2(),1),dX=v$(yT(),1);var iT=process.env.DASHBOARD_PORT?parseInt(process.env.DASHBOARD_PORT||"9847",10):9847;function cf(){if(process.env.MEMORIES_DIR)return process.env.MEMORIES_DIR;let $=process.argv[3];if($)return A4($,".serena","memories");return A4(process.cwd(),".serena","memories")}function uU($){try{return hf($,"utf-8")}catch{return""}}function pf($){try{let I=_U($);if(I.includes("orchestrator-session.md"))return A4($,"orchestrator-session.md");let _=I.filter((u)=>/^session-.*\.md$/.test(u)).map((u)=>({name:u,mtime:oX(A4($,u)).mtimeMs})).sort((u,U)=>U.mtime-u.mtime);if(_.length>0&&_[0])return A4($,_[0].name)}catch{}return null}function of($){let I=pf($);if(!I)return{id:"N/A",status:"UNKNOWN"};let _=uU(I);if(!_)return{id:"N/A",status:"UNKNOWN"};let u=(_.match(/session-id:\s*(.+)/i)||[])[1]||(_.match(/# Session:\s*(.+)/i)||[])[1]||_.match(/(session-\d{8}-\d{6})/)?.[1]||lT(I,".md")||"N/A",U="UNKNOWN";if(/IN PROGRESS|RUNNING|## Active|\[IN PROGRESS\]/i.test(_))U="RUNNING";else if(/COMPLETED|DONE|## Completed|\[COMPLETED\]/i.test(_))U="COMPLETED";else if(/FAILED|ERROR|## Failed|\[FAILED\]/i.test(_))U="FAILED";else if(/Step \d+:.*\[/i.test(_))U="RUNNING";return{id:u.trim(),status:U}}function tf($){let I=uU(A4($,"task-board.md"));if(!I)return[];let _=[],u=I.split(`
|
|
458
|
+
`);for(let U of u){if(!U.startsWith("|")||/^\|\s*-+/.test(U))continue;let z=U.split("|").map((J)=>J.trim()).filter(Boolean),g=z[0];if(z.length<2||!g||/^agent$/i.test(g))continue;_.push({agent:z[0]||"",status:z[1]||"pending",task:z[2]||""})}return _}function pX($,I){try{let _=_U($).filter((z)=>z.startsWith(`progress-${I}`)&&z.endsWith(".md")).sort().reverse();if(_.length===0)return null;let U=(_[0]?uU(A4($,_[0])):"").match(/turn[:\s]*(\d+)/i);return U?.[1]?parseInt(U[1],10):null}catch{return null}}function af($){try{return _U($).filter((_)=>_.endsWith(".md")&&_!==".gitkeep").map((_)=>({name:_,mtime:oX(A4($,_)).mtimeMs})).sort((_,u)=>u.mtime-_.mtime).slice(0,5).map((_)=>{let u=_.name.replace(/^(progress|result|session|debug|task)-?/,"").replace(/[-_]agent/,"").replace(/[-_]completion/,"").replace(/\.md$/,"").replace(/[-_]/g," ").trim()||_.name.replace(/\.md$/,""),z=uU(A4($,_.name)).split(`
|
|
459
|
+
`).map((J)=>J.trim()).filter((J)=>J&&!J.startsWith("---")&&J.length>3),g="";for(let J=z.length-1;J>=0;J--){let G=z[J];if(!G)continue;if(/^\*\*|^#+|^-|^\d+\.|Status|Result|Action|Step/i.test(G)){if(g=G.replace(/^[#*\-\d.]+\s*/,"").replace(/\*\*/g,"").trim(),g.length>5)break}}if(g.length>80)g=`${g.substring(0,77)}...`;return{agent:u,message:g,file:_.name}}).filter((_)=>_.message)}catch{return[]}}function ef($){let I=[],_=new Set;try{let u=_U($).filter((U)=>U.endsWith(".md")&&U!==".gitkeep").map((U)=>({name:U,mtime:oX(A4($,U)).mtimeMs})).sort((U,z)=>z.mtime-U.mtime);for(let U of u){let z=uU(A4($,U.name)),g=z.match(/\*\*Agent\*\*:\s*(.+)/i)||z.match(/Agent:\s*(.+)/i)||z.match(/^#+\s*(.+?)\s*Agent/im),J=null;if(g?.[1])J=g[1].trim();else if(/_agent|agent_|-agent/i.test(U.name))J=U.name.replace(/\.md$/,"").replace(/[-_]completion|[-_]progress|[-_]result/gi,"").replace(/[-_]/g," ").trim();if(J&&!_.has(J.toLowerCase())){_.add(J.toLowerCase());let G="unknown";if(/\[COMPLETED\]|## Completed|## Results/i.test(z))G="completed";else if(/\[IN PROGRESS\]|## Progress|IN PROGRESS/i.test(z))G="running";else if(/\[FAILED\]|## Failed|ERROR/i.test(z))G="failed";let q=z.match(/## Task\s*\n+(.+)/i)||z.match(/\*\*Task\*\*:\s*(.+)/i),N=q?.[1]?q[1].trim().substring(0,60):"";I.push({agent:J,status:G,task:N,turn:pX($,J)})}}}catch{}return I}function cX($){let I=of($),u=tf($).map((U)=>({...U,turn:pX($,U.agent)}));if(u.length===0)u=ef($);if(u.length===0)try{let U=_U($).filter((z)=>z.startsWith("progress-")&&z.endsWith(".md"));for(let z of U){let g=z.replace(/^progress-/,"").replace(/\.md$/,"");u.push({agent:g,status:"running",task:"",turn:pX($,g)})}}catch{}return{session:I,agents:u,activity:af($),memoriesDir:$,updatedAt:new Date().toISOString()}}var sf=`<!DOCTYPE html>
|
|
454
460
|
<html lang="en">
|
|
455
461
|
<head>
|
|
456
462
|
<meta charset="UTF-8">
|
|
@@ -507,15 +513,15 @@ source: migrated
|
|
|
507
513
|
fetch('/api/state').then(r=>r.json()).then(renderState).catch(()=>{});connect();
|
|
508
514
|
</script>
|
|
509
515
|
</body>
|
|
510
|
-
</html>`;function
|
|
511
|
-
Shutting down...`),z.close(),_.clients.forEach((g)=>{g.terminate()}),_.close(()=>I.close(()=>process.exit(0))),setTimeout(()=>process.exit(1),3000).unref()}),process.on("SIGTERM",()=>process.emit("SIGINT")),I.listen(
|
|
512
|
-
\uD83D\uDEF8 Serena Memory Dashboard`)),console.log(
|
|
513
|
-
`))})}var rT={name:"oh-my-agent",version:"4.
|
|
514
|
-
`);for(let U of u){if(!U.startsWith("|")||/^\|\s*-+/.test(U))continue;let z=U.split("|").map((
|
|
515
|
-
`).map((G)=>G.trim()).filter((G)=>G&&!G.startsWith("---")&&G.length>3),J="";for(let G=g.length-1;G>=0;G--){let
|
|
516
|
+
</html>`;function mT(){let $=cf();if(!rf($))nf($,{recursive:!0});let I=df((g,J)=>{if(g.url==="/api/state")J.writeHead(200,{"Content-Type":"application/json"}),J.end(JSON.stringify(cX($)));else J.writeHead(200,{"Content-Type":"text/html"}),J.end(sf)}),_=new dX.default({server:I}),u=null;function U(g,J){if(u)clearTimeout(u);u=setTimeout(()=>{let G=JSON.stringify({type:"update",event:g,file:J,data:cX($)});_.clients.forEach((q)=>{if(q.readyState===hX.default.OPEN)q.send(G)})},100)}let z=b2($,{persistent:!0,ignoreInitial:!0,awaitWriteFinish:{stabilityThreshold:200,pollInterval:50}});z.on("all",(g,J)=>U(g,lT(J))),_.on("connection",(g)=>{g.send(JSON.stringify({type:"full",data:cX($)})),g.on("error",()=>g.terminate())}),process.on("SIGINT",()=>{console.log(`
|
|
517
|
+
Shutting down...`),z.close(),_.clients.forEach((g)=>{g.terminate()}),_.close(()=>I.close(()=>process.exit(0))),setTimeout(()=>process.exit(1),3000).unref()}),process.on("SIGTERM",()=>process.emit("SIGINT")),I.listen(iT,()=>{console.log(P0.magenta(`
|
|
518
|
+
\uD83D\uDEF8 Serena Memory Dashboard`)),console.log(P0.white(` http://localhost:${iT}`)),console.log(P0.dim(` Watching: ${$}
|
|
519
|
+
`))})}var rT={name:"oh-my-agent",version:"4.24.0",description:"Portable multi-agent harness for .agents-based skills and workflows across Antigravity, Claude Code, Codex, OpenCode, and more",type:"module",bin:{"oh-my-agent":"./bin/cli.js",oma:"./bin/cli.js"},files:["bin"],keywords:["oh-my-agent","antigravity",".agents","agent","skills","agent-skills","multi-agent","orchestrator","claude","claude-code","codex","opencode","copilot","cursor","chatgpt","pm","frontend","backend","mobile","qa","debug","terraform","database","workflow","bug-fixing","gemini"],author:"our.first.fluke <our.first.fluke@gmail.com>",contributors:["gracefullight <gracefullight.dev@gmail.com>","gahyun-git <go4it.gh@gmail.com>"],license:"MIT",funding:[{type:"github",url:"https://github.com/sponsors/first-fluke"},{type:"buymeacoffee",url:"https://buymeacoffee.com/firstfluke"}],scripts:{"sync:readme":"node ./scripts/sync-readme.mjs",build:"bun run sync:readme && bun build cli.ts --outfile bin/cli.js --target node --minify",dev:"bun run cli.ts",lint:"biome check --write --unsafe .",test:"vitest run",prepublishOnly:"bun run build"},dependencies:{"@clack/prompts":"^1.1.0",chokidar:"^5.0.0",commander:"^14.0.3","p-map":"^7.0.4",picocolors:"^1.1.1",ws:"^8.18.0",yaml:"^2.8.2",zod:"^4.3.6"},devDependencies:{"@biomejs/biome":"2.4.5","@types/bun":"^1.3.10","@types/ws":"^8.18.1",vitest:"^4.0.18"},peerDependencies:{typescript:"^6"},repository:{type:"git",url:"https://github.com/first-fluke/oh-my-agent"},antigravity:{skillsPath:".agents/skills",skills:["oma-brainstorm","oma-coordination","oma-pm","oma-frontend","oma-backend","oma-db","oma-mobile","oma-qa","oma-debug","oma-orchestrator","oma-dev-workflow","oma-tf-infra","oma-commit","oma-pdf"]}};import{existsSync as Ix,mkdirSync as Ux,readdirSync as zU,readFileSync as _x,statSync as aX}from"node:fs";import{basename as ux,join as j4}from"node:path";var y$=v$(P$(),1),zx="●",gx="✓",Jx="✗",Gx="○",qx="◌";function Xx(){if(process.env.MEMORIES_DIR)return process.env.MEMORIES_DIR;let $=process.argv[3];if($)return j4($,".serena","memories");return j4(process.cwd(),".serena","memories")}function gU($){try{return _x($,"utf-8")}catch{return""}}function Nx($){try{let I=zU($);if(I.includes("orchestrator-session.md"))return j4($,"orchestrator-session.md");let _=I.filter((u)=>/^session-.*\.md$/.test(u)).map((u)=>({name:u,mtime:aX(j4($,u)).mtimeMs})).sort((u,U)=>U.mtime-u.mtime);if(_.length>0&&_[0])return j4($,_[0].name)}catch{}return null}function Qx($){let I=Nx($);if(!I)return{id:"N/A",status:"UNKNOWN"};let _=gU(I);if(!_)return{id:"N/A",status:"UNKNOWN"};let u=(_.match(/session-id:\s*(.+)/i)||[])[1]||(_.match(/# Session:\s*(.+)/i)||[])[1]||_.match(/(session-\d{8}-\d{6})/)?.[1]||ux(I,".md"),U="UNKNOWN";if(/IN PROGRESS|RUNNING|## Active|\[IN PROGRESS\]/i.test(_))U="RUNNING";else if(/COMPLETED|DONE|## Completed|\[COMPLETED\]/i.test(_))U="COMPLETED";else if(/FAILED|ERROR|## Failed|\[FAILED\]/i.test(_))U="FAILED";else if(/Step \d+:.*\[/i.test(_))U="RUNNING";return{id:(u||"N/A").trim(),status:U}}function vx($){let I=gU(j4($,"task-board.md"));if(!I)return[];let _=[],u=I.split(`
|
|
520
|
+
`);for(let U of u){if(!U.startsWith("|")||/^\|\s*-+/.test(U))continue;let z=U.split("|").map((q)=>q.trim()).filter(Boolean),g=z[0];if(z.length<2||!g||/^agent$/i.test(g))continue;let J=z[1],G=z[2];_.push({agent:g,status:J||"pending",task:G||""})}return _}function tX($,I){try{let _=zU($).filter((z)=>z.startsWith(`progress-${I}`)&&z.endsWith(".md")).sort().reverse();if(_.length===0||!_[0])return null;let U=gU(j4($,_[0])).match(/turn[:\s]*(\d+)/i);return U?.[1]?parseInt(U[1],10):null}catch{return null}}function Hx($){try{let I=zU($).filter((u)=>u.endsWith(".md")&&u!==".gitkeep").map((u)=>({name:u,mtime:aX(j4($,u)).mtimeMs})).sort((u,U)=>U.mtime-u.mtime).slice(0,5),_=[];for(let u of I){let U=u.name.replace(/^(progress|result|session|debug|task)-?/,"").replace(/[-_]agent/,"").replace(/[-_]completion/,"").replace(/\.md$/,"").replace(/[-_]/g," ").trim()||u.name.replace(/\.md$/,""),g=gU(j4($,u.name)).split(`
|
|
521
|
+
`).map((G)=>G.trim()).filter((G)=>G&&!G.startsWith("---")&&G.length>3),J="";for(let G=g.length-1;G>=0;G--){let q=g[G];if(!q)continue;if(/^\*\*|^#+|^-|^\d+\.|Status|Result|Action|Step/i.test(q)){if(J=q.replace(/^[#*\-\d.]+\s*/,"").replace(/\*\*/g,"").trim(),J.length>5)break}}if(J.length>52)J=`${J.substring(0,49)}...`;if(J)_.push({agent:U,message:J})}return _}catch{return[]}}function Yx($){let I=[],_=new Set;try{let u=zU($).filter((U)=>U.endsWith(".md")&&U!==".gitkeep").map((U)=>({name:U,mtime:aX(j4($,U)).mtimeMs})).sort((U,z)=>z.mtime-U.mtime);for(let U of u){let z=gU(j4($,U.name)),g=z.match(/\*\*Agent\*\*:\s*(.+)/i)||z.match(/Agent:\s*(.+)/i)||z.match(/^#+\s*(.+?)\s*Agent/im),J=null;if(g?.[1])J=g[1].trim();else if(/_agent|agent_|-agent/i.test(U.name))J=U.name.replace(/\.md$/,"").replace(/[-_]completion|[-_]progress|[-_]result/gi,"").replace(/[-_]/g," ").trim();if(J&&!_.has(J.toLowerCase())){_.add(J.toLowerCase());let G="unknown";if(/\[COMPLETED\]|## Completed|## Results/i.test(z))G="completed";else if(/\[IN PROGRESS\]|## Progress|IN PROGRESS/i.test(z))G="running";else if(/\[FAILED\]|## Failed|ERROR/i.test(z))G="failed";let q=z.match(/## Task\s*\n+(.+)/i)||z.match(/\*\*Task\*\*:\s*(.+)/i),N=q?.[1]?q[1].trim().substring(0,20):"";I.push({agent:J,status:G,task:N,turn:tX($,J)})}}}catch{}return I}function Ox($){let I=$.toLowerCase();if(["running","active","in_progress","in-progress"].includes(I))return`${y$.default.green(zx)} running`;else if(["completed","done","finished"].includes(I))return`${y$.default.cyan(gx)} completed`;else if(["failed","error"].includes(I))return`${y$.default.red(Jx)} failed`;else if(["blocked","waiting"].includes(I))return`${y$.default.yellow(Gx)} blocked`;return`${y$.default.dim(qx)} pending`}function nT($){console.clear();let I=Qx($),u=vx($).map((v)=>({...v,turn:tX($,v.agent)}));if(u.length===0)u=Yx($);if(u.length===0)try{let v=zU($).filter((O)=>O.startsWith("progress-")&&O.endsWith(".md"));for(let O of v){let T=O.replace(/^progress-/,"").replace(/\.md$/,"");u.push({agent:T,status:"running",task:"",turn:tX($,T)})}}catch{}let U=56,z="═".repeat(U),g=(v)=>" ".repeat(Math.max(0,v)),J=(v)=>y$.default.magenta(v),G=(v)=>y$.default.bold(v),q=(v)=>y$.default.dim(v),N=y$.default.yellow;if(I.status==="RUNNING")N=y$.default.green;else if(I.status==="COMPLETED")N=y$.default.cyan;else if(I.status==="FAILED")N=y$.default.red;console.log(`${J(`╔${z}╗`)}`),console.log(`${J("║")} ${G(J("Serena Memory Dashboard"))}${g(U-25)}${J("║")}`);let X=`Session: ${G(I.id.padEnd(20))} [${N(I.status)}]`;if(console.log(`${J("║")} ${X}${g(U-4-X.length-9)}${J("║")}`),console.log(`${J(`╠${z}╣`)}`),console.log(`${J("║")} ${G(`${"Agent".padEnd(12)} ${"Status".padEnd(12)} ${"Turn".padEnd(6)} ${"Task".padEnd(20)}`)} ${J("║")}`),console.log(`${J("║")} ${q(`${"──────────".padEnd(12)} ${"──────────".padEnd(12)} ${"────".padEnd(6)} ${"──────────────────".padEnd(20)}`)} ${J("║")}`),u.length===0)console.log(`${J("║")} ${q(`No agents detected yet${g(32)}`)}${J("║")}`);else for(let v of u){let O=Ox(v.status),T=v.turn!=null?String(v.turn):"-",L=v.task.substring(0,20);console.log(`${J("║")} ${v.agent.padEnd(12)} ${O.padEnd(22)} ${T.padEnd(6)} ${L.padEnd(20)}${J("║")}`)}console.log(`${J(`╠${z}╣`)}`),console.log(`${J("║")} ${G("Latest Activity:")}${g(U-18)}${J("║")}`);let Q=Hx($);if(Q.length===0)console.log(`${J("║")} ${q(`No activity yet${g(38)}`)}${J("║")}`);else for(let v of Q){let O=`[${v.agent}] ${v.message}`;console.log(`${J("║")} ${q(O.substring(0,52).padEnd(52))}${J("║")}`)}console.log(`${J(`╠${z}╣`)}`);let Y=`Updated: ${new Date().toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})} | Ctrl+C to exit`;console.log(`${J("║")} ${q(Y)}${g(U-4-Y.length)}${J("║")}`),console.log(`${J(`╚${z}╝`)}`)}async function hT(){let $=Xx();if(!Ix($))Ux($,{recursive:!0}),console.log(y$.default.yellow(`Created ${$} — waiting for memory files...`));console.log(y$.default.magenta(`
|
|
516
522
|
\uD83D\uDEF8 Serena Terminal Dashboard`)),console.log(y$.default.dim(` Watching: ${$}
|
|
517
|
-
`)),
|
|
518
|
-
`),I.close(),_(),process.exit(0)}),process.on("SIGTERM",()=>process.emit("SIGINT"))})}var
|
|
523
|
+
`)),nT($);let I=b2($,{persistent:!0,ignoreInitial:!0,awaitWriteFinish:{stabilityThreshold:200,pollInterval:50}});return I.on("all",()=>nT($)),new Promise((_)=>{process.on("SIGINT",()=>{console.log(`
|
|
524
|
+
`),I.close(),_(),process.exit(0)}),process.on("SIGTERM",()=>process.emit("SIGINT"))})}var oT=rT.version,tT="OH_MY_AG_OUTPUT_FORMAT",JU=["text","json"],dT=["gemini","claude","codex","qwen"],cT=["backend","frontend","mobile","qa","debug","pm"];function q6($,I="Output as JSON"){return $.option("--json",I).option("--output <format>","Output format (text/json)",(_)=>{let u=_.trim().toLowerCase();if(!JU.includes(u))throw Error(`Invalid output format: ${_}. Expected one of ${JU.join(", ")}`);return u})}function Tx($){if($?.json)return"json";let I=$?.output?.trim().toLowerCase();if(I&&JU.includes(I))return I;if(process.env[tT]?.trim().toLowerCase()==="json")return"json";return"text"}function h4($){return Tx($)==="json"}function aT($){let I=$.at(-1);return I instanceof a2?I:null}function Bx($){let I=aT($);if(I)return I.opts();let _=$.at(-1);return _&&typeof _==="object"?_:{}}function Dx($){if($ instanceof Error)return $.message;return String($)}function l6($){throw Error($)}function sX($,I){for(let _ of $){let u=_.charCodeAt(0);if(u>=0&&u<=31||u===127)l6(`${I} must not contain control characters`)}}function Mx($,I){if(sX($,I),/[?#%]/.test($))l6(`${I} must not contain ?, #, or %`);if($.includes(".."))l6(`${I} must not contain '..'`)}function Kx($,I){sX($,I);try{new URL($)}catch{l6(`${I} must be a valid absolute URL`)}}function eX($,I,_="text"){if(typeof $==="string"){if(_==="identifier"){Mx($,I);return}if(_==="url"){Kx($,I);return}sX($,I);return}if(Array.isArray($))for(let[u,U]of $.entries())eX(U,`${I}[${u}]`,_)}function pT($){let I=$.toLowerCase();if(I==="url"||I.endsWith("url"))return"url";if(I.includes("id")||I.includes("type")||I.includes("vendor")||I.includes("session"))return"identifier";return"text"}function Vx($){let I=$.vendor;if(typeof I==="string"&&!dT.includes(I))l6(`vendor must be one of ${dT.join(", ")}`);let _=$.output;if(typeof _==="string"&&!JU.includes(_))l6(`output must be one of ${JU.join(", ")}`)}function Rx($){let I=$.processedArgs??$.args??[];($.registeredArguments??[]).forEach((U,z)=>{let g=U.name?.()||String(z),J=I[z];if(eX(J,g,pT(g)),g==="agent-type"&&typeof J==="string"&&!cT.includes(J))l6(`agent-type must be one of ${cT.join(", ")}`)});let u=$.opts();Vx(u);for(let[U,z]of Object.entries(u))eX(z,U,pT(U))}function Lx($){return($.registeredArguments??[]).map((I)=>({name:I.name?.()||"",required:!!I.required,variadic:!!I.variadic}))}function Zx($){return $.options.map((I)=>({flags:I.flags,long:I.long||void 0,short:I.short||void 0,description:I.description||"",required:!!I.required||!!I.mandatory,optional:!!I.optional,defaultValue:I.defaultValue}))}function eT($){let I=[],_=$;while(_?.parent)I.unshift(_.name()),_=_.parent;return I.join(" ")}function Wx($){return $.options.some((I)=>I.long==="--json"||I.long==="--output")}function Px($){return $.options.some((I)=>I.long==="--dry-run")}function sT($){return{name:$.name(),path:eT($),summary:$.summary()||void 0,description:$.description(),arguments:Lx($),options:Zx($),supportsJsonOutput:Wx($),supportsDryRun:Px($),subcommands:$.commands.map((I)=>sT(I))}}function bx($,I){if(!I)return $;let _=I.trim();if(!_)return $;let u=[...$.commands];while(u.length>0){let U=u.shift();if(!U)continue;if(U.name()===_||eT(U)===_)return U;u.push(...U.commands)}return null}function Ax($,I){let _=bx($,I);if(!_)l6(`Unknown command: ${I}`);let u={name:$.name(),version:$.version(),description:$.description(),env:{[tT]:"Set to json to force machine-readable output on commands that support it."},command:sT(_)};console.log(JSON.stringify(u,null,2))}function K$($,I={}){return async(..._)=>{let u=aT(_),U=Bx(_);try{if(u)Rx(u);await $(..._)}catch(z){let g=Dx(z);if(I.supportsJsonOutput&&h4(U))console.log(JSON.stringify({error:g},null,2));else console.error(g);process.exitCode=1}}}var Q$=new a2;Q$.name("oh-my-agent").description("Multi-Agent Orchestrator for AI IDEs").version(oT).showSuggestionAfterError().showHelpAfterError().addHelpText("after",`
|
|
519
525
|
Aliases:
|
|
520
526
|
oma Alias for oh-my-agent after global installation.
|
|
521
|
-
`).action(
|
|
527
|
+
`).action(K$(async()=>{await uX()}));Q$.command("install").description("Install oh-my-agent skills and configurations").action(K$(async()=>{await uX()}));Q$.command("describe [command-path]").description("Describe CLI commands as JSON for runtime introspection").action(K$(($)=>{Ax(Q$,$)},{supportsJsonOutput:!0}));Q$.command("dashboard").description("Start terminal dashboard (real-time agent monitoring)").action(K$(async()=>{await hT()}));Q$.command("dashboard:web").description("Start web dashboard on http://localhost:9847").action(K$(()=>{mT()}));q6(Q$.command("auth:status").description("Check authentication status of all supported CLIs")).action(K$(async($)=>{await kH(h4($))},{supportsJsonOutput:!0}));q6(Q$.command("usage:anti").description("Show model usage quotas (connects to local Antigravity IDE)").option("--raw","Dump raw RPC response")).action(K$(async($)=>{await uO(h4($),$.raw)},{supportsJsonOutput:!0}));Q$.command("update").description("Update skills to latest version from registry").option("-f, --force","Overwrite user-customized config files").option("--ci","Run in non-interactive CI mode (skip prompts)").action(K$(async($)=>{await sY($.force??!1,$.ci??!1)}));q6(Q$.command("doctor").description("Check CLI installations, MCP configs, and skill status"),"Output as JSON for CI/CD").action(K$(async($)=>{await oH(h4($))},{supportsJsonOutput:!0}));q6(Q$.command("stats").description("View productivity metrics").option("--reset","Reset metrics data")).action(K$(async($)=>{await aY(h4($),$.reset)},{supportsJsonOutput:!0}));q6(Q$.command("retro [window]").description("Engineering retrospective with metrics & trends").option("--interactive","Interactive mode (manual entry)").option("--compare","Compare current window vs prior same-length window")).action(K$(async($,I)=>{await dY($,{json:h4(I),compare:I.compare,interactive:I.interactive})},{supportsJsonOutput:!0}));q6(Q$.command("cleanup").description("Clean up orphaned subagent processes and temp files").option("--dry-run","Show what would be cleaned without making changes").option("-y, --yes","Skip confirmation prompts and clean everything")).action(K$(async($)=>{await dH($.dryRun,h4($),$.yes)},{supportsJsonOutput:!0}));Q$.command("bridge [url]").description("Bridge MCP stdio to Streamable HTTP (for Serena)").action(K$(async($)=>{await nH($)}));Q$.command("agent:spawn <agent-id> <prompt> <session-id>").description("Spawn a subagent (prompt can be inline text or a file path)").option("-m, --model <vendor>","CLI vendor override (gemini/claude/codex/qwen)").option("-w, --workspace <path>","Working directory for the agent (auto-detected if omitted)").action(K$(async($,I,_,u)=>{await lv($,I,_,u.workspace||".",u.model)}));Q$.command("agent:status <session-id> [agent-ids...]").description("Check status of subagents").option("-r, --root <path>","Root path for memory checks",process.cwd()).action(K$(async($,I,_)=>{await mv($,I,_.root)}));Q$.command("agent:parallel [tasks...]").description("Run multiple sub-agents in parallel").option("-m, --model <vendor>","CLI vendor override (gemini/claude/codex/qwen)").option("-i, --inline","Inline mode: specify tasks as agent:task arguments").option("--no-wait","Don't wait for completion (background mode)").action(K$(async($,I)=>{await rv($,{vendor:I.model,inline:I.inline,noWait:!I.wait})}));Q$.command("agent:review").description("Run code review using external CLI (codex/claude/gemini)").option("-m, --model <vendor>","CLI vendor (codex/claude/gemini)").option("-p, --prompt <prompt>","Custom review prompt").option("-w, --workspace <path>","Working directory (default: current)").option("--no-uncommitted","Review committed changes only").action(K$(async($)=>{await nv({prompt:$.prompt,model:$.model,workspace:$.workspace,uncommitted:$.uncommitted})}));q6(Q$.command("memory:init").description("Initialize Serena memory schema in .serena/memories").option("--force","Overwrite empty or existing schema files")).action(K$(async($)=>{await OY(h4($),$.force)},{supportsJsonOutput:!0}));q6(Q$.command("verify <agent-type>").description("Verify subagent output (backend/frontend/mobile/qa/debug/pm)").option("-w, --workspace <path>","Workspace path",process.cwd())).action(K$(async($,I)=>{await GO($,I.workspace,h4(I))},{supportsJsonOutput:!0}));Q$.command("star").description("Star oh-my-agent on GitHub").action(K$(async()=>{await pY()}));q6(Q$.command("visualize").alias("viz").description("Visualize project structure as a dependency graph")).action(K$(async($)=>{await HO({json:h4($)})},{supportsJsonOutput:!0}));Q$.command("help").description("Show help information").action(K$(()=>{Q$.help()}));Q$.command("version").description("Show version number").action(K$(()=>{console.log(oT)}));Q$.parse();
|