Current File : /home/bravrvjk/hpgt.org/wp-content/plugins/elementor/assets/js/packages/editor-mcp//editor-mcp.js
/*! For license information please see editor-mcp.js.LICENSE.txt */
!function(){"use strict";var u={"./node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js":function(u,l,m){function assertToolsCallTaskCapability(u,l,m){if(!u)throw new Error(`${m} does not support task creation (required for ${l})`);if("tools/call"===l)if(!u.tools?.call)throw new Error(`${m} does not support task creation for tools/call (required for ${l})`)}function assertClientRequestTaskCapability(u,l,m){if(!u)throw new Error(`${m} does not support task creation (required for ${l})`);switch(l){case"sampling/createMessage":if(!u.sampling?.createMessage)throw new Error(`${m} does not support task creation for sampling/createMessage (required for ${l})`);break;case"elicitation/create":if(!u.elicitation?.create)throw new Error(`${m} does not support task creation for elicitation/create (required for ${l})`)}}m.r(l),m.d(l,{assertClientRequestTaskCapability:function(){return assertClientRequestTaskCapability},assertToolsCallTaskCapability:function(){return assertToolsCallTaskCapability}})},"./node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js":function(u,l,m){function isTerminal(u){return"completed"===u||"failed"===u||"cancelled"===u}m.r(l),m.d(l,{isTerminal:function(){return isTerminal}})},"./node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.js":function(u,l,m){m.r(l),m.d(l,{ExperimentalMcpServerTasks:function(){return ExperimentalMcpServerTasks}});class ExperimentalMcpServerTasks{constructor(u){this._mcpServer=u}registerToolTask(u,l,m){const f={taskSupport:"required",...l.execution};if("forbidden"===f.taskSupport)throw new Error(`Cannot register task-based tool '${u}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(u,l.title,l.description,l.inputSchema,l.outputSchema,l.annotations,f,l._meta,m)}}},"./node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js":function(u,l,m){m.r(l),m.d(l,{ExperimentalServerTasks:function(){return ExperimentalServerTasks}});var f=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/types.js");class ExperimentalServerTasks{constructor(u){this._server=u}requestStream(u,l,m){return this._server.requestStream(u,l,m)}createMessageStream(u,l){const m=this._server.getClientCapabilities();if((u.tools||u.toolChoice)&&!m?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(u.messages.length>0){const l=u.messages[u.messages.length-1],m=Array.isArray(l.content)?l.content:[l.content],f=m.some(u=>"tool_result"===u.type),h=u.messages.length>1?u.messages[u.messages.length-2]:void 0,y=h?Array.isArray(h.content)?h.content:[h.content]:[],v=y.some(u=>"tool_use"===u.type);if(f){if(m.some(u=>"tool_result"!==u.type))throw new Error("The last message must contain only tool_result content if any is present");if(!v)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(v){const u=new Set(y.filter(u=>"tool_use"===u.type).map(u=>u.id)),l=new Set(m.filter(u=>"tool_result"===u.type).map(u=>u.toolUseId));if(u.size!==l.size||![...u].every(u=>l.has(u)))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:u},f.CreateMessageResultSchema,l)}elicitInputStream(u,l){const m=this._server.getClientCapabilities(),h=u.mode??"form";switch(h){case"url":if(!m?.elicitation?.url)throw new Error("Client does not support url elicitation.");break;case"form":if(!m?.elicitation?.form)throw new Error("Client does not support form elicitation.")}const y="form"===h&&void 0===u.mode?{...u,mode:"form"}:u;return this.requestStream({method:"elicitation/create",params:y},f.ElicitResultSchema,l)}async getTask(u,l){return this._server.getTask({taskId:u},l)}async getTaskResult(u,l,m){return this._server.getTaskResult({taskId:u},l,m)}async listTasks(u,l){return this._server.listTasks(u?{cursor:u}:void 0,l)}async cancelTask(u,l){return this._server.cancelTask({taskId:u},l)}}},"./node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js":function(u,l,m){m.r(l),m.d(l,{COMPLETABLE_SYMBOL:function(){return f},McpZodTypeKind:function(){return h},completable:function(){return completable},getCompleter:function(){return getCompleter},isCompletable:function(){return isCompletable},unwrapCompletable:function(){return unwrapCompletable}});const f=Symbol.for("mcp.completable");function completable(u,l){return Object.defineProperty(u,f,{value:{complete:l},enumerable:!1,writable:!1,configurable:!1}),u}function isCompletable(u){return!!u&&"object"==typeof u&&f in u}function getCompleter(u){const l=u[f];return l?.complete}function unwrapCompletable(u){return u}var h;!function(u){u.Completable="McpCompletable"}(h||(h={}))},"./node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js":function(u,l,m){m.r(l),m.d(l,{Server:function(){return Server}});var f=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js"),h=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/types.js"),y=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js"),v=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js"),w=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js"),b=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js");class Server extends f.Protocol{constructor(u,l){super(l),this._serverInfo=u,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(h.LoggingLevelSchema.options.map((u,l)=>[u,l])),this.isMessageIgnored=(u,l)=>{const m=this._loggingLevels.get(l);return!!m&&this.LOG_LEVEL_SEVERITY.get(u)<this.LOG_LEVEL_SEVERITY.get(m)},this._capabilities=l?.capabilities??{},this._instructions=l?.instructions,this._jsonSchemaValidator=l?.jsonSchemaValidator??new y.AjvJsonSchemaValidator,this.setRequestHandler(h.InitializeRequestSchema,u=>this._oninitialize(u)),this.setNotificationHandler(h.InitializedNotificationSchema,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(h.SetLevelRequestSchema,async(u,l)=>{const m=l.sessionId||l.requestInfo?.headers["mcp-session-id"]||void 0,{level:f}=u.params,y=h.LoggingLevelSchema.safeParse(f);return y.success&&this._loggingLevels.set(m,y.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new w.ExperimentalServerTasks(this)}),this._experimental}registerCapabilities(u){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=(0,f.mergeCapabilities)(this._capabilities,u)}setRequestHandler(u,l){const m=(0,v.getObjectShape)(u),f=m?.method;if(!f)throw new Error("Schema is missing a method literal");let y;if((0,v.isZ4Schema)(f)){const u=f,l=u._zod?.def;y=l?.value??u.value}else{const u=f,l=u._def;y=l?.value??u.value}if("string"!=typeof y)throw new Error("Schema method literal must be a string");if("tools/call"===y){const wrappedHandler=async(u,m)=>{const f=(0,v.safeParse)(h.CallToolRequestSchema,u);if(!f.success){const u=f.error instanceof Error?f.error.message:String(f.error);throw new h.McpError(h.ErrorCode.InvalidParams,`Invalid tools/call request: ${u}`)}const{params:y}=f.data,w=await Promise.resolve(l(u,m));if(y.task){const u=(0,v.safeParse)(h.CreateTaskResultSchema,w);if(!u.success){const l=u.error instanceof Error?u.error.message:String(u.error);throw new h.McpError(h.ErrorCode.InvalidParams,`Invalid task creation result: ${l}`)}return u.data}const b=(0,v.safeParse)(h.CallToolResultSchema,w);if(!b.success){const u=b.error instanceof Error?b.error.message:String(b.error);throw new h.McpError(h.ErrorCode.InvalidParams,`Invalid tools/call result: ${u}`)}return b.data};return super.setRequestHandler(u,wrappedHandler)}return super.setRequestHandler(u,l)}assertCapabilityForMethod(u){switch(u){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${u})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${u})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${u})`)}}assertNotificationCapability(u){switch(u){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${u})`);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 ${u})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${u})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${u})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${u})`)}}assertRequestHandlerCapability(u){if(this._capabilities)switch(u){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${u})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${u})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${u})`);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 ${u})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${u})`);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 ${u})`)}}assertTaskCapability(u){(0,b.assertClientRequestTaskCapability)(this._clientCapabilities?.tasks?.requests,u,"Client")}assertTaskHandlerCapability(u){this._capabilities&&(0,b.assertToolsCallTaskCapability)(this._capabilities.tasks?.requests,u,"Server")}async _oninitialize(u){const l=u.params.protocolVersion;this._clientCapabilities=u.params.capabilities,this._clientVersion=u.params.clientInfo;return{protocolVersion:h.SUPPORTED_PROTOCOL_VERSIONS.includes(l)?l:h.LATEST_PROTOCOL_VERSION,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"},h.EmptyResultSchema)}async createMessage(u,l){if((u.tools||u.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(u.messages.length>0){const l=u.messages[u.messages.length-1],m=Array.isArray(l.content)?l.content:[l.content],f=m.some(u=>"tool_result"===u.type),h=u.messages.length>1?u.messages[u.messages.length-2]:void 0,y=h?Array.isArray(h.content)?h.content:[h.content]:[],v=y.some(u=>"tool_use"===u.type);if(f){if(m.some(u=>"tool_result"!==u.type))throw new Error("The last message must contain only tool_result content if any is present");if(!v)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(v){const u=new Set(y.filter(u=>"tool_use"===u.type).map(u=>u.id)),l=new Set(m.filter(u=>"tool_result"===u.type).map(u=>u.toolUseId));if(u.size!==l.size||![...u].every(u=>l.has(u)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return u.tools?this.request({method:"sampling/createMessage",params:u},h.CreateMessageResultWithToolsSchema,l):this.request({method:"sampling/createMessage",params:u},h.CreateMessageResultSchema,l)}async elicitInput(u,l){switch(u.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");const m=u;return this.request({method:"elicitation/create",params:m},h.ElicitResultSchema,l)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");const m="form"===u.mode?u:{...u,mode:"form"},f=await this.request({method:"elicitation/create",params:m},h.ElicitResultSchema,l);if("accept"===f.action&&f.content&&m.requestedSchema)try{const u=this._jsonSchemaValidator.getValidator(m.requestedSchema)(f.content);if(!u.valid)throw new h.McpError(h.ErrorCode.InvalidParams,`Elicitation response content does not match requested schema: ${u.errorMessage}`)}catch(u){if(u instanceof h.McpError)throw u;throw new h.McpError(h.ErrorCode.InternalError,`Error validating elicitation response: ${u instanceof Error?u.message:String(u)}`)}return f}}}createElicitationCompletionNotifier(u,l){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:u}},l)}async listRoots(u,l){return this.request({method:"roots/list",params:u},h.ListRootsResultSchema,l)}async sendLoggingMessage(u,l){if(this._capabilities.logging&&!this.isMessageIgnored(u.level,l))return this.notification({method:"notifications/message",params:u})}async sendResourceUpdated(u){return this.notification({method:"notifications/resources/updated",params:u})}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"})}}},"./node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js":function(u,l,m){m.r(l),m.d(l,{McpServer:function(){return McpServer},ResourceTemplate:function(){return ResourceTemplate}});var f=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js"),y=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js"),v=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/types.js"),w=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js"),b=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/shared/uriTemplate.js"),S=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js"),$=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.js"),x=m("./node_modules/zod/v3/types.js");class McpServer{constructor(u,l){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new f.Server(u,l)}get experimental(){return this._experimental||(this._experimental={tasks:new $.ExperimentalMcpServerTasks(this)}),this._experimental}async connect(u){return await this.server.connect(u)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(getMethodValue(v.ListToolsRequestSchema)),this.server.assertCanSetRequestHandler(getMethodValue(v.CallToolRequestSchema)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(v.ListToolsRequestSchema,()=>({tools:Object.entries(this._registeredTools).filter(([,u])=>u.enabled).map(([u,l])=>{const m={name:u,title:l.title,description:l.description,inputSchema:(()=>{const u=(0,h.normalizeObjectSchema)(l.inputSchema);return u?(0,y.toJsonSchemaCompat)(u,{strictUnions:!0,pipeStrategy:"input"}):j})(),annotations:l.annotations,execution:l.execution,_meta:l._meta};if(l.outputSchema){const u=(0,h.normalizeObjectSchema)(l.outputSchema);u&&(m.outputSchema=(0,y.toJsonSchemaCompat)(u,{strictUnions:!0,pipeStrategy:"output"}))}return m})})),this.server.setRequestHandler(v.CallToolRequestSchema,async(u,l)=>{try{const m=this._registeredTools[u.params.name];if(!m)throw new v.McpError(v.ErrorCode.InvalidParams,`Tool ${u.params.name} not found`);if(!m.enabled)throw new v.McpError(v.ErrorCode.InvalidParams,`Tool ${u.params.name} disabled`);const f=!!u.params.task,h=m.execution?.taskSupport,y="createTask"in m.handler;if(("required"===h||"optional"===h)&&!y)throw new v.McpError(v.ErrorCode.InternalError,`Tool ${u.params.name} has taskSupport '${h}' but was not registered with registerToolTask`);if("required"===h&&!f)throw new v.McpError(v.ErrorCode.MethodNotFound,`Tool ${u.params.name} requires task augmentation (taskSupport: 'required')`);if("optional"===h&&!f&&y)return await this.handleAutomaticTaskPolling(m,u,l);const w=await this.validateToolInput(m,u.params.arguments,u.params.name),b=await this.executeToolHandler(m,w,l);return f||await this.validateToolOutput(m,b,u.params.name),b}catch(u){if(u instanceof v.McpError&&u.code===v.ErrorCode.UrlElicitationRequired)throw u;return this.createToolError(u instanceof Error?u.message:String(u))}}),this._toolHandlersInitialized=!0)}createToolError(u){return{content:[{type:"text",text:u}],isError:!0}}async validateToolInput(u,l,m){if(!u.inputSchema)return;const f=(0,h.normalizeObjectSchema)(u.inputSchema)??u.inputSchema,y=await(0,h.safeParseAsync)(f,l);if(!y.success){const u="error"in y?y.error:"Unknown error",l=(0,h.getParseErrorMessage)(u);throw new v.McpError(v.ErrorCode.InvalidParams,`Input validation error: Invalid arguments for tool ${m}: ${l}`)}return y.data}async validateToolOutput(u,l,m){if(!u.outputSchema)return;if(!("content"in l))return;if(l.isError)return;if(!l.structuredContent)throw new v.McpError(v.ErrorCode.InvalidParams,`Output validation error: Tool ${m} has an output schema but no structured content was provided`);const f=(0,h.normalizeObjectSchema)(u.outputSchema),y=await(0,h.safeParseAsync)(f,l.structuredContent);if(!y.success){const u="error"in y?y.error:"Unknown error",l=(0,h.getParseErrorMessage)(u);throw new v.McpError(v.ErrorCode.InvalidParams,`Output validation error: Invalid structured content for tool ${m}: ${l}`)}}async executeToolHandler(u,l,m){const f=u.handler;if("createTask"in f){if(!m.taskStore)throw new Error("No task store provided.");const h={...m,taskStore:m.taskStore};if(u.inputSchema){const u=f;return await Promise.resolve(u.createTask(l,h))}{const u=f;return await Promise.resolve(u.createTask(h))}}if(u.inputSchema){const u=f;return await Promise.resolve(u(l,m))}{const u=f;return await Promise.resolve(u(m))}}async handleAutomaticTaskPolling(u,l,m){if(!m.taskStore)throw new Error("No task store provided for task-capable tool.");const f=await this.validateToolInput(u,l.params.arguments,l.params.name),h=u.handler,y={...m,taskStore:m.taskStore},w=f?await Promise.resolve(h.createTask(f,y)):await Promise.resolve(h.createTask(y)),b=w.task.taskId;let S=w.task;const $=S.pollInterval??5e3;for(;"completed"!==S.status&&"failed"!==S.status&&"cancelled"!==S.status;){await new Promise(u=>setTimeout(u,$));const u=await m.taskStore.getTask(b);if(!u)throw new v.McpError(v.ErrorCode.InternalError,`Task ${b} not found during polling`);S=u}return await m.taskStore.getTaskResult(b)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(getMethodValue(v.CompleteRequestSchema)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(v.CompleteRequestSchema,async u=>{switch(u.params.ref.type){case"ref/prompt":return(0,v.assertCompleteRequestPrompt)(u),this.handlePromptCompletion(u,u.params.ref);case"ref/resource":return(0,v.assertCompleteRequestResourceTemplate)(u),this.handleResourceCompletion(u,u.params.ref);default:throw new v.McpError(v.ErrorCode.InvalidParams,`Invalid completion reference: ${u.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(u,l){const m=this._registeredPrompts[l.name];if(!m)throw new v.McpError(v.ErrorCode.InvalidParams,`Prompt ${l.name} not found`);if(!m.enabled)throw new v.McpError(v.ErrorCode.InvalidParams,`Prompt ${l.name} disabled`);if(!m.argsSchema)return E;const f=(0,h.getObjectShape)(m.argsSchema),y=f?.[u.params.argument.name];if(!(0,w.isCompletable)(y))return E;const b=(0,w.getCompleter)(y);if(!b)return E;return createCompletionResult(await b(u.params.argument.value,u.params.context))}async handleResourceCompletion(u,l){const m=Object.values(this._registeredResourceTemplates).find(u=>u.resourceTemplate.uriTemplate.toString()===l.uri);if(!m){if(this._registeredResources[l.uri])return E;throw new v.McpError(v.ErrorCode.InvalidParams,`Resource template ${u.params.ref.uri} not found`)}const f=m.resourceTemplate.completeCallback(u.params.argument.name);if(!f)return E;return createCompletionResult(await f(u.params.argument.value,u.params.context))}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(getMethodValue(v.ListResourcesRequestSchema)),this.server.assertCanSetRequestHandler(getMethodValue(v.ListResourceTemplatesRequestSchema)),this.server.assertCanSetRequestHandler(getMethodValue(v.ReadResourceRequestSchema)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(v.ListResourcesRequestSchema,async(u,l)=>{const m=Object.entries(this._registeredResources).filter(([u,l])=>l.enabled).map(([u,l])=>({uri:u,name:l.name,...l.metadata})),f=[];for(const u of Object.values(this._registeredResourceTemplates)){if(!u.resourceTemplate.listCallback)continue;const m=await u.resourceTemplate.listCallback(l);for(const l of m.resources)f.push({...u.metadata,...l})}return{resources:[...m,...f]}}),this.server.setRequestHandler(v.ListResourceTemplatesRequestSchema,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([u,l])=>({name:u,uriTemplate:l.resourceTemplate.uriTemplate.toString(),...l.metadata}))})),this.server.setRequestHandler(v.ReadResourceRequestSchema,async(u,l)=>{const m=new URL(u.params.uri),f=this._registeredResources[m.toString()];if(f){if(!f.enabled)throw new v.McpError(v.ErrorCode.InvalidParams,`Resource ${m} disabled`);return f.readCallback(m,l)}for(const u of Object.values(this._registeredResourceTemplates)){const f=u.resourceTemplate.uriTemplate.match(m.toString());if(f)return u.readCallback(m,f,l)}throw new v.McpError(v.ErrorCode.InvalidParams,`Resource ${m} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(getMethodValue(v.ListPromptsRequestSchema)),this.server.assertCanSetRequestHandler(getMethodValue(v.GetPromptRequestSchema)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(v.ListPromptsRequestSchema,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,u])=>u.enabled).map(([u,l])=>({name:u,title:l.title,description:l.description,arguments:l.argsSchema?promptArgumentsFromSchema(l.argsSchema):void 0}))})),this.server.setRequestHandler(v.GetPromptRequestSchema,async(u,l)=>{const m=this._registeredPrompts[u.params.name];if(!m)throw new v.McpError(v.ErrorCode.InvalidParams,`Prompt ${u.params.name} not found`);if(!m.enabled)throw new v.McpError(v.ErrorCode.InvalidParams,`Prompt ${u.params.name} disabled`);if(m.argsSchema){const f=(0,h.normalizeObjectSchema)(m.argsSchema),y=await(0,h.safeParseAsync)(f,u.params.arguments);if(!y.success){const l="error"in y?y.error:"Unknown error",m=(0,h.getParseErrorMessage)(l);throw new v.McpError(v.ErrorCode.InvalidParams,`Invalid arguments for prompt ${u.params.name}: ${m}`)}const w=y.data,b=m.callback;return await Promise.resolve(b(w,l))}{const u=m.callback;return await Promise.resolve(u(l))}}),this._promptHandlersInitialized=!0)}resource(u,l,...m){let f;"object"==typeof m[0]&&(f=m.shift());const h=m[0];if("string"==typeof l){if(this._registeredResources[l])throw new Error(`Resource ${l} is already registered`);const m=this._createRegisteredResource(u,void 0,l,f,h);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),m}{if(this._registeredResourceTemplates[u])throw new Error(`Resource template ${u} is already registered`);const m=this._createRegisteredResourceTemplate(u,void 0,l,f,h);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),m}}registerResource(u,l,m,f){if("string"==typeof l){if(this._registeredResources[l])throw new Error(`Resource ${l} is already registered`);const h=this._createRegisteredResource(u,m.title,l,m,f);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),h}{if(this._registeredResourceTemplates[u])throw new Error(`Resource template ${u} is already registered`);const h=this._createRegisteredResourceTemplate(u,m.title,l,m,f);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),h}}_createRegisteredResource(u,l,m,f,h){const y={name:u,title:l,metadata:f,readCallback:h,enabled:!0,disable:()=>y.update({enabled:!1}),enable:()=>y.update({enabled:!0}),remove:()=>y.update({uri:null}),update:u=>{void 0!==u.uri&&u.uri!==m&&(delete this._registeredResources[m],u.uri&&(this._registeredResources[u.uri]=y)),void 0!==u.name&&(y.name=u.name),void 0!==u.title&&(y.title=u.title),void 0!==u.metadata&&(y.metadata=u.metadata),void 0!==u.callback&&(y.readCallback=u.callback),void 0!==u.enabled&&(y.enabled=u.enabled),this.sendResourceListChanged()}};return this._registeredResources[m]=y,y}_createRegisteredResourceTemplate(u,l,m,f,h){const y={resourceTemplate:m,title:l,metadata:f,readCallback:h,enabled:!0,disable:()=>y.update({enabled:!1}),enable:()=>y.update({enabled:!0}),remove:()=>y.update({name:null}),update:l=>{void 0!==l.name&&l.name!==u&&(delete this._registeredResourceTemplates[u],l.name&&(this._registeredResourceTemplates[l.name]=y)),void 0!==l.title&&(y.title=l.title),void 0!==l.template&&(y.resourceTemplate=l.template),void 0!==l.metadata&&(y.metadata=l.metadata),void 0!==l.callback&&(y.readCallback=l.callback),void 0!==l.enabled&&(y.enabled=l.enabled),this.sendResourceListChanged()}};this._registeredResourceTemplates[u]=y;const v=m.uriTemplate.variableNames;return Array.isArray(v)&&v.some(u=>!!m.completeCallback(u))&&this.setCompletionRequestHandler(),y}_createRegisteredPrompt(u,l,m,f,y){const v={title:l,description:m,argsSchema:void 0===f?void 0:(0,h.objectFromShape)(f),callback:y,enabled:!0,disable:()=>v.update({enabled:!1}),enable:()=>v.update({enabled:!0}),remove:()=>v.update({name:null}),update:l=>{void 0!==l.name&&l.name!==u&&(delete this._registeredPrompts[u],l.name&&(this._registeredPrompts[l.name]=v)),void 0!==l.title&&(v.title=l.title),void 0!==l.description&&(v.description=l.description),void 0!==l.argsSchema&&(v.argsSchema=(0,h.objectFromShape)(l.argsSchema)),void 0!==l.callback&&(v.callback=l.callback),void 0!==l.enabled&&(v.enabled=l.enabled),this.sendPromptListChanged()}};if(this._registeredPrompts[u]=v,f){Object.values(f).some(u=>{const l=u instanceof x.ZodOptional?u._def?.innerType:u;return(0,w.isCompletable)(l)})&&this.setCompletionRequestHandler()}return v}_createRegisteredTool(u,l,m,f,y,v,w,b,$){(0,S.validateAndWarnToolName)(u);const x={title:l,description:m,inputSchema:getZodSchemaObject(f),outputSchema:getZodSchemaObject(y),annotations:v,execution:w,_meta:b,handler:$,enabled:!0,disable:()=>x.update({enabled:!1}),enable:()=>x.update({enabled:!0}),remove:()=>x.update({name:null}),update:l=>{void 0!==l.name&&l.name!==u&&("string"==typeof l.name&&(0,S.validateAndWarnToolName)(l.name),delete this._registeredTools[u],l.name&&(this._registeredTools[l.name]=x)),void 0!==l.title&&(x.title=l.title),void 0!==l.description&&(x.description=l.description),void 0!==l.paramsSchema&&(x.inputSchema=(0,h.objectFromShape)(l.paramsSchema)),void 0!==l.outputSchema&&(x.outputSchema=(0,h.objectFromShape)(l.outputSchema)),void 0!==l.callback&&(x.handler=l.callback),void 0!==l.annotations&&(x.annotations=l.annotations),void 0!==l._meta&&(x._meta=l._meta),void 0!==l.enabled&&(x.enabled=l.enabled),this.sendToolListChanged()}};return this._registeredTools[u]=x,this.setToolRequestHandlers(),this.sendToolListChanged(),x}tool(u,...l){if(this._registeredTools[u])throw new Error(`Tool ${u} is already registered`);let m,f,h;if("string"==typeof l[0]&&(m=l.shift()),l.length>1){const u=l[0];isZodRawShapeCompat(u)?(f=l.shift(),l.length>1&&"object"==typeof l[0]&&null!==l[0]&&!isZodRawShapeCompat(l[0])&&(h=l.shift())):"object"==typeof u&&null!==u&&(h=l.shift())}const y=l[0];return this._createRegisteredTool(u,void 0,m,f,undefined,h,{taskSupport:"forbidden"},void 0,y)}registerTool(u,l,m){if(this._registeredTools[u])throw new Error(`Tool ${u} is already registered`);const{title:f,description:h,inputSchema:y,outputSchema:v,annotations:w,_meta:b}=l;return this._createRegisteredTool(u,f,h,y,v,w,{taskSupport:"forbidden"},b,m)}prompt(u,...l){if(this._registeredPrompts[u])throw new Error(`Prompt ${u} is already registered`);let m,f;"string"==typeof l[0]&&(m=l.shift()),l.length>1&&(f=l.shift());const h=l[0],y=this._createRegisteredPrompt(u,void 0,m,f,h);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),y}registerPrompt(u,l,m){if(this._registeredPrompts[u])throw new Error(`Prompt ${u} is already registered`);const{title:f,description:h,argsSchema:y}=l,v=this._createRegisteredPrompt(u,f,h,y,m);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),v}isConnected(){return void 0!==this.server.transport}async sendLoggingMessage(u,l){return this.server.sendLoggingMessage(u,l)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}}class ResourceTemplate{constructor(u,l){this._callbacks=l,this._uriTemplate="string"==typeof u?new b.UriTemplate(u):u}get uriTemplate(){return this._uriTemplate}get listCallback(){return this._callbacks.list}completeCallback(u){return this._callbacks.complete?.[u]}}const j={type:"object",properties:{}};function isZodTypeLike(u){return null!==u&&"object"==typeof u&&"parse"in u&&"function"==typeof u.parse&&"safeParse"in u&&"function"==typeof u.safeParse}function isZodRawShapeCompat(u){return"object"==typeof u&&null!==u&&(!function isZodSchemaInstance(u){return"_def"in u||"_zod"in u||isZodTypeLike(u)}(u)&&(0===Object.keys(u).length||Object.values(u).some(isZodTypeLike)))}function getZodSchemaObject(u){if(u)return isZodRawShapeCompat(u)?(0,h.objectFromShape)(u):u}function promptArgumentsFromSchema(u){const l=(0,h.getObjectShape)(u);return l?Object.entries(l).map(([u,l])=>({name:u,description:(0,h.getSchemaDescription)(l),required:!(0,h.isSchemaOptional)(l)})):[]}function getMethodValue(u){const l=(0,h.getObjectShape)(u),m=l?.method;if(!m)throw new Error("Schema is missing a method literal");const f=(0,h.getLiteralValue)(m);if("string"==typeof f)return f;throw new Error("Schema method literal must be a string")}function createCompletionResult(u){return{completion:{values:u.slice(0,100),total:u.length,hasMore:u.length>100}}}const E={completion:{values:[],hasMore:!1}}},"./node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js":function(u,l,m){m.r(l),m.d(l,{getLiteralValue:function(){return getLiteralValue},getObjectShape:function(){return getObjectShape},getParseErrorMessage:function(){return getParseErrorMessage},getSchemaDescription:function(){return getSchemaDescription},isSchemaOptional:function(){return isSchemaOptional},isZ4Schema:function(){return isZ4Schema},normalizeObjectSchema:function(){return normalizeObjectSchema},objectFromShape:function(){return objectFromShape},safeParse:function(){return safeParse},safeParseAsync:function(){return safeParseAsync}});var f=m("./node_modules/zod/v3/types.js"),h=m("./node_modules/zod/v4/core/parse.js"),y=m("./node_modules/zod/v4/mini/schemas.js");function isZ4Schema(u){return!!u._zod}function objectFromShape(u){const l=Object.values(u);if(0===l.length)return y.object({});const m=l.every(isZ4Schema),h=l.every(u=>!isZ4Schema(u));if(m)return y.object(u);if(h)return f.object(u);throw new Error("Mixed Zod versions detected in object shape.")}function safeParse(u,l){if(isZ4Schema(u)){return h.safeParse(u,l)}return u.safeParse(l)}async function safeParseAsync(u,l){if(isZ4Schema(u)){return await h.safeParseAsync(u,l)}const m=u;return await m.safeParseAsync(l)}function getObjectShape(u){if(!u)return;let l;if(isZ4Schema(u)){const m=u;l=m._zod?.def?.shape}else{l=u.shape}if(l){if("function"==typeof l)try{return l()}catch{return}return l}}function normalizeObjectSchema(u){if(u){if("object"==typeof u){const l=u;if(!u._def&&!l._zod){const l=Object.values(u);if(l.length>0&&l.every(u=>"object"==typeof u&&null!==u&&(void 0!==u._def||void 0!==u._zod||"function"==typeof u.parse)))return objectFromShape(u)}}if(isZ4Schema(u)){const l=u,m=l._zod?.def;if(m&&("object"===m.type||void 0!==m.shape))return u}else{if(void 0!==u.shape)return u}}}function getParseErrorMessage(u){if(u&&"object"==typeof u){if("message"in u&&"string"==typeof u.message)return u.message;if("issues"in u&&Array.isArray(u.issues)&&u.issues.length>0){const l=u.issues[0];if(l&&"object"==typeof l&&"message"in l)return String(l.message)}try{return JSON.stringify(u)}catch{return String(u)}}return String(u)}function getSchemaDescription(u){return u.description}function isSchemaOptional(u){if(isZ4Schema(u)){const l=u;return"optional"===l._zod?.def?.type}const l=u;return"function"==typeof u.isOptional?u.isOptional():"ZodOptional"===l._def?.typeName}function getLiteralValue(u){if(isZ4Schema(u)){const l=u,m=l._zod?.def;if(m){if(void 0!==m.value)return m.value;if(Array.isArray(m.values)&&m.values.length>0)return m.values[0]}}const l=u._def;if(l){if(void 0!==l.value)return l.value;if(Array.isArray(l.values)&&l.values.length>0)return l.values[0]}const m=u.value;if(void 0!==m)return m}},"./node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js":function(u,l,m){m.r(l),m.d(l,{getMethodLiteral:function(){return getMethodLiteral},parseWithCompat:function(){return parseWithCompat},toJsonSchemaCompat:function(){return toJsonSchemaCompat}});var f=m("./node_modules/zod/v4/core/to-json-schema.js"),h=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/index.js");function toJsonSchemaCompat(u,l){return(0,h.isZ4Schema)(u)?f.toJSONSchema(u,{target:(m=l?.target,m?"jsonSchema7"===m||"draft-7"===m?"draft-7":"jsonSchema2019-09"===m||"draft-2020-12"===m?"draft-2020-12":"draft-7":"draft-7"),io:l?.pipeStrategy??"input"}):(0,y.zodToJsonSchema)(u,{strictUnions:l?.strictUnions??!0,pipeStrategy:l?.pipeStrategy??"input"});var m}function getMethodLiteral(u){const l=(0,h.getObjectShape)(u),m=l?.method;if(!m)throw new Error("Schema is missing a method literal");const f=(0,h.getLiteralValue)(m);if("string"!=typeof f)throw new Error("Schema method literal must be a string");return f}function parseWithCompat(u,l){const m=(0,h.safeParse)(u,l);if(!m.success)throw m.error;return m.data}},"./node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js":function(u,l,m){m.r(l),m.d(l,{DEFAULT_REQUEST_TIMEOUT_MSEC:function(){return w},Protocol:function(){return Protocol},mergeCapabilities:function(){return mergeCapabilities}});var f=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js"),h=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/types.js"),y=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js"),v=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js");const w=6e4;class Protocol{constructor(u){this._options=u,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(h.CancelledNotificationSchema,u=>{this._oncancel(u)}),this.setNotificationHandler(h.ProgressNotificationSchema,u=>{this._onprogress(u)}),this.setRequestHandler(h.PingRequestSchema,u=>({})),this._taskStore=u?.taskStore,this._taskMessageQueue=u?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(h.GetTaskRequestSchema,async(u,l)=>{const m=await this._taskStore.getTask(u.params.taskId,l.sessionId);if(!m)throw new h.McpError(h.ErrorCode.InvalidParams,"Failed to retrieve task: Task not found");return{...m}}),this.setRequestHandler(h.GetTaskPayloadRequestSchema,async(u,l)=>{const handleTaskResult=async()=>{const m=u.params.taskId;if(this._taskMessageQueue){let u;for(;u=await this._taskMessageQueue.dequeue(m,l.sessionId);){if("response"===u.type||"error"===u.type){const l=u.message,m=l.id,f=this._requestResolvers.get(m);if(f)if(this._requestResolvers.delete(m),"response"===u.type)f(l);else{const u=l;f(new h.McpError(u.error.code,u.error.message,u.error.data))}else{const l="response"===u.type?"Response":"Error";this._onerror(new Error(`${l} handler missing for request ${m}`))}continue}await(this._transport?.send(u.message,{relatedRequestId:l.requestId}))}}const f=await this._taskStore.getTask(m,l.sessionId);if(!f)throw new h.McpError(h.ErrorCode.InvalidParams,`Task not found: ${m}`);if(!(0,y.isTerminal)(f.status))return await this._waitForTaskUpdate(m,l.signal),await handleTaskResult();if((0,y.isTerminal)(f.status)){const u=await this._taskStore.getTaskResult(m,l.sessionId);return this._clearTaskQueue(m),{...u,_meta:{...u._meta,[h.RELATED_TASK_META_KEY]:{taskId:m}}}}return await handleTaskResult()};return await handleTaskResult()}),this.setRequestHandler(h.ListTasksRequestSchema,async(u,l)=>{try{const{tasks:m,nextCursor:f}=await this._taskStore.listTasks(u.params?.cursor,l.sessionId);return{tasks:m,nextCursor:f,_meta:{}}}catch(u){throw new h.McpError(h.ErrorCode.InvalidParams,`Failed to list tasks: ${u instanceof Error?u.message:String(u)}`)}}),this.setRequestHandler(h.CancelTaskRequestSchema,async(u,l)=>{try{const m=await this._taskStore.getTask(u.params.taskId,l.sessionId);if(!m)throw new h.McpError(h.ErrorCode.InvalidParams,`Task not found: ${u.params.taskId}`);if((0,y.isTerminal)(m.status))throw new h.McpError(h.ErrorCode.InvalidParams,`Cannot cancel task in terminal status: ${m.status}`);await this._taskStore.updateTaskStatus(u.params.taskId,"cancelled","Client cancelled task execution.",l.sessionId),this._clearTaskQueue(u.params.taskId);const f=await this._taskStore.getTask(u.params.taskId,l.sessionId);if(!f)throw new h.McpError(h.ErrorCode.InvalidParams,`Task not found after cancellation: ${u.params.taskId}`);return{_meta:{},...f}}catch(u){if(u instanceof h.McpError)throw u;throw new h.McpError(h.ErrorCode.InvalidRequest,`Failed to cancel task: ${u instanceof Error?u.message:String(u)}`)}}))}async _oncancel(u){if(!u.params.requestId)return;const l=this._requestHandlerAbortControllers.get(u.params.requestId);l?.abort(u.params.reason)}_setupTimeout(u,l,m,f,h=!1){this._timeoutInfo.set(u,{timeoutId:setTimeout(f,l),startTime:Date.now(),timeout:l,maxTotalTimeout:m,resetTimeoutOnProgress:h,onTimeout:f})}_resetTimeout(u){const l=this._timeoutInfo.get(u);if(!l)return!1;const m=Date.now()-l.startTime;if(l.maxTotalTimeout&&m>=l.maxTotalTimeout)throw this._timeoutInfo.delete(u),h.McpError.fromError(h.ErrorCode.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:l.maxTotalTimeout,totalElapsed:m});return clearTimeout(l.timeoutId),l.timeoutId=setTimeout(l.onTimeout,l.timeout),!0}_cleanupTimeout(u){const l=this._timeoutInfo.get(u);l&&(clearTimeout(l.timeoutId),this._timeoutInfo.delete(u))}async connect(u){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=u;const l=this.transport?.onclose;this._transport.onclose=()=>{l?.(),this._onclose()};const m=this.transport?.onerror;this._transport.onerror=u=>{m?.(u),this._onerror(u)};const f=this._transport?.onmessage;this._transport.onmessage=(u,l)=>{f?.(u,l),(0,h.isJSONRPCResultResponse)(u)||(0,h.isJSONRPCErrorResponse)(u)?this._onresponse(u):(0,h.isJSONRPCRequest)(u)?this._onrequest(u,l):(0,h.isJSONRPCNotification)(u)?this._onnotification(u):this._onerror(new Error(`Unknown message type: ${JSON.stringify(u)}`))},await this._transport.start()}_onclose(){const u=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const u of this._requestHandlerAbortControllers.values())u.abort();this._requestHandlerAbortControllers.clear();const l=h.McpError.fromError(h.ErrorCode.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const m of u.values())m(l)}_onerror(u){this.onerror?.(u)}_onnotification(u){const l=this._notificationHandlers.get(u.method)??this.fallbackNotificationHandler;void 0!==l&&Promise.resolve().then(()=>l(u)).catch(u=>this._onerror(new Error(`Uncaught error in notification handler: ${u}`)))}_onrequest(u,l){const m=this._requestHandlers.get(u.method)??this.fallbackRequestHandler,f=this._transport,y=u.params?._meta?.[h.RELATED_TASK_META_KEY]?.taskId;if(void 0===m){const l={jsonrpc:"2.0",id:u.id,error:{code:h.ErrorCode.MethodNotFound,message:"Method not found"}};return void(y&&this._taskMessageQueue?this._enqueueTaskMessage(y,{type:"error",message:l,timestamp:Date.now()},f?.sessionId).catch(u=>this._onerror(new Error(`Failed to enqueue error response: ${u}`))):f?.send(l).catch(u=>this._onerror(new Error(`Failed to send an error response: ${u}`))))}const v=new AbortController;this._requestHandlerAbortControllers.set(u.id,v);const w=(0,h.isTaskAugmentedRequestParams)(u.params)?u.params.task:void 0,b=this._taskStore?this.requestTaskStore(u,f?.sessionId):void 0,S={signal:v.signal,sessionId:f?.sessionId,_meta:u.params?._meta,sendNotification:async l=>{if(v.signal.aborted)return;const m={relatedRequestId:u.id};y&&(m.relatedTask={taskId:y}),await this.notification(l,m)},sendRequest:async(l,m,f)=>{if(v.signal.aborted)throw new h.McpError(h.ErrorCode.ConnectionClosed,"Request was cancelled");const w={...f,relatedRequestId:u.id};y&&!w.relatedTask&&(w.relatedTask={taskId:y});const S=w.relatedTask?.taskId??y;return S&&b&&await b.updateTaskStatus(S,"input_required"),await this.request(l,m,w)},authInfo:l?.authInfo,requestId:u.id,requestInfo:l?.requestInfo,taskId:y,taskStore:b,taskRequestedTtl:w?.ttl,closeSSEStream:l?.closeSSEStream,closeStandaloneSSEStream:l?.closeStandaloneSSEStream};Promise.resolve().then(()=>{w&&this.assertTaskHandlerCapability(u.method)}).then(()=>m(u,S)).then(async l=>{if(v.signal.aborted)return;const m={result:l,jsonrpc:"2.0",id:u.id};y&&this._taskMessageQueue?await this._enqueueTaskMessage(y,{type:"response",message:m,timestamp:Date.now()},f?.sessionId):await(f?.send(m))},async l=>{if(v.signal.aborted)return;const m={jsonrpc:"2.0",id:u.id,error:{code:Number.isSafeInteger(l.code)?l.code:h.ErrorCode.InternalError,message:l.message??"Internal error",...void 0!==l.data&&{data:l.data}}};y&&this._taskMessageQueue?await this._enqueueTaskMessage(y,{type:"error",message:m,timestamp:Date.now()},f?.sessionId):await(f?.send(m))}).catch(u=>this._onerror(new Error(`Failed to send response: ${u}`))).finally(()=>{this._requestHandlerAbortControllers.delete(u.id)})}_onprogress(u){const{progressToken:l,...m}=u.params,f=Number(l),h=this._progressHandlers.get(f);if(!h)return void this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(u)}`));const y=this._responseHandlers.get(f),v=this._timeoutInfo.get(f);if(v&&y&&v.resetTimeoutOnProgress)try{this._resetTimeout(f)}catch(u){return this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),void y(u)}h(m)}_onresponse(u){const l=Number(u.id),m=this._requestResolvers.get(l);if(m){if(this._requestResolvers.delete(l),(0,h.isJSONRPCResultResponse)(u))m(u);else{m(new h.McpError(u.error.code,u.error.message,u.error.data))}return}const f=this._responseHandlers.get(l);if(void 0===f)return void this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(u)}`));this._responseHandlers.delete(l),this._cleanupTimeout(l);let y=!1;if((0,h.isJSONRPCResultResponse)(u)&&u.result&&"object"==typeof u.result){const m=u.result;if(m.task&&"object"==typeof m.task){const u=m.task;"string"==typeof u.taskId&&(y=!0,this._taskProgressTokens.set(u.taskId,l))}}if(y||this._progressHandlers.delete(l),(0,h.isJSONRPCResultResponse)(u))f(u);else{f(h.McpError.fromError(u.error.code,u.error.message,u.error.data))}}get transport(){return this._transport}async close(){await(this._transport?.close())}async*requestStream(u,l,m){const{task:f}=m??{};if(!f){try{const f=await this.request(u,l,m);yield{type:"result",result:f}}catch(u){yield{type:"error",error:u instanceof h.McpError?u:new h.McpError(h.ErrorCode.InternalError,String(u))}}return}let v;try{const f=await this.request(u,h.CreateTaskResultSchema,m);if(!f.task)throw new h.McpError(h.ErrorCode.InternalError,"Task creation did not return a task");for(v=f.task.taskId,yield{type:"taskCreated",task:f.task};;){const u=await this.getTask({taskId:v},m);if(yield{type:"taskStatus",task:u},(0,y.isTerminal)(u.status)){if("completed"===u.status){const u=await this.getTaskResult({taskId:v},l,m);yield{type:"result",result:u}}else"failed"===u.status?yield{type:"error",error:new h.McpError(h.ErrorCode.InternalError,`Task ${v} failed`)}:"cancelled"===u.status&&(yield{type:"error",error:new h.McpError(h.ErrorCode.InternalError,`Task ${v} was cancelled`)});return}if("input_required"===u.status){const u=await this.getTaskResult({taskId:v},l,m);return void(yield{type:"result",result:u})}const f=u.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(u=>setTimeout(u,f)),m?.signal?.throwIfAborted()}}catch(u){yield{type:"error",error:u instanceof h.McpError?u:new h.McpError(h.ErrorCode.InternalError,String(u))}}}request(u,l,m){const{relatedRequestId:y,resumptionToken:v,onresumptiontoken:b,task:S,relatedTask:$}=m??{};return new Promise((x,j)=>{const earlyReject=u=>{j(u)};if(!this._transport)return void earlyReject(new Error("Not connected"));if(!0===this._options?.enforceStrictCapabilities)try{this.assertCapabilityForMethod(u.method),S&&this.assertTaskCapability(u.method)}catch(u){return void earlyReject(u)}m?.signal?.throwIfAborted();const E=this._requestMessageId++,R={...u,jsonrpc:"2.0",id:E};m?.onprogress&&(this._progressHandlers.set(E,m.onprogress),R.params={...u.params,_meta:{...u.params?._meta||{},progressToken:E}}),S&&(R.params={...R.params,task:S}),$&&(R.params={...R.params,_meta:{...R.params?._meta||{},[h.RELATED_TASK_META_KEY]:$}});const cancel=u=>{this._responseHandlers.delete(E),this._progressHandlers.delete(E),this._cleanupTimeout(E),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:E,reason:String(u)}},{relatedRequestId:y,resumptionToken:v,onresumptiontoken:b}).catch(u=>this._onerror(new Error(`Failed to send cancellation: ${u}`)));const l=u instanceof h.McpError?u:new h.McpError(h.ErrorCode.RequestTimeout,String(u));j(l)};this._responseHandlers.set(E,u=>{if(!m?.signal?.aborted){if(u instanceof Error)return j(u);try{const m=(0,f.safeParse)(l,u.result);m.success?x(m.data):j(m.error)}catch(u){j(u)}}}),m?.signal?.addEventListener("abort",()=>{cancel(m?.signal?.reason)});const C=m?.timeout??w;this._setupTimeout(E,C,m?.maxTotalTimeout,()=>cancel(h.McpError.fromError(h.ErrorCode.RequestTimeout,"Request timed out",{timeout:C})),m?.resetTimeoutOnProgress??!1);const Z=$?.taskId;if(Z){const responseResolver=u=>{const l=this._responseHandlers.get(E);l?l(u):this._onerror(new Error(`Response handler missing for side-channeled request ${E}`))};this._requestResolvers.set(E,responseResolver),this._enqueueTaskMessage(Z,{type:"request",message:R,timestamp:Date.now()}).catch(u=>{this._cleanupTimeout(E),j(u)})}else this._transport.send(R,{relatedRequestId:y,resumptionToken:v,onresumptiontoken:b}).catch(u=>{this._cleanupTimeout(E),j(u)})})}async getTask(u,l){return this.request({method:"tasks/get",params:u},h.GetTaskResultSchema,l)}async getTaskResult(u,l,m){return this.request({method:"tasks/result",params:u},l,m)}async listTasks(u,l){return this.request({method:"tasks/list",params:u},h.ListTasksResultSchema,l)}async cancelTask(u,l){return this.request({method:"tasks/cancel",params:u},h.CancelTaskResultSchema,l)}async notification(u,l){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(u.method);const m=l?.relatedTask?.taskId;if(m){const f={...u,jsonrpc:"2.0",params:{...u.params,_meta:{...u.params?._meta||{},[h.RELATED_TASK_META_KEY]:l.relatedTask}}};return void await this._enqueueTaskMessage(m,{type:"notification",message:f,timestamp:Date.now()})}if((this._options?.debouncedNotificationMethods??[]).includes(u.method)&&!u.params&&!l?.relatedRequestId&&!l?.relatedTask){if(this._pendingDebouncedNotifications.has(u.method))return;return this._pendingDebouncedNotifications.add(u.method),void Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(u.method),!this._transport)return;let m={...u,jsonrpc:"2.0"};l?.relatedTask&&(m={...m,params:{...m.params,_meta:{...m.params?._meta||{},[h.RELATED_TASK_META_KEY]:l.relatedTask}}}),this._transport?.send(m,l).catch(u=>this._onerror(u))})}let f={...u,jsonrpc:"2.0"};l?.relatedTask&&(f={...f,params:{...f.params,_meta:{...f.params?._meta||{},[h.RELATED_TASK_META_KEY]:l.relatedTask}}}),await this._transport.send(f,l)}setRequestHandler(u,l){const m=(0,v.getMethodLiteral)(u);this.assertRequestHandlerCapability(m),this._requestHandlers.set(m,(m,f)=>{const h=(0,v.parseWithCompat)(u,m);return Promise.resolve(l(h,f))})}removeRequestHandler(u){this._requestHandlers.delete(u)}assertCanSetRequestHandler(u){if(this._requestHandlers.has(u))throw new Error(`A request handler for ${u} already exists, which would be overridden`)}setNotificationHandler(u,l){const m=(0,v.getMethodLiteral)(u);this._notificationHandlers.set(m,m=>{const f=(0,v.parseWithCompat)(u,m);return Promise.resolve(l(f))})}removeNotificationHandler(u){this._notificationHandlers.delete(u)}_cleanupTaskProgressHandler(u){const l=this._taskProgressTokens.get(u);void 0!==l&&(this._progressHandlers.delete(l),this._taskProgressTokens.delete(u))}async _enqueueTaskMessage(u,l,m){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const f=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(u,l,m,f)}async _clearTaskQueue(u,l){if(this._taskMessageQueue){const m=await this._taskMessageQueue.dequeueAll(u,l);for(const l of m)if("request"===l.type&&(0,h.isJSONRPCRequest)(l.message)){const m=l.message.id,f=this._requestResolvers.get(m);f?(f(new h.McpError(h.ErrorCode.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(m)):this._onerror(new Error(`Resolver missing for request ${m} during task ${u} cleanup`))}}}async _waitForTaskUpdate(u,l){let m=this._options?.defaultTaskPollInterval??1e3;try{const l=await(this._taskStore?.getTask(u));l?.pollInterval&&(m=l.pollInterval)}catch{}return new Promise((u,f)=>{if(l.aborted)return void f(new h.McpError(h.ErrorCode.InvalidRequest,"Request cancelled"));const y=setTimeout(u,m);l.addEventListener("abort",()=>{clearTimeout(y),f(new h.McpError(h.ErrorCode.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(u,l){const m=this._taskStore;if(!m)throw new Error("No task store configured");return{createTask:async f=>{if(!u)throw new Error("No request provided");return await m.createTask(f,u.id,{method:u.method,params:u.params},l)},getTask:async u=>{const f=await m.getTask(u,l);if(!f)throw new h.McpError(h.ErrorCode.InvalidParams,"Failed to retrieve task: Task not found");return f},storeTaskResult:async(u,f,v)=>{await m.storeTaskResult(u,f,v,l);const w=await m.getTask(u,l);if(w){const l=h.TaskStatusNotificationSchema.parse({method:"notifications/tasks/status",params:w});await this.notification(l),(0,y.isTerminal)(w.status)&&this._cleanupTaskProgressHandler(u)}},getTaskResult:u=>m.getTaskResult(u,l),updateTaskStatus:async(u,f,v)=>{const w=await m.getTask(u,l);if(!w)throw new h.McpError(h.ErrorCode.InvalidParams,`Task "${u}" not found - it may have been cleaned up`);if((0,y.isTerminal)(w.status))throw new h.McpError(h.ErrorCode.InvalidParams,`Cannot update task "${u}" from terminal status "${w.status}" to "${f}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await m.updateTaskStatus(u,f,v,l);const b=await m.getTask(u,l);if(b){const l=h.TaskStatusNotificationSchema.parse({method:"notifications/tasks/status",params:b});await this.notification(l),(0,y.isTerminal)(b.status)&&this._cleanupTaskProgressHandler(u)}},listTasks:u=>m.listTasks(u,l)}}}function isPlainObject(u){return null!==u&&"object"==typeof u&&!Array.isArray(u)}function mergeCapabilities(u,l){const m={...u};for(const u in l){const f=u,h=l[f];if(void 0===h)continue;const y=m[f];isPlainObject(y)&&isPlainObject(h)?m[f]={...y,...h}:m[f]=h}return m}},"./node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js":function(u,l,m){m.r(l),m.d(l,{issueToolNameWarning:function(){return issueToolNameWarning},validateAndWarnToolName:function(){return validateAndWarnToolName},validateToolName:function(){return validateToolName}});const f=/^[A-Za-z0-9._-]{1,128}$/;function validateToolName(u){const l=[];if(0===u.length)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(u.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${u.length})`]};if(u.includes(" ")&&l.push("Tool name contains spaces, which may cause parsing issues"),u.includes(",")&&l.push("Tool name contains commas, which may cause parsing issues"),(u.startsWith("-")||u.endsWith("-"))&&l.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(u.startsWith(".")||u.endsWith("."))&&l.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!f.test(u)){const m=u.split("").filter(u=>!/[A-Za-z0-9._-]/.test(u)).filter((u,l,m)=>m.indexOf(u)===l);return l.push(`Tool name contains invalid characters: ${m.map(u=>`"${u}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:l}}return{isValid:!0,warnings:l}}function issueToolNameWarning(u,l){if(l.length>0){console.warn(`Tool name validation warning for "${u}":`);for(const u of l)console.warn(` - ${u}`);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 validateAndWarnToolName(u){const l=validateToolName(u);return issueToolNameWarning(u,l.warnings),l.isValid}},"./node_modules/@modelcontextprotocol/sdk/dist/esm/shared/uriTemplate.js":function(u,l,m){m.r(l),m.d(l,{UriTemplate:function(){return UriTemplate}});const f=1e6,h=1e6;class UriTemplate{static isTemplate(u){return/\{[^}\s]+\}/.test(u)}static validateLength(u,l,m){if(u.length>l)throw new Error(`${m} exceeds maximum length of ${l} characters (got ${u.length})`)}get variableNames(){return this.parts.flatMap(u=>"string"==typeof u?[]:u.names)}constructor(u){UriTemplate.validateLength(u,f,"Template"),this.template=u,this.parts=this.parse(u)}toString(){return this.template}parse(u){const l=[];let m="",f=0,y=0;for(;f<u.length;)if("{"===u[f]){m&&(l.push(m),m="");const v=u.indexOf("}",f);if(-1===v)throw new Error("Unclosed template expression");if(y++,y>1e4)throw new Error("Template contains too many expressions (max 10000)");const w=u.slice(f+1,v),b=this.getOperator(w),S=w.includes("*"),$=this.getNames(w),x=$[0];for(const u of $)UriTemplate.validateLength(u,h,"Variable name");l.push({name:x,operator:b,names:$,exploded:S}),f=v+1}else m+=u[f],f++;return m&&l.push(m),l}getOperator(u){return["+","#",".","/","?","&"].find(l=>u.startsWith(l))||""}getNames(u){const l=this.getOperator(u);return u.slice(l.length).split(",").map(u=>u.replace("*","").trim()).filter(u=>u.length>0)}encodeValue(u,l){return UriTemplate.validateLength(u,h,"Variable value"),"+"===l||"#"===l?encodeURI(u):encodeURIComponent(u)}expandPart(u,l){if("?"===u.operator||"&"===u.operator){const m=u.names.map(m=>{const f=l[m];if(void 0===f)return"";return`${m}=${Array.isArray(f)?f.map(l=>this.encodeValue(l,u.operator)).join(","):this.encodeValue(f.toString(),u.operator)}`}).filter(u=>u.length>0);if(0===m.length)return"";return("?"===u.operator?"?":"&")+m.join("&")}if(u.names.length>1){const m=u.names.map(u=>l[u]).filter(u=>void 0!==u);return 0===m.length?"":m.map(u=>Array.isArray(u)?u[0]:u).join(",")}const m=l[u.name];if(void 0===m)return"";const f=(Array.isArray(m)?m:[m]).map(l=>this.encodeValue(l,u.operator));switch(u.operator){case"":case"+":default:return f.join(",");case"#":return"#"+f.join(",");case".":return"."+f.join(".");case"/":return"/"+f.join("/")}}expand(u){let l="",m=!1;for(const f of this.parts){if("string"==typeof f){l+=f;continue}const h=this.expandPart(f,u);h&&("?"!==f.operator&&"&"!==f.operator||!m?l+=h:l+=h.replace("?","&"),"?"!==f.operator&&"&"!==f.operator||(m=!0))}return l}escapeRegExp(u){return u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}partToRegExp(u){const l=[];for(const l of u.names)UriTemplate.validateLength(l,h,"Variable name");if("?"===u.operator||"&"===u.operator){for(let m=0;m<u.names.length;m++){const f=u.names[m],h=0===m?"\\"+u.operator:"&";l.push({pattern:h+this.escapeRegExp(f)+"=([^&]+)",name:f})}return l}let m;const f=u.name;switch(u.operator){case"":m=u.exploded?"([^/,]+(?:,[^/,]+)*)":"([^/,]+)";break;case"+":case"#":m="(.+)";break;case".":m="\\.([^/,]+)";break;case"/":m="/"+(u.exploded?"([^/,]+(?:,[^/,]+)*)":"([^/,]+)");break;default:m="([^/]+)"}return l.push({pattern:m,name:f}),l}match(u){UriTemplate.validateLength(u,f,"URI");let l="^";const m=[];for(const u of this.parts)if("string"==typeof u)l+=this.escapeRegExp(u);else{const f=this.partToRegExp(u);for(const{pattern:h,name:y}of f)l+=h,m.push({name:y,exploded:u.exploded})}l+="$",UriTemplate.validateLength(l,1e6,"Generated regex pattern");const h=new RegExp(l),y=u.match(h);if(!y)return null;const v={};for(let u=0;u<m.length;u++){const{name:l,exploded:f}=m[u],h=y[u+1],w=l.replace("*","");f&&h.includes(",")?v[w]=h.split(","):v[w]=h}return v}}},"./node_modules/@modelcontextprotocol/sdk/dist/esm/types.js":function(u,l,m){m.r(l),m.d(l,{AnnotationsSchema:function(){return Ue},AudioContentSchema:function(){return Vt},BaseMetadataSchema:function(){return re},BlobResourceContentsSchema:function(){return De},BooleanSchemaSchema:function(){return Tn},CallToolRequestParamsSchema:function(){return an},CallToolRequestSchema:function(){return cn},CallToolResultSchema:function(){return on},CancelTaskRequestSchema:function(){return Ze},CancelTaskResultSchema:function(){return ze},CancelledNotificationParamsSchema:function(){return X},CancelledNotificationSchema:function(){return ee},ClientCapabilitiesSchema:function(){return de},ClientNotificationSchema:function(){return rr},ClientRequestSchema:function(){return nr},ClientResultSchema:function(){return sr},ClientTasksCapabilitySchema:function(){return ae},CompatibilityCallToolResultSchema:function(){return sn},CompleteRequestParamsSchema:function(){return Gn},CompleteRequestSchema:function(){return Wn},CompleteResultSchema:function(){return Qn},ContentBlockSchema:function(){return Gt},CreateMessageRequestParamsSchema:function(){return Sn},CreateMessageRequestSchema:function(){return $n},CreateMessageResultSchema:function(){return xn},CreateMessageResultWithToolsSchema:function(){return jn},CreateTaskResultSchema:function(){return $e},CursorSchema:function(){return j},DEFAULT_NEGOTIATED_PROTOCOL_VERSION:function(){return v},ElicitRequestFormParamsSchema:function(){return Mn},ElicitRequestParamsSchema:function(){return Ln},ElicitRequestSchema:function(){return qn},ElicitRequestURLParamsSchema:function(){return Un},ElicitResultSchema:function(){return Kn},ElicitationCompleteNotificationParamsSchema:function(){return Fn},ElicitationCompleteNotificationSchema:function(){return Vn},EmbeddedResourceSchema:function(){return Bt},EmptyResultSchema:function(){return Y},EnumSchemaSchema:function(){return Nn},ErrorCode:function(){return H},GetPromptRequestParamsSchema:function(){return Mt},GetPromptRequestSchema:function(){return Lt},GetPromptResultSchema:function(){return Qt},GetTaskPayloadRequestSchema:function(){return Pe},GetTaskPayloadResultSchema:function(){return Ie},GetTaskRequestSchema:function(){return Te},GetTaskResultSchema:function(){return Ee},IconSchema:function(){return te},IconsSchema:function(){return ne},ImageContentSchema:function(){return Ft},ImplementationSchema:function(){return oe},InitializeRequestParamsSchema:function(){return ue},InitializeRequestSchema:function(){return le},InitializeResultSchema:function(){return me},InitializedNotificationSchema:function(){return fe},JSONRPCErrorResponseSchema:function(){return B},JSONRPCErrorSchema:function(){return J},JSONRPCMessageSchema:function(){return W},JSONRPCNotificationSchema:function(){return F},JSONRPCRequestSchema:function(){return L},JSONRPCResponseSchema:function(){return Q},JSONRPCResultResponseSchema:function(){return V},JSONRPC_VERSION:function(){return S},LATEST_PROTOCOL_VERSION:function(){return y},LegacyTitledEnumSchemaSchema:function(){return Cn},ListChangedOptionsBaseSchema:function(){return un},ListPromptsRequestSchema:function(){return Et},ListPromptsResultSchema:function(){return Zt},ListResourceTemplatesRequestSchema:function(){return Ge},ListResourceTemplatesResultSchema:function(){return We},ListResourcesRequestSchema:function(){return He},ListResourcesResultSchema:function(){return Be},ListRootsRequestSchema:function(){return Xn},ListRootsResultSchema:function(){return er},ListTasksRequestSchema:function(){return Re},ListTasksResultSchema:function(){return Ce},ListToolsRequestSchema:function(){return nn},ListToolsResultSchema:function(){return rn},LoggingLevelSchema:function(){return ln},LoggingMessageNotificationParamsSchema:function(){return fn},LoggingMessageNotificationSchema:function(){return hn},McpError:function(){return McpError},ModelHintSchema:function(){return gn},ModelPreferencesSchema:function(){return _n},MultiSelectEnumSchemaSchema:function(){return On},NotificationSchema:function(){return D},NumberSchemaSchema:function(){return Pn},PaginatedRequestParamsSchema:function(){return ve},PaginatedRequestSchema:function(){return we},PaginatedResultSchema:function(){return be},PingRequestSchema:function(){return he},PrimitiveSchemaDefinitionSchema:function(){return Dn},ProgressNotificationParamsSchema:function(){return _e},ProgressNotificationSchema:function(){return ye},ProgressSchema:function(){return ge},ProgressTokenSchema:function(){return x},PromptArgumentSchema:function(){return St},PromptListChangedNotificationSchema:function(){return Yt},PromptMessageSchema:function(){return Wt},PromptReferenceSchema:function(){return Jn},PromptSchema:function(){return $t},RELATED_TASK_META_KEY:function(){return b},ReadResourceRequestParamsSchema:function(){return Xe},ReadResourceRequestSchema:function(){return tt},ReadResourceResultSchema:function(){return ot},RelatedTaskMetadataSchema:function(){return C},RequestIdSchema:function(){return U},RequestSchema:function(){return O},ResourceContentsSchema:function(){return Ae},ResourceLinkSchema:function(){return Jt},ResourceListChangedNotificationSchema:function(){return it},ResourceReferenceSchema:function(){return Bn},ResourceRequestParamsSchema:function(){return Qe},ResourceSchema:function(){return Le},ResourceTemplateReferenceSchema:function(){return Hn},ResourceTemplateSchema:function(){return qe},ResourceUpdatedNotificationParamsSchema:function(){return bt},ResourceUpdatedNotificationSchema:function(){return kt},ResultSchema:function(){return M},RoleSchema:function(){return Me},RootSchema:function(){return Yn},RootsListChangedNotificationSchema:function(){return tr},SUPPORTED_PROTOCOL_VERSIONS:function(){return w},SamplingContentSchema:function(){return wn},SamplingMessageContentBlockSchema:function(){return bn},SamplingMessageSchema:function(){return kn},ServerCapabilitiesSchema:function(){return pe},ServerNotificationSchema:function(){return ar},ServerRequestSchema:function(){return ir},ServerResultSchema:function(){return cr},ServerTasksCapabilitySchema:function(){return ce},SetLevelRequestParamsSchema:function(){return pn},SetLevelRequestSchema:function(){return mn},SingleSelectEnumSchemaSchema:function(){return Zn},StringSchemaSchema:function(){return En},SubscribeRequestParamsSchema:function(){return at},SubscribeRequestSchema:function(){return pt},TaskAugmentedRequestParamsSchema:function(){return A},TaskCreationParamsSchema:function(){return E},TaskMetadataSchema:function(){return R},TaskSchema:function(){return Se},TaskStatusNotificationParamsSchema:function(){return xe},TaskStatusNotificationSchema:function(){return je},TaskStatusSchema:function(){return ke},TextContentSchema:function(){return qt},TextResourceContentsSchema:function(){return Oe},TitledMultiSelectEnumSchemaSchema:function(){return An},TitledSingleSelectEnumSchemaSchema:function(){return Rn},ToolAnnotationsSchema:function(){return Xt},ToolChoiceSchema:function(){return yn},ToolExecutionSchema:function(){return en},ToolListChangedNotificationSchema:function(){return dn},ToolResultContentSchema:function(){return vn},ToolSchema:function(){return tn},ToolUseContentSchema:function(){return Kt},UnsubscribeRequestParamsSchema:function(){return yt},UnsubscribeRequestSchema:function(){return vt},UntitledMultiSelectEnumSchemaSchema:function(){return zn},UntitledSingleSelectEnumSchemaSchema:function(){return In},UrlElicitationRequiredError:function(){return UrlElicitationRequiredError},assertCompleteRequestPrompt:function(){return assertCompleteRequestPrompt},assertCompleteRequestResourceTemplate:function(){return assertCompleteRequestResourceTemplate},isInitializeRequest:function(){return isInitializeRequest},isInitializedNotification:function(){return isInitializedNotification},isJSONRPCError:function(){return G},isJSONRPCErrorResponse:function(){return isJSONRPCErrorResponse},isJSONRPCNotification:function(){return isJSONRPCNotification},isJSONRPCRequest:function(){return isJSONRPCRequest},isJSONRPCResponse:function(){return K},isJSONRPCResultResponse:function(){return isJSONRPCResultResponse},isTaskAugmentedRequestParams:function(){return isTaskAugmentedRequestParams}});var f=m("./node_modules/zod/v4/classic/schemas.js"),h=m("./node_modules/zod/v4/classic/iso.js");const y="2025-11-25",v="2025-03-26",w=[y,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],b="io.modelcontextprotocol/related-task",S="2.0",$=f.custom(u=>null!==u&&("object"==typeof u||"function"==typeof u)),x=f.union([f.string(),f.number().int()]),j=f.string(),E=f.looseObject({ttl:f.union([f.number(),f.null()]).optional(),pollInterval:f.number().optional()}),R=f.object({ttl:f.number().optional()}),C=f.object({taskId:f.string()}),Z=f.looseObject({progressToken:x.optional(),[b]:C.optional()}),z=f.object({_meta:Z.optional()}),A=z.extend({task:R.optional()}),isTaskAugmentedRequestParams=u=>A.safeParse(u).success,O=f.object({method:f.string(),params:z.loose().optional()}),N=f.object({_meta:Z.optional()}),D=f.object({method:f.string(),params:N.loose().optional()}),M=f.looseObject({_meta:Z.optional()}),U=f.union([f.string(),f.number().int()]),L=f.object({jsonrpc:f.literal(S),id:U,...O.shape}).strict(),isJSONRPCRequest=u=>L.safeParse(u).success,F=f.object({jsonrpc:f.literal(S),...D.shape}).strict(),isJSONRPCNotification=u=>F.safeParse(u).success,V=f.object({jsonrpc:f.literal(S),id:U,result:M}).strict(),isJSONRPCResultResponse=u=>V.safeParse(u).success,K=isJSONRPCResultResponse;var H;!function(u){u[u.ConnectionClosed=-32e3]="ConnectionClosed",u[u.RequestTimeout=-32001]="RequestTimeout",u[u.ParseError=-32700]="ParseError",u[u.InvalidRequest=-32600]="InvalidRequest",u[u.MethodNotFound=-32601]="MethodNotFound",u[u.InvalidParams=-32602]="InvalidParams",u[u.InternalError=-32603]="InternalError",u[u.UrlElicitationRequired=-32042]="UrlElicitationRequired"}(H||(H={}));const B=f.object({jsonrpc:f.literal(S),id:U.optional(),error:f.object({code:f.number().int(),message:f.string(),data:f.unknown().optional()})}).strict(),J=B,isJSONRPCErrorResponse=u=>B.safeParse(u).success,G=isJSONRPCErrorResponse,W=f.union([L,F,V,B]),Q=f.union([V,B]),Y=M.strict(),X=N.extend({requestId:U.optional(),reason:f.string().optional()}),ee=D.extend({method:f.literal("notifications/cancelled"),params:X}),te=f.object({src:f.string(),mimeType:f.string().optional(),sizes:f.array(f.string()).optional(),theme:f.enum(["light","dark"]).optional()}),ne=f.object({icons:f.array(te).optional()}),re=f.object({name:f.string(),title:f.string().optional()}),oe=re.extend({...re.shape,...ne.shape,version:f.string(),websiteUrl:f.string().optional(),description:f.string().optional()}),se=f.intersection(f.object({applyDefaults:f.boolean().optional()}),f.record(f.string(),f.unknown())),ie=f.preprocess(u=>u&&"object"==typeof u&&!Array.isArray(u)&&0===Object.keys(u).length?{form:{}}:u,f.intersection(f.object({form:se.optional(),url:$.optional()}),f.record(f.string(),f.unknown()).optional())),ae=f.looseObject({list:$.optional(),cancel:$.optional(),requests:f.looseObject({sampling:f.looseObject({createMessage:$.optional()}).optional(),elicitation:f.looseObject({create:$.optional()}).optional()}).optional()}),ce=f.looseObject({list:$.optional(),cancel:$.optional(),requests:f.looseObject({tools:f.looseObject({call:$.optional()}).optional()}).optional()}),de=f.object({experimental:f.record(f.string(),$).optional(),sampling:f.object({context:$.optional(),tools:$.optional()}).optional(),elicitation:ie.optional(),roots:f.object({listChanged:f.boolean().optional()}).optional(),tasks:ae.optional()}),ue=z.extend({protocolVersion:f.string(),capabilities:de,clientInfo:oe}),le=O.extend({method:f.literal("initialize"),params:ue}),isInitializeRequest=u=>le.safeParse(u).success,pe=f.object({experimental:f.record(f.string(),$).optional(),logging:$.optional(),completions:$.optional(),prompts:f.object({listChanged:f.boolean().optional()}).optional(),resources:f.object({subscribe:f.boolean().optional(),listChanged:f.boolean().optional()}).optional(),tools:f.object({listChanged:f.boolean().optional()}).optional(),tasks:ce.optional()}),me=M.extend({protocolVersion:f.string(),capabilities:pe,serverInfo:oe,instructions:f.string().optional()}),fe=D.extend({method:f.literal("notifications/initialized"),params:N.optional()}),isInitializedNotification=u=>fe.safeParse(u).success,he=O.extend({method:f.literal("ping"),params:z.optional()}),ge=f.object({progress:f.number(),total:f.optional(f.number()),message:f.optional(f.string())}),_e=f.object({...N.shape,...ge.shape,progressToken:x}),ye=D.extend({method:f.literal("notifications/progress"),params:_e}),ve=z.extend({cursor:j.optional()}),we=O.extend({params:ve.optional()}),be=M.extend({nextCursor:j.optional()}),ke=f.enum(["working","input_required","completed","failed","cancelled"]),Se=f.object({taskId:f.string(),status:ke,ttl:f.union([f.number(),f.null()]),createdAt:f.string(),lastUpdatedAt:f.string(),pollInterval:f.optional(f.number()),statusMessage:f.optional(f.string())}),$e=M.extend({task:Se}),xe=N.merge(Se),je=D.extend({method:f.literal("notifications/tasks/status"),params:xe}),Te=O.extend({method:f.literal("tasks/get"),params:z.extend({taskId:f.string()})}),Ee=M.merge(Se),Pe=O.extend({method:f.literal("tasks/result"),params:z.extend({taskId:f.string()})}),Ie=M.loose(),Re=we.extend({method:f.literal("tasks/list")}),Ce=be.extend({tasks:f.array(Se)}),Ze=O.extend({method:f.literal("tasks/cancel"),params:z.extend({taskId:f.string()})}),ze=M.merge(Se),Ae=f.object({uri:f.string(),mimeType:f.optional(f.string()),_meta:f.record(f.string(),f.unknown()).optional()}),Oe=Ae.extend({text:f.string()}),Ne=f.string().refine(u=>{try{return atob(u),!0}catch{return!1}},{message:"Invalid Base64 string"}),De=Ae.extend({blob:Ne}),Me=f.enum(["user","assistant"]),Ue=f.object({audience:f.array(Me).optional(),priority:f.number().min(0).max(1).optional(),lastModified:h.datetime({offset:!0}).optional()}),Le=f.object({...re.shape,...ne.shape,uri:f.string(),description:f.optional(f.string()),mimeType:f.optional(f.string()),annotations:Ue.optional(),_meta:f.optional(f.looseObject({}))}),qe=f.object({...re.shape,...ne.shape,uriTemplate:f.string(),description:f.optional(f.string()),mimeType:f.optional(f.string()),annotations:Ue.optional(),_meta:f.optional(f.looseObject({}))}),He=we.extend({method:f.literal("resources/list")}),Be=be.extend({resources:f.array(Le)}),Ge=we.extend({method:f.literal("resources/templates/list")}),We=be.extend({resourceTemplates:f.array(qe)}),Qe=z.extend({uri:f.string()}),Xe=Qe,tt=O.extend({method:f.literal("resources/read"),params:Xe}),ot=M.extend({contents:f.array(f.union([Oe,De]))}),it=D.extend({method:f.literal("notifications/resources/list_changed"),params:N.optional()}),at=Qe,pt=O.extend({method:f.literal("resources/subscribe"),params:at}),yt=Qe,vt=O.extend({method:f.literal("resources/unsubscribe"),params:yt}),bt=N.extend({uri:f.string()}),kt=D.extend({method:f.literal("notifications/resources/updated"),params:bt}),St=f.object({name:f.string(),description:f.optional(f.string()),required:f.optional(f.boolean())}),$t=f.object({...re.shape,...ne.shape,description:f.optional(f.string()),arguments:f.optional(f.array(St)),_meta:f.optional(f.looseObject({}))}),Et=we.extend({method:f.literal("prompts/list")}),Zt=be.extend({prompts:f.array($t)}),Mt=z.extend({name:f.string(),arguments:f.record(f.string(),f.string()).optional()}),Lt=O.extend({method:f.literal("prompts/get"),params:Mt}),qt=f.object({type:f.literal("text"),text:f.string(),annotations:Ue.optional(),_meta:f.record(f.string(),f.unknown()).optional()}),Ft=f.object({type:f.literal("image"),data:Ne,mimeType:f.string(),annotations:Ue.optional(),_meta:f.record(f.string(),f.unknown()).optional()}),Vt=f.object({type:f.literal("audio"),data:Ne,mimeType:f.string(),annotations:Ue.optional(),_meta:f.record(f.string(),f.unknown()).optional()}),Kt=f.object({type:f.literal("tool_use"),name:f.string(),id:f.string(),input:f.record(f.string(),f.unknown()),_meta:f.record(f.string(),f.unknown()).optional()}),Bt=f.object({type:f.literal("resource"),resource:f.union([Oe,De]),annotations:Ue.optional(),_meta:f.record(f.string(),f.unknown()).optional()}),Jt=Le.extend({type:f.literal("resource_link")}),Gt=f.union([qt,Ft,Vt,Jt,Bt]),Wt=f.object({role:Me,content:Gt}),Qt=M.extend({description:f.string().optional(),messages:f.array(Wt)}),Yt=D.extend({method:f.literal("notifications/prompts/list_changed"),params:N.optional()}),Xt=f.object({title:f.string().optional(),readOnlyHint:f.boolean().optional(),destructiveHint:f.boolean().optional(),idempotentHint:f.boolean().optional(),openWorldHint:f.boolean().optional()}),en=f.object({taskSupport:f.enum(["required","optional","forbidden"]).optional()}),tn=f.object({...re.shape,...ne.shape,description:f.string().optional(),inputSchema:f.object({type:f.literal("object"),properties:f.record(f.string(),$).optional(),required:f.array(f.string()).optional()}).catchall(f.unknown()),outputSchema:f.object({type:f.literal("object"),properties:f.record(f.string(),$).optional(),required:f.array(f.string()).optional()}).catchall(f.unknown()).optional(),annotations:Xt.optional(),execution:en.optional(),_meta:f.record(f.string(),f.unknown()).optional()}),nn=we.extend({method:f.literal("tools/list")}),rn=be.extend({tools:f.array(tn)}),on=M.extend({content:f.array(Gt).default([]),structuredContent:f.record(f.string(),f.unknown()).optional(),isError:f.boolean().optional()}),sn=on.or(M.extend({toolResult:f.unknown()})),an=A.extend({name:f.string(),arguments:f.record(f.string(),f.unknown()).optional()}),cn=O.extend({method:f.literal("tools/call"),params:an}),dn=D.extend({method:f.literal("notifications/tools/list_changed"),params:N.optional()}),un=f.object({autoRefresh:f.boolean().default(!0),debounceMs:f.number().int().nonnegative().default(300)}),ln=f.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),pn=z.extend({level:ln}),mn=O.extend({method:f.literal("logging/setLevel"),params:pn}),fn=N.extend({level:ln,logger:f.string().optional(),data:f.unknown()}),hn=D.extend({method:f.literal("notifications/message"),params:fn}),gn=f.object({name:f.string().optional()}),_n=f.object({hints:f.array(gn).optional(),costPriority:f.number().min(0).max(1).optional(),speedPriority:f.number().min(0).max(1).optional(),intelligencePriority:f.number().min(0).max(1).optional()}),yn=f.object({mode:f.enum(["auto","required","none"]).optional()}),vn=f.object({type:f.literal("tool_result"),toolUseId:f.string().describe("The unique identifier for the corresponding tool call."),content:f.array(Gt).default([]),structuredContent:f.object({}).loose().optional(),isError:f.boolean().optional(),_meta:f.record(f.string(),f.unknown()).optional()}),wn=f.discriminatedUnion("type",[qt,Ft,Vt]),bn=f.discriminatedUnion("type",[qt,Ft,Vt,Kt,vn]),kn=f.object({role:Me,content:f.union([bn,f.array(bn)]),_meta:f.record(f.string(),f.unknown()).optional()}),Sn=A.extend({messages:f.array(kn),modelPreferences:_n.optional(),systemPrompt:f.string().optional(),includeContext:f.enum(["none","thisServer","allServers"]).optional(),temperature:f.number().optional(),maxTokens:f.number().int(),stopSequences:f.array(f.string()).optional(),metadata:$.optional(),tools:f.array(tn).optional(),toolChoice:yn.optional()}),$n=O.extend({method:f.literal("sampling/createMessage"),params:Sn}),xn=M.extend({model:f.string(),stopReason:f.optional(f.enum(["endTurn","stopSequence","maxTokens"]).or(f.string())),role:Me,content:wn}),jn=M.extend({model:f.string(),stopReason:f.optional(f.enum(["endTurn","stopSequence","maxTokens","toolUse"]).or(f.string())),role:Me,content:f.union([bn,f.array(bn)])}),Tn=f.object({type:f.literal("boolean"),title:f.string().optional(),description:f.string().optional(),default:f.boolean().optional()}),En=f.object({type:f.literal("string"),title:f.string().optional(),description:f.string().optional(),minLength:f.number().optional(),maxLength:f.number().optional(),format:f.enum(["email","uri","date","date-time"]).optional(),default:f.string().optional()}),Pn=f.object({type:f.enum(["number","integer"]),title:f.string().optional(),description:f.string().optional(),minimum:f.number().optional(),maximum:f.number().optional(),default:f.number().optional()}),In=f.object({type:f.literal("string"),title:f.string().optional(),description:f.string().optional(),enum:f.array(f.string()),default:f.string().optional()}),Rn=f.object({type:f.literal("string"),title:f.string().optional(),description:f.string().optional(),oneOf:f.array(f.object({const:f.string(),title:f.string()})),default:f.string().optional()}),Cn=f.object({type:f.literal("string"),title:f.string().optional(),description:f.string().optional(),enum:f.array(f.string()),enumNames:f.array(f.string()).optional(),default:f.string().optional()}),Zn=f.union([In,Rn]),zn=f.object({type:f.literal("array"),title:f.string().optional(),description:f.string().optional(),minItems:f.number().optional(),maxItems:f.number().optional(),items:f.object({type:f.literal("string"),enum:f.array(f.string())}),default:f.array(f.string()).optional()}),An=f.object({type:f.literal("array"),title:f.string().optional(),description:f.string().optional(),minItems:f.number().optional(),maxItems:f.number().optional(),items:f.object({anyOf:f.array(f.object({const:f.string(),title:f.string()}))}),default:f.array(f.string()).optional()}),On=f.union([zn,An]),Nn=f.union([Cn,Zn,On]),Dn=f.union([Nn,Tn,En,Pn]),Mn=A.extend({mode:f.literal("form").optional(),message:f.string(),requestedSchema:f.object({type:f.literal("object"),properties:f.record(f.string(),Dn),required:f.array(f.string()).optional()})}),Un=A.extend({mode:f.literal("url"),message:f.string(),elicitationId:f.string(),url:f.string().url()}),Ln=f.union([Mn,Un]),qn=O.extend({method:f.literal("elicitation/create"),params:Ln}),Fn=N.extend({elicitationId:f.string()}),Vn=D.extend({method:f.literal("notifications/elicitation/complete"),params:Fn}),Kn=M.extend({action:f.enum(["accept","decline","cancel"]),content:f.preprocess(u=>null===u?void 0:u,f.record(f.string(),f.union([f.string(),f.number(),f.boolean(),f.array(f.string())])).optional())}),Hn=f.object({type:f.literal("ref/resource"),uri:f.string()}),Bn=Hn,Jn=f.object({type:f.literal("ref/prompt"),name:f.string()}),Gn=z.extend({ref:f.union([Jn,Hn]),argument:f.object({name:f.string(),value:f.string()}),context:f.object({arguments:f.record(f.string(),f.string()).optional()}).optional()}),Wn=O.extend({method:f.literal("completion/complete"),params:Gn});function assertCompleteRequestPrompt(u){if("ref/prompt"!==u.params.ref.type)throw new TypeError(`Expected CompleteRequestPrompt, but got ${u.params.ref.type}`)}function assertCompleteRequestResourceTemplate(u){if("ref/resource"!==u.params.ref.type)throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${u.params.ref.type}`)}const Qn=M.extend({completion:f.looseObject({values:f.array(f.string()).max(100),total:f.optional(f.number().int()),hasMore:f.optional(f.boolean())})}),Yn=f.object({uri:f.string().startsWith("file://"),name:f.string().optional(),_meta:f.record(f.string(),f.unknown()).optional()}),Xn=O.extend({method:f.literal("roots/list"),params:z.optional()}),er=M.extend({roots:f.array(Yn)}),tr=D.extend({method:f.literal("notifications/roots/list_changed"),params:N.optional()}),nr=f.union([he,le,Wn,mn,Lt,Et,He,Ge,tt,pt,vt,cn,nn,Te,Pe,Re,Ze]),rr=f.union([ee,ye,fe,tr,je]),sr=f.union([Y,xn,jn,Kn,er,Ee,Ce,$e]),ir=f.union([he,$n,qn,Xn,Te,Pe,Re,Ze]),ar=f.union([ee,ye,hn,kt,it,dn,Yt,je,Vn]),cr=f.union([Y,me,Qn,Qt,Zt,Be,We,ot,on,rn,Ee,Ce,$e]);class McpError extends Error{constructor(u,l,m){super(`MCP error ${u}: ${l}`),this.code=u,this.data=m,this.name="McpError"}static fromError(u,l,m){if(u===H.UrlElicitationRequired&&m){const u=m;if(u.elicitations)return new UrlElicitationRequiredError(u.elicitations,l)}return new McpError(u,l,m)}}class UrlElicitationRequiredError extends McpError{constructor(u,l=`URL elicitation${u.length>1?"s":""} required`){super(H.UrlElicitationRequired,l,{elicitations:u})}get elicitations(){return this.data?.elicitations??[]}}},"./node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js":function(u,l,m){m.r(l),m.d(l,{AjvJsonSchemaValidator:function(){return AjvJsonSchemaValidator}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/ajv.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv-formats/dist/index.js");class AjvJsonSchemaValidator{constructor(u){this._ajv=u??function createDefaultAjvInstance(){const u=new f({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return h(u),u}()}getValidator(u){const l="$id"in u&&"string"==typeof u.$id?this._ajv.getSchema(u.$id)??this._ajv.compile(u):this._ajv.compile(u);return u=>l(u)?{valid:!0,data:u,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(l.errors)}}}},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv-formats/dist/formats.js":function(u,l){function fmtDef(u,l){return{validate:u,compare:l}}Object.defineProperty(l,"__esModule",{value:!0}),l.formatNames=l.fastFormats=l.fullFormats=void 0,l.fullFormats={date:fmtDef(date,compareDate),time:fmtDef(getTime(!0),compareTime),"date-time":fmtDef(getDateTime(!0),compareDateTime),"iso-time":fmtDef(getTime(),compareIsoTime),"iso-date-time":fmtDef(getDateTime(),compareIsoDateTime),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function uri(u){return v.test(u)&&w.test(u)},"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:function regex(u){if(x.test(u))return!1;try{return new RegExp(u),!0}catch(u){return!1}},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:function byte(u){return b.lastIndex=0,b.test(u)},int32:{type:"number",validate:function validateInt32(u){return Number.isInteger(u)&&u<=$&&u>=S}},int64:{type:"number",validate:function validateInt64(u){return Number.isInteger(u)}},float:{type:"number",validate:validateNumber},double:{type:"number",validate:validateNumber},password:!0,binary:!0},l.fastFormats={...l.fullFormats,date:fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,compareDate),time:fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,compareTime),"date-time":fmtDef(/^\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,compareDateTime),"iso-time":fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,compareIsoTime),"iso-date-time":fmtDef(/^\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,compareIsoDateTime),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},l.formatNames=Object.keys(l.fullFormats);const m=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,f=[0,31,28,31,30,31,30,31,31,30,31,30,31];function date(u){const l=m.exec(u);if(!l)return!1;const h=+l[1],y=+l[2],v=+l[3];return y>=1&&y<=12&&v>=1&&v<=(2===y&&function isLeapYear(u){return u%4==0&&(u%100!=0||u%400==0)}(h)?29:f[y])}function compareDate(u,l){if(u&&l)return u>l?1:u<l?-1:0}const h=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function getTime(u){return function time(l){const m=h.exec(l);if(!m)return!1;const f=+m[1],y=+m[2],v=+m[3],w=m[4],b="-"===m[5]?-1:1,S=+(m[6]||0),$=+(m[7]||0);if(S>23||$>59||u&&!w)return!1;if(f<=23&&y<=59&&v<60)return!0;const x=y-$*b,j=f-S*b-(x<0?1:0);return(23===j||-1===j)&&(59===x||-1===x)&&v<61}}function compareTime(u,l){if(!u||!l)return;const m=new Date("2020-01-01T"+u).valueOf(),f=new Date("2020-01-01T"+l).valueOf();return m&&f?m-f:void 0}function compareIsoTime(u,l){if(!u||!l)return;const m=h.exec(u),f=h.exec(l);return m&&f?(u=m[1]+m[2]+m[3])>(l=f[1]+f[2]+f[3])?1:u<l?-1:0:void 0}const y=/t|\s/i;function getDateTime(u){const l=getTime(u);return function date_time(u){const m=u.split(y);return 2===m.length&&date(m[0])&&l(m[1])}}function compareDateTime(u,l){if(!u||!l)return;const m=new Date(u).valueOf(),f=new Date(l).valueOf();return m&&f?m-f:void 0}function compareIsoDateTime(u,l){if(!u||!l)return;const[m,f]=u.split(y),[h,v]=l.split(y),w=compareDate(m,h);return void 0!==w?w||compareTime(f,v):void 0}const v=/\/|:/,w=/^(?:[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;const b=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;const S=-(2**31),$=2**31-1;function validateNumber(){return!0}const x=/[^\\]\\Z/},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv-formats/dist/index.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv-formats/dist/formats.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv-formats/dist/limit.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),v=new y.Name("fullFormats"),w=new y.Name("fastFormats"),formatsPlugin=(u,l={keywords:!0})=>{if(Array.isArray(l))return addFormats(u,l,f.fullFormats,v),u;const[m,y]="fast"===l.mode?[f.fastFormats,w]:[f.fullFormats,v];return addFormats(u,l.formats||f.formatNames,m,y),l.keywords&&(0,h.default)(u),u};function addFormats(u,l,m,f){var h,v;null!==(h=(v=u.opts.code).formats)&&void 0!==h||(v.formats=y._`require("ajv-formats/dist/formats").${f}`);for(const f of l)u.addFormat(f,m[f])}formatsPlugin.get=(u,l="full")=>{const m=("fast"===l?f.fastFormats:f.fullFormats)[u];if(!m)throw new Error(`Unknown format "${u}"`);return m},u.exports=l=formatsPlugin,Object.defineProperty(l,"__esModule",{value:!0}),l.default=formatsPlugin},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv-formats/dist/limit.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.formatLimitDefinition=void 0;const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/ajv.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),y=h.operators,v={formatMaximum:{okStr:"<=",ok:y.LTE,fail:y.GT},formatMinimum:{okStr:">=",ok:y.GTE,fail:y.LT},formatExclusiveMaximum:{okStr:"<",ok:y.LT,fail:y.GTE},formatExclusiveMinimum:{okStr:">",ok:y.GT,fail:y.LTE}},w={message:({keyword:u,schemaCode:l})=>h.str`should be ${v[u].okStr} ${l}`,params:({keyword:u,schemaCode:l})=>h._`{comparison: ${v[u].okStr}, limit: ${l}}`};l.formatLimitDefinition={keyword:Object.keys(v),type:"string",schemaType:"string",$data:!0,error:w,code(u){const{gen:l,data:m,schemaCode:y,keyword:w,it:b}=u,{opts:S,self:$}=b;if(!S.validateFormats)return;const x=new f.KeywordCxt(b,$.RULES.all.format.definition,"format");function compareCode(u){return h._`${u}.compare(${m}, ${y}) ${v[w].fail} 0`}x.$data?function validate$DataFormat(){const m=l.scopeValue("formats",{ref:$.formats,code:S.code.formats}),f=l.const("fmt",h._`${m}[${x.schemaCode}]`);u.fail$data((0,h.or)(h._`typeof ${f} != "object"`,h._`${f} instanceof RegExp`,h._`typeof ${f}.compare != "function"`,compareCode(f)))}():function validateFormat(){const m=x.schema,f=$.formats[m];if(!f||!0===f)return;if("object"!=typeof f||f instanceof RegExp||"function"!=typeof f.compare)throw new Error(`"${w}": format "${m}" does not define "compare" function`);const y=l.scopeValue("formats",{key:m,ref:f,code:S.code.formats?h._`${S.code.formats}${(0,h.getProperty)(m)}`:void 0});u.fail$data(compareCode(y))}()},dependencies:["format"]};l.default=u=>(u.addKeyword(l.formatLimitDefinition),u)},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/ajv.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.MissingRefError=l.ValidationError=l.CodeGen=l.Name=l.nil=l.stringify=l.str=l._=l.KeywordCxt=l.Ajv=void 0;const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/core.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/draft7.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/discriminator/index.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/refs/json-schema-draft-07.json"),w=["/properties"],b="http://json-schema.org/draft-07/schema";class Ajv extends f.default{_addVocabularies(){super._addVocabularies(),h.default.forEach(u=>this.addVocabulary(u)),this.opts.discriminator&&this.addKeyword(y.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const u=this.opts.$data?this.$dataMetaSchema(v,w):v;this.addMetaSchema(u,b,!1),this.refs["http://json-schema.org/schema"]=b}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(b)?b:void 0)}}l.Ajv=Ajv,u.exports=l=Ajv,u.exports.Ajv=Ajv,Object.defineProperty(l,"__esModule",{value:!0}),l.default=Ajv;var S=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/index.js");Object.defineProperty(l,"KeywordCxt",{enumerable:!0,get:function(){return S.KeywordCxt}});var $=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");Object.defineProperty(l,"_",{enumerable:!0,get:function(){return $._}}),Object.defineProperty(l,"str",{enumerable:!0,get:function(){return $.str}}),Object.defineProperty(l,"stringify",{enumerable:!0,get:function(){return $.stringify}}),Object.defineProperty(l,"nil",{enumerable:!0,get:function(){return $.nil}}),Object.defineProperty(l,"Name",{enumerable:!0,get:function(){return $.Name}}),Object.defineProperty(l,"CodeGen",{enumerable:!0,get:function(){return $.CodeGen}});var x=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/validation_error.js");Object.defineProperty(l,"ValidationError",{enumerable:!0,get:function(){return x.default}});var j=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/ref_error.js");Object.defineProperty(l,"MissingRefError",{enumerable:!0,get:function(){return j.default}})},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/code.js":function(u,l){Object.defineProperty(l,"__esModule",{value:!0}),l.regexpCode=l.getEsmExportName=l.getProperty=l.safeStringify=l.stringify=l.strConcat=l.addCodeArg=l.str=l._=l.nil=l._Code=l.Name=l.IDENTIFIER=l._CodeOrName=void 0;class _CodeOrName{}l._CodeOrName=_CodeOrName,l.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class Name extends _CodeOrName{constructor(u){if(super(),!l.IDENTIFIER.test(u))throw new Error("CodeGen: name must be a valid identifier");this.str=u}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}l.Name=Name;class _Code extends _CodeOrName{constructor(u){super(),this._items="string"==typeof u?[u]:u}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const u=this._items[0];return""===u||'""'===u}get str(){var u;return null!==(u=this._str)&&void 0!==u?u:this._str=this._items.reduce((u,l)=>`${u}${l}`,"")}get names(){var u;return null!==(u=this._names)&&void 0!==u?u:this._names=this._items.reduce((u,l)=>(l instanceof Name&&(u[l.str]=(u[l.str]||0)+1),u),{})}}function _(u,...l){const m=[u[0]];let f=0;for(;f<l.length;)addCodeArg(m,l[f]),m.push(u[++f]);return new _Code(m)}l._Code=_Code,l.nil=new _Code(""),l._=_;const m=new _Code("+");function str(u,...l){const f=[safeStringify(u[0])];let h=0;for(;h<l.length;)f.push(m),addCodeArg(f,l[h]),f.push(m,safeStringify(u[++h]));return function optimize(u){let l=1;for(;l<u.length-1;){if(u[l]===m){const m=mergeExprItems(u[l-1],u[l+1]);if(void 0!==m){u.splice(l-1,3,m);continue}u[l++]="+"}l++}}(f),new _Code(f)}function addCodeArg(u,l){l instanceof _Code?u.push(...l._items):l instanceof Name?u.push(l):u.push(function interpolate(u){return"number"==typeof u||"boolean"==typeof u||null===u?u:safeStringify(Array.isArray(u)?u.join(","):u)}(l))}function mergeExprItems(u,l){if('""'===l)return u;if('""'===u)return l;if("string"==typeof u){if(l instanceof Name||'"'!==u[u.length-1])return;return"string"!=typeof l?`${u.slice(0,-1)}${l}"`:'"'===l[0]?u.slice(0,-1)+l.slice(1):void 0}return"string"!=typeof l||'"'!==l[0]||u instanceof Name?void 0:`"${u}${l.slice(1)}`}function safeStringify(u){return JSON.stringify(u).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}l.str=str,l.addCodeArg=addCodeArg,l.strConcat=function strConcat(u,l){return l.emptyStr()?u:u.emptyStr()?l:str`${u}${l}`},l.stringify=function stringify(u){return new _Code(safeStringify(u))},l.safeStringify=safeStringify,l.getProperty=function getProperty(u){return"string"==typeof u&&l.IDENTIFIER.test(u)?new _Code(`.${u}`):_`[${u}]`},l.getEsmExportName=function getEsmExportName(u){if("string"==typeof u&&l.IDENTIFIER.test(u))return new _Code(`${u}`);throw new Error(`CodeGen: invalid export name: ${u}, use explicit $id name mapping`)},l.regexpCode=function regexpCode(u){return new _Code(u.toString())}},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.or=l.and=l.not=l.CodeGen=l.operators=l.varKinds=l.ValueScopeName=l.ValueScope=l.Scope=l.Name=l.regexpCode=l.stringify=l.getProperty=l.nil=l.strConcat=l.str=l._=void 0;const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/code.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/scope.js");var y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/code.js");Object.defineProperty(l,"_",{enumerable:!0,get:function(){return y._}}),Object.defineProperty(l,"str",{enumerable:!0,get:function(){return y.str}}),Object.defineProperty(l,"strConcat",{enumerable:!0,get:function(){return y.strConcat}}),Object.defineProperty(l,"nil",{enumerable:!0,get:function(){return y.nil}}),Object.defineProperty(l,"getProperty",{enumerable:!0,get:function(){return y.getProperty}}),Object.defineProperty(l,"stringify",{enumerable:!0,get:function(){return y.stringify}}),Object.defineProperty(l,"regexpCode",{enumerable:!0,get:function(){return y.regexpCode}}),Object.defineProperty(l,"Name",{enumerable:!0,get:function(){return y.Name}});var v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/scope.js");Object.defineProperty(l,"Scope",{enumerable:!0,get:function(){return v.Scope}}),Object.defineProperty(l,"ValueScope",{enumerable:!0,get:function(){return v.ValueScope}}),Object.defineProperty(l,"ValueScopeName",{enumerable:!0,get:function(){return v.ValueScopeName}}),Object.defineProperty(l,"varKinds",{enumerable:!0,get:function(){return v.varKinds}}),l.operators={GT:new f._Code(">"),GTE:new f._Code(">="),LT:new f._Code("<"),LTE:new f._Code("<="),EQ:new f._Code("==="),NEQ:new f._Code("!=="),NOT:new f._Code("!"),OR:new f._Code("||"),AND:new f._Code("&&"),ADD:new f._Code("+")};class Node{optimizeNodes(){return this}optimizeNames(u,l){return this}}class Def extends Node{constructor(u,l,m){super(),this.varKind=u,this.name=l,this.rhs=m}render({es5:u,_n:l}){const m=u?h.varKinds.var:this.varKind,f=void 0===this.rhs?"":` = ${this.rhs}`;return`${m} ${this.name}${f};`+l}optimizeNames(u,l){if(u[this.name.str])return this.rhs&&(this.rhs=optimizeExpr(this.rhs,u,l)),this}get names(){return this.rhs instanceof f._CodeOrName?this.rhs.names:{}}}class Assign extends Node{constructor(u,l,m){super(),this.lhs=u,this.rhs=l,this.sideEffects=m}render({_n:u}){return`${this.lhs} = ${this.rhs};`+u}optimizeNames(u,l){if(!(this.lhs instanceof f.Name)||u[this.lhs.str]||this.sideEffects)return this.rhs=optimizeExpr(this.rhs,u,l),this}get names(){return addExprNames(this.lhs instanceof f.Name?{}:{...this.lhs.names},this.rhs)}}class AssignOp extends Assign{constructor(u,l,m,f){super(u,m,f),this.op=l}render({_n:u}){return`${this.lhs} ${this.op}= ${this.rhs};`+u}}class Label extends Node{constructor(u){super(),this.label=u,this.names={}}render({_n:u}){return`${this.label}:`+u}}class Break extends Node{constructor(u){super(),this.label=u,this.names={}}render({_n:u}){return`break${this.label?` ${this.label}`:""};`+u}}class Throw extends Node{constructor(u){super(),this.error=u}render({_n:u}){return`throw ${this.error};`+u}get names(){return this.error.names}}class AnyCode extends Node{constructor(u){super(),this.code=u}render({_n:u}){return`${this.code};`+u}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(u,l){return this.code=optimizeExpr(this.code,u,l),this}get names(){return this.code instanceof f._CodeOrName?this.code.names:{}}}class ParentNode extends Node{constructor(u=[]){super(),this.nodes=u}render(u){return this.nodes.reduce((l,m)=>l+m.render(u),"")}optimizeNodes(){const{nodes:u}=this;let l=u.length;for(;l--;){const m=u[l].optimizeNodes();Array.isArray(m)?u.splice(l,1,...m):m?u[l]=m:u.splice(l,1)}return u.length>0?this:void 0}optimizeNames(u,l){const{nodes:m}=this;let f=m.length;for(;f--;){const h=m[f];h.optimizeNames(u,l)||(subtractNames(u,h.names),m.splice(f,1))}return m.length>0?this:void 0}get names(){return this.nodes.reduce((u,l)=>addNames(u,l.names),{})}}class BlockNode extends ParentNode{render(u){return"{"+u._n+super.render(u)+"}"+u._n}}class Root extends ParentNode{}class Else extends BlockNode{}Else.kind="else";class If extends BlockNode{constructor(u,l){super(l),this.condition=u}render(u){let l=`if(${this.condition})`+super.render(u);return this.else&&(l+="else "+this.else.render(u)),l}optimizeNodes(){super.optimizeNodes();const u=this.condition;if(!0===u)return this.nodes;let l=this.else;if(l){const u=l.optimizeNodes();l=this.else=Array.isArray(u)?new Else(u):u}return l?!1===u?l instanceof If?l:l.nodes:this.nodes.length?this:new If(not(u),l instanceof If?[l]:l.nodes):!1!==u&&this.nodes.length?this:void 0}optimizeNames(u,l){var m;if(this.else=null===(m=this.else)||void 0===m?void 0:m.optimizeNames(u,l),super.optimizeNames(u,l)||this.else)return this.condition=optimizeExpr(this.condition,u,l),this}get names(){const u=super.names;return addExprNames(u,this.condition),this.else&&addNames(u,this.else.names),u}}If.kind="if";class For extends BlockNode{}For.kind="for";class ForLoop extends For{constructor(u){super(),this.iteration=u}render(u){return`for(${this.iteration})`+super.render(u)}optimizeNames(u,l){if(super.optimizeNames(u,l))return this.iteration=optimizeExpr(this.iteration,u,l),this}get names(){return addNames(super.names,this.iteration.names)}}class ForRange extends For{constructor(u,l,m,f){super(),this.varKind=u,this.name=l,this.from=m,this.to=f}render(u){const l=u.es5?h.varKinds.var:this.varKind,{name:m,from:f,to:y}=this;return`for(${l} ${m}=${f}; ${m}<${y}; ${m}++)`+super.render(u)}get names(){const u=addExprNames(super.names,this.from);return addExprNames(u,this.to)}}class ForIter extends For{constructor(u,l,m,f){super(),this.loop=u,this.varKind=l,this.name=m,this.iterable=f}render(u){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(u)}optimizeNames(u,l){if(super.optimizeNames(u,l))return this.iterable=optimizeExpr(this.iterable,u,l),this}get names(){return addNames(super.names,this.iterable.names)}}class Func extends BlockNode{constructor(u,l,m){super(),this.name=u,this.args=l,this.async=m}render(u){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(u)}}Func.kind="func";class Return extends ParentNode{render(u){return"return "+super.render(u)}}Return.kind="return";class Try extends BlockNode{render(u){let l="try"+super.render(u);return this.catch&&(l+=this.catch.render(u)),this.finally&&(l+=this.finally.render(u)),l}optimizeNodes(){var u,l;return super.optimizeNodes(),null===(u=this.catch)||void 0===u||u.optimizeNodes(),null===(l=this.finally)||void 0===l||l.optimizeNodes(),this}optimizeNames(u,l){var m,f;return super.optimizeNames(u,l),null===(m=this.catch)||void 0===m||m.optimizeNames(u,l),null===(f=this.finally)||void 0===f||f.optimizeNames(u,l),this}get names(){const u=super.names;return this.catch&&addNames(u,this.catch.names),this.finally&&addNames(u,this.finally.names),u}}class Catch extends BlockNode{constructor(u){super(),this.error=u}render(u){return`catch(${this.error})`+super.render(u)}}Catch.kind="catch";class Finally extends BlockNode{render(u){return"finally"+super.render(u)}}Finally.kind="finally";function addNames(u,l){for(const m in l)u[m]=(u[m]||0)+(l[m]||0);return u}function addExprNames(u,l){return l instanceof f._CodeOrName?addNames(u,l.names):u}function optimizeExpr(u,l,m){return u instanceof f.Name?replaceName(u):function canOptimize(u){return u instanceof f._Code&&u._items.some(u=>u instanceof f.Name&&1===l[u.str]&&void 0!==m[u.str])}(u)?new f._Code(u._items.reduce((u,l)=>(l instanceof f.Name&&(l=replaceName(l)),l instanceof f._Code?u.push(...l._items):u.push(l),u),[])):u;function replaceName(u){const f=m[u.str];return void 0===f||1!==l[u.str]?u:(delete l[u.str],f)}}function subtractNames(u,l){for(const m in l)u[m]=(u[m]||0)-(l[m]||0)}function not(u){return"boolean"==typeof u||"number"==typeof u||null===u?!u:f._`!${par(u)}`}l.CodeGen=class CodeGen{constructor(u,l={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...l,_n:l.lines?"\n":""},this._extScope=u,this._scope=new h.Scope({parent:u}),this._nodes=[new Root]}toString(){return this._root.render(this.opts)}name(u){return this._scope.name(u)}scopeName(u){return this._extScope.name(u)}scopeValue(u,l){const m=this._extScope.value(u,l);return(this._values[m.prefix]||(this._values[m.prefix]=new Set)).add(m),m}getScopeValue(u,l){return this._extScope.getValue(u,l)}scopeRefs(u){return this._extScope.scopeRefs(u,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(u,l,m,f){const h=this._scope.toName(l);return void 0!==m&&f&&(this._constants[h.str]=m),this._leafNode(new Def(u,h,m)),h}const(u,l,m){return this._def(h.varKinds.const,u,l,m)}let(u,l,m){return this._def(h.varKinds.let,u,l,m)}var(u,l,m){return this._def(h.varKinds.var,u,l,m)}assign(u,l,m){return this._leafNode(new Assign(u,l,m))}add(u,m){return this._leafNode(new AssignOp(u,l.operators.ADD,m))}code(u){return"function"==typeof u?u():u!==f.nil&&this._leafNode(new AnyCode(u)),this}object(...u){const l=["{"];for(const[m,h]of u)l.length>1&&l.push(","),l.push(m),(m!==h||this.opts.es5)&&(l.push(":"),(0,f.addCodeArg)(l,h));return l.push("}"),new f._Code(l)}if(u,l,m){if(this._blockNode(new If(u)),l&&m)this.code(l).else().code(m).endIf();else if(l)this.code(l).endIf();else if(m)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(u){return this._elseNode(new If(u))}else(){return this._elseNode(new Else)}endIf(){return this._endBlockNode(If,Else)}_for(u,l){return this._blockNode(u),l&&this.code(l).endFor(),this}for(u,l){return this._for(new ForLoop(u),l)}forRange(u,l,m,f,y=(this.opts.es5?h.varKinds.var:h.varKinds.let)){const v=this._scope.toName(u);return this._for(new ForRange(y,v,l,m),()=>f(v))}forOf(u,l,m,y=h.varKinds.const){const v=this._scope.toName(u);if(this.opts.es5){const u=l instanceof f.Name?l:this.var("_arr",l);return this.forRange("_i",0,f._`${u}.length`,l=>{this.var(v,f._`${u}[${l}]`),m(v)})}return this._for(new ForIter("of",y,v,l),()=>m(v))}forIn(u,l,m,y=(this.opts.es5?h.varKinds.var:h.varKinds.const)){if(this.opts.ownProperties)return this.forOf(u,f._`Object.keys(${l})`,m);const v=this._scope.toName(u);return this._for(new ForIter("in",y,v,l),()=>m(v))}endFor(){return this._endBlockNode(For)}label(u){return this._leafNode(new Label(u))}break(u){return this._leafNode(new Break(u))}return(u){const l=new Return;if(this._blockNode(l),this.code(u),1!==l.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Return)}try(u,l,m){if(!l&&!m)throw new Error('CodeGen: "try" without "catch" and "finally"');const f=new Try;if(this._blockNode(f),this.code(u),l){const u=this.name("e");this._currNode=f.catch=new Catch(u),l(u)}return m&&(this._currNode=f.finally=new Finally,this.code(m)),this._endBlockNode(Catch,Finally)}throw(u){return this._leafNode(new Throw(u))}block(u,l){return this._blockStarts.push(this._nodes.length),u&&this.code(u).endBlock(l),this}endBlock(u){const l=this._blockStarts.pop();if(void 0===l)throw new Error("CodeGen: not in self-balancing block");const m=this._nodes.length-l;if(m<0||void 0!==u&&m!==u)throw new Error(`CodeGen: wrong number of nodes: ${m} vs ${u} expected`);return this._nodes.length=l,this}func(u,l=f.nil,m,h){return this._blockNode(new Func(u,l,m)),h&&this.code(h).endFunc(),this}endFunc(){return this._endBlockNode(Func)}optimize(u=1){for(;u-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(u){return this._currNode.nodes.push(u),this}_blockNode(u){this._currNode.nodes.push(u),this._nodes.push(u)}_endBlockNode(u,l){const m=this._currNode;if(m instanceof u||l&&m instanceof l)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${l?`${u.kind}/${l.kind}`:u.kind}"`)}_elseNode(u){const l=this._currNode;if(!(l instanceof If))throw new Error('CodeGen: "else" without "if"');return this._currNode=l.else=u,this}get _root(){return this._nodes[0]}get _currNode(){const u=this._nodes;return u[u.length-1]}set _currNode(u){const l=this._nodes;l[l.length-1]=u}},l.not=not;const w=mappend(l.operators.AND);l.and=function and(...u){return u.reduce(w)};const b=mappend(l.operators.OR);function mappend(u){return(l,m)=>l===f.nil?m:m===f.nil?l:f._`${par(l)} ${u} ${par(m)}`}function par(u){return u instanceof f.Name?u:f._`(${u})`}l.or=function or(...u){return u.reduce(b)}},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/scope.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.ValueScope=l.ValueScopeName=l.Scope=l.varKinds=l.UsedValueState=void 0;const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/code.js");class ValueError extends Error{constructor(u){super(`CodeGen: "code" for ${u} not defined`),this.value=u.value}}var h;!function(u){u[u.Started=0]="Started",u[u.Completed=1]="Completed"}(h||(l.UsedValueState=h={})),l.varKinds={const:new f.Name("const"),let:new f.Name("let"),var:new f.Name("var")};class Scope{constructor({prefixes:u,parent:l}={}){this._names={},this._prefixes=u,this._parent=l}toName(u){return u instanceof f.Name?u:this.name(u)}name(u){return new f.Name(this._newName(u))}_newName(u){return`${u}${(this._names[u]||this._nameGroup(u)).index++}`}_nameGroup(u){var l,m;if((null===(m=null===(l=this._parent)||void 0===l?void 0:l._prefixes)||void 0===m?void 0:m.has(u))||this._prefixes&&!this._prefixes.has(u))throw new Error(`CodeGen: prefix "${u}" is not allowed in this scope`);return this._names[u]={prefix:u,index:0}}}l.Scope=Scope;class ValueScopeName extends f.Name{constructor(u,l){super(l),this.prefix=u}setValue(u,{property:l,itemIndex:m}){this.value=u,this.scopePath=f._`.${new f.Name(l)}[${m}]`}}l.ValueScopeName=ValueScopeName;const y=f._`\n`;l.ValueScope=class ValueScope extends Scope{constructor(u){super(u),this._values={},this._scope=u.scope,this.opts={...u,_n:u.lines?y:f.nil}}get(){return this._scope}name(u){return new ValueScopeName(u,this._newName(u))}value(u,l){var m;if(void 0===l.ref)throw new Error("CodeGen: ref must be passed in value");const f=this.toName(u),{prefix:h}=f,y=null!==(m=l.key)&&void 0!==m?m:l.ref;let v=this._values[h];if(v){const u=v.get(y);if(u)return u}else v=this._values[h]=new Map;v.set(y,f);const w=this._scope[h]||(this._scope[h]=[]),b=w.length;return w[b]=l.ref,f.setValue(l,{property:h,itemIndex:b}),f}getValue(u,l){const m=this._values[u];if(m)return m.get(l)}scopeRefs(u,l=this._values){return this._reduceValues(l,l=>{if(void 0===l.scopePath)throw new Error(`CodeGen: name "${l}" has no value`);return f._`${u}${l.scopePath}`})}scopeCode(u=this._values,l,m){return this._reduceValues(u,u=>{if(void 0===u.value)throw new Error(`CodeGen: name "${u}" has no value`);return u.value.code},l,m)}_reduceValues(u,m,y={},v){let w=f.nil;for(const b in u){const S=u[b];if(!S)continue;const $=y[b]=y[b]||new Map;S.forEach(u=>{if($.has(u))return;$.set(u,h.Started);let y=m(u);if(y){const m=this.opts.es5?l.varKinds.var:l.varKinds.const;w=f._`${w}${m} ${u} = ${y};${this.opts._n}`}else{if(!(y=null==v?void 0:v(u)))throw new ValueError(u);w=f._`${w}${y}${this.opts._n}`}$.set(u,h.Completed)})}return w}}},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/errors.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.extendErrors=l.resetErrorsCount=l.reportExtraError=l.reportError=l.keyword$DataError=l.keywordError=void 0;const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/names.js");function addError(u,l){const m=u.const("err",l);u.if(f._`${y.default.vErrors} === null`,()=>u.assign(y.default.vErrors,f._`[${m}]`),f._`${y.default.vErrors}.push(${m})`),u.code(f._`${y.default.errors}++`)}function returnErrors(u,l){const{gen:m,validateName:h,schemaEnv:y}=u;y.$async?m.throw(f._`new ${u.ValidationError}(${l})`):(m.assign(f._`${h}.errors`,l),m.return(!1))}l.keywordError={message:({keyword:u})=>f.str`must pass "${u}" keyword validation`},l.keyword$DataError={message:({keyword:u,schemaType:l})=>l?f.str`"${u}" keyword must be ${l} ($data)`:f.str`"${u}" keyword is invalid ($data)`},l.reportError=function reportError(u,m=l.keywordError,h,y){const{it:v}=u,{gen:w,compositeRule:b,allErrors:S}=v,$=errorObjectCode(u,m,h);(null!=y?y:b||S)?addError(w,$):returnErrors(v,f._`[${$}]`)},l.reportExtraError=function reportExtraError(u,m=l.keywordError,f){const{it:h}=u,{gen:v,compositeRule:w,allErrors:b}=h;addError(v,errorObjectCode(u,m,f)),w||b||returnErrors(h,y.default.vErrors)},l.resetErrorsCount=function resetErrorsCount(u,l){u.assign(y.default.errors,l),u.if(f._`${y.default.vErrors} !== null`,()=>u.if(l,()=>u.assign(f._`${y.default.vErrors}.length`,l),()=>u.assign(y.default.vErrors,null)))},l.extendErrors=function extendErrors({gen:u,keyword:l,schemaValue:m,data:h,errsCount:v,it:w}){if(void 0===v)throw new Error("ajv implementation error");const b=u.name("err");u.forRange("i",v,y.default.errors,v=>{u.const(b,f._`${y.default.vErrors}[${v}]`),u.if(f._`${b}.instancePath === undefined`,()=>u.assign(f._`${b}.instancePath`,(0,f.strConcat)(y.default.instancePath,w.errorPath))),u.assign(f._`${b}.schemaPath`,f.str`${w.errSchemaPath}/${l}`),w.opts.verbose&&(u.assign(f._`${b}.schema`,m),u.assign(f._`${b}.data`,h))})};const v={keyword:new f.Name("keyword"),schemaPath:new f.Name("schemaPath"),params:new f.Name("params"),propertyName:new f.Name("propertyName"),message:new f.Name("message"),schema:new f.Name("schema"),parentSchema:new f.Name("parentSchema")};function errorObjectCode(u,l,m){const{createErrors:h}=u.it;return!1===h?f._`{}`:function errorObject(u,l,m={}){const{gen:h,it:w}=u,b=[errorInstancePath(w,m),errorSchemaPath(u,m)];return function extraErrorProps(u,{params:l,message:m},h){const{keyword:w,data:b,schemaValue:S,it:$}=u,{opts:x,propertyName:j,topSchemaRef:E,schemaPath:R}=$;h.push([v.keyword,w],[v.params,"function"==typeof l?l(u):l||f._`{}`]),x.messages&&h.push([v.message,"function"==typeof m?m(u):m]);x.verbose&&h.push([v.schema,S],[v.parentSchema,f._`${E}${R}`],[y.default.data,b]);j&&h.push([v.propertyName,j])}(u,l,b),h.object(...b)}(u,l,m)}function errorInstancePath({errorPath:u},{instancePath:l}){const m=l?f.str`${u}${(0,h.getErrorPath)(l,h.Type.Str)}`:u;return[y.default.instancePath,(0,f.strConcat)(y.default.instancePath,m)]}function errorSchemaPath({keyword:u,it:{errSchemaPath:l}},{schemaPath:m,parentSchema:y}){let w=y?l:f.str`${l}/${u}`;return m&&(w=f.str`${w}${(0,h.getErrorPath)(m,h.Type.Str)}`),[v.schemaPath,w]}},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/index.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.resolveSchema=l.getCompilingSchema=l.resolveRef=l.compileSchema=l.SchemaEnv=void 0;const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/validation_error.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/names.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/resolve.js"),w=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),b=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/index.js");class SchemaEnv{constructor(u){var l;let m;this.refs={},this.dynamicAnchors={},"object"==typeof u.schema&&(m=u.schema),this.schema=u.schema,this.schemaId=u.schemaId,this.root=u.root||this,this.baseId=null!==(l=u.baseId)&&void 0!==l?l:(0,v.normalizeId)(null==m?void 0:m[u.schemaId||"$id"]),this.schemaPath=u.schemaPath,this.localRefs=u.localRefs,this.meta=u.meta,this.$async=null==m?void 0:m.$async,this.refs={}}}function compileSchema(u){const l=getCompilingSchema.call(this,u);if(l)return l;const m=(0,v.getFullPath)(this.opts.uriResolver,u.root.baseId),{es5:w,lines:S}=this.opts.code,{ownProperties:$}=this.opts,x=new f.CodeGen(this.scope,{es5:w,lines:S,ownProperties:$});let j;u.$async&&(j=x.scopeValue("Error",{ref:h.default,code:f._`require("ajv/dist/runtime/validation_error").default`}));const E=x.scopeName("validate");u.validateName=E;const R={gen:x,allErrors:this.opts.allErrors,data:y.default.data,parentData:y.default.parentData,parentDataProperty:y.default.parentDataProperty,dataNames:[y.default.data],dataPathArr:[f.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:x.scopeValue("schema",!0===this.opts.code.source?{ref:u.schema,code:(0,f.stringify)(u.schema)}:{ref:u.schema}),validateName:E,ValidationError:j,schema:u.schema,schemaEnv:u,rootId:m,baseId:u.baseId||m,schemaPath:f.nil,errSchemaPath:u.schemaPath||(this.opts.jtd?"":"#"),errorPath:f._`""`,opts:this.opts,self:this};let C;try{this._compilations.add(u),(0,b.validateFunctionCode)(R),x.optimize(this.opts.code.optimize);const l=x.toString();C=`${x.scopeRefs(y.default.scope)}return ${l}`,this.opts.code.process&&(C=this.opts.code.process(C,u));const m=new Function(`${y.default.self}`,`${y.default.scope}`,C)(this,this.scope.get());if(this.scope.value(E,{ref:m}),m.errors=null,m.schema=u.schema,m.schemaEnv=u,u.$async&&(m.$async=!0),!0===this.opts.code.source&&(m.source={validateName:E,validateCode:l,scopeValues:x._values}),this.opts.unevaluated){const{props:u,items:l}=R;m.evaluated={props:u instanceof f.Name?void 0:u,items:l instanceof f.Name?void 0:l,dynamicProps:u instanceof f.Name,dynamicItems:l instanceof f.Name},m.source&&(m.source.evaluated=(0,f.stringify)(m.evaluated))}return u.validate=m,u}catch(l){throw delete u.validate,delete u.validateName,C&&this.logger.error("Error compiling schema, function code:",C),l}finally{this._compilations.delete(u)}}function inlineOrCompile(u){return(0,v.inlineRef)(u.schema,this.opts.inlineRefs)?u.schema:u.validate?u:compileSchema.call(this,u)}function getCompilingSchema(u){for(const l of this._compilations)if(sameSchemaEnv(l,u))return l}function sameSchemaEnv(u,l){return u.schema===l.schema&&u.root===l.root&&u.baseId===l.baseId}function resolve(u,l){let m;for(;"string"==typeof(m=this.refs[l]);)l=m;return m||this.schemas[l]||resolveSchema.call(this,u,l)}function resolveSchema(u,l){const m=this.opts.uriResolver.parse(l),f=(0,v._getFullPath)(this.opts.uriResolver,m);let h=(0,v.getFullPath)(this.opts.uriResolver,u.baseId,void 0);if(Object.keys(u.schema).length>0&&f===h)return getJsonPointer.call(this,m,u);const y=(0,v.normalizeId)(f),w=this.refs[y]||this.schemas[y];if("string"==typeof w){const l=resolveSchema.call(this,u,w);if("object"!=typeof(null==l?void 0:l.schema))return;return getJsonPointer.call(this,m,l)}if("object"==typeof(null==w?void 0:w.schema)){if(w.validate||compileSchema.call(this,w),y===(0,v.normalizeId)(l)){const{schema:l}=w,{schemaId:m}=this.opts,f=l[m];return f&&(h=(0,v.resolveUrl)(this.opts.uriResolver,h,f)),new SchemaEnv({schema:l,schemaId:m,root:u,baseId:h})}return getJsonPointer.call(this,m,w)}}l.SchemaEnv=SchemaEnv,l.compileSchema=compileSchema,l.resolveRef=function resolveRef(u,l,m){var f;m=(0,v.resolveUrl)(this.opts.uriResolver,l,m);const h=u.refs[m];if(h)return h;let y=resolve.call(this,u,m);if(void 0===y){const h=null===(f=u.localRefs)||void 0===f?void 0:f[m],{schemaId:v}=this.opts;h&&(y=new SchemaEnv({schema:h,schemaId:v,root:u,baseId:l}))}return void 0!==y?u.refs[m]=inlineOrCompile.call(this,y):void 0},l.getCompilingSchema=getCompilingSchema,l.resolveSchema=resolveSchema;const S=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function getJsonPointer(u,{baseId:l,schema:m,root:f}){var h;if("/"!==(null===(h=u.fragment)||void 0===h?void 0:h[0]))return;for(const f of u.fragment.slice(1).split("/")){if("boolean"==typeof m)return;const u=m[(0,w.unescapeFragment)(f)];if(void 0===u)return;const h="object"==typeof(m=u)&&m[this.opts.schemaId];!S.has(f)&&h&&(l=(0,v.resolveUrl)(this.opts.uriResolver,l,h))}let y;if("boolean"!=typeof m&&m.$ref&&!(0,w.schemaHasRulesButRef)(m,this.RULES)){const u=(0,v.resolveUrl)(this.opts.uriResolver,l,m.$ref);y=resolveSchema.call(this,f,u)}const{schemaId:b}=this.opts;return y=y||new SchemaEnv({schema:m,schemaId:b,root:f,baseId:l}),y.schema!==y.root.schema?y:void 0}},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/names.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h={data:new f.Name("data"),valCxt:new f.Name("valCxt"),instancePath:new f.Name("instancePath"),parentData:new f.Name("parentData"),parentDataProperty:new f.Name("parentDataProperty"),rootData:new f.Name("rootData"),dynamicAnchors:new f.Name("dynamicAnchors"),vErrors:new f.Name("vErrors"),errors:new f.Name("errors"),this:new f.Name("this"),self:new f.Name("self"),scope:new f.Name("scope"),json:new f.Name("json"),jsonPos:new f.Name("jsonPos"),jsonLen:new f.Name("jsonLen"),jsonPart:new f.Name("jsonPart")};l.default=h},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/ref_error.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/resolve.js");class MissingRefError extends Error{constructor(u,l,m,h){super(h||`can't resolve reference ${m} from id ${l}`),this.missingRef=(0,f.resolveUrl)(u,l,m),this.missingSchema=(0,f.normalizeId)((0,f.getFullPath)(u,this.missingRef))}}l.default=MissingRefError},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/resolve.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.getSchemaRefs=l.resolveUrl=l.normalizeId=l._getFullPath=l.getFullPath=l.inlineRef=void 0;const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),h=m("./node_modules/fast-deep-equal/index.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/json-schema-traverse/index.js"),v=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);l.inlineRef=function inlineRef(u,l=!0){return"boolean"==typeof u||(!0===l?!hasRef(u):!!l&&countKeys(u)<=l)};const w=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function hasRef(u){for(const l in u){if(w.has(l))return!0;const m=u[l];if(Array.isArray(m)&&m.some(hasRef))return!0;if("object"==typeof m&&hasRef(m))return!0}return!1}function countKeys(u){let l=0;for(const m in u){if("$ref"===m)return 1/0;if(l++,!v.has(m)&&("object"==typeof u[m]&&(0,f.eachItem)(u[m],u=>l+=countKeys(u)),l===1/0))return 1/0}return l}function getFullPath(u,l="",m){!1!==m&&(l=normalizeId(l));const f=u.parse(l);return _getFullPath(u,f)}function _getFullPath(u,l){return u.serialize(l).split("#")[0]+"#"}l.getFullPath=getFullPath,l._getFullPath=_getFullPath;const b=/#\/?$/;function normalizeId(u){return u?u.replace(b,""):""}l.normalizeId=normalizeId,l.resolveUrl=function resolveUrl(u,l,m){return m=normalizeId(m),u.resolve(l,m)};const S=/^[a-z_][-a-z0-9._]*$/i;l.getSchemaRefs=function getSchemaRefs(u,l){if("boolean"==typeof u)return{};const{schemaId:m,uriResolver:f}=this.opts,v=normalizeId(u[m]||l),w={"":v},b=getFullPath(f,v,!1),$={},x=new Set;return y(u,{allKeys:!0},(u,l,f,h)=>{if(void 0===h)return;const y=b+l;let v=w[h];function addRef(l){const m=this.opts.uriResolver.resolve;if(l=normalizeId(v?m(v,l):l),x.has(l))throw ambiguos(l);x.add(l);let f=this.refs[l];return"string"==typeof f&&(f=this.refs[f]),"object"==typeof f?checkAmbiguosRef(u,f.schema,l):l!==normalizeId(y)&&("#"===l[0]?(checkAmbiguosRef(u,$[l],l),$[l]=u):this.refs[l]=y),l}function addAnchor(u){if("string"==typeof u){if(!S.test(u))throw new Error(`invalid anchor "${u}"`);addRef.call(this,`#${u}`)}}"string"==typeof u[m]&&(v=addRef.call(this,u[m])),addAnchor.call(this,u.$anchor),addAnchor.call(this,u.$dynamicAnchor),w[l]=v}),$;function checkAmbiguosRef(u,l,m){if(void 0!==l&&!h(u,l))throw ambiguos(m)}function ambiguos(u){return new Error(`reference "${u}" resolves to more than one schema`)}}},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/rules.js":function(u,l){Object.defineProperty(l,"__esModule",{value:!0}),l.getRules=l.isJSONType=void 0;const m=new Set(["string","number","integer","boolean","null","object","array"]);l.isJSONType=function isJSONType(u){return"string"==typeof u&&m.has(u)},l.getRules=function getRules(){const u={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...u,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},u.number,u.string,u.array,u.object],post:{rules:[]},all:{},keywords:{}}}},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.checkStrictMode=l.getErrorPath=l.Type=l.useFunc=l.setEvaluated=l.evaluatedPropsToName=l.mergeEvaluated=l.eachItem=l.unescapeJsonPointer=l.escapeJsonPointer=l.escapeFragment=l.unescapeFragment=l.schemaRefOrVal=l.schemaHasRulesButRef=l.schemaHasRules=l.checkUnknownRules=l.alwaysValidSchema=l.toHash=void 0;const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/code.js");function checkUnknownRules(u,l=u.schema){const{opts:m,self:f}=u;if(!m.strictSchema)return;if("boolean"==typeof l)return;const h=f.RULES.keywords;for(const m in l)h[m]||checkStrictMode(u,`unknown keyword: "${m}"`)}function schemaHasRules(u,l){if("boolean"==typeof u)return!u;for(const m in u)if(l[m])return!0;return!1}function escapeJsonPointer(u){return"number"==typeof u?`${u}`:u.replace(/~/g,"~0").replace(/\//g,"~1")}function unescapeJsonPointer(u){return u.replace(/~1/g,"/").replace(/~0/g,"~")}function makeMergeEvaluated({mergeNames:u,mergeToName:l,mergeValues:m,resultToName:h}){return(y,v,w,b)=>{const S=void 0===w?v:w instanceof f.Name?(v instanceof f.Name?u(y,v,w):l(y,v,w),w):v instanceof f.Name?(l(y,w,v),v):m(v,w);return b!==f.Name||S instanceof f.Name?S:h(y,S)}}function evaluatedPropsToName(u,l){if(!0===l)return u.var("props",!0);const m=u.var("props",f._`{}`);return void 0!==l&&setEvaluated(u,m,l),m}function setEvaluated(u,l,m){Object.keys(m).forEach(m=>u.assign(f._`${l}${(0,f.getProperty)(m)}`,!0))}l.toHash=function toHash(u){const l={};for(const m of u)l[m]=!0;return l},l.alwaysValidSchema=function alwaysValidSchema(u,l){return"boolean"==typeof l?l:0===Object.keys(l).length||(checkUnknownRules(u,l),!schemaHasRules(l,u.self.RULES.all))},l.checkUnknownRules=checkUnknownRules,l.schemaHasRules=schemaHasRules,l.schemaHasRulesButRef=function schemaHasRulesButRef(u,l){if("boolean"==typeof u)return!u;for(const m in u)if("$ref"!==m&&l.all[m])return!0;return!1},l.schemaRefOrVal=function schemaRefOrVal({topSchemaRef:u,schemaPath:l},m,h,y){if(!y){if("number"==typeof m||"boolean"==typeof m)return m;if("string"==typeof m)return f._`${m}`}return f._`${u}${l}${(0,f.getProperty)(h)}`},l.unescapeFragment=function unescapeFragment(u){return unescapeJsonPointer(decodeURIComponent(u))},l.escapeFragment=function escapeFragment(u){return encodeURIComponent(escapeJsonPointer(u))},l.escapeJsonPointer=escapeJsonPointer,l.unescapeJsonPointer=unescapeJsonPointer,l.eachItem=function eachItem(u,l){if(Array.isArray(u))for(const m of u)l(m);else l(u)},l.mergeEvaluated={props:makeMergeEvaluated({mergeNames:(u,l,m)=>u.if(f._`${m} !== true && ${l} !== undefined`,()=>{u.if(f._`${l} === true`,()=>u.assign(m,!0),()=>u.assign(m,f._`${m} || {}`).code(f._`Object.assign(${m}, ${l})`))}),mergeToName:(u,l,m)=>u.if(f._`${m} !== true`,()=>{!0===l?u.assign(m,!0):(u.assign(m,f._`${m} || {}`),setEvaluated(u,m,l))}),mergeValues:(u,l)=>!0===u||{...u,...l},resultToName:evaluatedPropsToName}),items:makeMergeEvaluated({mergeNames:(u,l,m)=>u.if(f._`${m} !== true && ${l} !== undefined`,()=>u.assign(m,f._`${l} === true ? true : ${m} > ${l} ? ${m} : ${l}`)),mergeToName:(u,l,m)=>u.if(f._`${m} !== true`,()=>u.assign(m,!0===l||f._`${m} > ${l} ? ${m} : ${l}`)),mergeValues:(u,l)=>!0===u||Math.max(u,l),resultToName:(u,l)=>u.var("items",l)})},l.evaluatedPropsToName=evaluatedPropsToName,l.setEvaluated=setEvaluated;const y={};var v;function checkStrictMode(u,l,m=u.opts.strictSchema){if(m){if(l=`strict mode: ${l}`,!0===m)throw new Error(l);u.self.logger.warn(l)}}l.useFunc=function useFunc(u,l){return u.scopeValue("func",{ref:l,code:y[l.code]||(y[l.code]=new h._Code(l.code))})},function(u){u[u.Num=0]="Num",u[u.Str=1]="Str"}(v||(l.Type=v={})),l.getErrorPath=function getErrorPath(u,l,m){if(u instanceof f.Name){const h=l===v.Num;return m?h?f._`"[" + ${u} + "]"`:f._`"['" + ${u} + "']"`:h?f._`"/" + ${u}`:f._`"/" + ${u}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return m?(0,f.getProperty)(u).toString():"/"+escapeJsonPointer(u)},l.checkStrictMode=checkStrictMode},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/applicability.js":function(u,l){function shouldUseGroup(u,l){return l.rules.some(l=>shouldUseRule(u,l))}function shouldUseRule(u,l){var m;return void 0!==u[l.keyword]||(null===(m=l.definition.implements)||void 0===m?void 0:m.some(l=>void 0!==u[l]))}Object.defineProperty(l,"__esModule",{value:!0}),l.shouldUseRule=l.shouldUseGroup=l.schemaHasRulesForType=void 0,l.schemaHasRulesForType=function schemaHasRulesForType({schema:u,self:l},m){const f=l.RULES.types[m];return f&&!0!==f&&shouldUseGroup(u,f)},l.shouldUseGroup=shouldUseGroup,l.shouldUseRule=shouldUseRule},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/boolSchema.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.boolOrEmptySchema=l.topBoolOrEmptySchema=void 0;const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/errors.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/names.js"),v={message:"boolean schema is false"};function falseSchemaError(u,l){const{gen:m,data:h}=u,y={gen:m,keyword:"false schema",data:h,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:u};(0,f.reportError)(y,v,void 0,l)}l.topBoolOrEmptySchema=function topBoolOrEmptySchema(u){const{gen:l,schema:m,validateName:f}=u;!1===m?falseSchemaError(u,!1):"object"==typeof m&&!0===m.$async?l.return(y.default.data):(l.assign(h._`${f}.errors`,null),l.return(!0))},l.boolOrEmptySchema=function boolOrEmptySchema(u,l){const{gen:m,schema:f}=u;!1===f?(m.var(l,!1),falseSchemaError(u)):m.var(l,!0)}},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/dataType.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.reportTypeError=l.checkDataTypes=l.checkDataType=l.coerceAndCheckDataType=l.getJSONTypes=l.getSchemaTypes=l.DataType=void 0;const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/rules.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/applicability.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/errors.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),w=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");var b;function getJSONTypes(u){const l=Array.isArray(u)?u:u?[u]:[];if(l.every(f.isJSONType))return l;throw new Error("type must be JSONType or JSONType[]: "+l.join(","))}!function(u){u[u.Correct=0]="Correct",u[u.Wrong=1]="Wrong"}(b||(l.DataType=b={})),l.getSchemaTypes=function getSchemaTypes(u){const l=getJSONTypes(u.type);if(l.includes("null")){if(!1===u.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!l.length&&void 0!==u.nullable)throw new Error('"nullable" cannot be used without "type"');!0===u.nullable&&l.push("null")}return l},l.getJSONTypes=getJSONTypes,l.coerceAndCheckDataType=function coerceAndCheckDataType(u,l){const{gen:m,data:f,opts:y}=u,w=function coerceToTypes(u,l){return l?u.filter(u=>S.has(u)||"array"===l&&"array"===u):[]}(l,y.coerceTypes),$=l.length>0&&!(0===w.length&&1===l.length&&(0,h.schemaHasRulesForType)(u,l[0]));if($){const h=checkDataTypes(l,f,y.strictNumbers,b.Wrong);m.if(h,()=>{w.length?function coerceData(u,l,m){const{gen:f,data:h,opts:y}=u,w=f.let("dataType",v._`typeof ${h}`),b=f.let("coerced",v._`undefined`);"array"===y.coerceTypes&&f.if(v._`${w} == 'object' && Array.isArray(${h}) && ${h}.length == 1`,()=>f.assign(h,v._`${h}[0]`).assign(w,v._`typeof ${h}`).if(checkDataTypes(l,h,y.strictNumbers),()=>f.assign(b,h)));f.if(v._`${b} !== undefined`);for(const u of m)(S.has(u)||"array"===u&&"array"===y.coerceTypes)&&coerceSpecificType(u);function coerceSpecificType(u){switch(u){case"string":return void f.elseIf(v._`${w} == "number" || ${w} == "boolean"`).assign(b,v._`"" + ${h}`).elseIf(v._`${h} === null`).assign(b,v._`""`);case"number":return void f.elseIf(v._`${w} == "boolean" || ${h} === null
|| (${w} == "string" && ${h} && ${h} == +${h})`).assign(b,v._`+${h}`);case"integer":return void f.elseIf(v._`${w} === "boolean" || ${h} === null
|| (${w} === "string" && ${h} && ${h} == +${h} && !(${h} % 1))`).assign(b,v._`+${h}`);case"boolean":return void f.elseIf(v._`${h} === "false" || ${h} === 0 || ${h} === null`).assign(b,!1).elseIf(v._`${h} === "true" || ${h} === 1`).assign(b,!0);case"null":return f.elseIf(v._`${h} === "" || ${h} === 0 || ${h} === false`),void f.assign(b,null);case"array":f.elseIf(v._`${w} === "string" || ${w} === "number"
|| ${w} === "boolean" || ${h} === null`).assign(b,v._`[${h}]`)}}f.else(),reportTypeError(u),f.endIf(),f.if(v._`${b} !== undefined`,()=>{f.assign(h,b),function assignParentData({gen:u,parentData:l,parentDataProperty:m},f){u.if(v._`${l} !== undefined`,()=>u.assign(v._`${l}[${m}]`,f))}(u,b)})}(u,l,w):reportTypeError(u)})}return $};const S=new Set(["string","number","integer","boolean","null"]);function checkDataType(u,l,m,f=b.Correct){const h=f===b.Correct?v.operators.EQ:v.operators.NEQ;let y;switch(u){case"null":return v._`${l} ${h} null`;case"array":y=v._`Array.isArray(${l})`;break;case"object":y=v._`${l} && typeof ${l} == "object" && !Array.isArray(${l})`;break;case"integer":y=numCond(v._`!(${l} % 1) && !isNaN(${l})`);break;case"number":y=numCond();break;default:return v._`typeof ${l} ${h} ${u}`}return f===b.Correct?y:(0,v.not)(y);function numCond(u=v.nil){return(0,v.and)(v._`typeof ${l} == "number"`,u,m?v._`isFinite(${l})`:v.nil)}}function checkDataTypes(u,l,m,f){if(1===u.length)return checkDataType(u[0],l,m,f);let h;const y=(0,w.toHash)(u);if(y.array&&y.object){const u=v._`typeof ${l} != "object"`;h=y.null?u:v._`!${l} || ${u}`,delete y.null,delete y.array,delete y.object}else h=v.nil;y.number&&delete y.integer;for(const u in y)h=(0,v.and)(h,checkDataType(u,l,m,f));return h}l.checkDataType=checkDataType,l.checkDataTypes=checkDataTypes;const $={message:({schema:u})=>`must be ${u}`,params:({schema:u,schemaValue:l})=>"string"==typeof u?v._`{type: ${u}}`:v._`{type: ${l}}`};function reportTypeError(u){const l=function getTypeErrorContext(u){const{gen:l,data:m,schema:f}=u,h=(0,w.schemaRefOrVal)(u,f,"type");return{gen:l,keyword:"type",data:m,schema:f.type,schemaCode:h,schemaValue:h,parentSchema:f,params:{},it:u}}(u);(0,y.reportError)(l,$)}l.reportTypeError=reportTypeError},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/defaults.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.assignDefaults=void 0;const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");function assignDefault(u,l,m){const{gen:y,compositeRule:v,data:w,opts:b}=u;if(void 0===m)return;const S=f._`${w}${(0,f.getProperty)(l)}`;if(v)return void(0,h.checkStrictMode)(u,`default is ignored for: ${S}`);let $=f._`${S} === undefined`;"empty"===b.useDefaults&&($=f._`${$} || ${S} === null || ${S} === ""`),y.if($,f._`${S} = ${(0,f.stringify)(m)}`)}l.assignDefaults=function assignDefaults(u,l){const{properties:m,items:f}=u.schema;if("object"===l&&m)for(const l in m)assignDefault(u,l,m[l].default);else"array"===l&&Array.isArray(f)&&f.forEach((l,m)=>assignDefault(u,m,l.default))}},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/index.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.getData=l.KeywordCxt=l.validateFunctionCode=void 0;const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/boolSchema.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/dataType.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/applicability.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/dataType.js"),w=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/defaults.js"),b=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/keyword.js"),S=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/subschema.js"),$=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),x=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/names.js"),j=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/resolve.js"),E=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),R=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/errors.js");function validateFunction({gen:u,validateName:l,schema:m,schemaEnv:f,opts:h},y){h.code.es5?u.func(l,$._`${x.default.data}, ${x.default.valCxt}`,f.$async,()=>{u.code($._`"use strict"; ${funcSourceUrl(m,h)}`),function destructureValCxtES5(u,l){u.if(x.default.valCxt,()=>{u.var(x.default.instancePath,$._`${x.default.valCxt}.${x.default.instancePath}`),u.var(x.default.parentData,$._`${x.default.valCxt}.${x.default.parentData}`),u.var(x.default.parentDataProperty,$._`${x.default.valCxt}.${x.default.parentDataProperty}`),u.var(x.default.rootData,$._`${x.default.valCxt}.${x.default.rootData}`),l.dynamicRef&&u.var(x.default.dynamicAnchors,$._`${x.default.valCxt}.${x.default.dynamicAnchors}`)},()=>{u.var(x.default.instancePath,$._`""`),u.var(x.default.parentData,$._`undefined`),u.var(x.default.parentDataProperty,$._`undefined`),u.var(x.default.rootData,x.default.data),l.dynamicRef&&u.var(x.default.dynamicAnchors,$._`{}`)})}(u,h),u.code(y)}):u.func(l,$._`${x.default.data}, ${function destructureValCxt(u){return $._`{${x.default.instancePath}="", ${x.default.parentData}, ${x.default.parentDataProperty}, ${x.default.rootData}=${x.default.data}${u.dynamicRef?$._`, ${x.default.dynamicAnchors}={}`:$.nil}}={}`}(h)}`,f.$async,()=>u.code(funcSourceUrl(m,h)).code(y))}function funcSourceUrl(u,l){const m="object"==typeof u&&u[l.schemaId];return m&&(l.code.source||l.code.process)?$._`/*# sourceURL=${m} */`:$.nil}function subschemaCode(u,l){isSchemaObj(u)&&(checkKeywords(u),schemaCxtHasRules(u))?function subSchemaObjCode(u,l){const{schema:m,gen:f,opts:h}=u;h.$comment&&m.$comment&&commentKeyword(u);(function updateContext(u){const l=u.schema[u.opts.schemaId];l&&(u.baseId=(0,j.resolveUrl)(u.opts.uriResolver,u.baseId,l))})(u),function checkAsyncSchema(u){if(u.schema.$async&&!u.schemaEnv.$async)throw new Error("async schema in sync schema")}(u);const y=f.const("_errs",x.default.errors);typeAndKeywords(u,y),f.var(l,$._`${y} === ${x.default.errors}`)}(u,l):(0,f.boolOrEmptySchema)(u,l)}function schemaCxtHasRules({schema:u,self:l}){if("boolean"==typeof u)return!u;for(const m in u)if(l.RULES.all[m])return!0;return!1}function isSchemaObj(u){return"boolean"!=typeof u.schema}function checkKeywords(u){(0,E.checkUnknownRules)(u),function checkRefsAndKeywords(u){const{schema:l,errSchemaPath:m,opts:f,self:h}=u;l.$ref&&f.ignoreKeywordsWithRef&&(0,E.schemaHasRulesButRef)(l,h.RULES)&&h.logger.warn(`$ref: keywords ignored in schema at path "${m}"`)}(u)}function typeAndKeywords(u,l){if(u.opts.jtd)return schemaKeywords(u,[],!1,l);const m=(0,h.getSchemaTypes)(u.schema);schemaKeywords(u,m,!(0,h.coerceAndCheckDataType)(u,m),l)}function commentKeyword({gen:u,schemaEnv:l,schema:m,errSchemaPath:f,opts:h}){const y=m.$comment;if(!0===h.$comment)u.code($._`${x.default.self}.logger.log(${y})`);else if("function"==typeof h.$comment){const m=$.str`${f}/$comment`,h=u.scopeValue("root",{ref:l.root});u.code($._`${x.default.self}.opts.$comment(${y}, ${m}, ${h}.schema)`)}}function schemaKeywords(u,l,m,f){const{gen:h,schema:w,data:b,allErrors:S,opts:j,self:R}=u,{RULES:C}=R;function groupKeywords(E){(0,y.shouldUseGroup)(w,E)&&(E.type?(h.if((0,v.checkDataType)(E.type,b,j.strictNumbers)),iterateKeywords(u,E),1===l.length&&l[0]===E.type&&m&&(h.else(),(0,v.reportTypeError)(u)),h.endIf()):iterateKeywords(u,E),S||h.if($._`${x.default.errors} === ${f||0}`))}!w.$ref||!j.ignoreKeywordsWithRef&&(0,E.schemaHasRulesButRef)(w,C)?(j.jtd||function checkStrictTypes(u,l){if(u.schemaEnv.meta||!u.opts.strictTypes)return;(function checkContextTypes(u,l){if(!l.length)return;if(!u.dataTypes.length)return void(u.dataTypes=l);l.forEach(l=>{includesType(u.dataTypes,l)||strictTypesError(u,`type "${l}" not allowed by context "${u.dataTypes.join(",")}"`)}),function narrowSchemaTypes(u,l){const m=[];for(const f of u.dataTypes)includesType(l,f)?m.push(f):l.includes("integer")&&"number"===f&&m.push("integer");u.dataTypes=m}(u,l)})(u,l),u.opts.allowUnionTypes||function checkMultipleTypes(u,l){l.length>1&&(2!==l.length||!l.includes("null"))&&strictTypesError(u,"use allowUnionTypes to allow union type keyword")}(u,l);!function checkKeywordTypes(u,l){const m=u.self.RULES.all;for(const f in m){const h=m[f];if("object"==typeof h&&(0,y.shouldUseRule)(u.schema,h)){const{type:m}=h.definition;m.length&&!m.some(u=>hasApplicableType(l,u))&&strictTypesError(u,`missing type "${m.join(",")}" for keyword "${f}"`)}}}(u,u.dataTypes)}(u,l),h.block(()=>{for(const u of C.rules)groupKeywords(u);groupKeywords(C.post)})):h.block(()=>keywordCode(u,"$ref",C.all.$ref.definition))}function iterateKeywords(u,l){const{gen:m,schema:f,opts:{useDefaults:h}}=u;h&&(0,w.assignDefaults)(u,l.type),m.block(()=>{for(const m of l.rules)(0,y.shouldUseRule)(f,m)&&keywordCode(u,m.keyword,m.definition,l.type)})}function hasApplicableType(u,l){return u.includes(l)||"number"===l&&u.includes("integer")}function includesType(u,l){return u.includes(l)||"integer"===l&&u.includes("number")}function strictTypesError(u,l){l+=` at "${u.schemaEnv.baseId+u.errSchemaPath}" (strictTypes)`,(0,E.checkStrictMode)(u,l,u.opts.strictTypes)}l.validateFunctionCode=function validateFunctionCode(u){isSchemaObj(u)&&(checkKeywords(u),schemaCxtHasRules(u))?function topSchemaObjCode(u){const{schema:l,opts:m,gen:f}=u;return void validateFunction(u,()=>{m.$comment&&l.$comment&&commentKeyword(u),function checkNoDefault(u){const{schema:l,opts:m}=u;void 0!==l.default&&m.useDefaults&&m.strictSchema&&(0,E.checkStrictMode)(u,"default is ignored in the schema root")}(u),f.let(x.default.vErrors,null),f.let(x.default.errors,0),m.unevaluated&&function resetEvaluated(u){const{gen:l,validateName:m}=u;u.evaluated=l.const("evaluated",$._`${m}.evaluated`),l.if($._`${u.evaluated}.dynamicProps`,()=>l.assign($._`${u.evaluated}.props`,$._`undefined`)),l.if($._`${u.evaluated}.dynamicItems`,()=>l.assign($._`${u.evaluated}.items`,$._`undefined`))}(u),typeAndKeywords(u),function returnResults(u){const{gen:l,schemaEnv:m,validateName:f,ValidationError:h,opts:y}=u;m.$async?l.if($._`${x.default.errors} === 0`,()=>l.return(x.default.data),()=>l.throw($._`new ${h}(${x.default.vErrors})`)):(l.assign($._`${f}.errors`,x.default.vErrors),y.unevaluated&&function assignEvaluated({gen:u,evaluated:l,props:m,items:f}){m instanceof $.Name&&u.assign($._`${l}.props`,m);f instanceof $.Name&&u.assign($._`${l}.items`,f)}(u),l.return($._`${x.default.errors} === 0`))}(u)})}(u):validateFunction(u,()=>(0,f.topBoolOrEmptySchema)(u))};class KeywordCxt{constructor(u,l,m){if((0,b.validateKeywordUsage)(u,l,m),this.gen=u.gen,this.allErrors=u.allErrors,this.keyword=m,this.data=u.data,this.schema=u.schema[m],this.$data=l.$data&&u.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,E.schemaRefOrVal)(u,this.schema,m,this.$data),this.schemaType=l.schemaType,this.parentSchema=u.schema,this.params={},this.it=u,this.def=l,this.$data)this.schemaCode=u.gen.const("vSchema",getData(this.$data,u));else if(this.schemaCode=this.schemaValue,!(0,b.validSchemaType)(this.schema,l.schemaType,l.allowUndefined))throw new Error(`${m} value must be ${JSON.stringify(l.schemaType)}`);("code"in l?l.trackErrors:!1!==l.errors)&&(this.errsCount=u.gen.const("_errs",x.default.errors))}result(u,l,m){this.failResult((0,$.not)(u),l,m)}failResult(u,l,m){this.gen.if(u),m?m():this.error(),l?(this.gen.else(),l(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(u,l){this.failResult((0,$.not)(u),void 0,l)}fail(u){if(void 0===u)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(u),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(u){if(!this.$data)return this.fail(u);const{schemaCode:l}=this;this.fail($._`${l} !== undefined && (${(0,$.or)(this.invalid$data(),u)})`)}error(u,l,m){if(l)return this.setParams(l),this._error(u,m),void this.setParams({});this._error(u,m)}_error(u,l){(u?R.reportExtraError:R.reportError)(this,this.def.error,l)}$dataError(){(0,R.reportError)(this,this.def.$dataError||R.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,R.resetErrorsCount)(this.gen,this.errsCount)}ok(u){this.allErrors||this.gen.if(u)}setParams(u,l){l?Object.assign(this.params,u):this.params=u}block$data(u,l,m=$.nil){this.gen.block(()=>{this.check$data(u,m),l()})}check$data(u=$.nil,l=$.nil){if(!this.$data)return;const{gen:m,schemaCode:f,schemaType:h,def:y}=this;m.if((0,$.or)($._`${f} === undefined`,l)),u!==$.nil&&m.assign(u,!0),(h.length||y.validateSchema)&&(m.elseIf(this.invalid$data()),this.$dataError(),u!==$.nil&&m.assign(u,!1)),m.else()}invalid$data(){const{gen:u,schemaCode:l,schemaType:m,def:f,it:h}=this;return(0,$.or)(function wrong$DataType(){if(m.length){if(!(l instanceof $.Name))throw new Error("ajv implementation error");const u=Array.isArray(m)?m:[m];return $._`${(0,v.checkDataTypes)(u,l,h.opts.strictNumbers,v.DataType.Wrong)}`}return $.nil}(),function invalid$DataSchema(){if(f.validateSchema){const m=u.scopeValue("validate$data",{ref:f.validateSchema});return $._`!${m}(${l})`}return $.nil}())}subschema(u,l){const m=(0,S.getSubschema)(this.it,u);(0,S.extendSubschemaData)(m,this.it,u),(0,S.extendSubschemaMode)(m,u);const f={...this.it,...m,items:void 0,props:void 0};return subschemaCode(f,l),f}mergeEvaluated(u,l){const{it:m,gen:f}=this;m.opts.unevaluated&&(!0!==m.props&&void 0!==u.props&&(m.props=E.mergeEvaluated.props(f,u.props,m.props,l)),!0!==m.items&&void 0!==u.items&&(m.items=E.mergeEvaluated.items(f,u.items,m.items,l)))}mergeValidEvaluated(u,l){const{it:m,gen:f}=this;if(m.opts.unevaluated&&(!0!==m.props||!0!==m.items))return f.if(l,()=>this.mergeEvaluated(u,$.Name)),!0}}function keywordCode(u,l,m,f){const h=new KeywordCxt(u,m,l);"code"in m?m.code(h,f):h.$data&&m.validate?(0,b.funcKeywordCode)(h,m):"macro"in m?(0,b.macroKeywordCode)(h,m):(m.compile||m.validate)&&(0,b.funcKeywordCode)(h,m)}l.KeywordCxt=KeywordCxt;const C=/^\/(?:[^~]|~0|~1)*$/,Z=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function getData(u,{dataLevel:l,dataNames:m,dataPathArr:f}){let h,y;if(""===u)return x.default.rootData;if("/"===u[0]){if(!C.test(u))throw new Error(`Invalid JSON-pointer: ${u}`);h=u,y=x.default.rootData}else{const v=Z.exec(u);if(!v)throw new Error(`Invalid JSON-pointer: ${u}`);const w=+v[1];if(h=v[2],"#"===h){if(w>=l)throw new Error(errorMsg("property/index",w));return f[l-w]}if(w>l)throw new Error(errorMsg("data",w));if(y=m[l-w],!h)return y}let v=y;const w=h.split("/");for(const u of w)u&&(y=$._`${y}${(0,$.getProperty)((0,E.unescapeJsonPointer)(u))}`,v=$._`${v} && ${y}`);return v;function errorMsg(u,m){return`Cannot access ${u} ${m} levels up, current level is ${l}`}}l.getData=getData},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/keyword.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.validateKeywordUsage=l.validSchemaType=l.funcKeywordCode=l.macroKeywordCode=void 0;const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/names.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/errors.js");function modifyData(u){const{gen:l,data:m,it:h}=u;l.if(h.parentData,()=>l.assign(m,f._`${h.parentData}[${h.parentDataProperty}]`))}function useKeyword(u,l,m){if(void 0===m)throw new Error(`keyword "${l}" failed to compile`);return u.scopeValue("keyword","function"==typeof m?{ref:m}:{ref:m,code:(0,f.stringify)(m)})}l.macroKeywordCode=function macroKeywordCode(u,l){const{gen:m,keyword:h,schema:y,parentSchema:v,it:w}=u,b=l.macro.call(w.self,y,v,w),S=useKeyword(m,h,b);!1!==w.opts.validateSchema&&w.self.validateSchema(b,!0);const $=m.name("valid");u.subschema({schema:b,schemaPath:f.nil,errSchemaPath:`${w.errSchemaPath}/${h}`,topSchemaRef:S,compositeRule:!0},$),u.pass($,()=>u.error(!0))},l.funcKeywordCode=function funcKeywordCode(u,l){var m;const{gen:w,keyword:b,schema:S,parentSchema:$,$data:x,it:j}=u;!function checkAsyncKeyword({schemaEnv:u},l){if(l.async&&!u.$async)throw new Error("async keyword in sync schema")}(j,l);const E=!x&&l.compile?l.compile.call(j.self,S,$,j):l.validate,R=useKeyword(w,b,E),C=w.let("valid");function assignValid(m=(l.async?f._`await `:f.nil)){const v=j.opts.passContext?h.default.this:h.default.self,b=!("compile"in l&&!x||!1===l.schema);w.assign(C,f._`${m}${(0,y.callValidateCode)(u,R,v,b)}`,l.modifying)}function reportErrs(u){var m;w.if((0,f.not)(null!==(m=l.valid)&&void 0!==m?m:C),u)}u.block$data(C,function validateKeyword(){if(!1===l.errors)assignValid(),l.modifying&&modifyData(u),reportErrs(()=>u.error());else{const m=l.async?function validateAsync(){const u=w.let("ruleErrs",null);return w.try(()=>assignValid(f._`await `),l=>w.assign(C,!1).if(f._`${l} instanceof ${j.ValidationError}`,()=>w.assign(u,f._`${l}.errors`),()=>w.throw(l))),u}():function validateSync(){const u=f._`${R}.errors`;return w.assign(u,null),assignValid(f.nil),u}();l.modifying&&modifyData(u),reportErrs(()=>function addErrs(u,l){const{gen:m}=u;m.if(f._`Array.isArray(${l})`,()=>{m.assign(h.default.vErrors,f._`${h.default.vErrors} === null ? ${l} : ${h.default.vErrors}.concat(${l})`).assign(h.default.errors,f._`${h.default.vErrors}.length`),(0,v.extendErrors)(u)},()=>u.error())}(u,m))}}),u.ok(null!==(m=l.valid)&&void 0!==m?m:C)},l.validSchemaType=function validSchemaType(u,l,m=!1){return!l.length||l.some(l=>"array"===l?Array.isArray(u):"object"===l?u&&"object"==typeof u&&!Array.isArray(u):typeof u==l||m&&void 0===u)},l.validateKeywordUsage=function validateKeywordUsage({schema:u,opts:l,self:m,errSchemaPath:f},h,y){if(Array.isArray(h.keyword)?!h.keyword.includes(y):h.keyword!==y)throw new Error("ajv implementation error");const v=h.dependencies;if(null==v?void 0:v.some(l=>!Object.prototype.hasOwnProperty.call(u,l)))throw new Error(`parent schema must have dependencies of ${y}: ${v.join(",")}`);if(h.validateSchema){if(!h.validateSchema(u[y])){const u=`keyword "${y}" value is invalid at path "${f}": `+m.errorsText(h.validateSchema.errors);if("log"!==l.validateSchema)throw new Error(u);m.logger.error(u)}}}},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/subschema.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.extendSubschemaMode=l.extendSubschemaData=l.getSubschema=void 0;const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");l.getSubschema=function getSubschema(u,{keyword:l,schemaProp:m,schema:y,schemaPath:v,errSchemaPath:w,topSchemaRef:b}){if(void 0!==l&&void 0!==y)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==l){const y=u.schema[l];return void 0===m?{schema:y,schemaPath:f._`${u.schemaPath}${(0,f.getProperty)(l)}`,errSchemaPath:`${u.errSchemaPath}/${l}`}:{schema:y[m],schemaPath:f._`${u.schemaPath}${(0,f.getProperty)(l)}${(0,f.getProperty)(m)}`,errSchemaPath:`${u.errSchemaPath}/${l}/${(0,h.escapeFragment)(m)}`}}if(void 0!==y){if(void 0===v||void 0===w||void 0===b)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:y,schemaPath:v,topSchemaRef:b,errSchemaPath:w}}throw new Error('either "keyword" or "schema" must be passed')},l.extendSubschemaData=function extendSubschemaData(u,l,{dataProp:m,dataPropType:y,data:v,dataTypes:w,propertyName:b}){if(void 0!==v&&void 0!==m)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:S}=l;if(void 0!==m){const{errorPath:v,dataPathArr:w,opts:b}=l;dataContextProps(S.let("data",f._`${l.data}${(0,f.getProperty)(m)}`,!0)),u.errorPath=f.str`${v}${(0,h.getErrorPath)(m,y,b.jsPropertySyntax)}`,u.parentDataProperty=f._`${m}`,u.dataPathArr=[...w,u.parentDataProperty]}if(void 0!==v){dataContextProps(v instanceof f.Name?v:S.let("data",v,!0)),void 0!==b&&(u.propertyName=b)}function dataContextProps(m){u.data=m,u.dataLevel=l.dataLevel+1,u.dataTypes=[],l.definedProperties=new Set,u.parentData=l.data,u.dataNames=[...l.dataNames,m]}w&&(u.dataTypes=w)},l.extendSubschemaMode=function extendSubschemaMode(u,{jtdDiscriminator:l,jtdMetadata:m,compositeRule:f,createErrors:h,allErrors:y}){void 0!==f&&(u.compositeRule=f),void 0!==h&&(u.createErrors=h),void 0!==y&&(u.allErrors=y),u.jtdDiscriminator=l,u.jtdMetadata=m}},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/core.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.CodeGen=l.Name=l.nil=l.stringify=l.str=l._=l.KeywordCxt=void 0;var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/index.js");Object.defineProperty(l,"KeywordCxt",{enumerable:!0,get:function(){return f.KeywordCxt}});var h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");Object.defineProperty(l,"_",{enumerable:!0,get:function(){return h._}}),Object.defineProperty(l,"str",{enumerable:!0,get:function(){return h.str}}),Object.defineProperty(l,"stringify",{enumerable:!0,get:function(){return h.stringify}}),Object.defineProperty(l,"nil",{enumerable:!0,get:function(){return h.nil}}),Object.defineProperty(l,"Name",{enumerable:!0,get:function(){return h.Name}}),Object.defineProperty(l,"CodeGen",{enumerable:!0,get:function(){return h.CodeGen}});const y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/validation_error.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/ref_error.js"),w=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/rules.js"),b=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/index.js"),S=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),$=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/resolve.js"),x=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/dataType.js"),j=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),E=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/refs/data.json"),R=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/uri.js"),defaultRegExp=(u,l)=>new RegExp(u,l);defaultRegExp.code="new RegExp";const C=["removeAdditional","useDefaults","coerceTypes"],Z=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),z={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."},A={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function requiredOptions(u){var l,m,f,h,y,v,w,b,S,$,x,j,E,C,Z,z,A,O,N,D,M,U,L,F,V;const K=u.strict,H=null===(l=u.code)||void 0===l?void 0:l.optimize,B=!0===H||void 0===H?1:H||0,J=null!==(f=null===(m=u.code)||void 0===m?void 0:m.regExp)&&void 0!==f?f:defaultRegExp,G=null!==(h=u.uriResolver)&&void 0!==h?h:R.default;return{strictSchema:null===(v=null!==(y=u.strictSchema)&&void 0!==y?y:K)||void 0===v||v,strictNumbers:null===(b=null!==(w=u.strictNumbers)&&void 0!==w?w:K)||void 0===b||b,strictTypes:null!==($=null!==(S=u.strictTypes)&&void 0!==S?S:K)&&void 0!==$?$:"log",strictTuples:null!==(j=null!==(x=u.strictTuples)&&void 0!==x?x:K)&&void 0!==j?j:"log",strictRequired:null!==(C=null!==(E=u.strictRequired)&&void 0!==E?E:K)&&void 0!==C&&C,code:u.code?{...u.code,optimize:B,regExp:J}:{optimize:B,regExp:J},loopRequired:null!==(Z=u.loopRequired)&&void 0!==Z?Z:200,loopEnum:null!==(z=u.loopEnum)&&void 0!==z?z:200,meta:null===(A=u.meta)||void 0===A||A,messages:null===(O=u.messages)||void 0===O||O,inlineRefs:null===(N=u.inlineRefs)||void 0===N||N,schemaId:null!==(D=u.schemaId)&&void 0!==D?D:"$id",addUsedSchema:null===(M=u.addUsedSchema)||void 0===M||M,validateSchema:null===(U=u.validateSchema)||void 0===U||U,validateFormats:null===(L=u.validateFormats)||void 0===L||L,unicodeRegExp:null===(F=u.unicodeRegExp)||void 0===F||F,int32range:null===(V=u.int32range)||void 0===V||V,uriResolver:G}}class Ajv{constructor(u={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,u=this.opts={...u,...requiredOptions(u)};const{es5:l,lines:m}=this.opts.code;this.scope=new S.ValueScope({scope:{},prefixes:Z,es5:l,lines:m}),this.logger=function getLogger(u){if(!1===u)return O;if(void 0===u)return console;if(u.log&&u.warn&&u.error)return u;throw new Error("logger must implement log, warn and error methods")}(u.logger);const f=u.validateFormats;u.validateFormats=!1,this.RULES=(0,w.getRules)(),checkOptions.call(this,z,u,"NOT SUPPORTED"),checkOptions.call(this,A,u,"DEPRECATED","warn"),this._metaOpts=getMetaSchemaOptions.call(this),u.formats&&addInitialFormats.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),u.keywords&&addInitialKeywords.call(this,u.keywords),"object"==typeof u.meta&&this.addMetaSchema(u.meta),addInitialSchemas.call(this),u.validateFormats=f}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:u,meta:l,schemaId:m}=this.opts;let f=E;"id"===m&&(f={...E},f.id=f.$id,delete f.$id),l&&u&&this.addMetaSchema(f,f[m],!1)}defaultMeta(){const{meta:u,schemaId:l}=this.opts;return this.opts.defaultMeta="object"==typeof u?u[l]||u:void 0}validate(u,l){let m;if("string"==typeof u){if(m=this.getSchema(u),!m)throw new Error(`no schema with key or ref "${u}"`)}else m=this.compile(u);const f=m(l);return"$async"in m||(this.errors=m.errors),f}compile(u,l){const m=this._addSchema(u,l);return m.validate||this._compileSchemaEnv(m)}compileAsync(u,l){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:m}=this.opts;return runCompileAsync.call(this,u,l);async function runCompileAsync(u,l){await loadMetaSchema.call(this,u.$schema);const m=this._addSchema(u,l);return m.validate||_compileAsync.call(this,m)}async function loadMetaSchema(u){u&&!this.getSchema(u)&&await runCompileAsync.call(this,{$ref:u},!0)}async function _compileAsync(u){try{return this._compileSchemaEnv(u)}catch(l){if(!(l instanceof v.default))throw l;return checkLoaded.call(this,l),await loadMissingSchema.call(this,l.missingSchema),_compileAsync.call(this,u)}}function checkLoaded({missingSchema:u,missingRef:l}){if(this.refs[u])throw new Error(`AnySchema ${u} is loaded but ${l} cannot be resolved`)}async function loadMissingSchema(u){const m=await _loadSchema.call(this,u);this.refs[u]||await loadMetaSchema.call(this,m.$schema),this.refs[u]||this.addSchema(m,u,l)}async function _loadSchema(u){const l=this._loading[u];if(l)return l;try{return await(this._loading[u]=m(u))}finally{delete this._loading[u]}}}addSchema(u,l,m,f=this.opts.validateSchema){if(Array.isArray(u)){for(const l of u)this.addSchema(l,void 0,m,f);return this}let h;if("object"==typeof u){const{schemaId:l}=this.opts;if(h=u[l],void 0!==h&&"string"!=typeof h)throw new Error(`schema ${l} must be string`)}return l=(0,$.normalizeId)(l||h),this._checkUnique(l),this.schemas[l]=this._addSchema(u,m,l,f,!0),this}addMetaSchema(u,l,m=this.opts.validateSchema){return this.addSchema(u,l,!0,m),this}validateSchema(u,l){if("boolean"==typeof u)return!0;let m;if(m=u.$schema,void 0!==m&&"string"!=typeof m)throw new Error("$schema must be a string");if(m=m||this.opts.defaultMeta||this.defaultMeta(),!m)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const f=this.validate(m,u);if(!f&&l){const u="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(u);this.logger.error(u)}return f}getSchema(u){let l;for(;"string"==typeof(l=getSchEnv.call(this,u));)u=l;if(void 0===l){const{schemaId:m}=this.opts,f=new b.SchemaEnv({schema:{},schemaId:m});if(l=b.resolveSchema.call(this,f,u),!l)return;this.refs[u]=l}return l.validate||this._compileSchemaEnv(l)}removeSchema(u){if(u instanceof RegExp)return this._removeAllSchemas(this.schemas,u),this._removeAllSchemas(this.refs,u),this;switch(typeof u){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const l=getSchEnv.call(this,u);return"object"==typeof l&&this._cache.delete(l.schema),delete this.schemas[u],delete this.refs[u],this}case"object":{const l=u;this._cache.delete(l);let m=u[this.opts.schemaId];return m&&(m=(0,$.normalizeId)(m),delete this.schemas[m],delete this.refs[m]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(u){for(const l of u)this.addKeyword(l);return this}addKeyword(u,l){let m;if("string"==typeof u)m=u,"object"==typeof l&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),l.keyword=m);else{if("object"!=typeof u||void 0!==l)throw new Error("invalid addKeywords parameters");if(m=(l=u).keyword,Array.isArray(m)&&!m.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(checkKeyword.call(this,m,l),!l)return(0,j.eachItem)(m,u=>addRule.call(this,u)),this;keywordMetaschema.call(this,l);const f={...l,type:(0,x.getJSONTypes)(l.type),schemaType:(0,x.getJSONTypes)(l.schemaType)};return(0,j.eachItem)(m,0===f.type.length?u=>addRule.call(this,u,f):u=>f.type.forEach(l=>addRule.call(this,u,f,l))),this}getKeyword(u){const l=this.RULES.all[u];return"object"==typeof l?l.definition:!!l}removeKeyword(u){const{RULES:l}=this;delete l.keywords[u],delete l.all[u];for(const m of l.rules){const l=m.rules.findIndex(l=>l.keyword===u);l>=0&&m.rules.splice(l,1)}return this}addFormat(u,l){return"string"==typeof l&&(l=new RegExp(l)),this.formats[u]=l,this}errorsText(u=this.errors,{separator:l=", ",dataVar:m="data"}={}){return u&&0!==u.length?u.map(u=>`${m}${u.instancePath} ${u.message}`).reduce((u,m)=>u+l+m):"No errors"}$dataMetaSchema(u,l){const m=this.RULES.all;u=JSON.parse(JSON.stringify(u));for(const f of l){const l=f.split("/").slice(1);let h=u;for(const u of l)h=h[u];for(const u in m){const l=m[u];if("object"!=typeof l)continue;const{$data:f}=l.definition,y=h[u];f&&y&&(h[u]=schemaOrData(y))}}return u}_removeAllSchemas(u,l){for(const m in u){const f=u[m];l&&!l.test(m)||("string"==typeof f?delete u[m]:f&&!f.meta&&(this._cache.delete(f.schema),delete u[m]))}}_addSchema(u,l,m,f=this.opts.validateSchema,h=this.opts.addUsedSchema){let y;const{schemaId:v}=this.opts;if("object"==typeof u)y=u[v];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof u)throw new Error("schema must be object or boolean")}let w=this._cache.get(u);if(void 0!==w)return w;m=(0,$.normalizeId)(y||m);const S=$.getSchemaRefs.call(this,u,m);return w=new b.SchemaEnv({schema:u,schemaId:v,meta:l,baseId:m,localRefs:S}),this._cache.set(w.schema,w),h&&!m.startsWith("#")&&(m&&this._checkUnique(m),this.refs[m]=w),f&&this.validateSchema(u,!0),w}_checkUnique(u){if(this.schemas[u]||this.refs[u])throw new Error(`schema with key or id "${u}" already exists`)}_compileSchemaEnv(u){if(u.meta?this._compileMetaSchema(u):b.compileSchema.call(this,u),!u.validate)throw new Error("ajv implementation error");return u.validate}_compileMetaSchema(u){const l=this.opts;this.opts=this._metaOpts;try{b.compileSchema.call(this,u)}finally{this.opts=l}}}function checkOptions(u,l,m,f="error"){for(const h in u){const y=h;y in l&&this.logger[f](`${m}: option ${h}. ${u[y]}`)}}function getSchEnv(u){return u=(0,$.normalizeId)(u),this.schemas[u]||this.refs[u]}function addInitialSchemas(){const u=this.opts.schemas;if(u)if(Array.isArray(u))this.addSchema(u);else for(const l in u)this.addSchema(u[l],l)}function addInitialFormats(){for(const u in this.opts.formats){const l=this.opts.formats[u];l&&this.addFormat(u,l)}}function addInitialKeywords(u){if(Array.isArray(u))this.addVocabulary(u);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const l in u){const m=u[l];m.keyword||(m.keyword=l),this.addKeyword(m)}}}function getMetaSchemaOptions(){const u={...this.opts};for(const l of C)delete u[l];return u}Ajv.ValidationError=y.default,Ajv.MissingRefError=v.default,l.default=Ajv;const O={log(){},warn(){},error(){}};const N=/^[a-z_$][a-z0-9_$:-]*$/i;function checkKeyword(u,l){const{RULES:m}=this;if((0,j.eachItem)(u,u=>{if(m.keywords[u])throw new Error(`Keyword ${u} is already defined`);if(!N.test(u))throw new Error(`Keyword ${u} has invalid name`)}),l&&l.$data&&!("code"in l)&&!("validate"in l))throw new Error('$data keyword must have "code" or "validate" function')}function addRule(u,l,m){var f;const h=null==l?void 0:l.post;if(m&&h)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:y}=this;let v=h?y.post:y.rules.find(({type:u})=>u===m);if(v||(v={type:m,rules:[]},y.rules.push(v)),y.keywords[u]=!0,!l)return;const w={keyword:u,definition:{...l,type:(0,x.getJSONTypes)(l.type),schemaType:(0,x.getJSONTypes)(l.schemaType)}};l.before?addBeforeRule.call(this,v,w,l.before):v.rules.push(w),y.all[u]=w,null===(f=l.implements)||void 0===f||f.forEach(u=>this.addKeyword(u))}function addBeforeRule(u,l,m){const f=u.rules.findIndex(u=>u.keyword===m);f>=0?u.rules.splice(f,0,l):(u.rules.push(l),this.logger.warn(`rule ${m} is not defined`))}function keywordMetaschema(u){let{metaSchema:l}=u;void 0!==l&&(u.$data&&this.opts.$data&&(l=schemaOrData(l)),u.validateSchema=this.compile(l,!0))}const D={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function schemaOrData(u){return{anyOf:[u,D]}}},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/refs/data.json":function(u){u.exports=JSON.parse('{"$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":false}')},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/refs/json-schema-draft-07.json":function(u){u.exports=JSON.parse('{"$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":true,"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":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"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":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"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":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"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":true}')},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/equal.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/fast-deep-equal/index.js");f.code='require("ajv/dist/runtime/equal").default',l.default=f},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/ucs2length.js":function(u,l){function ucs2length(u){const l=u.length;let m,f=0,h=0;for(;h<l;)f++,m=u.charCodeAt(h++),m>=55296&&m<=56319&&h<l&&(m=u.charCodeAt(h),56320==(64512&m)&&h++);return f}Object.defineProperty(l,"__esModule",{value:!0}),l.default=ucs2length,ucs2length.code='require("ajv/dist/runtime/ucs2length").default'},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/uri.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/fast-uri/index.js");f.code='require("ajv/dist/runtime/uri").default',l.default=f},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/validation_error.js":function(u,l){Object.defineProperty(l,"__esModule",{value:!0});class ValidationError extends Error{constructor(u){super("validation failed"),this.errors=u,this.ajv=this.validation=!0}}l.default=ValidationError},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.validateAdditionalItems=void 0;const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),y={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:u}})=>f.str`must NOT have more than ${u} items`,params:({params:{len:u}})=>f._`{limit: ${u}}`},code(u){const{parentSchema:l,it:m}=u,{items:f}=l;Array.isArray(f)?validateAdditionalItems(u,f):(0,h.checkStrictMode)(m,'"additionalItems" is ignored when "items" is not an array of schemas')}};function validateAdditionalItems(u,l){const{gen:m,schema:y,data:v,keyword:w,it:b}=u;b.items=!0;const S=m.const("len",f._`${v}.length`);if(!1===y)u.setParams({len:l.length}),u.pass(f._`${S} <= ${l.length}`);else if("object"==typeof y&&!(0,h.alwaysValidSchema)(b,y)){const y=m.var("valid",f._`${S} <= ${l.length}`);m.if((0,f.not)(y),()=>function validateItems(y){m.forRange("i",l.length,S,l=>{u.subschema({keyword:w,dataProp:l,dataPropType:h.Type.Num},y),b.allErrors||m.if((0,f.not)(y),()=>m.break())})}(y)),u.ok(y)}}l.validateAdditionalItems=validateAdditionalItems,l.default=y},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/names.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),w={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:u})=>h._`{additionalProperty: ${u.additionalProperty}}`},code(u){const{gen:l,schema:m,parentSchema:w,data:b,errsCount:S,it:$}=u;if(!S)throw new Error("ajv implementation error");const{allErrors:x,opts:j}=$;if($.props=!0,"all"!==j.removeAdditional&&(0,v.alwaysValidSchema)($,m))return;const E=(0,f.allSchemaProperties)(w.properties),R=(0,f.allSchemaProperties)(w.patternProperties);function deleteAdditional(u){l.code(h._`delete ${b}[${u}]`)}function additionalPropertyCode(f){if("all"===j.removeAdditional||j.removeAdditional&&!1===m)deleteAdditional(f);else{if(!1===m)return u.setParams({additionalProperty:f}),u.error(),void(x||l.break());if("object"==typeof m&&!(0,v.alwaysValidSchema)($,m)){const m=l.name("valid");"failing"===j.removeAdditional?(applyAdditionalSchema(f,m,!1),l.if((0,h.not)(m),()=>{u.reset(),deleteAdditional(f)})):(applyAdditionalSchema(f,m),x||l.if((0,h.not)(m),()=>l.break()))}}}function applyAdditionalSchema(l,m,f){const h={keyword:"additionalProperties",dataProp:l,dataPropType:v.Type.Str};!1===f&&Object.assign(h,{compositeRule:!0,createErrors:!1,allErrors:!1}),u.subschema(h,m)}!function checkAdditionalProperties(){l.forIn("key",b,m=>{E.length||R.length?l.if(function isAdditional(m){let y;if(E.length>8){const u=(0,v.schemaRefOrVal)($,w.properties,"properties");y=(0,f.isOwnProperty)(l,u,m)}else y=E.length?(0,h.or)(...E.map(u=>h._`${m} === ${u}`)):h.nil;R.length&&(y=(0,h.or)(y,...R.map(l=>h._`${(0,f.usePattern)(u,l)}.test(${m})`)));return(0,h.not)(y)}(m),()=>additionalPropertyCode(m)):additionalPropertyCode(m)})}(),u.ok(h._`${S} === ${y.default.errors}`)}};l.default=w},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/allOf.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),h={keyword:"allOf",schemaType:"array",code(u){const{gen:l,schema:m,it:h}=u;if(!Array.isArray(m))throw new Error("ajv implementation error");const y=l.name("valid");m.forEach((l,m)=>{if((0,f.alwaysValidSchema)(h,l))return;const v=u.subschema({keyword:"allOf",schemaProp:m},y);u.ok(y),u.mergeEvaluated(v)})}};l.default=h},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/anyOf.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js").validateUnion,error:{message:"must match a schema in anyOf"}};l.default=f},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/contains.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),y={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:u,max:l}})=>void 0===l?f.str`must contain at least ${u} valid item(s)`:f.str`must contain at least ${u} and no more than ${l} valid item(s)`,params:({params:{min:u,max:l}})=>void 0===l?f._`{minContains: ${u}}`:f._`{minContains: ${u}, maxContains: ${l}}`},code(u){const{gen:l,schema:m,parentSchema:y,data:v,it:w}=u;let b,S;const{minContains:$,maxContains:x}=y;w.opts.next?(b=void 0===$?1:$,S=x):b=1;const j=l.const("len",f._`${v}.length`);if(u.setParams({min:b,max:S}),void 0===S&&0===b)return void(0,h.checkStrictMode)(w,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==S&&b>S)return(0,h.checkStrictMode)(w,'"minContains" > "maxContains" is always invalid'),void u.fail();if((0,h.alwaysValidSchema)(w,m)){let l=f._`${j} >= ${b}`;return void 0!==S&&(l=f._`${l} && ${j} <= ${S}`),void u.pass(l)}w.items=!0;const E=l.name("valid");function validateItemsWithCount(){const u=l.name("_valid"),m=l.let("count",0);validateItems(u,()=>l.if(u,()=>function checkLimits(u){l.code(f._`${u}++`),void 0===S?l.if(f._`${u} >= ${b}`,()=>l.assign(E,!0).break()):(l.if(f._`${u} > ${S}`,()=>l.assign(E,!1).break()),1===b?l.assign(E,!0):l.if(f._`${u} >= ${b}`,()=>l.assign(E,!0)))}(m)))}function validateItems(m,f){l.forRange("i",0,j,l=>{u.subschema({keyword:"contains",dataProp:l,dataPropType:h.Type.Num,compositeRule:!0},m),f()})}void 0===S&&1===b?validateItems(E,()=>l.if(E,()=>l.break())):0===b?(l.let(E,!0),void 0!==S&&l.if(f._`${v}.length > 0`,validateItemsWithCount)):(l.let(E,!1),validateItemsWithCount()),u.result(E,()=>u.reset())}};l.default=y},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/dependencies.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.validateSchemaDeps=l.validatePropertyDeps=l.error=void 0;const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js");l.error={message:({params:{property:u,depsCount:l,deps:m}})=>{const h=1===l?"property":"properties";return f.str`must have ${h} ${m} when property ${u} is present`},params:({params:{property:u,depsCount:l,deps:m,missingProperty:h}})=>f._`{property: ${u},
missingProperty: ${h},
depsCount: ${l},
deps: ${m}}`};const v={keyword:"dependencies",type:"object",schemaType:"object",error:l.error,code(u){const[l,m]=function splitDependencies({schema:u}){const l={},m={};for(const f in u){if("__proto__"===f)continue;(Array.isArray(u[f])?l:m)[f]=u[f]}return[l,m]}(u);validatePropertyDeps(u,l),validateSchemaDeps(u,m)}};function validatePropertyDeps(u,l=u.schema){const{gen:m,data:h,it:v}=u;if(0===Object.keys(l).length)return;const w=m.let("missing");for(const b in l){const S=l[b];if(0===S.length)continue;const $=(0,y.propertyInData)(m,h,b,v.opts.ownProperties);u.setParams({property:b,depsCount:S.length,deps:S.join(", ")}),v.allErrors?m.if($,()=>{for(const l of S)(0,y.checkReportMissingProp)(u,l)}):(m.if(f._`${$} && (${(0,y.checkMissingProp)(u,S,w)})`),(0,y.reportMissingProp)(u,w),m.else())}}function validateSchemaDeps(u,l=u.schema){const{gen:m,data:f,keyword:v,it:w}=u,b=m.name("valid");for(const S in l)(0,h.alwaysValidSchema)(w,l[S])||(m.if((0,y.propertyInData)(m,f,S,w.opts.ownProperties),()=>{const l=u.subschema({keyword:v,schemaProp:S},b);u.mergeValidEvaluated(l,b)},()=>m.var(b,!0)),u.ok(b))}l.validatePropertyDeps=validatePropertyDeps,l.validateSchemaDeps=validateSchemaDeps,l.default=v},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/if.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),y={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:u})=>f.str`must match "${u.ifClause}" schema`,params:({params:u})=>f._`{failingKeyword: ${u.ifClause}}`},code(u){const{gen:l,parentSchema:m,it:y}=u;void 0===m.then&&void 0===m.else&&(0,h.checkStrictMode)(y,'"if" without "then" and "else" is ignored');const v=hasSchema(y,"then"),w=hasSchema(y,"else");if(!v&&!w)return;const b=l.let("valid",!0),S=l.name("_valid");if(function validateIf(){const l=u.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},S);u.mergeEvaluated(l)}(),u.reset(),v&&w){const m=l.let("ifClause");u.setParams({ifClause:m}),l.if(S,validateClause("then",m),validateClause("else",m))}else v?l.if(S,validateClause("then")):l.if((0,f.not)(S),validateClause("else"));function validateClause(m,h){return()=>{const y=u.subschema({keyword:m},S);l.assign(b,S),u.mergeValidEvaluated(y,b),h?l.assign(h,f._`${m}`):u.setParams({ifClause:m})}}u.pass(b,()=>u.error(!0))}};function hasSchema(u,l){const m=u.schema[l];return void 0!==m&&!(0,h.alwaysValidSchema)(u,m)}l.default=y},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/index.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/items.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/items2020.js"),w=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/contains.js"),b=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/dependencies.js"),S=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js"),$=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js"),x=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/properties.js"),j=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js"),E=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/not.js"),R=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/anyOf.js"),C=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/oneOf.js"),Z=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/allOf.js"),z=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/if.js"),A=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/thenElse.js");l.default=function getApplicator(u=!1){const l=[E.default,R.default,C.default,Z.default,z.default,A.default,S.default,$.default,b.default,x.default,j.default];return u?l.push(h.default,v.default):l.push(f.default,y.default),l.push(w.default),l}},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/items.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.validateTuple=void 0;const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js"),v={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(u){const{schema:l,it:m}=u;if(Array.isArray(l))return validateTuple(u,"additionalItems",l);m.items=!0,(0,h.alwaysValidSchema)(m,l)||u.ok((0,y.validateArray)(u))}};function validateTuple(u,l,m=u.schema){const{gen:y,parentSchema:v,data:w,keyword:b,it:S}=u;!function checkStrictTuple(u){const{opts:f,errSchemaPath:y}=S,v=m.length,w=v===u.minItems&&(v===u.maxItems||!1===u[l]);if(f.strictTuples&&!w){const u=`"${b}" is ${v}-tuple, but minItems or maxItems/${l} are not specified or different at path "${y}"`;(0,h.checkStrictMode)(S,u,f.strictTuples)}}(v),S.opts.unevaluated&&m.length&&!0!==S.items&&(S.items=h.mergeEvaluated.items(y,m.length,S.items));const $=y.name("valid"),x=y.const("len",f._`${w}.length`);m.forEach((l,m)=>{(0,h.alwaysValidSchema)(S,l)||(y.if(f._`${x} > ${m}`,()=>u.subschema({keyword:b,schemaProp:m,dataProp:m},$)),u.ok($))})}l.validateTuple=validateTuple,l.default=v},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/items2020.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js"),w={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:u}})=>f.str`must NOT have more than ${u} items`,params:({params:{len:u}})=>f._`{limit: ${u}}`},code(u){const{schema:l,parentSchema:m,it:f}=u,{prefixItems:w}=m;f.items=!0,(0,h.alwaysValidSchema)(f,l)||(w?(0,v.validateAdditionalItems)(u,w):u.ok((0,y.validateArray)(u)))}};l.default=w},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/not.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),h={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(u){const{gen:l,schema:m,it:h}=u;if((0,f.alwaysValidSchema)(h,m))return void u.fail();const y=l.name("valid");u.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},y),u.failResult(y,()=>u.reset(),()=>u.error())},error:{message:"must NOT be valid"}};l.default=h},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/oneOf.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),y={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:u})=>f._`{passingSchemas: ${u.passing}}`},code(u){const{gen:l,schema:m,parentSchema:y,it:v}=u;if(!Array.isArray(m))throw new Error("ajv implementation error");if(v.opts.discriminator&&y.discriminator)return;const w=m,b=l.let("valid",!1),S=l.let("passing",null),$=l.name("_valid");u.setParams({passing:S}),l.block(function validateOneOf(){w.forEach((m,y)=>{let w;(0,h.alwaysValidSchema)(v,m)?l.var($,!0):w=u.subschema({keyword:"oneOf",schemaProp:y,compositeRule:!0},$),y>0&&l.if(f._`${$} && ${b}`).assign(b,!1).assign(S,f._`[${S}, ${y}]`).else(),l.if($,()=>{l.assign(b,!0),l.assign(S,y),w&&u.mergeEvaluated(w,f.Name)})})}),u.result(b,()=>u.reset(),()=>u.error(!0))}};l.default=y},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),w={keyword:"patternProperties",type:"object",schemaType:"object",code(u){const{gen:l,schema:m,data:w,parentSchema:b,it:S}=u,{opts:$}=S,x=(0,f.allSchemaProperties)(m),j=x.filter(u=>(0,y.alwaysValidSchema)(S,m[u]));if(0===x.length||j.length===x.length&&(!S.opts.unevaluated||!0===S.props))return;const E=$.strictSchema&&!$.allowMatchingProperties&&b.properties,R=l.name("valid");!0===S.props||S.props instanceof h.Name||(S.props=(0,v.evaluatedPropsToName)(l,S.props));const{props:C}=S;function checkMatchingProperties(u){for(const l in E)new RegExp(u).test(l)&&(0,y.checkStrictMode)(S,`property ${l} matches pattern ${u} (use allowMatchingProperties)`)}function validateProperties(m){l.forIn("key",w,y=>{l.if(h._`${(0,f.usePattern)(u,m)}.test(${y})`,()=>{const f=j.includes(m);f||u.subschema({keyword:"patternProperties",schemaProp:m,dataProp:y,dataPropType:v.Type.Str},R),S.opts.unevaluated&&!0!==C?l.assign(h._`${C}[${y}]`,!0):f||S.allErrors||l.if((0,h.not)(R),()=>l.break())})})}!function validatePatternProperties(){for(const u of x)E&&checkMatchingProperties(u),S.allErrors?validateProperties(u):(l.var(R,!0),validateProperties(u),l.if(R))}()}};l.default=w},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/items.js"),h={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:u=>(0,f.validateTuple)(u,"items")};l.default=h},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/properties.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js"),w={keyword:"properties",type:"object",schemaType:"object",code(u){const{gen:l,schema:m,parentSchema:w,data:b,it:S}=u;"all"===S.opts.removeAdditional&&void 0===w.additionalProperties&&v.default.code(new f.KeywordCxt(S,v.default,"additionalProperties"));const $=(0,h.allSchemaProperties)(m);for(const u of $)S.definedProperties.add(u);S.opts.unevaluated&&$.length&&!0!==S.props&&(S.props=y.mergeEvaluated.props(l,(0,y.toHash)($),S.props));const x=$.filter(u=>!(0,y.alwaysValidSchema)(S,m[u]));if(0===x.length)return;const j=l.name("valid");for(const m of x)hasDefault(m)?applyPropertySchema(m):(l.if((0,h.propertyInData)(l,b,m,S.opts.ownProperties)),applyPropertySchema(m),S.allErrors||l.else().var(j,!0),l.endIf()),u.it.definedProperties.add(m),u.ok(j);function hasDefault(u){return S.opts.useDefaults&&!S.compositeRule&&void 0!==m[u].default}function applyPropertySchema(l){u.subschema({keyword:"properties",schemaProp:l,dataProp:l},j)}}};l.default=w},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),y={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:u})=>f._`{propertyName: ${u.propertyName}}`},code(u){const{gen:l,schema:m,data:y,it:v}=u;if((0,h.alwaysValidSchema)(v,m))return;const w=l.name("valid");l.forIn("key",y,m=>{u.setParams({propertyName:m}),u.subschema({keyword:"propertyNames",data:m,dataTypes:["string"],propertyName:m,compositeRule:!0},w),l.if((0,f.not)(w),()=>{u.error(!0),v.allErrors||l.break()})}),u.ok(w)}};l.default=y},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/thenElse.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),h={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:u,parentSchema:l,it:m}){void 0===l.if&&(0,f.checkStrictMode)(m,`"${u}" without "if" is ignored`)}};l.default=h},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.validateUnion=l.validateArray=l.usePattern=l.callValidateCode=l.schemaProperties=l.allSchemaProperties=l.noPropertyInData=l.propertyInData=l.isOwnProperty=l.hasPropFunc=l.reportMissingProp=l.checkMissingProp=l.checkReportMissingProp=void 0;const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/names.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");function hasPropFunc(u){return u.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:f._`Object.prototype.hasOwnProperty`})}function isOwnProperty(u,l,m){return f._`${hasPropFunc(u)}.call(${l}, ${m})`}function noPropertyInData(u,l,m,h){const y=f._`${l}${(0,f.getProperty)(m)} === undefined`;return h?(0,f.or)(y,(0,f.not)(isOwnProperty(u,l,m))):y}function allSchemaProperties(u){return u?Object.keys(u).filter(u=>"__proto__"!==u):[]}l.checkReportMissingProp=function checkReportMissingProp(u,l){const{gen:m,data:h,it:y}=u;m.if(noPropertyInData(m,h,l,y.opts.ownProperties),()=>{u.setParams({missingProperty:f._`${l}`},!0),u.error()})},l.checkMissingProp=function checkMissingProp({gen:u,data:l,it:{opts:m}},h,y){return(0,f.or)(...h.map(h=>(0,f.and)(noPropertyInData(u,l,h,m.ownProperties),f._`${y} = ${h}`)))},l.reportMissingProp=function reportMissingProp(u,l){u.setParams({missingProperty:l},!0),u.error()},l.hasPropFunc=hasPropFunc,l.isOwnProperty=isOwnProperty,l.propertyInData=function propertyInData(u,l,m,h){const y=f._`${l}${(0,f.getProperty)(m)} !== undefined`;return h?f._`${y} && ${isOwnProperty(u,l,m)}`:y},l.noPropertyInData=noPropertyInData,l.allSchemaProperties=allSchemaProperties,l.schemaProperties=function schemaProperties(u,l){return allSchemaProperties(l).filter(m=>!(0,h.alwaysValidSchema)(u,l[m]))},l.callValidateCode=function callValidateCode({schemaCode:u,data:l,it:{gen:m,topSchemaRef:h,schemaPath:v,errorPath:w},it:b},S,$,x){const j=x?f._`${u}, ${l}, ${h}${v}`:l,E=[[y.default.instancePath,(0,f.strConcat)(y.default.instancePath,w)],[y.default.parentData,b.parentData],[y.default.parentDataProperty,b.parentDataProperty],[y.default.rootData,y.default.rootData]];b.opts.dynamicRef&&E.push([y.default.dynamicAnchors,y.default.dynamicAnchors]);const R=f._`${j}, ${m.object(...E)}`;return $!==f.nil?f._`${S}.call(${$}, ${R})`:f._`${S}(${R})`};const w=f._`new RegExp`;l.usePattern=function usePattern({gen:u,it:{opts:l}},m){const h=l.unicodeRegExp?"u":"",{regExp:y}=l.code,b=y(m,h);return u.scopeValue("pattern",{key:b.toString(),ref:b,code:f._`${"new RegExp"===y.code?w:(0,v.useFunc)(u,y)}(${m}, ${h})`})},l.validateArray=function validateArray(u){const{gen:l,data:m,keyword:y,it:v}=u,w=l.name("valid");if(v.allErrors){const u=l.let("valid",!0);return validateItems(()=>l.assign(u,!1)),u}return l.var(w,!0),validateItems(()=>l.break()),w;function validateItems(v){const b=l.const("len",f._`${m}.length`);l.forRange("i",0,b,m=>{u.subschema({keyword:y,dataProp:m,dataPropType:h.Type.Num},w),l.if((0,f.not)(w),v)})}},l.validateUnion=function validateUnion(u){const{gen:l,schema:m,keyword:y,it:v}=u;if(!Array.isArray(m))throw new Error("ajv implementation error");if(m.some(u=>(0,h.alwaysValidSchema)(v,u))&&!v.opts.unevaluated)return;const w=l.let("valid",!1),b=l.name("_valid");l.block(()=>m.forEach((m,h)=>{const v=u.subschema({keyword:y,schemaProp:h,compositeRule:!0},b);l.assign(w,f._`${w} || ${b}`);u.mergeValidEvaluated(v,b)||l.if((0,f.not)(w))})),u.result(w,()=>u.reset(),()=>u.error(!0))}},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/id.js":function(u,l){Object.defineProperty(l,"__esModule",{value:!0});const m={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};l.default=m},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/index.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/id.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/ref.js"),y=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",f.default,h.default];l.default=y},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/ref.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.callRef=l.getValidate=void 0;const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/ref_error.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/names.js"),w=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/index.js"),b=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),S={keyword:"$ref",schemaType:"string",code(u){const{gen:l,schema:m,it:h}=u,{baseId:v,schemaEnv:b,validateName:S,opts:$,self:x}=h,{root:j}=b;if(("#"===m||"#/"===m)&&v===j.baseId)return function callRootRef(){if(b===j)return callRef(u,S,b,b.$async);const m=l.scopeValue("root",{ref:j});return callRef(u,y._`${m}.validate`,j,j.$async)}();const E=w.resolveRef.call(x,j,v,m);if(void 0===E)throw new f.default(h.opts.uriResolver,v,m);return E instanceof w.SchemaEnv?function callValidate(l){const m=getValidate(u,l);callRef(u,m,l,l.$async)}(E):function inlineRefSchema(f){const h=l.scopeValue("schema",!0===$.code.source?{ref:f,code:(0,y.stringify)(f)}:{ref:f}),v=l.name("valid"),w=u.subschema({schema:f,dataTypes:[],schemaPath:y.nil,topSchemaRef:h,errSchemaPath:m},v);u.mergeEvaluated(w),u.ok(v)}(E)}};function getValidate(u,l){const{gen:m}=u;return l.validate?m.scopeValue("validate",{ref:l.validate}):y._`${m.scopeValue("wrapper",{ref:l})}.validate`}function callRef(u,l,m,f){const{gen:w,it:S}=u,{allErrors:$,schemaEnv:x,opts:j}=S,E=j.passContext?v.default.this:y.nil;function addErrorsFrom(u){const l=y._`${u}.errors`;w.assign(v.default.vErrors,y._`${v.default.vErrors} === null ? ${l} : ${v.default.vErrors}.concat(${l})`),w.assign(v.default.errors,y._`${v.default.vErrors}.length`)}function addEvaluatedFrom(u){var l;if(!S.opts.unevaluated)return;const f=null===(l=null==m?void 0:m.validate)||void 0===l?void 0:l.evaluated;if(!0!==S.props)if(f&&!f.dynamicProps)void 0!==f.props&&(S.props=b.mergeEvaluated.props(w,f.props,S.props));else{const l=w.var("props",y._`${u}.evaluated.props`);S.props=b.mergeEvaluated.props(w,l,S.props,y.Name)}if(!0!==S.items)if(f&&!f.dynamicItems)void 0!==f.items&&(S.items=b.mergeEvaluated.items(w,f.items,S.items));else{const l=w.var("items",y._`${u}.evaluated.items`);S.items=b.mergeEvaluated.items(w,l,S.items,y.Name)}}f?function callAsyncRef(){if(!x.$async)throw new Error("async schema referenced by sync schema");const m=w.let("valid");w.try(()=>{w.code(y._`await ${(0,h.callValidateCode)(u,l,E)}`),addEvaluatedFrom(l),$||w.assign(m,!0)},u=>{w.if(y._`!(${u} instanceof ${S.ValidationError})`,()=>w.throw(u)),addErrorsFrom(u),$||w.assign(m,!1)}),u.ok(m)}():function callSyncRef(){u.result((0,h.callValidateCode)(u,l,E),()=>addEvaluatedFrom(l),()=>addErrorsFrom(l))}()}l.getValidate=getValidate,l.callRef=callRef,l.default=S},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/discriminator/index.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/discriminator/types.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/index.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/ref_error.js"),w=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),b={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:u,tagName:l}})=>u===h.DiscrError.Tag?`tag "${l}" must be string`:`value of tag "${l}" must be in oneOf`,params:({params:{discrError:u,tag:l,tagName:m}})=>f._`{error: ${u}, tag: ${m}, tagValue: ${l}}`},code(u){const{gen:l,data:m,schema:b,parentSchema:S,it:$}=u,{oneOf:x}=S;if(!$.opts.discriminator)throw new Error("discriminator: requires discriminator option");const j=b.propertyName;if("string"!=typeof j)throw new Error("discriminator: requires propertyName");if(b.mapping)throw new Error("discriminator: mapping is not supported");if(!x)throw new Error("discriminator: requires oneOf keyword");const E=l.let("valid",!1),R=l.const("tag",f._`${m}${(0,f.getProperty)(j)}`);function applyTagSchema(m){const h=l.name("valid"),y=u.subschema({keyword:"oneOf",schemaProp:m},h);return u.mergeEvaluated(y,f.Name),h}l.if(f._`typeof ${R} == "string"`,()=>function validateMapping(){const m=function getMapping(){var u;const l={},m=hasRequired(S);let f=!0;for(let l=0;l<x.length;l++){let h=x[l];if((null==h?void 0:h.$ref)&&!(0,w.schemaHasRulesButRef)(h,$.self.RULES)){const u=h.$ref;if(h=y.resolveRef.call($.self,$.schemaEnv.root,$.baseId,u),h instanceof y.SchemaEnv&&(h=h.schema),void 0===h)throw new v.default($.opts.uriResolver,$.baseId,u)}const b=null===(u=null==h?void 0:h.properties)||void 0===u?void 0:u[j];if("object"!=typeof b)throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${j}"`);f=f&&(m||hasRequired(h)),addMappings(b,l)}if(!f)throw new Error(`discriminator: "${j}" must be required`);return l;function hasRequired({required:u}){return Array.isArray(u)&&u.includes(j)}function addMappings(u,l){if(u.const)addMapping(u.const,l);else{if(!u.enum)throw new Error(`discriminator: "properties/${j}" must have "const" or "enum"`);for(const m of u.enum)addMapping(m,l)}}function addMapping(u,m){if("string"!=typeof u||u in l)throw new Error(`discriminator: "${j}" values must be unique strings`);l[u]=m}}();l.if(!1);for(const u in m)l.elseIf(f._`${R} === ${u}`),l.assign(E,applyTagSchema(m[u]));l.else(),u.error(!1,{discrError:h.DiscrError.Mapping,tag:R,tagName:j}),l.endIf()}(),()=>u.error(!1,{discrError:h.DiscrError.Tag,tag:R,tagName:j})),u.ok(E)}};l.default=b},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/discriminator/types.js":function(u,l){var m;Object.defineProperty(l,"__esModule",{value:!0}),l.DiscrError=void 0,function(u){u.Tag="tag",u.Mapping="mapping"}(m||(l.DiscrError=m={}))},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/draft7.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/index.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/index.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/format/index.js"),w=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/metadata.js"),b=[f.default,h.default,(0,y.default)(),v.default,w.metadataVocabulary,w.contentVocabulary];l.default=b},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/format/format.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:u})=>f.str`must match format "${u}"`,params:({schemaCode:u})=>f._`{format: ${u}}`},code(u,l){const{gen:m,data:h,$data:y,schema:v,schemaCode:w,it:b}=u,{opts:S,errSchemaPath:$,schemaEnv:x,self:j}=b;S.validateFormats&&(y?function validate$DataFormat(){const y=m.scopeValue("formats",{ref:j.formats,code:S.code.formats}),v=m.const("fDef",f._`${y}[${w}]`),b=m.let("fType"),$=m.let("format");m.if(f._`typeof ${v} == "object" && !(${v} instanceof RegExp)`,()=>m.assign(b,f._`${v}.type || "string"`).assign($,f._`${v}.validate`),()=>m.assign(b,f._`"string"`).assign($,v)),u.fail$data((0,f.or)(function unknownFmt(){return!1===S.strictSchema?f.nil:f._`${w} && !${$}`}(),function invalidFmt(){const u=x.$async?f._`(${v}.async ? await ${$}(${h}) : ${$}(${h}))`:f._`${$}(${h})`,m=f._`(typeof ${$} == "function" ? ${u} : ${$}.test(${h}))`;return f._`${$} && ${$} !== true && ${b} === ${l} && !${m}`}()))}():function validateFormat(){const y=j.formats[v];if(!y)return void function unknownFormat(){if(!1===S.strictSchema)return void j.logger.warn(unknownMsg());throw new Error(unknownMsg());function unknownMsg(){return`unknown format "${v}" ignored in schema at path "${$}"`}}();if(!0===y)return;const[w,b,E]=function getFormat(u){const l=u instanceof RegExp?(0,f.regexpCode)(u):S.code.formats?f._`${S.code.formats}${(0,f.getProperty)(v)}`:void 0,h=m.scopeValue("formats",{key:v,ref:u,code:l});if("object"==typeof u&&!(u instanceof RegExp))return[u.type||"string",u.validate,f._`${h}.validate`];return["string",u,h]}(y);w===l&&u.pass(function validCondition(){if("object"==typeof y&&!(y instanceof RegExp)&&y.async){if(!x.$async)throw new Error("async format in sync schema");return f._`await ${E}(${h})`}return"function"==typeof b?f._`${E}(${h})`:f._`${E}.test(${h})`}())}())}};l.default=h},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/format/index.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=[m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/format/format.js").default];l.default=f},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/metadata.js":function(u,l){Object.defineProperty(l,"__esModule",{value:!0}),l.contentVocabulary=l.metadataVocabulary=void 0,l.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],l.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/const.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/equal.js"),v={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:u})=>f._`{allowedValue: ${u}}`},code(u){const{gen:l,data:m,$data:v,schemaCode:w,schema:b}=u;v||b&&"object"==typeof b?u.fail$data(f._`!${(0,h.useFunc)(l,y.default)}(${m}, ${w})`):u.fail(f._`${b} !== ${m}`)}};l.default=v},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/enum.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/equal.js"),v={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:u})=>f._`{allowedValues: ${u}}`},code(u){const{gen:l,data:m,$data:v,schema:w,schemaCode:b,it:S}=u;if(!v&&0===w.length)throw new Error("enum must have non-empty array");const $=w.length>=S.opts.loopEnum;let x;const getEql=()=>null!=x?x:x=(0,h.useFunc)(l,y.default);let j;if($||v)j=l.let("valid"),u.block$data(j,function loopEnum(){l.assign(j,!1),l.forOf("v",b,u=>l.if(f._`${getEql()}(${m}, ${u})`,()=>l.assign(j,!0).break()))});else{if(!Array.isArray(w))throw new Error("ajv implementation error");const u=l.const("vSchema",b);j=(0,f.or)(...w.map((l,h)=>function equalCode(u,l){const h=w[l];return"object"==typeof h&&null!==h?f._`${getEql()}(${m}, ${u}[${l}])`:f._`${m} === ${h}`}(u,h)))}u.pass(j)}};l.default=v},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/index.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitNumber.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/multipleOf.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitLength.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/pattern.js"),w=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitProperties.js"),b=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/required.js"),S=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitItems.js"),$=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js"),x=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/const.js"),j=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/enum.js"),E=[f.default,h.default,y.default,v.default,w.default,b.default,S.default,$.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},x.default,j.default];l.default=E},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitItems.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:u,schemaCode:l}){const m="maxItems"===u?"more":"fewer";return f.str`must NOT have ${m} than ${l} items`},params:({schemaCode:u})=>f._`{limit: ${u}}`},code(u){const{keyword:l,data:m,schemaCode:h}=u,y="maxItems"===l?f.operators.GT:f.operators.LT;u.fail$data(f._`${m}.length ${y} ${h}`)}};l.default=h},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitLength.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/ucs2length.js"),v={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:u,schemaCode:l}){const m="maxLength"===u?"more":"fewer";return f.str`must NOT have ${m} than ${l} characters`},params:({schemaCode:u})=>f._`{limit: ${u}}`},code(u){const{keyword:l,data:m,schemaCode:v,it:w}=u,b="maxLength"===l?f.operators.GT:f.operators.LT,S=!1===w.opts.unicode?f._`${m}.length`:f._`${(0,h.useFunc)(u.gen,y.default)}(${m})`;u.fail$data(f._`${S} ${b} ${v}`)}};l.default=v},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitNumber.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=f.operators,y={maximum:{okStr:"<=",ok:h.LTE,fail:h.GT},minimum:{okStr:">=",ok:h.GTE,fail:h.LT},exclusiveMaximum:{okStr:"<",ok:h.LT,fail:h.GTE},exclusiveMinimum:{okStr:">",ok:h.GT,fail:h.LTE}},v={message:({keyword:u,schemaCode:l})=>f.str`must be ${y[u].okStr} ${l}`,params:({keyword:u,schemaCode:l})=>f._`{comparison: ${y[u].okStr}, limit: ${l}}`},w={keyword:Object.keys(y),type:"number",schemaType:"number",$data:!0,error:v,code(u){const{keyword:l,data:m,schemaCode:h}=u;u.fail$data(f._`${m} ${y[l].fail} ${h} || isNaN(${m})`)}};l.default=w},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitProperties.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:u,schemaCode:l}){const m="maxProperties"===u?"more":"fewer";return f.str`must NOT have ${m} than ${l} properties`},params:({schemaCode:u})=>f._`{limit: ${u}}`},code(u){const{keyword:l,data:m,schemaCode:h}=u,y="maxProperties"===l?f.operators.GT:f.operators.LT;u.fail$data(f._`Object.keys(${m}).length ${y} ${h}`)}};l.default=h},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/multipleOf.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:u})=>f.str`must be multiple of ${u}`,params:({schemaCode:u})=>f._`{multipleOf: ${u}}`},code(u){const{gen:l,data:m,schemaCode:h,it:y}=u,v=y.opts.multipleOfPrecision,w=l.let("res"),b=v?f._`Math.abs(Math.round(${w}) - ${w}) > 1e-${v}`:f._`${w} !== parseInt(${w})`;u.fail$data(f._`(${h} === 0 || (${w} = ${m}/${h}, ${b}))`)}};l.default=h},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/pattern.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),v={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:u})=>y.str`must match pattern "${u}"`,params:({schemaCode:u})=>y._`{pattern: ${u}}`},code(u){const{gen:l,data:m,$data:v,schema:w,schemaCode:b,it:S}=u,$=S.opts.unicodeRegExp?"u":"";if(v){const{regExp:f}=S.opts.code,v="new RegExp"===f.code?y._`new RegExp`:(0,h.useFunc)(l,f),w=l.let("valid");l.try(()=>l.assign(w,y._`${v}(${b}, ${$}).test(${m})`),()=>l.assign(w,!1)),u.fail$data(y._`!${w}`)}else{const l=(0,f.usePattern)(u,w);u.fail$data(y._`!${l}.test(${m})`)}}};l.default=v},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/required.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),v={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:u}})=>h.str`must have required property '${u}'`,params:({params:{missingProperty:u}})=>h._`{missingProperty: ${u}}`},code(u){const{gen:l,schema:m,schemaCode:v,data:w,$data:b,it:S}=u,{opts:$}=S;if(!b&&0===m.length)return;const x=m.length>=$.loopRequired;if(S.allErrors?function allErrorsMode(){if(x||b)u.block$data(h.nil,loopAllRequired);else for(const l of m)(0,f.checkReportMissingProp)(u,l)}():function exitOnErrorMode(){const y=l.let("missing");if(x||b){const m=l.let("valid",!0);u.block$data(m,()=>function loopUntilMissing(m,y){u.setParams({missingProperty:m}),l.forOf(m,v,()=>{l.assign(y,(0,f.propertyInData)(l,w,m,$.ownProperties)),l.if((0,h.not)(y),()=>{u.error(),l.break()})},h.nil)}(y,m)),u.ok(m)}else l.if((0,f.checkMissingProp)(u,m,y)),(0,f.reportMissingProp)(u,y),l.else()}(),$.strictRequired){const l=u.parentSchema.properties,{definedProperties:f}=u.it;for(const u of m)if(void 0===(null==l?void 0:l[u])&&!f.has(u)){const l=`required property "${u}" is not defined at "${S.schemaEnv.baseId+S.errSchemaPath}" (strictRequired)`;(0,y.checkStrictMode)(S,l,S.opts.strictRequired)}}function loopAllRequired(){l.forOf("prop",v,m=>{u.setParams({missingProperty:m}),l.if((0,f.noPropertyInData)(l,w,m,$.ownProperties),()=>u.error())})}}};l.default=v},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/dataType.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/equal.js"),w={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:u,j:l}})=>h.str`must NOT have duplicate items (items ## ${l} and ${u} are identical)`,params:({params:{i:u,j:l}})=>h._`{i: ${u}, j: ${l}}`},code(u){const{gen:l,data:m,$data:w,schema:b,parentSchema:S,schemaCode:$,it:x}=u;if(!w&&!b)return;const j=l.let("valid"),E=S.items?(0,f.getSchemaTypes)(S.items):[];function loopN(y,v){const w=l.name("item"),b=(0,f.checkDataTypes)(E,w,x.opts.strictNumbers,f.DataType.Wrong),S=l.const("indices",h._`{}`);l.for(h._`;${y}--;`,()=>{l.let(w,h._`${m}[${y}]`),l.if(b,h._`continue`),E.length>1&&l.if(h._`typeof ${w} == "string"`,h._`${w} += "_"`),l.if(h._`typeof ${S}[${w}] == "number"`,()=>{l.assign(v,h._`${S}[${w}]`),u.error(),l.assign(j,!1).break()}).code(h._`${S}[${w}] = ${y}`)})}function loopN2(f,w){const b=(0,y.useFunc)(l,v.default),S=l.name("outer");l.label(S).for(h._`;${f}--;`,()=>l.for(h._`${w} = ${f}; ${w}--;`,()=>l.if(h._`${b}(${m}[${f}], ${m}[${w}])`,()=>{u.error(),l.assign(j,!1).break(S)})))}u.block$data(j,function validateUniqueItems(){const f=l.let("i",h._`${m}.length`),y=l.let("j");u.setParams({i:f,j:y}),l.assign(j,!0),l.if(h._`${f} > 1`,()=>(function canOptimize(){return E.length>0&&!E.some(u=>"object"===u||"array"===u)}()?loopN:loopN2)(f,y))},h._`${$} === false`),u.ok(j)}};l.default=w},"./node_modules/@modelcontextprotocol/sdk/node_modules/json-schema-traverse/index.js":function(u){var l=u.exports=function(u,l,m){"function"==typeof l&&(m=l,l={}),_traverse(l,"function"==typeof(m=l.cb||m)?m:m.pre||function(){},m.post||function(){},u,"",u)};function _traverse(u,m,f,h,y,v,w,b,S,$){if(h&&"object"==typeof h&&!Array.isArray(h)){for(var x in m(h,y,v,w,b,S,$),h){var j=h[x];if(Array.isArray(j)){if(x in l.arrayKeywords)for(var E=0;E<j.length;E++)_traverse(u,m,f,j[E],y+"/"+x+"/"+E,v,y,x,h,E)}else if(x in l.propsKeywords){if(j&&"object"==typeof j)for(var R in j)_traverse(u,m,f,j[R],y+"/"+x+"/"+escapeJsonPtr(R),v,y,x,h,R)}else(x in l.keywords||u.allKeys&&!(x in l.skipKeywords))&&_traverse(u,m,f,j,y+"/"+x,v,y,x,h)}f(h,y,v,w,b,S,$)}}function escapeJsonPtr(u){return u.replace(/~/g,"~0").replace(/\//g,"~1")}l.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},l.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},l.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},l.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}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/Options.js":function(u,l,m){m.r(l),m.d(l,{defaultOptions:function(){return h},getDefaultOptions:function(){return getDefaultOptions},ignoreOverride:function(){return f},jsonDescription:function(){return jsonDescription}});const f=Symbol("Let zodToJsonSchema decide on which parser to use"),jsonDescription=(u,l)=>{if(l.description)try{return{...u,...JSON.parse(l.description)}}catch{}return u},h={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"},getDefaultOptions=u=>"string"==typeof u?{...h,name:u}:{...h,...u}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/Refs.js":function(u,l,m){m.r(l),m.d(l,{getRefs:function(){return getRefs}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/Options.js");const getRefs=u=>{const l=(0,f.getDefaultOptions)(u),m=void 0!==l.name?[...l.basePath,l.definitionPath,l.name]:l.basePath;return{...l,flags:{hasReferencedOpenAiAnyType:!1},currentPath:m,propertyPath:void 0,seen:new Map(Object.entries(l.definitions).map(([u,m])=>[m._def,{def:m._def,path:[...l.basePath,l.definitionPath,u],jsonSchema:void 0}]))}}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/errorMessages.js":function(u,l,m){function addErrorMessage(u,l,m,f){f?.errorMessages&&m&&(u.errorMessage={...u.errorMessage,[l]:m})}function setResponseValueAndErrors(u,l,m,f,h){u[l]=m,addErrorMessage(u,l,f,h)}m.r(l),m.d(l,{addErrorMessage:function(){return addErrorMessage},setResponseValueAndErrors:function(){return setResponseValueAndErrors}})},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js":function(u,l,m){m.r(l),m.d(l,{getRelativePath:function(){return getRelativePath}});const getRelativePath=(u,l)=>{let m=0;for(;m<u.length&&m<l.length&&u[m]===l[m];m++);return[(u.length-m).toString(),...l.slice(m)].join("/")}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/index.js":function(u,l,m){m.r(l),m.d(l,{addErrorMessage:function(){return y.addErrorMessage},defaultOptions:function(){return f.defaultOptions},getDefaultOptions:function(){return f.getDefaultOptions},getRefs:function(){return h.getRefs},getRelativePath:function(){return v.getRelativePath},ignoreOverride:function(){return f.ignoreOverride},jsonDescription:function(){return f.jsonDescription},parseAnyDef:function(){return b.parseAnyDef},parseArrayDef:function(){return S.parseArrayDef},parseBigintDef:function(){return $.parseBigintDef},parseBooleanDef:function(){return x.parseBooleanDef},parseBrandedDef:function(){return j.parseBrandedDef},parseCatchDef:function(){return E.parseCatchDef},parseDateDef:function(){return R.parseDateDef},parseDef:function(){return w.parseDef},parseDefaultDef:function(){return C.parseDefaultDef},parseEffectsDef:function(){return Z.parseEffectsDef},parseEnumDef:function(){return z.parseEnumDef},parseIntersectionDef:function(){return A.parseIntersectionDef},parseLiteralDef:function(){return O.parseLiteralDef},parseMapDef:function(){return N.parseMapDef},parseNativeEnumDef:function(){return D.parseNativeEnumDef},parseNeverDef:function(){return M.parseNeverDef},parseNullDef:function(){return U.parseNullDef},parseNullableDef:function(){return L.parseNullableDef},parseNumberDef:function(){return F.parseNumberDef},parseObjectDef:function(){return V.parseObjectDef},parseOptionalDef:function(){return K.parseOptionalDef},parsePipelineDef:function(){return H.parsePipelineDef},parsePromiseDef:function(){return B.parsePromiseDef},parseReadonlyDef:function(){return J.parseReadonlyDef},parseRecordDef:function(){return G.parseRecordDef},parseSetDef:function(){return W.parseSetDef},parseStringDef:function(){return Q.parseStringDef},parseTupleDef:function(){return Y.parseTupleDef},parseUndefinedDef:function(){return X.parseUndefinedDef},parseUnionDef:function(){return ee.parseUnionDef},parseUnknownDef:function(){return te.parseUnknownDef},primitiveMappings:function(){return ee.primitiveMappings},selectParser:function(){return ne.selectParser},setResponseValueAndErrors:function(){return y.setResponseValueAndErrors},zodPatterns:function(){return Q.zodPatterns},zodToJsonSchema:function(){return re.zodToJsonSchema}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/Options.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/Refs.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/errorMessages.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js"),w=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js"),b=(m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseTypes.js"),m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/any.js")),S=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/array.js"),$=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js"),x=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js"),j=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js"),E=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js"),R=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/date.js"),C=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/default.js"),Z=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js"),z=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js"),A=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js"),O=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js"),N=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/map.js"),D=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js"),M=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/never.js"),U=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/null.js"),L=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js"),F=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/number.js"),V=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/object.js"),K=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js"),H=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js"),B=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js"),J=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js"),G=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/record.js"),W=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/set.js"),Q=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/string.js"),Y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js"),X=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js"),ee=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/union.js"),te=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js"),ne=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/selectParser.js"),re=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js");l.default=re.zodToJsonSchema},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js":function(u,l,m){m.r(l),m.d(l,{parseDef:function(){return parseDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/Options.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/selectParser.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseDef(u,l,m=!1){const y=l.seen.get(u);if(l.override){const h=l.override?.(u,l,y,m);if(h!==f.ignoreOverride)return h}if(y&&!m){const u=get$ref(y,l);if(void 0!==u)return u}const v={def:u,path:l.currentPath,jsonSchema:void 0};l.seen.set(u,v);const w=(0,h.selectParser)(u,u.typeName,l),b="function"==typeof w?parseDef(w(),l):w;if(b&&addMeta(u,l,b),l.postProcess){const m=l.postProcess(b,u,l);return v.jsonSchema=b,m}return v.jsonSchema=b,b}const get$ref=(u,l)=>{switch(l.$refStrategy){case"root":return{$ref:u.path.join("/")};case"relative":return{$ref:(0,y.getRelativePath)(l.currentPath,u.path)};case"none":case"seen":return u.path.length<l.currentPath.length&&u.path.every((u,m)=>l.currentPath[m]===u)?(console.warn(`Recursive reference detected at ${l.currentPath.join("/")}! Defaulting to any`),(0,v.parseAnyDef)(l)):"seen"===l.$refStrategy?(0,v.parseAnyDef)(l):void 0}},addMeta=(u,l,m)=>(u.description&&(m.description=u.description,l.markdownDescription&&(m.markdownDescription=u.description)),m)},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseTypes.js":function(u,l,m){m.r(l)},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/any.js":function(u,l,m){m.r(l),m.d(l,{parseAnyDef:function(){return parseAnyDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js");function parseAnyDef(u){if("openAi"!==u.target)return{};const l=[...u.basePath,u.definitionPath,u.openAiAnyTypeName];return u.flags.hasReferencedOpenAiAnyType=!0,{$ref:"relative"===u.$refStrategy?(0,f.getRelativePath)(l,u.currentPath):l.join("/")}}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/array.js":function(u,l,m){m.r(l),m.d(l,{parseArrayDef:function(){return parseArrayDef}});var f=m("./node_modules/zod/v3/types.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/errorMessages.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parseArrayDef(u,l){const m={type:"array"};return u.type?._def&&u.type?._def?.typeName!==f.ZodFirstPartyTypeKind.ZodAny&&(m.items=(0,y.parseDef)(u.type._def,{...l,currentPath:[...l.currentPath,"items"]})),u.minLength&&(0,h.setResponseValueAndErrors)(m,"minItems",u.minLength.value,u.minLength.message,l),u.maxLength&&(0,h.setResponseValueAndErrors)(m,"maxItems",u.maxLength.value,u.maxLength.message,l),u.exactLength&&((0,h.setResponseValueAndErrors)(m,"minItems",u.exactLength.value,u.exactLength.message,l),(0,h.setResponseValueAndErrors)(m,"maxItems",u.exactLength.value,u.exactLength.message,l)),m}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js":function(u,l,m){m.r(l),m.d(l,{parseBigintDef:function(){return parseBigintDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/errorMessages.js");function parseBigintDef(u,l){const m={type:"integer",format:"int64"};if(!u.checks)return m;for(const h of u.checks)switch(h.kind){case"min":"jsonSchema7"===l.target?h.inclusive?(0,f.setResponseValueAndErrors)(m,"minimum",h.value,h.message,l):(0,f.setResponseValueAndErrors)(m,"exclusiveMinimum",h.value,h.message,l):(h.inclusive||(m.exclusiveMinimum=!0),(0,f.setResponseValueAndErrors)(m,"minimum",h.value,h.message,l));break;case"max":"jsonSchema7"===l.target?h.inclusive?(0,f.setResponseValueAndErrors)(m,"maximum",h.value,h.message,l):(0,f.setResponseValueAndErrors)(m,"exclusiveMaximum",h.value,h.message,l):(h.inclusive||(m.exclusiveMaximum=!0),(0,f.setResponseValueAndErrors)(m,"maximum",h.value,h.message,l));break;case"multipleOf":(0,f.setResponseValueAndErrors)(m,"multipleOf",h.value,h.message,l)}return m}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js":function(u,l,m){function parseBooleanDef(){return{type:"boolean"}}m.r(l),m.d(l,{parseBooleanDef:function(){return parseBooleanDef}})},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js":function(u,l,m){m.r(l),m.d(l,{parseBrandedDef:function(){return parseBrandedDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parseBrandedDef(u,l){return(0,f.parseDef)(u.type._def,l)}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js":function(u,l,m){m.r(l),m.d(l,{parseCatchDef:function(){return parseCatchDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");const parseCatchDef=(u,l)=>(0,f.parseDef)(u.innerType._def,l)},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/date.js":function(u,l,m){m.r(l),m.d(l,{parseDateDef:function(){return parseDateDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/errorMessages.js");function parseDateDef(u,l,m){const f=m??l.dateStrategy;if(Array.isArray(f))return{anyOf:f.map((m,f)=>parseDateDef(u,l,m))};switch(f){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return integerDateParser(u,l)}}const integerDateParser=(u,l)=>{const m={type:"integer",format:"unix-time"};if("openApi3"===l.target)return m;for(const h of u.checks)switch(h.kind){case"min":(0,f.setResponseValueAndErrors)(m,"minimum",h.value,h.message,l);break;case"max":(0,f.setResponseValueAndErrors)(m,"maximum",h.value,h.message,l)}return m}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/default.js":function(u,l,m){m.r(l),m.d(l,{parseDefaultDef:function(){return parseDefaultDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parseDefaultDef(u,l){return{...(0,f.parseDef)(u.innerType._def,l),default:u.defaultValue()}}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js":function(u,l,m){m.r(l),m.d(l,{parseEffectsDef:function(){return parseEffectsDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseEffectsDef(u,l){return"input"===l.effectStrategy?(0,f.parseDef)(u.schema._def,l):(0,h.parseAnyDef)(l)}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js":function(u,l,m){function parseEnumDef(u){return{type:"string",enum:Array.from(u.values)}}m.r(l),m.d(l,{parseEnumDef:function(){return parseEnumDef}})},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js":function(u,l,m){m.r(l),m.d(l,{parseIntersectionDef:function(){return parseIntersectionDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");const isJsonSchema7AllOfType=u=>(!("type"in u)||"string"!==u.type)&&"allOf"in u;function parseIntersectionDef(u,l){const m=[(0,f.parseDef)(u.left._def,{...l,currentPath:[...l.currentPath,"allOf","0"]}),(0,f.parseDef)(u.right._def,{...l,currentPath:[...l.currentPath,"allOf","1"]})].filter(u=>!!u);let h="jsonSchema2019-09"===l.target?{unevaluatedProperties:!1}:void 0;const y=[];return m.forEach(u=>{if(isJsonSchema7AllOfType(u))y.push(...u.allOf),void 0===u.unevaluatedProperties&&(h=void 0);else{let l=u;if("additionalProperties"in u&&!1===u.additionalProperties){const{additionalProperties:m,...f}=u;l=f}else h=void 0;y.push(l)}}),y.length?{allOf:y,...h}:void 0}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js":function(u,l,m){function parseLiteralDef(u,l){const m=typeof u.value;return"bigint"!==m&&"number"!==m&&"boolean"!==m&&"string"!==m?{type:Array.isArray(u.value)?"array":"object"}:"openApi3"===l.target?{type:"bigint"===m?"integer":m,enum:[u.value]}:{type:"bigint"===m?"integer":m,const:u.value}}m.r(l),m.d(l,{parseLiteralDef:function(){return parseLiteralDef}})},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/map.js":function(u,l,m){m.r(l),m.d(l,{parseMapDef:function(){return parseMapDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/record.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseMapDef(u,l){if("record"===l.mapStrategy)return(0,h.parseRecordDef)(u,l);return{type:"array",maxItems:125,items:{type:"array",items:[(0,f.parseDef)(u.keyType._def,{...l,currentPath:[...l.currentPath,"items","items","0"]})||(0,y.parseAnyDef)(l),(0,f.parseDef)(u.valueType._def,{...l,currentPath:[...l.currentPath,"items","items","1"]})||(0,y.parseAnyDef)(l)],minItems:2,maxItems:2}}}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js":function(u,l,m){function parseNativeEnumDef(u){const l=u.values,m=Object.keys(u.values).filter(u=>"number"!=typeof l[l[u]]).map(u=>l[u]),f=Array.from(new Set(m.map(u=>typeof u)));return{type:1===f.length?"string"===f[0]?"string":"number":["string","number"],enum:m}}m.r(l),m.d(l,{parseNativeEnumDef:function(){return parseNativeEnumDef}})},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/never.js":function(u,l,m){m.r(l),m.d(l,{parseNeverDef:function(){return parseNeverDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseNeverDef(u){return"openAi"===u.target?void 0:{not:(0,f.parseAnyDef)({...u,currentPath:[...u.currentPath,"not"]})}}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/null.js":function(u,l,m){function parseNullDef(u){return"openApi3"===u.target?{enum:["null"],nullable:!0}:{type:"null"}}m.r(l),m.d(l,{parseNullDef:function(){return parseNullDef}})},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js":function(u,l,m){m.r(l),m.d(l,{parseNullableDef:function(){return parseNullableDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/union.js");function parseNullableDef(u,l){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(u.innerType._def.typeName)&&(!u.innerType._def.checks||!u.innerType._def.checks.length))return"openApi3"===l.target?{type:h.primitiveMappings[u.innerType._def.typeName],nullable:!0}:{type:[h.primitiveMappings[u.innerType._def.typeName],"null"]};if("openApi3"===l.target){const m=(0,f.parseDef)(u.innerType._def,{...l,currentPath:[...l.currentPath]});return m&&"$ref"in m?{allOf:[m],nullable:!0}:m&&{...m,nullable:!0}}const m=(0,f.parseDef)(u.innerType._def,{...l,currentPath:[...l.currentPath,"anyOf","0"]});return m&&{anyOf:[m,{type:"null"}]}}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/number.js":function(u,l,m){m.r(l),m.d(l,{parseNumberDef:function(){return parseNumberDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/errorMessages.js");function parseNumberDef(u,l){const m={type:"number"};if(!u.checks)return m;for(const h of u.checks)switch(h.kind){case"int":m.type="integer",(0,f.addErrorMessage)(m,"type",h.message,l);break;case"min":"jsonSchema7"===l.target?h.inclusive?(0,f.setResponseValueAndErrors)(m,"minimum",h.value,h.message,l):(0,f.setResponseValueAndErrors)(m,"exclusiveMinimum",h.value,h.message,l):(h.inclusive||(m.exclusiveMinimum=!0),(0,f.setResponseValueAndErrors)(m,"minimum",h.value,h.message,l));break;case"max":"jsonSchema7"===l.target?h.inclusive?(0,f.setResponseValueAndErrors)(m,"maximum",h.value,h.message,l):(0,f.setResponseValueAndErrors)(m,"exclusiveMaximum",h.value,h.message,l):(h.inclusive||(m.exclusiveMaximum=!0),(0,f.setResponseValueAndErrors)(m,"maximum",h.value,h.message,l));break;case"multipleOf":(0,f.setResponseValueAndErrors)(m,"multipleOf",h.value,h.message,l)}return m}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/object.js":function(u,l,m){m.r(l),m.d(l,{parseObjectDef:function(){return parseObjectDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parseObjectDef(u,l){const m="openAi"===l.target,h={type:"object",properties:{}},y=[],v=u.shape();for(const u in v){let w=v[u];if(void 0===w||void 0===w._def)continue;let b=safeIsOptional(w);b&&m&&("ZodOptional"===w._def.typeName&&(w=w._def.innerType),w.isNullable()||(w=w.nullable()),b=!1);const S=(0,f.parseDef)(w._def,{...l,currentPath:[...l.currentPath,"properties",u],propertyPath:[...l.currentPath,"properties",u]});void 0!==S&&(h.properties[u]=S,b||y.push(u))}y.length&&(h.required=y);const w=function decideAdditionalProperties(u,l){if("ZodNever"!==u.catchall._def.typeName)return(0,f.parseDef)(u.catchall._def,{...l,currentPath:[...l.currentPath,"additionalProperties"]});switch(u.unknownKeys){case"passthrough":return l.allowedAdditionalProperties;case"strict":return l.rejectedAdditionalProperties;case"strip":return"strict"===l.removeAdditionalStrategy?l.allowedAdditionalProperties:l.rejectedAdditionalProperties}}(u,l);return void 0!==w&&(h.additionalProperties=w),h}function safeIsOptional(u){try{return u.isOptional()}catch{return!0}}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js":function(u,l,m){m.r(l),m.d(l,{parseOptionalDef:function(){return parseOptionalDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");const parseOptionalDef=(u,l)=>{if(l.currentPath.toString()===l.propertyPath?.toString())return(0,f.parseDef)(u.innerType._def,l);const m=(0,f.parseDef)(u.innerType._def,{...l,currentPath:[...l.currentPath,"anyOf","1"]});return m?{anyOf:[{not:(0,h.parseAnyDef)(l)},m]}:(0,h.parseAnyDef)(l)}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js":function(u,l,m){m.r(l),m.d(l,{parsePipelineDef:function(){return parsePipelineDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");const parsePipelineDef=(u,l)=>{if("input"===l.pipeStrategy)return(0,f.parseDef)(u.in._def,l);if("output"===l.pipeStrategy)return(0,f.parseDef)(u.out._def,l);const m=(0,f.parseDef)(u.in._def,{...l,currentPath:[...l.currentPath,"allOf","0"]});return{allOf:[m,(0,f.parseDef)(u.out._def,{...l,currentPath:[...l.currentPath,"allOf",m?"1":"0"]})].filter(u=>void 0!==u)}}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js":function(u,l,m){m.r(l),m.d(l,{parsePromiseDef:function(){return parsePromiseDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parsePromiseDef(u,l){return(0,f.parseDef)(u.type._def,l)}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js":function(u,l,m){m.r(l),m.d(l,{parseReadonlyDef:function(){return parseReadonlyDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");const parseReadonlyDef=(u,l)=>(0,f.parseDef)(u.innerType._def,l)},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/record.js":function(u,l,m){m.r(l),m.d(l,{parseRecordDef:function(){return parseRecordDef}});var f=m("./node_modules/zod/v3/types.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/string.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js"),w=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseRecordDef(u,l){if("openAi"===l.target&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),"openApi3"===l.target&&u.keyType?._def.typeName===f.ZodFirstPartyTypeKind.ZodEnum)return{type:"object",required:u.keyType._def.values,properties:u.keyType._def.values.reduce((m,f)=>({...m,[f]:(0,h.parseDef)(u.valueType._def,{...l,currentPath:[...l.currentPath,"properties",f]})??(0,w.parseAnyDef)(l)}),{}),additionalProperties:l.rejectedAdditionalProperties};const m={type:"object",additionalProperties:(0,h.parseDef)(u.valueType._def,{...l,currentPath:[...l.currentPath,"additionalProperties"]})??l.allowedAdditionalProperties};if("openApi3"===l.target)return m;if(u.keyType?._def.typeName===f.ZodFirstPartyTypeKind.ZodString&&u.keyType._def.checks?.length){const{type:f,...h}=(0,y.parseStringDef)(u.keyType._def,l);return{...m,propertyNames:h}}if(u.keyType?._def.typeName===f.ZodFirstPartyTypeKind.ZodEnum)return{...m,propertyNames:{enum:u.keyType._def.values}};if(u.keyType?._def.typeName===f.ZodFirstPartyTypeKind.ZodBranded&&u.keyType._def.type._def.typeName===f.ZodFirstPartyTypeKind.ZodString&&u.keyType._def.type._def.checks?.length){const{type:f,...h}=(0,v.parseBrandedDef)(u.keyType._def,l);return{...m,propertyNames:h}}return m}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/set.js":function(u,l,m){m.r(l),m.d(l,{parseSetDef:function(){return parseSetDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/errorMessages.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parseSetDef(u,l){const m={type:"array",uniqueItems:!0,items:(0,h.parseDef)(u.valueType._def,{...l,currentPath:[...l.currentPath,"items"]})};return u.minSize&&(0,f.setResponseValueAndErrors)(m,"minItems",u.minSize.value,u.minSize.message,l),u.maxSize&&(0,f.setResponseValueAndErrors)(m,"maxItems",u.maxSize.value,u.maxSize.message,l),m}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/string.js":function(u,l,m){m.r(l),m.d(l,{parseStringDef:function(){return parseStringDef},zodPatterns:function(){return y}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/errorMessages.js");let h;const y={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:()=>(void 0===h&&(h=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),h),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-_]*$/};function parseStringDef(u,l){const m={type:"string"};if(u.checks)for(const h of u.checks)switch(h.kind){case"min":(0,f.setResponseValueAndErrors)(m,"minLength","number"==typeof m.minLength?Math.max(m.minLength,h.value):h.value,h.message,l);break;case"max":(0,f.setResponseValueAndErrors)(m,"maxLength","number"==typeof m.maxLength?Math.min(m.maxLength,h.value):h.value,h.message,l);break;case"email":switch(l.emailStrategy){case"format:email":addFormat(m,"email",h.message,l);break;case"format:idn-email":addFormat(m,"idn-email",h.message,l);break;case"pattern:zod":addPattern(m,y.email,h.message,l)}break;case"url":addFormat(m,"uri",h.message,l);break;case"uuid":addFormat(m,"uuid",h.message,l);break;case"regex":addPattern(m,h.regex,h.message,l);break;case"cuid":addPattern(m,y.cuid,h.message,l);break;case"cuid2":addPattern(m,y.cuid2,h.message,l);break;case"startsWith":addPattern(m,RegExp(`^${escapeLiteralCheckValue(h.value,l)}`),h.message,l);break;case"endsWith":addPattern(m,RegExp(`${escapeLiteralCheckValue(h.value,l)}$`),h.message,l);break;case"datetime":addFormat(m,"date-time",h.message,l);break;case"date":addFormat(m,"date",h.message,l);break;case"time":addFormat(m,"time",h.message,l);break;case"duration":addFormat(m,"duration",h.message,l);break;case"length":(0,f.setResponseValueAndErrors)(m,"minLength","number"==typeof m.minLength?Math.max(m.minLength,h.value):h.value,h.message,l),(0,f.setResponseValueAndErrors)(m,"maxLength","number"==typeof m.maxLength?Math.min(m.maxLength,h.value):h.value,h.message,l);break;case"includes":addPattern(m,RegExp(escapeLiteralCheckValue(h.value,l)),h.message,l);break;case"ip":"v6"!==h.version&&addFormat(m,"ipv4",h.message,l),"v4"!==h.version&&addFormat(m,"ipv6",h.message,l);break;case"base64url":addPattern(m,y.base64url,h.message,l);break;case"jwt":addPattern(m,y.jwt,h.message,l);break;case"cidr":"v6"!==h.version&&addPattern(m,y.ipv4Cidr,h.message,l),"v4"!==h.version&&addPattern(m,y.ipv6Cidr,h.message,l);break;case"emoji":addPattern(m,y.emoji(),h.message,l);break;case"ulid":addPattern(m,y.ulid,h.message,l);break;case"base64":switch(l.base64Strategy){case"format:binary":addFormat(m,"binary",h.message,l);break;case"contentEncoding:base64":(0,f.setResponseValueAndErrors)(m,"contentEncoding","base64",h.message,l);break;case"pattern:zod":addPattern(m,y.base64,h.message,l)}break;case"nanoid":addPattern(m,y.nanoid,h.message,l);case"toLowerCase":case"toUpperCase":case"trim":break;default:(()=>{})()}return m}function escapeLiteralCheckValue(u,l){return"escape"===l.patternStrategy?function escapeNonAlphaNumeric(u){let l="";for(let m=0;m<u.length;m++)v.has(u[m])||(l+="\\"),l+=u[m];return l}(u):u}const v=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function addFormat(u,l,m,h){u.format||u.anyOf?.some(u=>u.format)?(u.anyOf||(u.anyOf=[]),u.format&&(u.anyOf.push({format:u.format,...u.errorMessage&&h.errorMessages&&{errorMessage:{format:u.errorMessage.format}}}),delete u.format,u.errorMessage&&(delete u.errorMessage.format,0===Object.keys(u.errorMessage).length&&delete u.errorMessage)),u.anyOf.push({format:l,...m&&h.errorMessages&&{errorMessage:{format:m}}})):(0,f.setResponseValueAndErrors)(u,"format",l,m,h)}function addPattern(u,l,m,h){u.pattern||u.allOf?.some(u=>u.pattern)?(u.allOf||(u.allOf=[]),u.pattern&&(u.allOf.push({pattern:u.pattern,...u.errorMessage&&h.errorMessages&&{errorMessage:{pattern:u.errorMessage.pattern}}}),delete u.pattern,u.errorMessage&&(delete u.errorMessage.pattern,0===Object.keys(u.errorMessage).length&&delete u.errorMessage)),u.allOf.push({pattern:stringifyRegExpWithFlags(l,h),...m&&h.errorMessages&&{errorMessage:{pattern:m}}})):(0,f.setResponseValueAndErrors)(u,"pattern",stringifyRegExpWithFlags(l,h),m,h)}function stringifyRegExpWithFlags(u,l){if(!l.applyRegexFlags||!u.flags)return u.source;const m=u.flags.includes("i"),f=u.flags.includes("m"),h=u.flags.includes("s"),y=m?u.source.toLowerCase():u.source;let v="",w=!1,b=!1,S=!1;for(let u=0;u<y.length;u++)if(w)v+=y[u],w=!1;else{if(m)if(b){if(y[u].match(/[a-z]/)){S?(v+=y[u],v+=`${y[u-2]}-${y[u]}`.toUpperCase(),S=!1):"-"===y[u+1]&&y[u+2]?.match(/[a-z]/)?(v+=y[u],S=!0):v+=`${y[u]}${y[u].toUpperCase()}`;continue}}else if(y[u].match(/[a-z]/)){v+=`[${y[u]}${y[u].toUpperCase()}]`;continue}if(f){if("^"===y[u]){v+="(^|(?<=[\r\n]))";continue}if("$"===y[u]){v+="($|(?=[\r\n]))";continue}}h&&"."===y[u]?v+=b?`${y[u]}\r\n`:`[${y[u]}\r\n]`:(v+=y[u],"\\"===y[u]?w=!0:b&&"]"===y[u]?b=!1:b||"["!==y[u]||(b=!0))}try{new RegExp(v)}catch{return console.warn(`Could not convert regex pattern at ${l.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),u.source}return v}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js":function(u,l,m){m.r(l),m.d(l,{parseTupleDef:function(){return parseTupleDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parseTupleDef(u,l){return u.rest?{type:"array",minItems:u.items.length,items:u.items.map((u,m)=>(0,f.parseDef)(u._def,{...l,currentPath:[...l.currentPath,"items",`${m}`]})).reduce((u,l)=>void 0===l?u:[...u,l],[]),additionalItems:(0,f.parseDef)(u.rest._def,{...l,currentPath:[...l.currentPath,"additionalItems"]})}:{type:"array",minItems:u.items.length,maxItems:u.items.length,items:u.items.map((u,m)=>(0,f.parseDef)(u._def,{...l,currentPath:[...l.currentPath,"items",`${m}`]})).reduce((u,l)=>void 0===l?u:[...u,l],[])}}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js":function(u,l,m){m.r(l),m.d(l,{parseUndefinedDef:function(){return parseUndefinedDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseUndefinedDef(u){return{not:(0,f.parseAnyDef)(u)}}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/union.js":function(u,l,m){m.r(l),m.d(l,{parseUnionDef:function(){return parseUnionDef},primitiveMappings:function(){return h}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");const h={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function parseUnionDef(u,l){if("openApi3"===l.target)return asAnyOf(u,l);const m=u.options instanceof Map?Array.from(u.options.values()):u.options;if(m.every(u=>u._def.typeName in h&&(!u._def.checks||!u._def.checks.length))){const u=m.reduce((u,l)=>{const m=h[l._def.typeName];return m&&!u.includes(m)?[...u,m]:u},[]);return{type:u.length>1?u:u[0]}}if(m.every(u=>"ZodLiteral"===u._def.typeName&&!u.description)){const u=m.reduce((u,l)=>{const m=typeof l._def.value;switch(m){case"string":case"number":case"boolean":return[...u,m];case"bigint":return[...u,"integer"];case"object":if(null===l._def.value)return[...u,"null"];default:return u}},[]);if(u.length===m.length){const l=u.filter((u,l,m)=>m.indexOf(u)===l);return{type:l.length>1?l:l[0],enum:m.reduce((u,l)=>u.includes(l._def.value)?u:[...u,l._def.value],[])}}}else if(m.every(u=>"ZodEnum"===u._def.typeName))return{type:"string",enum:m.reduce((u,l)=>[...u,...l._def.values.filter(l=>!u.includes(l))],[])};return asAnyOf(u,l)}const asAnyOf=(u,l)=>{const m=(u.options instanceof Map?Array.from(u.options.values()):u.options).map((u,m)=>(0,f.parseDef)(u._def,{...l,currentPath:[...l.currentPath,"anyOf",`${m}`]})).filter(u=>!!u&&(!l.strictUnions||"object"==typeof u&&Object.keys(u).length>0));return m.length?{anyOf:m}:void 0}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js":function(u,l,m){m.r(l),m.d(l,{parseUnknownDef:function(){return parseUnknownDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseUnknownDef(u){return(0,f.parseAnyDef)(u)}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/selectParser.js":function(u,l,m){m.r(l),m.d(l,{selectParser:function(){return selectParser}});var f=m("./node_modules/zod/v3/types.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/any.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/array.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js"),w=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js"),b=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js"),S=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js"),$=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/date.js"),x=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/default.js"),j=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js"),E=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js"),R=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js"),C=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js"),Z=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/map.js"),z=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js"),A=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/never.js"),O=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/null.js"),N=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js"),D=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/number.js"),M=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/object.js"),U=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js"),L=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js"),F=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js"),V=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/record.js"),K=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/set.js"),H=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/string.js"),B=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js"),J=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js"),G=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/union.js"),W=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js"),Q=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js");const selectParser=(u,l,m)=>{switch(l){case f.ZodFirstPartyTypeKind.ZodString:return(0,H.parseStringDef)(u,m);case f.ZodFirstPartyTypeKind.ZodNumber:return(0,D.parseNumberDef)(u,m);case f.ZodFirstPartyTypeKind.ZodObject:return(0,M.parseObjectDef)(u,m);case f.ZodFirstPartyTypeKind.ZodBigInt:return(0,v.parseBigintDef)(u,m);case f.ZodFirstPartyTypeKind.ZodBoolean:return(0,w.parseBooleanDef)();case f.ZodFirstPartyTypeKind.ZodDate:return(0,$.parseDateDef)(u,m);case f.ZodFirstPartyTypeKind.ZodUndefined:return(0,J.parseUndefinedDef)(m);case f.ZodFirstPartyTypeKind.ZodNull:return(0,O.parseNullDef)(m);case f.ZodFirstPartyTypeKind.ZodArray:return(0,y.parseArrayDef)(u,m);case f.ZodFirstPartyTypeKind.ZodUnion:case f.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:return(0,G.parseUnionDef)(u,m);case f.ZodFirstPartyTypeKind.ZodIntersection:return(0,R.parseIntersectionDef)(u,m);case f.ZodFirstPartyTypeKind.ZodTuple:return(0,B.parseTupleDef)(u,m);case f.ZodFirstPartyTypeKind.ZodRecord:return(0,V.parseRecordDef)(u,m);case f.ZodFirstPartyTypeKind.ZodLiteral:return(0,C.parseLiteralDef)(u,m);case f.ZodFirstPartyTypeKind.ZodEnum:return(0,E.parseEnumDef)(u);case f.ZodFirstPartyTypeKind.ZodNativeEnum:return(0,z.parseNativeEnumDef)(u);case f.ZodFirstPartyTypeKind.ZodNullable:return(0,N.parseNullableDef)(u,m);case f.ZodFirstPartyTypeKind.ZodOptional:return(0,U.parseOptionalDef)(u,m);case f.ZodFirstPartyTypeKind.ZodMap:return(0,Z.parseMapDef)(u,m);case f.ZodFirstPartyTypeKind.ZodSet:return(0,K.parseSetDef)(u,m);case f.ZodFirstPartyTypeKind.ZodLazy:return()=>u.getter()._def;case f.ZodFirstPartyTypeKind.ZodPromise:return(0,F.parsePromiseDef)(u,m);case f.ZodFirstPartyTypeKind.ZodNaN:case f.ZodFirstPartyTypeKind.ZodNever:return(0,A.parseNeverDef)(m);case f.ZodFirstPartyTypeKind.ZodEffects:return(0,j.parseEffectsDef)(u,m);case f.ZodFirstPartyTypeKind.ZodAny:return(0,h.parseAnyDef)(m);case f.ZodFirstPartyTypeKind.ZodUnknown:return(0,W.parseUnknownDef)(m);case f.ZodFirstPartyTypeKind.ZodDefault:return(0,x.parseDefaultDef)(u,m);case f.ZodFirstPartyTypeKind.ZodBranded:return(0,b.parseBrandedDef)(u,m);case f.ZodFirstPartyTypeKind.ZodReadonly:return(0,Q.parseReadonlyDef)(u,m);case f.ZodFirstPartyTypeKind.ZodCatch:return(0,S.parseCatchDef)(u,m);case f.ZodFirstPartyTypeKind.ZodPipeline:return(0,L.parsePipelineDef)(u,m);case f.ZodFirstPartyTypeKind.ZodFunction:case f.ZodFirstPartyTypeKind.ZodVoid:case f.ZodFirstPartyTypeKind.ZodSymbol:default:return}}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js":function(u,l,m){m.r(l),m.d(l,{zodToJsonSchema:function(){return zodToJsonSchema}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/Refs.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");const zodToJsonSchema=(u,l)=>{const m=(0,h.getRefs)(l);let v="object"==typeof l&&l.definitions?Object.entries(l.definitions).reduce((u,[l,h])=>({...u,[l]:(0,f.parseDef)(h._def,{...m,currentPath:[...m.basePath,m.definitionPath,l]},!0)??(0,y.parseAnyDef)(m)}),{}):void 0;const w="string"==typeof l?l:"title"===l?.nameStrategy?void 0:l?.name,b=(0,f.parseDef)(u._def,void 0===w?m:{...m,currentPath:[...m.basePath,m.definitionPath,w]},!1)??(0,y.parseAnyDef)(m),S="object"==typeof l&&void 0!==l.name&&"title"===l.nameStrategy?l.name:void 0;void 0!==S&&(b.title=S),m.flags.hasReferencedOpenAiAnyType&&(v||(v={}),v[m.openAiAnyTypeName]||(v[m.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:"relative"===m.$refStrategy?"1":[...m.basePath,m.definitionPath,m.openAiAnyTypeName].join("/")}}));const $=void 0===w?v?{...b,[m.definitionPath]:v}:b:{$ref:[..."relative"===m.$refStrategy?[]:m.basePath,m.definitionPath,w].join("/"),[m.definitionPath]:{...v,[w]:b}};return"jsonSchema7"===m.target?$.$schema="http://json-schema.org/draft-07/schema#":"jsonSchema2019-09"!==m.target&&"openAi"!==m.target||($.$schema="https://json-schema.org/draft/2019-09/schema#"),"openAi"===m.target&&("anyOf"in $||"oneOf"in $||"allOf"in $||"type"in $&&Array.isArray($.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),$}},"./node_modules/fast-deep-equal/index.js":function(u){u.exports=function equal(u,l){if(u===l)return!0;if(u&&l&&"object"==typeof u&&"object"==typeof l){if(u.constructor!==l.constructor)return!1;var m,f,h;if(Array.isArray(u)){if((m=u.length)!=l.length)return!1;for(f=m;0!==f--;)if(!equal(u[f],l[f]))return!1;return!0}if(u.constructor===RegExp)return u.source===l.source&&u.flags===l.flags;if(u.valueOf!==Object.prototype.valueOf)return u.valueOf()===l.valueOf();if(u.toString!==Object.prototype.toString)return u.toString()===l.toString();if((m=(h=Object.keys(u)).length)!==Object.keys(l).length)return!1;for(f=m;0!==f--;)if(!Object.prototype.hasOwnProperty.call(l,h[f]))return!1;for(f=m;0!==f--;){var y=h[f];if(!equal(u[y],l[y]))return!1}return!0}return u!=u&&l!=l}},"./node_modules/fast-uri/index.js":function(u,l,m){const{normalizeIPv6:f,removeDotSegments:h,recomposeAuthority:y,normalizeComponentEncoding:v,isIPv4:w,nonSimpleDomain:b}=m("./node_modules/fast-uri/lib/utils.js"),{SCHEMES:S,getSchemeHandler:$}=m("./node_modules/fast-uri/lib/schemes.js");function resolveComponent(u,l,m,f){const y={};return f||(u=parse(serialize(u,m),m),l=parse(serialize(l,m),m)),!(m=m||{}).tolerant&&l.scheme?(y.scheme=l.scheme,y.userinfo=l.userinfo,y.host=l.host,y.port=l.port,y.path=h(l.path||""),y.query=l.query):(void 0!==l.userinfo||void 0!==l.host||void 0!==l.port?(y.userinfo=l.userinfo,y.host=l.host,y.port=l.port,y.path=h(l.path||""),y.query=l.query):(l.path?("/"===l.path[0]?y.path=h(l.path):(void 0===u.userinfo&&void 0===u.host&&void 0===u.port||u.path?u.path?y.path=u.path.slice(0,u.path.lastIndexOf("/")+1)+l.path:y.path=l.path:y.path="/"+l.path,y.path=h(y.path)),y.query=l.query):(y.path=u.path,void 0!==l.query?y.query=l.query:y.query=u.query),y.userinfo=u.userinfo,y.host=u.host,y.port=u.port),y.scheme=u.scheme),y.fragment=l.fragment,y}function serialize(u,l){const m={host:u.host,scheme:u.scheme,userinfo:u.userinfo,port:u.port,path:u.path,query:u.query,nid:u.nid,nss:u.nss,uuid:u.uuid,fragment:u.fragment,reference:u.reference,resourceName:u.resourceName,secure:u.secure,error:""},f=Object.assign({},l),v=[],w=$(f.scheme||m.scheme);w&&w.serialize&&w.serialize(m,f),void 0!==m.path&&(f.skipEscape?m.path=unescape(m.path):(m.path=escape(m.path),void 0!==m.scheme&&(m.path=m.path.split("%3A").join(":")))),"suffix"!==f.reference&&m.scheme&&v.push(m.scheme,":");const b=y(m);if(void 0!==b&&("suffix"!==f.reference&&v.push("//"),v.push(b),m.path&&"/"!==m.path[0]&&v.push("/")),void 0!==m.path){let u=m.path;f.absolutePath||w&&w.absolutePath||(u=h(u)),void 0===b&&"/"===u[0]&&"/"===u[1]&&(u="/%2F"+u.slice(2)),v.push(u)}return void 0!==m.query&&v.push("?",m.query),void 0!==m.fragment&&v.push("#",m.fragment),v.join("")}const x=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function parse(u,l){const m=Object.assign({},l),h={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let y=!1;"suffix"===m.reference&&(u=m.scheme?m.scheme+":"+u:"//"+u);const v=u.match(x);if(v){if(h.scheme=v[1],h.userinfo=v[3],h.host=v[4],h.port=parseInt(v[5],10),h.path=v[6]||"",h.query=v[7],h.fragment=v[8],isNaN(h.port)&&(h.port=v[5]),h.host){if(!1===w(h.host)){const u=f(h.host);h.host=u.host.toLowerCase(),y=u.isIPV6}else y=!0}void 0!==h.scheme||void 0!==h.userinfo||void 0!==h.host||void 0!==h.port||void 0!==h.query||h.path?void 0===h.scheme?h.reference="relative":void 0===h.fragment?h.reference="absolute":h.reference="uri":h.reference="same-document",m.reference&&"suffix"!==m.reference&&m.reference!==h.reference&&(h.error=h.error||"URI is not a "+m.reference+" reference.");const l=$(m.scheme||h.scheme);if(!(m.unicodeSupport||l&&l.unicodeSupport)&&h.host&&(m.domainHost||l&&l.domainHost)&&!1===y&&b(h.host))try{h.host=URL.domainToASCII(h.host.toLowerCase())}catch(u){h.error=h.error||"Host's domain name can not be converted to ASCII: "+u}(!l||l&&!l.skipNormalize)&&(-1!==u.indexOf("%")&&(void 0!==h.scheme&&(h.scheme=unescape(h.scheme)),void 0!==h.host&&(h.host=unescape(h.host))),h.path&&(h.path=escape(unescape(h.path))),h.fragment&&(h.fragment=encodeURI(decodeURIComponent(h.fragment)))),l&&l.parse&&l.parse(h,m)}else h.error=h.error||"URI can not be parsed.";return h}const j={SCHEMES:S,normalize:function normalize(u,l){return"string"==typeof u?u=serialize(parse(u,l),l):"object"==typeof u&&(u=parse(serialize(u,l),l)),u},resolve:function resolve(u,l,m){const f=m?Object.assign({scheme:"null"},m):{scheme:"null"},h=resolveComponent(parse(u,f),parse(l,f),f,!0);return f.skipEscape=!0,serialize(h,f)},resolveComponent:resolveComponent,equal:function equal(u,l,m){return"string"==typeof u?(u=unescape(u),u=serialize(v(parse(u,m),!0),{...m,skipEscape:!0})):"object"==typeof u&&(u=serialize(v(u,!0),{...m,skipEscape:!0})),"string"==typeof l?(l=unescape(l),l=serialize(v(parse(l,m),!0),{...m,skipEscape:!0})):"object"==typeof l&&(l=serialize(v(l,!0),{...m,skipEscape:!0})),u.toLowerCase()===l.toLowerCase()},serialize:serialize,parse:parse};u.exports=j,u.exports.default=j,u.exports.fastUri=j},"./node_modules/fast-uri/lib/schemes.js":function(u,l,m){const{isUUID:f}=m("./node_modules/fast-uri/lib/utils.js"),h=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,y=["http","https","ws","wss","urn","urn:uuid"];function wsIsSecure(u){return!0===u.secure||!1!==u.secure&&(!!u.scheme&&!(3!==u.scheme.length||"w"!==u.scheme[0]&&"W"!==u.scheme[0]||"s"!==u.scheme[1]&&"S"!==u.scheme[1]||"s"!==u.scheme[2]&&"S"!==u.scheme[2]))}function httpParse(u){return u.host||(u.error=u.error||"HTTP URIs must have a host."),u}function httpSerialize(u){const l="https"===String(u.scheme).toLowerCase();return u.port!==(l?443:80)&&""!==u.port||(u.port=void 0),u.path||(u.path="/"),u}const v={scheme:"http",domainHost:!0,parse:httpParse,serialize:httpSerialize},w={scheme:"ws",domainHost:!0,parse:function wsParse(u){return u.secure=wsIsSecure(u),u.resourceName=(u.path||"/")+(u.query?"?"+u.query:""),u.path=void 0,u.query=void 0,u},serialize:function wsSerialize(u){if(u.port!==(wsIsSecure(u)?443:80)&&""!==u.port||(u.port=void 0),"boolean"==typeof u.secure&&(u.scheme=u.secure?"wss":"ws",u.secure=void 0),u.resourceName){const[l,m]=u.resourceName.split("?");u.path=l&&"/"!==l?l:void 0,u.query=m,u.resourceName=void 0}return u.fragment=void 0,u}},b={http:v,https:{scheme:"https",domainHost:v.domainHost,parse:httpParse,serialize:httpSerialize},ws:w,wss:{scheme:"wss",domainHost:w.domainHost,parse:w.parse,serialize:w.serialize},urn:{scheme:"urn",parse:function urnParse(u,l){if(!u.path)return u.error="URN can not be parsed",u;const m=u.path.match(h);if(m){const f=l.scheme||u.scheme||"urn";u.nid=m[1].toLowerCase(),u.nss=m[2];const h=getSchemeHandler(`${f}:${l.nid||u.nid}`);u.path=void 0,h&&(u=h.parse(u,l))}else u.error=u.error||"URN can not be parsed.";return u},serialize:function urnSerialize(u,l){if(void 0===u.nid)throw new Error("URN without nid cannot be serialized");const m=l.scheme||u.scheme||"urn",f=u.nid.toLowerCase(),h=getSchemeHandler(`${m}:${l.nid||f}`);h&&(u=h.serialize(u,l));const y=u,v=u.nss;return y.path=`${f||l.nid}:${v}`,l.skipEscape=!0,y},skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:function urnuuidParse(u,l){const m=u;return m.uuid=m.nss,m.nss=void 0,l.tolerant||m.uuid&&f(m.uuid)||(m.error=m.error||"UUID is not valid."),m},serialize:function urnuuidSerialize(u){const l=u;return l.nss=(u.uuid||"").toLowerCase(),l},skipNormalize:!0}};function getSchemeHandler(u){return u&&(b[u]||b[u.toLowerCase()])||void 0}Object.setPrototypeOf(b,null),u.exports={wsIsSecure:wsIsSecure,SCHEMES:b,isValidSchemeName:function isValidSchemeName(u){return-1!==y.indexOf(u)},getSchemeHandler:getSchemeHandler}},"./node_modules/fast-uri/lib/utils.js":function(u){const l=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),m=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 stringArrayToHexStripped(u){let l="",m=0,f=0;for(f=0;f<u.length;f++)if(m=u[f].charCodeAt(0),48!==m){if(!(m>=48&&m<=57||m>=65&&m<=70||m>=97&&m<=102))return"";l+=u[f];break}for(f+=1;f<u.length;f++){if(m=u[f].charCodeAt(0),!(m>=48&&m<=57||m>=65&&m<=70||m>=97&&m<=102))return"";l+=u[f]}return l}const f=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function consumeIsZone(u){return u.length=0,!0}function consumeHextets(u,l,m){if(u.length){const f=stringArrayToHexStripped(u);if(""===f)return m.error=!0,!1;l.push(f),u.length=0}return!0}function normalizeIPv6(u){if(function findToken(u,l){let m=0;for(let f=0;f<u.length;f++)u[f]===l&&m++;return m}(u,":")<2)return{host:u,isIPV6:!1};const l=function getIPV6(u){let l=0;const m={error:!1,address:"",zone:""},f=[],h=[];let y=!1,v=!1,w=consumeHextets;for(let b=0;b<u.length;b++){const S=u[b];if("["!==S&&"]"!==S)if(":"!==S)if("%"===S){if(!w(h,f,m))break;w=consumeIsZone}else h.push(S);else{if(!0===y&&(v=!0),!w(h,f,m))break;if(++l>7){m.error=!0;break}b>0&&":"===u[b-1]&&(y=!0),f.push(":")}}return h.length&&(w===consumeIsZone?m.zone=h.join(""):v?f.push(h.join("")):f.push(stringArrayToHexStripped(h))),m.address=f.join(""),m}(u);if(l.error)return{host:u,isIPV6:!1};{let u=l.address,m=l.address;return l.zone&&(u+="%"+l.zone,m+="%25"+l.zone),{host:u,isIPV6:!0,escapedHost:m}}}u.exports={nonSimpleDomain:f,recomposeAuthority:function recomposeAuthority(u){const l=[];if(void 0!==u.userinfo&&(l.push(u.userinfo),l.push("@")),void 0!==u.host){let f=unescape(u.host);if(!m(f)){const l=normalizeIPv6(f);f=!0===l.isIPV6?`[${l.escapedHost}]`:u.host}l.push(f)}return"number"!=typeof u.port&&"string"!=typeof u.port||(l.push(":"),l.push(String(u.port))),l.length?l.join(""):void 0},normalizeComponentEncoding:function normalizeComponentEncoding(u,l){const m=!0!==l?escape:unescape;return void 0!==u.scheme&&(u.scheme=m(u.scheme)),void 0!==u.userinfo&&(u.userinfo=m(u.userinfo)),void 0!==u.host&&(u.host=m(u.host)),void 0!==u.path&&(u.path=m(u.path)),void 0!==u.query&&(u.query=m(u.query)),void 0!==u.fragment&&(u.fragment=m(u.fragment)),u},removeDotSegments:function removeDotSegments(u){let l=u;const m=[];let f=-1,h=0;for(;h=l.length;){if(1===h){if("."===l)break;if("/"===l){m.push("/");break}m.push(l);break}if(2===h){if("."===l[0]){if("."===l[1])break;if("/"===l[1]){l=l.slice(2);continue}}else if("/"===l[0]&&("."===l[1]||"/"===l[1])){m.push("/");break}}else if(3===h&&"/.."===l){0!==m.length&&m.pop(),m.push("/");break}if("."===l[0]){if("."===l[1]){if("/"===l[2]){l=l.slice(3);continue}}else if("/"===l[1]){l=l.slice(2);continue}}else if("/"===l[0]&&"."===l[1]){if("/"===l[2]){l=l.slice(2);continue}if("."===l[2]&&"/"===l[3]){l=l.slice(3),0!==m.length&&m.pop();continue}}if(-1===(f=l.indexOf("/",1))){m.push(l);break}m.push(l.slice(0,f)),l=l.slice(f)}return m.join("")},isIPv4:m,isUUID:l,normalizeIPv6:normalizeIPv6,stringArrayToHexStripped:stringArrayToHexStripped}},"./node_modules/zod/v3/ZodError.js":function(u,l,m){m.r(l),m.d(l,{ZodError:function(){return ZodError},ZodIssueCode:function(){return h},quotelessJson:function(){return quotelessJson}});var f=m("./node_modules/zod/v3/helpers/util.js");const h=f.util.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"]),quotelessJson=u=>JSON.stringify(u,null,2).replace(/"([^"]+)":/g,"$1:");class ZodError extends Error{get errors(){return this.issues}constructor(u){super(),this.issues=[],this.addIssue=u=>{this.issues=[...this.issues,u]},this.addIssues=(u=[])=>{this.issues=[...this.issues,...u]};const l=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,l):this.__proto__=l,this.name="ZodError",this.issues=u}format(u){const l=u||function(u){return u.message},m={_errors:[]},processError=u=>{for(const f of u.issues)if("invalid_union"===f.code)f.unionErrors.map(processError);else if("invalid_return_type"===f.code)processError(f.returnTypeError);else if("invalid_arguments"===f.code)processError(f.argumentsError);else if(0===f.path.length)m._errors.push(l(f));else{let u=m,h=0;for(;h<f.path.length;){const m=f.path[h];h===f.path.length-1?(u[m]=u[m]||{_errors:[]},u[m]._errors.push(l(f))):u[m]=u[m]||{_errors:[]},u=u[m],h++}}};return processError(this),m}static assert(u){if(!(u instanceof ZodError))throw new Error(`Not a ZodError: ${u}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,f.util.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(u=u=>u.message){const l={},m=[];for(const f of this.issues)if(f.path.length>0){const m=f.path[0];l[m]=l[m]||[],l[m].push(u(f))}else m.push(u(f));return{formErrors:m,fieldErrors:l}}get formErrors(){return this.flatten()}}ZodError.create=u=>new ZodError(u)},"./node_modules/zod/v3/errors.js":function(u,l,m){m.r(l),m.d(l,{defaultErrorMap:function(){return f.default},getErrorMap:function(){return getErrorMap},setErrorMap:function(){return setErrorMap}});var f=m("./node_modules/zod/v3/locales/en.js");let h=f.default;function setErrorMap(u){h=u}function getErrorMap(){return h}},"./node_modules/zod/v3/helpers/errorUtil.js":function(u,l,m){var f;m.r(l),m.d(l,{errorUtil:function(){return f}}),function(u){u.errToObj=u=>"string"==typeof u?{message:u}:u||{},u.toString=u=>"string"==typeof u?u:u?.message}(f||(f={}))},"./node_modules/zod/v3/helpers/parseUtil.js":function(u,l,m){m.r(l),m.d(l,{DIRTY:function(){return DIRTY},EMPTY_PATH:function(){return y},INVALID:function(){return v},OK:function(){return OK},ParseStatus:function(){return ParseStatus},addIssueToContext:function(){return addIssueToContext},isAborted:function(){return isAborted},isAsync:function(){return isAsync},isDirty:function(){return isDirty},isValid:function(){return isValid},makeIssue:function(){return makeIssue}});var f=m("./node_modules/zod/v3/errors.js"),h=m("./node_modules/zod/v3/locales/en.js");const makeIssue=u=>{const{data:l,path:m,errorMaps:f,issueData:h}=u,y=[...m,...h.path||[]],v={...h,path:y};if(void 0!==h.message)return{...h,path:y,message:h.message};let w="";const b=f.filter(u=>!!u).slice().reverse();for(const u of b)w=u(v,{data:l,defaultError:w}).message;return{...h,path:y,message:w}},y=[];function addIssueToContext(u,l){const m=(0,f.getErrorMap)(),y=makeIssue({issueData:l,data:u.data,path:u.path,errorMaps:[u.common.contextualErrorMap,u.schemaErrorMap,m,m===h.default?void 0:h.default].filter(u=>!!u)});u.common.issues.push(y)}class ParseStatus{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(u,l){const m=[];for(const f of l){if("aborted"===f.status)return v;"dirty"===f.status&&u.dirty(),m.push(f.value)}return{status:u.value,value:m}}static async mergeObjectAsync(u,l){const m=[];for(const u of l){const l=await u.key,f=await u.value;m.push({key:l,value:f})}return ParseStatus.mergeObjectSync(u,m)}static mergeObjectSync(u,l){const m={};for(const f of l){const{key:l,value:h}=f;if("aborted"===l.status)return v;if("aborted"===h.status)return v;"dirty"===l.status&&u.dirty(),"dirty"===h.status&&u.dirty(),"__proto__"===l.value||void 0===h.value&&!f.alwaysSet||(m[l.value]=h.value)}return{status:u.value,value:m}}}const v=Object.freeze({status:"aborted"}),DIRTY=u=>({status:"dirty",value:u}),OK=u=>({status:"valid",value:u}),isAborted=u=>"aborted"===u.status,isDirty=u=>"dirty"===u.status,isValid=u=>"valid"===u.status,isAsync=u=>"undefined"!=typeof Promise&&u instanceof Promise},"./node_modules/zod/v3/helpers/util.js":function(u,l,m){var f,h;m.r(l),m.d(l,{ZodParsedType:function(){return y},getParsedType:function(){return getParsedType},objectUtil:function(){return h},util:function(){return f}}),function(u){u.assertEqual=u=>{},u.assertIs=function assertIs(u){},u.assertNever=function assertNever(u){throw new Error},u.arrayToEnum=u=>{const l={};for(const m of u)l[m]=m;return l},u.getValidEnumValues=l=>{const m=u.objectKeys(l).filter(u=>"number"!=typeof l[l[u]]),f={};for(const u of m)f[u]=l[u];return u.objectValues(f)},u.objectValues=l=>u.objectKeys(l).map(function(u){return l[u]}),u.objectKeys="function"==typeof Object.keys?u=>Object.keys(u):u=>{const l=[];for(const m in u)Object.prototype.hasOwnProperty.call(u,m)&&l.push(m);return l},u.find=(u,l)=>{for(const m of u)if(l(m))return m},u.isInteger="function"==typeof Number.isInteger?u=>Number.isInteger(u):u=>"number"==typeof u&&Number.isFinite(u)&&Math.floor(u)===u,u.joinValues=function joinValues(u,l=" | "){return u.map(u=>"string"==typeof u?`'${u}'`:u).join(l)},u.jsonStringifyReplacer=(u,l)=>"bigint"==typeof l?l.toString():l}(f||(f={})),function(u){u.mergeShapes=(u,l)=>({...u,...l})}(h||(h={}));const y=f.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),getParsedType=u=>{switch(typeof u){case"undefined":return y.undefined;case"string":return y.string;case"number":return Number.isNaN(u)?y.nan:y.number;case"boolean":return y.boolean;case"function":return y.function;case"bigint":return y.bigint;case"symbol":return y.symbol;case"object":return Array.isArray(u)?y.array:null===u?y.null:u.then&&"function"==typeof u.then&&u.catch&&"function"==typeof u.catch?y.promise:"undefined"!=typeof Map&&u instanceof Map?y.map:"undefined"!=typeof Set&&u instanceof Set?y.set:"undefined"!=typeof Date&&u instanceof Date?y.date:y.object;default:return y.unknown}}},"./node_modules/zod/v3/locales/en.js":function(u,l,m){m.r(l);var f=m("./node_modules/zod/v3/ZodError.js"),h=m("./node_modules/zod/v3/helpers/util.js");l.default=(u,l)=>{let m;switch(u.code){case f.ZodIssueCode.invalid_type:m=u.received===h.ZodParsedType.undefined?"Required":`Expected ${u.expected}, received ${u.received}`;break;case f.ZodIssueCode.invalid_literal:m=`Invalid literal value, expected ${JSON.stringify(u.expected,h.util.jsonStringifyReplacer)}`;break;case f.ZodIssueCode.unrecognized_keys:m=`Unrecognized key(s) in object: ${h.util.joinValues(u.keys,", ")}`;break;case f.ZodIssueCode.invalid_union:m="Invalid input";break;case f.ZodIssueCode.invalid_union_discriminator:m=`Invalid discriminator value. Expected ${h.util.joinValues(u.options)}`;break;case f.ZodIssueCode.invalid_enum_value:m=`Invalid enum value. Expected ${h.util.joinValues(u.options)}, received '${u.received}'`;break;case f.ZodIssueCode.invalid_arguments:m="Invalid function arguments";break;case f.ZodIssueCode.invalid_return_type:m="Invalid function return type";break;case f.ZodIssueCode.invalid_date:m="Invalid date";break;case f.ZodIssueCode.invalid_string:"object"==typeof u.validation?"includes"in u.validation?(m=`Invalid input: must include "${u.validation.includes}"`,"number"==typeof u.validation.position&&(m=`${m} at one or more positions greater than or equal to ${u.validation.position}`)):"startsWith"in u.validation?m=`Invalid input: must start with "${u.validation.startsWith}"`:"endsWith"in u.validation?m=`Invalid input: must end with "${u.validation.endsWith}"`:h.util.assertNever(u.validation):m="regex"!==u.validation?`Invalid ${u.validation}`:"Invalid";break;case f.ZodIssueCode.too_small:m="array"===u.type?`Array must contain ${u.exact?"exactly":u.inclusive?"at least":"more than"} ${u.minimum} element(s)`:"string"===u.type?`String must contain ${u.exact?"exactly":u.inclusive?"at least":"over"} ${u.minimum} character(s)`:"number"===u.type||"bigint"===u.type?`Number must be ${u.exact?"exactly equal to ":u.inclusive?"greater than or equal to ":"greater than "}${u.minimum}`:"date"===u.type?`Date must be ${u.exact?"exactly equal to ":u.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(u.minimum))}`:"Invalid input";break;case f.ZodIssueCode.too_big:m="array"===u.type?`Array must contain ${u.exact?"exactly":u.inclusive?"at most":"less than"} ${u.maximum} element(s)`:"string"===u.type?`String must contain ${u.exact?"exactly":u.inclusive?"at most":"under"} ${u.maximum} character(s)`:"number"===u.type?`Number must be ${u.exact?"exactly":u.inclusive?"less than or equal to":"less than"} ${u.maximum}`:"bigint"===u.type?`BigInt must be ${u.exact?"exactly":u.inclusive?"less than or equal to":"less than"} ${u.maximum}`:"date"===u.type?`Date must be ${u.exact?"exactly":u.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(u.maximum))}`:"Invalid input";break;case f.ZodIssueCode.custom:m="Invalid input";break;case f.ZodIssueCode.invalid_intersection_types:m="Intersection results could not be merged";break;case f.ZodIssueCode.not_multiple_of:m=`Number must be a multiple of ${u.multipleOf}`;break;case f.ZodIssueCode.not_finite:m="Number must be finite";break;default:m=l.defaultError,h.util.assertNever(u)}return{message:m}}},"./node_modules/zod/v3/types.js":function(u,l,m){m.r(l),m.d(l,{BRAND:function(){return V},NEVER:function(){return Ee},Schema:function(){return ZodType},ZodAny:function(){return ZodAny},ZodArray:function(){return ZodArray},ZodBigInt:function(){return ZodBigInt},ZodBoolean:function(){return ZodBoolean},ZodBranded:function(){return ZodBranded},ZodCatch:function(){return ZodCatch},ZodDate:function(){return ZodDate},ZodDefault:function(){return ZodDefault},ZodDiscriminatedUnion:function(){return ZodDiscriminatedUnion},ZodEffects:function(){return ZodEffects},ZodEnum:function(){return ZodEnum},ZodFirstPartyTypeKind:function(){return H},ZodFunction:function(){return ZodFunction},ZodIntersection:function(){return ZodIntersection},ZodLazy:function(){return ZodLazy},ZodLiteral:function(){return ZodLiteral},ZodMap:function(){return ZodMap},ZodNaN:function(){return ZodNaN},ZodNativeEnum:function(){return ZodNativeEnum},ZodNever:function(){return ZodNever},ZodNull:function(){return ZodNull},ZodNullable:function(){return ZodNullable},ZodNumber:function(){return ZodNumber},ZodObject:function(){return ZodObject},ZodOptional:function(){return ZodOptional},ZodPipeline:function(){return ZodPipeline},ZodPromise:function(){return ZodPromise},ZodReadonly:function(){return ZodReadonly},ZodRecord:function(){return ZodRecord},ZodSchema:function(){return ZodType},ZodSet:function(){return ZodSet},ZodString:function(){return ZodString},ZodSymbol:function(){return ZodSymbol},ZodTransformer:function(){return ZodEffects},ZodTuple:function(){return ZodTuple},ZodType:function(){return ZodType},ZodUndefined:function(){return ZodUndefined},ZodUnion:function(){return ZodUnion},ZodUnknown:function(){return ZodUnknown},ZodVoid:function(){return ZodVoid},any:function(){return ne},array:function(){return ie},bigint:function(){return W},boolean:function(){return Q},coerce:function(){return Te},custom:function(){return custom},date:function(){return Y},datetimeRegex:function(){return datetimeRegex},discriminatedUnion:function(){return ue},effect:function(){return ke},enum:function(){return ve},function:function(){return ge},instanceof:function(){return instanceOfType},intersection:function(){return le},late:function(){return K},lazy:function(){return _e},literal:function(){return ye},map:function(){return fe},nan:function(){return G},nativeEnum:function(){return we},never:function(){return oe},null:function(){return te},nullable:function(){return $e},number:function(){return J},object:function(){return ae},oboolean:function(){return oboolean},onumber:function(){return onumber},optional:function(){return Se},ostring:function(){return ostring},pipeline:function(){return je},preprocess:function(){return xe},promise:function(){return be},record:function(){return me},set:function(){return he},strictObject:function(){return ce},string:function(){return B},symbol:function(){return X},transformer:function(){return ke},tuple:function(){return pe},undefined:function(){return ee},union:function(){return de},unknown:function(){return re},void:function(){return se}});var f=m("./node_modules/zod/v3/ZodError.js"),h=m("./node_modules/zod/v3/errors.js"),y=m("./node_modules/zod/v3/locales/en.js"),v=m("./node_modules/zod/v3/helpers/errorUtil.js"),w=m("./node_modules/zod/v3/helpers/parseUtil.js"),b=m("./node_modules/zod/v3/helpers/util.js");class ParseInputLazyPath{constructor(u,l,m,f){this._cachedPath=[],this.parent=u,this.data=l,this._path=m,this._key=f}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}}const handleResult=(u,l)=>{if((0,w.isValid)(l))return{success:!0,data:l.value};if(!u.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const l=new f.ZodError(u.common.issues);return this._error=l,this._error}}};function processCreateParams(u){if(!u)return{};const{errorMap:l,invalid_type_error:m,required_error:f,description:h}=u;if(l&&(m||f))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(l)return{errorMap:l,description:h};return{errorMap:(l,h)=>{const{message:y}=u;return"invalid_enum_value"===l.code?{message:y??h.defaultError}:void 0===h.data?{message:y??f??h.defaultError}:"invalid_type"!==l.code?{message:h.defaultError}:{message:y??m??h.defaultError}},description:h}}class ZodType{get description(){return this._def.description}_getType(u){return(0,b.getParsedType)(u.data)}_getOrReturnCtx(u,l){return l||{common:u.parent.common,data:u.data,parsedType:(0,b.getParsedType)(u.data),schemaErrorMap:this._def.errorMap,path:u.path,parent:u.parent}}_processInputParams(u){return{status:new w.ParseStatus,ctx:{common:u.parent.common,data:u.data,parsedType:(0,b.getParsedType)(u.data),schemaErrorMap:this._def.errorMap,path:u.path,parent:u.parent}}}_parseSync(u){const l=this._parse(u);if((0,w.isAsync)(l))throw new Error("Synchronous parse encountered promise.");return l}_parseAsync(u){const l=this._parse(u);return Promise.resolve(l)}parse(u,l){const m=this.safeParse(u,l);if(m.success)return m.data;throw m.error}safeParse(u,l){const m={common:{issues:[],async:l?.async??!1,contextualErrorMap:l?.errorMap},path:l?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:u,parsedType:(0,b.getParsedType)(u)},f=this._parseSync({data:u,path:m.path,parent:m});return handleResult(m,f)}"~validate"(u){const l={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:u,parsedType:(0,b.getParsedType)(u)};if(!this["~standard"].async)try{const m=this._parseSync({data:u,path:[],parent:l});return(0,w.isValid)(m)?{value:m.value}:{issues:l.common.issues}}catch(u){u?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),l.common={issues:[],async:!0}}return this._parseAsync({data:u,path:[],parent:l}).then(u=>(0,w.isValid)(u)?{value:u.value}:{issues:l.common.issues})}async parseAsync(u,l){const m=await this.safeParseAsync(u,l);if(m.success)return m.data;throw m.error}async safeParseAsync(u,l){const m={common:{issues:[],contextualErrorMap:l?.errorMap,async:!0},path:l?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:u,parsedType:(0,b.getParsedType)(u)},f=this._parse({data:u,path:m.path,parent:m}),h=await((0,w.isAsync)(f)?f:Promise.resolve(f));return handleResult(m,h)}refine(u,l){const getIssueProperties=u=>"string"==typeof l||void 0===l?{message:l}:"function"==typeof l?l(u):l;return this._refinement((l,m)=>{const h=u(l),setError=()=>m.addIssue({code:f.ZodIssueCode.custom,...getIssueProperties(l)});return"undefined"!=typeof Promise&&h instanceof Promise?h.then(u=>!!u||(setError(),!1)):!!h||(setError(),!1)})}refinement(u,l){return this._refinement((m,f)=>!!u(m)||(f.addIssue("function"==typeof l?l(m,f):l),!1))}_refinement(u){return new ZodEffects({schema:this,typeName:H.ZodEffects,effect:{type:"refinement",refinement:u}})}superRefine(u){return this._refinement(u)}constructor(u){this.spa=this.safeParseAsync,this._def=u,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:u=>this["~validate"](u)}}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this)}promise(){return ZodPromise.create(this,this._def)}or(u){return ZodUnion.create([this,u],this._def)}and(u){return ZodIntersection.create(this,u,this._def)}transform(u){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:H.ZodEffects,effect:{type:"transform",transform:u}})}default(u){const l="function"==typeof u?u:()=>u;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:l,typeName:H.ZodDefault})}brand(){return new ZodBranded({typeName:H.ZodBranded,type:this,...processCreateParams(this._def)})}catch(u){const l="function"==typeof u?u:()=>u;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:l,typeName:H.ZodCatch})}describe(u){return new(0,this.constructor)({...this._def,description:u})}pipe(u){return ZodPipeline.create(this,u)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const S=/^c[^\s-]{8,}$/i,$=/^[0-9a-z]+$/,x=/^[0-9A-HJKMNP-TV-Z]{26}$/i,j=/^[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,E=/^[a-z0-9_-]{21}$/i,R=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,C=/^[-+]?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)?)??$/,Z=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let z;const A=/^(?:(?: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])$/,O=/^(?:(?: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])$/,N=/^(([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]))$/,D=/^(([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])$/,M=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,U=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,L="((\\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])))",F=new RegExp(`^${L}$`);function timeRegexSource(u){let l="[0-5]\\d";u.precision?l=`${l}\\.\\d{${u.precision}}`:null==u.precision&&(l=`${l}(\\.\\d+)?`);return`([01]\\d|2[0-3]):[0-5]\\d(:${l})${u.precision?"+":"?"}`}function timeRegex(u){return new RegExp(`^${timeRegexSource(u)}$`)}function datetimeRegex(u){let l=`${L}T${timeRegexSource(u)}`;const m=[];return m.push(u.local?"Z?":"Z"),u.offset&&m.push("([+-]\\d{2}:?\\d{2})"),l=`${l}(${m.join("|")})`,new RegExp(`^${l}$`)}function isValidIP(u,l){return!("v4"!==l&&l||!A.test(u))||!("v6"!==l&&l||!N.test(u))}function isValidJWT(u,l){if(!R.test(u))return!1;try{const[m]=u.split(".");if(!m)return!1;const f=m.replace(/-/g,"+").replace(/_/g,"/").padEnd(m.length+(4-m.length%4)%4,"="),h=JSON.parse(atob(f));return"object"==typeof h&&null!==h&&((!("typ"in h)||"JWT"===h?.typ)&&(!!h.alg&&(!l||h.alg===l)))}catch{return!1}}function isValidCidr(u,l){return!("v4"!==l&&l||!O.test(u))||!("v6"!==l&&l||!D.test(u))}class ZodString extends ZodType{_parse(u){this._def.coerce&&(u.data=String(u.data));if(this._getType(u)!==b.ZodParsedType.string){const l=this._getOrReturnCtx(u);return(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.string,received:l.parsedType}),w.INVALID}const l=new w.ParseStatus;let m;for(const h of this._def.checks)if("min"===h.kind)u.data.length<h.value&&(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{code:f.ZodIssueCode.too_small,minimum:h.value,type:"string",inclusive:!0,exact:!1,message:h.message}),l.dirty());else if("max"===h.kind)u.data.length>h.value&&(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{code:f.ZodIssueCode.too_big,maximum:h.value,type:"string",inclusive:!0,exact:!1,message:h.message}),l.dirty());else if("length"===h.kind){const y=u.data.length>h.value,v=u.data.length<h.value;(y||v)&&(m=this._getOrReturnCtx(u,m),y?(0,w.addIssueToContext)(m,{code:f.ZodIssueCode.too_big,maximum:h.value,type:"string",inclusive:!0,exact:!0,message:h.message}):v&&(0,w.addIssueToContext)(m,{code:f.ZodIssueCode.too_small,minimum:h.value,type:"string",inclusive:!0,exact:!0,message:h.message}),l.dirty())}else if("email"===h.kind)Z.test(u.data)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{validation:"email",code:f.ZodIssueCode.invalid_string,message:h.message}),l.dirty());else if("emoji"===h.kind)z||(z=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),z.test(u.data)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{validation:"emoji",code:f.ZodIssueCode.invalid_string,message:h.message}),l.dirty());else if("uuid"===h.kind)j.test(u.data)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{validation:"uuid",code:f.ZodIssueCode.invalid_string,message:h.message}),l.dirty());else if("nanoid"===h.kind)E.test(u.data)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{validation:"nanoid",code:f.ZodIssueCode.invalid_string,message:h.message}),l.dirty());else if("cuid"===h.kind)S.test(u.data)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{validation:"cuid",code:f.ZodIssueCode.invalid_string,message:h.message}),l.dirty());else if("cuid2"===h.kind)$.test(u.data)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{validation:"cuid2",code:f.ZodIssueCode.invalid_string,message:h.message}),l.dirty());else if("ulid"===h.kind)x.test(u.data)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{validation:"ulid",code:f.ZodIssueCode.invalid_string,message:h.message}),l.dirty());else if("url"===h.kind)try{new URL(u.data)}catch{m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{validation:"url",code:f.ZodIssueCode.invalid_string,message:h.message}),l.dirty()}else if("regex"===h.kind){h.regex.lastIndex=0;h.regex.test(u.data)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{validation:"regex",code:f.ZodIssueCode.invalid_string,message:h.message}),l.dirty())}else if("trim"===h.kind)u.data=u.data.trim();else if("includes"===h.kind)u.data.includes(h.value,h.position)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{code:f.ZodIssueCode.invalid_string,validation:{includes:h.value,position:h.position},message:h.message}),l.dirty());else if("toLowerCase"===h.kind)u.data=u.data.toLowerCase();else if("toUpperCase"===h.kind)u.data=u.data.toUpperCase();else if("startsWith"===h.kind)u.data.startsWith(h.value)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{code:f.ZodIssueCode.invalid_string,validation:{startsWith:h.value},message:h.message}),l.dirty());else if("endsWith"===h.kind)u.data.endsWith(h.value)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{code:f.ZodIssueCode.invalid_string,validation:{endsWith:h.value},message:h.message}),l.dirty());else if("datetime"===h.kind){datetimeRegex(h).test(u.data)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{code:f.ZodIssueCode.invalid_string,validation:"datetime",message:h.message}),l.dirty())}else if("date"===h.kind){F.test(u.data)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{code:f.ZodIssueCode.invalid_string,validation:"date",message:h.message}),l.dirty())}else if("time"===h.kind){timeRegex(h).test(u.data)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{code:f.ZodIssueCode.invalid_string,validation:"time",message:h.message}),l.dirty())}else"duration"===h.kind?C.test(u.data)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{validation:"duration",code:f.ZodIssueCode.invalid_string,message:h.message}),l.dirty()):"ip"===h.kind?isValidIP(u.data,h.version)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{validation:"ip",code:f.ZodIssueCode.invalid_string,message:h.message}),l.dirty()):"jwt"===h.kind?isValidJWT(u.data,h.alg)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{validation:"jwt",code:f.ZodIssueCode.invalid_string,message:h.message}),l.dirty()):"cidr"===h.kind?isValidCidr(u.data,h.version)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{validation:"cidr",code:f.ZodIssueCode.invalid_string,message:h.message}),l.dirty()):"base64"===h.kind?M.test(u.data)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{validation:"base64",code:f.ZodIssueCode.invalid_string,message:h.message}),l.dirty()):"base64url"===h.kind?U.test(u.data)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{validation:"base64url",code:f.ZodIssueCode.invalid_string,message:h.message}),l.dirty()):b.util.assertNever(h);return{status:l.value,value:u.data}}_regex(u,l,m){return this.refinement(l=>u.test(l),{validation:l,code:f.ZodIssueCode.invalid_string,...v.errorUtil.errToObj(m)})}_addCheck(u){return new ZodString({...this._def,checks:[...this._def.checks,u]})}email(u){return this._addCheck({kind:"email",...v.errorUtil.errToObj(u)})}url(u){return this._addCheck({kind:"url",...v.errorUtil.errToObj(u)})}emoji(u){return this._addCheck({kind:"emoji",...v.errorUtil.errToObj(u)})}uuid(u){return this._addCheck({kind:"uuid",...v.errorUtil.errToObj(u)})}nanoid(u){return this._addCheck({kind:"nanoid",...v.errorUtil.errToObj(u)})}cuid(u){return this._addCheck({kind:"cuid",...v.errorUtil.errToObj(u)})}cuid2(u){return this._addCheck({kind:"cuid2",...v.errorUtil.errToObj(u)})}ulid(u){return this._addCheck({kind:"ulid",...v.errorUtil.errToObj(u)})}base64(u){return this._addCheck({kind:"base64",...v.errorUtil.errToObj(u)})}base64url(u){return this._addCheck({kind:"base64url",...v.errorUtil.errToObj(u)})}jwt(u){return this._addCheck({kind:"jwt",...v.errorUtil.errToObj(u)})}ip(u){return this._addCheck({kind:"ip",...v.errorUtil.errToObj(u)})}cidr(u){return this._addCheck({kind:"cidr",...v.errorUtil.errToObj(u)})}datetime(u){return"string"==typeof u?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:u}):this._addCheck({kind:"datetime",precision:void 0===u?.precision?null:u?.precision,offset:u?.offset??!1,local:u?.local??!1,...v.errorUtil.errToObj(u?.message)})}date(u){return this._addCheck({kind:"date",message:u})}time(u){return"string"==typeof u?this._addCheck({kind:"time",precision:null,message:u}):this._addCheck({kind:"time",precision:void 0===u?.precision?null:u?.precision,...v.errorUtil.errToObj(u?.message)})}duration(u){return this._addCheck({kind:"duration",...v.errorUtil.errToObj(u)})}regex(u,l){return this._addCheck({kind:"regex",regex:u,...v.errorUtil.errToObj(l)})}includes(u,l){return this._addCheck({kind:"includes",value:u,position:l?.position,...v.errorUtil.errToObj(l?.message)})}startsWith(u,l){return this._addCheck({kind:"startsWith",value:u,...v.errorUtil.errToObj(l)})}endsWith(u,l){return this._addCheck({kind:"endsWith",value:u,...v.errorUtil.errToObj(l)})}min(u,l){return this._addCheck({kind:"min",value:u,...v.errorUtil.errToObj(l)})}max(u,l){return this._addCheck({kind:"max",value:u,...v.errorUtil.errToObj(l)})}length(u,l){return this._addCheck({kind:"length",value:u,...v.errorUtil.errToObj(l)})}nonempty(u){return this.min(1,v.errorUtil.errToObj(u))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(u=>"datetime"===u.kind)}get isDate(){return!!this._def.checks.find(u=>"date"===u.kind)}get isTime(){return!!this._def.checks.find(u=>"time"===u.kind)}get isDuration(){return!!this._def.checks.find(u=>"duration"===u.kind)}get isEmail(){return!!this._def.checks.find(u=>"email"===u.kind)}get isURL(){return!!this._def.checks.find(u=>"url"===u.kind)}get isEmoji(){return!!this._def.checks.find(u=>"emoji"===u.kind)}get isUUID(){return!!this._def.checks.find(u=>"uuid"===u.kind)}get isNANOID(){return!!this._def.checks.find(u=>"nanoid"===u.kind)}get isCUID(){return!!this._def.checks.find(u=>"cuid"===u.kind)}get isCUID2(){return!!this._def.checks.find(u=>"cuid2"===u.kind)}get isULID(){return!!this._def.checks.find(u=>"ulid"===u.kind)}get isIP(){return!!this._def.checks.find(u=>"ip"===u.kind)}get isCIDR(){return!!this._def.checks.find(u=>"cidr"===u.kind)}get isBase64(){return!!this._def.checks.find(u=>"base64"===u.kind)}get isBase64url(){return!!this._def.checks.find(u=>"base64url"===u.kind)}get minLength(){let u=null;for(const l of this._def.checks)"min"===l.kind&&(null===u||l.value>u)&&(u=l.value);return u}get maxLength(){let u=null;for(const l of this._def.checks)"max"===l.kind&&(null===u||l.value<u)&&(u=l.value);return u}}function floatSafeRemainder(u,l){const m=(u.toString().split(".")[1]||"").length,f=(l.toString().split(".")[1]||"").length,h=m>f?m:f;return Number.parseInt(u.toFixed(h).replace(".",""))%Number.parseInt(l.toFixed(h).replace(".",""))/10**h}ZodString.create=u=>new ZodString({checks:[],typeName:H.ZodString,coerce:u?.coerce??!1,...processCreateParams(u)});class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(u){this._def.coerce&&(u.data=Number(u.data));if(this._getType(u)!==b.ZodParsedType.number){const l=this._getOrReturnCtx(u);return(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.number,received:l.parsedType}),w.INVALID}let l;const m=new w.ParseStatus;for(const h of this._def.checks)if("int"===h.kind)b.util.isInteger(u.data)||(l=this._getOrReturnCtx(u,l),(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:h.message}),m.dirty());else if("min"===h.kind){(h.inclusive?u.data<h.value:u.data<=h.value)&&(l=this._getOrReturnCtx(u,l),(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.too_small,minimum:h.value,type:"number",inclusive:h.inclusive,exact:!1,message:h.message}),m.dirty())}else if("max"===h.kind){(h.inclusive?u.data>h.value:u.data>=h.value)&&(l=this._getOrReturnCtx(u,l),(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.too_big,maximum:h.value,type:"number",inclusive:h.inclusive,exact:!1,message:h.message}),m.dirty())}else"multipleOf"===h.kind?0!==floatSafeRemainder(u.data,h.value)&&(l=this._getOrReturnCtx(u,l),(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.not_multiple_of,multipleOf:h.value,message:h.message}),m.dirty()):"finite"===h.kind?Number.isFinite(u.data)||(l=this._getOrReturnCtx(u,l),(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.not_finite,message:h.message}),m.dirty()):b.util.assertNever(h);return{status:m.value,value:u.data}}gte(u,l){return this.setLimit("min",u,!0,v.errorUtil.toString(l))}gt(u,l){return this.setLimit("min",u,!1,v.errorUtil.toString(l))}lte(u,l){return this.setLimit("max",u,!0,v.errorUtil.toString(l))}lt(u,l){return this.setLimit("max",u,!1,v.errorUtil.toString(l))}setLimit(u,l,m,f){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:u,value:l,inclusive:m,message:v.errorUtil.toString(f)}]})}_addCheck(u){return new ZodNumber({...this._def,checks:[...this._def.checks,u]})}int(u){return this._addCheck({kind:"int",message:v.errorUtil.toString(u)})}positive(u){return this._addCheck({kind:"min",value:0,inclusive:!1,message:v.errorUtil.toString(u)})}negative(u){return this._addCheck({kind:"max",value:0,inclusive:!1,message:v.errorUtil.toString(u)})}nonpositive(u){return this._addCheck({kind:"max",value:0,inclusive:!0,message:v.errorUtil.toString(u)})}nonnegative(u){return this._addCheck({kind:"min",value:0,inclusive:!0,message:v.errorUtil.toString(u)})}multipleOf(u,l){return this._addCheck({kind:"multipleOf",value:u,message:v.errorUtil.toString(l)})}finite(u){return this._addCheck({kind:"finite",message:v.errorUtil.toString(u)})}safe(u){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:v.errorUtil.toString(u)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:v.errorUtil.toString(u)})}get minValue(){let u=null;for(const l of this._def.checks)"min"===l.kind&&(null===u||l.value>u)&&(u=l.value);return u}get maxValue(){let u=null;for(const l of this._def.checks)"max"===l.kind&&(null===u||l.value<u)&&(u=l.value);return u}get isInt(){return!!this._def.checks.find(u=>"int"===u.kind||"multipleOf"===u.kind&&b.util.isInteger(u.value))}get isFinite(){let u=null,l=null;for(const m of this._def.checks){if("finite"===m.kind||"int"===m.kind||"multipleOf"===m.kind)return!0;"min"===m.kind?(null===l||m.value>l)&&(l=m.value):"max"===m.kind&&(null===u||m.value<u)&&(u=m.value)}return Number.isFinite(l)&&Number.isFinite(u)}}ZodNumber.create=u=>new ZodNumber({checks:[],typeName:H.ZodNumber,coerce:u?.coerce||!1,...processCreateParams(u)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(u){if(this._def.coerce)try{u.data=BigInt(u.data)}catch{return this._getInvalidInput(u)}if(this._getType(u)!==b.ZodParsedType.bigint)return this._getInvalidInput(u);let l;const m=new w.ParseStatus;for(const h of this._def.checks)if("min"===h.kind){(h.inclusive?u.data<h.value:u.data<=h.value)&&(l=this._getOrReturnCtx(u,l),(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.too_small,type:"bigint",minimum:h.value,inclusive:h.inclusive,message:h.message}),m.dirty())}else if("max"===h.kind){(h.inclusive?u.data>h.value:u.data>=h.value)&&(l=this._getOrReturnCtx(u,l),(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.too_big,type:"bigint",maximum:h.value,inclusive:h.inclusive,message:h.message}),m.dirty())}else"multipleOf"===h.kind?u.data%h.value!==BigInt(0)&&(l=this._getOrReturnCtx(u,l),(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.not_multiple_of,multipleOf:h.value,message:h.message}),m.dirty()):b.util.assertNever(h);return{status:m.value,value:u.data}}_getInvalidInput(u){const l=this._getOrReturnCtx(u);return(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.bigint,received:l.parsedType}),w.INVALID}gte(u,l){return this.setLimit("min",u,!0,v.errorUtil.toString(l))}gt(u,l){return this.setLimit("min",u,!1,v.errorUtil.toString(l))}lte(u,l){return this.setLimit("max",u,!0,v.errorUtil.toString(l))}lt(u,l){return this.setLimit("max",u,!1,v.errorUtil.toString(l))}setLimit(u,l,m,f){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:u,value:l,inclusive:m,message:v.errorUtil.toString(f)}]})}_addCheck(u){return new ZodBigInt({...this._def,checks:[...this._def.checks,u]})}positive(u){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:v.errorUtil.toString(u)})}negative(u){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:v.errorUtil.toString(u)})}nonpositive(u){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:v.errorUtil.toString(u)})}nonnegative(u){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:v.errorUtil.toString(u)})}multipleOf(u,l){return this._addCheck({kind:"multipleOf",value:u,message:v.errorUtil.toString(l)})}get minValue(){let u=null;for(const l of this._def.checks)"min"===l.kind&&(null===u||l.value>u)&&(u=l.value);return u}get maxValue(){let u=null;for(const l of this._def.checks)"max"===l.kind&&(null===u||l.value<u)&&(u=l.value);return u}}ZodBigInt.create=u=>new ZodBigInt({checks:[],typeName:H.ZodBigInt,coerce:u?.coerce??!1,...processCreateParams(u)});class ZodBoolean extends ZodType{_parse(u){this._def.coerce&&(u.data=Boolean(u.data));if(this._getType(u)!==b.ZodParsedType.boolean){const l=this._getOrReturnCtx(u);return(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.boolean,received:l.parsedType}),w.INVALID}return(0,w.OK)(u.data)}}ZodBoolean.create=u=>new ZodBoolean({typeName:H.ZodBoolean,coerce:u?.coerce||!1,...processCreateParams(u)});class ZodDate extends ZodType{_parse(u){this._def.coerce&&(u.data=new Date(u.data));if(this._getType(u)!==b.ZodParsedType.date){const l=this._getOrReturnCtx(u);return(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.date,received:l.parsedType}),w.INVALID}if(Number.isNaN(u.data.getTime())){const l=this._getOrReturnCtx(u);return(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_date}),w.INVALID}const l=new w.ParseStatus;let m;for(const h of this._def.checks)"min"===h.kind?u.data.getTime()<h.value&&(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{code:f.ZodIssueCode.too_small,message:h.message,inclusive:!0,exact:!1,minimum:h.value,type:"date"}),l.dirty()):"max"===h.kind?u.data.getTime()>h.value&&(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{code:f.ZodIssueCode.too_big,message:h.message,inclusive:!0,exact:!1,maximum:h.value,type:"date"}),l.dirty()):b.util.assertNever(h);return{status:l.value,value:new Date(u.data.getTime())}}_addCheck(u){return new ZodDate({...this._def,checks:[...this._def.checks,u]})}min(u,l){return this._addCheck({kind:"min",value:u.getTime(),message:v.errorUtil.toString(l)})}max(u,l){return this._addCheck({kind:"max",value:u.getTime(),message:v.errorUtil.toString(l)})}get minDate(){let u=null;for(const l of this._def.checks)"min"===l.kind&&(null===u||l.value>u)&&(u=l.value);return null!=u?new Date(u):null}get maxDate(){let u=null;for(const l of this._def.checks)"max"===l.kind&&(null===u||l.value<u)&&(u=l.value);return null!=u?new Date(u):null}}ZodDate.create=u=>new ZodDate({checks:[],coerce:u?.coerce||!1,typeName:H.ZodDate,...processCreateParams(u)});class ZodSymbol extends ZodType{_parse(u){if(this._getType(u)!==b.ZodParsedType.symbol){const l=this._getOrReturnCtx(u);return(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.symbol,received:l.parsedType}),w.INVALID}return(0,w.OK)(u.data)}}ZodSymbol.create=u=>new ZodSymbol({typeName:H.ZodSymbol,...processCreateParams(u)});class ZodUndefined extends ZodType{_parse(u){if(this._getType(u)!==b.ZodParsedType.undefined){const l=this._getOrReturnCtx(u);return(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.undefined,received:l.parsedType}),w.INVALID}return(0,w.OK)(u.data)}}ZodUndefined.create=u=>new ZodUndefined({typeName:H.ZodUndefined,...processCreateParams(u)});class ZodNull extends ZodType{_parse(u){if(this._getType(u)!==b.ZodParsedType.null){const l=this._getOrReturnCtx(u);return(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.null,received:l.parsedType}),w.INVALID}return(0,w.OK)(u.data)}}ZodNull.create=u=>new ZodNull({typeName:H.ZodNull,...processCreateParams(u)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(u){return(0,w.OK)(u.data)}}ZodAny.create=u=>new ZodAny({typeName:H.ZodAny,...processCreateParams(u)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(u){return(0,w.OK)(u.data)}}ZodUnknown.create=u=>new ZodUnknown({typeName:H.ZodUnknown,...processCreateParams(u)});class ZodNever extends ZodType{_parse(u){const l=this._getOrReturnCtx(u);return(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.never,received:l.parsedType}),w.INVALID}}ZodNever.create=u=>new ZodNever({typeName:H.ZodNever,...processCreateParams(u)});class ZodVoid extends ZodType{_parse(u){if(this._getType(u)!==b.ZodParsedType.undefined){const l=this._getOrReturnCtx(u);return(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.void,received:l.parsedType}),w.INVALID}return(0,w.OK)(u.data)}}ZodVoid.create=u=>new ZodVoid({typeName:H.ZodVoid,...processCreateParams(u)});class ZodArray extends ZodType{_parse(u){const{ctx:l,status:m}=this._processInputParams(u),h=this._def;if(l.parsedType!==b.ZodParsedType.array)return(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.array,received:l.parsedType}),w.INVALID;if(null!==h.exactLength){const u=l.data.length>h.exactLength.value,y=l.data.length<h.exactLength.value;(u||y)&&((0,w.addIssueToContext)(l,{code:u?f.ZodIssueCode.too_big:f.ZodIssueCode.too_small,minimum:y?h.exactLength.value:void 0,maximum:u?h.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:h.exactLength.message}),m.dirty())}if(null!==h.minLength&&l.data.length<h.minLength.value&&((0,w.addIssueToContext)(l,{code:f.ZodIssueCode.too_small,minimum:h.minLength.value,type:"array",inclusive:!0,exact:!1,message:h.minLength.message}),m.dirty()),null!==h.maxLength&&l.data.length>h.maxLength.value&&((0,w.addIssueToContext)(l,{code:f.ZodIssueCode.too_big,maximum:h.maxLength.value,type:"array",inclusive:!0,exact:!1,message:h.maxLength.message}),m.dirty()),l.common.async)return Promise.all([...l.data].map((u,m)=>h.type._parseAsync(new ParseInputLazyPath(l,u,l.path,m)))).then(u=>w.ParseStatus.mergeArray(m,u));const y=[...l.data].map((u,m)=>h.type._parseSync(new ParseInputLazyPath(l,u,l.path,m)));return w.ParseStatus.mergeArray(m,y)}get element(){return this._def.type}min(u,l){return new ZodArray({...this._def,minLength:{value:u,message:v.errorUtil.toString(l)}})}max(u,l){return new ZodArray({...this._def,maxLength:{value:u,message:v.errorUtil.toString(l)}})}length(u,l){return new ZodArray({...this._def,exactLength:{value:u,message:v.errorUtil.toString(l)}})}nonempty(u){return this.min(1,u)}}function deepPartialify(u){if(u instanceof ZodObject){const l={};for(const m in u.shape){const f=u.shape[m];l[m]=ZodOptional.create(deepPartialify(f))}return new ZodObject({...u._def,shape:()=>l})}return u instanceof ZodArray?new ZodArray({...u._def,type:deepPartialify(u.element)}):u instanceof ZodOptional?ZodOptional.create(deepPartialify(u.unwrap())):u instanceof ZodNullable?ZodNullable.create(deepPartialify(u.unwrap())):u instanceof ZodTuple?ZodTuple.create(u.items.map(u=>deepPartialify(u))):u}ZodArray.create=(u,l)=>new ZodArray({type:u,minLength:null,maxLength:null,exactLength:null,typeName:H.ZodArray,...processCreateParams(l)});class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const u=this._def.shape(),l=b.util.objectKeys(u);return this._cached={shape:u,keys:l},this._cached}_parse(u){if(this._getType(u)!==b.ZodParsedType.object){const l=this._getOrReturnCtx(u);return(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.object,received:l.parsedType}),w.INVALID}const{status:l,ctx:m}=this._processInputParams(u),{shape:h,keys:y}=this._getCached(),v=[];if(!(this._def.catchall instanceof ZodNever&&"strip"===this._def.unknownKeys))for(const u in m.data)y.includes(u)||v.push(u);const S=[];for(const u of y){const l=h[u],f=m.data[u];S.push({key:{status:"valid",value:u},value:l._parse(new ParseInputLazyPath(m,f,m.path,u)),alwaysSet:u in m.data})}if(this._def.catchall instanceof ZodNever){const u=this._def.unknownKeys;if("passthrough"===u)for(const u of v)S.push({key:{status:"valid",value:u},value:{status:"valid",value:m.data[u]}});else if("strict"===u)v.length>0&&((0,w.addIssueToContext)(m,{code:f.ZodIssueCode.unrecognized_keys,keys:v}),l.dirty());else if("strip"!==u)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const l of v){const f=m.data[l];S.push({key:{status:"valid",value:l},value:u._parse(new ParseInputLazyPath(m,f,m.path,l)),alwaysSet:l in m.data})}}return m.common.async?Promise.resolve().then(async()=>{const u=[];for(const l of S){const m=await l.key,f=await l.value;u.push({key:m,value:f,alwaysSet:l.alwaysSet})}return u}).then(u=>w.ParseStatus.mergeObjectSync(l,u)):w.ParseStatus.mergeObjectSync(l,S)}get shape(){return this._def.shape()}strict(u){return v.errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:"strict",...void 0!==u?{errorMap:(l,m)=>{const f=this._def.errorMap?.(l,m).message??m.defaultError;return"unrecognized_keys"===l.code?{message:v.errorUtil.errToObj(u).message??f}:{message:f}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(u){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...u})})}merge(u){return new ZodObject({unknownKeys:u._def.unknownKeys,catchall:u._def.catchall,shape:()=>({...this._def.shape(),...u._def.shape()}),typeName:H.ZodObject})}setKey(u,l){return this.augment({[u]:l})}catchall(u){return new ZodObject({...this._def,catchall:u})}pick(u){const l={};for(const m of b.util.objectKeys(u))u[m]&&this.shape[m]&&(l[m]=this.shape[m]);return new ZodObject({...this._def,shape:()=>l})}omit(u){const l={};for(const m of b.util.objectKeys(this.shape))u[m]||(l[m]=this.shape[m]);return new ZodObject({...this._def,shape:()=>l})}deepPartial(){return deepPartialify(this)}partial(u){const l={};for(const m of b.util.objectKeys(this.shape)){const f=this.shape[m];u&&!u[m]?l[m]=f:l[m]=f.optional()}return new ZodObject({...this._def,shape:()=>l})}required(u){const l={};for(const m of b.util.objectKeys(this.shape))if(u&&!u[m])l[m]=this.shape[m];else{let u=this.shape[m];for(;u instanceof ZodOptional;)u=u._def.innerType;l[m]=u}return new ZodObject({...this._def,shape:()=>l})}keyof(){return createZodEnum(b.util.objectKeys(this.shape))}}ZodObject.create=(u,l)=>new ZodObject({shape:()=>u,unknownKeys:"strip",catchall:ZodNever.create(),typeName:H.ZodObject,...processCreateParams(l)}),ZodObject.strictCreate=(u,l)=>new ZodObject({shape:()=>u,unknownKeys:"strict",catchall:ZodNever.create(),typeName:H.ZodObject,...processCreateParams(l)}),ZodObject.lazycreate=(u,l)=>new ZodObject({shape:u,unknownKeys:"strip",catchall:ZodNever.create(),typeName:H.ZodObject,...processCreateParams(l)});class ZodUnion extends ZodType{_parse(u){const{ctx:l}=this._processInputParams(u),m=this._def.options;if(l.common.async)return Promise.all(m.map(async u=>{const m={...l,common:{...l.common,issues:[]},parent:null};return{result:await u._parseAsync({data:l.data,path:l.path,parent:m}),ctx:m}})).then(function handleResults(u){for(const l of u)if("valid"===l.result.status)return l.result;for(const m of u)if("dirty"===m.result.status)return l.common.issues.push(...m.ctx.common.issues),m.result;const m=u.map(u=>new f.ZodError(u.ctx.common.issues));return(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_union,unionErrors:m}),w.INVALID});{let u;const h=[];for(const f of m){const m={...l,common:{...l.common,issues:[]},parent:null},y=f._parseSync({data:l.data,path:l.path,parent:m});if("valid"===y.status)return y;"dirty"!==y.status||u||(u={result:y,ctx:m}),m.common.issues.length&&h.push(m.common.issues)}if(u)return l.common.issues.push(...u.ctx.common.issues),u.result;const y=h.map(u=>new f.ZodError(u));return(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_union,unionErrors:y}),w.INVALID}}get options(){return this._def.options}}ZodUnion.create=(u,l)=>new ZodUnion({options:u,typeName:H.ZodUnion,...processCreateParams(l)});const getDiscriminator=u=>u instanceof ZodLazy?getDiscriminator(u.schema):u instanceof ZodEffects?getDiscriminator(u.innerType()):u instanceof ZodLiteral?[u.value]:u instanceof ZodEnum?u.options:u instanceof ZodNativeEnum?b.util.objectValues(u.enum):u instanceof ZodDefault?getDiscriminator(u._def.innerType):u instanceof ZodUndefined?[void 0]:u instanceof ZodNull?[null]:u instanceof ZodOptional?[void 0,...getDiscriminator(u.unwrap())]:u instanceof ZodNullable?[null,...getDiscriminator(u.unwrap())]:u instanceof ZodBranded||u instanceof ZodReadonly?getDiscriminator(u.unwrap()):u instanceof ZodCatch?getDiscriminator(u._def.innerType):[];class ZodDiscriminatedUnion extends ZodType{_parse(u){const{ctx:l}=this._processInputParams(u);if(l.parsedType!==b.ZodParsedType.object)return(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.object,received:l.parsedType}),w.INVALID;const m=this.discriminator,h=l.data[m],y=this.optionsMap.get(h);return y?l.common.async?y._parseAsync({data:l.data,path:l.path,parent:l}):y._parseSync({data:l.data,path:l.path,parent:l}):((0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[m]}),w.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(u,l,m){const f=new Map;for(const m of l){const l=getDiscriminator(m.shape[u]);if(!l.length)throw new Error(`A discriminator value for key \`${u}\` could not be extracted from all schema options`);for(const h of l){if(f.has(h))throw new Error(`Discriminator property ${String(u)} has duplicate value ${String(h)}`);f.set(h,m)}}return new ZodDiscriminatedUnion({typeName:H.ZodDiscriminatedUnion,discriminator:u,options:l,optionsMap:f,...processCreateParams(m)})}}function mergeValues(u,l){const m=(0,b.getParsedType)(u),f=(0,b.getParsedType)(l);if(u===l)return{valid:!0,data:u};if(m===b.ZodParsedType.object&&f===b.ZodParsedType.object){const m=b.util.objectKeys(l),f=b.util.objectKeys(u).filter(u=>-1!==m.indexOf(u)),h={...u,...l};for(const m of f){const f=mergeValues(u[m],l[m]);if(!f.valid)return{valid:!1};h[m]=f.data}return{valid:!0,data:h}}if(m===b.ZodParsedType.array&&f===b.ZodParsedType.array){if(u.length!==l.length)return{valid:!1};const m=[];for(let f=0;f<u.length;f++){const h=mergeValues(u[f],l[f]);if(!h.valid)return{valid:!1};m.push(h.data)}return{valid:!0,data:m}}return m===b.ZodParsedType.date&&f===b.ZodParsedType.date&&+u===+l?{valid:!0,data:u}:{valid:!1}}class ZodIntersection extends ZodType{_parse(u){const{status:l,ctx:m}=this._processInputParams(u),handleParsed=(u,h)=>{if((0,w.isAborted)(u)||(0,w.isAborted)(h))return w.INVALID;const y=mergeValues(u.value,h.value);return y.valid?(((0,w.isDirty)(u)||(0,w.isDirty)(h))&&l.dirty(),{status:l.value,value:y.data}):((0,w.addIssueToContext)(m,{code:f.ZodIssueCode.invalid_intersection_types}),w.INVALID)};return m.common.async?Promise.all([this._def.left._parseAsync({data:m.data,path:m.path,parent:m}),this._def.right._parseAsync({data:m.data,path:m.path,parent:m})]).then(([u,l])=>handleParsed(u,l)):handleParsed(this._def.left._parseSync({data:m.data,path:m.path,parent:m}),this._def.right._parseSync({data:m.data,path:m.path,parent:m}))}}ZodIntersection.create=(u,l,m)=>new ZodIntersection({left:u,right:l,typeName:H.ZodIntersection,...processCreateParams(m)});class ZodTuple extends ZodType{_parse(u){const{status:l,ctx:m}=this._processInputParams(u);if(m.parsedType!==b.ZodParsedType.array)return(0,w.addIssueToContext)(m,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.array,received:m.parsedType}),w.INVALID;if(m.data.length<this._def.items.length)return(0,w.addIssueToContext)(m,{code:f.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),w.INVALID;!this._def.rest&&m.data.length>this._def.items.length&&((0,w.addIssueToContext)(m,{code:f.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),l.dirty());const h=[...m.data].map((u,l)=>{const f=this._def.items[l]||this._def.rest;return f?f._parse(new ParseInputLazyPath(m,u,m.path,l)):null}).filter(u=>!!u);return m.common.async?Promise.all(h).then(u=>w.ParseStatus.mergeArray(l,u)):w.ParseStatus.mergeArray(l,h)}get items(){return this._def.items}rest(u){return new ZodTuple({...this._def,rest:u})}}ZodTuple.create=(u,l)=>{if(!Array.isArray(u))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:u,typeName:H.ZodTuple,rest:null,...processCreateParams(l)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(u){const{status:l,ctx:m}=this._processInputParams(u);if(m.parsedType!==b.ZodParsedType.object)return(0,w.addIssueToContext)(m,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.object,received:m.parsedType}),w.INVALID;const h=[],y=this._def.keyType,v=this._def.valueType;for(const u in m.data)h.push({key:y._parse(new ParseInputLazyPath(m,u,m.path,u)),value:v._parse(new ParseInputLazyPath(m,m.data[u],m.path,u)),alwaysSet:u in m.data});return m.common.async?w.ParseStatus.mergeObjectAsync(l,h):w.ParseStatus.mergeObjectSync(l,h)}get element(){return this._def.valueType}static create(u,l,m){return new ZodRecord(l instanceof ZodType?{keyType:u,valueType:l,typeName:H.ZodRecord,...processCreateParams(m)}:{keyType:ZodString.create(),valueType:u,typeName:H.ZodRecord,...processCreateParams(l)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(u){const{status:l,ctx:m}=this._processInputParams(u);if(m.parsedType!==b.ZodParsedType.map)return(0,w.addIssueToContext)(m,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.map,received:m.parsedType}),w.INVALID;const h=this._def.keyType,y=this._def.valueType,v=[...m.data.entries()].map(([u,l],f)=>({key:h._parse(new ParseInputLazyPath(m,u,m.path,[f,"key"])),value:y._parse(new ParseInputLazyPath(m,l,m.path,[f,"value"]))}));if(m.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const m of v){const f=await m.key,h=await m.value;if("aborted"===f.status||"aborted"===h.status)return w.INVALID;"dirty"!==f.status&&"dirty"!==h.status||l.dirty(),u.set(f.value,h.value)}return{status:l.value,value:u}})}{const u=new Map;for(const m of v){const f=m.key,h=m.value;if("aborted"===f.status||"aborted"===h.status)return w.INVALID;"dirty"!==f.status&&"dirty"!==h.status||l.dirty(),u.set(f.value,h.value)}return{status:l.value,value:u}}}}ZodMap.create=(u,l,m)=>new ZodMap({valueType:l,keyType:u,typeName:H.ZodMap,...processCreateParams(m)});class ZodSet extends ZodType{_parse(u){const{status:l,ctx:m}=this._processInputParams(u);if(m.parsedType!==b.ZodParsedType.set)return(0,w.addIssueToContext)(m,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.set,received:m.parsedType}),w.INVALID;const h=this._def;null!==h.minSize&&m.data.size<h.minSize.value&&((0,w.addIssueToContext)(m,{code:f.ZodIssueCode.too_small,minimum:h.minSize.value,type:"set",inclusive:!0,exact:!1,message:h.minSize.message}),l.dirty()),null!==h.maxSize&&m.data.size>h.maxSize.value&&((0,w.addIssueToContext)(m,{code:f.ZodIssueCode.too_big,maximum:h.maxSize.value,type:"set",inclusive:!0,exact:!1,message:h.maxSize.message}),l.dirty());const y=this._def.valueType;function finalizeSet(u){const m=new Set;for(const f of u){if("aborted"===f.status)return w.INVALID;"dirty"===f.status&&l.dirty(),m.add(f.value)}return{status:l.value,value:m}}const v=[...m.data.values()].map((u,l)=>y._parse(new ParseInputLazyPath(m,u,m.path,l)));return m.common.async?Promise.all(v).then(u=>finalizeSet(u)):finalizeSet(v)}min(u,l){return new ZodSet({...this._def,minSize:{value:u,message:v.errorUtil.toString(l)}})}max(u,l){return new ZodSet({...this._def,maxSize:{value:u,message:v.errorUtil.toString(l)}})}size(u,l){return this.min(u,l).max(u,l)}nonempty(u){return this.min(1,u)}}ZodSet.create=(u,l)=>new ZodSet({valueType:u,minSize:null,maxSize:null,typeName:H.ZodSet,...processCreateParams(l)});class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(u){const{ctx:l}=this._processInputParams(u);if(l.parsedType!==b.ZodParsedType.function)return(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.function,received:l.parsedType}),w.INVALID;function makeArgsIssue(u,m){return(0,w.makeIssue)({data:u,path:l.path,errorMaps:[l.common.contextualErrorMap,l.schemaErrorMap,(0,h.getErrorMap)(),y.default].filter(u=>!!u),issueData:{code:f.ZodIssueCode.invalid_arguments,argumentsError:m}})}function makeReturnsIssue(u,m){return(0,w.makeIssue)({data:u,path:l.path,errorMaps:[l.common.contextualErrorMap,l.schemaErrorMap,(0,h.getErrorMap)(),y.default].filter(u=>!!u),issueData:{code:f.ZodIssueCode.invalid_return_type,returnTypeError:m}})}const m={errorMap:l.common.contextualErrorMap},v=l.data;if(this._def.returns instanceof ZodPromise){const u=this;return(0,w.OK)(async function(...l){const h=new f.ZodError([]),y=await u._def.args.parseAsync(l,m).catch(u=>{throw h.addIssue(makeArgsIssue(l,u)),h}),w=await Reflect.apply(v,this,y);return await u._def.returns._def.type.parseAsync(w,m).catch(u=>{throw h.addIssue(makeReturnsIssue(w,u)),h})})}{const u=this;return(0,w.OK)(function(...l){const h=u._def.args.safeParse(l,m);if(!h.success)throw new f.ZodError([makeArgsIssue(l,h.error)]);const y=Reflect.apply(v,this,h.data),w=u._def.returns.safeParse(y,m);if(!w.success)throw new f.ZodError([makeReturnsIssue(y,w.error)]);return w.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...u){return new ZodFunction({...this._def,args:ZodTuple.create(u).rest(ZodUnknown.create())})}returns(u){return new ZodFunction({...this._def,returns:u})}implement(u){return this.parse(u)}strictImplement(u){return this.parse(u)}static create(u,l,m){return new ZodFunction({args:u||ZodTuple.create([]).rest(ZodUnknown.create()),returns:l||ZodUnknown.create(),typeName:H.ZodFunction,...processCreateParams(m)})}}class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(u){const{ctx:l}=this._processInputParams(u);return this._def.getter()._parse({data:l.data,path:l.path,parent:l})}}ZodLazy.create=(u,l)=>new ZodLazy({getter:u,typeName:H.ZodLazy,...processCreateParams(l)});class ZodLiteral extends ZodType{_parse(u){if(u.data!==this._def.value){const l=this._getOrReturnCtx(u);return(0,w.addIssueToContext)(l,{received:l.data,code:f.ZodIssueCode.invalid_literal,expected:this._def.value}),w.INVALID}return{status:"valid",value:u.data}}get value(){return this._def.value}}function createZodEnum(u,l){return new ZodEnum({values:u,typeName:H.ZodEnum,...processCreateParams(l)})}ZodLiteral.create=(u,l)=>new ZodLiteral({value:u,typeName:H.ZodLiteral,...processCreateParams(l)});class ZodEnum extends ZodType{_parse(u){if("string"!=typeof u.data){const l=this._getOrReturnCtx(u),m=this._def.values;return(0,w.addIssueToContext)(l,{expected:b.util.joinValues(m),received:l.parsedType,code:f.ZodIssueCode.invalid_type}),w.INVALID}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(u.data)){const l=this._getOrReturnCtx(u),m=this._def.values;return(0,w.addIssueToContext)(l,{received:l.data,code:f.ZodIssueCode.invalid_enum_value,options:m}),w.INVALID}return(0,w.OK)(u.data)}get options(){return this._def.values}get enum(){const u={};for(const l of this._def.values)u[l]=l;return u}get Values(){const u={};for(const l of this._def.values)u[l]=l;return u}get Enum(){const u={};for(const l of this._def.values)u[l]=l;return u}extract(u,l=this._def){return ZodEnum.create(u,{...this._def,...l})}exclude(u,l=this._def){return ZodEnum.create(this.options.filter(l=>!u.includes(l)),{...this._def,...l})}}ZodEnum.create=createZodEnum;class ZodNativeEnum extends ZodType{_parse(u){const l=b.util.getValidEnumValues(this._def.values),m=this._getOrReturnCtx(u);if(m.parsedType!==b.ZodParsedType.string&&m.parsedType!==b.ZodParsedType.number){const u=b.util.objectValues(l);return(0,w.addIssueToContext)(m,{expected:b.util.joinValues(u),received:m.parsedType,code:f.ZodIssueCode.invalid_type}),w.INVALID}if(this._cache||(this._cache=new Set(b.util.getValidEnumValues(this._def.values))),!this._cache.has(u.data)){const u=b.util.objectValues(l);return(0,w.addIssueToContext)(m,{received:m.data,code:f.ZodIssueCode.invalid_enum_value,options:u}),w.INVALID}return(0,w.OK)(u.data)}get enum(){return this._def.values}}ZodNativeEnum.create=(u,l)=>new ZodNativeEnum({values:u,typeName:H.ZodNativeEnum,...processCreateParams(l)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(u){const{ctx:l}=this._processInputParams(u);if(l.parsedType!==b.ZodParsedType.promise&&!1===l.common.async)return(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.promise,received:l.parsedType}),w.INVALID;const m=l.parsedType===b.ZodParsedType.promise?l.data:Promise.resolve(l.data);return(0,w.OK)(m.then(u=>this._def.type.parseAsync(u,{path:l.path,errorMap:l.common.contextualErrorMap})))}}ZodPromise.create=(u,l)=>new ZodPromise({type:u,typeName:H.ZodPromise,...processCreateParams(l)});class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===H.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(u){const{status:l,ctx:m}=this._processInputParams(u),f=this._def.effect||null,h={addIssue:u=>{(0,w.addIssueToContext)(m,u),u.fatal?l.abort():l.dirty()},get path(){return m.path}};if(h.addIssue=h.addIssue.bind(h),"preprocess"===f.type){const u=f.transform(m.data,h);if(m.common.async)return Promise.resolve(u).then(async u=>{if("aborted"===l.value)return w.INVALID;const f=await this._def.schema._parseAsync({data:u,path:m.path,parent:m});return"aborted"===f.status?w.INVALID:"dirty"===f.status||"dirty"===l.value?(0,w.DIRTY)(f.value):f});{if("aborted"===l.value)return w.INVALID;const f=this._def.schema._parseSync({data:u,path:m.path,parent:m});return"aborted"===f.status?w.INVALID:"dirty"===f.status||"dirty"===l.value?(0,w.DIRTY)(f.value):f}}if("refinement"===f.type){const executeRefinement=u=>{const l=f.refinement(u,h);if(m.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(!1===m.common.async){const u=this._def.schema._parseSync({data:m.data,path:m.path,parent:m});return"aborted"===u.status?w.INVALID:("dirty"===u.status&&l.dirty(),executeRefinement(u.value),{status:l.value,value:u.value})}return this._def.schema._parseAsync({data:m.data,path:m.path,parent:m}).then(u=>"aborted"===u.status?w.INVALID:("dirty"===u.status&&l.dirty(),executeRefinement(u.value).then(()=>({status:l.value,value:u.value}))))}if("transform"===f.type){if(!1===m.common.async){const u=this._def.schema._parseSync({data:m.data,path:m.path,parent:m});if(!(0,w.isValid)(u))return w.INVALID;const y=f.transform(u.value,h);if(y instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:l.value,value:y}}return this._def.schema._parseAsync({data:m.data,path:m.path,parent:m}).then(u=>(0,w.isValid)(u)?Promise.resolve(f.transform(u.value,h)).then(u=>({status:l.value,value:u})):w.INVALID)}b.util.assertNever(f)}}ZodEffects.create=(u,l,m)=>new ZodEffects({schema:u,typeName:H.ZodEffects,effect:l,...processCreateParams(m)}),ZodEffects.createWithPreprocess=(u,l,m)=>new ZodEffects({schema:l,effect:{type:"preprocess",transform:u},typeName:H.ZodEffects,...processCreateParams(m)});class ZodOptional extends ZodType{_parse(u){return this._getType(u)===b.ZodParsedType.undefined?(0,w.OK)(void 0):this._def.innerType._parse(u)}unwrap(){return this._def.innerType}}ZodOptional.create=(u,l)=>new ZodOptional({innerType:u,typeName:H.ZodOptional,...processCreateParams(l)});class ZodNullable extends ZodType{_parse(u){return this._getType(u)===b.ZodParsedType.null?(0,w.OK)(null):this._def.innerType._parse(u)}unwrap(){return this._def.innerType}}ZodNullable.create=(u,l)=>new ZodNullable({innerType:u,typeName:H.ZodNullable,...processCreateParams(l)});class ZodDefault extends ZodType{_parse(u){const{ctx:l}=this._processInputParams(u);let m=l.data;return l.parsedType===b.ZodParsedType.undefined&&(m=this._def.defaultValue()),this._def.innerType._parse({data:m,path:l.path,parent:l})}removeDefault(){return this._def.innerType}}ZodDefault.create=(u,l)=>new ZodDefault({innerType:u,typeName:H.ZodDefault,defaultValue:"function"==typeof l.default?l.default:()=>l.default,...processCreateParams(l)});class ZodCatch extends ZodType{_parse(u){const{ctx:l}=this._processInputParams(u),m={...l,common:{...l.common,issues:[]}},h=this._def.innerType._parse({data:m.data,path:m.path,parent:{...m}});return(0,w.isAsync)(h)?h.then(u=>({status:"valid",value:"valid"===u.status?u.value:this._def.catchValue({get error(){return new f.ZodError(m.common.issues)},input:m.data})})):{status:"valid",value:"valid"===h.status?h.value:this._def.catchValue({get error(){return new f.ZodError(m.common.issues)},input:m.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(u,l)=>new ZodCatch({innerType:u,typeName:H.ZodCatch,catchValue:"function"==typeof l.catch?l.catch:()=>l.catch,...processCreateParams(l)});class ZodNaN extends ZodType{_parse(u){if(this._getType(u)!==b.ZodParsedType.nan){const l=this._getOrReturnCtx(u);return(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.nan,received:l.parsedType}),w.INVALID}return{status:"valid",value:u.data}}}ZodNaN.create=u=>new ZodNaN({typeName:H.ZodNaN,...processCreateParams(u)});const V=Symbol("zod_brand");class ZodBranded extends ZodType{_parse(u){const{ctx:l}=this._processInputParams(u),m=l.data;return this._def.type._parse({data:m,path:l.path,parent:l})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(u){const{status:l,ctx:m}=this._processInputParams(u);if(m.common.async){return(async()=>{const u=await this._def.in._parseAsync({data:m.data,path:m.path,parent:m});return"aborted"===u.status?w.INVALID:"dirty"===u.status?(l.dirty(),(0,w.DIRTY)(u.value)):this._def.out._parseAsync({data:u.value,path:m.path,parent:m})})()}{const u=this._def.in._parseSync({data:m.data,path:m.path,parent:m});return"aborted"===u.status?w.INVALID:"dirty"===u.status?(l.dirty(),{status:"dirty",value:u.value}):this._def.out._parseSync({data:u.value,path:m.path,parent:m})}}static create(u,l){return new ZodPipeline({in:u,out:l,typeName:H.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(u){const l=this._def.innerType._parse(u),freeze=u=>((0,w.isValid)(u)&&(u.value=Object.freeze(u.value)),u);return(0,w.isAsync)(l)?l.then(u=>freeze(u)):freeze(l)}unwrap(){return this._def.innerType}}function cleanParams(u,l){const m="function"==typeof u?u(l):"string"==typeof u?{message:u}:u;return"string"==typeof m?{message:m}:m}function custom(u,l={},m){return u?ZodAny.create().superRefine((f,h)=>{const y=u(f);if(y instanceof Promise)return y.then(u=>{if(!u){const u=cleanParams(l,f),y=u.fatal??m??!0;h.addIssue({code:"custom",...u,fatal:y})}});if(!y){const u=cleanParams(l,f),y=u.fatal??m??!0;h.addIssue({code:"custom",...u,fatal:y})}}):ZodAny.create()}ZodReadonly.create=(u,l)=>new ZodReadonly({innerType:u,typeName:H.ZodReadonly,...processCreateParams(l)});const K={object:ZodObject.lazycreate};var H;!function(u){u.ZodString="ZodString",u.ZodNumber="ZodNumber",u.ZodNaN="ZodNaN",u.ZodBigInt="ZodBigInt",u.ZodBoolean="ZodBoolean",u.ZodDate="ZodDate",u.ZodSymbol="ZodSymbol",u.ZodUndefined="ZodUndefined",u.ZodNull="ZodNull",u.ZodAny="ZodAny",u.ZodUnknown="ZodUnknown",u.ZodNever="ZodNever",u.ZodVoid="ZodVoid",u.ZodArray="ZodArray",u.ZodObject="ZodObject",u.ZodUnion="ZodUnion",u.ZodDiscriminatedUnion="ZodDiscriminatedUnion",u.ZodIntersection="ZodIntersection",u.ZodTuple="ZodTuple",u.ZodRecord="ZodRecord",u.ZodMap="ZodMap",u.ZodSet="ZodSet",u.ZodFunction="ZodFunction",u.ZodLazy="ZodLazy",u.ZodLiteral="ZodLiteral",u.ZodEnum="ZodEnum",u.ZodEffects="ZodEffects",u.ZodNativeEnum="ZodNativeEnum",u.ZodOptional="ZodOptional",u.ZodNullable="ZodNullable",u.ZodDefault="ZodDefault",u.ZodCatch="ZodCatch",u.ZodPromise="ZodPromise",u.ZodBranded="ZodBranded",u.ZodPipeline="ZodPipeline",u.ZodReadonly="ZodReadonly"}(H||(H={}));const instanceOfType=(u,l={message:`Input not instance of ${u.name}`})=>custom(l=>l instanceof u,l),B=ZodString.create,J=ZodNumber.create,G=ZodNaN.create,W=ZodBigInt.create,Q=ZodBoolean.create,Y=ZodDate.create,X=ZodSymbol.create,ee=ZodUndefined.create,te=ZodNull.create,ne=ZodAny.create,re=ZodUnknown.create,oe=ZodNever.create,se=ZodVoid.create,ie=ZodArray.create,ae=ZodObject.create,ce=ZodObject.strictCreate,de=ZodUnion.create,ue=ZodDiscriminatedUnion.create,le=ZodIntersection.create,pe=ZodTuple.create,me=ZodRecord.create,fe=ZodMap.create,he=ZodSet.create,ge=ZodFunction.create,_e=ZodLazy.create,ye=ZodLiteral.create,ve=ZodEnum.create,we=ZodNativeEnum.create,be=ZodPromise.create,ke=ZodEffects.create,Se=ZodOptional.create,$e=ZodNullable.create,xe=ZodEffects.createWithPreprocess,je=ZodPipeline.create,ostring=()=>B().optional(),onumber=()=>J().optional(),oboolean=()=>Q().optional(),Te={string:u=>ZodString.create({...u,coerce:!0}),number:u=>ZodNumber.create({...u,coerce:!0}),boolean:u=>ZodBoolean.create({...u,coerce:!0}),bigint:u=>ZodBigInt.create({...u,coerce:!0}),date:u=>ZodDate.create({...u,coerce:!0})},Ee=w.INVALID},"./node_modules/zod/v4/classic/errors.js":function(u,l,m){m.r(l),m.d(l,{ZodError:function(){return y},ZodRealError:function(){return v}});var f=m("./node_modules/zod/v4/core/core.js"),h=m("./node_modules/zod/v4/core/errors.js");const initializer=(u,l)=>{h.$ZodError.init(u,l),u.name="ZodError",Object.defineProperties(u,{format:{value:l=>h.formatError(u,l)},flatten:{value:l=>h.flattenError(u,l)},addIssue:{value:l=>u.issues.push(l)},addIssues:{value:l=>u.issues.push(...l)},isEmpty:{get(){return 0===u.issues.length}}})},y=f.$constructor("ZodError",initializer),v=f.$constructor("ZodError",initializer,{Parent:Error})},"./node_modules/zod/v4/classic/iso.js":function(u,l,m){m.r(l),m.d(l,{ZodISODate:function(){return b},ZodISODateTime:function(){return w},ZodISODuration:function(){return $},ZodISOTime:function(){return S},date:function(){return date},datetime:function(){return datetime},duration:function(){return duration},time:function(){return time}});var f=m("./node_modules/zod/v4/core/core.js"),h=m("./node_modules/zod/v4/core/schemas.js"),y=m("./node_modules/zod/v4/core/api.js"),v=m("./node_modules/zod/v4/classic/schemas.js");const w=f.$constructor("ZodISODateTime",(u,l)=>{h.$ZodISODateTime.init(u,l),v.ZodStringFormat.init(u,l)});function datetime(u){return y._isoDateTime(w,u)}const b=f.$constructor("ZodISODate",(u,l)=>{h.$ZodISODate.init(u,l),v.ZodStringFormat.init(u,l)});function date(u){return y._isoDate(b,u)}const S=f.$constructor("ZodISOTime",(u,l)=>{h.$ZodISOTime.init(u,l),v.ZodStringFormat.init(u,l)});function time(u){return y._isoTime(S,u)}const $=f.$constructor("ZodISODuration",(u,l)=>{h.$ZodISODuration.init(u,l),v.ZodStringFormat.init(u,l)});function duration(u){return y._isoDuration($,u)}},"./node_modules/zod/v4/classic/parse.js":function(u,l,m){m.r(l),m.d(l,{parse:function(){return y},parseAsync:function(){return v},safeParse:function(){return w},safeParseAsync:function(){return b}});var f=m("./node_modules/zod/v4/core/parse.js"),h=m("./node_modules/zod/v4/classic/errors.js");const y=f._parse(h.ZodRealError),v=f._parseAsync(h.ZodRealError),w=f._safeParse(h.ZodRealError),b=f._safeParseAsync(h.ZodRealError)},"./node_modules/zod/v4/classic/schemas.js":function(u,l,m){m.r(l),m.d(l,{ZodAny:function(){return ae},ZodArray:function(){return pe},ZodBase64:function(){return J},ZodBase64URL:function(){return G},ZodBigInt:function(){return ne},ZodBigIntFormat:function(){return re},ZodBoolean:function(){return te},ZodCIDRv4:function(){return H},ZodCIDRv6:function(){return B},ZodCUID:function(){return D},ZodCUID2:function(){return M},ZodCatch:function(){return Re},ZodCustom:function(){return De},ZodCustomStringFormat:function(){return Y},ZodDate:function(){return le},ZodDefault:function(){return Te},ZodDiscriminatedUnion:function(){return he},ZodE164:function(){return W},ZodEmail:function(){return C},ZodEmoji:function(){return O},ZodEnum:function(){return be},ZodFile:function(){return Se},ZodGUID:function(){return Z},ZodIPv4:function(){return V},ZodIPv6:function(){return K},ZodIntersection:function(){return ge},ZodJWT:function(){return Q},ZodKSUID:function(){return F},ZodLazy:function(){return Oe},ZodLiteral:function(){return ke},ZodMap:function(){return ve},ZodNaN:function(){return Ce},ZodNanoID:function(){return N},ZodNever:function(){return de},ZodNonOptional:function(){return Pe},ZodNull:function(){return ie},ZodNullable:function(){return je},ZodNumber:function(){return X},ZodNumberFormat:function(){return ee},ZodObject:function(){return me},ZodOptional:function(){return xe},ZodPipe:function(){return Ze},ZodPrefault:function(){return Ee},ZodPromise:function(){return Ne},ZodReadonly:function(){return ze},ZodRecord:function(){return ye},ZodSet:function(){return we},ZodString:function(){return E},ZodStringFormat:function(){return R},ZodSuccess:function(){return Ie},ZodSymbol:function(){return oe},ZodTemplateLiteral:function(){return Ae},ZodTransform:function(){return $e},ZodTuple:function(){return _e},ZodType:function(){return x},ZodULID:function(){return U},ZodURL:function(){return A},ZodUUID:function(){return z},ZodUndefined:function(){return se},ZodUnion:function(){return fe},ZodUnknown:function(){return ce},ZodVoid:function(){return ue},ZodXID:function(){return L},_ZodString:function(){return j},_default:function(){return _default},any:function(){return any},array:function(){return array},base64:function(){return base64},base64url:function(){return base64url},bigint:function(){return bigint},boolean:function(){return boolean},catch:function(){return _catch},check:function(){return check},cidrv4:function(){return cidrv4},cidrv6:function(){return cidrv6},cuid:function(){return cuid},cuid2:function(){return cuid2},custom:function(){return custom},date:function(){return date},discriminatedUnion:function(){return discriminatedUnion},e164:function(){return e164},email:function(){return email},emoji:function(){return emoji},enum:function(){return _enum},file:function(){return file},float32:function(){return float32},float64:function(){return float64},guid:function(){return guid},instanceof:function(){return _instanceof},int:function(){return int},int32:function(){return int32},int64:function(){return int64},intersection:function(){return intersection},ipv4:function(){return ipv4},ipv6:function(){return ipv6},json:function(){return json},jwt:function(){return jwt},keyof:function(){return keyof},ksuid:function(){return ksuid},lazy:function(){return lazy},literal:function(){return literal},looseObject:function(){return looseObject},map:function(){return map},nan:function(){return nan},nanoid:function(){return nanoid},nativeEnum:function(){return nativeEnum},never:function(){return never},nonoptional:function(){return nonoptional},null:function(){return _null},nullable:function(){return nullable},nullish:function(){return nullish},number:function(){return number},object:function(){return object},optional:function(){return optional},partialRecord:function(){return partialRecord},pipe:function(){return pipe},prefault:function(){return prefault},preprocess:function(){return preprocess},promise:function(){return promise},readonly:function(){return readonly},record:function(){return record},refine:function(){return refine},set:function(){return set},strictObject:function(){return strictObject},string:function(){return string},stringFormat:function(){return stringFormat},stringbool:function(){return stringbool},success:function(){return success},superRefine:function(){return superRefine},symbol:function(){return symbol},templateLiteral:function(){return templateLiteral},transform:function(){return transform},tuple:function(){return tuple},uint32:function(){return uint32},uint64:function(){return uint64},ulid:function(){return ulid},undefined:function(){return _undefined},union:function(){return union},unknown:function(){return unknown},url:function(){return url},uuid:function(){return uuid},uuidv4:function(){return uuidv4},uuidv6:function(){return uuidv6},uuidv7:function(){return uuidv7},void:function(){return _void},xid:function(){return xid}});var f=m("./node_modules/zod/v4/core/core.js"),h=m("./node_modules/zod/v4/core/schemas.js"),y=m("./node_modules/zod/v4/core/checks.js"),v=m("./node_modules/zod/v4/core/util.js"),w=m("./node_modules/zod/v4/core/registries.js"),b=m("./node_modules/zod/v4/core/api.js"),S=m("./node_modules/zod/v4/classic/iso.js"),$=m("./node_modules/zod/v4/classic/parse.js");const x=f.$constructor("ZodType",(u,l)=>(h.$ZodType.init(u,l),u.def=l,Object.defineProperty(u,"_def",{value:l}),u.check=(...m)=>u.clone({...l,checks:[...l.checks??[],...m.map(u=>"function"==typeof u?{_zod:{check:u,def:{check:"custom"},onattach:[]}}:u)]}),u.clone=(l,m)=>v.clone(u,l,m),u.brand=()=>u,u.register=(l,m)=>(l.add(u,m),u),u.parse=(l,m)=>$.parse(u,l,m,{callee:u.parse}),u.safeParse=(l,m)=>$.safeParse(u,l,m),u.parseAsync=async(l,m)=>$.parseAsync(u,l,m,{callee:u.parseAsync}),u.safeParseAsync=async(l,m)=>$.safeParseAsync(u,l,m),u.spa=u.safeParseAsync,u.refine=(l,m)=>u.check(refine(l,m)),u.superRefine=l=>u.check(superRefine(l)),u.overwrite=l=>u.check(b._overwrite(l)),u.optional=()=>optional(u),u.nullable=()=>nullable(u),u.nullish=()=>optional(nullable(u)),u.nonoptional=l=>nonoptional(u,l),u.array=()=>array(u),u.or=l=>union([u,l]),u.and=l=>intersection(u,l),u.transform=l=>pipe(u,transform(l)),u.default=l=>_default(u,l),u.prefault=l=>prefault(u,l),u.catch=l=>_catch(u,l),u.pipe=l=>pipe(u,l),u.readonly=()=>readonly(u),u.describe=l=>{const m=u.clone();return w.globalRegistry.add(m,{description:l}),m},Object.defineProperty(u,"description",{get(){return w.globalRegistry.get(u)?.description},configurable:!0}),u.meta=(...l)=>{if(0===l.length)return w.globalRegistry.get(u);const m=u.clone();return w.globalRegistry.add(m,l[0]),m},u.isOptional=()=>u.safeParse(void 0).success,u.isNullable=()=>u.safeParse(null).success,u)),j=f.$constructor("_ZodString",(u,l)=>{h.$ZodString.init(u,l),x.init(u,l);const m=u._zod.bag;u.format=m.format??null,u.minLength=m.minimum??null,u.maxLength=m.maximum??null,u.regex=(...l)=>u.check(b._regex(...l)),u.includes=(...l)=>u.check(b._includes(...l)),u.startsWith=(...l)=>u.check(b._startsWith(...l)),u.endsWith=(...l)=>u.check(b._endsWith(...l)),u.min=(...l)=>u.check(b._minLength(...l)),u.max=(...l)=>u.check(b._maxLength(...l)),u.length=(...l)=>u.check(b._length(...l)),u.nonempty=(...l)=>u.check(b._minLength(1,...l)),u.lowercase=l=>u.check(b._lowercase(l)),u.uppercase=l=>u.check(b._uppercase(l)),u.trim=()=>u.check(b._trim()),u.normalize=(...l)=>u.check(b._normalize(...l)),u.toLowerCase=()=>u.check(b._toLowerCase()),u.toUpperCase=()=>u.check(b._toUpperCase())}),E=f.$constructor("ZodString",(u,l)=>{h.$ZodString.init(u,l),j.init(u,l),u.email=l=>u.check(b._email(C,l)),u.url=l=>u.check(b._url(A,l)),u.jwt=l=>u.check(b._jwt(Q,l)),u.emoji=l=>u.check(b._emoji(O,l)),u.guid=l=>u.check(b._guid(Z,l)),u.uuid=l=>u.check(b._uuid(z,l)),u.uuidv4=l=>u.check(b._uuidv4(z,l)),u.uuidv6=l=>u.check(b._uuidv6(z,l)),u.uuidv7=l=>u.check(b._uuidv7(z,l)),u.nanoid=l=>u.check(b._nanoid(N,l)),u.guid=l=>u.check(b._guid(Z,l)),u.cuid=l=>u.check(b._cuid(D,l)),u.cuid2=l=>u.check(b._cuid2(M,l)),u.ulid=l=>u.check(b._ulid(U,l)),u.base64=l=>u.check(b._base64(J,l)),u.base64url=l=>u.check(b._base64url(G,l)),u.xid=l=>u.check(b._xid(L,l)),u.ksuid=l=>u.check(b._ksuid(F,l)),u.ipv4=l=>u.check(b._ipv4(V,l)),u.ipv6=l=>u.check(b._ipv6(K,l)),u.cidrv4=l=>u.check(b._cidrv4(H,l)),u.cidrv6=l=>u.check(b._cidrv6(B,l)),u.e164=l=>u.check(b._e164(W,l)),u.datetime=l=>u.check(S.datetime(l)),u.date=l=>u.check(S.date(l)),u.time=l=>u.check(S.time(l)),u.duration=l=>u.check(S.duration(l))});function string(u){return b._string(E,u)}const R=f.$constructor("ZodStringFormat",(u,l)=>{h.$ZodStringFormat.init(u,l),j.init(u,l)}),C=f.$constructor("ZodEmail",(u,l)=>{h.$ZodEmail.init(u,l),R.init(u,l)});function email(u){return b._email(C,u)}const Z=f.$constructor("ZodGUID",(u,l)=>{h.$ZodGUID.init(u,l),R.init(u,l)});function guid(u){return b._guid(Z,u)}const z=f.$constructor("ZodUUID",(u,l)=>{h.$ZodUUID.init(u,l),R.init(u,l)});function uuid(u){return b._uuid(z,u)}function uuidv4(u){return b._uuidv4(z,u)}function uuidv6(u){return b._uuidv6(z,u)}function uuidv7(u){return b._uuidv7(z,u)}const A=f.$constructor("ZodURL",(u,l)=>{h.$ZodURL.init(u,l),R.init(u,l)});function url(u){return b._url(A,u)}const O=f.$constructor("ZodEmoji",(u,l)=>{h.$ZodEmoji.init(u,l),R.init(u,l)});function emoji(u){return b._emoji(O,u)}const N=f.$constructor("ZodNanoID",(u,l)=>{h.$ZodNanoID.init(u,l),R.init(u,l)});function nanoid(u){return b._nanoid(N,u)}const D=f.$constructor("ZodCUID",(u,l)=>{h.$ZodCUID.init(u,l),R.init(u,l)});function cuid(u){return b._cuid(D,u)}const M=f.$constructor("ZodCUID2",(u,l)=>{h.$ZodCUID2.init(u,l),R.init(u,l)});function cuid2(u){return b._cuid2(M,u)}const U=f.$constructor("ZodULID",(u,l)=>{h.$ZodULID.init(u,l),R.init(u,l)});function ulid(u){return b._ulid(U,u)}const L=f.$constructor("ZodXID",(u,l)=>{h.$ZodXID.init(u,l),R.init(u,l)});function xid(u){return b._xid(L,u)}const F=f.$constructor("ZodKSUID",(u,l)=>{h.$ZodKSUID.init(u,l),R.init(u,l)});function ksuid(u){return b._ksuid(F,u)}const V=f.$constructor("ZodIPv4",(u,l)=>{h.$ZodIPv4.init(u,l),R.init(u,l)});function ipv4(u){return b._ipv4(V,u)}const K=f.$constructor("ZodIPv6",(u,l)=>{h.$ZodIPv6.init(u,l),R.init(u,l)});function ipv6(u){return b._ipv6(K,u)}const H=f.$constructor("ZodCIDRv4",(u,l)=>{h.$ZodCIDRv4.init(u,l),R.init(u,l)});function cidrv4(u){return b._cidrv4(H,u)}const B=f.$constructor("ZodCIDRv6",(u,l)=>{h.$ZodCIDRv6.init(u,l),R.init(u,l)});function cidrv6(u){return b._cidrv6(B,u)}const J=f.$constructor("ZodBase64",(u,l)=>{h.$ZodBase64.init(u,l),R.init(u,l)});function base64(u){return b._base64(J,u)}const G=f.$constructor("ZodBase64URL",(u,l)=>{h.$ZodBase64URL.init(u,l),R.init(u,l)});function base64url(u){return b._base64url(G,u)}const W=f.$constructor("ZodE164",(u,l)=>{h.$ZodE164.init(u,l),R.init(u,l)});function e164(u){return b._e164(W,u)}const Q=f.$constructor("ZodJWT",(u,l)=>{h.$ZodJWT.init(u,l),R.init(u,l)});function jwt(u){return b._jwt(Q,u)}const Y=f.$constructor("ZodCustomStringFormat",(u,l)=>{h.$ZodCustomStringFormat.init(u,l),R.init(u,l)});function stringFormat(u,l,m={}){return b._stringFormat(Y,u,l,m)}const X=f.$constructor("ZodNumber",(u,l)=>{h.$ZodNumber.init(u,l),x.init(u,l),u.gt=(l,m)=>u.check(b._gt(l,m)),u.gte=(l,m)=>u.check(b._gte(l,m)),u.min=(l,m)=>u.check(b._gte(l,m)),u.lt=(l,m)=>u.check(b._lt(l,m)),u.lte=(l,m)=>u.check(b._lte(l,m)),u.max=(l,m)=>u.check(b._lte(l,m)),u.int=l=>u.check(int(l)),u.safe=l=>u.check(int(l)),u.positive=l=>u.check(b._gt(0,l)),u.nonnegative=l=>u.check(b._gte(0,l)),u.negative=l=>u.check(b._lt(0,l)),u.nonpositive=l=>u.check(b._lte(0,l)),u.multipleOf=(l,m)=>u.check(b._multipleOf(l,m)),u.step=(l,m)=>u.check(b._multipleOf(l,m)),u.finite=()=>u;const m=u._zod.bag;u.minValue=Math.max(m.minimum??Number.NEGATIVE_INFINITY,m.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,u.maxValue=Math.min(m.maximum??Number.POSITIVE_INFINITY,m.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,u.isInt=(m.format??"").includes("int")||Number.isSafeInteger(m.multipleOf??.5),u.isFinite=!0,u.format=m.format??null});function number(u){return b._number(X,u)}const ee=f.$constructor("ZodNumberFormat",(u,l)=>{h.$ZodNumberFormat.init(u,l),X.init(u,l)});function int(u){return b._int(ee,u)}function float32(u){return b._float32(ee,u)}function float64(u){return b._float64(ee,u)}function int32(u){return b._int32(ee,u)}function uint32(u){return b._uint32(ee,u)}const te=f.$constructor("ZodBoolean",(u,l)=>{h.$ZodBoolean.init(u,l),x.init(u,l)});function boolean(u){return b._boolean(te,u)}const ne=f.$constructor("ZodBigInt",(u,l)=>{h.$ZodBigInt.init(u,l),x.init(u,l),u.gte=(l,m)=>u.check(b._gte(l,m)),u.min=(l,m)=>u.check(b._gte(l,m)),u.gt=(l,m)=>u.check(b._gt(l,m)),u.gte=(l,m)=>u.check(b._gte(l,m)),u.min=(l,m)=>u.check(b._gte(l,m)),u.lt=(l,m)=>u.check(b._lt(l,m)),u.lte=(l,m)=>u.check(b._lte(l,m)),u.max=(l,m)=>u.check(b._lte(l,m)),u.positive=l=>u.check(b._gt(BigInt(0),l)),u.negative=l=>u.check(b._lt(BigInt(0),l)),u.nonpositive=l=>u.check(b._lte(BigInt(0),l)),u.nonnegative=l=>u.check(b._gte(BigInt(0),l)),u.multipleOf=(l,m)=>u.check(b._multipleOf(l,m));const m=u._zod.bag;u.minValue=m.minimum??null,u.maxValue=m.maximum??null,u.format=m.format??null});function bigint(u){return b._bigint(ne,u)}const re=f.$constructor("ZodBigIntFormat",(u,l)=>{h.$ZodBigIntFormat.init(u,l),ne.init(u,l)});function int64(u){return b._int64(re,u)}function uint64(u){return b._uint64(re,u)}const oe=f.$constructor("ZodSymbol",(u,l)=>{h.$ZodSymbol.init(u,l),x.init(u,l)});function symbol(u){return b._symbol(oe,u)}const se=f.$constructor("ZodUndefined",(u,l)=>{h.$ZodUndefined.init(u,l),x.init(u,l)});function _undefined(u){return b._undefined(se,u)}const ie=f.$constructor("ZodNull",(u,l)=>{h.$ZodNull.init(u,l),x.init(u,l)});function _null(u){return b._null(ie,u)}const ae=f.$constructor("ZodAny",(u,l)=>{h.$ZodAny.init(u,l),x.init(u,l)});function any(){return b._any(ae)}const ce=f.$constructor("ZodUnknown",(u,l)=>{h.$ZodUnknown.init(u,l),x.init(u,l)});function unknown(){return b._unknown(ce)}const de=f.$constructor("ZodNever",(u,l)=>{h.$ZodNever.init(u,l),x.init(u,l)});function never(u){return b._never(de,u)}const ue=f.$constructor("ZodVoid",(u,l)=>{h.$ZodVoid.init(u,l),x.init(u,l)});function _void(u){return b._void(ue,u)}const le=f.$constructor("ZodDate",(u,l)=>{h.$ZodDate.init(u,l),x.init(u,l),u.min=(l,m)=>u.check(b._gte(l,m)),u.max=(l,m)=>u.check(b._lte(l,m));const m=u._zod.bag;u.minDate=m.minimum?new Date(m.minimum):null,u.maxDate=m.maximum?new Date(m.maximum):null});function date(u){return b._date(le,u)}const pe=f.$constructor("ZodArray",(u,l)=>{h.$ZodArray.init(u,l),x.init(u,l),u.element=l.element,u.min=(l,m)=>u.check(b._minLength(l,m)),u.nonempty=l=>u.check(b._minLength(1,l)),u.max=(l,m)=>u.check(b._maxLength(l,m)),u.length=(l,m)=>u.check(b._length(l,m)),u.unwrap=()=>u.element});function array(u,l){return b._array(pe,u,l)}function keyof(u){const l=u._zod.def.shape;return literal(Object.keys(l))}const me=f.$constructor("ZodObject",(u,l)=>{h.$ZodObject.init(u,l),x.init(u,l),v.defineLazy(u,"shape",()=>l.shape),u.keyof=()=>_enum(Object.keys(u._zod.def.shape)),u.catchall=l=>u.clone({...u._zod.def,catchall:l}),u.passthrough=()=>u.clone({...u._zod.def,catchall:unknown()}),u.loose=()=>u.clone({...u._zod.def,catchall:unknown()}),u.strict=()=>u.clone({...u._zod.def,catchall:never()}),u.strip=()=>u.clone({...u._zod.def,catchall:void 0}),u.extend=l=>v.extend(u,l),u.merge=l=>v.merge(u,l),u.pick=l=>v.pick(u,l),u.omit=l=>v.omit(u,l),u.partial=(...l)=>v.partial(xe,u,l[0]),u.required=(...l)=>v.required(Pe,u,l[0])});function object(u,l){const m={type:"object",get shape(){return v.assignProp(this,"shape",{...u}),this.shape},...v.normalizeParams(l)};return new me(m)}function strictObject(u,l){return new me({type:"object",get shape(){return v.assignProp(this,"shape",{...u}),this.shape},catchall:never(),...v.normalizeParams(l)})}function looseObject(u,l){return new me({type:"object",get shape(){return v.assignProp(this,"shape",{...u}),this.shape},catchall:unknown(),...v.normalizeParams(l)})}const fe=f.$constructor("ZodUnion",(u,l)=>{h.$ZodUnion.init(u,l),x.init(u,l),u.options=l.options});function union(u,l){return new fe({type:"union",options:u,...v.normalizeParams(l)})}const he=f.$constructor("ZodDiscriminatedUnion",(u,l)=>{fe.init(u,l),h.$ZodDiscriminatedUnion.init(u,l)});function discriminatedUnion(u,l,m){return new he({type:"union",options:l,discriminator:u,...v.normalizeParams(m)})}const ge=f.$constructor("ZodIntersection",(u,l)=>{h.$ZodIntersection.init(u,l),x.init(u,l)});function intersection(u,l){return new ge({type:"intersection",left:u,right:l})}const _e=f.$constructor("ZodTuple",(u,l)=>{h.$ZodTuple.init(u,l),x.init(u,l),u.rest=l=>u.clone({...u._zod.def,rest:l})});function tuple(u,l,m){const f=l instanceof h.$ZodType,y=f?m:l;return new _e({type:"tuple",items:u,rest:f?l:null,...v.normalizeParams(y)})}const ye=f.$constructor("ZodRecord",(u,l)=>{h.$ZodRecord.init(u,l),x.init(u,l),u.keyType=l.keyType,u.valueType=l.valueType});function record(u,l,m){return new ye({type:"record",keyType:u,valueType:l,...v.normalizeParams(m)})}function partialRecord(u,l,m){return new ye({type:"record",keyType:union([u,never()]),valueType:l,...v.normalizeParams(m)})}const ve=f.$constructor("ZodMap",(u,l)=>{h.$ZodMap.init(u,l),x.init(u,l),u.keyType=l.keyType,u.valueType=l.valueType});function map(u,l,m){return new ve({type:"map",keyType:u,valueType:l,...v.normalizeParams(m)})}const we=f.$constructor("ZodSet",(u,l)=>{h.$ZodSet.init(u,l),x.init(u,l),u.min=(...l)=>u.check(b._minSize(...l)),u.nonempty=l=>u.check(b._minSize(1,l)),u.max=(...l)=>u.check(b._maxSize(...l)),u.size=(...l)=>u.check(b._size(...l))});function set(u,l){return new we({type:"set",valueType:u,...v.normalizeParams(l)})}const be=f.$constructor("ZodEnum",(u,l)=>{h.$ZodEnum.init(u,l),x.init(u,l),u.enum=l.entries,u.options=Object.values(l.entries);const m=new Set(Object.keys(l.entries));u.extract=(u,f)=>{const h={};for(const f of u){if(!m.has(f))throw new Error(`Key ${f} not found in enum`);h[f]=l.entries[f]}return new be({...l,checks:[],...v.normalizeParams(f),entries:h})},u.exclude=(u,f)=>{const h={...l.entries};for(const l of u){if(!m.has(l))throw new Error(`Key ${l} not found in enum`);delete h[l]}return new be({...l,checks:[],...v.normalizeParams(f),entries:h})}});function _enum(u,l){const m=Array.isArray(u)?Object.fromEntries(u.map(u=>[u,u])):u;return new be({type:"enum",entries:m,...v.normalizeParams(l)})}function nativeEnum(u,l){return new be({type:"enum",entries:u,...v.normalizeParams(l)})}const ke=f.$constructor("ZodLiteral",(u,l)=>{h.$ZodLiteral.init(u,l),x.init(u,l),u.values=new Set(l.values),Object.defineProperty(u,"value",{get(){if(l.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return l.values[0]}})});function literal(u,l){return new ke({type:"literal",values:Array.isArray(u)?u:[u],...v.normalizeParams(l)})}const Se=f.$constructor("ZodFile",(u,l)=>{h.$ZodFile.init(u,l),x.init(u,l),u.min=(l,m)=>u.check(b._minSize(l,m)),u.max=(l,m)=>u.check(b._maxSize(l,m)),u.mime=(l,m)=>u.check(b._mime(Array.isArray(l)?l:[l],m))});function file(u){return b._file(Se,u)}const $e=f.$constructor("ZodTransform",(u,l)=>{h.$ZodTransform.init(u,l),x.init(u,l),u._zod.parse=(m,f)=>{m.addIssue=f=>{if("string"==typeof f)m.issues.push(v.issue(f,m.value,l));else{const l=f;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=m.value),l.inst??(l.inst=u),l.continue??(l.continue=!0),m.issues.push(v.issue(l))}};const h=l.transform(m.value,m);return h instanceof Promise?h.then(u=>(m.value=u,m)):(m.value=h,m)}});function transform(u){return new $e({type:"transform",transform:u})}const xe=f.$constructor("ZodOptional",(u,l)=>{h.$ZodOptional.init(u,l),x.init(u,l),u.unwrap=()=>u._zod.def.innerType});function optional(u){return new xe({type:"optional",innerType:u})}const je=f.$constructor("ZodNullable",(u,l)=>{h.$ZodNullable.init(u,l),x.init(u,l),u.unwrap=()=>u._zod.def.innerType});function nullable(u){return new je({type:"nullable",innerType:u})}function nullish(u){return optional(nullable(u))}const Te=f.$constructor("ZodDefault",(u,l)=>{h.$ZodDefault.init(u,l),x.init(u,l),u.unwrap=()=>u._zod.def.innerType,u.removeDefault=u.unwrap});function _default(u,l){return new Te({type:"default",innerType:u,get defaultValue(){return"function"==typeof l?l():l}})}const Ee=f.$constructor("ZodPrefault",(u,l)=>{h.$ZodPrefault.init(u,l),x.init(u,l),u.unwrap=()=>u._zod.def.innerType});function prefault(u,l){return new Ee({type:"prefault",innerType:u,get defaultValue(){return"function"==typeof l?l():l}})}const Pe=f.$constructor("ZodNonOptional",(u,l)=>{h.$ZodNonOptional.init(u,l),x.init(u,l),u.unwrap=()=>u._zod.def.innerType});function nonoptional(u,l){return new Pe({type:"nonoptional",innerType:u,...v.normalizeParams(l)})}const Ie=f.$constructor("ZodSuccess",(u,l)=>{h.$ZodSuccess.init(u,l),x.init(u,l),u.unwrap=()=>u._zod.def.innerType});function success(u){return new Ie({type:"success",innerType:u})}const Re=f.$constructor("ZodCatch",(u,l)=>{h.$ZodCatch.init(u,l),x.init(u,l),u.unwrap=()=>u._zod.def.innerType,u.removeCatch=u.unwrap});function _catch(u,l){return new Re({type:"catch",innerType:u,catchValue:"function"==typeof l?l:()=>l})}const Ce=f.$constructor("ZodNaN",(u,l)=>{h.$ZodNaN.init(u,l),x.init(u,l)});function nan(u){return b._nan(Ce,u)}const Ze=f.$constructor("ZodPipe",(u,l)=>{h.$ZodPipe.init(u,l),x.init(u,l),u.in=l.in,u.out=l.out});function pipe(u,l){return new Ze({type:"pipe",in:u,out:l})}const ze=f.$constructor("ZodReadonly",(u,l)=>{h.$ZodReadonly.init(u,l),x.init(u,l)});function readonly(u){return new ze({type:"readonly",innerType:u})}const Ae=f.$constructor("ZodTemplateLiteral",(u,l)=>{h.$ZodTemplateLiteral.init(u,l),x.init(u,l)});function templateLiteral(u,l){return new Ae({type:"template_literal",parts:u,...v.normalizeParams(l)})}const Oe=f.$constructor("ZodLazy",(u,l)=>{h.$ZodLazy.init(u,l),x.init(u,l),u.unwrap=()=>u._zod.def.getter()});function lazy(u){return new Oe({type:"lazy",getter:u})}const Ne=f.$constructor("ZodPromise",(u,l)=>{h.$ZodPromise.init(u,l),x.init(u,l),u.unwrap=()=>u._zod.def.innerType});function promise(u){return new Ne({type:"promise",innerType:u})}const De=f.$constructor("ZodCustom",(u,l)=>{h.$ZodCustom.init(u,l),x.init(u,l)});function check(u){const l=new y.$ZodCheck({check:"custom"});return l._zod.check=u,l}function custom(u,l){return b._custom(De,u??(()=>!0),l)}function refine(u,l={}){return b._refine(De,u,l)}function superRefine(u){const l=check(m=>(m.addIssue=u=>{if("string"==typeof u)m.issues.push(v.issue(u,m.value,l._zod.def));else{const f=u;f.fatal&&(f.continue=!1),f.code??(f.code="custom"),f.input??(f.input=m.value),f.inst??(f.inst=l),f.continue??(f.continue=!l._zod.def.abort),m.issues.push(v.issue(f))}},u(m.value,m)));return l}function _instanceof(u,l={error:`Input not instance of ${u.name}`}){const m=new De({type:"custom",check:"custom",fn:l=>l instanceof u,abort:!0,...v.normalizeParams(l)});return m._zod.bag.Class=u,m}const stringbool=(...u)=>b._stringbool({Pipe:Ze,Boolean:te,String:E,Transform:$e},...u);function json(u){const l=lazy(()=>union([string(u),number(),boolean(),_null(),array(l),record(string(),l)]));return l}function preprocess(u,l){return pipe(transform(u),l)}},"./node_modules/zod/v4/core/api.js":function(u,l,m){m.r(l),m.d(l,{TimePrecision:function(){return v},_any:function(){return _any},_array:function(){return _array},_base64:function(){return _base64},_base64url:function(){return _base64url},_bigint:function(){return _bigint},_boolean:function(){return _boolean},_catch:function(){return _catch},_cidrv4:function(){return _cidrv4},_cidrv6:function(){return _cidrv6},_coercedBigint:function(){return _coercedBigint},_coercedBoolean:function(){return _coercedBoolean},_coercedDate:function(){return _coercedDate},_coercedNumber:function(){return _coercedNumber},_coercedString:function(){return _coercedString},_cuid:function(){return _cuid},_cuid2:function(){return _cuid2},_custom:function(){return _custom},_date:function(){return _date},_default:function(){return _default},_discriminatedUnion:function(){return _discriminatedUnion},_e164:function(){return _e164},_email:function(){return _email},_emoji:function(){return _emoji},_endsWith:function(){return _endsWith},_enum:function(){return _enum},_file:function(){return _file},_float32:function(){return _float32},_float64:function(){return _float64},_gt:function(){return _gt},_gte:function(){return _gte},_guid:function(){return _guid},_includes:function(){return _includes},_int:function(){return _int},_int32:function(){return _int32},_int64:function(){return _int64},_intersection:function(){return _intersection},_ipv4:function(){return _ipv4},_ipv6:function(){return _ipv6},_isoDate:function(){return _isoDate},_isoDateTime:function(){return _isoDateTime},_isoDuration:function(){return _isoDuration},_isoTime:function(){return _isoTime},_jwt:function(){return _jwt},_ksuid:function(){return _ksuid},_lazy:function(){return _lazy},_length:function(){return _length},_literal:function(){return _literal},_lowercase:function(){return _lowercase},_lt:function(){return _lt},_lte:function(){return _lte},_map:function(){return _map},_max:function(){return _lte},_maxLength:function(){return _maxLength},_maxSize:function(){return _maxSize},_mime:function(){return _mime},_min:function(){return _gte},_minLength:function(){return _minLength},_minSize:function(){return _minSize},_multipleOf:function(){return _multipleOf},_nan:function(){return _nan},_nanoid:function(){return _nanoid},_nativeEnum:function(){return _nativeEnum},_negative:function(){return _negative},_never:function(){return _never},_nonnegative:function(){return _nonnegative},_nonoptional:function(){return _nonoptional},_nonpositive:function(){return _nonpositive},_normalize:function(){return _normalize},_null:function(){return _null},_nullable:function(){return _nullable},_number:function(){return _number},_optional:function(){return _optional},_overwrite:function(){return _overwrite},_pipe:function(){return _pipe},_positive:function(){return _positive},_promise:function(){return _promise},_property:function(){return _property},_readonly:function(){return _readonly},_record:function(){return _record},_refine:function(){return _refine},_regex:function(){return _regex},_set:function(){return _set},_size:function(){return _size},_startsWith:function(){return _startsWith},_string:function(){return _string},_stringFormat:function(){return _stringFormat},_stringbool:function(){return _stringbool},_success:function(){return _success},_symbol:function(){return _symbol},_templateLiteral:function(){return _templateLiteral},_toLowerCase:function(){return _toLowerCase},_toUpperCase:function(){return _toUpperCase},_transform:function(){return _transform},_trim:function(){return _trim},_tuple:function(){return _tuple},_uint32:function(){return _uint32},_uint64:function(){return _uint64},_ulid:function(){return _ulid},_undefined:function(){return _undefined},_union:function(){return _union},_unknown:function(){return _unknown},_uppercase:function(){return _uppercase},_url:function(){return _url},_uuid:function(){return _uuid},_uuidv4:function(){return _uuidv4},_uuidv6:function(){return _uuidv6},_uuidv7:function(){return _uuidv7},_void:function(){return _void},_xid:function(){return _xid}});var f=m("./node_modules/zod/v4/core/checks.js"),h=m("./node_modules/zod/v4/core/schemas.js"),y=m("./node_modules/zod/v4/core/util.js");function _string(u,l){return new u({type:"string",...y.normalizeParams(l)})}function _coercedString(u,l){return new u({type:"string",coerce:!0,...y.normalizeParams(l)})}function _email(u,l){return new u({type:"string",format:"email",check:"string_format",abort:!1,...y.normalizeParams(l)})}function _guid(u,l){return new u({type:"string",format:"guid",check:"string_format",abort:!1,...y.normalizeParams(l)})}function _uuid(u,l){return new u({type:"string",format:"uuid",check:"string_format",abort:!1,...y.normalizeParams(l)})}function _uuidv4(u,l){return new u({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...y.normalizeParams(l)})}function _uuidv6(u,l){return new u({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...y.normalizeParams(l)})}function _uuidv7(u,l){return new u({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...y.normalizeParams(l)})}function _url(u,l){return new u({type:"string",format:"url",check:"string_format",abort:!1,...y.normalizeParams(l)})}function _emoji(u,l){return new u({type:"string",format:"emoji",check:"string_format",abort:!1,...y.normalizeParams(l)})}function _nanoid(u,l){return new u({type:"string",format:"nanoid",check:"string_format",abort:!1,...y.normalizeParams(l)})}function _cuid(u,l){return new u({type:"string",format:"cuid",check:"string_format",abort:!1,...y.normalizeParams(l)})}function _cuid2(u,l){return new u({type:"string",format:"cuid2",check:"string_format",abort:!1,...y.normalizeParams(l)})}function _ulid(u,l){return new u({type:"string",format:"ulid",check:"string_format",abort:!1,...y.normalizeParams(l)})}function _xid(u,l){return new u({type:"string",format:"xid",check:"string_format",abort:!1,...y.normalizeParams(l)})}function _ksuid(u,l){return new u({type:"string",format:"ksuid",check:"string_format",abort:!1,...y.normalizeParams(l)})}function _ipv4(u,l){return new u({type:"string",format:"ipv4",check:"string_format",abort:!1,...y.normalizeParams(l)})}function _ipv6(u,l){return new u({type:"string",format:"ipv6",check:"string_format",abort:!1,...y.normalizeParams(l)})}function _cidrv4(u,l){return new u({type:"string",format:"cidrv4",check:"string_format",abort:!1,...y.normalizeParams(l)})}function _cidrv6(u,l){return new u({type:"string",format:"cidrv6",check:"string_format",abort:!1,...y.normalizeParams(l)})}function _base64(u,l){return new u({type:"string",format:"base64",check:"string_format",abort:!1,...y.normalizeParams(l)})}function _base64url(u,l){return new u({type:"string",format:"base64url",check:"string_format",abort:!1,...y.normalizeParams(l)})}function _e164(u,l){return new u({type:"string",format:"e164",check:"string_format",abort:!1,...y.normalizeParams(l)})}function _jwt(u,l){return new u({type:"string",format:"jwt",check:"string_format",abort:!1,...y.normalizeParams(l)})}const v={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function _isoDateTime(u,l){return new u({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...y.normalizeParams(l)})}function _isoDate(u,l){return new u({type:"string",format:"date",check:"string_format",...y.normalizeParams(l)})}function _isoTime(u,l){return new u({type:"string",format:"time",check:"string_format",precision:null,...y.normalizeParams(l)})}function _isoDuration(u,l){return new u({type:"string",format:"duration",check:"string_format",...y.normalizeParams(l)})}function _number(u,l){return new u({type:"number",checks:[],...y.normalizeParams(l)})}function _coercedNumber(u,l){return new u({type:"number",coerce:!0,checks:[],...y.normalizeParams(l)})}function _int(u,l){return new u({type:"number",check:"number_format",abort:!1,format:"safeint",...y.normalizeParams(l)})}function _float32(u,l){return new u({type:"number",check:"number_format",abort:!1,format:"float32",...y.normalizeParams(l)})}function _float64(u,l){return new u({type:"number",check:"number_format",abort:!1,format:"float64",...y.normalizeParams(l)})}function _int32(u,l){return new u({type:"number",check:"number_format",abort:!1,format:"int32",...y.normalizeParams(l)})}function _uint32(u,l){return new u({type:"number",check:"number_format",abort:!1,format:"uint32",...y.normalizeParams(l)})}function _boolean(u,l){return new u({type:"boolean",...y.normalizeParams(l)})}function _coercedBoolean(u,l){return new u({type:"boolean",coerce:!0,...y.normalizeParams(l)})}function _bigint(u,l){return new u({type:"bigint",...y.normalizeParams(l)})}function _coercedBigint(u,l){return new u({type:"bigint",coerce:!0,...y.normalizeParams(l)})}function _int64(u,l){return new u({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...y.normalizeParams(l)})}function _uint64(u,l){return new u({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...y.normalizeParams(l)})}function _symbol(u,l){return new u({type:"symbol",...y.normalizeParams(l)})}function _undefined(u,l){return new u({type:"undefined",...y.normalizeParams(l)})}function _null(u,l){return new u({type:"null",...y.normalizeParams(l)})}function _any(u){return new u({type:"any"})}function _unknown(u){return new u({type:"unknown"})}function _never(u,l){return new u({type:"never",...y.normalizeParams(l)})}function _void(u,l){return new u({type:"void",...y.normalizeParams(l)})}function _date(u,l){return new u({type:"date",...y.normalizeParams(l)})}function _coercedDate(u,l){return new u({type:"date",coerce:!0,...y.normalizeParams(l)})}function _nan(u,l){return new u({type:"nan",...y.normalizeParams(l)})}function _lt(u,l){return new f.$ZodCheckLessThan({check:"less_than",...y.normalizeParams(l),value:u,inclusive:!1})}function _lte(u,l){return new f.$ZodCheckLessThan({check:"less_than",...y.normalizeParams(l),value:u,inclusive:!0})}function _gt(u,l){return new f.$ZodCheckGreaterThan({check:"greater_than",...y.normalizeParams(l),value:u,inclusive:!1})}function _gte(u,l){return new f.$ZodCheckGreaterThan({check:"greater_than",...y.normalizeParams(l),value:u,inclusive:!0})}function _positive(u){return _gt(0,u)}function _negative(u){return _lt(0,u)}function _nonpositive(u){return _lte(0,u)}function _nonnegative(u){return _gte(0,u)}function _multipleOf(u,l){return new f.$ZodCheckMultipleOf({check:"multiple_of",...y.normalizeParams(l),value:u})}function _maxSize(u,l){return new f.$ZodCheckMaxSize({check:"max_size",...y.normalizeParams(l),maximum:u})}function _minSize(u,l){return new f.$ZodCheckMinSize({check:"min_size",...y.normalizeParams(l),minimum:u})}function _size(u,l){return new f.$ZodCheckSizeEquals({check:"size_equals",...y.normalizeParams(l),size:u})}function _maxLength(u,l){return new f.$ZodCheckMaxLength({check:"max_length",...y.normalizeParams(l),maximum:u})}function _minLength(u,l){return new f.$ZodCheckMinLength({check:"min_length",...y.normalizeParams(l),minimum:u})}function _length(u,l){return new f.$ZodCheckLengthEquals({check:"length_equals",...y.normalizeParams(l),length:u})}function _regex(u,l){return new f.$ZodCheckRegex({check:"string_format",format:"regex",...y.normalizeParams(l),pattern:u})}function _lowercase(u){return new f.$ZodCheckLowerCase({check:"string_format",format:"lowercase",...y.normalizeParams(u)})}function _uppercase(u){return new f.$ZodCheckUpperCase({check:"string_format",format:"uppercase",...y.normalizeParams(u)})}function _includes(u,l){return new f.$ZodCheckIncludes({check:"string_format",format:"includes",...y.normalizeParams(l),includes:u})}function _startsWith(u,l){return new f.$ZodCheckStartsWith({check:"string_format",format:"starts_with",...y.normalizeParams(l),prefix:u})}function _endsWith(u,l){return new f.$ZodCheckEndsWith({check:"string_format",format:"ends_with",...y.normalizeParams(l),suffix:u})}function _property(u,l,m){return new f.$ZodCheckProperty({check:"property",property:u,schema:l,...y.normalizeParams(m)})}function _mime(u,l){return new f.$ZodCheckMimeType({check:"mime_type",mime:u,...y.normalizeParams(l)})}function _overwrite(u){return new f.$ZodCheckOverwrite({check:"overwrite",tx:u})}function _normalize(u){return _overwrite(l=>l.normalize(u))}function _trim(){return _overwrite(u=>u.trim())}function _toLowerCase(){return _overwrite(u=>u.toLowerCase())}function _toUpperCase(){return _overwrite(u=>u.toUpperCase())}function _array(u,l,m){return new u({type:"array",element:l,...y.normalizeParams(m)})}function _union(u,l,m){return new u({type:"union",options:l,...y.normalizeParams(m)})}function _discriminatedUnion(u,l,m,f){return new u({type:"union",options:m,discriminator:l,...y.normalizeParams(f)})}function _intersection(u,l,m){return new u({type:"intersection",left:l,right:m})}function _tuple(u,l,m,f){const v=m instanceof h.$ZodType,w=v?f:m;return new u({type:"tuple",items:l,rest:v?m:null,...y.normalizeParams(w)})}function _record(u,l,m,f){return new u({type:"record",keyType:l,valueType:m,...y.normalizeParams(f)})}function _map(u,l,m,f){return new u({type:"map",keyType:l,valueType:m,...y.normalizeParams(f)})}function _set(u,l,m){return new u({type:"set",valueType:l,...y.normalizeParams(m)})}function _enum(u,l,m){return new u({type:"enum",entries:Array.isArray(l)?Object.fromEntries(l.map(u=>[u,u])):l,...y.normalizeParams(m)})}function _nativeEnum(u,l,m){return new u({type:"enum",entries:l,...y.normalizeParams(m)})}function _literal(u,l,m){return new u({type:"literal",values:Array.isArray(l)?l:[l],...y.normalizeParams(m)})}function _file(u,l){return new u({type:"file",...y.normalizeParams(l)})}function _transform(u,l){return new u({type:"transform",transform:l})}function _optional(u,l){return new u({type:"optional",innerType:l})}function _nullable(u,l){return new u({type:"nullable",innerType:l})}function _default(u,l,m){return new u({type:"default",innerType:l,get defaultValue(){return"function"==typeof m?m():m}})}function _nonoptional(u,l,m){return new u({type:"nonoptional",innerType:l,...y.normalizeParams(m)})}function _success(u,l){return new u({type:"success",innerType:l})}function _catch(u,l,m){return new u({type:"catch",innerType:l,catchValue:"function"==typeof m?m:()=>m})}function _pipe(u,l,m){return new u({type:"pipe",in:l,out:m})}function _readonly(u,l){return new u({type:"readonly",innerType:l})}function _templateLiteral(u,l,m){return new u({type:"template_literal",parts:l,...y.normalizeParams(m)})}function _lazy(u,l){return new u({type:"lazy",getter:l})}function _promise(u,l){return new u({type:"promise",innerType:l})}function _custom(u,l,m){const f=y.normalizeParams(m);f.abort??(f.abort=!0);return new u({type:"custom",check:"custom",fn:l,...f})}function _refine(u,l,m){return new u({type:"custom",check:"custom",fn:l,...y.normalizeParams(m)})}function _stringbool(u,l){const m=y.normalizeParams(l);let f=m.truthy??["true","1","yes","on","y","enabled"],v=m.falsy??["false","0","no","off","n","disabled"];"sensitive"!==m.case&&(f=f.map(u=>"string"==typeof u?u.toLowerCase():u),v=v.map(u=>"string"==typeof u?u.toLowerCase():u));const w=new Set(f),b=new Set(v),S=u.Pipe??h.$ZodPipe,$=u.Boolean??h.$ZodBoolean,x=u.String??h.$ZodString,j=new(u.Transform??h.$ZodTransform)({type:"transform",transform:(u,l)=>{let f=u;return"sensitive"!==m.case&&(f=f.toLowerCase()),!!w.has(f)||!b.has(f)&&(l.issues.push({code:"invalid_value",expected:"stringbool",values:[...w,...b],input:l.value,inst:j}),{})},error:m.error}),E=new S({type:"pipe",in:new x({type:"string",error:m.error}),out:j,error:m.error});return new S({type:"pipe",in:E,out:new $({type:"boolean",error:m.error}),error:m.error})}function _stringFormat(u,l,m,f={}){const h=y.normalizeParams(f),v={...y.normalizeParams(f),check:"string_format",type:"string",format:l,fn:"function"==typeof m?m:u=>m.test(u),...h};m instanceof RegExp&&(v.pattern=m);return new u(v)}},"./node_modules/zod/v4/core/checks.js":function(u,l,m){m.r(l),m.d(l,{$ZodCheck:function(){return v},$ZodCheckBigIntFormat:function(){return j},$ZodCheckEndsWith:function(){return F},$ZodCheckGreaterThan:function(){return S},$ZodCheckIncludes:function(){return U},$ZodCheckLengthEquals:function(){return A},$ZodCheckLessThan:function(){return b},$ZodCheckLowerCase:function(){return D},$ZodCheckMaxLength:function(){return Z},$ZodCheckMaxSize:function(){return E},$ZodCheckMimeType:function(){return K},$ZodCheckMinLength:function(){return z},$ZodCheckMinSize:function(){return R},$ZodCheckMultipleOf:function(){return $},$ZodCheckNumberFormat:function(){return x},$ZodCheckOverwrite:function(){return H},$ZodCheckProperty:function(){return V},$ZodCheckRegex:function(){return N},$ZodCheckSizeEquals:function(){return C},$ZodCheckStartsWith:function(){return L},$ZodCheckStringFormat:function(){return O},$ZodCheckUpperCase:function(){return M}});var f=m("./node_modules/zod/v4/core/core.js"),h=m("./node_modules/zod/v4/core/regexes.js"),y=m("./node_modules/zod/v4/core/util.js");const v=f.$constructor("$ZodCheck",(u,l)=>{var m;u._zod??(u._zod={}),u._zod.def=l,(m=u._zod).onattach??(m.onattach=[])}),w={number:"number",bigint:"bigint",object:"date"},b=f.$constructor("$ZodCheckLessThan",(u,l)=>{v.init(u,l);const m=w[typeof l.value];u._zod.onattach.push(u=>{const m=u._zod.bag,f=(l.inclusive?m.maximum:m.exclusiveMaximum)??Number.POSITIVE_INFINITY;l.value<f&&(l.inclusive?m.maximum=l.value:m.exclusiveMaximum=l.value)}),u._zod.check=f=>{(l.inclusive?f.value<=l.value:f.value<l.value)||f.issues.push({origin:m,code:"too_big",maximum:l.value,input:f.value,inclusive:l.inclusive,inst:u,continue:!l.abort})}}),S=f.$constructor("$ZodCheckGreaterThan",(u,l)=>{v.init(u,l);const m=w[typeof l.value];u._zod.onattach.push(u=>{const m=u._zod.bag,f=(l.inclusive?m.minimum:m.exclusiveMinimum)??Number.NEGATIVE_INFINITY;l.value>f&&(l.inclusive?m.minimum=l.value:m.exclusiveMinimum=l.value)}),u._zod.check=f=>{(l.inclusive?f.value>=l.value:f.value>l.value)||f.issues.push({origin:m,code:"too_small",minimum:l.value,input:f.value,inclusive:l.inclusive,inst:u,continue:!l.abort})}}),$=f.$constructor("$ZodCheckMultipleOf",(u,l)=>{v.init(u,l),u._zod.onattach.push(u=>{var m;(m=u._zod.bag).multipleOf??(m.multipleOf=l.value)}),u._zod.check=m=>{if(typeof m.value!=typeof l.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof m.value?m.value%l.value===BigInt(0):0===y.floatSafeRemainder(m.value,l.value))||m.issues.push({origin:typeof m.value,code:"not_multiple_of",divisor:l.value,input:m.value,inst:u,continue:!l.abort})}}),x=f.$constructor("$ZodCheckNumberFormat",(u,l)=>{v.init(u,l),l.format=l.format||"float64";const m=l.format?.includes("int"),f=m?"int":"number",[w,b]=y.NUMBER_FORMAT_RANGES[l.format];u._zod.onattach.push(u=>{const f=u._zod.bag;f.format=l.format,f.minimum=w,f.maximum=b,m&&(f.pattern=h.integer)}),u._zod.check=h=>{const y=h.value;if(m){if(!Number.isInteger(y))return void h.issues.push({expected:f,format:l.format,code:"invalid_type",input:y,inst:u});if(!Number.isSafeInteger(y))return void(y>0?h.issues.push({input:y,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:u,origin:f,continue:!l.abort}):h.issues.push({input:y,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:u,origin:f,continue:!l.abort}))}y<w&&h.issues.push({origin:"number",input:y,code:"too_small",minimum:w,inclusive:!0,inst:u,continue:!l.abort}),y>b&&h.issues.push({origin:"number",input:y,code:"too_big",maximum:b,inst:u})}}),j=f.$constructor("$ZodCheckBigIntFormat",(u,l)=>{v.init(u,l);const[m,f]=y.BIGINT_FORMAT_RANGES[l.format];u._zod.onattach.push(u=>{const h=u._zod.bag;h.format=l.format,h.minimum=m,h.maximum=f}),u._zod.check=h=>{const y=h.value;y<m&&h.issues.push({origin:"bigint",input:y,code:"too_small",minimum:m,inclusive:!0,inst:u,continue:!l.abort}),y>f&&h.issues.push({origin:"bigint",input:y,code:"too_big",maximum:f,inst:u})}}),E=f.$constructor("$ZodCheckMaxSize",(u,l)=>{var m;v.init(u,l),(m=u._zod.def).when??(m.when=u=>{const l=u.value;return!y.nullish(l)&&void 0!==l.size}),u._zod.onattach.push(u=>{const m=u._zod.bag.maximum??Number.POSITIVE_INFINITY;l.maximum<m&&(u._zod.bag.maximum=l.maximum)}),u._zod.check=m=>{const f=m.value;f.size<=l.maximum||m.issues.push({origin:y.getSizableOrigin(f),code:"too_big",maximum:l.maximum,input:f,inst:u,continue:!l.abort})}}),R=f.$constructor("$ZodCheckMinSize",(u,l)=>{var m;v.init(u,l),(m=u._zod.def).when??(m.when=u=>{const l=u.value;return!y.nullish(l)&&void 0!==l.size}),u._zod.onattach.push(u=>{const m=u._zod.bag.minimum??Number.NEGATIVE_INFINITY;l.minimum>m&&(u._zod.bag.minimum=l.minimum)}),u._zod.check=m=>{const f=m.value;f.size>=l.minimum||m.issues.push({origin:y.getSizableOrigin(f),code:"too_small",minimum:l.minimum,input:f,inst:u,continue:!l.abort})}}),C=f.$constructor("$ZodCheckSizeEquals",(u,l)=>{var m;v.init(u,l),(m=u._zod.def).when??(m.when=u=>{const l=u.value;return!y.nullish(l)&&void 0!==l.size}),u._zod.onattach.push(u=>{const m=u._zod.bag;m.minimum=l.size,m.maximum=l.size,m.size=l.size}),u._zod.check=m=>{const f=m.value,h=f.size;if(h===l.size)return;const v=h>l.size;m.issues.push({origin:y.getSizableOrigin(f),...v?{code:"too_big",maximum:l.size}:{code:"too_small",minimum:l.size},inclusive:!0,exact:!0,input:m.value,inst:u,continue:!l.abort})}}),Z=f.$constructor("$ZodCheckMaxLength",(u,l)=>{var m;v.init(u,l),(m=u._zod.def).when??(m.when=u=>{const l=u.value;return!y.nullish(l)&&void 0!==l.length}),u._zod.onattach.push(u=>{const m=u._zod.bag.maximum??Number.POSITIVE_INFINITY;l.maximum<m&&(u._zod.bag.maximum=l.maximum)}),u._zod.check=m=>{const f=m.value;if(f.length<=l.maximum)return;const h=y.getLengthableOrigin(f);m.issues.push({origin:h,code:"too_big",maximum:l.maximum,inclusive:!0,input:f,inst:u,continue:!l.abort})}}),z=f.$constructor("$ZodCheckMinLength",(u,l)=>{var m;v.init(u,l),(m=u._zod.def).when??(m.when=u=>{const l=u.value;return!y.nullish(l)&&void 0!==l.length}),u._zod.onattach.push(u=>{const m=u._zod.bag.minimum??Number.NEGATIVE_INFINITY;l.minimum>m&&(u._zod.bag.minimum=l.minimum)}),u._zod.check=m=>{const f=m.value;if(f.length>=l.minimum)return;const h=y.getLengthableOrigin(f);m.issues.push({origin:h,code:"too_small",minimum:l.minimum,inclusive:!0,input:f,inst:u,continue:!l.abort})}}),A=f.$constructor("$ZodCheckLengthEquals",(u,l)=>{var m;v.init(u,l),(m=u._zod.def).when??(m.when=u=>{const l=u.value;return!y.nullish(l)&&void 0!==l.length}),u._zod.onattach.push(u=>{const m=u._zod.bag;m.minimum=l.length,m.maximum=l.length,m.length=l.length}),u._zod.check=m=>{const f=m.value,h=f.length;if(h===l.length)return;const v=y.getLengthableOrigin(f),w=h>l.length;m.issues.push({origin:v,...w?{code:"too_big",maximum:l.length}:{code:"too_small",minimum:l.length},inclusive:!0,exact:!0,input:m.value,inst:u,continue:!l.abort})}}),O=f.$constructor("$ZodCheckStringFormat",(u,l)=>{var m,f;v.init(u,l),u._zod.onattach.push(u=>{const m=u._zod.bag;m.format=l.format,l.pattern&&(m.patterns??(m.patterns=new Set),m.patterns.add(l.pattern))}),l.pattern?(m=u._zod).check??(m.check=m=>{l.pattern.lastIndex=0,l.pattern.test(m.value)||m.issues.push({origin:"string",code:"invalid_format",format:l.format,input:m.value,...l.pattern?{pattern:l.pattern.toString()}:{},inst:u,continue:!l.abort})}):(f=u._zod).check??(f.check=()=>{})}),N=f.$constructor("$ZodCheckRegex",(u,l)=>{O.init(u,l),u._zod.check=m=>{l.pattern.lastIndex=0,l.pattern.test(m.value)||m.issues.push({origin:"string",code:"invalid_format",format:"regex",input:m.value,pattern:l.pattern.toString(),inst:u,continue:!l.abort})}}),D=f.$constructor("$ZodCheckLowerCase",(u,l)=>{l.pattern??(l.pattern=h.lowercase),O.init(u,l)}),M=f.$constructor("$ZodCheckUpperCase",(u,l)=>{l.pattern??(l.pattern=h.uppercase),O.init(u,l)}),U=f.$constructor("$ZodCheckIncludes",(u,l)=>{v.init(u,l);const m=y.escapeRegex(l.includes),f=new RegExp("number"==typeof l.position?`^.{${l.position}}${m}`:m);l.pattern=f,u._zod.onattach.push(u=>{const l=u._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(f)}),u._zod.check=m=>{m.value.includes(l.includes,l.position)||m.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:l.includes,input:m.value,inst:u,continue:!l.abort})}}),L=f.$constructor("$ZodCheckStartsWith",(u,l)=>{v.init(u,l);const m=new RegExp(`^${y.escapeRegex(l.prefix)}.*`);l.pattern??(l.pattern=m),u._zod.onattach.push(u=>{const l=u._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(m)}),u._zod.check=m=>{m.value.startsWith(l.prefix)||m.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:l.prefix,input:m.value,inst:u,continue:!l.abort})}}),F=f.$constructor("$ZodCheckEndsWith",(u,l)=>{v.init(u,l);const m=new RegExp(`.*${y.escapeRegex(l.suffix)}$`);l.pattern??(l.pattern=m),u._zod.onattach.push(u=>{const l=u._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(m)}),u._zod.check=m=>{m.value.endsWith(l.suffix)||m.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:l.suffix,input:m.value,inst:u,continue:!l.abort})}});function handleCheckPropertyResult(u,l,m){u.issues.length&&l.issues.push(...y.prefixIssues(m,u.issues))}const V=f.$constructor("$ZodCheckProperty",(u,l)=>{v.init(u,l),u._zod.check=u=>{const m=l.schema._zod.run({value:u.value[l.property],issues:[]},{});if(m instanceof Promise)return m.then(m=>handleCheckPropertyResult(m,u,l.property));handleCheckPropertyResult(m,u,l.property)}}),K=f.$constructor("$ZodCheckMimeType",(u,l)=>{v.init(u,l);const m=new Set(l.mime);u._zod.onattach.push(u=>{u._zod.bag.mime=l.mime}),u._zod.check=f=>{m.has(f.value.type)||f.issues.push({code:"invalid_value",values:l.mime,input:f.value.type,inst:u})}}),H=f.$constructor("$ZodCheckOverwrite",(u,l)=>{v.init(u,l),u._zod.check=u=>{u.value=l.tx(u.value)}})},"./node_modules/zod/v4/core/core.js":function(u,l,m){m.r(l),m.d(l,{$ZodAsyncError:function(){return $ZodAsyncError},$brand:function(){return h},$constructor:function(){return $constructor},NEVER:function(){return f},config:function(){return config},globalConfig:function(){return y}});const f=Object.freeze({status:"aborted"});function $constructor(u,l,m){function init(m,f){var h;Object.defineProperty(m,"_zod",{value:m._zod??{},enumerable:!1}),(h=m._zod).traits??(h.traits=new Set),m._zod.traits.add(u),l(m,f);for(const u in _.prototype)u in m||Object.defineProperty(m,u,{value:_.prototype[u].bind(m)});m._zod.constr=_,m._zod.def=f}const f=m?.Parent??Object;class Definition extends f{}function _(u){var l;const f=m?.Parent?new Definition:this;init(f,u),(l=f._zod).deferred??(l.deferred=[]);for(const u of f._zod.deferred)u();return f}return Object.defineProperty(Definition,"name",{value:u}),Object.defineProperty(_,"init",{value:init}),Object.defineProperty(_,Symbol.hasInstance,{value:l=>!!(m?.Parent&&l instanceof m.Parent)||l?._zod?.traits?.has(u)}),Object.defineProperty(_,"name",{value:u}),_}const h=Symbol("zod_brand");class $ZodAsyncError extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const y={};function config(u){return u&&Object.assign(y,u),y}},"./node_modules/zod/v4/core/doc.js":function(u,l,m){m.r(l),m.d(l,{Doc:function(){return Doc}});class Doc{constructor(u=[]){this.content=[],this.indent=0,this&&(this.args=u)}indented(u){this.indent+=1,u(this),this.indent-=1}write(u){if("function"==typeof u)return u(this,{execution:"sync"}),void u(this,{execution:"async"});const l=u.split("\n").filter(u=>u),m=Math.min(...l.map(u=>u.length-u.trimStart().length)),f=l.map(u=>u.slice(m)).map(u=>" ".repeat(2*this.indent)+u);for(const u of f)this.content.push(u)}compile(){const u=Function,l=this?.args;return new u(...l,[...(this?.content??[""]).map(u=>` ${u}`)].join("\n"))}}},"./node_modules/zod/v4/core/errors.js":function(u,l,m){m.r(l),m.d(l,{$ZodError:function(){return y},$ZodRealError:function(){return v},flattenError:function(){return flattenError},formatError:function(){return formatError},prettifyError:function(){return prettifyError},toDotPath:function(){return toDotPath},treeifyError:function(){return treeifyError}});var f=m("./node_modules/zod/v4/core/core.js"),h=m("./node_modules/zod/v4/core/util.js");const initializer=(u,l)=>{u.name="$ZodError",Object.defineProperty(u,"_zod",{value:u._zod,enumerable:!1}),Object.defineProperty(u,"issues",{value:l,enumerable:!1}),Object.defineProperty(u,"message",{get(){return JSON.stringify(l,h.jsonStringifyReplacer,2)},enumerable:!0}),Object.defineProperty(u,"toString",{value:()=>u.message,enumerable:!1})},y=(0,f.$constructor)("$ZodError",initializer),v=(0,f.$constructor)("$ZodError",initializer,{Parent:Error});function flattenError(u,l=u=>u.message){const m={},f=[];for(const h of u.issues)h.path.length>0?(m[h.path[0]]=m[h.path[0]]||[],m[h.path[0]].push(l(h))):f.push(l(h));return{formErrors:f,fieldErrors:m}}function formatError(u,l){const m=l||function(u){return u.message},f={_errors:[]},processError=u=>{for(const l of u.issues)if("invalid_union"===l.code&&l.errors.length)l.errors.map(u=>processError({issues:u}));else if("invalid_key"===l.code)processError({issues:l.issues});else if("invalid_element"===l.code)processError({issues:l.issues});else if(0===l.path.length)f._errors.push(m(l));else{let u=f,h=0;for(;h<l.path.length;){const f=l.path[h];h===l.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(m(l))):u[f]=u[f]||{_errors:[]},u=u[f],h++}}};return processError(u),f}function treeifyError(u,l){const m=l||function(u){return u.message},f={errors:[]},processError=(u,l=[])=>{var h,y;for(const v of u.issues)if("invalid_union"===v.code&&v.errors.length)v.errors.map(u=>processError({issues:u},v.path));else if("invalid_key"===v.code)processError({issues:v.issues},v.path);else if("invalid_element"===v.code)processError({issues:v.issues},v.path);else{const u=[...l,...v.path];if(0===u.length){f.errors.push(m(v));continue}let w=f,b=0;for(;b<u.length;){const l=u[b],f=b===u.length-1;"string"==typeof l?(w.properties??(w.properties={}),(h=w.properties)[l]??(h[l]={errors:[]}),w=w.properties[l]):(w.items??(w.items=[]),(y=w.items)[l]??(y[l]={errors:[]}),w=w.items[l]),f&&w.errors.push(m(v)),b++}}};return processError(u),f}function toDotPath(u){const l=[];for(const m of u)"number"==typeof m?l.push(`[${m}]`):"symbol"==typeof m?l.push(`[${JSON.stringify(String(m))}]`):/[^\w$]/.test(m)?l.push(`[${JSON.stringify(m)}]`):(l.length&&l.push("."),l.push(m));return l.join("")}function prettifyError(u){const l=[],m=[...u.issues].sort((u,l)=>u.path.length-l.path.length);for(const u of m)l.push(`✖ ${u.message}`),u.path?.length&&l.push(` → at ${toDotPath(u.path)}`);return l.join("\n")}},"./node_modules/zod/v4/core/parse.js":function(u,l,m){m.r(l),m.d(l,{_parse:function(){return _parse},_parseAsync:function(){return _parseAsync},_safeParse:function(){return _safeParse},_safeParseAsync:function(){return _safeParseAsync},parse:function(){return v},parseAsync:function(){return w},safeParse:function(){return b},safeParseAsync:function(){return S}});var f=m("./node_modules/zod/v4/core/core.js"),h=m("./node_modules/zod/v4/core/errors.js"),y=m("./node_modules/zod/v4/core/util.js");const _parse=u=>(l,m,h,v)=>{const w=h?Object.assign(h,{async:!1}):{async:!1},b=l._zod.run({value:m,issues:[]},w);if(b instanceof Promise)throw new f.$ZodAsyncError;if(b.issues.length){const l=new(v?.Err??u)(b.issues.map(u=>y.finalizeIssue(u,w,f.config())));throw y.captureStackTrace(l,v?.callee),l}return b.value},v=_parse(h.$ZodRealError),_parseAsync=u=>async(l,m,h,v)=>{const w=h?Object.assign(h,{async:!0}):{async:!0};let b=l._zod.run({value:m,issues:[]},w);if(b instanceof Promise&&(b=await b),b.issues.length){const l=new(v?.Err??u)(b.issues.map(u=>y.finalizeIssue(u,w,f.config())));throw y.captureStackTrace(l,v?.callee),l}return b.value},w=_parseAsync(h.$ZodRealError),_safeParse=u=>(l,m,v)=>{const w=v?{...v,async:!1}:{async:!1},b=l._zod.run({value:m,issues:[]},w);if(b instanceof Promise)throw new f.$ZodAsyncError;return b.issues.length?{success:!1,error:new(u??h.$ZodError)(b.issues.map(u=>y.finalizeIssue(u,w,f.config())))}:{success:!0,data:b.value}},b=_safeParse(h.$ZodRealError),_safeParseAsync=u=>async(l,m,h)=>{const v=h?Object.assign(h,{async:!0}):{async:!0};let w=l._zod.run({value:m,issues:[]},v);return w instanceof Promise&&(w=await w),w.issues.length?{success:!1,error:new u(w.issues.map(u=>y.finalizeIssue(u,v,f.config())))}:{success:!0,data:w.value}},S=_safeParseAsync(h.$ZodRealError)},"./node_modules/zod/v4/core/regexes.js":function(u,l,m){m.r(l),m.d(l,{_emoji:function(){return N},base64:function(){return F},base64url:function(){return V},bigint:function(){return W},boolean:function(){return X},browserEmail:function(){return O},cidrv4:function(){return U},cidrv6:function(){return L},cuid:function(){return f},cuid2:function(){return h},date:function(){return G},datetime:function(){return datetime},domain:function(){return H},duration:function(){return S},e164:function(){return B},email:function(){return C},emoji:function(){return emoji},extendedDuration:function(){return $},guid:function(){return x},hostname:function(){return K},html5Email:function(){return Z},integer:function(){return Q},ipv4:function(){return D},ipv6:function(){return M},ksuid:function(){return w},lowercase:function(){return ne},nanoid:function(){return b},null:function(){return ee},number:function(){return Y},rfc5322Email:function(){return z},string:function(){return string},time:function(){return time},ulid:function(){return y},undefined:function(){return te},unicodeEmail:function(){return A},uppercase:function(){return re},uuid:function(){return uuid},uuid4:function(){return j},uuid6:function(){return E},uuid7:function(){return R},xid:function(){return v}});const f=/^[cC][^\s-]{8,}$/,h=/^[0-9a-z]+$/,y=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,v=/^[0-9a-vA-V]{20}$/,w=/^[A-Za-z0-9]{27}$/,b=/^[a-zA-Z0-9_-]{21}$/,S=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,$=/^[-+]?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)?)??$/,x=/^([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})$/,uuid=u=>u?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${u}[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)$/,j=uuid(4),E=uuid(6),R=uuid(7),C=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Z=/^[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])?)*$/,z=/^(([^<>()\[\]\\.,;:\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,}))$/,A=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,O=/^[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})+$";function emoji(){return new RegExp(N,"u")}const D=/^(?:(?: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])$/,M=/^(([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})$/,U=/^((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])$/,L=/^(([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])$/,F=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,V=/^[A-Za-z0-9_-]*$/,K=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,H=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,B=/^\+(?:[0-9]){6,14}[0-9]$/,J="(?:(?:\\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])))",G=new RegExp(`^${J}$`);function timeSource(u){const l="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof u.precision?-1===u.precision?`${l}`:0===u.precision?`${l}:[0-5]\\d`:`${l}:[0-5]\\d\\.\\d{${u.precision}}`:`${l}(?::[0-5]\\d(?:\\.\\d+)?)?`}function time(u){return new RegExp(`^${timeSource(u)}$`)}function datetime(u){const l=timeSource({precision:u.precision}),m=["Z"];u.local&&m.push(""),u.offset&&m.push("([+-]\\d{2}:\\d{2})");const f=`${l}(?:${m.join("|")})`;return new RegExp(`^${J}T(?:${f})$`)}const string=u=>new RegExp(`^${u?`[\\s\\S]{${u?.minimum??0},${u?.maximum??""}}`:"[\\s\\S]*"}$`),W=/^\d+n?$/,Q=/^\d+$/,Y=/^-?\d+(?:\.\d+)?/i,X=/true|false/i,ee=/null/i,te=/undefined/i,ne=/^[^A-Z]*$/,re=/^[^a-z]*$/},"./node_modules/zod/v4/core/registries.js":function(u,l,m){m.r(l),m.d(l,{$ZodRegistry:function(){return $ZodRegistry},$input:function(){return h},$output:function(){return f},globalRegistry:function(){return y},registry:function(){return registry}});const f=Symbol("ZodOutput"),h=Symbol("ZodInput");class $ZodRegistry{constructor(){this._map=new Map,this._idmap=new Map}add(u,...l){const m=l[0];if(this._map.set(u,m),m&&"object"==typeof m&&"id"in m){if(this._idmap.has(m.id))throw new Error(`ID ${m.id} already exists in the registry`);this._idmap.set(m.id,u)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(u){const l=this._map.get(u);return l&&"object"==typeof l&&"id"in l&&this._idmap.delete(l.id),this._map.delete(u),this}get(u){const l=u._zod.parent;if(l){const m={...this.get(l)??{}};return delete m.id,{...m,...this._map.get(u)}}return this._map.get(u)}has(u){return this._map.has(u)}}function registry(){return new $ZodRegistry}const y=registry()},"./node_modules/zod/v4/core/schemas.js":function(u,l,m){m.r(l),m.d(l,{$ZodAny:function(){return de},$ZodArray:function(){return fe},$ZodBase64:function(){return W},$ZodBase64URL:function(){return Q},$ZodBigInt:function(){return oe},$ZodBigIntFormat:function(){return se},$ZodBoolean:function(){return re},$ZodCIDRv4:function(){return J},$ZodCIDRv6:function(){return G},$ZodCUID:function(){return O},$ZodCUID2:function(){return N},$ZodCatch:function(){return Ze},$ZodCustom:function(){return Ue},$ZodCustomStringFormat:function(){return ee},$ZodDate:function(){return me},$ZodDefault:function(){return Pe},$ZodDiscriminatedUnion:function(){return _e},$ZodE164:function(){return Y},$ZodEmail:function(){return C},$ZodEmoji:function(){return z},$ZodEnum:function(){return Se},$ZodFile:function(){return xe},$ZodGUID:function(){return E},$ZodIPv4:function(){return H},$ZodIPv6:function(){return B},$ZodISODate:function(){return F},$ZodISODateTime:function(){return L},$ZodISODuration:function(){return K},$ZodISOTime:function(){return V},$ZodIntersection:function(){return ye},$ZodJWT:function(){return X},$ZodKSUID:function(){return U},$ZodLazy:function(){return Me},$ZodLiteral:function(){return $e},$ZodMap:function(){return be},$ZodNaN:function(){return ze},$ZodNanoID:function(){return A},$ZodNever:function(){return le},$ZodNonOptional:function(){return Re},$ZodNull:function(){return ce},$ZodNullable:function(){return Ee},$ZodNumber:function(){return te},$ZodNumberFormat:function(){return ne},$ZodObject:function(){return he},$ZodOptional:function(){return Te},$ZodPipe:function(){return Ae},$ZodPrefault:function(){return Ie},$ZodPromise:function(){return De},$ZodReadonly:function(){return Oe},$ZodRecord:function(){return we},$ZodSet:function(){return ke},$ZodString:function(){return x},$ZodStringFormat:function(){return j},$ZodSuccess:function(){return Ce},$ZodSymbol:function(){return ie},$ZodTemplateLiteral:function(){return Ne},$ZodTransform:function(){return je},$ZodTuple:function(){return ve},$ZodType:function(){return $},$ZodULID:function(){return D},$ZodURL:function(){return Z},$ZodUUID:function(){return R},$ZodUndefined:function(){return ae},$ZodUnion:function(){return ge},$ZodUnknown:function(){return ue},$ZodVoid:function(){return pe},$ZodXID:function(){return M},clone:function(){return b.clone},isValidBase64:function(){return isValidBase64},isValidBase64URL:function(){return isValidBase64URL},isValidJWT:function(){return isValidJWT}});var f=m("./node_modules/zod/v4/core/checks.js"),h=m("./node_modules/zod/v4/core/core.js"),y=m("./node_modules/zod/v4/core/doc.js"),v=m("./node_modules/zod/v4/core/parse.js"),w=m("./node_modules/zod/v4/core/regexes.js"),b=m("./node_modules/zod/v4/core/util.js"),S=m("./node_modules/zod/v4/core/versions.js");const $=h.$constructor("$ZodType",(u,l)=>{var m;u??(u={}),u._zod.def=l,u._zod.bag=u._zod.bag||{},u._zod.version=S.version;const f=[...u._zod.def.checks??[]];u._zod.traits.has("$ZodCheck")&&f.unshift(u);for(const l of f)for(const m of l._zod.onattach)m(u);if(0===f.length)(m=u._zod).deferred??(m.deferred=[]),u._zod.deferred?.push(()=>{u._zod.run=u._zod.parse});else{const runChecks=(u,l,m)=>{let f,y=b.aborted(u);for(const v of l){if(v._zod.def.when){if(!v._zod.def.when(u))continue}else if(y)continue;const l=u.issues.length,w=v._zod.check(u);if(w instanceof Promise&&!1===m?.async)throw new h.$ZodAsyncError;if(f||w instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await w;u.issues.length!==l&&(y||(y=b.aborted(u,l)))});else{if(u.issues.length===l)continue;y||(y=b.aborted(u,l))}}return f?f.then(()=>u):u};u._zod.run=(l,m)=>{const y=u._zod.parse(l,m);if(y instanceof Promise){if(!1===m.async)throw new h.$ZodAsyncError;return y.then(u=>runChecks(u,f,m))}return runChecks(y,f,m)}}u["~standard"]={validate:l=>{try{const m=(0,v.safeParse)(u,l);return m.success?{value:m.data}:{issues:m.error?.issues}}catch(m){return(0,v.safeParseAsync)(u,l).then(u=>u.success?{value:u.data}:{issues:u.error?.issues})}},vendor:"zod",version:1}}),x=h.$constructor("$ZodString",(u,l)=>{$.init(u,l),u._zod.pattern=[...u?._zod.bag?.patterns??[]].pop()??w.string(u._zod.bag),u._zod.parse=(m,f)=>{if(l.coerce)try{m.value=String(m.value)}catch(f){}return"string"==typeof m.value||m.issues.push({expected:"string",code:"invalid_type",input:m.value,inst:u}),m}}),j=h.$constructor("$ZodStringFormat",(u,l)=>{f.$ZodCheckStringFormat.init(u,l),x.init(u,l)}),E=h.$constructor("$ZodGUID",(u,l)=>{l.pattern??(l.pattern=w.guid),j.init(u,l)}),R=h.$constructor("$ZodUUID",(u,l)=>{if(l.version){const u={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[l.version];if(void 0===u)throw new Error(`Invalid UUID version: "${l.version}"`);l.pattern??(l.pattern=w.uuid(u))}else l.pattern??(l.pattern=w.uuid());j.init(u,l)}),C=h.$constructor("$ZodEmail",(u,l)=>{l.pattern??(l.pattern=w.email),j.init(u,l)}),Z=h.$constructor("$ZodURL",(u,l)=>{j.init(u,l),u._zod.check=m=>{try{const f=m.value,h=new URL(f),y=h.href;return l.hostname&&(l.hostname.lastIndex=0,l.hostname.test(h.hostname)||m.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:w.hostname.source,input:m.value,inst:u,continue:!l.abort})),l.protocol&&(l.protocol.lastIndex=0,l.protocol.test(h.protocol.endsWith(":")?h.protocol.slice(0,-1):h.protocol)||m.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:l.protocol.source,input:m.value,inst:u,continue:!l.abort})),void(!f.endsWith("/")&&y.endsWith("/")?m.value=y.slice(0,-1):m.value=y)}catch(f){m.issues.push({code:"invalid_format",format:"url",input:m.value,inst:u,continue:!l.abort})}}}),z=h.$constructor("$ZodEmoji",(u,l)=>{l.pattern??(l.pattern=w.emoji()),j.init(u,l)}),A=h.$constructor("$ZodNanoID",(u,l)=>{l.pattern??(l.pattern=w.nanoid),j.init(u,l)}),O=h.$constructor("$ZodCUID",(u,l)=>{l.pattern??(l.pattern=w.cuid),j.init(u,l)}),N=h.$constructor("$ZodCUID2",(u,l)=>{l.pattern??(l.pattern=w.cuid2),j.init(u,l)}),D=h.$constructor("$ZodULID",(u,l)=>{l.pattern??(l.pattern=w.ulid),j.init(u,l)}),M=h.$constructor("$ZodXID",(u,l)=>{l.pattern??(l.pattern=w.xid),j.init(u,l)}),U=h.$constructor("$ZodKSUID",(u,l)=>{l.pattern??(l.pattern=w.ksuid),j.init(u,l)}),L=h.$constructor("$ZodISODateTime",(u,l)=>{l.pattern??(l.pattern=w.datetime(l)),j.init(u,l)}),F=h.$constructor("$ZodISODate",(u,l)=>{l.pattern??(l.pattern=w.date),j.init(u,l)}),V=h.$constructor("$ZodISOTime",(u,l)=>{l.pattern??(l.pattern=w.time(l)),j.init(u,l)}),K=h.$constructor("$ZodISODuration",(u,l)=>{l.pattern??(l.pattern=w.duration),j.init(u,l)}),H=h.$constructor("$ZodIPv4",(u,l)=>{l.pattern??(l.pattern=w.ipv4),j.init(u,l),u._zod.onattach.push(u=>{u._zod.bag.format="ipv4"})}),B=h.$constructor("$ZodIPv6",(u,l)=>{l.pattern??(l.pattern=w.ipv6),j.init(u,l),u._zod.onattach.push(u=>{u._zod.bag.format="ipv6"}),u._zod.check=m=>{try{new URL(`http://[${m.value}]`)}catch{m.issues.push({code:"invalid_format",format:"ipv6",input:m.value,inst:u,continue:!l.abort})}}}),J=h.$constructor("$ZodCIDRv4",(u,l)=>{l.pattern??(l.pattern=w.cidrv4),j.init(u,l)}),G=h.$constructor("$ZodCIDRv6",(u,l)=>{l.pattern??(l.pattern=w.cidrv6),j.init(u,l),u._zod.check=m=>{const[f,h]=m.value.split("/");try{if(!h)throw new Error;const u=Number(h);if(`${u}`!==h)throw new Error;if(u<0||u>128)throw new Error;new URL(`http://[${f}]`)}catch{m.issues.push({code:"invalid_format",format:"cidrv6",input:m.value,inst:u,continue:!l.abort})}}});function isValidBase64(u){if(""===u)return!0;if(u.length%4!=0)return!1;try{return atob(u),!0}catch{return!1}}const W=h.$constructor("$ZodBase64",(u,l)=>{l.pattern??(l.pattern=w.base64),j.init(u,l),u._zod.onattach.push(u=>{u._zod.bag.contentEncoding="base64"}),u._zod.check=m=>{isValidBase64(m.value)||m.issues.push({code:"invalid_format",format:"base64",input:m.value,inst:u,continue:!l.abort})}});function isValidBase64URL(u){if(!w.base64url.test(u))return!1;const l=u.replace(/[-_]/g,u=>"-"===u?"+":"/");return isValidBase64(l.padEnd(4*Math.ceil(l.length/4),"="))}const Q=h.$constructor("$ZodBase64URL",(u,l)=>{l.pattern??(l.pattern=w.base64url),j.init(u,l),u._zod.onattach.push(u=>{u._zod.bag.contentEncoding="base64url"}),u._zod.check=m=>{isValidBase64URL(m.value)||m.issues.push({code:"invalid_format",format:"base64url",input:m.value,inst:u,continue:!l.abort})}}),Y=h.$constructor("$ZodE164",(u,l)=>{l.pattern??(l.pattern=w.e164),j.init(u,l)});function isValidJWT(u,l=null){try{const m=u.split(".");if(3!==m.length)return!1;const[f]=m;if(!f)return!1;const h=JSON.parse(atob(f));return(!("typ"in h)||"JWT"===h?.typ)&&(!!h.alg&&(!l||"alg"in h&&h.alg===l))}catch{return!1}}const X=h.$constructor("$ZodJWT",(u,l)=>{j.init(u,l),u._zod.check=m=>{isValidJWT(m.value,l.alg)||m.issues.push({code:"invalid_format",format:"jwt",input:m.value,inst:u,continue:!l.abort})}}),ee=h.$constructor("$ZodCustomStringFormat",(u,l)=>{j.init(u,l),u._zod.check=m=>{l.fn(m.value)||m.issues.push({code:"invalid_format",format:l.format,input:m.value,inst:u,continue:!l.abort})}}),te=h.$constructor("$ZodNumber",(u,l)=>{$.init(u,l),u._zod.pattern=u._zod.bag.pattern??w.number,u._zod.parse=(m,f)=>{if(l.coerce)try{m.value=Number(m.value)}catch(u){}const h=m.value;if("number"==typeof h&&!Number.isNaN(h)&&Number.isFinite(h))return m;const y="number"==typeof h?Number.isNaN(h)?"NaN":Number.isFinite(h)?void 0:"Infinity":void 0;return m.issues.push({expected:"number",code:"invalid_type",input:h,inst:u,...y?{received:y}:{}}),m}}),ne=h.$constructor("$ZodNumber",(u,l)=>{f.$ZodCheckNumberFormat.init(u,l),te.init(u,l)}),re=h.$constructor("$ZodBoolean",(u,l)=>{$.init(u,l),u._zod.pattern=w.boolean,u._zod.parse=(m,f)=>{if(l.coerce)try{m.value=Boolean(m.value)}catch(u){}const h=m.value;return"boolean"==typeof h||m.issues.push({expected:"boolean",code:"invalid_type",input:h,inst:u}),m}}),oe=h.$constructor("$ZodBigInt",(u,l)=>{$.init(u,l),u._zod.pattern=w.bigint,u._zod.parse=(m,f)=>{if(l.coerce)try{m.value=BigInt(m.value)}catch(u){}return"bigint"==typeof m.value||m.issues.push({expected:"bigint",code:"invalid_type",input:m.value,inst:u}),m}}),se=h.$constructor("$ZodBigInt",(u,l)=>{f.$ZodCheckBigIntFormat.init(u,l),oe.init(u,l)}),ie=h.$constructor("$ZodSymbol",(u,l)=>{$.init(u,l),u._zod.parse=(l,m)=>{const f=l.value;return"symbol"==typeof f||l.issues.push({expected:"symbol",code:"invalid_type",input:f,inst:u}),l}}),ae=h.$constructor("$ZodUndefined",(u,l)=>{$.init(u,l),u._zod.pattern=w.undefined,u._zod.values=new Set([void 0]),u._zod.optin="optional",u._zod.optout="optional",u._zod.parse=(l,m)=>{const f=l.value;return void 0===f||l.issues.push({expected:"undefined",code:"invalid_type",input:f,inst:u}),l}}),ce=h.$constructor("$ZodNull",(u,l)=>{$.init(u,l),u._zod.pattern=w.null,u._zod.values=new Set([null]),u._zod.parse=(l,m)=>{const f=l.value;return null===f||l.issues.push({expected:"null",code:"invalid_type",input:f,inst:u}),l}}),de=h.$constructor("$ZodAny",(u,l)=>{$.init(u,l),u._zod.parse=u=>u}),ue=h.$constructor("$ZodUnknown",(u,l)=>{$.init(u,l),u._zod.parse=u=>u}),le=h.$constructor("$ZodNever",(u,l)=>{$.init(u,l),u._zod.parse=(l,m)=>(l.issues.push({expected:"never",code:"invalid_type",input:l.value,inst:u}),l)}),pe=h.$constructor("$ZodVoid",(u,l)=>{$.init(u,l),u._zod.parse=(l,m)=>{const f=l.value;return void 0===f||l.issues.push({expected:"void",code:"invalid_type",input:f,inst:u}),l}}),me=h.$constructor("$ZodDate",(u,l)=>{$.init(u,l),u._zod.parse=(m,f)=>{if(l.coerce)try{m.value=new Date(m.value)}catch(u){}const h=m.value,y=h instanceof Date;return y&&!Number.isNaN(h.getTime())||m.issues.push({expected:"date",code:"invalid_type",input:h,...y?{received:"Invalid Date"}:{},inst:u}),m}});function handleArrayResult(u,l,m){u.issues.length&&l.issues.push(...b.prefixIssues(m,u.issues)),l.value[m]=u.value}const fe=h.$constructor("$ZodArray",(u,l)=>{$.init(u,l),u._zod.parse=(m,f)=>{const h=m.value;if(!Array.isArray(h))return m.issues.push({expected:"array",code:"invalid_type",input:h,inst:u}),m;m.value=Array(h.length);const y=[];for(let u=0;u<h.length;u++){const v=h[u],w=l.element._zod.run({value:v,issues:[]},f);w instanceof Promise?y.push(w.then(l=>handleArrayResult(l,m,u))):handleArrayResult(w,m,u)}return y.length?Promise.all(y).then(()=>m):m}});function handleObjectResult(u,l,m){u.issues.length&&l.issues.push(...b.prefixIssues(m,u.issues)),l.value[m]=u.value}function handleOptionalObjectResult(u,l,m,f){u.issues.length?void 0===f[m]?l.value[m]=m in f?void 0:u.value:l.issues.push(...b.prefixIssues(m,u.issues)):void 0===u.value?m in f&&(l.value[m]=void 0):l.value[m]=u.value}const he=h.$constructor("$ZodObject",(u,l)=>{$.init(u,l);const m=b.cached(()=>{const u=Object.keys(l.shape);for(const m of u)if(!(l.shape[m]instanceof $))throw new Error(`Invalid element at key "${m}": expected a Zod schema`);const m=b.optionalKeys(l.shape);return{shape:l.shape,keys:u,keySet:new Set(u),numKeys:u.length,optionalKeys:new Set(m)}});b.defineLazy(u._zod,"propValues",()=>{const u=l.shape,m={};for(const l in u){const f=u[l]._zod;if(f.values){m[l]??(m[l]=new Set);for(const u of f.values)m[l].add(u)}}return m});let f;const v=b.isObject,w=!h.globalConfig.jitless,S=b.allowsEval,x=w&&S.value,j=l.catchall;let E;u._zod.parse=(h,S)=>{E??(E=m.value);const $=h.value;if(!v($))return h.issues.push({expected:"object",code:"invalid_type",input:$,inst:u}),h;const R=[];if(w&&x&&!1===S?.async&&!0!==S.jitless)f||(f=(u=>{const l=new y.Doc(["shape","payload","ctx"]),f=m.value,parseStr=u=>{const l=b.esc(u);return`shape[${l}]._zod.run({ value: input[${l}], issues: [] }, ctx)`};l.write("const input = payload.value;");const h=Object.create(null);let v=0;for(const u of f.keys)h[u]="key_"+v++;l.write("const newResult = {}");for(const u of f.keys)if(f.optionalKeys.has(u)){const m=h[u];l.write(`const ${m} = ${parseStr(u)};`);const f=b.esc(u);l.write(`\n if (${m}.issues.length) {\n if (input[${f}] === undefined) {\n if (${f} in input) {\n newResult[${f}] = undefined;\n }\n } else {\n payload.issues = payload.issues.concat(\n ${m}.issues.map((iss) => ({\n ...iss,\n path: iss.path ? [${f}, ...iss.path] : [${f}],\n }))\n );\n }\n } else if (${m}.value === undefined) {\n if (${f} in input) newResult[${f}] = undefined;\n } else {\n newResult[${f}] = ${m}.value;\n }\n `)}else{const m=h[u];l.write(`const ${m} = ${parseStr(u)};`),l.write(`\n if (${m}.issues.length) payload.issues = payload.issues.concat(${m}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${b.esc(u)}, ...iss.path] : [${b.esc(u)}]\n })));`),l.write(`newResult[${b.esc(u)}] = ${m}.value`)}l.write("payload.value = newResult;"),l.write("return payload;");const w=l.compile();return(l,m)=>w(u,l,m)})(l.shape)),h=f(h,S);else{h.value={};const u=E.shape;for(const l of E.keys){const m=u[l],f=m._zod.run({value:$[l],issues:[]},S),y="optional"===m._zod.optin&&"optional"===m._zod.optout;f instanceof Promise?R.push(f.then(u=>y?handleOptionalObjectResult(u,h,l,$):handleObjectResult(u,h,l))):y?handleOptionalObjectResult(f,h,l,$):handleObjectResult(f,h,l)}}if(!j)return R.length?Promise.all(R).then(()=>h):h;const C=[],Z=E.keySet,z=j._zod,A=z.def.type;for(const u of Object.keys($)){if(Z.has(u))continue;if("never"===A){C.push(u);continue}const l=z.run({value:$[u],issues:[]},S);l instanceof Promise?R.push(l.then(l=>handleObjectResult(l,h,u))):handleObjectResult(l,h,u)}return C.length&&h.issues.push({code:"unrecognized_keys",keys:C,input:$,inst:u}),R.length?Promise.all(R).then(()=>h):h}});function handleUnionResults(u,l,m,f){for(const m of u)if(0===m.issues.length)return l.value=m.value,l;return l.issues.push({code:"invalid_union",input:l.value,inst:m,errors:u.map(u=>u.issues.map(u=>b.finalizeIssue(u,f,h.config())))}),l}const ge=h.$constructor("$ZodUnion",(u,l)=>{$.init(u,l),b.defineLazy(u._zod,"optin",()=>l.options.some(u=>"optional"===u._zod.optin)?"optional":void 0),b.defineLazy(u._zod,"optout",()=>l.options.some(u=>"optional"===u._zod.optout)?"optional":void 0),b.defineLazy(u._zod,"values",()=>{if(l.options.every(u=>u._zod.values))return new Set(l.options.flatMap(u=>Array.from(u._zod.values)))}),b.defineLazy(u._zod,"pattern",()=>{if(l.options.every(u=>u._zod.pattern)){const u=l.options.map(u=>u._zod.pattern);return new RegExp(`^(${u.map(u=>b.cleanRegex(u.source)).join("|")})$`)}}),u._zod.parse=(m,f)=>{let h=!1;const y=[];for(const u of l.options){const l=u._zod.run({value:m.value,issues:[]},f);if(l instanceof Promise)y.push(l),h=!0;else{if(0===l.issues.length)return l;y.push(l)}}return h?Promise.all(y).then(l=>handleUnionResults(l,m,u,f)):handleUnionResults(y,m,u,f)}}),_e=h.$constructor("$ZodDiscriminatedUnion",(u,l)=>{ge.init(u,l);const m=u._zod.parse;b.defineLazy(u._zod,"propValues",()=>{const u={};for(const m of l.options){const f=m._zod.propValues;if(!f||0===Object.keys(f).length)throw new Error(`Invalid discriminated union option at index "${l.options.indexOf(m)}"`);for(const[l,m]of Object.entries(f)){u[l]||(u[l]=new Set);for(const f of m)u[l].add(f)}}return u});const f=b.cached(()=>{const u=l.options,m=new Map;for(const f of u){const u=f._zod.propValues[l.discriminator];if(!u||0===u.size)throw new Error(`Invalid discriminated union option at index "${l.options.indexOf(f)}"`);for(const l of u){if(m.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);m.set(l,f)}}return m});u._zod.parse=(h,y)=>{const v=h.value;if(!b.isObject(v))return h.issues.push({code:"invalid_type",expected:"object",input:v,inst:u}),h;const w=f.value.get(v?.[l.discriminator]);return w?w._zod.run(h,y):l.unionFallback?m(h,y):(h.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:v,path:[l.discriminator],inst:u}),h)}}),ye=h.$constructor("$ZodIntersection",(u,l)=>{$.init(u,l),u._zod.parse=(u,m)=>{const f=u.value,h=l.left._zod.run({value:f,issues:[]},m),y=l.right._zod.run({value:f,issues:[]},m);return h instanceof Promise||y instanceof Promise?Promise.all([h,y]).then(([l,m])=>handleIntersectionResults(u,l,m)):handleIntersectionResults(u,h,y)}});function mergeValues(u,l){if(u===l)return{valid:!0,data:u};if(u instanceof Date&&l instanceof Date&&+u===+l)return{valid:!0,data:u};if(b.isPlainObject(u)&&b.isPlainObject(l)){const m=Object.keys(l),f=Object.keys(u).filter(u=>-1!==m.indexOf(u)),h={...u,...l};for(const m of f){const f=mergeValues(u[m],l[m]);if(!f.valid)return{valid:!1,mergeErrorPath:[m,...f.mergeErrorPath]};h[m]=f.data}return{valid:!0,data:h}}if(Array.isArray(u)&&Array.isArray(l)){if(u.length!==l.length)return{valid:!1,mergeErrorPath:[]};const m=[];for(let f=0;f<u.length;f++){const h=mergeValues(u[f],l[f]);if(!h.valid)return{valid:!1,mergeErrorPath:[f,...h.mergeErrorPath]};m.push(h.data)}return{valid:!0,data:m}}return{valid:!1,mergeErrorPath:[]}}function handleIntersectionResults(u,l,m){if(l.issues.length&&u.issues.push(...l.issues),m.issues.length&&u.issues.push(...m.issues),b.aborted(u))return u;const f=mergeValues(l.value,m.value);if(!f.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(f.mergeErrorPath)}`);return u.value=f.data,u}const ve=h.$constructor("$ZodTuple",(u,l)=>{$.init(u,l);const m=l.items,f=m.length-[...m].reverse().findIndex(u=>"optional"!==u._zod.optin);u._zod.parse=(h,y)=>{const v=h.value;if(!Array.isArray(v))return h.issues.push({input:v,inst:u,expected:"tuple",code:"invalid_type"}),h;h.value=[];const w=[];if(!l.rest){const l=v.length>m.length,y=v.length<f-1;if(l||y)return h.issues.push({input:v,inst:u,origin:"array",...l?{code:"too_big",maximum:m.length}:{code:"too_small",minimum:m.length}}),h}let b=-1;for(const u of m){if(b++,b>=v.length&&b>=f)continue;const l=u._zod.run({value:v[b],issues:[]},y);l instanceof Promise?w.push(l.then(u=>handleTupleResult(u,h,b))):handleTupleResult(l,h,b)}if(l.rest){const u=v.slice(m.length);for(const m of u){b++;const u=l.rest._zod.run({value:m,issues:[]},y);u instanceof Promise?w.push(u.then(u=>handleTupleResult(u,h,b))):handleTupleResult(u,h,b)}}return w.length?Promise.all(w).then(()=>h):h}});function handleTupleResult(u,l,m){u.issues.length&&l.issues.push(...b.prefixIssues(m,u.issues)),l.value[m]=u.value}const we=h.$constructor("$ZodRecord",(u,l)=>{$.init(u,l),u._zod.parse=(m,f)=>{const y=m.value;if(!b.isPlainObject(y))return m.issues.push({expected:"record",code:"invalid_type",input:y,inst:u}),m;const v=[];if(l.keyType._zod.values){const h=l.keyType._zod.values;m.value={};for(const u of h)if("string"==typeof u||"number"==typeof u||"symbol"==typeof u){const h=l.valueType._zod.run({value:y[u],issues:[]},f);h instanceof Promise?v.push(h.then(l=>{l.issues.length&&m.issues.push(...b.prefixIssues(u,l.issues)),m.value[u]=l.value})):(h.issues.length&&m.issues.push(...b.prefixIssues(u,h.issues)),m.value[u]=h.value)}let w;for(const u in y)h.has(u)||(w=w??[],w.push(u));w&&w.length>0&&m.issues.push({code:"unrecognized_keys",input:y,inst:u,keys:w})}else{m.value={};for(const w of Reflect.ownKeys(y)){if("__proto__"===w)continue;const S=l.keyType._zod.run({value:w,issues:[]},f);if(S instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(S.issues.length){m.issues.push({origin:"record",code:"invalid_key",issues:S.issues.map(u=>b.finalizeIssue(u,f,h.config())),input:w,path:[w],inst:u}),m.value[S.value]=S.value;continue}const $=l.valueType._zod.run({value:y[w],issues:[]},f);$ instanceof Promise?v.push($.then(u=>{u.issues.length&&m.issues.push(...b.prefixIssues(w,u.issues)),m.value[S.value]=u.value})):($.issues.length&&m.issues.push(...b.prefixIssues(w,$.issues)),m.value[S.value]=$.value)}}return v.length?Promise.all(v).then(()=>m):m}}),be=h.$constructor("$ZodMap",(u,l)=>{$.init(u,l),u._zod.parse=(m,f)=>{const h=m.value;if(!(h instanceof Map))return m.issues.push({expected:"map",code:"invalid_type",input:h,inst:u}),m;const y=[];m.value=new Map;for(const[v,w]of h){const b=l.keyType._zod.run({value:v,issues:[]},f),S=l.valueType._zod.run({value:w,issues:[]},f);b instanceof Promise||S instanceof Promise?y.push(Promise.all([b,S]).then(([l,y])=>{handleMapResult(l,y,m,v,h,u,f)})):handleMapResult(b,S,m,v,h,u,f)}return y.length?Promise.all(y).then(()=>m):m}});function handleMapResult(u,l,m,f,y,v,w){u.issues.length&&(b.propertyKeyTypes.has(typeof f)?m.issues.push(...b.prefixIssues(f,u.issues)):m.issues.push({origin:"map",code:"invalid_key",input:y,inst:v,issues:u.issues.map(u=>b.finalizeIssue(u,w,h.config()))})),l.issues.length&&(b.propertyKeyTypes.has(typeof f)?m.issues.push(...b.prefixIssues(f,l.issues)):m.issues.push({origin:"map",code:"invalid_element",input:y,inst:v,key:f,issues:l.issues.map(u=>b.finalizeIssue(u,w,h.config()))})),m.value.set(u.value,l.value)}const ke=h.$constructor("$ZodSet",(u,l)=>{$.init(u,l),u._zod.parse=(m,f)=>{const h=m.value;if(!(h instanceof Set))return m.issues.push({input:h,inst:u,expected:"set",code:"invalid_type"}),m;const y=[];m.value=new Set;for(const u of h){const h=l.valueType._zod.run({value:u,issues:[]},f);h instanceof Promise?y.push(h.then(u=>handleSetResult(u,m))):handleSetResult(h,m)}return y.length?Promise.all(y).then(()=>m):m}});function handleSetResult(u,l){u.issues.length&&l.issues.push(...u.issues),l.value.add(u.value)}const Se=h.$constructor("$ZodEnum",(u,l)=>{$.init(u,l);const m=b.getEnumValues(l.entries);u._zod.values=new Set(m),u._zod.pattern=new RegExp(`^(${m.filter(u=>b.propertyKeyTypes.has(typeof u)).map(u=>"string"==typeof u?b.escapeRegex(u):u.toString()).join("|")})$`),u._zod.parse=(l,f)=>{const h=l.value;return u._zod.values.has(h)||l.issues.push({code:"invalid_value",values:m,input:h,inst:u}),l}}),$e=h.$constructor("$ZodLiteral",(u,l)=>{$.init(u,l),u._zod.values=new Set(l.values),u._zod.pattern=new RegExp(`^(${l.values.map(u=>"string"==typeof u?b.escapeRegex(u):u?u.toString():String(u)).join("|")})$`),u._zod.parse=(m,f)=>{const h=m.value;return u._zod.values.has(h)||m.issues.push({code:"invalid_value",values:l.values,input:h,inst:u}),m}}),xe=h.$constructor("$ZodFile",(u,l)=>{$.init(u,l),u._zod.parse=(l,m)=>{const f=l.value;return f instanceof File||l.issues.push({expected:"file",code:"invalid_type",input:f,inst:u}),l}}),je=h.$constructor("$ZodTransform",(u,l)=>{$.init(u,l),u._zod.parse=(u,m)=>{const f=l.transform(u.value,u);if(m.async){return(f instanceof Promise?f:Promise.resolve(f)).then(l=>(u.value=l,u))}if(f instanceof Promise)throw new h.$ZodAsyncError;return u.value=f,u}}),Te=h.$constructor("$ZodOptional",(u,l)=>{$.init(u,l),u._zod.optin="optional",u._zod.optout="optional",b.defineLazy(u._zod,"values",()=>l.innerType._zod.values?new Set([...l.innerType._zod.values,void 0]):void 0),b.defineLazy(u._zod,"pattern",()=>{const u=l.innerType._zod.pattern;return u?new RegExp(`^(${b.cleanRegex(u.source)})?$`):void 0}),u._zod.parse=(u,m)=>"optional"===l.innerType._zod.optin?l.innerType._zod.run(u,m):void 0===u.value?u:l.innerType._zod.run(u,m)}),Ee=h.$constructor("$ZodNullable",(u,l)=>{$.init(u,l),b.defineLazy(u._zod,"optin",()=>l.innerType._zod.optin),b.defineLazy(u._zod,"optout",()=>l.innerType._zod.optout),b.defineLazy(u._zod,"pattern",()=>{const u=l.innerType._zod.pattern;return u?new RegExp(`^(${b.cleanRegex(u.source)}|null)$`):void 0}),b.defineLazy(u._zod,"values",()=>l.innerType._zod.values?new Set([...l.innerType._zod.values,null]):void 0),u._zod.parse=(u,m)=>null===u.value?u:l.innerType._zod.run(u,m)}),Pe=h.$constructor("$ZodDefault",(u,l)=>{$.init(u,l),u._zod.optin="optional",b.defineLazy(u._zod,"values",()=>l.innerType._zod.values),u._zod.parse=(u,m)=>{if(void 0===u.value)return u.value=l.defaultValue,u;const f=l.innerType._zod.run(u,m);return f instanceof Promise?f.then(u=>handleDefaultResult(u,l)):handleDefaultResult(f,l)}});function handleDefaultResult(u,l){return void 0===u.value&&(u.value=l.defaultValue),u}const Ie=h.$constructor("$ZodPrefault",(u,l)=>{$.init(u,l),u._zod.optin="optional",b.defineLazy(u._zod,"values",()=>l.innerType._zod.values),u._zod.parse=(u,m)=>(void 0===u.value&&(u.value=l.defaultValue),l.innerType._zod.run(u,m))}),Re=h.$constructor("$ZodNonOptional",(u,l)=>{$.init(u,l),b.defineLazy(u._zod,"values",()=>{const u=l.innerType._zod.values;return u?new Set([...u].filter(u=>void 0!==u)):void 0}),u._zod.parse=(m,f)=>{const h=l.innerType._zod.run(m,f);return h instanceof Promise?h.then(l=>handleNonOptionalResult(l,u)):handleNonOptionalResult(h,u)}});function handleNonOptionalResult(u,l){return u.issues.length||void 0!==u.value||u.issues.push({code:"invalid_type",expected:"nonoptional",input:u.value,inst:l}),u}const Ce=h.$constructor("$ZodSuccess",(u,l)=>{$.init(u,l),u._zod.parse=(u,m)=>{const f=l.innerType._zod.run(u,m);return f instanceof Promise?f.then(l=>(u.value=0===l.issues.length,u)):(u.value=0===f.issues.length,u)}}),Ze=h.$constructor("$ZodCatch",(u,l)=>{$.init(u,l),u._zod.optin="optional",b.defineLazy(u._zod,"optout",()=>l.innerType._zod.optout),b.defineLazy(u._zod,"values",()=>l.innerType._zod.values),u._zod.parse=(u,m)=>{const f=l.innerType._zod.run(u,m);return f instanceof Promise?f.then(f=>(u.value=f.value,f.issues.length&&(u.value=l.catchValue({...u,error:{issues:f.issues.map(u=>b.finalizeIssue(u,m,h.config()))},input:u.value}),u.issues=[]),u)):(u.value=f.value,f.issues.length&&(u.value=l.catchValue({...u,error:{issues:f.issues.map(u=>b.finalizeIssue(u,m,h.config()))},input:u.value}),u.issues=[]),u)}}),ze=h.$constructor("$ZodNaN",(u,l)=>{$.init(u,l),u._zod.parse=(l,m)=>("number"==typeof l.value&&Number.isNaN(l.value)||l.issues.push({input:l.value,inst:u,expected:"nan",code:"invalid_type"}),l)}),Ae=h.$constructor("$ZodPipe",(u,l)=>{$.init(u,l),b.defineLazy(u._zod,"values",()=>l.in._zod.values),b.defineLazy(u._zod,"optin",()=>l.in._zod.optin),b.defineLazy(u._zod,"optout",()=>l.out._zod.optout),u._zod.parse=(u,m)=>{const f=l.in._zod.run(u,m);return f instanceof Promise?f.then(u=>handlePipeResult(u,l,m)):handlePipeResult(f,l,m)}});function handlePipeResult(u,l,m){return b.aborted(u)?u:l.out._zod.run({value:u.value,issues:u.issues},m)}const Oe=h.$constructor("$ZodReadonly",(u,l)=>{$.init(u,l),b.defineLazy(u._zod,"propValues",()=>l.innerType._zod.propValues),b.defineLazy(u._zod,"values",()=>l.innerType._zod.values),b.defineLazy(u._zod,"optin",()=>l.innerType._zod.optin),b.defineLazy(u._zod,"optout",()=>l.innerType._zod.optout),u._zod.parse=(u,m)=>{const f=l.innerType._zod.run(u,m);return f instanceof Promise?f.then(handleReadonlyResult):handleReadonlyResult(f)}});function handleReadonlyResult(u){return u.value=Object.freeze(u.value),u}const Ne=h.$constructor("$ZodTemplateLiteral",(u,l)=>{$.init(u,l);const m=[];for(const u of l.parts)if(u instanceof $){if(!u._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...u._zod.traits].shift()}`);const l=u._zod.pattern instanceof RegExp?u._zod.pattern.source:u._zod.pattern;if(!l)throw new Error(`Invalid template literal part: ${u._zod.traits}`);const f=l.startsWith("^")?1:0,h=l.endsWith("$")?l.length-1:l.length;m.push(l.slice(f,h))}else{if(null!==u&&!b.primitiveTypes.has(typeof u))throw new Error(`Invalid template literal part: ${u}`);m.push(b.escapeRegex(`${u}`))}u._zod.pattern=new RegExp(`^${m.join("")}$`),u._zod.parse=(l,m)=>"string"!=typeof l.value?(l.issues.push({input:l.value,inst:u,expected:"template_literal",code:"invalid_type"}),l):(u._zod.pattern.lastIndex=0,u._zod.pattern.test(l.value)||l.issues.push({input:l.value,inst:u,code:"invalid_format",format:"template_literal",pattern:u._zod.pattern.source}),l)}),De=h.$constructor("$ZodPromise",(u,l)=>{$.init(u,l),u._zod.parse=(u,m)=>Promise.resolve(u.value).then(u=>l.innerType._zod.run({value:u,issues:[]},m))}),Me=h.$constructor("$ZodLazy",(u,l)=>{$.init(u,l),b.defineLazy(u._zod,"innerType",()=>l.getter()),b.defineLazy(u._zod,"pattern",()=>u._zod.innerType._zod.pattern),b.defineLazy(u._zod,"propValues",()=>u._zod.innerType._zod.propValues),b.defineLazy(u._zod,"optin",()=>u._zod.innerType._zod.optin),b.defineLazy(u._zod,"optout",()=>u._zod.innerType._zod.optout),u._zod.parse=(l,m)=>u._zod.innerType._zod.run(l,m)}),Ue=h.$constructor("$ZodCustom",(u,l)=>{f.$ZodCheck.init(u,l),$.init(u,l),u._zod.parse=(u,l)=>u,u._zod.check=m=>{const f=m.value,h=l.fn(f);if(h instanceof Promise)return h.then(l=>handleRefineResult(l,m,f,u));handleRefineResult(h,m,f,u)}});function handleRefineResult(u,l,m,f){if(!u){const u={code:"custom",input:m,inst:f,path:[...f._zod.def.path??[]],continue:!f._zod.def.abort};f._zod.def.params&&(u.params=f._zod.def.params),l.issues.push(b.issue(u))}}},"./node_modules/zod/v4/core/to-json-schema.js":function(u,l,m){m.r(l),m.d(l,{JSONSchemaGenerator:function(){return JSONSchemaGenerator},toJSONSchema:function(){return toJSONSchema}});var f=m("./node_modules/zod/v4/core/registries.js"),h=m("./node_modules/zod/v4/core/util.js");class JSONSchemaGenerator{constructor(u){this.counter=0,this.metadataRegistry=u?.metadata??f.globalRegistry,this.target=u?.target??"draft-2020-12",this.unrepresentable=u?.unrepresentable??"throw",this.override=u?.override??(()=>{}),this.io=u?.io??"output",this.seen=new Map}process(u,l={path:[],schemaPath:[]}){var m;const f=u._zod.def,y={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},v=this.seen.get(u);if(v){v.count++;return l.schemaPath.includes(u)&&(v.cycle=l.path),v.schema}const w={schema:{},count:1,cycle:void 0,path:l.path};this.seen.set(u,w);const b=u._zod.toJSONSchema?.();if(b)w.schema=b;else{const m={...l,schemaPath:[...l.schemaPath,u],path:l.path},v=u._zod.parent;if(v)w.ref=v,this.process(v,m),this.seen.get(v).isParent=!0;else{const l=w.schema;switch(f.type){case"string":{const m=l;m.type="string";const{minimum:f,maximum:h,format:v,patterns:b,contentEncoding:S}=u._zod.bag;if("number"==typeof f&&(m.minLength=f),"number"==typeof h&&(m.maxLength=h),v&&(m.format=y[v]??v,""===m.format&&delete m.format),S&&(m.contentEncoding=S),b&&b.size>0){const u=[...b];1===u.length?m.pattern=u[0].source:u.length>1&&(w.schema.allOf=[...u.map(u=>({..."draft-7"===this.target?{type:"string"}:{},pattern:u.source}))])}break}case"number":{const m=l,{minimum:f,maximum:h,format:y,multipleOf:v,exclusiveMaximum:w,exclusiveMinimum:b}=u._zod.bag;"string"==typeof y&&y.includes("int")?m.type="integer":m.type="number","number"==typeof b&&(m.exclusiveMinimum=b),"number"==typeof f&&(m.minimum=f,"number"==typeof b&&(b>=f?delete m.minimum:delete m.exclusiveMinimum)),"number"==typeof w&&(m.exclusiveMaximum=w),"number"==typeof h&&(m.maximum=h,"number"==typeof w&&(w<=h?delete m.maximum:delete m.exclusiveMaximum)),"number"==typeof v&&(m.multipleOf=v);break}case"boolean":l.type="boolean";break;case"bigint":if("throw"===this.unrepresentable)throw new Error("BigInt cannot be represented in JSON Schema");break;case"symbol":if("throw"===this.unrepresentable)throw new Error("Symbols cannot be represented in JSON Schema");break;case"null":l.type="null";break;case"any":case"unknown":break;case"undefined":if("throw"===this.unrepresentable)throw new Error("Undefined cannot be represented in JSON Schema");break;case"void":if("throw"===this.unrepresentable)throw new Error("Void cannot be represented in JSON Schema");break;case"never":l.not={};break;case"date":if("throw"===this.unrepresentable)throw new Error("Date cannot be represented in JSON Schema");break;case"array":{const h=l,{minimum:y,maximum:v}=u._zod.bag;"number"==typeof y&&(h.minItems=y),"number"==typeof v&&(h.maxItems=v),h.type="array",h.items=this.process(f.element,{...m,path:[...m.path,"items"]});break}case"object":{const u=l;u.type="object",u.properties={};const h=f.shape;for(const l in h)u.properties[l]=this.process(h[l],{...m,path:[...m.path,"properties",l]});const y=new Set(Object.keys(h)),v=new Set([...y].filter(u=>{const l=f.shape[u]._zod;return"input"===this.io?void 0===l.optin:void 0===l.optout}));v.size>0&&(u.required=Array.from(v)),"never"===f.catchall?._zod.def.type?u.additionalProperties=!1:f.catchall?f.catchall&&(u.additionalProperties=this.process(f.catchall,{...m,path:[...m.path,"additionalProperties"]})):"output"===this.io&&(u.additionalProperties=!1);break}case"union":l.anyOf=f.options.map((u,l)=>this.process(u,{...m,path:[...m.path,"anyOf",l]}));break;case"intersection":{const u=l,h=this.process(f.left,{...m,path:[...m.path,"allOf",0]}),y=this.process(f.right,{...m,path:[...m.path,"allOf",1]}),isSimpleIntersection=u=>"allOf"in u&&1===Object.keys(u).length,v=[...isSimpleIntersection(h)?h.allOf:[h],...isSimpleIntersection(y)?y.allOf:[y]];u.allOf=v;break}case"tuple":{const h=l;h.type="array";const y=f.items.map((u,l)=>this.process(u,{...m,path:[...m.path,"prefixItems",l]}));if("draft-2020-12"===this.target?h.prefixItems=y:h.items=y,f.rest){const u=this.process(f.rest,{...m,path:[...m.path,"items"]});"draft-2020-12"===this.target?h.items=u:h.additionalItems=u}f.rest&&(h.items=this.process(f.rest,{...m,path:[...m.path,"items"]}));const{minimum:v,maximum:w}=u._zod.bag;"number"==typeof v&&(h.minItems=v),"number"==typeof w&&(h.maxItems=w);break}case"record":{const u=l;u.type="object",u.propertyNames=this.process(f.keyType,{...m,path:[...m.path,"propertyNames"]}),u.additionalProperties=this.process(f.valueType,{...m,path:[...m.path,"additionalProperties"]});break}case"map":if("throw"===this.unrepresentable)throw new Error("Map cannot be represented in JSON Schema");break;case"set":if("throw"===this.unrepresentable)throw new Error("Set cannot be represented in JSON Schema");break;case"enum":{const u=l,m=(0,h.getEnumValues)(f.entries);m.every(u=>"number"==typeof u)&&(u.type="number"),m.every(u=>"string"==typeof u)&&(u.type="string"),u.enum=m;break}case"literal":{const u=l,m=[];for(const u of f.values)if(void 0===u){if("throw"===this.unrepresentable)throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof u){if("throw"===this.unrepresentable)throw new Error("BigInt literals cannot be represented in JSON Schema");m.push(Number(u))}else m.push(u);if(0===m.length);else if(1===m.length){const l=m[0];u.type=null===l?"null":typeof l,u.const=l}else m.every(u=>"number"==typeof u)&&(u.type="number"),m.every(u=>"string"==typeof u)&&(u.type="string"),m.every(u=>"boolean"==typeof u)&&(u.type="string"),m.every(u=>null===u)&&(u.type="null"),u.enum=m;break}case"file":{const m=l,f={type:"string",format:"binary",contentEncoding:"binary"},{minimum:h,maximum:y,mime:v}=u._zod.bag;void 0!==h&&(f.minLength=h),void 0!==y&&(f.maxLength=y),v?1===v.length?(f.contentMediaType=v[0],Object.assign(m,f)):m.anyOf=v.map(u=>({...f,contentMediaType:u})):Object.assign(m,f);break}case"transform":if("throw"===this.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema");break;case"nullable":{const u=this.process(f.innerType,m);l.anyOf=[u,{type:"null"}];break}case"nonoptional":case"promise":case"optional":this.process(f.innerType,m),w.ref=f.innerType;break;case"success":l.type="boolean";break;case"default":this.process(f.innerType,m),w.ref=f.innerType,l.default=JSON.parse(JSON.stringify(f.defaultValue));break;case"prefault":this.process(f.innerType,m),w.ref=f.innerType,"input"===this.io&&(l._prefault=JSON.parse(JSON.stringify(f.defaultValue)));break;case"catch":{let u;this.process(f.innerType,m),w.ref=f.innerType;try{u=f.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}l.default=u;break}case"nan":if("throw"===this.unrepresentable)throw new Error("NaN cannot be represented in JSON Schema");break;case"template_literal":{const m=l,f=u._zod.pattern;if(!f)throw new Error("Pattern not found in template literal");m.type="string",m.pattern=f.source;break}case"pipe":{const u="input"===this.io?"transform"===f.in._zod.def.type?f.out:f.in:f.out;this.process(u,m),w.ref=u;break}case"readonly":this.process(f.innerType,m),w.ref=f.innerType,l.readOnly=!0;break;case"lazy":{const l=u._zod.innerType;this.process(l,m),w.ref=l;break}case"custom":if("throw"===this.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema")}}}const S=this.metadataRegistry.get(u);S&&Object.assign(w.schema,S),"input"===this.io&&isTransforming(u)&&(delete w.schema.examples,delete w.schema.default),"input"===this.io&&w.schema._prefault&&((m=w.schema).default??(m.default=w.schema._prefault)),delete w.schema._prefault;return this.seen.get(u).schema}emit(u,l){const m={cycles:l?.cycles??"ref",reused:l?.reused??"inline",external:l?.external??void 0},f=this.seen.get(u);if(!f)throw new Error("Unprocessed schema. This is a bug in Zod.");const makeURI=u=>{const l="draft-2020-12"===this.target?"$defs":"definitions";if(m.external){const f=m.external.registry.get(u[0])?.id,h=m.external.uri??(u=>u);if(f)return{ref:h(f)};const y=u[1].defId??u[1].schema.id??"schema"+this.counter++;return u[1].defId=y,{defId:y,ref:`${h("__shared")}#/${l}/${y}`}}if(u[1]===f)return{ref:"#"};const h=`#/${l}/`,y=u[1].schema.id??"__schema"+this.counter++;return{defId:y,ref:h+y}},extractToDef=u=>{if(u[1].schema.$ref)return;const l=u[1],{ref:m,defId:f}=makeURI(u);l.def={...l.schema},f&&(l.defId=f);const h=l.schema;for(const u in h)delete h[u];h.$ref=m};if("throw"===m.cycles)for(const u of this.seen.entries()){const l=u[1];if(l.cycle)throw new Error(`Cycle detected: #/${l.cycle?.join("/")}/<root>\n\nSet the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const l of this.seen.entries()){const f=l[1];if(u===l[0]){extractToDef(l);continue}if(m.external){const f=m.external.registry.get(l[0])?.id;if(u!==l[0]&&f){extractToDef(l);continue}}const h=this.metadataRegistry.get(l[0])?.id;h?extractToDef(l):(f.cycle||f.count>1&&"ref"===m.reused)&&extractToDef(l)}const flattenRef=(u,l)=>{const m=this.seen.get(u),f=m.def??m.schema,h={...f};if(null===m.ref)return;const y=m.ref;if(m.ref=null,y){flattenRef(y,l);const u=this.seen.get(y).schema;u.$ref&&"draft-7"===l.target?(f.allOf=f.allOf??[],f.allOf.push(u)):(Object.assign(f,u),Object.assign(f,h))}m.isParent||this.override({zodSchema:u,jsonSchema:f,path:m.path??[]})};for(const u of[...this.seen.entries()].reverse())flattenRef(u[0],{target:this.target});const h={};if("draft-2020-12"===this.target?h.$schema="https://json-schema.org/draft/2020-12/schema":"draft-7"===this.target?h.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),m.external?.uri){const l=m.external.registry.get(u)?.id;if(!l)throw new Error("Schema is missing an `id` property");h.$id=m.external.uri(l)}Object.assign(h,f.def);const y=m.external?.defs??{};for(const u of this.seen.entries()){const l=u[1];l.def&&l.defId&&(y[l.defId]=l.def)}m.external||Object.keys(y).length>0&&("draft-2020-12"===this.target?h.$defs=y:h.definitions=y);try{return JSON.parse(JSON.stringify(h))}catch(u){throw new Error("Error converting schema to JSON.")}}}function toJSONSchema(u,l){if(u instanceof f.$ZodRegistry){const m=new JSONSchemaGenerator(l),f={};for(const l of u._idmap.entries()){const[u,f]=l;m.process(f)}const h={},y={registry:u,uri:l?.uri,defs:f};for(const f of u._idmap.entries()){const[u,v]=f;h[u]=m.emit(v,{...l,external:y})}if(Object.keys(f).length>0){const u="draft-2020-12"===m.target?"$defs":"definitions";h.__shared={[u]:f}}return{schemas:h}}const m=new JSONSchemaGenerator(l);return m.process(u),m.emit(u,l)}function isTransforming(u,l){const m=l??{seen:new Set};if(m.seen.has(u))return!1;m.seen.add(u);const f=u._zod.def;switch(f.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":case"custom":case"success":case"catch":return!1;case"array":return isTransforming(f.element,m);case"object":for(const u in f.shape)if(isTransforming(f.shape[u],m))return!0;return!1;case"union":for(const u of f.options)if(isTransforming(u,m))return!0;return!1;case"intersection":return isTransforming(f.left,m)||isTransforming(f.right,m);case"tuple":for(const u of f.items)if(isTransforming(u,m))return!0;return!(!f.rest||!isTransforming(f.rest,m));case"record":case"map":return isTransforming(f.keyType,m)||isTransforming(f.valueType,m);case"set":return isTransforming(f.valueType,m);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":case"default":case"prefault":return isTransforming(f.innerType,m);case"lazy":return isTransforming(f.getter(),m);case"transform":return!0;case"pipe":return isTransforming(f.in,m)||isTransforming(f.out,m)}throw new Error(`Unknown schema type: ${f.type}`)}},"./node_modules/zod/v4/core/util.js":function(u,l,m){function assertEqual(u){return u}function assertNotEqual(u){return u}function assertIs(u){}function assertNever(u){throw new Error}function assert(u){}function getEnumValues(u){const l=Object.values(u).filter(u=>"number"==typeof u);return Object.entries(u).filter(([u,m])=>-1===l.indexOf(+u)).map(([u,l])=>l)}function joinValues(u,l="|"){return u.map(u=>stringifyPrimitive(u)).join(l)}function jsonStringifyReplacer(u,l){return"bigint"==typeof l?l.toString():l}function cached(u){return{get value(){{const l=u();return Object.defineProperty(this,"value",{value:l}),l}}}}function nullish(u){return null==u}function cleanRegex(u){const l=u.startsWith("^")?1:0,m=u.endsWith("$")?u.length-1:u.length;return u.slice(l,m)}function floatSafeRemainder(u,l){const m=(u.toString().split(".")[1]||"").length,f=(l.toString().split(".")[1]||"").length,h=m>f?m:f;return Number.parseInt(u.toFixed(h).replace(".",""))%Number.parseInt(l.toFixed(h).replace(".",""))/10**h}function defineLazy(u,l,m){Object.defineProperty(u,l,{get(){{const f=m();return u[l]=f,f}},set(m){Object.defineProperty(u,l,{value:m})},configurable:!0})}function assignProp(u,l,m){Object.defineProperty(u,l,{value:m,writable:!0,enumerable:!0,configurable:!0})}function getElementAtPath(u,l){return l?l.reduce((u,l)=>u?.[l],u):u}function promiseAllObject(u){const l=Object.keys(u),m=l.map(l=>u[l]);return Promise.all(m).then(u=>{const m={};for(let f=0;f<l.length;f++)m[l[f]]=u[f];return m})}function randomString(u=10){const l="abcdefghijklmnopqrstuvwxyz";let m="";for(let f=0;f<u;f++)m+=l[Math.floor(26*Math.random())];return m}function esc(u){return JSON.stringify(u)}m.r(l),m.d(l,{BIGINT_FORMAT_RANGES:function(){return b},Class:function(){return Class},NUMBER_FORMAT_RANGES:function(){return w},aborted:function(){return aborted},allowsEval:function(){return h},assert:function(){return assert},assertEqual:function(){return assertEqual},assertIs:function(){return assertIs},assertNever:function(){return assertNever},assertNotEqual:function(){return assertNotEqual},assignProp:function(){return assignProp},cached:function(){return cached},captureStackTrace:function(){return f},cleanEnum:function(){return cleanEnum},cleanRegex:function(){return cleanRegex},clone:function(){return clone},createTransparentProxy:function(){return createTransparentProxy},defineLazy:function(){return defineLazy},esc:function(){return esc},escapeRegex:function(){return escapeRegex},extend:function(){return extend},finalizeIssue:function(){return finalizeIssue},floatSafeRemainder:function(){return floatSafeRemainder},getElementAtPath:function(){return getElementAtPath},getEnumValues:function(){return getEnumValues},getLengthableOrigin:function(){return getLengthableOrigin},getParsedType:function(){return getParsedType},getSizableOrigin:function(){return getSizableOrigin},isObject:function(){return isObject},isPlainObject:function(){return isPlainObject},issue:function(){return issue},joinValues:function(){return joinValues},jsonStringifyReplacer:function(){return jsonStringifyReplacer},merge:function(){return merge},normalizeParams:function(){return normalizeParams},nullish:function(){return nullish},numKeys:function(){return numKeys},omit:function(){return omit},optionalKeys:function(){return optionalKeys},partial:function(){return partial},pick:function(){return pick},prefixIssues:function(){return prefixIssues},primitiveTypes:function(){return v},promiseAllObject:function(){return promiseAllObject},propertyKeyTypes:function(){return y},randomString:function(){return randomString},required:function(){return required},stringifyPrimitive:function(){return stringifyPrimitive},unwrapMessage:function(){return unwrapMessage}});const f=Error.captureStackTrace?Error.captureStackTrace:(...u)=>{};function isObject(u){return"object"==typeof u&&null!==u&&!Array.isArray(u)}const h=cached(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(u){return!1}});function isPlainObject(u){if(!1===isObject(u))return!1;const l=u.constructor;if(void 0===l)return!0;const m=l.prototype;return!1!==isObject(m)&&!1!==Object.prototype.hasOwnProperty.call(m,"isPrototypeOf")}function numKeys(u){let l=0;for(const m in u)Object.prototype.hasOwnProperty.call(u,m)&&l++;return l}const getParsedType=u=>{const l=typeof u;switch(l){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(u)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(u)?"array":null===u?"null":u.then&&"function"==typeof u.then&&u.catch&&"function"==typeof u.catch?"promise":"undefined"!=typeof Map&&u instanceof Map?"map":"undefined"!=typeof Set&&u instanceof Set?"set":"undefined"!=typeof Date&&u instanceof Date?"date":"undefined"!=typeof File&&u instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${l}`)}},y=new Set(["string","number","symbol"]),v=new Set(["string","number","bigint","boolean","symbol","undefined"]);function escapeRegex(u){return u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function clone(u,l,m){const f=new u._zod.constr(l??u._zod.def);return l&&!m?.parent||(f._zod.parent=u),f}function normalizeParams(u){const l=u;if(!l)return{};if("string"==typeof l)return{error:()=>l};if(void 0!==l?.message){if(void 0!==l?.error)throw new Error("Cannot specify both `message` and `error` params");l.error=l.message}return delete l.message,"string"==typeof l.error?{...l,error:()=>l.error}:l}function createTransparentProxy(u){let l;return new Proxy({},{get(m,f,h){return l??(l=u()),Reflect.get(l,f,h)},set(m,f,h,y){return l??(l=u()),Reflect.set(l,f,h,y)},has(m,f){return l??(l=u()),Reflect.has(l,f)},deleteProperty(m,f){return l??(l=u()),Reflect.deleteProperty(l,f)},ownKeys(m){return l??(l=u()),Reflect.ownKeys(l)},getOwnPropertyDescriptor(m,f){return l??(l=u()),Reflect.getOwnPropertyDescriptor(l,f)},defineProperty(m,f,h){return l??(l=u()),Reflect.defineProperty(l,f,h)}})}function stringifyPrimitive(u){return"bigint"==typeof u?u.toString()+"n":"string"==typeof u?`"${u}"`:`${u}`}function optionalKeys(u){return Object.keys(u).filter(l=>"optional"===u[l]._zod.optin&&"optional"===u[l]._zod.optout)}const w={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]},b={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function pick(u,l){const m={},f=u._zod.def;for(const u in l){if(!(u in f.shape))throw new Error(`Unrecognized key: "${u}"`);l[u]&&(m[u]=f.shape[u])}return clone(u,{...u._zod.def,shape:m,checks:[]})}function omit(u,l){const m={...u._zod.def.shape},f=u._zod.def;for(const u in l){if(!(u in f.shape))throw new Error(`Unrecognized key: "${u}"`);l[u]&&delete m[u]}return clone(u,{...u._zod.def,shape:m,checks:[]})}function extend(u,l){if(!isPlainObject(l))throw new Error("Invalid input to extend: expected a plain object");const m={...u._zod.def,get shape(){const m={...u._zod.def.shape,...l};return assignProp(this,"shape",m),m},checks:[]};return clone(u,m)}function merge(u,l){return clone(u,{...u._zod.def,get shape(){const m={...u._zod.def.shape,...l._zod.def.shape};return assignProp(this,"shape",m),m},catchall:l._zod.def.catchall,checks:[]})}function partial(u,l,m){const f=l._zod.def.shape,h={...f};if(m)for(const l in m){if(!(l in f))throw new Error(`Unrecognized key: "${l}"`);m[l]&&(h[l]=u?new u({type:"optional",innerType:f[l]}):f[l])}else for(const l in f)h[l]=u?new u({type:"optional",innerType:f[l]}):f[l];return clone(l,{...l._zod.def,shape:h,checks:[]})}function required(u,l,m){const f=l._zod.def.shape,h={...f};if(m)for(const l in m){if(!(l in h))throw new Error(`Unrecognized key: "${l}"`);m[l]&&(h[l]=new u({type:"nonoptional",innerType:f[l]}))}else for(const l in f)h[l]=new u({type:"nonoptional",innerType:f[l]});return clone(l,{...l._zod.def,shape:h,checks:[]})}function aborted(u,l=0){for(let m=l;m<u.issues.length;m++)if(!0!==u.issues[m]?.continue)return!0;return!1}function prefixIssues(u,l){return l.map(l=>{var m;return(m=l).path??(m.path=[]),l.path.unshift(u),l})}function unwrapMessage(u){return"string"==typeof u?u:u?.message}function finalizeIssue(u,l,m){const f={...u,path:u.path??[]};if(!u.message){const h=unwrapMessage(u.inst?._zod.def?.error?.(u))??unwrapMessage(l?.error?.(u))??unwrapMessage(m.customError?.(u))??unwrapMessage(m.localeError?.(u))??"Invalid input";f.message=h}return delete f.inst,delete f.continue,l?.reportInput||delete f.input,f}function getSizableOrigin(u){return u instanceof Set?"set":u instanceof Map?"map":u instanceof File?"file":"unknown"}function getLengthableOrigin(u){return Array.isArray(u)?"array":"string"==typeof u?"string":"unknown"}function issue(...u){const[l,m,f]=u;return"string"==typeof l?{message:l,code:"custom",input:m,inst:f}:{...l}}function cleanEnum(u){return Object.entries(u).filter(([u,l])=>Number.isNaN(Number.parseInt(u,10))).map(u=>u[1])}class Class{constructor(...u){}}},"./node_modules/zod/v4/core/versions.js":function(u,l,m){m.r(l),m.d(l,{version:function(){return f}});const f={major:4,minor:0,patch:0}},"./node_modules/zod/v4/mini/schemas.js":function(u,l,m){m.r(l),m.d(l,{ZodMiniAny:function(){return oe},ZodMiniArray:function(){return de},ZodMiniBase64:function(){return K},ZodMiniBase64URL:function(){return H},ZodMiniBigInt:function(){return X},ZodMiniBigIntFormat:function(){return ee},ZodMiniBoolean:function(){return Y},ZodMiniCIDRv4:function(){return F},ZodMiniCIDRv6:function(){return V},ZodMiniCUID:function(){return A},ZodMiniCUID2:function(){return O},ZodMiniCatch:function(){return Ee},ZodMiniCustom:function(){return Ae},ZodMiniCustomStringFormat:function(){return G},ZodMiniDate:function(){return ce},ZodMiniDefault:function(){return $e},ZodMiniDiscriminatedUnion:function(){return pe},ZodMiniE164:function(){return B},ZodMiniEmail:function(){return j},ZodMiniEmoji:function(){return Z},ZodMiniEnum:function(){return ye},ZodMiniFile:function(){return we},ZodMiniGUID:function(){return E},ZodMiniIPv4:function(){return U},ZodMiniIPv6:function(){return L},ZodMiniIntersection:function(){return me},ZodMiniJWT:function(){return J},ZodMiniKSUID:function(){return M},ZodMiniLazy:function(){return Ze},ZodMiniLiteral:function(){return ve},ZodMiniMap:function(){return ge},ZodMiniNaN:function(){return Pe},ZodMiniNanoID:function(){return z},ZodMiniNever:function(){return ie},ZodMiniNonOptional:function(){return je},ZodMiniNull:function(){return re},ZodMiniNullable:function(){return Se},ZodMiniNumber:function(){return W},ZodMiniNumberFormat:function(){return Q},ZodMiniObject:function(){return ue},ZodMiniOptional:function(){return ke},ZodMiniPipe:function(){return Ie},ZodMiniPrefault:function(){return xe},ZodMiniPromise:function(){return ze},ZodMiniReadonly:function(){return Re},ZodMiniRecord:function(){return he},ZodMiniSet:function(){return _e},ZodMiniString:function(){return $},ZodMiniStringFormat:function(){return x},ZodMiniSuccess:function(){return Te},ZodMiniSymbol:function(){return te},ZodMiniTemplateLiteral:function(){return Ce},ZodMiniTransform:function(){return be},ZodMiniTuple:function(){return fe},ZodMiniType:function(){return S},ZodMiniULID:function(){return N},ZodMiniURL:function(){return C},ZodMiniUUID:function(){return R},ZodMiniUndefined:function(){return ne},ZodMiniUnion:function(){return le},ZodMiniUnknown:function(){return se},ZodMiniVoid:function(){return ae},ZodMiniXID:function(){return D},_default:function(){return _default},any:function(){return any},array:function(){return array},base64:function(){return base64},base64url:function(){return base64url},bigint:function(){return bigint},boolean:function(){return boolean},catch:function(){return _catch},catchall:function(){return catchall},check:function(){return check},cidrv4:function(){return cidrv4},cidrv6:function(){return cidrv6},cuid:function(){return cuid},cuid2:function(){return cuid2},custom:function(){return custom},date:function(){return date},discriminatedUnion:function(){return discriminatedUnion},e164:function(){return e164},email:function(){return email},emoji:function(){return emoji},enum:function(){return _enum},extend:function(){return extend},file:function(){return file},float32:function(){return float32},float64:function(){return float64},guid:function(){return guid},instanceof:function(){return _instanceof},int:function(){return int},int32:function(){return int32},int64:function(){return int64},intersection:function(){return intersection},ipv4:function(){return ipv4},ipv6:function(){return ipv6},json:function(){return json},jwt:function(){return jwt},keyof:function(){return keyof},ksuid:function(){return ksuid},lazy:function(){return _lazy},literal:function(){return literal},looseObject:function(){return looseObject},map:function(){return map},merge:function(){return merge},nan:function(){return nan},nanoid:function(){return nanoid},nativeEnum:function(){return nativeEnum},never:function(){return never},nonoptional:function(){return nonoptional},null:function(){return _null},nullable:function(){return nullable},nullish:function(){return nullish},number:function(){return number},object:function(){return object},omit:function(){return omit},optional:function(){return optional},partial:function(){return partial},partialRecord:function(){return partialRecord},pick:function(){return pick},pipe:function(){return pipe},prefault:function(){return prefault},promise:function(){return promise},readonly:function(){return readonly},record:function(){return record},refine:function(){return refine},required:function(){return required},set:function(){return set},strictObject:function(){return strictObject},string:function(){return string},stringFormat:function(){return stringFormat},stringbool:function(){return stringbool},success:function(){return success},symbol:function(){return symbol},templateLiteral:function(){return templateLiteral},transform:function(){return transform},tuple:function(){return tuple},uint32:function(){return uint32},uint64:function(){return uint64},ulid:function(){return ulid},undefined:function(){return _undefined},union:function(){return union},unknown:function(){return unknown},url:function(){return url},uuid:function(){return uuid},uuidv4:function(){return uuidv4},uuidv6:function(){return uuidv6},uuidv7:function(){return uuidv7},void:function(){return _void},xid:function(){return xid}});var f=m("./node_modules/zod/v4/core/core.js"),h=m("./node_modules/zod/v4/core/schemas.js"),y=m("./node_modules/zod/v4/core/checks.js"),v=m("./node_modules/zod/v4/core/util.js"),w=m("./node_modules/zod/v4/core/api.js"),b=m("./node_modules/zod/v4/core/parse.js");const S=f.$constructor("ZodMiniType",(u,l)=>{if(!u._zod)throw new Error("Uninitialized schema in ZodMiniType.");h.$ZodType.init(u,l),u.def=l,u.parse=(l,m)=>b.parse(u,l,m,{callee:u.parse}),u.safeParse=(l,m)=>b.safeParse(u,l,m),u.parseAsync=async(l,m)=>b.parseAsync(u,l,m,{callee:u.parseAsync}),u.safeParseAsync=async(l,m)=>b.safeParseAsync(u,l,m),u.check=(...m)=>u.clone({...l,checks:[...l.checks??[],...m.map(u=>"function"==typeof u?{_zod:{check:u,def:{check:"custom"},onattach:[]}}:u)]}),u.clone=(l,m)=>v.clone(u,l,m),u.brand=()=>u,u.register=(l,m)=>(l.add(u,m),u)}),$=f.$constructor("ZodMiniString",(u,l)=>{h.$ZodString.init(u,l),S.init(u,l)});function string(u){return w._string($,u)}const x=f.$constructor("ZodMiniStringFormat",(u,l)=>{h.$ZodStringFormat.init(u,l),$.init(u,l)}),j=f.$constructor("ZodMiniEmail",(u,l)=>{h.$ZodEmail.init(u,l),x.init(u,l)});function email(u){return w._email(j,u)}const E=f.$constructor("ZodMiniGUID",(u,l)=>{h.$ZodGUID.init(u,l),x.init(u,l)});function guid(u){return w._guid(E,u)}const R=f.$constructor("ZodMiniUUID",(u,l)=>{h.$ZodUUID.init(u,l),x.init(u,l)});function uuid(u){return w._uuid(R,u)}function uuidv4(u){return w._uuidv4(R,u)}function uuidv6(u){return w._uuidv6(R,u)}function uuidv7(u){return w._uuidv7(R,u)}const C=f.$constructor("ZodMiniURL",(u,l)=>{h.$ZodURL.init(u,l),x.init(u,l)});function url(u){return w._url(C,u)}const Z=f.$constructor("ZodMiniEmoji",(u,l)=>{h.$ZodEmoji.init(u,l),x.init(u,l)});function emoji(u){return w._emoji(Z,u)}const z=f.$constructor("ZodMiniNanoID",(u,l)=>{h.$ZodNanoID.init(u,l),x.init(u,l)});function nanoid(u){return w._nanoid(z,u)}const A=f.$constructor("ZodMiniCUID",(u,l)=>{h.$ZodCUID.init(u,l),x.init(u,l)});function cuid(u){return w._cuid(A,u)}const O=f.$constructor("ZodMiniCUID2",(u,l)=>{h.$ZodCUID2.init(u,l),x.init(u,l)});function cuid2(u){return w._cuid2(O,u)}const N=f.$constructor("ZodMiniULID",(u,l)=>{h.$ZodULID.init(u,l),x.init(u,l)});function ulid(u){return w._ulid(N,u)}const D=f.$constructor("ZodMiniXID",(u,l)=>{h.$ZodXID.init(u,l),x.init(u,l)});function xid(u){return w._xid(D,u)}const M=f.$constructor("ZodMiniKSUID",(u,l)=>{h.$ZodKSUID.init(u,l),x.init(u,l)});function ksuid(u){return w._ksuid(M,u)}const U=f.$constructor("ZodMiniIPv4",(u,l)=>{h.$ZodIPv4.init(u,l),x.init(u,l)});function ipv4(u){return w._ipv4(U,u)}const L=f.$constructor("ZodMiniIPv6",(u,l)=>{h.$ZodIPv6.init(u,l),x.init(u,l)});function ipv6(u){return w._ipv6(L,u)}const F=f.$constructor("ZodMiniCIDRv4",(u,l)=>{h.$ZodCIDRv4.init(u,l),x.init(u,l)});function cidrv4(u){return w._cidrv4(F,u)}const V=f.$constructor("ZodMiniCIDRv6",(u,l)=>{h.$ZodCIDRv6.init(u,l),x.init(u,l)});function cidrv6(u){return w._cidrv6(V,u)}const K=f.$constructor("ZodMiniBase64",(u,l)=>{h.$ZodBase64.init(u,l),x.init(u,l)});function base64(u){return w._base64(K,u)}const H=f.$constructor("ZodMiniBase64URL",(u,l)=>{h.$ZodBase64URL.init(u,l),x.init(u,l)});function base64url(u){return w._base64url(H,u)}const B=f.$constructor("ZodMiniE164",(u,l)=>{h.$ZodE164.init(u,l),x.init(u,l)});function e164(u){return w._e164(B,u)}const J=f.$constructor("ZodMiniJWT",(u,l)=>{h.$ZodJWT.init(u,l),x.init(u,l)});function jwt(u){return w._jwt(J,u)}const G=f.$constructor("ZodMiniCustomStringFormat",(u,l)=>{h.$ZodCustomStringFormat.init(u,l),x.init(u,l)});function stringFormat(u,l,m={}){return w._stringFormat(G,u,l,m)}const W=f.$constructor("ZodMiniNumber",(u,l)=>{h.$ZodNumber.init(u,l),S.init(u,l)});function number(u){return w._number(W,u)}const Q=f.$constructor("ZodMiniNumberFormat",(u,l)=>{h.$ZodNumberFormat.init(u,l),W.init(u,l)});function int(u){return w._int(Q,u)}function float32(u){return w._float32(Q,u)}function float64(u){return w._float64(Q,u)}function int32(u){return w._int32(Q,u)}function uint32(u){return w._uint32(Q,u)}const Y=f.$constructor("ZodMiniBoolean",(u,l)=>{h.$ZodBoolean.init(u,l),S.init(u,l)});function boolean(u){return w._boolean(Y,u)}const X=f.$constructor("ZodMiniBigInt",(u,l)=>{h.$ZodBigInt.init(u,l),S.init(u,l)});function bigint(u){return w._bigint(X,u)}const ee=f.$constructor("ZodMiniBigIntFormat",(u,l)=>{h.$ZodBigIntFormat.init(u,l),X.init(u,l)});function int64(u){return w._int64(ee,u)}function uint64(u){return w._uint64(ee,u)}const te=f.$constructor("ZodMiniSymbol",(u,l)=>{h.$ZodSymbol.init(u,l),S.init(u,l)});function symbol(u){return w._symbol(te,u)}const ne=f.$constructor("ZodMiniUndefined",(u,l)=>{h.$ZodUndefined.init(u,l),S.init(u,l)});function _undefined(u){return w._undefined(ne,u)}const re=f.$constructor("ZodMiniNull",(u,l)=>{h.$ZodNull.init(u,l),S.init(u,l)});function _null(u){return w._null(re,u)}const oe=f.$constructor("ZodMiniAny",(u,l)=>{h.$ZodAny.init(u,l),S.init(u,l)});function any(){return w._any(oe)}const se=f.$constructor("ZodMiniUnknown",(u,l)=>{h.$ZodUnknown.init(u,l),S.init(u,l)});function unknown(){return w._unknown(se)}const ie=f.$constructor("ZodMiniNever",(u,l)=>{h.$ZodNever.init(u,l),S.init(u,l)});function never(u){return w._never(ie,u)}const ae=f.$constructor("ZodMiniVoid",(u,l)=>{h.$ZodVoid.init(u,l),S.init(u,l)});function _void(u){return w._void(ae,u)}const ce=f.$constructor("ZodMiniDate",(u,l)=>{h.$ZodDate.init(u,l),S.init(u,l)});function date(u){return w._date(ce,u)}const de=f.$constructor("ZodMiniArray",(u,l)=>{h.$ZodArray.init(u,l),S.init(u,l)});function array(u,l){return new de({type:"array",element:u,...v.normalizeParams(l)})}function keyof(u){const l=u._zod.def.shape;return literal(Object.keys(l))}const ue=f.$constructor("ZodMiniObject",(u,l)=>{h.$ZodObject.init(u,l),S.init(u,l),v.defineLazy(u,"shape",()=>l.shape)});function object(u,l){const m={type:"object",get shape(){return v.assignProp(this,"shape",{...u}),this.shape},...v.normalizeParams(l)};return new ue(m)}function strictObject(u,l){return new ue({type:"object",get shape(){return v.assignProp(this,"shape",{...u}),this.shape},catchall:never(),...v.normalizeParams(l)})}function looseObject(u,l){return new ue({type:"object",get shape(){return v.assignProp(this,"shape",{...u}),this.shape},catchall:unknown(),...v.normalizeParams(l)})}function extend(u,l){return v.extend(u,l)}function merge(u,l){return v.extend(u,l)}function pick(u,l){return v.pick(u,l)}function omit(u,l){return v.omit(u,l)}function partial(u,l){return v.partial(ke,u,l)}function required(u,l){return v.required(je,u,l)}function catchall(u,l){return u.clone({...u._zod.def,catchall:l})}const le=f.$constructor("ZodMiniUnion",(u,l)=>{h.$ZodUnion.init(u,l),S.init(u,l)});function union(u,l){return new le({type:"union",options:u,...v.normalizeParams(l)})}const pe=f.$constructor("ZodMiniDiscriminatedUnion",(u,l)=>{h.$ZodDiscriminatedUnion.init(u,l),S.init(u,l)});function discriminatedUnion(u,l,m){return new pe({type:"union",options:l,discriminator:u,...v.normalizeParams(m)})}const me=f.$constructor("ZodMiniIntersection",(u,l)=>{h.$ZodIntersection.init(u,l),S.init(u,l)});function intersection(u,l){return new me({type:"intersection",left:u,right:l})}const fe=f.$constructor("ZodMiniTuple",(u,l)=>{h.$ZodTuple.init(u,l),S.init(u,l)});function tuple(u,l,m){const f=l instanceof h.$ZodType,y=f?m:l;return new fe({type:"tuple",items:u,rest:f?l:null,...v.normalizeParams(y)})}const he=f.$constructor("ZodMiniRecord",(u,l)=>{h.$ZodRecord.init(u,l),S.init(u,l)});function record(u,l,m){return new he({type:"record",keyType:u,valueType:l,...v.normalizeParams(m)})}function partialRecord(u,l,m){return new he({type:"record",keyType:union([u,never()]),valueType:l,...v.normalizeParams(m)})}const ge=f.$constructor("ZodMiniMap",(u,l)=>{h.$ZodMap.init(u,l),S.init(u,l)});function map(u,l,m){return new ge({type:"map",keyType:u,valueType:l,...v.normalizeParams(m)})}const _e=f.$constructor("ZodMiniSet",(u,l)=>{h.$ZodSet.init(u,l),S.init(u,l)});function set(u,l){return new _e({type:"set",valueType:u,...v.normalizeParams(l)})}const ye=f.$constructor("ZodMiniEnum",(u,l)=>{h.$ZodEnum.init(u,l),S.init(u,l)});function _enum(u,l){const m=Array.isArray(u)?Object.fromEntries(u.map(u=>[u,u])):u;return new ye({type:"enum",entries:m,...v.normalizeParams(l)})}function nativeEnum(u,l){return new ye({type:"enum",entries:u,...v.normalizeParams(l)})}const ve=f.$constructor("ZodMiniLiteral",(u,l)=>{h.$ZodLiteral.init(u,l),S.init(u,l)});function literal(u,l){return new ve({type:"literal",values:Array.isArray(u)?u:[u],...v.normalizeParams(l)})}const we=f.$constructor("ZodMiniFile",(u,l)=>{h.$ZodFile.init(u,l),S.init(u,l)});function file(u){return w._file(we,u)}const be=f.$constructor("ZodMiniTransform",(u,l)=>{h.$ZodTransform.init(u,l),S.init(u,l)});function transform(u){return new be({type:"transform",transform:u})}const ke=f.$constructor("ZodMiniOptional",(u,l)=>{h.$ZodOptional.init(u,l),S.init(u,l)});function optional(u){return new ke({type:"optional",innerType:u})}const Se=f.$constructor("ZodMiniNullable",(u,l)=>{h.$ZodNullable.init(u,l),S.init(u,l)});function nullable(u){return new Se({type:"nullable",innerType:u})}function nullish(u){return optional(nullable(u))}const $e=f.$constructor("ZodMiniDefault",(u,l)=>{h.$ZodDefault.init(u,l),S.init(u,l)});function _default(u,l){return new $e({type:"default",innerType:u,get defaultValue(){return"function"==typeof l?l():l}})}const xe=f.$constructor("ZodMiniPrefault",(u,l)=>{h.$ZodPrefault.init(u,l),S.init(u,l)});function prefault(u,l){return new xe({type:"prefault",innerType:u,get defaultValue(){return"function"==typeof l?l():l}})}const je=f.$constructor("ZodMiniNonOptional",(u,l)=>{h.$ZodNonOptional.init(u,l),S.init(u,l)});function nonoptional(u,l){return new je({type:"nonoptional",innerType:u,...v.normalizeParams(l)})}const Te=f.$constructor("ZodMiniSuccess",(u,l)=>{h.$ZodSuccess.init(u,l),S.init(u,l)});function success(u){return new Te({type:"success",innerType:u})}const Ee=f.$constructor("ZodMiniCatch",(u,l)=>{h.$ZodCatch.init(u,l),S.init(u,l)});function _catch(u,l){return new Ee({type:"catch",innerType:u,catchValue:"function"==typeof l?l:()=>l})}const Pe=f.$constructor("ZodMiniNaN",(u,l)=>{h.$ZodNaN.init(u,l),S.init(u,l)});function nan(u){return w._nan(Pe,u)}const Ie=f.$constructor("ZodMiniPipe",(u,l)=>{h.$ZodPipe.init(u,l),S.init(u,l)});function pipe(u,l){return new Ie({type:"pipe",in:u,out:l})}const Re=f.$constructor("ZodMiniReadonly",(u,l)=>{h.$ZodReadonly.init(u,l),S.init(u,l)});function readonly(u){return new Re({type:"readonly",innerType:u})}const Ce=f.$constructor("ZodMiniTemplateLiteral",(u,l)=>{h.$ZodTemplateLiteral.init(u,l),S.init(u,l)});function templateLiteral(u,l){return new Ce({type:"template_literal",parts:u,...v.normalizeParams(l)})}const Ze=f.$constructor("ZodMiniLazy",(u,l)=>{h.$ZodLazy.init(u,l),S.init(u,l)});function _lazy(u){return new Ze({type:"lazy",getter:u})}const ze=f.$constructor("ZodMiniPromise",(u,l)=>{h.$ZodPromise.init(u,l),S.init(u,l)});function promise(u){return new ze({type:"promise",innerType:u})}const Ae=f.$constructor("ZodMiniCustom",(u,l)=>{h.$ZodCustom.init(u,l),S.init(u,l)});function check(u,l){const m=new y.$ZodCheck({check:"custom",...v.normalizeParams(l)});return m._zod.check=u,m}function custom(u,l){return w._custom(Ae,u??(()=>!0),l)}function refine(u,l={}){return w._refine(Ae,u,l)}function _instanceof(u,l={error:`Input not instance of ${u.name}`}){const m=custom(l=>l instanceof u,l);return m._zod.bag.Class=u,m}const stringbool=(...u)=>w._stringbool({Pipe:Ie,Boolean:Y,String:$,Transform:be},...u);function json(){const u=_lazy(()=>union([string(),number(),boolean(),_null(),array(u),record(string(),u)]));return u}},"./packages/node_modules/@elementor-external/angie-sdk/dist/index.js":function(u,l,m){m.r(l),m.d(l,{ANGIE_EXTENDED_TIMEOUT:function(){return Qt},ANGIE_MODEL_PREFERENCES:function(){return Wt},ANGIE_REQUIRED_RESOURCES:function(){return Gt},ANGIE_SIDEBAR_STATE_OPEN:function(){return qt},AngieDetector:function(){return k},AngieLocalServerTransport:function(){return $},AngieMCPTransport:function(){return S},AngieMcpSdk:function(){return jt},AngieRemoteServerTransport:function(){return x},AngieServerType:function(){return j},BrowserContextTransport:function(){return I},ClientManager:function(){return T},DEFAULT_CONTAINER_ID:function(){return z},HostEventType:function(){return C},HostLocalStorageEventType:function(){return R},MCP_READONLY:function(){return Yt},McpAppDisplayMode:function(){return Xt},MessageEventType:function(){return E},RegistrationQueue:function(){return Ht},applyWidth:function(){return Pt},clearReferrerRedirect:function(){return gt},disableNavigationPrevention:function(){return Nt},executeReferrerRedirect:function(){return ut},getAngieIframe:function(){return p},getAngieSidebarSavedState:function(){return Tt},getReferrerRedirect:function(){return lt},initAngieSidebar:function(){return Ut},initializeResize:function(){return Ot},loadState:function(){return Ct},loadWidth:function(){return It},navigateAngieIframe:function(){return zt},saveState:function(){return Rt},saveWidth:function(){return At},setReferrerRedirect:function(){return dt},toggleAngieSidebar:function(){return wt},waitForDocumentReady:function(){return ft}});var f=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/types.js");const h={none:0,error:1,warn:2,info:3,debug:4},y={error:"error",warn:"warn",info:"info",log:"info",debug:"debug"},s=(u,l)=>h[u]<=h[l],r=u=>"string"==typeof u?u:JSON.stringify(u),o=(u,l)=>{let m=`[${r(u)}]`;return typeof window<"u"?{text:`%c${m}`,style:`color: ${l.color||"#00bcd4"}; font-weight: bold;`}:{text:m}},a=(u,l,m,f)=>(...h)=>{if(!s(y[u],f()))return;if(!l)return void console[u](...h);let{text:v,style:w}=o(l,m);w?console[u](v,w,...h):console[u](v,...h)},c=(u,l)=>{let m=l.logLevel??"debug",s=()=>m;return{log:a("log",u,l,s),info:a("info",u,l,s),warn:a("warn",u,l,s),error:a("error",u,l,s),debug:a("debug",u,l,s),setLogLevel:u=>{m=u},extend:f=>c(u?((u,l)=>`${r(u)} > ${r(l)}`)(u,f):f,{...l,logLevel:m})}},d=(u,l)=>c(u,{color:"#00bcd4",logLevel:"debug",...l}),v=d("angie-sdk",{color:"#00BCD4",logLevel:"error"}),g=u=>v.extend(u),w=g("iframe-utils");let b=null;const p=()=>(b&&document.contains(b)||(b=document.querySelector('iframe[src*="angie/"]')),b),_=(u,l)=>{w.log("postMessageToAngieIframe",u,l);const m=p();if(!m?.contentWindow)return!1;const f=l||(()=>{const u=p();if(!u)return null;try{return new URL(u.src).origin}catch(u){return w.error("Error parsing iframe URL:",u),null}})();return f?(m.contentWindow.postMessage(u,f),!0):(w.error("Could not determine target origin for Angie iframe"),!1)};var S,$,x,j,E,R,C;(S||(S={})).POST_MESSAGE="postMessage",function(u){u.POST_MESSAGE="postMessage"}($||($={})),function(u){u.STREAMABLE_HTTP="streamableHttp",u.SSE="sse"}(x||(x={})),function(u){u.LOCAL="local",u.REMOTE="remote"}(j||(j={})),function(u){u.SDK_ANGIE_READY_PING="sdk-angie-ready-ping",u.SDK_ANGIE_REFRESH_PING="sdk-angie-refresh-ping",u.SDK_ANGIE_ALL_SERVERS_REGISTERED="sdk-angie-all-servers-registered",u.SDK_REQUEST_CLIENT_CREATION="sdk-request-client-creation",u.SDK_REQUEST_INIT_SERVER="sdk-request-init-server",u.SDK_TRIGGER_ANGIE="sdk-trigger-angie",u.SDK_TRIGGER_ANGIE_RESPONSE="sdk-trigger-angie-response",u.ANGIE_SIDEBAR_RESIZED="angie-sidebar-resized",u.ANGIE_SIDEBAR_TOGGLED="angie-sidebar-toggled",u.ANGIE_CHAT_TOGGLE="angie-chat-toggle",u.ANGIE_STUDIO_TOGGLE="angie-studio-toggle",u.ANGIE_NAVIGATE_TO_URL="angie/navigate-to-url",u.ANGIE_PAGE_RELOAD="angie/page-reload",u.ANGIE_DISABLE_NAVIGATION_PREVENTION="angie/disable-navigation-prevention",u.ANGIE_NAVIGATE_AFTER_RESPONSE="angie/navigate-after-response"}(E||(E={})),function(u){u.SET="ANGIE_SET_LOCALSTORAGE",u.GET="ANGIE_GET_LOCALSTORAGE"}(R||(R={})),function(u){u.RESET_HASH="reset-hash",u.HOST_READY="host/ready",u.ANGIE_LOADED="angie/loaded",u.ANGIE_READY="angie/ready"}(C||(C={}));const Z=g("angie-detector");class k{isAngieReady=!1;readyPromise;readyResolve;constructor(){if(this.readyPromise=new Promise(u=>{this.readyResolve=u}),"undefined"==typeof window)return;let u=0;const t=()=>{if(this.isAngieReady||u>=500)return void(!this.isAngieReady&&u>=500&&this.handleDetectionTimeout());const l=new MessageChannel;l.port1.onmessage=u=>{this.handleAngieReady(u.data),l.port1.close(),l.port2.close()};const m={type:E.SDK_ANGIE_READY_PING,timestamp:Date.now()};window.postMessage(m,window.location.origin,[l.port2]),u++,setTimeout(t,500)};t()}handleAngieReady(u){this.isAngieReady=!0;const l={isReady:!0,version:u.version,capabilities:u.capabilities};this.readyResolve&&this.readyResolve(l)}handleDetectionTimeout(){this.readyResolve&&this.readyResolve({isReady:!1}),Z.warn("Detection timeout - Angie may not be available")}isReady(){return this.isAngieReady}async waitForReady(){return this.readyPromise}}class I{sessionId;onmessage;onerror;onclose;_port;_started=!1;_closed=!1;constructor(u){if(!u)throw new Error("MessagePort is required");this._port=u,this._port.onmessage=u=>{try{const l=f.JSONRPCMessageSchema.parse(u.data);this.onmessage?.(l)}catch(u){const l=new Error(`Failed to parse message: ${u}`);this.onerror?.(l)}},this._port.onmessageerror=u=>{const l=new Error(`MessagePort error: ${JSON.stringify(u)}`);this.onerror?.(l)}}async start(){if(this._started)throw new Error("BrowserContextTransport already started! If using Client or Server class, note that connect() calls start() automatically.");if(this._closed)throw new Error("Cannot start a closed BrowserContextTransport");this._started=!0,this._port.start()}async send(u){if(this._closed)throw new Error("Cannot send on a closed BrowserContextTransport");return new Promise((l,m)=>{try{this._port.postMessage(u),l()}catch(u){const l=u instanceof Error?u:new Error(String(u));this.onerror?.(l),m(l)}})}async close(){this._closed||(this._closed=!0,this._port.close(),this.onclose?.())}}class T{async requestClientCreation(u){const{config:l}=u,m={serverId:u.id,serverName:l.name,serverTitle:l.title,serverVersion:l.version,description:l.description,transport:l.transport||$.POST_MESSAGE,capabilities:l.capabilities,instanceId:u.instanceId};return"type"in l&&"remote"===l.type&&(m.remote={url:l.url}),new Promise((u,l)=>{const f=new MessageChannel,h=setTimeout(()=>{l(new Error("Client creation request timed out after 15000ms"))},15e3);f.port1.onmessage=l=>{clearTimeout(h),u(l.data)};const y={type:E.SDK_REQUEST_CLIENT_CREATION,payload:m,timestamp:Date.now()};window.postMessage(y,window.location.origin,[f.port2])})}}const z="angie-sidebar-container",A={open:!1,iframe:null,iframeUrlObject:null,containerId:z};class P extends Error{}P.prototype.name="InvalidTokenError";var O,N,D,M={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}},U=(u=>(u[u.NONE=0]="NONE",u[u.ERROR=1]="ERROR",u[u.WARN=2]="WARN",u[u.INFO=3]="INFO",u[u.DEBUG=4]="DEBUG",u))(U||{});(D=U||(U={})).reset=function(){O=3,N=M},D.setLevel=function(u){if(!(0<=u&&u<=4))throw new Error("Invalid log level");O=u},D.setLogger=function(u){N=u};var L=class e{constructor(u){this._name=u}debug(...u){O>=4&&N.debug(e._format(this._name,this._method),...u)}info(...u){O>=3&&N.info(e._format(this._name,this._method),...u)}warn(...u){O>=2&&N.warn(e._format(this._name,this._method),...u)}error(...u){O>=1&&N.error(e._format(this._name,this._method),...u)}throw(u){throw this.error(u),u}create(u){const l=Object.create(this);return l._method=u,l.debug("begin"),l}static createStatic(u,l){const m=new e(`${u}.${l}`);return m.debug("begin"),m}static _format(u,l){const m=`[${u}]`;return l?`${m} ${l}:`:m}static debug(u,...l){O>=4&&N.debug(e._format(u),...l)}static info(u,...l){O>=3&&N.info(e._format(u),...l)}static warn(u,...l){O>=2&&N.warn(e._format(u),...l)}static error(u,...l){O>=1&&N.error(e._format(u),...l)}};U.reset();var F=class{static decode(u){try{return function(u,l){if("string"!=typeof u)throw new P("Invalid token specified: must be a string");l||(l={});const m=!0===l.header?0:1,f=u.split(".")[m];if("string"!=typeof f)throw new P(`Invalid token specified: missing part #${m+1}`);let h;try{h=function(u){let l=u.replace(/-/g,"+").replace(/_/g,"/");switch(l.length%4){case 0:break;case 2:l+="==";break;case 3:l+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return function(u){return decodeURIComponent(atob(u).replace(/(.)/g,(u,l)=>{let m=l.charCodeAt(0).toString(16).toUpperCase();return m.length<2&&(m="0"+m),"%"+m}))}(l)}catch(u){return atob(l)}}(f)}catch(u){throw new P(`Invalid token specified: invalid base64 for part #${m+1} (${u.message})`)}try{return JSON.parse(h)}catch(u){throw new P(`Invalid token specified: invalid json for part #${m+1} (${u.message})`)}}(u)}catch(u){throw L.error("JwtUtils.decode",u),u}}static async generateSignedJwt(u,l,m){const f=`${K.encodeBase64Url((new TextEncoder).encode(JSON.stringify(u)))}.${K.encodeBase64Url((new TextEncoder).encode(JSON.stringify(l)))}`,h=await window.crypto.subtle.sign({name:"ECDSA",hash:{name:"SHA-256"}},m,(new TextEncoder).encode(f));return`${f}.${K.encodeBase64Url(new Uint8Array(h))}`}static async generateSignedJwtWithHmac(u,l,m){const f=`${K.encodeBase64Url((new TextEncoder).encode(JSON.stringify(u)))}.${K.encodeBase64Url((new TextEncoder).encode(JSON.stringify(l)))}`,h=await window.crypto.subtle.sign("HMAC",m,(new TextEncoder).encode(f));return`${f}.${K.encodeBase64Url(new Uint8Array(h))}`}},q=u=>btoa([...new Uint8Array(u)].map(u=>String.fromCharCode(u)).join("")),V=class e{static _randomWord(){const u=new Uint32Array(1);return crypto.getRandomValues(u),u[0]}static generateUUIDv4(){return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,u=>(+u^e._randomWord()&15>>+u/4).toString(16)).replace(/-/g,"")}static generateCodeVerifier(){return e.generateUUIDv4()+e.generateUUIDv4()+e.generateUUIDv4()}static async generateCodeChallenge(u){if(!crypto.subtle)throw new Error("Crypto.subtle is available only in secure contexts (HTTPS).");try{const l=(new TextEncoder).encode(u),m=await crypto.subtle.digest("SHA-256",l);return q(m).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(u){throw L.error("CryptoUtils.generateCodeChallenge",u),u}}static generateBasicAuth(u,l){const m=(new TextEncoder).encode([u,l].join(":"));return q(m)}static async hash(u,l){const m=(new TextEncoder).encode(l),f=await crypto.subtle.digest(u,m);return new Uint8Array(f)}static async customCalculateJwkThumbprint(u){let l;switch(u.kty){case"RSA":l={e:u.e,kty:u.kty,n:u.n};break;case"EC":l={crv:u.crv,kty:u.kty,x:u.x,y:u.y};break;case"OKP":l={crv:u.crv,kty:u.kty,x:u.x};break;case"oct":l={crv:u.k,kty:u.kty};break;default:throw new Error("Unknown jwk type")}const m=await e.hash("SHA-256",JSON.stringify(l));return e.encodeBase64Url(m)}static async generateDPoPProof({url:u,accessToken:l,httpMethod:m,keyPair:f,nonce:h}){let y,v;const w={jti:window.crypto.randomUUID(),htm:null!=m?m:"GET",htu:u,iat:Math.floor(Date.now()/1e3)};l&&(y=await e.hash("SHA-256",l),v=e.encodeBase64Url(y),w.ath=v),h&&(w.nonce=h);try{const u=await crypto.subtle.exportKey("jwk",f.publicKey),l={alg:"ES256",typ:"dpop+jwt",jwk:{crv:u.crv,kty:u.kty,x:u.x,y:u.y}};return await F.generateSignedJwt(l,w,f.privateKey)}catch(u){throw u instanceof TypeError?new Error(`Error exporting dpop public key: ${u.message}`):u}}static async generateDPoPJkt(u){try{const l=await crypto.subtle.exportKey("jwk",u.publicKey);return await e.customCalculateJwkThumbprint(l)}catch(u){throw u instanceof TypeError?new Error(`Could not retrieve dpop keys from storage: ${u.message}`):u}}static async generateDPoPKeys(){return await window.crypto.subtle.generateKey({name:"ECDSA",namedCurve:"P-256"},!1,["sign","verify"])}static async generateClientAssertionJwt(u,l,m,f="HS256"){const h=Math.floor(Date.now()/1e3),y={alg:f,typ:"JWT"},v={iss:u,sub:u,aud:m,jti:e.generateUUIDv4(),exp:h+300,iat:h},w={HS256:"SHA-256",HS384:"SHA-384",HS512:"SHA-512"}[f];if(!w)throw new Error(`Unsupported algorithm: ${f}. Supported algorithms are: HS256, HS384, HS512`);const b=new TextEncoder,S=await crypto.subtle.importKey("raw",b.encode(l),{name:"HMAC",hash:w},!1,["sign"]);return await F.generateSignedJwtWithHmac(y,v,S)}};V.encodeBase64Url=u=>q(u).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_");var K=V,H=class{constructor(u){this._name=u,this._callbacks=[],this._logger=new L(`Event('${this._name}')`)}addHandler(u){return this._callbacks.push(u),()=>this.removeHandler(u)}removeHandler(u){const l=this._callbacks.lastIndexOf(u);l>=0&&this._callbacks.splice(l,1)}async raise(...u){this._logger.debug("raise:",...u);for(const l of this._callbacks)await l(...u)}},B=class{static center({...u}){var l;return null==u.width&&(u.width=null!=(l=[800,720,600,480].find(u=>u<=window.outerWidth/1.618))?l:360),null!=u.left||(u.left=Math.max(0,Math.round(window.screenX+(window.outerWidth-u.width)/2))),null!=u.height&&(null!=u.top||(u.top=Math.max(0,Math.round(window.screenY+(window.outerHeight-u.height)/2)))),u}static serialize(u){return Object.entries(u).filter(([,u])=>null!=u).map(([u,l])=>`${u}=${"boolean"!=typeof l?l:l?"yes":"no"}`).join(",")}},J=class e extends H{constructor(){super(...arguments),this._logger=new L(`Timer('${this._name}')`),this._timerHandle=null,this._expiration=0,this._callback=()=>{const u=this._expiration-e.getEpochTime();this._logger.debug("timer completes in",u),this._expiration<=e.getEpochTime()&&(this.cancel(),super.raise())}}static getEpochTime(){return Math.floor(Date.now()/1e3)}init(u){const l=this._logger.create("init");u=Math.max(Math.floor(u),1);const m=e.getEpochTime()+u;if(this.expiration===m&&this._timerHandle)return void l.debug("skipping since already initialized for expiration at",this.expiration);this.cancel(),l.debug("using duration",u),this._expiration=m;const f=Math.min(u,5);this._timerHandle=setInterval(this._callback,1e3*f)}get expiration(){return this._expiration}cancel(){this._logger.create("cancel"),this._timerHandle&&(clearInterval(this._timerHandle),this._timerHandle=null)}},G=class{static readParams(u,l="query"){if(!u)throw new TypeError("Invalid URL");const m=new URL(u,"http://127.0.0.1")["fragment"===l?"hash":"search"];return new URLSearchParams(m.slice(1))}},W=";",Q=class extends Error{constructor(u,l){var m,f,h;if(super(u.error_description||u.error||""),this.form=l,this.name="ErrorResponse",!u.error)throw L.error("ErrorResponse","No error passed"),new Error("No error passed");this.error=u.error,this.error_description=null!=(m=u.error_description)?m:null,this.error_uri=null!=(f=u.error_uri)?f:null,this.state=u.userState,this.session_state=null!=(h=u.session_state)?h:null,this.url_state=u.url_state}},Y=class extends Error{constructor(u){super(u),this.name="ErrorTimeout"}},X=class{constructor(u){this._logger=new L("AccessTokenEvents"),this._expiringTimer=new J("Access token expiring"),this._expiredTimer=new J("Access token expired"),this._expiringNotificationTimeInSeconds=u.expiringNotificationTimeInSeconds}async load(u){const l=this._logger.create("load");if(u.access_token&&void 0!==u.expires_in){const m=u.expires_in;if(l.debug("access token present, remaining duration:",m),m>0){let u=m-this._expiringNotificationTimeInSeconds;u<=0&&(u=1),l.debug("registering expiring timer, raising in",u,"seconds"),this._expiringTimer.init(u)}else l.debug("canceling existing expiring timer because we're past expiration."),this._expiringTimer.cancel();const f=m+1;l.debug("registering expired timer, raising in",f,"seconds"),this._expiredTimer.init(f)}else this._expiringTimer.cancel(),this._expiredTimer.cancel()}async unload(){this._logger.debug("unload: canceling existing access token timers"),this._expiringTimer.cancel(),this._expiredTimer.cancel()}addAccessTokenExpiring(u){return this._expiringTimer.addHandler(u)}removeAccessTokenExpiring(u){this._expiringTimer.removeHandler(u)}addAccessTokenExpired(u){return this._expiredTimer.addHandler(u)}removeAccessTokenExpired(u){this._expiredTimer.removeHandler(u)}},ee=class{constructor(u,l,m,f,h){this._callback=u,this._client_id=l,this._intervalInSeconds=f,this._stopOnError=h,this._logger=new L("CheckSessionIFrame"),this._timer=null,this._session_state=null,this._message=u=>{u.origin===this._frame_origin&&u.source===this._frame.contentWindow&&("error"===u.data?(this._logger.error("error message from check session op iframe"),this._stopOnError&&this.stop()):"changed"===u.data?(this._logger.debug("changed message from check session op iframe"),this.stop(),this._callback()):this._logger.debug(u.data+" message from check session op iframe"))};const y=new URL(m);this._frame_origin=y.origin,this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="fixed",this._frame.style.left="-1000px",this._frame.style.top="0",this._frame.width="0",this._frame.height="0",this._frame.src=y.href}load(){return new Promise(u=>{this._frame.onload=()=>{u()},window.document.body.appendChild(this._frame),window.addEventListener("message",this._message,!1)})}start(u){if(this._session_state===u)return;this._logger.create("start"),this.stop(),this._session_state=u;const t=()=>{this._frame.contentWindow&&this._session_state&&this._frame.contentWindow.postMessage(this._client_id+" "+this._session_state,this._frame_origin)};t(),this._timer=setInterval(t,1e3*this._intervalInSeconds)}stop(){this._logger.create("stop"),this._session_state=null,this._timer&&(clearInterval(this._timer),this._timer=null)}},te=class{constructor(){this._logger=new L("InMemoryWebStorage"),this._data={}}clear(){this._logger.create("clear"),this._data={}}getItem(u){return this._logger.create(`getItem('${u}')`),this._data[u]}setItem(u,l){this._logger.create(`setItem('${u}')`),this._data[u]=l}removeItem(u){this._logger.create(`removeItem('${u}')`),delete this._data[u]}get length(){return Object.getOwnPropertyNames(this._data).length}key(u){return Object.getOwnPropertyNames(this._data)[u]}},ne=class extends Error{constructor(u,l){super(l),this.name="ErrorDPoPNonce",this.nonce=u}},re=class{constructor(u=[],l=null,m={}){this._jwtHandler=l,this._extraHeaders=m,this._logger=new L("JsonService"),this._contentTypes=[],this._contentTypes.push(...u,"application/json"),l&&this._contentTypes.push("application/jwt")}async fetchWithTimeout(u,l={}){const{timeoutInSeconds:m,...f}=l;if(!m)return await fetch(u,f);const h=new AbortController,y=setTimeout(()=>h.abort(),1e3*m);try{return await fetch(u,{...l,signal:h.signal})}catch(u){if(u instanceof DOMException&&"AbortError"===u.name)throw new Y("Network timed out");throw u}finally{clearTimeout(y)}}async getJson(u,{token:l,credentials:m,timeoutInSeconds:f}={}){const h=this._logger.create("getJson"),y={Accept:this._contentTypes.join(", ")};let v;l&&(h.debug("token passed, setting Authorization header"),y.Authorization="Bearer "+l),this._appendExtraHeaders(y);try{h.debug("url:",u),v=await this.fetchWithTimeout(u,{method:"GET",headers:y,timeoutInSeconds:f,credentials:m})}catch(u){throw h.error("Network Error"),u}h.debug("HTTP response received, status",v.status);const w=v.headers.get("Content-Type");if(w&&!this._contentTypes.find(u=>w.startsWith(u))&&h.throw(new Error(`Invalid response Content-Type: ${null!=w?w:"undefined"}, from URL: ${u}`)),v.ok&&this._jwtHandler&&(null==w?void 0:w.startsWith("application/jwt")))return await this._jwtHandler(await v.text());let b;try{b=await v.json()}catch(u){if(h.error("Error parsing JSON response",u),v.ok)throw u;throw new Error(`${v.statusText} (${v.status})`)}if(!v.ok){if(h.error("Error from server:",b),b.error)throw new Q(b);throw new Error(`${v.statusText} (${v.status}): ${JSON.stringify(b)}`)}return b}async postForm(u,{body:l,basicAuth:m,timeoutInSeconds:f,initCredentials:h,extraHeaders:y}){const v=this._logger.create("postForm"),w={Accept:this._contentTypes.join(", "),"Content-Type":"application/x-www-form-urlencoded",...y};let b;void 0!==m&&(w.Authorization="Basic "+m),this._appendExtraHeaders(w);try{v.debug("url:",u),b=await this.fetchWithTimeout(u,{method:"POST",headers:w,body:l,timeoutInSeconds:f,credentials:h})}catch(u){throw v.error("Network error"),u}v.debug("HTTP response received, status",b.status);const S=b.headers.get("Content-Type");if(S&&!this._contentTypes.find(u=>S.startsWith(u)))throw new Error(`Invalid response Content-Type: ${null!=S?S:"undefined"}, from URL: ${u}`);const $=await b.text();let x={};if($)try{x=JSON.parse($)}catch(u){if(v.error("Error parsing JSON response",u),b.ok)throw u;throw new Error(`${b.statusText} (${b.status})`)}if(!b.ok){if(v.error("Error from server:",x),b.headers.has("dpop-nonce")){const u=b.headers.get("dpop-nonce");throw new ne(u,`${JSON.stringify(x)}`)}if(x.error)throw new Q(x,l);throw new Error(`${b.statusText} (${b.status}): ${JSON.stringify(x)}`)}return x}_appendExtraHeaders(u){const l=this._logger.create("appendExtraHeaders"),m=Object.keys(this._extraHeaders),f=["accept","content-type"],h=["authorization"];0!==m.length&&m.forEach(m=>{if(f.includes(m.toLocaleLowerCase()))return void l.warn("Protected header could not be set",m,f);if(h.includes(m.toLocaleLowerCase())&&Object.keys(u).includes(m))return void l.warn("Header could not be overridden",m,h);const y="function"==typeof this._extraHeaders[m]?this._extraHeaders[m]():this._extraHeaders[m];y&&""!==y&&(u[m]=y)})}},oe=class{constructor(u){this._settings=u,this._logger=new L("MetadataService"),this._signingKeys=null,this._metadata=null,this._metadataUrl=this._settings.metadataUrl,this._jsonService=new re(["application/jwk-set+json"],null,this._settings.extraHeaders),this._settings.signingKeys&&(this._logger.debug("using signingKeys from settings"),this._signingKeys=this._settings.signingKeys),this._settings.metadata&&(this._logger.debug("using metadata from settings"),this._metadata=this._settings.metadata),this._settings.fetchRequestCredentials&&(this._logger.debug("using fetchRequestCredentials from settings"),this._fetchRequestCredentials=this._settings.fetchRequestCredentials)}resetSigningKeys(){this._signingKeys=null}async getMetadata(){const u=this._logger.create("getMetadata");if(this._metadata)return u.debug("using cached values"),this._metadata;if(!this._metadataUrl)throw u.throw(new Error("No authority or metadataUrl configured on settings")),null;u.debug("getting metadata from",this._metadataUrl);const l=await this._jsonService.getJson(this._metadataUrl,{credentials:this._fetchRequestCredentials,timeoutInSeconds:this._settings.requestTimeoutInSeconds});return u.debug("merging remote JSON with seed metadata"),this._metadata=Object.assign({},l,this._settings.metadataSeed),this._metadata}getIssuer(){return this._getMetadataProperty("issuer")}getAuthorizationEndpoint(){return this._getMetadataProperty("authorization_endpoint")}getUserInfoEndpoint(){return this._getMetadataProperty("userinfo_endpoint")}getTokenEndpoint(u=!0){return this._getMetadataProperty("token_endpoint",u)}getCheckSessionIframe(){return this._getMetadataProperty("check_session_iframe",!0)}getEndSessionEndpoint(){return this._getMetadataProperty("end_session_endpoint",!0)}getRevocationEndpoint(u=!0){return this._getMetadataProperty("revocation_endpoint",u)}getKeysEndpoint(u=!0){return this._getMetadataProperty("jwks_uri",u)}async _getMetadataProperty(u,l=!1){const m=this._logger.create(`_getMetadataProperty('${u}')`),f=await this.getMetadata();if(m.debug("resolved"),void 0===f[u]){if(!0===l)return void m.warn("Metadata does not contain optional property");m.throw(new Error("Metadata does not contain property "+u))}return f[u]}async getSigningKeys(){const u=this._logger.create("getSigningKeys");if(this._signingKeys)return u.debug("returning signingKeys from cache"),this._signingKeys;const l=await this.getKeysEndpoint(!1);u.debug("got jwks_uri",l);const m=await this._jsonService.getJson(l,{timeoutInSeconds:this._settings.requestTimeoutInSeconds});if(u.debug("got key set",m),!Array.isArray(m.keys))throw u.throw(new Error("Missing keys on keyset")),null;return this._signingKeys=m.keys,this._signingKeys}},se=class{constructor({prefix:u="oidc.",store:l=localStorage}={}){this._logger=new L("WebStorageStateStore"),this._store=l,this._prefix=u}async set(u,l){this._logger.create(`set('${u}')`),u=this._prefix+u,await this._store.setItem(u,l)}async get(u){return this._logger.create(`get('${u}')`),u=this._prefix+u,await this._store.getItem(u)}async remove(u){this._logger.create(`remove('${u}')`),u=this._prefix+u;const l=await this._store.getItem(u);return await this._store.removeItem(u),l}async getAllKeys(){this._logger.create("getAllKeys");const u=await this._store.length,l=[];for(let m=0;m<u;m++){const u=await this._store.key(m);u&&0===u.indexOf(this._prefix)&&l.push(u.substr(this._prefix.length))}return l}},ie=class{constructor({authority:u,metadataUrl:l,metadata:m,signingKeys:f,metadataSeed:h,client_id:y,client_secret:v,response_type:w="code",scope:b="openid",redirect_uri:S,post_logout_redirect_uri:$,client_authentication:x="client_secret_post",token_endpoint_auth_signing_alg:j="HS256",prompt:E,display:R,max_age:C,ui_locales:Z,acr_values:z,resource:A,response_mode:O,filterProtocolClaims:N=!0,loadUserInfo:D=!1,requestTimeoutInSeconds:M,staleStateAgeInSeconds:U=900,mergeClaimsStrategy:L={array:"replace"},disablePKCE:F=!1,stateStore:V,revokeTokenAdditionalContentTypes:K,fetchRequestCredentials:H,refreshTokenAllowedScope:B,extraQueryParams:J={},extraTokenParams:G={},extraHeaders:W={},dpop:Q,omitScopeWhenRequesting:Y=!1}){var X;if(this.authority=u,l?this.metadataUrl=l:(this.metadataUrl=u,u&&(this.metadataUrl.endsWith("/")||(this.metadataUrl+="/"),this.metadataUrl+=".well-known/openid-configuration")),this.metadata=m,this.metadataSeed=h,this.signingKeys=f,this.client_id=y,this.client_secret=v,this.response_type=w,this.scope=b,this.redirect_uri=S,this.post_logout_redirect_uri=$,this.client_authentication=x,this.token_endpoint_auth_signing_alg=j,this.prompt=E,this.display=R,this.max_age=C,this.ui_locales=Z,this.acr_values=z,this.resource=A,this.response_mode=O,this.filterProtocolClaims=null==N||N,this.loadUserInfo=!!D,this.staleStateAgeInSeconds=U,this.mergeClaimsStrategy=L,this.omitScopeWhenRequesting=Y,this.disablePKCE=!!F,this.revokeTokenAdditionalContentTypes=K,this.fetchRequestCredentials=H||"same-origin",this.requestTimeoutInSeconds=M,V)this.stateStore=V;else{const u="undefined"!=typeof window?window.localStorage:new te;this.stateStore=new se({store:u})}if(this.refreshTokenAllowedScope=B,this.extraQueryParams=J,this.extraTokenParams=G,this.extraHeaders=W,this.dpop=Q,this.dpop&&!(null==(X=this.dpop)?void 0:X.store))throw new Error("A DPoPStore is required when dpop is enabled")}},ae=class{constructor(u,l){this._settings=u,this._metadataService=l,this._logger=new L("UserInfoService"),this._getClaimsFromJwt=async u=>{const l=this._logger.create("_getClaimsFromJwt");try{const m=F.decode(u);return l.debug("JWT decoding successful"),m}catch(u){throw l.error("Error parsing JWT response"),u}},this._jsonService=new re(void 0,this._getClaimsFromJwt,this._settings.extraHeaders)}async getClaims(u){const l=this._logger.create("getClaims");u||this._logger.throw(new Error("No token passed"));const m=await this._metadataService.getUserInfoEndpoint();l.debug("got userinfo url",m);const f=await this._jsonService.getJson(m,{token:u,credentials:this._settings.fetchRequestCredentials,timeoutInSeconds:this._settings.requestTimeoutInSeconds});return l.debug("got claims",f),f}},ce=class{constructor(u,l){this._settings=u,this._metadataService=l,this._logger=new L("TokenClient"),this._jsonService=new re(this._settings.revokeTokenAdditionalContentTypes,null,this._settings.extraHeaders)}async exchangeCode({grant_type:u="authorization_code",redirect_uri:l=this._settings.redirect_uri,client_id:m=this._settings.client_id,client_secret:f=this._settings.client_secret,extraHeaders:h,...y}){const v=this._logger.create("exchangeCode");m||v.throw(new Error("A client_id is required")),l||v.throw(new Error("A redirect_uri is required")),y.code||v.throw(new Error("A code is required"));const w=new URLSearchParams({grant_type:u,redirect_uri:l});for(const[u,l]of Object.entries(y))null!=l&&w.set(u,l);if(("client_secret_basic"===this._settings.client_authentication||"client_secret_jwt"===this._settings.client_authentication)&&null==f)throw v.throw(new Error("A client_secret is required")),null;let b;const S=await this._metadataService.getTokenEndpoint(!1);switch(this._settings.client_authentication){case"client_secret_basic":b=K.generateBasicAuth(m,f);break;case"client_secret_post":w.append("client_id",m),f&&w.append("client_secret",f);break;case"client_secret_jwt":{const u=await K.generateClientAssertionJwt(m,f,S,this._settings.token_endpoint_auth_signing_alg);w.append("client_id",m),w.append("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),w.append("client_assertion",u);break}}v.debug("got token endpoint");const $=await this._jsonService.postForm(S,{body:w,basicAuth:b,timeoutInSeconds:this._settings.requestTimeoutInSeconds,initCredentials:this._settings.fetchRequestCredentials,extraHeaders:h});return v.debug("got response"),$}async exchangeCredentials({grant_type:u="password",client_id:l=this._settings.client_id,client_secret:m=this._settings.client_secret,scope:f=this._settings.scope,...h}){const y=this._logger.create("exchangeCredentials");l||y.throw(new Error("A client_id is required"));const v=new URLSearchParams({grant_type:u});this._settings.omitScopeWhenRequesting||v.set("scope",f);for(const[u,l]of Object.entries(h))null!=l&&v.set(u,l);if(("client_secret_basic"===this._settings.client_authentication||"client_secret_jwt"===this._settings.client_authentication)&&null==m)throw y.throw(new Error("A client_secret is required")),null;let w;const b=await this._metadataService.getTokenEndpoint(!1);switch(this._settings.client_authentication){case"client_secret_basic":w=K.generateBasicAuth(l,m);break;case"client_secret_post":v.append("client_id",l),m&&v.append("client_secret",m);break;case"client_secret_jwt":{const u=await K.generateClientAssertionJwt(l,m,b,this._settings.token_endpoint_auth_signing_alg);v.append("client_id",l),v.append("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),v.append("client_assertion",u);break}}y.debug("got token endpoint");const S=await this._jsonService.postForm(b,{body:v,basicAuth:w,timeoutInSeconds:this._settings.requestTimeoutInSeconds,initCredentials:this._settings.fetchRequestCredentials});return y.debug("got response"),S}async exchangeRefreshToken({grant_type:u="refresh_token",client_id:l=this._settings.client_id,client_secret:m=this._settings.client_secret,timeoutInSeconds:f,extraHeaders:h,...y}){const v=this._logger.create("exchangeRefreshToken");l||v.throw(new Error("A client_id is required")),y.refresh_token||v.throw(new Error("A refresh_token is required"));const w=new URLSearchParams({grant_type:u});for(const[u,l]of Object.entries(y))Array.isArray(l)?l.forEach(l=>w.append(u,l)):null!=l&&w.set(u,l);if(("client_secret_basic"===this._settings.client_authentication||"client_secret_jwt"===this._settings.client_authentication)&&null==m)throw v.throw(new Error("A client_secret is required")),null;let b;const S=await this._metadataService.getTokenEndpoint(!1);switch(this._settings.client_authentication){case"client_secret_basic":b=K.generateBasicAuth(l,m);break;case"client_secret_post":w.append("client_id",l),m&&w.append("client_secret",m);break;case"client_secret_jwt":{const u=await K.generateClientAssertionJwt(l,m,S,this._settings.token_endpoint_auth_signing_alg);w.append("client_id",l),w.append("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),w.append("client_assertion",u);break}}v.debug("got token endpoint");const $=await this._jsonService.postForm(S,{body:w,basicAuth:b,timeoutInSeconds:f,initCredentials:this._settings.fetchRequestCredentials,extraHeaders:h});return v.debug("got response"),$}async revoke(u){var l;const m=this._logger.create("revoke");u.token||m.throw(new Error("A token is required"));const f=await this._metadataService.getRevocationEndpoint(!1);m.debug(`got revocation endpoint, revoking ${null!=(l=u.token_type_hint)?l:"default token type"}`);const h=new URLSearchParams;for(const[l,m]of Object.entries(u))null!=m&&h.set(l,m);h.set("client_id",this._settings.client_id),this._settings.client_secret&&h.set("client_secret",this._settings.client_secret),await this._jsonService.postForm(f,{body:h,timeoutInSeconds:this._settings.requestTimeoutInSeconds}),m.debug("got response")}},de=class{constructor(u,l,m){this._settings=u,this._metadataService=l,this._claimsService=m,this._logger=new L("ResponseValidator"),this._userInfoService=new ae(this._settings,this._metadataService),this._tokenClient=new ce(this._settings,this._metadataService)}async validateSigninResponse(u,l,m){const f=this._logger.create("validateSigninResponse");this._processSigninState(u,l),f.debug("state processed"),await this._processCode(u,l,m),f.debug("code processed"),u.isOpenId&&this._validateIdTokenAttributes(u),f.debug("tokens validated"),await this._processClaims(u,null==l?void 0:l.skipUserInfo,u.isOpenId),f.debug("claims processed")}async validateCredentialsResponse(u,l){const m=this._logger.create("validateCredentialsResponse"),f=u.isOpenId&&!!u.id_token;f&&this._validateIdTokenAttributes(u),m.debug("tokens validated"),await this._processClaims(u,l,f),m.debug("claims processed")}async validateRefreshResponse(u,l){const m=this._logger.create("validateRefreshResponse");u.userState=l.data,null!=u.session_state||(u.session_state=l.session_state),null!=u.scope||(u.scope=l.scope),u.isOpenId&&u.id_token&&(this._validateIdTokenAttributes(u,l.id_token),m.debug("ID Token validated")),u.id_token||(u.id_token=l.id_token,u.profile=l.profile);const f=u.isOpenId&&!!u.id_token;await this._processClaims(u,!1,f),m.debug("claims processed")}validateSignoutResponse(u,l){const m=this._logger.create("validateSignoutResponse");if(l.id!==u.state&&m.throw(new Error("State does not match")),m.debug("state validated"),u.userState=l.data,u.error)throw m.warn("Response was error",u.error),new Q(u)}_processSigninState(u,l){const m=this._logger.create("_processSigninState");if(l.id!==u.state&&m.throw(new Error("State does not match")),l.client_id||m.throw(new Error("No client_id on state")),l.authority||m.throw(new Error("No authority on state")),this._settings.authority!==l.authority&&m.throw(new Error("authority mismatch on settings vs. signin state")),this._settings.client_id&&this._settings.client_id!==l.client_id&&m.throw(new Error("client_id mismatch on settings vs. signin state")),m.debug("state validated"),u.userState=l.data,u.url_state=l.url_state,null!=u.scope||(u.scope=l.scope),u.error)throw m.warn("Response was error",u.error),new Q(u);l.code_verifier&&!u.code&&m.throw(new Error("Expected code in response"))}async _processClaims(u,l=!1,m=!0){const f=this._logger.create("_processClaims");if(u.profile=this._claimsService.filterProtocolClaims(u.profile),l||!this._settings.loadUserInfo||!u.access_token)return void f.debug("not loading user info");f.debug("loading user info");const h=await this._userInfoService.getClaims(u.access_token);f.debug("user info claims received from user info endpoint"),m&&h.sub!==u.profile.sub&&f.throw(new Error("subject from UserInfo response does not match subject in ID Token")),u.profile=this._claimsService.mergeClaims(u.profile,this._claimsService.filterProtocolClaims(h)),f.debug("user info claims received, updated profile:",u.profile)}async _processCode(u,l,m){const f=this._logger.create("_processCode");if(u.code){f.debug("Validating code");const h=await this._tokenClient.exchangeCode({client_id:l.client_id,client_secret:l.client_secret,code:u.code,redirect_uri:l.redirect_uri,code_verifier:l.code_verifier,extraHeaders:m,...l.extraTokenParams});Object.assign(u,h)}else f.debug("No code to process")}_validateIdTokenAttributes(u,l){var m;const f=this._logger.create("_validateIdTokenAttributes");f.debug("decoding ID Token JWT");const h=F.decode(null!=(m=u.id_token)?m:"");if(h.sub||f.throw(new Error("ID Token is missing a subject claim")),l){const u=F.decode(l);h.sub!==u.sub&&f.throw(new Error("sub in id_token does not match current sub")),h.auth_time&&h.auth_time!==u.auth_time&&f.throw(new Error("auth_time in id_token does not match original auth_time")),h.azp&&h.azp!==u.azp&&f.throw(new Error("azp in id_token does not match original azp")),!h.azp&&u.azp&&f.throw(new Error("azp not in id_token, but present in original id_token"))}u.profile=h}},ue=class e{constructor(u){this.id=u.id||K.generateUUIDv4(),this.data=u.data,u.created&&u.created>0?this.created=u.created:this.created=J.getEpochTime(),this.request_type=u.request_type,this.url_state=u.url_state}toStorageString(){return new L("State").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,url_state:this.url_state})}static fromStorageString(u){return L.createStatic("State","fromStorageString"),Promise.resolve(new e(JSON.parse(u)))}static async clearStaleState(u,l){const m=L.createStatic("State","clearStaleState"),f=J.getEpochTime()-l,h=await u.getAllKeys();m.debug("got keys",h);for(let l=0;l<h.length;l++){const y=h[l],v=await u.get(y);let w=!1;if(v)try{const u=await e.fromStorageString(v);m.debug("got item from key:",y,u.created),u.created<=f&&(w=!0)}catch(u){m.error("Error parsing state for key:",y,u),w=!0}else m.debug("no item in storage for key:",y),w=!0;w&&(m.debug("removed item for key:",y),u.remove(y))}}},le=class e extends ue{constructor(u){super(u),this.code_verifier=u.code_verifier,this.code_challenge=u.code_challenge,this.authority=u.authority,this.client_id=u.client_id,this.redirect_uri=u.redirect_uri,this.scope=u.scope,this.client_secret=u.client_secret,this.extraTokenParams=u.extraTokenParams,this.response_mode=u.response_mode,this.skipUserInfo=u.skipUserInfo}static async create(u){const l=!0===u.code_verifier?K.generateCodeVerifier():u.code_verifier||void 0,m=l?await K.generateCodeChallenge(l):void 0;return new e({...u,code_verifier:l,code_challenge:m})}toStorageString(){return new L("SigninState").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,url_state:this.url_state,code_verifier:this.code_verifier,authority:this.authority,client_id:this.client_id,redirect_uri:this.redirect_uri,scope:this.scope,client_secret:this.client_secret,extraTokenParams:this.extraTokenParams,response_mode:this.response_mode,skipUserInfo:this.skipUserInfo})}static fromStorageString(u){L.createStatic("SigninState","fromStorageString");const l=JSON.parse(u);return e.create(l)}},pe=class e{constructor(u){this.url=u.url,this.state=u.state}static async create({url:u,authority:l,client_id:m,redirect_uri:f,response_type:h,scope:y,state_data:v,response_mode:w,request_type:b,client_secret:S,nonce:$,url_state:x,resource:j,skipUserInfo:E,extraQueryParams:R,extraTokenParams:C,disablePKCE:Z,dpopJkt:z,omitScopeWhenRequesting:A,...O}){if(!u)throw this._logger.error("create: No url passed"),new Error("url");if(!m)throw this._logger.error("create: No client_id passed"),new Error("client_id");if(!f)throw this._logger.error("create: No redirect_uri passed"),new Error("redirect_uri");if(!h)throw this._logger.error("create: No response_type passed"),new Error("response_type");if(!y)throw this._logger.error("create: No scope passed"),new Error("scope");if(!l)throw this._logger.error("create: No authority passed"),new Error("authority");const N=await le.create({data:v,request_type:b,url_state:x,code_verifier:!Z,client_id:m,authority:l,redirect_uri:f,response_mode:w,client_secret:S,scope:y,extraTokenParams:C,skipUserInfo:E}),D=new URL(u);D.searchParams.append("client_id",m),D.searchParams.append("redirect_uri",f),D.searchParams.append("response_type",h),A||D.searchParams.append("scope",y),$&&D.searchParams.append("nonce",$),z&&D.searchParams.append("dpop_jkt",z);let M=N.id;x&&(M=`${M}${W}${x}`),D.searchParams.append("state",M),N.code_challenge&&(D.searchParams.append("code_challenge",N.code_challenge),D.searchParams.append("code_challenge_method","S256")),j&&(Array.isArray(j)?j:[j]).forEach(u=>D.searchParams.append("resource",u));for(const[u,l]of Object.entries({response_mode:w,...O,...R}))null!=l&&D.searchParams.append(u,l.toString());return new e({url:D.href,state:N})}};pe._logger=new L("SigninRequest");var me=pe,fe=class{constructor(u){if(this.access_token="",this.token_type="",this.profile={},this.state=u.get("state"),this.session_state=u.get("session_state"),this.state){const u=decodeURIComponent(this.state).split(W);this.state=u[0],u.length>1&&(this.url_state=u.slice(1).join(W))}this.error=u.get("error"),this.error_description=u.get("error_description"),this.error_uri=u.get("error_uri"),this.code=u.get("code")}get expires_in(){if(void 0!==this.expires_at)return this.expires_at-J.getEpochTime()}set expires_in(u){"string"==typeof u&&(u=Number(u)),void 0!==u&&u>=0&&(this.expires_at=Math.floor(u)+J.getEpochTime())}get isOpenId(){var u;return(null==(u=this.scope)?void 0:u.split(" ").includes("openid"))||!!this.id_token}},he=class{constructor({url:u,state_data:l,id_token_hint:m,post_logout_redirect_uri:f,extraQueryParams:h,request_type:y,client_id:v,url_state:w}){if(this._logger=new L("SignoutRequest"),!u)throw this._logger.error("ctor: No url passed"),new Error("url");const b=new URL(u);if(m&&b.searchParams.append("id_token_hint",m),v&&b.searchParams.append("client_id",v),f&&(b.searchParams.append("post_logout_redirect_uri",f),l||w)){this.state=new ue({data:l,request_type:y,url_state:w});let u=this.state.id;w&&(u=`${u}${W}${w}`),b.searchParams.append("state",u)}for(const[u,l]of Object.entries({...h}))null!=l&&b.searchParams.append(u,l.toString());this.url=b.href}},ge=class{constructor(u){if(this.state=u.get("state"),this.state){const u=decodeURIComponent(this.state).split(W);this.state=u[0],u.length>1&&(this.url_state=u.slice(1).join(W))}this.error=u.get("error"),this.error_description=u.get("error_description"),this.error_uri=u.get("error_uri")}},_e=["nbf","jti","auth_time","nonce","acr","amr","azp","at_hash"],ye=["sub","iss","aud","exp","iat"],ve=class{constructor(u){this._settings=u,this._logger=new L("ClaimsService")}filterProtocolClaims(u){const l={...u};if(this._settings.filterProtocolClaims){let u;u=Array.isArray(this._settings.filterProtocolClaims)?this._settings.filterProtocolClaims:_e;for(const m of u)ye.includes(m)||delete l[m]}return l}mergeClaims(u,l){const m={...u};for(const[u,f]of Object.entries(l))if(m[u]!==f)if(Array.isArray(m[u])||Array.isArray(f))if("replace"==this._settings.mergeClaimsStrategy.array)m[u]=f;else{const l=Array.isArray(m[u])?m[u]:[m[u]];for(const u of Array.isArray(f)?f:[f])l.includes(u)||l.push(u);m[u]=l}else"object"==typeof m[u]&&"object"==typeof f?m[u]=this.mergeClaims(m[u],f):m[u]=f;return m}},we=class{constructor(u,l){this.keys=u,this.nonce=l}},be=class{constructor(u,l){this._logger=new L("OidcClient"),this.settings=u instanceof ie?u:new ie(u),this.metadataService=null!=l?l:new oe(this.settings),this._claimsService=new ve(this.settings),this._validator=new de(this.settings,this.metadataService,this._claimsService),this._tokenClient=new ce(this.settings,this.metadataService)}async createSigninRequest({state:u,request:l,request_uri:m,request_type:f,id_token_hint:h,login_hint:y,skipUserInfo:v,nonce:w,url_state:b,response_type:S=this.settings.response_type,scope:$=this.settings.scope,redirect_uri:x=this.settings.redirect_uri,prompt:j=this.settings.prompt,display:E=this.settings.display,max_age:R=this.settings.max_age,ui_locales:C=this.settings.ui_locales,acr_values:Z=this.settings.acr_values,resource:z=this.settings.resource,response_mode:A=this.settings.response_mode,extraQueryParams:O=this.settings.extraQueryParams,extraTokenParams:N=this.settings.extraTokenParams,dpopJkt:D,omitScopeWhenRequesting:M=this.settings.omitScopeWhenRequesting}){const U=this._logger.create("createSigninRequest");if("code"!==S)throw new Error("Only the Authorization Code flow (with PKCE) is supported");const L=await this.metadataService.getAuthorizationEndpoint();U.debug("Received authorization endpoint",L);const F=await me.create({url:L,authority:this.settings.authority,client_id:this.settings.client_id,redirect_uri:x,response_type:S,scope:$,state_data:u,url_state:b,prompt:j,display:E,max_age:R,ui_locales:C,id_token_hint:h,login_hint:y,acr_values:Z,dpopJkt:D,resource:z,request:l,request_uri:m,extraQueryParams:O,extraTokenParams:N,request_type:f,response_mode:A,client_secret:this.settings.client_secret,skipUserInfo:v,nonce:w,disablePKCE:this.settings.disablePKCE,omitScopeWhenRequesting:M});await this.clearStaleState();const V=F.state;return await this.settings.stateStore.set(V.id,V.toStorageString()),F}async readSigninResponseState(u,l=!1){const m=this._logger.create("readSigninResponseState"),f=new fe(G.readParams(u,this.settings.response_mode));if(!f.state)throw m.throw(new Error("No state in response")),null;const h=await this.settings.stateStore[l?"remove":"get"](f.state);if(!h)throw m.throw(new Error("No matching state found in storage")),null;return{state:await le.fromStorageString(h),response:f}}async processSigninResponse(u,l,m=!0){const f=this._logger.create("processSigninResponse"),{state:h,response:y}=await this.readSigninResponseState(u,m);if(f.debug("received state from storage; validating response"),this.settings.dpop&&this.settings.dpop.store){const u=await this.getDpopProof(this.settings.dpop.store);l={...l,DPoP:u}}try{await this._validator.validateSigninResponse(y,h,l)}catch(u){if(!(u instanceof ne&&this.settings.dpop))throw u;{const m=await this.getDpopProof(this.settings.dpop.store,u.nonce);l.DPoP=m,await this._validator.validateSigninResponse(y,h,l)}}return y}async getDpopProof(u,l){let m,f;return(await u.getAllKeys()).includes(this.settings.client_id)?(f=await u.get(this.settings.client_id),f.nonce!==l&&l&&(f.nonce=l,await u.set(this.settings.client_id,f))):(m=await K.generateDPoPKeys(),f=new we(m,l),await u.set(this.settings.client_id,f)),await K.generateDPoPProof({url:await this.metadataService.getTokenEndpoint(!1),httpMethod:"POST",keyPair:f.keys,nonce:f.nonce})}async processResourceOwnerPasswordCredentials({username:u,password:l,skipUserInfo:m=!1,extraTokenParams:f={}}){const h=await this._tokenClient.exchangeCredentials({username:u,password:l,...f}),y=new fe(new URLSearchParams);return Object.assign(y,h),await this._validator.validateCredentialsResponse(y,m),y}async useRefreshToken({state:u,redirect_uri:l,resource:m,timeoutInSeconds:f,extraHeaders:h,extraTokenParams:y}){var v;const w=this._logger.create("useRefreshToken");let b,S;if(void 0===this.settings.refreshTokenAllowedScope)b=u.scope;else{const l=this.settings.refreshTokenAllowedScope.split(" ");b=((null==(v=u.scope)?void 0:v.split(" "))||[]).filter(u=>l.includes(u)).join(" ")}if(this.settings.dpop&&this.settings.dpop.store){const u=await this.getDpopProof(this.settings.dpop.store);h={...h,DPoP:u}}try{S=await this._tokenClient.exchangeRefreshToken({refresh_token:u.refresh_token,scope:b,redirect_uri:l,resource:m,timeoutInSeconds:f,extraHeaders:h,...y})}catch(v){if(!(v instanceof ne&&this.settings.dpop))throw v;h.DPoP=await this.getDpopProof(this.settings.dpop.store,v.nonce),S=await this._tokenClient.exchangeRefreshToken({refresh_token:u.refresh_token,scope:b,redirect_uri:l,resource:m,timeoutInSeconds:f,extraHeaders:h,...y})}const $=new fe(new URLSearchParams);return Object.assign($,S),w.debug("validating response",$),await this._validator.validateRefreshResponse($,{...u,scope:b}),$}async createSignoutRequest({state:u,id_token_hint:l,client_id:m,request_type:f,url_state:h,post_logout_redirect_uri:y=this.settings.post_logout_redirect_uri,extraQueryParams:v=this.settings.extraQueryParams}={}){const w=this._logger.create("createSignoutRequest"),b=await this.metadataService.getEndSessionEndpoint();if(!b)throw w.throw(new Error("No end session endpoint")),null;w.debug("Received end session endpoint",b),m||!y||l||(m=this.settings.client_id);const S=new he({url:b,id_token_hint:l,client_id:m,post_logout_redirect_uri:y,state_data:u,extraQueryParams:v,request_type:f,url_state:h});await this.clearStaleState();const $=S.state;return $&&(w.debug("Signout request has state to persist"),await this.settings.stateStore.set($.id,$.toStorageString())),S}async readSignoutResponseState(u,l=!1){const m=this._logger.create("readSignoutResponseState"),f=new ge(G.readParams(u,this.settings.response_mode));if(!f.state){if(m.debug("No state in response"),f.error)throw m.warn("Response was error:",f.error),new Q(f);return{state:void 0,response:f}}const h=await this.settings.stateStore[l?"remove":"get"](f.state);if(!h)throw m.throw(new Error("No matching state found in storage")),null;return{state:await ue.fromStorageString(h),response:f}}async processSignoutResponse(u){const l=this._logger.create("processSignoutResponse"),{state:m,response:f}=await this.readSignoutResponseState(u,!0);return m?(l.debug("Received state from storage; validating response"),this._validator.validateSignoutResponse(f,m)):l.debug("No state from storage; skipping response validation"),f}clearStaleState(){return this._logger.create("clearStaleState"),ue.clearStaleState(this.settings.stateStore,this.settings.staleStateAgeInSeconds)}async revokeToken(u,l){return this._logger.create("revokeToken"),await this._tokenClient.revoke({token:u,token_type_hint:l})}},ke=class{constructor(u){this._userManager=u,this._logger=new L("SessionMonitor"),this._start=async u=>{const l=u.session_state;if(!l)return;const m=this._logger.create("_start");if(u.profile?(this._sub=u.profile.sub,m.debug("session_state",l,", sub",this._sub)):(this._sub=void 0,m.debug("session_state",l,", anonymous user")),this._checkSessionIFrame)this._checkSessionIFrame.start(l);else try{const u=await this._userManager.metadataService.getCheckSessionIframe();if(u){m.debug("initializing check session iframe");const f=this._userManager.settings.client_id,h=this._userManager.settings.checkSessionIntervalInSeconds,y=this._userManager.settings.stopCheckSessionOnError,v=new ee(this._callback,f,u,h,y);await v.load(),this._checkSessionIFrame=v,v.start(l)}else m.warn("no check session iframe found in the metadata")}catch(u){m.error("Error from getCheckSessionIframe:",u instanceof Error?u.message:u)}},this._stop=()=>{const u=this._logger.create("_stop");if(this._sub=void 0,this._checkSessionIFrame&&this._checkSessionIFrame.stop(),this._userManager.settings.monitorAnonymousSession){const l=setInterval(async()=>{clearInterval(l);try{const u=await this._userManager.querySessionStatus();if(u){const l={session_state:u.session_state,profile:u.sub?{sub:u.sub}:null};this._start(l)}}catch(l){u.error("error from querySessionStatus",l instanceof Error?l.message:l)}},1e3)}},this._callback=async()=>{const u=this._logger.create("_callback");try{const l=await this._userManager.querySessionStatus();let m=!0;l&&this._checkSessionIFrame?l.sub===this._sub?(m=!1,this._checkSessionIFrame.start(l.session_state),u.debug("same sub still logged in at OP, session state has changed, restarting check session iframe; session_state",l.session_state),await this._userManager.events._raiseUserSessionChanged()):u.debug("different subject signed into OP",l.sub):u.debug("subject no longer signed into OP"),m?this._sub?await this._userManager.events._raiseUserSignedOut():await this._userManager.events._raiseUserSignedIn():u.debug("no change in session detected, no event to raise")}catch(l){this._sub&&(u.debug("Error calling queryCurrentSigninSession; raising signed out event",l),await this._userManager.events._raiseUserSignedOut())}},u||this._logger.throw(new Error("No user manager passed")),this._userManager.events.addUserLoaded(this._start),this._userManager.events.addUserUnloaded(this._stop),this._init().catch(u=>{this._logger.error(u)})}async _init(){this._logger.create("_init");const u=await this._userManager.getUser();if(u)this._start(u);else if(this._userManager.settings.monitorAnonymousSession){const u=await this._userManager.querySessionStatus();if(u){const l={session_state:u.session_state,profile:u.sub?{sub:u.sub}:null};this._start(l)}}}},Se=class e{constructor(u){var l;this.id_token=u.id_token,this.session_state=null!=(l=u.session_state)?l:null,this.access_token=u.access_token,this.refresh_token=u.refresh_token,this.token_type=u.token_type,this.scope=u.scope,this.profile=u.profile,this.expires_at=u.expires_at,this.state=u.userState,this.url_state=u.url_state}get expires_in(){if(void 0!==this.expires_at)return this.expires_at-J.getEpochTime()}set expires_in(u){void 0!==u&&(this.expires_at=Math.floor(u)+J.getEpochTime())}get expired(){const u=this.expires_in;if(void 0!==u)return u<=0}get scopes(){var u,l;return null!=(l=null==(u=this.scope)?void 0:u.split(" "))?l:[]}toStorageString(){return new L("User").create("toStorageString"),JSON.stringify({id_token:this.id_token,session_state:this.session_state,access_token:this.access_token,refresh_token:this.refresh_token,token_type:this.token_type,scope:this.scope,profile:this.profile,expires_at:this.expires_at})}static fromStorageString(u){return L.createStatic("User","fromStorageString"),new e(JSON.parse(u))}},$e="oidc-client",xe=class{constructor(){this._abort=new H("Window navigation aborted"),this._disposeHandlers=new Set,this._window=null}async navigate(u){const l=this._logger.create("navigate");if(!this._window)throw new Error("Attempted to navigate on a disposed window");l.debug("setting URL in window"),this._window.location.replace(u.url);const{url:m,keepOpen:f}=await new Promise((m,f)=>{const r=h=>{var y;const v=h.data,w=null!=(y=u.scriptOrigin)?y:window.location.origin;if(h.origin===w&&(null==v?void 0:v.source)===$e){try{const m=G.readParams(v.url,u.response_mode).get("state");if(m||l.warn("no state found in response url"),h.source!==this._window&&m!==u.state)return}catch{this._dispose(),f(new Error("Invalid response from window"))}m(v)}};window.addEventListener("message",r,!1),this._disposeHandlers.add(()=>window.removeEventListener("message",r,!1));const h=new BroadcastChannel(`oidc-client-popup-${u.state}`);h.addEventListener("message",r,!1),this._disposeHandlers.add(()=>h.close()),this._disposeHandlers.add(this._abort.addHandler(u=>{this._dispose(),f(u)}))});return l.debug("got response from window"),this._dispose(),f||this.close(),{url:m}}_dispose(){this._logger.create("_dispose");for(const u of this._disposeHandlers)u();this._disposeHandlers.clear()}static _notifyParent(u,l,m=!1,f=window.location.origin){const h={source:$e,url:l,keepOpen:m},y=new L("_notifyParent");if(u)y.debug("With parent. Using parent.postMessage."),u.postMessage(h,f);else{y.debug("No parent. Using BroadcastChannel.");const u=new URL(l).searchParams.get("state");if(!u)throw new Error("No parent and no state in URL. Can't complete notification.");const m=new BroadcastChannel(`oidc-client-popup-${u}`);m.postMessage(h),m.close()}}},je={location:!1,toolbar:!1,height:640,closePopupWindowAfterInSeconds:-1},Te="_blank",Ee=60,Pe=2,Ie=class extends ie{constructor(u){const{popup_redirect_uri:l=u.redirect_uri,popup_post_logout_redirect_uri:m=u.post_logout_redirect_uri,popupWindowFeatures:f=je,popupWindowTarget:h=Te,redirectMethod:y="assign",redirectTarget:v="self",iframeNotifyParentOrigin:w=u.iframeNotifyParentOrigin,iframeScriptOrigin:b=u.iframeScriptOrigin,requestTimeoutInSeconds:S,silent_redirect_uri:$=u.redirect_uri,silentRequestTimeoutInSeconds:x,automaticSilentRenew:j=!0,validateSubOnSilentRenew:E=!0,includeIdTokenInSilentRenew:R=!1,monitorSession:C=!1,monitorAnonymousSession:Z=!1,checkSessionIntervalInSeconds:z=Pe,query_status_response_type:A="code",stopCheckSessionOnError:O=!0,revokeTokenTypes:N=["access_token","refresh_token"],revokeTokensOnSignout:D=!1,includeIdTokenInSilentSignout:M=!1,accessTokenExpiringNotificationTimeInSeconds:U=Ee,userStore:L}=u;if(super(u),this.popup_redirect_uri=l,this.popup_post_logout_redirect_uri=m,this.popupWindowFeatures=f,this.popupWindowTarget=h,this.redirectMethod=y,this.redirectTarget=v,this.iframeNotifyParentOrigin=w,this.iframeScriptOrigin=b,this.silent_redirect_uri=$,this.silentRequestTimeoutInSeconds=x||S||10,this.automaticSilentRenew=j,this.validateSubOnSilentRenew=E,this.includeIdTokenInSilentRenew=R,this.monitorSession=C,this.monitorAnonymousSession=Z,this.checkSessionIntervalInSeconds=z,this.stopCheckSessionOnError=O,this.query_status_response_type=A,this.revokeTokenTypes=N,this.revokeTokensOnSignout=D,this.includeIdTokenInSilentSignout=M,this.accessTokenExpiringNotificationTimeInSeconds=U,L)this.userStore=L;else{const u="undefined"!=typeof window?window.sessionStorage:new te;this.userStore=new se({store:u})}}},Re=class e extends xe{constructor({silentRequestTimeoutInSeconds:u=10}){super(),this._logger=new L("IFrameWindow"),this._timeoutInSeconds=u,this._frame=e.createHiddenIframe(),this._window=this._frame.contentWindow}static createHiddenIframe(){const u=window.document.createElement("iframe");return u.style.visibility="hidden",u.style.position="fixed",u.style.left="-1000px",u.style.top="0",u.width="0",u.height="0",window.document.body.appendChild(u),u}async navigate(u){this._logger.debug("navigate: Using timeout of:",this._timeoutInSeconds);const l=setTimeout(()=>{this._abort.raise(new Y("IFrame timed out without a response"))},1e3*this._timeoutInSeconds);return this._disposeHandlers.add(()=>clearTimeout(l)),await super.navigate(u)}close(){var u;this._frame&&(this._frame.parentNode&&(this._frame.addEventListener("load",u=>{var l;const m=u.target;null==(l=m.parentNode)||l.removeChild(m),this._abort.raise(new Error("IFrame removed from DOM"))},!0),null==(u=this._frame.contentWindow)||u.location.replace("about:blank")),this._frame=null),this._window=null}static notifyParent(u,l){return super._notifyParent(window.parent,u,!1,l)}},Ce=class{constructor(u){this._settings=u,this._logger=new L("IFrameNavigator")}async prepare({silentRequestTimeoutInSeconds:u=this._settings.silentRequestTimeoutInSeconds}){return new Re({silentRequestTimeoutInSeconds:u})}async callback(u){this._logger.create("callback"),Re.notifyParent(u,this._settings.iframeNotifyParentOrigin)}},Ze=class extends xe{constructor({popupWindowTarget:u=Te,popupWindowFeatures:l={},popupSignal:m,popupAbortOnClose:f}){super(),this._logger=new L("PopupWindow");const h=B.center({...je,...l});this._window=window.open(void 0,u,B.serialize(h)),this.abortOnClose=Boolean(f),m&&m.addEventListener("abort",()=>{var u;this._abort.raise(new Error(null!=(u=m.reason)?u:"Popup aborted"))}),l.closePopupWindowAfterInSeconds&&l.closePopupWindowAfterInSeconds>0&&setTimeout(()=>{this._window&&"boolean"==typeof this._window.closed&&!this._window.closed?this.close():this._abort.raise(new Error("Popup blocked by user"))},1e3*l.closePopupWindowAfterInSeconds)}async navigate(u){var l;null==(l=this._window)||l.focus();const m=setInterval(()=>{this._window&&!this._window.closed||(this._logger.debug("Popup closed by user or isolated by redirect"),s(),this._disposeHandlers.delete(s),this.abortOnClose&&this._abort.raise(new Error("Popup closed by user")))},500),s=()=>clearInterval(m);return this._disposeHandlers.add(s),await super.navigate(u)}close(){this._window&&(this._window.closed||(this._window.close(),this._abort.raise(new Error("Popup closed")))),this._window=null}static notifyOpener(u,l){super._notifyParent(window.opener,u,l),l||window.opener||window.close()}},ze=class{constructor(u){this._settings=u,this._logger=new L("PopupNavigator")}async prepare({popupWindowFeatures:u=this._settings.popupWindowFeatures,popupWindowTarget:l=this._settings.popupWindowTarget,popupSignal:m,popupAbortOnClose:f}){return new Ze({popupWindowFeatures:u,popupWindowTarget:l,popupSignal:m,popupAbortOnClose:f})}async callback(u,{keepOpen:l=!1}){this._logger.create("callback"),Ze.notifyOpener(u,l)}},Ae=class{constructor(u){this._settings=u,this._logger=new L("RedirectNavigator")}async prepare({redirectMethod:u=this._settings.redirectMethod,redirectTarget:l=this._settings.redirectTarget}){var m;this._logger.create("prepare");let f=window.self;"top"===l&&(f=null!=(m=window.top)?m:window.self);const h=f.location[u].bind(f.location);let y;return{navigate:async u=>{this._logger.create("navigate");const l=new Promise((l,m)=>{y=m,window.addEventListener("pageshow",()=>l(window.location.href)),h(u.url)});return await l},close:()=>{this._logger.create("close"),null==y||y(new Error("Redirect aborted")),f.stop()}}}async callback(){}},Oe=class extends X{constructor(u){super({expiringNotificationTimeInSeconds:u.accessTokenExpiringNotificationTimeInSeconds}),this._logger=new L("UserManagerEvents"),this._userLoaded=new H("User loaded"),this._userUnloaded=new H("User unloaded"),this._silentRenewError=new H("Silent renew error"),this._userSignedIn=new H("User signed in"),this._userSignedOut=new H("User signed out"),this._userSessionChanged=new H("User session changed")}async load(u,l=!0){await super.load(u),l&&await this._userLoaded.raise(u)}async unload(){await super.unload(),await this._userUnloaded.raise()}addUserLoaded(u){return this._userLoaded.addHandler(u)}removeUserLoaded(u){return this._userLoaded.removeHandler(u)}addUserUnloaded(u){return this._userUnloaded.addHandler(u)}removeUserUnloaded(u){return this._userUnloaded.removeHandler(u)}addSilentRenewError(u){return this._silentRenewError.addHandler(u)}removeSilentRenewError(u){return this._silentRenewError.removeHandler(u)}async _raiseSilentRenewError(u){await this._silentRenewError.raise(u)}addUserSignedIn(u){return this._userSignedIn.addHandler(u)}removeUserSignedIn(u){this._userSignedIn.removeHandler(u)}async _raiseUserSignedIn(){await this._userSignedIn.raise()}addUserSignedOut(u){return this._userSignedOut.addHandler(u)}removeUserSignedOut(u){this._userSignedOut.removeHandler(u)}async _raiseUserSignedOut(){await this._userSignedOut.raise()}addUserSessionChanged(u){return this._userSessionChanged.addHandler(u)}removeUserSessionChanged(u){this._userSessionChanged.removeHandler(u)}async _raiseUserSessionChanged(){await this._userSessionChanged.raise()}},Ne=class{constructor(u){this._userManager=u,this._logger=new L("SilentRenewService"),this._isStarted=!1,this._retryTimer=new J("Retry Silent Renew"),this._tokenExpiring=async()=>{const u=this._logger.create("_tokenExpiring");try{await this._userManager.signinSilent(),u.debug("silent token renewal successful")}catch(l){if(l instanceof Y)return u.warn("ErrorTimeout from signinSilent:",l,"retry in 5s"),void this._retryTimer.init(5);u.error("Error from signinSilent:",l),await this._userManager.events._raiseSilentRenewError(l)}}}async start(){const u=this._logger.create("start");if(!this._isStarted){this._isStarted=!0,this._userManager.events.addAccessTokenExpiring(this._tokenExpiring),this._retryTimer.addHandler(this._tokenExpiring);try{await this._userManager.getUser()}catch(l){u.error("getUser error",l)}}}stop(){this._isStarted&&(this._retryTimer.cancel(),this._retryTimer.removeHandler(this._tokenExpiring),this._userManager.events.removeAccessTokenExpiring(this._tokenExpiring),this._isStarted=!1)}},De=class{constructor(u){this.refresh_token=u.refresh_token,this.id_token=u.id_token,this.session_state=u.session_state,this.scope=u.scope,this.profile=u.profile,this.data=u.state}},Me=class{constructor(u,l,m,f){this._logger=new L("UserManager"),this.settings=new Ie(u),this._client=new be(u),this._redirectNavigator=null!=l?l:new Ae(this.settings),this._popupNavigator=null!=m?m:new ze(this.settings),this._iframeNavigator=null!=f?f:new Ce(this.settings),this._events=new Oe(this.settings),this._silentRenewService=new Ne(this),this.settings.automaticSilentRenew&&this.startSilentRenew(),this._sessionMonitor=null,this.settings.monitorSession&&(this._sessionMonitor=new ke(this))}get events(){return this._events}get metadataService(){return this._client.metadataService}async getUser(u=!1){const l=this._logger.create("getUser"),m=await this._loadUser();return m?(l.info("user loaded"),await this._events.load(m,u),m):(l.info("user not found in storage"),null)}async removeUser(){const u=this._logger.create("removeUser");await this.storeUser(null),u.info("user removed from storage"),await this._events.unload()}async signinRedirect(u={}){var l;this._logger.create("signinRedirect");const{redirectMethod:m,...f}=u;let h;(null==(l=this.settings.dpop)?void 0:l.bind_authorization_code)&&(h=await this.generateDPoPJkt(this.settings.dpop));const y=await this._redirectNavigator.prepare({redirectMethod:m});await this._signinStart({request_type:"si:r",dpopJkt:h,...f},y)}async signinRedirectCallback(u=window.location.href){const l=this._logger.create("signinRedirectCallback"),m=await this._signinEnd(u);return m.profile&&m.profile.sub?l.info("success, signed in subject",m.profile.sub):l.info("no subject"),m}async signinResourceOwnerCredentials({username:u,password:l,skipUserInfo:m=!1}){const f=this._logger.create("signinResourceOwnerCredential"),h=await this._client.processResourceOwnerPasswordCredentials({username:u,password:l,skipUserInfo:m,extraTokenParams:this.settings.extraTokenParams});f.debug("got signin response");const y=await this._buildUser(h);return y.profile&&y.profile.sub?f.info("success, signed in subject",y.profile.sub):f.info("no subject"),y}async signinPopup(u={}){var l;const m=this._logger.create("signinPopup");let f;(null==(l=this.settings.dpop)?void 0:l.bind_authorization_code)&&(f=await this.generateDPoPJkt(this.settings.dpop));const{popupWindowFeatures:h,popupWindowTarget:y,popupSignal:v,popupAbortOnClose:w,...b}=u,S=this.settings.popup_redirect_uri;S||m.throw(new Error("No popup_redirect_uri configured"));const $=await this._popupNavigator.prepare({popupWindowFeatures:h,popupWindowTarget:y,popupSignal:v,popupAbortOnClose:w}),x=await this._signin({request_type:"si:p",redirect_uri:S,display:"popup",dpopJkt:f,...b},$);return x&&(x.profile&&x.profile.sub?m.info("success, signed in subject",x.profile.sub):m.info("no subject")),x}async signinPopupCallback(u=window.location.href,l=!1){const m=this._logger.create("signinPopupCallback");await this._popupNavigator.callback(u,{keepOpen:l}),m.info("success")}async signinSilent(u={}){var l,m;const f=this._logger.create("signinSilent"),{silentRequestTimeoutInSeconds:h,...y}=u;let v,w=await this._loadUser();if(!u.forceIframeAuth&&(null==w?void 0:w.refresh_token)){f.debug("using refresh token");const u=new De(w);return await this._useRefreshToken({state:u,redirect_uri:y.redirect_uri,resource:y.resource,extraTokenParams:y.extraTokenParams,timeoutInSeconds:h})}(null==(l=this.settings.dpop)?void 0:l.bind_authorization_code)&&(v=await this.generateDPoPJkt(this.settings.dpop));const b=this.settings.silent_redirect_uri;let S;b||f.throw(new Error("No silent_redirect_uri configured")),w&&this.settings.validateSubOnSilentRenew&&(f.debug("subject prior to silent renew:",w.profile.sub),S=w.profile.sub);const $=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:h});return w=await this._signin({request_type:"si:s",redirect_uri:b,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?null==w?void 0:w.id_token:void 0,dpopJkt:v,...y},$,S),w&&((null==(m=w.profile)?void 0:m.sub)?f.info("success, signed in subject",w.profile.sub):f.info("no subject")),w}async _useRefreshToken(u){const l=await this._client.useRefreshToken({timeoutInSeconds:this.settings.silentRequestTimeoutInSeconds,...u}),m=new Se({...u.state,...l});return await this.storeUser(m),await this._events.load(m),m}async signinSilentCallback(u=window.location.href){const l=this._logger.create("signinSilentCallback");await this._iframeNavigator.callback(u),l.info("success")}async signinCallback(u=window.location.href){const{state:l}=await this._client.readSigninResponseState(u);switch(l.request_type){case"si:r":return await this.signinRedirectCallback(u);case"si:p":await this.signinPopupCallback(u);break;case"si:s":await this.signinSilentCallback(u);break;default:throw new Error("invalid response_type in state")}}async signoutCallback(u=window.location.href,l=!1){const{state:m}=await this._client.readSignoutResponseState(u);if(m)switch(m.request_type){case"so:r":return await this.signoutRedirectCallback(u);case"so:p":await this.signoutPopupCallback(u,l);break;case"so:s":await this.signoutSilentCallback(u);break;default:throw new Error("invalid response_type in state")}}async querySessionStatus(u={}){const l=this._logger.create("querySessionStatus"),{silentRequestTimeoutInSeconds:m,...f}=u,h=this.settings.silent_redirect_uri;h||l.throw(new Error("No silent_redirect_uri configured"));const y=await this._loadUser(),v=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:m}),w=await this._signinStart({request_type:"si:s",redirect_uri:h,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?null==y?void 0:y.id_token:void 0,response_type:this.settings.query_status_response_type,scope:"openid",skipUserInfo:!0,...f},v);try{const u={},m=await this._client.processSigninResponse(w.url,u);return l.debug("got signin response"),m.session_state&&m.profile.sub?(l.info("success for subject",m.profile.sub),{session_state:m.session_state,sub:m.profile.sub}):(l.info("success, user not authenticated"),null)}catch(u){if(this.settings.monitorAnonymousSession&&u instanceof Q)switch(u.error){case"login_required":case"consent_required":case"interaction_required":case"account_selection_required":return l.info("success for anonymous user"),{session_state:u.session_state}}throw u}}async _signin(u,l,m){const f=await this._signinStart(u,l);return await this._signinEnd(f.url,m)}async _signinStart(u,l){const m=this._logger.create("_signinStart");try{const f=await this._client.createSigninRequest(u);return m.debug("got signin request"),await l.navigate({url:f.url,state:f.state.id,response_mode:f.state.response_mode,scriptOrigin:this.settings.iframeScriptOrigin})}catch(u){throw m.debug("error after preparing navigator, closing navigator window"),l.close(),u}}async _signinEnd(u,l){const m=this._logger.create("_signinEnd"),f=await this._client.processSigninResponse(u,{});return m.debug("got signin response"),await this._buildUser(f,l)}async _buildUser(u,l){const m=this._logger.create("_buildUser"),f=new Se(u);if(l){if(l!==f.profile.sub)throw m.debug("current user does not match user returned from signin. sub from signin:",f.profile.sub),new Q({...u,error:"login_required"});m.debug("current user matches user returned from signin")}return await this.storeUser(f),m.debug("user stored"),await this._events.load(f),f}async signoutRedirect(u={}){const l=this._logger.create("signoutRedirect"),{redirectMethod:m,...f}=u,h=await this._redirectNavigator.prepare({redirectMethod:m});await this._signoutStart({request_type:"so:r",post_logout_redirect_uri:this.settings.post_logout_redirect_uri,...f},h),l.info("success")}async signoutRedirectCallback(u=window.location.href){const l=this._logger.create("signoutRedirectCallback"),m=await this._signoutEnd(u);return l.info("success"),m}async signoutPopup(u={}){const l=this._logger.create("signoutPopup"),{popupWindowFeatures:m,popupWindowTarget:f,popupSignal:h,...y}=u,v=this.settings.popup_post_logout_redirect_uri,w=await this._popupNavigator.prepare({popupWindowFeatures:m,popupWindowTarget:f,popupSignal:h});await this._signout({request_type:"so:p",post_logout_redirect_uri:v,state:null==v?void 0:{},...y},w),l.info("success")}async signoutPopupCallback(u=window.location.href,l=!1){const m=this._logger.create("signoutPopupCallback");await this._popupNavigator.callback(u,{keepOpen:l}),m.info("success")}async _signout(u,l){const m=await this._signoutStart(u,l);return await this._signoutEnd(m.url)}async _signoutStart(u={},l){var m;const f=this._logger.create("_signoutStart");try{const h=await this._loadUser();f.debug("loaded current user from storage"),this.settings.revokeTokensOnSignout&&await this._revokeInternal(h);const y=u.id_token_hint||h&&h.id_token;y&&(f.debug("setting id_token_hint in signout request"),u.id_token_hint=y),await this.removeUser(),f.debug("user removed, creating signout request");const v=await this._client.createSignoutRequest(u);return f.debug("got signout request"),await l.navigate({url:v.url,state:null==(m=v.state)?void 0:m.id,scriptOrigin:this.settings.iframeScriptOrigin})}catch(u){throw f.debug("error after preparing navigator, closing navigator window"),l.close(),u}}async _signoutEnd(u){const l=this._logger.create("_signoutEnd"),m=await this._client.processSignoutResponse(u);return l.debug("got signout response"),m}async signoutSilent(u={}){var l;const m=this._logger.create("signoutSilent"),{silentRequestTimeoutInSeconds:f,...h}=u,y=this.settings.includeIdTokenInSilentSignout?null==(l=await this._loadUser())?void 0:l.id_token:void 0,v=this.settings.popup_post_logout_redirect_uri,w=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:f});await this._signout({request_type:"so:s",post_logout_redirect_uri:v,id_token_hint:y,...h},w),m.info("success")}async signoutSilentCallback(u=window.location.href){const l=this._logger.create("signoutSilentCallback");await this._iframeNavigator.callback(u),l.info("success")}async revokeTokens(u){const l=await this._loadUser();await this._revokeInternal(l,u)}async _revokeInternal(u,l=this.settings.revokeTokenTypes){const m=this._logger.create("_revokeInternal");if(!u)return;const f=l.filter(l=>"string"==typeof u[l]);if(f.length){for(const l of f)await this._client.revokeToken(u[l],l),m.info(`${l} revoked successfully`),"access_token"!==l&&(u[l]=null);await this.storeUser(u),m.debug("user stored"),await this._events.load(u)}else m.debug("no need to revoke due to no token(s)")}startSilentRenew(){this._logger.create("startSilentRenew"),this._silentRenewService.start()}stopSilentRenew(){this._silentRenewService.stop()}get _userStoreKey(){return`user:${this.settings.authority}:${this.settings.client_id}`}async _loadUser(){const u=this._logger.create("_loadUser"),l=await this.settings.userStore.get(this._userStoreKey);return l?(u.debug("user storageString loaded"),Se.fromStorageString(l)):(u.debug("no user storageString"),null)}async storeUser(u){const l=this._logger.create("storeUser");if(u){l.debug("storing user");const m=u.toStorageString();await this.settings.userStore.set(this._userStoreKey,m)}else this._logger.debug("removing user"),await this.settings.userStore.remove(this._userStoreKey),this.settings.dpop&&await this.settings.dpop.store.remove(this.settings.client_id)}async clearStaleState(){await this._client.clearStaleState()}async dpopProof(u,l,m,f){var h,y;const v=await(null==(y=null==(h=this.settings.dpop)?void 0:h.store)?void 0:y.get(this.settings.client_id));if(v)return await K.generateDPoPProof({url:u,accessToken:null==l?void 0:l.access_token,httpMethod:m,keyPair:v.keys,nonce:f})}async generateDPoPJkt(u){let l=await u.store.get(this.settings.client_id);if(!l){const m=await K.generateDPoPKeys();l=new we(m),await u.store.set(this.settings.client_id,l)}return await K.generateDPoPJkt(l.keys)}};const Ue="OAUTH2_LOGIN_FLOW_COMPLETE_EVENT",Le="OAUTH_GET_TOP_URL",qe="OAUTH_REDIRECT_TOP_WINDOW",He="OAUTH_UPDATE_URL",Be="OAUTH2_CHECK_PENDING",Ge="oauth2_top_origin",We="oauth2_login_success",Qe="oauth2_state",Xe=60,tt=Math.max(Xe-15,20),ot=d("oidc-auth",{color:"green"}),Fe=u=>ot.extend(u);d("oidc-auth-utils");const Ke=()=>"undefined"==typeof window?"":new URLSearchParams(window.location.search).get("origin")||"";class Je{static instance=null;settings=null;constructor(){}static getInstance(){return Je.instance||(Je.instance=new Je),Je.instance}configure(u){this.settings=u}isConfigured(){return null!==this.settings}getSettings(){if(!this.settings)throw new Error("OidcAuthConfig not configured. Call configure() or pass settings to OidcAuthClient.initialize().");return this.settings}getAuthOrigin(){const{authOrigin:u,authEndpoint:l}=this.getSettings();return u||new URL(l).origin}isAccessTokenProactiveRefreshEnabled(){return this.settings?.accessTokenProactiveRefreshEnabled??!0}getOidcSettings(){const u="undefined"==typeof window?"":window.location.origin,{clientId:l,authEndpoint:m}=this.getSettings(),f=this.getAuthOrigin(),h="undefined"!=typeof window?new se({store:window.localStorage}):void 0,{accessTokenExpiringNotificationTimeInSeconds:y=Xe}=this.getSettings();return{client_id:l,authority:f,redirect_uri:`${u}/login/oauth-callback`,post_logout_redirect_uri:u,response_type:"code",scope:"openid offline_access",automaticSilentRenew:!1,accessTokenExpiringNotificationTimeInSeconds:y,stateStore:h,userStore:h,metadata:{issuer:f,authorization_endpoint:m,token_endpoint:`${f}/connect/api/v1/oauth2/token`,end_session_endpoint:`${f}/logout/`}}}getAccessTokenExpiringNotificationTimeInSeconds(){return this.getSettings().accessTokenExpiringNotificationTimeInSeconds??Xe}getAccessTokenFreshnessThresholdInSeconds(){return this.getSettings().accessTokenFreshnessThresholdInSeconds??tt}getAllowedParentOrigins(){return this.settings?.allowedParentOrigins}}const it=Je.getInstance(),at=Fe("oidc-auth:host-api"),Ve=async u=>new Promise((l,m)=>{const f=new MessageChannel;let h=!1;const n=()=>{h=!0,f.port1.close()},y=setTimeout(()=>{h||(n(),m(new Error(`Host message timeout: ${u.type}`)))},1e4);f.port1.onmessage=u=>{clearTimeout(y),n(),"success"!==u.data.status?m(u.data.payload):l(u.data.payload)};const v=new URLSearchParams(window.location.search).get("origin")||"";if(!function(u){if(!u.startsWith("http://")&&!u.startsWith("https://"))return!1;const l=it.getAllowedParentOrigins();return!l||0===l.length||l.includes(u)}(v))return clearTimeout(y),n(),void m(new Error("Origin not allowed"));at.log("posting message to host",u),window.top.postMessage({type:u.type,payload:u.payload,...u.data||{}},v,[f.port2])}),pt=Fe("oidc-auth:OidcAuthTimer");class Ye{timerHandle=null;expiration=null;initialized=!1;callback=()=>{};constructor(){this.timerHandle=null}init(u,l,m){const f=u-this.getEpochTime(),h=Math.max(f-l,10);this.cancel(),this.expiration=h,this.callback=m,pt.debug("OIDC: timer - using expiration",h,f,l,u,f-l),this.timerHandle=setTimeout(this.callback,1e3*h),this.initialized=!0}cancel(){this.timerHandle&&(clearTimeout(this.timerHandle),this.timerHandle=null),this.expiration=null}getEpochTime(){return Math.floor(Date.now()/1e3)}isInitialized(){return this.initialized}}const yt=Fe("oidc-auth:OidcAuthClient");class et{static instance=null;userManager=null;initialized=!1;accessTokenExpiringTimer=null;retryTimers=new Set;constructor(){}static getInstance(){return et.instance||(et.instance=new et),et.instance}isInitialized(){return this.initialized}ensureInitialized(){if(!this.userManager)throw new Error("OidcAuthClient not initialized. Call initialize() first.");return this.userManager}initialize(u){if(u&&(this.initialized=!1,it.configure(u)),this.initialized)yt.info("OIDC: initialize() - already initialized, skipping");else if("undefined"!=typeof window)if(it.isConfigured())try{yt.info("OIDC: initialize() - starting initialization");const u=it.getOidcSettings();this.userManager=new Me(u),U.setLogger(yt),U.setLevel(U.ERROR),this.initAccessTokenExpiringTimer(),this.initialized=!0}catch(u){throw yt.error("OIDC: initialize() - FAILED:",u),u}else yt.warn("OIDC: initialize() - skipped, config not set");else yt.warn("OidcAuthClient cannot initialize on server side")}async initAccessTokenExpiringTimer(){it.isAccessTokenProactiveRefreshEnabled()?this.getUser().then(u=>{const l=u?.expires_at;l&&(this.accessTokenExpiringTimer||(this.accessTokenExpiringTimer=new Ye),this.accessTokenExpiringTimer.init(l,it.getAccessTokenExpiringNotificationTimeInSeconds(),async()=>{yt.info("OIDC: timer proactive refresh access token expiring timer fired",l),this.proactiveRefreshWithRetry()}))}).catch(u=>{yt.error("OIDC: initAccessTokenExpiringTimer - FAILED:",u)}):yt.warn("OIDC: timer - not starting, access token proactive refresh is disabled")}async getUser(){if(!this.userManager)return null;try{return await this.userManager.getUser()}catch(u){return yt.error("OIDC: getUser - FAILED:",u),null}}async storeUser(u){const l=this.ensureInitialized();await l.storeUser(u)}async getAccessToken(){const u=await this.getUser();if(!u)return yt.info("OIDC: getAccessToken - no user found"),null;if(u.expired)try{const u=await this.signinSilent();return u?.access_token||null}catch(u){return yt.error("OIDC: getAccessToken - silent renew failed:",u),null}return this.isTokenFresh(u)||this.signinSilent().catch(u=>{yt.error("OIDC: getAccessToken - background refresh failed:",u)}),u.access_token}getUserData(){if("undefined"==typeof window)return null;try{const u=it.getOidcSettings(),l=`oidc.user:${u.authority}:${u.client_id}`,m=localStorage.getItem(l);if(!m)return null;const f=JSON.parse(m),h=f?.profile;return h?.sub?(yt.info("OIDC: USER:",{profile:h}),{id:h.sub,email:h.email||"",first_name:h.given_name,last_name:h.family_name}):null}catch(u){return yt.error("OIDC: getUserData - FAILED:",u),null}}async isAuthenticated(){const u=await this.getUser();return null!==u&&!u.expired}async signinRedirect(u){const l=this.ensureInitialized();await l.signinRedirect({state:u?{data:u}:void 0,prompt:"login"})}async signinCallback(){const u=this.ensureInitialized(),l=await u.signinCallback();if(!l)throw yt.error("OIDC: signinCallback - FAILED: no user returned"),new Error("Signin callback failed: no user returned");return l}async signinSilent(u){return this.ensureInitialized(),"undefined"!=typeof navigator&&navigator.locks?navigator.locks.request("oidc-token-refresh",async()=>{const l=await this.getUser();return l&&this.isTokenFresh(l,u)?l:this.doSigninSilent()}):(yt.warn("OIDC: signinSilent - navigator.locks not available, proceeding without lock"),this.doSigninSilent())}isTokenFresh(u,l){if(!u.expires_at)return!1;const m=l??it.getAccessTokenFreshnessThresholdInSeconds(),f=Math.floor(Date.now()/1e3);return u.expires_at-f>m}async doSigninSilent(){const u=this.ensureInitialized();try{return await u.signinSilent()}catch(u){throw yt.error("OIDC: doSigninSilent - FAILED:",u),u}}proactiveRefreshWithRetry(u=1){if("undefined"!=typeof document&&"hidden"===document.visibilityState){yt.info("OIDC: tab is hidden, deferring proactive refresh until visible");const t=()=>{"visible"===document.visibilityState&&(document.removeEventListener("visibilitychange",t),this.proactiveRefreshWithRetry(u))};return void document.addEventListener("visibilitychange",t)}this.signinSilent(it.getAccessTokenExpiringNotificationTimeInSeconds()).then(()=>{this.initAccessTokenExpiringTimer()}).catch(l=>{if(yt.error(`OIDC: proactive refresh failed (attempt ${u}/2):`,l),u<2){const l=setTimeout(()=>{this.retryTimers.delete(l),this.proactiveRefreshWithRetry(u+1)},3e3);this.retryTimers.add(l)}else yt.error("OIDC: proactive refresh exhausted all retries")})}async removeUser(){const u=this.ensureInitialized();this.accessTokenExpiringTimer?.cancel(),this.retryTimers.forEach(clearTimeout),this.retryTimers.clear(),await u.removeUser()}onUserLoaded(u){this.ensureInitialized().events.addUserLoaded(u)}offUserLoaded(u){this.ensureInitialized().events.removeUserLoaded(u)}onUserUnloaded(u){this.ensureInitialized().events.addUserUnloaded(u)}offUserUnloaded(u){this.ensureInitialized().events.removeUserUnloaded(u)}onSilentRenewError(u){this.ensureInitialized().events.addSilentRenewError(u)}offSilentRenewError(u){this.ensureInitialized().events.removeSilentRenewError(u)}onAccessTokenExpiring(u){this.ensureInitialized().events.addAccessTokenExpiring(u)}offAccessTokenExpiring(u){this.ensureInitialized().events.removeAccessTokenExpiring(u)}onAccessTokenExpired(u){this.ensureInitialized().events.addAccessTokenExpired(u)}offAccessTokenExpired(u){this.ensureInitialized().events.removeAccessTokenExpired(u)}getLogoutUrl(u,l){const m=new URL(function(u){return`${it.getAuthOrigin()}${u.logoutPath}`}(u));return l&&m.searchParams.set("redirect_to",l),m.toString()}getWindowOriginParam(){const u=new URL(window.location.href).searchParams.get("origin");if(!u)throw new Error("iframe origin param is required");return u}async getTopUrl(){return(await Ve({type:Le})).topUrl}async isOAuthFlowPending(){try{return(await Ve({type:Be})).isPending}catch(u){return yt.warn("OIDC: isOAuthFlowPending() - failed to check, assuming not pending:",u),!1}}async triggerLoginFlowViaParent({loginPath:u,windowPath:l}){yt.info("OIDC: triggerLoginFlowViaParent() - starting");const m=await this.getTopUrl(),f=new URL(m).origin,h=`${f}${l}`,y=new URL(`${window.location.origin}${u}`);y.searchParams.set(Ge,f),y.searchParams.set("oauth2_top_wp_url",h),yt.info("OIDC: triggerLoginFlowViaParent() - redirecting parent to:",y.toString()),await Ve({type:qe,payload:{url:y.toString()}})}async handleLoginFlowComplete(u,l){if(!l)throw new Error("oauthUserState is required");const m=this.getWindowOriginParam(),f=l.state,h=f?.data?.[Ge];if(m!==h)throw yt.error("OIDC: handleLoginFlowComplete - origin mismatch:",m,"!==",h),new Error("Invalid origin in OAuth state");try{const u=new Se(l);await this.storeUser(u),this.initAccessTokenExpiringTimer(),window.dispatchEvent(new CustomEvent("oidc-auth-completed"))}catch(l){yt.error("OIDC: handleLoginFlowComplete - FAILED to store user:",l),await this.triggerLoginFlowViaParent(u)}}async triggerLogoutViaParent(u,l=!0){const m=await this.getTopUrl(),f=new URL(m).origin,h=l?`${f}${u.windowPath}`:f;await this.removeUser();const y=this.getLogoutUrl(u,h);await Ve({type:qe,payload:{url:y}})}async cleanOAuthParamsFromUrl(){try{const u=await this.getTopUrl(),l=new URL(u);l.searchParams.delete("oauth_code"),l.searchParams.delete("oauth_state"),l.searchParams.delete("start-oauth"),l.searchParams.delete(We),l.searchParams.delete(Qe),await Ve({type:He,payload:{url:l.toString()}})}catch(u){yt.warn("Failed to clean OAuth params from URL:",u)}}setupLoginFlowMessageListener(u){let l=!1;const i=m=>{if(m.data?.type!==Ue)return;if(m.origin!==Ke())return void yt.error("OIDC: origin mismatch - expected:",Ke(),"received:",m.origin);if(l)return void yt.debug("OIDC: LOGIN_FLOW_COMPLETE already processed, ignoring duplicate");const f=m.data.payload;f?.oauthState?(l=!0,this.handleLoginFlowComplete(u,f.oauthState).catch(u=>{yt.error("OIDC: Failed to handle login flow complete:",u),l=!1})):yt.warn("OIDC: LOGIN_FLOW_COMPLETE but no oauthState in payload")};return window.addEventListener("message",i),()=>{window.removeEventListener("message",i)}}async getTokenExpirationInfo(){const u=await this.getUser();if(!u||!u.expires_at)return{expiresAt:null,expiresInSeconds:null,isExpired:!0};const l=new Date(1e3*u.expires_at),m=Date.now(),f=Math.floor((1e3*u.expires_at-m)/1e3);return{expiresAt:l,expiresInSeconds:f,isExpired:f<=0}}async forceTokenRefresh(){return yt.info("OIDC: forceTokenRefresh() - manually triggering token refresh"),this.signinSilent()}}const vt=et.getInstance();"undefined"!=typeof window&&(window.oidcAuthClient=vt);const bt=Fe("oidc-auth:oidc-auth-redirect");function st(u,l){u.postMessage({status:"success",payload:l})}function rt(u,l){u.postMessage({status:"error",payload:l})}function nt({targets:u,onSuccess:l,attempt:m=1}){const f=new URLSearchParams(window.location.search);if(!f.get(We))return void bt.warn("OIDC: No login_success param found, skipping");const h=f.get(Qe);if(h){if(!u.window?.contentWindow||!u.windowURL)return bt.warn("Cannot forward OIDC state: iframe not available"),void(m<5?setTimeout(()=>{nt({targets:u,onSuccess:l,attempt:m+1})},500):bt.error("OIDC: Failed to forward login flow after",5,"attempts - iframe never became available"));try{const m=JSON.parse(h),f=m.state?.data?.[Ge];if(f&&f!==window.location.origin)return void bt.error("Origin mismatch in OIDC state:",f,"vs",window.location.origin);!function(u,l){const m=l.window?.contentWindow,f=l.windowURL?.origin;m&&f?m.postMessage({type:Ue,payload:u},f):bt.warn("Cannot send OIDC state: window or origin not available")}({oauthState:m},u);const y=new URL(window.location.href);y.searchParams.delete(We),y.searchParams.delete(Qe),history.replaceState({},"",y.toString()),l?.()}catch(u){bt.error("Failed to parse or forward OIDC state:",u)}}else bt.warn("OIDC login complete but no state found in URL")}const kt="angie_return_url",St=g("referrer-redirect");function ct(u){try{return new URL(u,window.location.origin).origin===window.location.origin}catch{return!1}}function dt(u,l){if(!ct(u))return St.warn("Invalid redirect URL rejected:",u),!1;try{const m={url:u};return l&&(m.prompt=l),localStorage.setItem(kt,JSON.stringify(m)),!0}catch(u){return St.warn("localStorage not available"),!1}}function lt(){try{const u=localStorage.getItem(kt);if(!u)return null;let l;try{l=JSON.parse(u)}catch{return St.warn("Stored redirect data is not valid JSON, returning null"),null}return l.url&&"string"==typeof l.url?ct(l.url)?l:(St.warn("Stored redirect URL is invalid, returning null:",l.url),null):(St.warn("Stored redirect data missing url field, returning null"),null)}catch(u){return St.warn("localStorage not available"),null}}function gt(){try{localStorage.removeItem(kt)}catch(u){St.warn("localStorage not available")}}function ht(u,l){return l?`${u}#angie-prompt=${encodeURIComponent(l)}`:u}function ut(){const u=lt();return!!u&&(gt(),window.location.href=ht(u.url,u.prompt),!0)}const $t=g("oauth");function _t(){const u=lt();if(u)return gt(),void(window.location.href=ht(u.url,u.prompt));try{localStorage.setItem("angie_sidebar_state","open")}catch(u){$t.warn("localStorage not available")}setTimeout(()=>{window.toggleAngieSidebar(!0)},500)}const wt=(u,l)=>{const m=document.getElementById(A.containerId);m&&m.setAttribute("aria-hidden",l?"false":"true"),l?u.removeAttribute("tabindex"):u.setAttribute("tabindex","-1")},mt=(u,l)=>{u.postMessage({status:"success",payload:l})},ft=()=>new Promise(u=>{"loading"===document.readyState?document.addEventListener("DOMContentLoaded",u):u(null)}),Et=g("sdk");var Zt;(Zt||(Zt={})).POST_MESSAGE="postMessage";const Mt=g("sidebar");let Lt=!1;const qt="open",Ft="closed";function It(){if("undefined"==typeof window)return 370;try{const u=window.localStorage.getItem("angie_sidebar_width");if(u){const l=parseInt(u,10);if(l>=350&&l<=590)return l}}catch(u){Mt.warn("localStorage not available")}return 370}function Tt(){return"undefined"==typeof window?null:localStorage.getItem("angie_sidebar_state")}function Rt(u){try{localStorage.setItem("angie_sidebar_state",u)}catch(u){Mt.warn("localStorage not available")}}function At(u){try{localStorage.setItem("angie_sidebar_width",u.toString())}catch(u){Mt.warn("localStorage not available")}}function Pt(u){document.documentElement.style.setProperty("--angie-sidebar-width",`${u}px`)}function Ct(){!function(){if("undefined"==typeof window)return!1;const u=new URLSearchParams(window.location.search);return u.has(We)||u.has(Qe)||u.has(Ge)}()?xt(Tt()||qt):function(){xt(Ft);try{localStorage.setItem("angie_sidebar_state",Ft)}catch(u){Mt.warn("localStorage not available")}}()}function xt(u){"undefined"!=typeof window&&window.toggleAngieSidebar&&window.toggleAngieSidebar(u===qt,!0)}function Ot(){const u=document.getElementById(A.containerId);if(!u)return;let l=!1,m=0,f=0;u.addEventListener("mousedown",h=>{const y=u.getBoundingClientRect();("rtl"===document.documentElement.dir?h.clientX<=y.left+4:h.clientX>=y.right-4)&&(l=!0,m=h.clientX,f=y.width,u.classList.add("angie-resizing"),document.body.style.cursor="ew-resize",document.body.style.userSelect="none",h.preventDefault(),h.stopPropagation())}),document.addEventListener("mousemove",u=>{if(!l)return;let h;h="rtl"===document.documentElement.dir?m-u.clientX:u.clientX-m,Pt(Math.max(350,Math.min(590,f+h))),u.preventDefault(),u.stopPropagation()}),document.addEventListener("mouseup",m=>{if(l){l=!1,u.classList.remove("angie-resizing"),document.body.style.cursor="",document.body.style.userSelect="";const h=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--angie-sidebar-width"),10);At(h),_({type:E.ANGIE_SIDEBAR_RESIZED,payload:{initialWidth:f,width:h}}),m.preventDefault(),m.stopPropagation()}}),Pt(It())}function Ut(u){var l;u?.skipDefaultCss||function(){if("undefined"==typeof document||Lt)return;const u="angie-sidebar-styles";if(document.getElementById(u))return void(Lt=!0);const l=document.createElement("style");l.id=u,l.textContent="/* Angie Sidebar - CSS Variables */\n:root {\n --angie-sidebar-z-index: 1200; /* below MUI popups, elementor popups and media library modal */\n --angie-sidebar-width: 330px;\n --angie-sidebar-transition: margin 0.3s ease-in-out, transform 0.3s ease-in-out;\n /* Direction-aware transform values for sidebar positioning */\n --angie-sidebar-hide-transform: translateX(-100%); /* LTR: hide to the left */\n --angie-sidebar-show-transform: translateX(0);\n}\n\n/* RTL-specific transform values */\n[dir=\"rtl\"] {\n --angie-sidebar-hide-transform: translateX(100%); /* RTL: hide to the right */\n}\n\n/* Respect user's motion preferences */\n@media (prefers-reduced-motion: reduce) {\n :root {\n --angie-sidebar-transition: none;\n }\n}\n\n/* Apply transitions only when user is actively toggling */\nbody.angie-sidebar-transitioning {\n transition: var(--angie-sidebar-transition) !important;\n}\n\nbody.angie-sidebar-transitioning #angie-sidebar-container {\n transition: var(--angie-sidebar-transition) !important;\n}\n\n/* Layout (default) - Push content */\n@media (min-width: 768px) {\n body.angie-sidebar-active {\n padding-inline-start: var(--angie-sidebar-width) !important;\n }\n\n #angie-sidebar-container {\n position: fixed;\n top: 0;\n inset-inline-start: 0;\n width: var(--angie-sidebar-width);\n height: 100vh;\n z-index: var(--angie-sidebar-z-index) !important; /* below elementor popups and media library modal */\n background: #FCFCFC;\n transform: var(--angie-sidebar-hide-transform);\n outline: none;\n overflow: hidden;\n /* No default transition - only when transitioning */\n }\n\n /* Resize handle */\n #angie-sidebar-container::after {\n content: '';\n position: absolute;\n top: 0;\n inset-inline-end: 0;\n width: 4px;\n height: 100%;\n cursor: ew-resize;\n background: transparent;\n z-index: 1000001;\n }\n\n /* Pink border during resize */\n #angie-sidebar-container.angie-resizing {\n border-inline-end-color: #ff69b4 !important;\n border-inline-end-width: 2px !important;\n }\n\n /* Disable iframe pointer events during resize */\n #angie-sidebar-container.angie-resizing iframe#angie-iframe {\n pointer-events: none !important;\n }\n}\n\n/* Active states */\nbody.angie-sidebar-active #angie-sidebar-container {\n transform: var(--angie-sidebar-show-transform);\n}\n\n/* Studio mode - sidebar takes full width */\n@media (min-width: 768px) {\n html.angie-studio-active body.angie-sidebar-active #angie-sidebar-container {\n width: 100%;\n }\n}\n\n/* High contrast mode support */\n@media (prefers-contrast: high) {\n #angie-sidebar-container {\n border-color: #000;\n box-shadow: none;\n }\n}\n\n/* Screen reader only class */\n.angie-sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n}\n\n/* Plugin conflict resolution */\nbody.angie-sidebar-active {\n /* Reset common conflicting styles */\n box-sizing: border-box !important;\n position: relative !important;\n}\n\n#angie-sidebar-toggle {\n z-index: 99999 !important;\n}\n";const m=document.head||document.getElementsByTagName("head")[0];m.insertBefore(l,m.firstChild),Lt=!0}(),"undefined"!=typeof window&&(window.toggleAngieSidebar=(l=u?.onToggle,function(u,m){const f=document.body,h=document.getElementById(A.containerId);if(!h)return void Mt.warn("Required elements not found!");const y=f.classList.contains("angie-sidebar-active"),v=void 0!==u?u:!y;m||(f.classList.add("angie-sidebar-transitioning"),setTimeout(function(){f.classList.remove("angie-sidebar-transitioning")},300)),v?f.classList.add("angie-sidebar-active"):f.classList.remove("angie-sidebar-active"),v&&setTimeout(function(){_({type:"focusInput"})},m?0:300),l&&l(v,h,m),Rt(v?qt:Ft);const w=new CustomEvent("angieSidebarToggle",{detail:{isOpen:v,sidebar:h,skipTransition:m}});document.dispatchEvent(w),_({type:E.ANGIE_SIDEBAR_TOGGLED,payload:{state:v?"opened":"closed"}})}),window.addEventListener("message",function(u){if(u.data&&"toggleAngieSidebar"===u.data.type){const{force:l,skipTransition:m}=u.data.payload||{};window.toggleAngieSidebar&&window.toggleAngieSidebar(l,m)}}))}const Vt=g("iframe"),Dt=u=>{if(u.includes("://")||u.startsWith("//"))return!1;try{const l="https://test.com";return new URL(u,l).origin===l}catch{return!1}},Nt=async()=>{if(A.iframe?.contentWindow&&A.iframeUrlObject)try{Vt.log("Disabling navigation prevention in Angie iframe"),A.iframe.contentWindow.postMessage({type:E.ANGIE_DISABLE_NAVIGATION_PREVENTION},A.iframeUrlObject.origin),await new Promise(u=>setTimeout(u,100))}catch(u){throw Vt.error("Failed to disable navigation prevention:",u),u}else Vt.warn("Cannot disable navigation prevention: iframe or origin not available")},Kt=g("registration-queue");class Ht{queue=[];isProcessing=!1;add(u){const l={id:this.generateId(u),config:u,timestamp:Date.now(),status:"pending"};return this.queue.push(l),Kt.log(`Added server "${u.name}" to queue`),l}getAll(){return[...this.queue]}getPending(){return this.queue.filter(u=>"pending"===u.status)}updateStatus(u,l,m){const f=this.queue.find(l=>l.id===u);f&&(f.status=l,m?f.error=m:"pending"!==l&&"registered"!==l||delete f.error,Kt.log(`Updated server ${u} status to ${l}`))}async processQueue(u){if(this.isProcessing)return void Kt.log("Already processing queue");this.isProcessing=!0;const l=this.getPending();Kt.log(`Processing ${l.length} pending registrations`);try{for(const m of l)try{await u(m),this.updateStatus(m.id,"registered")}catch(u){const l=u instanceof Error?u.message:String(u);this.updateStatus(m.id,"failed",l),Kt.error(`Failed to process registration ${m.id}:`,l)}}finally{this.isProcessing=!1}}clear(){this.queue=[],Kt.log("Cleared all registrations")}resetAllToPending(){if(this.isProcessing)return Kt.log("Cannot reset to pending - processing in progress"),!1;const u=this.queue.filter(u=>"registered"===u.status).length,l=this.queue.filter(u=>"failed"===u.status).length;return this.queue.forEach(u=>{"pending"!==u.status&&(u.status="pending",delete u.error)}),Kt.log(`Reset ${u+l} registrations to pending`),!0}remove(u){const l=this.queue.findIndex(l=>l.id===u);return-1!==l&&(this.queue.splice(l,1),Kt.log(`Removed registration ${u}`),!0)}generateId(u){return`reg_${u.name}_${u.version}_${Date.now()}`}}const Bt={origin:"https://angie.elementor.com",uiTheme:"light",isRTL:!1,containerId:z,skipDefaultCss:!1,path:"angie/wp-admin"};class jt{angieDetector;clientManager;logger;registrationQueue;isInitialized=!1;instanceId;constructor(){this.instanceId=Math.random().toString(36).substring(2,8),this.logger=g({instanceId:this.instanceId}),this.logger.log("Constructor called - initializing SDK"),this.angieDetector=new k,this.registrationQueue=new Ht,this.clientManager=new T,this.logger.log("Setting up event handlers"),this.setupAngieReadyHandler(),this.setupServerInitHandler(),this.setupReRegistrationHandler(),this.logger.log("SDK initialization complete")}async loadSidebar(u){const{widgetConfig:l,...m}=u||{},f={...Bt,...m};A.containerId=f.containerId,Ut({skipDefaultCss:f.skipDefaultCss}),await(async u=>{if(window.screen.availWidth<=768)return void Vt.log("Mobile detected, skipping iframe injection");let l=document.getElementById(A.containerId);if(!l){const u=performance.now();if(Vt.log("⏱️ Waiting for sidebar container..."),await new Promise(u=>{let m=0;const f=setInterval(()=>{l=document.getElementById(A.containerId),m++,(l||m>20)&&(clearInterval(f),l&&u())},100);setTimeout(()=>{if(clearInterval(f),l)return void u();const m=new MutationObserver(()=>{l=document.getElementById(A.containerId),l&&(m.disconnect(),u())});m.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>{m.disconnect(),u()},8e3)},2e3)}),Vt.log(`⏱️ Sidebar container detection took: ${(performance.now()-u).toFixed(2)}ms`),!l)return void Vt.error("Sidebar container not found")}const{iframe:m,iframeUrlObject:f}=await(async u=>{const l=u.origin,m=new URL(u.path,l),f=m.pathname.slice(1).replace(/\//,"--")+"-"+Math.random().toString(36).substring(7);return new Promise(h=>{const y=new URL(l);y.pathname=m.pathname;const v=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";if(y.searchParams.append("colorScheme",u.uiTheme||v||"light"),y.searchParams.append("sdkVersion",u.sdkVersion),y.searchParams.append("instanceId",f),y.searchParams.append("origin",window.location.origin),u.isRTL&&y.searchParams.append("isRTL",u.isRTL?"true":"false"),"localhost"===window.location.hostname&&window.location.search.includes("debug_error")){const u=new URLSearchParams(window.location.search).get("debug_error");u&&y.searchParams.append("debug_error",u)}m.searchParams.forEach((u,l)=>{y.searchParams.set(l,u)}),y.searchParams.set("ver",(new Date).getTime().toString());const w=u.parent||document,b=w.createElement("iframe"),S={"background-color":"transparent","color-scheme":"normal",...u.css};window.addEventListener("message",async u=>{if(u.origin===y.origin)switch(u.data.type){case C.ANGIE_READY:h({iframe:b,iframeUrlObject:y});break;case C.ANGIE_LOADED:b.contentWindow?.postMessage({type:C.HOST_READY,instanceId:f},y.origin)}}),b.setAttribute("src",y.href),b.id="angie-iframe",b.setAttribute("frameborder","0"),b.setAttribute("scrolling","no"),b.setAttribute("style",Object.entries(S).map(([u,l])=>`${u}: ${l}`).join("; ")),b.setAttribute("allow","clipboard-write; clipboard-read"),u.insertCallback?u.insertCallback(b):w.body.appendChild(b)})})({origin:u.origin||"https://angie.elementor.com",path:u.path&&Dt(u.path)?u.path:"angie/wp-admin",insertCallback:u=>{Vt.log("Injecting Angie iframe into sidebar container"),u.setAttribute("title","Angie AI Assistant"),u.setAttribute("role","application"),u.setAttribute("aria-label","Angie AI Assistant Interface");const m=document.getElementById("angie-sidebar-loading");m&&(m.textContent=""),l?.appendChild(u),wt(u,!0),u.addEventListener("load",()=>{u.focus()})},css:{width:"100%",height:"100%",border:"none",outline:"none"},uiTheme:u.uiTheme,isRTL:u.isRTL,sdkVersion:"1.4.5"});A.iframe=m,A.iframeUrlObject=f,window.addEventListener("message",u=>{if(u.origin===A.iframeUrlObject?.origin)switch(u.data.type){case R.SET:window.localStorage.setItem(u.data.key,u.data.value);break;case R.GET:{const l=u.ports[0],m=window.localStorage.getItem(u.data.key);l.postMessage({value:m});break}}}),(u=>{window.addEventListener("message",async l=>{const m=l.origin===window.location.origin,f=l.origin===u.iframeUrlObject?.origin;if(m||f)switch(l?.data?.type){case E.SDK_ANGIE_ALL_SERVERS_REGISTERED:break;case E.SDK_ANGIE_READY_PING:{const u=l.ports[0];Et.log("Angie is ready",l),mt(u,{message:"Angie is ready"});break}case E.SDK_REQUEST_CLIENT_CREATION:{const m=l.data.payload;try{const f=l.ports[0],h=new MessageChannel;h.port1.onmessage=u=>{f.postMessage({success:!0,data:u.data})};const y={type:E.SDK_REQUEST_CLIENT_CREATION,payload:{success:!0,...m,clientId:`dynamic-client-${m.serverName}-${m.serverVersion}-${Date.now()}`,requestId:l.data.payload.requestId},timestamp:Date.now()};if(!u.iframe)throw new Error("Iframe not found");u.iframe.contentWindow?.postMessage(y,u.iframeUrlObject?.origin||"",[h.port2])}catch(u){Et.error(`Failed to create client for SDK server "${m.serverName}":`,u)}break}case E.SDK_TRIGGER_ANGIE:Et.log("SDK Trigger Angie received",l.data);try{const{requestId:m,prompt:f,context:h}=l.data.payload;if(!u.iframe)throw new Error("Iframe not found");u.iframe.contentWindow?.postMessage({type:E.SDK_TRIGGER_ANGIE,payload:{requestId:m,prompt:f,context:h}},u.iframeUrlObject?.origin||""),window.postMessage({type:E.SDK_TRIGGER_ANGIE_RESPONSE,payload:{success:!0,requestId:m,response:"Angie triggered successfully"}},window.location.origin)}catch(u){Et.error("Failed to trigger Angie:",u),window.postMessage({type:E.SDK_TRIGGER_ANGIE_RESPONSE,payload:{success:!1,requestId:l.data.payload?.requestId,error:u instanceof Error?u.message:"Unknown error"}},window.location.origin)}}})})(A),function({trustedOrigin:u,onOAuthParamsCleared:l}){window.addEventListener("message",m=>{if(m.origin!==u)return;const f=m.ports?.[0];switch(m.data.type){case Le:if(!f)return;st(f,{topUrl:window.location.href});break;case qe:window.location.href=m.data.payload.url;break;case He:{if(!f)return;const u=m.data.payload.url;if(!history?.replaceState)return void rt(f,{message:"URL update not supported in this browser"});try{const m=window.location.href;history.replaceState({},"",u),function(u,l){const m=new URL(u).searchParams,f=new URL(l).searchParams,h=[We,Qe,Ge];return h.some(u=>m.has(u))&&!h.some(u=>f.has(u))}(m,u)&&l?.(),st(f,{message:"URL updated successfully"})}catch(u){rt(f,{message:"URL update failed: "+(u instanceof Error?u.message:"Unknown error")})}break}case Be:if(!f)return;st(f,{isPending:"true"===new URLSearchParams(window.location.search).get(We)})}})}({trustedOrigin:A.iframeUrlObject?.origin??"",onOAuthParamsCleared:_t}),(()=>{const u={window:A.iframe,windowURL:A.iframeUrlObject};window.addEventListener("load",()=>{$t.log("OIDC: Window load event fired, forwarding OIDC state if present"),nt({targets:u,onSuccess:_t})}),nt({targets:u,onSuccess:_t})})(),new URLSearchParams(window.location.search).has("start-oauth")&&($t.log("Post-consent flow detected, checking for referrer redirect"),ut()),window.addEventListener("message",async l=>{if([window.location.origin,u.origin||"https://angie.elementor.com"].includes(l.origin))if(l?.data?.type===E.ANGIE_CHAT_TOGGLE)A.open=l.data.open,A.iframe&&wt(A.iframe,A.open);else if(l?.data?.type===E.ANGIE_STUDIO_TOGGLE){const u=l.data.isStudioOpen;if(!A.iframe)return;if(u)document.documentElement.classList.add("angie-studio-active");else{const u=It();document.documentElement.style.setProperty("--angie-sidebar-width",`${u}px`),document.documentElement.classList.remove("angie-studio-active")}}else if(l?.data?.type===E.ANGIE_NAVIGATE_TO_URL){const{url:u="",confirmed:m=!1}=l.data.payload||{};if(!m)return void Vt.log("Navigation requires user confirmation");if(!((u,l=[])=>{const m=0===l.length&&"undefined"!=typeof window?[window.location.origin]:l;if(!u.startsWith("http"))return!1;try{const l=new URL(u);return m.includes(l.origin)}catch{return!1}})(u))return void Vt.error("Navigation blocked: Invalid or unsafe URL",{url:u});await Nt(),window.location.assign(u)}else if(l?.data?.type===E.ANGIE_PAGE_RELOAD){const{confirmed:u=!1}=l.data.payload||{};if(!u)return void Vt.log("Page reload requires user confirmation");Vt.log("Page reload confirmed - disabling navigation prevention and reloading"),await Nt(),setTimeout(()=>{window.location.reload()},50)}else l?.data?.type===C.RESET_HASH&&(window.location.hash="",mt(l.ports[0],{message:"Hash reset successfully"}))})})(f),l&&_({type:"sdk-widget-config",payload:l}),this.setupPromptHashDetection()}setupReRegistrationHandler(){window.addEventListener("message",u=>{if(u.data?.type===E.SDK_ANGIE_REFRESH_PING)if(this.logger.log("Angie refresh ping received"),this.registrationQueue.resetAllToPending()){const u=this.registrationQueue.getPending().length;this.logger.log(`Successfully reset ${u} registrations, processing queue`),this.handleAngieReady()}else this.logger.log("Skipping queue reset - processing already in progress")})}setupAngieReadyHandler(){this.angieDetector.waitForReady().then(u=>{u.isReady?this.handleAngieReady():this.logger.warn("Angie not detected - servers will remain queued")}).catch(u=>{this.logger.error("Error waiting for Angie:",u)})}async handleAngieReady(){this.logger.log("Angie is ready, processing queued registrations");try{await this.registrationQueue.processQueue(async u=>{this.logger.log(`processQueue callback called for "${u.config.name}"`),await this.processRegistration(u)}),this.isInitialized=!0,this.logger.log("Initialization complete")}catch(u){this.logger.error("Error processing registration queue:",u)}}async processRegistration(u){this.logger.log(`Processing registration for server "${u.config.name}" (ID: ${u.id})`);try{this.logger.log(`Calling clientManager.requestClientCreation for "${u.config.name}"`);const l={...u,instanceId:this.instanceId};await this.clientManager.requestClientCreation(l),this.logger.log(`Successfully registered server "${u.config.name}"`)}catch(l){throw this.logger.error(`Failed to register server "${u.config.name}":`,l),l}}registerLocalServer(u){return u.type=j.LOCAL,u.transport=$.POST_MESSAGE,this.registerServer(u)}registerRemoteServer(u){return u.type=j.REMOTE,this.registerServer(u)}isLocalServerConfig(u){return u.type===j.LOCAL||!u.type&&"server"in u}isRemoteServerConfig(u){return u.type===j.REMOTE&&"url"in u}async registerServer(u){if(!u.type)return this.logger.warn("For a local server, please use registerLocalServer instead of registerServer"),void this.registerLocalServer(u);if(this.logger.log(`registerServer called for "${u.name}"`),!u.name)throw new Error("Server name is required");if(!u.description)throw new Error("Server description is required");if(this.isLocalServerConfig(u)&&!u.server)throw new Error("Server instance is required for local servers");this.logger.log(`Registering server "${u.name}"`);const l=this.registrationQueue.add(u);if(this.logger.log(`Added registration to queue: ${l.id}`),this.angieDetector.isReady())try{await this.processRegistration(l),this.registrationQueue.updateStatus(l.id,"registered"),this.logger.log(`Server "${u.name}" registered successfully`)}catch(u){const m=u instanceof Error?u.message:String(u);throw this.registrationQueue.updateStatus(l.id,"failed",m),u}else this.logger.log(`Server "${u.name}" queued until Angie is ready`)}getRegistrations(){return this.registrationQueue.getAll()}getPendingRegistrations(){return this.registrationQueue.getPending()}isAngieReady(){return this.angieDetector.isReady()}isReady(){return this.isInitialized}async waitForReady(){if(!(await this.angieDetector.waitForReady()).isReady)throw new Error("Angie is not available");for(;!this.isInitialized;)await new Promise(u=>setTimeout(u,100))}async triggerAngie(u){if(!this.isAngieReady())throw new Error("Angie is not ready. Please wait for Angie to be available before triggering.");const l=this.generateRequestId(),m=u.options?.timeout||3e4;return new Promise((f,h)=>{const y=setTimeout(()=>{h(new Error("Angie trigger request timed out"))},m),o=u=>{u.data?.type===E.SDK_TRIGGER_ANGIE_RESPONSE&&u.data?.payload?.requestId===l&&(clearTimeout(y),window.removeEventListener("message",o),f(u.data.payload))};window.addEventListener("message",o);const v={type:E.SDK_TRIGGER_ANGIE,payload:{requestId:l,prompt:u.prompt,options:u.options,context:{pageUrl:window.location.href,pageTitle:document.title,...u.context}},timestamp:Date.now()};this.logger.log(`Triggering Angie with prompt (Request ID: ${l})`),window.postMessage(v,window.location.origin)})}destroy(){this.registrationQueue.clear(),this.logger.log("SDK destroyed")}setupServerInitHandler(){window.addEventListener("message",u=>{u.data?.type===E.SDK_REQUEST_INIT_SERVER&&(this.logger.log("Server init request received"),this.handleServerInitRequest(u))})}handleServerInitRequest(u){const{clientId:l,serverId:m,instanceId:f}=u.data.payload||{};if(l&&m)if(this.logger.log(`Server init request received - Request instanceId: ${f}, This instanceId: ${this.instanceId}`),f&&f!==this.instanceId)this.logger.log(`Ignoring server init request for different instance. Request instanceId: ${f}, this instanceId: ${this.instanceId}`);else{this.logger.log(`Handling server init request for clientId: ${l}, serverId: ${m}`);try{const l=this.registrationQueue.getAll().find(u=>u.id===m);if(!l)return void this.logger.error(`No registration found for serverId: ${m}`);if("type"in l.config&&"remote"===l.config.type)return void this.logger.log("Remote server registration detected; skipping local connect");const f=u.ports[0];if(!f)return void this.logger.error("No port provided in server init request");const h=l.config.server;this.migrateInstructionsCompat(h);const y=new I(f);h.connect(y),this.logger.log(`Server "${l.config.name}" initialized successfully`)}catch(u){this.logger.error(`Error initializing server for clientId ${l}:`,u)}}else this.logger.error("Invalid server init request - missing clientId or serverId")}migrateInstructionsCompat(u){try{const l="server"in u&&u.server?u.server:u,m=l._serverInfo,f=l._instructions;m?.instructions&&!f&&(l._instructions=m.instructions,this.logger.log("Migrated instructions from serverInfo to serverOptions (backward compat)"))}catch{}}generateRequestId(){return`${this.instanceId}-${Date.now()}-${Math.random().toString(36).substring(2,8)}`}async handlePromptHash(){const u=window.location.hash;if(u.startsWith("#angie-prompt="))try{const l=u.replace("#angie-prompt=",""),m=decodeURIComponent(l);if(!m)return void this.logger.warn("Empty prompt detected in hash");this.logger.log("Detected prompt in hash:",m),await this.waitForReady();const f=await this.triggerAngie({prompt:m,context:{source:"hash-parameter",pageUrl:window.location.href,timestamp:(new Date).toISOString()}});this.logger.log("Triggered successfully from hash:",f),window.location.hash=""}catch(u){this.logger.error("Failed to trigger from hash:",u)}}setupPromptHashDetection(){this.handlePromptHash(),window.addEventListener("hashchange",()=>this.handlePromptHash())}}const Jt=g("navigation"),zt=(u,l)=>{if(p()){l.isOpen&&window.toggleAngieSidebar&&window.toggleAngieSidebar(!0);const m=_({type:"angie-route-navigation",path:u,payload:l});return m||Jt.error("Failed to post navigation message to Angie iframe"),m}return Jt.error("Angie iframe not found"),!1},Gt="angie/requiredResources",Wt="angie/modelPreferences",Qt="angie/extendedTimeout",Yt="readOnlyHint";var Xt;!function(u){u.Inline="inline",u.EndOfTurn="end-of-turn"}(Xt||(Xt={}))},"./packages/packages/libs/editor-mcp/src/angie-annotations.ts":function(u,l,m){m.r(l),m.d(l,{ANGIE_MODEL_PREFERENCES:function(){return f},ANGIE_REQUIRED_RESOURCES:function(){return h},createDefaultModelPreferences:function(){return createDefaultModelPreferences}});const f="angie/modelPreferences",h="angie/requiredResources";function createDefaultModelPreferences(){return{hints:[{name:"claude-sonnet-4-5"}],intelligencePriority:.8,speedPriority:.7}}},"./packages/packages/libs/editor-mcp/src/init.ts":function(u,l,m){m.r(l),m.d(l,{init:function(){return init},startMCPServer:function(){return startMCPServer}});var f=m("@elementor/editor-v1-adapters"),h=m("./packages/packages/libs/editor-mcp/src/mcp-registry.ts"),y=m("./packages/packages/libs/editor-mcp/src/utils/get-sdk.ts"),v=m("./packages/packages/libs/editor-mcp/src/utils/is-angie-available.ts");function init(){return(0,f.isExperimentActive)("editor_mcp")&&(0,v.isAngieAvailable)()?(0,y.getSDK)().waitForReady():Promise.resolve()}function startMCPServer(){if((0,f.isExperimentActive)("editor_mcp")&&(0,v.isAngieAvailable)()){const u=(0,y.getSDK)();u.waitForReady().then(()=>(0,h.activateMcpRegistration)(u))}return Promise.resolve()}document.addEventListener("DOMContentLoaded",()=>{startMCPServer()},{once:!0})},"./packages/packages/libs/editor-mcp/src/mcp-registry.ts":function(u,l,m){m.r(l),m.d(l,{activateMcpRegistration:function(){return activateMcpRegistration},getMCPByDomain:function(){return getMCPByDomain},registerMcp:function(){return registerMcp},toMCPTitle:function(){return toMCPTitle}});var f=m("@elementor/schema"),h=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js"),y=m("./packages/packages/libs/editor-mcp/src/angie-annotations.ts"),v=m("./packages/packages/libs/editor-mcp/src/test-utils/mock-mcp-registry.ts"),w=m("./packages/packages/libs/editor-mcp/src/utils/get-sdk.ts");const b={},S={},$=void 0!==globalThis.jest,registerMcp=(u,l)=>{const m=isAlphabet(l);b[m]=u};async function activateMcpRegistration(u,l=Object.entries(b),m=3){if(0===m)return void console.error("Failed to register MCP after 3 retries. failed entries: ",l);if(0===l.length)return;const f=[];for await(const m of l){const[l,h]=m;try{await u.registerLocalServer({title:toMCPTitle(l),name:`editor-${l}`,server:h,version:"1.0.0",description:S[l]||l})}catch{f.push(m)}}return f.length>0?activateMcpRegistration(u,f,m-1):void 0}const isAlphabet=u=>{if(!(!!u&&/^[a-z_]+$/.test(u)))throw new Error("Not alphabet");return u},toMCPTitle=u=>`Editor ${u.charAt(0).toUpperCase()+u.slice(1)}`,getMCPByDomain=(u,l)=>{const m=`editor-${isAlphabet(u)}`,x=toMCPTitle(u);if(void 0!==globalThis.jest)return(0,v.mockMcpRegistry)();b[u]||(b[u]=new h.McpServer({name:m,title:x,version:"1.0.0"},{instructions:l?.instructions}));const j=b[u],{addTool:E}=function createToolRegistry(u){function addTool(l){const m=l.outputSchema;m&&Object.assign(m,m.errors??{errors:f.z.string().optional().describe("Error message if the tool failed")});const h=l.schema?l.schema:{},toolCallback=async function(u,m){try{const f=await l.handler(l.schema?u:{},m);return{content:[{type:"text",text:"string"==typeof f?f:JSON.stringify(f)}]}}catch(u){return{isError:!0,structuredContent:{errors:u.message||"Unknown error"},content:[{type:"text",text:u.message||"Unknown error"}]}}},v={destructiveHint:l.isDestructive,readOnlyHint:!l.isDestructive&&void 0,title:l.name},w={[y.ANGIE_MODEL_PREFERENCES]:l.modelPreferences??(0,y.createDefaultModelPreferences)(),[y.ANGIE_REQUIRED_RESOURCES]:l.requiredResources??void 0};u.registerTool(l.name,{description:l.description,inputSchema:h,title:l.name,annotations:v,_meta:w},toolCallback),$&&u.sendToolListChanged()}return{addTool:addTool}}(j);return{waitForReady:()=>(0,w.getSDK)().waitForReady(),resource:async(...u)=>(await(0,w.getSDK)().waitForReady(),j.registerResource(...u)),sendResourceUpdated:(...u)=>(0,w.getSDK)().waitForReady().then(()=>j.server.sendResourceUpdated(...u)).catch(u=>{if(!u?.message?.includes("Not connected"))throw u}),mcpServer:j,addTool:E,setMCPDescription:l=>{S[u]=l},getActiveChatInfo:()=>{const u=localStorage.getItem("angie_active_chat_id");if(!u)return{expiresAt:0,sessionId:""};const l=JSON.parse(u);return{expiresAt:l.expiresAt,sessionId:l.sessionId}}}}},"./packages/packages/libs/editor-mcp/src/sampler.ts":function(u,l,m){m.r(l),m.d(l,{createSampler:function(){return createSampler}});var f=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/types.js");const h={maxTokens:1e4,modelPreferences:"openai",model:"gpt-4o"},y={type:"object",properties:{content:{type:"string",description:"Result"}},required:["content"],additionalProperties:!1},createSampler=(u,l=h)=>{const{maxTokens:m=1e3,modelPreferences:v="openai",model:w="gpt-4o"}=l;return async l=>{const h={...l.systemPrompt?{systemPrompt:l.systemPrompt}:{}},b=l.requestParams||{};return(await u.sendRequest({method:"sampling/createMessage",params:{...b,maxTokens:m,modelPreferences:{hints:[{name:v}]},metadata:{model:w,...h,structured_output:l.structuredOutput||y},messages:l.messages}},f.SamplingMessageSchema)).content}}},"./packages/packages/libs/editor-mcp/src/test-utils/mock-mcp-registry.ts":function(u,l,m){m.r(l),m.d(l,{mockMcpRegistry:function(){return mockMcpRegistry}});const f=new Proxy({},{get:()=>function mockedFn(...u){}}),mockMcpRegistry=()=>({resource:async()=>{},sendResourceUpdated:()=>{},addTool:()=>{},setMCPDescription:()=>{},getActiveChatInfo(){return{sessionId:"mock-session-id",expiresAt:Date.now()+36e5}},mcpServer:f})},"./packages/packages/libs/editor-mcp/src/utils/get-sdk.ts":function(u,l,m){m.r(l),m.d(l,{getSDK:function(){return getSDK}});var f=m("./packages/node_modules/@elementor-external/angie-sdk/dist/index.js");let h;const getSDK=()=>globalThis.__ELEMENTOR_MCP_DISABLED__?{}:(h||(h=new f.AngieMcpSdk),h)},"./packages/packages/libs/editor-mcp/src/utils/install-angie-plugin.ts":function(u,l,m){m.r(l),m.d(l,{installAngiePlugin:function(){return installAngiePlugin}});var f=m("@wordpress/api-fetch"),h=m.n(f);const y="angie",isPluginErrorResponse=u=>"object"==typeof u&&null!==u&&"code"in u&&"message"in u,installPlugin=async()=>{try{return await h()({path:"/wp/v2/plugins",method:"POST",data:{slug:y,status:"active"}})}catch(u){if(isPluginErrorResponse(u)&&"folder_exists"===u.code)return(async u=>h()({path:`/wp/v2/plugins/${u}`,method:"POST",data:{status:"active"}}))(`${y}/${y}`);throw u}},installAngiePlugin=async()=>{try{return await installPlugin(),{success:!0}}catch(u){return isPluginErrorResponse(u)?{success:!1,error:u.message,code:u.code}:{success:!1,error:"Unknown error occurred"}}}},"./packages/packages/libs/editor-mcp/src/utils/is-angie-available.ts":function(u,l,m){m.r(l),m.d(l,{isAngieAvailable:function(){return isAngieAvailable}});var f=m("./packages/node_modules/@elementor-external/angie-sdk/dist/index.js");const isAngieAvailable=()=>!!(0,f.getAngieIframe)()},"./packages/packages/libs/editor-mcp/src/utils/is-angie-sidebar-open.ts":function(u,l,m){m.r(l),m.d(l,{isAngieSidebarOpen:function(){return isAngieSidebarOpen}});var f=m("./packages/node_modules/@elementor-external/angie-sdk/dist/index.js");const isAngieSidebarOpen=()=>(0,f.getAngieSidebarSavedState)()===f.ANGIE_SIDEBAR_STATE_OPEN},"./packages/packages/libs/editor-mcp/src/utils/prompt-builder.ts":function(u,l,m){m.r(l),m.d(l,{toolPrompts:function(){return toolPrompts}});class ToolPrompts{_description="";_parameters={};_examples=[];_furtherInstructions=[];constructor(u){this.name=u}description(u){return void 0===u?this._description:(this._description=u,this)}parameter(u,l){return void 0===l?this._parameters[u]:(this._parameters[u]=`**${u}**:\n${l}`,this)}instruction(u){return this._furtherInstructions.push(u),this}example(u){return this._examples.push(u),this}get examples(){return this._examples.join("\n\n")}prompt(){return`# ${this.name}\n# Description\n${this._description}\n\n${this._parameters.length?"# Parameters":""}\n${Object.values(this._parameters).join("\n\n")}\n\n${this._examples.length?"# Examples":""}\n${this.examples}\n\n${this._furtherInstructions.length?"# Further Instructions":""}\n${this._furtherInstructions.join("\n\n")}\n`.trim()}}const toolPrompts=u=>new ToolPrompts(u)},"./packages/packages/libs/editor-mcp/src/utils/redirect-to-app-admin.ts":function(u,l,m){m.r(l),m.d(l,{redirectToAppAdmin:function(){return redirectToAppAdmin}});var f=m("./packages/node_modules/@elementor-external/angie-sdk/dist/index.js");const redirectToAppAdmin=u=>{(0,f.setReferrerRedirect)(window.location.href,u)&&(window.location.href="/wp-admin/admin.php?page=angie-app")}},"./packages/packages/libs/editor-mcp/src/utils/redirect-to-installation.ts":function(u,l,m){m.r(l),m.d(l,{redirectToInstallation:function(){return redirectToInstallation}});var f=m("./packages/node_modules/@elementor-external/angie-sdk/dist/index.js");const redirectToInstallation=u=>{(0,f.setReferrerRedirect)(window.location.href,u)&&(window.location.href="/wp-admin/plugin-install.php?s=angie&tab=search&type=term")}},"./packages/packages/libs/editor-mcp/src/utils/send-prompt-to-angie.ts":function(u,l,m){m.r(l),m.d(l,{sendPromptToAngie:function(){return sendPromptToAngie}});var f=m("./packages/node_modules/@elementor-external/angie-sdk/dist/index.js");const sendPromptToAngie=u=>{const l=(0,f.getAngieIframe)();l&&((0,f.toggleAngieSidebar)(l,!0),u&&(window.location.hash=`angie-prompt=${encodeURIComponent(u)}`))}},"@elementor/editor-v1-adapters":function(u){u.exports=window.elementorV2.editorV1Adapters},"@elementor/schema":function(u){u.exports=window.elementorV2.schema},"@wordpress/api-fetch":function(u){u.exports=window.wp.apiFetch}},l={};function __webpack_require__(m){var f=l[m];if(void 0!==f)return f.exports;var h=l[m]={exports:{}};return u[m](h,h.exports,__webpack_require__),h.exports}__webpack_require__.n=function(u){var l=u&&u.__esModule?function(){return u.default}:function(){return u};return __webpack_require__.d(l,{a:l}),l},__webpack_require__.d=function(u,l){for(var m in l)__webpack_require__.o(l,m)&&!__webpack_require__.o(u,m)&&Object.defineProperty(u,m,{enumerable:!0,get:l[m]})},__webpack_require__.o=function(u,l){return Object.prototype.hasOwnProperty.call(u,l)},__webpack_require__.r=function(u){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(u,"__esModule",{value:!0})};var m={};!function(){__webpack_require__.r(m),__webpack_require__.d(m,{ANGIE_MODEL_PREFERENCES:function(){return $.ANGIE_MODEL_PREFERENCES},McpServer:function(){return l.McpServer},ResourceTemplate:function(){return l.ResourceTemplate},SamplingMessageSchema:function(){return f.SamplingMessageSchema},activateMcpRegistration:function(){return w.activateMcpRegistration},createSampler:function(){return b.createSampler},getAngieSdk:function(){return getAngieSdk},getMCPByDomain:function(){return w.getMCPByDomain},init:function(){return h.init},installAngiePlugin:function(){return R.installAngiePlugin},isAngieAvailable:function(){return y.isAngieAvailable},isAngieSidebarOpen:function(){return v.isAngieSidebarOpen},redirectToAppAdmin:function(){return E.redirectToAppAdmin},redirectToInstallation:function(){return j.redirectToInstallation},registerMcp:function(){return w.registerMcp},sendPromptToAngie:function(){return x.sendPromptToAngie},toMCPTitle:function(){return w.toMCPTitle},toolPrompts:function(){return S.toolPrompts}});var u=__webpack_require__("./packages/packages/libs/editor-mcp/src/utils/get-sdk.ts"),l=__webpack_require__("./node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js"),f=__webpack_require__("./node_modules/@modelcontextprotocol/sdk/dist/esm/types.js"),h=__webpack_require__("./packages/packages/libs/editor-mcp/src/init.ts"),y=__webpack_require__("./packages/packages/libs/editor-mcp/src/utils/is-angie-available.ts"),v=__webpack_require__("./packages/packages/libs/editor-mcp/src/utils/is-angie-sidebar-open.ts"),w=__webpack_require__("./packages/packages/libs/editor-mcp/src/mcp-registry.ts"),b=__webpack_require__("./packages/packages/libs/editor-mcp/src/sampler.ts"),S=__webpack_require__("./packages/packages/libs/editor-mcp/src/utils/prompt-builder.ts"),$=__webpack_require__("./packages/packages/libs/editor-mcp/src/angie-annotations.ts"),x=__webpack_require__("./packages/packages/libs/editor-mcp/src/utils/send-prompt-to-angie.ts"),j=__webpack_require__("./packages/packages/libs/editor-mcp/src/utils/redirect-to-installation.ts"),E=__webpack_require__("./packages/packages/libs/editor-mcp/src/utils/redirect-to-app-admin.ts"),R=__webpack_require__("./packages/packages/libs/editor-mcp/src/utils/install-angie-plugin.ts");const getAngieSdk=()=>(0,u.getSDK)()}(),(window.elementorV2=window.elementorV2||{}).editorMcp=m}(),window.elementorV2.editorMcp?.init?.();
//# sourceMappingURL=editor-mcp.js.map