aide-memory 0.6.1 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/aide-memory.js +187 -113
- package/package.json +3 -2
package/dist/cli/aide-memory.js
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var
|
|
3
|
-
`).replace(/^/gm," ".repeat(
|
|
4
|
-
`)}padWidth(e,
|
|
2
|
+
"use strict";var YP=Object.create;var Ec=Object.defineProperty;var QP=Object.getOwnPropertyDescriptor;var e1=Object.getOwnPropertyNames;var t1=Object.getPrototypeOf,r1=Object.prototype.hasOwnProperty;var g=(t,e)=>()=>(t&&(e=t(t=0)),e);var O=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),bt=(t,e)=>{for(var r in e)Ec(t,r,{get:e[r],enumerable:!0})},O$=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of e1(e))!r1.call(t,n)&&n!==r&&Ec(t,n,{get:()=>e[n],enumerable:!(o=QP(e,n))||o.enumerable});return t};var C=(t,e,r)=>(r=t!=null?YP(t1(t)):{},O$(e||!t||!t.__esModule?Ec(r,"default",{value:t,enumerable:!0}):r,t)),Ic=t=>O$(Ec({},"__esModule",{value:!0}),t);var Yi=O(Yf=>{var zc=class extends Error{constructor(e,r,o){super(o),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0}},Xf=class extends zc{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Yf.CommanderError=zc;Yf.InvalidArgumentError=Xf});var Tc=O(em=>{var{InvalidArgumentError:n1}=Yi(),Qf=class{constructor(e,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:r.concat(e)}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,o)=>{if(!this.argChoices.includes(r))throw new n1(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,o):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function o1(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}em.Argument=Qf;em.humanReadableArgName=o1});var rm=O(P$=>{var{humanReadableArgName:i1}=Tc(),tm=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){let r=e.commands.filter(n=>!n._hidden),o=e._getHelpCommand();return o&&!o._hidden&&r.push(o),this.sortSubcommands&&r.sort((n,i)=>n.name().localeCompare(i.name())),r}compareOptions(e,r){let o=n=>n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"");return o(e).localeCompare(o(r))}visibleOptions(e){let r=e.options.filter(n=>!n.hidden),o=e._getHelpOption();if(o&&!o.hidden){let n=o.short&&e._findOption(o.short),i=o.long&&e._findOption(o.long);!n&&!i?r.push(o):o.long&&!i?r.push(e.createOption(o.long,o.description)):o.short&&!n&&r.push(e.createOption(o.short,o.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let r=[];for(let o=e.parent;o;o=o.parent){let n=o.options.filter(i=>!i.hidden);r.push(...n)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||""}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(o=>i1(o)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((o,n)=>Math.max(o,r.subcommandTerm(n).length),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((o,n)=>Math.max(o,r.optionTerm(n).length),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((o,n)=>Math.max(o,r.optionTerm(n).length),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((o,n)=>Math.max(o,r.argumentTerm(n).length),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let o="";for(let n=e.parent;n;n=n.parent)o=n.name()+" "+o;return o+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];return e.argChoices&&r.push(`choices: ${e.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0?`${e.description} (${r.join(", ")})`:e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let o=`(${r.join(", ")})`;return e.description?`${e.description} ${o}`:o}return e.description}formatHelp(e,r){let o=r.padWidth(e,r),n=r.helpWidth||80,i=2,s=2;function a(m,y){if(y){let x=`${m.padEnd(o+s)}${y}`;return r.wrap(x,n-i,o+s)}return m}function c(m){return m.join(`
|
|
3
|
+
`).replace(/^/gm," ".repeat(i))}let u=[`Usage: ${r.commandUsage(e)}`,""],l=r.commandDescription(e);l.length>0&&(u=u.concat([r.wrap(l,n,0),""]));let d=r.visibleArguments(e).map(m=>a(r.argumentTerm(m),r.argumentDescription(m)));d.length>0&&(u=u.concat(["Arguments:",c(d),""]));let p=r.visibleOptions(e).map(m=>a(r.optionTerm(m),r.optionDescription(m)));if(p.length>0&&(u=u.concat(["Options:",c(p),""])),this.showGlobalOptions){let m=r.visibleGlobalOptions(e).map(y=>a(r.optionTerm(y),r.optionDescription(y)));m.length>0&&(u=u.concat(["Global Options:",c(m),""]))}let f=r.visibleCommands(e).map(m=>a(r.subcommandTerm(m),r.subcommandDescription(m)));return f.length>0&&(u=u.concat(["Commands:",c(f),""])),u.join(`
|
|
4
|
+
`)}padWidth(e,r){return Math.max(r.longestOptionTermLength(e,r),r.longestGlobalOptionTermLength(e,r),r.longestSubcommandTermLength(e,r),r.longestArgumentTermLength(e,r))}wrap(e,r,o,n=40){let i=" \\f\\t\\v\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF",s=new RegExp(`[\\n][${i}]+`);if(e.match(s))return e;let a=r-o;if(a<n)return e;let c=e.slice(0,o),u=e.slice(o).replace(`\r
|
|
5
5
|
`,`
|
|
6
|
-
`),
|
|
7
|
-
|.{1,${a-1}}([${
|
|
8
|
-
`?"":(
|
|
9
|
-
`)}};
|
|
10
|
-
(Did you mean one of ${
|
|
11
|
-
(Did you mean ${
|
|
12
|
-
- specify the name in Command constructor or using .name()`);return
|
|
13
|
-
Expecting one of '${
|
|
14
|
-
- already used by option '${
|
|
6
|
+
`),l=" ".repeat(o),p="\\s\u200B",f=new RegExp(`
|
|
7
|
+
|.{1,${a-1}}([${p}]|$)|[^${p}]+?([${p}]|$)`,"g"),m=u.match(f)||[];return c+m.map((y,x)=>y===`
|
|
8
|
+
`?"":(x>0?l:"")+y.trimEnd()).join(`
|
|
9
|
+
`)}};P$.Help=tm});var sm=O(im=>{var{InvalidArgumentError:s1}=Yi(),nm=class{constructor(e,r){this.flags=e,this.description=r||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let o=c1(e);this.short=o.shortFlag,this.long=o.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let r=e;return typeof e=="string"&&(r={[e]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:r.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,o)=>{if(!this.argChoices.includes(r))throw new s1(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,o):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return a1(this.name().replace(/^no-/,""))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},om=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,o)=>{this.positiveOptions.has(o)&&this.dualOptions.add(o)})}valueFromOption(e,r){let o=r.attributeName();if(!this.dualOptions.has(o))return!0;let n=this.negativeOptions.get(o).presetArg,i=n!==void 0?n:!1;return r.negate===(i===e)}};function a1(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function c1(t){let e,r,o=t.split(/[ |,]+/);return o.length>1&&!/^[[<]/.test(o[1])&&(e=o.shift()),r=o.shift(),!e&&/^-[^-]$/.test(r)&&(e=r,r=void 0),{shortFlag:e,longFlag:r}}im.Option=nm;im.DualOptions=om});var j$=O(R$=>{function u1(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let r=[];for(let o=0;o<=t.length;o++)r[o]=[o];for(let o=0;o<=e.length;o++)r[0][o]=o;for(let o=1;o<=e.length;o++)for(let n=1;n<=t.length;n++){let i=1;t[n-1]===e[o-1]?i=0:i=1,r[n][o]=Math.min(r[n-1][o]+1,r[n][o-1]+1,r[n-1][o-1]+i),n>1&&o>1&&t[n-1]===e[o-2]&&t[n-2]===e[o-1]&&(r[n][o]=Math.min(r[n][o],r[n-2][o-2]+1))}return r[t.length][e.length]}function l1(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let r=t.startsWith("--");r&&(t=t.slice(2),e=e.map(s=>s.slice(2)));let o=[],n=3,i=.4;return e.forEach(s=>{if(s.length<=1)return;let a=u1(t,s),c=Math.max(t.length,s.length);(c-a)/c>i&&(a<n?(n=a,o=[s]):a===n&&o.push(s))}),o.sort((s,a)=>s.localeCompare(a)),r&&(o=o.map(s=>`--${s}`)),o.length>1?`
|
|
10
|
+
(Did you mean one of ${o.join(", ")}?)`:o.length===1?`
|
|
11
|
+
(Did you mean ${o[0]}?)`:""}R$.suggestSimilar=l1});var M$=O(D$=>{var d1=require("node:events").EventEmitter,am=require("node:child_process"),Or=require("node:path"),cm=require("node:fs"),De=require("node:process"),{Argument:p1,humanReadableArgName:f1}=Tc(),{CommanderError:um}=Yi(),{Help:m1}=rm(),{Option:N$,DualOptions:h1}=sm(),{suggestSimilar:C$}=j$(),lm=class t extends d1{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:r=>De.stdout.write(r),writeErr:r=>De.stderr.write(r),getOutHelpWidth:()=>De.stdout.isTTY?De.stdout.columns:void 0,getErrHelpWidth:()=>De.stderr.isTTY?De.stderr.columns:void 0,outputError:(r,o)=>o(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let r=this;r;r=r.parent)e.push(r);return e}command(e,r,o){let n=r,i=o;typeof n=="object"&&n!==null&&(i=n,n=null),i=i||{};let[,s,a]=e.match(/([^ ]+) *(.*)/),c=this.createCommand(s);return n&&(c.description(n),c._executableHandler=!0),i.isDefault&&(this._defaultCommandName=c._name),c._hidden=!!(i.noHelp||i.hidden),c._executableFile=i.executableFile||null,a&&c.arguments(a),this._registerCommand(c),c.parent=this,c.copyInheritedSettings(this),n?this:c}createCommand(e){return new t(e)}createHelp(){return Object.assign(new m1,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,r){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
|
|
12
|
+
- specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new p1(e,r)}argument(e,r,o,n){let i=this.createArgument(e,r);return typeof o=="function"?i.default(n).argParser(o):i.default(o),this.addArgument(i),this}arguments(e){return e.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(e){let r=this.registeredArguments.slice(-1)[0];if(r&&r.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,r){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,this;e=e??"help [command]";let[,o,n]=e.match(/([^ ]+) *(.*)/),i=r??"display help for command",s=this.createCommand(o);return s.helpOption(!1),n&&s.arguments(n),i&&s.description(i),this._addImplicitHelpCommand=!0,this._helpCommand=s,this}addHelpCommand(e,r){return typeof e!="object"?(this.helpCommand(e,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,r){let o=["preSubcommand","preAction","postAction"];if(!o.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
|
|
13
|
+
Expecting one of '${o.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(r):this._lifeCycleHooks[e]=[r],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(e,r,o){this._exitCallback&&this._exitCallback(new um(e,r,o)),De.exit(e)}action(e){let r=o=>{let n=this.registeredArguments.length,i=o.slice(0,n);return this._storeOptionsAsProperties?i[n]=this:i[n]=this.opts(),i.push(this),e.apply(this,i)};return this._actionHandler=r,this}createOption(e,r){return new N$(e,r)}_callParseArg(e,r,o,n){try{return e.parseArg(r,o)}catch(i){if(i.code==="commander.invalidArgument"){let s=`${n} ${i.message}`;this.error(s,{exitCode:i.exitCode,code:i.code})}throw i}}_registerOption(e){let r=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(r){let o=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${o}'
|
|
14
|
+
- already used by option '${r.flags}'`)}this.options.push(e)}_registerCommand(e){let r=n=>[n.name()].concat(n.aliases()),o=r(e).find(n=>this._findCommand(n));if(o){let n=r(this._findCommand(o)).join("|"),i=r(e).join("|");throw new Error(`cannot add command '${i}' as already have command '${n}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);let r=e.name(),o=e.attributeName();if(e.negate){let i=e.long.replace(/^--no-/,"--");this._findOption(i)||this.setOptionValueWithSource(o,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(o,e.defaultValue,"default");let n=(i,s,a)=>{i==null&&e.presetArg!==void 0&&(i=e.presetArg);let c=this.getOptionValue(o);i!==null&&e.parseArg?i=this._callParseArg(e,i,c,s):i!==null&&e.variadic&&(i=e._concatValue(i,c)),i==null&&(e.negate?i=!1:e.isBoolean()||e.optional?i=!0:i=""),this.setOptionValueWithSource(o,i,a)};return this.on("option:"+r,i=>{let s=`error: option '${e.flags}' argument '${i}' is invalid.`;n(i,s,"cli")}),e.envVar&&this.on("optionEnv:"+r,i=>{let s=`error: option '${e.flags}' value '${i}' from env '${e.envVar}' is invalid.`;n(i,s,"env")}),this}_optionEx(e,r,o,n,i){if(typeof r=="object"&&r instanceof N$)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(r,o);if(s.makeOptionMandatory(!!e.mandatory),typeof n=="function")s.default(i).argParser(n);else if(n instanceof RegExp){let a=n;n=(c,u)=>{let l=a.exec(c);return l?l[0]:u},s.default(i).argParser(n)}else s.default(n);return this.addOption(s)}option(e,r,o,n){return this._optionEx({},e,r,o,n)}requiredOption(e,r,o,n){return this._optionEx({mandatory:!0},e,r,o,n)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,r){return this.setOptionValueWithSource(e,r,void 0)}setOptionValueWithSource(e,r,o){return this._storeOptionsAsProperties?this[e]=r:this._optionValues[e]=r,this._optionValueSources[e]=o,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let r;return this._getCommandAndAncestors().forEach(o=>{o.getOptionValueSource(e)!==void 0&&(r=o.getOptionValueSource(e))}),r}_prepareUserArgs(e,r){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},e===void 0&&r.from===void 0){De.versions?.electron&&(r.from="electron");let n=De.execArgv??[];(n.includes("-e")||n.includes("--eval")||n.includes("-p")||n.includes("--print"))&&(r.from="eval")}e===void 0&&(e=De.argv),this.rawArgs=e.slice();let o;switch(r.from){case void 0:case"node":this._scriptPath=e[1],o=e.slice(2);break;case"electron":De.defaultApp?(this._scriptPath=e[1],o=e.slice(2)):o=e.slice(1);break;case"user":o=e.slice(0);break;case"eval":o=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",o}parse(e,r){let o=this._prepareUserArgs(e,r);return this._parseCommand([],o),this}async parseAsync(e,r){let o=this._prepareUserArgs(e,r);return await this._parseCommand([],o),this}_executeSubCommand(e,r){r=r.slice();let o=!1,n=[".js",".ts",".tsx",".mjs",".cjs"];function i(l,d){let p=Or.resolve(l,d);if(cm.existsSync(p))return p;if(n.includes(Or.extname(d)))return;let f=n.find(m=>cm.existsSync(`${p}${m}`));if(f)return`${p}${f}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||"";if(this._scriptPath){let l;try{l=cm.realpathSync(this._scriptPath)}catch{l=this._scriptPath}a=Or.resolve(Or.dirname(l),a)}if(a){let l=i(a,s);if(!l&&!e._executableFile&&this._scriptPath){let d=Or.basename(this._scriptPath,Or.extname(this._scriptPath));d!==this._name&&(l=i(a,`${d}-${e._name}`))}s=l||s}o=n.includes(Or.extname(s));let c;De.platform!=="win32"?o?(r.unshift(s),r=A$(De.execArgv).concat(r),c=am.spawn(De.argv[0],r,{stdio:"inherit"})):c=am.spawn(s,r,{stdio:"inherit"}):(r.unshift(s),r=A$(De.execArgv).concat(r),c=am.spawn(De.execPath,r,{stdio:"inherit"})),c.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(d=>{De.on(d,()=>{c.killed===!1&&c.exitCode===null&&c.kill(d)})});let u=this._exitCallback;c.on("close",l=>{l=l??1,u?u(new um(l,"commander.executeSubCommandAsync","(close)")):De.exit(l)}),c.on("error",l=>{if(l.code==="ENOENT"){let d=a?`searched for local subcommand relative to directory '${a}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",p=`'${s}' does not exist
|
|
15
15
|
- if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
16
16
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
17
|
-
- ${d}`;throw new Error(
|
|
17
|
+
- ${d}`;throw new Error(p)}else if(l.code==="EACCES")throw new Error(`'${s}' not executable`);if(!u)De.exit(1);else{let d=new um(1,"commander.executeSubCommandAsync","(error)");d.nestedError=l,u(d)}}),this.runningCommand=c}_dispatchSubcommand(e,r,o){let n=this._findCommand(e);n||this.help({error:!0});let i;return i=this._chainOrCallSubCommandHook(i,n,"preSubcommand"),i=this._chainOrCall(i,()=>{if(n._executableHandler)this._executeSubCommand(n,r.concat(o));else return n._parseCommand(r,o)}),i}_dispatchHelpCommand(e){e||this.help();let r=this._findCommand(e);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,r)=>{e.required&&this.args[r]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(o,n,i)=>{let s=n;if(n!==null&&o.parseArg){let a=`error: command-argument value '${n}' is invalid for argument '${o.name()}'.`;s=this._callParseArg(o,n,i,a)}return s};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((o,n)=>{let i=o.defaultValue;o.variadic?n<this.args.length?(i=this.args.slice(n),o.parseArg&&(i=i.reduce((s,a)=>e(o,a,s),o.defaultValue))):i===void 0&&(i=[]):n<this.args.length&&(i=this.args[n],o.parseArg&&(i=e(o,i,o.defaultValue))),r[n]=i}),this.processedArgs=r}_chainOrCall(e,r){return e&&e.then&&typeof e.then=="function"?e.then(()=>r()):r()}_chainOrCallHooks(e,r){let o=e,n=[];return this._getCommandAndAncestors().reverse().filter(i=>i._lifeCycleHooks[r]!==void 0).forEach(i=>{i._lifeCycleHooks[r].forEach(s=>{n.push({hookedCommand:i,callback:s})})}),r==="postAction"&&n.reverse(),n.forEach(i=>{o=this._chainOrCall(o,()=>i.callback(i.hookedCommand,this))}),o}_chainOrCallSubCommandHook(e,r,o){let n=e;return this._lifeCycleHooks[o]!==void 0&&this._lifeCycleHooks[o].forEach(i=>{n=this._chainOrCall(n,()=>i(this,r))}),n}_parseCommand(e,r){let o=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(o.operands),r=o.unknown,this.args=e.concat(r),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),r);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,e,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(o.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let n=()=>{o.unknown.length>0&&this.unknownOption(o.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){n(),this._processArguments();let s;return s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent&&(s=this._chainOrCall(s,()=>{this.parent.emit(i,e,r)})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent&&this.parent.listenerCount(i))n(),this._processArguments(),this.parent.emit(i,e,r);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,r);this.listenerCount("command:*")?this.emit("command:*",e,r):this.commands.length?this.unknownCommand():(n(),this._processArguments())}else this.commands.length?(n(),this.help({error:!0})):(n(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(r=>r._name===e||r._aliases.includes(e))}_findOption(e){return this.options.find(r=>r.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(r=>{r.mandatory&&e.getOptionValue(r.attributeName())===void 0&&e.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(o=>{let n=o.attributeName();return this.getOptionValue(n)===void 0?!1:this.getOptionValueSource(n)!=="default"});e.filter(o=>o.conflictsWith.length>0).forEach(o=>{let n=e.find(i=>o.conflictsWith.includes(i.attributeName()));n&&this._conflictingOption(o,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let r=[],o=[],n=r,i=e.slice();function s(c){return c.length>1&&c[0]==="-"}let a=null;for(;i.length;){let c=i.shift();if(c==="--"){n===o&&n.push(c),n.push(...i);break}if(a&&!s(c)){this.emit(`option:${a.name()}`,c);continue}if(a=null,s(c)){let u=this._findOption(c);if(u){if(u.required){let l=i.shift();l===void 0&&this.optionMissingArgument(u),this.emit(`option:${u.name()}`,l)}else if(u.optional){let l=null;i.length>0&&!s(i[0])&&(l=i.shift()),this.emit(`option:${u.name()}`,l)}else this.emit(`option:${u.name()}`);a=u.variadic?u:null;continue}}if(c.length>2&&c[0]==="-"&&c[1]!=="-"){let u=this._findOption(`-${c[1]}`);if(u){u.required||u.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${u.name()}`,c.slice(2)):(this.emit(`option:${u.name()}`),i.unshift(`-${c.slice(2)}`));continue}}if(/^--[^=]+=/.test(c)){let u=c.indexOf("="),l=this._findOption(c.slice(0,u));if(l&&(l.required||l.optional)){this.emit(`option:${l.name()}`,c.slice(u+1));continue}}if(s(c)&&(n=o),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&o.length===0){if(this._findCommand(c)){r.push(c),i.length>0&&o.push(...i);break}else if(this._getHelpCommand()&&c===this._getHelpCommand().name()){r.push(c),i.length>0&&r.push(...i);break}else if(this._defaultCommandName){o.push(c),i.length>0&&o.push(...i);break}}if(this._passThroughOptions){n.push(c),i.length>0&&n.push(...i);break}n.push(c)}return{operands:r,unknown:o}}opts(){if(this._storeOptionsAsProperties){let e={},r=this.options.length;for(let o=0;o<r;o++){let n=this.options[o].attributeName();e[n]=n===this._versionOptionName?this._version:this[n]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,r)=>Object.assign(e,r.opts()),{})}error(e,r){this._outputConfiguration.outputError(`${e}
|
|
18
18
|
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
19
19
|
`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
|
|
20
|
-
`),this.outputHelp({error:!0}));let r
|
|
21
|
-
`),this._exit(0,"commander.version",e)}),this}description(e,
|
|
22
|
-
Expecting one of '${
|
|
23
|
-
`)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(o=>t.is(o))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function gn(n){return n.map(e=>{if(!e.startsWith("--inspect"))return e;let t,r="127.0.0.1",o="9229",s;return(s=e.match(/^(--inspect(-brk)?)$/))!==null?t=s[1]:(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(t=s[1],/^\d+$/.test(s[3])?o=s[3]:r=s[3]):(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=s[1],r=s[3],o=s[4]),t&&o!=="0"?`${t}=${r}:${parseInt(o)+1}`:e})}yn.Command=fr});var En=F(X=>{var{Argument:_n}=ht(),{Command:hr}=bn(),{CommanderError:Ci,InvalidArgumentError:wn}=Ye(),{Help:Ai}=ir(),{Option:Sn}=ur();X.program=new hr;X.createCommand=n=>new hr(n);X.createOption=(n,e)=>new Sn(n,e);X.createArgument=(n,e)=>new _n(n,e);X.Command=hr;X.Option=Sn;X.Argument=_n;X.Help=Ai;X.CommanderError=Ci;X.InvalidArgumentError=wn;X.InvalidOptionArgumentError=wn});var On=F((Yc,xn)=>{"use strict";xn.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var gr=F((Kc,Cn)=>{var Ke=On(),Rn={};for(let n of Object.keys(Ke))Rn[Ke[n]]=n;var b={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};Cn.exports=b;for(let n of Object.keys(b)){if(!("channels"in b[n]))throw new Error("missing channels property: "+n);if(!("labels"in b[n]))throw new Error("missing channel labels property: "+n);if(b[n].labels.length!==b[n].channels)throw new Error("channel and label counts mismatch: "+n);let{channels:e,labels:t}=b[n];delete b[n].channels,delete b[n].labels,Object.defineProperty(b[n],"channels",{value:e}),Object.defineProperty(b[n],"labels",{value:t})}b.rgb.hsl=function(n){let e=n[0]/255,t=n[1]/255,r=n[2]/255,o=Math.min(e,t,r),s=Math.max(e,t,r),i=s-o,a,c;s===o?a=0:e===s?a=(t-r)/i:t===s?a=2+(r-e)/i:r===s&&(a=4+(e-t)/i),a=Math.min(a*60,360),a<0&&(a+=360);let l=(o+s)/2;return s===o?c=0:l<=.5?c=i/(s+o):c=i/(2-s-o),[a,c*100,l*100]};b.rgb.hsv=function(n){let e,t,r,o,s,i=n[0]/255,a=n[1]/255,c=n[2]/255,l=Math.max(i,a,c),u=l-Math.min(i,a,c),d=function(f){return(l-f)/6/u+1/2};return u===0?(o=0,s=0):(s=u/l,e=d(i),t=d(a),r=d(c),i===l?o=r-t:a===l?o=1/3+e-r:c===l&&(o=2/3+t-e),o<0?o+=1:o>1&&(o-=1)),[o*360,s*100,l*100]};b.rgb.hwb=function(n){let e=n[0],t=n[1],r=n[2],o=b.rgb.hsl(n)[0],s=1/255*Math.min(e,Math.min(t,r));return r=1-1/255*Math.max(e,Math.max(t,r)),[o,s*100,r*100]};b.rgb.cmyk=function(n){let e=n[0]/255,t=n[1]/255,r=n[2]/255,o=Math.min(1-e,1-t,1-r),s=(1-e-o)/(1-o)||0,i=(1-t-o)/(1-o)||0,a=(1-r-o)/(1-o)||0;return[s*100,i*100,a*100,o*100]};function Ti(n,e){return(n[0]-e[0])**2+(n[1]-e[1])**2+(n[2]-e[2])**2}b.rgb.keyword=function(n){let e=Rn[n];if(e)return e;let t=1/0,r;for(let o of Object.keys(Ke)){let s=Ke[o],i=Ti(n,s);i<t&&(t=i,r=o)}return r};b.keyword.rgb=function(n){return Ke[n]};b.rgb.xyz=function(n){let e=n[0]/255,t=n[1]/255,r=n[2]/255;e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;let o=e*.4124+t*.3576+r*.1805,s=e*.2126+t*.7152+r*.0722,i=e*.0193+t*.1192+r*.9505;return[o*100,s*100,i*100]};b.rgb.lab=function(n){let e=b.rgb.xyz(n),t=e[0],r=e[1],o=e[2];t/=95.047,r/=100,o/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,o=o>.008856?o**(1/3):7.787*o+16/116;let s=116*r-16,i=500*(t-r),a=200*(r-o);return[s,i,a]};b.hsl.rgb=function(n){let e=n[0]/360,t=n[1]/100,r=n[2]/100,o,s,i;if(t===0)return i=r*255,[i,i,i];r<.5?o=r*(1+t):o=r+t-r*t;let a=2*r-o,c=[0,0,0];for(let l=0;l<3;l++)s=e+1/3*-(l-1),s<0&&s++,s>1&&s--,6*s<1?i=a+(o-a)*6*s:2*s<1?i=o:3*s<2?i=a+(o-a)*(2/3-s)*6:i=a,c[l]=i*255;return c};b.hsl.hsv=function(n){let e=n[0],t=n[1]/100,r=n[2]/100,o=t,s=Math.max(r,.01);r*=2,t*=r<=1?r:2-r,o*=s<=1?s:2-s;let i=(r+t)/2,a=r===0?2*o/(s+o):2*t/(r+t);return[e,a*100,i*100]};b.hsv.rgb=function(n){let e=n[0]/60,t=n[1]/100,r=n[2]/100,o=Math.floor(e)%6,s=e-Math.floor(e),i=255*r*(1-t),a=255*r*(1-t*s),c=255*r*(1-t*(1-s));switch(r*=255,o){case 0:return[r,c,i];case 1:return[a,r,i];case 2:return[i,r,c];case 3:return[i,a,r];case 4:return[c,i,r];case 5:return[r,i,a]}};b.hsv.hsl=function(n){let e=n[0],t=n[1]/100,r=n[2]/100,o=Math.max(r,.01),s,i;i=(2-t)*r;let a=(2-t)*o;return s=t*o,s/=a<=1?a:2-a,s=s||0,i/=2,[e,s*100,i*100]};b.hwb.rgb=function(n){let e=n[0]/360,t=n[1]/100,r=n[2]/100,o=t+r,s;o>1&&(t/=o,r/=o);let i=Math.floor(6*e),a=1-r;s=6*e-i,(i&1)!==0&&(s=1-s);let c=t+s*(a-t),l,u,d;switch(i){default:case 6:case 0:l=a,u=c,d=t;break;case 1:l=c,u=a,d=t;break;case 2:l=t,u=a,d=c;break;case 3:l=t,u=c,d=a;break;case 4:l=c,u=t,d=a;break;case 5:l=a,u=t,d=c;break}return[l*255,u*255,d*255]};b.cmyk.rgb=function(n){let e=n[0]/100,t=n[1]/100,r=n[2]/100,o=n[3]/100,s=1-Math.min(1,e*(1-o)+o),i=1-Math.min(1,t*(1-o)+o),a=1-Math.min(1,r*(1-o)+o);return[s*255,i*255,a*255]};b.xyz.rgb=function(n){let e=n[0]/100,t=n[1]/100,r=n[2]/100,o,s,i;return o=e*3.2406+t*-1.5372+r*-.4986,s=e*-.9689+t*1.8758+r*.0415,i=e*.0557+t*-.204+r*1.057,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,o=Math.min(Math.max(0,o),1),s=Math.min(Math.max(0,s),1),i=Math.min(Math.max(0,i),1),[o*255,s*255,i*255]};b.xyz.lab=function(n){let e=n[0],t=n[1],r=n[2];e/=95.047,t/=100,r/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,t=t>.008856?t**(1/3):7.787*t+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;let o=116*t-16,s=500*(e-t),i=200*(t-r);return[o,s,i]};b.lab.xyz=function(n){let e=n[0],t=n[1],r=n[2],o,s,i;s=(e+16)/116,o=t/500+s,i=s-r/200;let a=s**3,c=o**3,l=i**3;return s=a>.008856?a:(s-16/116)/7.787,o=c>.008856?c:(o-16/116)/7.787,i=l>.008856?l:(i-16/116)/7.787,o*=95.047,s*=100,i*=108.883,[o,s,i]};b.lab.lch=function(n){let e=n[0],t=n[1],r=n[2],o;o=Math.atan2(r,t)*360/2/Math.PI,o<0&&(o+=360);let i=Math.sqrt(t*t+r*r);return[e,i,o]};b.lch.lab=function(n){let e=n[0],t=n[1],o=n[2]/360*2*Math.PI,s=t*Math.cos(o),i=t*Math.sin(o);return[e,s,i]};b.rgb.ansi16=function(n,e=null){let[t,r,o]=n,s=e===null?b.rgb.hsv(n)[2]:e;if(s=Math.round(s/50),s===0)return 30;let i=30+(Math.round(o/255)<<2|Math.round(r/255)<<1|Math.round(t/255));return s===2&&(i+=60),i};b.hsv.ansi16=function(n){return b.rgb.ansi16(b.hsv.rgb(n),n[2])};b.rgb.ansi256=function(n){let e=n[0],t=n[1],r=n[2];return e===t&&t===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(r/255*5)};b.ansi16.rgb=function(n){let e=n%10;if(e===0||e===7)return n>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let t=(~~(n>50)+1)*.5,r=(e&1)*t*255,o=(e>>1&1)*t*255,s=(e>>2&1)*t*255;return[r,o,s]};b.ansi256.rgb=function(n){if(n>=232){let s=(n-232)*10+8;return[s,s,s]}n-=16;let e,t=Math.floor(n/36)/5*255,r=Math.floor((e=n%36)/6)/5*255,o=e%6/5*255;return[t,r,o]};b.rgb.hex=function(n){let t=(((Math.round(n[0])&255)<<16)+((Math.round(n[1])&255)<<8)+(Math.round(n[2])&255)).toString(16).toUpperCase();return"000000".substring(t.length)+t};b.hex.rgb=function(n){let e=n.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let t=e[0];e[0].length===3&&(t=t.split("").map(a=>a+a).join(""));let r=parseInt(t,16),o=r>>16&255,s=r>>8&255,i=r&255;return[o,s,i]};b.rgb.hcg=function(n){let e=n[0]/255,t=n[1]/255,r=n[2]/255,o=Math.max(Math.max(e,t),r),s=Math.min(Math.min(e,t),r),i=o-s,a,c;return i<1?a=s/(1-i):a=0,i<=0?c=0:o===e?c=(t-r)/i%6:o===t?c=2+(r-e)/i:c=4+(e-t)/i,c/=6,c%=1,[c*360,i*100,a*100]};b.hsl.hcg=function(n){let e=n[1]/100,t=n[2]/100,r=t<.5?2*e*t:2*e*(1-t),o=0;return r<1&&(o=(t-.5*r)/(1-r)),[n[0],r*100,o*100]};b.hsv.hcg=function(n){let e=n[1]/100,t=n[2]/100,r=e*t,o=0;return r<1&&(o=(t-r)/(1-r)),[n[0],r*100,o*100]};b.hcg.rgb=function(n){let e=n[0]/360,t=n[1]/100,r=n[2]/100;if(t===0)return[r*255,r*255,r*255];let o=[0,0,0],s=e%1*6,i=s%1,a=1-i,c=0;switch(Math.floor(s)){case 0:o[0]=1,o[1]=i,o[2]=0;break;case 1:o[0]=a,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=i;break;case 3:o[0]=0,o[1]=a,o[2]=1;break;case 4:o[0]=i,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=a}return c=(1-t)*r,[(t*o[0]+c)*255,(t*o[1]+c)*255,(t*o[2]+c)*255]};b.hcg.hsv=function(n){let e=n[1]/100,t=n[2]/100,r=e+t*(1-e),o=0;return r>0&&(o=e/r),[n[0],o*100,r*100]};b.hcg.hsl=function(n){let e=n[1]/100,r=n[2]/100*(1-e)+.5*e,o=0;return r>0&&r<.5?o=e/(2*r):r>=.5&&r<1&&(o=e/(2*(1-r))),[n[0],o*100,r*100]};b.hcg.hwb=function(n){let e=n[1]/100,t=n[2]/100,r=e+t*(1-e);return[n[0],(r-e)*100,(1-r)*100]};b.hwb.hcg=function(n){let e=n[1]/100,r=1-n[2]/100,o=r-e,s=0;return o<1&&(s=(r-o)/(1-o)),[n[0],o*100,s*100]};b.apple.rgb=function(n){return[n[0]/65535*255,n[1]/65535*255,n[2]/65535*255]};b.rgb.apple=function(n){return[n[0]/255*65535,n[1]/255*65535,n[2]/255*65535]};b.gray.rgb=function(n){return[n[0]/100*255,n[0]/100*255,n[0]/100*255]};b.gray.hsl=function(n){return[0,0,n[0]]};b.gray.hsv=b.gray.hsl;b.gray.hwb=function(n){return[0,100,n[0]]};b.gray.cmyk=function(n){return[0,0,0,n[0]]};b.gray.lab=function(n){return[n[0],0,0]};b.gray.hex=function(n){let e=Math.round(n[0]/100*255)&255,r=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(r.length)+r};b.rgb.gray=function(n){return[(n[0]+n[1]+n[2])/3/255*100]}});var Tn=F((zc,An)=>{var gt=gr();function Mi(){let n={},e=Object.keys(gt);for(let t=e.length,r=0;r<t;r++)n[e[r]]={distance:-1,parent:null};return n}function Ni(n){let e=Mi(),t=[n];for(e[n].distance=0;t.length;){let r=t.pop(),o=Object.keys(gt[r]);for(let s=o.length,i=0;i<s;i++){let a=o[i],c=e[a];c.distance===-1&&(c.distance=e[r].distance+1,c.parent=r,t.unshift(a))}}return e}function $i(n,e){return function(t){return e(n(t))}}function Ii(n,e){let t=[e[n].parent,n],r=gt[e[n].parent][n],o=e[n].parent;for(;e[o].parent;)t.unshift(e[o].parent),r=$i(gt[e[o].parent][o],r),o=e[o].parent;return r.conversion=t,r}An.exports=function(n){let e=Ni(n),t={},r=Object.keys(e);for(let o=r.length,s=0;s<o;s++){let i=r[s];e[i].parent!==null&&(t[i]=Ii(i,e))}return t}});var Nn=F((Qc,Mn)=>{var yr=gr(),ji=Tn(),$e={},Pi=Object.keys(yr);function Di(n){let e=function(...t){let r=t[0];return r==null?r:(r.length>1&&(t=r),n(t))};return"conversion"in n&&(e.conversion=n.conversion),e}function Fi(n){let e=function(...t){let r=t[0];if(r==null)return r;r.length>1&&(t=r);let o=n(t);if(typeof o=="object")for(let s=o.length,i=0;i<s;i++)o[i]=Math.round(o[i]);return o};return"conversion"in n&&(e.conversion=n.conversion),e}Pi.forEach(n=>{$e[n]={},Object.defineProperty($e[n],"channels",{value:yr[n].channels}),Object.defineProperty($e[n],"labels",{value:yr[n].labels});let e=ji(n);Object.keys(e).forEach(r=>{let o=e[r];$e[n][r]=Fi(o),$e[n][r].raw=Di(o)})});Mn.exports=$e});var Fn=F((Zc,Dn)=>{"use strict";var $n=(n,e)=>(...t)=>`\x1B[${n(...t)+e}m`,In=(n,e)=>(...t)=>{let r=n(...t);return`\x1B[${38+e};5;${r}m`},jn=(n,e)=>(...t)=>{let r=n(...t);return`\x1B[${38+e};2;${r[0]};${r[1]};${r[2]}m`},yt=n=>n,Pn=(n,e,t)=>[n,e,t],Ie=(n,e,t)=>{Object.defineProperty(n,e,{get:()=>{let r=t();return Object.defineProperty(n,e,{value:r,enumerable:!0,configurable:!0}),r},enumerable:!0,configurable:!0})},br,je=(n,e,t,r)=>{br===void 0&&(br=Nn());let o=r?10:0,s={};for(let[i,a]of Object.entries(br)){let c=i==="ansi16"?"ansi":i;i===e?s[c]=n(t,o):typeof a=="object"&&(s[c]=n(a[e],o))}return s};function Li(){let n=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[t,r]of Object.entries(e)){for(let[o,s]of Object.entries(r))e[o]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},r[o]=e[o],n.set(s[0],s[1]);Object.defineProperty(e,t,{value:r,enumerable:!1})}return Object.defineProperty(e,"codes",{value:n,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",Ie(e.color,"ansi",()=>je($n,"ansi16",yt,!1)),Ie(e.color,"ansi256",()=>je(In,"ansi256",yt,!1)),Ie(e.color,"ansi16m",()=>je(jn,"rgb",Pn,!1)),Ie(e.bgColor,"ansi",()=>je($n,"ansi16",yt,!0)),Ie(e.bgColor,"ansi256",()=>je(In,"ansi256",yt,!0)),Ie(e.bgColor,"ansi16m",()=>je(jn,"rgb",Pn,!0)),e}Object.defineProperty(Dn,"exports",{enumerable:!0,get:Li})});var Hn=F((el,Ln)=>{"use strict";Ln.exports=(n,e=process.argv)=>{let t=n.startsWith("-")?"":n.length===1?"-":"--",r=e.indexOf(t+n),o=e.indexOf("--");return r!==-1&&(o===-1||r<o)}});var Vn=F((tl,Bn)=>{"use strict";var Hi=require("os"),Un=require("tty"),Y=Hn(),{env:P}=process,me;Y("no-color")||Y("no-colors")||Y("color=false")||Y("color=never")?me=0:(Y("color")||Y("colors")||Y("color=true")||Y("color=always"))&&(me=1);"FORCE_COLOR"in P&&(P.FORCE_COLOR==="true"?me=1:P.FORCE_COLOR==="false"?me=0:me=P.FORCE_COLOR.length===0?1:Math.min(parseInt(P.FORCE_COLOR,10),3));function _r(n){return n===0?!1:{level:n,hasBasic:!0,has256:n>=2,has16m:n>=3}}function wr(n,e){if(me===0)return 0;if(Y("color=16m")||Y("color=full")||Y("color=truecolor"))return 3;if(Y("color=256"))return 2;if(n&&!e&&me===void 0)return 0;let t=me||0;if(P.TERM==="dumb")return t;if(process.platform==="win32"){let r=Hi.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in P)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in P)||P.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in P)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(P.TEAMCITY_VERSION)?1:0;if(P.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in P){let r=parseInt((P.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(P.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(P.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(P.TERM)||"COLORTERM"in P?1:t}function Ui(n){let e=wr(n,n&&n.isTTY);return _r(e)}Bn.exports={supportsColor:Ui,stdout:_r(wr(!0,Un.isatty(1))),stderr:_r(wr(!0,Un.isatty(2)))}});var Jn=F((rl,Wn)=>{"use strict";var Bi=(n,e,t)=>{let r=n.indexOf(e);if(r===-1)return n;let o=e.length,s=0,i="";do i+=n.substr(s,r-s)+e+t,s=r+o,r=n.indexOf(e,s);while(r!==-1);return i+=n.substr(s),i},Vi=(n,e,t,r)=>{let o=0,s="";do{let i=n[r-1]==="\r";s+=n.substr(o,(i?r-1:r)-o)+e+(i?`\r
|
|
20
|
+
`),this.outputHelp({error:!0}));let o=r||{},n=o.exitCode||1,i=o.code||"commander.error";this._exit(n,i,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in De.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,De.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new h1(this.options),r=o=>this.getOptionValue(o)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(o));this.options.filter(o=>o.implied!==void 0&&r(o.attributeName())&&e.valueFromOption(this.getOptionValue(o.attributeName()),o)).forEach(o=>{Object.keys(o.implied).filter(n=>!r(n)).forEach(n=>{this.setOptionValueWithSource(n,o.implied[n],"implied")})})}missingArgument(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,r){let o=s=>{let a=s.attributeName(),c=this.getOptionValue(a),u=this.options.find(d=>d.negate&&a===d.attributeName()),l=this.options.find(d=>!d.negate&&a===d.attributeName());return u&&(u.presetArg===void 0&&c===!1||u.presetArg!==void 0&&c===u.presetArg)?u:l||s},n=s=>{let a=o(s),c=a.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},i=`error: ${n(e)} cannot be used with ${n(r)}`;this.error(i,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let n=[],i=this;do{let s=i.createHelp().visibleOptions(i).filter(a=>a.long).map(a=>a.long);n=n.concat(s),i=i.parent}while(i&&!i._enablePositionalOptions);r=C$(e,n)}let o=`error: unknown option '${e}'${r}`;this.error(o,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,o=r===1?"":"s",i=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${o} but got ${e.length}.`;this.error(i,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(i=>{n.push(i.name()),i.alias()&&n.push(i.alias())}),r=C$(e,n)}let o=`error: unknown command '${e}'${r}`;this.error(o,{code:"commander.unknownCommand"})}version(e,r,o){if(e===void 0)return this._version;this._version=e,r=r||"-V, --version",o=o||"output the version number";let n=this.createOption(r,o);return this._versionOptionName=n.attributeName(),this._registerOption(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${e}
|
|
21
|
+
`),this._exit(0,"commander.version",e)}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");let o=this.parent?._findCommand(e);if(o){let n=[o.name()].concat(o.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${n}'`)}return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(o=>f1(o));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=Or.basename(e,Or.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp();return r.helpWidth===void 0&&(r.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),r.formatHelp(this,r)}_getHelpContext(e){e=e||{};let r={error:!!e.error},o;return r.error?o=n=>this._outputConfiguration.writeErr(n):o=n=>this._outputConfiguration.writeOut(n),r.write=e.write||o,r.command=this,r}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let o=this._getHelpContext(e);this._getCommandAndAncestors().reverse().forEach(i=>i.emit("beforeAllHelp",o)),this.emit("beforeHelp",o);let n=this.helpInformation(o);if(r&&(n=r(n),typeof n!="string"&&!Buffer.isBuffer(n)))throw new Error("outputHelp callback must return a string or a Buffer");o.write(n),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",o),this._getCommandAndAncestors().forEach(i=>i.emit("afterAllHelp",o))}helpOption(e,r){return typeof e=="boolean"?(e?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(e=e??"-h, --help",r=r??"display help for command",this._helpOption=this.createOption(e,r),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this}help(e){this.outputHelp(e);let r=De.exitCode||0;r===0&&e&&typeof e!="function"&&e.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(e,r){let o=["beforeAll","before","after","afterAll"];if(!o.includes(e))throw new Error(`Unexpected value for position to addHelpText.
|
|
22
|
+
Expecting one of '${o.join("', '")}'`);let n=`${e}Help`;return this.on(n,i=>{let s;typeof r=="function"?s=r({error:i.error,command:i.command}):s=r,s&&i.write(`${s}
|
|
23
|
+
`)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(n=>r.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function A$(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,o="127.0.0.1",n="9229",i;return(i=e.match(/^(--inspect(-brk)?)$/))!==null?r=i[1]:(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=i[1],/^\d+$/.test(i[3])?n=i[3]:o=i[3]):(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=i[1],o=i[3],n=i[4]),r&&n!=="0"?`${r}=${o}:${parseInt(n)+1}`:e})}D$.Command=lm});var F$=O(At=>{var{Argument:U$}=Tc(),{Command:dm}=M$(),{CommanderError:g1,InvalidArgumentError:Z$}=Yi(),{Help:y1}=rm(),{Option:L$}=sm();At.program=new dm;At.createCommand=t=>new dm(t);At.createOption=(t,e)=>new L$(t,e);At.createArgument=(t,e)=>new U$(t,e);At.Command=dm;At.Option=L$;At.Argument=U$;At.Help=y1;At.CommanderError=g1;At.InvalidArgumentError=Z$;At.InvalidOptionArgumentError=Z$});var J$=O((IL,H$)=>{"use strict";H$.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var pm=O((zL,W$)=>{var Qi=J$(),B$={};for(let t of Object.keys(Qi))B$[Qi[t]]=t;var M={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};W$.exports=M;for(let t of Object.keys(M)){if(!("channels"in M[t]))throw new Error("missing channels property: "+t);if(!("labels"in M[t]))throw new Error("missing channel labels property: "+t);if(M[t].labels.length!==M[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:r}=M[t];delete M[t].channels,delete M[t].labels,Object.defineProperty(M[t],"channels",{value:e}),Object.defineProperty(M[t],"labels",{value:r})}M.rgb.hsl=function(t){let e=t[0]/255,r=t[1]/255,o=t[2]/255,n=Math.min(e,r,o),i=Math.max(e,r,o),s=i-n,a,c;i===n?a=0:e===i?a=(r-o)/s:r===i?a=2+(o-e)/s:o===i&&(a=4+(e-r)/s),a=Math.min(a*60,360),a<0&&(a+=360);let u=(n+i)/2;return i===n?c=0:u<=.5?c=s/(i+n):c=s/(2-i-n),[a,c*100,u*100]};M.rgb.hsv=function(t){let e,r,o,n,i,s=t[0]/255,a=t[1]/255,c=t[2]/255,u=Math.max(s,a,c),l=u-Math.min(s,a,c),d=function(p){return(u-p)/6/l+1/2};return l===0?(n=0,i=0):(i=l/u,e=d(s),r=d(a),o=d(c),s===u?n=o-r:a===u?n=1/3+e-o:c===u&&(n=2/3+r-e),n<0?n+=1:n>1&&(n-=1)),[n*360,i*100,u*100]};M.rgb.hwb=function(t){let e=t[0],r=t[1],o=t[2],n=M.rgb.hsl(t)[0],i=1/255*Math.min(e,Math.min(r,o));return o=1-1/255*Math.max(e,Math.max(r,o)),[n,i*100,o*100]};M.rgb.cmyk=function(t){let e=t[0]/255,r=t[1]/255,o=t[2]/255,n=Math.min(1-e,1-r,1-o),i=(1-e-n)/(1-n)||0,s=(1-r-n)/(1-n)||0,a=(1-o-n)/(1-n)||0;return[i*100,s*100,a*100,n*100]};function v1(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}M.rgb.keyword=function(t){let e=B$[t];if(e)return e;let r=1/0,o;for(let n of Object.keys(Qi)){let i=Qi[n],s=v1(t,i);s<r&&(r=s,o=n)}return o};M.keyword.rgb=function(t){return Qi[t]};M.rgb.xyz=function(t){let e=t[0]/255,r=t[1]/255,o=t[2]/255;e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,o=o>.04045?((o+.055)/1.055)**2.4:o/12.92;let n=e*.4124+r*.3576+o*.1805,i=e*.2126+r*.7152+o*.0722,s=e*.0193+r*.1192+o*.9505;return[n*100,i*100,s*100]};M.rgb.lab=function(t){let e=M.rgb.xyz(t),r=e[0],o=e[1],n=e[2];r/=95.047,o/=100,n/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,o=o>.008856?o**(1/3):7.787*o+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;let i=116*o-16,s=500*(r-o),a=200*(o-n);return[i,s,a]};M.hsl.rgb=function(t){let e=t[0]/360,r=t[1]/100,o=t[2]/100,n,i,s;if(r===0)return s=o*255,[s,s,s];o<.5?n=o*(1+r):n=o+r-o*r;let a=2*o-n,c=[0,0,0];for(let u=0;u<3;u++)i=e+1/3*-(u-1),i<0&&i++,i>1&&i--,6*i<1?s=a+(n-a)*6*i:2*i<1?s=n:3*i<2?s=a+(n-a)*(2/3-i)*6:s=a,c[u]=s*255;return c};M.hsl.hsv=function(t){let e=t[0],r=t[1]/100,o=t[2]/100,n=r,i=Math.max(o,.01);o*=2,r*=o<=1?o:2-o,n*=i<=1?i:2-i;let s=(o+r)/2,a=o===0?2*n/(i+n):2*r/(o+r);return[e,a*100,s*100]};M.hsv.rgb=function(t){let e=t[0]/60,r=t[1]/100,o=t[2]/100,n=Math.floor(e)%6,i=e-Math.floor(e),s=255*o*(1-r),a=255*o*(1-r*i),c=255*o*(1-r*(1-i));switch(o*=255,n){case 0:return[o,c,s];case 1:return[a,o,s];case 2:return[s,o,c];case 3:return[s,a,o];case 4:return[c,s,o];case 5:return[o,s,a]}};M.hsv.hsl=function(t){let e=t[0],r=t[1]/100,o=t[2]/100,n=Math.max(o,.01),i,s;s=(2-r)*o;let a=(2-r)*n;return i=r*n,i/=a<=1?a:2-a,i=i||0,s/=2,[e,i*100,s*100]};M.hwb.rgb=function(t){let e=t[0]/360,r=t[1]/100,o=t[2]/100,n=r+o,i;n>1&&(r/=n,o/=n);let s=Math.floor(6*e),a=1-o;i=6*e-s,(s&1)!==0&&(i=1-i);let c=r+i*(a-r),u,l,d;switch(s){default:case 6:case 0:u=a,l=c,d=r;break;case 1:u=c,l=a,d=r;break;case 2:u=r,l=a,d=c;break;case 3:u=r,l=c,d=a;break;case 4:u=c,l=r,d=a;break;case 5:u=a,l=r,d=c;break}return[u*255,l*255,d*255]};M.cmyk.rgb=function(t){let e=t[0]/100,r=t[1]/100,o=t[2]/100,n=t[3]/100,i=1-Math.min(1,e*(1-n)+n),s=1-Math.min(1,r*(1-n)+n),a=1-Math.min(1,o*(1-n)+n);return[i*255,s*255,a*255]};M.xyz.rgb=function(t){let e=t[0]/100,r=t[1]/100,o=t[2]/100,n,i,s;return n=e*3.2406+r*-1.5372+o*-.4986,i=e*-.9689+r*1.8758+o*.0415,s=e*.0557+r*-.204+o*1.057,n=n>.0031308?1.055*n**(1/2.4)-.055:n*12.92,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,n=Math.min(Math.max(0,n),1),i=Math.min(Math.max(0,i),1),s=Math.min(Math.max(0,s),1),[n*255,i*255,s*255]};M.xyz.lab=function(t){let e=t[0],r=t[1],o=t[2];e/=95.047,r/=100,o/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,o=o>.008856?o**(1/3):7.787*o+16/116;let n=116*r-16,i=500*(e-r),s=200*(r-o);return[n,i,s]};M.lab.xyz=function(t){let e=t[0],r=t[1],o=t[2],n,i,s;i=(e+16)/116,n=r/500+i,s=i-o/200;let a=i**3,c=n**3,u=s**3;return i=a>.008856?a:(i-16/116)/7.787,n=c>.008856?c:(n-16/116)/7.787,s=u>.008856?u:(s-16/116)/7.787,n*=95.047,i*=100,s*=108.883,[n,i,s]};M.lab.lch=function(t){let e=t[0],r=t[1],o=t[2],n;n=Math.atan2(o,r)*360/2/Math.PI,n<0&&(n+=360);let s=Math.sqrt(r*r+o*o);return[e,s,n]};M.lch.lab=function(t){let e=t[0],r=t[1],n=t[2]/360*2*Math.PI,i=r*Math.cos(n),s=r*Math.sin(n);return[e,i,s]};M.rgb.ansi16=function(t,e=null){let[r,o,n]=t,i=e===null?M.rgb.hsv(t)[2]:e;if(i=Math.round(i/50),i===0)return 30;let s=30+(Math.round(n/255)<<2|Math.round(o/255)<<1|Math.round(r/255));return i===2&&(s+=60),s};M.hsv.ansi16=function(t){return M.rgb.ansi16(M.hsv.rgb(t),t[2])};M.rgb.ansi256=function(t){let e=t[0],r=t[1],o=t[2];return e===r&&r===o?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(o/255*5)};M.ansi16.rgb=function(t){let e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let r=(~~(t>50)+1)*.5,o=(e&1)*r*255,n=(e>>1&1)*r*255,i=(e>>2&1)*r*255;return[o,n,i]};M.ansi256.rgb=function(t){if(t>=232){let i=(t-232)*10+8;return[i,i,i]}t-=16;let e,r=Math.floor(t/36)/5*255,o=Math.floor((e=t%36)/6)/5*255,n=e%6/5*255;return[r,o,n]};M.rgb.hex=function(t){let r=(((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255)).toString(16).toUpperCase();return"000000".substring(r.length)+r};M.hex.rgb=function(t){let e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let r=e[0];e[0].length===3&&(r=r.split("").map(a=>a+a).join(""));let o=parseInt(r,16),n=o>>16&255,i=o>>8&255,s=o&255;return[n,i,s]};M.rgb.hcg=function(t){let e=t[0]/255,r=t[1]/255,o=t[2]/255,n=Math.max(Math.max(e,r),o),i=Math.min(Math.min(e,r),o),s=n-i,a,c;return s<1?a=i/(1-s):a=0,s<=0?c=0:n===e?c=(r-o)/s%6:n===r?c=2+(o-e)/s:c=4+(e-r)/s,c/=6,c%=1,[c*360,s*100,a*100]};M.hsl.hcg=function(t){let e=t[1]/100,r=t[2]/100,o=r<.5?2*e*r:2*e*(1-r),n=0;return o<1&&(n=(r-.5*o)/(1-o)),[t[0],o*100,n*100]};M.hsv.hcg=function(t){let e=t[1]/100,r=t[2]/100,o=e*r,n=0;return o<1&&(n=(r-o)/(1-o)),[t[0],o*100,n*100]};M.hcg.rgb=function(t){let e=t[0]/360,r=t[1]/100,o=t[2]/100;if(r===0)return[o*255,o*255,o*255];let n=[0,0,0],i=e%1*6,s=i%1,a=1-s,c=0;switch(Math.floor(i)){case 0:n[0]=1,n[1]=s,n[2]=0;break;case 1:n[0]=a,n[1]=1,n[2]=0;break;case 2:n[0]=0,n[1]=1,n[2]=s;break;case 3:n[0]=0,n[1]=a,n[2]=1;break;case 4:n[0]=s,n[1]=0,n[2]=1;break;default:n[0]=1,n[1]=0,n[2]=a}return c=(1-r)*o,[(r*n[0]+c)*255,(r*n[1]+c)*255,(r*n[2]+c)*255]};M.hcg.hsv=function(t){let e=t[1]/100,r=t[2]/100,o=e+r*(1-e),n=0;return o>0&&(n=e/o),[t[0],n*100,o*100]};M.hcg.hsl=function(t){let e=t[1]/100,o=t[2]/100*(1-e)+.5*e,n=0;return o>0&&o<.5?n=e/(2*o):o>=.5&&o<1&&(n=e/(2*(1-o))),[t[0],n*100,o*100]};M.hcg.hwb=function(t){let e=t[1]/100,r=t[2]/100,o=e+r*(1-e);return[t[0],(o-e)*100,(1-o)*100]};M.hwb.hcg=function(t){let e=t[1]/100,o=1-t[2]/100,n=o-e,i=0;return n<1&&(i=(o-n)/(1-n)),[t[0],n*100,i*100]};M.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};M.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};M.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};M.gray.hsl=function(t){return[0,0,t[0]]};M.gray.hsv=M.gray.hsl;M.gray.hwb=function(t){return[0,100,t[0]]};M.gray.cmyk=function(t){return[0,0,0,t[0]]};M.gray.lab=function(t){return[t[0],0,0]};M.gray.hex=function(t){let e=Math.round(t[0]/100*255)&255,o=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(o.length)+o};M.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});var K$=O((TL,G$)=>{var Oc=pm();function _1(){let t={},e=Object.keys(Oc);for(let r=e.length,o=0;o<r;o++)t[e[o]]={distance:-1,parent:null};return t}function b1(t){let e=_1(),r=[t];for(e[t].distance=0;r.length;){let o=r.pop(),n=Object.keys(Oc[o]);for(let i=n.length,s=0;s<i;s++){let a=n[s],c=e[a];c.distance===-1&&(c.distance=e[o].distance+1,c.parent=o,r.unshift(a))}}return e}function $1(t,e){return function(r){return e(t(r))}}function x1(t,e){let r=[e[t].parent,t],o=Oc[e[t].parent][t],n=e[t].parent;for(;e[n].parent;)r.unshift(e[n].parent),o=$1(Oc[e[n].parent][n],o),n=e[n].parent;return o.conversion=r,o}G$.exports=function(t){let e=b1(t),r={},o=Object.keys(e);for(let n=o.length,i=0;i<n;i++){let s=o[i];e[s].parent!==null&&(r[s]=x1(s,e))}return r}});var Y$=O((OL,X$)=>{var fm=pm(),k1=K$(),$o={},w1=Object.keys(fm);function S1(t){let e=function(...r){let o=r[0];return o==null?o:(o.length>1&&(r=o),t(r))};return"conversion"in t&&(e.conversion=t.conversion),e}function E1(t){let e=function(...r){let o=r[0];if(o==null)return o;o.length>1&&(r=o);let n=t(r);if(typeof n=="object")for(let i=n.length,s=0;s<i;s++)n[s]=Math.round(n[s]);return n};return"conversion"in t&&(e.conversion=t.conversion),e}w1.forEach(t=>{$o[t]={},Object.defineProperty($o[t],"channels",{value:fm[t].channels}),Object.defineProperty($o[t],"labels",{value:fm[t].labels});let e=k1(t);Object.keys(e).forEach(o=>{let n=e[o];$o[t][o]=E1(n),$o[t][o].raw=S1(n)})});X$.exports=$o});var ox=O((PL,nx)=>{"use strict";var Q$=(t,e)=>(...r)=>`\x1B[${t(...r)+e}m`,ex=(t,e)=>(...r)=>{let o=t(...r);return`\x1B[${38+e};5;${o}m`},tx=(t,e)=>(...r)=>{let o=t(...r);return`\x1B[${38+e};2;${o[0]};${o[1]};${o[2]}m`},Pc=t=>t,rx=(t,e,r)=>[t,e,r],xo=(t,e,r)=>{Object.defineProperty(t,e,{get:()=>{let o=r();return Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0}),o},enumerable:!0,configurable:!0})},mm,ko=(t,e,r,o)=>{mm===void 0&&(mm=Y$());let n=o?10:0,i={};for(let[s,a]of Object.entries(mm)){let c=s==="ansi16"?"ansi":s;s===e?i[c]=t(r,n):typeof a=="object"&&(i[c]=t(a[e],n))}return i};function I1(){let t=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[r,o]of Object.entries(e)){for(let[n,i]of Object.entries(o))e[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},o[n]=e[n],t.set(i[0],i[1]);Object.defineProperty(e,r,{value:o,enumerable:!1})}return Object.defineProperty(e,"codes",{value:t,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",xo(e.color,"ansi",()=>ko(Q$,"ansi16",Pc,!1)),xo(e.color,"ansi256",()=>ko(ex,"ansi256",Pc,!1)),xo(e.color,"ansi16m",()=>ko(tx,"rgb",rx,!1)),xo(e.bgColor,"ansi",()=>ko(Q$,"ansi16",Pc,!0)),xo(e.bgColor,"ansi256",()=>ko(ex,"ansi256",Pc,!0)),xo(e.bgColor,"ansi16m",()=>ko(tx,"rgb",rx,!0)),e}Object.defineProperty(nx,"exports",{enumerable:!0,get:I1})});var sx=O((RL,ix)=>{"use strict";ix.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",o=e.indexOf(r+t),n=e.indexOf("--");return o!==-1&&(n===-1||o<n)}});var ux=O((jL,cx)=>{"use strict";var z1=require("os"),ax=require("tty"),Dt=sx(),{env:Ve}=process,Jr;Dt("no-color")||Dt("no-colors")||Dt("color=false")||Dt("color=never")?Jr=0:(Dt("color")||Dt("colors")||Dt("color=true")||Dt("color=always"))&&(Jr=1);"FORCE_COLOR"in Ve&&(Ve.FORCE_COLOR==="true"?Jr=1:Ve.FORCE_COLOR==="false"?Jr=0:Jr=Ve.FORCE_COLOR.length===0?1:Math.min(parseInt(Ve.FORCE_COLOR,10),3));function hm(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function gm(t,e){if(Jr===0)return 0;if(Dt("color=16m")||Dt("color=full")||Dt("color=truecolor"))return 3;if(Dt("color=256"))return 2;if(t&&!e&&Jr===void 0)return 0;let r=Jr||0;if(Ve.TERM==="dumb")return r;if(process.platform==="win32"){let o=z1.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in Ve)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(o=>o in Ve)||Ve.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in Ve)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ve.TEAMCITY_VERSION)?1:0;if(Ve.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Ve){let o=parseInt((Ve.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ve.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Ve.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ve.TERM)||"COLORTERM"in Ve?1:r}function T1(t){let e=gm(t,t&&t.isTTY);return hm(e)}cx.exports={supportsColor:T1,stdout:hm(gm(!0,ax.isatty(1))),stderr:hm(gm(!0,ax.isatty(2)))}});var dx=O((NL,lx)=>{"use strict";var O1=(t,e,r)=>{let o=t.indexOf(e);if(o===-1)return t;let n=e.length,i=0,s="";do s+=t.substr(i,o-i)+e+r,i=o+n,o=t.indexOf(e,i);while(o!==-1);return s+=t.substr(i),s},P1=(t,e,r,o)=>{let n=0,i="";do{let s=t[o-1]==="\r";i+=t.substr(n,(s?o-1:o)-n)+e+(s?`\r
|
|
24
24
|
`:`
|
|
25
|
-
`)+
|
|
26
|
-
`,
|
|
27
|
-
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function
|
|
28
|
-
`);return
|
|
29
|
-
`)}function
|
|
30
|
-
`)}function
|
|
25
|
+
`)+r,n=o+1,o=t.indexOf(`
|
|
26
|
+
`,n)}while(o!==-1);return i+=t.substr(n),i};lx.exports={stringReplaceAll:O1,stringEncaseCRLFWithFirstIndex:P1}});var gx=O((CL,hx)=>{"use strict";var R1=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,px=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,j1=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,N1=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,C1=new Map([["n",`
|
|
27
|
+
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function mx(t){let e=t[0]==="u",r=t[1]==="{";return e&&!r&&t.length===5||t[0]==="x"&&t.length===3?String.fromCharCode(parseInt(t.slice(1),16)):e&&r?String.fromCodePoint(parseInt(t.slice(2,-1),16)):C1.get(t)||t}function A1(t,e){let r=[],o=e.trim().split(/\s*,\s*/g),n;for(let i of o){let s=Number(i);if(!Number.isNaN(s))r.push(s);else if(n=i.match(j1))r.push(n[2].replace(N1,(a,c,u)=>c?mx(c):u));else throw new Error(`Invalid Chalk template style argument: ${i} (in style '${t}')`)}return r}function D1(t){px.lastIndex=0;let e=[],r;for(;(r=px.exec(t))!==null;){let o=r[1];if(r[2]){let n=A1(o,r[2]);e.push([o].concat(n))}else e.push([o])}return e}function fx(t,e){let r={};for(let n of e)for(let i of n.styles)r[i[0]]=n.inverse?null:i.slice(1);let o=t;for(let[n,i]of Object.entries(r))if(Array.isArray(i)){if(!(n in o))throw new Error(`Unknown Chalk style: ${n}`);o=i.length>0?o[n](...i):o[n]}return o}hx.exports=(t,e)=>{let r=[],o=[],n=[];if(e.replace(R1,(i,s,a,c,u,l)=>{if(s)n.push(mx(s));else if(c){let d=n.join("");n=[],o.push(r.length===0?d:fx(t,r)(d)),r.push({inverse:a,styles:D1(c)})}else if(u){if(r.length===0)throw new Error("Found extraneous } in Chalk template literal");o.push(fx(t,r)(n.join(""))),n=[],r.pop()}else n.push(l)}),o.push(n.join("")),r.length>0){let i=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?"":"s"} (\`}\`)`;throw new Error(i)}return o.join("")}});var dt=O((AL,xx)=>{"use strict";var es=ox(),{stdout:vm,stderr:_m}=ux(),{stringReplaceAll:M1,stringEncaseCRLFWithFirstIndex:U1}=dx(),{isArray:Rc}=Array,vx=["ansi","ansi","ansi256","ansi16m"],wo=Object.create(null),Z1=(t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=vm?vm.level:0;t.level=e.level===void 0?r:e.level},bm=class{constructor(e){return _x(e)}},_x=t=>{let e={};return Z1(e,t),e.template=(...r)=>$x(e.template,...r),Object.setPrototypeOf(e,jc.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},e.template.Instance=bm,e.template};function jc(t){return _x(t)}for(let[t,e]of Object.entries(es))wo[t]={get(){let r=Nc(this,$m(e.open,e.close,this._styler),this._isEmpty);return Object.defineProperty(this,t,{value:r}),r}};wo.visible={get(){let t=Nc(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:t}),t}};var bx=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let t of bx)wo[t]={get(){let{level:e}=this;return function(...r){let o=$m(es.color[vx[e]][t](...r),es.color.close,this._styler);return Nc(this,o,this._isEmpty)}}};for(let t of bx){let e="bg"+t[0].toUpperCase()+t.slice(1);wo[e]={get(){let{level:r}=this;return function(...o){let n=$m(es.bgColor[vx[r]][t](...o),es.bgColor.close,this._styler);return Nc(this,n,this._isEmpty)}}}}var L1=Object.defineProperties(()=>{},{...wo,level:{enumerable:!0,get(){return this._generator.level},set(t){this._generator.level=t}}}),$m=(t,e,r)=>{let o,n;return r===void 0?(o=t,n=e):(o=r.openAll+t,n=e+r.closeAll),{open:t,close:e,openAll:o,closeAll:n,parent:r}},Nc=(t,e,r)=>{let o=(...n)=>Rc(n[0])&&Rc(n[0].raw)?yx(o,$x(o,...n)):yx(o,n.length===1?""+n[0]:n.join(" "));return Object.setPrototypeOf(o,L1),o._generator=t,o._styler=e,o._isEmpty=r,o},yx=(t,e)=>{if(t.level<=0||!e)return t._isEmpty?"":e;let r=t._styler;if(r===void 0)return e;let{openAll:o,closeAll:n}=r;if(e.indexOf("\x1B")!==-1)for(;r!==void 0;)e=M1(e,r.close,r.open),r=r.parent;let i=e.indexOf(`
|
|
28
|
+
`);return i!==-1&&(e=U1(e,n,o,i)),o+e+n},ym,$x=(t,...e)=>{let[r]=e;if(!Rc(r)||!Rc(r.raw))return e.join(" ");let o=e.slice(1),n=[r.raw[0]];for(let i=1;i<r.length;i++)n.push(String(o[i-1]).replace(/[{}\\]/g,"\\$&"),String(r.raw[i]));return ym===void 0&&(ym=gx()),ym(t,n.join(""))};Object.defineProperties(jc.prototype,wo);var Cc=jc();Cc.supportsColor=vm;Cc.stderr=jc({level:_m?_m.level:0});Cc.stderr.supportsColor=_m;xx.exports=Cc});function wx(){let t=new Set;process.env.AIDE_DEBUG_HOOK==="1"&&t.add("hooks");let e=process.env.AIDE_DEBUG;if(!e)return t;let r=e.split(",").map(o=>o.trim()).filter(Boolean);for(let o of r){if(o==="all"||o==="1"){for(let n of kx)t.add(n);return t}kx.includes(o)&&t.add(o)}return t}function pt(t,e){wx().has(t)&&process.stderr.write(`[AIDE_DEBUG/${t}] ${e}
|
|
29
|
+
`)}function Pr(t,e){let r=e?` \u2014 ${e}`:"";process.stderr.write(`[AIDE_ERROR] ${t}${r}
|
|
30
|
+
`)}function Sx(t){return wx().has(t)}var kx,ts=g(()=>{"use strict";kx=["hooks","mcp","binding","recall"]});function F1(t){let e=t?.message??String(t);return/NODE_MODULE_VERSION/i.test(e)?{class:"abi-mismatch",hint:"reinstall aide-memory or run `npm rebuild libsql` in the install dir"}:/Cannot find module|MODULE_NOT_FOUND/i.test(e)?{class:"missing-module",hint:"reinstall aide-memory \u2014 the libsql platform package may be missing"}:/dlopen|wrong ELF class|invalid ELF header|image not found|symbol not found/i.test(e)?{class:"binary-incompatible",hint:"reinstall aide-memory \u2014 prebuilt binary may be wrong for this platform/arch"}:{class:"unknown",hint:"reinstall aide-memory; if the issue persists, file an issue with this stderr line"}}function q1(){if(xm)return xm;try{let t=require("libsql");return xm=t,pt("binding",`loaded lib=libsql node=${process.versions.node} abi=${process.versions.modules} platform=${process.platform}-${process.arch}`),t}catch(t){let{class:e,hint:r}=F1(t),o=t?.message??String(t);throw Pr(`aide-memory: failed to load native binding (libsql, ${e}): ${o}`,r),pt("binding",`load-failed lib=libsql class=${e} msg=${JSON.stringify(o)}`),t}}function Ex(t,e){let r=q1();return new r(t,e)}var xm,Ix=g(()=>{"use strict";ts();xm=null});function G1(t){try{return t.exec("CREATE VIRTUAL TABLE IF NOT EXISTS _fts5_probe USING fts5(x)"),t.exec("DROP TABLE IF EXISTS _fts5_probe"),!0}catch{return!1}}function zx(t){return G1(t)?(t.exec(V1),t.exec(H1),t.exec(J1),t.exec(B1),!0):!1}function Tx(t){t.prepare("SELECT COUNT(*) as c FROM memories").get().c===0||t.prepare("SELECT COUNT(*) as c FROM memories_fts").get().c>0||t.exec(`
|
|
31
31
|
INSERT INTO memories_fts(rowid, what, why, context_label)
|
|
32
32
|
SELECT id, what, why, context_label FROM memories
|
|
33
|
-
`)}function
|
|
33
|
+
`)}function Ox(t){if(!t||!t.trim())return null;let e=t.slice(0,500);if(e=e.replace(W1," "),e=e.replace(/\s+/g," ").trim(),!e)return null;let r=e.split(" ").filter(o=>o.length>0);return r.length===0?null:r.map(o=>`"${o}"`).join(" ")}var V1,H1,J1,B1,W1,Px=g(()=>{"use strict";V1=`
|
|
34
34
|
CREATE VIRTUAL TABLE IF NOT EXISTS memories_fts USING fts5(
|
|
35
35
|
what, why, context_label,
|
|
36
36
|
content=memories, content_rowid=id
|
|
37
37
|
);
|
|
38
|
-
`,
|
|
38
|
+
`,H1=`
|
|
39
39
|
CREATE TRIGGER IF NOT EXISTS memories_ai AFTER INSERT ON memories BEGIN
|
|
40
40
|
INSERT INTO memories_fts(rowid, what, why, context_label)
|
|
41
41
|
VALUES (new.id, new.what, new.why, new.context_label);
|
|
42
42
|
END;
|
|
43
|
-
`,
|
|
43
|
+
`,J1=`
|
|
44
44
|
CREATE TRIGGER IF NOT EXISTS memories_ad AFTER DELETE ON memories BEGIN
|
|
45
45
|
INSERT INTO memories_fts(memories_fts, rowid, what, why, context_label)
|
|
46
46
|
VALUES ('delete', old.id, old.what, old.why, old.context_label);
|
|
47
47
|
END;
|
|
48
|
-
`,
|
|
48
|
+
`,B1=`
|
|
49
49
|
CREATE TRIGGER IF NOT EXISTS memories_au AFTER UPDATE ON memories BEGIN
|
|
50
50
|
INSERT INTO memories_fts(memories_fts, rowid, what, why, context_label)
|
|
51
51
|
VALUES ('delete', old.id, old.what, old.why, old.context_label);
|
|
52
52
|
INSERT INTO memories_fts(rowid, what, why, context_label)
|
|
53
53
|
VALUES (new.id, new.what, new.why, new.context_label);
|
|
54
54
|
END;
|
|
55
|
-
`,
|
|
55
|
+
`,W1=/["*(){}[\]:^~!@#$%&+\\|<>=,;]/g});function X1(t,e){if(t.length!==e.length||t.length===0)return 0;let r=0,o=0,n=0;for(let s=0;s<t.length;s++)r+=t[s]*e[s],o+=t[s]*t[s],n+=e[s]*e[s];let i=Math.sqrt(o)*Math.sqrt(n);return i===0?0:r/i}function Y1(t){return Buffer.from(t.buffer,t.byteOffset,t.byteLength)}function Rx(t){if(t instanceof ArrayBuffer)return new Float32Array(t.slice(0));let e=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);return new Float32Array(e)}function Ac(t){t.exec(K1)}var K1,rs,ns,So,km=g(()=>{"use strict";K1=`
|
|
56
56
|
CREATE TABLE IF NOT EXISTS embeddings (
|
|
57
57
|
uuid TEXT PRIMARY KEY,
|
|
58
58
|
vector BLOB NOT NULL,
|
|
59
59
|
dimensions INTEGER NOT NULL
|
|
60
60
|
);
|
|
61
|
-
`;
|
|
61
|
+
`;rs=class{constructor(e="Xenova/bge-small-en-v1.5"){this.modelName=e;this.pipeline=null;this.ready=!1}async initialize(){try{let{pipeline:e,env:r}=await import("@huggingface/transformers"),o=await import("os"),n=await import("path");return r.cacheDir=n.join(o.homedir(),".cache","aide-memory","models"),this.pipeline=await e("feature-extraction",this.modelName,{dtype:"fp32"}),this.ready=!0,!0}catch{return this.ready=!1,!1}}isReady(){return this.ready}async generateEmbedding(e){if(!this.ready||!this.pipeline)return null;try{let r=await this.pipeline(e,{pooling:"mean",normalize:!0});return new Float32Array(r.data)}catch{return null}}},ns=class{constructor(e="nomic-embed-text",r="http://localhost:11434"){this.model=e;this.baseUrl=r;this.ready=!1}async initialize(){try{return(await fetch(`${this.baseUrl}/api/tags`)).ok?(this.ready=!0,!0):(this.ready=!1,!1)}catch{return this.ready=!1,!1}}isReady(){return this.ready}async generateEmbedding(e){if(!this.ready)return null;try{let r=await fetch(`${this.baseUrl}/api/embeddings`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:this.model,prompt:e})});if(!r.ok)return null;let o=await r.json();return!o.embedding||!Array.isArray(o.embedding)?null:new Float32Array(o.embedding)}catch{return null}}},So=class{constructor(e){this.preferredBackend=e;this.backend=null;this._ready=!1}async initialize(){if(this.preferredBackend)return await this.preferredBackend.initialize()?(this.backend=this.preferredBackend,this._ready=!0,!0):(this._ready=!1,!1);let e=new rs;if(await e.initialize())return this.backend=e,this._ready=!0,!0;let o=new ns;return await o.initialize()?(this.backend=o,this._ready=!0,!0):(this._ready=!1,!1)}isReady(){return this._ready}async generateEmbedding(e){return!this._ready||!this.backend?null:this.backend.generateEmbedding(e)}storeEmbedding(e,r,o){Ac(e);let n=Y1(o);e.prepare("INSERT OR REPLACE INTO embeddings (uuid, vector, dimensions) VALUES (?, ?, ?)").run(r,n,o.length)}getEmbedding(e,r){Ac(e);let o=e.prepare("SELECT vector FROM embeddings WHERE uuid = ?").get(r);return o?Rx(o.vector):null}removeEmbedding(e,r){return Ac(e),e.prepare("DELETE FROM embeddings WHERE uuid = ?").run(r).changes>0}async semanticSearch(e,r,o=10){if(!this._ready||!this.backend)return[];let n=await this.backend.generateEmbedding(r);return n?this.semanticSearchWithVector(e,n,o):[]}semanticSearchWithVector(e,r,o=10){Ac(e);let n=e.prepare("SELECT uuid, vector FROM embeddings").all(),i=[];for(let s of n){let a=Rx(s.vector);if(a.length!==r.length)continue;let c=X1(r,a);i.push({uuid:s.uuid,score:c})}return i.sort((s,a)=>a.score-s.score),i.slice(0,o)}}});var Nx,os,jx,Q1,eR,Dc,Cx=g(()=>{"use strict";Nx=C(require("crypto")),os=C(require("os")),jx=process.env.AIDE_TELEMETRY==="off"?"":"phc_ztrzpvbZQTa4ymkGxVdYZnFKiFFLyJMcf5zYUXVAqPzS",Q1="https://us.i.posthog.com",eR=`
|
|
62
62
|
CREATE TABLE IF NOT EXISTS analytics (
|
|
63
63
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
64
64
|
event TEXT NOT NULL,
|
|
@@ -68,7 +68,7 @@ CREATE TABLE IF NOT EXISTS analytics (
|
|
|
68
68
|
);
|
|
69
69
|
CREATE INDEX IF NOT EXISTS idx_analytics_event ON analytics(event);
|
|
70
70
|
CREATE INDEX IF NOT EXISTS idx_analytics_timestamp ON analytics(timestamp);
|
|
71
|
-
`,
|
|
71
|
+
`,Dc=class{constructor(e){this.eventBuffer=[];this.flushTimer=null;this.remoteDisabled=!1;this.db=e,this.init(),this.distinctId=Nx.default.createHash("sha256").update(`${os.default.hostname()}:${os.default.userInfo().username}`).digest("hex").slice(0,16)}init(){this.db.exec(eR)}disableRemote(){this.remoteDisabled=!0}logEvent(e,r,o){let n=new Date().toISOString();this.db.prepare("INSERT INTO analytics (event, value, tool, timestamp) VALUES (?, ?, ?, ?)").run(e,r??null,o??null,n),jx&&!this.remoteDisabled&&(this.eventBuffer.push({event:e,properties:{value:r??void 0,tool:o??void 0,platform:os.default.platform(),arch:os.default.arch(),node_version:process.version},timestamp:n}),this.eventBuffer.length>=10?this.flush():this.flushTimer||(this.flushTimer=setTimeout(()=>this.flush(),3e4)))}flush(){if(this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=null),this.eventBuffer.length===0)return;let e=this.eventBuffer.splice(0),r=JSON.stringify({api_key:jx,batch:e.map(o=>({event:o.event,properties:{...o.properties,distinct_id:this.distinctId,$ip:null,$geoip_disable:!0},timestamp:o.timestamp}))});fetch(`${Q1}/batch`,{method:"POST",headers:{"Content-Type":"application/json"},body:r}).catch(()=>{})}shutdown(){this.flush()}getEvents(e){let r=[],o=[];e?.event&&(r.push("event = ?"),o.push(e.event)),e?.since&&(r.push("timestamp >= ?"),o.push(e.since));let n="SELECT * FROM analytics";return r.length>0&&(n+=" WHERE "+r.join(" AND ")),n+=" ORDER BY timestamp DESC, id DESC",e?.limit&&(n+=" LIMIT ?",o.push(e.limit)),this.db.prepare(n).all(...o)}countEvents(e,r){let o=["event = ?"],n=[e];r&&(o.push("timestamp >= ?"),n.push(r));let i="SELECT COUNT(*) as count FROM analytics WHERE "+o.join(" AND ");return this.db.prepare(i).get(...n).count}getStats(){let r=this.db.prepare("SELECT COUNT(*) as count FROM memories WHERE 1=1").get().count,o=this.db.prepare("SELECT layer, COUNT(*) as count FROM memories WHERE 1=1 GROUP BY layer").all(),n={};for(let p of o)n[p.layer]=p.count;let s=this.db.prepare("SELECT what, layer, recalled_count FROM memories WHERE 1=1 AND recalled_count > 0 ORDER BY recalled_count DESC LIMIT 5").all().map(p=>({what:p.what,layer:p.layer,recalled_count:p.recalled_count})),a=this.db.prepare("SELECT source, COUNT(*) as count FROM memories WHERE 1=1 GROUP BY source").all(),c={};for(let p of a)c[p.source]=p.count;let u=new Date(Date.now()-30*864e5).toISOString(),d=this.db.prepare("SELECT COUNT(*) as count FROM memories WHERE 1=1 AND recalled_count = 0 AND created_at < ?").get(u).count;return{totalMemories:r,byLayer:n,mostRecalled:s,captureSourceBreakdown:c,staleCount:d}}prune(e){let r=new Date(Date.now()-e*864e5).toISOString();return this.db.prepare("DELETE FROM analytics WHERE timestamp < ?").run(r).changes}}});function Ux(t){let e=nt.default.resolve(t);return Mc.default.createHash("sha1").update(e).digest("hex").slice(0,12)}function nR(t){let e=Ux(t);return nt.default.join(wm.default.homedir(),".aide","projects",e,"memory.db")}function oR(){try{return(0,Mx.execSync)("git config user.name",{encoding:"utf-8"}).trim()}catch{return"unknown"}}var nt,wm,rt,Mc,Mx,Ax,Dx,tR,rR,$e,Ot=g(()=>{"use strict";Ix();nt=C(require("path")),wm=C(require("os")),rt=C(require("fs")),Mc=C(require("crypto")),Mx=require("child_process");Px();km();Cx();Ax=3,Dx=`
|
|
72
72
|
CREATE TABLE IF NOT EXISTS memories (
|
|
73
73
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
74
74
|
uuid TEXT NOT NULL UNIQUE,
|
|
@@ -94,13 +94,13 @@ CREATE UNIQUE INDEX IF NOT EXISTS idx_memories_uuid ON memories(uuid);
|
|
|
94
94
|
CREATE INDEX IF NOT EXISTS idx_memories_scope ON memories(scope);
|
|
95
95
|
CREATE INDEX IF NOT EXISTS idx_memories_layer ON memories(layer);
|
|
96
96
|
CREATE INDEX IF NOT EXISTS idx_memories_contributor ON memories(contributor);
|
|
97
|
-
`,
|
|
97
|
+
`,tR=`
|
|
98
98
|
CREATE TABLE IF NOT EXISTS meta (
|
|
99
99
|
key TEXT PRIMARY KEY,
|
|
100
100
|
value TEXT NOT NULL
|
|
101
101
|
);
|
|
102
|
-
`,
|
|
103
|
-
`;
|
|
102
|
+
`,rR={preferences:"preferences",technical:"technical",area_context:"area_context",guidelines:"guidelines"};$e=class{constructor(e){this._fts5Available=!1;this.embeddingService=null;this.analytics=null;this.telemetryEnabled=!0;this.memoriesDir=null;this.projectRoot=null;this.defaultShared=!0;if(this.defaultContributor=oR(),typeof e=="string")this.dbPath=nR(e);else if("projectRoot"in e){let o=e.projectRoot;this.projectRoot=o,this.memoriesDir=nt.default.join(o,".aide","memories");let n=Ux(o);this.dbPath=nt.default.join(wm.default.homedir(),".aide","projects",n,"memory.db"),this.ensureMemoryDirs()}else this.dbPath=e.dbPath;let r=nt.default.dirname(this.dbPath);if(rt.default.existsSync(r)||rt.default.mkdirSync(r,{recursive:!0}),this.db=Ex(this.dbPath),this.db.pragma("journal_mode = WAL"),this.db.pragma("foreign_keys = ON"),this.init(),this.analytics=new Dc(this.db),typeof e!="string"&&"projectRoot"in e)try{let o=nt.default.join(e.projectRoot,".aide","config.json");if(rt.default.existsSync(o)){let n=JSON.parse(rt.default.readFileSync(o,"utf-8"));n.telemetry?.enabled===!1&&(this.telemetryEnabled=!1,this.analytics?.disableRemote()),n.memories?.defaultShared===!1&&(this.defaultShared=!1);let i=n.contributor;typeof i=="string"&&i!=="auto"&&i.trim()!==""&&(this.defaultContributor=i);let s=n.embeddings?.backend??"auto",a=n.embeddings?.model??"auto";if(s==="none")this.embeddingService=null;else if(s==="transformers"||s==="ollama"){let c=a!=="auto"?a:void 0,u=s==="transformers"?new rs(c):new ns(c);this.embeddingService=new So(u)}}}catch{}this.memoriesDir&&this.rebuildCacheIfNeeded()}get fts5Available(){return this._fts5Available}getDatabase(){return this.db}ensureMemoryDirs(){if(!this.memoriesDir)return;let e=[nt.default.join(this.memoriesDir,"preferences","personal"),nt.default.join(this.memoriesDir,"preferences","shared"),nt.default.join(this.memoriesDir,"technical"),nt.default.join(this.memoriesDir,"area_context"),nt.default.join(this.memoriesDir,"guidelines")];for(let r of e)rt.default.existsSync(r)||rt.default.mkdirSync(r,{recursive:!0})}setEmbeddingService(e){this.embeddingService=e}getEmbeddingService(){return this.embeddingService}getAnalytics(){return this.analytics}logEvent(e,r,o){this.telemetryEnabled&&this.analytics&&this.analytics.logEvent(e,r,o)}init(){this.db.exec(tR);let e=this.db.prepare("SELECT value FROM meta WHERE key = ?").get("schema_version");(e?parseInt(e.value,10):0)<Ax?(this.db.exec("DROP TABLE IF EXISTS memories"),this.db.exec(Dx),this.db.prepare("INSERT OR REPLACE INTO meta (key, value) VALUES (?, ?)").run("schema_version",String(Ax))):this.db.exec(Dx),this._fts5Available=zx(this.db),this._fts5Available&&Tx(this.db)}getMemoryDir(e,r){if(!this.memoriesDir)throw new Error("File I/O not available in dbPath-only mode");return e==="preferences"?nt.default.join(this.memoriesDir,"preferences",r?"shared":"personal"):nt.default.join(this.memoriesDir,rR[e])}getMemoryFilePath(e,r,o){return nt.default.join(this.getMemoryDir(r,o),`${e}.json`)}toMemoryFile(e){return{id:e.id,uuid:e.uuid,layer:e.layer,what:e.what,why:e.why,scope:e.scope,context_label:e.context_label,contributor:e.contributor,tags:e.tags,source:e.source,shared:e.shared,priority:e.priority,generated_by:e.generated_by,derived_from:e.derived_from,created_at:e.created_at,updated_at:e.updated_at}}writeMemoryFile(e){if(!this.memoriesDir)return;let r=this.getMemoryFilePath(e.uuid,e.layer,e.shared),o=r+".tmp",n=JSON.stringify(this.toMemoryFile(e),null,2)+`
|
|
103
|
+
`;rt.default.writeFileSync(o,n,"utf-8"),rt.default.renameSync(o,r)}deleteMemoryFile(e,r,o){if(!this.memoriesDir)return;let n=this.getMemoryFilePath(e,r,o);rt.default.existsSync(n)&&rt.default.unlinkSync(n)}hashMemoriesDir(){if(!this.memoriesDir)return"";let e=Mc.default.createHash("sha1"),r=this.collectJsonFiles();for(let o of r.sort()){let n=rt.default.statSync(o);e.update(o+":"+n.mtimeMs+":"+n.size)}return e.digest("hex")}collectJsonFiles(){if(!this.memoriesDir||!rt.default.existsSync(this.memoriesDir))return[];let e=[],r=o=>{if(!rt.default.existsSync(o))return;let n=rt.default.readdirSync(o,{withFileTypes:!0});for(let i of n){let s=nt.default.join(o,i.name);i.isDirectory()?r(s):i.name.endsWith(".json")&&!i.name.endsWith(".tmp")&&e.push(s)}};return r(this.memoriesDir),e}rebuildCacheIfNeeded(){if(!this.memoriesDir)return;let e=this.hashMemoriesDir();this.db.prepare("SELECT value FROM meta WHERE key = ?").get("dir_hash")?.value!==e&&(this.rebuildCache(),this.db.prepare("INSERT OR REPLACE INTO meta (key, value) VALUES (?, ?)").run("dir_hash",e))}rebuildCache(){if(!this.memoriesDir)return;let e=this.collectJsonFiles(),r=new Set;this.db.transaction(()=>{for(let i of e)try{let s=rt.default.readFileSync(i,"utf-8"),a=JSON.parse(s);if(!a.uuid||!a.layer||!a.what)continue;if(r.add(a.uuid),this.db.prepare("SELECT id, recalled_count, last_recalled_at FROM memories WHERE uuid = ?").get(a.uuid))this.db.prepare(`
|
|
104
104
|
UPDATE memories SET layer = ?, what = ?, why = ?, scope = ?, context_label = ?,
|
|
105
105
|
contributor = ?, tags = ?, source = ?, shared = ?, priority = ?, generated_by = ?,
|
|
106
106
|
derived_from = ?, created_at = ?, updated_at = ?
|
|
@@ -109,39 +109,40 @@ CREATE TABLE IF NOT EXISTS meta (
|
|
|
109
109
|
INSERT INTO memories (id, uuid, layer, what, why, scope, context_label, contributor,
|
|
110
110
|
tags, source, shared, priority, generated_by, derived_from, created_at, updated_at)
|
|
111
111
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
112
|
-
`).run(a.id,a.uuid,a.layer,a.what,a.why??null,a.scope??null,a.context_label??null,a.contributor,JSON.stringify(a.tags??[]),a.source??"conversation",a.shared?1:0,a.priority??"normal",a.generated_by?JSON.stringify(a.generated_by):null,a.derived_from?JSON.stringify(a.derived_from):null,a.created_at,a.updated_at);else{let
|
|
112
|
+
`).run(a.id,a.uuid,a.layer,a.what,a.why??null,a.scope??null,a.context_label??null,a.contributor,JSON.stringify(a.tags??[]),a.source??"conversation",a.shared?1:0,a.priority??"normal",a.generated_by?JSON.stringify(a.generated_by):null,a.derived_from?JSON.stringify(a.derived_from):null,a.created_at,a.updated_at);else{let u=this.db.prepare(`
|
|
113
113
|
INSERT INTO memories (uuid, layer, what, why, scope, context_label, contributor,
|
|
114
114
|
tags, source, shared, priority, generated_by, derived_from, created_at, updated_at)
|
|
115
115
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
116
|
-
`).run(a.uuid,a.layer,a.what,a.why??null,a.scope??null,a.context_label??null,a.contributor,JSON.stringify(a.tags??[]),a.source??"conversation",a.shared?1:0,a.priority??"normal",a.generated_by?JSON.stringify(a.generated_by):null,a.derived_from?JSON.stringify(a.derived_from):null,a.created_at,a.updated_at);try{let
|
|
116
|
+
`).run(a.uuid,a.layer,a.what,a.why??null,a.scope??null,a.context_label??null,a.contributor,JSON.stringify(a.tags??[]),a.source??"conversation",a.shared?1:0,a.priority??"normal",a.generated_by?JSON.stringify(a.generated_by):null,a.derived_from?JSON.stringify(a.derived_from):null,a.created_at,a.updated_at);try{let l=Number(u.lastInsertRowid),d=this.get(l);d&&this.writeMemoryFile(d)}catch{}}}catch{}let n=this.db.prepare("SELECT uuid FROM memories").all();for(let i of n)r.has(i.uuid)||this.db.prepare("DELETE FROM memories WHERE uuid = ?").run(i.uuid)})()}updateDirHash(){if(!this.memoriesDir)return;let e=this.hashMemoriesDir();this.db.prepare("INSERT OR REPLACE INTO meta (key, value) VALUES (?, ?)").run("dir_hash",e)}add(e){let r=new Date().toISOString(),o=Mc.default.randomUUID(),n=e.contributor??this.defaultContributor,i=e.tags??[],s=e.shared??this.defaultShared,a=e.derived_from?JSON.stringify(e.derived_from):null,c=e.generated_by?JSON.stringify(e.generated_by):null,u=e.priority??"normal",l=this.db.prepare(`
|
|
117
117
|
INSERT INTO memories (uuid, layer, what, why, scope, context_label, contributor,
|
|
118
118
|
tags, source, shared, priority, generated_by, derived_from, created_at, updated_at)
|
|
119
119
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
120
|
-
`).run(
|
|
120
|
+
`).run(o,e.layer,e.what,e.why??null,e.scope??null,e.context_label??null,n,JSON.stringify(i),e.source??"conversation",s?1:0,u,c,a,r,r),d=this.get(Number(l.lastInsertRowid));if(this.logEvent("memory_stored",e.layer),this.memoriesDir&&(this.writeMemoryFile(d),this.updateDirHash()),this.embeddingService?.isReady()){let p=[d.what,d.why,d.context_label].filter(Boolean).join(" ");this.embeddingService.generateEmbedding(p).then(f=>{f&&this.embeddingService&&this.embeddingService.storeEmbedding(this.db,d.uuid,f)}).catch(()=>{})}return d}get(e){let r=this.db.prepare("SELECT * FROM memories WHERE id = ?").get(e);return r?this.rowToMemory(r):null}getByUuid(e){let r=this.db.prepare("SELECT * FROM memories WHERE uuid = ?").get(e);return r?this.rowToMemory(r):null}list(e){let r=[],o=[];e?.layer&&(r.push("layer = ?"),o.push(e.layer)),e?.scope&&(r.push("scope = ?"),o.push(e.scope)),e?.contributor&&(r.push("contributor = ?"),o.push(e.contributor)),e?.priority&&(r.push("priority = ?"),o.push(e.priority));let n="SELECT * FROM memories";return r.length>0&&(n+=" WHERE "+r.join(" AND ")),n+=" ORDER BY created_at DESC, id DESC",e?.limit&&(n+=" LIMIT ?",o.push(e.limit)),this.db.prepare(n).all(...o).map(s=>this.rowToMemory(s))}update(e,r){let o=this.get(e);if(!o)return null;let n=[],i=[];for(let[c,u]of Object.entries(r))u!==void 0&&(c==="tags"?(n.push("tags = ?"),i.push(JSON.stringify(u))):c==="generated_by"?(n.push("generated_by = ?"),i.push(u?JSON.stringify(u):null)):c==="shared"?(n.push("shared = ?"),i.push(u?1:0)):(n.push(`${c} = ?`),i.push(u)));if(n.length===0)return o;let s=new Date().toISOString();n.push("updated_at = ?"),i.push(s),i.push(e),this.db.prepare(`UPDATE memories SET ${n.join(", ")} WHERE id = ?`).run(...i);let a=this.get(e);if(this.logEvent("memory_updated",a.layer),this.memoriesDir&&(r.shared!==void 0&&r.shared!==o.shared&&this.deleteMemoryFile(o.uuid,o.layer,o.shared),this.writeMemoryFile(a),this.updateDirHash()),this.embeddingService?.isReady()&&(r.what!==void 0||r.why!==void 0||r.context_label!==void 0)){let c=[a.what,a.why,a.context_label].filter(Boolean).join(" ");this.embeddingService.generateEmbedding(c).then(u=>{u&&this.embeddingService&&this.embeddingService.storeEmbedding(this.db,a.uuid,u)}).catch(()=>{})}return a}remove(e){let r=this.get(e);if(!r)return!1;this.logEvent("memory_deleted",r.layer);let o=this.db.prepare("DELETE FROM memories WHERE id = ?").run(e);if(o.changes>0&&this.memoriesDir&&(this.deleteMemoryFile(r.uuid,r.layer,r.shared),this.updateDirHash()),o.changes>0&&this.embeddingService)try{this.embeddingService.removeEmbedding(this.db,r.uuid)}catch{}return o.changes>0}removeByUuid(e){let r=this.getByUuid(e);return r?this.remove(r.id):!1}recordRecall(e){if(e.length===0)return;let r=new Date().toISOString(),o=this.db.prepare("UPDATE memories SET recalled_count = recalled_count + 1, last_recalled_at = ? WHERE id = ?");this.db.transaction(()=>{for(let i of e)o.run(r,i)})(),this.logEvent("memory_recalled",String(e.length))}count(e){let r=[],o=[];e?.layer&&(r.push("layer = ?"),o.push(e.layer)),e?.contributor&&(r.push("contributor = ?"),o.push(e.contributor));let n="SELECT COUNT(*) as count FROM memories";return r.length>0&&(n+=" WHERE "+r.join(" AND ")),this.db.prepare(n).get(...o).count}search(e,r){let o=r?.mode??"auto",n,i;if(o==="semantic")n=[],i="semantic";else if(o==="keyword")if(this._fts5Available){let s=this.searchFts5(e,r);n=s.length>0?s:this.searchLike(e,r),i=s.length>0?"fts5":"like"}else n=this.searchLike(e,r),i="like";else if(this._fts5Available){let s=this.searchFts5(e,r);s.length>0?(n=s,i="fts5"):(n=this.searchLike(e,r),i="like")}else n=this.searchLike(e,r),i="like";return this.logEvent("search_performed",i),n}searchFts5(e,r){let o=Ox(e);if(o===null)return[];let n=r?.limit??50,i=`
|
|
121
121
|
SELECT m.* FROM memories m
|
|
122
122
|
INNER JOIN (
|
|
123
123
|
SELECT rowid, rank FROM memories_fts WHERE memories_fts MATCH ?
|
|
124
124
|
ORDER BY rank
|
|
125
125
|
) fts ON m.id = fts.rowid
|
|
126
|
-
`,i=[r],a=[];return t?.layer&&(a.push("m.layer = ?"),i.push(t.layer)),a.length>0&&(s+=" WHERE "+a.join(" AND ")),s+=" ORDER BY fts.rank",s+=" LIMIT ?",i.push(o),this.db.prepare(s).all(...i).map(l=>this.rowToMemory(l))}searchLike(e,t){if(!e||!e.trim())return[];let r=["(what LIKE ? OR why LIKE ?)"],o=`%${e}%`,s=[o,o];t?.layer&&(r.push("layer = ?"),s.push(t.layer));let i="SELECT * FROM memories WHERE "+r.join(" AND ");i+=" ORDER BY created_at DESC, id DESC";let a=t?.limit??50;i+=" LIMIT ?",s.push(a);let l=this.db.prepare(i).all(...s).map(u=>this.rowToMemory(u));return l.length<3&&this.embeddingService?.isReady(),l}async searchWithEmbeddings(e,t){let r=t?.limit??50,o=t?.mode??"auto";if(o==="semantic"){if(!this.embeddingService?.isReady())return[];try{let i=await this.embeddingService.semanticSearch(this.db,e,r),a=[];for(let c of i){if(c.score<.3)continue;let l=this.getByUuid(c.uuid);if(l&&!(t?.layer&&l.layer!==t.layer)&&(a.push(l),a.length>=r))break}return this.logEvent("search_performed","semantic"),a}catch{return[]}}if(o==="keyword")return this.search(e,t);let s=this.search(e,t);if(s.length<3&&this.embeddingService?.isReady())try{let i=await this.embeddingService.semanticSearch(this.db,e,r),a=new Set(s.map(c=>c.id));for(let c of i){if(c.score<.3)continue;let l=this.getByUuid(c.uuid);if(l&&!a.has(l.id)&&!(t?.layer&&l.layer!==t.layer)&&(s.push(l),a.add(l.id),s.length>=r))break}}catch{}return s}pruneOld(e){let t=new Date(Date.now()-e*864e5).toISOString();if(this.memoriesDir){let o=this.db.prepare("SELECT uuid, layer, shared FROM memories WHERE created_at < ?").all(t);for(let s of o)this.deleteMemoryFile(s.uuid,s.layer,s.shared===1)}let r=this.db.prepare("DELETE FROM memories WHERE created_at < ?").run(t);return this.memoriesDir&&this.updateDirHash(),r.changes}close(){this.analytics&&this.analytics.shutdown(),this.db.close()}getProjectRoot(){return this.projectRoot}get hasFileStorage(){return this.memoriesDir!==null}get memoriesPath(){return this.memoriesDir}rowToMemory(e){return{id:e.id,uuid:e.uuid,layer:e.layer,what:e.what,why:e.why,scope:e.scope,context_label:e.context_label,contributor:e.contributor,tags:e.tags?JSON.parse(e.tags):[],source:e.source,shared:e.shared===1,priority:e.priority==="always"?"always":"normal",generated_by:e.generated_by?JSON.parse(e.generated_by):null,derived_from:e.derived_from?JSON.parse(e.derived_from):null,created_at:e.created_at,updated_at:e.updated_at,recalled_count:e.recalled_count,last_recalled_at:e.last_recalled_at}}}});var Rt,Cr=T(()=>{Rt={"hooks.read.maxBlocks":{value:1,public:!0,pro:!1,description:"Max pre-read hard-blocks per file path per session. 0 disables the pre-read hook entirely. 1 is the default and fires a block on the first read of each file that has scoped memories."},"hooks.edit.maxBlocks":{value:1,public:!0,pro:!1,description:"Max pre-edit hard-blocks per file path per session. 0 disables the pre-edit hook entirely. 1 is the default."},"hooks.stop.schedule":{value:[{until:9,every:3},{until:29,every:5},{every:10}],public:!0,pro:!1,description:"Phased interval schedule for the Stop hook's 'worth remembering?' nudge. Each entry = {until, every}. Default ramps from every-3-turns for first 9 turns \u2192 every-5 for turns 10-29 \u2192 every-10 afterwards."},"hooks.search.mode":{value:"soft",public:!0,pro:!1,description:"Pre-search hook mode: 'off' (no nudge), 'soft' (additionalContext only, default), 'block' (hard decision:block envelope)."},"hooks.correction.enabled":{value:!0,public:!0,pro:!1,description:"Enable UserPromptSubmit correction detection. When true, messages like 'no, use X instead' trigger a nudge to call aide_remember."},"hooks.correction.escalate":{value:"off",public:!0,pro:!1,description:"When a correction is detected, optionally write a correction-pending flag so the next Stop fire reminds the agent if the correction wasn't stored. 'off' (default) \u2014 never reminds; correction surfaces only as the soft UserPromptSubmit hint at detection time. 'block' \u2014 flag is written and the next Stop fires decision:block with the reminder, regardless of hooks.stop.mode. Master switch: hooks.correction.enabled=false disables the entire correction system including this. (A 'soft' value existed in spec drafts but was dropped \u2014 Claude Code's Stop hook protocol doesn't accept hookSpecificOutput.additionalContext, so a soft Stop emit is impossible. Use the always-on UserPromptSubmit soft hint as the soft channel; escalate to 'block' only when you want an explicit follow-up reminder.)"},"hooks.stop.mode":{value:"block",public:!0,pro:!1,description:"How the scheduled Stop checkpoint surfaces. 'block' (default) uses decision:block + a softened reason prompt + chrome systemMessage. The Claude Code TUI collapses the 'Stop hook error:' label behind ctrl+o when systemMessage is present, so the brand chrome is the primary visible line. 'off' skips the scheduled checkpoint entirely (zero Stop noise). Frequency is still controlled by hooks.stop.schedule. (A 'soft' mode existed in spec drafts but was dropped \u2014 Claude Code's Stop hook protocol doesn't accept hookSpecificOutput.additionalContext, so 'block' is the only way to deliver text to the agent on Stop.) When a correction-pending flag is set and hooks.correction.escalate='block', that branch wins and the scheduled checkpoint is skipped that turn."},"hooks.precompact.mode":{value:"cleanup",public:!0,pro:!1,description:"PreCompact hook behavior: 'off' preserves tracking files across compaction; 'cleanup' (default) clears recalled-paths/stop-count/correction-pending so the post-compact turn re-blocks cleanly."},"hooks.visible":{value:!0,public:!0,pro:!1,description:"Surface user-facing systemMessage lines when hooks fire (soft recalls, correction detected, session-start injection, Stop checkpoints, etc). Default true so users can see what aide-memory is doing. Set to false to hide all aide-memory systemMessages \u2014 hooks still function (context injection + block enforcement unchanged). Does not affect what Claude sees."},"recall.limit":{value:20,public:!0,pro:!1,description:"Max memories returned per aide_recall call before layer-diversity balancing applies."},"recall.ensureLayerDiversity":{value:!0,public:!0,pro:!1,description:"If true, recall results are swapped to surface under-represented layers up to recall.layerDiversityMinLimit. Ensures each enabled layer gets at least some representation instead of the top-scoring one dominating."},"recall.layerDiversityMinLimit":{value:5,public:!0,pro:!1,description:"Minimum total results below which layer diversity swap kicks in. Above this threshold, natural ranking wins."},"recall.minScopeDepth":{value:1,public:!0,pro:!1,description:"Minimum fixed-prefix segment count a scope needs to surface via per-file path-recall. Scopes below this threshold surface only at SessionStart injection instead. Think of it as 'how specific must a scope be to show up when I open a file?' Default 1 is permissive \u2014 any scope with \u22651 segment (e.g. 'src/**', 'pages/**', 'packages/**') counts. Works across project shapes (src-wrapped, flat Next.js, deep monorepos). Bump to 2 if you have many broad scopes and want per-file recall quieter (broad scopes still surface at SessionStart). Bump to 3+ for very strict per-file recall."},"injection.enabled":{value:!0,public:!0,pro:!1,description:"Master switch for SessionStart dynamic injection. When true (default), the sessionStart handler loads + injects preferences / guidelines / priority:always memories into the agent's starting context; when false, the handler short-circuits before any SQLite read or template render \u2014 zero per-turn overhead from dynamic injection. The rules file still ships (static content) but carries no memory-derived content. Granular per-layer knobs (injection.preferences, injection.guidelines, etc.) only apply when this master switch is true. Flip to false if you want aide-memory's hooks + MCP tools without any session-start context injection."},"injection.preferences":{value:15,public:!0,pro:!1,description:"Max preferences injected at SessionStart. 0/false disables; number = hard cap; 'all' = every preference. Default 15 matches spec memory #297 ('top 15 most-recalled preferences'). Only honored when injection.enabled is true."},"injection.excludeScopedPreferences":{value:!1,public:!0,pro:!1,description:"If true, SessionStart injection skips preferences with a non-null scope \u2014 they surface via Read/Edit path hooks when the agent touches matching paths. Default false preserves current 'inject all preferences regardless of scope' behavior. Set to true for tighter SessionStart token usage when you have many scoped preferences. (NB: renamed from `injection.preferences.excludeScoped` to avoid key collision with `injection.preferences` which is a scalar limit, not an object.)"},"injection.technical":{value:!1,public:!0,pro:!1,description:"Inject technical-layer memories at SessionStart? Default false \u2014 technical context should surface via path hooks when relevant. Set to a number to cap, 'all' for unlimited, true for enabled-with-no-cap."},"injection.area_context":{value:!1,public:!0,pro:!1,description:"Inject area_context-layer memories at SessionStart? Default false \u2014 area context by definition is area-specific and should surface via path hooks."},"injection.guidelines":{value:"all",public:!0,pro:!1,description:"Inject guidelines at SessionStart. 'all' (default) injects every guideline regardless of scope \u2014 guidelines apply broadly so early visibility matters. Set to a number for a cap, or false to disable."},"injection.priorityAlwaysOverride":{value:!0,public:!0,pro:!1,description:"When true (default), any memory with priority='always' is injected at SessionStart regardless of layer-specific injection settings. User-marked 'always' memories surface in the ## Always section (rendered first since 0.4.3 so they survive char-cap truncation)."},"injection.maxChars":{value:1200,public:!0,pro:!1,description:"Overall character cap for the combined SessionStart injection (preferences + technical + area_context + guidelines + always). Applied after all layer sections are concatenated; truncates with '...truncated' suffix. Bump to 2000+ for richer context, drop to 600 for token-conscious sessions. Default 1200 matches the pre-0.4.3 hard-coded MAX_INJECT_CHARS constant."},"memories.hideFromGrep":{value:!0,public:!0,pro:!1,description:"Add an aide-memory-managed block to .ignore so grep/ripgrep/etc skip .aide/memories/ by default. Flipping this live triggers drift-repair on the next hook fire."},"memories.softening.threshold":{value:10,public:!0,pro:!1,description:"Total-memory count below which pre-read/pre-edit hard blocks become soft additionalContext nudges. Keeps small projects from feeling hostile. Default 10 \u2014 once you have 10+ total memories, hard blocking resumes on first-touch."},"memories.defaultShared":{value:!0,public:!0,pro:!1,description:"Default `shared` flag for new memories when the caller doesn't pass one. When true (default), aide_remember without an explicit shared param writes to `.aide/memories/preferences/shared/` (committed to repo). When false, defaults to `personal/` (gitignored). Per-call `shared: true|false` always overrides this default. Flip to false if you want personal-by-default and explicit opt-in for shared memories."}}});function Se(){return ba}function _a(n,e){let t=n;for(let r of e){if(t==null||typeof t!="object"||Array.isArray(t)||!Object.prototype.hasOwnProperty.call(t,r))return!1;t=t[r]}return!0}function wa(n,e){let t=n;for(let r of e)t=t[r];return t}function q(n,e){let r=Se()[e];if(!r)return;let o=r.value;if(r.public!==!0||!n)return o;let s=Eo.default.join(n,".aide","config.json");if(!Ar.default.existsSync(s))return o;let i;try{i=JSON.parse(Ar.default.readFileSync(s,"utf8"))}catch{return o}let a=e.split(".");return _a(i,a)?wa(i,a):o}function vo(){let n=Se(),e={};for(let[t,r]of Object.entries(n))r.public===!0&&(e[t]=r.value);return e}function ko(n){let e={};for(let[t,r]of Object.entries(n)){let o=t.split("."),s=e;for(let i=0;i<o.length-1;i++){let a=o[i],c=s[a];(!c||typeof c!="object"||Array.isArray(c))&&(s[a]={}),s=s[a]}s[o[o.length-1]]=r}return e}var Ar,Eo,ba,tt=T(()=>{"use strict";Ar=g(require("fs")),Eo=g(require("path"));Cr();ba=Rt});function Nt(n,e,t,r){if(t===!1||t===0)return[];let o=n.list({layer:e});return e==="preferences"?(q(r,"injection.excludeScopedPreferences")===!0&&(o=o.filter(i=>!i.scope||i.scope==="project")),o.sort((i,a)=>{let c=i.recalled_count??0,l=a.recalled_count??0;return l!==c?l-c:(a.updated_at||"").localeCompare(i.updated_at||"")})):o.sort((s,i)=>(i.updated_at||"").localeCompare(s.updated_at||"")),t==="all"?o:typeof t=="number"&&t>0?o.slice(0,t):o}function $t(n,e){if(!(q(n,"injection.enabled")??!0))return{content:"",injectedIds:[],truncated:!1};let r=q(n,"injection.preferences")??15,o=q(n,"injection.technical")??!1,s=q(n,"injection.area_context")??!1,i=q(n,"injection.guidelines")??"all",a=q(n,"injection.priorityAlwaysOverride")??!0,c=Number(q(n,"injection.maxChars")??1200),l=Nt(e,"preferences",r,n),u=Nt(e,"technical",o,n),d=Nt(e,"area_context",s,n),f=Nt(e,"guidelines",i,n),y=a?e.list({priority:"always"}):[],h=[],w=new Set,E=(k,H)=>{for(let I of k){let ce=I.uuid||String(I.id);w.has(ce)||(w.add(ce),H.push(I.what),h.push(I.id))}},p={preferences:[],technical:[],area_context:[],guidelines:[],always:[]};if(E(l,p.preferences),E(u,p.technical),E(d,p.area_context),E(f,p.guidelines),E(y,p.always),p.preferences.length+p.technical.length+p.area_context.length+p.guidelines.length+p.always.length===0)return{content:"",injectedIds:[],truncated:!1};let m=[];if(p.always.length>0){m.push("## Always");for(let k of p.always)m.push(`- ${k}`)}if(p.preferences.length>0){m.push("## Session Preferences");for(let k of p.preferences)m.push(`- ${k}`)}if(p.technical.length>0){m.push("## Technical Context");for(let k of p.technical)m.push(`- ${k}`)}if(p.area_context.length>0){m.push("## Area Context");for(let k of p.area_context)m.push(`- ${k}`)}if(p.guidelines.length>0){m.push("## Guidelines");for(let k of p.guidelines)m.push(`- ${k}`)}let S=m.join(`
|
|
127
|
-
`),
|
|
128
|
-
|
|
129
|
-
`,"
|
|
130
|
-
${
|
|
131
|
-
${
|
|
132
|
-
|
|
126
|
+
`,s=[o],a=[];return r?.layer&&(a.push("m.layer = ?"),s.push(r.layer)),a.length>0&&(i+=" WHERE "+a.join(" AND ")),i+=" ORDER BY fts.rank",i+=" LIMIT ?",s.push(n),this.db.prepare(i).all(...s).map(u=>this.rowToMemory(u))}searchLike(e,r){if(!e||!e.trim())return[];let o=["(what LIKE ? OR why LIKE ?)"],n=`%${e}%`,i=[n,n];r?.layer&&(o.push("layer = ?"),i.push(r.layer));let s="SELECT * FROM memories WHERE "+o.join(" AND ");s+=" ORDER BY created_at DESC, id DESC";let a=r?.limit??50;s+=" LIMIT ?",i.push(a);let u=this.db.prepare(s).all(...i).map(l=>this.rowToMemory(l));return u.length<3&&this.embeddingService?.isReady(),u}async searchWithEmbeddings(e,r){let o=r?.limit??50,n=r?.mode??"auto";if(n==="semantic"){if(!this.embeddingService?.isReady())return[];try{let s=await this.embeddingService.semanticSearch(this.db,e,o),a=[];for(let c of s){if(c.score<.3)continue;let u=this.getByUuid(c.uuid);if(u&&!(r?.layer&&u.layer!==r.layer)&&(a.push(u),a.length>=o))break}return this.logEvent("search_performed","semantic"),a}catch{return[]}}if(n==="keyword")return this.search(e,r);let i=this.search(e,r);if(i.length<3&&this.embeddingService?.isReady())try{let s=await this.embeddingService.semanticSearch(this.db,e,o),a=new Set(i.map(c=>c.id));for(let c of s){if(c.score<.3)continue;let u=this.getByUuid(c.uuid);if(u&&!a.has(u.id)&&!(r?.layer&&u.layer!==r.layer)&&(i.push(u),a.add(u.id),i.length>=o))break}}catch{}return i}pruneOld(e){let r=new Date(Date.now()-e*864e5).toISOString();if(this.memoriesDir){let n=this.db.prepare("SELECT uuid, layer, shared FROM memories WHERE created_at < ?").all(r);for(let i of n)this.deleteMemoryFile(i.uuid,i.layer,i.shared===1)}let o=this.db.prepare("DELETE FROM memories WHERE created_at < ?").run(r);return this.memoriesDir&&this.updateDirHash(),o.changes}close(){this.analytics&&this.analytics.shutdown(),this.db.close()}getProjectRoot(){return this.projectRoot}get hasFileStorage(){return this.memoriesDir!==null}get memoriesPath(){return this.memoriesDir}rowToMemory(e){return{id:e.id,uuid:e.uuid,layer:e.layer,what:e.what,why:e.why,scope:e.scope,context_label:e.context_label,contributor:e.contributor,tags:e.tags?JSON.parse(e.tags):[],source:e.source,shared:e.shared===1,priority:e.priority==="always"?"always":"normal",generated_by:e.generated_by?JSON.parse(e.generated_by):null,derived_from:e.derived_from?JSON.parse(e.derived_from):null,created_at:e.created_at,updated_at:e.updated_at,recalled_count:e.recalled_count,last_recalled_at:e.last_recalled_at}}}});var Uc,Sm=g(()=>{Uc={"hooks.read.maxBlocks":{value:1,public:!0,pro:!1,description:"Max pre-read hard-blocks per file path per session. 0 disables the pre-read hook entirely. 1 is the default and fires a block on the first read of each file that has scoped memories."},"hooks.edit.maxBlocks":{value:1,public:!0,pro:!1,description:"Max pre-edit hard-blocks per file path per session. 0 disables the pre-edit hook entirely. 1 is the default."},"hooks.stop.schedule":{value:[{until:9,every:3},{until:29,every:5},{every:10}],public:!0,pro:!1,description:"Phased interval schedule for the Stop hook's 'worth remembering?' nudge. Each entry = {until, every}. Default ramps from every-3-turns for first 9 turns \u2192 every-5 for turns 10-29 \u2192 every-10 afterwards."},"hooks.search.mode":{value:"soft",public:!0,pro:!1,description:"Pre-search hook mode: 'off' (no nudge), 'soft' (additionalContext only, default), 'block' (hard decision:block envelope)."},"hooks.correction.enabled":{value:!0,public:!0,pro:!1,description:"Enable UserPromptSubmit correction detection. When true, messages like 'no, use X instead' trigger a nudge to call aide_remember."},"hooks.correction.escalate":{value:"off",public:!0,pro:!1,description:"When a correction is detected, optionally write a correction-pending flag so the next Stop fire reminds the agent if the correction wasn't stored. 'off' (default) \u2014 never reminds; correction surfaces only as the soft UserPromptSubmit hint at detection time. 'block' \u2014 flag is written and the next Stop fires decision:block with the reminder, regardless of hooks.stop.mode. Master switch: hooks.correction.enabled=false disables the entire correction system including this. (A 'soft' value existed in spec drafts but was dropped \u2014 Claude Code's Stop hook protocol doesn't accept hookSpecificOutput.additionalContext, so a soft Stop emit is impossible. Use the always-on UserPromptSubmit soft hint as the soft channel; escalate to 'block' only when you want an explicit follow-up reminder.)"},"hooks.stop.mode":{value:"block",public:!0,pro:!1,description:"How the scheduled Stop checkpoint surfaces. 'block' (default) uses decision:block + a softened reason prompt + chrome systemMessage. The Claude Code TUI collapses the 'Stop hook error:' label behind ctrl+o when systemMessage is present, so the brand chrome is the primary visible line. 'off' skips the scheduled checkpoint entirely (zero Stop noise). Frequency is still controlled by hooks.stop.schedule. (A 'soft' mode existed in spec drafts but was dropped \u2014 Claude Code's Stop hook protocol doesn't accept hookSpecificOutput.additionalContext, so 'block' is the only way to deliver text to the agent on Stop.) When a correction-pending flag is set and hooks.correction.escalate='block', that branch wins and the scheduled checkpoint is skipped that turn."},"hooks.precompact.mode":{value:"cleanup",public:!0,pro:!1,description:"PreCompact hook behavior: 'off' preserves tracking files across compaction; 'cleanup' (default) clears recalled-paths/stop-count/correction-pending so the post-compact turn re-blocks cleanly."},"hooks.visible":{value:!0,public:!0,pro:!1,description:"Surface user-facing systemMessage lines when hooks fire (soft recalls, correction detected, session-start injection, Stop checkpoints, etc). Default true so users can see what aide-memory is doing. Set to false to hide all aide-memory systemMessages \u2014 hooks still function (context injection + block enforcement unchanged). Does not affect what Claude sees."},"recall.limit":{value:20,public:!0,pro:!1,description:"Max memories returned per aide_recall call before layer-diversity balancing applies."},"recall.ensureLayerDiversity":{value:!0,public:!0,pro:!1,description:"If true, recall results are swapped to surface under-represented layers up to recall.layerDiversityMinLimit. Ensures each enabled layer gets at least some representation instead of the top-scoring one dominating."},"recall.layerDiversityMinLimit":{value:5,public:!0,pro:!1,description:"Minimum total results below which layer diversity swap kicks in. Above this threshold, natural ranking wins."},"recall.minScopeDepth":{value:1,public:!0,pro:!1,description:"Minimum fixed-prefix segment count a scope needs to surface via per-file path-recall. Scopes below this threshold surface only at SessionStart injection instead. Think of it as 'how specific must a scope be to show up when I open a file?' Default 1 is permissive \u2014 any scope with \u22651 segment (e.g. 'src/**', 'pages/**', 'packages/**') counts. Works across project shapes (src-wrapped, flat Next.js, deep monorepos). Bump to 2 if you have many broad scopes and want per-file recall quieter (broad scopes still surface at SessionStart). Bump to 3+ for very strict per-file recall."},"injection.enabled":{value:!0,public:!0,pro:!1,description:"Master switch for SessionStart dynamic injection. When true (default), the sessionStart handler loads + injects preferences / guidelines / priority:always memories into the agent's starting context; when false, the handler short-circuits before any SQLite read or template render \u2014 zero per-turn overhead from dynamic injection. The rules file still ships (static content) but carries no memory-derived content. Granular per-layer knobs (injection.preferences, injection.guidelines, etc.) only apply when this master switch is true. Flip to false if you want aide-memory's hooks + MCP tools without any session-start context injection."},"injection.preferences":{value:15,public:!0,pro:!1,description:"Max preferences injected at SessionStart. 0/false disables; number = hard cap; 'all' = every preference. Default 15 matches spec memory #297 ('top 15 most-recalled preferences'). Only honored when injection.enabled is true."},"injection.excludeScopedPreferences":{value:!1,public:!0,pro:!1,description:"If true, SessionStart injection skips preferences with a non-null scope \u2014 they surface via Read/Edit path hooks when the agent touches matching paths. Default false preserves current 'inject all preferences regardless of scope' behavior. Set to true for tighter SessionStart token usage when you have many scoped preferences. (NB: renamed from `injection.preferences.excludeScoped` to avoid key collision with `injection.preferences` which is a scalar limit, not an object.)"},"injection.technical":{value:!1,public:!0,pro:!1,description:"Inject technical-layer memories at SessionStart? Default false \u2014 technical context should surface via path hooks when relevant. Set to a number to cap, 'all' for unlimited, true for enabled-with-no-cap."},"injection.area_context":{value:!1,public:!0,pro:!1,description:"Inject area_context-layer memories at SessionStart? Default false \u2014 area context by definition is area-specific and should surface via path hooks."},"injection.guidelines":{value:"all",public:!0,pro:!1,description:"Inject guidelines at SessionStart. 'all' (default) injects every guideline regardless of scope \u2014 guidelines apply broadly so early visibility matters. Set to a number for a cap, or false to disable."},"injection.priorityAlwaysOverride":{value:!0,public:!0,pro:!1,description:"When true (default), any memory with priority='always' is injected at SessionStart regardless of layer-specific injection settings. User-marked 'always' memories surface in the ## Always section (rendered first since 0.4.3 so they survive char-cap truncation)."},"injection.maxChars":{value:1200,public:!0,pro:!1,description:"Overall character cap for the combined SessionStart injection (preferences + technical + area_context + guidelines + always). Applied after all layer sections are concatenated; truncates with '...truncated' suffix. Bump to 2000+ for richer context, drop to 600 for token-conscious sessions. Default 1200 matches the pre-0.4.3 hard-coded MAX_INJECT_CHARS constant."},"memories.hideFromGrep":{value:!0,public:!0,pro:!1,description:"Add an aide-memory-managed block to .ignore so grep/ripgrep/etc skip .aide/memories/ by default. Flipping this live triggers drift-repair on the next hook fire."},"memories.softening.threshold":{value:10,public:!0,pro:!1,description:"Total-memory count below which pre-read/pre-edit hard blocks become soft additionalContext nudges. Keeps small projects from feeling hostile. Default 10 \u2014 once you have 10+ total memories, hard blocking resumes on first-touch."},"memories.defaultShared":{value:!0,public:!0,pro:!1,description:"Default `shared` flag for new memories when the caller doesn't pass one. When true (default), aide_remember without an explicit shared param writes to `.aide/memories/preferences/shared/` (committed to repo). When false, defaults to `personal/` (gitignored). Per-call `shared: true|false` always overrides this default. Flip to false if you want personal-by-default and explicit opt-in for shared memories."}}});function jn(){return sR}function aR(t,e){let r=t;for(let o of e){if(r==null||typeof r!="object"||Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,o))return!1;r=r[o]}return!0}function cR(t,e){let r=t;for(let o of e)r=r[o];return r}function ft(t,e){let o=jn()[e];if(!o)return;let n=o.value;if(o.public!==!0||!t)return n;let i=Zx.default.join(t,".aide","config.json");if(!Em.default.existsSync(i))return n;let s;try{s=JSON.parse(Em.default.readFileSync(i,"utf8"))}catch{return n}let a=e.split(".");return aR(s,a)?cR(s,a):n}function Lx(){let t=jn(),e={};for(let[r,o]of Object.entries(t))o.public===!0&&(e[r]=o.value);return e}function Fx(t){let e={};for(let[r,o]of Object.entries(t)){let n=r.split("."),i=e;for(let s=0;s<n.length-1;s++){let a=n[s],c=i[a];(!c||typeof c!="object"||Array.isArray(c))&&(i[a]={}),i=i[a]}i[n[n.length-1]]=o}return e}var Em,Zx,sR,is=g(()=>{"use strict";Em=C(require("fs")),Zx=C(require("path"));Sm();sR=Uc});function Bx(t,e,r){let o=r?Number(ft(r,"recall.minScopeDepth")??1):1,n=t.filter(a=>!a.scope||a.scope==="project"?!1:Wx(a.scope,e,{focused:!0,minScopeDepth:o})),i={},s=[];for(let a of n)i[a.layer]=(i[a.layer]||0)+1,s.push(a.id);return{memories:n,ids:s,layers:i,count:n.length}}function Vx(t,e,r,o,n){if(t)try{let i=Zc.default.join(t,"recall-log.jsonl"),s={timestamp:new Date().toISOString(),query:{paths:n??e.paths??[],text:e.query??null,layers:e.layers??null,limit:e.limit??Jx},matched_scopes:o,memories_returned:r.map(a=>({id:a.id,uuid:a.uuid,layer:a.layer,what:a.what,scope:a.scope,tags:a.tags,recalled_count:a.recalled_count+1})),count:r.length};Hx.default.appendFileSync(i,JSON.stringify(s)+`
|
|
127
|
+
`)}catch{}}function Wx(t,e,r){if(!t||t==="project")return!0;let o=t.replace(/\\/g,"/"),n=e.replace(/\\/g,"/"),i=o.replace(/\/?\*\*\/?$/,"").replace(/\/?\*$/,"").replace(/\/$/,"");if(!i)return!0;let s=n.startsWith(i+"/")||n===i,a=i.startsWith(n.replace(/\/$/,"")+"/");if(!s&&!a)return!1;if(r?.focused&&s){let c=r.minScopeDepth??1;if(i.split("/").length<c)return!1}return!0}function uR(t,e){if(!e)return 0;let r=e.toLowerCase().split(/\s+/).filter(i=>i.length>2);if(r.length===0)return 0;let o=[t.what,t.context_label,t.why].filter(Boolean).join(" ").toLowerCase(),n=0;for(let i of r)o.includes(i)&&n++;return n/r.length}function Lc(t,e,r){let o=performance.now();pt("recall",`enter paths=${JSON.stringify(e.paths??[])} ids=${JSON.stringify(e.ids??[])} query=${JSON.stringify(e.query??"")} layers=${JSON.stringify(e.layers??[])} limit=${e.limit??"default"}`);let n=t.getProjectRoot(),i=n?ft(n,"recall.limit"):null,s=n?ft(n,"recall.ensureLayerDiversity")??!0:!0,a=n?ft(n,"recall.layerDiversityMinLimit")??5:5,c=e.limit??i??Jx,u=n?Number(ft(n,"recall.minScopeDepth")??1):1,l={};e.contributor&&(l.contributor=e.contributor);let d=t.list(l),p=e.layers?d.filter(_=>e.layers.includes(_.layer)):d,f=new Set,m=e.paths?.map(_=>{if(Zc.default.isAbsolute(_)&&t.getProjectRoot()){let w=Zc.default.relative(t.getProjectRoot(),_),R=_.endsWith("/"),G=w!==""?w:".";return R&&!G.endsWith("/")?G+"/":G}return _});if(e.ids&&e.ids.length>0){let _=e.ids.map(R=>t.get(R)).filter(Boolean),w=_.map(R=>R.id);return w.length>0&&t.recordRecall(w),Vx(r??null,e,_,[],m),{memories:_,matched_scopes:[]}}m&&m.length>0&&(p=p.filter(_=>{for(let w of m)if(Wx(_.scope,w,{focused:!0,minScopeDepth:u}))return _.scope&&f.add(_.scope),!0;return!1}));let y=m?.some(_=>_.endsWith("/"))??!1,x=p.map(_=>{let w=_.scope&&_.scope!=="project"?_.scope.split("/").length:0,R=w>0?1:0;return{memory:_,isScoped:R,layerRank:qx.indexOf(_.layer),relevance:e.query?uR(_,e.query):0,scopeSpecificity:w}});x.sort((_,w)=>_.isScoped!==w.isScoped?w.isScoped-_.isScoped:_.layerRank!==w.layerRank?_.layerRank-w.layerRank:w.relevance!==_.relevance?w.relevance-_.relevance:y?_.scopeSpecificity-w.scopeSpecificity:w.scopeSpecificity-_.scopeSpecificity);let v;if(c){let _=x.slice(0,c);if(s&&c>=a){let w=new Set(_.map(G=>G.memory.layer)),R=x.slice(c);for(let G of qx)if(!w.has(G)){let be=R.filter(Oe=>Oe.memory.layer===G);if(be.length>0){let Oe=new Map;for(let ne of _)Oe.set(ne.memory.layer,(Oe.get(ne.memory.layer)||0)+1);let Tt=!1;for(let ne=_.length-1;ne>=0;ne--){let Fe=_[ne].memory.layer;if((Oe.get(Fe)||0)>1){_[ne]=be[0],Oe.set(Fe,(Oe.get(Fe)||0)-1),w.add(G),Tt=!0;break}}Tt||(_[_.length-1]=be[0],w.add(G))}}}v=_.map(w=>w.memory)}else v=x.map(_=>_.memory);let P=v.map(_=>_.id);return P.length>0&&t.recordRecall(P),Vx(r??null,e,v,Array.from(f),m),pt("recall",`exit candidates=${p.length} matched_scopes=${f.size} returned=${v.length} duration=${(performance.now()-o).toFixed(1)}ms`),{memories:v,matched_scopes:Array.from(f)}}var Hx,Zc,qx,Jx,Fc=g(()=>{"use strict";Hx=C(require("fs")),Zc=C(require("path"));is();ts();qx=["area_context","technical","preferences","guidelines"],Jx=20});function Jc(t,e,r,o){if(r===!1||r===0)return[];let n=t.list({layer:e});return e==="preferences"?(ft(o,"injection.excludeScopedPreferences")===!0&&(n=n.filter(s=>!s.scope||s.scope==="project")),n.sort((s,a)=>{let c=s.recalled_count??0,u=a.recalled_count??0;return u!==c?u-c:(a.updated_at||"").localeCompare(s.updated_at||"")})):n.sort((i,s)=>(s.updated_at||"").localeCompare(i.updated_at||"")),r==="all"?n:typeof r=="number"&&r>0?n.slice(0,r):n}function Bc(t,e){if(!(ft(t,"injection.enabled")??!0))return{content:"",injectedIds:[],truncated:!1};let o=ft(t,"injection.preferences")??15,n=ft(t,"injection.technical")??!1,i=ft(t,"injection.area_context")??!1,s=ft(t,"injection.guidelines")??"all",a=ft(t,"injection.priorityAlwaysOverride")??!0,c=Number(ft(t,"injection.maxChars")??1200),u=Jc(e,"preferences",o,t),l=Jc(e,"technical",n,t),d=Jc(e,"area_context",i,t),p=Jc(e,"guidelines",s,t),f=a?e.list({priority:"always"}):[],m=[],y=new Set,x=(G,be)=>{for(let Oe of G){let Tt=Oe.uuid||String(Oe.id);y.has(Tt)||(y.add(Tt),be.push(Oe.what),m.push(Oe.id))}},v={preferences:[],technical:[],area_context:[],guidelines:[],always:[]};if(x(u,v.preferences),x(l,v.technical),x(d,v.area_context),x(p,v.guidelines),x(f,v.always),v.preferences.length+v.technical.length+v.area_context.length+v.guidelines.length+v.always.length===0)return{content:"",injectedIds:[],truncated:!1};let _=[];if(v.always.length>0){_.push("## Always");for(let G of v.always)_.push(`- ${G}`)}if(v.preferences.length>0){_.push("## Session Preferences");for(let G of v.preferences)_.push(`- ${G}`)}if(v.technical.length>0){_.push("## Technical Context");for(let G of v.technical)_.push(`- ${G}`)}if(v.area_context.length>0){_.push("## Area Context");for(let G of v.area_context)_.push(`- ${G}`)}if(v.guidelines.length>0){_.push("## Guidelines");for(let G of v.guidelines)_.push(`- ${G}`)}let w=_.join(`
|
|
128
|
+
`),R=!1;return w.length>c&&(w=w.slice(0,c)+`
|
|
129
|
+
...truncated`,R=!0),{content:w,injectedIds:m,truncated:R}}var zm=g(()=>{"use strict";is()});var Kx={};bt(Kx,{_resetPackageRootCache:()=>mR,findPackageRoot:()=>as,getTemplatesDir:()=>Tm});function as(){if(Wc)return Wc;let t=__dirname;for(let e=0;e<32&&t!==Nn.parse(t).root;e++){let r=Nn.join(t,"package.json");if(ss.existsSync(r))try{let o=JSON.parse(ss.readFileSync(r,"utf8"));if(typeof o.name=="string"&&fR.has(o.name))return Wc=t,t}catch{}t=Nn.dirname(t)}throw new Error(`aide-memory: could not find package.json walking up from ${__dirname}. This indicates a broken install \u2014 reinstall aide-memory.`)}function Tm(){let t=as(),e=Nn.join(t,"src","templates","rules");if(!ss.existsSync(e))throw new Error(`aide-memory: templates directory not found at ${e}. This indicates a broken install \u2014 reinstall aide-memory.`);return e}function mR(){Wc=null}var ss,Nn,dR,pR,fR,Wc,Gc=g(()=>{"use strict";ss=C(require("fs")),Nn=C(require("path")),dR="aide-memory",pR=["aide","v0"].join("-"),fR=new Set([pR,dR]),Wc=null});function hR(){if(Kc!==null)return Kc;let t=Yx.join(Tm(),"shared","body.md");return Kc=Xx.readFileSync(t,"utf8"),Kc}function gR(t,e){let r=t;for(let[o,n]of Object.entries(e))r=r.replace(new RegExp(`\\{\\{${o}\\}\\}`,"g"),n);return r}function Xc(t,e){let r=hR(),o=t.ruleFrontmatter+r;return gR(o,{contributor:e.contributor,tools_list:e.tools_list,tool_id:t.ruleToolId,editor_notes:t.ruleNotes})}var Xx,Yx,Kc,Om=g(()=>{"use strict";Xx=C(require("fs")),Yx=C(require("path"));Gc();Kc=null});function Qx(t,e=""){let r=new Map;for(let[o,n]of Object.entries(t)){let i=e?`${e}.${o}`:o;if(Array.isArray(n))r.set(i,{type:"array"});else if(n!==null&&typeof n=="object"){r.set(i,{type:"object"});let s=Qx(n,i);for(let[a,c]of s)r.set(a,c)}else r.set(i,{type:typeof n})}return r}function yR(t,e){let r=e.split("."),o=t;for(let n of r){if(o==null||typeof o!="object")return;o=o[n]}return o}function vR(t,e,r){let o=e.split("."),n=t;for(let i=0;i<o.length-1;i++){let s=o[i];(n[s]===void 0||n[s]===null||typeof n[s]!="object")&&(n[s]={}),n=n[s]}n[o[o.length-1]]=r}function Cn(t){return JSON.parse(JSON.stringify(t))}var zo,Pm,An,Yc,Wr,Qc=g(()=>{"use strict";zo=C(require("fs")),Pm=C(require("path")),An={version:1,tags:{presets:["architecture","testing","security","style","integration","config","migration","performance","api-contract"]},telemetry:{enabled:!0},contributor:"auto",embeddings:{model:"auto",backend:"auto"},updates:{check:!0}};Yc=Qx(An);Wr=class{constructor(e){this.projectRoot=e,this.configPath=Pm.default.join(e,".aide","config.json"),this.config=this.load()}get(e){return yR(this.config,e)}set(e,r){this.validateKey(e),this.validateValue(e,r),vR(this.config,e,r),this.save()}addTag(e){let r=this.config.tags.presets;r.includes(e)||(r.push(e),this.save())}removeTag(e){let r=this.config.tags.presets,o=r.indexOf(e);o!==-1&&(r.splice(o,1),this.save())}reset(){this.config=Cn(An),this.save()}list(){return Cn(this.config)}static defaults(){return Cn(An)}load(){if(!zo.default.existsSync(this.configPath))return Cn(An);let e;try{e=zo.default.readFileSync(this.configPath,"utf-8")}catch{return console.warn(`[aide-config] Could not read ${this.configPath}, using defaults`),Cn(An)}try{let r=JSON.parse(e);return this.mergeWithDefaults(r)}catch{return console.warn(`[aide-config] Malformed JSON in ${this.configPath}, using defaults. Call config.reset() to overwrite the file with valid defaults.`),Cn(An)}}mergeWithDefaults(e){let r=Cn(An);return this.deepMerge(r,e)}deepMerge(e,r){if(r==null)return e;if(typeof r!="object"||Array.isArray(r)||typeof e!="object"||Array.isArray(e))return r;let o={...e};for(let n of Object.keys(r))n in o&&typeof o[n]=="object"&&!Array.isArray(o[n])&&typeof r[n]=="object"&&!Array.isArray(r[n])?o[n]=this.deepMerge(o[n],r[n]):o[n]=r[n];return o}save(){let e=Pm.default.dirname(this.configPath);zo.default.existsSync(e)||zo.default.mkdirSync(e,{recursive:!0}),zo.default.writeFileSync(this.configPath,JSON.stringify(this.config,null,2)+`
|
|
130
|
+
`,"utf-8")}validateKey(e){if(!Yc.has(e)){let r=Array.from(Yc.keys()).filter(o=>!Yc.get(o).type.startsWith("object")).sort();throw new Error(`Unknown config key: "${e}". Valid keys: ${r.join(", ")}`)}}validateValue(e,r){let o=Yc.get(e);if(!o)return;let n=Array.isArray(r)?"array":typeof r;if(o.type!==n)throw new Error(`Invalid value type for "${e}": expected ${o.type}, got ${n}`)}}});function jm(t,e){let r=Rm.default.join(t,".ignore"),o=Dn.default.existsSync(r),n=o?Dn.default.readFileSync(r,"utf8"):"",{withoutManaged:i,withoutLegacy:s}=bR(n),a;if(e){let c=_R();a=$R(s,c)}else a=i===s?i:s;return a===n?{ignorePath:r,changed:!1}:!e&&a.trim().length===0?o?(Dn.default.unlinkSync(r),{ignorePath:r,changed:!0,message:".ignore removed (memories.hideFromGrep disabled, no other entries)"}):{ignorePath:r,changed:!1}:(Dn.default.writeFileSync(r,a,"utf8"),{ignorePath:r,changed:!0,message:e?o?".ignore (aide-memory section updated)":".ignore (created with .aide/memories/ hidden from grep)":".ignore (aide-memory section removed)"})}function Nm(t){let e=Rm.default.join(t,".aide","config.json");if(!Dn.default.existsSync(e))return!0;try{return JSON.parse(Dn.default.readFileSync(e,"utf8"))?.memories?.hideFromGrep!==!1}catch{return!0}}function _R(){return`${tk}
|
|
131
|
+
${nk}
|
|
132
|
+
${rk}
|
|
133
|
+
`}function bR(t){let e=new RegExp(`(?:^|\\n)[ \\t]*${ek(tk)}[^\\n]*\\n[\\s\\S]*?${ek(rk)}[^\\n]*(?:\\n|$)`,"g"),r=t.replace(e,n=>n.startsWith(`
|
|
133
134
|
`)?`
|
|
134
|
-
`:""),r
|
|
135
|
-
`).filter(
|
|
136
|
-
`);return{withoutManaged:
|
|
135
|
+
`:""),o=r.split(`
|
|
136
|
+
`).filter(n=>n.trim()!==nk).join(`
|
|
137
|
+
`);return{withoutManaged:r,withoutLegacy:o}}function $R(t,e){if(t.length===0)return e;let r=t.replace(/\n+$/,"");return r.length===0?e:`${r}
|
|
137
138
|
|
|
138
|
-
${e}`}function
|
|
139
|
+
${e}`}function ek(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Dn,Rm,tk,rk,nk,ok=g(()=>{"use strict";Dn=C(require("fs")),Rm=C(require("path")),tk="# BEGIN aide-memory-managed",rk="# END aide-memory-managed",nk=".aide/memories/"});function ik(t=cs){let e=[];for(let r of t){if(!r.hasMatcher||!r.matchers||r.matchers.length===0){e.push({event:r,matcher:null});continue}for(let o of r.matchers)e.push({event:r,matcher:o})}return e}var cs,Cm=g(()=>{"use strict";cs=[{id:"session-start",script:"session-start-clear.sh",purpose:"Inject top-N preferences + guidelines + priority:always at session start",timeout:10,hasMatcher:!1},{id:"pre-compact",script:"pre-compact-save.sh",purpose:"Clear session tracking before compaction",timeout:30,hasMatcher:!1},{id:"stop",script:"stop-remember.sh",purpose:"Reflection nudge on schedule + correction-pending flag",timeout:30,hasMatcher:!1},{id:"pre-prompt",script:"detect-correction.sh",purpose:"Detect correction/decision/preference in user prompt",timeout:5,hasMatcher:!1},{id:"pre-read",script:"pre-read-recall.sh",purpose:"Block/soft on file read with scoped memories",timeout:10,hasMatcher:!0,matchers:["read"]},{id:"pre-edit",script:"pre-edit-recall.sh",purpose:"Block/soft on file edit with scoped memories",timeout:10,hasMatcher:!0,matchers:["edit","write"]},{id:"pre-search",script:"pre-search-nudge.sh",purpose:"Nudge aide_search when matching memories exist",timeout:10,hasMatcher:!0,matchers:["search","glob"]},{id:"pre-recall",script:"track-recall.sh",purpose:"Track paths on aide_recall pre-tool-use",timeout:5,hasMatcher:!0,matchers:["mcp-aide-recall"]},{id:"post-tool-use-recall",script:"track-recall-post.sh",purpose:"Record recalled ids post-tool-use",timeout:5,hasMatcher:!0,matchers:["mcp-aide-recall"]},{id:"post-remember",script:"track-remember.sh",purpose:"Clear correction-pending flag on aide_remember/update/forget",timeout:5,hasMatcher:!0,matchers:["mcp-aide-remember","mcp-aide-update","mcp-aide-forget"]},{id:"post-search",script:"track-search.sh",purpose:"Mark query as searched post aide_search",timeout:5,hasMatcher:!0,matchers:["mcp-aide-search"]}]});function To(t,e){let r=[],o=new Set;for(let{event:n,matcher:i}of ik(cs)){let s=t.eventNameMap[n.id];if(s===null)continue;let a=null;if(i!==null){let l=t.matcherMap[i];if(l===null)continue;a=l}let c=xR(e.packageRoot,n.script),u=`${s}|${a??""}|${c}`;o.has(u)||(o.add(u),r.push({eventName:s,matcher:a,command:c,timeout:n.timeout}))}return r}function xR(t,e){return`bash ${sk.join(t,"scripts","hooks",e)}`}function Oo(t){let e=new Map;for(let r of t){let o=e.get(r.eventName)??[];o.push(r),e.set(r.eventName,o)}return e}var sk,eu=g(()=>{"use strict";sk=C(require("path"));Cm()});var tu,ak=g(()=>{"use strict";eu();tu={id:"claude-code",displayName:"Claude Code",hookConfigPath:".claude/settings.json",mcpConfigPath:".mcp.json",rules:[{template:"claude-code.md",dest:".claude/rules/aide-memory.md"}],ruleFrontmatter:"",ruleNotes:"",ruleToolId:"claude-code",supportsHooks:!0,supportsMcp:!0,supportsRules:!0,eventNameMap:{"session-start":"SessionStart","pre-compact":"PreCompact",stop:"Stop","pre-prompt":"UserPromptSubmit","pre-read":"PreToolUse","pre-edit":"PreToolUse","pre-search":"PreToolUse","pre-recall":"PreToolUse","post-tool-use-recall":"PostToolUse","post-remember":"PostToolUse","post-search":"PostToolUse"},matcherMap:{read:"Read",edit:"Edit",write:"Write",search:"Grep",glob:"Glob","mcp-aide-recall":"mcp__aide-memory__aide_recall","mcp-aide-remember":"mcp__aide-memory__aide_remember","mcp-aide-update":"mcp__aide-memory__aide_update","mcp-aide-forget":"mcp__aide-memory__aide_forget","mcp-aide-search":"mcp__aide-memory__aide_search"},buildHookConfig(t){let e=To(tu,t),r=Oo(e),o={};for(let[n,i]of r){let s=i.some(a=>a.matcher!==null);o[n]=i.map(a=>{let c={type:"command",command:a.command,timeout:a.timeout};return s?{matcher:a.matcher,hooks:[c]}:{hooks:[c]}})}return{hooks:o}},buildMcpConfig({serverEntry:t,projectRoot:e}){return{mcpServers:{"aide-memory":{command:"node",args:[t,e]}}}},detectRuntime(t){return t.CURSOR_VERSION||t.CURSOR_PROJECT_DIR?!1:!!t.CLAUDECODE},translateInput(t){return t},translateOutput(t){switch(t.kind){case"block":{let e={decision:"block",reason:t.reason};return t.systemMessage&&(e.systemMessage=t.systemMessage),JSON.stringify(e,null,2)}case"additionalContext":{let e={hookSpecificOutput:{hookEventName:t.event,additionalContext:t.context}};return t.systemMessage&&(e.systemMessage=t.systemMessage),JSON.stringify(e,null,2)}case"systemMessage":return JSON.stringify({systemMessage:t.text},null,2);case"silent":return""}}}});function Mn(t){return t.replace(kR,"")}var kR,Am,ck=g(()=>{"use strict";eu();kR=/\[[0-9;]*m/g;Am={id:"cursor",displayName:"Cursor",hookConfigPath:".cursor/hooks.json",mcpConfigPath:".cursor/mcp.json",rules:[{template:"cursor.mdc",dest:".cursor/rules/aide-memory.mdc"}],ruleFrontmatter:`---
|
|
139
140
|
description: AIDE Memory - persistent context for AI coding agents
|
|
140
141
|
globs: **/*
|
|
141
142
|
alwaysApply: true
|
|
142
143
|
---
|
|
143
144
|
|
|
144
|
-
`,ruleNotes:"\nNote: Cursor uses `agent_message` for hook responses rather than `additionalContext`. The nudge content appears directly in the agent message flow.\n",ruleToolId:"cursor",supportsHooks:!0,supportsMcp:!0,supportsRules:!0,needsDynamicRules:!0,eventNameMap:{"session-start":"sessionStart","pre-compact":"preCompact",stop:"stop","pre-prompt":"beforeSubmitPrompt","pre-read":"preToolUse","pre-edit":"preToolUse","pre-search":"preToolUse","pre-recall":"preToolUse","post-tool-use-recall":"postToolUse","post-remember":"postToolUse","post-search":"postToolUse"},matcherMap:{read:"Read",edit:"Write",write:"Write",search:"Grep",glob:null,"mcp-aide-recall":"MCP:aide_recall","mcp-aide-remember":"MCP:aide_remember","mcp-aide-update":"MCP:aide_update","mcp-aide-forget":"MCP:aide_forget","mcp-aide-search":"MCP:aide_search"},buildHookConfig(
|
|
145
|
+
`,ruleNotes:"\nNote: Cursor uses `agent_message` for hook responses rather than `additionalContext`. The nudge content appears directly in the agent message flow.\n",ruleToolId:"cursor",supportsHooks:!0,supportsMcp:!0,supportsRules:!0,needsDynamicRules:!0,eventNameMap:{"session-start":"sessionStart","pre-compact":"preCompact",stop:"stop","pre-prompt":"beforeSubmitPrompt","pre-read":"preToolUse","pre-edit":"preToolUse","pre-search":"preToolUse","pre-recall":"preToolUse","post-tool-use-recall":"postToolUse","post-remember":"postToolUse","post-search":"postToolUse"},matcherMap:{read:"Read",edit:"Write",write:"Write",search:"Grep",glob:null,"mcp-aide-recall":"MCP:aide_recall","mcp-aide-remember":"MCP:aide_remember","mcp-aide-update":"MCP:aide_update","mcp-aide-forget":"MCP:aide_forget","mcp-aide-search":"MCP:aide_search"},buildHookConfig(t){let e=To(Am,t),r=Oo(e),o={};for(let[n,i]of r)o[n]=i.map(s=>{let a={type:"command",command:s.command,timeout:s.timeout};return s.matcher!==null&&(a.matcher=s.matcher),a});return{version:1,hooks:o}},buildMcpConfig({serverEntry:t}){return{mcpServers:{"aide-memory":{type:"stdio",command:"node",args:[t,"${workspaceFolder}"]}}}},detectRuntime(t){return!!t.CURSOR_VERSION||!!t.CURSOR_PROJECT_DIR},translateInput(t){let e={...t};if(typeof e.session_id!="string"&&typeof t.conversation_id=="string"&&(e.session_id=t.conversation_id),typeof e.cwd!="string"&&Array.isArray(t.workspace_roots)&&t.workspace_roots.length>0){let r=t.workspace_roots[0];typeof r=="string"&&(e.cwd=r)}return e.tool_response===void 0&&t.tool_output!==void 0&&(e.tool_response=t.tool_output),e},translateOutput(t){switch(t.kind){case"block":{let e=t.event??"preToolUse";if(e==="stop")return t.systemMessage?JSON.stringify({followup_message:`${Mn(t.systemMessage)} \u2014 ${t.reason}`},null,2):JSON.stringify({followup_message:t.reason},null,2);if(e==="userPromptSubmit"){let o=t.systemMessage?`${Mn(t.systemMessage)} \u2014 ${Mn(t.reason)}`:Mn(t.reason);return JSON.stringify({continue:!1,user_message:o},null,2)}let r={permission:"deny"};return t.systemMessage?(r.user_message=Mn(t.systemMessage),r.agent_message=t.reason):r.user_message=Mn(t.reason),JSON.stringify(r,null,2)}case"additionalContext":{if(String(t.event??"").toLowerCase()==="pretooluse"){let r={permission:"allow",agent_message:t.context};return t.systemMessage&&(r.user_message=Mn(t.systemMessage)),JSON.stringify(r,null,2)}return""}case"systemMessage":return"";case"silent":return""}}}});var Dm,uk=g(()=>{"use strict";eu();Dm={id:"devin",displayName:"Devin CLI",hookConfigPath:".devin/config.json",mcpConfigPath:".devin/config.json",rules:[{template:"devin.md",dest:".devin/skills/aide-memory/SKILL.md"}],ruleFrontmatter:`---
|
|
145
146
|
name: aide-memory
|
|
146
147
|
description: >-
|
|
147
148
|
How aide-memory works in this project \u2014 persistent cross-session memory.
|
|
@@ -155,97 +156,170 @@ triggers:
|
|
|
155
156
|
- model
|
|
156
157
|
---
|
|
157
158
|
|
|
158
|
-
`,ruleNotes:"\nNote: On Devin CLI the compaction hook fires AFTER context compaction (PostCompaction), not before. Don't rely on a pre-compaction save prompt \u2014 save important context proactively as the conversation grows, and re-run `aide_recall` after a compaction.\n",ruleToolId:"devin",supportsHooks:!0,supportsMcp:!0,supportsRules:!0,needsDynamicRules:!1,eventNameMap:{"session-start":"SessionStart","pre-compact":"PostCompaction",stop:"Stop","pre-prompt":"UserPromptSubmit","pre-read":"PreToolUse","pre-edit":"PreToolUse","pre-search":"PreToolUse","pre-recall":"PreToolUse","post-tool-use-recall":"PostToolUse","post-remember":"PostToolUse","post-search":"PostToolUse"},matcherMap:{read:"read",edit:"edit",write:"write",search:"grep",glob:"glob","mcp-aide-recall":"mcp__aide-memory__aide_recall","mcp-aide-remember":"mcp__aide-memory__aide_remember","mcp-aide-update":"mcp__aide-memory__aide_update","mcp-aide-forget":"mcp__aide-memory__aide_forget","mcp-aide-search":"mcp__aide-memory__aide_search"},buildHookConfig(
|
|
159
|
-
`,"utf8"),
|
|
160
|
-
`,"utf8"),
|
|
161
|
-
`,"utf8"),
|
|
162
|
-
`,"utf8"),
|
|
163
|
-
`,"utf8"),
|
|
164
|
-
`,"utf8"),{written:!0}}function
|
|
165
|
-
`),"utf8"),{created:[".aide/config-reference.md"],skipped:[]}}function
|
|
166
|
-
`),
|
|
159
|
+
`,ruleNotes:"\nNote: On Devin CLI the compaction hook fires AFTER context compaction (PostCompaction), not before. Don't rely on a pre-compaction save prompt \u2014 save important context proactively as the conversation grows, and re-run `aide_recall` after a compaction.\n",ruleToolId:"devin",supportsHooks:!0,supportsMcp:!0,supportsRules:!0,needsDynamicRules:!1,eventNameMap:{"session-start":"SessionStart","pre-compact":"PostCompaction",stop:"Stop","pre-prompt":"UserPromptSubmit","pre-read":"PreToolUse","pre-edit":"PreToolUse","pre-search":"PreToolUse","pre-recall":"PreToolUse","post-tool-use-recall":"PostToolUse","post-remember":"PostToolUse","post-search":"PostToolUse"},matcherMap:{read:"read",edit:"edit",write:"write",search:"grep",glob:"glob","mcp-aide-recall":"mcp__aide-memory__aide_recall","mcp-aide-remember":"mcp__aide-memory__aide_remember","mcp-aide-update":"mcp__aide-memory__aide_update","mcp-aide-forget":"mcp__aide-memory__aide_forget","mcp-aide-search":"mcp__aide-memory__aide_search"},buildHookConfig(t){let e=To(Dm,t),r=Oo(e),o={};for(let[n,i]of r){let s=i.some(a=>a.matcher!==null);o[n]=i.map(a=>{let c={type:"command",command:a.command,timeout:a.timeout};return s?{matcher:a.matcher,hooks:[c]}:{hooks:[c]}})}return{hooks:o}},buildMcpConfig({serverEntry:t,projectRoot:e}){return{mcpServers:{"aide-memory":{command:"node",args:[t,e]}}}},detectRuntime(t){return!!t.DEVIN_PROJECT_DIR},translateInput(t){let e={...t};if(typeof e.cwd!="string"||e.cwd.length===0){let o=process.env.DEVIN_PROJECT_DIR;typeof o=="string"&&o.length>0&&(e.cwd=o)}if(typeof e.session_id!="string"||e.session_id.length===0){let o=typeof t.conversation_id=="string"&&t.conversation_id||typeof t.sessionId=="string"&&t.sessionId||typeof t.session=="string"&&t.session||"";o&&(e.session_id=o)}let r=e.tool_response;if(r&&typeof r=="object"&&!Array.isArray(r)){let o=r;typeof o.output=="string"&&typeof o.text!="string"&&(e.tool_response={...o,text:o.output})}return e},translateOutput(t){switch(t.kind){case"block":{if((t.event??"preToolUse")==="preToolUse"){let o={hookSpecificOutput:{hookEventName:"PreToolUse",additionalContext:t.reason}};return t.systemMessage&&(o.systemMessage=t.systemMessage),JSON.stringify(o,null,2)}let r={decision:"block",reason:t.reason};return t.systemMessage&&(r.systemMessage=t.systemMessage),JSON.stringify(r,null,2)}case"additionalContext":{let e={hookSpecificOutput:{hookEventName:t.event,additionalContext:t.context}};return t.systemMessage&&(e.systemMessage=t.systemMessage),JSON.stringify(e,null,2)}case"systemMessage":return JSON.stringify({systemMessage:t.text},null,2);case"silent":return""}}}});var lk,dk=g(()=>{"use strict";lk={id:"codex",displayName:"OpenAI Codex",hookConfigPath:".codex/hooks.json",mcpConfigPath:".codex/mcp.json",rules:[{template:"codex.md",dest:".codex/rules/aide-memory.md"}],ruleFrontmatter:"",ruleNotes:"",ruleToolId:"codex",supportsHooks:!1,supportsMcp:!1,supportsRules:!1,eventNameMap:{"session-start":null,"pre-compact":null,stop:null,"pre-prompt":null,"pre-read":null,"pre-edit":null,"pre-search":null,"pre-recall":null,"post-tool-use-recall":null,"post-remember":null,"post-search":null},matcherMap:{read:null,edit:null,write:null,search:null,glob:null,"mcp-aide-recall":null,"mcp-aide-remember":null,"mcp-aide-update":null,"mcp-aide-forget":null,"mcp-aide-search":null},buildHookConfig(t){return{}},buildMcpConfig(t){return{}},detectRuntime(t){return!1},translateInput(t){return t},translateOutput(t){return""}}});var pk,fk=g(()=>{"use strict";pk={id:"copilot",displayName:"GitHub Copilot",hookConfigPath:".github/copilot/hooks.json",mcpConfigPath:".github/copilot/mcp.json",rules:[{template:"copilot.md",dest:".github/copilot-instructions.md"}],ruleFrontmatter:"",ruleNotes:"",ruleToolId:"copilot",supportsHooks:!1,supportsMcp:!1,supportsRules:!1,eventNameMap:{"session-start":null,"pre-compact":null,stop:null,"pre-prompt":null,"pre-read":null,"pre-edit":null,"pre-search":null,"pre-recall":null,"post-tool-use-recall":null,"post-remember":null,"post-search":null},matcherMap:{read:null,edit:null,write:null,search:null,glob:null,"mcp-aide-recall":null,"mcp-aide-remember":null,"mcp-aide-update":null,"mcp-aide-forget":null,"mcp-aide-search":null},buildHookConfig(t){return{}},buildMcpConfig(t){return{}},detectRuntime(t){return!1},translateInput(t){return t},translateOutput(t){return""}}});var mk,hk=g(()=>{"use strict";mk={id:"windsurf",displayName:"Windsurf",hookConfigPath:".windsurf/hooks.json",mcpConfigPath:".windsurf/mcp.json",rules:[{template:"windsurf.md",dest:".windsurf/rules/aide-memory.md"}],ruleFrontmatter:"",ruleNotes:"",ruleToolId:"windsurf",supportsHooks:!1,supportsMcp:!1,supportsRules:!1,eventNameMap:{"session-start":null,"pre-compact":null,stop:null,"pre-prompt":null,"pre-read":null,"pre-edit":null,"pre-search":null,"pre-recall":null,"post-tool-use-recall":null,"post-remember":null,"post-search":null},matcherMap:{read:null,edit:null,write:null,search:null,glob:null,"mcp-aide-recall":null,"mcp-aide-remember":null,"mcp-aide-update":null,"mcp-aide-forget":null,"mcp-aide-search":null},buildHookConfig(t){return{}},buildMcpConfig(t){return{}},detectRuntime(t){return!1},translateInput(t){return t},translateOutput(t){return""}}});function nu(){return ru.filter(t=>t.supportsHooks)}function Mm(){return ru.filter(t=>t.supportsMcp)}function ot(){return ru.filter(t=>t.supportsRules)}function Un(t=process.env){for(let e of ru)if(e.detectRuntime(t))return e;return tu}var ru,Qt=g(()=>{"use strict";ak();ck();uk();dk();fk();hk();ru=[tu,Am,Dm,lk,pk,mk]});var au={};bt(au,{MCP_TOOLS_LIST:()=>Po,autoUpdateIfNeeded:()=>jR,detectContributor:()=>us,ingestPendingMemories:()=>CR,initProject:()=>Vm,resyncDerivedArtifacts:()=>su});function iu(){return ge.default.resolve(__dirname,"..","..")}function SR(){let t=iu();return t.includes("/_npx/")||t.includes("\\_npx\\")}function vk(t,e,r,o){let n=[],i=[],s=t.hookConfigPath,a=ge.default.join(e,s),c=ge.default.dirname(a);Z.default.existsSync(c)||Z.default.mkdirSync(c,{recursive:!0});let u=iu(),l=t.buildHookConfig({packageRoot:u}),d=o?{_aideMemoryVersion:o}:{},p=v=>{Z.default.writeFileSync(a,JSON.stringify({...l,...d},null,2)+`
|
|
160
|
+
`,"utf8"),n.push(`${s}${v?` (${v})`:""}`)};if(!Z.default.existsSync(a))return p(""),{created:n,skipped:i};let f;try{f=JSON.parse(Z.default.readFileSync(a,"utf8"))}catch{return p(""),{created:n,skipped:i}}if(IR(f,u)&&!r)return i.push(`${s} (hooks already configured)`),{created:n,skipped:i};let y=ER(f.hooks??{},l.hooks??{},u),x={...f,...l,hooks:y,...d};return Z.default.writeFileSync(a,JSON.stringify(x,null,2)+`
|
|
161
|
+
`,"utf8"),n.push(`${s} (hooks ${r?"force-updated":"added"})`),{created:n,skipped:i}}function ER(t,e,r){let o=ge.default.join(r,"scripts","hooks"),n=new Set(cs.map(c=>c.script)),i=c=>{let u=l=>{if(typeof l=="string"){if(l.includes(o))return!0;for(let d of n)if(l.includes(`/${d}`)||l.endsWith(d))return!0;return!1}return Array.isArray(l)?l.some(u):l&&typeof l=="object"?Object.values(l).some(u):!1};return u(c)},s={},a=new Set([...Object.keys(t),...Object.keys(e)]);for(let c of a){let u=Array.isArray(t[c])?t[c]:[],l=Array.isArray(e[c])?e[c]:[],p=[...u.filter(f=>!i(f)),...l];p.length>0&&(s[c]=p)}return s}function IR(t,e){let r=ge.default.join(e,"scripts","hooks"),o=n=>typeof n=="string"?n.includes(r):Array.isArray(n)?n.some(o):n&&typeof n=="object"?Object.values(n).some(o):!1;return o(t.hooks)}function _k(t,e,r){let o=[],n=[],i=ge.default.join(e,t.mcpConfigPath),s=ge.default.dirname(i);Z.default.existsSync(s)||Z.default.mkdirSync(s,{recursive:!0});let a=iu(),c=ge.default.join(a,"dist","memory","cli.js"),u=t.buildMcpConfig({serverEntry:c,projectRoot:e});if(!Z.default.existsSync(i))return Z.default.writeFileSync(i,JSON.stringify(u,null,2)+`
|
|
162
|
+
`,"utf8"),o.push(t.mcpConfigPath),{created:o,skipped:n};try{let l=JSON.parse(Z.default.readFileSync(i,"utf8"));if(!!l.mcpServers?.["aide-memory"]&&!r)return n.push(`${t.mcpConfigPath} (aide-memory already configured)`),{created:o,skipped:n};l.mcpServers=l.mcpServers||{},l.mcpServers["aide-memory"]=u.mcpServers["aide-memory"],Z.default.writeFileSync(i,JSON.stringify(l,null,2)+`
|
|
163
|
+
`,"utf8"),o.push(`${t.mcpConfigPath} (aide-memory ${r?"force-updated":"server added"})`)}catch{Z.default.writeFileSync(i,JSON.stringify(u,null,2)+`
|
|
164
|
+
`,"utf8"),o.push(t.mcpConfigPath)}return{created:o,skipped:n}}function us(t){try{return(0,Lm.execSync)("git rev-parse --git-dir",{cwd:t,encoding:"utf8",stdio:["pipe","pipe","pipe"]}),(0,Lm.execSync)("git config user.name",{cwd:t,encoding:"utf8",stdio:["pipe","pipe","pipe"]}).trim()||"unknown"}catch{return"unknown"}}function zR(t,e){let r=[],o=[];for(let n of gk){let i=ge.default.join(t,n);if(Z.default.existsSync(i)&&!e){o.push(n);continue}Z.default.mkdirSync(i,{recursive:!0}),r.push(n)}return{created:r,skipped:o}}function Fm(t,e,r){let o=[],n=[];for(let i of ot())for(let s of i.rules){let a=ge.default.join(t,s.dest);if(Z.default.existsSync(a)&&!r){n.push(s.dest);continue}let c=ge.default.dirname(a);Z.default.existsSync(c)||Z.default.mkdirSync(c,{recursive:!0});let u=Xc(i,{contributor:e,tools_list:Po});Z.default.writeFileSync(a,u,"utf8"),o.push(s.dest)}return{created:o,skipped:n}}function bk(t,e){for(let[r,o]of Object.entries(e)){let n=t[r];n!=null&&typeof n=="object"&&!Array.isArray(n)&&o!==null&&typeof o=="object"&&!Array.isArray(o)?bk(n,o):n===void 0&&(t[r]=o)}return t}function qm(t){let e=ge.default.join(t,".aide","config.json"),r=Lx(),o=Fx(r),n={};if(Z.default.existsSync(e))try{n=JSON.parse(Z.default.readFileSync(e,"utf8"))}catch{n={}}let i=JSON.stringify(n);bk(n,o);let s=JSON.stringify(n);if(i===s)return{written:!1};let a=ge.default.dirname(e);return Z.default.existsSync(a)||Z.default.mkdirSync(a,{recursive:!0}),Z.default.writeFileSync(e,JSON.stringify(n,null,2)+`
|
|
165
|
+
`,"utf8"),{written:!0}}function TR(t,e){let r=ge.default.join(t,".aide","config-reference.md");if(Z.default.existsSync(r)&&!e)return{created:[],skipped:[".aide/config-reference.md"]};let o=jn(),n=Object.keys(o).filter(a=>o[a].public===!0).sort(),i=["# aide-memory configuration reference","","Auto-generated by `aide-memory init`. Every public setting from","`scripts/hooks/defaults.json` with its default and description.","","Override any of these with:","","```bash","aide-memory config <key> <value>","```","","Or see the live list with current values:","","```bash","aide-memory config list","```","","## Settings",""];for(let a of n){let c=o[a],u=typeof c.value=="object"?"`"+JSON.stringify(c.value)+"`":"`"+String(c.value)+"`";i.push("### `"+a+"`"),i.push(""),i.push("**Default:** "+u),i.push(""),c.description&&(i.push(c.description),i.push(""))}i.push("---"),i.push(""),i.push("_Reference regenerated at init time. If this file drifts from your installed aide-memory, re-run `aide-memory init --force` to refresh._"),i.push("");let s=ge.default.dirname(r);return Z.default.existsSync(s)||Z.default.mkdirSync(s,{recursive:!0}),Z.default.writeFileSync(r,i.join(`
|
|
166
|
+
`),"utf8"),{created:[".aide/config-reference.md"],skipped:[]}}function OR(t,e,r){let o=ge.default.join(t,".aide","config.json");if(Z.default.existsSync(o)&&!r){let{written:s}=qm(t);return s?{created:[".aide/config.json (public settings seeded)"],skipped:[]}:{created:[],skipped:[".aide/config.json"]}}let i=new Wr(t);return r&&i.reset(),i.set("contributor",e),qm(t),{created:[".aide/config.json"],skipped:[]}}function PR(t){let e=ge.default.join(t,".gitignore"),r=[],o=[],n="";Z.default.existsSync(e)&&(n=Z.default.readFileSync(e,"utf8"));let i=n.split(`
|
|
167
|
+
`),s=[];for(let a of yk)i.some(c=>c.trim()===a)?o.push(`.gitignore entry: ${a}`):(s.push(a),r.push(`.gitignore entry: ${a}`));if(s.length>0){let c=`${n.length>0&&!n.endsWith(`
|
|
167
168
|
`)?`
|
|
168
169
|
`:""}
|
|
169
170
|
# aide-memory
|
|
170
|
-
${
|
|
171
|
+
${s.join(`
|
|
171
172
|
`)}
|
|
172
|
-
`;
|
|
173
|
-
${
|
|
174
|
-
${
|
|
175
|
-
`;if(
|
|
173
|
+
`;Z.default.writeFileSync(e,n+c,"utf8")}return{created:r,skipped:o}}function RR(t){let e=[],r=[],o=Nm(t),n=jm(t,o);return n.changed&&n.message?e.push(n.message):!n.changed&&o&&r.push(".ignore (aide-memory section already present)"),{created:e,skipped:r}}function $k(t,e){let r=[],o=[],n=[],i="",s=t;for(let l=0;l<20;l++){let d=ge.default.join(s,".git");if(Z.default.existsSync(d)&&Z.default.statSync(d).isDirectory()){i=d;break}let p=ge.default.dirname(s);if(p===s||s!==t&&Z.default.existsSync(ge.default.join(p,".aide")))break;s=p}if(!i)return n.push("No git repository found \u2014 skipping post-checkout hook"),{created:r,skipped:o,warnings:n};let a=ge.default.join(i,"hooks");Z.default.existsSync(a)||Z.default.mkdirSync(a,{recursive:!0});let c=ge.default.join(a,"post-checkout"),u=`${Um}
|
|
174
|
+
${wR}
|
|
175
|
+
${Zm}
|
|
176
|
+
`;if(Z.default.existsSync(c)){let l=Z.default.readFileSync(c,"utf8");if(l.includes(Um)){if(!e)return o.push(".git/hooks/post-checkout (aide section already present)"),{created:r,skipped:o,warnings:n};let d=l.substring(0,l.indexOf(Um)),p=l.indexOf(Zm),f=p>=0?l.substring(p+Zm.length+1):"";Z.default.writeFileSync(c,d+u+f,"utf8")}else{let d=l.endsWith(`
|
|
176
177
|
`)?"":`
|
|
177
|
-
`;
|
|
178
|
-
`+
|
|
178
|
+
`;Z.default.writeFileSync(c,l+d+`
|
|
179
|
+
`+u,"utf8")}}else Z.default.writeFileSync(c,`#!/bin/bash
|
|
179
180
|
|
|
180
|
-
`+
|
|
181
|
-
`+
|
|
181
|
+
`+u,"utf8");return Z.default.chmodSync(c,493),r.push(".git/hooks/post-checkout"),{created:r,skipped:o,warnings:n}}async function Vm(t,e){let r=ge.default.resolve(t),o=e?.force??!1,n={created:[],skipped:[],warnings:[]};if(e?.updateRules){let y=us(r),x=Fm(r,y,!0);n.created.push(...x.created),n.skipped.push(...x.skipped);try{let v=ou(ot(),r,{contributor:y,tools_list:Po});for(let P of v)P.written&&n.created.push(`${P.dest} (rules regenerated)`),P.budgetWarning&&n.warnings.push(P.budgetWarning)}catch(v){n.warnings.push(`rulesGen: ${v.message}`)}return n}SR()&&n.warnings.push("aide-memory is running from the npx cache. Hook and MCP paths may break if the cache is cleaned, Node version changes, or aide-memory is upgraded. For a stable install, run: npm install -g aide-memory && aide-memory init");let i=us(r),s=zR(r,o);n.created.push(...s.created),n.skipped.push(...s.skipped);let a=Fm(r,i,o);n.created.push(...a.created),n.skipped.push(...a.skipped);let c=iu(),u;try{u=JSON.parse(Z.default.readFileSync(ge.default.join(c,"package.json"),"utf8")).version}catch{}for(let y of nu()){let x=vk(y,r,o,u);n.created.push(...x.created),n.skipped.push(...x.skipped)}for(let y of Mm()){let x=_k(y,r,o);n.created.push(...x.created),n.skipped.push(...x.skipped)}let l=OR(r,i,o);n.created.push(...l.created),n.skipped.push(...l.skipped);let d=TR(r,o);n.created.push(...d.created),n.skipped.push(...d.skipped);let p=PR(r);n.created.push(...p.created),n.skipped.push(...p.skipped);let f=RR(r);n.created.push(...f.created),n.skipped.push(...f.skipped);let m=$k(r,o);n.created.push(...m.created),n.skipped.push(...m.skipped),n.warnings.push(...m.warnings);try{let y=ou(ot(),r,{contributor:i,tools_list:Po});for(let x of y)x.written&&n.created.push(`${x.dest} (rules regenerated)`),x.budgetWarning&&n.warnings.push(x.budgetWarning)}catch(y){n.warnings.push(`rulesGen: ${y.message}`)}return n.warnings.push("Restart your editor (or start a fresh session) to ensure the MCP server is picked up."),Z.default.existsSync(ge.default.join(r,".cursor"))&&n.warnings.push("For Cursor: also enable aide-memory in Settings > MCP after restart."),n}function su(t){let e=[];try{let r=Nm(t),o=jm(t,r);o.changed&&o.message&&e.push(o.message)}catch{}return e}function jR(t,e){let r=[];try{try{let c=su(t);r.push(...c)}catch{}let o=!1;for(let c of nu()){let u=ge.default.join(t,c.hookConfigPath);if(!Z.default.existsSync(u)){o=!0;break}try{let d=JSON.parse(Z.default.readFileSync(u,"utf8"))._aideMemoryVersion;if(!d||NR(d,e)){o=!0;break}}catch{o=!0;break}}if(!o)return r;for(let c of nu()){let u=vk(c,t,!0,e);for(let l of u.created)r.push(`${l} (auto-updated)`)}for(let c of Mm()){let u=_k(c,t,!0);r.push(...u.created)}let n=ge.default.join(t,".claude","rules","aide-memory.md");if(Z.default.existsSync(n)){let c=Fm(t,"",!0);r.push(...c.created)}for(let c of gk){let u=ge.default.join(t,c);Z.default.existsSync(u)||(Z.default.mkdirSync(u,{recursive:!0}),r.push(`${c}/ (created)`))}let i=ge.default.join(t,".gitignore");if(Z.default.existsSync(i)){let c=Z.default.readFileSync(i,"utf8"),u=yk.filter(l=>!c.includes(l));u.length>0&&(Z.default.appendFileSync(i,`
|
|
182
|
+
`+u.join(`
|
|
182
183
|
`)+`
|
|
183
|
-
`,"utf8"),
|
|
184
|
-
`).filter(a=>a.trim().length>0);if(
|
|
184
|
+
`,"utf8"),r.push(`.gitignore (${u.length} entries added)`))}let s=$k(t,!0);s.created.length>0&&r.push(...s.created),qm(t).written&&r.push(".aide/config.json (public settings seeded)")}catch{}return r}function NR(t,e){let r=i=>i.replace(/^v/,"").split(".").map(Number),o=r(t),n=r(e);for(let i=0;i<3;i++){if((o[i]||0)<(n[i]||0))return!0;if((o[i]||0)>(n[i]||0))return!1}return!1}function CR(t,e){let r=ge.default.join(t,".aide","pending-memories.jsonl");if(!Z.default.existsSync(r))return 0;let o;try{o=Z.default.readFileSync(r,"utf8")}catch{return 0}let n=o.split(`
|
|
185
|
+
`).filter(a=>a.trim().length>0);if(n.length===0){try{Z.default.unlinkSync(r)}catch{}return 0}let i=0,s=[];for(let a of n)try{let c=JSON.parse(a),u=c.what??c.content;if(!c.layer||!u){s.push(a);continue}e.add({layer:c.layer,what:u,why:c.why,scope:c.scope??void 0,context_label:c.context_label,contributor:c.contributor,tags:Array.isArray(c.tags)?c.tags:void 0,source:c.source??"hook",shared:typeof c.shared=="boolean"?c.shared:void 0,priority:c.priority,generated_by:c.generated_by}),i++}catch{s.push(a)}if(i>0){let a=`${r}.imported-${Date.now()}`;try{Z.default.renameSync(r,a)}catch{}}if(s.length>0)try{Z.default.writeFileSync(r,s.join(`
|
|
185
186
|
`)+`
|
|
186
|
-
`,"utf8")}catch{}else if(
|
|
187
|
+
`,"utf8")}catch{}else if(i===0)try{Z.default.unlinkSync(r)}catch{}return i}var Z,ge,Lm,gk,yk,Um,Zm,wR,Po,Zn=g(()=>{"use strict";Z=C(require("fs")),ge=C(require("path")),Lm=require("child_process");Qc();ok();is();Qt();Om();Gr();Cm();gk=[".aide",".aide/memories",".aide/memories/preferences",".aide/memories/preferences/personal",".aide/memories/preferences/shared",".aide/memories/technical",".aide/memories/area_context",".aide/memories/guidelines",".aide/cache"],yk=[".aide/memories/preferences/personal/",".aide/cache/",".aide/recall-log.jsonl",".aide/pending-memories.jsonl",".cursor/rules/aide-memory.mdc"],Um="# >>> aide-memory post-checkout hook >>>",Zm="# <<< aide-memory post-checkout hook <<<",wR=`
|
|
187
188
|
# Rebuild aide-memory SQLite index from .aide/memories/ files after checkout.
|
|
188
189
|
# This keeps the cached index in sync when switching branches.
|
|
189
190
|
if command -v aide >/dev/null 2>&1; then
|
|
190
191
|
aide reindex --quiet &
|
|
191
192
|
fi
|
|
192
|
-
`;
|
|
193
|
+
`;Po="- `aide_recall` \u2014 retrieve stored context for file paths you're about to work on\n- `aide_remember` \u2014 store discoveries, decisions, corrections, and preferences\n- `aide_update` \u2014 update an existing memory when information changes\n- `aide_forget` \u2014 remove outdated memories\n- `aide_search` \u2014 find memories by keyword\n- `aide_import` \u2014 seed knowledge from existing markdown docs\n- `aide_memories` \u2014 list all stored memories"});function DR(t,e,r){if(!t.needsDynamicRules)return"";let{content:o}=Bc(e,r),n="";try{let a=require("os"),c=Kr.resolve(as(),"src","cli");if(!He.existsSync(c)){let u=Kr.join(as(),"package.json"),l=JSON.parse(He.readFileSync(u,"utf8")).version,d=Kr.join(a.homedir(),".aide","update-check.json");if(He.existsSync(d)){let p=JSON.parse(He.readFileSync(d,"utf8"));if(p.latestVersion&&p.latestVersion!==l){let f=l.replace(/^v/,"").split(".").map(Number),m=p.latestVersion.replace(/^v/,"").split(".").map(Number);(m[0]>f[0]||m[0]===f[0]&&m[1]>f[1]||m[0]===f[0]&&m[1]===f[1]&&m[2]>f[2])&&(n=`
|
|
193
194
|
## Update available
|
|
194
|
-
aide-memory v${
|
|
195
|
-
`)}}}}catch{}if(!
|
|
196
|
-
`)];return
|
|
197
|
-
`),
|
|
195
|
+
aide-memory v${p.latestVersion} is available (current: v${l}). Tell the user to run \`npm update -g aide-memory\` to upgrade.
|
|
196
|
+
`)}}}}catch{}if(!o&&!n)return"";let s=[[xk,"<!-- Content below reflects current memories + config. Do not edit by hand; -->","<!-- changes will be overwritten on the next memory / config write. -->",""].join(`
|
|
197
|
+
`)];return o&&(s.push(`## Current memory context
|
|
198
|
+
`),s.push(o)),n&&s.push(n),s.join(`
|
|
198
199
|
`)+`
|
|
199
|
-
`}function
|
|
200
|
+
`}function MR(t,e,r){let o={adapterId:t.id,dest:"",written:!1};if(!t.supportsRules||t.rules.length===0)return o;let n=t.rules[0];if(o.dest=n.dest,!t.needsDynamicRules)return o;let i=Kr.join(e,n.dest),s=Kr.dirname(i);He.existsSync(s)||He.mkdirSync(s,{recursive:!0});let a=new $e({projectRoot:e}),c;try{c=DR(t,e,a)}finally{a.close()}let u;if(He.existsSync(i)){let d=He.readFileSync(i,"utf8"),p=d.indexOf(xk);if(!c)return o;if(p===-1)u=d.replace(/\n+$/,"")+`
|
|
200
201
|
|
|
201
|
-
`+c;else{let
|
|
202
|
-
`,
|
|
202
|
+
`+c;else{let f=d.lastIndexOf(`
|
|
203
|
+
`,p)+1;u=d.slice(0,f).replace(/\n+$/,"")+`
|
|
203
204
|
|
|
204
|
-
`+c}}else{let d=
|
|
205
|
-
`+c:d}let
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
`)
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
`),s=n.last?parseInt(n.last,10):o.length,i=o.slice(-s).map(p=>{try{return JSON.parse(p)}catch{return null}}).filter(Boolean);if(i.length===0){console.log(N.default.yellow("No valid recall log entries found."));return}let a=i.filter(p=>!p.event),c=i.filter(p=>p.event);console.log(N.default.white.bold(`Event Log \u2014 ${i.length} event(s)
|
|
212
|
-
`));let l=0,u=0;for(let p of i){let R=new Date(p.timestamp).toLocaleString();if(p.event&&p.memory){u++;let m=p.event==="memory_stored"?v("STORED"):p.event==="memory_updated"?N.default.yellow("UPDATED"):N.default.red("DELETED");console.log(`${m} ${N.default.gray(`(${R})`)}`),console.log(` [${p.memory.id}] ${N.default.white(p.memory.what)}`);let S=ue[p.memory.layer]??p.memory.layer;console.log(N.default.gray(` Layer: ${S} | Scope: ${p.memory.scope??"project-wide"}`)),p.memory.why&&console.log(N.default.gray(` Why: ${p.memory.why}`))}else if(p.query&&p.memories_returned)if(l++,console.log(v.bold(`\u2500\u2500 Recall #${l} `)+N.default.gray(`(${R})`)),console.log(N.default.gray(` Query paths: ${p.query.paths.length>0?p.query.paths.join(", "):"(none)"}`)),p.query.text&&console.log(N.default.gray(` Query text: ${p.query.text}`)),p.query.layers&&console.log(N.default.gray(` Layers: ${p.query.layers.join(", ")}`)),console.log(N.default.gray(` Matched scopes: ${p.matched_scopes&&p.matched_scopes.length>0?p.matched_scopes.join(", "):"(none)"}`)),console.log(),p.memories_returned.length===0)console.log(N.default.yellow(" No memories returned."));else{console.log(N.default.white(` ${p.memories_returned.length} memor${p.memories_returned.length===1?"y":"ies"} returned:`)),console.log();for(let m of p.memories_returned){let S=ue[m.layer]??m.layer;console.log(` ${v("\u2713")} [${m.id}] ${N.default.white(m.what)}`),console.log(N.default.gray(` Layer: ${S} | Scope: ${m.scope??"project-wide"} | Recalled: ${m.recalled_count}x`)),m.tags.length>0&&console.log(N.default.gray(` Tags: ${m.tags.join(", ")}`))}}console.log()}let d=a.length,f=a.reduce((p,R)=>p+(R.count??0),0),y=a.filter(p=>(p.count??0)===0).length,h=c.filter(p=>p.event==="memory_stored").length,w=c.filter(p=>p.event==="memory_updated").length,E=c.filter(p=>p.event==="memory_deleted").length;console.log(N.default.white.bold("Summary")),console.log(` Recall events: ${d}`),console.log(` Total memories returned: ${f}`),console.log(` Empty recalls (0 results): ${y}`),d>0&&console.log(` Avg memories per recall: ${(f/d).toFixed(1)}`),console.log(` Memories stored: ${h}`),console.log(` Memories updated: ${w}`),console.log(` Memories deleted: ${E}`)}var se=g(J()),Yr=g(require("path")),Ve=g(require("fs"));it();tt();Lt();Ce();ne();function ys(n){return Yr.default.join(n,".aide","config.json")}function bs(n){if(!Ve.default.existsSync(n))return{};let e=Ve.default.readFileSync(n,"utf-8");return JSON.parse(e)}function za(n,e){let t=Yr.default.dirname(n);Ve.default.existsSync(t)||Ve.default.mkdirSync(t,{recursive:!0}),Ve.default.writeFileSync(n,JSON.stringify(e,null,2)+`
|
|
213
|
-
`)
|
|
214
|
-
`)}}function ws(n,e){if(n==="list"&&e===void 0){rc();return}let t=M(),r=ys(t),o=bs(r),s=tc(n);if(!s.ok){console.error(se.default.red(s.message)),process.exitCode=1;return}if(e===void 0){let i=_s(o,n);console.log(i===void 0?se.default.gray("(not set)"):typeof i=="object"?JSON.stringify(i,null,2):String(i))}else{let i=Za(e);Qa(o,n,i),za(r,o),console.log(v(`Set ${n} = ${JSON.stringify(i)}`)),nc(t,n,i)}}function rc(){let n=M(),e=ys(n),t=bs(e),r=Se(),o=Object.keys(r).filter(s=>r[s].public===!0).sort();if(o.length===0){console.log(se.default.gray("(no public settings registered)"));return}console.log(v("aide-memory \xB7 configurable settings")),console.log("");for(let s of o){let i=r[s],a=_s(t,s),c=a!==void 0,l=typeof i.value=="object"?JSON.stringify(i.value):String(i.value),u=c?typeof a=="object"?JSON.stringify(a):String(a):se.default.gray("(default)");if(console.log(se.default.bold(s)),console.log(` current: ${c?se.default.cyan(u):u}`),console.log(` default: ${se.default.gray(l)}`),i.description){let d=i.description.split(`
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
205
|
+
`+c}}else{let d=Xc(t,r);u=c?d+`
|
|
206
|
+
`+c:d}let l=`${i}.tmp`;try{He.writeFileSync(l,u,"utf8"),He.renameSync(l,i),o.written=!0}catch(d){try{He.existsSync(l)&&He.unlinkSync(l)}catch{}return console.warn(`aide-memory: failed to regenerate ${n.dest}: ${d.message}`),o}if(u.length>AR){let d=Math.round(u.length/4);o.budgetWarning=`${n.dest} is ~${d} tokens \u2014 above Cursor's ~2000-token soft cap for alwaysApply rules. Consider lowering injection.maxChars or disabling layers you don't need in SessionStart (see docs/user/editors/cursor.md).`,console.warn(`aide-memory: ${o.budgetWarning}`)}return o}function ou(t,e,r){let o=[];for(let n of t)if(n.supportsRules)try{o.push(MR(n,e,r))}catch(i){console.warn(`aide-memory: rulesGen failed for ${n.id}: ${i.message}`),o.push({adapterId:n.id,dest:n.rules[0]?.dest??"",written:!1})}return o}function er(t){return t?t.priority==="always"||t.layer==="preferences"||t.layer==="guidelines":!1}function Mt(t,e){try{let r=us(e)||"unknown";return ou(t,e,{contributor:r,tools_list:Po})}catch(r){return console.warn(`aide-memory: triggerRulesRegen failed: ${r.message}`),[]}}var He,Kr,AR,xk,Gr=g(()=>{"use strict";He=C(require("fs")),Kr=C(require("path"));Ot();zm();Om();Zn();Gc();AR=8e3,xk="<!-- \u2500\u2500\u2500 AUTOGENERATED section \u2014 regenerated by aide-memory \u2500\u2500\u2500 -->"});var bw={};bt(bw,{checkForUpdates:()=>ah,checkMinVersion:()=>yj,printRequiredUpdateNotice:()=>vj,printUpdateNotice:()=>ch});function _w(){return sh.default.join(vw.default.homedir(),".aide","update-check.json")}function fj(){let t=_w();try{if(!Do.default.existsSync(t))return null;let e=Do.default.readFileSync(t,"utf-8");return JSON.parse(e)}catch{return null}}function mj(t){let e=_w();try{let r=sh.default.dirname(e);Do.default.existsSync(r)||Do.default.mkdirSync(r,{recursive:!0}),Do.default.writeFileSync(e,JSON.stringify(t),"utf-8")}catch{}}function hj(){return new Promise(t=>{let e=yw.default.get(dj,{timeout:5e3},r=>{if(r.statusCode!==200){r.resume(),t(null);return}let o="";r.on("data",n=>{o+=n.toString()}),r.on("end",()=>{try{let n=JSON.parse(o);t(n.version??null)}catch{t(null)}})});e.on("error",()=>t(null)),e.on("timeout",()=>{e.destroy(),t(null)})})}function ih(t,e){let r=i=>{let s=i.replace(/^v/,"").split(".").map(Number);return{major:s[0]||0,minor:s[1]||0,patch:s[2]||0}},o=r(t),n=r(e);return n.major!==o.major?n.major>o.major:n.minor!==o.minor?n.minor>o.minor:n.patch>o.patch}function gj(){try{if(process.env.AIDE_MEMORY_FORCE_REGISTRY_CHECK==="1")return!1;let t=require("fs"),r=require("path").resolve(__dirname,"..","..","src","cli");return t.existsSync(r)}catch{return!1}}async function ah(t){if(gj())return null;try{let e=fj();if(e&&Date.now()-e.lastCheck<pj)return e.latestVersion&&ih(t,e.latestVersion)?e.latestVersion:null;let r=await hj();return mj({lastCheck:Date.now(),latestVersion:r}),r&&ih(t,r)?r:null}catch{return null}}function yj(t){return oh&&ih(t,oh)?oh:null}function ch(t,e){console.error(`
|
|
207
|
+
aide-memory v${e} available (current: v${t}).
|
|
208
|
+
Run \`npm update -g aide-memory\` to update.
|
|
209
|
+
`)}function vj(t,e){console.error(`
|
|
210
|
+
\u26A0 aide-memory v${t} is below minimum required v${e}.
|
|
211
|
+
Run \`npm update -g aide-memory\` to update.
|
|
212
|
+
`)}var yw,Do,sh,vw,dj,pj,oh,uh=g(()=>{"use strict";yw=C(require("https")),Do=C(require("fs")),sh=C(require("path")),vw=C(require("os")),dj="https://registry.npmjs.org/aide-memory/latest",pj=1440*60*1e3;oh=null});var ue,$w,D,Nr,gs=g(()=>{(function(t){t.assertEqual=n=>{};function e(n){}t.assertIs=e;function r(n){throw new Error}t.assertNever=r,t.arrayToEnum=n=>{let i={};for(let s of n)i[s]=s;return i},t.getValidEnumValues=n=>{let i=t.objectKeys(n).filter(a=>typeof n[n[a]]!="number"),s={};for(let a of i)s[a]=n[a];return t.objectValues(s)},t.objectValues=n=>t.objectKeys(n).map(function(i){return n[i]}),t.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let i=[];for(let s in n)Object.prototype.hasOwnProperty.call(n,s)&&i.push(s);return i},t.find=(n,i)=>{for(let s of n)if(i(s))return s},t.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function o(n,i=" | "){return n.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}t.joinValues=o,t.jsonStringifyReplacer=(n,i)=>typeof i=="bigint"?i.toString():i})(ue||(ue={}));(function(t){t.mergeShapes=(e,r)=>({...e,...r})})($w||($w={}));D=ue.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Nr=t=>{switch(typeof t){case"undefined":return D.undefined;case"string":return D.string;case"number":return Number.isNaN(t)?D.nan:D.number;case"boolean":return D.boolean;case"function":return D.function;case"bigint":return D.bigint;case"symbol":return D.symbol;case"object":return Array.isArray(t)?D.array:t===null?D.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?D.promise:typeof Map<"u"&&t instanceof Map?D.map:typeof Set<"u"&&t instanceof Set?D.set:typeof Date<"u"&&t instanceof Date?D.date:D.object;default:return D.unknown}}});var S,Pt,fu=g(()=>{gs();S=ue.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Pt=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(i){return i.message},o={_errors:[]},n=i=>{for(let s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(n);else if(s.code==="invalid_return_type")n(s.returnTypeError);else if(s.code==="invalid_arguments")n(s.argumentsError);else if(s.path.length===0)o._errors.push(r(s));else{let a=o,c=0;for(;c<s.path.length;){let u=s.path[c];c===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(s))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return n(this),o}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ue.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r=Object.create(null),o=[];for(let n of this.issues)if(n.path.length>0){let i=n.path[0];r[i]=r[i]||[],r[i].push(e(n))}else o.push(e(n));return{formErrors:o,fieldErrors:r}}get formErrors(){return this.flatten()}};Pt.create=t=>new Pt(t)});var _j,en,lh=g(()=>{fu();gs();_j=(t,e)=>{let r;switch(t.code){case S.invalid_type:t.received===D.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case S.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,ue.jsonStringifyReplacer)}`;break;case S.unrecognized_keys:r=`Unrecognized key(s) in object: ${ue.joinValues(t.keys,", ")}`;break;case S.invalid_union:r="Invalid input";break;case S.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ue.joinValues(t.options)}`;break;case S.invalid_enum_value:r=`Invalid enum value. Expected ${ue.joinValues(t.options)}, received '${t.received}'`;break;case S.invalid_arguments:r="Invalid function arguments";break;case S.invalid_return_type:r="Invalid function return type";break;case S.invalid_date:r="Invalid date";break;case S.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:ue.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case S.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case S.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case S.custom:r="Invalid input";break;case S.invalid_intersection_types:r="Intersection results could not be merged";break;case S.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case S.not_finite:r="Number must be finite";break;default:r=e.defaultError,ue.assertNever(t)}return{message:r}},en=_j});function ys(){return bj}var bj,mu=g(()=>{lh();bj=en});function j(t,e){let r=ys(),o=hu({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===en?void 0:en].filter(n=>!!n)});t.common.issues.push(o)}var hu,st,J,Mo,mt,dh,ph,qn,vs,fh=g(()=>{mu();lh();hu=t=>{let{data:e,path:r,errorMaps:o,issueData:n}=t,i=[...r,...n.path||[]],s={...n,path:i};if(n.message!==void 0)return{...n,path:i,message:n.message};let a="",c=o.filter(u=>!!u).slice().reverse();for(let u of c)a=u(s,{data:e,defaultError:a}).message;return{...n,path:i,message:a}};st=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let o=[];for(let n of r){if(n.status==="aborted")return J;n.status==="dirty"&&e.dirty(),o.push(n.value)}return{status:e.value,value:o}}static async mergeObjectAsync(e,r){let o=[];for(let n of r){let i=await n.key,s=await n.value;o.push({key:i,value:s})}return t.mergeObjectSync(e,o)}static mergeObjectSync(e,r){let o={};for(let n of r){let{key:i,value:s}=n;if(i.status==="aborted"||s.status==="aborted")return J;i.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof s.value<"u"||n.alwaysSet)&&(o[i.value]=s.value)}return{status:e.value,value:o}}},J=Object.freeze({status:"aborted"}),Mo=t=>({status:"dirty",value:t}),mt=t=>({status:"valid",value:t}),dh=t=>t.status==="aborted",ph=t=>t.status==="dirty",qn=t=>t.status==="valid",vs=t=>typeof Promise<"u"&&t instanceof Promise});var xw=g(()=>{});var U,kw=g(()=>{(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(U||(U={}))});function Y(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:o,description:n}=t;if(e&&(r||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(s,a)=>{let{message:c}=t;return s.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??o??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:c??r??a.defaultError}},description:n}}function Ew(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function Dj(t){return new RegExp(`^${Ew(t)}$`)}function Mj(t){let e=`${Sw}T${Ew(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function Uj(t,e){return!!((e==="v4"||!e)&&Oj.test(t)||(e==="v6"||!e)&&Rj.test(t))}function Zj(t,e){if(!Ej.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let o=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),n=JSON.parse(atob(o));return!(typeof n!="object"||n===null||"typ"in n&&n?.typ!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function Lj(t,e){return!!((e==="v4"||!e)&&Pj.test(t)||(e==="v6"||!e)&&jj.test(t))}function Fj(t,e){let r=(t.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,n=r>o?r:o,i=Number.parseInt(t.toFixed(n).replace(".","")),s=Number.parseInt(e.toFixed(n).replace(".",""));return i%s/10**n}function Uo(t){if(t instanceof Rt){let e={};for(let r in t.shape){let o=t.shape[r];e[r]=or.create(Uo(o))}return new Rt({...t._def,shape:()=>e})}else return t instanceof rn?new rn({...t._def,type:Uo(t.element)}):t instanceof or?or.create(Uo(t.unwrap())):t instanceof Dr?Dr.create(Uo(t.unwrap())):t instanceof Ar?Ar.create(t.items.map(e=>Uo(e))):t}function gh(t,e){let r=Nr(t),o=Nr(e);if(t===e)return{valid:!0,data:t};if(r===D.object&&o===D.object){let n=ue.objectKeys(e),i=ue.objectKeys(t).filter(a=>n.indexOf(a)!==-1),s={...t,...e};for(let a of i){let c=gh(t[a],e[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(r===D.array&&o===D.array){if(t.length!==e.length)return{valid:!1};let n=[];for(let i=0;i<t.length;i++){let s=t[i],a=e[i],c=gh(s,a);if(!c.valid)return{valid:!1};n.push(c.data)}return{valid:!0,data:n}}else return r===D.date&&o===D.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}function Iw(t,e){return new Bo({values:t,typeName:z.ZodEnum,...Y(e)})}var Lt,ww,oe,$j,xj,kj,wj,Sj,Ej,Ij,zj,Tj,mh,Oj,Pj,Rj,jj,Nj,Cj,Sw,Aj,Zo,_s,bs,$s,xs,ks,Lo,Fo,ws,tn,br,Ss,rn,Rt,qo,Cr,hh,Vo,Ar,yh,Es,Is,vh,Ho,Jo,Bo,Wo,Vn,ir,or,Dr,Go,Ko,zs,gu,yu,Xo,$q,z,xq,kq,wq,Sq,Eq,Iq,zq,Tq,Oq,Pq,Rq,jq,Nq,Cq,zw,Aq,Dq,Mq,Uq,Zq,Lq,Fq,qq,Vq,Hq,Jq,Bq,Wq,Gq,Kq,Xq,Yq,Qq,e9,Tw=g(()=>{fu();mu();kw();fh();gs();Lt=class{constructor(e,r,o,n){this._cachedPath=[],this.parent=e,this.data=r,this._path=o,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},ww=(t,e)=>{if(qn(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Pt(t.common.issues);return this._error=r,this._error}}};oe=class{get description(){return this._def.description}_getType(e){return Nr(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Nr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new st,ctx:{common:e.parent.common,data:e.data,parsedType:Nr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(vs(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let o=this.safeParse(e,r);if(o.success)return o.data;throw o.error}safeParse(e,r){let o={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Nr(e)},n=this._parseSync({data:e,path:o.path,parent:o});return ww(o,n)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Nr(e)};if(!this["~standard"].async)try{let o=this._parseSync({data:e,path:[],parent:r});return qn(o)?{value:o.value}:{issues:r.common.issues}}catch(o){o?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(o=>qn(o)?{value:o.value}:{issues:r.common.issues})}async parseAsync(e,r){let o=await this.safeParseAsync(e,r);if(o.success)return o.data;throw o.error}async safeParseAsync(e,r){let o={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Nr(e)},n=this._parse({data:e,path:o.path,parent:o}),i=await(vs(n)?n:Promise.resolve(n));return ww(o,i)}refine(e,r){let o=n=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(n):r;return this._refinement((n,i)=>{let s=e(n),a=()=>i.addIssue({code:S.custom,...o(n)});return typeof Promise<"u"&&s instanceof Promise?s.then(c=>c?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,r){return this._refinement((o,n)=>e(o)?!0:(n.addIssue(typeof r=="function"?r(o,n):r),!1))}_refinement(e){return new ir({schema:this,typeName:z.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return or.create(this,this._def)}nullable(){return Dr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return rn.create(this)}promise(){return Vn.create(this,this._def)}or(e){return qo.create([this,e],this._def)}and(e){return Vo.create(this,e,this._def)}transform(e){return new ir({...Y(this._def),schema:this,typeName:z.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Go({...Y(this._def),innerType:this,defaultValue:r,typeName:z.ZodDefault})}brand(){return new gu({typeName:z.ZodBranded,type:this,...Y(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Ko({...Y(this._def),innerType:this,catchValue:r,typeName:z.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return yu.create(this,e)}readonly(){return Xo.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},$j=/^c[^\s-]{8,}$/i,xj=/^[0-9a-z]+$/,kj=/^[0-9A-HJKMNP-TV-Z]{26}$/i,wj=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Sj=/^[a-z0-9_-]{21}$/i,Ej=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ij=/^[-+]?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)?)??$/,zj=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Tj="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Oj=/^(?:(?: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])$/,Pj=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Rj=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,jj=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Nj=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Cj=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Sw="((\\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])))",Aj=new RegExp(`^${Sw}$`);Zo=class t extends oe{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==D.string){let i=this._getOrReturnCtx(e);return j(i,{code:S.invalid_type,expected:D.string,received:i.parsedType}),J}let o=new st,n;for(let i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),j(n,{code:S.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),o.dirty());else if(i.kind==="max")e.data.length>i.value&&(n=this._getOrReturnCtx(e,n),j(n,{code:S.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),o.dirty());else if(i.kind==="length"){let s=e.data.length>i.value,a=e.data.length<i.value;(s||a)&&(n=this._getOrReturnCtx(e,n),s?j(n,{code:S.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&j(n,{code:S.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),o.dirty())}else if(i.kind==="email")zj.test(e.data)||(n=this._getOrReturnCtx(e,n),j(n,{validation:"email",code:S.invalid_string,message:i.message}),o.dirty());else if(i.kind==="emoji")mh||(mh=new RegExp(Tj,"u")),mh.test(e.data)||(n=this._getOrReturnCtx(e,n),j(n,{validation:"emoji",code:S.invalid_string,message:i.message}),o.dirty());else if(i.kind==="uuid")wj.test(e.data)||(n=this._getOrReturnCtx(e,n),j(n,{validation:"uuid",code:S.invalid_string,message:i.message}),o.dirty());else if(i.kind==="nanoid")Sj.test(e.data)||(n=this._getOrReturnCtx(e,n),j(n,{validation:"nanoid",code:S.invalid_string,message:i.message}),o.dirty());else if(i.kind==="cuid")$j.test(e.data)||(n=this._getOrReturnCtx(e,n),j(n,{validation:"cuid",code:S.invalid_string,message:i.message}),o.dirty());else if(i.kind==="cuid2")xj.test(e.data)||(n=this._getOrReturnCtx(e,n),j(n,{validation:"cuid2",code:S.invalid_string,message:i.message}),o.dirty());else if(i.kind==="ulid")kj.test(e.data)||(n=this._getOrReturnCtx(e,n),j(n,{validation:"ulid",code:S.invalid_string,message:i.message}),o.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),j(n,{validation:"url",code:S.invalid_string,message:i.message}),o.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),j(n,{validation:"regex",code:S.invalid_string,message:i.message}),o.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(n=this._getOrReturnCtx(e,n),j(n,{code:S.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),o.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(n=this._getOrReturnCtx(e,n),j(n,{code:S.invalid_string,validation:{startsWith:i.value},message:i.message}),o.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(n=this._getOrReturnCtx(e,n),j(n,{code:S.invalid_string,validation:{endsWith:i.value},message:i.message}),o.dirty()):i.kind==="datetime"?Mj(i).test(e.data)||(n=this._getOrReturnCtx(e,n),j(n,{code:S.invalid_string,validation:"datetime",message:i.message}),o.dirty()):i.kind==="date"?Aj.test(e.data)||(n=this._getOrReturnCtx(e,n),j(n,{code:S.invalid_string,validation:"date",message:i.message}),o.dirty()):i.kind==="time"?Dj(i).test(e.data)||(n=this._getOrReturnCtx(e,n),j(n,{code:S.invalid_string,validation:"time",message:i.message}),o.dirty()):i.kind==="duration"?Ij.test(e.data)||(n=this._getOrReturnCtx(e,n),j(n,{validation:"duration",code:S.invalid_string,message:i.message}),o.dirty()):i.kind==="ip"?Uj(e.data,i.version)||(n=this._getOrReturnCtx(e,n),j(n,{validation:"ip",code:S.invalid_string,message:i.message}),o.dirty()):i.kind==="jwt"?Zj(e.data,i.alg)||(n=this._getOrReturnCtx(e,n),j(n,{validation:"jwt",code:S.invalid_string,message:i.message}),o.dirty()):i.kind==="cidr"?Lj(e.data,i.version)||(n=this._getOrReturnCtx(e,n),j(n,{validation:"cidr",code:S.invalid_string,message:i.message}),o.dirty()):i.kind==="base64"?Nj.test(e.data)||(n=this._getOrReturnCtx(e,n),j(n,{validation:"base64",code:S.invalid_string,message:i.message}),o.dirty()):i.kind==="base64url"?Cj.test(e.data)||(n=this._getOrReturnCtx(e,n),j(n,{validation:"base64url",code:S.invalid_string,message:i.message}),o.dirty()):ue.assertNever(i);return{status:o.value,value:e.data}}_regex(e,r,o){return this.refinement(n=>e.test(n),{validation:r,code:S.invalid_string,...U.errToObj(o)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...U.errToObj(e)})}url(e){return this._addCheck({kind:"url",...U.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...U.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...U.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...U.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...U.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...U.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...U.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...U.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...U.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...U.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...U.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...U.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...U.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...U.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...U.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...U.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...U.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...U.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...U.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...U.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...U.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...U.errToObj(r)})}nonempty(e){return this.min(1,U.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Zo.create=t=>new Zo({checks:[],typeName:z.ZodString,coerce:t?.coerce??!1,...Y(t)});_s=class t extends oe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==D.number){let i=this._getOrReturnCtx(e);return j(i,{code:S.invalid_type,expected:D.number,received:i.parsedType}),J}let o,n=new st;for(let i of this._def.checks)i.kind==="int"?ue.isInteger(e.data)||(o=this._getOrReturnCtx(e,o),j(o,{code:S.invalid_type,expected:"integer",received:"float",message:i.message}),n.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(o=this._getOrReturnCtx(e,o),j(o,{code:S.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),n.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(o=this._getOrReturnCtx(e,o),j(o,{code:S.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),n.dirty()):i.kind==="multipleOf"?Fj(e.data,i.value)!==0&&(o=this._getOrReturnCtx(e,o),j(o,{code:S.not_multiple_of,multipleOf:i.value,message:i.message}),n.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(o=this._getOrReturnCtx(e,o),j(o,{code:S.not_finite,message:i.message}),n.dirty()):ue.assertNever(i);return{status:n.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,U.toString(r))}gt(e,r){return this.setLimit("min",e,!1,U.toString(r))}lte(e,r){return this.setLimit("max",e,!0,U.toString(r))}lt(e,r){return this.setLimit("max",e,!1,U.toString(r))}setLimit(e,r,o,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:o,message:U.toString(n)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:U.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:U.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:U.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:U.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:U.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:U.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:U.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:U.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:U.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ue.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(r===null||o.value>r)&&(r=o.value):o.kind==="max"&&(e===null||o.value<e)&&(e=o.value)}return Number.isFinite(r)&&Number.isFinite(e)}};_s.create=t=>new _s({checks:[],typeName:z.ZodNumber,coerce:t?.coerce||!1,...Y(t)});bs=class t extends oe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==D.bigint)return this._getInvalidInput(e);let o,n=new st;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(o=this._getOrReturnCtx(e,o),j(o,{code:S.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),n.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(o=this._getOrReturnCtx(e,o),j(o,{code:S.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),n.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(o=this._getOrReturnCtx(e,o),j(o,{code:S.not_multiple_of,multipleOf:i.value,message:i.message}),n.dirty()):ue.assertNever(i);return{status:n.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return j(r,{code:S.invalid_type,expected:D.bigint,received:r.parsedType}),J}gte(e,r){return this.setLimit("min",e,!0,U.toString(r))}gt(e,r){return this.setLimit("min",e,!1,U.toString(r))}lte(e,r){return this.setLimit("max",e,!0,U.toString(r))}lt(e,r){return this.setLimit("max",e,!1,U.toString(r))}setLimit(e,r,o,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:o,message:U.toString(n)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:U.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:U.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:U.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:U.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:U.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};bs.create=t=>new bs({checks:[],typeName:z.ZodBigInt,coerce:t?.coerce??!1,...Y(t)});$s=class extends oe{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==D.boolean){let o=this._getOrReturnCtx(e);return j(o,{code:S.invalid_type,expected:D.boolean,received:o.parsedType}),J}return mt(e.data)}};$s.create=t=>new $s({typeName:z.ZodBoolean,coerce:t?.coerce||!1,...Y(t)});xs=class t extends oe{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==D.date){let i=this._getOrReturnCtx(e);return j(i,{code:S.invalid_type,expected:D.date,received:i.parsedType}),J}if(Number.isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return j(i,{code:S.invalid_date}),J}let o=new st,n;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(n=this._getOrReturnCtx(e,n),j(n,{code:S.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),o.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(n=this._getOrReturnCtx(e,n),j(n,{code:S.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),o.dirty()):ue.assertNever(i);return{status:o.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:U.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:U.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};xs.create=t=>new xs({checks:[],coerce:t?.coerce||!1,typeName:z.ZodDate,...Y(t)});ks=class extends oe{_parse(e){if(this._getType(e)!==D.symbol){let o=this._getOrReturnCtx(e);return j(o,{code:S.invalid_type,expected:D.symbol,received:o.parsedType}),J}return mt(e.data)}};ks.create=t=>new ks({typeName:z.ZodSymbol,...Y(t)});Lo=class extends oe{_parse(e){if(this._getType(e)!==D.undefined){let o=this._getOrReturnCtx(e);return j(o,{code:S.invalid_type,expected:D.undefined,received:o.parsedType}),J}return mt(e.data)}};Lo.create=t=>new Lo({typeName:z.ZodUndefined,...Y(t)});Fo=class extends oe{_parse(e){if(this._getType(e)!==D.null){let o=this._getOrReturnCtx(e);return j(o,{code:S.invalid_type,expected:D.null,received:o.parsedType}),J}return mt(e.data)}};Fo.create=t=>new Fo({typeName:z.ZodNull,...Y(t)});ws=class extends oe{constructor(){super(...arguments),this._any=!0}_parse(e){return mt(e.data)}};ws.create=t=>new ws({typeName:z.ZodAny,...Y(t)});tn=class extends oe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return mt(e.data)}};tn.create=t=>new tn({typeName:z.ZodUnknown,...Y(t)});br=class extends oe{_parse(e){let r=this._getOrReturnCtx(e);return j(r,{code:S.invalid_type,expected:D.never,received:r.parsedType}),J}};br.create=t=>new br({typeName:z.ZodNever,...Y(t)});Ss=class extends oe{_parse(e){if(this._getType(e)!==D.undefined){let o=this._getOrReturnCtx(e);return j(o,{code:S.invalid_type,expected:D.void,received:o.parsedType}),J}return mt(e.data)}};Ss.create=t=>new Ss({typeName:z.ZodVoid,...Y(t)});rn=class t extends oe{_parse(e){let{ctx:r,status:o}=this._processInputParams(e),n=this._def;if(r.parsedType!==D.array)return j(r,{code:S.invalid_type,expected:D.array,received:r.parsedType}),J;if(n.exactLength!==null){let s=r.data.length>n.exactLength.value,a=r.data.length<n.exactLength.value;(s||a)&&(j(r,{code:s?S.too_big:S.too_small,minimum:a?n.exactLength.value:void 0,maximum:s?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),o.dirty())}if(n.minLength!==null&&r.data.length<n.minLength.value&&(j(r,{code:S.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),o.dirty()),n.maxLength!==null&&r.data.length>n.maxLength.value&&(j(r,{code:S.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),o.dirty()),r.common.async)return Promise.all([...r.data].map((s,a)=>n.type._parseAsync(new Lt(r,s,r.path,a)))).then(s=>st.mergeArray(o,s));let i=[...r.data].map((s,a)=>n.type._parseSync(new Lt(r,s,r.path,a)));return st.mergeArray(o,i)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:U.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:U.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:U.toString(r)}})}nonempty(e){return this.min(1,e)}};rn.create=(t,e)=>new rn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:z.ZodArray,...Y(e)});Rt=class t extends oe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=ue.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==D.object){let u=this._getOrReturnCtx(e);return j(u,{code:S.invalid_type,expected:D.object,received:u.parsedType}),J}let{status:o,ctx:n}=this._processInputParams(e),{shape:i,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof br&&this._def.unknownKeys==="strip"))for(let u in n.data)s.includes(u)||a.push(u);let c=[];for(let u of s){let l=i[u],d=n.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new Lt(n,d,n.path,u)),alwaysSet:u in n.data})}if(this._def.catchall instanceof br){let u=this._def.unknownKeys;if(u==="passthrough")for(let l of a)c.push({key:{status:"valid",value:l},value:{status:"valid",value:n.data[l]}});else if(u==="strict")a.length>0&&(j(n,{code:S.unrecognized_keys,keys:a}),o.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let l of a){let d=n.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new Lt(n,d,n.path,l)),alwaysSet:l in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let u=[];for(let l of c){let d=await l.key,p=await l.value;u.push({key:d,value:p,alwaysSet:l.alwaysSet})}return u}).then(u=>st.mergeObjectSync(o,u)):st.mergeObjectSync(o,c)}get shape(){return this._def.shape()}strict(e){return U.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,o)=>{let n=this._def.errorMap?.(r,o).message??o.defaultError;return r.code==="unrecognized_keys"?{message:U.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:z.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let o of ue.objectKeys(e))e[o]&&this.shape[o]&&(r[o]=this.shape[o]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let o of ue.objectKeys(this.shape))e[o]||(r[o]=this.shape[o]);return new t({...this._def,shape:()=>r})}deepPartial(){return Uo(this)}partial(e){let r={};for(let o of ue.objectKeys(this.shape)){let n=this.shape[o];e&&!e[o]?r[o]=n:r[o]=n.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let o of ue.objectKeys(this.shape))if(e&&!e[o])r[o]=this.shape[o];else{let i=this.shape[o];for(;i instanceof or;)i=i._def.innerType;r[o]=i}return new t({...this._def,shape:()=>r})}keyof(){return Iw(ue.objectKeys(this.shape))}};Rt.create=(t,e)=>new Rt({shape:()=>t,unknownKeys:"strip",catchall:br.create(),typeName:z.ZodObject,...Y(e)});Rt.strictCreate=(t,e)=>new Rt({shape:()=>t,unknownKeys:"strict",catchall:br.create(),typeName:z.ZodObject,...Y(e)});Rt.lazycreate=(t,e)=>new Rt({shape:t,unknownKeys:"strip",catchall:br.create(),typeName:z.ZodObject,...Y(e)});qo=class extends oe{_parse(e){let{ctx:r}=this._processInputParams(e),o=this._def.options;function n(i){for(let a of i)if(a.result.status==="valid")return a.result;for(let a of i)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let s=i.map(a=>new Pt(a.ctx.common.issues));return j(r,{code:S.invalid_union,unionErrors:s}),J}if(r.common.async)return Promise.all(o.map(async i=>{let s={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(n);{let i,s=[];for(let c of o){let u={...r,common:{...r.common,issues:[]},parent:null},l=c._parseSync({data:r.data,path:r.path,parent:u});if(l.status==="valid")return l;l.status==="dirty"&&!i&&(i={result:l,ctx:u}),u.common.issues.length&&s.push(u.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let a=s.map(c=>new Pt(c));return j(r,{code:S.invalid_union,unionErrors:a}),J}}get options(){return this._def.options}};qo.create=(t,e)=>new qo({options:t,typeName:z.ZodUnion,...Y(e)});Cr=t=>t instanceof Ho?Cr(t.schema):t instanceof ir?Cr(t.innerType()):t instanceof Jo?[t.value]:t instanceof Bo?t.options:t instanceof Wo?ue.objectValues(t.enum):t instanceof Go?Cr(t._def.innerType):t instanceof Lo?[void 0]:t instanceof Fo?[null]:t instanceof or?[void 0,...Cr(t.unwrap())]:t instanceof Dr?[null,...Cr(t.unwrap())]:t instanceof gu||t instanceof Xo?Cr(t.unwrap()):t instanceof Ko?Cr(t._def.innerType):[],hh=class t extends oe{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==D.object)return j(r,{code:S.invalid_type,expected:D.object,received:r.parsedType}),J;let o=this.discriminator,n=r.data[o],i=this.optionsMap.get(n);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(j(r,{code:S.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),J)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,o){let n=new Map;for(let i of r){let s=Cr(i.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of s){if(n.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);n.set(a,i)}}return new t({typeName:z.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:n,...Y(o)})}};Vo=class extends oe{_parse(e){let{status:r,ctx:o}=this._processInputParams(e),n=(i,s)=>{if(dh(i)||dh(s))return J;let a=gh(i.value,s.value);return a.valid?((ph(i)||ph(s))&&r.dirty(),{status:r.value,value:a.data}):(j(o,{code:S.invalid_intersection_types}),J)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([i,s])=>n(i,s)):n(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}};Vo.create=(t,e,r)=>new Vo({left:t,right:e,typeName:z.ZodIntersection,...Y(r)});Ar=class t extends oe{_parse(e){let{status:r,ctx:o}=this._processInputParams(e);if(o.parsedType!==D.array)return j(o,{code:S.invalid_type,expected:D.array,received:o.parsedType}),J;if(o.data.length<this._def.items.length)return j(o,{code:S.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),J;!this._def.rest&&o.data.length>this._def.items.length&&(j(o,{code:S.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...o.data].map((s,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new Lt(o,s,o.path,a)):null}).filter(s=>!!s);return o.common.async?Promise.all(i).then(s=>st.mergeArray(r,s)):st.mergeArray(r,i)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Ar.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ar({items:t,typeName:z.ZodTuple,rest:null,...Y(e)})};yh=class t extends oe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:o}=this._processInputParams(e);if(o.parsedType!==D.object)return j(o,{code:S.invalid_type,expected:D.object,received:o.parsedType}),J;let n=[],i=this._def.keyType,s=this._def.valueType;for(let a in o.data)n.push({key:i._parse(new Lt(o,a,o.path,a)),value:s._parse(new Lt(o,o.data[a],o.path,a)),alwaysSet:a in o.data});return o.common.async?st.mergeObjectAsync(r,n):st.mergeObjectSync(r,n)}get element(){return this._def.valueType}static create(e,r,o){return r instanceof oe?new t({keyType:e,valueType:r,typeName:z.ZodRecord,...Y(o)}):new t({keyType:Zo.create(),valueType:e,typeName:z.ZodRecord,...Y(r)})}},Es=class extends oe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:o}=this._processInputParams(e);if(o.parsedType!==D.map)return j(o,{code:S.invalid_type,expected:D.map,received:o.parsedType}),J;let n=this._def.keyType,i=this._def.valueType,s=[...o.data.entries()].map(([a,c],u)=>({key:n._parse(new Lt(o,a,o.path,[u,"key"])),value:i._parse(new Lt(o,c,o.path,[u,"value"]))}));if(o.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of s){let u=await c.key,l=await c.value;if(u.status==="aborted"||l.status==="aborted")return J;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let c of s){let u=c.key,l=c.value;if(u.status==="aborted"||l.status==="aborted")return J;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}}}};Es.create=(t,e,r)=>new Es({valueType:e,keyType:t,typeName:z.ZodMap,...Y(r)});Is=class t extends oe{_parse(e){let{status:r,ctx:o}=this._processInputParams(e);if(o.parsedType!==D.set)return j(o,{code:S.invalid_type,expected:D.set,received:o.parsedType}),J;let n=this._def;n.minSize!==null&&o.data.size<n.minSize.value&&(j(o,{code:S.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),r.dirty()),n.maxSize!==null&&o.data.size>n.maxSize.value&&(j(o,{code:S.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),r.dirty());let i=this._def.valueType;function s(c){let u=new Set;for(let l of c){if(l.status==="aborted")return J;l.status==="dirty"&&r.dirty(),u.add(l.value)}return{status:r.value,value:u}}let a=[...o.data.values()].map((c,u)=>i._parse(new Lt(o,c,o.path,u)));return o.common.async?Promise.all(a).then(c=>s(c)):s(a)}min(e,r){return new t({...this._def,minSize:{value:e,message:U.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:U.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};Is.create=(t,e)=>new Is({valueType:t,minSize:null,maxSize:null,typeName:z.ZodSet,...Y(e)});vh=class t extends oe{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==D.function)return j(r,{code:S.invalid_type,expected:D.function,received:r.parsedType}),J;function o(a,c){return hu({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ys(),en].filter(u=>!!u),issueData:{code:S.invalid_arguments,argumentsError:c}})}function n(a,c){return hu({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ys(),en].filter(u=>!!u),issueData:{code:S.invalid_return_type,returnTypeError:c}})}let i={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof Vn){let a=this;return mt(async function(...c){let u=new Pt([]),l=await a._def.args.parseAsync(c,i).catch(f=>{throw u.addIssue(o(c,f)),u}),d=await Reflect.apply(s,this,l);return await a._def.returns._def.type.parseAsync(d,i).catch(f=>{throw u.addIssue(n(d,f)),u})})}else{let a=this;return mt(function(...c){let u=a._def.args.safeParse(c,i);if(!u.success)throw new Pt([o(c,u.error)]);let l=Reflect.apply(s,this,u.data),d=a._def.returns.safeParse(l,i);if(!d.success)throw new Pt([n(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Ar.create(e).rest(tn.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,o){return new t({args:e||Ar.create([]).rest(tn.create()),returns:r||tn.create(),typeName:z.ZodFunction,...Y(o)})}},Ho=class extends oe{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Ho.create=(t,e)=>new Ho({getter:t,typeName:z.ZodLazy,...Y(e)});Jo=class extends oe{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return j(r,{received:r.data,code:S.invalid_literal,expected:this._def.value}),J}return{status:"valid",value:e.data}}get value(){return this._def.value}};Jo.create=(t,e)=>new Jo({value:t,typeName:z.ZodLiteral,...Y(e)});Bo=class t extends oe{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),o=this._def.values;return j(r,{expected:ue.joinValues(o),received:r.parsedType,code:S.invalid_type}),J}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),o=this._def.values;return j(r,{received:r.data,code:S.invalid_enum_value,options:o}),J}return mt(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(o=>!e.includes(o)),{...this._def,...r})}};Bo.create=Iw;Wo=class extends oe{_parse(e){let r=ue.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(e);if(o.parsedType!==D.string&&o.parsedType!==D.number){let n=ue.objectValues(r);return j(o,{expected:ue.joinValues(n),received:o.parsedType,code:S.invalid_type}),J}if(this._cache||(this._cache=new Set(ue.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let n=ue.objectValues(r);return j(o,{received:o.data,code:S.invalid_enum_value,options:n}),J}return mt(e.data)}get enum(){return this._def.values}};Wo.create=(t,e)=>new Wo({values:t,typeName:z.ZodNativeEnum,...Y(e)});Vn=class extends oe{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==D.promise&&r.common.async===!1)return j(r,{code:S.invalid_type,expected:D.promise,received:r.parsedType}),J;let o=r.parsedType===D.promise?r.data:Promise.resolve(r.data);return mt(o.then(n=>this._def.type.parseAsync(n,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Vn.create=(t,e)=>new Vn({type:t,typeName:z.ZodPromise,...Y(e)});ir=class extends oe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===z.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:o}=this._processInputParams(e),n=this._def.effect||null,i={addIssue:s=>{j(o,s),s.fatal?r.abort():r.dirty()},get path(){return o.path}};if(i.addIssue=i.addIssue.bind(i),n.type==="preprocess"){let s=n.transform(o.data,i);if(o.common.async)return Promise.resolve(s).then(async a=>{if(r.value==="aborted")return J;let c=await this._def.schema._parseAsync({data:a,path:o.path,parent:o});return c.status==="aborted"?J:c.status==="dirty"?Mo(c.value):r.value==="dirty"?Mo(c.value):c});{if(r.value==="aborted")return J;let a=this._def.schema._parseSync({data:s,path:o.path,parent:o});return a.status==="aborted"?J:a.status==="dirty"?Mo(a.value):r.value==="dirty"?Mo(a.value):a}}if(n.type==="refinement"){let s=a=>{let c=n.refinement(a,i);if(o.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(o.common.async===!1){let a=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return a.status==="aborted"?J:(a.status==="dirty"&&r.dirty(),s(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(a=>a.status==="aborted"?J:(a.status==="dirty"&&r.dirty(),s(a.value).then(()=>({status:r.value,value:a.value}))))}if(n.type==="transform")if(o.common.async===!1){let s=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!qn(s))return J;let a=n.transform(s.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(s=>qn(s)?Promise.resolve(n.transform(s.value,i)).then(a=>({status:r.value,value:a})):J);ue.assertNever(n)}};ir.create=(t,e,r)=>new ir({schema:t,typeName:z.ZodEffects,effect:e,...Y(r)});ir.createWithPreprocess=(t,e,r)=>new ir({schema:e,effect:{type:"preprocess",transform:t},typeName:z.ZodEffects,...Y(r)});or=class extends oe{_parse(e){return this._getType(e)===D.undefined?mt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};or.create=(t,e)=>new or({innerType:t,typeName:z.ZodOptional,...Y(e)});Dr=class extends oe{_parse(e){return this._getType(e)===D.null?mt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Dr.create=(t,e)=>new Dr({innerType:t,typeName:z.ZodNullable,...Y(e)});Go=class extends oe{_parse(e){let{ctx:r}=this._processInputParams(e),o=r.data;return r.parsedType===D.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Go.create=(t,e)=>new Go({innerType:t,typeName:z.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Y(e)});Ko=class extends oe{_parse(e){let{ctx:r}=this._processInputParams(e),o={...r,common:{...r.common,issues:[]}},n=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return vs(n)?n.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Pt(o.common.issues)},input:o.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Pt(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}};Ko.create=(t,e)=>new Ko({innerType:t,typeName:z.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Y(e)});zs=class extends oe{_parse(e){if(this._getType(e)!==D.nan){let o=this._getOrReturnCtx(e);return j(o,{code:S.invalid_type,expected:D.nan,received:o.parsedType}),J}return{status:"valid",value:e.data}}};zs.create=t=>new zs({typeName:z.ZodNaN,...Y(t)});gu=class extends oe{_parse(e){let{ctx:r}=this._processInputParams(e),o=r.data;return this._def.type._parse({data:o,path:r.path,parent:r})}unwrap(){return this._def.type}},yu=class t extends oe{_parse(e){let{status:r,ctx:o}=this._processInputParams(e);if(o.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return i.status==="aborted"?J:i.status==="dirty"?(r.dirty(),Mo(i.value)):this._def.out._parseAsync({data:i.value,path:o.path,parent:o})})();{let n=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return n.status==="aborted"?J:n.status==="dirty"?(r.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:o.path,parent:o})}}static create(e,r){return new t({in:e,out:r,typeName:z.ZodPipeline})}},Xo=class extends oe{_parse(e){let r=this._def.innerType._parse(e),o=n=>(qn(n)&&(n.value=Object.freeze(n.value)),n);return vs(r)?r.then(n=>o(n)):o(r)}unwrap(){return this._def.innerType}};Xo.create=(t,e)=>new Xo({innerType:t,typeName:z.ZodReadonly,...Y(e)});$q={object:Rt.lazycreate};(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(z||(z={}));xq=Zo.create,kq=_s.create,wq=zs.create,Sq=bs.create,Eq=$s.create,Iq=xs.create,zq=ks.create,Tq=Lo.create,Oq=Fo.create,Pq=ws.create,Rq=tn.create,jq=br.create,Nq=Ss.create,Cq=rn.create,zw=Rt.create,Aq=Rt.strictCreate,Dq=qo.create,Mq=hh.create,Uq=Vo.create,Zq=Ar.create,Lq=yh.create,Fq=Es.create,qq=Is.create,Vq=vh.create,Hq=Ho.create,Jq=Jo.create,Bq=Bo.create,Wq=Wo.create,Gq=Vn.create,Kq=ir.create,Xq=or.create,Yq=Dr.create,Qq=ir.createWithPreprocess,e9=yu.create});var _h=g(()=>{mu();fh();xw();gs();Tw();fu()});var Ts=g(()=>{_h();_h()});function h(t,e,r){function o(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(t))return;a._zod.traits.add(t),e(a,c);let u=s.prototype,l=Object.keys(u);for(let d=0;d<l.length;d++){let p=l[d];p in a||(a[p]=u[p].bind(a))}}let n=r?.Parent??Object;class i extends n{}Object.defineProperty(i,"name",{value:t});function s(a){var c;let u=r?.Parent?new i:this;o(u,a),(c=u._zod).deferred??(c.deferred=[]);for(let l of u._zod.deferred)l();return u}return Object.defineProperty(s,"init",{value:o}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(t)}),Object.defineProperty(s,"name",{value:t}),s}function Ae(t){return t&&Object.assign(Os,t),Os}var vu,Ps,sr,nn,Os,Yo=g(()=>{vu=Object.freeze({status:"aborted"});Ps=Symbol("zod_brand"),sr=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},nn=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},Os={}});var E={};bt(E,{BIGINT_FORMAT_RANGES:()=>zh,Class:()=>$h,NUMBER_FORMAT_RANGES:()=>Ih,aborted:()=>cn,allowsEval:()=>wh,assert:()=>Gj,assertEqual:()=>Hj,assertIs:()=>Bj,assertNever:()=>Wj,assertNotEqual:()=>Jj,assignProp:()=>sn,base64ToUint8Array:()=>Dw,base64urlToUint8Array:()=>sN,cached:()=>ei,captureStackTrace:()=>bu,cleanEnum:()=>iN,cleanRegex:()=>Ns,clone:()=>Je,cloneDef:()=>Xj,createTransparentProxy:()=>nN,defineLazy:()=>Q,esc:()=>_u,escapeRegex:()=>Ft,extend:()=>jw,finalizeIssue:()=>$t,floatSafeRemainder:()=>xh,getElementAtPath:()=>Yj,getEnumValues:()=>js,getLengthableOrigin:()=>Ds,getParsedType:()=>rN,getSizableOrigin:()=>As,hexToUint8Array:()=>cN,isObject:()=>Hn,isPlainObject:()=>an,issue:()=>ti,joinValues:()=>b,jsonStringifyReplacer:()=>Qo,merge:()=>oN,mergeDefs:()=>Mr,normalizeParams:()=>T,nullish:()=>on,numKeys:()=>tN,objectClone:()=>Kj,omit:()=>Rw,optionalKeys:()=>Eh,parsedType:()=>I,partial:()=>Cw,pick:()=>Pw,prefixIssues:()=>jt,primitiveTypes:()=>Sh,promiseAllObject:()=>Qj,propertyKeyTypes:()=>Cs,randomString:()=>eN,required:()=>Aw,safeExtend:()=>Nw,shallowClone:()=>$u,slugify:()=>kh,stringifyPrimitive:()=>k,uint8ArrayToBase64:()=>Mw,uint8ArrayToBase64url:()=>aN,uint8ArrayToHex:()=>uN,unwrapMessage:()=>Rs});function Hj(t){return t}function Jj(t){return t}function Bj(t){}function Wj(t){throw new Error("Unexpected value in exhaustive check")}function Gj(t){}function js(t){let e=Object.values(t).filter(o=>typeof o=="number");return Object.entries(t).filter(([o,n])=>e.indexOf(+o)===-1).map(([o,n])=>n)}function b(t,e="|"){return t.map(r=>k(r)).join(e)}function Qo(t,e){return typeof e=="bigint"?e.toString():e}function ei(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function on(t){return t==null}function Ns(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function xh(t,e){let r=(t.toString().split(".")[1]||"").length,o=e.toString(),n=(o.split(".")[1]||"").length;if(n===0&&/\d?e-\d?/.test(o)){let c=o.match(/\d?e-(\d?)/);c?.[1]&&(n=Number.parseInt(c[1]))}let i=r>n?r:n,s=Number.parseInt(t.toFixed(i).replace(".","")),a=Number.parseInt(e.toFixed(i).replace(".",""));return s%a/10**i}function Q(t,e,r){let o;Object.defineProperty(t,e,{get(){if(o!==Ow)return o===void 0&&(o=Ow,o=r()),o},set(n){Object.defineProperty(t,e,{value:n})},configurable:!0})}function Kj(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function sn(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Mr(...t){let e={};for(let r of t){let o=Object.getOwnPropertyDescriptors(r);Object.assign(e,o)}return Object.defineProperties({},e)}function Xj(t){return Mr(t._zod.def)}function Yj(t,e){return e?e.reduce((r,o)=>r?.[o],t):t}function Qj(t){let e=Object.keys(t),r=e.map(o=>t[o]);return Promise.all(r).then(o=>{let n={};for(let i=0;i<e.length;i++)n[e[i]]=o[i];return n})}function eN(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<t;o++)r+=e[Math.floor(Math.random()*e.length)];return r}function _u(t){return JSON.stringify(t)}function kh(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function Hn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function an(t){if(Hn(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(Hn(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function $u(t){return an(t)?{...t}:Array.isArray(t)?[...t]:t}function tN(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}function Ft(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Je(t,e,r){let o=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(o._zod.parent=t),o}function T(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function nN(t){let e;return new Proxy({},{get(r,o,n){return e??(e=t()),Reflect.get(e,o,n)},set(r,o,n,i){return e??(e=t()),Reflect.set(e,o,n,i)},has(r,o){return e??(e=t()),Reflect.has(e,o)},deleteProperty(r,o){return e??(e=t()),Reflect.deleteProperty(e,o)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,o){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,o)},defineProperty(r,o,n){return e??(e=t()),Reflect.defineProperty(e,o,n)}})}function k(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function Eh(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}function Pw(t,e){let r=t._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i=Mr(t._zod.def,{get shape(){let s={};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&(s[a]=r.shape[a])}return sn(this,"shape",s),s},checks:[]});return Je(t,i)}function Rw(t,e){let r=t._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=Mr(t._zod.def,{get shape(){let s={...t._zod.def.shape};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&delete s[a]}return sn(this,"shape",s),s},checks:[]});return Je(t,i)}function jw(t,e){if(!an(e))throw new Error("Invalid input to extend: expected a plain object");let r=t._zod.def.checks;if(r&&r.length>0){let i=t._zod.def.shape;for(let s in e)if(Object.getOwnPropertyDescriptor(i,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=Mr(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e};return sn(this,"shape",i),i}});return Je(t,n)}function Nw(t,e){if(!an(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=Mr(t._zod.def,{get shape(){let o={...t._zod.def.shape,...e};return sn(this,"shape",o),o}});return Je(t,r)}function oN(t,e){let r=Mr(t._zod.def,{get shape(){let o={...t._zod.def.shape,...e._zod.def.shape};return sn(this,"shape",o),o},get catchall(){return e._zod.def.catchall},checks:[]});return Je(t,r)}function Cw(t,e,r){let n=e._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=Mr(e._zod.def,{get shape(){let a=e._zod.def.shape,c={...a};if(r)for(let u in r){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(c[u]=t?new t({type:"optional",innerType:a[u]}):a[u])}else for(let u in a)c[u]=t?new t({type:"optional",innerType:a[u]}):a[u];return sn(this,"shape",c),c},checks:[]});return Je(e,s)}function Aw(t,e,r){let o=Mr(e._zod.def,{get shape(){let n=e._zod.def.shape,i={...n};if(r)for(let s in r){if(!(s in i))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(i[s]=new t({type:"nonoptional",innerType:n[s]}))}else for(let s in n)i[s]=new t({type:"nonoptional",innerType:n[s]});return sn(this,"shape",i),i}});return Je(e,o)}function cn(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==!0)return!0;return!1}function jt(t,e){return e.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(t),r})}function Rs(t){return typeof t=="string"?t:t?.message}function $t(t,e,r){let o={...t,path:t.path??[]};if(!t.message){let n=Rs(t.inst?._zod.def?.error?.(t))??Rs(e?.error?.(t))??Rs(r.customError?.(t))??Rs(r.localeError?.(t))??"Invalid input";o.message=n}return delete o.inst,delete o.continue,e?.reportInput||delete o.input,o}function As(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function Ds(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function I(t){let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";let r=t;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return e}function ti(...t){let[e,r,o]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:o}:{...e}}function iN(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function Dw(t){let e=atob(t),r=new Uint8Array(e.length);for(let o=0;o<e.length;o++)r[o]=e.charCodeAt(o);return r}function Mw(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function sN(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return Dw(e+r)}function aN(t){return Mw(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function cN(t){let e=t.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(e.length/2);for(let o=0;o<e.length;o+=2)r[o/2]=Number.parseInt(e.slice(o,o+2),16);return r}function uN(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var Ow,bu,wh,rN,Cs,Sh,Ih,zh,$h,q=g(()=>{Ow=Symbol("evaluating");bu="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};wh=ei(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});rN=t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},Cs=new Set(["string","number","symbol"]),Sh=new Set(["string","number","bigint","boolean","symbol","undefined"]);Ih={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},zh={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};$h=class{constructor(...e){}}});function ri(t,e=r=>r.message){let r={},o=[];for(let n of t.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(e(n))):o.push(e(n));return{formErrors:o,fieldErrors:r}}function ni(t,e=r=>r.message){let r={_errors:[]},o=n=>{for(let i of n.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(s=>o({issues:s}));else if(i.code==="invalid_key")o({issues:i.issues});else if(i.code==="invalid_element")o({issues:i.issues});else if(i.path.length===0)r._errors.push(e(i));else{let s=r,a=0;for(;a<i.path.length;){let c=i.path[a];a===i.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(e(i))):s[c]=s[c]||{_errors:[]},s=s[c],a++}}};return o(t),r}function xu(t,e=r=>r.message){let r={errors:[]},o=(n,i=[])=>{var s,a;for(let c of n.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(u=>o({issues:u},c.path));else if(c.code==="invalid_key")o({issues:c.issues},c.path);else if(c.code==="invalid_element")o({issues:c.issues},c.path);else{let u=[...i,...c.path];if(u.length===0){r.errors.push(e(c));continue}let l=r,d=0;for(;d<u.length;){let p=u[d],f=d===u.length-1;typeof p=="string"?(l.properties??(l.properties={}),(s=l.properties)[p]??(s[p]={errors:[]}),l=l.properties[p]):(l.items??(l.items=[]),(a=l.items)[p]??(a[p]={errors:[]}),l=l.items[p]),f&&l.errors.push(e(c)),d++}}};return o(t),r}function Zw(t){let e=[],r=t.map(o=>typeof o=="object"?o.key:o);for(let o of r)typeof o=="number"?e.push(`[${o}]`):typeof o=="symbol"?e.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?e.push(`[${JSON.stringify(o)}]`):(e.length&&e.push("."),e.push(o));return e.join("")}function ku(t){let e=[],r=[...t.issues].sort((o,n)=>(o.path??[]).length-(n.path??[]).length);for(let o of r)e.push(`\u2716 ${o.message}`),o.path?.length&&e.push(` \u2192 at ${Zw(o.path)}`);return e.join(`
|
|
213
|
+
`)}var Uw,Ms,xt,Th=g(()=>{Yo();q();Uw=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,Qo,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},Ms=h("$ZodError",Uw),xt=h("$ZodError",Uw,{Parent:Error})});var oi,Jn,ii,Bn,si,un,ai,ln,wu,Lw,Su,Fw,Eu,qw,Iu,Vw,zu,Hw,Tu,Jw,Ou,Bw,Pu,Ww,Oh=g(()=>{Yo();Th();q();oi=t=>(e,r,o,n)=>{let i=o?Object.assign(o,{async:!1}):{async:!1},s=e._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new sr;if(s.issues.length){let a=new(n?.Err??t)(s.issues.map(c=>$t(c,i,Ae())));throw bu(a,n?.callee),a}return s.value},Jn=oi(xt),ii=t=>async(e,r,o,n)=>{let i=o?Object.assign(o,{async:!0}):{async:!0},s=e._zod.run({value:r,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new(n?.Err??t)(s.issues.map(c=>$t(c,i,Ae())));throw bu(a,n?.callee),a}return s.value},Bn=ii(xt),si=t=>(e,r,o)=>{let n=o?{...o,async:!1}:{async:!1},i=e._zod.run({value:r,issues:[]},n);if(i instanceof Promise)throw new sr;return i.issues.length?{success:!1,error:new(t??Ms)(i.issues.map(s=>$t(s,n,Ae())))}:{success:!0,data:i.value}},un=si(xt),ai=t=>async(e,r,o)=>{let n=o?Object.assign(o,{async:!0}):{async:!0},i=e._zod.run({value:r,issues:[]},n);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new t(i.issues.map(s=>$t(s,n,Ae())))}:{success:!0,data:i.value}},ln=ai(xt),wu=t=>(e,r,o)=>{let n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return oi(t)(e,r,n)},Lw=wu(xt),Su=t=>(e,r,o)=>oi(t)(e,r,o),Fw=Su(xt),Eu=t=>async(e,r,o)=>{let n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return ii(t)(e,r,n)},qw=Eu(xt),Iu=t=>async(e,r,o)=>ii(t)(e,r,o),Vw=Iu(xt),zu=t=>(e,r,o)=>{let n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return si(t)(e,r,n)},Hw=zu(xt),Tu=t=>(e,r,o)=>si(t)(e,r,o),Jw=Tu(xt),Ou=t=>async(e,r,o)=>{let n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return ai(t)(e,r,n)},Bw=Ou(xt),Pu=t=>async(e,r,o)=>ai(t)(e,r,o),Ww=Pu(xt)});var kt={};bt(kt,{base64:()=>Jh,base64url:()=>Ru,bigint:()=>Yh,boolean:()=>eg,browserEmail:()=>vN,cidrv4:()=>Vh,cidrv6:()=>Hh,cuid:()=>Ph,cuid2:()=>Rh,date:()=>Wh,datetime:()=>Kh,domain:()=>$N,duration:()=>Dh,e164:()=>Bh,email:()=>Uh,emoji:()=>Zh,extendedDuration:()=>dN,guid:()=>Mh,hex:()=>xN,hostname:()=>bN,html5Email:()=>hN,idnEmail:()=>yN,integer:()=>Qh,ipv4:()=>Lh,ipv6:()=>Fh,ksuid:()=>Ch,lowercase:()=>ng,mac:()=>qh,md5_base64:()=>wN,md5_base64url:()=>SN,md5_hex:()=>kN,nanoid:()=>Ah,null:()=>tg,number:()=>ju,rfc5322Email:()=>gN,sha1_base64:()=>IN,sha1_base64url:()=>zN,sha1_hex:()=>EN,sha256_base64:()=>ON,sha256_base64url:()=>PN,sha256_hex:()=>TN,sha384_base64:()=>jN,sha384_base64url:()=>NN,sha384_hex:()=>RN,sha512_base64:()=>AN,sha512_base64url:()=>DN,sha512_hex:()=>CN,string:()=>Xh,time:()=>Gh,ulid:()=>jh,undefined:()=>rg,unicodeEmail:()=>Gw,uppercase:()=>og,uuid:()=>Wn,uuid4:()=>pN,uuid6:()=>fN,uuid7:()=>mN,xid:()=>Nh});function Zh(){return new RegExp(_N,"u")}function Xw(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Gh(t){return new RegExp(`^${Xw(t)}$`)}function Kh(t){let e=Xw({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${e}(?:${r.join("|")})`;return new RegExp(`^${Kw}T(?:${o})$`)}function Us(t,e){return new RegExp(`^[A-Za-z0-9+/]{${t}}${e}$`)}function Zs(t){return new RegExp(`^[A-Za-z0-9_-]{${t}}$`)}var Ph,Rh,jh,Nh,Ch,Ah,Dh,dN,Mh,Wn,pN,fN,mN,Uh,hN,gN,Gw,yN,vN,_N,Lh,Fh,qh,Vh,Hh,Jh,Ru,bN,$N,Bh,Kw,Wh,Xh,Yh,Qh,ju,eg,tg,rg,ng,og,xN,kN,wN,SN,EN,IN,zN,TN,ON,PN,RN,jN,NN,CN,AN,DN,Nu=g(()=>{q();Ph=/^[cC][^\s-]{8,}$/,Rh=/^[0-9a-z]+$/,jh=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Nh=/^[0-9a-vA-V]{20}$/,Ch=/^[A-Za-z0-9]{27}$/,Ah=/^[a-zA-Z0-9_-]{21}$/,Dh=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,dN=/^[-+]?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)?)??$/,Mh=/^([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})$/,Wn=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([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)$/,pN=Wn(4),fN=Wn(6),mN=Wn(7),Uh=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,hN=/^[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])?)*$/,gN=/^(([^<>()\[\]\\.,;:\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,}))$/,Gw=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,yN=Gw,vN=/^[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])?)*$/,_N="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";Lh=/^(?:(?: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])$/,Fh=/^(([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}|:))$/,qh=t=>{let e=Ft(t??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},Vh=/^((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])$/,Hh=/^(([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])$/,Jh=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ru=/^[A-Za-z0-9_-]*$/,bN=/^(?=.{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])?)*\.?$/,$N=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Bh=/^\+[1-9]\d{6,14}$/,Kw="(?:(?:\\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])))",Wh=new RegExp(`^${Kw}$`);Xh=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},Yh=/^-?\d+n?$/,Qh=/^-?\d+$/,ju=/^-?\d+(?:\.\d+)?$/,eg=/^(?:true|false)$/i,tg=/^null$/i,rg=/^undefined$/i,ng=/^[^A-Z]*$/,og=/^[^a-z]*$/,xN=/^[0-9a-fA-F]*$/;kN=/^[0-9a-fA-F]{32}$/,wN=Us(22,"=="),SN=Zs(22),EN=/^[0-9a-fA-F]{40}$/,IN=Us(27,"="),zN=Zs(27),TN=/^[0-9a-fA-F]{64}$/,ON=Us(43,"="),PN=Zs(43),RN=/^[0-9a-fA-F]{96}$/,jN=Us(64,""),NN=Zs(64),CN=/^[0-9a-fA-F]{128}$/,AN=Us(86,"=="),DN=Zs(86)});function Yw(t,e,r){t.issues.length&&e.issues.push(...jt(r,t.issues))}var ke,Qw,Cu,Au,ig,sg,ag,cg,ug,lg,dg,pg,fg,ci,mg,hg,gg,yg,vg,_g,bg,$g,xg,Du=g(()=>{Yo();Nu();q();ke=h("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),Qw={number:"number",bigint:"bigint",object:"date"},Cu=h("$ZodCheckLessThan",(t,e)=>{ke.init(t,e);let r=Qw[typeof e.value];t._zod.onattach.push(o=>{let n=o._zod.bag,i=(e.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<i&&(e.inclusive?n.maximum=e.value:n.exclusiveMaximum=e.value)}),t._zod.check=o=>{(e.inclusive?o.value<=e.value:o.value<e.value)||o.issues.push({origin:r,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:o.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Au=h("$ZodCheckGreaterThan",(t,e)=>{ke.init(t,e);let r=Qw[typeof e.value];t._zod.onattach.push(o=>{let n=o._zod.bag,i=(e.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>i&&(e.inclusive?n.minimum=e.value:n.exclusiveMinimum=e.value)}),t._zod.check=o=>{(e.inclusive?o.value>=e.value:o.value>e.value)||o.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:o.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),ig=h("$ZodCheckMultipleOf",(t,e)=>{ke.init(t,e),t._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):xh(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),sg=h("$ZodCheckNumberFormat",(t,e)=>{ke.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),o=r?"int":"number",[n,i]=Ih[e.format];t._zod.onattach.push(s=>{let a=s._zod.bag;a.format=e.format,a.minimum=n,a.maximum=i,r&&(a.pattern=Qh)}),t._zod.check=s=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:o,format:e.format,code:"invalid_type",continue:!1,input:a,inst:t});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:o,inclusive:!0,continue:!e.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:o,inclusive:!0,continue:!e.abort});return}}a<n&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:n,inclusive:!0,inst:t,continue:!e.abort}),a>i&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:t,continue:!e.abort})}}),ag=h("$ZodCheckBigIntFormat",(t,e)=>{ke.init(t,e);let[r,o]=zh[e.format];t._zod.onattach.push(n=>{let i=n._zod.bag;i.format=e.format,i.minimum=r,i.maximum=o}),t._zod.check=n=>{let i=n.value;i<r&&n.issues.push({origin:"bigint",input:i,code:"too_small",minimum:r,inclusive:!0,inst:t,continue:!e.abort}),i>o&&n.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inclusive:!0,inst:t,continue:!e.abort})}}),cg=h("$ZodCheckMaxSize",(t,e)=>{var r;ke.init(t,e),(r=t._zod.def).when??(r.when=o=>{let n=o.value;return!on(n)&&n.size!==void 0}),t._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<n&&(o._zod.bag.maximum=e.maximum)}),t._zod.check=o=>{let n=o.value;n.size<=e.maximum||o.issues.push({origin:As(n),code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),ug=h("$ZodCheckMinSize",(t,e)=>{var r;ke.init(t,e),(r=t._zod.def).when??(r.when=o=>{let n=o.value;return!on(n)&&n.size!==void 0}),t._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(o._zod.bag.minimum=e.minimum)}),t._zod.check=o=>{let n=o.value;n.size>=e.minimum||o.issues.push({origin:As(n),code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),lg=h("$ZodCheckSizeEquals",(t,e)=>{var r;ke.init(t,e),(r=t._zod.def).when??(r.when=o=>{let n=o.value;return!on(n)&&n.size!==void 0}),t._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=e.size,n.maximum=e.size,n.size=e.size}),t._zod.check=o=>{let n=o.value,i=n.size;if(i===e.size)return;let s=i>e.size;o.issues.push({origin:As(n),...s?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:o.value,inst:t,continue:!e.abort})}}),dg=h("$ZodCheckMaxLength",(t,e)=>{var r;ke.init(t,e),(r=t._zod.def).when??(r.when=o=>{let n=o.value;return!on(n)&&n.length!==void 0}),t._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<n&&(o._zod.bag.maximum=e.maximum)}),t._zod.check=o=>{let n=o.value;if(n.length<=e.maximum)return;let s=Ds(n);o.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),pg=h("$ZodCheckMinLength",(t,e)=>{var r;ke.init(t,e),(r=t._zod.def).when??(r.when=o=>{let n=o.value;return!on(n)&&n.length!==void 0}),t._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(o._zod.bag.minimum=e.minimum)}),t._zod.check=o=>{let n=o.value;if(n.length>=e.minimum)return;let s=Ds(n);o.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),fg=h("$ZodCheckLengthEquals",(t,e)=>{var r;ke.init(t,e),(r=t._zod.def).when??(r.when=o=>{let n=o.value;return!on(n)&&n.length!==void 0}),t._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=e.length,n.maximum=e.length,n.length=e.length}),t._zod.check=o=>{let n=o.value,i=n.length;if(i===e.length)return;let s=Ds(n),a=i>e.length;o.issues.push({origin:s,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:o.value,inst:t,continue:!e.abort})}}),ci=h("$ZodCheckStringFormat",(t,e)=>{var r,o;ke.init(t,e),t._zod.onattach.push(n=>{let i=n._zod.bag;i.format=e.format,e.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:e.format,input:n.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(o=t._zod).check??(o.check=()=>{})}),mg=h("$ZodCheckRegex",(t,e)=>{ci.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),hg=h("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=ng),ci.init(t,e)}),gg=h("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=og),ci.init(t,e)}),yg=h("$ZodCheckIncludes",(t,e)=>{ke.init(t,e);let r=Ft(e.includes),o=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=o,t._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),t._zod.check=n=>{n.value.includes(e.includes,e.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:n.value,inst:t,continue:!e.abort})}}),vg=h("$ZodCheckStartsWith",(t,e)=>{ke.init(t,e);let r=new RegExp(`^${Ft(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),t._zod.check=o=>{o.value.startsWith(e.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:o.value,inst:t,continue:!e.abort})}}),_g=h("$ZodCheckEndsWith",(t,e)=>{ke.init(t,e);let r=new RegExp(`.*${Ft(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),t._zod.check=o=>{o.value.endsWith(e.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:o.value,inst:t,continue:!e.abort})}});bg=h("$ZodCheckProperty",(t,e)=>{ke.init(t,e),t._zod.check=r=>{let o=e.schema._zod.run({value:r.value[e.property],issues:[]},{});if(o instanceof Promise)return o.then(n=>Yw(n,r,e.property));Yw(o,r,e.property)}}),$g=h("$ZodCheckMimeType",(t,e)=>{ke.init(t,e);let r=new Set(e.mime);t._zod.onattach.push(o=>{o._zod.bag.mime=e.mime}),t._zod.check=o=>{r.has(o.value.type)||o.issues.push({code:"invalid_value",values:e.mime,input:o.value.type,inst:t,continue:!e.abort})}}),xg=h("$ZodCheckOverwrite",(t,e)=>{ke.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}})});var Ls,kg=g(()=>{Ls=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let o=e.split(`
|
|
214
|
+
`).filter(s=>s),n=Math.min(...o.map(s=>s.length-s.trimStart().length)),i=o.map(s=>s.slice(n)).map(s=>" ".repeat(this.indent*2)+s);for(let s of i)this.content.push(s)}compile(){let e=Function,r=this?.args,n=[...(this?.content??[""]).map(i=>` ${i}`)];return new e(...r,n.join(`
|
|
215
|
+
`))}}});var wg,Sg=g(()=>{wg={major:4,minor:3,patch:6}});function Ig(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}function pS(t){if(!Ru.test(t))return!1;let e=t.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return Ig(r)}function fS(t,e=null){try{let r=t.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||e&&(!("alg"in n)||n.alg!==e))}catch{return!1}}function tS(t,e,r){t.issues.length&&e.issues.push(...jt(r,t.issues)),e.value[r]=t.value}function Fu(t,e,r,o,n){if(t.issues.length){if(n&&!(r in o))return;e.issues.push(...jt(r,t.issues))}t.value===void 0?r in o&&(e.value[r]=void 0):e.value[r]=t.value}function mS(t){let e=Object.keys(t.shape);for(let o of e)if(!t.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let r=Eh(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function hS(t,e,r,o,n,i){let s=[],a=n.keySet,c=n.catchall._zod,u=c.def.type,l=c.optout==="optional";for(let d in e){if(a.has(d))continue;if(u==="never"){s.push(d);continue}let p=c.run({value:e[d],issues:[]},o);p instanceof Promise?t.push(p.then(f=>Fu(f,r,d,e,l))):Fu(p,r,d,e,l)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:e,inst:i}),t.length?Promise.all(t).then(()=>r):r}function rS(t,e,r,o){for(let i of t)if(i.issues.length===0)return e.value=i.value,e;let n=t.filter(i=>!cn(i));return n.length===1?(e.value=n[0].value,n[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(i=>i.issues.map(s=>$t(s,o,Ae())))}),e)}function nS(t,e,r,o){let n=t.filter(i=>i.issues.length===0);return n.length===1?(e.value=n[0].value,e):(n.length===0?e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(i=>i.issues.map(s=>$t(s,o,Ae())))}):e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:[],inclusive:!1}),e)}function Eg(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(an(t)&&an(e)){let r=Object.keys(e),o=Object.keys(t).filter(i=>r.indexOf(i)!==-1),n={...t,...e};for(let i of o){let s=Eg(t[i],e[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};n[i]=s.data}return{valid:!0,data:n}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<t.length;o++){let n=t[o],i=e[o],s=Eg(n,i);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function oS(t,e,r){let o=new Map,n;for(let a of e.issues)if(a.code==="unrecognized_keys"){n??(n=a);for(let c of a.keys)o.has(c)||o.set(c,{}),o.get(c).l=!0}else t.issues.push(a);for(let a of r.issues)if(a.code==="unrecognized_keys")for(let c of a.keys)o.has(c)||o.set(c,{}),o.get(c).r=!0;else t.issues.push(a);let i=[...o].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(i.length&&n&&t.issues.push({...n,keys:i}),cn(t))return t;let s=Eg(e.value,r.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return t.value=s.data,t}function Mu(t,e,r){t.issues.length&&e.issues.push(...jt(r,t.issues)),e.value[r]=t.value}function iS(t,e,r,o,n,i,s){t.issues.length&&(Cs.has(typeof o)?r.issues.push(...jt(o,t.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:i,issues:t.issues.map(a=>$t(a,s,Ae()))})),e.issues.length&&(Cs.has(typeof o)?r.issues.push(...jt(o,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:i,key:o,issues:e.issues.map(a=>$t(a,s,Ae()))})),r.value.set(t.value,e.value)}function sS(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}function aS(t,e){return t.issues.length&&e===void 0?{issues:[],value:void 0}:t}function cS(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}function uS(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}function Uu(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},r)}function Zu(t,e,r){if(t.issues.length)return t.aborted=!0,t;if((r.direction||"forward")==="forward"){let n=e.transform(t.value,t);return n instanceof Promise?n.then(i=>Lu(t,i,e.out,r)):Lu(t,n,e.out,r)}else{let n=e.reverseTransform(t.value,t);return n instanceof Promise?n.then(i=>Lu(t,i,e.in,r)):Lu(t,n,e.in,r)}}function Lu(t,e,r,o){return t.issues.length?(t.aborted=!0,t):r._zod.run({value:e,issues:t.issues},o)}function lS(t){return t.value=Object.freeze(t.value),t}function dS(t,e,r,o){if(!t){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(n.params=o._zod.def.params),e.issues.push(ti(n))}}var W,dn,ve,qu,Vu,Hu,Ju,Bu,Wu,Gu,Ku,Xu,Yu,Qu,el,tl,rl,nl,ol,il,sl,al,cl,ul,ll,dl,pl,fl,Fs,ml,ui,qs,hl,gl,yl,vl,_l,bl,$l,xl,kl,wl,Sl,zg,li,El,Il,zl,Vs,Tl,Ol,Pl,Rl,jl,Nl,Cl,Hs,Al,Dl,Ml,Ul,Zl,Ll,Fl,ql,Vl,di,Hl,Jl,Bl,Wl,Gl,Kl,Tg=g(()=>{Du();Yo();kg();Oh();Nu();q();Sg();q();W=h("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=wg;let o=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&o.unshift(t);for(let n of o)for(let i of n._zod.onattach)i(t);if(o.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let n=(s,a,c)=>{let u=cn(s),l;for(let d of a){if(d._zod.def.when){if(!d._zod.def.when(s))continue}else if(u)continue;let p=s.issues.length,f=d._zod.check(s);if(f instanceof Promise&&c?.async===!1)throw new sr;if(l||f instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await f,s.issues.length!==p&&(u||(u=cn(s,p)))});else{if(s.issues.length===p)continue;u||(u=cn(s,p))}}return l?l.then(()=>s):s},i=(s,a,c)=>{if(cn(s))return s.aborted=!0,s;let u=n(a,o,c);if(u instanceof Promise){if(c.async===!1)throw new sr;return u.then(l=>t._zod.parse(l,c))}return t._zod.parse(u,c)};t._zod.run=(s,a)=>{if(a.skipChecks)return t._zod.parse(s,a);if(a.direction==="backward"){let u=t._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(l=>i(l,s,a)):i(u,s,a)}let c=t._zod.parse(s,a);if(c instanceof Promise){if(a.async===!1)throw new sr;return c.then(u=>n(u,o,a))}return n(c,o,a)}}Q(t,"~standard",()=>({validate:n=>{try{let i=un(t,n);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return ln(t,n).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),dn=h("$ZodString",(t,e)=>{W.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Xh(t._zod.bag),t._zod.parse=(r,o)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),ve=h("$ZodStringFormat",(t,e)=>{ci.init(t,e),dn.init(t,e)}),qu=h("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=Mh),ve.init(t,e)}),Vu=h("$ZodUUID",(t,e)=>{if(e.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(o===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=Wn(o))}else e.pattern??(e.pattern=Wn());ve.init(t,e)}),Hu=h("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=Uh),ve.init(t,e)}),Ju=h("$ZodURL",(t,e)=>{ve.init(t,e),t._zod.check=r=>{try{let o=r.value.trim(),n=new URL(o);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=n.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),Bu=h("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=Zh()),ve.init(t,e)}),Wu=h("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=Ah),ve.init(t,e)}),Gu=h("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=Ph),ve.init(t,e)}),Ku=h("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=Rh),ve.init(t,e)}),Xu=h("$ZodULID",(t,e)=>{e.pattern??(e.pattern=jh),ve.init(t,e)}),Yu=h("$ZodXID",(t,e)=>{e.pattern??(e.pattern=Nh),ve.init(t,e)}),Qu=h("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=Ch),ve.init(t,e)}),el=h("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=Kh(e)),ve.init(t,e)}),tl=h("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Wh),ve.init(t,e)}),rl=h("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=Gh(e)),ve.init(t,e)}),nl=h("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=Dh),ve.init(t,e)}),ol=h("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=Lh),ve.init(t,e),t._zod.bag.format="ipv4"}),il=h("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=Fh),ve.init(t,e),t._zod.bag.format="ipv6",t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}}),sl=h("$ZodMAC",(t,e)=>{e.pattern??(e.pattern=qh(e.delimiter)),ve.init(t,e),t._zod.bag.format="mac"}),al=h("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=Vh),ve.init(t,e)}),cl=h("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=Hh),ve.init(t,e),t._zod.check=r=>{let o=r.value.split("/");try{if(o.length!==2)throw new Error;let[n,i]=o;if(!i)throw new Error;let s=Number(i);if(`${s}`!==i)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});ul=h("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=Jh),ve.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=r=>{Ig(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});ll=h("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=Ru),ve.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=r=>{pS(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),dl=h("$ZodE164",(t,e)=>{e.pattern??(e.pattern=Bh),ve.init(t,e)});pl=h("$ZodJWT",(t,e)=>{ve.init(t,e),t._zod.check=r=>{fS(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),fl=h("$ZodCustomStringFormat",(t,e)=>{ve.init(t,e),t._zod.check=r=>{e.fn(r.value)||r.issues.push({code:"invalid_format",format:e.format,input:r.value,inst:t,continue:!e.abort})}}),Fs=h("$ZodNumber",(t,e)=>{W.init(t,e),t._zod.pattern=t._zod.bag.pattern??ju,t._zod.parse=(r,o)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let i=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:t,...i?{received:i}:{}}),r}}),ml=h("$ZodNumberFormat",(t,e)=>{sg.init(t,e),Fs.init(t,e)}),ui=h("$ZodBoolean",(t,e)=>{W.init(t,e),t._zod.pattern=eg,t._zod.parse=(r,o)=>{if(e.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:t}),r}}),qs=h("$ZodBigInt",(t,e)=>{W.init(t,e),t._zod.pattern=Yh,t._zod.parse=(r,o)=>{if(e.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:t}),r}}),hl=h("$ZodBigIntFormat",(t,e)=>{ag.init(t,e),qs.init(t,e)}),gl=h("$ZodSymbol",(t,e)=>{W.init(t,e),t._zod.parse=(r,o)=>{let n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:t}),r}}),yl=h("$ZodUndefined",(t,e)=>{W.init(t,e),t._zod.pattern=rg,t._zod.values=new Set([void 0]),t._zod.optin="optional",t._zod.optout="optional",t._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:t}),r}}),vl=h("$ZodNull",(t,e)=>{W.init(t,e),t._zod.pattern=tg,t._zod.values=new Set([null]),t._zod.parse=(r,o)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:t}),r}}),_l=h("$ZodAny",(t,e)=>{W.init(t,e),t._zod.parse=r=>r}),bl=h("$ZodUnknown",(t,e)=>{W.init(t,e),t._zod.parse=r=>r}),$l=h("$ZodNever",(t,e)=>{W.init(t,e),t._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),xl=h("$ZodVoid",(t,e)=>{W.init(t,e),t._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:t}),r}}),kl=h("$ZodDate",(t,e)=>{W.init(t,e),t._zod.parse=(r,o)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,i=n instanceof Date;return i&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...i?{received:"Invalid Date"}:{},inst:t}),r}});wl=h("$ZodArray",(t,e)=>{W.init(t,e),t._zod.parse=(r,o)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:t}),r;r.value=Array(n.length);let i=[];for(let s=0;s<n.length;s++){let a=n[s],c=e.element._zod.run({value:a,issues:[]},o);c instanceof Promise?i.push(c.then(u=>tS(u,r,s))):tS(c,r,s)}return i.length?Promise.all(i).then(()=>r):r}});Sl=h("$ZodObject",(t,e)=>{if(W.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let a=e.shape;Object.defineProperty(e,"shape",{get:()=>{let c={...a};return Object.defineProperty(e,"shape",{value:c}),c}})}let o=ei(()=>mS(e));Q(t._zod,"propValues",()=>{let a=e.shape,c={};for(let u in a){let l=a[u]._zod;if(l.values){c[u]??(c[u]=new Set);for(let d of l.values)c[u].add(d)}}return c});let n=Hn,i=e.catchall,s;t._zod.parse=(a,c)=>{s??(s=o.value);let u=a.value;if(!n(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:t}),a;a.value={};let l=[],d=s.shape;for(let p of s.keys){let f=d[p],m=f._zod.optout==="optional",y=f._zod.run({value:u[p],issues:[]},c);y instanceof Promise?l.push(y.then(x=>Fu(x,a,p,u,m))):Fu(y,a,p,u,m)}return i?hS(l,u,a,c,o.value,t):l.length?Promise.all(l).then(()=>a):a}}),zg=h("$ZodObjectJIT",(t,e)=>{Sl.init(t,e);let r=t._zod.parse,o=ei(()=>mS(e)),n=p=>{let f=new Ls(["shape","payload","ctx"]),m=o.value,y=_=>{let w=_u(_);return`shape[${w}]._zod.run({ value: input[${w}], issues: [] }, ctx)`};f.write("const input = payload.value;");let x=Object.create(null),v=0;for(let _ of m.keys)x[_]=`key_${v++}`;f.write("const newResult = {};");for(let _ of m.keys){let w=x[_],R=_u(_),be=p[_]?._zod?.optout==="optional";f.write(`const ${w} = ${y(_)};`),be?f.write(`
|
|
216
|
+
if (${w}.issues.length) {
|
|
217
|
+
if (${R} in input) {
|
|
218
|
+
payload.issues = payload.issues.concat(${w}.issues.map(iss => ({
|
|
219
|
+
...iss,
|
|
220
|
+
path: iss.path ? [${R}, ...iss.path] : [${R}]
|
|
221
|
+
})));
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
if (${w}.value === undefined) {
|
|
226
|
+
if (${R} in input) {
|
|
227
|
+
newResult[${R}] = undefined;
|
|
228
|
+
}
|
|
229
|
+
} else {
|
|
230
|
+
newResult[${R}] = ${w}.value;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
`):f.write(`
|
|
234
|
+
if (${w}.issues.length) {
|
|
235
|
+
payload.issues = payload.issues.concat(${w}.issues.map(iss => ({
|
|
236
|
+
...iss,
|
|
237
|
+
path: iss.path ? [${R}, ...iss.path] : [${R}]
|
|
238
|
+
})));
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
if (${w}.value === undefined) {
|
|
242
|
+
if (${R} in input) {
|
|
243
|
+
newResult[${R}] = undefined;
|
|
244
|
+
}
|
|
245
|
+
} else {
|
|
246
|
+
newResult[${R}] = ${w}.value;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
`)}f.write("payload.value = newResult;"),f.write("return payload;");let P=f.compile();return(_,w)=>P(p,_,w)},i,s=Hn,a=!Os.jitless,u=a&&wh.value,l=e.catchall,d;t._zod.parse=(p,f)=>{d??(d=o.value);let m=p.value;return s(m)?a&&u&&f?.async===!1&&f.jitless!==!0?(i||(i=n(e.shape)),p=i(p,f),l?hS([],m,p,f,d,t):p):r(p,f):(p.issues.push({expected:"object",code:"invalid_type",input:m,inst:t}),p)}});li=h("$ZodUnion",(t,e)=>{W.init(t,e),Q(t._zod,"optin",()=>e.options.some(n=>n._zod.optin==="optional")?"optional":void 0),Q(t._zod,"optout",()=>e.options.some(n=>n._zod.optout==="optional")?"optional":void 0),Q(t._zod,"values",()=>{if(e.options.every(n=>n._zod.values))return new Set(e.options.flatMap(n=>Array.from(n._zod.values)))}),Q(t._zod,"pattern",()=>{if(e.options.every(n=>n._zod.pattern)){let n=e.options.map(i=>i._zod.pattern);return new RegExp(`^(${n.map(i=>Ns(i.source)).join("|")})$`)}});let r=e.options.length===1,o=e.options[0]._zod.run;t._zod.parse=(n,i)=>{if(r)return o(n,i);let s=!1,a=[];for(let c of e.options){let u=c._zod.run({value:n.value,issues:[]},i);if(u instanceof Promise)a.push(u),s=!0;else{if(u.issues.length===0)return u;a.push(u)}}return s?Promise.all(a).then(c=>rS(c,n,t,i)):rS(a,n,t,i)}});El=h("$ZodXor",(t,e)=>{li.init(t,e),e.inclusive=!1;let r=e.options.length===1,o=e.options[0]._zod.run;t._zod.parse=(n,i)=>{if(r)return o(n,i);let s=!1,a=[];for(let c of e.options){let u=c._zod.run({value:n.value,issues:[]},i);u instanceof Promise?(a.push(u),s=!0):a.push(u)}return s?Promise.all(a).then(c=>nS(c,n,t,i)):nS(a,n,t,i)}}),Il=h("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,li.init(t,e);let r=t._zod.parse;Q(t._zod,"propValues",()=>{let n={};for(let i of e.options){let s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(i)}"`);for(let[a,c]of Object.entries(s)){n[a]||(n[a]=new Set);for(let u of c)n[a].add(u)}}return n});let o=ei(()=>{let n=e.options,i=new Map;for(let s of n){let a=s._zod.propValues?.[e.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let c of a){if(i.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);i.set(c,s)}}return i});t._zod.parse=(n,i)=>{let s=n.value;if(!Hn(s))return n.issues.push({code:"invalid_type",expected:"object",input:s,inst:t}),n;let a=o.value.get(s?.[e.discriminator]);return a?a._zod.run(n,i):e.unionFallback?r(n,i):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:s,path:[e.discriminator],inst:t}),n)}}),zl=h("$ZodIntersection",(t,e)=>{W.init(t,e),t._zod.parse=(r,o)=>{let n=r.value,i=e.left._zod.run({value:n,issues:[]},o),s=e.right._zod.run({value:n,issues:[]},o);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([c,u])=>oS(r,c,u)):oS(r,i,s)}});Vs=h("$ZodTuple",(t,e)=>{W.init(t,e);let r=e.items;t._zod.parse=(o,n)=>{let i=o.value;if(!Array.isArray(i))return o.issues.push({input:i,inst:t,expected:"tuple",code:"invalid_type"}),o;o.value=[];let s=[],a=[...r].reverse().findIndex(l=>l._zod.optin!=="optional"),c=a===-1?0:r.length-a;if(!e.rest){let l=i.length>r.length,d=i.length<c-1;if(l||d)return o.issues.push({...l?{code:"too_big",maximum:r.length,inclusive:!0}:{code:"too_small",minimum:r.length},input:i,inst:t,origin:"array"}),o}let u=-1;for(let l of r){if(u++,u>=i.length&&u>=c)continue;let d=l._zod.run({value:i[u],issues:[]},n);d instanceof Promise?s.push(d.then(p=>Mu(p,o,u))):Mu(d,o,u)}if(e.rest){let l=i.slice(r.length);for(let d of l){u++;let p=e.rest._zod.run({value:d,issues:[]},n);p instanceof Promise?s.push(p.then(f=>Mu(f,o,u))):Mu(p,o,u)}}return s.length?Promise.all(s).then(()=>o):o}});Tl=h("$ZodRecord",(t,e)=>{W.init(t,e),t._zod.parse=(r,o)=>{let n=r.value;if(!an(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:t}),r;let i=[],s=e.keyType._zod.values;if(s){r.value={};let a=new Set;for(let u of s)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);let l=e.valueType._zod.run({value:n[u],issues:[]},o);l instanceof Promise?i.push(l.then(d=>{d.issues.length&&r.issues.push(...jt(u,d.issues)),r.value[u]=d.value})):(l.issues.length&&r.issues.push(...jt(u,l.issues)),r.value[u]=l.value)}let c;for(let u in n)a.has(u)||(c=c??[],c.push(u));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:t,keys:c})}else{r.value={};for(let a of Reflect.ownKeys(n)){if(a==="__proto__")continue;let c=e.keyType._zod.run({value:a,issues:[]},o);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&ju.test(a)&&c.issues.length){let d=e.keyType._zod.run({value:Number(a),issues:[]},o);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(c=d)}if(c.issues.length){e.mode==="loose"?r.value[a]=n[a]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(d=>$t(d,o,Ae())),input:a,path:[a],inst:t});continue}let l=e.valueType._zod.run({value:n[a],issues:[]},o);l instanceof Promise?i.push(l.then(d=>{d.issues.length&&r.issues.push(...jt(a,d.issues)),r.value[c.value]=d.value})):(l.issues.length&&r.issues.push(...jt(a,l.issues)),r.value[c.value]=l.value)}}return i.length?Promise.all(i).then(()=>r):r}}),Ol=h("$ZodMap",(t,e)=>{W.init(t,e),t._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:t}),r;let i=[];r.value=new Map;for(let[s,a]of n){let c=e.keyType._zod.run({value:s,issues:[]},o),u=e.valueType._zod.run({value:a,issues:[]},o);c instanceof Promise||u instanceof Promise?i.push(Promise.all([c,u]).then(([l,d])=>{iS(l,d,r,s,n,t,o)})):iS(c,u,r,s,n,t,o)}return i.length?Promise.all(i).then(()=>r):r}});Pl=h("$ZodSet",(t,e)=>{W.init(t,e),t._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:t,expected:"set",code:"invalid_type"}),r;let i=[];r.value=new Set;for(let s of n){let a=e.valueType._zod.run({value:s,issues:[]},o);a instanceof Promise?i.push(a.then(c=>sS(c,r))):sS(a,r)}return i.length?Promise.all(i).then(()=>r):r}});Rl=h("$ZodEnum",(t,e)=>{W.init(t,e);let r=js(e.entries),o=new Set(r);t._zod.values=o,t._zod.pattern=new RegExp(`^(${r.filter(n=>Cs.has(typeof n)).map(n=>typeof n=="string"?Ft(n):n.toString()).join("|")})$`),t._zod.parse=(n,i)=>{let s=n.value;return o.has(s)||n.issues.push({code:"invalid_value",values:r,input:s,inst:t}),n}}),jl=h("$ZodLiteral",(t,e)=>{if(W.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(e.values);t._zod.values=r,t._zod.pattern=new RegExp(`^(${e.values.map(o=>typeof o=="string"?Ft(o):o?Ft(o.toString()):String(o)).join("|")})$`),t._zod.parse=(o,n)=>{let i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:e.values,input:i,inst:t}),o}}),Nl=h("$ZodFile",(t,e)=>{W.init(t,e),t._zod.parse=(r,o)=>{let n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:t}),r}}),Cl=h("$ZodTransform",(t,e)=>{W.init(t,e),t._zod.parse=(r,o)=>{if(o.direction==="backward")throw new nn(t.constructor.name);let n=e.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then(s=>(r.value=s,r));if(n instanceof Promise)throw new sr;return r.value=n,r}});Hs=h("$ZodOptional",(t,e)=>{W.init(t,e),t._zod.optin="optional",t._zod.optout="optional",Q(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),Q(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Ns(r.source)})?$`):void 0}),t._zod.parse=(r,o)=>{if(e.innerType._zod.optin==="optional"){let n=e.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>aS(i,r.value)):aS(n,r.value)}return r.value===void 0?r:e.innerType._zod.run(r,o)}}),Al=h("$ZodExactOptional",(t,e)=>{Hs.init(t,e),Q(t._zod,"values",()=>e.innerType._zod.values),Q(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(r,o)=>e.innerType._zod.run(r,o)}),Dl=h("$ZodNullable",(t,e)=>{W.init(t,e),Q(t._zod,"optin",()=>e.innerType._zod.optin),Q(t._zod,"optout",()=>e.innerType._zod.optout),Q(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Ns(r.source)}|null)$`):void 0}),Q(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,o)=>r.value===null?r:e.innerType._zod.run(r,o)}),Ml=h("$ZodDefault",(t,e)=>{W.init(t,e),t._zod.optin="optional",Q(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,o)=>{if(o.direction==="backward")return e.innerType._zod.run(r,o);if(r.value===void 0)return r.value=e.defaultValue,r;let n=e.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>cS(i,e)):cS(n,e)}});Ul=h("$ZodPrefault",(t,e)=>{W.init(t,e),t._zod.optin="optional",Q(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,o))}),Zl=h("$ZodNonOptional",(t,e)=>{W.init(t,e),Q(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),t._zod.parse=(r,o)=>{let n=e.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>uS(i,t)):uS(n,t)}});Ll=h("$ZodSuccess",(t,e)=>{W.init(t,e),t._zod.parse=(r,o)=>{if(o.direction==="backward")throw new nn("ZodSuccess");let n=e.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.issues.length===0,r)):(r.value=n.issues.length===0,r)}}),Fl=h("$ZodCatch",(t,e)=>{W.init(t,e),Q(t._zod,"optin",()=>e.innerType._zod.optin),Q(t._zod,"optout",()=>e.innerType._zod.optout),Q(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,o)=>{if(o.direction==="backward")return e.innerType._zod.run(r,o);let n=e.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.value,i.issues.length&&(r.value=e.catchValue({...r,error:{issues:i.issues.map(s=>$t(s,o,Ae()))},input:r.value}),r.issues=[]),r)):(r.value=n.value,n.issues.length&&(r.value=e.catchValue({...r,error:{issues:n.issues.map(i=>$t(i,o,Ae()))},input:r.value}),r.issues=[]),r)}}),ql=h("$ZodNaN",(t,e)=>{W.init(t,e),t._zod.parse=(r,o)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:t,expected:"nan",code:"invalid_type"}),r)}),Vl=h("$ZodPipe",(t,e)=>{W.init(t,e),Q(t._zod,"values",()=>e.in._zod.values),Q(t._zod,"optin",()=>e.in._zod.optin),Q(t._zod,"optout",()=>e.out._zod.optout),Q(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,o)=>{if(o.direction==="backward"){let i=e.out._zod.run(r,o);return i instanceof Promise?i.then(s=>Uu(s,e.in,o)):Uu(i,e.in,o)}let n=e.in._zod.run(r,o);return n instanceof Promise?n.then(i=>Uu(i,e.out,o)):Uu(n,e.out,o)}});di=h("$ZodCodec",(t,e)=>{W.init(t,e),Q(t._zod,"values",()=>e.in._zod.values),Q(t._zod,"optin",()=>e.in._zod.optin),Q(t._zod,"optout",()=>e.out._zod.optout),Q(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,o)=>{if((o.direction||"forward")==="forward"){let i=e.in._zod.run(r,o);return i instanceof Promise?i.then(s=>Zu(s,e,o)):Zu(i,e,o)}else{let i=e.out._zod.run(r,o);return i instanceof Promise?i.then(s=>Zu(s,e,o)):Zu(i,e,o)}}});Hl=h("$ZodReadonly",(t,e)=>{W.init(t,e),Q(t._zod,"propValues",()=>e.innerType._zod.propValues),Q(t._zod,"values",()=>e.innerType._zod.values),Q(t._zod,"optin",()=>e.innerType?._zod?.optin),Q(t._zod,"optout",()=>e.innerType?._zod?.optout),t._zod.parse=(r,o)=>{if(o.direction==="backward")return e.innerType._zod.run(r,o);let n=e.innerType._zod.run(r,o);return n instanceof Promise?n.then(lS):lS(n)}});Jl=h("$ZodTemplateLiteral",(t,e)=>{W.init(t,e);let r=[];for(let o of e.parts)if(typeof o=="object"&&o!==null){if(!o._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let n=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${o._zod.traits}`);let i=n.startsWith("^")?1:0,s=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(i,s))}else if(o===null||Sh.has(typeof o))r.push(Ft(`${o}`));else throw new Error(`Invalid template literal part: ${o}`);t._zod.pattern=new RegExp(`^${r.join("")}$`),t._zod.parse=(o,n)=>typeof o.value!="string"?(o.issues.push({input:o.value,inst:t,expected:"string",code:"invalid_type"}),o):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(o.value)||o.issues.push({input:o.value,inst:t,code:"invalid_format",format:e.format??"template_literal",pattern:t._zod.pattern.source}),o)}),Bl=h("$ZodFunction",(t,e)=>(W.init(t,e),t._def=e,t._zod.def=e,t.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...o){let n=t._def.input?Jn(t._def.input,o):o,i=Reflect.apply(r,this,n);return t._def.output?Jn(t._def.output,i):i}},t.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...o){let n=t._def.input?await Bn(t._def.input,o):o,i=await Reflect.apply(r,this,n);return t._def.output?await Bn(t._def.output,i):i}},t._zod.parse=(r,o)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:t}),r):(t._def.output&&t._def.output._zod.def.type==="promise"?r.value=t.implementAsync(r.value):r.value=t.implement(r.value),r),t.input=(...r)=>{let o=t.constructor;return Array.isArray(r[0])?new o({type:"function",input:new Vs({type:"tuple",items:r[0],rest:r[1]}),output:t._def.output}):new o({type:"function",input:r[0],output:t._def.output})},t.output=r=>{let o=t.constructor;return new o({type:"function",input:t._def.input,output:r})},t)),Wl=h("$ZodPromise",(t,e)=>{W.init(t,e),t._zod.parse=(r,o)=>Promise.resolve(r.value).then(n=>e.innerType._zod.run({value:n,issues:[]},o))}),Gl=h("$ZodLazy",(t,e)=>{W.init(t,e),Q(t._zod,"innerType",()=>e.getter()),Q(t._zod,"pattern",()=>t._zod.innerType?._zod?.pattern),Q(t._zod,"propValues",()=>t._zod.innerType?._zod?.propValues),Q(t._zod,"optin",()=>t._zod.innerType?._zod?.optin??void 0),Q(t._zod,"optout",()=>t._zod.innerType?._zod?.optout??void 0),t._zod.parse=(r,o)=>t._zod.innerType._zod.run(r,o)}),Kl=h("$ZodCustom",(t,e)=>{ke.init(t,e),W.init(t,e),t._zod.parse=(r,o)=>r,t._zod.check=r=>{let o=r.value,n=e.fn(o);if(n instanceof Promise)return n.then(i=>dS(i,r,o,t));dS(n,r,o,t)}})});function gS(){return{localeError:UN()}}var UN,yS=g(()=>{q();UN=()=>{let t={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(n){return t[n]??null}let r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${i}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`}case"invalid_value":return n.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${k(n.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${b(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${n.prefix}"`:i.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${i.suffix}"`:i.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${i.includes}"`:i.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${i.pattern}`:`${r[i.format]??n.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${n.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${n.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${n.keys.length>1?"\u0629":""}: ${b(n.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}}});function vS(){return{localeError:ZN()}}var ZN,_S=g(()=>{q();ZN=()=>{let t={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(n){return t[n]??null}let r={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"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${n.expected}, daxil olan ${a}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${i}, daxil olan ${a}`}case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${k(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${b(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${i.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:i.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${i.suffix}" il\u0259 bitm\u0259lidir`:i.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${i.includes}" daxil olmal\u0131d\u0131r`:i.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${i.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[i.format]??n.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${n.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${n.keys.length>1?"lar":""}: ${b(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${n.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}}});function bS(t,e,r,o){let n=Math.abs(t),i=n%10,s=n%100;return s>=11&&s<=19?o:i===1?e:i>=2&&i<=4?r:o}function $S(){return{localeError:LN()}}var LN,xS=g(()=>{q();LN=()=>{let t={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(n){return t[n]??null}let r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},o={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${i}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`}case"invalid_value":return n.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${k(n.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${b(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin);if(s){let a=Number(n.maximum),c=bS(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${i}${n.maximum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin);if(s){let a=Number(n.minimum),c=bS(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${i}${n.minimum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${n.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${b(n.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${n.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}}});function kS(){return{localeError:FN()}}var FN,wS=g(()=>{q();FN=()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function e(n){return t[n]??null}let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${k(n.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${b(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.minimum.toString()} ${s.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${i.prefix}"`;if(i.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${i.suffix}"`;if(i.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${i.includes}"`;if(i.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${i.pattern}`;let s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return i.format==="emoji"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="datetime"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="date"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),i.format==="time"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="duration"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${s} ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${n.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u043E\u0432\u0435":""}: ${b(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}}});function SS(){return{localeError:qN()}}var qN,ES=g(()=>{q();qN=()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(n){return t[n]??null}let r={regex:"entrada",email:"adre\xE7a electr\xF2nica",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\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${n.expected}, s'ha rebut ${a}`:`Tipus inv\xE0lid: s'esperava ${i}, s'ha rebut ${a}`}case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${k(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${b(n.values," o ")}`;case"too_big":{let i=n.inclusive?"com a m\xE0xim":"menys de",s=e(n.origin);return s?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${i} ${n.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"com a m\xEDnim":"m\xE9s de",s=e(n.origin);return s?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${i} ${n.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${i.prefix}"`:i.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${i.suffix}"`:i.format==="includes"?`Format inv\xE0lid: ha d'incloure "${i.includes}"`:i.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${i.pattern}`:`Format inv\xE0lid per a ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${b(n.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${n.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${n.origin}`;default:return"Entrada inv\xE0lida"}}}});function IS(){return{localeError:VN()}}var VN,zS=g(()=>{q();VN=()=>{let t={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(n){return t[n]??null}let r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 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 \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},o={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${n.expected}, obdr\u017Eeno ${a}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${i}, obdr\u017Eeno ${a}`}case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${k(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${b(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${i.prefix}"`:i.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${i.suffix}"`:i.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${i.includes}"`:i.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${i.pattern}`:`Neplatn\xFD form\xE1t ${r[i.format]??n.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${n.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${b(n.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${n.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${n.origin}`;default:return"Neplatn\xFD vstup"}}}});function TS(){return{localeError:HN()}}var HN,OS=g(()=>{q();HN=()=>{let t={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function e(n){return t[n]??null}let r={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\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",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"},o={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${a}`:`Ugyldigt input: forventede ${i}, fik ${a}`}case"invalid_value":return n.values.length===1?`Ugyldig v\xE6rdi: forventede ${k(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${b(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin),a=o[n.origin]??n.origin;return s?`For stor: forventede ${a??"value"} ${s.verb} ${i} ${n.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${a??"value"} havde ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin),a=o[n.origin]??n.origin;return s?`For lille: forventede ${a} ${s.verb} ${i} ${n.minimum.toString()} ${s.unit}`:`For lille: forventede ${a} havde ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: skal starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: skal ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: skal indeholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${b(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${n.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${n.origin}`;default:return"Ugyldigt input"}}}});function PS(){return{localeError:JN()}}var JN,RS=g(()=>{q();JN=()=>{let t={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 e(n){return t[n]??null}let r={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"},o={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${n.expected}, erhalten ${a}`:`Ung\xFCltige Eingabe: erwartet ${i}, erhalten ${a}`}case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${k(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${b(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin);return s?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ist`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin);return s?`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ist`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ung\xFCltiger String: muss mit "${i.prefix}" beginnen`:i.format==="ends_with"?`Ung\xFCltiger String: muss mit "${i.suffix}" enden`:i.format==="includes"?`Ung\xFCltiger String: muss "${i.includes}" enthalten`:i.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${i.pattern} entsprechen`:`Ung\xFCltig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${b(n.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${n.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${n.origin}`;default:return"Ung\xFCltige Eingabe"}}}});function Xl(){return{localeError:BN()}}var BN,Og=g(()=>{q();BN=()=>{let t={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 e(n){return t[n]??null}let r={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"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return`Invalid input: expected ${i}, received ${a}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${k(n.values[0])}`:`Invalid option: expected one of ${b(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin);return s?`Too big: expected ${n.origin??"value"} to have ${i}${n.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin);return s?`Too small: expected ${n.origin} to have ${i}${n.minimum.toString()} ${s.unit}`:`Too small: expected ${n.origin} to be ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${b(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}}});function jS(){return{localeError:WN()}}var WN,NS=g(()=>{q();WN=()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(n){return t[n]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",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\u016Dro",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"},o={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${n.expected}, ricevi\u011Dis ${a}`:`Nevalida enigo: atendi\u011Dis ${i}, ricevi\u011Dis ${a}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${k(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${b(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin);return s?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin);return s?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${i}${n.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${i.prefix}"`:i.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${i.suffix}"`:i.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${i.includes}"`:i.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${i.pattern}`:`Nevalida ${r[i.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${b(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}}});function CS(){return{localeError:GN()}}var GN,AS=g(()=>{q();GN=()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(n){return t[n]??null}let r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",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\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${n.expected}, recibido ${a}`:`Entrada inv\xE1lida: se esperaba ${i}, recibido ${a}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${k(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${b(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin),a=o[n.origin]??n.origin;return s?`Demasiado grande: se esperaba que ${a??"valor"} tuviera ${i}${n.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${a??"valor"} fuera ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin),a=o[n.origin]??n.origin;return s?`Demasiado peque\xF1o: se esperaba que ${a} tuviera ${i}${n.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${a} fuera ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${i.prefix}"`:i.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${i.suffix}"`:i.format==="includes"?`Cadena inv\xE1lida: debe incluir "${i.includes}"`:i.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${i.pattern}`:`Inv\xE1lido ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${b(n.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o[n.origin]??n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o[n.origin]??n.origin}`;default:return"Entrada inv\xE1lida"}}}});function DS(){return{localeError:KN()}}var KN,MS=g(()=>{q();KN=()=>{let t={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(n){return t[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${i} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return n.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${k(n.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${b(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:i.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:i.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${i.includes}" \u0628\u0627\u0634\u062F`:i.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${i.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[i.format]??n.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${n.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${n.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${b(n.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${n.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${n.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}}});function US(){return{localeError:XN()}}var XN,ZS=g(()=>{q();XN=()=>{let t={string:{unit:"merkki\xE4",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\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(n){return t[n]??null}let r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",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\xE4iv\xE4m\xE4\xE4r\xE4",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"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${a}`:`Virheellinen tyyppi: odotettiin ${i}, oli ${a}`}case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${k(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${b(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${i}${n.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${i}${n.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${i.prefix}"`:i.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${i.suffix}"`:i.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${i.includes}"`:i.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${i.pattern}`:`Virheellinen ${r[i.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${b(n.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\xF6te"}}}});function LS(){return{localeError:YN()}}var YN,FS=g(()=>{q();YN=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(n){return t[n]??null}let r={regex:"entr\xE9e",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\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={nan:"NaN",number:"nombre",array:"tableau"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : instanceof ${n.expected} attendu, ${a} re\xE7u`:`Entr\xE9e invalide : ${i} attendu, ${a} re\xE7u`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${k(n.values[0])} attendu`:`Option invalide : une valeur parmi ${b(n.values,"|")} attendue`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin);return s?`Trop grand : ${n.origin??"valeur"} doit ${s.verb} ${i}${n.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${n.origin??"valeur"} doit \xEAtre ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin);return s?`Trop petit : ${n.origin} doit ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`Trop petit : ${n.origin} doit \xEAtre ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${b(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}}});function qS(){return{localeError:QN()}}var QN,VS=g(()=>{q();QN=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(n){return t[n]??null}let r={regex:"entr\xE9e",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\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : attendu instanceof ${n.expected}, re\xE7u ${a}`:`Entr\xE9e invalide : attendu ${i}, re\xE7u ${a}`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${k(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${b(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u2264":"<",s=e(n.origin);return s?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${i}${n.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u2265":">",s=e(n.origin);return s?`Trop petit : attendu que ${n.origin} ait ${i}${n.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${n.origin} soit ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${b(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}}});function HS(){return{localeError:eC()}}var eC,JS=g(()=>{q();eC=()=>{let t={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},e={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=u=>u?t[u]:void 0,o=u=>{let l=r(u);return l?l.label:u??t.unknown.label},n=u=>`\u05D4${o(u)}`,i=u=>(r(u)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",s=u=>u?e[u]??null:null,a={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",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:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},c={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let l=u.expected,d=c[l??""]??o(l),p=I(u.input),f=c[p]??t[p]?.label??p;return/^[A-Z]/.test(u.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${u.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${d}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`}case"invalid_value":{if(u.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${k(u.values[0])}`;let l=u.values.map(f=>k(f));if(u.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${l[0]} \u05D0\u05D5 ${l[1]}`;let d=l[l.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${l.slice(0,-1).join(", ")} \u05D0\u05D5 ${d}`}case"too_big":{let l=s(u.origin),d=n(u.origin??"value");if(u.origin==="string")return`${l?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.maximum.toString()} ${l?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(u.origin==="number"){let m=u.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${u.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}`}if(u.origin==="array"||u.origin==="set"){let m=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",y=u.inclusive?`${u.maximum} ${l?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${u.maximum} ${l?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let p=u.inclusive?"<=":"<",f=i(u.origin??"value");return l?.unit?`${l.longLabel} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${u.maximum.toString()} ${l.unit}`:`${l?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${u.maximum.toString()}`}case"too_small":{let l=s(u.origin),d=n(u.origin??"value");if(u.origin==="string")return`${l?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.minimum.toString()} ${l?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(u.origin==="number"){let m=u.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${u.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}`}if(u.origin==="array"||u.origin==="set"){let m=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(u.minimum===1&&u.inclusive){let x=(u.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${x}`}let y=u.inclusive?`${u.minimum} ${l?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${u.minimum} ${l?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let p=u.inclusive?">=":">",f=i(u.origin??"value");return l?.unit?`${l.shortLabel} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${u.minimum.toString()} ${l.unit}`:`${l?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${u.minimum.toString()}`}case"invalid_format":{let l=u;if(l.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${l.prefix}"`;if(l.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${l.suffix}"`;if(l.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${l.includes}"`;if(l.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${l.pattern}`;let d=a[l.format],p=d?.label??l.format,m=(d?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${p} \u05DC\u05D0 ${m}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${u.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${u.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${u.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${b(u.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${n(u.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}}});function BS(){return{localeError:tC()}}var tC,WS=g(()=>{q();tC=()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(n){return t[n]??null}let r={regex:"bemenet",email:"email c\xEDm",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\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},o={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${n.expected}, a kapott \xE9rt\xE9k ${a}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${i}, a kapott \xE9rt\xE9k ${a}`}case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${k(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${b(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin);return s?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${i}${n.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${i}${n.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xC9rv\xE9nytelen string: "${i.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:i.format==="ends_with"?`\xC9rv\xE9nytelen string: "${i.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:i.format==="includes"?`\xC9rv\xE9nytelen string: "${i.includes}" \xE9rt\xE9ket kell tartalmaznia`:i.format==="regex"?`\xC9rv\xE9nytelen string: ${i.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[i.format]??n.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${n.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${b(n.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${n.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${n.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}}});function GS(t,e,r){return Math.abs(t)===1?e:r}function pi(t){if(!t)return"";let e=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=t[t.length-1];return t+(e.includes(r)?"\u0576":"\u0568")}function KS(){return{localeError:rC()}}var rC,XS=g(()=>{q();rC=()=>{let t={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function e(n){return t[n]??null}let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},o={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${n.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${i}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`}case"invalid_value":return n.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${k(n.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${b(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin);if(s){let a=Number(n.maximum),c=GS(a,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${pi(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.maximum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${pi(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin);if(s){let a=Number(n.minimum),c=GS(a,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${pi(n.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.minimum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${pi(n.origin)} \u056C\u056B\u0576\u056B ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${i.prefix}"-\u0578\u057E`:i.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${i.suffix}"-\u0578\u057E`:i.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${i.includes}"`:i.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${i.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[i.format]??n.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${n.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${n.keys.length>1?"\u0576\u0565\u0580":""}. ${b(n.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${pi(n.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${pi(n.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}}});function YS(){return{localeError:nC()}}var nC,QS=g(()=>{q();nC=()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(n){return t[n]??null}let r={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"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${a}`:`Input tidak valid: diharapkan ${i}, diterima ${a}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${k(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${b(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin);return s?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${i}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin);return s?`Terlalu kecil: diharapkan ${n.origin} memiliki ${i}${n.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak valid: harus dimulai dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak valid: harus berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak valid: harus menyertakan "${i.includes}"`:i.format==="regex"?`String tidak valid: harus sesuai pola ${i.pattern}`:`${r[i.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${b(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}}});function e0(){return{localeError:oC()}}var oC,t0=g(()=>{q();oC=()=>{let t={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function e(n){return t[n]??null}let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",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\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",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\xF6lugildi",jwt:"JWT",template_literal:"gildi"},o={nan:"NaN",number:"n\xFAmer",array:"fylki"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera instanceof ${n.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera ${i}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${k(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${b(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin);return s?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${i}${n.maximum.toString()} ${s.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} s\xE9 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin);return s?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${i}${n.minimum.toString()} ${s.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} s\xE9 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${i.prefix}"`:i.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${i.suffix}"`:i.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${i.includes}"`:i.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${i.pattern}`:`Rangt ${r[i.format]??n.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${b(n.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${n.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${n.origin}`;default:return"Rangt gildi"}}}});function r0(){return{localeError:iC()}}var iC,n0=g(()=>{q();iC=()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(n){return t[n]??null}let r={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"},o={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${a}`:`Input non valido: atteso ${i}, ricevuto ${a}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${k(n.values[0])}`:`Opzione non valida: atteso uno tra ${b(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin);return s?`Troppo grande: ${n.origin??"valore"} deve avere ${i}${n.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin);return s?`Troppo piccolo: ${n.origin} deve avere ${i}${n.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${n.origin} deve essere ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Stringa non valida: deve iniziare con "${i.prefix}"`:i.format==="ends_with"?`Stringa non valida: deve terminare con "${i.suffix}"`:i.format==="includes"?`Stringa non valida: deve includere "${i.includes}"`:i.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${b(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}}});function o0(){return{localeError:sC()}}var sC,i0=g(()=>{q();sC=()=>{let t={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(n){return t[n]??null}let r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},o={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${i}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${k(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${b(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let i=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=e(n.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${s.unit??"\u8981\u7D20"}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let i=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=e(n.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${s.unit}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${i.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${n.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${n.keys.length>1?"\u7FA4":""}: ${b(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}}});function s0(){return{localeError:aC()}}var aC,a0=g(()=>{q();aC=()=>{let t={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function e(n){return t[n]??null}let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",json_string:"JSON \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},o={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${n.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`}case"invalid_value":return n.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${k(n.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${b(n.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${s.verb} ${i}${n.maximum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} \u10D8\u10E7\u10DD\u10E1 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.prefix}"-\u10D8\u10D7`:i.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.suffix}"-\u10D8\u10D7`:i.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${i.includes}"-\u10E1`:i.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${i.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${n.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${n.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${b(n.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${n.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${n.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}}});function Yl(){return{localeError:cC()}}var cC,Pg=g(()=>{q();cC=()=>{let t={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(n){return t[n]??null}let r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},o={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`}case"invalid_value":return n.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${k(n.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${b(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${i.prefix}"`:i.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${i.suffix}"`:i.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${i.includes}"`:i.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${i.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${n.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${b(n.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}}});function c0(){return Yl()}var u0=g(()=>{Pg()});function l0(){return{localeError:uC()}}var uC,d0=g(()=>{q();uC=()=>{let t={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function e(n){return t[n]??null}let r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${i}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`}case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${k(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${b(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let i=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=i==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(n.origin),c=a?.unit??"\uC694\uC18C";return a?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${c} ${i}${s}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${i}${s}`}case"too_small":{let i=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=i==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(n.origin),c=a?.unit??"\uC694\uC18C";return a?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${c} ${i}${s}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${i}${s}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:i.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${i.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[i.format]??n.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${n.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${b(n.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${n.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${n.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}}});function p0(t){let e=Math.abs(t),r=e%10,o=e%100;return o>=11&&o<=19||r===0?"many":r===1?"one":"few"}function f0(){return{localeError:lC()}}var Js,lC,m0=g(()=>{q();Js=t=>t.charAt(0).toUpperCase()+t.slice(1);lC=()=>{let t={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function e(n,i,s,a){let c=t[n]??null;return c===null?c:{unit:c.unit[i],verb:c.verb[a][s?"inclusive":"notInclusive"]}}let r={regex:"\u012Fvestis",email:"el. pa\u0161to 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\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},o={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Gautas tipas ${a}, o tik\u0117tasi - instanceof ${n.expected}`:`Gautas tipas ${a}, o tik\u0117tasi - ${i}`}case"invalid_value":return n.values.length===1?`Privalo b\u016Bti ${k(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${b(n.values,"|")} pasirinkim\u0173`;case"too_big":{let i=o[n.origin]??n.origin,s=e(n.origin,p0(Number(n.maximum)),n.inclusive??!1,"smaller");if(s?.verb)return`${Js(i??n.origin??"reik\u0161m\u0117")} ${s.verb} ${n.maximum.toString()} ${s.unit??"element\u0173"}`;let a=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Js(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${n.maximum.toString()} ${s?.unit}`}case"too_small":{let i=o[n.origin]??n.origin,s=e(n.origin,p0(Number(n.minimum)),n.inclusive??!1,"bigger");if(s?.verb)return`${Js(i??n.origin??"reik\u0161m\u0117")} ${s.verb} ${n.minimum.toString()} ${s.unit??"element\u0173"}`;let a=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Js(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${n.minimum.toString()} ${s?.unit}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${i.prefix}"`:i.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${i.suffix}"`:i.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${i.includes}"`:i.format==="regex"?`Eilut\u0117 privalo atitikti ${i.pattern}`:`Neteisingas ${r[i.format]??n.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${n.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${b(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let i=o[n.origin]??n.origin;return`${Js(i??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}}});function h0(){return{localeError:dC()}}var dC,g0=g(()=>{q();dC=()=>{let t={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(n){return t[n]??null}let r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},o={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${k(n.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${b(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${b(n.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${n.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${n.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}}});function y0(){return{localeError:pC()}}var pC,v0=g(()=>{q();pC=()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(n){return t[n]??null}let r={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"},o={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${a}`:`Input tidak sah: dijangka ${i}, diterima ${a}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${k(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${b(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin);return s?`Terlalu besar: dijangka ${n.origin??"nilai"} ${s.verb} ${i}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin);return s?`Terlalu kecil: dijangka ${n.origin} ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak sah: mesti bermula dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak sah: mesti mengandungi "${i.includes}"`:i.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${i.pattern}`:`${r[i.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${b(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}}});function _0(){return{localeError:fC()}}var fC,b0=g(()=>{q();fC=()=>{let t={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function e(n){return t[n]??null}let r={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"},o={nan:"NaN",number:"getal"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${a}`:`Ongeldige invoer: verwacht ${i}, ontving ${a}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${k(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${b(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin),a=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return s?`Te ${a}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${a}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} is`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin),a=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return s?`Te ${a}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${a}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} is`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ongeldige tekst: moet met "${i.prefix}" beginnen`:i.format==="ends_with"?`Ongeldige tekst: moet op "${i.suffix}" eindigen`:i.format==="includes"?`Ongeldige tekst: moet "${i.includes}" bevatten`:i.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`:`Ongeldig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${b(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}}});function $0(){return{localeError:mC()}}var mC,x0=g(()=>{q();mC=()=>{let t={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function e(n){return t[n]??null}let r={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\xE5de",ipv6:"IPv6-omr\xE5de",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"},o={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${a}`:`Ugyldig input: forventet ${i}, fikk ${a}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${k(n.values[0])}`:`Ugyldig valg: forventet en av ${b(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin);return s?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin);return s?`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${b(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}}});function k0(){return{localeError:hC()}}var hC,w0=g(()=>{q();hC=()=>{let t={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(n){return t[n]??null}let r={regex:"giren",email:"epostag\xE2h",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\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},o={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`F\xE2sit giren: umulan instanceof ${n.expected}, al\u0131nan ${a}`:`F\xE2sit giren: umulan ${i}, al\u0131nan ${a}`}case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${k(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${b(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin);return s?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin);return s?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let i=n;return i.format==="starts_with"?`F\xE2sit metin: "${i.prefix}" ile ba\u015Flamal\u0131.`:i.format==="ends_with"?`F\xE2sit metin: "${i.suffix}" ile bitmeli.`:i.format==="includes"?`F\xE2sit metin: "${i.includes}" ihtiv\xE2 etmeli.`:i.format==="regex"?`F\xE2sit metin: ${i.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[i.format]??n.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${n.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${n.keys.length>1?"s":""}: ${b(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${n.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}}});function S0(){return{localeError:gC()}}var gC,E0=g(()=>{q();gC=()=>{let t={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(n){return t[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${i} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return n.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${k(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${b(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:i.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:i.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${i.includes}" \u0648\u0644\u0631\u064A`:i.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${i.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[i.format]??n.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${n.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${n.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${b(n.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${n.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${n.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}}});function I0(){return{localeError:yC()}}var yC,z0=g(()=>{q();yC=()=>{let t={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function e(n){return t[n]??null}let r={regex:"wyra\u017Cenie",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\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},o={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${n.expected}, otrzymano ${a}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${i}, otrzymano ${a}`}case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${k(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${b(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${i.prefix}"`:i.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${i.suffix}"`:i.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${i.includes}"`:i.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${i.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[i.format]??n.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${b(n.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${n.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${n.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}}});function T0(){return{localeError:vC()}}var vC,O0=g(()=>{q();vC=()=>{let t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(n){return t[n]??null}let r={regex:"padr\xE3o",email:"endere\xE7o 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\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o 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\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",number:"n\xFAmero",null:"nulo"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Tipo inv\xE1lido: esperado instanceof ${n.expected}, recebido ${a}`:`Tipo inv\xE1lido: esperado ${i}, recebido ${a}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${k(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${b(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin);return s?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${i}${n.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin);return s?`Muito pequeno: esperado que ${n.origin} tivesse ${i}${n.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${i.prefix}"`:i.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${i.suffix}"`:i.format==="includes"?`Texto inv\xE1lido: deve incluir "${i.includes}"`:i.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${i.pattern}`:`${r[i.format]??n.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${b(n.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${n.origin}`;default:return"Campo inv\xE1lido"}}}});function P0(t,e,r,o){let n=Math.abs(t),i=n%10,s=n%100;return s>=11&&s<=19?o:i===1?e:i>=2&&i<=4?r:o}function R0(){return{localeError:_C()}}var _C,j0=g(()=>{q();_C=()=>{let t={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(n){return t[n]??null}let r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${k(n.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${b(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin);if(s){let a=Number(n.maximum),c=P0(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.maximum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin);if(s){let a=Number(n.minimum),c=P0(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.minimum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${n.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0438":""}: ${b(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}}});function N0(){return{localeError:bC()}}var bC,C0=g(()=>{q();bC=()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(n){return t[n]??null}let r={regex:"vnos",email:"e-po\u0161tni 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 \u010Das",date:"ISO datum",time:"ISO \u010Das",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 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},o={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${n.expected}, prejeto ${a}`:`Neveljaven vnos: pri\u010Dakovano ${i}, prejeto ${a}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${k(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${b(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${i}${n.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${i}${n.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${i.prefix}"`:i.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${i.suffix}"`:i.format==="includes"?`Neveljaven niz: mora vsebovati "${i.includes}"`:i.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`:`Neveljaven ${r[i.format]??n.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${b(n.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}}});function A0(){return{localeError:$C()}}var $C,D0=g(()=>{q();$C=()=>{let t={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function e(n){return t[n]??null}let r={regex:"regulj\xE4rt 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\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},o={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${n.expected}, fick ${a}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${i}, fick ${a}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${k(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${b(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${i.prefix}"`:i.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${i.suffix}"`:i.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${i.includes}"`:i.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${i.pattern}"`:`Ogiltig(t) ${r[i.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${b(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${n.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}}});function M0(){return{localeError:xC()}}var xC,U0=g(()=>{q();xC=()=>{let t={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function e(n){return t[n]??null}let r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",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 \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`}case"invalid_value":return n.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${k(n.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${b(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} ${s.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin);return s?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} ${s.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${i.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${n.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${n.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${b(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}}});function Z0(){return{localeError:kC()}}var kC,L0=g(()=>{q();kC=()=>{let t={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function e(n){return t[n]??null}let r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},o={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${i} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`}case"invalid_value":return n.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${k(n.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${b(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=e(n.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=e(n.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${i.prefix}"`:i.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${i.suffix}"`:i.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${i.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:i.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${i.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${n.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${b(n.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}}});function F0(){return{localeError:wC()}}var wC,q0=g(()=>{q();wC=()=>{let t={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(n){return t[n]??null}let r={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\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${n.expected}, al\u0131nan ${a}`:`Ge\xE7ersiz de\u011Fer: beklenen ${i}, al\u0131nan ${a}`}case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${k(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${b(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ge\xE7ersiz metin: "${i.prefix}" ile ba\u015Flamal\u0131`:i.format==="ends_with"?`Ge\xE7ersiz metin: "${i.suffix}" ile bitmeli`:i.format==="includes"?`Ge\xE7ersiz metin: "${i.includes}" i\xE7ermeli`:i.format==="regex"?`Ge\xE7ersiz metin: ${i.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[i.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${b(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}}});function Ql(){return{localeError:SC()}}var SC,Rg=g(()=>{q();SC=()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(n){return t[n]??null}let r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${i}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${k(n.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${b(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${i}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} \u0431\u0443\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0456":""}: ${b(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${n.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}}});function V0(){return Ql()}var H0=g(()=>{Rg()});function J0(){return{localeError:EC()}}var EC,B0=g(()=>{q();EC=()=>{let t={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(n){return t[n]??null}let r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},o={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${i} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${k(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${b(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${i}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${i}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${i}${n.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${i}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${i.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${n.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${n.keys.length>1?"\u0632":""}: ${b(n.keys,"\u060C ")}`;case"invalid_key":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}}});function W0(){return{localeError:IC()}}var IC,G0=g(()=>{q();IC=()=>{let t={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"}};function e(n){return t[n]??null}let r={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"},o={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${a}`:`Noto\u2018g\u2018ri kirish: kutilgan ${i}, qabul qilingan ${a}`}case"invalid_value":return n.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${k(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${b(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin);return s?`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin);return s?`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()} ${s.unit} ${s.verb}`:`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${i.prefix}" bilan boshlanishi kerak`:i.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${i.suffix}" bilan tugashi kerak`:i.format==="includes"?`Noto\u2018g\u2018ri satr: "${i.includes}" ni o\u2018z ichiga olishi kerak`:i.format==="regex"?`Noto\u2018g\u2018ri satr: ${i.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[i.format]??n.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${n.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${n.keys.length>1?"lar":""}: ${b(n.keys,", ")}`;case"invalid_key":return`${n.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${n.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}}});function K0(){return{localeError:zC()}}var zC,X0=g(()=>{q();zC=()=>{let t={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(n){return t[n]??null}let r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 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\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},o={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${i}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`}case"invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${k(n.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${b(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${i}${n.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${i.prefix}"`:i.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${i.suffix}"`:i.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${i.includes}"`:i.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${i.pattern}`:`${r[i.format]??n.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${n.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${b(n.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}}});function Y0(){return{localeError:TC()}}var TC,Q0=g(()=>{q();TC=()=>{let t={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function e(n){return t[n]??null}let r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},o={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${i}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`}case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${k(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${b(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.prefix}" \u5F00\u5934`:i.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.suffix}" \u7ED3\u5C3E`:i.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${i.pattern}`:`\u65E0\u6548${r[i.format]??n.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${n.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${b(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${n.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}}});function eE(){return{localeError:OC()}}var OC,tE=g(()=>{q();OC=()=>{let t={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(n){return t[n]??null}let r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",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 \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${n.expected}\uFF0C\u4F46\u6536\u5230 ${a}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${i}\uFF0C\u4F46\u6536\u5230 ${a}`}case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${k(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${b(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.prefix}" \u958B\u982D`:i.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.suffix}" \u7D50\u5C3E`:i.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${i.pattern}`:`\u7121\u6548\u7684 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${n.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${n.keys.length>1?"\u5011":""}\uFF1A${b(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}}});function rE(){return{localeError:PC()}}var PC,nE=g(()=>{q();PC=()=>{let t={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function e(n){return t[n]??null}let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",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:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},o={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=I(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${n.expected}, \xE0m\u1ECD\u0300 a r\xED ${a}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${i}, \xE0m\u1ECD\u0300 a r\xED ${a}`}case"invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${k(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${b(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=e(n.origin);return s?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${s.verb} ${i}${n.maximum} ${s.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.maximum}`}case"too_small":{let i=n.inclusive?">=":">",s=e(n.origin);return s?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${s.verb} ${i}${n.minimum} ${s.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.minimum}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${i.prefix}"`:i.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${i.suffix}"`:i.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${i.includes}"`:i.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${i.pattern}`:`A\u1E63\xEC\u1E63e: ${r[i.format]??n.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${n.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${b(n.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}}});var fi={};bt(fi,{ar:()=>gS,az:()=>vS,be:()=>$S,bg:()=>kS,ca:()=>SS,cs:()=>IS,da:()=>TS,de:()=>PS,en:()=>Xl,eo:()=>jS,es:()=>CS,fa:()=>DS,fi:()=>US,fr:()=>LS,frCA:()=>qS,he:()=>HS,hu:()=>BS,hy:()=>KS,id:()=>YS,is:()=>e0,it:()=>r0,ja:()=>o0,ka:()=>s0,kh:()=>c0,km:()=>Yl,ko:()=>l0,lt:()=>f0,mk:()=>h0,ms:()=>y0,nl:()=>_0,no:()=>$0,ota:()=>k0,pl:()=>I0,ps:()=>S0,pt:()=>T0,ru:()=>R0,sl:()=>N0,sv:()=>A0,ta:()=>M0,th:()=>Z0,tr:()=>F0,ua:()=>V0,uk:()=>Ql,ur:()=>J0,uz:()=>W0,vi:()=>K0,yo:()=>rE,zhCN:()=>Y0,zhTW:()=>eE});var ed=g(()=>{yS();_S();xS();wS();ES();zS();OS();RS();Og();NS();AS();MS();ZS();FS();VS();JS();WS();XS();QS();t0();n0();i0();a0();u0();Pg();d0();m0();g0();v0();b0();x0();w0();E0();z0();O0();j0();C0();D0();U0();L0();q0();H0();Rg();B0();G0();X0();Q0();tE();nE()});function Bs(){return new td}var oE,rd,nd,td,Be,Ws=g(()=>{rd=Symbol("ZodOutput"),nd=Symbol("ZodInput"),td=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let o=r[0];return this._map.set(e,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let o={...this.get(r)??{}};delete o.id;let n={...o,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};(oE=globalThis).__zod_globalRegistry??(oE.__zod_globalRegistry=Bs());Be=globalThis.__zod_globalRegistry});function od(t,e){return new t({type:"string",...T(e)})}function id(t,e){return new t({type:"string",coerce:!0,...T(e)})}function Gs(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...T(e)})}function mi(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...T(e)})}function Ks(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...T(e)})}function Xs(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...T(e)})}function Ys(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...T(e)})}function Qs(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...T(e)})}function hi(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...T(e)})}function ea(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...T(e)})}function ta(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...T(e)})}function ra(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...T(e)})}function na(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...T(e)})}function oa(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...T(e)})}function ia(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...T(e)})}function sa(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...T(e)})}function aa(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...T(e)})}function ca(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...T(e)})}function sd(t,e){return new t({type:"string",format:"mac",check:"string_format",abort:!1,...T(e)})}function ua(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...T(e)})}function la(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...T(e)})}function da(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...T(e)})}function pa(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...T(e)})}function fa(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...T(e)})}function ma(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...T(e)})}function cd(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...T(e)})}function ud(t,e){return new t({type:"string",format:"date",check:"string_format",...T(e)})}function ld(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...T(e)})}function dd(t,e){return new t({type:"string",format:"duration",check:"string_format",...T(e)})}function pd(t,e){return new t({type:"number",checks:[],...T(e)})}function fd(t,e){return new t({type:"number",coerce:!0,checks:[],...T(e)})}function md(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...T(e)})}function hd(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...T(e)})}function gd(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...T(e)})}function yd(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...T(e)})}function vd(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...T(e)})}function _d(t,e){return new t({type:"boolean",...T(e)})}function bd(t,e){return new t({type:"boolean",coerce:!0,...T(e)})}function $d(t,e){return new t({type:"bigint",...T(e)})}function xd(t,e){return new t({type:"bigint",coerce:!0,...T(e)})}function kd(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...T(e)})}function wd(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...T(e)})}function Sd(t,e){return new t({type:"symbol",...T(e)})}function Ed(t,e){return new t({type:"undefined",...T(e)})}function Id(t,e){return new t({type:"null",...T(e)})}function zd(t){return new t({type:"any"})}function Td(t){return new t({type:"unknown"})}function Od(t,e){return new t({type:"never",...T(e)})}function Pd(t,e){return new t({type:"void",...T(e)})}function Rd(t,e){return new t({type:"date",...T(e)})}function jd(t,e){return new t({type:"date",coerce:!0,...T(e)})}function Nd(t,e){return new t({type:"nan",...T(e)})}function ar(t,e){return new Cu({check:"less_than",...T(e),value:t,inclusive:!1})}function ht(t,e){return new Cu({check:"less_than",...T(e),value:t,inclusive:!0})}function cr(t,e){return new Au({check:"greater_than",...T(e),value:t,inclusive:!1})}function Ge(t,e){return new Au({check:"greater_than",...T(e),value:t,inclusive:!0})}function ha(t){return cr(0,t)}function ga(t){return ar(0,t)}function ya(t){return ht(0,t)}function va(t){return Ge(0,t)}function Ur(t,e){return new ig({check:"multiple_of",...T(e),value:t})}function Zr(t,e){return new cg({check:"max_size",...T(e),maximum:t})}function ur(t,e){return new ug({check:"min_size",...T(e),minimum:t})}function pn(t,e){return new lg({check:"size_equals",...T(e),size:t})}function fn(t,e){return new dg({check:"max_length",...T(e),maximum:t})}function $r(t,e){return new pg({check:"min_length",...T(e),minimum:t})}function mn(t,e){return new fg({check:"length_equals",...T(e),length:t})}function Gn(t,e){return new mg({check:"string_format",format:"regex",...T(e),pattern:t})}function Kn(t){return new hg({check:"string_format",format:"lowercase",...T(t)})}function Xn(t){return new gg({check:"string_format",format:"uppercase",...T(t)})}function Yn(t,e){return new yg({check:"string_format",format:"includes",...T(e),includes:t})}function Qn(t,e){return new vg({check:"string_format",format:"starts_with",...T(e),prefix:t})}function eo(t,e){return new _g({check:"string_format",format:"ends_with",...T(e),suffix:t})}function _a(t,e,r){return new bg({check:"property",property:t,schema:e,...T(r)})}function to(t,e){return new $g({check:"mime_type",mime:t,...T(e)})}function qt(t){return new xg({check:"overwrite",tx:t})}function ro(t){return qt(e=>e.normalize(t))}function no(){return qt(t=>t.trim())}function oo(){return qt(t=>t.toLowerCase())}function io(){return qt(t=>t.toUpperCase())}function gi(){return qt(t=>kh(t))}function jg(t,e,r){return new t({type:"array",element:e,...T(r)})}function jC(t,e,r){return new t({type:"union",options:e,...T(r)})}function NC(t,e,r){return new t({type:"union",options:e,inclusive:!1,...T(r)})}function CC(t,e,r,o){return new t({type:"union",options:r,discriminator:e,...T(o)})}function AC(t,e,r){return new t({type:"intersection",left:e,right:r})}function DC(t,e,r,o){let n=r instanceof W,i=n?o:r,s=n?r:null;return new t({type:"tuple",items:e,rest:s,...T(i)})}function MC(t,e,r,o){return new t({type:"record",keyType:e,valueType:r,...T(o)})}function UC(t,e,r,o){return new t({type:"map",keyType:e,valueType:r,...T(o)})}function ZC(t,e,r){return new t({type:"set",valueType:e,...T(r)})}function LC(t,e,r){let o=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new t({type:"enum",entries:o,...T(r)})}function FC(t,e,r){return new t({type:"enum",entries:e,...T(r)})}function qC(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...T(r)})}function Cd(t,e){return new t({type:"file",...T(e)})}function VC(t,e){return new t({type:"transform",transform:e})}function HC(t,e){return new t({type:"optional",innerType:e})}function JC(t,e){return new t({type:"nullable",innerType:e})}function BC(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():$u(r)}})}function WC(t,e,r){return new t({type:"nonoptional",innerType:e,...T(r)})}function GC(t,e){return new t({type:"success",innerType:e})}function KC(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function XC(t,e,r){return new t({type:"pipe",in:e,out:r})}function YC(t,e){return new t({type:"readonly",innerType:e})}function QC(t,e,r){return new t({type:"template_literal",parts:e,...T(r)})}function eA(t,e){return new t({type:"lazy",getter:e})}function tA(t,e){return new t({type:"promise",innerType:e})}function Ad(t,e,r){let o=T(r);return o.abort??(o.abort=!0),new t({type:"custom",check:"custom",fn:e,...o})}function Dd(t,e,r){return new t({type:"custom",check:"custom",fn:e,...T(r)})}function Md(t){let e=iE(r=>(r.addIssue=o=>{if(typeof o=="string")r.issues.push(ti(o,r.value,e._zod.def));else{let n=o;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=r.value),n.inst??(n.inst=e),n.continue??(n.continue=!e._zod.def.abort),r.issues.push(ti(n))}},t(r.value,r)));return e}function iE(t,e){let r=new ke({check:"custom",...T(e)});return r._zod.check=t,r}function Ud(t){let e=new ke({check:"describe"});return e._zod.onattach=[r=>{let o=Be.get(r)??{};Be.add(r,{...o,description:t})}],e._zod.check=()=>{},e}function Zd(t){let e=new ke({check:"meta"});return e._zod.onattach=[r=>{let o=Be.get(r)??{};Be.add(r,{...o,...t})}],e._zod.check=()=>{},e}function Ld(t,e){let r=T(e),o=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(o=o.map(f=>typeof f=="string"?f.toLowerCase():f),n=n.map(f=>typeof f=="string"?f.toLowerCase():f));let i=new Set(o),s=new Set(n),a=t.Codec??di,c=t.Boolean??ui,u=t.String??dn,l=new u({type:"string",error:r.error}),d=new c({type:"boolean",error:r.error}),p=new a({type:"pipe",in:l,out:d,transform:((f,m)=>{let y=f;return r.case!=="sensitive"&&(y=y.toLowerCase()),i.has(y)?!0:s.has(y)?!1:(m.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...s],input:m.value,inst:p,continue:!1}),{})}),reverseTransform:((f,m)=>f===!0?o[0]||"true":n[0]||"false"),error:r.error});return p}function so(t,e,r,o={}){let n=T(o),i={...T(o),check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:a=>r.test(a),...n};return r instanceof RegExp&&(i.pattern=r),new t(i)}var ad,sE=g(()=>{Du();Ws();Tg();q();ad={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function hn(t){let e=t?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??Be,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0}}function ye(t,e,r={path:[],schemaPath:[]}){var o;let n=t._zod.def,i=e.seen.get(t);if(i)return i.count++,r.schemaPath.includes(t)&&(i.cycle=r.path),i.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(t,s);let a=t._zod.toJSONSchema?.();if(a)s.schema=a;else{let l={...r,schemaPath:[...r.schemaPath,t],path:r.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,s.schema,l);else{let p=s.schema,f=e.processors[n.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);f(t,e,p,l)}let d=t._zod.parent;d&&(s.ref||(s.ref=d),ye(d,e,l),e.seen.get(d).isParent=!0)}let c=e.metadataRegistry.get(t);return c&&Object.assign(s.schema,c),e.io==="input"&>(t)&&(delete s.schema.examples,delete s.schema.default),e.io==="input"&&s.schema._prefault&&((o=s.schema).default??(o.default=s.schema._prefault)),delete s.schema._prefault,e.seen.get(t).schema}function gn(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let s of t.seen.entries()){let a=t.metadataRegistry.get(s[0])?.id;if(a){let c=o.get(a);if(c&&c!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(a,s[0])}}let n=s=>{let a=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let d=t.external.registry.get(s[0])?.id,p=t.external.uri??(m=>m);if(d)return{ref:p(d)};let f=s[1].defId??s[1].schema.id??`schema${t.counter++}`;return s[1].defId=f,{defId:f,ref:`${p("__shared")}#/${a}/${f}`}}if(s[1]===r)return{ref:"#"};let u=`#/${a}/`,l=s[1].schema.id??`__schema${t.counter++}`;return{defId:l,ref:u+l}},i=s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:c,defId:u}=n(s);a.def={...a.schema},u&&(a.defId=u);let l=a.schema;for(let d in l)delete l[d];l.$ref=c};if(t.cycles==="throw")for(let s of t.seen.entries()){let a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
250
|
+
|
|
251
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of t.seen.entries()){let a=s[1];if(e===s[0]){i(s);continue}if(t.external){let u=t.external.registry.get(s[0])?.id;if(e!==s[0]&&u){i(s);continue}}if(t.metadataRegistry.get(s[0])?.id){i(s);continue}if(a.cycle){i(s);continue}if(a.count>1&&t.reused==="ref"){i(s);continue}}}function yn(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=s=>{let a=t.seen.get(s);if(a.ref===null)return;let c=a.def??a.schema,u={...c},l=a.ref;if(a.ref=null,l){o(l);let p=t.seen.get(l),f=p.schema;if(f.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(f)):Object.assign(c,f),Object.assign(c,u),s._zod.parent===l)for(let y in c)y==="$ref"||y==="allOf"||y in u||delete c[y];if(f.$ref&&p.def)for(let y in c)y==="$ref"||y==="allOf"||y in p.def&&JSON.stringify(c[y])===JSON.stringify(p.def[y])&&delete c[y]}let d=s._zod.parent;if(d&&d!==l){o(d);let p=t.seen.get(d);if(p?.schema.$ref&&(c.$ref=p.schema.$ref,p.def))for(let f in c)f==="$ref"||f==="allOf"||f in p.def&&JSON.stringify(c[f])===JSON.stringify(p.def[f])&&delete c[f]}t.override({zodSchema:s,jsonSchema:c,path:a.path??[]})};for(let s of[...t.seen.entries()].reverse())o(s[0]);let n={};if(t.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let s=t.external.registry.get(e)?.id;if(!s)throw new Error("Schema is missing an `id` property");n.$id=t.external.uri(s)}Object.assign(n,r.def??r.schema);let i=t.external?.defs??{};for(let s of t.seen.entries()){let a=s[1];a.def&&a.defId&&(i[a.defId]=a.def)}t.external||Object.keys(i).length>0&&(t.target==="draft-2020-12"?n.$defs=i:n.definitions=i);try{let s=JSON.parse(JSON.stringify(n));return Object.defineProperty(s,"~standard",{value:{...e["~standard"],jsonSchema:{input:yi(e,"input",t.processors),output:yi(e,"output",t.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function gt(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let o=t._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return gt(o.element,r);if(o.type==="set")return gt(o.valueType,r);if(o.type==="lazy")return gt(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return gt(o.innerType,r);if(o.type==="intersection")return gt(o.left,r)||gt(o.right,r);if(o.type==="record"||o.type==="map")return gt(o.keyType,r)||gt(o.valueType,r);if(o.type==="pipe")return gt(o.in,r)||gt(o.out,r);if(o.type==="object"){for(let n in o.shape)if(gt(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(gt(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(gt(n,r))return!0;return!!(o.rest&>(o.rest,r))}return!1}var Ng,yi,ba=g(()=>{Ws();Ng=(t,e={})=>r=>{let o=hn({...r,processors:e});return ye(t,o),gn(o,t),yn(o,t)},yi=(t,e,r={})=>o=>{let{libraryOptions:n,target:i}=o??{},s=hn({...n??{},target:i,io:e,processors:r});return ye(t,s),gn(s,t),yn(s,t)}});function ao(t,e){if("_idmap"in t){let o=t,n=hn({...e,processors:Fd}),i={};for(let c of o._idmap.entries()){let[u,l]=c;ye(l,n)}let s={},a={registry:o,uri:e?.uri,defs:i};n.external=a;for(let c of o._idmap.entries()){let[u,l]=c;gn(n,l),s[u]=yn(n,l)}if(Object.keys(i).length>0){let c=n.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[c]:i}}return{schemas:s}}let r=hn({...e,processors:Fd});return ye(t,r),gn(r,t),yn(r,t)}var rA,Cg,Ag,Dg,Mg,Ug,Zg,Lg,Fg,qg,Vg,Hg,Jg,Bg,Wg,Gg,Kg,Xg,Yg,Qg,ey,ty,ry,ny,oy,iy,qd,sy,ay,cy,uy,ly,dy,py,fy,my,hy,gy,Vd,yy,Fd,vi=g(()=>{ba();q();rA={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Cg=(t,e,r,o)=>{let n=r;n.type="string";let{minimum:i,maximum:s,format:a,patterns:c,contentEncoding:u}=t._zod.bag;if(typeof i=="number"&&(n.minLength=i),typeof s=="number"&&(n.maxLength=s),a&&(n.format=rA[a]??a,n.format===""&&delete n.format,a==="time"&&delete n.format),u&&(n.contentEncoding=u),c&&c.size>0){let l=[...c];l.length===1?n.pattern=l[0].source:l.length>1&&(n.allOf=[...l.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},Ag=(t,e,r,o)=>{let n=r,{minimum:i,maximum:s,format:a,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:l}=t._zod.bag;typeof a=="string"&&a.includes("int")?n.type="integer":n.type="number",typeof l=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(n.minimum=l,n.exclusiveMinimum=!0):n.exclusiveMinimum=l),typeof i=="number"&&(n.minimum=i,typeof l=="number"&&e.target!=="draft-04"&&(l>=i?delete n.minimum:delete n.exclusiveMinimum)),typeof u=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(n.maximum=u,n.exclusiveMaximum=!0):n.exclusiveMaximum=u),typeof s=="number"&&(n.maximum=s,typeof u=="number"&&e.target!=="draft-04"&&(u<=s?delete n.maximum:delete n.exclusiveMaximum)),typeof c=="number"&&(n.multipleOf=c)},Dg=(t,e,r,o)=>{r.type="boolean"},Mg=(t,e,r,o)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Ug=(t,e,r,o)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Zg=(t,e,r,o)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},Lg=(t,e,r,o)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},Fg=(t,e,r,o)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},qg=(t,e,r,o)=>{r.not={}},Vg=(t,e,r,o)=>{},Hg=(t,e,r,o)=>{},Jg=(t,e,r,o)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Bg=(t,e,r,o)=>{let n=t._zod.def,i=js(n.entries);i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),r.enum=i},Wg=(t,e,r,o)=>{let n=t._zod.def,i=[];for(let s of n.values)if(s===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(s))}else i.push(s);if(i.length!==0)if(i.length===1){let s=i[0];r.type=s===null?"null":typeof s,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[s]:r.const=s}else i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),i.every(s=>typeof s=="boolean")&&(r.type="boolean"),i.every(s=>s===null)&&(r.type="null"),r.enum=i},Gg=(t,e,r,o)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Kg=(t,e,r,o)=>{let n=r,i=t._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=i.source},Xg=(t,e,r,o)=>{let n=r,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:a,mime:c}=t._zod.bag;s!==void 0&&(i.minLength=s),a!==void 0&&(i.maxLength=a),c?c.length===1?(i.contentMediaType=c[0],Object.assign(n,i)):(Object.assign(n,i),n.anyOf=c.map(u=>({contentMediaType:u}))):Object.assign(n,i)},Yg=(t,e,r,o)=>{r.type="boolean"},Qg=(t,e,r,o)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},ey=(t,e,r,o)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},ty=(t,e,r,o)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},ry=(t,e,r,o)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},ny=(t,e,r,o)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},oy=(t,e,r,o)=>{let n=r,i=t._zod.def,{minimum:s,maximum:a}=t._zod.bag;typeof s=="number"&&(n.minItems=s),typeof a=="number"&&(n.maxItems=a),n.type="array",n.items=ye(i.element,e,{...o,path:[...o.path,"items"]})},iy=(t,e,r,o)=>{let n=r,i=t._zod.def;n.type="object",n.properties={};let s=i.shape;for(let u in s)n.properties[u]=ye(s[u],e,{...o,path:[...o.path,"properties",u]});let a=new Set(Object.keys(s)),c=new Set([...a].filter(u=>{let l=i.shape[u]._zod;return e.io==="input"?l.optin===void 0:l.optout===void 0}));c.size>0&&(n.required=Array.from(c)),i.catchall?._zod.def.type==="never"?n.additionalProperties=!1:i.catchall?i.catchall&&(n.additionalProperties=ye(i.catchall,e,{...o,path:[...o.path,"additionalProperties"]})):e.io==="output"&&(n.additionalProperties=!1)},qd=(t,e,r,o)=>{let n=t._zod.def,i=n.inclusive===!1,s=n.options.map((a,c)=>ye(a,e,{...o,path:[...o.path,i?"oneOf":"anyOf",c]}));i?r.oneOf=s:r.anyOf=s},sy=(t,e,r,o)=>{let n=t._zod.def,i=ye(n.left,e,{...o,path:[...o.path,"allOf",0]}),s=ye(n.right,e,{...o,path:[...o.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];r.allOf=c},ay=(t,e,r,o)=>{let n=r,i=t._zod.def;n.type="array";let s=e.target==="draft-2020-12"?"prefixItems":"items",a=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",c=i.items.map((p,f)=>ye(p,e,{...o,path:[...o.path,s,f]})),u=i.rest?ye(i.rest,e,{...o,path:[...o.path,a,...e.target==="openapi-3.0"?[i.items.length]:[]]}):null;e.target==="draft-2020-12"?(n.prefixItems=c,u&&(n.items=u)):e.target==="openapi-3.0"?(n.items={anyOf:c},u&&n.items.anyOf.push(u),n.minItems=c.length,u||(n.maxItems=c.length)):(n.items=c,u&&(n.additionalItems=u));let{minimum:l,maximum:d}=t._zod.bag;typeof l=="number"&&(n.minItems=l),typeof d=="number"&&(n.maxItems=d)},cy=(t,e,r,o)=>{let n=r,i=t._zod.def;n.type="object";let s=i.keyType,c=s._zod.bag?.patterns;if(i.mode==="loose"&&c&&c.size>0){let l=ye(i.valueType,e,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let d of c)n.patternProperties[d.source]=l}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(n.propertyNames=ye(i.keyType,e,{...o,path:[...o.path,"propertyNames"]})),n.additionalProperties=ye(i.valueType,e,{...o,path:[...o.path,"additionalProperties"]});let u=s._zod.values;if(u){let l=[...u].filter(d=>typeof d=="string"||typeof d=="number");l.length>0&&(n.required=l)}},uy=(t,e,r,o)=>{let n=t._zod.def,i=ye(n.innerType,e,o),s=e.seen.get(t);e.target==="openapi-3.0"?(s.ref=n.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},ly=(t,e,r,o)=>{let n=t._zod.def;ye(n.innerType,e,o);let i=e.seen.get(t);i.ref=n.innerType},dy=(t,e,r,o)=>{let n=t._zod.def;ye(n.innerType,e,o);let i=e.seen.get(t);i.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},py=(t,e,r,o)=>{let n=t._zod.def;ye(n.innerType,e,o);let i=e.seen.get(t);i.ref=n.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},fy=(t,e,r,o)=>{let n=t._zod.def;ye(n.innerType,e,o);let i=e.seen.get(t);i.ref=n.innerType;let s;try{s=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s},my=(t,e,r,o)=>{let n=t._zod.def,i=e.io==="input"?n.in._zod.def.type==="transform"?n.out:n.in:n.out;ye(i,e,o);let s=e.seen.get(t);s.ref=i},hy=(t,e,r,o)=>{let n=t._zod.def;ye(n.innerType,e,o);let i=e.seen.get(t);i.ref=n.innerType,r.readOnly=!0},gy=(t,e,r,o)=>{let n=t._zod.def;ye(n.innerType,e,o);let i=e.seen.get(t);i.ref=n.innerType},Vd=(t,e,r,o)=>{let n=t._zod.def;ye(n.innerType,e,o);let i=e.seen.get(t);i.ref=n.innerType},yy=(t,e,r,o)=>{let n=t._zod.innerType;ye(n,e,o);let i=e.seen.get(t);i.ref=n},Fd={string:Cg,number:Ag,boolean:Dg,bigint:Mg,symbol:Ug,null:Zg,undefined:Lg,void:Fg,never:qg,any:Vg,unknown:Hg,date:Jg,enum:Bg,literal:Wg,nan:Gg,template_literal:Kg,file:Xg,success:Yg,custom:Qg,function:ey,transform:ty,map:ry,set:ny,array:oy,object:iy,union:qd,intersection:sy,tuple:ay,record:cy,nullable:uy,nonoptional:ly,default:dy,prefault:py,catch:fy,pipe:my,readonly:hy,promise:gy,optional:Vd,lazy:yy}});var Hd,aE=g(()=>{vi();ba();Hd=class{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(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let r=e?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=hn({processors:Fd,target:r,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,r={path:[],schemaPath:[]}){return ye(e,this.ctx,r)}emit(e,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),gn(this.ctx,e);let o=yn(this.ctx,e),{"~standard":n,...i}=o;return i}}});var cE={};var uE=g(()=>{});var Nt={};bt(Nt,{$ZodAny:()=>_l,$ZodArray:()=>wl,$ZodAsyncError:()=>sr,$ZodBase64:()=>ul,$ZodBase64URL:()=>ll,$ZodBigInt:()=>qs,$ZodBigIntFormat:()=>hl,$ZodBoolean:()=>ui,$ZodCIDRv4:()=>al,$ZodCIDRv6:()=>cl,$ZodCUID:()=>Gu,$ZodCUID2:()=>Ku,$ZodCatch:()=>Fl,$ZodCheck:()=>ke,$ZodCheckBigIntFormat:()=>ag,$ZodCheckEndsWith:()=>_g,$ZodCheckGreaterThan:()=>Au,$ZodCheckIncludes:()=>yg,$ZodCheckLengthEquals:()=>fg,$ZodCheckLessThan:()=>Cu,$ZodCheckLowerCase:()=>hg,$ZodCheckMaxLength:()=>dg,$ZodCheckMaxSize:()=>cg,$ZodCheckMimeType:()=>$g,$ZodCheckMinLength:()=>pg,$ZodCheckMinSize:()=>ug,$ZodCheckMultipleOf:()=>ig,$ZodCheckNumberFormat:()=>sg,$ZodCheckOverwrite:()=>xg,$ZodCheckProperty:()=>bg,$ZodCheckRegex:()=>mg,$ZodCheckSizeEquals:()=>lg,$ZodCheckStartsWith:()=>vg,$ZodCheckStringFormat:()=>ci,$ZodCheckUpperCase:()=>gg,$ZodCodec:()=>di,$ZodCustom:()=>Kl,$ZodCustomStringFormat:()=>fl,$ZodDate:()=>kl,$ZodDefault:()=>Ml,$ZodDiscriminatedUnion:()=>Il,$ZodE164:()=>dl,$ZodEmail:()=>Hu,$ZodEmoji:()=>Bu,$ZodEncodeError:()=>nn,$ZodEnum:()=>Rl,$ZodError:()=>Ms,$ZodExactOptional:()=>Al,$ZodFile:()=>Nl,$ZodFunction:()=>Bl,$ZodGUID:()=>qu,$ZodIPv4:()=>ol,$ZodIPv6:()=>il,$ZodISODate:()=>tl,$ZodISODateTime:()=>el,$ZodISODuration:()=>nl,$ZodISOTime:()=>rl,$ZodIntersection:()=>zl,$ZodJWT:()=>pl,$ZodKSUID:()=>Qu,$ZodLazy:()=>Gl,$ZodLiteral:()=>jl,$ZodMAC:()=>sl,$ZodMap:()=>Ol,$ZodNaN:()=>ql,$ZodNanoID:()=>Wu,$ZodNever:()=>$l,$ZodNonOptional:()=>Zl,$ZodNull:()=>vl,$ZodNullable:()=>Dl,$ZodNumber:()=>Fs,$ZodNumberFormat:()=>ml,$ZodObject:()=>Sl,$ZodObjectJIT:()=>zg,$ZodOptional:()=>Hs,$ZodPipe:()=>Vl,$ZodPrefault:()=>Ul,$ZodPromise:()=>Wl,$ZodReadonly:()=>Hl,$ZodRealError:()=>xt,$ZodRecord:()=>Tl,$ZodRegistry:()=>td,$ZodSet:()=>Pl,$ZodString:()=>dn,$ZodStringFormat:()=>ve,$ZodSuccess:()=>Ll,$ZodSymbol:()=>gl,$ZodTemplateLiteral:()=>Jl,$ZodTransform:()=>Cl,$ZodTuple:()=>Vs,$ZodType:()=>W,$ZodULID:()=>Xu,$ZodURL:()=>Ju,$ZodUUID:()=>Vu,$ZodUndefined:()=>yl,$ZodUnion:()=>li,$ZodUnknown:()=>bl,$ZodVoid:()=>xl,$ZodXID:()=>Yu,$ZodXor:()=>El,$brand:()=>Ps,$constructor:()=>h,$input:()=>nd,$output:()=>rd,Doc:()=>Ls,JSONSchema:()=>cE,JSONSchemaGenerator:()=>Hd,NEVER:()=>vu,TimePrecision:()=>ad,_any:()=>zd,_array:()=>jg,_base64:()=>da,_base64url:()=>pa,_bigint:()=>$d,_boolean:()=>_d,_catch:()=>KC,_check:()=>iE,_cidrv4:()=>ua,_cidrv6:()=>la,_coercedBigint:()=>xd,_coercedBoolean:()=>bd,_coercedDate:()=>jd,_coercedNumber:()=>fd,_coercedString:()=>id,_cuid:()=>ra,_cuid2:()=>na,_custom:()=>Ad,_date:()=>Rd,_decode:()=>Su,_decodeAsync:()=>Iu,_default:()=>BC,_discriminatedUnion:()=>CC,_e164:()=>fa,_email:()=>Gs,_emoji:()=>ea,_encode:()=>wu,_encodeAsync:()=>Eu,_endsWith:()=>eo,_enum:()=>LC,_file:()=>Cd,_float32:()=>hd,_float64:()=>gd,_gt:()=>cr,_gte:()=>Ge,_guid:()=>mi,_includes:()=>Yn,_int:()=>md,_int32:()=>yd,_int64:()=>kd,_intersection:()=>AC,_ipv4:()=>aa,_ipv6:()=>ca,_isoDate:()=>ud,_isoDateTime:()=>cd,_isoDuration:()=>dd,_isoTime:()=>ld,_jwt:()=>ma,_ksuid:()=>sa,_lazy:()=>eA,_length:()=>mn,_literal:()=>qC,_lowercase:()=>Kn,_lt:()=>ar,_lte:()=>ht,_mac:()=>sd,_map:()=>UC,_max:()=>ht,_maxLength:()=>fn,_maxSize:()=>Zr,_mime:()=>to,_min:()=>Ge,_minLength:()=>$r,_minSize:()=>ur,_multipleOf:()=>Ur,_nan:()=>Nd,_nanoid:()=>ta,_nativeEnum:()=>FC,_negative:()=>ga,_never:()=>Od,_nonnegative:()=>va,_nonoptional:()=>WC,_nonpositive:()=>ya,_normalize:()=>ro,_null:()=>Id,_nullable:()=>JC,_number:()=>pd,_optional:()=>HC,_overwrite:()=>qt,_parse:()=>oi,_parseAsync:()=>ii,_pipe:()=>XC,_positive:()=>ha,_promise:()=>tA,_property:()=>_a,_readonly:()=>YC,_record:()=>MC,_refine:()=>Dd,_regex:()=>Gn,_safeDecode:()=>Tu,_safeDecodeAsync:()=>Pu,_safeEncode:()=>zu,_safeEncodeAsync:()=>Ou,_safeParse:()=>si,_safeParseAsync:()=>ai,_set:()=>ZC,_size:()=>pn,_slugify:()=>gi,_startsWith:()=>Qn,_string:()=>od,_stringFormat:()=>so,_stringbool:()=>Ld,_success:()=>GC,_superRefine:()=>Md,_symbol:()=>Sd,_templateLiteral:()=>QC,_toLowerCase:()=>oo,_toUpperCase:()=>io,_transform:()=>VC,_trim:()=>no,_tuple:()=>DC,_uint32:()=>vd,_uint64:()=>wd,_ulid:()=>oa,_undefined:()=>Ed,_union:()=>jC,_unknown:()=>Td,_uppercase:()=>Xn,_url:()=>hi,_uuid:()=>Ks,_uuidv4:()=>Xs,_uuidv6:()=>Ys,_uuidv7:()=>Qs,_void:()=>Pd,_xid:()=>ia,_xor:()=>NC,clone:()=>Je,config:()=>Ae,createStandardJSONSchemaMethod:()=>yi,createToJSONSchemaMethod:()=>Ng,decode:()=>Fw,decodeAsync:()=>Vw,describe:()=>Ud,encode:()=>Lw,encodeAsync:()=>qw,extractDefs:()=>gn,finalize:()=>yn,flattenError:()=>ri,formatError:()=>ni,globalConfig:()=>Os,globalRegistry:()=>Be,initializeContext:()=>hn,isValidBase64:()=>Ig,isValidBase64URL:()=>pS,isValidJWT:()=>fS,locales:()=>fi,meta:()=>Zd,parse:()=>Jn,parseAsync:()=>Bn,prettifyError:()=>ku,process:()=>ye,regexes:()=>kt,registry:()=>Bs,safeDecode:()=>Jw,safeDecodeAsync:()=>Ww,safeEncode:()=>Hw,safeEncodeAsync:()=>Bw,safeParse:()=>un,safeParseAsync:()=>ln,toDotPath:()=>Zw,toJSONSchema:()=>ao,treeifyError:()=>xu,util:()=>E,version:()=>wg});var Me=g(()=>{Yo();Oh();Th();Tg();Du();Sg();q();Nu();ed();Ws();kg();sE();ba();vi();aE();uE()});var vy=g(()=>{Me()});function _y(t,e){let r={type:"object",shape:t??{},...T(e)};return new sA(r)}var iA,sA,Jd=g(()=>{Me();q();vy();iA=h("ZodMiniType",(t,e)=>{if(!t._zod)throw new Error("Uninitialized schema in ZodMiniType.");W.init(t,e),t.def=e,t.type=e.type,t.parse=(r,o)=>Jn(t,r,o,{callee:t.parse}),t.safeParse=(r,o)=>un(t,r,o),t.parseAsync=async(r,o)=>Bn(t,r,o,{callee:t.parseAsync}),t.safeParseAsync=async(r,o)=>ln(t,r,o),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]},{parent:!0}),t.with=t.check,t.clone=(r,o)=>Je(t,r,o),t.brand=()=>t,t.register=((r,o)=>(r.add(t,o),t)),t.apply=r=>r(t)}),sA=h("ZodMiniObject",(t,e)=>{Sl.init(t,e),iA.init(t,e),Q(t,"shape",()=>e.shape)})});var dE=g(()=>{Me()});var by=g(()=>{Me();Jd()});var pE=g(()=>{Me();Jd()});var $y=g(()=>{Me();vy();Jd();dE();Me();vi();ed();by();by();pE()});var xy=g(()=>{$y();$y()});function Vt(t){return!!t._zod}function co(t){let e=Object.values(t);if(e.length===0)return _y({});let r=e.every(Vt),o=e.every(n=>!Vt(n));if(r)return _y(t);if(o)return zw(t);throw new Error("Mixed Zod versions detected in object shape.")}function vn(t,e){return Vt(t)?un(t,e):t.safeParse(e)}async function Bd(t,e){return Vt(t)?await ln(t,e):await t.safeParseAsync(e)}function _n(t){if(!t)return;let e;if(Vt(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function _i(t){if(t){if(typeof t=="object"){let e=t,r=t;if(!e._def&&!r._zod){let o=Object.values(t);if(o.length>0&&o.every(n=>typeof n=="object"&&n!==null&&(n._def!==void 0||n._zod!==void 0||typeof n.parse=="function")))return co(t)}}if(Vt(t)){let r=t._zod?.def;if(r&&(r.type==="object"||r.shape!==void 0))return t}else if(t.shape!==void 0)return t}}function Wd(t){if(t&&typeof t=="object"){if("message"in t&&typeof t.message=="string")return t.message;if("issues"in t&&Array.isArray(t.issues)&&t.issues.length>0){let e=t.issues[0];if(e&&typeof e=="object"&&"message"in e)return String(e.message)}try{return JSON.stringify(t)}catch{return String(t)}}return String(t)}function mE(t){return t.description}function hE(t){if(Vt(t))return t._zod?.def?.type==="optional";let e=t;return typeof t.isOptional=="function"?t.isOptional():e._def?.typeName==="ZodOptional"}function Gd(t){if(Vt(t)){let i=t._zod?.def;if(i){if(i.value!==void 0)return i.value;if(Array.isArray(i.values)&&i.values.length>0)return i.values[0]}}let r=t._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let o=t.value;if(o!==void 0)return o}var $a=g(()=>{Ts();xy()});var Kd={};bt(Kd,{endsWith:()=>eo,gt:()=>cr,gte:()=>Ge,includes:()=>Yn,length:()=>mn,lowercase:()=>Kn,lt:()=>ar,lte:()=>ht,maxLength:()=>fn,maxSize:()=>Zr,mime:()=>to,minLength:()=>$r,minSize:()=>ur,multipleOf:()=>Ur,negative:()=>ga,nonnegative:()=>va,nonpositive:()=>ya,normalize:()=>ro,overwrite:()=>qt,positive:()=>ha,property:()=>_a,regex:()=>Gn,size:()=>pn,slugify:()=>gi,startsWith:()=>Qn,toLowerCase:()=>oo,toUpperCase:()=>io,trim:()=>no,uppercase:()=>Xn});var Xd=g(()=>{Me()});var bn={};bt(bn,{ZodISODate:()=>Qd,ZodISODateTime:()=>Yd,ZodISODuration:()=>tp,ZodISOTime:()=>ep,date:()=>wy,datetime:()=>ky,duration:()=>Ey,time:()=>Sy});function ky(t){return cd(Yd,t)}function wy(t){return ud(Qd,t)}function Sy(t){return ld(ep,t)}function Ey(t){return dd(tp,t)}var Yd,Qd,ep,tp,xa=g(()=>{Me();wa();Yd=h("ZodISODateTime",(t,e)=>{el.init(t,e),we.init(t,e)});Qd=h("ZodISODate",(t,e)=>{tl.init(t,e),we.init(t,e)});ep=h("ZodISOTime",(t,e)=>{rl.init(t,e),we.init(t,e)});tp=h("ZodISODuration",(t,e)=>{nl.init(t,e),we.init(t,e)})});var gE,lA,wt,Iy=g(()=>{Me();Me();q();gE=(t,e)=>{Ms.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>ni(t,r)},flatten:{value:r=>ri(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,Qo,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,Qo,2)}},isEmpty:{get(){return t.issues.length===0}}})},lA=h("ZodError",gE),wt=h("ZodError",gE,{Parent:Error})});var zy,Ty,Oy,Py,Ry,jy,Ny,Cy,Ay,Dy,My,Uy,Zy=g(()=>{Me();Iy();zy=oi(wt),Ty=ii(wt),Oy=si(wt),Py=ai(wt),Ry=wu(wt),jy=Su(wt),Ny=Eu(wt),Cy=Iu(wt),Ay=zu(wt),Dy=Tu(wt),My=Ou(wt),Uy=Pu(wt)});var ka={};bt(ka,{ZodAny:()=>Hy,ZodArray:()=>Gy,ZodBase64:()=>gp,ZodBase64URL:()=>yp,ZodBigInt:()=>Si,ZodBigIntFormat:()=>bp,ZodBoolean:()=>wi,ZodCIDRv4:()=>mp,ZodCIDRv6:()=>hp,ZodCUID:()=>ap,ZodCUID2:()=>cp,ZodCatch:()=>hv,ZodCodec:()=>Sp,ZodCustom:()=>Ca,ZodCustomStringFormat:()=>xi,ZodDate:()=>Oa,ZodDefault:()=>uv,ZodDiscriminatedUnion:()=>Xy,ZodE164:()=>vp,ZodEmail:()=>op,ZodEmoji:()=>ip,ZodEnum:()=>bi,ZodExactOptional:()=>sv,ZodFile:()=>ov,ZodFunction:()=>wv,ZodGUID:()=>Sa,ZodIPv4:()=>pp,ZodIPv6:()=>fp,ZodIntersection:()=>Yy,ZodJWT:()=>_p,ZodKSUID:()=>dp,ZodLazy:()=>$v,ZodLiteral:()=>nv,ZodMAC:()=>Ly,ZodMap:()=>tv,ZodNaN:()=>yv,ZodNanoID:()=>sp,ZodNever:()=>By,ZodNonOptional:()=>kp,ZodNull:()=>Vy,ZodNullable:()=>cv,ZodNumber:()=>ki,ZodNumberFormat:()=>uo,ZodObject:()=>Pa,ZodOptional:()=>Ii,ZodPipe:()=>wp,ZodPrefault:()=>dv,ZodPromise:()=>kv,ZodReadonly:()=>vv,ZodRecord:()=>Na,ZodSet:()=>rv,ZodString:()=>$i,ZodStringFormat:()=>we,ZodSuccess:()=>mv,ZodSymbol:()=>Fy,ZodTemplateLiteral:()=>bv,ZodTransform:()=>iv,ZodTuple:()=>Qy,ZodType:()=>ee,ZodULID:()=>up,ZodURL:()=>za,ZodUUID:()=>xr,ZodUndefined:()=>qy,ZodUnion:()=>Ra,ZodUnknown:()=>Jy,ZodVoid:()=>Wy,ZodXID:()=>lp,ZodXor:()=>Ky,_ZodString:()=>np,_default:()=>lv,_function:()=>vI,any:()=>eI,array:()=>ie,base64:()=>DE,base64url:()=>ME,bigint:()=>GE,boolean:()=>Ue,catch:()=>gv,check:()=>_I,cidrv4:()=>CE,cidrv6:()=>AE,codec:()=>hI,cuid:()=>IE,cuid2:()=>zE,custom:()=>Ep,date:()=>rI,describe:()=>bI,discriminatedUnion:()=>ja,e164:()=>UE,email:()=>yE,emoji:()=>SE,enum:()=>Xe,exactOptional:()=>av,file:()=>dI,float32:()=>HE,float64:()=>JE,function:()=>vI,guid:()=>vE,hash:()=>VE,hex:()=>qE,hostname:()=>FE,httpUrl:()=>wE,instanceof:()=>xI,int:()=>rp,int32:()=>BE,int64:()=>KE,intersection:()=>Ei,ipv4:()=>RE,ipv6:()=>NE,json:()=>wI,jwt:()=>ZE,keyof:()=>nI,ksuid:()=>PE,lazy:()=>xv,literal:()=>L,looseObject:()=>Ke,looseRecord:()=>aI,mac:()=>jE,map:()=>cI,meta:()=>$I,nan:()=>mI,nanoid:()=>EE,nativeEnum:()=>lI,never:()=>$p,nonoptional:()=>fv,null:()=>Ta,nullable:()=>Ea,nullish:()=>pI,number:()=>me,object:()=>A,optional:()=>ze,partialRecord:()=>sI,pipe:()=>Ia,prefault:()=>pv,preprocess:()=>Aa,promise:()=>yI,readonly:()=>_v,record:()=>_e,refine:()=>Sv,set:()=>uI,strictObject:()=>oI,string:()=>$,stringFormat:()=>LE,stringbool:()=>kI,success:()=>fI,superRefine:()=>Ev,symbol:()=>YE,templateLiteral:()=>gI,transform:()=>xp,tuple:()=>ev,uint32:()=>WE,uint64:()=>XE,ulid:()=>TE,undefined:()=>QE,union:()=>Ee,unknown:()=>Se,url:()=>kE,uuid:()=>_E,uuidv4:()=>bE,uuidv6:()=>$E,uuidv7:()=>xE,void:()=>tI,xid:()=>OE,xor:()=>iI});function $(t){return od($i,t)}function yE(t){return Gs(op,t)}function vE(t){return mi(Sa,t)}function _E(t){return Ks(xr,t)}function bE(t){return Xs(xr,t)}function $E(t){return Ys(xr,t)}function xE(t){return Qs(xr,t)}function kE(t){return hi(za,t)}function wE(t){return hi(za,{protocol:/^https?$/,hostname:kt.domain,...E.normalizeParams(t)})}function SE(t){return ea(ip,t)}function EE(t){return ta(sp,t)}function IE(t){return ra(ap,t)}function zE(t){return na(cp,t)}function TE(t){return oa(up,t)}function OE(t){return ia(lp,t)}function PE(t){return sa(dp,t)}function RE(t){return aa(pp,t)}function jE(t){return sd(Ly,t)}function NE(t){return ca(fp,t)}function CE(t){return ua(mp,t)}function AE(t){return la(hp,t)}function DE(t){return da(gp,t)}function ME(t){return pa(yp,t)}function UE(t){return fa(vp,t)}function ZE(t){return ma(_p,t)}function LE(t,e,r={}){return so(xi,t,e,r)}function FE(t){return so(xi,"hostname",kt.hostname,t)}function qE(t){return so(xi,"hex",kt.hex,t)}function VE(t,e){let r=e?.enc??"hex",o=`${t}_${r}`,n=kt[o];if(!n)throw new Error(`Unrecognized hash format: ${o}`);return so(xi,o,n,e)}function me(t){return pd(ki,t)}function rp(t){return md(uo,t)}function HE(t){return hd(uo,t)}function JE(t){return gd(uo,t)}function BE(t){return yd(uo,t)}function WE(t){return vd(uo,t)}function Ue(t){return _d(wi,t)}function GE(t){return $d(Si,t)}function KE(t){return kd(bp,t)}function XE(t){return wd(bp,t)}function YE(t){return Sd(Fy,t)}function QE(t){return Ed(qy,t)}function Ta(t){return Id(Vy,t)}function eI(){return zd(Hy)}function Se(){return Td(Jy)}function $p(t){return Od(By,t)}function tI(t){return Pd(Wy,t)}function rI(t){return Rd(Oa,t)}function ie(t,e){return jg(Gy,t,e)}function nI(t){let e=t._zod.def.shape;return Xe(Object.keys(e))}function A(t,e){let r={type:"object",shape:t??{},...E.normalizeParams(e)};return new Pa(r)}function oI(t,e){return new Pa({type:"object",shape:t,catchall:$p(),...E.normalizeParams(e)})}function Ke(t,e){return new Pa({type:"object",shape:t,catchall:Se(),...E.normalizeParams(e)})}function Ee(t,e){return new Ra({type:"union",options:t,...E.normalizeParams(e)})}function iI(t,e){return new Ky({type:"union",options:t,inclusive:!1,...E.normalizeParams(e)})}function ja(t,e,r){return new Xy({type:"union",options:e,discriminator:t,...E.normalizeParams(r)})}function Ei(t,e){return new Yy({type:"intersection",left:t,right:e})}function ev(t,e,r){let o=e instanceof W,n=o?r:e,i=o?e:null;return new Qy({type:"tuple",items:t,rest:i,...E.normalizeParams(n)})}function _e(t,e,r){return new Na({type:"record",keyType:t,valueType:e,...E.normalizeParams(r)})}function sI(t,e,r){let o=Je(t);return o._zod.values=void 0,new Na({type:"record",keyType:o,valueType:e,...E.normalizeParams(r)})}function aI(t,e,r){return new Na({type:"record",keyType:t,valueType:e,mode:"loose",...E.normalizeParams(r)})}function cI(t,e,r){return new tv({type:"map",keyType:t,valueType:e,...E.normalizeParams(r)})}function uI(t,e){return new rv({type:"set",valueType:t,...E.normalizeParams(e)})}function Xe(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(o=>[o,o])):t;return new bi({type:"enum",entries:r,...E.normalizeParams(e)})}function lI(t,e){return new bi({type:"enum",entries:t,...E.normalizeParams(e)})}function L(t,e){return new nv({type:"literal",values:Array.isArray(t)?t:[t],...E.normalizeParams(e)})}function dI(t){return Cd(ov,t)}function xp(t){return new iv({type:"transform",transform:t})}function ze(t){return new Ii({type:"optional",innerType:t})}function av(t){return new sv({type:"optional",innerType:t})}function Ea(t){return new cv({type:"nullable",innerType:t})}function pI(t){return ze(Ea(t))}function lv(t,e){return new uv({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():E.shallowClone(e)}})}function pv(t,e){return new dv({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():E.shallowClone(e)}})}function fv(t,e){return new kp({type:"nonoptional",innerType:t,...E.normalizeParams(e)})}function fI(t){return new mv({type:"success",innerType:t})}function gv(t,e){return new hv({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}function mI(t){return Nd(yv,t)}function Ia(t,e){return new wp({type:"pipe",in:t,out:e})}function hI(t,e,r){return new Sp({type:"pipe",in:t,out:e,transform:r.decode,reverseTransform:r.encode})}function _v(t){return new vv({type:"readonly",innerType:t})}function gI(t,e){return new bv({type:"template_literal",parts:t,...E.normalizeParams(e)})}function xv(t){return new $v({type:"lazy",getter:t})}function yI(t){return new kv({type:"promise",innerType:t})}function vI(t){return new wv({type:"function",input:Array.isArray(t?.input)?ev(t?.input):t?.input??ie(Se()),output:t?.output??Se()})}function _I(t){let e=new ke({check:"custom"});return e._zod.check=t,e}function Ep(t,e){return Ad(Ca,t??(()=>!0),e)}function Sv(t,e={}){return Dd(Ca,t,e)}function Ev(t){return Md(t)}function xI(t,e={}){let r=new Ca({type:"custom",check:"custom",fn:o=>o instanceof t,abort:!0,...E.normalizeParams(e)});return r._zod.bag.Class=t,r._zod.check=o=>{o.value instanceof t||o.issues.push({code:"invalid_type",expected:t.name,input:o.value,inst:r,path:[...r._zod.def.path??[]]})},r}function wI(t){let e=xv(()=>Ee([$(t),me(),Ue(),Ta(),ie(e),_e($(),e)]));return e}function Aa(t,e){return Ia(xp(t),e)}var ee,np,$i,we,op,Sa,xr,za,ip,sp,ap,cp,up,lp,dp,pp,Ly,fp,mp,hp,gp,yp,vp,_p,xi,ki,uo,wi,Si,bp,Fy,qy,Vy,Hy,Jy,By,Wy,Oa,Gy,Pa,Ra,Ky,Xy,Yy,Qy,Na,tv,rv,bi,nv,ov,iv,Ii,sv,cv,uv,dv,kp,mv,hv,yv,wp,Sp,vv,bv,$v,kv,wv,Ca,bI,$I,kI,wa=g(()=>{Me();Me();vi();ba();Xd();xa();Zy();ee=h("ZodType",(t,e)=>(W.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:yi(t,"input"),output:yi(t,"output")}}),t.toJSONSchema=Ng(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.check=(...r)=>t.clone(E.mergeDefs(e,{checks:[...e.checks??[],...r.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0}),t.with=t.check,t.clone=(r,o)=>Je(t,r,o),t.brand=()=>t,t.register=((r,o)=>(r.add(t,o),t)),t.parse=(r,o)=>zy(t,r,o,{callee:t.parse}),t.safeParse=(r,o)=>Oy(t,r,o),t.parseAsync=async(r,o)=>Ty(t,r,o,{callee:t.parseAsync}),t.safeParseAsync=async(r,o)=>Py(t,r,o),t.spa=t.safeParseAsync,t.encode=(r,o)=>Ry(t,r,o),t.decode=(r,o)=>jy(t,r,o),t.encodeAsync=async(r,o)=>Ny(t,r,o),t.decodeAsync=async(r,o)=>Cy(t,r,o),t.safeEncode=(r,o)=>Ay(t,r,o),t.safeDecode=(r,o)=>Dy(t,r,o),t.safeEncodeAsync=async(r,o)=>My(t,r,o),t.safeDecodeAsync=async(r,o)=>Uy(t,r,o),t.refine=(r,o)=>t.check(Sv(r,o)),t.superRefine=r=>t.check(Ev(r)),t.overwrite=r=>t.check(qt(r)),t.optional=()=>ze(t),t.exactOptional=()=>av(t),t.nullable=()=>Ea(t),t.nullish=()=>ze(Ea(t)),t.nonoptional=r=>fv(t,r),t.array=()=>ie(t),t.or=r=>Ee([t,r]),t.and=r=>Ei(t,r),t.transform=r=>Ia(t,xp(r)),t.default=r=>lv(t,r),t.prefault=r=>pv(t,r),t.catch=r=>gv(t,r),t.pipe=r=>Ia(t,r),t.readonly=()=>_v(t),t.describe=r=>{let o=t.clone();return Be.add(o,{description:r}),o},Object.defineProperty(t,"description",{get(){return Be.get(t)?.description},configurable:!0}),t.meta=(...r)=>{if(r.length===0)return Be.get(t);let o=t.clone();return Be.add(o,r[0]),o},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t.apply=r=>r(t),t)),np=h("_ZodString",(t,e)=>{dn.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(o,n,i)=>Cg(t,o,n,i);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,t.regex=(...o)=>t.check(Gn(...o)),t.includes=(...o)=>t.check(Yn(...o)),t.startsWith=(...o)=>t.check(Qn(...o)),t.endsWith=(...o)=>t.check(eo(...o)),t.min=(...o)=>t.check($r(...o)),t.max=(...o)=>t.check(fn(...o)),t.length=(...o)=>t.check(mn(...o)),t.nonempty=(...o)=>t.check($r(1,...o)),t.lowercase=o=>t.check(Kn(o)),t.uppercase=o=>t.check(Xn(o)),t.trim=()=>t.check(no()),t.normalize=(...o)=>t.check(ro(...o)),t.toLowerCase=()=>t.check(oo()),t.toUpperCase=()=>t.check(io()),t.slugify=()=>t.check(gi())}),$i=h("ZodString",(t,e)=>{dn.init(t,e),np.init(t,e),t.email=r=>t.check(Gs(op,r)),t.url=r=>t.check(hi(za,r)),t.jwt=r=>t.check(ma(_p,r)),t.emoji=r=>t.check(ea(ip,r)),t.guid=r=>t.check(mi(Sa,r)),t.uuid=r=>t.check(Ks(xr,r)),t.uuidv4=r=>t.check(Xs(xr,r)),t.uuidv6=r=>t.check(Ys(xr,r)),t.uuidv7=r=>t.check(Qs(xr,r)),t.nanoid=r=>t.check(ta(sp,r)),t.guid=r=>t.check(mi(Sa,r)),t.cuid=r=>t.check(ra(ap,r)),t.cuid2=r=>t.check(na(cp,r)),t.ulid=r=>t.check(oa(up,r)),t.base64=r=>t.check(da(gp,r)),t.base64url=r=>t.check(pa(yp,r)),t.xid=r=>t.check(ia(lp,r)),t.ksuid=r=>t.check(sa(dp,r)),t.ipv4=r=>t.check(aa(pp,r)),t.ipv6=r=>t.check(ca(fp,r)),t.cidrv4=r=>t.check(ua(mp,r)),t.cidrv6=r=>t.check(la(hp,r)),t.e164=r=>t.check(fa(vp,r)),t.datetime=r=>t.check(ky(r)),t.date=r=>t.check(wy(r)),t.time=r=>t.check(Sy(r)),t.duration=r=>t.check(Ey(r))});we=h("ZodStringFormat",(t,e)=>{ve.init(t,e),np.init(t,e)}),op=h("ZodEmail",(t,e)=>{Hu.init(t,e),we.init(t,e)});Sa=h("ZodGUID",(t,e)=>{qu.init(t,e),we.init(t,e)});xr=h("ZodUUID",(t,e)=>{Vu.init(t,e),we.init(t,e)});za=h("ZodURL",(t,e)=>{Ju.init(t,e),we.init(t,e)});ip=h("ZodEmoji",(t,e)=>{Bu.init(t,e),we.init(t,e)});sp=h("ZodNanoID",(t,e)=>{Wu.init(t,e),we.init(t,e)});ap=h("ZodCUID",(t,e)=>{Gu.init(t,e),we.init(t,e)});cp=h("ZodCUID2",(t,e)=>{Ku.init(t,e),we.init(t,e)});up=h("ZodULID",(t,e)=>{Xu.init(t,e),we.init(t,e)});lp=h("ZodXID",(t,e)=>{Yu.init(t,e),we.init(t,e)});dp=h("ZodKSUID",(t,e)=>{Qu.init(t,e),we.init(t,e)});pp=h("ZodIPv4",(t,e)=>{ol.init(t,e),we.init(t,e)});Ly=h("ZodMAC",(t,e)=>{sl.init(t,e),we.init(t,e)});fp=h("ZodIPv6",(t,e)=>{il.init(t,e),we.init(t,e)});mp=h("ZodCIDRv4",(t,e)=>{al.init(t,e),we.init(t,e)});hp=h("ZodCIDRv6",(t,e)=>{cl.init(t,e),we.init(t,e)});gp=h("ZodBase64",(t,e)=>{ul.init(t,e),we.init(t,e)});yp=h("ZodBase64URL",(t,e)=>{ll.init(t,e),we.init(t,e)});vp=h("ZodE164",(t,e)=>{dl.init(t,e),we.init(t,e)});_p=h("ZodJWT",(t,e)=>{pl.init(t,e),we.init(t,e)});xi=h("ZodCustomStringFormat",(t,e)=>{fl.init(t,e),we.init(t,e)});ki=h("ZodNumber",(t,e)=>{Fs.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(o,n,i)=>Ag(t,o,n,i),t.gt=(o,n)=>t.check(cr(o,n)),t.gte=(o,n)=>t.check(Ge(o,n)),t.min=(o,n)=>t.check(Ge(o,n)),t.lt=(o,n)=>t.check(ar(o,n)),t.lte=(o,n)=>t.check(ht(o,n)),t.max=(o,n)=>t.check(ht(o,n)),t.int=o=>t.check(rp(o)),t.safe=o=>t.check(rp(o)),t.positive=o=>t.check(cr(0,o)),t.nonnegative=o=>t.check(Ge(0,o)),t.negative=o=>t.check(ar(0,o)),t.nonpositive=o=>t.check(ht(0,o)),t.multipleOf=(o,n)=>t.check(Ur(o,n)),t.step=(o,n)=>t.check(Ur(o,n)),t.finite=()=>t;let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});uo=h("ZodNumberFormat",(t,e)=>{ml.init(t,e),ki.init(t,e)});wi=h("ZodBoolean",(t,e)=>{ui.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(r,o,n)=>Dg(t,r,o,n)});Si=h("ZodBigInt",(t,e)=>{qs.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(o,n,i)=>Mg(t,o,n,i),t.gte=(o,n)=>t.check(Ge(o,n)),t.min=(o,n)=>t.check(Ge(o,n)),t.gt=(o,n)=>t.check(cr(o,n)),t.gte=(o,n)=>t.check(Ge(o,n)),t.min=(o,n)=>t.check(Ge(o,n)),t.lt=(o,n)=>t.check(ar(o,n)),t.lte=(o,n)=>t.check(ht(o,n)),t.max=(o,n)=>t.check(ht(o,n)),t.positive=o=>t.check(cr(BigInt(0),o)),t.negative=o=>t.check(ar(BigInt(0),o)),t.nonpositive=o=>t.check(ht(BigInt(0),o)),t.nonnegative=o=>t.check(Ge(BigInt(0),o)),t.multipleOf=(o,n)=>t.check(Ur(o,n));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});bp=h("ZodBigIntFormat",(t,e)=>{hl.init(t,e),Si.init(t,e)});Fy=h("ZodSymbol",(t,e)=>{gl.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(r,o,n)=>Ug(t,r,o,n)});qy=h("ZodUndefined",(t,e)=>{yl.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(r,o,n)=>Lg(t,r,o,n)});Vy=h("ZodNull",(t,e)=>{vl.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(r,o,n)=>Zg(t,r,o,n)});Hy=h("ZodAny",(t,e)=>{_l.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(r,o,n)=>Vg(t,r,o,n)});Jy=h("ZodUnknown",(t,e)=>{bl.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(r,o,n)=>Hg(t,r,o,n)});By=h("ZodNever",(t,e)=>{$l.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(r,o,n)=>qg(t,r,o,n)});Wy=h("ZodVoid",(t,e)=>{xl.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(r,o,n)=>Fg(t,r,o,n)});Oa=h("ZodDate",(t,e)=>{kl.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(o,n,i)=>Jg(t,o,n,i),t.min=(o,n)=>t.check(Ge(o,n)),t.max=(o,n)=>t.check(ht(o,n));let r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null});Gy=h("ZodArray",(t,e)=>{wl.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(r,o,n)=>oy(t,r,o,n),t.element=e.element,t.min=(r,o)=>t.check($r(r,o)),t.nonempty=r=>t.check($r(1,r)),t.max=(r,o)=>t.check(fn(r,o)),t.length=(r,o)=>t.check(mn(r,o)),t.unwrap=()=>t.element});Pa=h("ZodObject",(t,e)=>{zg.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(r,o,n)=>iy(t,r,o,n),E.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>Xe(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone({...t._zod.def,catchall:r}),t.passthrough=()=>t.clone({...t._zod.def,catchall:Se()}),t.loose=()=>t.clone({...t._zod.def,catchall:Se()}),t.strict=()=>t.clone({...t._zod.def,catchall:$p()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=r=>E.extend(t,r),t.safeExtend=r=>E.safeExtend(t,r),t.merge=r=>E.merge(t,r),t.pick=r=>E.pick(t,r),t.omit=r=>E.omit(t,r),t.partial=(...r)=>E.partial(Ii,t,r[0]),t.required=(...r)=>E.required(kp,t,r[0])});Ra=h("ZodUnion",(t,e)=>{li.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(r,o,n)=>qd(t,r,o,n),t.options=e.options});Ky=h("ZodXor",(t,e)=>{Ra.init(t,e),El.init(t,e),t._zod.processJSONSchema=(r,o,n)=>qd(t,r,o,n),t.options=e.options});Xy=h("ZodDiscriminatedUnion",(t,e)=>{Ra.init(t,e),Il.init(t,e)});Yy=h("ZodIntersection",(t,e)=>{zl.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(r,o,n)=>sy(t,r,o,n)});Qy=h("ZodTuple",(t,e)=>{Vs.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(r,o,n)=>ay(t,r,o,n),t.rest=r=>t.clone({...t._zod.def,rest:r})});Na=h("ZodRecord",(t,e)=>{Tl.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(r,o,n)=>cy(t,r,o,n),t.keyType=e.keyType,t.valueType=e.valueType});tv=h("ZodMap",(t,e)=>{Ol.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(r,o,n)=>ry(t,r,o,n),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...r)=>t.check(ur(...r)),t.nonempty=r=>t.check(ur(1,r)),t.max=(...r)=>t.check(Zr(...r)),t.size=(...r)=>t.check(pn(...r))});rv=h("ZodSet",(t,e)=>{Pl.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(r,o,n)=>ny(t,r,o,n),t.min=(...r)=>t.check(ur(...r)),t.nonempty=r=>t.check(ur(1,r)),t.max=(...r)=>t.check(Zr(...r)),t.size=(...r)=>t.check(pn(...r))});bi=h("ZodEnum",(t,e)=>{Rl.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(o,n,i)=>Bg(t,o,n,i),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(o,n)=>{let i={};for(let s of o)if(r.has(s))i[s]=e.entries[s];else throw new Error(`Key ${s} not found in enum`);return new bi({...e,checks:[],...E.normalizeParams(n),entries:i})},t.exclude=(o,n)=>{let i={...e.entries};for(let s of o)if(r.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new bi({...e,checks:[],...E.normalizeParams(n),entries:i})}});nv=h("ZodLiteral",(t,e)=>{jl.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(r,o,n)=>Wg(t,r,o,n),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});ov=h("ZodFile",(t,e)=>{Nl.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(r,o,n)=>Xg(t,r,o,n),t.min=(r,o)=>t.check(ur(r,o)),t.max=(r,o)=>t.check(Zr(r,o)),t.mime=(r,o)=>t.check(to(Array.isArray(r)?r:[r],o))});iv=h("ZodTransform",(t,e)=>{Cl.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(r,o,n)=>ty(t,r,o,n),t._zod.parse=(r,o)=>{if(o.direction==="backward")throw new nn(t.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(E.issue(i,r.value,e));else{let s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=t),r.issues.push(E.issue(s))}};let n=e.transform(r.value,r);return n instanceof Promise?n.then(i=>(r.value=i,r)):(r.value=n,r)}});Ii=h("ZodOptional",(t,e)=>{Hs.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(r,o,n)=>Vd(t,r,o,n),t.unwrap=()=>t._zod.def.innerType});sv=h("ZodExactOptional",(t,e)=>{Al.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(r,o,n)=>Vd(t,r,o,n),t.unwrap=()=>t._zod.def.innerType});cv=h("ZodNullable",(t,e)=>{Dl.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(r,o,n)=>uy(t,r,o,n),t.unwrap=()=>t._zod.def.innerType});uv=h("ZodDefault",(t,e)=>{Ml.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(r,o,n)=>dy(t,r,o,n),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});dv=h("ZodPrefault",(t,e)=>{Ul.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(r,o,n)=>py(t,r,o,n),t.unwrap=()=>t._zod.def.innerType});kp=h("ZodNonOptional",(t,e)=>{Zl.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(r,o,n)=>ly(t,r,o,n),t.unwrap=()=>t._zod.def.innerType});mv=h("ZodSuccess",(t,e)=>{Ll.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(r,o,n)=>Yg(t,r,o,n),t.unwrap=()=>t._zod.def.innerType});hv=h("ZodCatch",(t,e)=>{Fl.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(r,o,n)=>fy(t,r,o,n),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});yv=h("ZodNaN",(t,e)=>{ql.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(r,o,n)=>Gg(t,r,o,n)});wp=h("ZodPipe",(t,e)=>{Vl.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(r,o,n)=>my(t,r,o,n),t.in=e.in,t.out=e.out});Sp=h("ZodCodec",(t,e)=>{wp.init(t,e),di.init(t,e)});vv=h("ZodReadonly",(t,e)=>{Hl.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(r,o,n)=>hy(t,r,o,n),t.unwrap=()=>t._zod.def.innerType});bv=h("ZodTemplateLiteral",(t,e)=>{Jl.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(r,o,n)=>Kg(t,r,o,n)});$v=h("ZodLazy",(t,e)=>{Gl.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(r,o,n)=>yy(t,r,o,n),t.unwrap=()=>t._zod.def.getter()});kv=h("ZodPromise",(t,e)=>{Wl.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(r,o,n)=>gy(t,r,o,n),t.unwrap=()=>t._zod.def.innerType});wv=h("ZodFunction",(t,e)=>{Bl.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(r,o,n)=>ey(t,r,o,n)});Ca=h("ZodCustom",(t,e)=>{Kl.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(r,o,n)=>Qg(t,r,o,n)});bI=Ud,$I=Zd;kI=(...t)=>Ld({Codec:Sp,Boolean:wi,String:$i},...t)});function fA(t){Ae({customError:t})}function mA(){return Ae().customError}var pA,Iv,SI=g(()=>{Me();Me();pA={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"};Iv||(Iv={})});function gA(t,e){let r=t.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":e??"draft-2020-12"}function yA(t,e){if(!t.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=t.slice(1).split("/").filter(Boolean);if(r.length===0)return e.rootSchema;let o=e.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===o){let n=r[1];if(!n||!e.defs[n])throw new Error(`Reference not found: ${t}`);return e.defs[n]}throw new Error(`Reference not found: ${t}`)}function EI(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return N.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(t.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(t.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(t.if!==void 0||t.then!==void 0||t.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(t.dependentSchemas!==void 0||t.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(t.$ref){let n=t.$ref;if(e.refs.has(n))return e.refs.get(n);if(e.processing.has(n))return N.lazy(()=>{if(!e.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return e.refs.get(n)});e.processing.add(n);let i=yA(n,e),s=at(i,e);return e.refs.set(n,s),e.processing.delete(n),s}if(t.enum!==void 0){let n=t.enum;if(e.version==="openapi-3.0"&&t.nullable===!0&&n.length===1&&n[0]===null)return N.null();if(n.length===0)return N.never();if(n.length===1)return N.literal(n[0]);if(n.every(s=>typeof s=="string"))return N.enum(n);let i=n.map(s=>N.literal(s));return i.length<2?i[0]:N.union([i[0],i[1],...i.slice(2)])}if(t.const!==void 0)return N.literal(t.const);let r=t.type;if(Array.isArray(r)){let n=r.map(i=>{let s={...t,type:i};return EI(s,e)});return n.length===0?N.never():n.length===1?n[0]:N.union(n)}if(!r)return N.any();let o;switch(r){case"string":{let n=N.string();if(t.format){let i=t.format;i==="email"?n=n.check(N.email()):i==="uri"||i==="uri-reference"?n=n.check(N.url()):i==="uuid"||i==="guid"?n=n.check(N.uuid()):i==="date-time"?n=n.check(N.iso.datetime()):i==="date"?n=n.check(N.iso.date()):i==="time"?n=n.check(N.iso.time()):i==="duration"?n=n.check(N.iso.duration()):i==="ipv4"?n=n.check(N.ipv4()):i==="ipv6"?n=n.check(N.ipv6()):i==="mac"?n=n.check(N.mac()):i==="cidr"?n=n.check(N.cidrv4()):i==="cidr-v6"?n=n.check(N.cidrv6()):i==="base64"?n=n.check(N.base64()):i==="base64url"?n=n.check(N.base64url()):i==="e164"?n=n.check(N.e164()):i==="jwt"?n=n.check(N.jwt()):i==="emoji"?n=n.check(N.emoji()):i==="nanoid"?n=n.check(N.nanoid()):i==="cuid"?n=n.check(N.cuid()):i==="cuid2"?n=n.check(N.cuid2()):i==="ulid"?n=n.check(N.ulid()):i==="xid"?n=n.check(N.xid()):i==="ksuid"&&(n=n.check(N.ksuid()))}typeof t.minLength=="number"&&(n=n.min(t.minLength)),typeof t.maxLength=="number"&&(n=n.max(t.maxLength)),t.pattern&&(n=n.regex(new RegExp(t.pattern))),o=n;break}case"number":case"integer":{let n=r==="integer"?N.number().int():N.number();typeof t.minimum=="number"&&(n=n.min(t.minimum)),typeof t.maximum=="number"&&(n=n.max(t.maximum)),typeof t.exclusiveMinimum=="number"?n=n.gt(t.exclusiveMinimum):t.exclusiveMinimum===!0&&typeof t.minimum=="number"&&(n=n.gt(t.minimum)),typeof t.exclusiveMaximum=="number"?n=n.lt(t.exclusiveMaximum):t.exclusiveMaximum===!0&&typeof t.maximum=="number"&&(n=n.lt(t.maximum)),typeof t.multipleOf=="number"&&(n=n.multipleOf(t.multipleOf)),o=n;break}case"boolean":{o=N.boolean();break}case"null":{o=N.null();break}case"object":{let n={},i=t.properties||{},s=new Set(t.required||[]);for(let[c,u]of Object.entries(i)){let l=at(u,e);n[c]=s.has(c)?l:l.optional()}if(t.propertyNames){let c=at(t.propertyNames,e),u=t.additionalProperties&&typeof t.additionalProperties=="object"?at(t.additionalProperties,e):N.any();if(Object.keys(n).length===0){o=N.record(c,u);break}let l=N.object(n).passthrough(),d=N.looseRecord(c,u);o=N.intersection(l,d);break}if(t.patternProperties){let c=t.patternProperties,u=Object.keys(c),l=[];for(let p of u){let f=at(c[p],e),m=N.string().regex(new RegExp(p));l.push(N.looseRecord(m,f))}let d=[];if(Object.keys(n).length>0&&d.push(N.object(n).passthrough()),d.push(...l),d.length===0)o=N.object({}).passthrough();else if(d.length===1)o=d[0];else{let p=N.intersection(d[0],d[1]);for(let f=2;f<d.length;f++)p=N.intersection(p,d[f]);o=p}break}let a=N.object(n);t.additionalProperties===!1?o=a.strict():typeof t.additionalProperties=="object"?o=a.catchall(at(t.additionalProperties,e)):o=a.passthrough();break}case"array":{let n=t.prefixItems,i=t.items;if(n&&Array.isArray(n)){let s=n.map(c=>at(c,e)),a=i&&typeof i=="object"&&!Array.isArray(i)?at(i,e):void 0;a?o=N.tuple(s).rest(a):o=N.tuple(s),typeof t.minItems=="number"&&(o=o.check(N.minLength(t.minItems))),typeof t.maxItems=="number"&&(o=o.check(N.maxLength(t.maxItems)))}else if(Array.isArray(i)){let s=i.map(c=>at(c,e)),a=t.additionalItems&&typeof t.additionalItems=="object"?at(t.additionalItems,e):void 0;a?o=N.tuple(s).rest(a):o=N.tuple(s),typeof t.minItems=="number"&&(o=o.check(N.minLength(t.minItems))),typeof t.maxItems=="number"&&(o=o.check(N.maxLength(t.maxItems)))}else if(i!==void 0){let s=at(i,e),a=N.array(s);typeof t.minItems=="number"&&(a=a.min(t.minItems)),typeof t.maxItems=="number"&&(a=a.max(t.maxItems)),o=a}else o=N.array(N.any());break}default:throw new Error(`Unsupported type: ${r}`)}return t.description&&(o=o.describe(t.description)),t.default!==void 0&&(o=o.default(t.default)),o}function at(t,e){if(typeof t=="boolean")return t?N.any():N.never();let r=EI(t,e),o=t.type||t.enum!==void 0||t.const!==void 0;if(t.anyOf&&Array.isArray(t.anyOf)){let a=t.anyOf.map(u=>at(u,e)),c=N.union(a);r=o?N.intersection(r,c):c}if(t.oneOf&&Array.isArray(t.oneOf)){let a=t.oneOf.map(u=>at(u,e)),c=N.xor(a);r=o?N.intersection(r,c):c}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)r=o?r:N.any();else{let a=o?r:at(t.allOf[0],e),c=o?0:1;for(let u=c;u<t.allOf.length;u++)a=N.intersection(a,at(t.allOf[u],e));r=a}t.nullable===!0&&e.version==="openapi-3.0"&&(r=N.nullable(r)),t.readOnly===!0&&(r=N.readonly(r));let n={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let a of i)a in t&&(n[a]=t[a]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let a of s)a in t&&(n[a]=t[a]);for(let a of Object.keys(t))hA.has(a)||(n[a]=t[a]);return Object.keys(n).length>0&&e.registry.add(r,n),r}function II(t,e){if(typeof t=="boolean")return t?N.any():N.never();let r=gA(t,e?.defaultTarget),o=t.$defs||t.definitions||{},n={version:r,defs:o,refs:new Map,processing:new Set,rootSchema:t,registry:e?.registry??Be};return at(t,n)}var N,hA,zI=g(()=>{Ws();Xd();xa();wa();N={...ka,...Kd,iso:bn},hA=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"])});var zv={};bt(zv,{bigint:()=>$A,boolean:()=>bA,date:()=>xA,number:()=>_A,string:()=>vA});function vA(t){return id($i,t)}function _A(t){return fd(ki,t)}function bA(t){return bd(wi,t)}function $A(t){return xd(Si,t)}function xA(t){return jd(Oa,t)}var TI=g(()=>{Me();wa()});var X={};bt(X,{$brand:()=>Ps,$input:()=>nd,$output:()=>rd,NEVER:()=>vu,TimePrecision:()=>ad,ZodAny:()=>Hy,ZodArray:()=>Gy,ZodBase64:()=>gp,ZodBase64URL:()=>yp,ZodBigInt:()=>Si,ZodBigIntFormat:()=>bp,ZodBoolean:()=>wi,ZodCIDRv4:()=>mp,ZodCIDRv6:()=>hp,ZodCUID:()=>ap,ZodCUID2:()=>cp,ZodCatch:()=>hv,ZodCodec:()=>Sp,ZodCustom:()=>Ca,ZodCustomStringFormat:()=>xi,ZodDate:()=>Oa,ZodDefault:()=>uv,ZodDiscriminatedUnion:()=>Xy,ZodE164:()=>vp,ZodEmail:()=>op,ZodEmoji:()=>ip,ZodEnum:()=>bi,ZodError:()=>lA,ZodExactOptional:()=>sv,ZodFile:()=>ov,ZodFirstPartyTypeKind:()=>Iv,ZodFunction:()=>wv,ZodGUID:()=>Sa,ZodIPv4:()=>pp,ZodIPv6:()=>fp,ZodISODate:()=>Qd,ZodISODateTime:()=>Yd,ZodISODuration:()=>tp,ZodISOTime:()=>ep,ZodIntersection:()=>Yy,ZodIssueCode:()=>pA,ZodJWT:()=>_p,ZodKSUID:()=>dp,ZodLazy:()=>$v,ZodLiteral:()=>nv,ZodMAC:()=>Ly,ZodMap:()=>tv,ZodNaN:()=>yv,ZodNanoID:()=>sp,ZodNever:()=>By,ZodNonOptional:()=>kp,ZodNull:()=>Vy,ZodNullable:()=>cv,ZodNumber:()=>ki,ZodNumberFormat:()=>uo,ZodObject:()=>Pa,ZodOptional:()=>Ii,ZodPipe:()=>wp,ZodPrefault:()=>dv,ZodPromise:()=>kv,ZodReadonly:()=>vv,ZodRealError:()=>wt,ZodRecord:()=>Na,ZodSet:()=>rv,ZodString:()=>$i,ZodStringFormat:()=>we,ZodSuccess:()=>mv,ZodSymbol:()=>Fy,ZodTemplateLiteral:()=>bv,ZodTransform:()=>iv,ZodTuple:()=>Qy,ZodType:()=>ee,ZodULID:()=>up,ZodURL:()=>za,ZodUUID:()=>xr,ZodUndefined:()=>qy,ZodUnion:()=>Ra,ZodUnknown:()=>Jy,ZodVoid:()=>Wy,ZodXID:()=>lp,ZodXor:()=>Ky,_ZodString:()=>np,_default:()=>lv,_function:()=>vI,any:()=>eI,array:()=>ie,base64:()=>DE,base64url:()=>ME,bigint:()=>GE,boolean:()=>Ue,catch:()=>gv,check:()=>_I,cidrv4:()=>CE,cidrv6:()=>AE,clone:()=>Je,codec:()=>hI,coerce:()=>zv,config:()=>Ae,core:()=>Nt,cuid:()=>IE,cuid2:()=>zE,custom:()=>Ep,date:()=>rI,decode:()=>jy,decodeAsync:()=>Cy,describe:()=>bI,discriminatedUnion:()=>ja,e164:()=>UE,email:()=>yE,emoji:()=>SE,encode:()=>Ry,encodeAsync:()=>Ny,endsWith:()=>eo,enum:()=>Xe,exactOptional:()=>av,file:()=>dI,flattenError:()=>ri,float32:()=>HE,float64:()=>JE,formatError:()=>ni,fromJSONSchema:()=>II,function:()=>vI,getErrorMap:()=>mA,globalRegistry:()=>Be,gt:()=>cr,gte:()=>Ge,guid:()=>vE,hash:()=>VE,hex:()=>qE,hostname:()=>FE,httpUrl:()=>wE,includes:()=>Yn,instanceof:()=>xI,int:()=>rp,int32:()=>BE,int64:()=>KE,intersection:()=>Ei,ipv4:()=>RE,ipv6:()=>NE,iso:()=>bn,json:()=>wI,jwt:()=>ZE,keyof:()=>nI,ksuid:()=>PE,lazy:()=>xv,length:()=>mn,literal:()=>L,locales:()=>fi,looseObject:()=>Ke,looseRecord:()=>aI,lowercase:()=>Kn,lt:()=>ar,lte:()=>ht,mac:()=>jE,map:()=>cI,maxLength:()=>fn,maxSize:()=>Zr,meta:()=>$I,mime:()=>to,minLength:()=>$r,minSize:()=>ur,multipleOf:()=>Ur,nan:()=>mI,nanoid:()=>EE,nativeEnum:()=>lI,negative:()=>ga,never:()=>$p,nonnegative:()=>va,nonoptional:()=>fv,nonpositive:()=>ya,normalize:()=>ro,null:()=>Ta,nullable:()=>Ea,nullish:()=>pI,number:()=>me,object:()=>A,optional:()=>ze,overwrite:()=>qt,parse:()=>zy,parseAsync:()=>Ty,partialRecord:()=>sI,pipe:()=>Ia,positive:()=>ha,prefault:()=>pv,preprocess:()=>Aa,prettifyError:()=>ku,promise:()=>yI,property:()=>_a,readonly:()=>_v,record:()=>_e,refine:()=>Sv,regex:()=>Gn,regexes:()=>kt,registry:()=>Bs,safeDecode:()=>Dy,safeDecodeAsync:()=>Uy,safeEncode:()=>Ay,safeEncodeAsync:()=>My,safeParse:()=>Oy,safeParseAsync:()=>Py,set:()=>uI,setErrorMap:()=>fA,size:()=>pn,slugify:()=>gi,startsWith:()=>Qn,strictObject:()=>oI,string:()=>$,stringFormat:()=>LE,stringbool:()=>kI,success:()=>fI,superRefine:()=>Ev,symbol:()=>YE,templateLiteral:()=>gI,toJSONSchema:()=>ao,toLowerCase:()=>oo,toUpperCase:()=>io,transform:()=>xp,treeifyError:()=>xu,trim:()=>no,tuple:()=>ev,uint32:()=>WE,uint64:()=>XE,ulid:()=>TE,undefined:()=>QE,union:()=>Ee,unknown:()=>Se,uppercase:()=>Xn,url:()=>kE,util:()=>E,uuid:()=>_E,uuidv4:()=>bE,uuidv6:()=>$E,uuidv7:()=>xE,void:()=>tI,xid:()=>OE,xor:()=>iI});var Da=g(()=>{Me();wa();Xd();Iy();Zy();SI();Me();Og();Me();vi();zI();ed();xa();xa();TI();Ae(Xl())});var Tv=g(()=>{Da();Da()});var OI=g(()=>{Tv();Tv()});function BI(t){if(t.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${t.params.ref.type}`)}function WI(t){if(t.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${t.params.ref.type}`)}var Pv,PI,$n,zp,qe,RI,jI,xH,wA,SA,Rv,Ct,Ma,NI,Ye,Ht,Jt,Qe,Tp,CI,jv,AI,DI,Nv,Ua,H,Cv,MI,UI,kH,Op,EA,Pp,IA,Za,zi,ZI,zA,TA,OA,PA,RA,jA,Av,NA,CA,Dv,Rp,AA,DA,jp,MA,La,Fa,UA,qa,Ti,ZA,Va,Np,Cp,Ap,wH,Dp,Mp,Up,LI,FI,qI,Mv,VI,Ha,Oi,HI,LA,Zp,FA,Lp,qA,Uv,VA,Fp,HA,JA,BA,WA,GA,KA,XA,YA,QA,eD,qp,tD,rD,Vp,Zv,Lv,Fv,nD,oD,iD,qv,sD,aD,cD,uD,lD,JI,Hp,dD,Jp,SH,pD,Pi,fD,EH,Ja,mD,Vv,hD,gD,yD,vD,_D,bD,$D,Ip,xD,kD,wD,Ba,Hv,SD,ED,ID,zD,TD,OD,PD,RD,jD,ND,CD,AD,DD,MD,UD,ZD,LD,FD,Ri,qD,VD,HD,Bp,JD,BD,WD,Jv,GD,IH,zH,TH,OH,PH,RH,F,Ov,ji=g(()=>{OI();Pv="2025-11-25",PI=[Pv,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],$n="io.modelcontextprotocol/related-task",zp="2.0",qe=Ep(t=>t!==null&&(typeof t=="object"||typeof t=="function")),RI=Ee([$(),me().int()]),jI=$(),xH=Ke({ttl:me().optional(),pollInterval:me().optional()}),wA=A({ttl:me().optional()}),SA=A({taskId:$()}),Rv=Ke({progressToken:RI.optional(),[$n]:SA.optional()}),Ct=A({_meta:Rv.optional()}),Ma=Ct.extend({task:wA.optional()}),NI=t=>Ma.safeParse(t).success,Ye=A({method:$(),params:Ct.loose().optional()}),Ht=A({_meta:Rv.optional()}),Jt=A({method:$(),params:Ht.loose().optional()}),Qe=Ke({_meta:Rv.optional()}),Tp=Ee([$(),me().int()]),CI=A({jsonrpc:L(zp),id:Tp,...Ye.shape}).strict(),jv=t=>CI.safeParse(t).success,AI=A({jsonrpc:L(zp),...Jt.shape}).strict(),DI=t=>AI.safeParse(t).success,Nv=A({jsonrpc:L(zp),id:Tp,result:Qe}).strict(),Ua=t=>Nv.safeParse(t).success;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(H||(H={}));Cv=A({jsonrpc:L(zp),id:Tp.optional(),error:A({code:me().int(),message:$(),data:Se().optional()})}).strict(),MI=t=>Cv.safeParse(t).success,UI=Ee([CI,AI,Nv,Cv]),kH=Ee([Nv,Cv]),Op=Qe.strict(),EA=Ht.extend({requestId:Tp.optional(),reason:$().optional()}),Pp=Jt.extend({method:L("notifications/cancelled"),params:EA}),IA=A({src:$(),mimeType:$().optional(),sizes:ie($()).optional(),theme:Xe(["light","dark"]).optional()}),Za=A({icons:ie(IA).optional()}),zi=A({name:$(),title:$().optional()}),ZI=zi.extend({...zi.shape,...Za.shape,version:$(),websiteUrl:$().optional(),description:$().optional()}),zA=Ei(A({applyDefaults:Ue().optional()}),_e($(),Se())),TA=Aa(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,Ei(A({form:zA.optional(),url:qe.optional()}),_e($(),Se()).optional())),OA=Ke({list:qe.optional(),cancel:qe.optional(),requests:Ke({sampling:Ke({createMessage:qe.optional()}).optional(),elicitation:Ke({create:qe.optional()}).optional()}).optional()}),PA=Ke({list:qe.optional(),cancel:qe.optional(),requests:Ke({tools:Ke({call:qe.optional()}).optional()}).optional()}),RA=A({experimental:_e($(),qe).optional(),sampling:A({context:qe.optional(),tools:qe.optional()}).optional(),elicitation:TA.optional(),roots:A({listChanged:Ue().optional()}).optional(),tasks:OA.optional(),extensions:_e($(),qe).optional()}),jA=Ct.extend({protocolVersion:$(),capabilities:RA,clientInfo:ZI}),Av=Ye.extend({method:L("initialize"),params:jA}),NA=A({experimental:_e($(),qe).optional(),logging:qe.optional(),completions:qe.optional(),prompts:A({listChanged:Ue().optional()}).optional(),resources:A({subscribe:Ue().optional(),listChanged:Ue().optional()}).optional(),tools:A({listChanged:Ue().optional()}).optional(),tasks:PA.optional(),extensions:_e($(),qe).optional()}),CA=Qe.extend({protocolVersion:$(),capabilities:NA,serverInfo:ZI,instructions:$().optional()}),Dv=Jt.extend({method:L("notifications/initialized"),params:Ht.optional()}),Rp=Ye.extend({method:L("ping"),params:Ct.optional()}),AA=A({progress:me(),total:ze(me()),message:ze($())}),DA=A({...Ht.shape,...AA.shape,progressToken:RI}),jp=Jt.extend({method:L("notifications/progress"),params:DA}),MA=Ct.extend({cursor:jI.optional()}),La=Ye.extend({params:MA.optional()}),Fa=Qe.extend({nextCursor:jI.optional()}),UA=Xe(["working","input_required","completed","failed","cancelled"]),qa=A({taskId:$(),status:UA,ttl:Ee([me(),Ta()]),createdAt:$(),lastUpdatedAt:$(),pollInterval:ze(me()),statusMessage:ze($())}),Ti=Qe.extend({task:qa}),ZA=Ht.merge(qa),Va=Jt.extend({method:L("notifications/tasks/status"),params:ZA}),Np=Ye.extend({method:L("tasks/get"),params:Ct.extend({taskId:$()})}),Cp=Qe.merge(qa),Ap=Ye.extend({method:L("tasks/result"),params:Ct.extend({taskId:$()})}),wH=Qe.loose(),Dp=La.extend({method:L("tasks/list")}),Mp=Fa.extend({tasks:ie(qa)}),Up=Ye.extend({method:L("tasks/cancel"),params:Ct.extend({taskId:$()})}),LI=Qe.merge(qa),FI=A({uri:$(),mimeType:ze($()),_meta:_e($(),Se()).optional()}),qI=FI.extend({text:$()}),Mv=$().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),VI=FI.extend({blob:Mv}),Ha=Xe(["user","assistant"]),Oi=A({audience:ie(Ha).optional(),priority:me().min(0).max(1).optional(),lastModified:bn.datetime({offset:!0}).optional()}),HI=A({...zi.shape,...Za.shape,uri:$(),description:ze($()),mimeType:ze($()),size:ze(me()),annotations:Oi.optional(),_meta:ze(Ke({}))}),LA=A({...zi.shape,...Za.shape,uriTemplate:$(),description:ze($()),mimeType:ze($()),annotations:Oi.optional(),_meta:ze(Ke({}))}),Zp=La.extend({method:L("resources/list")}),FA=Fa.extend({resources:ie(HI)}),Lp=La.extend({method:L("resources/templates/list")}),qA=Fa.extend({resourceTemplates:ie(LA)}),Uv=Ct.extend({uri:$()}),VA=Uv,Fp=Ye.extend({method:L("resources/read"),params:VA}),HA=Qe.extend({contents:ie(Ee([qI,VI]))}),JA=Jt.extend({method:L("notifications/resources/list_changed"),params:Ht.optional()}),BA=Uv,WA=Ye.extend({method:L("resources/subscribe"),params:BA}),GA=Uv,KA=Ye.extend({method:L("resources/unsubscribe"),params:GA}),XA=Ht.extend({uri:$()}),YA=Jt.extend({method:L("notifications/resources/updated"),params:XA}),QA=A({name:$(),description:ze($()),required:ze(Ue())}),eD=A({...zi.shape,...Za.shape,description:ze($()),arguments:ze(ie(QA)),_meta:ze(Ke({}))}),qp=La.extend({method:L("prompts/list")}),tD=Fa.extend({prompts:ie(eD)}),rD=Ct.extend({name:$(),arguments:_e($(),$()).optional()}),Vp=Ye.extend({method:L("prompts/get"),params:rD}),Zv=A({type:L("text"),text:$(),annotations:Oi.optional(),_meta:_e($(),Se()).optional()}),Lv=A({type:L("image"),data:Mv,mimeType:$(),annotations:Oi.optional(),_meta:_e($(),Se()).optional()}),Fv=A({type:L("audio"),data:Mv,mimeType:$(),annotations:Oi.optional(),_meta:_e($(),Se()).optional()}),nD=A({type:L("tool_use"),name:$(),id:$(),input:_e($(),Se()),_meta:_e($(),Se()).optional()}),oD=A({type:L("resource"),resource:Ee([qI,VI]),annotations:Oi.optional(),_meta:_e($(),Se()).optional()}),iD=HI.extend({type:L("resource_link")}),qv=Ee([Zv,Lv,Fv,iD,oD]),sD=A({role:Ha,content:qv}),aD=Qe.extend({description:$().optional(),messages:ie(sD)}),cD=Jt.extend({method:L("notifications/prompts/list_changed"),params:Ht.optional()}),uD=A({title:$().optional(),readOnlyHint:Ue().optional(),destructiveHint:Ue().optional(),idempotentHint:Ue().optional(),openWorldHint:Ue().optional()}),lD=A({taskSupport:Xe(["required","optional","forbidden"]).optional()}),JI=A({...zi.shape,...Za.shape,description:$().optional(),inputSchema:A({type:L("object"),properties:_e($(),qe).optional(),required:ie($()).optional()}).catchall(Se()),outputSchema:A({type:L("object"),properties:_e($(),qe).optional(),required:ie($()).optional()}).catchall(Se()).optional(),annotations:uD.optional(),execution:lD.optional(),_meta:_e($(),Se()).optional()}),Hp=La.extend({method:L("tools/list")}),dD=Fa.extend({tools:ie(JI)}),Jp=Qe.extend({content:ie(qv).default([]),structuredContent:_e($(),Se()).optional(),isError:Ue().optional()}),SH=Jp.or(Qe.extend({toolResult:Se()})),pD=Ma.extend({name:$(),arguments:_e($(),Se()).optional()}),Pi=Ye.extend({method:L("tools/call"),params:pD}),fD=Jt.extend({method:L("notifications/tools/list_changed"),params:Ht.optional()}),EH=A({autoRefresh:Ue().default(!0),debounceMs:me().int().nonnegative().default(300)}),Ja=Xe(["debug","info","notice","warning","error","critical","alert","emergency"]),mD=Ct.extend({level:Ja}),Vv=Ye.extend({method:L("logging/setLevel"),params:mD}),hD=Ht.extend({level:Ja,logger:$().optional(),data:Se()}),gD=Jt.extend({method:L("notifications/message"),params:hD}),yD=A({name:$().optional()}),vD=A({hints:ie(yD).optional(),costPriority:me().min(0).max(1).optional(),speedPriority:me().min(0).max(1).optional(),intelligencePriority:me().min(0).max(1).optional()}),_D=A({mode:Xe(["auto","required","none"]).optional()}),bD=A({type:L("tool_result"),toolUseId:$().describe("The unique identifier for the corresponding tool call."),content:ie(qv).default([]),structuredContent:A({}).loose().optional(),isError:Ue().optional(),_meta:_e($(),Se()).optional()}),$D=ja("type",[Zv,Lv,Fv]),Ip=ja("type",[Zv,Lv,Fv,nD,bD]),xD=A({role:Ha,content:Ee([Ip,ie(Ip)]),_meta:_e($(),Se()).optional()}),kD=Ma.extend({messages:ie(xD),modelPreferences:vD.optional(),systemPrompt:$().optional(),includeContext:Xe(["none","thisServer","allServers"]).optional(),temperature:me().optional(),maxTokens:me().int(),stopSequences:ie($()).optional(),metadata:qe.optional(),tools:ie(JI).optional(),toolChoice:_D.optional()}),wD=Ye.extend({method:L("sampling/createMessage"),params:kD}),Ba=Qe.extend({model:$(),stopReason:ze(Xe(["endTurn","stopSequence","maxTokens"]).or($())),role:Ha,content:$D}),Hv=Qe.extend({model:$(),stopReason:ze(Xe(["endTurn","stopSequence","maxTokens","toolUse"]).or($())),role:Ha,content:Ee([Ip,ie(Ip)])}),SD=A({type:L("boolean"),title:$().optional(),description:$().optional(),default:Ue().optional()}),ED=A({type:L("string"),title:$().optional(),description:$().optional(),minLength:me().optional(),maxLength:me().optional(),format:Xe(["email","uri","date","date-time"]).optional(),default:$().optional()}),ID=A({type:Xe(["number","integer"]),title:$().optional(),description:$().optional(),minimum:me().optional(),maximum:me().optional(),default:me().optional()}),zD=A({type:L("string"),title:$().optional(),description:$().optional(),enum:ie($()),default:$().optional()}),TD=A({type:L("string"),title:$().optional(),description:$().optional(),oneOf:ie(A({const:$(),title:$()})),default:$().optional()}),OD=A({type:L("string"),title:$().optional(),description:$().optional(),enum:ie($()),enumNames:ie($()).optional(),default:$().optional()}),PD=Ee([zD,TD]),RD=A({type:L("array"),title:$().optional(),description:$().optional(),minItems:me().optional(),maxItems:me().optional(),items:A({type:L("string"),enum:ie($())}),default:ie($()).optional()}),jD=A({type:L("array"),title:$().optional(),description:$().optional(),minItems:me().optional(),maxItems:me().optional(),items:A({anyOf:ie(A({const:$(),title:$()}))}),default:ie($()).optional()}),ND=Ee([RD,jD]),CD=Ee([OD,PD,ND]),AD=Ee([CD,SD,ED,ID]),DD=Ma.extend({mode:L("form").optional(),message:$(),requestedSchema:A({type:L("object"),properties:_e($(),AD),required:ie($()).optional()})}),MD=Ma.extend({mode:L("url"),message:$(),elicitationId:$(),url:$().url()}),UD=Ee([DD,MD]),ZD=Ye.extend({method:L("elicitation/create"),params:UD}),LD=Ht.extend({elicitationId:$()}),FD=Jt.extend({method:L("notifications/elicitation/complete"),params:LD}),Ri=Qe.extend({action:Xe(["accept","decline","cancel"]),content:Aa(t=>t===null?void 0:t,_e($(),Ee([$(),me(),Ue(),ie($())])).optional())}),qD=A({type:L("ref/resource"),uri:$()}),VD=A({type:L("ref/prompt"),name:$()}),HD=Ct.extend({ref:Ee([VD,qD]),argument:A({name:$(),value:$()}),context:A({arguments:_e($(),$()).optional()}).optional()}),Bp=Ye.extend({method:L("completion/complete"),params:HD});JD=Qe.extend({completion:Ke({values:ie($()).max(100),total:ze(me().int()),hasMore:ze(Ue())})}),BD=A({uri:$().startsWith("file://"),name:$().optional(),_meta:_e($(),Se()).optional()}),WD=Ye.extend({method:L("roots/list"),params:Ct.optional()}),Jv=Qe.extend({roots:ie(BD)}),GD=Jt.extend({method:L("notifications/roots/list_changed"),params:Ht.optional()}),IH=Ee([Rp,Av,Bp,Vv,Vp,qp,Zp,Lp,Fp,WA,KA,Pi,Hp,Np,Ap,Dp,Up]),zH=Ee([Pp,jp,Dv,GD,Va]),TH=Ee([Op,Ba,Hv,Ri,Jv,Cp,Mp,Ti]),OH=Ee([Rp,wD,ZD,WD,Np,Ap,Dp,Up]),PH=Ee([Pp,jp,gD,YA,JA,fD,cD,Va,FD]),RH=Ee([Op,CA,JD,aD,tD,FA,qA,HA,Jp,dD,Cp,Mp,Ti]),F=class t extends Error{constructor(e,r,o){super(`MCP error ${e}: ${r}`),this.code=e,this.data=o,this.name="McpError"}static fromError(e,r,o){if(e===H.UrlElicitationRequired&&o){let n=o;if(n.elicitations)return new Ov(n.elicitations,r)}return new t(e,r,o)}},Ov=class extends F{constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(H.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}}});function xn(t){return t==="completed"||t==="failed"||t==="cancelled"}var GI=g(()=>{});var XI,KI,YI,Wp=g(()=>{XI=Symbol("Let zodToJsonSchema decide on which parser to use"),KI={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},YI=t=>typeof t=="string"?{...KI,name:t}:{...KI,...t}});var QI,Bv=g(()=>{Wp();QI=t=>{let e=YI(t),r=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([o,n])=>[n._def,{def:n._def,path:[...e.basePath,e.definitionPath,o],jsonSchema:void 0}]))}}});function Wv(t,e,r,o){o?.errorMessages&&r&&(t.errorMessage={...t.errorMessage,[e]:r})}function le(t,e,r,o,n){t[e]=r,Wv(t,e,o,n)}var kn=g(()=>{});var Gp,Kp=g(()=>{Gp=(t,e)=>{let r=0;for(;r<t.length&&r<e.length&&t[r]===e[r];r++);return[(t.length-r).toString(),...e.slice(r)].join("/")}});function Ce(t){if(t.target!=="openAi")return{};let e=[...t.basePath,t.definitionPath,t.openAiAnyTypeName];return t.flags.hasReferencedOpenAiAnyType=!0,{$ref:t.$refStrategy==="relative"?Gp(e,t.currentPath):e.join("/")}}var Bt=g(()=>{Kp()});function ez(t,e){let r={type:"array"};return t.type?._def&&t.type?._def?.typeName!==z.ZodAny&&(r.items=B(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&le(r,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&le(r,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(le(r,"minItems",t.exactLength.value,t.exactLength.message,e),le(r,"maxItems",t.exactLength.value,t.exactLength.message,e)),r}var Gv=g(()=>{Ts();kn();Le()});function tz(t,e){let r={type:"integer",format:"int64"};if(!t.checks)return r;for(let o of t.checks)switch(o.kind){case"min":e.target==="jsonSchema7"?o.inclusive?le(r,"minimum",o.value,o.message,e):le(r,"exclusiveMinimum",o.value,o.message,e):(o.inclusive||(r.exclusiveMinimum=!0),le(r,"minimum",o.value,o.message,e));break;case"max":e.target==="jsonSchema7"?o.inclusive?le(r,"maximum",o.value,o.message,e):le(r,"exclusiveMaximum",o.value,o.message,e):(o.inclusive||(r.exclusiveMaximum=!0),le(r,"maximum",o.value,o.message,e));break;case"multipleOf":le(r,"multipleOf",o.value,o.message,e);break}return r}var Kv=g(()=>{kn()});function rz(){return{type:"boolean"}}var Xv=g(()=>{});function Xp(t,e){return B(t.type._def,e)}var Yp=g(()=>{Le()});var nz,Yv=g(()=>{Le();nz=(t,e)=>B(t.innerType._def,e)});function Qv(t,e,r){let o=r??e.dateStrategy;if(Array.isArray(o))return{anyOf:o.map((n,i)=>Qv(t,e,n))};switch(o){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return KD(t,e)}}var KD,e_=g(()=>{kn();KD=(t,e)=>{let r={type:"integer",format:"unix-time"};if(e.target==="openApi3")return r;for(let o of t.checks)switch(o.kind){case"min":le(r,"minimum",o.value,o.message,e);break;case"max":le(r,"maximum",o.value,o.message,e);break}return r}});function oz(t,e){return{...B(t.innerType._def,e),default:t.defaultValue()}}var t_=g(()=>{Le()});function iz(t,e){return e.effectStrategy==="input"?B(t.schema._def,e):Ce(e)}var r_=g(()=>{Le();Bt()});function sz(t){return{type:"string",enum:Array.from(t.values)}}var n_=g(()=>{});function az(t,e){let r=[B(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),B(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(i=>!!i),o=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,n=[];return r.forEach(i=>{if(XD(i))n.push(...i.allOf),i.unevaluatedProperties===void 0&&(o=void 0);else{let s=i;if("additionalProperties"in i&&i.additionalProperties===!1){let{additionalProperties:a,...c}=i;s=c}else o=void 0;n.push(s)}}),n.length?{allOf:n,...o}:void 0}var XD,o_=g(()=>{Le();XD=t=>"type"in t&&t.type==="string"?!1:"allOf"in t});function cz(t,e){let r=typeof t.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[t.value]}:{type:r==="bigint"?"integer":r,const:t.value}}var i_=g(()=>{});function Qp(t,e){let r={type:"string"};if(t.checks)for(let o of t.checks)switch(o.kind){case"min":le(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,o.value):o.value,o.message,e);break;case"max":le(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,o.value):o.value,o.message,e);break;case"email":switch(e.emailStrategy){case"format:email":dr(r,"email",o.message,e);break;case"format:idn-email":dr(r,"idn-email",o.message,e);break;case"pattern:zod":yt(r,lr.email,o.message,e);break}break;case"url":dr(r,"uri",o.message,e);break;case"uuid":dr(r,"uuid",o.message,e);break;case"regex":yt(r,o.regex,o.message,e);break;case"cuid":yt(r,lr.cuid,o.message,e);break;case"cuid2":yt(r,lr.cuid2,o.message,e);break;case"startsWith":yt(r,RegExp(`^${a_(o.value,e)}`),o.message,e);break;case"endsWith":yt(r,RegExp(`${a_(o.value,e)}$`),o.message,e);break;case"datetime":dr(r,"date-time",o.message,e);break;case"date":dr(r,"date",o.message,e);break;case"time":dr(r,"time",o.message,e);break;case"duration":dr(r,"duration",o.message,e);break;case"length":le(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,o.value):o.value,o.message,e),le(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,o.value):o.value,o.message,e);break;case"includes":{yt(r,RegExp(a_(o.value,e)),o.message,e);break}case"ip":{o.version!=="v6"&&dr(r,"ipv4",o.message,e),o.version!=="v4"&&dr(r,"ipv6",o.message,e);break}case"base64url":yt(r,lr.base64url,o.message,e);break;case"jwt":yt(r,lr.jwt,o.message,e);break;case"cidr":{o.version!=="v6"&&yt(r,lr.ipv4Cidr,o.message,e),o.version!=="v4"&&yt(r,lr.ipv6Cidr,o.message,e);break}case"emoji":yt(r,lr.emoji(),o.message,e);break;case"ulid":{yt(r,lr.ulid,o.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{dr(r,"binary",o.message,e);break}case"contentEncoding:base64":{le(r,"contentEncoding","base64",o.message,e);break}case"pattern:zod":{yt(r,lr.base64,o.message,e);break}}break}case"nanoid":yt(r,lr.nanoid,o.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}function a_(t,e){return e.patternStrategy==="escape"?QD(t):t}function QD(t){let e="";for(let r=0;r<t.length;r++)YD.has(t[r])||(e+="\\"),e+=t[r];return e}function dr(t,e,r,o){t.format||t.anyOf?.some(n=>n.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format,...t.errorMessage&&o.errorMessages&&{errorMessage:{format:t.errorMessage.format}}}),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push({format:e,...r&&o.errorMessages&&{errorMessage:{format:r}}})):le(t,"format",e,r,o)}function yt(t,e,r,o){t.pattern||t.allOf?.some(n=>n.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern,...t.errorMessage&&o.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}}}),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push({pattern:uz(e,o),...r&&o.errorMessages&&{errorMessage:{pattern:r}}})):le(t,"pattern",uz(e,o),r,o)}function uz(t,e){if(!e.applyRegexFlags||!t.flags)return t.source;let r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},o=r.i?t.source.toLowerCase():t.source,n="",i=!1,s=!1,a=!1;for(let c=0;c<o.length;c++){if(i){n+=o[c],i=!1;continue}if(r.i){if(s){if(o[c].match(/[a-z]/)){a?(n+=o[c],n+=`${o[c-2]}-${o[c]}`.toUpperCase(),a=!1):o[c+1]==="-"&&o[c+2]?.match(/[a-z]/)?(n+=o[c],a=!0):n+=`${o[c]}${o[c].toUpperCase()}`;continue}}else if(o[c].match(/[a-z]/)){n+=`[${o[c]}${o[c].toUpperCase()}]`;continue}}if(r.m){if(o[c]==="^"){n+=`(^|(?<=[\r
|
|
252
|
+
]))`;continue}else if(o[c]==="$"){n+=`($|(?=[\r
|
|
253
|
+
]))`;continue}}if(r.s&&o[c]==="."){n+=s?`${o[c]}\r
|
|
254
|
+
`:`[${o[c]}\r
|
|
255
|
+
]`;continue}n+=o[c],o[c]==="\\"?i=!0:s&&o[c]==="]"?s=!1:!s&&o[c]==="["&&(s=!0)}try{new RegExp(n)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),t.source}return n}var s_,lr,YD,ef=g(()=>{kn();lr={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(s_===void 0&&(s_=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),s_),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?: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])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};YD=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789")});function tf(t,e){if(e.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),e.target==="openApi3"&&t.keyType?._def.typeName===z.ZodEnum)return{type:"object",required:t.keyType._def.values,properties:t.keyType._def.values.reduce((o,n)=>({...o,[n]:B(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",n]})??Ce(e)}),{}),additionalProperties:e.rejectedAdditionalProperties};let r={type:"object",additionalProperties:B(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??e.allowedAdditionalProperties};if(e.target==="openApi3")return r;if(t.keyType?._def.typeName===z.ZodString&&t.keyType._def.checks?.length){let{type:o,...n}=Qp(t.keyType._def,e);return{...r,propertyNames:n}}else{if(t.keyType?._def.typeName===z.ZodEnum)return{...r,propertyNames:{enum:t.keyType._def.values}};if(t.keyType?._def.typeName===z.ZodBranded&&t.keyType._def.type._def.typeName===z.ZodString&&t.keyType._def.type._def.checks?.length){let{type:o,...n}=Xp(t.keyType._def,e);return{...r,propertyNames:n}}}return r}var rf=g(()=>{Ts();Le();ef();Yp();Bt()});function lz(t,e){if(e.mapStrategy==="record")return tf(t,e);let r=B(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||Ce(e),o=B(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||Ce(e);return{type:"array",maxItems:125,items:{type:"array",items:[r,o],minItems:2,maxItems:2}}}var c_=g(()=>{Le();rf();Bt()});function dz(t){let e=t.values,o=Object.keys(t.values).filter(i=>typeof e[e[i]]!="number").map(i=>e[i]),n=Array.from(new Set(o.map(i=>typeof i)));return{type:n.length===1?n[0]==="string"?"string":"number":["string","number"],enum:o}}var u_=g(()=>{});function pz(t){return t.target==="openAi"?void 0:{not:Ce({...t,currentPath:[...t.currentPath,"not"]})}}var l_=g(()=>{Bt()});function fz(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var d_=g(()=>{});function hz(t,e){if(e.target==="openApi3")return mz(t,e);let r=t.options instanceof Map?Array.from(t.options.values()):t.options;if(r.every(o=>o._def.typeName in Wa&&(!o._def.checks||!o._def.checks.length))){let o=r.reduce((n,i)=>{let s=Wa[i._def.typeName];return s&&!n.includes(s)?[...n,s]:n},[]);return{type:o.length>1?o:o[0]}}else if(r.every(o=>o._def.typeName==="ZodLiteral"&&!o.description)){let o=r.reduce((n,i)=>{let s=typeof i._def.value;switch(s){case"string":case"number":case"boolean":return[...n,s];case"bigint":return[...n,"integer"];case"object":if(i._def.value===null)return[...n,"null"];default:return n}},[]);if(o.length===r.length){let n=o.filter((i,s,a)=>a.indexOf(i)===s);return{type:n.length>1?n:n[0],enum:r.reduce((i,s)=>i.includes(s._def.value)?i:[...i,s._def.value],[])}}}else if(r.every(o=>o._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((o,n)=>[...o,...n._def.values.filter(i=>!o.includes(i))],[])};return mz(t,e)}var Wa,mz,nf=g(()=>{Le();Wa={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};mz=(t,e)=>{let r=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((o,n)=>B(o._def,{...e,currentPath:[...e.currentPath,"anyOf",`${n}`]})).filter(o=>!!o&&(!e.strictUnions||typeof o=="object"&&Object.keys(o).length>0));return r.length?{anyOf:r}:void 0}});function gz(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return e.target==="openApi3"?{type:Wa[t.innerType._def.typeName],nullable:!0}:{type:[Wa[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let o=B(t.innerType._def,{...e,currentPath:[...e.currentPath]});return o&&"$ref"in o?{allOf:[o],nullable:!0}:o&&{...o,nullable:!0}}let r=B(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}var p_=g(()=>{Le();nf()});function yz(t,e){let r={type:"number"};if(!t.checks)return r;for(let o of t.checks)switch(o.kind){case"int":r.type="integer",Wv(r,"type",o.message,e);break;case"min":e.target==="jsonSchema7"?o.inclusive?le(r,"minimum",o.value,o.message,e):le(r,"exclusiveMinimum",o.value,o.message,e):(o.inclusive||(r.exclusiveMinimum=!0),le(r,"minimum",o.value,o.message,e));break;case"max":e.target==="jsonSchema7"?o.inclusive?le(r,"maximum",o.value,o.message,e):le(r,"exclusiveMaximum",o.value,o.message,e):(o.inclusive||(r.exclusiveMaximum=!0),le(r,"maximum",o.value,o.message,e));break;case"multipleOf":le(r,"multipleOf",o.value,o.message,e);break}return r}var f_=g(()=>{kn()});function vz(t,e){let r=e.target==="openAi",o={type:"object",properties:{}},n=[],i=t.shape();for(let a in i){let c=i[a];if(c===void 0||c._def===void 0)continue;let u=tM(c);u&&r&&(c._def.typeName==="ZodOptional"&&(c=c._def.innerType),c.isNullable()||(c=c.nullable()),u=!1);let l=B(c._def,{...e,currentPath:[...e.currentPath,"properties",a],propertyPath:[...e.currentPath,"properties",a]});l!==void 0&&(o.properties[a]=l,u||n.push(a))}n.length&&(o.required=n);let s=eM(t,e);return s!==void 0&&(o.additionalProperties=s),o}function eM(t,e){if(t.catchall._def.typeName!=="ZodNever")return B(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function tM(t){try{return t.isOptional()}catch{return!0}}var m_=g(()=>{Le()});var _z,h_=g(()=>{Le();Bt();_z=(t,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return B(t.innerType._def,e);let r=B(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return r?{anyOf:[{not:Ce(e)},r]}:Ce(e)}});var bz,g_=g(()=>{Le();bz=(t,e)=>{if(e.pipeStrategy==="input")return B(t.in._def,e);if(e.pipeStrategy==="output")return B(t.out._def,e);let r=B(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),o=B(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,o].filter(n=>n!==void 0)}}});function $z(t,e){return B(t.type._def,e)}var y_=g(()=>{Le()});function xz(t,e){let o={type:"array",uniqueItems:!0,items:B(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&le(o,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&le(o,"maxItems",t.maxSize.value,t.maxSize.message,e),o}var v_=g(()=>{kn();Le()});function kz(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((r,o)=>B(r._def,{...e,currentPath:[...e.currentPath,"items",`${o}`]})).reduce((r,o)=>o===void 0?r:[...r,o],[]),additionalItems:B(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((r,o)=>B(r._def,{...e,currentPath:[...e.currentPath,"items",`${o}`]})).reduce((r,o)=>o===void 0?r:[...r,o],[])}}var __=g(()=>{Le()});function wz(t){return{not:Ce(t)}}var b_=g(()=>{Bt()});function Sz(t){return Ce(t)}var $_=g(()=>{Bt()});var Ez,x_=g(()=>{Le();Ez=(t,e)=>B(t.innerType._def,e)});var Iz,k_=g(()=>{Ts();Bt();Gv();Kv();Xv();Yp();Yv();e_();t_();r_();n_();o_();i_();c_();u_();l_();d_();p_();f_();m_();h_();g_();y_();rf();v_();ef();__();b_();nf();$_();x_();Iz=(t,e,r)=>{switch(e){case z.ZodString:return Qp(t,r);case z.ZodNumber:return yz(t,r);case z.ZodObject:return vz(t,r);case z.ZodBigInt:return tz(t,r);case z.ZodBoolean:return rz();case z.ZodDate:return Qv(t,r);case z.ZodUndefined:return wz(r);case z.ZodNull:return fz(r);case z.ZodArray:return ez(t,r);case z.ZodUnion:case z.ZodDiscriminatedUnion:return hz(t,r);case z.ZodIntersection:return az(t,r);case z.ZodTuple:return kz(t,r);case z.ZodRecord:return tf(t,r);case z.ZodLiteral:return cz(t,r);case z.ZodEnum:return sz(t);case z.ZodNativeEnum:return dz(t);case z.ZodNullable:return gz(t,r);case z.ZodOptional:return _z(t,r);case z.ZodMap:return lz(t,r);case z.ZodSet:return xz(t,r);case z.ZodLazy:return()=>t.getter()._def;case z.ZodPromise:return $z(t,r);case z.ZodNaN:case z.ZodNever:return pz(r);case z.ZodEffects:return iz(t,r);case z.ZodAny:return Ce(r);case z.ZodUnknown:return Sz(r);case z.ZodDefault:return oz(t,r);case z.ZodBranded:return Xp(t,r);case z.ZodReadonly:return Ez(t,r);case z.ZodCatch:return nz(t,r);case z.ZodPipeline:return bz(t,r);case z.ZodFunction:case z.ZodVoid:case z.ZodSymbol:return;default:return(o=>{})(e)}}});function B(t,e,r=!1){let o=e.seen.get(t);if(e.override){let a=e.override?.(t,e,o,r);if(a!==XI)return a}if(o&&!r){let a=rM(o,e);if(a!==void 0)return a}let n={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,n);let i=Iz(t,t.typeName,e),s=typeof i=="function"?B(i(),e):i;if(s&&nM(t,e,s),e.postProcess){let a=e.postProcess(s,t,e);return n.jsonSchema=s,a}return n.jsonSchema=s,s}var rM,nM,Le=g(()=>{Wp();k_();Kp();Bt();rM=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:Gp(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((r,o)=>e.currentPath[o]===r)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),Ce(e)):e.$refStrategy==="seen"?Ce(e):void 0}},nM=(t,e,r)=>(t.description&&(r.description=t.description,e.markdownDescription&&(r.markdownDescription=t.description)),r)});var zz=g(()=>{});var w_,S_=g(()=>{Le();Bv();Bt();w_=(t,e)=>{let r=QI(e),o=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((c,[u,l])=>({...c,[u]:B(l._def,{...r,currentPath:[...r.basePath,r.definitionPath,u]},!0)??Ce(r)}),{}):void 0,n=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,i=B(t._def,n===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,n]},!1)??Ce(r),s=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;s!==void 0&&(i.title=s),r.flags.hasReferencedOpenAiAnyType&&(o||(o={}),o[r.openAiAnyTypeName]||(o[r.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:r.$refStrategy==="relative"?"1":[...r.basePath,r.definitionPath,r.openAiAnyTypeName].join("/")}}));let a=n===void 0?o?{...i,[r.definitionPath]:o}:i:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,n].join("/"),[r.definitionPath]:{...o,[n]:i}};return r.target==="jsonSchema7"?a.$schema="http://json-schema.org/draft-07/schema#":(r.target==="jsonSchema2019-09"||r.target==="openAi")&&(a.$schema="https://json-schema.org/draft/2019-09/schema#"),r.target==="openAi"&&("anyOf"in a||"oneOf"in a||"allOf"in a||"type"in a&&Array.isArray(a.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),a}});var Tz=g(()=>{Wp();Bv();kn();Kp();Le();zz();Bt();Gv();Kv();Xv();Yp();Yv();e_();t_();r_();n_();o_();i_();c_();u_();l_();d_();p_();f_();m_();h_();g_();y_();x_();rf();v_();ef();__();b_();nf();$_();k_();S_();S_()});function oM(t){return!t||t==="jsonSchema7"||t==="draft-7"?"draft-7":t==="jsonSchema2019-09"||t==="draft-2020-12"?"draft-2020-12":"draft-7"}function E_(t,e){return Vt(t)?ao(t,{target:oM(e?.target),io:e?.pipeStrategy??"input"}):w_(t,{strictUnions:e?.strictUnions??!0,pipeStrategy:e?.pipeStrategy??"input"})}function I_(t){let r=_n(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let o=Gd(r);if(typeof o!="string")throw new Error("Schema method literal must be a string");return o}function z_(t,e){let r=vn(t,e);if(!r.success)throw r.error;return r.data}var T_=g(()=>{xy();$a();Tz()});function Oz(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function Pz(t,e){let r={...t};for(let o in e){let n=o,i=e[n];if(i===void 0)continue;let s=r[n];Oz(s)&&Oz(i)?r[n]={...s,...i}:r[n]=i}return r}var iM,of,Rz=g(()=>{$a();ji();GI();T_();iM=6e4,of=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(Pp,r=>{this._oncancel(r)}),this.setNotificationHandler(jp,r=>{this._onprogress(r)}),this.setRequestHandler(Rp,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Np,async(r,o)=>{let n=await this._taskStore.getTask(r.params.taskId,o.sessionId);if(!n)throw new F(H.InvalidParams,"Failed to retrieve task: Task not found");return{...n}}),this.setRequestHandler(Ap,async(r,o)=>{let n=async()=>{let i=r.params.taskId;if(this._taskMessageQueue){let a;for(;a=await this._taskMessageQueue.dequeue(i,o.sessionId);){if(a.type==="response"||a.type==="error"){let c=a.message,u=c.id,l=this._requestResolvers.get(u);if(l)if(this._requestResolvers.delete(u),a.type==="response")l(c);else{let d=c,p=new F(d.error.code,d.error.message,d.error.data);l(p)}else{let d=a.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${u}`))}continue}await this._transport?.send(a.message,{relatedRequestId:o.requestId})}}let s=await this._taskStore.getTask(i,o.sessionId);if(!s)throw new F(H.InvalidParams,`Task not found: ${i}`);if(!xn(s.status))return await this._waitForTaskUpdate(i,o.signal),await n();if(xn(s.status)){let a=await this._taskStore.getTaskResult(i,o.sessionId);return this._clearTaskQueue(i),{...a,_meta:{...a._meta,[$n]:{taskId:i}}}}return await n()};return await n()}),this.setRequestHandler(Dp,async(r,o)=>{try{let{tasks:n,nextCursor:i}=await this._taskStore.listTasks(r.params?.cursor,o.sessionId);return{tasks:n,nextCursor:i,_meta:{}}}catch(n){throw new F(H.InvalidParams,`Failed to list tasks: ${n instanceof Error?n.message:String(n)}`)}}),this.setRequestHandler(Up,async(r,o)=>{try{let n=await this._taskStore.getTask(r.params.taskId,o.sessionId);if(!n)throw new F(H.InvalidParams,`Task not found: ${r.params.taskId}`);if(xn(n.status))throw new F(H.InvalidParams,`Cannot cancel task in terminal status: ${n.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",o.sessionId),this._clearTaskQueue(r.params.taskId);let i=await this._taskStore.getTask(r.params.taskId,o.sessionId);if(!i)throw new F(H.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...i}}catch(n){throw n instanceof F?n:new F(H.InvalidRequest,`Failed to cancel task: ${n instanceof Error?n.message:String(n)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,r,o,n,i=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(n,r),startTime:Date.now(),timeout:r,maxTotalTimeout:o,resetTimeoutOnProgress:i,onTimeout:n})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let o=Date.now()-r.startTime;if(r.maxTotalTimeout&&o>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),F.fromError(H.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:o});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){let r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let o=this.transport?.onerror;this._transport.onerror=i=>{o?.(i),this._onerror(i)};let n=this._transport?.onmessage;this._transport.onmessage=(i,s)=>{n?.(i,s),Ua(i)||MI(i)?this._onresponse(i):jv(i)?this._onrequest(i,s):DI(i)?this._onnotification(i):this._onerror(new Error(`Unknown message type: ${JSON.stringify(i)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let o of this._timeoutInfo.values())clearTimeout(o.timeoutId);this._timeoutInfo.clear();for(let o of this._requestHandlerAbortControllers.values())o.abort();this._requestHandlerAbortControllers.clear();let r=F.fromError(H.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let o of e.values())o(r)}_onerror(e){this.onerror?.(e)}_onnotification(e){let r=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(o=>this._onerror(new Error(`Uncaught error in notification handler: ${o}`)))}_onrequest(e,r){let o=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,n=this._transport,i=e.params?._meta?.[$n]?.taskId;if(o===void 0){let l={jsonrpc:"2.0",id:e.id,error:{code:H.MethodNotFound,message:"Method not found"}};i&&this._taskMessageQueue?this._enqueueTaskMessage(i,{type:"error",message:l,timestamp:Date.now()},n?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):n?.send(l).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}let s=new AbortController;this._requestHandlerAbortControllers.set(e.id,s);let a=NI(e.params)?e.params.task:void 0,c=this._taskStore?this.requestTaskStore(e,n?.sessionId):void 0,u={signal:s.signal,sessionId:n?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(s.signal.aborted)return;let d={relatedRequestId:e.id};i&&(d.relatedTask={taskId:i}),await this.notification(l,d)},sendRequest:async(l,d,p)=>{if(s.signal.aborted)throw new F(H.ConnectionClosed,"Request was cancelled");let f={...p,relatedRequestId:e.id};i&&!f.relatedTask&&(f.relatedTask={taskId:i});let m=f.relatedTask?.taskId??i;return m&&c&&await c.updateTaskStatus(m,"input_required"),await this.request(l,d,f)},authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:i,taskStore:c,taskRequestedTtl:a?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{a&&this.assertTaskHandlerCapability(e.method)}).then(()=>o(e,u)).then(async l=>{if(s.signal.aborted)return;let d={result:l,jsonrpc:"2.0",id:e.id};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:"response",message:d,timestamp:Date.now()},n?.sessionId):await n?.send(d)},async l=>{if(s.signal.aborted)return;let d={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:H.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:"error",message:d,timestamp:Date.now()},n?.sessionId):await n?.send(d)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===s&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...o}=e.params,n=Number(r),i=this._progressHandlers.get(n);if(!i){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let s=this._responseHandlers.get(n),a=this._timeoutInfo.get(n);if(a&&s&&a.resetTimeoutOnProgress)try{this._resetTimeout(n)}catch(c){this._responseHandlers.delete(n),this._progressHandlers.delete(n),this._cleanupTimeout(n),s(c);return}i(o)}_onresponse(e){let r=Number(e.id),o=this._requestResolvers.get(r);if(o){if(this._requestResolvers.delete(r),Ua(e))o(e);else{let s=new F(e.error.code,e.error.message,e.error.data);o(s)}return}let n=this._responseHandlers.get(r);if(n===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let i=!1;if(Ua(e)&&e.result&&typeof e.result=="object"){let s=e.result;if(s.task&&typeof s.task=="object"){let a=s.task;typeof a.taskId=="string"&&(i=!0,this._taskProgressTokens.set(a.taskId,r))}}if(i||this._progressHandlers.delete(r),Ua(e))n(e);else{let s=F.fromError(e.error.code,e.error.message,e.error.data);n(s)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,o){let{task:n}=o??{};if(!n){try{yield{type:"result",result:await this.request(e,r,o)}}catch(s){yield{type:"error",error:s instanceof F?s:new F(H.InternalError,String(s))}}return}let i;try{let s=await this.request(e,Ti,o);if(s.task)i=s.task.taskId,yield{type:"taskCreated",task:s.task};else throw new F(H.InternalError,"Task creation did not return a task");for(;;){let a=await this.getTask({taskId:i},o);if(yield{type:"taskStatus",task:a},xn(a.status)){a.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:i},r,o)}:a.status==="failed"?yield{type:"error",error:new F(H.InternalError,`Task ${i} failed`)}:a.status==="cancelled"&&(yield{type:"error",error:new F(H.InternalError,`Task ${i} was cancelled`)});return}if(a.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:i},r,o)};return}let c=a.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(u=>setTimeout(u,c)),o?.signal?.throwIfAborted()}}catch(s){yield{type:"error",error:s instanceof F?s:new F(H.InternalError,String(s))}}}request(e,r,o){let{relatedRequestId:n,resumptionToken:i,onresumptiontoken:s,task:a,relatedTask:c}=o??{};return new Promise((u,l)=>{let d=P=>{l(P)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),a&&this.assertTaskCapability(e.method)}catch(P){d(P);return}o?.signal?.throwIfAborted();let p=this._requestMessageId++,f={...e,jsonrpc:"2.0",id:p};o?.onprogress&&(this._progressHandlers.set(p,o.onprogress),f.params={...e.params,_meta:{...e.params?._meta||{},progressToken:p}}),a&&(f.params={...f.params,task:a}),c&&(f.params={...f.params,_meta:{...f.params?._meta||{},[$n]:c}});let m=P=>{this._responseHandlers.delete(p),this._progressHandlers.delete(p),this._cleanupTimeout(p),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:p,reason:String(P)}},{relatedRequestId:n,resumptionToken:i,onresumptiontoken:s}).catch(w=>this._onerror(new Error(`Failed to send cancellation: ${w}`)));let _=P instanceof F?P:new F(H.RequestTimeout,String(P));l(_)};this._responseHandlers.set(p,P=>{if(!o?.signal?.aborted){if(P instanceof Error)return l(P);try{let _=vn(r,P.result);_.success?u(_.data):l(_.error)}catch(_){l(_)}}}),o?.signal?.addEventListener("abort",()=>{m(o?.signal?.reason)});let y=o?.timeout??iM,x=()=>m(F.fromError(H.RequestTimeout,"Request timed out",{timeout:y}));this._setupTimeout(p,y,o?.maxTotalTimeout,x,o?.resetTimeoutOnProgress??!1);let v=c?.taskId;if(v){let P=_=>{let w=this._responseHandlers.get(p);w?w(_):this._onerror(new Error(`Response handler missing for side-channeled request ${p}`))};this._requestResolvers.set(p,P),this._enqueueTaskMessage(v,{type:"request",message:f,timestamp:Date.now()}).catch(_=>{this._cleanupTimeout(p),l(_)})}else this._transport.send(f,{relatedRequestId:n,resumptionToken:i,onresumptiontoken:s}).catch(P=>{this._cleanupTimeout(p),l(P)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},Cp,r)}async getTaskResult(e,r,o){return this.request({method:"tasks/result",params:e},r,o)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},Mp,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},LI,r)}async notification(e,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let o=r?.relatedTask?.taskId;if(o){let a={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[$n]:r.relatedTask}}};await this._enqueueTaskMessage(o,{type:"notification",message:a,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let a={...e,jsonrpc:"2.0"};r?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[$n]:r.relatedTask}}}),this._transport?.send(a,r).catch(c=>this._onerror(c))});return}let s={...e,jsonrpc:"2.0"};r?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[$n]:r.relatedTask}}}),await this._transport.send(s,r)}setRequestHandler(e,r){let o=I_(e);this.assertRequestHandlerCapability(o),this._requestHandlers.set(o,(n,i)=>{let s=z_(e,n);return Promise.resolve(r(s,i))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){let o=I_(e);this._notificationHandlers.set(o,n=>{let i=z_(e,n);return Promise.resolve(r(i))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let r=this._taskProgressTokens.get(e);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,r,o){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let n=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,r,o,n)}async _clearTaskQueue(e,r){if(this._taskMessageQueue){let o=await this._taskMessageQueue.dequeueAll(e,r);for(let n of o)if(n.type==="request"&&jv(n.message)){let i=n.message.id,s=this._requestResolvers.get(i);s?(s(new F(H.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(i)):this._onerror(new Error(`Resolver missing for request ${i} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,r){let o=this._options?.defaultTaskPollInterval??1e3;try{let n=await this._taskStore?.getTask(e);n?.pollInterval&&(o=n.pollInterval)}catch{}return new Promise((n,i)=>{if(r.aborted){i(new F(H.InvalidRequest,"Request cancelled"));return}let s=setTimeout(n,o);r.addEventListener("abort",()=>{clearTimeout(s),i(new F(H.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,r){let o=this._taskStore;if(!o)throw new Error("No task store configured");return{createTask:async n=>{if(!e)throw new Error("No request provided");return await o.createTask(n,e.id,{method:e.method,params:e.params},r)},getTask:async n=>{let i=await o.getTask(n,r);if(!i)throw new F(H.InvalidParams,"Failed to retrieve task: Task not found");return i},storeTaskResult:async(n,i,s)=>{await o.storeTaskResult(n,i,s,r);let a=await o.getTask(n,r);if(a){let c=Va.parse({method:"notifications/tasks/status",params:a});await this.notification(c),xn(a.status)&&this._cleanupTaskProgressHandler(n)}},getTaskResult:n=>o.getTaskResult(n,r),updateTaskStatus:async(n,i,s)=>{let a=await o.getTask(n,r);if(!a)throw new F(H.InvalidParams,`Task "${n}" not found - it may have been cleaned up`);if(xn(a.status))throw new F(H.InvalidParams,`Cannot update task "${n}" from terminal status "${a.status}" to "${i}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await o.updateTaskStatus(n,i,s,r);let c=await o.getTask(n,r);if(c){let u=Va.parse({method:"notifications/tasks/status",params:c});await this.notification(u),xn(c.status)&&this._cleanupTaskProgressHandler(n)}},listTasks:n=>o.listTasks(n,r)}}}});var Xa=O(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.regexpCode=he.getEsmExportName=he.getProperty=he.safeStringify=he.stringify=he.strConcat=he.addCodeArg=he.str=he._=he.nil=he._Code=he.Name=he.IDENTIFIER=he._CodeOrName=void 0;var Ga=class{};he._CodeOrName=Ga;he.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var lo=class extends Ga{constructor(e){if(super(),!he.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};he.Name=lo;var Wt=class extends Ga{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,o)=>`${r}${o}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,o)=>(o instanceof lo&&(r[o.str]=(r[o.str]||0)+1),r),{})}};he._Code=Wt;he.nil=new Wt("");function jz(t,...e){let r=[t[0]],o=0;for(;o<e.length;)P_(r,e[o]),r.push(t[++o]);return new Wt(r)}he._=jz;var O_=new Wt("+");function Nz(t,...e){let r=[Ka(t[0])],o=0;for(;o<e.length;)r.push(O_),P_(r,e[o]),r.push(O_,Ka(t[++o]));return sM(r),new Wt(r)}he.str=Nz;function P_(t,e){e instanceof Wt?t.push(...e._items):e instanceof lo?t.push(e):t.push(uM(e))}he.addCodeArg=P_;function sM(t){let e=1;for(;e<t.length-1;){if(t[e]===O_){let r=aM(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function aM(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof lo||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof lo))return`"${t}${e.slice(1)}`}function cM(t,e){return e.emptyStr()?t:t.emptyStr()?e:Nz`${t}${e}`}he.strConcat=cM;function uM(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Ka(Array.isArray(t)?t.join(","):t)}function lM(t){return new Wt(Ka(t))}he.stringify=lM;function Ka(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}he.safeStringify=Ka;function dM(t){return typeof t=="string"&&he.IDENTIFIER.test(t)?new Wt(`.${t}`):jz`[${t}]`}he.getProperty=dM;function pM(t){if(typeof t=="string"&&he.IDENTIFIER.test(t))return new Wt(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}he.getEsmExportName=pM;function fM(t){return new Wt(t.toString())}he.regexpCode=fM});var N_=O(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.ValueScope=Et.ValueScopeName=Et.Scope=Et.varKinds=Et.UsedValueState=void 0;var St=Xa(),R_=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},sf;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(sf||(Et.UsedValueState=sf={}));Et.varKinds={const:new St.Name("const"),let:new St.Name("let"),var:new St.Name("var")};var af=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof St.Name?e:this.name(e)}name(e){return new St.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,o;if(!((o=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||o===void 0)&&o.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Et.Scope=af;var cf=class extends St.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:o}){this.value=e,this.scopePath=(0,St._)`.${new St.Name(r)}[${o}]`}};Et.ValueScopeName=cf;var mM=(0,St._)`\n`,j_=class extends af{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?mM:St.nil}}get(){return this._scope}name(e){return new cf(e,this._newName(e))}value(e,r){var o;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let n=this.toName(e),{prefix:i}=n,s=(o=r.key)!==null&&o!==void 0?o:r.ref,a=this._values[i];if(a){let l=a.get(s);if(l)return l}else a=this._values[i]=new Map;a.set(s,n);let c=this._scope[i]||(this._scope[i]=[]),u=c.length;return c[u]=r.ref,n.setValue(r,{property:i,itemIndex:u}),n}getValue(e,r){let o=this._values[e];if(o)return o.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,o=>{if(o.scopePath===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return(0,St._)`${e}${o.scopePath}`})}scopeCode(e=this._values,r,o){return this._reduceValues(e,n=>{if(n.value===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return n.value.code},r,o)}_reduceValues(e,r,o={},n){let i=St.nil;for(let s in e){let a=e[s];if(!a)continue;let c=o[s]=o[s]||new Map;a.forEach(u=>{if(c.has(u))return;c.set(u,sf.Started);let l=r(u);if(l){let d=this.opts.es5?Et.varKinds.var:Et.varKinds.const;i=(0,St._)`${i}${d} ${u} = ${l};${this.opts._n}`}else if(l=n?.(u))i=(0,St._)`${i}${l}${this.opts._n}`;else throw new R_(u);c.set(u,sf.Completed)})}return i}};Et.ValueScope=j_});var re=O(se=>{"use strict";Object.defineProperty(se,"__esModule",{value:!0});se.or=se.and=se.not=se.CodeGen=se.operators=se.varKinds=se.ValueScopeName=se.ValueScope=se.Scope=se.Name=se.regexpCode=se.stringify=se.getProperty=se.nil=se.strConcat=se.str=se._=void 0;var de=Xa(),pr=N_(),wn=Xa();Object.defineProperty(se,"_",{enumerable:!0,get:function(){return wn._}});Object.defineProperty(se,"str",{enumerable:!0,get:function(){return wn.str}});Object.defineProperty(se,"strConcat",{enumerable:!0,get:function(){return wn.strConcat}});Object.defineProperty(se,"nil",{enumerable:!0,get:function(){return wn.nil}});Object.defineProperty(se,"getProperty",{enumerable:!0,get:function(){return wn.getProperty}});Object.defineProperty(se,"stringify",{enumerable:!0,get:function(){return wn.stringify}});Object.defineProperty(se,"regexpCode",{enumerable:!0,get:function(){return wn.regexpCode}});Object.defineProperty(se,"Name",{enumerable:!0,get:function(){return wn.Name}});var pf=N_();Object.defineProperty(se,"Scope",{enumerable:!0,get:function(){return pf.Scope}});Object.defineProperty(se,"ValueScope",{enumerable:!0,get:function(){return pf.ValueScope}});Object.defineProperty(se,"ValueScopeName",{enumerable:!0,get:function(){return pf.ValueScopeName}});Object.defineProperty(se,"varKinds",{enumerable:!0,get:function(){return pf.varKinds}});se.operators={GT:new de._Code(">"),GTE:new de._Code(">="),LT:new de._Code("<"),LTE:new de._Code("<="),EQ:new de._Code("==="),NEQ:new de._Code("!=="),NOT:new de._Code("!"),OR:new de._Code("||"),AND:new de._Code("&&"),ADD:new de._Code("+")};var Lr=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},C_=class extends Lr{constructor(e,r,o){super(),this.varKind=e,this.name=r,this.rhs=o}render({es5:e,_n:r}){let o=e?pr.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${o} ${this.name}${n};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=Ci(this.rhs,e,r)),this}get names(){return this.rhs instanceof de._CodeOrName?this.rhs.names:{}}},uf=class extends Lr{constructor(e,r,o){super(),this.lhs=e,this.rhs=r,this.sideEffects=o}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof de.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Ci(this.rhs,e,r),this}get names(){let e=this.lhs instanceof de.Name?{}:{...this.lhs.names};return df(e,this.rhs)}},A_=class extends uf{constructor(e,r,o,n){super(e,o,n),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},D_=class extends Lr{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},M_=class extends Lr{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},U_=class extends Lr{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Z_=class extends Lr{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=Ci(this.code,e,r),this}get names(){return this.code instanceof de._CodeOrName?this.code.names:{}}},Ya=class extends Lr{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,o)=>r+o.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let o=e[r].optimizeNodes();Array.isArray(o)?e.splice(r,1,...o):o?e[r]=o:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:o}=this,n=o.length;for(;n--;){let i=o[n];i.optimizeNames(e,r)||(hM(e,i.names),o.splice(n,1))}return o.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>mo(e,r.names),{})}},Fr=class extends Ya{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},L_=class extends Ya{},Ni=class extends Fr{};Ni.kind="else";var po=class t extends Fr{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let o=r.optimizeNodes();r=this.else=Array.isArray(o)?new Ni(o):o}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(Cz(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var o;if(this.else=(o=this.else)===null||o===void 0?void 0:o.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=Ci(this.condition,e,r),this}get names(){let e=super.names;return df(e,this.condition),this.else&&mo(e,this.else.names),e}};po.kind="if";var fo=class extends Fr{};fo.kind="for";var F_=class extends fo{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=Ci(this.iteration,e,r),this}get names(){return mo(super.names,this.iteration.names)}},q_=class extends fo{constructor(e,r,o,n){super(),this.varKind=e,this.name=r,this.from=o,this.to=n}render(e){let r=e.es5?pr.varKinds.var:this.varKind,{name:o,from:n,to:i}=this;return`for(${r} ${o}=${n}; ${o}<${i}; ${o}++)`+super.render(e)}get names(){let e=df(super.names,this.from);return df(e,this.to)}},lf=class extends fo{constructor(e,r,o,n){super(),this.loop=e,this.varKind=r,this.name=o,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=Ci(this.iterable,e,r),this}get names(){return mo(super.names,this.iterable.names)}},Qa=class extends Fr{constructor(e,r,o){super(),this.name=e,this.args=r,this.async=o}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Qa.kind="func";var ec=class extends Ya{render(e){return"return "+super.render(e)}};ec.kind="return";var V_=class extends Fr{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var o,n;return super.optimizeNames(e,r),(o=this.catch)===null||o===void 0||o.optimizeNames(e,r),(n=this.finally)===null||n===void 0||n.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&mo(e,this.catch.names),this.finally&&mo(e,this.finally.names),e}},tc=class extends Fr{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};tc.kind="catch";var rc=class extends Fr{render(e){return"finally"+super.render(e)}};rc.kind="finally";var H_=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
256
|
+
`:""},this._extScope=e,this._scope=new pr.Scope({parent:e}),this._nodes=[new L_]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let o=this._extScope.value(e,r);return(this._values[o.prefix]||(this._values[o.prefix]=new Set)).add(o),o}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,o,n){let i=this._scope.toName(r);return o!==void 0&&n&&(this._constants[i.str]=o),this._leafNode(new C_(e,i,o)),i}const(e,r,o){return this._def(pr.varKinds.const,e,r,o)}let(e,r,o){return this._def(pr.varKinds.let,e,r,o)}var(e,r,o){return this._def(pr.varKinds.var,e,r,o)}assign(e,r,o){return this._leafNode(new uf(e,r,o))}add(e,r){return this._leafNode(new A_(e,se.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==de.nil&&this._leafNode(new Z_(e)),this}object(...e){let r=["{"];for(let[o,n]of e)r.length>1&&r.push(","),r.push(o),(o!==n||this.opts.es5)&&(r.push(":"),(0,de.addCodeArg)(r,n));return r.push("}"),new de._Code(r)}if(e,r,o){if(this._blockNode(new po(e)),r&&o)this.code(r).else().code(o).endIf();else if(r)this.code(r).endIf();else if(o)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new po(e))}else(){return this._elseNode(new Ni)}endIf(){return this._endBlockNode(po,Ni)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new F_(e),r)}forRange(e,r,o,n,i=this.opts.es5?pr.varKinds.var:pr.varKinds.let){let s=this._scope.toName(e);return this._for(new q_(i,s,r,o),()=>n(s))}forOf(e,r,o,n=pr.varKinds.const){let i=this._scope.toName(e);if(this.opts.es5){let s=r instanceof de.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,de._)`${s}.length`,a=>{this.var(i,(0,de._)`${s}[${a}]`),o(i)})}return this._for(new lf("of",n,i,r),()=>o(i))}forIn(e,r,o,n=this.opts.es5?pr.varKinds.var:pr.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,de._)`Object.keys(${r})`,o);let i=this._scope.toName(e);return this._for(new lf("in",n,i,r),()=>o(i))}endFor(){return this._endBlockNode(fo)}label(e){return this._leafNode(new D_(e))}break(e){return this._leafNode(new M_(e))}return(e){let r=new ec;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(ec)}try(e,r,o){if(!r&&!o)throw new Error('CodeGen: "try" without "catch" and "finally"');let n=new V_;if(this._blockNode(n),this.code(e),r){let i=this.name("e");this._currNode=n.catch=new tc(i),r(i)}return o&&(this._currNode=n.finally=new rc,this.code(o)),this._endBlockNode(tc,rc)}throw(e){return this._leafNode(new U_(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let o=this._nodes.length-r;if(o<0||e!==void 0&&o!==e)throw new Error(`CodeGen: wrong number of nodes: ${o} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=de.nil,o,n){return this._blockNode(new Qa(e,r,o)),n&&this.code(n).endFunc(),this}endFunc(){return this._endBlockNode(Qa)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let o=this._currNode;if(o instanceof e||r&&o instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof po))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};se.CodeGen=H_;function mo(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function df(t,e){return e instanceof de._CodeOrName?mo(t,e.names):t}function Ci(t,e,r){if(t instanceof de.Name)return o(t);if(!n(t))return t;return new de._Code(t._items.reduce((i,s)=>(s instanceof de.Name&&(s=o(s)),s instanceof de._Code?i.push(...s._items):i.push(s),i),[]));function o(i){let s=r[i.str];return s===void 0||e[i.str]!==1?i:(delete e[i.str],s)}function n(i){return i instanceof de._Code&&i._items.some(s=>s instanceof de.Name&&e[s.str]===1&&r[s.str]!==void 0)}}function hM(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function Cz(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,de._)`!${J_(t)}`}se.not=Cz;var gM=Az(se.operators.AND);function yM(...t){return t.reduce(gM)}se.and=yM;var vM=Az(se.operators.OR);function _M(...t){return t.reduce(vM)}se.or=_M;function Az(t){return(e,r)=>e===de.nil?r:r===de.nil?e:(0,de._)`${J_(e)} ${t} ${J_(r)}`}function J_(t){return t instanceof de.Name?t:(0,de._)`(${t})`}});var pe=O(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.checkStrictMode=ae.getErrorPath=ae.Type=ae.useFunc=ae.setEvaluated=ae.evaluatedPropsToName=ae.mergeEvaluated=ae.eachItem=ae.unescapeJsonPointer=ae.escapeJsonPointer=ae.escapeFragment=ae.unescapeFragment=ae.schemaRefOrVal=ae.schemaHasRulesButRef=ae.schemaHasRules=ae.checkUnknownRules=ae.alwaysValidSchema=ae.toHash=void 0;var Te=re(),bM=Xa();function $M(t){let e={};for(let r of t)e[r]=!0;return e}ae.toHash=$M;function xM(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(Uz(t,e),!Zz(e,t.self.RULES.all))}ae.alwaysValidSchema=xM;function Uz(t,e=t.schema){let{opts:r,self:o}=t;if(!r.strictSchema||typeof e=="boolean")return;let n=o.RULES.keywords;for(let i in e)n[i]||qz(t,`unknown keyword: "${i}"`)}ae.checkUnknownRules=Uz;function Zz(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}ae.schemaHasRules=Zz;function kM(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}ae.schemaHasRulesButRef=kM;function wM({topSchemaRef:t,schemaPath:e},r,o,n){if(!n){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Te._)`${r}`}return(0,Te._)`${t}${e}${(0,Te.getProperty)(o)}`}ae.schemaRefOrVal=wM;function SM(t){return Lz(decodeURIComponent(t))}ae.unescapeFragment=SM;function EM(t){return encodeURIComponent(W_(t))}ae.escapeFragment=EM;function W_(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}ae.escapeJsonPointer=W_;function Lz(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}ae.unescapeJsonPointer=Lz;function IM(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}ae.eachItem=IM;function Dz({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:o}){return(n,i,s,a)=>{let c=s===void 0?i:s instanceof Te.Name?(i instanceof Te.Name?t(n,i,s):e(n,i,s),s):i instanceof Te.Name?(e(n,s,i),i):r(i,s);return a===Te.Name&&!(c instanceof Te.Name)?o(n,c):c}}ae.mergeEvaluated={props:Dz({mergeNames:(t,e,r)=>t.if((0,Te._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,Te._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,Te._)`${r} || {}`).code((0,Te._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,Te._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,Te._)`${r} || {}`),G_(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:Fz}),items:Dz({mergeNames:(t,e,r)=>t.if((0,Te._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,Te._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,Te._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,Te._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function Fz(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,Te._)`{}`);return e!==void 0&&G_(t,r,e),r}ae.evaluatedPropsToName=Fz;function G_(t,e,r){Object.keys(r).forEach(o=>t.assign((0,Te._)`${e}${(0,Te.getProperty)(o)}`,!0))}ae.setEvaluated=G_;var Mz={};function zM(t,e){return t.scopeValue("func",{ref:e,code:Mz[e.code]||(Mz[e.code]=new bM._Code(e.code))})}ae.useFunc=zM;var B_;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(B_||(ae.Type=B_={}));function TM(t,e,r){if(t instanceof Te.Name){let o=e===B_.Num;return r?o?(0,Te._)`"[" + ${t} + "]"`:(0,Te._)`"['" + ${t} + "']"`:o?(0,Te._)`"/" + ${t}`:(0,Te._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Te.getProperty)(t).toString():"/"+W_(t)}ae.getErrorPath=TM;function qz(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}ae.checkStrictMode=qz});var qr=O(K_=>{"use strict";Object.defineProperty(K_,"__esModule",{value:!0});var ct=re(),OM={data:new ct.Name("data"),valCxt:new ct.Name("valCxt"),instancePath:new ct.Name("instancePath"),parentData:new ct.Name("parentData"),parentDataProperty:new ct.Name("parentDataProperty"),rootData:new ct.Name("rootData"),dynamicAnchors:new ct.Name("dynamicAnchors"),vErrors:new ct.Name("vErrors"),errors:new ct.Name("errors"),this:new ct.Name("this"),self:new ct.Name("self"),scope:new ct.Name("scope"),json:new ct.Name("json"),jsonPos:new ct.Name("jsonPos"),jsonLen:new ct.Name("jsonLen"),jsonPart:new ct.Name("jsonPart")};K_.default=OM});var nc=O(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.extendErrors=ut.resetErrorsCount=ut.reportExtraError=ut.reportError=ut.keyword$DataError=ut.keywordError=void 0;var fe=re(),ff=pe(),vt=qr();ut.keywordError={message:({keyword:t})=>(0,fe.str)`must pass "${t}" keyword validation`};ut.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,fe.str)`"${t}" keyword must be ${e} ($data)`:(0,fe.str)`"${t}" keyword is invalid ($data)`};function PM(t,e=ut.keywordError,r,o){let{it:n}=t,{gen:i,compositeRule:s,allErrors:a}=n,c=Jz(t,e,r);o??(s||a)?Vz(i,c):Hz(n,(0,fe._)`[${c}]`)}ut.reportError=PM;function RM(t,e=ut.keywordError,r){let{it:o}=t,{gen:n,compositeRule:i,allErrors:s}=o,a=Jz(t,e,r);Vz(n,a),i||s||Hz(o,vt.default.vErrors)}ut.reportExtraError=RM;function jM(t,e){t.assign(vt.default.errors,e),t.if((0,fe._)`${vt.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,fe._)`${vt.default.vErrors}.length`,e),()=>t.assign(vt.default.vErrors,null)))}ut.resetErrorsCount=jM;function NM({gen:t,keyword:e,schemaValue:r,data:o,errsCount:n,it:i}){if(n===void 0)throw new Error("ajv implementation error");let s=t.name("err");t.forRange("i",n,vt.default.errors,a=>{t.const(s,(0,fe._)`${vt.default.vErrors}[${a}]`),t.if((0,fe._)`${s}.instancePath === undefined`,()=>t.assign((0,fe._)`${s}.instancePath`,(0,fe.strConcat)(vt.default.instancePath,i.errorPath))),t.assign((0,fe._)`${s}.schemaPath`,(0,fe.str)`${i.errSchemaPath}/${e}`),i.opts.verbose&&(t.assign((0,fe._)`${s}.schema`,r),t.assign((0,fe._)`${s}.data`,o))})}ut.extendErrors=NM;function Vz(t,e){let r=t.const("err",e);t.if((0,fe._)`${vt.default.vErrors} === null`,()=>t.assign(vt.default.vErrors,(0,fe._)`[${r}]`),(0,fe._)`${vt.default.vErrors}.push(${r})`),t.code((0,fe._)`${vt.default.errors}++`)}function Hz(t,e){let{gen:r,validateName:o,schemaEnv:n}=t;n.$async?r.throw((0,fe._)`new ${t.ValidationError}(${e})`):(r.assign((0,fe._)`${o}.errors`,e),r.return(!1))}var ho={keyword:new fe.Name("keyword"),schemaPath:new fe.Name("schemaPath"),params:new fe.Name("params"),propertyName:new fe.Name("propertyName"),message:new fe.Name("message"),schema:new fe.Name("schema"),parentSchema:new fe.Name("parentSchema")};function Jz(t,e,r){let{createErrors:o}=t.it;return o===!1?(0,fe._)`{}`:CM(t,e,r)}function CM(t,e,r={}){let{gen:o,it:n}=t,i=[AM(n,r),DM(t,r)];return MM(t,e,i),o.object(...i)}function AM({errorPath:t},{instancePath:e}){let r=e?(0,fe.str)`${t}${(0,ff.getErrorPath)(e,ff.Type.Str)}`:t;return[vt.default.instancePath,(0,fe.strConcat)(vt.default.instancePath,r)]}function DM({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:o}){let n=o?e:(0,fe.str)`${e}/${t}`;return r&&(n=(0,fe.str)`${n}${(0,ff.getErrorPath)(r,ff.Type.Str)}`),[ho.schemaPath,n]}function MM(t,{params:e,message:r},o){let{keyword:n,data:i,schemaValue:s,it:a}=t,{opts:c,propertyName:u,topSchemaRef:l,schemaPath:d}=a;o.push([ho.keyword,n],[ho.params,typeof e=="function"?e(t):e||(0,fe._)`{}`]),c.messages&&o.push([ho.message,typeof r=="function"?r(t):r]),c.verbose&&o.push([ho.schema,s],[ho.parentSchema,(0,fe._)`${l}${d}`],[vt.default.data,i]),u&&o.push([ho.propertyName,u])}});var Wz=O(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai.boolOrEmptySchema=Ai.topBoolOrEmptySchema=void 0;var UM=nc(),ZM=re(),LM=qr(),FM={message:"boolean schema is false"};function qM(t){let{gen:e,schema:r,validateName:o}=t;r===!1?Bz(t,!1):typeof r=="object"&&r.$async===!0?e.return(LM.default.data):(e.assign((0,ZM._)`${o}.errors`,null),e.return(!0))}Ai.topBoolOrEmptySchema=qM;function VM(t,e){let{gen:r,schema:o}=t;o===!1?(r.var(e,!1),Bz(t)):r.var(e,!0)}Ai.boolOrEmptySchema=VM;function Bz(t,e){let{gen:r,data:o}=t,n={gen:r,keyword:"false schema",data:o,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,UM.reportError)(n,FM,void 0,e)}});var X_=O(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.getRules=Di.isJSONType=void 0;var HM=["string","number","integer","boolean","null","object","array"],JM=new Set(HM);function BM(t){return typeof t=="string"&&JM.has(t)}Di.isJSONType=BM;function WM(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}Di.getRules=WM});var Y_=O(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.shouldUseRule=Sn.shouldUseGroup=Sn.schemaHasRulesForType=void 0;function GM({schema:t,self:e},r){let o=e.RULES.types[r];return o&&o!==!0&&Gz(t,o)}Sn.schemaHasRulesForType=GM;function Gz(t,e){return e.rules.some(r=>Kz(t,r))}Sn.shouldUseGroup=Gz;function Kz(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(o=>t[o]!==void 0))}Sn.shouldUseRule=Kz});var oc=O(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.reportTypeError=lt.checkDataTypes=lt.checkDataType=lt.coerceAndCheckDataType=lt.getJSONTypes=lt.getSchemaTypes=lt.DataType=void 0;var KM=X_(),XM=Y_(),YM=nc(),te=re(),Xz=pe(),Mi;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Mi||(lt.DataType=Mi={}));function QM(t){let e=Yz(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}lt.getSchemaTypes=QM;function Yz(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(KM.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}lt.getJSONTypes=Yz;function e4(t,e){let{gen:r,data:o,opts:n}=t,i=t4(e,n.coerceTypes),s=e.length>0&&!(i.length===0&&e.length===1&&(0,XM.schemaHasRulesForType)(t,e[0]));if(s){let a=eb(e,o,n.strictNumbers,Mi.Wrong);r.if(a,()=>{i.length?r4(t,e,i):tb(t)})}return s}lt.coerceAndCheckDataType=e4;var Qz=new Set(["string","number","integer","boolean","null"]);function t4(t,e){return e?t.filter(r=>Qz.has(r)||e==="array"&&r==="array"):[]}function r4(t,e,r){let{gen:o,data:n,opts:i}=t,s=o.let("dataType",(0,te._)`typeof ${n}`),a=o.let("coerced",(0,te._)`undefined`);i.coerceTypes==="array"&&o.if((0,te._)`${s} == 'object' && Array.isArray(${n}) && ${n}.length == 1`,()=>o.assign(n,(0,te._)`${n}[0]`).assign(s,(0,te._)`typeof ${n}`).if(eb(e,n,i.strictNumbers),()=>o.assign(a,n))),o.if((0,te._)`${a} !== undefined`);for(let u of r)(Qz.has(u)||u==="array"&&i.coerceTypes==="array")&&c(u);o.else(),tb(t),o.endIf(),o.if((0,te._)`${a} !== undefined`,()=>{o.assign(n,a),n4(t,a)});function c(u){switch(u){case"string":o.elseIf((0,te._)`${s} == "number" || ${s} == "boolean"`).assign(a,(0,te._)`"" + ${n}`).elseIf((0,te._)`${n} === null`).assign(a,(0,te._)`""`);return;case"number":o.elseIf((0,te._)`${s} == "boolean" || ${n} === null
|
|
257
|
+
|| (${s} == "string" && ${n} && ${n} == +${n})`).assign(a,(0,te._)`+${n}`);return;case"integer":o.elseIf((0,te._)`${s} === "boolean" || ${n} === null
|
|
258
|
+
|| (${s} === "string" && ${n} && ${n} == +${n} && !(${n} % 1))`).assign(a,(0,te._)`+${n}`);return;case"boolean":o.elseIf((0,te._)`${n} === "false" || ${n} === 0 || ${n} === null`).assign(a,!1).elseIf((0,te._)`${n} === "true" || ${n} === 1`).assign(a,!0);return;case"null":o.elseIf((0,te._)`${n} === "" || ${n} === 0 || ${n} === false`),o.assign(a,null);return;case"array":o.elseIf((0,te._)`${s} === "string" || ${s} === "number"
|
|
259
|
+
|| ${s} === "boolean" || ${n} === null`).assign(a,(0,te._)`[${n}]`)}}}function n4({gen:t,parentData:e,parentDataProperty:r},o){t.if((0,te._)`${e} !== undefined`,()=>t.assign((0,te._)`${e}[${r}]`,o))}function Q_(t,e,r,o=Mi.Correct){let n=o===Mi.Correct?te.operators.EQ:te.operators.NEQ,i;switch(t){case"null":return(0,te._)`${e} ${n} null`;case"array":i=(0,te._)`Array.isArray(${e})`;break;case"object":i=(0,te._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":i=s((0,te._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":i=s();break;default:return(0,te._)`typeof ${e} ${n} ${t}`}return o===Mi.Correct?i:(0,te.not)(i);function s(a=te.nil){return(0,te.and)((0,te._)`typeof ${e} == "number"`,a,r?(0,te._)`isFinite(${e})`:te.nil)}}lt.checkDataType=Q_;function eb(t,e,r,o){if(t.length===1)return Q_(t[0],e,r,o);let n,i=(0,Xz.toHash)(t);if(i.array&&i.object){let s=(0,te._)`typeof ${e} != "object"`;n=i.null?s:(0,te._)`!${e} || ${s}`,delete i.null,delete i.array,delete i.object}else n=te.nil;i.number&&delete i.integer;for(let s in i)n=(0,te.and)(n,Q_(s,e,r,o));return n}lt.checkDataTypes=eb;var o4={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,te._)`{type: ${t}}`:(0,te._)`{type: ${e}}`};function tb(t){let e=i4(t);(0,YM.reportError)(e,o4)}lt.reportTypeError=tb;function i4(t){let{gen:e,data:r,schema:o}=t,n=(0,Xz.schemaRefOrVal)(t,o,"type");return{gen:e,keyword:"type",data:r,schema:o.type,schemaCode:n,schemaValue:n,parentSchema:o,params:{},it:t}}});var tT=O(mf=>{"use strict";Object.defineProperty(mf,"__esModule",{value:!0});mf.assignDefaults=void 0;var Ui=re(),s4=pe();function a4(t,e){let{properties:r,items:o}=t.schema;if(e==="object"&&r)for(let n in r)eT(t,n,r[n].default);else e==="array"&&Array.isArray(o)&&o.forEach((n,i)=>eT(t,i,n.default))}mf.assignDefaults=a4;function eT(t,e,r){let{gen:o,compositeRule:n,data:i,opts:s}=t;if(r===void 0)return;let a=(0,Ui._)`${i}${(0,Ui.getProperty)(e)}`;if(n){(0,s4.checkStrictMode)(t,`default is ignored for: ${a}`);return}let c=(0,Ui._)`${a} === undefined`;s.useDefaults==="empty"&&(c=(0,Ui._)`${c} || ${a} === null || ${a} === ""`),o.if(c,(0,Ui._)`${a} = ${(0,Ui.stringify)(r)}`)}});var Gt=O(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.validateUnion=Ie.validateArray=Ie.usePattern=Ie.callValidateCode=Ie.schemaProperties=Ie.allSchemaProperties=Ie.noPropertyInData=Ie.propertyInData=Ie.isOwnProperty=Ie.hasPropFunc=Ie.reportMissingProp=Ie.checkMissingProp=Ie.checkReportMissingProp=void 0;var Pe=re(),rb=pe(),En=qr(),c4=pe();function u4(t,e){let{gen:r,data:o,it:n}=t;r.if(ob(r,o,e,n.opts.ownProperties),()=>{t.setParams({missingProperty:(0,Pe._)`${e}`},!0),t.error()})}Ie.checkReportMissingProp=u4;function l4({gen:t,data:e,it:{opts:r}},o,n){return(0,Pe.or)(...o.map(i=>(0,Pe.and)(ob(t,e,i,r.ownProperties),(0,Pe._)`${n} = ${i}`)))}Ie.checkMissingProp=l4;function d4(t,e){t.setParams({missingProperty:e},!0),t.error()}Ie.reportMissingProp=d4;function rT(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Pe._)`Object.prototype.hasOwnProperty`})}Ie.hasPropFunc=rT;function nb(t,e,r){return(0,Pe._)`${rT(t)}.call(${e}, ${r})`}Ie.isOwnProperty=nb;function p4(t,e,r,o){let n=(0,Pe._)`${e}${(0,Pe.getProperty)(r)} !== undefined`;return o?(0,Pe._)`${n} && ${nb(t,e,r)}`:n}Ie.propertyInData=p4;function ob(t,e,r,o){let n=(0,Pe._)`${e}${(0,Pe.getProperty)(r)} === undefined`;return o?(0,Pe.or)(n,(0,Pe.not)(nb(t,e,r))):n}Ie.noPropertyInData=ob;function nT(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}Ie.allSchemaProperties=nT;function f4(t,e){return nT(e).filter(r=>!(0,rb.alwaysValidSchema)(t,e[r]))}Ie.schemaProperties=f4;function m4({schemaCode:t,data:e,it:{gen:r,topSchemaRef:o,schemaPath:n,errorPath:i},it:s},a,c,u){let l=u?(0,Pe._)`${t}, ${e}, ${o}${n}`:e,d=[[En.default.instancePath,(0,Pe.strConcat)(En.default.instancePath,i)],[En.default.parentData,s.parentData],[En.default.parentDataProperty,s.parentDataProperty],[En.default.rootData,En.default.rootData]];s.opts.dynamicRef&&d.push([En.default.dynamicAnchors,En.default.dynamicAnchors]);let p=(0,Pe._)`${l}, ${r.object(...d)}`;return c!==Pe.nil?(0,Pe._)`${a}.call(${c}, ${p})`:(0,Pe._)`${a}(${p})`}Ie.callValidateCode=m4;var h4=(0,Pe._)`new RegExp`;function g4({gen:t,it:{opts:e}},r){let o=e.unicodeRegExp?"u":"",{regExp:n}=e.code,i=n(r,o);return t.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,Pe._)`${n.code==="new RegExp"?h4:(0,c4.useFunc)(t,n)}(${r}, ${o})`})}Ie.usePattern=g4;function y4(t){let{gen:e,data:r,keyword:o,it:n}=t,i=e.name("valid");if(n.allErrors){let a=e.let("valid",!0);return s(()=>e.assign(a,!1)),a}return e.var(i,!0),s(()=>e.break()),i;function s(a){let c=e.const("len",(0,Pe._)`${r}.length`);e.forRange("i",0,c,u=>{t.subschema({keyword:o,dataProp:u,dataPropType:rb.Type.Num},i),e.if((0,Pe.not)(i),a)})}}Ie.validateArray=y4;function v4(t){let{gen:e,schema:r,keyword:o,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,rb.alwaysValidSchema)(n,c))&&!n.opts.unevaluated)return;let s=e.let("valid",!1),a=e.name("_valid");e.block(()=>r.forEach((c,u)=>{let l=t.subschema({keyword:o,schemaProp:u,compositeRule:!0},a);e.assign(s,(0,Pe._)`${s} || ${a}`),t.mergeValidEvaluated(l,a)||e.if((0,Pe.not)(s))})),t.result(s,()=>t.reset(),()=>t.error(!0))}Ie.validateUnion=v4});var sT=O(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.validateKeywordUsage=kr.validSchemaType=kr.funcKeywordCode=kr.macroKeywordCode=void 0;var _t=re(),go=qr(),_4=Gt(),b4=nc();function $4(t,e){let{gen:r,keyword:o,schema:n,parentSchema:i,it:s}=t,a=e.macro.call(s.self,n,i,s),c=iT(r,o,a);s.opts.validateSchema!==!1&&s.self.validateSchema(a,!0);let u=r.name("valid");t.subschema({schema:a,schemaPath:_t.nil,errSchemaPath:`${s.errSchemaPath}/${o}`,topSchemaRef:c,compositeRule:!0},u),t.pass(u,()=>t.error(!0))}kr.macroKeywordCode=$4;function x4(t,e){var r;let{gen:o,keyword:n,schema:i,parentSchema:s,$data:a,it:c}=t;w4(c,e);let u=!a&&e.compile?e.compile.call(c.self,i,s,c):e.validate,l=iT(o,n,u),d=o.let("valid");t.block$data(d,p),t.ok((r=e.valid)!==null&&r!==void 0?r:d);function p(){if(e.errors===!1)y(),e.modifying&&oT(t),x(()=>t.error());else{let v=e.async?f():m();e.modifying&&oT(t),x(()=>k4(t,v))}}function f(){let v=o.let("ruleErrs",null);return o.try(()=>y((0,_t._)`await `),P=>o.assign(d,!1).if((0,_t._)`${P} instanceof ${c.ValidationError}`,()=>o.assign(v,(0,_t._)`${P}.errors`),()=>o.throw(P))),v}function m(){let v=(0,_t._)`${l}.errors`;return o.assign(v,null),y(_t.nil),v}function y(v=e.async?(0,_t._)`await `:_t.nil){let P=c.opts.passContext?go.default.this:go.default.self,_=!("compile"in e&&!a||e.schema===!1);o.assign(d,(0,_t._)`${v}${(0,_4.callValidateCode)(t,l,P,_)}`,e.modifying)}function x(v){var P;o.if((0,_t.not)((P=e.valid)!==null&&P!==void 0?P:d),v)}}kr.funcKeywordCode=x4;function oT(t){let{gen:e,data:r,it:o}=t;e.if(o.parentData,()=>e.assign(r,(0,_t._)`${o.parentData}[${o.parentDataProperty}]`))}function k4(t,e){let{gen:r}=t;r.if((0,_t._)`Array.isArray(${e})`,()=>{r.assign(go.default.vErrors,(0,_t._)`${go.default.vErrors} === null ? ${e} : ${go.default.vErrors}.concat(${e})`).assign(go.default.errors,(0,_t._)`${go.default.vErrors}.length`),(0,b4.extendErrors)(t)},()=>t.error())}function w4({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function iT(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,_t.stringify)(r)})}function S4(t,e,r=!1){return!e.length||e.some(o=>o==="array"?Array.isArray(t):o==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==o||r&&typeof t>"u")}kr.validSchemaType=S4;function E4({schema:t,opts:e,self:r,errSchemaPath:o},n,i){if(Array.isArray(n.keyword)?!n.keyword.includes(i):n.keyword!==i)throw new Error("ajv implementation error");let s=n.dependencies;if(s?.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${i}: ${s.join(",")}`);if(n.validateSchema&&!n.validateSchema(t[i])){let c=`keyword "${i}" value is invalid at path "${o}": `+r.errorsText(n.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}kr.validateKeywordUsage=E4});var cT=O(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.extendSubschemaMode=In.extendSubschemaData=In.getSubschema=void 0;var wr=re(),aT=pe();function I4(t,{keyword:e,schemaProp:r,schema:o,schemaPath:n,errSchemaPath:i,topSchemaRef:s}){if(e!==void 0&&o!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=t.schema[e];return r===void 0?{schema:a,schemaPath:(0,wr._)`${t.schemaPath}${(0,wr.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,wr._)`${t.schemaPath}${(0,wr.getProperty)(e)}${(0,wr.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,aT.escapeFragment)(r)}`}}if(o!==void 0){if(n===void 0||i===void 0||s===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:o,schemaPath:n,topSchemaRef:s,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}In.getSubschema=I4;function z4(t,e,{dataProp:r,dataPropType:o,data:n,dataTypes:i,propertyName:s}){if(n!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(r!==void 0){let{errorPath:u,dataPathArr:l,opts:d}=e,p=a.let("data",(0,wr._)`${e.data}${(0,wr.getProperty)(r)}`,!0);c(p),t.errorPath=(0,wr.str)`${u}${(0,aT.getErrorPath)(r,o,d.jsPropertySyntax)}`,t.parentDataProperty=(0,wr._)`${r}`,t.dataPathArr=[...l,t.parentDataProperty]}if(n!==void 0){let u=n instanceof wr.Name?n:a.let("data",n,!0);c(u),s!==void 0&&(t.propertyName=s)}i&&(t.dataTypes=i);function c(u){t.data=u,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,u]}}In.extendSubschemaData=z4;function T4(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:o,createErrors:n,allErrors:i}){o!==void 0&&(t.compositeRule=o),n!==void 0&&(t.createErrors=n),i!==void 0&&(t.allErrors=i),t.jtdDiscriminator=e,t.jtdMetadata=r}In.extendSubschemaMode=T4});var ib=O((WW,uT)=>{"use strict";uT.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var o,n,i;if(Array.isArray(e)){if(o=e.length,o!=r.length)return!1;for(n=o;n--!==0;)if(!t(e[n],r[n]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(i=Object.keys(e),o=i.length,o!==Object.keys(r).length)return!1;for(n=o;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[n]))return!1;for(n=o;n--!==0;){var s=i[n];if(!t(e[s],r[s]))return!1}return!0}return e!==e&&r!==r}});var dT=O((GW,lT)=>{"use strict";var zn=lT.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var o=typeof r=="function"?r:r.pre||function(){},n=r.post||function(){};hf(e,o,n,t,"",t)};zn.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};zn.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};zn.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};zn.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function hf(t,e,r,o,n,i,s,a,c,u){if(o&&typeof o=="object"&&!Array.isArray(o)){e(o,n,i,s,a,c,u);for(var l in o){var d=o[l];if(Array.isArray(d)){if(l in zn.arrayKeywords)for(var p=0;p<d.length;p++)hf(t,e,r,d[p],n+"/"+l+"/"+p,i,n,l,o,p)}else if(l in zn.propsKeywords){if(d&&typeof d=="object")for(var f in d)hf(t,e,r,d[f],n+"/"+l+"/"+O4(f),i,n,l,o,f)}else(l in zn.keywords||t.allKeys&&!(l in zn.skipKeywords))&&hf(t,e,r,d,n+"/"+l,i,n,l,o)}r(o,n,i,s,a,c,u)}}function O4(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var ic=O(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.getSchemaRefs=It.resolveUrl=It.normalizeId=It._getFullPath=It.getFullPath=It.inlineRef=void 0;var P4=pe(),R4=ib(),j4=dT(),N4=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function C4(t,e=!0){return typeof t=="boolean"?!0:e===!0?!sb(t):e?pT(t)<=e:!1}It.inlineRef=C4;var A4=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function sb(t){for(let e in t){if(A4.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(sb)||typeof r=="object"&&sb(r))return!0}return!1}function pT(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!N4.has(r)&&(typeof t[r]=="object"&&(0,P4.eachItem)(t[r],o=>e+=pT(o)),e===1/0))return 1/0}return e}function fT(t,e="",r){r!==!1&&(e=Zi(e));let o=t.parse(e);return mT(t,o)}It.getFullPath=fT;function mT(t,e){return t.serialize(e).split("#")[0]+"#"}It._getFullPath=mT;var D4=/#\/?$/;function Zi(t){return t?t.replace(D4,""):""}It.normalizeId=Zi;function M4(t,e,r){return r=Zi(r),t.resolve(e,r)}It.resolveUrl=M4;var U4=/^[a-z_][-a-z0-9._]*$/i;function Z4(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:o}=this.opts,n=Zi(t[r]||e),i={"":n},s=fT(o,n,!1),a={},c=new Set;return j4(t,{allKeys:!0},(d,p,f,m)=>{if(m===void 0)return;let y=s+p,x=i[m];typeof d[r]=="string"&&(x=v.call(this,d[r])),P.call(this,d.$anchor),P.call(this,d.$dynamicAnchor),i[p]=x;function v(_){let w=this.opts.uriResolver.resolve;if(_=Zi(x?w(x,_):_),c.has(_))throw l(_);c.add(_);let R=this.refs[_];return typeof R=="string"&&(R=this.refs[R]),typeof R=="object"?u(d,R.schema,_):_!==Zi(y)&&(_[0]==="#"?(u(d,a[_],_),a[_]=d):this.refs[_]=y),_}function P(_){if(typeof _=="string"){if(!U4.test(_))throw new Error(`invalid anchor "${_}"`);v.call(this,`#${_}`)}}}),a;function u(d,p,f){if(p!==void 0&&!R4(d,p))throw l(f)}function l(d){return new Error(`reference "${d}" resolves to more than one schema`)}}It.getSchemaRefs=Z4});var cc=O(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.getData=Tn.KeywordCxt=Tn.validateFunctionCode=void 0;var _T=Wz(),hT=oc(),cb=Y_(),gf=oc(),L4=tT(),ac=sT(),ab=cT(),V=re(),K=qr(),F4=ic(),Vr=pe(),sc=nc();function q4(t){if(xT(t)&&(kT(t),$T(t))){J4(t);return}bT(t,()=>(0,_T.topBoolOrEmptySchema)(t))}Tn.validateFunctionCode=q4;function bT({gen:t,validateName:e,schema:r,schemaEnv:o,opts:n},i){n.code.es5?t.func(e,(0,V._)`${K.default.data}, ${K.default.valCxt}`,o.$async,()=>{t.code((0,V._)`"use strict"; ${gT(r,n)}`),H4(t,n),t.code(i)}):t.func(e,(0,V._)`${K.default.data}, ${V4(n)}`,o.$async,()=>t.code(gT(r,n)).code(i))}function V4(t){return(0,V._)`{${K.default.instancePath}="", ${K.default.parentData}, ${K.default.parentDataProperty}, ${K.default.rootData}=${K.default.data}${t.dynamicRef?(0,V._)`, ${K.default.dynamicAnchors}={}`:V.nil}}={}`}function H4(t,e){t.if(K.default.valCxt,()=>{t.var(K.default.instancePath,(0,V._)`${K.default.valCxt}.${K.default.instancePath}`),t.var(K.default.parentData,(0,V._)`${K.default.valCxt}.${K.default.parentData}`),t.var(K.default.parentDataProperty,(0,V._)`${K.default.valCxt}.${K.default.parentDataProperty}`),t.var(K.default.rootData,(0,V._)`${K.default.valCxt}.${K.default.rootData}`),e.dynamicRef&&t.var(K.default.dynamicAnchors,(0,V._)`${K.default.valCxt}.${K.default.dynamicAnchors}`)},()=>{t.var(K.default.instancePath,(0,V._)`""`),t.var(K.default.parentData,(0,V._)`undefined`),t.var(K.default.parentDataProperty,(0,V._)`undefined`),t.var(K.default.rootData,K.default.data),e.dynamicRef&&t.var(K.default.dynamicAnchors,(0,V._)`{}`)})}function J4(t){let{schema:e,opts:r,gen:o}=t;bT(t,()=>{r.$comment&&e.$comment&&ST(t),X4(t),o.let(K.default.vErrors,null),o.let(K.default.errors,0),r.unevaluated&&B4(t),wT(t),e2(t)})}function B4(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,V._)`${r}.evaluated`),e.if((0,V._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,V._)`${t.evaluated}.props`,(0,V._)`undefined`)),e.if((0,V._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,V._)`${t.evaluated}.items`,(0,V._)`undefined`))}function gT(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,V._)`/*# sourceURL=${r} */`:V.nil}function W4(t,e){if(xT(t)&&(kT(t),$T(t))){G4(t,e);return}(0,_T.boolOrEmptySchema)(t,e)}function $T({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function xT(t){return typeof t.schema!="boolean"}function G4(t,e){let{schema:r,gen:o,opts:n}=t;n.$comment&&r.$comment&&ST(t),Y4(t),Q4(t);let i=o.const("_errs",K.default.errors);wT(t,i),o.var(e,(0,V._)`${i} === ${K.default.errors}`)}function kT(t){(0,Vr.checkUnknownRules)(t),K4(t)}function wT(t,e){if(t.opts.jtd)return yT(t,[],!1,e);let r=(0,hT.getSchemaTypes)(t.schema),o=(0,hT.coerceAndCheckDataType)(t,r);yT(t,r,!o,e)}function K4(t){let{schema:e,errSchemaPath:r,opts:o,self:n}=t;e.$ref&&o.ignoreKeywordsWithRef&&(0,Vr.schemaHasRulesButRef)(e,n.RULES)&&n.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function X4(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Vr.checkStrictMode)(t,"default is ignored in the schema root")}function Y4(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,F4.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function Q4(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function ST({gen:t,schemaEnv:e,schema:r,errSchemaPath:o,opts:n}){let i=r.$comment;if(n.$comment===!0)t.code((0,V._)`${K.default.self}.logger.log(${i})`);else if(typeof n.$comment=="function"){let s=(0,V.str)`${o}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,V._)`${K.default.self}.opts.$comment(${i}, ${s}, ${a}.schema)`)}}function e2(t){let{gen:e,schemaEnv:r,validateName:o,ValidationError:n,opts:i}=t;r.$async?e.if((0,V._)`${K.default.errors} === 0`,()=>e.return(K.default.data),()=>e.throw((0,V._)`new ${n}(${K.default.vErrors})`)):(e.assign((0,V._)`${o}.errors`,K.default.vErrors),i.unevaluated&&t2(t),e.return((0,V._)`${K.default.errors} === 0`))}function t2({gen:t,evaluated:e,props:r,items:o}){r instanceof V.Name&&t.assign((0,V._)`${e}.props`,r),o instanceof V.Name&&t.assign((0,V._)`${e}.items`,o)}function yT(t,e,r,o){let{gen:n,schema:i,data:s,allErrors:a,opts:c,self:u}=t,{RULES:l}=u;if(i.$ref&&(c.ignoreKeywordsWithRef||!(0,Vr.schemaHasRulesButRef)(i,l))){n.block(()=>IT(t,"$ref",l.all.$ref.definition));return}c.jtd||r2(t,e),n.block(()=>{for(let p of l.rules)d(p);d(l.post)});function d(p){(0,cb.shouldUseGroup)(i,p)&&(p.type?(n.if((0,gf.checkDataType)(p.type,s,c.strictNumbers)),vT(t,p),e.length===1&&e[0]===p.type&&r&&(n.else(),(0,gf.reportTypeError)(t)),n.endIf()):vT(t,p),a||n.if((0,V._)`${K.default.errors} === ${o||0}`))}}function vT(t,e){let{gen:r,schema:o,opts:{useDefaults:n}}=t;n&&(0,L4.assignDefaults)(t,e.type),r.block(()=>{for(let i of e.rules)(0,cb.shouldUseRule)(o,i)&&IT(t,i.keyword,i.definition,e.type)})}function r2(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(n2(t,e),t.opts.allowUnionTypes||o2(t,e),i2(t,t.dataTypes))}function n2(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{ET(t.dataTypes,r)||ub(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),a2(t,e)}}function o2(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&ub(t,"use allowUnionTypes to allow union type keyword")}function i2(t,e){let r=t.self.RULES.all;for(let o in r){let n=r[o];if(typeof n=="object"&&(0,cb.shouldUseRule)(t.schema,n)){let{type:i}=n.definition;i.length&&!i.some(s=>s2(e,s))&&ub(t,`missing type "${i.join(",")}" for keyword "${o}"`)}}}function s2(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function ET(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function a2(t,e){let r=[];for(let o of t.dataTypes)ET(e,o)?r.push(o):e.includes("integer")&&o==="number"&&r.push("integer");t.dataTypes=r}function ub(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Vr.checkStrictMode)(t,e,t.opts.strictTypes)}var yf=class{constructor(e,r,o){if((0,ac.validateKeywordUsage)(e,r,o),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=o,this.data=e.data,this.schema=e.schema[o],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Vr.schemaRefOrVal)(e,this.schema,o,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",zT(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,ac.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${o} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",K.default.errors))}result(e,r,o){this.failResult((0,V.not)(e),r,o)}failResult(e,r,o){this.gen.if(e),o?o():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,V.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,V._)`${r} !== undefined && (${(0,V.or)(this.invalid$data(),e)})`)}error(e,r,o){if(r){this.setParams(r),this._error(e,o),this.setParams({});return}this._error(e,o)}_error(e,r){(e?sc.reportExtraError:sc.reportError)(this,this.def.error,r)}$dataError(){(0,sc.reportError)(this,this.def.$dataError||sc.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,sc.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,o=V.nil){this.gen.block(()=>{this.check$data(e,o),r()})}check$data(e=V.nil,r=V.nil){if(!this.$data)return;let{gen:o,schemaCode:n,schemaType:i,def:s}=this;o.if((0,V.or)((0,V._)`${n} === undefined`,r)),e!==V.nil&&o.assign(e,!0),(i.length||s.validateSchema)&&(o.elseIf(this.invalid$data()),this.$dataError(),e!==V.nil&&o.assign(e,!1)),o.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:o,def:n,it:i}=this;return(0,V.or)(s(),a());function s(){if(o.length){if(!(r instanceof V.Name))throw new Error("ajv implementation error");let c=Array.isArray(o)?o:[o];return(0,V._)`${(0,gf.checkDataTypes)(c,r,i.opts.strictNumbers,gf.DataType.Wrong)}`}return V.nil}function a(){if(n.validateSchema){let c=e.scopeValue("validate$data",{ref:n.validateSchema});return(0,V._)`!${c}(${r})`}return V.nil}}subschema(e,r){let o=(0,ab.getSubschema)(this.it,e);(0,ab.extendSubschemaData)(o,this.it,e),(0,ab.extendSubschemaMode)(o,e);let n={...this.it,...o,items:void 0,props:void 0};return W4(n,r),n}mergeEvaluated(e,r){let{it:o,gen:n}=this;o.opts.unevaluated&&(o.props!==!0&&e.props!==void 0&&(o.props=Vr.mergeEvaluated.props(n,e.props,o.props,r)),o.items!==!0&&e.items!==void 0&&(o.items=Vr.mergeEvaluated.items(n,e.items,o.items,r)))}mergeValidEvaluated(e,r){let{it:o,gen:n}=this;if(o.opts.unevaluated&&(o.props!==!0||o.items!==!0))return n.if(r,()=>this.mergeEvaluated(e,V.Name)),!0}};Tn.KeywordCxt=yf;function IT(t,e,r,o){let n=new yf(t,r,e);"code"in r?r.code(n,o):n.$data&&r.validate?(0,ac.funcKeywordCode)(n,r):"macro"in r?(0,ac.macroKeywordCode)(n,r):(r.compile||r.validate)&&(0,ac.funcKeywordCode)(n,r)}var c2=/^\/(?:[^~]|~0|~1)*$/,u2=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function zT(t,{dataLevel:e,dataNames:r,dataPathArr:o}){let n,i;if(t==="")return K.default.rootData;if(t[0]==="/"){if(!c2.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);n=t,i=K.default.rootData}else{let u=u2.exec(t);if(!u)throw new Error(`Invalid JSON-pointer: ${t}`);let l=+u[1];if(n=u[2],n==="#"){if(l>=e)throw new Error(c("property/index",l));return o[e-l]}if(l>e)throw new Error(c("data",l));if(i=r[e-l],!n)return i}let s=i,a=n.split("/");for(let u of a)u&&(i=(0,V._)`${i}${(0,V.getProperty)((0,Vr.unescapeJsonPointer)(u))}`,s=(0,V._)`${s} && ${i}`);return s;function c(u,l){return`Cannot access ${u} ${l} levels up, current level is ${e}`}}Tn.getData=zT});var vf=O(db=>{"use strict";Object.defineProperty(db,"__esModule",{value:!0});var lb=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};db.default=lb});var uc=O(mb=>{"use strict";Object.defineProperty(mb,"__esModule",{value:!0});var pb=ic(),fb=class extends Error{constructor(e,r,o,n){super(n||`can't resolve reference ${o} from id ${r}`),this.missingRef=(0,pb.resolveUrl)(e,r,o),this.missingSchema=(0,pb.normalizeId)((0,pb.getFullPath)(e,this.missingRef))}};mb.default=fb});var bf=O(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.resolveSchema=Kt.getCompilingSchema=Kt.resolveRef=Kt.compileSchema=Kt.SchemaEnv=void 0;var fr=re(),l2=vf(),yo=qr(),mr=ic(),TT=pe(),d2=cc(),Li=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let o;typeof e.schema=="object"&&(o=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,mr.normalizeId)(o?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=o?.$async,this.refs={}}};Kt.SchemaEnv=Li;function gb(t){let e=OT.call(this,t);if(e)return e;let r=(0,mr.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:o,lines:n}=this.opts.code,{ownProperties:i}=this.opts,s=new fr.CodeGen(this.scope,{es5:o,lines:n,ownProperties:i}),a;t.$async&&(a=s.scopeValue("Error",{ref:l2.default,code:(0,fr._)`require("ajv/dist/runtime/validation_error").default`}));let c=s.scopeName("validate");t.validateName=c;let u={gen:s,allErrors:this.opts.allErrors,data:yo.default.data,parentData:yo.default.parentData,parentDataProperty:yo.default.parentDataProperty,dataNames:[yo.default.data],dataPathArr:[fr.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,fr.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:fr.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,fr._)`""`,opts:this.opts,self:this},l;try{this._compilations.add(t),(0,d2.validateFunctionCode)(u),s.optimize(this.opts.code.optimize);let d=s.toString();l=`${s.scopeRefs(yo.default.scope)}return ${d}`,this.opts.code.process&&(l=this.opts.code.process(l,t));let f=new Function(`${yo.default.self}`,`${yo.default.scope}`,l)(this,this.scope.get());if(this.scope.value(c,{ref:f}),f.errors=null,f.schema=t.schema,f.schemaEnv=t,t.$async&&(f.$async=!0),this.opts.code.source===!0&&(f.source={validateName:c,validateCode:d,scopeValues:s._values}),this.opts.unevaluated){let{props:m,items:y}=u;f.evaluated={props:m instanceof fr.Name?void 0:m,items:y instanceof fr.Name?void 0:y,dynamicProps:m instanceof fr.Name,dynamicItems:y instanceof fr.Name},f.source&&(f.source.evaluated=(0,fr.stringify)(f.evaluated))}return t.validate=f,t}catch(d){throw delete t.validate,delete t.validateName,l&&this.logger.error("Error compiling schema, function code:",l),d}finally{this._compilations.delete(t)}}Kt.compileSchema=gb;function p2(t,e,r){var o;r=(0,mr.resolveUrl)(this.opts.uriResolver,e,r);let n=t.refs[r];if(n)return n;let i=h2.call(this,t,r);if(i===void 0){let s=(o=t.localRefs)===null||o===void 0?void 0:o[r],{schemaId:a}=this.opts;s&&(i=new Li({schema:s,schemaId:a,root:t,baseId:e}))}if(i!==void 0)return t.refs[r]=f2.call(this,i)}Kt.resolveRef=p2;function f2(t){return(0,mr.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:gb.call(this,t)}function OT(t){for(let e of this._compilations)if(m2(e,t))return e}Kt.getCompilingSchema=OT;function m2(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function h2(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||_f.call(this,t,e)}function _f(t,e){let r=this.opts.uriResolver.parse(e),o=(0,mr._getFullPath)(this.opts.uriResolver,r),n=(0,mr.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&o===n)return hb.call(this,r,t);let i=(0,mr.normalizeId)(o),s=this.refs[i]||this.schemas[i];if(typeof s=="string"){let a=_f.call(this,t,s);return typeof a?.schema!="object"?void 0:hb.call(this,r,a)}if(typeof s?.schema=="object"){if(s.validate||gb.call(this,s),i===(0,mr.normalizeId)(e)){let{schema:a}=s,{schemaId:c}=this.opts,u=a[c];return u&&(n=(0,mr.resolveUrl)(this.opts.uriResolver,n,u)),new Li({schema:a,schemaId:c,root:t,baseId:n})}return hb.call(this,r,s)}}Kt.resolveSchema=_f;var g2=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function hb(t,{baseId:e,schema:r,root:o}){var n;if(((n=t.fragment)===null||n===void 0?void 0:n[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,TT.unescapeFragment)(a)];if(c===void 0)return;r=c;let u=typeof r=="object"&&r[this.opts.schemaId];!g2.has(a)&&u&&(e=(0,mr.resolveUrl)(this.opts.uriResolver,e,u))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,TT.schemaHasRulesButRef)(r,this.RULES)){let a=(0,mr.resolveUrl)(this.opts.uriResolver,e,r.$ref);i=_f.call(this,o,a)}let{schemaId:s}=this.opts;if(i=i||new Li({schema:r,schemaId:s,root:o,baseId:e}),i.schema!==i.root.schema)return i}});var PT=O((t8,y2)=>{y2.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var vb=O((r8,CT)=>{"use strict";var v2=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),jT=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function yb(t){let e="",r=0,o=0;for(o=0;o<t.length;o++)if(r=t[o].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[o];break}for(o+=1;o<t.length;o++){if(r=t[o].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[o]}return e}var _2=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function RT(t){return t.length=0,!0}function b2(t,e,r){if(t.length){let o=yb(t);if(o!=="")e.push(o);else return r.error=!0,!1;t.length=0}return!0}function $2(t){let e=0,r={error:!1,address:"",zone:""},o=[],n=[],i=!1,s=!1,a=b2;for(let c=0;c<t.length;c++){let u=t[c];if(!(u==="["||u==="]"))if(u===":"){if(i===!0&&(s=!0),!a(n,o,r))break;if(++e>7){r.error=!0;break}c>0&&t[c-1]===":"&&(i=!0),o.push(":");continue}else if(u==="%"){if(!a(n,o,r))break;a=RT}else{n.push(u);continue}}return n.length&&(a===RT?r.zone=n.join(""):s?o.push(n.join("")):o.push(yb(n))),r.address=o.join(""),r}function NT(t){if(x2(t,":")<2)return{host:t,isIPV6:!1};let e=$2(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,o=e.address;return e.zone&&(r+="%"+e.zone,o+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:o}}}function x2(t,e){let r=0;for(let o=0;o<t.length;o++)t[o]===e&&r++;return r}function k2(t){let e=t,r=[],o=-1,n=0;for(;n=e.length;){if(n===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(n===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(n===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((o=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,o)),e=e.slice(o)}return r.join("")}function w2(t,e){let r=e!==!0?escape:unescape;return t.scheme!==void 0&&(t.scheme=r(t.scheme)),t.userinfo!==void 0&&(t.userinfo=r(t.userinfo)),t.host!==void 0&&(t.host=r(t.host)),t.path!==void 0&&(t.path=r(t.path)),t.query!==void 0&&(t.query=r(t.query)),t.fragment!==void 0&&(t.fragment=r(t.fragment)),t}function S2(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!jT(r)){let o=NT(r);o.isIPV6===!0?r=`[${o.escapedHost}]`:r=t.host}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}CT.exports={nonSimpleDomain:_2,recomposeAuthority:S2,normalizeComponentEncoding:w2,removeDotSegments:k2,isIPv4:jT,isUUID:v2,normalizeIPv6:NT,stringArrayToHexStripped:yb}});var ZT=O((n8,UT)=>{"use strict";var{isUUID:E2}=vb(),I2=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,z2=["http","https","ws","wss","urn","urn:uuid"];function T2(t){return z2.indexOf(t)!==-1}function _b(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function AT(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function DT(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function O2(t){return t.secure=_b(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function P2(t){if((t.port===(_b(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function R2(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(I2);if(r){let o=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let n=`${o}:${e.nid||t.nid}`,i=bb(n);t.path=void 0,i&&(t=i.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function j2(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",o=t.nid.toLowerCase(),n=`${r}:${e.nid||o}`,i=bb(n);i&&(t=i.serialize(t,e));let s=t,a=t.nss;return s.path=`${o||e.nid}:${a}`,e.skipEscape=!0,s}function N2(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!E2(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function C2(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var MT={scheme:"http",domainHost:!0,parse:AT,serialize:DT},A2={scheme:"https",domainHost:MT.domainHost,parse:AT,serialize:DT},$f={scheme:"ws",domainHost:!0,parse:O2,serialize:P2},D2={scheme:"wss",domainHost:$f.domainHost,parse:$f.parse,serialize:$f.serialize},M2={scheme:"urn",parse:R2,serialize:j2,skipNormalize:!0},U2={scheme:"urn:uuid",parse:N2,serialize:C2,skipNormalize:!0},xf={http:MT,https:A2,ws:$f,wss:D2,urn:M2,"urn:uuid":U2};Object.setPrototypeOf(xf,null);function bb(t){return t&&(xf[t]||xf[t.toLowerCase()])||void 0}UT.exports={wsIsSecure:_b,SCHEMES:xf,isValidSchemeName:T2,getSchemeHandler:bb}});var qT=O((o8,wf)=>{"use strict";var{normalizeIPv6:Z2,removeDotSegments:lc,recomposeAuthority:L2,normalizeComponentEncoding:kf,isIPv4:F2,nonSimpleDomain:q2}=vb(),{SCHEMES:V2,getSchemeHandler:LT}=ZT();function H2(t,e){return typeof t=="string"?t=Sr(Hr(t,e),e):typeof t=="object"&&(t=Hr(Sr(t,e),e)),t}function J2(t,e,r){let o=r?Object.assign({scheme:"null"},r):{scheme:"null"},n=FT(Hr(t,o),Hr(e,o),o,!0);return o.skipEscape=!0,Sr(n,o)}function FT(t,e,r,o){let n={};return o||(t=Hr(Sr(t,r),r),e=Hr(Sr(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(n.scheme=e.scheme,n.userinfo=e.userinfo,n.host=e.host,n.port=e.port,n.path=lc(e.path||""),n.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(n.userinfo=e.userinfo,n.host=e.host,n.port=e.port,n.path=lc(e.path||""),n.query=e.query):(e.path?(e.path[0]==="/"?n.path=lc(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?n.path="/"+e.path:t.path?n.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:n.path=e.path,n.path=lc(n.path)),n.query=e.query):(n.path=t.path,e.query!==void 0?n.query=e.query:n.query=t.query),n.userinfo=t.userinfo,n.host=t.host,n.port=t.port),n.scheme=t.scheme),n.fragment=e.fragment,n}function B2(t,e,r){return typeof t=="string"?(t=unescape(t),t=Sr(kf(Hr(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=Sr(kf(t,!0),{...r,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=Sr(kf(Hr(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=Sr(kf(e,!0),{...r,skipEscape:!0})),t.toLowerCase()===e.toLowerCase()}function Sr(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},o=Object.assign({},e),n=[],i=LT(o.scheme||r.scheme);i&&i.serialize&&i.serialize(r,o),r.path!==void 0&&(o.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),o.reference!=="suffix"&&r.scheme&&n.push(r.scheme,":");let s=L2(r);if(s!==void 0&&(o.reference!=="suffix"&&n.push("//"),n.push(s),r.path&&r.path[0]!=="/"&&n.push("/")),r.path!==void 0){let a=r.path;!o.absolutePath&&(!i||!i.absolutePath)&&(a=lc(a)),s===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),n.push(a)}return r.query!==void 0&&n.push("?",r.query),r.fragment!==void 0&&n.push("#",r.fragment),n.join("")}var W2=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Hr(t,e){let r=Object.assign({},e),o={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},n=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let i=t.match(W2);if(i){if(o.scheme=i[1],o.userinfo=i[3],o.host=i[4],o.port=parseInt(i[5],10),o.path=i[6]||"",o.query=i[7],o.fragment=i[8],isNaN(o.port)&&(o.port=i[5]),o.host)if(F2(o.host)===!1){let c=Z2(o.host);o.host=c.host.toLowerCase(),n=c.isIPV6}else n=!0;o.scheme===void 0&&o.userinfo===void 0&&o.host===void 0&&o.port===void 0&&o.query===void 0&&!o.path?o.reference="same-document":o.scheme===void 0?o.reference="relative":o.fragment===void 0?o.reference="absolute":o.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==o.reference&&(o.error=o.error||"URI is not a "+r.reference+" reference.");let s=LT(r.scheme||o.scheme);if(!r.unicodeSupport&&(!s||!s.unicodeSupport)&&o.host&&(r.domainHost||s&&s.domainHost)&&n===!1&&q2(o.host))try{o.host=URL.domainToASCII(o.host.toLowerCase())}catch(a){o.error=o.error||"Host's domain name can not be converted to ASCII: "+a}(!s||s&&!s.skipNormalize)&&(t.indexOf("%")!==-1&&(o.scheme!==void 0&&(o.scheme=unescape(o.scheme)),o.host!==void 0&&(o.host=unescape(o.host))),o.path&&(o.path=escape(unescape(o.path))),o.fragment&&(o.fragment=encodeURI(decodeURIComponent(o.fragment)))),s&&s.parse&&s.parse(o,r)}else o.error=o.error||"URI can not be parsed.";return o}var $b={SCHEMES:V2,normalize:H2,resolve:J2,resolveComponent:FT,equal:B2,serialize:Sr,parse:Hr};wf.exports=$b;wf.exports.default=$b;wf.exports.fastUri=$b});var HT=O(xb=>{"use strict";Object.defineProperty(xb,"__esModule",{value:!0});var VT=qT();VT.code='require("ajv/dist/runtime/uri").default';xb.default=VT});var QT=O(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.CodeGen=et.Name=et.nil=et.stringify=et.str=et._=et.KeywordCxt=void 0;var G2=cc();Object.defineProperty(et,"KeywordCxt",{enumerable:!0,get:function(){return G2.KeywordCxt}});var Fi=re();Object.defineProperty(et,"_",{enumerable:!0,get:function(){return Fi._}});Object.defineProperty(et,"str",{enumerable:!0,get:function(){return Fi.str}});Object.defineProperty(et,"stringify",{enumerable:!0,get:function(){return Fi.stringify}});Object.defineProperty(et,"nil",{enumerable:!0,get:function(){return Fi.nil}});Object.defineProperty(et,"Name",{enumerable:!0,get:function(){return Fi.Name}});Object.defineProperty(et,"CodeGen",{enumerable:!0,get:function(){return Fi.CodeGen}});var K2=vf(),KT=uc(),X2=X_(),dc=bf(),Y2=re(),pc=ic(),Sf=oc(),wb=pe(),JT=PT(),Q2=HT(),XT=(t,e)=>new RegExp(t,e);XT.code="new RegExp";var eU=["removeAdditional","useDefaults","coerceTypes"],tU=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),rU={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},nU={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},BT=200;function oU(t){var e,r,o,n,i,s,a,c,u,l,d,p,f,m,y,x,v,P,_,w,R,G,be,Oe,Tt;let ne=t.strict,Fe=(e=t.code)===null||e===void 0?void 0:e.optimize,Yt=Fe===!0||Fe===void 0?1:Fe||0,Tr=(o=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&o!==void 0?o:XT,Xi=(n=t.uriResolver)!==null&&n!==void 0?n:Q2.default;return{strictSchema:(s=(i=t.strictSchema)!==null&&i!==void 0?i:ne)!==null&&s!==void 0?s:!0,strictNumbers:(c=(a=t.strictNumbers)!==null&&a!==void 0?a:ne)!==null&&c!==void 0?c:!0,strictTypes:(l=(u=t.strictTypes)!==null&&u!==void 0?u:ne)!==null&&l!==void 0?l:"log",strictTuples:(p=(d=t.strictTuples)!==null&&d!==void 0?d:ne)!==null&&p!==void 0?p:"log",strictRequired:(m=(f=t.strictRequired)!==null&&f!==void 0?f:ne)!==null&&m!==void 0?m:!1,code:t.code?{...t.code,optimize:Yt,regExp:Tr}:{optimize:Yt,regExp:Tr},loopRequired:(y=t.loopRequired)!==null&&y!==void 0?y:BT,loopEnum:(x=t.loopEnum)!==null&&x!==void 0?x:BT,meta:(v=t.meta)!==null&&v!==void 0?v:!0,messages:(P=t.messages)!==null&&P!==void 0?P:!0,inlineRefs:(_=t.inlineRefs)!==null&&_!==void 0?_:!0,schemaId:(w=t.schemaId)!==null&&w!==void 0?w:"$id",addUsedSchema:(R=t.addUsedSchema)!==null&&R!==void 0?R:!0,validateSchema:(G=t.validateSchema)!==null&&G!==void 0?G:!0,validateFormats:(be=t.validateFormats)!==null&&be!==void 0?be:!0,unicodeRegExp:(Oe=t.unicodeRegExp)!==null&&Oe!==void 0?Oe:!0,int32range:(Tt=t.int32range)!==null&&Tt!==void 0?Tt:!0,uriResolver:Xi}}var fc=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...oU(e)};let{es5:r,lines:o}=this.opts.code;this.scope=new Y2.ValueScope({scope:{},prefixes:tU,es5:r,lines:o}),this.logger=lU(e.logger);let n=e.validateFormats;e.validateFormats=!1,this.RULES=(0,X2.getRules)(),WT.call(this,rU,e,"NOT SUPPORTED"),WT.call(this,nU,e,"DEPRECATED","warn"),this._metaOpts=cU.call(this),e.formats&&sU.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&aU.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),iU.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:o}=this.opts,n=JT;o==="id"&&(n={...JT},n.id=n.$id,delete n.$id),r&&e&&this.addMetaSchema(n,n[o],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let o;if(typeof e=="string"){if(o=this.getSchema(e),!o)throw new Error(`no schema with key or ref "${e}"`)}else o=this.compile(e);let n=o(r);return"$async"in o||(this.errors=o.errors),n}compile(e,r){let o=this._addSchema(e,r);return o.validate||this._compileSchemaEnv(o)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:o}=this.opts;return n.call(this,e,r);async function n(l,d){await i.call(this,l.$schema);let p=this._addSchema(l,d);return p.validate||s.call(this,p)}async function i(l){l&&!this.getSchema(l)&&await n.call(this,{$ref:l},!0)}async function s(l){try{return this._compileSchemaEnv(l)}catch(d){if(!(d instanceof KT.default))throw d;return a.call(this,d),await c.call(this,d.missingSchema),s.call(this,l)}}function a({missingSchema:l,missingRef:d}){if(this.refs[l])throw new Error(`AnySchema ${l} is loaded but ${d} cannot be resolved`)}async function c(l){let d=await u.call(this,l);this.refs[l]||await i.call(this,d.$schema),this.refs[l]||this.addSchema(d,l,r)}async function u(l){let d=this._loading[l];if(d)return d;try{return await(this._loading[l]=o(l))}finally{delete this._loading[l]}}}addSchema(e,r,o,n=this.opts.validateSchema){if(Array.isArray(e)){for(let s of e)this.addSchema(s,void 0,o,n);return this}let i;if(typeof e=="object"){let{schemaId:s}=this.opts;if(i=e[s],i!==void 0&&typeof i!="string")throw new Error(`schema ${s} must be string`)}return r=(0,pc.normalizeId)(r||i),this._checkUnique(r),this.schemas[r]=this._addSchema(e,o,r,n,!0),this}addMetaSchema(e,r,o=this.opts.validateSchema){return this.addSchema(e,r,!0,o),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let o;if(o=e.$schema,o!==void 0&&typeof o!="string")throw new Error("$schema must be a string");if(o=o||this.opts.defaultMeta||this.defaultMeta(),!o)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let n=this.validate(o,e);if(!n&&r){let i="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(i);else throw new Error(i)}return n}getSchema(e){let r;for(;typeof(r=GT.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:o}=this.opts,n=new dc.SchemaEnv({schema:{},schemaId:o});if(r=dc.resolveSchema.call(this,n,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=GT.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let o=e[this.opts.schemaId];return o&&(o=(0,pc.normalizeId)(o),delete this.schemas[o],delete this.refs[o]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let o;if(typeof e=="string")o=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=o);else if(typeof e=="object"&&r===void 0){if(r=e,o=r.keyword,Array.isArray(o)&&!o.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(pU.call(this,o,r),!r)return(0,wb.eachItem)(o,i=>kb.call(this,i)),this;mU.call(this,r);let n={...r,type:(0,Sf.getJSONTypes)(r.type),schemaType:(0,Sf.getJSONTypes)(r.schemaType)};return(0,wb.eachItem)(o,n.type.length===0?i=>kb.call(this,i,n):i=>n.type.forEach(s=>kb.call(this,i,n,s))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let o of r.rules){let n=o.rules.findIndex(i=>i.keyword===e);n>=0&&o.rules.splice(n,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:o="data"}={}){return!e||e.length===0?"No errors":e.map(n=>`${o}${n.instancePath} ${n.message}`).reduce((n,i)=>n+r+i)}$dataMetaSchema(e,r){let o=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let n of r){let i=n.split("/").slice(1),s=e;for(let a of i)s=s[a];for(let a in o){let c=o[a];if(typeof c!="object")continue;let{$data:u}=c.definition,l=s[a];u&&l&&(s[a]=YT(l))}}return e}_removeAllSchemas(e,r){for(let o in e){let n=e[o];(!r||r.test(o))&&(typeof n=="string"?delete e[o]:n&&!n.meta&&(this._cache.delete(n.schema),delete e[o]))}}_addSchema(e,r,o,n=this.opts.validateSchema,i=this.opts.addUsedSchema){let s,{schemaId:a}=this.opts;if(typeof e=="object")s=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(e);if(c!==void 0)return c;o=(0,pc.normalizeId)(s||o);let u=pc.getSchemaRefs.call(this,e,o);return c=new dc.SchemaEnv({schema:e,schemaId:a,meta:r,baseId:o,localRefs:u}),this._cache.set(c.schema,c),i&&!o.startsWith("#")&&(o&&this._checkUnique(o),this.refs[o]=c),n&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):dc.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{dc.compileSchema.call(this,e)}finally{this.opts=r}}};fc.ValidationError=K2.default;fc.MissingRefError=KT.default;et.default=fc;function WT(t,e,r,o="error"){for(let n in t){let i=n;i in e&&this.logger[o](`${r}: option ${n}. ${t[i]}`)}}function GT(t){return t=(0,pc.normalizeId)(t),this.schemas[t]||this.refs[t]}function iU(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function sU(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function aU(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function cU(){let t={...this.opts};for(let e of eU)delete t[e];return t}var uU={log(){},warn(){},error(){}};function lU(t){if(t===!1)return uU;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var dU=/^[a-z_$][a-z0-9_$:-]*$/i;function pU(t,e){let{RULES:r}=this;if((0,wb.eachItem)(t,o=>{if(r.keywords[o])throw new Error(`Keyword ${o} is already defined`);if(!dU.test(o))throw new Error(`Keyword ${o} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function kb(t,e,r){var o;let n=e?.post;if(r&&n)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,s=n?i.post:i.rules.find(({type:c})=>c===r);if(s||(s={type:r,rules:[]},i.rules.push(s)),i.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,Sf.getJSONTypes)(e.type),schemaType:(0,Sf.getJSONTypes)(e.schemaType)}};e.before?fU.call(this,s,a,e.before):s.rules.push(a),i.all[t]=a,(o=e.implements)===null||o===void 0||o.forEach(c=>this.addKeyword(c))}function fU(t,e,r){let o=t.rules.findIndex(n=>n.keyword===r);o>=0?t.rules.splice(o,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function mU(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=YT(e)),t.validateSchema=this.compile(e,!0))}var hU={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function YT(t){return{anyOf:[t,hU]}}});var eO=O(Sb=>{"use strict";Object.defineProperty(Sb,"__esModule",{value:!0});var gU={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Sb.default=gU});var oO=O(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.callRef=vo.getValidate=void 0;var yU=uc(),tO=Gt(),zt=re(),qi=qr(),rO=bf(),Ef=pe(),vU={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:o}=t,{baseId:n,schemaEnv:i,validateName:s,opts:a,self:c}=o,{root:u}=i;if((r==="#"||r==="#/")&&n===u.baseId)return d();let l=rO.resolveRef.call(c,u,n,r);if(l===void 0)throw new yU.default(o.opts.uriResolver,n,r);if(l instanceof rO.SchemaEnv)return p(l);return f(l);function d(){if(i===u)return If(t,s,i,i.$async);let m=e.scopeValue("root",{ref:u});return If(t,(0,zt._)`${m}.validate`,u,u.$async)}function p(m){let y=nO(t,m);If(t,y,m,m.$async)}function f(m){let y=e.scopeValue("schema",a.code.source===!0?{ref:m,code:(0,zt.stringify)(m)}:{ref:m}),x=e.name("valid"),v=t.subschema({schema:m,dataTypes:[],schemaPath:zt.nil,topSchemaRef:y,errSchemaPath:r},x);t.mergeEvaluated(v),t.ok(x)}}};function nO(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,zt._)`${r.scopeValue("wrapper",{ref:e})}.validate`}vo.getValidate=nO;function If(t,e,r,o){let{gen:n,it:i}=t,{allErrors:s,schemaEnv:a,opts:c}=i,u=c.passContext?qi.default.this:zt.nil;o?l():d();function l(){if(!a.$async)throw new Error("async schema referenced by sync schema");let m=n.let("valid");n.try(()=>{n.code((0,zt._)`await ${(0,tO.callValidateCode)(t,e,u)}`),f(e),s||n.assign(m,!0)},y=>{n.if((0,zt._)`!(${y} instanceof ${i.ValidationError})`,()=>n.throw(y)),p(y),s||n.assign(m,!1)}),t.ok(m)}function d(){t.result((0,tO.callValidateCode)(t,e,u),()=>f(e),()=>p(e))}function p(m){let y=(0,zt._)`${m}.errors`;n.assign(qi.default.vErrors,(0,zt._)`${qi.default.vErrors} === null ? ${y} : ${qi.default.vErrors}.concat(${y})`),n.assign(qi.default.errors,(0,zt._)`${qi.default.vErrors}.length`)}function f(m){var y;if(!i.opts.unevaluated)return;let x=(y=r?.validate)===null||y===void 0?void 0:y.evaluated;if(i.props!==!0)if(x&&!x.dynamicProps)x.props!==void 0&&(i.props=Ef.mergeEvaluated.props(n,x.props,i.props));else{let v=n.var("props",(0,zt._)`${m}.evaluated.props`);i.props=Ef.mergeEvaluated.props(n,v,i.props,zt.Name)}if(i.items!==!0)if(x&&!x.dynamicItems)x.items!==void 0&&(i.items=Ef.mergeEvaluated.items(n,x.items,i.items));else{let v=n.var("items",(0,zt._)`${m}.evaluated.items`);i.items=Ef.mergeEvaluated.items(n,v,i.items,zt.Name)}}}vo.callRef=If;vo.default=vU});var iO=O(Eb=>{"use strict";Object.defineProperty(Eb,"__esModule",{value:!0});var _U=eO(),bU=oO(),$U=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",_U.default,bU.default];Eb.default=$U});var sO=O(Ib=>{"use strict";Object.defineProperty(Ib,"__esModule",{value:!0});var zf=re(),On=zf.operators,Tf={maximum:{okStr:"<=",ok:On.LTE,fail:On.GT},minimum:{okStr:">=",ok:On.GTE,fail:On.LT},exclusiveMaximum:{okStr:"<",ok:On.LT,fail:On.GTE},exclusiveMinimum:{okStr:">",ok:On.GT,fail:On.LTE}},xU={message:({keyword:t,schemaCode:e})=>(0,zf.str)`must be ${Tf[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,zf._)`{comparison: ${Tf[t].okStr}, limit: ${e}}`},kU={keyword:Object.keys(Tf),type:"number",schemaType:"number",$data:!0,error:xU,code(t){let{keyword:e,data:r,schemaCode:o}=t;t.fail$data((0,zf._)`${r} ${Tf[e].fail} ${o} || isNaN(${r})`)}};Ib.default=kU});var aO=O(zb=>{"use strict";Object.defineProperty(zb,"__esModule",{value:!0});var mc=re(),wU={message:({schemaCode:t})=>(0,mc.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,mc._)`{multipleOf: ${t}}`},SU={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:wU,code(t){let{gen:e,data:r,schemaCode:o,it:n}=t,i=n.opts.multipleOfPrecision,s=e.let("res"),a=i?(0,mc._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${i}`:(0,mc._)`${s} !== parseInt(${s})`;t.fail$data((0,mc._)`(${o} === 0 || (${s} = ${r}/${o}, ${a}))`)}};zb.default=SU});var uO=O(Tb=>{"use strict";Object.defineProperty(Tb,"__esModule",{value:!0});function cO(t){let e=t.length,r=0,o=0,n;for(;o<e;)r++,n=t.charCodeAt(o++),n>=55296&&n<=56319&&o<e&&(n=t.charCodeAt(o),(n&64512)===56320&&o++);return r}Tb.default=cO;cO.code='require("ajv/dist/runtime/ucs2length").default'});var lO=O(Ob=>{"use strict";Object.defineProperty(Ob,"__esModule",{value:!0});var _o=re(),EU=pe(),IU=uO(),zU={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,_o.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,_o._)`{limit: ${t}}`},TU={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:zU,code(t){let{keyword:e,data:r,schemaCode:o,it:n}=t,i=e==="maxLength"?_o.operators.GT:_o.operators.LT,s=n.opts.unicode===!1?(0,_o._)`${r}.length`:(0,_o._)`${(0,EU.useFunc)(t.gen,IU.default)}(${r})`;t.fail$data((0,_o._)`${s} ${i} ${o}`)}};Ob.default=TU});var dO=O(Pb=>{"use strict";Object.defineProperty(Pb,"__esModule",{value:!0});var OU=Gt(),PU=pe(),Vi=re(),RU={message:({schemaCode:t})=>(0,Vi.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Vi._)`{pattern: ${t}}`},jU={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:RU,code(t){let{gen:e,data:r,$data:o,schema:n,schemaCode:i,it:s}=t,a=s.opts.unicodeRegExp?"u":"";if(o){let{regExp:c}=s.opts.code,u=c.code==="new RegExp"?(0,Vi._)`new RegExp`:(0,PU.useFunc)(e,c),l=e.let("valid");e.try(()=>e.assign(l,(0,Vi._)`${u}(${i}, ${a}).test(${r})`),()=>e.assign(l,!1)),t.fail$data((0,Vi._)`!${l}`)}else{let c=(0,OU.usePattern)(t,n);t.fail$data((0,Vi._)`!${c}.test(${r})`)}}};Pb.default=jU});var pO=O(Rb=>{"use strict";Object.defineProperty(Rb,"__esModule",{value:!0});var hc=re(),NU={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,hc.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,hc._)`{limit: ${t}}`},CU={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:NU,code(t){let{keyword:e,data:r,schemaCode:o}=t,n=e==="maxProperties"?hc.operators.GT:hc.operators.LT;t.fail$data((0,hc._)`Object.keys(${r}).length ${n} ${o}`)}};Rb.default=CU});var fO=O(jb=>{"use strict";Object.defineProperty(jb,"__esModule",{value:!0});var gc=Gt(),yc=re(),AU=pe(),DU={message:({params:{missingProperty:t}})=>(0,yc.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,yc._)`{missingProperty: ${t}}`},MU={keyword:"required",type:"object",schemaType:"array",$data:!0,error:DU,code(t){let{gen:e,schema:r,schemaCode:o,data:n,$data:i,it:s}=t,{opts:a}=s;if(!i&&r.length===0)return;let c=r.length>=a.loopRequired;if(s.allErrors?u():l(),a.strictRequired){let f=t.parentSchema.properties,{definedProperties:m}=t.it;for(let y of r)if(f?.[y]===void 0&&!m.has(y)){let x=s.schemaEnv.baseId+s.errSchemaPath,v=`required property "${y}" is not defined at "${x}" (strictRequired)`;(0,AU.checkStrictMode)(s,v,s.opts.strictRequired)}}function u(){if(c||i)t.block$data(yc.nil,d);else for(let f of r)(0,gc.checkReportMissingProp)(t,f)}function l(){let f=e.let("missing");if(c||i){let m=e.let("valid",!0);t.block$data(m,()=>p(f,m)),t.ok(m)}else e.if((0,gc.checkMissingProp)(t,r,f)),(0,gc.reportMissingProp)(t,f),e.else()}function d(){e.forOf("prop",o,f=>{t.setParams({missingProperty:f}),e.if((0,gc.noPropertyInData)(e,n,f,a.ownProperties),()=>t.error())})}function p(f,m){t.setParams({missingProperty:f}),e.forOf(f,o,()=>{e.assign(m,(0,gc.propertyInData)(e,n,f,a.ownProperties)),e.if((0,yc.not)(m),()=>{t.error(),e.break()})},yc.nil)}}};jb.default=MU});var mO=O(Nb=>{"use strict";Object.defineProperty(Nb,"__esModule",{value:!0});var vc=re(),UU={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,vc.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,vc._)`{limit: ${t}}`},ZU={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:UU,code(t){let{keyword:e,data:r,schemaCode:o}=t,n=e==="maxItems"?vc.operators.GT:vc.operators.LT;t.fail$data((0,vc._)`${r}.length ${n} ${o}`)}};Nb.default=ZU});var Of=O(Cb=>{"use strict";Object.defineProperty(Cb,"__esModule",{value:!0});var hO=ib();hO.code='require("ajv/dist/runtime/equal").default';Cb.default=hO});var gO=O(Db=>{"use strict";Object.defineProperty(Db,"__esModule",{value:!0});var Ab=oc(),tt=re(),LU=pe(),FU=Of(),qU={message:({params:{i:t,j:e}})=>(0,tt.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,tt._)`{i: ${t}, j: ${e}}`},VU={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:qU,code(t){let{gen:e,data:r,$data:o,schema:n,parentSchema:i,schemaCode:s,it:a}=t;if(!o&&!n)return;let c=e.let("valid"),u=i.items?(0,Ab.getSchemaTypes)(i.items):[];t.block$data(c,l,(0,tt._)`${s} === false`),t.ok(c);function l(){let m=e.let("i",(0,tt._)`${r}.length`),y=e.let("j");t.setParams({i:m,j:y}),e.assign(c,!0),e.if((0,tt._)`${m} > 1`,()=>(d()?p:f)(m,y))}function d(){return u.length>0&&!u.some(m=>m==="object"||m==="array")}function p(m,y){let x=e.name("item"),v=(0,Ab.checkDataTypes)(u,x,a.opts.strictNumbers,Ab.DataType.Wrong),P=e.const("indices",(0,tt._)`{}`);e.for((0,tt._)`;${m}--;`,()=>{e.let(x,(0,tt._)`${r}[${m}]`),e.if(v,(0,tt._)`continue`),u.length>1&&e.if((0,tt._)`typeof ${x} == "string"`,(0,tt._)`${x} += "_"`),e.if((0,tt._)`typeof ${P}[${x}] == "number"`,()=>{e.assign(y,(0,tt._)`${P}[${x}]`),t.error(),e.assign(c,!1).break()}).code((0,tt._)`${P}[${x}] = ${m}`)})}function f(m,y){let x=(0,LU.useFunc)(e,FU.default),v=e.name("outer");e.label(v).for((0,tt._)`;${m}--;`,()=>e.for((0,tt._)`${y} = ${m}; ${y}--;`,()=>e.if((0,tt._)`${x}(${r}[${m}], ${r}[${y}])`,()=>{t.error(),e.assign(c,!1).break(v)})))}}};Db.default=VU});var yO=O(Ub=>{"use strict";Object.defineProperty(Ub,"__esModule",{value:!0});var Mb=re(),HU=pe(),JU=Of(),BU={message:"must be equal to constant",params:({schemaCode:t})=>(0,Mb._)`{allowedValue: ${t}}`},WU={keyword:"const",$data:!0,error:BU,code(t){let{gen:e,data:r,$data:o,schemaCode:n,schema:i}=t;o||i&&typeof i=="object"?t.fail$data((0,Mb._)`!${(0,HU.useFunc)(e,JU.default)}(${r}, ${n})`):t.fail((0,Mb._)`${i} !== ${r}`)}};Ub.default=WU});var vO=O(Zb=>{"use strict";Object.defineProperty(Zb,"__esModule",{value:!0});var _c=re(),GU=pe(),KU=Of(),XU={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,_c._)`{allowedValues: ${t}}`},YU={keyword:"enum",schemaType:"array",$data:!0,error:XU,code(t){let{gen:e,data:r,$data:o,schema:n,schemaCode:i,it:s}=t;if(!o&&n.length===0)throw new Error("enum must have non-empty array");let a=n.length>=s.opts.loopEnum,c,u=()=>c??(c=(0,GU.useFunc)(e,KU.default)),l;if(a||o)l=e.let("valid"),t.block$data(l,d);else{if(!Array.isArray(n))throw new Error("ajv implementation error");let f=e.const("vSchema",i);l=(0,_c.or)(...n.map((m,y)=>p(f,y)))}t.pass(l);function d(){e.assign(l,!1),e.forOf("v",i,f=>e.if((0,_c._)`${u()}(${r}, ${f})`,()=>e.assign(l,!0).break()))}function p(f,m){let y=n[m];return typeof y=="object"&&y!==null?(0,_c._)`${u()}(${r}, ${f}[${m}])`:(0,_c._)`${r} === ${y}`}}};Zb.default=YU});var _O=O(Lb=>{"use strict";Object.defineProperty(Lb,"__esModule",{value:!0});var QU=sO(),e6=aO(),t6=lO(),r6=dO(),n6=pO(),o6=fO(),i6=mO(),s6=gO(),a6=yO(),c6=vO(),u6=[QU.default,e6.default,t6.default,r6.default,n6.default,o6.default,i6.default,s6.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},a6.default,c6.default];Lb.default=u6});var qb=O(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});bc.validateAdditionalItems=void 0;var bo=re(),Fb=pe(),l6={message:({params:{len:t}})=>(0,bo.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,bo._)`{limit: ${t}}`},d6={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:l6,code(t){let{parentSchema:e,it:r}=t,{items:o}=e;if(!Array.isArray(o)){(0,Fb.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}bO(t,o)}};function bO(t,e){let{gen:r,schema:o,data:n,keyword:i,it:s}=t;s.items=!0;let a=r.const("len",(0,bo._)`${n}.length`);if(o===!1)t.setParams({len:e.length}),t.pass((0,bo._)`${a} <= ${e.length}`);else if(typeof o=="object"&&!(0,Fb.alwaysValidSchema)(s,o)){let u=r.var("valid",(0,bo._)`${a} <= ${e.length}`);r.if((0,bo.not)(u),()=>c(u)),t.ok(u)}function c(u){r.forRange("i",e.length,a,l=>{t.subschema({keyword:i,dataProp:l,dataPropType:Fb.Type.Num},u),s.allErrors||r.if((0,bo.not)(u),()=>r.break())})}}bc.validateAdditionalItems=bO;bc.default=d6});var Vb=O($c=>{"use strict";Object.defineProperty($c,"__esModule",{value:!0});$c.validateTuple=void 0;var $O=re(),Pf=pe(),p6=Gt(),f6={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return xO(t,"additionalItems",e);r.items=!0,!(0,Pf.alwaysValidSchema)(r,e)&&t.ok((0,p6.validateArray)(t))}};function xO(t,e,r=t.schema){let{gen:o,parentSchema:n,data:i,keyword:s,it:a}=t;l(n),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=Pf.mergeEvaluated.items(o,r.length,a.items));let c=o.name("valid"),u=o.const("len",(0,$O._)`${i}.length`);r.forEach((d,p)=>{(0,Pf.alwaysValidSchema)(a,d)||(o.if((0,$O._)`${u} > ${p}`,()=>t.subschema({keyword:s,schemaProp:p,dataProp:p},c)),t.ok(c))});function l(d){let{opts:p,errSchemaPath:f}=a,m=r.length,y=m===d.minItems&&(m===d.maxItems||d[e]===!1);if(p.strictTuples&&!y){let x=`"${s}" is ${m}-tuple, but minItems or maxItems/${e} are not specified or different at path "${f}"`;(0,Pf.checkStrictMode)(a,x,p.strictTuples)}}}$c.validateTuple=xO;$c.default=f6});var kO=O(Hb=>{"use strict";Object.defineProperty(Hb,"__esModule",{value:!0});var m6=Vb(),h6={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,m6.validateTuple)(t,"items")};Hb.default=h6});var SO=O(Jb=>{"use strict";Object.defineProperty(Jb,"__esModule",{value:!0});var wO=re(),g6=pe(),y6=Gt(),v6=qb(),_6={message:({params:{len:t}})=>(0,wO.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,wO._)`{limit: ${t}}`},b6={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:_6,code(t){let{schema:e,parentSchema:r,it:o}=t,{prefixItems:n}=r;o.items=!0,!(0,g6.alwaysValidSchema)(o,e)&&(n?(0,v6.validateAdditionalItems)(t,n):t.ok((0,y6.validateArray)(t)))}};Jb.default=b6});var EO=O(Bb=>{"use strict";Object.defineProperty(Bb,"__esModule",{value:!0});var Xt=re(),Rf=pe(),$6={message:({params:{min:t,max:e}})=>e===void 0?(0,Xt.str)`must contain at least ${t} valid item(s)`:(0,Xt.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,Xt._)`{minContains: ${t}}`:(0,Xt._)`{minContains: ${t}, maxContains: ${e}}`},x6={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:$6,code(t){let{gen:e,schema:r,parentSchema:o,data:n,it:i}=t,s,a,{minContains:c,maxContains:u}=o;i.opts.next?(s=c===void 0?1:c,a=u):s=1;let l=e.const("len",(0,Xt._)`${n}.length`);if(t.setParams({min:s,max:a}),a===void 0&&s===0){(0,Rf.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&s>a){(0,Rf.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,Rf.alwaysValidSchema)(i,r)){let y=(0,Xt._)`${l} >= ${s}`;a!==void 0&&(y=(0,Xt._)`${y} && ${l} <= ${a}`),t.pass(y);return}i.items=!0;let d=e.name("valid");a===void 0&&s===1?f(d,()=>e.if(d,()=>e.break())):s===0?(e.let(d,!0),a!==void 0&&e.if((0,Xt._)`${n}.length > 0`,p)):(e.let(d,!1),p()),t.result(d,()=>t.reset());function p(){let y=e.name("_valid"),x=e.let("count",0);f(y,()=>e.if(y,()=>m(x)))}function f(y,x){e.forRange("i",0,l,v=>{t.subschema({keyword:"contains",dataProp:v,dataPropType:Rf.Type.Num,compositeRule:!0},y),x()})}function m(y){e.code((0,Xt._)`${y}++`),a===void 0?e.if((0,Xt._)`${y} >= ${s}`,()=>e.assign(d,!0).break()):(e.if((0,Xt._)`${y} > ${a}`,()=>e.assign(d,!1).break()),s===1?e.assign(d,!0):e.if((0,Xt._)`${y} >= ${s}`,()=>e.assign(d,!0)))}}};Bb.default=x6});var TO=O(Er=>{"use strict";Object.defineProperty(Er,"__esModule",{value:!0});Er.validateSchemaDeps=Er.validatePropertyDeps=Er.error=void 0;var Wb=re(),k6=pe(),xc=Gt();Er.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let o=e===1?"property":"properties";return(0,Wb.str)`must have ${o} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:o}})=>(0,Wb._)`{property: ${t},
|
|
260
|
+
missingProperty: ${o},
|
|
261
|
+
depsCount: ${e},
|
|
262
|
+
deps: ${r}}`};var w6={keyword:"dependencies",type:"object",schemaType:"object",error:Er.error,code(t){let[e,r]=S6(t);IO(t,e),zO(t,r)}};function S6({schema:t}){let e={},r={};for(let o in t){if(o==="__proto__")continue;let n=Array.isArray(t[o])?e:r;n[o]=t[o]}return[e,r]}function IO(t,e=t.schema){let{gen:r,data:o,it:n}=t;if(Object.keys(e).length===0)return;let i=r.let("missing");for(let s in e){let a=e[s];if(a.length===0)continue;let c=(0,xc.propertyInData)(r,o,s,n.opts.ownProperties);t.setParams({property:s,depsCount:a.length,deps:a.join(", ")}),n.allErrors?r.if(c,()=>{for(let u of a)(0,xc.checkReportMissingProp)(t,u)}):(r.if((0,Wb._)`${c} && (${(0,xc.checkMissingProp)(t,a,i)})`),(0,xc.reportMissingProp)(t,i),r.else())}}Er.validatePropertyDeps=IO;function zO(t,e=t.schema){let{gen:r,data:o,keyword:n,it:i}=t,s=r.name("valid");for(let a in e)(0,k6.alwaysValidSchema)(i,e[a])||(r.if((0,xc.propertyInData)(r,o,a,i.opts.ownProperties),()=>{let c=t.subschema({keyword:n,schemaProp:a},s);t.mergeValidEvaluated(c,s)},()=>r.var(s,!0)),t.ok(s))}Er.validateSchemaDeps=zO;Er.default=w6});var PO=O(Gb=>{"use strict";Object.defineProperty(Gb,"__esModule",{value:!0});var OO=re(),E6=pe(),I6={message:"property name must be valid",params:({params:t})=>(0,OO._)`{propertyName: ${t.propertyName}}`},z6={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:I6,code(t){let{gen:e,schema:r,data:o,it:n}=t;if((0,E6.alwaysValidSchema)(n,r))return;let i=e.name("valid");e.forIn("key",o,s=>{t.setParams({propertyName:s}),t.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},i),e.if((0,OO.not)(i),()=>{t.error(!0),n.allErrors||e.break()})}),t.ok(i)}};Gb.default=z6});var Xb=O(Kb=>{"use strict";Object.defineProperty(Kb,"__esModule",{value:!0});var jf=Gt(),hr=re(),T6=qr(),Nf=pe(),O6={message:"must NOT have additional properties",params:({params:t})=>(0,hr._)`{additionalProperty: ${t.additionalProperty}}`},P6={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:O6,code(t){let{gen:e,schema:r,parentSchema:o,data:n,errsCount:i,it:s}=t;if(!i)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=s;if(s.props=!0,c.removeAdditional!=="all"&&(0,Nf.alwaysValidSchema)(s,r))return;let u=(0,jf.allSchemaProperties)(o.properties),l=(0,jf.allSchemaProperties)(o.patternProperties);d(),t.ok((0,hr._)`${i} === ${T6.default.errors}`);function d(){e.forIn("key",n,x=>{!u.length&&!l.length?m(x):e.if(p(x),()=>m(x))})}function p(x){let v;if(u.length>8){let P=(0,Nf.schemaRefOrVal)(s,o.properties,"properties");v=(0,jf.isOwnProperty)(e,P,x)}else u.length?v=(0,hr.or)(...u.map(P=>(0,hr._)`${x} === ${P}`)):v=hr.nil;return l.length&&(v=(0,hr.or)(v,...l.map(P=>(0,hr._)`${(0,jf.usePattern)(t,P)}.test(${x})`))),(0,hr.not)(v)}function f(x){e.code((0,hr._)`delete ${n}[${x}]`)}function m(x){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){f(x);return}if(r===!1){t.setParams({additionalProperty:x}),t.error(),a||e.break();return}if(typeof r=="object"&&!(0,Nf.alwaysValidSchema)(s,r)){let v=e.name("valid");c.removeAdditional==="failing"?(y(x,v,!1),e.if((0,hr.not)(v),()=>{t.reset(),f(x)})):(y(x,v),a||e.if((0,hr.not)(v),()=>e.break()))}}function y(x,v,P){let _={keyword:"additionalProperties",dataProp:x,dataPropType:Nf.Type.Str};P===!1&&Object.assign(_,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(_,v)}}};Kb.default=P6});var NO=O(Qb=>{"use strict";Object.defineProperty(Qb,"__esModule",{value:!0});var R6=cc(),RO=Gt(),Yb=pe(),jO=Xb(),j6={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:o,data:n,it:i}=t;i.opts.removeAdditional==="all"&&o.additionalProperties===void 0&&jO.default.code(new R6.KeywordCxt(i,jO.default,"additionalProperties"));let s=(0,RO.allSchemaProperties)(r);for(let d of s)i.definedProperties.add(d);i.opts.unevaluated&&s.length&&i.props!==!0&&(i.props=Yb.mergeEvaluated.props(e,(0,Yb.toHash)(s),i.props));let a=s.filter(d=>!(0,Yb.alwaysValidSchema)(i,r[d]));if(a.length===0)return;let c=e.name("valid");for(let d of a)u(d)?l(d):(e.if((0,RO.propertyInData)(e,n,d,i.opts.ownProperties)),l(d),i.allErrors||e.else().var(c,!0),e.endIf()),t.it.definedProperties.add(d),t.ok(c);function u(d){return i.opts.useDefaults&&!i.compositeRule&&r[d].default!==void 0}function l(d){t.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};Qb.default=j6});var MO=O(e$=>{"use strict";Object.defineProperty(e$,"__esModule",{value:!0});var CO=Gt(),Cf=re(),AO=pe(),DO=pe(),N6={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:o,parentSchema:n,it:i}=t,{opts:s}=i,a=(0,CO.allSchemaProperties)(r),c=a.filter(y=>(0,AO.alwaysValidSchema)(i,r[y]));if(a.length===0||c.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;let u=s.strictSchema&&!s.allowMatchingProperties&&n.properties,l=e.name("valid");i.props!==!0&&!(i.props instanceof Cf.Name)&&(i.props=(0,DO.evaluatedPropsToName)(e,i.props));let{props:d}=i;p();function p(){for(let y of a)u&&f(y),i.allErrors?m(y):(e.var(l,!0),m(y),e.if(l))}function f(y){for(let x in u)new RegExp(y).test(x)&&(0,AO.checkStrictMode)(i,`property ${x} matches pattern ${y} (use allowMatchingProperties)`)}function m(y){e.forIn("key",o,x=>{e.if((0,Cf._)`${(0,CO.usePattern)(t,y)}.test(${x})`,()=>{let v=c.includes(y);v||t.subschema({keyword:"patternProperties",schemaProp:y,dataProp:x,dataPropType:DO.Type.Str},l),i.opts.unevaluated&&d!==!0?e.assign((0,Cf._)`${d}[${x}]`,!0):!v&&!i.allErrors&&e.if((0,Cf.not)(l),()=>e.break())})})}}};e$.default=N6});var UO=O(t$=>{"use strict";Object.defineProperty(t$,"__esModule",{value:!0});var C6=pe(),A6={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:o}=t;if((0,C6.alwaysValidSchema)(o,r)){t.fail();return}let n=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},n),t.failResult(n,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};t$.default=A6});var ZO=O(r$=>{"use strict";Object.defineProperty(r$,"__esModule",{value:!0});var D6=Gt(),M6={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:D6.validateUnion,error:{message:"must match a schema in anyOf"}};r$.default=M6});var LO=O(n$=>{"use strict";Object.defineProperty(n$,"__esModule",{value:!0});var Af=re(),U6=pe(),Z6={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,Af._)`{passingSchemas: ${t.passing}}`},L6={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Z6,code(t){let{gen:e,schema:r,parentSchema:o,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(n.opts.discriminator&&o.discriminator)return;let i=r,s=e.let("valid",!1),a=e.let("passing",null),c=e.name("_valid");t.setParams({passing:a}),e.block(u),t.result(s,()=>t.reset(),()=>t.error(!0));function u(){i.forEach((l,d)=>{let p;(0,U6.alwaysValidSchema)(n,l)?e.var(c,!0):p=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,Af._)`${c} && ${s}`).assign(s,!1).assign(a,(0,Af._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(s,!0),e.assign(a,d),p&&t.mergeEvaluated(p,Af.Name)})})}}};n$.default=L6});var FO=O(o$=>{"use strict";Object.defineProperty(o$,"__esModule",{value:!0});var F6=pe(),q6={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:o}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let n=e.name("valid");r.forEach((i,s)=>{if((0,F6.alwaysValidSchema)(o,i))return;let a=t.subschema({keyword:"allOf",schemaProp:s},n);t.ok(n),t.mergeEvaluated(a)})}};o$.default=q6});var HO=O(i$=>{"use strict";Object.defineProperty(i$,"__esModule",{value:!0});var Df=re(),VO=pe(),V6={message:({params:t})=>(0,Df.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,Df._)`{failingKeyword: ${t.ifClause}}`},H6={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:V6,code(t){let{gen:e,parentSchema:r,it:o}=t;r.then===void 0&&r.else===void 0&&(0,VO.checkStrictMode)(o,'"if" without "then" and "else" is ignored');let n=qO(o,"then"),i=qO(o,"else");if(!n&&!i)return;let s=e.let("valid",!0),a=e.name("_valid");if(c(),t.reset(),n&&i){let l=e.let("ifClause");t.setParams({ifClause:l}),e.if(a,u("then",l),u("else",l))}else n?e.if(a,u("then")):e.if((0,Df.not)(a),u("else"));t.pass(s,()=>t.error(!0));function c(){let l=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(l)}function u(l,d){return()=>{let p=t.subschema({keyword:l},a);e.assign(s,a),t.mergeValidEvaluated(p,s),d?e.assign(d,(0,Df._)`${l}`):t.setParams({ifClause:l})}}}};function qO(t,e){let r=t.schema[e];return r!==void 0&&!(0,VO.alwaysValidSchema)(t,r)}i$.default=H6});var JO=O(s$=>{"use strict";Object.defineProperty(s$,"__esModule",{value:!0});var J6=pe(),B6={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,J6.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};s$.default=B6});var BO=O(a$=>{"use strict";Object.defineProperty(a$,"__esModule",{value:!0});var W6=qb(),G6=kO(),K6=Vb(),X6=SO(),Y6=EO(),Q6=TO(),eZ=PO(),tZ=Xb(),rZ=NO(),nZ=MO(),oZ=UO(),iZ=ZO(),sZ=LO(),aZ=FO(),cZ=HO(),uZ=JO();function lZ(t=!1){let e=[oZ.default,iZ.default,sZ.default,aZ.default,cZ.default,uZ.default,eZ.default,tZ.default,Q6.default,rZ.default,nZ.default];return t?e.push(G6.default,X6.default):e.push(W6.default,K6.default),e.push(Y6.default),e}a$.default=lZ});var WO=O(c$=>{"use strict";Object.defineProperty(c$,"__esModule",{value:!0});var Ze=re(),dZ={message:({schemaCode:t})=>(0,Ze.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,Ze._)`{format: ${t}}`},pZ={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:dZ,code(t,e){let{gen:r,data:o,$data:n,schema:i,schemaCode:s,it:a}=t,{opts:c,errSchemaPath:u,schemaEnv:l,self:d}=a;if(!c.validateFormats)return;n?p():f();function p(){let m=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),y=r.const("fDef",(0,Ze._)`${m}[${s}]`),x=r.let("fType"),v=r.let("format");r.if((0,Ze._)`typeof ${y} == "object" && !(${y} instanceof RegExp)`,()=>r.assign(x,(0,Ze._)`${y}.type || "string"`).assign(v,(0,Ze._)`${y}.validate`),()=>r.assign(x,(0,Ze._)`"string"`).assign(v,y)),t.fail$data((0,Ze.or)(P(),_()));function P(){return c.strictSchema===!1?Ze.nil:(0,Ze._)`${s} && !${v}`}function _(){let w=l.$async?(0,Ze._)`(${y}.async ? await ${v}(${o}) : ${v}(${o}))`:(0,Ze._)`${v}(${o})`,R=(0,Ze._)`(typeof ${v} == "function" ? ${w} : ${v}.test(${o}))`;return(0,Ze._)`${v} && ${v} !== true && ${x} === ${e} && !${R}`}}function f(){let m=d.formats[i];if(!m){P();return}if(m===!0)return;let[y,x,v]=_(m);y===e&&t.pass(w());function P(){if(c.strictSchema===!1){d.logger.warn(R());return}throw new Error(R());function R(){return`unknown format "${i}" ignored in schema at path "${u}"`}}function _(R){let G=R instanceof RegExp?(0,Ze.regexpCode)(R):c.code.formats?(0,Ze._)`${c.code.formats}${(0,Ze.getProperty)(i)}`:void 0,be=r.scopeValue("formats",{key:i,ref:R,code:G});return typeof R=="object"&&!(R instanceof RegExp)?[R.type||"string",R.validate,(0,Ze._)`${be}.validate`]:["string",R,be]}function w(){if(typeof m=="object"&&!(m instanceof RegExp)&&m.async){if(!l.$async)throw new Error("async format in sync schema");return(0,Ze._)`await ${v}(${o})`}return typeof x=="function"?(0,Ze._)`${v}(${o})`:(0,Ze._)`${v}.test(${o})`}}}};c$.default=pZ});var GO=O(u$=>{"use strict";Object.defineProperty(u$,"__esModule",{value:!0});var fZ=WO(),mZ=[fZ.default];u$.default=mZ});var KO=O(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});Hi.contentVocabulary=Hi.metadataVocabulary=void 0;Hi.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Hi.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var YO=O(l$=>{"use strict";Object.defineProperty(l$,"__esModule",{value:!0});var hZ=iO(),gZ=_O(),yZ=BO(),vZ=GO(),XO=KO(),_Z=[hZ.default,gZ.default,(0,yZ.default)(),vZ.default,XO.metadataVocabulary,XO.contentVocabulary];l$.default=_Z});var eP=O(Mf=>{"use strict";Object.defineProperty(Mf,"__esModule",{value:!0});Mf.DiscrError=void 0;var QO;(function(t){t.Tag="tag",t.Mapping="mapping"})(QO||(Mf.DiscrError=QO={}))});var rP=O(p$=>{"use strict";Object.defineProperty(p$,"__esModule",{value:!0});var Ji=re(),d$=eP(),tP=bf(),bZ=uc(),$Z=pe(),xZ={message:({params:{discrError:t,tagName:e}})=>t===d$.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Ji._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},kZ={keyword:"discriminator",type:"object",schemaType:"object",error:xZ,code(t){let{gen:e,data:r,schema:o,parentSchema:n,it:i}=t,{oneOf:s}=n;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=o.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(o.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",!1),u=e.const("tag",(0,Ji._)`${r}${(0,Ji.getProperty)(a)}`);e.if((0,Ji._)`typeof ${u} == "string"`,()=>l(),()=>t.error(!1,{discrError:d$.DiscrError.Tag,tag:u,tagName:a})),t.ok(c);function l(){let f=p();e.if(!1);for(let m in f)e.elseIf((0,Ji._)`${u} === ${m}`),e.assign(c,d(f[m]));e.else(),t.error(!1,{discrError:d$.DiscrError.Mapping,tag:u,tagName:a}),e.endIf()}function d(f){let m=e.name("valid"),y=t.subschema({keyword:"oneOf",schemaProp:f},m);return t.mergeEvaluated(y,Ji.Name),m}function p(){var f;let m={},y=v(n),x=!0;for(let w=0;w<s.length;w++){let R=s[w];if(R?.$ref&&!(0,$Z.schemaHasRulesButRef)(R,i.self.RULES)){let be=R.$ref;if(R=tP.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,be),R instanceof tP.SchemaEnv&&(R=R.schema),R===void 0)throw new bZ.default(i.opts.uriResolver,i.baseId,be)}let G=(f=R?.properties)===null||f===void 0?void 0:f[a];if(typeof G!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);x=x&&(y||v(R)),P(G,w)}if(!x)throw new Error(`discriminator: "${a}" must be required`);return m;function v({required:w}){return Array.isArray(w)&&w.includes(a)}function P(w,R){if(w.const)_(w.const,R);else if(w.enum)for(let G of w.enum)_(G,R);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function _(w,R){if(typeof w!="string"||w in m)throw new Error(`discriminator: "${a}" values must be unique strings`);m[w]=R}}}};p$.default=kZ});var nP=O((J8,wZ)=>{wZ.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var m$=O((Re,f$)=>{"use strict";Object.defineProperty(Re,"__esModule",{value:!0});Re.MissingRefError=Re.ValidationError=Re.CodeGen=Re.Name=Re.nil=Re.stringify=Re.str=Re._=Re.KeywordCxt=Re.Ajv=void 0;var SZ=QT(),EZ=YO(),IZ=rP(),oP=nP(),zZ=["/properties"],Uf="http://json-schema.org/draft-07/schema",Bi=class extends SZ.default{_addVocabularies(){super._addVocabularies(),EZ.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(IZ.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(oP,zZ):oP;this.addMetaSchema(e,Uf,!1),this.refs["http://json-schema.org/schema"]=Uf}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Uf)?Uf:void 0)}};Re.Ajv=Bi;f$.exports=Re=Bi;f$.exports.Ajv=Bi;Object.defineProperty(Re,"__esModule",{value:!0});Re.default=Bi;var TZ=cc();Object.defineProperty(Re,"KeywordCxt",{enumerable:!0,get:function(){return TZ.KeywordCxt}});var Wi=re();Object.defineProperty(Re,"_",{enumerable:!0,get:function(){return Wi._}});Object.defineProperty(Re,"str",{enumerable:!0,get:function(){return Wi.str}});Object.defineProperty(Re,"stringify",{enumerable:!0,get:function(){return Wi.stringify}});Object.defineProperty(Re,"nil",{enumerable:!0,get:function(){return Wi.nil}});Object.defineProperty(Re,"Name",{enumerable:!0,get:function(){return Wi.Name}});Object.defineProperty(Re,"CodeGen",{enumerable:!0,get:function(){return Wi.CodeGen}});var OZ=vf();Object.defineProperty(Re,"ValidationError",{enumerable:!0,get:function(){return OZ.default}});var PZ=uc();Object.defineProperty(Re,"MissingRefError",{enumerable:!0,get:function(){return PZ.default}})});var pP=O(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.formatNames=zr.fastFormats=zr.fullFormats=void 0;function Ir(t,e){return{validate:t,compare:e}}zr.fullFormats={date:Ir(cP,v$),time:Ir(g$(!0),_$),"date-time":Ir(iP(!0),lP),"iso-time":Ir(g$(),uP),"iso-date-time":Ir(iP(),dP),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:DZ,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:VZ,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:MZ,int32:{type:"number",validate:LZ},int64:{type:"number",validate:FZ},float:{type:"number",validate:aP},double:{type:"number",validate:aP},password:!0,binary:!0};zr.fastFormats={...zr.fullFormats,date:Ir(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,v$),time:Ir(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,_$),"date-time":Ir(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,lP),"iso-time":Ir(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,uP),"iso-date-time":Ir(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,dP),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};zr.formatNames=Object.keys(zr.fullFormats);function RZ(t){return t%4===0&&(t%100!==0||t%400===0)}var jZ=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,NZ=[0,31,28,31,30,31,30,31,31,30,31,30,31];function cP(t){let e=jZ.exec(t);if(!e)return!1;let r=+e[1],o=+e[2],n=+e[3];return o>=1&&o<=12&&n>=1&&n<=(o===2&&RZ(r)?29:NZ[o])}function v$(t,e){if(t&&e)return t>e?1:t<e?-1:0}var h$=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function g$(t){return function(r){let o=h$.exec(r);if(!o)return!1;let n=+o[1],i=+o[2],s=+o[3],a=o[4],c=o[5]==="-"?-1:1,u=+(o[6]||0),l=+(o[7]||0);if(u>23||l>59||t&&!a)return!1;if(n<=23&&i<=59&&s<60)return!0;let d=i-l*c,p=n-u*c-(d<0?1:0);return(p===23||p===-1)&&(d===59||d===-1)&&s<61}}function _$(t,e){if(!(t&&e))return;let r=new Date("2020-01-01T"+t).valueOf(),o=new Date("2020-01-01T"+e).valueOf();if(r&&o)return r-o}function uP(t,e){if(!(t&&e))return;let r=h$.exec(t),o=h$.exec(e);if(r&&o)return t=r[1]+r[2]+r[3],e=o[1]+o[2]+o[3],t>e?1:t<e?-1:0}var y$=/t|\s/i;function iP(t){let e=g$(t);return function(o){let n=o.split(y$);return n.length===2&&cP(n[0])&&e(n[1])}}function lP(t,e){if(!(t&&e))return;let r=new Date(t).valueOf(),o=new Date(e).valueOf();if(r&&o)return r-o}function dP(t,e){if(!(t&&e))return;let[r,o]=t.split(y$),[n,i]=e.split(y$),s=v$(r,n);if(s!==void 0)return s||_$(o,i)}var CZ=/\/|:/,AZ=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function DZ(t){return CZ.test(t)&&AZ.test(t)}var sP=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function MZ(t){return sP.lastIndex=0,sP.test(t)}var UZ=-(2**31),ZZ=2**31-1;function LZ(t){return Number.isInteger(t)&&t<=ZZ&&t>=UZ}function FZ(t){return Number.isInteger(t)}function aP(){return!0}var qZ=/[^\\]\\Z/;function VZ(t){if(qZ.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var fP=O(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.formatLimitDefinition=void 0;var HZ=m$(),gr=re(),Pn=gr.operators,Zf={formatMaximum:{okStr:"<=",ok:Pn.LTE,fail:Pn.GT},formatMinimum:{okStr:">=",ok:Pn.GTE,fail:Pn.LT},formatExclusiveMaximum:{okStr:"<",ok:Pn.LT,fail:Pn.GTE},formatExclusiveMinimum:{okStr:">",ok:Pn.GT,fail:Pn.LTE}},JZ={message:({keyword:t,schemaCode:e})=>(0,gr.str)`should be ${Zf[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,gr._)`{comparison: ${Zf[t].okStr}, limit: ${e}}`};Gi.formatLimitDefinition={keyword:Object.keys(Zf),type:"string",schemaType:"string",$data:!0,error:JZ,code(t){let{gen:e,data:r,schemaCode:o,keyword:n,it:i}=t,{opts:s,self:a}=i;if(!s.validateFormats)return;let c=new HZ.KeywordCxt(i,a.RULES.all.format.definition,"format");c.$data?u():l();function u(){let p=e.scopeValue("formats",{ref:a.formats,code:s.code.formats}),f=e.const("fmt",(0,gr._)`${p}[${c.schemaCode}]`);t.fail$data((0,gr.or)((0,gr._)`typeof ${f} != "object"`,(0,gr._)`${f} instanceof RegExp`,(0,gr._)`typeof ${f}.compare != "function"`,d(f)))}function l(){let p=c.schema,f=a.formats[p];if(!f||f===!0)return;if(typeof f!="object"||f instanceof RegExp||typeof f.compare!="function")throw new Error(`"${n}": format "${p}" does not define "compare" function`);let m=e.scopeValue("formats",{key:p,ref:f,code:s.code.formats?(0,gr._)`${s.code.formats}${(0,gr.getProperty)(p)}`:void 0});t.fail$data(d(m))}function d(p){return(0,gr._)`${p}.compare(${r}, ${o}) ${Zf[n].fail} 0`}},dependencies:["format"]};var BZ=t=>(t.addKeyword(Gi.formatLimitDefinition),t);Gi.default=BZ});var yP=O((kc,gP)=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0});var Ki=pP(),WZ=fP(),b$=re(),mP=new b$.Name("fullFormats"),GZ=new b$.Name("fastFormats"),$$=(t,e={keywords:!0})=>{if(Array.isArray(e))return hP(t,e,Ki.fullFormats,mP),t;let[r,o]=e.mode==="fast"?[Ki.fastFormats,GZ]:[Ki.fullFormats,mP],n=e.formats||Ki.formatNames;return hP(t,n,r,o),e.keywords&&(0,WZ.default)(t),t};$$.get=(t,e="full")=>{let o=(e==="fast"?Ki.fastFormats:Ki.fullFormats)[t];if(!o)throw new Error(`Unknown format "${t}"`);return o};function hP(t,e,r,o){var n,i;(n=(i=t.opts.code).formats)!==null&&n!==void 0||(i.formats=(0,b$._)`require("ajv-formats/dist/formats").${o}`);for(let s of e)t.addFormat(s,r[s])}gP.exports=kc=$$;Object.defineProperty(kc,"__esModule",{value:!0});kc.default=$$});function KZ(){let t=new vP.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,_P.default)(t),t}var vP,_P,Lf,bP=g(()=>{vP=C(m$(),1),_P=C(yP(),1);Lf=class{constructor(e){this._ajv=e??KZ()}getValidator(e){let r="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return o=>r(o)?{valid:!0,data:o,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}}});var Ff,$P=g(()=>{ji();Ff=class{constructor(e){this._server=e}requestStream(e,r,o){return this._server.requestStream(e,r,o)}createMessageStream(e,r){let o=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!o?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let n=e.messages[e.messages.length-1],i=Array.isArray(n.content)?n.content:[n.content],s=i.some(l=>l.type==="tool_result"),a=e.messages.length>1?e.messages[e.messages.length-2]:void 0,c=a?Array.isArray(a.content)?a.content:[a.content]:[],u=c.some(l=>l.type==="tool_use");if(s){if(i.some(l=>l.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!u)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(u){let l=new Set(c.filter(p=>p.type==="tool_use").map(p=>p.id)),d=new Set(i.filter(p=>p.type==="tool_result").map(p=>p.toolUseId));if(l.size!==d.size||![...l].every(p=>d.has(p)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:e},Ba,r)}elicitInputStream(e,r){let o=this._server.getClientCapabilities(),n=e.mode??"form";switch(n){case"url":{if(!o?.elicitation?.url)throw new Error("Client does not support url elicitation.");break}case"form":{if(!o?.elicitation?.form)throw new Error("Client does not support form elicitation.");break}}let i=n==="form"&&e.mode===void 0?{...e,mode:"form"}:e;return this.requestStream({method:"elicitation/create",params:i},Ri,r)}async getTask(e,r){return this._server.getTask({taskId:e},r)}async getTaskResult(e,r,o){return this._server.getTaskResult({taskId:e},r,o)}async listTasks(e,r){return this._server.listTasks(e?{cursor:e}:void 0,r)}async cancelTask(e,r){return this._server.cancelTask({taskId:e},r)}}});function xP(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${e})`);break;default:break}}function kP(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}var wP=g(()=>{});var qf,SP=g(()=>{Rz();ji();bP();$a();$P();wP();qf=class extends of{constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Ja.options.map((o,n)=>[o,n])),this.isMessageIgnored=(o,n)=>{let i=this._loggingLevels.get(n);return i?this.LOG_LEVEL_SEVERITY.get(o)<this.LOG_LEVEL_SEVERITY.get(i):!1},this._capabilities=r?.capabilities??{},this._instructions=r?.instructions,this._jsonSchemaValidator=r?.jsonSchemaValidator??new Lf,this.setRequestHandler(Av,o=>this._oninitialize(o)),this.setNotificationHandler(Dv,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(Vv,async(o,n)=>{let i=n.sessionId||n.requestInfo?.headers["mcp-session-id"]||void 0,{level:s}=o.params,a=Ja.safeParse(s);return a.success&&this._loggingLevels.set(i,a.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new Ff(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Pz(this._capabilities,e)}setRequestHandler(e,r){let n=_n(e)?.method;if(!n)throw new Error("Schema is missing a method literal");let i;if(Vt(n)){let a=n;i=a._zod?.def?.value??a.value}else{let a=n;i=a._def?.value??a.value}if(typeof i!="string")throw new Error("Schema method literal must be a string");if(i==="tools/call"){let a=async(c,u)=>{let l=vn(Pi,c);if(!l.success){let m=l.error instanceof Error?l.error.message:String(l.error);throw new F(H.InvalidParams,`Invalid tools/call request: ${m}`)}let{params:d}=l.data,p=await Promise.resolve(r(c,u));if(d.task){let m=vn(Ti,p);if(!m.success){let y=m.error instanceof Error?m.error.message:String(m.error);throw new F(H.InvalidParams,`Invalid task creation result: ${y}`)}return m.data}let f=vn(Jp,p);if(!f.success){let m=f.error instanceof Error?f.error.message:String(f.error);throw new F(H.InvalidParams,`Invalid tools/call result: ${m}`)}return f.data};return super.setRequestHandler(e,a)}return super.setRequestHandler(e,r)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${e})`);break;case"ping":case"initialize":break}}assertTaskCapability(e){kP(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&xP(this._capabilities.tasks?.requests,e,"Server")}async _oninitialize(e){let r=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:PI.includes(r)?r:Pv,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},Op)}async createMessage(e,r){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let o=e.messages[e.messages.length-1],n=Array.isArray(o.content)?o.content:[o.content],i=n.some(u=>u.type==="tool_result"),s=e.messages.length>1?e.messages[e.messages.length-2]:void 0,a=s?Array.isArray(s.content)?s.content:[s.content]:[],c=a.some(u=>u.type==="tool_use");if(i){if(n.some(u=>u.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!c)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(c){let u=new Set(a.filter(d=>d.type==="tool_use").map(d=>d.id)),l=new Set(n.filter(d=>d.type==="tool_result").map(d=>d.toolUseId));if(u.size!==l.size||![...u].every(d=>l.has(d)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return e.tools?this.request({method:"sampling/createMessage",params:e},Hv,r):this.request({method:"sampling/createMessage",params:e},Ba,r)}async elicitInput(e,r){switch(e.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let n=e;return this.request({method:"elicitation/create",params:n},Ri,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let n=e.mode==="form"?e:{...e,mode:"form"},i=await this.request({method:"elicitation/create",params:n},Ri,r);if(i.action==="accept"&&i.content&&n.requestedSchema)try{let a=this._jsonSchemaValidator.getValidator(n.requestedSchema)(i.content);if(!a.valid)throw new F(H.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorMessage}`)}catch(s){throw s instanceof F?s:new F(H.InternalError,`Error validating elicitation response: ${s instanceof Error?s.message:String(s)}`)}return i}}}createElicitationCompletionNotifier(e,r){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},r)}async listRoots(e,r){return this.request({method:"roots/list",params:e},Jv,r)}async sendLoggingMessage(e,r){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,r))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}});function x$(t){return!!t&&typeof t=="object"&&IP in t}function zP(t){return t[IP]?.complete}var IP,EP,TP=g(()=>{IP=Symbol.for("mcp.completable");(function(t){t.Completable="McpCompletable"})(EP||(EP={}))});var OP=g(()=>{});function YZ(t){let e=[];if(t.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(t.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${t.length})`]};if(t.includes(" ")&&e.push("Tool name contains spaces, which may cause parsing issues"),t.includes(",")&&e.push("Tool name contains commas, which may cause parsing issues"),(t.startsWith("-")||t.endsWith("-"))&&e.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(t.startsWith(".")||t.endsWith("."))&&e.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!XZ.test(t)){let r=t.split("").filter(o=>!/[A-Za-z0-9._-]/.test(o)).filter((o,n,i)=>i.indexOf(o)===n);return e.push(`Tool name contains invalid characters: ${r.map(o=>`"${o}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:e}}return{isValid:!0,warnings:e}}function QZ(t,e){if(e.length>0){console.warn(`Tool name validation warning for "${t}":`);for(let r of e)console.warn(` - ${r}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function k$(t){let e=YZ(t);return QZ(t,e.warnings),e.isValid}var XZ,PP=g(()=>{XZ=/^[A-Za-z0-9._-]{1,128}$/});var Vf,RP=g(()=>{Vf=class{constructor(e){this._mcpServer=e}registerToolTask(e,r,o){let n={taskSupport:"required",...r.execution};if(n.taskSupport==="forbidden")throw new Error(`Cannot register task-based tool '${e}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(e,r.title,r.description,r.inputSchema,r.outputSchema,r.annotations,n,r._meta,o)}}});var w$=g(()=>{Da();Da()});function CP(t){return t!==null&&typeof t=="object"&&"parse"in t&&typeof t.parse=="function"&&"safeParse"in t&&typeof t.safeParse=="function"}function AP(t){return"_def"in t||"_zod"in t||CP(t)}function S$(t){return typeof t!="object"||t===null||AP(t)?!1:Object.keys(t).length===0?!0:Object.values(t).some(CP)}function jP(t){if(t){if(S$(t))return co(t);if(!AP(t))throw new Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return t}}function tL(t){let e=_n(t);return e?Object.entries(e).map(([r,o])=>{let n=mE(o),i=hE(o);return{name:r,description:n,required:!i}}):[]}function Rn(t){let r=_n(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let o=Gd(r);if(typeof o=="string")return o;throw new Error("Schema method literal must be a string")}function NP(t){return{completion:{values:t.slice(0,100),total:t.length,hasMore:t.length>100}}}var Hf,eL,wc,DP=g(()=>{SP();$a();T_();ji();TP();OP();PP();RP();w$();Hf=class{constructor(e,r){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new qf(e,r)}get experimental(){return this._experimental||(this._experimental={tasks:new Vf(this)}),this._experimental}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(Rn(Hp)),this.server.assertCanSetRequestHandler(Rn(Pi)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(Hp,()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,r])=>{let o={name:e,title:r.title,description:r.description,inputSchema:(()=>{let n=_i(r.inputSchema);return n?E_(n,{strictUnions:!0,pipeStrategy:"input"}):eL})(),annotations:r.annotations,execution:r.execution,_meta:r._meta};if(r.outputSchema){let n=_i(r.outputSchema);n&&(o.outputSchema=E_(n,{strictUnions:!0,pipeStrategy:"output"}))}return o})})),this.server.setRequestHandler(Pi,async(e,r)=>{try{let o=this._registeredTools[e.params.name];if(!o)throw new F(H.InvalidParams,`Tool ${e.params.name} not found`);if(!o.enabled)throw new F(H.InvalidParams,`Tool ${e.params.name} disabled`);let n=!!e.params.task,i=o.execution?.taskSupport,s="createTask"in o.handler;if((i==="required"||i==="optional")&&!s)throw new F(H.InternalError,`Tool ${e.params.name} has taskSupport '${i}' but was not registered with registerToolTask`);if(i==="required"&&!n)throw new F(H.MethodNotFound,`Tool ${e.params.name} requires task augmentation (taskSupport: 'required')`);if(i==="optional"&&!n&&s)return await this.handleAutomaticTaskPolling(o,e,r);let a=await this.validateToolInput(o,e.params.arguments,e.params.name),c=await this.executeToolHandler(o,a,r);return n||await this.validateToolOutput(o,c,e.params.name),c}catch(o){if(o instanceof F&&o.code===H.UrlElicitationRequired)throw o;return this.createToolError(o instanceof Error?o.message:String(o))}}),this._toolHandlersInitialized=!0)}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,r,o){if(!e.inputSchema)return;let i=_i(e.inputSchema)??e.inputSchema,s=await Bd(i,r);if(!s.success){let a="error"in s?s.error:"Unknown error",c=Wd(a);throw new F(H.InvalidParams,`Input validation error: Invalid arguments for tool ${o}: ${c}`)}return s.data}async validateToolOutput(e,r,o){if(!e.outputSchema||!("content"in r)||r.isError)return;if(!r.structuredContent)throw new F(H.InvalidParams,`Output validation error: Tool ${o} has an output schema but no structured content was provided`);let n=_i(e.outputSchema),i=await Bd(n,r.structuredContent);if(!i.success){let s="error"in i?i.error:"Unknown error",a=Wd(s);throw new F(H.InvalidParams,`Output validation error: Invalid structured content for tool ${o}: ${a}`)}}async executeToolHandler(e,r,o){let n=e.handler;if("createTask"in n){if(!o.taskStore)throw new Error("No task store provided.");let s={...o,taskStore:o.taskStore};if(e.inputSchema){let a=n;return await Promise.resolve(a.createTask(r,s))}else{let a=n;return await Promise.resolve(a.createTask(s))}}if(e.inputSchema){let s=n;return await Promise.resolve(s(r,o))}else{let s=n;return await Promise.resolve(s(o))}}async handleAutomaticTaskPolling(e,r,o){if(!o.taskStore)throw new Error("No task store provided for task-capable tool.");let n=await this.validateToolInput(e,r.params.arguments,r.params.name),i=e.handler,s={...o,taskStore:o.taskStore},a=n?await Promise.resolve(i.createTask(n,s)):await Promise.resolve(i.createTask(s)),c=a.task.taskId,u=a.task,l=u.pollInterval??5e3;for(;u.status!=="completed"&&u.status!=="failed"&&u.status!=="cancelled";){await new Promise(p=>setTimeout(p,l));let d=await o.taskStore.getTask(c);if(!d)throw new F(H.InternalError,`Task ${c} not found during polling`);u=d}return await o.taskStore.getTaskResult(c)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(Rn(Bp)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(Bp,async e=>{switch(e.params.ref.type){case"ref/prompt":return BI(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return WI(e),this.handleResourceCompletion(e,e.params.ref);default:throw new F(H.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,r){let o=this._registeredPrompts[r.name];if(!o)throw new F(H.InvalidParams,`Prompt ${r.name} not found`);if(!o.enabled)throw new F(H.InvalidParams,`Prompt ${r.name} disabled`);if(!o.argsSchema)return wc;let i=_n(o.argsSchema)?.[e.params.argument.name];if(!x$(i))return wc;let s=zP(i);if(!s)return wc;let a=await s(e.params.argument.value,e.params.context);return NP(a)}async handleResourceCompletion(e,r){let o=Object.values(this._registeredResourceTemplates).find(s=>s.resourceTemplate.uriTemplate.toString()===r.uri);if(!o){if(this._registeredResources[r.uri])return wc;throw new F(H.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let n=o.resourceTemplate.completeCallback(e.params.argument.name);if(!n)return wc;let i=await n(e.params.argument.value,e.params.context);return NP(i)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(Rn(Zp)),this.server.assertCanSetRequestHandler(Rn(Lp)),this.server.assertCanSetRequestHandler(Rn(Fp)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(Zp,async(e,r)=>{let o=Object.entries(this._registeredResources).filter(([i,s])=>s.enabled).map(([i,s])=>({uri:i,name:s.name,...s.metadata})),n=[];for(let i of Object.values(this._registeredResourceTemplates)){if(!i.resourceTemplate.listCallback)continue;let s=await i.resourceTemplate.listCallback(r);for(let a of s.resources)n.push({...i.metadata,...a})}return{resources:[...o,...n]}}),this.server.setRequestHandler(Lp,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([r,o])=>({name:r,uriTemplate:o.resourceTemplate.uriTemplate.toString(),...o.metadata}))})),this.server.setRequestHandler(Fp,async(e,r)=>{let o=new URL(e.params.uri),n=this._registeredResources[o.toString()];if(n){if(!n.enabled)throw new F(H.InvalidParams,`Resource ${o} disabled`);return n.readCallback(o,r)}for(let i of Object.values(this._registeredResourceTemplates)){let s=i.resourceTemplate.uriTemplate.match(o.toString());if(s)return i.readCallback(o,s,r)}throw new F(H.InvalidParams,`Resource ${o} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(Rn(qp)),this.server.assertCanSetRequestHandler(Rn(Vp)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(qp,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,r])=>({name:e,title:r.title,description:r.description,arguments:r.argsSchema?tL(r.argsSchema):void 0}))})),this.server.setRequestHandler(Vp,async(e,r)=>{let o=this._registeredPrompts[e.params.name];if(!o)throw new F(H.InvalidParams,`Prompt ${e.params.name} not found`);if(!o.enabled)throw new F(H.InvalidParams,`Prompt ${e.params.name} disabled`);if(o.argsSchema){let n=_i(o.argsSchema),i=await Bd(n,e.params.arguments);if(!i.success){let c="error"in i?i.error:"Unknown error",u=Wd(c);throw new F(H.InvalidParams,`Invalid arguments for prompt ${e.params.name}: ${u}`)}let s=i.data,a=o.callback;return await Promise.resolve(a(s,r))}else{let n=o.callback;return await Promise.resolve(n(r))}}),this._promptHandlersInitialized=!0)}resource(e,r,...o){let n;typeof o[0]=="object"&&(n=o.shift());let i=o[0];if(typeof r=="string"){if(this._registeredResources[r])throw new Error(`Resource ${r} is already registered`);let s=this._createRegisteredResource(e,void 0,r,n,i);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let s=this._createRegisteredResourceTemplate(e,void 0,r,n,i);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}}registerResource(e,r,o,n){if(typeof r=="string"){if(this._registeredResources[r])throw new Error(`Resource ${r} is already registered`);let i=this._createRegisteredResource(e,o.title,r,o,n);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),i}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let i=this._createRegisteredResourceTemplate(e,o.title,r,o,n);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),i}}_createRegisteredResource(e,r,o,n,i){let s={name:e,title:r,metadata:n,readCallback:i,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({uri:null}),update:a=>{typeof a.uri<"u"&&a.uri!==o&&(delete this._registeredResources[o],a.uri&&(this._registeredResources[a.uri]=s)),typeof a.name<"u"&&(s.name=a.name),typeof a.title<"u"&&(s.title=a.title),typeof a.metadata<"u"&&(s.metadata=a.metadata),typeof a.callback<"u"&&(s.readCallback=a.callback),typeof a.enabled<"u"&&(s.enabled=a.enabled),this.sendResourceListChanged()}};return this._registeredResources[o]=s,s}_createRegisteredResourceTemplate(e,r,o,n,i){let s={resourceTemplate:o,title:r,metadata:n,readCallback:i,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({name:null}),update:u=>{typeof u.name<"u"&&u.name!==e&&(delete this._registeredResourceTemplates[e],u.name&&(this._registeredResourceTemplates[u.name]=s)),typeof u.title<"u"&&(s.title=u.title),typeof u.template<"u"&&(s.resourceTemplate=u.template),typeof u.metadata<"u"&&(s.metadata=u.metadata),typeof u.callback<"u"&&(s.readCallback=u.callback),typeof u.enabled<"u"&&(s.enabled=u.enabled),this.sendResourceListChanged()}};this._registeredResourceTemplates[e]=s;let a=o.uriTemplate.variableNames;return Array.isArray(a)&&a.some(u=>!!o.completeCallback(u))&&this.setCompletionRequestHandler(),s}_createRegisteredPrompt(e,r,o,n,i){let s={title:r,description:o,argsSchema:n===void 0?void 0:co(n),callback:i,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({name:null}),update:a=>{typeof a.name<"u"&&a.name!==e&&(delete this._registeredPrompts[e],a.name&&(this._registeredPrompts[a.name]=s)),typeof a.title<"u"&&(s.title=a.title),typeof a.description<"u"&&(s.description=a.description),typeof a.argsSchema<"u"&&(s.argsSchema=co(a.argsSchema)),typeof a.callback<"u"&&(s.callback=a.callback),typeof a.enabled<"u"&&(s.enabled=a.enabled),this.sendPromptListChanged()}};return this._registeredPrompts[e]=s,n&&Object.values(n).some(c=>{let u=c instanceof Ii?c._def?.innerType:c;return x$(u)})&&this.setCompletionRequestHandler(),s}_createRegisteredTool(e,r,o,n,i,s,a,c,u){k$(e);let l={title:r,description:o,inputSchema:jP(n),outputSchema:jP(i),annotations:s,execution:a,_meta:c,handler:u,enabled:!0,disable:()=>l.update({enabled:!1}),enable:()=>l.update({enabled:!0}),remove:()=>l.update({name:null}),update:d=>{typeof d.name<"u"&&d.name!==e&&(typeof d.name=="string"&&k$(d.name),delete this._registeredTools[e],d.name&&(this._registeredTools[d.name]=l)),typeof d.title<"u"&&(l.title=d.title),typeof d.description<"u"&&(l.description=d.description),typeof d.paramsSchema<"u"&&(l.inputSchema=co(d.paramsSchema)),typeof d.outputSchema<"u"&&(l.outputSchema=co(d.outputSchema)),typeof d.callback<"u"&&(l.handler=d.callback),typeof d.annotations<"u"&&(l.annotations=d.annotations),typeof d._meta<"u"&&(l._meta=d._meta),typeof d.enabled<"u"&&(l.enabled=d.enabled),this.sendToolListChanged()}};return this._registeredTools[e]=l,this.setToolRequestHandlers(),this.sendToolListChanged(),l}tool(e,...r){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let o,n,i,s;if(typeof r[0]=="string"&&(o=r.shift()),r.length>1){let c=r[0];if(S$(c))n=r.shift(),r.length>1&&typeof r[0]=="object"&&r[0]!==null&&!S$(r[0])&&(s=r.shift());else if(typeof c=="object"&&c!==null){if(Object.values(c).some(u=>typeof u=="object"&&u!==null))throw new Error(`Tool ${e} expected a Zod schema or ToolAnnotations, but received an unrecognized object`);s=r.shift()}}let a=r[0];return this._createRegisteredTool(e,void 0,o,n,i,s,{taskSupport:"forbidden"},void 0,a)}registerTool(e,r,o){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let{title:n,description:i,inputSchema:s,outputSchema:a,annotations:c,_meta:u}=r;return this._createRegisteredTool(e,n,i,s,a,c,{taskSupport:"forbidden"},u,o)}prompt(e,...r){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let o;typeof r[0]=="string"&&(o=r.shift());let n;r.length>1&&(n=r.shift());let i=r[0],s=this._createRegisteredPrompt(e,void 0,o,n,i);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),s}registerPrompt(e,r,o){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let{title:n,description:i,argsSchema:s}=r,a=this._createRegisteredPrompt(e,n,i,s,o);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),a}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,r){return this.server.sendLoggingMessage(e,r)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}},eL={type:"object",properties:{}};wc={completion:{values:[],hasMore:!1}}});function rL(t){return UI.parse(JSON.parse(t))}function MP(t){return JSON.stringify(t)+`
|
|
263
|
+
`}var Jf,UP=g(()=>{ji();Jf=class{append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(`
|
|
264
|
+
`);if(e===-1)return null;let r=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),rL(r)}clear(){this._buffer=void 0}}});var E$,Bf,ZP=g(()=>{E$=C(require("node:process"),1);UP();Bf=class{constructor(e=E$.default.stdin,r=E$.default.stdout){this._stdin=e,this._stdout=r,this._readBuffer=new Jf,this._started=!1,this._ondata=o=>{this._readBuffer.append(o),this.processReadBuffer()},this._onerror=o=>{this.onerror?.(o)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.()}send(e){return new Promise(r=>{let o=MP(e);this._stdout.write(o)?r():this._stdout.once("drain",r)})}}});function Wf(t,e,r){if(t)try{let o=FP.default.join(t,"recall-log.jsonl"),n={timestamp:new Date().toISOString(),event:e,memory:{id:r.id,uuid:r.uuid,layer:r.layer,what:r.what,why:r.why??null,scope:r.scope??null,tags:r.tags}};LP.default.appendFileSync(o,JSON.stringify(n)+`
|
|
265
|
+
`)}catch{}}var LP,FP,qP=g(()=>{"use strict";LP=C(require("fs")),FP=C(require("path"))});var BP={};bt(BP,{createServer:()=>JP,startServer:()=>sL});function I$(t){return typeof t=="string"?Number(t):t}function Gf(t){return X.preprocess(e=>e!=null&&!Array.isArray(e)?[e]:e,X.array(t))}function JP(t,e){let r=e?.logDir??null,o=i=>{if(!er(i))return;let s=t.getProjectRoot();if(s)try{Mt(ot(),s)}catch{}},n=new Hf({name:"aide-memory",version:(()=>{try{let i=Kf.default.join(__dirname,"..","..","package.json"),s=JSON.parse(z$.default.readFileSync(i,"utf8"));return s&&typeof s.version=="string"?s.version:"0.0.0"}catch{return"0.0.0"}})()});return n.tool("aide_recall","Retrieve context for an area of the codebase before planning or making changes. Returns contributor preferences, technical knowledge, area decisions, and project guidelines. Call this when starting work in a codebase area, before proposing plans, or when you may have lost earlier context.",{paths:Gf(X.string()).nullish().transform(i=>i??void 0).describe("File or directory paths you are working in. Returns memories scoped to these areas plus project-wide context."),ids:Gf(X.coerce.number()).nullish().transform(i=>i??void 0).describe("Specific memory IDs to retrieve (for gap-filling). When provided, returns exactly these memories \u2014 no path matching."),query:X.string().nullish().transform(i=>i??void 0).describe('Optional text to boost relevant results (e.g. "skeleton loading" or "authentication flow").'),layers:Gf(X.enum(Sc)).nullish().transform(i=>i??void 0).describe("Filter to specific layers: preferences, technical, area_context, guidelines."),contributor:X.string().nullish().transform(i=>i??void 0).describe("Filter to a specific contributor."),limit:X.coerce.number().nullish().transform(i=>i??void 0).describe("Max memories to return (default 20).")},async i=>{let s=Lc(t,{paths:i.paths,ids:i.ids?i.ids.map(I$):void 0,query:i.query,layers:i.layers,contributor:i.contributor,limit:i.limit},r);if(s.memories.length===0)return{content:[{type:"text",text:"No memories found for this area. As you work and make decisions, use aide_remember to store context that should persist."}]};let a=VP(s.memories),c="";for(let[u,l]of a){c+=`
|
|
266
|
+
## ${HP(u)}
|
|
267
|
+
`;for(let d of l)c+=`- [${d.id}] ${d.what}`,d.contributor&&(c+=` (from ${d.contributor})`),d.scope&&d.scope!=="project"&&(c+=` [${d.scope}]`),c+=`
|
|
268
|
+
`,d.why&&(c+=` _Why: ${d.why}_
|
|
269
|
+
`)}return{content:[{type:"text",text:c.trim()}]}}),n.tool("aide_remember","Store knowledge that should persist beyond this conversation. Call when the developer corrects your approach, makes a decision during planning, teaches you something about the codebase, or when you discover something relevant during exploration. Store the specific knowledge \u2014 do not over-generalize from a single instance.",{what:X.string().nullish().transform(i=>i??void 0).describe('The specific knowledge to remember. Alias: "content" (either field accepted).'),content:X.string().nullish().transform(i=>i??void 0).describe('Alias for "what". Either field accepted; provided because LLMs often reach for "content" first.'),layer:X.enum(Sc).describe("preferences = how someone likes to work. technical = facts about the stack. area_context = decisions for a code area. guidelines = team principles."),scope:X.string().nullish().transform(i=>i??void 0).describe('Glob pattern for the code area this applies to (e.g. "src/components/dashboard/**"). Omit for project-wide.'),why:X.string().nullish().transform(i=>i??void 0).describe("Context for why this is worth remembering."),context_label:X.string().nullish().transform(i=>i??void 0).describe('Feature grouping label (e.g. "dashboard skeleton loading", "Add App modal").'),contributor:X.string().nullish().transform(i=>i??void 0).describe("Who this knowledge came from (for preferences layer)."),tags:Gf(X.string()).nullish().transform(i=>i??void 0).describe("Tags for categorization."),source:X.enum(nL).nullish().transform(i=>i??void 0).describe("How this was captured. Default: conversation."),shared:oL.nullish().transform(i=>i??void 0).describe("Whether this memory is shared (true, default) or personal (false). Only affects preferences layer file placement."),priority:X.enum(["always","normal"]).nullish().transform(i=>i??void 0).describe("always = auto-injected at session start. normal = standard recall.")},async i=>{let s=i.what??i.content;if(!s)return{content:[{type:"text",text:'aide_remember requires the "what" field (or its alias "content"). Provide the specific knowledge to store.'}],isError:!0};let a=t.add({layer:i.layer,what:s,why:i.why,scope:i.scope,context_label:i.context_label,contributor:i.contributor,tags:i.tags,source:i.source??"conversation",shared:i.shared,priority:i.priority});return Wf(r,"memory_stored",a),o(a),{content:[{type:"text",text:`Stored: "${a.what}" as ${a.layer}${a.scope?` [${a.scope}]`:" [project-wide]"} (id: ${a.id}, uuid: ${a.uuid})`}]}}),n.tool("aide_update","Update an existing memory. Use when information has changed, scope needs adjusting, or context needs updating. You can only update your own memories.",{id:X.coerce.number().describe("ID of the memory to update."),what:X.string().nullish().transform(i=>i??void 0).describe('Updated knowledge text. Alias: "content" (either field accepted).'),content:X.string().nullish().transform(i=>i??void 0).describe('Alias for "what". Either field accepted; provided because LLMs often reach for "content" first.'),why:X.string().nullish().transform(i=>i??void 0).describe("Updated context."),scope:X.string().nullish().transform(i=>i??void 0).describe("Updated scope pattern."),context_label:X.string().nullish().transform(i=>i??void 0).describe("Updated feature label."),priority:X.enum(["always","normal"]).nullish().transform(i=>i??void 0).describe("always = auto-injected at session start. normal = standard recall.")},async i=>{let s=I$(i.id),a=t.get(s);if(!a)return{content:[{type:"text",text:`Memory ${s} not found.`}]};let c=i.what??i.content,u={};if(c!==void 0&&(u.what=c),i.why!==void 0&&(u.why=i.why),i.scope!==void 0&&(u.scope=i.scope),i.context_label!==void 0&&(u.context_label=i.context_label),i.priority!==void 0&&(u.priority=i.priority),Object.keys(u).length===0)return{content:[{type:"text",text:`No changes provided. Current memory:
|
|
270
|
+
- what: ${a.what}
|
|
271
|
+
- scope: ${a.scope??"project-wide"}
|
|
272
|
+
- layer: ${a.layer}`}]};let l=t.update(s,u);return Wf(r,"memory_updated",l),(er(a)||er(l))&&o(l),{content:[{type:"text",text:`Updated memory ${l.id}: "${l.what}"${l.scope?` [${l.scope}]`:" [project-wide]"}`}]}}),n.tool("aide_forget","Permanently delete a memory that is no longer relevant or was incorrect.",{id:X.coerce.number().describe("The memory ID to delete.")},async i=>{let s=I$(i.id),a=t.get(s);return a?(t.remove(s),Wf(r,"memory_deleted",a),o(a),{content:[{type:"text",text:`Deleted: "${a.what}" (id: ${s})`}]}):{content:[{type:"text",text:`Memory ${s} not found.`}]}}),n.tool("aide_memories","List stored memories for transparency and management. Shows what context is available.",{layer:X.enum(Sc).nullish().transform(i=>i??void 0).describe("Filter by layer."),scope:X.string().nullish().transform(i=>i??void 0).describe("Filter by exact scope."),contributor:X.string().nullish().transform(i=>i??void 0).describe("Filter by contributor."),limit:X.coerce.number().nullish().transform(i=>i??void 0).describe("Max results (default 50).")},async i=>{let s=t.list({layer:i.layer,scope:i.scope,contributor:i.contributor,limit:i.limit??50});if(s.length===0)return{content:[{type:"text",text:"No memories found."}]};let a=t.count(),c=`Showing ${s.length} of ${a} memories:
|
|
273
|
+
|
|
274
|
+
`;for(let u of s)c+=`[${u.id}] ${u.layer} | ${u.what}`,u.scope&&(c+=` [${u.scope}]`),u.contributor&&(c+=` (${u.contributor})`),c+=` | recalled ${u.recalled_count}x`,c+=`
|
|
275
|
+
`;return{content:[{type:"text",text:c.trim()}]}}),n.tool("aide_import","Import guidelines or technical context from a markdown document. Each bullet point or paragraph becomes a separate memory. Use this to seed knowledge from existing docs like TESTING_GUIDELINES.md or ARCHITECTURE.md.",{content:X.string().describe("The markdown content to import."),layer:X.enum(Sc).describe("Which layer to import into."),scope:X.string().nullish().transform(i=>i??void 0).describe("Scope for all imported memories."),context_label:X.string().nullish().transform(i=>i??void 0).describe("Label for the import batch.")},async i=>{let s=iL(i.content);if(s.length===0)return{content:[{type:"text",text:"No importable items found in the content."}]};let a=s.map(c=>t.add({layer:i.layer,what:c,scope:i.scope,context_label:i.context_label,source:"import"}));return{content:[{type:"text",text:`Imported ${a.length} memories as ${i.layer}${i.scope?` [${i.scope}]`:""}:
|
|
276
|
+
${a.map(c=>`- [${c.id}] ${c.what}`).join(`
|
|
277
|
+
`)}`}]}}),n.tool("aide_search",'Search memories by keyword substring match. Use when looking for specific knowledge that may be stored \u2014 e.g. "what do we know about authentication?" or "any memories about testing?"',{keyword:X.string().describe("Text to search for in memory content (case-insensitive substring match on what and why fields)."),layer:X.enum(Sc).nullish().transform(i=>i??void 0).describe("Filter to a specific layer."),limit:X.coerce.number().nullish().transform(i=>i??void 0).describe("Max results (default 50)."),mode:X.enum(["auto","keyword","semantic"]).nullish().transform(i=>i??void 0).describe("Search mode. 'auto' (default): keyword first, semantic fallback if <3 results. 'keyword': exact substring only. 'semantic': embedding similarity only.")},async i=>{let s=i.mode,a={layer:i.layer,limit:i.limit,mode:s},c=s==="semantic"||s==="auto"||!s?await t.searchWithEmbeddings(i.keyword,a):t.search(i.keyword,a);if(c.length===0)return{content:[{type:"text",text:`No memories found matching "${i.keyword}".`}]};let u=VP(c),l=`Found ${c.length} matching "${i.keyword}":
|
|
278
|
+
`;for(let[d,p]of u){l+=`
|
|
279
|
+
## ${HP(d)}
|
|
280
|
+
`;for(let f of p)l+=`- [${f.id}] ${f.what}`,f.scope&&f.scope!=="project"&&(l+=` [${f.scope}]`),l+=`
|
|
281
|
+
`,f.why&&(l+=` _Why: ${f.why}_
|
|
282
|
+
`)}return{content:[{type:"text",text:l.trim()}]}}),n}function VP(t){let e=new Map;for(let r of t)e.has(r.layer)||e.set(r.layer,[]),e.get(r.layer).push(r);return Array.from(e.entries())}function HP(t){switch(t){case"area_context":return"Area Context";case"technical":return"Technical Context";case"preferences":return"Preferences";case"guidelines":return"Guidelines";default:return t}}function iL(t){let e=t.split(`
|
|
283
|
+
`),r=[];for(let o of e){let n=o.trim();if(/^[-*+]\s+/.test(n)){let i=n.replace(/^[-*+]\s+/,"").trim();i.length>5&&r.push(i)}else if(/^\d+\.\s+/.test(n)){let i=n.replace(/^\d+\.\s+/,"").trim();i.length>5&&r.push(i)}else n.length>20&&!n.startsWith("#")&&!n.startsWith("```")&&!n.startsWith("|")&&r.push(n)}return r}async function sL(t){pt("mcp",`startServer enter projectPath=${t} node=${process.versions.node} abi=${process.versions.modules}`);let{checkForUpdates:e,printUpdateNotice:r,checkMinVersion:o,printRequiredUpdateNotice:n}=await Promise.resolve().then(()=>(uh(),bw)),s=JSON.parse(z$.default.readFileSync(Kf.default.join(__dirname,"..","..","package.json"),"utf-8")).version,a=o(s);a&&(n(s,a),process.exit(1)),e(s).then(f=>{f&&r(s,f)}).catch(()=>{});try{let{autoUpdateIfNeeded:f}=await Promise.resolve().then(()=>(Zn(),au)),m=f(t,s);m.length>0&&console.error(` aide-memory: auto-updated ${m.length} config(s) to v${s}`)}catch{}let c;try{c=new $e({projectRoot:t})}catch(f){Pr(`aide-memory MCP server failed to initialize store for ${t}: ${f?.message??String(f)}`,"see preceding [AIDE_ERROR] for the underlying binding/load failure"),process.exit(1)}try{let{ingestPendingMemories:f}=await Promise.resolve().then(()=>(Zn(),au)),m=f(t,c);m>0&&console.error(` aide-memory: imported ${m} pending memor${m===1?"y":"ies"} from .aide/pending-memories.jsonl`)}catch{}let u=new So;u.initialize().then(f=>{f&&c.setEmbeddingService(u)}).catch(()=>{});let l=Kf.default.join(t,".aide"),d=JP(c,{logDir:l}),p=new Bf;await d.connect(p),pt("mcp",`startServer ready version=${s} logDir=${l}`),process.on("SIGINT",()=>{pt("mcp","startServer SIGINT \u2014 closing store"),c.close(),process.exit(0)})}var Kf,z$,Sc,nL,oL,WP=g(()=>{"use strict";DP();ZP();w$();Kf=C(require("path")),z$=C(require("fs"));Ot();Fc();qP();km();Qt();Gr();ts();Sc=["preferences","technical","area_context","guidelines"],nL=["conversation","import","agent_discovery","elevated","hook"];oL=X.preprocess(t=>{if(typeof t=="string"){let e=t.toLowerCase().trim();if(e==="true"||e==="1")return!0;if(e==="false"||e==="0"||e==="")return!1}return t},X.boolean())});var aL={};bt(aL,{createProgram:()=>XP});module.exports=Ic(aL);var q$=C(F$(),1),{program:gL,createCommand:yL,createArgument:vL,createOption:_L,CommanderError:bL,InvalidArgumentError:$L,InvalidOptionArgumentError:xL,Command:V$,Argument:kL,Option:wL,Help:SL}=q$.default;var Hc=C(dt());Ot();Fc();var Eo=C(require("path")),Im=C(require("fs")),qc=C(dt()),ce=qc.default.hex("#00c2cb"),Rr={preferences:"Preferences",technical:"Technical Context",area_context:"Area Context",guidelines:"Guidelines"},Br=["preferences","technical","area_context","guidelines"];function lR(t){let e=Eo.default.resolve(t),r=Eo.default.parse(e).root;for(;e!==r;){if(Im.default.existsSync(Eo.default.join(e,".aide")))return e;e=Eo.default.dirname(e)}return Im.default.existsSync(Eo.default.join(r,".aide"))?r:null}function je(){let t=lR(process.cwd());return t||(console.error(qc.default.red("No .aide/ directory found. Run `aide-memory init` first.")),process.exit(1)),t}function Vc(t){let e=new Map;for(let r of t)e.has(r.layer)||e.set(r.layer,[]),e.get(r.layer).push(r);return Array.from(e.entries())}function Io(t){let e=` [${t.id}] ${t.what}`;return t.contributor&&(e+=ce(` (from ${t.contributor})`)),t.scope&&t.scope!=="project"&&(e+=qc.default.gray(` [${t.scope}]`)),e}function Gx(t){let e=je(),r=new $e({projectRoot:e});try{let o=Lc(r,{paths:[t]});if(o.memories.length===0){console.log(Hc.default.gray("No memories found for this area."));return}console.log(Hc.default.white(`Recalled ${o.memories.length} memories for "${t}":
|
|
284
|
+
`));let n=Vc(o.memories);for(let[i,s]of n){console.log(ce.bold(`## ${Rr[i]??i}`));for(let a of s)console.log(Io(a)),a.why&&console.log(Hc.default.gray(` Why: ${a.why}`));console.log()}}finally{r.close()}}var kk=C(dt());Ot();Gr();Qt();function wk(t,e){Br.includes(e.layer)||(console.error(kk.default.red(`Invalid layer "${e.layer}". Must be one of: ${Br.join(", ")}`)),process.exit(1));let r=je(),o=new $e({projectRoot:r});try{let n=o.add({layer:e.layer,what:t,why:e.why,scope:e.scope,context_label:e.tags,contributor:e.contributor});if(console.log(ce(`Stored memory (id: ${n.id}):`)),console.log(` Layer: ${n.layer}`),console.log(` What: ${n.what}`),n.scope&&console.log(` Scope: ${n.scope}`),n.why&&console.log(` Why: ${n.why}`),n.contributor&&console.log(` From: ${n.contributor}`),n.context_label&&console.log(` Tags: ${n.context_label}`),er(n))try{Mt(ot(),r)}catch{}}finally{o.close()}}var ls=C(dt());Ot();Gr();Qt();function Sk(t,e){let r=parseInt(t,10);isNaN(r)&&(console.error(ls.default.red(`Invalid memory ID: "${t}". Must be a number.`)),process.exit(1));let o=je(),n=new $e({projectRoot:o});try{let i=n.get(r);i||(console.error(ls.default.red(`Memory ${r} not found.`)),process.exit(1));let s={};e.what!==void 0&&(s.what=e.what),e.why!==void 0&&(s.why=e.why),e.scope!==void 0&&(s.scope=e.scope),e.tags!==void 0&&(s.context_label=e.tags),Object.keys(s).length===0&&(console.error(ls.default.yellow("No changes specified. Use --what, --why, --scope, or --tags.")),process.exit(1));let a=n.update(r,s);if(a||(console.error(ls.default.red(`Failed to update memory ${r}.`)),process.exit(1)),console.log(ce(`Updated memory (id: ${a.id}):`)),console.log(` Layer: ${a.layer}`),console.log(` What: ${a.what}`),a.scope&&console.log(` Scope: ${a.scope}`),a.why&&console.log(` Why: ${a.why}`),er(i)||er(a))try{Mt(ot(),o)}catch{}}finally{n.close()}}var Hm=C(dt());Ot();Gr();Qt();function Ek(t){let e=parseInt(t,10);isNaN(e)&&(console.error(Hm.default.red(`Invalid memory ID: "${t}". Must be a number.`)),process.exit(1));let r=je(),o=new $e({projectRoot:r});try{let n=o.get(e);if(n||(console.error(Hm.default.red(`Memory ${e} not found.`)),process.exit(1)),o.remove(e),console.log(ce(`Deleted memory ${e}: "${n.what}"`)),er(n))try{Mt(ot(),r)}catch{}}finally{o.close()}}var cu=C(dt());Ot();function Ik(t,e){let r=je(),o=new $e({projectRoot:r});try{let n=o.search(t,{layer:e.layer,limit:e.limit?parseInt(e.limit,10):50});if(n.length===0){console.log(cu.default.gray(`No memories found matching "${t}".`));return}console.log(cu.default.white(`Found ${n.length} matching "${t}":
|
|
285
|
+
`));let i=Vc(n);for(let[s,a]of i){console.log(ce.bold(` ${Rr[s]??s}`));for(let c of a)console.log(Io(c)),c.why&&console.log(cu.default.gray(` Why: ${c.why}`));console.log()}}finally{o.close()}}var ds=C(dt());Ot();function zk(t){t.layer&&!Br.includes(t.layer)&&(console.error(ds.default.red(`Invalid layer "${t.layer}". Must be one of: ${Br.join(", ")}`)),process.exit(1));let e=je(),r=new $e({projectRoot:e});try{let o=r.list({layer:t.layer,scope:t.scope,limit:t.limit?parseInt(t.limit,10):void 0});if(t.contributor&&(o=o.filter(i=>i.contributor===t.contributor)),t.tag){let i=t.tag.toLowerCase();o=o.filter(s=>s.context_label?.toLowerCase().includes(i))}if(o.length===0){console.log(ds.default.gray("No memories found."));return}let n=r.count();console.log(ds.default.white(`Showing ${o.length} of ${n} memories:
|
|
286
|
+
`));for(let i of o){let s=Io(i);s+=ds.default.gray(` | recalled ${i.recalled_count}x`),console.log(s)}}finally{r.close()}}var Tk=C(dt());Ot();function Ok(){let t=je(),e=new $e({projectRoot:t});try{let r=e.count();console.log(Tk.default.white.bold(`Memory Statistics
|
|
287
|
+
`)),console.log(` Total memories: ${r}`),console.log(),console.log(ce.bold(" By Layer:"));for(let a of Br){let c=e.count({layer:a});console.log(` ${Rr[a]}: ${c}`)}console.log();let o=e.list(),i=[...o].sort((a,c)=>c.recalled_count-a.recalled_count).filter(a=>a.recalled_count>0).slice(0,5);if(i.length>0){console.log(ce.bold(" Most Recalled:"));for(let a of i)console.log(` [${a.id}] ${a.what} (${a.recalled_count}x)`);console.log()}let s=new Map;for(let a of o)s.set(a.source,(s.get(a.source)??0)+1);if(s.size>0){console.log(ce.bold(" By Source:"));for(let[a,c]of s)console.log(` ${a}: ${c}`)}}finally{e.close()}}var Pk=C(require("path")),ps=C(require("fs")),Ne=C(dt());function Rk(t){let e=je(),r=Pk.default.join(e,".aide","recall-log.jsonl");if(t.clear){ps.default.existsSync(r)?(ps.default.unlinkSync(r),console.log(ce("Recall log cleared."))):console.log(Ne.default.yellow("No recall log to clear."));return}if(!ps.default.existsSync(r)){console.log(Ne.default.yellow("No recall log found. Recalls will be logged after the next aide_recall call.")),console.log(Ne.default.gray(` Expected at: ${r}`));return}let o=ps.default.readFileSync(r,"utf-8").trim();if(!o){console.log(Ne.default.yellow("Recall log is empty."));return}let n=o.split(`
|
|
288
|
+
`),i=t.last?parseInt(t.last,10):n.length,s=n.slice(-i).map(v=>{try{return JSON.parse(v)}catch{return null}}).filter(Boolean);if(s.length===0){console.log(Ne.default.yellow("No valid recall log entries found."));return}let a=s.filter(v=>!v.event),c=s.filter(v=>v.event);console.log(Ne.default.white.bold(`Event Log \u2014 ${s.length} event(s)
|
|
289
|
+
`));let u=0,l=0;for(let v of s){let P=new Date(v.timestamp).toLocaleString();if(v.event&&v.memory){l++;let _=v.event==="memory_stored"?ce("STORED"):v.event==="memory_updated"?Ne.default.yellow("UPDATED"):Ne.default.red("DELETED");console.log(`${_} ${Ne.default.gray(`(${P})`)}`),console.log(` [${v.memory.id}] ${Ne.default.white(v.memory.what)}`);let w=Rr[v.memory.layer]??v.memory.layer;console.log(Ne.default.gray(` Layer: ${w} | Scope: ${v.memory.scope??"project-wide"}`)),v.memory.why&&console.log(Ne.default.gray(` Why: ${v.memory.why}`))}else if(v.query&&v.memories_returned)if(u++,console.log(ce.bold(`\u2500\u2500 Recall #${u} `)+Ne.default.gray(`(${P})`)),console.log(Ne.default.gray(` Query paths: ${v.query.paths.length>0?v.query.paths.join(", "):"(none)"}`)),v.query.text&&console.log(Ne.default.gray(` Query text: ${v.query.text}`)),v.query.layers&&console.log(Ne.default.gray(` Layers: ${v.query.layers.join(", ")}`)),console.log(Ne.default.gray(` Matched scopes: ${v.matched_scopes&&v.matched_scopes.length>0?v.matched_scopes.join(", "):"(none)"}`)),console.log(),v.memories_returned.length===0)console.log(Ne.default.yellow(" No memories returned."));else{console.log(Ne.default.white(` ${v.memories_returned.length} memor${v.memories_returned.length===1?"y":"ies"} returned:`)),console.log();for(let _ of v.memories_returned){let w=Rr[_.layer]??_.layer;console.log(` ${ce("\u2713")} [${_.id}] ${Ne.default.white(_.what)}`),console.log(Ne.default.gray(` Layer: ${w} | Scope: ${_.scope??"project-wide"} | Recalled: ${_.recalled_count}x`)),_.tags.length>0&&console.log(Ne.default.gray(` Tags: ${_.tags.join(", ")}`))}}console.log()}let d=a.length,p=a.reduce((v,P)=>v+(P.count??0),0),f=a.filter(v=>(v.count??0)===0).length,m=c.filter(v=>v.event==="memory_stored").length,y=c.filter(v=>v.event==="memory_updated").length,x=c.filter(v=>v.event==="memory_deleted").length;console.log(Ne.default.white.bold("Summary")),console.log(` Recall events: ${d}`),console.log(` Total memories returned: ${p}`),console.log(` Empty recalls (0 results): ${f}`),d>0&&console.log(` Avg memories per recall: ${(p/d).toFixed(1)}`),console.log(` Memories stored: ${m}`),console.log(` Memories updated: ${y}`),console.log(` Memories deleted: ${x}`)}var yr=C(dt()),Jm=C(require("path")),Ro=C(require("fs"));Zn();is();Qc();Gr();Qt();function jk(t){return Jm.default.join(t,".aide","config.json")}function Nk(t){if(!Ro.default.existsSync(t))return{};let e=Ro.default.readFileSync(t,"utf-8");return JSON.parse(e)}function UR(t,e){let r=Jm.default.dirname(t);Ro.default.existsSync(r)||Ro.default.mkdirSync(r,{recursive:!0}),Ro.default.writeFileSync(t,JSON.stringify(e,null,2)+`
|
|
290
|
+
`)}function Ck(t,e){let r=e.split("."),o=t;for(let n of r){if(o==null||typeof o!="object")return;o=o[n]}return o}function ZR(t,e,r){let o=e.split("."),n=t;for(let i=0;i<o.length-1;i++){let s=o[i];(n[s]===void 0||typeof n[s]!="object")&&(n[s]={}),n=n[s]}n[o[o.length-1]]=r}function LR(t){if(t==="true")return!0;if(t==="false")return!1;if(t==="null")return null;let e=Number(t);if(!isNaN(e)&&t.trim()!=="")return e;let r=t.trim();if(r.startsWith("[")&&r.endsWith("]")||r.startsWith("{")&&r.endsWith("}"))try{return JSON.parse(r)}catch{}return t}function FR(){let t=new Set;for(let o of Object.keys(jn()))t.add(o);let r=[{obj:Wr.defaults(),prefix:""}];for(;r.length>0;){let{obj:o,prefix:n}=r.pop();if(o==null||typeof o!="object"||Array.isArray(o)){n&&t.add(n);continue}for(let[i,s]of Object.entries(o)){let a=n?`${n}.${i}`:i;s!==null&&typeof s=="object"&&!Array.isArray(s)?r.push({obj:s,prefix:a}):t.add(a)}}return Array.from(t).sort()}function qR(t){let e=FR();if(e.includes(t))return{ok:!0};let r=t.toLowerCase(),o=r.split(".")[0],n=e.filter(c=>c.toLowerCase().startsWith(o)),i=e.filter(c=>c.toLowerCase().includes(r)),s=Array.from(new Set([...n,...i])).slice(0,10),a=[];if(a.push(`Unknown config key: "${t}".`),s.length>0){a.push("Did you mean one of:");for(let c of s)a.push(` - ${c}`)}return a.push(""),a.push(`Valid keys: ${e.join(", ")}`),{ok:!1,message:a.join(`
|
|
291
|
+
`)}}function Ak(t,e){if(t==="list"&&e===void 0){VR();return}let r=je(),o=jk(r),n=Nk(o),i=qR(t);if(!i.ok){console.error(yr.default.red(i.message)),process.exitCode=1;return}if(e===void 0){let s=Ck(n,t);console.log(s===void 0?yr.default.gray("(not set)"):typeof s=="object"?JSON.stringify(s,null,2):String(s))}else{let s=LR(e);ZR(n,t,s),UR(o,n),console.log(ce(`Set ${t} = ${JSON.stringify(s)}`)),HR(r,t,s)}}function VR(){let t=je(),e=jk(t),r=Nk(e),o=jn(),n=Object.keys(o).filter(i=>o[i].public===!0).sort();if(n.length===0){console.log(yr.default.gray("(no public settings registered)"));return}console.log(ce("aide-memory \xB7 configurable settings")),console.log("");for(let i of n){let s=o[i],a=Ck(r,i),c=a!==void 0,u=typeof s.value=="object"?JSON.stringify(s.value):String(s.value),l=c?typeof a=="object"?JSON.stringify(a):String(a):yr.default.gray("(default)");if(console.log(yr.default.bold(i)),console.log(` current: ${c?yr.default.cyan(l):l}`),console.log(` default: ${yr.default.gray(u)}`),s.description){let d=s.description.split(`
|
|
292
|
+
`).map(p=>` ${p}`).join(`
|
|
293
|
+
`);console.log(yr.default.dim(d))}console.log("")}console.log(yr.default.gray("Set a value: aide-memory config <key> <value> \u2022 Read: aide-memory config <key>"))}function HR(t,e,r){if(new Set(["memories.hideFromGrep"]).has(e)){let i=su(t);for(let s of i)console.log(ce(s))}if(e.startsWith("injection.")||e==="memories.softening.threshold")try{let i=Mt(ot(),t);for(let s of i)s.written&&console.log(ce(`regenerated ${s.dest}`)),s.budgetWarning&&console.warn(ce(s.budgetWarning))}catch(i){console.warn(ce(`rules regen skipped: ${i.message}`))}}var uu=C(dt());Ot();var vr=C(require("path")),tr=C(require("fs")),JR={preferences:"preferences",technical:"technical",area_context:"area_context",guidelines:"guidelines"},fs=class{constructor(e){this.store=e,this.db=e.db;let r=e.memoriesPath;if(!r)throw new Error("MemorySync requires a store in file-per-memory mode (use { projectRoot } constructor)");this.memoriesDir=r}importFromFiles(){let e={imported:0,updated:0,removed:0,conflicts:[],errors:[]},r=this.collectJsonFiles(),o=new Set;for(let i of r)if(!this.isPersonalPreference(i))try{let s=tr.default.readFileSync(i,"utf-8"),a=JSON.parse(s);if(!this.isValidMemoryFile(a)){e.errors.push(`Malformed file: ${vr.default.relative(this.memoriesDir,i)}`);continue}o.add(a.uuid);let c=this.getByUuid(a.uuid);if(c){if(c.updated_at>a.updated_at){e.conflicts.push({uuid:a.uuid,reason:"local edits would be overwritten",localUpdatedAt:c.updated_at,incomingUpdatedAt:a.updated_at});continue}if(c.updated_at===a.updated_at)continue;this.updateFromFile(c.id,a),e.updated++}else this.insertFromFile(a),e.imported++}catch(s){let a=vr.default.relative(this.memoriesDir,i);e.errors.push(`Error reading ${a}: ${s instanceof Error?s.message:String(s)}`)}let n=this.getAllUuids();for(let i of n)if(!o.has(i.uuid)){if(i.layer==="preferences"&&i.shared===0)continue;this.deleteByUuid(i.uuid),e.removed++}return e}exportToFiles(){let e={imported:0,updated:0,removed:0,conflicts:[],errors:[]},r=this.store.list();for(let o of r)try{let n=this.getMemoryFilePath(o.uuid,o.layer,o.shared);if(tr.default.existsSync(n))continue;let i=vr.default.dirname(n);tr.default.existsSync(i)||tr.default.mkdirSync(i,{recursive:!0});let s={uuid:o.uuid,layer:o.layer,what:o.what,why:o.why,scope:o.scope,context_label:o.context_label,contributor:o.contributor,tags:o.tags,source:o.source,shared:o.shared,generated_by:o.generated_by,derived_from:o.derived_from,created_at:o.created_at,updated_at:o.updated_at},a=n+".tmp";tr.default.writeFileSync(a,JSON.stringify(s,null,2)+`
|
|
294
|
+
`,"utf-8"),tr.default.renameSync(a,n),e.imported++}catch(n){e.errors.push(`Error exporting ${o.uuid}: ${n instanceof Error?n.message:String(n)}`)}return e}syncFromGit(){let e={imported:0,updated:0,removed:0,conflicts:[],errors:[]},r=this.collectJsonFiles(),o=new Set;for(let i of r)if(!this.isPersonalPreference(i))try{let s=tr.default.readFileSync(i,"utf-8"),a=JSON.parse(s);if(!this.isValidMemoryFile(a)){e.errors.push(`Malformed file: ${vr.default.relative(this.memoriesDir,i)}`);continue}o.add(a.uuid);let c=this.getByUuid(a.uuid);c?a.updated_at>c.updated_at?(this.updateFromFile(c.id,a),e.updated++):a.updated_at<c.updated_at&&e.conflicts.push({uuid:a.uuid,reason:"local edits would be overwritten",localUpdatedAt:c.updated_at,incomingUpdatedAt:a.updated_at}):(this.insertFromFile(a),e.imported++)}catch(s){let a=vr.default.relative(this.memoriesDir,i);e.errors.push(`Error reading ${a}: ${s instanceof Error?s.message:String(s)}`)}let n=this.getAllUuids();for(let i of n)if(!o.has(i.uuid)){if(i.layer==="preferences"&&i.shared===0)continue;this.deleteByUuid(i.uuid),e.removed++}return e}getByUuid(e){return this.db.prepare("SELECT id, updated_at, layer, shared FROM memories WHERE uuid = ?").get(e)}getAllUuids(){return this.db.prepare("SELECT uuid, layer, shared FROM memories").all()}insertFromFile(e){this.db.prepare(`
|
|
218
295
|
INSERT INTO memories (uuid, layer, what, why, scope, context_label, contributor,
|
|
219
296
|
tags, source, shared, generated_by, derived_from, created_at, updated_at,
|
|
220
297
|
recalled_count, last_recalled_at)
|
|
221
298
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 0, NULL)
|
|
222
|
-
`).run(e.uuid,e.layer,e.what,e.why??null,e.scope??null,e.context_label??null,e.contributor,JSON.stringify(e.tags??[]),e.source??"import",e.shared?1:0,e.generated_by?JSON.stringify(e.generated_by):null,e.derived_from?JSON.stringify(e.derived_from):null,e.created_at,e.updated_at)}updateFromFile(e,
|
|
299
|
+
`).run(e.uuid,e.layer,e.what,e.why??null,e.scope??null,e.context_label??null,e.contributor,JSON.stringify(e.tags??[]),e.source??"import",e.shared?1:0,e.generated_by?JSON.stringify(e.generated_by):null,e.derived_from?JSON.stringify(e.derived_from):null,e.created_at,e.updated_at)}updateFromFile(e,r){this.db.prepare(`
|
|
223
300
|
UPDATE memories SET
|
|
224
301
|
layer = ?, what = ?, why = ?, scope = ?, context_label = ?,
|
|
225
302
|
contributor = ?, tags = ?, source = ?, shared = ?,
|
|
226
303
|
generated_by = ?, derived_from = ?,
|
|
227
304
|
created_at = ?, updated_at = ?
|
|
228
305
|
WHERE id = ?
|
|
229
|
-
`).run(
|
|
230
|
-
Created:`));for(let
|
|
231
|
-
Skipped (already exists):`));for(let
|
|
232
|
-
Warnings:`));for(let
|
|
233
|
-
`).filter(
|
|
234
|
-
`).some(
|
|
235
|
-
`)}catch{}}function
|
|
236
|
-
`))
|
|
237
|
-
`)+(
|
|
306
|
+
`).run(r.layer,r.what,r.why??null,r.scope??null,r.context_label??null,r.contributor,JSON.stringify(r.tags??[]),r.source??"import",r.shared?1:0,r.generated_by?JSON.stringify(r.generated_by):null,r.derived_from?JSON.stringify(r.derived_from):null,r.created_at,r.updated_at,e)}deleteByUuid(e){this.db.prepare("DELETE FROM memories WHERE uuid = ?").run(e)}isPersonalPreference(e){return vr.default.relative(this.memoriesDir,e).replace(/\\/g,"/").startsWith("preferences/personal/")}isValidMemoryFile(e){return e&&typeof e=="object"&&typeof e.uuid=="string"&&typeof e.layer=="string"&&typeof e.what=="string"&&typeof e.contributor=="string"&&typeof e.created_at=="string"&&typeof e.updated_at=="string"}getMemoryFilePath(e,r,o){let n;return r==="preferences"?n=vr.default.join("preferences",o?"shared":"personal"):n=JR[r],vr.default.join(this.memoriesDir,n,`${e}.json`)}collectJsonFiles(){if(!tr.default.existsSync(this.memoriesDir))return[];let e=[],r=o=>{if(!tr.default.existsSync(o))return;let n=tr.default.readdirSync(o,{withFileTypes:!0});for(let i of n){let s=vr.default.join(o,i.name);i.isDirectory()?r(s):i.name.endsWith(".json")&&!i.name.endsWith(".tmp")&&e.push(s)}};return r(this.memoriesDir),e}};Gr();Qt();function Dk(t,e,r=!1){let o=[];e.imported>0&&o.push(`${e.imported} ${r?"exported":"imported"}`),e.updated>0&&o.push(`${e.updated} updated`),e.removed>0&&o.push(`${e.removed} removed`),o.length>0?console.log(ce(`${t} complete: ${o.join(", ")}.`)):console.log(uu.default.gray(`${t}: everything up to date.`));for(let n of e.conflicts)console.log(uu.default.yellow(` Conflict: memory ${n.uuid} has local edits newer than incoming file. Keeping newer version.`));for(let n of e.errors)console.log(uu.default.yellow(` ${n}`))}function Mk(){let t=je(),e=new $e({projectRoot:t});try{let o=new fs(e).importFromFiles();if(Dk("Import",o),o.imported>0||o.updated>0)try{Mt(ot(),t)}catch{}}finally{e.close()}}function Uk(){let t=je(),e=new $e({projectRoot:t});try{let o=new fs(e).exportToFiles();Dk("Export",o,!0)}finally{e.close()}}var jo=C(require("fs")),lu=C(require("path")),du=C(dt());function BR(t){let e=t.match(/^(\d+)\s*([smhd])$/);if(!e)throw new Error(`Invalid duration: ${t}. Use formats like "7d", "24h", "30m".`);let r=parseInt(e[1],10),o=e[2];return r*{s:1e3,m:6e4,h:36e5,d:864e5}[o]}function Zk(t={}){let e=je(),r=lu.default.join(e,".aide","cache");if(!jo.default.existsSync(r)){console.log(du.default.gray("No cache directory \u2014 nothing to clean."));return}let o=t.all?0:BR(t.olderThan||"7d"),n=Date.now()-o,i=["recalled-paths-","searched-queries-","correction-pending-","recalled-ids-"],s=jo.default.readdirSync(r),a=[];for(let c of s){if(!i.some(d=>c.startsWith(d)))continue;let u=lu.default.join(r,c);jo.default.statSync(u).mtimeMs<n&&a.push(u)}if(a.length===0){console.log(du.default.gray("No stale tracking files found."));return}if(t.dryRun){console.log(ce(`Would delete ${a.length} stale file(s):`));for(let c of a){let u=jo.default.statSync(c),l=Math.floor((Date.now()-u.mtimeMs)/36e5);console.log(du.default.gray(` ${lu.default.basename(c)} (${l}h old)`))}return}for(let c of a)jo.default.unlinkSync(c);console.log(ce(`Cleaned up ${a.length} stale tracking file(s).`))}var Bm=C(dt());function Lk(){console.log(Bm.default.yellow("Migration is not yet implemented. Coming soon.")),console.log(Bm.default.gray("This command will migrate from the legacy memory.db format."))}var Ln=C(dt());Zn();function Fk(t){let e=process.cwd();if(t.reset){let o=require("path").join(e,".aide","config.json"),n=require("fs");n.existsSync(o)&&(n.unlinkSync(o),console.log(ce("Config reset to factory defaults."))),t.force=!0}let r={updateRules:t.updateRules,force:t.force};Vm(e,r).then(o=>{if(t.updateRules?console.log(ce("Rules files updated.")):console.log(ce("Project initialized for aide-memory.")),o.created.length>0){console.log(Ln.default.white(`
|
|
307
|
+
Created:`));for(let n of o.created)console.log(ce(` + ${n}`))}if(o.skipped.length>0){console.log(Ln.default.gray(`
|
|
308
|
+
Skipped (already exists):`));for(let n of o.skipped)console.log(Ln.default.gray(` - ${n}`))}if(o.warnings.length>0){console.log(Ln.default.yellow(`
|
|
309
|
+
Warnings:`));for(let n of o.warnings)console.log(Ln.default.yellow(` ! ${n}`))}}).catch(o=>{console.error(Ln.default.red(`Init failed: ${o.message}`)),process.exit(1)})}var Zt=C(require("fs")),Qr=C(require("path")),mw=require("child_process");Qt();async function WR(){return new Promise(t=>{let e="";process.stdin.setEncoding("utf8"),process.stdin.on("data",r=>e+=r),process.stdin.on("end",()=>t(e)),process.stdin.isTTY&&t("")})}async function qk(){let t=await WR();if(!t||!t.trim())return{};try{return JSON.parse(t)}catch{return{}}}function Vk(t){let r=Un().translateOutput(t);r&&process.stdout.write(r)}function jr(t,e,r){Vk({kind:"additionalContext",event:t,context:e,systemMessage:r})}function No(t,e,r){Vk({kind:"block",reason:t,systemMessage:e,event:r})}Qt();ts();var We=C(require("fs")),rw=C(require("os")),it=C(require("path"));Sm();Ot();var xe=C(require("fs")),Xr=C(require("path"));function Fn(t){return Xr.join(t,".aide","cache")}function Co(t){let e=Fn(t);try{xe.mkdirSync(e,{recursive:!0})}catch{}return e}function pu(t,e){return Xr.join(Fn(t),`recalled-paths-${e}.txt`)}function Hk(t,e){return Xr.join(Fn(t),`searched-queries-${e}.txt`)}function Wm(t,e){return Xr.join(Fn(t),`correction-pending-${e}.txt`)}function Jk(t,e){return Xr.join(Fn(t),`stop-count-${e}.txt`)}function Bk(t,e){return Xr.join(Fn(t),`stop-followup-pending-${e}.txt`)}function Gm(t,e){let r=pu(t,e);if(!xe.existsSync(r))return[];try{let n=xe.readFileSync(r,"utf8").split(`
|
|
310
|
+
`).filter(s=>s.startsWith("ids|"));return n.length===0?[]:n[n.length-1].slice(4).split(",").map(s=>s.trim()).filter(Boolean)}catch{return[]}}function Km(t,e,r){let o=pu(t,e);if(!xe.existsSync(o))return!1;try{return xe.readFileSync(o,"utf8").split(`
|
|
311
|
+
`).some(i=>i===`file|${r}`)}catch{return!1}}function ms(t,e,r,o){Co(t);let n=pu(t,e);try{xe.appendFileSync(n,`${r}|${o}
|
|
312
|
+
`)}catch{}}function Xm(t,e,r){Co(t);let o=pu(t,e),n=[],i=[];if(xe.existsSync(o))try{let u=xe.readFileSync(o,"utf8");for(let l of u.split(`
|
|
313
|
+
`))l.startsWith("ids|")?i=l.slice(4).split(",").map(d=>d.trim()).filter(Boolean):l.length>0&&n.push(l)}catch{}let s=new Set([...i,...r.map(u=>u.trim()).filter(Boolean)]),a=Array.from(s).sort((u,l)=>Number(u)-Number(l)),c=n.join(`
|
|
314
|
+
`)+(n.length>0?`
|
|
238
315
|
`:"")+`ids|${a.join(",")}
|
|
239
|
-
`;try{
|
|
240
|
-
`).some(
|
|
241
|
-
`)}catch{}}function
|
|
242
|
-
`).filter(
|
|
243
|
-
`),e}var
|
|
244
|
-
`):typeof
|
|
245
|
-
`),
|
|
246
|
-
`):void 0,
|
|
316
|
+
`;try{xe.writeFileSync(o,c)}catch{}}function Wk(t,e,r){let o=Hk(t,e);if(!xe.existsSync(o))return!1;try{return xe.readFileSync(o,"utf8").split(`
|
|
317
|
+
`).some(i=>i===r)}catch{return!1}}function Gk(t,e,r){Co(t);let o=Hk(t,e);try{xe.appendFileSync(o,`${r}
|
|
318
|
+
`)}catch{}}function Ym(t,e){let r=Fn(t),o=[`recalled-paths-${e}.txt`,`searched-queries-${e}.txt`,`correction-pending-${e}.txt`,`compact-pending-${e}.txt`,`stop-count-${e}.txt`,`stop-followup-pending-${e}.txt`];for(let n of o)try{xe.unlinkSync(Xr.join(r,n))}catch{}}function Kk(t,e){let r=Jk(t,e);if(!xe.existsSync(r))return 0;try{let o=xe.readFileSync(r,"utf8").trim(),n=parseInt(o,10);return Number.isFinite(n)?n:0}catch{return 0}}function Xk(t,e,r){Co(t);try{xe.writeFileSync(Jk(t,e),String(r))}catch{}}function Qm(t,e){Co(t);try{xe.writeFileSync(Bk(t,e),"1")}catch{}}function Yk(t,e){let r=Bk(t,e);if(!xe.existsSync(r))return!1;try{xe.unlinkSync(r)}catch{}return!0}function Qk(t,e){return xe.existsSync(Wm(t,e))}function ew(t,e,r){Co(t);try{xe.writeFileSync(Wm(t,e),r)}catch{}}function eh(t,e){try{xe.unlinkSync(Wm(t,e))}catch{}}function th(t){return(t||"").toLowerCase().trim()}Qt();var hs=C(require("fs")),Yr=C(require("path"));Ot();Fc();var rh=new Set(["the","this","that","from","with","into","for","and","but","not","all","are","was","were","been","have","has","had","will","can","should","would","could","may","must","use","used","using","also","when","what","how","why","who","which","where","then","than","each","every","some","any","does","done","only","just","more","most","very","same","other","after","before","about","between","IMPORTANT","COMPLETE","DONE","TODO","NOTE","PENDING","NEW","OLD","TRUE","FALSE","YES","NO","NEVER","ALWAYS"]);function tw(t){let e={},r=t.match(/[a-zA-Z]+-[a-zA-Z]+(?:-[a-zA-Z]+)*/g)||[];for(let n of r){let i=n.toLowerCase();rh.has(i)||(e[i]=(e[i]||0)+1)}let o=t.split(/[.\n]+/);for(let n of o){let i=n.trim().split(/\s+/).slice(1);for(let s of i)if(/^[A-Z][a-z]{2,}/.test(s)){let a=s.replace(/[^a-zA-Z]/g,"");a.length>2&&!rh.has(a)&&!rh.has(a.toUpperCase())&&(e[a]=(e[a]||0)+1)}}return e}function nh(t,e){let r=Yr.join(t,".aide");if(!hs.existsSync(r))return null;let o=e.endsWith("/"),n=t,i=e;try{n=hs.realpathSync(t)}catch{}try{i=hs.realpathSync(e)}catch{}let s=e;Yr.isAbsolute(i)&&i.startsWith(n)&&(s=Yr.relative(n,i)),o&&!s.endsWith("/")&&(s=s+"/");let a=new $e({projectRoot:t});try{let c=a.list(),u=Bx(c,s,t),l=0;for(let ne of c)(!ne.scope||ne.scope==="project")&&l++;let d=u.memories;if(d.length===0)return null;let p=u.layers,f=u.count,m=u.ids,y=0,x=0;for(let ne of d){let Fe=ne.scope||"";Fe.endsWith("/")||Fe.endsWith("/**")||Fe.endsWith("/*")?x++:y++}let v=c.length,P={},_={};for(let ne of d){let Fe=[ne.what,ne.why||"",ne.context_label||""].join(" "),Yt=tw(Fe);for(let[Tr,Xi]of Object.entries(Yt))P[Tr]=(P[Tr]||0)+Xi;_[ne.layer]||(_[ne.layer]=""),_[ne.layer]+=" "+Fe}let w=Object.entries(P).sort((ne,Fe)=>Fe[1]-ne[1]).slice(0,8).map(([ne])=>ne),R=new Set(w),G={};for(let[ne,Fe]of Object.entries(_)){let Yt=tw(Fe);G[ne]=Object.entries(Yt).sort((Tr,Xi)=>Xi[1]-Tr[1]).slice(0,2).map(([Tr])=>Tr)}let be=[];for(let[,ne]of Object.entries(G))if(!ne.some(Yt=>R.has(Yt))&&ne.length>0)for(let Yt of ne)!R.has(Yt)&&be.length<2&&be.push(Yt);let Oe=[...w,...be],Tt=null;if(s&&!s.endsWith("/")&&s.includes("/")){let ne=Yr.dirname(s);ne&&ne!=="."&&(Tt=ne+"/")}return{count:d.length,scoped_count:f,scoped_ids:m,project_count:l,total_memories:v,layers:p,file_count:y,dir_count:x,topics:Oe,per_layer_topics:G,suggested_path:Tt}}finally{a.close()}}zm();function rr(t){return t.cwd?t.cwd:process.cwd()}function nr(t){return t.session_id||"default"}var GR=Uc;function Ao(t){return Ut(t,"hooks.visible")!==!1}var KR="\x1B[38;2;0;194;203m",XR="\x1B[0m",_r=`${KR}aide-memory \xB7 ${XR}`;function Ut(t,e){let r=GR[e];if(!r)return;let o=r.value;if(r.public!==!0)return o;let n=it.join(t,".aide","config.json");if(!We.existsSync(n))return o;let i;try{i=JSON.parse(We.readFileSync(n,"utf8"))}catch{return o}let s=e.split("."),a=i;for(let c of s){if(a==null||typeof a!="object"||Array.isArray(a)||!Object.prototype.hasOwnProperty.call(a,c))return o;a=a[c]}return a}async function nw(t){let e=t.tool_input?.file_path;if(!e||!We.existsSync(e))return;if(e.includes(".aide/memories/")){jr("PreToolUse","memory_file_direct_read: You are reading a raw memory file. Use aide_recall for structured context.");return}let r=rr(t),o=nr(t),n=it.isAbsolute(e)?e:it.resolve(r,e),i=Ut(r,"hooks.read.maxBlocks");if(i===0||i==="0")return;let s=nh(r,n);if(!s||s.count===0||s.scoped_count===0||s.scoped_ids.length===0)return;let a=Gm(r,o),c=new Set(a.map(String)),u=[],l=0;for(let _ of s.scoped_ids)c.has(String(_))?l++:u.push(String(_));let d=Km(r,o,n);if(ms(r,o,"file",n),l===s.scoped_ids.length)return;let p=s.scoped_ids.length-l,f=Number(Ut(r,"memories.softening.threshold")??10),m=s.total_memories<f,y;if(l===0){let _=Object.entries(s.layers).map(([R,G])=>`${G} ${R}`).join(", "),w=(s.topics||[]).join(", ");w?y=`${s.scoped_count} memories for ${n} (${_}) \u2014 topics: ${w}. Call aide_recall({paths: ['${n}']}).`:y=`${s.scoped_count} memories for ${n}. Call aide_recall({paths: ['${n}']}).`}else y=`${p} memories for ${n} not yet recalled. Call aide_recall({ids: [${u.join(",")}]}).`;let x=Ao(r),v=x?`${_r}prompting aide_recall \u2014 additional scoped memories not yet recalled`:void 0,P=x?`${_r}prompting aide_recall \u2014 scoped memories not recalled yet (expected flow)`:void 0;m||d?jr("PreToolUse",y,v):No(y,P)}async function ow(t){let e=t.tool_input?.file_path;if(!e||!We.existsSync(e))return;let r=rr(t),o=nr(t),n=it.isAbsolute(e)?e:it.resolve(r,e),i=Ut(r,"hooks.edit.maxBlocks");if(i===0||i==="0")return;let s=nh(r,n);if(!s||s.count===0||s.scoped_count===0||s.scoped_ids.length===0)return;let a=Gm(r,o),c=new Set(a.map(String)),u=[],l=0;for(let _ of s.scoped_ids)c.has(String(_))?l++:u.push(String(_));let d=Km(r,o,n);if(ms(r,o,"file",n),l===s.scoped_ids.length)return;let p=s.scoped_ids.length-l,f=Number(Ut(r,"memories.softening.threshold")??10),m=s.total_memories<f,y;l===0?y=`${s.scoped_count} memories for ${n}. Call aide_recall({paths: ['${n}']}) before editing.`:y=`${p} memories for ${n} not yet recalled. Call aide_recall({ids: [${u.join(",")}]}) before editing.`;let x=Ao(r),v=x?`${_r}prompting aide_recall \u2014 additional scoped memories not yet recalled`:void 0,P=x?`${_r}prompting aide_recall \u2014 scoped memories not recalled yet (expected flow)`:void 0;m||d?jr("PreToolUse",y,v):No(y,P)}async function iw(t){let e=t.tool_input?.pattern;if(!e)return;let r=rr(t),o=nr(t),n=Ut(r,"hooks.search.mode");if(n==="off")return;let i=it.join(r,".aide");if(!We.existsSync(i))return;let s=0,a=[],c=new $e({projectRoot:r});try{let y=c.list(),x=e.toLowerCase(),v=y.filter(P=>{let _=(P.what||"").toLowerCase(),w=(P.why||"").toLowerCase();return _.includes(x)||w.includes(x)});if(s=v.length,s===0)return;a=v.slice(0,3).map(P=>{let _=P.what||"";return _.length>30?_.slice(0,30)+"...":_})}finally{c.close()}if(s===0)return;let u=a.join(", "),l=th(e),d=Wk(r,o,l),f=Ao(r)?`${_r}prompting aide_search for "${e}" \u2014 ${s} matching ${s===1?"memory":"memories"}`:void 0;if(d){jr("PreToolUse",`${s} aide memories match '${e}' (${u}). Call aide_search({keyword: '${e}'}).`,f);return}let m=`${s} aide memories match '${e}' (${u}). Call aide_search({keyword: '${e}'}).`;n==="block"?No(m,f):jr("PreToolUse",m,f)}var YR=new RegExp("(no[, ]+(don'?t|do not|can'?t|won'?t|isn'?t|wasn'?t|weren'?t|shouldn'?t|didn'?t|couldn'?t|wouldn'?t|mustn'?t|haven'?t|hadn'?t|aren'?t|use|instead|that'?s wrong)|no[, ]+(we|I|it|you)\\s+(use|go with|prefer|want|need|should)|no[, ]+try\\s+.+\\s+instead|actually[, ]|wrong[, ]|not like that|use .+ instead|don'?t use|stop using|I told you|I said)","i"),QR=new RegExp("(let'?s (use|go with)|we should|go with|the approach is|decided to|decision is|we'?re going|from now on)","i"),ej=new RegExp("(I prefer|always use|never use|I like|my style is|I want you to|don'?t ever|make sure to always|I always)","i"),tj=new RegExp("^(no I mean (the|that|this|it|a|an|one|those)\\s|no (but|actually I|I think|not sure)|I don'?t (think|know|get|understand)|what I mean)","i"),rj=new RegExp("(correction (prompt|regex|pattern|hook|flag|detection)|matched correction|hooks?\\.correction|correction[- ]pending)","i");function nj(t){let e=t.replace(/```[\s\S]*?```/g,"");return e=e.replace(/`[^`\n]*`/g,""),e=e.split(`
|
|
319
|
+
`).filter(r=>!/^\s*["'`]/.test(r)).join(`
|
|
320
|
+
`),e}var oj="Your prompt may contain a correction or convention worth persisting. If something here applies to future work in this project \u2014 across preferences (how you work), technical (stack facts, why-decisions), area_context (decisions for this code area), or guidelines (team rules) \u2014 call aide_remember on the matching layer. Otherwise respond as normal.";async function sw(t){let e=t.prompt||"";if(!e||e.trim().split(/\s+/).filter(Boolean).length<3||tj.test(e)||rj.test(e))return;let o=rr(t),n=nr(t);if(Ut(o,"hooks.correction.enabled")===!1)return;let s=nj(e),a=null;if(YR.test(s)?a="correction":QR.test(s)?a="decision":ej.test(s)&&(a="preference"),!a)return;let u=Ao(o)?`${_r}possible ${a} detected \u2014 consider aide_remember`:void 0;jr("UserPromptSubmit",oj,u);let l=Ut(o,"hooks.correction.escalate");(l==="soft"||l==="block")&&ew(o,n,a)}function ij(t){return t?typeof t=="string"?t:Array.isArray(t)?t.map(e=>typeof e=="object"&&e?.text?e.text:"").join(`
|
|
321
|
+
`):typeof t=="object"&&t.text?t.text:"":""}async function aw(t){let e=ij(t.tool_response);if(!e)return;let r=rr(t),o=nr(t),n=e.match(/\[(\d+)\]/g)||[],i=Array.from(new Set(n.map(s=>s.slice(1,-1))));i.length!==0&&Xm(r,o,i)}var sj="Anything from this turn worth persisting for future sessions in this project? Could touch preferences, technical, area_context, or guidelines. If yes, call aide_remember on the matching layer. Otherwise stop.",aj="A correction or convention from this turn was detected but no memory was stored. If it applies to future work \u2014 preferences, technical, area_context, or guidelines \u2014 call aide_remember on the matching layer. Otherwise stop.";async function cw(t){if(t.stop_hook_active)return;let e=rr(t),r=nr(t),o=Un().id==="cursor";if(o&&Yk(e,r))return;let i=Kk(e,r)+1;Xk(e,r,i);let s=Ao(e),a=Ut(e,"hooks.correction.escalate"),c=Ut(e,"hooks.stop.mode");if(Qk(e,r)&&(eh(e,r),a==="block")){let p=s?`${_r}correction from this turn not yet stored \u2014 prompting aide_remember`:void 0;o&&Qm(e,r),No(aj,p,"stop");return}if(c==="off")return;let u=Ut(e,"hooks.stop.schedule")||[],l=!1;if(!Array.isArray(u)||u.length===0)i%5===0&&(l=!0);else{let p=0,f=!1;for(let m of u){let y=m.every??5;m.until===void 0||m.until===null?f||((i-p)%y===0&&(l=!0),f=!0):i<=m.until&&!f&&((i-p)%y===0&&(l=!0),f=!0),m.until!==void 0&&m.until!==null&&(p=m.until)}}if(!l)return;let d=s?`${_r}checkpoint \u2014 anything worth remembering?`:void 0;o&&Qm(e,r),No(sj,d,"stop")}async function uw(t){let e=rr(t),r=nr(t);Ut(e,"hooks.precompact.mode")!=="off"&&Ym(e,r)}async function lw(t){let e=rr(t),r=nr(t),o=it.join(e,".aide");if(!We.existsSync(o))return;try{let v=it.join(e,".mcp.json");if(We.existsSync(v)){let _=JSON.parse(We.readFileSync(v,"utf8"))?.mcpServers?.["aide-memory"]?.args?.[0];if(_&&!We.existsSync(_)){let w=`aide-memory: MCP server path not found (${_}). This can happen after a Node version change or cache clean. Fix: run "npx aide-memory init" or "npm install -g aide-memory && aide-memory init"`;process.stderr.write(`[AIDE_HEALTH] ${w}
|
|
322
|
+
`),jr("SessionStart",w);return}}}catch{}let n="",i="";try{let{findPackageRoot:v}=(Gc(),Ic(Kx)),P=v();if(!We.existsSync(it.resolve(P,"src","cli"))){let _=it.join(P,"package.json"),w=JSON.parse(We.readFileSync(_,"utf8")).version,R=it.join(rw.homedir(),".aide","update-check.json");if(We.existsSync(R)){let G=JSON.parse(We.readFileSync(R,"utf8"));if(G.latestVersion&&G.latestVersion!==w){let be=w.replace(/^v/,"").split(".").map(Number),Oe=G.latestVersion.replace(/^v/,"").split(".").map(Number);(Oe[0]>be[0]||Oe[0]===be[0]&&Oe[1]>be[1]||Oe[0]===be[0]&&Oe[1]===be[1]&&Oe[2]>be[2])&&(n=`aide-memory v${G.latestVersion} is available (current: v${w}). Run \`npm update -g aide-memory\` to upgrade.`,i=`${_r}update available: v${G.latestVersion}`)}}}}catch{}let s=t.source;if(s==="resume")return;(s==="clear"||s==="compact")&&Ym(e,r);let a=new $e({projectRoot:e}),c="",u=[];try{let v=Bc(e,a);c=v.content,u=v.injectedIds}finally{a.close()}let d=Un().id==="devin"?cj:"";if(!c&&!n&&!d)return;u.length>0&&Xm(e,r,u.map(String));let p=Ao(e),f=u.length,m=[];p&&f>0&&m.push(`${_r}injected ${f} ${f===1?"memory":"memories"} at session start`),i&&m.push(i);let y=m.length>0?m.join(`
|
|
323
|
+
`):void 0,x=[n,d,c].filter(Boolean).join(`
|
|
247
324
|
|
|
248
|
-
`);
|
|
249
|
-
aide-memory v${e} available (current: v${n}).
|
|
250
|
-
Run \`npm update -g aide-memory\` to update.
|
|
251
|
-
`)}Lt();var ln=JSON.parse(ai.readFileSync(ci.join(__dirname,"..","..","package.json"),"utf8"));function li(){let n=new kn;n.name("aide-memory").description("AIDE Memory \u2014 persistent context for AI coding agents").version(ln.version),n.command("recall").description("Recall memories for a file/directory path").argument("<path>","File or directory path to recall context for").action(t=>{No(t)}),n.command("remember").description("Store a new memory").argument("<what>","The knowledge to remember").requiredOption("--layer <layer>","Memory layer: preferences, technical, area_context, guidelines").option("--scope <scope>",'Glob pattern for the code area (e.g. "src/components/**")').option("--tags <tags>","Comma-separated tags / context label").option("--why <why>","Context for why this is worth remembering").option("--contributor <contributor>","Who this knowledge came from").action((t,r)=>{cs(t,r)}),n.command("update").description("Update an existing memory").argument("<id>","Memory ID to update").option("--what <what>","New content").option("--why <why>","New reason").option("--scope <scope>","New scope").option("--tags <tags>","New tags / context label").action((t,r)=>{ls(t,r)}),n.command("forget").description("Delete a memory").argument("<id>","Memory ID to delete").action(t=>{us(t)}),n.command("search").description("Search memories by keyword").argument("<query>","Text to search for").option("--layer <layer>","Filter by layer").option("--limit <limit>","Max results (default 50)").action((t,r)=>{ds(t,r)}),n.command("list").description("List memories").option("--layer <layer>","Filter by layer").option("--scope <scope>","Filter by scope").option("--contributor <contributor>","Filter by contributor").option("--limit <limit>","Max results").option("--tag <tag>","Filter by tag / context label").action(t=>{ps(t)}),n.command("stats").description("Show memory analytics summary").action(()=>{fs()}),n.command("recall-log").description("Show detailed recall history (which memories were returned per recall event)").option("--last <n>","Show only the last N recall events").option("--clear","Clear the recall log").action(t=>{gs(t)}),n.command("config").description("Get or set configuration (dot-notation keys). Use `aide-memory config list` to enumerate all public settings with current value + description.").argument("<key>",'Configuration key (e.g. hooks.visible) or "list" to enumerate all public settings').argument("[value]","Value to set (omit to read)").action((t,r)=>{ws(t,r)});let e=n.command("sync").description("Synchronize between JSON files and SQLite cache");return e.command("import").description("Rebuild SQLite cache from JSON memory files").action(()=>{Es()}),e.command("export").description("Export memories to JSON files").action(()=>{vs()}),n.command("migrate").description("Migrate from legacy memory.db format").action(()=>{xs()}),n.command("cleanup").description("Remove stale session tracking files from .aide/cache/").option("--older-than <duration>",'TTL for cleanup (e.g. "7d", "24h", "30m")',"7d").option("--all","Remove all tracking files regardless of age").option("--dry-run","Show what would be deleted without actually deleting").action(t=>{ks(t)}),n.command("init").description("Initialize a new .aide/ project").option("--update-rules","Only refresh rules files (idempotent)").option("--force","Update all config to current version (merges, preserves user settings)").option("--reset","Reset config to factory defaults (does not delete memories)").action(t=>{Os(t)}),n.command("hook <name>").description("Internal: dispatch a Claude Code hook (called by shell shims)").action(t=>{ei(t)}),n.command("internal-resync <projectRoot>",{hidden:!0}).description("Internal: resync derived artifacts (spawned by hooks on config drift)").action(t=>{try{let{resyncDerivedArtifacts:r}=(it(),er(ss));r(t)}catch{}process.exit(0)}),n}if(require.main===module){li().parse(process.argv);try{let e=process.cwd();new he(e).get("updates.check")&&si(ln.version).then(r=>{r&&ii(ln.version,r)}).catch(()=>{})}catch{}}0&&(module.exports={createProgram});
|
|
325
|
+
`);jr("SessionStart",x,y)}var cj='This project uses aide-memory for persistent, cross-session context (managed via an MCP server + hooks). When an aide-memory hook nudges you \u2014 e.g. "N memories for this path. Call aide_recall(...)", a correction hint, or the Stop checkpoint \u2014 follow it. For how aide-memory works (when to call aide_recall / aide_remember / aide_search, the memory layers, and how to format a memory), use the `aide-memory` skill. Memory management is invisible to the user \u2014 do not mention aide-memory unless asked.';async function dw(t){let e=t.tool_input?.paths;if(!e||!Array.isArray(e)||e.length===0)return;let r=rr(t),o=nr(t);for(let n of e){let i=it.isAbsolute(n)?n:it.join(r,n),s=i.endsWith("/"),a=i.endsWith("/**"),c=i.endsWith("/*"),u=!1,l=i;if(s)u=!0;else if(a)u=!0,l=i.slice(0,-3);else if(c)u=!0,l=i.slice(0,-2);else try{We.statSync(i).isDirectory()&&(u=!0)}catch{}u?(l.endsWith("/")||(l=l+"/"),ms(r,o,"dir",l)):ms(r,o,"file",i)}}async function pw(t){let e=rr(t),r=nr(t);eh(e,r)}async function fw(t){let e=t.tool_input?.keyword;if(!e)return;let r=rr(t),o=nr(t),n=th(e);Gk(r,o,n)}function uj(t){try{let e=t.cwd;if(!e)return;let r=Qr.join(e,".aide","config.json"),o=Qr.join(e,".aide","cache","config-mtime.txt");if(!Zt.existsSync(r))return;let n=String(Zt.statSync(r).mtimeMs),i="";try{i=Zt.readFileSync(o,"utf8").trim()}catch{}if(n===i)return;Zt.mkdirSync(Qr.dirname(o),{recursive:!0}),Zt.writeFileSync(o,n,"utf8");try{let s=process.argv[1]&&/aide-memory(?:\.js)?$/.test(process.argv[1])?process.argv[1]:Qr.resolve(__dirname,"..","..","cli","aide-memory.js");if(!Zt.existsSync(s)){let c=Qr.resolve(__dirname,"..","..","cli","aide-memory.js");Zt.existsSync(c)&&(s=c)}(0,mw.spawn)(process.execPath,[s,"internal-resync",e],{detached:!0,stdio:"ignore",cwd:e}).unref()}catch{}}catch{}}var lj={"pre-read":nw,"pre-edit":ow,"pre-search":iw,"pre-prompt":sw,"post-tool-use-recall":aw,stop:cw,"pre-compact":uw,"session-start":lw,"pre-recall":dw,"post-remember":pw,"post-search":fw};async function hw(t){let e=lj[t];if(!e){Pr(`aide-memory hook: unknown event "${t}"`,"check .claude/settings.json or .cursor/hooks.json command lines");return}let r=performance.now();try{let o=await qk(),n=Un(),i=n.translateInput(o);if(uj(i),pt("hooks",`enter hook=${t} adapter=${n.id} cwd=${i.cwd??""} session=${i.session_id??""} file=${i.tool_input?.file_path??""}`),Sx("hooks")){let s=process.stdout.write.bind(process.stdout),a="";process.stdout.write=(c,...u)=>{try{a+=typeof c=="string"?c:String(c)}catch{}return s(c,...u)};try{await e(i)}finally{process.stdout.write=s,pt("hooks",`exit hook=${t} duration=${(performance.now()-r).toFixed(1)}ms stdout-len=${a.length} stdout-head=${JSON.stringify(a.slice(0,200))}`)}}else await e(i),pt("hooks",`exit hook=${t} duration=${(performance.now()-r).toFixed(1)}ms`)}catch(o){let n=o,i=n?.message??String(o);/NODE_MODULE_VERSION|node-loader|wrong ELF class|invalid ELF header|dlopen/i.test(i)?Pr(`aide-memory hook=${t}: native binding load failed (${i})`,"reinstall aide-memory or run `npm rebuild libsql` in the install dir"):/ENOENT|MODULE_NOT_FOUND/i.test(i)?Pr(`aide-memory hook=${t}: missing file/module (${i})`,"reinstall aide-memory \u2014 dist/ may be incomplete"):Pr(`aide-memory hook=${t} threw: ${i}`),pt("hooks",`error hook=${t} duration=${(performance.now()-r).toFixed(1)}ms class=${n?.name??"Error"}`)}}async function gw(t){await hw(t),process.exit(0)}var GP=C(require("fs")),KP=C(require("path"));uh();Qc();var T$=JSON.parse(GP.readFileSync(KP.join(__dirname,"..","..","package.json"),"utf8"));function XP(){let t=new V$;t.name("aide-memory").description("AIDE Memory \u2014 persistent context for AI coding agents").version(T$.version),t.command("recall").description("Recall memories for a file/directory path").argument("<path>","File or directory path to recall context for").action(r=>{Gx(r)}),t.command("remember").description("Store a new memory").argument("<what>","The knowledge to remember").requiredOption("--layer <layer>","Memory layer: preferences, technical, area_context, guidelines").option("--scope <scope>",'Glob pattern for the code area (e.g. "src/components/**")').option("--tags <tags>","Comma-separated tags / context label").option("--why <why>","Context for why this is worth remembering").option("--contributor <contributor>","Who this knowledge came from").action((r,o)=>{wk(r,o)}),t.command("update").description("Update an existing memory").argument("<id>","Memory ID to update").option("--what <what>","New content").option("--why <why>","New reason").option("--scope <scope>","New scope").option("--tags <tags>","New tags / context label").action((r,o)=>{Sk(r,o)}),t.command("forget").description("Delete a memory").argument("<id>","Memory ID to delete").action(r=>{Ek(r)}),t.command("search").description("Search memories by keyword").argument("<query>","Text to search for").option("--layer <layer>","Filter by layer").option("--limit <limit>","Max results (default 50)").action((r,o)=>{Ik(r,o)}),t.command("list").description("List memories").option("--layer <layer>","Filter by layer").option("--scope <scope>","Filter by scope").option("--contributor <contributor>","Filter by contributor").option("--limit <limit>","Max results").option("--tag <tag>","Filter by tag / context label").action(r=>{zk(r)}),t.command("stats").description("Show memory analytics summary").action(()=>{Ok()}),t.command("recall-log").description("Show detailed recall history (which memories were returned per recall event)").option("--last <n>","Show only the last N recall events").option("--clear","Clear the recall log").action(r=>{Rk(r)}),t.command("config").description("Get or set configuration (dot-notation keys). Use `aide-memory config list` to enumerate all public settings with current value + description.").argument("<key>",'Configuration key (e.g. hooks.visible) or "list" to enumerate all public settings').argument("[value]","Value to set (omit to read)").action((r,o)=>{Ak(r,o)});let e=t.command("sync").description("Synchronize between JSON files and SQLite cache");return e.command("import").description("Rebuild SQLite cache from JSON memory files").action(()=>{Mk()}),e.command("export").description("Export memories to JSON files").action(()=>{Uk()}),t.command("migrate").description("Migrate from legacy memory.db format").action(()=>{Lk()}),t.command("cleanup").description("Remove stale session tracking files from .aide/cache/").option("--older-than <duration>",'TTL for cleanup (e.g. "7d", "24h", "30m")',"7d").option("--all","Remove all tracking files regardless of age").option("--dry-run","Show what would be deleted without actually deleting").action(r=>{Zk(r)}),t.command("init").description("Initialize a new .aide/ project").option("--update-rules","Only refresh rules files (idempotent)").option("--force","Update all config to current version (merges, preserves user settings)").option("--reset","Reset config to factory defaults (does not delete memories)").action(r=>{Fk(r)}),t.command("mcp").description("Start the aide-memory MCP server over stdio (for MCP clients / registries)").argument("[projectRoot]","Project root to serve memories for (default: current directory)").action(r=>{let{startServer:o}=(WP(),Ic(BP));o(r||process.cwd()).catch(n=>{console.error("Failed to start aide-memory server:",n),process.exit(1)})}),t.command("hook <name>").description("Internal: dispatch a Claude Code hook (called by shell shims)").action(r=>{gw(r)}),t.command("internal-resync <projectRoot>",{hidden:!0}).description("Internal: resync derived artifacts (spawned by hooks on config drift)").action(r=>{try{let{resyncDerivedArtifacts:o}=(Zn(),Ic(au));o(r)}catch{}process.exit(0)}),t}if(require.main===module&&(XP().parse(process.argv),process.argv[2]!=="mcp"))try{let e=process.cwd();new Wr(e).get("updates.check")&&ah(T$.version).then(o=>{o&&ch(T$.version,o)}).catch(()=>{})}catch{}0&&(module.exports={createProgram});
|